@orthacms/content-server 0.0.0-reserve.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +7 -0
- package/dist/define.d.ts +17 -0
- package/dist/define.d.ts.map +1 -0
- package/dist/define.js +28 -0
- package/dist/index.d.ts +48 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +109 -0
- package/dist/lib/collection/define.d.ts +35 -0
- package/dist/lib/collection/define.d.ts.map +1 -0
- package/dist/lib/collection/define.js +217 -0
- package/dist/lib/collection/table-builder.d.ts +28 -0
- package/dist/lib/collection/table-builder.d.ts.map +1 -0
- package/dist/lib/collection/table-builder.js +306 -0
- package/dist/lib/content-types/controllers/get-content-schema.controller.d.ts +24 -0
- package/dist/lib/content-types/controllers/get-content-schema.controller.d.ts.map +1 -0
- package/dist/lib/content-types/controllers/get-content-schema.controller.js +58 -0
- package/dist/lib/content-types/controllers/get-filter-fields.controller.d.ts +35 -0
- package/dist/lib/content-types/controllers/get-filter-fields.controller.d.ts.map +1 -0
- package/dist/lib/content-types/controllers/get-filter-fields.controller.js +74 -0
- package/dist/lib/content-types/controllers/list-content-schema.controller.d.ts +15 -0
- package/dist/lib/content-types/controllers/list-content-schema.controller.d.ts.map +1 -0
- package/dist/lib/content-types/controllers/list-content-schema.controller.js +38 -0
- package/dist/lib/content-types/queries/workspace-grants.query.d.ts +25 -0
- package/dist/lib/content-types/queries/workspace-grants.query.d.ts.map +1 -0
- package/dist/lib/content-types/queries/workspace-grants.query.js +45 -0
- package/dist/lib/content.module.d.ts +21 -0
- package/dist/lib/content.module.d.ts.map +1 -0
- package/dist/lib/content.module.js +264 -0
- package/dist/lib/content.tokens.d.ts +5 -0
- package/dist/lib/content.tokens.d.ts.map +1 -0
- package/dist/lib/content.tokens.js +9 -0
- package/dist/lib/copilot/content-tool.provider.d.ts +64 -0
- package/dist/lib/copilot/content-tool.provider.d.ts.map +1 -0
- package/dist/lib/copilot/content-tool.provider.js +309 -0
- package/dist/lib/copilot/diff-snapshots.d.ts +42 -0
- package/dist/lib/copilot/diff-snapshots.d.ts.map +1 -0
- package/dist/lib/copilot/diff-snapshots.js +77 -0
- package/dist/lib/copilot/entry-proposal.applier.d.ts +89 -0
- package/dist/lib/copilot/entry-proposal.applier.d.ts.map +1 -0
- package/dist/lib/copilot/entry-proposal.applier.js +245 -0
- package/dist/lib/copilot/entry-proposal.provider.d.ts +157 -0
- package/dist/lib/copilot/entry-proposal.provider.d.ts.map +1 -0
- package/dist/lib/copilot/entry-proposal.provider.js +619 -0
- package/dist/lib/copilot/filter-schema.d.ts +61 -0
- package/dist/lib/copilot/filter-schema.d.ts.map +1 -0
- package/dist/lib/copilot/filter-schema.js +139 -0
- package/dist/lib/copilot/project-entry.d.ts +23 -0
- package/dist/lib/copilot/project-entry.d.ts.map +1 -0
- package/dist/lib/copilot/project-entry.js +36 -0
- package/dist/lib/copilot/proposal-kinds.d.ts +30 -0
- package/dist/lib/copilot/proposal-kinds.d.ts.map +1 -0
- package/dist/lib/copilot/proposal-kinds.js +32 -0
- package/dist/lib/copilot/revision-tool.provider.d.ts +56 -0
- package/dist/lib/copilot/revision-tool.provider.d.ts.map +1 -0
- package/dist/lib/copilot/revision-tool.provider.js +215 -0
- package/dist/lib/docs/content-schemas.d.ts +34 -0
- package/dist/lib/docs/content-schemas.d.ts.map +1 -0
- package/dist/lib/docs/content-schemas.js +617 -0
- package/dist/lib/docs/describe-content-api.d.ts +22 -0
- package/dist/lib/docs/describe-content-api.d.ts.map +1 -0
- package/dist/lib/docs/describe-content-api.js +173 -0
- package/dist/lib/docs/field-schema.d.ts +28 -0
- package/dist/lib/docs/field-schema.d.ts.map +1 -0
- package/dist/lib/docs/field-schema.js +214 -0
- package/dist/lib/entries/application/use-cases/bulk-publish-entries.use-case.d.ts +23 -0
- package/dist/lib/entries/application/use-cases/bulk-publish-entries.use-case.d.ts.map +1 -0
- package/dist/lib/entries/application/use-cases/bulk-publish-entries.use-case.js +77 -0
- package/dist/lib/entries/application/use-cases/bulk-unpublish-entries.use-case.d.ts +23 -0
- package/dist/lib/entries/application/use-cases/bulk-unpublish-entries.use-case.d.ts.map +1 -0
- package/dist/lib/entries/application/use-cases/bulk-unpublish-entries.use-case.js +66 -0
- package/dist/lib/entries/application/use-cases/publish-entry.use-case.d.ts +43 -0
- package/dist/lib/entries/application/use-cases/publish-entry.use-case.d.ts.map +1 -0
- package/dist/lib/entries/application/use-cases/publish-entry.use-case.js +106 -0
- package/dist/lib/entries/application/use-cases/unpublish-entry.use-case.d.ts +30 -0
- package/dist/lib/entries/application/use-cases/unpublish-entry.use-case.d.ts.map +1 -0
- package/dist/lib/entries/application/use-cases/unpublish-entry.use-case.js +70 -0
- package/dist/lib/entries/controllers/bulk-entries.controller.d.ts +26 -0
- package/dist/lib/entries/controllers/bulk-entries.controller.d.ts.map +1 -0
- package/dist/lib/entries/controllers/create-entry.controller.d.ts +20 -0
- package/dist/lib/entries/controllers/create-entry.controller.d.ts.map +1 -0
- package/dist/lib/entries/controllers/delete-entry.controller.d.ts +24 -0
- package/dist/lib/entries/controllers/delete-entry.controller.d.ts.map +1 -0
- package/dist/lib/entries/controllers/get-entry.controller.d.ts +34 -0
- package/dist/lib/entries/controllers/get-entry.controller.d.ts.map +1 -0
- package/dist/lib/entries/controllers/list-entries.controller.d.ts +20 -0
- package/dist/lib/entries/controllers/list-entries.controller.d.ts.map +1 -0
- package/dist/lib/entries/controllers/publish-entry.controller.d.ts +19 -0
- package/dist/lib/entries/controllers/publish-entry.controller.d.ts.map +1 -0
- package/dist/lib/entries/controllers/resolve-type.d.ts +9 -0
- package/dist/lib/entries/controllers/resolve-type.d.ts.map +1 -0
- package/dist/lib/entries/controllers/update-entry.controller.d.ts +18 -0
- package/dist/lib/entries/controllers/update-entry.controller.d.ts.map +1 -0
- package/dist/lib/entries/domain/entry-publish-blocked.error.d.ts +13 -0
- package/dist/lib/entries/domain/entry-publish-blocked.error.d.ts.map +1 -0
- package/dist/lib/entries/domain/entry-publish-blocked.error.js +19 -0
- package/dist/lib/entries/domain/entry.d.ts +71 -0
- package/dist/lib/entries/domain/entry.d.ts.map +1 -0
- package/dist/lib/entries/domain/entry.js +90 -0
- package/dist/lib/entries/domain/events/entry-events.d.ts +67 -0
- package/dist/lib/entries/domain/events/entry-events.d.ts.map +1 -0
- package/dist/lib/entries/domain/events/entry-events.js +100 -0
- package/dist/lib/entries/dto/bulk-ids.dto.d.ts +11 -0
- package/dist/lib/entries/dto/bulk-ids.dto.d.ts.map +1 -0
- package/dist/lib/entries/dto/list-entries-query.dto.d.ts +46 -0
- package/dist/lib/entries/dto/list-entries-query.dto.d.ts.map +1 -0
- package/dist/lib/entries/dto/relation-delta-map.validator.d.ts +19 -0
- package/dist/lib/entries/dto/relation-delta-map.validator.d.ts.map +1 -0
- package/dist/lib/entries/dto/save-entry.dto.d.ts +46 -0
- package/dist/lib/entries/dto/save-entry.dto.d.ts.map +1 -0
- package/dist/lib/entries/entries.constants.d.ts +19 -0
- package/dist/lib/entries/entries.constants.d.ts.map +1 -0
- package/dist/lib/entries/entries.constants.js +21 -0
- package/dist/lib/entries/http/controllers/bulk-entries.controller.d.ts +33 -0
- package/dist/lib/entries/http/controllers/bulk-entries.controller.d.ts.map +1 -0
- package/dist/lib/entries/http/controllers/bulk-entries.controller.js +143 -0
- package/dist/lib/entries/http/controllers/create-entry.controller.d.ts +21 -0
- package/dist/lib/entries/http/controllers/create-entry.controller.d.ts.map +1 -0
- package/dist/lib/entries/http/controllers/create-entry.controller.js +52 -0
- package/dist/lib/entries/http/controllers/delete-entry.controller.d.ts +25 -0
- package/dist/lib/entries/http/controllers/delete-entry.controller.d.ts.map +1 -0
- package/dist/lib/entries/http/controllers/delete-entry.controller.js +84 -0
- package/dist/lib/entries/http/controllers/get-entry.controller.d.ts +44 -0
- package/dist/lib/entries/http/controllers/get-entry.controller.d.ts.map +1 -0
- package/dist/lib/entries/http/controllers/get-entry.controller.js +124 -0
- package/dist/lib/entries/http/controllers/list-entries.controller.d.ts +20 -0
- package/dist/lib/entries/http/controllers/list-entries.controller.d.ts.map +1 -0
- package/dist/lib/entries/http/controllers/list-entries.controller.js +52 -0
- package/dist/lib/entries/http/controllers/publish-entry.controller.d.ts +22 -0
- package/dist/lib/entries/http/controllers/publish-entry.controller.d.ts.map +1 -0
- package/dist/lib/entries/http/controllers/publish-entry.controller.js +68 -0
- package/dist/lib/entries/http/controllers/resolve-type.d.ts +9 -0
- package/dist/lib/entries/http/controllers/resolve-type.d.ts.map +1 -0
- package/dist/lib/entries/http/controllers/resolve-type.js +16 -0
- package/dist/lib/entries/http/controllers/to-actor.d.ts +13 -0
- package/dist/lib/entries/http/controllers/to-actor.d.ts.map +1 -0
- package/dist/lib/entries/http/controllers/to-actor.js +15 -0
- package/dist/lib/entries/http/controllers/update-entry.controller.d.ts +19 -0
- package/dist/lib/entries/http/controllers/update-entry.controller.d.ts.map +1 -0
- package/dist/lib/entries/http/controllers/update-entry.controller.js +51 -0
- package/dist/lib/entries/http/dto/bulk-ids.dto.d.ts +11 -0
- package/dist/lib/entries/http/dto/bulk-ids.dto.d.ts.map +1 -0
- package/dist/lib/entries/http/dto/bulk-ids.dto.js +33 -0
- package/dist/lib/entries/http/dto/list-entries-query.dto.d.ts +66 -0
- package/dist/lib/entries/http/dto/list-entries-query.dto.d.ts.map +1 -0
- package/dist/lib/entries/http/dto/list-entries-query.dto.js +192 -0
- package/dist/lib/entries/http/dto/relation-delta-map.validator.d.ts +30 -0
- package/dist/lib/entries/http/dto/relation-delta-map.validator.d.ts.map +1 -0
- package/dist/lib/entries/http/dto/relation-delta-map.validator.js +102 -0
- package/dist/lib/entries/http/dto/save-entry.dto.d.ts +48 -0
- package/dist/lib/entries/http/dto/save-entry.dto.d.ts.map +1 -0
- package/dist/lib/entries/http/dto/save-entry.dto.js +120 -0
- package/dist/lib/entries/http/guards/content-grant.guard.d.ts +37 -0
- package/dist/lib/entries/http/guards/content-grant.guard.d.ts.map +1 -0
- package/dist/lib/entries/http/guards/content-grant.guard.js +67 -0
- package/dist/lib/entries/infrastructure/persistence/bulk-publish-verdicts.d.ts +22 -0
- package/dist/lib/entries/infrastructure/persistence/bulk-publish-verdicts.d.ts.map +1 -0
- package/dist/lib/entries/infrastructure/persistence/bulk-publish-verdicts.js +81 -0
- package/dist/lib/entries/infrastructure/persistence/entry-counter.service.d.ts +42 -0
- package/dist/lib/entries/infrastructure/persistence/entry-counter.service.d.ts.map +1 -0
- package/dist/lib/entries/infrastructure/persistence/entry-counter.service.js +73 -0
- package/dist/lib/entries/infrastructure/persistence/entry-row.d.ts +56 -0
- package/dist/lib/entries/infrastructure/persistence/entry-row.d.ts.map +1 -0
- package/dist/lib/entries/infrastructure/persistence/entry-row.js +185 -0
- package/dist/lib/entries/infrastructure/persistence/entry-writer.service.d.ts +392 -0
- package/dist/lib/entries/infrastructure/persistence/entry-writer.service.d.ts.map +1 -0
- package/dist/lib/entries/infrastructure/persistence/entry-writer.service.js +1223 -0
- package/dist/lib/entries/infrastructure/persistence/field-selection.d.ts +24 -0
- package/dist/lib/entries/infrastructure/persistence/field-selection.d.ts.map +1 -0
- package/dist/lib/entries/infrastructure/persistence/media-accept.d.ts +23 -0
- package/dist/lib/entries/infrastructure/persistence/media-accept.d.ts.map +1 -0
- package/dist/lib/entries/infrastructure/persistence/media-accept.js +55 -0
- package/dist/lib/entries/infrastructure/persistence/relation-link.service.d.ts +327 -0
- package/dist/lib/entries/infrastructure/persistence/relation-link.service.d.ts.map +1 -0
- package/dist/lib/entries/infrastructure/persistence/relation-link.service.js +1008 -0
- package/dist/lib/entries/infrastructure/queries/bulk-publish-preview.query.d.ts +19 -0
- package/dist/lib/entries/infrastructure/queries/bulk-publish-preview.query.d.ts.map +1 -0
- package/dist/lib/entries/infrastructure/queries/bulk-publish-preview.query.js +39 -0
- package/dist/lib/entries/infrastructure/queries/entries.service.d.ts +64 -0
- package/dist/lib/entries/infrastructure/queries/entries.service.d.ts.map +1 -0
- package/dist/lib/entries/infrastructure/queries/entries.service.js +202 -0
- package/dist/lib/entries/infrastructure/queries/entry-filter-schema.d.ts +40 -0
- package/dist/lib/entries/infrastructure/queries/entry-filter-schema.d.ts.map +1 -0
- package/dist/lib/entries/infrastructure/queries/entry-filter-surface.d.ts +38 -0
- package/dist/lib/entries/infrastructure/queries/entry-filter-surface.d.ts.map +1 -0
- package/dist/lib/entries/infrastructure/queries/entry-filter-surface.js +310 -0
- package/dist/lib/entries/infrastructure/queries/entry-scalar-fields.d.ts +25 -0
- package/dist/lib/entries/infrastructure/queries/entry-scalar-fields.d.ts.map +1 -0
- package/dist/lib/entries/infrastructure/queries/entry-scalar-fields.js +51 -0
- package/dist/lib/entries/infrastructure/queries/entry-search.d.ts +19 -0
- package/dist/lib/entries/infrastructure/queries/entry-search.d.ts.map +1 -0
- package/dist/lib/entries/infrastructure/queries/entry-search.js +52 -0
- package/dist/lib/entries/infrastructure/queries/media-refs.query.d.ts +21 -0
- package/dist/lib/entries/infrastructure/queries/media-refs.query.d.ts.map +1 -0
- package/dist/lib/entries/infrastructure/queries/media-refs.query.js +117 -0
- package/dist/lib/entries/services/entries.service.d.ts +59 -0
- package/dist/lib/entries/services/entries.service.d.ts.map +1 -0
- package/dist/lib/entries/services/entry-counter.service.d.ts +31 -0
- package/dist/lib/entries/services/entry-counter.service.d.ts.map +1 -0
- package/dist/lib/entries/services/entry-filter-schema.d.ts +32 -0
- package/dist/lib/entries/services/entry-filter-schema.d.ts.map +1 -0
- package/dist/lib/entries/services/entry-row.d.ts +56 -0
- package/dist/lib/entries/services/entry-row.d.ts.map +1 -0
- package/dist/lib/entries/services/entry-writer.service.d.ts +193 -0
- package/dist/lib/entries/services/entry-writer.service.d.ts.map +1 -0
- package/dist/lib/entries/services/relation-link.service.d.ts +115 -0
- package/dist/lib/entries/services/relation-link.service.d.ts.map +1 -0
- package/dist/lib/entries/types/bulk-publish.d.ts +75 -0
- package/dist/lib/entries/types/bulk-publish.d.ts.map +1 -0
- package/dist/lib/entries/types/bulk-publish.js +22 -0
- package/dist/lib/entries/types/entry-list-view.d.ts +205 -0
- package/dist/lib/entries/types/entry-list-view.d.ts.map +1 -0
- package/dist/lib/entries/types/entry-list-view.js +5 -0
- package/dist/lib/entries/types/filter-surface.d.ts +35 -0
- package/dist/lib/entries/types/filter-surface.d.ts.map +1 -0
- package/dist/lib/entries/types/filter-surface.js +2 -0
- package/dist/lib/extension/entry-extension-boot-check.d.ts +16 -0
- package/dist/lib/extension/entry-extension-boot-check.d.ts.map +1 -0
- package/dist/lib/extension/entry-extension-boot-check.js +42 -0
- package/dist/lib/extension/entry-extension.d.ts +225 -0
- package/dist/lib/extension/entry-extension.d.ts.map +1 -0
- package/dist/lib/extension/entry-extension.js +27 -0
- package/dist/lib/extension/media-asset-resolver.d.ts +85 -0
- package/dist/lib/extension/media-asset-resolver.d.ts.map +1 -0
- package/dist/lib/extension/media-asset-resolver.js +26 -0
- package/dist/lib/extension/per-locale-relation.d.ts +18 -0
- package/dist/lib/extension/per-locale-relation.d.ts.map +1 -0
- package/dist/lib/extension/relation-locale-sync.d.ts +62 -0
- package/dist/lib/extension/relation-locale-sync.d.ts.map +1 -0
- package/dist/lib/extension/relation-locale-sync.js +88 -0
- package/dist/lib/fields/index.d.ts +94 -0
- package/dist/lib/fields/index.d.ts.map +1 -0
- package/dist/lib/fields/index.js +203 -0
- package/dist/lib/insights/http/controllers/content-pipeline.controller.d.ts +16 -0
- package/dist/lib/insights/http/controllers/content-pipeline.controller.d.ts.map +1 -0
- package/dist/lib/insights/http/controllers/content-pipeline.controller.js +39 -0
- package/dist/lib/insights/http/controllers/content-punchcard.controller.d.ts +18 -0
- package/dist/lib/insights/http/controllers/content-punchcard.controller.d.ts.map +1 -0
- package/dist/lib/insights/http/controllers/content-punchcard.controller.js +42 -0
- package/dist/lib/insights/http/controllers/content-stale.controller.d.ts +17 -0
- package/dist/lib/insights/http/controllers/content-stale.controller.d.ts.map +1 -0
- package/dist/lib/insights/http/controllers/content-stale.controller.js +40 -0
- package/dist/lib/insights/http/controllers/content-totals.controller.d.ts +18 -0
- package/dist/lib/insights/http/controllers/content-totals.controller.d.ts.map +1 -0
- package/dist/lib/insights/http/controllers/content-totals.controller.js +42 -0
- package/dist/lib/insights/http/controllers/content-unshipped.controller.d.ts +17 -0
- package/dist/lib/insights/http/controllers/content-unshipped.controller.d.ts.map +1 -0
- package/dist/lib/insights/http/controllers/content-unshipped.controller.js +40 -0
- package/dist/lib/insights/http/controllers/content-velocity.controller.d.ts +17 -0
- package/dist/lib/insights/http/controllers/content-velocity.controller.d.ts.map +1 -0
- package/dist/lib/insights/http/controllers/content-velocity.controller.js +41 -0
- package/dist/lib/insights/http/dto/insights-range-query.dto.d.ts +15 -0
- package/dist/lib/insights/http/dto/insights-range-query.dto.d.ts.map +1 -0
- package/dist/lib/insights/http/dto/insights-range-query.dto.js +38 -0
- package/dist/lib/insights/infrastructure/queries/content-insights.query.d.ts +77 -0
- package/dist/lib/insights/infrastructure/queries/content-insights.query.d.ts.map +1 -0
- package/dist/lib/insights/infrastructure/queries/content-insights.query.js +380 -0
- package/dist/lib/insights/types/content-insights-view.d.ts +134 -0
- package/dist/lib/insights/types/content-insights-view.d.ts.map +1 -0
- package/dist/lib/insights/types/content-insights-view.js +10 -0
- package/dist/lib/mcp/content-tools.provider.d.ts +83 -0
- package/dist/lib/mcp/content-tools.provider.d.ts.map +1 -0
- package/dist/lib/mcp/content-tools.provider.js +441 -0
- package/dist/lib/mcp/tool-input.d.ts +43 -0
- package/dist/lib/mcp/tool-input.d.ts.map +1 -0
- package/dist/lib/mcp/tool-input.js +117 -0
- package/dist/lib/mcp/tool-schemas.d.ts +34 -0
- package/dist/lib/mcp/tool-schemas.d.ts.map +1 -0
- package/dist/lib/mcp/tool-schemas.js +282 -0
- package/dist/lib/public/controllers/get-public-entry.controller.d.ts +26 -0
- package/dist/lib/public/controllers/get-public-entry.controller.d.ts.map +1 -0
- package/dist/lib/public/controllers/list-public-entries.controller.d.ts +24 -0
- package/dist/lib/public/controllers/list-public-entries.controller.d.ts.map +1 -0
- package/dist/lib/public/controllers/public-schema.controller.d.ts +18 -0
- package/dist/lib/public/controllers/public-schema.controller.d.ts.map +1 -0
- package/dist/lib/public-api/http/api-token-request.d.ts +41 -0
- package/dist/lib/public-api/http/api-token-request.d.ts.map +1 -0
- package/dist/lib/public-api/http/api-token-request.js +2 -0
- package/dist/lib/public-api/http/controllers/public-content-types.controller.d.ts +31 -0
- package/dist/lib/public-api/http/controllers/public-content-types.controller.d.ts.map +1 -0
- package/dist/lib/public-api/http/controllers/public-content-types.controller.js +93 -0
- package/dist/lib/public-api/http/controllers/public-entries.controller.d.ts +101 -0
- package/dist/lib/public-api/http/controllers/public-entries.controller.d.ts.map +1 -0
- package/dist/lib/public-api/http/controllers/public-entries.controller.js +307 -0
- package/dist/lib/public-api/http/controllers/public-entry-writes.controller.d.ts +76 -0
- package/dist/lib/public-api/http/controllers/public-entry-writes.controller.d.ts.map +1 -0
- package/dist/lib/public-api/http/controllers/public-entry-writes.controller.js +353 -0
- package/dist/lib/public-api/http/controllers/resolve-granted-type.d.ts +42 -0
- package/dist/lib/public-api/http/controllers/resolve-granted-type.d.ts.map +1 -0
- package/dist/lib/public-api/http/controllers/resolve-granted-type.js +25 -0
- package/dist/lib/public-api/http/decorators/current-api-token.decorator.d.ts +8 -0
- package/dist/lib/public-api/http/decorators/current-api-token.decorator.d.ts.map +1 -0
- package/dist/lib/public-api/http/decorators/current-api-token.decorator.js +17 -0
- package/dist/lib/public-api/http/dto/public-bulk.dto.d.ts +58 -0
- package/dist/lib/public-api/http/dto/public-bulk.dto.d.ts.map +1 -0
- package/dist/lib/public-api/http/dto/public-bulk.dto.js +118 -0
- package/dist/lib/public-api/http/dto/public-list-entries-query.dto.d.ts +106 -0
- package/dist/lib/public-api/http/dto/public-list-entries-query.dto.d.ts.map +1 -0
- package/dist/lib/public-api/http/dto/public-list-entries-query.dto.js +297 -0
- package/dist/lib/public-api/http/dto/public-save-entry.dto.d.ts +39 -0
- package/dist/lib/public-api/http/dto/public-save-entry.dto.d.ts.map +1 -0
- package/dist/lib/public-api/http/dto/public-save-entry.dto.js +112 -0
- package/dist/lib/public-api/http/guards/api-token-workspace.guard.d.ts +25 -0
- package/dist/lib/public-api/http/guards/api-token-workspace.guard.d.ts.map +1 -0
- package/dist/lib/public-api/http/guards/api-token-workspace.guard.js +58 -0
- package/dist/lib/public-api/http/guards/api-token.guard.d.ts +32 -0
- package/dist/lib/public-api/http/guards/api-token.guard.d.ts.map +1 -0
- package/dist/lib/public-api/http/guards/api-token.guard.js +92 -0
- package/dist/lib/public-api/http/guards/draft-visibility.guard.d.ts +25 -0
- package/dist/lib/public-api/http/guards/draft-visibility.guard.d.ts.map +1 -0
- package/dist/lib/public-api/http/guards/draft-visibility.guard.js +56 -0
- package/dist/lib/public-api/infrastructure/bulk-save-op.d.ts +55 -0
- package/dist/lib/public-api/infrastructure/bulk-save-op.d.ts.map +1 -0
- package/dist/lib/public-api/infrastructure/bulk-save-op.js +61 -0
- package/dist/lib/public-api/infrastructure/field-selection.d.ts +21 -0
- package/dist/lib/public-api/infrastructure/field-selection.d.ts.map +1 -0
- package/dist/lib/public-api/infrastructure/field-selection.js +72 -0
- package/dist/lib/public-api/infrastructure/public-entries.query.d.ts +248 -0
- package/dist/lib/public-api/infrastructure/public-entries.query.d.ts.map +1 -0
- package/dist/lib/public-api/infrastructure/public-entries.query.js +557 -0
- package/dist/lib/public-api/infrastructure/public-entry-row.d.ts +31 -0
- package/dist/lib/public-api/infrastructure/public-entry-row.d.ts.map +1 -0
- package/dist/lib/public-api/infrastructure/public-entry-row.js +76 -0
- package/dist/lib/public-api/infrastructure/public-entry-writes.service.d.ts +188 -0
- package/dist/lib/public-api/infrastructure/public-entry-writes.service.d.ts.map +1 -0
- package/dist/lib/public-api/infrastructure/public-entry-writes.service.js +321 -0
- package/dist/lib/public-api/infrastructure/public-expansion.query.d.ts +98 -0
- package/dist/lib/public-api/infrastructure/public-expansion.query.d.ts.map +1 -0
- package/dist/lib/public-api/infrastructure/public-expansion.query.js +384 -0
- package/dist/lib/public-api/types/public-bulk.d.ts +77 -0
- package/dist/lib/public-api/types/public-bulk.d.ts.map +1 -0
- package/dist/lib/public-api/types/public-bulk.js +23 -0
- package/dist/lib/public-api/types/public-entry.d.ts +97 -0
- package/dist/lib/public-api/types/public-entry.d.ts.map +1 -0
- package/dist/lib/public-api/types/public-entry.js +8 -0
- package/dist/lib/public-api/types/public-expansion.d.ts +92 -0
- package/dist/lib/public-api/types/public-expansion.d.ts.map +1 -0
- package/dist/lib/public-api/types/public-expansion.js +2 -0
- package/dist/lib/registry/content-type-registry.d.ts +103 -0
- package/dist/lib/registry/content-type-registry.d.ts.map +1 -0
- package/dist/lib/registry/content-type-registry.js +155 -0
- package/dist/lib/revisions/application/ports/revision-store.d.ts +71 -0
- package/dist/lib/revisions/application/ports/revision-store.d.ts.map +1 -0
- package/dist/lib/revisions/application/ports/revision-store.js +9 -0
- package/dist/lib/revisions/application/use-cases/publish-revision.use-case.d.ts +40 -0
- package/dist/lib/revisions/application/use-cases/publish-revision.use-case.d.ts.map +1 -0
- package/dist/lib/revisions/application/use-cases/publish-revision.use-case.js +66 -0
- package/dist/lib/revisions/application/use-cases/restore-revision.use-case.d.ts +36 -0
- package/dist/lib/revisions/application/use-cases/restore-revision.use-case.d.ts.map +1 -0
- package/dist/lib/revisions/application/use-cases/restore-revision.use-case.js +57 -0
- package/dist/lib/revisions/domain/revision-status.d.ts +18 -0
- package/dist/lib/revisions/domain/revision-status.d.ts.map +1 -0
- package/dist/lib/revisions/domain/revision-status.js +18 -0
- package/dist/lib/revisions/domain/revision.d.ts +80 -0
- package/dist/lib/revisions/domain/revision.d.ts.map +1 -0
- package/dist/lib/revisions/domain/revision.js +84 -0
- package/dist/lib/revisions/http/controllers/publish-revision.controller.d.ts +19 -0
- package/dist/lib/revisions/http/controllers/publish-revision.controller.d.ts.map +1 -0
- package/dist/lib/revisions/http/controllers/publish-revision.controller.js +51 -0
- package/dist/lib/revisions/http/controllers/restore-revision.controller.d.ts +17 -0
- package/dist/lib/revisions/http/controllers/restore-revision.controller.d.ts.map +1 -0
- package/dist/lib/revisions/http/controllers/restore-revision.controller.js +49 -0
- package/dist/lib/revisions/http/controllers/revisions.controller.d.ts +20 -0
- package/dist/lib/revisions/http/controllers/revisions.controller.d.ts.map +1 -0
- package/dist/lib/revisions/http/controllers/revisions.controller.js +76 -0
- package/dist/lib/revisions/infrastructure/persistence/drizzle-revision.store.d.ts +33 -0
- package/dist/lib/revisions/infrastructure/persistence/drizzle-revision.store.d.ts.map +1 -0
- package/dist/lib/revisions/infrastructure/persistence/drizzle-revision.store.js +174 -0
- package/dist/lib/revisions/infrastructure/persistence/revision-snapshot.d.ts +17 -0
- package/dist/lib/revisions/infrastructure/persistence/revision-snapshot.d.ts.map +1 -0
- package/dist/lib/revisions/infrastructure/persistence/revision-snapshot.js +20 -0
- package/dist/lib/revisions/infrastructure/persistence/revision-table.d.ts +228 -0
- package/dist/lib/revisions/infrastructure/persistence/revision-table.d.ts.map +1 -0
- package/dist/lib/revisions/infrastructure/persistence/revision-table.js +57 -0
- package/dist/lib/revisions/infrastructure/queries/revision-refs.query.d.ts +22 -0
- package/dist/lib/revisions/infrastructure/queries/revision-refs.query.d.ts.map +1 -0
- package/dist/lib/revisions/infrastructure/queries/revision-refs.query.js +66 -0
- package/dist/lib/revisions/revisions.constants.d.ts +10 -0
- package/dist/lib/revisions/revisions.constants.d.ts.map +1 -0
- package/dist/lib/revisions/revisions.constants.js +12 -0
- package/dist/lib/revisions/types/revision-view.d.ts +74 -0
- package/dist/lib/revisions/types/revision-view.d.ts.map +1 -0
- package/dist/lib/revisions/types/revision-view.js +2 -0
- package/dist/lib/types/content-type.d.ts +131 -0
- package/dist/lib/types/content-type.d.ts.map +1 -0
- package/dist/lib/types/content-type.js +28 -0
- package/dist/lib/types/fields.d.ts +303 -0
- package/dist/lib/types/fields.d.ts.map +1 -0
- package/dist/lib/types/fields.js +52 -0
- package/dist/lib/utils/content-plugin.d.ts +35 -0
- package/dist/lib/utils/content-plugin.d.ts.map +1 -0
- package/dist/lib/utils/content-plugin.js +35 -0
- package/dist/lib/validation/services/entry-validation.service.d.ts +24 -0
- package/dist/lib/validation/services/entry-validation.service.d.ts.map +1 -0
- package/dist/lib/validation/services/entry-validation.service.js +35 -0
- package/package.json +54 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RestoreRevisionUseCase = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const common_1 = require("@nestjs/common");
|
|
6
|
+
const fields_1 = require("../../../types/fields");
|
|
7
|
+
const entry_writer_service_1 = require("../../../entries/infrastructure/persistence/entry-writer.service");
|
|
8
|
+
const revision_store_1 = require("../ports/revision-store");
|
|
9
|
+
/**
|
|
10
|
+
* Restore an entry to an earlier revision. History is **append-only** — a
|
|
11
|
+
* restore never rewrites or deletes past versions: it applies the chosen
|
|
12
|
+
* snapshot back onto the live row through the normal save path, which in turn
|
|
13
|
+
* records the restore as a **new** draft revision (so v5 restoring v2 yields a
|
|
14
|
+
* fresh v6 equal to v2). The snapshot's `values` (scalars, localized + shared
|
|
15
|
+
* fields, single-relation FKs) and its owning many-to-many link sets are
|
|
16
|
+
* re-applied; inverse relations mirror their owning side and aren't written from
|
|
17
|
+
* here.
|
|
18
|
+
*/
|
|
19
|
+
let RestoreRevisionUseCase = class RestoreRevisionUseCase {
|
|
20
|
+
writer;
|
|
21
|
+
store;
|
|
22
|
+
constructor(writer, store) {
|
|
23
|
+
this.writer = writer;
|
|
24
|
+
this.store = store;
|
|
25
|
+
}
|
|
26
|
+
async execute(type, id, number, workspaceId,
|
|
27
|
+
/**
|
|
28
|
+
* The acting user — stamped on the new revision and on the
|
|
29
|
+
* `entry.updated` event the underlying save raises, so a restore is
|
|
30
|
+
* attributable in the audit log like any other edit.
|
|
31
|
+
*/
|
|
32
|
+
actor, options) {
|
|
33
|
+
const detail = await this.store.get(type.name, id, workspaceId, number);
|
|
34
|
+
if (!detail) {
|
|
35
|
+
throw new common_1.NotFoundException(`No revision #${number} for entry "${id}" on "${type.name}".`);
|
|
36
|
+
}
|
|
37
|
+
// Merge the snapshot's owning many-to-many link sets into the values bag
|
|
38
|
+
// so the writer's whole-set `writeLinks` re-applies them; single FKs and
|
|
39
|
+
// scalar/localized values already ride `values`.
|
|
40
|
+
const values = { ...detail.snapshot.values };
|
|
41
|
+
for (const [field, ids] of Object.entries(detail.snapshot.relations)) {
|
|
42
|
+
const spec = type.fields[field];
|
|
43
|
+
if (spec?.type === fields_1.CONTENT_FIELD_TYPE.Relation &&
|
|
44
|
+
spec.relation?.many &&
|
|
45
|
+
!spec.relation.inverse) {
|
|
46
|
+
values[field] = ids;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return this.writer.update(type, id, values, workspaceId, undefined, actor, options);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
exports.RestoreRevisionUseCase = RestoreRevisionUseCase;
|
|
53
|
+
exports.RestoreRevisionUseCase = RestoreRevisionUseCase = tslib_1.__decorate([
|
|
54
|
+
(0, common_1.Injectable)(),
|
|
55
|
+
tslib_1.__param(1, (0, revision_store_1.InjectRevisionStore)()),
|
|
56
|
+
tslib_1.__metadata("design:paramtypes", [entry_writer_service_1.EntryWriterService, Object])
|
|
57
|
+
], RestoreRevisionUseCase);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The lifecycle state of a single revision. Distinct from an entry's
|
|
3
|
+
* `draft ↔ published` status (`@orthacms/content-domain`): that describes the
|
|
4
|
+
* live row, this describes one version in its history.
|
|
5
|
+
*
|
|
6
|
+
* - `draft` — a saved version that is not (yet) live.
|
|
7
|
+
* - `published` — the version currently promoted to the live row. At most one
|
|
8
|
+
* per `entry_id`.
|
|
9
|
+
* - `superseded` — a previously-published version that a later publish replaced.
|
|
10
|
+
*/
|
|
11
|
+
export declare const REVISION_STATUS: {
|
|
12
|
+
readonly Draft: "draft";
|
|
13
|
+
readonly Published: "published";
|
|
14
|
+
readonly Superseded: "superseded";
|
|
15
|
+
};
|
|
16
|
+
/** A revision's lifecycle state. */
|
|
17
|
+
export type RevisionStatus = (typeof REVISION_STATUS)[keyof typeof REVISION_STATUS];
|
|
18
|
+
//# sourceMappingURL=revision-status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"revision-status.d.ts","sourceRoot":"","sources":["../../../../src/lib/revisions/domain/revision-status.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe;;;;CAIlB,CAAC;AAEX,oCAAoC;AACpC,MAAM,MAAM,cAAc,GACtB,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.REVISION_STATUS = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The lifecycle state of a single revision. Distinct from an entry's
|
|
6
|
+
* `draft ↔ published` status (`@orthacms/content-domain`): that describes the
|
|
7
|
+
* live row, this describes one version in its history.
|
|
8
|
+
*
|
|
9
|
+
* - `draft` — a saved version that is not (yet) live.
|
|
10
|
+
* - `published` — the version currently promoted to the live row. At most one
|
|
11
|
+
* per `entry_id`.
|
|
12
|
+
* - `superseded` — a previously-published version that a later publish replaced.
|
|
13
|
+
*/
|
|
14
|
+
exports.REVISION_STATUS = {
|
|
15
|
+
Draft: 'draft',
|
|
16
|
+
Published: 'published',
|
|
17
|
+
Superseded: 'superseded'
|
|
18
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { type RevisionStatus } from './revision-status';
|
|
2
|
+
import type { RevisionSnapshot } from '../types/revision-view';
|
|
3
|
+
/** The data a new revision is minted from — everything but the store-owned id. */
|
|
4
|
+
export interface NewRevisionParams {
|
|
5
|
+
/** The registry content-type machine name. */
|
|
6
|
+
contentType: string;
|
|
7
|
+
/** The live `content_<name>` row (per-locale) the revision belongs to. */
|
|
8
|
+
entryId: string;
|
|
9
|
+
/** Owning workspace. */
|
|
10
|
+
workspaceId: string;
|
|
11
|
+
/** Translation-group id — null on non-i18n types. */
|
|
12
|
+
localeGroupId: string | null;
|
|
13
|
+
/** The row's locale — null on non-i18n types. */
|
|
14
|
+
locale: string | null;
|
|
15
|
+
/** Monotonic version number within the entry (allocated by the store). */
|
|
16
|
+
number: number;
|
|
17
|
+
/** The captured document. */
|
|
18
|
+
snapshot: RevisionSnapshot;
|
|
19
|
+
/** The acting user's id, or null when unknown. */
|
|
20
|
+
createdBy: string | null;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The **focused domain model** for a content revision. Like {@link Entry}, the
|
|
24
|
+
* revision engine is generic and registry-driven — one store backs every content
|
|
25
|
+
* type — so this models the small piece with real invariants (a new revision is
|
|
26
|
+
* always born a `draft`, carrying a complete snapshot) and leaves the heavy
|
|
27
|
+
* persistence to the infrastructure store.
|
|
28
|
+
*
|
|
29
|
+
* Framework-free (ADR-0003's one hard rule): imports nothing from `@nestjs/*`,
|
|
30
|
+
* `drizzle-orm`, `class-validator`, or the infrastructure layer — only sibling
|
|
31
|
+
* domain types.
|
|
32
|
+
*
|
|
33
|
+
* Event emission (`entry.revision.created`) is intentionally deferred: Phase-1
|
|
34
|
+
* snapshotting runs inside the `EntryWriterService` save transaction, not the
|
|
35
|
+
* `UnitOfWork`, so there is no atomic outbox to append to yet — the same reason
|
|
36
|
+
* `entry.created`/`entry.updated` are still unemitted (see content-server
|
|
37
|
+
* `AGENTS.md`). The model stays event-ready for when those writes move onto the
|
|
38
|
+
* `UnitOfWork`.
|
|
39
|
+
*/
|
|
40
|
+
export declare class Revision {
|
|
41
|
+
private readonly _contentType;
|
|
42
|
+
private readonly _entryId;
|
|
43
|
+
private readonly _workspaceId;
|
|
44
|
+
private readonly _localeGroupId;
|
|
45
|
+
private readonly _locale;
|
|
46
|
+
private readonly _number;
|
|
47
|
+
private readonly _status;
|
|
48
|
+
private readonly _snapshot;
|
|
49
|
+
private readonly _createdBy;
|
|
50
|
+
private constructor();
|
|
51
|
+
/**
|
|
52
|
+
* Mint a new **draft** revision from a just-saved document. A revision is
|
|
53
|
+
* never born published: publishing is a separate, deliberate transition that
|
|
54
|
+
* promotes the entry's latest draft to `published`
|
|
55
|
+
* (`RevisionStore.markPublished`, driven by the publish use-case), and a
|
|
56
|
+
* restore appends a fresh draft rather than rewriting history.
|
|
57
|
+
*/
|
|
58
|
+
static createDraft(params: NewRevisionParams): Revision;
|
|
59
|
+
/** The version number within the entry. */
|
|
60
|
+
get number(): number;
|
|
61
|
+
/** The lifecycle state (always `draft` for a freshly-created revision). */
|
|
62
|
+
get status(): RevisionStatus;
|
|
63
|
+
/**
|
|
64
|
+
* The row to insert — the store adds only the DB-defaulted `id`/`created_at`.
|
|
65
|
+
* Kept here so the persisted shape and the invariants that produced it stay
|
|
66
|
+
* in one place.
|
|
67
|
+
*/
|
|
68
|
+
toPersistence(): {
|
|
69
|
+
contentType: string;
|
|
70
|
+
entryId: string;
|
|
71
|
+
workspaceId: string;
|
|
72
|
+
localeGroupId: string | null;
|
|
73
|
+
locale: string | null;
|
|
74
|
+
revisionNumber: number;
|
|
75
|
+
status: RevisionStatus;
|
|
76
|
+
snapshot: RevisionSnapshot;
|
|
77
|
+
createdBy: string | null;
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=revision.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"revision.d.ts","sourceRoot":"","sources":["../../../../src/lib/revisions/domain/revision.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,kFAAkF;AAClF,MAAM,WAAW,iBAAiB;IAC9B,8CAA8C;IAC9C,WAAW,EAAE,MAAM,CAAC;IACpB,0EAA0E;IAC1E,OAAO,EAAE,MAAM,CAAC;IAChB,wBAAwB;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,qDAAqD;IACrD,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,iDAAiD;IACjD,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,0EAA0E;IAC1E,MAAM,EAAE,MAAM,CAAC;IACf,6BAA6B;IAC7B,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,kDAAkD;IAClD,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,QAAQ;IAEb,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,UAAU;IAT/B,OAAO;IAYP;;;;;;OAMG;IACH,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,QAAQ;IAmBvD,2CAA2C;IAC3C,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,2EAA2E;IAC3E,IAAI,MAAM,IAAI,cAAc,CAE3B;IAED;;;;OAIG;IACH,aAAa,IAAI;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,EAAE,MAAM,CAAC;QACpB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;QAC7B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;QACtB,cAAc,EAAE,MAAM,CAAC;QACvB,MAAM,EAAE,cAAc,CAAC;QACvB,QAAQ,EAAE,gBAAgB,CAAC;QAC3B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;KAC5B;CAaJ"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Revision = void 0;
|
|
4
|
+
const revision_status_1 = require("./revision-status");
|
|
5
|
+
/**
|
|
6
|
+
* The **focused domain model** for a content revision. Like {@link Entry}, the
|
|
7
|
+
* revision engine is generic and registry-driven — one store backs every content
|
|
8
|
+
* type — so this models the small piece with real invariants (a new revision is
|
|
9
|
+
* always born a `draft`, carrying a complete snapshot) and leaves the heavy
|
|
10
|
+
* persistence to the infrastructure store.
|
|
11
|
+
*
|
|
12
|
+
* Framework-free (ADR-0003's one hard rule): imports nothing from `@nestjs/*`,
|
|
13
|
+
* `drizzle-orm`, `class-validator`, or the infrastructure layer — only sibling
|
|
14
|
+
* domain types.
|
|
15
|
+
*
|
|
16
|
+
* Event emission (`entry.revision.created`) is intentionally deferred: Phase-1
|
|
17
|
+
* snapshotting runs inside the `EntryWriterService` save transaction, not the
|
|
18
|
+
* `UnitOfWork`, so there is no atomic outbox to append to yet — the same reason
|
|
19
|
+
* `entry.created`/`entry.updated` are still unemitted (see content-server
|
|
20
|
+
* `AGENTS.md`). The model stays event-ready for when those writes move onto the
|
|
21
|
+
* `UnitOfWork`.
|
|
22
|
+
*/
|
|
23
|
+
class Revision {
|
|
24
|
+
_contentType;
|
|
25
|
+
_entryId;
|
|
26
|
+
_workspaceId;
|
|
27
|
+
_localeGroupId;
|
|
28
|
+
_locale;
|
|
29
|
+
_number;
|
|
30
|
+
_status;
|
|
31
|
+
_snapshot;
|
|
32
|
+
_createdBy;
|
|
33
|
+
constructor(_contentType, _entryId, _workspaceId, _localeGroupId, _locale, _number, _status, _snapshot, _createdBy) {
|
|
34
|
+
this._contentType = _contentType;
|
|
35
|
+
this._entryId = _entryId;
|
|
36
|
+
this._workspaceId = _workspaceId;
|
|
37
|
+
this._localeGroupId = _localeGroupId;
|
|
38
|
+
this._locale = _locale;
|
|
39
|
+
this._number = _number;
|
|
40
|
+
this._status = _status;
|
|
41
|
+
this._snapshot = _snapshot;
|
|
42
|
+
this._createdBy = _createdBy;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Mint a new **draft** revision from a just-saved document. A revision is
|
|
46
|
+
* never born published: publishing is a separate, deliberate transition that
|
|
47
|
+
* promotes the entry's latest draft to `published`
|
|
48
|
+
* (`RevisionStore.markPublished`, driven by the publish use-case), and a
|
|
49
|
+
* restore appends a fresh draft rather than rewriting history.
|
|
50
|
+
*/
|
|
51
|
+
static createDraft(params) {
|
|
52
|
+
if (!Number.isInteger(params.number) || params.number < 1) {
|
|
53
|
+
throw new Error(`Revision number must be a positive integer, got ${params.number}.`);
|
|
54
|
+
}
|
|
55
|
+
return new Revision(params.contentType, params.entryId, params.workspaceId, params.localeGroupId, params.locale, params.number, revision_status_1.REVISION_STATUS.Draft, params.snapshot, params.createdBy);
|
|
56
|
+
}
|
|
57
|
+
/** The version number within the entry. */
|
|
58
|
+
get number() {
|
|
59
|
+
return this._number;
|
|
60
|
+
}
|
|
61
|
+
/** The lifecycle state (always `draft` for a freshly-created revision). */
|
|
62
|
+
get status() {
|
|
63
|
+
return this._status;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* The row to insert — the store adds only the DB-defaulted `id`/`created_at`.
|
|
67
|
+
* Kept here so the persisted shape and the invariants that produced it stay
|
|
68
|
+
* in one place.
|
|
69
|
+
*/
|
|
70
|
+
toPersistence() {
|
|
71
|
+
return {
|
|
72
|
+
contentType: this._contentType,
|
|
73
|
+
entryId: this._entryId,
|
|
74
|
+
workspaceId: this._workspaceId,
|
|
75
|
+
localeGroupId: this._localeGroupId,
|
|
76
|
+
locale: this._locale,
|
|
77
|
+
revisionNumber: this._number,
|
|
78
|
+
status: this._status,
|
|
79
|
+
snapshot: this._snapshot,
|
|
80
|
+
createdBy: this._createdBy
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
exports.Revision = Revision;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type PublicUser } from '@orthacms/identity-server';
|
|
2
|
+
import type { ContentTypeRegistry } from '../../../registry/content-type-registry';
|
|
3
|
+
import type { EntryRecord } from '../../../entries/types/entry-list-view';
|
|
4
|
+
import { PublishRevisionUseCase } from '../../application/use-cases/publish-revision.use-case';
|
|
5
|
+
/**
|
|
6
|
+
* `POST /api/content/:typeName/:id/revisions/:number/publish` — make a specific
|
|
7
|
+
* version the entry's **live** one. The newest version publishes in place; an
|
|
8
|
+
* earlier one is restored (as a new revision) then published, so history stays
|
|
9
|
+
* append-only. `OriginGuard` defends the write; `WorkspaceGuard` scopes it;
|
|
10
|
+
* `content:publish` gates it. `400` on a non-publishable type, `404` on an
|
|
11
|
+
* absent version, `422 { issues }` when the version fails the publish gate.
|
|
12
|
+
*/
|
|
13
|
+
export declare class PublishRevisionController {
|
|
14
|
+
private readonly registry;
|
|
15
|
+
private readonly publishRevision;
|
|
16
|
+
constructor(registry: ContentTypeRegistry, publishRevision: PublishRevisionUseCase);
|
|
17
|
+
publish(typeName: string, id: string, number: number, workspaceId: string, user?: PublicUser): Promise<EntryRecord>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=publish-revision.controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish-revision.controller.d.ts","sourceRoot":"","sources":["../../../../../src/lib/revisions/http/controllers/publish-revision.controller.ts"],"names":[],"mappings":"AAQA,OAAO,EAKH,KAAK,UAAU,EAElB,MAAM,2BAA2B,CAAC;AAInC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAGnF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,sBAAsB,EAAE,MAAM,uDAAuD,CAAC;AAE/F;;;;;;;GAOG;AACH,qBAGa,yBAAyB;IAG9B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,eAAe;gBADf,QAAQ,EAAE,mBAAmB,EAC7B,eAAe,EAAE,sBAAsB;IAI5D,OAAO,CACgB,QAAQ,EAAE,MAAM,EACP,EAAE,EAAE,MAAM,EACP,MAAM,EAAE,MAAM,EACzB,WAAW,EAAE,MAAM,EACxB,IAAI,CAAC,EAAE,UAAU,GACjC,OAAO,CAAC,WAAW,CAAC;CAU1B"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PublishRevisionController = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const common_1 = require("@nestjs/common");
|
|
6
|
+
const identity_server_1 = require("@orthacms/identity-server");
|
|
7
|
+
const workspaces_server_1 = require("@orthacms/workspaces-server");
|
|
8
|
+
const content_grant_guard_1 = require("../../../entries/http/guards/content-grant.guard");
|
|
9
|
+
const content_tokens_1 = require("../../../content.tokens");
|
|
10
|
+
const resolve_type_1 = require("../../../entries/http/controllers/resolve-type");
|
|
11
|
+
const to_actor_1 = require("../../../entries/http/controllers/to-actor");
|
|
12
|
+
const publish_revision_use_case_1 = require("../../application/use-cases/publish-revision.use-case");
|
|
13
|
+
/**
|
|
14
|
+
* `POST /api/content/:typeName/:id/revisions/:number/publish` — make a specific
|
|
15
|
+
* version the entry's **live** one. The newest version publishes in place; an
|
|
16
|
+
* earlier one is restored (as a new revision) then published, so history stays
|
|
17
|
+
* append-only. `OriginGuard` defends the write; `WorkspaceGuard` scopes it;
|
|
18
|
+
* `content:publish` gates it. `400` on a non-publishable type, `404` on an
|
|
19
|
+
* absent version, `422 { issues }` when the version fails the publish gate.
|
|
20
|
+
*/
|
|
21
|
+
let PublishRevisionController = class PublishRevisionController {
|
|
22
|
+
registry;
|
|
23
|
+
publishRevision;
|
|
24
|
+
constructor(registry, publishRevision) {
|
|
25
|
+
this.registry = registry;
|
|
26
|
+
this.publishRevision = publishRevision;
|
|
27
|
+
}
|
|
28
|
+
publish(typeName, id, number, workspaceId, user) {
|
|
29
|
+
const type = (0, resolve_type_1.resolveType)(this.registry, typeName);
|
|
30
|
+
return this.publishRevision.execute(type, id, number, workspaceId, (0, to_actor_1.toActor)(user) ?? null);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
exports.PublishRevisionController = PublishRevisionController;
|
|
34
|
+
tslib_1.__decorate([
|
|
35
|
+
(0, common_1.Post)(':typeName/:id/revisions/:number/publish'),
|
|
36
|
+
tslib_1.__param(0, (0, common_1.Param)('typeName')),
|
|
37
|
+
tslib_1.__param(1, (0, common_1.Param)('id', common_1.ParseUUIDPipe)),
|
|
38
|
+
tslib_1.__param(2, (0, common_1.Param)('number', common_1.ParseIntPipe)),
|
|
39
|
+
tslib_1.__param(3, (0, workspaces_server_1.CurrentWorkspace)()),
|
|
40
|
+
tslib_1.__param(4, (0, identity_server_1.CurrentUser)()),
|
|
41
|
+
tslib_1.__metadata("design:type", Function),
|
|
42
|
+
tslib_1.__metadata("design:paramtypes", [String, String, Number, String, Object]),
|
|
43
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
44
|
+
], PublishRevisionController.prototype, "publish", null);
|
|
45
|
+
exports.PublishRevisionController = PublishRevisionController = tslib_1.__decorate([
|
|
46
|
+
(0, common_1.UseGuards)(identity_server_1.OriginGuard, identity_server_1.PermissionsGuard, workspaces_server_1.WorkspaceGuard, content_grant_guard_1.ContentGrantGuard),
|
|
47
|
+
(0, identity_server_1.RequirePermissions)(identity_server_1.PERMISSIONS.CONTENT_PUBLISH),
|
|
48
|
+
(0, common_1.Controller)('content'),
|
|
49
|
+
tslib_1.__param(0, (0, content_tokens_1.InjectContentRegistry)()),
|
|
50
|
+
tslib_1.__metadata("design:paramtypes", [Function, publish_revision_use_case_1.PublishRevisionUseCase])
|
|
51
|
+
], PublishRevisionController);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type PublicUser } from '@orthacms/identity-server';
|
|
2
|
+
import type { ContentTypeRegistry } from '../../../registry/content-type-registry';
|
|
3
|
+
import type { EntryRecord } from '../../../entries/types/entry-list-view';
|
|
4
|
+
import { RestoreRevisionUseCase } from '../../application/use-cases/restore-revision.use-case';
|
|
5
|
+
/**
|
|
6
|
+
* `POST /api/content/:typeName/:id/revisions/:number/restore` — re-apply an
|
|
7
|
+
* earlier version onto the live entry. History is append-only: the restore is
|
|
8
|
+
* itself saved as a new revision. `OriginGuard` defends the write;
|
|
9
|
+
* `WorkspaceGuard` scopes it; `content:update` gates it (restoring is an edit).
|
|
10
|
+
*/
|
|
11
|
+
export declare class RestoreRevisionController {
|
|
12
|
+
private readonly registry;
|
|
13
|
+
private readonly restoreRevision;
|
|
14
|
+
constructor(registry: ContentTypeRegistry, restoreRevision: RestoreRevisionUseCase);
|
|
15
|
+
restore(typeName: string, id: string, number: number, workspaceId: string, user?: PublicUser): Promise<EntryRecord>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=restore-revision.controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"restore-revision.controller.d.ts","sourceRoot":"","sources":["../../../../../src/lib/revisions/http/controllers/restore-revision.controller.ts"],"names":[],"mappings":"AAQA,OAAO,EAKH,KAAK,UAAU,EAElB,MAAM,2BAA2B,CAAC;AAInC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAGnF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,sBAAsB,EAAE,MAAM,uDAAuD,CAAC;AAE/F;;;;;GAKG;AACH,qBAGa,yBAAyB;IAG9B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,eAAe;gBADf,QAAQ,EAAE,mBAAmB,EAC7B,eAAe,EAAE,sBAAsB;IAI5D,OAAO,CACgB,QAAQ,EAAE,MAAM,EACP,EAAE,EAAE,MAAM,EACP,MAAM,EAAE,MAAM,EACzB,WAAW,EAAE,MAAM,EACxB,IAAI,CAAC,EAAE,UAAU,GACjC,OAAO,CAAC,WAAW,CAAC;CAU1B"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RestoreRevisionController = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const common_1 = require("@nestjs/common");
|
|
6
|
+
const identity_server_1 = require("@orthacms/identity-server");
|
|
7
|
+
const workspaces_server_1 = require("@orthacms/workspaces-server");
|
|
8
|
+
const content_grant_guard_1 = require("../../../entries/http/guards/content-grant.guard");
|
|
9
|
+
const content_tokens_1 = require("../../../content.tokens");
|
|
10
|
+
const resolve_type_1 = require("../../../entries/http/controllers/resolve-type");
|
|
11
|
+
const to_actor_1 = require("../../../entries/http/controllers/to-actor");
|
|
12
|
+
const restore_revision_use_case_1 = require("../../application/use-cases/restore-revision.use-case");
|
|
13
|
+
/**
|
|
14
|
+
* `POST /api/content/:typeName/:id/revisions/:number/restore` — re-apply an
|
|
15
|
+
* earlier version onto the live entry. History is append-only: the restore is
|
|
16
|
+
* itself saved as a new revision. `OriginGuard` defends the write;
|
|
17
|
+
* `WorkspaceGuard` scopes it; `content:update` gates it (restoring is an edit).
|
|
18
|
+
*/
|
|
19
|
+
let RestoreRevisionController = class RestoreRevisionController {
|
|
20
|
+
registry;
|
|
21
|
+
restoreRevision;
|
|
22
|
+
constructor(registry, restoreRevision) {
|
|
23
|
+
this.registry = registry;
|
|
24
|
+
this.restoreRevision = restoreRevision;
|
|
25
|
+
}
|
|
26
|
+
restore(typeName, id, number, workspaceId, user) {
|
|
27
|
+
const type = (0, resolve_type_1.resolveType)(this.registry, typeName);
|
|
28
|
+
return this.restoreRevision.execute(type, id, number, workspaceId, (0, to_actor_1.toActor)(user) ?? null);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
exports.RestoreRevisionController = RestoreRevisionController;
|
|
32
|
+
tslib_1.__decorate([
|
|
33
|
+
(0, common_1.Post)(':typeName/:id/revisions/:number/restore'),
|
|
34
|
+
tslib_1.__param(0, (0, common_1.Param)('typeName')),
|
|
35
|
+
tslib_1.__param(1, (0, common_1.Param)('id', common_1.ParseUUIDPipe)),
|
|
36
|
+
tslib_1.__param(2, (0, common_1.Param)('number', common_1.ParseIntPipe)),
|
|
37
|
+
tslib_1.__param(3, (0, workspaces_server_1.CurrentWorkspace)()),
|
|
38
|
+
tslib_1.__param(4, (0, identity_server_1.CurrentUser)()),
|
|
39
|
+
tslib_1.__metadata("design:type", Function),
|
|
40
|
+
tslib_1.__metadata("design:paramtypes", [String, String, Number, String, Object]),
|
|
41
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
42
|
+
], RestoreRevisionController.prototype, "restore", null);
|
|
43
|
+
exports.RestoreRevisionController = RestoreRevisionController = tslib_1.__decorate([
|
|
44
|
+
(0, common_1.UseGuards)(identity_server_1.OriginGuard, identity_server_1.PermissionsGuard, workspaces_server_1.WorkspaceGuard, content_grant_guard_1.ContentGrantGuard),
|
|
45
|
+
(0, identity_server_1.RequirePermissions)(identity_server_1.PERMISSIONS.CONTENT_UPDATE),
|
|
46
|
+
(0, common_1.Controller)('content'),
|
|
47
|
+
tslib_1.__param(0, (0, content_tokens_1.InjectContentRegistry)()),
|
|
48
|
+
tslib_1.__metadata("design:paramtypes", [Function, restore_revision_use_case_1.RestoreRevisionUseCase])
|
|
49
|
+
], RestoreRevisionController);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ContentTypeRegistry } from '../../../registry/content-type-registry';
|
|
2
|
+
import { type RevisionStore } from '../../application/ports/revision-store';
|
|
3
|
+
import type { RevisionDetail, RevisionListView } from '../../types/revision-view';
|
|
4
|
+
import { RevisionRefsQuery } from '../../infrastructure/queries/revision-refs.query';
|
|
5
|
+
/**
|
|
6
|
+
* `GET /api/content/:typeName/:id/revisions` — the version timeline of one entry
|
|
7
|
+
* (newest first, paginated), and `.../revisions/:number` — one version with its
|
|
8
|
+
* full snapshot (for preview / restore). Both scoped to a workspace the caller
|
|
9
|
+
* belongs to and gated on `content:read`; a 404 on an unknown type or an
|
|
10
|
+
* absent version.
|
|
11
|
+
*/
|
|
12
|
+
export declare class RevisionsController {
|
|
13
|
+
private readonly registry;
|
|
14
|
+
private readonly revisions;
|
|
15
|
+
private readonly refs;
|
|
16
|
+
constructor(registry: ContentTypeRegistry, revisions: RevisionStore, refs: RevisionRefsQuery);
|
|
17
|
+
list(typeName: string, id: string, workspaceId: string, page?: string, pageSize?: string): Promise<RevisionListView>;
|
|
18
|
+
get(typeName: string, id: string, number: number, workspaceId: string): Promise<RevisionDetail>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=revisions.controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"revisions.controller.d.ts","sourceRoot":"","sources":["../../../../../src/lib/revisions/http/controllers/revisions.controller.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAEnF,OAAO,EAEH,KAAK,aAAa,EACrB,MAAM,wCAAwC,CAAC;AAChD,OAAO,KAAK,EACR,cAAc,EACd,gBAAgB,EACnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kDAAkD,CAAC;AAGrF;;;;;;GAMG;AACH,qBAGa,mBAAmB;IAGxB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACF,OAAO,CAAC,QAAQ,CAAC,SAAS;IACjD,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAFJ,QAAQ,EAAE,mBAAmB,EACN,SAAS,EAAE,aAAa,EAC/C,IAAI,EAAE,iBAAiB;IAI5C,IAAI,CACmB,QAAQ,EAAE,MAAM,EACP,EAAE,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACxB,IAAI,CAAC,EAAE,MAAM,EACT,QAAQ,CAAC,EAAE,MAAM,GACrC,OAAO,CAAC,gBAAgB,CAAC;IAYtB,GAAG,CACc,QAAQ,EAAE,MAAM,EACP,EAAE,EAAE,MAAM,EACP,MAAM,EAAE,MAAM,EACzB,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,cAAc,CAAC;CAiB7B"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RevisionsController = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const common_1 = require("@nestjs/common");
|
|
6
|
+
const identity_server_1 = require("@orthacms/identity-server");
|
|
7
|
+
const workspaces_server_1 = require("@orthacms/workspaces-server");
|
|
8
|
+
const content_grant_guard_1 = require("../../../entries/http/guards/content-grant.guard");
|
|
9
|
+
const utils_server_1 = require("@orthacms/utils-server");
|
|
10
|
+
const entries_constants_1 = require("../../../entries/entries.constants");
|
|
11
|
+
const content_tokens_1 = require("../../../content.tokens");
|
|
12
|
+
const resolve_type_1 = require("../../../entries/http/controllers/resolve-type");
|
|
13
|
+
const revision_store_1 = require("../../application/ports/revision-store");
|
|
14
|
+
const revision_refs_query_1 = require("../../infrastructure/queries/revision-refs.query");
|
|
15
|
+
const revisions_constants_1 = require("../../revisions.constants");
|
|
16
|
+
/**
|
|
17
|
+
* `GET /api/content/:typeName/:id/revisions` — the version timeline of one entry
|
|
18
|
+
* (newest first, paginated), and `.../revisions/:number` — one version with its
|
|
19
|
+
* full snapshot (for preview / restore). Both scoped to a workspace the caller
|
|
20
|
+
* belongs to and gated on `content:read`; a 404 on an unknown type or an
|
|
21
|
+
* absent version.
|
|
22
|
+
*/
|
|
23
|
+
let RevisionsController = class RevisionsController {
|
|
24
|
+
registry;
|
|
25
|
+
revisions;
|
|
26
|
+
refs;
|
|
27
|
+
constructor(registry, revisions, refs) {
|
|
28
|
+
this.registry = registry;
|
|
29
|
+
this.revisions = revisions;
|
|
30
|
+
this.refs = refs;
|
|
31
|
+
}
|
|
32
|
+
list(typeName, id, workspaceId, page, pageSize) {
|
|
33
|
+
const type = (0, resolve_type_1.resolveType)(this.registry, typeName);
|
|
34
|
+
return this.revisions.list(type.name, id, workspaceId, (0, utils_server_1.clampInt)(page, 1, 1, Number.MAX_SAFE_INTEGER), (0, utils_server_1.clampInt)(pageSize, revisions_constants_1.REVISIONS_PAGE_SIZE, 1, entries_constants_1.MAX_PAGE_SIZE));
|
|
35
|
+
}
|
|
36
|
+
async get(typeName, id, number, workspaceId) {
|
|
37
|
+
const type = (0, resolve_type_1.resolveType)(this.registry, typeName);
|
|
38
|
+
const detail = await this.revisions.get(type.name, id, workspaceId, number);
|
|
39
|
+
if (!detail) {
|
|
40
|
+
throw new common_1.NotFoundException(`No revision #${number} for entry "${id}".`);
|
|
41
|
+
}
|
|
42
|
+
// Resolve the snapshot's relation ids to display refs so the preview can
|
|
43
|
+
// list the actual linked records, not raw uuids.
|
|
44
|
+
return this.refs.enrich(type, detail, workspaceId);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
exports.RevisionsController = RevisionsController;
|
|
48
|
+
tslib_1.__decorate([
|
|
49
|
+
(0, common_1.Get)(':typeName/:id/revisions'),
|
|
50
|
+
tslib_1.__param(0, (0, common_1.Param)('typeName')),
|
|
51
|
+
tslib_1.__param(1, (0, common_1.Param)('id', common_1.ParseUUIDPipe)),
|
|
52
|
+
tslib_1.__param(2, (0, workspaces_server_1.CurrentWorkspace)()),
|
|
53
|
+
tslib_1.__param(3, (0, common_1.Query)('page')),
|
|
54
|
+
tslib_1.__param(4, (0, common_1.Query)('pageSize')),
|
|
55
|
+
tslib_1.__metadata("design:type", Function),
|
|
56
|
+
tslib_1.__metadata("design:paramtypes", [String, String, String, String, String]),
|
|
57
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
58
|
+
], RevisionsController.prototype, "list", null);
|
|
59
|
+
tslib_1.__decorate([
|
|
60
|
+
(0, common_1.Get)(':typeName/:id/revisions/:number'),
|
|
61
|
+
tslib_1.__param(0, (0, common_1.Param)('typeName')),
|
|
62
|
+
tslib_1.__param(1, (0, common_1.Param)('id', common_1.ParseUUIDPipe)),
|
|
63
|
+
tslib_1.__param(2, (0, common_1.Param)('number', common_1.ParseIntPipe)),
|
|
64
|
+
tslib_1.__param(3, (0, workspaces_server_1.CurrentWorkspace)()),
|
|
65
|
+
tslib_1.__metadata("design:type", Function),
|
|
66
|
+
tslib_1.__metadata("design:paramtypes", [String, String, Number, String]),
|
|
67
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
68
|
+
], RevisionsController.prototype, "get", null);
|
|
69
|
+
exports.RevisionsController = RevisionsController = tslib_1.__decorate([
|
|
70
|
+
(0, common_1.UseGuards)(identity_server_1.PermissionsGuard, workspaces_server_1.WorkspaceGuard, content_grant_guard_1.ContentGrantGuard),
|
|
71
|
+
(0, identity_server_1.RequirePermissions)(identity_server_1.PERMISSIONS.CONTENT_READ),
|
|
72
|
+
(0, common_1.Controller)('content'),
|
|
73
|
+
tslib_1.__param(0, (0, content_tokens_1.InjectContentRegistry)()),
|
|
74
|
+
tslib_1.__param(1, (0, revision_store_1.InjectRevisionStore)()),
|
|
75
|
+
tslib_1.__metadata("design:paramtypes", [Function, Object, revision_refs_query_1.RevisionRefsQuery])
|
|
76
|
+
], RevisionsController);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type Database } from '@orthacms/database';
|
|
2
|
+
import type { RevisionExecutor, RevisionStore } from '../../application/ports/revision-store';
|
|
3
|
+
import type { Revision } from '../../domain/revision';
|
|
4
|
+
import type { RevisionDetail, RevisionListView, RevisionSummary } from '../../types/revision-view';
|
|
5
|
+
/**
|
|
6
|
+
* The Drizzle-backed {@link RevisionStore}. Writes are executor-parameterized so
|
|
7
|
+
* a snapshot commits atomically with the save it records (via the
|
|
8
|
+
* `EntryWriterService` transaction); reads run on the base connection.
|
|
9
|
+
*/
|
|
10
|
+
export declare class DrizzleRevisionStore implements RevisionStore {
|
|
11
|
+
private readonly db;
|
|
12
|
+
constructor(db: Database);
|
|
13
|
+
lockEntry(exec: RevisionExecutor, entryId: string): Promise<void>;
|
|
14
|
+
nextNumber(exec: RevisionExecutor, entryId: string): Promise<number>;
|
|
15
|
+
append(exec: RevisionExecutor, revision: Revision): Promise<RevisionSummary>;
|
|
16
|
+
markPublished(exec: RevisionExecutor, entryId: string, workspaceId: string, revisionNumber?: number): Promise<void>;
|
|
17
|
+
markUnpublished(exec: RevisionExecutor, entryId: string, workspaceId: string): Promise<void>;
|
|
18
|
+
list(contentType: string, entryId: string, workspaceId: string, page: number, pageSize: number): Promise<RevisionListView>;
|
|
19
|
+
get(contentType: string, entryId: string, workspaceId: string, number: number): Promise<RevisionDetail | undefined>;
|
|
20
|
+
/** The highest version number for an entry, or 0 if it has no revisions. */
|
|
21
|
+
private latestNumber;
|
|
22
|
+
/**
|
|
23
|
+
* The read scope every timeline query shares: one entry, in one workspace,
|
|
24
|
+
* **of one content type**. All types share `content_entry_revisions`, and
|
|
25
|
+
* the routes address an entry as `:typeName/:id` — so leaving the type out
|
|
26
|
+
* means the `:typeName` in the URL is never checked against the revision it
|
|
27
|
+
* returns, and any registered type name serves any entry's history.
|
|
28
|
+
*/
|
|
29
|
+
private scope;
|
|
30
|
+
/** Map a row to the metadata view, deriving the `isLatest`/`isPublished` flags. */
|
|
31
|
+
private toSummary;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=drizzle-revision.store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drizzle-revision.store.d.ts","sourceRoot":"","sources":["../../../../../src/lib/revisions/infrastructure/persistence/drizzle-revision.store.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,KAAK,EACR,gBAAgB,EAChB,aAAa,EAChB,MAAM,wCAAwC,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGtD,OAAO,KAAK,EACR,cAAc,EACd,gBAAgB,EAEhB,eAAe,EAClB,MAAM,2BAA2B,CAAC;AAanC;;;;GAIG;AACH,qBACa,oBAAqB,YAAW,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAAF,EAAE,EAAE,QAAQ;IAErD,SAAS,CAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAMjE,UAAU,CAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IASpE,MAAM,CACR,IAAI,EAAE,gBAAgB,EACtB,QAAQ,EAAE,QAAQ,GACnB,OAAO,CAAC,eAAe,CAAC;IAuBrB,aAAa,CACf,IAAI,EAAE,gBAAgB,EACtB,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,cAAc,CAAC,EAAE,MAAM,GACxB,OAAO,CAAC,IAAI,CAAC;IAyCV,eAAe,CACjB,IAAI,EAAE,gBAAgB,EACtB,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,GACpB,OAAO,CAAC,IAAI,CAAC;IAaV,IAAI,CACN,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,GACjB,OAAO,CAAC,gBAAgB,CAAC;IAsBtB,GAAG,CACL,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,GACf,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC;IAsBtC,4EAA4E;YAC9D,YAAY;IAY1B;;;;;;OAMG;IACH,OAAO,CAAC,KAAK;IAQb,mFAAmF;IACnF,OAAO,CAAC,SAAS;CAkBpB"}
|