payload 4.0.0-internal.a7ca468 → 4.0.0-internal.af6aad0
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/admin/views/index.d.ts +1 -1
- package/dist/admin/views/index.d.ts.map +1 -1
- package/dist/admin/views/index.js.map +1 -1
- package/dist/admin/views/list.d.ts +10 -0
- package/dist/admin/views/list.d.ts.map +1 -1
- package/dist/admin/views/list.js.map +1 -1
- package/dist/auth/baseFields/apiKey.d.ts.map +1 -1
- package/dist/auth/baseFields/apiKey.js +16 -1
- package/dist/auth/baseFields/apiKey.js.map +1 -1
- package/dist/auth/crypto.d.ts +73 -2
- package/dist/auth/crypto.d.ts.map +1 -1
- package/dist/auth/crypto.js +90 -13
- package/dist/auth/crypto.js.map +1 -1
- package/dist/auth/endpoints/refresh.d.ts.map +1 -1
- package/dist/auth/endpoints/refresh.js +4 -6
- package/dist/auth/endpoints/refresh.js.map +1 -1
- package/dist/auth/executeAccess.d.ts +2 -1
- package/dist/auth/executeAccess.d.ts.map +1 -1
- package/dist/auth/executeAccess.js +2 -1
- package/dist/auth/executeAccess.js.map +1 -1
- package/dist/auth/getAccessResults.js +1 -0
- package/dist/auth/getAccessResults.js.map +1 -1
- package/dist/auth/operations/access.d.ts.map +1 -1
- package/dist/auth/operations/access.js +3 -9
- package/dist/auth/operations/access.js.map +1 -1
- package/dist/auth/operations/auth.d.ts.map +1 -1
- package/dist/auth/operations/auth.js +15 -21
- package/dist/auth/operations/auth.js.map +1 -1
- package/dist/auth/operations/me.d.ts +0 -7
- package/dist/auth/operations/me.d.ts.map +1 -1
- package/dist/auth/operations/me.js +0 -6
- package/dist/auth/operations/me.js.map +1 -1
- package/dist/auth/operations/refresh.d.ts +0 -7
- package/dist/auth/operations/refresh.d.ts.map +1 -1
- package/dist/auth/operations/refresh.js +0 -6
- package/dist/auth/operations/refresh.js.map +1 -1
- package/dist/auth/operations/unlock.d.ts.map +1 -1
- package/dist/auth/operations/unlock.js +1 -0
- package/dist/auth/operations/unlock.js.map +1 -1
- package/dist/auth/rotateSecret.d.ts +51 -0
- package/dist/auth/rotateSecret.d.ts.map +1 -0
- package/dist/auth/rotateSecret.js +131 -0
- package/dist/auth/rotateSecret.js.map +1 -0
- package/dist/auth/strategies/apiKey.d.ts.map +1 -1
- package/dist/auth/strategies/apiKey.js +5 -3
- package/dist/auth/strategies/apiKey.js.map +1 -1
- package/dist/auth/strategies/jwt.d.ts.map +1 -1
- package/dist/auth/strategies/jwt.js +23 -2
- package/dist/auth/strategies/jwt.js.map +1 -1
- package/dist/auth/withBaseAccess.d.ts +22 -0
- package/dist/auth/withBaseAccess.d.ts.map +1 -0
- package/dist/auth/withBaseAccess.js +61 -0
- package/dist/auth/withBaseAccess.js.map +1 -0
- package/dist/bin/build.d.ts.map +1 -1
- package/dist/bin/build.js +9 -2
- package/dist/bin/build.js.map +1 -1
- package/dist/bin/build.spec.js +49 -18
- package/dist/bin/build.spec.js.map +1 -1
- package/dist/collections/config/sanitize.d.ts.map +1 -1
- package/dist/collections/config/sanitize.js +35 -0
- package/dist/collections/config/sanitize.js.map +1 -1
- package/dist/collections/config/sanitize.spec.js +363 -1
- package/dist/collections/config/sanitize.spec.js.map +1 -1
- package/dist/collections/config/types.d.ts +13 -8
- package/dist/collections/config/types.d.ts.map +1 -1
- package/dist/collections/config/types.js.map +1 -1
- package/dist/collections/config/useAsThumbnail.d.ts +6 -0
- package/dist/collections/config/useAsThumbnail.d.ts.map +1 -0
- package/dist/collections/config/useAsThumbnail.js +28 -0
- package/dist/collections/config/useAsThumbnail.js.map +1 -0
- package/dist/collections/operations/count.d.ts.map +1 -1
- package/dist/collections/operations/count.js +65 -70
- package/dist/collections/operations/count.js.map +1 -1
- package/dist/collections/operations/countVersions.d.ts.map +1 -1
- package/dist/collections/operations/countVersions.js +61 -66
- package/dist/collections/operations/countVersions.js.map +1 -1
- package/dist/collections/operations/create.d.ts.map +1 -1
- package/dist/collections/operations/create.js +1 -0
- package/dist/collections/operations/create.js.map +1 -1
- package/dist/collections/operations/delete.d.ts.map +1 -1
- package/dist/collections/operations/delete.js +1 -0
- package/dist/collections/operations/delete.js.map +1 -1
- package/dist/collections/operations/deleteByID.d.ts.map +1 -1
- package/dist/collections/operations/deleteByID.js +1 -0
- package/dist/collections/operations/deleteByID.js.map +1 -1
- package/dist/collections/operations/docAccess.d.ts.map +1 -1
- package/dist/collections/operations/docAccess.js +19 -25
- package/dist/collections/operations/docAccess.js.map +1 -1
- package/dist/collections/operations/find.d.ts.map +1 -1
- package/dist/collections/operations/find.js +248 -246
- package/dist/collections/operations/find.js.map +1 -1
- package/dist/collections/operations/findByID.d.ts.map +1 -1
- package/dist/collections/operations/findByID.js +215 -220
- package/dist/collections/operations/findByID.js.map +1 -1
- package/dist/collections/operations/findDistinct.d.ts.map +1 -1
- package/dist/collections/operations/findDistinct.js +161 -159
- package/dist/collections/operations/findDistinct.js.map +1 -1
- package/dist/collections/operations/findVersionByID.d.ts.map +1 -1
- package/dist/collections/operations/findVersionByID.js +131 -136
- package/dist/collections/operations/findVersionByID.js.map +1 -1
- package/dist/collections/operations/findVersions.d.ts.map +1 -1
- package/dist/collections/operations/findVersions.js +152 -149
- package/dist/collections/operations/findVersions.js.map +1 -1
- package/dist/collections/operations/restoreVersion.d.ts.map +1 -1
- package/dist/collections/operations/restoreVersion.js +1 -0
- package/dist/collections/operations/restoreVersion.js.map +1 -1
- package/dist/collections/operations/update.d.ts.map +1 -1
- package/dist/collections/operations/update.js +10 -1
- package/dist/collections/operations/update.js.map +1 -1
- package/dist/collections/operations/updateByID.d.ts.map +1 -1
- package/dist/collections/operations/updateByID.js +2 -0
- package/dist/collections/operations/updateByID.js.map +1 -1
- package/dist/config/client.d.ts +1 -1
- package/dist/config/client.d.ts.map +1 -1
- package/dist/config/client.js +1 -0
- package/dist/config/client.js.map +1 -1
- package/dist/config/client.spec.js +20 -0
- package/dist/config/client.spec.js.map +1 -0
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/defaults.js +43 -39
- package/dist/config/defaults.js.map +1 -1
- package/dist/config/orderable/index.d.ts.map +1 -1
- package/dist/config/orderable/index.js +1 -0
- package/dist/config/orderable/index.js.map +1 -1
- package/dist/config/sanitize.d.ts.map +1 -1
- package/dist/config/sanitize.js +5 -1
- package/dist/config/sanitize.js.map +1 -1
- package/dist/config/sanitize.spec.js +105 -0
- package/dist/config/sanitize.spec.js.map +1 -0
- package/dist/config/types.d.ts +415 -412
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config/types.js.map +1 -1
- package/dist/database/queryValidation/validateQueryPaths.d.ts.map +1 -1
- package/dist/database/queryValidation/validateQueryPaths.js +8 -1
- package/dist/database/queryValidation/validateQueryPaths.js.map +1 -1
- package/dist/database/queryValidation/validateSortQuery.d.ts +23 -0
- package/dist/database/queryValidation/validateSortQuery.d.ts.map +1 -0
- package/dist/database/queryValidation/validateSortQuery.js +54 -0
- package/dist/database/queryValidation/validateSortQuery.js.map +1 -0
- package/dist/database/sanitizeJoinQuery.d.ts.map +1 -1
- package/dist/database/sanitizeJoinQuery.js +7 -0
- package/dist/database/sanitizeJoinQuery.js.map +1 -1
- package/dist/duplicateDocument/index.js +1 -0
- package/dist/duplicateDocument/index.js.map +1 -1
- package/dist/globals/config/sanitize.d.ts.map +1 -1
- package/dist/globals/config/sanitize.js +23 -0
- package/dist/globals/config/sanitize.js.map +1 -1
- package/dist/globals/config/sanitize.spec.js +221 -2
- package/dist/globals/config/sanitize.spec.js.map +1 -1
- package/dist/globals/config/types.d.ts +21 -16
- package/dist/globals/config/types.d.ts.map +1 -1
- package/dist/globals/config/types.js.map +1 -1
- package/dist/globals/operations/countGlobalVersions.d.ts.map +1 -1
- package/dist/globals/operations/countGlobalVersions.js +51 -56
- package/dist/globals/operations/countGlobalVersions.js.map +1 -1
- package/dist/globals/operations/docAccess.d.ts.map +1 -1
- package/dist/globals/operations/docAccess.js +19 -25
- package/dist/globals/operations/docAccess.js.map +1 -1
- package/dist/globals/operations/findOne.d.ts.map +1 -1
- package/dist/globals/operations/findOne.js +169 -174
- package/dist/globals/operations/findOne.js.map +1 -1
- package/dist/globals/operations/findVersionByID.d.ts.map +1 -1
- package/dist/globals/operations/findVersionByID.js +104 -109
- package/dist/globals/operations/findVersionByID.js.map +1 -1
- package/dist/globals/operations/findVersions.d.ts.map +1 -1
- package/dist/globals/operations/findVersions.js +112 -109
- package/dist/globals/operations/findVersions.js.map +1 -1
- package/dist/globals/operations/restoreVersion.js +1 -0
- package/dist/globals/operations/restoreVersion.js.map +1 -1
- package/dist/globals/operations/update.d.ts.map +1 -1
- package/dist/globals/operations/update.js +1 -0
- package/dist/globals/operations/update.js.map +1 -1
- package/dist/hierarchy/addHierarchyToCollection.js +2 -0
- package/dist/hierarchy/addHierarchyToCollection.js.map +1 -1
- package/dist/hierarchy/resolveHierarchyCollections.js +43 -34
- package/dist/hierarchy/resolveHierarchyCollections.js.map +1 -1
- package/dist/index.bundled.d.ts +594 -464
- package/dist/index.d.ts +16 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -46
- package/dist/index.js.map +1 -1
- package/dist/preferences/types.d.ts +2 -0
- package/dist/preferences/types.d.ts.map +1 -1
- package/dist/preferences/types.js.map +1 -1
- package/dist/uploads/checkFileAccess.js +1 -0
- package/dist/uploads/checkFileAccess.js.map +1 -1
- package/dist/uploads/cropImage.d.ts +1 -1
- package/dist/uploads/cropImage.d.ts.map +1 -1
- package/dist/uploads/cropImage.js.map +1 -1
- package/dist/uploads/endpoints/getFileFromURL.js +2 -0
- package/dist/uploads/endpoints/getFileFromURL.js.map +1 -1
- package/dist/uploads/fetchAPI-multipart/isEligibleRequest.js +1 -2
- package/dist/uploads/fetchAPI-multipart/isEligibleRequest.js.map +1 -1
- package/dist/uploads/fetchAPI-multipart/isEligibleRequest.spec.js +28 -0
- package/dist/uploads/fetchAPI-multipart/isEligibleRequest.spec.js.map +1 -1
- package/dist/utilities/canAccessAdmin.js +1 -0
- package/dist/utilities/canAccessAdmin.js.map +1 -1
- package/dist/utilities/getEntityPermissions/getEntityPermissions.d.ts.map +1 -1
- package/dist/utilities/getEntityPermissions/getEntityPermissions.js +1 -0
- package/dist/utilities/getEntityPermissions/getEntityPermissions.js.map +1 -1
- package/dist/utilities/getNextVersion.d.ts +7 -0
- package/dist/utilities/getNextVersion.d.ts.map +1 -0
- package/dist/utilities/getNextVersion.js +20 -0
- package/dist/utilities/getNextVersion.js.map +1 -0
- package/dist/utilities/getNextVersion.spec.js +16 -0
- package/dist/utilities/getNextVersion.spec.js.map +1 -0
- package/dist/utilities/getRequestOrigin.d.ts.map +1 -1
- package/dist/utilities/getRequestOrigin.js.map +1 -1
- package/dist/utilities/getSafeRedirect.d.ts.map +1 -1
- package/dist/utilities/getSafeRedirect.js +16 -9
- package/dist/utilities/getSafeRedirect.js.map +1 -1
- package/dist/utilities/getSafeRedirect.spec.js +96 -2
- package/dist/utilities/getSafeRedirect.spec.js.map +1 -1
- package/dist/utilities/headersWithCors.js +1 -1
- package/dist/utilities/headersWithCors.js.map +1 -1
- package/dist/utilities/killTransaction.d.ts +7 -0
- package/dist/utilities/killTransaction.d.ts.map +1 -1
- package/dist/utilities/killTransaction.js +7 -0
- package/dist/utilities/killTransaction.js.map +1 -1
- package/dist/utilities/logError.d.ts.map +1 -1
- package/dist/utilities/logError.js +5 -2
- package/dist/utilities/logError.js.map +1 -1
- package/dist/utilities/nextJsDevReloadStrategy.d.ts +7 -0
- package/dist/utilities/nextJsDevReloadStrategy.d.ts.map +1 -0
- package/dist/utilities/nextJsDevReloadStrategy.js +59 -0
- package/dist/utilities/nextJsDevReloadStrategy.js.map +1 -0
- package/dist/utilities/nextJsDevReloadStrategy.spec.js +123 -0
- package/dist/utilities/nextJsDevReloadStrategy.spec.js.map +1 -0
- package/dist/versions/drafts/appendVersionToQueryKey.js +1 -3
- package/dist/versions/drafts/appendVersionToQueryKey.js.map +1 -1
- package/dist/versions/drafts/appendVersionToQueryKey.spec.js +28 -0
- package/dist/versions/drafts/appendVersionToQueryKey.spec.js.map +1 -0
- package/package.json +5 -4
- package/skills/payload/SKILL.md +526 -0
- package/skills/payload/reference/ACCESS-CONTROL-ADVANCED.md +704 -0
- package/skills/payload/reference/ACCESS-CONTROL.md +696 -0
- package/skills/payload/reference/ADAPTERS.md +305 -0
- package/skills/payload/reference/ADVANCED.md +386 -0
- package/skills/payload/reference/COLLECTIONS.md +333 -0
- package/skills/payload/reference/ENDPOINTS.md +634 -0
- package/skills/payload/reference/FIELD-TYPE-GUARDS.md +553 -0
- package/skills/payload/reference/FIELDS.md +745 -0
- package/skills/payload/reference/HOOKS.md +186 -0
- package/skills/payload/reference/PLUGIN-DEVELOPMENT.md +1436 -0
- package/skills/payload/reference/QUERIES.md +274 -0
|
@@ -10,7 +10,7 @@ import type { LanguageOptions } from '../LanguageOptions.js';
|
|
|
10
10
|
import type { Data, StaticDescription } from '../types.js';
|
|
11
11
|
import type { DocumentSubViewTypes } from './document.js';
|
|
12
12
|
export type AdminViewConfig = {
|
|
13
|
-
Component: PayloadComponent
|
|
13
|
+
Component: PayloadComponent<AdminViewServerProps>;
|
|
14
14
|
/** Whether the path should be matched exactly or as a prefix */
|
|
15
15
|
exact?: boolean;
|
|
16
16
|
meta?: MetaConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/admin/views/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAA;AAExE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AACrE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAA;AAClF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,KAAK,EACV,eAAe,EACf,MAAM,EACN,UAAU,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AAA;AAEjB,MAAM,MAAM,mBAAmB,GAAG;IAChC,gBAAgB,CAAC,EAAE,eAAe,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,CAAA;IACzD,YAAY,CAAC,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAA;IACjD,WAAW,EAAE,eAAe,EAAE,CAAA;CAC/B,CAAA;AAGD,MAAM,MAAM,0BAA0B,GAAG;IACvC,cAAc,CAAC,EAAE,yBAAyB,CAAC,MAAM,CAAC,CAAA;IAClD,WAAW,EAAE,iBAAiB,CAAA;CAC/B,CAAA;AAED,MAAM,MAAM,8BAA8B,GAAG,EAAE,GAAG,WAAW,CAAA;AAE7D,MAAM,MAAM,0BAA0B,GAAG,0BAA0B,GAAG,8BAA8B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/admin/views/index.ts"],"sourcesContent":["import type { ClientTranslationsObject } from '@payloadcms/translations'\n\nimport type { SanitizedPermissions } from '../../auth/index.js'\nimport type { ImportMap } from '../../bin/generateImportMap/index.js'\nimport type { SanitizedCollectionConfig } from '../../collections/config/types.js'\nimport type { ClientConfig } from '../../config/client.js'\nimport type {\n CustomComponent,\n Locale,\n MetaConfig,\n PayloadComponent,\n SanitizedConfig,\n ServerProps,\n} from '../../config/types.js'\nimport type { SanitizedGlobalConfig } from '../../globals/config/types.js'\nimport type { PayloadRequest } from '../../types/index.js'\nimport type { LanguageOptions } from '../LanguageOptions.js'\nimport type { Data, StaticDescription } from '../types.js'\nimport type { DocumentSubViewTypes } from './document.js'\n\nexport type AdminViewConfig = {\n Component: PayloadComponent
|
|
1
|
+
{"version":3,"sources":["../../../src/admin/views/index.ts"],"sourcesContent":["import type { ClientTranslationsObject } from '@payloadcms/translations'\n\nimport type { SanitizedPermissions } from '../../auth/index.js'\nimport type { ImportMap } from '../../bin/generateImportMap/index.js'\nimport type { SanitizedCollectionConfig } from '../../collections/config/types.js'\nimport type { ClientConfig } from '../../config/client.js'\nimport type {\n CustomComponent,\n Locale,\n MetaConfig,\n PayloadComponent,\n SanitizedConfig,\n ServerProps,\n} from '../../config/types.js'\nimport type { SanitizedGlobalConfig } from '../../globals/config/types.js'\nimport type { PayloadRequest } from '../../types/index.js'\nimport type { LanguageOptions } from '../LanguageOptions.js'\nimport type { Data, StaticDescription } from '../types.js'\nimport type { DocumentSubViewTypes } from './document.js'\n\nexport type AdminViewConfig = {\n Component: PayloadComponent<AdminViewServerProps>\n /** Whether the path should be matched exactly or as a prefix */\n exact?: boolean\n meta?: MetaConfig\n /**\n * Any valid URL path or array of paths that [`path-to-regexp`](https://www.npmjs.com/package/path-to-regex) understands. Must begin with a forward slash (`/`).\n */\n path?: `/${string}`\n sensitive?: boolean\n strict?: boolean\n}\n\nexport type AdminViewClientProps = {\n clientConfig: ClientConfig\n collectionSlug?: SanitizedCollectionConfig['slug']\n docID?: number | string\n documentSubViewType?: DocumentSubViewTypes\n folderID?: number | string\n globalSlug?: SanitizedGlobalConfig['slug']\n viewType: ViewTypes\n}\n\nexport type AdminViewServerPropsOnly = {\n readonly clientConfig: ClientConfig\n readonly collectionConfig?: SanitizedCollectionConfig\n readonly disableActions?: boolean\n /**\n * @todo remove `docID` here as it is already contained in `initPageResult`\n */\n readonly docID?: number | string\n readonly globalConfig?: SanitizedGlobalConfig\n readonly importMap: ImportMap\n readonly initialData?: Data\n readonly initPageResult: InitPageResult\n readonly params?: { [key: string]: string | string[] | undefined }\n readonly redirectAfterCreate?: boolean\n readonly redirectAfterDelete?: boolean\n readonly redirectAfterDuplicate?: boolean\n readonly redirectAfterRestore?: boolean\n readonly viewActions?: CustomComponent[]\n} & ServerProps\n\nexport type AdminViewServerProps = AdminViewClientProps & AdminViewServerPropsOnly\n\n/**\n * @deprecated This should be removed in favor of direct props\n */\nexport type AdminViewComponent = PayloadComponent<AdminViewServerProps>\n\nexport type VisibleEntities = {\n collections: SanitizedCollectionConfig['slug'][]\n globals: SanitizedGlobalConfig['slug'][]\n}\n\nexport type InitPageResult = {\n collectionConfig?: SanitizedCollectionConfig\n cookies: Map<string, string>\n docID?: number | string\n globalConfig?: SanitizedGlobalConfig\n languageOptions: LanguageOptions\n locale?: Locale\n permissions: SanitizedPermissions\n redirectTo?: string\n req: PayloadRequest\n translations: ClientTranslationsObject\n visibleEntities: VisibleEntities\n}\n\n/**\n * @todo This should be renamed to `ViewType` (singular)\n */\nexport type ViewTypes =\n | 'account'\n | 'createFirstUser'\n | 'dashboard'\n | 'document'\n | 'hierarchy'\n | 'list'\n | 'reset'\n | 'trash'\n | 'verify'\n | 'version'\n | ({} & string)\n\nexport type ServerPropsFromView = {\n collectionConfig?: SanitizedConfig['collections'][number]\n globalConfig?: SanitizedConfig['globals'][number]\n viewActions: CustomComponent[]\n}\n\n// Description\nexport type ViewDescriptionClientProps = {\n collectionSlug?: SanitizedCollectionConfig['slug']\n description: StaticDescription\n}\n\nexport type ViewDescriptionServerPropsOnly = {} & ServerProps\n\nexport type ViewDescriptionServerProps = ViewDescriptionClientProps & ViewDescriptionServerPropsOnly\n"],"names":[],"mappings":"AAuHA,WAAoG"}
|
|
@@ -27,6 +27,11 @@ export type HierarchyViewData = {
|
|
|
27
27
|
}>;
|
|
28
28
|
/** Children of the current parent (same collection) */
|
|
29
29
|
childrenData: PaginatedDocs;
|
|
30
|
+
/**
|
|
31
|
+
* The collection that owns the folder tree being walked. Equals the viewed collection when it
|
|
32
|
+
* owns the hierarchy, and the folder collection when the view is scoped to a related collection.
|
|
33
|
+
*/
|
|
34
|
+
hierarchySlug: string;
|
|
30
35
|
/** The current parent document data (for display and collectionSpecific field access) */
|
|
31
36
|
parent: null | (Record<string, unknown> & TypeWithID);
|
|
32
37
|
/** The parent field name for building queries */
|
|
@@ -37,6 +42,11 @@ export type HierarchyViewData = {
|
|
|
37
42
|
relatedBaseFilters?: Record<string, Where>;
|
|
38
43
|
/** Related documents grouped by collection */
|
|
39
44
|
relatedDocumentsByCollection: RelatedDocumentsGrouped;
|
|
45
|
+
/**
|
|
46
|
+
* Set when the view browses one related collection's documents by folder (e.g. Media by Folder),
|
|
47
|
+
* rather than the folder collection's own list of everything it contains.
|
|
48
|
+
*/
|
|
49
|
+
scopedCollectionSlug?: string;
|
|
40
50
|
};
|
|
41
51
|
export type ListViewSlots = {
|
|
42
52
|
AfterList?: React.ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/admin/views/list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,qBAAqB,CAAA;AACxE,OAAO,KAAK,EACV,sBAAsB,EACtB,yBAAyB,EACzB,UAAU,EACX,MAAM,mCAAmC,CAAA;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AACvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACxE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAA;AAEjE,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IAC3D,gFAAgF;IAChF,UAAU,CAAC,EAAE,KAAK,CAAA;IAClB,6CAA6C;IAC7C,WAAW,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,GAAG,M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uB,CAAA;AACxE,MAAM,MAAM,yBAAyB,GAAG,yBAAyB,GAAG,6BAA6B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/admin/views/list.ts"],"sourcesContent":["import type { SanitizedCollectionPermission } from '../../auth/types.js'\nimport type {\n CollectionAdminOptions,\n SanitizedCollectionConfig,\n TypeWithID,\n} from '../../collections/config/types.js'\nimport type { ServerProps } from '../../config/types.js'\nimport type { PaginatedDocs } from '../../database/types.js'\nimport type { CollectionPreferences } from '../../preferences/types.js'\nimport type { QueryPreset } from '../../query-presets/types.js'\nimport type { ResolvedFilterOptions, Where } from '../../types/index.js'\nimport type { Column } from '../elements/Table.js'\nimport type { Data, ViewTypes } from '../types.js'\nimport type { RelatedDocumentsGrouped } from './hierarchyList.js'\n\nexport type HierarchyViewData = {\n /**\n * Collections allowed for creation based on parent's collectionSpecific field.\n * Undefined means all related collections are allowed.\n * Always includes the hierarchy collection itself.\n */\n allowedCollections?: Array<{ label: string; slug: string }>\n /** Base filter applied to hierarchy collection queries (e.g., tenant filter) */\n baseFilter?: Where\n /** Breadcrumb trail to the current parent */\n breadcrumbs: Array<{ id: number | string; title: string }>\n /** Children of the current parent (same collection) */\n childrenData: PaginatedDocs\n /** The current parent document data (for display and collectionSpecific field access) */\n parent: null | (Record<string, unknown> & TypeWithID)\n /** The parent field name for building queries */\n parentFieldName: string\n /** The parent ID being viewed */\n parentId: null | number | string\n /** Base filters for related collections (keyed by collection slug) */\n relatedBaseFilters?: Record<string, Where>\n /** Related documents grouped by collection */\n relatedDocumentsByCollection: RelatedDocumentsGrouped\n}\n\nexport type ListViewSlots = {\n AfterList?: React.ReactNode\n AfterListTable?: React.ReactNode\n BeforeList?: React.ReactNode\n BeforeListTable?: React.ReactNode\n Description?: React.ReactNode\n listMenuItems?: React.ReactNode[]\n NoResults?: React.ReactNode\n Table: React.ReactNode | React.ReactNode[]\n}\n\n/**\n * The `ListViewServerPropsOnly` approach is needed to ensure type strictness when injecting component props\n * There is no way to do something like `Omit<ListViewServerProps, keyof ListViewClientProps>`\n * This is because `ListViewClientProps` is a union which is impossible to exclude from\n * Exporting explicitly defined `ListViewServerPropsOnly`, etc. allows for the strictest typing\n */\nexport type ListViewServerPropsOnly = {\n collectionConfig: SanitizedCollectionConfig\n data: Data\n limit: number\n listPreferences: CollectionPreferences\n listSearchableFields: CollectionAdminOptions['listSearchableFields']\n} & ServerProps\n\nexport type ListViewServerProps = ListViewClientProps & ListViewServerPropsOnly\n\nexport type ListViewClientProps = {\n baseFilter?: Where\n beforeActions?: React.ReactNode[]\n collectionSlug: SanitizedCollectionConfig['slug']\n columnState: Column[]\n disableBulkDelete?: boolean\n disableBulkEdit?: boolean\n disableQueryPresets?: boolean\n enableRowSelections?: boolean\n hasCreatePermission: boolean\n hasDeletePermission?: boolean\n hasTrashPermission?: boolean\n /**\n * Hierarchy view data - present when viewing a hierarchy collection with a parent selected\n */\n hierarchyData?: HierarchyViewData\n /**\n * Resolved full-size icon component for hierarchy collections (used in drawer subheader)\n */\n HierarchyIcon?: React.ReactNode\n /**\n * Resolved small icon component for hierarchy collections (used in table rows)\n */\n HierarchySmallIcon?: React.ReactNode\n /**\n * @deprecated\n */\n listPreferences?: CollectionPreferences\n newDocumentURL: string\n /**\n * @deprecated\n */\n preferenceKey?: string\n queryPreset?: QueryPreset\n queryPresetPermissions?: SanitizedCollectionPermission\n renderedFilters?: Map<string, React.ReactNode>\n resolvedFilterOptions?: Map<string, ResolvedFilterOptions>\n viewType: ViewTypes\n} & ListViewSlots\n\nexport type ListViewSlotSharedClientProps = {\n collectionSlug: SanitizedCollectionConfig['slug']\n hasCreatePermission: boolean\n hasDeletePermission?: boolean\n hasTrashPermission?: boolean\n newDocumentURL: string\n viewType: ViewTypes\n}\n\n// BeforeList\nexport type BeforeListClientProps = ListViewSlotSharedClientProps\nexport type BeforeListServerPropsOnly = {} & ListViewServerPropsOnly\nexport type BeforeListServerProps = BeforeListClientProps & BeforeListServerPropsOnly\n\n// BeforeListTable\nexport type BeforeListTableClientProps = ListViewSlotSharedClientProps\nexport type BeforeListTableServerPropsOnly = {} & ListViewServerPropsOnly\nexport type BeforeListTableServerProps = BeforeListTableClientProps & BeforeListTableServerPropsOnly\n\n// NoResults\nexport type NoResultsClientProps = ListViewSlotSharedClientProps\nexport type NoResultsServerPropsOnly = {} & ListViewServerPropsOnly\nexport type NoResultsServerProps = NoResultsClientProps & NoResultsServerPropsOnly\n\n// AfterList\nexport type AfterListClientProps = ListViewSlotSharedClientProps\nexport type AfterListServerPropsOnly = {} & ListViewServerPropsOnly\nexport type AfterListServerProps = AfterListClientProps & AfterListServerPropsOnly\n\n// AfterListTable\nexport type AfterListTableClientProps = ListViewSlotSharedClientProps\nexport type AfterListTableServerPropsOnly = {} & ListViewServerPropsOnly\nexport type AfterListTableServerProps = AfterListTableClientProps & AfterListTableServerPropsOnly\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/admin/views/list.ts"],"sourcesContent":["import type { SanitizedCollectionPermission } from '../../auth/types.js'\nimport type {\n CollectionAdminOptions,\n SanitizedCollectionConfig,\n TypeWithID,\n} from '../../collections/config/types.js'\nimport type { ServerProps } from '../../config/types.js'\nimport type { PaginatedDocs } from '../../database/types.js'\nimport type { CollectionPreferences } from '../../preferences/types.js'\nimport type { QueryPreset } from '../../query-presets/types.js'\nimport type { ResolvedFilterOptions, Where } from '../../types/index.js'\nimport type { Column } from '../elements/Table.js'\nimport type { Data, ViewTypes } from '../types.js'\nimport type { RelatedDocumentsGrouped } from './hierarchyList.js'\n\nexport type HierarchyViewData = {\n /**\n * Collections allowed for creation based on parent's collectionSpecific field.\n * Undefined means all related collections are allowed.\n * Always includes the hierarchy collection itself.\n */\n allowedCollections?: Array<{ label: string; slug: string }>\n /** Base filter applied to hierarchy collection queries (e.g., tenant filter) */\n baseFilter?: Where\n /** Breadcrumb trail to the current parent */\n breadcrumbs: Array<{ id: number | string; title: string }>\n /** Children of the current parent (same collection) */\n childrenData: PaginatedDocs\n /**\n * The collection that owns the folder tree being walked. Equals the viewed collection when it\n * owns the hierarchy, and the folder collection when the view is scoped to a related collection.\n */\n hierarchySlug: string\n /** The current parent document data (for display and collectionSpecific field access) */\n parent: null | (Record<string, unknown> & TypeWithID)\n /** The parent field name for building queries */\n parentFieldName: string\n /** The parent ID being viewed */\n parentId: null | number | string\n /** Base filters for related collections (keyed by collection slug) */\n relatedBaseFilters?: Record<string, Where>\n /** Related documents grouped by collection */\n relatedDocumentsByCollection: RelatedDocumentsGrouped\n /**\n * Set when the view browses one related collection's documents by folder (e.g. Media by Folder),\n * rather than the folder collection's own list of everything it contains.\n */\n scopedCollectionSlug?: string\n}\n\nexport type ListViewSlots = {\n AfterList?: React.ReactNode\n AfterListTable?: React.ReactNode\n BeforeList?: React.ReactNode\n BeforeListTable?: React.ReactNode\n Description?: React.ReactNode\n listMenuItems?: React.ReactNode[]\n NoResults?: React.ReactNode\n Table: React.ReactNode | React.ReactNode[]\n}\n\n/**\n * The `ListViewServerPropsOnly` approach is needed to ensure type strictness when injecting component props\n * There is no way to do something like `Omit<ListViewServerProps, keyof ListViewClientProps>`\n * This is because `ListViewClientProps` is a union which is impossible to exclude from\n * Exporting explicitly defined `ListViewServerPropsOnly`, etc. allows for the strictest typing\n */\nexport type ListViewServerPropsOnly = {\n collectionConfig: SanitizedCollectionConfig\n data: Data\n limit: number\n listPreferences: CollectionPreferences\n listSearchableFields: CollectionAdminOptions['listSearchableFields']\n} & ServerProps\n\nexport type ListViewServerProps = ListViewClientProps & ListViewServerPropsOnly\n\nexport type ListViewClientProps = {\n baseFilter?: Where\n beforeActions?: React.ReactNode[]\n collectionSlug: SanitizedCollectionConfig['slug']\n columnState: Column[]\n disableBulkDelete?: boolean\n disableBulkEdit?: boolean\n disableQueryPresets?: boolean\n enableRowSelections?: boolean\n hasCreatePermission: boolean\n hasDeletePermission?: boolean\n hasTrashPermission?: boolean\n /**\n * Hierarchy view data - present when viewing a hierarchy collection with a parent selected\n */\n hierarchyData?: HierarchyViewData\n /**\n * Resolved full-size icon component for hierarchy collections (used in drawer subheader)\n */\n HierarchyIcon?: React.ReactNode\n /**\n * Resolved small icon component for hierarchy collections (used in table rows)\n */\n HierarchySmallIcon?: React.ReactNode\n /**\n * @deprecated\n */\n listPreferences?: CollectionPreferences\n newDocumentURL: string\n /**\n * @deprecated\n */\n preferenceKey?: string\n queryPreset?: QueryPreset\n queryPresetPermissions?: SanitizedCollectionPermission\n renderedFilters?: Map<string, React.ReactNode>\n resolvedFilterOptions?: Map<string, ResolvedFilterOptions>\n viewType: ViewTypes\n} & ListViewSlots\n\nexport type ListViewSlotSharedClientProps = {\n collectionSlug: SanitizedCollectionConfig['slug']\n hasCreatePermission: boolean\n hasDeletePermission?: boolean\n hasTrashPermission?: boolean\n newDocumentURL: string\n viewType: ViewTypes\n}\n\n// BeforeList\nexport type BeforeListClientProps = ListViewSlotSharedClientProps\nexport type BeforeListServerPropsOnly = {} & ListViewServerPropsOnly\nexport type BeforeListServerProps = BeforeListClientProps & BeforeListServerPropsOnly\n\n// BeforeListTable\nexport type BeforeListTableClientProps = ListViewSlotSharedClientProps\nexport type BeforeListTableServerPropsOnly = {} & ListViewServerPropsOnly\nexport type BeforeListTableServerProps = BeforeListTableClientProps & BeforeListTableServerPropsOnly\n\n// NoResults\nexport type NoResultsClientProps = ListViewSlotSharedClientProps\nexport type NoResultsServerPropsOnly = {} & ListViewServerPropsOnly\nexport type NoResultsServerProps = NoResultsClientProps & NoResultsServerPropsOnly\n\n// AfterList\nexport type AfterListClientProps = ListViewSlotSharedClientProps\nexport type AfterListServerPropsOnly = {} & ListViewServerPropsOnly\nexport type AfterListServerProps = AfterListClientProps & AfterListServerPropsOnly\n\n// AfterListTable\nexport type AfterListTableClientProps = ListViewSlotSharedClientProps\nexport type AfterListTableServerPropsOnly = {} & ListViewServerPropsOnly\nexport type AfterListTableServerProps = AfterListTableClientProps & AfterListTableServerPropsOnly\n"],"names":[],"mappings":"AAqJA,WAAiG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apiKey.d.ts","sourceRoot":"","sources":["../../../src/auth/baseFields/apiKey.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,KAAK,EAAa,SAAS,EAAE,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"apiKey.d.ts","sourceRoot":"","sources":["../../../src/auth/baseFields/apiKey.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,KAAK,EAAa,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAqB9F,KAAK,2BAA2B,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,CAAA;AAChF,KAAK,uBAAuB,GAAG,IAAI,CACjC,OAAO,CAAC,SAAS,CAAC,EAClB,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,CACjE,CAAA;AAED,eAAO,MAAM,kBAAkB,gFAK5B;IACD,WAAW,CAAC,EAAE,uBAAuB,CAAA;IACrC,gBAAgB,CAAC,EAAE,uBAAuB,CAAA;IAC1C,iBAAiB,CAAC,EAAE,2BAA2B,CAAA;IAC/C,mBAAmB,CAAC,EAAE,OAAO,CAAA;CAC9B,KAAQ,KAAK,EAwEb,CAAA"}
|
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
import crypto from 'crypto';
|
|
2
2
|
const encryptKey = ({ req, value })=>value ? req.payload.encrypt(value) : null;
|
|
3
|
-
const decryptKey = ({ req, value })=>
|
|
3
|
+
const decryptKey = ({ req, value })=>{
|
|
4
|
+
if (!value) {
|
|
5
|
+
return undefined;
|
|
6
|
+
}
|
|
7
|
+
try {
|
|
8
|
+
return req.payload.decrypt(value);
|
|
9
|
+
} catch {
|
|
10
|
+
// The value was encrypted under a secret no longer in the keyring (e.g. a
|
|
11
|
+
// previousSecret was removed before rotateSecret re-keyed this row). Mask the
|
|
12
|
+
// field (return null, since an undefined afterRead result is treated as "no
|
|
13
|
+
// change" and would leak the ciphertext) rather than failing the whole
|
|
14
|
+
// document read; API key auth is unaffected (it matches the apiKeyIndex), and
|
|
15
|
+
// running rotateSecret restores the displayed value.
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
4
19
|
export const createAPIKeyFields = ({ apiKeyField, apiKeyIndexField, enableAPIKeyField, includeEnableAPIKey = true } = {})=>{
|
|
5
20
|
const fields = [];
|
|
6
21
|
if (includeEnableAPIKey) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/auth/baseFields/apiKey.ts"],"sourcesContent":["import crypto from 'crypto'\n\nimport type { CheckboxField, Field, FieldHook, TextField } from '../../fields/config/types.js'\n\nconst encryptKey: FieldHook = ({ req, value }) =>\n value ? req.payload.encrypt(value as string) : null\nconst decryptKey: FieldHook = ({ req, value })
|
|
1
|
+
{"version":3,"sources":["../../../src/auth/baseFields/apiKey.ts"],"sourcesContent":["import crypto from 'crypto'\n\nimport type { CheckboxField, Field, FieldHook, TextField } from '../../fields/config/types.js'\n\nconst encryptKey: FieldHook = ({ req, value }) =>\n value ? req.payload.encrypt(value as string) : null\nconst decryptKey: FieldHook = ({ req, value }) => {\n if (!value) {\n return undefined\n }\n try {\n return req.payload.decrypt(value as string)\n } catch {\n // The value was encrypted under a secret no longer in the keyring (e.g. a\n // previousSecret was removed before rotateSecret re-keyed this row). Mask the\n // field (return null, since an undefined afterRead result is treated as \"no\n // change\" and would leak the ciphertext) rather than failing the whole\n // document read; API key auth is unaffected (it matches the apiKeyIndex), and\n // running rotateSecret restores the displayed value.\n return null\n }\n}\n\ntype APIKeyCheckboxFieldOverride = Omit<Partial<CheckboxField>, 'name' | 'type'>\ntype APIKeyTextFieldOverride = Omit<\n Partial<TextField>,\n 'hasMany' | 'maxRows' | 'minRows' | 'name' | 'type' | 'validate'\n>\n\nexport const createAPIKeyFields = ({\n apiKeyField,\n apiKeyIndexField,\n enableAPIKeyField,\n includeEnableAPIKey = true,\n}: {\n apiKeyField?: APIKeyTextFieldOverride\n apiKeyIndexField?: APIKeyTextFieldOverride\n enableAPIKeyField?: APIKeyCheckboxFieldOverride\n includeEnableAPIKey?: boolean\n} = {}): Field[] => {\n const fields: Field[] = []\n\n if (includeEnableAPIKey) {\n fields.push({\n name: 'enableAPIKey',\n type: 'checkbox',\n ...enableAPIKeyField,\n admin: {\n components: {\n Field: false,\n },\n ...enableAPIKeyField?.admin,\n },\n label: enableAPIKeyField?.label ?? (({ t }) => t('authentication:enableAPIKey')),\n })\n }\n\n fields.push(\n {\n name: 'apiKey',\n type: 'text',\n ...apiKeyField,\n admin: {\n components: {\n Field: false,\n },\n ...apiKeyField?.admin,\n },\n hooks: {\n afterRead: [decryptKey],\n beforeChange: [encryptKey],\n ...apiKeyField?.hooks,\n },\n label: apiKeyField?.label ?? (({ t }) => t('authentication:apiKey')),\n },\n {\n name: 'apiKeyIndex',\n type: 'text',\n ...apiKeyIndexField,\n admin: {\n disabled: true,\n ...apiKeyIndexField?.admin,\n },\n hidden: apiKeyIndexField?.hidden ?? true,\n hooks: {\n beforeValidate: [\n ({ data, req, value }) => {\n if (data?.apiKey === false || data?.apiKey === null || data?.apiKey === '') {\n return null\n }\n if (\n includeEnableAPIKey &&\n (data?.enableAPIKey === false || data?.enableAPIKey === null)\n ) {\n return null\n }\n if (data?.apiKey) {\n return crypto\n .createHmac('sha256', req.payload.secret)\n .update(data.apiKey as string)\n .digest('hex')\n }\n return value\n },\n ],\n ...apiKeyIndexField?.hooks,\n },\n },\n )\n\n return fields\n}\n"],"names":["crypto","encryptKey","req","value","payload","encrypt","decryptKey","undefined","decrypt","createAPIKeyFields","apiKeyField","apiKeyIndexField","enableAPIKeyField","includeEnableAPIKey","fields","push","name","type","admin","components","Field","label","t","hooks","afterRead","beforeChange","disabled","hidden","beforeValidate","data","apiKey","enableAPIKey","createHmac","secret","update","digest"],"mappings":"AAAA,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YACLQ,UAAU;YACV,GAAGf,kBAAkBO,KAAK;QAC5B;QACAS,QAAQhB,kBAAkBgB,UAAU;QACpCJ,OAAO;YACLK,gBAAgB;gBACd,CAAC,EAAEC,IAAI,EAAE3B,GAAG,EAAEC,KAAK,EAAE;oBACnB,IAAI0B,MAAMC,WAAW,SAASD,MAAMC,WAAW,QAAQD,MAAMC,WAAW,IAAI;wBAC1E,OAAO;oBACT;oBACA,IACEjB,uBACCgB,CAAAA,MAAME,iBAAiB,SAASF,MAAME,iBAAiB,IAAG,GAC3D;wBACA,OAAO;oBACT;oBACA,IAAIF,MAAMC,QAAQ;wBAChB,OAAO9B,OACJgC,UAAU,CAAC,UAAU9B,IAAIE,OAAO,CAAC6B,MAAM,EACvCC,MAAM,CAACL,KAAKC,MAAM,EAClBK,MAAM,CAAC;oBACZ;oBACA,OAAOhC;gBACT;aACD;YACD,GAAGQ,kBAAkBY,KAAK;QAC5B;IACF;IAGF,OAAOT;AACT,EAAC"}
|
package/dist/auth/crypto.d.ts
CHANGED
|
@@ -1,3 +1,74 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* A single secret in the keyring, with its derived keys precomputed.
|
|
3
|
+
*/
|
|
4
|
+
export type EncryptionKey = {
|
|
5
|
+
/** One-way fingerprint of `v1Key` (16 hex chars), stored in the v1 envelope. */
|
|
6
|
+
keyId: string;
|
|
7
|
+
/** Legacy 32-char key for aes-256-ctr and the apiKey HMAC index. */
|
|
8
|
+
legacyKey: string;
|
|
9
|
+
/** The raw `PAYLOAD_SECRET` string. */
|
|
10
|
+
secret: string;
|
|
11
|
+
/** True 32-byte key (HKDF) for the aes-256-gcm v1 envelope. */
|
|
12
|
+
v1Key: Buffer;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* The set of secrets Payload accepts. `active` is used for all writes; every
|
|
16
|
+
* entry (active + `previousSecrets`) is accepted for reads.
|
|
17
|
+
*/
|
|
18
|
+
export type EncryptionKeyring = {
|
|
19
|
+
/** Entry used for all new writes (the current `PAYLOAD_SECRET`). */
|
|
20
|
+
active: EncryptionKey;
|
|
21
|
+
all: EncryptionKey[];
|
|
22
|
+
/** keyId -> entry, for O(1) v1 key selection. */
|
|
23
|
+
byId: Record<string, EncryptionKey>;
|
|
24
|
+
};
|
|
25
|
+
type CryptoContext = {
|
|
26
|
+
encryptionKeyring: EncryptionKeyring;
|
|
27
|
+
secret: string;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Legacy key derivation (pre-v1 aes-256-ctr values and the apiKey HMAC index).
|
|
31
|
+
* Kept in sync with `BasePayload.secret`.
|
|
32
|
+
*/
|
|
33
|
+
export declare const deriveSecretKey: (secret: string) => string;
|
|
34
|
+
/**
|
|
35
|
+
* v1 key derivation: a true 32-byte key via HKDF, correcting the reduced
|
|
36
|
+
* effective entropy of the legacy derivation.
|
|
37
|
+
*/
|
|
38
|
+
export declare const deriveKeyV1: (secret: string) => Buffer;
|
|
39
|
+
/** Non-secret fingerprint of a v1 key, used to select the key on decrypt. */
|
|
40
|
+
export declare const keyIdFor: (v1Key: Buffer) => string;
|
|
41
|
+
export declare const buildEncryptionKey: (secret: string) => EncryptionKey;
|
|
42
|
+
/**
|
|
43
|
+
* Builds the keyring from the active secret followed by any previous secrets.
|
|
44
|
+
* The first entry is the active (writing) key.
|
|
45
|
+
*/
|
|
46
|
+
export declare const buildEncryptionKeyring: (secrets: string[]) => EncryptionKeyring;
|
|
47
|
+
/**
|
|
48
|
+
* Encrypts `text` under the active secret using the versioned aes-256-gcm
|
|
49
|
+
* envelope `v1:<keyId>:<iv>:<authTag>:<ciphertext>`. Pass `options.secret` (the
|
|
50
|
+
* raw `PAYLOAD_SECRET`) to encrypt under a specific secret instead.
|
|
51
|
+
*/
|
|
52
|
+
export declare function encrypt(this: CryptoContext, text: string, options?: {
|
|
53
|
+
secret?: string;
|
|
54
|
+
}): string;
|
|
55
|
+
/**
|
|
56
|
+
* Decrypts a value produced by {@link encrypt}. Dispatches on format: v1
|
|
57
|
+
* envelopes are authenticated (aes-256-gcm) and select their key by keyId from
|
|
58
|
+
* the keyring; pre-v1 values fall back to aes-256-ctr. Pass `options.secret` to
|
|
59
|
+
* decrypt under a specific secret (e.g. to read data encrypted under a previous
|
|
60
|
+
* secret during a rotation).
|
|
61
|
+
*/
|
|
62
|
+
export declare function decrypt(this: CryptoContext, hash: string, options?: {
|
|
63
|
+
secret?: string;
|
|
64
|
+
}): string;
|
|
65
|
+
/**
|
|
66
|
+
* Re-encrypts a value that was encrypted under a previous secret: decrypts it
|
|
67
|
+
* with `options.oldSecret`, then re-encrypts it with the active secret. Also
|
|
68
|
+
* upgrades a legacy aes-256-ctr value to the v1 envelope.
|
|
69
|
+
*/
|
|
70
|
+
export declare function reencrypt(this: CryptoContext, hash: string, options: {
|
|
71
|
+
oldSecret: string;
|
|
72
|
+
}): string;
|
|
73
|
+
export {};
|
|
3
74
|
//# sourceMappingURL=crypto.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src/auth/crypto.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src/auth/crypto.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,gFAAgF;IAChF,KAAK,EAAE,MAAM,CAAA;IACb,oEAAoE;IACpE,SAAS,EAAE,MAAM,CAAA;IACjB,uCAAuC;IACvC,MAAM,EAAE,MAAM,CAAA;IACd,+DAA+D;IAC/D,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,oEAAoE;IACpE,MAAM,EAAE,aAAa,CAAA;IACrB,GAAG,EAAE,aAAa,EAAE,CAAA;IACpB,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;CACpC,CA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1';
|
|
5
|
+
/**
|
|
6
|
+
* Legacy key derivation (pre-v1 aes-256-ctr values and the apiKey HMAC index).
|
|
7
|
+
* Kept in sync with `BasePayload.secret`.
|
|
8
|
+
*/ export const deriveSecretKey = (secret)=>crypto.createHash('sha256').update(secret).digest('hex').slice(0, 32);
|
|
9
|
+
/**
|
|
10
|
+
* v1 key derivation: a true 32-byte key via HKDF, correcting the reduced
|
|
11
|
+
* effective entropy of the legacy derivation.
|
|
12
|
+
*/ export const deriveKeyV1 = (secret)=>Buffer.from(crypto.hkdfSync('sha256', secret, '', 'payload-secret-v1', 32));
|
|
13
|
+
/** Non-secret fingerprint of a v1 key, used to select the key on decrypt. */ export const keyIdFor = (v1Key)=>crypto.createHash('sha256').update(v1Key).digest('hex').slice(0, 16);
|
|
14
|
+
export const buildEncryptionKey = (secret)=>{
|
|
15
|
+
const v1Key = deriveKeyV1(secret);
|
|
16
|
+
return {
|
|
17
|
+
keyId: keyIdFor(v1Key),
|
|
18
|
+
legacyKey: deriveSecretKey(secret),
|
|
19
|
+
secret,
|
|
20
|
+
v1Key
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Builds the keyring from the active secret followed by any previous secrets.
|
|
25
|
+
* The first entry is the active (writing) key.
|
|
26
|
+
*/ export const buildEncryptionKeyring = (secrets)=>{
|
|
27
|
+
const all = secrets.map(buildEncryptionKey);
|
|
28
|
+
const byId = {};
|
|
29
|
+
for (const key of all){
|
|
30
|
+
// First writer wins if two secrets somehow share a keyId.
|
|
31
|
+
if (!byId[key.keyId]) {
|
|
32
|
+
byId[key.keyId] = key;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
active: all[0],
|
|
37
|
+
all,
|
|
38
|
+
byId
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Encrypts `text` under the active secret using the versioned aes-256-gcm
|
|
43
|
+
* envelope `v1:<keyId>:<iv>:<authTag>:<ciphertext>`. Pass `options.secret` (the
|
|
44
|
+
* raw `PAYLOAD_SECRET`) to encrypt under a specific secret instead.
|
|
45
|
+
*/ export function encrypt(text, options) {
|
|
46
|
+
const key = options?.secret ? buildEncryptionKey(options.secret) : this.encryptionKeyring.active;
|
|
47
|
+
const iv = crypto.randomBytes(12);
|
|
48
|
+
const cipher = crypto.createCipheriv(v1Algorithm, key.v1Key, iv);
|
|
49
|
+
const ciphertext = cipher.update(text, 'utf8', 'hex') + cipher.final('hex');
|
|
50
|
+
const authTag = cipher.getAuthTag().toString('hex');
|
|
51
|
+
return `${v1Prefix}:${key.keyId}:${iv.toString('hex')}:${authTag}:${ciphertext}`;
|
|
11
52
|
}
|
|
12
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Decrypts a value produced by {@link encrypt}. Dispatches on format: v1
|
|
55
|
+
* envelopes are authenticated (aes-256-gcm) and select their key by keyId from
|
|
56
|
+
* the keyring; pre-v1 values fall back to aes-256-ctr. Pass `options.secret` to
|
|
57
|
+
* decrypt under a specific secret (e.g. to read data encrypted under a previous
|
|
58
|
+
* secret during a rotation).
|
|
59
|
+
*/ export function decrypt(hash, options) {
|
|
60
|
+
if (hash.startsWith(`${v1Prefix}:`)) {
|
|
61
|
+
const parts = hash.split(':');
|
|
62
|
+
if (parts.length !== 5) {
|
|
63
|
+
throw new Error('decrypt: malformed v1 envelope, expected "v1:keyId:iv:authTag:ciphertext".');
|
|
64
|
+
}
|
|
65
|
+
const [, keyId, ivHex, authTagHex, ciphertext] = parts;
|
|
66
|
+
const key = options?.secret ? buildEncryptionKey(options.secret) : this.encryptionKeyring.byId[keyId];
|
|
67
|
+
if (!key) {
|
|
68
|
+
throw new Error(`decrypt: no secret in the keyring matches key id "${keyId}". Add the secret that encrypted this value to config.previousSecrets.`);
|
|
69
|
+
}
|
|
70
|
+
const decipher = crypto.createDecipheriv(v1Algorithm, key.v1Key, Buffer.from(ivHex, 'hex'));
|
|
71
|
+
decipher.setAuthTag(Buffer.from(authTagHex, 'hex'));
|
|
72
|
+
// final() throws on a wrong key or tampered ciphertext.
|
|
73
|
+
return decipher.update(ciphertext, 'hex', 'utf8') + decipher.final('utf8');
|
|
74
|
+
}
|
|
75
|
+
// Legacy aes-256-ctr is unauthenticated, so it cannot verify a key and a wrong
|
|
76
|
+
// key returns garbage instead of throwing. We therefore intentionally use only
|
|
77
|
+
// the explicit or active key here (never trial the keyring): a legacy value
|
|
78
|
+
// written under a previous secret decrypts to garbage until rotateSecret
|
|
79
|
+
// upgrades it to the authenticated v1 envelope. API key auth is unaffected
|
|
80
|
+
// (it matches the HMAC apiKeyIndex, which is keyring-aware).
|
|
81
|
+
const legacyKey = options?.secret ? deriveSecretKey(options.secret) : this.secret;
|
|
13
82
|
const iv = hash.slice(0, 32);
|
|
14
83
|
const content = hash.slice(32);
|
|
15
|
-
|
|
16
|
-
const secret = this.secret;
|
|
17
|
-
const decipher = crypto.createDecipheriv(algorithm, secret, Buffer.from(iv, 'hex'));
|
|
84
|
+
const decipher = crypto.createDecipheriv(legacyAlgorithm, legacyKey, Buffer.from(iv, 'hex'));
|
|
18
85
|
return decipher.update(content, 'hex', 'utf8') + decipher.final('utf8');
|
|
19
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* Re-encrypts a value that was encrypted under a previous secret: decrypts it
|
|
89
|
+
* with `options.oldSecret`, then re-encrypts it with the active secret. Also
|
|
90
|
+
* upgrades a legacy aes-256-ctr value to the v1 envelope.
|
|
91
|
+
*/ export function reencrypt(hash, options) {
|
|
92
|
+
const plaintext = decrypt.call(this, hash, {
|
|
93
|
+
secret: options.oldSecret
|
|
94
|
+
});
|
|
95
|
+
return encrypt.call(this, plaintext);
|
|
96
|
+
}
|
|
20
97
|
|
|
21
98
|
//# sourceMappingURL=crypto.js.map
|
package/dist/auth/crypto.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/auth/crypto.ts"],"sourcesContent":["import crypto from 'crypto'\n\nconst
|
|
1
|
+
{"version":3,"sources":["../../src/auth/crypto.ts"],"sourcesContent":["import crypto from 'crypto'\n\n/**\n * A single secret in the keyring, with its derived keys precomputed.\n */\nexport type EncryptionKey = {\n /** One-way fingerprint of `v1Key` (16 hex chars), stored in the v1 envelope. */\n keyId: string\n /** Legacy 32-char key for aes-256-ctr and the apiKey HMAC index. */\n legacyKey: string\n /** The raw `PAYLOAD_SECRET` string. */\n secret: string\n /** True 32-byte key (HKDF) for the aes-256-gcm v1 envelope. */\n v1Key: Buffer\n}\n\n/**\n * The set of secrets Payload accepts. `active` is used for all writes; every\n * entry (active + `previousSecrets`) is accepted for reads.\n */\nexport type EncryptionKeyring = {\n /** Entry used for all new writes (the current `PAYLOAD_SECRET`). */\n active: EncryptionKey\n all: EncryptionKey[]\n /** keyId -> entry, for O(1) v1 key selection. */\n byId: Record<string, EncryptionKey>\n}\n\ntype CryptoContext = {\n encryptionKeyring: EncryptionKeyring\n secret: string\n}\n\nconst legacyAlgorithm = 'aes-256-ctr'\nconst v1Algorithm = 'aes-256-gcm'\nconst v1Prefix = 'v1'\n\n/**\n * Legacy key derivation (pre-v1 aes-256-ctr values and the apiKey HMAC index).\n * Kept in sync with `BasePayload.secret`.\n */\nexport const deriveSecretKey = (secret: string): string =>\n crypto.createHash('sha256').update(secret).digest('hex').slice(0, 32)\n\n/**\n * v1 key derivation: a true 32-byte key via HKDF, correcting the reduced\n * effective entropy of the legacy derivation.\n */\nexport const deriveKeyV1 = (secret: string): Buffer =>\n Buffer.from(crypto.hkdfSync('sha256', secret, '', 'payload-secret-v1', 32))\n\n/** Non-secret fingerprint of a v1 key, used to select the key on decrypt. */\nexport const keyIdFor = (v1Key: Buffer): string =>\n crypto.createHash('sha256').update(v1Key).digest('hex').slice(0, 16)\n\nexport const buildEncryptionKey = (secret: string): EncryptionKey => {\n const v1Key = deriveKeyV1(secret)\n return {\n keyId: keyIdFor(v1Key),\n legacyKey: deriveSecretKey(secret),\n secret,\n v1Key,\n }\n}\n\n/**\n * Builds the keyring from the active secret followed by any previous secrets.\n * The first entry is the active (writing) key.\n */\nexport const buildEncryptionKeyring = (secrets: string[]): EncryptionKeyring => {\n const all = secrets.map(buildEncryptionKey)\n const byId: Record<string, EncryptionKey> = {}\n for (const key of all) {\n // First writer wins if two secrets somehow share a keyId.\n if (!byId[key.keyId]) {\n byId[key.keyId] = key\n }\n }\n return { active: all[0]!, all, byId }\n}\n\n/**\n * Encrypts `text` under the active secret using the versioned aes-256-gcm\n * envelope `v1:<keyId>:<iv>:<authTag>:<ciphertext>`. Pass `options.secret` (the\n * raw `PAYLOAD_SECRET`) to encrypt under a specific secret instead.\n */\nexport function encrypt(this: CryptoContext, text: string, options?: { secret?: string }): string {\n const key = options?.secret ? buildEncryptionKey(options.secret) : this.encryptionKeyring.active\n\n const iv = crypto.randomBytes(12)\n const cipher = crypto.createCipheriv(v1Algorithm, key.v1Key, iv)\n\n const ciphertext = cipher.update(text, 'utf8', 'hex') + cipher.final('hex')\n const authTag = cipher.getAuthTag().toString('hex')\n\n return `${v1Prefix}:${key.keyId}:${iv.toString('hex')}:${authTag}:${ciphertext}`\n}\n\n/**\n * Decrypts a value produced by {@link encrypt}. Dispatches on format: v1\n * envelopes are authenticated (aes-256-gcm) and select their key by keyId from\n * the keyring; pre-v1 values fall back to aes-256-ctr. Pass `options.secret` to\n * decrypt under a specific secret (e.g. to read data encrypted under a previous\n * secret during a rotation).\n */\nexport function decrypt(this: CryptoContext, hash: string, options?: { secret?: string }): string {\n if (hash.startsWith(`${v1Prefix}:`)) {\n const parts = hash.split(':')\n\n if (parts.length !== 5) {\n throw new Error('decrypt: malformed v1 envelope, expected \"v1:keyId:iv:authTag:ciphertext\".')\n }\n\n const [, keyId, ivHex, authTagHex, ciphertext] = parts\n\n const key = options?.secret\n ? buildEncryptionKey(options.secret)\n : this.encryptionKeyring.byId[keyId!]\n\n if (!key) {\n throw new Error(\n `decrypt: no secret in the keyring matches key id \"${keyId}\". Add the secret that encrypted this value to config.previousSecrets.`,\n )\n }\n\n const decipher = crypto.createDecipheriv(v1Algorithm, key.v1Key, Buffer.from(ivHex!, 'hex'))\n decipher.setAuthTag(Buffer.from(authTagHex!, 'hex'))\n\n // final() throws on a wrong key or tampered ciphertext.\n return decipher.update(ciphertext!, 'hex', 'utf8') + decipher.final('utf8')\n }\n\n // Legacy aes-256-ctr is unauthenticated, so it cannot verify a key and a wrong\n // key returns garbage instead of throwing. We therefore intentionally use only\n // the explicit or active key here (never trial the keyring): a legacy value\n // written under a previous secret decrypts to garbage until rotateSecret\n // upgrades it to the authenticated v1 envelope. API key auth is unaffected\n // (it matches the HMAC apiKeyIndex, which is keyring-aware).\n const legacyKey = options?.secret ? deriveSecretKey(options.secret) : this.secret\n const iv = hash.slice(0, 32)\n const content = hash.slice(32)\n const decipher = crypto.createDecipheriv(legacyAlgorithm, legacyKey, Buffer.from(iv, 'hex'))\n\n return decipher.update(content, 'hex', 'utf8') + decipher.final('utf8')\n}\n\n/**\n * Re-encrypts a value that was encrypted under a previous secret: decrypts it\n * with `options.oldSecret`, then re-encrypts it with the active secret. Also\n * upgrades a legacy aes-256-ctr value to the v1 envelope.\n */\nexport function reencrypt(\n this: CryptoContext,\n hash: string,\n options: { oldSecret: string },\n): string {\n const plaintext = decrypt.call(this, hash, { secret: options.oldSecret })\n return encrypt.call(this, plaintext)\n}\n"],"names":["crypto","legacyAlgorithm","v1Algorithm","v1Prefix","deriveSecretKey","secret","createHash","update","digest","slice","deriveKeyV1","Buffer","from","hkdfSync","keyIdFor","v1Key","buildEncryptionKey","keyId","legacyKey","buildEncryptionKeyring","secrets","all","map","byId","key","active","encrypt","text","options","encryptionKeyring","iv","randomBytes","cipher","createCipheriv","ciphertext","final","authTag","getAuthTag","toString","decrypt","hash","startsWith","parts","split","length","Error","ivHex","authTagHex","decipher","createDecipheriv","setAuthTag","content","reencrypt","plaintext","call","oldSecret"],"mappings":"AAAA,OAAOA,YAAY,SAAQ;AAiC3B,MAAMC,kBAAkB;AACxB,MAAMC,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U,KAAK/B,KAAK,CAAC,GAAG;IACzB,MAAM0C,UAAUX,KAAK/B,KAAK,CAAC;IAC3B,MAAMuC,WAAWhD,OAAOiD,gBAAgB,CAAChD,iBAAiBiB,WAAWP,OAAOC,IAAI,CAACkB,IAAI;IAErF,OAAOkB,SAASzC,MAAM,CAAC4C,SAAS,OAAO,UAAUH,SAASb,KAAK,CAAC;AAClE;AAEA;;;;CAIC,GACD,OAAO,SAASiB,UAEdZ,IAAY,EACZZ,OAA8B;IAE9B,MAAMyB,YAAYd,QAAQe,IAAI,CAAC,IAAI,EAAEd,MAAM;QAAEnC,QAAQuB,QAAQ2B,SAAS;IAAC;IACvE,OAAO7B,QAAQ4B,IAAI,CAAC,IAAI,EAAED;AAC5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refresh.d.ts","sourceRoot":"","sources":["../../../src/auth/endpoints/refresh.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAO3D,eAAO,MAAM,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"refresh.d.ts","sourceRoot":"","sources":["../../../src/auth/endpoints/refresh.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAO3D,eAAO,MAAM,cAAc,EAAE,cAwC5B,CAAA"}
|
|
@@ -14,21 +14,19 @@ export const refreshHandler = async (req)=>{
|
|
|
14
14
|
collection,
|
|
15
15
|
req
|
|
16
16
|
});
|
|
17
|
+
const { refreshedToken, ...resultWithoutToken } = result;
|
|
17
18
|
if (result.setCookie) {
|
|
18
19
|
const cookie = generatePayloadCookie({
|
|
19
20
|
collectionAuthConfig: collection.config.auth,
|
|
20
21
|
cookiePrefix: req.payload.config.cookiePrefix,
|
|
21
|
-
token:
|
|
22
|
+
token: refreshedToken
|
|
22
23
|
});
|
|
23
|
-
if (collection.config.auth.removeTokenFromResponses) {
|
|
24
|
-
// @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve
|
|
25
|
-
delete result.refreshedToken;
|
|
26
|
-
}
|
|
27
24
|
headers.set('Set-Cookie', cookie);
|
|
28
25
|
}
|
|
26
|
+
const responseResult = collection.config.auth.removeTokenFromResponses ? resultWithoutToken : result;
|
|
29
27
|
return Response.json({
|
|
30
28
|
message: t('authentication:tokenRefreshSuccessful'),
|
|
31
|
-
...
|
|
29
|
+
...responseResult
|
|
32
30
|
}, {
|
|
33
31
|
headers,
|
|
34
32
|
status: httpStatus.OK
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/auth/endpoints/refresh.ts"],"sourcesContent":["import { status as httpStatus } from 'http-status'\n\nimport type { PayloadHandler } from '../../config/types.js'\n\nimport { getRequestCollection } from '../../utilities/getRequestEntity.js'\nimport { headersWithCors } from '../../utilities/headersWithCors.js'\nimport { generatePayloadCookie } from '../cookies.js'\nimport { refreshOperation } from '../operations/refresh.js'\n\nexport const refreshHandler: PayloadHandler = async (req) => {\n const collection = getRequestCollection(req)\n const { t } = req\n\n const headers = headersWithCors({\n headers: new Headers(),\n req,\n })\n\n const result = await refreshOperation({\n collection,\n req,\n })\n\n if (result.setCookie) {\n const cookie = generatePayloadCookie({\n collectionAuthConfig: collection.config.auth,\n cookiePrefix: req.payload.config.cookiePrefix,\n token:
|
|
1
|
+
{"version":3,"sources":["../../../src/auth/endpoints/refresh.ts"],"sourcesContent":["import { status as httpStatus } from 'http-status'\n\nimport type { PayloadHandler } from '../../config/types.js'\n\nimport { getRequestCollection } from '../../utilities/getRequestEntity.js'\nimport { headersWithCors } from '../../utilities/headersWithCors.js'\nimport { generatePayloadCookie } from '../cookies.js'\nimport { refreshOperation } from '../operations/refresh.js'\n\nexport const refreshHandler: PayloadHandler = async (req) => {\n const collection = getRequestCollection(req)\n const { t } = req\n\n const headers = headersWithCors({\n headers: new Headers(),\n req,\n })\n\n const result = await refreshOperation({\n collection,\n req,\n })\n\n const { refreshedToken, ...resultWithoutToken } = result\n\n if (result.setCookie) {\n const cookie = generatePayloadCookie({\n collectionAuthConfig: collection.config.auth,\n cookiePrefix: req.payload.config.cookiePrefix,\n token: refreshedToken,\n })\n\n headers.set('Set-Cookie', cookie)\n }\n\n const responseResult = collection.config.auth.removeTokenFromResponses\n ? resultWithoutToken\n : result\n\n return Response.json(\n {\n message: t('authentication:tokenRefreshSuccessful'),\n ...responseResult,\n },\n {\n headers,\n status: httpStatus.OK,\n },\n )\n}\n"],"names":["status","httpStatus","getRequestCollection","headersWithCors","generatePayloadCookie","refreshOperation","refreshHandler","req","collection","t","headers","Headers","result","refreshedToken","resultWithoutToken","setCookie","cookie","collectionAuthConfig","config","auth","cookiePrefix","payload","token","set","responseResult","removeTokenFromResponses","Response","json","message","OK"],"mappings":"AAAA,SAASA,UAAUC,UAAU,QAAQ,cAAa;AAIlD,SAASC,oBAAoB,QAAQ,sCAAqC;AAC1E,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,qBAAqB,QAAQ,gBAAe;AACrD,SAASC,gBAAgB,QAAQ,2BAA0B;AAE3D,OAAO,MAAMC,iBAAiC,OAAOC;IACnD,MAAMC,aAAaN,qBAAqBK;IACxC,MAAM,EAAEE,CAAC,EAAE,GAAGF;IAEd,MAAMG,UAAUP,gBAAgB;QAC9BO,SAAS,IAAIC;QACbJ;IACF;IAEA,MAAMK,SAAS,MAAMP,iBAAiB;QACpCG;QACAD;IACF;IAEA,MAAM,EAAEM,cAAc,EAAE,GAAGC,oBAAoB,GAAGF;IAElD,IAAIA,OAAOG,SAAS,EAAE;QACpB,MAAMC,SAASZ,sBAAsB;YACnCa,sBAAsBT,WAAWU,MAAM,CAACC,IAAI;YAC5CC,cAAcb,IAAIc,OAAO,CAACH,MAAM,CAACE,YAAY;YAC7CE,OAAOT;QACT;QAEAH,QAAQa,GAAG,CAAC,cAAcP;IAC5B;IAEA,MAAMQ,iBAAiBhB,WAAWU,MAAM,CAACC,IAAI,CAACM,wBAAwB,GAClEX,qBACAF;IAEJ,OAAOc,SAASC,IAAI,CAClB;QACEC,SAASnB,EAAE;QACX,GAAGe,cAAc;IACnB,GACA;QACEd;QACAV,QAAQC,WAAW4B,EAAE;IACvB;AAEJ,EAAC"}
|
|
@@ -6,7 +6,8 @@ type OperationArgs = {
|
|
|
6
6
|
id?: number | string;
|
|
7
7
|
isReadingStaticFile?: boolean;
|
|
8
8
|
req: PayloadRequest;
|
|
9
|
+
slug: string;
|
|
9
10
|
};
|
|
10
|
-
export declare const executeAccess: ({ id, data, disableErrors, isReadingStaticFile, req }: OperationArgs, access?: Access) => Promise<AccessResult>;
|
|
11
|
+
export declare const executeAccess: ({ id, slug, data, disableErrors, isReadingStaticFile, req }: OperationArgs, access?: Access) => Promise<AccessResult>;
|
|
11
12
|
export {};
|
|
12
13
|
//# sourceMappingURL=executeAccess.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executeAccess.d.ts","sourceRoot":"","sources":["../../src/auth/executeAccess.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAIvD,KAAK,aAAa,GAAG;IACnB,IAAI,CAAC,EAAE,GAAG,CAAA;IACV,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,GAAG,EAAE,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"executeAccess.d.ts","sourceRoot":"","sources":["../../src/auth/executeAccess.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAIvD,KAAK,aAAa,GAAG;IACnB,IAAI,CAAC,EAAE,GAAG,CAAA;IACV,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,GAAG,EAAE,cAAc,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AACD,eAAO,MAAM,aAAa,gEAC6C,aAAa,WACzE,MAAM,KACd,OAAO,CAAC,YAAY,CA2BtB,CAAA"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Forbidden } from '../errors/index.js';
|
|
2
|
-
export const executeAccess = async ({ id, data, disableErrors, isReadingStaticFile = false, req }, access)=>{
|
|
2
|
+
export const executeAccess = async ({ id, slug, data, disableErrors, isReadingStaticFile = false, req }, access)=>{
|
|
3
3
|
if (access) {
|
|
4
4
|
const resolvedConstraint = await access({
|
|
5
5
|
id,
|
|
6
|
+
slug,
|
|
6
7
|
data,
|
|
7
8
|
isReadingStaticFile,
|
|
8
9
|
req
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/auth/executeAccess.ts"],"sourcesContent":["import type { Access, AccessResult } from '../config/types.js'\nimport type { PayloadRequest } from '../types/index.js'\n\nimport { Forbidden } from '../errors/index.js'\n\ntype OperationArgs = {\n data?: any\n disableErrors?: boolean\n id?: number | string\n isReadingStaticFile?: boolean\n req: PayloadRequest\n}\nexport const executeAccess = async (\n { id, data, disableErrors, isReadingStaticFile = false, req }: OperationArgs,\n access?: Access,\n): Promise<AccessResult> => {\n if (access) {\n const resolvedConstraint = await access({\n id,\n data,\n isReadingStaticFile,\n req,\n })\n\n if (!resolvedConstraint) {\n if (!disableErrors) {\n throw new Forbidden(req.t)\n }\n }\n\n return resolvedConstraint\n }\n\n if (req.user) {\n return true\n }\n\n if (!disableErrors) {\n throw new Forbidden(req.t)\n }\n return false\n}\n"],"names":["Forbidden","executeAccess","id","data","disableErrors","isReadingStaticFile","req","access","resolvedConstraint","t","user"],"mappings":"AAGA,SAASA,SAAS,QAAQ,qBAAoB;
|
|
1
|
+
{"version":3,"sources":["../../src/auth/executeAccess.ts"],"sourcesContent":["import type { Access, AccessResult } from '../config/types.js'\nimport type { PayloadRequest } from '../types/index.js'\n\nimport { Forbidden } from '../errors/index.js'\n\ntype OperationArgs = {\n data?: any\n disableErrors?: boolean\n id?: number | string\n isReadingStaticFile?: boolean\n req: PayloadRequest\n slug: string\n}\nexport const executeAccess = async (\n { id, slug, data, disableErrors, isReadingStaticFile = false, req }: OperationArgs,\n access?: Access,\n): Promise<AccessResult> => {\n if (access) {\n const resolvedConstraint = await access({\n id,\n slug,\n data,\n isReadingStaticFile,\n req,\n })\n\n if (!resolvedConstraint) {\n if (!disableErrors) {\n throw new Forbidden(req.t)\n }\n }\n\n return resolvedConstraint\n }\n\n if (req.user) {\n return true\n }\n\n if (!disableErrors) {\n throw new Forbidden(req.t)\n }\n return false\n}\n"],"names":["Forbidden","executeAccess","id","slug","data","disableErrors","isReadingStaticFile","req","access","resolvedConstraint","t","user"],"mappings":"AAGA,SAASA,SAAS,QAAQ,qBAAoB;AAU9C,OAAO,MAAMC,gBAAgB,OAC3B,EAAEC,EAAE,EAAEC,IAAI,EAAEC,IAAI,EAAEC,aAAa,EAAEC,sBAAsB,KAAK,EAAEC,GAAG,EAAiB,EAClFC;IAEA,IAAIA,QAAQ;QACV,MAAMC,qBAAqB,MAAMD,OAAO;YACtCN;YACAC;YACAC;YACAE;YACAC;QACF;QAEA,IAAI,CAACE,oBAAoB;YACvB,IAAI,CAACJ,eAAe;gBAClB,MAAM,IAAIL,UAAUO,IAAIG,CAAC;YAC3B;QACF;QAEA,OAAOD;IACT;IAEA,IAAIF,IAAII,IAAI,EAAE;QACZ,OAAO;IACT;IAEA,IAAI,CAACN,eAAe;QAClB,MAAM,IAAIL,UAAUO,IAAIG,CAAC;IAC3B;IACA,OAAO;AACT,EAAC"}
|
|
@@ -10,6 +10,7 @@ export async function getAccessResults({ req }) {
|
|
|
10
10
|
const userCollectionConfig = user && user.collection ? payload?.collections?.[user.collection]?.config : null;
|
|
11
11
|
if (userCollectionConfig && payload.config.admin.user === user?.collection) {
|
|
12
12
|
results.canAccessAdmin = userCollectionConfig.access.admin ? await userCollectionConfig.access.admin({
|
|
13
|
+
slug: userCollectionConfig.slug,
|
|
13
14
|
req
|
|
14
15
|
}) : isLoggedIn;
|
|
15
16
|
} else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/auth/getAccessResults.ts"],"sourcesContent":["import type { AllOperations, PayloadRequest } from '../types/index.js'\nimport type { Permissions, SanitizedPermissions } from './types.js'\n\nimport { getEntityPermissions } from '../utilities/getEntityPermissions/getEntityPermissions.js'\nimport { sanitizePermissions } from '../utilities/sanitizePermissions.js'\n\ntype GetAccessResultsArgs = {\n req: PayloadRequest\n}\nexport async function getAccessResults({\n req,\n}: GetAccessResultsArgs): Promise<SanitizedPermissions> {\n const results = {\n collections: {},\n globals: {},\n } as Permissions\n const { payload, user } = req\n\n const isLoggedIn = !!user\n const userCollectionConfig =\n user && user.collection ? payload?.collections?.[user.collection]?.config : null\n\n if (userCollectionConfig && payload.config.admin.user === user?.collection) {\n results.canAccessAdmin = userCollectionConfig.access.admin\n ? await userCollectionConfig.access.admin({ req })\n : isLoggedIn\n } else {\n results.canAccessAdmin = false\n }\n const blockReferencesPermissions = {}\n\n await Promise.all(\n payload.config.collections.map(async (collection) => {\n const collectionOperations: AllOperations[] = ['create', 'read', 'update', 'delete']\n\n if (\n collection.auth &&\n typeof collection.auth.maxLoginAttempts !== 'undefined' &&\n collection.auth.maxLoginAttempts !== 0\n ) {\n collectionOperations.push('unlock')\n }\n\n if (collection.versions) {\n collectionOperations.push('readVersions')\n }\n\n const collectionPermissions = await getEntityPermissions({\n blockReferencesPermissions,\n entity: collection,\n entityType: 'collection',\n fetchData: false,\n operations: collectionOperations,\n req,\n })\n results.collections![collection.slug] = collectionPermissions\n }),\n )\n\n await Promise.all(\n payload.config.globals.map(async (global) => {\n const globalOperations: AllOperations[] = ['read', 'update']\n\n if (global.versions) {\n globalOperations.push('readVersions')\n }\n\n const globalPermissions = await getEntityPermissions({\n blockReferencesPermissions,\n entity: global,\n entityType: 'global',\n fetchData: false,\n operations: globalOperations,\n req,\n })\n results.globals![global.slug] = globalPermissions\n }),\n )\n\n return sanitizePermissions(results)\n}\n"],"names":["getEntityPermissions","sanitizePermissions","getAccessResults","req","results","collections","globals","payload","user","isLoggedIn","userCollectionConfig","collection","config","admin","canAccessAdmin","access","blockReferencesPermissions","Promise","all","map","collectionOperations","auth","maxLoginAttempts","push","versions","collectionPermissions","entity","entityType","fetchData","operations","
|
|
1
|
+
{"version":3,"sources":["../../src/auth/getAccessResults.ts"],"sourcesContent":["import type { AllOperations, PayloadRequest } from '../types/index.js'\nimport type { Permissions, SanitizedPermissions } from './types.js'\n\nimport { getEntityPermissions } from '../utilities/getEntityPermissions/getEntityPermissions.js'\nimport { sanitizePermissions } from '../utilities/sanitizePermissions.js'\n\ntype GetAccessResultsArgs = {\n req: PayloadRequest\n}\nexport async function getAccessResults({\n req,\n}: GetAccessResultsArgs): Promise<SanitizedPermissions> {\n const results = {\n collections: {},\n globals: {},\n } as Permissions\n const { payload, user } = req\n\n const isLoggedIn = !!user\n const userCollectionConfig =\n user && user.collection ? payload?.collections?.[user.collection]?.config : null\n\n if (userCollectionConfig && payload.config.admin.user === user?.collection) {\n results.canAccessAdmin = userCollectionConfig.access.admin\n ? await userCollectionConfig.access.admin({ slug: userCollectionConfig.slug, req })\n : isLoggedIn\n } else {\n results.canAccessAdmin = false\n }\n const blockReferencesPermissions = {}\n\n await Promise.all(\n payload.config.collections.map(async (collection) => {\n const collectionOperations: AllOperations[] = ['create', 'read', 'update', 'delete']\n\n if (\n collection.auth &&\n typeof collection.auth.maxLoginAttempts !== 'undefined' &&\n collection.auth.maxLoginAttempts !== 0\n ) {\n collectionOperations.push('unlock')\n }\n\n if (collection.versions) {\n collectionOperations.push('readVersions')\n }\n\n const collectionPermissions = await getEntityPermissions({\n blockReferencesPermissions,\n entity: collection,\n entityType: 'collection',\n fetchData: false,\n operations: collectionOperations,\n req,\n })\n results.collections![collection.slug] = collectionPermissions\n }),\n )\n\n await Promise.all(\n payload.config.globals.map(async (global) => {\n const globalOperations: AllOperations[] = ['read', 'update']\n\n if (global.versions) {\n globalOperations.push('readVersions')\n }\n\n const globalPermissions = await getEntityPermissions({\n blockReferencesPermissions,\n entity: global,\n entityType: 'global',\n fetchData: false,\n operations: globalOperations,\n req,\n })\n results.globals![global.slug] = globalPermissions\n }),\n )\n\n return sanitizePermissions(results)\n}\n"],"names":["getEntityPermissions","sanitizePermissions","getAccessResults","req","results","collections","globals","payload","user","isLoggedIn","userCollectionConfig","collection","config","admin","canAccessAdmin","access","slug","blockReferencesPermissions","Promise","all","map","collectionOperations","auth","maxLoginAttempts","push","versions","collectionPermissions","entity","entityType","fetchData","operations","global","globalOperations","globalPermissions"],"mappings":"AAGA,SAASA,oBAAoB,QAAQ,4DAA2D;AAChG,SAASC,mBAAmB,QAAQ,sCAAqC;AAKzE,OAAO,eAAeC,iBAAiB,EACrCC,GAAG,EACkB;IACrB,MAAMC,UAAU;QACdC,aAAa,CAAC;QACdC,SAAS,CAAC;IACZ;IACA,MAAM,EAAEC,OAAO,EAAEC,IAAI,EAAE,GAAGL;IAE1B,MAAMM,aAAa,CAAC,CAACD;IACrB,MAAME,uBACJF,QAAQA,KAAKG,UAAU,GAAGJ,SAASF,aAAa,CAACG,KAAKG,UAAU,CAAC,EAAEC,SAAS;IAE9E,IAAIF,wBAAwBH,QAAQK,MAAM,CAACC,KAAK,CAACL,IAAI,KAAKA,MAAMG,YAAY;QAC1EP,QAAQU,cAAc,GAAGJ,qBAAqBK,MAAM,CAACF,KAAK,GACtD,MAAMH,qBAAqBK,MAAM,CAACF,KAAK,CAAC;YAAEG,MAAMN,qBAAqBM,IAAI;YAAEb;QAAI,KAC/EM;IACN,OAAO;QACLL,QAAQU,cAAc,GAAG;IAC3B;IACA,MAAMG,6BAA6B,CAAC;IAEpC,MAAMC,QAAQC,GAAG,CACfZ,QAAQK,MAAM,CAACP,WAAW,CAACe,GAAG,CAAC,OAAOT;QACpC,MAAMU,uBAAwC;YAAC;YAAU;YAAQ;YAAU;SAAS;QAEpF,IACEV,WAAWW,IAAI,IACf,OAAOX,WAAWW,IAAI,CAACC,gBAAgB,KAAK,eAC5CZ,WAAWW,IAAI,CAACC,gBAAgB,KAAK,GACrC;YACAF,qBAAqBG,IAAI,CAAC;QAC5B;QAEA,IAAIb,WAAWc,QAAQ,EAAE;YACvBJ,qBAAqBG,IAAI,CAAC;QAC5B;QAEA,MAAME,wBAAwB,MAAM1B,qBAAqB;YACvDiB;YACAU,QAAQhB;YACRiB,YAAY;YACZC,WAAW;YACXC,YAAYT;YACZlB;QACF;QACAC,QAAQC,WAAW,AAAC,CAACM,WAAWK,IAAI,CAAC,GAAGU;IAC1C;IAGF,MAAMR,QAAQC,GAAG,CACfZ,QAAQK,MAAM,CAACN,OAAO,CAACc,GAAG,CAAC,OAAOW;QAChC,MAAMC,mBAAoC;YAAC;YAAQ;SAAS;QAE5D,IAAID,OAAON,QAAQ,EAAE;YACnBO,iBAAiBR,IAAI,CAAC;QACxB;QAEA,MAAMS,oBAAoB,MAAMjC,qBAAqB;YACnDiB;YACAU,QAAQI;YACRH,YAAY;YACZC,WAAW;YACXC,YAAYE;YACZ7B;QACF;QACAC,QAAQE,OAAO,AAAC,CAACyB,OAAOf,IAAI,CAAC,GAAGiB;IAClC;IAGF,OAAOhC,oBAAoBG;AAC7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"access.d.ts","sourceRoot":"","sources":["../../../src/auth/operations/access.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"access.d.ts","sourceRoot":"","sources":["../../../src/auth/operations/access.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAKvD,KAAK,SAAS,GAAG;IACf,GAAG,EAAE,cAAc,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,eAAe,SAAgB,SAAS,KAAG,OAAO,CAAC,oBAAoB,CAMnF,CAAA"}
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
import { killTransaction } from '../../utilities/killTransaction.js';
|
|
2
1
|
import { adminInit as adminInitTelemetry } from '../../utilities/telemetry/events/adminInit.js';
|
|
3
2
|
import { getAccessResults } from '../getAccessResults.js';
|
|
4
3
|
export const accessOperation = async (args)=>{
|
|
5
4
|
const { req } = args;
|
|
6
5
|
adminInitTelemetry(req);
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
});
|
|
11
|
-
} catch (e) {
|
|
12
|
-
await killTransaction(req);
|
|
13
|
-
throw e;
|
|
14
|
-
}
|
|
6
|
+
return getAccessResults({
|
|
7
|
+
req
|
|
8
|
+
});
|
|
15
9
|
};
|
|
16
10
|
|
|
17
11
|
//# sourceMappingURL=access.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/auth/operations/access.ts"],"sourcesContent":["import type { PayloadRequest } from '../../types/index.js'\nimport type { SanitizedPermissions } from '../types.js'\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../src/auth/operations/access.ts"],"sourcesContent":["import type { PayloadRequest } from '../../types/index.js'\nimport type { SanitizedPermissions } from '../types.js'\n\nimport { adminInit as adminInitTelemetry } from '../../utilities/telemetry/events/adminInit.js'\nimport { getAccessResults } from '../getAccessResults.js'\n\ntype Arguments = {\n req: PayloadRequest\n}\n\nexport const accessOperation = async (args: Arguments): Promise<SanitizedPermissions> => {\n const { req } = args\n\n adminInitTelemetry(req)\n\n return getAccessResults({ req })\n}\n"],"names":["adminInit","adminInitTelemetry","getAccessResults","accessOperation","args","req"],"mappings":"AAGA,SAASA,aAAaC,kBAAkB,QAAQ,gDAA+C;AAC/F,SAASC,gBAAgB,QAAQ,yBAAwB;AAMzD,OAAO,MAAMC,kBAAkB,OAAOC;IACpC,MAAM,EAAEC,GAAG,EAAE,GAAGD;IAEhBH,mBAAmBI;IAEnB,OAAOH,iBAAiB;QAAEG;IAAI;AAChC,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/auth/operations/auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/auth/operations/auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAK1D,MAAM,MAAM,QAAQ,GAAG;IACrB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;IAC3B,GAAG,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,CAAA;CACnC,CAAA;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,WAAW,EAAE,oBAAoB,CAAA;IACjC,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,IAAI,EAAE,iBAAiB,GAAG,IAAI,CAAA;CAC/B,CAAA;AAED,eAAO,MAAM,IAAI,SAAgB,QAAQ,CAAC,QAAQ,CAAC,KAAG,OAAO,CAAC,UAAU,CAuBvE,CAAA"}
|