@ruya.sa/plugin-import-export 3.71.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/dist/components/CollectionField/index.d.ts +3 -0
- package/dist/components/CollectionField/index.d.ts.map +1 -0
- package/dist/components/CollectionField/index.js +29 -0
- package/dist/components/CollectionField/index.js.map +1 -0
- package/dist/components/ExportListMenuItem/index.d.ts +6 -0
- package/dist/components/ExportListMenuItem/index.d.ts.map +1 -0
- package/dist/components/ExportListMenuItem/index.js +44 -0
- package/dist/components/ExportListMenuItem/index.js.map +1 -0
- package/dist/components/ExportPreview/index.d.ts +4 -0
- package/dist/components/ExportPreview/index.d.ts.map +1 -0
- package/dist/components/ExportPreview/index.js +252 -0
- package/dist/components/ExportPreview/index.js.map +1 -0
- package/dist/components/ExportPreview/index.scss +36 -0
- package/dist/components/ExportSaveButton/index.d.ts +3 -0
- package/dist/components/ExportSaveButton/index.d.ts.map +1 -0
- package/dist/components/ExportSaveButton/index.js +110 -0
- package/dist/components/ExportSaveButton/index.js.map +1 -0
- package/dist/components/FieldsToExport/index.d.ts +3 -0
- package/dist/components/FieldsToExport/index.d.ts.map +1 -0
- package/dist/components/FieldsToExport/index.js +87 -0
- package/dist/components/FieldsToExport/index.js.map +1 -0
- package/dist/components/FieldsToExport/index.scss +0 -0
- package/dist/components/FieldsToExport/reduceFields.d.ts +13 -0
- package/dist/components/FieldsToExport/reduceFields.d.ts.map +1 -0
- package/dist/components/FieldsToExport/reduceFields.js +109 -0
- package/dist/components/FieldsToExport/reduceFields.js.map +1 -0
- package/dist/components/ImportCollectionField/index.d.ts +3 -0
- package/dist/components/ImportCollectionField/index.d.ts.map +1 -0
- package/dist/components/ImportCollectionField/index.js +17 -0
- package/dist/components/ImportCollectionField/index.js.map +1 -0
- package/dist/components/ImportExportProvider/index.d.ts +12 -0
- package/dist/components/ImportExportProvider/index.d.ts.map +1 -0
- package/dist/components/ImportExportProvider/index.js +20 -0
- package/dist/components/ImportExportProvider/index.js.map +1 -0
- package/dist/components/ImportListMenuItem/index.d.ts +6 -0
- package/dist/components/ImportListMenuItem/index.d.ts.map +1 -0
- package/dist/components/ImportListMenuItem/index.js +48 -0
- package/dist/components/ImportListMenuItem/index.js.map +1 -0
- package/dist/components/ImportPreview/index.d.ts +4 -0
- package/dist/components/ImportPreview/index.d.ts.map +1 -0
- package/dist/components/ImportPreview/index.js +624 -0
- package/dist/components/ImportPreview/index.js.map +1 -0
- package/dist/components/ImportPreview/index.scss +41 -0
- package/dist/components/ImportSaveButton/index.d.ts +2 -0
- package/dist/components/ImportSaveButton/index.d.ts.map +1 -0
- package/dist/components/ImportSaveButton/index.js +18 -0
- package/dist/components/ImportSaveButton/index.js.map +1 -0
- package/dist/components/Page/index.d.ts +4 -0
- package/dist/components/Page/index.d.ts.map +1 -0
- package/dist/components/Page/index.js +40 -0
- package/dist/components/Page/index.js.map +1 -0
- package/dist/components/Page/index.scss +5 -0
- package/dist/components/SelectionToUseField/index.d.ts +3 -0
- package/dist/components/SelectionToUseField/index.d.ts.map +1 -0
- package/dist/components/SelectionToUseField/index.js +128 -0
- package/dist/components/SelectionToUseField/index.js.map +1 -0
- package/dist/components/SortBy/index.d.ts +4 -0
- package/dist/components/SortBy/index.d.ts.map +1 -0
- package/dist/components/SortBy/index.js +133 -0
- package/dist/components/SortBy/index.js.map +1 -0
- package/dist/components/SortBy/index.scss +3 -0
- package/dist/components/SortOrder/index.d.ts +4 -0
- package/dist/components/SortOrder/index.d.ts.map +1 -0
- package/dist/components/SortOrder/index.js +121 -0
- package/dist/components/SortOrder/index.js.map +1 -0
- package/dist/components/SortOrder/index.scss +3 -0
- package/dist/constants.d.ts +21 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +21 -0
- package/dist/constants.js.map +1 -0
- package/dist/export/batchProcessor.d.ts +107 -0
- package/dist/export/batchProcessor.d.ts.map +1 -0
- package/dist/export/batchProcessor.js +187 -0
- package/dist/export/batchProcessor.js.map +1 -0
- package/dist/export/createExport.d.ts +37 -0
- package/dist/export/createExport.d.ts.map +1 -0
- package/dist/export/createExport.js +385 -0
- package/dist/export/createExport.js.map +1 -0
- package/dist/export/getCreateExportCollectionTask.d.ts +16 -0
- package/dist/export/getCreateExportCollectionTask.d.ts.map +1 -0
- package/dist/export/getCreateExportCollectionTask.js +35 -0
- package/dist/export/getCreateExportCollectionTask.js.map +1 -0
- package/dist/export/getExportCollection.d.ts +8 -0
- package/dist/export/getExportCollection.d.ts.map +1 -0
- package/dist/export/getExportCollection.js +100 -0
- package/dist/export/getExportCollection.js.map +1 -0
- package/dist/export/getFields.d.ts +10 -0
- package/dist/export/getFields.d.ts.map +1 -0
- package/dist/export/getFields.js +244 -0
- package/dist/export/getFields.js.map +1 -0
- package/dist/export/handleDownload.d.ts +3 -0
- package/dist/export/handleDownload.d.ts.map +1 -0
- package/dist/export/handleDownload.js +42 -0
- package/dist/export/handleDownload.js.map +1 -0
- package/dist/export/handlePreview.d.ts +3 -0
- package/dist/export/handlePreview.d.ts.map +1 -0
- package/dist/export/handlePreview.js +163 -0
- package/dist/export/handlePreview.js.map +1 -0
- package/dist/exports/rsc.d.ts +15 -0
- package/dist/exports/rsc.d.ts.map +1 -0
- package/dist/exports/rsc.js +16 -0
- package/dist/exports/rsc.js.map +1 -0
- package/dist/exports/types.d.ts +2 -0
- package/dist/exports/types.d.ts.map +1 -0
- package/dist/exports/types.js +3 -0
- package/dist/exports/types.js.map +1 -0
- package/dist/import/batchProcessor.d.ts +46 -0
- package/dist/import/batchProcessor.d.ts.map +1 -0
- package/dist/import/batchProcessor.js +529 -0
- package/dist/import/batchProcessor.js.map +1 -0
- package/dist/import/createImport.d.ts +45 -0
- package/dist/import/createImport.d.ts.map +1 -0
- package/dist/import/createImport.js +175 -0
- package/dist/import/createImport.js.map +1 -0
- package/dist/import/getCreateImportCollectionTask.d.ts +13 -0
- package/dist/import/getCreateImportCollectionTask.d.ts.map +1 -0
- package/dist/import/getCreateImportCollectionTask.js +81 -0
- package/dist/import/getCreateImportCollectionTask.js.map +1 -0
- package/dist/import/getFields.d.ts +7 -0
- package/dist/import/getFields.d.ts.map +1 -0
- package/dist/import/getFields.js +150 -0
- package/dist/import/getFields.js.map +1 -0
- package/dist/import/getImportCollection.d.ts +8 -0
- package/dist/import/getImportCollection.d.ts.map +1 -0
- package/dist/import/getImportCollection.js +258 -0
- package/dist/import/getImportCollection.js.map +1 -0
- package/dist/import/handlePreview.d.ts +3 -0
- package/dist/import/handlePreview.d.ts.map +1 -0
- package/dist/import/handlePreview.js +94 -0
- package/dist/import/handlePreview.js.map +1 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +120 -0
- package/dist/index.js.map +1 -0
- package/dist/translations/index.d.ts +6 -0
- package/dist/translations/index.d.ts.map +1 -0
- package/dist/translations/index.js +84 -0
- package/dist/translations/index.js.map +1 -0
- package/dist/translations/languages/ar.d.ts +4 -0
- package/dist/translations/languages/ar.d.ts.map +1 -0
- package/dist/translations/languages/ar.js +48 -0
- package/dist/translations/languages/ar.js.map +1 -0
- package/dist/translations/languages/az.d.ts +4 -0
- package/dist/translations/languages/az.d.ts.map +1 -0
- package/dist/translations/languages/az.js +48 -0
- package/dist/translations/languages/az.js.map +1 -0
- package/dist/translations/languages/bg.d.ts +4 -0
- package/dist/translations/languages/bg.d.ts.map +1 -0
- package/dist/translations/languages/bg.js +48 -0
- package/dist/translations/languages/bg.js.map +1 -0
- package/dist/translations/languages/bnBd.d.ts +4 -0
- package/dist/translations/languages/bnBd.d.ts.map +1 -0
- package/dist/translations/languages/bnBd.js +48 -0
- package/dist/translations/languages/bnBd.js.map +1 -0
- package/dist/translations/languages/bnIn.d.ts +4 -0
- package/dist/translations/languages/bnIn.d.ts.map +1 -0
- package/dist/translations/languages/bnIn.js +48 -0
- package/dist/translations/languages/bnIn.js.map +1 -0
- package/dist/translations/languages/ca.d.ts +4 -0
- package/dist/translations/languages/ca.d.ts.map +1 -0
- package/dist/translations/languages/ca.js +48 -0
- package/dist/translations/languages/ca.js.map +1 -0
- package/dist/translations/languages/cs.d.ts +4 -0
- package/dist/translations/languages/cs.d.ts.map +1 -0
- package/dist/translations/languages/cs.js +48 -0
- package/dist/translations/languages/cs.js.map +1 -0
- package/dist/translations/languages/da.d.ts +4 -0
- package/dist/translations/languages/da.d.ts.map +1 -0
- package/dist/translations/languages/da.js +48 -0
- package/dist/translations/languages/da.js.map +1 -0
- package/dist/translations/languages/de.d.ts +4 -0
- package/dist/translations/languages/de.d.ts.map +1 -0
- package/dist/translations/languages/de.js +48 -0
- package/dist/translations/languages/de.js.map +1 -0
- package/dist/translations/languages/en.d.ts +45 -0
- package/dist/translations/languages/en.d.ts.map +1 -0
- package/dist/translations/languages/en.js +48 -0
- package/dist/translations/languages/en.js.map +1 -0
- package/dist/translations/languages/es.d.ts +4 -0
- package/dist/translations/languages/es.d.ts.map +1 -0
- package/dist/translations/languages/es.js +48 -0
- package/dist/translations/languages/es.js.map +1 -0
- package/dist/translations/languages/et.d.ts +4 -0
- package/dist/translations/languages/et.d.ts.map +1 -0
- package/dist/translations/languages/et.js +48 -0
- package/dist/translations/languages/et.js.map +1 -0
- package/dist/translations/languages/fa.d.ts +4 -0
- package/dist/translations/languages/fa.d.ts.map +1 -0
- package/dist/translations/languages/fa.js +48 -0
- package/dist/translations/languages/fa.js.map +1 -0
- package/dist/translations/languages/fr.d.ts +4 -0
- package/dist/translations/languages/fr.d.ts.map +1 -0
- package/dist/translations/languages/fr.js +48 -0
- package/dist/translations/languages/fr.js.map +1 -0
- package/dist/translations/languages/he.d.ts +4 -0
- package/dist/translations/languages/he.d.ts.map +1 -0
- package/dist/translations/languages/he.js +48 -0
- package/dist/translations/languages/he.js.map +1 -0
- package/dist/translations/languages/hr.d.ts +4 -0
- package/dist/translations/languages/hr.d.ts.map +1 -0
- package/dist/translations/languages/hr.js +48 -0
- package/dist/translations/languages/hr.js.map +1 -0
- package/dist/translations/languages/hu.d.ts +4 -0
- package/dist/translations/languages/hu.d.ts.map +1 -0
- package/dist/translations/languages/hu.js +48 -0
- package/dist/translations/languages/hu.js.map +1 -0
- package/dist/translations/languages/hy.d.ts +4 -0
- package/dist/translations/languages/hy.d.ts.map +1 -0
- package/dist/translations/languages/hy.js +48 -0
- package/dist/translations/languages/hy.js.map +1 -0
- package/dist/translations/languages/id.d.ts +4 -0
- package/dist/translations/languages/id.d.ts.map +1 -0
- package/dist/translations/languages/id.js +48 -0
- package/dist/translations/languages/id.js.map +1 -0
- package/dist/translations/languages/is.d.ts +4 -0
- package/dist/translations/languages/is.d.ts.map +1 -0
- package/dist/translations/languages/is.js +48 -0
- package/dist/translations/languages/is.js.map +1 -0
- package/dist/translations/languages/it.d.ts +4 -0
- package/dist/translations/languages/it.d.ts.map +1 -0
- package/dist/translations/languages/it.js +48 -0
- package/dist/translations/languages/it.js.map +1 -0
- package/dist/translations/languages/ja.d.ts +4 -0
- package/dist/translations/languages/ja.d.ts.map +1 -0
- package/dist/translations/languages/ja.js +48 -0
- package/dist/translations/languages/ja.js.map +1 -0
- package/dist/translations/languages/ko.d.ts +4 -0
- package/dist/translations/languages/ko.d.ts.map +1 -0
- package/dist/translations/languages/ko.js +48 -0
- package/dist/translations/languages/ko.js.map +1 -0
- package/dist/translations/languages/lt.d.ts +4 -0
- package/dist/translations/languages/lt.d.ts.map +1 -0
- package/dist/translations/languages/lt.js +48 -0
- package/dist/translations/languages/lt.js.map +1 -0
- package/dist/translations/languages/lv.d.ts +4 -0
- package/dist/translations/languages/lv.d.ts.map +1 -0
- package/dist/translations/languages/lv.js +48 -0
- package/dist/translations/languages/lv.js.map +1 -0
- package/dist/translations/languages/my.d.ts +4 -0
- package/dist/translations/languages/my.d.ts.map +1 -0
- package/dist/translations/languages/my.js +48 -0
- package/dist/translations/languages/my.js.map +1 -0
- package/dist/translations/languages/nb.d.ts +4 -0
- package/dist/translations/languages/nb.d.ts.map +1 -0
- package/dist/translations/languages/nb.js +48 -0
- package/dist/translations/languages/nb.js.map +1 -0
- package/dist/translations/languages/nl.d.ts +4 -0
- package/dist/translations/languages/nl.d.ts.map +1 -0
- package/dist/translations/languages/nl.js +48 -0
- package/dist/translations/languages/nl.js.map +1 -0
- package/dist/translations/languages/pl.d.ts +4 -0
- package/dist/translations/languages/pl.d.ts.map +1 -0
- package/dist/translations/languages/pl.js +48 -0
- package/dist/translations/languages/pl.js.map +1 -0
- package/dist/translations/languages/pt.d.ts +4 -0
- package/dist/translations/languages/pt.d.ts.map +1 -0
- package/dist/translations/languages/pt.js +48 -0
- package/dist/translations/languages/pt.js.map +1 -0
- package/dist/translations/languages/ro.d.ts +4 -0
- package/dist/translations/languages/ro.d.ts.map +1 -0
- package/dist/translations/languages/ro.js +48 -0
- package/dist/translations/languages/ro.js.map +1 -0
- package/dist/translations/languages/rs.d.ts +4 -0
- package/dist/translations/languages/rs.d.ts.map +1 -0
- package/dist/translations/languages/rs.js +48 -0
- package/dist/translations/languages/rs.js.map +1 -0
- package/dist/translations/languages/rsLatin.d.ts +4 -0
- package/dist/translations/languages/rsLatin.d.ts.map +1 -0
- package/dist/translations/languages/rsLatin.js +48 -0
- package/dist/translations/languages/rsLatin.js.map +1 -0
- package/dist/translations/languages/ru.d.ts +4 -0
- package/dist/translations/languages/ru.d.ts.map +1 -0
- package/dist/translations/languages/ru.js +48 -0
- package/dist/translations/languages/ru.js.map +1 -0
- package/dist/translations/languages/sk.d.ts +4 -0
- package/dist/translations/languages/sk.d.ts.map +1 -0
- package/dist/translations/languages/sk.js +48 -0
- package/dist/translations/languages/sk.js.map +1 -0
- package/dist/translations/languages/sl.d.ts +4 -0
- package/dist/translations/languages/sl.d.ts.map +1 -0
- package/dist/translations/languages/sl.js +48 -0
- package/dist/translations/languages/sl.js.map +1 -0
- package/dist/translations/languages/sv.d.ts +4 -0
- package/dist/translations/languages/sv.d.ts.map +1 -0
- package/dist/translations/languages/sv.js +48 -0
- package/dist/translations/languages/sv.js.map +1 -0
- package/dist/translations/languages/ta.d.ts +4 -0
- package/dist/translations/languages/ta.d.ts.map +1 -0
- package/dist/translations/languages/ta.js +48 -0
- package/dist/translations/languages/ta.js.map +1 -0
- package/dist/translations/languages/th.d.ts +4 -0
- package/dist/translations/languages/th.d.ts.map +1 -0
- package/dist/translations/languages/th.js +48 -0
- package/dist/translations/languages/th.js.map +1 -0
- package/dist/translations/languages/tr.d.ts +4 -0
- package/dist/translations/languages/tr.d.ts.map +1 -0
- package/dist/translations/languages/tr.js +48 -0
- package/dist/translations/languages/tr.js.map +1 -0
- package/dist/translations/languages/translation-schema.json +114 -0
- package/dist/translations/languages/uk.d.ts +4 -0
- package/dist/translations/languages/uk.d.ts.map +1 -0
- package/dist/translations/languages/uk.js +48 -0
- package/dist/translations/languages/uk.js.map +1 -0
- package/dist/translations/languages/vi.d.ts +4 -0
- package/dist/translations/languages/vi.d.ts.map +1 -0
- package/dist/translations/languages/vi.js +48 -0
- package/dist/translations/languages/vi.js.map +1 -0
- package/dist/translations/languages/zh.d.ts +4 -0
- package/dist/translations/languages/zh.d.ts.map +1 -0
- package/dist/translations/languages/zh.js +48 -0
- package/dist/translations/languages/zh.js.map +1 -0
- package/dist/translations/languages/zhTw.d.ts +4 -0
- package/dist/translations/languages/zhTw.d.ts.map +1 -0
- package/dist/translations/languages/zhTw.js +48 -0
- package/dist/translations/languages/zhTw.js.map +1 -0
- package/dist/translations/types.d.ts +38 -0
- package/dist/translations/types.d.ts.map +1 -0
- package/dist/translations/types.js +3 -0
- package/dist/translations/types.js.map +1 -0
- package/dist/types.d.ts +221 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/dist/utilities/buildDisabledFieldRegex.d.ts +5 -0
- package/dist/utilities/buildDisabledFieldRegex.d.ts.map +1 -0
- package/dist/utilities/buildDisabledFieldRegex.js +12 -0
- package/dist/utilities/buildDisabledFieldRegex.js.map +1 -0
- package/dist/utilities/collectDisabledFieldPaths.d.ts +15 -0
- package/dist/utilities/collectDisabledFieldPaths.d.ts.map +1 -0
- package/dist/utilities/collectDisabledFieldPaths.js +61 -0
- package/dist/utilities/collectDisabledFieldPaths.js.map +1 -0
- package/dist/utilities/flattenObject.d.ts +11 -0
- package/dist/utilities/flattenObject.d.ts.map +1 -0
- package/dist/utilities/flattenObject.js +129 -0
- package/dist/utilities/flattenObject.js.map +1 -0
- package/dist/utilities/getExportFieldFunctions.d.ts +12 -0
- package/dist/utilities/getExportFieldFunctions.d.ts.map +1 -0
- package/dist/utilities/getExportFieldFunctions.js +102 -0
- package/dist/utilities/getExportFieldFunctions.js.map +1 -0
- package/dist/utilities/getFilename.d.ts +6 -0
- package/dist/utilities/getFilename.d.ts.map +1 -0
- package/dist/utilities/getFilename.js +13 -0
- package/dist/utilities/getFilename.js.map +1 -0
- package/dist/utilities/getFlattenedFieldKeys.d.ts +24 -0
- package/dist/utilities/getFlattenedFieldKeys.d.ts.map +1 -0
- package/dist/utilities/getFlattenedFieldKeys.js +95 -0
- package/dist/utilities/getFlattenedFieldKeys.js.map +1 -0
- package/dist/utilities/getImportFieldFunctions.d.ts +12 -0
- package/dist/utilities/getImportFieldFunctions.d.ts.map +1 -0
- package/dist/utilities/getImportFieldFunctions.js +130 -0
- package/dist/utilities/getImportFieldFunctions.js.map +1 -0
- package/dist/utilities/getPluginCollections.d.ts +39 -0
- package/dist/utilities/getPluginCollections.d.ts.map +1 -0
- package/dist/utilities/getPluginCollections.js +102 -0
- package/dist/utilities/getPluginCollections.js.map +1 -0
- package/dist/utilities/getSchemaColumns.d.ts +43 -0
- package/dist/utilities/getSchemaColumns.d.ts.map +1 -0
- package/dist/utilities/getSchemaColumns.js +163 -0
- package/dist/utilities/getSchemaColumns.js.map +1 -0
- package/dist/utilities/getSelect.d.ts +11 -0
- package/dist/utilities/getSelect.d.ts.map +1 -0
- package/dist/utilities/getSelect.js +27 -0
- package/dist/utilities/getSelect.js.map +1 -0
- package/dist/utilities/getvalueAtPath.d.ts +15 -0
- package/dist/utilities/getvalueAtPath.d.ts.map +1 -0
- package/dist/utilities/getvalueAtPath.js +49 -0
- package/dist/utilities/getvalueAtPath.js.map +1 -0
- package/dist/utilities/parseCSV.d.ts +11 -0
- package/dist/utilities/parseCSV.d.ts.map +1 -0
- package/dist/utilities/parseCSV.js +67 -0
- package/dist/utilities/parseCSV.js.map +1 -0
- package/dist/utilities/parseCSV.spec.js +169 -0
- package/dist/utilities/parseCSV.spec.js.map +1 -0
- package/dist/utilities/parseJSON.d.ts +11 -0
- package/dist/utilities/parseJSON.d.ts.map +1 -0
- package/dist/utilities/parseJSON.js +25 -0
- package/dist/utilities/parseJSON.js.map +1 -0
- package/dist/utilities/processRichTextField.d.ts +6 -0
- package/dist/utilities/processRichTextField.d.ts.map +1 -0
- package/dist/utilities/processRichTextField.js +45 -0
- package/dist/utilities/processRichTextField.js.map +1 -0
- package/dist/utilities/removeDisabledFields.d.ts +15 -0
- package/dist/utilities/removeDisabledFields.d.ts.map +1 -0
- package/dist/utilities/removeDisabledFields.js +66 -0
- package/dist/utilities/removeDisabledFields.js.map +1 -0
- package/dist/utilities/setNestedValue.d.ts +19 -0
- package/dist/utilities/setNestedValue.d.ts.map +1 -0
- package/dist/utilities/setNestedValue.js +55 -0
- package/dist/utilities/setNestedValue.js.map +1 -0
- package/dist/utilities/sortHelpers.d.ts +6 -0
- package/dist/utilities/sortHelpers.d.ts.map +1 -0
- package/dist/utilities/sortHelpers.js +14 -0
- package/dist/utilities/sortHelpers.js.map +1 -0
- package/dist/utilities/unflattenObject.d.ts +11 -0
- package/dist/utilities/unflattenObject.d.ts.map +1 -0
- package/dist/utilities/unflattenObject.js +431 -0
- package/dist/utilities/unflattenObject.js.map +1 -0
- package/dist/utilities/unflattenObject.spec.js +680 -0
- package/dist/utilities/unflattenObject.spec.js.map +1 -0
- package/dist/utilities/useBatchProcessor.d.ts +103 -0
- package/dist/utilities/useBatchProcessor.d.ts.map +1 -0
- package/dist/utilities/useBatchProcessor.js +88 -0
- package/dist/utilities/useBatchProcessor.js.map +1 -0
- package/dist/utilities/validateLimitValue.d.ts +3 -0
- package/dist/utilities/validateLimitValue.d.ts.map +1 -0
- package/dist/utilities/validateLimitValue.js +12 -0
- package/dist/utilities/validateLimitValue.js.map +1 -0
- package/license.md +22 -0
- package/package.json +90 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { traverseFields } from '@ruya.sa/payload';
|
|
2
|
+
/**
|
|
3
|
+
* Gets custom toCSV field functions for export.
|
|
4
|
+
* These functions transform field values when flattening documents for CSV export.
|
|
5
|
+
*/ export const getExportFieldFunctions = ({ fields })=>{
|
|
6
|
+
const result = {};
|
|
7
|
+
const buildCustomFunctions = ({ field, parentRef, ref })=>{
|
|
8
|
+
// @ts-expect-error ref is untyped
|
|
9
|
+
ref.prefix = parentRef.prefix || '';
|
|
10
|
+
if (field.type === 'group' || field.type === 'tab') {
|
|
11
|
+
// @ts-expect-error ref is untyped
|
|
12
|
+
const parentPrefix = parentRef?.prefix ? `${parentRef.prefix}_` : '';
|
|
13
|
+
// @ts-expect-error ref is untyped
|
|
14
|
+
ref.prefix = `${parentPrefix}${field.name}_`;
|
|
15
|
+
}
|
|
16
|
+
if (typeof field.custom?.['plugin-import-export']?.toCSV === 'function') {
|
|
17
|
+
// @ts-expect-error ref is untyped
|
|
18
|
+
result[`${ref.prefix}${field.name}`] = field.custom['plugin-import-export']?.toCSV;
|
|
19
|
+
} else if (field.type === 'json' || field.type === 'richText') {
|
|
20
|
+
// Serialize JSON and richText fields as JSON strings in a single column
|
|
21
|
+
// This prevents them from being flattened into multiple columns
|
|
22
|
+
// @ts-expect-error ref is untyped
|
|
23
|
+
result[`${ref.prefix}${field.name}`] = ({ value })=>{
|
|
24
|
+
if (value === null || value === undefined) {
|
|
25
|
+
return value;
|
|
26
|
+
}
|
|
27
|
+
if (typeof value === 'object') {
|
|
28
|
+
return JSON.stringify(value);
|
|
29
|
+
}
|
|
30
|
+
return value;
|
|
31
|
+
};
|
|
32
|
+
} else if (field.type === 'relationship' || field.type === 'upload') {
|
|
33
|
+
if (field.hasMany !== true) {
|
|
34
|
+
if (!Array.isArray(field.relationTo)) {
|
|
35
|
+
// monomorphic single
|
|
36
|
+
// @ts-expect-error ref is untyped
|
|
37
|
+
result[`${ref.prefix}${field.name}`] = ({ value })=>typeof value === 'object' && value && 'id' in value ? value.id : value;
|
|
38
|
+
} else {
|
|
39
|
+
// polymorphic single
|
|
40
|
+
// @ts-expect-error ref is untyped
|
|
41
|
+
result[`${ref.prefix}${field.name}`] = ({ data, value })=>{
|
|
42
|
+
if (value && typeof value === 'object' && 'relationTo' in value && 'value' in value) {
|
|
43
|
+
const relationTo = value.relationTo;
|
|
44
|
+
const relatedDoc = value.value;
|
|
45
|
+
if (relatedDoc && typeof relatedDoc === 'object') {
|
|
46
|
+
// @ts-expect-error ref is untyped
|
|
47
|
+
data[`${ref.prefix}${field.name}_id`] = relatedDoc.id;
|
|
48
|
+
// @ts-expect-error ref is untyped
|
|
49
|
+
data[`${ref.prefix}${field.name}_relationTo`] = relationTo;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return undefined // prevents further flattening
|
|
53
|
+
;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
} else {
|
|
57
|
+
if (!Array.isArray(field.relationTo)) {
|
|
58
|
+
// monomorphic many
|
|
59
|
+
// @ts-expect-error ref is untyped
|
|
60
|
+
result[`${ref.prefix}${field.name}`] = ({ data, value })=>{
|
|
61
|
+
if (Array.isArray(value)) {
|
|
62
|
+
value.forEach((val, i)=>{
|
|
63
|
+
const id = typeof val === 'object' && val ? val.id : val;
|
|
64
|
+
// @ts-expect-error ref is untyped
|
|
65
|
+
data[`${ref.prefix}${field.name}_${i}_id`] = id;
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
return undefined // prevents further flattening
|
|
69
|
+
;
|
|
70
|
+
};
|
|
71
|
+
} else {
|
|
72
|
+
// polymorphic many
|
|
73
|
+
// @ts-expect-error ref is untyped
|
|
74
|
+
result[`${ref.prefix}${field.name}`] = ({ data, value })=>{
|
|
75
|
+
if (Array.isArray(value)) {
|
|
76
|
+
value.forEach((val, i)=>{
|
|
77
|
+
if (val && typeof val === 'object') {
|
|
78
|
+
const relationTo = val.relationTo;
|
|
79
|
+
const relatedDoc = val.value;
|
|
80
|
+
if (relationTo && relatedDoc && typeof relatedDoc === 'object') {
|
|
81
|
+
// @ts-expect-error ref is untyped
|
|
82
|
+
data[`${ref.prefix}${field.name}_${i}_id`] = relatedDoc.id;
|
|
83
|
+
// @ts-expect-error ref is untyped
|
|
84
|
+
data[`${ref.prefix}${field.name}_${i}_relationTo`] = relationTo;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
return undefined;
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
traverseFields({
|
|
96
|
+
callback: buildCustomFunctions,
|
|
97
|
+
fields
|
|
98
|
+
});
|
|
99
|
+
return result;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
//# sourceMappingURL=getExportFieldFunctions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utilities/getExportFieldFunctions.ts"],"sourcesContent":["import { type FlattenedField, traverseFields, type TraverseFieldsCallback } from '@ruya.sa/payload'\n\nimport type { ToCSVFunction } from '../types.js'\n\ntype Args = {\n fields: FlattenedField[]\n}\n\n/**\n * Gets custom toCSV field functions for export.\n * These functions transform field values when flattening documents for CSV export.\n */\nexport const getExportFieldFunctions = ({ fields }: Args): Record<string, ToCSVFunction> => {\n const result: Record<string, ToCSVFunction> = {}\n\n const buildCustomFunctions: TraverseFieldsCallback = ({ field, parentRef, ref }) => {\n // @ts-expect-error ref is untyped\n ref.prefix = parentRef.prefix || ''\n if (field.type === 'group' || field.type === 'tab') {\n // @ts-expect-error ref is untyped\n const parentPrefix = parentRef?.prefix ? `${parentRef.prefix}_` : ''\n // @ts-expect-error ref is untyped\n ref.prefix = `${parentPrefix}${field.name}_`\n }\n\n if (typeof field.custom?.['plugin-import-export']?.toCSV === 'function') {\n // @ts-expect-error ref is untyped\n result[`${ref.prefix}${field.name}`] = field.custom['plugin-import-export']?.toCSV\n } else if (field.type === 'json' || field.type === 'richText') {\n // Serialize JSON and richText fields as JSON strings in a single column\n // This prevents them from being flattened into multiple columns\n // @ts-expect-error ref is untyped\n result[`${ref.prefix}${field.name}`] = ({ value }) => {\n if (value === null || value === undefined) {\n return value\n }\n if (typeof value === 'object') {\n return JSON.stringify(value)\n }\n return value\n }\n } else if (field.type === 'relationship' || field.type === 'upload') {\n if (field.hasMany !== true) {\n if (!Array.isArray(field.relationTo)) {\n // monomorphic single\n // @ts-expect-error ref is untyped\n result[`${ref.prefix}${field.name}`] = ({ value }) =>\n typeof value === 'object' && value && 'id' in value ? value.id : value\n } else {\n // polymorphic single\n // @ts-expect-error ref is untyped\n result[`${ref.prefix}${field.name}`] = ({ data, value }) => {\n if (value && typeof value === 'object' && 'relationTo' in value && 'value' in value) {\n const relationTo = (value as { relationTo: string; value: { id: number | string } })\n .relationTo\n const relatedDoc = (value as { relationTo: string; value: { id: number | string } })\n .value\n if (relatedDoc && typeof relatedDoc === 'object') {\n // @ts-expect-error ref is untyped\n data[`${ref.prefix}${field.name}_id`] = relatedDoc.id\n // @ts-expect-error ref is untyped\n data[`${ref.prefix}${field.name}_relationTo`] = relationTo\n }\n }\n return undefined // prevents further flattening\n }\n }\n } else {\n if (!Array.isArray(field.relationTo)) {\n // monomorphic many\n // @ts-expect-error ref is untyped\n result[`${ref.prefix}${field.name}`] = ({\n data,\n value,\n }: {\n data: Record<string, unknown>\n value: Array<number | Record<string, any> | string> | undefined\n }) => {\n if (Array.isArray(value)) {\n value.forEach((val, i) => {\n const id = typeof val === 'object' && val ? val.id : val\n // @ts-expect-error ref is untyped\n data[`${ref.prefix}${field.name}_${i}_id`] = id\n })\n }\n return undefined // prevents further flattening\n }\n } else {\n // polymorphic many\n // @ts-expect-error ref is untyped\n result[`${ref.prefix}${field.name}`] = ({\n data,\n value,\n }: {\n data: Record<string, unknown>\n value: Array<Record<string, any>> | undefined\n }) => {\n if (Array.isArray(value)) {\n value.forEach((val, i) => {\n if (val && typeof val === 'object') {\n const relationTo = val.relationTo\n const relatedDoc = val.value\n if (relationTo && relatedDoc && typeof relatedDoc === 'object') {\n // @ts-expect-error ref is untyped\n data[`${ref.prefix}${field.name}_${i}_id`] = relatedDoc.id\n // @ts-expect-error ref is untyped\n data[`${ref.prefix}${field.name}_${i}_relationTo`] = relationTo\n }\n }\n })\n }\n return undefined\n }\n }\n }\n }\n }\n\n traverseFields({ callback: buildCustomFunctions, fields })\n\n return result\n}\n"],"names":["traverseFields","getExportFieldFunctions","fields","result","buildCustomFunctions","field","parentRef","ref","prefix","type","parentPrefix","name","custom","toCSV","value","undefined","JSON","stringify","hasMany","Array","isArray","relationTo","id","data","relatedDoc","forEach","val","i","callback"],"mappings":"AAAA,SAA8BA,cAAc,QAAqC,mBAAkB;AAQnG;;;CAGC,GACD,OAAO,MAAMC,0BAA0B,CAAC,EAAEC,MAAM,EAAQ;IACtD,MAAMC,SAAwC,CAAC;IAE/C,MAAMC,uBAA+C,CAAC,EAAEC,KAAK,EAAEC,SAAS,EAAEC,GAAG,EAAE;QAC7E,kCAAkC;QAClCA,IAAIC,MAAM,GAAGF,UAAUE,MAAM,IAAI;QACjC,IAAIH,MAAMI,IAAI,KAAK,WAAWJ,MAAMI,IAAI,KAAK,OAAO;YAClD,kCAAkC;YAClC,MAAMC,eAAeJ,WAAWE,SAAS,GAAGF,UAAUE,MAAM,CAAC,CAAC,CAAC,GAAG;YAClE,kCAAkC;YAClCD,IAAIC,MAAM,GAAG,GAAGE,eAAeL,MAAMM,IAAI,CAAC,CAAC,CAAC;QAC9C;QAEA,IAAI,OAAON,MAAMO,MAAM,EAAE,CAAC,uBAAuB,EAAEC,UAAU,YAAY;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C9D,kCAAkC;wCAClCD,IAAI,CAAC,GAAGhB,IAAIC,MAAM,GAAGH,MAAMM,IAAI,CAAC,CAAC,EAAEgB,EAAE,GAAG,CAAC,CAAC,GAAGH,WAAWF,EAAE;wCAC1D,kCAAkC;wCAClCC,IAAI,CAAC,GAAGhB,IAAIC,MAAM,GAAGH,MAAMM,IAAI,CAAC,CAAC,EAAEgB,EAAE,WAAW,CAAC,CAAC,GAAGN;oCACvD;gCACF;4BACF;wBACF;wBACA,OAAON;oBACT;gBACF;YACF;QACF;IACF;IAEAf,eAAe;QAAE4B,UAAUxB;QAAsBF;IAAO;IAExD,OAAOC;AACT,EAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getFilename.d.ts","sourceRoot":"","sources":["../../src/utilities/getFilename.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,WAAW,cAMvB,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates a filename based on current date and time.
|
|
3
|
+
* Format: "YYYY-MM-DD HH:MM:SS"
|
|
4
|
+
*/ export const getFilename = ()=>{
|
|
5
|
+
const now = new Date();
|
|
6
|
+
const yyymmdd = now.toISOString().split('T')[0] // "YYYY-MM-DD"
|
|
7
|
+
;
|
|
8
|
+
const hhmmss = now.toTimeString().split(' ')[0] // "HH:MM:SS"
|
|
9
|
+
;
|
|
10
|
+
return `${yyymmdd} ${hhmmss}`;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=getFilename.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utilities/getFilename.ts"],"sourcesContent":["/**\n * Generates a filename based on current date and time.\n * Format: \"YYYY-MM-DD HH:MM:SS\"\n */\nexport const getFilename = () => {\n const now = new Date()\n const yyymmdd = now.toISOString().split('T')[0] // \"YYYY-MM-DD\"\n const hhmmss = now.toTimeString().split(' ')[0] // \"HH:MM:SS\"\n\n return `${yyymmdd} ${hhmmss}`\n}\n"],"names":["getFilename","now","Date","yyymmdd","toISOString","split","hhmmss","toTimeString"],"mappings":"AAAA;;;CAGC,GACD,OAAO,MAAMA,cAAc;IACzB,MAAMC,MAAM,IAAIC;IAChB,MAAMC,UAAUF,IAAIG,WAAW,GAAGC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,eAAe;;IAC/D,MAAMC,SAASL,IAAIM,YAAY,GAAGF,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,aAAa;;IAE7D,OAAO,GAAGF,QAAQ,CAAC,EAAEG,QAAQ;AAC/B,EAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type FlattenedField } from '@ruya.sa/payload';
|
|
2
|
+
type FieldWithPresentational = {
|
|
3
|
+
fields?: FlattenedField[];
|
|
4
|
+
name?: string;
|
|
5
|
+
tabs?: {
|
|
6
|
+
fields: FlattenedField[];
|
|
7
|
+
name?: string;
|
|
8
|
+
}[];
|
|
9
|
+
type: 'collapsible' | 'row' | 'tabs';
|
|
10
|
+
} | FlattenedField;
|
|
11
|
+
export type GetFlattenedFieldKeysOptions = {
|
|
12
|
+
/**
|
|
13
|
+
* When provided, localized fields will be expanded to include locale suffixes.
|
|
14
|
+
* e.g., 'title' (localized) -> ['title_en', 'title_es']
|
|
15
|
+
*/
|
|
16
|
+
localeCodes?: string[];
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Recursively traverses fields and generates flattened CSV column keys.
|
|
20
|
+
* This is schema-based - it derives columns from field definitions, not data.
|
|
21
|
+
*/
|
|
22
|
+
export declare const getFlattenedFieldKeys: (fields: FieldWithPresentational[], prefix?: string, options?: GetFlattenedFieldKeysOptions) => string[];
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=getFlattenedFieldKeys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getFlattenedFieldKeys.d.ts","sourceRoot":"","sources":["../../src/utilities/getFlattenedFieldKeys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEtD,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"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recursively traverses fields and generates flattened CSV column keys.
|
|
3
|
+
* This is schema-based - it derives columns from field definitions, not data.
|
|
4
|
+
*/ export const getFlattenedFieldKeys = (fields, prefix = '', options = {})=>{
|
|
5
|
+
const { localeCodes } = options;
|
|
6
|
+
const keys = [];
|
|
7
|
+
fields.forEach((field)=>{
|
|
8
|
+
// Skip disabled fields
|
|
9
|
+
const isDisabled = 'custom' in field && typeof field.custom === 'object' && field.custom?.['plugin-import-export']?.disabled === true;
|
|
10
|
+
if (isDisabled) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
const name = 'name' in field && typeof field.name === 'string' ? field.name : undefined;
|
|
14
|
+
const fullKey = name && prefix ? `${prefix}_${name}` : name ?? prefix;
|
|
15
|
+
// Check if field is localized
|
|
16
|
+
const isLocalized = 'localized' in field && field.localized === true;
|
|
17
|
+
// Helper to add keys with locale expansion if needed
|
|
18
|
+
const addKey = (key, fieldIsLocalized)=>{
|
|
19
|
+
if (fieldIsLocalized && localeCodes && localeCodes.length > 0) {
|
|
20
|
+
// Expand to locale-specific keys
|
|
21
|
+
for (const locale of localeCodes){
|
|
22
|
+
keys.push(`${key}_${locale}`);
|
|
23
|
+
}
|
|
24
|
+
} else {
|
|
25
|
+
keys.push(key);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
switch(field.type){
|
|
29
|
+
case 'array':
|
|
30
|
+
{
|
|
31
|
+
const subKeys = getFlattenedFieldKeys(field.fields, `${fullKey}_0`, options);
|
|
32
|
+
keys.push(...subKeys);
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
case 'blocks':
|
|
36
|
+
{
|
|
37
|
+
field.blocks.forEach((block)=>{
|
|
38
|
+
if (typeof block === 'string') {
|
|
39
|
+
return; // Skip block references
|
|
40
|
+
}
|
|
41
|
+
const blockPrefix = `${fullKey}_0_${block.slug}`;
|
|
42
|
+
keys.push(`${blockPrefix}_blockType`);
|
|
43
|
+
keys.push(`${blockPrefix}_id`);
|
|
44
|
+
keys.push(...getFlattenedFieldKeys(block.flattenedFields ?? block.fields, blockPrefix, options));
|
|
45
|
+
});
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
case 'collapsible':
|
|
49
|
+
case 'group':
|
|
50
|
+
case 'row':
|
|
51
|
+
keys.push(...getFlattenedFieldKeys(field.fields, fullKey, options));
|
|
52
|
+
break;
|
|
53
|
+
case 'relationship':
|
|
54
|
+
case 'upload':
|
|
55
|
+
if (field.hasMany) {
|
|
56
|
+
if (Array.isArray(field.relationTo)) {
|
|
57
|
+
// hasMany polymorphic
|
|
58
|
+
keys.push(`${fullKey}_0_relationTo`, `${fullKey}_0_id`);
|
|
59
|
+
} else {
|
|
60
|
+
// hasMany monomorphic
|
|
61
|
+
keys.push(`${fullKey}_0`);
|
|
62
|
+
}
|
|
63
|
+
} else {
|
|
64
|
+
if (Array.isArray(field.relationTo)) {
|
|
65
|
+
// hasOne polymorphic
|
|
66
|
+
keys.push(`${fullKey}_relationTo`, `${fullKey}_id`);
|
|
67
|
+
} else {
|
|
68
|
+
// hasOne monomorphic
|
|
69
|
+
addKey(fullKey, isLocalized);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
break;
|
|
73
|
+
case 'tabs':
|
|
74
|
+
field.tabs?.forEach((tab)=>{
|
|
75
|
+
const tabPrefix = tab.name ? `${fullKey}_${tab.name}` : fullKey;
|
|
76
|
+
keys.push(...getFlattenedFieldKeys(tab.fields || [], tabPrefix, options));
|
|
77
|
+
});
|
|
78
|
+
break;
|
|
79
|
+
default:
|
|
80
|
+
if (!name) {
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
if ('hasMany' in field && field.hasMany) {
|
|
84
|
+
// Push placeholder for first index
|
|
85
|
+
keys.push(`${fullKey}_0`);
|
|
86
|
+
} else {
|
|
87
|
+
addKey(fullKey, isLocalized);
|
|
88
|
+
}
|
|
89
|
+
break;
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
return keys;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
//# sourceMappingURL=getFlattenedFieldKeys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utilities/getFlattenedFieldKeys.ts"],"sourcesContent":["import { type FlattenedField } from '@ruya.sa/payload'\n\ntype FieldWithPresentational =\n | {\n fields?: FlattenedField[]\n name?: string\n tabs?: {\n fields: FlattenedField[]\n name?: string\n }[]\n type: 'collapsible' | 'row' | 'tabs'\n }\n | FlattenedField\n\nexport type GetFlattenedFieldKeysOptions = {\n /**\n * When provided, localized fields will be expanded to include locale suffixes.\n * e.g., 'title' (localized) -> ['title_en', 'title_es']\n */\n localeCodes?: string[]\n}\n\n/**\n * Recursively traverses fields and generates flattened CSV column keys.\n * This is schema-based - it derives columns from field definitions, not data.\n */\nexport const getFlattenedFieldKeys = (\n fields: FieldWithPresentational[],\n prefix = '',\n options: GetFlattenedFieldKeysOptions = {},\n): string[] => {\n const { localeCodes } = options\n const keys: string[] = []\n\n fields.forEach((field) => {\n // Skip disabled fields\n const isDisabled =\n 'custom' in field &&\n typeof field.custom === 'object' &&\n field.custom?.['plugin-import-export']?.disabled === true\n\n if (isDisabled) {\n return\n }\n\n const name = 'name' in field && typeof field.name === 'string' ? field.name : undefined\n const fullKey = name && prefix ? `${prefix}_${name}` : (name ?? prefix)\n\n // Check if field is localized\n const isLocalized = 'localized' in field && field.localized === true\n\n // Helper to add keys with locale expansion if needed\n const addKey = (key: string, fieldIsLocalized: boolean) => {\n if (fieldIsLocalized && localeCodes && localeCodes.length > 0) {\n // Expand to locale-specific keys\n for (const locale of localeCodes) {\n keys.push(`${key}_${locale}`)\n }\n } else {\n keys.push(key)\n }\n }\n\n switch (field.type) {\n case 'array': {\n const subKeys = getFlattenedFieldKeys(\n field.fields as FlattenedField[],\n `${fullKey}_0`,\n options,\n )\n keys.push(...subKeys)\n break\n }\n case 'blocks': {\n field.blocks.forEach((block) => {\n if (typeof block === 'string') {\n return // Skip block references\n }\n const blockPrefix = `${fullKey}_0_${block.slug}`\n keys.push(`${blockPrefix}_blockType`)\n keys.push(`${blockPrefix}_id`)\n keys.push(\n ...getFlattenedFieldKeys(block.flattenedFields ?? block.fields, blockPrefix, options),\n )\n })\n break\n }\n case 'collapsible':\n case 'group':\n case 'row':\n keys.push(...getFlattenedFieldKeys(field.fields as FlattenedField[], fullKey, options))\n break\n case 'relationship':\n case 'upload':\n if (field.hasMany) {\n if (Array.isArray(field.relationTo)) {\n // hasMany polymorphic\n keys.push(`${fullKey}_0_relationTo`, `${fullKey}_0_id`)\n } else {\n // hasMany monomorphic\n keys.push(`${fullKey}_0`)\n }\n } else {\n if (Array.isArray(field.relationTo)) {\n // hasOne polymorphic\n keys.push(`${fullKey}_relationTo`, `${fullKey}_id`)\n } else {\n // hasOne monomorphic\n addKey(fullKey, isLocalized)\n }\n }\n break\n case 'tabs':\n field.tabs?.forEach((tab) => {\n const tabPrefix = tab.name ? `${fullKey}_${tab.name}` : fullKey\n keys.push(...getFlattenedFieldKeys(tab.fields || [], tabPrefix, options))\n })\n break\n default:\n if (!name) {\n break\n }\n if ('hasMany' in field && field.hasMany) {\n // Push placeholder for first index\n keys.push(`${fullKey}_0`)\n } else {\n addKey(fullKey, isLocalized)\n }\n break\n }\n })\n\n return keys\n}\n"],"names":["getFlattenedFieldKeys","fields","prefix","options","localeCodes","keys","forEach","field","isDisabled","custom","disabled","name","undefined","fullKey","isLocalized","localized","addKey","key","fieldIsLocalized","length","locale","push","type","subKeys","blocks","block","blockPrefix","slug","flattenedFields","hasMany","Array","isArray","relationTo","tabs","tab","tabPrefix"],"mappings":"AAsBA;;;CAGC,GACD,OAAO,MAAMA,wBAAwB,CACnCC,QACAC,SAAS,EAAE,EACXC,UAAwC,CAAC,CAAC;IAE1C,MAAM,EAAEC,WAAW,EAAE,GAAGD;IACxB,MAAME,OAAiB,EAAE;IAEzBJ,OAAOK,OAAO,CAAC,CAACC;QACd,uBAAuB;QACvB,MAAMC,aACJ,YAAYD,SACZ,OAAOA,MAAME,MAAM,KAAK,YACxBF,MAAME,MAAM,EAAE,CAAC,uBAAuB,EAAEC,aAAa;QAEvD,IAAIF,YAAY;YACd;QACF;QAEA,MAAMG,OAAO,UAAUJ,SAAS,OAAOA,MAAMI,IAAI,KAAK,WAAWJ,MAAMI,IAAI,GAAGC;QAC9E,MAAMC,UAAUF,QAAQT,SAAS,GAAGA,OAAO,CAAC,EAAES,MAAM,GAAIA,QAAQT;QAEhE,8BAA8B;QAC9B,MAAMY,cAAc,eAAeP,SAASA,MAAMQ,SAAS,KAAK;QAEhE,qDAAqD;QACrD,MAAMC,SAAS,CAACC,KAAaC;YAC3B,IAAIA,oBAAoBd,eAAeA,YAAYe,MAAM,GAAG,GAAG;gBAC7D,iCAAiC;gBACjC,KAAK,MAAMC,UAAUhB,YAAa;oBAChCC,KAAKgB,IAAI,CAAC,GAAGJ,IAAI,CAAC,EAAEG,QAAQ;gBAC9B;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OAAO;wBACL,qBAAqB;wBACrBG,OAAOH,SAASC;oBAClB;gBACF;gBACA;YACF,KAAK;gBACHP,MAAM0B,IAAI,EAAE3B,QAAQ,CAAC4B;oBACnB,MAAMC,YAAYD,IAAIvB,IAAI,GAAG,GAAGE,QAAQ,CAAC,EAAEqB,IAAIvB,IAAI,EAAE,GAAGE;oBACxDR,KAAKgB,IAAI,IAAIrB,sBAAsBkC,IAAIjC,MAAM,IAAI,EAAE,EAAEkC,WAAWhC;gBAClE;gBACA;YACF;gBACE,IAAI,CAACQ,MAAM;oBACT;gBACF;gBACA,IAAI,aAAaJ,SAASA,MAAMsB,OAAO,EAAE;oBACvC,mCAAmC;oBACnCxB,KAAKgB,IAAI,CAAC,GAAGR,QAAQ,EAAE,CAAC;gBAC1B,OAAO;oBACLG,OAAOH,SAASC;gBAClB;gBACA;QACJ;IACF;IAEA,OAAOT;AACT,EAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type FlattenedField } from '@ruya.sa/payload';
|
|
2
|
+
import type { FromCSVFunction } from '../types.js';
|
|
3
|
+
type Args = {
|
|
4
|
+
fields: FlattenedField[];
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Gets custom fromCSV field functions for import.
|
|
8
|
+
* These functions transform field values when unflattening CSV data for import.
|
|
9
|
+
*/
|
|
10
|
+
export declare const getImportFieldFunctions: ({ fields }: Args) => Record<string, FromCSVFunction>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=getImportFieldFunctions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getImportFieldFunctions.d.ts","sourceRoot":"","sources":["../../src/utilities/getImportFieldFunctions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAA+C,MAAM,kBAAkB,CAAA;AAEnG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAElD,KAAK,IAAI,GAAG;IACV,MAAM,EAAE,cAAc,EAAE,CAAA;CACzB,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,uBAAuB,eAAgB,IAAI,KAAG,MAAM,CAAC,MAAM,EAAE,eAAe,CA4HxF,CAAA"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { traverseFields } from '@ruya.sa/payload';
|
|
2
|
+
/**
|
|
3
|
+
* Gets custom fromCSV field functions for import.
|
|
4
|
+
* These functions transform field values when unflattening CSV data for import.
|
|
5
|
+
*/ export const getImportFieldFunctions = ({ fields })=>{
|
|
6
|
+
const result = {};
|
|
7
|
+
const buildCustomFunctions = ({ field, parentRef, ref })=>{
|
|
8
|
+
// @ts-expect-error ref is untyped
|
|
9
|
+
ref.prefix = parentRef.prefix || '';
|
|
10
|
+
if (field.type === 'group' || field.type === 'tab') {
|
|
11
|
+
// @ts-expect-error ref is untyped
|
|
12
|
+
const parentPrefix = parentRef?.prefix ? `${parentRef.prefix}_` : '';
|
|
13
|
+
// @ts-expect-error ref is untyped
|
|
14
|
+
ref.prefix = `${parentPrefix}${field.name}_`;
|
|
15
|
+
}
|
|
16
|
+
if (typeof field.custom?.['plugin-import-export']?.fromCSV === 'function') {
|
|
17
|
+
// @ts-expect-error ref is untyped
|
|
18
|
+
result[`${ref.prefix}${field.name}`] = field.custom['plugin-import-export']?.fromCSV;
|
|
19
|
+
} else if (field.type === 'relationship' || field.type === 'upload') {
|
|
20
|
+
if (field.hasMany !== true) {
|
|
21
|
+
if (!Array.isArray(field.relationTo)) {
|
|
22
|
+
// monomorphic single relationship - simple ID to value conversion
|
|
23
|
+
// @ts-expect-error ref is untyped
|
|
24
|
+
result[`${ref.prefix}${field.name}`] = ({ value })=>{
|
|
25
|
+
// If it's already an object (from JSON import), return as-is
|
|
26
|
+
if (typeof value === 'object' && value !== null) {
|
|
27
|
+
return value;
|
|
28
|
+
}
|
|
29
|
+
// Convert string/number ID to relationship value
|
|
30
|
+
return value;
|
|
31
|
+
};
|
|
32
|
+
} else {
|
|
33
|
+
// polymorphic single relationship - needs special handling
|
|
34
|
+
// The CSV has field_id and field_relationTo columns
|
|
35
|
+
// We need to combine them back into { relationTo, value } format
|
|
36
|
+
// This is handled in unflattenObject, so we don't need a fromCSV here
|
|
37
|
+
}
|
|
38
|
+
} else {
|
|
39
|
+
if (!Array.isArray(field.relationTo)) {
|
|
40
|
+
// @ts-expect-error ref is untyped
|
|
41
|
+
result[`${ref.prefix}${field.name}`] = ({ value })=>{
|
|
42
|
+
// If it's already an array (from JSON import), return as-is
|
|
43
|
+
if (Array.isArray(value)) {
|
|
44
|
+
return value;
|
|
45
|
+
}
|
|
46
|
+
// For CSV, this is handled by array unflattening in unflattenObject
|
|
47
|
+
return value;
|
|
48
|
+
};
|
|
49
|
+
} else {
|
|
50
|
+
// polymorphic many relationships
|
|
51
|
+
// Similar to polymorphic single, handled in unflattenObject
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
} else if (field.type === 'number') {
|
|
55
|
+
// For hasMany number fields, preserve comma-separated strings for later processing
|
|
56
|
+
if (field.hasMany) {
|
|
57
|
+
// Don't convert - let unflattenObject handle comma-separated values
|
|
58
|
+
// @ts-expect-error ref is untyped
|
|
59
|
+
result[`${ref.prefix}${field.name}`] = ({ value })=>value;
|
|
60
|
+
} else {
|
|
61
|
+
// Ensure single numbers are parsed correctly from CSV strings
|
|
62
|
+
// @ts-expect-error ref is untyped
|
|
63
|
+
result[`${ref.prefix}${field.name}`] = ({ value })=>{
|
|
64
|
+
if (typeof value === 'number') {
|
|
65
|
+
return value;
|
|
66
|
+
}
|
|
67
|
+
if (typeof value === 'string') {
|
|
68
|
+
const parsed = parseFloat(value);
|
|
69
|
+
return isNaN(parsed) ? 0 : parsed;
|
|
70
|
+
}
|
|
71
|
+
return value;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
} else if (field.type === 'checkbox') {
|
|
75
|
+
// Convert string boolean values to actual booleans
|
|
76
|
+
// @ts-expect-error ref is untyped
|
|
77
|
+
result[`${ref.prefix}${field.name}`] = ({ value })=>{
|
|
78
|
+
if (typeof value === 'boolean') {
|
|
79
|
+
return value;
|
|
80
|
+
}
|
|
81
|
+
if (typeof value === 'string') {
|
|
82
|
+
return value.toLowerCase() === 'true' || value === '1';
|
|
83
|
+
}
|
|
84
|
+
return Boolean(value);
|
|
85
|
+
};
|
|
86
|
+
} else if (field.type === 'date') {
|
|
87
|
+
// Ensure dates are in proper format
|
|
88
|
+
// @ts-expect-error ref is untyped
|
|
89
|
+
result[`${ref.prefix}${field.name}`] = ({ value })=>{
|
|
90
|
+
if (!value) {
|
|
91
|
+
return value;
|
|
92
|
+
}
|
|
93
|
+
// If it's already a valid date string, return as-is
|
|
94
|
+
if (typeof value === 'string' && !isNaN(Date.parse(value))) {
|
|
95
|
+
return value;
|
|
96
|
+
}
|
|
97
|
+
// Try to parse and format
|
|
98
|
+
try {
|
|
99
|
+
const date = new Date(value);
|
|
100
|
+
return isNaN(date.getTime()) ? value : date.toISOString();
|
|
101
|
+
} catch {
|
|
102
|
+
return value;
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
} else if (field.type === 'json' || field.type === 'richText') {
|
|
106
|
+
// Parse JSON strings back to objects (both json and richText fields)
|
|
107
|
+
// @ts-expect-error ref is untyped
|
|
108
|
+
result[`${ref.prefix}${field.name}`] = ({ value })=>{
|
|
109
|
+
if (typeof value === 'object') {
|
|
110
|
+
return value;
|
|
111
|
+
}
|
|
112
|
+
if (typeof value === 'string') {
|
|
113
|
+
try {
|
|
114
|
+
return JSON.parse(value);
|
|
115
|
+
} catch {
|
|
116
|
+
return value;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return value;
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
traverseFields({
|
|
124
|
+
callback: buildCustomFunctions,
|
|
125
|
+
fields
|
|
126
|
+
});
|
|
127
|
+
return result;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
//# sourceMappingURL=getImportFieldFunctions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utilities/getImportFieldFunctions.ts"],"sourcesContent":["import { type FlattenedField, traverseFields, type TraverseFieldsCallback } from '@ruya.sa/payload'\n\nimport type { FromCSVFunction } from '../types.js'\n\ntype Args = {\n fields: FlattenedField[]\n}\n\n/**\n * Gets custom fromCSV field functions for import.\n * These functions transform field values when unflattening CSV data for import.\n */\nexport const getImportFieldFunctions = ({ fields }: Args): Record<string, FromCSVFunction> => {\n const result: Record<string, FromCSVFunction> = {}\n\n const buildCustomFunctions: TraverseFieldsCallback = ({ field, parentRef, ref }) => {\n // @ts-expect-error ref is untyped\n ref.prefix = parentRef.prefix || ''\n if (field.type === 'group' || field.type === 'tab') {\n // @ts-expect-error ref is untyped\n const parentPrefix = parentRef?.prefix ? `${parentRef.prefix}_` : ''\n // @ts-expect-error ref is untyped\n ref.prefix = `${parentPrefix}${field.name}_`\n }\n\n if (typeof field.custom?.['plugin-import-export']?.fromCSV === 'function') {\n // @ts-expect-error ref is untyped\n result[`${ref.prefix}${field.name}`] = field.custom['plugin-import-export']?.fromCSV\n } else if (field.type === 'relationship' || field.type === 'upload') {\n if (field.hasMany !== true) {\n if (!Array.isArray(field.relationTo)) {\n // monomorphic single relationship - simple ID to value conversion\n // @ts-expect-error ref is untyped\n result[`${ref.prefix}${field.name}`] = ({ value }) => {\n // If it's already an object (from JSON import), return as-is\n if (typeof value === 'object' && value !== null) {\n return value\n }\n // Convert string/number ID to relationship value\n return value\n }\n } else {\n // polymorphic single relationship - needs special handling\n // The CSV has field_id and field_relationTo columns\n // We need to combine them back into { relationTo, value } format\n // This is handled in unflattenObject, so we don't need a fromCSV here\n }\n } else {\n if (!Array.isArray(field.relationTo)) {\n // @ts-expect-error ref is untyped\n result[`${ref.prefix}${field.name}`] = ({ value }) => {\n // If it's already an array (from JSON import), return as-is\n if (Array.isArray(value)) {\n return value\n }\n // For CSV, this is handled by array unflattening in unflattenObject\n return value\n }\n } else {\n // polymorphic many relationships\n // Similar to polymorphic single, handled in unflattenObject\n }\n }\n } else if (field.type === 'number') {\n // For hasMany number fields, preserve comma-separated strings for later processing\n if (field.hasMany) {\n // Don't convert - let unflattenObject handle comma-separated values\n // @ts-expect-error ref is untyped\n result[`${ref.prefix}${field.name}`] = ({ value }) => value\n } else {\n // Ensure single numbers are parsed correctly from CSV strings\n // @ts-expect-error ref is untyped\n result[`${ref.prefix}${field.name}`] = ({ value }) => {\n if (typeof value === 'number') {\n return value\n }\n if (typeof value === 'string') {\n const parsed = parseFloat(value)\n return isNaN(parsed) ? 0 : parsed\n }\n return value\n }\n }\n } else if (field.type === 'checkbox') {\n // Convert string boolean values to actual booleans\n // @ts-expect-error ref is untyped\n result[`${ref.prefix}${field.name}`] = ({ value }) => {\n if (typeof value === 'boolean') {\n return value\n }\n if (typeof value === 'string') {\n return value.toLowerCase() === 'true' || value === '1'\n }\n return Boolean(value)\n }\n } else if (field.type === 'date') {\n // Ensure dates are in proper format\n // @ts-expect-error ref is untyped\n result[`${ref.prefix}${field.name}`] = ({ value }) => {\n if (!value) {\n return value\n }\n // If it's already a valid date string, return as-is\n if (typeof value === 'string' && !isNaN(Date.parse(value))) {\n return value\n }\n // Try to parse and format\n try {\n const date = new Date(value as string)\n return isNaN(date.getTime()) ? value : date.toISOString()\n } catch {\n return value\n }\n }\n } else if (field.type === 'json' || field.type === 'richText') {\n // Parse JSON strings back to objects (both json and richText fields)\n // @ts-expect-error ref is untyped\n result[`${ref.prefix}${field.name}`] = ({ value }) => {\n if (typeof value === 'object') {\n return value\n }\n if (typeof value === 'string') {\n try {\n return JSON.parse(value)\n } catch {\n return value\n }\n }\n return value\n }\n }\n }\n\n traverseFields({ callback: buildCustomFunctions, fields })\n\n return result\n}\n"],"names":["traverseFields","getImportFieldFunctions","fields","result","buildCustomFunctions","field","parentRef","ref","prefix","type","parentPrefix","name","custom","fromCSV","hasMany","Array","isArray","relationTo","value","parsed","parseFloat","isNaN","toLowerCase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;oBAC7B,OAAOA,MAAMI,WAAW,OAAO,UAAUJ,UAAU;gBACrD;gBACA,OAAOK,QAAQL;YACjB;QACF,OAAO,IAAIb,MAAMI,IAAI,KAAK,QAAQ;YAChC,oCAAoC;YACpC,kCAAkC;YAClCN,MAAM,CAAC,GAAGI,IAAIC,MAAM,GAAGH,MAAMM,IAAI,EAAE,CAAC,GAAG,CAAC,EAAEO,KAAK,EAAE;gBAC/C,IAAI,CAACA,OAAO;oBACV,OAAOA;gBACT;gBACA,oDAAoD;gBACpD,IAAI,OAAOA,UAAU,YAAY,CAACG,MAAMG,KAAKC,KAAK,CAACP,SAAS;oBAC1D,OAAOA;gBACT;gBACA,0BAA0B;gBAC1B,IAAI;oBACF,MAAMQ,OAAO,IAAIF,KAAKN;oBACtB,OAAOG,MAAMK,KAAKC,OAAO,MAAMT,QAAQQ,KAAKE,WAAW;gBACzD,EAAE,OAAM;oBACN,OAAOV;gBACT;YACF;QACF,OAAO,IAAIb,MAAMI,IAAI,KAAK,UAAUJ,MAAMI,IAAI,KAAK,YAAY;YAC7D,qEAAqE;YACrE,kCAAkC;YAClCN,MAAM,CAAC,GAAGI,IAAIC,MAAM,GAAGH,MAAMM,IAAI,EAAE,CAAC,GAAG,CAAC,EAAEO,KAAK,EAAE;gBAC/C,IAAI,OAAOA,UAAU,UAAU;oBAC7B,OAAOA;gBACT;gBACA,IAAI,OAAOA,UAAU,UAAU;oBAC7B,IAAI;wBACF,OAAOW,KAAKJ,KAAK,CAACP;oBACpB,EAAE,OAAM;wBACN,OAAOA;oBACT;gBACF;gBACA,OAAOA;YACT;QACF;IACF;IAEAlB,eAAe;QAAE8B,UAAU1B;QAAsBF;IAAO;IAExD,OAAOC;AACT,EAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { CollectionConfig, Config } from '@ruya.sa/payload';
|
|
2
|
+
import type { ImportExportPluginConfig } from '../types.js';
|
|
3
|
+
export type PluginCollectionsResult = {
|
|
4
|
+
/**
|
|
5
|
+
* Map from target collection slug to the export collection slug to use for it.
|
|
6
|
+
* Only contains entries for collections with custom export collection overrides.
|
|
7
|
+
*/
|
|
8
|
+
customExportSlugMap: Map<string, string>;
|
|
9
|
+
/**
|
|
10
|
+
* Map from target collection slug to the import collection slug to use for it.
|
|
11
|
+
* Only contains entries for collections with custom import collection overrides.
|
|
12
|
+
*/
|
|
13
|
+
customImportSlugMap: Map<string, string>;
|
|
14
|
+
/**
|
|
15
|
+
* All export collections (base + any per-collection overrides)
|
|
16
|
+
*/
|
|
17
|
+
exportCollections: CollectionConfig[];
|
|
18
|
+
/**
|
|
19
|
+
* All import collections (base + any per-collection overrides)
|
|
20
|
+
*/
|
|
21
|
+
importCollections: CollectionConfig[];
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Processes the plugin config and returns export/import collections.
|
|
25
|
+
*
|
|
26
|
+
* - Creates the base export and import collections
|
|
27
|
+
* - Applies top-level overrideExportCollection/overrideImportCollection if provided
|
|
28
|
+
* - For each collection in `pluginConfig.collections` that has a function override
|
|
29
|
+
* for `export` or `import`, applies the override to create customized collections
|
|
30
|
+
*
|
|
31
|
+
* @param config - The Payload config
|
|
32
|
+
* @param pluginConfig - The import/export plugin config
|
|
33
|
+
* @returns Object containing arrays of export and import collections
|
|
34
|
+
*/
|
|
35
|
+
export declare const getPluginCollections: ({ config, pluginConfig, }: {
|
|
36
|
+
config: Config;
|
|
37
|
+
pluginConfig: ImportExportPluginConfig;
|
|
38
|
+
}) => Promise<PluginCollectionsResult>;
|
|
39
|
+
//# sourceMappingURL=getPluginCollections.d.ts.map
|
|
@@ -0,0 +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,kBAAkB,CAAA;AAEhE,OAAO,KAAK,EAA8B,wBAAwB,EAAE,MAAM,aAAa,CAAA;AAKvF,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;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,oBAAoB,8BAG9B;IACD,MAAM,EAAE,MAAM,CAAA;IACd,YAAY,EAAE,wBAAwB,CAAA;CACvC,KAAG,OAAO,CAAC,uBAAuB,CA0GlC,CAAA"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { getExportCollection } from '../export/getExportCollection.js';
|
|
2
|
+
import { getImportCollection } from '../import/getImportCollection.js';
|
|
3
|
+
/**
|
|
4
|
+
* Processes the plugin config and returns export/import collections.
|
|
5
|
+
*
|
|
6
|
+
* - Creates the base export and import collections
|
|
7
|
+
* - Applies top-level overrideExportCollection/overrideImportCollection if provided
|
|
8
|
+
* - For each collection in `pluginConfig.collections` that has a function override
|
|
9
|
+
* for `export` or `import`, applies the override to create customized collections
|
|
10
|
+
*
|
|
11
|
+
* @param config - The Payload config
|
|
12
|
+
* @param pluginConfig - The import/export plugin config
|
|
13
|
+
* @returns Object containing arrays of export and import collections
|
|
14
|
+
*/ export const getPluginCollections = async ({ config, pluginConfig })=>{
|
|
15
|
+
// Get the base export and import collections with default configs (no per-collection settings)
|
|
16
|
+
let baseExportCollection = getExportCollection({
|
|
17
|
+
config,
|
|
18
|
+
pluginConfig
|
|
19
|
+
});
|
|
20
|
+
let baseImportCollection = getImportCollection({
|
|
21
|
+
config,
|
|
22
|
+
pluginConfig
|
|
23
|
+
});
|
|
24
|
+
// Apply top-level collection overrides if provided
|
|
25
|
+
if (pluginConfig.overrideExportCollection && typeof pluginConfig.overrideExportCollection === 'function') {
|
|
26
|
+
baseExportCollection = await pluginConfig.overrideExportCollection({
|
|
27
|
+
collection: baseExportCollection
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
if (pluginConfig.overrideImportCollection && typeof pluginConfig.overrideImportCollection === 'function') {
|
|
31
|
+
baseImportCollection = await pluginConfig.overrideImportCollection({
|
|
32
|
+
collection: baseImportCollection
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
const exportCollections = [];
|
|
36
|
+
const importCollections = [];
|
|
37
|
+
// Maps from target collection slug to the export/import collection slug to use
|
|
38
|
+
const customExportSlugMap = new Map();
|
|
39
|
+
const customImportSlugMap = new Map();
|
|
40
|
+
// Process each collection config for custom collection overrides
|
|
41
|
+
if (pluginConfig.collections && pluginConfig.collections.length > 0) {
|
|
42
|
+
for (const collectionConfig of pluginConfig.collections){
|
|
43
|
+
// Handle export config - only process if overrideCollection is provided
|
|
44
|
+
// Settings like disableJobsQueue require a custom slug to work properly
|
|
45
|
+
const exportConfig = typeof collectionConfig.export === 'object' ? collectionConfig.export : undefined;
|
|
46
|
+
if (exportConfig?.overrideCollection) {
|
|
47
|
+
// Generate a collection with this export config's settings (like disableJobsQueue)
|
|
48
|
+
const collectionWithSettings = getExportCollection({
|
|
49
|
+
config,
|
|
50
|
+
exportConfig,
|
|
51
|
+
pluginConfig
|
|
52
|
+
});
|
|
53
|
+
const customExport = await exportConfig.overrideCollection({
|
|
54
|
+
collection: collectionWithSettings
|
|
55
|
+
});
|
|
56
|
+
// If the slug changed, this is a separate collection; otherwise it modifies the base
|
|
57
|
+
if (customExport.slug !== baseExportCollection.slug) {
|
|
58
|
+
exportCollections.push(customExport);
|
|
59
|
+
// Map this target collection to its custom export collection
|
|
60
|
+
customExportSlugMap.set(collectionConfig.slug, customExport.slug);
|
|
61
|
+
} else {
|
|
62
|
+
// Full override - replace the base
|
|
63
|
+
baseExportCollection = customExport;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
// Handle import config - only process if overrideCollection is provided
|
|
67
|
+
// Settings like disableJobsQueue require a custom slug to work properly
|
|
68
|
+
const importConf = typeof collectionConfig.import === 'object' ? collectionConfig.import : undefined;
|
|
69
|
+
if (importConf?.overrideCollection) {
|
|
70
|
+
// Generate a collection with this import config's settings (like disableJobsQueue)
|
|
71
|
+
const collectionWithSettings = getImportCollection({
|
|
72
|
+
config,
|
|
73
|
+
importConfig: importConf,
|
|
74
|
+
pluginConfig
|
|
75
|
+
});
|
|
76
|
+
const customImport = await importConf.overrideCollection({
|
|
77
|
+
collection: collectionWithSettings
|
|
78
|
+
});
|
|
79
|
+
// If the slug changed, this is a separate collection; otherwise it modifies the base
|
|
80
|
+
if (customImport.slug !== baseImportCollection.slug) {
|
|
81
|
+
importCollections.push(customImport);
|
|
82
|
+
// Map this target collection to its custom import collection
|
|
83
|
+
customImportSlugMap.set(collectionConfig.slug, customImport.slug);
|
|
84
|
+
} else {
|
|
85
|
+
// Full override - replace the base
|
|
86
|
+
baseImportCollection = customImport;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
// Add base collections to the front of the arrays
|
|
92
|
+
exportCollections.unshift(baseExportCollection);
|
|
93
|
+
importCollections.unshift(baseImportCollection);
|
|
94
|
+
return {
|
|
95
|
+
customExportSlugMap,
|
|
96
|
+
customImportSlugMap,
|
|
97
|
+
exportCollections,
|
|
98
|
+
importCollections
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
//# sourceMappingURL=getPluginCollections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utilities/getPluginCollections.ts"],"sourcesContent":["import type { CollectionConfig, Config } from '@ruya.sa/payload'\n\nimport type { ExportConfig, ImportConfig, ImportExportPluginConfig } from '../types.js'\n\nimport { getExportCollection } from '../export/getExportCollection.js'\nimport { getImportCollection } from '../import/getImportCollection.js'\n\nexport type PluginCollectionsResult = {\n /**\n * Map from target collection slug to the export collection slug to use for it.\n * Only contains entries for collections with custom export collection overrides.\n */\n customExportSlugMap: Map<string, string>\n /**\n * Map from target collection slug to the import collection slug to use for it.\n * Only contains entries for collections with custom import collection overrides.\n */\n customImportSlugMap: Map<string, string>\n /**\n * All export collections (base + any per-collection overrides)\n */\n exportCollections: CollectionConfig[]\n /**\n * All import collections (base + any per-collection overrides)\n */\n importCollections: CollectionConfig[]\n}\n\n/**\n * Processes the plugin config and returns export/import collections.\n *\n * - Creates the base export and import collections\n * - Applies top-level overrideExportCollection/overrideImportCollection if provided\n * - For each collection in `pluginConfig.collections` that has a function override\n * for `export` or `import`, applies the override to create customized collections\n *\n * @param config - The Payload config\n * @param pluginConfig - The import/export plugin config\n * @returns Object containing arrays of export and import collections\n */\nexport const getPluginCollections = async ({\n config,\n pluginConfig,\n}: {\n config: Config\n pluginConfig: ImportExportPluginConfig\n}): Promise<PluginCollectionsResult> => {\n // Get the base export and import collections with default configs (no per-collection settings)\n let baseExportCollection = getExportCollection({\n config,\n pluginConfig,\n })\n let baseImportCollection = getImportCollection({\n config,\n pluginConfig,\n })\n\n // Apply top-level collection overrides if provided\n if (\n pluginConfig.overrideExportCollection &&\n typeof pluginConfig.overrideExportCollection === 'function'\n ) {\n baseExportCollection = await pluginConfig.overrideExportCollection({\n collection: baseExportCollection,\n })\n }\n\n if (\n pluginConfig.overrideImportCollection &&\n typeof pluginConfig.overrideImportCollection === 'function'\n ) {\n baseImportCollection = await pluginConfig.overrideImportCollection({\n collection: baseImportCollection,\n })\n }\n\n const exportCollections: CollectionConfig[] = []\n const importCollections: CollectionConfig[] = []\n\n // Maps from target collection slug to the export/import collection slug to use\n const customExportSlugMap = new Map<string, string>()\n const customImportSlugMap = new Map<string, string>()\n\n // Process each collection config for custom collection overrides\n if (pluginConfig.collections && pluginConfig.collections.length > 0) {\n for (const collectionConfig of pluginConfig.collections) {\n // Handle export config - only process if overrideCollection is provided\n // Settings like disableJobsQueue require a custom slug to work properly\n const exportConfig =\n typeof collectionConfig.export === 'object' ? collectionConfig.export : undefined\n if (exportConfig?.overrideCollection) {\n // Generate a collection with this export config's settings (like disableJobsQueue)\n const collectionWithSettings = getExportCollection({\n config,\n exportConfig,\n pluginConfig,\n })\n\n const customExport = await exportConfig.overrideCollection({\n collection: collectionWithSettings,\n })\n\n // If the slug changed, this is a separate collection; otherwise it modifies the base\n if (customExport.slug !== baseExportCollection.slug) {\n exportCollections.push(customExport)\n // Map this target collection to its custom export collection\n customExportSlugMap.set(collectionConfig.slug, customExport.slug)\n } else {\n // Full override - replace the base\n baseExportCollection = customExport\n }\n }\n\n // Handle import config - only process if overrideCollection is provided\n // Settings like disableJobsQueue require a custom slug to work properly\n const importConf =\n typeof collectionConfig.import === 'object' ? collectionConfig.import : undefined\n if (importConf?.overrideCollection) {\n // Generate a collection with this import config's settings (like disableJobsQueue)\n const collectionWithSettings = getImportCollection({\n config,\n importConfig: importConf,\n pluginConfig,\n })\n\n const customImport = await importConf.overrideCollection({\n collection: collectionWithSettings,\n })\n\n // If the slug changed, this is a separate collection; otherwise it modifies the base\n if (customImport.slug !== baseImportCollection.slug) {\n importCollections.push(customImport)\n // Map this target collection to its custom import collection\n customImportSlugMap.set(collectionConfig.slug, customImport.slug)\n } else {\n // Full override - replace the base\n baseImportCollection = customImport\n }\n }\n }\n }\n\n // Add base collections to the front of the arrays\n exportCollections.unshift(baseExportCollection)\n importCollections.unshift(baseImportCollection)\n\n return {\n customExportSlugMap,\n customImportSlugMap,\n exportCollections,\n importCollections,\n }\n}\n"],"names":["getExportCollection","getImportCollection","getPluginCollections","config","pluginConfig","baseExportCollection","baseImportCollection","overrideExportCollection","collection","overrideImportCollection","exportCollections","importCollections","customExportSlugMap","Map","customImportSlugMap","collections","length","collectionConfig","exportConfig","export","undefined","overrideCollection","collectionWithSettings","customExport","slug","push","set","importConf","import","importConfig","customImport","unshift"],"mappings":"AAIA,SAASA,mBAAmB,QAAQ,mCAAkC;AACtE,SAASC,mBAA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