{"id":50127557,"url":"https://github.com/devforth/adminforth-auto-remove","last_synced_at":"2026-05-23T20:35:01.944Z","repository":{"id":337811593,"uuid":"1154460263","full_name":"devforth/adminforth-auto-remove","owner":"devforth","description":null,"archived":false,"fork":false,"pushed_at":"2026-04-23T12:35:24.000Z","size":189,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-23T14:07:20.443Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devforth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-10T12:15:32.000Z","updated_at":"2026-04-23T12:34:44.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/devforth/adminforth-auto-remove","commit_stats":null,"previous_names":["devforth/adminforth-auto-remove"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/devforth/adminforth-auto-remove","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devforth%2Fadminforth-auto-remove","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devforth%2Fadminforth-auto-remove/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devforth%2Fadminforth-auto-remove/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devforth%2Fadminforth-auto-remove/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devforth","download_url":"https://codeload.github.com/devforth/adminforth-auto-remove/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devforth%2Fadminforth-auto-remove/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33412082,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-23T18:09:33.147Z","status":"ssl_error","status_checked_at":"2026-05-23T18:09:31.380Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-23T20:35:01.367Z","updated_at":"2026-05-23T20:35:01.939Z","avatar_url":"https://github.com/devforth.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AdminForth Auto Remove Plugin\n\n\u003cimg src=\"https://img.shields.io/badge/License-MIT-blue.svg\" alt=\"License: MIT\" /\u003e \u003cimg src=\"https://woodpecker.devforth.io/api/badges/3848/status.svg\" alt=\"Build Status\" /\u003e \u003ca href=\"https://www.npmjs.com/package/@adminforth/auto-remove\"\u003e\u003cimg src=\"https://img.shields.io/npm/dm/@adminforth/auto-remove\" alt=\"npm downloads\" /\u003e\u003c/a\u003e \u003ca href=\"https://www.npmjs.com/package/@adminforth/auto-remove\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@adminforth/auto-remove\" alt=\"npm version\" /\u003e\u003c/a\u003e\n\n[![Ask AI](https://tluma.ai/badge)](https://tluma.ai/ask-ai/devforth/adminforth)\n\nThis plugin removes records from resources based on **count-based** or **time-based** rules.\n\n## Features\n\n- Remove old records automatically from AdminForth resources.\n- Support both count-based and time-based cleanup rules.\n- Keep logs, demo data, and temporary entities under control.\n- Run cleanup on a configurable schedule.\n\n## Documentation\n\nFull setup and configuration guide:\n\n[AdminForth Auto Remove Documentation](https://adminforth.dev/docs/tutorial/Plugins/auto-remove/)\n\n## About AdminForth\n\nAdminForth is an open-source, agent-first admin framework for building robust admin panels and back-office applications faster.\n\n## Related links\n\n- [AdminForth website](https://adminforth.dev)\n- [npm package](https://www.npmjs.com/package/@adminforth/auto-remove)\n- [More AdminForth plugins](https://adminforth.dev/docs/tutorial/ListOfPlugins/)\n- [Built by DevForth](https://devforth.io)\n\nIt is designed for cleaning up:\n\n* old records\n* logs\n* demo/test data\n* temporary entities\n\n---\n\n## Installation\n\nTo install the plugin:\n\n```ts\nnpm install @adminforth/auto-remove\n```\n\nImport it into your resource:\n```ts\nimport AutoRemovePlugin from '../../plugins/adminforth-auto-remove/index.js';\n```\n\n## Plugin Options\n\n```ts\nexport interface PluginOptions {\n createdAtField: string;\n\n  /**\n   * - count-based: Delete items \u003e keepAtLeast\n   * - time-based: Delete age \u003e deleteOlderThan\n   */\n  mode: AutoRemoveMode;\n\n  /**\n   * for count-based mode (100', '1k', '10k', '1m')\n   */\n  keepAtLeast?: HumanNumber;\n\n  /**\n   * Minimum number of items to always keep in count-based mode.\n   * This acts as a safety threshold together with `keepAtLeast`.\n   * Example formats: '100', '1k', '10k', '1m'.\n   * \n   * Validation ensures that minItemsKeep \u003c= keepAtLeast. \n  */\n  minItemsKeep?: HumanNumber;\n\n  /**\n   * Max age of item for time-based mode ('1d', '7d', '1mo', '1y')\n   */\n  deleteOlderThan?: HumanDuration;\n\n  /**\n   * Interval for running cleanup (e.g. '1h', '1d')\n   * Default '1d'\n   */\n  interval?: HumanDuration;\n}\n```\n---\n\n## Usage\nTo use the plugin, add it to your resource file. Here's an example:\n\nfor count-based mode\n```ts\nnew AutoRemovePlugin({\n        createdAtField: 'created_at',   \n        mode: 'count-based',            \n        keepAtLeast: '200',                  \n        interval: '1mo',                  \n        minItemsKeep: '180',       \n      }),\n```\n\nfor time-based mode\n```ts\nnew AutoRemovePlugin({\n        createdAtField: 'created_at',\n        mode: 'time-based',\n        deleteOlderThan: '3mo',\n        interval: '1mo',  \n      }),\n```\n\n---\n\n## Result\nAfter running **AutoRemovePlugin**, old or excess records are deleted automatically:\n\n- **Count-based mode:** keeps the newest `keepAtLeast` records, deletes older ones.  \n  Example: `keepAtLeast = 500` → table with 650 records deletes 150 oldest.\n\n- **Time-based mode:** deletes records older than `deleteOlderThan`.  \n  Example: `deleteOlderThan = '7d'` → removes records older than 7 days.\n\n- **Manual cleanup:** `POST /plugin/{pluginInstanceId}/cleanup`, returns `{ \"ok\": true }`.\n\nLogs show how many records were removed per run.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevforth%2Fadminforth-auto-remove","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevforth%2Fadminforth-auto-remove","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevforth%2Fadminforth-auto-remove/lists"}