@strapi/i18n 0.0.0-next.e1a19b9e52cdcb526515883c8289522a64c9871a → 0.0.0-next.e2e3ca14971ee768e1a227a209362264fd0132d4

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 (167) hide show
  1. package/dist/admin/components/BulkLocaleActionModal.js +2 -2
  2. package/dist/admin/components/BulkLocaleActionModal.js.map +1 -1
  3. package/dist/admin/components/BulkLocaleActionModal.mjs +2 -2
  4. package/dist/admin/components/BulkLocaleActionModal.mjs.map +1 -1
  5. package/dist/admin/components/CMHeaderActions.js +294 -20
  6. package/dist/admin/components/CMHeaderActions.js.map +1 -1
  7. package/dist/admin/components/CMHeaderActions.mjs +298 -25
  8. package/dist/admin/components/CMHeaderActions.mjs.map +1 -1
  9. package/dist/admin/components/CreateLocale.js +11 -5
  10. package/dist/admin/components/CreateLocale.js.map +1 -1
  11. package/dist/admin/components/CreateLocale.mjs +12 -6
  12. package/dist/admin/components/CreateLocale.mjs.map +1 -1
  13. package/dist/admin/components/LocaleListCell.js +65 -45
  14. package/dist/admin/components/LocaleListCell.js.map +1 -1
  15. package/dist/admin/components/LocaleListCell.mjs +66 -46
  16. package/dist/admin/components/LocaleListCell.mjs.map +1 -1
  17. package/dist/admin/components/LocalePicker.js +18 -11
  18. package/dist/admin/components/LocalePicker.js.map +1 -1
  19. package/dist/admin/components/LocalePicker.mjs +19 -12
  20. package/dist/admin/components/LocalePicker.mjs.map +1 -1
  21. package/dist/admin/contentManagerHooks/editView.js +6 -3
  22. package/dist/admin/contentManagerHooks/editView.js.map +1 -1
  23. package/dist/admin/contentManagerHooks/editView.mjs +7 -4
  24. package/dist/admin/contentManagerHooks/editView.mjs.map +1 -1
  25. package/dist/admin/contentManagerHooks/listView.js +2 -1
  26. package/dist/admin/contentManagerHooks/listView.js.map +1 -1
  27. package/dist/admin/contentManagerHooks/listView.mjs +2 -1
  28. package/dist/admin/contentManagerHooks/listView.mjs.map +1 -1
  29. package/dist/admin/hooks/useAILocalizationJobsPolling.js +110 -0
  30. package/dist/admin/hooks/useAILocalizationJobsPolling.js.map +1 -0
  31. package/dist/admin/hooks/useAILocalizationJobsPolling.mjs +89 -0
  32. package/dist/admin/hooks/useAILocalizationJobsPolling.mjs.map +1 -0
  33. package/dist/admin/hooks/useI18n.js +4 -4
  34. package/dist/admin/hooks/useI18n.js.map +1 -1
  35. package/dist/admin/hooks/useI18n.mjs +4 -4
  36. package/dist/admin/hooks/useI18n.mjs.map +1 -1
  37. package/dist/admin/index.js +1 -0
  38. package/dist/admin/index.js.map +1 -1
  39. package/dist/admin/index.mjs +2 -1
  40. package/dist/admin/index.mjs.map +1 -1
  41. package/dist/admin/pages/SettingsPage.js +121 -46
  42. package/dist/admin/pages/SettingsPage.js.map +1 -1
  43. package/dist/admin/pages/SettingsPage.mjs +124 -30
  44. package/dist/admin/pages/SettingsPage.mjs.map +1 -1
  45. package/dist/admin/services/aiLocalizationJobs.js +26 -0
  46. package/dist/admin/services/aiLocalizationJobs.js.map +1 -0
  47. package/dist/admin/services/aiLocalizationJobs.mjs +24 -0
  48. package/dist/admin/services/aiLocalizationJobs.mjs.map +1 -0
  49. package/dist/admin/services/api.js +3 -1
  50. package/dist/admin/services/api.js.map +1 -1
  51. package/dist/admin/services/api.mjs +3 -1
  52. package/dist/admin/services/api.mjs.map +1 -1
  53. package/dist/admin/services/locales.js.map +1 -1
  54. package/dist/admin/services/locales.mjs.map +1 -1
  55. package/dist/admin/services/settings.js +30 -0
  56. package/dist/admin/services/settings.js.map +1 -0
  57. package/dist/admin/services/settings.mjs +27 -0
  58. package/dist/admin/services/settings.mjs.map +1 -0
  59. package/dist/admin/src/components/CMHeaderActions.d.ts +17 -4
  60. package/dist/admin/src/components/LocaleListCell.d.ts +2 -1
  61. package/dist/admin/src/hooks/useAILocalizationJobsPolling.d.ts +9 -0
  62. package/dist/admin/src/services/aiLocalizationJobs.d.ts +6 -0
  63. package/dist/admin/src/services/api.d.ts +1 -1
  64. package/dist/admin/src/services/locales.d.ts +1 -1
  65. package/dist/admin/src/services/relations.d.ts +1 -1
  66. package/dist/admin/src/services/settings.d.ts +5 -0
  67. package/dist/admin/translations/en.json.js +10 -0
  68. package/dist/admin/translations/en.json.js.map +1 -1
  69. package/dist/admin/translations/en.json.mjs +10 -0
  70. package/dist/admin/translations/en.json.mjs.map +1 -1
  71. package/dist/admin/utils/clean.js +2 -2
  72. package/dist/admin/utils/clean.js.map +1 -1
  73. package/dist/admin/utils/clean.mjs +2 -2
  74. package/dist/admin/utils/clean.mjs.map +1 -1
  75. package/dist/admin/utils/getTranslation.js.map +1 -1
  76. package/dist/admin/utils/getTranslation.mjs.map +1 -1
  77. package/dist/admin/utils/prefixPluginTranslations.js.map +1 -1
  78. package/dist/admin/utils/prefixPluginTranslations.mjs.map +1 -1
  79. package/dist/server/bootstrap.js +24 -8
  80. package/dist/server/bootstrap.js.map +1 -1
  81. package/dist/server/bootstrap.mjs +24 -8
  82. package/dist/server/bootstrap.mjs.map +1 -1
  83. package/dist/server/constants/iso-locales.json.js +4 -0
  84. package/dist/server/constants/iso-locales.json.js.map +1 -1
  85. package/dist/server/constants/iso-locales.json.mjs +4 -0
  86. package/dist/server/constants/iso-locales.json.mjs.map +1 -1
  87. package/dist/server/controllers/ai-localization-jobs.js +47 -0
  88. package/dist/server/controllers/ai-localization-jobs.js.map +1 -0
  89. package/dist/server/controllers/ai-localization-jobs.mjs +45 -0
  90. package/dist/server/controllers/ai-localization-jobs.mjs.map +1 -0
  91. package/dist/server/controllers/index.js +5 -1
  92. package/dist/server/controllers/index.js.map +1 -1
  93. package/dist/server/controllers/index.mjs +5 -1
  94. package/dist/server/controllers/index.mjs.map +1 -1
  95. package/dist/server/controllers/settings.js +24 -0
  96. package/dist/server/controllers/settings.js.map +1 -0
  97. package/dist/server/controllers/settings.mjs +22 -0
  98. package/dist/server/controllers/settings.mjs.map +1 -0
  99. package/dist/server/models/ai-localization-job.js +60 -0
  100. package/dist/server/models/ai-localization-job.js.map +1 -0
  101. package/dist/server/models/ai-localization-job.mjs +57 -0
  102. package/dist/server/models/ai-localization-job.mjs.map +1 -0
  103. package/dist/server/register.js +3 -1
  104. package/dist/server/register.js.map +1 -1
  105. package/dist/server/register.mjs +3 -1
  106. package/dist/server/register.mjs.map +1 -1
  107. package/dist/server/routes/admin.js +40 -0
  108. package/dist/server/routes/admin.js.map +1 -1
  109. package/dist/server/routes/admin.mjs +40 -0
  110. package/dist/server/routes/admin.mjs.map +1 -1
  111. package/dist/server/services/ai-localization-jobs.js +64 -0
  112. package/dist/server/services/ai-localization-jobs.js.map +1 -0
  113. package/dist/server/services/ai-localization-jobs.mjs +62 -0
  114. package/dist/server/services/ai-localization-jobs.mjs.map +1 -0
  115. package/dist/server/services/ai-localizations.js +268 -0
  116. package/dist/server/services/ai-localizations.js.map +1 -0
  117. package/dist/server/services/ai-localizations.mjs +266 -0
  118. package/dist/server/services/ai-localizations.mjs.map +1 -0
  119. package/dist/server/services/content-types.js.map +1 -1
  120. package/dist/server/services/content-types.mjs.map +1 -1
  121. package/dist/server/services/index.js +7 -1
  122. package/dist/server/services/index.js.map +1 -1
  123. package/dist/server/services/index.mjs +7 -1
  124. package/dist/server/services/index.mjs.map +1 -1
  125. package/dist/server/services/settings.js +25 -0
  126. package/dist/server/services/settings.js.map +1 -0
  127. package/dist/server/services/settings.mjs +23 -0
  128. package/dist/server/services/settings.mjs.map +1 -0
  129. package/dist/server/src/bootstrap.d.ts.map +1 -1
  130. package/dist/server/src/controllers/ai-localization-jobs.d.ts +17 -0
  131. package/dist/server/src/controllers/ai-localization-jobs.d.ts.map +1 -0
  132. package/dist/server/src/controllers/index.d.ts +10 -0
  133. package/dist/server/src/controllers/index.d.ts.map +1 -1
  134. package/dist/server/src/controllers/settings.d.ts +7 -0
  135. package/dist/server/src/controllers/settings.d.ts.map +1 -0
  136. package/dist/server/src/index.d.ts +44 -1
  137. package/dist/server/src/index.d.ts.map +1 -1
  138. package/dist/server/src/models/ai-localization-job.d.ts +5 -0
  139. package/dist/server/src/models/ai-localization-job.d.ts.map +1 -0
  140. package/dist/server/src/models/index.d.ts +5 -0
  141. package/dist/server/src/models/index.d.ts.map +1 -0
  142. package/dist/server/src/register.d.ts +1 -1
  143. package/dist/server/src/register.d.ts.map +1 -1
  144. package/dist/server/src/routes/admin.d.ts.map +1 -1
  145. package/dist/server/src/services/ai-localization-jobs.d.ts +26 -0
  146. package/dist/server/src/services/ai-localization-jobs.d.ts.map +1 -0
  147. package/dist/server/src/services/ai-localizations.d.ts +18 -0
  148. package/dist/server/src/services/ai-localizations.d.ts.map +1 -0
  149. package/dist/server/src/services/index.d.ts +33 -0
  150. package/dist/server/src/services/index.d.ts.map +1 -1
  151. package/dist/server/src/services/settings.d.ts +13 -0
  152. package/dist/server/src/services/settings.d.ts.map +1 -0
  153. package/dist/server/src/utils/index.d.ts +7 -1
  154. package/dist/server/src/utils/index.d.ts.map +1 -1
  155. package/dist/server/src/validation/settings.d.ts +12 -0
  156. package/dist/server/src/validation/settings.d.ts.map +1 -0
  157. package/dist/server/utils/index.js.map +1 -1
  158. package/dist/server/utils/index.mjs.map +1 -1
  159. package/dist/server/validation/settings.js +11 -0
  160. package/dist/server/validation/settings.js.map +1 -0
  161. package/dist/server/validation/settings.mjs +9 -0
  162. package/dist/server/validation/settings.mjs.map +1 -0
  163. package/dist/shared/contracts/ai-localization-jobs.d.ts +27 -0
  164. package/dist/shared/contracts/ai-localization-jobs.d.ts.map +1 -0
  165. package/dist/shared/contracts/settings.d.ts +40 -0
  166. package/dist/shared/contracts/shared.d.ts.map +1 -0
  167. package/package.json +11 -9
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
 
3
+ var fp = require('lodash/fp');
3
4
  var index = require('./utils/index.js');
4
5
 
5
6
  const registerModelsHooks = ()=>{
@@ -28,8 +29,15 @@ const registerModelsHooks = ()=>{
28
29
  return next();
29
30
  }
30
31
  // Build a populate array for all non localized fields within the schema
31
- const { getNestedPopulateOfNonLocalizedAttributes } = index.getService('content-types');
32
+ const { getNestedPopulateOfNonLocalizedAttributes, copyNonLocalizedAttributes } = index.getService('content-types');
32
33
  const attributesToPopulate = getNestedPopulateOfNonLocalizedAttributes(schema.uid);
34
+ // Get original data before the update to compare what actually changed
35
+ const originalData = 'documentId' in context.params && context.params.documentId ? await strapi.db.query(schema.uid).findOne({
36
+ where: {
37
+ documentId: context.params.documentId
38
+ },
39
+ populate: attributesToPopulate
40
+ }) : null;
33
41
  // Get the result of the document service action
34
42
  const result = await next();
35
43
  // We may not have received a result with everything populated that we need
@@ -44,13 +52,19 @@ const registerModelsHooks = ()=>{
44
52
  } else {
45
53
  return result;
46
54
  }
47
- if (attributesToPopulate.length > 0) {
48
- const populatedResult = await strapi.db.query(schema.uid).findOne({
49
- where: {
50
- id: resultID
51
- },
52
- populate: attributesToPopulate
53
- });
55
+ const populatedResult = await strapi.db.query(schema.uid).findOne({
56
+ where: {
57
+ id: resultID
58
+ },
59
+ populate: attributesToPopulate
60
+ });
61
+ const originalFields = copyNonLocalizedAttributes(schema, originalData);
62
+ const currentFields = copyNonLocalizedAttributes(schema, populatedResult);
63
+ // Only sync if there are actual changes to non-localized fields
64
+ const shouldSync = !originalData || Object.keys(currentFields).some((key)=>{
65
+ return !fp.isEqual(currentFields[key], originalFields[key]);
66
+ });
67
+ if (shouldSync) {
54
68
  await index.getService('localizations').syncNonLocalizedAttributes(populatedResult, schema);
55
69
  }
56
70
  return result;
@@ -72,6 +86,8 @@ var bootstrap = (async ()=>{
72
86
  engine.registerI18nPermissionsHandlers();
73
87
  // Hooks & Models
74
88
  registerModelsHooks();
89
+ // AI Localizations
90
+ index.getService('ai-localizations').setupMiddleware();
75
91
  sendDidInitializeEvent();
76
92
  });
77
93
 
@@ -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","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,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,sBAAsB,CAACJ,MAAS,CAAA,EAAA;YAC/D,OAAOD,IAAAA,EAAAA;AACT;;AAGA,QAAA,MAAM,EAAEM,yCAAyC,EAAE,GAAGb,gBAAW,CAAA,eAAA,CAAA;QAEjE,MAAMc,oBAAAA,GAAuBD,yCAA0CL,CAAAA,MAAAA,CAAOO,GAAG,CAAA;;A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CjC,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.js","sources":["../../server/src/bootstrap.ts"],"sourcesContent":["import type { Schema } from '@strapi/types';\nimport { isEqual } from 'lodash/fp';\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, copyNonLocalizedAttributes } =\n getService('content-types');\n const attributesToPopulate = getNestedPopulateOfNonLocalizedAttributes(schema.uid);\n\n // Get original data before the update to compare what actually changed\n const originalData =\n 'documentId' in context.params && context.params.documentId\n ? await strapi.db.query(schema.uid).findOne({\n where: { documentId: context.params.documentId },\n populate: attributesToPopulate,\n })\n : null;\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 const populatedResult = await strapi.db.query(schema.uid).findOne({\n where: { id: resultID },\n populate: attributesToPopulate,\n });\n\n const originalFields = copyNonLocalizedAttributes(schema, originalData);\n const currentFields = copyNonLocalizedAttributes(schema, populatedResult);\n\n // Only sync if there are actual changes to non-localized fields\n const shouldSync =\n !originalData ||\n Object.keys(currentFields).some((key) => {\n return !isEqual(currentFields[key], originalFields[key]);\n });\n\n if (shouldSync) {\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","copyNonLocalizedAttributes","attributesToPopulate","uid","originalData","params","documentId","query","findOne","where","populate","result","resultID","Array","isArray","entries","id","populatedResult","originalFields","currentFields","shouldSync","Object","keys","some","key","isEqual","syncNonLocalizedAttributes","sendDidInitializeEvent","initDefaultLocale","sectionsBuilder","engine","registerLocalesPropertyHandler","registerI18nActions","registerI18nActionsHooks","updateActionsProperties","registerI18nPermissionsHandlers","setupMiddleware"],"mappings":";;;;;AAIA,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,CA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,GAAGzC,gBAAW,CAAA,SAAA,CAAA;IACzC,MAAM,EAAE0C,eAAe,EAAEzC,OAAO,EAAE0C,MAAM,EAAE,GAAG3C,gBAAW,CAAA,aAAA,CAAA;;IAGxD,MAAMyC,iBAAAA,EAAAA;;AAGNC,IAAAA,eAAAA,CAAgBE,8BAA8B,EAAA;;AAG9C,IAAA,MAAM3C,QAAQ4C,mBAAmB,EAAA;AACjC5C,IAAAA,OAAAA,CAAQ6C,wBAAwB,EAAA;AAChC7C,IAAAA,OAAAA,CAAQ8C,uBAAuB,EAAA;;AAG/BJ,IAAAA,MAAAA,CAAOK,+BAA+B,EAAA;;AAGtCvD,IAAAA,mBAAAA,EAAAA;;AAGAO,IAAAA,gBAAAA,CAAW,oBAAoBiD,eAAe,EAAA;AAE9CT,IAAAA,sBAAAA,EAAAA;AACF,CAAA;;;;"}
@@ -1,3 +1,4 @@
1
+ import { isEqual } from 'lodash/fp';
1
2
  import { getService } from './utils/index.mjs';
2
3
 
3
4
  const registerModelsHooks = ()=>{
@@ -26,8 +27,15 @@ const registerModelsHooks = ()=>{
26
27
  return next();
27
28
  }
28
29
  // Build a populate array for all non localized fields within the schema
29
- const { getNestedPopulateOfNonLocalizedAttributes } = getService('content-types');
30
+ const { getNestedPopulateOfNonLocalizedAttributes, copyNonLocalizedAttributes } = getService('content-types');
30
31
  const attributesToPopulate = getNestedPopulateOfNonLocalizedAttributes(schema.uid);
32
+ // Get original data before the update to compare what actually changed
33
+ const originalData = 'documentId' in context.params && context.params.documentId ? await strapi.db.query(schema.uid).findOne({
34
+ where: {
35
+ documentId: context.params.documentId
36
+ },
37
+ populate: attributesToPopulate
38
+ }) : null;
31
39
  // Get the result of the document service action
32
40
  const result = await next();
33
41
  // We may not have received a result with everything populated that we need
@@ -42,13 +50,19 @@ const registerModelsHooks = ()=>{
42
50
  } else {
43
51
  return result;
44
52
  }
45
- if (attributesToPopulate.length > 0) {
46
- const populatedResult = await strapi.db.query(schema.uid).findOne({
47
- where: {
48
- id: resultID
49
- },
50
- populate: attributesToPopulate
51
- });
53
+ const populatedResult = await strapi.db.query(schema.uid).findOne({
54
+ where: {
55
+ id: resultID
56
+ },
57
+ populate: attributesToPopulate
58
+ });
59
+ const originalFields = copyNonLocalizedAttributes(schema, originalData);
60
+ const currentFields = copyNonLocalizedAttributes(schema, populatedResult);
61
+ // Only sync if there are actual changes to non-localized fields
62
+ const shouldSync = !originalData || Object.keys(currentFields).some((key)=>{
63
+ return !isEqual(currentFields[key], originalFields[key]);
64
+ });
65
+ if (shouldSync) {
52
66
  await getService('localizations').syncNonLocalizedAttributes(populatedResult, schema);
53
67
  }
54
68
  return result;
@@ -70,6 +84,8 @@ var bootstrap = (async ()=>{
70
84
  engine.registerI18nPermissionsHandlers();
71
85
  // Hooks & Models
72
86
  registerModelsHooks();
87
+ // AI Localizations
88
+ getService('ai-localizations').setupMiddleware();
73
89
  sendDidInitializeEvent();
74
90
  });
75
91
 
@@ -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,UAAW,CAAA,aAAA,CAAA,CAAeC,OAAO,CAACC,oCAAoC,EAAA;AAC9E,SAAA;QAEA,MAAM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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 { isEqual } from 'lodash/fp';\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, copyNonLocalizedAttributes } =\n getService('content-types');\n const attributesToPopulate = getNestedPopulateOfNonLocalizedAttributes(schema.uid);\n\n // Get original data before the update to compare what actually changed\n const originalData =\n 'documentId' in context.params && context.params.documentId\n ? await strapi.db.query(schema.uid).findOne({\n where: { documentId: context.params.documentId },\n populate: attributesToPopulate,\n })\n : null;\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 const populatedResult = await strapi.db.query(schema.uid).findOne({\n where: { id: resultID },\n populate: attributesToPopulate,\n });\n\n const originalFields = copyNonLocalizedAttributes(schema, originalData);\n const currentFields = copyNonLocalizedAttributes(schema, populatedResult);\n\n // Only sync if there are actual changes to non-localized fields\n const shouldSync =\n !originalData ||\n Object.keys(currentFields).some((key) => {\n return !isEqual(currentFields[key], originalFields[key]);\n });\n\n if (shouldSync) {\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","copyNonLocalizedAttributes","attributesToPopulate","uid","originalData","params","documentId","query","findOne","where","populate","result","resultID","Array","isArray","entries","id","populatedResult","originalFields","currentFields","shouldSync","Object","keys","some","key","isEqual","syncNonLocalizedAttributes","sendDidInitializeEvent","initDefaultLocale","sectionsBuilder","engine","registerLocalesPropertyHandler","registerI18nActions","registerI18nActionsHooks","updateActionsProperties","registerI18nPermissionsHandlers","setupMiddleware"],"mappings":";;;AAIA,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,EAAA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;;;;"}
@@ -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,YAAA,MAAM,EAAEC,WAAW,EAAE,GAAGD,IAAIE,MAAM;AAElC,YAAA,IAAI,CAACD,WAAa,EAAA;gBAChB,OAAOD,GAAAA,CAAIG,UAAU,CAAC,yBAAA,CAAA;AACxB;YAEA,IAAI;AACF,gBAAA,MAAMC,GAAM,GAAA,MAAMN,yBAA0BO,CAAAA,mBAAmB,CAACJ,WAAAA,CAAAA;AAEhED,gBAAAA,GAAAA,CAAIM,IAAI,GAAG;oBACTC,IAAMH,EAAAA;AACR,iBAAA;AACF,aAAA,CAAE,OAAOI,KAAO,EAAA;AACdf,gBAAAA,MAAAA,CAAOgB,GAAG,CAACD,KAAK,CAAC,6CAA+CA,EAAAA,KAAAA,CAAAA;AAChER,gBAAAA,GAAAA,CAAIU,mBAAmB,CAAC,sCAAA,CAAA;AAC1B;AACF,SAAA;AACA;;;QAIA,MAAMC,yBAAwBX,GAAQ,EAAA;AACpC,YAAA,MAAM,EAAEY,UAAU,EAAEX,WAAW,EAAE,GAAGD,IAAIE,MAAM;YAE9C,IAAI,CAACU,UAAc,IAAA,CAACX,WAAa,EAAA;gBAC/B,OAAOD,GAAAA,CAAIG,UAAU,CAAC,0CAAA,CAAA;AACxB;YAEA,IAAI;AACF,gBAAA,MAAMC,GAAM,GAAA,MAAMN,yBAA0Be,CAAAA,gBAAgB,CAACZ,WAAaW,EAAAA,UAAAA,CAAAA;AAE1EZ,gBAAAA,GAAAA,CAAIM,IAAI,GAAG;oBACTC,IAAMH,EAAAA;AACR,iBAAA;AACF,aAAA,CAAE,OAAOI,KAAO,EAAA;AACdf,gBAAAA,MAAAA,CAAOgB,GAAG,CAACD,KAAK,CAAC,6CAA+CA,EAAAA,KAAAA,CAAAA;AAChER,gBAAAA,GAAAA,CAAIU,mBAAmB,CAAC,sCAAA,CAAA;AAC1B;AACF;AACF,KAAA;AACF;;;;"}
@@ -0,0 +1,45 @@
1
+ const createAILocalizationJobsController = ({ strapi })=>{
2
+ const getService = (name)=>strapi.plugin('i18n').service(name);
3
+ const aiLocalizationJobsService = getService('ai-localization-jobs');
4
+ return {
5
+ /**
6
+ * Get a job for a singleType using the contentType
7
+ * There is only 1 job per contentType
8
+ */ async getJobForSingleType (ctx) {
9
+ const { contentType } = ctx.params;
10
+ if (!contentType) {
11
+ return ctx.badRequest('contentType is required');
12
+ }
13
+ try {
14
+ const job = await aiLocalizationJobsService.getJobByContentType(contentType);
15
+ ctx.body = {
16
+ data: job
17
+ };
18
+ } catch (error) {
19
+ strapi.log.error('[AI Localizations Jobs] Error fetching job:', error);
20
+ ctx.internalServerError('Failed to fetch AI localizations job');
21
+ }
22
+ },
23
+ /**
24
+ * Get a job for a collectionType using the documentId
25
+ * There is only 1 job per documentId
26
+ */ async getJobForCollectionType (ctx) {
27
+ const { documentId, contentType } = ctx.params;
28
+ if (!documentId || !contentType) {
29
+ return ctx.badRequest('Document ID and contentType are required');
30
+ }
31
+ try {
32
+ const job = await aiLocalizationJobsService.getJobByDocument(contentType, documentId);
33
+ ctx.body = {
34
+ data: job
35
+ };
36
+ } catch (error) {
37
+ strapi.log.error('[AI Localizations Jobs] Error fetching job:', error);
38
+ ctx.internalServerError('Failed to fetch AI localizations job');
39
+ }
40
+ }
41
+ };
42
+ };
43
+
44
+ export { createAILocalizationJobsController as default };
45
+ //# sourceMappingURL=ai-localization-jobs.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-localization-jobs.mjs","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,YAAA,MAAM,EAAEC,WAAW,EAAE,GAAGD,IAAIE,MAAM;AAElC,YAAA,IAAI,CAACD,WAAa,EAAA;gBAChB,OAAOD,GAAAA,CAAIG,UAAU,CAAC,yBAAA,CAAA;AACxB;YAEA,IAAI;AACF,gBAAA,MAAMC,GAAM,GAAA,MAAMN,yBAA0BO,CAAAA,mBAAmB,CAACJ,WAAAA,CAAAA;AAEhED,gBAAAA,GAAAA,CAAIM,IAAI,GAAG;oBACTC,IAAMH,EAAAA;AACR,iBAAA;AACF,aAAA,CAAE,OAAOI,KAAO,EAAA;AACdf,gBAAAA,MAAAA,CAAOgB,GAAG,CAACD,KAAK,CAAC,6CAA+CA,EAAAA,KAAAA,CAAAA;AAChER,gBAAAA,GAAAA,CAAIU,mBAAmB,CAAC,sCAAA,CAAA;AAC1B;AACF,SAAA;AACA;;;QAIA,MAAMC,yBAAwBX,GAAQ,EAAA;AACpC,YAAA,MAAM,EAAEY,UAAU,EAAEX,WAAW,EAAE,GAAGD,IAAIE,MAAM;YAE9C,IAAI,CAACU,UAAc,IAAA,CAACX,WAAa,EAAA;gBAC/B,OAAOD,GAAAA,CAAIG,UAAU,CAAC,0CAAA,CAAA;AACxB;YAEA,IAAI;AACF,gBAAA,MAAMC,GAAM,GAAA,MAAMN,yBAA0Be,CAAAA,gBAAgB,CAACZ,WAAaW,EAAAA,UAAAA,CAAAA;AAE1EZ,gBAAAA,GAAAA,CAAIM,IAAI,GAAG;oBACTC,IAAMH,EAAAA;AACR,iBAAA;AACF,aAAA,CAAE,OAAOI,KAAO,EAAA;AACdf,gBAAAA,MAAAA,CAAOgB,GAAG,CAACD,KAAK,CAAC,6CAA+CA,EAAAA,KAAAA,CAAAA;AAChER,gBAAAA,GAAAA,CAAIU,mBAAmB,CAAC,sCAAA,CAAA;AAC1B;AACF;AACF,KAAA;AACF;;;;"}
@@ -3,11 +3,15 @@
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');
7
+ var aiLocalizationJobs = require('./ai-localization-jobs.js');
6
8
 
7
9
  var controllers = {
8
10
  locales,
9
11
  'iso-locales': isoLocales,
10
- 'content-types': contentTypes
12
+ 'content-types': contentTypes,
13
+ settings,
14
+ 'ai-localization-jobs': aiLocalizationJobs
11
15
  };
12
16
 
13
17
  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';\nimport aiLocalizationJobs from './ai-localization-jobs';\n\nexport default {\n locales,\n 'iso-locales': isoLocales,\n 'content-types': contentTypes,\n settings,\n 'ai-localization-jobs': aiLocalizationJobs,\n};\n"],"names":["locales","isoLocales","contentTypes","settings","aiLocalizationJobs"],"mappings":";;;;;;;;AAMA,kBAAe;AACbA,IAAAA,OAAAA;IACA,aAAeC,EAAAA,UAAAA;IACf,eAAiBC,EAAAA,YAAAA;AACjBC,IAAAA,QAAAA;IACA,sBAAwBC,EAAAA;AAC1B,CAAE;;;;"}
@@ -1,11 +1,15 @@
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';
5
+ import createAILocalizationJobsController from './ai-localization-jobs.mjs';
4
6
 
5
7
  var controllers = {
6
8
  locales: controller,
7
9
  'iso-locales': controller$1,
8
- 'content-types': controller$2
10
+ 'content-types': controller$2,
11
+ settings,
12
+ 'ai-localization-jobs': createAILocalizationJobsController
9
13
  };
10
14
 
11
15
  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';\nimport aiLocalizationJobs from './ai-localization-jobs';\n\nexport default {\n locales,\n 'iso-locales': isoLocales,\n 'content-types': contentTypes,\n settings,\n 'ai-localization-jobs': aiLocalizationJobs,\n};\n"],"names":["locales","isoLocales","contentTypes","settings","aiLocalizationJobs"],"mappings":";;;;;;AAMA,kBAAe;AACbA,aAAAA,UAAAA;IACA,aAAeC,EAAAA,YAAAA;IACf,eAAiBC,EAAAA,YAAAA;AACjBC,IAAAA,QAAAA;IACA,sBAAwBC,EAAAA;AAC1B,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;;;;"}
@@ -0,0 +1,60 @@
1
+ 'use strict';
2
+
3
+ const AI_LOCALIZATION_JOB_UID = 'plugin::i18n.ai-localization-job';
4
+ const aiLocalizationJob = {
5
+ uid: AI_LOCALIZATION_JOB_UID,
6
+ tableName: 'strapi_ai_localization_jobs',
7
+ singularName: 'ai-localization-job',
8
+ attributes: {
9
+ id: {
10
+ type: 'increments'
11
+ },
12
+ contentType: {
13
+ type: 'string',
14
+ column: {
15
+ notNullable: true
16
+ }
17
+ },
18
+ relatedDocumentId: {
19
+ type: 'string',
20
+ column: {
21
+ notNullable: true
22
+ }
23
+ },
24
+ sourceLocale: {
25
+ type: 'string',
26
+ column: {
27
+ notNullable: true
28
+ }
29
+ },
30
+ targetLocales: {
31
+ type: 'json',
32
+ column: {
33
+ notNullable: true
34
+ }
35
+ },
36
+ status: {
37
+ type: 'enumeration',
38
+ enum: [
39
+ 'processing',
40
+ 'completed',
41
+ 'failed'
42
+ ],
43
+ column: {
44
+ notNullable: true
45
+ }
46
+ },
47
+ createdAt: {
48
+ type: 'datetime',
49
+ default: ()=>new Date()
50
+ },
51
+ updatedAt: {
52
+ type: 'datetime',
53
+ default: ()=>new Date()
54
+ }
55
+ }
56
+ };
57
+
58
+ exports.AI_LOCALIZATION_JOB_UID = AI_LOCALIZATION_JOB_UID;
59
+ exports.aiLocalizationJob = aiLocalizationJob;
60
+ //# sourceMappingURL=ai-localization-job.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-localization-job.js","sources":["../../../server/src/models/ai-localization-job.ts"],"sourcesContent":["import type { Model } from '@strapi/database';\n\nconst AI_LOCALIZATION_JOB_UID = 'plugin::i18n.ai-localization-job';\n\nconst aiLocalizationJob: Model = {\n uid: AI_LOCALIZATION_JOB_UID,\n tableName: 'strapi_ai_localization_jobs',\n singularName: 'ai-localization-job',\n attributes: {\n id: {\n type: 'increments',\n },\n contentType: {\n type: 'string',\n column: { notNullable: true },\n },\n relatedDocumentId: {\n type: 'string',\n column: { notNullable: true },\n },\n sourceLocale: {\n type: 'string',\n column: { notNullable: true },\n },\n targetLocales: {\n type: 'json',\n column: { notNullable: true },\n },\n status: {\n type: 'enumeration',\n enum: ['processing', 'completed', 'failed'],\n column: { notNullable: true },\n },\n createdAt: {\n type: 'datetime',\n default: () => new Date(),\n },\n updatedAt: {\n type: 'datetime',\n default: () => new Date(),\n },\n },\n};\n\nexport { aiLocalizationJob, AI_LOCALIZATION_JOB_UID };\n"],"names":["AI_LOCALIZATION_JOB_UID","aiLocalizationJob","uid","tableName","singularName","attributes","id","type","contentType","column","notNullable","relatedDocumentId","sourceLocale","targetLocales","status","enum","createdAt","default","Date","updatedAt"],"mappings":";;AAEA,MAAMA,uBAA0B,GAAA;AAEhC,MAAMC,iBAA2B,GAAA;IAC/BC,GAAKF,EAAAA,uBAAAA;IACLG,SAAW,EAAA,6BAAA;IACXC,YAAc,EAAA,qBAAA;IACdC,UAAY,EAAA;QACVC,EAAI,EAAA;YACFC,IAAM,EAAA;AACR,SAAA;QACAC,WAAa,EAAA;YACXD,IAAM,EAAA,QAAA;YACNE,MAAQ,EAAA;gBAAEC,WAAa,EAAA;AAAK;AAC9B,SAAA;QACAC,iBAAmB,EAAA;YACjBJ,IAAM,EAAA,QAAA;YACNE,MAAQ,EAAA;gBAAEC,WAAa,EAAA;AAAK;AAC9B,SAAA;QACAE,YAAc,EAAA;YACZL,IAAM,EAAA,QAAA;YACNE,MAAQ,EAAA;gBAAEC,WAAa,EAAA;AAAK;AAC9B,SAAA;QACAG,aAAe,EAAA;YACbN,IAAM,EAAA,MAAA;YACNE,MAAQ,EAAA;gBAAEC,WAAa,EAAA;AAAK;AAC9B,SAAA;QACAI,MAAQ,EAAA;YACNP,IAAM,EAAA,aAAA;YACNQ,IAAM,EAAA;AAAC,gBAAA,YAAA;AAAc,gBAAA,WAAA;AAAa,gBAAA;AAAS,aAAA;YAC3CN,MAAQ,EAAA;gBAAEC,WAAa,EAAA;AAAK;AAC9B,SAAA;QACAM,SAAW,EAAA;YACTT,IAAM,EAAA,UAAA;AACNU,YAAAA,OAAAA,EAAS,IAAM,IAAIC,IAAAA;AACrB,SAAA;QACAC,SAAW,EAAA;YACTZ,IAAM,EAAA,UAAA;AACNU,YAAAA,OAAAA,EAAS,IAAM,IAAIC,IAAAA;AACrB;AACF;AACF;;;;;"}
@@ -0,0 +1,57 @@
1
+ const AI_LOCALIZATION_JOB_UID = 'plugin::i18n.ai-localization-job';
2
+ const aiLocalizationJob = {
3
+ uid: AI_LOCALIZATION_JOB_UID,
4
+ tableName: 'strapi_ai_localization_jobs',
5
+ singularName: 'ai-localization-job',
6
+ attributes: {
7
+ id: {
8
+ type: 'increments'
9
+ },
10
+ contentType: {
11
+ type: 'string',
12
+ column: {
13
+ notNullable: true
14
+ }
15
+ },
16
+ relatedDocumentId: {
17
+ type: 'string',
18
+ column: {
19
+ notNullable: true
20
+ }
21
+ },
22
+ sourceLocale: {
23
+ type: 'string',
24
+ column: {
25
+ notNullable: true
26
+ }
27
+ },
28
+ targetLocales: {
29
+ type: 'json',
30
+ column: {
31
+ notNullable: true
32
+ }
33
+ },
34
+ status: {
35
+ type: 'enumeration',
36
+ enum: [
37
+ 'processing',
38
+ 'completed',
39
+ 'failed'
40
+ ],
41
+ column: {
42
+ notNullable: true
43
+ }
44
+ },
45
+ createdAt: {
46
+ type: 'datetime',
47
+ default: ()=>new Date()
48
+ },
49
+ updatedAt: {
50
+ type: 'datetime',
51
+ default: ()=>new Date()
52
+ }
53
+ }
54
+ };
55
+
56
+ export { AI_LOCALIZATION_JOB_UID, aiLocalizationJob };
57
+ //# sourceMappingURL=ai-localization-job.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-localization-job.mjs","sources":["../../../server/src/models/ai-localization-job.ts"],"sourcesContent":["import type { Model } from '@strapi/database';\n\nconst AI_LOCALIZATION_JOB_UID = 'plugin::i18n.ai-localization-job';\n\nconst aiLocalizationJob: Model = {\n uid: AI_LOCALIZATION_JOB_UID,\n tableName: 'strapi_ai_localization_jobs',\n singularName: 'ai-localization-job',\n attributes: {\n id: {\n type: 'increments',\n },\n contentType: {\n type: 'string',\n column: { notNullable: true },\n },\n relatedDocumentId: {\n type: 'string',\n column: { notNullable: true },\n },\n sourceLocale: {\n type: 'string',\n column: { notNullable: true },\n },\n targetLocales: {\n type: 'json',\n column: { notNullable: true },\n },\n status: {\n type: 'enumeration',\n enum: ['processing', 'completed', 'failed'],\n column: { notNullable: true },\n },\n createdAt: {\n type: 'datetime',\n default: () => new Date(),\n },\n updatedAt: {\n type: 'datetime',\n default: () => new Date(),\n },\n },\n};\n\nexport { aiLocalizationJob, AI_LOCALIZATION_JOB_UID };\n"],"names":["AI_LOCALIZATION_JOB_UID","aiLocalizationJob","uid","tableName","singularName","attributes","id","type","contentType","column","notNullable","relatedDocumentId","sourceLocale","targetLocales","status","enum","createdAt","default","Date","updatedAt"],"mappings":"AAEA,MAAMA,uBAA0B,GAAA;AAEhC,MAAMC,iBAA2B,GAAA;IAC/BC,GAAKF,EAAAA,uBAAAA;IACLG,SAAW,EAAA,6BAAA;IACXC,YAAc,EAAA,qBAAA;IACdC,UAAY,EAAA;QACVC,EAAI,EAAA;YACFC,IAAM,EAAA;AACR,SAAA;QACAC,WAAa,EAAA;YACXD,IAAM,EAAA,QAAA;YACNE,MAAQ,EAAA;gBAAEC,WAAa,EAAA;AAAK;AAC9B,SAAA;QACAC,iBAAmB,EAAA;YACjBJ,IAAM,EAAA,QAAA;YACNE,MAAQ,EAAA;gBAAEC,WAAa,EAAA;AAAK;AAC9B,SAAA;QACAE,YAAc,EAAA;YACZL,IAAM,EAAA,QAAA;YACNE,MAAQ,EAAA;gBAAEC,WAAa,EAAA;AAAK;AAC9B,SAAA;QACAG,aAAe,EAAA;YACbN,IAAM,EAAA,MAAA;YACNE,MAAQ,EAAA;gBAAEC,WAAa,EAAA;AAAK;AAC9B,SAAA;QACAI,MAAQ,EAAA;YACNP,IAAM,EAAA,aAAA;YACNQ,IAAM,EAAA;AAAC,gBAAA,YAAA;AAAc,gBAAA,WAAA;AAAa,gBAAA;AAAS,aAAA;YAC3CN,MAAQ,EAAA;gBAAEC,WAAa,EAAA;AAAK;AAC9B,SAAA;QACAM,SAAW,EAAA;YACTT,IAAM,EAAA,UAAA;AACNU,YAAAA,OAAAA,EAAS,IAAM,IAAIC,IAAAA;AACrB,SAAA;QACAC,SAAW,EAAA;YACTZ,IAAM,EAAA,UAAA;AACNU,YAAAA,OAAAA,EAAS,IAAM,IAAIC,IAAAA;AACrB;AACF;AACF;;;;"}
@@ -4,8 +4,10 @@ var _ = require('lodash');
4
4
  var validateLocaleCreation = require('./controllers/validate-locale-creation.js');
5
5
  var graphql = require('./graphql.js');
6
6
  var index = require('./utils/index.js');
7
+ var aiLocalizationJob = require('./models/ai-localization-job.js');
7
8
 
8
- var register = (({ strapi })=>{
9
+ var register = (async ({ strapi })=>{
10
+ strapi.get('models').add(aiLocalizationJob.aiLocalizationJob);
9
11
  extendContentTypes(strapi);
10
12
  addContentManagerLocaleMiddleware(strapi);
11
13
  });