{"_id":"@anyday/sanity-plugin-recycle-bin","name":"@anyday/sanity-plugin-recycle-bin","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@anyday/sanity-plugin-recycle-bin","version":"1.0.0","description":"Sanity plugin providing soft-delete functionality with 30-day retention and document restoration","keywords":["sanity","sanity-plugin","recycle-bin","soft-delete","trash","document-recovery"],"license":"MIT","author":{"name":"Anyday Agency"},"type":"module","exports":{".":{"source":"./src/index.ts","import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js"},"./package.json":"./package.json"},"main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","sideEffects":false,"scripts":{"build":"plugin-kit verify-package --silent && pkg-utils build --strict --check --clean","watch":"pkg-utils watch --strict","link-watch":"plugin-kit link-watch","prepublishOnly":"npm run build","format":"prettier --write .","format:check":"prettier --check .","typecheck":"tsc --noEmit","prepare":"husky"},"peerDependencies":{"@sanity/icons":"^3","@sanity/ui":"^3","react":"^18 || ^19","react-dom":"^18 || ^19","sanity":"^5"},"devDependencies":{"@sanity/icons":"^3","@sanity/ui":"^3","@commitlint/cli":"^20.4.3","@commitlint/config-conventional":"^20.4.3","@sanity/pkg-utils":"^10.4.8","@sanity/plugin-kit":"^4.0.20","@sanity/semantic-release-preset":"^6.0.0","@types/react":"^19.1","eslint":"^8.57.0","husky":"^9.1.7","lint-staged":"^16.3.3","react":"^19.2.4","react-dom":"^19.2.4","sanity":"^5.7.0","styled-components":"^6.1.18","tsup":"^8.4.0","typescript":"^5.8.0"},"engines":{"node":">=18"},"browserslist":"extends @sanity/browserslist-config","publishConfig":{"access":"public","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js"},"./package.json":"./package.json"}},"sanityPlugin":{"verifyPackage":{"module":false,"sanityV2Json":false,"eslintImports":false}},"repository":{"type":"git","url":"git+https://github.com/anydayagency/sanity-recyclebin.git"},"bugs":{"url":"https://github.com/anydayagency/sanity-recyclebin/issues"},"homepage":"https://github.com/anydayagency/sanity-recyclebin#readme","_id":"@anyday/sanity-plugin-recycle-bin@1.0.0","gitHead":"7e191efe725b0ae38314d8abfb1eb26909933fb9","_nodeVersion":"22.18.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-WUrxe9LZXpByH69j0I5ao9ZxSNo5zg3anxrmIkwYPj4jayHGIh4r+wGoU7VjdwaFQALj6YbGhjpllr7fz7Xqiw==","shasum":"f56a1334eeeaae72ccb774090fec4eca4b0bcf49","tarball":"https://registry.npmjs.org/@anyday/sanity-plugin-recycle-bin/-/sanity-plugin-recycle-bin-1.0.0.tgz","fileCount":28,"unpackedSize":298267,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDlvkRMdaR21U8gRIrbAjNpegTrQl2yYqcOLsl0Xv50+gIhAOEyiFMgpJ5s2XK58LtNQ3JwEPBx9o3m8A4dBQsilgxs"}]},"_npmUser":{"name":"stephen-anyday","email":"stephen.adedokun@anyday.inc"},"directories":{},"maintainers":[{"name":"stephen-anyday","email":"stephen.adedokun@anyday.inc"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sanity-plugin-recycle-bin_1.0.0_1773256735021_0.8901347382045208"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-11T19:18:54.902Z","1.0.0":"2026-03-11T19:18:55.188Z","modified":"2026-03-11T19:18:55.466Z"},"maintainers":[{"name":"stephen-anyday","email":"stephen.adedokun@anyday.inc"}],"description":"Sanity plugin providing soft-delete functionality with 30-day retention and document restoration","homepage":"https://github.com/anydayagency/sanity-recyclebin#readme","keywords":["sanity","sanity-plugin","recycle-bin","soft-delete","trash","document-recovery"],"repository":{"type":"git","url":"git+https://github.com/anydayagency/sanity-recyclebin.git"},"author":{"name":"Anyday Agency"},"bugs":{"url":"https://github.com/anydayagency/sanity-recyclebin/issues"},"license":"MIT","readme":"# Sanity Plugin Recyle bin\n\nA Sanity plugin that provides soft-delete functionality with configurable retention, allowing users to restore deleted documents from a Recycle Bin tool.\n\n## Features\n\n- **Soft delete** - Documents are moved to Recycle Bin instead of being permanently deleted\n- **Configurable retention** - Default 30-day retention period before auto-purge\n- **Document restoration** - Restore deleted documents with missing reference handling\n- **Multi-site support** - Filter by workspace/siteId in admin workspace\n- **Auto-purge** - Expired documents are automatically removed\n\n## Installation\n\n```bash\nnpm install @anyday/sanity-plugin-recycle-bin @sanity/icons @sanity/ui\n```\n\n> **Note:** `@sanity/icons` and `@sanity/ui` are peer dependencies. If you're using pnpm, they must be declared as direct dependencies in your project since pnpm does not hoist transitive dependencies.\n\n## Usage\n\nAdd the plugin to your Sanity configuration:\n\n```typescript\nimport {defineConfig} from 'sanity'\nimport {recycleBin} from '@anyday/sanity-plugin-recycle-bin'\n\nexport default defineConfig({\n  // ... your config\n  plugins: [\n    recycleBin({\n      retentionDays: 30, // optional, default is 30\n      deletableTypes: ['page', 'post', 'article'], // optional, limit to specific types\n      excludeTypes: ['siteSettings', 'themeSettings'], // optional, exclude specific types\n    }),\n  ],\n})\n```\n\n## Configuration Options\n\n| Option           | Type       | Default     | Description                           |\n| ---------------- | ---------- | ----------- | ------------------------------------- |\n| `retentionDays`  | `number`   | `30`        | Days to retain deleted documents      |\n| `deletableTypes` | `string[]` | `undefined` | Only these types will use soft delete |\n| `excludeTypes`   | `string[]` | `undefined` | These types will use hard delete      |\n\n## How It Works\n\n1. When a document is deleted, it's archived as a `recycleBin.deletedDocument`\n2. The archive stores the complete document snapshot and metadata\n3. Users can restore documents from the Recycle Bin tool\n4. When restoring, missing references are detected and nullified\n5. Documents are auto-purged after the retention period expires\n\n## Multi-Site Support\n\nIn a multi-site setup, the plugin respects the `siteId` field:\n\n- **Regular workspaces** - Only see deleted documents for their site\n- **Admin workspace** - Sees all deleted documents across all sites\n\n## License\n\nMIT\n\n## License\n\n[MIT](LICENSE) © Anyday Agency\n\n## Develop & test\n\nThis plugin uses [@sanity/plugin-kit](https://github.com/sanity-io/plugin-kit)\nwith default configuration for build & watch scripts.\n\nSee [Testing a plugin in Sanity Studio](https://github.com/sanity-io/plugin-kit#testing-a-plugin-in-sanity-studio)\non how to run this plugin with hotreload in the studio.\n\n### Release new version\n\nRun [\"CI & Release\" workflow](https://github.com/anydayagency/sanity-recyclebin/actions/workflows/main.yml).\nMake sure to select the main branch and check \"Release new version\".\n\nSemantic release will only release on configured branches, so it is safe to run release on any branch.\n","readmeFilename":"README.md","_rev":"1-6cd97ecd1a1c5be5e938b04b41d4b90f"}