@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 @@
|
|
|
1
|
+
{"version":3,"file":"entries.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/entries/services/entries.service.ts"],"names":[],"mappings":"AAcA,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpE,OAAO,EAEH,KAAK,qBAAqB,EAC7B,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,EAEH,KAAK,mBAAmB,EAC3B,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAiB9D;;;;;;GAMG;AACH,qBACa,cAAc;IAED,OAAO,CAAC,QAAQ,CAAC,EAAE;IAKrC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC;gBALQ,EAAE,EAAE,QAAQ,EAK9B,SAAS,CAAC,EAAE,qBAAqB,YAAA;IAGtD;;;;;;OAMG;IACG,IAAI,CACN,IAAI,EAAE,cAAc,EACpB,KAAK,EAAE,mBAAmB,EAC1B,WAAW,EAAE,MAAM,GACpB,OAAO,CAAC,aAAa,CAAC;IA8BzB;;;;;;;OAOG;YACW,SAAS;IAqCvB;;;;;OAKG;IACH,OAAO,CAAC,gBAAgB;IAWxB;;;;OAIG;IACH,OAAO,CAAC,eAAe;IAcvB;;;;;;;;;OASG;IACH,OAAO,CAAC,OAAO;CAsBlB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type Database } from '@ortha-cms/database';
|
|
2
|
+
import type { ContentEntryCounter } from '@ortha-cms/identity-server';
|
|
3
|
+
import type { ContentTypeRegistry } from '../../registry/content-type-registry';
|
|
4
|
+
/**
|
|
5
|
+
* Implements identity's {@link ContentEntryCounter} port over the generated
|
|
6
|
+
* `content_<name>` tables: counts how many entries of a content type a
|
|
7
|
+
* workspace holds. Bound to `CONTENT_ENTRY_COUNTER` in {@link ContentModule},
|
|
8
|
+
* so identity's "revoke a content-type grant only when empty" rule resolves
|
|
9
|
+
* against the real stored entries.
|
|
10
|
+
*/
|
|
11
|
+
export declare class EntryCounterService implements ContentEntryCounter {
|
|
12
|
+
private readonly db;
|
|
13
|
+
private readonly registry;
|
|
14
|
+
constructor(db: Database, registry: ContentTypeRegistry);
|
|
15
|
+
/**
|
|
16
|
+
* Every stored row of content type `slug` in `workspaceId`. Counts the
|
|
17
|
+
* whole workspace slice of the type's table — including soft-deleted rows
|
|
18
|
+
* for paranoid types (data that still exists must keep the grant). An
|
|
19
|
+
* unknown slug (no such content type) counts as `0`.
|
|
20
|
+
*/
|
|
21
|
+
countEntries(workspaceId: string, slug: string): Promise<number>;
|
|
22
|
+
/**
|
|
23
|
+
* Every stored row the workspace holds across **all** content types —
|
|
24
|
+
* summed over each type's table. Backs the workspace-delete guard (delete is
|
|
25
|
+
* refused until this is zero). The per-type counts run concurrently.
|
|
26
|
+
*/
|
|
27
|
+
countWorkspaceEntries(workspaceId: string): Promise<number>;
|
|
28
|
+
/** Counts a single content type's rows in a workspace. */
|
|
29
|
+
private countTable;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=entry-counter.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry-counter.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/entries/services/entry-counter.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAMhF;;;;;;GAMG;AACH,qBACa,mBAAoB,YAAW,mBAAmB;IAErC,OAAO,CAAC,QAAQ,CAAC,EAAE;IACZ,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBADf,EAAE,EAAE,QAAQ,EACL,QAAQ,EAAE,mBAAmB;IAG3E;;;;;OAKG;IACG,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAMtE;;;;OAIG;IACG,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IASjE,0DAA0D;YAC5C,UAAU;CAW3B"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type FieldSchema, type FilterSchema } from '@ortha-cms/utils-server';
|
|
2
|
+
import { type AnyContentType } from '../../types/content-type';
|
|
3
|
+
import { type AnyFieldSpec } from '../../types/fields';
|
|
4
|
+
/**
|
|
5
|
+
* Whether a field is backed by a comparable scalar column — the single source of
|
|
6
|
+
* truth for "can this field be filtered or sorted". `json`/`multiselect` (jsonb)
|
|
7
|
+
* and `relation` (FK uuid / join table) are not: they have no scalar editor and
|
|
8
|
+
* ordering them is meaningless. The sort whitelist and the filter schema both
|
|
9
|
+
* derive from this, so the two can't drift apart.
|
|
10
|
+
*/
|
|
11
|
+
export declare function isScalarField(spec: AnyFieldSpec): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Build the query-builder `FilterSchema` for one content type at request time.
|
|
14
|
+
* Whitelists the always-present envelope columns (`createdAt`/`updatedAt`),
|
|
15
|
+
* plus `status`/`publishedAt` only on publishable types, plus `locale` on i18n
|
|
16
|
+
* types, plus every filterable field (those `isScalarField` admits — the same
|
|
17
|
+
* set the admin's `filterFieldsFromSchema` offers), keyed by the property
|
|
18
|
+
* names the engine resolves to table columns. (`status` has a matching admin
|
|
19
|
+
* filter; the timestamp envelopes like `publishedAt` are filterable via the
|
|
20
|
+
* API but have no UI control yet.) This is the security boundary: only listed
|
|
21
|
+
* fields/ops reach SQL, and the engine's depth/node caps bound payload
|
|
22
|
+
* blow-up.
|
|
23
|
+
*
|
|
24
|
+
* `extensionFields` are **virtual** fields contributed by the bound
|
|
25
|
+
* `CONTENT_ENTRY_EXTENSION` (e.g. locale aggregates): their declarations merge
|
|
26
|
+
* into `fields` (so the parser can coerce values) and their names are
|
|
27
|
+
* registered on the schema's `extensionFields` set, routing them to the
|
|
28
|
+
* extension's own SQL resolver instead of a table column. A field column
|
|
29
|
+
* always wins a name collision — an extension cannot shadow real data.
|
|
30
|
+
*/
|
|
31
|
+
export declare function buildEntryFilterSchema(type: AnyContentType, extensionFields?: FieldSchema): FilterSchema;
|
|
32
|
+
//# sourceMappingURL=entry-filter-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry-filter-schema.d.ts","sourceRoot":"","sources":["../../../../src/lib/entries/services/entry-filter-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,KAAK,WAAW,EAChB,KAAK,YAAY,EAEpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAiC3E;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAEzD;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,sBAAsB,CAClC,IAAI,EAAE,cAAc,EACpB,eAAe,CAAC,EAAE,WAAW,GAC9B,YAAY,CAmCd"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure row ↔ entry mappers shared by the read ({@link EntriesService}) and write
|
|
3
|
+
* ({@link EntryWriterService}) paths, so the wire shape and the column projection
|
|
4
|
+
* have one definition each. No DB access, no NestJS — just shape translation.
|
|
5
|
+
*/
|
|
6
|
+
import type { AnyContentType } from '../../types/content-type';
|
|
7
|
+
import type { EntryRecord } from '../types/entry-list-view';
|
|
8
|
+
/** A generated content table row seen as a bag of values by property name. */
|
|
9
|
+
type Row = Record<string, unknown>;
|
|
10
|
+
/**
|
|
11
|
+
* Map a raw DB row to the admin {@link EntryRecord}: envelope fields plus a
|
|
12
|
+
* `values` bag keyed by field name. `status` is emitted only for publishable
|
|
13
|
+
* types. Relations that own no column — many-relations (their links live in join
|
|
14
|
+
* tables) and inverse/back-references (they reuse the owning side's storage) —
|
|
15
|
+
* aren't selected here; an owning single relation passes through as its FK uuid.
|
|
16
|
+
*/
|
|
17
|
+
export declare function toRecord(type: AnyContentType, row: Row): EntryRecord;
|
|
18
|
+
/**
|
|
19
|
+
* Normalize the admin's (string-shaped) `values` bag to the proper JS types the
|
|
20
|
+
* validator and storage expect — numbers parsed, JSON text parsed, empties
|
|
21
|
+
* collapsed to null — keeping every field (so a many-relation array still
|
|
22
|
+
* validates). The single coercion point: both {@link toColumns} (storage) and
|
|
23
|
+
* the writer's validation run against the result, so they can't disagree on a
|
|
24
|
+
* value's type. Datetime/date stay ISO strings (the validator accepts them;
|
|
25
|
+
* {@link toColumns} converts datetime to `Date` for `timestamptz`).
|
|
26
|
+
*/
|
|
27
|
+
export declare function coerceValues(type: AnyContentType, values: Record<string, unknown>): Record<string, unknown>;
|
|
28
|
+
/**
|
|
29
|
+
* Project a (coerced) `values` bag onto the columns of a generated table for an
|
|
30
|
+
* insert/update. Includes only keys declared on the type (reserved envelope
|
|
31
|
+
* columns — `status`/`published_at`/`deleted_at`/timestamps — are owned by the
|
|
32
|
+
* service, never the client), skips relations that own no column (many-relations,
|
|
33
|
+
* whose links live in join tables, and inverse/back-references, which reuse the
|
|
34
|
+
* owning side's storage), collapses empties to `null`, converts a `datetime` to a `Date` for
|
|
35
|
+
* the `timestamptz` column (guarding an invalid date to `null` rather than
|
|
36
|
+
* letting `pg` throw), and drops a `NaN` number to `null`. A field absent from
|
|
37
|
+
* `values` is written as `null` — the editor submits the full bag, so a write
|
|
38
|
+
* replaces the whole document.
|
|
39
|
+
*/
|
|
40
|
+
export declare function toColumns(type: AnyContentType, values: Record<string, unknown>): Record<string, unknown>;
|
|
41
|
+
/**
|
|
42
|
+
* A human display label for an entry — the first non-empty title-eligible field's
|
|
43
|
+
* value (see {@link TITLE_FIELD_TYPES}), falling back to the id. Used to label
|
|
44
|
+
* rows in the bulk-publish preview.
|
|
45
|
+
*/
|
|
46
|
+
export declare function entryTitle(type: AnyContentType, row: Row): string;
|
|
47
|
+
/**
|
|
48
|
+
* The slug handle for an entry — the value of its **slug field**: the first
|
|
49
|
+
* field flagged `admin.widget === 'slug'`, else a field literally named `slug`.
|
|
50
|
+
* Returns the trimmed value when present and non-empty, otherwise `undefined`
|
|
51
|
+
* (the type has no slug field, or the row's slug is blank). Used to give a
|
|
52
|
+
* linked relation record a stable `/handle` in the admin.
|
|
53
|
+
*/
|
|
54
|
+
export declare function entrySlug(type: AnyContentType, row: Row): string | undefined;
|
|
55
|
+
export {};
|
|
56
|
+
//# sourceMappingURL=entry-row.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry-row.d.ts","sourceRoot":"","sources":["../../../../src/lib/entries/services/entry-row.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D,8EAA8E;AAC9E,KAAK,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEnC;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,cAAc,EAAE,GAAG,EAAE,GAAG,GAAG,WAAW,CAwBpE;AAKD;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CACxB,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAgCzB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CACrB,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA0BzB;AAWD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,cAAc,EAAE,GAAG,EAAE,GAAG,GAAG,MAAM,CAOjE;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,cAAc,EAAE,GAAG,EAAE,GAAG,GAAG,MAAM,GAAG,SAAS,CAS5E"}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { type Database } from '@ortha-cms/database';
|
|
2
|
+
import { type ContentEntryExtension } from '../../extension/entry-extension';
|
|
3
|
+
import type { AnyContentType } from '../../types/content-type';
|
|
4
|
+
import { EntryValidationService } from '../../validation/services/entry-validation.service';
|
|
5
|
+
import type { EntryRecord, RelationDelta, RelationFieldView } from '../types/entry-list-view';
|
|
6
|
+
import { type BulkActionResult, type BulkPublishPreview, type BulkPublishResult } from '../types/bulk-publish';
|
|
7
|
+
import { RelationLinkService } from './relation-link.service';
|
|
8
|
+
/**
|
|
9
|
+
* The write half of the entries pipeline — create / read-one / update / publish
|
|
10
|
+
* / unpublish / delete / restore / purge, plus their bulk variants. Generic over
|
|
11
|
+
* the content type (like {@link EntriesService}): the physical table and its
|
|
12
|
+
* envelope columns are derived from `type` at request time, so one service backs
|
|
13
|
+
* every collection. {@link EntryValidationService} is the gate — nothing is
|
|
14
|
+
* written or published without passing it.
|
|
15
|
+
*/
|
|
16
|
+
export declare class EntryWriterService {
|
|
17
|
+
private readonly db;
|
|
18
|
+
private readonly validation;
|
|
19
|
+
private readonly relations;
|
|
20
|
+
private readonly extension?;
|
|
21
|
+
constructor(db: Database, validation: EntryValidationService, relations: RelationLinkService, extension?: ContentEntryExtension | undefined);
|
|
22
|
+
/**
|
|
23
|
+
* Create an entry **owned by `workspaceId`** (stamped onto the row so the
|
|
24
|
+
* reader's workspace filter and every later scoped write see it). A
|
|
25
|
+
* publishable type starts as a **draft** and may be incomplete — validation
|
|
26
|
+
* is deferred to publish. A non-publishable type is always live, so its
|
|
27
|
+
* values must validate now.
|
|
28
|
+
*
|
|
29
|
+
* The insert runs in a transaction that first takes the workspace's *shared*
|
|
30
|
+
* content lock ({@link lockWorkspaceShared}): it coordinates with the
|
|
31
|
+
* workspace delete / content-revoke guards (which take the lock exclusively),
|
|
32
|
+
* so a new entry can't land between their emptiness check and their mutation
|
|
33
|
+
* and be orphaned. Shared mode keeps concurrent creates non-blocking.
|
|
34
|
+
*
|
|
35
|
+
* `locale` / `localeGroupId` are opaque, extension-owned params: the bound
|
|
36
|
+
* extension validates them and stamps the envelope columns (a
|
|
37
|
+
* `localeGroupId` makes the row a **sibling** in that translation group). A
|
|
38
|
+
* duplicate `(group, locale)` surfaces as a **409** via {@link uniqueGuarded}.
|
|
39
|
+
*/
|
|
40
|
+
create(type: AnyContentType, values: Record<string, unknown>, workspaceId: string, relations?: Record<string, RelationDelta>, locale?: string, localeGroupId?: string): Promise<EntryRecord>;
|
|
41
|
+
/**
|
|
42
|
+
* First page (+ total) of every relation field's links for one live entry,
|
|
43
|
+
* keyed by field name — what the editor loads on open. Each field is
|
|
44
|
+
* paginated, so a relation with many links contributes only its first page.
|
|
45
|
+
* 404 if the entry is missing (or soft-deleted) in this workspace.
|
|
46
|
+
*/
|
|
47
|
+
getRelations(type: AnyContentType, id: string, workspaceId: string): Promise<Record<string, RelationFieldView>>;
|
|
48
|
+
/**
|
|
49
|
+
* One page of a single relation field's links (infinite-scroll for a
|
|
50
|
+
* many/inverse relation). 404 if the entry is missing; 400 if `field` isn't a
|
|
51
|
+
* relation on the type.
|
|
52
|
+
*/
|
|
53
|
+
getRelationField(type: AnyContentType, id: string, field: string, page: number, pageSize: number, workspaceId: string): Promise<RelationFieldView>;
|
|
54
|
+
/**
|
|
55
|
+
* Apply the staged per-field relation deltas of a save, inside the entry's
|
|
56
|
+
* transaction — so the row and every link change commit or roll back as one.
|
|
57
|
+
* Each field must be a **many/inverse** relation (a single relation is set
|
|
58
|
+
* through `values`); a single-relation or unknown key is a 400. `applyDelta`
|
|
59
|
+
* validates the linked ids against the workspace (422 on a bad target).
|
|
60
|
+
*/
|
|
61
|
+
private applyRelationDeltas;
|
|
62
|
+
/** Resolve a relation field spec on the type, or 400 if it isn't one. */
|
|
63
|
+
private relationSpec;
|
|
64
|
+
/** Read one live entry in the workspace, or 404. */
|
|
65
|
+
getOne(type: AnyContentType, id: string, workspaceId: string): Promise<EntryRecord>;
|
|
66
|
+
/**
|
|
67
|
+
* Replace a live entry's values, or 404. As with {@link create}, a
|
|
68
|
+
* publishable type's values aren't validated here (a draft may be saved
|
|
69
|
+
* incomplete; publish enforces the rules) — a non-publishable, always-live
|
|
70
|
+
* type validates now.
|
|
71
|
+
*/
|
|
72
|
+
update(type: AnyContentType, id: string, values: Record<string, unknown>, workspaceId: string, relations?: Record<string, RelationDelta>): Promise<EntryRecord>;
|
|
73
|
+
/** Validate the stored row, then mark it published (publishable types only). */
|
|
74
|
+
publish(type: AnyContentType, id: string, workspaceId: string): Promise<EntryRecord>;
|
|
75
|
+
/** Revert a live entry to draft (publishable types only). */
|
|
76
|
+
unpublish(type: AnyContentType, id: string, workspaceId: string): Promise<EntryRecord>;
|
|
77
|
+
/**
|
|
78
|
+
* Delete an entry: soft (stamp `deleted_at`) for a paranoid type, hard
|
|
79
|
+
* `DELETE` otherwise. 404 if there's no live row to remove **in this
|
|
80
|
+
* workspace** — an id from another workspace is indistinguishable from a
|
|
81
|
+
* missing one.
|
|
82
|
+
*/
|
|
83
|
+
remove(type: AnyContentType, id: string, workspaceId: string): Promise<void>;
|
|
84
|
+
/**
|
|
85
|
+
* Clear a soft-deleted entry's tombstone (paranoid types only), or 404.
|
|
86
|
+
* On an i18n type the restore can collide with a row created in the same
|
|
87
|
+
* (locale group, locale) slot after the soft delete — the partial unique
|
|
88
|
+
* index rejects it, surfaced as a 409 rather than a 500.
|
|
89
|
+
*/
|
|
90
|
+
restore(type: AnyContentType, id: string, workspaceId: string): Promise<EntryRecord>;
|
|
91
|
+
/** Permanently delete a tombstoned entry (paranoid types only), or 404. */
|
|
92
|
+
purge(type: AnyContentType, id: string, workspaceId: string): Promise<void>;
|
|
93
|
+
/**
|
|
94
|
+
* Dry-run a publish over a set of ids: validate each live row and report a
|
|
95
|
+
* verdict (will-publish / already-published / blocked / not-found) in
|
|
96
|
+
* request order. Writes nothing.
|
|
97
|
+
*/
|
|
98
|
+
previewBulkPublish(type: AnyContentType, ids: string[], workspaceId: string): Promise<BulkPublishPreview>;
|
|
99
|
+
/**
|
|
100
|
+
* Commit a bulk publish. The validation gate is **locked**: the candidate
|
|
101
|
+
* rows are selected `FOR UPDATE` and re-validated inside one transaction, so
|
|
102
|
+
* a concurrent edit can't invalidate a row between the dry run and the write
|
|
103
|
+
* (the single-statement preview-then-update split had that TOCTOU window).
|
|
104
|
+
* Publishes only the `publishable` ids, reporting which were skipped and why.
|
|
105
|
+
*/
|
|
106
|
+
bulkPublish(type: AnyContentType, ids: string[], workspaceId: string): Promise<BulkPublishResult>;
|
|
107
|
+
/**
|
|
108
|
+
* Compute the per-entry publish verdict (will-publish / already-published /
|
|
109
|
+
* blocked / not-found) for `ids` in request order, given the live rows keyed
|
|
110
|
+
* by id. Pure — the dry run and the committed {@link bulkPublish} share it so
|
|
111
|
+
* they can't disagree on what's publishable.
|
|
112
|
+
*/
|
|
113
|
+
private verdictsFor;
|
|
114
|
+
/**
|
|
115
|
+
* The per-field publish-gate checklist for one record: every required field
|
|
116
|
+
* plus any field that has an issue, each marked pass/fail. Mirrors the
|
|
117
|
+
* editor's Publish Gate so a row can show its passed fields, not just the
|
|
118
|
+
* failures.
|
|
119
|
+
*/
|
|
120
|
+
private buildChecks;
|
|
121
|
+
/** Revert a set of live entries to draft. */
|
|
122
|
+
bulkUnpublish(type: AnyContentType, ids: string[], workspaceId: string): Promise<BulkActionResult>;
|
|
123
|
+
/** Delete a set of entries: soft for paranoid types, hard otherwise. */
|
|
124
|
+
bulkRemove(type: AnyContentType, ids: string[], workspaceId: string): Promise<BulkActionResult>;
|
|
125
|
+
/** Permanently delete a set of tombstoned entries (paranoid types only). */
|
|
126
|
+
bulkPurge(type: AnyContentType, ids: string[], workspaceId: string): Promise<BulkActionResult>;
|
|
127
|
+
/**
|
|
128
|
+
* Restore a set of soft-deleted entries (paranoid types only). As with
|
|
129
|
+
* {@link restore}, a restored row colliding with a live sibling in its
|
|
130
|
+
* (locale group, locale) slot is a 409 — the whole batch rolls back
|
|
131
|
+
* (single statement), so the caller can retry without the conflicting id.
|
|
132
|
+
*/
|
|
133
|
+
bulkRestore(type: AnyContentType, ids: string[], workspaceId: string): Promise<BulkActionResult>;
|
|
134
|
+
/**
|
|
135
|
+
* Run a write, translating a Postgres unique violation (23505) into a 409.
|
|
136
|
+
* Only i18n types carry a restore-relevant unique index — the partial
|
|
137
|
+
* `(locale_group_id, locale)` one — so the mapping is scoped to them and
|
|
138
|
+
* any other type's violation still surfaces as the bug it is.
|
|
139
|
+
*/
|
|
140
|
+
private uniqueGuarded;
|
|
141
|
+
/** The type's generated table seen as a column bag (envelope + fields). */
|
|
142
|
+
private columns;
|
|
143
|
+
/**
|
|
144
|
+
* `workspace_id = :workspaceId` — the ownership predicate every read and
|
|
145
|
+
* write AND-s in, so a request scoped to one workspace can neither see nor
|
|
146
|
+
* mutate another's rows.
|
|
147
|
+
*/
|
|
148
|
+
private scope;
|
|
149
|
+
/**
|
|
150
|
+
* `id = :id` AND the workspace scope AND (for paranoid types)
|
|
151
|
+
* `deleted_at IS NULL`.
|
|
152
|
+
*/
|
|
153
|
+
private liveWhere;
|
|
154
|
+
/** Fetch one live row by id in the workspace, or undefined. */
|
|
155
|
+
private findLive;
|
|
156
|
+
/** Fetch the workspace's live rows for a set of ids, keyed by id. */
|
|
157
|
+
private loadLiveByIds;
|
|
158
|
+
/**
|
|
159
|
+
* Verify every referenced relation target exists **in the same workspace** —
|
|
160
|
+
* single FKs, many-to-many links, and the inverse (back-reference) side of a
|
|
161
|
+
* two-way relation. Neither the FK column nor the join table has a workspace
|
|
162
|
+
* constraint of its own (the target table is workspace-scoped only at the app
|
|
163
|
+
* layer), so without this a caller could reference — or probe the existence
|
|
164
|
+
* of — an entry in another workspace. Batched one existence query per
|
|
165
|
+
* referenced target type; a missing or cross-workspace target surfaces as a
|
|
166
|
+
* uniform 422 validation issue (indistinguishable from a plain "invalid id",
|
|
167
|
+
* so no not-found-vs-forbidden enumeration signal). Runs on every
|
|
168
|
+
* create/update, draft or not, because links are written eagerly either way.
|
|
169
|
+
* An inverse-of-single (one-to-many) field owns no writable link from this
|
|
170
|
+
* side, so it's skipped.
|
|
171
|
+
*/
|
|
172
|
+
private assertRelationTargets;
|
|
173
|
+
/**
|
|
174
|
+
* Enforce required **link-managed** relations (an owning many-to-many, or the
|
|
175
|
+
* inverse of one) against the entry's actual link set — the check
|
|
176
|
+
* {@link EntryValidationService} can't make, because those links never travel
|
|
177
|
+
* in the `values` bag it sees. A required such relation with zero links is a
|
|
178
|
+
* 422 `is required`, matching how a required scalar field reads. A single FK
|
|
179
|
+
* relation is validated in `values` already; an inverse-of-single owns no
|
|
180
|
+
* writable link from this side, so it's skipped (it can't be satisfied here).
|
|
181
|
+
* `exec` is the write transaction on create/update (so it counts the
|
|
182
|
+
* just-written, uncommitted rows) or the root client on publish (committed).
|
|
183
|
+
*/
|
|
184
|
+
private assertRequiredRelations;
|
|
185
|
+
/** Throw 422 with the issue list when the values fail validation. */
|
|
186
|
+
private assertValid;
|
|
187
|
+
/** Reject publish/unpublish on a type with no publish workflow. */
|
|
188
|
+
private assertPublishable;
|
|
189
|
+
/** Reject restore/purge on a type without soft delete. */
|
|
190
|
+
private assertParanoid;
|
|
191
|
+
private notFound;
|
|
192
|
+
}
|
|
193
|
+
//# sourceMappingURL=entry-writer.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry-writer.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/entries/services/entry-writer.service.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { type Database } from '@ortha-cms/database';
|
|
2
|
+
import type { AnyContentType } from '../../types/content-type';
|
|
3
|
+
import { type AnyFieldSpec } from '../../types/fields';
|
|
4
|
+
import type { RelationDelta, RelationFieldView } from '../types/entry-list-view';
|
|
5
|
+
/** A generated content row seen as a bag of values by property name. */
|
|
6
|
+
type Row = Record<string, unknown>;
|
|
7
|
+
/** Default links per page when the caller doesn't specify one. */
|
|
8
|
+
export declare const RELATION_PAGE_SIZE = 20;
|
|
9
|
+
/**
|
|
10
|
+
* The transaction handle Drizzle hands the `db.transaction(tx => …)` callback —
|
|
11
|
+
* derived from {@link Database} so link writes share the exact query surface of
|
|
12
|
+
* the client without hard-coding the dialect's transaction type.
|
|
13
|
+
*/
|
|
14
|
+
export type DbTransaction = Parameters<Parameters<Database['transaction']>[0]>[0];
|
|
15
|
+
/**
|
|
16
|
+
* Reads and writes the relation **links** an entry owns beyond its own columns:
|
|
17
|
+
* many-to-many join rows and the inverse (back-reference) side of a two-way
|
|
18
|
+
* relation. Owning **single** relations are plain `<field>_id` FK columns —
|
|
19
|
+
* written by `toColumns`, read off the row — so they need no join plumbing.
|
|
20
|
+
*
|
|
21
|
+
* Everything is **paginated**: a relation can hold thousands of links, so reads
|
|
22
|
+
* return one ordered page + a `total` (never every id), and writes apply an
|
|
23
|
+
* incremental {@link RelationDelta} (link / unlink / reorder) inside a
|
|
24
|
+
* transaction — so a huge relation never has to be sent or held in full.
|
|
25
|
+
* Order is persisted in the join table's `position` column, owned by the
|
|
26
|
+
* **source** side; the inverse reads by it (stable) but can't reorder it.
|
|
27
|
+
*/
|
|
28
|
+
export declare class RelationLinkService {
|
|
29
|
+
private readonly db;
|
|
30
|
+
constructor(db: Database);
|
|
31
|
+
/**
|
|
32
|
+
* First page (+ total) of **every** relation field of `type` for one entry,
|
|
33
|
+
* keyed by field name — what the editor loads on open. Each field is read
|
|
34
|
+
* independently (paginated), so a relation with many links contributes only
|
|
35
|
+
* its first page, not every id.
|
|
36
|
+
*/
|
|
37
|
+
readAll(type: AnyContentType, row: Row, workspaceId: string, pageSize?: number): Promise<Record<string, RelationFieldView>>;
|
|
38
|
+
/**
|
|
39
|
+
* One page of a single relation field's links, ordered by `position`
|
|
40
|
+
* (owning) and resolved to display-ready refs (id + title). `row` is the
|
|
41
|
+
* editing entry (its FK columns back a single relation); pass it to avoid a
|
|
42
|
+
* re-read. Returns `{ items, total }`.
|
|
43
|
+
*/
|
|
44
|
+
readField(type: AnyContentType, row: Row, field: string, spec: AnyFieldSpec, page: number, pageSize: number, workspaceId: string): Promise<RelationFieldView>;
|
|
45
|
+
/**
|
|
46
|
+
* Apply an incremental {@link RelationDelta} to one many/inverse relation
|
|
47
|
+
* field inside `tx`: validate the linked targets are in the workspace, unlink
|
|
48
|
+
* the removed pairs, append the new ones (`position = max+1` for the source,
|
|
49
|
+
* `ON CONFLICT DO NOTHING`), then renumber to `order` (owning side only).
|
|
50
|
+
* A single relation or an inverse-of-single owns no delta-writable link, so
|
|
51
|
+
* it's a no-op. Returns nothing — read the field back for the new state.
|
|
52
|
+
*/
|
|
53
|
+
applyDelta(tx: DbTransaction, type: AnyContentType, sourceId: string, field: string, delta: RelationDelta, workspaceId: string): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Replace a many-relation's links with exactly `values[field]` (array),
|
|
56
|
+
* position = array index — the **whole-set** write used only when a caller
|
|
57
|
+
* genuinely submits a relation **array** in the entry body (legacy / bulk).
|
|
58
|
+
* The editor uses {@link applyDelta} instead. Runs inside the entry's
|
|
59
|
+
* transaction. **Only an array counts**: a field that's absent or `null`
|
|
60
|
+
* (`coerceValues` stamps `null` onto every unset field) is left untouched, so
|
|
61
|
+
* a save that manages a relation purely through deltas can never have its
|
|
62
|
+
* links cleared here.
|
|
63
|
+
*/
|
|
64
|
+
writeLinks(tx: DbTransaction, type: AnyContentType, sourceId: string, values: Record<string, unknown>, workspaceId: string): Promise<void>;
|
|
65
|
+
/**
|
|
66
|
+
* Count the links of one join-backed relation field for an entry — the
|
|
67
|
+
* `total` a read would report, without fetching or resolving any page. Runs
|
|
68
|
+
* on the passed executor (the write transaction when validating a just-saved
|
|
69
|
+
* entry, so it sees the delta's uncommitted rows). Returns 0 for a relation
|
|
70
|
+
* that owns no writable links from this side (single FK / inverse-of-single).
|
|
71
|
+
*/
|
|
72
|
+
countLinks(exec: Database | DbTransaction, type: AnyContentType, row: Row, field: string, spec: AnyFieldSpec, workspaceId: string): Promise<number>;
|
|
73
|
+
/**
|
|
74
|
+
* Take the transaction-scoped advisory lock for one physical source list
|
|
75
|
+
* (`<join table>:<sourceId>`), serializing every appender to that list so no
|
|
76
|
+
* two concurrent writes read the same `max(position)`. Auto-releases at
|
|
77
|
+
* commit/rollback. Keyed on the table name too, so distinct join tables that
|
|
78
|
+
* happen to share a source id don't falsely contend.
|
|
79
|
+
*/
|
|
80
|
+
private lockSource;
|
|
81
|
+
/** Next append position for a source: `max(position) + 1`, else 0. */
|
|
82
|
+
private nextPosition;
|
|
83
|
+
/**
|
|
84
|
+
* Resolve `ids` (in order) to display-ready refs via one lookup on the target
|
|
85
|
+
* type, scoped to the workspace. Ids with no **live** row drop to an id-only
|
|
86
|
+
* ref — a soft-deleted (paranoid) target is excluded here just as it is on
|
|
87
|
+
* the inverse read side, so a trashed record never surfaces its title on the
|
|
88
|
+
* owning side while it's hidden on the other.
|
|
89
|
+
*/
|
|
90
|
+
private refsFor;
|
|
91
|
+
/** Build a display ref from a full target row. */
|
|
92
|
+
private rowToRef;
|
|
93
|
+
/**
|
|
94
|
+
* Verify every id to be linked exists **in the same workspace** (the join FK
|
|
95
|
+
* has no workspace constraint of its own). A missing or cross-workspace id is
|
|
96
|
+
* a uniform 422 — indistinguishable from an invalid id, so no enumeration
|
|
97
|
+
* signal.
|
|
98
|
+
*/
|
|
99
|
+
private assertTargets;
|
|
100
|
+
/**
|
|
101
|
+
* The join-table plan for a relation field, or `null` when it owns no join
|
|
102
|
+
* table (an owning single relation, or an inverse-of-single). An owning
|
|
103
|
+
* many-relation uses its own join table (`source→target`); an inverse of a
|
|
104
|
+
* many-to-many reuses the owning side's join table with the roles swapped.
|
|
105
|
+
*/
|
|
106
|
+
private joinPlanFor;
|
|
107
|
+
/**
|
|
108
|
+
* The inverse-of-single (one-to-many) plan for a relation field, or `null`:
|
|
109
|
+
* it reads the owner rows whose FK points back at the editing record, and
|
|
110
|
+
* owns no writable link from this side.
|
|
111
|
+
*/
|
|
112
|
+
private inversePlanFor;
|
|
113
|
+
}
|
|
114
|
+
export {};
|
|
115
|
+
//# sourceMappingURL=relation-link.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relation-link.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/entries/services/relation-link.service.ts"],"names":[],"mappings":"AAeA,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,KAAK,EAAE,cAAc,EAAe,MAAM,0BAA0B,CAAC;AAC5E,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,KAAK,EACR,aAAa,EACb,iBAAiB,EAEpB,MAAM,0BAA0B,CAAC;AAMlC,wEAAwE;AACxE,KAAK,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEnC,kEAAkE;AAClE,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAUrC;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,UAAU,CAClC,UAAU,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CACzC,CAAC,CAAC,CAAC,CAAC;AA0BL;;;;;;;;;;;;GAYG;AACH,qBACa,mBAAmB;IACE,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAAF,EAAE,EAAE,QAAQ;IAI3D;;;;;OAKG;IACG,OAAO,CACT,IAAI,EAAE,cAAc,EACpB,GAAG,EAAE,GAAG,EACR,WAAW,EAAE,MAAM,EACnB,QAAQ,SAAqB,GAC9B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IAoB7C;;;;;OAKG;IACG,SAAS,CACX,IAAI,EAAE,cAAc,EACpB,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,GACpB,OAAO,CAAC,iBAAiB,CAAC;IA0E7B;;;;;;;OAOG;IACG,UAAU,CACZ,EAAE,EAAE,aAAa,EACjB,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,aAAa,EACpB,WAAW,EAAE,MAAM,GACpB,OAAO,CAAC,IAAI,CAAC;IA+FhB;;;;;;;;;OASG;IACG,UAAU,CACZ,EAAE,EAAE,aAAa,EACjB,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,WAAW,EAAE,MAAM,GACpB,OAAO,CAAC,IAAI,CAAC;IAwChB;;;;;;OAMG;IACG,UAAU,CACZ,IAAI,EAAE,QAAQ,GAAG,aAAa,EAC9B,IAAI,EAAE,cAAc,EACpB,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,YAAY,EAClB,WAAW,EAAE,MAAM,GACpB,OAAO,CAAC,MAAM,CAAC;IA8BlB;;;;;;OAMG;YACW,UAAU;IAWxB,sEAAsE;YACxD,YAAY;IAc1B;;;;;;OAMG;YACW,OAAO;IAuBrB,kDAAkD;IAClD,OAAO,CAAC,QAAQ;IAWhB;;;;;OAKG;YACW,aAAa;IAmC3B;;;;;OAKG;IACH,OAAO,CAAC,WAAW;IA8BnB;;;;OAIG;IACH,OAAO,CAAC,cAAc;CAYzB"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire contracts for the bulk-publish dry run and its commit. The preview is
|
|
3
|
+
* advisory (the admin renders it in a confirm modal); the commit re-validates
|
|
4
|
+
* server-side and never trusts the client's copy.
|
|
5
|
+
*/
|
|
6
|
+
import type { EntryStatus } from '../../types/content-type';
|
|
7
|
+
import type { ValidationIssue } from '../../validation/services/entry-validation.service';
|
|
8
|
+
/**
|
|
9
|
+
* The outcome of dry-running a publish against one selected entry. The runtime
|
|
10
|
+
* object is the source of truth so the admin and server share the verdict set.
|
|
11
|
+
*/
|
|
12
|
+
export declare const BULK_VERDICT: {
|
|
13
|
+
/** Currently a draft and valid — will publish. */
|
|
14
|
+
readonly Publishable: "publishable";
|
|
15
|
+
/** Already published — nothing to do. */
|
|
16
|
+
readonly AlreadyPublished: "already-published";
|
|
17
|
+
/** Has validation issues — cannot publish until fixed. */
|
|
18
|
+
readonly Blocked: "blocked";
|
|
19
|
+
/** No live row with this id (unknown or soft-deleted). */
|
|
20
|
+
readonly NotFound: "not-found";
|
|
21
|
+
};
|
|
22
|
+
/** One row's dry-run verdict. */
|
|
23
|
+
export type BulkVerdictKind = (typeof BULK_VERDICT)[keyof typeof BULK_VERDICT];
|
|
24
|
+
/**
|
|
25
|
+
* One field's publish-gate check: whether it currently passes (and, when it
|
|
26
|
+
* doesn't, why). Lets the admin show a full per-record checklist — passed fields
|
|
27
|
+
* included — not just the failures.
|
|
28
|
+
*/
|
|
29
|
+
export interface BulkPublishCheck {
|
|
30
|
+
/** Field name. */
|
|
31
|
+
field: string;
|
|
32
|
+
/** Human label (admin label, else the field name). */
|
|
33
|
+
label: string;
|
|
34
|
+
/** Whether the field passes publish validation. */
|
|
35
|
+
ok: boolean;
|
|
36
|
+
/** The failure message when `ok` is false. */
|
|
37
|
+
message?: string;
|
|
38
|
+
}
|
|
39
|
+
/** Per-entry result in a bulk-publish dry run. */
|
|
40
|
+
export interface BulkPublishVerdict {
|
|
41
|
+
id: string;
|
|
42
|
+
/** Display label (first text field, else id). */
|
|
43
|
+
title: string;
|
|
44
|
+
/** Current publish state, or null when not found. */
|
|
45
|
+
status: EntryStatus | null;
|
|
46
|
+
verdict: BulkVerdictKind;
|
|
47
|
+
/** Populated only when `verdict === 'blocked'`. */
|
|
48
|
+
issues: ValidationIssue[];
|
|
49
|
+
/**
|
|
50
|
+
* Per-field publish-gate checks (required fields + any field with an issue),
|
|
51
|
+
* for any record the server validated — `publishable`, `blocked`, and
|
|
52
|
+
* `already-published` (whose checks all pass). Empty only for a `not-found`
|
|
53
|
+
* row, which has no record to check.
|
|
54
|
+
*/
|
|
55
|
+
checks: BulkPublishCheck[];
|
|
56
|
+
}
|
|
57
|
+
/** The dry-run response: one verdict per requested id, in request order. */
|
|
58
|
+
export interface BulkPublishPreview {
|
|
59
|
+
items: BulkPublishVerdict[];
|
|
60
|
+
}
|
|
61
|
+
/** The result of committing a bulk publish. */
|
|
62
|
+
export interface BulkPublishResult {
|
|
63
|
+
/** Ids actually transitioned to published. */
|
|
64
|
+
published: string[];
|
|
65
|
+
/** Ids left untouched, with why (a non-publishable verdict kind). */
|
|
66
|
+
skipped: {
|
|
67
|
+
id: string;
|
|
68
|
+
reason: BulkVerdictKind;
|
|
69
|
+
}[];
|
|
70
|
+
}
|
|
71
|
+
/** The result of a bulk unpublish/delete/restore — how many rows changed. */
|
|
72
|
+
export interface BulkActionResult {
|
|
73
|
+
count: number;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=bulk-publish.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bulk-publish.d.ts","sourceRoot":"","sources":["../../../../src/lib/entries/types/bulk-publish.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oDAAoD,CAAC;AAE1F;;;GAGG;AACH,eAAO,MAAM,YAAY;IACrB,kDAAkD;;IAElD,yCAAyC;;IAEzC,0DAA0D;;IAE1D,0DAA0D;;CAEpD,CAAC;AAEX,iCAAiC;AACjC,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAE/E;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC7B,kBAAkB;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,KAAK,EAAE,MAAM,CAAC;IACd,mDAAmD;IACnD,EAAE,EAAE,OAAO,CAAC;IACZ,8CAA8C;IAC9C,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,kDAAkD;AAClD,MAAM,WAAW,kBAAkB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,qDAAqD;IACrD,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC;IAC3B,OAAO,EAAE,eAAe,CAAC;IACzB,mDAAmD;IACnD,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B;;;;;OAKG;IACH,MAAM,EAAE,gBAAgB,EAAE,CAAC;CAC9B;AAED,4EAA4E;AAC5E,MAAM,WAAW,kBAAkB;IAC/B,KAAK,EAAE,kBAAkB,EAAE,CAAC;CAC/B;AAED,+CAA+C;AAC/C,MAAM,WAAW,iBAAiB;IAC9B,8CAA8C;IAC9C,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,qEAAqE;IACrE,OAAO,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,eAAe,CAAA;KAAE,EAAE,CAAC;CACtD;AAED,6EAA6E;AAC7E,MAAM,WAAW,gBAAgB;IAC7B,KAAK,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Wire contracts for the bulk-publish dry run and its commit. The preview is
|
|
4
|
+
* advisory (the admin renders it in a confirm modal); the commit re-validates
|
|
5
|
+
* server-side and never trusts the client's copy.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.BULK_VERDICT = void 0;
|
|
9
|
+
/**
|
|
10
|
+
* The outcome of dry-running a publish against one selected entry. The runtime
|
|
11
|
+
* object is the source of truth so the admin and server share the verdict set.
|
|
12
|
+
*/
|
|
13
|
+
exports.BULK_VERDICT = {
|
|
14
|
+
/** Currently a draft and valid — will publish. */
|
|
15
|
+
Publishable: 'publishable',
|
|
16
|
+
/** Already published — nothing to do. */
|
|
17
|
+
AlreadyPublished: 'already-published',
|
|
18
|
+
/** Has validation issues — cannot publish until fixed. */
|
|
19
|
+
Blocked: 'blocked',
|
|
20
|
+
/** No live row with this id (unknown or soft-deleted). */
|
|
21
|
+
NotFound: 'not-found'
|
|
22
|
+
};
|