@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 @@
1
+ {"version":3,"file":"iso-locales.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ var index = require('./locale/index.js');
4
+
5
+ var contentTypes = {
6
+ locale: index
7
+ };
8
+
9
+ module.exports = contentTypes;
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../server/src/content-types/index.ts"],"sourcesContent":["import locale from './locale';\n\nexport default {\n locale,\n};\n"],"names":["locale"],"mappings":";;;;AAEA,mBAAe;AACbA,YAAAA;AACF,CAAE;;;;"}
@@ -0,0 +1,8 @@
1
+ import locale from './locale/index.mjs';
2
+
3
+ var contentTypes = {
4
+ locale
5
+ };
6
+
7
+ export { contentTypes as default };
8
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":["../../../server/src/content-types/index.ts"],"sourcesContent":["import locale from './locale';\n\nexport default {\n locale,\n};\n"],"names":["locale"],"mappings":";;AAEA,mBAAe;AACbA,IAAAA;AACF,CAAE;;;;"}
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ var schema = require('./schema.json.js');
4
+
5
+ var locale = {
6
+ schema: schema.default
7
+ };
8
+
9
+ module.exports = locale;
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../server/src/content-types/locale/index.ts"],"sourcesContent":["import schema from './schema.json';\n\nexport default {\n schema,\n};\n"],"names":["schema"],"mappings":";;;;AAEA,aAAe;AACbA,YAAAA;AACF,CAAE;;;;"}
@@ -0,0 +1,8 @@
1
+ import schema from './schema.json.mjs';
2
+
3
+ var locale = {
4
+ schema
5
+ };
6
+
7
+ export { locale as default };
8
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":["../../../../server/src/content-types/locale/index.ts"],"sourcesContent":["import schema from './schema.json';\n\nexport default {\n schema,\n};\n"],"names":["schema"],"mappings":";;AAEA,aAAe;AACbA,IAAAA;AACF,CAAE;;;;"}
@@ -0,0 +1,46 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var info = {
6
+ singularName: "locale",
7
+ pluralName: "locales",
8
+ collectionName: "locales",
9
+ displayName: "Locale",
10
+ description: ""
11
+ };
12
+ var options = {};
13
+ var pluginOptions = {
14
+ "content-manager": {
15
+ visible: false
16
+ },
17
+ "content-type-builder": {
18
+ visible: false
19
+ }
20
+ };
21
+ var attributes = {
22
+ name: {
23
+ type: "string",
24
+ min: 1,
25
+ max: 50,
26
+ configurable: false
27
+ },
28
+ code: {
29
+ type: "string",
30
+ unique: true,
31
+ configurable: false
32
+ }
33
+ };
34
+ var schema = {
35
+ info: info,
36
+ options: options,
37
+ pluginOptions: pluginOptions,
38
+ attributes: attributes
39
+ };
40
+
41
+ exports.attributes = attributes;
42
+ exports.default = schema;
43
+ exports.info = info;
44
+ exports.options = options;
45
+ exports.pluginOptions = pluginOptions;
46
+ //# sourceMappingURL=schema.json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,38 @@
1
+ var info = {
2
+ singularName: "locale",
3
+ pluralName: "locales",
4
+ collectionName: "locales",
5
+ displayName: "Locale",
6
+ description: ""
7
+ };
8
+ var options = {};
9
+ var pluginOptions = {
10
+ "content-manager": {
11
+ visible: false
12
+ },
13
+ "content-type-builder": {
14
+ visible: false
15
+ }
16
+ };
17
+ var attributes = {
18
+ name: {
19
+ type: "string",
20
+ min: 1,
21
+ max: 50,
22
+ configurable: false
23
+ },
24
+ code: {
25
+ type: "string",
26
+ unique: true,
27
+ configurable: false
28
+ }
29
+ };
30
+ var schema = {
31
+ info: info,
32
+ options: options,
33
+ pluginOptions: pluginOptions,
34
+ attributes: attributes
35
+ };
36
+
37
+ export { attributes, schema as default, info, options, pluginOptions };
38
+ //# sourceMappingURL=schema.json.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -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,sBAA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@@
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;;;;"}
@@ -0,0 +1,76 @@
1
+ 'use strict';
2
+
3
+ var fp = require('lodash/fp');
4
+ var utils = require('@strapi/utils');
5
+ var index = require('../utils/index.js');
6
+ var contentTypes = require('../validation/content-types.js');
7
+
8
+ const { ApplicationError } = utils.errors;
9
+ const { PUBLISHED_AT_ATTRIBUTE } = utils.contentTypes.constants;
10
+ const getLocalesProperty = fp.getOr([], 'properties.locales');
11
+ const getFieldsProperty = fp.prop('properties.fields');
12
+ const getFirstLevelPath = fp.map((path)=>path.split('.')[0]);
13
+ const controller = {
14
+ async getNonLocalizedAttributes (ctx) {
15
+ const { user } = ctx.state;
16
+ const body = ctx.request.body;
17
+ const { model, id, locale } = body;
18
+ await contentTypes.validateGetNonLocalizedAttributesInput({
19
+ model,
20
+ id,
21
+ locale
22
+ });
23
+ const { copyNonLocalizedAttributes, isLocalizedContentType, getNestedPopulateOfNonLocalizedAttributes } = index.getService('content-types');
24
+ const { default: { READ_ACTION, CREATE_ACTION } } = strapi.service('admin::constants');
25
+ const modelDef = strapi.contentType(model);
26
+ const attributesToPopulate = getNestedPopulateOfNonLocalizedAttributes(model);
27
+ if (!isLocalizedContentType(modelDef)) {
28
+ throw new ApplicationError(`Model ${model} is not localized`);
29
+ }
30
+ const params = modelDef.kind === 'singleType' ? {} : {
31
+ id
32
+ };
33
+ const entity = await strapi.db.query(model).findOne({
34
+ where: params,
35
+ populate: attributesToPopulate
36
+ });
37
+ if (!entity) {
38
+ return ctx.notFound();
39
+ }
40
+ const permissions = await strapi.admin.services.permission.findMany({
41
+ where: {
42
+ action: [
43
+ READ_ACTION,
44
+ CREATE_ACTION
45
+ ],
46
+ subject: model,
47
+ role: {
48
+ id: user.roles.map(fp.prop('id'))
49
+ }
50
+ }
51
+ });
52
+ const localePermissions = permissions.filter((perm)=>getLocalesProperty(perm).includes(locale)).map(getFieldsProperty);
53
+ const permittedFields = fp.pipe(fp.flatten, getFirstLevelPath, fp.uniq)(localePermissions);
54
+ const nonLocalizedFields = copyNonLocalizedAttributes(modelDef, entity);
55
+ const sanitizedNonLocalizedFields = fp.pick(permittedFields, nonLocalizedFields);
56
+ const availableLocalesResult = await strapi.plugins['content-manager'].service('document-metadata').getMetadata(model, entity, {
57
+ availableLocales: true
58
+ });
59
+ const availableLocales = availableLocalesResult.availableLocales.map((localeResult)=>fp.pick([
60
+ 'id',
61
+ 'locale',
62
+ PUBLISHED_AT_ATTRIBUTE
63
+ ], localeResult));
64
+ ctx.body = {
65
+ nonLocalizedFields: sanitizedNonLocalizedFields,
66
+ localizations: availableLocales.concat(fp.pick([
67
+ 'id',
68
+ 'locale',
69
+ PUBLISHED_AT_ATTRIBUTE
70
+ ], entity))
71
+ };
72
+ }
73
+ };
74
+
75
+ module.exports = controller;
76
+ //# sourceMappingURL=content-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-types.js","sources":["../../../server/src/controllers/content-types.ts"],"sourcesContent":["import { pick, uniq, prop, getOr, flatten, pipe, map } from 'lodash/fp';\nimport { contentTypes as contentTypesUtils, errors } from '@strapi/utils';\nimport type { Core } from '@strapi/types';\nimport { getService } from '../utils';\nimport { validateGetNonLocalizedAttributesInput } from '../validation/content-types';\n\nconst { ApplicationError } = errors;\n\nconst { PUBLISHED_AT_ATTRIBUTE } = contentTypesUtils.constants;\n\nconst getLocalesProperty = getOr<string[]>([], 'properties.locales');\nconst getFieldsProperty = prop('properties.fields');\n\nconst getFirstLevelPath = map((path: string) => path.split('.')[0]);\n\nconst controller = {\n async getNonLocalizedAttributes(ctx) {\n const { user } = ctx.state;\n const body = ctx.request.body as any;\n const { model, id, locale } = body;\n\n await validateGetNonLocalizedAttributesInput({ model, id, locale });\n\n const {\n copyNonLocalizedAttributes,\n isLocalizedContentType,\n getNestedPopulateOfNonLocalizedAttributes,\n } = getService('content-types');\n\n const {\n default: { READ_ACTION, CREATE_ACTION },\n } = strapi.service('admin::constants');\n\n const modelDef = strapi.contentType(model);\n const attributesToPopulate = getNestedPopulateOfNonLocalizedAttributes(model);\n\n if (!isLocalizedContentType(modelDef)) {\n throw new ApplicationError(`Model ${model} is not localized`);\n }\n\n const params = modelDef.kind === 'singleType' ? {} : { id };\n\n const entity = await strapi.db\n .query(model)\n .findOne({ where: params, populate: attributesToPopulate });\n\n if (!entity) {\n return ctx.notFound();\n }\n\n const permissions = await strapi.admin.services.permission.findMany({\n where: {\n action: [READ_ACTION, CREATE_ACTION],\n subject: model,\n role: {\n id: user.roles.map(prop('id')),\n },\n },\n });\n\n const localePermissions = permissions\n .filter((perm: any) => getLocalesProperty(perm).includes(locale))\n .map(getFieldsProperty);\n\n const permittedFields = pipe(flatten, getFirstLevelPath, uniq)(localePermissions);\n\n const nonLocalizedFields = copyNonLocalizedAttributes(modelDef, entity);\n const sanitizedNonLocalizedFields = pick(permittedFields, nonLocalizedFields);\n\n const availableLocalesResult = await strapi.plugins['content-manager']\n .service('document-metadata')\n .getMetadata(model, entity, {\n availableLocales: true,\n });\n\n const availableLocales = availableLocalesResult.availableLocales.map((localeResult: any) =>\n pick(['id', 'locale', PUBLISHED_AT_ATTRIBUTE], localeResult)\n );\n\n ctx.body = {\n nonLocalizedFields: sanitizedNonLocalizedFields,\n localizations: availableLocales.concat(\n pick(['id', 'locale', PUBLISHED_AT_ATTRIBUTE], entity)\n ),\n };\n },\n} satisfies Core.Controller;\n\nexport default controller;\n"],"names":["ApplicationError","errors","PUBLISHED_AT_ATTRIBUTE","contentTypesUtils","constants","getLocalesProperty","getOr","getFieldsProperty","prop","getFirstLevelPath","map","path","split","controller","getNonLocalizedAttributes","ctx","user","state","body","request","model","id","locale","validateGetNonLocalizedAttributesInput","copyNonLocalizedAttributes","isLocalizedContentType","getNestedPopulateOfNonLocalizedAttributes","getService","default","READ_ACTION","CREATE_ACTION","strapi","service","modelDef","contentType","attributesToPopulate","params","kind","entity","db","query","findOne","where","populate","notFound","permissions","admin","services","permission","findMany","action","subject","role","roles","localePermissions","filter","perm","includes","permittedFields","pipe","flatten","uniq","nonLocalizedFields","sanitizedNonLocalizedFields","pick","availableLocalesResult","plugins","getMetadata","availableLocales","localeResult","localizations","concat"],"mappings":";;;;;;;AAMA,MAAM,EAAEA,gBAAgB,EAAE,GAAGC,YAAAA;AAE7B,MAAM,EAAEC,sBAAsB,EAAE,GAAGC,mBAAkBC,SAAS;AAE9D,MAAMC,kBAAAA,GAAqBC,QAAgB,CAAA,EAAE,EAAE,oBAAA,CAAA;AAC/C,MAAMC,oBAAoBC,OAAK,CAAA,mBAAA,CAAA;AAE/B,MAAMC,iBAAAA,GAAoBC,OAAI,CAACC,IAAAA,GAAi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AAA,QAAA;AAAU9D,gBAAAA;aAAuB,EAAEmE,YAAAA,CAAAA,CAAAA;AAGjDtD,QAAAA,GAAAA,CAAIG,IAAI,GAAG;YACT4C,kBAAoBC,EAAAA,2BAAAA;YACpBO,aAAeF,EAAAA,gBAAAA,CAAiBG,MAAM,CACpCP,OAAK,CAAA;AAAC,gBAAA,IAAA;AAAM,gBAAA,QAAA;AAAU9D,gBAAAA;aAAuB,EAAEoC,MAAAA,CAAAA;AAEnD,SAAA;AACF;AACF;;;;"}
@@ -0,0 +1,74 @@
1
+ import { getOr, prop, map, pipe, flatten, uniq, pick } from 'lodash/fp';
2
+ import { contentTypes, errors } from '@strapi/utils';
3
+ import { getService } from '../utils/index.mjs';
4
+ import { validateGetNonLocalizedAttributesInput } from '../validation/content-types.mjs';
5
+
6
+ const { ApplicationError } = errors;
7
+ const { PUBLISHED_AT_ATTRIBUTE } = contentTypes.constants;
8
+ const getLocalesProperty = getOr([], 'properties.locales');
9
+ const getFieldsProperty = prop('properties.fields');
10
+ const getFirstLevelPath = map((path)=>path.split('.')[0]);
11
+ const controller = {
12
+ async getNonLocalizedAttributes (ctx) {
13
+ const { user } = ctx.state;
14
+ const body = ctx.request.body;
15
+ const { model, id, locale } = body;
16
+ await validateGetNonLocalizedAttributesInput({
17
+ model,
18
+ id,
19
+ locale
20
+ });
21
+ const { copyNonLocalizedAttributes, isLocalizedContentType, getNestedPopulateOfNonLocalizedAttributes } = getService('content-types');
22
+ const { default: { READ_ACTION, CREATE_ACTION } } = strapi.service('admin::constants');
23
+ const modelDef = strapi.contentType(model);
24
+ const attributesToPopulate = getNestedPopulateOfNonLocalizedAttributes(model);
25
+ if (!isLocalizedContentType(modelDef)) {
26
+ throw new ApplicationError(`Model ${model} is not localized`);
27
+ }
28
+ const params = modelDef.kind === 'singleType' ? {} : {
29
+ id
30
+ };
31
+ const entity = await strapi.db.query(model).findOne({
32
+ where: params,
33
+ populate: attributesToPopulate
34
+ });
35
+ if (!entity) {
36
+ return ctx.notFound();
37
+ }
38
+ const permissions = await strapi.admin.services.permission.findMany({
39
+ where: {
40
+ action: [
41
+ READ_ACTION,
42
+ CREATE_ACTION
43
+ ],
44
+ subject: model,
45
+ role: {
46
+ id: user.roles.map(prop('id'))
47
+ }
48
+ }
49
+ });
50
+ const localePermissions = permissions.filter((perm)=>getLocalesProperty(perm).includes(locale)).map(getFieldsProperty);
51
+ const permittedFields = pipe(flatten, getFirstLevelPath, uniq)(localePermissions);
52
+ const nonLocalizedFields = copyNonLocalizedAttributes(modelDef, entity);
53
+ const sanitizedNonLocalizedFields = pick(permittedFields, nonLocalizedFields);
54
+ const availableLocalesResult = await strapi.plugins['content-manager'].service('document-metadata').getMetadata(model, entity, {
55
+ availableLocales: true
56
+ });
57
+ const availableLocales = availableLocalesResult.availableLocales.map((localeResult)=>pick([
58
+ 'id',
59
+ 'locale',
60
+ PUBLISHED_AT_ATTRIBUTE
61
+ ], localeResult));
62
+ ctx.body = {
63
+ nonLocalizedFields: sanitizedNonLocalizedFields,
64
+ localizations: availableLocales.concat(pick([
65
+ 'id',
66
+ 'locale',
67
+ PUBLISHED_AT_ATTRIBUTE
68
+ ], entity))
69
+ };
70
+ }
71
+ };
72
+
73
+ export { controller as default };
74
+ //# sourceMappingURL=content-types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-types.mjs","sources":["../../../server/src/controllers/content-types.ts"],"sourcesContent":["import { pick, uniq, prop, getOr, flatten, pipe, map } from 'lodash/fp';\nimport { contentTypes as contentTypesUtils, errors } from '@strapi/utils';\nimport type { Core } from '@strapi/types';\nimport { getService } from '../utils';\nimport { validateGetNonLocalizedAttributesInput } from '../validation/content-types';\n\nconst { ApplicationError } = errors;\n\nconst { PUBLISHED_AT_ATTRIBUTE } = contentTypesUtils.constants;\n\nconst getLocalesProperty = getOr<string[]>([], 'properties.locales');\nconst getFieldsProperty = prop('properties.fields');\n\nconst getFirstLevelPath = map((path: string) => path.split('.')[0]);\n\nconst controller = {\n async getNonLocalizedAttributes(ctx) {\n const { user } = ctx.state;\n const body = ctx.request.body as any;\n const { model, id, locale } = body;\n\n await validateGetNonLocalizedAttributesInput({ model, id, locale });\n\n const {\n copyNonLocalizedAttributes,\n isLocalizedContentType,\n getNestedPopulateOfNonLocalizedAttributes,\n } = getService('content-types');\n\n const {\n default: { READ_ACTION, CREATE_ACTION },\n } = strapi.service('admin::constants');\n\n const modelDef = strapi.contentType(model);\n const attributesToPopulate = getNestedPopulateOfNonLocalizedAttributes(model);\n\n if (!isLocalizedContentType(modelDef)) {\n throw new ApplicationError(`Model ${model} is not localized`);\n }\n\n const params = modelDef.kind === 'singleType' ? {} : { id };\n\n const entity = await strapi.db\n .query(model)\n .findOne({ where: params, populate: attributesToPopulate });\n\n if (!entity) {\n return ctx.notFound();\n }\n\n const permissions = await strapi.admin.services.permission.findMany({\n where: {\n action: [READ_ACTION, CREATE_ACTION],\n subject: model,\n role: {\n id: user.roles.map(prop('id')),\n },\n },\n });\n\n const localePermissions = permissions\n .filter((perm: any) => getLocalesProperty(perm).includes(locale))\n .map(getFieldsProperty);\n\n const permittedFields = pipe(flatten, getFirstLevelPath, uniq)(localePermissions);\n\n const nonLocalizedFields = copyNonLocalizedAttributes(modelDef, entity);\n const sanitizedNonLocalizedFields = pick(permittedFields, nonLocalizedFields);\n\n const availableLocalesResult = await strapi.plugins['content-manager']\n .service('document-metadata')\n .getMetadata(model, entity, {\n availableLocales: true,\n });\n\n const availableLocales = availableLocalesResult.availableLocales.map((localeResult: any) =>\n pick(['id', 'locale', PUBLISHED_AT_ATTRIBUTE], localeResult)\n );\n\n ctx.body = {\n nonLocalizedFields: sanitizedNonLocalizedFields,\n localizations: availableLocales.concat(\n pick(['id', 'locale', PUBLISHED_AT_ATTRIBUTE], entity)\n ),\n };\n },\n} satisfies Core.Controller;\n\nexport default controller;\n"],"names":["ApplicationError","errors","PUBLISHED_AT_ATTRIBUTE","contentTypesUtils","constants","getLocalesProperty","getOr","getFieldsProperty","prop","getFirstLevelPath","map","path","split","controller","getNonLocalizedAttributes","ctx","user","state","body","request","model","id","locale","validateGetNonLocalizedAttributesInput","copyNonLocalizedAttributes","isLocalizedContentType","getNestedPopulateOfNonLocalizedAttributes","getService","default","READ_ACTION","CREATE_ACTION","strapi","service","modelDef","contentType","attributesToPopulate","params","kind","entity","db","query","findOne","where","populate","notFound","permissions","admin","services","permission","findMany","action","subject","role","roles","localePermissions","filter","perm","includes","permittedFields","pipe","flatten","uniq","nonLocalizedFields","sanitizedNonLocalizedFields","pick","availableLocalesResult","plugins","getMetadata","availableLocales","localeResult","localizations","concat"],"mappings":";;;;;AAMA,MAAM,EAAEA,gBAAgB,EAAE,GAAGC,MAAAA;AAE7B,MAAM,EAAEC,sBAAsB,EAAE,GAAGC,aAAkBC,SAAS;AAE9D,MAAMC,kBAAAA,GAAqBC,KAAgB,CAAA,EAAE,EAAE,oBAAA,CAAA;AAC/C,MAAMC,oBAAoBC,IAAK,CAAA,mBAAA,CAAA;AAE/B,MAAMC,iBAAAA,GAAoBC,IAAI,CAACC,IAAAA,GAAiBA,KAAKC,KAAK,CAAC,GAAI,CAAA,CAAC,CAAE,CAAA,CAAA;AAElE,MAAMC,UAAa,GAAA;AACjB,IAAA,MAAMC,2BAA0BC,GAAG,EAAA;AACjC,QAAA,MAAM,EAAEC,IAAI,EAAE,GAAGD,IAAIE,KAAK;AAC1B,QAAA,MAAMC,IAAOH,GAAAA,GAAAA,CAAII,OAAO,CAACD,IAAI;AAC7B,QAAA,MAAM,EAAEE,KAAK,EAAEC,EAAE,EAAEC,MAAM,EAAE,GAAGJ,IAAAA;AAE9B,QAAA,MAAMK,sCAAuC,CAAA;AAAEH,YAAAA,KAAAA;AAAOC,YAAAA,EAAAA;AAAIC,YAAAA;AAAO,SAAA,CAAA;QAEjE,MAAM,EACJE,0BAA0B,EAC1BC,sBAAsB,EACtBC,yCAAyC,EAC1C,GAAGC,UAAW,CAAA,eAAA,CAAA;QAEf,MAAM,EACJC,OAAS,EAAA,EAA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Q,CAACnC,MACxDZ,CAAAA,CAAAA,CAAAA,GAAG,CAACH,iBAAAA,CAAAA;AAEP,QAAA,MAAMmD,eAAkBC,GAAAA,IAAAA,CAAKC,OAASnD,EAAAA,iBAAAA,EAAmBoD,IAAMP,CAAAA,CAAAA,iBAAAA,CAAAA;QAE/D,MAAMQ,kBAAAA,GAAqBtC,2BAA2BS,QAAUK,EAAAA,MAAAA,CAAAA;QAChE,MAAMyB,2BAAAA,GAA8BC,KAAKN,eAAiBI,EAAAA,kBAAAA,CAAAA;AAE1D,QAAA,MAAMG,sBAAyB,GAAA,MAAMlC,MAAOmC,CAAAA,OAAO,CAAC,iBAAA,CAAkB,CACnElC,OAAO,CAAC,mBAAA,CAAA,CACRmC,WAAW,CAAC/C,OAAOkB,MAAQ,EAAA;YAC1B8B,gBAAkB,EAAA;AACpB,SAAA,CAAA;QAEF,MAAMA,gBAAAA,GAAmBH,uBAAuBG,gBAAgB,CAAC1D,GAAG,CAAC,CAAC2D,eACpEL,IAAK,CAAA;AAAC,gBAAA,IAAA;AAAM,gBAAA,QAAA;AAAU9D,gBAAAA;aAAuB,EAAEmE,YAAAA,CAAAA,CAAAA;AAGjDtD,QAAAA,GAAAA,CAAIG,IAAI,GAAG;YACT4C,kBAAoBC,EAAAA,2BAAAA;YACpBO,aAAeF,EAAAA,gBAAAA,CAAiBG,MAAM,CACpCP,IAAK,CAAA;AAAC,gBAAA,IAAA;AAAM,gBAAA,QAAA;AAAU9D,gBAAAA;aAAuB,EAAEoC,MAAAA,CAAAA;AAEnD,SAAA;AACF;AACF;;;;"}
@@ -0,0 +1,18 @@
1
+ 'use strict';
2
+
3
+ var locales = require('./locales.js');
4
+ var contentTypes = require('./content-types.js');
5
+ var isoLocales = require('./iso-locales.js');
6
+ var settings = require('./settings.js');
7
+ var aiLocalizationJobs = require('./ai-localization-jobs.js');
8
+
9
+ var controllers = {
10
+ locales,
11
+ 'iso-locales': isoLocales,
12
+ 'content-types': contentTypes,
13
+ settings,
14
+ 'ai-localization-jobs': aiLocalizationJobs
15
+ };
16
+
17
+ module.exports = controllers;
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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';\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;;;;"}
@@ -0,0 +1,16 @@
1
+ import controller from './locales.mjs';
2
+ import controller$2 from './content-types.mjs';
3
+ import controller$1 from './iso-locales.mjs';
4
+ import settings from './settings.mjs';
5
+ import createAILocalizationJobsController from './ai-localization-jobs.mjs';
6
+
7
+ var controllers = {
8
+ locales: controller,
9
+ 'iso-locales': controller$1,
10
+ 'content-types': controller$2,
11
+ settings,
12
+ 'ai-localization-jobs': createAILocalizationJobsController
13
+ };
14
+
15
+ export { controllers as default };
16
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +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';\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,13 @@
1
+ 'use strict';
2
+
3
+ var index = require('../utils/index.js');
4
+
5
+ const controller = {
6
+ listIsoLocales (ctx) {
7
+ const isoLocalesService = index.getService('iso-locales');
8
+ ctx.body = isoLocalesService.getIsoLocales();
9
+ }
10
+ };
11
+
12
+ module.exports = controller;
13
+ //# sourceMappingURL=iso-locales.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iso-locales.js","sources":["../../../server/src/controllers/iso-locales.ts"],"sourcesContent":["import type { Core } from '@strapi/types';\nimport { getService } from '../utils';\n\nconst controller: Core.Controller = {\n listIsoLocales(ctx) {\n const isoLocalesService = getService('iso-locales');\n\n ctx.body = isoLocalesService.getIsoLocales();\n },\n};\n\nexport default controller;\n"],"names":["controller","listIsoLocales","ctx","isoLocalesService","getService","body","getIsoLocales"],"mappings":";;;;AAGA,MAAMA,UAA8B,GAAA;AAClCC,IAAAA,cAAAA,CAAAA,CAAeC,GAAG,EAAA;AAChB,QAAA,MAAMC,oBAAoBC,gBAAW,CAAA,aAAA,CAAA;QAErCF,GAAIG,CAAAA,IAAI,GAAGF,iBAAAA,CAAkBG,aAAa,EAAA;AAC5C;AACF;;;;"}
@@ -0,0 +1,11 @@
1
+ import { getService } from '../utils/index.mjs';
2
+
3
+ const controller = {
4
+ listIsoLocales (ctx) {
5
+ const isoLocalesService = getService('iso-locales');
6
+ ctx.body = isoLocalesService.getIsoLocales();
7
+ }
8
+ };
9
+
10
+ export { controller as default };
11
+ //# sourceMappingURL=iso-locales.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iso-locales.mjs","sources":["../../../server/src/controllers/iso-locales.ts"],"sourcesContent":["import type { Core } from '@strapi/types';\nimport { getService } from '../utils';\n\nconst controller: Core.Controller = {\n listIsoLocales(ctx) {\n const isoLocalesService = getService('iso-locales');\n\n ctx.body = isoLocalesService.getIsoLocales();\n },\n};\n\nexport default controller;\n"],"names":["controller","listIsoLocales","ctx","isoLocalesService","getService","body","getIsoLocales"],"mappings":";;AAGA,MAAMA,UAA8B,GAAA;AAClCC,IAAAA,cAAAA,CAAAA,CAAeC,GAAG,EAAA;AAChB,QAAA,MAAMC,oBAAoBC,UAAW,CAAA,aAAA,CAAA;QAErCF,GAAIG,CAAAA,IAAI,GAAGF,iBAAAA,CAAkBG,aAAa,EAAA;AAC5C;AACF;;;;"}