strapi-plugin-navigation 2.0.13 → 2.1.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/README.md +105 -27
- package/admin/src/components/Alert/styles.d.ts +2 -0
- package/admin/src/components/Alert/styles.js +10 -4
- package/admin/src/components/CollapseButton/index.d.ts +7 -0
- package/admin/src/components/CollapseButton/index.js +21 -22
- package/admin/src/components/ConfirmationDialog/index.d.ts +28 -0
- package/admin/src/components/ConfirmationDialog/index.js +32 -54
- package/admin/src/components/EmptyView/index.d.ts +3 -0
- package/admin/src/components/EmptyView/index.js +9 -7
- package/admin/src/components/Item/ItemCardBadge/index.d.ts +3 -0
- package/admin/src/components/Item/ItemCardBadge/index.js +11 -7
- package/admin/src/components/Item/ItemCardHeader/Wrapper.d.ts +3 -0
- package/admin/src/components/Item/ItemCardHeader/Wrapper.js +10 -6
- package/admin/src/components/Item/ItemCardHeader/index.d.ts +12 -0
- package/admin/src/components/Item/ItemCardHeader/index.js +33 -52
- package/admin/src/components/Item/ItemCardRemovedOverlay/index.d.ts +2 -0
- package/admin/src/components/Item/ItemCardRemovedOverlay/index.js +10 -4
- package/admin/src/components/Item/Wrapper.d.ts +3 -0
- package/admin/src/components/Item/Wrapper.js +10 -6
- package/admin/src/components/Item/index.d.ts +31 -0
- package/admin/src/components/Item/index.js +163 -242
- package/admin/src/components/NavigationItemList/Wrapper.d.ts +3 -0
- package/admin/src/components/NavigationItemList/Wrapper.js +9 -5
- package/admin/src/components/NavigationItemList/index.d.ts +35 -0
- package/admin/src/components/NavigationItemList/index.js +28 -66
- package/admin/src/components/RestartAlert/index.d.ts +3 -0
- package/admin/src/components/RestartAlert/index.js +10 -5
- package/admin/src/components/Search/index.d.ts +6 -0
- package/admin/src/components/Search/index.js +57 -46
- package/admin/src/components/icons/navigation.d.ts +6 -0
- package/admin/src/components/icons/navigation.js +11 -13
- package/admin/src/contexts/DataManagerContext.d.ts +3 -0
- package/admin/src/contexts/DataManagerContext.js +6 -5
- package/admin/src/hooks/useAllContentTypes.d.ts +6 -0
- package/admin/src/hooks/useAllContentTypes.js +10 -11
- package/admin/src/hooks/useDataManager.d.ts +3 -0
- package/admin/src/hooks/useDataManager.js +10 -6
- package/admin/src/hooks/useI18nCopyNavigationItemsModal.d.ts +9 -0
- package/admin/src/hooks/useI18nCopyNavigationItemsModal.js +51 -0
- package/admin/src/hooks/useNavigationConfig.d.ts +10 -0
- package/admin/src/hooks/useNavigationConfig.js +52 -56
- package/admin/src/hooks/useNavigationManager.d.ts +7 -0
- package/admin/src/hooks/useNavigationManager.js +41 -0
- package/admin/src/index.d.ts +14 -0
- package/admin/src/index.js +92 -76
- package/admin/src/pages/App/index.d.ts +3 -0
- package/admin/src/pages/App/index.js +43 -31
- package/admin/src/pages/DataManagerProvider/actions.d.ts +19 -0
- package/admin/src/pages/DataManagerProvider/actions.js +22 -26
- package/admin/src/pages/DataManagerProvider/index.d.ts +12 -0
- package/admin/src/pages/DataManagerProvider/index.js +316 -298
- package/admin/src/pages/DataManagerProvider/init.d.ts +3 -0
- package/admin/src/pages/DataManagerProvider/init.js +5 -3
- package/admin/src/pages/DataManagerProvider/reducer.d.ts +19 -0
- package/admin/src/pages/DataManagerProvider/reducer.js +119 -121
- package/admin/src/pages/SettingsPage/components/DisableI18nModal/index.d.ts +24 -0
- package/admin/src/pages/SettingsPage/components/DisableI18nModal/index.js +88 -0
- package/admin/src/pages/SettingsPage/index.d.ts +3 -0
- package/admin/src/pages/SettingsPage/index.js +242 -335
- package/admin/src/pages/SettingsPage/utils/functions.d.ts +5 -0
- package/admin/src/pages/SettingsPage/utils/functions.js +3 -8
- package/admin/src/pages/View/components/I18nCopyNavigationItems/index.d.ts +14 -0
- package/admin/src/pages/View/components/I18nCopyNavigationItems/index.js +15 -0
- package/admin/src/pages/View/components/NavigationContentHeader/index.d.ts +6 -0
- package/admin/src/pages/View/components/NavigationContentHeader/index.js +13 -17
- package/admin/src/pages/View/components/NavigationHeader/index.d.ts +12 -0
- package/admin/src/pages/View/components/NavigationHeader/index.js +79 -65
- package/admin/src/pages/View/components/NavigationHeader/styles.d.ts +2 -0
- package/admin/src/pages/View/components/NavigationHeader/styles.js +10 -5
- package/admin/src/pages/View/components/NavigationItemForm/index.d.ts +57 -0
- package/admin/src/pages/View/components/NavigationItemForm/index.js +416 -453
- package/admin/src/pages/View/components/NavigationItemForm/utils/form.d.ts +45 -0
- package/admin/src/pages/View/components/NavigationItemForm/utils/form.js +84 -52
- package/admin/src/pages/View/components/NavigationItemPopup/NavigationItemPopupFooter.d.ts +23 -0
- package/admin/src/pages/View/components/NavigationItemPopup/NavigationItemPopupFooter.js +24 -34
- package/admin/src/pages/View/components/NavigationItemPopup/NavigationItemPopupHeader.d.ts +4 -0
- package/admin/src/pages/View/components/NavigationItemPopup/NavigationItemPopupHeader.js +16 -16
- package/admin/src/pages/View/components/NavigationItemPopup/index.d.ts +30 -0
- package/admin/src/pages/View/components/NavigationItemPopup/index.js +85 -108
- package/admin/src/pages/View/components/NavigationManager/Create/index.d.ts +9 -0
- package/admin/src/pages/View/components/NavigationManager/Create/index.js +57 -0
- package/admin/src/pages/View/components/NavigationManager/Delete/index.d.ts +8 -0
- package/admin/src/pages/View/components/NavigationManager/Delete/index.js +28 -0
- package/admin/src/pages/View/components/NavigationManager/Edit/index.d.ts +8 -0
- package/admin/src/pages/View/components/NavigationManager/Edit/index.js +54 -0
- package/admin/src/pages/View/components/NavigationManager/Error/index.d.ts +8 -0
- package/admin/src/pages/View/components/NavigationManager/Error/index.js +53 -0
- package/admin/src/pages/View/components/NavigationManager/Form/index.d.ts +19 -0
- package/admin/src/pages/View/components/NavigationManager/Form/index.js +98 -0
- package/admin/src/pages/View/components/NavigationManager/List/index.d.ts +8 -0
- package/admin/src/pages/View/components/NavigationManager/List/index.js +138 -0
- package/admin/src/pages/View/components/NavigationManager/index.d.ts +10 -0
- package/admin/src/pages/View/components/NavigationManager/index.js +189 -0
- package/admin/src/pages/View/components/NavigationManager/types.d.ts +53 -0
- package/admin/src/pages/View/components/NavigationManager/types.js +3 -0
- package/admin/src/pages/View/index.d.ts +4 -0
- package/admin/src/pages/View/index.js +231 -304
- package/admin/src/pages/View/utils/enums.d.ts +9 -0
- package/admin/src/pages/View/utils/enums.js +11 -8
- package/admin/src/pages/View/utils/form.d.ts +2 -0
- package/admin/src/pages/View/utils/form.js +15 -12
- package/admin/src/pages/View/utils/index.d.ts +2 -0
- package/admin/src/pages/View/utils/index.js +11 -3
- package/admin/src/pages/View/utils/parsers.d.ts +49 -0
- package/admin/src/pages/View/utils/parsers.js +239 -278
- package/admin/src/permissions.d.ts +12 -0
- package/admin/src/permissions.js +11 -7
- package/admin/src/pluginId.d.ts +3 -0
- package/admin/src/pluginId.js +2 -2
- package/admin/src/translations/en.json +157 -104
- package/admin/src/translations/fr.json +44 -44
- package/admin/src/translations/index.d.ts +12 -0
- package/admin/src/translations/index.js +17 -11
- package/admin/src/utils/api.d.ts +8 -0
- package/admin/src/utils/api.js +54 -50
- package/admin/src/utils/getTrad.d.ts +3 -0
- package/admin/src/utils/getTrad.js +9 -5
- package/admin/src/utils/index.d.ts +18 -0
- package/admin/src/utils/index.js +36 -15
- package/package.json +20 -19
- package/permissions.d.ts +9 -0
- package/permissions.js +5 -4
- package/server/bootstrap/index.d.ts +4 -0
- package/server/bootstrap/index.js +41 -0
- package/server/config/index.d.ts +5 -0
- package/server/config/index.js +33 -9
- package/server/config/setupStrategy.d.ts +3 -0
- package/server/config/setupStrategy.js +38 -0
- package/server/content-types/audience/index.d.ts +27 -0
- package/server/content-types/audience/index.js +9 -8
- package/server/content-types/audience/schema.d.ts +25 -0
- package/server/content-types/audience/schema.js +26 -0
- package/server/content-types/index.d.ts +255 -0
- package/server/content-types/index.js +15 -12
- package/server/content-types/navigation/index.d.ts +64 -0
- package/server/content-types/navigation/index.js +11 -8
- package/server/content-types/navigation/lifecycle.d.ts +9 -0
- package/server/content-types/navigation/lifecycle.js +8 -12
- package/server/content-types/navigation/schema.d.ts +55 -0
- package/server/content-types/navigation/schema.js +56 -0
- package/server/content-types/navigation-item/index.d.ts +112 -0
- package/server/content-types/navigation-item/index.js +11 -8
- package/server/content-types/navigation-item/lifecycle.d.ts +16 -0
- package/server/content-types/navigation-item/lifecycle.js +28 -32
- package/server/content-types/navigation-item/schema.d.ts +97 -0
- package/server/content-types/navigation-item/schema.js +102 -0
- package/server/content-types/navigations-items-related/index.d.ts +56 -0
- package/server/content-types/navigations-items-related/index.js +11 -8
- package/server/content-types/navigations-items-related/lifecycle.d.ts +8 -0
- package/server/content-types/navigations-items-related/lifecycle.js +20 -17
- package/server/content-types/navigations-items-related/schema.d.ts +49 -0
- package/server/content-types/navigations-items-related/schema.js +50 -0
- package/server/controllers/admin.d.ts +4 -0
- package/server/controllers/admin.js +130 -0
- package/server/controllers/client.d.ts +4 -0
- package/server/controllers/client.js +57 -0
- package/server/controllers/index.d.ts +4 -0
- package/server/controllers/index.js +12 -6
- package/server/destroy.d.ts +3 -0
- package/server/destroy.js +5 -0
- package/server/graphql/config.d.ts +4 -0
- package/server/graphql/config.js +28 -0
- package/server/graphql/index.d.ts +2 -0
- package/server/graphql/index.js +18 -22
- package/server/graphql/queries/index.d.ts +3 -0
- package/server/graphql/queries/index.js +15 -15
- package/server/graphql/queries/render-navigation-child.d.ts +15 -0
- package/server/graphql/queries/render-navigation-child.js +24 -15
- package/server/graphql/queries/render-navigation.d.ts +21 -0
- package/server/graphql/queries/render-navigation.js +31 -15
- package/server/graphql/resolvers-config.d.ts +10 -0
- package/server/graphql/resolvers-config.js +5 -3
- package/server/graphql/setupStrategy.d.ts +3 -0
- package/server/graphql/setupStrategy.js +15 -0
- package/server/graphql/types/content-types-name-fields.d.ts +6 -0
- package/server/graphql/types/content-types-name-fields.js +13 -9
- package/server/graphql/types/content-types.d.ts +5 -0
- package/server/graphql/types/content-types.js +17 -15
- package/server/graphql/types/create-navigation-item.d.ts +5 -0
- package/server/graphql/types/create-navigation-item.js +18 -16
- package/server/graphql/types/create-navigation-related.d.ts +5 -0
- package/server/graphql/types/create-navigation-related.js +9 -7
- package/server/graphql/types/create-navigation.d.ts +5 -0
- package/server/graphql/types/create-navigation.js +8 -6
- package/server/graphql/types/index.d.ts +3 -0
- package/server/graphql/types/index.js +15 -13
- package/server/graphql/types/navigation-config.d.ts +5 -0
- package/server/graphql/types/navigation-config.js +10 -8
- package/server/graphql/types/navigation-details.d.ts +5 -0
- package/server/graphql/types/navigation-details.js +11 -9
- package/server/graphql/types/navigation-item-related-data.d.ts +5 -0
- package/server/graphql/types/navigation-item-related-data.js +9 -0
- package/server/graphql/types/navigation-item-related.d.ts +7 -0
- package/server/graphql/types/navigation-item-related.js +25 -0
- package/server/graphql/types/navigation-item.d.ts +5 -0
- package/server/graphql/types/navigation-item.js +28 -29
- package/server/graphql/types/navigation-render-type.d.ts +5 -0
- package/server/graphql/types/navigation-render-type.js +7 -4
- package/server/graphql/types/navigation.d.ts +5 -0
- package/server/graphql/types/navigation.js +10 -8
- package/server/i18n/constant.d.ts +2 -0
- package/server/i18n/constant.js +5 -0
- package/server/i18n/errors.d.ts +7 -0
- package/server/i18n/errors.js +14 -0
- package/server/i18n/graphQLEnhancers.d.ts +10 -0
- package/server/i18n/graphQLEnhancers.js +10 -0
- package/server/i18n/index.d.ts +8 -0
- package/server/i18n/index.js +23 -0
- package/server/i18n/navigationSetupStrategy.d.ts +3 -0
- package/server/i18n/navigationSetupStrategy.js +119 -0
- package/server/i18n/serviceEnhancers.d.ts +13 -0
- package/server/i18n/serviceEnhancers.js +156 -0
- package/server/i18n/types.d.ts +60 -0
- package/server/i18n/types.js +3 -0
- package/server/i18n/utils.d.ts +12 -0
- package/server/i18n/utils.js +29 -0
- package/server/index.d.ts +273 -0
- package/server/index.js +26 -0
- package/server/navigation/index.d.ts +2 -0
- package/server/navigation/index.js +18 -0
- package/server/navigation/setupStrategy.d.ts +3 -0
- package/server/navigation/setupStrategy.js +39 -0
- package/server/register/index.d.ts +3 -0
- package/server/register/index.js +4 -0
- package/server/routes/admin.d.ts +4 -0
- package/server/routes/admin.js +82 -61
- package/server/routes/client.d.ts +4 -0
- package/server/routes/client.js +25 -21
- package/server/routes/index.d.ts +6 -0
- package/server/routes/index.js +13 -4
- package/server/services/admin.d.ts +5 -0
- package/server/services/admin.js +238 -0
- package/server/services/client.d.ts +5 -0
- package/server/services/client.js +249 -0
- package/server/services/common.d.ts +5 -0
- package/server/services/common.js +313 -0
- package/server/services/index.d.ts +7 -0
- package/server/services/index.js +14 -6
- package/server/utils/constant.d.ts +27 -0
- package/server/utils/constant.js +24 -0
- package/server/utils/functions.d.ts +139 -0
- package/server/utils/functions.js +226 -0
- package/server/utils/index.d.ts +3 -0
- package/server/utils/index.js +19 -0
- package/strapi-admin.d.ts +3 -0
- package/strapi-admin.js +8 -1
- package/strapi-server.d.ts +273 -0
- package/strapi-server.js +6 -17
- package/tsconfig.tsbuildinfo +1 -0
- package/types/bootstrap.d.ts +13 -0
- package/types/bootstrap.js +3 -0
- package/types/config.d.ts +21 -0
- package/types/config.js +3 -0
- package/types/contentTypes.d.ts +85 -0
- package/types/contentTypes.js +3 -0
- package/types/controllers.d.ts +48 -0
- package/types/controllers.js +5 -0
- package/types/graphQL.d.ts +3 -0
- package/types/graphQL.js +3 -0
- package/types/i18n.d.ts +9 -0
- package/types/i18n.js +3 -0
- package/types/index.d.ts +9 -0
- package/types/index.js +25 -0
- package/types/services.d.ts +74 -0
- package/types/services.js +3 -0
- package/types/utils.d.ts +62 -0
- package/types/utils.js +27 -0
- package/utils/InvalidParamNavigationError.d.ts +4 -0
- package/utils/InvalidParamNavigationError.js +8 -0
- package/utils/NavigationError.d.ts +5 -0
- package/utils/NavigationError.js +7 -7
- package/__mocks__/pages.settings.json +0 -25
- package/__mocks__/strapi.js +0 -207
- package/jest.config.js +0 -14
- package/server/bootstrap.js +0 -52
- package/server/config.js +0 -9
- package/server/content-types/audience/lifecycle.js +0 -8
- package/server/content-types/audience/schema.json +0 -23
- package/server/content-types/navigation/schema.json +0 -45
- package/server/content-types/navigation-item/schema.json +0 -99
- package/server/content-types/navigations-items-related/schema.json +0 -47
- package/server/controllers/navigation.js +0 -105
- package/server/graphql/types/navigation-related.js +0 -25
- package/server/services/__tests__/functions.test.js +0 -48
- package/server/services/__tests__/navigation.test.js +0 -91
- package/server/services/navigation.js +0 -791
- package/server/services/utils/constant.js +0 -21
- package/server/services/utils/functions.js +0 -226
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.i18nNavigationSetupStrategy = void 0;
|
|
4
|
+
const types_1 = require("../../types");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
const errors_1 = require("./errors");
|
|
7
|
+
const i18nNavigationSetupStrategy = async ({ strapi, }) => {
|
|
8
|
+
const pluginStore = strapi.store({
|
|
9
|
+
type: "plugin",
|
|
10
|
+
name: "navigation",
|
|
11
|
+
});
|
|
12
|
+
const config = await pluginStore.get({
|
|
13
|
+
key: "config",
|
|
14
|
+
});
|
|
15
|
+
let currentNavigations = await getCurrentNavigations(strapi);
|
|
16
|
+
const localeService = strapi.plugin("i18n").service("locales");
|
|
17
|
+
const defaultLocale = await localeService.getDefaultLocale();
|
|
18
|
+
const allLocale = (await localeService.find({})).map(({ code }) => code);
|
|
19
|
+
(0, types_1.assertNotEmpty)(defaultLocale, new errors_1.DefaultLocaleMissingError());
|
|
20
|
+
if (config.i18nEnabled) {
|
|
21
|
+
const hasNotAnyLocale = ({ localeCode }) => !localeCode;
|
|
22
|
+
if (currentNavigations.length === 0) {
|
|
23
|
+
currentNavigations = [
|
|
24
|
+
await createDefaultI18nNavigation({ strapi, defaultLocale }),
|
|
25
|
+
];
|
|
26
|
+
}
|
|
27
|
+
if (currentNavigations.some(hasNotAnyLocale)) {
|
|
28
|
+
currentNavigations = await Promise.all(currentNavigations.map(async (navigation) => {
|
|
29
|
+
return hasNotAnyLocale(navigation)
|
|
30
|
+
? await updateNavigation({
|
|
31
|
+
strapi,
|
|
32
|
+
current: navigation,
|
|
33
|
+
payload: {
|
|
34
|
+
localeCode: defaultLocale,
|
|
35
|
+
},
|
|
36
|
+
populate: utils_1.DEFAULT_POPULATE,
|
|
37
|
+
})
|
|
38
|
+
: navigation;
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
await Promise.all(currentNavigations
|
|
42
|
+
.filter(({ localeCode }) => defaultLocale === localeCode)
|
|
43
|
+
.flatMap(async (rootNavigation) => {
|
|
44
|
+
const localizations = [
|
|
45
|
+
...(rootNavigation.localizations ?? []).map((localization) => (0, types_1.assertEntity)(localization, "Navigation")),
|
|
46
|
+
rootNavigation,
|
|
47
|
+
];
|
|
48
|
+
for (const locale of allLocale) {
|
|
49
|
+
if (!localizations.some(({ localeCode }) => localeCode === locale)) {
|
|
50
|
+
localizations.push(await createNavigation({
|
|
51
|
+
strapi,
|
|
52
|
+
payload: {
|
|
53
|
+
localeCode: locale,
|
|
54
|
+
slug: `${rootNavigation.slug}-${locale}`,
|
|
55
|
+
name: rootNavigation.name,
|
|
56
|
+
visible: true,
|
|
57
|
+
},
|
|
58
|
+
}));
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return await Promise.all(localizations.map((current) => updateNavigation({
|
|
62
|
+
strapi,
|
|
63
|
+
current,
|
|
64
|
+
payload: {
|
|
65
|
+
localizations: localizations.filter(({ id }) => id !== current.id),
|
|
66
|
+
},
|
|
67
|
+
})));
|
|
68
|
+
}));
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
if (config.pruneObsoleteI18nNavigations) {
|
|
72
|
+
await deleteNavigations({
|
|
73
|
+
strapi,
|
|
74
|
+
where: { localeCode: { $not: defaultLocale } },
|
|
75
|
+
});
|
|
76
|
+
await pluginStore.set({
|
|
77
|
+
key: "config",
|
|
78
|
+
value: {
|
|
79
|
+
...config,
|
|
80
|
+
pruneObsoleteI18nNavigations: false,
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
const remainingNavigations = await getCurrentNavigations(strapi);
|
|
85
|
+
if (!remainingNavigations.length) {
|
|
86
|
+
await createDefaultI18nNavigation({ strapi, defaultLocale });
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return getCurrentNavigations(strapi);
|
|
90
|
+
};
|
|
91
|
+
exports.i18nNavigationSetupStrategy = i18nNavigationSetupStrategy;
|
|
92
|
+
const getCurrentNavigations = (strapi) => strapi.plugin("navigation").service("admin").get();
|
|
93
|
+
const createNavigation = ({ strapi, payload, populate, }) => strapi.query("plugin::navigation.navigation").create({
|
|
94
|
+
data: {
|
|
95
|
+
...payload,
|
|
96
|
+
},
|
|
97
|
+
populate,
|
|
98
|
+
});
|
|
99
|
+
const updateNavigation = ({ strapi, current, payload, populate, }) => strapi.query("plugin::navigation.navigation").update({
|
|
100
|
+
data: {
|
|
101
|
+
...payload,
|
|
102
|
+
},
|
|
103
|
+
populate,
|
|
104
|
+
where: {
|
|
105
|
+
id: current.id,
|
|
106
|
+
},
|
|
107
|
+
});
|
|
108
|
+
const deleteNavigations = ({ strapi, where, }) => strapi.query("plugin::navigation.navigation").deleteMany({
|
|
109
|
+
where,
|
|
110
|
+
});
|
|
111
|
+
const createDefaultI18nNavigation = ({ strapi, defaultLocale }) => createNavigation({
|
|
112
|
+
strapi,
|
|
113
|
+
payload: {
|
|
114
|
+
...utils_1.DEFAULT_NAVIGATION_ITEM,
|
|
115
|
+
localeCode: defaultLocale,
|
|
116
|
+
},
|
|
117
|
+
populate: utils_1.DEFAULT_POPULATE,
|
|
118
|
+
});
|
|
119
|
+
//# sourceMappingURL=navigationSetupStrategy.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AddI18NConfigFieldsInput, AddI18nWhereClause, HandleLocaleParamInput, I18nAwareEntityReadHandlerInput, I18NConfigFields, I18nNavigationContentsCopyInput, I18nNavigationItemReadInput } from "./types";
|
|
2
|
+
export declare const addI18NConfigFields: <T>({ previousConfig, strapi, viaSettingsPage, }: AddI18NConfigFieldsInput<T>) => Promise<T & I18NConfigFields>;
|
|
3
|
+
export declare const handleLocaleQueryParam: ({ locale, strapi, }: HandleLocaleParamInput) => Promise<string | undefined>;
|
|
4
|
+
export declare const i18nAwareEntityReadHandler: <T extends {
|
|
5
|
+
localeCode?: string | null | undefined;
|
|
6
|
+
localizations?: T[] | null | undefined;
|
|
7
|
+
}>({ entity, entityUid, localeCode, populate, strapi, whereClause, }: I18nAwareEntityReadHandlerInput<T>) => Promise<T | null | undefined>;
|
|
8
|
+
export declare const addI18nWhereClause: <T>({ modelUid, previousWhere, query, strapi, }: AddI18nWhereClause<T>) => Promise<T & {
|
|
9
|
+
locale?: string | undefined;
|
|
10
|
+
}>;
|
|
11
|
+
export declare const i18nNavigationContentsCopy: ({ target, source, strapi, service, }: I18nNavigationContentsCopyInput) => Promise<void>;
|
|
12
|
+
export declare const i18nNavigationItemRead: ({ target, source, path, strapi }: I18nNavigationItemReadInput) => Promise<Partial<any>>;
|
|
13
|
+
//# sourceMappingURL=serviceEnhancers.d.ts.map
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.i18nNavigationItemRead = exports.i18nNavigationContentsCopy = exports.addI18nWhereClause = exports.i18nAwareEntityReadHandler = exports.handleLocaleQueryParam = exports.addI18NConfigFields = void 0;
|
|
4
|
+
const utils_1 = require("@strapi/utils");
|
|
5
|
+
const lodash_1 = require("lodash");
|
|
6
|
+
const fp_1 = require("lodash/fp");
|
|
7
|
+
const types_1 = require("../../types");
|
|
8
|
+
const InvalidParamNavigationError_1 = require("../../utils/InvalidParamNavigationError");
|
|
9
|
+
const utils_2 = require("../utils");
|
|
10
|
+
const constant_1 = require("./constant");
|
|
11
|
+
const errors_1 = require("./errors");
|
|
12
|
+
const utils_3 = require("./utils");
|
|
13
|
+
const addI18NConfigFields = async ({ previousConfig, strapi, viaSettingsPage = false, }) => {
|
|
14
|
+
const { enabled, hasI18NPlugin, defaultLocale } = await (0, utils_3.getI18nStatus)({
|
|
15
|
+
strapi,
|
|
16
|
+
});
|
|
17
|
+
return {
|
|
18
|
+
...previousConfig,
|
|
19
|
+
defaultLocale,
|
|
20
|
+
i18nEnabled: enabled,
|
|
21
|
+
isI18NPluginEnabled: viaSettingsPage ? hasI18NPlugin : undefined,
|
|
22
|
+
pruneObsoleteI18nNavigations: false,
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
exports.addI18NConfigFields = addI18NConfigFields;
|
|
26
|
+
const handleLocaleQueryParam = async ({ locale, strapi, }) => {
|
|
27
|
+
const { enabled } = await (0, utils_3.getI18nStatus)({ strapi });
|
|
28
|
+
if (locale) {
|
|
29
|
+
return locale;
|
|
30
|
+
}
|
|
31
|
+
const localeService = strapi.plugin("i18n").service("locales");
|
|
32
|
+
const defaultLocale = await localeService.getDefaultLocale();
|
|
33
|
+
(0, types_1.assertNotEmpty)(defaultLocale, new errors_1.DefaultLocaleMissingError());
|
|
34
|
+
return enabled ? defaultLocale : undefined;
|
|
35
|
+
};
|
|
36
|
+
exports.handleLocaleQueryParam = handleLocaleQueryParam;
|
|
37
|
+
const i18nAwareEntityReadHandler = async ({ entity, entityUid, localeCode, populate = [], strapi, whereClause, }) => {
|
|
38
|
+
const { defaultLocale, enabled } = await (0, utils_3.getI18nStatus)({ strapi });
|
|
39
|
+
if (!enabled) {
|
|
40
|
+
return entity;
|
|
41
|
+
}
|
|
42
|
+
if (entity && (!localeCode || entity.localeCode === localeCode)) {
|
|
43
|
+
return entity;
|
|
44
|
+
}
|
|
45
|
+
const locale = localeCode || defaultLocale;
|
|
46
|
+
const rerun = await strapi.query(entityUid).findOne({
|
|
47
|
+
where: whereClause,
|
|
48
|
+
populate: [...populate, ...constant_1.I18N_DEFAULT_POPULATE],
|
|
49
|
+
});
|
|
50
|
+
if (rerun) {
|
|
51
|
+
if (rerun.localeCode === locale) {
|
|
52
|
+
return rerun;
|
|
53
|
+
}
|
|
54
|
+
return rerun.localizations?.find((localization) => localization.localeCode === locale);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
exports.i18nAwareEntityReadHandler = i18nAwareEntityReadHandler;
|
|
58
|
+
const addI18nWhereClause = async ({ modelUid, previousWhere, query, strapi, }) => {
|
|
59
|
+
const { enabled } = await (0, utils_3.getI18nStatus)({ strapi });
|
|
60
|
+
const modelSchema = strapi.getModel(modelUid);
|
|
61
|
+
if (enabled && query.localeCode && modelSchema.attributes.locale) {
|
|
62
|
+
return {
|
|
63
|
+
...previousWhere,
|
|
64
|
+
locale: query.localeCode,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
return previousWhere;
|
|
68
|
+
};
|
|
69
|
+
exports.addI18nWhereClause = addI18nWhereClause;
|
|
70
|
+
const i18nNavigationContentsCopy = async ({ target, source, strapi, service, }) => {
|
|
71
|
+
const sourceItems = source.items ?? [];
|
|
72
|
+
if (target.items?.length) {
|
|
73
|
+
throw new errors_1.FillNavigationError("Current navigation is non-empty");
|
|
74
|
+
}
|
|
75
|
+
if (!target.localeCode) {
|
|
76
|
+
throw new errors_1.FillNavigationError("Current navigation does not have specified locale");
|
|
77
|
+
}
|
|
78
|
+
if (!sourceItems.length) {
|
|
79
|
+
throw new errors_1.FillNavigationError("Source navigation is empty");
|
|
80
|
+
}
|
|
81
|
+
const newItems = await Promise.all(sourceItems.map(processItems({
|
|
82
|
+
master: target,
|
|
83
|
+
localeCode: target.localeCode,
|
|
84
|
+
strapi,
|
|
85
|
+
})));
|
|
86
|
+
await service.createBranch(newItems, target, null, { create: true });
|
|
87
|
+
};
|
|
88
|
+
exports.i18nNavigationContentsCopy = i18nNavigationContentsCopy;
|
|
89
|
+
const i18nNavigationItemRead = async ({ target, source, path, strapi }) => {
|
|
90
|
+
const pickFields = (0, fp_1.pick)(['path', 'related', 'type', 'uiRouterKey', 'title', 'externalPath']);
|
|
91
|
+
const structurePath = path.split('.').map(p => parseInt(p, 10));
|
|
92
|
+
if (!structurePath.some(Number.isNaN) || !structurePath.length) {
|
|
93
|
+
new InvalidParamNavigationError_1.InvalidParamNavigationError("Path is invalid");
|
|
94
|
+
}
|
|
95
|
+
let result = (0, lodash_1.get)(source.items, (0, utils_2.intercalate)("items", structurePath.map(lodash_1.toString)));
|
|
96
|
+
if (!result) {
|
|
97
|
+
throw new utils_1.errors.NotFoundError("Unable to find navigation item");
|
|
98
|
+
}
|
|
99
|
+
let { related } = result;
|
|
100
|
+
if (related) {
|
|
101
|
+
const fullRelated = await strapi.query(related.__contentType).findOne({
|
|
102
|
+
where: {
|
|
103
|
+
id: related.id,
|
|
104
|
+
},
|
|
105
|
+
populate: constant_1.I18N_DEFAULT_POPULATE,
|
|
106
|
+
});
|
|
107
|
+
if (fullRelated.localizations?.length) {
|
|
108
|
+
const localeVersion = fullRelated.localizations.find(({ locale }) => locale === target.localeCode);
|
|
109
|
+
if (localeVersion) {
|
|
110
|
+
related = {
|
|
111
|
+
...localeVersion,
|
|
112
|
+
__contentType: related.__contentType
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return pickFields({
|
|
118
|
+
...result,
|
|
119
|
+
related
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
exports.i18nNavigationItemRead = i18nNavigationItemRead;
|
|
123
|
+
const processItems = (context) => async (item) => ({
|
|
124
|
+
title: item.title,
|
|
125
|
+
path: item.path,
|
|
126
|
+
audience: item.audience,
|
|
127
|
+
type: item.type,
|
|
128
|
+
uiRouterKey: item.uiRouterKey,
|
|
129
|
+
order: item.order,
|
|
130
|
+
collapsed: item.collapsed,
|
|
131
|
+
menuAttached: item.menuAttached,
|
|
132
|
+
removed: false,
|
|
133
|
+
updated: true,
|
|
134
|
+
externalPath: item.externalPath ?? undefined,
|
|
135
|
+
items: item.items
|
|
136
|
+
? await Promise.all(item.items.map(processItems(context)))
|
|
137
|
+
: [],
|
|
138
|
+
master: parseInt(context.master.id.toString(), 10),
|
|
139
|
+
parent: null,
|
|
140
|
+
related: item.related ? [await processRelated(item.related, context)] : [],
|
|
141
|
+
});
|
|
142
|
+
const processRelated = async (related, { localeCode, strapi }) => {
|
|
143
|
+
const { __contentType, id } = related;
|
|
144
|
+
(0, types_1.assertNotEmpty)(__contentType, new errors_1.FillNavigationError("Related item's content type is missing"));
|
|
145
|
+
(0, types_1.assertIsNumber)(id, new errors_1.FillNavigationError("Related item's id is not a number"));
|
|
146
|
+
const relatedItemWithLocalizations = await strapi
|
|
147
|
+
.query(__contentType)
|
|
148
|
+
.findOne({ where: { id }, populate: constant_1.I18N_DEFAULT_POPULATE });
|
|
149
|
+
const localization = relatedItemWithLocalizations.localizations?.find(({ locale }) => locale === localeCode);
|
|
150
|
+
return {
|
|
151
|
+
refId: localization?.id ?? id,
|
|
152
|
+
ref: __contentType,
|
|
153
|
+
field: related.field,
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
//# sourceMappingURL=serviceEnhancers.js.map
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { IStrapi, OnlyStrings, StringMap, WhereClause } from "strapi-typed";
|
|
2
|
+
import { ICommonService, Navigation, NavigationItemInput, NestedStructure, NotVoid } from "../../types";
|
|
3
|
+
export declare type AddI18NConfigFieldsInput<T> = {
|
|
4
|
+
previousConfig: T;
|
|
5
|
+
strapi: IStrapi;
|
|
6
|
+
viaSettingsPage?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare type HandleLocaleParamInput = {
|
|
9
|
+
locale?: string;
|
|
10
|
+
strapi: IStrapi;
|
|
11
|
+
};
|
|
12
|
+
export declare type I18nAwareEntityReadHandlerInput<T> = {
|
|
13
|
+
entity: T | undefined | null;
|
|
14
|
+
entityUid: string;
|
|
15
|
+
whereClause: WhereClause<OnlyStrings<keyof T>>;
|
|
16
|
+
localeCode?: string;
|
|
17
|
+
strapi: IStrapi;
|
|
18
|
+
populate?: string[];
|
|
19
|
+
};
|
|
20
|
+
export declare type I18NConfigFields = {
|
|
21
|
+
i18nEnabled: boolean;
|
|
22
|
+
isI18NPluginEnabled: boolean | undefined;
|
|
23
|
+
pruneObsoleteI18nNavigations: boolean;
|
|
24
|
+
defaultLocale?: string | null;
|
|
25
|
+
};
|
|
26
|
+
export declare type AddI18nWhereClause<T> = {
|
|
27
|
+
previousWhere: T;
|
|
28
|
+
strapi: IStrapi;
|
|
29
|
+
query: StringMap<string> & {
|
|
30
|
+
localeCode?: string;
|
|
31
|
+
};
|
|
32
|
+
modelUid: string;
|
|
33
|
+
};
|
|
34
|
+
export declare type I18nNavigationContentsCopyInput = {
|
|
35
|
+
target: Navigation;
|
|
36
|
+
source: Navigation;
|
|
37
|
+
service: ICommonService;
|
|
38
|
+
strapi: IStrapi;
|
|
39
|
+
};
|
|
40
|
+
export declare type I18nNavigationItemReadInput = {
|
|
41
|
+
path: string;
|
|
42
|
+
source: Navigation;
|
|
43
|
+
strapi: IStrapi;
|
|
44
|
+
target: Navigation;
|
|
45
|
+
};
|
|
46
|
+
export declare type SourceNavigationItem = NestedStructure<NotVoid<Navigation["items"]>[0]>;
|
|
47
|
+
export declare type ResultNavigationItem = NestedStructure<NavigationItemInput>;
|
|
48
|
+
export declare type FillCopyContext = {
|
|
49
|
+
master: Navigation;
|
|
50
|
+
strapi: IStrapi;
|
|
51
|
+
localeCode: string;
|
|
52
|
+
};
|
|
53
|
+
export declare type MinimalEntityWithI18n = {
|
|
54
|
+
id: number;
|
|
55
|
+
localizations?: Array<{
|
|
56
|
+
id: number;
|
|
57
|
+
locale?: string;
|
|
58
|
+
}>;
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IStrapi } from "strapi-typed";
|
|
2
|
+
declare type GetI18nStatusInput = {
|
|
3
|
+
strapi: IStrapi;
|
|
4
|
+
};
|
|
5
|
+
declare type I18NStatus = {
|
|
6
|
+
hasI18NPlugin: boolean;
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
defaultLocale?: string | null;
|
|
9
|
+
};
|
|
10
|
+
export declare const getI18nStatus: ({ strapi, }: GetI18nStatusInput) => Promise<I18NStatus>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getI18nStatus = void 0;
|
|
4
|
+
const getI18nStatus = async ({ strapi, }) => {
|
|
5
|
+
const i18nPlugin = strapi.plugin("i18n");
|
|
6
|
+
const hasI18NPlugin = !!i18nPlugin;
|
|
7
|
+
const pluginStore = strapi.store({
|
|
8
|
+
type: "plugin",
|
|
9
|
+
name: "navigation",
|
|
10
|
+
});
|
|
11
|
+
const config = await pluginStore.get({
|
|
12
|
+
key: "config",
|
|
13
|
+
});
|
|
14
|
+
const localeService = i18nPlugin ? i18nPlugin.service("locales") : null;
|
|
15
|
+
const defaultLocale = await localeService?.getDefaultLocale();
|
|
16
|
+
return hasI18NPlugin
|
|
17
|
+
? {
|
|
18
|
+
hasI18NPlugin,
|
|
19
|
+
enabled: config.i18nEnabled,
|
|
20
|
+
defaultLocale,
|
|
21
|
+
}
|
|
22
|
+
: {
|
|
23
|
+
hasI18NPlugin,
|
|
24
|
+
enabled: false,
|
|
25
|
+
defaultLocale: undefined,
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
exports.getI18nStatus = getI18nStatus;
|
|
29
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
bootstrap: ({ strapi }: import("strapi-typed").StrapiContext) => Promise<void>;
|
|
3
|
+
config: import("../types").StrapiConfig<import("../types").NavigationPluginConfig>;
|
|
4
|
+
contentTypes: {
|
|
5
|
+
audience: {
|
|
6
|
+
schema: {
|
|
7
|
+
collectionName: string;
|
|
8
|
+
info: {
|
|
9
|
+
singularName: string;
|
|
10
|
+
pluralName: string;
|
|
11
|
+
displayName: string;
|
|
12
|
+
name: string;
|
|
13
|
+
};
|
|
14
|
+
options: {
|
|
15
|
+
increments: boolean;
|
|
16
|
+
comment: string;
|
|
17
|
+
};
|
|
18
|
+
attributes: {
|
|
19
|
+
name: {
|
|
20
|
+
type: string;
|
|
21
|
+
required: boolean;
|
|
22
|
+
};
|
|
23
|
+
key: {
|
|
24
|
+
type: string;
|
|
25
|
+
targetField: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
navigation: {
|
|
31
|
+
lifecycle: {
|
|
32
|
+
renderType: {
|
|
33
|
+
FLAT: string;
|
|
34
|
+
TREE: string;
|
|
35
|
+
RFR: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
schema: {
|
|
39
|
+
collectionName: string;
|
|
40
|
+
info: {
|
|
41
|
+
singularName: string;
|
|
42
|
+
pluralName: string;
|
|
43
|
+
displayName: string;
|
|
44
|
+
name: string;
|
|
45
|
+
};
|
|
46
|
+
options: {
|
|
47
|
+
increments: boolean;
|
|
48
|
+
comment: string;
|
|
49
|
+
};
|
|
50
|
+
pluginOptions: {
|
|
51
|
+
"content-manager": {
|
|
52
|
+
visible: boolean;
|
|
53
|
+
};
|
|
54
|
+
"content-type-builder": {
|
|
55
|
+
visible: boolean;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
attributes: {
|
|
59
|
+
name: {
|
|
60
|
+
type: string;
|
|
61
|
+
configurable: boolean;
|
|
62
|
+
required: boolean;
|
|
63
|
+
};
|
|
64
|
+
slug: {
|
|
65
|
+
type: string;
|
|
66
|
+
target: string;
|
|
67
|
+
configurable: boolean;
|
|
68
|
+
required: boolean;
|
|
69
|
+
};
|
|
70
|
+
visible: {
|
|
71
|
+
type: string;
|
|
72
|
+
default: boolean;
|
|
73
|
+
configurable: boolean;
|
|
74
|
+
};
|
|
75
|
+
items: {
|
|
76
|
+
type: string;
|
|
77
|
+
relation: string;
|
|
78
|
+
target: string;
|
|
79
|
+
configurable: boolean;
|
|
80
|
+
};
|
|
81
|
+
localizations: {
|
|
82
|
+
type: string;
|
|
83
|
+
relation: string;
|
|
84
|
+
target: string;
|
|
85
|
+
};
|
|
86
|
+
localeCode: {
|
|
87
|
+
type: string;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
"navigation-item": {
|
|
93
|
+
lifecycle: {
|
|
94
|
+
type: {
|
|
95
|
+
INTERNAL: string;
|
|
96
|
+
EXTERNAL: string;
|
|
97
|
+
WRAPPER: string;
|
|
98
|
+
};
|
|
99
|
+
additionalFields: {
|
|
100
|
+
AUDIENCE: string;
|
|
101
|
+
};
|
|
102
|
+
lifecycles: {
|
|
103
|
+
afterFind(results: any): void;
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
schema: {
|
|
107
|
+
collectionName: string;
|
|
108
|
+
info: {
|
|
109
|
+
singularName: string;
|
|
110
|
+
pluralName: string;
|
|
111
|
+
displayName: string;
|
|
112
|
+
name: string;
|
|
113
|
+
};
|
|
114
|
+
options: {
|
|
115
|
+
increments: boolean;
|
|
116
|
+
timestamps: boolean;
|
|
117
|
+
comment: string;
|
|
118
|
+
};
|
|
119
|
+
pluginOptions: {
|
|
120
|
+
"content-manager": {
|
|
121
|
+
visible: boolean;
|
|
122
|
+
};
|
|
123
|
+
"content-type-builder": {
|
|
124
|
+
visible: boolean;
|
|
125
|
+
};
|
|
126
|
+
i18n: {
|
|
127
|
+
localized: boolean;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
attributes: {
|
|
131
|
+
title: {
|
|
132
|
+
type: string;
|
|
133
|
+
configurable: boolean;
|
|
134
|
+
required: boolean;
|
|
135
|
+
pluginOptions: {
|
|
136
|
+
i18n: {
|
|
137
|
+
localized: boolean;
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
type: {
|
|
142
|
+
type: string;
|
|
143
|
+
enum: string[];
|
|
144
|
+
default: string;
|
|
145
|
+
configurable: boolean;
|
|
146
|
+
};
|
|
147
|
+
path: {
|
|
148
|
+
type: string;
|
|
149
|
+
targetField: string;
|
|
150
|
+
configurable: boolean;
|
|
151
|
+
};
|
|
152
|
+
externalPath: {
|
|
153
|
+
type: string;
|
|
154
|
+
configurable: boolean;
|
|
155
|
+
};
|
|
156
|
+
uiRouterKey: {
|
|
157
|
+
type: string;
|
|
158
|
+
configurable: boolean;
|
|
159
|
+
};
|
|
160
|
+
menuAttached: {
|
|
161
|
+
type: string;
|
|
162
|
+
default: boolean;
|
|
163
|
+
configurable: boolean;
|
|
164
|
+
};
|
|
165
|
+
order: {
|
|
166
|
+
type: string;
|
|
167
|
+
default: number;
|
|
168
|
+
configurable: boolean;
|
|
169
|
+
};
|
|
170
|
+
collapsed: {
|
|
171
|
+
type: string;
|
|
172
|
+
default: boolean;
|
|
173
|
+
configurable: boolean;
|
|
174
|
+
};
|
|
175
|
+
related: {
|
|
176
|
+
type: string;
|
|
177
|
+
relation: string;
|
|
178
|
+
target: string;
|
|
179
|
+
configurable: boolean;
|
|
180
|
+
};
|
|
181
|
+
parent: {
|
|
182
|
+
type: string;
|
|
183
|
+
relation: string;
|
|
184
|
+
target: string;
|
|
185
|
+
configurable: boolean;
|
|
186
|
+
default: null;
|
|
187
|
+
};
|
|
188
|
+
master: {
|
|
189
|
+
type: string;
|
|
190
|
+
relation: string;
|
|
191
|
+
target: string;
|
|
192
|
+
configurable: boolean;
|
|
193
|
+
};
|
|
194
|
+
audience: {
|
|
195
|
+
type: string;
|
|
196
|
+
relation: string;
|
|
197
|
+
target: string;
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
};
|
|
202
|
+
"navigations-items-related": {
|
|
203
|
+
lifecycle: {
|
|
204
|
+
lifecycles: {
|
|
205
|
+
afterFind(results: any): void;
|
|
206
|
+
};
|
|
207
|
+
};
|
|
208
|
+
schema: {
|
|
209
|
+
collectionName: string;
|
|
210
|
+
info: {
|
|
211
|
+
singularName: string;
|
|
212
|
+
pluralName: string;
|
|
213
|
+
displayName: string;
|
|
214
|
+
name: string;
|
|
215
|
+
};
|
|
216
|
+
options: {
|
|
217
|
+
increments: boolean;
|
|
218
|
+
timestamps: boolean;
|
|
219
|
+
populateCreatorFields: boolean;
|
|
220
|
+
};
|
|
221
|
+
pluginOptions: {
|
|
222
|
+
"content-manager": {
|
|
223
|
+
visible: boolean;
|
|
224
|
+
};
|
|
225
|
+
"content-type-builder": {
|
|
226
|
+
visible: boolean;
|
|
227
|
+
};
|
|
228
|
+
i18n: {
|
|
229
|
+
localized: boolean;
|
|
230
|
+
};
|
|
231
|
+
};
|
|
232
|
+
attributes: {
|
|
233
|
+
related_id: {
|
|
234
|
+
type: string;
|
|
235
|
+
required: boolean;
|
|
236
|
+
};
|
|
237
|
+
related_type: {
|
|
238
|
+
type: string;
|
|
239
|
+
required: boolean;
|
|
240
|
+
};
|
|
241
|
+
field: {
|
|
242
|
+
type: string;
|
|
243
|
+
required: boolean;
|
|
244
|
+
};
|
|
245
|
+
order: {
|
|
246
|
+
type: string;
|
|
247
|
+
required: boolean;
|
|
248
|
+
};
|
|
249
|
+
master: {
|
|
250
|
+
type: string;
|
|
251
|
+
required: boolean;
|
|
252
|
+
};
|
|
253
|
+
};
|
|
254
|
+
};
|
|
255
|
+
};
|
|
256
|
+
};
|
|
257
|
+
controllers: import("../types").NavigationController;
|
|
258
|
+
destroy: () => void;
|
|
259
|
+
middlewares: {};
|
|
260
|
+
policies: {};
|
|
261
|
+
register: () => Promise<void>;
|
|
262
|
+
routes: {
|
|
263
|
+
admin: import("../types").StrapiRoutes;
|
|
264
|
+
'content-api': import("../types").StrapiRoutes;
|
|
265
|
+
};
|
|
266
|
+
services: {
|
|
267
|
+
common: (context: import("strapi-typed").StrapiContext) => import("../types").ICommonService;
|
|
268
|
+
admin: (context: import("strapi-typed").StrapiContext) => import("../types").IAdminService;
|
|
269
|
+
client: (context: import("strapi-typed").StrapiContext) => import("../types").IClientService;
|
|
270
|
+
};
|
|
271
|
+
};
|
|
272
|
+
export default _default;
|
|
273
|
+
//# sourceMappingURL=index.d.ts.map
|