@strapi/i18n 5.48.1 → 5.50.0
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 +3 -2
- package/dist/admin/components/CMHeaderActions.js.map +1 -1
- package/dist/admin/components/CheckboxConfirmation.js +3 -2
- package/dist/admin/components/CheckboxConfirmation.js.map +1 -1
- package/dist/admin/components/CreateLocale.js +4 -3
- package/dist/admin/components/CreateLocale.js.map +1 -1
- package/dist/admin/components/DeleteLocale.js +3 -2
- package/dist/admin/components/DeleteLocale.js.map +1 -1
- package/dist/admin/components/EditLocale.js +3 -2
- package/dist/admin/components/EditLocale.js.map +1 -1
- package/dist/admin/components/LocalePicker.js +3 -2
- package/dist/admin/components/LocalePicker.js.map +1 -1
- package/dist/admin/components/LocaleTable.js +3 -2
- package/dist/admin/components/LocaleTable.js.map +1 -1
- package/dist/admin/hooks/useAILocalizationJobsPolling.js +3 -2
- package/dist/admin/hooks/useAILocalizationJobsPolling.js.map +1 -1
- package/dist/admin/hooks/useI18n.js +7 -3
- package/dist/admin/hooks/useI18n.js.map +1 -1
- package/dist/admin/index.js +8 -3
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/index.mjs +1 -0
- package/dist/admin/index.mjs.map +1 -1
- package/dist/admin/middlewares/extendCTBAttributeInitialData.js +6 -2
- package/dist/admin/middlewares/extendCTBAttributeInitialData.js.map +1 -1
- package/dist/admin/middlewares/rbac-middleware.js +3 -2
- package/dist/admin/middlewares/rbac-middleware.js.map +1 -1
- package/dist/admin/src/contentReleasesHooks/releaseDetailsView.d.ts +1 -1
- package/dist/admin/src/services/relations.d.ts +2 -2
- package/dist/admin/src/services/settings.d.ts +1 -1
- package/dist/admin/src/utils/schemas.d.ts +6 -6
- package/dist/admin/translations/ja.json.js +92 -0
- package/dist/admin/translations/ja.json.js.map +1 -0
- package/dist/admin/translations/ja.json.mjs +90 -0
- package/dist/admin/translations/ja.json.mjs.map +1 -0
- package/dist/admin/utils/fields.js +5 -1
- package/dist/admin/utils/fields.js.map +1 -1
- package/dist/admin/utils/schemas.js +6 -2
- package/dist/admin/utils/schemas.js.map +1 -1
- package/dist/server/controllers/locales.js +3 -2
- package/dist/server/controllers/locales.js.map +1 -1
- package/dist/server/register.js +10 -2
- package/dist/server/register.js.map +1 -1
- package/dist/server/register.mjs +4 -0
- package/dist/server/register.mjs.map +1 -1
- package/dist/server/routes/validation/locale.js +3 -2
- package/dist/server/routes/validation/locale.js.map +1 -1
- package/dist/server/services/content-types.js +6 -2
- package/dist/server/services/content-types.js.map +1 -1
- package/dist/server/services/content-types.mjs.map +1 -1
- package/dist/server/services/localizations.js.map +1 -1
- package/dist/server/services/localizations.mjs.map +1 -1
- package/dist/server/services/permissions/actions.js +95 -1
- package/dist/server/services/permissions/actions.js.map +1 -1
- package/dist/server/services/permissions/actions.mjs +95 -1
- package/dist/server/services/permissions/actions.mjs.map +1 -1
- package/dist/server/services/permissions/sections-builder.js +6 -4
- package/dist/server/services/permissions/sections-builder.js.map +1 -1
- package/dist/server/services/permissions/sections-builder.mjs +6 -4
- package/dist/server/services/permissions/sections-builder.mjs.map +1 -1
- package/dist/server/src/controllers/ai-localization-jobs.d.ts.map +1 -1
- package/dist/server/src/controllers/content-types.d.ts +2 -3
- package/dist/server/src/controllers/content-types.d.ts.map +1 -1
- package/dist/server/src/controllers/index.d.ts +2 -3
- package/dist/server/src/controllers/index.d.ts.map +1 -1
- package/dist/server/src/domain/locale.d.ts.map +1 -1
- package/dist/server/src/graphql.d.ts.map +1 -1
- package/dist/server/src/index.d.ts +12 -11
- package/dist/server/src/index.d.ts.map +1 -1
- package/dist/server/src/register.d.ts.map +1 -1
- package/dist/server/src/services/ai-localization-jobs.d.ts +1 -1
- package/dist/server/src/services/ai-localization-jobs.d.ts.map +1 -1
- package/dist/server/src/services/ai-localizations.d.ts.map +1 -1
- package/dist/server/src/services/content-types.d.ts +1 -1
- package/dist/server/src/services/content-types.d.ts.map +1 -1
- package/dist/server/src/services/fill-from-locale.d.ts.map +1 -1
- package/dist/server/src/services/index.d.ts +10 -8
- package/dist/server/src/services/index.d.ts.map +1 -1
- package/dist/server/src/services/localizations.d.ts.map +1 -1
- package/dist/server/src/services/permissions/actions.d.ts +5 -0
- package/dist/server/src/services/permissions/actions.d.ts.map +1 -1
- package/dist/server/src/services/permissions/conditions.d.ts.map +1 -1
- package/dist/server/src/services/permissions/engine.d.ts.map +1 -1
- package/dist/server/src/services/permissions/sections-builder.d.ts.map +1 -1
- package/dist/server/src/services/permissions.d.ts +5 -0
- package/dist/server/src/services/permissions.d.ts.map +1 -1
- package/dist/server/src/services/sanitize/index.d.ts +0 -1
- package/dist/server/src/services/sanitize/index.d.ts.map +1 -1
- package/dist/server/src/services/settings.d.ts.map +1 -1
- package/dist/server/src/utils/index.d.ts +15 -15
- package/dist/server/src/utils/index.d.ts.map +1 -1
- package/dist/server/src/validation/content-types.d.ts +2 -2
- package/dist/server/src/validation/content-types.d.ts.map +1 -1
- package/dist/server/src/validation/locales.d.ts +2 -2
- package/dist/server/src/validation/settings.d.ts +1 -1
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.mjs","sources":["../../../../server/src/services/permissions/actions.ts"],"sourcesContent":["import { isArray, getOr, prop } from 'lodash/fp';\nimport { getService } from '../../utils';\n\nconst actions = [\n {\n section: 'settings',\n category: 'Internationalization',\n subCategory: 'Locales',\n pluginName: 'i18n',\n displayName: 'Create',\n uid: 'locale.create',\n },\n {\n section: 'settings',\n category: 'Internationalization',\n subCategory: 'Locales',\n pluginName: 'i18n',\n displayName: 'Read',\n uid: 'locale.read',\n aliases: [\n { actionId: 'plugin::content-manager.explorer.read', subjects: ['plugin::i18n.locale'] },\n ],\n },\n {\n section: 'settings',\n category: 'Internationalization',\n subCategory: 'Locales',\n pluginName: 'i18n',\n displayName: 'Update',\n uid: 'locale.update',\n },\n {\n section: 'settings',\n category: 'Internationalization',\n subCategory: 'Locales',\n pluginName: 'i18n',\n displayName: 'Delete',\n uid: 'locale.delete',\n },\n];\n\nconst addLocalesPropertyIfNeeded = ({ value: action }: any) => {\n const {\n section,\n options: { applyToProperties },\n } = action;\n\n // Only add the locales property to contentTypes' actions\n if (section !== 'contentTypes') {\n return;\n }\n\n // If the 'locales' property is already declared within the applyToProperties array, then ignore the next steps\n if (isArray(applyToProperties) && applyToProperties.includes('locales')) {\n return;\n }\n\n // Add the 'locales' property to the applyToProperties array (create it if necessary)\n action.options.applyToProperties = isArray(applyToProperties)\n ? applyToProperties.concat('locales')\n : ['locales'];\n};\n\nconst shouldApplyLocalesPropertyToSubject = ({ property, subject }: any) => {\n if (property === 'locales') {\n const model = strapi.getModel(subject);\n\n return getService('content-types').isLocalizedContentType(model);\n }\n\n return true;\n};\n\nconst addAllLocalesToPermissions = async (permissions: any) => {\n const { actionProvider } = strapi.service('admin::permission');\n const { find: findAllLocales } = getService('locales');\n\n const allLocales = await findAllLocales();\n const allLocalesCode = allLocales.map(prop('code'));\n\n return Promise.all(\n permissions.map(async (permission: any) => {\n const { action, subject } = permission;\n\n const appliesToLocalesProperty = await actionProvider.appliesToProperty(\n 'locales',\n action,\n subject\n );\n\n if (!appliesToLocalesProperty) {\n return permission;\n }\n\n const oldPermissionProperties = getOr({}, 'properties', permission);\n\n return { ...permission, properties: { ...oldPermissionProperties, locales: allLocalesCode } };\n })\n );\n};\n\nconst syncSuperAdminPermissionsWithLocales = async () => {\n const roleService = strapi.service('admin::role');\n const permissionService = strapi.service('admin::permission');\n\n const superAdminRole = await roleService.getSuperAdmin();\n\n if (!superAdminRole) {\n return;\n }\n\n const superAdminPermissions = await permissionService.findMany({\n where: {\n role: {\n id: superAdminRole.id,\n },\n },\n });\n\n const newSuperAdminPermissions = await addAllLocalesToPermissions(superAdminPermissions);\n\n await roleService.assignPermissions(superAdminRole.id, newSuperAdminPermissions);\n};\n\nconst registerI18nActions = async () => {\n const { actionProvider } = strapi.service('admin::permission');\n\n await actionProvider.registerMany(actions);\n};\n\nconst registerI18nActionsHooks = () => {\n const { actionProvider } = strapi.service('admin::permission');\n const { hooks } = strapi.service('admin::role');\n\n actionProvider.hooks.appliesPropertyToSubject.register(shouldApplyLocalesPropertyToSubject);\n hooks.willResetSuperAdminPermissions.register(addAllLocalesToPermissions);\n};\n\nconst updateActionsProperties = () => {\n const { actionProvider } = strapi.service('admin::permission');\n\n // Register the transformation for every new action\n actionProvider.hooks.willRegister.register(addLocalesPropertyIfNeeded);\n\n // Handle already registered actions\n actionProvider.values().forEach((action: any) => addLocalesPropertyIfNeeded({ value: action }));\n};\n\nexport default {\n actions,\n registerI18nActions,\n registerI18nActionsHooks,\n updateActionsProperties,\n syncSuperAdminPermissionsWithLocales,\n};\n"],"names":["actions","section","category","subCategory","pluginName","displayName","uid","aliases","actionId","subjects","addLocalesPropertyIfNeeded","value","action","options","applyToProperties","isArray","includes","concat","shouldApplyLocalesPropertyToSubject","property","subject","model","strapi","getModel","getService","isLocalizedContentType","addAllLocalesToPermissions","permissions","actionProvider","service","find","findAllLocales","allLocales","allLocalesCode","map","prop","Promise","all","permission","appliesToLocalesProperty","appliesToProperty","oldPermissionProperties","getOr","properties","locales","syncSuperAdminPermissionsWithLocales","roleService","permissionService","superAdminRole","getSuperAdmin","superAdminPermissions","findMany","where","role","id","newSuperAdminPermissions","assignPermissions","registerI18nActions","registerMany","registerI18nActionsHooks","hooks","appliesPropertyToSubject","register","willResetSuperAdminPermissions","updateActionsProperties","willRegister","values","forEach"],"mappings":";;;AAGA,MAAMA,OAAAA,GAAU;AACd,IAAA;QACEC,OAAAA,EAAS,UAAA;QACTC,QAAAA,EAAU,sBAAA;QACVC,WAAAA,EAAa,SAAA;QACbC,UAAAA,EAAY,MAAA;QACZC,WAAAA,EAAa,QAAA;QACbC,GAAAA,EAAK;AACP,KAAA;AACA,IAAA;QACEL,OAAAA,EAAS,UAAA;QACTC,QAAAA,EAAU,sBAAA;QACVC,WAAAA,EAAa,SAAA;QACbC,UAA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,CAACpD,0BAAAA,CAAAA;;AAG3CkB,IAAAA,cAAAA,CAAesC,MAAM,EAAA,CAAGC,OAAO,CAAC,CAACvD,SAAgBF,0BAAAA,CAA2B;YAAEC,KAAAA,EAAOC;AAAO,SAAA,CAAA,CAAA;AAC9F,CAAA;AAEA,yBAAe;AACbZ,IAAAA,OAAAA;AACAyD,IAAAA,mBAAAA;AACAE,IAAAA,wBAAAA;AACAK,IAAAA,uBAAAA;AACAnB,IAAAA;AACF,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"actions.mjs","sources":["../../../../server/src/services/permissions/actions.ts"],"sourcesContent":["import { isArray, getOr, prop } from 'lodash/fp';\nimport { getService } from '../../utils';\n\nconst actions = [\n {\n section: 'settings',\n category: 'Internationalization',\n subCategory: 'Locales',\n pluginName: 'i18n',\n displayName: 'Create',\n uid: 'locale.create',\n },\n {\n section: 'settings',\n category: 'Internationalization',\n subCategory: 'Locales',\n pluginName: 'i18n',\n displayName: 'Read',\n uid: 'locale.read',\n aliases: [\n { actionId: 'plugin::content-manager.explorer.read', subjects: ['plugin::i18n.locale'] },\n ],\n },\n {\n section: 'settings',\n category: 'Internationalization',\n subCategory: 'Locales',\n pluginName: 'i18n',\n displayName: 'Update',\n uid: 'locale.update',\n },\n {\n section: 'settings',\n category: 'Internationalization',\n subCategory: 'Locales',\n pluginName: 'i18n',\n displayName: 'Delete',\n uid: 'locale.delete',\n },\n];\n\nconst addLocalesPropertyIfNeeded = ({ value: action }: any) => {\n const {\n section,\n options: { applyToProperties },\n } = action;\n\n // Only add the locales property to contentTypes' actions\n if (section !== 'contentTypes') {\n return;\n }\n\n // If the 'locales' property is already declared within the applyToProperties array, then ignore the next steps\n if (isArray(applyToProperties) && applyToProperties.includes('locales')) {\n return;\n }\n\n // Add the 'locales' property to the applyToProperties array (create it if necessary)\n action.options.applyToProperties = isArray(applyToProperties)\n ? applyToProperties.concat('locales')\n : ['locales'];\n};\n\nconst shouldApplyLocalesPropertyToSubject = ({ property, subject }: any) => {\n if (property === 'locales') {\n const model = strapi.getModel(subject);\n\n return getService('content-types').isLocalizedContentType(model);\n }\n\n return true;\n};\n\nconst addAllLocalesToPermissions = async (permissions: any) => {\n const { actionProvider } = strapi.service('admin::permission');\n const { find: findAllLocales } = getService('locales');\n\n const allLocales = await findAllLocales();\n const allLocalesCode = allLocales.map(prop('code'));\n\n return Promise.all(\n permissions.map(async (permission: any) => {\n const { action, subject } = permission;\n\n const appliesToLocalesProperty = await actionProvider.appliesToProperty(\n 'locales',\n action,\n subject\n );\n\n if (!appliesToLocalesProperty) {\n return permission;\n }\n\n const oldPermissionProperties = getOr({}, 'properties', permission);\n\n return { ...permission, properties: { ...oldPermissionProperties, locales: allLocalesCode } };\n })\n );\n};\n\n/**\n * `properties.locales === null` means access to all locales (see engine handler) — do not patch.\n */\nconst needsLocalesPatch = (properties: Record<string, unknown> = {}) => {\n if (!('locales' in properties)) {\n return true;\n }\n\n const { locales } = properties;\n\n if (locales === null) {\n return false;\n }\n\n return Array.isArray(locales) && locales.length === 0;\n};\n\nconst normalizeRolePermissionsLocales = async (permissions: any[]): Promise<any[]> => {\n const { isLocalizedContentType } = getService('content-types');\n const { actionProvider } = strapi.service('admin::permission');\n const defaultLocale = await getService('locales').getDefaultLocale();\n\n return Promise.all(\n permissions.map(async (permission) => {\n const { subject, action, properties = {} } = permission;\n\n if (!subject) {\n return permission;\n }\n\n const model = strapi.getModel(subject);\n\n if (!model || !isLocalizedContentType(model)) {\n return permission;\n }\n\n const appliesToLocales = await actionProvider.appliesToProperty('locales', action, subject);\n\n if (!appliesToLocales) {\n return permission;\n }\n\n // null means access to all locales — same semantics as the permission engine handler\n if (properties.locales === null) {\n return permission;\n }\n\n if (needsLocalesPatch(properties) && defaultLocale) {\n return { ...permission, properties: { ...properties, locales: [defaultLocale] } };\n }\n\n return permission;\n })\n );\n};\n\n/**\n * Repairs role permissions on content types that just had i18n enabled in this sync.\n * Only patches permissions where `properties.locales` is missing or `[]`; leaves `null` alone.\n * Safe to run at `afterSync` time because it does not depend on the actionProvider.\n */\nconst repairPermissionsForNewlyLocalizedTypes = async ({\n oldContentTypes,\n contentTypes,\n}: {\n oldContentTypes: Record<string, any> | null | undefined;\n contentTypes: Record<string, any>;\n}) => {\n if (!oldContentTypes) {\n return;\n }\n\n const { isLocalizedContentType } = getService('content-types');\n\n const newlyLocalizedUids = Object.keys(contentTypes).filter(\n (uid) =>\n oldContentTypes[uid] &&\n !isLocalizedContentType(oldContentTypes[uid]) &&\n isLocalizedContentType(contentTypes[uid])\n );\n\n if (newlyLocalizedUids.length === 0) {\n return;\n }\n\n try {\n const defaultLocaleCode = await getService('locales').getDefaultLocale();\n if (!defaultLocaleCode) {\n return;\n }\n\n const permissionService = strapi.service('admin::permission');\n const allPermissions = await permissionService.findMany({\n where: { subject: { $in: newlyLocalizedUids } },\n });\n\n const results = await Promise.allSettled(\n allPermissions\n .filter((permission: any) => needsLocalesPatch(permission.properties))\n .map((permission: any) =>\n strapi.db.query('admin::permission').update({\n where: { id: permission.id },\n data: {\n properties: { ...permission.properties, locales: [defaultLocaleCode] },\n },\n })\n )\n );\n\n results\n .filter((r): r is PromiseRejectedResult => r.status === 'rejected')\n .forEach((r) =>\n strapi.log.error(\n 'Failed to patch i18n permission during newly-localized type repair.',\n r.reason\n )\n );\n } catch (error) {\n strapi.log.error('Failed to repair i18n permissions for newly localized content types.', error);\n }\n};\n\nconst syncSuperAdminPermissionsWithLocales = async () => {\n const roleService = strapi.service('admin::role');\n const permissionService = strapi.service('admin::permission');\n\n const superAdminRole = await roleService.getSuperAdmin();\n\n if (!superAdminRole) {\n return;\n }\n\n const superAdminPermissions = await permissionService.findMany({\n where: {\n role: {\n id: superAdminRole.id,\n },\n },\n });\n\n const newSuperAdminPermissions = await addAllLocalesToPermissions(superAdminPermissions);\n\n await roleService.assignPermissions(superAdminRole.id, newSuperAdminPermissions);\n};\n\nconst registerI18nActions = async () => {\n const { actionProvider } = strapi.service('admin::permission');\n\n await actionProvider.registerMany(actions);\n};\n\nconst registerI18nActionsHooks = () => {\n const { actionProvider } = strapi.service('admin::permission');\n const { hooks } = strapi.service('admin::role');\n\n actionProvider.hooks.appliesPropertyToSubject.register(shouldApplyLocalesPropertyToSubject);\n hooks.willResetSuperAdminPermissions.register(addAllLocalesToPermissions);\n hooks.willValidateUpdatePermissions.register(normalizeRolePermissionsLocales);\n};\n\nconst updateActionsProperties = () => {\n const { actionProvider } = strapi.service('admin::permission');\n\n // Register the transformation for every new action\n actionProvider.hooks.willRegister.register(addLocalesPropertyIfNeeded);\n\n // Handle already registered actions\n actionProvider.values().forEach((action: any) => addLocalesPropertyIfNeeded({ value: action }));\n};\n\nexport default {\n actions,\n registerI18nActions,\n registerI18nActionsHooks,\n updateActionsProperties,\n syncSuperAdminPermissionsWithLocales,\n repairPermissionsForNewlyLocalizedTypes,\n normalizeRolePermissionsLocales,\n};\n"],"names":["actions","section","category","subCategory","pluginName","displayName","uid","aliases","actionId","subjects","addLocalesPropertyIfNeeded","value","action","options","applyToProperties","isArray","includes","concat","shouldApplyLocalesPropertyToSubject","property","subject","model","strapi","getModel","getService","isLocalizedContentType","addAllLocalesToPermissions","permissions","actionProvider","service","find","findAllLocales","allLocales","allLocalesCode","map","prop","Promise","all","permission","appliesToLocalesProperty","appliesToProperty","oldPermissionProperties","getOr","properties","locales","needsLocalesPatch","Array","length","normalizeRolePermissionsLocales","defaultLocale","getDefaultLocale","appliesToLocales","repairPermissionsForNewlyLocalizedTypes","oldContentTypes","contentTypes","newlyLocalizedUids","Object","keys","filter","defaultLocaleCode","permissionService","allPermissions","findMany","where","$in","results","allSettled","db","query","update","id","data","r","status","forEach","log","error","reason","syncSuperAdminPermissionsWithLocales","roleService","superAdminRole","getSuperAdmin","superAdminPermissions","role","newSuperAdminPermissions","assignPermissions","registerI18nActions","registerMany","registerI18nActionsHooks","hooks","appliesPropertyToSubject","register","willResetSuperAdminPermissions","willValidateUpdatePermissions","updateActionsProperties","willRegister","values"],"mappings":";;;AAGA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N,MAAAA,CAAOO,OAAO,CAAC,mBAAA,CAAA;;AAG1CD,IAAAA,cAAAA,CAAe6D,KAAK,CAACM,YAAY,CAACJ,QAAQ,CAACjF,0BAAAA,CAAAA;;AAG3CkB,IAAAA,cAAAA,CAAeoE,MAAM,EAAA,CAAGtB,OAAO,CAAC,CAAC9D,SAAgBF,0BAAAA,CAA2B;YAAEC,KAAAA,EAAOC;AAAO,SAAA,CAAA,CAAA;AAC9F,CAAA;AAEA,yBAAe;AACbZ,IAAAA,OAAAA;AACAsF,IAAAA,mBAAAA;AACAE,IAAAA,wBAAAA;AACAM,IAAAA,uBAAAA;AACAhB,IAAAA,oCAAAA;AACA1B,IAAAA,uCAAAA;AACAJ,IAAAA;AACF,CAAA;;;;"}
|
|
@@ -11,21 +11,23 @@ var index = require('../../utils/index.js');
|
|
|
11
11
|
* @return {Promise<void>}
|
|
12
12
|
*/ const localesPropertyHandler = async ({ action, section })=>{
|
|
13
13
|
const { actionProvider } = strapi.service('admin::permission');
|
|
14
|
-
const
|
|
14
|
+
const localesService = index.getService('locales');
|
|
15
|
+
const locales = await localesService.setIsDefault(await localesService.find());
|
|
15
16
|
// Do not add the locales property if there is none registered
|
|
16
17
|
if (fp.isEmpty(locales)) {
|
|
17
18
|
return;
|
|
18
19
|
}
|
|
19
20
|
for (const subject of section.subjects){
|
|
20
21
|
const applies = await actionProvider.appliesToProperty('locales', action.actionId, subject.uid);
|
|
21
|
-
const hasLocalesProperty = subject.properties.
|
|
22
|
+
const hasLocalesProperty = subject.properties.some((property)=>property.value === 'locales');
|
|
22
23
|
if (applies && !hasLocalesProperty) {
|
|
23
24
|
subject.properties.push({
|
|
24
25
|
label: 'Locales',
|
|
25
26
|
value: 'locales',
|
|
26
|
-
children: locales.map(({ name, code })=>({
|
|
27
|
+
children: locales.map(({ name, code, isDefault })=>({
|
|
27
28
|
label: name || code,
|
|
28
|
-
value: code
|
|
29
|
+
value: code,
|
|
30
|
+
isDefault
|
|
29
31
|
}))
|
|
30
32
|
});
|
|
31
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sections-builder.js","sources":["../../../../server/src/services/permissions/sections-builder.ts"],"sourcesContent":["import { isEmpty } from 'lodash/fp';\n\nimport { getService } from '../../utils';\n\n/**\n * Handler for the permissions layout (sections builder)\n * Adds the locales property to the subjects\n * @param {Action} action\n * @param {ContentTypesSection} section\n * @return {Promise<void>}\n */\nconst localesPropertyHandler = async ({ action, section }: any) => {\n const { actionProvider } = strapi.service('admin::permission');\n\n const
|
|
1
|
+
{"version":3,"file":"sections-builder.js","sources":["../../../../server/src/services/permissions/sections-builder.ts"],"sourcesContent":["import { isEmpty } from 'lodash/fp';\n\nimport { getService } from '../../utils';\n\n/**\n * Handler for the permissions layout (sections builder)\n * Adds the locales property to the subjects\n * @param {Action} action\n * @param {ContentTypesSection} section\n * @return {Promise<void>}\n */\nconst localesPropertyHandler = async ({ action, section }: any) => {\n const { actionProvider } = strapi.service('admin::permission');\n\n const localesService = getService('locales');\n const locales = await localesService.setIsDefault(await localesService.find());\n\n // Do not add the locales property if there is none registered\n if (isEmpty(locales)) {\n return;\n }\n\n for (const subject of section.subjects) {\n const applies = await actionProvider.appliesToProperty('locales', action.actionId, subject.uid);\n const hasLocalesProperty = subject.properties.some(\n (property: any) => property.value === 'locales'\n );\n\n if (applies && !hasLocalesProperty) {\n subject.properties.push({\n label: 'Locales',\n value: 'locales',\n children: locales.map(({ name, code, isDefault }: any) => ({\n label: name || code,\n value: code,\n isDefault,\n })),\n });\n }\n }\n};\n\nconst registerLocalesPropertyHandler = () => {\n const { sectionsBuilder } = strapi.service('admin::permission');\n\n sectionsBuilder.addHandler('singleTypes', localesPropertyHandler);\n sectionsBuilder.addHandler('collectionTypes', localesPropertyHandler);\n};\n\nexport default {\n localesPropertyHandler,\n registerLocalesPropertyHandler,\n};\n"],"names":["localesPropertyHandler","action","section","actionProvider","strapi","service","localesService","getService","locales","setIsDefault","find","isEmpty","subject","subjects","applies","appliesToProperty","actionId","uid","hasLocalesProperty","properties","some","property","value","push","label","children","map","name","code","isDefault","registerLocalesPropertyHandler","sectionsBuilder","addHandler"],"mappings":";;;;;AAIA;;;;;;AAMC,IACD,MAAMA,sBAAAA,GAAyB,OAAO,EAAEC,MAAM,EAAEC,OAAO,EAAO,GAAA;AAC5D,IAAA,MAAM,EAAEC,cAAc,EAAE,GAAGC,MAAAA,CAAOC,OAAO,CAAC,mBAAA,CAAA;AAE1C,IAAA,MAAMC,iBAAiBC,gBAAAA,CAAW,SAAA,CAAA;AAClC,IAAA,MAAMC,UAAU,MAAMF,cAAAA,CAAeG,YAAY,CAAC,MAAMH,eAAeI,IAAI,EAAA,CAAA;;AAG3E,IAAA,IAAIC,WAAQH,OAAAA,CAAAA,EAAU;AACpB,QAAA;AACF,IAAA;AAEA,IAAA,KAAK,MAAMI,OAAAA,IAAWV,OAAAA,CAAQW,QAAQ,CAAE;QACtC,MAAMC,OAAAA,GAAU,MAAMX,cAAAA,CAAeY,iBAAiB,CAAC,WAAWd,MAAAA,CAAOe,QAAQ,EAAEJ,OAAAA,CAAQK,GAAG,CAAA;QAC9F,MAAMC,kBAAAA,GAAqBN,OAAAA,CAAQO,UAAU,CAACC,IAAI,CAChD,CAACC,QAAAA,GAAkBA,QAAAA,CAASC,KAAK,KAAK,SAAA,CAAA;QAGxC,IAAIR,OAAAA,IAAW,CAACI,kBAAAA,EAAoB;YAClCN,OAAAA,CAAQO,UAAU,CAACI,IAAI,CAAC;gBACtBC,KAAAA,EAAO,SAAA;gBACPF,KAAAA,EAAO,SAAA;AACPG,gBAAAA,QAAAA,EAAUjB,OAAAA,CAAQkB,GAAG,CAAC,CAAC,EAAEC,IAAI,EAAEC,IAAI,EAAEC,SAAS,EAAO,IAAM;AACzDL,wBAAAA,KAAAA,EAAOG,IAAAA,IAAQC,IAAAA;wBACfN,KAAAA,EAAOM,IAAAA;AACPC,wBAAAA;qBACF,CAAA;AACF,aAAA,CAAA;AACF,QAAA;AACF,IAAA;AACF,CAAA;AAEA,MAAMC,8BAAAA,GAAiC,IAAA;AACrC,IAAA,MAAM,EAAEC,eAAe,EAAE,GAAG3B,MAAAA,CAAOC,OAAO,CAAC,mBAAA,CAAA;IAE3C0B,eAAAA,CAAgBC,UAAU,CAAC,aAAA,EAAehC,sBAAAA,CAAAA;IAC1C+B,eAAAA,CAAgBC,UAAU,CAAC,iBAAA,EAAmBhC,sBAAAA,CAAAA;AAChD,CAAA;AAEA,6BAAe;AACbA,IAAAA,sBAAAA;AACA8B,IAAAA;AACF,CAAA;;;;"}
|
|
@@ -9,21 +9,23 @@ import { getService } from '../../utils/index.mjs';
|
|
|
9
9
|
* @return {Promise<void>}
|
|
10
10
|
*/ const localesPropertyHandler = async ({ action, section })=>{
|
|
11
11
|
const { actionProvider } = strapi.service('admin::permission');
|
|
12
|
-
const
|
|
12
|
+
const localesService = getService('locales');
|
|
13
|
+
const locales = await localesService.setIsDefault(await localesService.find());
|
|
13
14
|
// Do not add the locales property if there is none registered
|
|
14
15
|
if (isEmpty(locales)) {
|
|
15
16
|
return;
|
|
16
17
|
}
|
|
17
18
|
for (const subject of section.subjects){
|
|
18
19
|
const applies = await actionProvider.appliesToProperty('locales', action.actionId, subject.uid);
|
|
19
|
-
const hasLocalesProperty = subject.properties.
|
|
20
|
+
const hasLocalesProperty = subject.properties.some((property)=>property.value === 'locales');
|
|
20
21
|
if (applies && !hasLocalesProperty) {
|
|
21
22
|
subject.properties.push({
|
|
22
23
|
label: 'Locales',
|
|
23
24
|
value: 'locales',
|
|
24
|
-
children: locales.map(({ name, code })=>({
|
|
25
|
+
children: locales.map(({ name, code, isDefault })=>({
|
|
25
26
|
label: name || code,
|
|
26
|
-
value: code
|
|
27
|
+
value: code,
|
|
28
|
+
isDefault
|
|
27
29
|
}))
|
|
28
30
|
});
|
|
29
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sections-builder.mjs","sources":["../../../../server/src/services/permissions/sections-builder.ts"],"sourcesContent":["import { isEmpty } from 'lodash/fp';\n\nimport { getService } from '../../utils';\n\n/**\n * Handler for the permissions layout (sections builder)\n * Adds the locales property to the subjects\n * @param {Action} action\n * @param {ContentTypesSection} section\n * @return {Promise<void>}\n */\nconst localesPropertyHandler = async ({ action, section }: any) => {\n const { actionProvider } = strapi.service('admin::permission');\n\n const
|
|
1
|
+
{"version":3,"file":"sections-builder.mjs","sources":["../../../../server/src/services/permissions/sections-builder.ts"],"sourcesContent":["import { isEmpty } from 'lodash/fp';\n\nimport { getService } from '../../utils';\n\n/**\n * Handler for the permissions layout (sections builder)\n * Adds the locales property to the subjects\n * @param {Action} action\n * @param {ContentTypesSection} section\n * @return {Promise<void>}\n */\nconst localesPropertyHandler = async ({ action, section }: any) => {\n const { actionProvider } = strapi.service('admin::permission');\n\n const localesService = getService('locales');\n const locales = await localesService.setIsDefault(await localesService.find());\n\n // Do not add the locales property if there is none registered\n if (isEmpty(locales)) {\n return;\n }\n\n for (const subject of section.subjects) {\n const applies = await actionProvider.appliesToProperty('locales', action.actionId, subject.uid);\n const hasLocalesProperty = subject.properties.some(\n (property: any) => property.value === 'locales'\n );\n\n if (applies && !hasLocalesProperty) {\n subject.properties.push({\n label: 'Locales',\n value: 'locales',\n children: locales.map(({ name, code, isDefault }: any) => ({\n label: name || code,\n value: code,\n isDefault,\n })),\n });\n }\n }\n};\n\nconst registerLocalesPropertyHandler = () => {\n const { sectionsBuilder } = strapi.service('admin::permission');\n\n sectionsBuilder.addHandler('singleTypes', localesPropertyHandler);\n sectionsBuilder.addHandler('collectionTypes', localesPropertyHandler);\n};\n\nexport default {\n localesPropertyHandler,\n registerLocalesPropertyHandler,\n};\n"],"names":["localesPropertyHandler","action","section","actionProvider","strapi","service","localesService","getService","locales","setIsDefault","find","isEmpty","subject","subjects","applies","appliesToProperty","actionId","uid","hasLocalesProperty","properties","some","property","value","push","label","children","map","name","code","isDefault","registerLocalesPropertyHandler","sectionsBuilder","addHandler"],"mappings":";;;AAIA;;;;;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C,mBAAA,CAAA;IAE3C0B,eAAAA,CAAgBC,UAAU,CAAC,aAAA,EAAehC,sBAAAA,CAAAA;IAC1C+B,eAAAA,CAAgBC,UAAU,CAAC,iBAAA,EAAmBhC,sBAAAA,CAAAA;AAChD,CAAA;AAEA,6BAAe;AACbA,IAAAA,sBAAAA;AACA8B,IAAAA;AACF,CAAA;;;;"}
|
|
@@ -1 +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,
|
|
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,GAAI,YAAY;IAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAA;CAAE;IAK3E;;;OAGG;6BAC4B,GAAG;IAuBlC;;;OAGG;iCACgC,GAAG;CAwBzC,CAAC;AAEF,eAAe,kCAAkC,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
/// <reference types="koa" />
|
|
2
1
|
declare const controller: {
|
|
3
|
-
getNonLocalizedAttributes(ctx: import("koa").Context): Promise<
|
|
4
|
-
getFillFromLocaleData(ctx: import("koa").Context): Promise<
|
|
2
|
+
getNonLocalizedAttributes(ctx: import("koa").Context): Promise<any>;
|
|
3
|
+
getFillFromLocaleData(ctx: import("koa").Context): Promise<any>;
|
|
5
4
|
};
|
|
6
5
|
export default controller;
|
|
7
6
|
//# sourceMappingURL=content-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-types.d.ts","sourceRoot":"","sources":["../../../../server/src/controllers/content-types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"content-types.d.ts","sourceRoot":"","sources":["../../../../server/src/controllers/content-types.ts"],"names":[],"mappings":"AAmBA,QAAA,MAAM,UAAU;;;CAyIW,CAAC;AAE5B,eAAe,UAAU,CAAC"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
/// <reference types="koa" />
|
|
2
1
|
declare const _default: {
|
|
3
2
|
locales: import("@strapi/types/dist/core").Controller;
|
|
4
3
|
'iso-locales': import("@strapi/types/dist/core").Controller;
|
|
5
4
|
'content-types': {
|
|
6
|
-
getNonLocalizedAttributes(ctx: import("koa").Context): Promise<
|
|
7
|
-
getFillFromLocaleData(ctx: import("koa").Context): Promise<
|
|
5
|
+
getNonLocalizedAttributes(ctx: import("koa").Context): Promise<any>;
|
|
6
|
+
getFillFromLocaleData(ctx: import("koa").Context): Promise<any>;
|
|
8
7
|
};
|
|
9
8
|
settings: {
|
|
10
9
|
updateSettings(ctx: import("koa").Context): Promise<void>;
|
|
@@ -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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locale.d.ts","sourceRoot":"","sources":["../../../../server/src/domain/locale.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"locale.d.ts","sourceRoot":"","sources":["../../../../server/src/domain/locale.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,YAAY,GAAI,QAAQ;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE;;UAA5B,MAAM;eAAa,OAAO;CAK7E,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql.d.ts","sourceRoot":"","sources":["../../../server/src/graphql.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"graphql.d.ts","sourceRoot":"","sources":["../../../server/src/graphql.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;yBAO1B,YAAY;IAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAA;CAAE;;;AAAnD,wBAqCG"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="koa" />
|
|
2
|
-
/// <reference types="lodash" />
|
|
3
1
|
declare const _default: () => {
|
|
4
2
|
register: ({ strapi }: {
|
|
5
3
|
strapi: import("@strapi/types/dist/core").Strapi;
|
|
@@ -31,8 +29,8 @@ declare const _default: () => {
|
|
|
31
29
|
locales: import("@strapi/types/dist/core").Controller;
|
|
32
30
|
'iso-locales': import("@strapi/types/dist/core").Controller;
|
|
33
31
|
'content-types': {
|
|
34
|
-
getNonLocalizedAttributes(ctx: import("koa").Context): Promise<
|
|
35
|
-
getFillFromLocaleData(ctx: import("koa").Context): Promise<
|
|
32
|
+
getNonLocalizedAttributes(ctx: import("koa").Context): Promise<any>;
|
|
33
|
+
getFillFromLocaleData(ctx: import("koa").Context): Promise<any>;
|
|
36
34
|
};
|
|
37
35
|
settings: {
|
|
38
36
|
updateSettings(ctx: import("koa").Context): Promise<void>;
|
|
@@ -107,6 +105,11 @@ declare const _default: () => {
|
|
|
107
105
|
registerI18nActionsHooks: () => void;
|
|
108
106
|
updateActionsProperties: () => void;
|
|
109
107
|
syncSuperAdminPermissionsWithLocales: () => Promise<void>;
|
|
108
|
+
repairPermissionsForNewlyLocalizedTypes: ({ oldContentTypes, contentTypes, }: {
|
|
109
|
+
oldContentTypes: Record<string, any> | null | undefined;
|
|
110
|
+
contentTypes: Record<string, any>;
|
|
111
|
+
}) => Promise<void>;
|
|
112
|
+
normalizeRolePermissionsLocales: (permissions: any[]) => Promise<any[]>;
|
|
110
113
|
};
|
|
111
114
|
sectionsBuilder: {
|
|
112
115
|
localesPropertyHandler: ({ action, section }: any) => Promise<void>;
|
|
@@ -122,7 +125,7 @@ declare const _default: () => {
|
|
|
122
125
|
sendDidUpdateI18nLocalesEvent: () => Promise<void>;
|
|
123
126
|
};
|
|
124
127
|
localizations: () => {
|
|
125
|
-
syncNonLocalizedAttributes: (sourceEntry: any, model: import("@strapi/types/dist/
|
|
128
|
+
syncNonLocalizedAttributes: (sourceEntry: any, model: import("@strapi/types/dist/schema").ContentType) => Promise<void>;
|
|
126
129
|
};
|
|
127
130
|
locales: () => {
|
|
128
131
|
find: (params?: any) => Promise<any[]>;
|
|
@@ -153,7 +156,7 @@ declare const _default: () => {
|
|
|
153
156
|
getValidLocale: (locale: any) => Promise<any>;
|
|
154
157
|
getLocalizedAttributes: (model: any) => string[];
|
|
155
158
|
getNonLocalizedAttributes: (model: any) => string[];
|
|
156
|
-
copyNonLocalizedAttributes: (model: any, entry: any) => any
|
|
159
|
+
copyNonLocalizedAttributes: (model: any, entry: any) => Record<string, any>;
|
|
157
160
|
fillNonLocalizedAttributes: (entry: any, relatedEntry: any, { model }: any) => void;
|
|
158
161
|
getNestedPopulateOfNonLocalizedAttributes: (modelUID: any) => string[];
|
|
159
162
|
};
|
|
@@ -175,7 +178,7 @@ declare const _default: () => {
|
|
|
175
178
|
contentType: string;
|
|
176
179
|
sourceLocale: string;
|
|
177
180
|
targetLocales: string[];
|
|
178
|
-
status?: "
|
|
181
|
+
status?: import("../../shared/contracts/ai-localization-jobs").AILocalizationJobs["status"];
|
|
179
182
|
}): Promise<any>;
|
|
180
183
|
getJobByDocument(contentType: string, documentId: string): Promise<any>;
|
|
181
184
|
getJobByContentType(contentType: string): Promise<any>;
|
|
@@ -186,14 +189,12 @@ declare const _default: () => {
|
|
|
186
189
|
getSettings: () => Promise<import("yup/lib/object").AssertsShape<{
|
|
187
190
|
aiLocalizations: import("yup").BooleanSchema<boolean, Record<string, any>, boolean>;
|
|
188
191
|
}> | null>;
|
|
189
|
-
setSettings: (value: import("
|
|
190
|
-
aiLocalizations: import("yup").BooleanSchema<boolean, Record<string, any>, boolean>;
|
|
191
|
-
}>) => Promise<void>;
|
|
192
|
+
setSettings: (value: import("./validation/settings").Settings) => Promise<void>;
|
|
192
193
|
};
|
|
193
194
|
'fill-from-locale': ({ strapi }: {
|
|
194
195
|
strapi: import("@strapi/types/dist/core").Strapi;
|
|
195
196
|
}) => {
|
|
196
|
-
fetchRawDocument(model: import("@strapi/types/dist/uid").ContentType, sourceLocale: string, documentId?: string
|
|
197
|
+
fetchRawDocument(model: import("@strapi/types/dist/uid").ContentType, sourceLocale: string, documentId?: string): Promise<import("@strapi/types/dist/modules/documents").AnyDocument | null>;
|
|
197
198
|
transformDocument(document: Record<string, unknown>, model: import("@strapi/types/dist/uid").ContentType, targetLocale: string, userAbility: any): Promise<Record<string, unknown>>;
|
|
198
199
|
};
|
|
199
200
|
};
|
|
@@ -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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAemW,CAAC;;;;;;;;;;;;;;;;;;;;;AARpW,wBAOG"}
|
|
@@ -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;yBAOpB,YAAY;IAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAA;CAAE;AAAzD,wBAcE"}
|
|
@@ -12,7 +12,7 @@ export declare const createAILocalizationJobsService: ({ strapi }: {
|
|
|
12
12
|
contentType: string;
|
|
13
13
|
sourceLocale: string;
|
|
14
14
|
targetLocales: string[];
|
|
15
|
-
status?: AILocalizationJobs[
|
|
15
|
+
status?: AILocalizationJobs["status"];
|
|
16
16
|
}): Promise<any>;
|
|
17
17
|
/**
|
|
18
18
|
* Get job by document ID
|
|
@@ -1 +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,
|
|
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,GAAI,YAAY;IAAE,MAAM,EAAE,IAAI,CAAC,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"}
|
|
@@ -1 +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,MAAM,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAiEhE;;;;;;GAMG;AACH,QAAA,MAAM,sBAAsB,
|
|
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,MAAM,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAiEhE;;;;;;GAMG;AACH,QAAA,MAAM,sBAAsB,GAC1B,YAAY,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC/B,WAAW,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,EACrC,QAAQ,MAAM,CAAC,MAAM,EACrB,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM,GAAG,SAAS,KACvD,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CA4D7B,CAAC;AAEF,QAAA,MAAM,4BAA4B,GAAI,YAAY;IAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAA;CAAE;;IAgBrE;;;;OAIG;wDAIA;QACD,KAAK,EAAE,GAAG,CAAC,WAAW,CAAC;QACvB,QAAQ,EAAE,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC;KACzC;;CAyQJ,CAAC;AAEF,OAAO,EAAE,4BAA4B,EAAE,sBAAsB,EAAE,CAAC"}
|
|
@@ -3,7 +3,7 @@ declare const contentTypes: () => {
|
|
|
3
3
|
getValidLocale: (locale: any) => Promise<any>;
|
|
4
4
|
getLocalizedAttributes: (model: any) => string[];
|
|
5
5
|
getNonLocalizedAttributes: (model: any) => string[];
|
|
6
|
-
copyNonLocalizedAttributes: (model: any, entry: any) => any
|
|
6
|
+
copyNonLocalizedAttributes: (model: any, entry: any) => Record<string, any>;
|
|
7
7
|
fillNonLocalizedAttributes: (entry: any, relatedEntry: any, { model }: any) => void;
|
|
8
8
|
getNestedPopulateOfNonLocalizedAttributes: (modelUID: any) => string[];
|
|
9
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-types.d.ts","sourceRoot":"","sources":["../../../../server/src/services/content-types.ts"],"names":[],"mappings":"AA6LA,QAAA,MAAM,YAAY;oCA1IqB,GAAG;6BAjCJ,GAAG;oCAsGF,GAAG;uCA5DA,GAAG;wCAiDF,GAAG,SAAS,GAAG;wCAwBf,GAAG,gBAAgB,GAAG,aAAa,GAAG;0DAmBpB,GAAG;
|
|
1
|
+
{"version":3,"file":"content-types.d.ts","sourceRoot":"","sources":["../../../../server/src/services/content-types.ts"],"names":[],"mappings":"AA6LA,QAAA,MAAM,YAAY;oCA1IqB,GAAG;6BAjCJ,GAAG;oCAsGF,GAAG;uCA5DA,GAAG;wCAiDF,GAAG,SAAS,GAAG;wCAwBf,GAAG,gBAAgB,GAAG,aAAa,GAAG;0DAmBpB,GAAG,KAAG,MAAM,EAAE;CA6CzE,CAAC;AAEH,KAAK,mBAAmB,GAAG,OAAO,YAAY,CAAC;AAE/C,eAAe,YAAY,CAAC;AAC5B,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fill-from-locale.d.ts","sourceRoot":"","sources":["../../../../server/src/services/fill-from-locale.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAU,IAAI,EAAE,MAAM,eAAe,CAAC;AA4cvD,eAAO,MAAM,2BAA2B,
|
|
1
|
+
{"version":3,"file":"fill-from-locale.d.ts","sourceRoot":"","sources":["../../../../server/src/services/fill-from-locale.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAU,IAAI,EAAE,MAAM,eAAe,CAAC;AA4cvD,eAAO,MAAM,2BAA2B,GAAI,YAAY;IAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAA;CAAE;IAE3E;;;OAGG;4BAC2B,GAAG,CAAC,WAAW,gBAAgB,MAAM,eAAe,MAAM;IA0BxF;;;OAGG;gCAES,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,SAC1B,GAAG,CAAC,WAAW,gBACR,MAAM,eACP,GAAG;CAgBrB,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="lodash" />
|
|
2
1
|
declare const _default: {
|
|
3
2
|
permissions: () => {
|
|
4
3
|
actions: {
|
|
@@ -26,6 +25,11 @@ declare const _default: {
|
|
|
26
25
|
registerI18nActionsHooks: () => void;
|
|
27
26
|
updateActionsProperties: () => void;
|
|
28
27
|
syncSuperAdminPermissionsWithLocales: () => Promise<void>;
|
|
28
|
+
repairPermissionsForNewlyLocalizedTypes: ({ oldContentTypes, contentTypes, }: {
|
|
29
|
+
oldContentTypes: Record<string, any> | null | undefined;
|
|
30
|
+
contentTypes: Record<string, any>;
|
|
31
|
+
}) => Promise<void>;
|
|
32
|
+
normalizeRolePermissionsLocales: (permissions: any[]) => Promise<any[]>;
|
|
29
33
|
};
|
|
30
34
|
sectionsBuilder: {
|
|
31
35
|
localesPropertyHandler: ({ action, section }: any) => Promise<void>;
|
|
@@ -41,7 +45,7 @@ declare const _default: {
|
|
|
41
45
|
sendDidUpdateI18nLocalesEvent: () => Promise<void>;
|
|
42
46
|
};
|
|
43
47
|
localizations: () => {
|
|
44
|
-
syncNonLocalizedAttributes: (sourceEntry: any, model: import("@strapi/types/dist/
|
|
48
|
+
syncNonLocalizedAttributes: (sourceEntry: any, model: import("@strapi/types/dist/schema").ContentType) => Promise<void>;
|
|
45
49
|
};
|
|
46
50
|
locales: () => {
|
|
47
51
|
find: (params?: any) => Promise<any[]>;
|
|
@@ -72,7 +76,7 @@ declare const _default: {
|
|
|
72
76
|
getValidLocale: (locale: any) => Promise<any>;
|
|
73
77
|
getLocalizedAttributes: (model: any) => string[];
|
|
74
78
|
getNonLocalizedAttributes: (model: any) => string[];
|
|
75
|
-
copyNonLocalizedAttributes: (model: any, entry: any) => any
|
|
79
|
+
copyNonLocalizedAttributes: (model: any, entry: any) => Record<string, any>;
|
|
76
80
|
fillNonLocalizedAttributes: (entry: any, relatedEntry: any, { model }: any) => void;
|
|
77
81
|
getNestedPopulateOfNonLocalizedAttributes: (modelUID: any) => string[];
|
|
78
82
|
};
|
|
@@ -94,7 +98,7 @@ declare const _default: {
|
|
|
94
98
|
contentType: string;
|
|
95
99
|
sourceLocale: string;
|
|
96
100
|
targetLocales: string[];
|
|
97
|
-
status?: "
|
|
101
|
+
status?: import("../../../shared/contracts/ai-localization-jobs").AILocalizationJobs["status"];
|
|
98
102
|
}): Promise<any>;
|
|
99
103
|
getJobByDocument(contentType: string, documentId: string): Promise<any>;
|
|
100
104
|
getJobByContentType(contentType: string): Promise<any>;
|
|
@@ -105,14 +109,12 @@ declare const _default: {
|
|
|
105
109
|
getSettings: () => Promise<import("yup/lib/object").AssertsShape<{
|
|
106
110
|
aiLocalizations: import("yup").BooleanSchema<boolean, Record<string, any>, boolean>;
|
|
107
111
|
}> | null>;
|
|
108
|
-
setSettings: (value: import("
|
|
109
|
-
aiLocalizations: import("yup").BooleanSchema<boolean, Record<string, any>, boolean>;
|
|
110
|
-
}>) => Promise<void>;
|
|
112
|
+
setSettings: (value: import("../validation/settings").Settings) => Promise<void>;
|
|
111
113
|
};
|
|
112
114
|
'fill-from-locale': ({ strapi }: {
|
|
113
115
|
strapi: import("@strapi/types/dist/core").Strapi;
|
|
114
116
|
}) => {
|
|
115
|
-
fetchRawDocument(model: import("@strapi/types/dist/uid").ContentType, sourceLocale: string, documentId?: string
|
|
117
|
+
fetchRawDocument(model: import("@strapi/types/dist/uid").ContentType, sourceLocale: string, documentId?: string): Promise<import("@strapi/types/dist/modules/documents").AnyDocument | null>;
|
|
116
118
|
transformDocument(document: Record<string, unknown>, model: import("@strapi/types/dist/uid").ContentType, targetLocale: string, userAbility: any): Promise<Record<string, unknown>>;
|
|
117
119
|
};
|
|
118
120
|
};
|
|
@@ -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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAoBS,CAAC;;;;;;;;;;;;;;;;;;;;AARV,wBAYE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localizations.d.ts","sourceRoot":"","sources":["../../../../server/src/services/localizations.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AA6H5C,QAAA,MAAM,aAAa;8CA1DoC,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"localizations.d.ts","sourceRoot":"","sources":["../../../../server/src/services/localizations.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AA6H5C,QAAA,MAAM,aAAa;8CA1DoC,GAAG,SAAS,MAAM,CAAC,WAAW;CA4DnF,CAAC;AAEH,KAAK,oBAAoB,GAAG,OAAO,aAAa,CAAC;AAEjD,eAAe,aAAa,CAAC;AAC7B,YAAY,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -23,6 +23,11 @@ declare const _default: {
|
|
|
23
23
|
registerI18nActionsHooks: () => void;
|
|
24
24
|
updateActionsProperties: () => void;
|
|
25
25
|
syncSuperAdminPermissionsWithLocales: () => Promise<void>;
|
|
26
|
+
repairPermissionsForNewlyLocalizedTypes: ({ oldContentTypes, contentTypes, }: {
|
|
27
|
+
oldContentTypes: Record<string, any> | null | undefined;
|
|
28
|
+
contentTypes: Record<string, any>;
|
|
29
|
+
}) => Promise<void>;
|
|
30
|
+
normalizeRolePermissionsLocales: (permissions: any[]) => Promise<any[]>;
|
|
26
31
|
};
|
|
27
32
|
export default _default;
|
|
28
33
|
//# sourceMappingURL=actions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../../../server/src/services/permissions/actions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../../../server/src/services/permissions/actions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;kFAqKG;QACD,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;QACxD,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KACnC;mDAlD2D,GAAG,EAAE,KAAG,OAAO,CAAC,GAAG,EAAE,CAAC;;AAyJlF,wBAQE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conditions.d.ts","sourceRoot":"","sources":["../../../../../server/src/services/permissions/conditions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"conditions.d.ts","sourceRoot":"","sources":["../../../../../server/src/services/permissions/conditions.ts"],"names":[],"mappings":";;;;;sBAKkB,GAAG,WAAW,GAAG;;;;;;;;AAyBnC,wBAGE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../../../../server/src/services/permissions/engine.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../../../../server/src/services/permissions/engine.ts"],"names":[],"mappings":";sCAcyC,GAAG;;;AA2C5C,wBAGE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sections-builder.d.ts","sourceRoot":"","sources":["../../../../../server/src/services/permissions/sections-builder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sections-builder.d.ts","sourceRoot":"","sources":["../../../../../server/src/services/permissions/sections-builder.ts"],"names":[],"mappings":";kDAW2D,GAAG;;;AAsC9D,wBAGE"}
|
|
@@ -24,6 +24,11 @@ declare const permissions: () => {
|
|
|
24
24
|
registerI18nActionsHooks: () => void;
|
|
25
25
|
updateActionsProperties: () => void;
|
|
26
26
|
syncSuperAdminPermissionsWithLocales: () => Promise<void>;
|
|
27
|
+
repairPermissionsForNewlyLocalizedTypes: ({ oldContentTypes, contentTypes, }: {
|
|
28
|
+
oldContentTypes: Record<string, any> | null | undefined;
|
|
29
|
+
contentTypes: Record<string, any>;
|
|
30
|
+
}) => Promise<void>;
|
|
31
|
+
normalizeRolePermissionsLocales: (permissions: any[]) => Promise<any[]>;
|
|
27
32
|
};
|
|
28
33
|
sectionsBuilder: {
|
|
29
34
|
localesPropertyHandler: ({ action, section }: any) => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../../../server/src/services/permissions.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../../../server/src/services/permissions.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIf,CAAC;AAEH,KAAK,kBAAkB,GAAG,OAAO,WAAW,CAAC;AAE7C,eAAe,WAAW,CAAC;AAC3B,YAAY,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../server/src/services/sanitize/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../server/src/services/sanitize/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAU,IAAI,EAAE,MAAM,eAAe,CAAC;AASxD,QAAA,MAAM,QAAQ,GAAI,YAAY;IAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAA;CAAE;;CA2BpD,CAAC;AAEF,KAAK,eAAe,GAAG,OAAO,QAAQ,CAAC;AAEvC,eAAe,QAAQ,CAAC;AACxB,YAAY,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -1 +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,
|
|
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,GAAI,YAAY;IAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAA;CAAE;;;;yBASpC,QAAQ;CAQrC,CAAC;AAEF,OAAO,EAAE,qBAAqB,EAAE,CAAC;AACjC,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
|
@@ -25,26 +25,26 @@ type S = {
|
|
|
25
25
|
declare const getCoreStore: () => {
|
|
26
26
|
get(params?: Partial<{
|
|
27
27
|
key: string;
|
|
28
|
-
type?: string
|
|
29
|
-
environment?: string
|
|
30
|
-
name?: string
|
|
31
|
-
tag?: string
|
|
32
|
-
}>
|
|
28
|
+
type?: string;
|
|
29
|
+
environment?: string;
|
|
30
|
+
name?: string;
|
|
31
|
+
tag?: string;
|
|
32
|
+
}>): Promise<unknown>;
|
|
33
33
|
set(params?: Partial<{
|
|
34
34
|
key: string;
|
|
35
35
|
value: unknown;
|
|
36
|
-
type?: string
|
|
37
|
-
environment?: string
|
|
38
|
-
name?: string
|
|
39
|
-
tag?: string
|
|
40
|
-
}>
|
|
36
|
+
type?: string;
|
|
37
|
+
environment?: string;
|
|
38
|
+
name?: string;
|
|
39
|
+
tag?: string;
|
|
40
|
+
}>): Promise<void>;
|
|
41
41
|
delete(params?: Partial<{
|
|
42
42
|
key: string;
|
|
43
|
-
type?: string
|
|
44
|
-
environment?: string
|
|
45
|
-
name?: string
|
|
46
|
-
tag?: string
|
|
47
|
-
}>
|
|
43
|
+
type?: string;
|
|
44
|
+
environment?: string;
|
|
45
|
+
name?: string;
|
|
46
|
+
tag?: string;
|
|
47
|
+
}>): Promise<void>;
|
|
48
48
|
};
|
|
49
49
|
declare const getService: <T extends keyof S>(name: T) => S[T] extends (...args: any) => any ? ReturnType<S[T]> : S[T];
|
|
50
50
|
export { getService, getCoreStore };
|
|
@@ -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,K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F,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const validateGetNonLocalizedAttributesInput: (body: unknown, errorMessage?: string
|
|
2
|
-
declare const validateFillFromLocaleInput: (body: unknown, errorMessage?: string
|
|
1
|
+
declare const validateGetNonLocalizedAttributesInput: (body: unknown, errorMessage?: string) => Promise<any>;
|
|
2
|
+
declare const validateFillFromLocaleInput: (body: unknown, errorMessage?: string) => Promise<any>;
|
|
3
3
|
export { validateGetNonLocalizedAttributesInput, validateFillFromLocaleInput };
|
|
4
4
|
//# sourceMappingURL=content-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-types.d.ts","sourceRoot":"","sources":["../../../../server/src/validation/content-types.ts"],"names":[],"mappings":"AAkBA,QAAA,MAAM,sCAAsC,
|
|
1
|
+
{"version":3,"file":"content-types.d.ts","sourceRoot":"","sources":["../../../../server/src/validation/content-types.ts"],"names":[],"mappings":"AAkBA,QAAA,MAAM,sCAAsC,wDAE3C,CAAC;AAiBF,QAAA,MAAM,2BAA2B,wDAAuD,CAAC;AAEzF,OAAO,EAAE,sCAAsC,EAAE,2BAA2B,EAAE,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { yup } from '@strapi/utils';
|
|
2
|
-
declare const validateCreateLocaleInput: (body: unknown, errorMessage?: string
|
|
2
|
+
declare const validateCreateLocaleInput: (body: unknown, errorMessage?: string) => Promise<import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
3
3
|
name: import("yup").StringSchema<string | null | undefined, Record<string, any>, string | null | undefined>;
|
|
4
4
|
code: import("yup/lib/string").RequiredStringSchema<string | undefined, Record<string, any>>;
|
|
5
5
|
isDefault: import("yup/lib/boolean").RequiredBooleanSchema<boolean | undefined, Record<string, any>>;
|
|
6
6
|
}>>>;
|
|
7
|
-
declare const validateUpdateLocaleInput: (body: unknown, errorMessage?: string
|
|
7
|
+
declare const validateUpdateLocaleInput: (body: unknown, errorMessage?: string) => Promise<import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
8
8
|
name: import("yup").StringSchema<string | null | undefined, Record<string, any>, string | null | undefined>;
|
|
9
9
|
isDefault: yup.BooleanSchema<boolean | undefined, Record<string, any>, boolean | undefined>;
|
|
10
10
|
}>>>;
|
|
@@ -4,7 +4,7 @@ declare const settingsSchema: import("yup/lib/object").OptionalObjectSchema<{
|
|
|
4
4
|
}, Record<string, any>, import("yup/lib/object").TypeOfShape<{
|
|
5
5
|
aiLocalizations: yup.BooleanSchema<boolean, Record<string, any>, boolean>;
|
|
6
6
|
}>>;
|
|
7
|
-
declare const _default: (body: unknown, errorMessage?: string
|
|
7
|
+
declare const _default: (body: unknown, errorMessage?: string) => Promise<import("yup/lib/object").AssertsShape<{
|
|
8
8
|
aiLocalizations: yup.BooleanSchema<boolean, Record<string, any>, boolean>;
|
|
9
9
|
}>>;
|
|
10
10
|
export default _default;
|