payload 3.84.1 → 3.85.0
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/email/normalizeSendEmailOptions.d.ts +13 -0
- package/dist/email/normalizeSendEmailOptions.d.ts.map +1 -0
- package/dist/email/normalizeSendEmailOptions.js +20 -0
- package/dist/email/normalizeSendEmailOptions.js.map +1 -0
- package/dist/email/types.d.ts +7 -2
- package/dist/email/types.d.ts.map +1 -1
- package/dist/email/types.js.map +1 -1
- package/dist/index.bundled.d.ts +7 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/queues/errors/handleWorkflowError.d.ts.map +1 -1
- package/dist/queues/errors/handleWorkflowError.js +9 -1
- package/dist/queues/errors/handleWorkflowError.js.map +1 -1
- package/dist/queues/operations/runJobs/index.d.ts.map +1 -1
- package/dist/queues/operations/runJobs/index.js +33 -10
- package/dist/queues/operations/runJobs/index.js.map +1 -1
- package/dist/uploads/getSafeFilename.d.ts +9 -4
- package/dist/uploads/getSafeFilename.d.ts.map +1 -1
- package/dist/uploads/getSafeFilename.js +5 -5
- package/dist/uploads/getSafeFilename.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @todo: Remove in v4.
|
|
3
|
+
*
|
|
4
|
+
* This is a runtime guard to handle the breaking change in nodemailer v8.
|
|
5
|
+
*
|
|
6
|
+
* The `from` property is intentionally narrowed back to nodemailer 7's shape.
|
|
7
|
+
* Nodemailer v8 (security patch) widened it to also accept an array of addresses (breaking change).
|
|
8
|
+
* For backwards compatibility, we normalize that from an array back to a single address at runtime.
|
|
9
|
+
*/
|
|
10
|
+
export declare function normalizeSendEmailOptions<T extends {
|
|
11
|
+
from?: unknown;
|
|
12
|
+
}>(message: T): T;
|
|
13
|
+
//# sourceMappingURL=normalizeSendEmailOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalizeSendEmailOptions.d.ts","sourceRoot":"","sources":["../../src/email/normalizeSendEmailOptions.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,SAAS;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAUrF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @todo: Remove in v4.
|
|
3
|
+
*
|
|
4
|
+
* This is a runtime guard to handle the breaking change in nodemailer v8.
|
|
5
|
+
*
|
|
6
|
+
* The `from` property is intentionally narrowed back to nodemailer 7's shape.
|
|
7
|
+
* Nodemailer v8 (security patch) widened it to also accept an array of addresses (breaking change).
|
|
8
|
+
* For backwards compatibility, we normalize that from an array back to a single address at runtime.
|
|
9
|
+
*/ export function normalizeSendEmailOptions(message) {
|
|
10
|
+
if (!Array.isArray(message.from)) {
|
|
11
|
+
return message;
|
|
12
|
+
}
|
|
13
|
+
const first = message.from[0];
|
|
14
|
+
return {
|
|
15
|
+
...message,
|
|
16
|
+
from: typeof first === 'string' || first && typeof first === 'object' ? first : undefined
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=normalizeSendEmailOptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/email/normalizeSendEmailOptions.ts"],"sourcesContent":["import type { Address } from 'nodemailer/lib/mailer'\n\n/**\n * @todo: Remove in v4.\n *\n * This is a runtime guard to handle the breaking change in nodemailer v8.\n *\n * The `from` property is intentionally narrowed back to nodemailer 7's shape.\n * Nodemailer v8 (security patch) widened it to also accept an array of addresses (breaking change).\n * For backwards compatibility, we normalize that from an array back to a single address at runtime.\n */\nexport function normalizeSendEmailOptions<T extends { from?: unknown }>(message: T): T {\n if (!Array.isArray(message.from)) {\n return message\n }\n\n const first = (message.from as Array<Address | string>)[0]\n return {\n ...message,\n from: typeof first === 'string' || (first && typeof first === 'object') ? first : undefined,\n } as { from?: Address | string } & T\n}\n"],"names":["normalizeSendEmailOptions","message","Array","isArray","from","first","undefined"],"mappings":"AAEA;;;;;;;;CAQC,GACD,OAAO,SAASA,0BAAwDC,OAAU;IAChF,IAAI,CAACC,MAAMC,OAAO,CAACF,QAAQG,IAAI,GAAG;QAChC,OAAOH;IACT;IAEA,MAAMI,QAAQ,AAACJ,QAAQG,IAAI,AAA4B,CAAC,EAAE;IAC1D,OAAO;QACL,GAAGH,OAAO;QACVG,MAAM,OAAOC,UAAU,YAAaA,SAAS,OAAOA,UAAU,WAAYA,QAAQC;IACpF;AACF"}
|
package/dist/email/types.d.ts
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import type { SendMailOptions as NodemailerSendMailOptions } from 'nodemailer';
|
|
2
|
+
import type { Address } from 'nodemailer/lib/mailer';
|
|
2
3
|
import type { Payload } from '../types/index.js';
|
|
3
4
|
type Prettify<T> = {
|
|
4
5
|
[K in keyof T]: T[K];
|
|
5
6
|
} & NonNullable<unknown>;
|
|
6
7
|
/**
|
|
7
|
-
* Options for sending an email. Allows access to the PayloadRequest object
|
|
8
|
+
* Options for sending an email. Allows access to the PayloadRequest object.
|
|
9
|
+
*
|
|
10
|
+
* @todo: Remove in v4. See `normalizeSendEmailOptions` for details.
|
|
8
11
|
*/
|
|
9
|
-
export type SendEmailOptions = Prettify<
|
|
12
|
+
export type SendEmailOptions = Prettify<{
|
|
13
|
+
from?: Address | string;
|
|
14
|
+
} & Omit<NodemailerSendMailOptions, 'from'>>;
|
|
10
15
|
/**
|
|
11
16
|
* Email adapter after it has been initialized. This is used internally by Payload.
|
|
12
17
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/email/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,IAAI,yBAAyB,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/email/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,IAAI,yBAAyB,EAAE,MAAM,YAAY,CAAA;AAC9E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAEpD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAEhD,KAAK,QAAQ,CAAC,CAAC,IAAI;KAChB,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACrB,GAAG,WAAW,CAAC,OAAO,CAAC,CAAA;AAExB;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CACrC;IACE,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;CACxB,GAAG,IAAI,CAAC,yBAAyB,EAAE,MAAM,CAAC,CAC5C,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,uBAAuB,CAAC,kBAAkB,GAAG,OAAO,IAAI,UAAU,CAC5E,YAAY,CAAC,kBAAkB,CAAC,CACjC,CAAA;AAED;;;;GAIG;AAEH,MAAM,MAAM,YAAY,CAAC,kBAAkB,GAAG,OAAO,IAAI,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,KAAK;IAC9F,kBAAkB,EAAE,MAAM,CAAA;IAC1B,eAAe,EAAE,MAAM,CAAA;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAA;CACtE,CAAA"}
|
package/dist/email/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/email/types.ts"],"sourcesContent":["import type { SendMailOptions as NodemailerSendMailOptions } from 'nodemailer'\n\nimport type { Payload } from '../types/index.js'\n\ntype Prettify<T> = {\n [K in keyof T]: T[K]\n} & NonNullable<unknown>\n\n/**\n * Options for sending an email. Allows access to the PayloadRequest object
|
|
1
|
+
{"version":3,"sources":["../../src/email/types.ts"],"sourcesContent":["import type { SendMailOptions as NodemailerSendMailOptions } from 'nodemailer'\nimport type { Address } from 'nodemailer/lib/mailer'\n\nimport type { Payload } from '../types/index.js'\n\ntype Prettify<T> = {\n [K in keyof T]: T[K]\n} & NonNullable<unknown>\n\n/**\n * Options for sending an email. Allows access to the PayloadRequest object.\n *\n * @todo: Remove in v4. See `normalizeSendEmailOptions` for details.\n */\nexport type SendEmailOptions = Prettify<\n {\n from?: Address | string\n } & Omit<NodemailerSendMailOptions, 'from'>\n>\n\n/**\n * Email adapter after it has been initialized. This is used internally by Payload.\n */\nexport type InitializedEmailAdapter<TSendEmailResponse = unknown> = ReturnType<\n EmailAdapter<TSendEmailResponse>\n>\n\n/**\n * Email adapter interface. Allows a generic type for the response of the sendEmail method.\n *\n * This is the interface to use if you are creating a new email adapter.\n */\n\nexport type EmailAdapter<TSendEmailResponse = unknown> = ({ payload }: { payload: Payload }) => {\n defaultFromAddress: string\n defaultFromName: string\n name: string\n sendEmail: (message: SendEmailOptions) => Promise<TSendEmailResponse>\n}\n"],"names":[],"mappings":"AA2BA;;;;CAIC,GAED,WAKC"}
|
package/dist/index.bundled.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ import sharp, { Metadata as Metadata$1, SharpOptions, Sharp, ResizeOptions } fro
|
|
|
11
11
|
import { EditorProps } from '@monaco-editor/react';
|
|
12
12
|
import { OperationArgs as OperationArgs$1, Request as Request$1 } from 'graphql-http';
|
|
13
13
|
import { SendMailOptions } from 'nodemailer';
|
|
14
|
+
import { Address } from 'nodemailer/lib/mailer';
|
|
14
15
|
import { ParsedArgs } from 'minimist';
|
|
15
16
|
import { lookup } from 'dns';
|
|
16
17
|
import deepMerge from 'deepmerge';
|
|
@@ -4331,9 +4332,13 @@ type Prettify$1<T> = {
|
|
|
4331
4332
|
[K in keyof T]: T[K];
|
|
4332
4333
|
} & NonNullable<unknown>;
|
|
4333
4334
|
/**
|
|
4334
|
-
* Options for sending an email. Allows access to the PayloadRequest object
|
|
4335
|
+
* Options for sending an email. Allows access to the PayloadRequest object.
|
|
4336
|
+
*
|
|
4337
|
+
* @todo: Remove in v4. See `normalizeSendEmailOptions` for details.
|
|
4335
4338
|
*/
|
|
4336
|
-
type SendEmailOptions = Prettify$1<
|
|
4339
|
+
type SendEmailOptions = Prettify$1<{
|
|
4340
|
+
from?: Address | string;
|
|
4341
|
+
} & Omit<SendMailOptions, 'from'>>;
|
|
4337
4342
|
/**
|
|
4338
4343
|
* Email adapter after it has been initialized. This is used internally by Payload.
|
|
4339
4344
|
*/
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAC7E,OAAO,KAAK,EAAE,OAAO,IAAI,cAAc,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAC5E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAClC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAQ7C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AACzD,OAAO,KAAK,EAAE,MAAM,IAAI,oBAAoB,EAAE,MAAM,qCAAqC,CAAA;AACzF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAC7D,OAAO,KAAK,EAAE,MAAM,IAAI,mBAAmB,EAAE,MAAM,oCAAoC,CAAA;AACvF,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAChE,OAAO,KAAK,EACV,mBAAmB,EACnB,UAAU,EACV,sBAAsB,EACtB,wBAAwB,EACxB,UAAU,E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@@ -35,6 +35,7 @@ import { generateImportMap } from './bin/generateImportMap/index.js';
|
|
|
35
35
|
import { checkPayloadDependencies } from './checkPayloadDependencies.js';
|
|
36
36
|
import { countVersionsLocal } from './collections/operations/local/countVersions.js';
|
|
37
37
|
import { consoleEmailAdapter } from './email/consoleEmailAdapter.js';
|
|
38
|
+
import { normalizeSendEmailOptions } from './email/normalizeSendEmailOptions.js';
|
|
38
39
|
import { fieldAffectsData } from './fields/config/types.js';
|
|
39
40
|
import { getJobsLocalAPI } from './queues/localAPI.js';
|
|
40
41
|
import { _internal_jobSystemGlobals } from './queues/utilities/getCurrentDate.js';
|
|
@@ -408,7 +409,11 @@ let checkedDependencies = false;
|
|
|
408
409
|
this.logger.warn(`Collections with uploads enabled require a storage adapter when deploying to Vercel. Collection(s) without storage adapters: ${slugs}. See https://payloadcms.com/docs/upload/storage-adapters for more info.`);
|
|
409
410
|
}
|
|
410
411
|
}
|
|
411
|
-
|
|
412
|
+
/**
|
|
413
|
+
* @todo: Remove in v4.
|
|
414
|
+
* See `normalizeSendEmailOptions` for details.
|
|
415
|
+
*/ const adapterSendEmail = this.email['sendEmail'];
|
|
416
|
+
this.sendEmail = (message)=>adapterSendEmail(normalizeSendEmailOptions(message));
|
|
412
417
|
serverInitTelemetry(this);
|
|
413
418
|
// 1. loop over collections, if collection has auth strategy, initialize and push to array
|
|
414
419
|
let jwtStrategyEnabled = false;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { ExecutionResult, GraphQLSchema, ValidationRule } from 'graphql'\nimport type { Request as graphQLRequest, OperationArgs } from 'graphql-http'\nimport type { Logger } from 'pino'\nimport type { NonNever } from 'ts-essentials'\n\nimport { spawn } from 'child_process'\nimport crypto from 'crypto'\nimport { fileURLToPath } from 'node:url'\nimport path from 'path'\nimport WebSocket from 'ws'\n\nimport type { AuthArgs } from './auth/operations/auth.js'\nimport type { Result as ForgotPasswordResult } from './auth/operations/forgotPassword.js'\nimport type { LoginResult } from './auth/operations/login.js'\nimport type { Result as ResetPasswordResult } from './auth/operations/resetPassword.js'\nimport type { AuthStrategy, UntypedUser } from './auth/types.js'\nimport type {\n BulkOperationResult,\n Collection,\n DataFromCollectionSlug,\n SelectFromCollectionSlug,\n TypeWithID,\n} from './collections/config/types.js'\n\nimport {\n forgotPasswordLocal,\n type Options as ForgotPasswordOptions,\n} from './auth/operations/local/forgotPassword.js'\nimport { loginLocal, type Options as LoginOptions } from './auth/operations/local/login.js'\nimport {\n resetPasswordLocal,\n type Options as ResetPasswordOptions,\n} from './auth/operations/local/resetPassword.js'\nimport { unlockLocal, type Options as UnlockOptions } from './auth/operations/local/unlock.js'\nimport {\n verifyEmailLocal,\n type Options as VerifyEmailOptions,\n} from './auth/operations/local/verifyEmail.js'\nexport type { FieldState } from './admin/forms/Form.js'\nimport type { InitOptions, SanitizedConfig } from './config/types.js'\nimport type { BaseDatabaseAdapter, PaginatedDistinctDocs, PaginatedDocs } from './database/types.js'\nimport type { InitializedEmailAdapter } from './email/types.js'\nimport type { DataFromGlobalSlug, Globals, SelectFromGlobalSlug } from './globals/config/types.js'\nimport type {\n ApplyDisableErrors,\n DraftTransformCollectionWithSelect,\n JsonObject,\n SelectType,\n TransformCollectionWithSelect,\n TransformGlobalWithSelect,\n} from './types/index.js'\nimport type { TraverseFieldsCallback } from './utilities/traverseFields.js'\n\nimport { countLocal, type CountOptions } from './collections/operations/local/count.js'\nimport {\n createLocal,\n type Options as CreateOptions,\n} from './collections/operations/local/create.js'\nimport {\n type ByIDOptions as DeleteByIDOptions,\n deleteLocal,\n type ManyOptions as DeleteManyOptions,\n type Options as DeleteOptions,\n} from './collections/operations/local/delete.js'\nimport {\n duplicateLocal,\n type Options as DuplicateOptions,\n} from './collections/operations/local/duplicate.js'\nimport { findLocal, type FindOptions } from './collections/operations/local/find.js'\nexport type { FindOptions }\nimport {\n findByIDLocal,\n type Options as FindByIDOptions,\n} from './collections/operations/local/findByID.js'\nimport {\n findDistinct as findDistinctLocal,\n type Options as FindDistinctOptions,\n} from './collections/operations/local/findDistinct.js'\nimport {\n findVersionByIDLocal,\n type Options as FindVersionByIDOptions,\n} from './collections/operations/local/findVersionByID.js'\nimport {\n findVersionsLocal,\n type Options as FindVersionsOptions,\n} from './collections/operations/local/findVersions.js'\nimport {\n restoreVersionLocal,\n type Options as RestoreVersionOptions,\n} from './collections/operations/local/restoreVersion.js'\nimport {\n type ByIDOptions as UpdateByIDOptions,\n updateLocal,\n type ManyOptions as UpdateManyOptions,\n type Options as UpdateOptions,\n} from './collections/operations/local/update.js'\nimport {\n countGlobalVersionsLocal,\n type CountGlobalVersionsOptions,\n} from './globals/operations/local/countVersions.js'\nimport {\n type Options as FindGlobalOptions,\n findOneGlobalLocal,\n} from './globals/operations/local/findOne.js'\nimport {\n findGlobalVersionByIDLocal,\n type Options as FindGlobalVersionByIDOptions,\n} from './globals/operations/local/findVersionByID.js'\nimport {\n findGlobalVersionsLocal,\n type Options as FindGlobalVersionsOptions,\n} from './globals/operations/local/findVersions.js'\nimport {\n restoreGlobalVersionLocal,\n type Options as RestoreGlobalVersionOptions,\n} from './globals/operations/local/restoreVersion.js'\nimport {\n updateGlobalLocal,\n type Options as UpdateGlobalOptions,\n} from './globals/operations/local/update.js'\nexport type * from './admin/types.js'\nexport { EntityType } from './admin/views/dashboard.js'\nimport type { SupportedLanguages } from '@payloadcms/translations'\n\nimport { Cron } from 'croner'\n\nimport type { ClientConfig } from './config/client.js'\nimport type { KVAdapter } from './kv/index.js'\nimport type { BaseJob } from './queues/config/types/workflowTypes.js'\nimport type { TypeWithVersion } from './versions/types.js'\n\nimport { decrypt, encrypt } from './auth/crypto.js'\nimport { authLocal } from './auth/operations/local/auth.js'\nimport { APIKeyAuthentication } from './auth/strategies/apiKey.js'\nimport { JWTAuthentication } from './auth/strategies/jwt.js'\nimport { generateImportMap, type ImportMap } from './bin/generateImportMap/index.js'\nimport { checkPayloadDependencies } from './checkPayloadDependencies.js'\nimport {\n countVersionsLocal,\n type CountVersionsOptions,\n} from './collections/operations/local/countVersions.js'\nimport { consoleEmailAdapter } from './email/consoleEmailAdapter.js'\nimport { fieldAffectsData, type FlattenedBlock } from './fields/config/types.js'\nimport { getJobsLocalAPI } from './queues/localAPI.js'\nimport { _internal_jobSystemGlobals } from './queues/utilities/getCurrentDate.js'\nimport { formatAdminURL } from './utilities/formatAdminURL.js'\nimport { isNextBuild } from './utilities/isNextBuild.js'\nimport { getLogger } from './utilities/logger.js'\nimport { serverInit as serverInitTelemetry } from './utilities/telemetry/events/serverInit.js'\nimport { traverseFields } from './utilities/traverseFields.js'\n\n/**\n * Export of all base fields that could potentially be\n * useful as users wish to extend built-in fields with custom logic\n */\nexport { accountLockFields as baseAccountLockFields } from './auth/baseFields/accountLock.js'\nexport { apiKeyFields as baseAPIKeyFields } from './auth/baseFields/apiKey.js'\nexport { baseAuthFields } from './auth/baseFields/auth.js'\nexport { emailFieldConfig as baseEmailField } from './auth/baseFields/email.js'\nexport { sessionsFieldConfig as baseSessionsField } from './auth/baseFields/sessions.js'\nexport { usernameFieldConfig as baseUsernameField } from './auth/baseFields/username.js'\n\nexport { verificationFields as baseVerificationFields } from './auth/baseFields/verification.js'\nexport { executeAccess } from './auth/executeAccess.js'\nexport { executeAuthStrategies } from './auth/executeAuthStrategies.js'\nexport { extractAccessFromPermission } from './auth/extractAccessFromPermission.js'\nexport { getAccessResults } from './auth/getAccessResults.js'\nexport { getFieldsToSign } from './auth/getFieldsToSign.js'\nexport { getLoginOptions } from './auth/getLoginOptions.js'\nexport * from './auth/index.js'\n\n/**\n * Shape constraint for PayloadTypes.\n * Matches the structure of generated Config types.\n *\n * By defining the actual shape, we can use simple property access (T['collections'])\n * instead of conditional types throughout the codebase.\n */\nexport interface PayloadTypesShape {\n auth: Record<string, unknown>\n blocks: Record<string, unknown>\n collections: Record<string, unknown>\n collectionsJoins: Record<string, unknown>\n collectionsSelect: Record<string, unknown>\n db: { defaultIDType: unknown }\n fallbackLocale: unknown\n globals: Record<string, unknown>\n globalsSelect: Record<string, unknown>\n jobs: unknown\n locale: unknown\n user: unknown\n widgets?: Record<string, unknown>\n}\n\n/**\n * Untyped fallback types. Uses the SAME property names as generated types.\n * PayloadTypes merges GeneratedTypes with these fallbacks.\n */\nexport interface UntypedPayloadTypes {\n auth: {\n [slug: string]: {\n forgotPassword: {\n email: string\n }\n login: {\n email: string\n password: string\n }\n registerFirstUser: {\n email: string\n password: string\n }\n unlock: {\n email: string\n }\n }\n }\n blocks: {\n [slug: string]: JsonObject\n }\n collections: {\n [slug: string]: JsonObject & TypeWithID\n }\n collectionsJoins: {\n [slug: string]: {\n [schemaPath: string]: string\n }\n }\n collectionsSelect: {\n [slug: string]: SelectType\n }\n db: {\n defaultIDType: number | string\n }\n fallbackLocale: 'false' | 'none' | 'null' | ({} & string)[] | ({} & string) | false | null\n globals: {\n [slug: string]: JsonObject\n }\n globalsSelect: {\n [slug: string]: SelectType\n }\n jobs: {\n tasks: {\n [slug: string]: {\n input?: JsonObject\n output?: JsonObject\n }\n }\n workflows: {\n [slug: string]: {\n input: JsonObject\n }\n }\n }\n locale: null | string\n user: UntypedUser\n widgets: {\n [slug: string]: JsonObject\n }\n}\n\n/**\n * Interface to be module-augmented by the `payload-types.ts` file.\n * When augmented, its properties take precedence over UntypedPayloadTypes.\n */\nexport interface GeneratedTypes {}\n\n/**\n * Interface to be module-augmented by plugin packages.\n * Maps plugin slug to plugin options type, enabling typed cross-plugin\n * discovery via the `plugins` map passed to `definePlugin` functions.\n *\n * @experimental\n *\n * @example\n * // In a plugin package's index.ts:\n * declare module 'payload' {\n * interface RegisteredPlugins {\n * 'plugin-seo': SEOPluginOptions\n * }\n * }\n */\nexport interface RegisteredPlugins {}\n\n/**\n * Check if GeneratedTypes has been augmented (has any keys).\n */\ntype IsAugmented = keyof GeneratedTypes extends never ? false : true\n\n/**\n * PayloadTypes merges GeneratedTypes with UntypedPayloadTypes.\n * - When augmented: uses augmented properties, fills gaps with untyped fallbacks\n * - When not augmented: uses only UntypedPayloadTypes\n */\nexport type PayloadTypes = IsAugmented extends true\n ? GeneratedTypes & Omit<UntypedPayloadTypes, keyof GeneratedTypes>\n : UntypedPayloadTypes\n\nexport type TypedCollection<T extends PayloadTypesShape = PayloadTypes> = T['collections']\n\nexport type TypedBlock = PayloadTypes['blocks']\n\nexport type TypedWidget<T extends PayloadTypesShape = PayloadTypes> = T extends {\n widgets: infer TWidgets\n}\n ? TWidgets extends Record<string, unknown>\n ? TWidgets\n : Record<string, unknown>\n : Record<string, unknown>\n\nexport type TypedUploadCollection<T extends PayloadTypesShape = PayloadTypes> = NonNever<{\n [TSlug in keyof T['collections']]:\n | 'filename'\n | 'filesize'\n | 'mimeType'\n | 'url' extends keyof T['collections'][TSlug]\n ? T['collections'][TSlug]\n : never\n}>\n\nexport type TypedCollectionSelect<T extends PayloadTypesShape = PayloadTypes> =\n T['collectionsSelect']\n\nexport type TypedCollectionJoins<T extends PayloadTypesShape = PayloadTypes> = T['collectionsJoins']\n\nexport type TypedGlobal<T extends PayloadTypesShape = PayloadTypes> = T['globals']\n\nexport type TypedGlobalSelect<T extends PayloadTypesShape = PayloadTypes> = T['globalsSelect']\n\n// Extract string keys from the type\nexport type StringKeyOf<T> = Extract<keyof T, string>\n\n// Define the types for slugs using the appropriate collections and globals\nexport type CollectionSlug<T extends PayloadTypesShape = PayloadTypes> = StringKeyOf<\n T['collections']\n>\n\nexport type BlockSlug = StringKeyOf<TypedBlock>\n\nexport type WidgetSlug<T extends PayloadTypesShape = PayloadTypes> = StringKeyOf<TypedWidget<T>>\n\nexport type DataFromWidgetSlug<TSlug extends WidgetSlug> = TypedWidget[TSlug] extends {\n data?: infer TData\n}\n ? TData\n : TypedWidget[TSlug]\n\nexport type UploadCollectionSlug<T extends PayloadTypesShape = PayloadTypes> = StringKeyOf<\n TypedUploadCollection<T>\n>\n\nexport type DefaultDocumentIDType = PayloadTypes['db']['defaultIDType']\n\nexport type GlobalSlug<T extends PayloadTypesShape = PayloadTypes> = StringKeyOf<T['globals']>\n\nexport type TypedLocale<T extends PayloadTypesShape = PayloadTypes> = T['locale']\n\nexport type TypedFallbackLocale = PayloadTypes['fallbackLocale']\n\n/**\n *\n * TypedUser is the type of the user object. This can be a union of multiple user types, if you have multiple\n * auth-enabled collections.\n *\n * @todo rename to `User` in 4.0\n */\nexport type TypedUser = PayloadTypes['user']\n\nexport type TypedAuthOperations<T extends PayloadTypesShape = PayloadTypes> = T['auth']\n\nexport type AuthCollectionSlug<T extends PayloadTypesShape = PayloadTypes> = StringKeyOf<T['auth']>\n\nexport type TypedJobs = PayloadTypes['jobs']\n\n// Check if payload-jobs exists in the AUGMENTED types (not the fallback with index signature)\ntype HasPayloadJobsType = GeneratedTypes extends { collections: infer C }\n ? 'payload-jobs' extends keyof C\n ? true\n : false\n : false\n\n/**\n * Represents a job in the `payload-jobs` collection, referencing a queued workflow or task (= Job).\n * If a generated type for the `payload-jobs` collection is not available, falls back to the BaseJob type.\n *\n * `input` and `taksStatus` are always present here, as the job afterRead hook will always populate them.\n */\nexport type Job<\n TWorkflowSlugOrInput extends false | keyof TypedJobs['workflows'] | object = false,\n> = HasPayloadJobsType extends true\n ? {\n input: BaseJob<TWorkflowSlugOrInput>['input']\n taskStatus: BaseJob<TWorkflowSlugOrInput>['taskStatus']\n } & Omit<TypedCollection['payload-jobs'], 'input' | 'taskStatus'>\n : BaseJob<TWorkflowSlugOrInput>\n\nconst filename = fileURLToPath(import.meta.url)\nconst dirname = path.dirname(filename)\n\nlet checkedDependencies = false\n\n/**\n * @description Payload\n */\nexport class BasePayload {\n /**\n * @description Authorization and Authentication using headers and cookies to run auth user strategies\n * @returns permissions: Permissions\n * @returns user: User\n */\n auth = async (options: AuthArgs) => {\n return authLocal(this, options)\n }\n\n authStrategies!: AuthStrategy[]\n\n blocks: Record<BlockSlug, FlattenedBlock> = {}\n\n collections: Record<CollectionSlug, Collection> = {}\n\n config!: SanitizedConfig\n /**\n * @description Performs count operation\n * @param options\n * @returns count of documents satisfying query\n */\n count = async <T extends CollectionSlug>(\n options: CountOptions<T>,\n ): Promise<{ totalDocs: number }> => {\n return countLocal(this, options)\n }\n\n /**\n * @description Performs countGlobalVersions operation\n * @param options\n * @returns count of global document versions satisfying query\n */\n countGlobalVersions = async <T extends GlobalSlug>(\n options: CountGlobalVersionsOptions<T>,\n ): Promise<{ totalDocs: number }> => {\n return countGlobalVersionsLocal(this, options)\n }\n\n /**\n * @description Performs countVersions operation\n * @param options\n * @returns count of document versions satisfying query\n */\n countVersions = async <T extends CollectionSlug>(\n options: CountVersionsOptions<T>,\n ): Promise<{ totalDocs: number }> => {\n return countVersionsLocal(this, options)\n }\n\n /**\n * @description Performs create operation\n * @param options\n * @returns created document\n */\n create = async <TSlug extends CollectionSlug, TSelect extends SelectFromCollectionSlug<TSlug>>(\n options: CreateOptions<TSlug, TSelect>,\n ): Promise<TransformCollectionWithSelect<TSlug, TSelect>> => {\n return createLocal<TSlug, TSelect>(this, options)\n }\n\n crons: Cron[] = []\n db!: DatabaseAdapter\n\n decrypt = decrypt\n\n destroy = async () => {\n if (this.crons.length) {\n // Remove all crons from the list before stopping them\n const cronsToStop = this.crons.splice(0, this.crons.length)\n await Promise.all(cronsToStop.map((cron) => cron.stop()))\n }\n\n if (this.db?.destroy && typeof this.db.destroy === 'function') {\n await this.db.destroy()\n }\n }\n\n duplicate = async <TSlug extends CollectionSlug, TSelect extends SelectFromCollectionSlug<TSlug>>(\n options: DuplicateOptions<TSlug, TSelect>,\n ): Promise<TransformCollectionWithSelect<TSlug, TSelect>> => {\n return duplicateLocal<TSlug, TSelect>(this, options)\n }\n\n email!: InitializedEmailAdapter\n\n // TODO: re-implement or remove?\n // errorHandler: ErrorHandler\n\n encrypt = encrypt\n\n extensions!: (args: {\n args: OperationArgs<any>\n req: graphQLRequest<unknown, unknown>\n result: ExecutionResult\n }) => Promise<any>\n\n /**\n * @description Find documents with criteria\n * @param options\n * @returns documents satisfying query\n */\n find = async <\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n TDraft extends boolean = false,\n >(\n options: { draft?: TDraft } & FindOptions<TSlug, TSelect>,\n ): Promise<\n PaginatedDocs<\n TDraft extends true\n ? PayloadTypes extends { strictDraftTypes: true }\n ? DraftTransformCollectionWithSelect<TSlug, TSelect>\n : TransformCollectionWithSelect<TSlug, TSelect>\n : TransformCollectionWithSelect<TSlug, TSelect>\n >\n > => {\n return findLocal<TSlug, TSelect, TDraft>(this, options)\n }\n\n /**\n * @description Find document by ID\n * @param options\n * @returns document with specified ID\n */\n findByID = async <\n TSlug extends CollectionSlug,\n TDisableErrors extends boolean,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n >(\n options: FindByIDOptions<TSlug, TDisableErrors, TSelect>,\n ): Promise<ApplyDisableErrors<TransformCollectionWithSelect<TSlug, TSelect>, TDisableErrors>> => {\n return findByIDLocal<TSlug, TDisableErrors, TSelect>(this, options)\n }\n\n /**\n * @description Find distinct field values\n * @param options\n * @returns result with distinct field values\n */\n findDistinct = async <\n TSlug extends CollectionSlug,\n TField extends keyof DataFromCollectionSlug<TSlug> & string,\n >(\n options: FindDistinctOptions<TSlug, TField>,\n ): Promise<PaginatedDistinctDocs<Record<TField, DataFromCollectionSlug<TSlug>[TField]>>> => {\n return findDistinctLocal(this, options)\n }\n\n findGlobal = async <TSlug extends GlobalSlug, TSelect extends SelectFromGlobalSlug<TSlug>>(\n options: FindGlobalOptions<TSlug, TSelect>,\n ): Promise<TransformGlobalWithSelect<TSlug, TSelect>> => {\n return findOneGlobalLocal<TSlug, TSelect>(this, options)\n }\n\n /**\n * @description Find global version by ID\n * @param options\n * @returns global version with specified ID\n */\n findGlobalVersionByID = async <TSlug extends GlobalSlug>(\n options: FindGlobalVersionByIDOptions<TSlug>,\n ): Promise<TypeWithVersion<DataFromGlobalSlug<TSlug>>> => {\n return findGlobalVersionByIDLocal<TSlug>(this, options)\n }\n\n /**\n * @description Find global versions with criteria\n * @param options\n * @returns versions satisfying query\n */\n findGlobalVersions = async <TSlug extends GlobalSlug>(\n options: FindGlobalVersionsOptions<TSlug>,\n ): Promise<PaginatedDocs<TypeWithVersion<DataFromGlobalSlug<TSlug>>>> => {\n return findGlobalVersionsLocal<TSlug>(this, options)\n }\n\n /**\n * @description Find version by ID\n * @param options\n * @returns version with specified ID\n */\n findVersionByID = async <TSlug extends CollectionSlug>(\n options: FindVersionByIDOptions<TSlug>,\n ): Promise<TypeWithVersion<DataFromCollectionSlug<TSlug>>> => {\n return findVersionByIDLocal<TSlug>(this, options)\n }\n\n /**\n * @description Find versions with criteria\n * @param options\n * @returns versions satisfying query\n */\n findVersions = async <TSlug extends CollectionSlug>(\n options: FindVersionsOptions<TSlug>,\n ): Promise<PaginatedDocs<TypeWithVersion<DataFromCollectionSlug<TSlug>>>> => {\n return findVersionsLocal<TSlug>(this, options)\n }\n\n forgotPassword = async <TSlug extends CollectionSlug>(\n options: ForgotPasswordOptions<TSlug>,\n ): Promise<ForgotPasswordResult> => {\n return forgotPasswordLocal<TSlug>(this, options)\n }\n\n getAdminURL = (): string =>\n formatAdminURL({\n adminRoute: this.config.routes.admin,\n path: '',\n serverURL: this.config.serverURL,\n })\n\n getAPIURL = (): string =>\n formatAdminURL({\n apiRoute: this.config.routes.api,\n path: '',\n serverURL: this.config.serverURL,\n })\n\n globals!: Globals\n\n importMap!: ImportMap\n\n jobs = getJobsLocalAPI(this)\n\n /**\n * Key Value storage\n */\n kv!: KVAdapter\n\n logger!: Logger\n\n login = async <TSlug extends CollectionSlug>(\n options: LoginOptions<TSlug>,\n ): Promise<LoginResult<TSlug>> => {\n return loginLocal<TSlug>(this, options)\n }\n\n resetPassword = async <TSlug extends CollectionSlug>(\n options: ResetPasswordOptions<TSlug>,\n ): Promise<ResetPasswordResult> => {\n return resetPasswordLocal<TSlug>(this, options)\n }\n\n /**\n * @description Restore global version by ID\n * @param options\n * @returns version with specified ID\n */\n restoreGlobalVersion = async <TSlug extends GlobalSlug>(\n options: RestoreGlobalVersionOptions<TSlug>,\n ): Promise<DataFromGlobalSlug<TSlug>> => {\n return restoreGlobalVersionLocal<TSlug>(this, options)\n }\n\n /**\n * @description Restore version by ID\n * @param options\n * @returns version with specified ID\n */\n restoreVersion = async <TSlug extends CollectionSlug>(\n options: RestoreVersionOptions<TSlug>,\n ): Promise<DataFromCollectionSlug<TSlug>> => {\n return restoreVersionLocal<TSlug>(this, options)\n }\n\n schema!: GraphQLSchema\n\n secret!: string\n\n sendEmail!: InitializedEmailAdapter['sendEmail']\n\n types!: {\n arrayTypes: any\n blockInputTypes: any\n blockTypes: any\n fallbackLocaleInputType?: any\n groupTypes: any\n localeInputType?: any\n tabTypes: any\n }\n\n unlock = async <TSlug extends CollectionSlug>(\n options: UnlockOptions<TSlug>,\n ): Promise<boolean> => {\n return unlockLocal<TSlug>(this, options)\n }\n\n updateGlobal = async <TSlug extends GlobalSlug, TSelect extends SelectFromGlobalSlug<TSlug>>(\n options: UpdateGlobalOptions<TSlug, TSelect>,\n ): Promise<TransformGlobalWithSelect<TSlug, TSelect>> => {\n return updateGlobalLocal<TSlug, TSelect>(this, options)\n }\n\n validationRules!: (args: OperationArgs<any>) => ValidationRule[]\n\n verifyEmail = async <TSlug extends CollectionSlug>(\n options: VerifyEmailOptions<TSlug>,\n ): Promise<boolean> => {\n return verifyEmailLocal(this, options)\n }\n\n versions: {\n [slug: string]: any // TODO: Type this\n } = {}\n\n async _initializeCrons() {\n if (this.config.jobs.enabled && this.config.jobs.autoRun && !isNextBuild()) {\n const DEFAULT_CRON = '* * * * *'\n const DEFAULT_LIMIT = 10\n\n const cronJobs =\n typeof this.config.jobs.autoRun === 'function'\n ? await this.config.jobs.autoRun(this)\n : this.config.jobs.autoRun\n\n await Promise.all(\n cronJobs.map((cronConfig) => {\n const jobAutorunCron = new Cron(\n cronConfig.cron ?? DEFAULT_CRON,\n async () => {\n if (\n _internal_jobSystemGlobals.shouldAutoSchedule &&\n !cronConfig.disableScheduling &&\n this.config.jobs.scheduling\n ) {\n await this.jobs.handleSchedules({\n allQueues: cronConfig.allQueues,\n queue: cronConfig.queue,\n })\n }\n\n if (!_internal_jobSystemGlobals.shouldAutoRun) {\n return\n }\n\n if (typeof this.config.jobs.shouldAutoRun === 'function') {\n const shouldAutoRun = await this.config.jobs.shouldAutoRun(this)\n\n if (!shouldAutoRun) {\n jobAutorunCron.stop()\n return\n }\n }\n\n await this.jobs.run({\n allQueues: cronConfig.allQueues,\n limit: cronConfig.limit ?? DEFAULT_LIMIT,\n queue: cronConfig.queue,\n silent: cronConfig.silent,\n })\n },\n {\n catch: (err) => {\n this.logger.error({ err, msg: 'Error in job queue cron job handler' })\n },\n // Do not run consecutive crons if previous crons still ongoing\n protect: true,\n // TODO: Remove this compatibility option in 4.0. This only exists to ensure backwards-compatibility between Croner v9 and Croner v10 cron syntax\n sloppyRanges: true,\n },\n )\n\n this.crons.push(jobAutorunCron)\n }),\n )\n }\n }\n\n async bin({\n args,\n cwd,\n log,\n }: {\n args: string[]\n cwd?: string\n log?: boolean\n }): Promise<{ code: number }> {\n return new Promise((resolve, reject) => {\n const spawned = spawn('node', [path.resolve(dirname, '../bin.js'), ...args], {\n cwd,\n stdio: log || log === undefined ? 'inherit' : 'ignore',\n })\n\n spawned.on('exit', (code) => {\n resolve({ code: code! })\n })\n\n spawned.on('error', (error) => {\n reject(error)\n })\n })\n }\n\n /**\n * @description delete one or more documents\n * @param options\n * @returns Updated document(s)\n */\n delete<TSlug extends CollectionSlug, TSelect extends SelectFromCollectionSlug<TSlug>>(\n options: DeleteByIDOptions<TSlug, TSelect>,\n ): Promise<TransformCollectionWithSelect<TSlug, TSelect>>\n\n delete<TSlug extends CollectionSlug, TSelect extends SelectFromCollectionSlug<TSlug>>(\n options: DeleteManyOptions<TSlug, TSelect>,\n ): Promise<BulkOperationResult<TSlug, TSelect>>\n\n delete<TSlug extends CollectionSlug, TSelect extends SelectFromCollectionSlug<TSlug>>(\n options: DeleteOptions<TSlug, TSelect>,\n ): Promise<BulkOperationResult<TSlug, TSelect> | TransformCollectionWithSelect<TSlug, TSelect>> {\n return deleteLocal<TSlug, TSelect>(this, options)\n }\n\n /**\n * @description Initializes Payload\n * @param options\n */\n async init(options: InitOptions): Promise<Payload> {\n if (\n process.env.NODE_ENV !== 'production' &&\n process.env.PAYLOAD_DISABLE_DEPENDENCY_CHECKER !== 'true' &&\n !checkedDependencies\n ) {\n checkedDependencies = true\n void checkPayloadDependencies()\n }\n\n this.importMap = options.importMap!\n\n if (!options?.config) {\n throw new Error('Error: the payload config is required to initialize payload.')\n }\n\n this.config = await options.config\n this.logger = getLogger('payload', this.config.logger)\n\n if (!this.config.secret) {\n throw new Error('Error: missing secret key. A secret key is needed to secure Payload.')\n }\n\n this.secret = crypto.createHash('sha256').update(this.config.secret).digest('hex').slice(0, 32)\n\n this.globals = {\n config: this.config.globals,\n }\n\n for (const collection of this.config.collections) {\n let customIDType: string | undefined = undefined\n const findCustomID: TraverseFieldsCallback = ({ field }) => {\n if (\n ['array', 'blocks', 'group'].includes(field.type) ||\n (field.type === 'tab' && 'name' in field)\n ) {\n return true\n }\n\n if (!fieldAffectsData(field)) {\n return\n }\n\n if (field.name === 'id') {\n customIDType = field.type\n return true\n }\n }\n\n traverseFields({\n callback: findCustomID,\n config: this.config,\n fields: collection.fields,\n parentIsLocalized: false,\n })\n\n this.collections[collection.slug] = {\n config: collection,\n customIDType,\n }\n }\n\n this.blocks = this.config.blocks!.reduce(\n (blocks, block) => {\n blocks[block.slug] = block\n return blocks\n },\n {} as Record<string, FlattenedBlock>,\n )\n\n // Generate types on startup\n if (process.env.NODE_ENV !== 'production' && this.config.typescript.autoGenerate !== false) {\n // We cannot run it directly here, as generate-types imports json-schema-to-typescript, which breaks on turbopack.\n // see: https://github.com/vercel/next.js/issues/66723\n void this.bin({\n args: ['generate:types'],\n log: false,\n })\n }\n\n this.db = this.config.db.init({ payload: this })\n this.db.payload = this\n\n this.kv = this.config.kv.init({ payload: this })\n\n if (this.db?.init) {\n await this.db.init()\n }\n\n if (!options.disableDBConnect && this.db.connect) {\n await this.db.connect()\n }\n\n // Load email adapter\n if (this.config.email instanceof Promise) {\n const awaitedAdapter = await this.config.email\n this.email = awaitedAdapter({ payload: this })\n } else if (this.config.email) {\n this.email = this.config.email({ payload: this })\n } else {\n if (process.env.NEXT_PHASE !== 'phase-production-build') {\n this.logger.warn(\n `No email adapter provided. Email will be written to console. More info at https://payloadcms.com/docs/email/overview.`,\n )\n }\n\n this.email = consoleEmailAdapter({ payload: this })\n }\n\n // Warn if image resizing is enabled but sharp is not installed\n if (\n !this.config.sharp &&\n this.config.collections.some((c) => c.upload.imageSizes || c.upload.formatOptions)\n ) {\n this.logger.warn(\n `Image resizing is enabled for one or more collections, but sharp not installed. Please install 'sharp' and pass into the config.`,\n )\n }\n\n // Warn if user is deploying to Vercel, and any upload collection is missing a storage adapter\n if (process.env.VERCEL) {\n const uploadCollWithoutAdapter = this.config.collections.filter(\n (c) => c.upload && c.upload.adapter === undefined, // Uploads enabled, but no storage adapter provided\n )\n\n if (uploadCollWithoutAdapter.length) {\n const slugs = uploadCollWithoutAdapter.map((c) => c.slug).join(', ')\n this.logger.warn(\n `Collections with uploads enabled require a storage adapter when deploying to Vercel. Collection(s) without storage adapters: ${slugs}. See https://payloadcms.com/docs/upload/storage-adapters for more info.`,\n )\n }\n }\n\n this.sendEmail = this.email['sendEmail']\n\n serverInitTelemetry(this)\n\n // 1. loop over collections, if collection has auth strategy, initialize and push to array\n let jwtStrategyEnabled = false\n this.authStrategies = this.config.collections.reduce((authStrategies, collection) => {\n if (collection?.auth) {\n if (collection.auth.strategies.length > 0) {\n authStrategies.push(...collection.auth.strategies)\n }\n\n // 2. if api key enabled, push api key strategy into the array\n if (collection.auth?.useAPIKey) {\n authStrategies.push({\n name: `${collection.slug}-api-key`,\n authenticate: APIKeyAuthentication(collection),\n })\n }\n\n // 3. if localStrategy flag is true\n if (!collection.auth.disableLocalStrategy && !jwtStrategyEnabled) {\n jwtStrategyEnabled = true\n }\n }\n\n return authStrategies\n }, [] as AuthStrategy[])\n\n // 4. if enabled, push jwt strategy into authStrategies last\n if (jwtStrategyEnabled) {\n this.authStrategies.push({\n name: 'local-jwt',\n authenticate: JWTAuthentication,\n })\n }\n\n try {\n if (!options.disableOnInit) {\n if (typeof options.onInit === 'function') {\n await options.onInit(this)\n }\n if (typeof this.config.onInit === 'function') {\n await this.config.onInit(this)\n }\n }\n } catch (error) {\n this.logger.error({ err: error }, 'Error running onInit function')\n throw error\n }\n\n if (options.cron) {\n await this._initializeCrons()\n }\n\n return this\n }\n\n update<TSlug extends CollectionSlug, TSelect extends SelectFromCollectionSlug<TSlug>>(\n options: UpdateManyOptions<TSlug, TSelect>,\n ): Promise<BulkOperationResult<TSlug, TSelect>>\n\n /**\n * @description Update one or more documents\n * @param options\n * @returns Updated document(s)\n */\n update<TSlug extends CollectionSlug, TSelect extends SelectFromCollectionSlug<TSlug>>(\n options: UpdateByIDOptions<TSlug, TSelect>,\n ): Promise<TransformCollectionWithSelect<TSlug, TSelect>>\n\n update<TSlug extends CollectionSlug, TSelect extends SelectFromCollectionSlug<TSlug>>(\n options: UpdateOptions<TSlug, TSelect>,\n ): Promise<BulkOperationResult<TSlug, TSelect> | TransformCollectionWithSelect<TSlug, TSelect>> {\n return updateLocal<TSlug, TSelect>(this, options)\n }\n}\n\nconst initialized = new BasePayload()\n\n// eslint-disable-next-line no-restricted-exports\nexport default initialized\n\nexport const reload = async (\n config: SanitizedConfig,\n payload: Payload,\n skipImportMapGeneration?: boolean,\n options?: InitOptions,\n): Promise<void> => {\n if (typeof payload.db.destroy === 'function') {\n // Only destroy db, as we then later only call payload.db.init and not payload.init\n await payload.db.destroy()\n }\n payload.config = config\n\n payload.collections = config.collections.reduce(\n (collections, collection) => {\n collections[collection.slug] = {\n config: collection,\n customIDType: payload.collections[collection.slug]?.customIDType,\n }\n return collections\n },\n {} as Record<string, any>,\n )\n\n payload.blocks = config.blocks!.reduce(\n (blocks, block) => {\n blocks[block.slug] = block\n return blocks\n },\n {} as Record<string, FlattenedBlock>,\n )\n\n payload.globals = {\n config: config.globals,\n }\n\n // TODO: support HMR for other props in the future (see payload/src/index init()) that may change on Payload singleton\n\n // Generate types\n if (config.typescript.autoGenerate !== false) {\n // We cannot run it directly here, as generate-types imports json-schema-to-typescript, which breaks on turbopack.\n // see: https://github.com/vercel/next.js/issues/66723\n void payload.bin({\n args: ['generate:types'],\n log: false,\n })\n }\n\n // Generate import map\n if (skipImportMapGeneration !== true && config.admin?.importMap?.autoGenerate !== false) {\n // This may run outside of the admin panel, e.g. in the user's frontend, where we don't have an import map file.\n // We don't want to throw an error in this case, as it would break the user's frontend.\n // => just skip it => ignoreResolveError: true\n await generateImportMap(config, {\n ignoreResolveError: true,\n log: true,\n })\n }\n\n if (payload.db?.init) {\n await payload.db.init()\n }\n\n if (!options?.disableDBConnect && payload.db.connect) {\n await payload.db.connect({ hotReload: true })\n }\n\n ;(global as any)._payload_clientConfigs = {} as Record<keyof SupportedLanguages, ClientConfig>\n ;(global as any)._payload_schemaMap = null\n ;(global as any)._payload_clientSchemaMap = null\n ;(global as any)._payload_doNotCacheClientConfig = true // This will help refreshing the client config cache more reliably. If you remove this, please test HMR + client config refreshing (do new fields appear in the document?)\n ;(global as any)._payload_doNotCacheSchemaMap = true\n ;(global as any)._payload_doNotCacheClientSchemaMap = true\n}\n\nlet _cached: Map<\n string,\n {\n initializedCrons: boolean\n payload: null | Payload\n promise: null | Promise<Payload>\n reload: boolean | Promise<void>\n ws: null | WebSocket\n }\n> = (global as any)._payload\n\nif (!_cached) {\n _cached = (global as any)._payload = new Map()\n}\n\n/**\n * Get a payload instance.\n * This function is a wrapper around new BasePayload().init() that adds the following functionality on top of that:\n *\n * - smartly caches Payload instance on the module scope. That way, we prevent unnecessarily initializing Payload over and over again\n * when calling getPayload multiple times or from multiple locations.\n * - adds HMR support and reloads the payload instance when the config changes.\n */\nexport const getPayload = async (\n options: {\n /**\n * A unique key to identify the payload instance. You can pass your own key if you want to cache this payload instance separately.\n * This is useful if you pass a different payload config for each instance.\n *\n * @default 'default'\n */\n key?: string\n } & InitOptions,\n): Promise<Payload> => {\n if (!options?.config) {\n throw new Error('Error: the payload config is required for getPayload to work.')\n }\n\n let alreadyCachedSameConfig = false\n\n let cached = _cached.get(options.key ?? 'default')\n if (!cached) {\n cached = {\n initializedCrons: Boolean(options.cron),\n payload: null,\n promise: null,\n reload: false,\n ws: null,\n }\n _cached.set(options.key ?? 'default', cached)\n } else {\n alreadyCachedSameConfig = true\n }\n\n if (alreadyCachedSameConfig) {\n // alreadyCachedSameConfig => already called onInit once, but same config => no need to call onInit again.\n // calling onInit again would only make sense if a different config was passed.\n options.disableOnInit = true\n }\n\n if (cached.payload) {\n if (options.cron && !cached.initializedCrons) {\n // getPayload called with crons enabled, but existing cached version does not have crons initialized. => Initialize crons in existing cached version\n cached.initializedCrons = true\n await cached.payload._initializeCrons()\n }\n\n if (cached.reload === true) {\n let resolve!: () => void\n\n // getPayload is called multiple times, in parallel. However, we only want to run `await reload` once. By immediately setting cached.reload to a promise,\n // we can ensure that all subsequent calls will wait for the first reload to finish. So if we set it here, the 2nd call of getPayload\n // will reach `if (cached.reload instanceof Promise) {` which then waits for the first reload to finish.\n cached.reload = new Promise((res) => (resolve = res))\n const config = await options.config\n\n // Reload the payload instance after a config change (triggered by HMR in development).\n // The second parameter (false) forces import map regeneration rather than deciding based on options.importMap.\n //\n // Why we always regenerate import map: getPayload() may be called from multiple sources (admin panel, frontend, etc.)\n // that share the same cache but may pass different importMap values. Since call order is unpredictable,\n // we cannot rely on options.importMap to determine if regeneration is needed.\n //\n // Example scenario: If the frontend calls getPayload() without importMap first, followed by the admin\n // panel calling it with importMap, we'd incorrectly skip generation for the admin panel's needs.\n // By always regenerating on reload, we ensure the import map stays in sync with the updated config.\n await reload(config, cached.payload, false, options)\n\n resolve()\n cached.reload = false\n }\n\n if (cached.reload instanceof Promise) {\n await cached.reload\n }\n if (options?.importMap) {\n cached.payload.importMap = options.importMap\n }\n return cached.payload\n }\n\n try {\n if (!cached.promise) {\n // no need to await options.config here, as it's already awaited in the BasePayload.init\n cached.promise = new BasePayload().init(options)\n }\n\n cached.payload = await cached.promise\n\n if (\n !cached.ws &&\n process.env.NODE_ENV !== 'production' &&\n process.env.NODE_ENV !== 'test' &&\n process.env.DISABLE_PAYLOAD_HMR !== 'true'\n ) {\n try {\n const port = process.env.PORT || '3000'\n const hasHTTPS =\n process.env.USE_HTTPS === 'true' || process.argv.includes('--experimental-https')\n const protocol = hasHTTPS ? 'wss' : 'ws'\n\n const path = '/_next/webpack-hmr'\n // The __NEXT_ASSET_PREFIX env variable is set for both assetPrefix and basePath (tested in Next.js 15.1.6)\n const prefix = process.env.__NEXT_ASSET_PREFIX ?? ''\n\n cached.ws = new WebSocket(\n process.env.PAYLOAD_HMR_URL_OVERRIDE ?? `${protocol}://localhost:${port}${prefix}${path}`,\n )\n\n cached.ws.onmessage = (event) => {\n if (cached.reload instanceof Promise) {\n // If there is an in-progress reload in the same getPayload\n // cache instance, do not set reload to true again, which would\n // trigger another reload.\n // Instead, wait for the in-progress reload to finish.\n return\n }\n\n if (typeof event.data === 'string') {\n const data = JSON.parse(event.data)\n\n if (\n // On Next.js 15, we need to check for data.action. On Next.js 16, we need to check for data.type.\n data.type === 'serverComponentChanges' ||\n data.action === 'serverComponentChanges'\n ) {\n cached.reload = true\n }\n }\n }\n\n cached.ws.onerror = (_) => {\n // swallow any websocket connection error\n }\n } catch (_) {\n // swallow e\n }\n }\n } catch (e) {\n cached.promise = null\n // add identifier to error object, so that our error logger in routeError.ts does not attempt to re-initialize getPayload\n ;(e as { payloadInitError?: boolean }).payloadInitError = true\n throw e\n }\n\n if (options?.importMap) {\n cached.payload.importMap = options.importMap\n }\n\n return cached.payload\n}\n\ntype Payload = BasePayload\n\ninterface RequestContext {\n [key: string]: unknown\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface DatabaseAdapter extends BaseDatabaseAdapter {}\nexport type { Payload, RequestContext }\nexport { jwtSign } from './auth/jwt.js'\nexport { accessOperation } from './auth/operations/access.js'\nexport { forgotPasswordOperation } from './auth/operations/forgotPassword.js'\nexport { initOperation } from './auth/operations/init.js'\nexport type { LoginResult } from './auth/operations/login.js'\nexport { checkLoginPermission } from './auth/operations/login.js'\nexport { loginOperation } from './auth/operations/login.js'\nexport { logoutOperation } from './auth/operations/logout.js'\nexport type { MeOperationResult } from './auth/operations/me.js'\nexport { meOperation } from './auth/operations/me.js'\nexport { refreshOperation } from './auth/operations/refresh.js'\nexport { registerFirstUserOperation } from './auth/operations/registerFirstUser.js'\nexport { resetPasswordOperation } from './auth/operations/resetPassword.js'\nexport { unlockOperation } from './auth/operations/unlock.js'\nexport { verifyEmailOperation } from './auth/operations/verifyEmail.js'\nexport { JWTAuthentication } from './auth/strategies/jwt.js'\nexport { incrementLoginAttempts } from './auth/strategies/local/incrementLoginAttempts.js'\nexport { resetLoginAttempts } from './auth/strategies/local/resetLoginAttempts.js'\nexport type {\n AuthStrategyFunction,\n AuthStrategyFunctionArgs,\n AuthStrategyResult,\n CollectionPermission,\n DocumentPermissions,\n FieldPermissions,\n GlobalPermission,\n IncomingAuthType,\n Permission,\n Permissions,\n SanitizedCollectionPermission,\n SanitizedDocumentPermissions,\n SanitizedFieldPermissions,\n SanitizedGlobalPermission,\n SanitizedPermissions,\n UntypedUser as User,\n VerifyConfig,\n} from './auth/types.js'\nexport { generateImportMap } from './bin/generateImportMap/index.js'\n\nexport type { ImportMap } from './bin/generateImportMap/index.js'\nexport { genImportMapIterateFields } from './bin/generateImportMap/iterateFields.js'\nexport { migrate as migrateCLI } from './bin/migrate.js'\n\nexport {\n type ClientCollectionConfig,\n createClientCollectionConfig,\n createClientCollectionConfigs,\n type ServerOnlyCollectionAdminProperties,\n type ServerOnlyCollectionProperties,\n type ServerOnlyUploadProperties,\n} from './collections/config/client.js'\n\nexport type {\n AfterChangeHook as CollectionAfterChangeHook,\n AfterDeleteHook as CollectionAfterDeleteHook,\n AfterErrorHook as CollectionAfterErrorHook,\n AfterForgotPasswordHook as CollectionAfterForgotPasswordHook,\n AfterLoginHook as CollectionAfterLoginHook,\n AfterLogoutHook as CollectionAfterLogoutHook,\n AfterMeHook as CollectionAfterMeHook,\n AfterOperationHook as CollectionAfterOperationHook,\n AfterReadHook as CollectionAfterReadHook,\n AfterRefreshHook as CollectionAfterRefreshHook,\n AuthCollection,\n AuthOperationsFromCollectionSlug,\n BaseFilter,\n BaseListFilter,\n BeforeChangeHook as CollectionBeforeChangeHook,\n BeforeDeleteHook as CollectionBeforeDeleteHook,\n BeforeLoginHook as CollectionBeforeLoginHook,\n BeforeOperationHook as CollectionBeforeOperationHook,\n BeforeReadHook as CollectionBeforeReadHook,\n BeforeValidateHook as CollectionBeforeValidateHook,\n BulkOperationResult,\n Collection,\n CollectionAdminOptions,\n CollectionConfig,\n DataFromCollectionSlug,\n HookOperationType,\n MeHook as CollectionMeHook,\n RefreshHook as CollectionRefreshHook,\n RequiredDataFromCollection,\n RequiredDataFromCollectionSlug,\n SanitizedCollectionConfig,\n SanitizedJoins,\n TypeWithID,\n TypeWithTimestamps,\n} from './collections/config/types.js'\n\nexport type { CompoundIndex } from './collections/config/types.js'\nexport type { SanitizedCompoundIndex } from './collections/config/types.js'\n\nexport { createDataloaderCacheKey, getDataLoader } from './collections/dataloader.js'\nexport { countOperation } from './collections/operations/count.js'\nexport { createOperation } from './collections/operations/create.js'\nexport { deleteOperation } from './collections/operations/delete.js'\nexport { deleteByIDOperation } from './collections/operations/deleteByID.js'\nexport { docAccessOperation } from './collections/operations/docAccess.js'\nexport { duplicateOperation } from './collections/operations/duplicate.js'\nexport { findOperation } from './collections/operations/find.js'\nexport { findByIDOperation } from './collections/operations/findByID.js'\nexport { findVersionByIDOperation } from './collections/operations/findVersionByID.js'\nexport { findVersionsOperation } from './collections/operations/findVersions.js'\nexport { restoreVersionOperation } from './collections/operations/restoreVersion.js'\nexport { updateOperation } from './collections/operations/update.js'\nexport { updateByIDOperation } from './collections/operations/updateByID.js'\nexport { buildConfig } from './config/build.js'\nexport {\n type ClientConfig,\n createClientConfig,\n type CreateClientConfigArgs,\n createUnauthenticatedClientConfig,\n serverOnlyAdminConfigProperties,\n serverOnlyConfigProperties,\n type UnauthenticatedClientConfig,\n} from './config/client.js'\nexport { defaults } from './config/defaults.js'\nexport { definePlugin } from './config/definePlugin.js'\n\nexport { type OrderableEndpointBody } from './config/orderable/index.js'\nexport { sanitizeConfig } from './config/sanitize.js'\nexport type * from './config/types.js'\nexport { combineQueries } from './database/combineQueries.js'\nexport { createDatabaseAdapter } from './database/createDatabaseAdapter.js'\nexport { defaultBeginTransaction } from './database/defaultBeginTransaction.js'\nexport { flattenWhereToOperators } from './database/flattenWhereToOperators.js'\nexport { getLocalizedPaths } from './database/getLocalizedPaths.js'\nexport { createMigration } from './database/migrations/createMigration.js'\nexport { findMigrationDir } from './database/migrations/findMigrationDir.js'\nexport { getMigrations } from './database/migrations/getMigrations.js'\nexport { getPredefinedMigration } from './database/migrations/getPredefinedMigration.js'\nexport { migrate } from './database/migrations/migrate.js'\nexport { migrateDown } from './database/migrations/migrateDown.js'\nexport { migrateRefresh } from './database/migrations/migrateRefresh.js'\nexport { migrateReset } from './database/migrations/migrateReset.js'\nexport { migrateStatus } from './database/migrations/migrateStatus.js'\nexport { migrationsCollection } from './database/migrations/migrationsCollection.js'\nexport { migrationTemplate } from './database/migrations/migrationTemplate.js'\nexport { readMigrationFiles } from './database/migrations/readMigrationFiles.js'\nexport { writeMigrationIndex } from './database/migrations/writeMigrationIndex.js'\nexport type * from './database/queryValidation/types.js'\nexport type { EntityPolicies, PathToQuery } from './database/queryValidation/types.js'\nexport { validateQueryPaths } from './database/queryValidation/validateQueryPaths.js'\nexport { validateSearchParam } from './database/queryValidation/validateSearchParams.js'\nexport type {\n BaseDatabaseAdapter,\n BeginTransaction,\n CommitTransaction,\n Connect,\n Count,\n CountArgs,\n CountGlobalVersionArgs,\n CountGlobalVersions,\n CountVersions,\n Create,\n CreateArgs,\n CreateGlobal,\n CreateGlobalArgs,\n CreateGlobalVersion,\n CreateGlobalVersionArgs,\n CreateMigration,\n CreateVersion,\n CreateVersionArgs,\n DatabaseAdapterResult as DatabaseAdapterObj,\n DBIdentifierName,\n DeleteMany,\n DeleteManyArgs,\n DeleteOne,\n DeleteOneArgs,\n DeleteVersions,\n DeleteVersionsArgs,\n Destroy,\n Find,\n FindArgs,\n FindDistinct,\n FindGlobal,\n FindGlobalArgs,\n FindGlobalVersions,\n FindGlobalVersionsArgs,\n FindOne,\n FindOneArgs,\n FindVersions,\n FindVersionsArgs,\n GenerateSchema,\n Init,\n Migration,\n MigrationData,\n MigrationTemplateArgs,\n PaginatedDistinctDocs,\n PaginatedDocs,\n QueryDrafts,\n QueryDraftsArgs,\n RollbackTransaction,\n Transaction,\n UpdateGlobal,\n UpdateGlobalArgs,\n UpdateGlobalVersion,\n UpdateGlobalVersionArgs,\n UpdateJobs,\n UpdateJobsArgs,\n UpdateMany,\n UpdateManyArgs,\n UpdateOne,\n UpdateOneArgs,\n UpdateVersion,\n UpdateVersionArgs,\n Upsert,\n UpsertArgs,\n} from './database/types.js'\nexport type { DynamicMigrationTemplate } from './database/types.js'\nexport type { EmailAdapter as PayloadEmailAdapter, SendEmailOptions } from './email/types.js'\n\nexport {\n APIError,\n APIErrorName,\n AuthenticationError,\n DuplicateCollection,\n DuplicateFieldName,\n DuplicateGlobal,\n ErrorDeletingFile,\n FileRetrievalError,\n FileUploadError,\n Forbidden,\n InvalidConfiguration,\n InvalidFieldName,\n InvalidFieldRelationship,\n Locked,\n LockedAuth,\n MissingCollectionLabel,\n MissingEditorProp,\n MissingFieldInputOptions,\n MissingFieldType,\n MissingFile,\n NotFound,\n QueryError,\n UnauthorizedError,\n UnverifiedEmail,\n ValidationError,\n ValidationErrorName,\n} from './errors/index.js'\nexport type { ValidationFieldError } from './errors/index.js'\n\nexport { baseBlockFields } from './fields/baseFields/baseBlockFields.js'\n\nexport { baseIDField } from './fields/baseFields/baseIDField.js'\nexport { slugField, type SlugFieldClientProps } from './fields/baseFields/slug/index.js'\n\nexport { type SlugField } from './fields/baseFields/slug/index.js'\n\nexport {\n createClientBlocks,\n createClientField,\n createClientFields,\n type ServerOnlyFieldAdminProperties,\n type ServerOnlyFieldProperties,\n} from './fields/config/client.js'\n\nexport interface FieldCustom extends Record<string, any> {}\n\nexport interface CollectionCustom extends Record<string, any> {}\n\nexport interface CollectionAdminCustom extends Record<string, any> {}\n\nexport interface GlobalCustom extends Record<string, any> {}\n\nexport interface GlobalAdminCustom extends Record<string, any> {}\n\nexport { sanitizeField, sanitizeFields } from './fields/config/sanitize.js'\nexport type { SanitizeFieldArgs } from './fields/config/sanitize.js'\n\nexport type {\n AdminClient,\n ArrayField,\n ArrayFieldClient,\n BaseValidateOptions,\n Block,\n BlockJSX,\n BlocksField,\n BlocksFieldClient,\n CheckboxField,\n CheckboxFieldClient,\n ClientBlock,\n ClientField,\n ClientFieldProps,\n CodeField,\n CodeFieldClient,\n CollapsibleField,\n CollapsibleFieldClient,\n Condition,\n DateField,\n DateFieldClient,\n EmailField,\n EmailFieldClient,\n Field,\n FieldAccess,\n FieldAccessArgs,\n FieldAffectingData,\n FieldAffectingDataClient,\n FieldBase,\n FieldBaseClient,\n FieldHook,\n FieldHookArgs,\n FieldPosition,\n FieldPresentationalOnly,\n FieldPresentationalOnlyClient,\n FieldTypes,\n FieldWithMany,\n FieldWithManyClient,\n FieldWithMaxDepth,\n FieldWithMaxDepthClient,\n FieldWithPath,\n FieldWithPathClient,\n FieldWithSubFields,\n FieldWithSubFieldsClient,\n FilterOptions,\n FilterOptionsProps,\n FlattenedArrayField,\n FlattenedBlock,\n FlattenedBlocksField,\n FlattenedField,\n FlattenedGroupField,\n FlattenedJoinField,\n FlattenedTabAsField,\n GroupField,\n GroupFieldClient,\n HookName,\n JoinField,\n JoinFieldClient,\n JSONField,\n JSONFieldClient,\n Labels,\n LabelsClient,\n NamedGroupField,\n NamedGroupFieldClient,\n NamedTab,\n NonPresentationalField,\n NonPresentationalFieldClient,\n NumberField,\n NumberFieldClient,\n Option,\n OptionLabel,\n OptionObject,\n PointField,\n PointFieldClient,\n PolymorphicRelationshipField,\n PolymorphicRelationshipFieldClient,\n RadioField,\n RadioFieldClient,\n RelationshipField,\n RelationshipFieldClient,\n RelationshipValue,\n RichTextField,\n RichTextFieldClient,\n RowField,\n RowFieldClient,\n SelectField,\n SelectFieldClient,\n SingleRelationshipField,\n SingleRelationshipFieldClient,\n Tab,\n TabAsField,\n TabAsFieldClient,\n TabsField,\n TabsFieldClient,\n TextareaField,\n TextareaFieldClient,\n TextField,\n TextFieldClient,\n UIField,\n UIFieldClient,\n UnnamedGroupField,\n UnnamedGroupFieldClient,\n UnnamedTab,\n UploadField,\n UploadFieldClient,\n Validate,\n ValidateOptions,\n ValueWithRelation,\n} from './fields/config/types.js'\n\nexport { getDefaultValue } from './fields/getDefaultValue.js'\nexport { traverseFields as afterChangeTraverseFields } from './fields/hooks/afterChange/traverseFields.js'\n\nexport { promise as afterReadPromise } from './fields/hooks/afterRead/promise.js'\nexport { traverseFields as afterReadTraverseFields } from './fields/hooks/afterRead/traverseFields.js'\nexport { traverseFields as beforeChangeTraverseFields } from './fields/hooks/beforeChange/traverseFields.js'\nexport { traverseFields as beforeValidateTraverseFields } from './fields/hooks/beforeValidate/traverseFields.js'\n\nexport { sortableFieldTypes } from './fields/sortableFieldTypes.js'\nexport { validateBlocksFilterOptions, validations } from './fields/validations.js'\n\nexport type {\n ArrayFieldValidation,\n BlocksFieldValidation,\n CheckboxFieldValidation,\n CodeFieldValidation,\n ConfirmPasswordFieldValidation,\n DateFieldValidation,\n EmailFieldValidation,\n JSONFieldValidation,\n NumberFieldManyValidation,\n NumberFieldSingleValidation,\n NumberFieldValidation,\n PasswordFieldValidation,\n PointFieldValidation,\n RadioFieldValidation,\n RelationshipFieldManyValidation,\n RelationshipFieldSingleValidation,\n RelationshipFieldValidation,\n RichTextFieldValidation,\n SelectFieldManyValidation,\n SelectFieldSingleValidation,\n SelectFieldValidation,\n TextareaFieldValidation,\n TextFieldManyValidation,\n TextFieldSingleValidation,\n TextFieldValidation,\n UploadFieldManyValidation,\n UploadFieldSingleValidation,\n UploadFieldValidation,\n UsernameFieldValidation,\n} from './fields/validations.js'\nexport type { FolderSortKeys } from './folders/types.js'\nexport { getFolderData } from './folders/utils/getFolderData.js'\nexport {\n type ClientGlobalConfig,\n createClientGlobalConfig,\n createClientGlobalConfigs,\n type ServerOnlyGlobalAdminProperties,\n type ServerOnlyGlobalProperties,\n} from './globals/config/client.js'\nexport type {\n AfterChangeHook as GlobalAfterChangeHook,\n AfterReadHook as GlobalAfterReadHook,\n BeforeChangeHook as GlobalBeforeChangeHook,\n BeforeOperationHook as GlobalBeforeOperationHook,\n BeforeReadHook as GlobalBeforeReadHook,\n BeforeValidateHook as GlobalBeforeValidateHook,\n DataFromGlobalSlug,\n GlobalAdminOptions,\n GlobalConfig,\n SanitizedGlobalConfig,\n} from './globals/config/types.js'\nexport { docAccessOperation as docAccessOperationGlobal } from './globals/operations/docAccess.js'\nexport { findOneOperation } from './globals/operations/findOne.js'\n\nexport { findVersionByIDOperation as findVersionByIDOperationGlobal } from './globals/operations/findVersionByID.js'\n\nexport { findVersionsOperation as findVersionsOperationGlobal } from './globals/operations/findVersions.js'\nexport { restoreVersionOperation as restoreVersionOperationGlobal } from './globals/operations/restoreVersion.js'\nexport { updateOperation as updateOperationGlobal } from './globals/operations/update.js'\nexport * from './kv/adapters/DatabaseKVAdapter.js'\nexport * from './kv/adapters/InMemoryKVAdapter.js'\nexport * from './kv/index.js'\nexport type {\n CollapsedPreferences,\n CollectionPreferences,\n /**\n * @deprecated Use `CollectionPreferences` instead.\n */\n CollectionPreferences as ListPreferences,\n ColumnPreference,\n DocumentPreferences,\n FieldsPreferences,\n InsideFieldsPreferences,\n PreferenceRequest,\n PreferenceUpdateRequest,\n TabsPreferences,\n} from './preferences/types.js'\nexport type { QueryPreset } from './query-presets/types.js'\nexport { jobAfterRead } from './queues/config/collection.js'\nexport type { JobsConfig, RunJobAccess, RunJobAccessArgs } from './queues/config/types/index.js'\nexport type {\n RunInlineTaskFunction,\n RunTaskFunction,\n RunTaskFunctions,\n TaskConfig,\n TaskHandler,\n TaskHandlerArgs,\n TaskHandlerResult,\n TaskHandlerResults,\n TaskInput,\n TaskOutput,\n TaskType,\n} from './queues/config/types/taskTypes.js'\nexport type {\n BaseJob,\n ConcurrencyConfig,\n JobLog,\n JobTaskStatus,\n RunningJob,\n SingleTaskStatus,\n WorkflowConfig,\n WorkflowHandler,\n WorkflowTypes,\n} from './queues/config/types/workflowTypes.js'\n\nexport { JobCancelledError } from './queues/errors/index.js'\nexport { countRunnableOrActiveJobsForQueue } from './queues/operations/handleSchedules/countRunnableOrActiveJobsForQueue.js'\nexport { importHandlerPath } from './queues/operations/runJobs/runJob/importHandlerPath.js'\n\nexport {\n _internal_jobSystemGlobals,\n _internal_resetJobSystemGlobals,\n getCurrentDate,\n} from './queues/utilities/getCurrentDate.js'\nexport { getLocalI18n } from './translations/getLocalI18n.js'\nexport * from './types/index.js'\nexport { getFileByPath } from './uploads/getFileByPath.js'\nexport { _internal_safeFetchGlobal } from './uploads/safeFetch.js'\n\nexport type * from './uploads/types.js'\nexport { addDataAndFileToRequest } from './utilities/addDataAndFileToRequest.js'\nexport { addLocalesToRequestFromData, sanitizeLocales } from './utilities/addLocalesToRequest.js'\nexport { canAccessAdmin } from './utilities/canAccessAdmin.js'\nexport { commitTransaction } from './utilities/commitTransaction.js'\nexport {\n configToJSONSchema,\n entityToJSONSchema,\n fieldsToJSONSchema,\n withNullableJSONSchemaType,\n} from './utilities/configToJSONSchema.js'\nexport { createArrayFromCommaDelineated } from './utilities/createArrayFromCommaDelineated.js'\nexport { createLocalReq } from './utilities/createLocalReq.js'\nexport { createPayloadRequest } from './utilities/createPayloadRequest.js'\nexport {\n deepCopyObject,\n deepCopyObjectComplex,\n deepCopyObjectSimple,\n} from './utilities/deepCopyObject.js'\nexport {\n deepMerge,\n deepMergeWithCombinedArrays,\n deepMergeWithReactComponents,\n deepMergeWithSourceArrays,\n} from './utilities/deepMerge.js'\nexport {\n checkDependencies,\n type CustomVersionParser,\n} from './utilities/dependencies/dependencyChecker.js'\nexport { getDependencies } from './utilities/dependencies/getDependencies.js'\nexport { dynamicImport } from './utilities/dynamicImport.js'\nexport { escapeRegExp } from './utilities/escapeRegExp.js'\nexport {\n findUp,\n findUpSync,\n pathExistsAndIsAccessible,\n pathExistsAndIsAccessibleSync,\n} from './utilities/findUp.js'\nexport { flattenAllFields } from './utilities/flattenAllFields.js'\nexport { flattenTopLevelFields } from './utilities/flattenTopLevelFields.js'\nexport { formatErrors } from './utilities/formatErrors.js'\nexport { formatLabels, formatNames, toWords } from './utilities/formatLabels.js'\nexport { getBlockSelect } from './utilities/getBlockSelect.js'\nexport { getCollectionIDFieldTypes } from './utilities/getCollectionIDFieldTypes.js'\nexport { getFieldByPath } from './utilities/getFieldByPath.js'\nexport { getObjectDotNotation } from './utilities/getObjectDotNotation.js'\nexport { getRequestLanguage } from './utilities/getRequestLanguage.js'\nexport { handleEndpoints } from './utilities/handleEndpoints.js'\nexport { headersWithCors } from './utilities/headersWithCors.js'\nexport { initTransaction } from './utilities/initTransaction.js'\nexport { isEntityHidden } from './utilities/isEntityHidden.js'\nexport { isolateObjectProperty } from './utilities/isolateObjectProperty.js'\nexport { isPlainObject } from './utilities/isPlainObject.js'\nexport { isValidID } from './utilities/isValidID.js'\nexport { killTransaction } from './utilities/killTransaction.js'\nexport { logError } from './utilities/logError.js'\nexport { defaultLoggerOptions } from './utilities/logger.js'\nexport type { PayloadLogger } from './utilities/logger.js'\nexport { mapAsync } from './utilities/mapAsync.js'\nexport { mergeHeaders } from './utilities/mergeHeaders.js'\nexport { parseDocumentID } from './utilities/parseDocumentID.js'\nexport { sanitizeFallbackLocale } from './utilities/sanitizeFallbackLocale.js'\nexport { sanitizeJoinParams } from './utilities/sanitizeJoinParams.js'\nexport { sanitizePopulateParam } from './utilities/sanitizePopulateParam.js'\nexport { sanitizeSelectParam } from './utilities/sanitizeSelectParam.js'\nexport { stripUnselectedFields } from './utilities/stripUnselectedFields.js'\nexport { traverseFields } from './utilities/traverseFields.js'\nexport type { TraverseFieldsCallback } from './utilities/traverseFields.js'\nexport { buildVersionCollectionFields } from './versions/buildCollectionFields.js'\nexport { buildVersionGlobalFields } from './versions/buildGlobalFields.js'\nexport { buildVersionCompoundIndexes } from './versions/buildVersionCompoundIndexes.js'\nexport { versionDefaults } from './versions/defaults.js'\nexport { deleteCollectionVersions } from './versions/deleteCollectionVersions.js'\n\nexport { appendVersionToQueryKey } from './versions/drafts/appendVersionToQueryKey.js'\nexport { getQueryDraftsSort } from './versions/drafts/getQueryDraftsSort.js'\nexport { enforceMaxVersions } from './versions/enforceMaxVersions.js'\nexport { getLatestCollectionVersion } from './versions/getLatestCollectionVersion.js'\nexport { getLatestGlobalVersion } from './versions/getLatestGlobalVersion.js'\nexport { localizeStatus } from './versions/migrations/localizeStatus/index.js'\nexport type {\n MongoLocalizeStatusArgs,\n SqlLocalizeStatusArgs,\n} from './versions/migrations/localizeStatus/index.js'\nexport { saveVersion } from './versions/saveVersion.js'\nexport type { SchedulePublishTaskInput } from './versions/schedule/types.js'\n\nexport type { SchedulePublish, TypeWithVersion } from './versions/types.js'\nexport { deepMergeSimple } from '@payloadcms/translations/utilities'\n"],"names":["spawn","crypto","fileURLToPath","path","WebSocket","forgotPasswordLocal","loginLocal","resetPasswordLocal","unlockLocal","verifyEmailLocal","countLocal","createLocal","deleteLocal","duplicateLocal","findLocal","findByIDLocal","findDistinct","findDistinctLocal","findVersionByIDLocal","findVersionsLocal","restoreVersionLocal","updateLocal","countGlobalVersionsLocal","findOneGlobalLocal","findGlobalVersionByIDLocal","findGlobalVersionsLocal","restoreGlobalVersionLocal","updateGlobalLocal","EntityType","Cron","decrypt","encrypt","authLocal","APIKeyAuthentication","JWTAuthentication","generateImportMap","checkPayloadDependencies","countVersionsLocal","consoleEmailAdapter","fieldAffectsData","getJobsLocalAPI","_internal_jobSystemGlobals","formatAdminURL","isNextBuild","getLogger","serverInit","serverInitTelemetry","traverseFields","accountLockFields","baseAccountLockFields","apiKeyFields","baseAPIKeyFields","baseAuthFields","emailFieldConfig","baseEmailField","sessionsFieldConfig","baseSessionsField","usernameFieldConfig","baseUsernameField","verificationFields","baseVerificationFields","executeAccess","executeAuthStrategies","extractAccessFromPermission","getAccessResults","getFieldsToSign","getLoginOptions","filename","url","dirname","checkedDependencies","BasePayload","auth","options","authStrategies","blocks","collections","config","count","countGlobalVersions","countVersions","create","crons","db","destroy","length","cronsToStop","splice","Promise","all","map","cron","stop","duplicate","email","extensions","find","findByID","findGlobal","findGlobalVersionByID","findGlobalVersions","findVersionByID","findVersions","forgotPassword","getAdminURL","adminRoute","routes","admin","serverURL","getAPIURL","apiRoute","api","globals","importMap","jobs","kv","logger","login","resetPassword","restoreGlobalVersion","restoreVersion","schema","secret","sendEmail","types","unlock","updateGlobal","validationRules","verifyEmail","versions","_initializeCrons","enabled","autoRun","DEFAULT_CRON","DEFAULT_LIMIT","cronJobs","cronConfig","jobAutorunCron","shouldAutoSchedule","disableScheduling","scheduling","handleSchedules","allQueues","queue","shouldAutoRun","run","limit","silent","catch","err","error","msg","protect","sloppyRanges","push","bin","args","cwd","log","resolve","reject","spawned","stdio","undefined","on","code","delete","init","process","env","NODE_ENV","PAYLOAD_DISABLE_DEPENDENCY_CHECKER","Error","createHash","update","digest","slice","collection","customIDType","findCustomID","field","includes","type","name","callback","fields","parentIsLocalized","slug","reduce","block","typescript","autoGenerate","payload","disableDBConnect","connect","awaitedAdapter","NEXT_PHASE","warn","sharp","some","c","upload","imageSizes","formatOptions","VERCEL","uploadCollWithoutAdapter","filter","adapter","slugs","join","jwtStrategyEnabled","strategies","useAPIKey","authenticate","disableLocalStrategy","disableOnInit","onInit","initialized","reload","skipImportMapGeneration","ignoreResolveError","hotReload","global","_payload_clientConfigs","_payload_schemaMap","_payload_clientSchemaMap","_payload_doNotCacheClientConfig","_payload_doNotCacheSchemaMap","_payload_doNotCacheClientSchemaMap","_cached","_payload","Map","getPayload","alreadyCachedSameConfig","cached","get","key","initializedCrons","Boolean","promise","ws","set","res","DISABLE_PAYLOAD_HMR","port","PORT","hasHTTPS","USE_HTTPS","argv","protocol","prefix","__NEXT_ASSET_PREFIX","PAYLOAD_HMR_URL_OVERRIDE","onmessage","event","data","JSON","parse","action","onerror","_","e","payloadInitError","jwtSign","accessOperation","forgotPasswordOperation","initOperation","checkLoginPermission","loginOperation","logoutOperation","meOperation","refreshOperation","registerFirstUserOperation","resetPasswordOperation","unlockOperation","verifyEmailOperation","incrementLoginAttempts","resetLoginAttempts","genImportMapIterateFields","migrate","migrateCLI","createClientCollectionConfig","createClientCollectionConfigs","createDataloaderCacheKey","getDataLoader","countOperation","createOperation","deleteOperation","deleteByIDOperation","docAccessOperation","duplicateOperation","findOperation","findByIDOperation","findVersionByIDOperation","findVersionsOperation","restoreVersionOperation","updateOperation","updateByIDOperation","buildConfig","createClientConfig","createUnauthenticatedClientConfig","serverOnlyAdminConfigProperties","serverOnlyConfigProperties","defaults","definePlugin","sanitizeConfig","combineQueries","createDatabaseAdapter","defaultBeginTransaction","flattenWhereToOperators","getLocalizedPaths","createMigration","findMigrationDir","getMigrations","getPredefinedMigration","migrateDown","migrateRefresh","migrateReset","migrateStatus","migrationsCollection","migrationTemplate","readMigrationFiles","writeMigrationIndex","validateQueryPaths","validateSearchParam","APIError","APIErrorName","AuthenticationError","DuplicateCollection","DuplicateFieldName","DuplicateGlobal","ErrorDeletingFile","FileRetrievalError","FileUploadError","Forbidden","InvalidConfiguration","InvalidFieldName","InvalidFieldRelationship","Locked","LockedAuth","MissingCollectionLabel","MissingEditorProp","MissingFieldInputOptions","MissingFieldType","MissingFile","NotFound","QueryError","UnauthorizedError","UnverifiedEmail","ValidationError","ValidationErrorName","baseBlockFields","baseIDField","slugField","createClientBlocks","createClientField","createClientFields","sanitizeField","sanitizeFields","getDefaultValue","afterChangeTraverseFields","afterReadPromise","afterReadTraverseFields","beforeChangeTraverseFields","beforeValidateTraverseFields","sortableFieldTypes","validateBlocksFilterOptions","validations","getFolderData","createClientGlobalConfig","createClientGlobalConfigs","docAccessOperationGlobal","findOneOperation","findVersionByIDOperationGlobal","findVersionsOperationGlobal","restoreVersionOperationGlobal","updateOperationGlobal","jobAfterRead","JobCancelledError","countRunnableOrActiveJobsForQueue","importHandlerPath","_internal_resetJobSystemGlobals","getCurrentDate","getLocalI18n","getFileByPath","_internal_safeFetchGlobal","addDataAndFileToRequest","addLocalesToRequestFromData","sanitizeLocales","canAccessAdmin","commitTransaction","configToJSONSchema","entityToJSONSchema","fieldsToJSONSchema","withNullableJSONSchemaType","createArrayFromCommaDelineated","createLocalReq","createPayloadRequest","deepCopyObject","deepCopyObjectComplex","deepCopyObjectSimple","deepMerge","deepMergeWithCombinedArrays","deepMergeWithReactComponents","deepMergeWithSourceArrays","checkDependencies","getDependencies","dynamicImport","escapeRegExp","findUp","findUpSync","pathExistsAndIsAccessible","pathExistsAndIsAccessibleSync","flattenAllFields","flattenTopLevelFields","formatErrors","formatLabels","formatNames","toWords","getBlockSelect","getCollectionIDFieldTypes","getFieldByPath","getObjectDotNotation","getRequestLanguage","handleEndpoints","headersWithCors","initTransaction","isEntityHidden","isolateObjectProperty","isPlainObject","isValidID","killTransaction","logError","defaultLoggerOptions","mapAsync","mergeHeaders","parseDocumentID","sanitizeFallbackLocale","sanitizeJoinParams","sanitizePopulateParam","sanitizeSelectParam","stripUnselectedFields","buildVersionCollectionFields","buildVersionGlobalFields","buildVersionCompoundIndexes","versionDefaults","deleteCollectionVersions","appendVersionToQueryKey","getQueryDraftsSort","enforceMaxVersions","getLatestCollectionVersion","getLatestGlobalVersion","localizeStatus","saveVersion","deepMergeSimple"],"mappings":"AAAA,qDAAqD,GAMrD,SAASA,KAAK,QAAQ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,QAAQ,wBAAuB;AAE5D,SAASC,QAAQ,QAAQ,0BAAyB;AAClD,SAASC,YAAY,QAAQ,8BAA6B;AAC1D,SAASC,eAAe,QAAQ,iCAAgC;AAChE,SAASC,sBAAsB,QAAQ,wCAAuC;AAC9E,SAASC,kBAAkB,QAAQ,oCAAmC;AACtE,SAASC,qBAAqB,QAAQ,uCAAsC;AAC5E,SAASC,mBAAmB,QAAQ,qCAAoC;AACxE,SAASC,qBAAqB,QAAQ,uCAAsC;AAC5E,SAAS1Y,cAAc,QAAQ,gCAA+B;AAE9D,SAAS2Y,4BAA4B,QAAQ,sCAAqC;AAClF,SAASC,wBAAwB,QAAQ,kCAAiC;AAC1E,SAASC,2BAA2B,QAAQ,4CAA2C;AACvF,SAASC,eAAe,QAAQ,yBAAwB;AACxD,SAASC,wBAAwB,QAAQ,yCAAwC;AAEjF,SAASC,uBAAuB,QAAQ,+CAA8C;AACtF,SAASC,kBAAkB,QAAQ,0CAAyC;AAC5E,SAASC,kBAAkB,QAAQ,mCAAkC;AACrE,SAASC,0BAA0B,QAAQ,2CAA0C;AACrF,SAASC,sBAAsB,QAAQ,uCAAsC;AAC7E,SAASC,cAAc,QAAQ,gDAA+C;AAK9E,SAASC,WAAW,QAAQ,4BAA2B;AAIvD,SAASC,eAAe,QAAQ,qCAAoC"}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { ExecutionResult, GraphQLSchema, ValidationRule } from 'graphql'\nimport type { Request as graphQLRequest, OperationArgs } from 'graphql-http'\nimport type { Logger } from 'pino'\nimport type { NonNever } from 'ts-essentials'\n\nimport { spawn } from 'child_process'\nimport crypto from 'crypto'\nimport { fileURLToPath } from 'node:url'\nimport path from 'path'\nimport WebSocket from 'ws'\n\nimport type { AuthArgs } from './auth/operations/auth.js'\nimport type { Result as ForgotPasswordResult } from './auth/operations/forgotPassword.js'\nimport type { LoginResult } from './auth/operations/login.js'\nimport type { Result as ResetPasswordResult } from './auth/operations/resetPassword.js'\nimport type { AuthStrategy, UntypedUser } from './auth/types.js'\nimport type {\n BulkOperationResult,\n Collection,\n DataFromCollectionSlug,\n SelectFromCollectionSlug,\n TypeWithID,\n} from './collections/config/types.js'\n\nimport {\n forgotPasswordLocal,\n type Options as ForgotPasswordOptions,\n} from './auth/operations/local/forgotPassword.js'\nimport { loginLocal, type Options as LoginOptions } from './auth/operations/local/login.js'\nimport {\n resetPasswordLocal,\n type Options as ResetPasswordOptions,\n} from './auth/operations/local/resetPassword.js'\nimport { unlockLocal, type Options as UnlockOptions } from './auth/operations/local/unlock.js'\nimport {\n verifyEmailLocal,\n type Options as VerifyEmailOptions,\n} from './auth/operations/local/verifyEmail.js'\nexport type { FieldState } from './admin/forms/Form.js'\nimport type { InitOptions, SanitizedConfig } from './config/types.js'\nimport type { BaseDatabaseAdapter, PaginatedDistinctDocs, PaginatedDocs } from './database/types.js'\nimport type { InitializedEmailAdapter } from './email/types.js'\nimport type { DataFromGlobalSlug, Globals, SelectFromGlobalSlug } from './globals/config/types.js'\nimport type {\n ApplyDisableErrors,\n DraftTransformCollectionWithSelect,\n JsonObject,\n SelectType,\n TransformCollectionWithSelect,\n TransformGlobalWithSelect,\n} from './types/index.js'\nimport type { TraverseFieldsCallback } from './utilities/traverseFields.js'\n\nimport { countLocal, type CountOptions } from './collections/operations/local/count.js'\nimport {\n createLocal,\n type Options as CreateOptions,\n} from './collections/operations/local/create.js'\nimport {\n type ByIDOptions as DeleteByIDOptions,\n deleteLocal,\n type ManyOptions as DeleteManyOptions,\n type Options as DeleteOptions,\n} from './collections/operations/local/delete.js'\nimport {\n duplicateLocal,\n type Options as DuplicateOptions,\n} from './collections/operations/local/duplicate.js'\nimport { findLocal, type FindOptions } from './collections/operations/local/find.js'\nexport type { FindOptions }\nimport {\n findByIDLocal,\n type Options as FindByIDOptions,\n} from './collections/operations/local/findByID.js'\nimport {\n findDistinct as findDistinctLocal,\n type Options as FindDistinctOptions,\n} from './collections/operations/local/findDistinct.js'\nimport {\n findVersionByIDLocal,\n type Options as FindVersionByIDOptions,\n} from './collections/operations/local/findVersionByID.js'\nimport {\n findVersionsLocal,\n type Options as FindVersionsOptions,\n} from './collections/operations/local/findVersions.js'\nimport {\n restoreVersionLocal,\n type Options as RestoreVersionOptions,\n} from './collections/operations/local/restoreVersion.js'\nimport {\n type ByIDOptions as UpdateByIDOptions,\n updateLocal,\n type ManyOptions as UpdateManyOptions,\n type Options as UpdateOptions,\n} from './collections/operations/local/update.js'\nimport {\n countGlobalVersionsLocal,\n type CountGlobalVersionsOptions,\n} from './globals/operations/local/countVersions.js'\nimport {\n type Options as FindGlobalOptions,\n findOneGlobalLocal,\n} from './globals/operations/local/findOne.js'\nimport {\n findGlobalVersionByIDLocal,\n type Options as FindGlobalVersionByIDOptions,\n} from './globals/operations/local/findVersionByID.js'\nimport {\n findGlobalVersionsLocal,\n type Options as FindGlobalVersionsOptions,\n} from './globals/operations/local/findVersions.js'\nimport {\n restoreGlobalVersionLocal,\n type Options as RestoreGlobalVersionOptions,\n} from './globals/operations/local/restoreVersion.js'\nimport {\n updateGlobalLocal,\n type Options as UpdateGlobalOptions,\n} from './globals/operations/local/update.js'\nexport type * from './admin/types.js'\nexport { EntityType } from './admin/views/dashboard.js'\nimport type { SupportedLanguages } from '@payloadcms/translations'\n\nimport { Cron } from 'croner'\n\nimport type { ClientConfig } from './config/client.js'\nimport type { KVAdapter } from './kv/index.js'\nimport type { BaseJob } from './queues/config/types/workflowTypes.js'\nimport type { TypeWithVersion } from './versions/types.js'\n\nimport { decrypt, encrypt } from './auth/crypto.js'\nimport { authLocal } from './auth/operations/local/auth.js'\nimport { APIKeyAuthentication } from './auth/strategies/apiKey.js'\nimport { JWTAuthentication } from './auth/strategies/jwt.js'\nimport { generateImportMap, type ImportMap } from './bin/generateImportMap/index.js'\nimport { checkPayloadDependencies } from './checkPayloadDependencies.js'\nimport {\n countVersionsLocal,\n type CountVersionsOptions,\n} from './collections/operations/local/countVersions.js'\nimport { consoleEmailAdapter } from './email/consoleEmailAdapter.js'\nimport { normalizeSendEmailOptions } from './email/normalizeSendEmailOptions.js'\nimport { fieldAffectsData, type FlattenedBlock } from './fields/config/types.js'\nimport { getJobsLocalAPI } from './queues/localAPI.js'\nimport { _internal_jobSystemGlobals } from './queues/utilities/getCurrentDate.js'\nimport { formatAdminURL } from './utilities/formatAdminURL.js'\nimport { isNextBuild } from './utilities/isNextBuild.js'\nimport { getLogger } from './utilities/logger.js'\nimport { serverInit as serverInitTelemetry } from './utilities/telemetry/events/serverInit.js'\nimport { traverseFields } from './utilities/traverseFields.js'\n\n/**\n * Export of all base fields that could potentially be\n * useful as users wish to extend built-in fields with custom logic\n */\nexport { accountLockFields as baseAccountLockFields } from './auth/baseFields/accountLock.js'\nexport { apiKeyFields as baseAPIKeyFields } from './auth/baseFields/apiKey.js'\nexport { baseAuthFields } from './auth/baseFields/auth.js'\nexport { emailFieldConfig as baseEmailField } from './auth/baseFields/email.js'\nexport { sessionsFieldConfig as baseSessionsField } from './auth/baseFields/sessions.js'\nexport { usernameFieldConfig as baseUsernameField } from './auth/baseFields/username.js'\n\nexport { verificationFields as baseVerificationFields } from './auth/baseFields/verification.js'\nexport { executeAccess } from './auth/executeAccess.js'\nexport { executeAuthStrategies } from './auth/executeAuthStrategies.js'\nexport { extractAccessFromPermission } from './auth/extractAccessFromPermission.js'\nexport { getAccessResults } from './auth/getAccessResults.js'\nexport { getFieldsToSign } from './auth/getFieldsToSign.js'\nexport { getLoginOptions } from './auth/getLoginOptions.js'\nexport * from './auth/index.js'\n\n/**\n * Shape constraint for PayloadTypes.\n * Matches the structure of generated Config types.\n *\n * By defining the actual shape, we can use simple property access (T['collections'])\n * instead of conditional types throughout the codebase.\n */\nexport interface PayloadTypesShape {\n auth: Record<string, unknown>\n blocks: Record<string, unknown>\n collections: Record<string, unknown>\n collectionsJoins: Record<string, unknown>\n collectionsSelect: Record<string, unknown>\n db: { defaultIDType: unknown }\n fallbackLocale: unknown\n globals: Record<string, unknown>\n globalsSelect: Record<string, unknown>\n jobs: unknown\n locale: unknown\n user: unknown\n widgets?: Record<string, unknown>\n}\n\n/**\n * Untyped fallback types. Uses the SAME property names as generated types.\n * PayloadTypes merges GeneratedTypes with these fallbacks.\n */\nexport interface UntypedPayloadTypes {\n auth: {\n [slug: string]: {\n forgotPassword: {\n email: string\n }\n login: {\n email: string\n password: string\n }\n registerFirstUser: {\n email: string\n password: string\n }\n unlock: {\n email: string\n }\n }\n }\n blocks: {\n [slug: string]: JsonObject\n }\n collections: {\n [slug: string]: JsonObject & TypeWithID\n }\n collectionsJoins: {\n [slug: string]: {\n [schemaPath: string]: string\n }\n }\n collectionsSelect: {\n [slug: string]: SelectType\n }\n db: {\n defaultIDType: number | string\n }\n fallbackLocale: 'false' | 'none' | 'null' | ({} & string)[] | ({} & string) | false | null\n globals: {\n [slug: string]: JsonObject\n }\n globalsSelect: {\n [slug: string]: SelectType\n }\n jobs: {\n tasks: {\n [slug: string]: {\n input?: JsonObject\n output?: JsonObject\n }\n }\n workflows: {\n [slug: string]: {\n input: JsonObject\n }\n }\n }\n locale: null | string\n user: UntypedUser\n widgets: {\n [slug: string]: JsonObject\n }\n}\n\n/**\n * Interface to be module-augmented by the `payload-types.ts` file.\n * When augmented, its properties take precedence over UntypedPayloadTypes.\n */\nexport interface GeneratedTypes {}\n\n/**\n * Interface to be module-augmented by plugin packages.\n * Maps plugin slug to plugin options type, enabling typed cross-plugin\n * discovery via the `plugins` map passed to `definePlugin` functions.\n *\n * @experimental\n *\n * @example\n * // In a plugin package's index.ts:\n * declare module 'payload' {\n * interface RegisteredPlugins {\n * 'plugin-seo': SEOPluginOptions\n * }\n * }\n */\nexport interface RegisteredPlugins {}\n\n/**\n * Check if GeneratedTypes has been augmented (has any keys).\n */\ntype IsAugmented = keyof GeneratedTypes extends never ? false : true\n\n/**\n * PayloadTypes merges GeneratedTypes with UntypedPayloadTypes.\n * - When augmented: uses augmented properties, fills gaps with untyped fallbacks\n * - When not augmented: uses only UntypedPayloadTypes\n */\nexport type PayloadTypes = IsAugmented extends true\n ? GeneratedTypes & Omit<UntypedPayloadTypes, keyof GeneratedTypes>\n : UntypedPayloadTypes\n\nexport type TypedCollection<T extends PayloadTypesShape = PayloadTypes> = T['collections']\n\nexport type TypedBlock = PayloadTypes['blocks']\n\nexport type TypedWidget<T extends PayloadTypesShape = PayloadTypes> = T extends {\n widgets: infer TWidgets\n}\n ? TWidgets extends Record<string, unknown>\n ? TWidgets\n : Record<string, unknown>\n : Record<string, unknown>\n\nexport type TypedUploadCollection<T extends PayloadTypesShape = PayloadTypes> = NonNever<{\n [TSlug in keyof T['collections']]:\n | 'filename'\n | 'filesize'\n | 'mimeType'\n | 'url' extends keyof T['collections'][TSlug]\n ? T['collections'][TSlug]\n : never\n}>\n\nexport type TypedCollectionSelect<T extends PayloadTypesShape = PayloadTypes> =\n T['collectionsSelect']\n\nexport type TypedCollectionJoins<T extends PayloadTypesShape = PayloadTypes> = T['collectionsJoins']\n\nexport type TypedGlobal<T extends PayloadTypesShape = PayloadTypes> = T['globals']\n\nexport type TypedGlobalSelect<T extends PayloadTypesShape = PayloadTypes> = T['globalsSelect']\n\n// Extract string keys from the type\nexport type StringKeyOf<T> = Extract<keyof T, string>\n\n// Define the types for slugs using the appropriate collections and globals\nexport type CollectionSlug<T extends PayloadTypesShape = PayloadTypes> = StringKeyOf<\n T['collections']\n>\n\nexport type BlockSlug = StringKeyOf<TypedBlock>\n\nexport type WidgetSlug<T extends PayloadTypesShape = PayloadTypes> = StringKeyOf<TypedWidget<T>>\n\nexport type DataFromWidgetSlug<TSlug extends WidgetSlug> = TypedWidget[TSlug] extends {\n data?: infer TData\n}\n ? TData\n : TypedWidget[TSlug]\n\nexport type UploadCollectionSlug<T extends PayloadTypesShape = PayloadTypes> = StringKeyOf<\n TypedUploadCollection<T>\n>\n\nexport type DefaultDocumentIDType = PayloadTypes['db']['defaultIDType']\n\nexport type GlobalSlug<T extends PayloadTypesShape = PayloadTypes> = StringKeyOf<T['globals']>\n\nexport type TypedLocale<T extends PayloadTypesShape = PayloadTypes> = T['locale']\n\nexport type TypedFallbackLocale = PayloadTypes['fallbackLocale']\n\n/**\n *\n * TypedUser is the type of the user object. This can be a union of multiple user types, if you have multiple\n * auth-enabled collections.\n *\n * @todo rename to `User` in 4.0\n */\nexport type TypedUser = PayloadTypes['user']\n\nexport type TypedAuthOperations<T extends PayloadTypesShape = PayloadTypes> = T['auth']\n\nexport type AuthCollectionSlug<T extends PayloadTypesShape = PayloadTypes> = StringKeyOf<T['auth']>\n\nexport type TypedJobs = PayloadTypes['jobs']\n\n// Check if payload-jobs exists in the AUGMENTED types (not the fallback with index signature)\ntype HasPayloadJobsType = GeneratedTypes extends { collections: infer C }\n ? 'payload-jobs' extends keyof C\n ? true\n : false\n : false\n\n/**\n * Represents a job in the `payload-jobs` collection, referencing a queued workflow or task (= Job).\n * If a generated type for the `payload-jobs` collection is not available, falls back to the BaseJob type.\n *\n * `input` and `taksStatus` are always present here, as the job afterRead hook will always populate them.\n */\nexport type Job<\n TWorkflowSlugOrInput extends false | keyof TypedJobs['workflows'] | object = false,\n> = HasPayloadJobsType extends true\n ? {\n input: BaseJob<TWorkflowSlugOrInput>['input']\n taskStatus: BaseJob<TWorkflowSlugOrInput>['taskStatus']\n } & Omit<TypedCollection['payload-jobs'], 'input' | 'taskStatus'>\n : BaseJob<TWorkflowSlugOrInput>\n\nconst filename = fileURLToPath(import.meta.url)\nconst dirname = path.dirname(filename)\n\nlet checkedDependencies = false\n\n/**\n * @description Payload\n */\nexport class BasePayload {\n /**\n * @description Authorization and Authentication using headers and cookies to run auth user strategies\n * @returns permissions: Permissions\n * @returns user: User\n */\n auth = async (options: AuthArgs) => {\n return authLocal(this, options)\n }\n\n authStrategies!: AuthStrategy[]\n\n blocks: Record<BlockSlug, FlattenedBlock> = {}\n\n collections: Record<CollectionSlug, Collection> = {}\n\n config!: SanitizedConfig\n /**\n * @description Performs count operation\n * @param options\n * @returns count of documents satisfying query\n */\n count = async <T extends CollectionSlug>(\n options: CountOptions<T>,\n ): Promise<{ totalDocs: number }> => {\n return countLocal(this, options)\n }\n\n /**\n * @description Performs countGlobalVersions operation\n * @param options\n * @returns count of global document versions satisfying query\n */\n countGlobalVersions = async <T extends GlobalSlug>(\n options: CountGlobalVersionsOptions<T>,\n ): Promise<{ totalDocs: number }> => {\n return countGlobalVersionsLocal(this, options)\n }\n\n /**\n * @description Performs countVersions operation\n * @param options\n * @returns count of document versions satisfying query\n */\n countVersions = async <T extends CollectionSlug>(\n options: CountVersionsOptions<T>,\n ): Promise<{ totalDocs: number }> => {\n return countVersionsLocal(this, options)\n }\n\n /**\n * @description Performs create operation\n * @param options\n * @returns created document\n */\n create = async <TSlug extends CollectionSlug, TSelect extends SelectFromCollectionSlug<TSlug>>(\n options: CreateOptions<TSlug, TSelect>,\n ): Promise<TransformCollectionWithSelect<TSlug, TSelect>> => {\n return createLocal<TSlug, TSelect>(this, options)\n }\n\n crons: Cron[] = []\n db!: DatabaseAdapter\n\n decrypt = decrypt\n\n destroy = async () => {\n if (this.crons.length) {\n // Remove all crons from the list before stopping them\n const cronsToStop = this.crons.splice(0, this.crons.length)\n await Promise.all(cronsToStop.map((cron) => cron.stop()))\n }\n\n if (this.db?.destroy && typeof this.db.destroy === 'function') {\n await this.db.destroy()\n }\n }\n\n duplicate = async <TSlug extends CollectionSlug, TSelect extends SelectFromCollectionSlug<TSlug>>(\n options: DuplicateOptions<TSlug, TSelect>,\n ): Promise<TransformCollectionWithSelect<TSlug, TSelect>> => {\n return duplicateLocal<TSlug, TSelect>(this, options)\n }\n\n email!: InitializedEmailAdapter\n\n // TODO: re-implement or remove?\n // errorHandler: ErrorHandler\n\n encrypt = encrypt\n\n extensions!: (args: {\n args: OperationArgs<any>\n req: graphQLRequest<unknown, unknown>\n result: ExecutionResult\n }) => Promise<any>\n\n /**\n * @description Find documents with criteria\n * @param options\n * @returns documents satisfying query\n */\n find = async <\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n TDraft extends boolean = false,\n >(\n options: { draft?: TDraft } & FindOptions<TSlug, TSelect>,\n ): Promise<\n PaginatedDocs<\n TDraft extends true\n ? PayloadTypes extends { strictDraftTypes: true }\n ? DraftTransformCollectionWithSelect<TSlug, TSelect>\n : TransformCollectionWithSelect<TSlug, TSelect>\n : TransformCollectionWithSelect<TSlug, TSelect>\n >\n > => {\n return findLocal<TSlug, TSelect, TDraft>(this, options)\n }\n\n /**\n * @description Find document by ID\n * @param options\n * @returns document with specified ID\n */\n findByID = async <\n TSlug extends CollectionSlug,\n TDisableErrors extends boolean,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n >(\n options: FindByIDOptions<TSlug, TDisableErrors, TSelect>,\n ): Promise<ApplyDisableErrors<TransformCollectionWithSelect<TSlug, TSelect>, TDisableErrors>> => {\n return findByIDLocal<TSlug, TDisableErrors, TSelect>(this, options)\n }\n\n /**\n * @description Find distinct field values\n * @param options\n * @returns result with distinct field values\n */\n findDistinct = async <\n TSlug extends CollectionSlug,\n TField extends keyof DataFromCollectionSlug<TSlug> & string,\n >(\n options: FindDistinctOptions<TSlug, TField>,\n ): Promise<PaginatedDistinctDocs<Record<TField, DataFromCollectionSlug<TSlug>[TField]>>> => {\n return findDistinctLocal(this, options)\n }\n\n findGlobal = async <TSlug extends GlobalSlug, TSelect extends SelectFromGlobalSlug<TSlug>>(\n options: FindGlobalOptions<TSlug, TSelect>,\n ): Promise<TransformGlobalWithSelect<TSlug, TSelect>> => {\n return findOneGlobalLocal<TSlug, TSelect>(this, options)\n }\n\n /**\n * @description Find global version by ID\n * @param options\n * @returns global version with specified ID\n */\n findGlobalVersionByID = async <TSlug extends GlobalSlug>(\n options: FindGlobalVersionByIDOptions<TSlug>,\n ): Promise<TypeWithVersion<DataFromGlobalSlug<TSlug>>> => {\n return findGlobalVersionByIDLocal<TSlug>(this, options)\n }\n\n /**\n * @description Find global versions with criteria\n * @param options\n * @returns versions satisfying query\n */\n findGlobalVersions = async <TSlug extends GlobalSlug>(\n options: FindGlobalVersionsOptions<TSlug>,\n ): Promise<PaginatedDocs<TypeWithVersion<DataFromGlobalSlug<TSlug>>>> => {\n return findGlobalVersionsLocal<TSlug>(this, options)\n }\n\n /**\n * @description Find version by ID\n * @param options\n * @returns version with specified ID\n */\n findVersionByID = async <TSlug extends CollectionSlug>(\n options: FindVersionByIDOptions<TSlug>,\n ): Promise<TypeWithVersion<DataFromCollectionSlug<TSlug>>> => {\n return findVersionByIDLocal<TSlug>(this, options)\n }\n\n /**\n * @description Find versions with criteria\n * @param options\n * @returns versions satisfying query\n */\n findVersions = async <TSlug extends CollectionSlug>(\n options: FindVersionsOptions<TSlug>,\n ): Promise<PaginatedDocs<TypeWithVersion<DataFromCollectionSlug<TSlug>>>> => {\n return findVersionsLocal<TSlug>(this, options)\n }\n\n forgotPassword = async <TSlug extends CollectionSlug>(\n options: ForgotPasswordOptions<TSlug>,\n ): Promise<ForgotPasswordResult> => {\n return forgotPasswordLocal<TSlug>(this, options)\n }\n\n getAdminURL = (): string =>\n formatAdminURL({\n adminRoute: this.config.routes.admin,\n path: '',\n serverURL: this.config.serverURL,\n })\n\n getAPIURL = (): string =>\n formatAdminURL({\n apiRoute: this.config.routes.api,\n path: '',\n serverURL: this.config.serverURL,\n })\n\n globals!: Globals\n\n importMap!: ImportMap\n\n jobs = getJobsLocalAPI(this)\n\n /**\n * Key Value storage\n */\n kv!: KVAdapter\n\n logger!: Logger\n\n login = async <TSlug extends CollectionSlug>(\n options: LoginOptions<TSlug>,\n ): Promise<LoginResult<TSlug>> => {\n return loginLocal<TSlug>(this, options)\n }\n\n resetPassword = async <TSlug extends CollectionSlug>(\n options: ResetPasswordOptions<TSlug>,\n ): Promise<ResetPasswordResult> => {\n return resetPasswordLocal<TSlug>(this, options)\n }\n\n /**\n * @description Restore global version by ID\n * @param options\n * @returns version with specified ID\n */\n restoreGlobalVersion = async <TSlug extends GlobalSlug>(\n options: RestoreGlobalVersionOptions<TSlug>,\n ): Promise<DataFromGlobalSlug<TSlug>> => {\n return restoreGlobalVersionLocal<TSlug>(this, options)\n }\n\n /**\n * @description Restore version by ID\n * @param options\n * @returns version with specified ID\n */\n restoreVersion = async <TSlug extends CollectionSlug>(\n options: RestoreVersionOptions<TSlug>,\n ): Promise<DataFromCollectionSlug<TSlug>> => {\n return restoreVersionLocal<TSlug>(this, options)\n }\n\n schema!: GraphQLSchema\n\n secret!: string\n\n sendEmail!: InitializedEmailAdapter['sendEmail']\n\n types!: {\n arrayTypes: any\n blockInputTypes: any\n blockTypes: any\n fallbackLocaleInputType?: any\n groupTypes: any\n localeInputType?: any\n tabTypes: any\n }\n\n unlock = async <TSlug extends CollectionSlug>(\n options: UnlockOptions<TSlug>,\n ): Promise<boolean> => {\n return unlockLocal<TSlug>(this, options)\n }\n\n updateGlobal = async <TSlug extends GlobalSlug, TSelect extends SelectFromGlobalSlug<TSlug>>(\n options: UpdateGlobalOptions<TSlug, TSelect>,\n ): Promise<TransformGlobalWithSelect<TSlug, TSelect>> => {\n return updateGlobalLocal<TSlug, TSelect>(this, options)\n }\n\n validationRules!: (args: OperationArgs<any>) => ValidationRule[]\n\n verifyEmail = async <TSlug extends CollectionSlug>(\n options: VerifyEmailOptions<TSlug>,\n ): Promise<boolean> => {\n return verifyEmailLocal(this, options)\n }\n\n versions: {\n [slug: string]: any // TODO: Type this\n } = {}\n\n async _initializeCrons() {\n if (this.config.jobs.enabled && this.config.jobs.autoRun && !isNextBuild()) {\n const DEFAULT_CRON = '* * * * *'\n const DEFAULT_LIMIT = 10\n\n const cronJobs =\n typeof this.config.jobs.autoRun === 'function'\n ? await this.config.jobs.autoRun(this)\n : this.config.jobs.autoRun\n\n await Promise.all(\n cronJobs.map((cronConfig) => {\n const jobAutorunCron = new Cron(\n cronConfig.cron ?? DEFAULT_CRON,\n async () => {\n if (\n _internal_jobSystemGlobals.shouldAutoSchedule &&\n !cronConfig.disableScheduling &&\n this.config.jobs.scheduling\n ) {\n await this.jobs.handleSchedules({\n allQueues: cronConfig.allQueues,\n queue: cronConfig.queue,\n })\n }\n\n if (!_internal_jobSystemGlobals.shouldAutoRun) {\n return\n }\n\n if (typeof this.config.jobs.shouldAutoRun === 'function') {\n const shouldAutoRun = await this.config.jobs.shouldAutoRun(this)\n\n if (!shouldAutoRun) {\n jobAutorunCron.stop()\n return\n }\n }\n\n await this.jobs.run({\n allQueues: cronConfig.allQueues,\n limit: cronConfig.limit ?? DEFAULT_LIMIT,\n queue: cronConfig.queue,\n silent: cronConfig.silent,\n })\n },\n {\n catch: (err) => {\n this.logger.error({ err, msg: 'Error in job queue cron job handler' })\n },\n // Do not run consecutive crons if previous crons still ongoing\n protect: true,\n // TODO: Remove this compatibility option in 4.0. This only exists to ensure backwards-compatibility between Croner v9 and Croner v10 cron syntax\n sloppyRanges: true,\n },\n )\n\n this.crons.push(jobAutorunCron)\n }),\n )\n }\n }\n\n async bin({\n args,\n cwd,\n log,\n }: {\n args: string[]\n cwd?: string\n log?: boolean\n }): Promise<{ code: number }> {\n return new Promise((resolve, reject) => {\n const spawned = spawn('node', [path.resolve(dirname, '../bin.js'), ...args], {\n cwd,\n stdio: log || log === undefined ? 'inherit' : 'ignore',\n })\n\n spawned.on('exit', (code) => {\n resolve({ code: code! })\n })\n\n spawned.on('error', (error) => {\n reject(error)\n })\n })\n }\n\n /**\n * @description delete one or more documents\n * @param options\n * @returns Updated document(s)\n */\n delete<TSlug extends CollectionSlug, TSelect extends SelectFromCollectionSlug<TSlug>>(\n options: DeleteByIDOptions<TSlug, TSelect>,\n ): Promise<TransformCollectionWithSelect<TSlug, TSelect>>\n\n delete<TSlug extends CollectionSlug, TSelect extends SelectFromCollectionSlug<TSlug>>(\n options: DeleteManyOptions<TSlug, TSelect>,\n ): Promise<BulkOperationResult<TSlug, TSelect>>\n\n delete<TSlug extends CollectionSlug, TSelect extends SelectFromCollectionSlug<TSlug>>(\n options: DeleteOptions<TSlug, TSelect>,\n ): Promise<BulkOperationResult<TSlug, TSelect> | TransformCollectionWithSelect<TSlug, TSelect>> {\n return deleteLocal<TSlug, TSelect>(this, options)\n }\n\n /**\n * @description Initializes Payload\n * @param options\n */\n async init(options: InitOptions): Promise<Payload> {\n if (\n process.env.NODE_ENV !== 'production' &&\n process.env.PAYLOAD_DISABLE_DEPENDENCY_CHECKER !== 'true' &&\n !checkedDependencies\n ) {\n checkedDependencies = true\n void checkPayloadDependencies()\n }\n\n this.importMap = options.importMap!\n\n if (!options?.config) {\n throw new Error('Error: the payload config is required to initialize payload.')\n }\n\n this.config = await options.config\n this.logger = getLogger('payload', this.config.logger)\n\n if (!this.config.secret) {\n throw new Error('Error: missing secret key. A secret key is needed to secure Payload.')\n }\n\n this.secret = crypto.createHash('sha256').update(this.config.secret).digest('hex').slice(0, 32)\n\n this.globals = {\n config: this.config.globals,\n }\n\n for (const collection of this.config.collections) {\n let customIDType: string | undefined = undefined\n const findCustomID: TraverseFieldsCallback = ({ field }) => {\n if (\n ['array', 'blocks', 'group'].includes(field.type) ||\n (field.type === 'tab' && 'name' in field)\n ) {\n return true\n }\n\n if (!fieldAffectsData(field)) {\n return\n }\n\n if (field.name === 'id') {\n customIDType = field.type\n return true\n }\n }\n\n traverseFields({\n callback: findCustomID,\n config: this.config,\n fields: collection.fields,\n parentIsLocalized: false,\n })\n\n this.collections[collection.slug] = {\n config: collection,\n customIDType,\n }\n }\n\n this.blocks = this.config.blocks!.reduce(\n (blocks, block) => {\n blocks[block.slug] = block\n return blocks\n },\n {} as Record<string, FlattenedBlock>,\n )\n\n // Generate types on startup\n if (process.env.NODE_ENV !== 'production' && this.config.typescript.autoGenerate !== false) {\n // We cannot run it directly here, as generate-types imports json-schema-to-typescript, which breaks on turbopack.\n // see: https://github.com/vercel/next.js/issues/66723\n void this.bin({\n args: ['generate:types'],\n log: false,\n })\n }\n\n this.db = this.config.db.init({ payload: this })\n this.db.payload = this\n\n this.kv = this.config.kv.init({ payload: this })\n\n if (this.db?.init) {\n await this.db.init()\n }\n\n if (!options.disableDBConnect && this.db.connect) {\n await this.db.connect()\n }\n\n // Load email adapter\n if (this.config.email instanceof Promise) {\n const awaitedAdapter = await this.config.email\n this.email = awaitedAdapter({ payload: this })\n } else if (this.config.email) {\n this.email = this.config.email({ payload: this })\n } else {\n if (process.env.NEXT_PHASE !== 'phase-production-build') {\n this.logger.warn(\n `No email adapter provided. Email will be written to console. More info at https://payloadcms.com/docs/email/overview.`,\n )\n }\n\n this.email = consoleEmailAdapter({ payload: this })\n }\n\n // Warn if image resizing is enabled but sharp is not installed\n if (\n !this.config.sharp &&\n this.config.collections.some((c) => c.upload.imageSizes || c.upload.formatOptions)\n ) {\n this.logger.warn(\n `Image resizing is enabled for one or more collections, but sharp not installed. Please install 'sharp' and pass into the config.`,\n )\n }\n\n // Warn if user is deploying to Vercel, and any upload collection is missing a storage adapter\n if (process.env.VERCEL) {\n const uploadCollWithoutAdapter = this.config.collections.filter(\n (c) => c.upload && c.upload.adapter === undefined, // Uploads enabled, but no storage adapter provided\n )\n\n if (uploadCollWithoutAdapter.length) {\n const slugs = uploadCollWithoutAdapter.map((c) => c.slug).join(', ')\n this.logger.warn(\n `Collections with uploads enabled require a storage adapter when deploying to Vercel. Collection(s) without storage adapters: ${slugs}. See https://payloadcms.com/docs/upload/storage-adapters for more info.`,\n )\n }\n }\n\n /**\n * @todo: Remove in v4.\n * See `normalizeSendEmailOptions` for details.\n */\n const adapterSendEmail = this.email['sendEmail']\n this.sendEmail = (message) => adapterSendEmail(normalizeSendEmailOptions(message))\n\n serverInitTelemetry(this)\n\n // 1. loop over collections, if collection has auth strategy, initialize and push to array\n let jwtStrategyEnabled = false\n this.authStrategies = this.config.collections.reduce((authStrategies, collection) => {\n if (collection?.auth) {\n if (collection.auth.strategies.length > 0) {\n authStrategies.push(...collection.auth.strategies)\n }\n\n // 2. if api key enabled, push api key strategy into the array\n if (collection.auth?.useAPIKey) {\n authStrategies.push({\n name: `${collection.slug}-api-key`,\n authenticate: APIKeyAuthentication(collection),\n })\n }\n\n // 3. if localStrategy flag is true\n if (!collection.auth.disableLocalStrategy && !jwtStrategyEnabled) {\n jwtStrategyEnabled = true\n }\n }\n\n return authStrategies\n }, [] as AuthStrategy[])\n\n // 4. if enabled, push jwt strategy into authStrategies last\n if (jwtStrategyEnabled) {\n this.authStrategies.push({\n name: 'local-jwt',\n authenticate: JWTAuthentication,\n })\n }\n\n try {\n if (!options.disableOnInit) {\n if (typeof options.onInit === 'function') {\n await options.onInit(this)\n }\n if (typeof this.config.onInit === 'function') {\n await this.config.onInit(this)\n }\n }\n } catch (error) {\n this.logger.error({ err: error }, 'Error running onInit function')\n throw error\n }\n\n if (options.cron) {\n await this._initializeCrons()\n }\n\n return this\n }\n\n update<TSlug extends CollectionSlug, TSelect extends SelectFromCollectionSlug<TSlug>>(\n options: UpdateManyOptions<TSlug, TSelect>,\n ): Promise<BulkOperationResult<TSlug, TSelect>>\n\n /**\n * @description Update one or more documents\n * @param options\n * @returns Updated document(s)\n */\n update<TSlug extends CollectionSlug, TSelect extends SelectFromCollectionSlug<TSlug>>(\n options: UpdateByIDOptions<TSlug, TSelect>,\n ): Promise<TransformCollectionWithSelect<TSlug, TSelect>>\n\n update<TSlug extends CollectionSlug, TSelect extends SelectFromCollectionSlug<TSlug>>(\n options: UpdateOptions<TSlug, TSelect>,\n ): Promise<BulkOperationResult<TSlug, TSelect> | TransformCollectionWithSelect<TSlug, TSelect>> {\n return updateLocal<TSlug, TSelect>(this, options)\n }\n}\n\nconst initialized = new BasePayload()\n\n// eslint-disable-next-line no-restricted-exports\nexport default initialized\n\nexport const reload = async (\n config: SanitizedConfig,\n payload: Payload,\n skipImportMapGeneration?: boolean,\n options?: InitOptions,\n): Promise<void> => {\n if (typeof payload.db.destroy === 'function') {\n // Only destroy db, as we then later only call payload.db.init and not payload.init\n await payload.db.destroy()\n }\n payload.config = config\n\n payload.collections = config.collections.reduce(\n (collections, collection) => {\n collections[collection.slug] = {\n config: collection,\n customIDType: payload.collections[collection.slug]?.customIDType,\n }\n return collections\n },\n {} as Record<string, any>,\n )\n\n payload.blocks = config.blocks!.reduce(\n (blocks, block) => {\n blocks[block.slug] = block\n return blocks\n },\n {} as Record<string, FlattenedBlock>,\n )\n\n payload.globals = {\n config: config.globals,\n }\n\n // TODO: support HMR for other props in the future (see payload/src/index init()) that may change on Payload singleton\n\n // Generate types\n if (config.typescript.autoGenerate !== false) {\n // We cannot run it directly here, as generate-types imports json-schema-to-typescript, which breaks on turbopack.\n // see: https://github.com/vercel/next.js/issues/66723\n void payload.bin({\n args: ['generate:types'],\n log: false,\n })\n }\n\n // Generate import map\n if (skipImportMapGeneration !== true && config.admin?.importMap?.autoGenerate !== false) {\n // This may run outside of the admin panel, e.g. in the user's frontend, where we don't have an import map file.\n // We don't want to throw an error in this case, as it would break the user's frontend.\n // => just skip it => ignoreResolveError: true\n await generateImportMap(config, {\n ignoreResolveError: true,\n log: true,\n })\n }\n\n if (payload.db?.init) {\n await payload.db.init()\n }\n\n if (!options?.disableDBConnect && payload.db.connect) {\n await payload.db.connect({ hotReload: true })\n }\n\n ;(global as any)._payload_clientConfigs = {} as Record<keyof SupportedLanguages, ClientConfig>\n ;(global as any)._payload_schemaMap = null\n ;(global as any)._payload_clientSchemaMap = null\n ;(global as any)._payload_doNotCacheClientConfig = true // This will help refreshing the client config cache more reliably. If you remove this, please test HMR + client config refreshing (do new fields appear in the document?)\n ;(global as any)._payload_doNotCacheSchemaMap = true\n ;(global as any)._payload_doNotCacheClientSchemaMap = true\n}\n\nlet _cached: Map<\n string,\n {\n initializedCrons: boolean\n payload: null | Payload\n promise: null | Promise<Payload>\n reload: boolean | Promise<void>\n ws: null | WebSocket\n }\n> = (global as any)._payload\n\nif (!_cached) {\n _cached = (global as any)._payload = new Map()\n}\n\n/**\n * Get a payload instance.\n * This function is a wrapper around new BasePayload().init() that adds the following functionality on top of that:\n *\n * - smartly caches Payload instance on the module scope. That way, we prevent unnecessarily initializing Payload over and over again\n * when calling getPayload multiple times or from multiple locations.\n * - adds HMR support and reloads the payload instance when the config changes.\n */\nexport const getPayload = async (\n options: {\n /**\n * A unique key to identify the payload instance. You can pass your own key if you want to cache this payload instance separately.\n * This is useful if you pass a different payload config for each instance.\n *\n * @default 'default'\n */\n key?: string\n } & InitOptions,\n): Promise<Payload> => {\n if (!options?.config) {\n throw new Error('Error: the payload config is required for getPayload to work.')\n }\n\n let alreadyCachedSameConfig = false\n\n let cached = _cached.get(options.key ?? 'default')\n if (!cached) {\n cached = {\n initializedCrons: Boolean(options.cron),\n payload: null,\n promise: null,\n reload: false,\n ws: null,\n }\n _cached.set(options.key ?? 'default', cached)\n } else {\n alreadyCachedSameConfig = true\n }\n\n if (alreadyCachedSameConfig) {\n // alreadyCachedSameConfig => already called onInit once, but same config => no need to call onInit again.\n // calling onInit again would only make sense if a different config was passed.\n options.disableOnInit = true\n }\n\n if (cached.payload) {\n if (options.cron && !cached.initializedCrons) {\n // getPayload called with crons enabled, but existing cached version does not have crons initialized. => Initialize crons in existing cached version\n cached.initializedCrons = true\n await cached.payload._initializeCrons()\n }\n\n if (cached.reload === true) {\n let resolve!: () => void\n\n // getPayload is called multiple times, in parallel. However, we only want to run `await reload` once. By immediately setting cached.reload to a promise,\n // we can ensure that all subsequent calls will wait for the first reload to finish. So if we set it here, the 2nd call of getPayload\n // will reach `if (cached.reload instanceof Promise) {` which then waits for the first reload to finish.\n cached.reload = new Promise((res) => (resolve = res))\n const config = await options.config\n\n // Reload the payload instance after a config change (triggered by HMR in development).\n // The second parameter (false) forces import map regeneration rather than deciding based on options.importMap.\n //\n // Why we always regenerate import map: getPayload() may be called from multiple sources (admin panel, frontend, etc.)\n // that share the same cache but may pass different importMap values. Since call order is unpredictable,\n // we cannot rely on options.importMap to determine if regeneration is needed.\n //\n // Example scenario: If the frontend calls getPayload() without importMap first, followed by the admin\n // panel calling it with importMap, we'd incorrectly skip generation for the admin panel's needs.\n // By always regenerating on reload, we ensure the import map stays in sync with the updated config.\n await reload(config, cached.payload, false, options)\n\n resolve()\n cached.reload = false\n }\n\n if (cached.reload instanceof Promise) {\n await cached.reload\n }\n if (options?.importMap) {\n cached.payload.importMap = options.importMap\n }\n return cached.payload\n }\n\n try {\n if (!cached.promise) {\n // no need to await options.config here, as it's already awaited in the BasePayload.init\n cached.promise = new BasePayload().init(options)\n }\n\n cached.payload = await cached.promise\n\n if (\n !cached.ws &&\n process.env.NODE_ENV !== 'production' &&\n process.env.NODE_ENV !== 'test' &&\n process.env.DISABLE_PAYLOAD_HMR !== 'true'\n ) {\n try {\n const port = process.env.PORT || '3000'\n const hasHTTPS =\n process.env.USE_HTTPS === 'true' || process.argv.includes('--experimental-https')\n const protocol = hasHTTPS ? 'wss' : 'ws'\n\n const path = '/_next/webpack-hmr'\n // The __NEXT_ASSET_PREFIX env variable is set for both assetPrefix and basePath (tested in Next.js 15.1.6)\n const prefix = process.env.__NEXT_ASSET_PREFIX ?? ''\n\n cached.ws = new WebSocket(\n process.env.PAYLOAD_HMR_URL_OVERRIDE ?? `${protocol}://localhost:${port}${prefix}${path}`,\n )\n\n cached.ws.onmessage = (event) => {\n if (cached.reload instanceof Promise) {\n // If there is an in-progress reload in the same getPayload\n // cache instance, do not set reload to true again, which would\n // trigger another reload.\n // Instead, wait for the in-progress reload to finish.\n return\n }\n\n if (typeof event.data === 'string') {\n const data = JSON.parse(event.data)\n\n if (\n // On Next.js 15, we need to check for data.action. On Next.js 16, we need to check for data.type.\n data.type === 'serverComponentChanges' ||\n data.action === 'serverComponentChanges'\n ) {\n cached.reload = true\n }\n }\n }\n\n cached.ws.onerror = (_) => {\n // swallow any websocket connection error\n }\n } catch (_) {\n // swallow e\n }\n }\n } catch (e) {\n cached.promise = null\n // add identifier to error object, so that our error logger in routeError.ts does not attempt to re-initialize getPayload\n ;(e as { payloadInitError?: boolean }).payloadInitError = true\n throw e\n }\n\n if (options?.importMap) {\n cached.payload.importMap = options.importMap\n }\n\n return cached.payload\n}\n\ntype Payload = BasePayload\n\ninterface RequestContext {\n [key: string]: unknown\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface DatabaseAdapter extends BaseDatabaseAdapter {}\nexport type { Payload, RequestContext }\nexport { jwtSign } from './auth/jwt.js'\nexport { accessOperation } from './auth/operations/access.js'\nexport { forgotPasswordOperation } from './auth/operations/forgotPassword.js'\nexport { initOperation } from './auth/operations/init.js'\nexport type { LoginResult } from './auth/operations/login.js'\nexport { checkLoginPermission } from './auth/operations/login.js'\nexport { loginOperation } from './auth/operations/login.js'\nexport { logoutOperation } from './auth/operations/logout.js'\nexport type { MeOperationResult } from './auth/operations/me.js'\nexport { meOperation } from './auth/operations/me.js'\nexport { refreshOperation } from './auth/operations/refresh.js'\nexport { registerFirstUserOperation } from './auth/operations/registerFirstUser.js'\nexport { resetPasswordOperation } from './auth/operations/resetPassword.js'\nexport { unlockOperation } from './auth/operations/unlock.js'\nexport { verifyEmailOperation } from './auth/operations/verifyEmail.js'\nexport { JWTAuthentication } from './auth/strategies/jwt.js'\nexport { incrementLoginAttempts } from './auth/strategies/local/incrementLoginAttempts.js'\nexport { resetLoginAttempts } from './auth/strategies/local/resetLoginAttempts.js'\nexport type {\n AuthStrategyFunction,\n AuthStrategyFunctionArgs,\n AuthStrategyResult,\n CollectionPermission,\n DocumentPermissions,\n FieldPermissions,\n GlobalPermission,\n IncomingAuthType,\n Permission,\n Permissions,\n SanitizedCollectionPermission,\n SanitizedDocumentPermissions,\n SanitizedFieldPermissions,\n SanitizedGlobalPermission,\n SanitizedPermissions,\n UntypedUser as User,\n VerifyConfig,\n} from './auth/types.js'\nexport { generateImportMap } from './bin/generateImportMap/index.js'\n\nexport type { ImportMap } from './bin/generateImportMap/index.js'\nexport { genImportMapIterateFields } from './bin/generateImportMap/iterateFields.js'\nexport { migrate as migrateCLI } from './bin/migrate.js'\n\nexport {\n type ClientCollectionConfig,\n createClientCollectionConfig,\n createClientCollectionConfigs,\n type ServerOnlyCollectionAdminProperties,\n type ServerOnlyCollectionProperties,\n type ServerOnlyUploadProperties,\n} from './collections/config/client.js'\n\nexport type {\n AfterChangeHook as CollectionAfterChangeHook,\n AfterDeleteHook as CollectionAfterDeleteHook,\n AfterErrorHook as CollectionAfterErrorHook,\n AfterForgotPasswordHook as CollectionAfterForgotPasswordHook,\n AfterLoginHook as CollectionAfterLoginHook,\n AfterLogoutHook as CollectionAfterLogoutHook,\n AfterMeHook as CollectionAfterMeHook,\n AfterOperationHook as CollectionAfterOperationHook,\n AfterReadHook as CollectionAfterReadHook,\n AfterRefreshHook as CollectionAfterRefreshHook,\n AuthCollection,\n AuthOperationsFromCollectionSlug,\n BaseFilter,\n BaseListFilter,\n BeforeChangeHook as CollectionBeforeChangeHook,\n BeforeDeleteHook as CollectionBeforeDeleteHook,\n BeforeLoginHook as CollectionBeforeLoginHook,\n BeforeOperationHook as CollectionBeforeOperationHook,\n BeforeReadHook as CollectionBeforeReadHook,\n BeforeValidateHook as CollectionBeforeValidateHook,\n BulkOperationResult,\n Collection,\n CollectionAdminOptions,\n CollectionConfig,\n DataFromCollectionSlug,\n HookOperationType,\n MeHook as CollectionMeHook,\n RefreshHook as CollectionRefreshHook,\n RequiredDataFromCollection,\n RequiredDataFromCollectionSlug,\n SanitizedCollectionConfig,\n SanitizedJoins,\n TypeWithID,\n TypeWithTimestamps,\n} from './collections/config/types.js'\n\nexport type { CompoundIndex } from './collections/config/types.js'\nexport type { SanitizedCompoundIndex } from './collections/config/types.js'\n\nexport { createDataloaderCacheKey, getDataLoader } from './collections/dataloader.js'\nexport { countOperation } from './collections/operations/count.js'\nexport { createOperation } from './collections/operations/create.js'\nexport { deleteOperation } from './collections/operations/delete.js'\nexport { deleteByIDOperation } from './collections/operations/deleteByID.js'\nexport { docAccessOperation } from './collections/operations/docAccess.js'\nexport { duplicateOperation } from './collections/operations/duplicate.js'\nexport { findOperation } from './collections/operations/find.js'\nexport { findByIDOperation } from './collections/operations/findByID.js'\nexport { findVersionByIDOperation } from './collections/operations/findVersionByID.js'\nexport { findVersionsOperation } from './collections/operations/findVersions.js'\nexport { restoreVersionOperation } from './collections/operations/restoreVersion.js'\nexport { updateOperation } from './collections/operations/update.js'\nexport { updateByIDOperation } from './collections/operations/updateByID.js'\nexport { buildConfig } from './config/build.js'\nexport {\n type ClientConfig,\n createClientConfig,\n type CreateClientConfigArgs,\n createUnauthenticatedClientConfig,\n serverOnlyAdminConfigProperties,\n serverOnlyConfigProperties,\n type UnauthenticatedClientConfig,\n} from './config/client.js'\nexport { defaults } from './config/defaults.js'\nexport { definePlugin } from './config/definePlugin.js'\n\nexport { type OrderableEndpointBody } from './config/orderable/index.js'\nexport { sanitizeConfig } from './config/sanitize.js'\nexport type * from './config/types.js'\nexport { combineQueries } from './database/combineQueries.js'\nexport { createDatabaseAdapter } from './database/createDatabaseAdapter.js'\nexport { defaultBeginTransaction } from './database/defaultBeginTransaction.js'\nexport { flattenWhereToOperators } from './database/flattenWhereToOperators.js'\nexport { getLocalizedPaths } from './database/getLocalizedPaths.js'\nexport { createMigration } from './database/migrations/createMigration.js'\nexport { findMigrationDir } from './database/migrations/findMigrationDir.js'\nexport { getMigrations } from './database/migrations/getMigrations.js'\nexport { getPredefinedMigration } from './database/migrations/getPredefinedMigration.js'\nexport { migrate } from './database/migrations/migrate.js'\nexport { migrateDown } from './database/migrations/migrateDown.js'\nexport { migrateRefresh } from './database/migrations/migrateRefresh.js'\nexport { migrateReset } from './database/migrations/migrateReset.js'\nexport { migrateStatus } from './database/migrations/migrateStatus.js'\nexport { migrationsCollection } from './database/migrations/migrationsCollection.js'\nexport { migrationTemplate } from './database/migrations/migrationTemplate.js'\nexport { readMigrationFiles } from './database/migrations/readMigrationFiles.js'\nexport { writeMigrationIndex } from './database/migrations/writeMigrationIndex.js'\nexport type * from './database/queryValidation/types.js'\nexport type { EntityPolicies, PathToQuery } from './database/queryValidation/types.js'\nexport { validateQueryPaths } from './database/queryValidation/validateQueryPaths.js'\nexport { validateSearchParam } from './database/queryValidation/validateSearchParams.js'\nexport type {\n BaseDatabaseAdapter,\n BeginTransaction,\n CommitTransaction,\n Connect,\n Count,\n CountArgs,\n CountGlobalVersionArgs,\n CountGlobalVersions,\n CountVersions,\n Create,\n CreateArgs,\n CreateGlobal,\n CreateGlobalArgs,\n CreateGlobalVersion,\n CreateGlobalVersionArgs,\n CreateMigration,\n CreateVersion,\n CreateVersionArgs,\n DatabaseAdapterResult as DatabaseAdapterObj,\n DBIdentifierName,\n DeleteMany,\n DeleteManyArgs,\n DeleteOne,\n DeleteOneArgs,\n DeleteVersions,\n DeleteVersionsArgs,\n Destroy,\n Find,\n FindArgs,\n FindDistinct,\n FindGlobal,\n FindGlobalArgs,\n FindGlobalVersions,\n FindGlobalVersionsArgs,\n FindOne,\n FindOneArgs,\n FindVersions,\n FindVersionsArgs,\n GenerateSchema,\n Init,\n Migration,\n MigrationData,\n MigrationTemplateArgs,\n PaginatedDistinctDocs,\n PaginatedDocs,\n QueryDrafts,\n QueryDraftsArgs,\n RollbackTransaction,\n Transaction,\n UpdateGlobal,\n UpdateGlobalArgs,\n UpdateGlobalVersion,\n UpdateGlobalVersionArgs,\n UpdateJobs,\n UpdateJobsArgs,\n UpdateMany,\n UpdateManyArgs,\n UpdateOne,\n UpdateOneArgs,\n UpdateVersion,\n UpdateVersionArgs,\n Upsert,\n UpsertArgs,\n} from './database/types.js'\nexport type { DynamicMigrationTemplate } from './database/types.js'\nexport type { EmailAdapter as PayloadEmailAdapter, SendEmailOptions } from './email/types.js'\n\nexport {\n APIError,\n APIErrorName,\n AuthenticationError,\n DuplicateCollection,\n DuplicateFieldName,\n DuplicateGlobal,\n ErrorDeletingFile,\n FileRetrievalError,\n FileUploadError,\n Forbidden,\n InvalidConfiguration,\n InvalidFieldName,\n InvalidFieldRelationship,\n Locked,\n LockedAuth,\n MissingCollectionLabel,\n MissingEditorProp,\n MissingFieldInputOptions,\n MissingFieldType,\n MissingFile,\n NotFound,\n QueryError,\n UnauthorizedError,\n UnverifiedEmail,\n ValidationError,\n ValidationErrorName,\n} from './errors/index.js'\nexport type { ValidationFieldError } from './errors/index.js'\n\nexport { baseBlockFields } from './fields/baseFields/baseBlockFields.js'\n\nexport { baseIDField } from './fields/baseFields/baseIDField.js'\nexport { slugField, type SlugFieldClientProps } from './fields/baseFields/slug/index.js'\n\nexport { type SlugField } from './fields/baseFields/slug/index.js'\n\nexport {\n createClientBlocks,\n createClientField,\n createClientFields,\n type ServerOnlyFieldAdminProperties,\n type ServerOnlyFieldProperties,\n} from './fields/config/client.js'\n\nexport interface FieldCustom extends Record<string, any> {}\n\nexport interface CollectionCustom extends Record<string, any> {}\n\nexport interface CollectionAdminCustom extends Record<string, any> {}\n\nexport interface GlobalCustom extends Record<string, any> {}\n\nexport interface GlobalAdminCustom extends Record<string, any> {}\n\nexport { sanitizeField, sanitizeFields } from './fields/config/sanitize.js'\nexport type { SanitizeFieldArgs } from './fields/config/sanitize.js'\n\nexport type {\n AdminClient,\n ArrayField,\n ArrayFieldClient,\n BaseValidateOptions,\n Block,\n BlockJSX,\n BlocksField,\n BlocksFieldClient,\n CheckboxField,\n CheckboxFieldClient,\n ClientBlock,\n ClientField,\n ClientFieldProps,\n CodeField,\n CodeFieldClient,\n CollapsibleField,\n CollapsibleFieldClient,\n Condition,\n DateField,\n DateFieldClient,\n EmailField,\n EmailFieldClient,\n Field,\n FieldAccess,\n FieldAccessArgs,\n FieldAffectingData,\n FieldAffectingDataClient,\n FieldBase,\n FieldBaseClient,\n FieldHook,\n FieldHookArgs,\n FieldPosition,\n FieldPresentationalOnly,\n FieldPresentationalOnlyClient,\n FieldTypes,\n FieldWithMany,\n FieldWithManyClient,\n FieldWithMaxDepth,\n FieldWithMaxDepthClient,\n FieldWithPath,\n FieldWithPathClient,\n FieldWithSubFields,\n FieldWithSubFieldsClient,\n FilterOptions,\n FilterOptionsProps,\n FlattenedArrayField,\n FlattenedBlock,\n FlattenedBlocksField,\n FlattenedField,\n FlattenedGroupField,\n FlattenedJoinField,\n FlattenedTabAsField,\n GroupField,\n GroupFieldClient,\n HookName,\n JoinField,\n JoinFieldClient,\n JSONField,\n JSONFieldClient,\n Labels,\n LabelsClient,\n NamedGroupField,\n NamedGroupFieldClient,\n NamedTab,\n NonPresentationalField,\n NonPresentationalFieldClient,\n NumberField,\n NumberFieldClient,\n Option,\n OptionLabel,\n OptionObject,\n PointField,\n PointFieldClient,\n PolymorphicRelationshipField,\n PolymorphicRelationshipFieldClient,\n RadioField,\n RadioFieldClient,\n RelationshipField,\n RelationshipFieldClient,\n RelationshipValue,\n RichTextField,\n RichTextFieldClient,\n RowField,\n RowFieldClient,\n SelectField,\n SelectFieldClient,\n SingleRelationshipField,\n SingleRelationshipFieldClient,\n Tab,\n TabAsField,\n TabAsFieldClient,\n TabsField,\n TabsFieldClient,\n TextareaField,\n TextareaFieldClient,\n TextField,\n TextFieldClient,\n UIField,\n UIFieldClient,\n UnnamedGroupField,\n UnnamedGroupFieldClient,\n UnnamedTab,\n UploadField,\n UploadFieldClient,\n Validate,\n ValidateOptions,\n ValueWithRelation,\n} from './fields/config/types.js'\n\nexport { getDefaultValue } from './fields/getDefaultValue.js'\nexport { traverseFields as afterChangeTraverseFields } from './fields/hooks/afterChange/traverseFields.js'\n\nexport { promise as afterReadPromise } from './fields/hooks/afterRead/promise.js'\nexport { traverseFields as afterReadTraverseFields } from './fields/hooks/afterRead/traverseFields.js'\nexport { traverseFields as beforeChangeTraverseFields } from './fields/hooks/beforeChange/traverseFields.js'\nexport { traverseFields as beforeValidateTraverseFields } from './fields/hooks/beforeValidate/traverseFields.js'\n\nexport { sortableFieldTypes } from './fields/sortableFieldTypes.js'\nexport { validateBlocksFilterOptions, validations } from './fields/validations.js'\n\nexport type {\n ArrayFieldValidation,\n BlocksFieldValidation,\n CheckboxFieldValidation,\n CodeFieldValidation,\n ConfirmPasswordFieldValidation,\n DateFieldValidation,\n EmailFieldValidation,\n JSONFieldValidation,\n NumberFieldManyValidation,\n NumberFieldSingleValidation,\n NumberFieldValidation,\n PasswordFieldValidation,\n PointFieldValidation,\n RadioFieldValidation,\n RelationshipFieldManyValidation,\n RelationshipFieldSingleValidation,\n RelationshipFieldValidation,\n RichTextFieldValidation,\n SelectFieldManyValidation,\n SelectFieldSingleValidation,\n SelectFieldValidation,\n TextareaFieldValidation,\n TextFieldManyValidation,\n TextFieldSingleValidation,\n TextFieldValidation,\n UploadFieldManyValidation,\n UploadFieldSingleValidation,\n UploadFieldValidation,\n UsernameFieldValidation,\n} from './fields/validations.js'\nexport type { FolderSortKeys } from './folders/types.js'\nexport { getFolderData } from './folders/utils/getFolderData.js'\nexport {\n type ClientGlobalConfig,\n createClientGlobalConfig,\n createClientGlobalConfigs,\n type ServerOnlyGlobalAdminProperties,\n type ServerOnlyGlobalProperties,\n} from './globals/config/client.js'\nexport type {\n AfterChangeHook as GlobalAfterChangeHook,\n AfterReadHook as GlobalAfterReadHook,\n BeforeChangeHook as GlobalBeforeChangeHook,\n BeforeOperationHook as GlobalBeforeOperationHook,\n BeforeReadHook as GlobalBeforeReadHook,\n BeforeValidateHook as GlobalBeforeValidateHook,\n DataFromGlobalSlug,\n GlobalAdminOptions,\n GlobalConfig,\n SanitizedGlobalConfig,\n} from './globals/config/types.js'\nexport { docAccessOperation as docAccessOperationGlobal } from './globals/operations/docAccess.js'\nexport { findOneOperation } from './globals/operations/findOne.js'\n\nexport { findVersionByIDOperation as findVersionByIDOperationGlobal } from './globals/operations/findVersionByID.js'\n\nexport { findVersionsOperation as findVersionsOperationGlobal } from './globals/operations/findVersions.js'\nexport { restoreVersionOperation as restoreVersionOperationGlobal } from './globals/operations/restoreVersion.js'\nexport { updateOperation as updateOperationGlobal } from './globals/operations/update.js'\nexport * from './kv/adapters/DatabaseKVAdapter.js'\nexport * from './kv/adapters/InMemoryKVAdapter.js'\nexport * from './kv/index.js'\nexport type {\n CollapsedPreferences,\n CollectionPreferences,\n /**\n * @deprecated Use `CollectionPreferences` instead.\n */\n CollectionPreferences as ListPreferences,\n ColumnPreference,\n DocumentPreferences,\n FieldsPreferences,\n InsideFieldsPreferences,\n PreferenceRequest,\n PreferenceUpdateRequest,\n TabsPreferences,\n} from './preferences/types.js'\nexport type { QueryPreset } from './query-presets/types.js'\nexport { jobAfterRead } from './queues/config/collection.js'\nexport type { JobsConfig, RunJobAccess, RunJobAccessArgs } from './queues/config/types/index.js'\nexport type {\n RunInlineTaskFunction,\n RunTaskFunction,\n RunTaskFunctions,\n TaskConfig,\n TaskHandler,\n TaskHandlerArgs,\n TaskHandlerResult,\n TaskHandlerResults,\n TaskInput,\n TaskOutput,\n TaskType,\n} from './queues/config/types/taskTypes.js'\nexport type {\n BaseJob,\n ConcurrencyConfig,\n JobLog,\n JobTaskStatus,\n RunningJob,\n SingleTaskStatus,\n WorkflowConfig,\n WorkflowHandler,\n WorkflowTypes,\n} from './queues/config/types/workflowTypes.js'\n\nexport { JobCancelledError } from './queues/errors/index.js'\nexport { countRunnableOrActiveJobsForQueue } from './queues/operations/handleSchedules/countRunnableOrActiveJobsForQueue.js'\nexport { importHandlerPath } from './queues/operations/runJobs/runJob/importHandlerPath.js'\n\nexport {\n _internal_jobSystemGlobals,\n _internal_resetJobSystemGlobals,\n getCurrentDate,\n} from './queues/utilities/getCurrentDate.js'\nexport { getLocalI18n } from './translations/getLocalI18n.js'\nexport * from './types/index.js'\nexport { getFileByPath } from './uploads/getFileByPath.js'\nexport { _internal_safeFetchGlobal } from './uploads/safeFetch.js'\n\nexport type * from './uploads/types.js'\nexport { addDataAndFileToRequest } from './utilities/addDataAndFileToRequest.js'\nexport { addLocalesToRequestFromData, sanitizeLocales } from './utilities/addLocalesToRequest.js'\nexport { canAccessAdmin } from './utilities/canAccessAdmin.js'\nexport { commitTransaction } from './utilities/commitTransaction.js'\nexport {\n configToJSONSchema,\n entityToJSONSchema,\n fieldsToJSONSchema,\n withNullableJSONSchemaType,\n} from './utilities/configToJSONSchema.js'\nexport { createArrayFromCommaDelineated } from './utilities/createArrayFromCommaDelineated.js'\nexport { createLocalReq } from './utilities/createLocalReq.js'\nexport { createPayloadRequest } from './utilities/createPayloadRequest.js'\nexport {\n deepCopyObject,\n deepCopyObjectComplex,\n deepCopyObjectSimple,\n} from './utilities/deepCopyObject.js'\nexport {\n deepMerge,\n deepMergeWithCombinedArrays,\n deepMergeWithReactComponents,\n deepMergeWithSourceArrays,\n} from './utilities/deepMerge.js'\nexport {\n checkDependencies,\n type CustomVersionParser,\n} from './utilities/dependencies/dependencyChecker.js'\nexport { getDependencies } from './utilities/dependencies/getDependencies.js'\nexport { dynamicImport } from './utilities/dynamicImport.js'\nexport { escapeRegExp } from './utilities/escapeRegExp.js'\nexport {\n findUp,\n findUpSync,\n pathExistsAndIsAccessible,\n pathExistsAndIsAccessibleSync,\n} from './utilities/findUp.js'\nexport { flattenAllFields } from './utilities/flattenAllFields.js'\nexport { flattenTopLevelFields } from './utilities/flattenTopLevelFields.js'\nexport { formatErrors } from './utilities/formatErrors.js'\nexport { formatLabels, formatNames, toWords } from './utilities/formatLabels.js'\nexport { getBlockSelect } from './utilities/getBlockSelect.js'\nexport { getCollectionIDFieldTypes } from './utilities/getCollectionIDFieldTypes.js'\nexport { getFieldByPath } from './utilities/getFieldByPath.js'\nexport { getObjectDotNotation } from './utilities/getObjectDotNotation.js'\nexport { getRequestLanguage } from './utilities/getRequestLanguage.js'\nexport { handleEndpoints } from './utilities/handleEndpoints.js'\nexport { headersWithCors } from './utilities/headersWithCors.js'\nexport { initTransaction } from './utilities/initTransaction.js'\nexport { isEntityHidden } from './utilities/isEntityHidden.js'\nexport { isolateObjectProperty } from './utilities/isolateObjectProperty.js'\nexport { isPlainObject } from './utilities/isPlainObject.js'\nexport { isValidID } from './utilities/isValidID.js'\nexport { killTransaction } from './utilities/killTransaction.js'\nexport { logError } from './utilities/logError.js'\nexport { defaultLoggerOptions } from './utilities/logger.js'\nexport type { PayloadLogger } from './utilities/logger.js'\nexport { mapAsync } from './utilities/mapAsync.js'\nexport { mergeHeaders } from './utilities/mergeHeaders.js'\nexport { parseDocumentID } from './utilities/parseDocumentID.js'\nexport { sanitizeFallbackLocale } from './utilities/sanitizeFallbackLocale.js'\nexport { sanitizeJoinParams } from './utilities/sanitizeJoinParams.js'\nexport { sanitizePopulateParam } from './utilities/sanitizePopulateParam.js'\nexport { sanitizeSelectParam } from './utilities/sanitizeSelectParam.js'\nexport { stripUnselectedFields } from './utilities/stripUnselectedFields.js'\nexport { traverseFields } from './utilities/traverseFields.js'\nexport type { TraverseFieldsCallback } from './utilities/traverseFields.js'\nexport { buildVersionCollectionFields } from './versions/buildCollectionFields.js'\nexport { buildVersionGlobalFields } from './versions/buildGlobalFields.js'\nexport { buildVersionCompoundIndexes } from './versions/buildVersionCompoundIndexes.js'\nexport { versionDefaults } from './versions/defaults.js'\nexport { deleteCollectionVersions } from './versions/deleteCollectionVersions.js'\n\nexport { appendVersionToQueryKey } from './versions/drafts/appendVersionToQueryKey.js'\nexport { getQueryDraftsSort } from './versions/drafts/getQueryDraftsSort.js'\nexport { enforceMaxVersions } from './versions/enforceMaxVersions.js'\nexport { getLatestCollectionVersion } from './versions/getLatestCollectionVersion.js'\nexport { getLatestGlobalVersion } from './versions/getLatestGlobalVersion.js'\nexport { localizeStatus } from './versions/migrations/localizeStatus/index.js'\nexport type {\n MongoLocalizeStatusArgs,\n SqlLocalizeStatusArgs,\n} from './versions/migrations/localizeStatus/index.js'\nexport { saveVersion } from './versions/saveVersion.js'\nexport type { SchedulePublishTaskInput } from './versions/schedule/types.js'\n\nexport type { SchedulePublish, TypeWithVersion } from './versions/types.js'\nexport { deepMergeSimple } from '@payloadcms/translations/utilities'\n"],"names":["spawn","crypto","fileURLToPath","path","WebSocket","forgotPasswordLocal","loginLocal","resetPasswordLocal","unlockLocal","verifyEmailLocal","countLocal","createLocal","deleteLocal","duplicateLocal","findLocal","findByIDLocal","findDistinct","findDistinctLocal","findVersionByIDLocal","findVersionsLocal","restoreVersionLocal","updateLocal","countGlobalVersionsLocal","findOneGlobalLocal","findGlobalVersionByIDLocal","findGlobalVersionsLocal","restoreGlobalVersionLocal","updateGlobalLocal","EntityType","Cron","decrypt","encrypt","authLocal","APIKeyAuthentication","JWTAuthentication","generateImportMap","checkPayloadDependencies","countVersionsLocal","consoleEmailAdapter","normalizeSendEmailOptions","fieldAffectsData","getJobsLocalAPI","_internal_jobSystemGlobals","formatAdminURL","isNextBuild","getLogger","serverInit","serverInitTelemetry","traverseFields","accountLockFields","baseAccountLockFields","apiKeyFields","baseAPIKeyFields","baseAuthFields","emailFieldConfig","baseEmailField","sessionsFieldConfig","baseSessionsField","usernameFieldConfig","baseUsernameField","verificationFields","baseVerificationFields","executeAccess","executeAuthStrategies","extractAccessFromPermission","getAccessResults","getFieldsToSign","getLoginOptions","filename","url","dirname","checkedDependencies","BasePayload","auth","options","authStrategies","blocks","collections","config","count","countGlobalVersions","countVersions","create","crons","db","destroy","length","cronsToStop","splice","Promise","all","map","cron","stop","duplicate","email","extensions","find","findByID","findGlobal","findGlobalVersionByID","findGlobalVersions","findVersionByID","findVersions","forgotPassword","getAdminURL","adminRoute","routes","admin","serverURL","getAPIURL","apiRoute","api","globals","importMap","jobs","kv","logger","login","resetPassword","restoreGlobalVersion","restoreVersion","schema","secret","sendEmail","types","unlock","updateGlobal","validationRules","verifyEmail","versions","_initializeCrons","enabled","autoRun","DEFAULT_CRON","DEFAULT_LIMIT","cronJobs","cronConfig","jobAutorunCron","shouldAutoSchedule","disableScheduling","scheduling","handleSchedules","allQueues","queue","shouldAutoRun","run","limit","silent","catch","err","error","msg","protect","sloppyRanges","push","bin","args","cwd","log","resolve","reject","spawned","stdio","undefined","on","code","delete","init","process","env","NODE_ENV","PAYLOAD_DISABLE_DEPENDENCY_CHECKER","Error","createHash","update","digest","slice","collection","customIDType","findCustomID","field","includes","type","name","callback","fields","parentIsLocalized","slug","reduce","block","typescript","autoGenerate","payload","disableDBConnect","connect","awaitedAdapter","NEXT_PHASE","warn","sharp","some","c","upload","imageSizes","formatOptions","VERCEL","uploadCollWithoutAdapter","filter","adapter","slugs","join","adapterSendEmail","message","jwtStrategyEnabled","strategies","useAPIKey","authenticate","disableLocalStrategy","disableOnInit","onInit","initialized","reload","skipImportMapGeneration","ignoreResolveError","hotReload","global","_payload_clientConfigs","_payload_schemaMap","_payload_clientSchemaMap","_payload_doNotCacheClientConfig","_payload_doNotCacheSchemaMap","_payload_doNotCacheClientSchemaMap","_cached","_payload","Map","getPayload","alreadyCachedSameConfig","cached","get","key","initializedCrons","Boolean","promise","ws","set","res","DISABLE_PAYLOAD_HMR","port","PORT","hasHTTPS","USE_HTTPS","argv","protocol","prefix","__NEXT_ASSET_PREFIX","PAYLOAD_HMR_URL_OVERRIDE","onmessage","event","data","JSON","parse","action","onerror","_","e","payloadInitError","jwtSign","accessOperation","forgotPasswordOperation","initOperation","checkLoginPermission","loginOperation","logoutOperation","meOperation","refreshOperation","registerFirstUserOperation","resetPasswordOperation","unlockOperation","verifyEmailOperation","incrementLoginAttempts","resetLoginAttempts","genImportMapIterateFields","migrate","migrateCLI","createClientCollectionConfig","createClientCollectionConfigs","createDataloaderCacheKey","getDataLoader","countOperation","createOperation","deleteOperation","deleteByIDOperation","docAccessOperation","duplicateOperation","findOperation","findByIDOperation","findVersionByIDOperation","findVersionsOperation","restoreVersionOperation","updateOperation","updateByIDOperation","buildConfig","createClientConfig","createUnauthenticatedClientConfig","serverOnlyAdminConfigProperties","serverOnlyConfigProperties","defaults","definePlugin","sanitizeConfig","combineQueries","createDatabaseAdapter","defaultBeginTransaction","flattenWhereToOperators","getLocalizedPaths","createMigration","findMigrationDir","getMigrations","getPredefinedMigration","migrateDown","migrateRefresh","migrateReset","migrateStatus","migrationsCollection","migrationTemplate","readMigrationFiles","writeMigrationIndex","validateQueryPaths","validateSearchParam","APIError","APIErrorName","AuthenticationError","DuplicateCollection","DuplicateFieldName","DuplicateGlobal","ErrorDeletingFile","FileRetrievalError","FileUploadError","Forbidden","InvalidConfiguration","InvalidFieldName","InvalidFieldRelationship","Locked","LockedAuth","MissingCollectionLabel","MissingEditorProp","MissingFieldInputOptions","MissingFieldType","MissingFile","NotFound","QueryError","UnauthorizedError","UnverifiedEmail","ValidationError","ValidationErrorName","baseBlockFields","baseIDField","slugField","createClientBlocks","createClientField","createClientFields","sanitizeField","sanitizeFields","getDefaultValue","afterChangeTraverseFields","afterReadPromise","afterReadTraverseFields","beforeChangeTraverseFields","beforeValidateTraverseFields","sortableFieldTypes","validateBlocksFilterOptions","validations","getFolderData","createClientGlobalConfig","createClientGlobalConfigs","docAccessOperationGlobal","findOneOperation","findVersionByIDOperationGlobal","findVersionsOperationGlobal","restoreVersionOperationGlobal","updateOperationGlobal","jobAfterRead","JobCancelledError","countRunnableOrActiveJobsForQueue","importHandlerPath","_internal_resetJobSystemGlobals","getCurrentDate","getLocalI18n","getFileByPath","_internal_safeFetchGlobal","addDataAndFileToRequest","addLocalesToRequestFromData","sanitizeLocales","canAccessAdmin","commitTransaction","configToJSONSchema","entityToJSONSchema","fieldsToJSONSchema","withNullableJSONSchemaType","createArrayFromCommaDelineated","createLocalReq","createPayloadRequest","deepCopyObject","deepCopyObjectComplex","deepCopyObjectSimple","deepMerge","deepMergeWithCombinedArrays","deepMergeWithReactComponents","deepMergeWithSourceArrays","checkDependencies","getDependencies","dynamicImport","escapeRegExp","findUp","findUpSync","pathExistsAndIsAccessible","pathExistsAndIsAccessibleSync","flattenAllFields","flattenTopLevelFields","formatErrors","formatLabels","formatNames","toWords","getBlockSelect","getCollectionIDFieldTypes","getFieldByPath","getObjectDotNotation","getRequestLanguage","handleEndpoints","headersWithCors","initTransaction","isEntityHidden","isolateObjectProperty","isPlainObject","isValidID","killTransaction","logError","defaultLoggerOptions","mapAsync","mergeHeaders","parseDocumentID","sanitizeFallbackLocale","sanitizeJoinParams","sanitizePopulateParam","sanitizeSelectParam","stripUnselectedFields","buildVersionCollectionFields","buildVersionGlobalFields","buildVersionCompoundIndexes","versionDefaults","deleteCollectionVersions","appendVersionToQueryKey","getQueryDraftsSort","enforceMaxVersions","getLatestCollectionVersion","getLatestGlobalV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,CAAA;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sDAAsD,CAAA;AAC7F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAK/C;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CAAC,EACxC,KAAK,EACL,GAAG,EACH,MAAc,EACd,SAAS,GACV,EAAE;IACD,KAAK,EAAE,aAAa,CAAA;IACpB,GAAG,EAAE,cAAc,CAAA;IACnB;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,aAAa,CAAA;IACtB,SAAS,EAAE,iBAAiB,CAAA;CAC7B,GAAG,OAAO,CAAC;IACV,aAAa,EAAE,OAAO,CAAA;CACvB,CAAC,
|
|
1
|
+
{"version":3,"file":"handleWorkflowError.d.ts","sourceRoot":"","sources":["../../../src/queues/errors/handleWorkflowError.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sDAAsD,CAAA;AAC7F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAK/C;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CAAC,EACxC,KAAK,EACL,GAAG,EACH,MAAc,EACd,SAAS,GACV,EAAE;IACD,KAAK,EAAE,aAAa,CAAA;IACpB,GAAG,EAAE,cAAc,CAAA;IACnB;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,aAAa,CAAA;IACtB,SAAS,EAAE,iBAAiB,CAAA;CAC7B,GAAG,OAAO,CAAC;IACV,aAAa,EAAE,OAAO,CAAA;CACvB,CAAC,CA6DD"}
|
|
@@ -15,7 +15,15 @@ import { getWorkflowRetryBehavior } from './getWorkflowRetryBehavior.js';
|
|
|
15
15
|
message: error.message,
|
|
16
16
|
stack: error.stack
|
|
17
17
|
};
|
|
18
|
-
|
|
18
|
+
// No retries configured => permanently fail. Errors reaching this handler are
|
|
19
|
+
// workflow-level (task errors are routed to handleTaskError first), so there's
|
|
20
|
+
// nothing else to bound them.
|
|
21
|
+
const hasNoRetriesConfigured = workflowConfig.retries === undefined || workflowConfig.retries === null;
|
|
22
|
+
const { hasFinalError, maxWorkflowRetries, waitUntil } = hasNoRetriesConfigured ? {
|
|
23
|
+
hasFinalError: true,
|
|
24
|
+
maxWorkflowRetries: undefined,
|
|
25
|
+
waitUntil: undefined
|
|
26
|
+
} : getWorkflowRetryBehavior({
|
|
19
27
|
job,
|
|
20
28
|
retriesConfig: workflowConfig.retries
|
|
21
29
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/queues/errors/handleWorkflowError.ts"],"sourcesContent":["import type { PayloadRequest } from '../../index.js'\nimport type { RunJobsSilent } from '../localAPI.js'\nimport type { UpdateJobFunction } from '../operations/runJobs/runJob/getUpdateJobFunction.js'\nimport type { WorkflowError } from './index.js'\n\nimport { getCurrentDate } from '../utilities/getCurrentDate.js'\nimport { getWorkflowRetryBehavior } from './getWorkflowRetryBehavior.js'\n\n/**\n * This is called if a workflow catches an error. It determines if it's a final error\n * or not and handles logging.\n * A Workflow error = error that happens anywhere in between running tasks.\n *\n * This function assumes that the error is not a TaskError, but a WorkflowError. If a task errors,\n * only a TaskError should be thrown, not a WorkflowError.\n */\nexport async function handleWorkflowError({\n error,\n req,\n silent = false,\n updateJob,\n}: {\n error: WorkflowError\n req: PayloadRequest\n /**\n * If set to true, the job system will not log any output to the console (for both info and error logs).\n * Can be an option for more granular control over logging.\n *\n * This will not automatically affect user-configured logs (e.g. if you call `console.log` or `payload.logger.info` in your job code).\n *\n * @default false\n */\n silent?: RunJobsSilent\n updateJob: UpdateJobFunction\n}): Promise<{\n hasFinalError: boolean\n}> {\n const { job, workflowConfig } = error.args\n\n const errorJSON = {\n name: error.name,\n cancelled: Boolean('cancelled' in error && error.cancelled),\n message: error.message,\n stack: error.stack,\n }\n\n const { hasFinalError, maxWorkflowRetries, waitUntil } = getWorkflowRetryBehavior({\n
|
|
1
|
+
{"version":3,"sources":["../../../src/queues/errors/handleWorkflowError.ts"],"sourcesContent":["import type { PayloadRequest } from '../../index.js'\nimport type { RunJobsSilent } from '../localAPI.js'\nimport type { UpdateJobFunction } from '../operations/runJobs/runJob/getUpdateJobFunction.js'\nimport type { WorkflowError } from './index.js'\n\nimport { getCurrentDate } from '../utilities/getCurrentDate.js'\nimport { getWorkflowRetryBehavior } from './getWorkflowRetryBehavior.js'\n\n/**\n * This is called if a workflow catches an error. It determines if it's a final error\n * or not and handles logging.\n * A Workflow error = error that happens anywhere in between running tasks.\n *\n * This function assumes that the error is not a TaskError, but a WorkflowError. If a task errors,\n * only a TaskError should be thrown, not a WorkflowError.\n */\nexport async function handleWorkflowError({\n error,\n req,\n silent = false,\n updateJob,\n}: {\n error: WorkflowError\n req: PayloadRequest\n /**\n * If set to true, the job system will not log any output to the console (for both info and error logs).\n * Can be an option for more granular control over logging.\n *\n * This will not automatically affect user-configured logs (e.g. if you call `console.log` or `payload.logger.info` in your job code).\n *\n * @default false\n */\n silent?: RunJobsSilent\n updateJob: UpdateJobFunction\n}): Promise<{\n hasFinalError: boolean\n}> {\n const { job, workflowConfig } = error.args\n\n const errorJSON = {\n name: error.name,\n cancelled: Boolean('cancelled' in error && error.cancelled),\n message: error.message,\n stack: error.stack,\n }\n\n // No retries configured => permanently fail. Errors reaching this handler are\n // workflow-level (task errors are routed to handleTaskError first), so there's\n // nothing else to bound them.\n const hasNoRetriesConfigured =\n workflowConfig.retries === undefined || workflowConfig.retries === null\n\n const { hasFinalError, maxWorkflowRetries, waitUntil } = hasNoRetriesConfigured\n ? { hasFinalError: true, maxWorkflowRetries: undefined, waitUntil: undefined }\n : getWorkflowRetryBehavior({\n job,\n retriesConfig: workflowConfig.retries,\n })\n\n if (!hasFinalError) {\n if (job.waitUntil) {\n // Check if waitUntil is in the past\n const waitUntil = new Date(job.waitUntil)\n if (waitUntil < getCurrentDate()) {\n // Outdated waitUntil, remove it\n delete job.waitUntil\n }\n }\n\n // Update job's waitUntil only if this waitUntil is later than the current one\n if (waitUntil && (!job.waitUntil || waitUntil > new Date(job.waitUntil))) {\n job.waitUntil = waitUntil.toISOString()\n }\n }\n\n const jobLabel = job.workflowSlug || `Task: ${job.taskSlug}`\n\n if (!silent || (typeof silent === 'object' && !silent.error)) {\n req.payload.logger.error({\n err: error,\n msg: `Error running job ${jobLabel} id: ${job.id} attempt ${job.totalTried + 1}${maxWorkflowRetries !== undefined ? '/' + (maxWorkflowRetries + 1) : ''}`,\n })\n }\n\n // Tasks update the job if they error - but in case there is an unhandled error (e.g. in the workflow itself, not in a task)\n // we need to ensure the job is updated to reflect the error\n await updateJob({\n error: errorJSON,\n hasError: hasFinalError, // If reached max retries => final error. If hasError is true this job will not be retried\n processing: false,\n totalTried: (job.totalTried ?? 0) + 1,\n waitUntil: job.waitUntil,\n })\n\n return {\n hasFinalError,\n }\n}\n"],"names":["getCurrentDate","getWorkflowRetryBehavior","handleWorkflowError","error","req","silent","updateJob","job","workflowConfig","args","errorJSON","name","cancelled","Boolean","message","stack","hasNoRetriesConfigured","retries","undefined","hasFinalError","maxWorkflowRetries","waitUntil","retriesConfig","Date","toISOString","jobLabel","workflowSlug","taskSlug","payload","logger","err","msg","id","totalTried","hasError","processing"],"mappings":"AAKA,SAASA,cAAc,QAAQ,iCAAgC;AAC/D,SAASC,wBAAwB,QAAQ,gCAA+B;AAExE;;;;;;;CAOC,GACD,OAAO,eAAeC,oBAAoB,EACxCC,KAAK,EACLC,GAAG,EACHC,SAAS,KAAK,EACdC,SAAS,EAcV;IAGC,MAAM,EAAEC,GAAG,EAAEC,cAAc,EAAE,GAAGL,MAAMM,IAAI;IAE1C,MAAMC,YAAY;QAChBC,MAAMR,MAAMQ,IAAI;QAChBC,WAAWC,QAAQ,eAAeV,SAASA,MAAMS,SAAS;QAC1DE,SAASX,MAAMW,OAAO;QACtBC,OAAOZ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,IAAI,CAAA,IAAK;QACpCZ,WAAWd,IAAIc,SAAS;IAC1B;IAEA,OAAO;QACLF;IACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/queues/operations/runJobs/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAG1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAarD,MAAM,MAAM,WAAW,GAAG;IACxB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,IAAI,CAAA;IACtB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,GAAG,EAAE,cAAc,CAAA;IACnB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,aAAa,CAAA;IACtB,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;IACxC;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;OAEG;IACH,wBAAwB,EAAE,MAAM,CAAA;CACjC,CAAA;AAED,eAAO,MAAM,OAAO,SAAgB,WAAW,KAAG,OAAO,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/queues/operations/runJobs/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAG1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAarD,MAAM,MAAM,WAAW,GAAG;IACxB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,IAAI,CAAA;IACtB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,GAAG,EAAE,cAAc,CAAA;IACnB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,aAAa,CAAA;IACtB,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;IACxC;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;OAEG;IACH,wBAAwB,EAAE,MAAM,CAAA;CACjC,CAAA;AAED,eAAO,MAAM,OAAO,SAAgB,WAAW,KAAG,OAAO,CAAC,aAAa,CA2dtE,CAAA"}
|
|
@@ -248,22 +248,45 @@ export const runJobs = async (args)=>{
|
|
|
248
248
|
throw new Error('Job must have either a workflowSlug or a taskSlug');
|
|
249
249
|
}
|
|
250
250
|
const jobReq = isolateObjectProperty(req, 'transactionID');
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
251
|
+
let workflowConfig = undefined;
|
|
252
|
+
if (job.workflowSlug && jobsConfig.workflows?.length) {
|
|
253
|
+
workflowConfig = jobsConfig.workflows.find(({ slug })=>slug === job.workflowSlug);
|
|
254
|
+
} else if (job.taskSlug && jobsConfig.tasks?.length) {
|
|
255
|
+
const taskExists = jobsConfig.tasks.some(({ slug })=>slug === job.taskSlug);
|
|
256
|
+
if (taskExists) {
|
|
257
|
+
workflowConfig = {
|
|
258
|
+
slug: 'singleTask',
|
|
259
|
+
handler: async ({ job, tasks })=>{
|
|
260
|
+
await tasks[job.taskSlug]('1', {
|
|
261
|
+
input: job.input
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
};
|
|
257
265
|
}
|
|
258
|
-
}
|
|
266
|
+
}
|
|
259
267
|
if (!workflowConfig) {
|
|
268
|
+
// Permanently fail jobs whose task/workflow slug is no longer registered in config — they can never complete.
|
|
269
|
+
const errorMessage = `${job.taskSlug ? `Task '${job.taskSlug}'` : `Workflow '${job.workflowSlug}'`} is not registered in payload.config.jobs.`;
|
|
270
|
+
if (!silent || typeof silent === 'object' && !silent.error) {
|
|
271
|
+
payload.logger.error({
|
|
272
|
+
msg: `Error running job ${job.workflowSlug || `Task: ${job.taskSlug}`} id: ${job.id} - ${errorMessage}`
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
const updateJob = getUpdateJobFunction(job, jobReq);
|
|
276
|
+
await updateJob({
|
|
277
|
+
error: {
|
|
278
|
+
message: errorMessage
|
|
279
|
+
},
|
|
280
|
+
hasError: true,
|
|
281
|
+
processing: false,
|
|
282
|
+
totalTried: (job.totalTried ?? 0) + 1
|
|
283
|
+
});
|
|
260
284
|
return {
|
|
261
285
|
id: job.id,
|
|
262
286
|
result: {
|
|
263
|
-
status: 'error'
|
|
287
|
+
status: 'error-reached-max-retries'
|
|
264
288
|
}
|
|
265
|
-
}
|
|
266
|
-
;
|
|
289
|
+
};
|
|
267
290
|
}
|
|
268
291
|
try {
|
|
269
292
|
const updateJob = getUpdateJobFunction(job, jobReq);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/queues/operations/runJobs/index.ts"],"sourcesContent":["import type { Job } from '../../../index.js'\nimport type { PayloadRequest, Sort, Where } from '../../../types/index.js'\nimport type { WorkflowJSON } from '../../config/types/workflowJSONTypes.js'\nimport type { WorkflowConfig, WorkflowHandler } from '../../config/types/workflowTypes.js'\nimport type { RunJobsSilent } from '../../localAPI.js'\nimport type { RunJobResult } from './runJob/index.js'\n\nimport { Forbidden } from '../../../errors/Forbidden.js'\nimport { isolateObjectProperty } from '../../../utilities/isolateObjectProperty.js'\nimport { jobsCollectionSlug } from '../../config/collection.js'\nimport { JobCancelledError } from '../../errors/index.js'\nimport { getCurrentDate } from '../../utilities/getCurrentDate.js'\nimport { updateJob, updateJobs } from '../../utilities/updateJob.js'\nimport { getUpdateJobFunction } from './runJob/getUpdateJobFunction.js'\nimport { importHandlerPath } from './runJob/importHandlerPath.js'\nimport { runJob } from './runJob/index.js'\nimport { runJSONJob } from './runJSONJob/index.js'\n\nexport type RunJobsArgs = {\n /**\n * If you want to run jobs from all queues, set this to true.\n * If you set this to true, the `queue` property will be ignored.\n *\n * @default false\n */\n allQueues?: boolean\n /**\n * ID of the job to run\n */\n id?: number | string\n /**\n * The maximum number of jobs to run in this invocation\n *\n * @default 10\n */\n limit?: number\n overrideAccess?: boolean\n /**\n * Adjust the job processing order\n *\n * FIFO would equal `createdAt` and LIFO would equal `-createdAt`.\n *\n * @default all jobs for all queues will be executed in FIFO order.\n */\n processingOrder?: Sort\n /**\n * If you want to run jobs from a specific queue, set this to the queue name.\n *\n * @default jobs from the `default` queue will be executed.\n */\n queue?: string\n req: PayloadRequest\n /**\n * By default, jobs are run in parallel.\n * If you want to run them in sequence, set this to true.\n */\n sequential?: boolean\n /**\n * If set to true, the job system will not log any output to the console (for both info and error logs).\n * Can be an option for more granular control over logging.\n *\n * This will not automatically affect user-configured logs (e.g. if you call `console.log` or `payload.logger.info` in your job code).\n *\n * @default false\n */\n silent?: RunJobsSilent\n where?: Where\n}\n\nexport type RunJobsResult = {\n jobStatus?: Record<string, RunJobResult>\n /**\n * If this is true, there for sure are no jobs remaining, regardless of the limit\n */\n noJobsRemaining?: boolean\n /**\n * Out of the jobs that were queried & processed (within the set limit), how many are remaining and retryable?\n */\n remainingJobsFromQueried: number\n}\n\nexport const runJobs = async (args: RunJobsArgs): Promise<RunJobsResult> => {\n const {\n id,\n allQueues = false,\n limit = 10,\n overrideAccess,\n processingOrder,\n queue = 'default',\n req,\n req: {\n payload,\n payload: {\n config: { jobs: jobsConfig },\n },\n },\n sequential,\n silent = false,\n where: whereFromProps,\n } = args\n\n if (!overrideAccess) {\n /**\n * By default, jobsConfig.access.run will be `defaultAccess` which is a function that returns `true` if the user is logged in.\n */\n const accessFn = jobsConfig?.access?.run ?? (() => true)\n const hasAccess = await accessFn({ req })\n if (!hasAccess) {\n throw new Forbidden(req.t)\n }\n }\n const and: Where[] = [\n {\n completedAt: {\n exists: false,\n },\n },\n {\n hasError: {\n not_equals: true,\n },\n },\n {\n processing: {\n equals: false,\n },\n },\n {\n or: [\n {\n waitUntil: {\n exists: false,\n },\n },\n {\n waitUntil: {\n less_than: getCurrentDate().toISOString(),\n },\n },\n ],\n },\n ]\n\n if (allQueues !== true) {\n and.push({\n queue: {\n equals: queue ?? 'default',\n },\n })\n }\n\n if (whereFromProps) {\n and.push(whereFromProps)\n }\n\n // Only enforce concurrency controls if the feature is enabled\n if (jobsConfig.enableConcurrencyControl) {\n // Find currently running jobs with concurrency keys to enforce exclusive concurrency\n // Jobs with the same concurrencyKey should not run in parallel\n const runningJobsWithConcurrency = await payload.db.find({\n collection: jobsCollectionSlug,\n limit: 0,\n pagination: false,\n req: { transactionID: undefined },\n select: {\n concurrencyKey: true,\n },\n where: {\n and: [{ processing: { equals: true } }, { concurrencyKey: { exists: true } }],\n },\n })\n\n const runningConcurrencyKeys = new Set<string>()\n if (runningJobsWithConcurrency?.docs) {\n for (const doc of runningJobsWithConcurrency.docs) {\n const concurrencyKey = (doc as Job).concurrencyKey\n if (concurrencyKey) {\n runningConcurrencyKeys.add(concurrencyKey)\n }\n }\n }\n\n // Exclude jobs whose concurrencyKey is already running\n if (runningConcurrencyKeys.size > 0) {\n and.push({\n or: [\n // Jobs without a concurrency key can always run\n { concurrencyKey: { exists: false } },\n // Jobs with a concurrency key that is not currently running can run\n { concurrencyKey: { not_in: [...runningConcurrencyKeys] } },\n ],\n })\n }\n }\n\n // Find all jobs and ensure we set job to processing: true as early as possible to reduce the chance of\n // the same job being picked up by another worker\n let jobs: Job[] = []\n\n if (id) {\n // Only one job to run\n const job = await updateJob({\n id,\n data: {\n processing: true,\n },\n depth: jobsConfig.depth,\n disableTransaction: true,\n req,\n returning: true,\n })\n if (job) {\n jobs = [job]\n }\n } else {\n let defaultProcessingOrder: Sort =\n payload.collections[jobsCollectionSlug]?.config.defaultSort ?? 'createdAt'\n\n const processingOrderConfig = jobsConfig.processingOrder\n if (typeof processingOrderConfig === 'function') {\n defaultProcessingOrder = await processingOrderConfig(args)\n } else if (typeof processingOrderConfig === 'object' && !Array.isArray(processingOrderConfig)) {\n if (\n !allQueues &&\n queue &&\n processingOrderConfig.queues &&\n processingOrderConfig.queues[queue]\n ) {\n defaultProcessingOrder = processingOrderConfig.queues[queue]\n } else if (processingOrderConfig.default) {\n defaultProcessingOrder = processingOrderConfig.default\n }\n } else if (typeof processingOrderConfig === 'string') {\n defaultProcessingOrder = processingOrderConfig\n }\n const updatedDocs = await updateJobs({\n data: {\n processing: true,\n },\n depth: jobsConfig.depth,\n disableTransaction: true,\n limit,\n req,\n returning: true,\n sort: processingOrder ?? defaultProcessingOrder,\n where: { and },\n })\n\n if (updatedDocs) {\n jobs = updatedDocs\n }\n }\n\n if (!jobs.length) {\n return {\n noJobsRemaining: true,\n remainingJobsFromQueried: 0,\n }\n }\n\n // Only handle concurrency deduplication if the feature is enabled\n if (jobsConfig.enableConcurrencyControl) {\n // Handle the case where multiple jobs with the same concurrencyKey were picked up in the same batch\n // We should only run one job per concurrencyKey, release the others back to pending\n const seenConcurrencyKeys = new Set<string>()\n const jobsToRun: Job[] = []\n const jobsToRelease: Job[] = []\n\n for (const job of jobs) {\n if (job.concurrencyKey) {\n if (seenConcurrencyKeys.has(job.concurrencyKey)) {\n // This job has the same concurrencyKey as another job we're already running\n jobsToRelease.push(job)\n } else {\n seenConcurrencyKeys.add(job.concurrencyKey)\n jobsToRun.push(job)\n }\n } else {\n jobsToRun.push(job)\n }\n }\n\n // Release duplicate concurrencyKey jobs back to pending state\n if (jobsToRelease.length > 0) {\n const releaseIds = jobsToRelease.map((job) => job.id)\n await updateJobs({\n data: { processing: false },\n disableTransaction: true,\n req,\n returning: false,\n where: { id: { in: releaseIds } },\n })\n }\n\n // Use only the filtered jobs going forward\n jobs = jobsToRun\n }\n\n if (!jobs.length) {\n return {\n noJobsRemaining: false,\n remainingJobsFromQueried: 0,\n }\n }\n\n if (!silent || (typeof silent === 'object' && !silent.info)) {\n let newCount = 0\n let retryCount = 0\n\n for (const job of jobs) {\n if (job.totalTried > 0) {\n retryCount++\n } else {\n newCount++\n }\n }\n\n payload.logger.info({\n msg: `Running ${jobs.length} jobs.`,\n new: newCount,\n retrying: retryCount,\n })\n }\n\n const successfullyCompletedJobs: (number | string)[] = []\n\n const runSingleJob = async (\n job: Job,\n ): Promise<{\n id: number | string\n result: RunJobResult\n }> => {\n if (!job.workflowSlug && !job.taskSlug) {\n throw new Error('Job must have either a workflowSlug or a taskSlug')\n }\n const jobReq = isolateObjectProperty(req, 'transactionID')\n\n const workflowConfig: WorkflowConfig =\n job.workflowSlug && jobsConfig.workflows?.length\n ? jobsConfig.workflows.find(({ slug }) => slug === job.workflowSlug)!\n : {\n slug: 'singleTask',\n handler: async ({ job, tasks }) => {\n await tasks[job.taskSlug as string]!('1', {\n input: job.input,\n })\n },\n }\n\n if (!workflowConfig) {\n return {\n id: job.id,\n result: {\n status: 'error',\n },\n } // Skip jobs with no workflow configuration\n }\n\n try {\n const updateJob = getUpdateJobFunction(job, jobReq)\n\n // the runner will either be passed to the config\n // OR it will be a path, which we will need to import via eval to avoid\n // Next.js compiler dynamic import expression errors\n let workflowHandler: WorkflowHandler | WorkflowJSON\n if (\n typeof workflowConfig.handler === 'function' ||\n (typeof workflowConfig.handler === 'object' && Array.isArray(workflowConfig.handler))\n ) {\n workflowHandler = workflowConfig.handler\n } else {\n workflowHandler = await importHandlerPath<typeof workflowHandler>(workflowConfig.handler)\n\n if (!workflowHandler) {\n const jobLabel = job.workflowSlug || `Task: ${job.taskSlug}`\n const errorMessage = `Can't find runner while importing with the path ${workflowConfig.handler} in job type ${jobLabel}.`\n if (!silent || (typeof silent === 'object' && !silent.error)) {\n payload.logger.error(errorMessage)\n }\n\n await updateJob({\n error: {\n error: errorMessage,\n },\n hasError: true,\n processing: false,\n })\n\n return {\n id: job.id,\n result: {\n status: 'error-reached-max-retries',\n },\n }\n }\n }\n\n if (typeof workflowHandler === 'function') {\n const result = await runJob({\n job,\n req: jobReq,\n silent,\n updateJob,\n workflowConfig,\n workflowHandler,\n })\n\n if (result.status === 'success') {\n successfullyCompletedJobs.push(job.id)\n }\n\n return { id: job.id, result }\n } else {\n const result = await runJSONJob({\n job,\n req: jobReq,\n silent,\n updateJob,\n workflowConfig,\n workflowHandler,\n })\n\n if (result.status === 'success') {\n successfullyCompletedJobs.push(job.id)\n }\n\n return { id: job.id, result }\n }\n } catch (error) {\n if (error instanceof JobCancelledError) {\n if (\n !(job.error as Record<string, unknown> | undefined)?.cancelled ||\n !job.hasError ||\n job.processing ||\n job.completedAt ||\n job.waitUntil\n ) {\n // When using the local API to cancel jobs, the local API will update the job data for us to ensure the job is cancelled.\n // But when throwing a JobCancelledError within a task or workflow handler, we are responsible for updating the job data ourselves.\n await updateJob({\n id: job.id,\n data: {\n completedAt: null,\n error: {\n cancelled: true,\n message: error.message,\n },\n hasError: true,\n processing: false,\n waitUntil: null,\n },\n depth: 0,\n disableTransaction: true,\n req,\n returning: false,\n })\n }\n\n return {\n id: job.id,\n result: {\n status: 'error-reached-max-retries',\n },\n }\n }\n throw error\n }\n }\n\n let resultsArray: { id: number | string; result: RunJobResult }[] = []\n if (sequential) {\n for (const job of jobs) {\n const result = await runSingleJob(job)\n if (result) {\n resultsArray.push(result)\n }\n }\n } else {\n const jobPromises = jobs.map(runSingleJob)\n resultsArray = (await Promise.all(jobPromises)) as {\n id: number | string\n result: RunJobResult\n }[]\n }\n\n if (jobsConfig.deleteJobOnComplete && successfullyCompletedJobs.length) {\n try {\n if (jobsConfig.runHooks) {\n await payload.delete({\n collection: jobsCollectionSlug,\n depth: 0, // can be 0 since we're not returning anything\n disableTransaction: true,\n where: { id: { in: successfullyCompletedJobs } },\n })\n } else {\n await payload.db.deleteMany({\n collection: jobsCollectionSlug,\n where: { id: { in: successfullyCompletedJobs } },\n })\n }\n } catch (err) {\n if (!silent || (typeof silent === 'object' && !silent.error)) {\n payload.logger.error({\n err,\n msg: `Failed to delete jobs ${successfullyCompletedJobs.join(', ')} on complete`,\n })\n }\n }\n }\n\n const resultsObject: RunJobsResult['jobStatus'] = resultsArray.reduce(\n (acc, cur) => {\n if (cur !== null) {\n // Check if there's a valid result to include\n acc[cur.id] = cur.result\n }\n return acc\n },\n {} as Record<string, RunJobResult>,\n )\n\n let remainingJobsFromQueried = 0\n for (const jobID in resultsObject) {\n const jobResult = resultsObject[jobID]\n if (jobResult?.status === 'error') {\n remainingJobsFromQueried++ // Can be retried\n }\n }\n\n return {\n jobStatus: resultsObject,\n remainingJobsFromQueried,\n }\n}\n"],"names":["Forbidden","isolateObjectProperty","jobsCollectionSlug","JobCancelledError","getCurrentDate","updateJob","updateJobs","getUpdateJobFunction","importHandlerPath","runJob","runJSONJob","runJobs","args","id","allQueues","limit","overrideAccess","processingOrder","queue","req","payload","config","jobs","jobsConfig","sequential","silent","where","whereFromProps","accessFn","access","run","hasAccess","t","and","completedAt","exists","hasError","not_equals","processing","equals","or","waitUntil","less_than","toISOString","push","enableConcurrencyControl","runningJobsWithConcurrency","db","find","collection","pagination","transactionID","undefined","select","concurrencyKey","runningConcurrencyKeys","Set","docs","doc","add","size","not_in","job","data","depth","disableTransaction","returning","defaultProcessingOrder","collections","defaultSort","processingOrderConfig","Array","isArray","queues","default","updatedDocs","sort","length","noJobsRemaining","remainingJobsFromQueried","seenConcurrencyKeys","jobsToRun","jobsToRelease","has","releaseIds","map","in","info","newCount","retryCount","totalTried","logger","msg","new","retrying","successfullyCompletedJobs","runSingleJob","workflowSlug","taskSlug","Error","jobReq","workflowConfig","workflows","slug","handler","tasks","input","result","status","workflowHandler","jobLabel","errorMessage","error","cancelled","message","resultsArray","jobPromises","Promise","all","deleteJobOnComplete","runHooks","delete","deleteMany","err","join","resultsObject","reduce","acc","cur","jobID","jobResult","jobStatus"],"mappings":"AAOA,SAASA,SAAS,QAAQ,+BAA8B;AACxD,SAASC,qBAAqB,QAAQ,8CAA6C;AACnF,SAASC,kBAAkB,QAAQ,6BAA4B;AAC/D,SAASC,iBAAiB,QAAQ,wBAAuB;AACzD,SAASC,cAAc,QAAQ,oCAAmC;AAClE,SAASC,SAAS,EAAEC,UAAU,QAAQ,+BAA8B;AACpE,SAASC,oBAAoB,QAAQ,mCAAkC;AACvE,SAASC,iBAAiB,QAAQ,gCAA+B;AACjE,SAASC,MAAM,QAAQ,oBAAmB;AAC1C,SAASC,UAAU,QAAQ,wBAAuB;AAiElD,OAAO,MAAMC,UAAU,OAAOC;IAC5B,MAAM,EACJC,EAAE,EACFC,YAAY,KAAK,EACjBC,QAAQ,EAAE,EACVC,cAAc,EACdC,eAAe,EACfC,QAAQ,SAAS,EACjBC,GAAG,EACHA,KAAK,EACHC,OAAO,EACPA,SAAS,EACPC,QAAQ,EAAEC,MAAMC,UAAU,EAAE,EAC7B,EACF,EACDC,UAAU,EACVC,SAAS,KAAK,EACdC,OAAOC,cAAc,EACtB,GAAGf;IAEJ,IAAI,CAACI,gBAAgB;QACnB;;KAEC,GACD,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4B,KAAK;YACZ,IAAI,CAAClG,UAAW,OAAOA,WAAW,YAAY,CAACA,OAAOuF,KAAK,EAAG;gBAC5D5F,QAAQuE,MAAM,CAACqB,KAAK,CAAC;oBACnBW;oBACA/B,KAAK,CAAC,sBAAsB,EAAEG,0BAA0B6B,IAAI,CAAC,MAAM,YAAY,CAAC;gBAClF;YACF;QACF;IACF;IAEA,MAAMC,gBAA4CV,aAAaW,MAAM,CACnE,CAACC,KAAKC;QACJ,IAAIA,QAAQ,MAAM;YAChB,6CAA6C;YAC7CD,GAAG,CAACC,IAAInH,EAAE,CAAC,GAAGmH,IAAIrB,MAAM;QAC1B;QACA,OAAOoB;IACT,GACA,CAAC;IAGH,IAAIhD,2BAA2B;IAC/B,IAAK,MAAMkD,SAASJ,cAAe;QACjC,MAAMK,YAAYL,aAAa,CAACI,MAAM;QACtC,IAAIC,WAAWtB,WAAW,SAAS;YACjC7B,4BAA2B,iBAAiB;QAC9C;IACF;IAEA,OAAO;QACLoD,WAAWN;QACX9C;IACF;AACF,EAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/queues/operations/runJobs/index.ts"],"sourcesContent":["import type { Job } from '../../../index.js'\nimport type { PayloadRequest, Sort, Where } from '../../../types/index.js'\nimport type { WorkflowJSON } from '../../config/types/workflowJSONTypes.js'\nimport type { WorkflowConfig, WorkflowHandler } from '../../config/types/workflowTypes.js'\nimport type { RunJobsSilent } from '../../localAPI.js'\nimport type { RunJobResult } from './runJob/index.js'\n\nimport { Forbidden } from '../../../errors/Forbidden.js'\nimport { isolateObjectProperty } from '../../../utilities/isolateObjectProperty.js'\nimport { jobsCollectionSlug } from '../../config/collection.js'\nimport { JobCancelledError } from '../../errors/index.js'\nimport { getCurrentDate } from '../../utilities/getCurrentDate.js'\nimport { updateJob, updateJobs } from '../../utilities/updateJob.js'\nimport { getUpdateJobFunction } from './runJob/getUpdateJobFunction.js'\nimport { importHandlerPath } from './runJob/importHandlerPath.js'\nimport { runJob } from './runJob/index.js'\nimport { runJSONJob } from './runJSONJob/index.js'\n\nexport type RunJobsArgs = {\n /**\n * If you want to run jobs from all queues, set this to true.\n * If you set this to true, the `queue` property will be ignored.\n *\n * @default false\n */\n allQueues?: boolean\n /**\n * ID of the job to run\n */\n id?: number | string\n /**\n * The maximum number of jobs to run in this invocation\n *\n * @default 10\n */\n limit?: number\n overrideAccess?: boolean\n /**\n * Adjust the job processing order\n *\n * FIFO would equal `createdAt` and LIFO would equal `-createdAt`.\n *\n * @default all jobs for all queues will be executed in FIFO order.\n */\n processingOrder?: Sort\n /**\n * If you want to run jobs from a specific queue, set this to the queue name.\n *\n * @default jobs from the `default` queue will be executed.\n */\n queue?: string\n req: PayloadRequest\n /**\n * By default, jobs are run in parallel.\n * If you want to run them in sequence, set this to true.\n */\n sequential?: boolean\n /**\n * If set to true, the job system will not log any output to the console (for both info and error logs).\n * Can be an option for more granular control over logging.\n *\n * This will not automatically affect user-configured logs (e.g. if you call `console.log` or `payload.logger.info` in your job code).\n *\n * @default false\n */\n silent?: RunJobsSilent\n where?: Where\n}\n\nexport type RunJobsResult = {\n jobStatus?: Record<string, RunJobResult>\n /**\n * If this is true, there for sure are no jobs remaining, regardless of the limit\n */\n noJobsRemaining?: boolean\n /**\n * Out of the jobs that were queried & processed (within the set limit), how many are remaining and retryable?\n */\n remainingJobsFromQueried: number\n}\n\nexport const runJobs = async (args: RunJobsArgs): Promise<RunJobsResult> => {\n const {\n id,\n allQueues = false,\n limit = 10,\n overrideAccess,\n processingOrder,\n queue = 'default',\n req,\n req: {\n payload,\n payload: {\n config: { jobs: jobsConfig },\n },\n },\n sequential,\n silent = false,\n where: whereFromProps,\n } = args\n\n if (!overrideAccess) {\n /**\n * By default, jobsConfig.access.run will be `defaultAccess` which is a function that returns `true` if the user is logged in.\n */\n const accessFn = jobsConfig?.access?.run ?? (() => true)\n const hasAccess = await accessFn({ req })\n if (!hasAccess) {\n throw new Forbidden(req.t)\n }\n }\n const and: Where[] = [\n {\n completedAt: {\n exists: false,\n },\n },\n {\n hasError: {\n not_equals: true,\n },\n },\n {\n processing: {\n equals: false,\n },\n },\n {\n or: [\n {\n waitUntil: {\n exists: false,\n },\n },\n {\n waitUntil: {\n less_than: getCurrentDate().toISOString(),\n },\n },\n ],\n },\n ]\n\n if (allQueues !== true) {\n and.push({\n queue: {\n equals: queue ?? 'default',\n },\n })\n }\n\n if (whereFromProps) {\n and.push(whereFromProps)\n }\n\n // Only enforce concurrency controls if the feature is enabled\n if (jobsConfig.enableConcurrencyControl) {\n // Find currently running jobs with concurrency keys to enforce exclusive concurrency\n // Jobs with the same concurrencyKey should not run in parallel\n const runningJobsWithConcurrency = await payload.db.find({\n collection: jobsCollectionSlug,\n limit: 0,\n pagination: false,\n req: { transactionID: undefined },\n select: {\n concurrencyKey: true,\n },\n where: {\n and: [{ processing: { equals: true } }, { concurrencyKey: { exists: true } }],\n },\n })\n\n const runningConcurrencyKeys = new Set<string>()\n if (runningJobsWithConcurrency?.docs) {\n for (const doc of runningJobsWithConcurrency.docs) {\n const concurrencyKey = (doc as Job).concurrencyKey\n if (concurrencyKey) {\n runningConcurrencyKeys.add(concurrencyKey)\n }\n }\n }\n\n // Exclude jobs whose concurrencyKey is already running\n if (runningConcurrencyKeys.size > 0) {\n and.push({\n or: [\n // Jobs without a concurrency key can always run\n { concurrencyKey: { exists: false } },\n // Jobs with a concurrency key that is not currently running can run\n { concurrencyKey: { not_in: [...runningConcurrencyKeys] } },\n ],\n })\n }\n }\n\n // Find all jobs and ensure we set job to processing: true as early as possible to reduce the chance of\n // the same job being picked up by another worker\n let jobs: Job[] = []\n\n if (id) {\n // Only one job to run\n const job = await updateJob({\n id,\n data: {\n processing: true,\n },\n depth: jobsConfig.depth,\n disableTransaction: true,\n req,\n returning: true,\n })\n if (job) {\n jobs = [job]\n }\n } else {\n let defaultProcessingOrder: Sort =\n payload.collections[jobsCollectionSlug]?.config.defaultSort ?? 'createdAt'\n\n const processingOrderConfig = jobsConfig.processingOrder\n if (typeof processingOrderConfig === 'function') {\n defaultProcessingOrder = await processingOrderConfig(args)\n } else if (typeof processingOrderConfig === 'object' && !Array.isArray(processingOrderConfig)) {\n if (\n !allQueues &&\n queue &&\n processingOrderConfig.queues &&\n processingOrderConfig.queues[queue]\n ) {\n defaultProcessingOrder = processingOrderConfig.queues[queue]\n } else if (processingOrderConfig.default) {\n defaultProcessingOrder = processingOrderConfig.default\n }\n } else if (typeof processingOrderConfig === 'string') {\n defaultProcessingOrder = processingOrderConfig\n }\n const updatedDocs = await updateJobs({\n data: {\n processing: true,\n },\n depth: jobsConfig.depth,\n disableTransaction: true,\n limit,\n req,\n returning: true,\n sort: processingOrder ?? defaultProcessingOrder,\n where: { and },\n })\n\n if (updatedDocs) {\n jobs = updatedDocs\n }\n }\n\n if (!jobs.length) {\n return {\n noJobsRemaining: true,\n remainingJobsFromQueried: 0,\n }\n }\n\n // Only handle concurrency deduplication if the feature is enabled\n if (jobsConfig.enableConcurrencyControl) {\n // Handle the case where multiple jobs with the same concurrencyKey were picked up in the same batch\n // We should only run one job per concurrencyKey, release the others back to pending\n const seenConcurrencyKeys = new Set<string>()\n const jobsToRun: Job[] = []\n const jobsToRelease: Job[] = []\n\n for (const job of jobs) {\n if (job.concurrencyKey) {\n if (seenConcurrencyKeys.has(job.concurrencyKey)) {\n // This job has the same concurrencyKey as another job we're already running\n jobsToRelease.push(job)\n } else {\n seenConcurrencyKeys.add(job.concurrencyKey)\n jobsToRun.push(job)\n }\n } else {\n jobsToRun.push(job)\n }\n }\n\n // Release duplicate concurrencyKey jobs back to pending state\n if (jobsToRelease.length > 0) {\n const releaseIds = jobsToRelease.map((job) => job.id)\n await updateJobs({\n data: { processing: false },\n disableTransaction: true,\n req,\n returning: false,\n where: { id: { in: releaseIds } },\n })\n }\n\n // Use only the filtered jobs going forward\n jobs = jobsToRun\n }\n\n if (!jobs.length) {\n return {\n noJobsRemaining: false,\n remainingJobsFromQueried: 0,\n }\n }\n\n if (!silent || (typeof silent === 'object' && !silent.info)) {\n let newCount = 0\n let retryCount = 0\n\n for (const job of jobs) {\n if (job.totalTried > 0) {\n retryCount++\n } else {\n newCount++\n }\n }\n\n payload.logger.info({\n msg: `Running ${jobs.length} jobs.`,\n new: newCount,\n retrying: retryCount,\n })\n }\n\n const successfullyCompletedJobs: (number | string)[] = []\n\n const runSingleJob = async (\n job: Job,\n ): Promise<{\n id: number | string\n result: RunJobResult\n }> => {\n if (!job.workflowSlug && !job.taskSlug) {\n throw new Error('Job must have either a workflowSlug or a taskSlug')\n }\n const jobReq = isolateObjectProperty(req, 'transactionID')\n\n let workflowConfig: undefined | WorkflowConfig = undefined\n\n if (job.workflowSlug && jobsConfig.workflows?.length) {\n workflowConfig = jobsConfig.workflows.find(({ slug }) => slug === job.workflowSlug)\n } else if (job.taskSlug && jobsConfig.tasks?.length) {\n const taskExists = jobsConfig.tasks.some(({ slug }) => slug === job.taskSlug)\n if (taskExists) {\n workflowConfig = {\n slug: 'singleTask',\n handler: async ({ job, tasks }) => {\n await tasks[job.taskSlug as string]!('1', {\n input: job.input,\n })\n },\n }\n }\n }\n\n if (!workflowConfig) {\n // Permanently fail jobs whose task/workflow slug is no longer registered in config — they can never complete.\n const errorMessage = `${job.taskSlug ? `Task '${job.taskSlug}'` : `Workflow '${job.workflowSlug}'`} is not registered in payload.config.jobs.`\n\n if (!silent || (typeof silent === 'object' && !silent.error)) {\n payload.logger.error({\n msg: `Error running job ${job.workflowSlug || `Task: ${job.taskSlug}`} id: ${job.id} - ${errorMessage}`,\n })\n }\n\n const updateJob = getUpdateJobFunction(job, jobReq)\n await updateJob({\n error: { message: errorMessage },\n hasError: true,\n processing: false,\n totalTried: (job.totalTried ?? 0) + 1,\n })\n\n return {\n id: job.id,\n result: {\n status: 'error-reached-max-retries',\n },\n }\n }\n\n try {\n const updateJob = getUpdateJobFunction(job, jobReq)\n\n // the runner will either be passed to the config\n // OR it will be a path, which we will need to import via eval to avoid\n // Next.js compiler dynamic import expression errors\n let workflowHandler: WorkflowHandler | WorkflowJSON\n if (\n typeof workflowConfig.handler === 'function' ||\n (typeof workflowConfig.handler === 'object' && Array.isArray(workflowConfig.handler))\n ) {\n workflowHandler = workflowConfig.handler\n } else {\n workflowHandler = await importHandlerPath<typeof workflowHandler>(workflowConfig.handler)\n\n if (!workflowHandler) {\n const jobLabel = job.workflowSlug || `Task: ${job.taskSlug}`\n const errorMessage = `Can't find runner while importing with the path ${workflowConfig.handler} in job type ${jobLabel}.`\n if (!silent || (typeof silent === 'object' && !silent.error)) {\n payload.logger.error(errorMessage)\n }\n\n await updateJob({\n error: {\n error: errorMessage,\n },\n hasError: true,\n processing: false,\n })\n\n return {\n id: job.id,\n result: {\n status: 'error-reached-max-retries',\n },\n }\n }\n }\n\n if (typeof workflowHandler === 'function') {\n const result = await runJob({\n job,\n req: jobReq,\n silent,\n updateJob,\n workflowConfig,\n workflowHandler,\n })\n\n if (result.status === 'success') {\n successfullyCompletedJobs.push(job.id)\n }\n\n return { id: job.id, result }\n } else {\n const result = await runJSONJob({\n job,\n req: jobReq,\n silent,\n updateJob,\n workflowConfig,\n workflowHandler,\n })\n\n if (result.status === 'success') {\n successfullyCompletedJobs.push(job.id)\n }\n\n return { id: job.id, result }\n }\n } catch (error) {\n if (error instanceof JobCancelledError) {\n if (\n !(job.error as Record<string, unknown> | undefined)?.cancelled ||\n !job.hasError ||\n job.processing ||\n job.completedAt ||\n job.waitUntil\n ) {\n // When using the local API to cancel jobs, the local API will update the job data for us to ensure the job is cancelled.\n // But when throwing a JobCancelledError within a task or workflow handler, we are responsible for updating the job data ourselves.\n await updateJob({\n id: job.id,\n data: {\n completedAt: null,\n error: {\n cancelled: true,\n message: error.message,\n },\n hasError: true,\n processing: false,\n waitUntil: null,\n },\n depth: 0,\n disableTransaction: true,\n req,\n returning: false,\n })\n }\n\n return {\n id: job.id,\n result: {\n status: 'error-reached-max-retries',\n },\n }\n }\n throw error\n }\n }\n\n let resultsArray: { id: number | string; result: RunJobResult }[] = []\n if (sequential) {\n for (const job of jobs) {\n const result = await runSingleJob(job)\n if (result) {\n resultsArray.push(result)\n }\n }\n } else {\n const jobPromises = jobs.map(runSingleJob)\n resultsArray = (await Promise.all(jobPromises)) as {\n id: number | string\n result: RunJobResult\n }[]\n }\n\n if (jobsConfig.deleteJobOnComplete && successfullyCompletedJobs.length) {\n try {\n if (jobsConfig.runHooks) {\n await payload.delete({\n collection: jobsCollectionSlug,\n depth: 0, // can be 0 since we're not returning anything\n disableTransaction: true,\n where: { id: { in: successfullyCompletedJobs } },\n })\n } else {\n await payload.db.deleteMany({\n collection: jobsCollectionSlug,\n where: { id: { in: successfullyCompletedJobs } },\n })\n }\n } catch (err) {\n if (!silent || (typeof silent === 'object' && !silent.error)) {\n payload.logger.error({\n err,\n msg: `Failed to delete jobs ${successfullyCompletedJobs.join(', ')} on complete`,\n })\n }\n }\n }\n\n const resultsObject: RunJobsResult['jobStatus'] = resultsArray.reduce(\n (acc, cur) => {\n if (cur !== null) {\n // Check if there's a valid result to include\n acc[cur.id] = cur.result\n }\n return acc\n },\n {} as Record<string, RunJobResult>,\n )\n\n let remainingJobsFromQueried = 0\n for (const jobID in resultsObject) {\n const jobResult = resultsObject[jobID]\n if (jobResult?.status === 'error') {\n remainingJobsFromQueried++ // Can be retried\n }\n }\n\n return {\n jobStatus: resultsObject,\n remainingJobsFromQueried,\n }\n}\n"],"names":["Forbidden","isolateObjectProperty","jobsCollectionSlug","JobCancelledError","getCurrentDate","updateJob","updateJobs","getUpdateJobFunction","importHandlerPath","runJob","runJSONJob","runJobs","args","id","allQueues","limit","overrideAccess","processingOrder","queue","req","payload","config","jobs","jobsConfig","sequential","silent","where","whereFromProps","accessFn","access","run","hasAccess","t","and","completedAt","exists","hasError","not_equals","processing","equals","or","waitUntil","less_than","toISOString","push","enableConcurrencyControl","runningJobsWithConcurrency","db","find","collection","pagination","transactionID","undefined","select","concurrencyKey","runningConcurrencyKeys","Set","docs","doc","add","size","not_in","job","data","depth","disableTransaction","returning","defaultProcessingOrder","collections","defaultSort","processingOrderConfig","Array","isArray","queues","default","updatedDocs","sort","length","noJobsRemaining","remainingJobsFromQueried","seenConcurrencyKeys","jobsToRun","jobsToRelease","has","releaseIds","map","in","info","newCount","retryCount","totalTried","logger","msg","new","retrying","successfullyCompletedJobs","runSingleJob","workflowSlug","taskSlug","Error","jobReq","workflowConfig","workflows","slug","tasks","taskExists","some","handler","input","errorMessage","error","message","result","status","workflowHandler","jobLabel","cancelled","resultsArray","jobPromises","Promise","all","deleteJobOnComplete","runHooks","delete","deleteMany","err","join","resultsObject","reduce","acc","cur","jobID","jobResult","jobStatus"],"mappings":"AAOA,SAASA,SAAS,QAAQ,+BAA8B;AACxD,SAASC,qBAAqB,QAAQ,8CAA6C;AACnF,SAASC,kBAAkB,QAAQ,6BAA4B;AAC/D,SAASC,iBAAiB,QAAQ,wBAAuB;AACzD,SAASC,cAAc,QAAQ,oCAAmC;AAClE,SAASC,SAAS,EAAEC,UAAU,QAAQ,+BAA8B;AACpE,SAASC,oBAAoB,QAAQ,mCAAkC;AACvE,SAASC,iBAAiB,QAAQ,gCAA+B;AACjE,SAASC,MAAM,QAAQ,oBAAmB;AAC1C,SAASC,UAAU,QAAQ,wBAAuB;AAiElD,OAAO,MAAMC,UAAU,OAAOC;IAC5B,MAAM,EACJC,EAAE,EACFC,YAAY,KAAK,EACjBC,QAAQ,EAAE,EACVC,cAAc,EACdC,eAAe,EACfC,QAAQ,SAAS,EACjBC,GAAG,EACHA,KAAK,EACHC,OAAO,EACPA,SAAS,EACPC,QAAQ,EAAEC,MAAMC,UAAU,EAAE,EAC7B,EACF,EACDC,UAAU,EACVC,SAAS,KAAK,EACdC,OAAOC,cAAc,EACtB,GAAGf;IAEJ,IAAI,CAACI,gBAAgB;QACnB;;KAEC,GACD,MAAMY,WAAWL,YAAYM,QAAQC,OAAQ,CAAA,IAAM,IAAG;QACtD,MAAMC,YAAY,MAAMH,SAAS;YAAET;QAAI;QACvC,IAAI,CAACY,WAAW;YACd,MAAM,IAAI/B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A2B;IAC/B,IAAK,MAAMoD,SAASJ,cAAe;QACjC,MAAMK,YAAYL,aAAa,CAACI,MAAM;QACtC,IAAIC,WAAWnB,WAAW,SAAS;YACjClC,4BAA2B,iBAAiB;QAC9C;IACF;IAEA,OAAO;QACLsD,WAAWN;QACXhD;IACF;AACF,EAAC"}
|
|
@@ -12,12 +12,17 @@ type Args = {
|
|
|
12
12
|
desiredFilename: string;
|
|
13
13
|
prefix?: string;
|
|
14
14
|
req: PayloadRequest;
|
|
15
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Filesystem path where uploads are stored. When omitted, only the database
|
|
17
|
+
* is consulted for filename conflicts - useful for cloud-storage adapters
|
|
18
|
+
* that have no local filesystem.
|
|
19
|
+
*/
|
|
20
|
+
staticPath?: string;
|
|
16
21
|
};
|
|
17
22
|
/**
|
|
18
|
-
* Generates a safe, unique filename by checking for conflicts in
|
|
19
|
-
* and
|
|
20
|
-
* unique name is found.
|
|
23
|
+
* Generates a safe, unique filename by checking for conflicts in the database
|
|
24
|
+
* and (when a `staticPath` is provided) the local filesystem. If a conflict
|
|
25
|
+
* exists, it increments a numeric suffix until a unique name is found.
|
|
21
26
|
*
|
|
22
27
|
* @param args.collectionSlug - The slug of the upload collection
|
|
23
28
|
* @param args.desiredFilename - The original filename to make safe
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSafeFilename.d.ts","sourceRoot":"","sources":["../../src/uploads/getSafeFilename.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAKvD;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,SAAU,MAAM,KAAG,MAe5C,CAAA;AAED,KAAK,IAAI,GAAG;IACV,cAAc,EAAE,MAAM,CAAA;IACtB,eAAe,EAAE,MAAM,CAAA;IACvB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,GAAG,EAAE,cAAc,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"getSafeFilename.d.ts","sourceRoot":"","sources":["../../src/uploads/getSafeFilename.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAKvD;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,SAAU,MAAM,KAAG,MAe5C,CAAA;AAED,KAAK,IAAI,GAAG;IACV,cAAc,EAAE,MAAM,CAAA;IACtB,eAAe,EAAE,MAAM,CAAA;IACvB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,GAAG,EAAE,cAAc,CAAA;IACnB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,eAAe,CAAC,EACpC,cAAc,EACd,eAAe,EACf,MAAM,EACN,GAAG,EACH,UAAU,GACX,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAiBxB"}
|
|
@@ -24,9 +24,9 @@ import { fileExists } from './fileExists.js';
|
|
|
24
24
|
return `${incrementedName}.${extension}`;
|
|
25
25
|
};
|
|
26
26
|
/**
|
|
27
|
-
* Generates a safe, unique filename by checking for conflicts in
|
|
28
|
-
* and
|
|
29
|
-
* unique name is found.
|
|
27
|
+
* Generates a safe, unique filename by checking for conflicts in the database
|
|
28
|
+
* and (when a `staticPath` is provided) the local filesystem. If a conflict
|
|
29
|
+
* exists, it increments a numeric suffix until a unique name is found.
|
|
30
30
|
*
|
|
31
31
|
* @param args.collectionSlug - The slug of the upload collection
|
|
32
32
|
* @param args.desiredFilename - The original filename to make safe
|
|
@@ -48,10 +48,10 @@ import { fileExists } from './fileExists.js';
|
|
|
48
48
|
while(await docWithFilenameExists({
|
|
49
49
|
collectionSlug,
|
|
50
50
|
filename: modifiedFilename,
|
|
51
|
-
path: staticPath,
|
|
51
|
+
path: staticPath ?? '',
|
|
52
52
|
prefix,
|
|
53
53
|
req
|
|
54
|
-
}) || await fileExists(`${staticPath}/${modifiedFilename}`)){
|
|
54
|
+
}) || (staticPath ? await fileExists(`${staticPath}/${modifiedFilename}`) : false)){
|
|
55
55
|
modifiedFilename = incrementName(modifiedFilename);
|
|
56
56
|
}
|
|
57
57
|
return modifiedFilename;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/uploads/getSafeFilename.ts"],"sourcesContent":["import sanitize from 'sanitize-filename'\n\nimport type { PayloadRequest } from '../types/index.js'\n\nimport { docWithFilenameExists } from './docWithFilenameExists.js'\nimport { fileExists } from './fileExists.js'\n\n/**\n * Increments a filename by appending or incrementing a numeric suffix.\n * @example\n * incrementName('file.jpg') // 'file-1.jpg'\n * incrementName('file-1.jpg') // 'file-2.jpg'\n * incrementName('file-99.jpg') // 'file-100.jpg'\n */\nexport const incrementName = (name: string): string => {\n const extension = name.split('.').pop()\n const baseFilename = sanitize(name.substring(0, name.lastIndexOf('.')) || name)\n let incrementedName = baseFilename\n const regex = /(.*)-(\\d+)$/\n const found = baseFilename.match(regex)\n if (found === null) {\n incrementedName += '-1'\n } else {\n const matchedName = found[1]\n const matchedNumber = found[2]\n const incremented = Number(matchedNumber) + 1\n incrementedName = `${matchedName}-${incremented}`\n }\n return `${incrementedName}.${extension}`\n}\n\ntype Args = {\n collectionSlug: string\n desiredFilename: string\n prefix?: string\n req: PayloadRequest\n staticPath
|
|
1
|
+
{"version":3,"sources":["../../src/uploads/getSafeFilename.ts"],"sourcesContent":["import sanitize from 'sanitize-filename'\n\nimport type { PayloadRequest } from '../types/index.js'\n\nimport { docWithFilenameExists } from './docWithFilenameExists.js'\nimport { fileExists } from './fileExists.js'\n\n/**\n * Increments a filename by appending or incrementing a numeric suffix.\n * @example\n * incrementName('file.jpg') // 'file-1.jpg'\n * incrementName('file-1.jpg') // 'file-2.jpg'\n * incrementName('file-99.jpg') // 'file-100.jpg'\n */\nexport const incrementName = (name: string): string => {\n const extension = name.split('.').pop()\n const baseFilename = sanitize(name.substring(0, name.lastIndexOf('.')) || name)\n let incrementedName = baseFilename\n const regex = /(.*)-(\\d+)$/\n const found = baseFilename.match(regex)\n if (found === null) {\n incrementedName += '-1'\n } else {\n const matchedName = found[1]\n const matchedNumber = found[2]\n const incremented = Number(matchedNumber) + 1\n incrementedName = `${matchedName}-${incremented}`\n }\n return `${incrementedName}.${extension}`\n}\n\ntype Args = {\n collectionSlug: string\n desiredFilename: string\n prefix?: string\n req: PayloadRequest\n /**\n * Filesystem path where uploads are stored. When omitted, only the database\n * is consulted for filename conflicts - useful for cloud-storage adapters\n * that have no local filesystem.\n */\n staticPath?: string\n}\n\n/**\n * Generates a safe, unique filename by checking for conflicts in the database\n * and (when a `staticPath` is provided) the local filesystem. If a conflict\n * exists, it increments a numeric suffix until a unique name is found.\n *\n * @param args.collectionSlug - The slug of the upload collection\n * @param args.desiredFilename - The original filename to make safe\n * @param args.prefix - Optional prefix path for cloud storage adapters\n * @param args.req - The Payload request object\n * @param args.staticPath - The filesystem path where uploads are stored\n * @returns A unique filename that doesn't conflict with existing files\n *\n * @example\n * // If 'photo.jpg' already exists, returns 'photo-1.jpg'\n * const safeName = await getSafeFileName({\n * collectionSlug: 'media',\n * desiredFilename: 'photo.jpg',\n * req,\n * staticPath: '/uploads/media',\n * })\n */\nexport async function getSafeFileName({\n collectionSlug,\n desiredFilename,\n prefix,\n req,\n staticPath,\n}: Args): Promise<string> {\n let modifiedFilename = desiredFilename\n\n while (\n (await docWithFilenameExists({\n collectionSlug,\n filename: modifiedFilename,\n path: staticPath ?? '',\n prefix,\n req,\n })) ||\n (staticPath ? await fileExists(`${staticPath}/${modifiedFilename}`) : false)\n ) {\n modifiedFilename = incrementName(modifiedFilename)\n }\n\n return modifiedFilename\n}\n"],"names":["sanitize","docWithFilenameExists","fileExists","incrementName","name","extension","split","pop","baseFilename","substring","lastIndexOf","incrementedName","regex","found","match","matchedName","matchedNumber","incremented","Number","getSafeFileName","collectionSlug","desiredFilename","prefix","req","staticPath","modifiedFilename","filename","path"],"mappings":"AAAA,OAAOA,cAAc,oBAAmB;AAIxC,SAASC,qBAAqB,QAAQ,6BAA4B;AAClE,SAASC,UAAU,QAAQ,kBAAiB;AAE5C;;;;;;CAMC,GACD,OAAO,MAAMC,gBAAgB,CAACC;IAC5B,MAAMC,YAAYD,KAAKE,KAAK,CAAC,KAAKC,GAAG;IACrC,MAAMC,eAAeR,SAASI,KAAKK,SAAS,CAAC,GAAGL,KAAKM,WAAW,CAAC,SAASN;IAC1E,IAAIO,kBAAkBH;IACtB,MAAMI,QAAQ;IACd,MAAMC,QAAQL,aAAaM,KAAK,CAACF;IACjC,IAAIC,UAAU,MAAM;QAClBF,mBAAmB;IACrB,OAAO;QACL,MAAMI,cAAcF,KAAK,CAAC,EAAE;QAC5B,MAAMG,gBAAgBH,KAAK,CAAC,EAAE;QAC9B,MAAMI,cAAcC,OAAOF,iBAAiB;QAC5CL,kBAAkB,GAAGI,YAAY,CAAC,EAAEE,aAAa;IACnD;IACA,OAAO,GAAGN,gBAAgB,CAAC,EAAEN,WAAW;AAC1C,EAAC;AAeD;;;;;;;;;;;;;;;;;;;;CAoBC,GACD,OAAO,eAAec,gBAAgB,EACpCC,cAAc,EACdC,eAAe,EACfC,MAAM,EACNC,GAAG,EACHC,UAAU,EACL;IACL,IAAIC,mBAAmBJ;IAEvB,MACE,AAAC,MAAMpB,sBAAsB;QAC3BmB;QACAM,UAAUD;QACVE,MAAMH,cAAc;QACpBF;QACAC;IACF,MACCC,CAAAA,aAAa,MAAMtB,WAAW,GAAGsB,WAAW,CAAC,EAAEC,kBAAkB,IAAI,KAAI,EAC1E;QACAA,mBAAmBtB,cAAcsB;IACnC;IAEA,OAAOA;AACT"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "payload",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.85.0",
|
|
4
4
|
"description": "Node, React, Headless CMS and Application Framework built on Next.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"admin panel",
|
|
@@ -113,16 +113,16 @@
|
|
|
113
113
|
"ts-essentials": "10.0.3",
|
|
114
114
|
"tsx": "4.21.0",
|
|
115
115
|
"undici": "7.24.4",
|
|
116
|
-
"uuid": "
|
|
116
|
+
"uuid": "13.0.2",
|
|
117
117
|
"ws": "^8.16.0",
|
|
118
|
-
"@payloadcms/translations": "3.
|
|
118
|
+
"@payloadcms/translations": "3.85.0"
|
|
119
119
|
},
|
|
120
120
|
"devDependencies": {
|
|
121
121
|
"@hyrious/esbuild-plugin-commonjs": "0.2.6",
|
|
122
122
|
"@monaco-editor/react": "4.7.0",
|
|
123
123
|
"@types/json-schema": "7.0.15",
|
|
124
124
|
"@types/minimist": "1.2.2",
|
|
125
|
-
"@types/nodemailer": "
|
|
125
|
+
"@types/nodemailer": "^8.0.0",
|
|
126
126
|
"@types/pluralize": "0.0.33",
|
|
127
127
|
"@types/range-parser": "1.2.7",
|
|
128
128
|
"@types/ws": "^8.5.10",
|