@strapi/i18n 0.0.0-next.86f7c82a340bd1cb833f5f785b8001df5461c5a9 → 0.0.0-next.88599e70ce0e4e804e2bad578aba4718c5a5304d
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 +116 -1
- package/dist/admin/components/CMHeaderActions.js.map +1 -1
- package/dist/admin/components/CMHeaderActions.mjs +119 -5
- package/dist/admin/components/CMHeaderActions.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/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/api.js +2 -1
- package/dist/admin/services/api.js.map +1 -1
- package/dist/admin/services/api.mjs +2 -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/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 +7 -0
- package/dist/admin/translations/en.json.js.map +1 -1
- package/dist/admin/translations/en.json.mjs +7 -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/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/index.js +3 -1
- package/dist/server/controllers/index.js.map +1 -1
- package/dist/server/controllers/index.mjs +3 -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/routes/admin.js +20 -0
- package/dist/server/routes/admin.js.map +1 -1
- package/dist/server/routes/admin.mjs +20 -0
- package/dist/server/routes/admin.mjs.map +1 -1
- package/dist/server/services/ai-localizations.js +28 -0
- package/dist/server/services/ai-localizations.js.map +1 -0
- package/dist/server/services/ai-localizations.mjs +26 -0
- package/dist/server/services/ai-localizations.mjs.map +1 -0
- package/dist/server/services/index.js +5 -1
- package/dist/server/services/index.js.map +1 -1
- package/dist/server/services/index.mjs +5 -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/controllers/index.d.ts +4 -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 +19 -0
- package/dist/server/src/index.d.ts.map +1 -1
- package/dist/server/src/routes/admin.d.ts.map +1 -1
- package/dist/server/src/services/ai-localizations.d.ts +8 -0
- package/dist/server/src/services/ai-localizations.d.ts.map +1 -0
- package/dist/server/src/services/index.d.ts +15 -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 +3 -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/settings.d.ts +40 -0
- package/package.json +9 -8
|
@@ -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;;;;"}
|
|
@@ -5,6 +5,10 @@ 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
|
+
};
|
|
8
12
|
};
|
|
9
13
|
export default _default;
|
|
10
14
|
//# 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":";;;;;;;;;;;;AAKA,wBAKE"}
|
|
@@ -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"}
|
|
@@ -33,6 +33,10 @@ 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
|
+
};
|
|
36
40
|
};
|
|
37
41
|
contentTypes: {
|
|
38
42
|
locale: {
|
|
@@ -146,6 +150,21 @@ declare const _default: () => {
|
|
|
146
150
|
fillNonLocalizedAttributes: (entry: any, relatedEntry: any, { model }: any) => void;
|
|
147
151
|
getNestedPopulateOfNonLocalizedAttributes: (modelUID: any) => string[];
|
|
148
152
|
};
|
|
153
|
+
aiLocalizations: ({ strapi }: {
|
|
154
|
+
strapi: import("@strapi/types/dist/core").Strapi;
|
|
155
|
+
}) => {
|
|
156
|
+
isEnabled(): Promise<boolean>;
|
|
157
|
+
};
|
|
158
|
+
settings: ({ strapi }: {
|
|
159
|
+
strapi: import("@strapi/types/dist/core").Strapi;
|
|
160
|
+
}) => {
|
|
161
|
+
getSettings: () => Promise<import("yup/lib/object").AssertsShape<{
|
|
162
|
+
aiLocalizations: import("yup").BooleanSchema<boolean, Record<string, any>, boolean>;
|
|
163
|
+
}> | null>;
|
|
164
|
+
setSettings: (value: import("yup/lib/object").AssertsShape<{
|
|
165
|
+
aiLocalizations: import("yup").BooleanSchema<boolean, Record<string, any>, boolean>;
|
|
166
|
+
}>) => Promise<void>;
|
|
167
|
+
};
|
|
149
168
|
};
|
|
150
169
|
};
|
|
151
170
|
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"}
|
|
@@ -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,wBA4FE"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Core } from '@strapi/types';
|
|
2
|
+
declare const createAILocalizationsService: ({ strapi }: {
|
|
3
|
+
strapi: Core.Strapi;
|
|
4
|
+
}) => {
|
|
5
|
+
isEnabled(): Promise<boolean>;
|
|
6
|
+
};
|
|
7
|
+
export { createAILocalizationsService };
|
|
8
|
+
//# 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,MAAM,eAAe,CAAC;AAE1C,QAAA,MAAM,4BAA4B,eAAgB;IAAE,MAAM,EAAE,KAAK,MAAM,CAAA;CAAE;;CAyBxE,CAAC;AAEF,OAAO,EAAE,4BAA4B,EAAE,CAAC"}
|
|
@@ -76,6 +76,21 @@ declare const _default: {
|
|
|
76
76
|
fillNonLocalizedAttributes: (entry: any, relatedEntry: any, { model }: any) => void;
|
|
77
77
|
getNestedPopulateOfNonLocalizedAttributes: (modelUID: any) => string[];
|
|
78
78
|
};
|
|
79
|
+
aiLocalizations: ({ strapi }: {
|
|
80
|
+
strapi: import("@strapi/types/dist/core").Strapi;
|
|
81
|
+
}) => {
|
|
82
|
+
isEnabled(): Promise<boolean>;
|
|
83
|
+
};
|
|
84
|
+
settings: ({ strapi }: {
|
|
85
|
+
strapi: import("@strapi/types/dist/core").Strapi;
|
|
86
|
+
}) => {
|
|
87
|
+
getSettings: () => Promise<import("yup/lib/object").AssertsShape<{
|
|
88
|
+
aiLocalizations: import("yup").BooleanSchema<boolean, Record<string, any>, boolean>;
|
|
89
|
+
}> | null>;
|
|
90
|
+
setSettings: (value: import("yup/lib/object").AssertsShape<{
|
|
91
|
+
aiLocalizations: import("yup").BooleanSchema<boolean, Record<string, any>, boolean>;
|
|
92
|
+
}>) => Promise<void>;
|
|
93
|
+
};
|
|
79
94
|
};
|
|
80
95
|
export default _default;
|
|
81
96
|
//# 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,wBAUE"}
|
|
@@ -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,11 +5,13 @@ 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';
|
|
8
9
|
type S = {
|
|
9
10
|
permissions: PermissionsService;
|
|
10
11
|
metrics: MetricsService;
|
|
11
12
|
locales: LocaleService;
|
|
12
13
|
localizations: LocalizationsService;
|
|
14
|
+
settings: SettingsService;
|
|
13
15
|
['iso-locales']: ISOLocalesService;
|
|
14
16
|
['content-types']: ContentTypesService;
|
|
15
17
|
sanitize: SanitizeService;
|
|
@@ -38,6 +40,6 @@ declare const getCoreStore: () => {
|
|
|
38
40
|
tag?: string | undefined;
|
|
39
41
|
}> | undefined): Promise<void>;
|
|
40
42
|
};
|
|
41
|
-
declare const getService: <T extends keyof S>(name: T) => ReturnType<S[T]
|
|
43
|
+
declare const getService: <T extends keyof S>(name: T) => S[T] extends (...args: any) => any ? ReturnType<S[T]> : S[T];
|
|
42
44
|
export { getService, getCoreStore };
|
|
43
45
|
//# 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;AAE5D,KAAK,CAAC,GAAG;IACP,WAAW,EAAE,kBAAkB,CAAC;IAChC,OAAO,EAAE,cAAc,CAAC;IACxB,OAAO,EAAE,aAAa,CAAC;IACvB,aAAa,EAAE,oBAAoB,CAAC;IACpC,CAAC,aAAa,CAAC,EAAE,iBAAiB,CAAC;IACnC,CAAC,eAAe,CAAC,EAAE,mBAAmB,CAAC;IACvC,QAAQ,EAAE,eAAe,CAAC;CAC3B,CAAC;AAEF,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;CAEjB,CAAC;AAGF,QAAA,MAAM,UAAU,
|
|
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;AAE5D,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;CAC3B,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';\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};\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":";;AAoBA,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';\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};\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":"AAoBA,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,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
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/i18n",
|
|
3
|
-
"version": "0.0.0-next.
|
|
3
|
+
"version": "0.0.0-next.88599e70ce0e4e804e2bad578aba4718c5a5304d",
|
|
4
4
|
"description": "Create read and update content in different languages, both from the Admin Panel and from the API",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -57,9 +57,9 @@
|
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@reduxjs/toolkit": "1.9.7",
|
|
60
|
-
"@strapi/design-system": "2.0.0-rc.
|
|
61
|
-
"@strapi/icons": "2.0.0-rc.
|
|
62
|
-
"@strapi/utils": "0.0.0-next.
|
|
60
|
+
"@strapi/design-system": "2.0.0-rc.30",
|
|
61
|
+
"@strapi/icons": "2.0.0-rc.30",
|
|
62
|
+
"@strapi/utils": "0.0.0-next.88599e70ce0e4e804e2bad578aba4718c5a5304d",
|
|
63
63
|
"lodash": "4.17.21",
|
|
64
64
|
"qs": "6.11.1",
|
|
65
65
|
"react-intl": "6.6.2",
|
|
@@ -68,12 +68,13 @@
|
|
|
68
68
|
"zod": "3.25.67"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
|
-
"@strapi/admin": "0.0.0-next.
|
|
72
|
-
"@strapi/admin-test-utils": "0.0.0-next.
|
|
73
|
-
"@strapi/content-manager": "0.0.0-next.
|
|
74
|
-
"@strapi/types": "0.0.0-next.
|
|
71
|
+
"@strapi/admin": "0.0.0-next.88599e70ce0e4e804e2bad578aba4718c5a5304d",
|
|
72
|
+
"@strapi/admin-test-utils": "0.0.0-next.88599e70ce0e4e804e2bad578aba4718c5a5304d",
|
|
73
|
+
"@strapi/content-manager": "0.0.0-next.88599e70ce0e4e804e2bad578aba4718c5a5304d",
|
|
74
|
+
"@strapi/types": "0.0.0-next.88599e70ce0e4e804e2bad578aba4718c5a5304d",
|
|
75
75
|
"@testing-library/react": "15.0.7",
|
|
76
76
|
"@testing-library/user-event": "14.5.2",
|
|
77
|
+
"koa": "2.16.1",
|
|
77
78
|
"msw": "1.3.0",
|
|
78
79
|
"react": "18.3.1",
|
|
79
80
|
"react-dom": "18.3.1",
|