{"_id":"@alistigo/list-document","_rev":"3-23b5a555341e15af260c26c61369bfb4","name":"@alistigo/list-document","dist-tags":{"latest":"0.5.0"},"versions":{"0.4.0":{"name":"@alistigo/list-document","version":"0.4.0","keywords":["alistigo","list","document","json-schema","json-ld","typescript"],"author":{"name":"Mikael Labrut","email":"contact@alistigo.com"},"license":"MIT","_id":"@alistigo/list-document@0.4.0","maintainers":[{"name":"mikael.labrut","email":"npm@alistigo.com"}],"homepage":"https://github.com/alistigo/holos/tree/main/packages/list-document#readme","bugs":{"url":"https://github.com/alistigo/holos/issues"},"dist":{"shasum":"8ace3258d382c5075d286b74583872e7d9496f6f","tarball":"https://registry.npmjs.org/@alistigo/list-document/-/list-document-0.4.0.tgz","fileCount":64,"integrity":"sha512-gDE+7GCZQIJvb+Ydz2vyV0XM2NgA3QdgtlESHgEt5cUVj2YvNLAqslsr+pKe9GywQZil8xAKKCWN+HIOT2FCwQ==","signatures":[{"sig":"MEYCIQCeMih4q4u5BTeNZ9Kkzd7WOvUMU7KLqRGVz5KVXpN6MAIhALM4clvdAxaoMawdkjWQx26tUtE9sZ3rjbiQT3q50OQS","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":169731},"main":"./dist/index.js","type":"module","_from":"file:alistigo-list-document-0.4.0.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./schemas/document.json":"./src/schemas/document.json"},"private":false,"_npmUser":{"name":"mikael.labrut","email":"npm@alistigo.com"},"alistigo":{"type":"document"},"_resolved":"/tmp/b281cf2bf831349a621dd26d8c573651/alistigo-list-document-0.4.0.tgz","_integrity":"sha512-gDE+7GCZQIJvb+Ydz2vyV0XM2NgA3QdgtlESHgEt5cUVj2YvNLAqslsr+pKe9GywQZil8xAKKCWN+HIOT2FCwQ==","repository":{"url":"git+https://github.com/alistigo/holos.git","type":"git","directory":"packages/list-document"},"_npmVersion":"11.16.0","description":"Specification, JSON schemas, and TypeScript types for the Alistigo list document format.","directories":{},"_nodeVersion":"24.18.0","dependencies":{"ajv":"^8.17.0","schema-dts":"^2.0.0","ajv-formats":"^3.0.1","@alistigo/logger":"0.3.2","@alistigo/list-domain":"0.3.2","@alistigo/core-document":"0.2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/list-document_0.4.0_1788428333434_0.0339552002330572","host":"s3://npm-registry-packages-npm-production"}},"0.4.1":{"name":"@alistigo/list-document","version":"0.4.1","keywords":["alistigo","list","document","json-schema","json-ld","typescript"],"author":{"name":"Mikael Labrut","email":"contact@alistigo.com"},"license":"MIT","_id":"@alistigo/list-document@0.4.1","maintainers":[{"name":"mikael.labrut","email":"npm@alistigo.com"}],"homepage":"https://github.com/alistigo/holos/tree/main/packages/list-document#readme","bugs":{"url":"https://github.com/alistigo/holos/issues"},"dist":{"shasum":"7d13be061357d87869b2ff3a404d166def1665fb","tarball":"https://registry.npmjs.org/@alistigo/list-document/-/list-document-0.4.1.tgz","fileCount":64,"integrity":"sha512-EtUkWU0a29Qn+Wj9QYJBz8PRBD/TR0RxnB1EDQgrFNRgWbpLugr8VAEGZMsjEJR64xs2rRoCGMlY82Iml1yZlw==","signatures":[{"sig":"MEUCIBfqKL3BhR4wSpjT1bQZtcj8twQoShoD0B6afp9PWyXrAiEAgFPMocoAoFu4cXWEEZjyqsQHzNwO+TNGg/UMMv1K6jg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEYCIQCKGu+UwVe5yE/urUp7qe2enQrvMBeZtZggQivldzBAGgIhAJ0sf7DAWjyHT/Nz0Ewts1abHIEzsSy0HzGFTfpK9+ZQ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":169731},"main":"./dist/index.js","type":"module","_from":"file:alistigo-list-document-0.4.1.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./schemas/document.json":"./src/schemas/document.json"},"private":false,"_npmUser":{"name":"mikael.labrut","email":"npm@alistigo.com"},"alistigo":{"type":"document"},"_resolved":"/tmp/c177fb31d74d6388a74bf53d595c372c/alistigo-list-document-0.4.1.tgz","_integrity":"sha512-EtUkWU0a29Qn+Wj9QYJBz8PRBD/TR0RxnB1EDQgrFNRgWbpLugr8VAEGZMsjEJR64xs2rRoCGMlY82Iml1yZlw==","repository":{"url":"git+https://github.com/alistigo/holos.git","type":"git","directory":"packages/list-document"},"_npmVersion":"11.16.0","description":"Specification, JSON schemas, and TypeScript types for the Alistigo list document format.","directories":{},"_nodeVersion":"24.18.0","dependencies":{"ajv":"^8.17.0","schema-dts":"^2.0.0","ajv-formats":"^3.0.1","@alistigo/logger":"0.3.3","@alistigo/list-domain":"0.3.3","@alistigo/core-document":"0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/list-document_0.4.1_1789389216712_0.11476459662862748","host":"s3://npm-registry-packages-npm-production"}},"0.5.0":{"_id":"@alistigo/list-document@0.5.0","bugs":{"url":"https://github.com/alistigo/holos/issues"},"dist":{"shasum":"4443f35e59793b6188fd9f8d834c420006fcef91","tarball":"https://registry.npmjs.org/@alistigo/list-document/-/list-document-0.5.0.tgz","fileCount":64,"integrity":"sha512-7W+kTa+RGXsd2MqARptKrDHH84iWnDChKxxGkbjHG8uHBmSU7l//kQDf7HwmxhRAYjQQ8Ov2A51fNn9ENQs7qA==","signatures":[{"sig":"MEUCIE7Rn+UuMsyxXbUHDckudWCHJHPJroDwiBmNMAGC7SraAiEA7rMh1QpDcP5dz7Q4FFUKIRqj/9ibxLPGnw+WX2aT7hU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDTM02y+j3Hp7ov7mq7yDpcNRWK00Obi7HwGX5kUz7CqQIhAP/hMHNo0isWSVdjLdX+hw+hTVbF8qUvcntkVV6zDKWY"}],"unpackedSize":169707},"main":"./dist/index.js","name":"@alistigo/list-document","type":"module","_from":"file:alistigo-list-document-0.5.0.tgz","types":"./dist/index.d.ts","author":{"name":"Mikael Labrut","email":"contact@alistigo.com"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./schemas/document.json":"./src/schemas/document.json"},"license":"MIT","private":false,"version":"0.5.0","_npmUser":{"name":"mikael.labrut","email":"npm@alistigo.com"},"alistigo":{"type":"document"},"homepage":"https://github.com/alistigo/holos/tree/main/packages/list-document#readme","keywords":["alistigo","list","document","json-schema","json-ld","typescript"],"_resolved":"/tmp/3a5509e932ec2fe0aaca40f7f56aaead/alistigo-list-document-0.5.0.tgz","_integrity":"sha512-7W+kTa+RGXsd2MqARptKrDHH84iWnDChKxxGkbjHG8uHBmSU7l//kQDf7HwmxhRAYjQQ8Ov2A51fNn9ENQs7qA==","repository":{"url":"git+https://github.com/alistigo/holos.git","type":"git","directory":"packages/list-document"},"_npmVersion":"11.16.0","description":"Specification, JSON schemas, and TypeScript types for the Alistigo list document format.","directories":{},"maintainers":[{"name":"mikael.labrut","email":"npm@alistigo.com"}],"_nodeVersion":"24.18.0","dependencies":{"ajv":"^8.17.0","schema-dts":"^2.0.0","ajv-formats":"^3.0.1","@alistigo/logger":"0.4.0","@alistigo/list-domain":"0.4.0","@alistigo/core-document":"0.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/list-document_0.5.0_1789474750384_0.1880802989561554"}}},"time":{"created":"2026-09-03T09:38:53.226Z","modified":"2026-09-15T12:19:10.658Z","0.4.0":"2026-09-03T09:38:53.578Z","0.4.1":"2026-09-14T12:33:36.844Z","0.5.0":"2026-09-15T12:19:10.466Z"},"bugs":{"url":"https://github.com/alistigo/holos/issues"},"author":{"name":"Mikael Labrut","email":"contact@alistigo.com"},"license":"MIT","homepage":"https://github.com/alistigo/holos/tree/main/packages/list-document#readme","keywords":["alistigo","list","document","json-schema","json-ld","typescript"],"repository":{"url":"git+https://github.com/alistigo/holos.git","type":"git","directory":"packages/list-document"},"description":"Specification, JSON schemas, and TypeScript types for the Alistigo list document format.","maintainers":[{"name":"mikael.labrut","email":"npm@alistigo.com"}],"readme":"# @alistigo/list-document\n\n[![npm version](https://img.shields.io/npm/v/@alistigo/list-document.svg?style=flat)](https://www.npmjs.com/package/@alistigo/list-document)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![TypeScript](https://img.shields.io/badge/TypeScript-strict-blue?logo=typescript)](https://www.typescriptlang.org/)\n\n**Everything needed to work with an Alistigo list document** — schemas, types, serializer, projector, application service, and validation in a single package. The iframe app, runner, plugins, and UI components all import from here.\n\nA list document is a JSON-LD object conforming to schema.org `ItemList`, extended with an append-only event log:\n\n```jsonc\n{\n  \"@context\": { \"@vocab\": \"https://schema.org/\", \"alistigo\": \"https://json-ld.alistigo.com/vocab/\" },\n  \"@type\": \"ItemList\",\n  \"@id\": \"lst_00000000000000000000000001\",\n  \"identifier\": \"lst_00000000000000000000000001\",\n  \"name\": \"Groceries\",\n  \"itemListElement\": [\n    { \"@type\": \"ListItem\", \"alistigo:listElementId\": \"lse_00000000000000000000000001\", \"position\": 1, \"name\": \"Milk\" }\n  ],\n  \"alistigo:eventLog\": [\n    {\n      \"@id\": \"lev_00000000000000000000000001\",\n      \"alistigo:eventType\": \"ListCreated\",\n      \"list\": { \"@id\": \"lst_00000000000000000000000001\" },\n      \"agent\": { \"@id\": \"act_00000000000000000000000001\" },\n      \"startTime\": \"2026-01-01T00:00:00.000Z\"\n    }\n  ]\n}\n```\n\n## Install\n\n```sh\npnpm add @alistigo/list-document @alistigo/list-domain @alistigo/logger\n# Only needed if you call validateDocument():\npnpm add ajv ajv-formats\n```\n\n## What's exported\n\n### Document types and schema\n\n| Export | Purpose |\n|--------|---------|\n| `AlistigoDocument` | Root document type (extends schema.org `ItemListLeaf`) |\n| `AlistigoListItem` | List element type (extends schema.org `ListItemLeaf`) |\n| `AlistigoEventRecord` | Union of all event record types |\n| `AlistigoListCreatedRecord` | `ListCreated` event |\n| `AlistigoListElementAddedRecord` | `ListElementAdded` event |\n| `AlistigoListElementDeletedRecord` | `ListElementDeleted` event |\n| `AlistigoListElementCheckedRecord` | `ListElementChecked` event |\n| `AlistigoListExportedRecord` | `ListExported` event |\n| `Reference` | JSON-LD node reference shape `{ \"@id\": string }` |\n| `AlistigoActorRecord` | Actor identity record (re-exported from `@alistigo/core-document`) |\n| `AlistigoPluginRecord` | Plugin registration record (re-exported from `@alistigo/core-document`) |\n| `ALISTIGO_CONTEXT` | The JSON-LD `@context` constant (re-exported from `@alistigo/core-document`) |\n| `documentSchema` | The raw JSON schema object |\n| `validateDocument` | Validate an unknown value against the JSON schema |\n\n### Projection and serialization\n\n| Export | Purpose |\n|--------|---------|\n| `buildProjection` | Build a view-model projection from a document |\n| `buildAttributionMap` | Build an actor attribution map |\n| `ListDocumentSerializer` | Serialize/deserialize a list domain model to/from a document |\n\n### Markdown helpers\n\n| Export | Purpose |\n|--------|---------|\n| `buildListDocumentFromMarkdown` | Parse a Markdown checklist into a full document |\n| `parseListMarkdown` | Parse title and items from markdown |\n| `isValidListMarkdown` | Validate markdown without producing a document |\n\n### Event projector\n\n| Export | Purpose |\n|--------|---------|\n| `projectList` | Pure function — replays events → current `ListProjection` |\n| `ListProjector` | Namespace object: `ListProjector.project(listId, events)` |\n| `ListProjection` | Type returned by `projectList` |\n\n### Application service\n\n| Export | Purpose |\n|--------|---------|\n| `ListApplicationService` | Orchestrates commands through the `List` aggregate; persists via `AlistigoListStore` |\n| `AlistigoListStore` | Repository interface (extends `ListRepository` with `loadDocument` / `saveDocument`) |\n| `Result<T, E>` | Discriminated-union result type returned by service methods |\n| `ok` | Construct a successful `Result` |\n| `err` | Construct a failed `Result` |\n\nThe list JSON schema is also available as a subpath export:\n\n```ts\nimport documentSchema from \"@alistigo/list-document/schemas/document.json\" with { type: \"json\" };\n```\n\n## Usage\n\n### Types\n\n```ts\nimport type { AlistigoDocument, AlistigoEventRecord } from \"@alistigo/list-document\";\nimport { ALISTIGO_CONTEXT } from \"@alistigo/list-document\";\n```\n\n### Validation\n\n```ts\nimport { validateDocument } from \"@alistigo/list-document\";\n\nconst result = await validateDocument(unknownInput);\nif (!result.valid) {\n  console.error(result.errors);\n}\n```\n\n### Projection\n\n```ts\nimport { buildProjection } from \"@alistigo/list-document\";\n\nconst projection = buildProjection(document);\n// projection.numberOfItems — element count\n// projection.itemListElement — ordered items with optional attribution\n```\n\n### Application service\n\n```ts\nimport { ListApplicationService, type AlistigoListStore } from \"@alistigo/list-document\";\n\n// Implement AlistigoListStore for your storage backend:\nclass MyStore implements AlistigoListStore { /* ... */ }\n\nconst service = new ListApplicationService(new MyStore());\n\nconst result = await service.createList(actorId, \"Groceries\");\nif (result.ok) {\n  const doc: AlistigoDocument = result.value;\n}\n```\n\n## Related\n\n- [`@alistigo/core-document`](../document/) — base types this package extends\n- [`@alistigo/list-domain`](../list-domain/) — domain model (pure business logic, no I/O)\n","readmeFilename":"README.md"}