strapi-plugin-navigation 2.5.4 → 3.0.0-beta.1
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 +43 -70
- package/dist/_chunks/ca-BR-kBlg0.mjs +478 -0
- package/dist/_chunks/ca-BR-kBlg0.mjs.map +1 -0
- package/dist/_chunks/ca-CUqlPpIU.js +478 -0
- package/dist/_chunks/ca-CUqlPpIU.js.map +1 -0
- package/dist/_chunks/en-BX9EIpFS.js +480 -0
- package/dist/_chunks/en-BX9EIpFS.js.map +1 -0
- package/dist/_chunks/en-DGoYXo3O.mjs +480 -0
- package/dist/_chunks/en-DGoYXo3O.mjs.map +1 -0
- package/dist/_chunks/fr-C7TqeT5C.mjs +480 -0
- package/dist/_chunks/fr-C7TqeT5C.mjs.map +1 -0
- package/dist/_chunks/fr-DmfGsoRQ.js +480 -0
- package/dist/_chunks/fr-DmfGsoRQ.js.map +1 -0
- package/dist/admin/index.js +57380 -0
- package/dist/admin/index.js.map +1 -0
- package/dist/admin/index.mjs +57361 -0
- package/dist/admin/index.mjs.map +1 -0
- package/dist/admin/src/api/client.d.ts +190 -0
- package/dist/admin/src/api/index.d.ts +1 -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/{admin → dist/admin}/src/components/TextArrayInput/index.d.ts +1 -4
- package/dist/admin/src/components/icons/index.d.ts +1 -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/{admin/src → dist/admin/src/pages/HomePage}/components/DragButton/index.d.ts +0 -1
- package/{admin/src/pages/View → dist/admin/src/pages/HomePage}/components/I18nCopyNavigationItems/index.d.ts +2 -3
- package/dist/admin/src/pages/HomePage/components/NavigationContentHeader/index.d.ts +7 -0
- package/{admin/src/hooks/useNavigationManager.d.ts → dist/admin/src/pages/HomePage/components/NavigationHeader/hooks.d.ts} +1 -2
- 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 +24 -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 +43 -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/{admin/src/pages/View → dist/admin/src/pages/HomePage}/components/NavigationManager/AllNavigations/index.d.ts +3 -4
- package/{admin/src/pages/View → dist/admin/src/pages/HomePage}/components/NavigationManager/DeletionConfirm/index.d.ts +3 -4
- package/dist/admin/src/pages/HomePage/components/NavigationManager/ErrorDetails/index.d.ts +7 -0
- package/{admin/src/pages/View → dist/admin/src/pages/HomePage}/components/NavigationManager/Footer/index.d.ts +7 -6
- package/dist/admin/src/pages/HomePage/components/NavigationManager/Form/hooks.d.ts +8 -0
- package/dist/admin/src/pages/HomePage/components/NavigationManager/Form/index.d.ts +10 -0
- package/{admin/src/pages/View → dist/admin/src/pages/HomePage}/components/NavigationManager/NavigationUpdate/index.d.ts +3 -4
- package/{admin/src/pages/View → dist/admin/src/pages/HomePage}/components/NavigationManager/NewNavigation/index.d.ts +3 -4
- package/{admin/src/pages/View → dist/admin/src/pages/HomePage}/components/NavigationManager/PurgeCacheConfirm/index.d.ts +3 -4
- package/{admin/src/pages/View → dist/admin/src/pages/HomePage}/components/NavigationManager/index.d.ts +3 -4
- package/{admin/src/pages/View → dist/admin/src/pages/HomePage}/components/NavigationManager/types.d.ts +14 -14
- package/dist/admin/src/pages/HomePage/components/Search/index.d.ts +11 -0
- package/dist/admin/src/pages/HomePage/components/index.d.ts +1 -0
- package/dist/admin/src/pages/HomePage/hooks/index.d.ts +143 -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/common/index.d.ts +1 -0
- package/dist/admin/src/pages/SettingsPage/components/CustomFieldForm/hooks/index.d.ts +10 -0
- package/{admin → dist/admin}/src/pages/SettingsPage/components/CustomFieldForm/index.d.ts +2 -3
- package/{admin → dist/admin}/src/pages/SettingsPage/components/CustomFieldModal/index.d.ts +2 -3
- package/{admin → dist/admin}/src/pages/SettingsPage/components/CustomFieldTable/index.d.ts +4 -4
- package/dist/admin/src/pages/SettingsPage/hooks/index.d.ts +427 -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/schemas/index.d.ts +2 -0
- package/dist/admin/src/translations/ca.d.ts +475 -0
- package/dist/admin/src/translations/en.d.ts +478 -0
- package/dist/admin/src/translations/fr.d.ts +477 -0
- package/dist/admin/src/translations/index.d.ts +14 -0
- package/dist/admin/src/types.d.ts +3 -0
- package/dist/admin/src/utils/constants.d.ts +1 -0
- package/dist/admin/src/utils/getTranslation.d.ts +3 -0
- package/{admin/src → dist/admin/src/utils}/permissions.d.ts +6 -7
- 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 +16463 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/index.mjs +16426 -0
- package/dist/server/index.mjs.map +1 -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/{server → dist/server/src}/content-types/audience/index.d.ts +0 -1
- package/{server → dist/server/src}/content-types/audience/schema.d.ts +0 -1
- package/{server → dist/server/src}/content-types/index.d.ts +11 -65
- package/{server → dist/server/src}/content-types/navigation/index.d.ts +7 -10
- package/dist/server/src/content-types/navigation/lifecycles.d.ts +2 -0
- package/{server → dist/server/src}/content-types/navigation/schema.d.ts +6 -9
- package/{server → dist/server/src}/content-types/navigation-item/index.d.ts +3 -6
- package/dist/server/src/content-types/navigation-item/lifecycles.d.ts +2 -0
- package/{server → dist/server/src}/content-types/navigation-item/schema.d.ts +2 -5
- 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 +49 -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/{server → dist/server/src}/graphql/resolvers-config.d.ts +1 -3
- 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/{permissions.d.ts → dist/server/src/permissions/permissions.d.ts} +0 -1
- 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 +27 -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 +45 -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 +118 -33
- package/admin/src/components/AdditionalFieldInput/index.d.ts +0 -5
- package/admin/src/components/AdditionalFieldInput/index.js +0 -99
- package/admin/src/components/AdditionalFieldInput/types.d.ts +0 -15
- package/admin/src/components/AdditionalFieldInput/types.js +0 -3
- package/admin/src/components/Alert/styles.d.ts +0 -2
- package/admin/src/components/Alert/styles.js +0 -14
- package/admin/src/components/CollapseButton/index.d.ts +0 -7
- package/admin/src/components/CollapseButton/index.js +0 -30
- package/admin/src/components/ConfirmationDialog/index.d.ts +0 -28
- package/admin/src/components/ConfirmationDialog/index.js +0 -34
- package/admin/src/components/DragButton/index.js +0 -62
- package/admin/src/components/EmptyView/index.d.ts +0 -3
- package/admin/src/components/EmptyView/index.js +0 -30
- package/admin/src/components/Item/ItemCardBadge/index.d.ts +0 -3
- package/admin/src/components/Item/ItemCardBadge/index.js +0 -26
- package/admin/src/components/Item/ItemCardHeader/Wrapper.d.ts +0 -3
- package/admin/src/components/Item/ItemCardHeader/Wrapper.js +0 -21
- package/admin/src/components/Item/ItemCardHeader/icons.d.ts +0 -5
- package/admin/src/components/Item/ItemCardHeader/icons.js +0 -13
- package/admin/src/components/Item/ItemCardHeader/index.d.ts +0 -17
- package/admin/src/components/Item/ItemCardHeader/index.js +0 -38
- package/admin/src/components/Item/ItemCardRemovedOverlay/index.d.ts +0 -2
- package/admin/src/components/Item/ItemCardRemovedOverlay/index.js +0 -18
- package/admin/src/components/Item/Wrapper.d.ts +0 -3
- package/admin/src/components/Item/Wrapper.js +0 -43
- package/admin/src/components/Item/index.d.ts +0 -31
- package/admin/src/components/Item/index.js +0 -188
- package/admin/src/components/NavigationItemList/Wrapper.d.ts +0 -3
- package/admin/src/components/NavigationItemList/Wrapper.js +0 -26
- package/admin/src/components/NavigationItemList/index.d.ts +0 -36
- package/admin/src/components/NavigationItemList/index.js +0 -32
- package/admin/src/components/RestartAlert/index.d.ts +0 -3
- package/admin/src/components/RestartAlert/index.js +0 -13
- package/admin/src/components/Search/index.d.ts +0 -12
- package/admin/src/components/Search/index.js +0 -97
- package/admin/src/components/TextArrayInput/index.js +0 -45
- package/admin/src/components/icons/navigation.d.ts +0 -6
- package/admin/src/components/icons/navigation.js +0 -12
- package/admin/src/contexts/DataManagerContext.d.ts +0 -3
- package/admin/src/contexts/DataManagerContext.js +0 -6
- package/admin/src/hooks/useAllContentTypes.d.ts +0 -3
- package/admin/src/hooks/useAllContentTypes.js +0 -8
- package/admin/src/hooks/useDataManager.d.ts +0 -3
- package/admin/src/hooks/useDataManager.js +0 -10
- package/admin/src/hooks/useI18nCopyNavigationItemsModal.d.ts +0 -9
- package/admin/src/hooks/useI18nCopyNavigationItemsModal.js +0 -51
- package/admin/src/hooks/useNavigationConfig.d.ts +0 -10
- package/admin/src/hooks/useNavigationConfig.js +0 -54
- package/admin/src/hooks/useNavigationManager.js +0 -41
- package/admin/src/index.d.ts +0 -14
- package/admin/src/index.js +0 -87
- package/admin/src/pages/App/index.d.ts +0 -3
- package/admin/src/pages/App/index.js +0 -43
- package/admin/src/pages/DataManagerProvider/actions.d.ts +0 -21
- package/admin/src/pages/DataManagerProvider/actions.js +0 -24
- package/admin/src/pages/DataManagerProvider/index.d.ts +0 -12
- package/admin/src/pages/DataManagerProvider/index.js +0 -382
- package/admin/src/pages/DataManagerProvider/init.d.ts +0 -3
- package/admin/src/pages/DataManagerProvider/init.js +0 -7
- package/admin/src/pages/DataManagerProvider/reducer.d.ts +0 -20
- package/admin/src/pages/DataManagerProvider/reducer.js +0 -132
- package/admin/src/pages/NoAccessPage/index.d.ts +0 -3
- package/admin/src/pages/NoAccessPage/index.js +0 -31
- package/admin/src/pages/SettingsPage/common/const.d.ts +0 -2
- package/admin/src/pages/SettingsPage/common/const.js +0 -5
- package/admin/src/pages/SettingsPage/common/index.d.ts +0 -2
- package/admin/src/pages/SettingsPage/common/index.js +0 -18
- package/admin/src/pages/SettingsPage/components/CustomFieldForm/index.js +0 -129
- package/admin/src/pages/SettingsPage/components/CustomFieldModal/index.js +0 -20
- package/admin/src/pages/SettingsPage/components/CustomFieldTable/index.js +0 -105
- package/admin/src/pages/SettingsPage/components/DisableI18nModal/index.d.ts +0 -23
- package/admin/src/pages/SettingsPage/components/DisableI18nModal/index.js +0 -86
- package/admin/src/pages/SettingsPage/index.d.ts +0 -3
- package/admin/src/pages/SettingsPage/index.js +0 -321
- package/admin/src/pages/SettingsPage/types.d.ts +0 -35
- package/admin/src/pages/SettingsPage/types.js +0 -3
- package/admin/src/pages/SettingsPage/utils/form.d.ts +0 -20
- package/admin/src/pages/SettingsPage/utils/form.js +0 -37
- package/admin/src/pages/SettingsPage/utils/functions.d.ts +0 -3
- package/admin/src/pages/SettingsPage/utils/functions.js +0 -26
- package/admin/src/pages/View/components/I18nCopyNavigationItems/index.js +0 -15
- package/admin/src/pages/View/components/NavigationContentHeader/index.d.ts +0 -6
- package/admin/src/pages/View/components/NavigationContentHeader/index.js +0 -14
- package/admin/src/pages/View/components/NavigationHeader/index.d.ts +0 -14
- package/admin/src/pages/View/components/NavigationHeader/index.js +0 -92
- package/admin/src/pages/View/components/NavigationHeader/styles.d.ts +0 -2
- package/admin/src/pages/View/components/NavigationHeader/styles.js +0 -18
- package/admin/src/pages/View/components/NavigationItemForm/index.d.ts +0 -5
- package/admin/src/pages/View/components/NavigationItemForm/index.js +0 -470
- package/admin/src/pages/View/components/NavigationItemForm/types.d.ts +0 -99
- package/admin/src/pages/View/components/NavigationItemForm/types.js +0 -3
- package/admin/src/pages/View/components/NavigationItemForm/utils/form.d.ts +0 -28
- package/admin/src/pages/View/components/NavigationItemForm/utils/form.js +0 -123
- package/admin/src/pages/View/components/NavigationItemPopup/NavigationItemPopupFooter.d.ts +0 -25
- package/admin/src/pages/View/components/NavigationItemPopup/NavigationItemPopupFooter.js +0 -31
- package/admin/src/pages/View/components/NavigationItemPopup/NavigationItemPopupHeader.d.ts +0 -5
- package/admin/src/pages/View/components/NavigationItemPopup/NavigationItemPopupHeader.js +0 -20
- package/admin/src/pages/View/components/NavigationItemPopup/index.d.ts +0 -33
- package/admin/src/pages/View/components/NavigationItemPopup/index.js +0 -90
- package/admin/src/pages/View/components/NavigationManager/AllNavigations/icons.d.ts +0 -4
- package/admin/src/pages/View/components/NavigationManager/AllNavigations/icons.js +0 -12
- package/admin/src/pages/View/components/NavigationManager/AllNavigations/index.js +0 -151
- package/admin/src/pages/View/components/NavigationManager/DeletionConfirm/index.js +0 -34
- package/admin/src/pages/View/components/NavigationManager/ErrorDetails/index.d.ts +0 -8
- package/admin/src/pages/View/components/NavigationManager/ErrorDetails/index.js +0 -53
- package/admin/src/pages/View/components/NavigationManager/Footer/index.js +0 -13
- package/admin/src/pages/View/components/NavigationManager/Form/index.d.ts +0 -19
- package/admin/src/pages/View/components/NavigationManager/Form/index.js +0 -103
- package/admin/src/pages/View/components/NavigationManager/NavigationUpdate/index.js +0 -59
- package/admin/src/pages/View/components/NavigationManager/NewNavigation/index.js +0 -62
- package/admin/src/pages/View/components/NavigationManager/PurgeCacheConfirm/index.js +0 -34
- package/admin/src/pages/View/components/NavigationManager/index.js +0 -203
- package/admin/src/pages/View/components/NavigationManager/types.js +0 -3
- package/admin/src/pages/View/index.d.ts +0 -4
- package/admin/src/pages/View/index.js +0 -269
- package/admin/src/pages/View/utils/form.d.ts +0 -2
- package/admin/src/pages/View/utils/form.js +0 -16
- package/admin/src/pages/View/utils/index.d.ts +0 -2
- package/admin/src/pages/View/utils/index.js +0 -11
- package/admin/src/pages/View/utils/parsers.d.ts +0 -51
- package/admin/src/pages/View/utils/parsers.js +0 -272
- package/admin/src/pages/View/utils/types.d.ts +0 -3
- package/admin/src/pages/View/utils/types.js +0 -3
- package/admin/src/permissions.js +0 -13
- package/admin/src/pluginId.d.ts +0 -3
- package/admin/src/pluginId.js +0 -5
- package/admin/src/translations/ca.json +0 -199
- package/admin/src/translations/en.json +0 -220
- package/admin/src/translations/fr.json +0 -48
- package/admin/src/translations/index.d.ts +0 -15
- package/admin/src/translations/index.js +0 -21
- package/admin/src/utils/api.d.ts +0 -9
- package/admin/src/utils/api.js +0 -20
- package/admin/src/utils/enums.d.ts +0 -25
- package/admin/src/utils/enums.js +0 -30
- package/admin/src/utils/functions.d.ts +0 -16
- package/admin/src/utils/functions.js +0 -46
- package/admin/src/utils/index.d.ts +0 -4
- package/admin/src/utils/index.js +0 -20
- package/permissions.js +0 -13
- package/server/bootstrap/index.d.ts +0 -4
- package/server/bootstrap/index.js +0 -50
- package/server/cache/index.d.ts +0 -2
- package/server/cache/index.js +0 -18
- package/server/cache/serviceEnhancers.d.ts +0 -3
- package/server/cache/serviceEnhancers.js +0 -16
- package/server/cache/setupStrategy.d.ts +0 -3
- package/server/cache/setupStrategy.js +0 -38
- package/server/cache/types.d.ts +0 -11
- package/server/cache/types.js +0 -3
- package/server/cache/utils.d.ts +0 -11
- package/server/cache/utils.js +0 -19
- package/server/config/index.d.ts +0 -5
- package/server/config/index.js +0 -37
- package/server/config/setupStrategy.d.ts +0 -3
- package/server/config/setupStrategy.js +0 -55
- package/server/content-types/audience/index.js +0 -10
- package/server/content-types/audience/schema.js +0 -26
- package/server/content-types/index.js +0 -16
- package/server/content-types/navigation/index.js +0 -12
- package/server/content-types/navigation/lifecycles.d.ts +0 -3
- package/server/content-types/navigation/lifecycles.js +0 -7
- package/server/content-types/navigation/schema.js +0 -57
- package/server/content-types/navigation-item/index.js +0 -12
- package/server/content-types/navigation-item/lifecycles.d.ts +0 -3
- package/server/content-types/navigation-item/lifecycles.js +0 -7
- package/server/content-types/navigation-item/schema.js +0 -113
- package/server/content-types/navigations-items-related/index.d.ts +0 -51
- package/server/content-types/navigations-items-related/index.js +0 -10
- package/server/content-types/navigations-items-related/schema.d.ts +0 -49
- package/server/content-types/navigations-items-related/schema.js +0 -50
- package/server/controllers/admin.d.ts +0 -4
- package/server/controllers/admin.js +0 -164
- package/server/controllers/client.d.ts +0 -4
- package/server/controllers/client.js +0 -75
- package/server/controllers/index.d.ts +0 -4
- package/server/controllers/index.js +0 -13
- package/server/destroy.d.ts +0 -3
- package/server/destroy.js +0 -5
- package/server/graphql/config.d.ts +0 -4
- package/server/graphql/config.js +0 -28
- package/server/graphql/index.d.ts +0 -2
- package/server/graphql/index.js +0 -18
- package/server/graphql/queries/index.d.ts +0 -3
- package/server/graphql/queries/index.js +0 -17
- package/server/graphql/queries/render-navigation-child.d.ts +0 -15
- package/server/graphql/queries/render-navigation-child.js +0 -25
- package/server/graphql/queries/render-navigation.d.ts +0 -21
- package/server/graphql/queries/render-navigation.js +0 -32
- package/server/graphql/resolvers-config.js +0 -6
- package/server/graphql/setupStrategy.d.ts +0 -3
- package/server/graphql/setupStrategy.js +0 -15
- package/server/graphql/types/content-types-name-fields.d.ts +0 -6
- package/server/graphql/types/content-types-name-fields.js +0 -14
- package/server/graphql/types/content-types.d.ts +0 -5
- package/server/graphql/types/content-types.js +0 -18
- package/server/graphql/types/create-navigation-item.d.ts +0 -5
- package/server/graphql/types/create-navigation-item.js +0 -19
- package/server/graphql/types/create-navigation-related.d.ts +0 -5
- package/server/graphql/types/create-navigation-related.js +0 -10
- package/server/graphql/types/create-navigation.d.ts +0 -5
- package/server/graphql/types/create-navigation.js +0 -9
- package/server/graphql/types/index.d.ts +0 -3
- package/server/graphql/types/index.js +0 -18
- package/server/graphql/types/navigation-config.d.ts +0 -5
- package/server/graphql/types/navigation-config.js +0 -11
- package/server/graphql/types/navigation-details.d.ts +0 -5
- package/server/graphql/types/navigation-details.js +0 -12
- package/server/graphql/types/navigation-item-additional-field-media.d.ts +0 -5
- package/server/graphql/types/navigation-item-additional-field-media.js +0 -13
- package/server/graphql/types/navigation-item-related-data.d.ts +0 -5
- package/server/graphql/types/navigation-item-related-data.js +0 -9
- package/server/graphql/types/navigation-item-related.d.ts +0 -7
- package/server/graphql/types/navigation-item-related.js +0 -25
- package/server/graphql/types/navigation-item.d.ts +0 -6
- package/server/graphql/types/navigation-item.js +0 -55
- package/server/graphql/types/navigation-render-type.d.ts +0 -5
- package/server/graphql/types/navigation-render-type.js +0 -7
- package/server/graphql/types/navigation.d.ts +0 -5
- package/server/graphql/types/navigation.js +0 -11
- package/server/i18n/constant.d.ts +0 -2
- package/server/i18n/constant.js +0 -5
- package/server/i18n/errors.d.ts +0 -7
- package/server/i18n/errors.js +0 -14
- package/server/i18n/graphQLEnhancers.d.ts +0 -10
- package/server/i18n/graphQLEnhancers.js +0 -10
- package/server/i18n/index.d.ts +0 -8
- package/server/i18n/index.js +0 -23
- package/server/i18n/navigationSetupStrategy.d.ts +0 -3
- package/server/i18n/navigationSetupStrategy.js +0 -147
- package/server/i18n/serviceEnhancers.d.ts +0 -13
- package/server/i18n/serviceEnhancers.js +0 -156
- package/server/i18n/types.d.ts +0 -60
- package/server/i18n/types.js +0 -3
- package/server/i18n/utils.d.ts +0 -13
- package/server/i18n/utils.js +0 -33
- package/server/index.d.ts +0 -262
- package/server/index.js +0 -26
- package/server/navigation/index.d.ts +0 -2
- package/server/navigation/index.js +0 -18
- package/server/navigation/setupStrategy.d.ts +0 -3
- package/server/navigation/setupStrategy.js +0 -39
- package/server/register/index.d.ts +0 -3
- package/server/register/index.js +0 -4
- package/server/routes/admin.d.ts +0 -4
- package/server/routes/admin.js +0 -209
- package/server/routes/client.d.ts +0 -4
- package/server/routes/client.js +0 -33
- package/server/routes/index.d.ts +0 -6
- package/server/routes/index.js +0 -13
- package/server/services/admin.d.ts +0 -5
- package/server/services/admin.js +0 -347
- package/server/services/client.d.ts +0 -5
- package/server/services/client.js +0 -335
- package/server/services/common.d.ts +0 -5
- package/server/services/common.js +0 -385
- package/server/services/index.d.ts +0 -7
- package/server/services/index.js +0 -15
- package/server/utils/constant.d.ts +0 -27
- package/server/utils/constant.js +0 -43
- package/server/utils/functions.d.ts +0 -157
- package/server/utils/functions.js +0 -339
- package/server/utils/index.d.ts +0 -3
- package/server/utils/index.js +0 -19
- package/strapi-admin.d.ts +0 -3
- package/strapi-admin.js +0 -8
- package/strapi-server.d.ts +0 -262
- package/strapi-server.js +0 -7
- package/tsconfig.tsbuildinfo +0 -1
- package/types/bootstrap.d.ts +0 -16
- package/types/bootstrap.js +0 -3
- package/types/config.d.ts +0 -27
- package/types/config.js +0 -3
- package/types/contentTypes.d.ts +0 -112
- package/types/contentTypes.js +0 -3
- package/types/controllers.d.ts +0 -65
- package/types/controllers.js +0 -5
- package/types/graphQL.d.ts +0 -3
- package/types/graphQL.js +0 -3
- package/types/i18n.d.ts +0 -9
- package/types/i18n.js +0 -3
- package/types/index.d.ts +0 -10
- package/types/index.js +0 -26
- package/types/lifecycle.d.ts +0 -22
- package/types/lifecycle.js +0 -3
- package/types/services.d.ts +0 -106
- package/types/services.js +0 -3
- package/types/utils.d.ts +0 -72
- package/types/utils.js +0 -41
- package/utils/InvalidParamNavigationError.d.ts +0 -4
- package/utils/InvalidParamNavigationError.js +0 -8
- package/utils/NavigationError.d.ts +0 -5
- package/utils/NavigationError.js +0 -11
|
@@ -1,339 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.buildAllHookListeners = exports.buildHookListener = exports.sanitizePopulateField = exports.resolveGlobalLikeId = exports.purgeSensitiveDataFromUser = exports.purgeSensitiveData = exports.parsePopulateQuery = exports.validateAdditionalFields = exports.getPluginModels = exports.compareArraysOfNumbers = exports.intercalate = exports.isContentTypeEligible = exports.filterByPath = exports.buildNestedPaths = exports.buildNestedStructure = exports.singularize = exports.checkDuplicatePath = exports.filterOutUnpublished = exports.extractItemRelationTitle = exports.composeItemTitle = exports.sendAuditLog = exports.prepareAuditLog = exports.getTemplateComponentFromTemplate = exports.templateNameFactory = exports.parseParams = exports.getCustomFields = exports.errorHandler = exports.getPluginService = void 0;
|
|
4
|
-
const lodash_1 = require("lodash");
|
|
5
|
-
const types_1 = require("../../types");
|
|
6
|
-
const NavigationError_1 = require("../../utils/NavigationError");
|
|
7
|
-
const constant_1 = require("./constant");
|
|
8
|
-
const UID_REGEX = /^(?<type>[a-z0-9-]+)\:{2}(?<api>[a-z0-9-]+)\.{1}(?<contentType>[a-z0-9-]+)$/i;
|
|
9
|
-
function getPluginService(name, strapiInstance = strapi) {
|
|
10
|
-
return strapiInstance.plugin("navigation").service(name);
|
|
11
|
-
}
|
|
12
|
-
exports.getPluginService = getPluginService;
|
|
13
|
-
const errorHandler = (ctx) => (error) => {
|
|
14
|
-
if (error instanceof NavigationError_1.NavigationError) {
|
|
15
|
-
return ctx.badRequest(error.message, error.additionalInfo);
|
|
16
|
-
}
|
|
17
|
-
throw error;
|
|
18
|
-
};
|
|
19
|
-
exports.errorHandler = errorHandler;
|
|
20
|
-
const getCustomFields = (additionalFields) => additionalFields.filter(field => typeof field !== 'string');
|
|
21
|
-
exports.getCustomFields = getCustomFields;
|
|
22
|
-
const parseParams = (params) => Object.keys(params).reduce((prev, curr) => {
|
|
23
|
-
const value = params[curr];
|
|
24
|
-
const parsedValue = isNaN(Number(value)) ? value : parseInt(value, 10);
|
|
25
|
-
return {
|
|
26
|
-
...prev,
|
|
27
|
-
[curr]: parsedValue,
|
|
28
|
-
};
|
|
29
|
-
}, {});
|
|
30
|
-
exports.parseParams = parseParams;
|
|
31
|
-
const templateNameFactory = async (items = [], strapi, contentTypes = []) => {
|
|
32
|
-
const flatRelated = (0, lodash_1.flatten)(items.map(i => i.related)).filter(_ => !!_);
|
|
33
|
-
const relatedMap = (flatRelated).reduce((acc, curr) => {
|
|
34
|
-
if ((0, lodash_1.isNil)(curr) || typeof curr.__contentType !== "string")
|
|
35
|
-
return acc;
|
|
36
|
-
const index = curr.__contentType;
|
|
37
|
-
if ((0, lodash_1.isNil)(acc[index]))
|
|
38
|
-
acc[index] = [];
|
|
39
|
-
return { ...acc, [index]: [...acc[index], curr.id] };
|
|
40
|
-
}, {});
|
|
41
|
-
const responses = await Promise.all(Object.entries(relatedMap)
|
|
42
|
-
.map(([contentType, ids]) => {
|
|
43
|
-
(0, types_1.assertNotEmpty)((0, lodash_1.find)(contentTypes, cnt => cnt.uid === contentType));
|
|
44
|
-
return strapi.query(contentType)
|
|
45
|
-
.findMany({
|
|
46
|
-
where: { id: { $in: ids } },
|
|
47
|
-
limit: Number.MAX_SAFE_INTEGER,
|
|
48
|
-
populate: ["template"],
|
|
49
|
-
})
|
|
50
|
-
.then(res => ({ [contentType]: res }));
|
|
51
|
-
}));
|
|
52
|
-
const relatedResponseMap = responses.reduce((acc, curr) => ({ ...acc, ...curr }), {});
|
|
53
|
-
const singleTypes = new Map(contentTypes
|
|
54
|
-
.filter(x => x.isSingle)
|
|
55
|
-
.map(({ contentTypeName, templateName }) => [contentTypeName, templateName || contentTypeName]));
|
|
56
|
-
return (contentType, id) => {
|
|
57
|
-
const template = (0, lodash_1.get)(relatedResponseMap[contentType].find(data => data.id === id), 'template');
|
|
58
|
-
if (template && template instanceof Array) {
|
|
59
|
-
const templateComponent = (0, exports.getTemplateComponentFromTemplate)(strapi, template);
|
|
60
|
-
return (0, lodash_1.get)(templateComponent, 'options.templateName', constant_1.TEMPLATE_DEFAULT);
|
|
61
|
-
}
|
|
62
|
-
if (singleTypes.get(contentType)) {
|
|
63
|
-
return singleTypes.get(contentType);
|
|
64
|
-
}
|
|
65
|
-
return constant_1.TEMPLATE_DEFAULT;
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
exports.templateNameFactory = templateNameFactory;
|
|
69
|
-
const getTemplateComponentFromTemplate = (strapi, template = []) => {
|
|
70
|
-
const componentName = (0, lodash_1.get)((0, lodash_1.first)(template), '__component');
|
|
71
|
-
return !!componentName ? strapi.components[componentName] : null;
|
|
72
|
-
};
|
|
73
|
-
exports.getTemplateComponentFromTemplate = getTemplateComponentFromTemplate;
|
|
74
|
-
const prepareAuditLog = (actions) => {
|
|
75
|
-
return [
|
|
76
|
-
...new Set(actions
|
|
77
|
-
.filter((_) => !!_)
|
|
78
|
-
.flatMap(({ remove, create, update }) => {
|
|
79
|
-
return [create ? 'CREATE' : '', update ? 'UPDATE' : '', remove ? 'REMOVE' : '']
|
|
80
|
-
.filter(_ => !!_);
|
|
81
|
-
})),
|
|
82
|
-
].join('_');
|
|
83
|
-
};
|
|
84
|
-
exports.prepareAuditLog = prepareAuditLog;
|
|
85
|
-
const sendAuditLog = (auditLogInstance, event, data) => {
|
|
86
|
-
if (auditLogInstance && auditLogInstance.emit) {
|
|
87
|
-
auditLogInstance.emit(event, data);
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
exports.sendAuditLog = sendAuditLog;
|
|
91
|
-
const composeItemTitle = (item, fields = {}, contentTypes = []) => {
|
|
92
|
-
const { title, related } = item;
|
|
93
|
-
const lastRelated = (0, lodash_1.isArray)(related) ? (0, lodash_1.last)(related) : related;
|
|
94
|
-
if (title) {
|
|
95
|
-
return (0, lodash_1.isString)(title) && !(0, lodash_1.isEmpty)(title) ? title : undefined;
|
|
96
|
-
}
|
|
97
|
-
else if (lastRelated) {
|
|
98
|
-
const relationTitle = (0, exports.extractItemRelationTitle)(lastRelated, fields, contentTypes);
|
|
99
|
-
return (0, lodash_1.isString)(relationTitle) && !(0, lodash_1.isEmpty)(relationTitle) ? relationTitle : undefined;
|
|
100
|
-
}
|
|
101
|
-
return undefined;
|
|
102
|
-
};
|
|
103
|
-
exports.composeItemTitle = composeItemTitle;
|
|
104
|
-
const extractItemRelationTitle = (relatedItem, fields = {}, contentTypes = []) => {
|
|
105
|
-
const { __contentType } = relatedItem;
|
|
106
|
-
const contentType = (0, lodash_1.find)(contentTypes, _ => _.contentTypeName === __contentType);
|
|
107
|
-
const { default: defaultFields = [] } = fields;
|
|
108
|
-
return (0, lodash_1.get)(fields, `${contentType ? contentType.collectionName : ''}`, defaultFields).map((_) => relatedItem[_]).filter((_) => _)[0] || '';
|
|
109
|
-
};
|
|
110
|
-
exports.extractItemRelationTitle = extractItemRelationTitle;
|
|
111
|
-
const filterOutUnpublished = (item) => {
|
|
112
|
-
const relatedItem = item.related && ((0, lodash_1.isArray)(item.related) ? (0, lodash_1.last)(item.related) : item.related);
|
|
113
|
-
const isHandledByPublishFlow = relatedItem ? 'published_at' in relatedItem : false;
|
|
114
|
-
if (isHandledByPublishFlow) {
|
|
115
|
-
const isRelatedDefinedAndPublished = relatedItem ?
|
|
116
|
-
isHandledByPublishFlow && (0, lodash_1.get)(relatedItem, 'published_at') :
|
|
117
|
-
false;
|
|
118
|
-
return item.type === "INTERNAL" ? isRelatedDefinedAndPublished : true;
|
|
119
|
-
}
|
|
120
|
-
return (item.type !== "INTERNAL") || relatedItem;
|
|
121
|
-
};
|
|
122
|
-
exports.filterOutUnpublished = filterOutUnpublished;
|
|
123
|
-
const checkDuplicatePath = (parentItem, checkData) => {
|
|
124
|
-
return new Promise((resolve, reject) => {
|
|
125
|
-
if (parentItem && parentItem.items) {
|
|
126
|
-
for (let item of checkData) {
|
|
127
|
-
for (let _ of parentItem.items) {
|
|
128
|
-
if (_.path === item.path && (_.id !== item.id) && (item.type === "INTERNAL")) {
|
|
129
|
-
return reject(new NavigationError_1.NavigationError(`Duplicate path:${item.path} in parent: ${parentItem.title || 'root'} for ${item.title} and ${_.title} items`, {
|
|
130
|
-
parentTitle: parentItem.title,
|
|
131
|
-
parentId: parentItem.id,
|
|
132
|
-
path: item.path,
|
|
133
|
-
errorTitles: [item.title, _.title],
|
|
134
|
-
}));
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
return resolve();
|
|
140
|
-
});
|
|
141
|
-
};
|
|
142
|
-
exports.checkDuplicatePath = checkDuplicatePath;
|
|
143
|
-
const singularize = (value = '') => {
|
|
144
|
-
return (0, lodash_1.last)(value) === 's' ? value.substr(0, value.length - 1) : value;
|
|
145
|
-
};
|
|
146
|
-
exports.singularize = singularize;
|
|
147
|
-
const buildNestedStructure = (entities, id = null, field = 'parent') => {
|
|
148
|
-
return entities
|
|
149
|
-
.filter(entity => {
|
|
150
|
-
let data = entity[field];
|
|
151
|
-
if (data == null && id === null) {
|
|
152
|
-
return true;
|
|
153
|
-
}
|
|
154
|
-
if (data && typeof id === 'string') {
|
|
155
|
-
data = data.toString();
|
|
156
|
-
}
|
|
157
|
-
if (!!data && typeof data === 'object' && 'id' in data) {
|
|
158
|
-
return (data).id === id;
|
|
159
|
-
}
|
|
160
|
-
return (data && data === id);
|
|
161
|
-
})
|
|
162
|
-
.map(entity => {
|
|
163
|
-
return ({
|
|
164
|
-
...entity,
|
|
165
|
-
related: entity.related,
|
|
166
|
-
items: (0, exports.buildNestedStructure)(entities, entity.id, field),
|
|
167
|
-
});
|
|
168
|
-
});
|
|
169
|
-
};
|
|
170
|
-
exports.buildNestedStructure = buildNestedStructure;
|
|
171
|
-
const buildNestedPaths = (items, id = null, parentPath = null) => {
|
|
172
|
-
return items
|
|
173
|
-
.filter(entity => {
|
|
174
|
-
let data = entity.parent;
|
|
175
|
-
if (data == null && id === null) {
|
|
176
|
-
return true;
|
|
177
|
-
}
|
|
178
|
-
if (data && typeof id === 'string') {
|
|
179
|
-
data = data.toString();
|
|
180
|
-
}
|
|
181
|
-
return (data && data === id) || ((0, lodash_1.isObject)(entity.parent) && ((entity.parent).id === id));
|
|
182
|
-
})
|
|
183
|
-
.reduce((acc, entity) => {
|
|
184
|
-
const path = `${parentPath || ''}/${entity.path}`.replace("//", "/");
|
|
185
|
-
return [
|
|
186
|
-
{
|
|
187
|
-
id: entity.id,
|
|
188
|
-
parent: parentPath ? {
|
|
189
|
-
id: (0, lodash_1.get)(entity, ['parent', 'id']),
|
|
190
|
-
path: parentPath,
|
|
191
|
-
} : undefined,
|
|
192
|
-
path,
|
|
193
|
-
},
|
|
194
|
-
...(0, exports.buildNestedPaths)(items, entity.id, path),
|
|
195
|
-
...acc,
|
|
196
|
-
];
|
|
197
|
-
}, []);
|
|
198
|
-
};
|
|
199
|
-
exports.buildNestedPaths = buildNestedPaths;
|
|
200
|
-
const filterByPath = (items, path) => {
|
|
201
|
-
const itemsWithPaths = path ? (0, exports.buildNestedPaths)(items).filter(({ path: itemPath }) => itemPath.includes(path)) : [];
|
|
202
|
-
const root = itemsWithPaths.find(({ path: itemPath }) => itemPath === path);
|
|
203
|
-
return {
|
|
204
|
-
root,
|
|
205
|
-
items: (0, lodash_1.isNil)(root) ? [] : items.filter(({ id }) => (itemsWithPaths.find(v => v.id === id))),
|
|
206
|
-
};
|
|
207
|
-
};
|
|
208
|
-
exports.filterByPath = filterByPath;
|
|
209
|
-
const isContentTypeEligible = (uid = '') => {
|
|
210
|
-
const isOneOfAllowedType = constant_1.ALLOWED_CONTENT_TYPES.filter(_ => uid.includes(_)).length > 0;
|
|
211
|
-
const isNoneOfRestricted = constant_1.RESTRICTED_CONTENT_TYPES.filter(_ => uid.includes(_) || (uid === _)).length === 0;
|
|
212
|
-
return uid && isOneOfAllowedType && isNoneOfRestricted;
|
|
213
|
-
};
|
|
214
|
-
exports.isContentTypeEligible = isContentTypeEligible;
|
|
215
|
-
const intercalate = (glue, arr) => arr.slice(1).reduce((acc, element) => acc.concat([glue, element]), arr.slice(0, 1));
|
|
216
|
-
exports.intercalate = intercalate;
|
|
217
|
-
const compareArraysOfNumbers = (arrA, arrB) => {
|
|
218
|
-
const diff = (0, lodash_1.zipWith)(arrA, arrB, (a, b) => {
|
|
219
|
-
if ((0, lodash_1.isNil)(a))
|
|
220
|
-
return -1;
|
|
221
|
-
if ((0, lodash_1.isNil)(b))
|
|
222
|
-
return 1;
|
|
223
|
-
return a - b;
|
|
224
|
-
});
|
|
225
|
-
return (0, lodash_1.find)(diff, a => a !== 0) || 0;
|
|
226
|
-
};
|
|
227
|
-
exports.compareArraysOfNumbers = compareArraysOfNumbers;
|
|
228
|
-
const getPluginModels = () => {
|
|
229
|
-
const plugin = strapi.plugin('navigation');
|
|
230
|
-
return {
|
|
231
|
-
masterModel: plugin.contentType('navigation'),
|
|
232
|
-
itemModel: plugin.contentType('navigation-item'),
|
|
233
|
-
relatedModel: plugin.contentType('navigations-items-related'),
|
|
234
|
-
audienceModel: plugin.contentType('audience'),
|
|
235
|
-
};
|
|
236
|
-
};
|
|
237
|
-
exports.getPluginModels = getPluginModels;
|
|
238
|
-
const validateAdditionalFields = (additionalFields) => {
|
|
239
|
-
const forbiddenNames = [
|
|
240
|
-
'title', 'type', 'path',
|
|
241
|
-
'externalPath', 'uiRouterKey', 'menuAttached',
|
|
242
|
-
'order', 'collapsed', 'related',
|
|
243
|
-
'parent', 'master', 'audience',
|
|
244
|
-
'additionalFields',
|
|
245
|
-
];
|
|
246
|
-
const customFields = (0, exports.getCustomFields)(additionalFields);
|
|
247
|
-
if (customFields.length !== (0, lodash_1.uniqBy)(customFields, 'name').length) {
|
|
248
|
-
throw new Error('All names of custom fields must be unique.');
|
|
249
|
-
}
|
|
250
|
-
if (!(0, lodash_1.isNil)((0, lodash_1.find)(customFields, item => (0, lodash_1.includes)(forbiddenNames, item.name)))) {
|
|
251
|
-
throw new Error(`Name of custom field cannot be one of: ${forbiddenNames.join(', ')}`);
|
|
252
|
-
}
|
|
253
|
-
};
|
|
254
|
-
exports.validateAdditionalFields = validateAdditionalFields;
|
|
255
|
-
const parsePopulateQuery = (populate) => {
|
|
256
|
-
if (populate === "*") {
|
|
257
|
-
return true;
|
|
258
|
-
}
|
|
259
|
-
else if (typeof populate === "string") {
|
|
260
|
-
return [populate];
|
|
261
|
-
}
|
|
262
|
-
else {
|
|
263
|
-
return populate;
|
|
264
|
-
}
|
|
265
|
-
};
|
|
266
|
-
exports.parsePopulateQuery = parsePopulateQuery;
|
|
267
|
-
const purgeSensitiveData = (data) => {
|
|
268
|
-
if (!data || !(typeof data === "object") || !Object.keys(data).length) {
|
|
269
|
-
return data;
|
|
270
|
-
}
|
|
271
|
-
const { createdBy = undefined, updatedBy = undefined, ...rest } = data;
|
|
272
|
-
if (!createdBy && !updatedBy) {
|
|
273
|
-
return data;
|
|
274
|
-
}
|
|
275
|
-
return {
|
|
276
|
-
...Object.fromEntries(Object.entries(rest).map(([key, value]) => [key, (0, exports.purgeSensitiveData)(value)])),
|
|
277
|
-
...(createdBy ? { createdBy: (0, exports.purgeSensitiveDataFromUser)(createdBy) } : {}),
|
|
278
|
-
...(updatedBy ? { updatedBy: (0, exports.purgeSensitiveDataFromUser)(updatedBy) } : {}),
|
|
279
|
-
};
|
|
280
|
-
};
|
|
281
|
-
exports.purgeSensitiveData = purgeSensitiveData;
|
|
282
|
-
const purgeSensitiveDataFromUser = (data = {}) => {
|
|
283
|
-
if (!data) {
|
|
284
|
-
return undefined;
|
|
285
|
-
}
|
|
286
|
-
const allowedFields = ['username', 'firstname', 'lastname', 'email'];
|
|
287
|
-
return Object.keys(data)
|
|
288
|
-
.filter((key) => allowedFields.includes(key.toLowerCase()))
|
|
289
|
-
.reduce((prev, curr) => ({
|
|
290
|
-
...prev,
|
|
291
|
-
[curr]: data[curr],
|
|
292
|
-
}), {});
|
|
293
|
-
};
|
|
294
|
-
exports.purgeSensitiveDataFromUser = purgeSensitiveDataFromUser;
|
|
295
|
-
const resolveGlobalLikeId = (uid = '') => {
|
|
296
|
-
const parse = (str) => str.split('-')
|
|
297
|
-
.map(_ => (0, lodash_1.capitalize)(_))
|
|
298
|
-
.join('');
|
|
299
|
-
const [type, scope, contentTypeName] = splitTypeUid(uid);
|
|
300
|
-
if (type === 'api') {
|
|
301
|
-
return parse(contentTypeName);
|
|
302
|
-
}
|
|
303
|
-
return `${parse(scope)}${parse(contentTypeName)}`;
|
|
304
|
-
};
|
|
305
|
-
exports.resolveGlobalLikeId = resolveGlobalLikeId;
|
|
306
|
-
const splitTypeUid = (uid = '') => {
|
|
307
|
-
return uid.split(UID_REGEX).filter((s) => s && s.length > 0);
|
|
308
|
-
};
|
|
309
|
-
const sanitizePopulateField = (populate) => {
|
|
310
|
-
if (!populate || populate === true || populate === "*") {
|
|
311
|
-
return undefined;
|
|
312
|
-
}
|
|
313
|
-
if (Array.isArray(populate)) {
|
|
314
|
-
return populate
|
|
315
|
-
.map((item) => (0, exports.sanitizePopulateField)(item));
|
|
316
|
-
}
|
|
317
|
-
if ("object" === typeof populate) {
|
|
318
|
-
return Object.fromEntries(Object.entries(populate).map(([key, value]) => [key, (0, exports.sanitizePopulateField)(value)]));
|
|
319
|
-
}
|
|
320
|
-
return populate;
|
|
321
|
-
};
|
|
322
|
-
exports.sanitizePopulateField = sanitizePopulateField;
|
|
323
|
-
const buildHookListener = (contentTypeName, { strapi }) => (hookName) => [
|
|
324
|
-
hookName,
|
|
325
|
-
async (event) => {
|
|
326
|
-
const commonService = strapi
|
|
327
|
-
.plugin("navigation")
|
|
328
|
-
.service("common");
|
|
329
|
-
await commonService.runLifecycleHook({
|
|
330
|
-
contentTypeName,
|
|
331
|
-
hookName,
|
|
332
|
-
event,
|
|
333
|
-
});
|
|
334
|
-
},
|
|
335
|
-
];
|
|
336
|
-
exports.buildHookListener = buildHookListener;
|
|
337
|
-
const buildAllHookListeners = (contentTypeName, context) => Object.fromEntries(constant_1.allLifecycleHooks.map((0, exports.buildHookListener)(contentTypeName, context)));
|
|
338
|
-
exports.buildAllHookListeners = buildAllHookListeners;
|
|
339
|
-
//# sourceMappingURL=functions.js.map
|
package/server/utils/index.d.ts
DELETED
package/server/utils/index.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
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.d.ts
DELETED
package/strapi-admin.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
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
|
package/strapi-server.d.ts
DELETED
|
@@ -1,262 +0,0 @@
|
|
|
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
|
-
schema: {
|
|
32
|
-
collectionName: string;
|
|
33
|
-
info: {
|
|
34
|
-
singularName: string;
|
|
35
|
-
pluralName: string;
|
|
36
|
-
displayName: string;
|
|
37
|
-
name: string;
|
|
38
|
-
};
|
|
39
|
-
options: {
|
|
40
|
-
increments: boolean;
|
|
41
|
-
comment: string;
|
|
42
|
-
};
|
|
43
|
-
pluginOptions: {
|
|
44
|
-
"content-manager": {
|
|
45
|
-
visible: boolean;
|
|
46
|
-
};
|
|
47
|
-
"content-type-builder": {
|
|
48
|
-
visible: boolean;
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
attributes: {
|
|
52
|
-
name: {
|
|
53
|
-
type: string;
|
|
54
|
-
configurable: boolean;
|
|
55
|
-
required: boolean;
|
|
56
|
-
};
|
|
57
|
-
slug: {
|
|
58
|
-
type: string;
|
|
59
|
-
target: string;
|
|
60
|
-
configurable: boolean;
|
|
61
|
-
required: boolean;
|
|
62
|
-
};
|
|
63
|
-
visible: {
|
|
64
|
-
type: string;
|
|
65
|
-
default: boolean;
|
|
66
|
-
configurable: boolean;
|
|
67
|
-
};
|
|
68
|
-
items: {
|
|
69
|
-
type: string;
|
|
70
|
-
relation: string;
|
|
71
|
-
target: string;
|
|
72
|
-
configurable: boolean;
|
|
73
|
-
mappedBy: string;
|
|
74
|
-
};
|
|
75
|
-
localizations: {
|
|
76
|
-
type: string;
|
|
77
|
-
relation: string;
|
|
78
|
-
target: string;
|
|
79
|
-
};
|
|
80
|
-
localeCode: {
|
|
81
|
-
type: string;
|
|
82
|
-
};
|
|
83
|
-
};
|
|
84
|
-
};
|
|
85
|
-
lifecycles: Record<import("./types").LifeCycleHookName, import("./types").Effect<import("./types").LifeCycleEvent<import("./types").LifeCycleHookName, unknown, Record<string, unknown>>>>;
|
|
86
|
-
};
|
|
87
|
-
"navigation-item": {
|
|
88
|
-
schema: {
|
|
89
|
-
collectionName: string;
|
|
90
|
-
info: {
|
|
91
|
-
singularName: string;
|
|
92
|
-
pluralName: string;
|
|
93
|
-
displayName: string;
|
|
94
|
-
name: string;
|
|
95
|
-
};
|
|
96
|
-
options: {
|
|
97
|
-
increments: boolean;
|
|
98
|
-
timestamps: boolean;
|
|
99
|
-
comment: string;
|
|
100
|
-
};
|
|
101
|
-
pluginOptions: {
|
|
102
|
-
"content-manager": {
|
|
103
|
-
visible: boolean;
|
|
104
|
-
};
|
|
105
|
-
"content-type-builder": {
|
|
106
|
-
visible: boolean;
|
|
107
|
-
};
|
|
108
|
-
i18n: {
|
|
109
|
-
localized: boolean;
|
|
110
|
-
};
|
|
111
|
-
};
|
|
112
|
-
attributes: {
|
|
113
|
-
title: {
|
|
114
|
-
type: string;
|
|
115
|
-
configurable: boolean;
|
|
116
|
-
required: boolean;
|
|
117
|
-
pluginOptions: {
|
|
118
|
-
i18n: {
|
|
119
|
-
localized: boolean;
|
|
120
|
-
};
|
|
121
|
-
};
|
|
122
|
-
};
|
|
123
|
-
type: {
|
|
124
|
-
type: string;
|
|
125
|
-
enum: string[];
|
|
126
|
-
default: string;
|
|
127
|
-
configurable: boolean;
|
|
128
|
-
};
|
|
129
|
-
path: {
|
|
130
|
-
type: string;
|
|
131
|
-
targetField: string;
|
|
132
|
-
configurable: boolean;
|
|
133
|
-
};
|
|
134
|
-
externalPath: {
|
|
135
|
-
type: string;
|
|
136
|
-
configurable: boolean;
|
|
137
|
-
};
|
|
138
|
-
uiRouterKey: {
|
|
139
|
-
type: string;
|
|
140
|
-
configurable: boolean;
|
|
141
|
-
};
|
|
142
|
-
menuAttached: {
|
|
143
|
-
type: string;
|
|
144
|
-
default: boolean;
|
|
145
|
-
configurable: boolean;
|
|
146
|
-
};
|
|
147
|
-
order: {
|
|
148
|
-
type: string;
|
|
149
|
-
default: number;
|
|
150
|
-
configurable: boolean;
|
|
151
|
-
};
|
|
152
|
-
collapsed: {
|
|
153
|
-
type: string;
|
|
154
|
-
default: boolean;
|
|
155
|
-
configurable: boolean;
|
|
156
|
-
};
|
|
157
|
-
autoSync: {
|
|
158
|
-
type: string;
|
|
159
|
-
default: boolean;
|
|
160
|
-
configurable: boolean;
|
|
161
|
-
};
|
|
162
|
-
related: {
|
|
163
|
-
type: string;
|
|
164
|
-
relation: string;
|
|
165
|
-
target: string;
|
|
166
|
-
configurable: boolean;
|
|
167
|
-
};
|
|
168
|
-
parent: {
|
|
169
|
-
type: string;
|
|
170
|
-
relation: string;
|
|
171
|
-
target: string;
|
|
172
|
-
configurable: boolean;
|
|
173
|
-
default: null;
|
|
174
|
-
};
|
|
175
|
-
master: {
|
|
176
|
-
type: string;
|
|
177
|
-
relation: string;
|
|
178
|
-
target: string;
|
|
179
|
-
configurable: boolean;
|
|
180
|
-
inversedBy: string;
|
|
181
|
-
};
|
|
182
|
-
audience: {
|
|
183
|
-
type: string;
|
|
184
|
-
relation: string;
|
|
185
|
-
target: string;
|
|
186
|
-
};
|
|
187
|
-
additionalFields: {
|
|
188
|
-
type: string;
|
|
189
|
-
require: boolean;
|
|
190
|
-
default: {};
|
|
191
|
-
};
|
|
192
|
-
};
|
|
193
|
-
};
|
|
194
|
-
lifecycles: Record<import("./types").LifeCycleHookName, import("./types").Effect<import("./types").LifeCycleEvent<import("./types").LifeCycleHookName, unknown, Record<string, unknown>>>>;
|
|
195
|
-
};
|
|
196
|
-
"navigations-items-related": {
|
|
197
|
-
schema: {
|
|
198
|
-
collectionName: string;
|
|
199
|
-
info: {
|
|
200
|
-
singularName: string;
|
|
201
|
-
pluralName: string;
|
|
202
|
-
displayName: string;
|
|
203
|
-
name: string;
|
|
204
|
-
};
|
|
205
|
-
options: {
|
|
206
|
-
increments: boolean;
|
|
207
|
-
timestamps: boolean;
|
|
208
|
-
populateCreatorFields: boolean;
|
|
209
|
-
};
|
|
210
|
-
pluginOptions: {
|
|
211
|
-
"content-manager": {
|
|
212
|
-
visible: boolean;
|
|
213
|
-
};
|
|
214
|
-
"content-type-builder": {
|
|
215
|
-
visible: boolean;
|
|
216
|
-
};
|
|
217
|
-
i18n: {
|
|
218
|
-
localized: boolean;
|
|
219
|
-
};
|
|
220
|
-
};
|
|
221
|
-
attributes: {
|
|
222
|
-
related_id: {
|
|
223
|
-
type: string;
|
|
224
|
-
required: boolean;
|
|
225
|
-
};
|
|
226
|
-
related_type: {
|
|
227
|
-
type: string;
|
|
228
|
-
required: boolean;
|
|
229
|
-
};
|
|
230
|
-
field: {
|
|
231
|
-
type: string;
|
|
232
|
-
required: boolean;
|
|
233
|
-
};
|
|
234
|
-
order: {
|
|
235
|
-
type: string;
|
|
236
|
-
required: boolean;
|
|
237
|
-
};
|
|
238
|
-
master: {
|
|
239
|
-
type: string;
|
|
240
|
-
required: boolean;
|
|
241
|
-
};
|
|
242
|
-
};
|
|
243
|
-
};
|
|
244
|
-
};
|
|
245
|
-
};
|
|
246
|
-
controllers: import("./types").NavigationController;
|
|
247
|
-
destroy: () => void;
|
|
248
|
-
middlewares: {};
|
|
249
|
-
policies: {};
|
|
250
|
-
register: () => Promise<void>;
|
|
251
|
-
routes: {
|
|
252
|
-
admin: import("./types").StrapiRoutes;
|
|
253
|
-
'content-api': import("./types").StrapiRoutes;
|
|
254
|
-
};
|
|
255
|
-
services: {
|
|
256
|
-
common: (context: import("strapi-typed").StrapiContext) => import("./types").ICommonService;
|
|
257
|
-
admin: (context: import("strapi-typed").StrapiContext) => import("./types").IAdminService;
|
|
258
|
-
client: (context: import("strapi-typed").StrapiContext) => import("./types").IClientService;
|
|
259
|
-
};
|
|
260
|
-
};
|
|
261
|
-
export = _default;
|
|
262
|
-
//# sourceMappingURL=strapi-server.d.ts.map
|
package/strapi-server.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
const server_1 = __importDefault(require("./server"));
|
|
6
|
-
module.exports = () => server_1.default;
|
|
7
|
-
//# sourceMappingURL=strapi-server.js.map
|