convex-cms 0.0.1
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/cli/commands/admin.d.ts +16 -0
- package/dist/cli/commands/admin.d.ts.map +1 -0
- package/dist/cli/commands/admin.js +88 -0
- package/dist/cli/commands/admin.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +18 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/utils/detectConvexUrl.d.ts +13 -0
- package/dist/cli/utils/detectConvexUrl.d.ts.map +1 -0
- package/dist/cli/utils/detectConvexUrl.js +48 -0
- package/dist/cli/utils/detectConvexUrl.js.map +1 -0
- package/dist/cli/utils/openBrowser.d.ts +7 -0
- package/dist/cli/utils/openBrowser.d.ts.map +1 -0
- package/dist/cli/utils/openBrowser.js +17 -0
- package/dist/cli/utils/openBrowser.js.map +1 -0
- package/dist/client/admin-config.d.ts +126 -0
- package/dist/client/admin-config.d.ts.map +1 -0
- package/dist/client/admin-config.js +117 -0
- package/dist/client/admin-config.js.map +1 -0
- package/dist/client/adminApi.d.ts +2273 -0
- package/dist/client/adminApi.d.ts.map +1 -0
- package/dist/client/adminApi.js +716 -0
- package/dist/client/adminApi.js.map +1 -0
- package/dist/client/agentTools.d.ts +933 -0
- package/dist/client/agentTools.d.ts.map +1 -0
- package/dist/client/agentTools.js +1004 -0
- package/dist/client/agentTools.js.map +1 -0
- package/dist/client/argTypes.d.ts +212 -0
- package/dist/client/argTypes.d.ts.map +1 -0
- package/dist/client/argTypes.js +5 -0
- package/dist/client/argTypes.js.map +1 -0
- package/dist/client/field-types.d.ts +55 -0
- package/dist/client/field-types.d.ts.map +1 -0
- package/dist/client/field-types.js +152 -0
- package/dist/client/field-types.js.map +1 -0
- package/dist/client/index.d.ts +189 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +668 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/queryBuilder.d.ts +765 -0
- package/dist/client/queryBuilder.d.ts.map +1 -0
- package/dist/client/queryBuilder.js +970 -0
- package/dist/client/queryBuilder.js.map +1 -0
- package/dist/client/schema/codegen.d.ts +128 -0
- package/dist/client/schema/codegen.d.ts.map +1 -0
- package/dist/client/schema/codegen.js +318 -0
- package/dist/client/schema/codegen.js.map +1 -0
- package/dist/client/schema/defineContentType.d.ts +221 -0
- package/dist/client/schema/defineContentType.d.ts.map +1 -0
- package/dist/client/schema/defineContentType.js +380 -0
- package/dist/client/schema/defineContentType.js.map +1 -0
- package/dist/client/schema/index.d.ts +85 -0
- package/dist/client/schema/index.d.ts.map +1 -0
- package/dist/client/schema/index.js +92 -0
- package/dist/client/schema/index.js.map +1 -0
- package/dist/client/schema/schemaDrift.d.ts +199 -0
- package/dist/client/schema/schemaDrift.d.ts.map +1 -0
- package/dist/client/schema/schemaDrift.js +340 -0
- package/dist/client/schema/schemaDrift.js.map +1 -0
- package/dist/client/schema/typedClient.d.ts +401 -0
- package/dist/client/schema/typedClient.d.ts.map +1 -0
- package/dist/client/schema/typedClient.js +269 -0
- package/dist/client/schema/typedClient.js.map +1 -0
- package/dist/client/schema/types.d.ts +477 -0
- package/dist/client/schema/types.d.ts.map +1 -0
- package/dist/client/schema/types.js +39 -0
- package/dist/client/schema/types.js.map +1 -0
- package/dist/client/types.d.ts +449 -0
- package/dist/client/types.d.ts.map +1 -0
- package/dist/client/types.js +149 -0
- package/dist/client/types.js.map +1 -0
- package/dist/client/workflows.d.ts +51 -0
- package/dist/client/workflows.d.ts.map +1 -0
- package/dist/client/workflows.js +103 -0
- package/dist/client/workflows.js.map +1 -0
- package/dist/client/wrapper.d.ts +2198 -0
- package/dist/client/wrapper.d.ts.map +1 -0
- package/dist/client/wrapper.js +2651 -0
- package/dist/client/wrapper.js.map +1 -0
- package/dist/component/_generated/api.d.ts +124 -0
- package/dist/component/_generated/api.d.ts.map +1 -0
- package/dist/component/_generated/api.js +31 -0
- package/dist/component/_generated/api.js.map +1 -0
- package/dist/component/_generated/component.d.ts +4321 -0
- package/dist/component/_generated/component.d.ts.map +1 -0
- package/dist/component/_generated/component.js +11 -0
- package/dist/component/_generated/component.js.map +1 -0
- package/dist/component/_generated/dataModel.d.ts +46 -0
- package/dist/component/_generated/dataModel.d.ts.map +1 -0
- package/dist/component/_generated/dataModel.js +11 -0
- package/dist/component/_generated/dataModel.js.map +1 -0
- package/dist/component/_generated/server.d.ts +121 -0
- package/dist/component/_generated/server.d.ts.map +1 -0
- package/dist/component/_generated/server.js +78 -0
- package/dist/component/_generated/server.js.map +1 -0
- package/dist/component/auditLog.d.ts +410 -0
- package/dist/component/auditLog.d.ts.map +1 -0
- package/dist/component/auditLog.js +607 -0
- package/dist/component/auditLog.js.map +1 -0
- package/dist/component/authorization.d.ts +323 -0
- package/dist/component/authorization.d.ts.map +1 -0
- package/dist/component/authorization.js +464 -0
- package/dist/component/authorization.js.map +1 -0
- package/dist/component/authorizationHooks.d.ts +184 -0
- package/dist/component/authorizationHooks.d.ts.map +1 -0
- package/dist/component/authorizationHooks.js +521 -0
- package/dist/component/authorizationHooks.js.map +1 -0
- package/dist/component/bulkOperations.d.ts +200 -0
- package/dist/component/bulkOperations.d.ts.map +1 -0
- package/dist/component/bulkOperations.js +568 -0
- package/dist/component/bulkOperations.js.map +1 -0
- package/dist/component/contentEntries.d.ts +719 -0
- package/dist/component/contentEntries.d.ts.map +1 -0
- package/dist/component/contentEntries.js +1617 -0
- package/dist/component/contentEntries.js.map +1 -0
- package/dist/component/contentEntryMutations.d.ts +505 -0
- package/dist/component/contentEntryMutations.d.ts.map +1 -0
- package/dist/component/contentEntryMutations.js +1009 -0
- package/dist/component/contentEntryMutations.js.map +1 -0
- package/dist/component/contentEntryValidation.d.ts +115 -0
- package/dist/component/contentEntryValidation.d.ts.map +1 -0
- package/dist/component/contentEntryValidation.js +546 -0
- package/dist/component/contentEntryValidation.js.map +1 -0
- package/dist/component/contentLock.d.ts +328 -0
- package/dist/component/contentLock.d.ts.map +1 -0
- package/dist/component/contentLock.js +471 -0
- package/dist/component/contentLock.js.map +1 -0
- package/dist/component/contentTypeMigration.d.ts +411 -0
- package/dist/component/contentTypeMigration.d.ts.map +1 -0
- package/dist/component/contentTypeMigration.js +805 -0
- package/dist/component/contentTypeMigration.js.map +1 -0
- package/dist/component/contentTypeMutations.d.ts +975 -0
- package/dist/component/contentTypeMutations.d.ts.map +1 -0
- package/dist/component/contentTypeMutations.js +768 -0
- package/dist/component/contentTypeMutations.js.map +1 -0
- package/dist/component/contentTypes.d.ts +538 -0
- package/dist/component/contentTypes.d.ts.map +1 -0
- package/dist/component/contentTypes.js +304 -0
- package/dist/component/contentTypes.js.map +1 -0
- package/dist/component/convex.config.d.ts +42 -0
- package/dist/component/convex.config.d.ts.map +1 -0
- package/dist/component/convex.config.js +43 -0
- package/dist/component/convex.config.js.map +1 -0
- package/dist/component/documentTypes.d.ts +186 -0
- package/dist/component/documentTypes.d.ts.map +1 -0
- package/dist/component/documentTypes.js +23 -0
- package/dist/component/documentTypes.js.map +1 -0
- package/dist/component/eventEmitter.d.ts +281 -0
- package/dist/component/eventEmitter.d.ts.map +1 -0
- package/dist/component/eventEmitter.js +300 -0
- package/dist/component/eventEmitter.js.map +1 -0
- package/dist/component/exportImport.d.ts +1120 -0
- package/dist/component/exportImport.d.ts.map +1 -0
- package/dist/component/exportImport.js +931 -0
- package/dist/component/exportImport.js.map +1 -0
- package/dist/component/index.d.ts +28 -0
- package/dist/component/index.d.ts.map +1 -0
- package/dist/component/index.js +142 -0
- package/dist/component/index.js.map +1 -0
- package/dist/component/lib/deepReferenceResolver.d.ts +252 -0
- package/dist/component/lib/deepReferenceResolver.d.ts.map +1 -0
- package/dist/component/lib/deepReferenceResolver.js +601 -0
- package/dist/component/lib/deepReferenceResolver.js.map +1 -0
- package/dist/component/lib/errors.d.ts +306 -0
- package/dist/component/lib/errors.d.ts.map +1 -0
- package/dist/component/lib/errors.js +407 -0
- package/dist/component/lib/errors.js.map +1 -0
- package/dist/component/lib/index.d.ts +10 -0
- package/dist/component/lib/index.d.ts.map +1 -0
- package/dist/component/lib/index.js +33 -0
- package/dist/component/lib/index.js.map +1 -0
- package/dist/component/lib/mediaReferenceResolver.d.ts +217 -0
- package/dist/component/lib/mediaReferenceResolver.d.ts.map +1 -0
- package/dist/component/lib/mediaReferenceResolver.js +326 -0
- package/dist/component/lib/mediaReferenceResolver.js.map +1 -0
- package/dist/component/lib/metadataExtractor.d.ts +245 -0
- package/dist/component/lib/metadataExtractor.d.ts.map +1 -0
- package/dist/component/lib/metadataExtractor.js +548 -0
- package/dist/component/lib/metadataExtractor.js.map +1 -0
- package/dist/component/lib/mutationAuth.d.ts +95 -0
- package/dist/component/lib/mutationAuth.d.ts.map +1 -0
- package/dist/component/lib/mutationAuth.js +146 -0
- package/dist/component/lib/mutationAuth.js.map +1 -0
- package/dist/component/lib/queries.d.ts +17 -0
- package/dist/component/lib/queries.d.ts.map +1 -0
- package/dist/component/lib/queries.js +49 -0
- package/dist/component/lib/queries.js.map +1 -0
- package/dist/component/lib/ragContentChunker.d.ts +423 -0
- package/dist/component/lib/ragContentChunker.d.ts.map +1 -0
- package/dist/component/lib/ragContentChunker.js +897 -0
- package/dist/component/lib/ragContentChunker.js.map +1 -0
- package/dist/component/lib/referenceResolver.d.ts +175 -0
- package/dist/component/lib/referenceResolver.d.ts.map +1 -0
- package/dist/component/lib/referenceResolver.js +293 -0
- package/dist/component/lib/referenceResolver.js.map +1 -0
- package/dist/component/lib/slugGenerator.d.ts +71 -0
- package/dist/component/lib/slugGenerator.d.ts.map +1 -0
- package/dist/component/lib/slugGenerator.js +207 -0
- package/dist/component/lib/slugGenerator.js.map +1 -0
- package/dist/component/lib/slugUniqueness.d.ts +131 -0
- package/dist/component/lib/slugUniqueness.d.ts.map +1 -0
- package/dist/component/lib/slugUniqueness.js +229 -0
- package/dist/component/lib/slugUniqueness.js.map +1 -0
- package/dist/component/lib/softDelete.d.ts +18 -0
- package/dist/component/lib/softDelete.d.ts.map +1 -0
- package/dist/component/lib/softDelete.js +29 -0
- package/dist/component/lib/softDelete.js.map +1 -0
- package/dist/component/localeFallbackChain.d.ts +410 -0
- package/dist/component/localeFallbackChain.d.ts.map +1 -0
- package/dist/component/localeFallbackChain.js +467 -0
- package/dist/component/localeFallbackChain.js.map +1 -0
- package/dist/component/localeFields.d.ts +508 -0
- package/dist/component/localeFields.d.ts.map +1 -0
- package/dist/component/localeFields.js +592 -0
- package/dist/component/localeFields.js.map +1 -0
- package/dist/component/mediaAssetMutations.d.ts +235 -0
- package/dist/component/mediaAssetMutations.d.ts.map +1 -0
- package/dist/component/mediaAssetMutations.js +558 -0
- package/dist/component/mediaAssetMutations.js.map +1 -0
- package/dist/component/mediaAssets.d.ts +168 -0
- package/dist/component/mediaAssets.d.ts.map +1 -0
- package/dist/component/mediaAssets.js +618 -0
- package/dist/component/mediaAssets.js.map +1 -0
- package/dist/component/mediaFolderMutations.d.ts +642 -0
- package/dist/component/mediaFolderMutations.d.ts.map +1 -0
- package/dist/component/mediaFolderMutations.js +849 -0
- package/dist/component/mediaFolderMutations.js.map +1 -0
- package/dist/component/mediaUploadMutations.d.ts +136 -0
- package/dist/component/mediaUploadMutations.d.ts.map +1 -0
- package/dist/component/mediaUploadMutations.js +205 -0
- package/dist/component/mediaUploadMutations.js.map +1 -0
- package/dist/component/mediaVariantMutations.d.ts +468 -0
- package/dist/component/mediaVariantMutations.d.ts.map +1 -0
- package/dist/component/mediaVariantMutations.js +737 -0
- package/dist/component/mediaVariantMutations.js.map +1 -0
- package/dist/component/mediaVariants.d.ts +525 -0
- package/dist/component/mediaVariants.d.ts.map +1 -0
- package/dist/component/mediaVariants.js +661 -0
- package/dist/component/mediaVariants.js.map +1 -0
- package/dist/component/ragContentIndexer.d.ts +595 -0
- package/dist/component/ragContentIndexer.d.ts.map +1 -0
- package/dist/component/ragContentIndexer.js +794 -0
- package/dist/component/ragContentIndexer.js.map +1 -0
- package/dist/component/rateLimitHooks.d.ts +266 -0
- package/dist/component/rateLimitHooks.d.ts.map +1 -0
- package/dist/component/rateLimitHooks.js +412 -0
- package/dist/component/rateLimitHooks.js.map +1 -0
- package/dist/component/roles.d.ts +649 -0
- package/dist/component/roles.d.ts.map +1 -0
- package/dist/component/roles.js +884 -0
- package/dist/component/roles.js.map +1 -0
- package/dist/component/scheduledPublish.d.ts +182 -0
- package/dist/component/scheduledPublish.d.ts.map +1 -0
- package/dist/component/scheduledPublish.js +304 -0
- package/dist/component/scheduledPublish.js.map +1 -0
- package/dist/component/schema.d.ts +4114 -0
- package/dist/component/schema.d.ts.map +1 -0
- package/dist/component/schema.js +469 -0
- package/dist/component/schema.js.map +1 -0
- package/dist/component/taxonomies.d.ts +476 -0
- package/dist/component/taxonomies.d.ts.map +1 -0
- package/dist/component/taxonomies.js +785 -0
- package/dist/component/taxonomies.js.map +1 -0
- package/dist/component/taxonomyMutations.d.ts +206 -0
- package/dist/component/taxonomyMutations.d.ts.map +1 -0
- package/dist/component/taxonomyMutations.js +1001 -0
- package/dist/component/taxonomyMutations.js.map +1 -0
- package/dist/component/trash.d.ts +265 -0
- package/dist/component/trash.d.ts.map +1 -0
- package/dist/component/trash.js +621 -0
- package/dist/component/trash.js.map +1 -0
- package/dist/component/types.d.ts +4 -0
- package/dist/component/types.d.ts.map +1 -0
- package/dist/component/types.js +2 -0
- package/dist/component/types.js.map +1 -0
- package/dist/component/userContext.d.ts +508 -0
- package/dist/component/userContext.d.ts.map +1 -0
- package/dist/component/userContext.js +615 -0
- package/dist/component/userContext.js.map +1 -0
- package/dist/component/validation.d.ts +387 -0
- package/dist/component/validation.d.ts.map +1 -0
- package/dist/component/validation.js +1052 -0
- package/dist/component/validation.js.map +1 -0
- package/dist/component/validators.d.ts +4645 -0
- package/dist/component/validators.d.ts.map +1 -0
- package/dist/component/validators.js +641 -0
- package/dist/component/validators.js.map +1 -0
- package/dist/component/versionMutations.d.ts +216 -0
- package/dist/component/versionMutations.d.ts.map +1 -0
- package/dist/component/versionMutations.js +321 -0
- package/dist/component/versionMutations.js.map +1 -0
- package/dist/component/webhookTrigger.d.ts +770 -0
- package/dist/component/webhookTrigger.d.ts.map +1 -0
- package/dist/component/webhookTrigger.js +1413 -0
- package/dist/component/webhookTrigger.js.map +1 -0
- package/dist/react/index.d.ts +316 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +558 -0
- package/dist/react/index.js.map +1 -0
- package/dist/test.d.ts +2230 -0
- package/dist/test.d.ts.map +1 -0
- package/dist/test.js +1107 -0
- package/dist/test.js.map +1 -0
- package/package.json +95 -0
- package/src/cli/commands/admin.ts +104 -0
- package/src/cli/index.ts +21 -0
- package/src/cli/utils/detectConvexUrl.ts +54 -0
- package/src/cli/utils/openBrowser.ts +16 -0
- package/src/client/admin-config.ts +138 -0
- package/src/client/adminApi.ts +942 -0
- package/src/client/agentTools.ts +1311 -0
- package/src/client/argTypes.ts +316 -0
- package/src/client/field-types.ts +187 -0
- package/src/client/index.ts +1301 -0
- package/src/client/queryBuilder.ts +1100 -0
- package/src/client/schema/codegen.ts +500 -0
- package/src/client/schema/defineContentType.ts +501 -0
- package/src/client/schema/index.ts +169 -0
- package/src/client/schema/schemaDrift.ts +574 -0
- package/src/client/schema/typedClient.ts +688 -0
- package/src/client/schema/types.ts +666 -0
- package/src/client/types.ts +723 -0
- package/src/client/workflows.ts +141 -0
- package/src/client/wrapper.ts +4304 -0
- package/src/component/_generated/api.ts +140 -0
- package/src/component/_generated/component.ts +5029 -0
- package/src/component/_generated/dataModel.ts +60 -0
- package/src/component/_generated/server.ts +156 -0
- package/src/component/authorization.ts +647 -0
- package/src/component/authorizationHooks.ts +668 -0
- package/src/component/bulkOperations.ts +687 -0
- package/src/component/contentEntries.ts +1976 -0
- package/src/component/contentEntryMutations.ts +1223 -0
- package/src/component/contentEntryValidation.ts +707 -0
- package/src/component/contentLock.ts +550 -0
- package/src/component/contentTypeMigration.ts +1064 -0
- package/src/component/contentTypeMutations.ts +969 -0
- package/src/component/contentTypes.ts +346 -0
- package/src/component/convex.config.ts +44 -0
- package/src/component/documentTypes.ts +240 -0
- package/src/component/eventEmitter.ts +485 -0
- package/src/component/exportImport.ts +1169 -0
- package/src/component/index.ts +491 -0
- package/src/component/lib/deepReferenceResolver.ts +999 -0
- package/src/component/lib/errors.ts +816 -0
- package/src/component/lib/index.ts +145 -0
- package/src/component/lib/mediaReferenceResolver.ts +495 -0
- package/src/component/lib/metadataExtractor.ts +792 -0
- package/src/component/lib/mutationAuth.ts +199 -0
- package/src/component/lib/queries.ts +79 -0
- package/src/component/lib/ragContentChunker.ts +1371 -0
- package/src/component/lib/referenceResolver.ts +430 -0
- package/src/component/lib/slugGenerator.ts +262 -0
- package/src/component/lib/slugUniqueness.ts +333 -0
- package/src/component/lib/softDelete.ts +44 -0
- package/src/component/localeFallbackChain.ts +673 -0
- package/src/component/localeFields.ts +896 -0
- package/src/component/mediaAssetMutations.ts +725 -0
- package/src/component/mediaAssets.ts +932 -0
- package/src/component/mediaFolderMutations.ts +1046 -0
- package/src/component/mediaUploadMutations.ts +224 -0
- package/src/component/mediaVariantMutations.ts +900 -0
- package/src/component/mediaVariants.ts +793 -0
- package/src/component/ragContentIndexer.ts +1067 -0
- package/src/component/rateLimitHooks.ts +572 -0
- package/src/component/roles.ts +1360 -0
- package/src/component/scheduledPublish.ts +358 -0
- package/src/component/schema.ts +617 -0
- package/src/component/taxonomies.ts +949 -0
- package/src/component/taxonomyMutations.ts +1210 -0
- package/src/component/trash.ts +724 -0
- package/src/component/userContext.ts +898 -0
- package/src/component/validation.ts +1388 -0
- package/src/component/validators.ts +949 -0
- package/src/component/versionMutations.ts +392 -0
- package/src/component/webhookTrigger.ts +1922 -0
- package/src/react/index.ts +898 -0
- package/src/test.ts +1580 -0
|
@@ -0,0 +1,508 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User Context Handler Module
|
|
3
|
+
*
|
|
4
|
+
* Functions to receive and validate user context passed from parent apps.
|
|
5
|
+
* Extracts user ID and roles for permission checks in the CMS authorization system.
|
|
6
|
+
*
|
|
7
|
+
* This module bridges the gap between external authentication systems and the
|
|
8
|
+
* CMS's internal RBAC (Role-Based Access Control) system. The CMS is auth-agnostic,
|
|
9
|
+
* meaning it doesn't own user authentication - instead, it relies on the parent
|
|
10
|
+
* application to provide user identification.
|
|
11
|
+
*
|
|
12
|
+
* Key concepts:
|
|
13
|
+
* - UserContext: The validated user information passed to CMS operations
|
|
14
|
+
* - User ID: A string identifier from your auth system (Clerk, Auth0, custom, etc.)
|
|
15
|
+
* - Role: The CMS role assigned to the user (admin, editor, author, viewer, or custom)
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* import { createUserContext, validateUserContext, extractUserId } from './userContext';
|
|
20
|
+
*
|
|
21
|
+
* // In your Convex function:
|
|
22
|
+
* export const createPost = mutation({
|
|
23
|
+
* handler: async (ctx, args) => {
|
|
24
|
+
* // Get user from your auth system
|
|
25
|
+
* const identity = await ctx.auth.getUserIdentity();
|
|
26
|
+
*
|
|
27
|
+
* // Create and validate user context
|
|
28
|
+
* const userContext = await createUserContext({
|
|
29
|
+
* userId: identity?.subject,
|
|
30
|
+
* getUserRole: config.getUserRole,
|
|
31
|
+
* });
|
|
32
|
+
*
|
|
33
|
+
* // Use in CMS operations
|
|
34
|
+
* const entry = await cms.contentEntries.create(ctx, {
|
|
35
|
+
* ...args,
|
|
36
|
+
* createdBy: userContext.userId,
|
|
37
|
+
* });
|
|
38
|
+
* },
|
|
39
|
+
* });
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
import type { GetUserRoleHook, GetUserRoleResult, AuthorizationHookContext, CmsOperation, CmsHookContext } from "../client/types.js";
|
|
43
|
+
import { type RoleDefinition } from "./roles.js";
|
|
44
|
+
/**
|
|
45
|
+
* Raw user context input from the parent application.
|
|
46
|
+
* This is the initial user information before validation.
|
|
47
|
+
*/
|
|
48
|
+
export interface UserContextInput {
|
|
49
|
+
/**
|
|
50
|
+
* The user ID from your authentication system.
|
|
51
|
+
* Can be undefined for anonymous/unauthenticated requests.
|
|
52
|
+
*
|
|
53
|
+
* Examples:
|
|
54
|
+
* - Clerk: `user.id` or `identity.subject`
|
|
55
|
+
* - Auth0: `user.sub`
|
|
56
|
+
* - Custom: Your database user ID
|
|
57
|
+
*/
|
|
58
|
+
userId?: string | null;
|
|
59
|
+
/**
|
|
60
|
+
* Optional pre-resolved role name.
|
|
61
|
+
* If provided, skips the getUserRole hook lookup.
|
|
62
|
+
* Useful when you've already determined the role elsewhere.
|
|
63
|
+
*/
|
|
64
|
+
role?: string | null;
|
|
65
|
+
/**
|
|
66
|
+
* Optional email for logging/debugging purposes.
|
|
67
|
+
* Not used for authorization decisions.
|
|
68
|
+
*/
|
|
69
|
+
email?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Optional display name for audit trails.
|
|
72
|
+
* Not used for authorization decisions.
|
|
73
|
+
*/
|
|
74
|
+
displayName?: string;
|
|
75
|
+
/**
|
|
76
|
+
* Additional metadata from your auth system.
|
|
77
|
+
* Can be used in custom authorization hooks.
|
|
78
|
+
*/
|
|
79
|
+
metadata?: Record<string, unknown>;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Validated user context ready for CMS operations.
|
|
83
|
+
* This is the result after validation and role resolution.
|
|
84
|
+
*/
|
|
85
|
+
export interface UserContext {
|
|
86
|
+
/**
|
|
87
|
+
* The validated user ID.
|
|
88
|
+
* Will be undefined for anonymous users.
|
|
89
|
+
*/
|
|
90
|
+
userId: string | undefined;
|
|
91
|
+
/**
|
|
92
|
+
* The resolved CMS role name.
|
|
93
|
+
* Will be null if the user has no CMS role assigned.
|
|
94
|
+
*/
|
|
95
|
+
role: string | null;
|
|
96
|
+
/**
|
|
97
|
+
* Whether the user is authenticated (has a valid userId).
|
|
98
|
+
*/
|
|
99
|
+
isAuthenticated: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Whether the user has a valid CMS role assigned.
|
|
102
|
+
*/
|
|
103
|
+
hasRole: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* The full role definition if the role exists.
|
|
106
|
+
* Useful for checking specific permissions.
|
|
107
|
+
*/
|
|
108
|
+
roleDefinition?: RoleDefinition;
|
|
109
|
+
/**
|
|
110
|
+
* Optional email (passed through from input).
|
|
111
|
+
*/
|
|
112
|
+
email?: string;
|
|
113
|
+
/**
|
|
114
|
+
* Optional display name (passed through from input).
|
|
115
|
+
*/
|
|
116
|
+
displayName?: string;
|
|
117
|
+
/**
|
|
118
|
+
* Optional metadata (passed through from input).
|
|
119
|
+
*/
|
|
120
|
+
metadata?: Record<string, unknown>;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Options for creating a user context.
|
|
124
|
+
*/
|
|
125
|
+
export interface CreateUserContextOptions {
|
|
126
|
+
/**
|
|
127
|
+
* The CMS hook context (provides db and auth access for hooks).
|
|
128
|
+
* Required when using getUserRole hook.
|
|
129
|
+
*/
|
|
130
|
+
ctx?: CmsHookContext;
|
|
131
|
+
/**
|
|
132
|
+
* The raw user context input.
|
|
133
|
+
*/
|
|
134
|
+
input: UserContextInput;
|
|
135
|
+
/**
|
|
136
|
+
* The getUserRole hook from CMS configuration.
|
|
137
|
+
* Required if input.role is not provided.
|
|
138
|
+
*/
|
|
139
|
+
getUserRole?: GetUserRoleHook;
|
|
140
|
+
/**
|
|
141
|
+
* Custom role definitions to check against.
|
|
142
|
+
* Used in addition to built-in roles.
|
|
143
|
+
*/
|
|
144
|
+
customRoles?: Record<string, RoleDefinition>;
|
|
145
|
+
/**
|
|
146
|
+
* Whether to allow anonymous (unauthenticated) users.
|
|
147
|
+
* @default true
|
|
148
|
+
*/
|
|
149
|
+
allowAnonymous?: boolean;
|
|
150
|
+
/**
|
|
151
|
+
* Whether to require a valid CMS role.
|
|
152
|
+
* If true, throws an error when the user has no role.
|
|
153
|
+
* @default false
|
|
154
|
+
*/
|
|
155
|
+
requireRole?: boolean;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Validation error details for user context.
|
|
159
|
+
*/
|
|
160
|
+
export interface UserContextValidationError {
|
|
161
|
+
/**
|
|
162
|
+
* Error code for programmatic handling.
|
|
163
|
+
*/
|
|
164
|
+
code: "INVALID_USER_ID" | "ANONYMOUS_NOT_ALLOWED" | "ROLE_REQUIRED" | "UNKNOWN_ROLE" | "HOOK_ERROR";
|
|
165
|
+
/**
|
|
166
|
+
* Human-readable error message.
|
|
167
|
+
*/
|
|
168
|
+
message: string;
|
|
169
|
+
/**
|
|
170
|
+
* Additional details about the error.
|
|
171
|
+
*/
|
|
172
|
+
details?: Record<string, unknown>;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Result of user context validation.
|
|
176
|
+
*/
|
|
177
|
+
export interface UserContextValidationResult {
|
|
178
|
+
/**
|
|
179
|
+
* Whether the validation passed.
|
|
180
|
+
*/
|
|
181
|
+
valid: boolean;
|
|
182
|
+
/**
|
|
183
|
+
* The validated user context (only present if valid).
|
|
184
|
+
*/
|
|
185
|
+
context?: UserContext;
|
|
186
|
+
/**
|
|
187
|
+
* Validation errors (only present if invalid).
|
|
188
|
+
*/
|
|
189
|
+
errors?: UserContextValidationError[];
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Error thrown when user context validation fails.
|
|
193
|
+
*
|
|
194
|
+
* @example
|
|
195
|
+
* ```typescript
|
|
196
|
+
* try {
|
|
197
|
+
* const context = await createUserContext({ input, getUserRole });
|
|
198
|
+
* } catch (error) {
|
|
199
|
+
* if (error instanceof UserContextError) {
|
|
200
|
+
* console.log(error.code); // 'ANONYMOUS_NOT_ALLOWED'
|
|
201
|
+
* console.log(error.message); // 'Anonymous users are not allowed'
|
|
202
|
+
* }
|
|
203
|
+
* }
|
|
204
|
+
* ```
|
|
205
|
+
*/
|
|
206
|
+
export declare class UserContextError extends Error {
|
|
207
|
+
readonly code: UserContextValidationError["code"];
|
|
208
|
+
readonly details?: Record<string, unknown>;
|
|
209
|
+
constructor(error: UserContextValidationError);
|
|
210
|
+
toJSON(): Record<string, unknown>;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Validate a user ID string.
|
|
214
|
+
*
|
|
215
|
+
* @param userId - The user ID to validate
|
|
216
|
+
* @returns True if the user ID is valid
|
|
217
|
+
*
|
|
218
|
+
* @example
|
|
219
|
+
* ```typescript
|
|
220
|
+
* isValidUserId("user_123"); // true
|
|
221
|
+
* isValidUserId(""); // false
|
|
222
|
+
* isValidUserId(null); // false
|
|
223
|
+
* ```
|
|
224
|
+
*/
|
|
225
|
+
export declare function isValidUserId(userId: unknown): userId is string;
|
|
226
|
+
/**
|
|
227
|
+
* Validate that a role name exists in the role definitions.
|
|
228
|
+
*
|
|
229
|
+
* @param roleName - The role name to validate
|
|
230
|
+
* @param customRoles - Optional custom role definitions
|
|
231
|
+
* @returns True if the role exists
|
|
232
|
+
*
|
|
233
|
+
* @example
|
|
234
|
+
* ```typescript
|
|
235
|
+
* isValidRole("admin"); // true (built-in)
|
|
236
|
+
* isValidRole("blog-author", { "blog-author": {...} }); // true (custom)
|
|
237
|
+
* isValidRole("unknown"); // false
|
|
238
|
+
* ```
|
|
239
|
+
*/
|
|
240
|
+
export declare function isValidRole(roleName: string | null | undefined, customRoles?: Record<string, RoleDefinition>): boolean;
|
|
241
|
+
/**
|
|
242
|
+
* Validate user context input without creating the full context.
|
|
243
|
+
* Use this for quick validation before expensive operations.
|
|
244
|
+
*
|
|
245
|
+
* @param input - The user context input to validate
|
|
246
|
+
* @param options - Validation options
|
|
247
|
+
* @returns Validation result with errors if invalid
|
|
248
|
+
*
|
|
249
|
+
* @example
|
|
250
|
+
* ```typescript
|
|
251
|
+
* const result = validateUserContextInput(
|
|
252
|
+
* { userId: "user_123" },
|
|
253
|
+
* { allowAnonymous: false }
|
|
254
|
+
* );
|
|
255
|
+
*
|
|
256
|
+
* if (!result.valid) {
|
|
257
|
+
* console.log(result.errors); // Validation errors
|
|
258
|
+
* }
|
|
259
|
+
* ```
|
|
260
|
+
*/
|
|
261
|
+
export declare function validateUserContextInput(input: UserContextInput, options?: {
|
|
262
|
+
allowAnonymous?: boolean;
|
|
263
|
+
requireRole?: boolean;
|
|
264
|
+
customRoles?: Record<string, RoleDefinition>;
|
|
265
|
+
}): {
|
|
266
|
+
valid: boolean;
|
|
267
|
+
errors?: UserContextValidationError[];
|
|
268
|
+
};
|
|
269
|
+
/**
|
|
270
|
+
* Resolve the user's CMS role using the getUserRole hook.
|
|
271
|
+
*
|
|
272
|
+
* @param ctx - The CMS hook context (provides db and auth access)
|
|
273
|
+
* @param userId - The user ID to look up
|
|
274
|
+
* @param getUserRole - The getUserRole hook from configuration
|
|
275
|
+
* @returns The resolved role name or null
|
|
276
|
+
*
|
|
277
|
+
* @example
|
|
278
|
+
* ```typescript
|
|
279
|
+
* const role = await resolveUserRole(ctx, "user_123", config.getUserRole);
|
|
280
|
+
* console.log(role); // "editor" or null
|
|
281
|
+
* ```
|
|
282
|
+
*/
|
|
283
|
+
export declare function resolveUserRole(ctx: CmsHookContext, userId: string, getUserRole?: GetUserRoleHook): Promise<GetUserRoleResult>;
|
|
284
|
+
/**
|
|
285
|
+
* Create a validated user context from input.
|
|
286
|
+
*
|
|
287
|
+
* This is the main function for converting raw user input into a validated
|
|
288
|
+
* UserContext that can be used throughout CMS operations. It handles:
|
|
289
|
+
* - User ID validation
|
|
290
|
+
* - Role resolution via the getUserRole hook
|
|
291
|
+
* - Role validation against built-in and custom roles
|
|
292
|
+
* - Access control checks (anonymous, role requirements)
|
|
293
|
+
*
|
|
294
|
+
* @param options - Options including input and hooks
|
|
295
|
+
* @returns Validated UserContext
|
|
296
|
+
* @throws UserContextError if validation fails
|
|
297
|
+
*
|
|
298
|
+
* @example
|
|
299
|
+
* ```typescript
|
|
300
|
+
* // Basic usage with getUserRole hook
|
|
301
|
+
* const context = await createUserContext({
|
|
302
|
+
* input: { userId: identity?.subject },
|
|
303
|
+
* getUserRole: config.getUserRole,
|
|
304
|
+
* });
|
|
305
|
+
*
|
|
306
|
+
* // With pre-resolved role (skips hook)
|
|
307
|
+
* const context = await createUserContext({
|
|
308
|
+
* input: { userId: "user_123", role: "editor" },
|
|
309
|
+
* });
|
|
310
|
+
*
|
|
311
|
+
* // Require authentication
|
|
312
|
+
* const context = await createUserContext({
|
|
313
|
+
* input: { userId },
|
|
314
|
+
* allowAnonymous: false,
|
|
315
|
+
* });
|
|
316
|
+
* ```
|
|
317
|
+
*/
|
|
318
|
+
export declare function createUserContext(options: CreateUserContextOptions): Promise<UserContext>;
|
|
319
|
+
/**
|
|
320
|
+
* Create a user context synchronously when the role is already known.
|
|
321
|
+
* Use this when you've already resolved the role or want to skip hook execution.
|
|
322
|
+
*
|
|
323
|
+
* @param input - User context input with role pre-resolved
|
|
324
|
+
* @param customRoles - Optional custom role definitions
|
|
325
|
+
* @returns Validated UserContext
|
|
326
|
+
*
|
|
327
|
+
* @example
|
|
328
|
+
* ```typescript
|
|
329
|
+
* // When role is already known
|
|
330
|
+
* const context = createUserContextSync({
|
|
331
|
+
* userId: "user_123",
|
|
332
|
+
* role: "editor",
|
|
333
|
+
* });
|
|
334
|
+
* ```
|
|
335
|
+
*/
|
|
336
|
+
export declare function createUserContextSync(input: UserContextInput, customRoles?: Record<string, RoleDefinition>): UserContext;
|
|
337
|
+
/**
|
|
338
|
+
* Extract user ID from various input formats.
|
|
339
|
+
* Handles common patterns from different auth systems.
|
|
340
|
+
*
|
|
341
|
+
* @param input - The input to extract userId from
|
|
342
|
+
* @returns The extracted userId or undefined
|
|
343
|
+
*
|
|
344
|
+
* @example
|
|
345
|
+
* ```typescript
|
|
346
|
+
* // From Convex identity
|
|
347
|
+
* extractUserId(identity); // uses identity.subject
|
|
348
|
+
*
|
|
349
|
+
* // From string
|
|
350
|
+
* extractUserId("user_123"); // "user_123"
|
|
351
|
+
*
|
|
352
|
+
* // From object with common fields
|
|
353
|
+
* extractUserId({ sub: "user_123" }); // "user_123"
|
|
354
|
+
* extractUserId({ userId: "user_123" }); // "user_123"
|
|
355
|
+
* extractUserId({ id: "user_123" }); // "user_123"
|
|
356
|
+
* ```
|
|
357
|
+
*/
|
|
358
|
+
export declare function extractUserId(input: string | {
|
|
359
|
+
subject?: string;
|
|
360
|
+
sub?: string;
|
|
361
|
+
userId?: string;
|
|
362
|
+
id?: string;
|
|
363
|
+
_id?: string;
|
|
364
|
+
} | null | undefined): string | undefined;
|
|
365
|
+
/**
|
|
366
|
+
* Extract user ID from a Convex auth context.
|
|
367
|
+
* This is a convenience wrapper for extractUserId that works with ctx.auth.
|
|
368
|
+
*
|
|
369
|
+
* @param authContext - The auth context from ctx.auth
|
|
370
|
+
* @returns The user ID or undefined if not authenticated
|
|
371
|
+
*
|
|
372
|
+
* @example
|
|
373
|
+
* ```typescript
|
|
374
|
+
* export const myMutation = mutation({
|
|
375
|
+
* handler: async (ctx, args) => {
|
|
376
|
+
* const userId = await extractUserIdFromAuth(ctx.auth);
|
|
377
|
+
* if (!userId) {
|
|
378
|
+
* throw new Error("Authentication required");
|
|
379
|
+
* }
|
|
380
|
+
* // ... use userId
|
|
381
|
+
* },
|
|
382
|
+
* });
|
|
383
|
+
* ```
|
|
384
|
+
*/
|
|
385
|
+
export declare function extractUserIdFromAuth(authContext: {
|
|
386
|
+
getUserIdentity: () => Promise<{
|
|
387
|
+
subject?: string;
|
|
388
|
+
} | null>;
|
|
389
|
+
}): Promise<string | undefined>;
|
|
390
|
+
/**
|
|
391
|
+
* Build an AuthorizationHookContext from a UserContext and operation details.
|
|
392
|
+
* This creates the context object used by authorization hooks.
|
|
393
|
+
*
|
|
394
|
+
* @param userContext - The validated user context
|
|
395
|
+
* @param operation - The CMS operation being performed
|
|
396
|
+
* @param resourceInfo - Additional resource information
|
|
397
|
+
* @returns AuthorizationHookContext for hook execution
|
|
398
|
+
*
|
|
399
|
+
* @example
|
|
400
|
+
* ```typescript
|
|
401
|
+
* const hookContext = buildAuthorizationContext(
|
|
402
|
+
* userContext,
|
|
403
|
+
* "contentEntries.update",
|
|
404
|
+
* {
|
|
405
|
+
* resourceId: entry._id,
|
|
406
|
+
* resourceOwnerId: entry.createdBy,
|
|
407
|
+
* contentTypeId: entry.contentTypeId,
|
|
408
|
+
* contentTypeName: contentType.name,
|
|
409
|
+
* }
|
|
410
|
+
* );
|
|
411
|
+
* ```
|
|
412
|
+
*/
|
|
413
|
+
export declare function buildAuthorizationContext(userContext: UserContext, operation: CmsOperation, resourceInfo?: {
|
|
414
|
+
resourceId?: string;
|
|
415
|
+
resourceOwnerId?: string;
|
|
416
|
+
contentTypeId?: string;
|
|
417
|
+
contentTypeName?: string;
|
|
418
|
+
operationData?: Record<string, unknown>;
|
|
419
|
+
}): Omit<AuthorizationHookContext, "ctx">;
|
|
420
|
+
/**
|
|
421
|
+
* Create a minimal user context for anonymous operations.
|
|
422
|
+
* Use this for public read operations that don't require authentication.
|
|
423
|
+
*
|
|
424
|
+
* @returns A UserContext representing an anonymous user
|
|
425
|
+
*
|
|
426
|
+
* @example
|
|
427
|
+
* ```typescript
|
|
428
|
+
* // For public content queries
|
|
429
|
+
* const context = createAnonymousContext();
|
|
430
|
+
* // context.isAuthenticated === false
|
|
431
|
+
* // context.hasRole === false
|
|
432
|
+
* ```
|
|
433
|
+
*/
|
|
434
|
+
export declare function createAnonymousContext(): UserContext;
|
|
435
|
+
/**
|
|
436
|
+
* Create a system context for internal operations.
|
|
437
|
+
* This bypasses normal user authentication for system-level operations.
|
|
438
|
+
* Use with caution - only for trusted internal operations.
|
|
439
|
+
*
|
|
440
|
+
* @param systemId - Optional identifier for the system operation
|
|
441
|
+
* @returns A UserContext representing a system operation
|
|
442
|
+
*
|
|
443
|
+
* @example
|
|
444
|
+
* ```typescript
|
|
445
|
+
* // For scheduled jobs or internal migrations
|
|
446
|
+
* const context = createSystemContext("scheduled-publisher");
|
|
447
|
+
* // context.userId === "_system:scheduled-publisher"
|
|
448
|
+
* // context.role === "admin" (full access)
|
|
449
|
+
* ```
|
|
450
|
+
*/
|
|
451
|
+
export declare function createSystemContext(systemId?: string): UserContext;
|
|
452
|
+
/**
|
|
453
|
+
* Check if a user context represents an authenticated user.
|
|
454
|
+
*
|
|
455
|
+
* @param context - The user context to check
|
|
456
|
+
* @returns True if the user is authenticated
|
|
457
|
+
*/
|
|
458
|
+
export declare function isAuthenticated(context: UserContext): boolean;
|
|
459
|
+
/**
|
|
460
|
+
* Check if a user context has a specific role.
|
|
461
|
+
*
|
|
462
|
+
* @param context - The user context to check
|
|
463
|
+
* @param roleName - The role name to check for
|
|
464
|
+
* @returns True if the user has the specified role
|
|
465
|
+
*/
|
|
466
|
+
export declare function hasUserRole(context: UserContext, roleName: string): boolean;
|
|
467
|
+
/**
|
|
468
|
+
* Check if a user context represents a system operation.
|
|
469
|
+
*
|
|
470
|
+
* @param context - The user context to check
|
|
471
|
+
* @returns True if this is a system context
|
|
472
|
+
*/
|
|
473
|
+
export declare function isSystemContext(context: UserContext): boolean;
|
|
474
|
+
/**
|
|
475
|
+
* Get the display identifier for a user context.
|
|
476
|
+
* Useful for logging and audit trails.
|
|
477
|
+
*
|
|
478
|
+
* @param context - The user context
|
|
479
|
+
* @returns A human-readable identifier for the user
|
|
480
|
+
*/
|
|
481
|
+
export declare function getUserDisplayId(context: UserContext): string;
|
|
482
|
+
/**
|
|
483
|
+
* Validate that a user context meets minimum requirements for an operation.
|
|
484
|
+
* Returns validation result with specific error messages.
|
|
485
|
+
*
|
|
486
|
+
* @param context - The user context to validate
|
|
487
|
+
* @param requirements - The requirements to check
|
|
488
|
+
* @returns Validation result
|
|
489
|
+
*
|
|
490
|
+
* @example
|
|
491
|
+
* ```typescript
|
|
492
|
+
* const result = validateUserContext(context, {
|
|
493
|
+
* requireAuthentication: true,
|
|
494
|
+
* requireRole: true,
|
|
495
|
+
* allowedRoles: ["admin", "editor"],
|
|
496
|
+
* });
|
|
497
|
+
*
|
|
498
|
+
* if (!result.valid) {
|
|
499
|
+
* throw new Error(result.errors[0].message);
|
|
500
|
+
* }
|
|
501
|
+
* ```
|
|
502
|
+
*/
|
|
503
|
+
export declare function validateUserContext(context: UserContext, requirements: {
|
|
504
|
+
requireAuthentication?: boolean;
|
|
505
|
+
requireRole?: boolean;
|
|
506
|
+
allowedRoles?: string[];
|
|
507
|
+
}): UserContextValidationResult;
|
|
508
|
+
//# sourceMappingURL=userContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userContext.d.ts","sourceRoot":"","sources":["../../src/component/userContext.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,KAAK,EACV,eAAe,EAEf,iBAAiB,EACjB,wBAAwB,EACxB,YAAY,EACZ,cAAc,EACf,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAW,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AAM1D;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAErB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAE3B;;;OAGG;IACH,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAEpB;;OAEG;IACH,eAAe,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAEhC;;OAEG;IACH,KAAK,CAAC,EAAE,MAA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