@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,307 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PublicEntriesController = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const common_1 = require("@nestjs/common");
|
|
6
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
7
|
+
const identity_server_1 = require("@orthacms/identity-server");
|
|
8
|
+
const workspaces_server_1 = require("@orthacms/workspaces-server");
|
|
9
|
+
const content_tokens_1 = require("../../../content.tokens");
|
|
10
|
+
const workspace_grants_query_1 = require("../../../content-types/queries/workspace-grants.query");
|
|
11
|
+
const public_entries_query_1 = require("../../infrastructure/public-entries.query");
|
|
12
|
+
const relation_link_service_1 = require("../../../entries/infrastructure/persistence/relation-link.service");
|
|
13
|
+
const api_token_guard_1 = require("../guards/api-token.guard");
|
|
14
|
+
const api_token_workspace_guard_1 = require("../guards/api-token-workspace.guard");
|
|
15
|
+
const draft_visibility_guard_1 = require("../guards/draft-visibility.guard");
|
|
16
|
+
const public_list_entries_query_dto_1 = require("../dto/public-list-entries-query.dto");
|
|
17
|
+
const resolve_granted_type_1 = require("./resolve-granted-type");
|
|
18
|
+
/**
|
|
19
|
+
* `GET /api/v1/content/...` — the **public, token-authenticated read API** an
|
|
20
|
+
* external site or app fetches content with. One route pair serves every
|
|
21
|
+
* code-defined type: `:typeName` is resolved against the registry (and the
|
|
22
|
+
* workspace's grants) at request time.
|
|
23
|
+
*
|
|
24
|
+
* `@Public()` opts these routes out of the session `AuthGuard`; `ApiTokenGuard`
|
|
25
|
+
* then authenticates the `Authorization: Bearer` token and checks
|
|
26
|
+
* `content:read` against its scope, and `ApiTokenWorkspaceGuard` resolves which
|
|
27
|
+
* of the token's workspaces the request targets (the `X-Workspace-Id` header,
|
|
28
|
+
* or the only one when the token covers a single workspace).
|
|
29
|
+
*
|
|
30
|
+
* Reads are flat and live-only — published entries, no drafts, no soft-deleted
|
|
31
|
+
* rows, and `values` carries the entry's own data only (no relation or media
|
|
32
|
+
* fields, in either direction). See {@link PublicEntriesQuery} for the exact
|
|
33
|
+
* visibility rule and `types/public-entry.ts` for the wire shape.
|
|
34
|
+
*
|
|
35
|
+
* A `single` (page) type is served by the same list route as a collection: with
|
|
36
|
+
* localization a single still has one row per locale, so a list envelope is the
|
|
37
|
+
* honest shape for both — take `items[0]`.
|
|
38
|
+
*/
|
|
39
|
+
let PublicEntriesController = class PublicEntriesController {
|
|
40
|
+
registry;
|
|
41
|
+
grants;
|
|
42
|
+
entries;
|
|
43
|
+
constructor(registry, grants, entries) {
|
|
44
|
+
this.registry = registry;
|
|
45
|
+
this.grants = grants;
|
|
46
|
+
this.entries = entries;
|
|
47
|
+
}
|
|
48
|
+
/** `GET /api/v1/content/:typeName` — one page of published entries. */
|
|
49
|
+
async list(typeName, query, workspaceId) {
|
|
50
|
+
const { type, granted } = await (0, resolve_granted_type_1.resolveGrantedType)(this.registry, this.grants, typeName, workspaceId);
|
|
51
|
+
return this.entries.list(type, query, workspaceId, granted);
|
|
52
|
+
}
|
|
53
|
+
// ---- addressed by translation group -----------------------------------
|
|
54
|
+
//
|
|
55
|
+
// Every single-entry read below exists twice: once under `:id` and once
|
|
56
|
+
// under `group/:localeGroupId`. Anything a consumer can do holding an
|
|
57
|
+
// entry id, it can do holding the group id plus a `?locale=` — which is
|
|
58
|
+
// the identity a localized front-end actually carries, since the group is
|
|
59
|
+
// stable across languages and each locale's `id` is not. Both forms funnel
|
|
60
|
+
// into the same `EntryLocator`, so the two spellings cannot drift on what
|
|
61
|
+
// they return or what they hide.
|
|
62
|
+
//
|
|
63
|
+
// The `group/...` routes are declared FIRST. They cannot be shadowed by
|
|
64
|
+
// the `:id` ones on segment count alone (`:typeName/:id/relations/:field`
|
|
65
|
+
// requires a literal `relations` where a group route carries the group id),
|
|
66
|
+
// but Express matches in declaration order, so putting the more specific
|
|
67
|
+
// literal-prefixed routes ahead of the wildcards keeps that independent of
|
|
68
|
+
// how the pattern set grows.
|
|
69
|
+
/**
|
|
70
|
+
* `GET /api/v1/content/:typeName/group/:localeGroupId` — one published
|
|
71
|
+
* entry addressed by its translation group and the requested locale.
|
|
72
|
+
*/
|
|
73
|
+
async getByLocaleGroup(typeName, localeGroupId, query, workspaceId) {
|
|
74
|
+
return this.readEntry(typeName, { localeGroupId }, query, workspaceId);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* `GET /api/v1/content/:typeName/group/:localeGroupId/relations/:field` —
|
|
78
|
+
* one page of a relation field's links, for the group's row in the
|
|
79
|
+
* requested locale.
|
|
80
|
+
*/
|
|
81
|
+
async getRelationFieldByLocaleGroup(typeName, localeGroupId, field, query, workspaceId) {
|
|
82
|
+
return this.readRelationField(typeName, { localeGroupId }, field, query, workspaceId);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* `GET /api/v1/content/:typeName/group/:localeGroupId/media` — the media
|
|
86
|
+
* assets of the group's row in the requested locale.
|
|
87
|
+
*/
|
|
88
|
+
async getMediaByLocaleGroup(typeName, localeGroupId, query, workspaceId) {
|
|
89
|
+
return this.readMedia(typeName, { localeGroupId }, query, workspaceId);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* `GET /api/v1/content/:typeName/group/:localeGroupId/translations` — the
|
|
93
|
+
* group's other published locale rows.
|
|
94
|
+
*
|
|
95
|
+
* Reachable without holding any entry id at all: the group id alone names
|
|
96
|
+
* every language a story is live in.
|
|
97
|
+
*/
|
|
98
|
+
async getTranslationsByLocaleGroup(typeName, localeGroupId, query, workspaceId) {
|
|
99
|
+
return this.readTranslations(typeName, { localeGroupId }, query, workspaceId);
|
|
100
|
+
}
|
|
101
|
+
// ---- addressed by entry id ---------------------------------------------
|
|
102
|
+
/** `GET /api/v1/content/:typeName/:id` — one published entry. */
|
|
103
|
+
async getOne(typeName, id, query, workspaceId) {
|
|
104
|
+
return this.readEntry(typeName, { id }, query, workspaceId);
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* `GET /api/v1/content/:typeName/:id/relations/:field` — one page of a
|
|
108
|
+
* single relation field's links.
|
|
109
|
+
*
|
|
110
|
+
* The **only** relation route, deliberately. An all-fields sibling
|
|
111
|
+
* (`/:id/relations`) used to sit here and returned exactly what
|
|
112
|
+
* `GET /:id?relations=preview` already returns minus the entry — a second
|
|
113
|
+
* spelling of one read, on a contract that has to stay still. Paging one
|
|
114
|
+
* field past the preview's cap is the one thing a query parameter cannot
|
|
115
|
+
* express, so it is the one thing that keeps a route.
|
|
116
|
+
*/
|
|
117
|
+
async getRelationField(typeName, id, field, query, workspaceId) {
|
|
118
|
+
return this.readRelationField(typeName, { id }, field, query, workspaceId);
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* `GET /api/v1/content/:typeName/:id/media` — every media field of one
|
|
122
|
+
* entry, resolved to asset metadata and URLs.
|
|
123
|
+
*/
|
|
124
|
+
async getMedia(typeName, id, query, workspaceId) {
|
|
125
|
+
return this.readMedia(typeName, { id }, query, workspaceId);
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* `GET /api/v1/content/:typeName/:id/translations` — the entry's other
|
|
129
|
+
* locale rows. The sibling of `?translations=preview`, for a consumer that
|
|
130
|
+
* already holds the entry.
|
|
131
|
+
*/
|
|
132
|
+
async getTranslations(typeName, id, query, workspaceId) {
|
|
133
|
+
return this.readTranslations(typeName, { id }, query, workspaceId);
|
|
134
|
+
}
|
|
135
|
+
// ---- the shared handlers, one per read ---------------------------------
|
|
136
|
+
//
|
|
137
|
+
// Each is called by exactly two routes — the `:id` spelling and the
|
|
138
|
+
// `group/:localeGroupId` one — so the pair is a routing detail and never a
|
|
139
|
+
// behavioural fork.
|
|
140
|
+
/** @see getOne */
|
|
141
|
+
async readEntry(typeName, locator, query, workspaceId) {
|
|
142
|
+
const { type, granted } = await (0, resolve_granted_type_1.resolveGrantedType)(this.registry, this.grants, typeName, workspaceId);
|
|
143
|
+
return this.entries.getOne(type, locator, workspaceId, query, granted);
|
|
144
|
+
}
|
|
145
|
+
/** @see getRelationField */
|
|
146
|
+
async readRelationField(typeName, locator, field, query, workspaceId) {
|
|
147
|
+
const { type, granted } = await (0, resolve_granted_type_1.resolveGrantedType)(this.registry, this.grants, typeName, workspaceId);
|
|
148
|
+
return this.entries.relationField(type, locator, field, query.page ?? 1, query.pageSize ?? query.relationLimit ?? relation_link_service_1.RELATION_PAGE_SIZE, workspaceId, granted, query.locale, query.status);
|
|
149
|
+
}
|
|
150
|
+
/** @see getMedia */
|
|
151
|
+
async readMedia(typeName, locator, query, workspaceId) {
|
|
152
|
+
const { type } = await (0, resolve_granted_type_1.resolveGrantedType)(this.registry, this.grants, typeName, workspaceId);
|
|
153
|
+
return {
|
|
154
|
+
media: await this.entries.mediaOf(type, locator, workspaceId, query.locale, query.mediaLimit, query.status)
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
/** @see getTranslations */
|
|
158
|
+
async readTranslations(typeName, locator, query, workspaceId) {
|
|
159
|
+
const { type } = await (0, resolve_granted_type_1.resolveGrantedType)(this.registry, this.grants, typeName, workspaceId);
|
|
160
|
+
return {
|
|
161
|
+
translations: await this.entries.translationsOf(type, locator, workspaceId, query)
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
exports.PublicEntriesController = PublicEntriesController;
|
|
166
|
+
tslib_1.__decorate([
|
|
167
|
+
(0, common_1.Get)(':typeName'),
|
|
168
|
+
(0, swagger_1.ApiOperation)({
|
|
169
|
+
summary: 'List published entries of a content type',
|
|
170
|
+
description: 'One page of the type’s published, non-deleted entries in the requested workspace, newest-updated first by default. Supports free-text `?search=` and the structured `?filter=` tree (the same shape the admin query builder emits). 404 when the type is unknown or the workspace was not granted it.'
|
|
171
|
+
}),
|
|
172
|
+
tslib_1.__param(0, (0, common_1.Param)('typeName')),
|
|
173
|
+
tslib_1.__param(1, (0, common_1.Query)()),
|
|
174
|
+
tslib_1.__param(2, (0, workspaces_server_1.CurrentWorkspace)()),
|
|
175
|
+
tslib_1.__metadata("design:type", Function),
|
|
176
|
+
tslib_1.__metadata("design:paramtypes", [String, public_list_entries_query_dto_1.PublicListEntriesQueryDto, String]),
|
|
177
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
178
|
+
], PublicEntriesController.prototype, "list", null);
|
|
179
|
+
tslib_1.__decorate([
|
|
180
|
+
(0, common_1.Get)(':typeName/group/:localeGroupId'),
|
|
181
|
+
(0, swagger_1.ApiOperation)({
|
|
182
|
+
summary: 'Read one published entry by translation group + locale',
|
|
183
|
+
description: 'The group’s published row in the requested `?locale=` (the default locale when none is given) — so a localized front-end renders “this story” by varying the locale alone, instead of keeping a per-locale id map. Takes the same expansion params as the `:id` read. 404 when the group has no published row in that locale, or does not exist. 400 when the type is not localized.'
|
|
184
|
+
}),
|
|
185
|
+
tslib_1.__param(0, (0, common_1.Param)('typeName')),
|
|
186
|
+
tslib_1.__param(1, (0, common_1.Param)('localeGroupId', common_1.ParseUUIDPipe)),
|
|
187
|
+
tslib_1.__param(2, (0, common_1.Query)()),
|
|
188
|
+
tslib_1.__param(3, (0, workspaces_server_1.CurrentWorkspace)()),
|
|
189
|
+
tslib_1.__metadata("design:type", Function),
|
|
190
|
+
tslib_1.__metadata("design:paramtypes", [String, String, public_list_entries_query_dto_1.PublicEntryQueryDto, String]),
|
|
191
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
192
|
+
], PublicEntriesController.prototype, "getByLocaleGroup", null);
|
|
193
|
+
tslib_1.__decorate([
|
|
194
|
+
(0, common_1.Get)(':typeName/group/:localeGroupId/relations/:field'),
|
|
195
|
+
(0, swagger_1.ApiOperation)({
|
|
196
|
+
summary: 'Page one relation field’s links, by translation group',
|
|
197
|
+
description: 'As the `:id` form, for the group’s published row in the requested `?locale=`.'
|
|
198
|
+
}),
|
|
199
|
+
tslib_1.__param(0, (0, common_1.Param)('typeName')),
|
|
200
|
+
tslib_1.__param(1, (0, common_1.Param)('localeGroupId', common_1.ParseUUIDPipe)),
|
|
201
|
+
tslib_1.__param(2, (0, common_1.Param)('field')),
|
|
202
|
+
tslib_1.__param(3, (0, common_1.Query)()),
|
|
203
|
+
tslib_1.__param(4, (0, workspaces_server_1.CurrentWorkspace)()),
|
|
204
|
+
tslib_1.__metadata("design:type", Function),
|
|
205
|
+
tslib_1.__metadata("design:paramtypes", [String, String, String, public_list_entries_query_dto_1.PublicListEntriesQueryDto, String]),
|
|
206
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
207
|
+
], PublicEntriesController.prototype, "getRelationFieldByLocaleGroup", null);
|
|
208
|
+
tslib_1.__decorate([
|
|
209
|
+
(0, common_1.Get)(':typeName/group/:localeGroupId/media'),
|
|
210
|
+
(0, swagger_1.ApiOperation)({
|
|
211
|
+
summary: 'Read one entry’s media assets, by translation group',
|
|
212
|
+
description: 'As the `:id` form, for the group’s published row in the requested `?locale=`.'
|
|
213
|
+
}),
|
|
214
|
+
tslib_1.__param(0, (0, common_1.Param)('typeName')),
|
|
215
|
+
tslib_1.__param(1, (0, common_1.Param)('localeGroupId', common_1.ParseUUIDPipe)),
|
|
216
|
+
tslib_1.__param(2, (0, common_1.Query)()),
|
|
217
|
+
tslib_1.__param(3, (0, workspaces_server_1.CurrentWorkspace)()),
|
|
218
|
+
tslib_1.__metadata("design:type", Function),
|
|
219
|
+
tslib_1.__metadata("design:paramtypes", [String, String, public_list_entries_query_dto_1.PublicEntryQueryDto, String]),
|
|
220
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
221
|
+
], PublicEntriesController.prototype, "getMediaByLocaleGroup", null);
|
|
222
|
+
tslib_1.__decorate([
|
|
223
|
+
(0, common_1.Get)(':typeName/group/:localeGroupId/translations'),
|
|
224
|
+
(0, swagger_1.ApiOperation)({
|
|
225
|
+
summary: 'Read a translation group’s other locale rows',
|
|
226
|
+
description: 'As the `:id` form, for the group’s published row in the requested `?locale=` — so the group id alone is enough to enumerate the languages a story is live in.'
|
|
227
|
+
}),
|
|
228
|
+
tslib_1.__param(0, (0, common_1.Param)('typeName')),
|
|
229
|
+
tslib_1.__param(1, (0, common_1.Param)('localeGroupId', common_1.ParseUUIDPipe)),
|
|
230
|
+
tslib_1.__param(2, (0, common_1.Query)()),
|
|
231
|
+
tslib_1.__param(3, (0, workspaces_server_1.CurrentWorkspace)()),
|
|
232
|
+
tslib_1.__metadata("design:type", Function),
|
|
233
|
+
tslib_1.__metadata("design:paramtypes", [String, String, public_list_entries_query_dto_1.PublicEntryQueryDto, String]),
|
|
234
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
235
|
+
], PublicEntriesController.prototype, "getTranslationsByLocaleGroup", null);
|
|
236
|
+
tslib_1.__decorate([
|
|
237
|
+
(0, common_1.Get)(':typeName/:id'),
|
|
238
|
+
(0, swagger_1.ApiOperation)({
|
|
239
|
+
summary: 'Read one published entry',
|
|
240
|
+
description: 'A single published, non-deleted entry of the type. A draft, a soft-deleted entry, one in another workspace, and an unknown id are all the same 404.'
|
|
241
|
+
}),
|
|
242
|
+
tslib_1.__param(0, (0, common_1.Param)('typeName')),
|
|
243
|
+
tslib_1.__param(1, (0, common_1.Param)('id', common_1.ParseUUIDPipe)),
|
|
244
|
+
tslib_1.__param(2, (0, common_1.Query)()),
|
|
245
|
+
tslib_1.__param(3, (0, workspaces_server_1.CurrentWorkspace)()),
|
|
246
|
+
tslib_1.__metadata("design:type", Function),
|
|
247
|
+
tslib_1.__metadata("design:paramtypes", [String, String, public_list_entries_query_dto_1.PublicEntryQueryDto, String]),
|
|
248
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
249
|
+
], PublicEntriesController.prototype, "getOne", null);
|
|
250
|
+
tslib_1.__decorate([
|
|
251
|
+
(0, common_1.Get)(':typeName/:id/relations/:field'),
|
|
252
|
+
(0, swagger_1.ApiOperation)({
|
|
253
|
+
summary: 'Page one relation field’s links',
|
|
254
|
+
description: 'One ordered page of a single relation field’s visible links — the way past the `?relationLimit=` cap that `?relations=preview` applies. Only published targets are shown or counted. 400 when the field is not a relation, or its target type is not granted to the workspace.'
|
|
255
|
+
}),
|
|
256
|
+
tslib_1.__param(0, (0, common_1.Param)('typeName')),
|
|
257
|
+
tslib_1.__param(1, (0, common_1.Param)('id', common_1.ParseUUIDPipe)),
|
|
258
|
+
tslib_1.__param(2, (0, common_1.Param)('field')),
|
|
259
|
+
tslib_1.__param(3, (0, common_1.Query)()),
|
|
260
|
+
tslib_1.__param(4, (0, workspaces_server_1.CurrentWorkspace)()),
|
|
261
|
+
tslib_1.__metadata("design:type", Function),
|
|
262
|
+
tslib_1.__metadata("design:paramtypes", [String, String, String, public_list_entries_query_dto_1.PublicListEntriesQueryDto, String]),
|
|
263
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
264
|
+
], PublicEntriesController.prototype, "getRelationField", null);
|
|
265
|
+
tslib_1.__decorate([
|
|
266
|
+
(0, common_1.Get)(':typeName/:id/media'),
|
|
267
|
+
(0, swagger_1.ApiOperation)({
|
|
268
|
+
summary: 'Read one entry’s media assets',
|
|
269
|
+
description: 'Every media field of the entry, keyed by field name, resolved to asset metadata (name, kind, MIME type, alt) and URLs. The URLs are the CMS media routes, which require an authenticated session — a bearer token cannot fetch them.'
|
|
270
|
+
}),
|
|
271
|
+
tslib_1.__param(0, (0, common_1.Param)('typeName')),
|
|
272
|
+
tslib_1.__param(1, (0, common_1.Param)('id', common_1.ParseUUIDPipe)),
|
|
273
|
+
tslib_1.__param(2, (0, common_1.Query)()),
|
|
274
|
+
tslib_1.__param(3, (0, workspaces_server_1.CurrentWorkspace)()),
|
|
275
|
+
tslib_1.__metadata("design:type", Function),
|
|
276
|
+
tslib_1.__metadata("design:paramtypes", [String, String, public_list_entries_query_dto_1.PublicEntryQueryDto, String]),
|
|
277
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
278
|
+
], PublicEntriesController.prototype, "getMedia", null);
|
|
279
|
+
tslib_1.__decorate([
|
|
280
|
+
(0, common_1.Get)(':typeName/:id/translations'),
|
|
281
|
+
(0, swagger_1.ApiOperation)({
|
|
282
|
+
summary: 'Read one entry’s sibling translations',
|
|
283
|
+
description: 'The entry’s other published locale rows — the rest of its translation group — ordered by locale slug, each a full entry honouring the same `?fields=` selection. The entry itself is not repeated. 400 when the type is not localized.'
|
|
284
|
+
}),
|
|
285
|
+
tslib_1.__param(0, (0, common_1.Param)('typeName')),
|
|
286
|
+
tslib_1.__param(1, (0, common_1.Param)('id', common_1.ParseUUIDPipe)),
|
|
287
|
+
tslib_1.__param(2, (0, common_1.Query)()),
|
|
288
|
+
tslib_1.__param(3, (0, workspaces_server_1.CurrentWorkspace)()),
|
|
289
|
+
tslib_1.__metadata("design:type", Function),
|
|
290
|
+
tslib_1.__metadata("design:paramtypes", [String, String, public_list_entries_query_dto_1.PublicEntryQueryDto, String]),
|
|
291
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
292
|
+
], PublicEntriesController.prototype, "getTranslations", null);
|
|
293
|
+
exports.PublicEntriesController = PublicEntriesController = tslib_1.__decorate([
|
|
294
|
+
(0, identity_server_1.Public)(),
|
|
295
|
+
(0, common_1.UseGuards)(api_token_guard_1.ApiTokenGuard, api_token_workspace_guard_1.ApiTokenWorkspaceGuard, draft_visibility_guard_1.DraftVisibilityGuard),
|
|
296
|
+
(0, identity_server_1.RequirePermissions)(identity_server_1.PERMISSIONS.CONTENT_READ),
|
|
297
|
+
(0, swagger_1.ApiSecurity)('apiToken'),
|
|
298
|
+
(0, swagger_1.ApiHeader)({
|
|
299
|
+
name: 'X-Workspace-Id',
|
|
300
|
+
required: false,
|
|
301
|
+
description: "The workspace to read from. Required when the token covers more than one workspace; optional (and ignored) when it covers exactly one. A workspace outside the token's bucket is a 403."
|
|
302
|
+
}),
|
|
303
|
+
(0, common_1.Controller)('v1/content'),
|
|
304
|
+
tslib_1.__param(0, (0, content_tokens_1.InjectContentRegistry)()),
|
|
305
|
+
tslib_1.__metadata("design:paramtypes", [Function, workspace_grants_query_1.WorkspaceGrantsQuery,
|
|
306
|
+
public_entries_query_1.PublicEntriesQuery])
|
|
307
|
+
], PublicEntriesController);
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { ContentTypeRegistry } from '../../../registry/content-type-registry';
|
|
2
|
+
import { WorkspaceGrantsQuery } from '../../../content-types/queries/workspace-grants.query';
|
|
3
|
+
import { PublicEntryWritesService } from '../../infrastructure/public-entry-writes.service';
|
|
4
|
+
import type { PublicEntry } from '../../types/public-entry';
|
|
5
|
+
import { PublicSaveEntryDto } from '../dto/public-save-entry.dto';
|
|
6
|
+
import { PublicBulkIdsDto, PublicBulkSaveDto } from '../dto/public-bulk.dto';
|
|
7
|
+
import type { PublicBulkSaveResult } from '../../types/public-bulk';
|
|
8
|
+
import type { BulkActionResult, BulkPublishResult } from '../../../entries/types/bulk-publish';
|
|
9
|
+
import { PublicEntryQueryDto } from '../dto/public-list-entries-query.dto';
|
|
10
|
+
/**
|
|
11
|
+
* `POST|PATCH|DELETE /api/v1/content/...` — the **write half** of the public,
|
|
12
|
+
* token-authenticated content API. A `full`-scope token can author content from
|
|
13
|
+
* outside the admin: create drafts, edit them, assign and unassign relations,
|
|
14
|
+
* add translations, publish, and remove.
|
|
15
|
+
*
|
|
16
|
+
* Every route is gated by its own permission (`content:create` / `update` /
|
|
17
|
+
* `publish` / `delete`), which `ApiTokenGuard` evaluates against the token's
|
|
18
|
+
* scope through the same `AccessPolicy` the session routes use. A `read` token
|
|
19
|
+
* therefore gets a **403** on all of them without a line of code here saying so.
|
|
20
|
+
*
|
|
21
|
+
* **Batches sit alongside the single-entry writes, not instead of them**
|
|
22
|
+
* (`/bulk`, `/bulk/publish`, `/bulk/unpublish`, `/bulk/delete`). They exist
|
|
23
|
+
* because an external client is usually syncing a list — an import, a scheduled
|
|
24
|
+
* republish — and doing that one HTTP round trip per record is the difference
|
|
25
|
+
* between a job that finishes and one that times out. Every one of them runs the
|
|
26
|
+
* same use-case its single-entry sibling does, so a batch is a way of *asking*,
|
|
27
|
+
* never a second set of rules.
|
|
28
|
+
*
|
|
29
|
+
* Like the reads, every single-entry write exists in **both addressing forms** —
|
|
30
|
+
* `:id` and `group/:localeGroupId` — so a localized client that holds group ids
|
|
31
|
+
* can edit, publish, and delete without ever learning a per-locale id.
|
|
32
|
+
*
|
|
33
|
+
* **No `OriginGuard`**, unlike the admin's write controllers: those are
|
|
34
|
+
* cookie-authenticated and so CSRF-able, while a bearer token is never sent
|
|
35
|
+
* ambiently by a browser. Requiring an `Origin` header here would reject every
|
|
36
|
+
* server-side client instead of protecting anything.
|
|
37
|
+
*/
|
|
38
|
+
export declare class PublicEntryWritesController {
|
|
39
|
+
private readonly registry;
|
|
40
|
+
private readonly grants;
|
|
41
|
+
private readonly writes;
|
|
42
|
+
constructor(registry: ContentTypeRegistry, grants: WorkspaceGrantsQuery, writes: PublicEntryWritesService);
|
|
43
|
+
/** `POST /api/v1/content/:typeName` — create a draft entry. */
|
|
44
|
+
create(typeName: string, body: PublicSaveEntryDto, workspaceId: string): Promise<PublicEntry>;
|
|
45
|
+
/** `POST /api/v1/content/:typeName/bulk` — create and/or update many entries. */
|
|
46
|
+
bulkSave(typeName: string, body: PublicBulkSaveDto, workspaceId: string): Promise<PublicBulkSaveResult>;
|
|
47
|
+
/** `POST /api/v1/content/:typeName/bulk/publish` — take many entries live. */
|
|
48
|
+
bulkPublish(typeName: string, body: PublicBulkIdsDto, workspaceId: string): Promise<BulkPublishResult>;
|
|
49
|
+
/** `POST /api/v1/content/:typeName/bulk/unpublish` — take many off the air. */
|
|
50
|
+
bulkUnpublish(typeName: string, body: PublicBulkIdsDto, workspaceId: string): Promise<BulkActionResult>;
|
|
51
|
+
/** `POST /api/v1/content/:typeName/bulk/delete` — remove many entries. */
|
|
52
|
+
bulkRemove(typeName: string, body: PublicBulkIdsDto, workspaceId: string): Promise<BulkActionResult>;
|
|
53
|
+
/** `PATCH /api/v1/content/:typeName/group/:localeGroupId` */
|
|
54
|
+
updateByGroup(typeName: string, localeGroupId: string, body: PublicSaveEntryDto, query: PublicEntryQueryDto, workspaceId: string): Promise<PublicEntry>;
|
|
55
|
+
/** `POST /api/v1/content/:typeName/group/:localeGroupId/publish` */
|
|
56
|
+
publishByGroup(typeName: string, localeGroupId: string, query: PublicEntryQueryDto, workspaceId: string): Promise<PublicEntry>;
|
|
57
|
+
/** `POST /api/v1/content/:typeName/group/:localeGroupId/unpublish` */
|
|
58
|
+
unpublishByGroup(typeName: string, localeGroupId: string, query: PublicEntryQueryDto, workspaceId: string): Promise<PublicEntry>;
|
|
59
|
+
/** `DELETE /api/v1/content/:typeName/group/:localeGroupId` */
|
|
60
|
+
removeByGroup(typeName: string, localeGroupId: string, query: PublicEntryQueryDto, workspaceId: string): Promise<void>;
|
|
61
|
+
/** `PATCH /api/v1/content/:typeName/:id` — replace an entry's values. */
|
|
62
|
+
update(typeName: string, id: string, body: PublicSaveEntryDto, workspaceId: string): Promise<PublicEntry>;
|
|
63
|
+
/** `POST /api/v1/content/:typeName/:id/publish` — take an entry live. */
|
|
64
|
+
publish(typeName: string, id: string, workspaceId: string): Promise<PublicEntry>;
|
|
65
|
+
/** `POST /api/v1/content/:typeName/:id/unpublish` — take it off the air. */
|
|
66
|
+
unpublish(typeName: string, id: string, workspaceId: string): Promise<PublicEntry>;
|
|
67
|
+
/** `DELETE /api/v1/content/:typeName/:id` — remove an entry. */
|
|
68
|
+
remove(typeName: string, id: string, workspaceId: string): Promise<void>;
|
|
69
|
+
/** @see update */
|
|
70
|
+
private applyUpdate;
|
|
71
|
+
/** @see publish */
|
|
72
|
+
private applyPublish;
|
|
73
|
+
/** @see remove */
|
|
74
|
+
private applyRemove;
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=public-entry-writes.controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-entry-writes.controller.d.ts","sourceRoot":"","sources":["../../../../../src/lib/public-api/http/controllers/public-entry-writes.controller.ts"],"names":[],"mappings":"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"}
|