payload 3.0.0-beta.67 → 3.0.0-beta.68
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/RichText.d.ts +4 -4
- package/dist/admin/RichText.d.ts.map +1 -1
- package/dist/admin/RichText.js.map +1 -1
- package/dist/auth/operations/resetPassword.js +1 -1
- package/dist/auth/operations/resetPassword.js.map +1 -1
- package/dist/auth/strategies/jwt.d.ts.map +1 -1
- package/dist/auth/strategies/jwt.js +29 -0
- package/dist/auth/strategies/jwt.js.map +1 -1
- package/dist/auth/strategies/local/incrementLoginAttempts.d.ts.map +1 -1
- package/dist/auth/strategies/local/incrementLoginAttempts.js +1 -1
- package/dist/auth/strategies/local/incrementLoginAttempts.js.map +1 -1
- package/dist/auth/strategies/local/register.d.ts +2 -2
- package/dist/auth/strategies/local/register.d.ts.map +1 -1
- package/dist/auth/strategies/local/register.js.map +1 -1
- package/dist/bin/generateTypes.js +2 -2
- package/dist/bin/generateTypes.js.map +1 -1
- package/dist/collections/config/client.d.ts.map +1 -1
- package/dist/collections/config/defaults.d.ts +4 -69
- package/dist/collections/config/defaults.d.ts.map +1 -1
- package/dist/collections/config/defaults.js.map +1 -1
- package/dist/collections/config/reservedFieldNames.d.ts +15 -0
- package/dist/collections/config/reservedFieldNames.d.ts.map +1 -0
- package/dist/collections/config/reservedFieldNames.js +104 -0
- package/dist/collections/config/reservedFieldNames.js.map +1 -0
- package/dist/collections/config/reservedFieldNames.spec.js +148 -0
- package/dist/collections/config/reservedFieldNames.spec.js.map +1 -0
- package/dist/collections/config/sanitize.d.ts.map +1 -1
- package/dist/collections/config/sanitize.js +13 -9
- package/dist/collections/config/sanitize.js.map +1 -1
- package/dist/collections/config/types.d.ts +2 -2
- package/dist/collections/config/types.d.ts.map +1 -1
- package/dist/collections/config/types.js.map +1 -1
- package/dist/collections/dataloader.d.ts.map +1 -1
- package/dist/collections/dataloader.js.map +1 -1
- package/dist/collections/operations/create.d.ts.map +1 -1
- package/dist/collections/operations/create.js.map +1 -1
- package/dist/collections/operations/deleteByID.d.ts.map +1 -1
- package/dist/collections/operations/deleteByID.js.map +1 -1
- package/dist/collections/operations/duplicate.js.map +1 -1
- package/dist/collections/operations/update.js.map +1 -1
- package/dist/collections/operations/updateByID.js.map +1 -1
- package/dist/config/client.d.ts.map +1 -1
- package/dist/config/client.js +26 -26
- package/dist/config/client.js.map +1 -1
- package/dist/config/sanitize.d.ts.map +1 -1
- package/dist/config/sanitize.js +4 -7
- package/dist/config/sanitize.js.map +1 -1
- package/dist/config/types.d.ts +3 -4
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config/types.js.map +1 -1
- package/dist/errors/APIError.d.ts +1 -0
- package/dist/errors/APIError.d.ts.map +1 -1
- package/dist/errors/APIError.js +3 -0
- package/dist/errors/APIError.js.map +1 -1
- package/dist/errors/ValidationError.d.ts +1 -0
- package/dist/errors/ValidationError.d.ts.map +1 -1
- package/dist/errors/ValidationError.js +3 -0
- package/dist/errors/ValidationError.js.map +1 -1
- package/dist/errors/index.d.ts +2 -2
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/errors/index.js +2 -2
- package/dist/errors/index.js.map +1 -1
- package/dist/exports/shared.d.ts +3 -2
- package/dist/exports/shared.d.ts.map +1 -1
- package/dist/exports/shared.js +3 -2
- package/dist/exports/shared.js.map +1 -1
- package/dist/fields/config/sanitize.d.ts +3 -2
- package/dist/fields/config/sanitize.d.ts.map +1 -1
- package/dist/fields/config/sanitize.js +8 -16
- package/dist/fields/config/sanitize.js.map +1 -1
- package/dist/fields/config/sanitize.spec.js +1 -17
- package/dist/fields/config/sanitize.spec.js.map +1 -1
- package/dist/fields/getDefaultValue.d.ts +5 -5
- package/dist/fields/getDefaultValue.d.ts.map +1 -1
- package/dist/fields/getDefaultValue.js +4 -6
- package/dist/fields/getDefaultValue.js.map +1 -1
- package/dist/fields/hooks/afterChange/index.d.ts +6 -6
- package/dist/fields/hooks/afterChange/index.d.ts.map +1 -1
- package/dist/fields/hooks/afterChange/index.js +2 -2
- package/dist/fields/hooks/afterChange/index.js.map +1 -1
- package/dist/fields/hooks/afterChange/promise.d.ts +7 -7
- package/dist/fields/hooks/afterChange/promise.d.ts.map +1 -1
- package/dist/fields/hooks/afterChange/promise.js.map +1 -1
- package/dist/fields/hooks/afterChange/traverseFields.d.ts +7 -7
- package/dist/fields/hooks/afterChange/traverseFields.d.ts.map +1 -1
- package/dist/fields/hooks/afterChange/traverseFields.js.map +1 -1
- package/dist/fields/hooks/afterRead/index.d.ts +4 -4
- package/dist/fields/hooks/afterRead/index.d.ts.map +1 -1
- package/dist/fields/hooks/afterRead/index.js +2 -2
- package/dist/fields/hooks/afterRead/index.js.map +1 -1
- package/dist/fields/hooks/afterRead/promise.d.ts +3 -3
- package/dist/fields/hooks/afterRead/promise.d.ts.map +1 -1
- package/dist/fields/hooks/afterRead/promise.js +2 -2
- package/dist/fields/hooks/afterRead/promise.js.map +1 -1
- package/dist/fields/hooks/afterRead/traverseFields.d.ts +3 -3
- package/dist/fields/hooks/afterRead/traverseFields.d.ts.map +1 -1
- package/dist/fields/hooks/afterRead/traverseFields.js.map +1 -1
- package/dist/fields/hooks/beforeChange/cloneDataFromOriginalDoc.d.ts +2 -1
- package/dist/fields/hooks/beforeChange/cloneDataFromOriginalDoc.d.ts.map +1 -1
- package/dist/fields/hooks/beforeChange/cloneDataFromOriginalDoc.js.map +1 -1
- package/dist/fields/hooks/beforeChange/getExistingRowDoc.d.ts +2 -1
- package/dist/fields/hooks/beforeChange/getExistingRowDoc.d.ts.map +1 -1
- package/dist/fields/hooks/beforeChange/getExistingRowDoc.js.map +1 -1
- package/dist/fields/hooks/beforeChange/index.d.ts +6 -6
- package/dist/fields/hooks/beforeChange/index.d.ts.map +1 -1
- package/dist/fields/hooks/beforeChange/index.js +2 -2
- package/dist/fields/hooks/beforeChange/index.js.map +1 -1
- package/dist/fields/hooks/beforeChange/promise.d.ts +7 -7
- package/dist/fields/hooks/beforeChange/promise.d.ts.map +1 -1
- package/dist/fields/hooks/beforeChange/promise.js +3 -7
- package/dist/fields/hooks/beforeChange/promise.js.map +1 -1
- package/dist/fields/hooks/beforeChange/traverseFields.d.ts +7 -7
- package/dist/fields/hooks/beforeChange/traverseFields.d.ts.map +1 -1
- package/dist/fields/hooks/beforeChange/traverseFields.js.map +1 -1
- package/dist/fields/hooks/beforeValidate/index.d.ts +5 -5
- package/dist/fields/hooks/beforeValidate/index.d.ts.map +1 -1
- package/dist/fields/hooks/beforeValidate/index.js +2 -2
- package/dist/fields/hooks/beforeValidate/index.js.map +1 -1
- package/dist/fields/hooks/beforeValidate/promise.d.ts +3 -3
- package/dist/fields/hooks/beforeValidate/promise.d.ts.map +1 -1
- package/dist/fields/hooks/beforeValidate/promise.js +2 -2
- package/dist/fields/hooks/beforeValidate/promise.js.map +1 -1
- package/dist/fields/hooks/beforeValidate/traverseFields.d.ts +3 -3
- package/dist/fields/hooks/beforeValidate/traverseFields.d.ts.map +1 -1
- package/dist/fields/hooks/beforeValidate/traverseFields.js.map +1 -1
- package/dist/fields/mergeBaseFields.d.ts.map +1 -1
- package/dist/fields/mergeBaseFields.js +2 -2
- package/dist/fields/mergeBaseFields.js.map +1 -1
- package/dist/globals/operations/findOne.d.ts.map +1 -1
- 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 +2 -1
- package/dist/globals/operations/findVersionByID.js.map +1 -1
- package/dist/globals/operations/findVersions.js.map +1 -1
- package/dist/globals/operations/update.d.ts.map +1 -1
- package/dist/globals/operations/update.js +2 -1
- package/dist/globals/operations/update.js.map +1 -1
- package/dist/index.d.ts +11 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -12
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.ts +8 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/uploads/imageResizer.d.ts.map +1 -1
- package/dist/uploads/imageResizer.js +16 -18
- package/dist/uploads/imageResizer.js.map +1 -1
- package/dist/utilities/deepCopyObject.d.ts +18 -1
- package/dist/utilities/deepCopyObject.d.ts.map +1 -1
- package/dist/utilities/deepCopyObject.js +147 -16
- package/dist/utilities/deepCopyObject.js.map +1 -1
- package/dist/utilities/deepMerge.d.ts +18 -1
- package/dist/utilities/deepMerge.d.ts.map +1 -1
- package/dist/utilities/deepMerge.js +38 -13
- package/dist/utilities/deepMerge.js.map +1 -1
- package/dist/utilities/isPlainObject.d.ts +1 -1
- package/dist/utilities/isPlainObject.d.ts.map +1 -1
- package/dist/utilities/isPlainObject.js +4 -18
- package/dist/utilities/isPlainObject.js.map +1 -1
- package/dist/utilities/logger.d.ts +5 -7
- package/dist/utilities/logger.d.ts.map +1 -1
- package/dist/utilities/logger.js +4 -7
- package/dist/utilities/logger.js.map +1 -1
- package/dist/utilities/telemetry/events/adminInit.d.ts.map +1 -1
- package/dist/utilities/telemetry/events/adminInit.js.map +1 -1
- package/dist/versions/baseFields.d.ts.map +1 -1
- package/dist/versions/baseFields.js +1 -0
- package/dist/versions/baseFields.js.map +1 -1
- package/dist/versions/drafts/replaceWithDraftIfAvailable.d.ts.map +1 -1
- package/dist/versions/drafts/replaceWithDraftIfAvailable.js +2 -1
- package/dist/versions/drafts/replaceWithDraftIfAvailable.js.map +1 -1
- package/dist/versions/saveVersion.d.ts.map +1 -1
- package/dist/versions/saveVersion.js +2 -2
- package/dist/versions/saveVersion.js.map +1 -1
- package/package.json +5 -7
- package/dist/collections/config/schema.d.ts +0 -4
- package/dist/collections/config/schema.d.ts.map +0 -1
- package/dist/collections/config/schema.js +0 -191
- package/dist/collections/config/schema.js.map +0 -1
- package/dist/config/schema.d.ts +0 -5
- package/dist/config/schema.d.ts.map +0 -1
- package/dist/config/schema.js +0 -179
- package/dist/config/schema.js.map +0 -1
- package/dist/config/shared/adminViewSchema.d.ts +0 -3
- package/dist/config/shared/adminViewSchema.d.ts.map +0 -1
- package/dist/config/shared/adminViewSchema.js +0 -11
- package/dist/config/shared/adminViewSchema.js.map +0 -1
- package/dist/config/shared/componentSchema.d.ts +0 -16
- package/dist/config/shared/componentSchema.d.ts.map +0 -1
- package/dist/config/shared/componentSchema.js +0 -27
- package/dist/config/shared/componentSchema.js.map +0 -1
- package/dist/config/shared/openGraphSchema.d.ts +0 -3
- package/dist/config/shared/openGraphSchema.d.ts.map +0 -1
- package/dist/config/shared/openGraphSchema.js +0 -16
- package/dist/config/shared/openGraphSchema.js.map +0 -1
- package/dist/config/validate.d.ts +0 -4
- package/dist/config/validate.d.ts.map +0 -1
- package/dist/config/validate.js +0 -89
- package/dist/config/validate.js.map +0 -1
- package/dist/fields/config/schema.d.ts +0 -29
- package/dist/fields/config/schema.d.ts.map +0 -1
- package/dist/fields/config/schema.js +0 -508
- package/dist/fields/config/schema.js.map +0 -1
- package/dist/globals/config/schema.d.ts +0 -4
- package/dist/globals/config/schema.d.ts.map +0 -1
- package/dist/globals/config/schema.js +0 -79
- package/dist/globals/config/schema.js.map +0 -1
- package/dist/utilities/combineMerge.d.ts +0 -2
- package/dist/utilities/combineMerge.d.ts.map +0 -1
- package/dist/utilities/combineMerge.js +0 -16
- package/dist/utilities/combineMerge.js.map +0 -1
- package/dist/utilities/convertData.d.ts +0 -5
- package/dist/utilities/convertData.d.ts.map +0 -1
- package/dist/utilities/convertData.js +0 -16
- package/dist/utilities/convertData.js.map +0 -1
- package/dist/utilities/getCSSVariable.d.ts +0 -3
- package/dist/utilities/getCSSVariable.d.ts.map +0 -1
- package/dist/utilities/getCSSVariable.js +0 -3
- package/dist/utilities/getCSSVariable.js.map +0 -1
- package/dist/utilities/overwriteMerge.d.ts +0 -3
- package/dist/utilities/overwriteMerge.d.ts.map +0 -1
- package/dist/utilities/overwriteMerge.js +0 -4
- package/dist/utilities/overwriteMerge.js.map +0 -1
package/dist/admin/RichText.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type { SanitizedCollectionConfig, TypeWithID } from '../collections/confi
|
|
|
5
5
|
import type { SanitizedConfig } from '../config/types.js';
|
|
6
6
|
import type { Field, FieldAffectingData, RichTextField, Validate } from '../fields/config/types.js';
|
|
7
7
|
import type { SanitizedGlobalConfig } from '../globals/config/types.js';
|
|
8
|
-
import type { PayloadRequest, RequestContext } from '../types/index.js';
|
|
8
|
+
import type { JsonObject, PayloadRequest, RequestContext } from '../types/index.js';
|
|
9
9
|
import type { WithServerSidePropsComponentProps } from './elements/WithServerSideProps.js';
|
|
10
10
|
export type RichTextFieldProps<Value extends object, AdapterProps, ExtraFieldProperties = {}> = {
|
|
11
11
|
path?: string;
|
|
@@ -51,7 +51,7 @@ export type BeforeChangeRichTextHookArgs<TData extends TypeWithID = any, TValue
|
|
|
51
51
|
/**
|
|
52
52
|
* The original data with locales (not modified by any hooks). Only available in `beforeChange` and `beforeDuplicate` field hooks.
|
|
53
53
|
*/
|
|
54
|
-
docWithLocales?:
|
|
54
|
+
docWithLocales?: JsonObject;
|
|
55
55
|
duplicate?: boolean;
|
|
56
56
|
errors?: {
|
|
57
57
|
field: string;
|
|
@@ -68,7 +68,7 @@ export type BeforeChangeRichTextHookArgs<TData extends TypeWithID = any, TValue
|
|
|
68
68
|
/**
|
|
69
69
|
* The original siblingData with locales (not modified by any hooks).
|
|
70
70
|
*/
|
|
71
|
-
siblingDocWithLocales?:
|
|
71
|
+
siblingDocWithLocales?: JsonObject;
|
|
72
72
|
skipValidation?: boolean;
|
|
73
73
|
};
|
|
74
74
|
export type BaseRichTextHookArgs<TData extends TypeWithID = any, TValue = any, TSiblingData = any> = {
|
|
@@ -140,7 +140,7 @@ type RichTextAdapterBase<Value extends object = object, AdapterProps = any, Extr
|
|
|
140
140
|
populationPromises: Promise<void>[];
|
|
141
141
|
req: PayloadRequest;
|
|
142
142
|
showHiddenFields: boolean;
|
|
143
|
-
siblingDoc:
|
|
143
|
+
siblingDoc: JsonObject;
|
|
144
144
|
}) => void;
|
|
145
145
|
hooks?: RichTextHooks;
|
|
146
146
|
i18n?: Partial<GenericLanguages>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichText.d.ts","sourceRoot":"","sources":["../../src/admin/RichText.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAClF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,yBAAyB,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAA;AAC3F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,KAAK,EAAE,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AACnG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AACvE,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"RichText.d.ts","sourceRoot":"","sources":["../../src/admin/RichText.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAClF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,yBAAyB,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAA;AAC3F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,KAAK,EAAE,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AACnG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AACvE,OAAO,KAA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Client } from '@payloadcms/translations'\nimport type { JSONSchema4 } from 'json-schema'\nimport type React from 'react'\n\nimport type { SanitizedCollectionConfig, TypeWithID } from '../collections/config/types.js'\nimport type { SanitizedConfig } from '../config/types.js'\nimport type { Field, FieldAffectingData, RichTextField, Validate } from '../fields/config/types.js'\nimport type { SanitizedGlobalConfig } from '../globals/config/types.js'\nimport type { PayloadRequest, RequestContext } from '../types/index.js'\nimport type { WithServerSidePropsComponentProps } from './elements/WithServerSideProps.js'\n\nexport type RichTextFieldProps<Value extends object, AdapterProps, ExtraFieldProperties = {}> = {\n path?: string\n} & Omit<RichTextField<Value, AdapterProps, ExtraFieldProperties>, 'type'>\n\nexport type AfterReadRichTextHookArgs<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = {\n currentDepth?: number\n\n depth?: number\n\n draft?: boolean\n\n fallbackLocale?: string\n\n fieldPromises?: Promise<void>[]\n\n /** Boolean to denote if this hook is running against finding one, or finding many within the afterRead hook. */\n findMany?: boolean\n\n flattenLocales?: boolean\n\n locale?: string\n\n /** A string relating to which operation the field type is currently executing within. */\n operation?: 'create' | 'delete' | 'read' | 'update'\n\n overrideAccess?: boolean\n\n populationPromises?: Promise<void>[]\n showHiddenFields?: boolean\n triggerAccessControl?: boolean\n triggerHooks?: boolean\n}\n\nexport type AfterChangeRichTextHookArgs<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = {\n /** A string relating to which operation the field type is currently executing within. */\n operation: 'create' | 'update'\n /** The document before changes were applied. */\n previousDoc?: TData\n /** The sibling data of the document before changes being applied. */\n previousSiblingDoc?: TData\n /** The previous value of the field, before changes */\n previousValue?: TValue\n}\nexport type BeforeValidateRichTextHookArgs<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = {\n /** A string relating to which operation the field type is currently executing within. */\n operation: 'create' | 'update'\n overrideAccess?: boolean\n /** The sibling data of the document before changes being applied. */\n previousSiblingDoc?: TData\n /** The previous value of the field, before changes */\n previousValue?: TValue\n}\n\nexport type BeforeChangeRichTextHookArgs<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = {\n /**\n * The original data with locales (not modified by any hooks). Only available in `beforeChange` and `beforeDuplicate` field hooks.\n */\n docWithLocales?:
|
|
1
|
+
{"version":3,"sources":["../../src/admin/RichText.ts"],"sourcesContent":["import type { GenericLanguages, I18n, I18nClient } from '@payloadcms/translations'\nimport type { JSONSchema4 } from 'json-schema'\nimport type React from 'react'\n\nimport type { SanitizedCollectionConfig, TypeWithID } from '../collections/config/types.js'\nimport type { SanitizedConfig } from '../config/types.js'\nimport type { Field, FieldAffectingData, RichTextField, Validate } from '../fields/config/types.js'\nimport type { SanitizedGlobalConfig } from '../globals/config/types.js'\nimport type { JsonObject, PayloadRequest, RequestContext } from '../types/index.js'\nimport type { WithServerSidePropsComponentProps } from './elements/WithServerSideProps.js'\n\nexport type RichTextFieldProps<Value extends object, AdapterProps, ExtraFieldProperties = {}> = {\n path?: string\n} & Omit<RichTextField<Value, AdapterProps, ExtraFieldProperties>, 'type'>\n\nexport type AfterReadRichTextHookArgs<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = {\n currentDepth?: number\n\n depth?: number\n\n draft?: boolean\n\n fallbackLocale?: string\n\n fieldPromises?: Promise<void>[]\n\n /** Boolean to denote if this hook is running against finding one, or finding many within the afterRead hook. */\n findMany?: boolean\n\n flattenLocales?: boolean\n\n locale?: string\n\n /** A string relating to which operation the field type is currently executing within. */\n operation?: 'create' | 'delete' | 'read' | 'update'\n\n overrideAccess?: boolean\n\n populationPromises?: Promise<void>[]\n showHiddenFields?: boolean\n triggerAccessControl?: boolean\n triggerHooks?: boolean\n}\n\nexport type AfterChangeRichTextHookArgs<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = {\n /** A string relating to which operation the field type is currently executing within. */\n operation: 'create' | 'update'\n /** The document before changes were applied. */\n previousDoc?: TData\n /** The sibling data of the document before changes being applied. */\n previousSiblingDoc?: TData\n /** The previous value of the field, before changes */\n previousValue?: TValue\n}\nexport type BeforeValidateRichTextHookArgs<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = {\n /** A string relating to which operation the field type is currently executing within. */\n operation: 'create' | 'update'\n overrideAccess?: boolean\n /** The sibling data of the document before changes being applied. */\n previousSiblingDoc?: TData\n /** The previous value of the field, before changes */\n previousValue?: TValue\n}\n\nexport type BeforeChangeRichTextHookArgs<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = {\n /**\n * The original data with locales (not modified by any hooks). Only available in `beforeChange` and `beforeDuplicate` field hooks.\n */\n docWithLocales?: JsonObject\n\n duplicate?: boolean\n\n errors?: { field: string; message: string }[]\n /** Only available in `beforeChange` field hooks */\n mergeLocaleActions?: (() => Promise<void>)[]\n /** A string relating to which operation the field type is currently executing within. */\n operation?: 'create' | 'delete' | 'read' | 'update'\n /** The sibling data of the document before changes being applied. */\n previousSiblingDoc?: TData\n /** The previous value of the field, before changes */\n previousValue?: TValue\n /**\n * The original siblingData with locales (not modified by any hooks).\n */\n siblingDocWithLocales?: JsonObject\n\n skipValidation?: boolean\n}\n\nexport type BaseRichTextHookArgs<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = {\n /** The collection which the field belongs to. If the field belongs to a global, this will be null. */\n collection: SanitizedCollectionConfig | null\n context: RequestContext\n /** The data passed to update the document within create and update operations, and the full document itself in the afterRead hook. */\n data?: Partial<TData>\n /** The field which the hook is running against. */\n field: FieldAffectingData\n /** The global which the field belongs to. If the field belongs to a collection, this will be null. */\n global: SanitizedGlobalConfig | null\n\n /** The full original document in `update` operations. In the `afterChange` hook, this is the resulting document of the operation. */\n originalDoc?: TData\n /**\n * The path of the field, e.g. [\"group\", \"myArray\", 1, \"textField\"]. The path is the schemaPath but with indexes and would be used in the context of field data, not field schemas.\n */\n path: (number | string)[]\n\n /** The Express request object. It is mocked for Local API operations. */\n req: PayloadRequest\n /**\n * The schemaPath of the field, e.g. [\"group\", \"myArray\", \"textField\"]. The schemaPath is the path but without indexes and would be used in the context of field schemas, not field data.\n */\n schemaPath: string[]\n /** The sibling data passed to a field that the hook is running against. */\n siblingData: Partial<TSiblingData>\n /** The value of the field. */\n value?: TValue\n}\n\nexport type AfterReadRichTextHook<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = (\n args: AfterReadRichTextHookArgs<TData, TValue, TSiblingData> &\n BaseRichTextHookArgs<TData, TValue, TSiblingData>,\n) => Promise<TValue> | TValue\n\nexport type AfterChangeRichTextHook<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = (\n args: AfterChangeRichTextHookArgs<TData, TValue, TSiblingData> &\n BaseRichTextHookArgs<TData, TValue, TSiblingData>,\n) => Promise<TValue> | TValue\n\nexport type BeforeChangeRichTextHook<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = (\n args: BaseRichTextHookArgs<TData, TValue, TSiblingData> &\n BeforeChangeRichTextHookArgs<TData, TValue, TSiblingData>,\n) => Promise<TValue> | TValue\n\nexport type BeforeValidateRichTextHook<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = (\n args: BaseRichTextHookArgs<TData, TValue, TSiblingData> &\n BeforeValidateRichTextHookArgs<TData, TValue, TSiblingData>,\n) => Promise<TValue> | TValue\n\nexport type RichTextHooks = {\n afterChange?: AfterChangeRichTextHook[]\n afterRead?: AfterReadRichTextHook[]\n beforeChange?: BeforeChangeRichTextHook[]\n beforeValidate?: BeforeValidateRichTextHook[]\n}\n\ntype RichTextAdapterBase<\n Value extends object = object,\n AdapterProps = any,\n ExtraFieldProperties = {},\n> = {\n generateComponentMap: (args: {\n WithServerSideProps: React.FC<Omit<WithServerSidePropsComponentProps, 'serverOnlyProps'>>\n config: SanitizedConfig\n i18n: I18nClient\n schemaPath: string\n }) => Map<string, React.ReactNode>\n generateSchemaMap?: (args: {\n config: SanitizedConfig\n i18n: I18n<any, any>\n schemaMap: Map<string, Field[]>\n schemaPath: string\n }) => Map<string, Field[]>\n /**\n * Like an afterRead hook, but runs only for the GraphQL resolver. For populating data, this should be used, as afterRead hooks do not have a depth in graphQL.\n *\n * To populate stuff / resolve field hooks, mutate the incoming populationPromises or fieldPromises array. They will then be awaited in the correct order within payload itself.\n * @param data\n */\n graphQLPopulationPromises?: (data: {\n context: RequestContext\n currentDepth?: number\n depth: number\n draft: boolean\n field: RichTextField<Value, AdapterProps, ExtraFieldProperties>\n fieldPromises: Promise<void>[]\n findMany: boolean\n flattenLocales: boolean\n overrideAccess?: boolean\n populationPromises: Promise<void>[]\n req: PayloadRequest\n showHiddenFields: boolean\n siblingDoc: JsonObject\n }) => void\n hooks?: RichTextHooks\n i18n?: Partial<GenericLanguages>\n outputSchema?: ({\n collectionIDFieldTypes,\n config,\n field,\n interfaceNameDefinitions,\n isRequired,\n }: {\n collectionIDFieldTypes: { [key: string]: 'number' | 'string' }\n config?: SanitizedConfig\n field: RichTextField<Value, AdapterProps, ExtraFieldProperties>\n /**\n * Allows you to define new top-level interfaces that can be re-used in the output schema.\n */\n interfaceNameDefinitions: Map<string, JSONSchema4>\n isRequired: boolean\n }) => JSONSchema4\n validate: Validate<\n Value,\n Value,\n unknown,\n RichTextField<Value, AdapterProps, ExtraFieldProperties>\n >\n}\n\nexport type RichTextAdapter<\n Value extends object = object,\n AdapterProps = any,\n ExtraFieldProperties = {},\n> = {\n CellComponent: React.FC<any>\n FieldComponent: React.FC<RichTextFieldProps<Value, AdapterProps, ExtraFieldProperties>>\n} & RichTextAdapterBase<Value, AdapterProps, ExtraFieldProperties>\n\nexport type RichTextAdapterProvider<\n Value extends object = object,\n AdapterProps = any,\n ExtraFieldProperties = {},\n> = ({\n config,\n isRoot,\n}: {\n config: SanitizedConfig\n /**\n * Whether or not this is the root richText editor, defined in the payload.config.ts.\n *\n * @default false\n */\n isRoot?: boolean\n}) =>\n | Promise<RichTextAdapter<Value, AdapterProps, ExtraFieldProperties>>\n | RichTextAdapter<Value, AdapterProps, ExtraFieldProperties>\n"],"names":[],"mappings":"AA+PA,WAiB8D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/auth/operations/resetPassword.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport jwt from 'jsonwebtoken'\n\nimport type { Collection } from '../../collections/config/types.js'\nimport type { PayloadRequest } from '../../types/index.js'\n\nimport { APIError } from '../../errors/index.js'\nimport { commitTransaction } from '../../utilities/commitTransaction.js'\nimport { initTransaction } from '../../utilities/initTransaction.js'\nimport { killTransaction } from '../../utilities/killTransaction.js'\nimport { getFieldsToSign } from '../getFieldsToSign.js'\nimport { authenticateLocalStrategy } from '../strategies/local/authenticate.js'\nimport { generatePasswordSaltHash } from '../strategies/local/generatePasswordSaltHash.js'\n\nexport type Result = {\n token?: string\n user: Record<string, unknown>\n}\n\nexport type Arguments = {\n collection: Collection\n data: {\n password: string\n token: string\n }\n depth?: number\n overrideAccess?: boolean\n req: PayloadRequest\n}\n\nexport const resetPasswordOperation = async (args: Arguments): Promise<Result> => {\n if (\n !Object.prototype.hasOwnProperty.call(args.data, 'token') ||\n !Object.prototype.hasOwnProperty.call(args.data, 'password')\n ) {\n throw new APIError('Missing required data.', httpStatus.BAD_REQUEST)\n }\n\n const {\n collection: { config: collectionConfig },\n data,\n depth,\n overrideAccess,\n req: {\n payload: { secret },\n payload,\n },\n req,\n } = args\n\n try {\n const shouldCommit = await initTransaction(req)\n\n // /////////////////////////////////////\n // Reset Password\n // /////////////////////////////////////\n\n const user = await payload.db.findOne<any>({\n collection: collectionConfig.slug,\n req,\n where: {\n resetPasswordExpiration: { greater_than: new Date() },\n resetPasswordToken: { equals: data.token },\n },\n })\n\n if (!user) throw new APIError('Token is either invalid or has expired.', httpStatus.FORBIDDEN)\n\n // TODO: replace this method\n const { hash, salt } = await generatePasswordSaltHash({\n collection: collectionConfig,\n password: data.password,\n })\n\n user.salt = salt\n user.hash = hash\n\n user.resetPasswordExpiration = new Date().toISOString()\n\n if (collectionConfig.auth.verify) {\n user._verified = true\n }\n\n const doc = await payload.db.updateOne({\n id: user.id,\n collection: collectionConfig.slug,\n data: user,\n req,\n })\n\n await authenticateLocalStrategy({ doc, password: data.password })\n\n const fieldsToSign = getFieldsToSign({\n collectionConfig,\n email: user.email,\n user,\n })\n\n const token = jwt.sign(fieldsToSign, secret, {\n expiresIn: collectionConfig.auth.tokenExpiration,\n })\n\n const fullUser = await payload.findByID({\n id: user.id,\n collection: collectionConfig.slug,\n depth,\n overrideAccess,\n req,\n })\n if (shouldCommit) await commitTransaction(req)\n\n const result = {\n token,\n user: fullUser,\n }\n\n return result\n } catch (error: unknown) {\n await killTransaction(req)\n throw error\n }\n}\n"],"names":["httpStatus","jwt","APIError","commitTransaction","initTransaction","killTransaction","getFieldsToSign","authenticateLocalStrategy","generatePasswordSaltHash","resetPasswordOperation","args","Object","prototype","hasOwnProperty","call","data","BAD_REQUEST","collection","config","collectionConfig","depth","overrideAccess","req","payload","secret","shouldCommit","user","db","findOne","slug","where","resetPasswordExpiration","greater_than","Date","resetPasswordToken","equals","token","FORBIDDEN","hash","salt","password","
|
|
1
|
+
{"version":3,"sources":["../../../src/auth/operations/resetPassword.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport jwt from 'jsonwebtoken'\n\nimport type { Collection } from '../../collections/config/types.js'\nimport type { PayloadRequest } from '../../types/index.js'\n\nimport { APIError } from '../../errors/index.js'\nimport { commitTransaction } from '../../utilities/commitTransaction.js'\nimport { initTransaction } from '../../utilities/initTransaction.js'\nimport { killTransaction } from '../../utilities/killTransaction.js'\nimport { getFieldsToSign } from '../getFieldsToSign.js'\nimport { authenticateLocalStrategy } from '../strategies/local/authenticate.js'\nimport { generatePasswordSaltHash } from '../strategies/local/generatePasswordSaltHash.js'\n\nexport type Result = {\n token?: string\n user: Record<string, unknown>\n}\n\nexport type Arguments = {\n collection: Collection\n data: {\n password: string\n token: string\n }\n depth?: number\n overrideAccess?: boolean\n req: PayloadRequest\n}\n\nexport const resetPasswordOperation = async (args: Arguments): Promise<Result> => {\n if (\n !Object.prototype.hasOwnProperty.call(args.data, 'token') ||\n !Object.prototype.hasOwnProperty.call(args.data, 'password')\n ) {\n throw new APIError('Missing required data.', httpStatus.BAD_REQUEST)\n }\n\n const {\n collection: { config: collectionConfig },\n data,\n depth,\n overrideAccess,\n req: {\n payload: { secret },\n payload,\n },\n req,\n } = args\n\n try {\n const shouldCommit = await initTransaction(req)\n\n // /////////////////////////////////////\n // Reset Password\n // /////////////////////////////////////\n\n const user = await payload.db.findOne<any>({\n collection: collectionConfig.slug,\n req,\n where: {\n resetPasswordExpiration: { greater_than: new Date().toISOString() },\n resetPasswordToken: { equals: data.token },\n },\n })\n\n if (!user) throw new APIError('Token is either invalid or has expired.', httpStatus.FORBIDDEN)\n\n // TODO: replace this method\n const { hash, salt } = await generatePasswordSaltHash({\n collection: collectionConfig,\n password: data.password,\n })\n\n user.salt = salt\n user.hash = hash\n\n user.resetPasswordExpiration = new Date().toISOString()\n\n if (collectionConfig.auth.verify) {\n user._verified = true\n }\n\n const doc = await payload.db.updateOne({\n id: user.id,\n collection: collectionConfig.slug,\n data: user,\n req,\n })\n\n await authenticateLocalStrategy({ doc, password: data.password })\n\n const fieldsToSign = getFieldsToSign({\n collectionConfig,\n email: user.email,\n user,\n })\n\n const token = jwt.sign(fieldsToSign, secret, {\n expiresIn: collectionConfig.auth.tokenExpiration,\n })\n\n const fullUser = await payload.findByID({\n id: user.id,\n collection: collectionConfig.slug,\n depth,\n overrideAccess,\n req,\n })\n if (shouldCommit) await commitTransaction(req)\n\n const result = {\n token,\n user: fullUser,\n }\n\n return result\n } catch (error: unknown) {\n await killTransaction(req)\n throw error\n }\n}\n"],"names":["httpStatus","jwt","APIError","commitTransaction","initTransaction","killTransaction","getFieldsToSign","authenticateLocalStrategy","generatePasswordSaltHash","resetPasswordOperation","args","Object","prototype","hasOwnProperty","call","data","BAD_REQUEST","collection","config","collectionConfig","depth","overrideAccess","req","payload","secret","shouldCommit","user","db","findOne","slug","where","resetPasswordExpiration","greater_than","Date","toISOString","resetPasswordToken","equals","token","FORBIDDEN","hash","salt","password","auth","verify","_verified","doc","updateOne","id","fieldsToSign","email","sign","expiresIn","tokenExpiration","fullUser","findByID","result","error"],"mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,OAAOC,SAAS,eAAc;AAK9B,SAASC,QAAQ,QAAQ,wBAAuB;AAChD,SAASC,iBAAiB,QAAQ,uCAAsC;AACxE,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,eAAe,QAAQ,wBAAuB;AACvD,SAASC,yBAAyB,QAAQ,sCAAqC;AAC/E,SAASC,wBAAwB,QAAQ,kDAAiD;AAkB1F,OAAO,MAAMC,yBAAyB,OAAOC;IAC3C,IACE,CAACC,OAAOC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACJ,KAAKK,IAAI,EAAE,YACjD,CAACJ,OAAOC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACJ,KAAKK,IAAI,EAAE,aACjD;QACA,MAAM,IAAIb,SAAS,0BAA0BF,WAAWgB,WAAW;IACrE;IAEA,MAAM,EACJC,YAAY,EAAEC,QAAQC,gBAAgB,EAAE,EACxCJ,IAAI,EACJK,KAAK,EACLC,cAAc,EACdC,KAAK,EACHC,SAAS,EAAEC,MAAM,EAAE,EACnBD,OAAO,EACR,EACDD,GAAG,EACJ,GAAGZ;IAEJ,IAAI;QACF,MAAMe,eAAe,MAAMrB,gBAAgBkB;QAE3C,wCAAwC;QACxC,iBAAiB;QACjB,wCAAwC;QAExC,MAAMI,OAAO,MAAMH,QAAQI,EAAE,CAACC,OAAO,CAAM;YACzCX,YAAYE,iBAAiBU,IAAI;YACjCP;YACAQ,OAAO;gBACLC,yBAAyB;oBAAEC,cAAc,IAAIC,OAAOC,WAAW;gBAAG;gBAClEC,oBAAoB;oBAAEC,QAAQrB,KAAKsB,KA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],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"jwt.d.ts","sourceRoot":"","sources":["../../../src/auth/strategies/jwt.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAQ,MAAM,aAAa,CAAA;AAS7D,eAAO,MAAM,iBAAiB,EAAE,oBAqE/B,CAAA"}
|
|
@@ -6,6 +6,35 @@ export const JWTAuthentication = async ({ headers, isGraphQL = false, payload })
|
|
|
6
6
|
headers,
|
|
7
7
|
payload
|
|
8
8
|
});
|
|
9
|
+
if (!token && typeof payload?.config?.admin?.autoLogin === 'object' && !payload.config.admin?.autoLogin.prefillOnly && headers.get('DisableAutologin') !== 'true') {
|
|
10
|
+
const collection = payload.collections[payload.config.admin.user];
|
|
11
|
+
const where = {
|
|
12
|
+
or: []
|
|
13
|
+
};
|
|
14
|
+
if (payload.config.admin?.autoLogin.email) {
|
|
15
|
+
where.or.push({
|
|
16
|
+
email: {
|
|
17
|
+
equals: payload.config.admin?.autoLogin.email
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
} else if (payload.config.admin?.autoLogin.username) {
|
|
21
|
+
where.or.push({
|
|
22
|
+
username: {
|
|
23
|
+
equals: payload.config.admin?.autoLogin.username
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
const user = (await payload.find({
|
|
28
|
+
collection: collection.config.slug,
|
|
29
|
+
depth: isGraphQL ? 0 : collection.config.auth.depth,
|
|
30
|
+
where
|
|
31
|
+
})).docs[0];
|
|
32
|
+
user.collection = collection.config.slug;
|
|
33
|
+
user._strategy = 'local-jwt';
|
|
34
|
+
return {
|
|
35
|
+
user: user
|
|
36
|
+
};
|
|
37
|
+
}
|
|
9
38
|
const decodedPayload = jwt.verify(token, payload.secret);
|
|
10
39
|
const collection = payload.collections[decodedPayload.collection];
|
|
11
40
|
const user = await payload.findByID({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/auth/strategies/jwt.ts"],"sourcesContent":["import jwt from 'jsonwebtoken'\n\nimport type { AuthStrategyFunction, User } from '../index.js'\n\nimport { extractJWT } from '../extractJWT.js'\n\ntype JWTToken = {\n collection: string\n id: string\n}\n\nexport const JWTAuthentication: AuthStrategyFunction = async ({\n headers,\n isGraphQL = false,\n payload,\n}) => {\n try {\n const token = extractJWT({ headers, payload })\n const decodedPayload = jwt.verify(token, payload.secret) as JWTToken & jwt.JwtPayload\n\n const collection = payload.collections[decodedPayload.collection]\n\n const user = await payload.findByID({\n id: decodedPayload.id,\n collection: decodedPayload.collection,\n depth: isGraphQL ? 0 : collection.config.auth.depth,\n })\n\n if (user && (!collection.config.auth.verify || user._verified)) {\n user.collection = collection.config.slug\n user._strategy = 'local-jwt'\n return {\n user: user as User,\n }\n } else {\n return { user: null }\n }\n } catch (error) {\n return { user: null }\n }\n}\n"],"names":["jwt","extractJWT","JWTAuthentication","headers","isGraphQL","payload","token","
|
|
1
|
+
{"version":3,"sources":["../../../src/auth/strategies/jwt.ts"],"sourcesContent":["import jwt from 'jsonwebtoken'\n\nimport type { Where } from '../../types/index.js'\nimport type { AuthStrategyFunction, User } from '../index.js'\n\nimport { extractJWT } from '../extractJWT.js'\n\ntype JWTToken = {\n collection: string\n id: string\n}\n\nexport const JWTAuthentication: AuthStrategyFunction = async ({\n headers,\n isGraphQL = false,\n payload,\n}) => {\n try {\n const token = extractJWT({ headers, payload })\n\n if (\n !token &&\n typeof payload?.config?.admin?.autoLogin === 'object' &&\n !payload.config.admin?.autoLogin.prefillOnly &&\n headers.get('DisableAutologin') !== 'true'\n ) {\n const collection = payload.collections[payload.config.admin.user]\n\n const where: Where = {\n or: [],\n }\n if (payload.config.admin?.autoLogin.email) {\n where.or.push({\n email: {\n equals: payload.config.admin?.autoLogin.email,\n },\n })\n } else if (payload.config.admin?.autoLogin.username) {\n where.or.push({\n username: {\n equals: payload.config.admin?.autoLogin.username,\n },\n })\n }\n\n const user = (\n await payload.find({\n collection: collection.config.slug,\n depth: isGraphQL ? 0 : collection.config.auth.depth,\n where,\n })\n ).docs[0]\n user.collection = collection.config.slug\n user._strategy = 'local-jwt'\n return {\n user: user as User,\n }\n }\n\n const decodedPayload = jwt.verify(token, payload.secret) as JWTToken & jwt.JwtPayload\n\n const collection = payload.collections[decodedPayload.collection]\n\n const user = await payload.findByID({\n id: decodedPayload.id,\n collection: decodedPayload.collection,\n depth: isGraphQL ? 0 : collection.config.auth.depth,\n })\n\n if (user && (!collection.config.auth.verify || user._verified)) {\n user.collection = collection.config.slug\n user._strategy = 'local-jwt'\n return {\n user: user as User,\n }\n } else {\n return { user: null }\n }\n } catch (error) {\n return { user: null }\n }\n}\n"],"names":["jwt","extractJWT","JWTAuthentication","headers","isGraphQL","payload","token","config","admin","autoLogin","prefillOnly","get","collection","collections","user","where","or","email","push","equals","username","find","slug","depth","auth","docs","_strategy","decodedPayload","verify","secret","findByID","id","_verified","error"],"mappings":"AAAA,OAAOA,SAAS,eAAc;AAK9B,SAASC,UAAU,QAAQ,mBAAkB;AAO7C,OAAO,MAAMC,oBAA0C,OAAO,EAC5DC,OAAO,EACPC,YAAY,KAAK,EACjBC,OAAO,EACR;IACC,IAAI;QACF,MAAMC,QAAQL,WAAW;YAAEE;YAASE;QAAQ;QAE5C,IACE,CAACC,SACD,OAAOD,SAASE,QAAQC,OAAOC,cAAc,YAC7C,CAACJ,QAAQE,MAAM,CAACC,KAAK,EAAEC,UAAUC,eACjCP,QAAQQ,GAAG,CAAC,wBAAwB,QACpC;YACA,MAAMC,aAAaP,QAAQQ,WAAW,CAACR,QAAQE,MAAM,CAACC,KAAK,CAACM,IAAI,CAAC;YAEjE,MAAMC,QAAe;gBACnBC,IAAI,EAAE;YACR;YACA,IAAIX,QAAQE,MAAM,CAACC,KAAK,EAAEC,UAAUQ,OAAO;gBACzCF,MAAMC,EAAE,CAACE,IAAI,CAAC;oBACZD,OAAO;wBACLE,QAAQd,QAAQE,MAAM,CAACC,KAAK,EAAEC,UAAUQ;oBAC1C;gB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ts","sourceRoot":"","sources":["../../../../src/auth/strategies/local/incrementLoginAttempts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAA;AACjG,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"incrementLoginAttempts.d.ts","sourceRoot":"","sources":["../../../../src/auth/strategies/local/incrementLoginAttempts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAA;AACjG,OAAO,KAAK,EAAc,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAE7D,KAAK,IAAI,GAAG;IACV,UAAU,EAAE,yBAAyB,CAAA;IACrC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,UAAU,CAAA;IACzC,OAAO,EAAE,OAAO,CAAA;IAChB,GAAG,EAAE,cAAc,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,sBAAsB,uCAKhC,IAAI,KAAG,OAAO,CAAC,IAAI,CA0CrB,CAAA"}
|
|
@@ -22,7 +22,7 @@ export const incrementLoginAttempts = async ({ collection, doc, payload, req })=
|
|
|
22
22
|
};
|
|
23
23
|
// Lock the account if at max attempts and not already locked
|
|
24
24
|
if (typeof doc.loginAttempts === 'number' && doc.loginAttempts + 1 >= maxLoginAttempts) {
|
|
25
|
-
const lockUntil = new Date(Date.now() + lockTime);
|
|
25
|
+
const lockUntil = new Date(Date.now() + lockTime).toISOString();
|
|
26
26
|
data.lockUntil = lockUntil;
|
|
27
27
|
}
|
|
28
28
|
await payload.update({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/auth/strategies/local/incrementLoginAttempts.ts"],"sourcesContent":["import type { SanitizedCollectionConfig, TypeWithID } from '../../../collections/config/types.js'\nimport type { Payload } from '../../../index.js'\nimport type { PayloadRequest } from '../../../types/index.js'\n\ntype Args = {\n collection: SanitizedCollectionConfig\n doc: Record<string, unknown> & TypeWithID\n payload: Payload\n req: PayloadRequest\n}\n\nexport const incrementLoginAttempts = async ({\n collection,\n doc,\n payload,\n req,\n}: Args): Promise<void> => {\n const {\n auth: { lockTime, maxLoginAttempts },\n } = collection\n\n if ('lockUntil' in doc && typeof doc.lockUntil === 'string') {\n const lockUntil = new Date(doc.lockUntil).getTime()\n\n // Expired lock, restart count at 1\n if (lockUntil < Date.now()) {\n await payload.update({\n id: doc.id,\n collection: collection.slug,\n data: {\n lockUntil: null,\n loginAttempts: 1,\n },\n depth: 0,\n req,\n })\n }\n\n return\n }\n\n const data:
|
|
1
|
+
{"version":3,"sources":["../../../../src/auth/strategies/local/incrementLoginAttempts.ts"],"sourcesContent":["import type { SanitizedCollectionConfig, TypeWithID } from '../../../collections/config/types.js'\nimport type { JsonObject, Payload } from '../../../index.js'\nimport type { PayloadRequest } from '../../../types/index.js'\n\ntype Args = {\n collection: SanitizedCollectionConfig\n doc: Record<string, unknown> & TypeWithID\n payload: Payload\n req: PayloadRequest\n}\n\nexport const incrementLoginAttempts = async ({\n collection,\n doc,\n payload,\n req,\n}: Args): Promise<void> => {\n const {\n auth: { lockTime, maxLoginAttempts },\n } = collection\n\n if ('lockUntil' in doc && typeof doc.lockUntil === 'string') {\n const lockUntil = new Date(doc.lockUntil).getTime()\n\n // Expired lock, restart count at 1\n if (lockUntil < Date.now()) {\n await payload.update({\n id: doc.id,\n collection: collection.slug,\n data: {\n lockUntil: null,\n loginAttempts: 1,\n },\n depth: 0,\n req,\n })\n }\n\n return\n }\n\n const data: JsonObject = {\n loginAttempts: Number(doc.loginAttempts) + 1,\n }\n\n // Lock the account if at max attempts and not already locked\n if (typeof doc.loginAttempts === 'number' && doc.loginAttempts + 1 >= maxLoginAttempts) {\n const lockUntil = new Date(Date.now() + lockTime).toISOString()\n data.lockUntil = lockUntil\n }\n\n await payload.update({\n id: doc.id,\n collection: collection.slug,\n data,\n depth: 0,\n req,\n })\n}\n"],"names":["incrementLoginAttempts","collection","doc","payload","req","auth","lockTime","maxLoginAttempts","lockUntil","Date","getTime","now","update","id","slug","data","loginAttempts","depth","Number","toISOString"],"mappings":"AAWA,OAAO,MAAMA,yBAAyB,OAAO,EAC3CC,UAAU,EACVC,GAAG,EACHC,OAAO,EACPC,GAAG,EACE;IACL,MAAM,EACJC,MAAM,EAAEC,QAAQ,EAAEC,gBAAgB,EAAE,EACrC,GAAGN;IAEJ,IAAI,eAAeC,OAAO,OAAOA,IAAIM,SAAS,KAAK,UAAU;QAC3D,MAAMA,YAAY,IAAIC,KAAKP,IAAIM,SAAS,EAAEE,OAAO;QAEjD,mCAAmC;QACnC,IAAIF,YAAYC,KAAKE,GAAG,IAAI;YAC1B,MAAMR,QAAQS,MAAM,CAAC;gBACnBC,IAAIX,IAAIW,EAAE;gBACVZ,YAAYA,WAAWa,IAAI;gBAC3BC,MAAM;oBACJP,WAAW;oBACXQ,eAAe;gBACjB;gBACAC,OAAO;gBACPb;YACF;QACF;QAEA;IACF;IAEA,MAAMW,OAAmB;QACvBC,eAAeE,OAAOhB,IAAIc,aAAa,IAAI;IAC7C;IAEA,6DAA6D;IAC7D,IAAI,OAAOd,IAAIc,aAAa,KAAK,YAAYd,IAAIc,aAAa,GAAG,KAAKT,kBAAkB;QACtF,MAAMC,YAAY,IAAIC,KAAKA,KAAKE,GAAG,KAAKL,UAAUa,WAAW;QAC7DJ,KAAKP,SAAS,GAAGA;IACnB;IAEA,MAAML,QAAQS,MAAM,CAAC;QACnBC,IAAIX,IAAIW,EAAE;QACVZ,YAAYA,WAAWa,IAAI;QAC3BC;QACAE,OAAO;QACPb;IACF;AACF,EAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { SanitizedCollectionConfig } from '../../../collections/config/types.js';
|
|
2
|
-
import type { Payload } from '../../../index.js';
|
|
2
|
+
import type { JsonObject, Payload } from '../../../index.js';
|
|
3
3
|
import type { PayloadRequest } from '../../../types/index.js';
|
|
4
4
|
type Args = {
|
|
5
5
|
collection: SanitizedCollectionConfig;
|
|
6
|
-
doc:
|
|
6
|
+
doc: JsonObject;
|
|
7
7
|
password: string;
|
|
8
8
|
payload: Payload;
|
|
9
9
|
req: PayloadRequest;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../src/auth/strategies/local/register.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAA;AACrF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../src/auth/strategies/local/register.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAA;AACrF,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAK7D,KAAK,IAAI,GAAG;IACV,UAAU,EAAE,yBAAyB,CAAA;IACrC,GAAG,EAAE,UAAU,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,OAAO,CAAA;IAChB,GAAG,EAAE,cAAc,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,qBAAqB,iDAM/B,IAAI,KAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAkDxC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/auth/strategies/local/register.ts"],"sourcesContent":["import type { SanitizedCollectionConfig } from '../../../collections/config/types.js'\nimport type { Payload } from '../../../index.js'\nimport type { PayloadRequest } from '../../../types/index.js'\n\nimport { ValidationError } from '../../../errors/index.js'\nimport { generatePasswordSaltHash } from './generatePasswordSaltHash.js'\n\ntype Args = {\n collection: SanitizedCollectionConfig\n doc:
|
|
1
|
+
{"version":3,"sources":["../../../../src/auth/strategies/local/register.ts"],"sourcesContent":["import type { SanitizedCollectionConfig } from '../../../collections/config/types.js'\nimport type { JsonObject, Payload } from '../../../index.js'\nimport type { PayloadRequest } from '../../../types/index.js'\n\nimport { ValidationError } from '../../../errors/index.js'\nimport { generatePasswordSaltHash } from './generatePasswordSaltHash.js'\n\ntype Args = {\n collection: SanitizedCollectionConfig\n doc: JsonObject\n password: string\n payload: Payload\n req: PayloadRequest\n}\n\nexport const registerLocalStrategy = async ({\n collection,\n doc,\n password,\n payload,\n req,\n}: Args): Promise<Record<string, unknown>> => {\n const loginWithUsername = collection?.auth?.loginWithUsername\n\n const existingUser = await payload.find({\n collection: collection.slug,\n depth: 0,\n limit: 1,\n pagination: false,\n req,\n where: loginWithUsername\n ? {\n username: {\n equals: doc.username,\n },\n }\n : {\n email: {\n equals: doc.email,\n },\n },\n })\n\n if (existingUser.docs.length > 0) {\n throw new ValidationError({\n collection: collection.slug,\n errors: [\n loginWithUsername\n ? {\n field: 'username',\n message: req.t('error:usernameAlreadyRegistered'),\n }\n : { field: 'email', message: req.t('error:userEmailAlreadyRegistered') },\n ],\n })\n }\n\n const { hash, salt } = await generatePasswordSaltHash({ collection, password })\n\n const sanitizedDoc = { ...doc }\n if (sanitizedDoc.password) delete sanitizedDoc.password\n\n return payload.db.create({\n collection: collection.slug,\n data: {\n ...sanitizedDoc,\n hash,\n salt,\n },\n req,\n })\n}\n"],"names":["ValidationError","generatePasswordSaltHash","registerLocalStrategy","collection","doc","password","payload","req","loginWithUsername","auth","existingUser","find","slug","depth","limit","pagination","where","username","equals","email","docs","length","errors","field","message","t","hash","salt","sanitizedDoc","db","create","data"],"mappings":"AAIA,SAASA,eAAe,QAAQ,2BAA0B;AAC1D,SAASC,wBAAwB,QAAQ,gCAA+B;AAUxE,OAAO,MAAMC,wBAAwB,OAAO,EAC1CC,UAAU,EACVC,GAAG,EACHC,QAAQ,EACRC,OAAO,EACPC,GAAG,EACE;IACL,MAAMC,oBAAoBL,YAAYM,MAAMD;IAE5C,MAAME,eAAe,MAAMJ,QAAQK,IAAI,CAAC;QACtCR,YAAYA,WAAWS,IAAI;QAC3BC,OAAO;QACPC,OAAO;QACPC,YAAY;QACZR;QACAS,OAAOR,oBACH;YACES,UAAU;gBACRC,QAAQd,IAAIa,QAAQ;YACtB;QACF,IACA;YACEE,OAAO;gBACLD,QAAQd,IAAIe,KAAK;YACnB;QACF;IACN;IAEA,IAAIT,aAAaU,IAAI,CAACC,MAAM,GAAG,GAAG;QAChC,MAAM,IAAIrB,gBAAgB;YACxBG,YAAYA,WAAWS,IAAI;YAC3BU,QAAQ;gBACNd,oBACI;oBACEe,OAAO;oBACPC,SAASjB,IAAIkB,CAAC,CAAC;gBACjB,IACA;oBAAEF,OAAO;oBAASC,SAASjB,IAAIkB,CAAC,CAAC;gBAAoC;aAC1E;QACH;IACF;IAEA,MAAM,EAAEC,IAAI,EAAEC,IAAI,EAAE,GAAG,MAAM1B,yBAAyB;QAAEE;QAAYE;IAAS;IAE7E,MAAMuB,eAAe;QAAE,GAAGxB,GAAG;IAAC;IAC9B,IAAIwB,aAAavB,QAAQ,EAAE,OAAOuB,aAAavB,QAAQ;IAEvD,OAAOC,QAAQuB,EAAE,CAACC,MAAM,CAAC;QACvB3B,YAAYA,WAAWS,IAAI;QAC3BmB,MAAM;YACJ,GAAGH,YAAY;YACfF;YACAC;QACF;QACApB;IACF;AACF,EAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import { compile } from 'json-schema-to-typescript';
|
|
3
3
|
import { configToJSONSchema } from '../utilities/configToJSONSchema.js';
|
|
4
|
-
import
|
|
4
|
+
import { getLogger } from '../utilities/logger.js';
|
|
5
5
|
export async function generateTypes(config, options) {
|
|
6
|
-
const logger =
|
|
6
|
+
const logger = getLogger();
|
|
7
7
|
const outputFile = process.env.PAYLOAD_TS_OUTPUT_PATH || config.typescript.outputFile;
|
|
8
8
|
const shouldLog = options?.log ?? true;
|
|
9
9
|
if (shouldLog) logger.info('Compiling TS types for Collections and Globals...');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/bin/generateTypes.ts"],"sourcesContent":["import fs from 'fs'\nimport { compile } from 'json-schema-to-typescript'\n\nimport type { SanitizedConfig } from '../config/types.js'\n\nimport { configToJSONSchema } from '../utilities/configToJSONSchema.js'\nimport
|
|
1
|
+
{"version":3,"sources":["../../src/bin/generateTypes.ts"],"sourcesContent":["import fs from 'fs'\nimport { compile } from 'json-schema-to-typescript'\n\nimport type { SanitizedConfig } from '../config/types.js'\n\nimport { configToJSONSchema } from '../utilities/configToJSONSchema.js'\nimport { getLogger } from '../utilities/logger.js'\n\nexport async function generateTypes(\n config: SanitizedConfig,\n options?: { log: boolean },\n): Promise<void> {\n const logger = getLogger()\n const outputFile = process.env.PAYLOAD_TS_OUTPUT_PATH || config.typescript.outputFile\n\n const shouldLog = options?.log ?? true\n\n if (shouldLog) logger.info('Compiling TS types for Collections and Globals...')\n\n const jsonSchema = configToJSONSchema(config, config.db.defaultIDType)\n\n const declare = `declare module 'payload' {\\n export interface GeneratedTypes extends Config {}\\n}`\n const declareWithTSIgnoreError = `declare module 'payload' {\\n // @ts-ignore \\n export interface GeneratedTypes extends Config {}\\n}`\n\n let compiled = await compile(jsonSchema, 'Config', {\n bannerComment:\n '/* tslint:disable */\\n/* eslint-disable */\\n/**\\n* This file was automatically generated by Payload.\\n* DO NOT MODIFY IT BY HAND. Instead, modify your source Payload config,\\n* and re-run `payload generate:types` to regenerate this file.\\n*/',\n style: {\n singleQuote: true,\n },\n // Generates code for $defs that aren't referenced by the schema. Reason:\n // If a field defines an interfaceName, it should be included in the generated types\n // even if it's not used by another type. Reason: the user might want to use it in their own code.\n unreachableDefinitions: true,\n })\n\n if (config.typescript.declare !== false) {\n if (config.typescript.declare?.ignoreTSError) {\n compiled += `\\n\\n${declareWithTSIgnoreError}`\n } else {\n compiled += `\\n\\n${declare}`\n }\n }\n\n // Diff the compiled types against the existing types file\n try {\n const existingTypes = fs.readFileSync(outputFile, 'utf-8')\n\n if (compiled === existingTypes) {\n return\n }\n } catch (_) {\n // swallow err\n }\n\n fs.writeFileSync(outputFile, compiled)\n if (shouldLog) logger.info(`Types written to ${outputFile}`)\n}\n"],"names":["fs","compile","configToJSONSchema","getLogger","generateTypes","config","options","logger","outputFile","process","env","PAYLOAD_TS_OUTPUT_PATH","typescript","shouldLog","log","info","jsonSchema","db","defaultIDType","declare","declareWithTSIgnoreError","compiled","bannerComment","style","singleQuote","unreachableDefinitions","ignoreTSError","existingTypes","readFileSync","_","writeFileSync"],"mappings":"AAAA,OAAOA,QAAQ,KAAI;AACnB,SAASC,OAAO,QAAQ,4BAA2B;AAInD,SAASC,kBAAkB,QAAQ,qCAAoC;AACvE,SAASC,SAAS,QAAQ,yBAAwB;AAElD,OAAO,eAAeC,cACpBC,MAAuB,EACvBC,OAA0B;IAE1B,MAAMC,SAASJ;IACf,MAAMK,aAAaC,QAAQC,GAAG,CAACC,sBAAsB,IAAIN,OAAOO,UAAU,CAACJ,UAAU;IAErF,MAAMK,YAAYP,SAASQ,OAAO;IAElC,IAAID,WAAWN,OAAOQ,IAAI,CAAC;IAE3B,MAAMC,aAAad,mBAAmBG,QAAQA,OAAOY,EAAE,CAACC,aAAa;IAErE,MAAMC,UAAU,CAAC,kFAAkF,CAAC;IACpG,MAAMC,2BAA2B,CAAC,oGAAoG,CAAC;IAEvI,IAAIC,WAAW,MAAMpB,QAAQe,YAAY,UAAU;QACjDM,eACE;QACFC,OAAO;YACLC,aAAa;QACf;QACA,yEAAyE;QACzE,oFAAoF;QACpF,kGAAkG;QAClGC,wBAAwB;IAC1B;IAEA,IAAIpB,OAAOO,UAAU,CAACO,OAAO,KAAK,OAAO;QACvC,IAAId,OAAOO,UAAU,CAACO,OAAO,EAAEO,eAAe;YAC5CL,YAAY,CAAC,IAAI,EAA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
6
|
-
}) => boolean;
|
|
7
|
-
delete: ({ req: { user } }: {
|
|
8
|
-
req: import("../../index.js").PayloadRequest;
|
|
9
|
-
}) => boolean;
|
|
10
|
-
read: ({ req: { user } }: {
|
|
11
|
-
req: import("../../index.js").PayloadRequest;
|
|
12
|
-
}) => boolean;
|
|
13
|
-
unlock: ({ req: { user } }: {
|
|
14
|
-
req: import("../../index.js").PayloadRequest;
|
|
15
|
-
}) => boolean;
|
|
16
|
-
update: ({ req: { user } }: {
|
|
17
|
-
req: import("../../index.js").PayloadRequest;
|
|
18
|
-
}) => boolean;
|
|
19
|
-
};
|
|
20
|
-
admin: {
|
|
21
|
-
components: {};
|
|
22
|
-
custom: {};
|
|
23
|
-
enableRichTextLink: boolean;
|
|
24
|
-
enableRichTextRelationship: boolean;
|
|
25
|
-
pagination: {
|
|
26
|
-
defaultLimit: number;
|
|
27
|
-
limits: number[];
|
|
28
|
-
};
|
|
29
|
-
useAsTitle: string;
|
|
30
|
-
};
|
|
31
|
-
auth: boolean;
|
|
32
|
-
custom: {};
|
|
33
|
-
endpoints: any[];
|
|
34
|
-
fields: any[];
|
|
35
|
-
hooks: {
|
|
36
|
-
afterChange: any[];
|
|
37
|
-
afterDelete: any[];
|
|
38
|
-
afterForgotPassword: any[];
|
|
39
|
-
afterLogin: any[];
|
|
40
|
-
afterLogout: any[];
|
|
41
|
-
afterMe: any[];
|
|
42
|
-
afterOperation: any[];
|
|
43
|
-
afterRead: any[];
|
|
44
|
-
afterRefresh: any[];
|
|
45
|
-
beforeChange: any[];
|
|
46
|
-
beforeDelete: any[];
|
|
47
|
-
beforeLogin: any[];
|
|
48
|
-
beforeOperation: any[];
|
|
49
|
-
beforeRead: any[];
|
|
50
|
-
beforeValidate: any[];
|
|
51
|
-
me: any[];
|
|
52
|
-
refresh: any[];
|
|
53
|
-
};
|
|
54
|
-
timestamps: boolean;
|
|
55
|
-
upload: boolean;
|
|
56
|
-
versions: boolean;
|
|
57
|
-
};
|
|
58
|
-
export declare const authDefaults: {
|
|
59
|
-
cookies: {
|
|
60
|
-
sameSite: string;
|
|
61
|
-
secure: boolean;
|
|
62
|
-
};
|
|
63
|
-
forgotPassword: {};
|
|
64
|
-
lockTime: number;
|
|
65
|
-
loginWithUsername: boolean;
|
|
66
|
-
maxLoginAttempts: number;
|
|
67
|
-
tokenExpiration: number;
|
|
68
|
-
verify: boolean;
|
|
69
|
-
};
|
|
1
|
+
import type { IncomingAuthType, LoginWithUsernameOptions } from '../../auth/types.js';
|
|
2
|
+
import type { CollectionConfig } from './types.js';
|
|
3
|
+
export declare const defaults: Partial<CollectionConfig>;
|
|
4
|
+
export declare const authDefaults: IncomingAuthType;
|
|
70
5
|
export declare const loginWithUsernameDefaults: LoginWithUsernameOptions;
|
|
71
6
|
//# sourceMappingURL=defaults.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../../src/collections/config/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../../src/collections/config/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAA;AACrF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAIlD,eAAO,MAAM,QAAQ,EAAE,OAAO,CAAC,gBAAgB,CA6C9C,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,gBAW1B,CAAA;AAED,eAAO,MAAM,yBAAyB,EAAE,wBAGvC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/collections/config/defaults.ts"],"sourcesContent":["import type { LoginWithUsernameOptions } from '../../auth/types.js'\n\nimport defaultAccess from '../../auth/defaultAccess.js'\n\nexport const defaults = {\n access: {\n create: defaultAccess,\n delete: defaultAccess,\n read: defaultAccess,\n unlock: defaultAccess,\n update: defaultAccess,\n },\n admin: {\n components: {},\n custom: {},\n enableRichTextLink: true,\n enableRichTextRelationship: true,\n pagination: {\n defaultLimit: 10,\n limits: [5, 10, 25, 50, 100],\n },\n useAsTitle: 'id',\n },\n auth: false,\n custom: {},\n endpoints: [],\n fields: [],\n hooks: {\n afterChange: [],\n afterDelete: [],\n afterForgotPassword: [],\n afterLogin: [],\n afterLogout: [],\n afterMe: [],\n afterOperation: [],\n afterRead: [],\n afterRefresh: [],\n beforeChange: [],\n beforeDelete: [],\n beforeLogin: [],\n beforeOperation: [],\n beforeRead: [],\n beforeValidate: [],\n me: [],\n refresh: [],\n },\n timestamps: true,\n upload: false,\n versions: false,\n}\n\nexport const authDefaults = {\n cookies: {\n sameSite: 'Lax',\n secure: false,\n },\n forgotPassword: {},\n lockTime: 600000, // 10 minutes\n loginWithUsername: false,\n maxLoginAttempts: 5,\n tokenExpiration: 7200,\n verify: false,\n}\n\nexport const loginWithUsernameDefaults: LoginWithUsernameOptions = {\n allowEmailLogin: false,\n requireEmail: false,\n}\n"],"names":["defaultAccess","defaults","access","create","delete","read","unlock","update","admin","components","custom","enableRichTextLink","enableRichTextRelationship","pagination","defaultLimit","limits","useAsTitle","auth","endpoints","fields","hooks","afterChange","afterDelete","afterForgotPassword","afterLogin","afterLogout","afterMe","afterOperation","afterRead","afterRefresh","beforeChange","beforeDelete","beforeLogin","beforeOperation","beforeRead","beforeValidate","me","refresh","timestamps","upload","versions","authDefaults","cookies","sameSite","secure","forgotPassword","lockTime","loginWithUsername","maxLoginAttempts","tokenExpiration","verify","loginWithUsernameDefaults","allowEmailLogin","requireEmail"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/collections/config/defaults.ts"],"sourcesContent":["import type { IncomingAuthType, LoginWithUsernameOptions } from '../../auth/types.js'\nimport type { CollectionConfig } from './types.js'\n\nimport defaultAccess from '../../auth/defaultAccess.js'\n\nexport const defaults: Partial<CollectionConfig> = {\n access: {\n create: defaultAccess,\n delete: defaultAccess,\n read: defaultAccess,\n unlock: defaultAccess,\n update: defaultAccess,\n },\n admin: {\n components: {},\n custom: {},\n enableRichTextLink: true,\n enableRichTextRelationship: true,\n pagination: {\n defaultLimit: 10,\n limits: [5, 10, 25, 50, 100],\n },\n useAsTitle: 'id',\n },\n auth: false,\n custom: {},\n endpoints: [],\n fields: [],\n hooks: {\n afterChange: [],\n afterDelete: [],\n afterForgotPassword: [],\n afterLogin: [],\n afterLogout: [],\n afterMe: [],\n afterOperation: [],\n afterRead: [],\n afterRefresh: [],\n beforeChange: [],\n beforeDelete: [],\n beforeLogin: [],\n beforeOperation: [],\n beforeRead: [],\n beforeValidate: [],\n me: [],\n refresh: [],\n },\n timestamps: true,\n upload: false,\n versions: false,\n}\n\nexport const authDefaults: IncomingAuthType = {\n cookies: {\n sameSite: 'Lax',\n secure: false,\n },\n forgotPassword: {},\n lockTime: 600000, // 10 minutes\n loginWithUsername: false,\n maxLoginAttempts: 5,\n tokenExpiration: 7200,\n verify: false,\n}\n\nexport const loginWithUsernameDefaults: LoginWithUsernameOptions = {\n allowEmailLogin: false,\n requireEmail: false,\n}\n"],"names":["defaultAccess","defaults","access","create","delete","read","unlock","update","admin","components","custom","enableRichTextLink","enableRichTextRelationship","pagination","defaultLimit","limits","useAsTitle","auth","endpoints","fields","hooks","afterChange","afterDelete","afterForgotPassword","afterLogin","afterLogout","afterMe","afterOperation","afterRead","afterRefresh","beforeChange","beforeDelete","beforeLogin","beforeOperation","beforeRead","beforeValidate","me","refresh","timestamps","upload","versions","authDefaults","cookies","sameSite","secure","forgotPassword","lockTime","loginWithUsername","maxLoginAttempts","tokenExpiration","verify","loginWithUsernameDefaults","allowEmailLogin","requireEmail"],"mappings":"AAGA,OAAOA,mBAAmB,8BAA6B;AAEvD,OAAO,MAAMC,WAAsC;IACjDC,QAAQ;QACNC,QAAQH;QACRI,QAAQJ;QACRK,MAAML;QACNM,QAAQN;QACRO,QAAQP;IACV;IACAQ,OAAO;QACLC,YAAY,CAAC;QACbC,QAAQ,CAAC;QACTC,oBAAoB;QACpBC,4BAA4B;QAC5BC,YAAY;YACVC,cAAc;YACdC,QAAQ;gBAAC;gBAAG;gBAAI;gBAAI;gBAAI;aAAI;QAC9B;QACAC,YAAY;IACd;IACAC,MAAM;IACNP,QAAQ,CAAC;IACTQ,WAAW,EAAE;IACbC,QAAQ,EAAE;IACVC,OAAO;QACLC,aAAa,EAAE;QACfC,aAAa,EAAE;QACfC,qBAAqB,EAAE;QACvBC,YAAY,EAAE;QACdC,aAAa,EAAE;QACfC,SAAS,EAAE;QACXC,gBAAgB,EAAE;QAClBC,WAAW,EAAE;QACbC,cAAc,EAAE;QAChBC,cAAc,EAAE;QAChBC,cAAc,EAAE;QAChBC,aAAa,EAAE;QACfC,iBAAiB,EAAE;QACnBC,YAAY,EAAE;QACdC,gBAAgB,EAAE;QAClBC,IAAI,EAAE;QACNC,SAAS,EAAE;IACb;IACAC,YAAY;IACZC,QAAQ;IACRC,UAAU;AACZ,EAAC;AAED,OAAO,MAAMC,eAAiC;IAC5CC,SAAS;QACPC,UAAU;QACVC,QAAQ;IACV;IACAC,gBAAgB,CAAC;IACjBC,UAAU;IACVC,mBAAmB;IACnBC,kBAAkB;IAClBC,iBAAiB;IACjBC,QAAQ;AACV,EAAC;AAED,OAAO,MAAMC,4BAAsD;IACjEC,iBAAiB;IACjBC,cAAc;AAChB,EAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Field } from '../../fields/config/types.js';
|
|
2
|
+
import type { CollectionConfig } from '../../index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Sanitize fields for collections with auth config enabled.
|
|
5
|
+
*
|
|
6
|
+
* Should run on top level fields only.
|
|
7
|
+
*/
|
|
8
|
+
export declare const sanitizeAuthFields: (fields: Field[], config: CollectionConfig) => void;
|
|
9
|
+
/**
|
|
10
|
+
* Sanitize fields for collections with upload config enabled.
|
|
11
|
+
*
|
|
12
|
+
* Should run on top level fields only.
|
|
13
|
+
*/
|
|
14
|
+
export declare const sanitizeUploadFields: (fields: Field[], config: CollectionConfig) => void;
|
|
15
|
+
//# sourceMappingURL=reservedFieldNames.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reservedFieldNames.d.ts","sourceRoot":"","sources":["../../../src/collections/config/reservedFieldNames.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAsDtD;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,WAAY,KAAK,EAAE,UAAU,gBAAgB,SAsD3E,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,WAAY,KAAK,EAAE,UAAU,gBAAgB,SA4B7E,CAAA"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { ReservedFieldName } from '../../errors/ReservedFieldName.js';
|
|
2
|
+
import { fieldAffectsData } from '../../fields/config/types.js';
|
|
3
|
+
// Note for future reference: We've slimmed down the reserved field names but left them in here for reference in case it's needed in the future.
|
|
4
|
+
/**
|
|
5
|
+
* Reserved field names for collections with auth config enabled
|
|
6
|
+
*/ const reservedBaseAuthFieldNames = [
|
|
7
|
+
/* 'email',
|
|
8
|
+
'resetPasswordToken',
|
|
9
|
+
'resetPasswordExpiration', */ 'salt',
|
|
10
|
+
'hash'
|
|
11
|
+
];
|
|
12
|
+
/**
|
|
13
|
+
* Reserved field names for auth collections with verify: true
|
|
14
|
+
*/ const reservedVerifyFieldNames = [];
|
|
15
|
+
/**
|
|
16
|
+
* Reserved field names for auth collections with useApiKey: true
|
|
17
|
+
*/ const reservedAPIKeyFieldNames = [];
|
|
18
|
+
/**
|
|
19
|
+
* Reserved field names for collections with upload config enabled
|
|
20
|
+
*/ const reservedBaseUploadFieldNames = [
|
|
21
|
+
'file'
|
|
22
|
+
];
|
|
23
|
+
/**
|
|
24
|
+
* Reserved field names for collections with versions enabled
|
|
25
|
+
*/ const reservedVersionsFieldNames = [];
|
|
26
|
+
/**
|
|
27
|
+
* Sanitize fields for collections with auth config enabled.
|
|
28
|
+
*
|
|
29
|
+
* Should run on top level fields only.
|
|
30
|
+
*/ export const sanitizeAuthFields = (fields, config)=>{
|
|
31
|
+
for(let i = 0; i < fields.length; i++){
|
|
32
|
+
const field = fields[i];
|
|
33
|
+
if (fieldAffectsData(field) && field.name) {
|
|
34
|
+
if (config.auth && typeof config.auth === 'object' && !config.auth.disableLocalStrategy) {
|
|
35
|
+
const auth = config.auth;
|
|
36
|
+
if (reservedBaseAuthFieldNames.includes(field.name)) {
|
|
37
|
+
throw new ReservedFieldName(field, field.name);
|
|
38
|
+
}
|
|
39
|
+
if (auth.verify) {
|
|
40
|
+
if (reservedAPIKeyFieldNames.includes(field.name)) {
|
|
41
|
+
throw new ReservedFieldName(field, field.name);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/* if (auth.maxLoginAttempts) {
|
|
45
|
+
if (field.name === 'loginAttempts' || field.name === 'lockUntil') {
|
|
46
|
+
throw new ReservedFieldName(field, field.name)
|
|
47
|
+
}
|
|
48
|
+
} */ /* if (auth.loginWithUsername) {
|
|
49
|
+
if (field.name === 'username') {
|
|
50
|
+
throw new ReservedFieldName(field, field.name)
|
|
51
|
+
}
|
|
52
|
+
} */ if (auth.verify) {
|
|
53
|
+
if (reservedVerifyFieldNames.includes(field.name)) {
|
|
54
|
+
throw new ReservedFieldName(field, field.name);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
// Handle tabs without a name
|
|
60
|
+
if (field.type === 'tabs') {
|
|
61
|
+
for(let j = 0; j < field.tabs.length; j++){
|
|
62
|
+
const tab = field.tabs[j];
|
|
63
|
+
if (!('name' in tab)) {
|
|
64
|
+
sanitizeAuthFields(tab.fields, config);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
// Handle presentational fields like rows and collapsibles
|
|
69
|
+
if (!fieldAffectsData(field) && 'fields' in field && field.fields) {
|
|
70
|
+
sanitizeAuthFields(field.fields, config);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Sanitize fields for collections with upload config enabled.
|
|
76
|
+
*
|
|
77
|
+
* Should run on top level fields only.
|
|
78
|
+
*/ export const sanitizeUploadFields = (fields, config)=>{
|
|
79
|
+
if (config.upload && typeof config.upload === 'object') {
|
|
80
|
+
for(let i = 0; i < fields.length; i++){
|
|
81
|
+
const field = fields[i];
|
|
82
|
+
if (fieldAffectsData(field) && field.name) {
|
|
83
|
+
if (reservedBaseUploadFieldNames.includes(field.name)) {
|
|
84
|
+
throw new ReservedFieldName(field, field.name);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
// Handle tabs without a name
|
|
88
|
+
if (field.type === 'tabs') {
|
|
89
|
+
for(let j = 0; j < field.tabs.length; j++){
|
|
90
|
+
const tab = field.tabs[j];
|
|
91
|
+
if (!('name' in tab)) {
|
|
92
|
+
sanitizeUploadFields(tab.fields, config);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
// Handle presentational fields like rows and collapsibles
|
|
97
|
+
if (!fieldAffectsData(field) && 'fields' in field && field.fields) {
|
|
98
|
+
sanitizeUploadFields(field.fields, config);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
//# sourceMappingURL=reservedFieldNames.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/collections/config/reservedFieldNames.ts"],"sourcesContent":["import type { Field } from '../../fields/config/types.js'\nimport type { CollectionConfig } from '../../index.js'\n\nimport { ReservedFieldName } from '../../errors/ReservedFieldName.js'\nimport { fieldAffectsData } from '../../fields/config/types.js'\n\n// Note for future reference: We've slimmed down the reserved field names but left them in here for reference in case it's needed in the future.\n\n/**\n * Reserved field names for collections with auth config enabled\n */\nconst reservedBaseAuthFieldNames = [\n /* 'email',\n 'resetPasswordToken',\n 'resetPasswordExpiration', */\n 'salt',\n 'hash',\n]\n/**\n * Reserved field names for auth collections with verify: true\n */\nconst reservedVerifyFieldNames = [\n /* '_verified', '_verificationToken' */\n]\n/**\n * Reserved field names for auth collections with useApiKey: true\n */\nconst reservedAPIKeyFieldNames = [\n /* 'enableAPIKey', 'apiKeyIndex', 'apiKey' */\n]\n\n/**\n * Reserved field names for collections with upload config enabled\n */\nconst reservedBaseUploadFieldNames = [\n 'file',\n /* 'mimeType',\n 'thumbnailURL',\n 'width',\n 'height',\n 'filesize',\n 'filename',\n 'url',\n 'focalX',\n 'focalY',\n 'sizes', */\n]\n\n/**\n * Reserved field names for collections with versions enabled\n */\nconst reservedVersionsFieldNames = [\n /* '__v', '_status' */\n]\n\n/**\n * Sanitize fields for collections with auth config enabled.\n *\n * Should run on top level fields only.\n */\nexport const sanitizeAuthFields = (fields: Field[], config: CollectionConfig) => {\n for (let i = 0; i < fields.length; i++) {\n const field = fields[i]\n\n if (fieldAffectsData(field) && field.name) {\n if (config.auth && typeof config.auth === 'object' && !config.auth.disableLocalStrategy) {\n const auth = config.auth\n\n if (reservedBaseAuthFieldNames.includes(field.name)) {\n throw new ReservedFieldName(field, field.name)\n }\n\n if (auth.verify) {\n if (reservedAPIKeyFieldNames.includes(field.name)) {\n throw new ReservedFieldName(field, field.name)\n }\n }\n\n /* if (auth.maxLoginAttempts) {\n if (field.name === 'loginAttempts' || field.name === 'lockUntil') {\n throw new ReservedFieldName(field, field.name)\n }\n } */\n\n /* if (auth.loginWithUsername) {\n if (field.name === 'username') {\n throw new ReservedFieldName(field, field.name)\n }\n } */\n\n if (auth.verify) {\n if (reservedVerifyFieldNames.includes(field.name)) {\n throw new ReservedFieldName(field, field.name)\n }\n }\n }\n }\n\n // Handle tabs without a name\n if (field.type === 'tabs') {\n for (let j = 0; j < field.tabs.length; j++) {\n const tab = field.tabs[j]\n\n if (!('name' in tab)) {\n sanitizeAuthFields(tab.fields, config)\n }\n }\n }\n\n // Handle presentational fields like rows and collapsibles\n if (!fieldAffectsData(field) && 'fields' in field && field.fields) {\n sanitizeAuthFields(field.fields, config)\n }\n }\n}\n\n/**\n * Sanitize fields for collections with upload config enabled.\n *\n * Should run on top level fields only.\n */\nexport const sanitizeUploadFields = (fields: Field[], config: CollectionConfig) => {\n if (config.upload && typeof config.upload === 'object') {\n for (let i = 0; i < fields.length; i++) {\n const field = fields[i]\n\n if (fieldAffectsData(field) && field.name) {\n if (reservedBaseUploadFieldNames.includes(field.name)) {\n throw new ReservedFieldName(field, field.name)\n }\n }\n\n // Handle tabs without a name\n if (field.type === 'tabs') {\n for (let j = 0; j < field.tabs.length; j++) {\n const tab = field.tabs[j]\n\n if (!('name' in tab)) {\n sanitizeUploadFields(tab.fields, config)\n }\n }\n }\n\n // Handle presentational fields like rows and collapsibles\n if (!fieldAffectsData(field) && 'fields' in field && field.fields) {\n sanitizeUploadFields(field.fields, config)\n }\n }\n }\n}\n"],"names":["ReservedFieldName","fieldAffectsData","reservedBaseAuthFieldNames","reservedVerifyFieldNames","reservedAPIKeyFieldNames","reservedBaseUploadFieldNames","reservedVersionsFieldNames","sanitizeAuthFields","fields","config","i","length","field","name","auth","disableLocalStrategy","includes","verify","type","j","tabs","tab","sanitizeUploadFields","upload"],"mappings":"AAGA,SAASA,iBAAiB,QAAQ,oCAAmC;AACrE,SAASC,gBAAgB,QAAQ,+BAA8B;AAE/D,gJAAgJ;AAEhJ;;CAEC,GACD,MAAMC,6BAA6B;IACjC;;6BAE2B,GAC3B;IACA;CACD;AACD;;CAEC,GACD,MAAMC,2BAA2B,EAEhC;AACD;;CAEC,GACD,MAAMC,2BAA2B,EAEhC;AAED;;CAEC,GACD,MAAMC,+BAA+B;IACnC;CAWD;AAED;;CAEC,GACD,MAAMC,6BAA6B,EAElC;AAED;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