@daffodil/external-router 0.78.0 → 0.80.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.
Files changed (133) hide show
  1. package/README.md +116 -7
  2. package/config.d.ts +1 -10
  3. package/driver/in-memory/config.d.ts +1 -7
  4. package/driver/in-memory/in-memory.module.d.ts +2 -0
  5. package/driver/in-memory/provider.d.ts +6 -0
  6. package/driver/in-memory/public_api.d.ts +1 -0
  7. package/driver/interfaces/external-router-driver.interface.d.ts +2 -6
  8. package/driver/magento/2.4.3/magento.service.d.ts +2 -1
  9. package/driver/magento/2.4.3/provider.d.ts +5 -0
  10. package/driver/magento/2.4.3/public_api.d.ts +1 -0
  11. package/driver/magento/2.4.3/transforms/schema/category/category.d.ts +2 -0
  12. package/driver/magento/2.4.3/transforms/schema/clientify-url-path.d.ts +1 -0
  13. package/driver/magento/2.4.3/transforms/schema/product/base.d.ts +2 -0
  14. package/driver/magento/2.4.3/transforms/schema/product/bundle.d.ts +2 -0
  15. package/driver/magento/2.4.3/transforms/schema/product/configurable.d.ts +2 -0
  16. package/driver/magento/2.4.3/transforms/schema/product/product.d.ts +5 -0
  17. package/driver/magento/2.4.3/transforms/schema/product/simple.d.ts +2 -0
  18. package/driver/magento/2.4.3/transforms/schema/rescale-rating.d.ts +5 -0
  19. package/driver/magento/2.4.3/transforms/schema/transform-schema.d.ts +2 -0
  20. package/driver/magento/2.4.3/transforms/transform-client-urls.d.ts +2 -0
  21. package/driver/magento/model/category-route-product.d.ts +77 -0
  22. package/driver/magento/model/category-route.d.ts +41 -0
  23. package/driver/magento/model/product-route.d.ts +85 -0
  24. package/driver/magento/model/public_api.d.ts +2 -0
  25. package/driver/magento/model/routable.d.ts +14 -0
  26. package/driver/magento/model/route.d.ts +4 -34
  27. package/driver/public_api.d.ts +1 -1
  28. package/driver/testing/config.d.ts +3 -9
  29. package/driver/testing/provider.d.ts +6 -0
  30. package/driver/testing/public_api.d.ts +1 -0
  31. package/esm2022/config.mjs +8 -7
  32. package/esm2022/driver/in-memory/config.mjs +8 -6
  33. package/esm2022/driver/in-memory/in-memory.module.mjs +8 -15
  34. package/esm2022/driver/in-memory/provider.mjs +12 -0
  35. package/esm2022/driver/in-memory/public_api.mjs +2 -1
  36. package/esm2022/driver/interfaces/external-router-driver.interface.mjs +8 -3
  37. package/esm2022/driver/magento/2.4.1/magento.module.mjs +5 -12
  38. package/esm2022/driver/magento/2.4.2/magento.module.mjs +5 -12
  39. package/esm2022/driver/magento/2.4.3/graphql/queries/resolve.mjs +66 -2
  40. package/esm2022/driver/magento/2.4.3/magento.module.mjs +5 -12
  41. package/esm2022/driver/magento/2.4.3/magento.service.mjs +12 -6
  42. package/esm2022/driver/magento/2.4.3/provider.mjs +13 -0
  43. package/esm2022/driver/magento/2.4.3/public_api.mjs +2 -1
  44. package/esm2022/driver/magento/2.4.3/transforms/resolution-to-resolvable-url.mjs +7 -3
  45. package/esm2022/driver/magento/2.4.3/transforms/schema/category/category.mjs +15 -0
  46. package/esm2022/driver/magento/2.4.3/transforms/schema/clientify-url-path.mjs +2 -0
  47. package/esm2022/driver/magento/2.4.3/transforms/schema/product/base.mjs +16 -0
  48. package/esm2022/driver/magento/2.4.3/transforms/schema/product/bundle.mjs +11 -0
  49. package/esm2022/driver/magento/2.4.3/transforms/schema/product/configurable.mjs +11 -0
  50. package/esm2022/driver/magento/2.4.3/transforms/schema/product/product.mjs +20 -0
  51. package/esm2022/driver/magento/2.4.3/transforms/schema/product/simple.mjs +25 -0
  52. package/esm2022/driver/magento/2.4.3/transforms/schema/rescale-rating.mjs +6 -0
  53. package/esm2022/driver/magento/2.4.3/transforms/schema/transform-schema.mjs +13 -0
  54. package/esm2022/driver/magento/2.4.3/transforms/transform-client-urls.mjs +28 -0
  55. package/esm2022/driver/magento/model/category-route-product.mjs +2 -0
  56. package/esm2022/driver/magento/model/category-route.mjs +2 -0
  57. package/esm2022/driver/magento/model/product-route.mjs +2 -0
  58. package/esm2022/driver/magento/model/public_api.mjs +1 -1
  59. package/esm2022/driver/magento/model/routable.mjs +2 -0
  60. package/esm2022/driver/magento/model/route.mjs +1 -1
  61. package/esm2022/driver/public_api.mjs +2 -2
  62. package/esm2022/driver/testing/config.mjs +8 -6
  63. package/esm2022/driver/testing/provider.mjs +12 -0
  64. package/esm2022/driver/testing/public_api.mjs +2 -1
  65. package/esm2022/driver/testing/testing.module.mjs +5 -11
  66. package/esm2022/driver/testing/testing.service.mjs +13 -11
  67. package/esm2022/model/public_api.mjs +1 -1
  68. package/esm2022/model/route-data.mjs +1 -1
  69. package/esm2022/model/route-with-seo-data.mjs +1 -1
  70. package/esm2022/provide-external-router.mjs +6 -0
  71. package/esm2022/public_api.mjs +2 -10
  72. package/esm2022/routing/guard/external-matcher-type.guard.mjs +43 -0
  73. package/esm2022/routing/helper/convert-to-path.mjs +7 -0
  74. package/esm2022/routing/public_api.mjs +2 -2
  75. package/fesm2022/daffodil-external-router-driver-in-memory.mjs +22 -18
  76. package/fesm2022/daffodil-external-router-driver-in-memory.mjs.map +1 -1
  77. package/fesm2022/daffodil-external-router-driver-magento-2.4.1.mjs +4 -11
  78. package/fesm2022/daffodil-external-router-driver-magento-2.4.1.mjs.map +1 -1
  79. package/fesm2022/daffodil-external-router-driver-magento-2.4.2.mjs +4 -11
  80. package/fesm2022/daffodil-external-router-driver-magento-2.4.2.mjs.map +1 -1
  81. package/fesm2022/daffodil-external-router-driver-magento-2.4.3.mjs +228 -21
  82. package/fesm2022/daffodil-external-router-driver-magento-2.4.3.mjs.map +1 -1
  83. package/fesm2022/daffodil-external-router-driver-testing.mjs +31 -25
  84. package/fesm2022/daffodil-external-router-driver-testing.mjs.map +1 -1
  85. package/fesm2022/daffodil-external-router-driver.mjs +8 -3
  86. package/fesm2022/daffodil-external-router-driver.mjs.map +1 -1
  87. package/fesm2022/daffodil-external-router-routing.mjs +40 -66
  88. package/fesm2022/daffodil-external-router-routing.mjs.map +1 -1
  89. package/fesm2022/daffodil-external-router.mjs +10 -282
  90. package/fesm2022/daffodil-external-router.mjs.map +1 -1
  91. package/model/public_api.d.ts +2 -5
  92. package/model/route-data.d.ts +13 -0
  93. package/model/route-with-seo-data.d.ts +3 -4
  94. package/package.json +1 -1
  95. package/provide-external-router.d.ts +3 -0
  96. package/public_api.d.ts +1 -9
  97. package/routing/guard/external-matcher-type.guard.d.ts +10 -0
  98. package/routing/helper/convert-to-path.d.ts +7 -0
  99. package/routing/public_api.d.ts +1 -1
  100. package/errors/no-wildcard.d.ts +0 -9
  101. package/errors/unknown-type.d.ts +0 -9
  102. package/esm2022/errors/no-wildcard.mjs +0 -12
  103. package/esm2022/errors/unknown-type.mjs +0 -12
  104. package/esm2022/external-router.module.mjs +0 -31
  105. package/esm2022/model/insertion-strategy.type.mjs +0 -2
  106. package/esm2022/model/route-info.mjs +0 -2
  107. package/esm2022/model/route-with-data-path.mjs +0 -2
  108. package/esm2022/model/route-with-type.mjs +0 -2
  109. package/esm2022/model/route-without-path.mjs +0 -2
  110. package/esm2022/model/type-route-pair.mjs +0 -2
  111. package/esm2022/router/router.service.mjs +0 -43
  112. package/esm2022/router/strategies/insert-data-path.mjs +0 -84
  113. package/esm2022/router/strategies/insert-route-before-wildcard.mjs +0 -17
  114. package/esm2022/router/url-matcher/data-path-matcher.mjs +0 -31
  115. package/esm2022/routing/guard/existence.guard.mjs +0 -77
  116. package/esm2022/token/type-resolvable-routes.token.mjs +0 -29
  117. package/esm2022/transform/resolved-route-to-route.mjs +0 -24
  118. package/esm2022/util/extract-daff-path-data.mjs +0 -9
  119. package/external-router.module.d.ts +0 -15
  120. package/model/insertion-strategy.type.d.ts +0 -8
  121. package/model/route-info.d.ts +0 -9
  122. package/model/route-with-data-path.d.ts +0 -14
  123. package/model/route-with-type.d.ts +0 -12
  124. package/model/route-without-path.d.ts +0 -7
  125. package/model/type-route-pair.d.ts +0 -26
  126. package/router/router.service.d.ts +0 -15
  127. package/router/strategies/insert-data-path.d.ts +0 -40
  128. package/router/strategies/insert-route-before-wildcard.d.ts +0 -6
  129. package/router/url-matcher/data-path-matcher.d.ts +0 -20
  130. package/routing/guard/existence.guard.d.ts +0 -22
  131. package/token/type-resolvable-routes.token.d.ts +0 -14
  132. package/transform/resolved-route-to-route.d.ts +0 -7
  133. package/util/extract-daff-path-data.d.ts +0 -6
@@ -1,29 +0,0 @@
1
- import { InjectionToken, } from '@angular/core';
2
- /**
3
- * A multi-token that allows you to register route "types" that correspond to routes.
4
- */
5
- export const DAFF_EXTERNAL_ROUTER_ROUTES_RESOLVABLE_BY_TYPE = new InjectionToken('DAFF_EXTERNAL_ROUTER_RESOLVABLE_TYPE_ROUTES', {
6
- providedIn: 'root',
7
- factory: () => [],
8
- });
9
- /**
10
- * A provider used to connect a type to a route to enable dynamic route resolution at runtime.
11
- */
12
- export function daffProvideRouteResolvableByType(typeRoutePair) {
13
- return {
14
- provide: DAFF_EXTERNAL_ROUTER_ROUTES_RESOLVABLE_BY_TYPE,
15
- multi: true,
16
- useValue: typeRoutePair,
17
- };
18
- }
19
- /**
20
- * A multi-provider used to connect an array of types to their respective routes.
21
- */
22
- export function daffProvideRoutesResolvableByType(routes) {
23
- return routes.map((route) => ({
24
- provide: DAFF_EXTERNAL_ROUTER_ROUTES_RESOLVABLE_BY_TYPE,
25
- multi: true,
26
- useValue: route,
27
- }));
28
- }
29
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZS1yZXNvbHZhYmxlLXJvdXRlcy50b2tlbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYnMvZXh0ZXJuYWwtcm91dGVyL3NyYy90b2tlbi90eXBlLXJlc29sdmFibGUtcm91dGVzLnRva2VuLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFDTCxjQUFjLEdBRWYsTUFBTSxlQUFlLENBQUM7QUFPdkI7O0dBRUc7QUFDSCxNQUFNLENBQ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m92aWRlUm91dGVzUmVzb2x2YWJsZUJ5VHlwZShyb3V0ZXM6IERhZmZUeXBlUm91dGVQYWlyW10pOiBQcm92aWRlcltdIHtcbiAgcmV0dXJuIHJvdXRlcy5tYXAoKHJvdXRlOiBEYWZmVHlwZVJvdXRlUGFpcikgPT4gKHtcbiAgICBwcm92aWRlOiBEQUZGX0VYVEVSTkFMX1JPVVRFUl9ST1VURVNfUkVTT0xWQUJMRV9CWV9UWVBFLFxuICAgIG11bHRpOiB0cnVlLFxuICAgIHVzZVZhbHVlOiByb3V0ZSxcbiAgfSkpO1xufVxuIl19
@@ -1,24 +0,0 @@
1
- import { DaffExternalRouterUnknownRouteTypeError } from '../errors/unknown-type';
2
- /**
3
- * Transforms a DaffExternallyResolvableUrl into an Angular Route.
4
- */
5
- export const daffTransformResolvedRouteToRoute = (resolvedRoute, availableTypes) => {
6
- const routeType = availableTypes
7
- .filter(t => t.type === resolvedRoute.type)
8
- .shift();
9
- if (!routeType) {
10
- throw new DaffExternalRouterUnknownRouteTypeError(`Unable to resolve the route '${resolvedRoute.url}'. Its type is '${resolvedRoute.type}' but a matching route wasn't found.`);
11
- }
12
- return {
13
- route: {
14
- path: resolvedRoute.url,
15
- daffExternalRouteType: resolvedRoute.type,
16
- ...routeType.route,
17
- data: {
18
- ...resolvedRoute.data,
19
- },
20
- },
21
- insertionStrategy: routeType.insertionStrategy,
22
- };
23
- };
24
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVzb2x2ZWQtcm91dGUtdG8tcm91dGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9saWJzL2V4dGVybmFsLXJvdXRlci9zcmMvdHJhbnNmb3JtL3Jlc29sdmVkLXJvdXRlLXRvLXJvdXRlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSx1Q0FBdUMsRUFBRSxNQUFNLHdCQUF3QixD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lc29sdmVkUm91dGUuZGF0YSxcbiAgICAgIH0sXG4gICAgfSxcbiAgICBpbnNlcnRpb25TdHJhdGVneTogcm91dGVUeXBlLmluc2VydGlvblN0cmF0ZWd5LFxuICB9O1xufTtcbiJdfQ==
@@ -1,9 +0,0 @@
1
- /**
2
- * Extracts a key from DaffPath data based upon the currently activated
3
- * RouteSnapshot.
4
- */
5
- export const daffExtractDaffPathData = (snapshot, key) => {
6
- const pathFromRoot = snapshot.pathFromRoot.flatMap((route) => route.url).map((seg) => seg.path).join('/');
7
- return snapshot.data?.daffPaths?.[pathFromRoot]?.[key] ?? null;
8
- };
9
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXh0cmFjdC1kYWZmLXBhdGgtZGF0YS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYnMvZXh0ZXJuYWwtcm91dGVyL3NyYy91dGlsL2V4dHJhY3QtZGFmZi1wYXRoLWRhdGEudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBS0E7OztHQUdHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sdUJBQXVCLEdBQUcsQ0FBcUQsUUFBZ0MsRUFBRSxHQUFNLEVBQVEsRUFBRTtJQUM1SSxNQUFNLFlBQVksR0FBRyxRQUFRLENBQUMsWUFBWSxDQUFDLE9BQU8sQ0FBQyxDQUFDLEtBQUssRUFBRSxFQUFFLENBQUMsS0FBSyxDQUFDLEdBQUcsQ0FBQyxDQUFDLEdBQUcsQ0FBQyxDQUFDLEdBQUcsRUFBRSxFQUFFLENBQUMsR0FBRyxDQUFDLElBQUksQ0FBQyxDQUFDLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQztJQUMxRyxPQUFPLFFBQVEsQ0FBQyxJQUFJLEVBQUUsU0FBUyxFQUFFLENBQUMsWUFBWSxDQUFDLEVBQUUsQ0FBQyxHQUFHLENBQUMsSUFBSSxJQUFJLENBQUM7QUFDakUsQ0FBQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHtcbiAgQWN0aXZhdGVkUm91dGVTbmFwc2hvdCxcbiAgRGF0YSxcbn0gZnJvbSAnQGFuZ3VsYXIvcm91dGVyJztcblxuLyoqXG4gKiBFeHRyYWN0cyBhIGtleSBmcm9tIERhZmZQYXRoIGRhdGEgYmFzZWQgdXBvbiB0aGUgY3VycmVudGx5IGFjdGl2YXRlZFxuICogUm91dGVTbmFwc2hvdC5cbiAqL1xuZXhwb3J0IGNvbnN0IGRhZmZFeHRyYWN0RGFmZlBhdGhEYXRhID0gPFQgZXh0ZW5kcyBEYXRhID0gRGF0YSwgSyBleHRlbmRzIGtleW9mIFQgPSBrZXlvZiBUPihzbmFwc2hvdDogQWN0aXZhdGVkUm91dGVTbmFwc2hvdCwga2V5OiBLKTogVFtLXSA9PiB7XG4gIGNvbnN0IHBhdGhGcm9tUm9vdCA9IHNuYXBzaG90LnBhdGhGcm9tUm9vdC5mbGF0TWFwKChyb3V0ZSkgPT4gcm91dGUudXJsKS5tYXAoKHNlZykgPT4gc2VnLnBhdGgpLmpvaW4oJy8nKTtcbiAgcmV0dXJuIHNuYXBzaG90LmRhdGE/LmRhZmZQYXRocz8uW3BhdGhGcm9tUm9vdF0/LltrZXldID8/IG51bGw7XG59O1xuIl19
@@ -1,15 +0,0 @@
1
- import { ModuleWithProviders } from '@angular/core';
2
- import { DaffExternalRouterConfiguration } from './config';
3
- import { DaffTypeRoutePair } from './model/type-route-pair';
4
- import * as i0 from "@angular/core";
5
- import * as i1 from "@angular/common";
6
- /**
7
- * The external `DaffExternalRouterModule` allows you to configure the
8
- * `@daffodil/external-router` package's behavior.
9
- */
10
- export declare class DaffExternalRouterModule {
11
- static forRoot(config: Partial<DaffExternalRouterConfiguration>, routes?: DaffTypeRoutePair[]): ModuleWithProviders<DaffExternalRouterModule>;
12
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffExternalRouterModule, never>;
13
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffExternalRouterModule, never, [typeof i1.CommonModule], never>;
14
- static ɵinj: i0.ɵɵInjectorDeclaration<DaffExternalRouterModule>;
15
- }
@@ -1,8 +0,0 @@
1
- import { Route, Routes } from '@angular/router';
2
- /**
3
- * A function used to insert a route into a routing config.
4
- * The entire routing configuration will be replaced by the return value
5
- * so a typical usage should not modify the config beyond simply adding the route
6
- * to the desired location.
7
- */
8
- export type DaffExternalRouterInsertionStrategy = (route: Route, routes: Routes) => Routes;
@@ -1,9 +0,0 @@
1
- import { DaffExternalRouterInsertionStrategy } from './insertion-strategy.type';
2
- import { DaffRouteWithType } from './route-with-type';
3
- /**
4
- * An object containing the info needed to insert a route into a configuration.
5
- */
6
- export interface DaffRouteInfo {
7
- route: DaffRouteWithType;
8
- insertionStrategy?: DaffExternalRouterInsertionStrategy;
9
- }
@@ -1,14 +0,0 @@
1
- import { Data, Route } from '@angular/router';
2
- import { DaffRouteData } from './route-data';
3
- /**
4
- * A type that describes the special data that Daffodil will look for when attempting
5
- * to match a route based upon path data stored in the `data` key of a route.
6
- *
7
- * {@link daffDataPathUrlMatcher}
8
- * {@link daffInsertDataPathStrategy}
9
- */
10
- export type DaffRouteWithDataPath = Route & {
11
- data?: {
12
- daffPaths?: Record<string, DaffRouteData | Data>;
13
- };
14
- };
@@ -1,12 +0,0 @@
1
- import { Route } from '@angular/router';
2
- import { DaffExternalRouteType } from './route-type';
3
- /**
4
- * A type that describes the special data that Daffodil will look for when attempting
5
- * to match a route based upon path data stored in the `data` key of a route.
6
- *
7
- * {@link daffDataPathUrlMatcher}
8
- * {@link daffInsertDataPathStrategy}
9
- */
10
- export type DaffRouteWithType = Route & {
11
- daffExternalRouteType: DaffExternalRouteType;
12
- };
@@ -1,7 +0,0 @@
1
- import { Route } from '@angular/router';
2
- /**
3
- * A DaffRouteWithoutPath is a special kind of route definition without a path.
4
- * This is useful when defining routes that aren't provided a path initially,
5
- * but will be provided with one at a later time, e.g. at runtime.
6
- */
7
- export type DaffRouteWithoutPath = Omit<Route, 'path'>;
@@ -1,26 +0,0 @@
1
- import { DaffExternalRouterInsertionStrategy } from './insertion-strategy.type';
2
- import { DaffExternalRouteType } from './route-type';
3
- import { DaffRouteWithoutPath } from './route-without-path';
4
- /**
5
- * A model used to describe the relationship between a {@link DaffExternalRouterType}
6
- * and its corresponding route.
7
- *
8
- * The DaffTypeRoutePair is the pre-provided "glue" that a developer will provide
9
- * ahead-of-time so that that the External Router knows what the list of available
10
- * "types" are (along with that type's corresponding route).
11
- *
12
- * An insertion strategy can be specified if the route needs to be inserted somewhere
13
- * other than the root of the route config.
14
- * Omitting the insertion strategy will default to inserting the route to the root level,
15
- * immediately before the wildcard route.
16
- *
17
- * @docs-private
18
- */
19
- export interface DaffTypeRoutePair {
20
- type: DaffExternalRouteType;
21
- route: DaffRouteWithoutPath;
22
- /**
23
- * An optional function to provide route insertion behavior.
24
- */
25
- insertionStrategy?: DaffExternalRouterInsertionStrategy;
26
- }
@@ -1,15 +0,0 @@
1
- import { Router } from '@angular/router';
2
- import { DaffExternallyResolvableUrl } from '../model/resolvable-route';
3
- import { DaffTypeRoutePair } from '../model/type-route-pair';
4
- import * as i0 from "@angular/core";
5
- export declare class DaffExternalRouter {
6
- private router;
7
- private runtimeRoutes;
8
- constructor(router: Router, runtimeRoutes: DaffTypeRoutePair[]);
9
- /**
10
- * Adds a route to the existing router configuration.
11
- */
12
- add(resolvedRoute: DaffExternallyResolvableUrl): void;
13
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffExternalRouter, never>;
14
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffExternalRouter>;
15
- }
@@ -1,40 +0,0 @@
1
- import { DaffExternalRouterInsertionStrategy } from '../../model/insertion-strategy.type';
2
- /**
3
- * A route insertion strategy that can be used to append external routes onto
4
- * existing Angular routes. This can be useful when you need to route to
5
- * an existing lazy-loaded module from multiple externally defined urls.
6
- *
7
- * This should be used in combination with the {@link daffDataPathUrlMatcher} to match lazy-loaded modules with
8
- * associated external urls.
9
- *
10
- * For example, you can provide the insertion strategy in the {@link DaffExternalRouterModule} as below.
11
- *
12
- * ```ts
13
- * DaffExternalRouterModule.forRoot({}, [
14
- * {
15
- * type: 'CATEGORY',
16
- * insertionStrategy: daffInsertDataPathStrategy,
17
- * route: {}
18
- * }
19
- * ],
20
- * ```
21
- *
22
- * Then, you can match it with an associated route defined in your Routing
23
- * configuration with the {@link daffDataPathUrlMatcher}.
24
- *
25
- * ```ts
26
- * export const routes: Routes = [
27
- * {
28
- * matcher: daffDataPathUrlMatcher,
29
- * data: {
30
- * daffExternalRouteType: "CATEGORY",
31
- * },
32
- * loadChildren: () => import('./category/category.module').then((m) => m.MyCategoryModule),
33
- * }
34
- * ]
35
- * ```
36
- *
37
- * See {@link DaffRouteWithDataPath}
38
- *
39
- */
40
- export declare const daffInsertDataPathStrategy: DaffExternalRouterInsertionStrategy;
@@ -1,6 +0,0 @@
1
- import { DaffExternalRouterInsertionStrategy } from '../../model/insertion-strategy.type';
2
- /**
3
- * Inserts a Route into Routes right before the wildcard route.
4
- * If no wildcard is found, it fails fast with a `DaffExternalRouterNoWildcardError`.
5
- */
6
- export declare const daffInsertRouteBeforeWildCardStrategy: DaffExternalRouterInsertionStrategy;
@@ -1,20 +0,0 @@
1
- import { UrlMatcher } from '@angular/router';
2
- /**
3
- * A UrlMatcher that does an exact match against a path stored in the special
4
- * configuration fields that External Router stores on a Route's data.
5
- *
6
- * ```ts
7
- * export const routes: Routes = [
8
- * {
9
- * matcher: daffDataPathUrlMatcher,
10
- * data: {
11
- * daffExternalRouteType: "CATEGORY",
12
- * },
13
- * loadChildren: () => import('./category/category.module').then((m) => m.ShopCategoryModule),
14
- * }
15
- * ]
16
- * ```
17
- * {@link daffInsertDataPathStrategy }
18
- * {@link DaffRouteWithDataPath }
19
- */
20
- export declare const daffDataPathUrlMatcher: UrlMatcher;
@@ -1,22 +0,0 @@
1
- import { ActivatedRouteSnapshot, Router, RouterStateSnapshot, UrlTree } from '@angular/router';
2
- import { Observable } from 'rxjs';
3
- import { DaffRoutingUriNormalizer } from '@daffodil/core/routing';
4
- import { DaffExternalRouter, DaffExternalRouterConfiguration } from '@daffodil/external-router';
5
- import { DaffExternalRouterDriverInterface } from '@daffodil/external-router/driver';
6
- import * as i0 from "@angular/core";
7
- /**
8
- * The DaffExternalRouterExistenceGuard is responsible for guarding the wildcard route
9
- * of an Angular App and either navigating to a resolved route upon successful resolution
10
- * or navigating to the configured route upon a failed resolution.
11
- */
12
- export declare class DaffExternalRouterExistenceGuard {
13
- private driver;
14
- private externalRouter;
15
- private router;
16
- private config;
17
- private urlNormalizer;
18
- constructor(driver: DaffExternalRouterDriverInterface, externalRouter: DaffExternalRouter, router: Router, config: DaffExternalRouterConfiguration, urlNormalizer: DaffRoutingUriNormalizer);
19
- canActivate(next: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<UrlTree | boolean>;
20
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffExternalRouterExistenceGuard, never>;
21
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffExternalRouterExistenceGuard>;
22
- }
@@ -1,14 +0,0 @@
1
- import { InjectionToken, Provider } from '@angular/core';
2
- import { DaffTypeRoutePair } from '../model/type-route-pair';
3
- /**
4
- * A multi-token that allows you to register route "types" that correspond to routes.
5
- */
6
- export declare const DAFF_EXTERNAL_ROUTER_ROUTES_RESOLVABLE_BY_TYPE: InjectionToken<DaffTypeRoutePair[]>;
7
- /**
8
- * A provider used to connect a type to a route to enable dynamic route resolution at runtime.
9
- */
10
- export declare function daffProvideRouteResolvableByType(typeRoutePair: DaffTypeRoutePair): Provider;
11
- /**
12
- * A multi-provider used to connect an array of types to their respective routes.
13
- */
14
- export declare function daffProvideRoutesResolvableByType(routes: DaffTypeRoutePair[]): Provider[];
@@ -1,7 +0,0 @@
1
- import { DaffExternallyResolvableUrl } from '../model/resolvable-route';
2
- import { DaffRouteInfo } from '../model/route-info';
3
- import { DaffTypeRoutePair } from '../model/type-route-pair';
4
- /**
5
- * Transforms a DaffExternallyResolvableUrl into an Angular Route.
6
- */
7
- export declare const daffTransformResolvedRouteToRoute: (resolvedRoute: DaffExternallyResolvableUrl, availableTypes: DaffTypeRoutePair[]) => DaffRouteInfo;
@@ -1,6 +0,0 @@
1
- import { ActivatedRouteSnapshot, Data } from '@angular/router';
2
- /**
3
- * Extracts a key from DaffPath data based upon the currently activated
4
- * RouteSnapshot.
5
- */
6
- export declare const daffExtractDaffPathData: <T extends Data = Data, K extends keyof T = keyof T>(snapshot: ActivatedRouteSnapshot, key: K) => T[K];