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,139 @@
|
|
|
1
|
+
import { Id, IStrapi, Primitive, StrapiContentType, StrapiPlugin, StringMap } from "strapi-typed";
|
|
2
|
+
import { AuditLogContext, AuditLogParams, ContentTypeEntity, NavigationActions, NavigationItem, NavigationItemEntity, NavigationService, NavigationServiceName, NestedPath, NestedStructure, PluginConfigNameFields, ToBeFixed } from "../../types";
|
|
3
|
+
import { NavigationError } from '../../utils/NavigationError';
|
|
4
|
+
export declare const getPluginService: <T extends NavigationService>(name: NavigationServiceName) => T;
|
|
5
|
+
export declare const errorHandler: (ctx: ToBeFixed) => (error: NavigationError | string) => any;
|
|
6
|
+
export declare const parseParams: <TParams extends StringMap<string> = StringMap<string>, TResult extends StringMap<Primitive> = StringMap<Primitive>>(params: TParams) => TResult;
|
|
7
|
+
export declare const templateNameFactory: (items: import("strapi-typed").TypeResult<{
|
|
8
|
+
path: string | null;
|
|
9
|
+
title: string;
|
|
10
|
+
type: import("../../types").NavigationItemType;
|
|
11
|
+
collapsed: boolean;
|
|
12
|
+
menuAttached: boolean;
|
|
13
|
+
order: number;
|
|
14
|
+
uiRouterKey: string;
|
|
15
|
+
} & {
|
|
16
|
+
createdAt: string;
|
|
17
|
+
updatedAt: string;
|
|
18
|
+
} & {
|
|
19
|
+
id: number;
|
|
20
|
+
parent: import("strapi-typed").TypeResult<{
|
|
21
|
+
path: string | null;
|
|
22
|
+
title: string;
|
|
23
|
+
type: import("../../types").NavigationItemType;
|
|
24
|
+
collapsed: boolean;
|
|
25
|
+
menuAttached: boolean;
|
|
26
|
+
order: number;
|
|
27
|
+
uiRouterKey: string;
|
|
28
|
+
} & {
|
|
29
|
+
createdAt: string;
|
|
30
|
+
updatedAt: string;
|
|
31
|
+
} & {
|
|
32
|
+
id: number;
|
|
33
|
+
parent: import("strapi-typed").TypeResult<{
|
|
34
|
+
path: string | null;
|
|
35
|
+
title: string;
|
|
36
|
+
type: import("../../types").NavigationItemType;
|
|
37
|
+
collapsed: boolean;
|
|
38
|
+
menuAttached: boolean;
|
|
39
|
+
order: number;
|
|
40
|
+
uiRouterKey: string;
|
|
41
|
+
} & {
|
|
42
|
+
createdAt: string;
|
|
43
|
+
updatedAt: string;
|
|
44
|
+
} & any> | null;
|
|
45
|
+
master: import("../../types").Navigation;
|
|
46
|
+
audience: import("../../types").Audience[];
|
|
47
|
+
externalPath: string | null;
|
|
48
|
+
related: import("../../types").NavigationItemRelated | null;
|
|
49
|
+
}> | null;
|
|
50
|
+
master: import("../../types").Navigation;
|
|
51
|
+
audience: import("../../types").Audience[];
|
|
52
|
+
externalPath: string | null;
|
|
53
|
+
related: ContentTypeEntity | ContentTypeEntity[] | null;
|
|
54
|
+
}>[] | undefined, strapi: IStrapi, contentTypes?: StrapiContentType<ToBeFixed>[]) => Promise<(contentType: ToBeFixed, id: Id) => any>;
|
|
55
|
+
export declare const getTemplateComponentFromTemplate: (strapi: IStrapi, template?: ToBeFixed[]) => any;
|
|
56
|
+
export declare const prepareAuditLog: (actions: NavigationActions[]) => string;
|
|
57
|
+
export declare const sendAuditLog: (auditLogInstance: AuditLogContext, event: string, data: AuditLogParams) => void;
|
|
58
|
+
export declare const composeItemTitle: (item: NavigationItemEntity<ContentTypeEntity[] | ContentTypeEntity>, fields?: PluginConfigNameFields, contentTypes?: StrapiContentType<ToBeFixed>[]) => string | undefined;
|
|
59
|
+
export declare const extractItemRelationTitle: (relatedItem: ContentTypeEntity, fields?: PluginConfigNameFields, contentTypes?: StrapiContentType<ToBeFixed>[]) => unknown;
|
|
60
|
+
export declare const filterOutUnpublished: (item: NavigationItemEntity<ContentTypeEntity | ContentTypeEntity[]>) => unknown;
|
|
61
|
+
export declare const checkDuplicatePath: (parentItem: ToBeFixed | null, checkData: NavigationItem[]) => Promise<void>;
|
|
62
|
+
export declare const singularize: (value?: string) => string;
|
|
63
|
+
export declare const extractMeta: (plugins: {
|
|
64
|
+
[uid: string]: StrapiPlugin;
|
|
65
|
+
}) => {
|
|
66
|
+
masterModel: any;
|
|
67
|
+
itemModel: any;
|
|
68
|
+
relatedModel: any;
|
|
69
|
+
audienceModel: any;
|
|
70
|
+
plugin: StrapiPlugin;
|
|
71
|
+
pluginName: string;
|
|
72
|
+
};
|
|
73
|
+
export declare const buildNestedStructure: (entities: NavigationItemEntity<ContentTypeEntity>[], id?: Id | null, field?: keyof NavigationItemEntity) => NestedStructure<NavigationItemEntity<ContentTypeEntity>>[];
|
|
74
|
+
export declare const buildNestedPaths: <T extends Pick<import("strapi-typed").TypeResult<{
|
|
75
|
+
path: string | null;
|
|
76
|
+
title: string;
|
|
77
|
+
type: import("../../types").NavigationItemType;
|
|
78
|
+
collapsed: boolean;
|
|
79
|
+
menuAttached: boolean;
|
|
80
|
+
order: number;
|
|
81
|
+
uiRouterKey: string;
|
|
82
|
+
} & {
|
|
83
|
+
createdAt: string;
|
|
84
|
+
updatedAt: string;
|
|
85
|
+
} & {
|
|
86
|
+
id: number;
|
|
87
|
+
parent: import("strapi-typed").TypeResult<{
|
|
88
|
+
path: string | null;
|
|
89
|
+
title: string;
|
|
90
|
+
type: import("../../types").NavigationItemType;
|
|
91
|
+
collapsed: boolean;
|
|
92
|
+
menuAttached: boolean;
|
|
93
|
+
order: number;
|
|
94
|
+
uiRouterKey: string;
|
|
95
|
+
} & {
|
|
96
|
+
createdAt: string;
|
|
97
|
+
updatedAt: string;
|
|
98
|
+
} & any> | null;
|
|
99
|
+
master: import("../../types").Navigation;
|
|
100
|
+
audience: import("../../types").Audience[];
|
|
101
|
+
externalPath: string | null;
|
|
102
|
+
related: import("../../types").NavigationItemRelated | null;
|
|
103
|
+
}>, "id" | "path" | "parent">>(items: T[], id?: Id | null, parentPath?: string | null) => NestedPath[];
|
|
104
|
+
export declare const filterByPath: <T extends Pick<import("strapi-typed").TypeResult<{
|
|
105
|
+
path: string | null;
|
|
106
|
+
title: string;
|
|
107
|
+
type: import("../../types").NavigationItemType;
|
|
108
|
+
collapsed: boolean;
|
|
109
|
+
menuAttached: boolean;
|
|
110
|
+
order: number;
|
|
111
|
+
uiRouterKey: string;
|
|
112
|
+
} & {
|
|
113
|
+
createdAt: string;
|
|
114
|
+
updatedAt: string;
|
|
115
|
+
} & {
|
|
116
|
+
id: number;
|
|
117
|
+
parent: import("strapi-typed").TypeResult<{
|
|
118
|
+
path: string | null;
|
|
119
|
+
title: string;
|
|
120
|
+
type: import("../../types").NavigationItemType;
|
|
121
|
+
collapsed: boolean;
|
|
122
|
+
menuAttached: boolean;
|
|
123
|
+
order: number;
|
|
124
|
+
uiRouterKey: string;
|
|
125
|
+
} & {
|
|
126
|
+
createdAt: string;
|
|
127
|
+
updatedAt: string;
|
|
128
|
+
} & any> | null;
|
|
129
|
+
master: import("../../types").Navigation;
|
|
130
|
+
audience: import("../../types").Audience[];
|
|
131
|
+
externalPath: string | null;
|
|
132
|
+
related: import("../../types").NavigationItemRelated | null;
|
|
133
|
+
}>, "id" | "path" | "parent">>(items: T[], path: string | null) => {
|
|
134
|
+
root?: NestedPath | undefined;
|
|
135
|
+
items: T[];
|
|
136
|
+
};
|
|
137
|
+
export declare const isContentTypeEligible: (uid?: string) => boolean | "";
|
|
138
|
+
export declare const intercalate: <T, U extends T>(glue: T, arr: U[]) => (T | U)[];
|
|
139
|
+
//# sourceMappingURL=functions.d.ts.map
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.intercalate = exports.isContentTypeEligible = exports.filterByPath = exports.buildNestedPaths = exports.buildNestedStructure = exports.extractMeta = exports.singularize = exports.checkDuplicatePath = exports.filterOutUnpublished = exports.extractItemRelationTitle = exports.composeItemTitle = exports.sendAuditLog = exports.prepareAuditLog = exports.getTemplateComponentFromTemplate = exports.templateNameFactory = exports.parseParams = exports.errorHandler = exports.getPluginService = void 0;
|
|
4
|
+
const lodash_1 = require("lodash");
|
|
5
|
+
const NavigationError_1 = require("../../utils/NavigationError");
|
|
6
|
+
const constant_1 = require("./constant");
|
|
7
|
+
const getPluginService = (name) => strapi.plugin("navigation").service(name);
|
|
8
|
+
exports.getPluginService = getPluginService;
|
|
9
|
+
const errorHandler = (ctx) => (error) => {
|
|
10
|
+
if (error instanceof NavigationError_1.NavigationError) {
|
|
11
|
+
return ctx.badRequest(error.message, error.additionalInfo);
|
|
12
|
+
}
|
|
13
|
+
throw error;
|
|
14
|
+
};
|
|
15
|
+
exports.errorHandler = errorHandler;
|
|
16
|
+
const parseParams = (params) => Object.keys(params).reduce((prev, curr) => {
|
|
17
|
+
const value = params[curr];
|
|
18
|
+
const parsedValue = isNaN(Number(value)) ? value : parseInt(value, 10);
|
|
19
|
+
return {
|
|
20
|
+
...prev,
|
|
21
|
+
[curr]: parsedValue,
|
|
22
|
+
};
|
|
23
|
+
}, {});
|
|
24
|
+
exports.parseParams = parseParams;
|
|
25
|
+
const templateNameFactory = async (items = [], strapi, contentTypes = []) => {
|
|
26
|
+
const flatRelated = (0, lodash_1.flatten)(items.map(i => i.related)).filter(_ => !!_);
|
|
27
|
+
const relatedMap = (flatRelated).reduce((acc, curr) => {
|
|
28
|
+
if (curr === null)
|
|
29
|
+
return acc;
|
|
30
|
+
const index = curr.__contentType;
|
|
31
|
+
if (typeof index !== 'string')
|
|
32
|
+
return acc;
|
|
33
|
+
if (!acc[index]) {
|
|
34
|
+
acc[index] = [];
|
|
35
|
+
}
|
|
36
|
+
acc[index].push(curr.id);
|
|
37
|
+
return acc;
|
|
38
|
+
}, {});
|
|
39
|
+
const responses = await Promise.all(Object.entries(relatedMap)
|
|
40
|
+
.map(([contentType, ids]) => {
|
|
41
|
+
const contentTypeUid = (0, lodash_1.get)((0, lodash_1.find)(contentTypes, cnt => cnt.uid === contentType), 'uid');
|
|
42
|
+
return strapi.query(contentTypeUid)
|
|
43
|
+
.findMany({
|
|
44
|
+
where: { id: { $in: ids } },
|
|
45
|
+
limit: Number.MAX_SAFE_INTEGER,
|
|
46
|
+
})
|
|
47
|
+
.then(res => ({ [contentType]: res }));
|
|
48
|
+
}));
|
|
49
|
+
const relatedResponseMap = responses.reduce((acc, curr) => ({ ...acc, ...curr }), {});
|
|
50
|
+
const singleTypes = new Map(contentTypes
|
|
51
|
+
.filter(x => x.isSingle)
|
|
52
|
+
.map(({ contentTypeName, templateName }) => [contentTypeName, templateName || contentTypeName]));
|
|
53
|
+
return (contentType, id) => {
|
|
54
|
+
const template = (0, lodash_1.get)(relatedResponseMap[contentType].find(data => data.id === id), 'template');
|
|
55
|
+
if (template && template instanceof Array) {
|
|
56
|
+
const templateComponent = (0, exports.getTemplateComponentFromTemplate)(strapi, template);
|
|
57
|
+
return (0, lodash_1.get)(templateComponent, 'options.templateName', constant_1.TEMPLATE_DEFAULT);
|
|
58
|
+
}
|
|
59
|
+
if (singleTypes.get(contentType)) {
|
|
60
|
+
return singleTypes.get(contentType);
|
|
61
|
+
}
|
|
62
|
+
return constant_1.TEMPLATE_DEFAULT;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
exports.templateNameFactory = templateNameFactory;
|
|
66
|
+
const getTemplateComponentFromTemplate = (strapi, template = []) => {
|
|
67
|
+
const componentName = (0, lodash_1.get)((0, lodash_1.first)(template), '__component');
|
|
68
|
+
return !!componentName ? strapi.components[componentName] : null;
|
|
69
|
+
};
|
|
70
|
+
exports.getTemplateComponentFromTemplate = getTemplateComponentFromTemplate;
|
|
71
|
+
const prepareAuditLog = (actions) => {
|
|
72
|
+
return [
|
|
73
|
+
...new Set(actions
|
|
74
|
+
.filter((_) => !!_)
|
|
75
|
+
.flatMap(({ remove, create, update }) => {
|
|
76
|
+
return [create ? 'CREATE' : '', update ? 'UPDATE' : '', remove ? 'REMOVE' : '']
|
|
77
|
+
.filter(_ => !!_);
|
|
78
|
+
})),
|
|
79
|
+
].join('_');
|
|
80
|
+
};
|
|
81
|
+
exports.prepareAuditLog = prepareAuditLog;
|
|
82
|
+
const sendAuditLog = (auditLogInstance, event, data) => {
|
|
83
|
+
if (auditLogInstance && auditLogInstance.emit) {
|
|
84
|
+
auditLogInstance.emit(event, data);
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
exports.sendAuditLog = sendAuditLog;
|
|
88
|
+
const composeItemTitle = (item, fields = {}, contentTypes = []) => {
|
|
89
|
+
const { title, related } = item;
|
|
90
|
+
const lastRelated = (0, lodash_1.isArray)(related) ? (0, lodash_1.last)(related) : related;
|
|
91
|
+
if (title) {
|
|
92
|
+
return (0, lodash_1.isString)(title) && !(0, lodash_1.isEmpty)(title) ? title : undefined;
|
|
93
|
+
}
|
|
94
|
+
else if (lastRelated) {
|
|
95
|
+
const relationTitle = (0, exports.extractItemRelationTitle)(lastRelated, fields, contentTypes);
|
|
96
|
+
return (0, lodash_1.isString)(relationTitle) && !(0, lodash_1.isEmpty)(relationTitle) ? relationTitle : undefined;
|
|
97
|
+
}
|
|
98
|
+
return undefined;
|
|
99
|
+
};
|
|
100
|
+
exports.composeItemTitle = composeItemTitle;
|
|
101
|
+
const extractItemRelationTitle = (relatedItem, fields = {}, contentTypes = []) => {
|
|
102
|
+
const { __contentType } = relatedItem;
|
|
103
|
+
const contentType = (0, lodash_1.find)(contentTypes, _ => _.contentTypeName === __contentType);
|
|
104
|
+
const { default: defaultFields = [] } = fields;
|
|
105
|
+
return (0, lodash_1.get)(fields, `${contentType ? contentType.collectionName : ''}`, defaultFields).map((_) => relatedItem[_]).filter((_) => _)[0] || '';
|
|
106
|
+
};
|
|
107
|
+
exports.extractItemRelationTitle = extractItemRelationTitle;
|
|
108
|
+
const filterOutUnpublished = (item) => {
|
|
109
|
+
const relatedItem = item.related && ((0, lodash_1.isArray)(item.related) ? (0, lodash_1.last)(item.related) : item.related);
|
|
110
|
+
const isHandledByPublishFlow = relatedItem ? 'published_at' in relatedItem : false;
|
|
111
|
+
if (isHandledByPublishFlow) {
|
|
112
|
+
const isRelatedDefinedAndPublished = relatedItem ?
|
|
113
|
+
isHandledByPublishFlow && (0, lodash_1.get)(relatedItem, 'published_at') :
|
|
114
|
+
false;
|
|
115
|
+
return item.type === "INTERNAL" ? isRelatedDefinedAndPublished : true;
|
|
116
|
+
}
|
|
117
|
+
return (item.type !== "INTERNAL") || relatedItem;
|
|
118
|
+
};
|
|
119
|
+
exports.filterOutUnpublished = filterOutUnpublished;
|
|
120
|
+
const checkDuplicatePath = (parentItem, checkData) => {
|
|
121
|
+
return new Promise((resolve, reject) => {
|
|
122
|
+
if (parentItem && parentItem.items) {
|
|
123
|
+
for (let item of checkData) {
|
|
124
|
+
for (let _ of parentItem.items) {
|
|
125
|
+
if (_.path === item.path && (_.id !== item.id) && (item.type === "INTERNAL")) {
|
|
126
|
+
return reject(new NavigationError_1.NavigationError(`Duplicate path:${item.path} in parent: ${parentItem.title || 'root'} for ${item.title} and ${_.title} items`, {
|
|
127
|
+
parentTitle: parentItem.title,
|
|
128
|
+
parentId: parentItem.id,
|
|
129
|
+
path: item.path,
|
|
130
|
+
errorTitles: [item.title, _.title],
|
|
131
|
+
}));
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return resolve();
|
|
137
|
+
});
|
|
138
|
+
};
|
|
139
|
+
exports.checkDuplicatePath = checkDuplicatePath;
|
|
140
|
+
const singularize = (value = '') => {
|
|
141
|
+
return (0, lodash_1.last)(value) === 's' ? value.substr(0, value.length - 1) : value;
|
|
142
|
+
};
|
|
143
|
+
exports.singularize = singularize;
|
|
144
|
+
const extractMeta = (plugins) => {
|
|
145
|
+
const { navigation: plugin } = plugins;
|
|
146
|
+
return {
|
|
147
|
+
masterModel: plugin.contentType('navigation'),
|
|
148
|
+
itemModel: plugin.contentType('navigation-item'),
|
|
149
|
+
relatedModel: plugin.contentType('navigations-items-related'),
|
|
150
|
+
audienceModel: plugin.contentType('audience'),
|
|
151
|
+
plugin,
|
|
152
|
+
pluginName: 'navigation',
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
exports.extractMeta = extractMeta;
|
|
156
|
+
const buildNestedStructure = (entities, id = null, field = 'parent') => {
|
|
157
|
+
return entities
|
|
158
|
+
.filter(entity => {
|
|
159
|
+
let data = entity[field];
|
|
160
|
+
if (data == null && id === null) {
|
|
161
|
+
return true;
|
|
162
|
+
}
|
|
163
|
+
if (data && typeof id === 'string') {
|
|
164
|
+
data = data.toString();
|
|
165
|
+
}
|
|
166
|
+
if (!!data && typeof data === 'object' && 'id' in data) {
|
|
167
|
+
return (data).id === id;
|
|
168
|
+
}
|
|
169
|
+
return (data && data === id);
|
|
170
|
+
})
|
|
171
|
+
.map(entity => {
|
|
172
|
+
return ({
|
|
173
|
+
...entity,
|
|
174
|
+
related: entity.related,
|
|
175
|
+
items: (0, exports.buildNestedStructure)(entities, entity.id, field),
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
};
|
|
179
|
+
exports.buildNestedStructure = buildNestedStructure;
|
|
180
|
+
const buildNestedPaths = (items, id = null, parentPath = null) => {
|
|
181
|
+
return items
|
|
182
|
+
.filter(entity => {
|
|
183
|
+
let data = entity.parent;
|
|
184
|
+
if (data == null && id === null) {
|
|
185
|
+
return true;
|
|
186
|
+
}
|
|
187
|
+
if (data && typeof id === 'string') {
|
|
188
|
+
data = data.toString();
|
|
189
|
+
}
|
|
190
|
+
return (data && data === id) || ((0, lodash_1.isObject)(entity.parent) && ((entity.parent).id === id));
|
|
191
|
+
})
|
|
192
|
+
.reduce((acc, entity) => {
|
|
193
|
+
const path = `${parentPath || ''}/${entity.path}`;
|
|
194
|
+
return [
|
|
195
|
+
{
|
|
196
|
+
id: entity.id,
|
|
197
|
+
parent: parentPath ? {
|
|
198
|
+
id: (0, lodash_1.get)(entity, 'parent.id'),
|
|
199
|
+
path: parentPath,
|
|
200
|
+
} : undefined,
|
|
201
|
+
path,
|
|
202
|
+
},
|
|
203
|
+
...(0, exports.buildNestedPaths)(items, entity.id, path),
|
|
204
|
+
...acc,
|
|
205
|
+
];
|
|
206
|
+
}, []);
|
|
207
|
+
};
|
|
208
|
+
exports.buildNestedPaths = buildNestedPaths;
|
|
209
|
+
const filterByPath = (items, path) => {
|
|
210
|
+
const itemsWithPaths = path ? (0, exports.buildNestedPaths)(items).filter(({ path: itemPath }) => itemPath.includes(path)) : [];
|
|
211
|
+
const root = itemsWithPaths.find(({ path: itemPath }) => itemPath === path);
|
|
212
|
+
return {
|
|
213
|
+
root,
|
|
214
|
+
items: (0, lodash_1.isNil)(root) ? [] : items.filter(({ id }) => (itemsWithPaths.find(v => v.id === id))),
|
|
215
|
+
};
|
|
216
|
+
};
|
|
217
|
+
exports.filterByPath = filterByPath;
|
|
218
|
+
const isContentTypeEligible = (uid = '') => {
|
|
219
|
+
const isOneOfAllowedType = constant_1.ALLOWED_CONTENT_TYPES.filter(_ => uid.includes(_)).length > 0;
|
|
220
|
+
const isNoneOfRestricted = constant_1.RESTRICTED_CONTENT_TYPES.filter(_ => uid.includes(_) || (uid === _)).length === 0;
|
|
221
|
+
return uid && isOneOfAllowedType && isNoneOfRestricted;
|
|
222
|
+
};
|
|
223
|
+
exports.isContentTypeEligible = isContentTypeEligible;
|
|
224
|
+
const intercalate = (glue, arr) => arr.slice(1).reduce((acc, element) => acc.concat([glue, element]), arr.slice(0, 1));
|
|
225
|
+
exports.intercalate = intercalate;
|
|
226
|
+
//# sourceMappingURL=functions.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./functions"), exports);
|
|
18
|
+
__exportStar(require("./constant"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
package/strapi-admin.js
CHANGED
|
@@ -1 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const src_1 = __importDefault(require("./admin/src"));
|
|
7
|
+
exports.default = src_1.default;
|
|
8
|
+
//# sourceMappingURL=strapi-admin.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;
|
|
273
|
+
//# sourceMappingURL=strapi-server.d.ts.map
|