canopycms 0.0.63 → 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 +7 -8
- package/dist/ai/index.js +0 -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 +4 -1
- package/dist/ai/to-plain-text.js +47 -1
- package/dist/ai/transform-components.d.ts +1 -2
- package/dist/ai/transform-components.js +0 -1
- 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 +4 -5
- package/dist/authorization/branch.js +0 -1
- 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 +6 -7
- 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 +5 -6
- package/dist/build-canopy.js +0 -1
- 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 +1131 -486
- package/dist/cli/generate-ai-content.d.ts +0 -1
- package/dist/cli/generate-ai-content.js +1000 -360
- 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/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 +75 -59
- package/dist/content-listing.js +76 -83
- package/dist/content-reader.d.ts +4 -5
- package/dist/content-reader.js +22 -3
- package/dist/content-store.d.ts +137 -6
- package/dist/content-store.js +294 -22
- package/dist/content-tree.d.ts +15 -5
- package/dist/content-tree.js +27 -8
- package/dist/context.d.ts +9 -6
- package/dist/context.js +0 -1
- 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 +114 -3
- package/dist/entry-schema.js +46 -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 -18
- package/dist/index.js +0 -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 +54 -45
- package/dist/server.js +11 -3
- package/dist/services.d.ts +10 -11
- package/dist/services.js +0 -1
- package/dist/settings-workspace.d.ts +12 -15
- package/dist/settings-workspace.js +10 -13
- package/dist/static/index.d.ts +164 -6
- package/dist/static/index.js +242 -7
- package/dist/static/seo.d.ts +8 -30
- package/dist/static/seo.js +19 -46
- 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 +2 -3
- package/dist/utils/sanitize-href.js +2 -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/to-plain-text.d.ts.map +0 -1
- package/dist/ai/to-plain-text.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-canopy.d.ts.map +0 -1
- package/dist/build-canopy.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/static/seo.d.ts.map +0 -1
- package/dist/static/seo.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
package/dist/utils/entry-url.js
CHANGED
|
@@ -5,6 +5,25 @@
|
|
|
5
5
|
* so it can be safely imported into browser bundles.
|
|
6
6
|
*/
|
|
7
7
|
import { trimSlashes } from '../paths/normalize.js';
|
|
8
|
+
/**
|
|
9
|
+
* Is this slug the collection-index slug?
|
|
10
|
+
*
|
|
11
|
+
* The shared home for that decision. Six sites route through here: `computeEntryUrl` below,
|
|
12
|
+
* `content-tree.ts`'s `defaultBuildPath`, `content-reader.ts`'s `buildEntryPath` and the
|
|
13
|
+
* editor's `buildPreviewSrc` (the four forward-rule implementations), the reverse
|
|
14
|
+
* `resolveUrlPathCandidates`, and `canopycms-next`'s `collectStaticParams`, which skips index
|
|
15
|
+
* entries for a single-segment route. Re-exported from `canopycms/server` for adopters. (`content-tree.ts`'s `indexEntry` lookup still does its own
|
|
16
|
+
* `slug === 'index'`; it is fed slugs already lowercased by the listing, so it is safe rather
|
|
17
|
+
* than shared.) Slug matching is case-insensitive throughout
|
|
18
|
+
* CanopyCMS (`parseSlug` lowercases, and `ContentStore` resolves slugs by a lowercased
|
|
19
|
+
* directory scan), so this compares lowercased — a bare `slug === 'index'` is correct only
|
|
20
|
+
* for callers whose input was already normalized, and silently wrong for the ones handling
|
|
21
|
+
* raw URL segments or on-disk names. `resolveUrlPathCandidates` was exactly that case: its
|
|
22
|
+
* strict compare left `/x/Index` resolving the index entry after `/x/index` stopped.
|
|
23
|
+
*/
|
|
24
|
+
export function isIndexSlug(slug) {
|
|
25
|
+
return slug?.toLowerCase() === 'index';
|
|
26
|
+
}
|
|
8
27
|
/**
|
|
9
28
|
* Compute a URL path from an entry's collection path and slug.
|
|
10
29
|
*
|
|
@@ -30,12 +49,11 @@ export function computeEntryUrl(collection, slug, contentRoot) {
|
|
|
30
49
|
}
|
|
31
50
|
// Build URL segments
|
|
32
51
|
const segments = stripped.split('/').filter(Boolean);
|
|
33
|
-
// Append slug unless it's
|
|
34
|
-
if (slug && slug
|
|
52
|
+
// Append slug unless it's an index slug (index entries collapse to parent)
|
|
53
|
+
if (slug && !isIndexSlug(slug)) {
|
|
35
54
|
segments.push(slug);
|
|
36
55
|
}
|
|
37
56
|
const path = segments.length > 0 ? `/${segments.join('/')}` : '/';
|
|
38
57
|
// Lowercase to match content-listing.ts and content-tree.ts URL conventions
|
|
39
58
|
return path.toLowerCase();
|
|
40
59
|
}
|
|
41
|
-
//# sourceMappingURL=entry-url.js.map
|
package/dist/utils/error.d.ts
CHANGED
package/dist/utils/error.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FieldConfig } from '../config';
|
|
1
|
+
import type { FieldConfig } from '../config/index.js';
|
|
2
2
|
/**
|
|
3
3
|
* Recursively flatten inline groups out of a field array.
|
|
4
4
|
* Group children are inlined at the parent level — groups are transparent to data.
|
|
@@ -10,4 +10,3 @@ import type { FieldConfig } from '../config';
|
|
|
10
10
|
* Not needed when using traverseFields() — that already handles groups transparently.
|
|
11
11
|
*/
|
|
12
12
|
export declare function flattenGroupFields(fields: readonly FieldConfig[]): FieldConfig[];
|
|
13
|
-
//# sourceMappingURL=flatten-group-fields.d.ts.map
|
package/dist/utils/format.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ContentFormat } from '../config';
|
|
1
|
+
import type { ContentFormat } from '../config/index.js';
|
|
2
2
|
/**
|
|
3
3
|
* Get the file extension for a content format
|
|
4
4
|
* @param format - The content format (md, mdx, json, yaml)
|
|
@@ -9,4 +9,3 @@ export declare const getFormatExtension: (format: ContentFormat) => string;
|
|
|
9
9
|
export declare const isDataOnlyFormat: (format: ContentFormat) => boolean;
|
|
10
10
|
/** Safely coerce a parsed value to a record, returning {} for non-object values */
|
|
11
11
|
export declare const asRecord: (value: unknown) => Record<string, unknown>;
|
|
12
|
-
//# sourceMappingURL=format.d.ts.map
|
package/dist/utils/format.js
CHANGED
package/dist/utils/fs.d.ts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
/** Check if a path exists on disk. */
|
|
2
2
|
export declare function filePathExists(filePath: string): Promise<boolean>;
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Read a UTF-8 file, or return undefined if it does not exist.
|
|
5
|
+
*
|
|
6
|
+
* Only ENOENT is swallowed — a permissions or I/O failure still throws, so a caller cannot
|
|
7
|
+
* mistake "unreadable" for "not there yet".
|
|
8
|
+
*/
|
|
9
|
+
export declare function readFileIfExists(filePath: string): Promise<string | undefined>;
|
package/dist/utils/fs.js
CHANGED
|
@@ -12,4 +12,19 @@ export async function filePathExists(filePath) {
|
|
|
12
12
|
throw err;
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Read a UTF-8 file, or return undefined if it does not exist.
|
|
17
|
+
*
|
|
18
|
+
* Only ENOENT is swallowed — a permissions or I/O failure still throws, so a caller cannot
|
|
19
|
+
* mistake "unreadable" for "not there yet".
|
|
20
|
+
*/
|
|
21
|
+
export async function readFileIfExists(filePath) {
|
|
22
|
+
try {
|
|
23
|
+
return await fs.readFile(filePath, 'utf8');
|
|
24
|
+
}
|
|
25
|
+
catch (err) {
|
|
26
|
+
if (isNotFoundError(err))
|
|
27
|
+
return undefined;
|
|
28
|
+
throw err;
|
|
29
|
+
}
|
|
30
|
+
}
|
package/dist/utils/git.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { OperatingMode } from '../operating-mode';
|
|
1
|
+
import type { OperatingMode } from '../operating-mode/index.js';
|
|
2
2
|
/**
|
|
3
3
|
* Whether a git remote URL points at a network location — http(s)://,
|
|
4
4
|
* ssh://, git://, scp-like `[user@]host:path`, a transport-helper `scheme::`
|
|
@@ -98,4 +98,3 @@ export declare function resolveBaseBranch(options: {
|
|
|
98
98
|
/** Repo root used for dev-mode HEAD detection. Defaults to process.cwd(). */
|
|
99
99
|
detectFrom?: string;
|
|
100
100
|
}): Promise<string>;
|
|
101
|
-
//# sourceMappingURL=git.d.ts.map
|
package/dist/utils/git.js
CHANGED
package/dist/utils/logger.d.ts
CHANGED
|
@@ -68,4 +68,3 @@ export declare function canopyLog(...args: unknown[]): void;
|
|
|
68
68
|
export declare function canopyLogWarn(...args: unknown[]): void;
|
|
69
69
|
/** Failure worth alerting on. Routes to stderr. */
|
|
70
70
|
export declare function canopyLogError(...args: unknown[]): void;
|
|
71
|
-
//# sourceMappingURL=logger.d.ts.map
|
package/dist/utils/logger.js
CHANGED
|
@@ -97,4 +97,3 @@ export declare function withOccRetry<T>(operation: () => Promise<T>, options?: W
|
|
|
97
97
|
* legitimately take many seconds.
|
|
98
98
|
*/
|
|
99
99
|
export declare function withOccFileLock<T>(filePath: string, fn: () => Promise<T>): Promise<T>;
|
|
100
|
-
//# sourceMappingURL=occ-json-write.d.ts.map
|
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Called when proper-lockfile reports the lock was lost mid-hold (its directory
|
|
3
|
+
* vanished, or a refresh failed and another holder may have taken over).
|
|
4
|
+
*
|
|
5
|
+
* Every call site must decide what that means for ITS critical section, which
|
|
6
|
+
* is why this is a parameter rather than a fixed policy: a compromise during
|
|
7
|
+
* idempotent provisioning is survivable, but a compromise during the worker's
|
|
8
|
+
* rebase means a second writer may be live and the next destructive git step
|
|
9
|
+
* must not run. What is NOT negotiable is that it must not throw --
|
|
10
|
+
* proper-lockfile invokes it from inside the refresh timer, so a throw is an
|
|
11
|
+
* uncaught exception that kills the process.
|
|
12
|
+
*/
|
|
13
|
+
export type OnLockCompromised = (err: Error) => void;
|
|
1
14
|
/**
|
|
2
15
|
* Acquire a cross-process filesystem lock for content provisioning.
|
|
3
16
|
*
|
|
@@ -11,10 +24,11 @@
|
|
|
11
24
|
*
|
|
12
25
|
* Returns a release function — always call it in a `finally`.
|
|
13
26
|
*
|
|
14
|
-
* @param lockTargetDir directory the lock
|
|
27
|
+
* @param lockTargetDir directory the lock marker lives in (created if missing)
|
|
15
28
|
* @param lockName name of the on-disk lock marker, created inside lockTargetDir
|
|
29
|
+
* @param onCompromised see {@link OnLockCompromised}; defaults to log-and-continue
|
|
16
30
|
*/
|
|
17
|
-
export declare function acquireProvisioningLock(lockTargetDir: string, lockName: string): Promise<() => Promise<void>>;
|
|
31
|
+
export declare function acquireProvisioningLock(lockTargetDir: string, lockName: string, onCompromised?: OnLockCompromised): Promise<() => Promise<void>>;
|
|
18
32
|
/**
|
|
19
33
|
* Zero-retry variant of {@link acquireProvisioningLock}, for admin actions
|
|
20
34
|
* running inside a synchronous request/response cycle (e.g. a Lambda-backed
|
|
@@ -33,5 +47,4 @@ export declare function acquireProvisioningLock(lockTargetDir: string, lockName:
|
|
|
33
47
|
* Throws with `err.code === 'ELOCKED'` on contention (a live, non-stale
|
|
34
48
|
* holder) -- callers should translate that into a 409.
|
|
35
49
|
*/
|
|
36
|
-
export declare function tryAcquireProvisioningLock(lockTargetDir: string, lockName: string): Promise<() => Promise<void>>;
|
|
37
|
-
//# sourceMappingURL=provisioning-lock.d.ts.map
|
|
50
|
+
export declare function tryAcquireProvisioningLock(lockTargetDir: string, lockName: string, onCompromised?: OnLockCompromised): Promise<() => Promise<void>>;
|
|
@@ -1,6 +1,90 @@
|
|
|
1
1
|
import fs from 'node:fs/promises';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import lockfile from 'proper-lockfile';
|
|
4
|
+
import { getErrorMessage, isNodeError } from './error.js';
|
|
5
|
+
import { canopyLogWarn } from './logger.js';
|
|
6
|
+
/**
|
|
7
|
+
* Shared option set for both provisioning-lock variants.
|
|
8
|
+
*
|
|
9
|
+
* **The lock is anchored on the lock file's own path, not its directory.**
|
|
10
|
+
* proper-lockfile keys its module-level `locks{}` bookkeeping (refresh timer,
|
|
11
|
+
* release fn) by the TARGET path passed to `lock()` — not by `lockfilePath`.
|
|
12
|
+
* Passing the shared branches directory made every branch under one root alias
|
|
13
|
+
* a single registry entry: acquiring `.b.init.lock` overwrote `.a.init.lock`'s
|
|
14
|
+
* entry, so releasing A tore down B's refresh timer, made B's own release fail
|
|
15
|
+
* with `ERELEASED`, and leaked B's lock directory on disk until `stale`
|
|
16
|
+
* expired. The orphaned refresh timer then `stat`ed a path its owner had
|
|
17
|
+
* already deleted, raising `ECOMPROMISED`. Anchoring here makes the registry
|
|
18
|
+
* key identical to the on-disk lock identity, so two live locks can never
|
|
19
|
+
* share a key. `realpath: false` because the anchor path is the lock marker
|
|
20
|
+
* itself and does not exist before we create it (realpath would ENOENT).
|
|
21
|
+
* See docs/concurrency.md ("Anchor path matters").
|
|
22
|
+
*/
|
|
23
|
+
function provisioningLockOptions(lockPath, retries, onCompromised) {
|
|
24
|
+
return {
|
|
25
|
+
lockfilePath: lockPath,
|
|
26
|
+
realpath: false,
|
|
27
|
+
retries,
|
|
28
|
+
stale: 30_000,
|
|
29
|
+
// proper-lockfile invokes this from inside its refresh timer, so ANY throw
|
|
30
|
+
// escaping here is an uncaught exception that kills the process -- the very
|
|
31
|
+
// failure the handler exists to prevent. Call sites are told not to throw
|
|
32
|
+
// (see OnLockCompromised); this makes it structural rather than a
|
|
33
|
+
// convention, and also covers the LOGGER throwing: under `CI=true`,
|
|
34
|
+
// vitest's `onConsoleLog` turns any console write into a throw.
|
|
35
|
+
onCompromised: (err) => {
|
|
36
|
+
try {
|
|
37
|
+
if (onCompromised) {
|
|
38
|
+
onCompromised(err);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
// Default: log and let the holder finish. proper-lockfile's own default
|
|
42
|
+
// rethrows from the refresh timer, which protects nothing -- by the time
|
|
43
|
+
// a compromise is reported the mutual exclusion is already gone.
|
|
44
|
+
// `canopyLogWarn` (not the debug logger) because this means "two
|
|
45
|
+
// holders may now be live": it must be visible without CANOPYCMS_DEBUG.
|
|
46
|
+
canopyLogWarn(`[canopy] Provisioning lock compromised mid-hold for ${lockPath}:`, getErrorMessage(err));
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
// Last resort: a raw stderr write goes around both a replaced logger
|
|
50
|
+
// and vitest's console interception, so the compromise still leaves a
|
|
51
|
+
// trace. Guarded in turn, because nothing above this line is allowed
|
|
52
|
+
// to throw out of a refresh timer.
|
|
53
|
+
try {
|
|
54
|
+
process.stderr.write(`[canopy] lock compromised for ${lockPath}; its handler or logger threw\n`);
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
// Nothing further is safe to attempt.
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* proper-lockfile's release rejects with `ERELEASED` once the lock has been
|
|
65
|
+
* marked compromised (`setLockAsCompromised` sets `released = true` before the
|
|
66
|
+
* caller ever gets to release). Callers hold this in a `finally`, so letting
|
|
67
|
+
* that escape would convert a COMPLETED operation into a spurious failure.
|
|
68
|
+
* There is nothing left to release in that state, so swallow just that code and
|
|
69
|
+
* let every other release error propagate to the caller that asked for it.
|
|
70
|
+
*/
|
|
71
|
+
function releaseIgnoringAlreadyReleased(release, lockPath) {
|
|
72
|
+
return async () => {
|
|
73
|
+
try {
|
|
74
|
+
await release();
|
|
75
|
+
}
|
|
76
|
+
catch (err) {
|
|
77
|
+
if (isNodeError(err) && err.code === 'ERELEASED') {
|
|
78
|
+
// Deliberately does not name a cause: ERELEASED is raised both by a
|
|
79
|
+
// lock compromised mid-hold AND by a plain double-release bug, and
|
|
80
|
+
// from here the two are indistinguishable.
|
|
81
|
+
canopyLogWarn(`[canopy] Lock at ${lockPath} was already released (compromised mid-hold, or released twice); nothing to release`);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
throw err;
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
}
|
|
4
88
|
/**
|
|
5
89
|
* Acquire a cross-process filesystem lock for content provisioning.
|
|
6
90
|
*
|
|
@@ -14,22 +98,21 @@ import lockfile from 'proper-lockfile';
|
|
|
14
98
|
*
|
|
15
99
|
* Returns a release function — always call it in a `finally`.
|
|
16
100
|
*
|
|
17
|
-
* @param lockTargetDir directory the lock
|
|
101
|
+
* @param lockTargetDir directory the lock marker lives in (created if missing)
|
|
18
102
|
* @param lockName name of the on-disk lock marker, created inside lockTargetDir
|
|
103
|
+
* @param onCompromised see {@link OnLockCompromised}; defaults to log-and-continue
|
|
19
104
|
*/
|
|
20
|
-
export async function acquireProvisioningLock(lockTargetDir, lockName) {
|
|
105
|
+
export async function acquireProvisioningLock(lockTargetDir, lockName, onCompromised) {
|
|
21
106
|
await fs.mkdir(lockTargetDir, { recursive: true });
|
|
107
|
+
const lockPath = path.join(lockTargetDir, lockName);
|
|
22
108
|
// Generous, jittered retries: many waiters (one per build worker process, each
|
|
23
109
|
// prerendering several pages) may contend, and the holder can take several
|
|
24
110
|
// seconds to init + clone/push. `randomize` de-syncs the herd so a waiter isn't
|
|
25
111
|
// perpetually colliding on the same tick. `stale` stays modest because proper-
|
|
26
112
|
// lockfile auto-refreshes a live holder's lock, so it only expires when a
|
|
27
113
|
// process actually dies.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
retries: { retries: 600, factor: 1, minTimeout: 300, maxTimeout: 800, randomize: true },
|
|
31
|
-
stale: 30_000,
|
|
32
|
-
});
|
|
114
|
+
const release = await lockfile.lock(lockPath, provisioningLockOptions(lockPath, { retries: 600, factor: 1, minTimeout: 300, maxTimeout: 800, randomize: true }, onCompromised));
|
|
115
|
+
return releaseIgnoringAlreadyReleased(release, lockPath);
|
|
33
116
|
}
|
|
34
117
|
/**
|
|
35
118
|
* Zero-retry variant of {@link acquireProvisioningLock}, for admin actions
|
|
@@ -49,12 +132,9 @@ export async function acquireProvisioningLock(lockTargetDir, lockName) {
|
|
|
49
132
|
* Throws with `err.code === 'ELOCKED'` on contention (a live, non-stale
|
|
50
133
|
* holder) -- callers should translate that into a 409.
|
|
51
134
|
*/
|
|
52
|
-
export async function tryAcquireProvisioningLock(lockTargetDir, lockName) {
|
|
135
|
+
export async function tryAcquireProvisioningLock(lockTargetDir, lockName, onCompromised) {
|
|
53
136
|
await fs.mkdir(lockTargetDir, { recursive: true });
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
stale: 30_000,
|
|
58
|
-
});
|
|
137
|
+
const lockPath = path.join(lockTargetDir, lockName);
|
|
138
|
+
const release = await lockfile.lock(lockPath, provisioningLockOptions(lockPath, 0, onCompromised));
|
|
139
|
+
return releaseIgnoringAlreadyReleased(release, lockPath);
|
|
59
140
|
}
|
|
60
|
-
//# sourceMappingURL=provisioning-lock.js.map
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* equivalent to forward slash for special schemes, so `/\evil.com`, `\\evil.com` and `\/evil.com`
|
|
8
8
|
* are all protocol-relative in effect despite declaring no scheme). Exported so every "is this
|
|
9
9
|
* URL off-site" check in the package shares one answer instead of re-deriving it -- see
|
|
10
|
-
* `isImplicitlyOffOrigin` below and `
|
|
10
|
+
* `isImplicitlyOffOrigin` below and `utils/url-prefix.ts`'s `isAbsoluteUrl`.
|
|
11
11
|
*/
|
|
12
12
|
export declare function declaresScheme(url: string): boolean;
|
|
13
13
|
/**
|
|
@@ -22,7 +22,7 @@ export declare function declaresScheme(url: string): boolean;
|
|
|
22
22
|
* (`declaresScheme` already identifies those as intentionally off-site on their own).
|
|
23
23
|
*
|
|
24
24
|
* Callers that want to treat a LITERAL `//host` as an intentionally-supported off-site pointer
|
|
25
|
-
* (e.g. `
|
|
25
|
+
* (e.g. `utils/url-prefix.ts`'s `isAbsoluteUrl`, for a CDN-hosted `ogImage`) should check that
|
|
26
26
|
* separately and only fall back to this function to catch the spellings that slip past a
|
|
27
27
|
* `startsWith('//')` check.
|
|
28
28
|
*/
|
|
@@ -87,4 +87,3 @@ export declare function neutralizeImplicitOffOrigin(url: string): string;
|
|
|
87
87
|
* ```
|
|
88
88
|
*/
|
|
89
89
|
export declare function sanitizeHref(url: string, fallback?: string): string;
|
|
90
|
-
//# sourceMappingURL=sanitize-href.d.ts.map
|
|
@@ -11,7 +11,7 @@ const SENTINEL_BASE = 'https://relative.invalid';
|
|
|
11
11
|
* equivalent to forward slash for special schemes, so `/\evil.com`, `\\evil.com` and `\/evil.com`
|
|
12
12
|
* are all protocol-relative in effect despite declaring no scheme). Exported so every "is this
|
|
13
13
|
* URL off-site" check in the package shares one answer instead of re-deriving it -- see
|
|
14
|
-
* `isImplicitlyOffOrigin` below and `
|
|
14
|
+
* `isImplicitlyOffOrigin` below and `utils/url-prefix.ts`'s `isAbsoluteUrl`.
|
|
15
15
|
*/
|
|
16
16
|
export function declaresScheme(url) {
|
|
17
17
|
return /^[a-z][a-z0-9+.-]*:/i.test(url.trim());
|
|
@@ -28,7 +28,7 @@ export function declaresScheme(url) {
|
|
|
28
28
|
* (`declaresScheme` already identifies those as intentionally off-site on their own).
|
|
29
29
|
*
|
|
30
30
|
* Callers that want to treat a LITERAL `//host` as an intentionally-supported off-site pointer
|
|
31
|
-
* (e.g. `
|
|
31
|
+
* (e.g. `utils/url-prefix.ts`'s `isAbsoluteUrl`, for a CDN-hosted `ogImage`) should check that
|
|
32
32
|
* separately and only fall back to this function to catch the spellings that slip past a
|
|
33
33
|
* `startsWith('//')` check.
|
|
34
34
|
*/
|
|
@@ -146,4 +146,3 @@ export function sanitizeHref(url, fallback = '#') {
|
|
|
146
146
|
}
|
|
147
147
|
return fallback;
|
|
148
148
|
}
|
|
149
|
-
//# sourceMappingURL=sanitize-href.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FieldConfig } from '../config';
|
|
1
|
+
import type { FieldConfig } from '../config/index.js';
|
|
2
2
|
/**
|
|
3
3
|
* Find the field marked `isTitle: true` in a schema and extract its value from data.
|
|
4
4
|
* Recurses into object fields to support nested title fields (e.g., hero.title).
|
|
@@ -37,4 +37,3 @@ export declare function findInvalidTitleFields(fields: readonly FieldConfig[], p
|
|
|
37
37
|
* Returns dotted paths of such fields.
|
|
38
38
|
*/
|
|
39
39
|
export declare function findTitleFieldsInLists(fields: readonly FieldConfig[], parentPath?: string): string[];
|
|
40
|
-
//# sourceMappingURL=title-field.d.ts.map
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { EntryTypeConfig } from '../config/index.js';
|
|
2
|
+
import type { ContentId, Slug } from '../paths/types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Parse a Canopy content filename into its `{type}.{slug}.{id}.{ext}` parts.
|
|
5
|
+
*
|
|
6
|
+
* ## Filename grammar
|
|
7
|
+
*
|
|
8
|
+
* Every entry file on disk is named `{type}.{slug}.{id}.{ext}`:
|
|
9
|
+
* - `type` — the entry type name (a key in the collection's `entries` config).
|
|
10
|
+
* - `slug` — the entry's URL slug. May itself contain dots (e.g. a slug of
|
|
11
|
+
* `getting.started.guide`), so the type and ID anchor the split: the ID is
|
|
12
|
+
* always the second-to-last dot-separated segment, and the slug is
|
|
13
|
+
* everything between the type and the ID. The returned `slug` is
|
|
14
|
+
* lowercased.
|
|
15
|
+
* - `id` — a 12-character Base58 content ID (`generateId()`/`isValidId()`).
|
|
16
|
+
* Base58 excludes the ambiguous characters `0`, `O`, `I`, `l` so IDs are
|
|
17
|
+
* unambiguous when read aloud or hand-transcribed. A filename whose
|
|
18
|
+
* would-be ID segment doesn't pass `isValidId` is rejected — the whole
|
|
19
|
+
* parse returns `null`, even if the rest of the shape looks right.
|
|
20
|
+
* - `ext` — the format extension (`.md`, `.mdx`, `.json`, `.yaml`), stripped
|
|
21
|
+
* before parsing and not part of the returned result.
|
|
22
|
+
*
|
|
23
|
+
* @param filename - The bare filename (no directory component). **This precondition is
|
|
24
|
+
* not enforced.** The parser splits purely on `.`, so a `/` or `\` you pass in is not
|
|
25
|
+
* rejected and is not treated as special — it becomes part of whichever segment it
|
|
26
|
+
* falls in, most often the `type` segment (e.g. `'foo/bar.slug.<validId>.md'` parses
|
|
27
|
+
* to `type: 'foo/bar'`). Strip any directory component yourself (e.g.
|
|
28
|
+
* `path.basename(filePath)`) before calling this — every internal caller already does.
|
|
29
|
+
* @param entryTypes - When provided, the parsed `type` segment must match one
|
|
30
|
+
* of these entry types by name, or the parse is rejected (this is how
|
|
31
|
+
* `listCollectionEntries` filters out files that don't belong to the
|
|
32
|
+
* collection's configured entry types). Omit this argument to parse
|
|
33
|
+
* structurally without validating the type against a known list — useful
|
|
34
|
+
* for adopter code that needs to recover `{type, slug, id}` from a
|
|
35
|
+
* filename without having a schema/entry-types list on hand (e.g. a
|
|
36
|
+
* filesystem walk over content for tooling or diagnostics). Even without
|
|
37
|
+
* `entryTypes`, a leading-dot filename (dotfile, editor swap/backup file)
|
|
38
|
+
* is always rejected — an empty string is never a legal type, matching the
|
|
39
|
+
* `filename.startsWith('.')` guard `extractEntryTypeFromFilename` in
|
|
40
|
+
* `content-id-index.ts` already applies.
|
|
41
|
+
* @returns `{ type, slug, id }`, or `null` if `filename` doesn't match the
|
|
42
|
+
* `{type}.{slug}.{id}.{ext}` shape (too few segments, no extension, a
|
|
43
|
+
* leading dot, an invalid ID, or — when `entryTypes` is given — an
|
|
44
|
+
* unrecognized type). `id` is validated (`isValidId`) and safe to trust. **`slug` is
|
|
45
|
+
* not** — it is the raw dot-joined middle segment(s), lowercased, cast to the branded
|
|
46
|
+
* `Slug` type without running `parseSlug`'s validation. A filename with an
|
|
47
|
+
* unconventional slug segment (e.g. containing a space, or a dot) still parses and still
|
|
48
|
+
* receives the `Slug` brand. Callers that need a validated slug must run the result
|
|
49
|
+
* through `parseSlug` themselves; this function's contract is "split the filename
|
|
50
|
+
* grammar apart," not "validate every part." `listCollectionEntries` (content-listing.ts)
|
|
51
|
+
* is exactly such a caller that does NOT re-validate — it lists the file and computes a
|
|
52
|
+
* `urlPath` for it regardless — so a dotted slug listed this way builds and gets
|
|
53
|
+
* advertised (sitemap, `generateStaticParams`) but can never be read back through
|
|
54
|
+
* `readByUrlPath`, which does run every URL-resolution candidate through `parseSlug`.
|
|
55
|
+
* `static/index.ts`'s `assertRoutableSlugs` is the build-time guard that catches this.
|
|
56
|
+
*/
|
|
57
|
+
export declare const parseTypedFilename: (filename: string, entryTypes?: readonly EntryTypeConfig[]) => {
|
|
58
|
+
type: string;
|
|
59
|
+
slug: Slug;
|
|
60
|
+
id: ContentId;
|
|
61
|
+
} | null;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { isValidId } from '../id.js';
|
|
2
|
+
// Lives here rather than in content-listing.ts, where it was born, purely so dependency-light
|
|
3
|
+
// modules can use it: content-listing imports ContentStore, so anything content-store itself
|
|
4
|
+
// imports (url-collision.ts) cannot reach back into it without a cycle. content-listing
|
|
5
|
+
// re-exports this and `canopycms/server` re-exports it from there, so the public surface is
|
|
6
|
+
// unchanged.
|
|
7
|
+
/**
|
|
8
|
+
* Parse a Canopy content filename into its `{type}.{slug}.{id}.{ext}` parts.
|
|
9
|
+
*
|
|
10
|
+
* ## Filename grammar
|
|
11
|
+
*
|
|
12
|
+
* Every entry file on disk is named `{type}.{slug}.{id}.{ext}`:
|
|
13
|
+
* - `type` — the entry type name (a key in the collection's `entries` config).
|
|
14
|
+
* - `slug` — the entry's URL slug. May itself contain dots (e.g. a slug of
|
|
15
|
+
* `getting.started.guide`), so the type and ID anchor the split: the ID is
|
|
16
|
+
* always the second-to-last dot-separated segment, and the slug is
|
|
17
|
+
* everything between the type and the ID. The returned `slug` is
|
|
18
|
+
* lowercased.
|
|
19
|
+
* - `id` — a 12-character Base58 content ID (`generateId()`/`isValidId()`).
|
|
20
|
+
* Base58 excludes the ambiguous characters `0`, `O`, `I`, `l` so IDs are
|
|
21
|
+
* unambiguous when read aloud or hand-transcribed. A filename whose
|
|
22
|
+
* would-be ID segment doesn't pass `isValidId` is rejected — the whole
|
|
23
|
+
* parse returns `null`, even if the rest of the shape looks right.
|
|
24
|
+
* - `ext` — the format extension (`.md`, `.mdx`, `.json`, `.yaml`), stripped
|
|
25
|
+
* before parsing and not part of the returned result.
|
|
26
|
+
*
|
|
27
|
+
* @param filename - The bare filename (no directory component). **This precondition is
|
|
28
|
+
* not enforced.** The parser splits purely on `.`, so a `/` or `\` you pass in is not
|
|
29
|
+
* rejected and is not treated as special — it becomes part of whichever segment it
|
|
30
|
+
* falls in, most often the `type` segment (e.g. `'foo/bar.slug.<validId>.md'` parses
|
|
31
|
+
* to `type: 'foo/bar'`). Strip any directory component yourself (e.g.
|
|
32
|
+
* `path.basename(filePath)`) before calling this — every internal caller already does.
|
|
33
|
+
* @param entryTypes - When provided, the parsed `type` segment must match one
|
|
34
|
+
* of these entry types by name, or the parse is rejected (this is how
|
|
35
|
+
* `listCollectionEntries` filters out files that don't belong to the
|
|
36
|
+
* collection's configured entry types). Omit this argument to parse
|
|
37
|
+
* structurally without validating the type against a known list — useful
|
|
38
|
+
* for adopter code that needs to recover `{type, slug, id}` from a
|
|
39
|
+
* filename without having a schema/entry-types list on hand (e.g. a
|
|
40
|
+
* filesystem walk over content for tooling or diagnostics). Even without
|
|
41
|
+
* `entryTypes`, a leading-dot filename (dotfile, editor swap/backup file)
|
|
42
|
+
* is always rejected — an empty string is never a legal type, matching the
|
|
43
|
+
* `filename.startsWith('.')` guard `extractEntryTypeFromFilename` in
|
|
44
|
+
* `content-id-index.ts` already applies.
|
|
45
|
+
* @returns `{ type, slug, id }`, or `null` if `filename` doesn't match the
|
|
46
|
+
* `{type}.{slug}.{id}.{ext}` shape (too few segments, no extension, a
|
|
47
|
+
* leading dot, an invalid ID, or — when `entryTypes` is given — an
|
|
48
|
+
* unrecognized type). `id` is validated (`isValidId`) and safe to trust. **`slug` is
|
|
49
|
+
* not** — it is the raw dot-joined middle segment(s), lowercased, cast to the branded
|
|
50
|
+
* `Slug` type without running `parseSlug`'s validation. A filename with an
|
|
51
|
+
* unconventional slug segment (e.g. containing a space, or a dot) still parses and still
|
|
52
|
+
* receives the `Slug` brand. Callers that need a validated slug must run the result
|
|
53
|
+
* through `parseSlug` themselves; this function's contract is "split the filename
|
|
54
|
+
* grammar apart," not "validate every part." `listCollectionEntries` (content-listing.ts)
|
|
55
|
+
* is exactly such a caller that does NOT re-validate — it lists the file and computes a
|
|
56
|
+
* `urlPath` for it regardless — so a dotted slug listed this way builds and gets
|
|
57
|
+
* advertised (sitemap, `generateStaticParams`) but can never be read back through
|
|
58
|
+
* `readByUrlPath`, which does run every URL-resolution candidate through `parseSlug`.
|
|
59
|
+
* `static/index.ts`'s `assertRoutableSlugs` is the build-time guard that catches this.
|
|
60
|
+
*/
|
|
61
|
+
export const parseTypedFilename = (filename, entryTypes) => {
|
|
62
|
+
// Reject dotfiles outright (matching extractEntryTypeFromFilename's guard in
|
|
63
|
+
// content-id-index.ts): a leading dot can never be a legal entry type, and this
|
|
64
|
+
// is exactly the shape of the files a structural (no-entryTypes) parse would
|
|
65
|
+
// otherwise misparse -- e.g. '.hidden.file.aB3cD4eF5gH6.md' -> potentialType ''.
|
|
66
|
+
if (filename.startsWith('.'))
|
|
67
|
+
return null;
|
|
68
|
+
// Remove extension
|
|
69
|
+
const lastDot = filename.lastIndexOf('.');
|
|
70
|
+
if (lastDot === -1)
|
|
71
|
+
return null;
|
|
72
|
+
const nameWithoutExt = filename.slice(0, lastDot);
|
|
73
|
+
// Parse: {type}.{slug}.{id}
|
|
74
|
+
const parts = nameWithoutExt.split('.');
|
|
75
|
+
if (parts.length < 3)
|
|
76
|
+
return null;
|
|
77
|
+
const potentialType = parts[0];
|
|
78
|
+
// When a known-types list is supplied, the first segment must match one of
|
|
79
|
+
// them. Without it, any non-empty first segment is accepted as the type.
|
|
80
|
+
if (entryTypes && !entryTypes.some((e) => e.name === potentialType)) {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
const id = parts[parts.length - 1];
|
|
84
|
+
if (!isValidId(id))
|
|
85
|
+
return null;
|
|
86
|
+
const slug = parts.slice(1, -1).join('.').toLowerCase();
|
|
87
|
+
return {
|
|
88
|
+
type: potentialType,
|
|
89
|
+
slug: slug,
|
|
90
|
+
id: id,
|
|
91
|
+
};
|
|
92
|
+
};
|