@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,61 @@
|
|
|
1
|
+
import type { FieldSchema } from '@orthacms/utils-server';
|
|
2
|
+
import type { WireFilterField } from '../entries/types/filter-surface';
|
|
3
|
+
/**
|
|
4
|
+
* The operators the filter engine accepts, as the model sees them. Mirrors
|
|
5
|
+
* `FilterOperator` in `@orthacms/utils-server` — restated rather than imported
|
|
6
|
+
* so the descriptions can be written *for a model* instead of for a developer.
|
|
7
|
+
*/
|
|
8
|
+
export declare const FILTER_OPERATORS: readonly ["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin", "like", "ilike", "nilike", "null"];
|
|
9
|
+
/**
|
|
10
|
+
* The JSON Schema for a filter tree, handed to the model as
|
|
11
|
+
* `admin_content_search`'s `filter` parameter.
|
|
12
|
+
*
|
|
13
|
+
* The grammar is the query builder's own — a node is either a group
|
|
14
|
+
* (`{and: […]}` / `{or: […]}`) or a rule (`{field, op, value}`) — so the model
|
|
15
|
+
* emits exactly what the admin's UI emits and the same parser validates both.
|
|
16
|
+
* **The model never writes SQL**: `parseFilterTree` checks every path against a
|
|
17
|
+
* schema derived from the content type, so an unknown field or an ungranted
|
|
18
|
+
* relation hop is a rejected filter, not a query.
|
|
19
|
+
*
|
|
20
|
+
* `$ref`/`$defs` are deliberately avoided — a recursive schema is exactly the
|
|
21
|
+
* thing small models handle worst, and our own `validateToolInput` ignores
|
|
22
|
+
* `$ref` anyway. Two literal levels of nesting cover every filter the admin's
|
|
23
|
+
* own query builder can produce, and a deeper one still *works*: the validator
|
|
24
|
+
* only checks what it is given, and the real depth limit is the parser's.
|
|
25
|
+
*/
|
|
26
|
+
export declare function filterTreeSchema(): Record<string, unknown>;
|
|
27
|
+
/**
|
|
28
|
+
* The filterable paths, flattened for a model.
|
|
29
|
+
*
|
|
30
|
+
* `WireFilterField` carries a `group` breadcrumb for the admin's picker UI,
|
|
31
|
+
* which is noise here — a model wants the dotted path, the coercion type, and
|
|
32
|
+
* the allowed values for an enum. Trimming it also keeps `admin_content_types`
|
|
33
|
+
* affordable on a type with a wide relation graph.
|
|
34
|
+
*
|
|
35
|
+
* **`wire` alone is the picker's list, which is narrower than what SQL
|
|
36
|
+
* accepts** — and the gap is not cosmetic. `scalarWireOf` pushes `status` and
|
|
37
|
+
* the type's own fields; the envelope timestamps, `publishedAt` above all, are
|
|
38
|
+
* whitelisted for SQL and deliberately kept out of the admin UI. A person does
|
|
39
|
+
* not need `publishedAt` in a picker — they have a **Modified** badge in front
|
|
40
|
+
* of them. A model has no badge, and without this path cannot express
|
|
41
|
+
* "published content with unpublished changes" at all: it falls back to
|
|
42
|
+
* `status eq draft` and counts never-published drafts as edits, or invents
|
|
43
|
+
* `status eq "modified"` and gets an enum error. Both answers are confidently
|
|
44
|
+
* wrong, which is exactly what the filter grammar's "only paths listed by
|
|
45
|
+
* admin_content_types are accepted" is supposed to prevent.
|
|
46
|
+
*
|
|
47
|
+
* So `sqlFields` — the ROOT level of the very `FilterSchema` that is the
|
|
48
|
+
* security boundary — is unioned in. Reading the boundary is the opposite of
|
|
49
|
+
* a second source of truth: a field added to `scalarFieldsOf` later is offered
|
|
50
|
+
* here automatically, with {@link PARAMETER_BACKED_FIELDS} the one stated
|
|
51
|
+
* exception. Relation-level envelope paths (`author.publishedAt`) stay
|
|
52
|
+
* unadvertised: SQL still accepts them, and listing every hop's envelope would
|
|
53
|
+
* cost more prompt than it buys.
|
|
54
|
+
*/
|
|
55
|
+
export declare function describeFilterFields(fields: readonly WireFilterField[], sqlFields?: FieldSchema): Array<{
|
|
56
|
+
path: string;
|
|
57
|
+
type: string;
|
|
58
|
+
values?: readonly string[];
|
|
59
|
+
relationTo?: string;
|
|
60
|
+
}>;
|
|
61
|
+
//# sourceMappingURL=filter-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter-schema.d.ts","sourceRoot":"","sources":["../../../src/lib/copilot/filter-schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAEvE;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,iGAanB,CAAC;AAEX;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAwC1D;AAiBD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,oBAAoB,CAChC,MAAM,EAAE,SAAS,eAAe,EAAE,EAClC,SAAS,CAAC,EAAE,WAAW,GACxB,KAAK,CAAC;IACL,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC,CAoBD"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FILTER_OPERATORS = void 0;
|
|
4
|
+
exports.filterTreeSchema = filterTreeSchema;
|
|
5
|
+
exports.describeFilterFields = describeFilterFields;
|
|
6
|
+
/**
|
|
7
|
+
* The operators the filter engine accepts, as the model sees them. Mirrors
|
|
8
|
+
* `FilterOperator` in `@orthacms/utils-server` — restated rather than imported
|
|
9
|
+
* so the descriptions can be written *for a model* instead of for a developer.
|
|
10
|
+
*/
|
|
11
|
+
exports.FILTER_OPERATORS = [
|
|
12
|
+
'eq',
|
|
13
|
+
'ne',
|
|
14
|
+
'gt',
|
|
15
|
+
'gte',
|
|
16
|
+
'lt',
|
|
17
|
+
'lte',
|
|
18
|
+
'in',
|
|
19
|
+
'nin',
|
|
20
|
+
'like',
|
|
21
|
+
'ilike',
|
|
22
|
+
'nilike',
|
|
23
|
+
'null'
|
|
24
|
+
];
|
|
25
|
+
/**
|
|
26
|
+
* The JSON Schema for a filter tree, handed to the model as
|
|
27
|
+
* `admin_content_search`'s `filter` parameter.
|
|
28
|
+
*
|
|
29
|
+
* The grammar is the query builder's own — a node is either a group
|
|
30
|
+
* (`{and: […]}` / `{or: […]}`) or a rule (`{field, op, value}`) — so the model
|
|
31
|
+
* emits exactly what the admin's UI emits and the same parser validates both.
|
|
32
|
+
* **The model never writes SQL**: `parseFilterTree` checks every path against a
|
|
33
|
+
* schema derived from the content type, so an unknown field or an ungranted
|
|
34
|
+
* relation hop is a rejected filter, not a query.
|
|
35
|
+
*
|
|
36
|
+
* `$ref`/`$defs` are deliberately avoided — a recursive schema is exactly the
|
|
37
|
+
* thing small models handle worst, and our own `validateToolInput` ignores
|
|
38
|
+
* `$ref` anyway. Two literal levels of nesting cover every filter the admin's
|
|
39
|
+
* own query builder can produce, and a deeper one still *works*: the validator
|
|
40
|
+
* only checks what it is given, and the real depth limit is the parser's.
|
|
41
|
+
*/
|
|
42
|
+
function filterTreeSchema() {
|
|
43
|
+
const rule = {
|
|
44
|
+
type: 'object',
|
|
45
|
+
properties: {
|
|
46
|
+
field: {
|
|
47
|
+
type: 'string',
|
|
48
|
+
description: 'A filterable path from admin_content_types → filterableFields, e.g. "status" or "author.name".'
|
|
49
|
+
},
|
|
50
|
+
op: {
|
|
51
|
+
type: 'string',
|
|
52
|
+
enum: [...exports.FILTER_OPERATORS],
|
|
53
|
+
description: 'like/ilike/nilike match text only — they are rejected on a date, number, boolean or uuid field. Use eq/ne, the ordering operators, or in/nin there.'
|
|
54
|
+
},
|
|
55
|
+
value: {
|
|
56
|
+
description: 'The comparison value. An array for in/nin; a boolean for null (true = IS NULL); omitted values are rejected.'
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
required: ['field', 'op'],
|
|
60
|
+
additionalProperties: false
|
|
61
|
+
};
|
|
62
|
+
const group = (of) => ({
|
|
63
|
+
type: 'object',
|
|
64
|
+
properties: {
|
|
65
|
+
and: { type: 'array', items: of },
|
|
66
|
+
or: { type: 'array', items: of }
|
|
67
|
+
},
|
|
68
|
+
additionalProperties: false
|
|
69
|
+
});
|
|
70
|
+
return {
|
|
71
|
+
...group({ anyOf: [rule, group(rule)] }),
|
|
72
|
+
description: 'A filter tree. Either a group — {"and":[…]} or {"or":[…]} — or, nested inside one, ' +
|
|
73
|
+
'rules of the form {"field":"status","op":"eq","value":"published"}. ' +
|
|
74
|
+
'Only paths listed by admin_content_types are accepted.'
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Root envelope columns the SQL whitelist accepts but that must NOT be
|
|
79
|
+
* advertised, because each already has a dedicated tool **parameter**.
|
|
80
|
+
*
|
|
81
|
+
* `admin_content_search` takes `locale`, which the bound entry extension
|
|
82
|
+
* validates and scopes with; a model that filtered `locale eq "de"` instead
|
|
83
|
+
* would AND that onto the extension's own scope — already pinned to the
|
|
84
|
+
* default locale — and read zero rows from a perfectly valid query. Offering
|
|
85
|
+
* both spellings of one idea is how a model picks the broken one.
|
|
86
|
+
*/
|
|
87
|
+
const PARAMETER_BACKED_FIELDS = new Set([
|
|
88
|
+
'locale',
|
|
89
|
+
'localeGroupId'
|
|
90
|
+
]);
|
|
91
|
+
/**
|
|
92
|
+
* The filterable paths, flattened for a model.
|
|
93
|
+
*
|
|
94
|
+
* `WireFilterField` carries a `group` breadcrumb for the admin's picker UI,
|
|
95
|
+
* which is noise here — a model wants the dotted path, the coercion type, and
|
|
96
|
+
* the allowed values for an enum. Trimming it also keeps `admin_content_types`
|
|
97
|
+
* affordable on a type with a wide relation graph.
|
|
98
|
+
*
|
|
99
|
+
* **`wire` alone is the picker's list, which is narrower than what SQL
|
|
100
|
+
* accepts** — and the gap is not cosmetic. `scalarWireOf` pushes `status` and
|
|
101
|
+
* the type's own fields; the envelope timestamps, `publishedAt` above all, are
|
|
102
|
+
* whitelisted for SQL and deliberately kept out of the admin UI. A person does
|
|
103
|
+
* not need `publishedAt` in a picker — they have a **Modified** badge in front
|
|
104
|
+
* of them. A model has no badge, and without this path cannot express
|
|
105
|
+
* "published content with unpublished changes" at all: it falls back to
|
|
106
|
+
* `status eq draft` and counts never-published drafts as edits, or invents
|
|
107
|
+
* `status eq "modified"` and gets an enum error. Both answers are confidently
|
|
108
|
+
* wrong, which is exactly what the filter grammar's "only paths listed by
|
|
109
|
+
* admin_content_types are accepted" is supposed to prevent.
|
|
110
|
+
*
|
|
111
|
+
* So `sqlFields` — the ROOT level of the very `FilterSchema` that is the
|
|
112
|
+
* security boundary — is unioned in. Reading the boundary is the opposite of
|
|
113
|
+
* a second source of truth: a field added to `scalarFieldsOf` later is offered
|
|
114
|
+
* here automatically, with {@link PARAMETER_BACKED_FIELDS} the one stated
|
|
115
|
+
* exception. Relation-level envelope paths (`author.publishedAt`) stay
|
|
116
|
+
* unadvertised: SQL still accepts them, and listing every hop's envelope would
|
|
117
|
+
* cost more prompt than it buys.
|
|
118
|
+
*/
|
|
119
|
+
function describeFilterFields(fields, sqlFields) {
|
|
120
|
+
const described = fields.map((field) => ({
|
|
121
|
+
path: field.path,
|
|
122
|
+
type: field.type,
|
|
123
|
+
...(field.enumValues ? { values: field.enumValues } : {}),
|
|
124
|
+
...(field.relationTarget ? { relationTo: field.relationTarget } : {})
|
|
125
|
+
}));
|
|
126
|
+
if (!sqlFields)
|
|
127
|
+
return described;
|
|
128
|
+
const advertised = new Set(described.map((field) => field.path));
|
|
129
|
+
for (const [name, spec] of Object.entries(sqlFields)) {
|
|
130
|
+
if (advertised.has(name) || PARAMETER_BACKED_FIELDS.has(name))
|
|
131
|
+
continue;
|
|
132
|
+
described.push({
|
|
133
|
+
path: name,
|
|
134
|
+
type: spec.type,
|
|
135
|
+
...(spec.enumValues ? { values: spec.enumValues } : {})
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
return described;
|
|
139
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { EntryRecord } from '../entries/types/entry-list-view';
|
|
2
|
+
/**
|
|
3
|
+
* Narrows an entry's `values` to the named fields, leaving the envelope alone.
|
|
4
|
+
*
|
|
5
|
+
* **This is what makes "list all the articles" possible at all.** A full
|
|
6
|
+
* `EntryRecord` carries every field including richtext bodies, so a page of 25
|
|
7
|
+
* can be tens of thousands of tokens — the run hits its token ceiling long
|
|
8
|
+
* before it hits the row cap. Asking for `["text","status"]` turns the same page
|
|
9
|
+
* into something a model can actually reason over.
|
|
10
|
+
*
|
|
11
|
+
* The envelope (`id`, `status`, `locale`, timestamps, …) is always kept: `id` is
|
|
12
|
+
* what makes an entry addressable for a follow-up `admin_content_get`, and a
|
|
13
|
+
* projection that could drop it would be a trap. Same rule the public API's
|
|
14
|
+
* sparse fieldsets follow.
|
|
15
|
+
*
|
|
16
|
+
* An unknown name is **ignored** rather than rejected. The public API 400s one,
|
|
17
|
+
* because there a typo is a developer's bug worth surfacing; here the names come
|
|
18
|
+
* from a model that may have mis-remembered a field, and failing the whole call
|
|
19
|
+
* over one bad name costs a round trip to learn something the response itself
|
|
20
|
+
* shows. The returned `values` say what was actually found.
|
|
21
|
+
*/
|
|
22
|
+
export declare function projectEntry(entry: EntryRecord, fields: readonly string[] | undefined): EntryRecord;
|
|
23
|
+
//# sourceMappingURL=project-entry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-entry.d.ts","sourceRoot":"","sources":["../../../src/lib/copilot/project-entry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAEpE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,YAAY,CACxB,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,GACtC,WAAW,CAYb"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.projectEntry = projectEntry;
|
|
4
|
+
/**
|
|
5
|
+
* Narrows an entry's `values` to the named fields, leaving the envelope alone.
|
|
6
|
+
*
|
|
7
|
+
* **This is what makes "list all the articles" possible at all.** A full
|
|
8
|
+
* `EntryRecord` carries every field including richtext bodies, so a page of 25
|
|
9
|
+
* can be tens of thousands of tokens — the run hits its token ceiling long
|
|
10
|
+
* before it hits the row cap. Asking for `["text","status"]` turns the same page
|
|
11
|
+
* into something a model can actually reason over.
|
|
12
|
+
*
|
|
13
|
+
* The envelope (`id`, `status`, `locale`, timestamps, …) is always kept: `id` is
|
|
14
|
+
* what makes an entry addressable for a follow-up `admin_content_get`, and a
|
|
15
|
+
* projection that could drop it would be a trap. Same rule the public API's
|
|
16
|
+
* sparse fieldsets follow.
|
|
17
|
+
*
|
|
18
|
+
* An unknown name is **ignored** rather than rejected. The public API 400s one,
|
|
19
|
+
* because there a typo is a developer's bug worth surfacing; here the names come
|
|
20
|
+
* from a model that may have mis-remembered a field, and failing the whole call
|
|
21
|
+
* over one bad name costs a round trip to learn something the response itself
|
|
22
|
+
* shows. The returned `values` say what was actually found.
|
|
23
|
+
*/
|
|
24
|
+
function projectEntry(entry, fields) {
|
|
25
|
+
if (!fields || fields.length === 0) {
|
|
26
|
+
return entry;
|
|
27
|
+
}
|
|
28
|
+
const wanted = new Set(fields);
|
|
29
|
+
const values = {};
|
|
30
|
+
for (const [key, value] of Object.entries(entry.values ?? {})) {
|
|
31
|
+
if (wanted.has(key)) {
|
|
32
|
+
values[key] = value;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return { ...entry, values };
|
|
36
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The proposal kinds this plugin declares and applies.
|
|
3
|
+
*
|
|
4
|
+
* Named once here rather than spelled as literals in the tool and again in the
|
|
5
|
+
* applier: the two halves are in different files and a typo between them
|
|
6
|
+
* produces a proposal nothing can carry out — which surfaces only when a human
|
|
7
|
+
* clicks Accept, long after the mistake.
|
|
8
|
+
*
|
|
9
|
+
* They are namespaced like tool names for the same reason MCP tools are
|
|
10
|
+
* (ADR-0005 §8): the registry refuses a duplicate `kind`, so a flat name like
|
|
11
|
+
* `update` would be a collision waiting for the second plugin that wants it.
|
|
12
|
+
*/
|
|
13
|
+
export declare const CONTENT_PROPOSAL_KINDS: {
|
|
14
|
+
/** A new draft entry of a content type. */
|
|
15
|
+
readonly createEntry: "content.entry.create";
|
|
16
|
+
/** A change to an existing entry's field values. */
|
|
17
|
+
readonly updateEntry: "content.entry.update";
|
|
18
|
+
/**
|
|
19
|
+
* A batch of creates and updates on one content type, carried out as one
|
|
20
|
+
* change.
|
|
21
|
+
*
|
|
22
|
+
* Its own kind rather than a repeated `createEntry`/`updateEntry`, because
|
|
23
|
+
* a proposal row is the receipt for **one tool call**: a batch that wrote
|
|
24
|
+
* itself as twelve rows would be twelve cards in the transcript for a
|
|
25
|
+
* change the user asked for once, and no row would say what the other
|
|
26
|
+
* eleven were.
|
|
27
|
+
*/
|
|
28
|
+
readonly bulkSaveEntries: "content.entry.bulk-save";
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=proposal-kinds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proposal-kinds.d.ts","sourceRoot":"","sources":["../../../src/lib/copilot/proposal-kinds.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,sBAAsB;IAC/B,2CAA2C;;IAE3C,oDAAoD;;IAEpD;;;;;;;;;OASG;;CAEG,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CONTENT_PROPOSAL_KINDS = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The proposal kinds this plugin declares and applies.
|
|
6
|
+
*
|
|
7
|
+
* Named once here rather than spelled as literals in the tool and again in the
|
|
8
|
+
* applier: the two halves are in different files and a typo between them
|
|
9
|
+
* produces a proposal nothing can carry out — which surfaces only when a human
|
|
10
|
+
* clicks Accept, long after the mistake.
|
|
11
|
+
*
|
|
12
|
+
* They are namespaced like tool names for the same reason MCP tools are
|
|
13
|
+
* (ADR-0005 §8): the registry refuses a duplicate `kind`, so a flat name like
|
|
14
|
+
* `update` would be a collision waiting for the second plugin that wants it.
|
|
15
|
+
*/
|
|
16
|
+
exports.CONTENT_PROPOSAL_KINDS = {
|
|
17
|
+
/** A new draft entry of a content type. */
|
|
18
|
+
createEntry: 'content.entry.create',
|
|
19
|
+
/** A change to an existing entry's field values. */
|
|
20
|
+
updateEntry: 'content.entry.update',
|
|
21
|
+
/**
|
|
22
|
+
* A batch of creates and updates on one content type, carried out as one
|
|
23
|
+
* change.
|
|
24
|
+
*
|
|
25
|
+
* Its own kind rather than a repeated `createEntry`/`updateEntry`, because
|
|
26
|
+
* a proposal row is the receipt for **one tool call**: a batch that wrote
|
|
27
|
+
* itself as twelve rows would be twelve cards in the transcript for a
|
|
28
|
+
* change the user asked for once, and no row would say what the other
|
|
29
|
+
* eleven were.
|
|
30
|
+
*/
|
|
31
|
+
bulkSaveEntries: 'content.entry.bulk-save'
|
|
32
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type OnModuleInit } from '@nestjs/common';
|
|
2
|
+
import { ToolRegistry } from '@orthacms/tools-server';
|
|
3
|
+
import type { ToolDefinition, ToolProvider } from '@orthacms/tools-server';
|
|
4
|
+
import type { ContentTypeRegistry } from '../registry/content-type-registry';
|
|
5
|
+
import { WorkspaceGrantsQuery } from '../content-types/queries/workspace-grants.query';
|
|
6
|
+
import { type RevisionStore } from '../revisions/application/ports/revision-store';
|
|
7
|
+
/**
|
|
8
|
+
* The content plugin's **version-history** tools — `admin_content_revisions` and
|
|
9
|
+
* `admin_content_diff`.
|
|
10
|
+
*
|
|
11
|
+
* A second provider rather than more methods on
|
|
12
|
+
* {@link ContentCopilotToolProvider}: revisions are their own feature folder
|
|
13
|
+
* with their own port, and the registry takes any number of providers, so the
|
|
14
|
+
* split costs one `register(...)` call and keeps each file about one thing.
|
|
15
|
+
*
|
|
16
|
+
* Both re-check the workspace's content grants for the same reason the entry
|
|
17
|
+
* tools do — the type name arrives from the *model*. The revision store is
|
|
18
|
+
* workspace-scoped on every read besides, so an entry id from another workspace
|
|
19
|
+
* reads as absent rather than as a leak.
|
|
20
|
+
*/
|
|
21
|
+
export declare class RevisionCopilotToolProvider implements ToolProvider, OnModuleInit {
|
|
22
|
+
private readonly registry;
|
|
23
|
+
private readonly revisions;
|
|
24
|
+
private readonly grants;
|
|
25
|
+
private readonly toolRegistry?;
|
|
26
|
+
constructor(registry: ContentTypeRegistry, revisions: RevisionStore, grants: WorkspaceGrantsQuery, toolRegistry?: ToolRegistry | undefined);
|
|
27
|
+
/**
|
|
28
|
+
* Register with the shared tool registry once the DI graph is built —
|
|
29
|
+
* the same catalogue the MCP endpoint serves, narrowed to the `copilot`
|
|
30
|
+
* surface by each tool's `surfaces`. `@Optional()` because a deployment
|
|
31
|
+
* may run neither consumer, in which case these simply go unregistered.
|
|
32
|
+
*/
|
|
33
|
+
onModuleInit(): void;
|
|
34
|
+
/** The two history tools, in the order the model sees them. */
|
|
35
|
+
tools(): readonly ToolDefinition[];
|
|
36
|
+
/**
|
|
37
|
+
* Resolves a model-supplied type name to a granted, registered type, or
|
|
38
|
+
* throws. Same uniform message as the entry tools, for the same reason:
|
|
39
|
+
* distinguishing "not granted" from "does not exist" would let a run in one
|
|
40
|
+
* workspace enumerate the deployment's other content types.
|
|
41
|
+
*/
|
|
42
|
+
private resolveGranted;
|
|
43
|
+
/** `admin_content_revisions` — an entry's version timeline, newest first. */
|
|
44
|
+
private listRevisions;
|
|
45
|
+
/**
|
|
46
|
+
* `admin_content_diff` — what changed between two versions.
|
|
47
|
+
*
|
|
48
|
+
* The tool returns **only the changed fields**, plus a count of the
|
|
49
|
+
* unchanged ones. A full side-by-side of every field is what the admin's
|
|
50
|
+
* dialog renders, because a person wants unchanged rows for context; a
|
|
51
|
+
* model gets nothing from them but a bigger prompt, and on a wide type the
|
|
52
|
+
* unchanged richtext bodies alone would dominate the run's token budget.
|
|
53
|
+
*/
|
|
54
|
+
private diffRevisions;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=revision-tool.provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"revision-tool.provider.d.ts","sourceRoot":"","sources":["../../../src/lib/copilot/revision-tool.provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEzE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,iDAAiD,CAAC;AACvF,OAAO,EAEH,KAAK,aAAa,EACrB,MAAM,+CAA+C,CAAC;AAMvD;;;;;;;;;;;;;GAaG;AACH,qBACa,2BAA4B,YAAW,YAAY,EAAE,YAAY;IAGtE,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAEzB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACX,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC;gBAJzB,QAAQ,EAAE,mBAAmB,EAE7B,SAAS,EAAE,aAAa,EACxB,MAAM,EAAE,oBAAoB,EAChB,YAAY,CAAC,EAAE,YAAY,YAAA;IAG5D;;;;;OAKG;IACH,YAAY,IAAI,IAAI;IAIpB,+DAA+D;IAC/D,KAAK,IAAI,SAAS,cAAc,EAAE;IAIlC;;;;;OAKG;YACW,cAAc;IAW5B,6EAA6E;IAC7E,OAAO,CAAC,aAAa;IA2ErB;;;;;;;;OAQG;IACH,OAAO,CAAC,aAAa;CA0GxB"}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RevisionCopilotToolProvider = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const common_1 = require("@nestjs/common");
|
|
6
|
+
const identity_server_1 = require("@orthacms/identity-server");
|
|
7
|
+
const tools_server_1 = require("@orthacms/tools-server");
|
|
8
|
+
const content_tokens_1 = require("../content.tokens");
|
|
9
|
+
const workspace_grants_query_1 = require("../content-types/queries/workspace-grants.query");
|
|
10
|
+
const revision_store_1 = require("../revisions/application/ports/revision-store");
|
|
11
|
+
const diff_snapshots_1 = require("./diff-snapshots");
|
|
12
|
+
/** Revisions a single `admin_content_revisions` call may return. */
|
|
13
|
+
const MAX_REVISION_PAGE_SIZE = 25;
|
|
14
|
+
/**
|
|
15
|
+
* The content plugin's **version-history** tools — `admin_content_revisions` and
|
|
16
|
+
* `admin_content_diff`.
|
|
17
|
+
*
|
|
18
|
+
* A second provider rather than more methods on
|
|
19
|
+
* {@link ContentCopilotToolProvider}: revisions are their own feature folder
|
|
20
|
+
* with their own port, and the registry takes any number of providers, so the
|
|
21
|
+
* split costs one `register(...)` call and keeps each file about one thing.
|
|
22
|
+
*
|
|
23
|
+
* Both re-check the workspace's content grants for the same reason the entry
|
|
24
|
+
* tools do — the type name arrives from the *model*. The revision store is
|
|
25
|
+
* workspace-scoped on every read besides, so an entry id from another workspace
|
|
26
|
+
* reads as absent rather than as a leak.
|
|
27
|
+
*/
|
|
28
|
+
let RevisionCopilotToolProvider = class RevisionCopilotToolProvider {
|
|
29
|
+
registry;
|
|
30
|
+
revisions;
|
|
31
|
+
grants;
|
|
32
|
+
toolRegistry;
|
|
33
|
+
constructor(registry, revisions, grants, toolRegistry) {
|
|
34
|
+
this.registry = registry;
|
|
35
|
+
this.revisions = revisions;
|
|
36
|
+
this.grants = grants;
|
|
37
|
+
this.toolRegistry = toolRegistry;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Register with the shared tool registry once the DI graph is built —
|
|
41
|
+
* the same catalogue the MCP endpoint serves, narrowed to the `copilot`
|
|
42
|
+
* surface by each tool's `surfaces`. `@Optional()` because a deployment
|
|
43
|
+
* may run neither consumer, in which case these simply go unregistered.
|
|
44
|
+
*/
|
|
45
|
+
onModuleInit() {
|
|
46
|
+
this.toolRegistry?.register(this);
|
|
47
|
+
}
|
|
48
|
+
/** The two history tools, in the order the model sees them. */
|
|
49
|
+
tools() {
|
|
50
|
+
return [this.listRevisions(), this.diffRevisions()];
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Resolves a model-supplied type name to a granted, registered type, or
|
|
54
|
+
* throws. Same uniform message as the entry tools, for the same reason:
|
|
55
|
+
* distinguishing "not granted" from "does not exist" would let a run in one
|
|
56
|
+
* workspace enumerate the deployment's other content types.
|
|
57
|
+
*/
|
|
58
|
+
async resolveGranted(typeName, workspaceId) {
|
|
59
|
+
const type = this.registry.get(typeName);
|
|
60
|
+
const granted = await this.grants.grantedSlugs(workspaceId);
|
|
61
|
+
if (!type || !granted.has(type.name)) {
|
|
62
|
+
throw new Error(`Unknown content type "${typeName}" in this workspace.`);
|
|
63
|
+
}
|
|
64
|
+
return type;
|
|
65
|
+
}
|
|
66
|
+
/** `admin_content_revisions` — an entry's version timeline, newest first. */
|
|
67
|
+
listRevisions() {
|
|
68
|
+
return {
|
|
69
|
+
name: 'admin_content_revisions',
|
|
70
|
+
title: 'List an entry’s versions',
|
|
71
|
+
description: 'List an entry’s saved versions, newest first — version number, status ' +
|
|
72
|
+
'(draft / published / superseded), when it was captured and by whom. Use this ' +
|
|
73
|
+
'to answer “when did this change?” or “what version is live?”, and to find the ' +
|
|
74
|
+
'two version numbers to pass to admin_content_diff. Each locale of a ' +
|
|
75
|
+
'localized entry has its own timeline, keyed by that locale’s entry id.',
|
|
76
|
+
inputSchema: {
|
|
77
|
+
type: 'object',
|
|
78
|
+
properties: {
|
|
79
|
+
typeName: {
|
|
80
|
+
type: 'string',
|
|
81
|
+
description: 'The entry’s content type.'
|
|
82
|
+
},
|
|
83
|
+
id: {
|
|
84
|
+
type: 'string',
|
|
85
|
+
description: 'The entry’s id, as returned by admin_content_search.'
|
|
86
|
+
},
|
|
87
|
+
page: {
|
|
88
|
+
type: 'integer',
|
|
89
|
+
minimum: 1,
|
|
90
|
+
description: '1-based page number.'
|
|
91
|
+
},
|
|
92
|
+
pageSize: {
|
|
93
|
+
type: 'integer',
|
|
94
|
+
minimum: 1,
|
|
95
|
+
maximum: MAX_REVISION_PAGE_SIZE,
|
|
96
|
+
description: `Versions per page (max ${MAX_REVISION_PAGE_SIZE}).`
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
required: ['typeName', 'id'],
|
|
100
|
+
additionalProperties: false
|
|
101
|
+
},
|
|
102
|
+
requires: [identity_server_1.PERMISSIONS.CONTENT_READ],
|
|
103
|
+
readOnly: true,
|
|
104
|
+
effect: 'read',
|
|
105
|
+
surfaces: ['copilot'],
|
|
106
|
+
handler: async (input, ctx) => {
|
|
107
|
+
const args = (input ?? {});
|
|
108
|
+
const type = await this.resolveGranted(args.typeName, ctx.workspaceId);
|
|
109
|
+
// Clamped in `run` as well as declared: the schema validator is
|
|
110
|
+
// defence in depth, not the boundary.
|
|
111
|
+
const pageSize = Math.min(Math.max(args.pageSize ?? 10, 1), MAX_REVISION_PAGE_SIZE);
|
|
112
|
+
const result = await this.revisions.list(type.name, args.id, ctx.workspaceId, Math.max(args.page ?? 1, 1), pageSize);
|
|
113
|
+
return {
|
|
114
|
+
...result,
|
|
115
|
+
page: Math.max(args.page ?? 1, 1),
|
|
116
|
+
pageSize
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* `admin_content_diff` — what changed between two versions.
|
|
123
|
+
*
|
|
124
|
+
* The tool returns **only the changed fields**, plus a count of the
|
|
125
|
+
* unchanged ones. A full side-by-side of every field is what the admin's
|
|
126
|
+
* dialog renders, because a person wants unchanged rows for context; a
|
|
127
|
+
* model gets nothing from them but a bigger prompt, and on a wide type the
|
|
128
|
+
* unchanged richtext bodies alone would dominate the run's token budget.
|
|
129
|
+
*/
|
|
130
|
+
diffRevisions() {
|
|
131
|
+
return {
|
|
132
|
+
name: 'admin_content_diff',
|
|
133
|
+
title: 'Compare two versions',
|
|
134
|
+
description: 'Compare two saved versions of an entry and report which fields differ, with ' +
|
|
135
|
+
'the before and after value of each. Only changed fields are returned (the ' +
|
|
136
|
+
'number of unchanged ones is reported separately). Get the version numbers ' +
|
|
137
|
+
'from admin_content_revisions.',
|
|
138
|
+
inputSchema: {
|
|
139
|
+
type: 'object',
|
|
140
|
+
properties: {
|
|
141
|
+
typeName: {
|
|
142
|
+
type: 'string',
|
|
143
|
+
description: 'The entry’s content type.'
|
|
144
|
+
},
|
|
145
|
+
id: { type: 'string', description: 'The entry’s id.' },
|
|
146
|
+
from: {
|
|
147
|
+
type: 'integer',
|
|
148
|
+
minimum: 1,
|
|
149
|
+
description: 'The older version number — the baseline to compare against.'
|
|
150
|
+
},
|
|
151
|
+
to: {
|
|
152
|
+
type: 'integer',
|
|
153
|
+
minimum: 1,
|
|
154
|
+
description: 'The newer version number.'
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
required: ['typeName', 'id', 'from', 'to'],
|
|
158
|
+
additionalProperties: false
|
|
159
|
+
},
|
|
160
|
+
requires: [identity_server_1.PERMISSIONS.CONTENT_READ],
|
|
161
|
+
readOnly: true,
|
|
162
|
+
effect: 'read',
|
|
163
|
+
surfaces: ['copilot'],
|
|
164
|
+
handler: async (input, ctx) => {
|
|
165
|
+
const args = (input ?? {});
|
|
166
|
+
const type = await this.resolveGranted(args.typeName, ctx.workspaceId);
|
|
167
|
+
const [before, after] = await Promise.all([
|
|
168
|
+
this.revisions.get(type.name, args.id, ctx.workspaceId, args.from),
|
|
169
|
+
this.revisions.get(type.name, args.id, ctx.workspaceId, args.to)
|
|
170
|
+
]);
|
|
171
|
+
// Naming the missing one matters: "version 7 does not exist"
|
|
172
|
+
// is recoverable by re-reading the timeline, "not found" is
|
|
173
|
+
// not. Neither reveals anything — the store is already
|
|
174
|
+
// workspace-scoped, so an entry the caller cannot reach has no
|
|
175
|
+
// versions to enumerate either.
|
|
176
|
+
const missing = [
|
|
177
|
+
...(before ? [] : [args.from]),
|
|
178
|
+
...(after ? [] : [args.to])
|
|
179
|
+
];
|
|
180
|
+
if (!before || !after) {
|
|
181
|
+
throw new Error(`No version ${missing.join(' or ')} of this entry.`);
|
|
182
|
+
}
|
|
183
|
+
// `serialize` is `T | undefined` for an unregistered name;
|
|
184
|
+
// `resolveGranted` already proved this one is registered, so
|
|
185
|
+
// the fallback is unreachable rather than a real branch — an
|
|
186
|
+
// empty field list would diff to "nothing changed", which is
|
|
187
|
+
// why it isn't left implicit.
|
|
188
|
+
const schema = this.registry.serialize(type.name);
|
|
189
|
+
if (!schema) {
|
|
190
|
+
throw new Error(`Unknown content type "${args.typeName}" in this workspace.`);
|
|
191
|
+
}
|
|
192
|
+
const { changes, unchangedFields } = (0, diff_snapshots_1.diffSnapshots)(schema, before.snapshot, after.snapshot);
|
|
193
|
+
return {
|
|
194
|
+
typeName: type.name,
|
|
195
|
+
from: {
|
|
196
|
+
number: before.number,
|
|
197
|
+
createdAt: before.createdAt
|
|
198
|
+
},
|
|
199
|
+
to: { number: after.number, createdAt: after.createdAt },
|
|
200
|
+
changes,
|
|
201
|
+
unchangedFields
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
exports.RevisionCopilotToolProvider = RevisionCopilotToolProvider;
|
|
208
|
+
exports.RevisionCopilotToolProvider = RevisionCopilotToolProvider = tslib_1.__decorate([
|
|
209
|
+
(0, common_1.Injectable)(),
|
|
210
|
+
tslib_1.__param(0, (0, content_tokens_1.InjectContentRegistry)()),
|
|
211
|
+
tslib_1.__param(1, (0, revision_store_1.InjectRevisionStore)()),
|
|
212
|
+
tslib_1.__param(3, (0, common_1.Optional)()),
|
|
213
|
+
tslib_1.__metadata("design:paramtypes", [Function, Object, workspace_grants_query_1.WorkspaceGrantsQuery,
|
|
214
|
+
tools_server_1.ToolRegistry])
|
|
215
|
+
], RevisionCopilotToolProvider);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The OpenAPI schemas this plugin contributes: one set **per registered content
|
|
3
|
+
* type** (generated from the registry) plus the fixed shapes its routes share.
|
|
4
|
+
*
|
|
5
|
+
* Content types are code-defined runtime data, not decorated classes, so
|
|
6
|
+
* `@nestjs/swagger` cannot see them. This module is how they become visible.
|
|
7
|
+
*/
|
|
8
|
+
import type { SerializedContentType } from '../registry/content-type-registry';
|
|
9
|
+
import { type OpenApiSchema } from './field-schema';
|
|
10
|
+
/** Schema names of one content type's generated trio. */
|
|
11
|
+
export interface TypeSchemaNames {
|
|
12
|
+
/** The `values` bag — one property per column-backed field. */
|
|
13
|
+
values: string;
|
|
14
|
+
/** One entry: the storage envelope wrapping {@link values}. */
|
|
15
|
+
entry: string;
|
|
16
|
+
/** One page of entries. */
|
|
17
|
+
listPage: string;
|
|
18
|
+
}
|
|
19
|
+
/** `#/components/schemas/<name>`. */
|
|
20
|
+
export declare function ref(name: string): OpenApiSchema;
|
|
21
|
+
/**
|
|
22
|
+
* `article` → `Article`, `seo_meta` → `SeoMeta`. Content-type names are
|
|
23
|
+
* snake_case machine names; schema names are the PascalCase convention the rest
|
|
24
|
+
* of the document uses.
|
|
25
|
+
*/
|
|
26
|
+
export declare function pascalCase(name: string): string;
|
|
27
|
+
/** The three schema names a content type contributes. */
|
|
28
|
+
export declare function schemaNamesOf(type: SerializedContentType): TypeSchemaNames;
|
|
29
|
+
/**
|
|
30
|
+
* Every schema this plugin contributes: the shared shapes plus, for each
|
|
31
|
+
* registered content type, its `Values` / `Entry` / `ListPage` trio.
|
|
32
|
+
*/
|
|
33
|
+
export declare function buildContentSchemas(types: readonly SerializedContentType[]): Record<string, OpenApiSchema>;
|
|
34
|
+
//# sourceMappingURL=content-schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-schemas.d.ts","sourceRoot":"","sources":["../../../src/lib/docs/content-schemas.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,EAA6B,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/E,yDAAyD;AACzD,MAAM,WAAW,eAAe;IAC5B,+DAA+D;IAC/D,MAAM,EAAE,MAAM,CAAC;IACf,+DAA+D;IAC/D,KAAK,EAAE,MAAM,CAAC;IACd,2BAA2B;IAC3B,QAAQ,EAAE,MAAM,CAAC;CACpB;AAKD,qCAAqC;AACrC,wBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CAE/C;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAM/C;AAED,yDAAyD;AACzD,wBAAgB,aAAa,CAAC,IAAI,EAAE,qBAAqB,GAAG,eAAe,CAO1E;AAomBD;;;GAGG;AACH,wBAAgB,mBAAmB,CAC/B,KAAK,EAAE,SAAS,qBAAqB,EAAE,GACxC,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAS/B"}
|