payload 3.54.0-internal.84621da → 3.54.0-internal.90cf7d5

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bin/index.ts"],"names":[],"mappings":"AA0BA,eAAO,MAAM,GAAG,qBAyBf,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bin/index.ts"],"names":[],"mappings":"AA0BA,eAAO,MAAM,GAAG,qBA6If,CAAA"}
package/dist/bin/index.js CHANGED
@@ -1,9 +1,10 @@
1
+ // @ts-strict-ignore
1
2
  /* eslint-disable no-console */ import { Cron } from 'croner';
2
3
  import minimist from 'minimist';
3
4
  import { pathToFileURL } from 'node:url';
4
5
  import path from 'path';
5
6
  import { findConfig } from '../config/find.js';
6
- import { getPayload } from '../index.js';
7
+ import payload, { getPayload } from '../index.js';
7
8
  import { generateImportMap } from './generateImportMap/index.js';
8
9
  import { generateTypes } from './generateTypes.js';
9
10
  import { info } from './info.js';
@@ -16,44 +17,16 @@ const availableScripts = [
16
17
  'generate:types',
17
18
  'info',
18
19
  'jobs:run',
19
- 'jobs:handle-schedules',
20
20
  'run',
21
21
  ...migrateCommands
22
22
  ];
23
23
  export const bin = async ()=>{
24
24
  loadEnv();
25
- process.env.DISABLE_PAYLOAD_HMR = 'true';
26
25
  const args = minimist(process.argv.slice(2));
27
26
  const script = (typeof args._[0] === 'string' ? args._[0] : '').toLowerCase();
28
- if (args.cron) {
29
- new Cron(args.cron, async ()=>{
30
- // If the bin script initializes payload (getPayload), this will only happen once, as getPayload
31
- // caches the payload instance on the module scope => no need to manually cache and manage getPayload initialization
32
- // outside the Cron here.
33
- await runBinScript({
34
- args,
35
- script
36
- });
37
- });
38
- process.stdin.resume() // Keep the process alive
39
- ;
40
- return;
41
- } else {
42
- const { payload } = await runBinScript({
43
- args,
44
- script
45
- });
46
- if (payload) {
47
- await payload.destroy() // close database connections after running jobs so process can exit cleanly
48
- ;
49
- }
50
- process.exit(0);
51
- }
52
- };
53
- async function runBinScript({ args, script }) {
54
27
  if (script === 'info') {
55
28
  await info();
56
- return {};
29
+ return;
57
30
  }
58
31
  if (script === 'run') {
59
32
  const scriptPath = args._[1];
@@ -79,7 +52,7 @@ async function runBinScript({ args, script }) {
79
52
  // Restore original process.argv
80
53
  process.argv = originalArgv;
81
54
  }
82
- return {};
55
+ return;
83
56
  }
84
57
  const configPath = findConfig();
85
58
  const configPromise = await import(pathToFileURL(configPath).toString());
@@ -103,22 +76,19 @@ async function runBinScript({ args, script }) {
103
76
  console.log(`Could not find associated bin script for the ${userBinScript.key} command`);
104
77
  console.error(err);
105
78
  }
106
- return {};
79
+ return;
107
80
  }
108
81
  if (script.startsWith('migrate')) {
109
- await migrate({
82
+ return migrate({
110
83
  config,
111
84
  parsedArgs: args
112
- });
113
- return {};
85
+ }).then(()=>process.exit(0));
114
86
  }
115
87
  if (script === 'generate:types') {
116
- await generateTypes(config);
117
- return {};
88
+ return generateTypes(config);
118
89
  }
119
90
  if (script === 'generate:importmap') {
120
- await generateImportMap(config);
121
- return {};
91
+ return generateImportMap(config);
122
92
  }
123
93
  if (script === 'jobs:run') {
124
94
  const payload = await getPayload({
@@ -128,63 +98,50 @@ async function runBinScript({ args, script }) {
128
98
  const limit = args.limit ? parseInt(args.limit, 10) : undefined;
129
99
  const queue = args.queue ? args.queue : undefined;
130
100
  const allQueues = !!args.allQueues;
131
- const handleSchedules = !!args.handleSchedules;
132
- if (handleSchedules) {
133
- await payload.jobs.handleSchedules({
101
+ if (args.cron) {
102
+ new Cron(args.cron, async ()=>{
103
+ await payload.jobs.run({
104
+ allQueues,
105
+ limit,
106
+ queue
107
+ });
108
+ });
109
+ process.stdin.resume() // Keep the process alive
110
+ ;
111
+ return;
112
+ } else {
113
+ await payload.jobs.run({
134
114
  allQueues,
115
+ limit,
135
116
  queue
136
117
  });
118
+ await payload.destroy() // close database connections after running jobs so process can exit cleanly
119
+ ;
120
+ process.exit(0);
137
121
  }
138
- await payload.jobs.run({
139
- allQueues,
140
- limit,
141
- queue
142
- });
143
- return {
144
- payload
145
- };
146
- }
147
- if (script === 'jobs:handle-schedules') {
148
- const payload = await getPayload({
149
- config
150
- }) // Do not setup crons here - this bin script can set up its own crons
151
- ;
152
- const queue = args.queue ? args.queue : undefined;
153
- const allQueues = !!args.allQueues;
154
- await payload.jobs.handleSchedules({
155
- allQueues,
156
- queue
157
- });
158
- return {
159
- payload
160
- };
161
122
  }
162
123
  if (script === 'generate:db-schema') {
163
124
  // Barebones instance to access database adapter, without connecting to the DB
164
- const payload = await getPayload({
125
+ await payload.init({
165
126
  config,
166
127
  disableDBConnect: true,
167
128
  disableOnInit: true
168
- }) // Do not setup crons here
169
- ;
129
+ });
170
130
  if (typeof payload.db.generateSchema !== 'function') {
171
131
  payload.logger.error({
172
132
  msg: `${payload.db.packageName} does not support database schema generation`
173
133
  });
174
- await payload.destroy();
175
134
  process.exit(1);
176
135
  }
177
136
  await payload.db.generateSchema({
178
137
  log: args.log === 'false' ? false : true,
179
138
  prettify: args.prettify === 'false' ? false : true
180
139
  });
181
- return {
182
- payload
183
- };
140
+ process.exit(0);
184
141
  }
185
142
  console.error(script ? `Unknown command: "${script}"` : 'Please provide a command to run');
186
143
  console.log(`\nAvailable commands:\n${availableScripts.map((c)=>` - ${c}`).join('\n')}`);
187
144
  process.exit(1);
188
- }
145
+ };
189
146
 
190
147
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/bin/index.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport { Cron } from 'croner'\nimport minimist from 'minimist'\nimport { pathToFileURL } from 'node:url'\nimport path from 'path'\n\nimport { findConfig } from '../config/find.js'\nimport { getPayload, type Payload } from '../index.js'\nimport { generateImportMap } from './generateImportMap/index.js'\nimport { generateTypes } from './generateTypes.js'\nimport { info } from './info.js'\nimport { loadEnv } from './loadEnv.js'\nimport { migrate, availableCommands as migrateCommands } from './migrate.js'\n\n// Note: this does not account for any user bin scripts\nconst availableScripts = [\n 'generate:db-schema',\n 'generate:importmap',\n 'generate:types',\n 'info',\n 'jobs:run',\n 'jobs:handle-schedules',\n 'run',\n ...migrateCommands,\n] as const\n\nexport const bin = async () => {\n loadEnv()\n process.env.DISABLE_PAYLOAD_HMR = 'true'\n\n const args = minimist(process.argv.slice(2))\n const script = (typeof args._[0] === 'string' ? args._[0] : '').toLowerCase()\n\n if (args.cron) {\n new Cron(args.cron, async () => {\n // If the bin script initializes payload (getPayload), this will only happen once, as getPayload\n // caches the payload instance on the module scope => no need to manually cache and manage getPayload initialization\n // outside the Cron here.\n await runBinScript({ args, script })\n })\n\n process.stdin.resume() // Keep the process alive\n\n return\n } else {\n const { payload } = await runBinScript({ args, script })\n if (payload) {\n await payload.destroy() // close database connections after running jobs so process can exit cleanly\n }\n process.exit(0)\n }\n}\n\nasync function runBinScript({\n args,\n script,\n}: {\n args: minimist.ParsedArgs\n script: string\n}): Promise<{\n /**\n * Scripts can return a payload instance if it exists. The bin script runner can then safely\n * shut off the instance, depending on if it's running in a cron job or not.\n */\n payload?: Payload\n}> {\n if (script === 'info') {\n await info()\n return {}\n }\n\n if (script === 'run') {\n const scriptPath = args._[1]\n if (!scriptPath) {\n console.error('Please provide a script path to run.')\n process.exit(1)\n }\n\n const absoluteScriptPath = path.resolve(process.cwd(), scriptPath)\n\n // Modify process.argv to remove 'run' and the script path\n const originalArgv = process.argv\n process.argv = [process.argv[0]!, process.argv[1]!, ...args._.slice(2)]\n\n try {\n await import(pathToFileURL(absoluteScriptPath).toString())\n } catch (error) {\n console.error(`Error running script: ${absoluteScriptPath}`)\n console.error(error)\n process.exit(1)\n } finally {\n // Restore original process.argv\n process.argv = originalArgv\n }\n return {}\n }\n\n const configPath = findConfig()\n const configPromise = await import(pathToFileURL(configPath).toString())\n let config = await configPromise\n if (config.default) {\n config = await config.default\n }\n\n const userBinScript = Array.isArray(config.bin)\n ? config.bin.find(({ key }: { key: string }) => key === script)\n : false\n\n if (userBinScript) {\n try {\n const module = await import(pathToFileURL(userBinScript.scriptPath).toString())\n\n if (!module.script || typeof module.script !== 'function') {\n console.error(\n `Could not find \"script\" function export for script ${userBinScript.key} in ${userBinScript.scriptPath}`,\n )\n } else {\n await module.script(config).catch((err: unknown) => {\n console.log(`Script ${userBinScript.key} failed, details:`)\n console.error(err)\n })\n }\n } catch (err) {\n console.log(`Could not find associated bin script for the ${userBinScript.key} command`)\n console.error(err)\n }\n\n return {}\n }\n\n if (script.startsWith('migrate')) {\n await migrate({ config, parsedArgs: args })\n return {}\n }\n\n if (script === 'generate:types') {\n await generateTypes(config)\n return {}\n }\n\n if (script === 'generate:importmap') {\n await generateImportMap(config)\n return {}\n }\n\n if (script === 'jobs:run') {\n const payload = await getPayload({ config }) // Do not setup crons here - this bin script can set up its own crons\n const limit = args.limit ? parseInt(args.limit, 10) : undefined\n const queue = args.queue ? args.queue : undefined\n const allQueues = !!args.allQueues\n const handleSchedules = !!args.handleSchedules\n\n if (handleSchedules) {\n await payload.jobs.handleSchedules({\n allQueues,\n queue,\n })\n }\n\n await payload.jobs.run({\n allQueues,\n limit,\n queue,\n })\n\n return { payload }\n }\n\n if (script === 'jobs:handle-schedules') {\n const payload = await getPayload({ config }) // Do not setup crons here - this bin script can set up its own crons\n const queue = args.queue ? args.queue : undefined\n const allQueues = !!args.allQueues\n\n await payload.jobs.handleSchedules({\n allQueues,\n queue,\n })\n\n return { payload }\n }\n\n if (script === 'generate:db-schema') {\n // Barebones instance to access database adapter, without connecting to the DB\n const payload = await getPayload({ config, disableDBConnect: true, disableOnInit: true }) // Do not setup crons here\n\n if (typeof payload.db.generateSchema !== 'function') {\n payload.logger.error({\n msg: `${payload.db.packageName} does not support database schema generation`,\n })\n\n await payload.destroy()\n process.exit(1)\n }\n\n await payload.db.generateSchema({\n log: args.log === 'false' ? false : true,\n prettify: args.prettify === 'false' ? false : true,\n })\n\n return { payload }\n }\n\n console.error(script ? `Unknown command: \"${script}\"` : 'Please provide a command to run')\n console.log(`\\nAvailable commands:\\n${availableScripts.map((c) => ` - ${c}`).join('\\n')}`)\n\n process.exit(1)\n}\n"],"names":["Cron","minimist","pathToFileURL","path","findConfig","getPayload","generateImportMap","generateTypes","info","loadEnv","migrate","availableCommands","migrateCommands","availableScripts","bin","process","env","DISABLE_PAYLOAD_HMR","args","argv","slice","script","_","toLowerCase","cron","runBinScript","stdin","resume","payload","destroy","exit","scriptPath","console","error","absoluteScriptPath","resolve","cwd","originalArgv","toString","configPath","configPromise","config","default","userBinScript","Array","isArray","find","key","module","catch","err","log","startsWith","parsedArgs","limit","parseInt","undefined","queue","allQueues","handleSchedules","jobs","run","disableDBConnect","disableOnInit","db","generateSchema","logger","msg","packageName","prettify","map","c","join"],"mappings":"AAAA,6BAA6B,GAC7B,SAASA,IAAI,QAAQ,SAAQ;AAC7B,OAAOC,cAAc,WAAU;AAC/B,SAASC,aAAa,QAAQ,WAAU;AACxC,OAAOC,UAAU,OAAM;AAEvB,SAASC,UAAU,QAAQ,oBAAmB;AAC9C,SAASC,UAAU,QAAsB,cAAa;AACtD,SAASC,iBAAiB,QAAQ,+BAA8B;AAChE,SAASC,aAAa,QAAQ,qBAAoB;AAClD,SAASC,IAAI,QAAQ,YAAW;AAChC,SAASC,OAAO,QAAQ,eAAc;AACtC,SAASC,OAAO,EAAEC,qBAAqBC,eAAe,QAAQ,eAAc;AAE5E,uDAAuD;AACvD,MAAMC,mBAAmB;IACvB;IACA;IACA;IACA;IACA;IACA;IACA;OACGD;CACJ;AAED,OAAO,MAAME,MAAM;IACjBL;IACAM,QAAQC,GAAG,CAACC,mBAAmB,GAAG;IAElC,MAAMC,OAAOjB,SAASc,QAAQI,IAAI,CAACC,KAAK,CAAC;IACzC,MAAMC,SAAS,AAAC,CAAA,OAAOH,KAAKI,CAAC,CAAC,EAAE,KAAK,WAAWJ,KAAKI,CAAC,CAAC,EAAE,GAAG,EAAC,EAAGC,WAAW;IA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,CAAC;YAC9Bd,KAAKjC,KAAKiC,GAAG,KAAK,UAAU,QAAQ;YACpCkB,UAAUnD,KAAKmD,QAAQ,KAAK,UAAU,QAAQ;QAChD;QAEA,OAAO;YAAEzC;QAAQ;IACnB;IAEAI,QAAQC,KAAK,CAACZ,SAAS,CAAC,kBAAkB,EAAEA,OAAO,CAAC,CAAC,GAAG;IACxDW,QAAQmB,GAAG,CAAC,CAAC,uBAAuB,EAAEtC,iBAAiByD,GAAG,CAAC,CAACC,IAAM,CAAC,IAAI,EAAEA,GAAG,EAAEC,IAAI,CAAC,OAAO;IAE1FzD,QAAQe,IAAI,CAAC;AACf"}
1
+ {"version":3,"sources":["../../src/bin/index.ts"],"sourcesContent":["// @ts-strict-ignore\n/* eslint-disable no-console */\nimport { Cron } from 'croner'\nimport minimist from 'minimist'\nimport { pathToFileURL } from 'node:url'\nimport path from 'path'\n\nimport { findConfig } from '../config/find.js'\nimport payload, { getPayload } from '../index.js'\nimport { generateImportMap } from './generateImportMap/index.js'\nimport { generateTypes } from './generateTypes.js'\nimport { info } from './info.js'\nimport { loadEnv } from './loadEnv.js'\nimport { migrate, availableCommands as migrateCommands } from './migrate.js'\n\n// Note: this does not account for any user bin scripts\nconst availableScripts = [\n 'generate:db-schema',\n 'generate:importmap',\n 'generate:types',\n 'info',\n 'jobs:run',\n 'run',\n ...migrateCommands,\n] as const\n\nexport const bin = async () => {\n loadEnv()\n\n const args = minimist(process.argv.slice(2))\n const script = (typeof args._[0] === 'string' ? args._[0] : '').toLowerCase()\n\n if (script === 'info') {\n await info()\n return\n }\n\n if (script === 'run') {\n const scriptPath = args._[1]\n if (!scriptPath) {\n console.error('Please provide a script path to run.')\n process.exit(1)\n }\n\n const absoluteScriptPath = path.resolve(process.cwd(), scriptPath)\n\n // Modify process.argv to remove 'run' and the script path\n const originalArgv = process.argv\n process.argv = [process.argv[0]!, process.argv[1]!, ...args._.slice(2)]\n\n try {\n await import(pathToFileURL(absoluteScriptPath).toString())\n } catch (error) {\n console.error(`Error running script: ${absoluteScriptPath}`)\n console.error(error)\n process.exit(1)\n } finally {\n // Restore original process.argv\n process.argv = originalArgv\n }\n return\n }\n\n const configPath = findConfig()\n const configPromise = await import(pathToFileURL(configPath).toString())\n let config = await configPromise\n if (config.default) {\n config = await config.default\n }\n\n const userBinScript = Array.isArray(config.bin)\n ? config.bin.find(({ key }: { key: string }) => key === script)\n : false\n\n if (userBinScript) {\n try {\n const module = await import(pathToFileURL(userBinScript.scriptPath).toString())\n\n if (!module.script || typeof module.script !== 'function') {\n console.error(\n `Could not find \"script\" function export for script ${userBinScript.key} in ${userBinScript.scriptPath}`,\n )\n } else {\n await module.script(config).catch((err: unknown) => {\n console.log(`Script ${userBinScript.key} failed, details:`)\n console.error(err)\n })\n }\n } catch (err) {\n console.log(`Could not find associated bin script for the ${userBinScript.key} command`)\n console.error(err)\n }\n\n return\n }\n\n if (script.startsWith('migrate')) {\n return migrate({ config, parsedArgs: args }).then(() => process.exit(0))\n }\n\n if (script === 'generate:types') {\n return generateTypes(config)\n }\n\n if (script === 'generate:importmap') {\n return generateImportMap(config)\n }\n\n if (script === 'jobs:run') {\n const payload = await getPayload({ config }) // Do not setup crons here - this bin script can set up its own crons\n const limit = args.limit ? parseInt(args.limit, 10) : undefined\n const queue = args.queue ? args.queue : undefined\n const allQueues = !!args.allQueues\n\n if (args.cron) {\n new Cron(args.cron, async () => {\n await payload.jobs.run({\n allQueues,\n limit,\n queue,\n })\n })\n\n process.stdin.resume() // Keep the process alive\n\n return\n } else {\n await payload.jobs.run({\n allQueues,\n limit,\n queue,\n })\n\n await payload.destroy() // close database connections after running jobs so process can exit cleanly\n\n process.exit(0)\n }\n }\n\n if (script === 'generate:db-schema') {\n // Barebones instance to access database adapter, without connecting to the DB\n await payload.init({\n config,\n disableDBConnect: true,\n disableOnInit: true,\n })\n\n if (typeof payload.db.generateSchema !== 'function') {\n payload.logger.error({\n msg: `${payload.db.packageName} does not support database schema generation`,\n })\n\n process.exit(1)\n }\n\n await payload.db.generateSchema({\n log: args.log === 'false' ? false : true,\n prettify: args.prettify === 'false' ? false : true,\n })\n\n process.exit(0)\n }\n\n console.error(script ? `Unknown command: \"${script}\"` : 'Please provide a command to run')\n console.log(`\\nAvailable commands:\\n${availableScripts.map((c) => ` - ${c}`).join('\\n')}`)\n\n process.exit(1)\n}\n"],"names":["Cron","minimist","pathToFileURL","path","findConfig","payload","getPayload","generateImportMap","generateTypes","info","loadEnv","migrate","availableCommands","migrateCommands","availableScripts","bin","args","process","argv","slice","script","_","toLowerCase","scriptPath","console","error","exit","absoluteScriptPath","resolve","cwd","originalArgv","toString","configPath","configPromise","config","default","userBinScript","Array","isArray","find","key","module","catch","err","log","startsWith","parsedArgs","then","limit","parseInt","undefined","queue","allQueues","cron","jobs","run","stdin","resume","destroy","init","disableDBConnect","disableOnInit","db","generateSchema","logger","msg","packageName","prettify","map","c","join"],"mappings":"AAAA,oBAAoB;AACpB,6BAA6B,GAC7B,SAASA,IAAI,QAAQ,SAAQ;AAC7B,OAAOC,cAAc,WAAU;AAC/B,SAASC,aAAa,QAAQ,WAAU;AACxC,OAAOC,UAAU,OAAM;AAEvB,SAASC,UAAU,QAAQ,oBAAmB;AAC9C,OAAOC,WAAWC,UAAU,QAAQ,cAAa;AACjD,SAASC,iBAAiB,QAAQ,+BAA8B;AAChE,SAASC,aAAa,QAAQ,qBAAoB;AAClD,SAASC,IAAI,QAAQ,YAAW;AAChC,SAASC,OAAO,QAAQ,eAAc;AACtC,SAASC,OAAO,EAAEC,qBAAqBC,eAAe,QAAQ,eAAc;AAE5E,uDAAuD;AACvD,MAAMC,mBAAmB;IACvB;IACA;IACA;IACA;IACA;IACA;OACGD;CACJ;AAED,OAAO,MAAME,MAAM;IACjBL;IAEA,MAAMM,OAAOf,SAASgB,QAAQC,IAAI,CAACC,KAAK,CAAC;IACzC,MAAMC,SAAS,AAAC,CAAA,OAAOJ,KAAKK,CAAC,CAAC,EAAE,KAAK,WAAWL,KAAKK,CAAC,CA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;;YAEhD;QACF,OAAO;YACL,MAAMpD,QAAQiD,IAAI,CAACC,GAAG,CAAC;gBACrBH;gBACAJ;gBACAG;YACF;YAEA,MAAM9C,QAAQqD,OAAO,GAAG,4EAA4E;;YAEpGzC,QAAQS,IAAI,CAAC;QACf;IACF;IAEA,IAAIN,WAAW,sBAAsB;QACnC,8EAA8E;QAC9E,MAAMf,QAAQsD,IAAI,CAAC;YACjBzB;YACA0B,kBAAkB;YAClBC,eAAe;QACjB;QAEA,IAAI,OAAOxD,QAAQyD,EAAE,CAACC,cAAc,KAAK,YAAY;YACnD1D,QAAQ2D,MAAM,CAACvC,KAAK,CAAC;gBACnBwC,KAAK,GAAG5D,QAAQyD,EAAE,CAACI,WAAW,CAAC,4CAA4C,CAAC;YAC9E;YAEAjD,QAAQS,IAAI,CAAC;QACf;QAEA,MAAMrB,QAAQyD,EAAE,CAACC,cAAc,CAAC;YAC9BnB,KAAK5B,KAAK4B,GAAG,KAAK,UAAU,QAAQ;YACpCuB,UAAUnD,KAAKmD,QAAQ,KAAK,UAAU,QAAQ;QAChD;QAEAlD,QAAQS,IAAI,CAAC;IACf;IAEAF,QAAQC,KAAK,CAACL,SAAS,CAAC,kBAAkB,EAAEA,OAAO,CAAC,CAAC,GAAG;IACxDI,QAAQoB,GAAG,CAAC,CAAC,uBAAuB,EAAE9B,iBAAiBsD,GAAG,CAAC,CAACC,IAAM,CAAC,IAAI,EAAEA,GAAG,EAAEC,IAAI,CAAC,OAAO;IAE1FrD,QAAQS,IAAI,CAAC;AACf,EAAC"}
package/dist/index.d.ts CHANGED
@@ -354,6 +354,7 @@ export declare class BasePayload {
354
354
  versions: {
355
355
  [slug: string]: any;
356
356
  };
357
+ _initializeCrons(): Promise<void>;
357
358
  bin({ args, cwd, log, }: {
358
359
  args: string[];
359
360
  cwd?: string;
@@ -383,8 +384,16 @@ export declare class BasePayload {
383
384
  }
384
385
  declare const initialized: BasePayload;
385
386
  export default initialized;
386
- export declare const reload: (config: SanitizedConfig, payload: Payload, skipImportMapGeneration?: boolean, options?: InitOptions) => Promise<void>;
387
- export declare const getPayload: (options: InitOptions) => Promise<Payload>;
387
+ export declare const reload: (config: SanitizedConfig, payload: Payload, skipImportMapGeneration?: boolean) => Promise<void>;
388
+ export declare const getPayload: (options: {
389
+ /**
390
+ * A unique key to identify the payload instance. You can pass your own key if you want to cache this payload instance separately.
391
+ * This is useful if you pass a different payload config for each instance.
392
+ *
393
+ * @default 'default'
394
+ */
395
+ key?: string;
396
+ } & Pick<InitOptions, "config" | "cron" | "disableOnInit" | "importMap">) => Promise<Payload>;
388
397
  type Payload = BasePayload;
389
398
  interface RequestContext {
390
399
  [key: string]: unknown;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,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,MAAM,IAAI,WAAW,EAAE,MAAM,4BAA4B,CAAA;AACvE,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,EACX,MAAM,+BAA+B,CAAA;AAEtC,OAAO,EAEL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,sCAAsC,CAAA;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AACvD,YAAY,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAA;AAC5E,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAA"}
package/dist/index.js CHANGED
@@ -219,6 +219,40 @@ let checkedDependencies = false;
219
219
  return verifyEmailLocal(this, options);
220
220
  };
221
221
  versions = {};
222
+ async _initializeCrons() {
223
+ if (this.config.jobs.enabled && this.config.jobs.autoRun && !isNextBuild()) {
224
+ const DEFAULT_CRON = '* * * * *';
225
+ const DEFAULT_LIMIT = 10;
226
+ const cronJobs = typeof this.config.jobs.autoRun === 'function' ? await this.config.jobs.autoRun(this) : this.config.jobs.autoRun;
227
+ await Promise.all(cronJobs.map((cronConfig)=>{
228
+ const jobAutorunCron = new Cron(cronConfig.cron ?? DEFAULT_CRON, async ()=>{
229
+ if (_internal_jobSystemGlobals.shouldAutoSchedule && !cronConfig.disableScheduling && this.config.jobs.scheduling) {
230
+ await this.jobs.handleSchedules({
231
+ allQueues: cronConfig.allQueues,
232
+ queue: cronConfig.queue
233
+ });
234
+ }
235
+ if (!_internal_jobSystemGlobals.shouldAutoRun) {
236
+ return;
237
+ }
238
+ if (typeof this.config.jobs.shouldAutoRun === 'function') {
239
+ const shouldAutoRun = await this.config.jobs.shouldAutoRun(this);
240
+ if (!shouldAutoRun) {
241
+ jobAutorunCron.stop();
242
+ return;
243
+ }
244
+ }
245
+ await this.jobs.run({
246
+ allQueues: cronConfig.allQueues,
247
+ limit: cronConfig.limit ?? DEFAULT_LIMIT,
248
+ queue: cronConfig.queue,
249
+ silent: cronConfig.silent
250
+ });
251
+ });
252
+ this.crons.push(jobAutorunCron);
253
+ }));
254
+ }
255
+ }
222
256
  async bin({ args, cwd, log }) {
223
257
  return new Promise((resolve, reject)=>{
224
258
  const spawned = spawn('node', [
@@ -391,37 +425,8 @@ let checkedDependencies = false;
391
425
  }, 'Error running onInit function');
392
426
  throw error;
393
427
  }
394
- if (this.config.jobs.enabled && this.config.jobs.autoRun && !isNextBuild() && options.cron) {
395
- const DEFAULT_CRON = '* * * * *';
396
- const DEFAULT_LIMIT = 10;
397
- const cronJobs = typeof this.config.jobs.autoRun === 'function' ? await this.config.jobs.autoRun(this) : this.config.jobs.autoRun;
398
- await Promise.all(cronJobs.map((cronConfig)=>{
399
- const jobAutorunCron = new Cron(cronConfig.cron ?? DEFAULT_CRON, async ()=>{
400
- if (_internal_jobSystemGlobals.shouldAutoSchedule && !cronConfig.disableScheduling && this.config.jobs.scheduling) {
401
- await this.jobs.handleSchedules({
402
- allQueues: cronConfig.allQueues,
403
- queue: cronConfig.queue
404
- });
405
- }
406
- if (!_internal_jobSystemGlobals.shouldAutoRun) {
407
- return;
408
- }
409
- if (typeof this.config.jobs.shouldAutoRun === 'function') {
410
- const shouldAutoRun = await this.config.jobs.shouldAutoRun(this);
411
- if (!shouldAutoRun) {
412
- jobAutorunCron.stop();
413
- return;
414
- }
415
- }
416
- await this.jobs.run({
417
- allQueues: cronConfig.allQueues,
418
- limit: cronConfig.limit ?? DEFAULT_LIMIT,
419
- queue: cronConfig.queue,
420
- silent: cronConfig.silent
421
- });
422
- });
423
- this.crons.push(jobAutorunCron);
424
- }));
428
+ if (options.cron) {
429
+ await this._initializeCrons();
425
430
  }
426
431
  return this;
427
432
  }
@@ -432,16 +437,7 @@ let checkedDependencies = false;
432
437
  const initialized = new BasePayload();
433
438
  // eslint-disable-next-line no-restricted-exports
434
439
  export default initialized;
435
- let cached = global._payload;
436
- if (!cached) {
437
- cached = global._payload = {
438
- payload: null,
439
- promise: null,
440
- reload: false,
441
- ws: null
442
- };
443
- }
444
- export const reload = async (config, payload, skipImportMapGeneration, options)=>{
440
+ export const reload = async (config, payload, skipImportMapGeneration)=>{
445
441
  if (typeof payload.db.destroy === 'function') {
446
442
  // Only destroy db, as we then later only call payload.db.init and not payload.init
447
443
  await payload.db.destroy();
@@ -479,10 +475,8 @@ export const reload = async (config, payload, skipImportMapGeneration, options)=
479
475
  log: true
480
476
  });
481
477
  }
482
- if (payload.db?.init) {
483
- await payload.db.init();
484
- }
485
- if (!options?.disableDBConnect && payload.db.connect) {
478
+ await payload.db.init?.();
479
+ if (payload.db.connect) {
486
480
  await payload.db.connect({
487
481
  hotReload: true
488
482
  });
@@ -496,11 +490,38 @@ export const reload = async (config, payload, skipImportMapGeneration, options)=
496
490
  global._payload_doNotCacheSchemaMap = true;
497
491
  global._payload_doNotCacheClientSchemaMap = true;
498
492
  };
493
+ let _cached = global._payload;
494
+ if (!_cached) {
495
+ _cached = global._payload = new Map();
496
+ }
499
497
  export const getPayload = async (options)=>{
500
498
  if (!options?.config) {
501
499
  throw new Error('Error: the payload config is required for getPayload to work.');
502
500
  }
501
+ let alreadyCachedSameConfig = false;
502
+ let cached = _cached.get(options.key ?? 'default');
503
+ if (!cached) {
504
+ cached = {
505
+ initializedCrons: Boolean(options.cron),
506
+ payload: null,
507
+ promise: null,
508
+ reload: false,
509
+ ws: null
510
+ };
511
+ _cached.set(options.key ?? 'default', cached);
512
+ } else {
513
+ alreadyCachedSameConfig = true;
514
+ }
515
+ if (alreadyCachedSameConfig) {
516
+ // alreadyCachedSameConfig => already called onInit once, but same config => no need to call onInit again.
517
+ // calling onInit again would only make sense if a different config was passed.
518
+ options.disableOnInit = true;
519
+ }
503
520
  if (cached.payload) {
521
+ if (options.cron && !cached.initializedCrons) {
522
+ cached.initializedCrons = true;
523
+ await cached.payload._initializeCrons();
524
+ }
504
525
  if (cached.reload === true) {
505
526
  let resolve;
506
527
  // getPayload is called multiple times, in parallel. However, we only want to run `await reload` once. By immediately setting cached.reload to a promise,
@@ -508,7 +529,7 @@ export const getPayload = async (options)=>{
508
529
  // will reach `if (cached.reload instanceof Promise) {` which then waits for the first reload to finish.
509
530
  cached.reload = new Promise((res)=>resolve = res);
510
531
  const config = await options.config;
511
- await reload(config, cached.payload, !options.importMap, options);
532
+ await reload(config, cached.payload, !options.importMap);
512
533
  resolve();
513
534
  }
514
535
  if (cached.reload instanceof Promise) {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/ban-ts-comment */\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 { Result as 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 JsonObject,\n SelectType,\n TransformCollectionWithSelect,\n TransformGlobalWithSelect,\n} from './types/index.js'\nimport type { TraverseFieldsCallback } from './utilities/traverseFields.js'\n\nimport { countLocal, type Options as 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 Options as FindOptions } from './collections/operations/local/find.js'\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'\nimport type { SupportedLanguages } from '@payloadcms/translations'\n\nimport { Cron } from 'croner'\n\nimport type { ClientConfig } from './config/client.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 { countVersionsLocal } 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 { 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 interface GeneratedTypes {\n authUntyped: {\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\n blocksUntyped: {\n [slug: string]: JsonObject\n }\n collectionsJoinsUntyped: {\n [slug: string]: {\n [schemaPath: string]: CollectionSlug\n }\n }\n collectionsSelectUntyped: {\n [slug: string]: SelectType\n }\n\n collectionsUntyped: {\n [slug: string]: JsonObject & TypeWithID\n }\n dbUntyped: {\n defaultIDType: number | string\n }\n globalsSelectUntyped: {\n [slug: string]: SelectType\n }\n\n globalsUntyped: {\n [slug: string]: JsonObject\n }\n jobsUntyped: {\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 localeUntyped: null | string\n userUntyped: UntypedUser\n}\n\n// Helper type to resolve the correct type using conditional types\ntype ResolveCollectionType<T> = 'collections' extends keyof T\n ? T['collections']\n : // @ts-expect-error\n T['collectionsUntyped']\n\ntype ResolveBlockType<T> = 'blocks' extends keyof T\n ? T['blocks']\n : // @ts-expect-error\n T['blocksUntyped']\n\ntype ResolveCollectionSelectType<T> = 'collectionsSelect' extends keyof T\n ? T['collectionsSelect']\n : // @ts-expect-error\n T['collectionsSelectUntyped']\n\ntype ResolveCollectionJoinsType<T> = 'collectionsJoins' extends keyof T\n ? T['collectionsJoins']\n : // @ts-expect-error\n T['collectionsJoinsUntyped']\n\ntype ResolveGlobalType<T> = 'globals' extends keyof T\n ? T['globals']\n : // @ts-expect-error\n T['globalsUntyped']\n\ntype ResolveGlobalSelectType<T> = 'globalsSelect' extends keyof T\n ? T['globalsSelect']\n : // @ts-expect-error\n T['globalsSelectUntyped']\n\n// Applying helper types to GeneratedTypes\nexport type TypedCollection = ResolveCollectionType<GeneratedTypes>\n\nexport type TypedBlock = ResolveBlockType<GeneratedTypes>\n\nexport type TypedUploadCollection = NonNever<{\n [K in keyof TypedCollection]:\n | 'filename'\n | 'filesize'\n | 'mimeType'\n | 'url' extends keyof TypedCollection[K]\n ? TypedCollection[K]\n : never\n}>\n\nexport type TypedCollectionSelect = ResolveCollectionSelectType<GeneratedTypes>\n\nexport type TypedCollectionJoins = ResolveCollectionJoinsType<GeneratedTypes>\n\nexport type TypedGlobal = ResolveGlobalType<GeneratedTypes>\n\nexport type TypedGlobalSelect = ResolveGlobalSelectType<GeneratedTypes>\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 = StringKeyOf<TypedCollection>\n\nexport type BlockSlug = StringKeyOf<TypedBlock>\n\nexport type UploadCollectionSlug = StringKeyOf<TypedUploadCollection>\n\ntype ResolveDbType<T> = 'db' extends keyof T\n ? T['db']\n : // @ts-expect-error\n T['dbUntyped']\n\nexport type DefaultDocumentIDType = ResolveDbType<GeneratedTypes>['defaultIDType']\nexport type GlobalSlug = StringKeyOf<TypedGlobal>\n\n// now for locale and user\n\n// @ts-expect-error\ntype ResolveLocaleType<T> = 'locale' extends keyof T ? T['locale'] : T['localeUntyped']\n// @ts-expect-error\ntype ResolveUserType<T> = 'user' extends keyof T ? T['user'] : T['userUntyped']\n\nexport type TypedLocale = ResolveLocaleType<GeneratedTypes>\n\n/**\n * @todo rename to `User` in 4.0\n */\nexport type TypedUser = ResolveUserType<GeneratedTypes>\n\n// @ts-expect-error\ntype ResolveAuthOperationsType<T> = 'auth' extends keyof T ? T['auth'] : T['authUntyped']\nexport type TypedAuthOperations = ResolveAuthOperationsType<GeneratedTypes>\n\n// @ts-expect-error\ntype ResolveJobOperationsType<T> = 'jobs' extends keyof T ? T['jobs'] : T['jobsUntyped']\nexport type TypedJobs = ResolveJobOperationsType<GeneratedTypes>\n\ntype HasPayloadJobsType = 'collections' extends keyof GeneratedTypes\n ? 'payload-jobs' extends keyof TypedCollection\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: CountOptions<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 <TSlug extends CollectionSlug, TSelect extends SelectFromCollectionSlug<TSlug>>(\n options: FindOptions<TSlug, TSelect>,\n ): Promise<PaginatedDocs<TransformCollectionWithSelect<TSlug, TSelect>>> => {\n return findLocal<TSlug, TSelect>(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 => `${this.config.serverURL}${this.config.routes.admin}`\n\n getAPIURL = (): string => `${this.config.serverURL}${this.config.routes.api}`\n\n globals!: Globals\n\n importMap!: ImportMap\n\n jobs = getJobsLocalAPI(this)\n\n logger!: Logger\n\n login = async <TSlug extends CollectionSlug>(\n options: LoginOptions<TSlug>,\n ): Promise<{ user: DataFromCollectionSlug<TSlug> } & LoginResult> => {\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 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 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 (this.config.jobs.enabled && this.config.jobs.autoRun && !isNextBuild() && options.cron) {\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(cronConfig.cron ?? DEFAULT_CRON, 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 this.crons.push(jobAutorunCron)\n }),\n )\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\nlet cached: {\n payload: null | Payload\n promise: null | Promise<Payload>\n reload: boolean | Promise<void>\n ws: null | WebSocket\n} = (global as any)._payload\n\nif (!cached) {\n cached = (global as any)._payload = { payload: null, promise: null, reload: false, ws: null }\n}\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 component map\n if (skipImportMapGeneration !== true && config.admin?.importMap?.autoGenerate !== false) {\n await generateImportMap(config, {\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\nexport const getPayload = async (options: InitOptions): Promise<Payload> => {\n if (!options?.config) {\n throw new Error('Error: the payload config is required for getPayload to work.')\n }\n\n if (cached.payload) {\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 await reload(config, cached.payload, !options.importMap, options)\n\n resolve()\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 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 try {\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\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 ?? `ws://localhost:${port}${prefix}${path}`,\n )\n\n cached.ws.onmessage = (event) => {\n if (typeof event.data === 'string') {\n const data = JSON.parse(event.data)\n\n if ('action' in data && data.action === 'serverComponentChanges') {\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 * from './auth/index.js'\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 { 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 serverOnlyAdminConfigProperties,\n serverOnlyConfigProperties,\n type UnsanitizedClientConfig,\n} from './config/client.js'\nexport { defaults } from './config/defaults.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 { 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 { EmailAdapter as PayloadEmailAdapter, SendEmailOptions } from './email/types.js'\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 UnverifiedEmail,\n ValidationError,\n ValidationErrorName,\n} from './errors/index.js'\n\nexport type { ValidationFieldError } from './errors/index.js'\nexport { baseBlockFields } from './fields/baseFields/baseBlockFields.js'\n\nexport { baseIDField } from './fields/baseFields/baseIDField.js'\n\nexport {\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 { sanitizeFields } 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 FieldAffectingData,\n FieldAffectingDataClient,\n FieldBase,\n FieldBaseClient,\n FieldHook,\n FieldHookArgs,\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 { 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 BeforeReadHook as GlobalBeforeReadHook,\n BeforeValidateHook as GlobalBeforeValidateHook,\n DataFromGlobalSlug,\n GlobalAdminOptions,\n GlobalConfig,\n SanitizedGlobalConfig,\n} from './globals/config/types.js'\n\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'\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 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'\n\nexport type {\n BaseJob,\n JobLog,\n JobTaskStatus,\n RunningJob,\n SingleTaskStatus,\n WorkflowConfig,\n WorkflowHandler,\n WorkflowTypes,\n} from './queues/config/types/workflowTypes.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 { 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 type { FieldSchemaJSON } from './utilities/fieldSchemaToJSON.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 { 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'\nexport { appendVersionToQueryKey } from './versions/drafts/appendVersionToQueryKey.js'\nexport { getQueryDraftsSort } from './versions/drafts/getQueryDraftsSort.js'\n\nexport { enforceMaxVersions } from './versions/enforceMaxVersions.js'\nexport { getLatestCollectionVersion } from './versions/getLatestCollectionVersion.js'\nexport { getLatestGlobalVersion } from './versions/getLatestGlobalVersion.js'\nexport { saveVersion } from './versions/saveVersion.js'\nexport type { SchedulePublishTaskInput } from './versions/schedule/types.js'\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","Cron","decrypt","encrypt","authLocal","APIKeyAuthentication","JWTAuthentication","generateImportMap","checkPayloadDependencies","countVersionsLocal","consoleEmailAdapter","fieldAffectsData","getJobsLocalAPI","_internal_jobSystemGlobals","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","serverURL","routes","admin","getAPIURL","api","globals","importMap","jobs","logger","login","resetPassword","restoreGlobalVersion","restoreVersion","schema","secret","sendEmail","types","unlock","updateGlobal","validationRules","verifyEmail","versions","bin","args","cwd","log","resolve","reject","spawned","stdio","undefined","on","code","error","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","push","useAPIKey","authenticate","disableLocalStrategy","disableOnInit","onInit","err","enabled","autoRun","DEFAULT_CRON","DEFAULT_LIMIT","cronJobs","cronConfig","jobAutorunCron","shouldAutoSchedule","disableScheduling","scheduling","handleSchedules","allQueues","queue","shouldAutoRun","run","limit","silent","initialized","cached","global","_payload","promise","reload","ws","skipImportMapGeneration","hotReload","_payload_clientConfigs","_payload_schemaMap","_payload_clientSchemaMap","_payload_doNotCacheClientConfig","_payload_doNotCacheSchemaMap","_payload_doNotCacheClientSchemaMap","getPayload","res","DISABLE_PAYLOAD_HMR","port","PORT","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","serverOnlyAdminConfigProperties","serverOnlyConfigProperties","defaults","sanitizeConfig","combineQueries","createDatabaseAdapter","defaultBeginTransaction","flattenWhereToOperators","getLocalizedPaths","createMigration","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","UnverifiedEmail","ValidationError","ValidationErrorName","baseBlockFields","baseIDField","createClientField","createClientFields","sanitizeFields","getDefaultValue","afterChangeTraverseFields","afterReadPromise","afterReadTraverseFields","beforeChangeTraverseFields","beforeValidateTraverseFields","sortableFieldTypes","validations","getFolderData","createClientGlobalConfig","createClientGlobalConfigs","docAccessOperationGlobal","findOneOperation","findVersionByIDOperationGlobal","findVersionsOperationGlobal","restoreVersionOperationGlobal","updateOperationGlobal","jobAfterRead","countRunnableOrActiveJobsForQueue","importHandlerPath","_internal_resetJobSystemGlobals","getCurrentDate","getLocalI18n","getFileByPath","_internal_safeFetchGlobal","addDataAndFileToRequest","addLocalesToRequestFromData","sanitizeLocales","commitTransaction","configToJSONSchema","entityToJSONSchema","fieldsToJSONSchema","withNullableJSONSchemaType","createArrayFromCommaDelineated","createLocalReq","createPayloadRequest","deepCopyObject","deepCopyObjectComplex","deepCopyObjectSimple","deepMerge","deepMergeWithCombinedArrays","deepMergeWithReactComponents","deepMergeWithSourceArrays","checkDependencies","getDependencies","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","saveVersion","deepMergeSimple"],"mappings":"AAAA,qDAAqD,GACrD,oDAAoD,GAMpD,SAASA,KAAK,QAAQ,gBAAe;AACrC,OAAOC,YAAY,SAAQ;AAC3B,SAASC,aAAa,QAAQ,WAAU;AACxC,OAAOC,UAAU,OAAM;AACvB,OAAOC,eAAe,KAAI;AAe1B,SACEC,mBAAmB,QAEd,4CAA2C;AAClD,SAASC,UAAU,QAAsC,mCAAkC;AAC3F,SACEC,kBAAkB,QAEb,2CAA0C;AACjD,SAASC,WAAW,QAAuC,oCAAmC;AAC9F,SACEC,gBAAgB,QAEX,yCAAwC;AAe/C,SAASC,UAAU,QAAsC,0CAAyC;AAClG,SACEC,WAAW,QAEN,2CAA0C;AACjD,SAEEC,WAAW,QAGN,2CAA0C;AACjD,SACEC,cAAc,QAET,8CAA6C;AACpD,SAASC,SAAS,QAAqC,yCAAwC;AAC/F,SACEC,aAAa,QAER,6CAA4C;AACnD,SACEC,gBAAgBC,iBAAiB,QAE5B,iDAAgD;AACvD,SACEC,oBAAoB,QAEf,oDAAmD;AAC1D,SACEC,iBAAiB,QAEZ,iDAAgD;AACvD,SACEC,mBAAmB,QAEd,mDAAkD;AACzD,SAEEC,WAAW,QAGN,2CAA0C;AACjD,SACEC,wBAAwB,QAEnB,8CAA6C;AACpD,SAEEC,kBAAkB,QACb,wCAAuC;AAC9C,SACEC,0BAA0B,QAErB,gDAA+C;AACtD,SACEC,uBAAuB,QAElB,6CAA4C;AACnD,SACEC,yBAAyB,QAEpB,+CAA8C;AACrD,SACEC,iBAAiB,QAEZ,uCAAsC;AAI7C,SAASC,IAAI,QAAQ,SAAQ;AAM7B,SAASC,OAAO,EAAEC,OAAO,QAAQ,mBAAkB;AACnD,SAASC,SAAS,QAAQ,kCAAiC;AAC3D,SAASC,oBAAoB,QAAQ,8BAA6B;A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CAA8C;AACtF,SAASC,kBAAkB,QAAQ,0CAAyC;AAE5E,SAASC,kBAAkB,QAAQ,mCAAkC;AACrE,SAASC,0BAA0B,QAAQ,2CAA0C;AACrF,SAASC,sBAAsB,QAAQ,uCAAsC;AAC7E,SAASC,WAAW,QAAQ,4BAA2B;AAGvD,SAASC,eAAe,QAAQ,qCAAoC"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/ban-ts-comment */\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 { Result as 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 JsonObject,\n SelectType,\n TransformCollectionWithSelect,\n TransformGlobalWithSelect,\n} from './types/index.js'\nimport type { TraverseFieldsCallback } from './utilities/traverseFields.js'\n\nimport { countLocal, type Options as 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 Options as FindOptions } from './collections/operations/local/find.js'\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'\nimport type { SupportedLanguages } from '@payloadcms/translations'\n\nimport { Cron } from 'croner'\n\nimport type { ClientConfig } from './config/client.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 { countVersionsLocal } 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 { 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 interface GeneratedTypes {\n authUntyped: {\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\n blocksUntyped: {\n [slug: string]: JsonObject\n }\n collectionsJoinsUntyped: {\n [slug: string]: {\n [schemaPath: string]: CollectionSlug\n }\n }\n collectionsSelectUntyped: {\n [slug: string]: SelectType\n }\n\n collectionsUntyped: {\n [slug: string]: JsonObject & TypeWithID\n }\n dbUntyped: {\n defaultIDType: number | string\n }\n globalsSelectUntyped: {\n [slug: string]: SelectType\n }\n\n globalsUntyped: {\n [slug: string]: JsonObject\n }\n jobsUntyped: {\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 localeUntyped: null | string\n userUntyped: UntypedUser\n}\n\n// Helper type to resolve the correct type using conditional types\ntype ResolveCollectionType<T> = 'collections' extends keyof T\n ? T['collections']\n : // @ts-expect-error\n T['collectionsUntyped']\n\ntype ResolveBlockType<T> = 'blocks' extends keyof T\n ? T['blocks']\n : // @ts-expect-error\n T['blocksUntyped']\n\ntype ResolveCollectionSelectType<T> = 'collectionsSelect' extends keyof T\n ? T['collectionsSelect']\n : // @ts-expect-error\n T['collectionsSelectUntyped']\n\ntype ResolveCollectionJoinsType<T> = 'collectionsJoins' extends keyof T\n ? T['collectionsJoins']\n : // @ts-expect-error\n T['collectionsJoinsUntyped']\n\ntype ResolveGlobalType<T> = 'globals' extends keyof T\n ? T['globals']\n : // @ts-expect-error\n T['globalsUntyped']\n\ntype ResolveGlobalSelectType<T> = 'globalsSelect' extends keyof T\n ? T['globalsSelect']\n : // @ts-expect-error\n T['globalsSelectUntyped']\n\n// Applying helper types to GeneratedTypes\nexport type TypedCollection = ResolveCollectionType<GeneratedTypes>\n\nexport type TypedBlock = ResolveBlockType<GeneratedTypes>\n\nexport type TypedUploadCollection = NonNever<{\n [K in keyof TypedCollection]:\n | 'filename'\n | 'filesize'\n | 'mimeType'\n | 'url' extends keyof TypedCollection[K]\n ? TypedCollection[K]\n : never\n}>\n\nexport type TypedCollectionSelect = ResolveCollectionSelectType<GeneratedTypes>\n\nexport type TypedCollectionJoins = ResolveCollectionJoinsType<GeneratedTypes>\n\nexport type TypedGlobal = ResolveGlobalType<GeneratedTypes>\n\nexport type TypedGlobalSelect = ResolveGlobalSelectType<GeneratedTypes>\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 = StringKeyOf<TypedCollection>\n\nexport type BlockSlug = StringKeyOf<TypedBlock>\n\nexport type UploadCollectionSlug = StringKeyOf<TypedUploadCollection>\n\ntype ResolveDbType<T> = 'db' extends keyof T\n ? T['db']\n : // @ts-expect-error\n T['dbUntyped']\n\nexport type DefaultDocumentIDType = ResolveDbType<GeneratedTypes>['defaultIDType']\nexport type GlobalSlug = StringKeyOf<TypedGlobal>\n\n// now for locale and user\n\n// @ts-expect-error\ntype ResolveLocaleType<T> = 'locale' extends keyof T ? T['locale'] : T['localeUntyped']\n// @ts-expect-error\ntype ResolveUserType<T> = 'user' extends keyof T ? T['user'] : T['userUntyped']\n\nexport type TypedLocale = ResolveLocaleType<GeneratedTypes>\n\n/**\n * @todo rename to `User` in 4.0\n */\nexport type TypedUser = ResolveUserType<GeneratedTypes>\n\n// @ts-expect-error\ntype ResolveAuthOperationsType<T> = 'auth' extends keyof T ? T['auth'] : T['authUntyped']\nexport type TypedAuthOperations = ResolveAuthOperationsType<GeneratedTypes>\n\n// @ts-expect-error\ntype ResolveJobOperationsType<T> = 'jobs' extends keyof T ? T['jobs'] : T['jobsUntyped']\nexport type TypedJobs = ResolveJobOperationsType<GeneratedTypes>\n\ntype HasPayloadJobsType = 'collections' extends keyof GeneratedTypes\n ? 'payload-jobs' extends keyof TypedCollection\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: CountOptions<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 <TSlug extends CollectionSlug, TSelect extends SelectFromCollectionSlug<TSlug>>(\n options: FindOptions<TSlug, TSelect>,\n ): Promise<PaginatedDocs<TransformCollectionWithSelect<TSlug, TSelect>>> => {\n return findLocal<TSlug, TSelect>(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 => `${this.config.serverURL}${this.config.routes.admin}`\n\n getAPIURL = (): string => `${this.config.serverURL}${this.config.routes.api}`\n\n globals!: Globals\n\n importMap!: ImportMap\n\n jobs = getJobsLocalAPI(this)\n\n logger!: Logger\n\n login = async <TSlug extends CollectionSlug>(\n options: LoginOptions<TSlug>,\n ): Promise<{ user: DataFromCollectionSlug<TSlug> } & LoginResult> => {\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(cronConfig.cron ?? DEFAULT_CRON, 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 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 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): 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 component map\n if (skipImportMapGeneration !== true && config.admin?.importMap?.autoGenerate !== false) {\n await generateImportMap(config, {\n log: true,\n })\n }\n\n await payload.db.init?.()\n\n if (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\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 } & Pick<InitOptions, 'config' | 'cron' | 'disableOnInit' | 'importMap'>,\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 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 await reload(config, cached.payload, !options.importMap)\n\n resolve()\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 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 try {\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\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 ?? `ws://localhost:${port}${prefix}${path}`,\n )\n\n cached.ws.onmessage = (event) => {\n if (typeof event.data === 'string') {\n const data = JSON.parse(event.data)\n\n if ('action' in data && data.action === 'serverComponentChanges') {\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 * from './auth/index.js'\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 { 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 serverOnlyAdminConfigProperties,\n serverOnlyConfigProperties,\n type UnsanitizedClientConfig,\n} from './config/client.js'\nexport { defaults } from './config/defaults.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 { 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 { EmailAdapter as PayloadEmailAdapter, SendEmailOptions } from './email/types.js'\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 UnverifiedEmail,\n ValidationError,\n ValidationErrorName,\n} from './errors/index.js'\n\nexport type { ValidationFieldError } from './errors/index.js'\nexport { baseBlockFields } from './fields/baseFields/baseBlockFields.js'\n\nexport { baseIDField } from './fields/baseFields/baseIDField.js'\n\nexport {\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 { sanitizeFields } 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 FieldAffectingData,\n FieldAffectingDataClient,\n FieldBase,\n FieldBaseClient,\n FieldHook,\n FieldHookArgs,\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 { 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 BeforeReadHook as GlobalBeforeReadHook,\n BeforeValidateHook as GlobalBeforeValidateHook,\n DataFromGlobalSlug,\n GlobalAdminOptions,\n GlobalConfig,\n SanitizedGlobalConfig,\n} from './globals/config/types.js'\n\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'\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 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'\n\nexport type {\n BaseJob,\n JobLog,\n JobTaskStatus,\n RunningJob,\n SingleTaskStatus,\n WorkflowConfig,\n WorkflowHandler,\n WorkflowTypes,\n} from './queues/config/types/workflowTypes.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 { 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 type { FieldSchemaJSON } from './utilities/fieldSchemaToJSON.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 { 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'\nexport { appendVersionToQueryKey } from './versions/drafts/appendVersionToQueryKey.js'\nexport { getQueryDraftsSort } from './versions/drafts/getQueryDraftsSort.js'\n\nexport { enforceMaxVersions } from './versions/enforceMaxVersions.js'\nexport { getLatestCollectionVersion } from './versions/getLatestCollectionVersion.js'\nexport { getLatestGlobalVersion } from './versions/getLatestGlobalVersion.js'\nexport { saveVersion } from './versions/saveVersion.js'\nexport type { SchedulePublishTaskInput } from './versions/schedule/types.js'\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","Cron","decrypt","encrypt","authLocal","APIKeyAuthentication","JWTAuthentication","generateImportMap","checkPayloadDependencies","countVersionsLocal","consoleEmailAdapter","fieldAffectsData","getJobsLocalAPI","_internal_jobSystemGlobals","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","serverURL","routes","admin","getAPIURL","api","globals","importMap","jobs","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","push","bin","args","cwd","log","resolve","reject","spawned","stdio","undefined","on","code","error","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","err","initialized","reload","skipImportMapGeneration","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","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","serverOnlyAdminConfigProperties","serverOnlyConfigProperties","defaults","sanitizeConfig","combineQueries","createDatabaseAdapter","defaultBeginTransaction","flattenWhereToOperators","getLocalizedPaths","createMigration","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","UnverifiedEmail","ValidationError","ValidationErrorName","baseBlockFields","baseIDField","createClientField","createClientFields","sanitizeFields","getDefaultValue","afterChangeTraverseFields","afterReadPromise","afterReadTraverseFields","beforeChangeTraverseFields","beforeValidateTraverseFields","sortableFieldTypes","validations","getFolderData","createClientGlobalConfig","createClientGlobalConfigs","docAccessOperationGlobal","findOneOperation","findVersionByIDOperationGlobal","findVersionsOperationGlobal","restoreVersionOperationGlobal","updateOperationGlobal","jobAfterRead","countRunnableOrActiveJobsForQueue","importHandlerPath","_internal_resetJobSystemGlobals","getCurrentDate","getLocalI18n","getFileByPath","_internal_safeFetchGlobal","addDataAndFileToRequest","addLocalesToRequestFromData","sanitizeLocales","commitTransaction","configToJSONSchema","entityToJSONSchema","fieldsToJSONSchema","withNullableJSONSchemaType","createArrayFromCommaDelineated","createLocalReq","createPayloadRequest","deepCopyObject","deepCopyObjectComplex","deepCopyObjectSimple","deepMerge","deepMergeWithCombinedArrays","deepMergeWithReactComponents","deepMergeWithSourceArrays","checkDependencies","getDependencies","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","saveVersion","deepMergeSimple"],"mappings":"AAAA,qDAAqD,GACrD,oDAAoD,GAMpD,SAASA,KAAK,QAAQ,gBAAe;AACrC,OAAOC,YAAY,SAAQ;AAC3B,SAASC,aAAa,QAAQ,WAAU;AACxC,OAAOC,UAAU,OAAM;AACvB,OAAOC,eAAe,KAAI;AAe1B,SACEC,mBAAmB,QAEd,4CAA2C;AAClD,SAASC,UAAU,QAAsC,mCAAkC;AAC3F,SACEC,kBAAkB,QAEb,2CAA0C;AACjD,SAASC,WAAW,QAAuC,oCAAmC;AAC9F,SACEC,gBAAgB,QAEX,yCAAwC;AAe/C,SAASC,UAAU,QAAsC,0CAAyC;AAClG,SACEC,WAAW,QAEN,2CAA0C;AACjD,SAEEC,WAAW,QAG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AAkC;AACrE,SAASC,0BAA0B,QAAQ,2CAA0C;AACrF,SAASC,sBAAsB,QAAQ,uCAAsC;AAC7E,SAASC,WAAW,QAAQ,4BAA2B;AAGvD,SAASC,eAAe,QAAQ,qCAAoC"}
@@ -1 +1 @@
1
- {"version":3,"file":"global.d.ts","sourceRoot":"","sources":["../../../src/queues/config/global.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAE7D,eAAO,MAAM,kBAAkB,uBAAuB,CAAA;AAEtD;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG;IACrB,KAAK,CAAC,EAAE;QACN,aAAa,CAAC,EAAE;YACd,MAAM,CAAC,EAAE;gBACP,CAAC,SAAS,EAAE,MAAM,GAAG;oBACnB,KAAK,CAAC,EAAE;wBACN,CAAC,QAAQ,EAAE,QAAQ,GAAG;4BACpB,gBAAgB,EAAE,MAAM,CAAA;yBACzB,CAAA;qBACF,CAAA;oBACD,SAAS,CAAC,EAAE;wBACV,CAAC,YAAY,EAAE,aAAa,GAAG;4BAC7B,gBAAgB,EAAE,MAAM,CAAA;yBACzB,CAAA;qBACF,CAAA;iBACF,CAAA;aACF,CAAA;SACF,CAAA;KACF,CAAA;CACF,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,YAUnD,CAAA"}
1
+ {"version":3,"file":"global.d.ts","sourceRoot":"","sources":["../../../src/queues/config/global.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAE7D,eAAO,MAAM,kBAAkB,uBAAuB,CAAA;AAEtD;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG;IACrB,KAAK,CAAC,EAAE;QACN,aAAa,CAAC,EAAE;YACd,MAAM,CAAC,EAAE;gBACP,CAAC,SAAS,EAAE,MAAM,GAAG;oBACnB,KAAK,CAAC,EAAE;wBACN,CAAC,QAAQ,EAAE,QAAQ,GAAG;4BACpB,gBAAgB,EAAE,MAAM,CAAA;yBACzB,CAAA;qBACF,CAAA;oBACD,SAAS,CAAC,EAAE;wBACV,CAAC,YAAY,EAAE,aAAa,GAAG;4BAC7B,gBAAgB,EAAE,MAAM,CAAA;yBACzB,CAAA;qBACF,CAAA;iBACF,CAAA;aACF,CAAA;SACF,CAAA;KACF,CAAA;CACF,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,YAcnD,CAAA"}
@@ -4,6 +4,10 @@ export const jobStatsGlobalSlug = 'payload-jobs-stats';
4
4
  */ export const getJobStatsGlobal = (config)=>{
5
5
  return {
6
6
  slug: jobStatsGlobalSlug,
7
+ admin: {
8
+ group: 'System',
9
+ hidden: true
10
+ },
7
11
  fields: [
8
12
  {
9
13
  name: 'stats',
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/queues/config/global.ts"],"sourcesContent":["import type { Config } from '../../config/types.js'\nimport type { GlobalConfig } from '../../globals/config/types.js'\nimport type { TaskType } from './types/taskTypes.js'\nimport type { WorkflowTypes } from './types/workflowTypes.js'\n\nexport const jobStatsGlobalSlug = 'payload-jobs-stats'\n\n/**\n * Type for data stored in the payload-jobs-stats global.\n */\nexport type JobStats = {\n stats?: {\n scheduledRuns?: {\n queues?: {\n [queueSlug: string]: {\n tasks?: {\n [taskSlug: TaskType]: {\n lastScheduledRun: string\n }\n }\n workflows?: {\n [workflowSlug: WorkflowTypes]: {\n lastScheduledRun: string\n }\n }\n }\n }\n }\n }\n}\n\n/**\n * Global config for job statistics.\n */\nexport const getJobStatsGlobal: (config: Config) => GlobalConfig = (config) => {\n return {\n slug: jobStatsGlobalSlug,\n fields: [\n {\n name: 'stats',\n type: 'json',\n },\n ],\n }\n}\n"],"names":["jobStatsGlobalSlug","getJobStatsGlobal","config","slug","fields","name","type"],"mappings":"AAKA,OAAO,MAAMA,qBAAqB,qBAAoB;AA0BtD;;CAEC,GACD,OAAO,MAAMC,oBAAsD,CAACC;IAClE,OAAO;QACLC,MAAMH;QACNI,QAAQ;YACN;gBACEC,MAAM;gBACNC,MAAM;YACR;SACD;IACH;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../src/queues/config/global.ts"],"sourcesContent":["import type { Config } from '../../config/types.js'\nimport type { GlobalConfig } from '../../globals/config/types.js'\nimport type { TaskType } from './types/taskTypes.js'\nimport type { WorkflowTypes } from './types/workflowTypes.js'\n\nexport const jobStatsGlobalSlug = 'payload-jobs-stats'\n\n/**\n * Type for data stored in the payload-jobs-stats global.\n */\nexport type JobStats = {\n stats?: {\n scheduledRuns?: {\n queues?: {\n [queueSlug: string]: {\n tasks?: {\n [taskSlug: TaskType]: {\n lastScheduledRun: string\n }\n }\n workflows?: {\n [workflowSlug: WorkflowTypes]: {\n lastScheduledRun: string\n }\n }\n }\n }\n }\n }\n}\n\n/**\n * Global config for job statistics.\n */\nexport const getJobStatsGlobal: (config: Config) => GlobalConfig = (config) => {\n return {\n slug: jobStatsGlobalSlug,\n admin: {\n group: 'System',\n hidden: true,\n },\n fields: [\n {\n name: 'stats',\n type: 'json',\n },\n ],\n }\n}\n"],"names":["jobStatsGlobalSlug","getJobStatsGlobal","config","slug","admin","group","hidden","fields","name","type"],"mappings":"AAKA,OAAO,MAAMA,qBAAqB,qBAAoB;AA0BtD;;CAEC,GACD,OAAO,MAAMC,oBAAsD,CAACC;IAClE,OAAO;QACLC,MAAMH;QACNI,OAAO;YACLC,OAAO;YACPC,QAAQ;QACV;QACAC,QAAQ;YACN;gBACEC,MAAM;gBACNC,MAAM;YACR;SACD;IACH;AACF,EAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payload",
3
- "version": "3.54.0-internal.84621da",
3
+ "version": "3.54.0-internal.90cf7d5",
4
4
  "description": "Node, React, Headless CMS and Application Framework built on Next.js",
5
5
  "keywords": [
6
6
  "admin panel",
@@ -101,7 +101,7 @@
101
101
  "undici": "7.10.0",
102
102
  "uuid": "10.0.0",
103
103
  "ws": "^8.16.0",
104
- "@payloadcms/translations": "3.54.0-internal.84621da"
104
+ "@payloadcms/translations": "3.54.0-internal.90cf7d5"
105
105
  },
106
106
  "devDependencies": {
107
107
  "@hyrious/esbuild-plugin-commonjs": "0.2.6",