@mattisvensson/strapi-plugin-webatlas 0.13.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/{ContentBox-D4PGQ8eh.js → ContentBox-CHwpYMiB.js} +1 -1
- package/dist/admin/{ContentBox-KyQN2KGV.mjs → ContentBox-CYnyB_5a.mjs} +1 -1
- package/dist/admin/{RoutePicker-CgndSXoF.mjs → RoutePicker-43YnYCpH.mjs} +1 -1
- package/dist/admin/{RoutePicker-CwoMMhf_.js → RoutePicker-D9zf-VdN.js} +1 -1
- package/dist/admin/{de-Cl0vM1wA.js → de-DolV3m7M.js} +64 -1
- package/dist/admin/{de-DWs5ckOd.mjs → de-Dt3jjL3h.mjs} +64 -1
- package/dist/admin/{en-CyhISGZi.mjs → en-CCRmKJEV.mjs} +63 -0
- package/dist/admin/{en-DSmtmPYk.js → en-jWdO5RMZ.js} +63 -0
- package/dist/admin/{index-uOC1Clyv.js → index-7iO5UsYI.js} +2 -2
- package/dist/admin/{index-Bv5Ri-ri.mjs → index-B2k8Pikg.mjs} +2 -2
- package/dist/admin/{index-Ctm4TBT5.mjs → index-CK4JyItR.mjs} +63 -8
- package/dist/admin/{index-BKhrfzjO.mjs → index-CMuhLgfi.mjs} +16 -11
- package/dist/admin/{index-BxGPKxr_.js → index-Ciem6YTr.js} +2 -2
- package/dist/admin/{index-FvaXwOH0.mjs → index-DGYmrx3f.mjs} +2 -2
- package/dist/admin/index-Ddnt9W-v.mjs +1025 -0
- package/dist/admin/{index-JBUU7dE6.js → index-DfG_hSMk.js} +60 -5
- package/dist/admin/{index-DTrsl_uN.js → index-DmOWQK6g.js} +12 -7
- package/dist/admin/index-dB79zyxi.js +1025 -0
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/components/CMEditViewAside/NewPathInfo.d.ts +5 -0
- package/dist/admin/src/components/CMEditViewAside/OverrideCheckbox.d.ts +7 -0
- package/dist/admin/src/components/CMEditViewAside/Panel.d.ts +5 -0
- package/dist/admin/src/components/CMEditViewAside/PathInput.d.ts +12 -0
- package/dist/admin/src/components/CMEditViewAside/RouteStructure.d.ts +3 -0
- package/dist/admin/src/components/CMEditViewAside/UidPathDisplay.d.ts +4 -0
- package/dist/admin/src/components/CMEditViewAside/index.d.ts +3 -0
- package/dist/admin/src/components/Initializer.d.ts +5 -0
- package/dist/admin/src/components/PathInfo.d.ts +8 -0
- package/dist/admin/src/components/PluginIcon.d.ts +3 -0
- package/dist/admin/src/components/Tooltip.d.ts +3 -0
- package/dist/admin/src/components/UI/Center.d.ts +4 -0
- package/dist/admin/src/components/UI/EmptyBox.d.ts +5 -0
- package/dist/admin/src/components/UI/FullLoader.d.ts +3 -0
- package/dist/admin/src/components/UI/WarningBox.d.ts +4 -0
- package/dist/admin/src/components/UI/index.d.ts +5 -0
- package/dist/admin/src/components/customFields/RoutePicker.d.ts +25 -0
- package/dist/admin/src/components/modals/Delete.d.ts +7 -0
- package/dist/admin/src/components/modals/DiscardChanges.d.ts +3 -0
- package/dist/admin/src/components/modals/NavCreate.d.ts +1 -0
- package/dist/admin/src/components/modals/NavEdit.d.ts +7 -0
- package/dist/admin/src/components/modals/NavModal.d.ts +16 -0
- package/dist/admin/src/components/modals/NavOverview.d.ts +10 -0
- package/dist/admin/src/components/modals/SaveConfirm.d.ts +8 -0
- package/dist/admin/src/components/modals/externalItem/index.d.ts +15 -0
- package/dist/admin/src/components/modals/index.d.ts +14 -0
- package/dist/admin/src/components/modals/internalItem/EntrySelection.d.ts +17 -0
- package/dist/admin/src/components/modals/internalItem/ItemDetails.d.ts +13 -0
- package/dist/admin/src/components/modals/internalItem/MultiItemReview.d.ts +23 -0
- package/dist/admin/src/components/modals/internalItem/internalItemCreate.d.ts +2 -0
- package/dist/admin/src/components/modals/internalItem/internalItemEdit.d.ts +2 -0
- package/dist/admin/src/components/modals/useModalSharedLogic.d.ts +2 -0
- package/dist/admin/src/components/modals/withModalSharedLogic.d.ts +3 -0
- package/dist/admin/src/components/modals/wrapperItem/index.d.ts +15 -0
- package/dist/admin/src/contexts/index.d.ts +17 -0
- package/dist/admin/src/hooks/index.d.ts +7 -0
- package/dist/admin/src/hooks/useAllContentTypes.d.ts +7 -0
- package/dist/admin/src/hooks/useAllEntities.d.ts +7 -0
- package/dist/admin/src/hooks/useApi.d.ts +23 -0
- package/dist/admin/src/hooks/useEntrySearch.d.ts +13 -0
- package/dist/admin/src/hooks/useErrorMessage.d.ts +8 -0
- package/dist/admin/src/hooks/usePluginConfig.d.ts +9 -0
- package/dist/admin/src/pages/Navigation/Page.d.ts +2 -0
- package/dist/admin/src/pages/Navigation/PageWrapper.d.ts +8 -0
- package/dist/admin/src/pages/Navigation/RouteItem.d.ts +2 -0
- package/dist/admin/src/pages/Navigation/RouteItemBadge.d.ts +4 -0
- package/dist/admin/src/pages/Navigation/RouteItemIcon.d.ts +5 -0
- package/dist/admin/src/pages/Navigation/RouteItemMenu.d.ts +12 -0
- package/dist/admin/src/pages/Navigation/RouteItemStatus.d.ts +5 -0
- package/dist/admin/src/pages/Navigation/SortableRouteItem.d.ts +2 -0
- package/dist/admin/src/pages/Navigation/UnsavedChangesBlocker.d.ts +8 -0
- package/dist/admin/src/pages/Navigation/index.d.ts +2 -0
- package/dist/admin/src/pages/Navigation/useCollapsedItems.d.ts +13 -0
- package/dist/admin/src/pages/Paths/HealthSummary.d.ts +8 -0
- package/dist/admin/src/pages/Paths/IssueBadges.d.ts +4 -0
- package/dist/admin/src/pages/Paths/PageWrapper.d.ts +5 -0
- package/dist/admin/src/pages/Paths/PathActionsMenu.d.ts +7 -0
- package/dist/admin/src/pages/Paths/PathFilters.d.ts +14 -0
- package/dist/admin/src/pages/Paths/PathTable.d.ts +18 -0
- package/dist/admin/src/pages/Paths/SearchInput.d.ts +5 -0
- package/dist/admin/src/pages/Paths/TableHeader.d.ts +6 -0
- package/dist/admin/src/pages/Paths/TableRow.d.ts +9 -0
- package/dist/admin/src/pages/Paths/compareBy.d.ts +3 -0
- package/dist/admin/src/pages/Paths/hasPathDeviation.d.ts +2 -0
- package/dist/admin/src/pages/Paths/healthMessages.d.ts +11 -0
- package/dist/admin/src/pages/Paths/index.d.ts +2 -0
- package/dist/admin/src/pages/Settings/ContentBox.d.ts +4 -0
- package/dist/admin/src/pages/Settings/General/ContentTypeAccordion.d.ts +9 -0
- package/dist/admin/src/pages/Settings/General/index.d.ts +2 -0
- package/dist/admin/src/pages/Settings/Navigation/index.d.ts +2 -0
- package/dist/admin/src/pages/Settings/PageWrapper.d.ts +7 -0
- package/dist/admin/src/pages/Settings/SettingTitle.d.ts +3 -0
- package/dist/admin/src/pages/Settings/index.d.ts +4 -0
- package/dist/admin/src/permissions.d.ts +51 -0
- package/dist/admin/src/types/index.d.ts +4 -0
- package/dist/admin/src/types/modal.d.ts +60 -0
- package/dist/admin/src/types/navigation.d.ts +24 -0
- package/dist/admin/src/types/panel.d.ts +50 -0
- package/dist/admin/src/types/route.d.ts +3 -0
- package/dist/admin/src/utils/buildBreadcrumbString.d.ts +16 -0
- package/dist/admin/src/utils/createTempNavItemObject.d.ts +22 -0
- package/dist/admin/src/utils/debounce.d.ts +1 -0
- package/dist/admin/src/utils/dnd.d.ts +13 -0
- package/dist/admin/src/utils/duplicateCheck.d.ts +19 -0
- package/dist/admin/src/utils/findParentNavItem.d.ts +13 -0
- package/dist/admin/src/utils/getRouteSourceFields.d.ts +2 -0
- package/dist/admin/src/utils/getTranslation.d.ts +2 -0
- package/dist/admin/src/utils/index.d.ts +11 -0
- package/dist/admin/src/utils/isAbortError.d.ts +5 -0
- package/dist/admin/src/utils/navTree.d.ts +39 -0
- package/dist/admin/src/utils/syncNavItemPaths.d.ts +12 -0
- package/dist/admin/src/utils/typeChecks.d.ts +3 -0
- package/dist/server/index.js +270 -2
- package/dist/server/index.mjs +270 -2
- package/dist/server/src/bootstrap/documentMiddleware.d.ts +18 -0
- package/dist/server/src/bootstrap/index.d.ts +5 -0
- package/dist/server/src/bootstrap/permissions.d.ts +2 -0
- package/dist/server/src/bootstrap/syncConfig.d.ts +3 -0
- package/dist/server/src/bootstrap/webatlasMiddleware.d.ts +2 -0
- package/dist/server/src/bootstrap.d.ts +5 -0
- package/dist/server/src/config/index.d.ts +8 -0
- package/dist/server/src/content-types/index.d.ts +208 -0
- package/dist/server/src/content-types/navigation/index.d.ts +56 -0
- package/dist/server/src/content-types/navigation/schema.d.ts +54 -0
- package/dist/server/src/content-types/navitem/index.d.ts +51 -0
- package/dist/server/src/content-types/navitem/schema.d.ts +49 -0
- package/dist/server/src/content-types/route/index.d.ts +101 -0
- package/dist/server/src/content-types/route/schema.d.ts +99 -0
- package/dist/server/src/controllers/admin.d.ts +19 -0
- package/dist/server/src/controllers/client.d.ts +8 -0
- package/dist/server/src/controllers/index.d.ts +27 -0
- package/dist/server/src/destroy.d.ts +5 -0
- package/dist/server/src/index.d.ts +15 -5
- package/dist/server/src/middlewares/addWebatlasField.d.ts +10 -0
- package/dist/server/src/middlewares/enrichRoutePicker.d.ts +10 -0
- package/dist/server/src/middlewares/index.d.ts +9 -0
- package/dist/server/src/migrations/001-canonical-path.d.ts +7 -0
- package/dist/server/src/migrations/002-webatlas-json-field.d.ts +7 -0
- package/dist/server/src/migrations/003-route-source-field.d.ts +7 -0
- package/dist/server/src/migrations/004-navigation-max-depth.d.ts +7 -0
- package/dist/server/src/migrations/index.d.ts +3 -0
- package/dist/server/src/policies/has-permissions.d.ts +2 -0
- package/dist/server/src/policies/index.d.ts +4 -0
- package/dist/server/src/register.d.ts +5 -0
- package/dist/server/src/routes/admin.d.ts +17 -0
- package/dist/server/src/routes/client.d.ts +12 -0
- package/dist/server/src/routes/index.d.ts +30 -0
- package/dist/server/src/services/admin.d.ts +33 -0
- package/dist/server/src/services/client.d.ts +48 -0
- package/dist/server/src/services/health.d.ts +5 -0
- package/dist/server/src/services/index.d.ts +83 -0
- package/dist/server/src/utils/addWebatlasBreadcrumb.d.ts +14 -0
- package/dist/server/src/utils/assertDescendantPathsAllowed.d.ts +19 -0
- package/dist/server/src/utils/assertPathAllowed.d.ts +2 -0
- package/dist/server/src/utils/buildCanonicalPath.d.ts +1 -0
- package/dist/server/src/utils/buildNavigationPath.d.ts +5 -0
- package/dist/server/src/utils/buildStructuredNavigation.d.ts +12 -0
- package/dist/server/src/utils/cascadePathUpdates.d.ts +6 -0
- package/dist/server/src/utils/cleanRootKeys.d.ts +1 -0
- package/dist/server/src/utils/duplicateCheck.d.ts +1 -0
- package/dist/server/src/utils/enrichRoutePickerFields.d.ts +7 -0
- package/dist/server/src/utils/enrichWebatlasData.d.ts +6 -0
- package/dist/server/src/utils/extractRouteAndItems.d.ts +32 -0
- package/dist/server/src/utils/getDocumentStatuses.d.ts +12 -0
- package/dist/server/src/utils/getNonInternalRouteIds.d.ts +1 -0
- package/dist/server/src/utils/getPublishedDocumentIds.d.ts +11 -0
- package/dist/server/src/utils/getRouteAncestors.d.ts +1 -0
- package/dist/server/src/utils/getRouteDescendants.d.ts +1 -0
- package/dist/server/src/utils/health/checks.d.ts +48 -0
- package/dist/server/src/utils/index.d.ts +29 -0
- package/dist/server/src/utils/isBlacklistedPath.d.ts +1 -0
- package/dist/server/src/utils/navItemHandler.d.ts +5 -0
- package/dist/server/src/utils/navigationItemStructure.d.ts +27 -0
- package/dist/server/src/utils/normalizeRouteBlacklist.d.ts +5 -0
- package/dist/server/src/utils/pluginHelpers.d.ts +4 -0
- package/dist/server/src/utils/populateDeep.d.ts +4 -0
- package/dist/server/src/utils/reduceDepthOfOrphanedItems.d.ts +2 -0
- package/dist/server/src/utils/removeUnpublishedNavItems.d.ts +7 -0
- package/dist/server/src/utils/removeWaFields.d.ts +1 -0
- package/dist/server/src/utils/routeHandler.d.ts +5 -0
- package/dist/server/src/utils/validateRouteDependencies.d.ts +4 -0
- package/package.json +5 -5
- package/dist/admin/index-D2O7sLKs.mjs +0 -249
- package/dist/admin/index-jOCO4_-k.js +0 -249
|
@@ -21,6 +21,7 @@ declare const _default: {
|
|
|
21
21
|
getConfig(ctx: any): Promise<any>;
|
|
22
22
|
getRoute(ctx: any): Promise<any>;
|
|
23
23
|
getAllRoutes(ctx: any): Promise<any>;
|
|
24
|
+
getHealthReport(ctx: any): Promise<any>;
|
|
24
25
|
getRelatedRoute(ctx: any): Promise<any>;
|
|
25
26
|
getRelatedRoutes(ctx: any): Promise<any>;
|
|
26
27
|
getNavigationDepths(ctx: any): Promise<any>;
|
|
@@ -79,7 +80,7 @@ declare const _default: {
|
|
|
79
80
|
getAllRoutes(): Promise<any>;
|
|
80
81
|
getRelatedRoute(documentId: string): Promise<any>;
|
|
81
82
|
getRelatedRoutes(documentIds: string[]): Promise<any>;
|
|
82
|
-
getProhibitedRouteIds(documentId: string): Promise<string[]>;
|
|
83
|
+
getProhibitedRouteIds(documentId: string | undefined): Promise<string[]>;
|
|
83
84
|
getNavigation(documentId?: string, variant?: import('../../types').StructuredNavigationVariant | "namesOnly"): Promise<any>;
|
|
84
85
|
createNavigation(name: string, visible: boolean): Promise<any>;
|
|
85
86
|
updateNavigation(documentId: string, data: import('../../types').NavigationInput): Promise<any>;
|
|
@@ -93,7 +94,7 @@ declare const _default: {
|
|
|
93
94
|
success: boolean;
|
|
94
95
|
errors: string[];
|
|
95
96
|
}>;
|
|
96
|
-
checkUniquePath(initialPath: string, targetRouteDocumentId?: string): Promise<{
|
|
97
|
+
checkUniquePath(initialPath: string, targetRouteDocumentId?: string | null): Promise<{
|
|
97
98
|
blacklisted: boolean;
|
|
98
99
|
uniquePath?: undefined;
|
|
99
100
|
} | {
|
|
@@ -104,7 +105,7 @@ declare const _default: {
|
|
|
104
105
|
client: ({ strapi }: {
|
|
105
106
|
strapi: any;
|
|
106
107
|
}) => {
|
|
107
|
-
getEntityByPath(slug: string, populate: string, populateDeepDepth: number, fields: any, status?: "
|
|
108
|
+
getEntityByPath(slug: string, populate: string, populateDeepDepth: number, fields: any, status?: "draft" | "published", breadcrumb?: boolean, auth?: any): Promise<any>;
|
|
108
109
|
getNavigation(id: string, name: string, slug: string, documentId: string, variant?: import('../../types').StructuredNavigationVariant): Promise<{
|
|
109
110
|
items: {
|
|
110
111
|
depth: any;
|
|
@@ -122,9 +123,15 @@ declare const _default: {
|
|
|
122
123
|
type: import('../../types').RouteType;
|
|
123
124
|
active: boolean;
|
|
124
125
|
isOverride: boolean;
|
|
125
|
-
navitem
|
|
126
|
+
navitem?: {
|
|
126
127
|
id: number;
|
|
127
|
-
|
|
128
|
+
documentId: string;
|
|
129
|
+
navigation?: {
|
|
130
|
+
id: number;
|
|
131
|
+
documentId: string;
|
|
132
|
+
name: string;
|
|
133
|
+
} | null;
|
|
134
|
+
}[] | null;
|
|
128
135
|
parent?: import('../../types').Route;
|
|
129
136
|
children?: import('../../types').Route[];
|
|
130
137
|
createdAt: string;
|
|
@@ -141,6 +148,9 @@ declare const _default: {
|
|
|
141
148
|
createdAt: string;
|
|
142
149
|
}>;
|
|
143
150
|
};
|
|
151
|
+
health: () => {
|
|
152
|
+
getHealthReport(): Promise<import('../../types').HealthReport>;
|
|
153
|
+
};
|
|
144
154
|
};
|
|
145
155
|
contentTypes: {
|
|
146
156
|
route: {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Core } from '@strapi/strapi';
|
|
2
|
+
/**
|
|
3
|
+
* Middleware to add a webatlas field in Content API responses
|
|
4
|
+
* Uses enrichWebatlasData utility to recursively enrich entities with webatlas data
|
|
5
|
+
* Works for nested relations, components, and dynamic zones
|
|
6
|
+
*/
|
|
7
|
+
declare const _default: ({ strapi }: {
|
|
8
|
+
strapi: Core.Strapi;
|
|
9
|
+
}) => (ctx: any, next: any) => Promise<void>;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Core } from '@strapi/strapi';
|
|
2
|
+
/**
|
|
3
|
+
* Middleware to enrich route-picker custom fields in Content API responses
|
|
4
|
+
* Replaces documentId values with actual route paths for internal routes
|
|
5
|
+
* Leaves external URLs unchanged
|
|
6
|
+
*/
|
|
7
|
+
declare const _default: ({ strapi }: {
|
|
8
|
+
strapi: Core.Strapi;
|
|
9
|
+
}) => (ctx: any, next: any) => Promise<void>;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
addWebatlasField: ({ strapi }: {
|
|
3
|
+
strapi: import('@strapi/types/dist/core').Strapi;
|
|
4
|
+
}) => (ctx: any, next: any) => Promise<void>;
|
|
5
|
+
enrichRoutePicker: ({ strapi }: {
|
|
6
|
+
strapi: import('@strapi/types/dist/core').Strapi;
|
|
7
|
+
}) => (ctx: any, next: any) => Promise<void>;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
type: string;
|
|
3
|
+
routes: {
|
|
4
|
+
method: string;
|
|
5
|
+
path: string;
|
|
6
|
+
handler: string;
|
|
7
|
+
config: {
|
|
8
|
+
policies: (string | {
|
|
9
|
+
name: string;
|
|
10
|
+
config: {
|
|
11
|
+
actions: string[];
|
|
12
|
+
};
|
|
13
|
+
})[];
|
|
14
|
+
};
|
|
15
|
+
}[];
|
|
16
|
+
};
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
admin: {
|
|
3
|
+
type: string;
|
|
4
|
+
routes: {
|
|
5
|
+
method: string;
|
|
6
|
+
path: string;
|
|
7
|
+
handler: string;
|
|
8
|
+
config: {
|
|
9
|
+
policies: (string | {
|
|
10
|
+
name: string;
|
|
11
|
+
config: {
|
|
12
|
+
actions: string[];
|
|
13
|
+
};
|
|
14
|
+
})[];
|
|
15
|
+
};
|
|
16
|
+
}[];
|
|
17
|
+
};
|
|
18
|
+
'content-api': {
|
|
19
|
+
type: string;
|
|
20
|
+
routes: {
|
|
21
|
+
method: string;
|
|
22
|
+
path: string;
|
|
23
|
+
handler: string;
|
|
24
|
+
config: {
|
|
25
|
+
policies: any[];
|
|
26
|
+
};
|
|
27
|
+
}[];
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export default _default;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { NavigationInput, NavigationDepth, NestedNavItem, PluginConfig, StructuredNavigationVariant } from '../../../types';
|
|
2
|
+
declare const _default: ({ strapi }: {
|
|
3
|
+
strapi: any;
|
|
4
|
+
}) => {
|
|
5
|
+
updateConfig(newConfig: Partial<PluginConfig>): Promise<PluginConfig>;
|
|
6
|
+
getConfig(): Promise<any>;
|
|
7
|
+
getRoute(documentId: string): Promise<any>;
|
|
8
|
+
getAllRoutes(): Promise<any>;
|
|
9
|
+
getRelatedRoute(documentId: string): Promise<any>;
|
|
10
|
+
getRelatedRoutes(documentIds: string[]): Promise<any>;
|
|
11
|
+
getProhibitedRouteIds(documentId: string | undefined): Promise<string[]>;
|
|
12
|
+
getNavigation(documentId?: string, variant?: StructuredNavigationVariant | "namesOnly"): Promise<any>;
|
|
13
|
+
createNavigation(name: string, visible: boolean): Promise<any>;
|
|
14
|
+
updateNavigation(documentId: string, data: NavigationInput): Promise<any>;
|
|
15
|
+
getNavigationDepths(): Promise<NavigationDepth[]>;
|
|
16
|
+
updateNavigationDepths(depths: {
|
|
17
|
+
documentId: string;
|
|
18
|
+
maxDepth: number;
|
|
19
|
+
}[]): Promise<NavigationDepth[]>;
|
|
20
|
+
deleteNavigation(documentId: string): Promise<any>;
|
|
21
|
+
updateNavigationItemStructure(navigationId: string, navigationItems: NestedNavItem[]): Promise<{
|
|
22
|
+
success: boolean;
|
|
23
|
+
errors: string[];
|
|
24
|
+
}>;
|
|
25
|
+
checkUniquePath(initialPath: string, targetRouteDocumentId?: string | null): Promise<{
|
|
26
|
+
blacklisted: boolean;
|
|
27
|
+
uniquePath?: undefined;
|
|
28
|
+
} | {
|
|
29
|
+
uniquePath: string;
|
|
30
|
+
blacklisted?: undefined;
|
|
31
|
+
}>;
|
|
32
|
+
};
|
|
33
|
+
export default _default;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Route, StructuredNavigationVariant } from '../../../types';
|
|
2
|
+
declare const _default: ({ strapi }: {
|
|
3
|
+
strapi: any;
|
|
4
|
+
}) => {
|
|
5
|
+
getEntityByPath(slug: string, populate: string, populateDeepDepth: number, fields: any, status?: "draft" | "published", breadcrumb?: boolean, auth?: any): Promise<any>;
|
|
6
|
+
getNavigation(id: string, name: string, slug: string, documentId: string, variant?: StructuredNavigationVariant): Promise<{
|
|
7
|
+
items: {
|
|
8
|
+
depth: any;
|
|
9
|
+
items: any;
|
|
10
|
+
id: number;
|
|
11
|
+
documentId: string;
|
|
12
|
+
title: string;
|
|
13
|
+
slug: string;
|
|
14
|
+
path: string;
|
|
15
|
+
uidPath: string;
|
|
16
|
+
canonicalPath: string;
|
|
17
|
+
relatedContentType: string;
|
|
18
|
+
relatedId: number;
|
|
19
|
+
relatedDocumentId: string;
|
|
20
|
+
type: import('../../../types').RouteType;
|
|
21
|
+
active: boolean;
|
|
22
|
+
isOverride: boolean;
|
|
23
|
+
navitem?: {
|
|
24
|
+
id: number;
|
|
25
|
+
documentId: string;
|
|
26
|
+
navigation?: {
|
|
27
|
+
id: number;
|
|
28
|
+
documentId: string;
|
|
29
|
+
name: string;
|
|
30
|
+
} | null;
|
|
31
|
+
}[] | null;
|
|
32
|
+
parent?: Route;
|
|
33
|
+
children?: Route[];
|
|
34
|
+
createdAt: string;
|
|
35
|
+
updatedAt: string;
|
|
36
|
+
__component: string;
|
|
37
|
+
}[];
|
|
38
|
+
id: number;
|
|
39
|
+
documentId: string;
|
|
40
|
+
name: string;
|
|
41
|
+
slug: string;
|
|
42
|
+
visible: boolean;
|
|
43
|
+
maxDepth?: number;
|
|
44
|
+
updatedAt: string;
|
|
45
|
+
createdAt: string;
|
|
46
|
+
}>;
|
|
47
|
+
};
|
|
48
|
+
export default _default;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
admin: ({ strapi }: {
|
|
3
|
+
strapi: any;
|
|
4
|
+
}) => {
|
|
5
|
+
updateConfig(newConfig: Partial<import('../../../types').PluginConfig>): Promise<import('../../../types').PluginConfig>;
|
|
6
|
+
getConfig(): Promise<any>;
|
|
7
|
+
getRoute(documentId: string): Promise<any>;
|
|
8
|
+
getAllRoutes(): Promise<any>;
|
|
9
|
+
getRelatedRoute(documentId: string): Promise<any>;
|
|
10
|
+
getRelatedRoutes(documentIds: string[]): Promise<any>;
|
|
11
|
+
getProhibitedRouteIds(documentId: string | undefined): Promise<string[]>;
|
|
12
|
+
getNavigation(documentId?: string, variant?: import('../../../types').StructuredNavigationVariant | "namesOnly"): Promise<any>;
|
|
13
|
+
createNavigation(name: string, visible: boolean): Promise<any>;
|
|
14
|
+
updateNavigation(documentId: string, data: import('../../../types').NavigationInput): Promise<any>;
|
|
15
|
+
getNavigationDepths(): Promise<import('../../../types').NavigationDepth[]>;
|
|
16
|
+
updateNavigationDepths(depths: {
|
|
17
|
+
documentId: string;
|
|
18
|
+
maxDepth: number;
|
|
19
|
+
}[]): Promise<import('../../../types').NavigationDepth[]>;
|
|
20
|
+
deleteNavigation(documentId: string): Promise<any>;
|
|
21
|
+
updateNavigationItemStructure(navigationId: string, navigationItems: import('../../../types').NestedNavItem[]): Promise<{
|
|
22
|
+
success: boolean;
|
|
23
|
+
errors: string[];
|
|
24
|
+
}>;
|
|
25
|
+
checkUniquePath(initialPath: string, targetRouteDocumentId?: string | null): Promise<{
|
|
26
|
+
blacklisted: boolean;
|
|
27
|
+
uniquePath?: undefined;
|
|
28
|
+
} | {
|
|
29
|
+
uniquePath: string;
|
|
30
|
+
blacklisted?: undefined;
|
|
31
|
+
}>;
|
|
32
|
+
};
|
|
33
|
+
client: ({ strapi }: {
|
|
34
|
+
strapi: any;
|
|
35
|
+
}) => {
|
|
36
|
+
getEntityByPath(slug: string, populate: string, populateDeepDepth: number, fields: any, status?: "draft" | "published", breadcrumb?: boolean, auth?: any): Promise<any>;
|
|
37
|
+
getNavigation(id: string, name: string, slug: string, documentId: string, variant?: import('../../../types').StructuredNavigationVariant): Promise<{
|
|
38
|
+
items: {
|
|
39
|
+
depth: any;
|
|
40
|
+
items: any;
|
|
41
|
+
id: number;
|
|
42
|
+
documentId: string;
|
|
43
|
+
title: string;
|
|
44
|
+
slug: string;
|
|
45
|
+
path: string;
|
|
46
|
+
uidPath: string;
|
|
47
|
+
canonicalPath: string;
|
|
48
|
+
relatedContentType: string;
|
|
49
|
+
relatedId: number;
|
|
50
|
+
relatedDocumentId: string;
|
|
51
|
+
type: import('../../../types').RouteType;
|
|
52
|
+
active: boolean;
|
|
53
|
+
isOverride: boolean;
|
|
54
|
+
navitem?: {
|
|
55
|
+
id: number;
|
|
56
|
+
documentId: string;
|
|
57
|
+
navigation?: {
|
|
58
|
+
id: number;
|
|
59
|
+
documentId: string;
|
|
60
|
+
name: string;
|
|
61
|
+
} | null;
|
|
62
|
+
}[] | null;
|
|
63
|
+
parent?: import('../../../types').Route;
|
|
64
|
+
children?: import('../../../types').Route[];
|
|
65
|
+
createdAt: string;
|
|
66
|
+
updatedAt: string;
|
|
67
|
+
__component: string;
|
|
68
|
+
}[];
|
|
69
|
+
id: number;
|
|
70
|
+
documentId: string;
|
|
71
|
+
name: string;
|
|
72
|
+
slug: string;
|
|
73
|
+
visible: boolean;
|
|
74
|
+
maxDepth?: number;
|
|
75
|
+
updatedAt: string;
|
|
76
|
+
createdAt: string;
|
|
77
|
+
}>;
|
|
78
|
+
};
|
|
79
|
+
health: () => {
|
|
80
|
+
getHealthReport(): Promise<import('../../../types').HealthReport>;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Route } from '../../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Adds the ancestors of the entity's route plus the entity itself to `webatlas.breadcrumb`, ordered
|
|
4
|
+
* from the root to the current page:
|
|
5
|
+
*
|
|
6
|
+
* [{ path: 'page-1', canonicalPath: 'page-1', slug: 'page-1', uidPath: 'page/1', title: 'Page 1' },
|
|
7
|
+
* { path: 'page-1/page-2', canonicalPath: 'page-1/page-2', slug: 'page-2', … }]
|
|
8
|
+
*
|
|
9
|
+
* The hierarchy comes from `canonicalPath`, which is built from the entity titles and therefore
|
|
10
|
+
* unaffected by an overridden `path`.
|
|
11
|
+
*
|
|
12
|
+
* Ancestors without a published entry are left out, unless drafts are requested.
|
|
13
|
+
*/
|
|
14
|
+
export declare function addWebatlasBreadcrumb(data: any, route: Route, status?: 'draft' | 'published'): Promise<any>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks the paths that descendants of a route will receive once the route itself moved (see
|
|
3
|
+
* cascadePathUpdates), so a move can be rejected before anything is written. Mirrors how
|
|
4
|
+
* cascadePathUpdates derives child paths: the canonical path always cascades, while `path` only
|
|
5
|
+
* follows `validatedParentPath` when the parent is an override and the child has no overridden
|
|
6
|
+
* path of its own.
|
|
7
|
+
*
|
|
8
|
+
* Every descendant path starts with `${validatedParentPath}/` resp. `${canonicalPath}/`, so a
|
|
9
|
+
* descendant can only be blocked by a blacklist entry starting with one of those prefixes —
|
|
10
|
+
* provided both parent paths already passed assertPathAllowed. If no entry does, the subtree cannot
|
|
11
|
+
* be affected and the walk is skipped.
|
|
12
|
+
*/
|
|
13
|
+
export default function assertDescendantPathsAllowed({ validatedParentPath, parentRouteDocumentId, canonicalPath, isOverride, routeBlacklist, }: {
|
|
14
|
+
validatedParentPath: string;
|
|
15
|
+
parentRouteDocumentId: string;
|
|
16
|
+
canonicalPath: string;
|
|
17
|
+
isOverride: boolean;
|
|
18
|
+
routeBlacklist: string[];
|
|
19
|
+
}): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function buildCanonicalPath(slug: string, parentDocumentId: string | null): Promise<string>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { NestedNavigation, StructuredNavigationVariant } from '../../../types';
|
|
2
|
+
export default function buildStructuredNavigation(navigation: NestedNavigation, variant?: StructuredNavigationVariant): {
|
|
3
|
+
items: any[];
|
|
4
|
+
id: number;
|
|
5
|
+
documentId: string;
|
|
6
|
+
name: string;
|
|
7
|
+
slug: string;
|
|
8
|
+
visible: boolean;
|
|
9
|
+
maxDepth?: number;
|
|
10
|
+
updatedAt: string;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function cleanRootKeys(obj: any): any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function duplicateCheck(initialPath: string, targetRouteDocumentId?: string | null): Promise<string>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recursively enrich route-picker fields in the data
|
|
3
|
+
* Uses a two-pass approach: first collect all IDs, then fetch routes once, then enrich
|
|
4
|
+
* Accepts a single entity or an array of entities, the routes are fetched with a single query
|
|
5
|
+
* Links to pages without a published entry are set to null, unless drafts are requested
|
|
6
|
+
*/
|
|
7
|
+
export declare function enrichRoutePickerFields(data: any, contentTypeUid: string, status?: 'draft' | 'published'): Promise<any>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enriches response data with webatlas fields for all enabled content types
|
|
3
|
+
* Works recursively to handle nested relations, components, and dynamic zones
|
|
4
|
+
* Accepts a single entity or an array of entities, the routes are fetched with a single query
|
|
5
|
+
*/
|
|
6
|
+
export declare function enrichWebatlasData(data: any, contentTypeUid?: string): Promise<any>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { NestedNavItem } from '../../../types';
|
|
2
|
+
export default function extractRouteAndItems(items: NestedNavItem[]): {
|
|
3
|
+
depth: any;
|
|
4
|
+
items: any;
|
|
5
|
+
id: number;
|
|
6
|
+
documentId: string;
|
|
7
|
+
title: string;
|
|
8
|
+
slug: string;
|
|
9
|
+
path: string;
|
|
10
|
+
uidPath: string;
|
|
11
|
+
canonicalPath: string;
|
|
12
|
+
relatedContentType: string;
|
|
13
|
+
relatedId: number;
|
|
14
|
+
relatedDocumentId: string;
|
|
15
|
+
type: import('../../../types').RouteType;
|
|
16
|
+
active: boolean;
|
|
17
|
+
isOverride: boolean;
|
|
18
|
+
navitem?: {
|
|
19
|
+
id: number;
|
|
20
|
+
documentId: string;
|
|
21
|
+
navigation?: {
|
|
22
|
+
id: number;
|
|
23
|
+
documentId: string;
|
|
24
|
+
name: string;
|
|
25
|
+
} | null;
|
|
26
|
+
}[] | null;
|
|
27
|
+
parent?: import('../../../types').Route;
|
|
28
|
+
children?: import('../../../types').Route[];
|
|
29
|
+
createdAt: string;
|
|
30
|
+
updatedAt: string;
|
|
31
|
+
__component: string;
|
|
32
|
+
}[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type LinkedRoute = {
|
|
2
|
+
relatedContentType?: string;
|
|
3
|
+
relatedDocumentId?: string;
|
|
4
|
+
} | null | undefined;
|
|
5
|
+
type DocumentStatus = 'published' | 'draft' | 'modified';
|
|
6
|
+
/**
|
|
7
|
+
* Returns the content manager status of the entries linked to the given routes, keyed by documentId,
|
|
8
|
+
* fetched with two queries per content type. Entries of content types without draft and publish have
|
|
9
|
+
* no status, like in the content manager. External and wrapper routes are ignored.
|
|
10
|
+
*/
|
|
11
|
+
export default function getDocumentStatuses(routes: LinkedRoute[]): Promise<Map<string, DocumentStatus>>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function getNonInternalRouteIds(): Promise<string[]>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type LinkedRoute = {
|
|
2
|
+
relatedContentType?: string;
|
|
3
|
+
relatedDocumentId?: string;
|
|
4
|
+
} | null | undefined;
|
|
5
|
+
/**
|
|
6
|
+
* Returns the documentIds of the entries linked to the given routes that have a published version,
|
|
7
|
+
* fetched with one query per content type. External and wrapper routes are not linked to an entry and
|
|
8
|
+
* are ignored. Entries of content types that no longer exist are never returned.
|
|
9
|
+
*/
|
|
10
|
+
export default function getPublishedDocumentIds(routes: LinkedRoute[]): Promise<Set<string>>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function getRouteAncestors(routeId: string): Promise<string[]>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function getRouteDescendants(routeId: string): Promise<string[]>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { HealthIssue, Route } from '../../../../types';
|
|
2
|
+
export type HealthRoute = Pick<Route, 'documentId' | 'title' | 'path' | 'canonicalPath' | 'uidPath' | 'type' | 'relatedContentType' | 'relatedDocumentId'>;
|
|
3
|
+
export type HealthNavItem = {
|
|
4
|
+
routeDocumentId: string;
|
|
5
|
+
navigationName: string;
|
|
6
|
+
depth: number;
|
|
7
|
+
maxDepth: number;
|
|
8
|
+
hasChildren: boolean;
|
|
9
|
+
};
|
|
10
|
+
export type HealthData = {
|
|
11
|
+
routes: HealthRoute[];
|
|
12
|
+
navItems: HealthNavItem[];
|
|
13
|
+
existingContentTypes: Set<string>;
|
|
14
|
+
enabledContentTypes: Set<string>;
|
|
15
|
+
existingDocumentIds: Map<string, Set<string>>;
|
|
16
|
+
draftOnlyDocumentIds: Set<string>;
|
|
17
|
+
routeBlacklist: string[];
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* The frontend API finds a route by path, canonicalPath or uidPath with findFirst. A value used by
|
|
21
|
+
* several routes therefore returns any one of them. External routes are skipped, their path is a
|
|
22
|
+
* URL that is never requested through the API and may be linked several times on purpose.
|
|
23
|
+
*/
|
|
24
|
+
export declare function checkPathConflicts({ routes }: HealthData): HealthIssue[];
|
|
25
|
+
/**
|
|
26
|
+
* Internal routes whose entry or content type no longer exists, or whose content type is no longer
|
|
27
|
+
* selected in the plugin settings.
|
|
28
|
+
*/
|
|
29
|
+
export declare function checkOrphanedRoutes({ routes, existingContentTypes, enabledContentTypes, existingDocumentIds, }: HealthData): HealthIssue[];
|
|
30
|
+
/**
|
|
31
|
+
* The blacklist only applies to paths created or updated after saving it, existing routes can
|
|
32
|
+
* still use a blocked path. The canonical path is checked too, the frontend API resolves it as well.
|
|
33
|
+
*/
|
|
34
|
+
export declare function checkBlacklistedPaths({ routes, routeBlacklist }: HealthData): HealthIssue[];
|
|
35
|
+
export declare function checkInvalidExternalUrls({ routes }: HealthData): HealthIssue[];
|
|
36
|
+
/**
|
|
37
|
+
* Navigation items of entries that were never published. The frontend API removes them from the
|
|
38
|
+
* navigation, so they are missing in the navigation without a hint in the admin panel.
|
|
39
|
+
*/
|
|
40
|
+
export declare function checkUnpublishedInNavigation({ routes, navItems, draftOnlyDocumentIds, }: HealthData): HealthIssue[];
|
|
41
|
+
/**
|
|
42
|
+
* Items deeper than the max depth of their navigation, e.g. after the max depth was reduced in the
|
|
43
|
+
* plugin settings.
|
|
44
|
+
*/
|
|
45
|
+
export declare function checkTooDeepItems({ navItems }: HealthData): HealthIssue[];
|
|
46
|
+
export declare function checkNotInNavigation({ routes, navItems }: HealthData): HealthIssue[];
|
|
47
|
+
export declare function checkEmptyWrappers({ routes, navItems }: HealthData): HealthIssue[];
|
|
48
|
+
export default function runHealthChecks(data: HealthData): HealthIssue[];
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { default as duplicateCheck } from './duplicateCheck';
|
|
2
|
+
import { createNavItem, updateNavItem, deleteNavItem } from './navItemHandler';
|
|
3
|
+
import { getAdminService, getClientService } from './pluginHelpers';
|
|
4
|
+
import { default as reduceDepthOfOrphanedItems } from './reduceDepthOfOrphanedItems';
|
|
5
|
+
import { createExternalRoute, updateRoute, deleteRoute } from './routeHandler';
|
|
6
|
+
import { default as buildStructuredNavigation } from './buildStructuredNavigation';
|
|
7
|
+
import { default as extractRouteAndItems } from './extractRouteAndItems';
|
|
8
|
+
import { default as getFullPopulateObject } from './populateDeep';
|
|
9
|
+
import { default as cleanRootKeys } from './cleanRootKeys';
|
|
10
|
+
import { default as removeWaFields } from './removeWaFields';
|
|
11
|
+
import { default as buildCanonicalPath } from './buildCanonicalPath';
|
|
12
|
+
import { default as cascadePathUpdates } from './cascadePathUpdates';
|
|
13
|
+
import { default as getRouteAncestors } from './getRouteAncestors';
|
|
14
|
+
import { default as getRouteDescendants } from './getRouteDescendants';
|
|
15
|
+
import { default as getNonInternalRouteIds } from './getNonInternalRouteIds';
|
|
16
|
+
import { default as validateRouteDependencies } from './validateRouteDependencies';
|
|
17
|
+
import { default as buildNavigationPath } from './buildNavigationPath';
|
|
18
|
+
import { handleItemDeletion, handleItemUpdate, calculateParentAndOrder } from './navigationItemStructure';
|
|
19
|
+
import { enrichWebatlasData } from './enrichWebatlasData';
|
|
20
|
+
import { enrichRoutePickerFields } from './enrichRoutePickerFields';
|
|
21
|
+
import { default as isBlacklistedPath } from './isBlacklistedPath';
|
|
22
|
+
import { default as assertPathAllowed, getRouteBlacklist } from './assertPathAllowed';
|
|
23
|
+
import { default as assertDescendantPathsAllowed } from './assertDescendantPathsAllowed';
|
|
24
|
+
import { default as normalizeRouteBlacklist } from './normalizeRouteBlacklist';
|
|
25
|
+
import { addWebatlasBreadcrumb } from './addWebatlasBreadcrumb';
|
|
26
|
+
import { default as removeUnpublishedNavItems } from './removeUnpublishedNavItems';
|
|
27
|
+
import { default as getPublishedDocumentIds } from './getPublishedDocumentIds';
|
|
28
|
+
import { default as getDocumentStatuses } from './getDocumentStatuses';
|
|
29
|
+
export { duplicateCheck, createNavItem, updateNavItem, deleteNavItem, getAdminService, getClientService, reduceDepthOfOrphanedItems, createExternalRoute, updateRoute, deleteRoute, buildStructuredNavigation, extractRouteAndItems, getFullPopulateObject, cleanRootKeys, removeWaFields, buildCanonicalPath, cascadePathUpdates, getRouteAncestors, getRouteDescendants, getNonInternalRouteIds, validateRouteDependencies, buildNavigationPath, handleItemDeletion, handleItemUpdate, calculateParentAndOrder, enrichWebatlasData, enrichRoutePickerFields, isBlacklistedPath, assertPathAllowed, getRouteBlacklist, assertDescendantPathsAllowed, normalizeRouteBlacklist, addWebatlasBreadcrumb, removeUnpublishedNavItems, getPublishedDocumentIds, getDocumentStatuses, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function isBlacklistedPath(url: string, routeBlacklist: string[]): boolean;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { NavItemSettings, NestedNavItem } from '../../../types';
|
|
2
|
+
declare function createNavItem(data: NavItemSettings): Promise<null | NestedNavItem>;
|
|
3
|
+
declare function updateNavItem(documentId: string, data: Pick<NavItemSettings, 'parent' | 'order'>): Promise<import('@strapi/types/dist/modules/documents').AnyDocument>;
|
|
4
|
+
declare function deleteNavItem(documentId: string): Promise<boolean>;
|
|
5
|
+
export { createNavItem, updateNavItem, deleteNavItem };
|