@strapi/i18n 0.0.0-next.86f7c82a340bd1cb833f5f785b8001df5461c5a9 → 0.0.0-next.88599e70ce0e4e804e2bad578aba4718c5a5304d

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/dist/admin/components/CMHeaderActions.js +116 -1
  2. package/dist/admin/components/CMHeaderActions.js.map +1 -1
  3. package/dist/admin/components/CMHeaderActions.mjs +119 -5
  4. package/dist/admin/components/CMHeaderActions.mjs.map +1 -1
  5. package/dist/admin/components/LocaleListCell.js +65 -45
  6. package/dist/admin/components/LocaleListCell.js.map +1 -1
  7. package/dist/admin/components/LocaleListCell.mjs +66 -46
  8. package/dist/admin/components/LocaleListCell.mjs.map +1 -1
  9. package/dist/admin/components/LocalePicker.js +18 -11
  10. package/dist/admin/components/LocalePicker.js.map +1 -1
  11. package/dist/admin/components/LocalePicker.mjs +19 -12
  12. package/dist/admin/components/LocalePicker.mjs.map +1 -1
  13. package/dist/admin/contentManagerHooks/editView.js +6 -3
  14. package/dist/admin/contentManagerHooks/editView.js.map +1 -1
  15. package/dist/admin/contentManagerHooks/editView.mjs +7 -4
  16. package/dist/admin/contentManagerHooks/editView.mjs.map +1 -1
  17. package/dist/admin/contentManagerHooks/listView.js +2 -1
  18. package/dist/admin/contentManagerHooks/listView.js.map +1 -1
  19. package/dist/admin/contentManagerHooks/listView.mjs +2 -1
  20. package/dist/admin/contentManagerHooks/listView.mjs.map +1 -1
  21. package/dist/admin/index.js +1 -0
  22. package/dist/admin/index.js.map +1 -1
  23. package/dist/admin/index.mjs +2 -1
  24. package/dist/admin/index.mjs.map +1 -1
  25. package/dist/admin/pages/SettingsPage.js +121 -46
  26. package/dist/admin/pages/SettingsPage.js.map +1 -1
  27. package/dist/admin/pages/SettingsPage.mjs +124 -30
  28. package/dist/admin/pages/SettingsPage.mjs.map +1 -1
  29. package/dist/admin/services/api.js +2 -1
  30. package/dist/admin/services/api.js.map +1 -1
  31. package/dist/admin/services/api.mjs +2 -1
  32. package/dist/admin/services/api.mjs.map +1 -1
  33. package/dist/admin/services/settings.js +29 -0
  34. package/dist/admin/services/settings.js.map +1 -0
  35. package/dist/admin/services/settings.mjs +26 -0
  36. package/dist/admin/services/settings.mjs.map +1 -0
  37. package/dist/admin/src/components/CMHeaderActions.d.ts +7 -1
  38. package/dist/admin/src/components/LocaleListCell.d.ts +2 -1
  39. package/dist/admin/src/services/api.d.ts +1 -1
  40. package/dist/admin/src/services/locales.d.ts +1 -1
  41. package/dist/admin/src/services/relations.d.ts +1 -1
  42. package/dist/admin/src/services/settings.d.ts +5 -0
  43. package/dist/admin/translations/en.json.js +7 -0
  44. package/dist/admin/translations/en.json.js.map +1 -1
  45. package/dist/admin/translations/en.json.mjs +7 -0
  46. package/dist/admin/translations/en.json.mjs.map +1 -1
  47. package/dist/admin/utils/clean.js +2 -2
  48. package/dist/admin/utils/clean.js.map +1 -1
  49. package/dist/admin/utils/clean.mjs +2 -2
  50. package/dist/admin/utils/clean.mjs.map +1 -1
  51. package/dist/server/constants/iso-locales.json.js +4 -0
  52. package/dist/server/constants/iso-locales.json.js.map +1 -1
  53. package/dist/server/constants/iso-locales.json.mjs +4 -0
  54. package/dist/server/constants/iso-locales.json.mjs.map +1 -1
  55. package/dist/server/controllers/index.js +3 -1
  56. package/dist/server/controllers/index.js.map +1 -1
  57. package/dist/server/controllers/index.mjs +3 -1
  58. package/dist/server/controllers/index.mjs.map +1 -1
  59. package/dist/server/controllers/settings.js +24 -0
  60. package/dist/server/controllers/settings.js.map +1 -0
  61. package/dist/server/controllers/settings.mjs +22 -0
  62. package/dist/server/controllers/settings.mjs.map +1 -0
  63. package/dist/server/routes/admin.js +20 -0
  64. package/dist/server/routes/admin.js.map +1 -1
  65. package/dist/server/routes/admin.mjs +20 -0
  66. package/dist/server/routes/admin.mjs.map +1 -1
  67. package/dist/server/services/ai-localizations.js +28 -0
  68. package/dist/server/services/ai-localizations.js.map +1 -0
  69. package/dist/server/services/ai-localizations.mjs +26 -0
  70. package/dist/server/services/ai-localizations.mjs.map +1 -0
  71. package/dist/server/services/index.js +5 -1
  72. package/dist/server/services/index.js.map +1 -1
  73. package/dist/server/services/index.mjs +5 -1
  74. package/dist/server/services/index.mjs.map +1 -1
  75. package/dist/server/services/settings.js +25 -0
  76. package/dist/server/services/settings.js.map +1 -0
  77. package/dist/server/services/settings.mjs +23 -0
  78. package/dist/server/services/settings.mjs.map +1 -0
  79. package/dist/server/src/controllers/index.d.ts +4 -0
  80. package/dist/server/src/controllers/index.d.ts.map +1 -1
  81. package/dist/server/src/controllers/settings.d.ts +7 -0
  82. package/dist/server/src/controllers/settings.d.ts.map +1 -0
  83. package/dist/server/src/index.d.ts +19 -0
  84. package/dist/server/src/index.d.ts.map +1 -1
  85. package/dist/server/src/routes/admin.d.ts.map +1 -1
  86. package/dist/server/src/services/ai-localizations.d.ts +8 -0
  87. package/dist/server/src/services/ai-localizations.d.ts.map +1 -0
  88. package/dist/server/src/services/index.d.ts +15 -0
  89. package/dist/server/src/services/index.d.ts.map +1 -1
  90. package/dist/server/src/services/settings.d.ts +13 -0
  91. package/dist/server/src/services/settings.d.ts.map +1 -0
  92. package/dist/server/src/utils/index.d.ts +3 -1
  93. package/dist/server/src/utils/index.d.ts.map +1 -1
  94. package/dist/server/src/validation/settings.d.ts +12 -0
  95. package/dist/server/src/validation/settings.d.ts.map +1 -0
  96. package/dist/server/utils/index.js.map +1 -1
  97. package/dist/server/utils/index.mjs.map +1 -1
  98. package/dist/server/validation/settings.js +11 -0
  99. package/dist/server/validation/settings.js.map +1 -0
  100. package/dist/server/validation/settings.mjs +9 -0
  101. package/dist/server/validation/settings.mjs.map +1 -0
  102. package/dist/shared/contracts/settings.d.ts +40 -0
  103. package/package.json +9 -8
@@ -1,4 +1,4 @@
1
1
  import type { GetISOLocales } from '../../../shared/contracts/iso-locales';
2
2
  import type { GetLocales, CreateLocale, DeleteLocale, UpdateLocale } from '../../../shared/contracts/locales';
3
- declare const useCreateLocaleMutation: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseMutation<import("@reduxjs/toolkit/query").MutationDefinition<Omit<import("../../../shared/contracts/locales").Locale, keyof import("../../../shared/contracts/shared").Entity>, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@strapi/admin/strapi-admin").QueryArguments, unknown, import("@strapi/admin/strapi-admin").BaseQueryError, {}, {}>, "GuidedTourMeta" | "HomepageKeyStatistics" | "Locale" | "KeyStatistics", CreateLocale.Response, "adminApi">>, useDeleteLocaleMutation: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseMutation<import("@reduxjs/toolkit/query").MutationDefinition<import("@strapi/types/dist/data").ID, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@strapi/admin/strapi-admin").QueryArguments, unknown, import("@strapi/admin/strapi-admin").BaseQueryError, {}, {}>, "GuidedTourMeta" | "HomepageKeyStatistics" | "Locale" | "KeyStatistics", DeleteLocale.Response, "adminApi">>, useGetLocalesQuery: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseQuery<import("@reduxjs/toolkit/query").QueryDefinition<void, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@strapi/admin/strapi-admin").QueryArguments, unknown, import("@strapi/admin/strapi-admin").BaseQueryError, {}, {}>, "GuidedTourMeta" | "HomepageKeyStatistics" | "Locale" | "KeyStatistics", GetLocales.Response, "adminApi">>, useGetDefaultLocalesQuery: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseQuery<import("@reduxjs/toolkit/query").QueryDefinition<void, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@strapi/admin/strapi-admin").QueryArguments, unknown, import("@strapi/admin/strapi-admin").BaseQueryError, {}, {}>, "GuidedTourMeta" | "HomepageKeyStatistics" | "Locale" | "KeyStatistics", GetISOLocales.Response, "adminApi">>, useUpdateLocaleMutation: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseMutation<import("@reduxjs/toolkit/query").MutationDefinition<Pick<import("../../../shared/contracts/locales").Locale, "name" | "isDefault"> & UpdateLocale.Params, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@strapi/admin/strapi-admin").QueryArguments, unknown, import("@strapi/admin/strapi-admin").BaseQueryError, {}, {}>, "GuidedTourMeta" | "HomepageKeyStatistics" | "Locale" | "KeyStatistics", UpdateLocale.Response, "adminApi">>;
3
+ declare const useCreateLocaleMutation: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseMutation<import("@reduxjs/toolkit/query").MutationDefinition<Omit<import("../../../shared/contracts/locales").Locale, keyof import("../../../shared/contracts/shared").Entity>, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@strapi/admin/strapi-admin").QueryArguments, unknown, import("@strapi/admin/strapi-admin").BaseQueryError, {}, {}>, "GuidedTourMeta" | "HomepageKeyStatistics" | "AIUsage" | "Locale" | "KeyStatistics" | "Settings", CreateLocale.Response, "adminApi">>, useDeleteLocaleMutation: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseMutation<import("@reduxjs/toolkit/query").MutationDefinition<import("@strapi/types/dist/data").ID, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@strapi/admin/strapi-admin").QueryArguments, unknown, import("@strapi/admin/strapi-admin").BaseQueryError, {}, {}>, "GuidedTourMeta" | "HomepageKeyStatistics" | "AIUsage" | "Locale" | "KeyStatistics" | "Settings", DeleteLocale.Response, "adminApi">>, useGetLocalesQuery: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseQuery<import("@reduxjs/toolkit/query").QueryDefinition<void, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@strapi/admin/strapi-admin").QueryArguments, unknown, import("@strapi/admin/strapi-admin").BaseQueryError, {}, {}>, "GuidedTourMeta" | "HomepageKeyStatistics" | "AIUsage" | "Locale" | "KeyStatistics" | "Settings", GetLocales.Response, "adminApi">>, useGetDefaultLocalesQuery: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseQuery<import("@reduxjs/toolkit/query").QueryDefinition<void, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@strapi/admin/strapi-admin").QueryArguments, unknown, import("@strapi/admin/strapi-admin").BaseQueryError, {}, {}>, "GuidedTourMeta" | "HomepageKeyStatistics" | "AIUsage" | "Locale" | "KeyStatistics" | "Settings", GetISOLocales.Response, "adminApi">>, useUpdateLocaleMutation: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseMutation<import("@reduxjs/toolkit/query").MutationDefinition<Pick<import("../../../shared/contracts/locales").Locale, "name" | "isDefault"> & UpdateLocale.Params, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@strapi/admin/strapi-admin").QueryArguments, unknown, import("@strapi/admin/strapi-admin").BaseQueryError, {}, {}>, "GuidedTourMeta" | "HomepageKeyStatistics" | "AIUsage" | "Locale" | "KeyStatistics" | "Settings", UpdateLocale.Response, "adminApi">>;
4
4
  export { useCreateLocaleMutation, useDeleteLocaleMutation, useGetLocalesQuery, useGetDefaultLocalesQuery, useUpdateLocaleMutation, };
@@ -3,5 +3,5 @@ declare const useGetManyDraftRelationCountQuery: import("@reduxjs/toolkit/dist/q
3
3
  locale?: string | string[] | null | undefined;
4
4
  } & {
5
5
  model: string;
6
- }, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@strapi/admin/strapi-admin").QueryArguments, unknown, import("@strapi/admin/strapi-admin").BaseQueryError, {}, {}>, "GuidedTourMeta" | "HomepageKeyStatistics" | "Locale" | "KeyStatistics", number, "adminApi">>;
6
+ }, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@strapi/admin/strapi-admin").QueryArguments, unknown, import("@strapi/admin/strapi-admin").BaseQueryError, {}, {}>, "GuidedTourMeta" | "HomepageKeyStatistics" | "AIUsage" | "Locale" | "KeyStatistics" | "Settings", number, "adminApi">>;
7
7
  export { useGetManyDraftRelationCountQuery };
@@ -0,0 +1,5 @@
1
+ import type { UpdateSettings } from '../../../shared/contracts/settings';
2
+ declare const useGetSettingsQuery: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseQuery<import("@reduxjs/toolkit/query").QueryDefinition<void, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@strapi/admin/strapi-admin").QueryArguments, unknown, import("@strapi/admin/strapi-admin").BaseQueryError, {}, {}>, "GuidedTourMeta" | "HomepageKeyStatistics" | "AIUsage" | "Locale" | "KeyStatistics" | "Settings", import("../../../shared/contracts/settings").Settings, "adminApi">>, useUpdatei18nSettingsMutation: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseMutation<import("@reduxjs/toolkit/query").MutationDefinition<{
3
+ aiLocalizations?: boolean | undefined;
4
+ }, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@strapi/admin/strapi-admin").QueryArguments, unknown, import("@strapi/admin/strapi-admin").BaseQueryError, {}, {}>, "GuidedTourMeta" | "HomepageKeyStatistics" | "AIUsage" | "Locale" | "KeyStatistics" | "Settings", UpdateSettings.Response, "adminApi">>;
5
+ export { useGetSettingsQuery, useUpdatei18nSettingsMutation };
@@ -20,8 +20,13 @@ var en = {
20
20
  "CMEditViewBulkLocale.publication-status": "Publication Status",
21
21
  "CMEditViewBulkLocale.draft-relation-warning": "Some locales are related to draft entries. Publishing them could leave broken links in your app.",
22
22
  "CMEditViewBulkLocale.continue-confirmation": "Are you sure you want to continue?",
23
+ "CMEditViewAITranslation.status-aria-label": "AI Translation Status",
24
+ "CMEditViewAITranslation.status-title": "{enabled, select, true {AI translation enabled} false {AI translation disabled} other {AI translation disabled}}",
25
+ "CMEditViewAITranslation.status-description": "Our AI translates content in all locales each time you save a modification.",
26
+ "CMEditViewAITranslation.settings-link": "{enabled, select, true {Disable it in settings} false {Enable it in settings} other {Enable it in settings}}",
23
27
  "CMEditViewLocalePicker.locale.create": "Create <bold>{locale}</bold> locale",
24
28
  "CMListView.popover.display-locales.label": "Display translated locales",
29
+ "CMListView.popover.display-locales.more": "{locales} + {count} more",
25
30
  "CheckboxConfirmation.Modal.body": "Do you want to disable it?",
26
31
  "CheckboxConfirmation.Modal.button-confirm": "Yes, disable",
27
32
  "CheckboxConfirmation.Modal.content": "Disabling localization will engender the deletion of all your content but the one associated to your default locale (if existing).",
@@ -36,6 +41,8 @@ var en = {
36
41
  "Settings.list.description": "Configure the settings for the Internationalization plugin",
37
42
  "Settings.list.empty.description": "This is not a usual behavior, meaning that you have eventually modified the database manually. Make sure to have at least one locale saved in your database in order to be able to use Strapi correctly.",
38
43
  "Settings.list.empty.title": "There are no locales.",
44
+ "Settings.aiLocalizations.label": "AI Translations",
45
+ "Settings.aiLocalizations.description": "Everytime you save in the Content Manager, our AI will use your default locale to translate all other locales automatically.",
39
46
  "Settings.locales.default": "Default",
40
47
  "Settings.locales.list.sort.default": "Sort by the default locale",
41
48
  "Settings.locales.list.sort.displayName": "Sort by display name",
@@ -1 +1 @@
1
- {"version":3,"file":"en.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"en.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -18,8 +18,13 @@ var en = {
18
18
  "CMEditViewBulkLocale.publication-status": "Publication Status",
19
19
  "CMEditViewBulkLocale.draft-relation-warning": "Some locales are related to draft entries. Publishing them could leave broken links in your app.",
20
20
  "CMEditViewBulkLocale.continue-confirmation": "Are you sure you want to continue?",
21
+ "CMEditViewAITranslation.status-aria-label": "AI Translation Status",
22
+ "CMEditViewAITranslation.status-title": "{enabled, select, true {AI translation enabled} false {AI translation disabled} other {AI translation disabled}}",
23
+ "CMEditViewAITranslation.status-description": "Our AI translates content in all locales each time you save a modification.",
24
+ "CMEditViewAITranslation.settings-link": "{enabled, select, true {Disable it in settings} false {Enable it in settings} other {Enable it in settings}}",
21
25
  "CMEditViewLocalePicker.locale.create": "Create <bold>{locale}</bold> locale",
22
26
  "CMListView.popover.display-locales.label": "Display translated locales",
27
+ "CMListView.popover.display-locales.more": "{locales} + {count} more",
23
28
  "CheckboxConfirmation.Modal.body": "Do you want to disable it?",
24
29
  "CheckboxConfirmation.Modal.button-confirm": "Yes, disable",
25
30
  "CheckboxConfirmation.Modal.content": "Disabling localization will engender the deletion of all your content but the one associated to your default locale (if existing).",
@@ -34,6 +39,8 @@ var en = {
34
39
  "Settings.list.description": "Configure the settings for the Internationalization plugin",
35
40
  "Settings.list.empty.description": "This is not a usual behavior, meaning that you have eventually modified the database manually. Make sure to have at least one locale saved in your database in order to be able to use Strapi correctly.",
36
41
  "Settings.list.empty.title": "There are no locales.",
42
+ "Settings.aiLocalizations.label": "AI Translations",
43
+ "Settings.aiLocalizations.description": "Everytime you save in the Content Manager, our AI will use your default locale to translate all other locales automatically.",
37
44
  "Settings.locales.default": "Default",
38
45
  "Settings.locales.list.sort.default": "Sort by the default locale",
39
46
  "Settings.locales.list.sort.displayName": "Sort by display name",
@@ -1 +1 @@
1
- {"version":3,"file":"en.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"en.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -55,8 +55,8 @@ const recursiveRemoveFieldTypes = (data, schema, components, fields)=>{
55
55
  __temp_key__: index + 1
56
56
  };
57
57
  });
58
- } else {
59
- const { id: _, ...rest } = recursiveRemoveFieldTypes(data[current] ?? {}, components[component], components, fields);
58
+ } else if (data[current]) {
59
+ const { id: _, ...rest } = recursiveRemoveFieldTypes(data[current], components[component], components, fields);
60
60
  acc[current] = rest;
61
61
  }
62
62
  } else {
@@ -1 +1 @@
1
- {"version":3,"file":"clean.js","sources":["../../../admin/src/utils/clean.ts"],"sourcesContent":["import type { Schema } from '@strapi/types';\n\ntype Data = Record<keyof Schema.ContentType['attributes'], any>;\n\nconst cleanData = (\n data: Data,\n schema: Schema.ContentType,\n components: Record<string, Schema.Component>\n) => {\n const cleanedData = removeFields(data, [\n 'createdAt',\n 'createdBy',\n 'updatedAt',\n 'updatedBy',\n 'id',\n 'documentId',\n 'publishedAt',\n 'strapi_stage',\n 'strapi_assignee',\n 'locale',\n 'status',\n ]);\n\n const cleanedDataWithoutPasswordAndRelation = recursiveRemoveFieldTypes(\n cleanedData,\n schema,\n components,\n ['relation', 'password']\n );\n\n return cleanedDataWithoutPasswordAndRelation;\n};\n\nconst removeFields = (data: Data, fields: Array<keyof Schema.ContentType['attributes']>) => {\n return Object.keys(data).reduce((acc, current) => {\n if (fields.includes(current)) {\n return acc;\n }\n acc[current] = data[current];\n return acc;\n }, {} as Data);\n};\n\nconst recursiveRemoveFieldTypes = (\n data: Data,\n schema: Schema.Schema,\n components: Record<string, Schema.Component>,\n fields: Array<keyof Schema.ContentType['attributes']>\n) => {\n return Object.keys(data).reduce((acc, current) => {\n const attribute = schema.attributes[current] ?? { type: undefined };\n\n if (fields.includes(attribute.type)) {\n return acc;\n }\n\n if (attribute.type === 'dynamiczone') {\n acc[current] = data[current].map((componentValue: any, index: number) => {\n const { id: _, ...rest } = recursiveRemoveFieldTypes(\n componentValue,\n components[componentValue.__component],\n components,\n fields\n );\n\n return {\n ...rest,\n __temp_key__: index + 1,\n };\n });\n } else if (attribute.type === 'component') {\n const { repeatable, component } = attribute;\n\n if (repeatable) {\n acc[current] = (data[current] ?? []).map((compoData: any, index: number) => {\n const { id: _, ...rest } = recursiveRemoveFieldTypes(\n compoData,\n components[component],\n components,\n fields\n );\n\n return {\n ...rest,\n __temp_key__: index + 1,\n };\n });\n } else {\n const { id: _, ...rest } = recursiveRemoveFieldTypes(\n data[current] ?? {},\n components[component],\n components,\n fields\n );\n\n acc[current] = rest;\n }\n } else {\n acc[current] = data[current];\n }\n\n return acc;\n }, {} as any);\n};\n\nexport { cleanData };\n"],"names":["cleanData","data","schema","components","cleanedData","removeFields","cleanedDataWithoutPasswordAndRelation","recursiveRemoveFieldTypes","fields","Object","keys","reduce","acc","current","includes","attribute","attributes","type","undefined","map","componentValue","index","id","_","rest","__component","__temp_key__","repeatable","component","compoData"],"mappings":";;AAIMA,MAAAA,SAAAA,GAAY,CAChBC,IAAAA,EACAC,MACAC,EAAAA,UAAAA,GAAAA;IAEA,MAAMC,WAAAA,GAAcC,aAAaJ,IAAM,EAAA;AACrC,QAAA,WAAA;AACA,QAAA,WAAA;AACA,QAAA,WAAA;AACA,QAAA,WAAA;AACA,QAAA,IAAA;AACA,QAAA,YAAA;AACA,QAAA,aAAA;AACA,QAAA,cAAA;AACA,QAAA,iBAAA;AACA,QAAA,QAAA;AACA,QAAA;AACD,KAAA,CAAA;AAED,IAAA,MAAMK,qCAAwCC,GAAAA,yBAAAA,CAC5CH,WACAF,EAAAA,MAAAA,EACAC,UACA,EAAA;AAAC,QAAA,UAAA;AAAY,QAAA;AAAW,KAAA,CAAA;IAG1B,OAAOG,qCAAAA;AACT;AAEA,MAAMD,YAAAA,GAAe,CAACJ,IAAYO,EAAAA,MAAAA,GAAAA;AAChC,IAAA,OAAOC,OAAOC,IAAI,CAACT,MAAMU,MAAM,CAAC,CAACC,GAAKC,EAAAA,OAAAA,GAAAA;QACpC,IAAIL,MAAAA,CAAOM,QAAQ,CAACD,OAAU,CAAA,EAAA;YAC5B,OAAOD,GAAAA;AACT;AACAA,QAAAA,GAAG,CAACC,OAAAA,CAAQ,GAAGZ,IAAI,CAACY,OAAQ,CAAA;QAC5B,OAAOD,GAAAA;AACT,KAAA,EAAG,EAAC,CAAA;AACN,CAAA;AAEA,MAAML,yBAA4B,GAAA,CAChCN,IACAC,EAAAA,MAAAA,EACAC,UACAK,EAAAA,MA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zB,UACAK,EAAAA,MAAAA,CAAAA;oBAGF,OAAO;AACL,wBAAA,GAAGgB,IAAI;AACPE,wBAAAA,YAAAA,EAAcL,KAAQ,GAAA;AACxB,qBAAA;AACF,iBAAA,CAAA;aACK,MAAA;AACL,gBAAA,MAAM,EAAEC,EAAIC,EAAAA,CAAC,EAAE,GAAGC,IAAAA,EAAM,GAAGjB,yBACzBN,CAAAA,IAAI,CAACY,OAAAA,CAAQ,IAAI,EAAC,EAClBV,UAAU,CAACyB,SAAAA,CAAU,EACrBzB,UACAK,EAAAA,MAAAA,CAAAA;gBAGFI,GAAG,CAACC,QAAQ,GAAGW,IAAAA;AACjB;SACK,MAAA;AACLZ,YAAAA,GAAG,CAACC,OAAAA,CAAQ,GAAGZ,IAAI,CAACY,OAAQ,CAAA;AAC9B;QAEA,OAAOD,GAAAA;AACT,KAAA,EAAG,EAAC,CAAA;AACN,CAAA;;;;"}
1
+ {"version":3,"file":"clean.js","sources":["../../../admin/src/utils/clean.ts"],"sourcesContent":["import type { Schema } from '@strapi/types';\n\ntype Data = Record<keyof Schema.ContentType['attributes'], any>;\n\nconst cleanData = (\n data: Data,\n schema: Schema.ContentType,\n components: Record<string, Schema.Component>\n) => {\n const cleanedData = removeFields(data, [\n 'createdAt',\n 'createdBy',\n 'updatedAt',\n 'updatedBy',\n 'id',\n 'documentId',\n 'publishedAt',\n 'strapi_stage',\n 'strapi_assignee',\n 'locale',\n 'status',\n ]);\n\n const cleanedDataWithoutPasswordAndRelation = recursiveRemoveFieldTypes(\n cleanedData,\n schema,\n components,\n ['relation', 'password']\n );\n\n return cleanedDataWithoutPasswordAndRelation;\n};\n\nconst removeFields = (data: Data, fields: Array<keyof Schema.ContentType['attributes']>) => {\n return Object.keys(data).reduce((acc, current) => {\n if (fields.includes(current)) {\n return acc;\n }\n acc[current] = data[current];\n return acc;\n }, {} as Data);\n};\n\nconst recursiveRemoveFieldTypes = (\n data: Data,\n schema: Schema.Schema,\n components: Record<string, Schema.Component>,\n fields: Array<keyof Schema.ContentType['attributes']>\n) => {\n return Object.keys(data).reduce((acc, current) => {\n const attribute = schema.attributes[current] ?? { type: undefined };\n\n if (fields.includes(attribute.type)) {\n return acc;\n }\n\n if (attribute.type === 'dynamiczone') {\n acc[current] = data[current].map((componentValue: any, index: number) => {\n const { id: _, ...rest } = recursiveRemoveFieldTypes(\n componentValue,\n components[componentValue.__component],\n components,\n fields\n );\n\n return {\n ...rest,\n __temp_key__: index + 1,\n };\n });\n } else if (attribute.type === 'component') {\n const { repeatable, component } = attribute;\n\n if (repeatable) {\n acc[current] = (data[current] ?? []).map((compoData: any, index: number) => {\n const { id: _, ...rest } = recursiveRemoveFieldTypes(\n compoData,\n components[component],\n components,\n fields\n );\n\n return {\n ...rest,\n __temp_key__: index + 1,\n };\n });\n } else if (data[current]) {\n const { id: _, ...rest } = recursiveRemoveFieldTypes(\n data[current],\n components[component],\n components,\n fields\n );\n\n acc[current] = rest;\n }\n } else {\n acc[current] = data[current];\n }\n\n return acc;\n }, {} as any);\n};\n\nexport { cleanData };\n"],"names":["cleanData","data","schema","components","cleanedData","removeFields","cleanedDataWithoutPasswordAndRelation","recursiveRemoveFieldTypes","fields","Object","keys","reduce","acc","current","includes","attribute","attributes","type","undefined","map","componentValue","index","id","_","rest","__component","__temp_key__","repeatable","component","compoData"],"mappings":";;AAIMA,MAAAA,SAAAA,GAAY,CAChBC,IAAAA,EACAC,MACAC,EAAAA,UAAAA,GAAAA;IAEA,MAAMC,WAAAA,GAAcC,aAAaJ,IAAM,EAAA;AACrC,QAAA,WAAA;AACA,QAAA,WAAA;AACA,QAAA,WAAA;AACA,QAAA,WAAA;AACA,QAAA,IAAA;AACA,QAAA,YAAA;AACA,QAAA,aAAA;AACA,QAAA,cAAA;AACA,QAAA,iBAAA;AACA,QAAA,QAAA;AACA,QAAA;AACD,KAAA,CAAA;AAED,IAAA,MAAMK,qCAAwCC,GAAAA,yBAAAA,CAC5CH,WACAF,EAAAA,MAAAA,EACAC,UACA,EA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IAAI;AACPE,oBAAAA,YAAAA,EAAcL,KAAQ,GAAA;AACxB,iBAAA;AACF,aAAA,CAAA;AACF,SAAA,MAAO,IAAIN,SAAAA,CAAUE,IAAI,KAAK,WAAa,EAAA;AACzC,YAAA,MAAM,EAAEU,UAAU,EAAEC,SAAS,EAAE,GAAGb,SAAAA;AAElC,YAAA,IAAIY,UAAY,EAAA;AACdf,gBAAAA,GAAG,CAACC,OAAAA,CAAQ,GAAIZ,CAAAA,IAAI,CAACY,OAAQ,CAAA,IAAI,EAAE,EAAEM,GAAG,CAAC,CAACU,SAAgBR,EAAAA,KAAAA,GAAAA;AACxD,oBAAA,MAAM,EAAEC,EAAAA,EAAIC,CAAC,EAAE,GAAGC,IAAAA,EAAM,GAAGjB,yBAAAA,CACzBsB,SACA1B,EAAAA,UAAU,CAACyB,SAAAA,CAAU,EACrBzB,UACAK,EAAAA,MAAAA,CAAAA;oBAGF,OAAO;AACL,wBAAA,GAAGgB,IAAI;AACPE,wBAAAA,YAAAA,EAAcL,KAAQ,GAAA;AACxB,qBAAA;AACF,iBAAA,CAAA;AACF,aAAA,MAAO,IAAIpB,IAAI,CAACY,OAAAA,CAAQ,EAAE;AACxB,gBAAA,MAAM,EAAES,EAAIC,EAAAA,CAAC,EAAE,GAAGC,MAAM,GAAGjB,yBAAAA,CACzBN,IAAI,CAACY,QAAQ,EACbV,UAAU,CAACyB,SAAAA,CAAU,EACrBzB,UACAK,EAAAA,MAAAA,CAAAA;gBAGFI,GAAG,CAACC,QAAQ,GAAGW,IAAAA;AACjB;SACK,MAAA;AACLZ,YAAAA,GAAG,CAACC,OAAAA,CAAQ,GAAGZ,IAAI,CAACY,OAAQ,CAAA;AAC9B;QAEA,OAAOD,GAAAA;AACT,KAAA,EAAG,EAAC,CAAA;AACN,CAAA;;;;"}
@@ -53,8 +53,8 @@ const recursiveRemoveFieldTypes = (data, schema, components, fields)=>{
53
53
  __temp_key__: index + 1
54
54
  };
55
55
  });
56
- } else {
57
- const { id: _, ...rest } = recursiveRemoveFieldTypes(data[current] ?? {}, components[component], components, fields);
56
+ } else if (data[current]) {
57
+ const { id: _, ...rest } = recursiveRemoveFieldTypes(data[current], components[component], components, fields);
58
58
  acc[current] = rest;
59
59
  }
60
60
  } else {
@@ -1 +1 @@
1
- {"version":3,"file":"clean.mjs","sources":["../../../admin/src/utils/clean.ts"],"sourcesContent":["import type { Schema } from '@strapi/types';\n\ntype Data = Record<keyof Schema.ContentType['attributes'], any>;\n\nconst cleanData = (\n data: Data,\n schema: Schema.ContentType,\n components: Record<string, Schema.Component>\n) => {\n const cleanedData = removeFields(data, [\n 'createdAt',\n 'createdBy',\n 'updatedAt',\n 'updatedBy',\n 'id',\n 'documentId',\n 'publishedAt',\n 'strapi_stage',\n 'strapi_assignee',\n 'locale',\n 'status',\n ]);\n\n const cleanedDataWithoutPasswordAndRelation = recursiveRemoveFieldTypes(\n cleanedData,\n schema,\n components,\n ['relation', 'password']\n );\n\n return cleanedDataWithoutPasswordAndRelation;\n};\n\nconst removeFields = (data: Data, fields: Array<keyof Schema.ContentType['attributes']>) => {\n return Object.keys(data).reduce((acc, current) => {\n if (fields.includes(current)) {\n return acc;\n }\n acc[current] = data[current];\n return acc;\n }, {} as Data);\n};\n\nconst recursiveRemoveFieldTypes = (\n data: Data,\n schema: Schema.Schema,\n components: Record<string, Schema.Component>,\n fields: Array<keyof Schema.ContentType['attributes']>\n) => {\n return Object.keys(data).reduce((acc, current) => {\n const attribute = schema.attributes[current] ?? { type: undefined };\n\n if (fields.includes(attribute.type)) {\n return acc;\n }\n\n if (attribute.type === 'dynamiczone') {\n acc[current] = data[current].map((componentValue: any, index: number) => {\n const { id: _, ...rest } = recursiveRemoveFieldTypes(\n componentValue,\n components[componentValue.__component],\n components,\n fields\n );\n\n return {\n ...rest,\n __temp_key__: index + 1,\n };\n });\n } else if (attribute.type === 'component') {\n const { repeatable, component } = attribute;\n\n if (repeatable) {\n acc[current] = (data[current] ?? []).map((compoData: any, index: number) => {\n const { id: _, ...rest } = recursiveRemoveFieldTypes(\n compoData,\n components[component],\n components,\n fields\n );\n\n return {\n ...rest,\n __temp_key__: index + 1,\n };\n });\n } else {\n const { id: _, ...rest } = recursiveRemoveFieldTypes(\n data[current] ?? {},\n components[component],\n components,\n fields\n );\n\n acc[current] = rest;\n }\n } else {\n acc[current] = data[current];\n }\n\n return acc;\n }, {} as any);\n};\n\nexport { cleanData };\n"],"names":["cleanData","data","schema","components","cleanedData","removeFields","cleanedDataWithoutPasswordAndRelation","recursiveRemoveFieldTypes","fields","Object","keys","reduce","acc","current","includes","attribute","attributes","type","undefined","map","componentValue","index","id","_","rest","__component","__temp_key__","repeatable","component","compoData"],"mappings":"AAIMA,MAAAA,SAAAA,GAAY,CAChBC,IAAAA,EACAC,MACAC,EAAAA,UAAAA,GAAAA;IAEA,MAAMC,WAAAA,GAAcC,aAAaJ,IAAM,EAAA;AACrC,QAAA,WAAA;AACA,QAAA,WAAA;AACA,QAAA,WAAA;AACA,QAAA,WAAA;AACA,QAAA,IAAA;AACA,QAAA,YAAA;AACA,QAAA,aAAA;AACA,QAAA,cAAA;AACA,QAAA,iBAAA;AACA,QAAA,QAAA;AACA,QAAA;AACD,KAAA,CAAA;AAED,IAAA,MAAMK,qCAAwCC,GAAAA,yBAAAA,CAC5CH,WACAF,EAAAA,MAAAA,EACAC,UACA,EAAA;AAAC,QAAA,UAAA;AAAY,QAAA;AAAW,KAAA,CAAA;IAG1B,OAAOG,qCAAAA;AACT;AAEA,MAAMD,YAAAA,GAAe,CAACJ,IAAYO,EAAAA,MAAAA,GAAAA;AAChC,IAAA,OAAOC,OAAOC,IAAI,CAACT,MAAMU,MAAM,CAAC,CAACC,GAAKC,EAAAA,OAAAA,GAAAA;QACpC,IAAIL,MAAAA,CAAOM,QAAQ,CAACD,OAAU,CAAA,EAAA;YAC5B,OAAOD,GAAAA;AACT;AACAA,QAAAA,GAAG,CAACC,OAAAA,CAAQ,GAAGZ,IAAI,CAACY,OAAQ,CAAA;QAC5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,MAAM,EAAEC,EAAAA,EAAIC,CAAC,EAAE,GAAGC,IAAAA,EAAM,GAAGjB,yBAAAA,CACzBsB,SACA1B,EAAAA,UAAU,CAACyB,SAAAA,CAAU,EACrBzB,UACAK,EAAAA,MAAAA,CAAAA;oBAGF,OAAO;AACL,wBAAA,GAAGgB,IAAI;AACPE,wBAAAA,YAAAA,EAAcL,KAAQ,GAAA;AACxB,qBAAA;AACF,iBAAA,CAAA;aACK,MAAA;AACL,gBAAA,MAAM,EAAEC,EAAIC,EAAAA,CAAC,EAAE,GAAGC,IAAAA,EAAM,GAAGjB,yBACzBN,CAAAA,IAAI,CAACY,OAAAA,CAAQ,IAAI,EAAC,EAClBV,UAAU,CAACyB,SAAAA,CAAU,EACrBzB,UACAK,EAAAA,MAAAA,CAAAA;gBAGFI,GAAG,CAACC,QAAQ,GAAGW,IAAAA;AACjB;SACK,MAAA;AACLZ,YAAAA,GAAG,CAACC,OAAAA,CAAQ,GAAGZ,IAAI,CAACY,OAAQ,CAAA;AAC9B;QAEA,OAAOD,GAAAA;AACT,KAAA,EAAG,EAAC,CAAA;AACN,CAAA;;;;"}
1
+ {"version":3,"file":"clean.mjs","sources":["../../../admin/src/utils/clean.ts"],"sourcesContent":["import type { Schema } from '@strapi/types';\n\ntype Data = Record<keyof Schema.ContentType['attributes'], any>;\n\nconst cleanData = (\n data: Data,\n schema: Schema.ContentType,\n components: Record<string, Schema.Component>\n) => {\n const cleanedData = removeFields(data, [\n 'createdAt',\n 'createdBy',\n 'updatedAt',\n 'updatedBy',\n 'id',\n 'documentId',\n 'publishedAt',\n 'strapi_stage',\n 'strapi_assignee',\n 'locale',\n 'status',\n ]);\n\n const cleanedDataWithoutPasswordAndRelation = recursiveRemoveFieldTypes(\n cleanedData,\n schema,\n components,\n ['relation', 'password']\n );\n\n return cleanedDataWithoutPasswordAndRelation;\n};\n\nconst removeFields = (data: Data, fields: Array<keyof Schema.ContentType['attributes']>) => {\n return Object.keys(data).reduce((acc, current) => {\n if (fields.includes(current)) {\n return acc;\n }\n acc[current] = data[current];\n return acc;\n }, {} as Data);\n};\n\nconst recursiveRemoveFieldTypes = (\n data: Data,\n schema: Schema.Schema,\n components: Record<string, Schema.Component>,\n fields: Array<keyof Schema.ContentType['attributes']>\n) => {\n return Object.keys(data).reduce((acc, current) => {\n const attribute = schema.attributes[current] ?? { type: undefined };\n\n if (fields.includes(attribute.type)) {\n return acc;\n }\n\n if (attribute.type === 'dynamiczone') {\n acc[current] = data[current].map((componentValue: any, index: number) => {\n const { id: _, ...rest } = recursiveRemoveFieldTypes(\n componentValue,\n components[componentValue.__component],\n components,\n fields\n );\n\n return {\n ...rest,\n __temp_key__: index + 1,\n };\n });\n } else if (attribute.type === 'component') {\n const { repeatable, component } = attribute;\n\n if (repeatable) {\n acc[current] = (data[current] ?? []).map((compoData: any, index: number) => {\n const { id: _, ...rest } = recursiveRemoveFieldTypes(\n compoData,\n components[component],\n components,\n fields\n );\n\n return {\n ...rest,\n __temp_key__: index + 1,\n };\n });\n } else if (data[current]) {\n const { id: _, ...rest } = recursiveRemoveFieldTypes(\n data[current],\n components[component],\n components,\n fields\n );\n\n acc[current] = rest;\n }\n } else {\n acc[current] = data[current];\n }\n\n return acc;\n }, {} as any);\n};\n\nexport { cleanData };\n"],"names":["cleanData","data","schema","components","cleanedData","removeFields","cleanedDataWithoutPasswordAndRelation","recursiveRemoveFieldTypes","fields","Object","keys","reduce","acc","current","includes","attribute","attributes","type","undefined","map","componentValue","index","id","_","rest","__component","__temp_key__","repeatable","component","compoData"],"mappings":"AAIMA,MAAAA,SAAAA,GAAY,CAChBC,IAAAA,EACAC,MACAC,EAAAA,UAAAA,GAAAA;IAEA,MAAMC,WAAAA,GAAcC,aAAaJ,IAAM,EAAA;AACrC,QAAA,WAAA;AACA,QAAA,WAAA;AACA,QAAA,WAAA;AACA,QAAA,WAAA;AACA,QAAA,IAAA;AACA,QAAA,YAAA;AACA,QAAA,aAAA;AACA,QAAA,cAAA;AACA,QAAA,iBA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;AACN,CAAA;;;;"}
@@ -633,6 +633,10 @@ var isoLocales = [
633
633
  code: "en-JM",
634
634
  name: "English (Jamaica) (en-JM)"
635
635
  },
636
+ {
637
+ code: "en-JP",
638
+ name: "English (Japan) (en-JP)"
639
+ },
636
640
  {
637
641
  code: "en-JE",
638
642
  name: "English (Jersey) (en-JE)"
@@ -1 +1 @@
1
- {"version":3,"file":"iso-locales.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;"}
@@ -631,6 +631,10 @@ var isoLocales = [
631
631
  code: "en-JM",
632
632
  name: "English (Jamaica) (en-JM)"
633
633
  },
634
+ {
635
+ code: "en-JP",
636
+ name: "English (Japan) (en-JP)"
637
+ },
634
638
  {
635
639
  code: "en-JE",
636
640
  name: "English (Jersey) (en-JE)"
@@ -1 +1 @@
1
- {"version":3,"file":"iso-locales.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -3,11 +3,13 @@
3
3
  var locales = require('./locales.js');
4
4
  var contentTypes = require('./content-types.js');
5
5
  var isoLocales = require('./iso-locales.js');
6
+ var settings = require('./settings.js');
6
7
 
7
8
  var controllers = {
8
9
  locales,
9
10
  'iso-locales': isoLocales,
10
- 'content-types': contentTypes
11
+ 'content-types': contentTypes,
12
+ settings
11
13
  };
12
14
 
13
15
  module.exports = controllers;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../server/src/controllers/index.ts"],"sourcesContent":["import locales from './locales';\nimport contentTypes from './content-types';\nimport isoLocales from './iso-locales';\n\nexport default {\n locales,\n 'iso-locales': isoLocales,\n 'content-types': contentTypes,\n};\n"],"names":["locales","isoLocales","contentTypes"],"mappings":";;;;;;AAIA,kBAAe;AACbA,IAAAA,OAAAA;IACA,aAAeC,EAAAA,UAAAA;IACf,eAAiBC,EAAAA;AACnB,CAAE;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../server/src/controllers/index.ts"],"sourcesContent":["import locales from './locales';\nimport contentTypes from './content-types';\nimport isoLocales from './iso-locales';\nimport settings from './settings';\n\nexport default {\n locales,\n 'iso-locales': isoLocales,\n 'content-types': contentTypes,\n settings,\n};\n"],"names":["locales","isoLocales","contentTypes","settings"],"mappings":";;;;;;;AAKA,kBAAe;AACbA,IAAAA,OAAAA;IACA,aAAeC,EAAAA,UAAAA;IACf,eAAiBC,EAAAA,YAAAA;AACjBC,IAAAA;AACF,CAAE;;;;"}
@@ -1,11 +1,13 @@
1
1
  import controller from './locales.mjs';
2
2
  import controller$2 from './content-types.mjs';
3
3
  import controller$1 from './iso-locales.mjs';
4
+ import settings from './settings.mjs';
4
5
 
5
6
  var controllers = {
6
7
  locales: controller,
7
8
  'iso-locales': controller$1,
8
- 'content-types': controller$2
9
+ 'content-types': controller$2,
10
+ settings
9
11
  };
10
12
 
11
13
  export { controllers as default };
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../server/src/controllers/index.ts"],"sourcesContent":["import locales from './locales';\nimport contentTypes from './content-types';\nimport isoLocales from './iso-locales';\n\nexport default {\n locales,\n 'iso-locales': isoLocales,\n 'content-types': contentTypes,\n};\n"],"names":["locales","isoLocales","contentTypes"],"mappings":";;;;AAIA,kBAAe;AACbA,aAAAA,UAAAA;IACA,aAAeC,EAAAA,YAAAA;IACf,eAAiBC,EAAAA;AACnB,CAAE;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../server/src/controllers/index.ts"],"sourcesContent":["import locales from './locales';\nimport contentTypes from './content-types';\nimport isoLocales from './iso-locales';\nimport settings from './settings';\n\nexport default {\n locales,\n 'iso-locales': isoLocales,\n 'content-types': contentTypes,\n settings,\n};\n"],"names":["locales","isoLocales","contentTypes","settings"],"mappings":";;;;;AAKA,kBAAe;AACbA,aAAAA,UAAAA;IACA,aAAeC,EAAAA,YAAAA;IACf,eAAiBC,EAAAA,YAAAA;AACjBC,IAAAA;AACF,CAAE;;;;"}
@@ -0,0 +1,24 @@
1
+ 'use strict';
2
+
3
+ var index = require('../utils/index.js');
4
+ var settings$1 = require('../validation/settings.js');
5
+
6
+ var settings = {
7
+ async updateSettings (ctx) {
8
+ const { request: { body } } = ctx;
9
+ const data = await settings$1(body);
10
+ await index.getService('settings').setSettings(data);
11
+ ctx.body = {
12
+ data
13
+ };
14
+ },
15
+ async getSettings (ctx) {
16
+ const data = await index.getService('settings').getSettings();
17
+ ctx.body = {
18
+ data
19
+ };
20
+ }
21
+ };
22
+
23
+ module.exports = settings;
24
+ //# sourceMappingURL=settings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.js","sources":["../../../server/src/controllers/settings.ts"],"sourcesContent":["import type { Context } from 'koa';\n\nimport { getService } from '../utils';\nimport validateSettings from '../validation/settings';\n\nexport default {\n async updateSettings(ctx: Context) {\n const {\n request: { body },\n } = ctx;\n\n const data = await validateSettings(body);\n\n await getService('settings').setSettings(data);\n\n ctx.body = { data };\n },\n\n async getSettings(ctx: Context) {\n const data = await getService('settings').getSettings();\n\n ctx.body = { data };\n },\n};\n"],"names":["updateSettings","ctx","request","body","data","validateSettings","getService","setSettings","getSettings"],"mappings":";;;;;AAKA,eAAe;AACb,IAAA,MAAMA,gBAAeC,GAAY,EAAA;AAC/B,QAAA,MAAM,EACJC,OAAS,EAAA,EAAEC,IAAI,EAAE,EAClB,GAAGF,GAAAA;QAEJ,MAAMG,IAAAA,GAAO,MAAMC,UAAiBF,CAAAA,IAAAA,CAAAA;QAEpC,MAAMG,gBAAAA,CAAW,UAAYC,CAAAA,CAAAA,WAAW,CAACH,IAAAA,CAAAA;AAEzCH,QAAAA,GAAAA,CAAIE,IAAI,GAAG;AAAEC,YAAAA;AAAK,SAAA;AACpB,KAAA;AAEA,IAAA,MAAMI,aAAYP,GAAY,EAAA;AAC5B,QAAA,MAAMG,IAAO,GAAA,MAAME,gBAAW,CAAA,UAAA,CAAA,CAAYE,WAAW,EAAA;AAErDP,QAAAA,GAAAA,CAAIE,IAAI,GAAG;AAAEC,YAAAA;AAAK,SAAA;AACpB;AACF,CAAE;;;;"}
@@ -0,0 +1,22 @@
1
+ import { getService } from '../utils/index.mjs';
2
+ import validateSettings from '../validation/settings.mjs';
3
+
4
+ var settings = {
5
+ async updateSettings (ctx) {
6
+ const { request: { body } } = ctx;
7
+ const data = await validateSettings(body);
8
+ await getService('settings').setSettings(data);
9
+ ctx.body = {
10
+ data
11
+ };
12
+ },
13
+ async getSettings (ctx) {
14
+ const data = await getService('settings').getSettings();
15
+ ctx.body = {
16
+ data
17
+ };
18
+ }
19
+ };
20
+
21
+ export { settings as default };
22
+ //# sourceMappingURL=settings.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.mjs","sources":["../../../server/src/controllers/settings.ts"],"sourcesContent":["import type { Context } from 'koa';\n\nimport { getService } from '../utils';\nimport validateSettings from '../validation/settings';\n\nexport default {\n async updateSettings(ctx: Context) {\n const {\n request: { body },\n } = ctx;\n\n const data = await validateSettings(body);\n\n await getService('settings').setSettings(data);\n\n ctx.body = { data };\n },\n\n async getSettings(ctx: Context) {\n const data = await getService('settings').getSettings();\n\n ctx.body = { data };\n },\n};\n"],"names":["updateSettings","ctx","request","body","data","validateSettings","getService","setSettings","getSettings"],"mappings":";;;AAKA,eAAe;AACb,IAAA,MAAMA,gBAAeC,GAAY,EAAA;AAC/B,QAAA,MAAM,EACJC,OAAS,EAAA,EAAEC,IAAI,EAAE,EAClB,GAAGF,GAAAA;QAEJ,MAAMG,IAAAA,GAAO,MAAMC,gBAAiBF,CAAAA,IAAAA,CAAAA;QAEpC,MAAMG,UAAAA,CAAW,UAAYC,CAAAA,CAAAA,WAAW,CAACH,IAAAA,CAAAA;AAEzCH,QAAAA,GAAAA,CAAIE,IAAI,GAAG;AAAEC,YAAAA;AAAK,SAAA;AACpB,KAAA;AAEA,IAAA,MAAMI,aAAYP,GAAY,EAAA;AAC5B,QAAA,MAAMG,IAAO,GAAA,MAAME,UAAW,CAAA,UAAA,CAAA,CAAYE,WAAW,EAAA;AAErDP,QAAAA,GAAAA,CAAIE,IAAI,GAAG;AAAEC,YAAAA;AAAK,SAAA;AACpB;AACF,CAAE;;;;"}
@@ -94,6 +94,26 @@ var admin = {
94
94
  'admin::isAuthenticatedAdmin'
95
95
  ]
96
96
  }
97
+ },
98
+ {
99
+ method: 'GET',
100
+ path: '/settings',
101
+ handler: 'settings.getSettings',
102
+ config: {
103
+ policies: [
104
+ 'admin::isAuthenticatedAdmin'
105
+ ]
106
+ }
107
+ },
108
+ {
109
+ method: 'PUT',
110
+ path: '/settings',
111
+ handler: 'settings.updateSettings',
112
+ config: {
113
+ policies: [
114
+ 'admin::isAuthenticatedAdmin'
115
+ ]
116
+ }
97
117
  }
98
118
  ]
99
119
  };
@@ -1 +1 @@
1
- {"version":3,"file":"admin.js","sources":["../../../server/src/routes/admin.ts"],"sourcesContent":["export default {\n type: 'admin',\n routes: [\n {\n method: 'GET',\n path: '/iso-locales',\n handler: 'iso-locales.listIsoLocales',\n config: {\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'plugin::content-manager.hasPermissions',\n config: { actions: ['plugin::i18n.locale.read'] },\n },\n ],\n },\n },\n {\n method: 'GET',\n path: '/locales',\n handler: 'locales.listLocales',\n config: {\n policies: ['admin::isAuthenticatedAdmin'],\n },\n },\n {\n method: 'POST',\n path: '/locales',\n handler: 'locales.createLocale',\n config: {\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'plugin::content-manager.hasPermissions',\n config: { actions: ['plugin::i18n.locale.create'] },\n },\n ],\n },\n },\n {\n method: 'PUT',\n path: '/locales/:id',\n handler: 'locales.updateLocale',\n config: {\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'plugin::content-manager.hasPermissions',\n config: { actions: ['plugin::i18n.locale.update'] },\n },\n ],\n },\n },\n {\n method: 'DELETE',\n path: '/locales/:id',\n handler: 'locales.deleteLocale',\n config: {\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'plugin::content-manager.hasPermissions',\n config: { actions: ['plugin::i18n.locale.delete'] },\n },\n ],\n },\n },\n {\n method: 'POST',\n path: '/content-manager/actions/get-non-localized-fields',\n handler: 'content-types.getNonLocalizedAttributes',\n config: {\n policies: ['admin::isAuthenticatedAdmin'],\n },\n },\n ],\n};\n"],"names":["type","routes","method","path","handler","config","policies","name","actions"],"mappings":";;AAAA,YAAe;IACbA,IAAM,EAAA,OAAA;IACNC,MAAQ,EAAA;AACN,QAAA;YACEC,MAAQ,EAAA,KAAA;YACRC,IAAM,EAAA,cAAA;YACNC,OAAS,EAAA,4BAAA;YACTC,MAAQ,EAAA;gBACNC,QAAU,EAAA;AACR,oBAAA,6BAAA;AACA,oBAAA;wBACEC,IAAM,EAAA,wCAAA;wBACNF,MAAQ,EAAA;4BAAEG,OAAS,EAAA;AAAC,gCAAA;AAA2B;AAAC;AAClD;AACD;AACH;AACF,SAAA;AACA,QAAA;YACEN,MAAQ,EAAA,KAAA;YACRC,IAAM,EAAA,UAAA;YACNC,OAAS,EAAA,qBAAA;YACTC,MAAQ,EAAA;gBACNC,QAAU,EAAA;AAAC,oBAAA;AAA8B;AAC3C;AACF,SAAA;AACA,QAAA;YACEJ,MAAQ,EAAA,MAAA;YACRC,IAAM,EAAA,UAAA;YACNC,OAAS,EAAA,sBAAA;YACTC,MAAQ,EAAA;gBACNC,QAAU,EAAA;AACR,oBAAA,6BAAA;AACA,oBAAA;wBACEC,IAAM,EAAA,wCAAA;wBACNF,MAAQ,EAAA;4BAAEG,OAAS,EAAA;AAAC,gCAAA;AAA6B;AAAC;AACpD;AACD;AACH;AACF,SAAA;AACA,QAAA;YACEN,MAAQ,EAAA,KAAA;YACRC,IAAM,EAAA,cAAA;YACNC,OAAS,EAAA,sBAAA;YACTC,MAAQ,EAAA;gBACNC,QAAU,EAAA;AACR,oBAAA,6BAAA;AACA,oBAAA;wBACEC,IAAM,EAAA,wCAAA;wBACNF,MAAQ,EAAA;4BAAEG,OAAS,EAAA;AAAC,gCAAA;AAA6B;AAAC;AACpD;AACD;AACH;AACF,SAAA;AACA,QAAA;YACEN,MAAQ,EAAA,QAAA;YACRC,IAAM,EAAA,cAAA;YACNC,OAAS,EAAA,sBAAA;YACTC,MAAQ,EAAA;gBACNC,QAAU,EAAA;AACR,oBAAA,6BAAA;AACA,oBAAA;wBACEC,IAAM,EAAA,wCAAA;wBACNF,MAAQ,EAAA;4BAAEG,OAAS,EAAA;AAAC,gCAAA;AAA6B;AAAC;AACpD;AACD;AACH;AACF,SAAA;AACA,QAAA;YACEN,MAAQ,EAAA,MAAA;YACRC,IAAM,EAAA,mDAAA;YACNC,OAAS,EAAA,yCAAA;YACTC,MAAQ,EAAA;gBACNC,QAAU,EAAA;AAAC,oBAAA;AAA8B;AAC3C;AACF;AACD;AACH,CAAE;;;;"}
1
+ {"version":3,"file":"admin.js","sources":["../../../server/src/routes/admin.ts"],"sourcesContent":["export default {\n type: 'admin',\n routes: [\n {\n method: 'GET',\n path: '/iso-locales',\n handler: 'iso-locales.listIsoLocales',\n config: {\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'plugin::content-manager.hasPermissions',\n config: { actions: ['plugin::i18n.locale.read'] },\n },\n ],\n },\n },\n {\n method: 'GET',\n path: '/locales',\n handler: 'locales.listLocales',\n config: {\n policies: ['admin::isAuthenticatedAdmin'],\n },\n },\n {\n method: 'POST',\n path: '/locales',\n handler: 'locales.createLocale',\n config: {\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'plugin::content-manager.hasPermissions',\n config: { actions: ['plugin::i18n.locale.create'] },\n },\n ],\n },\n },\n {\n method: 'PUT',\n path: '/locales/:id',\n handler: 'locales.updateLocale',\n config: {\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'plugin::content-manager.hasPermissions',\n config: { actions: ['plugin::i18n.locale.update'] },\n },\n ],\n },\n },\n {\n method: 'DELETE',\n path: '/locales/:id',\n handler: 'locales.deleteLocale',\n config: {\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'plugin::content-manager.hasPermissions',\n config: { actions: ['plugin::i18n.locale.delete'] },\n },\n ],\n },\n },\n {\n method: 'POST',\n path: '/content-manager/actions/get-non-localized-fields',\n handler: 'content-types.getNonLocalizedAttributes',\n config: {\n policies: ['admin::isAuthenticatedAdmin'],\n },\n },\n {\n method: 'GET',\n path: '/settings',\n handler: 'settings.getSettings',\n config: {\n policies: ['admin::isAuthenticatedAdmin'],\n },\n },\n {\n method: 'PUT',\n path: '/settings',\n handler: 'settings.updateSettings',\n config: {\n policies: ['admin::isAuthenticatedAdmin'],\n },\n },\n ],\n};\n"],"names":["type","routes","method","path","handler","config","policies","name","actions"],"mappings":";;AAAA,YAAe;IACbA,IAAM,EAAA,OAAA;IACNC,MAAQ,EAAA;AACN,QAAA;YACEC,MAAQ,EAAA,KAAA;YACRC,IAAM,EAAA,cAAA;YACNC,OAAS,EAAA,4BAAA;YACTC,MAAQ,E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,OAAS,EAAA,yCAAA;YACTC,MAAQ,EAAA;gBACNC,QAAU,EAAA;AAAC,oBAAA;AAA8B;AAC3C;AACF,SAAA;AACA,QAAA;YACEJ,MAAQ,EAAA,KAAA;YACRC,IAAM,EAAA,WAAA;YACNC,OAAS,EAAA,sBAAA;YACTC,MAAQ,EAAA;gBACNC,QAAU,EAAA;AAAC,oBAAA;AAA8B;AAC3C;AACF,SAAA;AACA,QAAA;YACEJ,MAAQ,EAAA,KAAA;YACRC,IAAM,EAAA,WAAA;YACNC,OAAS,EAAA,yBAAA;YACTC,MAAQ,EAAA;gBACNC,QAAU,EAAA;AAAC,oBAAA;AAA8B;AAC3C;AACF;AACD;AACH,CAAE;;;;"}
@@ -92,6 +92,26 @@ var admin = {
92
92
  'admin::isAuthenticatedAdmin'
93
93
  ]
94
94
  }
95
+ },
96
+ {
97
+ method: 'GET',
98
+ path: '/settings',
99
+ handler: 'settings.getSettings',
100
+ config: {
101
+ policies: [
102
+ 'admin::isAuthenticatedAdmin'
103
+ ]
104
+ }
105
+ },
106
+ {
107
+ method: 'PUT',
108
+ path: '/settings',
109
+ handler: 'settings.updateSettings',
110
+ config: {
111
+ policies: [
112
+ 'admin::isAuthenticatedAdmin'
113
+ ]
114
+ }
95
115
  }
96
116
  ]
97
117
  };
@@ -1 +1 @@
1
- {"version":3,"file":"admin.mjs","sources":["../../../server/src/routes/admin.ts"],"sourcesContent":["export default {\n type: 'admin',\n routes: [\n {\n method: 'GET',\n path: '/iso-locales',\n handler: 'iso-locales.listIsoLocales',\n config: {\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'plugin::content-manager.hasPermissions',\n config: { actions: ['plugin::i18n.locale.read'] },\n },\n ],\n },\n },\n {\n method: 'GET',\n path: '/locales',\n handler: 'locales.listLocales',\n config: {\n policies: ['admin::isAuthenticatedAdmin'],\n },\n },\n {\n method: 'POST',\n path: '/locales',\n handler: 'locales.createLocale',\n config: {\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'plugin::content-manager.hasPermissions',\n config: { actions: ['plugin::i18n.locale.create'] },\n },\n ],\n },\n },\n {\n method: 'PUT',\n path: '/locales/:id',\n handler: 'locales.updateLocale',\n config: {\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'plugin::content-manager.hasPermissions',\n config: { actions: ['plugin::i18n.locale.update'] },\n },\n ],\n },\n },\n {\n method: 'DELETE',\n path: '/locales/:id',\n handler: 'locales.deleteLocale',\n config: {\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'plugin::content-manager.hasPermissions',\n config: { actions: ['plugin::i18n.locale.delete'] },\n },\n ],\n },\n },\n {\n method: 'POST',\n path: '/content-manager/actions/get-non-localized-fields',\n handler: 'content-types.getNonLocalizedAttributes',\n config: {\n policies: ['admin::isAuthenticatedAdmin'],\n },\n },\n ],\n};\n"],"names":["type","routes","method","path","handler","config","policies","name","actions"],"mappings":"AAAA,YAAe;IACbA,IAAM,EAAA,OAAA;IACNC,MAAQ,EAAA;AACN,QAAA;YACEC,MAAQ,EAAA,KAAA;YACRC,IAAM,EAAA,cAAA;YACNC,OAAS,EAAA,4BAAA;YACTC,MAAQ,EAAA;gBACNC,QAAU,EAAA;AACR,oBAAA,6BAAA;AACA,oBAAA;wBACEC,IAAM,EAAA,wCAAA;wBACNF,MAAQ,EAAA;4BAAEG,OAAS,EAAA;AAAC,gCAAA;AAA2B;AAAC;AAClD;AACD;AACH;AACF,SAAA;AACA,QAAA;YACEN,MAAQ,EAAA,KAAA;YACRC,IAAM,EAAA,UAAA;YACNC,OAAS,EAAA,qBAAA;YACTC,MAAQ,EAAA;gBACNC,QAAU,EAAA;AAAC,oBAAA;AAA8B;AAC3C;AACF,SAAA;AACA,QAAA;YACEJ,MAAQ,EAAA,MAAA;YACRC,IAAM,EAAA,UAAA;YACNC,OAAS,EAAA,sBAAA;YACTC,MAAQ,EAAA;gBACNC,QAAU,EAAA;AACR,oBAAA,6BAAA;AACA,oBAAA;wBACEC,IAAM,EAAA,wCAAA;wBACNF,MAAQ,EAAA;4BAAEG,OAAS,EAAA;AAAC,gCAAA;AAA6B;AAAC;AACpD;AACD;AACH;AACF,SAAA;AACA,QAAA;YACEN,MAAQ,EAAA,KAAA;YACRC,IAAM,EAAA,cAAA;YACNC,OAAS,EAAA,sBAAA;YACTC,MAAQ,EAAA;gBACNC,QAAU,EAAA;AACR,oBAAA,6BAAA;AACA,oBAAA;wBACEC,IAAM,EAAA,wCAAA;wBACNF,MAAQ,EAAA;4BAAEG,OAAS,EAAA;AAAC,gCAAA;AAA6B;AAAC;AACpD;AACD;AACH;AACF,SAAA;AACA,QAAA;YACEN,MAAQ,EAAA,QAAA;YACRC,IAAM,EAAA,cAAA;YACNC,OAAS,EAAA,sBAAA;YACTC,MAAQ,EAAA;gBACNC,QAAU,EAAA;AACR,oBAAA,6BAAA;AACA,oBAAA;wBACEC,IAAM,EAAA,wCAAA;wBACNF,MAAQ,EAAA;4BAAEG,OAAS,EAAA;AAAC,gCAAA;AAA6B;AAAC;AACpD;AACD;AACH;AACF,SAAA;AACA,QAAA;YACEN,MAAQ,EAAA,MAAA;YACRC,IAAM,EAAA,mDAAA;YACNC,OAAS,EAAA,yCAAA;YACTC,MAAQ,EAAA;gBACNC,QAAU,EAAA;AAAC,oBAAA;AAA8B;AAC3C;AACF;AACD;AACH,CAAE;;;;"}
1
+ {"version":3,"file":"admin.mjs","sources":["../../../server/src/routes/admin.ts"],"sourcesContent":["export default {\n type: 'admin',\n routes: [\n {\n method: 'GET',\n path: '/iso-locales',\n handler: 'iso-locales.listIsoLocales',\n config: {\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'plugin::content-manager.hasPermissions',\n config: { actions: ['plugin::i18n.locale.read'] },\n },\n ],\n },\n },\n {\n method: 'GET',\n path: '/locales',\n handler: 'locales.listLocales',\n config: {\n policies: ['admin::isAuthenticatedAdmin'],\n },\n },\n {\n method: 'POST',\n path: '/locales',\n handler: 'locales.createLocale',\n config: {\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'plugin::content-manager.hasPermissions',\n config: { actions: ['plugin::i18n.locale.create'] },\n },\n ],\n },\n },\n {\n method: 'PUT',\n path: '/locales/:id',\n handler: 'locales.updateLocale',\n config: {\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'plugin::content-manager.hasPermissions',\n config: { actions: ['plugin::i18n.locale.update'] },\n },\n ],\n },\n },\n {\n method: 'DELETE',\n path: '/locales/:id',\n handler: 'locales.deleteLocale',\n config: {\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'plugin::content-manager.hasPermissions',\n config: { actions: ['plugin::i18n.locale.delete'] },\n },\n ],\n },\n },\n {\n method: 'POST',\n path: '/content-manager/actions/get-non-localized-fields',\n handler: 'content-types.getNonLocalizedAttributes',\n config: {\n policies: ['admin::isAuthenticatedAdmin'],\n },\n },\n {\n method: 'GET',\n path: '/settings',\n handler: 'settings.getSettings',\n config: {\n policies: ['admin::isAuthenticatedAdmin'],\n },\n },\n {\n method: 'PUT',\n path: '/settings',\n handler: 'settings.updateSettings',\n config: {\n policies: ['admin::isAuthenticatedAdmin'],\n },\n },\n ],\n};\n"],"names":["type","routes","method","path","handler","config","policies","name","actions"],"mappings":"AAAA,YAAe;IACbA,IAAM,EAAA,OAAA;IACNC,MAAQ,EAAA;AACN,QAAA;YACEC,MAAQ,EAAA,KAAA;YACRC,IAAM,EAAA,cAAA;YACNC,OAAS,EAAA,4BAAA;YACTC,MAAQ,EAAA;gBACNC,QAAU,EAAA;AACR,oBAAA,6BAAA;AACA,oBAAA;wBACEC,IAAM,EAAA,wCAAA;wBACNF,MAAQ,EAAA;4BAAEG,OAAS,EAAA;AAAC,gCAAA;AAA2B;AAAC;AAClD;AACD;AACH;AACF,SAAA;AACA,QAAA;YACEN,MAAQ,EAAA,KAAA;YACRC,IAAM,EAAA,UAAA;YACNC,OAAS,EAAA,qBAAA;YACTC,MAAQ,EAAA;gBACNC,QAAU,EAAA;AAAC,oBA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,EAAA,WAAA;YACNC,OAAS,EAAA,yBAAA;YACTC,MAAQ,EAAA;gBACNC,QAAU,EAAA;AAAC,oBAAA;AAA8B;AAC3C;AACF;AACD;AACH,CAAE;;;;"}
@@ -0,0 +1,28 @@
1
+ 'use strict';
2
+
3
+ const createAILocalizationsService = ({ strapi })=>{
4
+ return {
5
+ // Async to avoid changing the signature later (there will be a db check in the future)
6
+ async isEnabled () {
7
+ // Check if future flag is enabled
8
+ const isFutureFlagEnabled = strapi.features.future.isEnabled('unstableAILocalizations');
9
+ if (!isFutureFlagEnabled) {
10
+ return false;
11
+ }
12
+ // Check if user disabled AI features globally
13
+ const isAIEnabled = strapi.config.get('admin.ai.enabled', true);
14
+ if (!isAIEnabled) {
15
+ return false;
16
+ }
17
+ // Check if the user's license grants access to AI features
18
+ const hasAccess = strapi.ee.features.isEnabled('cms-ai');
19
+ if (!hasAccess) {
20
+ return false;
21
+ }
22
+ return true;
23
+ }
24
+ };
25
+ };
26
+
27
+ exports.createAILocalizationsService = createAILocalizationsService;
28
+ //# sourceMappingURL=ai-localizations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-localizations.js","sources":["../../../server/src/services/ai-localizations.ts"],"sourcesContent":["import type { Core } from '@strapi/types';\n\nconst createAILocalizationsService = ({ strapi }: { strapi: Core.Strapi }) => {\n return {\n // Async to avoid changing the signature later (there will be a db check in the future)\n async isEnabled() {\n // Check if future flag is enabled\n const isFutureFlagEnabled = strapi.features.future.isEnabled('unstableAILocalizations');\n if (!isFutureFlagEnabled) {\n return false;\n }\n\n // Check if user disabled AI features globally\n const isAIEnabled = strapi.config.get('admin.ai.enabled', true);\n if (!isAIEnabled) {\n return false;\n }\n\n // Check if the user's license grants access to AI features\n const hasAccess = strapi.ee.features.isEnabled('cms-ai');\n if (!hasAccess) {\n return false;\n }\n\n return true;\n },\n };\n};\n\nexport { createAILocalizationsService };\n"],"names":["createAILocalizationsService","strapi","isEnabled","isFutureFlagEnabled","features","future","isAIEnabled","config","get","hasAccess","ee"],"mappings":";;AAEA,MAAMA,4BAA+B,GAAA,CAAC,EAAEC,MAAM,EAA2B,GAAA;IACvE,OAAO;;QAEL,MAAMC,SAAAA,CAAAA,GAAAA;;AAEJ,YAAA,MAAMC,sBAAsBF,MAAOG,CAAAA,QAAQ,CAACC,MAAM,CAACH,SAAS,CAAC,yBAAA,CAAA;AAC7D,YAAA,IAAI,CAACC,mBAAqB,EAAA;gBACxB,OAAO,KAAA;AACT;;AAGA,YAAA,MAAMG,cAAcL,MAAOM,CAAAA,MAAM,CAACC,GAAG,CAAC,kBAAoB,EAAA,IAAA,CAAA;AAC1D,YAAA,IAAI,CAACF,WAAa,EAAA;gBAChB,OAAO,KAAA;AACT;;AAGA,YAAA,MAAMG,YAAYR,MAAOS,CAAAA,EAAE,CAACN,QAAQ,CAACF,SAAS,CAAC,QAAA,CAAA;AAC/C,YAAA,IAAI,CAACO,SAAW,EAAA;gBACd,OAAO,KAAA;AACT;YAEA,OAAO,IAAA;AACT;AACF,KAAA;AACF;;;;"}
@@ -0,0 +1,26 @@
1
+ const createAILocalizationsService = ({ strapi })=>{
2
+ return {
3
+ // Async to avoid changing the signature later (there will be a db check in the future)
4
+ async isEnabled () {
5
+ // Check if future flag is enabled
6
+ const isFutureFlagEnabled = strapi.features.future.isEnabled('unstableAILocalizations');
7
+ if (!isFutureFlagEnabled) {
8
+ return false;
9
+ }
10
+ // Check if user disabled AI features globally
11
+ const isAIEnabled = strapi.config.get('admin.ai.enabled', true);
12
+ if (!isAIEnabled) {
13
+ return false;
14
+ }
15
+ // Check if the user's license grants access to AI features
16
+ const hasAccess = strapi.ee.features.isEnabled('cms-ai');
17
+ if (!hasAccess) {
18
+ return false;
19
+ }
20
+ return true;
21
+ }
22
+ };
23
+ };
24
+
25
+ export { createAILocalizationsService };
26
+ //# sourceMappingURL=ai-localizations.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-localizations.mjs","sources":["../../../server/src/services/ai-localizations.ts"],"sourcesContent":["import type { Core } from '@strapi/types';\n\nconst createAILocalizationsService = ({ strapi }: { strapi: Core.Strapi }) => {\n return {\n // Async to avoid changing the signature later (there will be a db check in the future)\n async isEnabled() {\n // Check if future flag is enabled\n const isFutureFlagEnabled = strapi.features.future.isEnabled('unstableAILocalizations');\n if (!isFutureFlagEnabled) {\n return false;\n }\n\n // Check if user disabled AI features globally\n const isAIEnabled = strapi.config.get('admin.ai.enabled', true);\n if (!isAIEnabled) {\n return false;\n }\n\n // Check if the user's license grants access to AI features\n const hasAccess = strapi.ee.features.isEnabled('cms-ai');\n if (!hasAccess) {\n return false;\n }\n\n return true;\n },\n };\n};\n\nexport { createAILocalizationsService };\n"],"names":["createAILocalizationsService","strapi","isEnabled","isFutureFlagEnabled","features","future","isAIEnabled","config","get","hasAccess","ee"],"mappings":"AAEA,MAAMA,4BAA+B,GAAA,CAAC,EAAEC,MAAM,EAA2B,GAAA;IACvE,OAAO;;QAEL,MAAMC,SAAAA,CAAAA,GAAAA;;AAEJ,YAAA,MAAMC,sBAAsBF,MAAOG,CAAAA,QAAQ,CAACC,MAAM,CAACH,SAAS,CAAC,yBAAA,CAAA;AAC7D,YAAA,IAAI,CAACC,mBAAqB,EAAA;gBACxB,OAAO,KAAA;AACT;;AAGA,YAAA,MAAMG,cAAcL,MAAOM,CAAAA,MAAM,CAACC,GAAG,CAAC,kBAAoB,EAAA,IAAA,CAAA;AAC1D,YAAA,IAAI,CAACF,WAAa,EAAA;gBAChB,OAAO,KAAA;AACT;;AAGA,YAAA,MAAMG,YAAYR,MAAOS,CAAAA,EAAE,CAACN,QAAQ,CAACF,SAAS,CAAC,QAAA,CAAA;AAC/C,YAAA,IAAI,CAACO,SAAW,EAAA;gBACd,OAAO,KAAA;AACT;YAEA,OAAO,IAAA;AACT;AACF,KAAA;AACF;;;;"}
@@ -7,6 +7,8 @@ var locales = require('./locales.js');
7
7
  var isoLocales = require('./iso-locales.js');
8
8
  var contentTypes = require('./content-types.js');
9
9
  var index = require('./sanitize/index.js');
10
+ var settings = require('./settings.js');
11
+ var aiLocalizations = require('./ai-localizations.js');
10
12
 
11
13
  var services = {
12
14
  permissions,
@@ -15,7 +17,9 @@ var services = {
15
17
  locales,
16
18
  sanitize: index,
17
19
  'iso-locales': isoLocales,
18
- 'content-types': contentTypes
20
+ 'content-types': contentTypes,
21
+ aiLocalizations: aiLocalizations.createAILocalizationsService,
22
+ settings: settings.createSettingsService
19
23
  };
20
24
 
21
25
  module.exports = services;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../server/src/services/index.ts"],"sourcesContent":["import permissions from './permissions';\nimport metrics from './metrics';\nimport localizations from './localizations';\nimport locales from './locales';\nimport isoLocales from './iso-locales';\nimport contentTypes from './content-types';\nimport sanitize from './sanitize';\n\nexport default {\n permissions,\n metrics,\n localizations,\n locales,\n sanitize,\n 'iso-locales': isoLocales,\n 'content-types': contentTypes,\n};\n"],"names":["permissions","metrics","localizations","locales","sanitize","isoLocales","contentTypes"],"mappings":";;;;;;;;;;AAQA,eAAe;AACbA,IAAAA,WAAAA;AACAC,IAAAA,OAAAA;AACAC,IAAAA,aAAAA;AACAC,IAAAA,OAAAA;AACAC,cAAAA,KAAAA;IACA,aAAeC,EAAAA,UAAAA;IACf,eAAiBC,EAAAA;AACnB,CAAE;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../server/src/services/index.ts"],"sourcesContent":["import permissions from './permissions';\nimport metrics from './metrics';\nimport localizations from './localizations';\nimport locales from './locales';\nimport isoLocales from './iso-locales';\nimport contentTypes from './content-types';\nimport sanitize from './sanitize';\nimport { createSettingsService } from './settings';\nimport { createAILocalizationsService } from './ai-localizations';\n\nexport default {\n permissions,\n metrics,\n localizations,\n locales,\n sanitize,\n 'iso-locales': isoLocales,\n 'content-types': contentTypes,\n aiLocalizations: createAILocalizationsService,\n settings: createSettingsService,\n};\n"],"names":["permissions","metrics","localizations","locales","sanitize","isoLocales","contentTypes","aiLocalizations","createAILocalizationsService","settings","createSettingsService"],"mappings":";;;;;;;;;;;;AAUA,eAAe;AACbA,IAAAA,WAAAA;AACAC,IAAAA,OAAAA;AACAC,IAAAA,aAAAA;AACAC,IAAAA,OAAAA;AACAC,cAAAA,KAAAA;IACA,aAAeC,EAAAA,UAAAA;IACf,eAAiBC,EAAAA,YAAAA;IACjBC,eAAiBC,EAAAA,4CAAAA;IACjBC,QAAUC,EAAAA;AACZ,CAAE;;;;"}
@@ -5,6 +5,8 @@ import locales from './locales.mjs';
5
5
  import isoLocalesService from './iso-locales.mjs';
6
6
  import contentTypes from './content-types.mjs';
7
7
  import sanitize from './sanitize/index.mjs';
8
+ import { createSettingsService } from './settings.mjs';
9
+ import { createAILocalizationsService } from './ai-localizations.mjs';
8
10
 
9
11
  var services = {
10
12
  permissions,
@@ -13,7 +15,9 @@ var services = {
13
15
  locales,
14
16
  sanitize,
15
17
  'iso-locales': isoLocalesService,
16
- 'content-types': contentTypes
18
+ 'content-types': contentTypes,
19
+ aiLocalizations: createAILocalizationsService,
20
+ settings: createSettingsService
17
21
  };
18
22
 
19
23
  export { services as default };
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../server/src/services/index.ts"],"sourcesContent":["import permissions from './permissions';\nimport metrics from './metrics';\nimport localizations from './localizations';\nimport locales from './locales';\nimport isoLocales from './iso-locales';\nimport contentTypes from './content-types';\nimport sanitize from './sanitize';\n\nexport default {\n permissions,\n metrics,\n localizations,\n locales,\n sanitize,\n 'iso-locales': isoLocales,\n 'content-types': contentTypes,\n};\n"],"names":["permissions","metrics","localizations","locales","sanitize","isoLocales","contentTypes"],"mappings":";;;;;;;;AAQA,eAAe;AACbA,IAAAA,WAAAA;AACAC,IAAAA,OAAAA;AACAC,IAAAA,aAAAA;AACAC,IAAAA,OAAAA;AACAC,IAAAA,QAAAA;IACA,aAAeC,EAAAA,iBAAAA;IACf,eAAiBC,EAAAA;AACnB,CAAE;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../server/src/services/index.ts"],"sourcesContent":["import permissions from './permissions';\nimport metrics from './metrics';\nimport localizations from './localizations';\nimport locales from './locales';\nimport isoLocales from './iso-locales';\nimport contentTypes from './content-types';\nimport sanitize from './sanitize';\nimport { createSettingsService } from './settings';\nimport { createAILocalizationsService } from './ai-localizations';\n\nexport default {\n permissions,\n metrics,\n localizations,\n locales,\n sanitize,\n 'iso-locales': isoLocales,\n 'content-types': contentTypes,\n aiLocalizations: createAILocalizationsService,\n settings: createSettingsService,\n};\n"],"names":["permissions","metrics","localizations","locales","sanitize","isoLocales","contentTypes","aiLocalizations","createAILocalizationsService","settings","createSettingsService"],"mappings":";;;;;;;;;;AAUA,eAAe;AACbA,IAAAA,WAAAA;AACAC,IAAAA,OAAAA;AACAC,IAAAA,aAAAA;AACAC,IAAAA,OAAAA;AACAC,IAAAA,QAAAA;IACA,aAAeC,EAAAA,iBAAAA;IACf,eAAiBC,EAAAA,YAAAA;IACjBC,eAAiBC,EAAAA,4BAAAA;IACjBC,QAAUC,EAAAA;AACZ,CAAE;;;;"}
@@ -0,0 +1,25 @@
1
+ 'use strict';
2
+
3
+ const createSettingsService = ({ strapi })=>{
4
+ const settings = strapi.store({
5
+ type: 'plugin',
6
+ name: 'i18n',
7
+ key: 'settings'
8
+ });
9
+ async function getSettings() {
10
+ const res = await settings.get({});
11
+ return res;
12
+ }
13
+ function setSettings(value) {
14
+ return settings.set({
15
+ value
16
+ });
17
+ }
18
+ return {
19
+ getSettings,
20
+ setSettings
21
+ };
22
+ };
23
+
24
+ exports.createSettingsService = createSettingsService;
25
+ //# sourceMappingURL=settings.js.map