canopycms 0.0.16 → 0.0.17
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/dist/ai/generate.js +3 -3
- package/dist/ai/handler.js +5 -5
- package/dist/ai/index.js +3 -3
- package/dist/ai/resolve-branch.js +2 -2
- package/dist/api/__test__/mock-client.js +1 -1
- package/dist/api/assets.js +1 -1
- package/dist/api/branch-merge.js +3 -3
- package/dist/api/branch-review.js +4 -4
- package/dist/api/branch-status.js +8 -8
- package/dist/api/branch-withdraw.js +5 -5
- package/dist/api/branch.js +9 -9
- package/dist/api/comments.js +4 -4
- package/dist/api/content.js +5 -5
- package/dist/api/entries.js +8 -8
- package/dist/api/github-sync.js +3 -3
- package/dist/api/groups.js +4 -4
- package/dist/api/guards.js +1 -1
- package/dist/api/index.js +3 -3
- package/dist/api/permissions.js +4 -4
- package/dist/api/reference-options.js +5 -5
- package/dist/api/resolve-references.js +4 -4
- package/dist/api/route-builder.js +1 -1
- package/dist/api/schema.js +5 -5
- package/dist/api/settings-helpers.js +1 -1
- package/dist/api/user.js +1 -1
- package/dist/api/validators.js +3 -3
- package/dist/asset-store.js +1 -1
- package/dist/auth/cache.js +2 -2
- package/dist/auth/caching-auth-plugin.js +1 -1
- package/dist/auth/file-based-auth-cache.js +1 -1
- package/dist/auth/index.js +1 -1
- package/dist/authorization/branch.js +1 -1
- package/dist/authorization/content.js +3 -3
- package/dist/authorization/groups/index.js +2 -2
- package/dist/authorization/groups/loader.js +4 -4
- package/dist/authorization/index.js +8 -8
- package/dist/authorization/path.js +1 -1
- package/dist/authorization/permissions/index.js +2 -2
- package/dist/authorization/permissions/loader.js +3 -3
- package/dist/authorization/permissions/schema.js +1 -1
- package/dist/authorization/test-utils.js +1 -1
- package/dist/authorization/validation.js +1 -1
- package/dist/branch-metadata.js +3 -3
- package/dist/branch-registry.js +2 -2
- package/dist/branch-schema-cache.js +2 -2
- package/dist/branch-workspace.js +6 -6
- package/dist/build/generate-ai-content.js +4 -4
- package/dist/build/index.js +1 -1
- package/dist/cli/cli.js +5 -5
- package/dist/cli/generate-ai-content.js +1 -9
- package/dist/cli/init.js +2 -10
- package/dist/cli/sync.js +1 -1
- package/dist/client.js +9 -9
- package/dist/config/flatten.js +2 -2
- package/dist/config/helpers.js +3 -3
- package/dist/config/index.js +9 -9
- package/dist/config/schemas/collection.js +1 -1
- package/dist/config/schemas/config.js +2 -2
- package/dist/config/schemas/field.js +1 -1
- package/dist/config/validation.js +2 -2
- package/dist/config-test.js +2 -2
- package/dist/config.js +2 -2
- package/dist/content-id-index.js +2 -2
- package/dist/content-listing.js +7 -7
- package/dist/content-reader.js +5 -5
- package/dist/content-store.js +5 -5
- package/dist/content-tree.js +1 -1
- package/dist/context.js +6 -6
- package/dist/editor/BranchManager.js +4 -4
- package/dist/editor/CanopyEditor.js +3 -3
- package/dist/editor/CanopyEditorPage.js +1 -1
- package/dist/editor/CommentsPanel.js +1 -1
- package/dist/editor/Editor.js +18 -18
- package/dist/editor/EntryNavigator.js +1 -1
- package/dist/editor/FormRenderer.js +12 -12
- package/dist/editor/GroupManager.js +1 -1
- package/dist/editor/PermissionManager.js +1 -1
- package/dist/editor/client-reference-resolver.js +1 -1
- package/dist/editor/comments/BranchComments.js +1 -1
- package/dist/editor/comments/EntryComments.js +1 -1
- package/dist/editor/comments/FieldWrapper.js +1 -1
- package/dist/editor/comments/InlineCommentThread.js +1 -1
- package/dist/editor/comments/ThreadCarousel.js +1 -1
- package/dist/editor/components/EditorHeader.js +1 -1
- package/dist/editor/components/UserBadge.js +1 -1
- package/dist/editor/components/index.js +3 -3
- package/dist/editor/context/ApiClientContext.js +1 -1
- package/dist/editor/context/index.js +2 -2
- package/dist/editor/editor-utils.js +1 -1
- package/dist/editor/fields/BlockField.js +1 -1
- package/dist/editor/fields/ObjectField.js +1 -1
- package/dist/editor/fields/ReferenceField.js +1 -1
- package/dist/editor/group-manager/GroupCard.js +1 -1
- package/dist/editor/group-manager/InternalGroupsTab.js +1 -1
- package/dist/editor/group-manager/MemberList.js +1 -1
- package/dist/editor/group-manager/index.js +9 -9
- package/dist/editor/hooks/__test__/test-utils.js +3 -3
- package/dist/editor/hooks/index.js +11 -11
- package/dist/editor/hooks/useBranchActions.js +1 -1
- package/dist/editor/hooks/useBranchManager.js +1 -1
- package/dist/editor/hooks/useCommentSystem.js +2 -2
- package/dist/editor/hooks/useDraftManager.js +1 -1
- package/dist/editor/hooks/useEntryManager.js +3 -3
- package/dist/editor/hooks/useGroupManager.js +1 -1
- package/dist/editor/hooks/usePermissionManager.js +1 -1
- package/dist/editor/hooks/useReferenceResolution.js +1 -1
- package/dist/editor/hooks/useSchemaManager.js +1 -1
- package/dist/editor/hooks/useUserContext.js +1 -1
- package/dist/editor/permission-manager/PermissionEditor.js +4 -4
- package/dist/editor/permission-manager/PermissionLevelBadge.js +1 -1
- package/dist/editor/permission-manager/PermissionTree.js +3 -3
- package/dist/editor/permission-manager/UserSelector.js +1 -1
- package/dist/editor/permission-manager/hooks/usePermissionTree.js +2 -2
- package/dist/editor/permission-manager/index.js +6 -6
- package/dist/editor/preview-bridge.js +1 -1
- package/dist/editor/schema-editor/CollectionEditor.js +2 -2
- package/dist/editor/schema-editor/index.js +2 -2
- package/dist/entry-schema-registry.js +3 -3
- package/dist/git-manager.js +4 -4
- package/dist/github-service.js +1 -1
- package/dist/http/handler.js +7 -7
- package/dist/http/index.js +3 -3
- package/dist/http/router.js +12 -12
- package/dist/id.js +1 -1
- package/dist/index.js +6 -6
- package/dist/operating-mode/client-unsafe-strategy.js +2 -2
- package/dist/operating-mode/client.js +1 -1
- package/dist/operating-mode/index.js +2 -2
- package/dist/paths/branch.js +1 -1
- package/dist/paths/index.js +6 -6
- package/dist/paths/test-utils.js +1 -1
- package/dist/paths/validation.js +1 -1
- package/dist/reference-resolver.js +1 -1
- package/dist/schema/index.js +2 -2
- package/dist/schema/meta-loader.js +1 -1
- package/dist/schema/resolver.js +1 -1
- package/dist/schema/schema-store.js +4 -4
- package/dist/server.js +13 -13
- package/dist/services.js +12 -12
- package/dist/settings-branch-utils.js +1 -1
- package/dist/settings-workspace.js +3 -3
- package/dist/task-queue/index.js +1 -1
- package/dist/task-queue/task-queue.js +1 -1
- package/dist/user.js +1 -1
- package/dist/utils/fs.js +1 -1
- package/dist/validation/reference-validator.js +2 -2
- package/dist/worker/cms-worker.js +5 -5
- package/dist/worker/task-queue-config.js +1 -1
- package/dist/worker/task-queue.js +2 -2
- package/package.json +1 -1
package/dist/ai/generate.js
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import path from 'node:path';
|
|
9
9
|
import { minimatch } from 'minimatch';
|
|
10
|
-
import { extractEntryTypeFromFilename } from '../content-id-index';
|
|
11
|
-
import { getErrorMessage } from '../utils/error';
|
|
12
|
-
import { entryToMarkdown } from './json-to-markdown';
|
|
10
|
+
import { extractEntryTypeFromFilename } from '../content-id-index.js';
|
|
11
|
+
import { getErrorMessage } from '../utils/error.js';
|
|
12
|
+
import { entryToMarkdown } from './json-to-markdown.js';
|
|
13
13
|
/**
|
|
14
14
|
* Generate all AI content from the content store.
|
|
15
15
|
*
|
package/dist/ai/handler.js
CHANGED
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
* export const GET = createAIContentHandler({ config, entrySchemaRegistry })
|
|
11
11
|
* ```
|
|
12
12
|
*/
|
|
13
|
-
import { ContentStore } from '../content-store';
|
|
14
|
-
import { BranchSchemaCache } from '../branch-schema-cache';
|
|
15
|
-
import { getErrorMessage } from '../utils/error';
|
|
16
|
-
import { generateAIContent } from './generate';
|
|
17
|
-
import { resolveBranchRoot } from './resolve-branch';
|
|
13
|
+
import { ContentStore } from '../content-store.js';
|
|
14
|
+
import { BranchSchemaCache } from '../branch-schema-cache.js';
|
|
15
|
+
import { getErrorMessage } from '../utils/error.js';
|
|
16
|
+
import { generateAIContent } from './generate.js';
|
|
17
|
+
import { resolveBranchRoot } from './resolve-branch.js';
|
|
18
18
|
/**
|
|
19
19
|
* Create a Next.js GET handler for serving AI content.
|
|
20
20
|
*
|
package/dist/ai/index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Provides AI-ready content generation: config helpers,
|
|
5
5
|
* route handler for runtime serving, and content types.
|
|
6
6
|
*/
|
|
7
|
-
export { defineAIContentConfig } from './types';
|
|
8
|
-
export { createAIContentHandler } from './handler';
|
|
9
|
-
export { generateAIContent } from './generate';
|
|
7
|
+
export { defineAIContentConfig } from './types.js';
|
|
8
|
+
export { createAIContentHandler } from './handler.js';
|
|
9
|
+
export { generateAIContent } from './generate.js';
|
|
10
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Shared branch root resolution for AI content generation.
|
|
3
3
|
* Used by both the route handler and build utility.
|
|
4
4
|
*/
|
|
5
|
-
import { loadOrCreateBranchContext } from '../branch-workspace';
|
|
6
|
-
import { isDeployedStatic } from '../build-mode';
|
|
5
|
+
import { loadOrCreateBranchContext } from '../branch-workspace.js';
|
|
6
|
+
import { isDeployedStatic } from '../build-mode.js';
|
|
7
7
|
/**
|
|
8
8
|
* Resolve the branch root directory for reading content.
|
|
9
9
|
*
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Do not edit this file manually - changes will be overwritten.
|
|
6
6
|
*/
|
|
7
7
|
import { vi } from 'vitest';
|
|
8
|
-
import { createLogicalPath } from '../../paths';
|
|
8
|
+
import { createLogicalPath } from '../../paths/index.js';
|
|
9
9
|
/**
|
|
10
10
|
* Create a mock API client with all methods as vi.fn().
|
|
11
11
|
*/
|
package/dist/api/assets.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { defineEndpoint } from './route-builder';
|
|
2
|
+
import { defineEndpoint } from './route-builder.js';
|
|
3
3
|
// ============================================================================
|
|
4
4
|
// Zod Schemas for Validation
|
|
5
5
|
// ============================================================================
|
package/dist/api/branch-merge.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { branchNameSchema } from './validators';
|
|
3
|
-
import { getBranchMetadataFileManager } from '../branch-metadata';
|
|
4
|
-
import { defineEndpoint } from './route-builder';
|
|
2
|
+
import { branchNameSchema } from './validators.js';
|
|
3
|
+
import { getBranchMetadataFileManager } from '../branch-metadata.js';
|
|
4
|
+
import { defineEndpoint } from './route-builder.js';
|
|
5
5
|
const markAsMergedParamsSchema = z.object({
|
|
6
6
|
branch: branchNameSchema,
|
|
7
7
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { branchNameSchema } from './validators';
|
|
3
|
-
import { getBranchMetadataFileManager } from '../branch-metadata';
|
|
4
|
-
import { defineEndpoint } from './route-builder';
|
|
5
|
-
import { syncConvertToDraft } from './github-sync';
|
|
2
|
+
import { branchNameSchema } from './validators.js';
|
|
3
|
+
import { getBranchMetadataFileManager } from '../branch-metadata.js';
|
|
4
|
+
import { defineEndpoint } from './route-builder.js';
|
|
5
|
+
import { syncConvertToDraft } from './github-sync.js';
|
|
6
6
|
const branchParamSchema = z.object({
|
|
7
7
|
branch: branchNameSchema,
|
|
8
8
|
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { branchNameSchema } from './validators';
|
|
3
|
-
import { getBranchMetadataFileManager } from '../branch-metadata';
|
|
4
|
-
import { withdrawBranch } from './branch-withdraw';
|
|
5
|
-
import { requestChanges, approveBranch } from './branch-review';
|
|
6
|
-
import { markAsMerged } from './branch-merge';
|
|
7
|
-
import { defineEndpoint } from './route-builder';
|
|
8
|
-
import { canPerformWorkflowAction } from '../authorization';
|
|
9
|
-
import { syncSubmitPr } from './github-sync';
|
|
2
|
+
import { branchNameSchema } from './validators.js';
|
|
3
|
+
import { getBranchMetadataFileManager } from '../branch-metadata.js';
|
|
4
|
+
import { withdrawBranch } from './branch-withdraw.js';
|
|
5
|
+
import { requestChanges, approveBranch } from './branch-review.js';
|
|
6
|
+
import { markAsMerged } from './branch-merge.js';
|
|
7
|
+
import { defineEndpoint } from './route-builder.js';
|
|
8
|
+
import { canPerformWorkflowAction } from '../authorization/index.js';
|
|
9
|
+
import { syncSubmitPr } from './github-sync.js';
|
|
10
10
|
// ============================================================================
|
|
11
11
|
// Zod Schemas for Validation
|
|
12
12
|
// ============================================================================
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { branchNameSchema } from './validators';
|
|
3
|
-
import { getBranchMetadataFileManager } from '../branch-metadata';
|
|
4
|
-
import { defineEndpoint } from './route-builder';
|
|
5
|
-
import { canPerformWorkflowAction } from '../authorization';
|
|
6
|
-
import { syncConvertToDraft } from './github-sync';
|
|
2
|
+
import { branchNameSchema } from './validators.js';
|
|
3
|
+
import { getBranchMetadataFileManager } from '../branch-metadata.js';
|
|
4
|
+
import { defineEndpoint } from './route-builder.js';
|
|
5
|
+
import { canPerformWorkflowAction } from '../authorization/index.js';
|
|
6
|
+
import { syncConvertToDraft } from './github-sync.js';
|
|
7
7
|
const branchParamSchema = z.object({
|
|
8
8
|
branch: branchNameSchema,
|
|
9
9
|
});
|
package/dist/api/branch.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import fs from 'node:fs/promises';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { BranchWorkspaceManager } from '../branch-workspace';
|
|
5
|
-
import { getBranchMetadataFileManager } from '../branch-metadata';
|
|
6
|
-
import { defineEndpoint } from './route-builder';
|
|
7
|
-
import { createDebugLogger } from '../utils/debug';
|
|
8
|
-
import { clientOperatingStrategy } from '../operating-mode';
|
|
9
|
-
import { isNotFoundError, getErrorMessage } from '../utils/error';
|
|
10
|
-
import { branchNameSchema } from './validators';
|
|
4
|
+
import { BranchWorkspaceManager } from '../branch-workspace.js';
|
|
5
|
+
import { getBranchMetadataFileManager } from '../branch-metadata.js';
|
|
6
|
+
import { defineEndpoint } from './route-builder.js';
|
|
7
|
+
import { createDebugLogger } from '../utils/debug.js';
|
|
8
|
+
import { clientOperatingStrategy } from '../operating-mode/index.js';
|
|
9
|
+
import { isNotFoundError, getErrorMessage } from '../utils/error.js';
|
|
10
|
+
import { branchNameSchema } from './validators.js';
|
|
11
11
|
const log = createDebugLogger({ prefix: 'BranchAPI' });
|
|
12
12
|
// ============================================================================
|
|
13
13
|
// Zod Schemas for Validation
|
|
@@ -30,8 +30,8 @@ const updateBranchAccessBodySchema = z.object({
|
|
|
30
30
|
allowedUsers: z.array(z.string()).optional(),
|
|
31
31
|
allowedGroups: z.array(z.string()).optional(),
|
|
32
32
|
});
|
|
33
|
-
import { isPrivileged, isAdmin, loadPathPermissions } from '../authorization';
|
|
34
|
-
import { operatingStrategy } from '../operating-mode';
|
|
33
|
+
import { isPrivileged, isAdmin, loadPathPermissions } from '../authorization/index.js';
|
|
34
|
+
import { operatingStrategy } from '../operating-mode/index.js';
|
|
35
35
|
/**
|
|
36
36
|
* Check if a user can create branches.
|
|
37
37
|
* Returns true if:
|
package/dist/api/comments.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { CommentStore } from '../comment-store';
|
|
3
|
-
import { isReviewer } from '../authorization';
|
|
4
|
-
import { defineEndpoint } from './route-builder';
|
|
5
|
-
import { branchNameSchema, logicalPathSchema } from './validators';
|
|
2
|
+
import { CommentStore } from '../comment-store.js';
|
|
3
|
+
import { isReviewer } from '../authorization/index.js';
|
|
4
|
+
import { defineEndpoint } from './route-builder.js';
|
|
5
|
+
import { branchNameSchema, logicalPathSchema } from './validators.js';
|
|
6
6
|
// ============================================================================
|
|
7
7
|
// Zod Schemas for Validation
|
|
8
8
|
// ============================================================================
|
package/dist/api/content.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { ContentStore, ContentStoreError } from '../content-store';
|
|
3
|
-
import { defineEndpoint } from './route-builder';
|
|
4
|
-
import { ReferenceValidator } from '../validation/reference-validator';
|
|
5
|
-
import { branchNameSchema, logicalPathSchema, slugSchema } from './validators';
|
|
6
|
-
import { isNotFoundError } from '../utils/error';
|
|
2
|
+
import { ContentStore, ContentStoreError } from '../content-store.js';
|
|
3
|
+
import { defineEndpoint } from './route-builder.js';
|
|
4
|
+
import { ReferenceValidator } from '../validation/reference-validator.js';
|
|
5
|
+
import { branchNameSchema, logicalPathSchema, slugSchema } from './validators.js';
|
|
6
|
+
import { isNotFoundError } from '../utils/error.js';
|
|
7
7
|
// ============================================================================
|
|
8
8
|
// Zod Schemas for Validation
|
|
9
9
|
// ============================================================================
|
package/dist/api/entries.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { ContentStore, ContentStoreError } from '../content-store';
|
|
3
|
-
import { defineEndpoint } from './route-builder';
|
|
4
|
-
import { normalizeFilesystemPath, parseSlug, parseLogicalPath } from '../paths';
|
|
5
|
-
import { isNotFoundError } from '../utils/error';
|
|
6
|
-
import { resolveEntryTitle } from '../utils/title-field';
|
|
7
|
-
import { branchNameSchema, logicalPathSchema } from './validators';
|
|
8
|
-
import { SchemaOps } from '../schema/schema-store';
|
|
9
|
-
import { listCollectionEntries as listCollectionEntriesShared, sortByOrder, } from '../content-listing';
|
|
2
|
+
import { ContentStore, ContentStoreError } from '../content-store.js';
|
|
3
|
+
import { defineEndpoint } from './route-builder.js';
|
|
4
|
+
import { normalizeFilesystemPath, parseSlug, parseLogicalPath } from '../paths/index.js';
|
|
5
|
+
import { isNotFoundError } from '../utils/error.js';
|
|
6
|
+
import { resolveEntryTitle } from '../utils/title-field.js';
|
|
7
|
+
import { branchNameSchema, logicalPathSchema } from './validators.js';
|
|
8
|
+
import { SchemaOps } from '../schema/schema-store.js';
|
|
9
|
+
import { listCollectionEntries as listCollectionEntriesShared, sortByOrder, } from '../content-listing.js';
|
|
10
10
|
// ============================================================================
|
|
11
11
|
// Zod Schemas for Validation
|
|
12
12
|
// ============================================================================
|
package/dist/api/github-sync.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { enqueueTask } from '../worker/task-queue';
|
|
2
|
-
import { getTaskQueueDir } from '../worker/task-queue-config';
|
|
3
|
-
import { clientOperatingStrategy } from '../operating-mode';
|
|
1
|
+
import { enqueueTask } from '../worker/task-queue.js';
|
|
2
|
+
import { getTaskQueueDir } from '../worker/task-queue-config.js';
|
|
3
|
+
import { clientOperatingStrategy } from '../operating-mode/index.js';
|
|
4
4
|
/**
|
|
5
5
|
* Submit a branch: create or update a PR.
|
|
6
6
|
* Uses githubService directly if available, otherwise queues a task for the worker.
|
package/dist/api/groups.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { loadInternalGroups, saveInternalGroups, loadGroupsFile, RESERVED_GROUPS, isReservedGroup, } from '../authorization';
|
|
3
|
-
import { defineEndpoint } from './route-builder';
|
|
4
|
-
import { getSettingsBranchContext, commitSettings } from './settings-helpers';
|
|
5
|
-
import { generateId } from '../id';
|
|
2
|
+
import { loadInternalGroups, saveInternalGroups, loadGroupsFile, RESERVED_GROUPS, isReservedGroup, } from '../authorization/index.js';
|
|
3
|
+
import { defineEndpoint } from './route-builder.js';
|
|
4
|
+
import { getSettingsBranchContext, commitSettings } from './settings-helpers.js';
|
|
5
|
+
import { generateId } from '../id.js';
|
|
6
6
|
// ============================================================================
|
|
7
7
|
// Zod Schemas for Validation
|
|
8
8
|
// ============================================================================
|
package/dist/api/guards.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* })
|
|
16
16
|
* ```
|
|
17
17
|
*/
|
|
18
|
-
import { isAdmin, isReviewer, isPrivileged } from '../authorization/helpers';
|
|
18
|
+
import { isAdmin, isReviewer, isPrivileged } from '../authorization/helpers.js';
|
|
19
19
|
// ============================================================================
|
|
20
20
|
// Guard runner implementations
|
|
21
21
|
// ============================================================================
|
package/dist/api/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Content API uses path-based routing now - no separate params/body types exported
|
|
2
2
|
// Export route definitions
|
|
3
|
-
export { USER_ROUTES } from './user';
|
|
3
|
+
export { USER_ROUTES } from './user.js';
|
|
4
4
|
// Note: SCHEMA_ROUTES is not exported here because it imports server-only code (fs module).
|
|
5
|
-
// Import it directly from './schema' in server-side code when needed.
|
|
5
|
+
// Import it directly from './schema.js' in server-side code when needed.
|
|
6
6
|
// Export client
|
|
7
|
-
export { CanopyApiClient, createApiClient } from './client';
|
|
7
|
+
export { CanopyApiClient, createApiClient } from './client.js';
|
|
8
8
|
//# sourceMappingURL=index.js.map
|
package/dist/api/permissions.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { loadPathPermissions, savePathPermissions, loadPermissionsFile } from '../authorization';
|
|
3
|
-
import { permissionPathSchema } from './validators';
|
|
4
|
-
import { defineEndpoint } from './route-builder';
|
|
5
|
-
import { getSettingsBranchContext, commitSettings } from './settings-helpers';
|
|
2
|
+
import { loadPathPermissions, savePathPermissions, loadPermissionsFile } from '../authorization/index.js';
|
|
3
|
+
import { permissionPathSchema } from './validators.js';
|
|
4
|
+
import { defineEndpoint } from './route-builder.js';
|
|
5
|
+
import { getSettingsBranchContext, commitSettings } from './settings-helpers.js';
|
|
6
6
|
// ============================================================================
|
|
7
7
|
// Zod Schemas for Validation
|
|
8
8
|
// ============================================================================
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { ContentStore } from '../content-store';
|
|
3
|
-
import { defineEndpoint } from './route-builder';
|
|
4
|
-
import { ReferenceResolver } from '../reference-resolver';
|
|
5
|
-
import { parseLogicalPath } from '../paths';
|
|
6
|
-
import { branchNameSchema } from './validators';
|
|
2
|
+
import { ContentStore } from '../content-store.js';
|
|
3
|
+
import { defineEndpoint } from './route-builder.js';
|
|
4
|
+
import { ReferenceResolver } from '../reference-resolver.js';
|
|
5
|
+
import { parseLogicalPath } from '../paths/index.js';
|
|
6
|
+
import { branchNameSchema } from './validators.js';
|
|
7
7
|
// ============================================================================
|
|
8
8
|
// Zod Schemas for Validation
|
|
9
9
|
// ============================================================================
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { ContentStore } from '../content-store';
|
|
3
|
-
import { defineEndpoint } from './route-builder';
|
|
4
|
-
import { ReferenceResolver } from '../reference-resolver';
|
|
5
|
-
import { branchNameSchema, contentIdSchema } from './validators';
|
|
2
|
+
import { ContentStore } from '../content-store.js';
|
|
3
|
+
import { defineEndpoint } from './route-builder.js';
|
|
4
|
+
import { ReferenceResolver } from '../reference-resolver.js';
|
|
5
|
+
import { branchNameSchema, contentIdSchema } from './validators.js';
|
|
6
6
|
// ============================================================================
|
|
7
7
|
// Zod Schemas for Validation
|
|
8
8
|
// ============================================================================
|
package/dist/api/schema.js
CHANGED
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import { z } from 'zod';
|
|
13
13
|
import path from 'node:path';
|
|
14
|
-
import { defineEndpoint } from './route-builder';
|
|
15
|
-
import { getErrorMessage } from '../utils/error';
|
|
16
|
-
import { branchNameSchema, logicalPathSchema } from './validators';
|
|
17
|
-
import { SchemaOps, createCollectionInputSchema, updateCollectionInputSchema, entryTypeInputSchema, updateEntryTypeInputSchema, } from '../schema/schema-store';
|
|
18
|
-
import { parseLogicalPath } from '../paths';
|
|
14
|
+
import { defineEndpoint } from './route-builder.js';
|
|
15
|
+
import { getErrorMessage } from '../utils/error.js';
|
|
16
|
+
import { branchNameSchema, logicalPathSchema } from './validators.js';
|
|
17
|
+
import { SchemaOps, createCollectionInputSchema, updateCollectionInputSchema, entryTypeInputSchema, updateEntryTypeInputSchema, } from '../schema/schema-store.js';
|
|
18
|
+
import { parseLogicalPath } from '../paths/index.js';
|
|
19
19
|
/**
|
|
20
20
|
* Resolve the schemaRef for an entry type. Uses the explicit schemaRef if set,
|
|
21
21
|
* otherwise does a reverse lookup in the registry by matching the schema array.
|
package/dist/api/user.js
CHANGED
package/dist/api/validators.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Usage:
|
|
8
8
|
* ```ts
|
|
9
|
-
* import { branchNameSchema, logicalPathSchema } from './validators'
|
|
9
|
+
* import { branchNameSchema, logicalPathSchema } from './validators.js'
|
|
10
10
|
*
|
|
11
11
|
* const paramsSchema = z.object({
|
|
12
12
|
* branch: branchNameSchema,
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
* ```
|
|
21
21
|
*/
|
|
22
22
|
import { z } from 'zod';
|
|
23
|
-
import { parseBranchName, parseLogicalPath, parseContentId, parseSlug, } from '../paths';
|
|
24
|
-
import { parsePermissionPath } from '../authorization';
|
|
23
|
+
import { parseBranchName, parseLogicalPath, parseContentId, parseSlug, } from '../paths/index.js';
|
|
24
|
+
import { parsePermissionPath } from '../authorization/index.js';
|
|
25
25
|
/**
|
|
26
26
|
* Zod schema for BranchName - validates git branch naming rules and brands.
|
|
27
27
|
*
|
package/dist/asset-store.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs from 'node:fs/promises';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import { isNotFoundError } from './utils/error';
|
|
3
|
+
import { isNotFoundError } from './utils/error.js';
|
|
4
4
|
const normalizeKey = (key) => key.replace(/^\/+/, '');
|
|
5
5
|
/**
|
|
6
6
|
* Local filesystem asset store for dev and tests. In production, swap with S3 adapter.
|
package/dist/auth/cache.js
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
* These use node:fs/promises and must NOT be imported in client bundles.
|
|
4
4
|
* Use 'canopycms/auth/cache' as the import path.
|
|
5
5
|
*/
|
|
6
|
-
export { FileBasedAuthCache, writeAuthCacheSnapshot } from './file-based-auth-cache';
|
|
7
|
-
export { CachingAuthPlugin } from './caching-auth-plugin';
|
|
6
|
+
export { FileBasedAuthCache, writeAuthCacheSnapshot } from './file-based-auth-cache.js';
|
|
7
|
+
export { CachingAuthPlugin } from './caching-auth-plugin.js';
|
|
8
8
|
//# sourceMappingURL=cache.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs from 'node:fs/promises';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import { createDebugLogger } from '../utils/debug';
|
|
3
|
+
import { createDebugLogger } from '../utils/debug.js';
|
|
4
4
|
const log = createDebugLogger({ prefix: 'FileBasedAuthCache' });
|
|
5
5
|
/**
|
|
6
6
|
* Resolve the active cache directory.
|
package/dist/auth/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { isCanopyRequest, isHeadersLike, extractHeaders, validateAuthContext, } from './context-helpers';
|
|
1
|
+
export { isCanopyRequest, isHeadersLike, extractHeaders, validateAuthContext, } from './context-helpers.js';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Usage:
|
|
8
8
|
* ```ts
|
|
9
|
-
* import { checkContentAccess } from './authorization'
|
|
9
|
+
* import { checkContentAccess } from './authorization.js'
|
|
10
10
|
*
|
|
11
11
|
* const result = await checkContentAccess(deps, context, branchRoot, 'content/posts/my-post.mdx', user, 'edit')
|
|
12
12
|
* if (result.allowed) {
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
* }
|
|
15
15
|
* ```
|
|
16
16
|
*/
|
|
17
|
-
import { operatingStrategy } from '../operating-mode';
|
|
18
|
-
import { createCheckPathAccess } from './path';
|
|
17
|
+
import { operatingStrategy } from '../operating-mode/index.js';
|
|
18
|
+
import { createCheckPathAccess } from './path.js';
|
|
19
19
|
/**
|
|
20
20
|
* Check content access by evaluating both branch and path permissions.
|
|
21
21
|
* Path permissions are loaded dynamically from the branch root.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Groups module exports
|
|
3
3
|
*/
|
|
4
|
-
export { GroupsFileSchema, createDefaultGroupsFile, } from './schema';
|
|
5
|
-
export { loadGroupsFile, loadInternalGroups, saveInternalGroups } from './loader';
|
|
4
|
+
export { GroupsFileSchema, createDefaultGroupsFile, } from './schema.js';
|
|
5
|
+
export { loadGroupsFile, loadInternalGroups, saveInternalGroups } from './loader.js';
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
* Handles loading and saving internal groups from the filesystem.
|
|
5
5
|
*/
|
|
6
6
|
import { promises as fs } from 'node:fs';
|
|
7
|
-
import { GroupsFileSchema } from './schema';
|
|
8
|
-
import { operatingStrategy } from '../../operating-mode';
|
|
9
|
-
import { RESERVED_GROUPS } from '../helpers';
|
|
10
|
-
import { atomicWriteFile } from '../../utils/atomic-write';
|
|
7
|
+
import { GroupsFileSchema } from './schema.js';
|
|
8
|
+
import { operatingStrategy } from '../../operating-mode/index.js';
|
|
9
|
+
import { RESERVED_GROUPS } from '../helpers.js';
|
|
10
|
+
import { atomicWriteFile } from '../../utils/atomic-write.js';
|
|
11
11
|
/**
|
|
12
12
|
* Get the appropriate groups file path based on mode
|
|
13
13
|
*/
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* For most use cases, use `checkContentAccess` which handles both branch and path permissions:
|
|
9
9
|
*
|
|
10
10
|
* ```ts
|
|
11
|
-
* import { checkContentAccess } from './authorization'
|
|
11
|
+
* import { checkContentAccess } from './authorization.js'
|
|
12
12
|
*
|
|
13
13
|
* const result = await checkContentAccess(deps, context, branchRoot, 'content/posts/post.mdx', user, 'edit')
|
|
14
14
|
* if (result.allowed) {
|
|
@@ -26,17 +26,17 @@
|
|
|
26
26
|
* - `groups/` - Groups file schema and loader
|
|
27
27
|
*/
|
|
28
28
|
// Validation
|
|
29
|
-
export { parsePermissionPath } from './validation';
|
|
29
|
+
export { parsePermissionPath } from './validation.js';
|
|
30
30
|
// Main content access (recommended for most cases)
|
|
31
|
-
export { checkContentAccess, createCheckContentAccess } from './content';
|
|
31
|
+
export { checkContentAccess, createCheckContentAccess } from './content.js';
|
|
32
32
|
// Branch-level access
|
|
33
|
-
export { checkBranchAccessWithDefault, createCheckBranchAccess, canPerformWorkflowAction, } from './branch';
|
|
33
|
+
export { checkBranchAccessWithDefault, createCheckBranchAccess, canPerformWorkflowAction, } from './branch.js';
|
|
34
34
|
// Path-level access
|
|
35
|
-
export { checkPathAccess, createCheckPathAccess } from './path';
|
|
35
|
+
export { checkPathAccess, createCheckPathAccess } from './path.js';
|
|
36
36
|
// Helper functions
|
|
37
|
-
export { RESERVED_GROUPS, isReservedGroup, isAdmin, isReviewer, isPrivileged, } from './helpers';
|
|
37
|
+
export { RESERVED_GROUPS, isReservedGroup, isAdmin, isReviewer, isPrivileged, } from './helpers.js';
|
|
38
38
|
// Permissions file handling
|
|
39
|
-
export { PermissionsFileSchema, createDefaultPermissionsFile, loadPermissionsFile, loadPathPermissions, savePathPermissions, ensurePermissionsFile, } from './permissions';
|
|
39
|
+
export { PermissionsFileSchema, createDefaultPermissionsFile, loadPermissionsFile, loadPathPermissions, savePathPermissions, ensurePermissionsFile, } from './permissions/index.js';
|
|
40
40
|
// Groups file handling
|
|
41
|
-
export { GroupsFileSchema, createDefaultGroupsFile, loadGroupsFile, loadInternalGroups, saveInternalGroups, } from './groups';
|
|
41
|
+
export { GroupsFileSchema, createDefaultGroupsFile, loadGroupsFile, loadInternalGroups, saveInternalGroups, } from './groups/index.js';
|
|
42
42
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Permissions module exports
|
|
3
3
|
*/
|
|
4
|
-
export { PermissionsFileSchema, createDefaultPermissionsFile } from './schema';
|
|
5
|
-
export { loadPermissionsFile, loadPathPermissions, savePathPermissions, ensurePermissionsFile, } from './loader';
|
|
4
|
+
export { PermissionsFileSchema, createDefaultPermissionsFile } from './schema.js';
|
|
5
|
+
export { loadPermissionsFile, loadPathPermissions, savePathPermissions, ensurePermissionsFile, } from './loader.js';
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* Handles loading and saving path permissions from the filesystem.
|
|
5
5
|
*/
|
|
6
6
|
import fs from 'node:fs/promises';
|
|
7
|
-
import { PermissionsFileSchema } from './schema';
|
|
8
|
-
import { operatingStrategy } from '../../operating-mode';
|
|
9
|
-
import { atomicWriteFile } from '../../utils/atomic-write';
|
|
7
|
+
import { PermissionsFileSchema } from './schema.js';
|
|
8
|
+
import { operatingStrategy } from '../../operating-mode/index.js';
|
|
9
|
+
import { atomicWriteFile } from '../../utils/atomic-write.js';
|
|
10
10
|
/**
|
|
11
11
|
* Get the appropriate permissions file path based on mode
|
|
12
12
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Schema for permissions.json file
|
|
3
3
|
*/
|
|
4
4
|
import { z } from 'zod';
|
|
5
|
-
import { parsePermissionPath } from '../validation';
|
|
5
|
+
import { parsePermissionPath } from '../validation.js';
|
|
6
6
|
const permissionTargetSchema = z.object({
|
|
7
7
|
allowedUsers: z.array(z.string()).optional(),
|
|
8
8
|
allowedGroups: z.array(z.string()).optional(),
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* // In test files only:
|
|
9
|
-
* import { unsafeAsPermissionPath } from '../authorization/test-utils'
|
|
9
|
+
* import { unsafeAsPermissionPath } from '../authorization/test-utils.js'
|
|
10
10
|
*/
|
|
11
11
|
/** Test-only: cast a string to PermissionPath without validation. */
|
|
12
12
|
export const unsafeAsPermissionPath = (path) => path;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* SECURITY CRITICAL: These functions validate permission paths
|
|
5
5
|
* to prevent path traversal attacks.
|
|
6
6
|
*/
|
|
7
|
-
import { hasTraversalSequence } from '../paths/normalize';
|
|
7
|
+
import { hasTraversalSequence } from '../paths/normalize.js';
|
|
8
8
|
/**
|
|
9
9
|
* Parse and validate a PermissionPath.
|
|
10
10
|
*
|
package/dist/branch-metadata.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { randomUUID } from 'node:crypto';
|
|
2
2
|
import fs from 'node:fs/promises';
|
|
3
3
|
import path from 'node:path';
|
|
4
|
-
import { BranchRegistry } from './branch-registry';
|
|
5
|
-
import { resolveBranchPath } from './paths';
|
|
6
|
-
import { isFileExistsError, isNotFoundError } from './utils/error';
|
|
4
|
+
import { BranchRegistry } from './branch-registry.js';
|
|
5
|
+
import { resolveBranchPath } from './paths/index.js';
|
|
6
|
+
import { isFileExistsError, isNotFoundError } from './utils/error.js';
|
|
7
7
|
const BRANCH_META_DIR = '.canopy-meta';
|
|
8
8
|
const BRANCH_META_FILE = 'branch.json';
|
|
9
9
|
const CURRENT_SCHEMA_VERSION = 1;
|
package/dist/branch-registry.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from 'node:fs/promises';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import { BranchMetadataFileManager } from './branch-metadata';
|
|
4
|
-
import { isNotFoundError } from './utils/error';
|
|
3
|
+
import { BranchMetadataFileManager } from './branch-metadata.js';
|
|
4
|
+
import { isNotFoundError } from './utils/error.js';
|
|
5
5
|
// Registry files are stored directly in the branches root (not in a subdirectory)
|
|
6
6
|
const REGISTRY_FILE = 'branches.json';
|
|
7
7
|
const REGISTRY_STALE_FILE = 'branches.stale.json';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from 'node:fs/promises';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import { resolveSchema, isValidSchema } from './schema/resolver';
|
|
4
|
-
import { flattenSchema } from './config/flatten';
|
|
3
|
+
import { resolveSchema, isValidSchema } from './schema/resolver.js';
|
|
4
|
+
import { flattenSchema } from './config/flatten.js';
|
|
5
5
|
/** Bump when BranchSchemaCacheEntry shape changes to auto-invalidate stale caches */
|
|
6
6
|
const SCHEMA_CACHE_VERSION = 2;
|
|
7
7
|
/** Minimum interval between mtime staleness checks (ms) */
|