@payloadcms/plugin-import-export 4.0.0-internal.688c4d0 → 4.0.0-internal.77191e5

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 (130) hide show
  1. package/dist/components/ExportPreview/index.css +55 -0
  2. package/dist/components/ExportPreview/index.d.ts +1 -1
  3. package/dist/components/ExportPreview/index.d.ts.map +1 -1
  4. package/dist/components/ExportPreview/index.js +1 -1
  5. package/dist/components/ExportPreview/index.js.map +1 -1
  6. package/dist/components/FieldsToExport/reduceFields.d.ts.map +1 -1
  7. package/dist/components/FormatField/index.d.ts.map +1 -1
  8. package/dist/components/FormatField/index.js +6 -3
  9. package/dist/components/FormatField/index.js.map +1 -1
  10. package/dist/components/ImportPreview/index.css +48 -0
  11. package/dist/components/ImportPreview/index.d.ts +1 -1
  12. package/dist/components/ImportPreview/index.d.ts.map +1 -1
  13. package/dist/components/ImportPreview/index.js +1 -1
  14. package/dist/components/ImportPreview/index.js.map +1 -1
  15. package/dist/components/Page/index.d.ts +1 -1
  16. package/dist/components/Page/index.d.ts.map +1 -1
  17. package/dist/components/Page/index.js +1 -1
  18. package/dist/components/Page/index.js.map +1 -1
  19. package/dist/components/SortBy/index.css +9 -0
  20. package/dist/components/SortBy/index.d.ts +1 -1
  21. package/dist/components/SortBy/index.d.ts.map +1 -1
  22. package/dist/components/SortBy/index.js +1 -2
  23. package/dist/components/SortBy/index.js.map +1 -1
  24. package/dist/components/SortOrder/index.css +9 -0
  25. package/dist/components/SortOrder/index.d.ts +1 -1
  26. package/dist/components/SortOrder/index.d.ts.map +1 -1
  27. package/dist/components/SortOrder/index.js +1 -2
  28. package/dist/components/SortOrder/index.js.map +1 -1
  29. package/dist/export/batchProcessor.d.ts +2 -2
  30. package/dist/export/batchProcessor.d.ts.map +1 -1
  31. package/dist/export/batchProcessor.js.map +1 -1
  32. package/dist/export/createExport.d.ts +2 -2
  33. package/dist/export/createExport.d.ts.map +1 -1
  34. package/dist/export/createExport.js +1 -1
  35. package/dist/export/createExport.js.map +1 -1
  36. package/dist/export/getCreateExportCollectionTask.d.ts.map +1 -1
  37. package/dist/export/getExportCollection.d.ts.map +1 -1
  38. package/dist/export/getExportCollection.js +4 -4
  39. package/dist/export/getExportCollection.js.map +1 -1
  40. package/dist/export/getFields.d.ts.map +1 -1
  41. package/dist/export/handleDownload.d.ts.map +1 -1
  42. package/dist/export/handleDownload.js +2 -2
  43. package/dist/export/handleDownload.js.map +1 -1
  44. package/dist/export/handlePreview.d.ts.map +1 -1
  45. package/dist/export/handlePreview.js +1 -1
  46. package/dist/export/handlePreview.js.map +1 -1
  47. package/dist/import/batchProcessor.d.ts +2 -2
  48. package/dist/import/batchProcessor.d.ts.map +1 -1
  49. package/dist/import/batchProcessor.js.map +1 -1
  50. package/dist/import/createImport.d.ts.map +1 -1
  51. package/dist/import/createImport.js.map +1 -1
  52. package/dist/import/getCreateImportCollectionTask.d.ts.map +1 -1
  53. package/dist/import/getFields.d.ts.map +1 -1
  54. package/dist/import/getImportCollection.d.ts.map +1 -1
  55. package/dist/import/getImportCollection.js +4 -4
  56. package/dist/import/getImportCollection.js.map +1 -1
  57. package/dist/import/handlePreview.d.ts.map +1 -1
  58. package/dist/index.d.ts +1 -2
  59. package/dist/index.d.ts.map +1 -1
  60. package/dist/index.js +6 -3
  61. package/dist/index.js.map +1 -1
  62. package/dist/translations/languages/en.d.ts.map +1 -1
  63. package/dist/utilities/applyFieldHooks.d.ts.map +1 -1
  64. package/dist/utilities/buildDisabledFieldRegex.d.ts.map +1 -1
  65. package/dist/utilities/collectDisabledFieldPaths.d.ts.map +1 -1
  66. package/dist/utilities/fieldToRegex.d.ts.map +1 -1
  67. package/dist/utilities/flattenObject.d.ts.map +1 -1
  68. package/dist/utilities/flattenedFields.d.ts.map +1 -1
  69. package/dist/utilities/getExportFieldFunctions.d.ts.map +1 -1
  70. package/dist/utilities/getFileFromDoc.d.ts.map +1 -1
  71. package/dist/utilities/getFileFromDoc.js +3 -3
  72. package/dist/utilities/getFileFromDoc.js.map +1 -1
  73. package/dist/utilities/getFlattenedFieldKeys.d.ts.map +1 -1
  74. package/dist/utilities/getImportFieldFunctions.d.ts.map +1 -1
  75. package/dist/utilities/getPluginCollections.d.ts.map +1 -1
  76. package/dist/utilities/getSchemaColumns.d.ts.map +1 -1
  77. package/dist/utilities/getSelect.d.ts.map +1 -1
  78. package/dist/utilities/getSelect.js +11 -3
  79. package/dist/utilities/getSelect.js.map +1 -1
  80. package/dist/utilities/isPlainObject.d.ts.map +1 -1
  81. package/dist/utilities/parseCSV.d.ts.map +1 -1
  82. package/dist/utilities/parseJSON.d.ts.map +1 -1
  83. package/dist/utilities/polymorphicRel.d.ts.map +1 -1
  84. package/dist/utilities/processRichTextField.d.ts.map +1 -1
  85. package/dist/utilities/removeDisabledFields.d.ts.map +1 -1
  86. package/dist/utilities/setNestedValue.d.ts +2 -1
  87. package/dist/utilities/setNestedValue.d.ts.map +1 -1
  88. package/dist/utilities/setNestedValue.js +65 -34
  89. package/dist/utilities/setNestedValue.js.map +1 -1
  90. package/dist/utilities/sortHelpers.d.ts +1 -1
  91. package/dist/utilities/sortHelpers.d.ts.map +1 -1
  92. package/dist/utilities/unflattenObject.d.ts.map +1 -1
  93. package/dist/utilities/unflattenPostProcess.d.ts.map +1 -1
  94. package/dist/utilities/validateLimitValue.d.ts.map +1 -1
  95. package/license.md +1 -1
  96. package/package.json +9 -9
  97. package/dist/@types/assets.d.js +0 -2
  98. package/dist/@types/assets.d.js.map +0 -1
  99. package/dist/components/ExportPreview/index.scss +0 -48
  100. package/dist/components/FieldsToExport/index.scss +0 -0
  101. package/dist/components/FieldsToExport/reduceFields.spec.js +0 -239
  102. package/dist/components/FieldsToExport/reduceFields.spec.js.map +0 -1
  103. package/dist/components/ImportPreview/index.scss +0 -41
  104. package/dist/components/SortBy/index.scss +0 -3
  105. package/dist/components/SortOrder/index.scss +0 -3
  106. package/dist/utilities/applyFieldHooks.spec.js +0 -205
  107. package/dist/utilities/applyFieldHooks.spec.js.map +0 -1
  108. package/dist/utilities/buildDisabledFieldRegex.spec.js +0 -64
  109. package/dist/utilities/buildDisabledFieldRegex.spec.js.map +0 -1
  110. package/dist/utilities/fieldToRegex.spec.js +0 -151
  111. package/dist/utilities/fieldToRegex.spec.js.map +0 -1
  112. package/dist/utilities/filterToSelectedFields.spec.js +0 -204
  113. package/dist/utilities/filterToSelectedFields.spec.js.map +0 -1
  114. package/dist/utilities/flattenObject.spec.js +0 -158
  115. package/dist/utilities/flattenObject.spec.js.map +0 -1
  116. package/dist/utilities/getExportFieldFunctions.spec.js +0 -50
  117. package/dist/utilities/getExportFieldFunctions.spec.js.map +0 -1
  118. package/dist/utilities/getImportFieldFunctions.spec.js +0 -167
  119. package/dist/utilities/getImportFieldFunctions.spec.js.map +0 -1
  120. package/dist/utilities/getSchemaColumns.spec.js +0 -157
  121. package/dist/utilities/getSchemaColumns.spec.js.map +0 -1
  122. package/dist/utilities/parseCSV.spec.js +0 -195
  123. package/dist/utilities/parseCSV.spec.js.map +0 -1
  124. package/dist/utilities/processRichTextField.spec.js +0 -308
  125. package/dist/utilities/processRichTextField.spec.js.map +0 -1
  126. package/dist/utilities/siblingDoc.spec.js +0 -278
  127. package/dist/utilities/siblingDoc.spec.js.map +0 -1
  128. package/dist/utilities/unflattenObject.spec.js +0 -819
  129. package/dist/utilities/unflattenObject.spec.js.map +0 -1
  130. /package/dist/components/Page/{index.scss → index.css} +0 -0
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { Config } from 'payload'\n\nimport { deepMergeSimple } from 'payload'\n\nimport type { PluginDefaultTranslationsObject } from './translations/types.js'\nimport type {\n ExportAfterHook,\n ExportBeforeHook,\n FieldBeforeExportHook,\n FieldBeforeImportHook,\n ImportAfterHook,\n ImportBeforeHook,\n ImportExportPluginConfig,\n Limit,\n PluginCollectionConfig,\n} from './types.js'\n\nimport { getCreateCollectionExportTask } from './export/getCreateExportCollectionTask.js'\nimport { getCreateCollectionImportTask } from './import/getCreateImportCollectionTask.js'\nimport { translations } from './translations/index.js'\nimport { collectDisabledFieldPaths } from './utilities/collectDisabledFieldPaths.js'\nimport { getPluginCollections } from './utilities/getPluginCollections.js'\n\n/**\n * Adds CSV/JSON import and export functionality to selected collections.\n *\n * Registers two upload collections (`exports`, `imports`) that drive the admin\n * UI flow, plus the `createCollectionExport` and `createCollectionImport` jobs\n * that run the work asynchronously. Per-collection settings (batch size, limits,\n * format, lifecycle hooks, override) live on each entry of `collections`.\n *\n * @see https://payloadcms.com/docs/plugins/import-export\n */\nexport const importExportPlugin =\n (pluginConfig: ImportExportPluginConfig) =>\n async (config: Config): Promise<Config> => {\n // Get all export/import collections and the mappings from target collections to custom collections\n const { customExportSlugMap, customImportSlugMap, exportCollections, importCollections } =\n await getPluginCollections({\n config,\n pluginConfig,\n })\n\n // Base collections are at index 0 (always present)\n const baseExportCollection = exportCollections[0]!\n const baseImportCollection = importCollections[0]!\n\n // Collect all export and import collection slugs for filtering\n const allExportSlugs = new Set(exportCollections.map((c) => c.slug))\n const allImportSlugs = new Set(importCollections.map((c) => c.slug))\n\n // Initialize collections array if needed\n if (!config.collections) {\n config.collections = []\n }\n\n // Push all export/import collections if their slugs don't already exist\n for (const collection of [...exportCollections, ...importCollections]) {\n const slugExists = config.collections.some((c) => c.slug === collection.slug)\n if (!slugExists) {\n config.collections.push(collection)\n }\n }\n\n // inject custom import export provider\n config.admin = config.admin || {}\n config.admin.components = config.admin.components || {}\n config.admin.components.providers = config.admin.components.providers || []\n config.admin.components.providers.push(\n '@payloadcms/plugin-import-export/rsc#ImportExportProvider',\n )\n\n // inject the createExport and createImport jobs into the config\n ;((config.jobs ??= {}).tasks ??= []).push(getCreateCollectionExportTask(config))\n config.jobs.tasks.push(getCreateCollectionImportTask(config))\n\n // Build a map of collection configs for quick lookup\n const collectionConfigMap = new Map<string, PluginCollectionConfig>()\n if (pluginConfig.collections) {\n for (const collectionConfig of pluginConfig.collections) {\n collectionConfigMap.set(collectionConfig.slug, collectionConfig)\n }\n }\n\n // Determine which collections to add import/export menu items to\n // Exclude all export and import collections\n const collectionsToUpdate = config.collections.filter(\n (c) => !allExportSlugs.has(c.slug) && !allImportSlugs.has(c.slug),\n )\n\n for (const collection of collectionsToUpdate) {\n // Get the plugin config for this collection (if specified)\n const collectionPluginConfig = collectionConfigMap.get(collection.slug)\n\n // If collections array is specified but this collection is not in it, skip\n if (\n pluginConfig.collections &&\n pluginConfig.collections.length > 0 &&\n !collectionPluginConfig\n ) {\n continue\n }\n\n // Determine which export/import collection to use for this collection\n const exportSlugForCollection =\n customExportSlugMap.get(collection.slug) || baseExportCollection.slug\n const importSlugForCollection =\n customImportSlugMap.get(collection.slug) || baseImportCollection.slug\n\n // Check if export/import are disabled for this collection\n const exportDisabled = collectionPluginConfig?.export === false\n const importDisabled = collectionPluginConfig?.import === false\n\n if (!collection.admin) {\n collection.admin = { components: { listMenuItems: [] } }\n }\n const components = collection.admin.components || {}\n if (!components.listMenuItems) {\n components.listMenuItems = []\n }\n\n // Add export menu item if not disabled\n if (!exportDisabled) {\n components.listMenuItems.push({\n clientProps: {\n collectionSlug: collection.slug,\n exportCollectionSlug: exportSlugForCollection,\n },\n path: '@payloadcms/plugin-import-export/rsc#ExportListMenuItem',\n })\n }\n\n // Add import menu item if not disabled\n if (!importDisabled) {\n components.listMenuItems.push({\n clientProps: {\n collectionSlug: collection.slug,\n importCollectionSlug: importSlugForCollection,\n },\n path: '@payloadcms/plugin-import-export/rsc#ImportListMenuItem',\n })\n }\n\n // Find fields explicitly marked as disabled for import/export\n const disabledFieldAccessors = collectDisabledFieldPaths(collection.fields)\n\n const exportConfig =\n typeof collectionPluginConfig?.export === 'object'\n ? collectionPluginConfig.export\n : undefined\n const exportFormat = exportConfig?.format\n const exportDisableJobsQueue = exportConfig?.disableJobsQueue\n const exportBatchSize = exportConfig?.batchSize\n const exportDisableSave = exportConfig?.disableSave\n const exportDisableDownload = exportConfig?.disableDownload\n\n const importConfig =\n typeof collectionPluginConfig?.import === 'object'\n ? collectionPluginConfig.import\n : undefined\n const importDisableJobsQueue = importConfig?.disableJobsQueue\n const importBatchSize = importConfig?.batchSize\n\n const exportLimit = exportConfig?.limit ?? pluginConfig.exportLimit\n const exportHooks = exportConfig?.hooks\n\n const importLimit = importConfig?.limit ?? pluginConfig.importLimit\n const importDefaultVersionStatus = importConfig?.defaultVersionStatus\n const importHooks = importConfig?.hooks\n\n collection.admin.custom = {\n ...(collection.admin.custom || {}),\n 'plugin-import-export': {\n ...(collection.admin.custom?.['plugin-import-export'] || {}),\n disabledFields: disabledFieldAccessors,\n ...(exportFormat !== undefined && { exportFormat }),\n ...(exportDisableSave !== undefined && { disableSave: exportDisableSave }),\n ...(exportDisableDownload !== undefined && { disableDownload: exportDisableDownload }),\n },\n }\n\n collection.custom = {\n ...(collection.custom || {}),\n 'plugin-import-export': {\n ...(collection.custom?.['plugin-import-export'] || {}),\n ...(exportLimit !== undefined && { exportLimit }),\n ...(exportDisableJobsQueue !== undefined && {\n exportDisableJobsQueue,\n }),\n ...(exportBatchSize !== undefined && { exportBatchSize }),\n ...(importLimit !== undefined && { importLimit }),\n ...(importDisableJobsQueue !== undefined && {\n importDisableJobsQueue,\n }),\n ...(importBatchSize !== undefined && { importBatchSize }),\n ...(importDefaultVersionStatus !== undefined && {\n defaultVersionStatus: importDefaultVersionStatus,\n }),\n ...(exportHooks !== undefined && { exportHooks }),\n ...(importHooks !== undefined && { importHooks }),\n },\n }\n\n collection.admin.components = components\n }\n\n if (!config.i18n) {\n config.i18n = {}\n }\n\n /**\n * Merge plugin translations — only for languages the user has enabled.\n * Plugins run before sanitize, so `supportedLanguages` may be undefined; sanitize will\n * default it to `{ en }`, so we mirror that here to avoid merging 30+ unused tables.\n */\n const supportedLanguageKeys = config.i18n?.supportedLanguages\n ? Object.keys(config.i18n.supportedLanguages)\n : ['en']\n\n const simplifiedTranslations: Record<string, PluginDefaultTranslationsObject> = {}\n for (const lang of supportedLanguageKeys) {\n const entry = translations[lang as keyof typeof translations]\n if (entry) {\n simplifiedTranslations[lang] = entry.translations\n }\n }\n\n config.i18n = {\n ...config.i18n,\n translations: deepMergeSimple(simplifiedTranslations, config.i18n?.translations ?? {}),\n }\n\n return config\n }\n\ndeclare module 'payload' {\n export interface FieldCustom {\n 'plugin-import-export'?: {\n /**\n * When `true` the field is **completely excluded** from the import-export plugin:\n * - It will not appear in the \"Fields to export\" selector.\n * - It is hidden from the preview list when no specific fields are chosen.\n * - Its data is omitted from the final CSV / JSON export.\n * @default false\n */\n disabled?: boolean\n /**\n * Field-level lifecycle hooks for import/export transformations.\n * Works for both CSV and JSON formats.\n */\n hooks?: {\n /**\n * Runs before a field value is exported. Return a transformed value,\n * `undefined` to use default behavior, or mutate `siblingData` to add\n * extra columns at the same level.\n */\n beforeExport?: FieldBeforeExportHook\n /**\n * Runs before a field value is imported. Return the transformed value.\n */\n beforeImport?: FieldBeforeImportHook\n }\n }\n }\n\n export interface CollectionAdminCustom {\n 'plugin-import-export'?: {\n /**\n * Array of collection slugs that this export/import collection can target.\n * Used by CollectionField to populate the dropdown options.\n */\n collectionSlugs?: string[]\n /**\n * Array of field paths that are disabled for import/export.\n * These paths are collected from fields marked with `custom['plugin-import-export'].disabled = true`.\n */\n disabledFields?: string[]\n /**\n * If true, disables the download button in the export preview UI.\n */\n disableDownload?: boolean\n /**\n * If true, disables the save button in the export preview UI.\n */\n disableSave?: boolean\n /**\n * When set, forces exports from this collection to use this format.\n * This value is read from the plugin config's `export.format` option.\n */\n exportFormat?: 'csv' | 'json'\n }\n }\n\n export interface CollectionCustom {\n /**\n * @internal\n * Server-side storage for resolved plugin config. Users should configure\n * import/export via `importExportPlugin({ collections: [{ slug, export: { ... }, import: { ... } }] })`.\n * These fields are populated automatically and are not part of the public\n * API — the names here intentionally diverge from the user-facing nested\n * `export.hooks` / `import.hooks` config and may change without notice.\n */\n 'plugin-import-export'?: {\n /**\n * @internal Default version status for imported documents when _status field is not provided.\n * Only applies to collections with versions enabled.\n * @default 'published'\n */\n defaultVersionStatus?: 'draft' | 'published'\n /**\n * Number of documents to process in each batch during export.\n * @default 100\n */\n exportBatchSize?: number\n /**\n * If true, disables the jobs queue for exports and runs them synchronously.\n * @default false\n */\n exportDisableJobsQueue?: boolean\n /**\n * Lifecycle hooks for export operations. Stored server-side since functions\n * cannot be serialized to the client.\n */\n exportHooks?: { after?: ExportAfterHook; before?: ExportBeforeHook }\n /**\n * Maximum number of documents that can be exported from this collection.\n * Set to 0 for unlimited (default). Can be a number or function.\n * Stored in collection.custom (server-only) since functions cannot be serialized to client.\n */\n exportLimit?: Limit\n /**\n * Number of documents to process in each batch during import.\n * @default 100\n */\n importBatchSize?: number\n /**\n * If true, disables the jobs queue for imports and runs them synchronously.\n * @default false\n */\n importDisableJobsQueue?: boolean\n /**\n * Lifecycle hooks for import operations. Stored server-side since functions\n * cannot be serialized to the client.\n */\n importHooks?: { after?: ImportAfterHook; before?: ImportBeforeHook }\n /**\n * Maximum number of documents that can be imported to this collection.\n * Set to 0 for unlimited (default). Can be a number or function.\n * Stored in collection.custom (server-only) since functions cannot be serialized to client.\n */\n importLimit?: Limit\n }\n }\n}\n"],"names":["deepMergeSimple","getCreateCollectionExportTask","getCreateCollectionImportTask","translations","collectDisabledFieldPaths","getPluginCollections","importExportPlugin","pluginConfig","config","customExportSlugMap","customImportSlugMap","exportCollections","importCollections","baseExportCollection","baseImportCollection","allExportSlugs","Set","map","c","slug","allImportSlugs","collections","collection","slugExists","some","push","admin","components","providers","jobs","tasks","collectionConfigMap","Map","collectionConfig","set","collectionsToUpdate","filter","has","collectionPluginConfig","get","length","exportSlugForCollection","importSlugForCollection","exportDisabled","export","importDisabled","import","listMenuItems","clientProps","collectionSlug","exportCollectionSlug","path","importCollectionSlug","disabledFieldAccessors","fields","exportConfig","undefined","exportFormat","format","exportDisableJobsQueue","disableJobsQueue","exportBatchSize","batchSize","exportDisableSave","disableSave","exportDisableDownload","disableDownload","importConfig","importDisableJobsQueue","importBatchSize","exportLimit","limit","exportHooks","hooks","importLimit","importDefaultVersionStatus","defaultVersionStatus","importHooks","custom","disabledFields","i18n","supportedLanguageKeys","supportedLanguages","Object","keys","simplifiedTranslations","lang","entry"],"mappings":"AAEA,SAASA,eAAe,QAAQ,UAAS;AAezC,SAASC,6BAA6B,QAAQ,4CAA2C;AACzF,SAASC,6BAA6B,QAAQ,4CAA2C;AACzF,SAASC,YAAY,QAAQ,0BAAyB;AACtD,SAASC,yBAAyB,QAAQ,2CAA0C;AACpF,SAASC,oBAAoB,QAAQ,sCAAqC;AAE1E;;;;;;;;;CASC,GACD,OAAO,MAAMC,qBACX,CAACC,eACD,OAAOC;QACL,mGAAmG;QACnG,MAAM,EAAEC,mBAAmB,EAAEC,mBAAmB,EAAEC,iBAAiB,EAAEC,iBAAiB,EAAE,GACtF,MAAMP,qBAAqB;YACzBG;YACAD;QACF;QAEF,mDAAmD;QACnD,MAAMM,uBAAuBF,iBAAiB,CAAC,EAAE;QACjD,MAAMG,uBAAuBF,iBAAiB,CAAC,EAAE;QAEjD,+DAA+D;QAC/D,MAAMG,iBAAiB,IAAIC,IAAIL,kBAAkBM,GAAG,CAAC,CAACC,IAAMA,EAAEC,IAAI;QAClE,MAAMC,iBAAiB,IAAIJ,IAAIJ,kBAAkBK,GAAG,CAAC,CAACC,IAAMA,EAAEC,IAAI;QAElE,yCAAyC;QACzC,IAAI,CAACX,OAAOa,WAAW,EAAE;YACvBb,OAAOa,WAAW,GAAG,EAAE;QACzB;QAEA,wEAAwE;QACxE,KAAK,MAAMC,cAAc;eAAIX;eAAsBC;SAAkB,CAAE;YACrE,MAAMW,aAAaf,OAAOa,WAAW,CAACG,IAAI,CAAC,CAACN,IAAMA,EAAEC,IAAI,KAAKG,WAAWH,IAAI;YAC5E,IAAI,CAACI,YAAY;gBACff,OAAOa,WAAW,CAACI,IAAI,CAACH;YAC1B;QACF;QAEA,uCAAuC;QACvCd,OAAOkB,KAAK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A;QAChC;QAEA,IAAI,CAACnB,OAAOwE,IAAI,EAAE;YAChBxE,OAAOwE,IAAI,GAAG,CAAC;QACjB;QAEA;;;;KAIC,GACD,MAAMC,wBAAwBzE,OAAOwE,IAAI,EAAEE,qBACvCC,OAAOC,IAAI,CAAC5E,OAAOwE,IAAI,CAACE,kBAAkB,IAC1C;YAAC;SAAK;QAEV,MAAMG,yBAA0E,CAAC;QACjF,KAAK,MAAMC,QAAQL,sBAAuB;YACxC,MAAMM,QAAQpF,YAAY,CAACmF,KAAkC;YAC7D,IAAIC,OAAO;gBACTF,sBAAsB,CAACC,KAAK,GAAGC,MAAMpF,YAAY;YACnD;QACF;QAEAK,OAAOwE,IAAI,GAAG;YACZ,GAAGxE,OAAOwE,IAAI;YACd7E,cAAcH,gBAAgBqF,wBAAwB7E,OAAOwE,IAAI,EAAE7E,gBAAgB,CAAC;QACtF;QAEA,OAAOK;IACT,EAAC"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { deepMergeSimple, definePlugin } from 'payload'\n\nimport type { PluginDefaultTranslationsObject } from './translations/types.js'\nimport type {\n ExportAfterHook,\n ExportBeforeHook,\n FieldBeforeExportHook,\n FieldBeforeImportHook,\n ImportAfterHook,\n ImportBeforeHook,\n ImportExportPluginConfig,\n Limit,\n PluginCollectionConfig,\n} from './types.js'\n\nimport { getCreateCollectionExportTask } from './export/getCreateExportCollectionTask.js'\nimport { getCreateCollectionImportTask } from './import/getCreateImportCollectionTask.js'\nimport { translations } from './translations/index.js'\nimport { collectDisabledFieldPaths } from './utilities/collectDisabledFieldPaths.js'\nimport { getPluginCollections } from './utilities/getPluginCollections.js'\n\n/**\n * Adds CSV/JSON import and export functionality to selected collections.\n *\n * Registers two upload collections (`exports`, `imports`) that drive the admin\n * UI flow, plus the `createCollectionExport` and `createCollectionImport` jobs\n * that run the work asynchronously. Per-collection settings (batch size, limits,\n * format, lifecycle hooks, override) live on each entry of `collections`.\n *\n * @see https://payloadcms.com/docs/plugins/import-export\n */\nexport const importExportPlugin = definePlugin<ImportExportPluginConfig>({\n slug: '@payloadcms/plugin-import-export',\n plugin: async ({ config, options: pluginConfig }) => {\n // Get all export/import collections and the mappings from target collections to custom collections\n const { customExportSlugMap, customImportSlugMap, exportCollections, importCollections } =\n await getPluginCollections({\n config,\n pluginConfig,\n })\n\n // Base collections are at index 0 (always present)\n const baseExportCollection = exportCollections[0]!\n const baseImportCollection = importCollections[0]!\n\n // Collect all export and import collection slugs for filtering\n const allExportSlugs = new Set(exportCollections.map((c) => c.slug))\n const allImportSlugs = new Set(importCollections.map((c) => c.slug))\n\n // Initialize collections array if needed\n if (!config.collections) {\n config.collections = []\n }\n\n // Push all export/import collections if their slugs don't already exist\n for (const collection of [...exportCollections, ...importCollections]) {\n const slugExists = config.collections.some((c) => c.slug === collection.slug)\n if (!slugExists) {\n config.collections.push(collection)\n }\n }\n\n // inject custom import export provider\n config.admin = config.admin || {}\n config.admin.components = config.admin.components || {}\n config.admin.components.providers = config.admin.components.providers || []\n config.admin.components.providers.push(\n '@payloadcms/plugin-import-export/rsc#ImportExportProvider',\n )\n\n // inject the createExport and createImport jobs into the config\n ;((config.jobs ??= {}).tasks ??= []).push(getCreateCollectionExportTask(config))\n config.jobs.tasks.push(getCreateCollectionImportTask(config))\n\n // Build a map of collection configs for quick lookup\n const collectionConfigMap = new Map<string, PluginCollectionConfig>()\n if (pluginConfig.collections) {\n for (const collectionConfig of pluginConfig.collections) {\n collectionConfigMap.set(collectionConfig.slug, collectionConfig)\n }\n }\n\n // Determine which collections to add import/export menu items to\n // Exclude all export and import collections\n const collectionsToUpdate = config.collections.filter(\n (c) => !allExportSlugs.has(c.slug) && !allImportSlugs.has(c.slug),\n )\n\n for (const collection of collectionsToUpdate) {\n // Get the plugin config for this collection (if specified)\n const collectionPluginConfig = collectionConfigMap.get(collection.slug)\n\n // If collections array is specified but this collection is not in it, skip\n if (\n pluginConfig.collections &&\n pluginConfig.collections.length > 0 &&\n !collectionPluginConfig\n ) {\n continue\n }\n\n // Determine which export/import collection to use for this collection\n const exportSlugForCollection =\n customExportSlugMap.get(collection.slug) || baseExportCollection.slug\n const importSlugForCollection =\n customImportSlugMap.get(collection.slug) || baseImportCollection.slug\n\n // Check if export/import are disabled for this collection\n const exportDisabled = collectionPluginConfig?.export === false\n const importDisabled = collectionPluginConfig?.import === false\n\n if (!collection.admin) {\n collection.admin = { components: { listMenuItems: [] } }\n }\n const components = collection.admin.components || {}\n if (!components.listMenuItems) {\n components.listMenuItems = []\n }\n\n // Add export menu item if not disabled\n if (!exportDisabled) {\n components.listMenuItems.push({\n clientProps: {\n collectionSlug: collection.slug,\n exportCollectionSlug: exportSlugForCollection,\n },\n path: '@payloadcms/plugin-import-export/rsc#ExportListMenuItem',\n })\n }\n\n // Add import menu item if not disabled\n if (!importDisabled) {\n components.listMenuItems.push({\n clientProps: {\n collectionSlug: collection.slug,\n importCollectionSlug: importSlugForCollection,\n },\n path: '@payloadcms/plugin-import-export/rsc#ImportListMenuItem',\n })\n }\n\n // Find fields explicitly marked as disabled for import/export\n const disabledFieldAccessors = collectDisabledFieldPaths(collection.fields)\n\n const exportConfig =\n typeof collectionPluginConfig?.export === 'object'\n ? collectionPluginConfig.export\n : undefined\n const exportFormat = exportConfig?.format\n const exportDisableJobsQueue = exportConfig?.disableJobsQueue\n const exportBatchSize = exportConfig?.batchSize\n const exportDisableSave = exportConfig?.disableSave\n const exportDisableDownload = exportConfig?.disableDownload\n\n const importConfig =\n typeof collectionPluginConfig?.import === 'object'\n ? collectionPluginConfig.import\n : undefined\n const importDisableJobsQueue = importConfig?.disableJobsQueue\n const importBatchSize = importConfig?.batchSize\n\n const exportLimit = exportConfig?.limit ?? pluginConfig.exportLimit\n const exportHooks = exportConfig?.hooks\n\n const importLimit = importConfig?.limit ?? pluginConfig.importLimit\n const importDefaultVersionStatus = importConfig?.defaultVersionStatus\n const importHooks = importConfig?.hooks\n\n collection.admin.custom = {\n ...(collection.admin.custom || {}),\n 'plugin-import-export': {\n ...(collection.admin.custom?.['plugin-import-export'] || {}),\n disabledFields: disabledFieldAccessors,\n ...(exportFormat !== undefined && { exportFormat }),\n ...(exportDisableSave !== undefined && { disableSave: exportDisableSave }),\n ...(exportDisableDownload !== undefined && { disableDownload: exportDisableDownload }),\n },\n }\n\n collection.custom = {\n ...(collection.custom || {}),\n 'plugin-import-export': {\n ...(collection.custom?.['plugin-import-export'] || {}),\n ...(exportLimit !== undefined && { exportLimit }),\n ...(exportDisableJobsQueue !== undefined && {\n exportDisableJobsQueue,\n }),\n ...(exportBatchSize !== undefined && { exportBatchSize }),\n ...(importLimit !== undefined && { importLimit }),\n ...(importDisableJobsQueue !== undefined && {\n importDisableJobsQueue,\n }),\n ...(importBatchSize !== undefined && { importBatchSize }),\n ...(importDefaultVersionStatus !== undefined && {\n defaultVersionStatus: importDefaultVersionStatus,\n }),\n ...(exportHooks !== undefined && { exportHooks }),\n ...(importHooks !== undefined && { importHooks }),\n },\n }\n\n collection.admin.components = components\n }\n\n if (!config.i18n) {\n config.i18n = {}\n }\n\n /**\n * Merge plugin translations — only for languages the user has enabled.\n * Plugins run before sanitize, so `supportedLanguages` may be undefined; sanitize will\n * default it to `{ en }`, so we mirror that here to avoid merging 30+ unused tables.\n */\n const supportedLanguageKeys = config.i18n?.supportedLanguages\n ? Object.keys(config.i18n.supportedLanguages)\n : ['en']\n\n const simplifiedTranslations: Record<string, PluginDefaultTranslationsObject> = {}\n for (const lang of supportedLanguageKeys) {\n const entry = translations[lang as keyof typeof translations]\n if (entry) {\n simplifiedTranslations[lang] = entry.translations\n }\n }\n\n config.i18n = {\n ...config.i18n,\n translations: deepMergeSimple(simplifiedTranslations, config.i18n?.translations ?? {}),\n }\n\n return config\n },\n})\n\ndeclare module 'payload' {\n export interface FieldCustom {\n 'plugin-import-export'?: {\n /**\n * When `true` the field is **completely excluded** from the import-export plugin:\n * - It will not appear in the \"Fields to export\" selector.\n * - It is hidden from the preview list when no specific fields are chosen.\n * - Its data is omitted from the final CSV / JSON export.\n * @default false\n */\n disabled?: boolean\n /**\n * Field-level lifecycle hooks for import/export transformations.\n * Works for both CSV and JSON formats.\n */\n hooks?: {\n /**\n * Runs before a field value is exported. Return a transformed value,\n * `undefined` to use default behavior, or mutate `siblingData` to add\n * extra columns at the same level.\n */\n beforeExport?: FieldBeforeExportHook\n /**\n * Runs before a field value is imported. Return the transformed value.\n */\n beforeImport?: FieldBeforeImportHook\n }\n }\n }\n\n export interface CollectionAdminCustom {\n 'plugin-import-export'?: {\n /**\n * Array of collection slugs that this export/import collection can target.\n * Used by CollectionField to populate the dropdown options.\n */\n collectionSlugs?: string[]\n /**\n * Array of field paths that are disabled for import/export.\n * These paths are collected from fields marked with `custom['plugin-import-export'].disabled = true`.\n */\n disabledFields?: string[]\n /**\n * If true, disables the download button in the export preview UI.\n */\n disableDownload?: boolean\n /**\n * If true, disables the save button in the export preview UI.\n */\n disableSave?: boolean\n /**\n * When set, forces exports from this collection to use this format.\n * This value is read from the plugin config's `export.format` option.\n */\n exportFormat?: 'csv' | 'json'\n }\n }\n\n export interface CollectionCustom {\n /**\n * @internal\n * Server-side storage for resolved plugin config. Users should configure\n * import/export via `importExportPlugin({ collections: [{ slug, export: { ... }, import: { ... } }] })`.\n * These fields are populated automatically and are not part of the public\n * API — the names here intentionally diverge from the user-facing nested\n * `export.hooks` / `import.hooks` config and may change without notice.\n */\n 'plugin-import-export'?: {\n /**\n * @internal Default version status for imported documents when _status field is not provided.\n * Only applies to collections with versions enabled.\n * @default 'published'\n */\n defaultVersionStatus?: 'draft' | 'published'\n /**\n * Number of documents to process in each batch during export.\n * @default 100\n */\n exportBatchSize?: number\n /**\n * If true, disables the jobs queue for exports and runs them synchronously.\n * @default false\n */\n exportDisableJobsQueue?: boolean\n /**\n * Lifecycle hooks for export operations. Stored server-side since functions\n * cannot be serialized to the client.\n */\n exportHooks?: { after?: ExportAfterHook; before?: ExportBeforeHook }\n /**\n * Maximum number of documents that can be exported from this collection.\n * Set to 0 for unlimited (default). Can be a number or function.\n * Stored in collection.custom (server-only) since functions cannot be serialized to client.\n */\n exportLimit?: Limit\n /**\n * Number of documents to process in each batch during import.\n * @default 100\n */\n importBatchSize?: number\n /**\n * If true, disables the jobs queue for imports and runs them synchronously.\n * @default false\n */\n importDisableJobsQueue?: boolean\n /**\n * Lifecycle hooks for import operations. Stored server-side since functions\n * cannot be serialized to the client.\n */\n importHooks?: { after?: ImportAfterHook; before?: ImportBeforeHook }\n /**\n * Maximum number of documents that can be imported to this collection.\n * Set to 0 for unlimited (default). Can be a number or function.\n * Stored in collection.custom (server-only) since functions cannot be serialized to client.\n */\n importLimit?: Limit\n }\n }\n}\n"],"names":["deepMergeSimple","definePlugin","getCreateCollectionExportTask","getCreateCollectionImportTask","translations","collectDisabledFieldPaths","getPluginCollections","importExportPlugin","slug","plugin","config","options","pluginConfig","customExportSlugMap","customImportSlugMap","exportCollections","importCollections","baseExportCollection","baseImportCollection","allExportSlugs","Set","map","c","allImportSlugs","collections","collection","slugExists","some","push","admin","components","providers","jobs","tasks","collectionConfigMap","Map","collectionConfig","set","collectionsToUpdate","filter","has","collectionPluginConfig","get","length","exportSlugForCollection","importSlugForCollection","exportDisabled","export","importDisabled","import","listMenuItems","clientProps","collectionSlug","exportCollectionSlug","path","importCollectionSlug","disabledFieldAccessors","fields","exportConfig","undefined","exportFormat","format","exportDisableJobsQueue","disableJobsQueue","exportBatchSize","batchSize","exportDisableSave","disableSave","exportDisableDownload","disableDownload","importConfig","importDisableJobsQueue","importBatchSize","exportLimit","limit","exportHooks","hooks","importLimit","importDefaultVersionStatus","defaultVersionStatus","importHooks","custom","disabledFields","i18n","supportedLanguageKeys","supportedLanguages","Object","keys","simplifiedTranslations","lang","entry"],"mappings":"AAAA,SAASA,eAAe,EAAEC,YAAY,QAAQ,UAAS;AAevD,SAASC,6BAA6B,QAAQ,4CAA2C;AACzF,SAASC,6BAA6B,QAAQ,4CAA2C;AACzF,SAASC,YAAY,QAAQ,0BAAyB;AACtD,SAASC,y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AK;QAEV,MAAMG,yBAA0E,CAAC;QACjF,KAAK,MAAMC,QAAQL,sBAAuB;YACxC,MAAMM,QAAQtF,YAAY,CAACqF,KAAkC;YAC7D,IAAIC,OAAO;gBACTF,sBAAsB,CAACC,KAAK,GAAGC,MAAMtF,YAAY;YACnD;QACF;QAEAM,OAAOyE,IAAI,GAAG;YACZ,GAAGzE,OAAOyE,IAAI;YACd/E,cAAcJ,gBAAgBwF,wBAAwB9E,OAAOyE,IAAI,EAAE/E,gBAAgB,CAAC;QACtF;QAEA,OAAOM;IACT;AACF,GAAE"}
@@ -1 +1 @@
1
- {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../src/translations/languages/en.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4C1B,CAAA;AAED,eAAO,MAAM,EAAE,EAAE,cAGhB,CAAA"}
1
+ {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../src/translations/languages/en.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,eAAO,MAAM,cAAc;IACzB,sBAAsB;QACpB,UAAU;QACV,kBAAkB;QAClB,iBAAiB;QACjB,iBAAiB;QACjB,mBAAmB;QACnB,aAAa;QACb,4BAA4B;QAC5B,mBAAmB;QACnB,oBAAoB;QACpB,oBAAoB;QACpB,oBAAoB;QACpB,+BAA+B;QAC/B,wBAAwB;QACxB,+BAA+B;QAC/B,+BAA+B;QAC/B,mBAAmB;QACnB,oBAAoB;QACpB,8BAA8B;QAC9B,wBAAwB;QACxB,kBAAkB;QAClB,kBAAkB;QAClB,4BAA4B;QAC5B,kBAAkB;QAClB,wBAAwB;QACxB,oBAAoB;QACpB,qBAAqB;QACrB,mBAAmB;QACnB,aAAa;QACb,WAAW;QACX,mBAAmB;QACnB,mBAAmB;QACnB,OAAO;QACP,IAAI;QACJ,eAAe;QACf,eAAe;QACf,6BAA6B;QAC7B,+BAA+B;QAC/B,iCAAiC;QACjC,WAAW;QACX,mBAAmB;QACnB,sBAAsB;;CAEzB,CAAA;AAED,eAAO,MAAM,EAAE,EAAE,cAGhB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"applyFieldHooks.d.ts","sourceRoot":"","sources":["../../src/utilities/applyFieldHooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAkB,cAAc,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7E,OAAO,KAAK,EACV,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,aAAa,CAAA;AAIpB,MAAM,MAAM,SAAS,GAAG,qBAAqB,GAAG,qBAAqB,CAAA;AAErE,MAAM,MAAM,cAAc,GAAG,oBAAoB,GAAG,oBAAoB,CAAA;AAKxE,MAAM,MAAM,IAAI,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;IAC1C,MAAM,EAAE,cAAc,EAAE,CAAA;IACxB,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,CAAC,EAAE,GAAG,MAAM,CAAC,CAAA;IACtC,SAAS,EAAE,QAAQ,GAAG,QAAQ,CAAA;IAC9B,GAAG,EAAE,cAAc,CAAA;IACnB,IAAI,EAAE,cAAc,GAAG,cAAc,CAAA;CACtC,CAAA;AA4HD;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,GAAI,MAAM,IAAI,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAYlE,CAAA"}
1
+ {"version":3,"file":"applyFieldHooks.d.ts","sourceRoot":"","sources":["../../src/utilities/applyFieldHooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAkB,cAAc,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7E,OAAO,KAAK,EACV,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,aAAa,CAAA;AAIpB,MAAM,MAAM,SAAS,GAAG,qBAAqB,GAAG,qBAAqB,CAAA;AAErE,MAAM,MAAM,cAAc,GAAG,oBAAoB,GAAG,oBAAoB,CAAA;AAKxE,MAAM,MAAM,IAAI,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;IAC1C,MAAM,EAAE,cAAc,EAAE,CAAA;IACxB,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,CAAC,EAAE,GAAG,MAAM,CAAC,CAAA;IACtC,SAAS,EAAE,QAAQ,GAAG,QAAQ,CAAA;IAC9B,GAAG,EAAE,cAAc,CAAA;IACnB,IAAI,EAAE,cAAc,GAAG,cAAc,CAAA;CACtC,CAAA;AA4HD;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,SAAU,IAAI,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAYlE,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"buildDisabledFieldRegex.d.ts","sourceRoot":"","sources":["../../src/utilities/buildDisabledFieldRegex.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,uBAAuB,GAAI,WAAW,MAAM,KAAG,MAyB3D,CAAA"}
1
+ {"version":3,"file":"buildDisabledFieldRegex.d.ts","sourceRoot":"","sources":["../../src/utilities/buildDisabledFieldRegex.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,uBAAuB,cAAe,MAAM,KAAG,MAyB3D,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"collectDisabledFieldPaths.d.ts","sourceRoot":"","sources":["../../src/utilities/collectDisabledFieldPaths.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAKpC;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,yBAAyB,GAAI,QAAQ,KAAK,EAAE,KAAG,MAAM,EAmEjE,CAAA"}
1
+ {"version":3,"file":"collectDisabledFieldPaths.d.ts","sourceRoot":"","sources":["../../src/utilities/collectDisabledFieldPaths.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAKpC;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,yBAAyB,WAAY,KAAK,EAAE,KAAG,MAAM,EAmEjE,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"fieldToRegex.d.ts","sourceRoot":"","sources":["../../src/utilities/fieldToRegex.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,YAAY,GAAI,WAAW,MAAM,KAAG,MAoBhD,CAAA"}
1
+ {"version":3,"file":"fieldToRegex.d.ts","sourceRoot":"","sources":["../../src/utilities/fieldToRegex.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,YAAY,cAAe,MAAM,KAAG,MAoBhD,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"flattenObject.d.ts","sourceRoot":"","sources":["../../src/utilities/flattenObject.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAMvD,KAAK,IAAI,GAAG;IACV,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAA;IACtD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,CAAC,EAAE,GAAG,MAAM,CAAC,CAAA;IACtC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,cAAc,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,wDAO3B,IAAI,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CA2K/B,CAAA"}
1
+ {"version":3,"file":"flattenObject.d.ts","sourceRoot":"","sources":["../../src/utilities/flattenObject.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAMvD,KAAK,IAAI,GAAG;IACV,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAA;IACtD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,CAAC,EAAE,GAAG,MAAM,CAAC,CAAA;IACtC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,cAAc,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,aAAa,2DAOvB,IAAI,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CA2K/B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"flattenedFields.d.ts","sourceRoot":"","sources":["../../src/utilities/flattenedFields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,GAAI,OAAO,cAAc,KAAG,cAAc,EAAE,GAAG,SACjB,CAAA;AAEnE;;GAEG;AACH,eAAO,MAAM,uBAAuB,GAAI,OAAO;IAC7C,eAAe,CAAC,EAAE,cAAc,EAAE,CAAA;CACnC,KAAG,cAAc,EAAiC,CAAA;AAEnD;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAI,MAAM,EACvC,QAAQ,cAAc,EAAE,EACxB,YAAY,MAAM,EAClB,QAAQ,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,iBAAiB,CAAC,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,KAChG,IA6BF,CAAA"}
1
+ {"version":3,"file":"flattenedFields.d.ts","sourceRoot":"","sources":["../../src/utilities/flattenedFields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,UAAW,cAAc,KAAG,cAAc,EAAE,GAAG,SACjB,CAAA;AAEnE;;GAEG;AACH,eAAO,MAAM,uBAAuB,UAAW;IAC7C,eAAe,CAAC,EAAE,cAAc,EAAE,CAAA;CACnC,KAAG,cAAc,EAAiC,CAAA;AAEnD;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAI,MAAM,UAC/B,cAAc,EAAE,cACZ,MAAM,UACV,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,mBACb,CAAC,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,KAChG,IA6BF,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"getExportFieldFunctions.d.ts","sourceRoot":"","sources":["../../src/utilities/getExportFieldFunctions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C,OAAO,KAAK,EAAE,oBAAoB,EAAyB,MAAM,aAAa,CAAA;AAK9E,KAAK,IAAI,GAAG;IACV,MAAM,EAAE,cAAc,EAAE,CAAA;CACzB,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,uBAAuB,GAAI,YAAY,IAAI,KAAG,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAI7F,CAAA"}
1
+ {"version":3,"file":"getExportFieldFunctions.d.ts","sourceRoot":"","sources":["../../src/utilities/getExportFieldFunctions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C,OAAO,KAAK,EAAE,oBAAoB,EAAyB,MAAM,aAAa,CAAA;AAK9E,KAAK,IAAI,GAAG;IACV,MAAM,EAAE,cAAc,EAAE,CAAA;CACzB,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,uBAAuB,eAAgB,IAAI,KAAG,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAI7F,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"getFileFromDoc.d.ts","sourceRoot":"","sources":["../../src/utilities/getFileFromDoc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAY,cAAc,EAAgB,MAAM,SAAS,CAAA;AAMvF,KAAK,IAAI,GAAG;IACV,gBAAgB,EAAE,gBAAgB,CAAA;IAClC,GAAG,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IAC1D,GAAG,EAAE,cAAc,CAAA;CACpB,CAAA;AAED,KAAK,MAAM,GAAG;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,GAAU,gCAAgC,IAAI,KAAG,OAAO,CAAC,MAAM,CAkEzF,CAAA"}
1
+ {"version":3,"file":"getFileFromDoc.d.ts","sourceRoot":"","sources":["../../src/utilities/getFileFromDoc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAY,cAAc,EAAgB,MAAM,SAAS,CAAA;AAMvF,KAAK,IAAI,GAAG;IACV,gBAAgB,EAAE,gBAAgB,CAAA;IAClC,GAAG,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IAC1D,GAAG,EAAE,cAAc,CAAA;CACpB,CAAA;AAED,KAAK,MAAM,GAAG;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,mCAA0C,IAAI,KAAG,OAAO,CAAC,MAAM,CAkEzF,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { FileRetrievalError, getFileByPath } from 'payload';
2
- import { getExternalFile } from 'payload/internal';
2
+ import { downloadFileToBuffer } from 'payload/internal';
3
3
  import { formatAdminURL } from 'payload/shared';
4
4
  /**
5
5
  * Retrieves file data from an uploaded document, handling both local storage
@@ -33,7 +33,7 @@ import { formatAdminURL } from 'payload/shared';
33
33
  }
34
34
  if (doc.filename && doc.url) {
35
35
  // Cloud storage or external - fetch via Payload's file endpoint
36
- // getExternalFile constructs full URL, includes cookies for auth, and
36
+ // downloadFileToBuffer constructs full URL, includes cookies for auth, and
37
37
  // the request goes through Payload's handler chain (including storage adapter)
38
38
  // For relative URLs, construct a full URL using formatAdminURL which properly
39
39
  // handles serverURL, basePath, and other config. This is important in job contexts
@@ -44,7 +44,7 @@ import { formatAdminURL } from 'payload/shared';
44
44
  path: doc.url,
45
45
  serverURL: serverURL || req.origin
46
46
  });
47
- const file = await getExternalFile({
47
+ const file = await downloadFileToBuffer({
48
48
  data: {
49
49
  filename: doc.filename,
50
50
  url: fileUrl
@@ -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;IAEjE,MAAMC,YAAYN,IAAIO,OAAO,CAACC,MAAM,CAACF,SAAS;IAC9C,MAAMG,cAAc,AAACH,aAAaP,IAAIW,GAAG,EAAEC,WAAWL,cAAeP,IAAIW,GAAG,EAAEC,WAAW;IAEzF,IAAI,CAACR,uBAAuBM,eAAeV,IAAIa,QAAQ,EAAE;QACvD,iFAAiF;QACjF,MAAMC,WAAW,GAAGT,UAAU,CAAC,EAAEL,IAAIa,QAAQ,EAAE;QAC/C,MAAME,OAAO,MAAMpB,cAAcmB;QAEjC,IAAI,CAACC,MAAM;YACT,MAAM,IAAIC,MAAM,CAAC,wBAAwB,EAAEF,UAAU;QACvD;QAEA,MAAMG,WAAWF,KAAKE,QAAQ,IAAIjB,IAAIkB,QAAQ;QAE9C,IAAI,CAACD,UAAU;YACb,MAAM,IAAIvB,mBAAmBO,IAAIkB,CAAC,EAAE,CAAC,uCAAuC,EAAEnB,IAAIa,QAAQ,EAAE;QAC9F;QAEA,OAAO;YACLO,MAAML,KAAKK,IAAI;YACfH;QACF;IACF;IAEA,IAAIjB,IAAIa,QAAQ,IAAIb,IAAIW,GAAG,EAAE;QAC3B,gEAAgE;QAChE,sEAAsE;QACtE,+EAA+E;QAE/E,8EAA8E;QAC9E,mFAAmF;QACnF,mEAAmE;QACnE,gFAAgF;QAChF,MAAMU,UAAUrB,IAAIW,GAAG,CAACC,UAAU,CAAC,UAC/BZ,IAAIW,GAAG,GACPd,eAAe;YACbyB,UAAU;YACVC,MAAMvB,IAAIW,GAAG;YACbJ,WAAWA,aAAaN,IAAIuB,MAAM;QACpC;QAEJ,MAAMT,OAAO,MAAMnB,gBAAgB;YACjCwB,MAAM;gBAAEP,UAAUb,IAAIa,QAAQ;gBAAEF,KAAKU;YAAQ;YAC7CpB;YACAC;QACF;QAEA,MAAMe,WAAWF,KAAKE,QAAQ,IAAIjB,IAAIkB,QAAQ;QAE9C,IAAI,CAACD,UAAU;YACb,MAAM,IAAIvB,mBAAmBO,IAAIkB,CAAC,EAAE,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 } 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","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;IAC9C,MAAMG,cAAc,AAACH,aAAaP,IAAIW,GAAG,EAAEC,WAAWL,cAAeP,IAAIW,GAAG,EAAEC,WAAW;IAEzF,IAAI,CAACR,uBAAuBM,eAAeV,IAAIa,QAAQ,EAAE;QACvD,iFAAiF;QACjF,MAAMC,WAAW,GAAGT,UAAU,CAAC,EAAEL,IAAIa,QAAQ,EAAE;QAC/C,MAAME,OAAO,MAAMpB,cAAcmB;QAEjC,IAAI,CAACC,MAAM;YACT,MAAM,IAAIC,MAAM,CAAC,wBAAwB,EAAEF,UAAU;QACvD;QAEA,MAAMG,WAAWF,KAAKE,QAAQ,IAAI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,EAAE,cAAc,EAAE,CAAA;QACxB,IAAI,CAAC,EAAE,MAAM,CAAA;KACd,EAAE,CAAA;IACH,IAAI,EAAE,aAAa,GAAG,KAAK,GAAG,MAAM,CAAA;CACrC,GACD,cAAc,CAAA;AAElB,MAAM,MAAM,4BAA4B,GAAG;IACzC;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;CACvB,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,qBAAqB,GAChC,QAAQ,uBAAuB,EAAE,EACjC,eAAW,EACX,UAAS,4BAAiC,KACzC,MAAM,EAuGR,CAAA"}
1
+ {"version":3,"file":"getFlattenedFieldKeys.d.ts","sourceRoot":"","sources":["../../src/utilities/getFlattenedFieldKeys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C,KAAK,uBAAuB,GACxB;IACE,MAAM,CAAC,EAAE,cAAc,EAAE,CAAA;IACzB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE;QACL,MAAM,EAAE,cAAc,EAAE,CAAA;QACxB,IAAI,CAAC,EAAE,MAAM,CAAA;KACd,EAAE,CAAA;IACH,IAAI,EAAE,aAAa,GAAG,KAAK,GAAG,MAAM,CAAA;CACrC,GACD,cAAc,CAAA;AAElB,MAAM,MAAM,4BAA4B,GAAG;IACzC;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;CACvB,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,qBAAqB,WACxB,uBAAuB,EAAE,6BAExB,4BAA4B,KACpC,MAAM,EAuGR,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"getImportFieldFunctions.d.ts","sourceRoot":"","sources":["../../src/utilities/getImportFieldFunctions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C,OAAO,KAAK,EAAyB,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAI9E,KAAK,IAAI,GAAG;IACV,MAAM,EAAE,cAAc,EAAE,CAAA;CACzB,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,uBAAuB,GAAI,YAAY,IAAI,KAAG,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAI7F,CAAA"}
1
+ {"version":3,"file":"getImportFieldFunctions.d.ts","sourceRoot":"","sources":["../../src/utilities/getImportFieldFunctions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C,OAAO,KAAK,EAAyB,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAI9E,KAAK,IAAI,GAAG;IACV,MAAM,EAAE,cAAc,EAAE,CAAA;CACzB,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,uBAAuB,eAAgB,IAAI,KAAG,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAI7F,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"getPluginCollections.d.ts","sourceRoot":"","sources":["../../src/utilities/getPluginCollections.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAEvD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AAK3D,MAAM,MAAM,uBAAuB,GAAG;IACpC;;;OAGG;IACH,mBAAmB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACxC;;;OAGG;IACH,mBAAmB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACxC;;OAEG;IACH,iBAAiB,EAAE,gBAAgB,EAAE,CAAA;IACrC;;OAEG;IACH,iBAAiB,EAAE,gBAAgB,EAAE,CAAA;CACtC,CAAA;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,oBAAoB,GAAU,2BAGxC;IACD,MAAM,EAAE,MAAM,CAAA;IACd,YAAY,EAAE,wBAAwB,CAAA;CACvC,KAAG,OAAO,CAAC,uBAAuB,CAyLlC,CAAA"}
1
+ {"version":3,"file":"getPluginCollections.d.ts","sourceRoot":"","sources":["../../src/utilities/getPluginCollections.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAEvD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AAK3D,MAAM,MAAM,uBAAuB,GAAG;IACpC;;;OAGG;IACH,mBAAmB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACxC;;;OAGG;IACH,mBAAmB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACxC;;OAEG;IACH,iBAAiB,EAAE,gBAAgB,EAAE,CAAA;IACrC;;OAEG;IACH,iBAAiB,EAAE,gBAAgB,EAAE,CAAA;CACtC,CAAA;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,oBAAoB,8BAG9B;IACD,MAAM,EAAE,MAAM,CAAA;IACd,YAAY,EAAE,wBAAwB,CAAA;CACvC,KAAG,OAAO,CAAC,uBAAuB,CAyLlC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"getSchemaColumns.d.ts","sourceRoot":"","sources":["../../src/utilities/getSchemaColumns.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAA;AAIxD,MAAM,MAAM,oBAAoB,GAAG;IACjC;;OAEG;IACH,gBAAgB,EAAE,yBAAyB,CAAA;IAC3C;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;IACzB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB;;OAEG;IACH,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM,CAAA;IACtB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;CACvB,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB,GAAI,oFAM9B,oBAAoB,KAAG,MAAM,EAmC/B,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,GAAI,eAAe,MAAM,EAAE,EAAE,aAAa,MAAM,EAAE,KAAG,MAAM,EAqEnF,CAAA;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAmC5F"}
1
+ {"version":3,"file":"getSchemaColumns.d.ts","sourceRoot":"","sources":["../../src/utilities/getSchemaColumns.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAA;AAIxD,MAAM,MAAM,oBAAoB,GAAG;IACjC;;OAEG;IACH,gBAAgB,EAAE,yBAAyB,CAAA;IAC3C;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;IACzB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB;;OAEG;IACH,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM,CAAA;IACtB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;CACvB,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB,uFAM1B,oBAAoB,KAAG,MAAM,EAmC/B,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,kBAAmB,MAAM,EAAE,eAAe,MAAM,EAAE,KAAG,MAAM,EAqEnF,CAAA;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAmC5F"}
@@ -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,GAAI,QAAQ,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"}
@@ -1 +1 @@
1
- {"version":3,"file":"isPlainObject.d.ts","sourceRoot":"","sources":["../../src/utilities/isPlainObject.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CACR,CAAA"}
1
+ {"version":3,"file":"isPlainObject.d.ts","sourceRoot":"","sources":["../../src/utilities/isPlainObject.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,UAAW,OAAO,KAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CACR,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"parseCSV.d.ts","sourceRoot":"","sources":["../../src/utilities/parseCSV.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAI7C,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;IACrB,GAAG,EAAE,cAAc,CAAA;CACpB,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,QAAQ,GAAU,eAAe,YAAY,KAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CA8D7F,CAAA"}
1
+ {"version":3,"file":"parseCSV.d.ts","sourceRoot":"","sources":["../../src/utilities/parseCSV.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAI7C,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;IACrB,GAAG,EAAE,cAAc,CAAA;CACpB,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,QAAQ,kBAAyB,YAAY,KAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CA8D7F,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"parseJSON.d.ts","sourceRoot":"","sources":["../../src/utilities/parseJSON.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAI7C,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;IACrB,GAAG,EAAE,cAAc,CAAA;CACpB,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,SAAS,GAAI,eAAe,aAAa,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAiB/E,CAAA"}
1
+ {"version":3,"file":"parseJSON.d.ts","sourceRoot":"","sources":["../../src/utilities/parseJSON.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAI7C,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;IACrB,GAAG,EAAE,cAAc,CAAA;CACpB,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,SAAS,kBAAmB,aAAa,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAiB/E,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"polymorphicRel.d.ts","sourceRoot":"","sources":["../../src/utilities/polymorphicRel.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG;IAChC,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE;QAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,MAAM,GAAG,MAAM,CAAA;CACjD,CAAA;AAED,eAAO,MAAM,qBAAqB,GAAI,GAAG,OAAO,KAAG,CAAC,IAAI,mBACkB,CAAA;AAE1E;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,GAAG,mBAAmB,KAAG,MAAM,GAAG,MAAM,GAAG,SAS9E,CAAA"}
1
+ {"version":3,"file":"polymorphicRel.d.ts","sourceRoot":"","sources":["../../src/utilities/polymorphicRel.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG;IAChC,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE;QAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,MAAM,GAAG,MAAM,CAAA;CACjD,CAAA;AAED,eAAO,MAAM,qBAAqB,MAAO,OAAO,KAAG,CAAC,IAAI,mBACkB,CAAA;AAE1E;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,MAAO,mBAAmB,KAAG,MAAM,GAAG,MAAM,GAAG,SAS9E,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"processRichTextField.d.ts","sourceRoot":"","sources":["../../src/utilities/processRichTextField.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,oBAAoB,GAAI,OAAO,OAAO,KAAG,OAoDrD,CAAA"}
1
+ {"version":3,"file":"processRichTextField.d.ts","sourceRoot":"","sources":["../../src/utilities/processRichTextField.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,oBAAoB,UAAW,OAAO,KAAG,OAoDrD,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"removeDisabledFields.d.ts","sourceRoot":"","sources":["../../src/utilities/removeDisabledFields.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,eAAO,MAAM,oBAAoB,GAC/B,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5B,WAAU,MAAM,EAAO,KACtB,MAAM,CAAC,MAAM,EAAE,OAAO,CA8DxB,CAAA"}
1
+ {"version":3,"file":"removeDisabledFields.d.ts","sourceRoot":"","sources":["../../src/utilities/removeDisabledFields.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,eAAO,MAAM,oBAAoB,QAC1B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,aAClB,MAAM,EAAE,KACjB,MAAM,CAAC,MAAM,EAAE,OAAO,CA8DxB,CAAA"}
@@ -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,GACzB,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5B,MAAM,MAAM,EACZ,OAAO,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,I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AAMmB,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"}
@@ -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: "asc" | "desc") => string;
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,GAAI,IAAI,IAAI,GAAG,MAAM,KAAG,MAAwC,CAAA;AAE1F,iEAAiE;AACjE,eAAO,MAAM,cAAc,GAAI,OAAO,MAAM,EAAE,OAAO,KAAK,GAAG,MAAM,KAAG,MAC9B,CAAA;AAGxC,eAAO,MAAM,mBAAmB,GAAI,GAAG,OAAO,KAAG,MAAM,GAAG,SAQzD,CAAA"}
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,GAAI,kDAM7B,aAAa,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAyUxC,CAAA"}
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,GAC9B,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5B,QAAQ,cAAc,EAAE,KACvB,IAMF,CAAA"}
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,GAC7B,OAAO,IAAI,GAAG,MAAM,GAAG,SAAS,EAChC,GAAG,SAAS,KACX,MAAM,GAAG,SAMX,CAAA"}
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-2024 Payload CMS, Inc. <info@payloadcms.com>
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.688c4d0",
3
+ "version": "4.0.0-internal.77191e5",
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.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.688c4d0",
68
- "@payloadcms/ui": "4.0.0-internal.688c4d0"
67
+ "@payloadcms/translations": "4.0.0-internal.77191e5",
68
+ "@payloadcms/ui": "4.0.0-internal.77191e5"
69
69
  },
70
70
  "devDependencies": {
71
71
  "@payloadcms/eslint-config": "3.28.0",
72
- "payload": "4.0.0-internal.688c4d0",
73
- "@payloadcms/ui": "4.0.0-internal.688c4d0"
72
+ "payload": "4.0.0-internal.77191e5",
73
+ "@payloadcms/ui": "4.0.0-internal.77191e5"
74
74
  },
75
75
  "peerDependencies": {
76
- "payload": "4.0.0-internal.688c4d0",
77
- "@payloadcms/ui": "4.0.0-internal.688c4d0"
76
+ "payload": "4.0.0-internal.77191e5",
77
+ "@payloadcms/ui": "4.0.0-internal.77191e5"
78
78
  },
79
79
  "homepage:": "https://payloadcms.com",
80
80
  "scripts": {
@@ -83,7 +83,7 @@
83
83
  "build:swc": "swc ./src -d ./dist --config-file .swcrc --strip-leading-paths",
84
84
  "build:types": "tsc --emitDeclarationOnly --outDir dist",
85
85
  "clean": "rimraf {dist,*.tsbuildinfo}",
86
- "copyfiles": "copyfiles -u 1 \"src/**/*.{html,css,scss,ttf,woff,woff2,eot,svg,jpg,png,json}\" dist/",
86
+ "copyfiles": "copyfiles -u 1 -e \"**/*.spec.*\" \"src/**/*.{html,css,scss,ttf,woff,woff2,eot,svg,jpg,png,json}\" dist/",
87
87
  "lint": "eslint .",
88
88
  "lint:fix": "eslint . --fix"
89
89
  }
@@ -1,2 +0,0 @@
1
-
2
- //# sourceMappingURL=assets.d.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/@types/assets.d.ts"],"names":[],"mappings":""}