@depup/payload 3.82.1-depup.0 → 3.86.0-depup.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -13
- package/bin.js +11 -0
- package/changes.json +25 -17
- package/dist/admin/fields/Row.d.ts +2 -2
- package/dist/admin/fields/Row.d.ts.map +1 -1
- package/dist/admin/fields/Row.js.map +1 -1
- package/dist/admin/forms/Field.d.ts +1 -3
- package/dist/admin/forms/Field.d.ts.map +1 -1
- package/dist/admin/forms/Field.js.map +1 -1
- package/dist/admin/views/index.d.ts +5 -1
- package/dist/admin/views/index.d.ts.map +1 -1
- package/dist/admin/views/index.js.map +1 -1
- package/dist/bin/generateImportMap/index.d.ts.map +1 -1
- package/dist/bin/generateImportMap/index.js +1 -0
- package/dist/bin/generateImportMap/index.js.map +1 -1
- package/dist/bin/generateImportMap/iterateCollections.d.ts.map +1 -1
- package/dist/bin/generateImportMap/iterateCollections.js +11 -0
- package/dist/bin/generateImportMap/iterateCollections.js.map +1 -1
- package/dist/bin/index.d.ts.map +1 -1
- package/dist/bin/index.js +3 -1
- package/dist/bin/index.js.map +1 -1
- package/dist/collections/config/sanitize.d.ts +5 -0
- package/dist/collections/config/sanitize.d.ts.map +1 -1
- package/dist/collections/config/sanitize.js +21 -0
- package/dist/collections/config/sanitize.js.map +1 -1
- package/dist/collections/config/sanitize.spec.js +120 -0
- package/dist/collections/config/sanitize.spec.js.map +1 -0
- package/dist/collections/config/types.d.ts +24 -1
- package/dist/collections/config/types.d.ts.map +1 -1
- package/dist/collections/config/types.js.map +1 -1
- package/dist/collections/operations/create.d.ts.map +1 -1
- package/dist/collections/operations/create.js +1 -0
- package/dist/collections/operations/create.js.map +1 -1
- package/dist/collections/operations/delete.d.ts.map +1 -1
- package/dist/collections/operations/delete.js +3 -0
- package/dist/collections/operations/delete.js.map +1 -1
- package/dist/collections/operations/restoreVersion.d.ts.map +1 -1
- package/dist/collections/operations/restoreVersion.js +1 -0
- package/dist/collections/operations/restoreVersion.js.map +1 -1
- package/dist/collections/operations/update.d.ts.map +1 -1
- package/dist/collections/operations/update.js +7 -2
- package/dist/collections/operations/update.js.map +1 -1
- package/dist/collections/operations/utilities/copyDataWithFreshRowIDs.d.ts +9 -0
- package/dist/collections/operations/utilities/copyDataWithFreshRowIDs.d.ts.map +1 -0
- package/dist/collections/operations/utilities/copyDataWithFreshRowIDs.js +170 -0
- package/dist/collections/operations/utilities/copyDataWithFreshRowIDs.js.map +1 -0
- package/dist/collections/operations/utilities/update.d.ts.map +1 -1
- package/dist/collections/operations/utilities/update.js +16 -8
- package/dist/collections/operations/utilities/update.js.map +1 -1
- package/dist/config/build.js +5 -4
- package/dist/config/build.js.map +1 -1
- package/dist/config/definePlugin.d.ts +41 -0
- package/dist/config/definePlugin.d.ts.map +1 -0
- package/dist/config/definePlugin.js +34 -0
- package/dist/config/definePlugin.js.map +1 -0
- package/dist/config/orderable/index.d.ts.map +1 -1
- package/dist/config/orderable/index.js +23 -0
- package/dist/config/orderable/index.js.map +1 -1
- package/dist/config/types.d.ts +30 -2
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config/types.js.map +1 -1
- package/dist/email/normalizeSendEmailOptions.d.ts +13 -0
- package/dist/email/normalizeSendEmailOptions.d.ts.map +1 -0
- package/dist/email/normalizeSendEmailOptions.js +20 -0
- package/dist/email/normalizeSendEmailOptions.js.map +1 -0
- package/dist/email/types.d.ts +7 -2
- package/dist/email/types.d.ts.map +1 -1
- package/dist/email/types.js.map +1 -1
- package/dist/errors/APIError.d.ts +2 -1
- package/dist/errors/APIError.d.ts.map +1 -1
- package/dist/errors/APIError.js +1 -3
- package/dist/errors/APIError.js.map +1 -1
- package/dist/errors/ValidationError.d.ts +3 -1
- package/dist/errors/ValidationError.d.ts.map +1 -1
- package/dist/errors/ValidationError.js +1 -3
- package/dist/errors/ValidationError.js.map +1 -1
- package/dist/fields/config/sanitize.d.ts.map +1 -1
- package/dist/fields/config/sanitize.js +3 -0
- package/dist/fields/config/sanitize.js.map +1 -1
- package/dist/fields/config/sanitize.spec.js +66 -0
- package/dist/fields/config/sanitize.spec.js.map +1 -1
- package/dist/fields/config/types.d.ts +3 -2
- package/dist/fields/config/types.d.ts.map +1 -1
- package/dist/fields/config/types.js.map +1 -1
- package/dist/fields/hooks/beforeValidate/promise.js +2 -2
- package/dist/fields/hooks/beforeValidate/promise.js.map +1 -1
- package/dist/globals/operations/restoreVersion.d.ts.map +1 -1
- package/dist/globals/operations/restoreVersion.js +1 -0
- package/dist/globals/operations/restoreVersion.js.map +1 -1
- package/dist/index.bundled.d.ts +484 -115
- package/dist/index.d.ts +19 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -2
- package/dist/index.js.map +1 -1
- package/dist/queues/config/collection.d.ts.map +1 -1
- package/dist/queues/config/collection.js +0 -1
- package/dist/queues/config/collection.js.map +1 -1
- package/dist/queues/endpoints/run.d.ts.map +1 -1
- package/dist/queues/endpoints/run.js +0 -3
- package/dist/queues/endpoints/run.js.map +1 -1
- package/dist/queues/errors/calculateBackoffWaitUntil.d.ts.map +1 -1
- package/dist/queues/errors/calculateBackoffWaitUntil.js +5 -13
- package/dist/queues/errors/calculateBackoffWaitUntil.js.map +1 -1
- package/dist/queues/errors/handleWorkflowError.d.ts.map +1 -1
- package/dist/queues/errors/handleWorkflowError.js +9 -1
- package/dist/queues/errors/handleWorkflowError.js.map +1 -1
- package/dist/queues/operations/handleSchedules/countRunnableOrActiveJobsForQueue.d.ts.map +1 -1
- package/dist/queues/operations/handleSchedules/countRunnableOrActiveJobsForQueue.js +2 -1
- package/dist/queues/operations/handleSchedules/countRunnableOrActiveJobsForQueue.js.map +1 -1
- package/dist/queues/operations/handleSchedules/defaultAfterSchedule.js +1 -1
- package/dist/queues/operations/handleSchedules/defaultAfterSchedule.js.map +1 -1
- package/dist/queues/operations/handleSchedules/index.d.ts.map +1 -1
- package/dist/queues/operations/handleSchedules/index.js +4 -1
- package/dist/queues/operations/handleSchedules/index.js.map +1 -1
- package/dist/queues/operations/runJobs/index.d.ts.map +1 -1
- package/dist/queues/operations/runJobs/index.js +44 -26
- package/dist/queues/operations/runJobs/index.js.map +1 -1
- package/dist/queues/operations/runJobs/runJSONJob/index.d.ts.map +1 -1
- package/dist/queues/operations/runJobs/runJSONJob/index.js +1 -0
- package/dist/queues/operations/runJobs/runJSONJob/index.js.map +1 -1
- package/dist/queues/utilities/updateJob.d.ts.map +1 -1
- package/dist/queues/utilities/updateJob.js +2 -1
- package/dist/queues/utilities/updateJob.js.map +1 -1
- package/dist/types/index.d.ts +4 -6
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/uploads/checkFileAccess.d.ts.map +1 -1
- package/dist/uploads/checkFileAccess.js +30 -9
- package/dist/uploads/checkFileAccess.js.map +1 -1
- package/dist/uploads/checkFileRestrictions.d.ts.map +1 -1
- package/dist/uploads/checkFileRestrictions.js +48 -8
- package/dist/uploads/checkFileRestrictions.js.map +1 -1
- package/dist/uploads/fetchAPI-multipart/isEligibleRequest.d.ts.map +1 -1
- package/dist/uploads/fetchAPI-multipart/isEligibleRequest.js +2 -1
- package/dist/uploads/fetchAPI-multipart/isEligibleRequest.js.map +1 -1
- package/dist/uploads/fetchAPI-multipart/isEligibleRequest.spec.js +29 -0
- package/dist/uploads/fetchAPI-multipart/isEligibleRequest.spec.js.map +1 -0
- package/dist/uploads/fetchAPI-multipart/processMultipart.d.ts.map +1 -1
- package/dist/uploads/fetchAPI-multipart/processMultipart.js +11 -2
- package/dist/uploads/fetchAPI-multipart/processMultipart.js.map +1 -1
- package/dist/uploads/generateFileData.d.ts +2 -1
- package/dist/uploads/generateFileData.d.ts.map +1 -1
- package/dist/uploads/generateFileData.js +5 -2
- package/dist/uploads/generateFileData.js.map +1 -1
- package/dist/uploads/getSafeFilename.d.ts +9 -4
- package/dist/uploads/getSafeFilename.d.ts.map +1 -1
- package/dist/uploads/getSafeFilename.js +5 -5
- package/dist/uploads/getSafeFilename.js.map +1 -1
- package/dist/uploads/types.d.ts +4 -0
- package/dist/uploads/types.d.ts.map +1 -1
- package/dist/uploads/types.js.map +1 -1
- package/dist/utilities/addDataAndFileToRequest.d.ts.map +1 -1
- package/dist/utilities/addDataAndFileToRequest.js +16 -3
- package/dist/utilities/addDataAndFileToRequest.js.map +1 -1
- package/dist/utilities/addDataAndFileToRequest.spec.js +41 -0
- package/dist/utilities/addDataAndFileToRequest.spec.js.map +1 -0
- package/dist/utilities/createPayloadRequest.d.ts.map +1 -1
- package/dist/utilities/createPayloadRequest.js +1 -0
- package/dist/utilities/createPayloadRequest.js.map +1 -1
- package/dist/utilities/filterDataToSelectedLocales.d.ts.map +1 -1
- package/dist/utilities/filterDataToSelectedLocales.js +74 -31
- package/dist/utilities/filterDataToSelectedLocales.js.map +1 -1
- package/dist/utilities/filterDataToSelectedLocales.spec.js +337 -0
- package/dist/utilities/filterDataToSelectedLocales.spec.js.map +1 -1
- package/dist/utilities/formatErrors.d.ts +1 -1
- package/dist/utilities/formatErrors.d.ts.map +1 -1
- package/dist/utilities/formatErrors.js +4 -7
- package/dist/utilities/formatErrors.js.map +1 -1
- package/dist/utilities/formatErrors.spec.js +101 -0
- package/dist/utilities/formatErrors.spec.js.map +1 -0
- package/dist/utilities/isURLAllowed.d.ts.map +1 -1
- package/dist/utilities/isURLAllowed.js +9 -3
- package/dist/utilities/isURLAllowed.js.map +1 -1
- package/dist/utilities/isURLAllowed.spec.js +78 -0
- package/dist/utilities/isURLAllowed.spec.js.map +1 -0
- package/dist/utilities/parseParams/index.d.ts +1 -1
- package/dist/utilities/parseParams/index.d.ts.map +1 -1
- package/dist/utilities/parseParams/index.js +3 -0
- package/dist/utilities/parseParams/index.js.map +1 -1
- package/dist/utilities/parseParams/index.spec.js +24 -0
- package/dist/utilities/parseParams/index.spec.js.map +1 -1
- package/dist/utilities/profiling.d.ts +12 -0
- package/dist/utilities/profiling.d.ts.map +1 -0
- package/dist/utilities/profiling.js +56 -0
- package/dist/utilities/profiling.js.map +1 -0
- package/dist/utilities/profiling.spec.js +53 -0
- package/dist/utilities/profiling.spec.js.map +1 -0
- package/dist/versions/saveVersion.js +1 -1
- package/dist/versions/saveVersion.js.map +1 -1
- package/dist/versions/schedule/job.d.ts.map +1 -1
- package/dist/versions/schedule/job.js +4 -1
- package/dist/versions/schedule/job.js.map +1 -1
- package/dist/versions/updateLatestVersion.d.ts.map +1 -1
- package/dist/versions/updateLatestVersion.js +55 -8
- package/dist/versions/updateLatestVersion.js.map +1 -1
- package/package.json +42 -35
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
const profiles = new Map();
|
|
2
|
+
const callStack = [];
|
|
3
|
+
export const timeSync = (name, fn)=>{
|
|
4
|
+
callStack.push(name);
|
|
5
|
+
const start = performance.now();
|
|
6
|
+
try {
|
|
7
|
+
return fn();
|
|
8
|
+
} finally{
|
|
9
|
+
const duration = performance.now() - start;
|
|
10
|
+
callStack.pop();
|
|
11
|
+
const entry = profiles.get(name) || {
|
|
12
|
+
name,
|
|
13
|
+
calls: 0,
|
|
14
|
+
duration: 0
|
|
15
|
+
};
|
|
16
|
+
entry.duration += duration;
|
|
17
|
+
entry.calls++;
|
|
18
|
+
profiles.set(name, entry);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
export const timeAsync = async (name, fn)=>{
|
|
22
|
+
callStack.push(name);
|
|
23
|
+
const start = performance.now();
|
|
24
|
+
try {
|
|
25
|
+
return await fn();
|
|
26
|
+
} finally{
|
|
27
|
+
const duration = performance.now() - start;
|
|
28
|
+
callStack.pop();
|
|
29
|
+
const entry = profiles.get(name) || {
|
|
30
|
+
name,
|
|
31
|
+
calls: 0,
|
|
32
|
+
duration: 0
|
|
33
|
+
};
|
|
34
|
+
entry.duration += duration;
|
|
35
|
+
entry.calls++;
|
|
36
|
+
profiles.set(name, entry);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
export const clearProfiles = ()=>{
|
|
40
|
+
profiles.clear();
|
|
41
|
+
};
|
|
42
|
+
export const printProfileResults = ()=>{
|
|
43
|
+
const entries = Array.from(profiles.values()).sort((a, b)=>b.duration - a.duration);
|
|
44
|
+
console.log('\n=== Profile Results ===');
|
|
45
|
+
console.log('Name'.padEnd(50) + 'Duration (ms)'.padStart(15) + 'Calls'.padStart(10));
|
|
46
|
+
console.log('-'.repeat(75));
|
|
47
|
+
for (const entry of entries){
|
|
48
|
+
console.log(entry.name.padEnd(50) + entry.duration.toFixed(2).padStart(15) + String(entry.calls).padStart(10));
|
|
49
|
+
}
|
|
50
|
+
console.log('='.repeat(75) + '\n');
|
|
51
|
+
};
|
|
52
|
+
export const getProfileResults = ()=>{
|
|
53
|
+
return Array.from(profiles.values()).sort((a, b)=>b.duration - a.duration);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
//# sourceMappingURL=profiling.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utilities/profiling.ts"],"sourcesContent":["type ProfileEntry = {\n calls: number\n duration: number\n name: string\n}\n\nconst profiles = new Map<string, ProfileEntry>()\nconst callStack: string[] = []\n\nexport const timeSync = <T>(name: string, fn: () => T): T => {\n callStack.push(name)\n const start = performance.now()\n try {\n return fn()\n } finally {\n const duration = performance.now() - start\n callStack.pop()\n const entry = profiles.get(name) || { name, calls: 0, duration: 0 }\n entry.duration += duration\n entry.calls++\n profiles.set(name, entry)\n }\n}\n\nexport const timeAsync = async <T>(name: string, fn: () => Promise<T>): Promise<T> => {\n callStack.push(name)\n const start = performance.now()\n try {\n return await fn()\n } finally {\n const duration = performance.now() - start\n callStack.pop()\n const entry = profiles.get(name) || { name, calls: 0, duration: 0 }\n entry.duration += duration\n entry.calls++\n profiles.set(name, entry)\n }\n}\n\nexport const clearProfiles = () => {\n profiles.clear()\n}\n\nexport const printProfileResults = () => {\n const entries = Array.from(profiles.values()).sort((a, b) => b.duration - a.duration)\n\n console.log('\\n=== Profile Results ===')\n console.log('Name'.padEnd(50) + 'Duration (ms)'.padStart(15) + 'Calls'.padStart(10))\n console.log('-'.repeat(75))\n\n for (const entry of entries) {\n console.log(\n entry.name.padEnd(50) +\n entry.duration.toFixed(2).padStart(15) +\n String(entry.calls).padStart(10),\n )\n }\n\n console.log('='.repeat(75) + '\\n')\n}\n\nexport const getProfileResults = () => {\n return Array.from(profiles.values()).sort((a, b) => b.duration - a.duration)\n}\n"],"names":["profiles","Map","callStack","timeSync","name","fn","push","start","performance","now","duration","pop","entry","get","calls","set","timeAsync","clearProfiles","clear","printProfileResults","entries","Array","from","values","sort","a","b","console","log","padEnd","padStart","repeat","toFixed","String","getProfileResults"],"mappings":"AAMA,MAAMA,WAAW,IAAIC;AACrB,MAAMC,YAAsB,EAAE;AAE9B,OAAO,MAAMC,WAAW,CAAIC,MAAcC;IACxCH,UAAUI,IAAI,CAACF;IACf,MAAMG,QAAQC,YAAYC,GAAG;IAC7B,IAAI;QACF,OAAOJ;IACT,SAAU;QACR,MAAMK,WAAWF,YAAYC,GAAG,KAAKF;QACrCL,UAAUS,GAAG;QACb,MAAMC,QAAQZ,SAASa,GAAG,CAACT,SAAS;YAAEA;YAAMU,OAAO;YAAGJ,UAAU;QAAE;QAClEE,MAAMF,QAAQ,IAAIA;QAClBE,MAAME,KAAK;QACXd,SAASe,GAAG,CAACX,MAAMQ;IACrB;AACF,EAAC;AAED,OAAO,MAAMI,YAAY,OAAUZ,MAAcC;IAC/CH,UAAUI,IAAI,CAACF;IACf,MAAMG,QAAQC,YAAYC,GAAG;IAC7B,IAAI;QACF,OAAO,MAAMJ;IACf,SAAU;QACR,MAAMK,WAAWF,YAAYC,GAAG,KAAKF;QACrCL,UAAUS,GAAG;QACb,MAAMC,QAAQZ,SAASa,GAAG,CAACT,SAAS;YAAEA;YAAMU,OAAO;YAAGJ,UAAU;QAAE;QAClEE,MAAMF,QAAQ,IAAIA;QAClBE,MAAME,KAAK;QACXd,SAASe,GAAG,CAACX,MAAMQ;IACrB;AACF,EAAC;AAED,OAAO,MAAMK,gBAAgB;IAC3BjB,SAASkB,KAAK;AAChB,EAAC;AAED,OAAO,MAAMC,sBAAsB;IACjC,MAAMC,UAAUC,MAAMC,IAAI,CAACtB,SAASuB,MAAM,IAAIC,IAAI,CAAC,CAACC,GAAGC,IAAMA,EAAEhB,QAAQ,GAAGe,EAAEf,QAAQ;IAEpFiB,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC,OAAOC,MAAM,CAAC,MAAM,gBAAgBC,QAAQ,CAAC,MAAM,QAAQA,QAAQ,CAAC;IAChFH,QAAQC,GAAG,CAAC,IAAIG,MAAM,CAAC;IAEvB,KAAK,MAAMnB,SAASQ,QAAS;QAC3BO,QAAQC,GAAG,CACThB,MAAMR,IAAI,CAACyB,MAAM,CAAC,MAChBjB,MAAMF,QAAQ,CAACsB,OAAO,CAAC,GAAGF,QAAQ,CAAC,MACnCG,OAAOrB,MAAME,KAAK,EAAEgB,QAAQ,CAAC;IAEnC;IAEAH,QAAQC,GAAG,CAAC,IAAIG,MAAM,CAAC,MAAM;AAC/B,EAAC;AAED,OAAO,MAAMG,oBAAoB;IAC/B,OAAOb,MAAMC,IAAI,CAACtB,SAASuB,MAAM,IAAIC,IAAI,CAAC,CAACC,GAAGC,IAAMA,EAAEhB,QAAQ,GAAGe,EAAEf,QAAQ;AAC7E,EAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { clearProfiles, getProfileResults, printProfileResults, timeAsync, timeSync } from './profiling.js';
|
|
3
|
+
describe('Profiling Utilities', ()=>{
|
|
4
|
+
it('should time synchronous functions', ()=>{
|
|
5
|
+
clearProfiles();
|
|
6
|
+
const result = timeSync('syncOperation', ()=>{
|
|
7
|
+
let sum = 0;
|
|
8
|
+
for(let i = 0; i < 1000; i++){
|
|
9
|
+
sum += i;
|
|
10
|
+
}
|
|
11
|
+
return sum;
|
|
12
|
+
});
|
|
13
|
+
expect(result).toBe(499500);
|
|
14
|
+
const results = getProfileResults();
|
|
15
|
+
expect(results).toHaveLength(1);
|
|
16
|
+
expect(results[0]?.name).toBe('syncOperation');
|
|
17
|
+
expect(results[0]?.calls).toBe(1);
|
|
18
|
+
expect(results[0]?.duration).toBeGreaterThanOrEqual(0);
|
|
19
|
+
});
|
|
20
|
+
it('should time async functions', async ()=>{
|
|
21
|
+
clearProfiles();
|
|
22
|
+
const result = await timeAsync('asyncOperation', async ()=>{
|
|
23
|
+
await new Promise((resolve)=>setTimeout(resolve, 10));
|
|
24
|
+
return 'done';
|
|
25
|
+
});
|
|
26
|
+
expect(result).toBe('done');
|
|
27
|
+
const results = getProfileResults();
|
|
28
|
+
expect(results).toHaveLength(1);
|
|
29
|
+
expect(results[0]?.name).toBe('asyncOperation');
|
|
30
|
+
expect(results[0]?.calls).toBe(1);
|
|
31
|
+
expect(results[0]?.duration).toBeGreaterThanOrEqual(9);
|
|
32
|
+
});
|
|
33
|
+
it('should accumulate multiple calls', ()=>{
|
|
34
|
+
clearProfiles();
|
|
35
|
+
for(let i = 0; i < 5; i++){
|
|
36
|
+
timeSync('repeatedOperation', ()=>i * 2);
|
|
37
|
+
}
|
|
38
|
+
const results = getProfileResults();
|
|
39
|
+
expect(results).toHaveLength(1);
|
|
40
|
+
expect(results[0]?.calls).toBe(5);
|
|
41
|
+
});
|
|
42
|
+
it('should print profile results', ()=>{
|
|
43
|
+
clearProfiles();
|
|
44
|
+
timeSync('operation1', ()=>'a');
|
|
45
|
+
timeSync('operation2', ()=>'b');
|
|
46
|
+
// Just ensure it doesn't throw
|
|
47
|
+
printProfileResults();
|
|
48
|
+
const results = getProfileResults();
|
|
49
|
+
expect(results).toHaveLength(2);
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=profiling.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utilities/profiling.spec.ts"],"sourcesContent":["import { describe, expect, it } from 'vitest'\n\nimport {\n clearProfiles,\n getProfileResults,\n printProfileResults,\n timeAsync,\n timeSync,\n} from './profiling.js'\n\ndescribe('Profiling Utilities', () => {\n it('should time synchronous functions', () => {\n clearProfiles()\n\n const result = timeSync('syncOperation', () => {\n let sum = 0\n for (let i = 0; i < 1000; i++) {\n sum += i\n }\n return sum\n })\n\n expect(result).toBe(499500)\n\n const results = getProfileResults()\n expect(results).toHaveLength(1)\n expect(results[0]?.name).toBe('syncOperation')\n expect(results[0]?.calls).toBe(1)\n expect(results[0]?.duration).toBeGreaterThanOrEqual(0)\n })\n\n it('should time async functions', async () => {\n clearProfiles()\n\n const result = await timeAsync('asyncOperation', async () => {\n await new Promise((resolve) => setTimeout(resolve, 10))\n return 'done'\n })\n\n expect(result).toBe('done')\n\n const results = getProfileResults()\n expect(results).toHaveLength(1)\n expect(results[0]?.name).toBe('asyncOperation')\n expect(results[0]?.calls).toBe(1)\n expect(results[0]?.duration).toBeGreaterThanOrEqual(9)\n })\n\n it('should accumulate multiple calls', () => {\n clearProfiles()\n\n for (let i = 0; i < 5; i++) {\n timeSync('repeatedOperation', () => i * 2)\n }\n\n const results = getProfileResults()\n expect(results).toHaveLength(1)\n expect(results[0]?.calls).toBe(5)\n })\n\n it('should print profile results', () => {\n clearProfiles()\n\n timeSync('operation1', () => 'a')\n timeSync('operation2', () => 'b')\n\n // Just ensure it doesn't throw\n printProfileResults()\n\n const results = getProfileResults()\n expect(results).toHaveLength(2)\n })\n})\n"],"names":["describe","expect","it","clearProfiles","getProfileResults","printProfileResults","timeAsync","timeSync","result","sum","i","toBe","results","toHaveLength","name","calls","duration","toBeGreaterThanOrEqual","Promise","resolve","setTimeout"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,SAAQ;AAE7C,SACEC,aAAa,EACbC,iBAAiB,EACjBC,mBAAmB,EACnBC,SAAS,EACTC,QAAQ,QACH,iBAAgB;AAEvBP,SAAS,uBAAuB;IAC9BE,GAAG,qCAAqC;QAC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AASC,YAAY,CAAC;IAC/B;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/versions/saveVersion.ts"],"sourcesContent":["import type { SanitizedCollectionConfig } from '../collections/config/types.js'\nimport type { SanitizedGlobalConfig } from '../globals/config/types.js'\nimport type { CreateGlobalVersionArgs, CreateVersionArgs, Payload } from '../index.js'\nimport type { JsonObject, PayloadRequest, SelectType } from '../types/index.js'\n\nimport { deepCopyObjectSimple } from '../index.js'\nimport { getVersionsMax } from '../utilities/getVersionsConfig.js'\nimport { sanitizeInternalFields } from '../utilities/sanitizeInternalFields.js'\nimport { getQueryDraftsSelect } from './drafts/getQueryDraftsSelect.js'\nimport { enforceMaxVersions } from './enforceMaxVersions.js'\nimport { saveSnapshot } from './saveSnapshot.js'\nimport { updateLatestVersion } from './updateLatestVersion.js'\n\ntype Args<T extends JsonObject = JsonObject> = {\n autosave?: boolean\n collection?: SanitizedCollectionConfig\n docWithLocales: T\n draft?: boolean\n global?: SanitizedGlobalConfig\n id?: number | string\n operation?: 'create' | 'restoreVersion' | 'update'\n payload: Payload\n publishSpecificLocale?: string\n req?: PayloadRequest\n returning?: boolean\n select?: SelectType\n snapshot?: any\n unpublish?: boolean\n}\n\nexport async function saveVersion<TData extends JsonObject = JsonObject>(\n args: { returning: false } & Args<TData>,\n): Promise<null>\nexport async function saveVersion<TData extends JsonObject = JsonObject>(\n args: { returning: true } & Args<TData>,\n): Promise<JsonObject>\nexport async function saveVersion<TData extends JsonObject = JsonObject>(\n args: Omit<Args<TData>, 'returning'>,\n): Promise<JsonObject>\nexport async function saveVersion<TData extends JsonObject = JsonObject>({\n id,\n autosave,\n collection,\n docWithLocales,\n draft,\n global,\n operation,\n payload,\n publishSpecificLocale,\n req,\n returning,\n select,\n snapshot,\n unpublish,\n}: Args<TData>): Promise<JsonObject | null> {\n let result: JsonObject | undefined\n let createdNewVersion = false\n const now = new Date().toISOString()\n const versionData: {\n _status?: 'draft'\n updatedAt?: string\n } & TData = deepCopyObjectSimple(docWithLocales)\n\n if ((collection?.timestamps || global) && draft) {\n versionData.updatedAt = now\n }\n\n if (versionData._id) {\n delete versionData._id\n }\n\n try {\n if (unpublish || autosave) {\n result = await updateLatestVersion({\n id,\n collection,\n global,\n now,\n payload,\n req,\n shouldUpdate: autosave ? (v) => 'autosave' in v && v.autosave === true : undefined,\n versionData,\n })\n }\n\n if (!result) {\n createdNewVersion = true\n\n const createVersionArgs = {\n autosave: Boolean(autosave),\n collectionSlug: undefined as string | undefined,\n createdAt: operation === 'restoreVersion' ? versionData.createdAt : now,\n globalSlug: undefined as string | undefined,\n parent: collection ? id : undefined,\n publishedLocale: publishSpecificLocale || undefined,\n req,\n returning,\n select: getQueryDraftsSelect({ select }),\n updatedAt: now,\n versionData,\n }\n\n if (collection) {\n createVersionArgs.collectionSlug = collection.slug\n result = await payload.db.createVersion(createVersionArgs as CreateVersionArgs)\n }\n\n if (global) {\n createVersionArgs.globalSlug = global.slug\n result = await payload.db.createGlobalVersion(createVersionArgs as CreateGlobalVersionArgs)\n }\n\n if (snapshot) {\n await saveSnapshot<TData>({\n id,\n autosave,\n collection,\n data: snapshot,\n global,\n payload,\n publishSpecificLocale,\n req,\n select,\n })\n }\n }\n } catch (err) {\n let errorMessage: string | undefined\n\n if (collection) {\n errorMessage = `There was an error while saving a version for the ${typeof collection.labels.singular === 'string' ? collection.labels.singular : collection.slug} with ID ${id}.`\n }\n if (global) {\n errorMessage = `There was an error while saving a version for the global ${typeof global.label === 'string' ? global.label : global.slug}.`\n }\n payload.logger.error({ err, msg: errorMessage })\n
|
|
1
|
+
{"version":3,"sources":["../../src/versions/saveVersion.ts"],"sourcesContent":["import type { SanitizedCollectionConfig } from '../collections/config/types.js'\nimport type { SanitizedGlobalConfig } from '../globals/config/types.js'\nimport type { CreateGlobalVersionArgs, CreateVersionArgs, Payload } from '../index.js'\nimport type { JsonObject, PayloadRequest, SelectType } from '../types/index.js'\n\nimport { deepCopyObjectSimple } from '../index.js'\nimport { getVersionsMax } from '../utilities/getVersionsConfig.js'\nimport { sanitizeInternalFields } from '../utilities/sanitizeInternalFields.js'\nimport { getQueryDraftsSelect } from './drafts/getQueryDraftsSelect.js'\nimport { enforceMaxVersions } from './enforceMaxVersions.js'\nimport { saveSnapshot } from './saveSnapshot.js'\nimport { updateLatestVersion } from './updateLatestVersion.js'\n\ntype Args<T extends JsonObject = JsonObject> = {\n autosave?: boolean\n collection?: SanitizedCollectionConfig\n docWithLocales: T\n draft?: boolean\n global?: SanitizedGlobalConfig\n id?: number | string\n operation?: 'create' | 'restoreVersion' | 'update'\n payload: Payload\n publishSpecificLocale?: string\n req?: PayloadRequest\n returning?: boolean\n select?: SelectType\n snapshot?: any\n unpublish?: boolean\n}\n\nexport async function saveVersion<TData extends JsonObject = JsonObject>(\n args: { returning: false } & Args<TData>,\n): Promise<null>\nexport async function saveVersion<TData extends JsonObject = JsonObject>(\n args: { returning: true } & Args<TData>,\n): Promise<JsonObject>\nexport async function saveVersion<TData extends JsonObject = JsonObject>(\n args: Omit<Args<TData>, 'returning'>,\n): Promise<JsonObject>\nexport async function saveVersion<TData extends JsonObject = JsonObject>({\n id,\n autosave,\n collection,\n docWithLocales,\n draft,\n global,\n operation,\n payload,\n publishSpecificLocale,\n req,\n returning,\n select,\n snapshot,\n unpublish,\n}: Args<TData>): Promise<JsonObject | null> {\n let result: JsonObject | undefined\n let createdNewVersion = false\n const now = new Date().toISOString()\n const versionData: {\n _status?: 'draft'\n updatedAt?: string\n } & TData = deepCopyObjectSimple(docWithLocales)\n\n if ((collection?.timestamps || global) && draft) {\n versionData.updatedAt = now\n }\n\n if (versionData._id) {\n delete versionData._id\n }\n\n try {\n if (unpublish || autosave) {\n result = await updateLatestVersion({\n id,\n collection,\n global,\n now,\n payload,\n req,\n shouldUpdate: autosave ? (v) => 'autosave' in v && v.autosave === true : undefined,\n versionData,\n })\n }\n\n if (!result) {\n createdNewVersion = true\n\n const createVersionArgs = {\n autosave: Boolean(autosave),\n collectionSlug: undefined as string | undefined,\n createdAt: operation === 'restoreVersion' ? versionData.createdAt : now,\n globalSlug: undefined as string | undefined,\n parent: collection ? id : undefined,\n publishedLocale: publishSpecificLocale || undefined,\n req,\n returning,\n select: getQueryDraftsSelect({ select }),\n updatedAt: now,\n versionData,\n }\n\n if (collection) {\n createVersionArgs.collectionSlug = collection.slug\n result = await payload.db.createVersion(createVersionArgs as CreateVersionArgs)\n }\n\n if (global) {\n createVersionArgs.globalSlug = global.slug\n result = await payload.db.createGlobalVersion(createVersionArgs as CreateGlobalVersionArgs)\n }\n\n if (snapshot) {\n await saveSnapshot<TData>({\n id,\n autosave,\n collection,\n data: snapshot,\n global,\n payload,\n publishSpecificLocale,\n req,\n select,\n })\n }\n }\n } catch (err) {\n let errorMessage: string | undefined\n\n if (collection) {\n errorMessage = `There was an error while saving a version for the ${typeof collection.labels.singular === 'string' ? collection.labels.singular : collection.slug} with ID ${id}.`\n }\n if (global) {\n errorMessage = `There was an error while saving a version for the global ${typeof global.label === 'string' ? global.label : global.slug}.`\n }\n payload.logger.error({ err, msg: errorMessage })\n throw err\n }\n\n const max = getVersionsMax(collection || global!)\n\n if (createdNewVersion && max > 0) {\n await enforceMaxVersions({\n id,\n collection,\n global,\n max,\n payload,\n req,\n })\n }\n if (returning === false) {\n return null\n }\n\n let createdVersion = (result as any).version\n\n createdVersion = sanitizeInternalFields(createdVersion)\n createdVersion.id = (result as any).parent\n\n return createdVersion\n}\n"],"names":["deepCopyObjectSimple","getVersionsMax","sanitizeInternalFields","getQueryDraftsSelect","enforceMaxVersions","saveSnapshot","updateLatestVersion","saveVersion","id","autosave","collection","docWithLocales","draft","global","operation","payload","publishSpecificLocale","req","returning","select","snapshot","unpublish","result","createdNewVersion","now","Date","toISOString","versionData","timestamps","updatedAt","_id","shouldUpdate","v","undefined","createVersionArgs","Boolean","collectionSlug","createdAt","globalSlug","parent","publishedLocale","slug","db","createVersion","createGlobalVersion","data","err","errorMessage","labels","singular","label","logger","error","msg","max","created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IAE1C,OAAOgB;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"job.d.ts","sourceRoot":"","sources":["../../../src/versions/schedule/job.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAA;AACxE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAA;AAE1D,KAAK,IAAI,GAAG;IACV,aAAa,EAAE,MAAM,CAAA;IACrB,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,sBAAsB,6CAIhC,IAAI,KAAG,UAAU,CAAC;IAAE,KAAK,EAAE,wBAAwB,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"job.d.ts","sourceRoot":"","sources":["../../../src/versions/schedule/job.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAA;AACxE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAA;AAE1D,KAAK,IAAI,GAAG;IACV,aAAa,EAAE,MAAM,CAAA;IACrB,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,sBAAsB,6CAIhC,IAAI,KAAG,UAAU,CAAC;IAAE,KAAK,EAAE,wBAAwB,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAsGvE,CAAA"}
|
|
@@ -21,8 +21,11 @@ export const getSchedulePublishTask = ({ adminUserSlug, collections, globals })=
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
if (input.doc) {
|
|
24
|
+
// input.doc.value is always a string (#10481); coerce back to the real ID type.
|
|
25
|
+
const idType = req.payload.collections[input.doc.relationTo]?.customIDType ?? req.payload.db?.defaultIDType ?? 'text';
|
|
26
|
+
const id = idType === 'number' ? Number(input.doc.value) : input.doc.value;
|
|
24
27
|
await req.payload.update({
|
|
25
|
-
id
|
|
28
|
+
id,
|
|
26
29
|
collection: input.doc.relationTo,
|
|
27
30
|
data: {
|
|
28
31
|
_status
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/versions/schedule/job.ts"],"sourcesContent":["import type { Field } from '../../fields/config/types.js'\nimport type { TypedUser } from '../../index.js'\nimport type { TaskConfig } from '../../queues/config/types/taskTypes.js'\nimport type { SchedulePublishTaskInput } from './types.js'\n\ntype Args = {\n adminUserSlug: string\n collections: string[]\n globals: string[]\n}\n\nexport const getSchedulePublishTask = ({\n adminUserSlug,\n collections,\n globals,\n}: Args): TaskConfig<{ input: SchedulePublishTaskInput; output: object }> => {\n return {\n slug: 'schedulePublish',\n handler: async ({ input, req }) => {\n const _status = input?.type === 'publish' || !input?.type ? 'published' : 'draft'\n\n const userID = input.user\n\n let user: null | TypedUser = null\n\n if (userID) {\n user = (await req.payload.findByID({\n id: userID,\n collection: adminUserSlug,\n depth: 0,\n })) as TypedUser\n\n user.collection = adminUserSlug\n }\n\n let publishSpecificLocale: string\n\n if (input?.type === 'publish' && input.locale && req.payload.config.localization) {\n const matchedLocale = req.payload.config.localization.locales.find(\n ({ code }) => code === input.locale,\n )\n\n if (matchedLocale) {\n publishSpecificLocale = input.locale\n }\n }\n\n if (input.doc) {\n
|
|
1
|
+
{"version":3,"sources":["../../../src/versions/schedule/job.ts"],"sourcesContent":["import type { Field } from '../../fields/config/types.js'\nimport type { TypedUser } from '../../index.js'\nimport type { TaskConfig } from '../../queues/config/types/taskTypes.js'\nimport type { SchedulePublishTaskInput } from './types.js'\n\ntype Args = {\n adminUserSlug: string\n collections: string[]\n globals: string[]\n}\n\nexport const getSchedulePublishTask = ({\n adminUserSlug,\n collections,\n globals,\n}: Args): TaskConfig<{ input: SchedulePublishTaskInput; output: object }> => {\n return {\n slug: 'schedulePublish',\n handler: async ({ input, req }) => {\n const _status = input?.type === 'publish' || !input?.type ? 'published' : 'draft'\n\n const userID = input.user\n\n let user: null | TypedUser = null\n\n if (userID) {\n user = (await req.payload.findByID({\n id: userID,\n collection: adminUserSlug,\n depth: 0,\n })) as TypedUser\n\n user.collection = adminUserSlug\n }\n\n let publishSpecificLocale: string\n\n if (input?.type === 'publish' && input.locale && req.payload.config.localization) {\n const matchedLocale = req.payload.config.localization.locales.find(\n ({ code }) => code === input.locale,\n )\n\n if (matchedLocale) {\n publishSpecificLocale = input.locale\n }\n }\n\n if (input.doc) {\n // input.doc.value is always a string (#10481); coerce back to the real ID type.\n const idType =\n req.payload.collections[input.doc.relationTo]?.customIDType ??\n req.payload.db?.defaultIDType ??\n 'text'\n const id = idType === 'number' ? Number(input.doc.value) : input.doc.value\n\n await req.payload.update({\n id,\n collection: input.doc.relationTo,\n data: {\n _status,\n },\n depth: 0,\n overrideAccess: user === null,\n publishSpecificLocale: publishSpecificLocale!,\n user,\n })\n }\n\n if (input.global) {\n await req.payload.updateGlobal({\n slug: input.global,\n data: {\n _status,\n },\n depth: 0,\n overrideAccess: user === null,\n publishSpecificLocale: publishSpecificLocale!,\n user,\n })\n }\n\n return {\n output: {},\n }\n },\n inputSchema: [\n {\n name: 'type',\n type: 'radio',\n defaultValue: 'publish',\n options: ['publish', 'unpublish'],\n },\n {\n name: 'locale',\n type: 'text',\n },\n ...(collections.length > 0\n ? [\n {\n name: 'doc',\n type: 'relationship',\n relationTo: collections,\n } satisfies Field,\n ]\n : []),\n {\n name: 'global',\n type: 'select',\n options: globals,\n },\n {\n name: 'user',\n type: 'relationship',\n relationTo: adminUserSlug,\n },\n ],\n }\n}\n"],"names":["getSchedulePublishTask","adminUserSlug","collections","globals","slug","handler","input","req","_status","type","userID","user","payload","findByID","id","collection","depth","publishSpecificLocale","locale","config","localization","matchedLocale","locales","find","code","doc","idType","relationTo","customIDType","db","defaultIDType","Number","value","update","data","overrideAccess","global","updateGlobal","output","inputSchema","name","defaultValue","options","length"],"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BACzBM,uBAAuBA;oBACvBN;gBACF;YACF;YAEA,IAAIL,MAAM8B,MAAM,EAAE;gBAChB,MAAM7B,IAAIK,OAAO,CAACyB,YAAY,CAAC;oBAC7BjC,MAAME,MAAM8B,MAAM;oBAClBF,MAAM;wBACJ1B;oBACF;oBACAQ,OAAO;oBACPmB,gBAAgBxB,SAAS;oBACzBM,uBAAuBA;oBACvBN;gBACF;YACF;YAEA,OAAO;gBACL2B,QAAQ,CAAC;YACX;QACF;QACAC,aAAa;YACX;gBACEC,MAAM;gBACN/B,MAAM;gBACNgC,cAAc;gBACdC,SAAS;oBAAC;oBAAW;iBAAY;YACnC;YACA;gBACEF,MAAM;gBACN/B,MAAM;YACR;eACIP,YAAYyC,MAAM,GAAG,IACrB;gBACE;oBACEH,MAAM;oBACN/B,MAAM;oBACNkB,YAAYzB;gBACd;aACD,GACD,EAAE;YACN;gBACEsC,MAAM;gBACN/B,MAAM;gBACNiC,SAASvC;YACX;YACA;gBACEqC,MAAM;gBACN/B,MAAM;gBACNkB,YAAY1B;YACd;SACD;IACH;AACF,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateLatestVersion.d.ts","sourceRoot":"","sources":["../../src/versions/updateLatestVersion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAA;AAC/E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AACvE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAEnE,KAAK,IAAI,CAAC,KAAK,SAAS,UAAU,IAAI;IACpC,UAAU,CAAC,EAAE,yBAAyB,CAAA;IACtC,MAAM,CAAC,EAAE,qBAAqB,CAAA;IAC9B,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,EAAE,OAAO,CAAA;IAChB,GAAG,CAAC,EAAE,cAAc,CAAA;IACpB,YAAY,CAAC,EAAE,CAAC,aAAa,EAAE,UAAU,KAAK,OAAO,CAAA;IACrD,WAAW,EAAE,KAAK,CAAA;CACnB,CAAA;AAED;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CAAC,KAAK,SAAS,UAAU,EAAE,EAClE,EAAE,EACF,UAAU,EACV,MAAM,EACN,GAAG,EACH,OAAO,EACP,GAAG,EACH,YAAyB,EACzB,WAAW,GACZ,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"updateLatestVersion.d.ts","sourceRoot":"","sources":["../../src/versions/updateLatestVersion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAA;AAC/E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AACvE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAEnE,KAAK,IAAI,CAAC,KAAK,SAAS,UAAU,IAAI;IACpC,UAAU,CAAC,EAAE,yBAAyB,CAAA;IACtC,MAAM,CAAC,EAAE,qBAAqB,CAAA;IAC9B,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,EAAE,OAAO,CAAA;IAChB,GAAG,CAAC,EAAE,cAAc,CAAA;IACpB,YAAY,CAAC,EAAE,CAAC,aAAa,EAAE,UAAU,KAAK,OAAO,CAAA;IACrD,WAAW,EAAE,KAAK,CAAA;CACnB,CAAA;AAED;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CAAC,KAAK,SAAS,UAAU,EAAE,EAClE,EAAE,EACF,UAAU,EACV,MAAM,EACN,GAAG,EACH,OAAO,EACP,GAAG,EACH,YAAyB,EACzB,WAAW,GACZ,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CA0G/C"}
|
|
@@ -47,18 +47,65 @@
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
let versionUpdateFailed = undefined;
|
|
51
|
+
try {
|
|
52
|
+
if (collection) {
|
|
53
|
+
return await payload.db.updateVersion({
|
|
54
|
+
...updateVersionArgs,
|
|
55
|
+
collection: collection.slug,
|
|
56
|
+
req
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
return await payload.db.updateGlobalVersion({
|
|
52
60
|
...updateVersionArgs,
|
|
53
|
-
|
|
61
|
+
global: global.slug,
|
|
54
62
|
req
|
|
55
63
|
});
|
|
64
|
+
} catch (err) {
|
|
65
|
+
versionUpdateFailed = true;
|
|
66
|
+
payload.logger.warn({
|
|
67
|
+
err,
|
|
68
|
+
msg: `Failed to update latest version — checking if a concurrent write already succeeded.`
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
if (versionUpdateFailed) {
|
|
72
|
+
// If a concurrent request already committed, return its result to avoid a duplicate version.
|
|
73
|
+
// If updatedAt is unchanged, the update genuinely failed — fall back to createVersion.
|
|
74
|
+
try {
|
|
75
|
+
let freshDocs;
|
|
76
|
+
if (collection) {
|
|
77
|
+
;
|
|
78
|
+
({ docs: freshDocs } = await payload.db.findVersions({
|
|
79
|
+
collection: collection.slug,
|
|
80
|
+
limit: 1,
|
|
81
|
+
pagination: false,
|
|
82
|
+
req,
|
|
83
|
+
sort: '-updatedAt',
|
|
84
|
+
where: {
|
|
85
|
+
parent: {
|
|
86
|
+
equals: id
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}));
|
|
90
|
+
} else {
|
|
91
|
+
;
|
|
92
|
+
({ docs: freshDocs } = await payload.db.findGlobalVersions({
|
|
93
|
+
global: global.slug,
|
|
94
|
+
limit: 1,
|
|
95
|
+
pagination: false,
|
|
96
|
+
req,
|
|
97
|
+
sort: '-updatedAt'
|
|
98
|
+
}));
|
|
99
|
+
}
|
|
100
|
+
const [freshVersion] = freshDocs;
|
|
101
|
+
if (freshVersion && new Date(freshVersion.updatedAt) > new Date(latestVersion.updatedAt)) {
|
|
102
|
+
return freshVersion;
|
|
103
|
+
}
|
|
104
|
+
} catch {
|
|
105
|
+
// If the follow-up query also fails, fall through to createVersion
|
|
106
|
+
}
|
|
56
107
|
}
|
|
57
|
-
return
|
|
58
|
-
...updateVersionArgs,
|
|
59
|
-
global: global.slug,
|
|
60
|
-
req
|
|
61
|
-
});
|
|
108
|
+
return undefined;
|
|
62
109
|
}
|
|
63
110
|
|
|
64
111
|
//# sourceMappingURL=updateLatestVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/versions/updateLatestVersion.ts"],"sourcesContent":["import type { SanitizedCollectionConfig } from '../collections/config/types.js'\nimport type { SanitizedGlobalConfig } from '../globals/config/types.js'\nimport type { Payload } from '../index.js'\nimport type { JsonObject, PayloadRequest } from '../types/index.js'\n\ntype Args<TData extends JsonObject> = {\n collection?: SanitizedCollectionConfig\n global?: SanitizedGlobalConfig\n id?: number | string\n now: string\n payload: Payload\n req?: PayloadRequest\n shouldUpdate?: (latestVersion: JsonObject) => boolean\n versionData: TData\n}\n\n/**\n * Finds the latest version and updates it in place if `shouldUpdate` returns true.\n * Used by both the unpublish and autosave paths in `saveVersion` to avoid creating\n * a redundant new version.\n *\n * Returns the updated version result, or `undefined` if no update was performed.\n */\nexport async function updateLatestVersion<TData extends JsonObject>({\n id,\n collection,\n global,\n now,\n payload,\n req,\n shouldUpdate = () => true,\n versionData,\n}: Args<TData>): Promise<JsonObject | undefined> {\n let docs\n const findVersionArgs = {\n limit: 1,\n pagination: false,\n req,\n sort: '-updatedAt',\n }\n\n if (collection) {\n ;({ docs } = await payload.db.findVersions<TData>({\n ...findVersionArgs,\n collection: collection.slug,\n where: {\n parent: {\n equals: id,\n },\n },\n }))\n } else {\n ;({ docs } = await payload.db.findGlobalVersions<TData>({\n ...findVersionArgs,\n global: global!.slug,\n }))\n }\n\n const [latestVersion] = docs\n\n if (!latestVersion || !shouldUpdate(latestVersion)) {\n return undefined\n }\n\n const updateVersionArgs = {\n id: latestVersion.id,\n req,\n versionData: {\n createdAt: new Date(latestVersion.createdAt).toISOString(),\n latest: true,\n parent: id,\n updatedAt: now,\n version: {\n ...versionData,\n },\n },\n }\n\n if (collection) {\n
|
|
1
|
+
{"version":3,"sources":["../../src/versions/updateLatestVersion.ts"],"sourcesContent":["import type { SanitizedCollectionConfig } from '../collections/config/types.js'\nimport type { SanitizedGlobalConfig } from '../globals/config/types.js'\nimport type { Payload } from '../index.js'\nimport type { JsonObject, PayloadRequest } from '../types/index.js'\n\ntype Args<TData extends JsonObject> = {\n collection?: SanitizedCollectionConfig\n global?: SanitizedGlobalConfig\n id?: number | string\n now: string\n payload: Payload\n req?: PayloadRequest\n shouldUpdate?: (latestVersion: JsonObject) => boolean\n versionData: TData\n}\n\n/**\n * Finds the latest version and updates it in place if `shouldUpdate` returns true.\n * Used by both the unpublish and autosave paths in `saveVersion` to avoid creating\n * a redundant new version.\n *\n * Returns the updated version result, or `undefined` if no update was performed.\n */\nexport async function updateLatestVersion<TData extends JsonObject>({\n id,\n collection,\n global,\n now,\n payload,\n req,\n shouldUpdate = () => true,\n versionData,\n}: Args<TData>): Promise<JsonObject | undefined> {\n let docs\n const findVersionArgs = {\n limit: 1,\n pagination: false,\n req,\n sort: '-updatedAt',\n }\n\n if (collection) {\n ;({ docs } = await payload.db.findVersions<TData>({\n ...findVersionArgs,\n collection: collection.slug,\n where: {\n parent: {\n equals: id,\n },\n },\n }))\n } else {\n ;({ docs } = await payload.db.findGlobalVersions<TData>({\n ...findVersionArgs,\n global: global!.slug,\n }))\n }\n\n const [latestVersion] = docs\n\n if (!latestVersion || !shouldUpdate(latestVersion)) {\n return undefined\n }\n\n const updateVersionArgs = {\n id: latestVersion.id,\n req,\n versionData: {\n createdAt: new Date(latestVersion.createdAt).toISOString(),\n latest: true,\n parent: id,\n updatedAt: now,\n version: {\n ...versionData,\n },\n },\n }\n\n let versionUpdateFailed: boolean | undefined = undefined\n\n try {\n if (collection) {\n return await payload.db.updateVersion<TData>({\n ...updateVersionArgs,\n collection: collection.slug,\n req,\n })\n }\n\n return await payload.db.updateGlobalVersion<TData>({\n ...updateVersionArgs,\n global: global!.slug,\n req,\n })\n } catch (err) {\n versionUpdateFailed = true\n payload.logger.warn({\n err,\n msg: `Failed to update latest version — checking if a concurrent write already succeeded.`,\n })\n }\n\n if (versionUpdateFailed) {\n // If a concurrent request already committed, return its result to avoid a duplicate version.\n // If updatedAt is unchanged, the update genuinely failed — fall back to createVersion.\n try {\n let freshDocs: JsonObject[]\n\n if (collection) {\n ;({ docs: freshDocs } = await payload.db.findVersions<TData>({\n collection: collection.slug,\n limit: 1,\n pagination: false,\n req,\n sort: '-updatedAt',\n where: { parent: { equals: id } },\n }))\n } else {\n ;({ docs: freshDocs } = await payload.db.findGlobalVersions<TData>({\n global: global!.slug,\n limit: 1,\n pagination: false,\n req,\n sort: '-updatedAt',\n }))\n }\n\n const [freshVersion] = freshDocs\n\n if (freshVersion && new Date(freshVersion.updatedAt) > new Date(latestVersion.updatedAt)) {\n return freshVersion\n }\n } catch {\n // If the follow-up query also fails, fall through to createVersion\n }\n }\n\n return undefined\n}\n"],"names":["updateLatestVersion","id","collection","global","now","payload","req","shouldUpdate","versionData","docs","findVersionArgs","limit","pagination","sort","db","findVersions","slug","where","parent","equals","findGlobalVersions","latestVersion","undefined","updateVersionArgs","createdAt","Date","toISOString","latest","updatedAt","version","versionUpdateFailed","updateVersion","updateGlobalVersion","err","logger","warn","msg","freshDocs","freshVersion"],"mappings":"AAgBA;;;;;;CAMC,GACD,OAAO,eAAeA,oBAA8C,EAClEC,EAAE,EACFC,U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C,IAAI,CAAC;YAClBF;YACAG,KAAK,CAAC,mFAAmF,CAAC;QAC5F;IACF;IAEA,IAAIN,qBAAqB;QACvB,6FAA6F;QAC7F,uFAAuF;QACvF,IAAI;YACF,IAAIO;YAEJ,IAAInC,YAAY;;gBACZ,CAAA,EAAEO,MAAM4B,SAAS,EAAE,GAAG,MAAMhC,QAAQS,EAAE,CAACC,YAAY,CAAQ;oBAC3Db,YAAYA,WAAWc,IAAI;oBAC3BL,OAAO;oBACPC,YAAY;oBACZN;oBACAO,MAAM;oBACNI,OAAO;wBAAEC,QAAQ;4BAAEC,QAAQlB;wBAAG;oBAAE;gBAClC,EAAC;YACH,OAAO;;gBACH,CAAA,EAAEQ,MAAM4B,SAAS,EAAE,GAAG,MAAMhC,QAAQS,EAAE,CAACM,kBAAkB,CAAQ;oBACjEjB,QAAQA,OAAQa,IAAI;oBACpBL,OAAO;oBACPC,YAAY;oBACZN;oBACAO,MAAM;gBACR,EAAC;YACH;YAEA,MAAM,CAACyB,aAAa,GAAGD;YAEvB,IAAIC,gBAAgB,IAAIb,KAAKa,aAAaV,SAAS,IAAI,IAAIH,KAAKJ,cAAcO,SAAS,GAAG;gBACxF,OAAOU;YACT;QACF,EAAE,OAAM;QACN,mEAAmE;QACrE;IACF;IAEA,OAAOhB;AACT"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depup/payload",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.86.0-depup.5",
|
|
4
4
|
"description": "Node, React, Headless CMS and Application Framework built on Next.js (with updated dependencies)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"payload",
|
|
@@ -92,22 +92,22 @@
|
|
|
92
92
|
"README.md"
|
|
93
93
|
],
|
|
94
94
|
"dependencies": {
|
|
95
|
-
"@next/env": "^16.2.
|
|
95
|
+
"@next/env": "^16.2.11",
|
|
96
96
|
"@types/busboy": "1.5.4",
|
|
97
|
-
"ajv": "8.
|
|
97
|
+
"ajv": "^8.20.0",
|
|
98
98
|
"bson-objectid": "2.0.4",
|
|
99
99
|
"busboy": "^1.6.0",
|
|
100
100
|
"ci-info": "^4.4.0",
|
|
101
|
-
"console-table-printer": "^2.
|
|
102
|
-
"croner": "
|
|
101
|
+
"console-table-printer": "^2.16.1",
|
|
102
|
+
"croner": "10.0.1",
|
|
103
103
|
"dataloader": "2.2.3",
|
|
104
104
|
"deepmerge": "4.3.1",
|
|
105
105
|
"file-type": "^22.0.1",
|
|
106
|
-
"get-tsconfig": "^4.
|
|
106
|
+
"get-tsconfig": "^4.14.0",
|
|
107
107
|
"http-status": "2.1.0",
|
|
108
108
|
"image-size": "2.0.2",
|
|
109
|
-
"ipaddr.js": "^2.
|
|
110
|
-
"jose": "^6.2.
|
|
109
|
+
"ipaddr.js": "^2.4.0",
|
|
110
|
+
"jose": "^6.2.3",
|
|
111
111
|
"json-schema-to-typescript": "^15.0.4",
|
|
112
112
|
"minimist": "1.2.8",
|
|
113
113
|
"path-to-regexp": "^8.4.2",
|
|
@@ -115,24 +115,23 @@
|
|
|
115
115
|
"pino-pretty": "^13.1.3",
|
|
116
116
|
"pluralize": "8.0.0",
|
|
117
117
|
"qs-esm": "8.0.1",
|
|
118
|
-
"range-parser": "1.
|
|
118
|
+
"range-parser": "^1.3.0",
|
|
119
119
|
"sanitize-filename": "^1.6.4",
|
|
120
|
-
"ts-essentials": "^10.
|
|
121
|
-
"tsx": "4.
|
|
122
|
-
"undici": "^8.0
|
|
123
|
-
"uuid": "^
|
|
124
|
-
"ws": "^8.
|
|
125
|
-
"@payloadcms/translations": "3.
|
|
120
|
+
"ts-essentials": "^10.2.1",
|
|
121
|
+
"tsx": "^4.23.1",
|
|
122
|
+
"undici": "^8.8.0",
|
|
123
|
+
"uuid": "^14.0.1",
|
|
124
|
+
"ws": "^8.21.1",
|
|
125
|
+
"@payloadcms/translations": "3.86.0"
|
|
126
126
|
},
|
|
127
127
|
"devDependencies": {
|
|
128
128
|
"@hyrious/esbuild-plugin-commonjs": "0.2.6",
|
|
129
129
|
"@monaco-editor/react": "4.7.0",
|
|
130
130
|
"@types/json-schema": "7.0.15",
|
|
131
131
|
"@types/minimist": "1.2.2",
|
|
132
|
-
"@types/nodemailer": "
|
|
132
|
+
"@types/nodemailer": "^8.0.0",
|
|
133
133
|
"@types/pluralize": "0.0.33",
|
|
134
134
|
"@types/range-parser": "1.2.7",
|
|
135
|
-
"@types/uuid": "10.0.0",
|
|
136
135
|
"@types/ws": "^8.5.10",
|
|
137
136
|
"copyfiles": "2.4.1",
|
|
138
137
|
"cross-env": "7.0.3",
|
|
@@ -169,7 +168,11 @@
|
|
|
169
168
|
"changes": {
|
|
170
169
|
"@next/env": {
|
|
171
170
|
"from": "^15.1.5",
|
|
172
|
-
"to": "^16.2.
|
|
171
|
+
"to": "^16.2.11"
|
|
172
|
+
},
|
|
173
|
+
"ajv": {
|
|
174
|
+
"from": "8.18.0",
|
|
175
|
+
"to": "^8.20.0"
|
|
173
176
|
},
|
|
174
177
|
"ci-info": {
|
|
175
178
|
"from": "^4.1.0",
|
|
@@ -177,11 +180,7 @@
|
|
|
177
180
|
},
|
|
178
181
|
"console-table-printer": {
|
|
179
182
|
"from": "2.12.1",
|
|
180
|
-
"to": "^2.
|
|
181
|
-
},
|
|
182
|
-
"croner": {
|
|
183
|
-
"from": "9.1.0",
|
|
184
|
-
"to": "^10.0.1"
|
|
183
|
+
"to": "^2.16.1"
|
|
185
184
|
},
|
|
186
185
|
"file-type": {
|
|
187
186
|
"from": "21.3.4",
|
|
@@ -189,15 +188,15 @@
|
|
|
189
188
|
},
|
|
190
189
|
"get-tsconfig": {
|
|
191
190
|
"from": "4.8.1",
|
|
192
|
-
"to": "^4.
|
|
191
|
+
"to": "^4.14.0"
|
|
193
192
|
},
|
|
194
193
|
"ipaddr.js": {
|
|
195
194
|
"from": "2.2.0",
|
|
196
|
-
"to": "^2.
|
|
195
|
+
"to": "^2.4.0"
|
|
197
196
|
},
|
|
198
197
|
"jose": {
|
|
199
198
|
"from": "5.10.0",
|
|
200
|
-
"to": "^6.2.
|
|
199
|
+
"to": "^6.2.3"
|
|
201
200
|
},
|
|
202
201
|
"json-schema-to-typescript": {
|
|
203
202
|
"from": "15.0.3",
|
|
@@ -215,31 +214,39 @@
|
|
|
215
214
|
"from": "13.1.2",
|
|
216
215
|
"to": "^13.1.3"
|
|
217
216
|
},
|
|
217
|
+
"range-parser": {
|
|
218
|
+
"from": "1.2.1",
|
|
219
|
+
"to": "^1.3.0"
|
|
220
|
+
},
|
|
218
221
|
"sanitize-filename": {
|
|
219
222
|
"from": "1.6.3",
|
|
220
223
|
"to": "^1.6.4"
|
|
221
224
|
},
|
|
222
225
|
"ts-essentials": {
|
|
223
226
|
"from": "10.0.3",
|
|
224
|
-
"to": "^10.
|
|
227
|
+
"to": "^10.2.1"
|
|
228
|
+
},
|
|
229
|
+
"tsx": {
|
|
230
|
+
"from": "4.22.4",
|
|
231
|
+
"to": "^4.23.1"
|
|
225
232
|
},
|
|
226
233
|
"undici": {
|
|
227
|
-
"from": "7.
|
|
228
|
-
"to": "^8.0
|
|
234
|
+
"from": "7.28.0",
|
|
235
|
+
"to": "^8.8.0"
|
|
229
236
|
},
|
|
230
237
|
"uuid": {
|
|
231
|
-
"from": "
|
|
232
|
-
"to": "^
|
|
238
|
+
"from": "13.0.2",
|
|
239
|
+
"to": "^14.0.1"
|
|
233
240
|
},
|
|
234
241
|
"ws": {
|
|
235
242
|
"from": "^8.16.0",
|
|
236
|
-
"to": "^8.
|
|
243
|
+
"to": "^8.21.1"
|
|
237
244
|
}
|
|
238
245
|
},
|
|
239
|
-
"depsUpdated":
|
|
246
|
+
"depsUpdated": 19,
|
|
240
247
|
"originalPackage": "payload",
|
|
241
|
-
"originalVersion": "3.
|
|
242
|
-
"processedAt": "2026-
|
|
248
|
+
"originalVersion": "3.86.0",
|
|
249
|
+
"processedAt": "2026-07-21T17:27:55.829Z",
|
|
243
250
|
"smokeTest": "passed"
|
|
244
251
|
}
|
|
245
252
|
}
|