@strapi/i18n 0.0.0-next.d9724d67b33363354d7171a9f2265e1c42485e13 → 0.0.0-next.da19c0501ff87d14fb664b55b8e0630d3c548485
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/CMHeaderActions.js +132 -1
- package/dist/admin/components/CMHeaderActions.js.map +1 -1
- package/dist/admin/components/CMHeaderActions.mjs +135 -5
- package/dist/admin/components/CMHeaderActions.mjs.map +1 -1
- package/dist/admin/components/CreateLocale.js +1 -1
- package/dist/admin/components/CreateLocale.js.map +1 -1
- package/dist/admin/components/CreateLocale.mjs +1 -1
- package/dist/admin/components/CreateLocale.mjs.map +1 -1
- package/dist/admin/components/EditLocale.js +1 -1
- package/dist/admin/components/EditLocale.js.map +1 -1
- package/dist/admin/components/EditLocale.mjs +1 -1
- package/dist/admin/components/EditLocale.mjs.map +1 -1
- package/dist/admin/components/LocaleListCell.js +65 -45
- package/dist/admin/components/LocaleListCell.js.map +1 -1
- package/dist/admin/components/LocaleListCell.mjs +66 -46
- package/dist/admin/components/LocaleListCell.mjs.map +1 -1
- package/dist/admin/components/LocalePicker.js +18 -11
- package/dist/admin/components/LocalePicker.js.map +1 -1
- package/dist/admin/components/LocalePicker.mjs +19 -12
- package/dist/admin/components/LocalePicker.mjs.map +1 -1
- package/dist/admin/contentManagerHooks/editView.js +6 -3
- package/dist/admin/contentManagerHooks/editView.js.map +1 -1
- package/dist/admin/contentManagerHooks/editView.mjs +7 -4
- package/dist/admin/contentManagerHooks/editView.mjs.map +1 -1
- package/dist/admin/contentManagerHooks/listView.js +2 -1
- package/dist/admin/contentManagerHooks/listView.js.map +1 -1
- package/dist/admin/contentManagerHooks/listView.mjs +2 -1
- package/dist/admin/contentManagerHooks/listView.mjs.map +1 -1
- package/dist/admin/hooks/useAILocalizationJobsPolling.js +91 -0
- package/dist/admin/hooks/useAILocalizationJobsPolling.js.map +1 -0
- package/dist/admin/hooks/useAILocalizationJobsPolling.mjs +70 -0
- package/dist/admin/hooks/useAILocalizationJobsPolling.mjs.map +1 -0
- package/dist/admin/index.js +1 -0
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/index.mjs +2 -1
- package/dist/admin/index.mjs.map +1 -1
- package/dist/admin/pages/SettingsPage.js +121 -46
- package/dist/admin/pages/SettingsPage.js.map +1 -1
- package/dist/admin/pages/SettingsPage.mjs +124 -30
- package/dist/admin/pages/SettingsPage.mjs.map +1 -1
- 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 +3 -1
- package/dist/admin/services/api.js.map +1 -1
- package/dist/admin/services/api.mjs +3 -1
- package/dist/admin/services/api.mjs.map +1 -1
- package/dist/admin/services/settings.js +29 -0
- package/dist/admin/services/settings.js.map +1 -0
- package/dist/admin/services/settings.mjs +26 -0
- package/dist/admin/services/settings.mjs.map +1 -0
- package/dist/admin/src/components/CMHeaderActions.d.ts +7 -1
- package/dist/admin/src/components/LocaleListCell.d.ts +2 -1
- package/dist/admin/src/hooks/useAILocalizationJobsPolling.d.ts +9 -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/translations/en.json.js +9 -0
- package/dist/admin/translations/en.json.js.map +1 -1
- package/dist/admin/translations/en.json.mjs +9 -0
- package/dist/admin/translations/en.json.mjs.map +1 -1
- package/dist/admin/utils/clean.js +2 -2
- package/dist/admin/utils/clean.js.map +1 -1
- package/dist/admin/utils/clean.mjs +2 -2
- package/dist/admin/utils/clean.mjs.map +1 -1
- package/dist/server/bootstrap.js +2 -0
- package/dist/server/bootstrap.js.map +1 -1
- package/dist/server/bootstrap.mjs +2 -0
- package/dist/server/bootstrap.mjs.map +1 -1
- package/dist/server/constants/iso-locales.json.js +4 -0
- package/dist/server/constants/iso-locales.json.js.map +1 -1
- package/dist/server/constants/iso-locales.json.mjs +4 -0
- package/dist/server/constants/iso-locales.json.mjs.map +1 -1
- 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/index.js +5 -1
- package/dist/server/controllers/index.js.map +1 -1
- package/dist/server/controllers/index.mjs +5 -1
- package/dist/server/controllers/index.mjs.map +1 -1
- 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/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 +3 -1
- package/dist/server/register.js.map +1 -1
- package/dist/server/register.mjs +3 -1
- package/dist/server/register.mjs.map +1 -1
- package/dist/server/routes/admin.js +40 -0
- package/dist/server/routes/admin.js.map +1 -1
- package/dist/server/routes/admin.mjs +40 -0
- package/dist/server/routes/admin.mjs.map +1 -1
- 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 +210 -0
- package/dist/server/services/ai-localizations.js.map +1 -0
- package/dist/server/services/ai-localizations.mjs +208 -0
- package/dist/server/services/ai-localizations.mjs.map +1 -0
- package/dist/server/services/index.js +7 -1
- package/dist/server/services/index.js.map +1 -1
- package/dist/server/services/index.mjs +7 -1
- package/dist/server/services/index.mjs.map +1 -1
- 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 +44 -1
- 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/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 +33 -0
- package/dist/server/src/services/index.d.ts.map +1 -1
- 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 +7 -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.map +1 -1
- package/dist/server/utils/index.mjs.map +1 -1
- 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/settings.d.ts +40 -0
- package/dist/shared/contracts/shared.d.ts.map +1 -0
- package/package.json +10 -8
|
@@ -7,6 +7,9 @@ var locales = require('./locales.js');
|
|
|
7
7
|
var isoLocales = require('./iso-locales.js');
|
|
8
8
|
var contentTypes = require('./content-types.js');
|
|
9
9
|
var index = require('./sanitize/index.js');
|
|
10
|
+
var settings = require('./settings.js');
|
|
11
|
+
var aiLocalizations = require('./ai-localizations.js');
|
|
12
|
+
var aiLocalizationJobs = require('./ai-localization-jobs.js');
|
|
10
13
|
|
|
11
14
|
var services = {
|
|
12
15
|
permissions,
|
|
@@ -15,7 +18,10 @@ var services = {
|
|
|
15
18
|
locales,
|
|
16
19
|
sanitize: index,
|
|
17
20
|
'iso-locales': isoLocales,
|
|
18
|
-
'content-types': contentTypes
|
|
21
|
+
'content-types': contentTypes,
|
|
22
|
+
'ai-localizations': aiLocalizations.createAILocalizationsService,
|
|
23
|
+
'ai-localization-jobs': aiLocalizationJobs.createAILocalizationJobsService,
|
|
24
|
+
settings: settings.createSettingsService
|
|
19
25
|
};
|
|
20
26
|
|
|
21
27
|
module.exports = services;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../server/src/services/index.ts"],"sourcesContent":["import permissions from './permissions';\nimport metrics from './metrics';\nimport localizations from './localizations';\nimport locales from './locales';\nimport isoLocales from './iso-locales';\nimport contentTypes from './content-types';\nimport sanitize from './sanitize';\n\nexport default {\n permissions,\n metrics,\n localizations,\n locales,\n sanitize,\n 'iso-locales': isoLocales,\n 'content-types': contentTypes,\n};\n"],"names":["permissions","metrics","localizations","locales","sanitize","isoLocales","contentTypes"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../server/src/services/index.ts"],"sourcesContent":["import permissions from './permissions';\nimport metrics from './metrics';\nimport localizations from './localizations';\nimport locales from './locales';\nimport isoLocales from './iso-locales';\nimport contentTypes from './content-types';\nimport sanitize from './sanitize';\nimport { createSettingsService } from './settings';\nimport { createAILocalizationsService } from './ai-localizations';\nimport { createAILocalizationJobsService } from './ai-localization-jobs';\n\nexport default {\n permissions,\n metrics,\n localizations,\n locales,\n sanitize,\n 'iso-locales': isoLocales,\n 'content-types': contentTypes,\n 'ai-localizations': createAILocalizationsService,\n 'ai-localization-jobs': createAILocalizationJobsService,\n settings: createSettingsService,\n};\n"],"names":["permissions","metrics","localizations","locales","sanitize","isoLocales","contentTypes","createAILocalizationsService","createAILocalizationJobsService","settings","createSettingsService"],"mappings":";;;;;;;;;;;;;AAWA,eAAe;AACbA,IAAAA,WAAAA;AACAC,IAAAA,OAAAA;AACAC,IAAAA,aAAAA;AACAC,IAAAA,OAAAA;AACAC,cAAAA,KAAAA;IACA,aAAeC,EAAAA,UAAAA;IACf,eAAiBC,EAAAA,YAAAA;IACjB,kBAAoBC,EAAAA,4CAAAA;IACpB,sBAAwBC,EAAAA,kDAAAA;IACxBC,QAAUC,EAAAA;AACZ,CAAE;;;;"}
|
|
@@ -5,6 +5,9 @@ import locales from './locales.mjs';
|
|
|
5
5
|
import isoLocalesService from './iso-locales.mjs';
|
|
6
6
|
import contentTypes from './content-types.mjs';
|
|
7
7
|
import sanitize from './sanitize/index.mjs';
|
|
8
|
+
import { createSettingsService } from './settings.mjs';
|
|
9
|
+
import { createAILocalizationsService } from './ai-localizations.mjs';
|
|
10
|
+
import { createAILocalizationJobsService } from './ai-localization-jobs.mjs';
|
|
8
11
|
|
|
9
12
|
var services = {
|
|
10
13
|
permissions,
|
|
@@ -13,7 +16,10 @@ var services = {
|
|
|
13
16
|
locales,
|
|
14
17
|
sanitize,
|
|
15
18
|
'iso-locales': isoLocalesService,
|
|
16
|
-
'content-types': contentTypes
|
|
19
|
+
'content-types': contentTypes,
|
|
20
|
+
'ai-localizations': createAILocalizationsService,
|
|
21
|
+
'ai-localization-jobs': createAILocalizationJobsService,
|
|
22
|
+
settings: createSettingsService
|
|
17
23
|
};
|
|
18
24
|
|
|
19
25
|
export { services as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../server/src/services/index.ts"],"sourcesContent":["import permissions from './permissions';\nimport metrics from './metrics';\nimport localizations from './localizations';\nimport locales from './locales';\nimport isoLocales from './iso-locales';\nimport contentTypes from './content-types';\nimport sanitize from './sanitize';\n\nexport default {\n permissions,\n metrics,\n localizations,\n locales,\n sanitize,\n 'iso-locales': isoLocales,\n 'content-types': contentTypes,\n};\n"],"names":["permissions","metrics","localizations","locales","sanitize","isoLocales","contentTypes"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../server/src/services/index.ts"],"sourcesContent":["import permissions from './permissions';\nimport metrics from './metrics';\nimport localizations from './localizations';\nimport locales from './locales';\nimport isoLocales from './iso-locales';\nimport contentTypes from './content-types';\nimport sanitize from './sanitize';\nimport { createSettingsService } from './settings';\nimport { createAILocalizationsService } from './ai-localizations';\nimport { createAILocalizationJobsService } from './ai-localization-jobs';\n\nexport default {\n permissions,\n metrics,\n localizations,\n locales,\n sanitize,\n 'iso-locales': isoLocales,\n 'content-types': contentTypes,\n 'ai-localizations': createAILocalizationsService,\n 'ai-localization-jobs': createAILocalizationJobsService,\n settings: createSettingsService,\n};\n"],"names":["permissions","metrics","localizations","locales","sanitize","isoLocales","contentTypes","createAILocalizationsService","createAILocalizationJobsService","settings","createSettingsService"],"mappings":";;;;;;;;;;;AAWA,eAAe;AACbA,IAAAA,WAAAA;AACAC,IAAAA,OAAAA;AACAC,IAAAA,aAAAA;AACAC,IAAAA,OAAAA;AACAC,IAAAA,QAAAA;IACA,aAAeC,EAAAA,iBAAAA;IACf,eAAiBC,EAAAA,YAAAA;IACjB,kBAAoBC,EAAAA,4BAAAA;IACpB,sBAAwBC,EAAAA,+BAAAA;IACxBC,QAAUC,EAAAA;AACZ,CAAE;;;;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const createSettingsService = ({ strapi })=>{
|
|
4
|
+
const settings = strapi.store({
|
|
5
|
+
type: 'plugin',
|
|
6
|
+
name: 'i18n',
|
|
7
|
+
key: 'settings'
|
|
8
|
+
});
|
|
9
|
+
async function getSettings() {
|
|
10
|
+
const res = await settings.get({});
|
|
11
|
+
return res;
|
|
12
|
+
}
|
|
13
|
+
function setSettings(value) {
|
|
14
|
+
return settings.set({
|
|
15
|
+
value
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
getSettings,
|
|
20
|
+
setSettings
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
exports.createSettingsService = createSettingsService;
|
|
25
|
+
//# sourceMappingURL=settings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings.js","sources":["../../../server/src/services/settings.ts"],"sourcesContent":["import type { Core } from '@strapi/types';\nimport type { Settings } from '../validation/settings';\n\nconst createSettingsService = ({ strapi }: { strapi: Core.Strapi }) => {\n const settings = strapi.store!({ type: 'plugin', name: 'i18n', key: 'settings' });\n\n async function getSettings() {\n const res = (await settings.get({})) as Settings | null;\n\n return res;\n }\n\n function setSettings(value: Settings) {\n return settings.set({ value });\n }\n\n return {\n getSettings,\n setSettings,\n };\n};\n\nexport { createSettingsService };\nexport type SettingsService = ReturnType<typeof createSettingsService>;\n"],"names":["createSettingsService","strapi","settings","store","type","name","key","getSettings","res","get","setSettings","value","set"],"mappings":";;AAGA,MAAMA,qBAAwB,GAAA,CAAC,EAAEC,MAAM,EAA2B,GAAA;IAChE,MAAMC,QAAAA,GAAWD,MAAOE,CAAAA,KAAK,CAAE;QAAEC,IAAM,EAAA,QAAA;QAAUC,IAAM,EAAA,MAAA;QAAQC,GAAK,EAAA;AAAW,KAAA,CAAA;IAE/E,eAAeC,WAAAA,GAAAA;AACb,QAAA,MAAMC,GAAO,GAAA,MAAMN,QAASO,CAAAA,GAAG,CAAC,EAAC,CAAA;QAEjC,OAAOD,GAAAA;AACT;AAEA,IAAA,SAASE,YAAYC,KAAe,EAAA;QAClC,OAAOT,QAAAA,CAASU,GAAG,CAAC;AAAED,YAAAA;AAAM,SAAA,CAAA;AAC9B;IAEA,OAAO;AACLJ,QAAAA,WAAAA;AACAG,QAAAA;AACF,KAAA;AACF;;;;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const createSettingsService = ({ strapi })=>{
|
|
2
|
+
const settings = strapi.store({
|
|
3
|
+
type: 'plugin',
|
|
4
|
+
name: 'i18n',
|
|
5
|
+
key: 'settings'
|
|
6
|
+
});
|
|
7
|
+
async function getSettings() {
|
|
8
|
+
const res = await settings.get({});
|
|
9
|
+
return res;
|
|
10
|
+
}
|
|
11
|
+
function setSettings(value) {
|
|
12
|
+
return settings.set({
|
|
13
|
+
value
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return {
|
|
17
|
+
getSettings,
|
|
18
|
+
setSettings
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { createSettingsService };
|
|
23
|
+
//# sourceMappingURL=settings.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings.mjs","sources":["../../../server/src/services/settings.ts"],"sourcesContent":["import type { Core } from '@strapi/types';\nimport type { Settings } from '../validation/settings';\n\nconst createSettingsService = ({ strapi }: { strapi: Core.Strapi }) => {\n const settings = strapi.store!({ type: 'plugin', name: 'i18n', key: 'settings' });\n\n async function getSettings() {\n const res = (await settings.get({})) as Settings | null;\n\n return res;\n }\n\n function setSettings(value: Settings) {\n return settings.set({ value });\n }\n\n return {\n getSettings,\n setSettings,\n };\n};\n\nexport { createSettingsService };\nexport type SettingsService = ReturnType<typeof createSettingsService>;\n"],"names":["createSettingsService","strapi","settings","store","type","name","key","getSettings","res","get","setSettings","value","set"],"mappings":"AAGA,MAAMA,qBAAwB,GAAA,CAAC,EAAEC,MAAM,EAA2B,GAAA;IAChE,MAAMC,QAAAA,GAAWD,MAAOE,CAAAA,KAAK,CAAE;QAAEC,IAAM,EAAA,QAAA;QAAUC,IAAM,EAAA,MAAA;QAAQC,GAAK,EAAA;AAAW,KAAA,CAAA;IAE/E,eAAeC,WAAAA,GAAAA;AACb,QAAA,MAAMC,GAAO,GAAA,MAAMN,QAASO,CAAAA,GAAG,CAAC,EAAC,CAAA;QAEjC,OAAOD,GAAAA;AACT;AAEA,IAAA,SAASE,YAAYC,KAAe,EAAA;QAClC,OAAOT,QAAAA,CAASU,GAAG,CAAC;AAAED,YAAAA;AAAM,SAAA,CAAA;AAC9B;IAEA,OAAO;AACLJ,QAAAA,WAAAA;AACAG,QAAAA;AACF,KAAA;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../../server/src/bootstrap.ts"],"names":[],"mappings":";AA4DA,
|
|
1
|
+
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../../server/src/bootstrap.ts"],"names":[],"mappings":";AA4DA,wBA0BE"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Core } from '@strapi/types';
|
|
2
|
+
declare const createAILocalizationJobsController: ({ strapi }: {
|
|
3
|
+
strapi: Core.Strapi;
|
|
4
|
+
}) => {
|
|
5
|
+
/**
|
|
6
|
+
* Get a job for a singleType using the contentType
|
|
7
|
+
* There is only 1 job per contentType
|
|
8
|
+
*/
|
|
9
|
+
getJobForSingleType(ctx: any): Promise<any>;
|
|
10
|
+
/**
|
|
11
|
+
* Get a job for a collectionType using the documentId
|
|
12
|
+
* There is only 1 job per documentId
|
|
13
|
+
*/
|
|
14
|
+
getJobForCollectionType(ctx: any): Promise<any>;
|
|
15
|
+
};
|
|
16
|
+
export default createAILocalizationJobsController;
|
|
17
|
+
//# sourceMappingURL=ai-localization-jobs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-localization-jobs.d.ts","sourceRoot":"","sources":["../../../../server/src/controllers/ai-localization-jobs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE1C,QAAA,MAAM,kCAAkC,eAAgB;IAAE,MAAM,EAAE,KAAK,MAAM,CAAA;CAAE;IAK3E;;;OAGG;6BAC4B,GAAG;IAkBlC;;;OAGG;iCACgC,GAAG;CAmBzC,CAAC;AAEF,eAAe,kCAAkC,CAAC"}
|
|
@@ -5,6 +5,16 @@ declare const _default: {
|
|
|
5
5
|
'content-types': {
|
|
6
6
|
getNonLocalizedAttributes(ctx: import("koa").Context): Promise<import("koa").Context | undefined>;
|
|
7
7
|
};
|
|
8
|
+
settings: {
|
|
9
|
+
updateSettings(ctx: import("koa").Context): Promise<void>;
|
|
10
|
+
getSettings(ctx: import("koa").Context): Promise<void>;
|
|
11
|
+
};
|
|
12
|
+
'ai-localization-jobs': ({ strapi }: {
|
|
13
|
+
strapi: import("@strapi/types/dist/core").Strapi;
|
|
14
|
+
}) => {
|
|
15
|
+
getJobForSingleType(ctx: any): Promise<any>;
|
|
16
|
+
getJobForCollectionType(ctx: any): Promise<any>;
|
|
17
|
+
};
|
|
8
18
|
};
|
|
9
19
|
export default _default;
|
|
10
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/src/controllers/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/src/controllers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAMA,wBAME"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../../server/src/controllers/settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;;wBAMP,OAAO;qBAYV,OAAO;;AAbhC,wBAkBE"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
declare const _default: () => {
|
|
4
4
|
register: ({ strapi }: {
|
|
5
5
|
strapi: import("@strapi/types/dist/core").Strapi;
|
|
6
|
-
}) => void
|
|
6
|
+
}) => Promise<void>;
|
|
7
7
|
bootstrap: () => Promise<void>;
|
|
8
8
|
routes: {
|
|
9
9
|
admin: {
|
|
@@ -33,6 +33,16 @@ declare const _default: () => {
|
|
|
33
33
|
'content-types': {
|
|
34
34
|
getNonLocalizedAttributes(ctx: import("koa").Context): Promise<import("koa").Context | undefined>;
|
|
35
35
|
};
|
|
36
|
+
settings: {
|
|
37
|
+
updateSettings(ctx: import("koa").Context): Promise<void>;
|
|
38
|
+
getSettings(ctx: import("koa").Context): Promise<void>;
|
|
39
|
+
};
|
|
40
|
+
'ai-localization-jobs': ({ strapi }: {
|
|
41
|
+
strapi: import("@strapi/types/dist/core").Strapi;
|
|
42
|
+
}) => {
|
|
43
|
+
getJobForSingleType(ctx: any): Promise<any>;
|
|
44
|
+
getJobForCollectionType(ctx: any): Promise<any>;
|
|
45
|
+
};
|
|
36
46
|
};
|
|
37
47
|
contentTypes: {
|
|
38
48
|
locale: {
|
|
@@ -146,6 +156,39 @@ declare const _default: () => {
|
|
|
146
156
|
fillNonLocalizedAttributes: (entry: any, relatedEntry: any, { model }: any) => void;
|
|
147
157
|
getNestedPopulateOfNonLocalizedAttributes: (modelUID: any) => string[];
|
|
148
158
|
};
|
|
159
|
+
'ai-localizations': ({ strapi }: {
|
|
160
|
+
strapi: import("@strapi/types/dist/core").Strapi;
|
|
161
|
+
}) => {
|
|
162
|
+
isEnabled(): Promise<boolean>;
|
|
163
|
+
generateDocumentLocalizations({ model, document, }: {
|
|
164
|
+
model: import("@strapi/types/dist/uid").ContentType;
|
|
165
|
+
document: import("@strapi/types/dist/modules/documents").AnyDocument;
|
|
166
|
+
}): Promise<void>;
|
|
167
|
+
setupMiddleware(): void;
|
|
168
|
+
};
|
|
169
|
+
'ai-localization-jobs': ({ strapi }: {
|
|
170
|
+
strapi: import("@strapi/types/dist/core").Strapi;
|
|
171
|
+
}) => {
|
|
172
|
+
upsertJobForDocument({ documentId, contentType, sourceLocale, targetLocales, status, }: {
|
|
173
|
+
documentId: string;
|
|
174
|
+
contentType: string;
|
|
175
|
+
sourceLocale: string;
|
|
176
|
+
targetLocales: string[];
|
|
177
|
+
status?: "processing" | "completed" | "failed" | undefined;
|
|
178
|
+
}): Promise<any>;
|
|
179
|
+
getJobByDocument(contentType: string, documentId: string): Promise<any>;
|
|
180
|
+
getJobByContentType(contentType: string): Promise<any>;
|
|
181
|
+
};
|
|
182
|
+
settings: ({ strapi }: {
|
|
183
|
+
strapi: import("@strapi/types/dist/core").Strapi;
|
|
184
|
+
}) => {
|
|
185
|
+
getSettings: () => Promise<import("yup/lib/object").AssertsShape<{
|
|
186
|
+
aiLocalizations: import("yup").BooleanSchema<boolean, Record<string, any>, boolean>;
|
|
187
|
+
}> | null>;
|
|
188
|
+
setSettings: (value: import("yup/lib/object").AssertsShape<{
|
|
189
|
+
aiLocalizations: import("yup").BooleanSchema<boolean, Record<string, any>, boolean>;
|
|
190
|
+
}>) => Promise<void>;
|
|
191
|
+
};
|
|
149
192
|
};
|
|
150
193
|
};
|
|
151
194
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../server/src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../server/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,wBAOG"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Model } from '@strapi/database';
|
|
2
|
+
declare const AI_LOCALIZATION_JOB_UID = "plugin::i18n.ai-localization-job";
|
|
3
|
+
declare const aiLocalizationJob: Model;
|
|
4
|
+
export { aiLocalizationJob, AI_LOCALIZATION_JOB_UID };
|
|
5
|
+
//# sourceMappingURL=ai-localization-job.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-localization-job.d.ts","sourceRoot":"","sources":["../../../../server/src/models/ai-localization-job.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C,QAAA,MAAM,uBAAuB,qCAAqC,CAAC;AAEnE,QAAA,MAAM,iBAAiB,EAAE,KAsCxB,CAAC;AAEF,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/src/models/index.ts"],"names":[],"mappings":";;;AAEA,wBAEE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../server/src/register.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../server/src/register.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;qCAOR;IAAE,MAAM,EAAE,KAAK,MAAM,CAAA;CAAE;AAAzD,wBAKE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../../../../server/src/routes/admin.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../../../../server/src/routes/admin.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wBA4GE"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Core } from '@strapi/types';
|
|
2
|
+
import type { AILocalizationJobs } from '../../../shared/contracts/ai-localization-jobs';
|
|
3
|
+
export declare const createAILocalizationJobsService: ({ strapi }: {
|
|
4
|
+
strapi: Core.Strapi;
|
|
5
|
+
}) => {
|
|
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
|
+
*/
|
|
10
|
+
upsertJobForDocument({ documentId, contentType, sourceLocale, targetLocales, status, }: {
|
|
11
|
+
documentId: string;
|
|
12
|
+
contentType: string;
|
|
13
|
+
sourceLocale: string;
|
|
14
|
+
targetLocales: string[];
|
|
15
|
+
status?: AILocalizationJobs['status'];
|
|
16
|
+
}): Promise<any>;
|
|
17
|
+
/**
|
|
18
|
+
* Get job by document ID
|
|
19
|
+
*/
|
|
20
|
+
getJobByDocument(contentType: string, documentId: string): Promise<any>;
|
|
21
|
+
/**
|
|
22
|
+
* Get job by content type
|
|
23
|
+
*/
|
|
24
|
+
getJobByContentType(contentType: string): Promise<any>;
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=ai-localization-jobs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-localization-jobs.d.ts","sourceRoot":"","sources":["../../../../server/src/services/ai-localization-jobs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AAEzF,eAAO,MAAM,+BAA+B,eAAgB;IAAE,MAAM,EAAE,KAAK,MAAM,CAAA;CAAE;IACjF;;;OAGG;4FAOA;QACD,UAAU,EAAE,MAAM,CAAC;QACnB,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,MAAM,CAAC;QACrB,aAAa,EAAE,MAAM,EAAE,CAAC;QACxB,MAAM,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC;KACvC;IAsCD;;OAEG;kCACiC,MAAM,cAAc,MAAM;IAS9D;;OAEG;qCACoC,MAAM;CAO7C,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Core, Modules, UID } from '@strapi/types';
|
|
2
|
+
declare const createAILocalizationsService: ({ strapi }: {
|
|
3
|
+
strapi: Core.Strapi;
|
|
4
|
+
}) => {
|
|
5
|
+
isEnabled(): Promise<boolean>;
|
|
6
|
+
/**
|
|
7
|
+
* Checks if there are localizations that need to be generated for the given document,
|
|
8
|
+
* and if so, calls the AI service and saves the results to the database.
|
|
9
|
+
* Works for both single and collection types, on create and update.
|
|
10
|
+
*/
|
|
11
|
+
generateDocumentLocalizations({ model, document, }: {
|
|
12
|
+
model: UID.ContentType;
|
|
13
|
+
document: Modules.Documents.AnyDocument;
|
|
14
|
+
}): Promise<void>;
|
|
15
|
+
setupMiddleware(): void;
|
|
16
|
+
};
|
|
17
|
+
export { createAILocalizationsService };
|
|
18
|
+
//# sourceMappingURL=ai-localizations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-localizations.d.ts","sourceRoot":"","sources":["../../../../server/src/services/ai-localizations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAIxD,QAAA,MAAM,4BAA4B,eAAgB;IAAE,MAAM,EAAE,KAAK,MAAM,CAAA;CAAE;;IAmCrE;;;;OAIG;wDAIA;QACD,KAAK,EAAE,IAAI,WAAW,CAAC;QACvB,QAAQ,EAAE,QAAQ,SAAS,CAAC,WAAW,CAAC;KACzC;;CAwMJ,CAAC;AAEF,OAAO,EAAE,4BAA4B,EAAE,CAAC"}
|
|
@@ -76,6 +76,39 @@ declare const _default: {
|
|
|
76
76
|
fillNonLocalizedAttributes: (entry: any, relatedEntry: any, { model }: any) => void;
|
|
77
77
|
getNestedPopulateOfNonLocalizedAttributes: (modelUID: any) => string[];
|
|
78
78
|
};
|
|
79
|
+
'ai-localizations': ({ strapi }: {
|
|
80
|
+
strapi: import("@strapi/types/dist/core").Strapi;
|
|
81
|
+
}) => {
|
|
82
|
+
isEnabled(): Promise<boolean>;
|
|
83
|
+
generateDocumentLocalizations({ model, document, }: {
|
|
84
|
+
model: import("@strapi/types/dist/uid").ContentType;
|
|
85
|
+
document: import("@strapi/types/dist/modules/documents").AnyDocument;
|
|
86
|
+
}): Promise<void>;
|
|
87
|
+
setupMiddleware(): void;
|
|
88
|
+
};
|
|
89
|
+
'ai-localization-jobs': ({ strapi }: {
|
|
90
|
+
strapi: import("@strapi/types/dist/core").Strapi;
|
|
91
|
+
}) => {
|
|
92
|
+
upsertJobForDocument({ documentId, contentType, sourceLocale, targetLocales, status, }: {
|
|
93
|
+
documentId: string;
|
|
94
|
+
contentType: string;
|
|
95
|
+
sourceLocale: string;
|
|
96
|
+
targetLocales: string[];
|
|
97
|
+
status?: "processing" | "completed" | "failed" | undefined;
|
|
98
|
+
}): Promise<any>;
|
|
99
|
+
getJobByDocument(contentType: string, documentId: string): Promise<any>;
|
|
100
|
+
getJobByContentType(contentType: string): Promise<any>;
|
|
101
|
+
};
|
|
102
|
+
settings: ({ strapi }: {
|
|
103
|
+
strapi: import("@strapi/types/dist/core").Strapi;
|
|
104
|
+
}) => {
|
|
105
|
+
getSettings: () => Promise<import("yup/lib/object").AssertsShape<{
|
|
106
|
+
aiLocalizations: import("yup").BooleanSchema<boolean, Record<string, any>, boolean>;
|
|
107
|
+
}> | null>;
|
|
108
|
+
setSettings: (value: import("yup/lib/object").AssertsShape<{
|
|
109
|
+
aiLocalizations: import("yup").BooleanSchema<boolean, Record<string, any>, boolean>;
|
|
110
|
+
}>) => Promise<void>;
|
|
111
|
+
};
|
|
79
112
|
};
|
|
80
113
|
export default _default;
|
|
81
114
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/src/services/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/src/services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,wBAWE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Core } from '@strapi/types';
|
|
2
|
+
import type { Settings } from '../validation/settings';
|
|
3
|
+
declare const createSettingsService: ({ strapi }: {
|
|
4
|
+
strapi: Core.Strapi;
|
|
5
|
+
}) => {
|
|
6
|
+
getSettings: () => Promise<import("yup/lib/object").AssertsShape<{
|
|
7
|
+
aiLocalizations: import("yup").BooleanSchema<boolean, Record<string, any>, boolean>;
|
|
8
|
+
}> | null>;
|
|
9
|
+
setSettings: (value: Settings) => Promise<void>;
|
|
10
|
+
};
|
|
11
|
+
export { createSettingsService };
|
|
12
|
+
export type SettingsService = ReturnType<typeof createSettingsService>;
|
|
13
|
+
//# sourceMappingURL=settings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../../server/src/services/settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAEvD,QAAA,MAAM,qBAAqB,eAAgB;IAAE,MAAM,EAAE,KAAK,MAAM,CAAA;CAAE;;;;yBASpC,QAAQ;CAQrC,CAAC;AAEF,OAAO,EAAE,qBAAqB,EAAE,CAAC;AACjC,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
|
@@ -5,14 +5,20 @@ import type { MetricsService } from '../services/metrics';
|
|
|
5
5
|
import type { ISOLocalesService } from '../services/iso-locales';
|
|
6
6
|
import type { LocalizationsService } from '../services/localizations';
|
|
7
7
|
import type { SanitizeService } from '../services/sanitize';
|
|
8
|
+
import type { SettingsService } from '../services/settings';
|
|
9
|
+
import type { createAILocalizationsService } from '../services/ai-localizations';
|
|
10
|
+
import type { createAILocalizationJobsService } from '../services/ai-localization-jobs';
|
|
8
11
|
type S = {
|
|
9
12
|
permissions: PermissionsService;
|
|
10
13
|
metrics: MetricsService;
|
|
11
14
|
locales: LocaleService;
|
|
12
15
|
localizations: LocalizationsService;
|
|
16
|
+
settings: SettingsService;
|
|
13
17
|
['iso-locales']: ISOLocalesService;
|
|
14
18
|
['content-types']: ContentTypesService;
|
|
15
19
|
sanitize: SanitizeService;
|
|
20
|
+
['ai-localizations']: ReturnType<typeof createAILocalizationsService>;
|
|
21
|
+
'ai-localization-jobs': ReturnType<typeof createAILocalizationJobsService>;
|
|
16
22
|
};
|
|
17
23
|
declare const getCoreStore: () => {
|
|
18
24
|
get(params?: Partial<{
|
|
@@ -38,6 +44,6 @@ declare const getCoreStore: () => {
|
|
|
38
44
|
tag?: string | undefined;
|
|
39
45
|
}> | undefined): Promise<void>;
|
|
40
46
|
};
|
|
41
|
-
declare const getService: <T extends keyof S>(name: T) => ReturnType<S[T]
|
|
47
|
+
declare const getService: <T extends keyof S>(name: T) => S[T] extends (...args: any) => any ? ReturnType<S[T]> : S[T];
|
|
42
48
|
export { getService, getCoreStore };
|
|
43
49
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,8BAA8B,CAAC;AACjF,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,kCAAkC,CAAC;AAExF,KAAK,CAAC,GAAG;IACP,WAAW,EAAE,kBAAkB,CAAC;IAChC,OAAO,EAAE,cAAc,CAAC;IACxB,OAAO,EAAE,aAAa,CAAC;IACvB,aAAa,EAAE,oBAAoB,CAAC;IACpC,QAAQ,EAAE,eAAe,CAAC;IAC1B,CAAC,aAAa,CAAC,EAAE,iBAAiB,CAAC;IACnC,CAAC,eAAe,CAAC,EAAE,mBAAmB,CAAC;IACvC,QAAQ,EAAE,eAAe,CAAC;IAC1B,CAAC,kBAAkB,CAAC,EAAE,UAAU,CAAC,OAAO,4BAA4B,CAAC,CAAC;IACtE,sBAAsB,EAAE,UAAU,CAAC,OAAO,+BAA+B,CAAC,CAAC;CAC5E,CAAC;AAEF,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;CAEjB,CAAC;AAGF,QAAA,MAAM,UAAU,4BACR,CAAC,KACN,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAE7D,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { yup } from '@strapi/utils';
|
|
2
|
+
declare const settingsSchema: import("yup/lib/object").OptionalObjectSchema<{
|
|
3
|
+
aiLocalizations: yup.BooleanSchema<boolean, Record<string, any>, boolean>;
|
|
4
|
+
}, Record<string, any>, import("yup/lib/object").TypeOfShape<{
|
|
5
|
+
aiLocalizations: yup.BooleanSchema<boolean, Record<string, any>, boolean>;
|
|
6
|
+
}>>;
|
|
7
|
+
declare const _default: (body: unknown, errorMessage?: string | undefined) => Promise<import("yup/lib/object").AssertsShape<{
|
|
8
|
+
aiLocalizations: yup.BooleanSchema<boolean, Record<string, any>, boolean>;
|
|
9
|
+
}>>;
|
|
10
|
+
export default _default;
|
|
11
|
+
export type Settings = yup.InferType<typeof settingsSchema>;
|
|
12
|
+
//# sourceMappingURL=settings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../../server/src/validation/settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAqB,MAAM,eAAe,CAAC;AAEvD,QAAA,MAAM,cAAc;;;;GAElB,CAAC;;;;AAEH,wBAAiD;AAEjD,MAAM,MAAM,QAAQ,GAAG,GAAG,CAAC,SAAS,CAAC,OAAO,cAAc,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../server/src/utils/index.ts"],"sourcesContent":["import type { LocaleService } from '../services/locales';\nimport type { PermissionsService } from '../services/permissions';\nimport type { ContentTypesService } from '../services/content-types';\nimport type { MetricsService } from '../services/metrics';\nimport type { ISOLocalesService } from '../services/iso-locales';\nimport type { LocalizationsService } from '../services/localizations';\nimport type { SanitizeService } from '../services/sanitize';\n\ntype S = {\n permissions: PermissionsService;\n metrics: MetricsService;\n locales: LocaleService;\n localizations: LocalizationsService;\n ['iso-locales']: ISOLocalesService;\n ['content-types']: ContentTypesService;\n sanitize: SanitizeService;\n};\n\nconst getCoreStore = () => {\n return strapi.store({ type: 'plugin', name: 'i18n' });\n};\n\n// retrieve a local service\nconst getService = <T extends keyof S>(name: T): ReturnType<S[T]> => {\n return strapi.plugin('i18n').service(name);\n};\n\nexport { getService, getCoreStore };\n"],"names":["getCoreStore","strapi","store","type","name","getService","plugin","service"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../server/src/utils/index.ts"],"sourcesContent":["import type { LocaleService } from '../services/locales';\nimport type { PermissionsService } from '../services/permissions';\nimport type { ContentTypesService } from '../services/content-types';\nimport type { MetricsService } from '../services/metrics';\nimport type { ISOLocalesService } from '../services/iso-locales';\nimport type { LocalizationsService } from '../services/localizations';\nimport type { SanitizeService } from '../services/sanitize';\nimport type { SettingsService } from '../services/settings';\nimport type { createAILocalizationsService } from '../services/ai-localizations';\nimport type { createAILocalizationJobsService } from '../services/ai-localization-jobs';\n\ntype S = {\n permissions: PermissionsService;\n metrics: MetricsService;\n locales: LocaleService;\n localizations: LocalizationsService;\n settings: SettingsService;\n ['iso-locales']: ISOLocalesService;\n ['content-types']: ContentTypesService;\n sanitize: SanitizeService;\n ['ai-localizations']: ReturnType<typeof createAILocalizationsService>;\n 'ai-localization-jobs': ReturnType<typeof createAILocalizationJobsService>;\n};\n\nconst getCoreStore = () => {\n return strapi.store({ type: 'plugin', name: 'i18n' });\n};\n\n// retrieve a local service\nconst getService = <T extends keyof S>(\n name: T\n): S[T] extends (...args: any) => any ? ReturnType<S[T]> : S[T] => {\n return strapi.plugin('i18n').service(name);\n};\n\nexport { getService, getCoreStore };\n"],"names":["getCoreStore","strapi","store","type","name","getService","plugin","service"],"mappings":";;AAwBA,MAAMA,YAAe,GAAA,IAAA;IACnB,OAAOC,MAAAA,CAAOC,KAAK,CAAC;QAAEC,IAAM,EAAA,QAAA;QAAUC,IAAM,EAAA;AAAO,KAAA,CAAA;AACrD;AAEA;AACA,MAAMC,aAAa,CACjBD,IAAAA,GAAAA;AAEA,IAAA,OAAOH,MAAOK,CAAAA,MAAM,CAAC,MAAA,CAAA,CAAQC,OAAO,CAACH,IAAAA,CAAAA;AACvC;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../server/src/utils/index.ts"],"sourcesContent":["import type { LocaleService } from '../services/locales';\nimport type { PermissionsService } from '../services/permissions';\nimport type { ContentTypesService } from '../services/content-types';\nimport type { MetricsService } from '../services/metrics';\nimport type { ISOLocalesService } from '../services/iso-locales';\nimport type { LocalizationsService } from '../services/localizations';\nimport type { SanitizeService } from '../services/sanitize';\n\ntype S = {\n permissions: PermissionsService;\n metrics: MetricsService;\n locales: LocaleService;\n localizations: LocalizationsService;\n ['iso-locales']: ISOLocalesService;\n ['content-types']: ContentTypesService;\n sanitize: SanitizeService;\n};\n\nconst getCoreStore = () => {\n return strapi.store({ type: 'plugin', name: 'i18n' });\n};\n\n// retrieve a local service\nconst getService = <T extends keyof S>(name: T): ReturnType<S[T]> => {\n return strapi.plugin('i18n').service(name);\n};\n\nexport { getService, getCoreStore };\n"],"names":["getCoreStore","strapi","store","type","name","getService","plugin","service"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../server/src/utils/index.ts"],"sourcesContent":["import type { LocaleService } from '../services/locales';\nimport type { PermissionsService } from '../services/permissions';\nimport type { ContentTypesService } from '../services/content-types';\nimport type { MetricsService } from '../services/metrics';\nimport type { ISOLocalesService } from '../services/iso-locales';\nimport type { LocalizationsService } from '../services/localizations';\nimport type { SanitizeService } from '../services/sanitize';\nimport type { SettingsService } from '../services/settings';\nimport type { createAILocalizationsService } from '../services/ai-localizations';\nimport type { createAILocalizationJobsService } from '../services/ai-localization-jobs';\n\ntype S = {\n permissions: PermissionsService;\n metrics: MetricsService;\n locales: LocaleService;\n localizations: LocalizationsService;\n settings: SettingsService;\n ['iso-locales']: ISOLocalesService;\n ['content-types']: ContentTypesService;\n sanitize: SanitizeService;\n ['ai-localizations']: ReturnType<typeof createAILocalizationsService>;\n 'ai-localization-jobs': ReturnType<typeof createAILocalizationJobsService>;\n};\n\nconst getCoreStore = () => {\n return strapi.store({ type: 'plugin', name: 'i18n' });\n};\n\n// retrieve a local service\nconst getService = <T extends keyof S>(\n name: T\n): S[T] extends (...args: any) => any ? ReturnType<S[T]> : S[T] => {\n return strapi.plugin('i18n').service(name);\n};\n\nexport { getService, getCoreStore };\n"],"names":["getCoreStore","strapi","store","type","name","getService","plugin","service"],"mappings":"AAwBA,MAAMA,YAAe,GAAA,IAAA;IACnB,OAAOC,MAAAA,CAAOC,KAAK,CAAC;QAAEC,IAAM,EAAA,QAAA;QAAUC,IAAM,EAAA;AAAO,KAAA,CAAA;AACrD;AAEA;AACA,MAAMC,aAAa,CACjBD,IAAAA,GAAAA;AAEA,IAAA,OAAOH,MAAOK,CAAAA,MAAM,CAAC,MAAA,CAAA,CAAQC,OAAO,CAACH,IAAAA,CAAAA;AACvC;;;;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var utils = require('@strapi/utils');
|
|
4
|
+
|
|
5
|
+
const settingsSchema = utils.yup.object({
|
|
6
|
+
aiLocalizations: utils.yup.boolean().default(false)
|
|
7
|
+
});
|
|
8
|
+
var validateSettings = utils.validateYupSchema(settingsSchema);
|
|
9
|
+
|
|
10
|
+
module.exports = validateSettings;
|
|
11
|
+
//# sourceMappingURL=settings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings.js","sources":["../../../server/src/validation/settings.ts"],"sourcesContent":["import { yup, validateYupSchema } from '@strapi/utils';\n\nconst settingsSchema = yup.object({\n aiLocalizations: yup.boolean().default(false),\n});\n\nexport default validateYupSchema(settingsSchema);\n\nexport type Settings = yup.InferType<typeof settingsSchema>;\n"],"names":["settingsSchema","yup","object","aiLocalizations","boolean","default","validateYupSchema"],"mappings":";;;;AAEA,MAAMA,cAAAA,GAAiBC,SAAIC,CAAAA,MAAM,CAAC;AAChCC,IAAAA,eAAAA,EAAiBF,SAAIG,CAAAA,OAAO,EAAGC,CAAAA,OAAO,CAAC,KAAA;AACzC,CAAA,CAAA;AAEA,uBAAeC,wBAAkBN,cAAgB,CAAA;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { yup, validateYupSchema } from '@strapi/utils';
|
|
2
|
+
|
|
3
|
+
const settingsSchema = yup.object({
|
|
4
|
+
aiLocalizations: yup.boolean().default(false)
|
|
5
|
+
});
|
|
6
|
+
var validateSettings = validateYupSchema(settingsSchema);
|
|
7
|
+
|
|
8
|
+
export { validateSettings as default };
|
|
9
|
+
//# sourceMappingURL=settings.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings.mjs","sources":["../../../server/src/validation/settings.ts"],"sourcesContent":["import { yup, validateYupSchema } from '@strapi/utils';\n\nconst settingsSchema = yup.object({\n aiLocalizations: yup.boolean().default(false),\n});\n\nexport default validateYupSchema(settingsSchema);\n\nexport type Settings = yup.InferType<typeof settingsSchema>;\n"],"names":["settingsSchema","yup","object","aiLocalizations","boolean","default","validateYupSchema"],"mappings":";;AAEA,MAAMA,cAAAA,GAAiBC,GAAIC,CAAAA,MAAM,CAAC;AAChCC,IAAAA,eAAAA,EAAiBF,GAAIG,CAAAA,OAAO,EAAGC,CAAAA,OAAO,CAAC,KAAA;AACzC,CAAA,CAAA;AAEA,uBAAeC,kBAAkBN,cAAgB,CAAA;;;;"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { errors } from '@strapi/utils';
|
|
2
|
+
import { Entity } from './shared';
|
|
3
|
+
export interface AILocalizationJobs extends Entity {
|
|
4
|
+
contentType: string;
|
|
5
|
+
relatedDocumentId: string;
|
|
6
|
+
sourceLocale: string;
|
|
7
|
+
targetLocales: string[];
|
|
8
|
+
status: 'processing' | 'completed' | 'failed';
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* GET /i18n/ai-localization-jobs/document/:documentId - Get AI localization jobs by document ID
|
|
12
|
+
*/
|
|
13
|
+
export declare namespace GetAILocalizationJobsByDocument {
|
|
14
|
+
interface Request {
|
|
15
|
+
query: {};
|
|
16
|
+
body: {};
|
|
17
|
+
}
|
|
18
|
+
interface Params {
|
|
19
|
+
documentId: string;
|
|
20
|
+
}
|
|
21
|
+
type Response = {
|
|
22
|
+
data: AILocalizationJobs;
|
|
23
|
+
} | {
|
|
24
|
+
data: null;
|
|
25
|
+
error: errors.ApplicationError;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-localization-jobs.d.ts","sourceRoot":"","sources":["../../../shared/contracts/ai-localization-jobs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,WAAW,kBAAmB,SAAQ,MAAM;IAChD,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,MAAM,EAAE,YAAY,GAAG,WAAW,GAAG,QAAQ,CAAC;CAC/C;AAED;;GAEG;AACH,MAAM,CAAC,OAAO,WAAW,+BAA+B,CAAC;IACvD,UAAiB,OAAO;QACtB,KAAK,EAAE,EAAE,CAAC;QACV,IAAI,EAAE,EAAE,CAAC;KACV;IAED,UAAiB,MAAM;QACrB,UAAU,EAAE,MAAM,CAAC;KACpB;IAED,KAAY,QAAQ,GAChB;QACE,IAAI,EAAE,kBAAkB,CAAC;KAC1B,GACD;QACE,IAAI,EAAE,IAAI,CAAC;QACX,KAAK,EAAE,MAAM,CAAC,gBAAgB,CAAC;KAChC,CAAC;CACP"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Used to store user configurations related to i18n.
|
|
3
|
+
* E.g the AI metadata flag for automatic translations.
|
|
4
|
+
*/
|
|
5
|
+
import { errors } from '@strapi/utils';
|
|
6
|
+
import type { Utils } from '@strapi/types';
|
|
7
|
+
export interface Settings {
|
|
8
|
+
data: {
|
|
9
|
+
aiLocalizations?: boolean;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export type SettingsData = Settings['data'];
|
|
13
|
+
/**
|
|
14
|
+
* GET /i18n/settings
|
|
15
|
+
*
|
|
16
|
+
* Return the stored settings for the i18n plugin.
|
|
17
|
+
*/
|
|
18
|
+
export declare namespace GetSettings {
|
|
19
|
+
interface Request {
|
|
20
|
+
query?: {};
|
|
21
|
+
}
|
|
22
|
+
interface Response {
|
|
23
|
+
data: Settings;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* PUT /i18n/settings
|
|
28
|
+
*
|
|
29
|
+
* Update the stored settings
|
|
30
|
+
*/
|
|
31
|
+
export declare namespace UpdateSettings {
|
|
32
|
+
interface Request {
|
|
33
|
+
body: Settings['data'];
|
|
34
|
+
}
|
|
35
|
+
type Response = Utils.OneOf<{
|
|
36
|
+
data: Settings['data'];
|
|
37
|
+
}, {
|
|
38
|
+
error?: errors.ApplicationError | errors.ValidationError;
|
|
39
|
+
}>;
|
|
40
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../shared/contracts/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE1C,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,IAAI,CAAC,EAAE,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB"}
|