@strapi/i18n 5.28.0 → 5.30.0

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 (157) hide show
  1. package/dist/admin/components/CMHeaderActions.js +193 -4
  2. package/dist/admin/components/CMHeaderActions.js.map +1 -1
  3. package/dist/admin/components/CMHeaderActions.mjs +197 -9
  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/hooks/useAILocalizationJobsPolling.js +110 -0
  22. package/dist/admin/hooks/useAILocalizationJobsPolling.js.map +1 -0
  23. package/dist/admin/hooks/useAILocalizationJobsPolling.mjs +89 -0
  24. package/dist/admin/hooks/useAILocalizationJobsPolling.mjs.map +1 -0
  25. package/dist/admin/hooks/useI18n.js +4 -4
  26. package/dist/admin/hooks/useI18n.js.map +1 -1
  27. package/dist/admin/hooks/useI18n.mjs +4 -4
  28. package/dist/admin/hooks/useI18n.mjs.map +1 -1
  29. package/dist/admin/index.js +1 -0
  30. package/dist/admin/index.js.map +1 -1
  31. package/dist/admin/index.mjs +2 -1
  32. package/dist/admin/index.mjs.map +1 -1
  33. package/dist/admin/pages/SettingsPage.js +121 -46
  34. package/dist/admin/pages/SettingsPage.js.map +1 -1
  35. package/dist/admin/pages/SettingsPage.mjs +124 -30
  36. package/dist/admin/pages/SettingsPage.mjs.map +1 -1
  37. package/dist/admin/services/aiLocalizationJobs.js +26 -0
  38. package/dist/admin/services/aiLocalizationJobs.js.map +1 -0
  39. package/dist/admin/services/aiLocalizationJobs.mjs +24 -0
  40. package/dist/admin/services/aiLocalizationJobs.mjs.map +1 -0
  41. package/dist/admin/services/api.js +3 -1
  42. package/dist/admin/services/api.js.map +1 -1
  43. package/dist/admin/services/api.mjs +3 -1
  44. package/dist/admin/services/api.mjs.map +1 -1
  45. package/dist/admin/services/settings.js +29 -0
  46. package/dist/admin/services/settings.js.map +1 -0
  47. package/dist/admin/services/settings.mjs +26 -0
  48. package/dist/admin/services/settings.mjs.map +1 -0
  49. package/dist/admin/src/components/CMHeaderActions.d.ts +17 -4
  50. package/dist/admin/src/components/LocaleListCell.d.ts +2 -1
  51. package/dist/admin/src/hooks/useAILocalizationJobsPolling.d.ts +9 -0
  52. package/dist/admin/src/services/aiLocalizationJobs.d.ts +6 -0
  53. package/dist/admin/src/services/api.d.ts +1 -1
  54. package/dist/admin/src/services/locales.d.ts +1 -1
  55. package/dist/admin/src/services/relations.d.ts +1 -1
  56. package/dist/admin/src/services/settings.d.ts +5 -0
  57. package/dist/admin/translations/en.json.js +10 -0
  58. package/dist/admin/translations/en.json.js.map +1 -1
  59. package/dist/admin/translations/en.json.mjs +10 -0
  60. package/dist/admin/translations/en.json.mjs.map +1 -1
  61. package/dist/admin/utils/clean.js +2 -2
  62. package/dist/admin/utils/clean.js.map +1 -1
  63. package/dist/admin/utils/clean.mjs +2 -2
  64. package/dist/admin/utils/clean.mjs.map +1 -1
  65. package/dist/server/bootstrap.js +2 -0
  66. package/dist/server/bootstrap.js.map +1 -1
  67. package/dist/server/bootstrap.mjs +2 -0
  68. package/dist/server/bootstrap.mjs.map +1 -1
  69. package/dist/server/constants/iso-locales.json.js +4 -0
  70. package/dist/server/constants/iso-locales.json.js.map +1 -1
  71. package/dist/server/constants/iso-locales.json.mjs +4 -0
  72. package/dist/server/constants/iso-locales.json.mjs.map +1 -1
  73. package/dist/server/controllers/ai-localization-jobs.js +47 -0
  74. package/dist/server/controllers/ai-localization-jobs.js.map +1 -0
  75. package/dist/server/controllers/ai-localization-jobs.mjs +45 -0
  76. package/dist/server/controllers/ai-localization-jobs.mjs.map +1 -0
  77. package/dist/server/controllers/index.js +5 -1
  78. package/dist/server/controllers/index.js.map +1 -1
  79. package/dist/server/controllers/index.mjs +5 -1
  80. package/dist/server/controllers/index.mjs.map +1 -1
  81. package/dist/server/controllers/settings.js +24 -0
  82. package/dist/server/controllers/settings.js.map +1 -0
  83. package/dist/server/controllers/settings.mjs +22 -0
  84. package/dist/server/controllers/settings.mjs.map +1 -0
  85. package/dist/server/models/ai-localization-job.js +60 -0
  86. package/dist/server/models/ai-localization-job.js.map +1 -0
  87. package/dist/server/models/ai-localization-job.mjs +57 -0
  88. package/dist/server/models/ai-localization-job.mjs.map +1 -0
  89. package/dist/server/register.js +3 -1
  90. package/dist/server/register.js.map +1 -1
  91. package/dist/server/register.mjs +3 -1
  92. package/dist/server/register.mjs.map +1 -1
  93. package/dist/server/routes/admin.js +40 -0
  94. package/dist/server/routes/admin.js.map +1 -1
  95. package/dist/server/routes/admin.mjs +40 -0
  96. package/dist/server/routes/admin.mjs.map +1 -1
  97. package/dist/server/services/ai-localization-jobs.js +64 -0
  98. package/dist/server/services/ai-localization-jobs.js.map +1 -0
  99. package/dist/server/services/ai-localization-jobs.mjs +62 -0
  100. package/dist/server/services/ai-localization-jobs.mjs.map +1 -0
  101. package/dist/server/services/ai-localizations.js +253 -5
  102. package/dist/server/services/ai-localizations.js.map +1 -1
  103. package/dist/server/services/ai-localizations.mjs +253 -5
  104. package/dist/server/services/ai-localizations.mjs.map +1 -1
  105. package/dist/server/services/index.js +5 -1
  106. package/dist/server/services/index.js.map +1 -1
  107. package/dist/server/services/index.mjs +5 -1
  108. package/dist/server/services/index.mjs.map +1 -1
  109. package/dist/server/services/metrics.js +12 -1
  110. package/dist/server/services/metrics.js.map +1 -1
  111. package/dist/server/services/metrics.mjs +12 -1
  112. package/dist/server/services/metrics.mjs.map +1 -1
  113. package/dist/server/services/settings.js +25 -0
  114. package/dist/server/services/settings.js.map +1 -0
  115. package/dist/server/services/settings.mjs +23 -0
  116. package/dist/server/services/settings.mjs.map +1 -0
  117. package/dist/server/src/bootstrap.d.ts.map +1 -1
  118. package/dist/server/src/controllers/ai-localization-jobs.d.ts +17 -0
  119. package/dist/server/src/controllers/ai-localization-jobs.d.ts.map +1 -0
  120. package/dist/server/src/controllers/index.d.ts +10 -0
  121. package/dist/server/src/controllers/index.d.ts.map +1 -1
  122. package/dist/server/src/controllers/settings.d.ts +7 -0
  123. package/dist/server/src/controllers/settings.d.ts.map +1 -0
  124. package/dist/server/src/index.d.ts +41 -2
  125. package/dist/server/src/index.d.ts.map +1 -1
  126. package/dist/server/src/models/ai-localization-job.d.ts +5 -0
  127. package/dist/server/src/models/ai-localization-job.d.ts.map +1 -0
  128. package/dist/server/src/models/index.d.ts +5 -0
  129. package/dist/server/src/models/index.d.ts.map +1 -0
  130. package/dist/server/src/register.d.ts +1 -1
  131. package/dist/server/src/register.d.ts.map +1 -1
  132. package/dist/server/src/routes/admin.d.ts.map +1 -1
  133. package/dist/server/src/services/ai-localization-jobs.d.ts +26 -0
  134. package/dist/server/src/services/ai-localization-jobs.d.ts.map +1 -0
  135. package/dist/server/src/services/ai-localizations.d.ts +11 -1
  136. package/dist/server/src/services/ai-localizations.d.ts.map +1 -1
  137. package/dist/server/src/services/index.d.ts +30 -1
  138. package/dist/server/src/services/index.d.ts.map +1 -1
  139. package/dist/server/src/services/metrics.d.ts +1 -0
  140. package/dist/server/src/services/metrics.d.ts.map +1 -1
  141. package/dist/server/src/services/settings.d.ts +13 -0
  142. package/dist/server/src/services/settings.d.ts.map +1 -0
  143. package/dist/server/src/utils/index.d.ts +7 -1
  144. package/dist/server/src/utils/index.d.ts.map +1 -1
  145. package/dist/server/src/validation/settings.d.ts +12 -0
  146. package/dist/server/src/validation/settings.d.ts.map +1 -0
  147. package/dist/server/utils/index.js.map +1 -1
  148. package/dist/server/utils/index.mjs.map +1 -1
  149. package/dist/server/validation/settings.js +11 -0
  150. package/dist/server/validation/settings.js.map +1 -0
  151. package/dist/server/validation/settings.mjs +9 -0
  152. package/dist/server/validation/settings.mjs.map +1 -0
  153. package/dist/shared/contracts/ai-localization-jobs.d.ts +27 -0
  154. package/dist/shared/contracts/ai-localization-jobs.d.ts.map +1 -0
  155. package/dist/shared/contracts/settings.d.ts +40 -0
  156. package/dist/shared/contracts/shared.d.ts.map +1 -0
  157. package/package.json +8 -6
@@ -5,7 +5,9 @@ var strapiAdmin = require('@strapi/admin/strapi-admin');
5
5
  const i18nApi = strapiAdmin.adminApi.enhanceEndpoints({
6
6
  addTagTypes: [
7
7
  'Locale',
8
- 'KeyStatistics'
8
+ 'KeyStatistics',
9
+ 'Settings',
10
+ 'AILocalizationJobs'
9
11
  ]
10
12
  });
11
13
 
@@ -1 +1 @@
1
- {"version":3,"file":"api.js","sources":["../../../admin/src/services/api.ts"],"sourcesContent":["import { adminApi } from '@strapi/admin/strapi-admin';\n\nconst i18nApi = adminApi.enhanceEndpoints({\n addTagTypes: ['Locale', 'KeyStatistics'],\n});\n\nexport { i18nApi };\n"],"names":["i18nApi","adminApi","enhanceEndpoints","addTagTypes"],"mappings":";;;;AAEMA,MAAAA,OAAAA,GAAUC,oBAASC,CAAAA,gBAAgB,CAAC;IACxCC,WAAa,EAAA;AAAC,QAAA,QAAA;AAAU,QAAA;AAAgB;AAC1C,CAAA;;;;"}
1
+ {"version":3,"file":"api.js","sources":["../../../admin/src/services/api.ts"],"sourcesContent":["import { adminApi } from '@strapi/admin/strapi-admin';\n\nconst i18nApi = adminApi.enhanceEndpoints({\n addTagTypes: ['Locale', 'KeyStatistics', 'Settings', 'AILocalizationJobs'],\n});\n\nexport { i18nApi };\n"],"names":["i18nApi","adminApi","enhanceEndpoints","addTagTypes"],"mappings":";;;;AAEMA,MAAAA,OAAAA,GAAUC,oBAASC,CAAAA,gBAAgB,CAAC;IACxCC,WAAa,EAAA;AAAC,QAAA,QAAA;AAAU,QAAA,eAAA;AAAiB,QAAA,UAAA;AAAY,QAAA;AAAqB;AAC5E,CAAA;;;;"}
@@ -3,7 +3,9 @@ import { adminApi } from '@strapi/admin/strapi-admin';
3
3
  const i18nApi = adminApi.enhanceEndpoints({
4
4
  addTagTypes: [
5
5
  'Locale',
6
- 'KeyStatistics'
6
+ 'KeyStatistics',
7
+ 'Settings',
8
+ 'AILocalizationJobs'
7
9
  ]
8
10
  });
9
11
 
@@ -1 +1 @@
1
- {"version":3,"file":"api.mjs","sources":["../../../admin/src/services/api.ts"],"sourcesContent":["import { adminApi } from '@strapi/admin/strapi-admin';\n\nconst i18nApi = adminApi.enhanceEndpoints({\n addTagTypes: ['Locale', 'KeyStatistics'],\n});\n\nexport { i18nApi };\n"],"names":["i18nApi","adminApi","enhanceEndpoints","addTagTypes"],"mappings":";;AAEMA,MAAAA,OAAAA,GAAUC,QAASC,CAAAA,gBAAgB,CAAC;IACxCC,WAAa,EAAA;AAAC,QAAA,QAAA;AAAU,QAAA;AAAgB;AAC1C,CAAA;;;;"}
1
+ {"version":3,"file":"api.mjs","sources":["../../../admin/src/services/api.ts"],"sourcesContent":["import { adminApi } from '@strapi/admin/strapi-admin';\n\nconst i18nApi = adminApi.enhanceEndpoints({\n addTagTypes: ['Locale', 'KeyStatistics', 'Settings', 'AILocalizationJobs'],\n});\n\nexport { i18nApi };\n"],"names":["i18nApi","adminApi","enhanceEndpoints","addTagTypes"],"mappings":";;AAEMA,MAAAA,OAAAA,GAAUC,QAASC,CAAAA,gBAAgB,CAAC;IACxCC,WAAa,EAAA;AAAC,QAAA,QAAA;AAAU,QAAA,eAAA;AAAiB,QAAA,UAAA;AAAY,QAAA;AAAqB;AAC5E,CAAA;;;;"}
@@ -0,0 +1,29 @@
1
+ 'use strict';
2
+
3
+ var api = require('./api.js');
4
+
5
+ const settingsApi = api.i18nApi.injectEndpoints({
6
+ endpoints: (builder)=>({
7
+ getSettings: builder.query({
8
+ query: ()=>'/i18n/settings',
9
+ providesTags: [
10
+ 'Settings'
11
+ ]
12
+ }),
13
+ updatei18nSettings: builder.mutation({
14
+ query: (data)=>({
15
+ url: '/i18n/settings',
16
+ method: 'PUT',
17
+ data
18
+ }),
19
+ invalidatesTags: [
20
+ 'Settings'
21
+ ]
22
+ })
23
+ })
24
+ });
25
+ const { useGetSettingsQuery, useUpdatei18nSettingsMutation } = settingsApi;
26
+
27
+ exports.useGetSettingsQuery = useGetSettingsQuery;
28
+ exports.useUpdatei18nSettingsMutation = useUpdatei18nSettingsMutation;
29
+ //# sourceMappingURL=settings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.js","sources":["../../../admin/src/services/settings.ts"],"sourcesContent":["import { i18nApi } from './api';\n\nimport type { GetSettings, UpdateSettings } from '../../../shared/contracts/settings';\n\nconst settingsApi = i18nApi.injectEndpoints({\n endpoints: (builder) => ({\n getSettings: builder.query<GetSettings.Response['data'], void>({\n query: () => '/i18n/settings',\n providesTags: ['Settings'],\n }),\n updatei18nSettings: builder.mutation<UpdateSettings.Response, UpdateSettings.Request['body']>({\n query: (data) => ({\n url: '/i18n/settings',\n method: 'PUT',\n data,\n }),\n invalidatesTags: ['Settings'],\n }),\n }),\n});\n\nconst { useGetSettingsQuery, useUpdatei18nSettingsMutation } = settingsApi;\n\nexport { useGetSettingsQuery, useUpdatei18nSettingsMutation };\n"],"names":["settingsApi","i18nApi","injectEndpoints","endpoints","builder","getSettings","query","providesTags","updatei18nSettings","mutation","data","url","method","invalidatesTags","useGetSettingsQuery","useUpdatei18nSettingsMutation"],"mappings":";;;;AAIA,MAAMA,WAAAA,GAAcC,WAAQC,CAAAA,eAAe,CAAC;IAC1CC,SAAW,EAAA,CAACC,WAAa;YACvBC,WAAaD,EAAAA,OAAAA,CAAQE,KAAK,CAAqC;AAC7DA,gBAAAA,KAAAA,EAAO,IAAM,gBAAA;gBACbC,YAAc,EAAA;AAAC,oBAAA;AAAW;AAC5B,aAAA,CAAA;YACAC,kBAAoBJ,EAAAA,OAAAA,CAAQK,QAAQ,CAA0D;gBAC5FH,KAAO,EAAA,CAACI,QAAU;wBAChBC,GAAK,EAAA,gBAAA;wBACLC,MAAQ,EAAA,KAAA;AACRF,wBAAAA;qBACF,CAAA;gBACAG,eAAiB,EAAA;AAAC,oBAAA;AAAW;AAC/B,aAAA;SACF;AACF,CAAA,CAAA;AAEA,MAAM,EAAEC,mBAAmB,EAAEC,6BAA6B,EAAE,GAAGf;;;;;"}
@@ -0,0 +1,26 @@
1
+ import { i18nApi } from './api.mjs';
2
+
3
+ const settingsApi = i18nApi.injectEndpoints({
4
+ endpoints: (builder)=>({
5
+ getSettings: builder.query({
6
+ query: ()=>'/i18n/settings',
7
+ providesTags: [
8
+ 'Settings'
9
+ ]
10
+ }),
11
+ updatei18nSettings: builder.mutation({
12
+ query: (data)=>({
13
+ url: '/i18n/settings',
14
+ method: 'PUT',
15
+ data
16
+ }),
17
+ invalidatesTags: [
18
+ 'Settings'
19
+ ]
20
+ })
21
+ })
22
+ });
23
+ const { useGetSettingsQuery, useUpdatei18nSettingsMutation } = settingsApi;
24
+
25
+ export { useGetSettingsQuery, useUpdatei18nSettingsMutation };
26
+ //# sourceMappingURL=settings.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.mjs","sources":["../../../admin/src/services/settings.ts"],"sourcesContent":["import { i18nApi } from './api';\n\nimport type { GetSettings, UpdateSettings } from '../../../shared/contracts/settings';\n\nconst settingsApi = i18nApi.injectEndpoints({\n endpoints: (builder) => ({\n getSettings: builder.query<GetSettings.Response['data'], void>({\n query: () => '/i18n/settings',\n providesTags: ['Settings'],\n }),\n updatei18nSettings: builder.mutation<UpdateSettings.Response, UpdateSettings.Request['body']>({\n query: (data) => ({\n url: '/i18n/settings',\n method: 'PUT',\n data,\n }),\n invalidatesTags: ['Settings'],\n }),\n }),\n});\n\nconst { useGetSettingsQuery, useUpdatei18nSettingsMutation } = settingsApi;\n\nexport { useGetSettingsQuery, useUpdatei18nSettingsMutation };\n"],"names":["settingsApi","i18nApi","injectEndpoints","endpoints","builder","getSettings","query","providesTags","updatei18nSettings","mutation","data","url","method","invalidatesTags","useGetSettingsQuery","useUpdatei18nSettingsMutation"],"mappings":";;AAIA,MAAMA,WAAAA,GAAcC,OAAQC,CAAAA,eAAe,CAAC;IAC1CC,SAAW,EAAA,CAACC,WAAa;YACvBC,WAAaD,EAAAA,OAAAA,CAAQE,KAAK,CAAqC;AAC7DA,gBAAAA,KAAAA,EAAO,IAAM,gBAAA;gBACbC,YAAc,EAAA;AAAC,oBAAA;AAAW;AAC5B,aAAA,CAAA;YACAC,kBAAoBJ,EAAAA,OAAAA,CAAQK,QAAQ,CAA0D;gBAC5FH,KAAO,EAAA,CAACI,QAAU;wBAChBC,GAAK,EAAA,gBAAA;wBACLC,MAAQ,EAAA,KAAA;AACRF,wBAAAA;qBACF,CAAA;gBACAG,eAAiB,EAAA;AAAC,oBAAA;AAAW;AAC/B,aAAA;SACF;AACF,CAAA,CAAA;AAEA,MAAM,EAAEC,mBAAmB,EAAEC,6BAA6B,EAAE,GAAGf;;;;"}
@@ -3,16 +3,29 @@ import type { Locale } from '../../../shared/contracts/locales';
3
3
  import type { Modules } from '@strapi/types';
4
4
  declare const LocalePickerAction: ({ document, meta, model, collectionType, documentId, }: HeaderActionProps) => {
5
5
  label: string;
6
- options: {
6
+ options: ({
7
+ _render: () => import("react/jsx-runtime").JSX.Element;
8
+ disabled?: undefined;
9
+ value?: undefined;
10
+ label?: undefined;
11
+ startIcon?: undefined;
12
+ } | {
7
13
  disabled: boolean;
8
14
  value: string;
9
15
  label: import("react/jsx-runtime").JSX.Element;
10
- startIcon: import("react/jsx-runtime").JSX.Element | null;
11
- }[];
16
+ startIcon: import("react/jsx-runtime").JSX.Element;
17
+ _render?: undefined;
18
+ })[];
12
19
  customizeContent: () => string | undefined;
13
20
  onSelect: (value: string) => void;
14
21
  value: Locale | undefined;
15
22
  } | null;
23
+ declare const AITranslationStatusAction: ({ documentId, model, collectionType }: HeaderActionProps) => {
24
+ _status: {
25
+ message: import("react/jsx-runtime").JSX.Element;
26
+ tooltip: import("react/jsx-runtime").JSX.Element;
27
+ };
28
+ } | null;
16
29
  declare const FillFromAnotherLocaleAction: ({ documentId, meta, model, collectionType, }: HeaderActionProps) => {
17
30
  type: string;
18
31
  icon: import("react/jsx-runtime").JSX.Element;
@@ -33,4 +46,4 @@ export type LocaleStatus = {
33
46
  };
34
47
  declare const BulkLocalePublishAction: DocumentActionComponent;
35
48
  declare const BulkLocaleUnpublishAction: DocumentActionComponent;
36
- export { BulkLocalePublishAction, BulkLocaleUnpublishAction, DeleteLocaleAction, LocalePickerAction, FillFromAnotherLocaleAction, };
49
+ export { BulkLocalePublishAction, BulkLocaleUnpublishAction, DeleteLocaleAction, LocalePickerAction, FillFromAnotherLocaleAction, AITranslationStatusAction, };
@@ -3,7 +3,8 @@ interface LocaleListCellProps {
3
3
  locale: string;
4
4
  }[];
5
5
  locale: string;
6
+ documentId: string;
6
7
  }
7
- declare const LocaleListCell: ({ locale: currentLocale, localizations }: LocaleListCellProps) => import("react/jsx-runtime").JSX.Element | null;
8
+ declare const LocaleListCell: ({ locale: currentLocale, localizations, documentId, }: LocaleListCellProps) => import("react/jsx-runtime").JSX.Element | null;
8
9
  export { LocaleListCell };
9
10
  export type { LocaleListCellProps };
@@ -0,0 +1,9 @@
1
+ interface UseAILocalizationJobsPollingOptions {
2
+ documentId?: string;
3
+ model?: string;
4
+ collectionType?: string;
5
+ }
6
+ export declare const useAILocalizationJobsPolling: ({ documentId, model, collectionType, }: UseAILocalizationJobsPollingOptions) => {
7
+ status: "processing" | "completed" | "failed" | undefined;
8
+ };
9
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { GetAILocalizationJobsByDocument } from '../../../shared/contracts/ai-localization-jobs';
2
+ export declare const useGetAILocalizationJobsByDocumentQuery: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseQuery<import("@reduxjs/toolkit/query").QueryDefinition<{
3
+ documentId: string;
4
+ model: string;
5
+ collectionType: string;
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" | "AILocalizationJobs", GetAILocalizationJobsByDocument.Response, "adminApi">>;
@@ -1,2 +1,2 @@
1
- declare const i18nApi: import("@reduxjs/toolkit/query").Api<import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@strapi/admin/strapi-admin").QueryArguments, unknown, import("@strapi/admin/strapi-admin").BaseQueryError, {}, {}>, import("@reduxjs/toolkit/dist/query/endpointDefinitions").UpdateDefinitions<{}, "GuidedTourMeta" | "HomepageKeyStatistics" | "AIUsage" | "Locale" | "KeyStatistics", never>, "adminApi", "GuidedTourMeta" | "HomepageKeyStatistics" | "AIUsage" | "Locale" | "KeyStatistics", typeof import("@reduxjs/toolkit/query").coreModuleName | typeof import("@reduxjs/toolkit/dist/query/react").reactHooksModuleName>;
1
+ declare const i18nApi: import("@reduxjs/toolkit/query").Api<import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@strapi/admin/strapi-admin").QueryArguments, unknown, import("@strapi/admin/strapi-admin").BaseQueryError, {}, {}>, import("@reduxjs/toolkit/dist/query/endpointDefinitions").UpdateDefinitions<{}, "GuidedTourMeta" | "HomepageKeyStatistics" | "AIUsage" | "Locale" | "KeyStatistics" | "Settings" | "AILocalizationJobs", never>, "adminApi", "GuidedTourMeta" | "HomepageKeyStatistics" | "AIUsage" | "Locale" | "KeyStatistics" | "Settings" | "AILocalizationJobs", typeof import("@reduxjs/toolkit/query").coreModuleName | typeof import("@reduxjs/toolkit/dist/query/react").reactHooksModuleName>;
2
2
  export { i18nApi };
@@ -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" | "AIUsage" | "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" | "AIUsage" | "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" | "AIUsage" | "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" | "AIUsage" | "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" | "AIUsage" | "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" | "AILocalizationJobs", 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" | "AILocalizationJobs", 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" | "AILocalizationJobs", 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" | "AILocalizationJobs", 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" | "AILocalizationJobs", 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" | "AIUsage" | "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" | "AILocalizationJobs", 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" | "AILocalizationJobs", 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" | "AILocalizationJobs", UpdateSettings.Response, "adminApi">>;
5
+ export { useGetSettingsQuery, useUpdatei18nSettingsMutation };
@@ -20,8 +20,16 @@ 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 in the default locale.",
26
+ "CMEditViewAITranslation.settings-link": "{enabled, select, true {Disable it in settings} false {Enable it in settings} other {Enable it in settings}}",
27
+ "CMEditViewAITranslation.job-completed": "AI translation completed successfully!",
28
+ "CMEditViewAITranslation.job-failed": "AI translation failed. Please try again.",
23
29
  "CMEditViewLocalePicker.locale.create": "Create <bold>{locale}</bold> locale",
30
+ "CMEditViewLocalePicker.locale.ai-translations": "AI Translations:",
24
31
  "CMListView.popover.display-locales.label": "Display translated locales",
32
+ "CMListView.popover.display-locales.more": "{locales} + {count} more",
25
33
  "CheckboxConfirmation.Modal.body": "Do you want to disable it?",
26
34
  "CheckboxConfirmation.Modal.button-confirm": "Yes, disable",
27
35
  "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 +44,8 @@ var en = {
36
44
  "Settings.list.description": "Configure the settings for the Internationalization plugin",
37
45
  "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
46
  "Settings.list.empty.title": "There are no locales.",
47
+ "Settings.aiLocalizations.label": "AI Translations",
48
+ "Settings.aiLocalizations.description": "Everytime you save in the Content Manager, our AI will use your default locale to translate all other locales automatically.",
39
49
  "Settings.locales.default": "Default",
40
50
  "Settings.locales.list.sort.default": "Sort by the default locale",
41
51
  "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,16 @@ 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 in the default locale.",
24
+ "CMEditViewAITranslation.settings-link": "{enabled, select, true {Disable it in settings} false {Enable it in settings} other {Enable it in settings}}",
25
+ "CMEditViewAITranslation.job-completed": "AI translation completed successfully!",
26
+ "CMEditViewAITranslation.job-failed": "AI translation failed. Please try again.",
21
27
  "CMEditViewLocalePicker.locale.create": "Create <bold>{locale}</bold> locale",
28
+ "CMEditViewLocalePicker.locale.ai-translations": "AI Translations:",
22
29
  "CMListView.popover.display-locales.label": "Display translated locales",
30
+ "CMListView.popover.display-locales.more": "{locales} + {count} more",
23
31
  "CheckboxConfirmation.Modal.body": "Do you want to disable it?",
24
32
  "CheckboxConfirmation.Modal.button-confirm": "Yes, disable",
25
33
  "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 +42,8 @@ var en = {
34
42
  "Settings.list.description": "Configure the settings for the Internationalization plugin",
35
43
  "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
44
  "Settings.list.empty.title": "There are no locales.",
45
+ "Settings.aiLocalizations.label": "AI Translations",
46
+ "Settings.aiLocalizations.description": "Everytime you save in the Content Manager, our AI will use your default locale to translate all other locales automatically.",
37
47
  "Settings.locales.default": "Default",
38
48
  "Settings.locales.list.sort.default": "Sort by the default locale",
39
49
  "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,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,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,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;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,a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AA;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,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;QAC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A,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;;;;"}
@@ -72,6 +72,8 @@ var bootstrap = (async ()=>{
72
72
  engine.registerI18nPermissionsHandlers();
73
73
  // Hooks & Models
74
74
  registerModelsHooks();
75
+ // AI Localizations
76
+ index.getService('ai-localizations').setupMiddleware();
75
77
  sendDidInitializeEvent();
76
78
  });
77
79
 
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap.js","sources":["../../server/src/bootstrap.ts"],"sourcesContent":["import type { Schema } from '@strapi/types';\nimport { getService } from './utils';\n\nconst registerModelsHooks = () => {\n strapi.db.lifecycles.subscribe({\n models: ['plugin::i18n.locale'],\n\n async afterCreate() {\n await getService('permissions').actions.syncSuperAdminPermissionsWithLocales();\n },\n\n async afterDelete() {\n await getService('permissions').actions.syncSuperAdminPermissionsWithLocales();\n },\n });\n\n strapi.documents.use(async (context, next) => {\n const schema: Schema.ContentType = context.contentType;\n\n if (!['create', 'update', 'discardDraft', 'publish'].includes(context.action)) {\n return next();\n }\n\n if (!getService('content-types').isLocalizedContentType(schema)) {\n return next();\n }\n\n // Build a populate array for all non localized fields within the schema\n const { getNestedPopulateOfNonLocalizedAttributes } = getService('content-types');\n\n const attributesToPopulate = getNestedPopulateOfNonLocalizedAttributes(schema.uid);\n\n // Get the result of the document service action\n const result = (await next()) as any;\n\n // We may not have received a result with everything populated that we need\n // Use the id and populate built from non localized fields to get the full\n // result\n let resultID;\n // TODO: fix bug where an empty array can be returned\n if (Array.isArray(result?.entries) && result.entries[0]?.id) {\n resultID = result.entries[0].id;\n } else if (result?.id) {\n resultID = result.id;\n } else {\n return result;\n }\n\n if (attributesToPopulate.length > 0) {\n const populatedResult = await strapi.db\n .query(schema.uid)\n .findOne({ where: { id: resultID }, populate: attributesToPopulate });\n\n await getService('localizations').syncNonLocalizedAttributes(populatedResult, schema);\n }\n\n return result;\n });\n};\n\nexport default async () => {\n const { sendDidInitializeEvent } = getService('metrics');\n const { initDefaultLocale } = getService('locales');\n const { sectionsBuilder, actions, engine } = getService('permissions');\n\n // Data\n await initDefaultLocale();\n\n // Sections Builder\n sectionsBuilder.registerLocalesPropertyHandler();\n\n // Actions\n await actions.registerI18nActions();\n actions.registerI18nActionsHooks();\n actions.updateActionsProperties();\n\n // Engine/Permissions\n engine.registerI18nPermissionsHandlers();\n\n // Hooks & Models\n registerModelsHooks();\n\n sendDidInitializeEvent();\n};\n"],"names":["registerModelsHooks","strapi","db","lifecycles","subscribe","models","afterCreate","getService","actions","syncSuperAdminPermissionsWithLocales","afterDelete","documents","use","context","next","schema","contentType","includes","action","isLocalizedContentType","getNestedPopulateOfNonLocalizedAttributes","attributesToPopulate","uid","result","resultID","Array","isArray","entries","id","length","populatedResult","query","findOne","where","populate","syncNonLocalizedAttributes","sendDidInitializeEvent","initDefaultLocale","sectionsBuilder","engine","registerLocalesPropertyHandler","registerI18nActions","registerI18nActionsHooks","updateAction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sBAAAA,EAAAA;AACF,CAAA;;;;"}
1
+ {"version":3,"file":"bootstrap.js","sources":["../../server/src/bootstrap.ts"],"sourcesContent":["import type { Schema } from '@strapi/types';\nimport { getService } from './utils';\n\nconst registerModelsHooks = () => {\n strapi.db.lifecycles.subscribe({\n models: ['plugin::i18n.locale'],\n\n async afterCreate() {\n await getService('permissions').actions.syncSuperAdminPermissionsWithLocales();\n },\n\n async afterDelete() {\n await getService('permissions').actions.syncSuperAdminPermissionsWithLocales();\n },\n });\n\n strapi.documents.use(async (context, next) => {\n const schema: Schema.ContentType = context.contentType;\n\n if (!['create', 'update', 'discardDraft', 'publish'].includes(context.action)) {\n return next();\n }\n\n if (!getService('content-types').isLocalizedContentType(schema)) {\n return next();\n }\n\n // Build a populate array for all non localized fields within the schema\n const { getNestedPopulateOfNonLocalizedAttributes } = getService('content-types');\n\n const attributesToPopulate = getNestedPopulateOfNonLocalizedAttributes(schema.uid);\n\n // Get the result of the document service action\n const result = (await next()) as any;\n\n // We may not have received a result with everything populated that we need\n // Use the id and populate built from non localized fields to get the full\n // result\n let resultID;\n // TODO: fix bug where an empty array can be returned\n if (Array.isArray(result?.entries) && result.entries[0]?.id) {\n resultID = result.entries[0].id;\n } else if (result?.id) {\n resultID = result.id;\n } else {\n return result;\n }\n\n if (attributesToPopulate.length > 0) {\n const populatedResult = await strapi.db\n .query(schema.uid)\n .findOne({ where: { id: resultID }, populate: attributesToPopulate });\n\n await getService('localizations').syncNonLocalizedAttributes(populatedResult, schema);\n }\n\n return result;\n });\n};\n\nexport default async () => {\n const { sendDidInitializeEvent } = getService('metrics');\n const { initDefaultLocale } = getService('locales');\n const { sectionsBuilder, actions, engine } = getService('permissions');\n\n // Data\n await initDefaultLocale();\n\n // Sections Builder\n sectionsBuilder.registerLocalesPropertyHandler();\n\n // Actions\n await actions.registerI18nActions();\n actions.registerI18nActionsHooks();\n actions.updateActionsProperties();\n\n // Engine/Permissions\n engine.registerI18nPermissionsHandlers();\n\n // Hooks & Models\n registerModelsHooks();\n\n // AI Localizations\n getService('ai-localizations').setupMiddleware();\n\n sendDidInitializeEvent();\n};\n"],"names":["registerModelsHooks","strapi","db","lifecycles","subscribe","models","afterCreate","getService","actions","syncSuperAdminPermissionsWithLocales","afterDelete","documents","use","context","next","schema","contentType","includes","action","isLocalizedContentType","getNestedPopulateOfNonLocalizedAttributes","attributesToPopulate","uid","result","resultID","Array","isArray","entries","id","length","populatedResult","query","findOne","where","populate","syncNonLocalizedAttributes","sendDidInitializeEvent","initDefaultLocale","sectionsBuilder","engine","registerLocalesPropertyHandler","registerI18nActions","registerI18nActionsHooks","updateActionsProperties","registerI18nPermissionsHandlers","setupMiddleware"],"mappings":";;;;AAGA,MAAMA,mBAAsB,GAAA,IAAA;AAC1BC,IAAAA,MAAAA,CAAOC,EAAE,CAACC,UAAU,CAACC,SAAS,CAAC;QAC7BC,MAAQ,EAAA;AAAC,YAAA;AAAsB,SAAA;QAE/B,MAAMC,WAAAA,CAAAA,GAAAA;AACJ,YAAA,MAAMC,gBAAW,CAAA,aAAA,CAAA,CAAeC,OAAO,CAACC,oCAAoC,EAAA;AAC9E,SAAA;QAEA,MAAMC,WAAAA,CAAAA,GAAAA;AACJ,YAAA,MAAMH,gBAAW,CAAA,aAAA,CAAA,CAAeC,OAAO,CAACC,oCAAoC,EAAA;AAC9E;AACF,KAAA,CAAA;AAEAR,IAAAA,MAAAA,CAAOU,SAAS,CAACC,GAAG,CAAC,OAAOC,OAASC,EAAAA,IAAAA,GAAAA;QACnC,MAAMC,MAAAA,GAA6BF,QAAQG,WAAW;AAEtD,QAAA,IAAI,CAAC;AAAC,YAAA,QAAA;AAAU,YAAA,QAAA;AAAU,YAAA,cAAA;AAAgB,YAAA;AAAU,SAAA,CAACC,QAAQ,CAACJ,OAAQK,CAAAA,MAAM,CAAG,EAAA;YAC7E,OAAOJ,IAAAA,EAAAA;AACT;AAEA,QAAA,IAAI,CAACP,gBAAAA,CAAW,eAAiBY,CAAAA,CAAAA,sBAA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M,EAAE+B,eAAe,EAAE9B,OAAO,EAAE+B,MAAM,EAAE,GAAGhC,gBAAW,CAAA,aAAA,CAAA;;IAGxD,MAAM8B,iBAAAA,EAAAA;;AAGNC,IAAAA,eAAAA,CAAgBE,8BAA8B,EAAA;;AAG9C,IAAA,MAAMhC,QAAQiC,mBAAmB,EAAA;AACjCjC,IAAAA,OAAAA,CAAQkC,wBAAwB,EAAA;AAChClC,IAAAA,OAAAA,CAAQmC,uBAAuB,EAAA;;AAG/BJ,IAAAA,MAAAA,CAAOK,+BAA+B,EAAA;;AAGtC5C,IAAAA,mBAAAA,EAAAA;;AAGAO,IAAAA,gBAAAA,CAAW,oBAAoBsC,eAAe,EAAA;AAE9CT,IAAAA,sBAAAA,EAAAA;AACF,CAAA;;;;"}
@@ -70,6 +70,8 @@ var bootstrap = (async ()=>{
70
70
  engine.registerI18nPermissionsHandlers();
71
71
  // Hooks & Models
72
72
  registerModelsHooks();
73
+ // AI Localizations
74
+ getService('ai-localizations').setupMiddleware();
73
75
  sendDidInitializeEvent();
74
76
  });
75
77
 
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap.mjs","sources":["../../server/src/bootstrap.ts"],"sourcesContent":["import type { Schema } from '@strapi/types';\nimport { getService } from './utils';\n\nconst registerModelsHooks = () => {\n strapi.db.lifecycles.subscribe({\n models: ['plugin::i18n.locale'],\n\n async afterCreate() {\n await getService('permissions').actions.syncSuperAdminPermissionsWithLocales();\n },\n\n async afterDelete() {\n await getService('permissions').actions.syncSuperAdminPermissionsWithLocales();\n },\n });\n\n strapi.documents.use(async (context, next) => {\n const schema: Schema.ContentType = context.contentType;\n\n if (!['create', 'update', 'discardDraft', 'publish'].includes(context.action)) {\n return next();\n }\n\n if (!getService('content-types').isLocalizedContentType(schema)) {\n return next();\n }\n\n // Build a populate array for all non localized fields within the schema\n const { getNestedPopulateOfNonLocalizedAttributes } = getService('content-types');\n\n const attributesToPopulate = getNestedPopulateOfNonLocalizedAttributes(schema.uid);\n\n // Get the result of the document service action\n const result = (await next()) as any;\n\n // We may not have received a result with everything populated that we need\n // Use the id and populate built from non localized fields to get the full\n // result\n let resultID;\n // TODO: fix bug where an empty array can be returned\n if (Array.isArray(result?.entries) && result.entries[0]?.id) {\n resultID = result.entries[0].id;\n } else if (result?.id) {\n resultID = result.id;\n } else {\n return result;\n }\n\n if (attributesToPopulate.length > 0) {\n const populatedResult = await strapi.db\n .query(schema.uid)\n .findOne({ where: { id: resultID }, populate: attributesToPopulate });\n\n await getService('localizations').syncNonLocalizedAttributes(populatedResult, schema);\n }\n\n return result;\n });\n};\n\nexport default async () => {\n const { sendDidInitializeEvent } = getService('metrics');\n const { initDefaultLocale } = getService('locales');\n const { sectionsBuilder, actions, engine } = getService('permissions');\n\n // Data\n await initDefaultLocale();\n\n // Sections Builder\n sectionsBuilder.registerLocalesPropertyHandler();\n\n // Actions\n await actions.registerI18nActions();\n actions.registerI18nActionsHooks();\n actions.updateActionsProperties();\n\n // Engine/Permissions\n engine.registerI18nPermissionsHandlers();\n\n // Hooks & Models\n registerModelsHooks();\n\n sendDidInitializeEvent();\n};\n"],"names":["registerModelsHooks","strapi","db","lifecycles","subscribe","models","afterCreate","getService","actions","syncSuperAdminPermissionsWithLocales","afterDelete","documents","use","context","next","schema","contentType","includes","action","isLocalizedContentType","getNestedPopulateOfNonLocalizedAttributes","attributesToPopulate","uid","result","resultID","Array","isArray","entries","id","length","populatedResult","query","findOne","where","populate","syncNonLocalizedAttributes","sendDidInitializeEvent","initDefaultLocale","sectionsBuilder","engine","registerLocalesPropertyHandler","registerI18nActions","registerI18nActionsHooks","updateActionsProperties","registerI18nPermissionsHandlers"],"mappings":";;AAGA,MAAMA,mBAAsB,GAAA,IAAA;AAC1BC,IAAAA,MAAAA,CAAOC,EAAE,CAACC,UAAU,CAACC,SAAS,CAAC;QAC7BC,MAAQ,EAAA;AAAC,YAAA;AAAsB,SAAA;QAE/B,MAAMC,WAAAA,CAAAA,GAAAA;AACJ,YAAA,MAAMC,UA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BQ,MAAM,GAAG,CAAG,EAAA;YACnC,MAAMC,eAAAA,GAAkB,MAAM7B,MAAAA,CAAOC,EAAE,CACpC6B,KAAK,CAAChB,MAAOO,CAAAA,GAAG,CAChBU,CAAAA,OAAO,CAAC;gBAAEC,KAAO,EAAA;oBAAEL,EAAIJ,EAAAA;AAAS,iBAAA;gBAAGU,QAAUb,EAAAA;AAAqB,aAAA,CAAA;AAErE,YAAA,MAAMd,UAAW,CAAA,eAAA,CAAA,CAAiB4B,0BAA0B,CAACL,eAAiBf,EAAAA,MAAAA,CAAAA;AAChF;QAEA,OAAOQ,MAAAA;AACT,KAAA,CAAA;AACF,CAAA;AAEA,gBAAe,CAAA,UAAA;AACb,IAAA,MAAM,EAAEa,sBAAsB,EAAE,GAAG7B,UAAW,CAAA,SAAA,CAAA;AAC9C,IAAA,MAAM,EAAE8B,iBAAiB,EAAE,GAAG9B,UAAW,CAAA,SAAA,CAAA;IACzC,MAAM,EAAE+B,eAAe,EAAE9B,OAAO,EAAE+B,MAAM,EAAE,GAAGhC,UAAW,CAAA,aAAA,CAAA;;IAGxD,MAAM8B,iBAAAA,EAAAA;;AAGNC,IAAAA,eAAAA,CAAgBE,8BAA8B,EAAA;;AAG9C,IAAA,MAAMhC,QAAQiC,mBAAmB,EAAA;AACjCjC,IAAAA,OAAAA,CAAQkC,wBAAwB,EAAA;AAChClC,IAAAA,OAAAA,CAAQmC,uBAAuB,EAAA;;AAG/BJ,IAAAA,MAAAA,CAAOK,+BAA+B,EAAA;;AAGtC5C,IAAAA,mBAAAA,EAAAA;AAEAoC,IAAAA,sBAAAA,EAAAA;AACF,CAAA;;;;"}
1
+ {"version":3,"file":"bootstrap.mjs","sources":["../../server/src/bootstrap.ts"],"sourcesContent":["import type { Schema } from '@strapi/types';\nimport { getService } from './utils';\n\nconst registerModelsHooks = () => {\n strapi.db.lifecycles.subscribe({\n models: ['plugin::i18n.locale'],\n\n async afterCreate() {\n await getService('permissions').actions.syncSuperAdminPermissionsWithLocales();\n },\n\n async afterDelete() {\n await getService('permissions').actions.syncSuperAdminPermissionsWithLocales();\n },\n });\n\n strapi.documents.use(async (context, next) => {\n const schema: Schema.ContentType = context.contentType;\n\n if (!['create', 'update', 'discardDraft', 'publish'].includes(context.action)) {\n return next();\n }\n\n if (!getService('content-types').isLocalizedContentType(schema)) {\n return next();\n }\n\n // Build a populate array for all non localized fields within the schema\n const { getNestedPopulateOfNonLocalizedAttributes } = getService('content-types');\n\n const attributesToPopulate = getNestedPopulateOfNonLocalizedAttributes(schema.uid);\n\n // Get the result of the document service action\n const result = (await next()) as any;\n\n // We may not have received a result with everything populated that we need\n // Use the id and populate built from non localized fields to get the full\n // result\n let resultID;\n // TODO: fix bug where an empty array can be returned\n if (Array.isArray(result?.entries) && result.entries[0]?.id) {\n resultID = result.entries[0].id;\n } else if (result?.id) {\n resultID = result.id;\n } else {\n return result;\n }\n\n if (attributesToPopulate.length > 0) {\n const populatedResult = await strapi.db\n .query(schema.uid)\n .findOne({ where: { id: resultID }, populate: attributesToPopulate });\n\n await getService('localizations').syncNonLocalizedAttributes(populatedResult, schema);\n }\n\n return result;\n });\n};\n\nexport default async () => {\n const { sendDidInitializeEvent } = getService('metrics');\n const { initDefaultLocale } = getService('locales');\n const { sectionsBuilder, actions, engine } = getService('permissions');\n\n // Data\n await initDefaultLocale();\n\n // Sections Builder\n sectionsBuilder.registerLocalesPropertyHandler();\n\n // Actions\n await actions.registerI18nActions();\n actions.registerI18nActionsHooks();\n actions.updateActionsProperties();\n\n // Engine/Permissions\n engine.registerI18nPermissionsHandlers();\n\n // Hooks & Models\n registerModelsHooks();\n\n // AI Localizations\n getService('ai-localizations').setupMiddleware();\n\n sendDidInitializeEvent();\n};\n"],"names":["registerModelsHooks","strapi","db","lifecycles","subscribe","models","afterCreate","getService","actions","syncSuperAdminPermissionsWithLocales","afterDelete","documents","use","context","next","schema","contentType","includes","action","isLocalizedContentType","getNestedPopulateOfNonLocalizedAttributes","attributesToPopulate","uid","result","resultID","Array","isArray","entries","id","length","populatedResult","query","findOne","where","populate","syncNonLocalizedAttributes","sendDidInitializeEvent","initDefaultLocale","sectionsBuilder","engine","registerLocalesPropertyHandler","registerI18nActions","registerI18nActionsHooks","updateActionsProperties","registerI18nPermissionsHandlers","setupMiddleware"],"mappings":";;AAGA,MAAMA,mBAAsB,GAAA,IAAA;AAC1BC,IAAAA,MAAAA,CAAOC,EAAE,CAACC,UAAU,CAACC,SAAS,CAAC;QAC7BC,MAAQ,EAAA;AAAC,YAAA;AAAsB,SAAA;QAE/B,MAAMC,WAAAA,CAAAA,GAAAA;AACJ,YAAA,MAAMC,UAAW,CAAA,aAAA,CAAA,CAAeC,OAAO,CAACC,oCAAoC,EAAA;AAC9E,SAAA;QAEA,MAAMC,WAAAA,CAAAA,GAAAA;AACJ,YAAA,MAAMH,UAAW,CAAA,aAAA,CAAA,CAAeC,OAAO,CAACC,oCAAoC,EAAA;AAC9E;AACF,KAAA,CAAA;AAEAR,IAAAA,MAAAA,CAAOU,SAAS,CAACC,GAAG,CAAC,OAAOC,OAASC,EAAAA,IAAAA,GAAAA;QACnC,MAAMC,MAAAA,GAA6BF,QAAQG,WAAW;AAEtD,QAAA,IAAI,CAAC;AAAC,YAAA,QAAA;AAAU,YAAA,QAAA;AAAU,YAAA,cAAA;AAAgB,YAAA;AAAU,SAAA,CAACC,QAAQ,CAACJ,OAAQK,CAAAA,MAAM,CAAG,EAAA;YAC7E,OAAOJ,IAAAA,EAAAA;AACT;AAEA,QAAA,IAAI,CAACP,UAAAA,CAAW,eAAiBY,CAAAA,CAAAA,sBAAsB,CAACJ,MAAS,CAAA,EAAA;YAC/D,OAAOD,IAAAA,EAAAA;AACT;;AAGA,QAAA,MAAM,EAAEM,yCAAyC,EAAE,GAAGb,UAAW,CAAA,eAAA,CAAA;QAEjE,MAAMc,oBAAAA,GAAuBD,yCAA0CL,CAAAA,MAAAA,CAAOO,GAAG,CAAA;;AAGjF,QAAA,MAAMC,SAAU,MAAMT,IAAAA,EA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C,IAAAA,OAAAA,CAAQmC,uBAAuB,EAAA;;AAG/BJ,IAAAA,MAAAA,CAAOK,+BAA+B,EAAA;;AAGtC5C,IAAAA,mBAAAA,EAAAA;;AAGAO,IAAAA,UAAAA,CAAW,oBAAoBsC,eAAe,EAAA;AAE9CT,IAAAA,sBAAAA,EAAAA;AACF,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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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,47 @@
1
+ 'use strict';
2
+
3
+ const createAILocalizationJobsController = ({ strapi })=>{
4
+ const getService = (name)=>strapi.plugin('i18n').service(name);
5
+ const aiLocalizationJobsService = getService('ai-localization-jobs');
6
+ return {
7
+ /**
8
+ * Get a job for a singleType using the contentType
9
+ * There is only 1 job per contentType
10
+ */ async getJobForSingleType (ctx) {
11
+ const { contentType } = ctx.params;
12
+ if (!contentType) {
13
+ return ctx.badRequest('contentType is required');
14
+ }
15
+ try {
16
+ const job = await aiLocalizationJobsService.getJobByContentType(contentType);
17
+ ctx.body = {
18
+ data: job
19
+ };
20
+ } catch (error) {
21
+ strapi.log.error('[AI Localizations Jobs] Error fetching job:', error);
22
+ ctx.internalServerError('Failed to fetch AI localizations job');
23
+ }
24
+ },
25
+ /**
26
+ * Get a job for a collectionType using the documentId
27
+ * There is only 1 job per documentId
28
+ */ async getJobForCollectionType (ctx) {
29
+ const { documentId, contentType } = ctx.params;
30
+ if (!documentId || !contentType) {
31
+ return ctx.badRequest('Document ID and contentType are required');
32
+ }
33
+ try {
34
+ const job = await aiLocalizationJobsService.getJobByDocument(contentType, documentId);
35
+ ctx.body = {
36
+ data: job
37
+ };
38
+ } catch (error) {
39
+ strapi.log.error('[AI Localizations Jobs] Error fetching job:', error);
40
+ ctx.internalServerError('Failed to fetch AI localizations job');
41
+ }
42
+ }
43
+ };
44
+ };
45
+
46
+ module.exports = createAILocalizationJobsController;
47
+ //# sourceMappingURL=ai-localization-jobs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-localization-jobs.js","sources":["../../../server/src/controllers/ai-localization-jobs.ts"],"sourcesContent":["import type { Core } from '@strapi/types';\n\nconst createAILocalizationJobsController = ({ strapi }: { strapi: Core.Strapi }) => {\n const getService = (name: string) => strapi.plugin('i18n').service(name);\n const aiLocalizationJobsService = getService('ai-localization-jobs');\n\n return {\n /**\n * Get a job for a singleType using the contentType\n * There is only 1 job per contentType\n */\n async getJobForSingleType(ctx: any) {\n const { contentType } = ctx.params;\n\n if (!contentType) {\n return ctx.badRequest('contentType is required');\n }\n\n try {\n const job = await aiLocalizationJobsService.getJobByContentType(contentType);\n\n ctx.body = {\n data: job,\n };\n } catch (error) {\n strapi.log.error('[AI Localizations Jobs] Error fetching job:', error);\n ctx.internalServerError('Failed to fetch AI localizations job');\n }\n },\n /**\n * Get a job for a collectionType using the documentId\n * There is only 1 job per documentId\n */\n async getJobForCollectionType(ctx: any) {\n const { documentId, contentType } = ctx.params;\n\n if (!documentId || !contentType) {\n return ctx.badRequest('Document ID and contentType are required');\n }\n\n try {\n const job = await aiLocalizationJobsService.getJobByDocument(contentType, documentId);\n\n ctx.body = {\n data: job,\n };\n } catch (error) {\n strapi.log.error('[AI Localizations Jobs] Error fetching job:', error);\n ctx.internalServerError('Failed to fetch AI localizations job');\n }\n },\n };\n};\n\nexport default createAILocalizationJobsController;\n"],"names":["createAILocalizationJobsController","strapi","getService","name","plugin","service","aiLocalizationJobsService","getJobForSingleType","ctx","contentType","params","badRequest","job","getJobByContentType","body","data","error","log","internalServerError","getJobForCollectionType","documentId","getJobByDocument"],"mappings":";;AAEA,MAAMA,kCAAqC,GAAA,CAAC,EAAEC,MAAM,EAA2B,GAAA;IAC7E,MAAMC,UAAAA,GAAa,CAACC,IAAiBF,GAAAA,MAAAA,CAAOG,MAAM,CAAC,MAAA,CAAA,CAAQC,OAAO,CAACF,IAAAA,CAAAA;AACnE,IAAA,MAAMG,4BAA4BJ,UAAW,CAAA,sBAAA,CAAA;IAE7C,OAAO;AACL;;;QAIA,MAAMK,qBAAoBC,GAAQ,EAAA;AAChC,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