@payloadcms/plugin-import-export 4.0.0-internal.a0ef1b8 → 4.0.0-internal.a1317b2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ExportPreview/index.css +55 -0
- package/dist/components/ExportPreview/index.d.ts +1 -1
- package/dist/components/ExportPreview/index.d.ts.map +1 -1
- package/dist/components/ExportPreview/index.js +1 -1
- package/dist/components/ExportPreview/index.js.map +1 -1
- package/dist/components/FieldsToExport/reduceFields.d.ts.map +1 -1
- package/dist/components/FormatField/index.d.ts.map +1 -1
- package/dist/components/FormatField/index.js +6 -3
- package/dist/components/FormatField/index.js.map +1 -1
- package/dist/components/ImportPreview/index.css +48 -0
- package/dist/components/ImportPreview/index.d.ts +1 -1
- package/dist/components/ImportPreview/index.d.ts.map +1 -1
- package/dist/components/ImportPreview/index.js +17 -3
- package/dist/components/ImportPreview/index.js.map +1 -1
- package/dist/components/Page/index.d.ts +1 -1
- package/dist/components/Page/index.d.ts.map +1 -1
- package/dist/components/Page/index.js +1 -1
- package/dist/components/Page/index.js.map +1 -1
- package/dist/components/SortBy/index.css +9 -0
- package/dist/components/SortBy/index.d.ts +1 -1
- package/dist/components/SortBy/index.d.ts.map +1 -1
- package/dist/components/SortBy/index.js +1 -2
- package/dist/components/SortBy/index.js.map +1 -1
- package/dist/components/SortOrder/index.css +9 -0
- package/dist/components/SortOrder/index.d.ts +1 -1
- package/dist/components/SortOrder/index.d.ts.map +1 -1
- package/dist/components/SortOrder/index.js +1 -2
- package/dist/components/SortOrder/index.js.map +1 -1
- package/dist/export/batchProcessor.d.ts +2 -2
- package/dist/export/batchProcessor.d.ts.map +1 -1
- package/dist/export/batchProcessor.js.map +1 -1
- package/dist/export/createExport.d.ts +2 -2
- package/dist/export/createExport.d.ts.map +1 -1
- package/dist/export/createExport.js +1 -1
- package/dist/export/createExport.js.map +1 -1
- package/dist/export/getCreateExportCollectionTask.d.ts.map +1 -1
- package/dist/export/getExportCollection.d.ts.map +1 -1
- package/dist/export/getExportCollection.js +4 -4
- package/dist/export/getExportCollection.js.map +1 -1
- package/dist/export/getFields.d.ts.map +1 -1
- package/dist/export/handleDownload.d.ts.map +1 -1
- package/dist/export/handleDownload.js +2 -2
- package/dist/export/handleDownload.js.map +1 -1
- package/dist/export/handlePreview.d.ts.map +1 -1
- package/dist/export/handlePreview.js +1 -1
- package/dist/export/handlePreview.js.map +1 -1
- package/dist/import/batchProcessor.d.ts +2 -2
- package/dist/import/batchProcessor.d.ts.map +1 -1
- package/dist/import/batchProcessor.js.map +1 -1
- package/dist/import/createImport.d.ts.map +1 -1
- package/dist/import/createImport.js.map +1 -1
- package/dist/import/getCreateImportCollectionTask.d.ts.map +1 -1
- package/dist/import/getFields.d.ts.map +1 -1
- package/dist/import/getImportCollection.d.ts.map +1 -1
- package/dist/import/getImportCollection.js +4 -4
- package/dist/import/getImportCollection.js.map +1 -1
- package/dist/import/handlePreview.d.ts.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/translations/languages/en.d.ts.map +1 -1
- package/dist/utilities/applyFieldHooks.d.ts.map +1 -1
- package/dist/utilities/applyFieldHooks.js +1 -1
- package/dist/utilities/applyFieldHooks.js.map +1 -1
- package/dist/utilities/buildDisabledFieldRegex.d.ts.map +1 -1
- package/dist/utilities/collectDisabledFieldPaths.d.ts.map +1 -1
- package/dist/utilities/fieldPath.d.ts +2 -0
- package/dist/utilities/fieldPath.d.ts.map +1 -0
- package/dist/utilities/fieldPath.js +8 -0
- package/dist/utilities/fieldPath.js.map +1 -0
- package/dist/utilities/fieldToRegex.d.ts.map +1 -1
- package/dist/utilities/flattenObject.d.ts.map +1 -1
- package/dist/utilities/flattenedFields.d.ts.map +1 -1
- package/dist/utilities/flattenedFields.js +3 -0
- package/dist/utilities/flattenedFields.js.map +1 -1
- package/dist/utilities/getExportFieldFunctions.d.ts.map +1 -1
- package/dist/utilities/getFileFromDoc.d.ts.map +1 -1
- package/dist/utilities/getFlattenedFieldKeys.d.ts.map +1 -1
- package/dist/utilities/getImportFieldFunctions.d.ts.map +1 -1
- package/dist/utilities/getPluginCollections.d.ts.map +1 -1
- package/dist/utilities/getSchemaColumns.d.ts.map +1 -1
- package/dist/utilities/getSelect.d.ts.map +1 -1
- package/dist/utilities/getSelect.js +9 -3
- package/dist/utilities/getSelect.js.map +1 -1
- package/dist/utilities/getSelect.spec.js +70 -0
- package/dist/utilities/getSelect.spec.js.map +1 -0
- package/dist/utilities/isPlainObject.d.ts.map +1 -1
- package/dist/utilities/parseCSV.d.ts.map +1 -1
- package/dist/utilities/parseJSON.d.ts.map +1 -1
- package/dist/utilities/polymorphicRel.d.ts.map +1 -1
- package/dist/utilities/processRichTextField.d.ts.map +1 -1
- package/dist/utilities/removeDisabledFields.d.ts.map +1 -1
- package/dist/utilities/setNestedValue.d.ts +2 -1
- package/dist/utilities/setNestedValue.d.ts.map +1 -1
- package/dist/utilities/setNestedValue.js +51 -34
- package/dist/utilities/setNestedValue.js.map +1 -1
- package/dist/utilities/setNestedValue.spec.js +164 -0
- package/dist/utilities/setNestedValue.spec.js.map +1 -0
- package/dist/utilities/sortHelpers.d.ts +1 -1
- package/dist/utilities/sortHelpers.d.ts.map +1 -1
- package/dist/utilities/unflattenObject.d.ts.map +1 -1
- package/dist/utilities/unflattenPostProcess.d.ts.map +1 -1
- package/dist/utilities/validateLimitValue.d.ts.map +1 -1
- package/license.md +1 -1
- package/package.json +8 -8
- package/dist/@types/assets.d.js +0 -2
- package/dist/@types/assets.d.js.map +0 -1
- package/dist/components/ExportPreview/index.scss +0 -48
- package/dist/components/FieldsToExport/index.scss +0 -0
- package/dist/components/ImportPreview/index.scss +0 -41
- package/dist/components/SortBy/index.scss +0 -3
- package/dist/components/SortOrder/index.scss +0 -3
- /package/dist/components/Page/{index.scss → index.css} +0 -0
|
@@ -1,3 +1,31 @@
|
|
|
1
|
+
import { APIError } from 'payload';
|
|
2
|
+
import { hasUnsupportedFieldPathSegment } from './fieldPath.js';
|
|
3
|
+
const MAX_UNVERIFIED_SPARSE_ARRAY_GAP = 1;
|
|
4
|
+
const createObject = ()=>Object.create(null);
|
|
5
|
+
const isArrayIndex = (part)=>{
|
|
6
|
+
if (!/^(?:0|[1-9]\d*)$/.test(part)) {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
const index = Number(part);
|
|
10
|
+
return Number.isSafeInteger(index) && index >= 0;
|
|
11
|
+
};
|
|
12
|
+
const getPathKey = (target, part, source)=>{
|
|
13
|
+
if (!Array.isArray(target) || !isArrayIndex(part)) {
|
|
14
|
+
return part;
|
|
15
|
+
}
|
|
16
|
+
const index = Number(part);
|
|
17
|
+
if (Array.isArray(source) && index >= source.length || !Array.isArray(source) && index > target.length + MAX_UNVERIFIED_SPARSE_ARRAY_GAP) {
|
|
18
|
+
throw new APIError('Invalid field path.', 400, null, true);
|
|
19
|
+
}
|
|
20
|
+
return index;
|
|
21
|
+
};
|
|
22
|
+
const getSourceValue = (source, part)=>{
|
|
23
|
+
if (source === null || typeof source !== 'object') {
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
const key = Array.isArray(source) && isArrayIndex(part) ? Number(part) : part;
|
|
27
|
+
return source[key];
|
|
28
|
+
};
|
|
1
29
|
/**
|
|
2
30
|
* Sets a value deeply into a nested object or array, based on a dot-notation path.
|
|
3
31
|
*
|
|
@@ -14,44 +42,33 @@
|
|
|
14
42
|
* @param obj - The target object to mutate.
|
|
15
43
|
* @param path - A dot-separated string path indicating where to assign the value.
|
|
16
44
|
* @param value - The value to set at the specified path.
|
|
17
|
-
|
|
45
|
+
* @param source - The source object used to validate array boundaries.
|
|
46
|
+
*/ export const setNestedValue = (obj, path, value, source)=>{
|
|
18
47
|
const parts = path.split('.');
|
|
48
|
+
if (hasUnsupportedFieldPathSegment(parts)) {
|
|
49
|
+
throw new APIError('Invalid field path.', 400, null, true);
|
|
50
|
+
}
|
|
51
|
+
const lastPart = parts.pop();
|
|
52
|
+
if (lastPart === undefined) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
19
55
|
let current = obj;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
const currentArray = current;
|
|
31
|
-
// Ensure the array slot is initialized
|
|
32
|
-
if (!currentArray[index]) {
|
|
33
|
-
currentArray[index] = {};
|
|
34
|
-
}
|
|
35
|
-
if (isLast) {
|
|
36
|
-
currentArray[index] = value;
|
|
37
|
-
} else {
|
|
38
|
-
current = currentArray[index];
|
|
39
|
-
}
|
|
40
|
-
} else {
|
|
41
|
-
const currentObj = current;
|
|
42
|
-
// Ensure the object key exists
|
|
43
|
-
if (isLast) {
|
|
44
|
-
if (typeof part === 'string') {
|
|
45
|
-
currentObj[part] = value;
|
|
46
|
-
}
|
|
47
|
-
} else {
|
|
48
|
-
if (typeof currentObj[part] !== 'object' || currentObj[part] === null) {
|
|
49
|
-
currentObj[part] = {};
|
|
50
|
-
}
|
|
51
|
-
current = currentObj[part];
|
|
52
|
-
}
|
|
56
|
+
let sourceCurrent = source;
|
|
57
|
+
for (const [i, part] of parts.entries()){
|
|
58
|
+
const key = getPathKey(current, part, sourceCurrent);
|
|
59
|
+
const currentRecord = current;
|
|
60
|
+
const nextPart = parts[i + 1] ?? lastPart;
|
|
61
|
+
const nextSource = getSourceValue(sourceCurrent, part);
|
|
62
|
+
const nextValue = currentRecord[key];
|
|
63
|
+
if (!Object.prototype.hasOwnProperty.call(currentRecord, key) || typeof nextValue !== 'object' || nextValue === null) {
|
|
64
|
+
currentRecord[key] = isArrayIndex(nextPart) ? [] : createObject();
|
|
53
65
|
}
|
|
66
|
+
current = currentRecord[key];
|
|
67
|
+
sourceCurrent = nextSource;
|
|
54
68
|
}
|
|
69
|
+
const lastKey = getPathKey(current, lastPart, sourceCurrent);
|
|
70
|
+
const finalRecord = current;
|
|
71
|
+
finalRecord[lastKey] = value;
|
|
55
72
|
};
|
|
56
73
|
|
|
57
74
|
//# sourceMappingURL=setNestedValue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utilities/setNestedValue.ts"],"sourcesContent":["/**\n * Sets a value deeply into a nested object or array, based on a dot-notation path.\n *\n * This function:\n * - Supports array indexing (e.g., \"array.0.field1\")\n * - Creates intermediate arrays/objects as needed\n * - Mutates the target object directly\n *\n * @example\n * const obj = {}\n * setNestedValue(obj, 'group.array.0.field1', 'hello')\n * // Result: { group: { array: [ { field1: 'hello' } ] } }\n *\n * @param obj - The target object to mutate.\n * @param path - A dot-separated string path indicating where to assign the value.\n * @param value - The value to set at the specified path.\n */\n\nexport const setNestedValue = (\n obj: Record<string, unknown>,\n path: string,\n value: unknown,\n): void => {\n const parts = path.split('.')\n
|
|
1
|
+
{"version":3,"sources":["../../src/utilities/setNestedValue.ts"],"sourcesContent":["import { APIError } from 'payload'\n\nimport { hasUnsupportedFieldPathSegment } from './fieldPath.js'\n\nconst MAX_UNVERIFIED_SPARSE_ARRAY_GAP = 1\n\nconst createObject = (): Record<string, unknown> => Object.create(null) as Record<string, unknown>\n\nconst isArrayIndex = (part: string): boolean => {\n if (!/^(?:0|[1-9]\\d*)$/.test(part)) {\n return false\n }\n\n const index = Number(part)\n\n return Number.isSafeInteger(index) && index >= 0\n}\n\nconst getPathKey = (\n target: Record<string, unknown> | unknown[],\n part: string,\n source: unknown,\n): number | string => {\n if (!Array.isArray(target) || !isArrayIndex(part)) {\n return part\n }\n\n const index = Number(part)\n\n if (\n (Array.isArray(source) && index >= source.length) ||\n (!Array.isArray(source) && index > target.length + MAX_UNVERIFIED_SPARSE_ARRAY_GAP)\n ) {\n throw new APIError('Invalid field path.', 400, null, true)\n }\n\n return index\n}\n\nconst getSourceValue = (source: unknown, part: string): unknown => {\n if (source === null || typeof source !== 'object') {\n return undefined\n }\n\n const key = Array.isArray(source) && isArrayIndex(part) ? Number(part) : part\n\n return (source as Record<number | string, unknown>)[key]\n}\n\n/**\n * Sets a value deeply into a nested object or array, based on a dot-notation path.\n *\n * This function:\n * - Supports array indexing (e.g., \"array.0.field1\")\n * - Creates intermediate arrays/objects as needed\n * - Mutates the target object directly\n *\n * @example\n * const obj = {}\n * setNestedValue(obj, 'group.array.0.field1', 'hello')\n * // Result: { group: { array: [ { field1: 'hello' } ] } }\n *\n * @param obj - The target object to mutate.\n * @param path - A dot-separated string path indicating where to assign the value.\n * @param value - The value to set at the specified path.\n * @param source - The source object used to validate array boundaries.\n */\n\nexport const setNestedValue = (\n obj: Record<string, unknown>,\n path: string,\n value: unknown,\n source?: Record<string, unknown>,\n): void => {\n const parts = path.split('.')\n\n if (hasUnsupportedFieldPathSegment(parts)) {\n throw new APIError('Invalid field path.', 400, null, true)\n }\n\n const lastPart = parts.pop()\n\n if (lastPart === undefined) {\n return\n }\n\n let current: Record<string, unknown> | unknown[] = obj\n let sourceCurrent: unknown = source\n\n for (const [i, part] of parts.entries()) {\n const key = getPathKey(current, part, sourceCurrent)\n const currentRecord = current as Record<number | string, unknown>\n const nextPart = parts[i + 1] ?? lastPart\n const nextSource = getSourceValue(sourceCurrent, part)\n\n const nextValue = currentRecord[key]\n\n if (\n !Object.prototype.hasOwnProperty.call(currentRecord, key) ||\n typeof nextValue !== 'object' ||\n nextValue === null\n ) {\n currentRecord[key] = isArrayIndex(nextPart) ? [] : createObject()\n }\n\n current = currentRecord[key] as Record<string, unknown> | unknown[]\n sourceCurrent = nextSource\n }\n\n const lastKey = getPathKey(current, lastPart, sourceCurrent)\n const finalRecord = current as Record<number | string, unknown>\n\n finalRecord[lastKey] = value\n}\n"],"names":["APIError","hasUnsupportedFieldPathSegment","MAX_UNVERIFIED_SPARSE_ARRAY_GAP","createObject","Object","create","isArrayIndex","part","test","index","Number","isSafeInteger","getPathKey","target","source","Array","isArray","length","getSourceValue","undefined","key","setNestedValue","obj","path","value","parts","split","lastPart","pop","current","sourceCurrent","i","entries","currentRecord","nextPart","nextSource","nextValue","prototype","hasOwnProperty","call","lastKey","finalRecord"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,UAAS;AAElC,SAASC,8BAA8B,QAAQ,iBAAgB;AAE/D,MAAMC,kCAAkC;AAExC,MAAMC,eAAe,IAA+BC,OAAOC,MAAM,CAAC;AAElE,MAAMC,eAAe,CAACC;IACpB,IAAI,CAAC,mBAAmBC,IAAI,CAACD,OAAO;QAClC,OAAO;IACT;IAEA,MAAME,QAAQC,OAAOH;IAErB,OAAOG,OAAOC,aAAa,CAACF,UAAUA,SAAS;AACjD;AAEA,MAAMG,aAAa,CACjBC,QACAN,MACAO;IAEA,IAAI,CAACC,MAAMC,OAAO,CAACH,WAAW,CAACP,aAAaC,OAAO;QACjD,OAAOA;IACT;IAEA,MAAME,QAAQC,OAAOH;IAErB,IACE,AAACQ,MAAMC,OAAO,CAACF,WAAWL,SAASK,OAAOG,MAAM,IAC/C,CAACF,MAAMC,OAAO,CAACF,WAAWL,QAAQI,OAAOI,MAAM,GAAGf,iCACnD;QACA,MAAM,IAAIF,SAAS,uBAAuB,KAAK,MAAM;IACvD;IAEA,OAAOS;AACT;AAEA,MAAMS,iBAAiB,CAACJ,QAAiBP;IACvC,IAAIO,WAAW,QAAQ,OAAOA,WAAW,UAAU;QACjD,OAAOK;IACT;IAEA,MAAMC,MAAML,MAAMC,OAAO,CAACF,WAAWR,aAAaC,QAAQG,OAAOH,QAAQA;IAEzE,OAAO,AAACO,MAA2C,CAACM,IAAI;AAC1D;AAEA;;;;;;;;;;;;;;;;;CAiBC,GAED,OAAO,MAAMC,iBAAiB,CAC5BC,KACAC,MACAC,OACAV;IAEA,MAAMW,QAAQF,KAAKG,KAAK,CAAC;IAEzB,IAAIzB,+BAA+BwB,QAAQ;QACzC,MAAM,IAAIzB,SAAS,uBAAuB,KAAK,MAAM;IACvD;IAEA,MAAM2B,WAAWF,MAAMG,GAAG;IAE1B,IAAID,aAAaR,WAAW;QAC1B;IACF;IAEA,IAAIU,UAA+CP;IACnD,IAAIQ,gBAAyBhB;IAE7B,KAAK,MAAM,CAACiB,GAAGxB,KAAK,IAAIkB,MAAMO,OAAO,GAAI;QACvC,MAAMZ,MAAMR,WAAWiB,SAAStB,MAAMuB;QACtC,MAAMG,gBAAgBJ;QACtB,MAAMK,WAAWT,KAAK,CAACM,IAAI,EAAE,IAAIJ;QACjC,MAAMQ,aAAajB,eAAeY,eAAevB;QAEjD,MAAM6B,YAAYH,aAAa,CAACb,IAAI;QAEpC,IACE,CAAChB,OAAOiC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACN,eAAeb,QACrD,OAAOgB,cAAc,YACrBA,cAAc,MACd;YACAH,aAAa,CAACb,IAAI,GAAGd,aAAa4B,YAAY,EAAE,GAAG/B;QACrD;QAEA0B,UAAUI,aAAa,CAACb,IAAI;QAC5BU,gBAAgBK;IAClB;IAEA,MAAMK,UAAU5B,WAAWiB,SAASF,UAAUG;IAC9C,MAAMW,cAAcZ;IAEpBY,WAAW,CAACD,QAAQ,GAAGhB;AACzB,EAAC"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { APIError } from 'payload';
|
|
2
|
+
import { describe, expect, it } from 'vitest';
|
|
3
|
+
import { setNestedValue } from './setNestedValue.js';
|
|
4
|
+
const unsupportedSegments = [
|
|
5
|
+
'__proto__',
|
|
6
|
+
'constructor',
|
|
7
|
+
'prototype'
|
|
8
|
+
];
|
|
9
|
+
const unsupportedPaths = unsupportedSegments.flatMap((segment)=>[
|
|
10
|
+
`${segment}.value`,
|
|
11
|
+
`group.${segment}.value`,
|
|
12
|
+
`group.${segment}`,
|
|
13
|
+
`items.${segment}.0.value`,
|
|
14
|
+
`items.0.${segment}.value`,
|
|
15
|
+
`items.0.${segment}`
|
|
16
|
+
]);
|
|
17
|
+
describe('setNestedValue', ()=>{
|
|
18
|
+
it.each(unsupportedPaths)('rejects invalid field path %s without changing the target', (path)=>{
|
|
19
|
+
const target = {
|
|
20
|
+
stable: {
|
|
21
|
+
value: true
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
const objectPrototypeBefore = Object.getOwnPropertyDescriptors(Object.prototype);
|
|
25
|
+
const targetPrototypeBefore = Object.getPrototypeOf(target);
|
|
26
|
+
try {
|
|
27
|
+
setNestedValue(target, path, true);
|
|
28
|
+
expect.fail('Expected setNestedValue to reject the invalid field path');
|
|
29
|
+
} catch (error) {
|
|
30
|
+
expect(error).toBeInstanceOf(APIError);
|
|
31
|
+
if (error instanceof APIError) {
|
|
32
|
+
expect(error.status).toBe(400);
|
|
33
|
+
expect(error.isPublic).toBe(true);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
expect(target).toEqual({
|
|
37
|
+
stable: {
|
|
38
|
+
value: true
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
expect(Object.getPrototypeOf(target)).toBe(targetPrototypeBefore);
|
|
42
|
+
expect(Object.getOwnPropertyDescriptors(Object.prototype)).toEqual(objectPrototypeBefore);
|
|
43
|
+
});
|
|
44
|
+
it('rejects field paths with out-of-range array indexes', ()=>{
|
|
45
|
+
const source = {
|
|
46
|
+
items: [
|
|
47
|
+
{
|
|
48
|
+
value: true
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
};
|
|
52
|
+
const target = {};
|
|
53
|
+
expect(()=>setNestedValue(target, 'items.4294967294.value', true, source)).toThrow(APIError);
|
|
54
|
+
expect(target).toEqual({
|
|
55
|
+
items: []
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
it('supports out-of-order array indexes that exist in the source document', ()=>{
|
|
59
|
+
const source = {
|
|
60
|
+
items: [
|
|
61
|
+
{
|
|
62
|
+
value: 'first'
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
value: 'second'
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
value: 'third'
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
};
|
|
72
|
+
const target = {};
|
|
73
|
+
setNestedValue(target, 'items.2.value', 'third', source);
|
|
74
|
+
expect(target).toEqual({
|
|
75
|
+
items: [
|
|
76
|
+
undefined,
|
|
77
|
+
undefined,
|
|
78
|
+
{
|
|
79
|
+
value: 'third'
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
it.each([
|
|
85
|
+
'-1',
|
|
86
|
+
'+1',
|
|
87
|
+
'01',
|
|
88
|
+
' 1',
|
|
89
|
+
'1 ',
|
|
90
|
+
'1e2',
|
|
91
|
+
'0x10',
|
|
92
|
+
'Infinity',
|
|
93
|
+
'9007199254740992'
|
|
94
|
+
])('treats noncanonical numeric segment %s as an object key', (segment)=>{
|
|
95
|
+
const target = {};
|
|
96
|
+
setNestedValue(target, `items.${segment}.value`, 'example');
|
|
97
|
+
expect(Array.isArray(target.items)).toBe(false);
|
|
98
|
+
expect(target).toEqual({
|
|
99
|
+
items: {
|
|
100
|
+
[segment]: {
|
|
101
|
+
value: 'example'
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
it('builds nested objects and arrays', ()=>{
|
|
107
|
+
const target = {};
|
|
108
|
+
setNestedValue(target, 'group.items.0.title', 'first');
|
|
109
|
+
setNestedValue(target, 'group.items.0.description', 'description');
|
|
110
|
+
setNestedValue(target, 'group.items.1.title', 'second');
|
|
111
|
+
expect(target).toEqual({
|
|
112
|
+
group: {
|
|
113
|
+
items: [
|
|
114
|
+
{
|
|
115
|
+
description: 'description',
|
|
116
|
+
title: 'first'
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
title: 'second'
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
const group = target.group;
|
|
125
|
+
const items = group.items;
|
|
126
|
+
expect(Object.getPrototypeOf(group)).toBeNull();
|
|
127
|
+
expect(Array.isArray(items)).toBe(true);
|
|
128
|
+
expect(Object.getPrototypeOf(items[0])).toBeNull();
|
|
129
|
+
expect(Object.getPrototypeOf(items[1])).toBeNull();
|
|
130
|
+
});
|
|
131
|
+
it('supports nested arrays using numeric lookahead', ()=>{
|
|
132
|
+
const target = {};
|
|
133
|
+
setNestedValue(target, 'matrix.0.1.value', 'nested');
|
|
134
|
+
expect(target).toEqual({
|
|
135
|
+
matrix: [
|
|
136
|
+
[
|
|
137
|
+
undefined,
|
|
138
|
+
{
|
|
139
|
+
value: 'nested'
|
|
140
|
+
}
|
|
141
|
+
]
|
|
142
|
+
]
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
it('creates own containers instead of traversing inherited properties', ()=>{
|
|
146
|
+
const inheritedGroup = {
|
|
147
|
+
inherited: true
|
|
148
|
+
};
|
|
149
|
+
const target = Object.create({
|
|
150
|
+
group: inheritedGroup
|
|
151
|
+
});
|
|
152
|
+
setNestedValue(target, 'group.value', 'own');
|
|
153
|
+
expect(Object.prototype.hasOwnProperty.call(target, 'group')).toBe(true);
|
|
154
|
+
expect(target.group).toEqual({
|
|
155
|
+
value: 'own'
|
|
156
|
+
});
|
|
157
|
+
expect(Object.getPrototypeOf(target.group)).toBeNull();
|
|
158
|
+
expect(inheritedGroup).toEqual({
|
|
159
|
+
inherited: true
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
//# sourceMappingURL=setNestedValue.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utilities/setNestedValue.spec.ts"],"sourcesContent":["import { APIError } from 'payload'\nimport { describe, expect, it } from 'vitest'\n\nimport { setNestedValue } from './setNestedValue.js'\n\nconst unsupportedSegments = ['__proto__', 'constructor', 'prototype']\nconst unsupportedPaths = unsupportedSegments.flatMap((segment) => [\n `${segment}.value`,\n `group.${segment}.value`,\n `group.${segment}`,\n `items.${segment}.0.value`,\n `items.0.${segment}.value`,\n `items.0.${segment}`,\n])\n\ndescribe('setNestedValue', () => {\n it.each(unsupportedPaths)('rejects invalid field path %s without changing the target', (path) => {\n const target = { stable: { value: true } }\n const objectPrototypeBefore = Object.getOwnPropertyDescriptors(Object.prototype)\n const targetPrototypeBefore = Object.getPrototypeOf(target)\n\n try {\n setNestedValue(target, path, true)\n expect.fail('Expected setNestedValue to reject the invalid field path')\n } catch (error) {\n expect(error).toBeInstanceOf(APIError)\n\n if (error instanceof APIError) {\n expect(error.status).toBe(400)\n expect(error.isPublic).toBe(true)\n }\n }\n\n expect(target).toEqual({ stable: { value: true } })\n expect(Object.getPrototypeOf(target)).toBe(targetPrototypeBefore)\n expect(Object.getOwnPropertyDescriptors(Object.prototype)).toEqual(objectPrototypeBefore)\n })\n\n it('rejects field paths with out-of-range array indexes', () => {\n const source = { items: [{ value: true }] }\n const target: Record<string, unknown> = {}\n\n expect(() => setNestedValue(target, 'items.4294967294.value', true, source)).toThrow(APIError)\n expect(target).toEqual({ items: [] })\n })\n\n it('supports out-of-order array indexes that exist in the source document', () => {\n const source = { items: [{ value: 'first' }, { value: 'second' }, { value: 'third' }] }\n const target: Record<string, unknown> = {}\n\n setNestedValue(target, 'items.2.value', 'third', source)\n\n expect(target).toEqual({ items: [undefined, undefined, { value: 'third' }] })\n })\n\n it.each(['-1', '+1', '01', ' 1', '1 ', '1e2', '0x10', 'Infinity', '9007199254740992'])(\n 'treats noncanonical numeric segment %s as an object key',\n (segment) => {\n const target: Record<string, unknown> = {}\n\n setNestedValue(target, `items.${segment}.value`, 'example')\n\n expect(Array.isArray(target.items)).toBe(false)\n expect(target).toEqual({ items: { [segment]: { value: 'example' } } })\n },\n )\n\n it('builds nested objects and arrays', () => {\n const target: Record<string, unknown> = {}\n\n setNestedValue(target, 'group.items.0.title', 'first')\n setNestedValue(target, 'group.items.0.description', 'description')\n setNestedValue(target, 'group.items.1.title', 'second')\n\n expect(target).toEqual({\n group: {\n items: [{ description: 'description', title: 'first' }, { title: 'second' }],\n },\n })\n\n const group = target.group as Record<string, unknown>\n const items = group.items as Record<string, unknown>[]\n\n expect(Object.getPrototypeOf(group)).toBeNull()\n expect(Array.isArray(items)).toBe(true)\n expect(Object.getPrototypeOf(items[0])).toBeNull()\n expect(Object.getPrototypeOf(items[1])).toBeNull()\n })\n\n it('supports nested arrays using numeric lookahead', () => {\n const target: Record<string, unknown> = {}\n\n setNestedValue(target, 'matrix.0.1.value', 'nested')\n\n expect(target).toEqual({\n matrix: [[undefined, { value: 'nested' }]],\n })\n })\n\n it('creates own containers instead of traversing inherited properties', () => {\n const inheritedGroup = { inherited: true }\n const target = Object.create({ group: inheritedGroup }) as Record<string, unknown>\n\n setNestedValue(target, 'group.value', 'own')\n\n expect(Object.prototype.hasOwnProperty.call(target, 'group')).toBe(true)\n expect(target.group).toEqual({ value: 'own' })\n expect(Object.getPrototypeOf(target.group)).toBeNull()\n expect(inheritedGroup).toEqual({ inherited: true })\n })\n})\n"],"names":["APIError","describe","expect","it","setNestedValue","unsupportedSegments","unsupportedPaths","flatMap","segment","each","path","target","stable","value","objectPrototypeBefore","Object","getOwnPropertyDescriptors","prototype","targetPrototypeBefore","getPrototypeOf","fail","error","toBeInstanceOf","status","toBe","isPublic","toEqual","source","items","toThrow","undefined","Array","isArray","group","description","title","toBeNull","matrix","inheritedGroup","inherited","create","hasOwnProperty","call"],"mappings":"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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Remove a leading '-' from a sort value (e.g. "-title" -> "title") */
|
|
2
2
|
export declare const stripSortDash: (v?: null | string) => string;
|
|
3
3
|
/** Apply order to a base field (("title","desc") -> "-title") */
|
|
4
|
-
export declare const applySortOrder: (field: string, order:
|
|
4
|
+
export declare const applySortOrder: (field: string, order: 'asc' | 'desc') => string;
|
|
5
5
|
export declare const normalizeQueryParam: (v: unknown) => string | undefined;
|
|
6
6
|
//# sourceMappingURL=sortHelpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sortHelpers.d.ts","sourceRoot":"","sources":["../../src/utilities/sortHelpers.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"sortHelpers.d.ts","sourceRoot":"","sources":["../../src/utilities/sortHelpers.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,eAAO,MAAM,aAAa,OAAQ,IAAI,GAAG,MAAM,KAAG,MAAwC,CAAA;AAE1F,iEAAiE;AACjE,eAAO,MAAM,cAAc,UAAW,MAAM,SAAS,KAAK,GAAG,MAAM,KAAG,MAC9B,CAAA;AAGxC,eAAO,MAAM,mBAAmB,MAAO,OAAO,KAAG,MAAM,GAAG,SAQzD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unflattenObject.d.ts","sourceRoot":"","sources":["../../src/utilities/unflattenObject.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAKvD,KAAK,aAAa,GAAG;IACnB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B,MAAM,EAAE,cAAc,EAAE,CAAA;IACxB,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,CAAC,EAAE,GAAG,MAAM,CAAC,CAAA;IACvC,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAA;IACvD,GAAG,EAAE,cAAc,CAAA;CACpB,CAAA;AAuCD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"unflattenObject.d.ts","sourceRoot":"","sources":["../../src/utilities/unflattenObject.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAKvD,KAAK,aAAa,GAAG;IACnB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B,MAAM,EAAE,cAAc,EAAE,CAAA;IACxB,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,CAAC,EAAE,GAAG,MAAM,CAAC,CAAA;IACvC,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAA;IACvD,GAAG,EAAE,cAAc,CAAA;CACpB,CAAA;AAuCD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,eAAe,qDAMzB,aAAa,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAyUxC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unflattenPostProcess.d.ts","sourceRoot":"","sources":["../../src/utilities/unflattenPostProcess.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAuM7C;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"unflattenPostProcess.d.ts","sourceRoot":"","sources":["../../src/utilities/unflattenPostProcess.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAuM7C;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,QACzB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,UACpB,cAAc,EAAE,KACvB,IAMF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validateLimitValue.d.ts","sourceRoot":"","sources":["../../src/utilities/validateLimitValue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAEzD,eAAO,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"validateLimitValue.d.ts","sourceRoot":"","sources":["../../src/utilities/validateLimitValue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAEzD,eAAO,MAAM,kBAAkB,UACtB,IAAI,GAAG,MAAM,GAAG,SAAS,KAC7B,SAAS,KACX,MAAM,GAAG,SAMX,CAAA"}
|
package/license.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2018-
|
|
3
|
+
Copyright (c) 2018-2026 Payload CMS, LLC <info@payloadcms.com>
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
6
|
a copy of this software and associated documentation files (the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/plugin-import-export",
|
|
3
|
-
"version": "4.0.0-internal.
|
|
3
|
+
"version": "4.0.0-internal.a1317b2",
|
|
4
4
|
"description": "Import-Export plugin for Payload",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"payload",
|
|
@@ -60,21 +60,21 @@
|
|
|
60
60
|
"dist"
|
|
61
61
|
],
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@faceless-ui/modal": "3.0.
|
|
63
|
+
"@faceless-ui/modal": "3.0.1",
|
|
64
64
|
"csv-parse": "5.6.0",
|
|
65
65
|
"csv-stringify": "6.5.2",
|
|
66
66
|
"qs-esm": "8.0.1",
|
|
67
|
-
"@payloadcms/
|
|
68
|
-
"@payloadcms/
|
|
67
|
+
"@payloadcms/ui": "4.0.0-internal.a1317b2",
|
|
68
|
+
"@payloadcms/translations": "4.0.0-internal.a1317b2"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@payloadcms/eslint-config": "3.28.0",
|
|
72
|
-
"payload": "4.0.0-internal.
|
|
73
|
-
"@payloadcms/ui": "4.0.0-internal.
|
|
72
|
+
"payload": "4.0.0-internal.a1317b2",
|
|
73
|
+
"@payloadcms/ui": "4.0.0-internal.a1317b2"
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
|
76
|
-
"@payloadcms/ui": "4.0.0-internal.
|
|
77
|
-
"payload": "4.0.0-internal.
|
|
76
|
+
"@payloadcms/ui": "4.0.0-internal.a1317b2",
|
|
77
|
+
"payload": "4.0.0-internal.a1317b2"
|
|
78
78
|
},
|
|
79
79
|
"homepage:": "https://payloadcms.com",
|
|
80
80
|
"scripts": {
|
package/dist/@types/assets.d.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/@types/assets.d.ts"],"names":[],"mappings":""}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
@layer payload-default {
|
|
2
|
-
.export-preview {
|
|
3
|
-
&__header {
|
|
4
|
-
display: flex;
|
|
5
|
-
justify-content: space-between;
|
|
6
|
-
align-items: flex-end;
|
|
7
|
-
margin-bottom: 10px;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
&__export-info {
|
|
11
|
-
display: flex;
|
|
12
|
-
flex-direction: column;
|
|
13
|
-
align-items: flex-end;
|
|
14
|
-
gap: 2px;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
&__export-count {
|
|
18
|
-
font-size: var(--font-size-small);
|
|
19
|
-
color: var(--theme-elevation-500);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
&__limit-capped {
|
|
23
|
-
font-size: var(--font-size-small);
|
|
24
|
-
color: var(--theme-warning-500);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
&__pagination {
|
|
28
|
-
display: flex;
|
|
29
|
-
align-items: center;
|
|
30
|
-
justify-content: space-between;
|
|
31
|
-
gap: var(--base);
|
|
32
|
-
margin-top: var(--base);
|
|
33
|
-
padding-top: var(--base);
|
|
34
|
-
border-top: 1px solid var(--theme-elevation-100);
|
|
35
|
-
|
|
36
|
-
// When only PerPage is present (no Pagination), keep it on the right
|
|
37
|
-
.per-page:only-child {
|
|
38
|
-
margin-left: auto;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
&__page-info {
|
|
43
|
-
font-size: var(--font-size-small);
|
|
44
|
-
color: var(--theme-elevation-500);
|
|
45
|
-
white-space: nowrap;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
File without changes
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
@layer payload-default {
|
|
2
|
-
.import-preview {
|
|
3
|
-
&__header {
|
|
4
|
-
display: flex;
|
|
5
|
-
justify-content: space-between;
|
|
6
|
-
align-items: flex-end;
|
|
7
|
-
margin-bottom: 10px;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
&__info {
|
|
11
|
-
font-size: var(--font-size-small);
|
|
12
|
-
color: var(--theme-elevation-500);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
&__import-count {
|
|
16
|
-
font-size: var(--font-size-small);
|
|
17
|
-
color: var(--theme-elevation-500);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
&__pagination {
|
|
21
|
-
display: flex;
|
|
22
|
-
align-items: center;
|
|
23
|
-
justify-content: space-between;
|
|
24
|
-
gap: var(--base);
|
|
25
|
-
margin-top: var(--base);
|
|
26
|
-
padding-top: var(--base);
|
|
27
|
-
border-top: 1px solid var(--theme-elevation-100);
|
|
28
|
-
|
|
29
|
-
// When only PerPage is present (no Pagination), keep it on the right
|
|
30
|
-
.per-page:only-child {
|
|
31
|
-
margin-left: auto;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
&__page-info {
|
|
36
|
-
font-size: var(--font-size-small);
|
|
37
|
-
color: var(--theme-elevation-500);
|
|
38
|
-
white-space: nowrap;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
File without changes
|