strapi-plugin-navigation 3.0.0-beta.0 → 3.0.0-beta.2
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 +23 -28
- package/dist/_chunks/ca-Bjfh0w36.js +480 -0
- package/dist/_chunks/ca-DIZHA0OL.mjs +480 -0
- package/dist/_chunks/en-BPYZYsnc.mjs +490 -0
- package/dist/_chunks/en-CT7eKHZS.js +490 -0
- package/dist/_chunks/fr-BTVWPkax.mjs +490 -0
- package/dist/_chunks/fr-ybbSdjZO.js +490 -0
- package/dist/admin/index.js +55426 -0
- package/dist/admin/index.mjs +55408 -0
- package/dist/admin/src/api/client.d.ts +192 -0
- package/dist/admin/src/api/validators.d.ts +1828 -0
- package/dist/admin/src/components/ConfirmationDialog/index.d.ts +20 -0
- package/dist/admin/src/components/Initializer.d.ts +5 -0
- package/dist/admin/src/components/RestartAlert/index.d.ts +2 -0
- package/dist/admin/src/components/TextArrayInput/index.d.ts +12 -0
- package/dist/admin/src/components/icons/navigation.d.ts +4 -0
- package/dist/admin/src/components/icons/pluginIcon.d.ts +7 -0
- package/dist/admin/src/index.d.ts +10 -0
- package/dist/admin/src/pages/App.d.ts +2 -0
- package/dist/admin/src/pages/HomePage/components/AdditionalFieldInput/index.d.ts +12 -0
- package/dist/admin/src/pages/HomePage/components/CollapseButton/index.d.ts +8 -0
- package/dist/admin/src/pages/HomePage/components/DragButton/index.d.ts +5 -0
- package/dist/admin/src/pages/HomePage/components/I18nCopyNavigationItems/index.d.ts +13 -0
- package/dist/admin/src/pages/HomePage/components/NavigationContentHeader/index.d.ts +7 -0
- package/dist/admin/src/pages/HomePage/components/NavigationHeader/hooks.d.ts +5 -0
- package/dist/admin/src/pages/HomePage/components/NavigationHeader/index.d.ts +23 -0
- package/dist/admin/src/pages/HomePage/components/NavigationHeader/styles.d.ts +2 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemForm/index.d.ts +22 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemForm/types.d.ts +45 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemForm/utils/form.d.ts +184 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemForm/utils/hooks.d.ts +1 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemForm/utils/properties.d.ts +33 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemList/Wrapper.d.ts +5 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemList/index.d.ts +25 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemListItem/ItemCardBadge/index.d.ts +2 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemListItem/ItemCardHeader/Wrapper.d.ts +2 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemListItem/ItemCardHeader/icons.d.ts +5 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemListItem/ItemCardHeader/index.d.ts +16 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemListItem/ItemCardRemovedOverlay/index.d.ts +2 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemListItem/Wrapper.d.ts +6 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemListItem/index.d.ts +44 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemPopup/NavigationItemPopupFooter.d.ts +10 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemPopup/NavigationItemPopupHeader.d.ts +4 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemPopup/index.d.ts +19 -0
- package/dist/admin/src/pages/HomePage/components/NavigationManager/AllNavigations/icons.d.ts +3 -0
- package/dist/admin/src/pages/HomePage/components/NavigationManager/AllNavigations/index.d.ts +7 -0
- package/dist/admin/src/pages/HomePage/components/NavigationManager/DeletionConfirm/index.d.ts +7 -0
- package/dist/admin/src/pages/HomePage/components/NavigationManager/ErrorDetails/index.d.ts +7 -0
- package/dist/admin/src/pages/HomePage/components/NavigationManager/Footer/index.d.ts +26 -0
- package/dist/admin/src/pages/HomePage/components/NavigationManager/Form/hooks.d.ts +13 -0
- package/dist/admin/src/pages/HomePage/components/NavigationManager/Form/index.d.ts +10 -0
- package/dist/admin/src/pages/HomePage/components/NavigationManager/NavigationUpdate/index.d.ts +7 -0
- package/dist/admin/src/pages/HomePage/components/NavigationManager/NewNavigation/index.d.ts +8 -0
- package/dist/admin/src/pages/HomePage/components/NavigationManager/PurgeCacheConfirm/index.d.ts +7 -0
- package/dist/admin/src/pages/HomePage/components/NavigationManager/index.d.ts +9 -0
- package/dist/admin/src/pages/HomePage/components/NavigationManager/types.d.ts +46 -0
- package/dist/admin/src/pages/HomePage/components/Search/index.d.ts +11 -0
- package/dist/admin/src/pages/HomePage/hooks/index.d.ts +144 -0
- package/dist/admin/src/pages/HomePage/index.d.ts +2 -0
- package/dist/admin/src/pages/HomePage/utils/index.d.ts +5 -0
- package/dist/admin/src/pages/HomePage/utils/parsers.d.ts +46 -0
- package/dist/admin/src/pages/SettingsPage/common/const.d.ts +1 -0
- package/dist/admin/src/pages/SettingsPage/components/CustomFieldForm/index.d.ts +11 -0
- package/dist/admin/src/pages/SettingsPage/components/CustomFieldModal/index.d.ts +11 -0
- package/dist/admin/src/pages/SettingsPage/components/CustomFieldTable/index.d.ts +11 -0
- package/dist/admin/src/pages/SettingsPage/hooks/index.d.ts +369 -0
- package/dist/admin/src/pages/SettingsPage/index.d.ts +1 -0
- package/dist/admin/src/pages/SettingsPage/types.d.ts +7 -0
- package/dist/admin/src/pages/SettingsPage/utils/index.d.ts +9 -0
- package/dist/admin/src/pluginId.d.ts +1 -0
- package/dist/admin/src/schemas/config.d.ts +453 -0
- package/dist/admin/src/schemas/content-type.d.ts +49 -0
- package/dist/admin/src/translations/ca.d.ts +478 -0
- package/dist/admin/src/translations/en.d.ts +489 -0
- package/dist/admin/src/translations/fr.d.ts +488 -0
- package/dist/admin/src/translations/index.d.ts +14 -0
- package/dist/admin/src/types.d.ts +6 -0
- package/dist/admin/src/utils/constants.d.ts +1 -0
- package/dist/admin/src/utils/getTranslation.d.ts +3 -0
- package/dist/admin/src/utils/permissions.d.ts +15 -0
- package/dist/admin/src/utils/prefixPluginTranslations.d.ts +3 -0
- package/dist/assets/configuration.png +0 -0
- package/dist/assets/logo.png +0 -0
- package/dist/assets/manager-view.png +0 -0
- package/dist/assets/marketplace.png +0 -0
- package/dist/assets/preview.png +0 -0
- package/dist/server/index.js +16171 -0
- package/dist/server/index.mjs +16135 -0
- package/dist/server/src/app-errors.d.ts +11 -0
- package/dist/server/src/bootstrap.d.ts +5 -0
- package/dist/server/src/cache/index.d.ts +4 -0
- package/dist/server/src/config/index.d.ts +20 -0
- package/dist/server/src/config/setup.d.ts +41 -0
- package/dist/server/src/content-types/audience/index.d.ts +26 -0
- package/dist/server/src/content-types/audience/schema.d.ts +24 -0
- package/dist/server/src/content-types/index.d.ts +190 -0
- package/dist/server/src/content-types/navigation/index.d.ts +56 -0
- package/dist/server/src/content-types/navigation/lifecycles.d.ts +2 -0
- package/dist/server/src/content-types/navigation/schema.d.ts +53 -0
- package/dist/server/src/content-types/navigation-item/index.d.ts +108 -0
- package/dist/server/src/content-types/navigation-item/lifecycles.d.ts +2 -0
- package/dist/server/src/content-types/navigation-item/schema.d.ts +105 -0
- package/dist/server/src/controllers/admin.d.ts +241 -0
- package/dist/server/src/controllers/client.d.ts +192 -0
- package/dist/server/src/controllers/index.d.ts +7 -0
- package/dist/server/src/controllers/utils.d.ts +4 -0
- package/dist/server/src/controllers/validators.d.ts +62 -0
- package/dist/server/src/destroy.d.ts +5 -0
- package/dist/server/src/dtos/config.d.ts +28 -0
- package/dist/server/src/dtos/index.d.ts +3 -0
- package/dist/server/src/dtos/navigation-item.d.ts +52 -0
- package/dist/server/src/dtos/navigation.d.ts +5 -0
- package/dist/server/src/graphql/config.d.ts +5 -0
- package/dist/server/src/graphql/index.d.ts +1 -0
- package/dist/server/src/graphql/queries/index.d.ts +1 -0
- package/dist/server/src/graphql/queries/render-navigation-child.d.ts +31 -0
- package/dist/server/src/graphql/queries/render-navigation.d.ts +32 -0
- package/dist/server/src/graphql/resolvers-config.d.ts +8 -0
- package/dist/server/src/graphql/setup.d.ts +4 -0
- package/dist/server/src/graphql/types/content-types-name-fields.d.ts +2 -0
- package/dist/server/src/graphql/types/content-types.d.ts +2 -0
- package/dist/server/src/graphql/types/create-navigation-item.d.ts +2 -0
- package/dist/server/src/graphql/types/create-navigation-related.d.ts +2 -0
- package/dist/server/src/graphql/types/create-navigation.d.ts +2 -0
- package/dist/server/src/graphql/types/index.d.ts +1 -0
- package/dist/server/src/graphql/types/navigation-config.d.ts +2 -0
- package/dist/server/src/graphql/types/navigation-details.d.ts +2 -0
- package/dist/server/src/graphql/types/navigation-item-additional-field-media.d.ts +2 -0
- package/dist/server/src/graphql/types/navigation-item-additional-fields.d.ts +2 -0
- package/dist/server/src/graphql/types/navigation-item-related-data.d.ts +2 -0
- package/dist/server/src/graphql/types/navigation-item-related.d.ts +2 -0
- package/dist/server/src/graphql/types/navigation-item.d.ts +2 -0
- package/dist/server/src/graphql/types/navigation-render-type.d.ts +2 -0
- package/dist/server/src/graphql/types/navigation.d.ts +2 -0
- package/dist/server/src/i18n/index.d.ts +4 -0
- package/dist/server/src/index.d.ts +582 -0
- package/dist/server/src/middlewares/index.d.ts +2 -0
- package/dist/server/src/permissions/index.d.ts +3 -0
- package/dist/server/src/permissions/permissions.d.ts +9 -0
- package/dist/server/src/permissions/setup.d.ts +4 -0
- package/dist/server/src/permissions.d.ts +13 -0
- package/dist/server/src/policies/index.d.ts +2 -0
- package/dist/server/src/register.d.ts +5 -0
- package/dist/server/src/repositories/audience.d.ts +11 -0
- package/dist/server/src/repositories/generic.d.ts +23 -0
- package/dist/server/src/repositories/index.d.ts +4 -0
- package/dist/server/src/repositories/navigation-item.d.ts +24 -0
- package/dist/server/src/repositories/navigation.d.ts +47 -0
- package/dist/server/src/routes/admin.d.ts +24 -0
- package/dist/server/src/routes/client.d.ts +17 -0
- package/dist/server/src/routes/index.d.ts +37 -0
- package/dist/server/src/schemas/config.d.ts +424 -0
- package/dist/server/src/schemas/content-type.d.ts +918 -0
- package/dist/server/src/schemas/index.d.ts +3 -0
- package/dist/server/src/schemas/navigation.d.ts +237 -0
- package/dist/server/src/services/admin/admin.d.ts +32 -0
- package/dist/server/src/services/admin/index.d.ts +3 -0
- package/dist/server/src/services/admin/types.d.ts +47 -0
- package/dist/server/src/services/admin/utils.d.ts +32 -0
- package/dist/server/src/services/client/client.d.ts +93 -0
- package/dist/server/src/services/client/index.d.ts +3 -0
- package/dist/server/src/services/client/types.d.ts +66 -0
- package/dist/server/src/services/client/utils.d.ts +12 -0
- package/dist/server/src/services/common/common.d.ts +31 -0
- package/dist/server/src/services/common/index.d.ts +3 -0
- package/dist/server/src/services/common/types.d.ts +68 -0
- package/dist/server/src/services/common/utils.d.ts +12 -0
- package/dist/server/src/services/index.d.ts +320 -0
- package/dist/server/src/services/migration/index.d.ts +3 -0
- package/dist/server/src/services/migration/migration.d.ts +8 -0
- package/dist/server/src/types.d.ts +40 -0
- package/dist/server/src/utils/constants.d.ts +13 -0
- package/dist/server/src/utils/functions.d.ts +30 -0
- package/dist/server/src/utils/index.d.ts +2 -0
- package/package.json +116 -35
- package/admin/api/client.js +0 -107
- package/admin/api/validators.js +0 -248
- package/admin/components/ConfirmationDialog/index.js +0 -21
- package/admin/components/Initializer.js +0 -10
- package/admin/components/RestartAlert/index.js +0 -7
- package/admin/components/TextArrayInput/index.js +0 -18
- package/admin/components/icons/navigation.js +0 -9
- package/admin/components/icons/pluginIcon.js +0 -9
- package/admin/index.js +0 -48
- package/admin/pages/App.js +0 -10
- package/admin/pages/HomePage/components/AdditionalFieldInput/index.js +0 -58
- package/admin/pages/HomePage/components/CollapseButton/index.js +0 -15
- package/admin/pages/HomePage/components/DragButton/index.js +0 -55
- package/admin/pages/HomePage/components/I18nCopyNavigationItems/index.js +0 -9
- package/admin/pages/HomePage/components/NavigationContentHeader/index.js +0 -5
- package/admin/pages/HomePage/components/NavigationHeader/hooks.js +0 -14
- package/admin/pages/HomePage/components/NavigationHeader/index.js +0 -29
- package/admin/pages/HomePage/components/NavigationHeader/styles.js +0 -11
- package/admin/pages/HomePage/components/NavigationItemForm/index.js +0 -277
- package/admin/pages/HomePage/components/NavigationItemForm/types.js +0 -1
- package/admin/pages/HomePage/components/NavigationItemForm/utils/form.js +0 -105
- package/admin/pages/HomePage/components/NavigationItemForm/utils/hooks.js +0 -12
- package/admin/pages/HomePage/components/NavigationItemForm/utils/properties.js +0 -51
- package/admin/pages/HomePage/components/NavigationItemList/Wrapper.js +0 -21
- package/admin/pages/HomePage/components/NavigationItemList/index.js +0 -6
- package/admin/pages/HomePage/components/NavigationItemListItem/ItemCardBadge/index.js +0 -20
- package/admin/pages/HomePage/components/NavigationItemListItem/ItemCardHeader/Wrapper.js +0 -14
- package/admin/pages/HomePage/components/NavigationItemListItem/ItemCardHeader/icons.js +0 -6
- package/admin/pages/HomePage/components/NavigationItemListItem/ItemCardHeader/index.js +0 -19
- package/admin/pages/HomePage/components/NavigationItemListItem/ItemCardRemovedOverlay/index.js +0 -11
- package/admin/pages/HomePage/components/NavigationItemListItem/Wrapper.js +0 -38
- package/admin/pages/HomePage/components/NavigationItemListItem/index.js +0 -165
- package/admin/pages/HomePage/components/NavigationItemPopup/NavigationItemPopupFooter.js +0 -11
- package/admin/pages/HomePage/components/NavigationItemPopup/NavigationItemPopupHeader.js +0 -12
- package/admin/pages/HomePage/components/NavigationItemPopup/index.js +0 -34
- package/admin/pages/HomePage/components/NavigationManager/AllNavigations/icons.js +0 -5
- package/admin/pages/HomePage/components/NavigationManager/AllNavigations/index.js +0 -79
- package/admin/pages/HomePage/components/NavigationManager/DeletionConfirm/index.js +0 -25
- package/admin/pages/HomePage/components/NavigationManager/ErrorDetails/index.js +0 -29
- package/admin/pages/HomePage/components/NavigationManager/Footer/index.js +0 -6
- package/admin/pages/HomePage/components/NavigationManager/Form/hooks.js +0 -19
- package/admin/pages/HomePage/components/NavigationManager/Form/index.js +0 -26
- package/admin/pages/HomePage/components/NavigationManager/NavigationUpdate/index.js +0 -32
- package/admin/pages/HomePage/components/NavigationManager/NewNavigation/index.js +0 -35
- package/admin/pages/HomePage/components/NavigationManager/PurgeCacheConfirm/index.js +0 -25
- package/admin/pages/HomePage/components/NavigationManager/index.js +0 -236
- package/admin/pages/HomePage/components/NavigationManager/types.js +0 -1
- package/admin/pages/HomePage/components/Search/index.js +0 -58
- package/admin/pages/HomePage/hooks/index.js +0 -165
- package/admin/pages/HomePage/index.js +0 -231
- package/admin/pages/HomePage/utils/index.js +0 -16
- package/admin/pages/HomePage/utils/parsers.js +0 -187
- package/admin/pages/SettingsPage/common/const.js +0 -1
- package/admin/pages/SettingsPage/components/CustomFieldForm/hooks/index.js +0 -10
- package/admin/pages/SettingsPage/components/CustomFieldForm/index.js +0 -36
- package/admin/pages/SettingsPage/components/CustomFieldModal/index.js +0 -16
- package/admin/pages/SettingsPage/components/CustomFieldTable/index.js +0 -45
- package/admin/pages/SettingsPage/hooks/index.js +0 -111
- package/admin/pages/SettingsPage/index.js +0 -189
- package/admin/pages/SettingsPage/types.js +0 -1
- package/admin/pages/SettingsPage/utils/index.js +0 -25
- package/admin/pluginId.js +0 -1
- package/admin/schemas/config.js +0 -53
- package/admin/schemas/content-type.js +0 -14
- package/admin/translations/ca.json +0 -199
- package/admin/translations/en.json +0 -218
- package/admin/translations/fr.json +0 -48
- package/admin/translations/index.js +0 -15
- package/admin/types.js +0 -1
- package/admin/utils/constants.js +0 -1
- package/admin/utils/getTranslation.js +0 -4
- package/admin/utils/permissions.js +0 -16
- package/admin/utils/prefixPluginTranslations.js +0 -3
- package/server/app-errors.js +0 -20
- package/server/bootstrap.js +0 -13
- package/server/cache/index.js +0 -37
- package/server/config/index.js +0 -39
- package/server/config/setup.js +0 -59
- package/server/content-types/audience/index.js +0 -9
- package/server/content-types/audience/schema.js +0 -25
- package/server/content-types/index.js +0 -13
- package/server/content-types/navigation/index.js +0 -11
- package/server/content-types/navigation/lifecycles.js +0 -6
- package/server/content-types/navigation/schema.js +0 -54
- package/server/content-types/navigation-item/index.js +0 -11
- package/server/content-types/navigation-item/lifecycles.js +0 -6
- package/server/content-types/navigation-item/schema.js +0 -106
- package/server/controllers/admin.js +0 -125
- package/server/controllers/client.js +0 -86
- package/server/controllers/index.js +0 -11
- package/server/controllers/utils.js +0 -22
- package/server/controllers/validators.js +0 -48
- package/server/destroy.js +0 -6
- package/server/dtos/config.js +0 -2
- package/server/dtos/index.js +0 -19
- package/server/dtos/navigation-item.js +0 -2
- package/server/dtos/navigation.js +0 -2
- package/server/graphql/config.js +0 -26
- package/server/graphql/index.js +0 -17
- package/server/graphql/queries/index.js +0 -21
- package/server/graphql/queries/render-navigation-child.js +0 -36
- package/server/graphql/queries/render-navigation.js +0 -48
- package/server/graphql/resolvers-config.js +0 -8
- package/server/graphql/setup.js +0 -14
- package/server/graphql/types/content-types-name-fields.js +0 -15
- package/server/graphql/types/content-types.js +0 -18
- package/server/graphql/types/create-navigation-item.js +0 -19
- package/server/graphql/types/create-navigation-related.js +0 -10
- package/server/graphql/types/create-navigation.js +0 -9
- package/server/graphql/types/index.js +0 -38
- package/server/graphql/types/navigation-config.js +0 -11
- package/server/graphql/types/navigation-details.js +0 -12
- package/server/graphql/types/navigation-item-additional-field-media.js +0 -13
- package/server/graphql/types/navigation-item-related-data.js +0 -9
- package/server/graphql/types/navigation-item-related.js +0 -25
- package/server/graphql/types/navigation-item.js +0 -58
- package/server/graphql/types/navigation-render-type.js +0 -6
- package/server/graphql/types/navigation.js +0 -11
- package/server/i18n/index.js +0 -32
- package/server/index.js +0 -33
- package/server/middlewares/index.js +0 -3
- package/server/permissions/index.js +0 -10
- package/server/permissions/permissions.js +0 -12
- package/server/permissions/setup.js +0 -32
- package/server/permissions.js +0 -39
- package/server/policies/index.js +0 -3
- package/server/register.js +0 -6
- package/server/repositories/audience.js +0 -12
- package/server/repositories/generic.js +0 -20
- package/server/repositories/index.js +0 -11
- package/server/repositories/navigation-item.js +0 -51
- package/server/repositories/navigation.js +0 -65
- package/server/routes/admin.js +0 -216
- package/server/routes/client.js +0 -32
- package/server/routes/index.js +0 -12
- package/server/schemas/config.js +0 -68
- package/server/schemas/content-type.js +0 -140
- package/server/schemas/index.js +0 -19
- package/server/schemas/navigation.js +0 -107
- package/server/services/admin/admin.js +0 -483
- package/server/services/admin/index.js +0 -7
- package/server/services/admin/types.js +0 -2
- package/server/services/admin/utils.js +0 -84
- package/server/services/client/client.js +0 -397
- package/server/services/client/index.js +0 -7
- package/server/services/client/types.js +0 -2
- package/server/services/client/utils.js +0 -88
- package/server/services/common/common.js +0 -307
- package/server/services/common/index.js +0 -7
- package/server/services/common/types.js +0 -2
- package/server/services/common/utils.js +0 -24
- package/server/services/index.js +0 -13
- package/server/types.js +0 -2
- package/server/utils/constants.js +0 -35
- package/server/utils/functions.js +0 -111
- package/server/utils/index.js +0 -18
- package/strapi-admin.js +0 -5
- package/strapi-server.js +0 -3
- package/tsconfig.tsbuildinfo +0 -1
- /package/{admin/api/index.js → dist/admin/src/api/index.d.ts} +0 -0
- /package/{admin/components/icons/index.js → dist/admin/src/components/icons/index.d.ts} +0 -0
- /package/{admin/pages/HomePage/components/index.js → dist/admin/src/pages/HomePage/components/index.d.ts} +0 -0
- /package/{admin/pages/SettingsPage/common/index.js → dist/admin/src/pages/SettingsPage/common/index.d.ts} +0 -0
- /package/{admin/schemas/index.js → dist/admin/src/schemas/index.d.ts} +0 -0
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
export type AudienceDBSchema = z.infer<typeof audienceDBSchema>;
|
|
3
|
+
export declare const audienceDBSchema: z.ZodObject<{
|
|
4
|
+
id: z.ZodNumber;
|
|
5
|
+
documentId: z.ZodString;
|
|
6
|
+
name: z.ZodString;
|
|
7
|
+
key: z.ZodString;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
name: string;
|
|
10
|
+
id: number;
|
|
11
|
+
documentId: string;
|
|
12
|
+
key: string;
|
|
13
|
+
}, {
|
|
14
|
+
name: string;
|
|
15
|
+
id: number;
|
|
16
|
+
documentId: string;
|
|
17
|
+
key: string;
|
|
18
|
+
}>;
|
|
19
|
+
export type NavigationItemType = z.infer<typeof navigationItemType>;
|
|
20
|
+
export declare const navigationItemType: z.ZodEnum<["INTERNAL", "EXTERNAL", "WRAPPER"]>;
|
|
21
|
+
declare const navigationItemDBBaseSchema: z.ZodObject<{
|
|
22
|
+
id: z.ZodNumber;
|
|
23
|
+
documentId: z.ZodString;
|
|
24
|
+
title: z.ZodString;
|
|
25
|
+
type: z.ZodEnum<["INTERNAL", "EXTERNAL", "WRAPPER"]>;
|
|
26
|
+
path: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
|
|
27
|
+
slug: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
|
|
28
|
+
externalPath: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
|
|
29
|
+
uiRouterKey: z.ZodString;
|
|
30
|
+
menuAttached: z.ZodBoolean;
|
|
31
|
+
order: z.ZodNumber;
|
|
32
|
+
collapsed: z.ZodBoolean;
|
|
33
|
+
related: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
|
|
34
|
+
additionalFields: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodNull]>>;
|
|
35
|
+
audience: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodObject<{
|
|
36
|
+
id: z.ZodNumber;
|
|
37
|
+
documentId: z.ZodString;
|
|
38
|
+
name: z.ZodString;
|
|
39
|
+
key: z.ZodString;
|
|
40
|
+
}, "strip", z.ZodTypeAny, {
|
|
41
|
+
name: string;
|
|
42
|
+
id: number;
|
|
43
|
+
documentId: string;
|
|
44
|
+
key: string;
|
|
45
|
+
}, {
|
|
46
|
+
name: string;
|
|
47
|
+
id: number;
|
|
48
|
+
documentId: string;
|
|
49
|
+
key: string;
|
|
50
|
+
}>, "many">, z.ZodNull]>>;
|
|
51
|
+
autoSync: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNull]>>;
|
|
52
|
+
}, "strip", z.ZodTypeAny, {
|
|
53
|
+
type: "INTERNAL" | "EXTERNAL" | "WRAPPER";
|
|
54
|
+
id: number;
|
|
55
|
+
documentId: string;
|
|
56
|
+
title: string;
|
|
57
|
+
uiRouterKey: string;
|
|
58
|
+
menuAttached: boolean;
|
|
59
|
+
order: number;
|
|
60
|
+
collapsed: boolean;
|
|
61
|
+
additionalFields?: Record<string, unknown> | null | undefined;
|
|
62
|
+
path?: string | null | undefined;
|
|
63
|
+
audience?: {
|
|
64
|
+
name: string;
|
|
65
|
+
id: number;
|
|
66
|
+
documentId: string;
|
|
67
|
+
key: string;
|
|
68
|
+
}[] | null | undefined;
|
|
69
|
+
slug?: string | null | undefined;
|
|
70
|
+
externalPath?: string | null | undefined;
|
|
71
|
+
related?: string | null | undefined;
|
|
72
|
+
autoSync?: boolean | null | undefined;
|
|
73
|
+
}, {
|
|
74
|
+
type: "INTERNAL" | "EXTERNAL" | "WRAPPER";
|
|
75
|
+
id: number;
|
|
76
|
+
documentId: string;
|
|
77
|
+
title: string;
|
|
78
|
+
uiRouterKey: string;
|
|
79
|
+
menuAttached: boolean;
|
|
80
|
+
order: number;
|
|
81
|
+
collapsed: boolean;
|
|
82
|
+
additionalFields?: Record<string, unknown> | null | undefined;
|
|
83
|
+
path?: string | null | undefined;
|
|
84
|
+
audience?: {
|
|
85
|
+
name: string;
|
|
86
|
+
id: number;
|
|
87
|
+
documentId: string;
|
|
88
|
+
key: string;
|
|
89
|
+
}[] | null | undefined;
|
|
90
|
+
slug?: string | null | undefined;
|
|
91
|
+
externalPath?: string | null | undefined;
|
|
92
|
+
related?: string | null | undefined;
|
|
93
|
+
autoSync?: boolean | null | undefined;
|
|
94
|
+
}>;
|
|
95
|
+
export type ReadNavigationItemFromLocaleSchema = z.infer<typeof readNavigationItemFromLocaleSchema>;
|
|
96
|
+
export declare const readNavigationItemFromLocaleSchema: z.ZodObject<z.objectUtil.extendShape<Pick<Omit<{
|
|
97
|
+
id: z.ZodNumber;
|
|
98
|
+
documentId: z.ZodString;
|
|
99
|
+
title: z.ZodString;
|
|
100
|
+
type: z.ZodEnum<["INTERNAL", "EXTERNAL", "WRAPPER"]>;
|
|
101
|
+
path: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
|
|
102
|
+
slug: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
|
|
103
|
+
externalPath: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
|
|
104
|
+
uiRouterKey: z.ZodString;
|
|
105
|
+
menuAttached: z.ZodBoolean;
|
|
106
|
+
order: z.ZodNumber;
|
|
107
|
+
collapsed: z.ZodBoolean;
|
|
108
|
+
related: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
|
|
109
|
+
additionalFields: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodNull]>>;
|
|
110
|
+
audience: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodObject<{
|
|
111
|
+
id: z.ZodNumber;
|
|
112
|
+
documentId: z.ZodString;
|
|
113
|
+
name: z.ZodString;
|
|
114
|
+
key: z.ZodString;
|
|
115
|
+
}, "strip", z.ZodTypeAny, {
|
|
116
|
+
name: string;
|
|
117
|
+
id: number;
|
|
118
|
+
documentId: string;
|
|
119
|
+
key: string;
|
|
120
|
+
}, {
|
|
121
|
+
name: string;
|
|
122
|
+
id: number;
|
|
123
|
+
documentId: string;
|
|
124
|
+
key: string;
|
|
125
|
+
}>, "many">, z.ZodNull]>>;
|
|
126
|
+
autoSync: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNull]>>;
|
|
127
|
+
}, "related">, "path" | "type" | "title" | "externalPath" | "uiRouterKey">, {
|
|
128
|
+
related: z.ZodUnknown;
|
|
129
|
+
}>, "strip", z.ZodTypeAny, {
|
|
130
|
+
type: "INTERNAL" | "EXTERNAL" | "WRAPPER";
|
|
131
|
+
title: string;
|
|
132
|
+
uiRouterKey: string;
|
|
133
|
+
path?: string | null | undefined;
|
|
134
|
+
externalPath?: string | null | undefined;
|
|
135
|
+
related?: unknown;
|
|
136
|
+
}, {
|
|
137
|
+
type: "INTERNAL" | "EXTERNAL" | "WRAPPER";
|
|
138
|
+
title: string;
|
|
139
|
+
uiRouterKey: string;
|
|
140
|
+
path?: string | null | undefined;
|
|
141
|
+
externalPath?: string | null | undefined;
|
|
142
|
+
related?: unknown;
|
|
143
|
+
}>;
|
|
144
|
+
export type NavigationItemDBSchema = z.infer<typeof navigationItemDBBaseSchema> & {
|
|
145
|
+
parent?: NavigationItemDBSchema | null;
|
|
146
|
+
items?: NavigationItemsDBSchema;
|
|
147
|
+
master?: NavigationDBSchema;
|
|
148
|
+
};
|
|
149
|
+
export declare const navigationItemDBSchema: z.ZodType<NavigationItemDBSchema>;
|
|
150
|
+
export type NavigationItemsDBSchema = z.infer<typeof navigationItemsDBSchema>;
|
|
151
|
+
export declare const navigationItemsDBSchema: z.ZodArray<z.ZodType<NavigationItemDBSchema, z.ZodTypeDef, NavigationItemDBSchema>, "many">;
|
|
152
|
+
export type NavigationDBSchema = z.infer<ReturnType<typeof navigationDBSchema>>;
|
|
153
|
+
export declare const navigationDBSchema: (withItems: boolean) => z.ZodObject<{
|
|
154
|
+
id: z.ZodNumber;
|
|
155
|
+
documentId: z.ZodString;
|
|
156
|
+
name: z.ZodString;
|
|
157
|
+
slug: z.ZodString;
|
|
158
|
+
localeCode: z.ZodString;
|
|
159
|
+
visible: z.ZodBoolean;
|
|
160
|
+
items: z.ZodArray<z.ZodType<NavigationItemDBSchema, z.ZodTypeDef, NavigationItemDBSchema>, "many"> | z.ZodOptional<z.ZodArray<z.ZodType<NavigationItemDBSchema, z.ZodTypeDef, NavigationItemDBSchema>, "many">>;
|
|
161
|
+
}, "strip", z.ZodTypeAny, {
|
|
162
|
+
name: string;
|
|
163
|
+
id: number;
|
|
164
|
+
documentId: string;
|
|
165
|
+
slug: string;
|
|
166
|
+
localeCode: string;
|
|
167
|
+
visible: boolean;
|
|
168
|
+
items?: NavigationItemDBSchema[] | undefined;
|
|
169
|
+
}, {
|
|
170
|
+
name: string;
|
|
171
|
+
id: number;
|
|
172
|
+
documentId: string;
|
|
173
|
+
slug: string;
|
|
174
|
+
localeCode: string;
|
|
175
|
+
visible: boolean;
|
|
176
|
+
items?: NavigationItemDBSchema[] | undefined;
|
|
177
|
+
}>;
|
|
178
|
+
export type CreateNavigationSchema = z.infer<typeof createNavigationSchema>;
|
|
179
|
+
export declare const createNavigationSchema: z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
180
|
+
id: z.ZodNumber;
|
|
181
|
+
documentId: z.ZodString;
|
|
182
|
+
name: z.ZodString;
|
|
183
|
+
slug: z.ZodString;
|
|
184
|
+
localeCode: z.ZodString;
|
|
185
|
+
visible: z.ZodBoolean;
|
|
186
|
+
items: z.ZodArray<z.ZodType<NavigationItemDBSchema, z.ZodTypeDef, NavigationItemDBSchema>, "many"> | z.ZodOptional<z.ZodArray<z.ZodType<NavigationItemDBSchema, z.ZodTypeDef, NavigationItemDBSchema>, "many">>;
|
|
187
|
+
}, "id" | "documentId" | "slug" | "localeCode" | "items">, {
|
|
188
|
+
documentId: z.ZodOptional<z.ZodString>;
|
|
189
|
+
id: z.ZodOptional<z.ZodUndefined>;
|
|
190
|
+
}>, "strip", z.ZodTypeAny, {
|
|
191
|
+
name: string;
|
|
192
|
+
visible: boolean;
|
|
193
|
+
id?: undefined;
|
|
194
|
+
documentId?: string | undefined;
|
|
195
|
+
}, {
|
|
196
|
+
name: string;
|
|
197
|
+
visible: boolean;
|
|
198
|
+
id?: undefined;
|
|
199
|
+
documentId?: string | undefined;
|
|
200
|
+
}>;
|
|
201
|
+
export type UpdateNavigationItemSchema = z.ZodType<Omit<z.infer<typeof navigationItemDBSchema>, 'id' | 'documentId' | 'parent' | 'items'>> & {
|
|
202
|
+
items?: UpdateNavigationItemsSchema | null;
|
|
203
|
+
id?: number;
|
|
204
|
+
documentId?: string;
|
|
205
|
+
updated?: boolean;
|
|
206
|
+
removed?: boolean;
|
|
207
|
+
};
|
|
208
|
+
export declare const updateNavigationItemSchema: UpdateNavigationItemSchema;
|
|
209
|
+
export type UpdateNavigationItemsSchema = z.infer<typeof navigationItemsDBSchema>;
|
|
210
|
+
export declare const updateNavigationItemsSchema: z.ZodArray<UpdateNavigationItemSchema, "many">;
|
|
211
|
+
export type UpdateNavigationSchema = z.infer<typeof updateNavigationSchema>;
|
|
212
|
+
export declare const updateNavigationSchema: z.ZodObject<{
|
|
213
|
+
name: z.ZodOptional<z.ZodString>;
|
|
214
|
+
id: z.ZodNumber;
|
|
215
|
+
documentId: z.ZodString;
|
|
216
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
217
|
+
localeCode: z.ZodOptional<z.ZodString>;
|
|
218
|
+
visible: z.ZodOptional<z.ZodBoolean>;
|
|
219
|
+
items: z.ZodOptional<z.ZodArray<UpdateNavigationItemSchema, "many">>;
|
|
220
|
+
}, "strip", z.ZodTypeAny, {
|
|
221
|
+
id: number;
|
|
222
|
+
documentId: string;
|
|
223
|
+
name?: string | undefined;
|
|
224
|
+
slug?: string | undefined;
|
|
225
|
+
localeCode?: string | undefined;
|
|
226
|
+
visible?: boolean | undefined;
|
|
227
|
+
items?: Omit<NavigationItemDBSchema, "id" | "documentId" | "items" | "parent">[] | undefined;
|
|
228
|
+
}, {
|
|
229
|
+
id: number;
|
|
230
|
+
documentId: string;
|
|
231
|
+
name?: string | undefined;
|
|
232
|
+
slug?: string | undefined;
|
|
233
|
+
localeCode?: string | undefined;
|
|
234
|
+
visible?: boolean | undefined;
|
|
235
|
+
items?: Omit<NavigationItemDBSchema, "id" | "documentId" | "items" | "parent">[] | undefined;
|
|
236
|
+
}>;
|
|
237
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Core } from '@strapi/strapi';
|
|
2
|
+
import { ConfigContentTypeDTO, NavigationDTO, NavigationPluginConfigDTO } from '../../dtos';
|
|
3
|
+
import { NavigationDBSchema, ReadNavigationItemFromLocaleSchema } from '../../schemas';
|
|
4
|
+
import { ConfigInput, DeleteInput, FillFromOtherLocaleInput, GetByIdInput, GetContentTypeItemsInput, GetInput, I18nNavigationContentsCopyInput, PostInput, PutInput, ReadNavigationItemFromLocaleInput, UpdateConfigInput } from './types';
|
|
5
|
+
export type AdminService = ReturnType<typeof adminService>;
|
|
6
|
+
declare const adminService: (context: {
|
|
7
|
+
strapi: Core.Strapi;
|
|
8
|
+
}) => {
|
|
9
|
+
config({ viaSettingsPage }: ConfigInput): Promise<NavigationPluginConfigDTO>;
|
|
10
|
+
configContentTypes({ viaSettingsPage, }: ConfigInput): Promise<ConfigContentTypeDTO[]>;
|
|
11
|
+
get({ ids, localeCode }: GetInput): Promise<NavigationDBSchema[]>;
|
|
12
|
+
getById({ documentId, localeCode }: GetByIdInput): Promise<NavigationDBSchema>;
|
|
13
|
+
post({ auditLog, payload }: PostInput): Promise<NavigationDTO>;
|
|
14
|
+
put({ auditLog, payload }: PutInput): Promise<NavigationDBSchema>;
|
|
15
|
+
delete({ auditLog, documentId }: DeleteInput): Promise<void>;
|
|
16
|
+
restart(): Promise<void>;
|
|
17
|
+
restoreConfig(): Promise<void>;
|
|
18
|
+
updateConfig({ config: newConfig }: UpdateConfigInput): Promise<void>;
|
|
19
|
+
fillFromOtherLocale({ auditLog, source, target, documentId, }: FillFromOtherLocaleInput): Promise<NavigationDBSchema>;
|
|
20
|
+
i18nNavigationContentsCopy({ source, target, }: I18nNavigationContentsCopyInput): Promise<void>;
|
|
21
|
+
readNavigationItemFromLocale({ path, source, target, }: ReadNavigationItemFromLocaleInput): Promise<ReadNavigationItemFromLocaleSchema>;
|
|
22
|
+
getContentTypeItems({ query, uid, }: GetContentTypeItemsInput): Promise<{
|
|
23
|
+
documentId: string;
|
|
24
|
+
}[]>;
|
|
25
|
+
purgeNavigationCache(documentId: string, clearLocalisations?: boolean): Promise<{
|
|
26
|
+
success: boolean;
|
|
27
|
+
}>;
|
|
28
|
+
purgeNavigationsCache(): Promise<{
|
|
29
|
+
success: boolean;
|
|
30
|
+
}>;
|
|
31
|
+
};
|
|
32
|
+
export default adminService;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { CreateNavigationSchema, NavigationDBSchema, NavigationPluginConfigDBSchema, UpdateNavigationSchema } from '../../schemas';
|
|
2
|
+
import { AuditLogContext } from './utils';
|
|
3
|
+
export interface ConfigInput {
|
|
4
|
+
viaSettingsPage?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface GetInput {
|
|
7
|
+
ids?: string[];
|
|
8
|
+
localeCode?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface GetByIdInput {
|
|
11
|
+
documentId: string;
|
|
12
|
+
localeCode?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface PostInput {
|
|
15
|
+
payload: CreateNavigationSchema;
|
|
16
|
+
auditLog: AuditLogContext;
|
|
17
|
+
}
|
|
18
|
+
export interface PutInput {
|
|
19
|
+
payload: UpdateNavigationSchema;
|
|
20
|
+
auditLog: AuditLogContext;
|
|
21
|
+
}
|
|
22
|
+
export interface DeleteInput {
|
|
23
|
+
documentId: string;
|
|
24
|
+
auditLog: AuditLogContext;
|
|
25
|
+
}
|
|
26
|
+
export interface UpdateConfigInput {
|
|
27
|
+
config: NavigationPluginConfigDBSchema;
|
|
28
|
+
}
|
|
29
|
+
export interface FillFromOtherLocaleInput {
|
|
30
|
+
source: string;
|
|
31
|
+
target: string;
|
|
32
|
+
documentId: string;
|
|
33
|
+
auditLog: AuditLogContext;
|
|
34
|
+
}
|
|
35
|
+
export interface I18nNavigationContentsCopyInput {
|
|
36
|
+
target: NavigationDBSchema;
|
|
37
|
+
source: NavigationDBSchema;
|
|
38
|
+
}
|
|
39
|
+
export interface ReadNavigationItemFromLocaleInput {
|
|
40
|
+
source: string;
|
|
41
|
+
target: string;
|
|
42
|
+
path: string;
|
|
43
|
+
}
|
|
44
|
+
export interface GetContentTypeItemsInput {
|
|
45
|
+
uid: string;
|
|
46
|
+
query: Record<string, unknown>;
|
|
47
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Core } from '@strapi/strapi';
|
|
2
|
+
import { CreateBranchNavigationItemDTO, NavigationItemDTO } from '../../dtos';
|
|
3
|
+
import { NavigationDBSchema } from '../../schemas';
|
|
4
|
+
import { NavigationAction } from '../../types';
|
|
5
|
+
export type AuditLogContext = {
|
|
6
|
+
emit: (e: string, d: AuditLogParams) => void;
|
|
7
|
+
};
|
|
8
|
+
export type AuditLogParams = {
|
|
9
|
+
actionType: string;
|
|
10
|
+
oldEntity: NavigationDBSchema;
|
|
11
|
+
newEntity: NavigationDBSchema;
|
|
12
|
+
} | {
|
|
13
|
+
actionType: 'DELETE';
|
|
14
|
+
entity: NavigationDBSchema;
|
|
15
|
+
};
|
|
16
|
+
export declare const sendAuditLog: (auditLogInstance: AuditLogContext, event: string, data: AuditLogParams) => void;
|
|
17
|
+
export declare const prepareAuditLog: (actions: NavigationAction[]) => string;
|
|
18
|
+
type FillCopyContext = {
|
|
19
|
+
master: NavigationDBSchema;
|
|
20
|
+
strapi: Core.Strapi;
|
|
21
|
+
localeCode: string;
|
|
22
|
+
entities: Map<string, NavigationItemDTO['related']>;
|
|
23
|
+
};
|
|
24
|
+
export declare const processItems: (context: FillCopyContext) => (item: CreateBranchNavigationItemDTO) => Promise<CreateBranchNavigationItemDTO>;
|
|
25
|
+
export declare const intercalate: <T, U extends T>(glue: T, arr: U[]) => (T | U)[];
|
|
26
|
+
export declare const getCacheStatus: ({ strapi, }: {
|
|
27
|
+
strapi: Core.Strapi;
|
|
28
|
+
}) => Promise<{
|
|
29
|
+
hasCachePlugin: boolean;
|
|
30
|
+
enabled: boolean;
|
|
31
|
+
}>;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { Core } from '@strapi/strapi';
|
|
2
|
+
import { NavigationItemDTO, RFRNavigationItemDTO, RFRPageDTO } from '../../dtos';
|
|
3
|
+
import { NavigationItemAdditionalField, NavigationItemCustomField } from '../../schemas';
|
|
4
|
+
import { ReadAllInput, RenderChildrenInput, RenderInput, RenderRFRInput, RenderRFRNavInput, RenderRFRPageInput, RenderTreeInput, RenderTypeInput } from './types';
|
|
5
|
+
export type ClientService = ReturnType<typeof clientService>;
|
|
6
|
+
declare const clientService: (context: {
|
|
7
|
+
strapi: Core.Strapi;
|
|
8
|
+
}) => {
|
|
9
|
+
readAll({ locale, orderBy, orderDirection }: ReadAllInput): Promise<{
|
|
10
|
+
name: string;
|
|
11
|
+
id: number;
|
|
12
|
+
documentId: string;
|
|
13
|
+
slug: string;
|
|
14
|
+
localeCode: string;
|
|
15
|
+
visible: boolean;
|
|
16
|
+
items?: import("../../schemas").NavigationItemDBSchema[] | undefined;
|
|
17
|
+
}[]>;
|
|
18
|
+
renderRFRNavigationItem({ item }: RenderRFRNavInput): RFRNavigationItemDTO;
|
|
19
|
+
renderRFRPage({ item, parent, enabledCustomFieldsNames }: RenderRFRPageInput): RFRPageDTO;
|
|
20
|
+
renderRFR({ items, parent, parentNavItem, contentTypes, enabledCustomFieldsNames, }: RenderRFRInput): {
|
|
21
|
+
pages: {};
|
|
22
|
+
nav: {};
|
|
23
|
+
};
|
|
24
|
+
renderTree({ items, documentId, path, itemParser, }: RenderTreeInput): Promise<NavigationItemDTO[]>;
|
|
25
|
+
getCustomFields(additionalFields: NavigationItemAdditionalField[]): NavigationItemCustomField[];
|
|
26
|
+
renderType({ criteria, filter, itemCriteria, locale, populate, rootPath, type, wrapRelated, }: RenderTypeInput): Promise<NavigationItemDTO[] | {
|
|
27
|
+
pages: {};
|
|
28
|
+
nav: {};
|
|
29
|
+
} | {
|
|
30
|
+
audience: string[] | undefined;
|
|
31
|
+
title: string;
|
|
32
|
+
related: any;
|
|
33
|
+
items: null;
|
|
34
|
+
path?: string | null | undefined;
|
|
35
|
+
type: "INTERNAL" | "EXTERNAL" | "WRAPPER";
|
|
36
|
+
id: number;
|
|
37
|
+
documentId: string;
|
|
38
|
+
slug?: string | null | undefined;
|
|
39
|
+
externalPath?: string | null | undefined;
|
|
40
|
+
uiRouterKey: string;
|
|
41
|
+
menuAttached: boolean;
|
|
42
|
+
order: number;
|
|
43
|
+
collapsed: boolean;
|
|
44
|
+
autoSync?: boolean | null | undefined;
|
|
45
|
+
master?: import("../../dtos").NavigationDTO | undefined;
|
|
46
|
+
parent?: NavigationItemDTO | null | undefined;
|
|
47
|
+
}[]>;
|
|
48
|
+
renderChildren({ childUIKey, idOrSlug, locale, menuOnly, type, wrapRelated, }: RenderChildrenInput): Promise<NavigationItemDTO[] | {
|
|
49
|
+
pages: {};
|
|
50
|
+
nav: {};
|
|
51
|
+
} | {
|
|
52
|
+
audience: string[] | undefined;
|
|
53
|
+
title: string;
|
|
54
|
+
related: any;
|
|
55
|
+
items: null;
|
|
56
|
+
path?: string | null | undefined;
|
|
57
|
+
type: "INTERNAL" | "EXTERNAL" | "WRAPPER";
|
|
58
|
+
id: number;
|
|
59
|
+
documentId: string;
|
|
60
|
+
slug?: string | null | undefined;
|
|
61
|
+
externalPath?: string | null | undefined;
|
|
62
|
+
uiRouterKey: string;
|
|
63
|
+
menuAttached: boolean;
|
|
64
|
+
order: number;
|
|
65
|
+
collapsed: boolean;
|
|
66
|
+
autoSync?: boolean | null | undefined;
|
|
67
|
+
master?: import("../../dtos").NavigationDTO | undefined;
|
|
68
|
+
parent?: NavigationItemDTO | null | undefined;
|
|
69
|
+
}[]>;
|
|
70
|
+
render({ idOrSlug, locale, menuOnly, populate, rootPath, type, wrapRelated, }: RenderInput): Promise<NavigationItemDTO[] | {
|
|
71
|
+
pages: {};
|
|
72
|
+
nav: {};
|
|
73
|
+
} | {
|
|
74
|
+
audience: string[] | undefined;
|
|
75
|
+
title: string;
|
|
76
|
+
related: any;
|
|
77
|
+
items: null;
|
|
78
|
+
path?: string | null | undefined;
|
|
79
|
+
type: "INTERNAL" | "EXTERNAL" | "WRAPPER";
|
|
80
|
+
id: number;
|
|
81
|
+
documentId: string;
|
|
82
|
+
slug?: string | null | undefined;
|
|
83
|
+
externalPath?: string | null | undefined;
|
|
84
|
+
uiRouterKey: string;
|
|
85
|
+
menuAttached: boolean;
|
|
86
|
+
order: number;
|
|
87
|
+
collapsed: boolean;
|
|
88
|
+
autoSync?: boolean | null | undefined;
|
|
89
|
+
master?: import("../../dtos").NavigationDTO | undefined;
|
|
90
|
+
parent?: NavigationItemDTO | null | undefined;
|
|
91
|
+
}[]>;
|
|
92
|
+
};
|
|
93
|
+
export default clientService;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { NavigationItemDTO, RFRNavigationItemDTO } from '../../dtos';
|
|
2
|
+
export type RenderType = 'FLAT' | 'TREE' | 'RFR';
|
|
3
|
+
export type PopulateQueryParam = string | boolean | string[];
|
|
4
|
+
export type NestedPath = {
|
|
5
|
+
id?: number;
|
|
6
|
+
documentId?: string;
|
|
7
|
+
parent?: {
|
|
8
|
+
id: number;
|
|
9
|
+
documentId: string;
|
|
10
|
+
path: string;
|
|
11
|
+
};
|
|
12
|
+
path: string;
|
|
13
|
+
};
|
|
14
|
+
export interface ReadAllInput {
|
|
15
|
+
orderBy?: string;
|
|
16
|
+
orderDirection?: 'DESC' | 'ASC';
|
|
17
|
+
locale?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface RenderRFRInput {
|
|
20
|
+
items: NavigationItemDTO[];
|
|
21
|
+
parent?: string;
|
|
22
|
+
parentNavItem?: RFRNavigationItemDTO;
|
|
23
|
+
contentTypes: string[];
|
|
24
|
+
enabledCustomFieldsNames: string[];
|
|
25
|
+
}
|
|
26
|
+
export interface RenderRFRNavInput {
|
|
27
|
+
item: Pick<NavigationItemDTO, 'uiRouterKey' | 'title' | 'path' | 'type' | 'audience'>;
|
|
28
|
+
}
|
|
29
|
+
export interface RenderRFRPageInput {
|
|
30
|
+
item: Omit<NavigationItemDTO, 'items' | 'parent' | 'master'>;
|
|
31
|
+
parent?: string;
|
|
32
|
+
enabledCustomFieldsNames: string[];
|
|
33
|
+
}
|
|
34
|
+
export interface RenderTreeInput {
|
|
35
|
+
items?: NavigationItemDTO[];
|
|
36
|
+
documentId?: string;
|
|
37
|
+
path: string | undefined;
|
|
38
|
+
itemParser: (_: NavigationItemDTO, path: string) => Promise<NavigationItemDTO>;
|
|
39
|
+
}
|
|
40
|
+
export interface RenderTypeInput {
|
|
41
|
+
type?: RenderType;
|
|
42
|
+
criteria?: Record<string, unknown>;
|
|
43
|
+
itemCriteria?: Record<string, unknown>;
|
|
44
|
+
filter?: string;
|
|
45
|
+
rootPath?: string;
|
|
46
|
+
wrapRelated?: boolean;
|
|
47
|
+
populate?: PopulateQueryParam;
|
|
48
|
+
locale?: string;
|
|
49
|
+
}
|
|
50
|
+
export interface RenderChildrenInput {
|
|
51
|
+
idOrSlug: number | string;
|
|
52
|
+
childUIKey: string;
|
|
53
|
+
type?: RenderType;
|
|
54
|
+
menuOnly?: boolean;
|
|
55
|
+
wrapRelated?: boolean;
|
|
56
|
+
locale?: string;
|
|
57
|
+
}
|
|
58
|
+
export interface RenderInput {
|
|
59
|
+
idOrSlug: string | number;
|
|
60
|
+
type?: RenderType;
|
|
61
|
+
menuOnly?: boolean;
|
|
62
|
+
rootPath?: string;
|
|
63
|
+
wrapRelated?: boolean;
|
|
64
|
+
populate?: PopulateQueryParam;
|
|
65
|
+
locale?: string;
|
|
66
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { NavigationItemDTO } from '../../dtos';
|
|
2
|
+
import { StrapiContentTypeFullSchema } from '../../types';
|
|
3
|
+
import { NestedPath } from './types';
|
|
4
|
+
export declare const composeItemTitle: (item: NavigationItemDTO, fields?: Record<string, string[]>, contentTypes?: StrapiContentTypeFullSchema[]) => string | undefined;
|
|
5
|
+
export declare const extractItemRelationTitle: (relatedItem: any, fields?: Record<string, string[]>, contentTypes?: StrapiContentTypeFullSchema[]) => any;
|
|
6
|
+
export declare const filterByPath: <T extends Pick<NavigationItemDTO, "path" | "documentId" | "parent">>(items: T[], path?: string) => {
|
|
7
|
+
root?: NestedPath;
|
|
8
|
+
items: T[];
|
|
9
|
+
};
|
|
10
|
+
export declare const buildNestedPaths: <T extends Pick<NavigationItemDTO, "path" | "documentId" | "parent">>(items: T[], documentId?: string, parentPath?: string | null) => NestedPath[];
|
|
11
|
+
export declare const compareArraysOfNumbers: (arrA: number[], arrB: number[]) => number;
|
|
12
|
+
export declare const filterOutUnpublished: (item: NavigationItemDTO) => any;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Core } from '@strapi/strapi';
|
|
2
|
+
import { NavigationItemDTO } from '../../dtos';
|
|
3
|
+
import { NavigationItemCustomField, NavigationItemDBSchema, NavigationPluginConfigDBSchema } from '../../schemas';
|
|
4
|
+
import { NavigationAction, NavigationActionsCategories } from '../../types';
|
|
5
|
+
import { AnalyzeBranchInput, BuildNestedStructureInput, CreateBranchInput, EmitEventInput, GetBranchNameInput, GetSlugInput, MapToNavigationItemDTOInput, RegisterLifeCycleHookInput, RemoveBranchInput, RunLifeCycleHookInput, UpdateBranchInput } from './types';
|
|
6
|
+
export type CommonService = ReturnType<typeof commonService>;
|
|
7
|
+
declare const commonService: (context: {
|
|
8
|
+
strapi: Core.Strapi;
|
|
9
|
+
}) => {
|
|
10
|
+
getPluginStore(): Promise<ReturnType<typeof strapi.store>>;
|
|
11
|
+
mapToNavigationItemDTO({ navigationItems, populate, master, parent, }: MapToNavigationItemDTOInput): Promise<NavigationItemDTO[]>;
|
|
12
|
+
setDefaultConfig(): Promise<NavigationPluginConfigDBSchema>;
|
|
13
|
+
getBranchName({ item }: GetBranchNameInput): NavigationActionsCategories | void;
|
|
14
|
+
analyzeBranch({ masterEntity, navigationItems, parentItem, prevAction, }: AnalyzeBranchInput): Promise<NavigationAction[]>;
|
|
15
|
+
removeBranch({ navigationItems, action, }: RemoveBranchInput): Promise<NavigationAction[]>;
|
|
16
|
+
createBranch({ action, masterEntity, navigationItems, parentItem, }: CreateBranchInput): Promise<NavigationAction[]>;
|
|
17
|
+
updateBranch({ masterEntity, navigationItems, action, parentItem, }: UpdateBranchInput): Promise<NavigationAction[]>;
|
|
18
|
+
emitEvent({ entity, event, uid }: EmitEventInput<any, any>): Promise<void>;
|
|
19
|
+
pruneCustomFields({ removedFields }: {
|
|
20
|
+
removedFields: NavigationItemCustomField[];
|
|
21
|
+
}): Promise<void>;
|
|
22
|
+
getSlug({ query }: GetSlugInput): Promise<string>;
|
|
23
|
+
registerLifeCycleHook({ callback, contentTypeName, hookName }: RegisterLifeCycleHookInput): void;
|
|
24
|
+
runLifeCycleHook({ contentTypeName, event, hookName }: RunLifeCycleHookInput): Promise<void>;
|
|
25
|
+
buildNestedStructure({ navigationItems, id, }: BuildNestedStructureInput): NavigationItemDBSchema[];
|
|
26
|
+
readLocale(): Promise<{
|
|
27
|
+
defaultLocale: string;
|
|
28
|
+
restLocale: string[];
|
|
29
|
+
}>;
|
|
30
|
+
};
|
|
31
|
+
export default commonService;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { UID } from '@strapi/strapi';
|
|
2
|
+
import { CreateBranchNavigationItemDTO, NavigationDTO, NavigationItemDTO } from '../../dtos';
|
|
3
|
+
import { NavigationDBSchema, NavigationItemDBSchema, NavigationItemsDBSchema } from '../../schemas';
|
|
4
|
+
import { ContentType, Effect, LifeCycleEvent, LifeCycleHookName, NavigationAction } from '../../types';
|
|
5
|
+
export type LifecycleHookRecord = Partial<Record<LifeCycleHookName, Array<Effect<LifeCycleEvent>>>>;
|
|
6
|
+
export interface RegisterLifeCycleHookInput {
|
|
7
|
+
hookName: LifeCycleHookName;
|
|
8
|
+
callback: Effect<LifeCycleEvent>;
|
|
9
|
+
contentTypeName: ContentType;
|
|
10
|
+
}
|
|
11
|
+
export interface RunLifeCycleHookInput {
|
|
12
|
+
contentTypeName: ContentType;
|
|
13
|
+
event: LifeCycleEvent;
|
|
14
|
+
hookName: LifeCycleHookName;
|
|
15
|
+
}
|
|
16
|
+
export interface MapToNavigationItemDTOInput {
|
|
17
|
+
navigationItems: NavigationItemDBSchema[];
|
|
18
|
+
populate: unknown;
|
|
19
|
+
master?: Omit<NavigationDTO, 'items'>;
|
|
20
|
+
parent?: NavigationItemDTO;
|
|
21
|
+
}
|
|
22
|
+
export interface CreateBranchInput {
|
|
23
|
+
navigationItems: CreateBranchNavigationItemDTO[];
|
|
24
|
+
masterEntity: NavigationDBSchema | undefined;
|
|
25
|
+
parentItem: NavigationItemDBSchema | undefined;
|
|
26
|
+
action: NavigationAction;
|
|
27
|
+
}
|
|
28
|
+
export interface RemoveBranchInput {
|
|
29
|
+
navigationItems?: NavigationItemsDBSchema;
|
|
30
|
+
action?: NavigationAction;
|
|
31
|
+
}
|
|
32
|
+
export interface UpdateBranchInput {
|
|
33
|
+
navigationItems: NavigationItemsDBSchema & {
|
|
34
|
+
updated?: boolean;
|
|
35
|
+
}[];
|
|
36
|
+
masterEntity: NavigationDBSchema | undefined;
|
|
37
|
+
parentItem: NavigationItemDBSchema | undefined;
|
|
38
|
+
action: NavigationAction;
|
|
39
|
+
}
|
|
40
|
+
export interface AnalyzeBranchInput {
|
|
41
|
+
navigationItems: (Omit<NavigationItemDBSchema, 'id' | 'documentId'> & {
|
|
42
|
+
removed?: boolean;
|
|
43
|
+
id?: number;
|
|
44
|
+
documentId?: string;
|
|
45
|
+
})[];
|
|
46
|
+
masterEntity?: NavigationDBSchema;
|
|
47
|
+
parentItem?: NavigationItemDBSchema;
|
|
48
|
+
prevAction: NavigationAction;
|
|
49
|
+
}
|
|
50
|
+
export interface EmitEventInput<TEvent, TEntity> {
|
|
51
|
+
uid: UID.Schema;
|
|
52
|
+
event: TEvent;
|
|
53
|
+
entity: TEntity;
|
|
54
|
+
}
|
|
55
|
+
export interface GetBranchNameInput {
|
|
56
|
+
item: Omit<NavigationItemDBSchema, 'id' | 'documentId'> & {
|
|
57
|
+
removed?: boolean;
|
|
58
|
+
documentId?: string;
|
|
59
|
+
id?: number;
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
export interface BuildNestedStructureInput {
|
|
63
|
+
navigationItems?: NavigationItemDBSchema[];
|
|
64
|
+
id?: number;
|
|
65
|
+
}
|
|
66
|
+
export interface GetSlugInput {
|
|
67
|
+
query: string;
|
|
68
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { NavigationItemType } from '../../schemas';
|
|
2
|
+
export interface DuplicateCheckItem {
|
|
3
|
+
items?: DuplicateCheckItem[];
|
|
4
|
+
id?: number;
|
|
5
|
+
title: string;
|
|
6
|
+
path?: string | null;
|
|
7
|
+
type: NavigationItemType;
|
|
8
|
+
}
|
|
9
|
+
export declare const checkDuplicatePath: ({ checkData, parentItem, }: {
|
|
10
|
+
parentItem?: DuplicateCheckItem;
|
|
11
|
+
checkData: DuplicateCheckItem[];
|
|
12
|
+
}) => Promise<void>;
|