{"_id":"emdash-document-revisions","name":"emdash-document-revisions","dist-tags":{"latest":"0.2.0"},"versions":{"0.2.0":{"name":"emdash-document-revisions","version":"0.2.0","description":"Document management for EmDash: versioned files stored privately in R2 and served through permission-checked permalinks.","keywords":["emdash","emdash-plugin","cloudflare-workers","r2","document-management","revisions","wp-document-revisions"],"homepage":"https://github.com/benbalter/emdash-document-revisions#readme","bugs":{"url":"https://github.com/benbalter/emdash-document-revisions/issues"},"repository":{"type":"git","url":"git+https://github.com/benbalter/emdash-document-revisions.git","directory":"plugin"},"license":"MIT","author":{"name":"Ben Balter"},"type":"module","main":"src/index.ts","exports":{".":"./src/index.ts","./admin":"./src/admin.tsx","./visibility":"./src/visibility.ts","./routes/document.ts":"./src/routes/document.ts","./routes/files.ts":"./src/routes/files.ts","./routes/api.ts":"./src/routes/api.ts","./worker":"./src/worker.ts","./astro":"./src/astro/index.ts","./astro/DocumentList.astro":"./src/astro/DocumentList.astro","./middleware.ts":"./src/middleware.ts"},"engines":{"node":">=22.16"},"scripts":{"typecheck":"tsc --noEmit"},"peerDependencies":{"astro":">=6","emdash":">=1.1.0","react":"^19.0.0"},"devDependencies":{"@cloudflare/workers-types":"^5.20260820.1","@emdash-cms/admin":"^1.1.0","@types/react":"^19.0.0","astro":"^7.3.2","emdash":"^1.1.0","react":"19.3.0","typescript":"^6.0.0"},"gitHead":"ca1346e92809de6c40c8a22723f988a4b4b0365d","_id":"emdash-document-revisions@0.2.0","_nodeVersion":"24.21.0","_npmVersion":"11.19.0","dist":{"integrity":"sha512-ZgtRCEqr1FwJdzGENISNRGaStdBNttmNxz2SQS26x0NeCKwxK2iilYIrRqZ+qiCKCyrxaLdyyMTvEOkzJJUQ3Q==","shasum":"4fd93044e795cc683115b666b38abc8a8c07f538","tarball":"https://registry.npmjs.org/emdash-document-revisions/-/emdash-document-revisions-0.2.0.tgz","fileCount":24,"unpackedSize":146467,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCDk7/byS0c13P122XGauC8vtoKolkL8VgSuIX5WgscjQIgSaGoC9ClimmjU78kLCEP+76tmzCpJYSL/BUjlRK1t/k="}]},"_npmUser":{"name":"benbalter","email":"ben@balter.com"},"directories":{},"maintainers":[{"name":"benbalter","email":"ben@balter.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/emdash-document-revisions_0.2.0_1790970525065_0.6491227929790786"},"_hasShrinkwrap":false}},"time":{"created":"2026-10-02T19:48:44.853Z","0.2.0":"2026-10-02T19:48:45.214Z","modified":"2026-10-02T19:48:45.355Z"},"maintainers":[{"name":"benbalter","email":"ben@balter.com"}],"description":"Document management for EmDash: versioned files stored privately in R2 and served through permission-checked permalinks.","homepage":"https://github.com/benbalter/emdash-document-revisions#readme","keywords":["emdash","emdash-plugin","cloudflare-workers","r2","document-management","revisions","wp-document-revisions"],"repository":{"type":"git","url":"git+https://github.com/benbalter/emdash-document-revisions.git","directory":"plugin"},"author":{"name":"Ben Balter"},"bugs":{"url":"https://github.com/benbalter/emdash-document-revisions/issues"},"license":"MIT","readme":"# emdash-document-revisions\n\nDocument management for [EmDash](https://github.com/emdash-cms/emdash): each document is a series of uploaded files with a revision log. Files are stored privately in R2 and served only through permission-checked permalinks.\n\nA TypeScript port of [WP Document Revisions](https://github.com/wp-document-revisions/wp-document-revisions) for EmDash on Cloudflare Workers, with an importer that brings WordPress libraries over, history included.\n\n> **Status: early.** Tested end to end against EmDash 1.1 in Cloudflare's local runtime, but not yet on a production deployment. APIs may change before 1.0, and it relies on a few EmDash internals that an EmDash upgrade could move ([details](https://github.com/benbalter/emdash-document-revisions#upgrading)). Not affiliated with EmDash or Cloudflare.\n\n**Full documentation is in the [project README](https://github.com/benbalter/emdash-document-revisions#readme)**: features, permissions, configuration, deployment, troubleshooting and the WordPress importer. Internals and platform constraints are in [docs/architecture.md](https://github.com/benbalter/emdash-document-revisions/blob/main/docs/architecture.md).\n\n## Install\n\nRequires an EmDash 1.1 site on Cloudflare Workers with R2.\n\n1. Register both halves in `astro.config.mjs`. A native EmDash plugin can't inject site routes, so the permalink and API routes come from a separate Astro integration:\n   ```js\n   import { documentRevisions, documentRevisionsRoutes } from \"emdash-document-revisions\";\n\n   integrations: [\n     emdash({ /* database, storage, … */ plugins: [documentRevisions()] }),\n     documentRevisionsRoutes(),\n   ],\n   ```\n2. Add a `DOCUMENTS` R2 bucket in `wrangler.jsonc`. It must be a **different bucket** from EmDash's media bucket, which EmDash serves publicly by key.\n3. Add the `documents` collection to your site: from the seed on a new site, or with [`scripts/setup-collection.mjs`](https://github.com/benbalter/emdash-document-revisions/blob/main/scripts/setup-collection.mjs) from the repository on an existing one. See [install step 3](https://github.com/benbalter/emdash-document-revisions#install-into-an-emdash-site).\n4. If your templates list documents, filter them through `filterPublicDocuments()` from `emdash-document-revisions/visibility` (or use the Document list component). Otherwise private and password-protected titles appear publicly.\n\nText extraction, password throttling and the other optional bindings are covered in the [configuration reference](https://github.com/benbalter/emdash-document-revisions#configuration-reference).\n\nThis is a native plugin with full access to your site, its database and secrets. Install it only from a source you trust. [Why it isn't sandboxed](https://github.com/benbalter/emdash-document-revisions/blob/main/docs/architecture.md#why-a-native-plugin-not-a-sandboxed-one).\n\n## License\n\n[MIT](https://github.com/benbalter/emdash-document-revisions/blob/main/LICENSE)\n","readmeFilename":"README.md","_rev":"1-a4351bc219b4ffa2288a27e7dba2f045"}