@strapi/i18n 0.0.0-next.614aaf36aaf7e94667b876f02949c3651d9715da → 0.0.0-next.62638801ce303ba9d03355a9f041541cc6668ae0

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 (426) hide show
  1. package/dist/admin/components/BulkLocaleActionModal.js +262 -0
  2. package/dist/admin/components/BulkLocaleActionModal.js.map +1 -0
  3. package/dist/admin/components/BulkLocaleActionModal.mjs +260 -0
  4. package/dist/admin/components/BulkLocaleActionModal.mjs.map +1 -0
  5. package/dist/admin/components/CMHeaderActions.js +995 -0
  6. package/dist/admin/components/CMHeaderActions.js.map +1 -0
  7. package/dist/admin/components/CMHeaderActions.mjs +969 -0
  8. package/dist/admin/components/CMHeaderActions.mjs.map +1 -0
  9. package/dist/admin/components/CMListViewModalsAdditionalInformation.js +69 -0
  10. package/dist/admin/components/CMListViewModalsAdditionalInformation.js.map +1 -0
  11. package/dist/admin/components/CMListViewModalsAdditionalInformation.mjs +65 -0
  12. package/dist/admin/components/CMListViewModalsAdditionalInformation.mjs.map +1 -0
  13. package/dist/admin/components/CheckboxConfirmation.js +155 -0
  14. package/dist/admin/components/CheckboxConfirmation.js.map +1 -0
  15. package/dist/admin/components/CheckboxConfirmation.mjs +134 -0
  16. package/dist/admin/components/CheckboxConfirmation.mjs.map +1 -0
  17. package/dist/admin/components/CreateLocale.js +399 -0
  18. package/dist/admin/components/CreateLocale.js.map +1 -0
  19. package/dist/admin/components/CreateLocale.mjs +373 -0
  20. package/dist/admin/components/CreateLocale.mjs.map +1 -0
  21. package/dist/admin/components/DeleteLocale.js +90 -0
  22. package/dist/admin/components/DeleteLocale.js.map +1 -0
  23. package/dist/admin/components/DeleteLocale.mjs +69 -0
  24. package/dist/admin/components/DeleteLocale.mjs.map +1 -0
  25. package/dist/admin/components/EditLocale.js +212 -0
  26. package/dist/admin/components/EditLocale.js.map +1 -0
  27. package/dist/admin/components/EditLocale.mjs +190 -0
  28. package/dist/admin/components/EditLocale.mjs.map +1 -0
  29. package/dist/admin/components/LocaleListCell.js +102 -0
  30. package/dist/admin/components/LocaleListCell.js.map +1 -0
  31. package/dist/admin/components/LocaleListCell.mjs +100 -0
  32. package/dist/admin/components/LocaleListCell.mjs.map +1 -0
  33. package/dist/admin/components/LocalePicker.js +105 -0
  34. package/dist/admin/components/LocalePicker.js.map +1 -0
  35. package/dist/admin/components/LocalePicker.mjs +84 -0
  36. package/dist/admin/components/LocalePicker.mjs.map +1 -0
  37. package/dist/admin/components/LocaleTable.js +143 -0
  38. package/dist/admin/components/LocaleTable.js.map +1 -0
  39. package/dist/admin/components/LocaleTable.mjs +122 -0
  40. package/dist/admin/components/LocaleTable.mjs.map +1 -0
  41. package/dist/admin/constants.js +37 -0
  42. package/dist/admin/constants.js.map +1 -0
  43. package/dist/admin/constants.mjs +35 -0
  44. package/dist/admin/constants.mjs.map +1 -0
  45. package/dist/admin/contentManagerHooks/editView.js +109 -0
  46. package/dist/admin/contentManagerHooks/editView.js.map +1 -0
  47. package/dist/admin/contentManagerHooks/editView.mjs +88 -0
  48. package/dist/admin/contentManagerHooks/editView.mjs.map +1 -0
  49. package/dist/admin/contentManagerHooks/listView.js +44 -0
  50. package/dist/admin/contentManagerHooks/listView.js.map +1 -0
  51. package/dist/admin/contentManagerHooks/listView.mjs +42 -0
  52. package/dist/admin/contentManagerHooks/listView.mjs.map +1 -0
  53. package/dist/admin/contentReleasesHooks/releaseDetailsView.js +20 -0
  54. package/dist/admin/contentReleasesHooks/releaseDetailsView.js.map +1 -0
  55. package/dist/admin/contentReleasesHooks/releaseDetailsView.mjs +18 -0
  56. package/dist/admin/contentReleasesHooks/releaseDetailsView.mjs.map +1 -0
  57. package/dist/admin/hooks/useAILocalizationJobsPolling.js +110 -0
  58. package/dist/admin/hooks/useAILocalizationJobsPolling.js.map +1 -0
  59. package/dist/admin/hooks/useAILocalizationJobsPolling.mjs +89 -0
  60. package/dist/admin/hooks/useAILocalizationJobsPolling.mjs.map +1 -0
  61. package/dist/admin/hooks/useI18n.js +78 -0
  62. package/dist/admin/hooks/useI18n.js.map +1 -0
  63. package/dist/admin/hooks/useI18n.mjs +57 -0
  64. package/dist/admin/hooks/useI18n.mjs.map +1 -0
  65. package/dist/admin/index.js +221 -16
  66. package/dist/admin/index.js.map +1 -1
  67. package/dist/admin/index.mjs +203 -15
  68. package/dist/admin/index.mjs.map +1 -1
  69. package/dist/admin/middlewares/extendCTBAttributeInitialData.js +71 -0
  70. package/dist/admin/middlewares/extendCTBAttributeInitialData.js.map +1 -0
  71. package/dist/admin/middlewares/extendCTBAttributeInitialData.mjs +69 -0
  72. package/dist/admin/middlewares/extendCTBAttributeInitialData.mjs.map +1 -0
  73. package/dist/admin/middlewares/extendCTBInitialData.js +40 -0
  74. package/dist/admin/middlewares/extendCTBInitialData.js.map +1 -0
  75. package/dist/admin/middlewares/extendCTBInitialData.mjs +38 -0
  76. package/dist/admin/middlewares/extendCTBInitialData.mjs.map +1 -0
  77. package/dist/admin/middlewares/rbac-middleware.js +49 -0
  78. package/dist/admin/middlewares/rbac-middleware.js.map +1 -0
  79. package/dist/admin/middlewares/rbac-middleware.mjs +28 -0
  80. package/dist/admin/middlewares/rbac-middleware.mjs.map +1 -0
  81. package/dist/admin/pages/SettingsPage.js +182 -0
  82. package/dist/admin/pages/SettingsPage.js.map +1 -0
  83. package/dist/admin/pages/SettingsPage.mjs +179 -0
  84. package/dist/admin/pages/SettingsPage.mjs.map +1 -0
  85. package/dist/admin/pluginId.js +6 -0
  86. package/dist/admin/pluginId.js.map +1 -0
  87. package/dist/admin/pluginId.mjs +4 -0
  88. package/dist/admin/pluginId.mjs.map +1 -0
  89. package/dist/admin/services/aiLocalizationJobs.js +26 -0
  90. package/dist/admin/services/aiLocalizationJobs.js.map +1 -0
  91. package/dist/admin/services/aiLocalizationJobs.mjs +24 -0
  92. package/dist/admin/services/aiLocalizationJobs.mjs.map +1 -0
  93. package/dist/admin/services/api.js +15 -0
  94. package/dist/admin/services/api.js.map +1 -0
  95. package/dist/admin/services/api.mjs +13 -0
  96. package/dist/admin/services/api.mjs.map +1 -0
  97. package/dist/admin/services/locales.js +72 -0
  98. package/dist/admin/services/locales.js.map +1 -0
  99. package/dist/admin/services/locales.mjs +66 -0
  100. package/dist/admin/services/locales.mjs.map +1 -0
  101. package/dist/admin/services/relations.js +23 -0
  102. package/dist/admin/services/relations.js.map +1 -0
  103. package/dist/admin/services/relations.mjs +21 -0
  104. package/dist/admin/services/relations.mjs.map +1 -0
  105. package/dist/admin/services/settings.js +30 -0
  106. package/dist/admin/services/settings.js.map +1 -0
  107. package/dist/admin/services/settings.mjs +27 -0
  108. package/dist/admin/services/settings.mjs.map +1 -0
  109. package/dist/admin/src/components/CMHeaderActions.d.ts +17 -4
  110. package/dist/admin/src/components/LocaleListCell.d.ts +2 -1
  111. package/dist/admin/src/hooks/useAILocalizationJobsPolling.d.ts +9 -0
  112. package/dist/admin/src/services/aiLocalizationJobs.d.ts +6 -0
  113. package/dist/admin/src/services/api.d.ts +1 -1
  114. package/dist/admin/src/services/locales.d.ts +1 -1
  115. package/dist/admin/src/services/relations.d.ts +1 -1
  116. package/dist/admin/src/services/settings.d.ts +5 -0
  117. package/dist/admin/src/utils/schemas.d.ts +642 -16
  118. package/dist/admin/{chunks/de-nEMWvIiY.js → translations/de.json.js} +2 -2
  119. package/dist/admin/translations/de.json.js.map +1 -0
  120. package/dist/admin/{chunks/de-Cm8mYdaO.mjs → translations/de.json.mjs} +1 -1
  121. package/dist/admin/translations/de.json.mjs.map +1 -0
  122. package/dist/admin/{chunks/dk-CYATLPVe.js → translations/dk.json.js} +2 -2
  123. package/dist/admin/translations/dk.json.js.map +1 -0
  124. package/dist/admin/{chunks/dk-BeUFOegB.mjs → translations/dk.json.mjs} +1 -1
  125. package/dist/admin/translations/dk.json.mjs.map +1 -0
  126. package/dist/admin/{chunks/en-CG5cUCbD.js → translations/en.json.js} +12 -2
  127. package/dist/admin/translations/en.json.js.map +1 -0
  128. package/dist/admin/{chunks/en-eWSaCeOb.mjs → translations/en.json.mjs} +11 -1
  129. package/dist/admin/translations/en.json.mjs.map +1 -0
  130. package/dist/admin/{chunks/es-CWsogTGm.js → translations/es.json.js} +2 -2
  131. package/dist/admin/translations/es.json.js.map +1 -0
  132. package/dist/admin/{chunks/es-DqF_IdAc.mjs → translations/es.json.mjs} +1 -1
  133. package/dist/admin/translations/es.json.mjs.map +1 -0
  134. package/dist/admin/{chunks/fr-CC7UFcYd.js → translations/fr.json.js} +2 -2
  135. package/dist/admin/translations/fr.json.js.map +1 -0
  136. package/dist/admin/{chunks/fr-CyARbZ3c.mjs → translations/fr.json.mjs} +1 -1
  137. package/dist/admin/translations/fr.json.mjs.map +1 -0
  138. package/dist/admin/{chunks/ko-XwGmfhoq.js → translations/ko.json.js} +2 -2
  139. package/dist/admin/translations/ko.json.js.map +1 -0
  140. package/dist/admin/{chunks/ko-Ax4NSedM.mjs → translations/ko.json.mjs} +1 -1
  141. package/dist/admin/translations/ko.json.mjs.map +1 -0
  142. package/dist/admin/{chunks/pl-B_vzY_ZB.js → translations/pl.json.js} +2 -2
  143. package/dist/admin/translations/pl.json.js.map +1 -0
  144. package/dist/admin/{chunks/pl-B-aqvMqL.mjs → translations/pl.json.mjs} +1 -1
  145. package/dist/admin/translations/pl.json.mjs.map +1 -0
  146. package/dist/admin/{chunks/ru-WzHcJV1f.js → translations/ru.json.js} +2 -2
  147. package/dist/admin/translations/ru.json.js.map +1 -0
  148. package/dist/admin/{chunks/ru-VkPjQ-Sk.mjs → translations/ru.json.mjs} +1 -1
  149. package/dist/admin/translations/ru.json.mjs.map +1 -0
  150. package/dist/admin/{chunks/tr-CcWp6u3w.js → translations/tr.json.js} +2 -2
  151. package/dist/admin/translations/tr.json.js.map +1 -0
  152. package/dist/admin/{chunks/tr-DcTR88c9.mjs → translations/tr.json.mjs} +1 -1
  153. package/dist/admin/translations/tr.json.mjs.map +1 -0
  154. package/dist/admin/{chunks/uk-CO6JHYRC.js → translations/uk.json.js} +2 -2
  155. package/dist/admin/translations/uk.json.js.map +1 -0
  156. package/dist/admin/{chunks/uk-CMz6iPag.mjs → translations/uk.json.mjs} +1 -1
  157. package/dist/admin/translations/uk.json.mjs.map +1 -0
  158. package/dist/admin/{chunks/zh-Hans-DnU2bhri.js → translations/zh-Hans.json.js} +2 -2
  159. package/dist/admin/translations/zh-Hans.json.js.map +1 -0
  160. package/dist/admin/{chunks/zh-Hans-L3wsRegj.mjs → translations/zh-Hans.json.mjs} +1 -1
  161. package/dist/admin/translations/zh-Hans.json.mjs.map +1 -0
  162. package/dist/admin/{chunks/zh-C9So4SGq.js → translations/zh.json.js} +2 -2
  163. package/dist/admin/translations/zh.json.js.map +1 -0
  164. package/dist/admin/{chunks/zh-RZyMiPIs.mjs → translations/zh.json.mjs} +1 -1
  165. package/dist/admin/translations/zh.json.mjs.map +1 -0
  166. package/dist/admin/utils/baseQuery.js +8 -0
  167. package/dist/admin/utils/baseQuery.js.map +1 -0
  168. package/dist/admin/utils/baseQuery.mjs +6 -0
  169. package/dist/admin/utils/baseQuery.mjs.map +1 -0
  170. package/dist/admin/utils/clean.js +70 -0
  171. package/dist/admin/utils/clean.js.map +1 -0
  172. package/dist/admin/utils/clean.mjs +68 -0
  173. package/dist/admin/utils/clean.mjs.map +1 -0
  174. package/dist/admin/utils/fields.js +34 -0
  175. package/dist/admin/utils/fields.js.map +1 -0
  176. package/dist/admin/utils/fields.mjs +31 -0
  177. package/dist/admin/utils/fields.mjs.map +1 -0
  178. package/dist/admin/utils/getTranslation.js +8 -0
  179. package/dist/admin/utils/getTranslation.js.map +1 -0
  180. package/dist/admin/utils/getTranslation.mjs +6 -0
  181. package/dist/admin/utils/getTranslation.mjs.map +1 -0
  182. package/dist/admin/utils/prefixPluginTranslations.js +11 -0
  183. package/dist/admin/utils/prefixPluginTranslations.js.map +1 -0
  184. package/dist/admin/utils/prefixPluginTranslations.mjs +9 -0
  185. package/dist/admin/utils/prefixPluginTranslations.mjs.map +1 -0
  186. package/dist/admin/utils/schemas.js +74 -0
  187. package/dist/admin/utils/schemas.js.map +1 -0
  188. package/dist/admin/utils/schemas.mjs +72 -0
  189. package/dist/admin/utils/schemas.mjs.map +1 -0
  190. package/dist/admin/utils/strings.js +6 -0
  191. package/dist/admin/utils/strings.js.map +1 -0
  192. package/dist/admin/utils/strings.mjs +4 -0
  193. package/dist/admin/utils/strings.mjs.map +1 -0
  194. package/dist/server/bootstrap.js +95 -0
  195. package/dist/server/bootstrap.js.map +1 -0
  196. package/dist/server/bootstrap.mjs +93 -0
  197. package/dist/server/bootstrap.mjs.map +1 -0
  198. package/dist/server/constants/index.js +29 -0
  199. package/dist/server/constants/index.js.map +1 -0
  200. package/dist/server/constants/index.mjs +25 -0
  201. package/dist/server/constants/index.mjs.map +1 -0
  202. package/dist/server/constants/iso-locales.json.js +2427 -0
  203. package/dist/server/constants/iso-locales.json.js.map +1 -0
  204. package/dist/server/constants/iso-locales.json.mjs +2425 -0
  205. package/dist/server/constants/iso-locales.json.mjs.map +1 -0
  206. package/dist/server/content-types/index.js +10 -0
  207. package/dist/server/content-types/index.js.map +1 -0
  208. package/dist/server/content-types/index.mjs +8 -0
  209. package/dist/server/content-types/index.mjs.map +1 -0
  210. package/dist/server/content-types/locale/index.js +10 -0
  211. package/dist/server/content-types/locale/index.js.map +1 -0
  212. package/dist/server/content-types/locale/index.mjs +8 -0
  213. package/dist/server/content-types/locale/index.mjs.map +1 -0
  214. package/dist/server/content-types/locale/schema.json.js +46 -0
  215. package/dist/server/content-types/locale/schema.json.js.map +1 -0
  216. package/dist/server/content-types/locale/schema.json.mjs +38 -0
  217. package/dist/server/content-types/locale/schema.json.mjs.map +1 -0
  218. package/dist/server/controllers/ai-localization-jobs.js +47 -0
  219. package/dist/server/controllers/ai-localization-jobs.js.map +1 -0
  220. package/dist/server/controllers/ai-localization-jobs.mjs +45 -0
  221. package/dist/server/controllers/ai-localization-jobs.mjs.map +1 -0
  222. package/dist/server/controllers/content-types.js +76 -0
  223. package/dist/server/controllers/content-types.js.map +1 -0
  224. package/dist/server/controllers/content-types.mjs +74 -0
  225. package/dist/server/controllers/content-types.mjs.map +1 -0
  226. package/dist/server/controllers/index.js +18 -0
  227. package/dist/server/controllers/index.js.map +1 -0
  228. package/dist/server/controllers/index.mjs +16 -0
  229. package/dist/server/controllers/index.mjs.map +1 -0
  230. package/dist/server/controllers/iso-locales.js +13 -0
  231. package/dist/server/controllers/iso-locales.js.map +1 -0
  232. package/dist/server/controllers/iso-locales.mjs +11 -0
  233. package/dist/server/controllers/iso-locales.mjs.map +1 -0
  234. package/dist/server/controllers/locales.js +108 -0
  235. package/dist/server/controllers/locales.js.map +1 -0
  236. package/dist/server/controllers/locales.mjs +87 -0
  237. package/dist/server/controllers/locales.mjs.map +1 -0
  238. package/dist/server/controllers/settings.js +24 -0
  239. package/dist/server/controllers/settings.js.map +1 -0
  240. package/dist/server/controllers/settings.mjs +22 -0
  241. package/dist/server/controllers/settings.mjs.map +1 -0
  242. package/dist/server/controllers/validate-locale-creation.js +47 -0
  243. package/dist/server/controllers/validate-locale-creation.js.map +1 -0
  244. package/dist/server/controllers/validate-locale-creation.mjs +45 -0
  245. package/dist/server/controllers/validate-locale-creation.mjs.map +1 -0
  246. package/dist/server/domain/locale.js +11 -0
  247. package/dist/server/domain/locale.js.map +1 -0
  248. package/dist/server/domain/locale.mjs +9 -0
  249. package/dist/server/domain/locale.mjs.map +1 -0
  250. package/dist/server/graphql.js +115 -0
  251. package/dist/server/graphql.js.map +1 -0
  252. package/dist/server/graphql.mjs +113 -0
  253. package/dist/server/graphql.mjs.map +1 -0
  254. package/dist/server/index.js +10 -3712
  255. package/dist/server/index.js.map +1 -1
  256. package/dist/server/index.mjs +7 -3691
  257. package/dist/server/index.mjs.map +1 -1
  258. package/dist/server/models/ai-localization-job.js +60 -0
  259. package/dist/server/models/ai-localization-job.js.map +1 -0
  260. package/dist/server/models/ai-localization-job.mjs +57 -0
  261. package/dist/server/models/ai-localization-job.mjs.map +1 -0
  262. package/dist/server/register.js +81 -0
  263. package/dist/server/register.js.map +1 -0
  264. package/dist/server/register.mjs +79 -0
  265. package/dist/server/register.mjs.map +1 -0
  266. package/dist/server/routes/admin.js +142 -0
  267. package/dist/server/routes/admin.js.map +1 -0
  268. package/dist/server/routes/admin.mjs +140 -0
  269. package/dist/server/routes/admin.mjs.map +1 -0
  270. package/dist/server/routes/content-api.js +19 -0
  271. package/dist/server/routes/content-api.js.map +1 -0
  272. package/dist/server/routes/content-api.mjs +17 -0
  273. package/dist/server/routes/content-api.mjs.map +1 -0
  274. package/dist/server/routes/index.js +12 -0
  275. package/dist/server/routes/index.js.map +1 -0
  276. package/dist/server/routes/index.mjs +10 -0
  277. package/dist/server/routes/index.mjs.map +1 -0
  278. package/dist/server/routes/validation/locale.js +57 -0
  279. package/dist/server/routes/validation/locale.js.map +1 -0
  280. package/dist/server/routes/validation/locale.mjs +36 -0
  281. package/dist/server/routes/validation/locale.mjs.map +1 -0
  282. package/dist/server/services/ai-localization-jobs.js +64 -0
  283. package/dist/server/services/ai-localization-jobs.js.map +1 -0
  284. package/dist/server/services/ai-localization-jobs.mjs +62 -0
  285. package/dist/server/services/ai-localization-jobs.mjs.map +1 -0
  286. package/dist/server/services/ai-localizations.js +268 -0
  287. package/dist/server/services/ai-localizations.js.map +1 -0
  288. package/dist/server/services/ai-localizations.mjs +266 -0
  289. package/dist/server/services/ai-localizations.mjs.map +1 -0
  290. package/dist/server/services/content-types.js +157 -0
  291. package/dist/server/services/content-types.js.map +1 -0
  292. package/dist/server/services/content-types.mjs +155 -0
  293. package/dist/server/services/content-types.mjs.map +1 -0
  294. package/dist/server/services/index.js +28 -0
  295. package/dist/server/services/index.js.map +1 -0
  296. package/dist/server/services/index.mjs +26 -0
  297. package/dist/server/services/index.mjs.map +1 -0
  298. package/dist/server/services/iso-locales.js +12 -0
  299. package/dist/server/services/iso-locales.js.map +1 -0
  300. package/dist/server/services/iso-locales.mjs +10 -0
  301. package/dist/server/services/iso-locales.mjs.map +1 -0
  302. package/dist/server/services/locales.js +114 -0
  303. package/dist/server/services/locales.js.map +1 -0
  304. package/dist/server/services/locales.mjs +112 -0
  305. package/dist/server/services/locales.mjs.map +1 -0
  306. package/dist/server/services/localizations.js +68 -0
  307. package/dist/server/services/localizations.js.map +1 -0
  308. package/dist/server/services/localizations.mjs +66 -0
  309. package/dist/server/services/localizations.mjs.map +1 -0
  310. package/dist/server/services/metrics.js +30 -0
  311. package/dist/server/services/metrics.js.map +1 -0
  312. package/dist/server/services/metrics.mjs +28 -0
  313. package/dist/server/services/metrics.mjs.map +1 -0
  314. package/dist/server/services/permissions/actions.js +136 -0
  315. package/dist/server/services/permissions/actions.js.map +1 -0
  316. package/dist/server/services/permissions/actions.mjs +134 -0
  317. package/dist/server/services/permissions/actions.mjs.map +1 -0
  318. package/dist/server/services/permissions/engine.js +52 -0
  319. package/dist/server/services/permissions/engine.js.map +1 -0
  320. package/dist/server/services/permissions/engine.mjs +50 -0
  321. package/dist/server/services/permissions/engine.mjs.map +1 -0
  322. package/dist/server/services/permissions/sections-builder.js +45 -0
  323. package/dist/server/services/permissions/sections-builder.js.map +1 -0
  324. package/dist/server/services/permissions/sections-builder.mjs +43 -0
  325. package/dist/server/services/permissions/sections-builder.mjs.map +1 -0
  326. package/dist/server/services/permissions.js +14 -0
  327. package/dist/server/services/permissions.js.map +1 -0
  328. package/dist/server/services/permissions.mjs +12 -0
  329. package/dist/server/services/permissions.mjs.map +1 -0
  330. package/dist/server/services/sanitize/index.js +34 -0
  331. package/dist/server/services/sanitize/index.js.map +1 -0
  332. package/dist/server/services/sanitize/index.mjs +32 -0
  333. package/dist/server/services/sanitize/index.mjs.map +1 -0
  334. package/dist/server/services/settings.js +25 -0
  335. package/dist/server/services/settings.js.map +1 -0
  336. package/dist/server/services/settings.mjs +23 -0
  337. package/dist/server/services/settings.mjs.map +1 -0
  338. package/dist/server/src/bootstrap.d.ts.map +1 -1
  339. package/dist/server/src/controllers/ai-localization-jobs.d.ts +17 -0
  340. package/dist/server/src/controllers/ai-localization-jobs.d.ts.map +1 -0
  341. package/dist/server/src/controllers/index.d.ts +10 -0
  342. package/dist/server/src/controllers/index.d.ts.map +1 -1
  343. package/dist/server/src/controllers/settings.d.ts +7 -0
  344. package/dist/server/src/controllers/settings.d.ts.map +1 -0
  345. package/dist/server/src/index.d.ts +47 -8
  346. package/dist/server/src/index.d.ts.map +1 -1
  347. package/dist/server/src/models/ai-localization-job.d.ts +5 -0
  348. package/dist/server/src/models/ai-localization-job.d.ts.map +1 -0
  349. package/dist/server/src/models/index.d.ts +5 -0
  350. package/dist/server/src/models/index.d.ts.map +1 -0
  351. package/dist/server/src/register.d.ts +1 -1
  352. package/dist/server/src/register.d.ts.map +1 -1
  353. package/dist/server/src/routes/admin.d.ts.map +1 -1
  354. package/dist/server/src/routes/content-api.d.ts +5 -8
  355. package/dist/server/src/routes/content-api.d.ts.map +1 -1
  356. package/dist/server/src/routes/index.d.ts +3 -7
  357. package/dist/server/src/routes/index.d.ts.map +1 -1
  358. package/dist/server/src/routes/validation/index.d.ts +2 -0
  359. package/dist/server/src/routes/validation/index.d.ts.map +1 -0
  360. package/dist/server/src/routes/validation/locale.d.ts +41 -0
  361. package/dist/server/src/routes/validation/locale.d.ts.map +1 -0
  362. package/dist/server/src/services/ai-localization-jobs.d.ts +26 -0
  363. package/dist/server/src/services/ai-localization-jobs.d.ts.map +1 -0
  364. package/dist/server/src/services/ai-localizations.d.ts +18 -0
  365. package/dist/server/src/services/ai-localizations.d.ts.map +1 -0
  366. package/dist/server/src/services/index.d.ts +33 -0
  367. package/dist/server/src/services/index.d.ts.map +1 -1
  368. package/dist/server/src/services/settings.d.ts +13 -0
  369. package/dist/server/src/services/settings.d.ts.map +1 -0
  370. package/dist/server/src/utils/index.d.ts +7 -1
  371. package/dist/server/src/utils/index.d.ts.map +1 -1
  372. package/dist/server/src/validation/settings.d.ts +12 -0
  373. package/dist/server/src/validation/settings.d.ts.map +1 -0
  374. package/dist/server/utils/index.js +16 -0
  375. package/dist/server/utils/index.js.map +1 -0
  376. package/dist/server/utils/index.mjs +13 -0
  377. package/dist/server/utils/index.mjs.map +1 -0
  378. package/dist/server/validation/content-types.js +18 -0
  379. package/dist/server/validation/content-types.js.map +1 -0
  380. package/dist/server/validation/content-types.mjs +16 -0
  381. package/dist/server/validation/content-types.mjs.map +1 -0
  382. package/dist/server/validation/locales.js +23 -0
  383. package/dist/server/validation/locales.js.map +1 -0
  384. package/dist/server/validation/locales.mjs +20 -0
  385. package/dist/server/validation/locales.mjs.map +1 -0
  386. package/dist/server/validation/settings.js +11 -0
  387. package/dist/server/validation/settings.js.map +1 -0
  388. package/dist/server/validation/settings.mjs +9 -0
  389. package/dist/server/validation/settings.mjs.map +1 -0
  390. package/dist/shared/contracts/ai-localization-jobs.d.ts +27 -0
  391. package/dist/shared/contracts/ai-localization-jobs.d.ts.map +1 -0
  392. package/dist/shared/contracts/settings.d.ts +40 -0
  393. package/dist/shared/contracts/shared.d.ts.map +1 -0
  394. package/package.json +13 -10
  395. package/dist/admin/chunks/SettingsPage-BOEeBbiM.mjs +0 -797
  396. package/dist/admin/chunks/SettingsPage-BOEeBbiM.mjs.map +0 -1
  397. package/dist/admin/chunks/SettingsPage-Mg2Ygywx.js +0 -820
  398. package/dist/admin/chunks/SettingsPage-Mg2Ygywx.js.map +0 -1
  399. package/dist/admin/chunks/de-Cm8mYdaO.mjs.map +0 -1
  400. package/dist/admin/chunks/de-nEMWvIiY.js.map +0 -1
  401. package/dist/admin/chunks/dk-BeUFOegB.mjs.map +0 -1
  402. package/dist/admin/chunks/dk-CYATLPVe.js.map +0 -1
  403. package/dist/admin/chunks/en-CG5cUCbD.js.map +0 -1
  404. package/dist/admin/chunks/en-eWSaCeOb.mjs.map +0 -1
  405. package/dist/admin/chunks/es-CWsogTGm.js.map +0 -1
  406. package/dist/admin/chunks/es-DqF_IdAc.mjs.map +0 -1
  407. package/dist/admin/chunks/fr-CC7UFcYd.js.map +0 -1
  408. package/dist/admin/chunks/fr-CyARbZ3c.mjs.map +0 -1
  409. package/dist/admin/chunks/index--VTS8j_L.mjs +0 -2008
  410. package/dist/admin/chunks/index--VTS8j_L.mjs.map +0 -1
  411. package/dist/admin/chunks/index-hJ67XV0K.js +0 -2037
  412. package/dist/admin/chunks/index-hJ67XV0K.js.map +0 -1
  413. package/dist/admin/chunks/ko-Ax4NSedM.mjs.map +0 -1
  414. package/dist/admin/chunks/ko-XwGmfhoq.js.map +0 -1
  415. package/dist/admin/chunks/pl-B-aqvMqL.mjs.map +0 -1
  416. package/dist/admin/chunks/pl-B_vzY_ZB.js.map +0 -1
  417. package/dist/admin/chunks/ru-VkPjQ-Sk.mjs.map +0 -1
  418. package/dist/admin/chunks/ru-WzHcJV1f.js.map +0 -1
  419. package/dist/admin/chunks/tr-CcWp6u3w.js.map +0 -1
  420. package/dist/admin/chunks/tr-DcTR88c9.mjs.map +0 -1
  421. package/dist/admin/chunks/uk-CMz6iPag.mjs.map +0 -1
  422. package/dist/admin/chunks/uk-CO6JHYRC.js.map +0 -1
  423. package/dist/admin/chunks/zh-C9So4SGq.js.map +0 -1
  424. package/dist/admin/chunks/zh-Hans-DnU2bhri.js.map +0 -1
  425. package/dist/admin/chunks/zh-Hans-L3wsRegj.mjs.map +0 -1
  426. package/dist/admin/chunks/zh-RZyMiPIs.mjs.map +0 -1
@@ -0,0 +1,142 @@
1
+ 'use strict';
2
+
3
+ var admin = {
4
+ type: 'admin',
5
+ routes: [
6
+ {
7
+ method: 'GET',
8
+ path: '/iso-locales',
9
+ handler: 'iso-locales.listIsoLocales',
10
+ config: {
11
+ policies: [
12
+ 'admin::isAuthenticatedAdmin',
13
+ {
14
+ name: 'plugin::content-manager.hasPermissions',
15
+ config: {
16
+ actions: [
17
+ 'plugin::i18n.locale.read'
18
+ ]
19
+ }
20
+ }
21
+ ]
22
+ }
23
+ },
24
+ {
25
+ method: 'GET',
26
+ path: '/locales',
27
+ handler: 'locales.listLocales',
28
+ config: {
29
+ policies: [
30
+ 'admin::isAuthenticatedAdmin'
31
+ ]
32
+ }
33
+ },
34
+ {
35
+ method: 'POST',
36
+ path: '/locales',
37
+ handler: 'locales.createLocale',
38
+ config: {
39
+ policies: [
40
+ 'admin::isAuthenticatedAdmin',
41
+ {
42
+ name: 'plugin::content-manager.hasPermissions',
43
+ config: {
44
+ actions: [
45
+ 'plugin::i18n.locale.create'
46
+ ]
47
+ }
48
+ }
49
+ ]
50
+ }
51
+ },
52
+ {
53
+ method: 'PUT',
54
+ path: '/locales/:id',
55
+ handler: 'locales.updateLocale',
56
+ config: {
57
+ policies: [
58
+ 'admin::isAuthenticatedAdmin',
59
+ {
60
+ name: 'plugin::content-manager.hasPermissions',
61
+ config: {
62
+ actions: [
63
+ 'plugin::i18n.locale.update'
64
+ ]
65
+ }
66
+ }
67
+ ]
68
+ }
69
+ },
70
+ {
71
+ method: 'DELETE',
72
+ path: '/locales/:id',
73
+ handler: 'locales.deleteLocale',
74
+ config: {
75
+ policies: [
76
+ 'admin::isAuthenticatedAdmin',
77
+ {
78
+ name: 'plugin::content-manager.hasPermissions',
79
+ config: {
80
+ actions: [
81
+ 'plugin::i18n.locale.delete'
82
+ ]
83
+ }
84
+ }
85
+ ]
86
+ }
87
+ },
88
+ {
89
+ method: 'POST',
90
+ path: '/content-manager/actions/get-non-localized-fields',
91
+ handler: 'content-types.getNonLocalizedAttributes',
92
+ config: {
93
+ policies: [
94
+ 'admin::isAuthenticatedAdmin'
95
+ ]
96
+ }
97
+ },
98
+ {
99
+ method: 'GET',
100
+ path: '/settings',
101
+ handler: 'settings.getSettings',
102
+ config: {
103
+ policies: [
104
+ 'admin::isAuthenticatedAdmin'
105
+ ]
106
+ }
107
+ },
108
+ {
109
+ method: 'PUT',
110
+ path: '/settings',
111
+ handler: 'settings.updateSettings',
112
+ config: {
113
+ policies: [
114
+ 'admin::isAuthenticatedAdmin'
115
+ ]
116
+ }
117
+ },
118
+ {
119
+ method: 'GET',
120
+ path: '/ai-localization-jobs/collection-types/:contentType/:documentId',
121
+ handler: 'ai-localization-jobs.getJobForCollectionType',
122
+ config: {
123
+ policies: [
124
+ 'admin::isAuthenticatedAdmin'
125
+ ]
126
+ }
127
+ },
128
+ {
129
+ method: 'GET',
130
+ path: '/ai-localization-jobs/single-types/:contentType',
131
+ handler: 'ai-localization-jobs.getJobForSingleType',
132
+ config: {
133
+ policies: [
134
+ 'admin::isAuthenticatedAdmin'
135
+ ]
136
+ }
137
+ }
138
+ ]
139
+ };
140
+
141
+ module.exports = admin;
142
+ //# sourceMappingURL=admin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin.js","sources":["../../../server/src/routes/admin.ts"],"sourcesContent":["export default {\n type: 'admin',\n routes: [\n {\n method: 'GET',\n path: '/iso-locales',\n handler: 'iso-locales.listIsoLocales',\n config: {\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'plugin::content-manager.hasPermissions',\n config: { actions: ['plugin::i18n.locale.read'] },\n },\n ],\n },\n },\n {\n method: 'GET',\n path: '/locales',\n handler: 'locales.listLocales',\n config: {\n policies: ['admin::isAuthenticatedAdmin'],\n },\n },\n {\n method: 'POST',\n path: '/locales',\n handler: 'locales.createLocale',\n config: {\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'plugin::content-manager.hasPermissions',\n config: { actions: ['plugin::i18n.locale.create'] },\n },\n ],\n },\n },\n {\n method: 'PUT',\n path: '/locales/:id',\n handler: 'locales.updateLocale',\n config: {\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'plugin::content-manager.hasPermissions',\n config: { actions: ['plugin::i18n.locale.update'] },\n },\n ],\n },\n },\n {\n method: 'DELETE',\n path: '/locales/:id',\n handler: 'locales.deleteLocale',\n config: {\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'plugin::content-manager.hasPermissions',\n config: { actions: ['plugin::i18n.locale.delete'] },\n },\n ],\n },\n },\n {\n method: 'POST',\n path: '/content-manager/actions/get-non-localized-fields',\n handler: 'content-types.getNonLocalizedAttributes',\n config: {\n policies: ['admin::isAuthenticatedAdmin'],\n },\n },\n {\n method: 'GET',\n path: '/settings',\n handler: 'settings.getSettings',\n config: {\n policies: ['admin::isAuthenticatedAdmin'],\n },\n },\n {\n method: 'PUT',\n path: '/settings',\n handler: 'settings.updateSettings',\n config: {\n policies: ['admin::isAuthenticatedAdmin'],\n },\n },\n {\n method: 'GET',\n path: '/ai-localization-jobs/collection-types/:contentType/:documentId',\n handler: 'ai-localization-jobs.getJobForCollectionType',\n config: {\n policies: ['admin::isAuthenticatedAdmin'],\n },\n },\n {\n method: 'GET',\n path: '/ai-localization-jobs/single-types/:contentType',\n handler: 'ai-localization-jobs.getJobForSingleType',\n config: {\n policies: ['admin::isAuthenticatedAdmin'],\n },\n },\n ],\n};\n"],"names":["type","routes","method","path","handler","config","policies","name","actions"],"mappings":";;AAAA,YAAe;IACbA,IAAM,EAAA,OAAA;IACNC,MAAQ,EAAA;AACN,QAAA;YACEC,MAAQ,EAAA,KAAA;YACRC,IAAM,EAAA,cAAA;YACNC,OAAS,EAAA,4BAAA;YACTC,MAAQ,EAAA;gBACNC,QAAU,EAAA;AACR,oBAAA,6BAAA;AACA,oBAAA;wBACEC,IAAM,EAAA,wCAAA;wBACNF,MAAQ,EAAA;4BAAEG,OAAS,EAAA;AAAC,gCAAA;AAA2B;AAAC;AAClD;AACD;AACH;AACF,SAAA;AACA,QAAA;YACEN,MAAQ,EAAA,KAAA;YACRC,IAAM,EAAA,UAAA;YACNC,OAAS,EAAA,qBAAA;YACTC,MAAQ,EAAA;gBACNC,QAAU,EAAA;AAAC,oBAAA;AAA8B;AAC3C;AACF,SAAA;AACA,QAAA;YACEJ,MAAQ,EAAA,MAAA;YACRC,IAAM,EAAA,UAAA;YACNC,OAAS,EAAA,sBAAA;YACTC,MAAQ,EAAA;gBACNC,QAAU,EAAA;AACR,oBAAA,6BAAA;AACA,oBAAA;wBACEC,IAAM,EAAA,wCAAA;wBACNF,MAA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gBACNC,QAAU,EAAA;AAAC,oBAAA;AAA8B;AAC3C;AACF,SAAA;AACA,QAAA;YACEJ,MAAQ,EAAA,KAAA;YACRC,IAAM,EAAA,iDAAA;YACNC,OAAS,EAAA,0CAAA;YACTC,MAAQ,EAAA;gBACNC,QAAU,EAAA;AAAC,oBAAA;AAA8B;AAC3C;AACF;AACD;AACH,CAAE;;;;"}
@@ -0,0 +1,140 @@
1
+ var admin = {
2
+ type: 'admin',
3
+ routes: [
4
+ {
5
+ method: 'GET',
6
+ path: '/iso-locales',
7
+ handler: 'iso-locales.listIsoLocales',
8
+ config: {
9
+ policies: [
10
+ 'admin::isAuthenticatedAdmin',
11
+ {
12
+ name: 'plugin::content-manager.hasPermissions',
13
+ config: {
14
+ actions: [
15
+ 'plugin::i18n.locale.read'
16
+ ]
17
+ }
18
+ }
19
+ ]
20
+ }
21
+ },
22
+ {
23
+ method: 'GET',
24
+ path: '/locales',
25
+ handler: 'locales.listLocales',
26
+ config: {
27
+ policies: [
28
+ 'admin::isAuthenticatedAdmin'
29
+ ]
30
+ }
31
+ },
32
+ {
33
+ method: 'POST',
34
+ path: '/locales',
35
+ handler: 'locales.createLocale',
36
+ config: {
37
+ policies: [
38
+ 'admin::isAuthenticatedAdmin',
39
+ {
40
+ name: 'plugin::content-manager.hasPermissions',
41
+ config: {
42
+ actions: [
43
+ 'plugin::i18n.locale.create'
44
+ ]
45
+ }
46
+ }
47
+ ]
48
+ }
49
+ },
50
+ {
51
+ method: 'PUT',
52
+ path: '/locales/:id',
53
+ handler: 'locales.updateLocale',
54
+ config: {
55
+ policies: [
56
+ 'admin::isAuthenticatedAdmin',
57
+ {
58
+ name: 'plugin::content-manager.hasPermissions',
59
+ config: {
60
+ actions: [
61
+ 'plugin::i18n.locale.update'
62
+ ]
63
+ }
64
+ }
65
+ ]
66
+ }
67
+ },
68
+ {
69
+ method: 'DELETE',
70
+ path: '/locales/:id',
71
+ handler: 'locales.deleteLocale',
72
+ config: {
73
+ policies: [
74
+ 'admin::isAuthenticatedAdmin',
75
+ {
76
+ name: 'plugin::content-manager.hasPermissions',
77
+ config: {
78
+ actions: [
79
+ 'plugin::i18n.locale.delete'
80
+ ]
81
+ }
82
+ }
83
+ ]
84
+ }
85
+ },
86
+ {
87
+ method: 'POST',
88
+ path: '/content-manager/actions/get-non-localized-fields',
89
+ handler: 'content-types.getNonLocalizedAttributes',
90
+ config: {
91
+ policies: [
92
+ 'admin::isAuthenticatedAdmin'
93
+ ]
94
+ }
95
+ },
96
+ {
97
+ method: 'GET',
98
+ path: '/settings',
99
+ handler: 'settings.getSettings',
100
+ config: {
101
+ policies: [
102
+ 'admin::isAuthenticatedAdmin'
103
+ ]
104
+ }
105
+ },
106
+ {
107
+ method: 'PUT',
108
+ path: '/settings',
109
+ handler: 'settings.updateSettings',
110
+ config: {
111
+ policies: [
112
+ 'admin::isAuthenticatedAdmin'
113
+ ]
114
+ }
115
+ },
116
+ {
117
+ method: 'GET',
118
+ path: '/ai-localization-jobs/collection-types/:contentType/:documentId',
119
+ handler: 'ai-localization-jobs.getJobForCollectionType',
120
+ config: {
121
+ policies: [
122
+ 'admin::isAuthenticatedAdmin'
123
+ ]
124
+ }
125
+ },
126
+ {
127
+ method: 'GET',
128
+ path: '/ai-localization-jobs/single-types/:contentType',
129
+ handler: 'ai-localization-jobs.getJobForSingleType',
130
+ config: {
131
+ policies: [
132
+ 'admin::isAuthenticatedAdmin'
133
+ ]
134
+ }
135
+ }
136
+ ]
137
+ };
138
+
139
+ export { admin as default };
140
+ //# sourceMappingURL=admin.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin.mjs","sources":["../../../server/src/routes/admin.ts"],"sourcesContent":["export default {\n type: 'admin',\n routes: [\n {\n method: 'GET',\n path: '/iso-locales',\n handler: 'iso-locales.listIsoLocales',\n config: {\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'plugin::content-manager.hasPermissions',\n config: { actions: ['plugin::i18n.locale.read'] },\n },\n ],\n },\n },\n {\n method: 'GET',\n path: '/locales',\n handler: 'locales.listLocales',\n config: {\n policies: ['admin::isAuthenticatedAdmin'],\n },\n },\n {\n method: 'POST',\n path: '/locales',\n handler: 'locales.createLocale',\n config: {\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'plugin::content-manager.hasPermissions',\n config: { actions: ['plugin::i18n.locale.create'] },\n },\n ],\n },\n },\n {\n method: 'PUT',\n path: '/locales/:id',\n handler: 'locales.updateLocale',\n config: {\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'plugin::content-manager.hasPermissions',\n config: { actions: ['plugin::i18n.locale.update'] },\n },\n ],\n },\n },\n {\n method: 'DELETE',\n path: '/locales/:id',\n handler: 'locales.deleteLocale',\n config: {\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'plugin::content-manager.hasPermissions',\n config: { actions: ['plugin::i18n.locale.delete'] },\n },\n ],\n },\n },\n {\n method: 'POST',\n path: '/content-manager/actions/get-non-localized-fields',\n handler: 'content-types.getNonLocalizedAttributes',\n config: {\n policies: ['admin::isAuthenticatedAdmin'],\n },\n },\n {\n method: 'GET',\n path: '/settings',\n handler: 'settings.getSettings',\n config: {\n policies: ['admin::isAuthenticatedAdmin'],\n },\n },\n {\n method: 'PUT',\n path: '/settings',\n handler: 'settings.updateSettings',\n config: {\n policies: ['admin::isAuthenticatedAdmin'],\n },\n },\n {\n method: 'GET',\n path: '/ai-localization-jobs/collection-types/:contentType/:documentId',\n handler: 'ai-localization-jobs.getJobForCollectionType',\n config: {\n policies: ['admin::isAuthenticatedAdmin'],\n },\n },\n {\n method: 'GET',\n path: '/ai-localization-jobs/single-types/:contentType',\n handler: 'ai-localization-jobs.getJobForSingleType',\n config: {\n policies: ['admin::isAuthenticatedAdmin'],\n },\n },\n ],\n};\n"],"names":["type","routes","method","path","handler","config","policies","name","actions"],"mappings":"AAAA,YAAe;IACbA,IAAM,EAAA,OAAA;IACNC,MAAQ,EAAA;AACN,QAAA;YACEC,MAAQ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;AACF,SAAA;AACA,QAAA;YACEN,MAAQ,EAAA,MAAA;YACRC,IAAM,EAAA,mDAAA;YACNC,OAAS,EAAA,yCAAA;YACTC,MAAQ,EAAA;gBACNC,QAAU,EAAA;AAAC,oBAAA;AAA8B;AAC3C;AACF,SAAA;AACA,QAAA;YACEJ,MAAQ,EAAA,KAAA;YACRC,IAAM,EAAA,WAAA;YACNC,OAAS,EAAA,sBAAA;YACTC,MAAQ,EAAA;gBACNC,QAAU,EAAA;AAAC,oBAAA;AAA8B;AAC3C;AACF,SAAA;AACA,QAAA;YACEJ,MAAQ,EAAA,KAAA;YACRC,IAAM,EAAA,WAAA;YACNC,OAAS,EAAA,yBAAA;YACTC,MAAQ,EAAA;gBACNC,QAAU,EAAA;AAAC,oBAAA;AAA8B;AAC3C;AACF,SAAA;AACA,QAAA;YACEJ,MAAQ,EAAA,KAAA;YACRC,IAAM,EAAA,iEAAA;YACNC,OAAS,EAAA,8CAAA;YACTC,MAAQ,EAAA;gBACNC,QAAU,EAAA;AAAC,oBAAA;AAA8B;AAC3C;AACF,SAAA;AACA,QAAA;YACEJ,MAAQ,EAAA,KAAA;YACRC,IAAM,EAAA,iDAAA;YACNC,OAAS,EAAA,0CAAA;YACTC,MAAQ,EAAA;gBACNC,QAAU,EAAA;AAAC,oBAAA;AAA8B;AAC3C;AACF;AACD;AACH,CAAE;;;;"}
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+
3
+ var utils = require('@strapi/utils');
4
+ var locale = require('./validation/locale.js');
5
+
6
+ const createContentApiRoutes = utils.createContentApiRoutesFactory(()=>{
7
+ const validator = new locale.I18nLocaleRouteValidator(strapi);
8
+ return [
9
+ {
10
+ method: 'GET',
11
+ path: '/locales',
12
+ handler: 'locales.listLocales',
13
+ response: validator.locales
14
+ }
15
+ ];
16
+ });
17
+
18
+ module.exports = createContentApiRoutes;
19
+ //# sourceMappingURL=content-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-api.js","sources":["../../../server/src/routes/content-api.ts"],"sourcesContent":["import type { Core } from '@strapi/types';\nimport { createContentApiRoutesFactory } from '@strapi/utils';\nimport { I18nLocaleRouteValidator } from './validation';\n\nconst createContentApiRoutes = createContentApiRoutesFactory((): Core.RouterInput['routes'] => {\n const validator = new I18nLocaleRouteValidator(strapi);\n return [\n {\n method: 'GET',\n path: '/locales',\n handler: 'locales.listLocales',\n response: validator.locales,\n },\n ];\n});\n\nexport default createContentApiRoutes;\n"],"names":["createContentApiRoutes","createContentApiRoutesFactory","validator","I18nLocaleRouteValidator","strapi","method","path","handler","response","locales"],"mappings":";;;;;AAIA,MAAMA,yBAAyBC,mCAA8B,CAAA,IAAA;IAC3D,MAAMC,SAAAA,GAAY,IAAIC,+BAAyBC,CAAAA,MAAAA,CAAAA;IAC/C,OAAO;AACL,QAAA;YACEC,MAAQ,EAAA,KAAA;YACRC,IAAM,EAAA,UAAA;YACNC,OAAS,EAAA,qBAAA;AACTC,YAAAA,QAAAA,EAAUN,UAAUO;AACtB;AACD,KAAA;AACH,CAAA;;;;"}
@@ -0,0 +1,17 @@
1
+ import { createContentApiRoutesFactory } from '@strapi/utils';
2
+ import { I18nLocaleRouteValidator } from './validation/locale.mjs';
3
+
4
+ const createContentApiRoutes = createContentApiRoutesFactory(()=>{
5
+ const validator = new I18nLocaleRouteValidator(strapi);
6
+ return [
7
+ {
8
+ method: 'GET',
9
+ path: '/locales',
10
+ handler: 'locales.listLocales',
11
+ response: validator.locales
12
+ }
13
+ ];
14
+ });
15
+
16
+ export { createContentApiRoutes as default };
17
+ //# sourceMappingURL=content-api.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-api.mjs","sources":["../../../server/src/routes/content-api.ts"],"sourcesContent":["import type { Core } from '@strapi/types';\nimport { createContentApiRoutesFactory } from '@strapi/utils';\nimport { I18nLocaleRouteValidator } from './validation';\n\nconst createContentApiRoutes = createContentApiRoutesFactory((): Core.RouterInput['routes'] => {\n const validator = new I18nLocaleRouteValidator(strapi);\n return [\n {\n method: 'GET',\n path: '/locales',\n handler: 'locales.listLocales',\n response: validator.locales,\n },\n ];\n});\n\nexport default createContentApiRoutes;\n"],"names":["createContentApiRoutes","createContentApiRoutesFactory","validator","I18nLocaleRouteValidator","strapi","method","path","handler","response","locales"],"mappings":";;;AAIA,MAAMA,yBAAyBC,6BAA8B,CAAA,IAAA;IAC3D,MAAMC,SAAAA,GAAY,IAAIC,wBAAyBC,CAAAA,MAAAA,CAAAA;IAC/C,OAAO;AACL,QAAA;YACEC,MAAQ,EAAA,KAAA;YACRC,IAAM,EAAA,UAAA;YACNC,OAAS,EAAA,qBAAA;AACTC,YAAAA,QAAAA,EAAUN,UAAUO;AACtB;AACD,KAAA;AACH,CAAA;;;;"}
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+
3
+ var admin = require('./admin.js');
4
+ var contentApi = require('./content-api.js');
5
+
6
+ var routes = {
7
+ admin,
8
+ 'content-api': contentApi
9
+ };
10
+
11
+ module.exports = routes;
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../server/src/routes/index.ts"],"sourcesContent":["import admin from './admin';\nimport contentApi from './content-api';\n\nexport default {\n admin,\n 'content-api': contentApi,\n};\n"],"names":["admin","contentApi"],"mappings":";;;;;AAGA,aAAe;AACbA,IAAAA,KAAAA;IACA,aAAeC,EAAAA;AACjB,CAAE;;;;"}
@@ -0,0 +1,10 @@
1
+ import admin from './admin.mjs';
2
+ import createContentApiRoutes from './content-api.mjs';
3
+
4
+ var routes = {
5
+ admin,
6
+ 'content-api': createContentApiRoutes
7
+ };
8
+
9
+ export { routes as default };
10
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":["../../../server/src/routes/index.ts"],"sourcesContent":["import admin from './admin';\nimport contentApi from './content-api';\n\nexport default {\n admin,\n 'content-api': contentApi,\n};\n"],"names":["admin","contentApi"],"mappings":";;;AAGA,aAAe;AACbA,IAAAA,KAAAA;IACA,aAAeC,EAAAA;AACjB,CAAE;;;;"}
@@ -0,0 +1,57 @@
1
+ 'use strict';
2
+
3
+ var z = require('zod/v4');
4
+
5
+ function _interopNamespaceDefault(e) {
6
+ var n = Object.create(null);
7
+ if (e) {
8
+ Object.keys(e).forEach(function (k) {
9
+ if (k !== 'default') {
10
+ var d = Object.getOwnPropertyDescriptor(e, k);
11
+ Object.defineProperty(n, k, d.get ? d : {
12
+ enumerable: true,
13
+ get: function () { return e[k]; }
14
+ });
15
+ }
16
+ });
17
+ }
18
+ n.default = e;
19
+ return Object.freeze(n);
20
+ }
21
+
22
+ var z__namespace = /*#__PURE__*/_interopNamespaceDefault(z);
23
+
24
+ /**
25
+ * A validator for i18n locale routes.
26
+ *
27
+ */ class I18nLocaleRouteValidator {
28
+ /**
29
+ * Generates a validation schema for a single locale.
30
+ *
31
+ * @returns A schema for validating locale objects
32
+ */ get locale() {
33
+ return z__namespace.object({
34
+ id: z__namespace.number().int().positive(),
35
+ documentId: z__namespace.string().uuid(),
36
+ name: z__namespace.string(),
37
+ code: z__namespace.string().length(2, 'Locale code must be exactly 2 characters'),
38
+ createdAt: z__namespace.string(),
39
+ updatedAt: z__namespace.string(),
40
+ publishedAt: z__namespace.string().nullable(),
41
+ isDefault: z__namespace.boolean()
42
+ });
43
+ }
44
+ /**
45
+ * Generates a validation schema for an array of locales
46
+ *
47
+ * @returns A schema for validating arrays of locales
48
+ */ get locales() {
49
+ return z__namespace.array(this.locale);
50
+ }
51
+ constructor(strapi){
52
+ this._strapi = strapi;
53
+ }
54
+ }
55
+
56
+ exports.I18nLocaleRouteValidator = I18nLocaleRouteValidator;
57
+ //# sourceMappingURL=locale.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locale.js","sources":["../../../../server/src/routes/validation/locale.ts"],"sourcesContent":["import type { Core } from '@strapi/types';\nimport * as z from 'zod/v4';\n\n/**\n * A validator for i18n locale routes.\n *\n */\nexport class I18nLocaleRouteValidator {\n protected readonly _strapi: Core.Strapi;\n\n public constructor(strapi: Core.Strapi) {\n this._strapi = strapi;\n }\n\n /**\n * Generates a validation schema for a single locale.\n *\n * @returns A schema for validating locale objects\n */\n get locale() {\n return z.object({\n id: z.number().int().positive(),\n documentId: z.string().uuid(),\n name: z.string(),\n code: z.string().length(2, 'Locale code must be exactly 2 characters'),\n createdAt: z.string(),\n updatedAt: z.string(),\n publishedAt: z.string().nullable(),\n isDefault: z.boolean(),\n });\n }\n\n /**\n * Generates a validation schema for an array of locales\n *\n * @returns A schema for validating arrays of locales\n */\n get locales() {\n return z.array(this.locale);\n }\n}\n"],"names":["I18nLocaleRouteValidator","locale","z","object","id","number","int","positive","documentId","string","uuid","name","code","length","createdAt","updatedAt","publishedAt","nullable","isDefault","boolean","locales","array","strapi","_strapi"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAGA;;;AAGC,IACM,MAAMA,wBAAAA,CAAAA;AAOX;;;;AAIC,MACD,IAAIC,MAAS,GAAA;QACX,OAAOC,YAAAA,CAAEC,MAAM,CAAC;AACdC,YAAAA,EAAAA,EAAIF,YAAEG,CAAAA,MAAM,EAAGC,CAAAA,GAAG,GAAGC,QAAQ,EAAA;YAC7BC,UAAYN,EAAAA,YAAAA,CAAEO,MAAM,EAAA,CAAGC,IAAI,EAAA;AAC3BC,YAAAA,IAAAA,EAAMT,aAAEO,MAAM,EAAA;AACdG,YAAAA,IAAAA,EAAMV,YAAEO,CAAAA,MAAM,EAAGI,CAAAA,MAAM,CAAC,CAAG,EAAA,0CAAA,CAAA;AAC3BC,YAAAA,SAAAA,EAAWZ,aAAEO,MAAM,EAAA;AACnBM,YAAAA,SAAAA,EAAWb,aAAEO,MAAM,EAAA;YACnBO,WAAad,EAAAA,YAAAA,CAAEO,MAAM,EAAA,CAAGQ,QAAQ,EAAA;AAChCC,YAAAA,SAAAA,EAAWhB,aAAEiB,OAAO;AACtB,SAAA,CAAA;AACF;AAEA;;;;AAIC,MACD,IAAIC,OAAU,GAAA;AACZ,QAAA,OAAOlB,YAAEmB,CAAAA,KAAK,CAAC,IAAI,CAACpB,MAAM,CAAA;AAC5B;AA7BA,IAAA,WAAA,CAAmBqB,MAAmB,CAAE;QACtC,IAAI,CAACC,OAAO,GAAGD,MAAAA;AACjB;AA4BF;;;;"}
@@ -0,0 +1,36 @@
1
+ import * as z from 'zod/v4';
2
+
3
+ /**
4
+ * A validator for i18n locale routes.
5
+ *
6
+ */ class I18nLocaleRouteValidator {
7
+ /**
8
+ * Generates a validation schema for a single locale.
9
+ *
10
+ * @returns A schema for validating locale objects
11
+ */ get locale() {
12
+ return z.object({
13
+ id: z.number().int().positive(),
14
+ documentId: z.string().uuid(),
15
+ name: z.string(),
16
+ code: z.string().length(2, 'Locale code must be exactly 2 characters'),
17
+ createdAt: z.string(),
18
+ updatedAt: z.string(),
19
+ publishedAt: z.string().nullable(),
20
+ isDefault: z.boolean()
21
+ });
22
+ }
23
+ /**
24
+ * Generates a validation schema for an array of locales
25
+ *
26
+ * @returns A schema for validating arrays of locales
27
+ */ get locales() {
28
+ return z.array(this.locale);
29
+ }
30
+ constructor(strapi){
31
+ this._strapi = strapi;
32
+ }
33
+ }
34
+
35
+ export { I18nLocaleRouteValidator };
36
+ //# sourceMappingURL=locale.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locale.mjs","sources":["../../../../server/src/routes/validation/locale.ts"],"sourcesContent":["import type { Core } from '@strapi/types';\nimport * as z from 'zod/v4';\n\n/**\n * A validator for i18n locale routes.\n *\n */\nexport class I18nLocaleRouteValidator {\n protected readonly _strapi: Core.Strapi;\n\n public constructor(strapi: Core.Strapi) {\n this._strapi = strapi;\n }\n\n /**\n * Generates a validation schema for a single locale.\n *\n * @returns A schema for validating locale objects\n */\n get locale() {\n return z.object({\n id: z.number().int().positive(),\n documentId: z.string().uuid(),\n name: z.string(),\n code: z.string().length(2, 'Locale code must be exactly 2 characters'),\n createdAt: z.string(),\n updatedAt: z.string(),\n publishedAt: z.string().nullable(),\n isDefault: z.boolean(),\n });\n }\n\n /**\n * Generates a validation schema for an array of locales\n *\n * @returns A schema for validating arrays of locales\n */\n get locales() {\n return z.array(this.locale);\n }\n}\n"],"names":["I18nLocaleRouteValidator","locale","z","object","id","number","int","positive","documentId","string","uuid","name","code","length","createdAt","updatedAt","publishedAt","nullable","isDefault","boolean","locales","array","strapi","_strapi"],"mappings":";;AAGA;;;AAGC,IACM,MAAMA,wBAAAA,CAAAA;AAOX;;;;AAIC,MACD,IAAIC,MAAS,GAAA;QACX,OAAOC,CAAAA,CAAEC,MAAM,CAAC;AACdC,YAAAA,EAAAA,EAAIF,CAAEG,CAAAA,MAAM,EAAGC,CAAAA,GAAG,GAAGC,QAAQ,EAAA;YAC7BC,UAAYN,EAAAA,CAAAA,CAAEO,MAAM,EAAA,CAAGC,IAAI,EAAA;AAC3BC,YAAAA,IAAAA,EAAMT,EAAEO,MAAM,EAAA;AACdG,YAAAA,IAAAA,EAAMV,CAAEO,CAAAA,MAAM,EAAGI,CAAAA,MAAM,CAAC,CAAG,EAAA,0CAAA,CAAA;AAC3BC,YAAAA,SAAAA,EAAWZ,EAAEO,MAAM,EAAA;AACnBM,YAAAA,SAAAA,EAAWb,EAAEO,MAAM,EAAA;YACnBO,WAAad,EAAAA,CAAAA,CAAEO,MAAM,EAAA,CAAGQ,QAAQ,EAAA;AAChCC,YAAAA,SAAAA,EAAWhB,EAAEiB,OAAO;AACtB,SAAA,CAAA;AACF;AAEA;;;;AAIC,MACD,IAAIC,OAAU,GAAA;AACZ,QAAA,OAAOlB,CAAEmB,CAAAA,KAAK,CAAC,IAAI,CAACpB,MAAM,CAAA;AAC5B;AA7BA,IAAA,WAAA,CAAmBqB,MAAmB,CAAE;QACtC,IAAI,CAACC,OAAO,GAAGD,MAAAA;AACjB;AA4BF;;;;"}
@@ -0,0 +1,64 @@
1
+ 'use strict';
2
+
3
+ var aiLocalizationJob = require('../models/ai-localization-job.js');
4
+
5
+ const createAILocalizationJobsService = ({ strapi })=>({
6
+ /**
7
+ * Create a new AI localizations job or update an existing one for a document
8
+ * Ensures only one job exists per document
9
+ */ async upsertJobForDocument ({ documentId, contentType, sourceLocale, targetLocales, status = 'processing' }) {
10
+ // Check if job already exists for this document
11
+ const existingJob = await this.getJobByDocument(contentType, documentId);
12
+ if (existingJob) {
13
+ strapi.log.info(`[AI Localizations Job] Updated existing job for document ${documentId} with status: ${status}`);
14
+ // Update existing job with new data and status
15
+ return strapi.db.query(aiLocalizationJob.AI_LOCALIZATION_JOB_UID).update({
16
+ where: {
17
+ id: existingJob.id
18
+ },
19
+ data: {
20
+ contentType,
21
+ sourceLocale,
22
+ targetLocales,
23
+ status,
24
+ updatedAt: new Date()
25
+ }
26
+ });
27
+ }
28
+ strapi.log.info(`[AI Localizations Job] Created new job for document ${documentId} with status: ${status}`);
29
+ // Create new AI localizations job
30
+ return strapi.db.query(aiLocalizationJob.AI_LOCALIZATION_JOB_UID).create({
31
+ data: {
32
+ contentType,
33
+ relatedDocumentId: documentId,
34
+ sourceLocale,
35
+ targetLocales,
36
+ status,
37
+ createdAt: new Date(),
38
+ updatedAt: new Date()
39
+ }
40
+ });
41
+ },
42
+ /**
43
+ * Get job by document ID
44
+ */ async getJobByDocument (contentType, documentId) {
45
+ return strapi.db.query(aiLocalizationJob.AI_LOCALIZATION_JOB_UID).findOne({
46
+ where: {
47
+ relatedDocumentId: documentId,
48
+ contentType
49
+ }
50
+ });
51
+ },
52
+ /**
53
+ * Get job by content type
54
+ */ async getJobByContentType (contentType) {
55
+ return strapi.db.query(aiLocalizationJob.AI_LOCALIZATION_JOB_UID).findOne({
56
+ where: {
57
+ contentType
58
+ }
59
+ });
60
+ }
61
+ });
62
+
63
+ exports.createAILocalizationJobsService = createAILocalizationJobsService;
64
+ //# sourceMappingURL=ai-localization-jobs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-localization-jobs.js","sources":["../../../server/src/services/ai-localization-jobs.ts"],"sourcesContent":["import type { Core } from '@strapi/types';\nimport { AI_LOCALIZATION_JOB_UID } from '../models/ai-localization-job';\nimport type { AILocalizationJobs } from '../../../shared/contracts/ai-localization-jobs';\n\nexport const createAILocalizationJobsService = ({ strapi }: { strapi: Core.Strapi }) => ({\n /**\n * Create a new AI localizations job or update an existing one for a document\n * Ensures only one job exists per document\n */\n async upsertJobForDocument({\n documentId,\n contentType,\n sourceLocale,\n targetLocales,\n status = 'processing',\n }: {\n documentId: string;\n contentType: string;\n sourceLocale: string;\n targetLocales: string[];\n status?: AILocalizationJobs['status'];\n }) {\n // Check if job already exists for this document\n const existingJob = await this.getJobByDocument(contentType, documentId);\n\n if (existingJob) {\n strapi.log.info(\n `[AI Localizations Job] Updated existing job for document ${documentId} with status: ${status}`\n );\n // Update existing job with new data and status\n return strapi.db.query(AI_LOCALIZATION_JOB_UID).update({\n where: { id: existingJob.id },\n data: {\n contentType,\n sourceLocale,\n targetLocales,\n status,\n updatedAt: new Date(),\n },\n });\n }\n\n strapi.log.info(\n `[AI Localizations Job] Created new job for document ${documentId} with status: ${status}`\n );\n // Create new AI localizations job\n return strapi.db.query(AI_LOCALIZATION_JOB_UID).create({\n data: {\n contentType,\n relatedDocumentId: documentId,\n sourceLocale,\n targetLocales,\n status,\n createdAt: new Date(),\n updatedAt: new Date(),\n },\n });\n },\n\n /**\n * Get job by document ID\n */\n async getJobByDocument(contentType: string, documentId: string) {\n return strapi.db.query(AI_LOCALIZATION_JOB_UID).findOne({\n where: {\n relatedDocumentId: documentId,\n contentType,\n },\n });\n },\n\n /**\n * Get job by content type\n */\n async getJobByContentType(contentType: string) {\n return strapi.db.query(AI_LOCALIZATION_JOB_UID).findOne({\n where: {\n contentType,\n },\n });\n },\n});\n"],"names":["createAILocalizationJobsService","strapi","upsertJobForDocument","documentId","contentType","sourceLocale","targetLocales","status","existingJob","getJobByDocument","log","info","db","query","AI_LOCALIZATION_JOB_UID","update","where","id","data","updatedAt","Date","create","relatedDocumentId","createdAt","findOne","getJobByContentType"],"mappings":";;;;MAI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SAAA;AAEA;;AAEC,MACD,MAAMX,gBAAAA,CAAAA,CAAiBL,WAAmB,EAAED,UAAkB,EAAA;AAC5D,YAAA,OAAOF,OAAOW,EAAE,CAACC,KAAK,CAACC,yCAAAA,CAAAA,CAAyBU,OAAO,CAAC;gBACtDR,KAAO,EAAA;oBACLM,iBAAmBnB,EAAAA,UAAAA;AACnBC,oBAAAA;AACF;AACF,aAAA,CAAA;AACF,SAAA;AAEA;;MAGA,MAAMqB,qBAAoBrB,WAAmB,EAAA;AAC3C,YAAA,OAAOH,OAAOW,EAAE,CAACC,KAAK,CAACC,yCAAAA,CAAAA,CAAyBU,OAAO,CAAC;gBACtDR,KAAO,EAAA;AACLZ,oBAAAA;AACF;AACF,aAAA,CAAA;AACF;AACF,KAAA;;;;"}
@@ -0,0 +1,62 @@
1
+ import { AI_LOCALIZATION_JOB_UID } from '../models/ai-localization-job.mjs';
2
+
3
+ const createAILocalizationJobsService = ({ strapi })=>({
4
+ /**
5
+ * Create a new AI localizations job or update an existing one for a document
6
+ * Ensures only one job exists per document
7
+ */ async upsertJobForDocument ({ documentId, contentType, sourceLocale, targetLocales, status = 'processing' }) {
8
+ // Check if job already exists for this document
9
+ const existingJob = await this.getJobByDocument(contentType, documentId);
10
+ if (existingJob) {
11
+ strapi.log.info(`[AI Localizations Job] Updated existing job for document ${documentId} with status: ${status}`);
12
+ // Update existing job with new data and status
13
+ return strapi.db.query(AI_LOCALIZATION_JOB_UID).update({
14
+ where: {
15
+ id: existingJob.id
16
+ },
17
+ data: {
18
+ contentType,
19
+ sourceLocale,
20
+ targetLocales,
21
+ status,
22
+ updatedAt: new Date()
23
+ }
24
+ });
25
+ }
26
+ strapi.log.info(`[AI Localizations Job] Created new job for document ${documentId} with status: ${status}`);
27
+ // Create new AI localizations job
28
+ return strapi.db.query(AI_LOCALIZATION_JOB_UID).create({
29
+ data: {
30
+ contentType,
31
+ relatedDocumentId: documentId,
32
+ sourceLocale,
33
+ targetLocales,
34
+ status,
35
+ createdAt: new Date(),
36
+ updatedAt: new Date()
37
+ }
38
+ });
39
+ },
40
+ /**
41
+ * Get job by document ID
42
+ */ async getJobByDocument (contentType, documentId) {
43
+ return strapi.db.query(AI_LOCALIZATION_JOB_UID).findOne({
44
+ where: {
45
+ relatedDocumentId: documentId,
46
+ contentType
47
+ }
48
+ });
49
+ },
50
+ /**
51
+ * Get job by content type
52
+ */ async getJobByContentType (contentType) {
53
+ return strapi.db.query(AI_LOCALIZATION_JOB_UID).findOne({
54
+ where: {
55
+ contentType
56
+ }
57
+ });
58
+ }
59
+ });
60
+
61
+ export { createAILocalizationJobsService };
62
+ //# sourceMappingURL=ai-localization-jobs.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-localization-jobs.mjs","sources":["../../../server/src/services/ai-localization-jobs.ts"],"sourcesContent":["import type { Core } from '@strapi/types';\nimport { AI_LOCALIZATION_JOB_UID } from '../models/ai-localization-job';\nimport type { AILocalizationJobs } from '../../../shared/contracts/ai-localization-jobs';\n\nexport const createAILocalizationJobsService = ({ strapi }: { strapi: Core.Strapi }) => ({\n /**\n * Create a new AI localizations job or update an existing one for a document\n * Ensures only one job exists per document\n */\n async upsertJobForDocument({\n documentId,\n contentType,\n sourceLocale,\n targetLocales,\n status = 'processing',\n }: {\n documentId: string;\n contentType: string;\n sourceLocale: string;\n targetLocales: string[];\n status?: AILocalizationJobs['status'];\n }) {\n // Check if job already exists for this document\n const existingJob = await this.getJobByDocument(contentType, documentId);\n\n if (existingJob) {\n strapi.log.info(\n `[AI Localizations Job] Updated existing job for document ${documentId} with status: ${status}`\n );\n // Update existing job with new data and status\n return strapi.db.query(AI_LOCALIZATION_JOB_UID).update({\n where: { id: existingJob.id },\n data: {\n contentType,\n sourceLocale,\n targetLocales,\n status,\n updatedAt: new Date(),\n },\n });\n }\n\n strapi.log.info(\n `[AI Localizations Job] Created new job for document ${documentId} with status: ${status}`\n );\n // Create new AI localizations job\n return strapi.db.query(AI_LOCALIZATION_JOB_UID).create({\n data: {\n contentType,\n relatedDocumentId: documentId,\n sourceLocale,\n targetLocales,\n status,\n createdAt: new Date(),\n updatedAt: new Date(),\n },\n });\n },\n\n /**\n * Get job by document ID\n */\n async getJobByDocument(contentType: string, documentId: string) {\n return strapi.db.query(AI_LOCALIZATION_JOB_UID).findOne({\n where: {\n relatedDocumentId: documentId,\n contentType,\n },\n });\n },\n\n /**\n * Get job by content type\n */\n async getJobByContentType(contentType: string) {\n return strapi.db.query(AI_LOCALIZATION_JOB_UID).findOne({\n where: {\n contentType,\n },\n });\n },\n});\n"],"names":["createAILocalizationJobsService","strapi","upsertJobForDocument","documentId","contentType","sourceLocale","targetLocales","status","existingJob","getJobByDocument","log","info","db","query","AI_LOCALIZATION_JOB_UID","update","where","id","data","updatedAt","Date","create","relatedDocumentId","createdAt","findOne","getJobByContentType"],"mappings":";;MAIaA,+BAAkC,GAAA,CAAC,EAAEC,MAAM,EAA2B,IAAM;AACvF;;;AAGC,MACD,MAAMC,oBAAAA,CAAAA,CAAqB,EACzBC,UAAU,EACVC,WAAW,EACXC,YAAY,EACZC,aAAa,EACbC,MAAAA,GAAS,YAAY,EAOtB,EAAA;;AAEC,YAAA,MAAMC,cAAc,MAAM,IAAI,CAACC,gBAAgB,CAACL,WAAaD,EAAAA,UAAAA,CAAAA;AAE7D,YAAA,IAAIK,WAAa,EAAA;gBACfP,MAAOS,CAAAA,GAAG,CAACC,IAAI,CACb,CAAC,yDAAyD,EAAER,UAAAA,CAAW,cAAc,EAAEI,MAAQ,CAAA,CAAA,CAAA;;AAGjG,gBAAA,OAAON,OAAOW,EAAE,CAACC,KAAK,CAACC,uBAAAA,CAAAA,CAAyBC,MAAM,CAAC;oBACrDC,KAAO,EAAA;AAAEC,wBAAAA,EAAAA,EAAIT,YAAYS;AAAG,qBAAA;oBAC5BC,IAAM,EAAA;AACJd,wBAAAA,WAAAA;AACAC,wBAAAA,YAAAA;AACAC,wBAAAA,aAAAA;AACAC,wBAAAA,MAAAA;AACAY,wBAA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