@payloadcms/plugin-import-export 4.0.0-internal.f15737c → 4.0.0-internal.f2a04f7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/export/getFields.js.map +1 -1
- package/package.json +22 -22
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/export/getFields.ts"],"sourcesContent":["import type { TFunction } from '@payloadcms/translations'\nimport type { Config, Field, PayloadRequest, SelectField } from 'payload'\n\nimport { getFilename } from '../utilities/getFilename.js'\nimport { validateLimitValue } from '../utilities/validateLimitValue.js'\n\ntype GetFieldsOptions = {\n /**\n * Collection slugs that this export collection supports.\n * Used for schema/types and as the options in the select field.\n */\n collectionSlugs: string[]\n config: Config\n /**\n * Force a specific format, hiding the format dropdown\n */\n format?: 'csv' | 'json'\n}\n\nexport const getFields = (options: GetFieldsOptions): Field[] => {\n const { collectionSlugs, config, format } = options\n\n let localeField: SelectField | undefined\n\n if (config.localization) {\n localeField = {\n name: 'locale',\n type: 'select',\n admin: {\n components: {\n Field: '@payloadcms/plugin-import-export/rsc#LocaleField',\n },\n width: '25%',\n },\n defaultValue: 'all',\n // @ts-expect-error - this is not correctly typed in plugins right now\n label: ({ t }) => t('plugin-import-export:field-locale-label'),\n options: [\n {\n label: ({ t }) => t('general:allLocales'),\n value: 'all',\n },\n ...config.localization.locales.map((locale) => ({\n label: typeof locale === 'string' ? locale : locale.label,\n value: typeof locale === 'string' ? locale : locale.code,\n })),\n ],\n }\n }\n\n return [\n {\n type: 'collapsible',\n fields: [\n {\n name: 'name',\n type: 'text',\n defaultValue: () => getFilename(),\n // @ts-expect-error - this is not correctly typed in plugins right now\n label: ({ t }) => t('plugin-import-export:field-name-label'),\n },\n {\n type: 'row',\n fields: [\n {\n name: 'format',\n type: 'select',\n admin: {\n components: {\n Field: '@payloadcms/plugin-import-export/rsc#FormatField',\n },\n width: '33.3333%',\n },\n defaultValue: format ?? 'csv',\n // @ts-expect-error - this is not correctly typed in plugins right now\n label: ({ t }) => t('plugin-import-export:field-format-label'),\n options: [\n {\n label: 'CSV',\n value: 'csv',\n },\n {\n label: 'JSON',\n value: 'json',\n },\n ],\n required: true,\n },\n {\n name: 'limit',\n type: 'number',\n admin: {\n components: {\n Field: '@payloadcms/plugin-import-export/rsc#LimitField',\n },\n placeholder: 'No limit',\n step: 100,\n width: '33.3333%',\n },\n validate: (value: null | number | undefined, { req }: { req: { t: TFunction } }) => {\n return validateLimitValue(value, req.t) ?? true\n },\n // @ts-expect-error - this is not correctly typed in plugins right now\n label: ({ t }) => t('plugin-import-export:field-limit-label'),\n },\n {\n name: 'page',\n type: 'number',\n admin: {\n components: {\n Field: '@payloadcms/plugin-import-export/rsc#Page',\n },\n condition: ({ limit }) => {\n // Show the page field only if limit is set\n return typeof limit === 'number' && limit !== 0\n },\n width: '33.3333%',\n },\n defaultValue: 1,\n // @ts-expect-error - this is not correctly typed in plugins right now\n label: ({ t }) => t('plugin-import-export:field-page-label'),\n },\n ],\n },\n {\n type: 'row',\n fields: [\n {\n name: 'sort',\n type: 'text',\n admin: {\n components: {\n Field: '@payloadcms/plugin-import-export/rsc#SortBy',\n },\n },\n // @ts-expect-error - this is not correctly typed in plugins right now\n label: ({ t }) => t('plugin-import-export:field-sort-label'),\n },\n {\n name: 'sortOrder',\n type: 'select',\n admin: {\n components: {\n Field: '@payloadcms/plugin-import-export/rsc#SortOrder',\n },\n // Only show when `sort` has a value\n condition: ({ sort }) => typeof sort === 'string' && sort.trim().length > 0,\n },\n // @ts-expect-error - this is not correctly typed in plugins right now\n label: ({ t }) => t('plugin-import-export:field-sort-order-label'),\n options: [\n { label: 'Ascending', value: 'asc' },\n { label: 'Descending', value: 'desc' },\n ],\n },\n ...(localeField ? [localeField] : []),\n {\n name: 'drafts',\n type: 'select',\n admin: {\n condition: (data) => {\n const collectionConfig = (config.collections ?? []).find(\n (collection) => collection.slug === data.collectionSlug,\n )\n return Boolean(\n typeof collectionConfig?.versions === 'object' &&\n collectionConfig?.versions?.drafts,\n )\n },\n width: '25%',\n },\n defaultValue: 'yes',\n // @ts-expect-error - this is not correctly typed in plugins right now\n label: ({ t }) => t('plugin-import-export:field-drafts-label'),\n options: [\n {\n label: ({ t }) => t('general:yes'),\n value: 'yes',\n },\n {\n label: ({ t }) => t('general:no'),\n value: 'no',\n },\n ],\n },\n // {\n // name: 'depth',\n // type: 'number',\n // // @ts-expect-error - this is not correctly typed in plugins right now\n // label: ({ t }) => t('plugin-import-export:field-depth-label'),\n // admin: {\n // width: '33%',\n // },\n // defaultValue: 1,\n // required: true,\n // },\n ],\n },\n {\n name: 'selectionToUse',\n type: 'radio',\n admin: {\n components: {\n Field: '@payloadcms/plugin-import-export/rsc#SelectionToUseField',\n },\n },\n options: [\n {\n // @ts-expect-error - this is not correctly typed in plugins right now\n label: ({ t }) => t('plugin-import-export:selectionToUse-currentSelection'),\n value: 'currentSelection',\n },\n {\n // @ts-expect-error - this is not correctly typed in plugins right now\n label: ({ t }) => t('plugin-import-export:selectionToUse-currentFilters'),\n value: 'currentFilters',\n },\n {\n // @ts-expect-error - this is not correctly typed in plugins right now\n label: ({ t }) => t('plugin-import-export:selectionToUse-allDocuments'),\n value: 'all',\n },\n ],\n virtual: true,\n },\n {\n name: 'fields',\n type: 'text',\n admin: {\n components: {\n Field: '@payloadcms/plugin-import-export/rsc#FieldsToExport',\n },\n },\n hasMany: true,\n // @ts-expect-error - this is not correctly typed in plugins right now\n label: ({ t }) => t('plugin-import-export:field-fields-label'),\n },\n {\n name: 'collectionSlug',\n type: 'text',\n admin: {\n components: {\n Field: '@payloadcms/plugin-import-export/rsc#CollectionField',\n },\n },\n defaultValue: collectionSlugs[0],\n required: true,\n validate: (value: null | string | undefined, { req }: { req: PayloadRequest }) => {\n if (!value) {\n return 'Collection is required'\n }\n // Validate that the collection exists\n const collectionExists = req?.payload?.collections?.[value]\n if (!collectionExists) {\n return `Collection \"${value}\" does not exist`\n }\n return true\n },\n },\n {\n name: 'where',\n type: 'json',\n admin: {\n hidden: true,\n },\n defaultValue: {},\n hooks: {\n beforeValidate: [\n ({ value }) => {\n return value ?? {}\n },\n ],\n },\n },\n ],\n // @ts-expect-error - this is not correctly typed in plugins right now\n label: ({ t }) => t('plugin-import-export:exportOptions'),\n },\n {\n name: 'preview',\n type: 'ui',\n admin: {\n components: {\n Field: '@payloadcms/plugin-import-export/rsc#ExportPreview',\n },\n },\n },\n ]\n}\n"],"names":["getFilename","validateLimitValue","getFields","options","collectionSlugs","config","format","localeField","localization","name","type","admin","components","Field","width","defaultValue","label","t","value","locales","map","locale","code","fields","required","placeholder","step","validate","req","condition","limit","sort","trim","length","data","collectionConfig","collections","find","collection","slug","collectionSlug","Boolean","versions","drafts","virtual","hasMany","collectionExists","payload","hidden","hooks","beforeValidate"],"mappings":"AAGA,SAASA,WAAW,QAAQ,8BAA6B;AACzD,SAASC,kBAAkB,QAAQ,qCAAoC;AAevE,OAAO,MAAMC,YAAY,CAACC;IACxB,MAAM,EAAEC,eAAe,EAAEC,MAAM,EAAEC,MAAM,EAAE,GAAGH;IAE5C,IAAII;IAEJ,IAAIF,OAAOG,YAAY,EAAE;QACvBD,cAAc;YACZE,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,YAAY;oBACVC,OAAO;gBACT;gBACAC,OAAO;YACT;YACAC,cAAc;YACd,sEAAsE;YACtEC,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAKA,EAAE;YACpBd,SAAS;gBACP;oBACEa,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAKA,EAAE;oBACpBC,OAAO;gBACT;mBACGb,OAAOG,YAAY,CAACW,OAAO,CAACC,GAAG,CAAC,CAACC,SAAY,CAAA;wBAC9CL,OAAO,OAAOK,WAAW,WAAWA,SAASA,OAAOL,KAAK;wBACzDE,OAAO,OAAOG,WAAW,WAAWA,SAASA,OAAOC,IAAI;oBAC1D,CAAA;aACD;QACH;IACF;IAEA,OAAO;QACL;YACEZ,MAAM;YACNa,QAAQ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ACE,sEAAsE;4BACtEF,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAKA,EAAE;4BACpBC,OAAO;wBACT;wBACA;4BACE,sEAAsE;4BACtEF,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAKA,EAAE;4BACpBC,OAAO;wBACT;qBACD;oBACD0B,SAAS;gBACX;gBACA;oBACEnC,MAAM;oBACNC,MAAM;oBACNC,OAAO;wBACLC,YAAY;4BACVC,OAAO;wBACT;oBACF;oBACAgC,SAAS;oBACT,sEAAsE;oBACtE7B,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAKA,EAAE;gBACtB;gBACA;oBACER,MAAM;oBACNC,MAAM;oBACNC,OAAO;wBACLC,YAAY;4BACVC,OAAO;wBACT;oBACF;oBACAE,cAAcX,eAAe,CAAC,EAAE;oBAChCoB,UAAU;oBACVG,UAAU,CAACT,OAAkC,EAAEU,GAAG,EAA2B;wBAC3E,IAAI,CAACV,OAAO;4BACV,OAAO;wBACT;wBACA,sCAAsC;wBACtC,MAAM4B,mBAAmBlB,KAAKmB,SAASX,aAAa,CAAClB,MAAM;wBAC3D,IAAI,CAAC4B,kBAAkB;4BACrB,OAAO,CAAC,YAAY,EAAE5B,MAAM,gBAAgB,CAAC;wBAC/C;wBACA,OAAO;oBACT;gBACF;gBACA;oBACET,MAAM;oBACNC,MAAM;oBACNC,OAAO;wBACLqC,QAAQ;oBACV;oBACAjC,cAAc,CAAC;oBACfkC,OAAO;wBACLC,gBAAgB;4BACd,CAAC,EAAEhC,KAAK,EAAE;gCACR,OAAOA,SAAS,CAAC;4BACnB;yBACD;oBACH;gBACF;aACD;YACD,sEAAsE;YACtEF,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAKA,EAAE;QACtB;QACA;YACER,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,YAAY;oBACVC,OAAO;gBACT;YACF;QACF;KACD;AACH,EAAC"}
|
|
1
|
+
{"version":3,"sources":["../../src/export/getFields.ts"],"sourcesContent":["import type { TFunction } from '@payloadcms/translations'\nimport type { Config, Field, PayloadRequest, SelectField } from 'payload'\n\nimport { getFilename } from '../utilities/getFilename.js'\nimport { validateLimitValue } from '../utilities/validateLimitValue.js'\n\ntype GetFieldsOptions = {\n /**\n * Collection slugs that this export collection supports.\n * Used for schema/types and as the options in the select field.\n */\n collectionSlugs: string[]\n config: Config\n /**\n * Force a specific format, hiding the format dropdown\n */\n format?: 'csv' | 'json'\n}\n\nexport const getFields = (options: GetFieldsOptions): Field[] => {\n const { collectionSlugs, config, format } = options\n\n let localeField: SelectField | undefined\n\n if (config.localization) {\n localeField = {\n name: 'locale',\n type: 'select',\n admin: {\n components: {\n Field: '@payloadcms/plugin-import-export/rsc#LocaleField',\n },\n width: '25%',\n },\n defaultValue: 'all',\n // @ts-expect-error - this is not correctly typed in plugins right now\n label: ({ t }) => t('plugin-import-export:field-locale-label'),\n options: [\n {\n label: ({ t }) => t('general:allLocales'),\n value: 'all',\n },\n ...config.localization.locales.map((locale) => ({\n label: typeof locale === 'string' ? locale : locale.label,\n value: typeof locale === 'string' ? locale : locale.code,\n })),\n ],\n }\n }\n\n return [\n {\n type: 'collapsible',\n fields: [\n {\n name: 'name',\n type: 'text',\n defaultValue: () => getFilename(),\n // @ts-expect-error - this is not correctly typed in plugins right now\n label: ({ t }) => t('plugin-import-export:field-name-label'),\n },\n {\n type: 'row',\n fields: [\n {\n name: 'format',\n type: 'select',\n admin: {\n components: {\n Field: '@payloadcms/plugin-import-export/rsc#FormatField',\n },\n width: '33.3333%',\n },\n defaultValue: format ?? 'csv',\n // @ts-expect-error - this is not correctly typed in plugins right now\n label: ({ t }) => t('plugin-import-export:field-format-label'),\n options: [\n {\n label: 'CSV',\n value: 'csv',\n },\n {\n label: 'JSON',\n value: 'json',\n },\n ],\n required: true,\n },\n {\n name: 'limit',\n type: 'number',\n admin: {\n components: {\n Field: '@payloadcms/plugin-import-export/rsc#LimitField',\n },\n placeholder: 'No limit',\n step: 100,\n width: '33.3333%',\n },\n validate: (value: null | number | undefined, { req }: { req: { t: TFunction } }) => {\n return validateLimitValue(value, req.t) ?? true\n },\n // @ts-expect-error - this is not correctly typed in plugins right now\n label: ({ t }) => t('plugin-import-export:field-limit-label'),\n },\n {\n name: 'page',\n type: 'number',\n admin: {\n components: {\n Field: '@payloadcms/plugin-import-export/rsc#Page',\n },\n condition: ({ limit }) => {\n // Show the page field only if limit is set\n return typeof limit === 'number' && limit !== 0\n },\n width: '33.3333%',\n },\n defaultValue: 1,\n // @ts-expect-error - this is not correctly typed in plugins right now\n label: ({ t }) => t('plugin-import-export:field-page-label'),\n },\n ],\n },\n {\n type: 'row',\n fields: [\n {\n name: 'sort',\n type: 'text',\n admin: {\n components: {\n Field: '@payloadcms/plugin-import-export/rsc#SortBy',\n },\n },\n // @ts-expect-error - this is not correctly typed in plugins right now\n label: ({ t }) => t('plugin-import-export:field-sort-label'),\n },\n {\n name: 'sortOrder',\n type: 'select',\n admin: {\n components: {\n Field: '@payloadcms/plugin-import-export/rsc#SortOrder',\n },\n // Only show when `sort` has a value\n condition: ({ sort }) => typeof sort === 'string' && sort.trim().length > 0,\n },\n // @ts-expect-error - this is not correctly typed in plugins right now\n label: ({ t }) => t('plugin-import-export:field-sort-order-label'),\n options: [\n { label: 'Ascending', value: 'asc' },\n { label: 'Descending', value: 'desc' },\n ],\n },\n ...(localeField ? [localeField] : []),\n {\n name: 'drafts',\n type: 'select',\n admin: {\n condition: (data) => {\n const collectionConfig = (config.collections ?? []).find(\n (collection) => collection.slug === data.collectionSlug,\n )\n return Boolean(\n typeof collectionConfig?.versions === 'object' &&\n collectionConfig?.versions?.drafts,\n )\n },\n width: '25%',\n },\n defaultValue: 'yes',\n // @ts-expect-error - this is not correctly typed in plugins right now\n label: ({ t }) => t('plugin-import-export:field-drafts-label'),\n options: [\n {\n label: ({ t }) => t('general:yes'),\n value: 'yes',\n },\n {\n label: ({ t }) => t('general:no'),\n value: 'no',\n },\n ],\n },\n // {\n // name: 'depth',\n // type: 'number',\n // // @ts-expect-error - this is not correctly typed in plugins right now\n // label: ({ t }) => t('plugin-import-export:field-depth-label'),\n // admin: {\n // width: '33%',\n // },\n // defaultValue: 1,\n // required: true,\n // },\n ],\n },\n {\n name: 'selectionToUse',\n type: 'radio',\n admin: {\n components: {\n Field: '@payloadcms/plugin-import-export/rsc#SelectionToUseField',\n },\n },\n options: [\n {\n // @ts-expect-error - this is not correctly typed in plugins right now\n label: ({ t }) => t('plugin-import-export:selectionToUse-currentSelection'),\n value: 'currentSelection',\n },\n {\n // @ts-expect-error - this is not correctly typed in plugins right now\n label: ({ t }) => t('plugin-import-export:selectionToUse-currentFilters'),\n value: 'currentFilters',\n },\n {\n // @ts-expect-error - this is not correctly typed in plugins right now\n label: ({ t }) => t('plugin-import-export:selectionToUse-allDocuments'),\n value: 'all',\n },\n ],\n virtual: true,\n },\n {\n name: 'fields',\n type: 'text',\n admin: {\n components: {\n Field: '@payloadcms/plugin-import-export/rsc#FieldsToExport',\n },\n },\n hasMany: true,\n // @ts-expect-error - this is not correctly typed in plugins right now\n label: ({ t }) => t('plugin-import-export:field-fields-label'),\n },\n {\n name: 'collectionSlug',\n type: 'text',\n admin: {\n components: {\n Field: '@payloadcms/plugin-import-export/rsc#CollectionField',\n },\n },\n defaultValue: collectionSlugs[0],\n required: true,\n validate: (value: null | string | undefined, { req }: { req: PayloadRequest }) => {\n if (!value) {\n return 'Collection is required'\n }\n // Validate that the collection exists\n const collectionExists = req?.payload?.collections?.[value]\n if (!collectionExists) {\n return `Collection \"${value}\" does not exist`\n }\n return true\n },\n },\n {\n name: 'where',\n type: 'json',\n admin: {\n hidden: true,\n },\n defaultValue: {},\n hooks: {\n beforeValidate: [\n ({ value }) => {\n return value ?? {}\n },\n ],\n },\n },\n ],\n // @ts-expect-error - this is not correctly typed in plugins right now\n label: ({ t }) => t('plugin-import-export:exportOptions'),\n },\n {\n name: 'preview',\n type: 'ui',\n admin: {\n components: {\n Field: '@payloadcms/plugin-import-export/rsc#ExportPreview',\n },\n },\n },\n ]\n}\n"],"names":["getFilename","validateLimitValue","getFields","options","collectionSlugs","config","format","localeField","localization","name","type","admin","components","Field","width","defaultValue","label","t","value","locales","map","locale","code","fields","required","placeholder","step","validate","req","condition","limit","sort","trim","length","data","collectionConfig","collections","find","collection","slug","collectionSlug","Boolean","versions","drafts","virtual","hasMany","collectionExists","payload","hidden","hooks","beforeValidate"],"mappings":"AAGA,SAASA,WAAW,QAAQ,8BAA6B;AACzD,SAASC,kBAAkB,QAAQ,qCAAoC;AAevE,OAAO,MAAMC,YAAY,CAACC;IACxB,MAAM,EAAEC,eAAe,EAAEC,MAAM,EAAEC,MAAM,EAAE,GAAGH;IAE5C,IAAII;IAEJ,IAAIF,OAAOG,YAAY,EAAE;QACvBD,cAAc;YACZE,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,YAAY;oBACVC,OAAO;gBACT;gBACAC,OAAO;YACT;YACAC,cAAc;YACd,sEAAsE;YACtEC,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAKA,EAAE;YACpBd,SAAS;gBACP;oBACEa,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAKA,EAAE;oBACpBC,OAAO;gBACT;mBACGb,OAAOG,YAAY,CAACW,OAAO,CAACC,GAAG,CAAC,CAACC,SAAY,CAAA;wBAC9CL,OAAO,OAAOK,WAAW,WAAWA,SAASA,OAAOL,KAAK;wBACzDE,OAAO,OAAOG,WAAW,WAAWA,SAASA,OAAOC,IAAI;oBAC1D,CAAA;aACD;QACH;IACF;IAEA,OAAO;QACL;YACEZ,MAAM;YACNa,QAAQ;gBACN;oBACEd,MAAM;oBACNC,MAAM;oBACNK,cAAc,IAAMf;oBACpB,sEAAsE;oBACtEgB,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAKA,EAAE;gBACtB;gBACA;oBACEP,MAAM;oBACNa,QAAQ;wBACN;4BACEd,MAAM;4BACNC,MAAM;4BACNC,OAAO;gCACLC,YAAY;oCACVC,OAAO;gCACT;gCACAC,OAAO;4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LC,YAAY;4BACVC,OAAO;wBACT;oBACF;oBACAgC,SAAS;oBACT,sEAAsE;oBACtE7B,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAKA,EAAE;gBACtB;gBACA;oBACER,MAAM;oBACNC,MAAM;oBACNC,OAAO;wBACLC,YAAY;4BACVC,OAAO;wBACT;oBACF;oBACAE,cAAcX,eAAe,CAAC,EAAE;oBAChCoB,UAAU;oBACVG,UAAU,CAACT,OAAkC,EAAEU,GAAG,EAA2B;wBAC3E,IAAI,CAACV,OAAO;4BACV,OAAO;wBACT;wBACA,sCAAsC;wBACtC,MAAM4B,mBAAmBlB,KAAKmB,SAASX,aAAa,CAAClB,MAAM;wBAC3D,IAAI,CAAC4B,kBAAkB;4BACrB,OAAO,CAAC,YAAY,EAAE5B,MAAM,gBAAgB,CAAC;wBAC/C;wBACA,OAAO;oBACT;gBACF;gBACA;oBACET,MAAM;oBACNC,MAAM;oBACNC,OAAO;wBACLqC,QAAQ;oBACV;oBACAjC,cAAc,CAAC;oBACfkC,OAAO;wBACLC,gBAAgB;4BACd,CAAC,EAAEhC,KAAK,EAAE;gCACR,OAAOA,SAAS,CAAC;4BACnB;yBACD;oBACH;gBACF;aACD;YACD,sEAAsE;YACtEF,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAKA,EAAE;QACtB;QACA;YACER,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,YAAY;oBACVC,OAAO;gBACT;YACF;QACF;KACD;AACH,EAAC"}
|
package/package.json
CHANGED
|
@@ -1,22 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/plugin-import-export",
|
|
3
|
-
"version": "4.0.0-internal.
|
|
3
|
+
"version": "4.0.0-internal.f2a04f7",
|
|
4
4
|
"description": "Import-Export plugin for Payload",
|
|
5
5
|
"keywords": [
|
|
6
|
-
"payload",
|
|
7
6
|
"cms",
|
|
7
|
+
"export",
|
|
8
|
+
"import",
|
|
9
|
+
"nextjs",
|
|
10
|
+
"payload",
|
|
8
11
|
"plugin",
|
|
9
|
-
"typescript",
|
|
10
12
|
"react",
|
|
11
|
-
"
|
|
12
|
-
"import",
|
|
13
|
-
"export"
|
|
13
|
+
"typescript"
|
|
14
14
|
],
|
|
15
|
-
"repository": {
|
|
16
|
-
"type": "git",
|
|
17
|
-
"url": "https://github.com/payloadcms/payload.git",
|
|
18
|
-
"directory": "packages/plugin-import-export"
|
|
19
|
-
},
|
|
20
15
|
"license": "MIT",
|
|
21
16
|
"author": "Payload <dev@payloadcms.com> (https://payloadcms.com)",
|
|
22
17
|
"maintainers": [
|
|
@@ -26,7 +21,17 @@
|
|
|
26
21
|
"url": "https://payloadcms.com"
|
|
27
22
|
}
|
|
28
23
|
],
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "https://github.com/payloadcms/payload.git",
|
|
27
|
+
"directory": "packages/plugin-import-export"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"dist"
|
|
31
|
+
],
|
|
29
32
|
"type": "module",
|
|
33
|
+
"main": "./dist/index.js",
|
|
34
|
+
"types": "./dist/index.d.ts",
|
|
30
35
|
"exports": {
|
|
31
36
|
".": {
|
|
32
37
|
"import": "./dist/index.js",
|
|
@@ -54,27 +59,22 @@
|
|
|
54
59
|
"default": "./dist/translations/languages/*.js"
|
|
55
60
|
}
|
|
56
61
|
},
|
|
57
|
-
"main": "./dist/index.js",
|
|
58
|
-
"types": "./dist/index.d.ts",
|
|
59
|
-
"files": [
|
|
60
|
-
"dist"
|
|
61
|
-
],
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"@faceless-ui/modal": "3.0.2",
|
|
64
64
|
"csv-parse": "5.6.0",
|
|
65
65
|
"csv-stringify": "6.5.2",
|
|
66
66
|
"qs-esm": "8.0.1",
|
|
67
|
-
"@payloadcms/
|
|
68
|
-
"@payloadcms/
|
|
67
|
+
"@payloadcms/translations": "4.0.0-internal.f2a04f7",
|
|
68
|
+
"@payloadcms/ui": "4.0.0-internal.f2a04f7"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@payloadcms/eslint-config": "3.28.0",
|
|
72
|
-
"@payloadcms/ui": "4.0.0-internal.
|
|
73
|
-
"payload": "4.0.0-internal.
|
|
72
|
+
"@payloadcms/ui": "4.0.0-internal.f2a04f7",
|
|
73
|
+
"payload": "4.0.0-internal.f2a04f7"
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
|
76
|
-
"@payloadcms/ui": "4.0.0-internal.
|
|
77
|
-
"payload": "4.0.0-internal.
|
|
76
|
+
"@payloadcms/ui": "4.0.0-internal.f2a04f7",
|
|
77
|
+
"payload": "4.0.0-internal.f2a04f7"
|
|
78
78
|
},
|
|
79
79
|
"homepage:": "https://payloadcms.com",
|
|
80
80
|
"scripts": {
|