canopycms 0.0.62 → 0.0.64
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/README.md +153 -19
- package/dist/ai/generate.d.ts +4 -5
- package/dist/ai/generate.js +0 -1
- package/dist/ai/handler.d.ts +3 -4
- package/dist/ai/handler.js +0 -1
- package/dist/ai/index.d.ts +15 -7
- package/dist/ai/index.js +9 -1
- package/dist/ai/json-to-markdown.d.ts +1 -2
- package/dist/ai/json-to-markdown.js +11 -2
- package/dist/ai/resolve-branch.d.ts +1 -2
- package/dist/ai/resolve-branch.js +0 -1
- package/dist/ai/strip-mdx.d.ts +0 -1
- package/dist/ai/strip-mdx.js +0 -1
- package/dist/ai/to-plain-text.d.ts +60 -0
- package/dist/ai/to-plain-text.js +301 -0
- package/dist/ai/transform-components.d.ts +1 -2
- package/dist/ai/transform-components.js +70 -6
- package/dist/ai/types.d.ts +1 -2
- package/dist/ai/types.js +0 -1
- package/dist/api/admin-branch-health.d.ts +7 -8
- package/dist/api/admin-branch-health.js +0 -1
- package/dist/api/admin.d.ts +16 -17
- package/dist/api/admin.js +0 -1
- package/dist/api/assets.d.ts +8 -9
- package/dist/api/assets.js +0 -1
- package/dist/api/branch-merge.d.ts +3 -4
- package/dist/api/branch-merge.js +0 -1
- package/dist/api/branch-review.d.ts +5 -6
- package/dist/api/branch-review.js +0 -1
- package/dist/api/branch-status.d.ts +15 -16
- package/dist/api/branch-status.js +0 -1
- package/dist/api/branch-withdraw.d.ts +3 -4
- package/dist/api/branch-withdraw.js +0 -1
- package/dist/api/branch.d.ts +13 -14
- package/dist/api/branch.js +0 -1
- package/dist/api/client.d.ts +14 -15
- package/dist/api/client.js +0 -1
- package/dist/api/comments.d.ts +11 -12
- package/dist/api/comments.js +0 -1
- package/dist/api/content.d.ts +22 -24
- package/dist/api/content.js +132 -18
- package/dist/api/entries-constants.d.ts +0 -1
- package/dist/api/entries-constants.js +0 -1
- package/dist/api/entries.d.ts +12 -13
- package/dist/api/entries.js +12 -2
- package/dist/api/github-sync.d.ts +2 -3
- package/dist/api/github-sync.js +0 -1
- package/dist/api/groups.d.ts +6 -7
- package/dist/api/groups.js +0 -1
- package/dist/api/guards.d.ts +2 -3
- package/dist/api/guards.js +0 -1
- package/dist/api/index.d.ts +18 -19
- package/dist/api/index.js +0 -1
- package/dist/api/permissions.d.ts +10 -11
- package/dist/api/permissions.js +0 -1
- package/dist/api/reference-options.d.ts +3 -4
- package/dist/api/reference-options.js +0 -1
- package/dist/api/request-body-hash.d.ts +0 -1
- package/dist/api/request-body-hash.js +0 -1
- package/dist/api/resolve-references.d.ts +6 -7
- package/dist/api/resolve-references.js +24 -6
- package/dist/api/route-builder.d.ts +2 -3
- package/dist/api/route-builder.js +0 -1
- package/dist/api/schema.d.ts +43 -44
- package/dist/api/schema.js +0 -1
- package/dist/api/settings-helpers.d.ts +2 -3
- package/dist/api/settings-helpers.js +0 -1
- package/dist/api/types.d.ts +6 -7
- package/dist/api/types.js +0 -1
- package/dist/api/user.d.ts +2 -3
- package/dist/api/user.js +0 -1
- package/dist/api/validators.d.ts +3 -4
- package/dist/api/validators.js +0 -1
- package/dist/assets/asset-prefixes.d.ts +1 -2
- package/dist/assets/asset-prefixes.js +0 -1
- package/dist/assets/asset-src.d.ts +17 -5
- package/dist/assets/asset-src.js +15 -3
- package/dist/assets/asset-url.d.ts +28 -7
- package/dist/assets/asset-url.js +20 -15
- package/dist/assets/factory.d.ts +2 -3
- package/dist/assets/factory.js +0 -2
- package/dist/assets/finalize.d.ts +2 -3
- package/dist/assets/finalize.js +0 -1
- package/dist/assets/index.d.ts +12 -13
- package/dist/assets/index.js +0 -1
- package/dist/assets/keys.d.ts +1 -2
- package/dist/assets/keys.js +0 -1
- package/dist/assets/pipeline.d.ts +1 -2
- package/dist/assets/pipeline.js +0 -1
- package/dist/assets/store-local.d.ts +1 -2
- package/dist/assets/store-local.js +0 -1
- package/dist/assets/store-s3.d.ts +2 -4
- package/dist/assets/store-s3.js +0 -1
- package/dist/assets/svg-sanitizer.d.ts +0 -1
- package/dist/assets/svg-sanitizer.js +0 -1
- package/dist/assets/transform-directives.d.ts +0 -1
- package/dist/assets/transform-directives.js +0 -1
- package/dist/assets/transform.d.ts +1 -2
- package/dist/assets/transform.js +0 -1
- package/dist/assets/types.d.ts +0 -1
- package/dist/assets/types.js +0 -1
- package/dist/auth/cache.d.ts +2 -3
- package/dist/auth/cache.js +0 -1
- package/dist/auth/caching-auth-plugin.d.ts +3 -4
- package/dist/auth/caching-auth-plugin.js +0 -1
- package/dist/auth/context-helpers.d.ts +1 -2
- package/dist/auth/context-helpers.js +0 -1
- package/dist/auth/file-based-auth-cache.d.ts +3 -4
- package/dist/auth/file-based-auth-cache.js +0 -1
- package/dist/auth/index.d.ts +6 -7
- package/dist/auth/index.js +0 -1
- package/dist/auth/plugin.d.ts +3 -4
- package/dist/auth/plugin.js +0 -1
- package/dist/auth/types.d.ts +1 -2
- package/dist/auth/types.js +0 -1
- package/dist/authorization/branch.d.ts +58 -7
- package/dist/authorization/branch.js +55 -10
- package/dist/authorization/content.d.ts +6 -7
- package/dist/authorization/content.js +0 -1
- package/dist/authorization/groups/index.d.ts +2 -3
- package/dist/authorization/groups/index.js +0 -1
- package/dist/authorization/groups/loader.d.ts +3 -4
- package/dist/authorization/groups/loader.js +0 -1
- package/dist/authorization/groups/schema.d.ts +1 -2
- package/dist/authorization/groups/schema.js +0 -1
- package/dist/authorization/helpers.d.ts +0 -1
- package/dist/authorization/helpers.js +0 -1
- package/dist/authorization/index.d.ts +11 -12
- package/dist/authorization/index.js +0 -1
- package/dist/authorization/path.d.ts +4 -5
- package/dist/authorization/path.js +0 -1
- package/dist/authorization/permissions/index.d.ts +2 -3
- package/dist/authorization/permissions/index.js +0 -1
- package/dist/authorization/permissions/loader.d.ts +4 -5
- package/dist/authorization/permissions/loader.js +0 -1
- package/dist/authorization/permissions/schema.d.ts +2 -3
- package/dist/authorization/permissions/schema.js +0 -1
- package/dist/authorization/protected-branch.d.ts +2 -3
- package/dist/authorization/protected-branch.js +0 -1
- package/dist/authorization/settings-file-store.d.ts +1 -2
- package/dist/authorization/settings-file-store.js +0 -1
- package/dist/authorization/types.d.ts +7 -8
- package/dist/authorization/types.js +0 -1
- package/dist/authorization/validation.d.ts +1 -2
- package/dist/authorization/validation.js +0 -1
- package/dist/branch-health.d.ts +2 -3
- package/dist/branch-health.js +0 -1
- package/dist/branch-metadata.d.ts +2 -3
- package/dist/branch-metadata.js +0 -1
- package/dist/branch-registry.d.ts +1 -2
- package/dist/branch-registry.js +0 -1
- package/dist/branch-schema-cache.d.ts +4 -5
- package/dist/branch-schema-cache.js +0 -1
- package/dist/branch-workspace.d.ts +4 -5
- package/dist/branch-workspace.js +0 -1
- package/dist/build/generate-ai-content.d.ts +21 -5
- package/dist/build/generate-ai-content.js +98 -6
- package/dist/build/index.d.ts +2 -3
- package/dist/build/index.js +0 -1
- package/dist/build-canopy.d.ts +48 -0
- package/dist/build-canopy.js +50 -0
- package/dist/build-mode.d.ts +1 -2
- package/dist/build-mode.js +0 -1
- package/dist/cli/cli.d.ts +1 -2
- package/dist/cli/cli.js +1192 -495
- package/dist/cli/generate-ai-content.d.ts +0 -1
- package/dist/cli/generate-ai-content.js +1062 -370
- package/dist/cli/init.d.ts +1 -2
- package/dist/cli/init.js +12 -2
- package/dist/cli/migrate.d.ts +5 -3
- package/dist/cli/migrate.js +5 -3
- package/dist/cli/project-detect.d.ts +5 -2
- package/dist/cli/project-detect.js +5 -1
- package/dist/cli/project-root.d.ts +0 -1
- package/dist/cli/project-root.js +0 -1
- package/dist/cli/sync.d.ts +0 -1
- package/dist/cli/sync.js +0 -1
- package/dist/cli/template-files/canopycms.config.ts.template +18 -1
- package/dist/cli/template-files/deploy-cms.yml.template +8 -6
- package/dist/cli/templates.d.ts +0 -1
- package/dist/cli/templates.js +0 -1
- package/dist/client.d.ts +13 -14
- package/dist/client.js +0 -1
- package/dist/comment-store.d.ts +0 -1
- package/dist/comment-store.js +0 -1
- package/dist/config/flatten.d.ts +1 -2
- package/dist/config/flatten.js +0 -1
- package/dist/config/helpers.d.ts +3 -4
- package/dist/config/helpers.js +2 -2
- package/dist/config/index.d.ts +10 -11
- package/dist/config/index.js +0 -1
- package/dist/config/schemas/collection.d.ts +0 -1
- package/dist/config/schemas/collection.js +0 -1
- package/dist/config/schemas/config.d.ts +7 -4
- package/dist/config/schemas/config.js +12 -1
- package/dist/config/schemas/field.d.ts +3 -1
- package/dist/config/schemas/field.js +5 -1
- package/dist/config/schemas/media.d.ts +0 -1
- package/dist/config/schemas/media.js +0 -1
- package/dist/config/schemas/permissions.d.ts +0 -1
- package/dist/config/schemas/permissions.js +0 -1
- package/dist/config/types.d.ts +55 -9
- package/dist/config/types.js +0 -1
- package/dist/config/validation.d.ts +1 -2
- package/dist/config/validation.js +0 -1
- package/dist/config.d.ts +2 -3
- package/dist/config.js +0 -1
- package/dist/content-id-index.d.ts +1 -2
- package/dist/content-id-index.js +0 -1
- package/dist/content-index-generation.d.ts +0 -1
- package/dist/content-index-generation.js +0 -1
- package/dist/content-index-registry.d.ts +0 -1
- package/dist/content-index-registry.js +0 -1
- package/dist/content-listing.d.ts +137 -16
- package/dist/content-listing.js +175 -41
- package/dist/content-reader.d.ts +44 -8
- package/dist/content-reader.js +39 -7
- package/dist/content-store.d.ts +147 -7
- package/dist/content-store.js +294 -22
- package/dist/content-tree.d.ts +44 -5
- package/dist/content-tree.js +47 -11
- package/dist/context.d.ts +38 -15
- package/dist/context.js +55 -5
- package/dist/dev-content-watcher.d.ts +2 -3
- package/dist/dev-content-watcher.js +0 -1
- package/dist/editor/BranchManager.d.ts +4 -5
- package/dist/editor/BranchManager.js +0 -1
- package/dist/editor/CanopyEditor.d.ts +2 -3
- package/dist/editor/CanopyEditor.js +1 -2
- package/dist/editor/CanopyEditorPage.d.ts +2 -3
- package/dist/editor/CanopyEditorPage.js +0 -1
- package/dist/editor/CommentsPanel.d.ts +2 -3
- package/dist/editor/CommentsPanel.js +0 -1
- package/dist/editor/Editor.d.ts +13 -8
- package/dist/editor/Editor.js +4 -5
- package/dist/editor/EditorPanes.d.ts +0 -1
- package/dist/editor/EditorPanes.js +0 -1
- package/dist/editor/EntryNavigator.d.ts +1 -2
- package/dist/editor/EntryNavigator.js +0 -1
- package/dist/editor/FormRenderer.d.ts +2 -3
- package/dist/editor/FormRenderer.js +22 -3
- package/dist/editor/GroupManager.d.ts +2 -3
- package/dist/editor/GroupManager.js +0 -1
- package/dist/editor/PermissionManager.d.ts +2 -3
- package/dist/editor/PermissionManager.js +0 -1
- package/dist/editor/admin/SystemHealthPanel.d.ts +0 -1
- package/dist/editor/admin/SystemHealthPanel.js +0 -1
- package/dist/editor/admin/useSystemHealth.d.ts +2 -3
- package/dist/editor/admin/useSystemHealth.js +0 -1
- package/dist/editor/canopy-path.d.ts +0 -1
- package/dist/editor/canopy-path.js +0 -1
- package/dist/editor/client-reference-resolver.d.ts +13 -4
- package/dist/editor/client-reference-resolver.js +18 -8
- package/dist/editor/comments/BranchComments.d.ts +2 -3
- package/dist/editor/comments/BranchComments.js +0 -1
- package/dist/editor/comments/EntryComments.d.ts +1 -2
- package/dist/editor/comments/EntryComments.js +0 -1
- package/dist/editor/comments/FieldWrapper.d.ts +1 -2
- package/dist/editor/comments/FieldWrapper.js +0 -1
- package/dist/editor/comments/InlineCommentThread.d.ts +2 -3
- package/dist/editor/comments/InlineCommentThread.js +0 -1
- package/dist/editor/comments/ThreadCarousel.d.ts +2 -3
- package/dist/editor/comments/ThreadCarousel.js +0 -1
- package/dist/editor/components/ConfirmDeleteModal.d.ts +0 -1
- package/dist/editor/components/ConfirmDeleteModal.js +0 -1
- package/dist/editor/components/EditorFooter.d.ts +0 -1
- package/dist/editor/components/EditorFooter.js +0 -1
- package/dist/editor/components/EditorHeader.d.ts +4 -5
- package/dist/editor/components/EditorHeader.js +0 -1
- package/dist/editor/components/EditorSidebar.d.ts +1 -2
- package/dist/editor/components/EditorSidebar.js +0 -1
- package/dist/editor/components/EntryCreateModal.d.ts +0 -1
- package/dist/editor/components/EntryCreateModal.js +21 -10
- package/dist/editor/components/RenameEntryModal.d.ts +0 -1
- package/dist/editor/components/RenameEntryModal.js +0 -1
- package/dist/editor/components/UserBadge.d.ts +2 -3
- package/dist/editor/components/UserBadge.js +0 -1
- package/dist/editor/components/index.d.ts +3 -4
- package/dist/editor/components/index.js +0 -1
- package/dist/editor/context/ApiClientContext.d.ts +9 -3
- package/dist/editor/context/ApiClientContext.js +8 -4
- package/dist/editor/context/AssetContext.d.ts +26 -2
- package/dist/editor/context/AssetContext.js +23 -3
- package/dist/editor/context/EditorStateContext.d.ts +1 -2
- package/dist/editor/context/EditorStateContext.js +0 -1
- package/dist/editor/context/SWRProvider.d.ts +0 -1
- package/dist/editor/context/SWRProvider.js +0 -1
- package/dist/editor/context/index.d.ts +4 -5
- package/dist/editor/context/index.js +0 -1
- package/dist/editor/editor-config.d.ts +2 -3
- package/dist/editor/editor-config.js +0 -1
- package/dist/editor/editor-utils.d.ts +22 -10
- package/dist/editor/editor-utils.js +41 -10
- package/dist/editor/fields/BlockField.d.ts +1 -2
- package/dist/editor/fields/BlockField.js +0 -1
- package/dist/editor/fields/CodeField.d.ts +0 -1
- package/dist/editor/fields/CodeField.js +0 -1
- package/dist/editor/fields/DateTimeField.d.ts +0 -1
- package/dist/editor/fields/DateTimeField.js +0 -1
- package/dist/editor/fields/ImageField.d.ts +1 -2
- package/dist/editor/fields/ImageField.js +0 -1
- package/dist/editor/fields/InlineGroupField.d.ts +2 -3
- package/dist/editor/fields/InlineGroupField.js +0 -1
- package/dist/editor/fields/MarkdownField.d.ts +0 -1
- package/dist/editor/fields/MarkdownField.js +0 -1
- package/dist/editor/fields/MdxImageDialog.d.ts +0 -1
- package/dist/editor/fields/MdxImageDialog.js +0 -1
- package/dist/editor/fields/NumberField.d.ts +0 -1
- package/dist/editor/fields/NumberField.js +0 -1
- package/dist/editor/fields/NumberListField.d.ts +0 -1
- package/dist/editor/fields/NumberListField.js +0 -1
- package/dist/editor/fields/ObjectField.d.ts +11 -2
- package/dist/editor/fields/ObjectField.js +3 -4
- package/dist/editor/fields/ReferenceField.d.ts +0 -1
- package/dist/editor/fields/ReferenceField.js +8 -3
- package/dist/editor/fields/SelectField.d.ts +0 -1
- package/dist/editor/fields/SelectField.js +0 -1
- package/dist/editor/fields/StringListField.d.ts +0 -1
- package/dist/editor/fields/StringListField.js +0 -1
- package/dist/editor/fields/TextField.d.ts +0 -1
- package/dist/editor/fields/TextField.js +0 -1
- package/dist/editor/fields/ToggleField.d.ts +0 -1
- package/dist/editor/fields/ToggleField.js +0 -1
- package/dist/editor/fields/entry-link/EntryLinkContext.d.ts +1 -2
- package/dist/editor/fields/entry-link/EntryLinkContext.js +0 -1
- package/dist/editor/fields/entry-link/InsertEntryLink.d.ts +0 -1
- package/dist/editor/fields/entry-link/InsertEntryLink.js +0 -1
- package/dist/editor/fields/entry-link/index.d.ts +2 -3
- package/dist/editor/fields/entry-link/index.js +0 -1
- package/dist/editor/group-manager/ExternalGroupsTab.d.ts +1 -2
- package/dist/editor/group-manager/ExternalGroupsTab.js +0 -1
- package/dist/editor/group-manager/GroupCard.d.ts +1 -2
- package/dist/editor/group-manager/GroupCard.js +0 -1
- package/dist/editor/group-manager/GroupForm.d.ts +1 -2
- package/dist/editor/group-manager/GroupForm.js +0 -1
- package/dist/editor/group-manager/InternalGroupsTab.d.ts +1 -2
- package/dist/editor/group-manager/InternalGroupsTab.js +0 -1
- package/dist/editor/group-manager/MemberList.d.ts +1 -2
- package/dist/editor/group-manager/MemberList.js +0 -1
- package/dist/editor/group-manager/hooks/useExternalGroupSearch.d.ts +1 -2
- package/dist/editor/group-manager/hooks/useExternalGroupSearch.js +0 -1
- package/dist/editor/group-manager/hooks/useGroupState.d.ts +1 -2
- package/dist/editor/group-manager/hooks/useGroupState.js +0 -1
- package/dist/editor/group-manager/hooks/useUserSearch.d.ts +1 -2
- package/dist/editor/group-manager/hooks/useUserSearch.js +0 -1
- package/dist/editor/group-manager/index.d.ts +5 -6
- package/dist/editor/group-manager/index.js +0 -1
- package/dist/editor/group-manager/types.d.ts +4 -5
- package/dist/editor/group-manager/types.js +0 -1
- package/dist/editor/hooks/index.d.ts +14 -15
- package/dist/editor/hooks/index.js +0 -1
- package/dist/editor/hooks/useBranchActions.d.ts +0 -1
- package/dist/editor/hooks/useBranchActions.js +0 -1
- package/dist/editor/hooks/useBranchManager.d.ts +4 -5
- package/dist/editor/hooks/useBranchManager.js +0 -1
- package/dist/editor/hooks/useBranchesData.d.ts +2 -3
- package/dist/editor/hooks/useBranchesData.js +0 -1
- package/dist/editor/hooks/useCommentSystem.d.ts +2 -3
- package/dist/editor/hooks/useCommentSystem.js +0 -1
- package/dist/editor/hooks/useCommentsData.d.ts +2 -3
- package/dist/editor/hooks/useCommentsData.js +0 -1
- package/dist/editor/hooks/useDraftManager.d.ts +3 -4
- package/dist/editor/hooks/useDraftManager.js +0 -1
- package/dist/editor/hooks/useEditorLayout.d.ts +1 -2
- package/dist/editor/hooks/useEditorLayout.js +0 -1
- package/dist/editor/hooks/useEntriesData.d.ts +3 -5
- package/dist/editor/hooks/useEntriesData.js +0 -3
- package/dist/editor/hooks/useEntryLinkResolution.d.ts +2 -3
- package/dist/editor/hooks/useEntryLinkResolution.js +0 -1
- package/dist/editor/hooks/useEntryManager.d.ts +5 -7
- package/dist/editor/hooks/useEntryManager.js +8 -3
- package/dist/editor/hooks/useGroupManager.d.ts +2 -3
- package/dist/editor/hooks/useGroupManager.js +0 -1
- package/dist/editor/hooks/usePermissionManager.d.ts +2 -3
- package/dist/editor/hooks/usePermissionManager.js +0 -1
- package/dist/editor/hooks/useReferenceResolution.d.ts +1 -2
- package/dist/editor/hooks/useReferenceResolution.js +8 -3
- package/dist/editor/hooks/useSchemaManager.d.ts +2 -3
- package/dist/editor/hooks/useSchemaManager.js +0 -1
- package/dist/editor/hooks/useUserContext.d.ts +1 -2
- package/dist/editor/hooks/useUserContext.js +8 -3
- package/dist/editor/hooks/useUserMetadata.d.ts +2 -3
- package/dist/editor/hooks/useUserMetadata.js +0 -1
- package/dist/editor/media/AssetCard.d.ts +1 -2
- package/dist/editor/media/AssetCard.js +0 -1
- package/dist/editor/media/CropStep.d.ts +1 -2
- package/dist/editor/media/CropStep.js +0 -1
- package/dist/editor/media/MediaLibrary.d.ts +1 -2
- package/dist/editor/media/MediaLibrary.js +0 -1
- package/dist/editor/media/MediaLibraryBody.d.ts +1 -2
- package/dist/editor/media/MediaLibraryBody.js +0 -1
- package/dist/editor/media/crop-math.d.ts +1 -2
- package/dist/editor/media/crop-math.js +0 -1
- package/dist/editor/media/upload-asset.d.ts +2 -3
- package/dist/editor/media/upload-asset.js +0 -1
- package/dist/editor/media/upload-constants.d.ts +0 -1
- package/dist/editor/media/upload-constants.js +0 -1
- package/dist/editor/media/useAssetUpload.d.ts +1 -2
- package/dist/editor/media/useAssetUpload.js +0 -1
- package/dist/editor/media/xhr-upload.d.ts +0 -1
- package/dist/editor/media/xhr-upload.js +0 -1
- package/dist/editor/permission-manager/GroupSelector.d.ts +1 -2
- package/dist/editor/permission-manager/GroupSelector.js +0 -1
- package/dist/editor/permission-manager/PermissionEditor.d.ts +1 -2
- package/dist/editor/permission-manager/PermissionEditor.js +0 -1
- package/dist/editor/permission-manager/PermissionLevelBadge.d.ts +1 -2
- package/dist/editor/permission-manager/PermissionLevelBadge.js +0 -1
- package/dist/editor/permission-manager/PermissionTree.d.ts +1 -2
- package/dist/editor/permission-manager/PermissionTree.js +0 -1
- package/dist/editor/permission-manager/UserSelector.d.ts +1 -2
- package/dist/editor/permission-manager/UserSelector.js +0 -1
- package/dist/editor/permission-manager/constants.d.ts +1 -2
- package/dist/editor/permission-manager/constants.js +0 -1
- package/dist/editor/permission-manager/hooks/useGroupsAndUsers.d.ts +1 -2
- package/dist/editor/permission-manager/hooks/useGroupsAndUsers.js +0 -1
- package/dist/editor/permission-manager/hooks/usePermissionTree.d.ts +2 -3
- package/dist/editor/permission-manager/hooks/usePermissionTree.js +0 -1
- package/dist/editor/permission-manager/index.d.ts +4 -5
- package/dist/editor/permission-manager/index.js +0 -1
- package/dist/editor/permission-manager/types.d.ts +3 -4
- package/dist/editor/permission-manager/types.js +0 -1
- package/dist/editor/permission-manager/utils.d.ts +2 -3
- package/dist/editor/permission-manager/utils.js +0 -1
- package/dist/editor/preview-bridge.d.ts +1 -2
- package/dist/editor/preview-bridge.js +0 -1
- package/dist/editor/relative-time.d.ts +0 -1
- package/dist/editor/relative-time.js +0 -1
- package/dist/editor/schema-editor/CollectionEditor.d.ts +4 -5
- package/dist/editor/schema-editor/CollectionEditor.js +0 -1
- package/dist/editor/schema-editor/EntryTypeEditor.d.ts +2 -3
- package/dist/editor/schema-editor/EntryTypeEditor.js +0 -1
- package/dist/editor/schema-editor/index.d.ts +2 -3
- package/dist/editor/schema-editor/index.js +0 -1
- package/dist/editor/theme.d.ts +0 -1
- package/dist/editor/theme.js +0 -1
- package/dist/editor/utils/env.d.ts +0 -1
- package/dist/editor/utils/env.js +0 -1
- package/dist/entry-link-resolver.d.ts +1 -2
- package/dist/entry-link-resolver.js +0 -1
- package/dist/entry-schema-registry.d.ts +3 -4
- package/dist/entry-schema-registry.js +6 -2
- package/dist/entry-schema.d.ts +342 -11
- package/dist/entry-schema.js +170 -1
- package/dist/git-manager.d.ts +1 -2
- package/dist/git-manager.js +0 -1
- package/dist/github-service.d.ts +1 -2
- package/dist/github-service.js +0 -1
- package/dist/http/handler.d.ts +6 -7
- package/dist/http/handler.js +0 -1
- package/dist/http/index.d.ts +6 -7
- package/dist/http/index.js +0 -1
- package/dist/http/router.d.ts +2 -3
- package/dist/http/router.js +0 -1
- package/dist/http/types.d.ts +0 -1
- package/dist/http/types.js +0 -1
- package/dist/id.d.ts +2 -3
- package/dist/id.js +0 -1
- package/dist/index.d.ts +17 -17
- package/dist/index.js +7 -1
- package/dist/operating-mode/client-safe-strategy.d.ts +1 -2
- package/dist/operating-mode/client-safe-strategy.js +0 -1
- package/dist/operating-mode/client-unsafe-strategy.d.ts +1 -2
- package/dist/operating-mode/client-unsafe-strategy.js +0 -1
- package/dist/operating-mode/client.d.ts +3 -4
- package/dist/operating-mode/client.js +0 -1
- package/dist/operating-mode/deployment-name-fixtures.d.ts +0 -1
- package/dist/operating-mode/deployment-name-fixtures.js +0 -1
- package/dist/operating-mode/deployment-name.d.ts +0 -1
- package/dist/operating-mode/deployment-name.js +0 -1
- package/dist/operating-mode/index.d.ts +5 -6
- package/dist/operating-mode/index.js +0 -1
- package/dist/operating-mode/mode-env.d.ts +1 -2
- package/dist/operating-mode/mode-env.js +0 -1
- package/dist/operating-mode/types.d.ts +2 -3
- package/dist/operating-mode/types.js +0 -1
- package/dist/paths/branch-name.d.ts +1 -2
- package/dist/paths/branch-name.js +0 -1
- package/dist/paths/branch.d.ts +3 -4
- package/dist/paths/branch.js +0 -1
- package/dist/paths/index.d.ts +8 -9
- package/dist/paths/index.js +0 -1
- package/dist/paths/normalize-server.d.ts +1 -2
- package/dist/paths/normalize-server.js +0 -1
- package/dist/paths/normalize.d.ts +1 -2
- package/dist/paths/normalize.js +0 -1
- package/dist/paths/resolve.d.ts +2 -3
- package/dist/paths/resolve.js +0 -1
- package/dist/paths/types.d.ts +0 -1
- package/dist/paths/types.js +0 -1
- package/dist/paths/validation.d.ts +1 -2
- package/dist/paths/validation.js +0 -1
- package/dist/reference-resolver.d.ts +3 -4
- package/dist/reference-resolver.js +0 -1
- package/dist/resolve-canopy-user.d.ts +3 -4
- package/dist/resolve-canopy-user.js +0 -1
- package/dist/resource-generation.d.ts +0 -1
- package/dist/resource-generation.js +0 -1
- package/dist/schema/index.d.ts +3 -4
- package/dist/schema/index.js +0 -1
- package/dist/schema/meta-loader.d.ts +3 -4
- package/dist/schema/meta-loader.js +3 -3
- package/dist/schema/resolver.d.ts +2 -3
- package/dist/schema/resolver.js +0 -1
- package/dist/schema/schema-store-types.d.ts +2 -3
- package/dist/schema/schema-store-types.js +0 -1
- package/dist/schema/schema-store.d.ts +6 -7
- package/dist/schema/schema-store.js +33 -1
- package/dist/schema/types.d.ts +1 -2
- package/dist/schema/types.js +0 -1
- package/dist/server.d.ts +97 -37
- package/dist/server.js +60 -3
- package/dist/services.d.ts +10 -12
- package/dist/services.js +2 -7
- package/dist/settings-workspace.d.ts +12 -15
- package/dist/settings-workspace.js +10 -13
- package/dist/static/index.d.ts +227 -9
- package/dist/static/index.js +302 -14
- package/dist/static/seo.d.ts +128 -0
- package/dist/static/seo.js +162 -0
- package/dist/sync-core.d.ts +0 -1
- package/dist/sync-core.js +0 -1
- package/dist/task-queue/index.d.ts +2 -3
- package/dist/task-queue/index.js +0 -1
- package/dist/task-queue/task-queue.d.ts +1 -2
- package/dist/task-queue/task-queue.js +0 -1
- package/dist/task-queue/types.d.ts +0 -1
- package/dist/task-queue/types.js +0 -1
- package/dist/types.d.ts +3 -4
- package/dist/types.js +0 -1
- package/dist/url-collision.d.ts +86 -0
- package/dist/url-collision.js +186 -0
- package/dist/url-path-resolver.d.ts +11 -2
- package/dist/url-path-resolver.js +37 -5
- package/dist/user.d.ts +3 -4
- package/dist/user.js +0 -1
- package/dist/utils/async-mutex.d.ts +0 -1
- package/dist/utils/async-mutex.js +0 -1
- package/dist/utils/atomic-write.d.ts +0 -1
- package/dist/utils/atomic-write.js +0 -1
- package/dist/utils/body-field.d.ts +12 -2
- package/dist/utils/body-field.js +17 -1
- package/dist/utils/content-serialize.d.ts +37 -0
- package/dist/utils/content-serialize.js +429 -0
- package/dist/utils/content-write-lock.d.ts +12 -16
- package/dist/utils/content-write-lock.js +38 -22
- package/dist/utils/debug.d.ts +0 -1
- package/dist/utils/debug.js +0 -1
- package/dist/utils/entry-url.d.ts +17 -1
- package/dist/utils/entry-url.js +21 -3
- package/dist/utils/error.d.ts +0 -1
- package/dist/utils/error.js +0 -1
- package/dist/utils/flatten-group-fields.d.ts +1 -2
- package/dist/utils/flatten-group-fields.js +0 -1
- package/dist/utils/format.d.ts +1 -2
- package/dist/utils/format.js +0 -1
- package/dist/utils/fs.d.ts +7 -1
- package/dist/utils/fs.js +16 -1
- package/dist/utils/git.d.ts +1 -2
- package/dist/utils/git.js +0 -1
- package/dist/utils/logger.d.ts +0 -1
- package/dist/utils/logger.js +0 -1
- package/dist/utils/occ-json-write.d.ts +0 -1
- package/dist/utils/occ-json-write.js +0 -1
- package/dist/utils/provisioning-lock.d.ts +17 -4
- package/dist/utils/provisioning-lock.js +94 -14
- package/dist/utils/sanitize-href.d.ts +46 -1
- package/dist/utils/sanitize-href.js +63 -3
- package/dist/utils/title-field.d.ts +1 -2
- package/dist/utils/title-field.js +0 -1
- package/dist/utils/typed-filename.d.ts +61 -0
- package/dist/utils/typed-filename.js +92 -0
- package/dist/utils/url-prefix.d.ts +121 -0
- package/dist/utils/url-prefix.js +158 -0
- package/dist/validation/block-structural-keys.d.ts +42 -0
- package/dist/validation/block-structural-keys.js +44 -0
- package/dist/validation/deletion-checker.d.ts +4 -5
- package/dist/validation/deletion-checker.js +0 -1
- package/dist/validation/entry-link-validator.d.ts +2 -3
- package/dist/validation/entry-link-validator.js +0 -1
- package/dist/validation/entry-type-reference-validator.d.ts +1 -2
- package/dist/validation/entry-type-reference-validator.js +0 -1
- package/dist/validation/entry-validator.d.ts +23 -2
- package/dist/validation/entry-validator.js +34 -2
- package/dist/validation/field-traversal.d.ts +28 -4
- package/dist/validation/field-traversal.js +24 -7
- package/dist/validation/reference-validator.d.ts +2 -3
- package/dist/validation/reference-validator.js +0 -1
- package/dist/worker/cms-worker.d.ts +9 -2
- package/dist/worker/cms-worker.js +59 -2
- package/dist/worker/log.d.ts +0 -1
- package/dist/worker/log.js +0 -1
- package/dist/worker/task-queue-config.d.ts +1 -2
- package/dist/worker/task-queue-config.js +0 -1
- package/dist/worker/task-queue.d.ts +3 -4
- package/dist/worker/task-queue.js +0 -1
- package/dist/worker/worker-status.d.ts +1 -2
- package/dist/worker/worker-status.js +0 -1
- package/package.json +2 -6
- package/dist/ai/generate.d.ts.map +0 -1
- package/dist/ai/generate.js.map +0 -1
- package/dist/ai/handler.d.ts.map +0 -1
- package/dist/ai/handler.js.map +0 -1
- package/dist/ai/index.d.ts.map +0 -1
- package/dist/ai/index.js.map +0 -1
- package/dist/ai/json-to-markdown.d.ts.map +0 -1
- package/dist/ai/json-to-markdown.js.map +0 -1
- package/dist/ai/resolve-branch.d.ts.map +0 -1
- package/dist/ai/resolve-branch.js.map +0 -1
- package/dist/ai/strip-mdx.d.ts.map +0 -1
- package/dist/ai/strip-mdx.js.map +0 -1
- package/dist/ai/transform-components.d.ts.map +0 -1
- package/dist/ai/transform-components.js.map +0 -1
- package/dist/ai/types.d.ts.map +0 -1
- package/dist/ai/types.js.map +0 -1
- package/dist/api/__test__/mock-client.d.ts +0 -231
- package/dist/api/__test__/mock-client.d.ts.map +0 -1
- package/dist/api/__test__/mock-client.js +0 -388
- package/dist/api/__test__/mock-client.js.map +0 -1
- package/dist/api/admin-branch-health.d.ts.map +0 -1
- package/dist/api/admin-branch-health.js.map +0 -1
- package/dist/api/admin.d.ts.map +0 -1
- package/dist/api/admin.js.map +0 -1
- package/dist/api/assets.d.ts.map +0 -1
- package/dist/api/assets.js.map +0 -1
- package/dist/api/branch-merge.d.ts.map +0 -1
- package/dist/api/branch-merge.js.map +0 -1
- package/dist/api/branch-review.d.ts.map +0 -1
- package/dist/api/branch-review.js.map +0 -1
- package/dist/api/branch-status.d.ts.map +0 -1
- package/dist/api/branch-status.js.map +0 -1
- package/dist/api/branch-withdraw.d.ts.map +0 -1
- package/dist/api/branch-withdraw.js.map +0 -1
- package/dist/api/branch.d.ts.map +0 -1
- package/dist/api/branch.js.map +0 -1
- package/dist/api/client.d.ts.map +0 -1
- package/dist/api/client.js.map +0 -1
- package/dist/api/comments.d.ts.map +0 -1
- package/dist/api/comments.js.map +0 -1
- package/dist/api/content.d.ts.map +0 -1
- package/dist/api/content.js.map +0 -1
- package/dist/api/entries-constants.d.ts.map +0 -1
- package/dist/api/entries-constants.js.map +0 -1
- package/dist/api/entries.d.ts.map +0 -1
- package/dist/api/entries.js.map +0 -1
- package/dist/api/github-sync.d.ts.map +0 -1
- package/dist/api/github-sync.js.map +0 -1
- package/dist/api/groups.d.ts.map +0 -1
- package/dist/api/groups.js.map +0 -1
- package/dist/api/guards.d.ts.map +0 -1
- package/dist/api/guards.js.map +0 -1
- package/dist/api/index.d.ts.map +0 -1
- package/dist/api/index.js.map +0 -1
- package/dist/api/permissions.d.ts.map +0 -1
- package/dist/api/permissions.js.map +0 -1
- package/dist/api/reference-options.d.ts.map +0 -1
- package/dist/api/reference-options.js.map +0 -1
- package/dist/api/request-body-hash.d.ts.map +0 -1
- package/dist/api/request-body-hash.js.map +0 -1
- package/dist/api/resolve-references.d.ts.map +0 -1
- package/dist/api/resolve-references.js.map +0 -1
- package/dist/api/route-builder.d.ts.map +0 -1
- package/dist/api/route-builder.js.map +0 -1
- package/dist/api/schema.d.ts.map +0 -1
- package/dist/api/schema.js.map +0 -1
- package/dist/api/settings-helpers.d.ts.map +0 -1
- package/dist/api/settings-helpers.js.map +0 -1
- package/dist/api/types.d.ts.map +0 -1
- package/dist/api/types.js.map +0 -1
- package/dist/api/user.d.ts.map +0 -1
- package/dist/api/user.js.map +0 -1
- package/dist/api/validators.d.ts.map +0 -1
- package/dist/api/validators.js.map +0 -1
- package/dist/assets/asset-prefixes.d.ts.map +0 -1
- package/dist/assets/asset-prefixes.js.map +0 -1
- package/dist/assets/asset-src.d.ts.map +0 -1
- package/dist/assets/asset-src.js.map +0 -1
- package/dist/assets/asset-url.d.ts.map +0 -1
- package/dist/assets/asset-url.js.map +0 -1
- package/dist/assets/factory.d.ts.map +0 -1
- package/dist/assets/factory.js.map +0 -1
- package/dist/assets/finalize.d.ts.map +0 -1
- package/dist/assets/finalize.js.map +0 -1
- package/dist/assets/index.d.ts.map +0 -1
- package/dist/assets/index.js.map +0 -1
- package/dist/assets/keys.d.ts.map +0 -1
- package/dist/assets/keys.js.map +0 -1
- package/dist/assets/pipeline.d.ts.map +0 -1
- package/dist/assets/pipeline.js.map +0 -1
- package/dist/assets/store-local.d.ts.map +0 -1
- package/dist/assets/store-local.js.map +0 -1
- package/dist/assets/store-s3.d.ts.map +0 -1
- package/dist/assets/store-s3.js.map +0 -1
- package/dist/assets/svg-sanitizer.d.ts.map +0 -1
- package/dist/assets/svg-sanitizer.js.map +0 -1
- package/dist/assets/transform-directives.d.ts.map +0 -1
- package/dist/assets/transform-directives.js.map +0 -1
- package/dist/assets/transform.d.ts.map +0 -1
- package/dist/assets/transform.js.map +0 -1
- package/dist/assets/types.d.ts.map +0 -1
- package/dist/assets/types.js.map +0 -1
- package/dist/auth/cache.d.ts.map +0 -1
- package/dist/auth/cache.js.map +0 -1
- package/dist/auth/caching-auth-plugin.d.ts.map +0 -1
- package/dist/auth/caching-auth-plugin.js.map +0 -1
- package/dist/auth/context-helpers.d.ts.map +0 -1
- package/dist/auth/context-helpers.js.map +0 -1
- package/dist/auth/file-based-auth-cache.d.ts.map +0 -1
- package/dist/auth/file-based-auth-cache.js.map +0 -1
- package/dist/auth/index.d.ts.map +0 -1
- package/dist/auth/index.js.map +0 -1
- package/dist/auth/plugin.d.ts.map +0 -1
- package/dist/auth/plugin.js.map +0 -1
- package/dist/auth/types.d.ts.map +0 -1
- package/dist/auth/types.js.map +0 -1
- package/dist/authorization/branch.d.ts.map +0 -1
- package/dist/authorization/branch.js.map +0 -1
- package/dist/authorization/content.d.ts.map +0 -1
- package/dist/authorization/content.js.map +0 -1
- package/dist/authorization/groups/index.d.ts.map +0 -1
- package/dist/authorization/groups/index.js.map +0 -1
- package/dist/authorization/groups/loader.d.ts.map +0 -1
- package/dist/authorization/groups/loader.js.map +0 -1
- package/dist/authorization/groups/schema.d.ts.map +0 -1
- package/dist/authorization/groups/schema.js.map +0 -1
- package/dist/authorization/helpers.d.ts.map +0 -1
- package/dist/authorization/helpers.js.map +0 -1
- package/dist/authorization/index.d.ts.map +0 -1
- package/dist/authorization/index.js.map +0 -1
- package/dist/authorization/path.d.ts.map +0 -1
- package/dist/authorization/path.js.map +0 -1
- package/dist/authorization/permissions/index.d.ts.map +0 -1
- package/dist/authorization/permissions/index.js.map +0 -1
- package/dist/authorization/permissions/loader.d.ts.map +0 -1
- package/dist/authorization/permissions/loader.js.map +0 -1
- package/dist/authorization/permissions/schema.d.ts.map +0 -1
- package/dist/authorization/permissions/schema.js.map +0 -1
- package/dist/authorization/protected-branch.d.ts.map +0 -1
- package/dist/authorization/protected-branch.js.map +0 -1
- package/dist/authorization/settings-file-store.d.ts.map +0 -1
- package/dist/authorization/settings-file-store.js.map +0 -1
- package/dist/authorization/test-utils.d.ts +0 -26
- package/dist/authorization/test-utils.d.ts.map +0 -1
- package/dist/authorization/test-utils.js +0 -23
- package/dist/authorization/test-utils.js.map +0 -1
- package/dist/authorization/types.d.ts.map +0 -1
- package/dist/authorization/types.js.map +0 -1
- package/dist/authorization/validation.d.ts.map +0 -1
- package/dist/authorization/validation.js.map +0 -1
- package/dist/branch-health.d.ts.map +0 -1
- package/dist/branch-health.js.map +0 -1
- package/dist/branch-metadata.d.ts.map +0 -1
- package/dist/branch-metadata.js.map +0 -1
- package/dist/branch-registry.d.ts.map +0 -1
- package/dist/branch-registry.js.map +0 -1
- package/dist/branch-schema-cache.d.ts.map +0 -1
- package/dist/branch-schema-cache.js.map +0 -1
- package/dist/branch-workspace.d.ts.map +0 -1
- package/dist/branch-workspace.js.map +0 -1
- package/dist/build/generate-ai-content.d.ts.map +0 -1
- package/dist/build/generate-ai-content.js.map +0 -1
- package/dist/build/index.d.ts.map +0 -1
- package/dist/build/index.js.map +0 -1
- package/dist/build-mode.d.ts.map +0 -1
- package/dist/build-mode.js.map +0 -1
- package/dist/cli/cli.d.ts.map +0 -1
- package/dist/cli/cli.js.map +0 -1
- package/dist/cli/generate-ai-content.d.ts.map +0 -1
- package/dist/cli/generate-ai-content.js.map +0 -1
- package/dist/cli/init.d.ts.map +0 -1
- package/dist/cli/init.js.map +0 -1
- package/dist/cli/migrate.d.ts.map +0 -1
- package/dist/cli/migrate.js.map +0 -1
- package/dist/cli/project-detect.d.ts.map +0 -1
- package/dist/cli/project-detect.js.map +0 -1
- package/dist/cli/project-root.d.ts.map +0 -1
- package/dist/cli/project-root.js.map +0 -1
- package/dist/cli/sync.d.ts.map +0 -1
- package/dist/cli/sync.js.map +0 -1
- package/dist/cli/templates.d.ts.map +0 -1
- package/dist/cli/templates.js.map +0 -1
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js.map +0 -1
- package/dist/comment-store.d.ts.map +0 -1
- package/dist/comment-store.js.map +0 -1
- package/dist/config/flatten.d.ts.map +0 -1
- package/dist/config/flatten.js.map +0 -1
- package/dist/config/helpers.d.ts.map +0 -1
- package/dist/config/helpers.js.map +0 -1
- package/dist/config/index.d.ts.map +0 -1
- package/dist/config/index.js.map +0 -1
- package/dist/config/schemas/collection.d.ts.map +0 -1
- package/dist/config/schemas/collection.js.map +0 -1
- package/dist/config/schemas/config.d.ts.map +0 -1
- package/dist/config/schemas/config.js.map +0 -1
- package/dist/config/schemas/field.d.ts.map +0 -1
- package/dist/config/schemas/field.js.map +0 -1
- package/dist/config/schemas/media.d.ts.map +0 -1
- package/dist/config/schemas/media.js.map +0 -1
- package/dist/config/schemas/permissions.d.ts.map +0 -1
- package/dist/config/schemas/permissions.js.map +0 -1
- package/dist/config/types.d.ts.map +0 -1
- package/dist/config/types.js.map +0 -1
- package/dist/config/validation.d.ts.map +0 -1
- package/dist/config/validation.js.map +0 -1
- package/dist/config-test.d.ts +0 -20
- package/dist/config-test.d.ts.map +0 -1
- package/dist/config-test.js +0 -49
- package/dist/config-test.js.map +0 -1
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js.map +0 -1
- package/dist/content-id-index.d.ts.map +0 -1
- package/dist/content-id-index.js.map +0 -1
- package/dist/content-index-generation.d.ts.map +0 -1
- package/dist/content-index-generation.js.map +0 -1
- package/dist/content-index-registry.d.ts.map +0 -1
- package/dist/content-index-registry.js.map +0 -1
- package/dist/content-listing.d.ts.map +0 -1
- package/dist/content-listing.js.map +0 -1
- package/dist/content-reader.d.ts.map +0 -1
- package/dist/content-reader.js.map +0 -1
- package/dist/content-store.d.ts.map +0 -1
- package/dist/content-store.js.map +0 -1
- package/dist/content-tree.d.ts.map +0 -1
- package/dist/content-tree.js.map +0 -1
- package/dist/context.d.ts.map +0 -1
- package/dist/context.js.map +0 -1
- package/dist/dev-content-watcher.d.ts.map +0 -1
- package/dist/dev-content-watcher.js.map +0 -1
- package/dist/editor/BranchManager.d.ts.map +0 -1
- package/dist/editor/BranchManager.js.map +0 -1
- package/dist/editor/CanopyEditor.d.ts.map +0 -1
- package/dist/editor/CanopyEditor.js.map +0 -1
- package/dist/editor/CanopyEditorPage.d.ts.map +0 -1
- package/dist/editor/CanopyEditorPage.js.map +0 -1
- package/dist/editor/CommentsPanel.d.ts.map +0 -1
- package/dist/editor/CommentsPanel.js.map +0 -1
- package/dist/editor/Editor.d.ts.map +0 -1
- package/dist/editor/Editor.js.map +0 -1
- package/dist/editor/EditorPanes.d.ts.map +0 -1
- package/dist/editor/EditorPanes.js.map +0 -1
- package/dist/editor/EntryNavigator.d.ts.map +0 -1
- package/dist/editor/EntryNavigator.js.map +0 -1
- package/dist/editor/FormRenderer.d.ts.map +0 -1
- package/dist/editor/FormRenderer.js.map +0 -1
- package/dist/editor/GroupManager.d.ts.map +0 -1
- package/dist/editor/GroupManager.js.map +0 -1
- package/dist/editor/PermissionManager.d.ts.map +0 -1
- package/dist/editor/PermissionManager.js.map +0 -1
- package/dist/editor/admin/SystemHealthPanel.d.ts.map +0 -1
- package/dist/editor/admin/SystemHealthPanel.js.map +0 -1
- package/dist/editor/admin/useSystemHealth.d.ts.map +0 -1
- package/dist/editor/admin/useSystemHealth.js.map +0 -1
- package/dist/editor/canopy-path.d.ts.map +0 -1
- package/dist/editor/canopy-path.js.map +0 -1
- package/dist/editor/client-reference-resolver.d.ts.map +0 -1
- package/dist/editor/client-reference-resolver.js.map +0 -1
- package/dist/editor/comments/BranchComments.d.ts.map +0 -1
- package/dist/editor/comments/BranchComments.js.map +0 -1
- package/dist/editor/comments/EntryComments.d.ts.map +0 -1
- package/dist/editor/comments/EntryComments.js.map +0 -1
- package/dist/editor/comments/FieldWrapper.d.ts.map +0 -1
- package/dist/editor/comments/FieldWrapper.js.map +0 -1
- package/dist/editor/comments/InlineCommentThread.d.ts.map +0 -1
- package/dist/editor/comments/InlineCommentThread.js.map +0 -1
- package/dist/editor/comments/ThreadCarousel.d.ts.map +0 -1
- package/dist/editor/comments/ThreadCarousel.js.map +0 -1
- package/dist/editor/components/ConfirmDeleteModal.d.ts.map +0 -1
- package/dist/editor/components/ConfirmDeleteModal.js.map +0 -1
- package/dist/editor/components/EditorFooter.d.ts.map +0 -1
- package/dist/editor/components/EditorFooter.js.map +0 -1
- package/dist/editor/components/EditorHeader.d.ts.map +0 -1
- package/dist/editor/components/EditorHeader.js.map +0 -1
- package/dist/editor/components/EditorSidebar.d.ts.map +0 -1
- package/dist/editor/components/EditorSidebar.js.map +0 -1
- package/dist/editor/components/EntryCreateModal.d.ts.map +0 -1
- package/dist/editor/components/EntryCreateModal.js.map +0 -1
- package/dist/editor/components/RenameEntryModal.d.ts.map +0 -1
- package/dist/editor/components/RenameEntryModal.js.map +0 -1
- package/dist/editor/components/UserBadge.d.ts.map +0 -1
- package/dist/editor/components/UserBadge.js.map +0 -1
- package/dist/editor/components/index.d.ts.map +0 -1
- package/dist/editor/components/index.js.map +0 -1
- package/dist/editor/context/ApiClientContext.d.ts.map +0 -1
- package/dist/editor/context/ApiClientContext.js.map +0 -1
- package/dist/editor/context/AssetContext.d.ts.map +0 -1
- package/dist/editor/context/AssetContext.js.map +0 -1
- package/dist/editor/context/EditorStateContext.d.ts.map +0 -1
- package/dist/editor/context/EditorStateContext.js.map +0 -1
- package/dist/editor/context/SWRProvider.d.ts.map +0 -1
- package/dist/editor/context/SWRProvider.js.map +0 -1
- package/dist/editor/context/index.d.ts.map +0 -1
- package/dist/editor/context/index.js.map +0 -1
- package/dist/editor/editor-config.d.ts.map +0 -1
- package/dist/editor/editor-config.js.map +0 -1
- package/dist/editor/editor-utils.d.ts.map +0 -1
- package/dist/editor/editor-utils.js.map +0 -1
- package/dist/editor/fields/BlockField.d.ts.map +0 -1
- package/dist/editor/fields/BlockField.js.map +0 -1
- package/dist/editor/fields/CodeField.d.ts.map +0 -1
- package/dist/editor/fields/CodeField.js.map +0 -1
- package/dist/editor/fields/DateTimeField.d.ts.map +0 -1
- package/dist/editor/fields/DateTimeField.js.map +0 -1
- package/dist/editor/fields/ImageField.d.ts.map +0 -1
- package/dist/editor/fields/ImageField.js.map +0 -1
- package/dist/editor/fields/InlineGroupField.d.ts.map +0 -1
- package/dist/editor/fields/InlineGroupField.js.map +0 -1
- package/dist/editor/fields/MarkdownField.d.ts.map +0 -1
- package/dist/editor/fields/MarkdownField.js.map +0 -1
- package/dist/editor/fields/MdxImageDialog.d.ts.map +0 -1
- package/dist/editor/fields/MdxImageDialog.js.map +0 -1
- package/dist/editor/fields/NumberField.d.ts.map +0 -1
- package/dist/editor/fields/NumberField.js.map +0 -1
- package/dist/editor/fields/NumberListField.d.ts.map +0 -1
- package/dist/editor/fields/NumberListField.js.map +0 -1
- package/dist/editor/fields/ObjectField.d.ts.map +0 -1
- package/dist/editor/fields/ObjectField.js.map +0 -1
- package/dist/editor/fields/ReferenceField.d.ts.map +0 -1
- package/dist/editor/fields/ReferenceField.js.map +0 -1
- package/dist/editor/fields/SelectField.d.ts.map +0 -1
- package/dist/editor/fields/SelectField.js.map +0 -1
- package/dist/editor/fields/StringListField.d.ts.map +0 -1
- package/dist/editor/fields/StringListField.js.map +0 -1
- package/dist/editor/fields/TextField.d.ts.map +0 -1
- package/dist/editor/fields/TextField.js.map +0 -1
- package/dist/editor/fields/ToggleField.d.ts.map +0 -1
- package/dist/editor/fields/ToggleField.js.map +0 -1
- package/dist/editor/fields/entry-link/EntryLinkContext.d.ts.map +0 -1
- package/dist/editor/fields/entry-link/EntryLinkContext.js.map +0 -1
- package/dist/editor/fields/entry-link/InsertEntryLink.d.ts.map +0 -1
- package/dist/editor/fields/entry-link/InsertEntryLink.js.map +0 -1
- package/dist/editor/fields/entry-link/index.d.ts.map +0 -1
- package/dist/editor/fields/entry-link/index.js.map +0 -1
- package/dist/editor/group-manager/ExternalGroupsTab.d.ts.map +0 -1
- package/dist/editor/group-manager/ExternalGroupsTab.js.map +0 -1
- package/dist/editor/group-manager/GroupCard.d.ts.map +0 -1
- package/dist/editor/group-manager/GroupCard.js.map +0 -1
- package/dist/editor/group-manager/GroupForm.d.ts.map +0 -1
- package/dist/editor/group-manager/GroupForm.js.map +0 -1
- package/dist/editor/group-manager/InternalGroupsTab.d.ts.map +0 -1
- package/dist/editor/group-manager/InternalGroupsTab.js.map +0 -1
- package/dist/editor/group-manager/MemberList.d.ts.map +0 -1
- package/dist/editor/group-manager/MemberList.js.map +0 -1
- package/dist/editor/group-manager/hooks/useExternalGroupSearch.d.ts.map +0 -1
- package/dist/editor/group-manager/hooks/useExternalGroupSearch.js.map +0 -1
- package/dist/editor/group-manager/hooks/useGroupState.d.ts.map +0 -1
- package/dist/editor/group-manager/hooks/useGroupState.js.map +0 -1
- package/dist/editor/group-manager/hooks/useUserSearch.d.ts.map +0 -1
- package/dist/editor/group-manager/hooks/useUserSearch.js.map +0 -1
- package/dist/editor/group-manager/index.d.ts.map +0 -1
- package/dist/editor/group-manager/index.js.map +0 -1
- package/dist/editor/group-manager/types.d.ts.map +0 -1
- package/dist/editor/group-manager/types.js.map +0 -1
- package/dist/editor/hooks/__test__/test-utils.d.ts +0 -164
- package/dist/editor/hooks/__test__/test-utils.d.ts.map +0 -1
- package/dist/editor/hooks/__test__/test-utils.js +0 -203
- package/dist/editor/hooks/__test__/test-utils.js.map +0 -1
- package/dist/editor/hooks/index.d.ts.map +0 -1
- package/dist/editor/hooks/index.js.map +0 -1
- package/dist/editor/hooks/useBranchActions.d.ts.map +0 -1
- package/dist/editor/hooks/useBranchActions.js.map +0 -1
- package/dist/editor/hooks/useBranchManager.d.ts.map +0 -1
- package/dist/editor/hooks/useBranchManager.js.map +0 -1
- package/dist/editor/hooks/useBranchesData.d.ts.map +0 -1
- package/dist/editor/hooks/useBranchesData.js.map +0 -1
- package/dist/editor/hooks/useCommentSystem.d.ts.map +0 -1
- package/dist/editor/hooks/useCommentSystem.js.map +0 -1
- package/dist/editor/hooks/useCommentsData.d.ts.map +0 -1
- package/dist/editor/hooks/useCommentsData.js.map +0 -1
- package/dist/editor/hooks/useDraftManager.d.ts.map +0 -1
- package/dist/editor/hooks/useDraftManager.js.map +0 -1
- package/dist/editor/hooks/useEditorLayout.d.ts.map +0 -1
- package/dist/editor/hooks/useEditorLayout.js.map +0 -1
- package/dist/editor/hooks/useEntriesData.d.ts.map +0 -1
- package/dist/editor/hooks/useEntriesData.js.map +0 -1
- package/dist/editor/hooks/useEntryLinkResolution.d.ts.map +0 -1
- package/dist/editor/hooks/useEntryLinkResolution.js.map +0 -1
- package/dist/editor/hooks/useEntryManager.d.ts.map +0 -1
- package/dist/editor/hooks/useEntryManager.js.map +0 -1
- package/dist/editor/hooks/useGroupManager.d.ts.map +0 -1
- package/dist/editor/hooks/useGroupManager.js.map +0 -1
- package/dist/editor/hooks/usePermissionManager.d.ts.map +0 -1
- package/dist/editor/hooks/usePermissionManager.js.map +0 -1
- package/dist/editor/hooks/useReferenceResolution.d.ts.map +0 -1
- package/dist/editor/hooks/useReferenceResolution.js.map +0 -1
- package/dist/editor/hooks/useSchemaManager.d.ts.map +0 -1
- package/dist/editor/hooks/useSchemaManager.js.map +0 -1
- package/dist/editor/hooks/useUserContext.d.ts.map +0 -1
- package/dist/editor/hooks/useUserContext.js.map +0 -1
- package/dist/editor/hooks/useUserMetadata.d.ts.map +0 -1
- package/dist/editor/hooks/useUserMetadata.js.map +0 -1
- package/dist/editor/media/AssetCard.d.ts.map +0 -1
- package/dist/editor/media/AssetCard.js.map +0 -1
- package/dist/editor/media/CropStep.d.ts.map +0 -1
- package/dist/editor/media/CropStep.js.map +0 -1
- package/dist/editor/media/MediaLibrary.d.ts.map +0 -1
- package/dist/editor/media/MediaLibrary.js.map +0 -1
- package/dist/editor/media/MediaLibraryBody.d.ts.map +0 -1
- package/dist/editor/media/MediaLibraryBody.js.map +0 -1
- package/dist/editor/media/crop-math.d.ts.map +0 -1
- package/dist/editor/media/crop-math.js.map +0 -1
- package/dist/editor/media/upload-asset.d.ts.map +0 -1
- package/dist/editor/media/upload-asset.js.map +0 -1
- package/dist/editor/media/upload-constants.d.ts.map +0 -1
- package/dist/editor/media/upload-constants.js.map +0 -1
- package/dist/editor/media/useAssetUpload.d.ts.map +0 -1
- package/dist/editor/media/useAssetUpload.js.map +0 -1
- package/dist/editor/media/xhr-upload.d.ts.map +0 -1
- package/dist/editor/media/xhr-upload.js.map +0 -1
- package/dist/editor/permission-manager/GroupSelector.d.ts.map +0 -1
- package/dist/editor/permission-manager/GroupSelector.js.map +0 -1
- package/dist/editor/permission-manager/PermissionEditor.d.ts.map +0 -1
- package/dist/editor/permission-manager/PermissionEditor.js.map +0 -1
- package/dist/editor/permission-manager/PermissionLevelBadge.d.ts.map +0 -1
- package/dist/editor/permission-manager/PermissionLevelBadge.js.map +0 -1
- package/dist/editor/permission-manager/PermissionTree.d.ts.map +0 -1
- package/dist/editor/permission-manager/PermissionTree.js.map +0 -1
- package/dist/editor/permission-manager/UserSelector.d.ts.map +0 -1
- package/dist/editor/permission-manager/UserSelector.js.map +0 -1
- package/dist/editor/permission-manager/constants.d.ts.map +0 -1
- package/dist/editor/permission-manager/constants.js.map +0 -1
- package/dist/editor/permission-manager/hooks/useGroupsAndUsers.d.ts.map +0 -1
- package/dist/editor/permission-manager/hooks/useGroupsAndUsers.js.map +0 -1
- package/dist/editor/permission-manager/hooks/usePermissionTree.d.ts.map +0 -1
- package/dist/editor/permission-manager/hooks/usePermissionTree.js.map +0 -1
- package/dist/editor/permission-manager/index.d.ts.map +0 -1
- package/dist/editor/permission-manager/index.js.map +0 -1
- package/dist/editor/permission-manager/types.d.ts.map +0 -1
- package/dist/editor/permission-manager/types.js.map +0 -1
- package/dist/editor/permission-manager/utils.d.ts.map +0 -1
- package/dist/editor/permission-manager/utils.js.map +0 -1
- package/dist/editor/preview-bridge.d.ts.map +0 -1
- package/dist/editor/preview-bridge.js.map +0 -1
- package/dist/editor/relative-time.d.ts.map +0 -1
- package/dist/editor/relative-time.js.map +0 -1
- package/dist/editor/schema-editor/CollectionEditor.d.ts.map +0 -1
- package/dist/editor/schema-editor/CollectionEditor.js.map +0 -1
- package/dist/editor/schema-editor/EntryTypeEditor.d.ts.map +0 -1
- package/dist/editor/schema-editor/EntryTypeEditor.js.map +0 -1
- package/dist/editor/schema-editor/index.d.ts.map +0 -1
- package/dist/editor/schema-editor/index.js.map +0 -1
- package/dist/editor/setup-test-dom.d.ts +0 -1
- package/dist/editor/setup-test-dom.d.ts.map +0 -1
- package/dist/editor/setup-test-dom.js +0 -12
- package/dist/editor/setup-test-dom.js.map +0 -1
- package/dist/editor/test-setup.d.ts +0 -6
- package/dist/editor/test-setup.d.ts.map +0 -1
- package/dist/editor/test-setup.js +0 -42
- package/dist/editor/test-setup.js.map +0 -1
- package/dist/editor/theme.d.ts.map +0 -1
- package/dist/editor/theme.js.map +0 -1
- package/dist/editor/utils/env.d.ts.map +0 -1
- package/dist/editor/utils/env.js.map +0 -1
- package/dist/entry-link-resolver.d.ts.map +0 -1
- package/dist/entry-link-resolver.js.map +0 -1
- package/dist/entry-schema-registry.d.ts.map +0 -1
- package/dist/entry-schema-registry.js.map +0 -1
- package/dist/entry-schema.d.ts.map +0 -1
- package/dist/entry-schema.js.map +0 -1
- package/dist/git-manager.d.ts.map +0 -1
- package/dist/git-manager.js.map +0 -1
- package/dist/github-service.d.ts.map +0 -1
- package/dist/github-service.js.map +0 -1
- package/dist/http/handler.d.ts.map +0 -1
- package/dist/http/handler.js.map +0 -1
- package/dist/http/index.d.ts.map +0 -1
- package/dist/http/index.js.map +0 -1
- package/dist/http/router.d.ts.map +0 -1
- package/dist/http/router.js.map +0 -1
- package/dist/http/types.d.ts.map +0 -1
- package/dist/http/types.js.map +0 -1
- package/dist/id.d.ts.map +0 -1
- package/dist/id.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/operating-mode/client-safe-strategy.d.ts.map +0 -1
- package/dist/operating-mode/client-safe-strategy.js.map +0 -1
- package/dist/operating-mode/client-unsafe-strategy.d.ts.map +0 -1
- package/dist/operating-mode/client-unsafe-strategy.js.map +0 -1
- package/dist/operating-mode/client.d.ts.map +0 -1
- package/dist/operating-mode/client.js.map +0 -1
- package/dist/operating-mode/deployment-name-fixtures.d.ts.map +0 -1
- package/dist/operating-mode/deployment-name-fixtures.js.map +0 -1
- package/dist/operating-mode/deployment-name.d.ts.map +0 -1
- package/dist/operating-mode/deployment-name.js.map +0 -1
- package/dist/operating-mode/index.d.ts.map +0 -1
- package/dist/operating-mode/index.js.map +0 -1
- package/dist/operating-mode/mode-env.d.ts.map +0 -1
- package/dist/operating-mode/mode-env.js.map +0 -1
- package/dist/operating-mode/types.d.ts.map +0 -1
- package/dist/operating-mode/types.js.map +0 -1
- package/dist/paths/branch-name.d.ts.map +0 -1
- package/dist/paths/branch-name.js.map +0 -1
- package/dist/paths/branch.d.ts.map +0 -1
- package/dist/paths/branch.js.map +0 -1
- package/dist/paths/index.d.ts.map +0 -1
- package/dist/paths/index.js.map +0 -1
- package/dist/paths/normalize-server.d.ts.map +0 -1
- package/dist/paths/normalize-server.js.map +0 -1
- package/dist/paths/normalize.d.ts.map +0 -1
- package/dist/paths/normalize.js.map +0 -1
- package/dist/paths/resolve.d.ts.map +0 -1
- package/dist/paths/resolve.js.map +0 -1
- package/dist/paths/test-utils.d.ts +0 -22
- package/dist/paths/test-utils.d.ts.map +0 -1
- package/dist/paths/test-utils.js +0 -21
- package/dist/paths/test-utils.js.map +0 -1
- package/dist/paths/types.d.ts.map +0 -1
- package/dist/paths/types.js.map +0 -1
- package/dist/paths/validation.d.ts.map +0 -1
- package/dist/paths/validation.js.map +0 -1
- package/dist/reference-resolver.d.ts.map +0 -1
- package/dist/reference-resolver.js.map +0 -1
- package/dist/resolve-canopy-user.d.ts.map +0 -1
- package/dist/resolve-canopy-user.js.map +0 -1
- package/dist/resource-generation.d.ts.map +0 -1
- package/dist/resource-generation.js.map +0 -1
- package/dist/schema/index.d.ts.map +0 -1
- package/dist/schema/index.js.map +0 -1
- package/dist/schema/meta-loader.d.ts.map +0 -1
- package/dist/schema/meta-loader.js.map +0 -1
- package/dist/schema/resolver.d.ts.map +0 -1
- package/dist/schema/resolver.js.map +0 -1
- package/dist/schema/schema-store-types.d.ts.map +0 -1
- package/dist/schema/schema-store-types.js.map +0 -1
- package/dist/schema/schema-store.d.ts.map +0 -1
- package/dist/schema/schema-store.js.map +0 -1
- package/dist/schema/types.d.ts.map +0 -1
- package/dist/schema/types.js.map +0 -1
- package/dist/server.d.ts.map +0 -1
- package/dist/server.js.map +0 -1
- package/dist/services.d.ts.map +0 -1
- package/dist/services.js.map +0 -1
- package/dist/settings-workspace.d.ts.map +0 -1
- package/dist/settings-workspace.js.map +0 -1
- package/dist/static/index.d.ts.map +0 -1
- package/dist/static/index.js.map +0 -1
- package/dist/sync-core.d.ts.map +0 -1
- package/dist/sync-core.js.map +0 -1
- package/dist/task-queue/index.d.ts.map +0 -1
- package/dist/task-queue/index.js.map +0 -1
- package/dist/task-queue/task-queue.d.ts.map +0 -1
- package/dist/task-queue/task-queue.js.map +0 -1
- package/dist/task-queue/types.d.ts.map +0 -1
- package/dist/task-queue/types.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/url-path-resolver.d.ts.map +0 -1
- package/dist/url-path-resolver.js.map +0 -1
- package/dist/user.d.ts.map +0 -1
- package/dist/user.js.map +0 -1
- package/dist/utils/async-mutex.d.ts.map +0 -1
- package/dist/utils/async-mutex.js.map +0 -1
- package/dist/utils/atomic-write.d.ts.map +0 -1
- package/dist/utils/atomic-write.js.map +0 -1
- package/dist/utils/body-field.d.ts.map +0 -1
- package/dist/utils/body-field.js.map +0 -1
- package/dist/utils/content-write-lock.d.ts.map +0 -1
- package/dist/utils/content-write-lock.js.map +0 -1
- package/dist/utils/debug.d.ts.map +0 -1
- package/dist/utils/debug.js.map +0 -1
- package/dist/utils/entry-url.d.ts.map +0 -1
- package/dist/utils/entry-url.js.map +0 -1
- package/dist/utils/error.d.ts.map +0 -1
- package/dist/utils/error.js.map +0 -1
- package/dist/utils/flatten-group-fields.d.ts.map +0 -1
- package/dist/utils/flatten-group-fields.js.map +0 -1
- package/dist/utils/format.d.ts.map +0 -1
- package/dist/utils/format.js.map +0 -1
- package/dist/utils/fs.d.ts.map +0 -1
- package/dist/utils/fs.js.map +0 -1
- package/dist/utils/git.d.ts.map +0 -1
- package/dist/utils/git.js.map +0 -1
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/occ-json-write.d.ts.map +0 -1
- package/dist/utils/occ-json-write.js.map +0 -1
- package/dist/utils/provisioning-lock.d.ts.map +0 -1
- package/dist/utils/provisioning-lock.js.map +0 -1
- package/dist/utils/sanitize-href.d.ts.map +0 -1
- package/dist/utils/sanitize-href.js.map +0 -1
- package/dist/utils/title-field.d.ts.map +0 -1
- package/dist/utils/title-field.js.map +0 -1
- package/dist/validation/deletion-checker.d.ts.map +0 -1
- package/dist/validation/deletion-checker.js.map +0 -1
- package/dist/validation/entry-link-validator.d.ts.map +0 -1
- package/dist/validation/entry-link-validator.js.map +0 -1
- package/dist/validation/entry-type-reference-validator.d.ts.map +0 -1
- package/dist/validation/entry-type-reference-validator.js.map +0 -1
- package/dist/validation/entry-validator.d.ts.map +0 -1
- package/dist/validation/entry-validator.js.map +0 -1
- package/dist/validation/field-traversal.d.ts.map +0 -1
- package/dist/validation/field-traversal.js.map +0 -1
- package/dist/validation/reference-validator.d.ts.map +0 -1
- package/dist/validation/reference-validator.js.map +0 -1
- package/dist/worker/cms-worker.d.ts.map +0 -1
- package/dist/worker/cms-worker.js.map +0 -1
- package/dist/worker/log.d.ts.map +0 -1
- package/dist/worker/log.js.map +0 -1
- package/dist/worker/task-queue-config.d.ts.map +0 -1
- package/dist/worker/task-queue-config.js.map +0 -1
- package/dist/worker/task-queue.d.ts.map +0 -1
- package/dist/worker/task-queue.js.map +0 -1
- package/dist/worker/worker-status.d.ts.map +0 -1
- package/dist/worker/worker-status.js.map +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { countTitleFields, findInvalidTitleFields, findTitleFieldsInLists, } from './utils/title-field.js';
|
|
2
|
-
import { countBodyFields, findInvalidBodyFields } from './utils/body-field.js';
|
|
2
|
+
import { countBodyFields, findInvalidBodyFields, findReservedBodyFieldName, } from './utils/body-field.js';
|
|
3
|
+
import { RESOLVED_REFERENCE_KEYS } from './entry-schema.js';
|
|
3
4
|
import { flattenGroupFields } from './utils/flatten-group-fields.js';
|
|
4
5
|
import { ensureSelectFieldsHaveOptions, ensureReferenceFieldsHaveScope, ensureNoFlattenedFieldNameCollisions, ensureNoGroupsInsideComplexFields, } from './config/validation.js';
|
|
5
6
|
/** Look up a field's type by dotted path (e.g., "meta.order").
|
|
@@ -124,6 +125,10 @@ export function createEntrySchemaRegistry(registry) {
|
|
|
124
125
|
if (invalidBodyFields.length > 0) {
|
|
125
126
|
throw new Error(`Entry schema registry entry "${key}": field "${invalidBodyFields[0]}" has isBody: true but is type "${findFieldType(schema, invalidBodyFields[0])}" — isBody is only valid on markdown or mdx fields`);
|
|
126
127
|
}
|
|
128
|
+
const reservedBodyField = findReservedBodyFieldName(schema, RESOLVED_REFERENCE_KEYS);
|
|
129
|
+
if (reservedBodyField) {
|
|
130
|
+
throw new Error(`Entry schema registry entry "${key}": field "${reservedBodyField}" has isBody: true but "${reservedBodyField}" is reserved — reference resolution sets ${RESOLVED_REFERENCE_KEYS.map((k) => `"${k}"`).join(', ')} on a resolved reference, and a body field with one of those names would overwrite it. Rename the field (the body's field name is yours to choose; only these four are reserved).`);
|
|
131
|
+
}
|
|
127
132
|
// Field-shape checks moved here from validateCanopyConfig — these used to walk
|
|
128
133
|
// the (now-removed) inline-config schema; the registry is now the canonical
|
|
129
134
|
// entry point for entry schemas, so they run here.
|
|
@@ -193,4 +198,3 @@ export async function validateEntrySchemaRegistry(entrySchemaRegistry, contentPa
|
|
|
193
198
|
throw new Error(`Entry schema registry validation failed:\n${errors.map((e) => ` - ${e}`).join('\n')}`);
|
|
194
199
|
}
|
|
195
200
|
}
|
|
196
|
-
//# sourceMappingURL=entry-schema-registry.js.map
|
package/dist/entry-schema.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
1
2
|
/** Structural constraint for fields that can be inferred by TypeFromEntrySchema. */
|
|
2
3
|
type InferableField = {
|
|
3
4
|
name: string;
|
|
@@ -11,13 +12,88 @@ type InferableField = {
|
|
|
11
12
|
name: string;
|
|
12
13
|
fields: readonly InferableField[];
|
|
13
14
|
}>;
|
|
15
|
+
/**
|
|
16
|
+
* For select fields: the option list. Inferring the literal union of these values is
|
|
17
|
+
* what makes a select field's type its own options rather than a bare `string`.
|
|
18
|
+
*
|
|
19
|
+
* MUST stay `readonly` even though `SelectFieldConfig.options` (config/types.ts) is a
|
|
20
|
+
* mutable `SelectOption[]` — but NOT for the reason you might assume. A mutable
|
|
21
|
+
* constraint does not defeat `const` inference here: verified against this repo's tsc,
|
|
22
|
+
* `<const T>` still infers `['a', 'b']` with the literals intact under a mutable
|
|
23
|
+
* constraint, so the union would survive. The real failure is louder. An adopter who
|
|
24
|
+
* declares the option list separately and shares it across schemas writes
|
|
25
|
+
* `as const`, producing a `readonly` tuple — and a `readonly` array is not assignable
|
|
26
|
+
* to a mutable one (TS4104), so every such schema would stop compiling at the
|
|
27
|
+
* definition site. `readonly` here accepts both the inline literal and the shared
|
|
28
|
+
* `as const` array.
|
|
29
|
+
*/
|
|
30
|
+
options?: readonly (string | {
|
|
31
|
+
label: string;
|
|
32
|
+
value: string;
|
|
33
|
+
})[];
|
|
14
34
|
/** For reference fields: the target collection's schema (from defineEntrySchema) to infer resolved types. */
|
|
15
35
|
resolvedSchema?: readonly InferableField[];
|
|
16
36
|
/** For reference fields: filter by entry type name (e.g., ['partner']). */
|
|
17
37
|
entryTypes?: readonly string[];
|
|
18
38
|
/** For reference fields: collection paths to scope the search. */
|
|
19
39
|
collections?: readonly string[];
|
|
40
|
+
/** For reference fields: resolve the target's body too. See ReferenceFieldConfig.includeBody. */
|
|
41
|
+
includeBody?: boolean;
|
|
20
42
|
};
|
|
43
|
+
/**
|
|
44
|
+
* The fields reference resolution adds to a target's own data, on top of whatever
|
|
45
|
+
* `resolvedSchema` declares.
|
|
46
|
+
*
|
|
47
|
+
* These have always been returned at runtime (`resolveSingleReferenceOnce` in
|
|
48
|
+
* content-store.ts) but were missing from the inferred type, so a resolved reference typed
|
|
49
|
+
* narrower than it actually is — which is why reading `ref.id` needed a cast, and one source
|
|
50
|
+
* of the library-internal type error `adopter-migration.md` records under
|
|
51
|
+
* `exactOptionalPropertyTypes` + `skipLibCheck: false`.
|
|
52
|
+
*
|
|
53
|
+
* `urlPath` is what makes a resolved reference linkable without a second lookup; it follows
|
|
54
|
+
* the same collection+slug rule `listEntries` publishes as `item.urlPath`, so an index entry
|
|
55
|
+
* collapses to its parent path.
|
|
56
|
+
*/
|
|
57
|
+
export declare const RESOLVED_REFERENCE_KEYS: readonly ["id", "slug", "collection", "urlPath"];
|
|
58
|
+
/**
|
|
59
|
+
* Runtime counterpart of {@link ResolvedReferenceMeta}'s keys — the names reference resolution
|
|
60
|
+
* reserves on a resolved value. Kept beside the type so the two cannot drift, and consumed by
|
|
61
|
+
* both the resolver (which applies these last, so a target cannot shadow them) and the entry
|
|
62
|
+
* schema registry (which rejects a body field named one of them, since the body is assigned by
|
|
63
|
+
* key and would otherwise be the one way around that ordering).
|
|
64
|
+
*/
|
|
65
|
+
export interface ResolvedReferenceMeta {
|
|
66
|
+
/** The referenced entry's 12-char content ID. */
|
|
67
|
+
id: string;
|
|
68
|
+
/** The referenced entry's slug. */
|
|
69
|
+
slug: string;
|
|
70
|
+
/** The referenced entry's collection logical path (e.g. `content/snippets`). */
|
|
71
|
+
collection: string;
|
|
72
|
+
/** URL path for the referenced entry, e.g. `/guides/getting-started`. */
|
|
73
|
+
urlPath: string;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Assemble a resolved reference: the target's own data, then its body if the field asked to
|
|
77
|
+
* embed it, then the reserved metadata.
|
|
78
|
+
*
|
|
79
|
+
* Exists so the two places that construct one — the server resolver in content-store.ts and
|
|
80
|
+
* the editor's live-preview endpoint in api/resolve-references.ts — cannot drift. They already
|
|
81
|
+
* had: the preview endpoint kept the old `{ id, ...data }` order and carried none of the other
|
|
82
|
+
* three keys, so a component rendering `<a href={ref.urlPath}>` showed `undefined` while
|
|
83
|
+
* previewing and a real URL once published.
|
|
84
|
+
*
|
|
85
|
+
* The ordering is the contract, not a detail. Metadata last means a target that models `id` as
|
|
86
|
+
* a content field cannot shadow the real content ID — which matters because the write boundary
|
|
87
|
+
* recovers a reference's id from `value.id` (`referenceValueId`), so shadowing it made a
|
|
88
|
+
* re-save persist the wrong value and silently repoint the reference. Body before metadata
|
|
89
|
+
* closes the same hole for a body field named `id`; that schema is also rejected outright by
|
|
90
|
+
* the entry schema registry, so this ordering is the guarantee and that check is the loud
|
|
91
|
+
* error rather than a silent drop.
|
|
92
|
+
*/
|
|
93
|
+
export declare function buildResolvedReference(data: Record<string, unknown>, meta: ResolvedReferenceMeta, body?: {
|
|
94
|
+
fieldName: string;
|
|
95
|
+
value: string | undefined;
|
|
96
|
+
}): Record<string, unknown>;
|
|
21
97
|
/**
|
|
22
98
|
* Recursively flatten inline groups (type: 'group') out of a field tuple so that
|
|
23
99
|
* InferContentShape sees only data-carrying fields. Inline groups contribute no
|
|
@@ -30,11 +106,61 @@ type FlattenInlineGroups<Fields extends readonly InferableField[]> = Fields exte
|
|
|
30
106
|
type: 'group';
|
|
31
107
|
fields: infer GFields extends readonly InferableField[];
|
|
32
108
|
} ? [...FlattenInlineGroups<GFields>, ...FlattenInlineGroups<Rest>] : [Head, ...FlattenInlineGroups<Rest>] : [];
|
|
33
|
-
|
|
34
|
-
|
|
109
|
+
/**
|
|
110
|
+
* Collapse an intersection of mapped types into one object type, preserving the `?`
|
|
111
|
+
* modifier (the mapped type is homomorphic over `keyof T`, so optionality survives).
|
|
112
|
+
* Without it, InferContentShape would surface as `{ a: string } & { b?: string }` —
|
|
113
|
+
* structurally equivalent, but it reads badly in editor tooltips and is not accepted
|
|
114
|
+
* by strict type-equality assertions.
|
|
115
|
+
*/
|
|
116
|
+
type Simplify<T> = {
|
|
117
|
+
[K in keyof T]: T[K];
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* The value type of a field, WITHOUT any optionality. Optionality is carried solely by
|
|
121
|
+
* the `?` modifier that InferContentShape applies, never duplicated as `| undefined`.
|
|
122
|
+
*/
|
|
123
|
+
type ScalarValue<F extends InferableField, V> = F['list'] extends true ? V[] : V;
|
|
124
|
+
/**
|
|
125
|
+
* The value one `select` option contributes to the field's value union. A bare string
|
|
126
|
+
* option contributes itself; a `{ label, value }` option contributes its `value`, not
|
|
127
|
+
* the whole object. Mixed arrays of both forms work because this distributes.
|
|
128
|
+
*
|
|
129
|
+
* Falls back to `string` for an option whose literal type is gone — an options array
|
|
130
|
+
* annotated as `SelectOption[]` rather than inferred by `defineEntrySchema` widens to
|
|
131
|
+
* `string | { label: string; value: string }`, and both arms then land on `string`.
|
|
132
|
+
*/
|
|
133
|
+
type SelectOptionValue<O> = O extends {
|
|
134
|
+
value: infer V extends string;
|
|
135
|
+
} ? V : O extends string ? O : string;
|
|
136
|
+
/**
|
|
137
|
+
* The value type of a `select` field: the literal union of its OWN `options`.
|
|
138
|
+
*
|
|
139
|
+
* A select value is always a string — `SelectOption` (config/types.ts) carries
|
|
140
|
+
* `value: string` in both arms, `normalizeOptions` (editor/FormRenderer.tsx) emits
|
|
141
|
+
* strings, and `validateEntryData` (validation/entry-validator.ts) rejects anything
|
|
142
|
+
* that is not one. This type says WHICH strings.
|
|
143
|
+
*
|
|
144
|
+
* Like the rest of InferContentShape, this models the SCHEMA'S declared shape, not
|
|
145
|
+
* every byte the validator will tolerate on disk — the same stance that types a field
|
|
146
|
+
* omitting `required` as a required property. Notably the validator also accepts `''`
|
|
147
|
+
* as "not filled in" for any field that is not explicitly `required: true`, and `''` is
|
|
148
|
+
* deliberately NOT in this union.
|
|
149
|
+
*
|
|
150
|
+
* Degrades to `string` when there is nothing to infer: no `options` key at all, or an
|
|
151
|
+
* empty one. Both are schema mistakes that `ensureSelectFieldsHaveOptions`
|
|
152
|
+
* (config/validation.ts) rejects — but note it runs from `createEntrySchemaRegistry`,
|
|
153
|
+
* NOT from `validateCanopyConfig`, so a schema that is only ever fed to
|
|
154
|
+
* `TypeFromEntrySchema` and never registered gets no runtime rejection at all.
|
|
155
|
+
* Returning `never` here would type such a field as unsatisfiable, which is a worse
|
|
156
|
+
* error than the bare `string` this falls back to.
|
|
157
|
+
*/
|
|
158
|
+
type SelectValue<F extends InferableField> = F extends {
|
|
159
|
+
options: infer O extends readonly unknown[];
|
|
160
|
+
} ? [O[number]] extends [never] ? string : SelectOptionValue<O[number]> : string;
|
|
35
161
|
type ObjectValue<F extends InferableField & {
|
|
36
162
|
fields: readonly InferableField[];
|
|
37
|
-
}> =
|
|
163
|
+
}> = F['list'] extends true ? Array<InferContentShape<F['fields']>> : InferContentShape<F['fields']>;
|
|
38
164
|
/**
|
|
39
165
|
* Distributes over each member of a block templates union to produce a discriminated union.
|
|
40
166
|
*
|
|
@@ -55,7 +181,7 @@ type BlockValue<F extends InferableField & {
|
|
|
55
181
|
name: string;
|
|
56
182
|
fields: readonly InferableField[];
|
|
57
183
|
}>;
|
|
58
|
-
}> =
|
|
184
|
+
}> = Array<DistributeBlockTemplate<F['templates'][number]>>;
|
|
59
185
|
/**
|
|
60
186
|
* Structural mirror of `ImageFieldValue` (config/types.ts). Kept inline
|
|
61
187
|
* rather than imported so this module stays free of a FieldConfig import
|
|
@@ -88,10 +214,10 @@ type FieldValue<F extends InferableField> = F extends {
|
|
|
88
214
|
}>>>;
|
|
89
215
|
}> : F extends {
|
|
90
216
|
type: 'select';
|
|
91
|
-
} ? ScalarValue<F,
|
|
217
|
+
} ? ScalarValue<F, SelectValue<F>> : F extends {
|
|
92
218
|
type: 'reference';
|
|
93
219
|
resolvedSchema: infer S;
|
|
94
|
-
} ? ScalarValue<F, InferContentShape<Extract<S, readonly InferableField[]>> | null> : F extends {
|
|
220
|
+
} ? ScalarValue<F, (InferContentShape<Extract<S, readonly InferableField[]>> & ResolvedReferenceMeta) | null> : F extends {
|
|
95
221
|
type: 'reference';
|
|
96
222
|
} ? ScalarValue<F, string | null> : F extends {
|
|
97
223
|
type: 'image';
|
|
@@ -107,15 +233,23 @@ type FieldValue<F extends InferableField> = F extends {
|
|
|
107
233
|
* - Objects become nested objects
|
|
108
234
|
* - Blocks become arrays of tagged templates with their value shapes
|
|
109
235
|
* - Lists become arrays of the scalar/object type
|
|
110
|
-
* -
|
|
236
|
+
* - A field with an explicit `required: false` becomes an OPTIONAL property
|
|
237
|
+
* (`subheading?: string`), so a literal may omit it entirely rather than spelling it
|
|
238
|
+
* out as `undefined`. Reading it still yields `string | undefined`.
|
|
239
|
+
* - A field that OMITS `required` stays a REQUIRED property. `F['required']` infers as
|
|
240
|
+
* `boolean | undefined` there, which does not extend `false`. This three-way
|
|
241
|
+
* distinction (`true` / `false` / absent) is deliberate and pinned by tests — only an
|
|
242
|
+
* explicit `required: false` opts a key into `?:`.
|
|
111
243
|
* - Inline groups (type: 'group') are flattened — their fields contribute directly
|
|
112
244
|
* to the parent shape with no intermediate key.
|
|
113
245
|
*
|
|
114
246
|
* Works with any structurally compatible array; importing FieldConfig is not required.
|
|
115
247
|
*/
|
|
116
|
-
type InferContentShape<Fields extends readonly InferableField[]> = {
|
|
117
|
-
[F in FlattenInlineGroups<Fields>[number] as F['name']]: FieldValue<F>;
|
|
118
|
-
}
|
|
248
|
+
type InferContentShape<Fields extends readonly InferableField[]> = Simplify<{
|
|
249
|
+
[F in FlattenInlineGroups<Fields>[number] as F['required'] extends false ? never : F['name']]: FieldValue<F>;
|
|
250
|
+
} & {
|
|
251
|
+
[F in FlattenInlineGroups<Fields>[number] as F['required'] extends false ? F['name'] : never]?: FieldValue<F>;
|
|
252
|
+
}>;
|
|
119
253
|
/**
|
|
120
254
|
* Helper to define entry schema field arrays with literal inference without sprinkling `as const`.
|
|
121
255
|
*/
|
|
@@ -187,6 +321,117 @@ export declare const defineInlineFieldGroup: <const T extends {
|
|
|
187
321
|
}>(group: T) => T & {
|
|
188
322
|
readonly type: "group";
|
|
189
323
|
};
|
|
324
|
+
/**
|
|
325
|
+
* The recommended SEO field group, ready to drop into any entry schema.
|
|
326
|
+
*
|
|
327
|
+
* Emits the seven fields `extractSeoFields()` reads by default (`metaTitle`,
|
|
328
|
+
* `metaDescription`, `ogImage`, `ogType`, `canonical`, `noindex`, `twitterCard`), so schema and
|
|
329
|
+
* read side agree with no configuration. Every field is `required: false` — SEO metadata is
|
|
330
|
+
* always optional, and an unset field must fall back rather than fail validation.
|
|
331
|
+
*
|
|
332
|
+
* **Flat by default.** The fields are stored flat in the content file (an inline group: a
|
|
333
|
+
* visual container in the editor that adds no data key). Pass `group: 'seo'` for the nested
|
|
334
|
+
* convention, which stores them under that key — and then pass the same `{ group: 'seo' }` to
|
|
335
|
+
* `extractSeoFields` / `entryToMetadata`.
|
|
336
|
+
*
|
|
337
|
+
* @example
|
|
338
|
+
* // Flat (recommended): frontmatter carries `metaTitle:` at the top level.
|
|
339
|
+
* const pageSchema = defineEntrySchema([
|
|
340
|
+
* { name: 'title', type: 'string' },
|
|
341
|
+
* defineSeoFieldGroup(),
|
|
342
|
+
* ])
|
|
343
|
+
* // TypeFromEntrySchema: { title: string; metaTitle?: string; metaDescription?: string; ... }
|
|
344
|
+
*
|
|
345
|
+
* @example
|
|
346
|
+
* // Nested: frontmatter carries `seo: { metaTitle: … }`.
|
|
347
|
+
* const pageSchema = defineEntrySchema([defineSeoFieldGroup({ group: 'seo' })])
|
|
348
|
+
* const metadata = entryToMetadata(data, { group: 'seo' })
|
|
349
|
+
* // TypeFromEntrySchema: { seo?: { metaTitle?: string; ... } } — the wrapper key itself is
|
|
350
|
+
* // optional too, so an entry that sets no SEO fields at all can omit `seo` entirely.
|
|
351
|
+
*/
|
|
352
|
+
declare const SEO_GROUP_FIELDS: readonly [{
|
|
353
|
+
readonly name: "metaTitle";
|
|
354
|
+
readonly type: "string";
|
|
355
|
+
readonly label: "Meta Title";
|
|
356
|
+
readonly description: "Overrides the page title in search results and social cards.";
|
|
357
|
+
readonly required: false;
|
|
358
|
+
}, {
|
|
359
|
+
readonly name: "metaDescription";
|
|
360
|
+
readonly type: "string";
|
|
361
|
+
readonly label: "Meta Description";
|
|
362
|
+
readonly description: "Summary shown under the title in search results.";
|
|
363
|
+
readonly required: false;
|
|
364
|
+
}, {
|
|
365
|
+
readonly name: "ogImage";
|
|
366
|
+
readonly type: "string";
|
|
367
|
+
readonly label: "Social Image URL";
|
|
368
|
+
readonly description: "Image for social cards. Site-relative or absolute.";
|
|
369
|
+
readonly required: false;
|
|
370
|
+
}, {
|
|
371
|
+
readonly name: "ogType";
|
|
372
|
+
readonly type: "select";
|
|
373
|
+
readonly label: "OpenGraph Type";
|
|
374
|
+
readonly options: readonly ["website", "article", "profile"];
|
|
375
|
+
readonly required: false;
|
|
376
|
+
}, {
|
|
377
|
+
readonly name: "canonical";
|
|
378
|
+
readonly type: "string";
|
|
379
|
+
readonly label: "Canonical URL";
|
|
380
|
+
readonly description: "Set only to point at a different canonical copy of this page.";
|
|
381
|
+
readonly required: false;
|
|
382
|
+
}, {
|
|
383
|
+
readonly name: "noindex";
|
|
384
|
+
readonly type: "boolean";
|
|
385
|
+
readonly label: "Hide from search engines";
|
|
386
|
+
readonly description: "Marks the page noindex AND drops it from the sitemap.";
|
|
387
|
+
readonly required: false;
|
|
388
|
+
}, {
|
|
389
|
+
readonly name: "twitterCard";
|
|
390
|
+
readonly type: "select";
|
|
391
|
+
readonly label: "Twitter Card";
|
|
392
|
+
readonly options: readonly ["summary", "summary_large_image"];
|
|
393
|
+
readonly required: false;
|
|
394
|
+
}];
|
|
395
|
+
/** The seven recommended SEO fields, as a literal-typed field tuple. */
|
|
396
|
+
export type SeoGroupFields = typeof SEO_GROUP_FIELDS;
|
|
397
|
+
interface SeoFieldGroupOptions {
|
|
398
|
+
/** Editor label for the group. Default 'SEO'. */
|
|
399
|
+
label?: string;
|
|
400
|
+
/** Editor description for the group. */
|
|
401
|
+
description?: string;
|
|
402
|
+
}
|
|
403
|
+
/** Flat (inline) SEO group: fields are stored at the top level of the content file. */
|
|
404
|
+
export type InlineSeoFieldGroup = {
|
|
405
|
+
name: 'seo';
|
|
406
|
+
label: string;
|
|
407
|
+
description?: string;
|
|
408
|
+
fields: SeoGroupFields;
|
|
409
|
+
type: 'group';
|
|
410
|
+
};
|
|
411
|
+
/** Nested SEO group: fields are stored under the group's own key in the content file. */
|
|
412
|
+
export type NestedSeoFieldGroup<G extends string> = {
|
|
413
|
+
name: G;
|
|
414
|
+
label: string;
|
|
415
|
+
description?: string;
|
|
416
|
+
fields: SeoGroupFields;
|
|
417
|
+
type: 'object';
|
|
418
|
+
/**
|
|
419
|
+
* The wrapper object itself is optional — an entry that sets no SEO fields at all omits the
|
|
420
|
+
* `seo` key entirely, matching the runtime validator (`entry-validator.ts`), which only
|
|
421
|
+
* enforces fields with `required: true`.
|
|
422
|
+
*/
|
|
423
|
+
required: false;
|
|
424
|
+
};
|
|
425
|
+
export declare function defineSeoFieldGroup(opts?: SeoFieldGroupOptions & {
|
|
426
|
+
group?: undefined;
|
|
427
|
+
}): InlineSeoFieldGroup;
|
|
428
|
+
export declare function defineSeoFieldGroup<const G extends string>(opts: SeoFieldGroupOptions & {
|
|
429
|
+
/**
|
|
430
|
+
* Nest the fields under this data key instead of storing them flat. Must match the `group`
|
|
431
|
+
* option passed to `extractSeoFields` / `entryToMetadata`.
|
|
432
|
+
*/
|
|
433
|
+
group: G;
|
|
434
|
+
}): NestedSeoFieldGroup<G>;
|
|
190
435
|
/**
|
|
191
436
|
* Define a reusable nested field group — a visual container in the editor that groups
|
|
192
437
|
* related fields under a named key in the content file.
|
|
@@ -250,5 +495,91 @@ export declare const defineBlockTemplate: <const T extends {
|
|
|
250
495
|
description?: string;
|
|
251
496
|
fields: readonly InferableField[];
|
|
252
497
|
}>(template: T) => T;
|
|
498
|
+
/**
|
|
499
|
+
* Extract one template's value shape out of a block field's discriminated union.
|
|
500
|
+
*
|
|
501
|
+
* `Blocks` is the union itself — e.g. `Page['sections'][number]`, the element type of
|
|
502
|
+
* a `block` field as derived by `TypeFromEntrySchema` — not the surrounding array.
|
|
503
|
+
* `N` is one of that union's `template` literals.
|
|
504
|
+
*
|
|
505
|
+
* @example
|
|
506
|
+
* const heroBlock = defineBlockTemplate({
|
|
507
|
+
* name: 'hero',
|
|
508
|
+
* fields: [{ name: 'headline', type: 'string' }],
|
|
509
|
+
* })
|
|
510
|
+
* const pageSchema = defineEntrySchema([
|
|
511
|
+
* { name: 'sections', type: 'block', templates: [heroBlock] },
|
|
512
|
+
* ])
|
|
513
|
+
* type Sections = TypeFromEntrySchema<typeof pageSchema>['sections'][number]
|
|
514
|
+
* type HeroValue = BlockValueOf<Sections, 'hero'> // { headline: string }
|
|
515
|
+
*/
|
|
516
|
+
export type BlockValueOf<Blocks extends {
|
|
517
|
+
template: string;
|
|
518
|
+
value: unknown;
|
|
519
|
+
}, N extends Blocks['template']> = Extract<Blocks, {
|
|
520
|
+
template: N;
|
|
521
|
+
}>['value'];
|
|
522
|
+
/**
|
|
523
|
+
* A mapped type over a block field's template names, requiring exactly one component
|
|
524
|
+
* per template — no more, no fewer. This makes a block → component registry exhaustive
|
|
525
|
+
* *by construction*: adding a template to the schema without adding its component is a
|
|
526
|
+
* compile error, and a stray/renamed key in the registry is a compile error too. That is
|
|
527
|
+
* strictly stronger than a runtime "did I handle every template?" guard, since it fails
|
|
528
|
+
* the build instead of failing silently at render time.
|
|
529
|
+
*
|
|
530
|
+
* Deliberately a type, not a `renderBlocks()` helper — the type says nothing about key
|
|
531
|
+
* strategy, unknown-template handling, or how extra props reach each component, so it
|
|
532
|
+
* imposes no rendering shape. Adopters write their own small loop (see the README's
|
|
533
|
+
* "Block Component Registries" section for the recipe) and get exhaustiveness for free.
|
|
534
|
+
*
|
|
535
|
+
* @example
|
|
536
|
+
* const registry: BlockComponentRegistry<Sections> = {
|
|
537
|
+
* hero: ({ data }) => <HeroSection {...data} />,
|
|
538
|
+
* // TS error here if 'hero' is missing, or if a key doesn't match a template name.
|
|
539
|
+
* }
|
|
540
|
+
*
|
|
541
|
+
* // With extra props threaded to every block component:
|
|
542
|
+
* type Props = { index: number }
|
|
543
|
+
* const registryWithProps: BlockComponentRegistry<Sections, Props> = {
|
|
544
|
+
* hero: ({ data, index }) => <HeroSection {...data} position={index} />,
|
|
545
|
+
* }
|
|
546
|
+
*/
|
|
547
|
+
export type BlockComponentRegistry<Blocks extends {
|
|
548
|
+
template: string;
|
|
549
|
+
value: unknown;
|
|
550
|
+
}, ExtraProps extends object = object> = {
|
|
551
|
+
[N in Blocks['template']]: ComponentType<{
|
|
552
|
+
data: BlockValueOf<Blocks, N>;
|
|
553
|
+
} & ExtraProps>;
|
|
554
|
+
};
|
|
555
|
+
/**
|
|
556
|
+
* Const-inference identity helper for a reusable field fragment — a plain array of field
|
|
557
|
+
* configs (not a group, not a template) that you spread into multiple schemas' `fields`.
|
|
558
|
+
* Exists purely for discoverability: `defineEntrySchema` and `defineBlockTemplate` already
|
|
559
|
+
* infer literal types from a `const fields = [...] as const` array, so spreading it works
|
|
560
|
+
* without this helper too. Wrapping the definition site in `defineFieldFragment(...)` just
|
|
561
|
+
* makes the pattern easy to find (and to grep for) alongside `defineInlineFieldGroup` and
|
|
562
|
+
* `defineNestedFieldGroup`.
|
|
563
|
+
*
|
|
564
|
+
* Use this over a field group when you don't want the fields visually boxed together in
|
|
565
|
+
* the editor, or when different schemas need to override one field (e.g. a different
|
|
566
|
+
* `label` or `required`) — spread the fragment, then follow it with an object that
|
|
567
|
+
* overrides just the field(s) that differ for that schema.
|
|
568
|
+
*
|
|
569
|
+
* @example
|
|
570
|
+
* const ctaFields = defineFieldFragment([
|
|
571
|
+
* { name: 'ctaLabel', type: 'string', label: 'Button Label' },
|
|
572
|
+
* { name: 'ctaHref', type: 'string', label: 'Button Link' },
|
|
573
|
+
* ])
|
|
574
|
+
*
|
|
575
|
+
* const heroSchema = defineEntrySchema([
|
|
576
|
+
* { name: 'headline', type: 'string' },
|
|
577
|
+
* ...ctaFields,
|
|
578
|
+
* ])
|
|
579
|
+
* const bannerSchema = defineEntrySchema([
|
|
580
|
+
* { name: 'message', type: 'string' },
|
|
581
|
+
* ...ctaFields,
|
|
582
|
+
* ])
|
|
583
|
+
*/
|
|
584
|
+
export declare const defineFieldFragment: <const T extends readonly InferableField[]>(fields: T) => T;
|
|
253
585
|
export {};
|
|
254
|
-
//# sourceMappingURL=entry-schema.d.ts.map
|
package/dist/entry-schema.js
CHANGED
|
@@ -1,3 +1,52 @@
|
|
|
1
|
+
// The recommended SEO field names, shared with the read side (extractSeoFields) so the schema
|
|
2
|
+
// this module emits and the fields that module looks for cannot drift apart.
|
|
3
|
+
import { DEFAULT_SEO_FIELD_NAMES } from './static/seo.js';
|
|
4
|
+
/**
|
|
5
|
+
* The fields reference resolution adds to a target's own data, on top of whatever
|
|
6
|
+
* `resolvedSchema` declares.
|
|
7
|
+
*
|
|
8
|
+
* These have always been returned at runtime (`resolveSingleReferenceOnce` in
|
|
9
|
+
* content-store.ts) but were missing from the inferred type, so a resolved reference typed
|
|
10
|
+
* narrower than it actually is — which is why reading `ref.id` needed a cast, and one source
|
|
11
|
+
* of the library-internal type error `adopter-migration.md` records under
|
|
12
|
+
* `exactOptionalPropertyTypes` + `skipLibCheck: false`.
|
|
13
|
+
*
|
|
14
|
+
* `urlPath` is what makes a resolved reference linkable without a second lookup; it follows
|
|
15
|
+
* the same collection+slug rule `listEntries` publishes as `item.urlPath`, so an index entry
|
|
16
|
+
* collapses to its parent path.
|
|
17
|
+
*/
|
|
18
|
+
export const RESOLVED_REFERENCE_KEYS = ['id', 'slug', 'collection', 'urlPath'];
|
|
19
|
+
/**
|
|
20
|
+
* Assemble a resolved reference: the target's own data, then its body if the field asked to
|
|
21
|
+
* embed it, then the reserved metadata.
|
|
22
|
+
*
|
|
23
|
+
* Exists so the two places that construct one — the server resolver in content-store.ts and
|
|
24
|
+
* the editor's live-preview endpoint in api/resolve-references.ts — cannot drift. They already
|
|
25
|
+
* had: the preview endpoint kept the old `{ id, ...data }` order and carried none of the other
|
|
26
|
+
* three keys, so a component rendering `<a href={ref.urlPath}>` showed `undefined` while
|
|
27
|
+
* previewing and a real URL once published.
|
|
28
|
+
*
|
|
29
|
+
* The ordering is the contract, not a detail. Metadata last means a target that models `id` as
|
|
30
|
+
* a content field cannot shadow the real content ID — which matters because the write boundary
|
|
31
|
+
* recovers a reference's id from `value.id` (`referenceValueId`), so shadowing it made a
|
|
32
|
+
* re-save persist the wrong value and silently repoint the reference. Body before metadata
|
|
33
|
+
* closes the same hole for a body field named `id`; that schema is also rejected outright by
|
|
34
|
+
* the entry schema registry, so this ordering is the guarantee and that check is the loud
|
|
35
|
+
* error rather than a silent drop.
|
|
36
|
+
*/
|
|
37
|
+
export function buildResolvedReference(data, meta, body) {
|
|
38
|
+
const resolved = { ...data };
|
|
39
|
+
// Truthiness, matching `readEntryData`'s own merge: a listed md entry with an empty body
|
|
40
|
+
// carries no body key, so resolving one to `''` would reintroduce a listed-vs-resolved
|
|
41
|
+
// shape disagreement.
|
|
42
|
+
if (body && body.value)
|
|
43
|
+
resolved[body.fieldName] = body.value;
|
|
44
|
+
resolved.id = meta.id;
|
|
45
|
+
resolved.slug = meta.slug;
|
|
46
|
+
resolved.collection = meta.collection;
|
|
47
|
+
resolved.urlPath = meta.urlPath;
|
|
48
|
+
return resolved;
|
|
49
|
+
}
|
|
1
50
|
/**
|
|
2
51
|
* Helper to define entry schema field arrays with literal inference without sprinkling `as const`.
|
|
3
52
|
*/
|
|
@@ -24,6 +73,97 @@ export const defineEntrySchema = (fields) => fields;
|
|
|
24
73
|
* // TypeFromEntrySchema: { ..., metaTitle: string, metaDescription: string }
|
|
25
74
|
*/
|
|
26
75
|
export const defineInlineFieldGroup = (group) => ({ ...group, type: 'group' });
|
|
76
|
+
/**
|
|
77
|
+
* The recommended SEO field group, ready to drop into any entry schema.
|
|
78
|
+
*
|
|
79
|
+
* Emits the seven fields `extractSeoFields()` reads by default (`metaTitle`,
|
|
80
|
+
* `metaDescription`, `ogImage`, `ogType`, `canonical`, `noindex`, `twitterCard`), so schema and
|
|
81
|
+
* read side agree with no configuration. Every field is `required: false` — SEO metadata is
|
|
82
|
+
* always optional, and an unset field must fall back rather than fail validation.
|
|
83
|
+
*
|
|
84
|
+
* **Flat by default.** The fields are stored flat in the content file (an inline group: a
|
|
85
|
+
* visual container in the editor that adds no data key). Pass `group: 'seo'` for the nested
|
|
86
|
+
* convention, which stores them under that key — and then pass the same `{ group: 'seo' }` to
|
|
87
|
+
* `extractSeoFields` / `entryToMetadata`.
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* // Flat (recommended): frontmatter carries `metaTitle:` at the top level.
|
|
91
|
+
* const pageSchema = defineEntrySchema([
|
|
92
|
+
* { name: 'title', type: 'string' },
|
|
93
|
+
* defineSeoFieldGroup(),
|
|
94
|
+
* ])
|
|
95
|
+
* // TypeFromEntrySchema: { title: string; metaTitle?: string; metaDescription?: string; ... }
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* // Nested: frontmatter carries `seo: { metaTitle: … }`.
|
|
99
|
+
* const pageSchema = defineEntrySchema([defineSeoFieldGroup({ group: 'seo' })])
|
|
100
|
+
* const metadata = entryToMetadata(data, { group: 'seo' })
|
|
101
|
+
* // TypeFromEntrySchema: { seo?: { metaTitle?: string; ... } } — the wrapper key itself is
|
|
102
|
+
* // optional too, so an entry that sets no SEO fields at all can omit `seo` entirely.
|
|
103
|
+
*/
|
|
104
|
+
const SEO_GROUP_FIELDS = [
|
|
105
|
+
{
|
|
106
|
+
name: DEFAULT_SEO_FIELD_NAMES.title,
|
|
107
|
+
type: 'string',
|
|
108
|
+
label: 'Meta Title',
|
|
109
|
+
description: 'Overrides the page title in search results and social cards.',
|
|
110
|
+
required: false,
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
name: DEFAULT_SEO_FIELD_NAMES.description,
|
|
114
|
+
type: 'string',
|
|
115
|
+
label: 'Meta Description',
|
|
116
|
+
description: 'Summary shown under the title in search results.',
|
|
117
|
+
required: false,
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
name: DEFAULT_SEO_FIELD_NAMES.ogImage,
|
|
121
|
+
type: 'string',
|
|
122
|
+
label: 'Social Image URL',
|
|
123
|
+
description: 'Image for social cards. Site-relative or absolute.',
|
|
124
|
+
required: false,
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
name: DEFAULT_SEO_FIELD_NAMES.ogType,
|
|
128
|
+
type: 'select',
|
|
129
|
+
label: 'OpenGraph Type',
|
|
130
|
+
options: ['website', 'article', 'profile'],
|
|
131
|
+
required: false,
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
name: DEFAULT_SEO_FIELD_NAMES.canonical,
|
|
135
|
+
type: 'string',
|
|
136
|
+
label: 'Canonical URL',
|
|
137
|
+
description: 'Set only to point at a different canonical copy of this page.',
|
|
138
|
+
required: false,
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
name: DEFAULT_SEO_FIELD_NAMES.noindex,
|
|
142
|
+
type: 'boolean',
|
|
143
|
+
label: 'Hide from search engines',
|
|
144
|
+
description: 'Marks the page noindex AND drops it from the sitemap.',
|
|
145
|
+
required: false,
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
name: DEFAULT_SEO_FIELD_NAMES.twitterCard,
|
|
149
|
+
type: 'select',
|
|
150
|
+
label: 'Twitter Card',
|
|
151
|
+
options: ['summary', 'summary_large_image'],
|
|
152
|
+
required: false,
|
|
153
|
+
},
|
|
154
|
+
];
|
|
155
|
+
export function defineSeoFieldGroup(opts = {}) {
|
|
156
|
+
const base = {
|
|
157
|
+
label: opts.label ?? 'SEO',
|
|
158
|
+
...(opts.description ? { description: opts.description } : {}),
|
|
159
|
+
fields: SEO_GROUP_FIELDS,
|
|
160
|
+
};
|
|
161
|
+
// 'object' nests the fields under `name`; 'group' is the inline (flat) container, whose name
|
|
162
|
+
// is an editor-only label anchor and contributes no key to the content file.
|
|
163
|
+
return opts.group
|
|
164
|
+
? { ...base, name: opts.group, type: 'object', required: false }
|
|
165
|
+
: { ...base, name: 'seo', type: 'group' };
|
|
166
|
+
}
|
|
27
167
|
/**
|
|
28
168
|
* Define a reusable nested field group — a visual container in the editor that groups
|
|
29
169
|
* related fields under a named key in the content file.
|
|
@@ -78,4 +218,33 @@ export const defineNestedFieldGroup = (group) => ({ ...group, type: 'object' });
|
|
|
78
218
|
* // | { template: 'cta'; value: { label: string; href: string } }>
|
|
79
219
|
*/
|
|
80
220
|
export const defineBlockTemplate = (template) => template;
|
|
81
|
-
|
|
221
|
+
/**
|
|
222
|
+
* Const-inference identity helper for a reusable field fragment — a plain array of field
|
|
223
|
+
* configs (not a group, not a template) that you spread into multiple schemas' `fields`.
|
|
224
|
+
* Exists purely for discoverability: `defineEntrySchema` and `defineBlockTemplate` already
|
|
225
|
+
* infer literal types from a `const fields = [...] as const` array, so spreading it works
|
|
226
|
+
* without this helper too. Wrapping the definition site in `defineFieldFragment(...)` just
|
|
227
|
+
* makes the pattern easy to find (and to grep for) alongside `defineInlineFieldGroup` and
|
|
228
|
+
* `defineNestedFieldGroup`.
|
|
229
|
+
*
|
|
230
|
+
* Use this over a field group when you don't want the fields visually boxed together in
|
|
231
|
+
* the editor, or when different schemas need to override one field (e.g. a different
|
|
232
|
+
* `label` or `required`) — spread the fragment, then follow it with an object that
|
|
233
|
+
* overrides just the field(s) that differ for that schema.
|
|
234
|
+
*
|
|
235
|
+
* @example
|
|
236
|
+
* const ctaFields = defineFieldFragment([
|
|
237
|
+
* { name: 'ctaLabel', type: 'string', label: 'Button Label' },
|
|
238
|
+
* { name: 'ctaHref', type: 'string', label: 'Button Link' },
|
|
239
|
+
* ])
|
|
240
|
+
*
|
|
241
|
+
* const heroSchema = defineEntrySchema([
|
|
242
|
+
* { name: 'headline', type: 'string' },
|
|
243
|
+
* ...ctaFields,
|
|
244
|
+
* ])
|
|
245
|
+
* const bannerSchema = defineEntrySchema([
|
|
246
|
+
* { name: 'message', type: 'string' },
|
|
247
|
+
* ...ctaFields,
|
|
248
|
+
* ])
|
|
249
|
+
*/
|
|
250
|
+
export const defineFieldFragment = (fields) => fields;
|
package/dist/git-manager.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type SimpleGitOptions, type StatusResult } from 'simple-git';
|
|
2
|
-
import type { OperatingMode } from './operating-mode';
|
|
2
|
+
import type { OperatingMode } from './operating-mode/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Exported for GitManager's own use (see `this.git.env(...)` above),
|
|
5
5
|
* worker/cms-worker.ts's push-rejection-classified GitHub calls
|
|
@@ -423,4 +423,3 @@ export declare class GitManager {
|
|
|
423
423
|
createOrphanSettingsBranch(branchName: string, initialFiles: Record<string, string>): Promise<void>;
|
|
424
424
|
private createOrphanSettingsBranchInner;
|
|
425
425
|
}
|
|
426
|
-
//# sourceMappingURL=git-manager.d.ts.map
|
package/dist/git-manager.js
CHANGED
package/dist/github-service.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Octokit } from '@octokit/rest';
|
|
2
|
-
import type { CanopyConfig } from './config';
|
|
2
|
+
import type { CanopyConfig } from './config/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Retry primary rate limits at most twice and only for short waits; beyond
|
|
5
5
|
* that, task-level retry/backoff (worker) or the caller's error path takes
|
|
@@ -156,4 +156,3 @@ export declare class GitHubService {
|
|
|
156
156
|
* Returns null if not applicable (missing token, not GitHub, etc.)
|
|
157
157
|
*/
|
|
158
158
|
export declare const createGitHubService: (config: CanopyConfig, remoteUrl?: string) => GitHubService | null;
|
|
159
|
-
//# sourceMappingURL=github-service.d.ts.map
|
package/dist/github-service.js
CHANGED