@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,282 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BULK_IDS_SCHEMA = exports.BULK_SAVE_SCHEMA = exports.ENTRY_ACTION_SCHEMA = exports.UPDATE_SCHEMA = exports.CREATE_SCHEMA = exports.TRANSLATIONS_SCHEMA = exports.MEDIA_SCHEMA = exports.RELATIONS_SCHEMA = exports.GET_ENTRY_SCHEMA = exports.LIST_ENTRIES_SCHEMA = exports.GET_TYPE_SCHEMA = exports.LIST_TYPES_SCHEMA = void 0;
|
|
4
|
+
const entries_constants_1 = require("../entries/entries.constants");
|
|
5
|
+
const public_list_entries_query_dto_1 = require("../public-api/http/dto/public-list-entries-query.dto");
|
|
6
|
+
/**
|
|
7
|
+
* JSON Schemas for the content tools' arguments.
|
|
8
|
+
*
|
|
9
|
+
* **Hand-written and generic**, not generated per content type — the single
|
|
10
|
+
* most consequential shape decision in this surface. An MCP client loads every
|
|
11
|
+
* tool's schema into the model's context on connect, so generating
|
|
12
|
+
* `article_create`, `author_create`, `tag_create`… would put the entire content
|
|
13
|
+
* model in the prompt of every conversation and scale the cost with the number
|
|
14
|
+
* of collections. It could not even be a fixed set: the visible types depend on
|
|
15
|
+
* the calling token's workspace grants.
|
|
16
|
+
*
|
|
17
|
+
* So the tools take `typeName` as an argument, exactly as the HTTP routes take
|
|
18
|
+
* it as a path segment, and a model **discovers** the shape it needs with
|
|
19
|
+
* `content_type_get` — one type, on demand. That is why every `values`
|
|
20
|
+
* parameter below is an open object whose description points at the discovery
|
|
21
|
+
* tool rather than an inline schema.
|
|
22
|
+
*
|
|
23
|
+
* These are the schemas for the *arguments*; the per-type field schemas
|
|
24
|
+
* `content_type_get` returns are generated from the registry by
|
|
25
|
+
* `docs/field-schema.ts`, which already produces them for the OpenAPI document.
|
|
26
|
+
*/
|
|
27
|
+
/** `typeName`, on every tool. */
|
|
28
|
+
const TYPE_NAME = {
|
|
29
|
+
type: 'string',
|
|
30
|
+
description: 'Machine name of the content type, e.g. `article`. Call `content_types_list` for the names this workspace exposes.'
|
|
31
|
+
};
|
|
32
|
+
/** The two ways to name one entry. */
|
|
33
|
+
const LOCATOR = {
|
|
34
|
+
id: {
|
|
35
|
+
type: 'string',
|
|
36
|
+
format: 'uuid',
|
|
37
|
+
description: 'The entry id. Pass this **or** `localeGroupId`, not both.'
|
|
38
|
+
},
|
|
39
|
+
localeGroupId: {
|
|
40
|
+
type: 'string',
|
|
41
|
+
format: 'uuid',
|
|
42
|
+
description: 'The entry’s translation group id, resolved together with `locale`. Use this when you track a record across languages — the group id is stable, each locale’s `id` is not.'
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
/** `locale`, wherever a localized type can be addressed. */
|
|
46
|
+
const LOCALE = {
|
|
47
|
+
type: 'string',
|
|
48
|
+
maxLength: 35,
|
|
49
|
+
description: 'Locale slug (e.g. `en`). Absent means the default locale. Ignored on types that are not localized.'
|
|
50
|
+
};
|
|
51
|
+
/** The publish-state filter, gated on write scope for anything but the default. */
|
|
52
|
+
const STATUS = {
|
|
53
|
+
type: 'string',
|
|
54
|
+
enum: [...public_list_entries_query_dto_1.ENTRY_VISIBILITY],
|
|
55
|
+
description: 'Publish states to return. `published` (the default) is all a read-only token may ask for; `draft` and `any` need write scope. Use `any` after creating an entry — a new entry is a draft and the default would not find it.'
|
|
56
|
+
};
|
|
57
|
+
/** Sparse fieldsets — the main lever on how much context a result costs. */
|
|
58
|
+
const FIELDS = {
|
|
59
|
+
type: 'string',
|
|
60
|
+
description: 'Comma-separated field names to return in `values`, e.g. `title,slug`. Absent returns every field, which on a type with rich text can be very large — prefer naming the fields you need.'
|
|
61
|
+
};
|
|
62
|
+
/** Relation/media/translation expansion, shared by the single-entry reads. */
|
|
63
|
+
const EXPANSIONS = {
|
|
64
|
+
relations: {
|
|
65
|
+
type: 'string',
|
|
66
|
+
enum: ['preview'],
|
|
67
|
+
description: 'Set to `preview` to expand the relation fields named in `relationFields`.'
|
|
68
|
+
},
|
|
69
|
+
relationFields: {
|
|
70
|
+
type: 'string',
|
|
71
|
+
description: 'Comma-separated relation fields to expand, e.g. `author,tags`. Ignored without `relations=preview`.'
|
|
72
|
+
},
|
|
73
|
+
media: {
|
|
74
|
+
type: 'string',
|
|
75
|
+
enum: ['preview'],
|
|
76
|
+
description: 'Set to `preview` to expand the media fields named in `mediaFields`.'
|
|
77
|
+
},
|
|
78
|
+
mediaFields: {
|
|
79
|
+
type: 'string',
|
|
80
|
+
description: 'Comma-separated media fields to expand. Ignored without `media=preview`.'
|
|
81
|
+
},
|
|
82
|
+
translations: {
|
|
83
|
+
type: 'string',
|
|
84
|
+
enum: ['preview'],
|
|
85
|
+
description: 'Set to `preview` to attach the entry’s sibling translations. An error on a type that is not localized.'
|
|
86
|
+
},
|
|
87
|
+
relationLimit: {
|
|
88
|
+
type: 'integer',
|
|
89
|
+
minimum: 1,
|
|
90
|
+
maximum: entries_constants_1.MAX_PAGE_SIZE,
|
|
91
|
+
description: `Links per expanded relation field (1…${entries_constants_1.MAX_PAGE_SIZE}). The field's \`total\` always reports the true count.`
|
|
92
|
+
},
|
|
93
|
+
mediaLimit: {
|
|
94
|
+
type: 'integer',
|
|
95
|
+
minimum: 1,
|
|
96
|
+
maximum: entries_constants_1.MAX_PAGE_SIZE,
|
|
97
|
+
description: `Assets per expanded media field (1…${entries_constants_1.MAX_PAGE_SIZE}).`
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
/** An object schema with no extra keys allowed. */
|
|
101
|
+
function object(properties, required = []) {
|
|
102
|
+
return {
|
|
103
|
+
type: 'object',
|
|
104
|
+
properties,
|
|
105
|
+
...(required.length ? { required } : {}),
|
|
106
|
+
additionalProperties: false
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
/** `content_types_list` — no arguments. */
|
|
110
|
+
exports.LIST_TYPES_SCHEMA = object({});
|
|
111
|
+
/** `content_type_get` */
|
|
112
|
+
exports.GET_TYPE_SCHEMA = object({ typeName: TYPE_NAME }, [
|
|
113
|
+
'typeName'
|
|
114
|
+
]);
|
|
115
|
+
/** `content_list` */
|
|
116
|
+
exports.LIST_ENTRIES_SCHEMA = object({
|
|
117
|
+
typeName: TYPE_NAME,
|
|
118
|
+
search: {
|
|
119
|
+
type: 'string',
|
|
120
|
+
maxLength: 255,
|
|
121
|
+
description: 'Free-text, case-insensitive search across the type’s text-like columns.'
|
|
122
|
+
},
|
|
123
|
+
filter: {
|
|
124
|
+
type: 'string',
|
|
125
|
+
maxLength: entries_constants_1.FILTER_MAX_LENGTH,
|
|
126
|
+
description: 'Structured filter tree as a JSON **string**, e.g. `{"and":[{"field":"featured","op":"eq","value":true}]}`. Filterable: the type’s scalar fields plus `id`, `createdAt`, `updatedAt`, `publishedAt`, and on localized types `locale` and `localeGroupId`.'
|
|
127
|
+
},
|
|
128
|
+
sort: {
|
|
129
|
+
type: 'string',
|
|
130
|
+
description: 'A field name for ascending, `-`-prefixed for descending, e.g. `-publishedAt`. Defaults to newest-updated first.'
|
|
131
|
+
},
|
|
132
|
+
page: {
|
|
133
|
+
type: 'integer',
|
|
134
|
+
minimum: 1,
|
|
135
|
+
description: '1-based page number.'
|
|
136
|
+
},
|
|
137
|
+
pageSize: {
|
|
138
|
+
type: 'integer',
|
|
139
|
+
minimum: 1,
|
|
140
|
+
maximum: entries_constants_1.MAX_PAGE_SIZE,
|
|
141
|
+
description: `Rows per page (1…${entries_constants_1.MAX_PAGE_SIZE}, default ${entries_constants_1.DEFAULT_PAGE_SIZE}). Keep it small — every row costs context.`
|
|
142
|
+
},
|
|
143
|
+
fields: FIELDS,
|
|
144
|
+
locale: LOCALE,
|
|
145
|
+
status: STATUS
|
|
146
|
+
}, ['typeName']);
|
|
147
|
+
/** `content_get` */
|
|
148
|
+
exports.GET_ENTRY_SCHEMA = object({
|
|
149
|
+
typeName: TYPE_NAME,
|
|
150
|
+
...LOCATOR,
|
|
151
|
+
fields: FIELDS,
|
|
152
|
+
locale: LOCALE,
|
|
153
|
+
status: STATUS,
|
|
154
|
+
...EXPANSIONS
|
|
155
|
+
}, ['typeName']);
|
|
156
|
+
/** `content_relations` */
|
|
157
|
+
exports.RELATIONS_SCHEMA = object({
|
|
158
|
+
typeName: TYPE_NAME,
|
|
159
|
+
...LOCATOR,
|
|
160
|
+
field: {
|
|
161
|
+
type: 'string',
|
|
162
|
+
description: 'The relation field to page, e.g. `tags`.'
|
|
163
|
+
},
|
|
164
|
+
page: { type: 'integer', minimum: 1, description: '1-based page.' },
|
|
165
|
+
pageSize: {
|
|
166
|
+
type: 'integer',
|
|
167
|
+
minimum: 1,
|
|
168
|
+
maximum: entries_constants_1.MAX_PAGE_SIZE,
|
|
169
|
+
description: `Links per page (1…${entries_constants_1.MAX_PAGE_SIZE}).`
|
|
170
|
+
},
|
|
171
|
+
locale: LOCALE,
|
|
172
|
+
status: STATUS
|
|
173
|
+
}, ['typeName', 'field']);
|
|
174
|
+
/** `content_media` */
|
|
175
|
+
exports.MEDIA_SCHEMA = object({
|
|
176
|
+
typeName: TYPE_NAME,
|
|
177
|
+
...LOCATOR,
|
|
178
|
+
locale: LOCALE,
|
|
179
|
+
status: STATUS,
|
|
180
|
+
mediaLimit: EXPANSIONS['mediaLimit']
|
|
181
|
+
}, ['typeName']);
|
|
182
|
+
/** `content_translations` */
|
|
183
|
+
exports.TRANSLATIONS_SCHEMA = object({
|
|
184
|
+
typeName: TYPE_NAME,
|
|
185
|
+
...LOCATOR,
|
|
186
|
+
fields: FIELDS,
|
|
187
|
+
locale: LOCALE,
|
|
188
|
+
status: STATUS
|
|
189
|
+
}, ['typeName']);
|
|
190
|
+
/** The `values` bag — open, because its real shape is per content type. */
|
|
191
|
+
const VALUES = {
|
|
192
|
+
type: 'object',
|
|
193
|
+
additionalProperties: true,
|
|
194
|
+
description: 'Field values keyed by field name. The accepted shape is the content type’s own — call `content_type_get` first to see it. A media field takes asset ids; an owning single relation takes the target’s entry id.'
|
|
195
|
+
};
|
|
196
|
+
/** Relation deltas — assign/unassign, shared by create and update. */
|
|
197
|
+
const RELATION_DELTAS = {
|
|
198
|
+
type: 'object',
|
|
199
|
+
additionalProperties: true,
|
|
200
|
+
description: 'Relation changes keyed by relation field: `{"tags":{"link":["<id>"],"unlink":["<id>"]}}`. A delta, not a replacement — ids you do not mention are left alone. Many-to-many and inverse relations only; set an owning single relation through `values`. Add `"by":"localeGroup"` to pass translation-group ids instead of entry ids.'
|
|
201
|
+
};
|
|
202
|
+
/** `content_create` */
|
|
203
|
+
exports.CREATE_SCHEMA = object({
|
|
204
|
+
typeName: TYPE_NAME,
|
|
205
|
+
values: VALUES,
|
|
206
|
+
relations: RELATION_DELTAS,
|
|
207
|
+
locale: {
|
|
208
|
+
...LOCALE,
|
|
209
|
+
description: 'Locale the new row is written in. Absent means the default locale.'
|
|
210
|
+
},
|
|
211
|
+
localeGroupId: {
|
|
212
|
+
type: 'string',
|
|
213
|
+
format: 'uuid',
|
|
214
|
+
description: 'Join an existing translation group — this is how you add a language to a record that already exists. Take `localeGroupId` off any read and pass it with a different `locale`.'
|
|
215
|
+
}
|
|
216
|
+
}, ['typeName', 'values']);
|
|
217
|
+
/** `content_update` */
|
|
218
|
+
exports.UPDATE_SCHEMA = object({
|
|
219
|
+
typeName: TYPE_NAME,
|
|
220
|
+
...LOCATOR,
|
|
221
|
+
values: {
|
|
222
|
+
...VALUES,
|
|
223
|
+
description: 'Fields to change. A **partial** update: omitted fields are left alone, and an explicit `null` clears one. You do not need to send the whole record.'
|
|
224
|
+
},
|
|
225
|
+
relations: RELATION_DELTAS,
|
|
226
|
+
locale: LOCALE
|
|
227
|
+
}, ['typeName', 'values']);
|
|
228
|
+
/** `content_publish` / `content_unpublish` / `content_delete` */
|
|
229
|
+
exports.ENTRY_ACTION_SCHEMA = object({
|
|
230
|
+
typeName: TYPE_NAME,
|
|
231
|
+
...LOCATOR,
|
|
232
|
+
locale: LOCALE
|
|
233
|
+
}, ['typeName']);
|
|
234
|
+
/**
|
|
235
|
+
* `content_bulk_save` — the batch form of create + update.
|
|
236
|
+
*
|
|
237
|
+
* One `items` array rather than a `creates` and an `updates` list: a model
|
|
238
|
+
* working from a list of records knows which ones it read an id for and which
|
|
239
|
+
* it did not, and asking it to partition them first is a step it can get wrong
|
|
240
|
+
* for no benefit. The addressing inside an item is the same addressing the
|
|
241
|
+
* single-entry tools take as top-level arguments.
|
|
242
|
+
*/
|
|
243
|
+
exports.BULK_SAVE_SCHEMA = object({
|
|
244
|
+
typeName: TYPE_NAME,
|
|
245
|
+
items: {
|
|
246
|
+
type: 'array',
|
|
247
|
+
minItems: 1,
|
|
248
|
+
maxItems: entries_constants_1.BULK_MAX_SAVE_ITEMS,
|
|
249
|
+
description: `The entries to save (1…${entries_constants_1.BULK_MAX_SAVE_ITEMS}), applied in order. Every item is reported back at the same position, so a partial batch is legible.`,
|
|
250
|
+
items: object({
|
|
251
|
+
id: {
|
|
252
|
+
type: 'string',
|
|
253
|
+
format: 'uuid',
|
|
254
|
+
description: 'The entry to update. Omit to create a new one.'
|
|
255
|
+
},
|
|
256
|
+
op: {
|
|
257
|
+
type: 'string',
|
|
258
|
+
enum: ['create', 'update'],
|
|
259
|
+
description: 'What this item does. Inferred from the addressing — an `id` means update, no `id` and no `localeGroupId` means create — and required only when you pass `localeGroupId` alone, which could mean either adding that record’s row in `locale` or changing the row it already has there.'
|
|
260
|
+
},
|
|
261
|
+
values: VALUES,
|
|
262
|
+
relations: RELATION_DELTAS,
|
|
263
|
+
locale: LOCALE,
|
|
264
|
+
localeGroupId: {
|
|
265
|
+
type: 'string',
|
|
266
|
+
format: 'uuid',
|
|
267
|
+
description: 'The translation group this row belongs to — joined on a create, addressed together with `locale` on an update.'
|
|
268
|
+
}
|
|
269
|
+
})
|
|
270
|
+
}
|
|
271
|
+
}, ['typeName', 'items']);
|
|
272
|
+
/** `content_bulk_publish` / `content_bulk_unpublish` / `content_bulk_delete`. */
|
|
273
|
+
exports.BULK_IDS_SCHEMA = object({
|
|
274
|
+
typeName: TYPE_NAME,
|
|
275
|
+
ids: {
|
|
276
|
+
type: 'array',
|
|
277
|
+
minItems: 1,
|
|
278
|
+
maxItems: entries_constants_1.BULK_MAX_IDS,
|
|
279
|
+
items: { type: 'string', format: 'uuid' },
|
|
280
|
+
description: `Entry ids to act on (1…${entries_constants_1.BULK_MAX_IDS}). Ids from another workspace, or that never existed, simply do not match — they are not an error.`
|
|
281
|
+
}
|
|
282
|
+
}, ['typeName', 'ids']);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ContentTypeRegistry } from '../../registry/content-type-registry';
|
|
2
|
+
import { EntryWriterService } from '../../entries/infrastructure/persistence/entry-writer.service';
|
|
3
|
+
import type { EntryRecord, EntryRelationsView, RelationFieldView } from '../../entries/types/entry-list-view';
|
|
4
|
+
/**
|
|
5
|
+
* `GET /api/v1/content/:typeName/:id[/relations[/:field]]` — the external,
|
|
6
|
+
* bearer-token-authenticated single-entry reads, mirroring the admin's
|
|
7
|
+
* `GetEntryController`. Every route is scoped to the token's workspace
|
|
8
|
+
* (`@CurrentWorkspace()`), so an id outside it reads as 404. Read-only:
|
|
9
|
+
* `content:read`, enforced against the token's scope by {@link ApiTokenGuard}.
|
|
10
|
+
*/
|
|
11
|
+
export declare class GetPublicEntryController {
|
|
12
|
+
private readonly registry;
|
|
13
|
+
private readonly writer;
|
|
14
|
+
constructor(registry: ContentTypeRegistry, writer: EntryWriterService);
|
|
15
|
+
/**
|
|
16
|
+
* One live entry by id (404 if unknown or soft-deleted in the workspace).
|
|
17
|
+
* `?fields=title,slug` narrows the returned `values` bag to those fields;
|
|
18
|
+
* omitted, the whole record is returned. An unknown name is a 400.
|
|
19
|
+
*/
|
|
20
|
+
getOne(typeName: string, id: string, workspaceId: string, fields?: string): Promise<EntryRecord>;
|
|
21
|
+
/** First page of every relation field's links for one entry. */
|
|
22
|
+
getRelations(typeName: string, id: string, workspaceId: string): Promise<EntryRelationsView>;
|
|
23
|
+
/** One page of a single relation field's links (`{ items, total }`). */
|
|
24
|
+
getRelationField(typeName: string, id: string, field: string, workspaceId: string, page?: string, pageSize?: string): Promise<RelationFieldView>;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=get-public-entry.controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-public-entry.controller.d.ts","sourceRoot":"","sources":["../../../../src/lib/public/controllers/get-public-entry.controller.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,+DAA+D,CAAC;AAInG,OAAO,KAAK,EACR,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EACpB,MAAM,qCAAqC,CAAC;AAE7C;;;;;;GAMG;AACH,qBAIa,wBAAwB;IAG7B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBADN,QAAQ,EAAE,mBAAmB,EAC7B,MAAM,EAAE,kBAAkB;IAG/C;;;;OAIG;IAEH,MAAM,CACiB,QAAQ,EAAE,MAAM,EACP,EAAE,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACtB,MAAM,CAAC,EAAE,MAAM,GACjC,OAAO,CAAC,WAAW,CAAC;IAKvB,gEAAgE;IAE1D,YAAY,CACK,QAAQ,EAAE,MAAM,EACP,EAAE,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,kBAAkB,CAAC;IAO9B,wEAAwE;IAExE,gBAAgB,CACO,QAAQ,EAAE,MAAM,EACP,EAAE,EAAE,MAAM,EACtB,KAAK,EAAE,MAAM,EACT,WAAW,EAAE,MAAM,EACxB,IAAI,CAAC,EAAE,MAAM,EACT,QAAQ,CAAC,EAAE,MAAM,GACrC,OAAO,CAAC,iBAAiB,CAAC;CAWhC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ContentTypeRegistry } from '../../registry/content-type-registry';
|
|
2
|
+
import { EntriesService } from '../../entries/infrastructure/queries/entries.service';
|
|
3
|
+
import { ListEntriesQueryDto } from '../../entries/http/dto/list-entries-query.dto';
|
|
4
|
+
import type { EntryListView } from '../../entries/types/entry-list-view';
|
|
5
|
+
/**
|
|
6
|
+
* `GET /api/v1/content/:typeName` — the external, **bearer-token**-authenticated
|
|
7
|
+
* mirror of the admin's records list. Same generic pipeline
|
|
8
|
+
* (`search`/`filter`/`sort`/pagination + relation filtering), same
|
|
9
|
+
* `{ items, total, page, pageSize }` envelope — the only difference is the
|
|
10
|
+
* caller: an API token instead of a session.
|
|
11
|
+
*
|
|
12
|
+
* `@Public()` opts the route out of the app-wide session `AuthGuard` so
|
|
13
|
+
* {@link ApiTokenGuard} owns authentication; the guard authorizes the token's
|
|
14
|
+
* scope against `content:read` and mirrors the token's workspace onto the
|
|
15
|
+
* request, so `@CurrentWorkspace()` scopes the query exactly as the admin
|
|
16
|
+
* routes do — a token can never read another workspace's entries.
|
|
17
|
+
*/
|
|
18
|
+
export declare class ListPublicEntriesController {
|
|
19
|
+
private readonly registry;
|
|
20
|
+
private readonly entries;
|
|
21
|
+
constructor(registry: ContentTypeRegistry, entries: EntriesService);
|
|
22
|
+
list(typeName: string, query: ListEntriesQueryDto, workspaceId: string): Promise<EntryListView>;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=list-public-entries.controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-public-entries.controller.d.ts","sourceRoot":"","sources":["../../../../src/lib/public/controllers/list-public-entries.controller.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,MAAM,sDAAsD,CAAC;AACtF,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAC;AAEpF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAEzE;;;;;;;;;;;;GAYG;AACH,qBAIa,2BAA2B;IAGhC,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBADP,QAAQ,EAAE,mBAAmB,EAC7B,OAAO,EAAE,cAAc;IAI5C,IAAI,CACmB,QAAQ,EAAE,MAAM,EAC1B,KAAK,EAAE,mBAAmB,EACf,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,aAAa,CAAC;CAI5B"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ContentTypeRegistry, SerializedContentType, SerializedContentTypeSummary } from '../../registry/content-type-registry';
|
|
2
|
+
/**
|
|
3
|
+
* `GET /api/v1/content-schema[/:name]` — schema discovery for the external API,
|
|
4
|
+
* so a developer can enumerate the available content types (collections +
|
|
5
|
+
* pages) and read one type's full field list before querying it. Same registry
|
|
6
|
+
* projection the admin schema routes serve, behind the bearer-token guard on
|
|
7
|
+
* `content:read`. Schema is not workspace-specific — the types are code-defined
|
|
8
|
+
* — but access still requires a valid token.
|
|
9
|
+
*/
|
|
10
|
+
export declare class PublicSchemaController {
|
|
11
|
+
private readonly registry;
|
|
12
|
+
constructor(registry: ContentTypeRegistry);
|
|
13
|
+
/** Summaries of every content type. */
|
|
14
|
+
list(): SerializedContentTypeSummary[];
|
|
15
|
+
/** One type's full field schema (404 if unknown). */
|
|
16
|
+
get(name: string): SerializedContentType;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=public-schema.controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-schema.controller.d.ts","sourceRoot":"","sources":["../../../../src/lib/public/controllers/public-schema.controller.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EACR,mBAAmB,EACnB,qBAAqB,EACrB,4BAA4B,EAC/B,MAAM,sCAAsC,CAAC;AAE9C;;;;;;;GAOG;AACH,qBAIa,sBAAsB;IAG3B,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,mBAAmB;IAGlD,uCAAuC;IAEvC,IAAI,IAAI,4BAA4B,EAAE;IAItC,qDAAqD;IAErD,GAAG,CAAgB,IAAI,EAAE,MAAM,GAAG,qBAAqB;CAO1D"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ApiTokenScope, AuthenticatedRequest } from '@orthacms/identity-server';
|
|
2
|
+
/**
|
|
3
|
+
* The token a public-API request authenticated with, as {@link ApiTokenGuard}
|
|
4
|
+
* attaches it. A deliberately narrow projection of the stored record: the
|
|
5
|
+
* hash, the creator, and the timestamps are management concerns and have no
|
|
6
|
+
* business on the request.
|
|
7
|
+
*/
|
|
8
|
+
export interface PublicApiToken {
|
|
9
|
+
/** Stable token id — what a log line or a rate limiter keys on. */
|
|
10
|
+
id: string;
|
|
11
|
+
/** The token's display name, for diagnostics. */
|
|
12
|
+
name: string;
|
|
13
|
+
/** Access level, which the guard turns into a permission set. */
|
|
14
|
+
scope: ApiTokenScope;
|
|
15
|
+
/** Every workspace this token may act in — always at least one. */
|
|
16
|
+
workspaceIds: readonly string[];
|
|
17
|
+
/**
|
|
18
|
+
* The user who minted the token, when still known.
|
|
19
|
+
*
|
|
20
|
+
* Carried for **attribution on writes**, not for authorization — the token
|
|
21
|
+
* acts as itself, and this user's role grants are never consulted (revoking
|
|
22
|
+
* the token has to be enough). A media upload has a NOT NULL `uploaded_by`,
|
|
23
|
+
* so something must go there; the accountable human is the one who created
|
|
24
|
+
* the credential, and recording them keeps the Media Library's uploader
|
|
25
|
+
* column meaningful instead of blank.
|
|
26
|
+
*/
|
|
27
|
+
createdBy: string | null;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A public-API request after {@link ApiTokenGuard} has run: the verified token
|
|
31
|
+
* is attached as `apiToken`, and {@link ApiTokenWorkspaceGuard} additionally
|
|
32
|
+
* stamps the resolved `workspaceId` (inherited from `AuthenticatedRequest`, so
|
|
33
|
+
* `@CurrentWorkspace()` reads it exactly as it does on the admin routes).
|
|
34
|
+
*
|
|
35
|
+
* `user` is always `undefined` here — these routes are `@Public()`, so the
|
|
36
|
+
* app-wide session `AuthGuard` never runs on them.
|
|
37
|
+
*/
|
|
38
|
+
export interface ApiTokenRequest extends AuthenticatedRequest {
|
|
39
|
+
apiToken?: PublicApiToken;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=api-token-request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-token-request.d.ts","sourceRoot":"","sources":["../../../../src/lib/public-api/http/api-token-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,aAAa,EACb,oBAAoB,EACvB,MAAM,2BAA2B,CAAC;AAEnC;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC3B,mEAAmE;IACnE,EAAE,EAAE,MAAM,CAAC;IACX,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,KAAK,EAAE,aAAa,CAAC;IACrB,mEAAmE;IACnE,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC;;;;;;;;;OASG;IACH,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,eAAgB,SAAQ,oBAAoB;IACzD,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC7B"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ContentTypeRegistry, SerializedContentType, SerializedContentTypeSummary } from '../../../registry/content-type-registry';
|
|
2
|
+
import { WorkspaceGrantsQuery } from '../../../content-types/queries/workspace-grants.query';
|
|
3
|
+
/** The discovery list: every type this token's workspace can be read for. */
|
|
4
|
+
export interface PublicContentTypeListView {
|
|
5
|
+
items: SerializedContentTypeSummary[];
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* `GET /api/v1/content-types` — the **schema-discovery** half of the public
|
|
9
|
+
* API. A consumer asks what it can read and how each type is shaped, instead of
|
|
10
|
+
* hard-coding a model it can't see.
|
|
11
|
+
*
|
|
12
|
+
* Both routes are **pruned to the workspace's content grants**, and so is
|
|
13
|
+
* `/v1/content/:typeName` — so the discovery list is exactly the set of names
|
|
14
|
+
* that will not 404, and a token can't enumerate types its workspace doesn't
|
|
15
|
+
* expose.
|
|
16
|
+
*
|
|
17
|
+
* The field schema is served whole, including relation fields. Those describe
|
|
18
|
+
* the real model even though the entry read is flat: an owning single relation
|
|
19
|
+
* appears in `values` as the target's raw id (follow it with a second read),
|
|
20
|
+
* while a many-relation and an inverse carry no value in a public entry at all.
|
|
21
|
+
*/
|
|
22
|
+
export declare class PublicContentTypesController {
|
|
23
|
+
private readonly registry;
|
|
24
|
+
private readonly grants;
|
|
25
|
+
constructor(registry: ContentTypeRegistry, grants: WorkspaceGrantsQuery);
|
|
26
|
+
/** `GET /api/v1/content-types` — summaries of every readable type. */
|
|
27
|
+
list(workspaceId: string): Promise<PublicContentTypeListView>;
|
|
28
|
+
/** `GET /api/v1/content-types/:name` — one type's full field schema. */
|
|
29
|
+
get(name: string, workspaceId: string): Promise<SerializedContentType>;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=public-content-types.controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-content-types.controller.d.ts","sourceRoot":"","sources":["../../../../../src/lib/public-api/http/controllers/public-content-types.controller.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EACR,mBAAmB,EACnB,qBAAqB,EACrB,4BAA4B,EAC/B,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uDAAuD,CAAC;AAK7F,6EAA6E;AAC7E,MAAM,WAAW,yBAAyB;IACtC,KAAK,EAAE,4BAA4B,EAAE,CAAC;CACzC;AAED;;;;;;;;;;;;;;GAcG;AACH,qBAWa,4BAA4B;IAGjC,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBADN,QAAQ,EAAE,mBAAmB,EAC7B,MAAM,EAAE,oBAAoB;IAGjD,sEAAsE;IAOhE,IAAI,CACc,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,yBAAyB,CAAC;IASrC,wEAAwE;IAOlE,GAAG,CACU,IAAI,EAAE,MAAM,EACP,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,qBAAqB,CAAC;CAcpC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PublicContentTypesController = 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 api_token_guard_1 = require("../guards/api-token.guard");
|
|
12
|
+
const api_token_workspace_guard_1 = require("../guards/api-token-workspace.guard");
|
|
13
|
+
const resolve_granted_type_1 = require("./resolve-granted-type");
|
|
14
|
+
/**
|
|
15
|
+
* `GET /api/v1/content-types` — the **schema-discovery** half of the public
|
|
16
|
+
* API. A consumer asks what it can read and how each type is shaped, instead of
|
|
17
|
+
* hard-coding a model it can't see.
|
|
18
|
+
*
|
|
19
|
+
* Both routes are **pruned to the workspace's content grants**, and so is
|
|
20
|
+
* `/v1/content/:typeName` — so the discovery list is exactly the set of names
|
|
21
|
+
* that will not 404, and a token can't enumerate types its workspace doesn't
|
|
22
|
+
* expose.
|
|
23
|
+
*
|
|
24
|
+
* The field schema is served whole, including relation fields. Those describe
|
|
25
|
+
* the real model even though the entry read is flat: an owning single relation
|
|
26
|
+
* appears in `values` as the target's raw id (follow it with a second read),
|
|
27
|
+
* while a many-relation and an inverse carry no value in a public entry at all.
|
|
28
|
+
*/
|
|
29
|
+
let PublicContentTypesController = class PublicContentTypesController {
|
|
30
|
+
registry;
|
|
31
|
+
grants;
|
|
32
|
+
constructor(registry, grants) {
|
|
33
|
+
this.registry = registry;
|
|
34
|
+
this.grants = grants;
|
|
35
|
+
}
|
|
36
|
+
/** `GET /api/v1/content-types` — summaries of every readable type. */
|
|
37
|
+
async list(workspaceId) {
|
|
38
|
+
const granted = await this.grants.grantedSlugs(workspaceId);
|
|
39
|
+
return {
|
|
40
|
+
items: this.registry
|
|
41
|
+
.summaries()
|
|
42
|
+
.filter((summary) => granted.has(summary.name))
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/** `GET /api/v1/content-types/:name` — one type's full field schema. */
|
|
46
|
+
async get(name, workspaceId) {
|
|
47
|
+
// Resolve through the same grant gate as the entry routes, so an
|
|
48
|
+
// ungranted type reads identically here and there (one 404, no
|
|
49
|
+
// enumeration signal). The registry then serializes the resolved type.
|
|
50
|
+
const { type } = await (0, resolve_granted_type_1.resolveGrantedType)(this.registry, this.grants, name, workspaceId);
|
|
51
|
+
// Registered by definition (resolveGrantedType returned it), so the
|
|
52
|
+
// serialize can't miss — the non-null assertion documents that.
|
|
53
|
+
return this.registry.serialize(type.name);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
exports.PublicContentTypesController = PublicContentTypesController;
|
|
57
|
+
tslib_1.__decorate([
|
|
58
|
+
(0, common_1.Get)(),
|
|
59
|
+
(0, swagger_1.ApiOperation)({
|
|
60
|
+
summary: 'List the content types this token can read',
|
|
61
|
+
description: 'Summaries (name, kind, label, and the publishable/paranoid/i18n flags) of every content type granted to the requested workspace.'
|
|
62
|
+
}),
|
|
63
|
+
tslib_1.__param(0, (0, workspaces_server_1.CurrentWorkspace)()),
|
|
64
|
+
tslib_1.__metadata("design:type", Function),
|
|
65
|
+
tslib_1.__metadata("design:paramtypes", [String]),
|
|
66
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
67
|
+
], PublicContentTypesController.prototype, "list", null);
|
|
68
|
+
tslib_1.__decorate([
|
|
69
|
+
(0, common_1.Get)(':name'),
|
|
70
|
+
(0, swagger_1.ApiOperation)({
|
|
71
|
+
summary: 'Read one content type’s field schema',
|
|
72
|
+
description: 'Every field of the type with its kind, validation rules, and options — what a client renders or types its models from. 404 when the type is unknown or not granted to the workspace.'
|
|
73
|
+
}),
|
|
74
|
+
tslib_1.__param(0, (0, common_1.Param)('name')),
|
|
75
|
+
tslib_1.__param(1, (0, workspaces_server_1.CurrentWorkspace)()),
|
|
76
|
+
tslib_1.__metadata("design:type", Function),
|
|
77
|
+
tslib_1.__metadata("design:paramtypes", [String, String]),
|
|
78
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
79
|
+
], PublicContentTypesController.prototype, "get", null);
|
|
80
|
+
exports.PublicContentTypesController = PublicContentTypesController = tslib_1.__decorate([
|
|
81
|
+
(0, identity_server_1.Public)(),
|
|
82
|
+
(0, common_1.UseGuards)(api_token_guard_1.ApiTokenGuard, api_token_workspace_guard_1.ApiTokenWorkspaceGuard),
|
|
83
|
+
(0, identity_server_1.RequirePermissions)(identity_server_1.PERMISSIONS.CONTENT_READ),
|
|
84
|
+
(0, swagger_1.ApiSecurity)('apiToken'),
|
|
85
|
+
(0, swagger_1.ApiHeader)({
|
|
86
|
+
name: 'X-Workspace-Id',
|
|
87
|
+
required: false,
|
|
88
|
+
description: "The workspace whose grants scope the result. Required when the token covers more than one workspace; optional when it covers exactly one. A workspace outside the token's bucket is a 403."
|
|
89
|
+
}),
|
|
90
|
+
(0, common_1.Controller)('v1/content-types'),
|
|
91
|
+
tslib_1.__param(0, (0, content_tokens_1.InjectContentRegistry)()),
|
|
92
|
+
tslib_1.__metadata("design:paramtypes", [Function, workspace_grants_query_1.WorkspaceGrantsQuery])
|
|
93
|
+
], PublicContentTypesController);
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { ContentTypeRegistry } from '../../../registry/content-type-registry';
|
|
2
|
+
import { WorkspaceGrantsQuery } from '../../../content-types/queries/workspace-grants.query';
|
|
3
|
+
import { PublicEntriesQuery } from '../../infrastructure/public-entries.query';
|
|
4
|
+
import type { PublicEntry, PublicEntryListView } from '../../types/public-entry';
|
|
5
|
+
import type { PublicMediaFieldView, PublicRelationFieldView } from '../../types/public-expansion';
|
|
6
|
+
import { PublicEntryQueryDto, PublicListEntriesQueryDto } from '../dto/public-list-entries-query.dto';
|
|
7
|
+
/** One entry's media assets, keyed by field name. */
|
|
8
|
+
export interface PublicEntryMediaView {
|
|
9
|
+
media: Record<string, PublicMediaFieldView>;
|
|
10
|
+
}
|
|
11
|
+
/** One entry's sibling translations. */
|
|
12
|
+
export interface PublicEntryTranslationsView {
|
|
13
|
+
translations: PublicEntry[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* `GET /api/v1/content/...` — the **public, token-authenticated read API** an
|
|
17
|
+
* external site or app fetches content with. One route pair serves every
|
|
18
|
+
* code-defined type: `:typeName` is resolved against the registry (and the
|
|
19
|
+
* workspace's grants) at request time.
|
|
20
|
+
*
|
|
21
|
+
* `@Public()` opts these routes out of the session `AuthGuard`; `ApiTokenGuard`
|
|
22
|
+
* then authenticates the `Authorization: Bearer` token and checks
|
|
23
|
+
* `content:read` against its scope, and `ApiTokenWorkspaceGuard` resolves which
|
|
24
|
+
* of the token's workspaces the request targets (the `X-Workspace-Id` header,
|
|
25
|
+
* or the only one when the token covers a single workspace).
|
|
26
|
+
*
|
|
27
|
+
* Reads are flat and live-only — published entries, no drafts, no soft-deleted
|
|
28
|
+
* rows, and `values` carries the entry's own data only (no relation or media
|
|
29
|
+
* fields, in either direction). See {@link PublicEntriesQuery} for the exact
|
|
30
|
+
* visibility rule and `types/public-entry.ts` for the wire shape.
|
|
31
|
+
*
|
|
32
|
+
* A `single` (page) type is served by the same list route as a collection: with
|
|
33
|
+
* localization a single still has one row per locale, so a list envelope is the
|
|
34
|
+
* honest shape for both — take `items[0]`.
|
|
35
|
+
*/
|
|
36
|
+
export declare class PublicEntriesController {
|
|
37
|
+
private readonly registry;
|
|
38
|
+
private readonly grants;
|
|
39
|
+
private readonly entries;
|
|
40
|
+
constructor(registry: ContentTypeRegistry, grants: WorkspaceGrantsQuery, entries: PublicEntriesQuery);
|
|
41
|
+
/** `GET /api/v1/content/:typeName` — one page of published entries. */
|
|
42
|
+
list(typeName: string, query: PublicListEntriesQueryDto, workspaceId: string): Promise<PublicEntryListView>;
|
|
43
|
+
/**
|
|
44
|
+
* `GET /api/v1/content/:typeName/group/:localeGroupId` — one published
|
|
45
|
+
* entry addressed by its translation group and the requested locale.
|
|
46
|
+
*/
|
|
47
|
+
getByLocaleGroup(typeName: string, localeGroupId: string, query: PublicEntryQueryDto, workspaceId: string): Promise<PublicEntry>;
|
|
48
|
+
/**
|
|
49
|
+
* `GET /api/v1/content/:typeName/group/:localeGroupId/relations/:field` —
|
|
50
|
+
* one page of a relation field's links, for the group's row in the
|
|
51
|
+
* requested locale.
|
|
52
|
+
*/
|
|
53
|
+
getRelationFieldByLocaleGroup(typeName: string, localeGroupId: string, field: string, query: PublicListEntriesQueryDto, workspaceId: string): Promise<PublicRelationFieldView>;
|
|
54
|
+
/**
|
|
55
|
+
* `GET /api/v1/content/:typeName/group/:localeGroupId/media` — the media
|
|
56
|
+
* assets of the group's row in the requested locale.
|
|
57
|
+
*/
|
|
58
|
+
getMediaByLocaleGroup(typeName: string, localeGroupId: string, query: PublicEntryQueryDto, workspaceId: string): Promise<PublicEntryMediaView>;
|
|
59
|
+
/**
|
|
60
|
+
* `GET /api/v1/content/:typeName/group/:localeGroupId/translations` — the
|
|
61
|
+
* group's other published locale rows.
|
|
62
|
+
*
|
|
63
|
+
* Reachable without holding any entry id at all: the group id alone names
|
|
64
|
+
* every language a story is live in.
|
|
65
|
+
*/
|
|
66
|
+
getTranslationsByLocaleGroup(typeName: string, localeGroupId: string, query: PublicEntryQueryDto, workspaceId: string): Promise<PublicEntryTranslationsView>;
|
|
67
|
+
/** `GET /api/v1/content/:typeName/:id` — one published entry. */
|
|
68
|
+
getOne(typeName: string, id: string, query: PublicEntryQueryDto, workspaceId: string): Promise<PublicEntry>;
|
|
69
|
+
/**
|
|
70
|
+
* `GET /api/v1/content/:typeName/:id/relations/:field` — one page of a
|
|
71
|
+
* single relation field's links.
|
|
72
|
+
*
|
|
73
|
+
* The **only** relation route, deliberately. An all-fields sibling
|
|
74
|
+
* (`/:id/relations`) used to sit here and returned exactly what
|
|
75
|
+
* `GET /:id?relations=preview` already returns minus the entry — a second
|
|
76
|
+
* spelling of one read, on a contract that has to stay still. Paging one
|
|
77
|
+
* field past the preview's cap is the one thing a query parameter cannot
|
|
78
|
+
* express, so it is the one thing that keeps a route.
|
|
79
|
+
*/
|
|
80
|
+
getRelationField(typeName: string, id: string, field: string, query: PublicListEntriesQueryDto, workspaceId: string): Promise<PublicRelationFieldView>;
|
|
81
|
+
/**
|
|
82
|
+
* `GET /api/v1/content/:typeName/:id/media` — every media field of one
|
|
83
|
+
* entry, resolved to asset metadata and URLs.
|
|
84
|
+
*/
|
|
85
|
+
getMedia(typeName: string, id: string, query: PublicEntryQueryDto, workspaceId: string): Promise<PublicEntryMediaView>;
|
|
86
|
+
/**
|
|
87
|
+
* `GET /api/v1/content/:typeName/:id/translations` — the entry's other
|
|
88
|
+
* locale rows. The sibling of `?translations=preview`, for a consumer that
|
|
89
|
+
* already holds the entry.
|
|
90
|
+
*/
|
|
91
|
+
getTranslations(typeName: string, id: string, query: PublicEntryQueryDto, workspaceId: string): Promise<PublicEntryTranslationsView>;
|
|
92
|
+
/** @see getOne */
|
|
93
|
+
private readEntry;
|
|
94
|
+
/** @see getRelationField */
|
|
95
|
+
private readRelationField;
|
|
96
|
+
/** @see getMedia */
|
|
97
|
+
private readMedia;
|
|
98
|
+
/** @see getTranslations */
|
|
99
|
+
private readTranslations;
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=public-entries.controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-entries.controller.d.ts","sourceRoot":"","sources":["../../../../../src/lib/public-api/http/controllers/public-entries.controller.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AACnF,OAAO,EAAE,oBAAoB,EAAE,MAAM,uDAAuD,CAAC;AAC7F,OAAO,EACH,kBAAkB,EAErB,MAAM,2CAA2C,CAAC;AACnD,OAAO,KAAK,EACR,WAAW,EACX,mBAAmB,EACtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EACR,oBAAoB,EACpB,uBAAuB,EAC1B,MAAM,8BAA8B,CAAC;AAKtC,OAAO,EACH,mBAAmB,EACnB,yBAAyB,EAC5B,MAAM,sCAAsC,CAAC;AAG9C,qDAAqD;AACrD,MAAM,WAAW,oBAAoB;IACjC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;CAC/C;AAED,wCAAwC;AACxC,MAAM,WAAW,2BAA2B;IACxC,YAAY,EAAE,WAAW,EAAE,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAWa,uBAAuB;IAG5B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAFP,QAAQ,EAAE,mBAAmB,EAC7B,MAAM,EAAE,oBAAoB,EAC5B,OAAO,EAAE,kBAAkB;IAGhD,uEAAuE;IAOjE,IAAI,CACa,QAAQ,EAAE,MAAM,EAC1B,KAAK,EAAE,yBAAyB,EACrB,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,mBAAmB,CAAC;IA2B/B;;;OAGG;IAOG,gBAAgB,CACC,QAAQ,EAAE,MAAM,EACI,aAAa,EAAE,MAAM,EACnD,KAAK,EAAE,mBAAmB,EACf,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,WAAW,CAAC;IAIvB;;;;OAIG;IAOG,6BAA6B,CACZ,QAAQ,EAAE,MAAM,EACI,aAAa,EAAE,MAAM,EAC5C,KAAK,EAAE,MAAM,EACpB,KAAK,EAAE,yBAAyB,EACrB,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,uBAAuB,CAAC;IAUnC;;;OAGG;IAOG,qBAAqB,CACJ,QAAQ,EAAE,MAAM,EACI,aAAa,EAAE,MAAM,EACnD,KAAK,EAAE,mBAAmB,EACf,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,oBAAoB,CAAC;IAIhC;;;;;;OAMG;IAOG,4BAA4B,CACX,QAAQ,EAAE,MAAM,EACI,aAAa,EAAE,MAAM,EACnD,KAAK,EAAE,mBAAmB,EACf,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,2BAA2B,CAAC;IAWvC,iEAAiE;IAO3D,MAAM,CACW,QAAQ,EAAE,MAAM,EACP,EAAE,EAAE,MAAM,EAC7B,KAAK,EAAE,mBAAmB,EACf,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,WAAW,CAAC;IAIvB;;;;;;;;;;OAUG;IAOG,gBAAgB,CACC,QAAQ,EAAE,MAAM,EACP,EAAE,EAAE,MAAM,EACtB,KAAK,EAAE,MAAM,EACpB,KAAK,EAAE,yBAAyB,EACrB,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,uBAAuB,CAAC;IAUnC;;;OAGG;IAOG,QAAQ,CACS,QAAQ,EAAE,MAAM,EACP,EAAE,EAAE,MAAM,EAC7B,KAAK,EAAE,mBAAmB,EACf,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,oBAAoB,CAAC;IAIhC;;;;OAIG;IAOG,eAAe,CACE,QAAQ,EAAE,MAAM,EACP,EAAE,EAAE,MAAM,EAC7B,KAAK,EAAE,mBAAmB,EACf,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,2BAA2B,CAAC;IAUvC,kBAAkB;YACJ,SAAS;IAevB,4BAA4B;YACd,iBAAiB;IA0B/B,oBAAoB;YACN,SAAS;IAwBvB,2BAA2B;YACb,gBAAgB;CAqBjC"}
|