@strapi/i18n 0.0.0-next.ce84fada19d58a7dfbdd553035e6558f8befcba4 → 0.0.0-next.d190a700af70e9360d767221b76cd8e815bd01aa
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.
- package/dist/admin/components/BulkLocaleActionModal.js +262 -0
- package/dist/admin/components/BulkLocaleActionModal.js.map +1 -0
- package/dist/admin/components/BulkLocaleActionModal.mjs +260 -0
- package/dist/admin/components/BulkLocaleActionModal.mjs.map +1 -0
- package/dist/admin/components/CMHeaderActions.js +968 -0
- package/dist/admin/components/CMHeaderActions.js.map +1 -0
- package/dist/admin/components/CMHeaderActions.mjs +942 -0
- package/dist/admin/components/CMHeaderActions.mjs.map +1 -0
- package/dist/admin/components/CMListViewModalsAdditionalInformation.js +69 -0
- package/dist/admin/components/CMListViewModalsAdditionalInformation.js.map +1 -0
- package/dist/admin/components/CMListViewModalsAdditionalInformation.mjs +65 -0
- package/dist/admin/components/CMListViewModalsAdditionalInformation.mjs.map +1 -0
- package/dist/admin/components/CheckboxConfirmation.js +155 -0
- package/dist/admin/components/CheckboxConfirmation.js.map +1 -0
- package/dist/admin/components/CheckboxConfirmation.mjs +134 -0
- package/dist/admin/components/CheckboxConfirmation.mjs.map +1 -0
- package/dist/admin/components/CreateLocale.js +394 -0
- package/dist/admin/components/CreateLocale.js.map +1 -0
- package/dist/admin/components/CreateLocale.mjs +368 -0
- package/dist/admin/components/CreateLocale.mjs.map +1 -0
- package/dist/admin/components/DeleteLocale.js +90 -0
- package/dist/admin/components/DeleteLocale.js.map +1 -0
- package/dist/admin/components/DeleteLocale.mjs +69 -0
- package/dist/admin/components/DeleteLocale.mjs.map +1 -0
- package/dist/admin/components/EditLocale.js +212 -0
- package/dist/admin/components/EditLocale.js.map +1 -0
- package/dist/admin/components/EditLocale.mjs +190 -0
- package/dist/admin/components/EditLocale.mjs.map +1 -0
- package/dist/admin/components/LocaleListCell.js +102 -0
- package/dist/admin/components/LocaleListCell.js.map +1 -0
- package/dist/admin/components/LocaleListCell.mjs +100 -0
- package/dist/admin/components/LocaleListCell.mjs.map +1 -0
- package/dist/admin/components/LocalePicker.js +105 -0
- package/dist/admin/components/LocalePicker.js.map +1 -0
- package/dist/admin/components/LocalePicker.mjs +84 -0
- package/dist/admin/components/LocalePicker.mjs.map +1 -0
- package/dist/admin/components/LocaleTable.js +143 -0
- package/dist/admin/components/LocaleTable.js.map +1 -0
- package/dist/admin/components/LocaleTable.mjs +122 -0
- package/dist/admin/components/LocaleTable.mjs.map +1 -0
- package/dist/admin/constants.js +37 -0
- package/dist/admin/constants.js.map +1 -0
- package/dist/admin/constants.mjs +35 -0
- package/dist/admin/constants.mjs.map +1 -0
- package/dist/admin/contentManagerHooks/editView.js +109 -0
- package/dist/admin/contentManagerHooks/editView.js.map +1 -0
- package/dist/admin/contentManagerHooks/editView.mjs +88 -0
- package/dist/admin/contentManagerHooks/editView.mjs.map +1 -0
- package/dist/admin/contentManagerHooks/listView.js +44 -0
- package/dist/admin/contentManagerHooks/listView.js.map +1 -0
- package/dist/admin/contentManagerHooks/listView.mjs +42 -0
- package/dist/admin/contentManagerHooks/listView.mjs.map +1 -0
- package/dist/admin/contentReleasesHooks/releaseDetailsView.js +20 -0
- package/dist/admin/contentReleasesHooks/releaseDetailsView.js.map +1 -0
- package/dist/admin/contentReleasesHooks/releaseDetailsView.mjs +18 -0
- package/dist/admin/contentReleasesHooks/releaseDetailsView.mjs.map +1 -0
- package/dist/admin/hooks/useAILocalizationJobsPolling.js +110 -0
- package/dist/admin/hooks/useAILocalizationJobsPolling.js.map +1 -0
- package/dist/admin/hooks/useAILocalizationJobsPolling.mjs +89 -0
- package/dist/admin/hooks/useAILocalizationJobsPolling.mjs.map +1 -0
- package/dist/admin/hooks/useI18n.js +78 -0
- package/dist/admin/hooks/useI18n.js.map +1 -0
- package/dist/admin/hooks/useI18n.mjs +57 -0
- package/dist/admin/hooks/useI18n.mjs.map +1 -0
- package/dist/admin/index.js +226 -5
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/index.mjs +202 -5
- package/dist/admin/index.mjs.map +1 -1
- package/dist/admin/middlewares/extendCTBAttributeInitialData.js +71 -0
- package/dist/admin/middlewares/extendCTBAttributeInitialData.js.map +1 -0
- package/dist/admin/middlewares/extendCTBAttributeInitialData.mjs +69 -0
- package/dist/admin/middlewares/extendCTBAttributeInitialData.mjs.map +1 -0
- package/dist/admin/middlewares/extendCTBInitialData.js +40 -0
- package/dist/admin/middlewares/extendCTBInitialData.js.map +1 -0
- package/dist/admin/middlewares/extendCTBInitialData.mjs +38 -0
- package/dist/admin/middlewares/extendCTBInitialData.mjs.map +1 -0
- package/dist/admin/middlewares/rbac-middleware.js +49 -0
- package/dist/admin/middlewares/rbac-middleware.js.map +1 -0
- package/dist/admin/middlewares/rbac-middleware.mjs +28 -0
- package/dist/admin/middlewares/rbac-middleware.mjs.map +1 -0
- package/dist/admin/pages/SettingsPage.js +182 -0
- package/dist/admin/pages/SettingsPage.js.map +1 -0
- package/dist/admin/pages/SettingsPage.mjs +179 -0
- package/dist/admin/pages/SettingsPage.mjs.map +1 -0
- package/dist/admin/pluginId.js +6 -0
- package/dist/admin/pluginId.js.map +1 -0
- package/dist/admin/pluginId.mjs +4 -0
- package/dist/admin/pluginId.mjs.map +1 -0
- package/dist/admin/services/aiLocalizationJobs.js +26 -0
- package/dist/admin/services/aiLocalizationJobs.js.map +1 -0
- package/dist/admin/services/aiLocalizationJobs.mjs +24 -0
- package/dist/admin/services/aiLocalizationJobs.mjs.map +1 -0
- package/dist/admin/services/api.js +15 -0
- package/dist/admin/services/api.js.map +1 -0
- package/dist/admin/services/api.mjs +13 -0
- package/dist/admin/services/api.mjs.map +1 -0
- package/dist/admin/services/locales.js +72 -0
- package/dist/admin/services/locales.js.map +1 -0
- package/dist/admin/services/locales.mjs +66 -0
- package/dist/admin/services/locales.mjs.map +1 -0
- package/dist/admin/services/relations.js +23 -0
- package/dist/admin/services/relations.js.map +1 -0
- package/dist/admin/services/relations.mjs +21 -0
- package/dist/admin/services/relations.mjs.map +1 -0
- package/dist/admin/services/settings.js +30 -0
- package/dist/admin/services/settings.js.map +1 -0
- package/dist/admin/services/settings.mjs +27 -0
- package/dist/admin/services/settings.mjs.map +1 -0
- package/dist/admin/src/components/CMHeaderActions.d.ts +19 -6
- package/dist/admin/src/components/LocaleListCell.d.ts +5 -4
- package/dist/admin/src/components/tests/CreateLocale.test.d.ts +1 -0
- package/dist/admin/src/components/tests/DeleteLocale.test.d.ts +1 -0
- package/dist/admin/src/components/tests/EditLocale.test.d.ts +1 -0
- package/dist/admin/src/components/tests/LocaleListCell.test.d.ts +1 -0
- package/dist/admin/src/contentReleasesHooks/releaseDetailsView.d.ts +1 -1
- package/dist/admin/src/hooks/useAILocalizationJobsPolling.d.ts +9 -0
- package/dist/admin/src/pages/tests/SettingsPage.test.d.ts +1 -0
- package/dist/admin/src/services/aiLocalizationJobs.d.ts +6 -0
- package/dist/admin/src/services/api.d.ts +1 -1
- package/dist/admin/src/services/locales.d.ts +1 -1
- package/dist/admin/src/services/relations.d.ts +1 -1
- package/dist/admin/src/services/settings.d.ts +5 -0
- package/dist/admin/src/utils/schemas.d.ts +642 -16
- package/dist/admin/tests/server.d.ts +1 -0
- package/dist/admin/tests/utils.d.ts +6 -0
- package/dist/admin/translations/de.json.js +66 -0
- package/dist/admin/translations/de.json.js.map +1 -0
- package/dist/admin/translations/de.json.mjs +64 -0
- package/dist/admin/translations/de.json.mjs.map +1 -0
- package/dist/admin/translations/dk.json.js +66 -0
- package/dist/admin/translations/dk.json.js.map +1 -0
- package/dist/admin/translations/dk.json.mjs +64 -0
- package/dist/admin/translations/dk.json.mjs.map +1 -0
- package/dist/admin/translations/en.json.js +91 -0
- package/dist/admin/translations/en.json.js.map +1 -0
- package/dist/admin/translations/en.json.mjs +89 -0
- package/dist/admin/translations/en.json.mjs.map +1 -0
- package/dist/admin/translations/es.json.js +66 -0
- package/dist/admin/translations/es.json.js.map +1 -0
- package/dist/admin/translations/es.json.mjs +64 -0
- package/dist/admin/translations/es.json.mjs.map +1 -0
- package/dist/admin/translations/fr.json.js +66 -0
- package/dist/admin/translations/fr.json.js.map +1 -0
- package/dist/admin/translations/fr.json.mjs +64 -0
- package/dist/admin/translations/fr.json.mjs.map +1 -0
- package/dist/admin/translations/ko.json.js +65 -0
- package/dist/admin/translations/ko.json.js.map +1 -0
- package/dist/admin/translations/ko.json.mjs +63 -0
- package/dist/admin/translations/ko.json.mjs.map +1 -0
- package/dist/admin/translations/pl.json.js +66 -0
- package/dist/admin/translations/pl.json.js.map +1 -0
- package/dist/admin/translations/pl.json.mjs +64 -0
- package/dist/admin/translations/pl.json.mjs.map +1 -0
- package/dist/admin/translations/ru.json.js +68 -0
- package/dist/admin/translations/ru.json.js.map +1 -0
- package/dist/admin/translations/ru.json.mjs +66 -0
- package/dist/admin/translations/ru.json.mjs.map +1 -0
- package/dist/admin/translations/tr.json.js +66 -0
- package/dist/admin/translations/tr.json.js.map +1 -0
- package/dist/admin/translations/tr.json.mjs +64 -0
- package/dist/admin/translations/tr.json.mjs.map +1 -0
- package/dist/admin/translations/uk.json.js +82 -0
- package/dist/admin/translations/uk.json.js.map +1 -0
- package/dist/admin/translations/uk.json.mjs +80 -0
- package/dist/admin/translations/uk.json.mjs.map +1 -0
- package/dist/admin/translations/zh-Hans.json.js +57 -0
- package/dist/admin/translations/zh-Hans.json.js.map +1 -0
- package/dist/admin/translations/zh-Hans.json.mjs +55 -0
- package/dist/admin/translations/zh-Hans.json.mjs.map +1 -0
- package/dist/admin/translations/zh.json.js +66 -0
- package/dist/admin/translations/zh.json.js.map +1 -0
- package/dist/admin/translations/zh.json.mjs +64 -0
- package/dist/admin/translations/zh.json.mjs.map +1 -0
- package/dist/admin/utils/baseQuery.js +8 -0
- package/dist/admin/utils/baseQuery.js.map +1 -0
- package/dist/admin/utils/baseQuery.mjs +6 -0
- package/dist/admin/utils/baseQuery.mjs.map +1 -0
- package/dist/admin/utils/clean.js +70 -0
- package/dist/admin/utils/clean.js.map +1 -0
- package/dist/admin/utils/clean.mjs +68 -0
- package/dist/admin/utils/clean.mjs.map +1 -0
- package/dist/admin/utils/fields.js +34 -0
- package/dist/admin/utils/fields.js.map +1 -0
- package/dist/admin/utils/fields.mjs +31 -0
- package/dist/admin/utils/fields.mjs.map +1 -0
- package/dist/admin/utils/getTranslation.js +8 -0
- package/dist/admin/utils/getTranslation.js.map +1 -0
- package/dist/admin/utils/getTranslation.mjs +6 -0
- package/dist/admin/utils/getTranslation.mjs.map +1 -0
- package/dist/admin/utils/prefixPluginTranslations.js +11 -0
- package/dist/admin/utils/prefixPluginTranslations.js.map +1 -0
- package/dist/admin/utils/prefixPluginTranslations.mjs +9 -0
- package/dist/admin/utils/prefixPluginTranslations.mjs.map +1 -0
- package/dist/admin/utils/schemas.js +74 -0
- package/dist/admin/utils/schemas.js.map +1 -0
- package/dist/admin/utils/schemas.mjs +72 -0
- package/dist/admin/utils/schemas.mjs.map +1 -0
- package/dist/admin/utils/strings.js +6 -0
- package/dist/admin/utils/strings.js.map +1 -0
- package/dist/admin/utils/strings.mjs +4 -0
- package/dist/admin/utils/strings.mjs.map +1 -0
- package/dist/server/bootstrap.js +81 -0
- package/dist/server/bootstrap.js.map +1 -0
- package/dist/server/bootstrap.mjs +79 -0
- package/dist/server/bootstrap.mjs.map +1 -0
- package/dist/server/constants/index.js +29 -0
- package/dist/server/constants/index.js.map +1 -0
- package/dist/server/constants/index.mjs +25 -0
- package/dist/server/constants/index.mjs.map +1 -0
- package/dist/server/constants/iso-locales.json.js +2427 -0
- package/dist/server/constants/iso-locales.json.js.map +1 -0
- package/dist/server/constants/iso-locales.json.mjs +2425 -0
- package/dist/server/constants/iso-locales.json.mjs.map +1 -0
- package/dist/server/content-types/index.js +10 -0
- package/dist/server/content-types/index.js.map +1 -0
- package/dist/server/content-types/index.mjs +8 -0
- package/dist/server/content-types/index.mjs.map +1 -0
- package/dist/server/content-types/locale/index.js +10 -0
- package/dist/server/content-types/locale/index.js.map +1 -0
- package/dist/server/content-types/locale/index.mjs +8 -0
- package/dist/server/content-types/locale/index.mjs.map +1 -0
- package/dist/server/content-types/locale/schema.json.js +46 -0
- package/dist/server/content-types/locale/schema.json.js.map +1 -0
- package/dist/server/content-types/locale/schema.json.mjs +38 -0
- package/dist/server/content-types/locale/schema.json.mjs.map +1 -0
- package/dist/server/controllers/ai-localization-jobs.js +47 -0
- package/dist/server/controllers/ai-localization-jobs.js.map +1 -0
- package/dist/server/controllers/ai-localization-jobs.mjs +45 -0
- package/dist/server/controllers/ai-localization-jobs.mjs.map +1 -0
- package/dist/server/controllers/content-types.js +76 -0
- package/dist/server/controllers/content-types.js.map +1 -0
- package/dist/server/controllers/content-types.mjs +74 -0
- package/dist/server/controllers/content-types.mjs.map +1 -0
- package/dist/server/controllers/index.js +18 -0
- package/dist/server/controllers/index.js.map +1 -0
- package/dist/server/controllers/index.mjs +16 -0
- package/dist/server/controllers/index.mjs.map +1 -0
- package/dist/server/controllers/iso-locales.js +13 -0
- package/dist/server/controllers/iso-locales.js.map +1 -0
- package/dist/server/controllers/iso-locales.mjs +11 -0
- package/dist/server/controllers/iso-locales.mjs.map +1 -0
- package/dist/server/controllers/locales.js +108 -0
- package/dist/server/controllers/locales.js.map +1 -0
- package/dist/server/controllers/locales.mjs +87 -0
- package/dist/server/controllers/locales.mjs.map +1 -0
- package/dist/server/controllers/settings.js +24 -0
- package/dist/server/controllers/settings.js.map +1 -0
- package/dist/server/controllers/settings.mjs +22 -0
- package/dist/server/controllers/settings.mjs.map +1 -0
- package/dist/server/controllers/validate-locale-creation.js +47 -0
- package/dist/server/controllers/validate-locale-creation.js.map +1 -0
- package/dist/server/controllers/validate-locale-creation.mjs +45 -0
- package/dist/server/controllers/validate-locale-creation.mjs.map +1 -0
- package/dist/server/domain/locale.js +11 -0
- package/dist/server/domain/locale.js.map +1 -0
- package/dist/server/domain/locale.mjs +9 -0
- package/dist/server/domain/locale.mjs.map +1 -0
- package/dist/server/graphql.js +115 -0
- package/dist/server/graphql.js.map +1 -0
- package/dist/server/graphql.mjs +113 -0
- package/dist/server/graphql.mjs.map +1 -0
- package/dist/server/index.js +18 -3430
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +17 -3412
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/models/ai-localization-job.js +60 -0
- package/dist/server/models/ai-localization-job.js.map +1 -0
- package/dist/server/models/ai-localization-job.mjs +57 -0
- package/dist/server/models/ai-localization-job.mjs.map +1 -0
- package/dist/server/register.js +81 -0
- package/dist/server/register.js.map +1 -0
- package/dist/server/register.mjs +79 -0
- package/dist/server/register.mjs.map +1 -0
- package/dist/server/routes/admin.js +142 -0
- package/dist/server/routes/admin.js.map +1 -0
- package/dist/server/routes/admin.mjs +140 -0
- package/dist/server/routes/admin.mjs.map +1 -0
- package/dist/server/routes/content-api.js +19 -0
- package/dist/server/routes/content-api.js.map +1 -0
- package/dist/server/routes/content-api.mjs +17 -0
- package/dist/server/routes/content-api.mjs.map +1 -0
- package/dist/server/routes/index.js +12 -0
- package/dist/server/routes/index.js.map +1 -0
- package/dist/server/routes/index.mjs +10 -0
- package/dist/server/routes/index.mjs.map +1 -0
- package/dist/server/routes/validation/locale.js +57 -0
- package/dist/server/routes/validation/locale.js.map +1 -0
- package/dist/server/routes/validation/locale.mjs +36 -0
- package/dist/server/routes/validation/locale.mjs.map +1 -0
- package/dist/server/services/ai-localization-jobs.js +64 -0
- package/dist/server/services/ai-localization-jobs.js.map +1 -0
- package/dist/server/services/ai-localization-jobs.mjs +62 -0
- package/dist/server/services/ai-localization-jobs.mjs.map +1 -0
- package/dist/server/services/ai-localizations.js +268 -0
- package/dist/server/services/ai-localizations.js.map +1 -0
- package/dist/server/services/ai-localizations.mjs +266 -0
- package/dist/server/services/ai-localizations.mjs.map +1 -0
- package/dist/server/services/content-types.js +157 -0
- package/dist/server/services/content-types.js.map +1 -0
- package/dist/server/services/content-types.mjs +155 -0
- package/dist/server/services/content-types.mjs.map +1 -0
- package/dist/server/services/index.js +28 -0
- package/dist/server/services/index.js.map +1 -0
- package/dist/server/services/index.mjs +26 -0
- package/dist/server/services/index.mjs.map +1 -0
- package/dist/server/services/iso-locales.js +12 -0
- package/dist/server/services/iso-locales.js.map +1 -0
- package/dist/server/services/iso-locales.mjs +10 -0
- package/dist/server/services/iso-locales.mjs.map +1 -0
- package/dist/server/services/locales.js +114 -0
- package/dist/server/services/locales.js.map +1 -0
- package/dist/server/services/locales.mjs +112 -0
- package/dist/server/services/locales.mjs.map +1 -0
- package/dist/server/services/localizations.js +68 -0
- package/dist/server/services/localizations.js.map +1 -0
- package/dist/server/services/localizations.mjs +66 -0
- package/dist/server/services/localizations.mjs.map +1 -0
- package/dist/server/services/metrics.js +30 -0
- package/dist/server/services/metrics.js.map +1 -0
- package/dist/server/services/metrics.mjs +28 -0
- package/dist/server/services/metrics.mjs.map +1 -0
- package/dist/server/services/permissions/actions.js +136 -0
- package/dist/server/services/permissions/actions.js.map +1 -0
- package/dist/server/services/permissions/actions.mjs +134 -0
- package/dist/server/services/permissions/actions.mjs.map +1 -0
- package/dist/server/services/permissions/engine.js +52 -0
- package/dist/server/services/permissions/engine.js.map +1 -0
- package/dist/server/services/permissions/engine.mjs +50 -0
- package/dist/server/services/permissions/engine.mjs.map +1 -0
- package/dist/server/services/permissions/sections-builder.js +45 -0
- package/dist/server/services/permissions/sections-builder.js.map +1 -0
- package/dist/server/services/permissions/sections-builder.mjs +43 -0
- package/dist/server/services/permissions/sections-builder.mjs.map +1 -0
- package/dist/server/services/permissions.js +14 -0
- package/dist/server/services/permissions.js.map +1 -0
- package/dist/server/services/permissions.mjs +12 -0
- package/dist/server/services/permissions.mjs.map +1 -0
- package/dist/server/services/sanitize/index.js +34 -0
- package/dist/server/services/sanitize/index.js.map +1 -0
- package/dist/server/services/sanitize/index.mjs +32 -0
- package/dist/server/services/sanitize/index.mjs.map +1 -0
- package/dist/server/services/settings.js +25 -0
- package/dist/server/services/settings.js.map +1 -0
- package/dist/server/services/settings.mjs +23 -0
- package/dist/server/services/settings.mjs.map +1 -0
- package/dist/server/src/bootstrap.d.ts.map +1 -1
- package/dist/server/src/controllers/ai-localization-jobs.d.ts +17 -0
- package/dist/server/src/controllers/ai-localization-jobs.d.ts.map +1 -0
- package/dist/server/src/controllers/index.d.ts +10 -0
- package/dist/server/src/controllers/index.d.ts.map +1 -1
- package/dist/server/src/controllers/settings.d.ts +7 -0
- package/dist/server/src/controllers/settings.d.ts.map +1 -0
- package/dist/server/src/index.d.ts +53 -8
- package/dist/server/src/index.d.ts.map +1 -1
- package/dist/server/src/models/ai-localization-job.d.ts +5 -0
- package/dist/server/src/models/ai-localization-job.d.ts.map +1 -0
- package/dist/server/src/models/index.d.ts +5 -0
- package/dist/server/src/models/index.d.ts.map +1 -0
- package/dist/server/src/register.d.ts +1 -1
- package/dist/server/src/register.d.ts.map +1 -1
- package/dist/server/src/routes/admin.d.ts.map +1 -1
- package/dist/server/src/routes/content-api.d.ts +5 -8
- package/dist/server/src/routes/content-api.d.ts.map +1 -1
- package/dist/server/src/routes/index.d.ts +3 -7
- package/dist/server/src/routes/index.d.ts.map +1 -1
- package/dist/server/src/routes/validation/index.d.ts +2 -0
- package/dist/server/src/routes/validation/index.d.ts.map +1 -0
- package/dist/server/src/routes/validation/locale.d.ts +41 -0
- package/dist/server/src/routes/validation/locale.d.ts.map +1 -0
- package/dist/server/src/services/ai-localization-jobs.d.ts +26 -0
- package/dist/server/src/services/ai-localization-jobs.d.ts.map +1 -0
- package/dist/server/src/services/ai-localizations.d.ts +18 -0
- package/dist/server/src/services/ai-localizations.d.ts.map +1 -0
- package/dist/server/src/services/index.d.ts +39 -0
- package/dist/server/src/services/index.d.ts.map +1 -1
- package/dist/server/src/services/localizations.d.ts +1 -1
- package/dist/server/src/services/localizations.d.ts.map +1 -1
- package/dist/server/src/services/sanitize/index.d.ts +11 -0
- package/dist/server/src/services/sanitize/index.d.ts.map +1 -0
- package/dist/server/src/services/settings.d.ts +13 -0
- package/dist/server/src/services/settings.d.ts.map +1 -0
- package/dist/server/src/utils/index.d.ts +9 -1
- package/dist/server/src/utils/index.d.ts.map +1 -1
- package/dist/server/src/validation/settings.d.ts +12 -0
- package/dist/server/src/validation/settings.d.ts.map +1 -0
- package/dist/server/utils/index.js +16 -0
- package/dist/server/utils/index.js.map +1 -0
- package/dist/server/utils/index.mjs +13 -0
- package/dist/server/utils/index.mjs.map +1 -0
- package/dist/server/validation/content-types.js +18 -0
- package/dist/server/validation/content-types.js.map +1 -0
- package/dist/server/validation/content-types.mjs +16 -0
- package/dist/server/validation/content-types.mjs.map +1 -0
- package/dist/server/validation/locales.js +23 -0
- package/dist/server/validation/locales.js.map +1 -0
- package/dist/server/validation/locales.mjs +20 -0
- package/dist/server/validation/locales.mjs.map +1 -0
- package/dist/server/validation/settings.js +11 -0
- package/dist/server/validation/settings.js.map +1 -0
- package/dist/server/validation/settings.mjs +9 -0
- package/dist/server/validation/settings.mjs.map +1 -0
- package/dist/shared/contracts/ai-localization-jobs.d.ts +27 -0
- package/dist/shared/contracts/ai-localization-jobs.d.ts.map +1 -0
- package/dist/shared/contracts/content-manager.d.ts +1 -1
- package/dist/shared/contracts/settings.d.ts +40 -0
- package/dist/shared/contracts/shared.d.ts +1 -1
- package/dist/shared/contracts/shared.d.ts.map +1 -0
- package/package.json +22 -17
- package/dist/_chunks/SettingsPage-DbRFoF_H.mjs +0 -554
- package/dist/_chunks/SettingsPage-DbRFoF_H.mjs.map +0 -1
- package/dist/_chunks/SettingsPage-uGJv15wR.js +0 -574
- package/dist/_chunks/SettingsPage-uGJv15wR.js.map +0 -1
- package/dist/_chunks/de-9eCAqqrB.mjs +0 -66
- package/dist/_chunks/de-9eCAqqrB.mjs.map +0 -1
- package/dist/_chunks/de-DtWiGdHl.js +0 -66
- package/dist/_chunks/de-DtWiGdHl.js.map +0 -1
- package/dist/_chunks/dk-2qBjxt-P.mjs +0 -66
- package/dist/_chunks/dk-2qBjxt-P.mjs.map +0 -1
- package/dist/_chunks/dk-D8C-casx.js +0 -66
- package/dist/_chunks/dk-D8C-casx.js.map +0 -1
- package/dist/_chunks/en-BYRZFDBV.mjs +0 -81
- package/dist/_chunks/en-BYRZFDBV.mjs.map +0 -1
- package/dist/_chunks/en-Dk9At9_Z.js +0 -81
- package/dist/_chunks/en-Dk9At9_Z.js.map +0 -1
- package/dist/_chunks/es-DS-XFGSw.js +0 -66
- package/dist/_chunks/es-DS-XFGSw.js.map +0 -1
- package/dist/_chunks/es-DlmMVaBG.mjs +0 -66
- package/dist/_chunks/es-DlmMVaBG.mjs.map +0 -1
- package/dist/_chunks/fr-3S6ke71d.mjs +0 -66
- package/dist/_chunks/fr-3S6ke71d.mjs.map +0 -1
- package/dist/_chunks/fr-BTjekDpq.js +0 -66
- package/dist/_chunks/fr-BTjekDpq.js.map +0 -1
- package/dist/_chunks/index-7_EUScSl.mjs +0 -1614
- package/dist/_chunks/index-7_EUScSl.mjs.map +0 -1
- package/dist/_chunks/index-BGtXLYX-.js +0 -1636
- package/dist/_chunks/index-BGtXLYX-.js.map +0 -1
- package/dist/_chunks/ko-DmcGUBQ3.js +0 -65
- package/dist/_chunks/ko-DmcGUBQ3.js.map +0 -1
- package/dist/_chunks/ko-qTjQ8IMw.mjs +0 -65
- package/dist/_chunks/ko-qTjQ8IMw.mjs.map +0 -1
- package/dist/_chunks/pl-B67TSHqT.mjs +0 -66
- package/dist/_chunks/pl-B67TSHqT.mjs.map +0 -1
- package/dist/_chunks/pl-Cn5RYonZ.js +0 -66
- package/dist/_chunks/pl-Cn5RYonZ.js.map +0 -1
- package/dist/_chunks/ru-BMBgVL3s.js +0 -68
- package/dist/_chunks/ru-BMBgVL3s.js.map +0 -1
- package/dist/_chunks/ru-hagMa57T.mjs +0 -68
- package/dist/_chunks/ru-hagMa57T.mjs.map +0 -1
- package/dist/_chunks/tr-CarUU76c.js +0 -66
- package/dist/_chunks/tr-CarUU76c.js.map +0 -1
- package/dist/_chunks/tr-Dw_jmkG-.mjs +0 -66
- package/dist/_chunks/tr-Dw_jmkG-.mjs.map +0 -1
- package/dist/_chunks/zh-57YM4amO.mjs +0 -66
- package/dist/_chunks/zh-57YM4amO.mjs.map +0 -1
- package/dist/_chunks/zh-CukOviB0.js +0 -66
- package/dist/_chunks/zh-CukOviB0.js.map +0 -1
- package/dist/_chunks/zh-Hans-DSHIXAa3.js +0 -57
- package/dist/_chunks/zh-Hans-DSHIXAa3.js.map +0 -1
- package/dist/_chunks/zh-Hans-Dyc-aR-h.mjs +0 -57
- package/dist/_chunks/zh-Hans-Dyc-aR-h.mjs.map +0 -1
|
@@ -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;wB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S,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,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,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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,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 @@
|
|
|
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 @@
|
|
|
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":";;;;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,WAA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AA,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,uBA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