@payloadcms/plugin-import-export 4.0.0-internal.f851106 → 4.0.0-internal.f980c7c

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.
Files changed (143) hide show
  1. package/dist/components/CollectionField/index.d.ts +3 -2
  2. package/dist/components/CollectionField/index.d.ts.map +1 -1
  3. package/dist/components/CollectionField/index.js.map +1 -1
  4. package/dist/components/ExportListMenuItem/index.d.ts.map +1 -1
  5. package/dist/components/ExportListMenuItem/index.js +14 -12
  6. package/dist/components/ExportListMenuItem/index.js.map +1 -1
  7. package/dist/components/ExportPreview/index.css +0 -3
  8. package/dist/components/ExportPreview/index.d.ts.map +1 -1
  9. package/dist/components/ExportPreview/index.js +11 -1
  10. package/dist/components/ExportPreview/index.js.map +1 -1
  11. package/dist/components/FieldsToExport/index.d.ts +3 -2
  12. package/dist/components/FieldsToExport/index.d.ts.map +1 -1
  13. package/dist/components/FieldsToExport/index.js +18 -15
  14. package/dist/components/FieldsToExport/index.js.map +1 -1
  15. package/dist/components/FieldsToExport/reduceFields.d.ts +6 -0
  16. package/dist/components/FieldsToExport/reduceFields.d.ts.map +1 -1
  17. package/dist/components/FieldsToExport/reduceFields.js +4 -0
  18. package/dist/components/FieldsToExport/reduceFields.js.map +1 -1
  19. package/dist/components/FormatField/index.d.ts +3 -2
  20. package/dist/components/FormatField/index.d.ts.map +1 -1
  21. package/dist/components/FormatField/index.js.map +1 -1
  22. package/dist/components/ImportListMenuItem/index.d.ts.map +1 -1
  23. package/dist/components/ImportListMenuItem/index.js +14 -12
  24. package/dist/components/ImportListMenuItem/index.js.map +1 -1
  25. package/dist/components/ImportPreview/index.css +0 -3
  26. package/dist/components/ImportPreview/index.d.ts.map +1 -1
  27. package/dist/components/ImportPreview/index.js +27 -8
  28. package/dist/components/ImportPreview/index.js.map +1 -1
  29. package/dist/components/LimitField/index.d.ts +3 -2
  30. package/dist/components/LimitField/index.d.ts.map +1 -1
  31. package/dist/components/LimitField/index.js.map +1 -1
  32. package/dist/components/LocaleField/index.d.ts +3 -2
  33. package/dist/components/LocaleField/index.d.ts.map +1 -1
  34. package/dist/components/LocaleField/index.js.map +1 -1
  35. package/dist/components/Page/index.d.ts +3 -2
  36. package/dist/components/Page/index.d.ts.map +1 -1
  37. package/dist/components/Page/index.js.map +1 -1
  38. package/dist/components/RelationshipCell/getRelationshipGroupKey.d.ts +7 -0
  39. package/dist/components/RelationshipCell/getRelationshipGroupKey.d.ts.map +1 -0
  40. package/dist/components/RelationshipCell/getRelationshipGroupKey.js +3 -0
  41. package/dist/components/RelationshipCell/getRelationshipGroupKey.js.map +1 -0
  42. package/dist/components/RelationshipCell/getRelationshipGroups.d.ts +43 -0
  43. package/dist/components/RelationshipCell/getRelationshipGroups.d.ts.map +1 -0
  44. package/dist/components/RelationshipCell/getRelationshipGroups.js +109 -0
  45. package/dist/components/RelationshipCell/getRelationshipGroups.js.map +1 -0
  46. package/dist/components/RelationshipCell/index.css +30 -0
  47. package/dist/components/RelationshipCell/index.d.ts +15 -0
  48. package/dist/components/RelationshipCell/index.d.ts.map +1 -0
  49. package/dist/components/RelationshipCell/index.js +57 -0
  50. package/dist/components/RelationshipCell/index.js.map +1 -0
  51. package/dist/components/SortBy/index.d.ts +3 -2
  52. package/dist/components/SortBy/index.d.ts.map +1 -1
  53. package/dist/components/SortBy/index.js.map +1 -1
  54. package/dist/components/SortOrder/index.d.ts +3 -2
  55. package/dist/components/SortOrder/index.d.ts.map +1 -1
  56. package/dist/components/SortOrder/index.js.map +1 -1
  57. package/dist/export/batchProcessor.d.ts +2 -1
  58. package/dist/export/batchProcessor.d.ts.map +1 -1
  59. package/dist/export/batchProcessor.js +6 -2
  60. package/dist/export/batchProcessor.js.map +1 -1
  61. package/dist/export/createExport.d.ts +2 -0
  62. package/dist/export/createExport.d.ts.map +1 -1
  63. package/dist/export/createExport.js +6 -1
  64. package/dist/export/createExport.js.map +1 -1
  65. package/dist/export/getCreateExportCollectionTask.d.ts.map +1 -1
  66. package/dist/export/getCreateExportCollectionTask.js +11 -0
  67. package/dist/export/getCreateExportCollectionTask.js.map +1 -1
  68. package/dist/export/getExportCollection.d.ts.map +1 -1
  69. package/dist/export/getExportCollection.js +5 -0
  70. package/dist/export/getExportCollection.js.map +1 -1
  71. package/dist/export/getFields.js.map +1 -1
  72. package/dist/export/handleDownload.d.ts.map +1 -1
  73. package/dist/export/handleDownload.js +7 -3
  74. package/dist/export/handleDownload.js.map +1 -1
  75. package/dist/export/handlePreview.d.ts.map +1 -1
  76. package/dist/export/handlePreview.js +24 -5
  77. package/dist/export/handlePreview.js.map +1 -1
  78. package/dist/exports/types.d.ts +1 -1
  79. package/dist/exports/types.d.ts.map +1 -1
  80. package/dist/exports/types.js.map +1 -1
  81. package/dist/import/batchProcessor.d.ts +2 -1
  82. package/dist/import/batchProcessor.d.ts.map +1 -1
  83. package/dist/import/batchProcessor.js +15 -8
  84. package/dist/import/batchProcessor.js.map +1 -1
  85. package/dist/import/createImport.d.ts +3 -2
  86. package/dist/import/createImport.d.ts.map +1 -1
  87. package/dist/import/createImport.js +8 -1
  88. package/dist/import/createImport.js.map +1 -1
  89. package/dist/import/getCreateImportCollectionTask.d.ts.map +1 -1
  90. package/dist/import/getCreateImportCollectionTask.js +5 -2
  91. package/dist/import/getCreateImportCollectionTask.js.map +1 -1
  92. package/dist/import/getImportCollection.d.ts.map +1 -1
  93. package/dist/import/getImportCollection.js +2 -0
  94. package/dist/import/getImportCollection.js.map +1 -1
  95. package/dist/import/handlePreview.d.ts.map +1 -1
  96. package/dist/import/handlePreview.js +5 -1
  97. package/dist/import/handlePreview.js.map +1 -1
  98. package/dist/types.d.ts +17 -1
  99. package/dist/types.d.ts.map +1 -1
  100. package/dist/types.js.map +1 -1
  101. package/dist/utilities/applyFieldHooks.js.map +1 -1
  102. package/dist/utilities/getExportFieldFunctions.js +64 -27
  103. package/dist/utilities/getExportFieldFunctions.js.map +1 -1
  104. package/dist/utilities/getFileFromDoc.js +3 -3
  105. package/dist/utilities/getFileFromDoc.js.map +1 -1
  106. package/dist/utilities/getSelect.d.ts.map +1 -1
  107. package/dist/utilities/getSelect.js +11 -3
  108. package/dist/utilities/getSelect.js.map +1 -1
  109. package/dist/utilities/getSubmittedFormValues.d.ts +12 -0
  110. package/dist/utilities/getSubmittedFormValues.d.ts.map +1 -0
  111. package/dist/utilities/getSubmittedFormValues.js +24 -0
  112. package/dist/utilities/getSubmittedFormValues.js.map +1 -0
  113. package/dist/utilities/setNestedValue.d.ts +2 -1
  114. package/dist/utilities/setNestedValue.d.ts.map +1 -1
  115. package/dist/utilities/setNestedValue.js +65 -34
  116. package/dist/utilities/setNestedValue.js.map +1 -1
  117. package/package.json +25 -28
  118. package/dist/components/FieldsToExport/reduceFields.spec.js +0 -239
  119. package/dist/components/FieldsToExport/reduceFields.spec.js.map +0 -1
  120. package/dist/utilities/applyFieldHooks.spec.js +0 -205
  121. package/dist/utilities/applyFieldHooks.spec.js.map +0 -1
  122. package/dist/utilities/buildDisabledFieldRegex.spec.js +0 -64
  123. package/dist/utilities/buildDisabledFieldRegex.spec.js.map +0 -1
  124. package/dist/utilities/fieldToRegex.spec.js +0 -151
  125. package/dist/utilities/fieldToRegex.spec.js.map +0 -1
  126. package/dist/utilities/filterToSelectedFields.spec.js +0 -204
  127. package/dist/utilities/filterToSelectedFields.spec.js.map +0 -1
  128. package/dist/utilities/flattenObject.spec.js +0 -158
  129. package/dist/utilities/flattenObject.spec.js.map +0 -1
  130. package/dist/utilities/getExportFieldFunctions.spec.js +0 -50
  131. package/dist/utilities/getExportFieldFunctions.spec.js.map +0 -1
  132. package/dist/utilities/getImportFieldFunctions.spec.js +0 -167
  133. package/dist/utilities/getImportFieldFunctions.spec.js.map +0 -1
  134. package/dist/utilities/getSchemaColumns.spec.js +0 -157
  135. package/dist/utilities/getSchemaColumns.spec.js.map +0 -1
  136. package/dist/utilities/parseCSV.spec.js +0 -195
  137. package/dist/utilities/parseCSV.spec.js.map +0 -1
  138. package/dist/utilities/processRichTextField.spec.js +0 -308
  139. package/dist/utilities/processRichTextField.spec.js.map +0 -1
  140. package/dist/utilities/siblingDoc.spec.js +0 -278
  141. package/dist/utilities/siblingDoc.spec.js.map +0 -1
  142. package/dist/utilities/unflattenObject.spec.js +0 -819
  143. package/dist/utilities/unflattenObject.spec.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utilities/getFileFromDoc.ts"],"sourcesContent":["import type { CollectionConfig, FileData, PayloadRequest, UploadConfig } from 'payload'\n\nimport { FileRetrievalError, getFileByPath } from 'payload'\nimport { getExternalFile } from 'payload/internal'\nimport { formatAdminURL } from 'payload/shared'\n\ntype Args = {\n collectionConfig: CollectionConfig\n doc: { filename: string; mimeType?: string; url?: string }\n req: PayloadRequest\n}\n\ntype Result = {\n data: Buffer\n mimetype: string\n}\n\n/**\n * Retrieves file data from an uploaded document, handling both local storage\n * and cloud storage (S3, Azure, GCS, etc.) scenarios correctly.\n *\n * This function uses the same pattern as Payload's internal file retrieval:\n * - For local storage: reads directly from disk (efficient, no HTTP roundtrip)\n * - For cloud storage: fetches via Payload's file endpoint, which triggers\n * the storage adapter's staticHandler to serve the file\n */\nexport const getFileFromDoc = async ({ collectionConfig, doc, req }: Args): Promise<Result> => {\n const uploadConfig: UploadConfig =\n typeof collectionConfig.upload === 'object' ? collectionConfig.upload : {}\n const disableLocalStorage = uploadConfig.disableLocalStorage ?? false\n const staticDir = uploadConfig.staticDir || collectionConfig.slug\n\n const serverURL = req.payload.config.serverURL\n const isLocalFile = (serverURL && doc.url?.startsWith(serverURL)) || doc.url?.startsWith('/')\n\n if (!disableLocalStorage && isLocalFile && doc.filename) {\n // Local storage enabled - read directly from disk (efficient, no HTTP roundtrip)\n const filePath = `${staticDir}/${doc.filename}`\n const file = await getFileByPath(filePath)\n\n if (!file) {\n throw new Error(`File not found at path: ${filePath}`)\n }\n\n const mimetype = file.mimetype || doc.mimeType\n\n if (!mimetype) {\n throw new FileRetrievalError(req.t, `Unable to determine mimetype for file: ${doc.filename}`)\n }\n\n return {\n data: file.data,\n mimetype,\n }\n }\n\n if (doc.filename && doc.url) {\n // Cloud storage or external - fetch via Payload's file endpoint\n // getExternalFile constructs full URL, includes cookies for auth, and\n // the request goes through Payload's handler chain (including storage adapter)\n\n // For relative URLs, construct a full URL using formatAdminURL which properly\n // handles serverURL, basePath, and other config. This is important in job contexts\n // where request headers may not be available for URL construction.\n // Use serverURL from config, falling back to req.origin for local/job requests.\n const fileUrl = doc.url.startsWith('http')\n ? doc.url\n : formatAdminURL({\n apiRoute: '',\n path: doc.url as `/${string}`,\n serverURL: serverURL || req.origin,\n })\n\n const file = await getExternalFile({\n data: { filename: doc.filename, url: fileUrl } as FileData,\n req,\n uploadConfig,\n })\n\n const mimetype = file.mimetype || doc.mimeType\n\n if (!mimetype) {\n throw new FileRetrievalError(req.t, `Unable to determine mimetype for file: ${doc.filename}`)\n }\n\n return {\n data: file.data,\n mimetype,\n }\n }\n\n throw new Error('Unable to retrieve file: missing filename or url')\n}\n"],"names":["FileRetrievalError","getFileByPath","getExternalFile","formatAdminURL","getFileFromDoc","collectionConfig","doc","req","uploadConfig","upload","disableLocalStorage","staticDir","slug","serverURL","payload","config","isLocalFile","url","startsWith","filename","filePath","file","Error","mimetype","mimeType","t","data","fileUrl","apiRoute","path","origin"],"mappings":"AAEA,SAASA,kBAAkB,EAAEC,aAAa,QAAQ,UAAS;AAC3D,SAASC,eAAe,QAAQ,mBAAkB;AAClD,SAASC,cAAc,QAAQ,iBAAgB;AAa/C;;;;;;;;CAQC,GACD,OAAO,MAAMC,iBAAiB,OAAO,EAAEC,gBAAgB,EAAEC,GAAG,EAAEC,GAAG,EAAQ;IACvE,MAAMC,eACJ,OAAOH,iBAAiBI,MAAM,KAAK,WAAWJ,iBAAiBI,MAAM,GAAG,CAAC;IAC3E,MAAMC,sBAAsBF,aAAaE,mBAAmB,IAAI;IAChE,MAAMC,YAAYH,aAAaG,SAAS,IAAIN,iBAAiBO,IAAI;IA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E,CAAC,uCAAuC,EAAEnB,IAAIa,QAAQ,EAAE;QAC9F;QAEA,OAAO;YACLO,MAAML,KAAKK,IAAI;YACfH;QACF;IACF;IAEA,MAAM,IAAID,MAAM;AAClB,EAAC"}
1
+ {"version":3,"sources":["../../src/utilities/getFileFromDoc.ts"],"sourcesContent":["import type { CollectionConfig, FileData, PayloadRequest, UploadConfig } from 'payload'\n\nimport { FileRetrievalError, getFileByPath } from 'payload'\nimport { downloadFileToBuffer } from 'payload/internal'\nimport { formatAdminURL } from 'payload/shared'\n\ntype Args = {\n collectionConfig: CollectionConfig\n doc: { filename: string; mimeType?: string; url?: string }\n req: PayloadRequest\n}\n\ntype Result = {\n data: Buffer\n mimetype: string\n}\n\n/**\n * Retrieves file data from an uploaded document, handling both local storage\n * and cloud storage (S3, Azure, GCS, etc.) scenarios correctly.\n *\n * This function uses the same pattern as Payload's internal file retrieval:\n * - For local storage: reads directly from disk (efficient, no HTTP roundtrip)\n * - For cloud storage: fetches via Payload's file endpoint, which triggers\n * the storage adapter's staticHandler to serve the file\n */\nexport const getFileFromDoc = async ({ collectionConfig, doc, req }: Args): Promise<Result> => {\n const uploadConfig: UploadConfig =\n typeof collectionConfig.upload === 'object' ? collectionConfig.upload : {}\n const disableLocalStorage = uploadConfig.disableLocalStorage ?? false\n const staticDir = uploadConfig.staticDir || collectionConfig.slug\n\n const serverURL = req.payload.config.serverURL\n const isLocalFile = (serverURL && doc.url?.startsWith(serverURL)) || doc.url?.startsWith('/')\n\n if (!disableLocalStorage && isLocalFile && doc.filename) {\n // Local storage enabled - read directly from disk (efficient, no HTTP roundtrip)\n const filePath = `${staticDir}/${doc.filename}`\n const file = await getFileByPath(filePath)\n\n if (!file) {\n throw new Error(`File not found at path: ${filePath}`)\n }\n\n const mimetype = file.mimetype || doc.mimeType\n\n if (!mimetype) {\n throw new FileRetrievalError(req.t, `Unable to determine mimetype for file: ${doc.filename}`)\n }\n\n return {\n data: file.data,\n mimetype,\n }\n }\n\n if (doc.filename && doc.url) {\n // Cloud storage or external - fetch via Payload's file endpoint\n // downloadFileToBuffer constructs full URL, includes cookies for auth, and\n // the request goes through Payload's handler chain (including storage adapter)\n\n // For relative URLs, construct a full URL using formatAdminURL which properly\n // handles serverURL, basePath, and other config. This is important in job contexts\n // where request headers may not be available for URL construction.\n // Use serverURL from config, falling back to req.origin for local/job requests.\n const fileUrl = doc.url.startsWith('http')\n ? doc.url\n : formatAdminURL({\n apiRoute: '',\n path: doc.url as `/${string}`,\n serverURL: serverURL || req.origin,\n })\n\n const file = await downloadFileToBuffer({\n data: { filename: doc.filename, url: fileUrl },\n req,\n uploadConfig,\n })\n\n const mimetype = file.mimetype || doc.mimeType\n\n if (!mimetype) {\n throw new FileRetrievalError(req.t, `Unable to determine mimetype for file: ${doc.filename}`)\n }\n\n return {\n data: file.data,\n mimetype,\n }\n }\n\n throw new Error('Unable to retrieve file: missing filename or url')\n}\n"],"names":["FileRetrievalError","getFileByPath","downloadFileToBuffer","formatAdminURL","getFileFromDoc","collectionConfig","doc","req","uploadConfig","upload","disableLocalStorage","staticDir","slug","serverURL","payload","config","isLocalFile","url","startsWith","filename","filePath","file","Error","mimetype","mimeType","t","data","fileUrl","apiRoute","path","origin"],"mappings":"AAEA,SAASA,kBAAkB,EAAEC,aAAa,QAAQ,UAAS;AAC3D,SAASC,oBAAoB,QAAQ,mBAAkB;AACvD,SAASC,cAAc,QAAQ,iBAAgB;AAa/C;;;;;;;;CAQC,GACD,OAAO,MAAMC,iBAAiB,OAAO,EAAEC,gBAAgB,EAAEC,GAAG,EAAEC,GAAG,EAAQ;IACvE,MAAMC,eACJ,OAAOH,iBAAiBI,MAAM,KAAK,WAAWJ,iBAAiBI,MAAM,GAAG,CAAC;IAC3E,MAAMC,sBAAsBF,aAAaE,mBAAmB,IAAI;IAChE,MAAMC,YAAYH,aAAaG,SAAS,IAAIN,iBAAiBO,IAAI;IAEjE,MAAMC,YAAYN,IAAIO,OAAO,CAACC,MAAM,CAACF,SAAS;IAC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OAAO;YACLO,MAAML,KAAKK,IAAI;YACfH;QACF;IACF;IAEA,MAAM,IAAID,MAAM;AAClB,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"getSelect.d.ts","sourceRoot":"","sources":["../../src/utilities/getSelect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAEhD;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS,WAAY,MAAM,EAAE,KAAG,iBAoB5C,CAAA"}
1
+ {"version":3,"file":"getSelect.d.ts","sourceRoot":"","sources":["../../src/utilities/getSelect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAOhD;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS,WAAY,MAAM,EAAE,KAAG,iBAyB5C,CAAA"}
@@ -1,3 +1,6 @@
1
+ import { APIError } from 'payload';
2
+ import { hasUnsupportedFieldPathSegment } from 'payload/shared';
3
+ const createSelect = ()=>Object.create(null);
1
4
  /**
2
5
  * Takes an input of array of string paths in dot notation and returns a select object.
3
6
  * Used for both export and import to build Payload's select query format.
@@ -6,16 +9,21 @@
6
9
  * getSelect(['id', 'title', 'group.value', 'createdAt', 'updatedAt'])
7
10
  * // Returns: { id: true, title: true, group: { value: true }, createdAt: true, updatedAt: true }
8
11
  */ export const getSelect = (fields)=>{
9
- const select = {};
12
+ const select = createSelect();
10
13
  fields.forEach((field)=>{
11
14
  const segments = field.split('.');
15
+ if (hasUnsupportedFieldPathSegment({
16
+ segments
17
+ })) {
18
+ throw new APIError('Invalid field path.', 400, null, true);
19
+ }
12
20
  let selectRef = select;
13
21
  segments.forEach((segment, i)=>{
14
22
  if (i === segments.length - 1) {
15
23
  selectRef[segment] = true;
16
24
  } else {
17
- if (!selectRef[segment]) {
18
- selectRef[segment] = {};
25
+ if (!Object.prototype.hasOwnProperty.call(selectRef, segment)) {
26
+ selectRef[segment] = createSelect();
19
27
  }
20
28
  selectRef = selectRef[segment];
21
29
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utilities/getSelect.ts"],"sourcesContent":["import type { SelectIncludeType } from 'payload'\n\n/**\n * Takes an input of array of string paths in dot notation and returns a select object.\n * Used for both export and import to build Payload's select query format.\n *\n * @example\n * getSelect(['id', 'title', 'group.value', 'createdAt', 'updatedAt'])\n * // Returns: { id: true, title: true, group: { value: true }, createdAt: true, updatedAt: true }\n */\nexport const getSelect = (fields: string[]): SelectIncludeType => {\n const select: SelectIncludeType = {}\n\n fields.forEach((field) => {\n const segments = field.split('.')\n let selectRef = select\n\n segments.forEach((segment, i) => {\n if (i === segments.length - 1) {\n selectRef[segment] = true\n } else {\n if (!selectRef[segment]) {\n selectRef[segment] = {}\n }\n selectRef = selectRef[segment] as SelectIncludeType\n }\n })\n })\n\n return select\n}\n"],"names":["getSelect","fields","select","forEach","field","segments","split","selectRef","segment","i","length"],"mappings":"AAEA;;;;;;;CAOC,GACD,OAAO,MAAMA,YAAY,CAACC;IACxB,MAAMC,SAA4B,CAAC;IAEnCD,OAAOE,OAAO,CAAC,CAACC;QACd,MAAMC,WAAWD,MAAME,KAAK,CAAC;QAC7B,IAAIC,YAAYL;QAEhBG,SAASF,OAAO,CAAC,CAACK,SAASC;YACzB,IAAIA,MAAMJ,SAASK,MAAM,GAAG,GAAG;gBAC7BH,SAAS,CAACC,QAAQ,GAAG;YACvB,OAAO;gBACL,IAAI,CAACD,SAAS,CAACC,QAAQ,EAAE;oBACvBD,SAAS,CAACC,QAAQ,GAAG,CAAC;gBACxB;gBACAD,YAAYA,SAAS,CAACC,QAAQ;YAChC;QACF;IACF;IAEA,OAAON;AACT,EAAC"}
1
+ {"version":3,"sources":["../../src/utilities/getSelect.ts"],"sourcesContent":["import type { SelectIncludeType } from 'payload'\n\nimport { APIError } from 'payload'\nimport { hasUnsupportedFieldPathSegment } from 'payload/shared'\n\nconst createSelect = (): SelectIncludeType => Object.create(null) as SelectIncludeType\n\n/**\n * Takes an input of array of string paths in dot notation and returns a select object.\n * Used for both export and import to build Payload's select query format.\n *\n * @example\n * getSelect(['id', 'title', 'group.value', 'createdAt', 'updatedAt'])\n * // Returns: { id: true, title: true, group: { value: true }, createdAt: true, updatedAt: true }\n */\nexport const getSelect = (fields: string[]): SelectIncludeType => {\n const select = createSelect()\n\n fields.forEach((field) => {\n const segments = field.split('.')\n\n if (hasUnsupportedFieldPathSegment({ segments })) {\n throw new APIError('Invalid field path.', 400, null, true)\n }\n\n let selectRef = select\n\n segments.forEach((segment, i) => {\n if (i === segments.length - 1) {\n selectRef[segment] = true\n } else {\n if (!Object.prototype.hasOwnProperty.call(selectRef, segment)) {\n selectRef[segment] = createSelect()\n }\n selectRef = selectRef[segment] as SelectIncludeType\n }\n })\n })\n\n return select\n}\n"],"names":["APIError","hasUnsupportedFieldPathSegment","createSelect","Object","create","getSelect","fields","select","forEach","field","segments","split","selectRef","segment","i","length","prototype","hasOwnProperty","call"],"mappings":"AAEA,SAASA,QAAQ,QAAQ,UAAS;AAClC,SAASC,8BAA8B,QAAQ,iBAAgB;AAE/D,MAAMC,eAAe,IAAyBC,OAAOC,MAAM,CAAC;AAE5D;;;;;;;CAOC,GACD,OAAO,MAAMC,YAAY,CAACC;IACxB,MAAMC,SAASL;IAEfI,OAAOE,OAAO,CAAC,CAACC;QACd,MAAMC,WAAWD,MAAME,KAAK,CAAC;QAE7B,IAAIV,+BAA+B;YAAES;QAAS,IAAI;YAChD,MAAM,IAAIV,SAAS,uBAAuB,KAAK,MAAM;QACvD;QAEA,IAAIY,YAAYL;QAEhBG,SAASF,OAAO,CAAC,CAACK,SAASC;YACzB,IAAIA,MAAMJ,SAASK,MAAM,GAAG,GAAG;gBAC7BH,SAAS,CAACC,QAAQ,GAAG;YACvB,OAAO;gBACL,IAAI,CAACV,OAAOa,SAAS,CAACC,cAAc,CAACC,IAAI,CAACN,WAAWC,UAAU;oBAC7DD,SAAS,CAACC,QAAQ,GAAGX;gBACvB;gBACAU,YAAYA,SAAS,CAACC,QAAQ;YAChC;QACF;IACF;IAEA,OAAON;AACT,EAAC"}
@@ -0,0 +1,12 @@
1
+ export declare const getSubmittedFormValues: ({ formData, omit, }: {
2
+ formData: Record<string, unknown>;
3
+ omit?: string[];
4
+ }) => Record<string, unknown>;
5
+ /** Tracks value changes, including nested custom fields, without depending on field state identity. */
6
+ export declare const getFormStateSignature: ({ fields, omit, }: {
7
+ fields: Record<string, {
8
+ value?: unknown;
9
+ } | undefined>;
10
+ omit?: string[];
11
+ }) => string;
12
+ //# sourceMappingURL=getSubmittedFormValues.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getSubmittedFormValues.d.ts","sourceRoot":"","sources":["../../src/utilities/getSubmittedFormValues.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,sBAAsB,wBAGhC;IACD,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACjC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;CAChB,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAIzB,CAAA;AAED,uGAAuG;AACvG,eAAO,MAAM,qBAAqB,sBAG/B;IACD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,SAAS,CAAC,CAAA;IACvD,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;CAChB,KAAG,MAQH,CAAA"}
@@ -0,0 +1,24 @@
1
+ /** Unsaved form values must not appear to come from a saved document. */ const serverOwnedFormKeys = new Set([
2
+ 'createdAt',
3
+ 'id',
4
+ 'updatedAt'
5
+ ]);
6
+ export const getSubmittedFormValues = ({ formData, omit = [] })=>{
7
+ const omitKeys = new Set([
8
+ ...omit,
9
+ ...serverOwnedFormKeys
10
+ ]);
11
+ return Object.fromEntries(Object.entries(formData).filter(([key])=>!omitKeys.has(key)));
12
+ };
13
+ /** Tracks value changes, including nested custom fields, without depending on field state identity. */ export const getFormStateSignature = ({ fields, omit = [] })=>{
14
+ const omitKeys = new Set([
15
+ ...omit,
16
+ ...serverOwnedFormKeys
17
+ ]);
18
+ return JSON.stringify(Object.entries(fields).filter(([path])=>!omitKeys.has(path)).map(([path, field])=>[
19
+ path,
20
+ field?.value
21
+ ]));
22
+ };
23
+
24
+ //# sourceMappingURL=getSubmittedFormValues.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utilities/getSubmittedFormValues.ts"],"sourcesContent":["/** Unsaved form values must not appear to come from a saved document. */\nconst serverOwnedFormKeys = new Set(['createdAt', 'id', 'updatedAt'])\n\nexport const getSubmittedFormValues = ({\n formData,\n omit = [],\n}: {\n formData: Record<string, unknown>\n omit?: string[]\n}): Record<string, unknown> => {\n const omitKeys = new Set([...omit, ...serverOwnedFormKeys])\n\n return Object.fromEntries(Object.entries(formData).filter(([key]) => !omitKeys.has(key)))\n}\n\n/** Tracks value changes, including nested custom fields, without depending on field state identity. */\nexport const getFormStateSignature = ({\n fields,\n omit = [],\n}: {\n fields: Record<string, { value?: unknown } | undefined>\n omit?: string[]\n}): string => {\n const omitKeys = new Set([...omit, ...serverOwnedFormKeys])\n\n return JSON.stringify(\n Object.entries(fields)\n .filter(([path]) => !omitKeys.has(path))\n .map(([path, field]) => [path, field?.value]),\n )\n}\n"],"names":["serverOwnedFormKeys","Set","getSubmittedFormValues","formData","omit","omitKeys","Object","fromEntries","entries","filter","key","has","getFormStateSignature","fields","JSON","stringify","path","map","field","value"],"mappings":"AAAA,uEAAuE,GACvE,MAAMA,sBAAsB,IAAIC,IAAI;IAAC;IAAa;IAAM;CAAY;AAEpE,OAAO,MAAMC,yBAAyB,CAAC,EACrCC,QAAQ,EACRC,OAAO,EAAE,EAIV;IACC,MAAMC,WAAW,IAAIJ,IAAI;WAAIG;WAASJ;KAAoB;IAE1D,OAAOM,OAAOC,WAAW,CAACD,OAAOE,OAAO,CAACL,UAAUM,MAAM,CAAC,CAAC,CAACC,IAAI,GAAK,CAACL,SAASM,GAAG,CAACD;AACrF,EAAC;AAED,qGAAqG,GACrG,OAAO,MAAME,wBAAwB,CAAC,EACpCC,MAAM,EACNT,OAAO,EAAE,EAIV;IACC,MAAMC,WAAW,IAAIJ,IAAI;WAAIG;WAASJ;KAAoB;IAE1D,OAAOc,KAAKC,SAAS,CACnBT,OAAOE,OAAO,CAACK,QACZJ,MAAM,CAAC,CAAC,CAACO,KAAK,GAAK,CAACX,SAASM,GAAG,CAACK,OACjCC,GAAG,CAAC,CAAC,CAACD,MAAME,MAAM,GAAK;YAACF;YAAME,OAAOC;SAAM;AAElD,EAAC"}
@@ -14,6 +14,7 @@
14
14
  * @param obj - The target object to mutate.
15
15
  * @param path - A dot-separated string path indicating where to assign the value.
16
16
  * @param value - The value to set at the specified path.
17
+ * @param source - The source object used to validate array boundaries.
17
18
  */
18
- export declare const setNestedValue: (obj: Record<string, unknown>, path: string, value: unknown) => void;
19
+ export declare const setNestedValue: (obj: Record<string, unknown>, path: string, value: unknown, source?: Record<string, unknown>) => void;
19
20
  //# sourceMappingURL=setNestedValue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"setNestedValue.d.ts","sourceRoot":"","sources":["../../src/utilities/setNestedValue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,eAAO,MAAM,cAAc,QACpB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,QACtB,MAAM,SACL,OAAO,KACb,IA8CF,CAAA"}
1
+ {"version":3,"file":"setNestedValue.d.ts","sourceRoot":"","sources":["../../src/utilities/setNestedValue.ts"],"names":[],"mappings":"AAoDA;;;;;;;;;;;;;;;;;GAiBG;AAEH,eAAO,MAAM,cAAc,QACpB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,QACtB,MAAM,SACL,OAAO,WACL,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC/B,IAyCF,CAAA"}
@@ -1,3 +1,34 @@
1
+ import { APIError } from 'payload';
2
+ import { hasUnsupportedFieldPathSegment, setOwnProperty } from 'payload/shared';
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
+ if (!Object.hasOwn(source, key)) {
28
+ return undefined;
29
+ }
30
+ return source[key];
31
+ };
1
32
  /**
2
33
  * Sets a value deeply into a nested object or array, based on a dot-notation path.
3
34
  *
@@ -14,44 +45,44 @@
14
45
  * @param obj - The target object to mutate.
15
46
  * @param path - A dot-separated string path indicating where to assign the value.
16
47
  * @param value - The value to set at the specified path.
17
- */ export const setNestedValue = (obj, path, value)=>{
48
+ * @param source - The source object used to validate array boundaries.
49
+ */ export const setNestedValue = (obj, path, value, source)=>{
18
50
  const parts = path.split('.');
51
+ if (hasUnsupportedFieldPathSegment({
52
+ segments: parts
53
+ })) {
54
+ throw new APIError('Invalid field path.', 400, null, true);
55
+ }
56
+ const lastPart = parts.pop();
57
+ if (lastPart === undefined) {
58
+ return;
59
+ }
19
60
  let current = obj;
20
- for(let i = 0; i < parts.length; i++){
21
- const part = parts[i];
22
- const isLast = i === parts.length - 1;
23
- const isIndex = !Number.isNaN(Number(part));
24
- if (isIndex) {
25
- const index = Number(part);
26
- // Ensure the current target is an array
27
- if (!Array.isArray(current)) {
28
- current = [];
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
- }
61
+ let sourceCurrent = source;
62
+ for (const [i, part] of parts.entries()){
63
+ const key = getPathKey(current, part, sourceCurrent);
64
+ const currentRecord = current;
65
+ const nextPart = parts[i + 1] ?? lastPart;
66
+ const nextSource = getSourceValue(sourceCurrent, part);
67
+ const hasOwnNextValue = Object.hasOwn(currentRecord, key);
68
+ const nextValue = hasOwnNextValue ? currentRecord[key] : undefined;
69
+ if (!hasOwnNextValue || typeof nextValue !== 'object' || nextValue === null) {
70
+ setOwnProperty({
71
+ key,
72
+ target: currentRecord,
73
+ value: isArrayIndex(nextPart) ? [] : createObject()
74
+ });
53
75
  }
76
+ current = currentRecord[key];
77
+ sourceCurrent = nextSource;
54
78
  }
79
+ const lastKey = getPathKey(current, lastPart, sourceCurrent);
80
+ const finalRecord = current;
81
+ setOwnProperty({
82
+ key: lastKey,
83
+ target: finalRecord,
84
+ value
85
+ });
55
86
  };
56
87
 
57
88
  //# 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 let current: unknown = obj\n\n for (let i = 0; i < parts.length; i++) {\n const part = parts[i]\n const isLast = i === parts.length - 1\n const isIndex = !Number.isNaN(Number(part))\n\n if (isIndex) {\n const index = Number(part)\n\n // Ensure the current target is an array\n if (!Array.isArray(current)) {\n current = []\n }\n\n const currentArray = current as unknown[]\n\n // Ensure the array slot is initialized\n if (!currentArray[index]) {\n currentArray[index] = {}\n }\n\n if (isLast) {\n currentArray[index] = value\n } else {\n current = currentArray[index]\n }\n } else {\n const currentObj = current as Record<string, unknown>\n\n // Ensure the object key exists\n if (isLast) {\n if (typeof part === 'string') {\n currentObj[part] = value\n }\n } else {\n if (typeof currentObj[part as string] !== 'object' || currentObj[part as string] === null) {\n currentObj[part as string] = {}\n }\n\n current = currentObj[part as string]\n }\n }\n }\n}\n"],"names":["setNestedValue","obj","path","value","parts","split","current","i","length","part","isLast","isIndex","Number","isNaN","index","Array","isArray","currentArray","currentObj"],"mappings":"AAAA;;;;;;;;;;;;;;;;CAgBC,GAED,OAAO,MAAMA,iBAAiB,CAC5BC,KACAC,MACAC;IAEA,MAAMC,QAAQF,KAAKG,KAAK,CAAC;IACzB,IAAIC,UAAmBL;IAEvB,IAAK,IAAIM,IAAI,GAAGA,IAAIH,MAAMI,MAAM,EAAED,IAAK;QACrC,MAAME,OAAOL,KAAK,CAACG,EAAE;QACrB,MAAMG,SAASH,MAAMH,MAAMI,MAAM,GAAG;QACpC,MAAMG,UAAU,CAACC,OAAOC,KAAK,CAACD,OAAOH;QAErC,IAAIE,SAAS;YACX,MAAMG,QAAQF,OAAOH;YAErB,wCAAwC;YACxC,IAAI,CAACM,MAAMC,OAAO,CAACV,UAAU;gBAC3BA,UAAU,EAAE;YACd;YAEA,MAAMW,eAAeX;YAErB,uCAAuC;YACvC,IAAI,CAACW,YAAY,CAACH,MAAM,EAAE;gBACxBG,YAAY,CAACH,MAAM,GAAG,CAAC;YACzB;YAEA,IAAIJ,QAAQ;gBACVO,YAAY,CAACH,MAAM,GAAGX;YACxB,OAAO;gBACLG,UAAUW,YAAY,CAACH,MAAM;YAC/B;QACF,OAAO;YACL,MAAMI,aAAaZ;YAEnB,+BAA+B;YAC/B,IAAII,QAAQ;gBACV,IAAI,OAAOD,SAAS,UAAU;oBAC5BS,UAAU,CAACT,KAAK,GAAGN;gBACrB;YACF,OAAO;gBACL,IAAI,OAAOe,UAAU,CAACT,KAAe,KAAK,YAAYS,UAAU,CAACT,KAAe,KAAK,MAAM;oBACzFS,UAAU,CAACT,KAAe,GAAG,CAAC;gBAChC;gBAEAH,UAAUY,UAAU,CAACT,KAAe;YACtC;QACF;IACF;AACF,EAAC"}
1
+ {"version":3,"sources":["../../src/utilities/setNestedValue.ts"],"sourcesContent":["import { APIError } from 'payload'\nimport { hasUnsupportedFieldPathSegment, setOwnProperty } from 'payload/shared'\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 if (!Object.hasOwn(source, key)) {\n return undefined\n }\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({ segments: 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 hasOwnNextValue = Object.hasOwn(currentRecord, key)\n const nextValue = hasOwnNextValue ? currentRecord[key] : undefined\n\n if (!hasOwnNextValue || typeof nextValue !== 'object' || nextValue === null) {\n setOwnProperty({\n key,\n target: currentRecord,\n value: isArrayIndex(nextPart) ? [] : createObject(),\n })\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 setOwnProperty({ key: lastKey, target: finalRecord, value })\n}\n"],"names":["APIError","hasUnsupportedFieldPathSegment","setOwnProperty","MAX_UNVERIFIED_SPARSE_ARRAY_GAP","createObject","Object","create","isArrayIndex","part","test","index","Number","isSafeInteger","getPathKey","target","source","Array","isArray","length","getSourceValue","undefined","key","hasOwn","setNestedValue","obj","path","value","parts","split","segments","lastPart","pop","current","sourceCurrent","i","entries","currentRecord","nextPart","nextSource","hasOwnNextValue","nextValue","lastKey","finalRecord"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,UAAS;AAClC,SAASC,8BAA8B,EAAEC,cAAc,QAAQ,iBAAgB;AAE/E,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,IAAIH,SAAS,uBAAuB,KAAK,MAAM;IACvD;IAEA,OAAOU;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,IAAI,CAACH,OAAOiB,MAAM,CAACP,QAAQM,MAAM;QAC/B,OAAOD;IACT;IAEA,OAAO,AAACL,MAA2C,CAACM,IAAI;AAC1D;AAEA;;;;;;;;;;;;;;;;;CAiBC,GAED,OAAO,MAAME,iBAAiB,CAC5BC,KACAC,MACAC,OACAX;IAEA,MAAMY,QAAQF,KAAKG,KAAK,CAAC;IAEzB,IAAI3B,+BAA+B;QAAE4B,UAAUF;IAAM,IAAI;QACvD,MAAM,IAAI3B,SAAS,uBAAuB,KAAK,MAAM;IACvD;IAEA,MAAM8B,WAAWH,MAAMI,GAAG;IAE1B,IAAID,aAAaV,WAAW;QAC1B;IACF;IAEA,IAAIY,UAA+CR;IACnD,IAAIS,gBAAyBlB;IAE7B,KAAK,MAAM,CAACmB,GAAG1B,KAAK,IAAImB,MAAMQ,OAAO,GAAI;QACvC,MAAMd,MAAMR,WAAWmB,SAASxB,MAAMyB;QACtC,MAAMG,gBAAgBJ;QACtB,MAAMK,WAAWV,KAAK,CAACO,IAAI,EAAE,IAAIJ;QACjC,MAAMQ,aAAanB,eAAec,eAAezB;QAEjD,MAAM+B,kBAAkBlC,OAAOiB,MAAM,CAACc,eAAef;QACrD,MAAMmB,YAAYD,kBAAkBH,aAAa,CAACf,IAAI,GAAGD;QAEzD,IAAI,CAACmB,mBAAmB,OAAOC,cAAc,YAAYA,cAAc,MAAM;YAC3EtC,eAAe;gBACbmB;gBACAP,QAAQsB;gBACRV,OAAOnB,aAAa8B,YAAY,EAAE,GAAGjC;YACvC;QACF;QAEA4B,UAAUI,aAAa,CAACf,IAAI;QAC5BY,gBAAgBK;IAClB;IAEA,MAAMG,UAAU5B,WAAWmB,SAASF,UAAUG;IAC9C,MAAMS,cAAcV;IAEpB9B,eAAe;QAAEmB,KAAKoB;QAAS3B,QAAQ4B;QAAahB;IAAM;AAC5D,EAAC"}
package/package.json CHANGED
@@ -1,22 +1,17 @@
1
1
  {
2
2
  "name": "@payloadcms/plugin-import-export",
3
- "version": "4.0.0-internal.f851106",
3
+ "version": "4.0.0-internal.f980c7c",
4
4
  "description": "Import-Export plugin for Payload",
5
5
  "keywords": [
6
- "payload",
7
6
  "cms",
7
+ "export",
8
+ "import",
9
+ "nextjs",
10
+ "payload",
8
11
  "plugin",
9
- "typescript",
10
12
  "react",
11
- "nextjs",
12
- "import",
13
- "export"
13
+ "typescript"
14
14
  ],
15
- "repository": {
16
- "type": "git",
17
- "url": "https://github.com/payloadcms/payload.git",
18
- "directory": "packages/plugin-import-export"
19
- },
20
15
  "license": "MIT",
21
16
  "author": "Payload <dev@payloadcms.com> (https://payloadcms.com)",
22
17
  "maintainers": [
@@ -26,7 +21,17 @@
26
21
  "url": "https://payloadcms.com"
27
22
  }
28
23
  ],
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "https://github.com/payloadcms/payload.git",
27
+ "directory": "packages/plugin-import-export"
28
+ },
29
+ "files": [
30
+ "dist"
31
+ ],
29
32
  "type": "module",
33
+ "main": "./dist/index.js",
34
+ "types": "./dist/index.d.ts",
30
35
  "exports": {
31
36
  ".": {
32
37
  "import": "./dist/index.js",
@@ -54,27 +59,21 @@
54
59
  "default": "./dist/translations/languages/*.js"
55
60
  }
56
61
  },
57
- "main": "./dist/index.js",
58
- "types": "./dist/index.d.ts",
59
- "files": [
60
- "dist"
61
- ],
62
62
  "dependencies": {
63
- "@faceless-ui/modal": "3.0.1",
63
+ "@faceless-ui/modal": "3.0.2",
64
+ "@payloadcms/translations": "4.0.0-internal.f980c7c",
65
+ "@payloadcms/ui": "4.0.0-internal.f980c7c",
64
66
  "csv-parse": "5.6.0",
65
67
  "csv-stringify": "6.5.2",
66
- "qs-esm": "8.0.1",
67
- "@payloadcms/translations": "4.0.0-internal.f851106",
68
- "@payloadcms/ui": "4.0.0-internal.f851106"
68
+ "qs-esm": "8.0.1"
69
69
  },
70
70
  "devDependencies": {
71
- "@payloadcms/eslint-config": "3.28.0",
72
- "@payloadcms/ui": "4.0.0-internal.f851106",
73
- "payload": "4.0.0-internal.f851106"
71
+ "@payloadcms/ui": "4.0.0-internal.f980c7c",
72
+ "payload": "4.0.0-internal.f980c7c"
74
73
  },
75
74
  "peerDependencies": {
76
- "@payloadcms/ui": "4.0.0-internal.f851106",
77
- "payload": "4.0.0-internal.f851106"
75
+ "@payloadcms/ui": "4.0.0-internal.f980c7c",
76
+ "payload": "4.0.0-internal.f980c7c"
78
77
  },
79
78
  "homepage:": "https://payloadcms.com",
80
79
  "scripts": {
@@ -83,8 +82,6 @@
83
82
  "build:swc": "swc ./src -d ./dist --config-file .swcrc --strip-leading-paths",
84
83
  "build:types": "tsc --emitDeclarationOnly --outDir dist",
85
84
  "clean": "rimraf {dist,*.tsbuildinfo}",
86
- "copyfiles": "copyfiles -u 1 \"src/**/*.{html,css,scss,ttf,woff,woff2,eot,svg,jpg,png,json}\" dist/",
87
- "lint": "eslint .",
88
- "lint:fix": "eslint . --fix"
85
+ "copyfiles": "copyfiles -u 1 -e \"**/*.spec.*\" \"src/**/*.{html,css,scss,ttf,woff,woff2,eot,svg,jpg,png,json}\" dist/"
89
86
  }
90
87
  }
@@ -1,239 +0,0 @@
1
- import { describe, expect, it } from 'vitest';
2
- import { reduceFields } from './reduceFields.js';
3
- const values = (result)=>result.map((f)=>f.value);
4
- describe('reduceFields', ()=>{
5
- describe('excludeUnsortable', ()=>{
6
- it('should include array and blocks fields by default', ()=>{
7
- const fields = [
8
- {
9
- name: 'title',
10
- type: 'text'
11
- },
12
- {
13
- name: 'items',
14
- type: 'array',
15
- fields: [
16
- {
17
- name: 'text',
18
- type: 'text'
19
- }
20
- ]
21
- },
22
- {
23
- name: 'layout',
24
- type: 'blocks',
25
- blocks: []
26
- }
27
- ];
28
- const result = values(reduceFields({
29
- fields
30
- }));
31
- expect(result).toContain('title');
32
- expect(result).toContain('items');
33
- expect(result).toContain('layout');
34
- });
35
- it('should exclude array fields when excludeUnsortable is true', ()=>{
36
- const fields = [
37
- {
38
- name: 'title',
39
- type: 'text'
40
- },
41
- {
42
- name: 'items',
43
- type: 'array',
44
- fields: [
45
- {
46
- name: 'text',
47
- type: 'text'
48
- }
49
- ]
50
- }
51
- ];
52
- const result = values(reduceFields({
53
- excludeUnsortable: true,
54
- fields
55
- }));
56
- expect(result).toContain('title');
57
- expect(result).not.toContain('items');
58
- });
59
- it('should exclude blocks fields when excludeUnsortable is true', ()=>{
60
- const fields = [
61
- {
62
- name: 'title',
63
- type: 'text'
64
- },
65
- {
66
- name: 'layout',
67
- type: 'blocks',
68
- blocks: []
69
- }
70
- ];
71
- const result = values(reduceFields({
72
- excludeUnsortable: true,
73
- fields
74
- }));
75
- expect(result).toContain('title');
76
- expect(result).not.toContain('layout');
77
- });
78
- });
79
- describe('disabledFields', ()=>{
80
- it('should include all fields when disabledFields is empty', ()=>{
81
- const fields = [
82
- {
83
- name: 'title',
84
- type: 'text'
85
- },
86
- {
87
- name: 'slug',
88
- type: 'text'
89
- }
90
- ];
91
- const result = values(reduceFields({
92
- disabledFields: [],
93
- fields
94
- }));
95
- expect(result).toContain('title');
96
- expect(result).toContain('slug');
97
- });
98
- it('should exclude a field whose path is in disabledFields', ()=>{
99
- const fields = [
100
- {
101
- name: 'title',
102
- type: 'text'
103
- },
104
- {
105
- name: 'slug',
106
- type: 'text'
107
- }
108
- ];
109
- const result = values(reduceFields({
110
- disabledFields: [
111
- 'slug'
112
- ],
113
- fields
114
- }));
115
- expect(result).toContain('title');
116
- expect(result).not.toContain('slug');
117
- });
118
- it('should exclude nested fields whose paths start with a disabled parent path', ()=>{
119
- const fields = [
120
- {
121
- name: 'meta',
122
- type: 'group',
123
- fields: [
124
- {
125
- name: 'title',
126
- type: 'text'
127
- },
128
- {
129
- name: 'description',
130
- type: 'text'
131
- }
132
- ]
133
- }
134
- ];
135
- const result = values(reduceFields({
136
- disabledFields: [
137
- 'meta.description'
138
- ],
139
- fields
140
- }));
141
- expect(result).toContain('meta.title');
142
- expect(result).not.toContain('meta.description');
143
- });
144
- });
145
- describe('combined excludeUnsortable and disabledFields', ()=>{
146
- it('should apply both filters simultaneously', ()=>{
147
- const fields = [
148
- {
149
- name: 'title',
150
- type: 'text'
151
- },
152
- {
153
- name: 'slug',
154
- type: 'text'
155
- },
156
- {
157
- name: 'items',
158
- type: 'array',
159
- fields: [
160
- {
161
- name: 'text',
162
- type: 'text'
163
- }
164
- ]
165
- }
166
- ];
167
- const result = values(reduceFields({
168
- disabledFields: [
169
- 'slug'
170
- ],
171
- excludeUnsortable: true,
172
- fields
173
- }));
174
- expect(result).toContain('title');
175
- expect(result).not.toContain('slug');
176
- expect(result).not.toContain('items');
177
- });
178
- });
179
- describe('recursive propagation through group sub-fields', ()=>{
180
- it('should propagate excludeUnsortable into group sub-fields', ()=>{
181
- const fields = [
182
- {
183
- name: 'meta',
184
- type: 'group',
185
- fields: [
186
- {
187
- name: 'title',
188
- type: 'text'
189
- },
190
- {
191
- name: 'tags',
192
- type: 'array',
193
- fields: [
194
- {
195
- name: 'tag',
196
- type: 'text'
197
- }
198
- ]
199
- }
200
- ]
201
- }
202
- ];
203
- const result = values(reduceFields({
204
- excludeUnsortable: true,
205
- fields
206
- }));
207
- expect(result).toContain('meta.title');
208
- expect(result).not.toContain('meta.tags');
209
- });
210
- it('should propagate disabledFields into group sub-fields', ()=>{
211
- const fields = [
212
- {
213
- name: 'meta',
214
- type: 'group',
215
- fields: [
216
- {
217
- name: 'title',
218
- type: 'text'
219
- },
220
- {
221
- name: 'description',
222
- type: 'text'
223
- }
224
- ]
225
- }
226
- ];
227
- const result = values(reduceFields({
228
- disabledFields: [
229
- 'meta.description'
230
- ],
231
- fields
232
- }));
233
- expect(result).toContain('meta.title');
234
- expect(result).not.toContain('meta.description');
235
- });
236
- });
237
- });
238
-
239
- //# sourceMappingURL=reduceFields.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/components/FieldsToExport/reduceFields.spec.ts"],"sourcesContent":["import type { ClientField } from 'payload'\n\nimport { describe, expect, it } from 'vitest'\n\nimport { reduceFields } from './reduceFields.js'\n\nconst values = (result: ReturnType<typeof reduceFields>) => result.map((f) => f.value)\n\ndescribe('reduceFields', () => {\n describe('excludeUnsortable', () => {\n it('should include array and blocks fields by default', () => {\n const fields: ClientField[] = [\n { name: 'title', type: 'text' },\n { name: 'items', type: 'array', fields: [{ name: 'text', type: 'text' }] },\n { name: 'layout', type: 'blocks', blocks: [] },\n ]\n\n const result = values(reduceFields({ fields }))\n\n expect(result).toContain('title')\n expect(result).toContain('items')\n expect(result).toContain('layout')\n })\n\n it('should exclude array fields when excludeUnsortable is true', () => {\n const fields: ClientField[] = [\n { name: 'title', type: 'text' },\n { name: 'items', type: 'array', fields: [{ name: 'text', type: 'text' }] },\n ]\n\n const result = values(reduceFields({ excludeUnsortable: true, fields }))\n\n expect(result).toContain('title')\n expect(result).not.toContain('items')\n })\n\n it('should exclude blocks fields when excludeUnsortable is true', () => {\n const fields: ClientField[] = [\n { name: 'title', type: 'text' },\n { name: 'layout', type: 'blocks', blocks: [] },\n ]\n\n const result = values(reduceFields({ excludeUnsortable: true, fields }))\n\n expect(result).toContain('title')\n expect(result).not.toContain('layout')\n })\n })\n\n describe('disabledFields', () => {\n it('should include all fields when disabledFields is empty', () => {\n const fields: ClientField[] = [\n { name: 'title', type: 'text' },\n { name: 'slug', type: 'text' },\n ]\n\n const result = values(reduceFields({ disabledFields: [], fields }))\n\n expect(result).toContain('title')\n expect(result).toContain('slug')\n })\n\n it('should exclude a field whose path is in disabledFields', () => {\n const fields: ClientField[] = [\n { name: 'title', type: 'text' },\n { name: 'slug', type: 'text' },\n ]\n\n const result = values(reduceFields({ disabledFields: ['slug'], fields }))\n\n expect(result).toContain('title')\n expect(result).not.toContain('slug')\n })\n\n it('should exclude nested fields whose paths start with a disabled parent path', () => {\n const fields: ClientField[] = [\n {\n name: 'meta',\n type: 'group',\n fields: [\n { name: 'title', type: 'text' },\n { name: 'description', type: 'text' },\n ],\n },\n ]\n\n const result = values(reduceFields({ disabledFields: ['meta.description'], fields }))\n\n expect(result).toContain('meta.title')\n expect(result).not.toContain('meta.description')\n })\n })\n\n describe('combined excludeUnsortable and disabledFields', () => {\n it('should apply both filters simultaneously', () => {\n const fields: ClientField[] = [\n { name: 'title', type: 'text' },\n { name: 'slug', type: 'text' },\n { name: 'items', type: 'array', fields: [{ name: 'text', type: 'text' }] },\n ]\n\n const result = values(\n reduceFields({ disabledFields: ['slug'], excludeUnsortable: true, fields }),\n )\n\n expect(result).toContain('title')\n expect(result).not.toContain('slug')\n expect(result).not.toContain('items')\n })\n })\n\n describe('recursive propagation through group sub-fields', () => {\n it('should propagate excludeUnsortable into group sub-fields', () => {\n const fields: ClientField[] = [\n {\n name: 'meta',\n type: 'group',\n fields: [\n { name: 'title', type: 'text' },\n { name: 'tags', type: 'array', fields: [{ name: 'tag', type: 'text' }] },\n ],\n },\n ]\n\n const result = values(reduceFields({ excludeUnsortable: true, fields }))\n\n expect(result).toContain('meta.title')\n expect(result).not.toContain('meta.tags')\n })\n\n it('should propagate disabledFields into group sub-fields', () => {\n const fields: ClientField[] = [\n {\n name: 'meta',\n type: 'group',\n fields: [\n { name: 'title', type: 'text' },\n { name: 'description', type: 'text' },\n ],\n },\n ]\n\n const result = values(reduceFields({ disabledFields: ['meta.description'], fields }))\n\n expect(result).toContain('meta.title')\n expect(result).not.toContain('meta.description')\n })\n })\n})\n"],"names":["describe","expect","it","reduceFields","values","result","map","f","value","fields","name","type","blocks","toContain","excludeUnsortable","not","disabledFields"],"mappings":"AAEA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,SAAQ;AAE7C,SAASC,YAAY,QAAQ,oBAAmB;AAEhD,MAAMC,SAAS,CAACC,SAA4CA,OAAOC,GAAG,CAAC,CAACC,IAAMA,EAAEC,KAAK;AAErFR,SAAS,gBAAgB;IACvBA,SAAS,qBAAqB;QAC5BE,GAAG,qDAAqD;YACtD,MAAMO,SAAwB;gBAC5B;oBAAEC,MAAM;oBAASC,MAAM;gBAAO;gBAC9B;oBAAED,MAAM;oBAASC,MAAM;oBAASF,QAAQ;wBAAC;4BAAEC,MAAM;4BAAQC,MAAM;wBAAO;qBAAE;gBAAC;gBACzE;oBAAED,MAAM;oBAAUC,MAAM;oBAAUC,QAAQ,EAAE;gBAAC;aAC9C;YAED,MAAMP,SAASD,OAAOD,aAAa;gBA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