@payloadcms/plugin-import-export 4.0.0-internal.2fddfc0 → 4.0.0-internal.314c594
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 +1 -1
- 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/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/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 +9 -9
- 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
|
@@ -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":"AAAA,SAASA,QAAQ,QAAQ,UAAS;AAClC,SAASC,Q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,MAAML,QAAQK,MAAML,KAAK;QAEzB1B,OAAOa,OAAOI,cAAc,CAACc,QAAQG,QAAQ;QAC7ClC,OAAO6B,MAAMC,OAAO,CAACJ,QAAQJ,IAAI,CAAC;QAClCtB,OAAOa,OAAOI,cAAc,CAACS,KAAK,CAAC,EAAE,GAAGQ,QAAQ;QAChDlC,OAAOa,OAAOI,cAAc,CAACS,KAAK,CAAC,EAAE,GAAGQ,QAAQ;IAClD;IAEAjC,GAAG,kDAAkD;QACnD,MAAMQ,SAAkC,CAAC;QAEzCP,eAAeO,QAAQ,oBAAoB;QAE3CT,OAAOS,QAAQe,OAAO,CAAC;YACrBW,QAAQ;gBAAC;oBAACP;oBAAW;wBAAEjB,OAAO;oBAAS;iBAAE;aAAC;QAC5C;IACF;IAEAV,GAAG,qEAAqE;QACtE,MAAMmC,iBAAiB;YAAEC,WAAW;QAAK;QACzC,MAAM5B,SAASI,OAAOyB,MAAM,CAAC;YAAEP,OAAOK;QAAe;QAErDlC,eAAeO,QAAQ,eAAe;QAEtCT,OAAOa,OAAOE,SAAS,CAACwB,cAAc,CAACC,IAAI,CAAC/B,QAAQ,UAAUa,IAAI,CAAC;QACnEtB,OAAOS,OAAOsB,KAAK,EAAEP,OAAO,CAAC;YAAEb,OAAO;QAAM;QAC5CX,OAAOa,OAAOI,cAAc,CAACR,OAAOsB,KAAK,GAAGG,QAAQ;QACpDlC,OAAOoC,gBAAgBZ,OAAO,CAAC;YAAEa,WAAW;QAAK;IACnD;AACF"}
|
|
@@ -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.314c594",
|
|
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/translations": "4.0.0-internal.
|
|
68
|
-
"@payloadcms/ui": "4.0.0-internal.
|
|
67
|
+
"@payloadcms/translations": "4.0.0-internal.314c594",
|
|
68
|
+
"@payloadcms/ui": "4.0.0-internal.314c594"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
|
-
"@payloadcms/
|
|
72
|
-
"
|
|
73
|
-
"
|
|
71
|
+
"@payloadcms/eslint-config": "3.28.0",
|
|
72
|
+
"@payloadcms/ui": "4.0.0-internal.314c594",
|
|
73
|
+
"payload": "4.0.0-internal.314c594"
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
|
76
|
-
"
|
|
77
|
-
"
|
|
76
|
+
"payload": "4.0.0-internal.314c594",
|
|
77
|
+
"@payloadcms/ui": "4.0.0-internal.314c594"
|
|
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
|