@daffodil/external-router 0.78.0 → 0.79.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 (95) 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/provider.d.ts +5 -0
  9. package/driver/magento/2.4.3/public_api.d.ts +1 -0
  10. package/driver/public_api.d.ts +1 -1
  11. package/driver/testing/config.d.ts +3 -9
  12. package/driver/testing/provider.d.ts +6 -0
  13. package/driver/testing/public_api.d.ts +1 -0
  14. package/esm2022/config.mjs +8 -7
  15. package/esm2022/driver/in-memory/config.mjs +8 -6
  16. package/esm2022/driver/in-memory/in-memory.module.mjs +8 -15
  17. package/esm2022/driver/in-memory/provider.mjs +12 -0
  18. package/esm2022/driver/in-memory/public_api.mjs +2 -1
  19. package/esm2022/driver/interfaces/external-router-driver.interface.mjs +8 -3
  20. package/esm2022/driver/magento/2.4.1/magento.module.mjs +5 -12
  21. package/esm2022/driver/magento/2.4.2/magento.module.mjs +5 -12
  22. package/esm2022/driver/magento/2.4.3/magento.module.mjs +5 -12
  23. package/esm2022/driver/magento/2.4.3/provider.mjs +13 -0
  24. package/esm2022/driver/magento/2.4.3/public_api.mjs +2 -1
  25. package/esm2022/driver/public_api.mjs +2 -2
  26. package/esm2022/driver/testing/config.mjs +8 -6
  27. package/esm2022/driver/testing/provider.mjs +12 -0
  28. package/esm2022/driver/testing/public_api.mjs +2 -1
  29. package/esm2022/driver/testing/testing.module.mjs +5 -11
  30. package/esm2022/driver/testing/testing.service.mjs +13 -11
  31. package/esm2022/model/public_api.mjs +1 -1
  32. package/esm2022/model/route-with-seo-data.mjs +1 -1
  33. package/esm2022/provide-external-router.mjs +6 -0
  34. package/esm2022/public_api.mjs +2 -10
  35. package/esm2022/routing/guard/external-matcher-type.guard.mjs +43 -0
  36. package/esm2022/routing/helper/convert-to-path.mjs +7 -0
  37. package/esm2022/routing/public_api.mjs +2 -2
  38. package/fesm2022/daffodil-external-router-driver-in-memory.mjs +22 -18
  39. package/fesm2022/daffodil-external-router-driver-in-memory.mjs.map +1 -1
  40. package/fesm2022/daffodil-external-router-driver-magento-2.4.1.mjs +4 -11
  41. package/fesm2022/daffodil-external-router-driver-magento-2.4.1.mjs.map +1 -1
  42. package/fesm2022/daffodil-external-router-driver-magento-2.4.2.mjs +4 -11
  43. package/fesm2022/daffodil-external-router-driver-magento-2.4.2.mjs.map +1 -1
  44. package/fesm2022/daffodil-external-router-driver-magento-2.4.3.mjs +14 -13
  45. package/fesm2022/daffodil-external-router-driver-magento-2.4.3.mjs.map +1 -1
  46. package/fesm2022/daffodil-external-router-driver-testing.mjs +31 -25
  47. package/fesm2022/daffodil-external-router-driver-testing.mjs.map +1 -1
  48. package/fesm2022/daffodil-external-router-driver.mjs +8 -3
  49. package/fesm2022/daffodil-external-router-driver.mjs.map +1 -1
  50. package/fesm2022/daffodil-external-router-routing.mjs +40 -66
  51. package/fesm2022/daffodil-external-router-routing.mjs.map +1 -1
  52. package/fesm2022/daffodil-external-router.mjs +10 -282
  53. package/fesm2022/daffodil-external-router.mjs.map +1 -1
  54. package/model/public_api.d.ts +2 -5
  55. package/model/route-with-seo-data.d.ts +3 -4
  56. package/package.json +1 -1
  57. package/provide-external-router.d.ts +3 -0
  58. package/public_api.d.ts +1 -9
  59. package/routing/guard/external-matcher-type.guard.d.ts +10 -0
  60. package/routing/helper/convert-to-path.d.ts +7 -0
  61. package/routing/public_api.d.ts +1 -1
  62. package/errors/no-wildcard.d.ts +0 -9
  63. package/errors/unknown-type.d.ts +0 -9
  64. package/esm2022/errors/no-wildcard.mjs +0 -12
  65. package/esm2022/errors/unknown-type.mjs +0 -12
  66. package/esm2022/external-router.module.mjs +0 -31
  67. package/esm2022/model/insertion-strategy.type.mjs +0 -2
  68. package/esm2022/model/route-info.mjs +0 -2
  69. package/esm2022/model/route-with-data-path.mjs +0 -2
  70. package/esm2022/model/route-with-type.mjs +0 -2
  71. package/esm2022/model/route-without-path.mjs +0 -2
  72. package/esm2022/model/type-route-pair.mjs +0 -2
  73. package/esm2022/router/router.service.mjs +0 -43
  74. package/esm2022/router/strategies/insert-data-path.mjs +0 -84
  75. package/esm2022/router/strategies/insert-route-before-wildcard.mjs +0 -17
  76. package/esm2022/router/url-matcher/data-path-matcher.mjs +0 -31
  77. package/esm2022/routing/guard/existence.guard.mjs +0 -77
  78. package/esm2022/token/type-resolvable-routes.token.mjs +0 -29
  79. package/esm2022/transform/resolved-route-to-route.mjs +0 -24
  80. package/esm2022/util/extract-daff-path-data.mjs +0 -9
  81. package/external-router.module.d.ts +0 -15
  82. package/model/insertion-strategy.type.d.ts +0 -8
  83. package/model/route-info.d.ts +0 -9
  84. package/model/route-with-data-path.d.ts +0 -14
  85. package/model/route-with-type.d.ts +0 -12
  86. package/model/route-without-path.d.ts +0 -7
  87. package/model/type-route-pair.d.ts +0 -26
  88. package/router/router.service.d.ts +0 -15
  89. package/router/strategies/insert-data-path.d.ts +0 -40
  90. package/router/strategies/insert-route-before-wildcard.d.ts +0 -6
  91. package/router/url-matcher/data-path-matcher.d.ts +0 -20
  92. package/routing/guard/existence.guard.d.ts +0 -22
  93. package/token/type-resolvable-routes.token.d.ts +0 -14
  94. package/transform/resolved-route-to-route.d.ts +0 -7
  95. package/util/extract-daff-path-data.d.ts +0 -6
@@ -1,295 +1,23 @@
1
- import { CommonModule } from '@angular/common';
2
- import * as i0 from '@angular/core';
3
- import { InjectionToken, NgModule, Injectable, Inject } from '@angular/core';
4
- import * as i1 from '@angular/router';
5
- import { DaffInheritableError } from '@daffodil/core';
6
- import { daffUriTruncateLeadingSlash } from '@daffodil/core/routing';
1
+ import { createConfigInjectionToken } from '@daffodil/core';
2
+ import { makeEnvironmentProviders } from '@angular/core';
7
3
 
8
4
  const daffExternalRouterConfigurationDefault = {
9
5
  failedResolutionPath: '/',
10
- notFoundResolutionPath: '/',
11
6
  };
7
+ const {
12
8
  /**
13
9
  * The token holding the runtime configuration for the behavior of the
14
10
  * `@daffodil/external-router` package.
15
11
  */
16
- const DAFF_EXTERNAL_ROUTER_CONFIG = new InjectionToken('DAFF_EXTERNAL_ROUTER_CONFIG', {
17
- providedIn: 'root',
18
- factory: () => daffExternalRouterConfigurationDefault,
19
- });
20
-
21
- /**
22
- * A multi-token that allows you to register route "types" that correspond to routes.
23
- */
24
- const DAFF_EXTERNAL_ROUTER_ROUTES_RESOLVABLE_BY_TYPE = new InjectionToken('DAFF_EXTERNAL_ROUTER_RESOLVABLE_TYPE_ROUTES', {
25
- providedIn: 'root',
26
- factory: () => [],
27
- });
28
- /**
29
- * A provider used to connect a type to a route to enable dynamic route resolution at runtime.
30
- */
31
- function daffProvideRouteResolvableByType(typeRoutePair) {
32
- return {
33
- provide: DAFF_EXTERNAL_ROUTER_ROUTES_RESOLVABLE_BY_TYPE,
34
- multi: true,
35
- useValue: typeRoutePair,
36
- };
37
- }
38
- /**
39
- * A multi-provider used to connect an array of types to their respective routes.
40
- */
41
- function daffProvideRoutesResolvableByType(routes) {
42
- return routes.map((route) => ({
43
- provide: DAFF_EXTERNAL_ROUTER_ROUTES_RESOLVABLE_BY_TYPE,
44
- multi: true,
45
- useValue: route,
46
- }));
47
- }
48
-
49
- /**
50
- * The external `DaffExternalRouterModule` allows you to configure the
51
- * `@daffodil/external-router` package's behavior.
52
- */
53
- class DaffExternalRouterModule {
54
- static forRoot(config, routes = []) {
55
- return {
56
- ngModule: DaffExternalRouterModule,
57
- providers: [
58
- { provide: DAFF_EXTERNAL_ROUTER_CONFIG, useValue: { ...daffExternalRouterConfigurationDefault, ...config } },
59
- ...daffProvideRoutesResolvableByType(routes),
60
- ],
61
- };
62
- }
63
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffExternalRouterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
64
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.2", ngImport: i0, type: DaffExternalRouterModule, imports: [CommonModule] }); }
65
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffExternalRouterModule, imports: [CommonModule] }); }
66
- }
67
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffExternalRouterModule, decorators: [{
68
- type: NgModule,
69
- args: [{
70
- declarations: [],
71
- imports: [CommonModule],
72
- }]
73
- }] });
74
-
12
+ token: DAFF_EXTERNAL_ROUTER_CONFIG,
75
13
  /**
76
- * An error thrown when there was no wildcard route found in configuration
77
- * of the Angular Router.
14
+ * Provider function for {@link DAFF_EXTERNAL_ROUTER_CONFIG}.
78
15
  */
79
- class DaffExternalRouterNoWildcardError extends DaffInheritableError {
80
- constructor(message) {
81
- super(message);
82
- this.code = 'NO_WILDCARD_ROUTE';
83
- }
84
- }
16
+ provider: provideDaffExternalRouterConfig, } = createConfigInjectionToken(daffExternalRouterConfigurationDefault, 'DAFF_EXTERNAL_ROUTER_CONFIG');
85
17
 
86
- /**
87
- * Inserts a Route into Routes right before the wildcard route.
88
- * If no wildcard is found, it fails fast with a `DaffExternalRouterNoWildcardError`.
89
- */
90
- const daffInsertRouteBeforeWildCardStrategy = (route, routes) => {
91
- const index = routes.findIndex((r) => r.path === '**');
92
- if (index === -1) {
93
- throw new DaffExternalRouterNoWildcardError('No wildcard (**) route was found during route resolution.');
94
- }
95
- return [
96
- ...routes.slice(0, index),
97
- route,
98
- ...routes.slice(index),
99
- ];
100
- };
101
-
102
- /**
103
- * An error thrown when there is a failure matching a configured route to a
104
- * route type.
105
- */
106
- class DaffExternalRouterUnknownRouteTypeError extends DaffInheritableError {
107
- constructor(message) {
108
- super(message);
109
- this.code = 'UNKNOWN_ROUTE_TYPE';
110
- }
111
- }
112
-
113
- /**
114
- * Transforms a DaffExternallyResolvableUrl into an Angular Route.
115
- */
116
- const daffTransformResolvedRouteToRoute = (resolvedRoute, availableTypes) => {
117
- const routeType = availableTypes
118
- .filter(t => t.type === resolvedRoute.type)
119
- .shift();
120
- if (!routeType) {
121
- throw new DaffExternalRouterUnknownRouteTypeError(`Unable to resolve the route '${resolvedRoute.url}'. Its type is '${resolvedRoute.type}' but a matching route wasn't found.`);
122
- }
123
- return {
124
- route: {
125
- path: resolvedRoute.url,
126
- daffExternalRouteType: resolvedRoute.type,
127
- ...routeType.route,
128
- data: {
129
- ...resolvedRoute.data,
130
- },
131
- },
132
- insertionStrategy: routeType.insertionStrategy,
133
- };
134
- };
135
-
136
- class DaffExternalRouter {
137
- constructor(router, runtimeRoutes) {
138
- this.router = router;
139
- this.runtimeRoutes = runtimeRoutes;
140
- }
141
- /**
142
- * Adds a route to the existing router configuration.
143
- */
144
- add(resolvedRoute) {
145
- //Get the route.
146
- const { route, insertionStrategy, } = daffTransformResolvedRouteToRoute(resolvedRoute, this.runtimeRoutes);
147
- try {
148
- //Add it to configuration.
149
- this.router.config = (insertionStrategy || daffInsertRouteBeforeWildCardStrategy)(route, this.router.config);
150
- }
151
- catch (e) {
152
- if (e instanceof DaffExternalRouterNoWildcardError) {
153
- throw new DaffExternalRouterNoWildcardError(`${e.message} This usually means you have misconfigured your routes.`);
154
- }
155
- throw e;
156
- }
157
- }
158
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffExternalRouter, deps: [{ token: i1.Router }, { token: DAFF_EXTERNAL_ROUTER_ROUTES_RESOLVABLE_BY_TYPE }], target: i0.ɵɵFactoryTarget.Injectable }); }
159
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffExternalRouter, providedIn: 'root' }); }
160
- }
161
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffExternalRouter, decorators: [{
162
- type: Injectable,
163
- args: [{
164
- providedIn: 'root',
165
- }]
166
- }], ctorParameters: () => [{ type: i1.Router }, { type: undefined, decorators: [{
167
- type: Inject,
168
- args: [DAFF_EXTERNAL_ROUTER_ROUTES_RESOLVABLE_BY_TYPE]
169
- }] }] });
170
-
171
- /**
172
- * Tests whether or not a route matches a specific Daffodil Route type.
173
- *
174
- * See {@link DaffRouteWithDataPath}
175
- */
176
- const routeMatchesRouteType = (route, type) => route?.data?.daffExternalRouteType === type;
177
- /**
178
- * Adds a path to the `daffPaths` of the given route.
179
- *
180
- * See {@link DaffRouteWithDataPath}
181
- */
182
- const addRouteToDaffPaths = (route, externalRoute) => {
183
- route.data.daffPaths = {
184
- ...route.data.daffPaths,
185
- [externalRoute.path]: externalRoute.data,
186
- };
187
- return route;
188
- };
189
- const operateOnRoute = (externalRoute) => (route) => addRouteToDaffPaths(route, externalRoute);
190
- /**
191
- * Traverse the router config tree, halting after the first match.
192
- * This traversal is implemented in a pre-order manner. As such, for large
193
- * configuration trees, it will be most efficient to place externally routed
194
- * components at the top of router configuration.
195
- */
196
- const traverseRouteTree = (routes = [], matcher, operate) => {
197
- if (routes.length === 0) {
198
- return routes;
199
- }
200
- const stack = [];
201
- const treeRoot = { children: routes };
202
- stack.push(treeRoot);
203
- while (stack.length) {
204
- const route = stack.pop();
205
- if (matcher(route)) {
206
- operate(route);
207
- break;
208
- }
209
- if (route.children) {
210
- stack.push(...route.children.reverse());
211
- }
212
- }
213
- return routes;
214
- };
215
- /**
216
- * A route insertion strategy that can be used to append external routes onto
217
- * existing Angular routes. This can be useful when you need to route to
218
- * an existing lazy-loaded module from multiple externally defined urls.
219
- *
220
- * This should be used in combination with the {@link daffDataPathUrlMatcher} to match lazy-loaded modules with
221
- * associated external urls.
222
- *
223
- * For example, you can provide the insertion strategy in the {@link DaffExternalRouterModule} as below.
224
- *
225
- * ```ts
226
- * DaffExternalRouterModule.forRoot({}, [
227
- * {
228
- * type: 'CATEGORY',
229
- * insertionStrategy: daffInsertDataPathStrategy,
230
- * route: {}
231
- * }
232
- * ],
233
- * ```
234
- *
235
- * Then, you can match it with an associated route defined in your Routing
236
- * configuration with the {@link daffDataPathUrlMatcher}.
237
- *
238
- * ```ts
239
- * export const routes: Routes = [
240
- * {
241
- * matcher: daffDataPathUrlMatcher,
242
- * data: {
243
- * daffExternalRouteType: "CATEGORY",
244
- * },
245
- * loadChildren: () => import('./category/category.module').then((m) => m.MyCategoryModule),
246
- * }
247
- * ]
248
- * ```
249
- *
250
- * See {@link DaffRouteWithDataPath}
251
- *
252
- */
253
- const daffInsertDataPathStrategy = (externalRoute, routes) => traverseRouteTree(routes, (route) => routeMatchesRouteType(route, externalRoute.daffExternalRouteType), operateOnRoute(externalRoute));
254
-
255
- /**
256
- * A UrlMatcher that does an exact match against a path stored in the special
257
- * configuration fields that External Router stores on a Route's data.
258
- *
259
- * ```ts
260
- * export const routes: Routes = [
261
- * {
262
- * matcher: daffDataPathUrlMatcher,
263
- * data: {
264
- * daffExternalRouteType: "CATEGORY",
265
- * },
266
- * loadChildren: () => import('./category/category.module').then((m) => m.ShopCategoryModule),
267
- * }
268
- * ]
269
- * ```
270
- * {@link daffInsertDataPathStrategy }
271
- * {@link DaffRouteWithDataPath }
272
- */
273
- const daffDataPathUrlMatcher = (segments, group, route) => {
274
- const path = daffUriTruncateLeadingSlash(segments.reduce((acc, segment) => acc + '/' + segment.path, ''));
275
- const paths = route?.data?.daffPaths;
276
- // If we don't have any paths, we can safely fail a match.
277
- if (!paths) {
278
- return null;
279
- }
280
- // Otherwise, look up the path in the dictionary, failing if a match isn't found,
281
- // but matching the entire segment if a match is found.
282
- return path in paths ? { consumed: segments } : null;
283
- };
284
-
285
- /**
286
- * Extracts a key from DaffPath data based upon the currently activated
287
- * RouteSnapshot.
288
- */
289
- const daffExtractDaffPathData = (snapshot, key) => {
290
- const pathFromRoot = snapshot.pathFromRoot.flatMap((route) => route.url).map((seg) => seg.path).join('/');
291
- return snapshot.data?.daffPaths?.[pathFromRoot]?.[key] ?? null;
292
- };
18
+ const provideExternalRouter = (config = {}) => makeEnvironmentProviders([
19
+ provideDaffExternalRouterConfig(config),
20
+ ]);
293
21
 
294
22
  /*
295
23
  * Public API Surface of @daffodil/external-router
@@ -299,5 +27,5 @@ const daffExtractDaffPathData = (snapshot, key) => {
299
27
  * Generated bundle index. Do not edit.
300
28
  */
301
29
 
302
- export { DAFF_EXTERNAL_ROUTER_CONFIG, DaffExternalRouter, DaffExternalRouterModule, DaffExternalRouterNoWildcardError, DaffExternalRouterUnknownRouteTypeError, daffDataPathUrlMatcher, daffExtractDaffPathData, daffInsertDataPathStrategy, daffInsertRouteBeforeWildCardStrategy, daffProvideRouteResolvableByType };
30
+ export { DAFF_EXTERNAL_ROUTER_CONFIG, provideExternalRouter };
303
31
  //# sourceMappingURL=daffodil-external-router.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-external-router.mjs","sources":["../../../libs/external-router/src/config.ts","../../../libs/external-router/src/token/type-resolvable-routes.token.ts","../../../libs/external-router/src/external-router.module.ts","../../../libs/external-router/src/errors/no-wildcard.ts","../../../libs/external-router/src/router/strategies/insert-route-before-wildcard.ts","../../../libs/external-router/src/errors/unknown-type.ts","../../../libs/external-router/src/transform/resolved-route-to-route.ts","../../../libs/external-router/src/router/router.service.ts","../../../libs/external-router/src/router/strategies/insert-data-path.ts","../../../libs/external-router/src/router/url-matcher/data-path-matcher.ts","../../../libs/external-router/src/util/extract-daff-path-data.ts","../../../libs/external-router/src/public_api.ts","../../../libs/external-router/src/daffodil-external-router.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport const daffExternalRouterConfigurationDefault: DaffExternalRouterConfiguration = {\n failedResolutionPath: '/',\n notFoundResolutionPath: '/',\n};\n\n/**\n * The token holding the runtime configuration for the behavior of the\n * `@daffodil/external-router` package.\n */\nexport const DAFF_EXTERNAL_ROUTER_CONFIG = new InjectionToken<\n DaffExternalRouterConfiguration\n>('DAFF_EXTERNAL_ROUTER_CONFIG', {\n providedIn: 'root',\n factory: () => daffExternalRouterConfigurationDefault,\n});\n\n/**\n * The configuration object for the external router package.\n */\nexport interface DaffExternalRouterConfiguration {\n /**\n * The path to redirect to when external route resolution fails.\n */\n failedResolutionPath: string;\n\n /**\n * The path to redirect to when the requested URL is not found.\n */\n notFoundResolutionPath: string;\n}\n","import {\n InjectionToken,\n Provider,\n} from '@angular/core';\n\nimport { DaffExternalRouterInsertionStrategy } from '../model/insertion-strategy.type';\nimport { DaffExternalRouteType } from '../model/route-type';\nimport { DaffRouteWithoutPath } from '../model/route-without-path';\nimport { DaffTypeRoutePair } from '../model/type-route-pair';\n\n/**\n * A multi-token that allows you to register route \"types\" that correspond to routes.\n */\nexport const DAFF_EXTERNAL_ROUTER_ROUTES_RESOLVABLE_BY_TYPE = new InjectionToken<\n DaffTypeRoutePair[]\n>('DAFF_EXTERNAL_ROUTER_RESOLVABLE_TYPE_ROUTES', {\n providedIn: 'root',\n factory: () => [],\n});\n\n/**\n * A provider used to connect a type to a route to enable dynamic route resolution at runtime.\n */\nexport function daffProvideRouteResolvableByType(typeRoutePair: DaffTypeRoutePair): Provider {\n return {\n provide: DAFF_EXTERNAL_ROUTER_ROUTES_RESOLVABLE_BY_TYPE,\n multi: true,\n useValue: typeRoutePair,\n };\n}\n\n/**\n * A multi-provider used to connect an array of types to their respective routes.\n */\nexport function daffProvideRoutesResolvableByType(routes: DaffTypeRoutePair[]): Provider[] {\n return routes.map((route: DaffTypeRoutePair) => ({\n provide: DAFF_EXTERNAL_ROUTER_ROUTES_RESOLVABLE_BY_TYPE,\n multi: true,\n useValue: route,\n }));\n}\n","import { CommonModule } from '@angular/common';\nimport {\n ModuleWithProviders,\n NgModule,\n} from '@angular/core';\n\nimport {\n DaffExternalRouterConfiguration,\n DAFF_EXTERNAL_ROUTER_CONFIG,\n daffExternalRouterConfigurationDefault,\n} from './config';\nimport { DaffTypeRoutePair } from './model/type-route-pair';\nimport { daffProvideRoutesResolvableByType } from './token/type-resolvable-routes.token';\n\n/**\n * The external `DaffExternalRouterModule` allows you to configure the\n * `@daffodil/external-router` package's behavior.\n */\n@NgModule({\n declarations: [],\n imports: [CommonModule],\n})\nexport class DaffExternalRouterModule {\n static forRoot(\n config: Partial<DaffExternalRouterConfiguration>,\n routes: DaffTypeRoutePair[] = [],\n ): ModuleWithProviders<DaffExternalRouterModule> {\n return {\n ngModule: DaffExternalRouterModule,\n providers: [\n { provide: DAFF_EXTERNAL_ROUTER_CONFIG, useValue: { ...daffExternalRouterConfigurationDefault, ...config }},\n ...daffProvideRoutesResolvableByType(routes),\n ],\n };\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\n/**\n * An error thrown when there was no wildcard route found in configuration\n * of the Angular Router.\n */\nexport class DaffExternalRouterNoWildcardError extends DaffInheritableError\n implements DaffError {\n public readonly code: string = 'NO_WILDCARD_ROUTE';\n\n constructor(message?: string) {\n super(message);\n }\n}\n","import {\n Route,\n Routes,\n} from '@angular/router';\n\nimport { DaffExternalRouterNoWildcardError } from '../../errors/no-wildcard';\nimport { DaffExternalRouterInsertionStrategy } from '../../model/insertion-strategy.type';\n\n/**\n * Inserts a Route into Routes right before the wildcard route.\n * If no wildcard is found, it fails fast with a `DaffExternalRouterNoWildcardError`.\n */\nexport const daffInsertRouteBeforeWildCardStrategy: DaffExternalRouterInsertionStrategy = (\n route: Route,\n routes: Routes,\n): Routes => {\n const index = routes.findIndex((r: Route) => r.path === '**');\n if (index === -1) {\n throw new DaffExternalRouterNoWildcardError(\n 'No wildcard (**) route was found during route resolution.',\n );\n }\n return [\n ...routes.slice(0, index),\n route,\n ...routes.slice(index),\n ];\n};\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\n/**\n * An error thrown when there is a failure matching a configured route to a\n * route type.\n */\nexport class DaffExternalRouterUnknownRouteTypeError extends DaffInheritableError\n implements DaffError {\n public readonly code: string = 'UNKNOWN_ROUTE_TYPE';\n\n constructor(message?: string) {\n super(message);\n }\n}\n","import { DaffExternalRouterUnknownRouteTypeError } from '../errors/unknown-type';\nimport { DaffExternallyResolvableUrl } from '../model/resolvable-route';\nimport { DaffRouteInfo } from '../model/route-info';\nimport { DaffTypeRoutePair } from '../model/type-route-pair';\n\n/**\n * Transforms a DaffExternallyResolvableUrl into an Angular Route.\n */\nexport const daffTransformResolvedRouteToRoute = (\n resolvedRoute: DaffExternallyResolvableUrl,\n availableTypes: DaffTypeRoutePair[],\n): DaffRouteInfo => {\n const routeType = availableTypes\n .filter(t => t.type === resolvedRoute.type)\n .shift();\n if (!routeType) {\n throw new DaffExternalRouterUnknownRouteTypeError(\n `Unable to resolve the route '${resolvedRoute.url}'. Its type is '${resolvedRoute.type}' but a matching route wasn't found.`,\n );\n }\n\n return {\n route: {\n path: resolvedRoute.url,\n daffExternalRouteType: resolvedRoute.type,\n ...routeType.route,\n data: {\n ...resolvedRoute.data,\n },\n },\n insertionStrategy: routeType.insertionStrategy,\n };\n};\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\nimport {\n Router,\n Route,\n} from '@angular/router';\n\n\nimport { daffInsertRouteBeforeWildCardStrategy } from './strategies/insert-route-before-wildcard';\nimport { DaffExternalRouterNoWildcardError } from '../errors/no-wildcard';\nimport { DaffExternallyResolvableUrl } from '../model/resolvable-route';\nimport { DaffTypeRoutePair } from '../model/type-route-pair';\nimport { DAFF_EXTERNAL_ROUTER_ROUTES_RESOLVABLE_BY_TYPE } from '../token/type-resolvable-routes.token';\nimport { daffTransformResolvedRouteToRoute } from '../transform/resolved-route-to-route';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffExternalRouter {\n constructor(\n private router: Router,\n @Inject(DAFF_EXTERNAL_ROUTER_ROUTES_RESOLVABLE_BY_TYPE)\n private runtimeRoutes: DaffTypeRoutePair[],\n ) { }\n\n /**\n * Adds a route to the existing router configuration.\n */\n add(resolvedRoute: DaffExternallyResolvableUrl) {\n //Get the route.\n const {\n route,\n insertionStrategy,\n } = daffTransformResolvedRouteToRoute(\n resolvedRoute,\n this.runtimeRoutes,\n );\n\n try {\n //Add it to configuration.\n this.router.config = (insertionStrategy || daffInsertRouteBeforeWildCardStrategy)(route, this.router.config);\n } catch (e) {\n if (e instanceof DaffExternalRouterNoWildcardError) {\n throw new DaffExternalRouterNoWildcardError(\n `${e.message} This usually means you have misconfigured your routes.`,\n );\n }\n\n throw e;\n }\n }\n}\n","import {\n Route,\n Routes,\n} from '@angular/router';\n\nimport { DaffExternalRouterInsertionStrategy } from '../../model/insertion-strategy.type';\nimport { DaffExternalRouteType } from '../../model/route-type';\nimport { DaffRouteWithDataPath } from '../../model/route-with-data-path';\nimport { DaffRouteWithSeoData } from '../../model/route-with-seo-data';\nimport { DaffRouteWithType } from '../../model/route-with-type';\n\ntype RouteOperator = (route: Route) => Route;\ntype ExternalRouteOperator = (route: DaffRouteWithDataPath, externalRoute: Route) => Route;\ntype InsertionOperatorFactory = (externalRoute: Route) => RouteOperator;\n\n/**\n * Tests whether or not a route matches a specific Daffodil Route type.\n *\n * See {@link DaffRouteWithDataPath}\n */\nconst routeMatchesRouteType = (route: Route, type: DaffExternalRouteType): boolean => route?.data?.daffExternalRouteType === type;\n\n/**\n * Adds a path to the `daffPaths` of the given route.\n *\n * See {@link DaffRouteWithDataPath}\n */\nconst addRouteToDaffPaths: ExternalRouteOperator =\n (route: DaffRouteWithDataPath, externalRoute: Route) => {\n route.data.daffPaths = {\n ...route.data.daffPaths,\n [externalRoute.path]: externalRoute.data,\n };\n return route;\n };\n\nconst operateOnRoute: InsertionOperatorFactory =\n (externalRoute: Route) => (route: DaffRouteWithDataPath) => addRouteToDaffPaths(route, externalRoute);\n\n/**\n * Traverse the router config tree, halting after the first match.\n * This traversal is implemented in a pre-order manner. As such, for large\n * configuration trees, it will be most efficient to place externally routed\n * components at the top of router configuration.\n */\nconst traverseRouteTree = (routes: Routes = [], matcher: (route: Route) => boolean, operate: RouteOperator): Routes => {\n if(routes.length === 0) {\n return routes;\n }\n\n const stack: Routes = [];\n const treeRoot = { children: routes };\n stack.push(treeRoot);\n\n while(stack.length) {\n const route = stack.pop();\n if(matcher(route)) {\n operate(route);\n break;\n }\n if(route.children){\n stack.push(...route.children.reverse());\n }\n }\n return routes;\n};\n\n/**\n * A route insertion strategy that can be used to append external routes onto\n * existing Angular routes. This can be useful when you need to route to\n * an existing lazy-loaded module from multiple externally defined urls.\n *\n * This should be used in combination with the {@link daffDataPathUrlMatcher} to match lazy-loaded modules with\n * associated external urls.\n *\n * For example, you can provide the insertion strategy in the {@link DaffExternalRouterModule} as below.\n *\n * ```ts\n * DaffExternalRouterModule.forRoot({}, [\n * {\n * type: 'CATEGORY',\n * insertionStrategy: daffInsertDataPathStrategy,\n * route: {}\n * }\n * ],\n * ```\n *\n * Then, you can match it with an associated route defined in your Routing\n * configuration with the {@link daffDataPathUrlMatcher}.\n *\n * ```ts\n * export const routes: Routes = [\n * {\n * matcher: daffDataPathUrlMatcher,\n * data: {\n * daffExternalRouteType: \"CATEGORY\",\n * },\n * loadChildren: () => import('./category/category.module').then((m) => m.MyCategoryModule),\n * }\n * ]\n * ```\n *\n * See {@link DaffRouteWithDataPath}\n *\n */\nexport const daffInsertDataPathStrategy: DaffExternalRouterInsertionStrategy = (externalRoute: DaffRouteWithType & DaffRouteWithSeoData, routes: Routes) => traverseRouteTree(\n routes,\n (route) => routeMatchesRouteType(route, externalRoute.daffExternalRouteType),\n operateOnRoute(externalRoute),\n);\n","import {\n UrlMatcher,\n UrlSegment,\n UrlSegmentGroup,\n} from '@angular/router';\n\nimport { daffUriTruncateLeadingSlash } from '@daffodil/core/routing';\n\nimport { DaffRouteWithDataPath } from '../../model/public_api';\n\n/**\n * A UrlMatcher that does an exact match against a path stored in the special\n * configuration fields that External Router stores on a Route's data.\n *\n * ```ts\n * export const routes: Routes = [\n * {\n * matcher: daffDataPathUrlMatcher,\n * data: {\n * daffExternalRouteType: \"CATEGORY\",\n * },\n * loadChildren: () => import('./category/category.module').then((m) => m.ShopCategoryModule),\n * }\n * ]\n * ```\n * {@link daffInsertDataPathStrategy }\n * {@link DaffRouteWithDataPath }\n */\nexport const daffDataPathUrlMatcher: UrlMatcher = (segments: UrlSegment[], group: UrlSegmentGroup, route: DaffRouteWithDataPath) => {\n const path = daffUriTruncateLeadingSlash(segments.reduce((acc: string, segment) => acc + '/' + segment.path, ''));\n const paths = route?.data?.daffPaths;\n\n // If we don't have any paths, we can safely fail a match.\n if(!paths) {\n return null;\n }\n\n // Otherwise, look up the path in the dictionary, failing if a match isn't found,\n // but matching the entire segment if a match is found.\n return path in paths ? { consumed: segments } : null;\n};\n\n","import {\n ActivatedRouteSnapshot,\n Data,\n} from '@angular/router';\n\n/**\n * Extracts a key from DaffPath data based upon the currently activated\n * RouteSnapshot.\n */\nexport const daffExtractDaffPathData = <T extends Data = Data, K extends keyof T = keyof T>(snapshot: ActivatedRouteSnapshot, key: K): T[K] => {\n const pathFromRoot = snapshot.pathFromRoot.flatMap((route) => route.url).map((seg) => seg.path).join('/');\n return snapshot.data?.daffPaths?.[pathFromRoot]?.[key] ?? null;\n};\n","/*\n * Public API Surface of @daffodil/external-router\n */\n\nexport { DaffExternalRouterModule } from './external-router.module';\n\nexport {\n DAFF_EXTERNAL_ROUTER_CONFIG,\n DaffExternalRouterConfiguration,\n} from './config';\n\nexport { daffProvideRouteResolvableByType } from './token/type-resolvable-routes.token';\n\nexport * from './model/public_api';\n\nexport { DaffExternalRouter } from './router/router.service';\nexport { daffInsertRouteBeforeWildCardStrategy } from './router/strategies/insert-route-before-wildcard';\n\nexport { daffInsertDataPathStrategy } from './router/strategies/insert-data-path';\nexport { daffDataPathUrlMatcher } from './router/url-matcher/data-path-matcher';\n\nexport { DaffExternalRouterNoWildcardError } from './errors/no-wildcard';\nexport { DaffExternalRouterUnknownRouteTypeError } from './errors/unknown-type';\n\nexport { daffExtractDaffPathData } from './util/extract-daff-path-data';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAEO,MAAM,sCAAsC,GAAoC;AACrF,IAAA,oBAAoB,EAAE,GAAG;AACzB,IAAA,sBAAsB,EAAE,GAAG;CAC5B,CAAC;AAEF;;;AAGG;MACU,2BAA2B,GAAG,IAAI,cAAc,CAE3D,6BAA6B,EAAE;AAC/B,IAAA,UAAU,EAAE,MAAM;AAClB,IAAA,OAAO,EAAE,MAAM,sCAAsC;AACtD,CAAA;;ACND;;AAEG;AACI,MAAM,8CAA8C,GAAG,IAAI,cAAc,CAE9E,6CAA6C,EAAE;AAC/C,IAAA,UAAU,EAAE,MAAM;AAClB,IAAA,OAAO,EAAE,MAAM,EAAE;AAClB,CAAA,CAAC,CAAC;AAEH;;AAEG;AACG,SAAU,gCAAgC,CAAC,aAAgC,EAAA;IAC/E,OAAO;AACL,QAAA,OAAO,EAAE,8CAA8C;AACvD,QAAA,KAAK,EAAE,IAAI;AACX,QAAA,QAAQ,EAAE,aAAa;KACxB,CAAC;AACJ,CAAC;AAED;;AAEG;AACG,SAAU,iCAAiC,CAAC,MAA2B,EAAA;IAC3E,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,KAAwB,MAAM;AAC/C,QAAA,OAAO,EAAE,8CAA8C;AACvD,QAAA,KAAK,EAAE,IAAI;AACX,QAAA,QAAQ,EAAE,KAAK;AAChB,KAAA,CAAC,CAAC,CAAC;AACN;;AC1BA;;;AAGG;MAKU,wBAAwB,CAAA;AACnC,IAAA,OAAO,OAAO,CACZ,MAAgD,EAChD,SAA8B,EAAE,EAAA;QAEhC,OAAO;AACL,YAAA,QAAQ,EAAE,wBAAwB;AAClC,YAAA,SAAS,EAAE;AACT,gBAAA,EAAE,OAAO,EAAE,2BAA2B,EAAE,QAAQ,EA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router/src/config.ts","../../../libs/external-router/src/provide-external-router.ts","../../../libs/external-router/src/public_api.ts","../../../libs/external-router/src/daffodil-external-router.ts"],"sourcesContent":["import { createConfigInjectionToken } from '@daffodil/core';\n\nexport const daffExternalRouterConfigurationDefault: DaffExternalRouterConfiguration = {\n failedResolutionPath: '/',\n};\n\nexport const {\n /**\n * The token holding the runtime configuration for the behavior of the\n * `@daffodil/external-router` package.\n */\n token: DAFF_EXTERNAL_ROUTER_CONFIG,\n /**\n * Provider function for {@link DAFF_EXTERNAL_ROUTER_CONFIG}.\n */\n provider: provideDaffExternalRouterConfig,\n} = createConfigInjectionToken<DaffExternalRouterConfiguration>(daffExternalRouterConfigurationDefault, 'DAFF_EXTERNAL_ROUTER_CONFIG');\n\n/**\n * The configuration object for the external router package.\n */\nexport interface DaffExternalRouterConfiguration {\n /**\n * The path to redirect to when external route resolution fails.\n */\n failedResolutionPath: string;\n}\n","import {\n EnvironmentProviders,\n makeEnvironmentProviders,\n} from '@angular/core';\n\nimport {\n DaffExternalRouterConfiguration,\n provideDaffExternalRouterConfig,\n} from './config';\n\nexport const provideExternalRouter = (config: Partial<DaffExternalRouterConfiguration> = {}): EnvironmentProviders => makeEnvironmentProviders([\n provideDaffExternalRouterConfig(config),\n]);\n","/*\n * Public API Surface of @daffodil/external-router\n */\n\nexport {\n DAFF_EXTERNAL_ROUTER_CONFIG,\n DaffExternalRouterConfiguration,\n} from './config';\n\nexport * from './model/public_api';\n\nexport { provideExternalRouter } from './provide-external-router';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEO,MAAM,sCAAsC,GAAoC;AACrF,IAAA,oBAAoB,EAAE,GAAG;CAC1B,CAAC;AAEW,MAAA;AACX;;;AAGG;AACH,KAAK,EAAE,2BAA2B;AAClC;;AAEG;AACH,QAAQ,EAAE,+BAA+B,GAC1C,GAAG,0BAA0B,CAAkC,sCAAsC,EAAE,6BAA6B;;ACNxH,MAAA,qBAAqB,GAAG,CAAC,MAAmD,GAAA,EAAE,KAA2B,wBAAwB,CAAC;IAC7I,+BAA+B,CAAC,MAAM,CAAC;AACxC,CAAA;;ACZD;;AAEG;;ACFH;;AAEG;;;;"}
@@ -1,7 +1,4 @@
1
- export { DaffExternalRouterInsertionStrategy } from './insertion-strategy.type';
2
1
  export { DaffExternallyResolvableUrl } from './resolvable-route';
3
- export { DaffRouteInfo } from './route-info';
2
+ export { DaffRouteData } from './route-data';
4
3
  export { DaffExternalRouteType } from './route-type';
5
- export { DaffRouteWithoutPath } from './route-without-path';
6
- export { DaffTypeRoutePair } from './type-route-pair';
7
- export { DaffRouteWithDataPath } from './route-with-data-path';
4
+ export { DaffRouteWithSeoData } from './route-with-seo-data';
@@ -3,10 +3,9 @@ import { DaffRouteData } from './route-data';
3
3
  /**
4
4
  * A type that describes the special data that Daffodil will store for SEO purposes on
5
5
  * an external resolved route.
6
- *
7
- * {@link daffDataPathUrlMatcher}
8
- * {@link daffInsertDataPathStrategy}
9
6
  */
10
7
  export type DaffRouteWithSeoData = Route & {
11
- data: DaffRouteData;
8
+ data: Record<string, any> & {
9
+ daffSeoData: DaffRouteData;
10
+ };
12
11
  };
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@daffodil/external-router","nx":{"targets":{"build":{"outputs":["{workspaceRoot}/dist/external-router"]}}},"version":"0.78.0","description":"A platform-agnostic package that connects the @angular/router with an external routing service (e.g. an API), allowing for runtime route resolution.","repository":{"type":"git","url":"https://github.com/graycoreio/daffodil"},"author":"Graycore LLC","license":"MIT","bugs":{"url":"https://github.com/graycoreio/daffodil/issues"},"homepage":"https://github.com/graycoreio/daffodil","peerDependencies":{"@angular/common":"^18.2.2","@angular/core":"^18.2.2","@angular/router":"^18.2.2","@daffodil/core":"0.78.0","rxjs":"7.8.1"},"optionalDependencies":{"apollo-angular":"^7.1.2","@daffodil/driver":"0.78.0"},"module":"fesm2022/daffodil-external-router.mjs","typings":"index.d.ts","exports":{"./package.json":{"default":"./package.json"},".":{"types":"./index.d.ts","esm2022":"./esm2022/daffodil-external-router.mjs","esm":"./esm2022/daffodil-external-router.mjs","default":"./fesm2022/daffodil-external-router.mjs"},"./driver":{"types":"./driver/index.d.ts","esm2022":"./esm2022/driver/daffodil-external-router-driver.mjs","esm":"./esm2022/driver/daffodil-external-router-driver.mjs","default":"./fesm2022/daffodil-external-router-driver.mjs"},"./routing":{"types":"./routing/index.d.ts","esm2022":"./esm2022/routing/daffodil-external-router-routing.mjs","esm":"./esm2022/routing/daffodil-external-router-routing.mjs","default":"./fesm2022/daffodil-external-router-routing.mjs"},"./driver/in-memory":{"types":"./driver/in-memory/index.d.ts","esm2022":"./esm2022/driver/in-memory/daffodil-external-router-driver-in-memory.mjs","esm":"./esm2022/driver/in-memory/daffodil-external-router-driver-in-memory.mjs","default":"./fesm2022/daffodil-external-router-driver-in-memory.mjs"},"./driver/magento":{"types":"./driver/magento/index.d.ts","esm2022":"./esm2022/driver/magento/daffodil-external-router-driver-magento.mjs","esm":"./esm2022/driver/magento/daffodil-external-router-driver-magento.mjs","default":"./fesm2022/daffodil-external-router-driver-magento.mjs"},"./driver/testing":{"types":"./driver/testing/index.d.ts","esm2022":"./esm2022/driver/testing/daffodil-external-router-driver-testing.mjs","esm":"./esm2022/driver/testing/daffodil-external-router-driver-testing.mjs","default":"./fesm2022/daffodil-external-router-driver-testing.mjs"},"./driver/magento/2.4.1":{"types":"./driver/magento/2.4.1/index.d.ts","esm2022":"./esm2022/driver/magento/2.4.1/daffodil-external-router-driver-magento-2.4.1.mjs","esm":"./esm2022/driver/magento/2.4.1/daffodil-external-router-driver-magento-2.4.1.mjs","default":"./fesm2022/daffodil-external-router-driver-magento-2.4.1.mjs"},"./driver/magento/2.4.2":{"types":"./driver/magento/2.4.2/index.d.ts","esm2022":"./esm2022/driver/magento/2.4.2/daffodil-external-router-driver-magento-2.4.2.mjs","esm":"./esm2022/driver/magento/2.4.2/daffodil-external-router-driver-magento-2.4.2.mjs","default":"./fesm2022/daffodil-external-router-driver-magento-2.4.2.mjs"},"./driver/magento/2.4.3":{"types":"./driver/magento/2.4.3/index.d.ts","esm2022":"./esm2022/driver/magento/2.4.3/daffodil-external-router-driver-magento-2.4.3.mjs","esm":"./esm2022/driver/magento/2.4.3/daffodil-external-router-driver-magento-2.4.3.mjs","default":"./fesm2022/daffodil-external-router-driver-magento-2.4.3.mjs"}},"sideEffects":false,"dependencies":{"tslib":"^2.3.0"}}
1
+ {"name":"@daffodil/external-router","nx":{"targets":{"build":{"outputs":["{workspaceRoot}/dist/external-router"]}}},"version":"0.79.0","description":"A platform-agnostic package that connects the @angular/router with an external routing service (e.g. an API), allowing for runtime route resolution.","repository":{"type":"git","url":"https://github.com/graycoreio/daffodil"},"author":"Graycore LLC","license":"MIT","bugs":{"url":"https://github.com/graycoreio/daffodil/issues"},"homepage":"https://github.com/graycoreio/daffodil","peerDependencies":{"@angular/common":"^18.2.2","@angular/core":"^18.2.2","@angular/router":"^18.2.2","@daffodil/core":"0.79.0","rxjs":"7.8.1"},"optionalDependencies":{"apollo-angular":"^7.1.2","@daffodil/driver":"0.79.0"},"module":"fesm2022/daffodil-external-router.mjs","typings":"index.d.ts","exports":{"./package.json":{"default":"./package.json"},".":{"types":"./index.d.ts","esm2022":"./esm2022/daffodil-external-router.mjs","esm":"./esm2022/daffodil-external-router.mjs","default":"./fesm2022/daffodil-external-router.mjs"},"./driver":{"types":"./driver/index.d.ts","esm2022":"./esm2022/driver/daffodil-external-router-driver.mjs","esm":"./esm2022/driver/daffodil-external-router-driver.mjs","default":"./fesm2022/daffodil-external-router-driver.mjs"},"./routing":{"types":"./routing/index.d.ts","esm2022":"./esm2022/routing/daffodil-external-router-routing.mjs","esm":"./esm2022/routing/daffodil-external-router-routing.mjs","default":"./fesm2022/daffodil-external-router-routing.mjs"},"./driver/in-memory":{"types":"./driver/in-memory/index.d.ts","esm2022":"./esm2022/driver/in-memory/daffodil-external-router-driver-in-memory.mjs","esm":"./esm2022/driver/in-memory/daffodil-external-router-driver-in-memory.mjs","default":"./fesm2022/daffodil-external-router-driver-in-memory.mjs"},"./driver/magento":{"types":"./driver/magento/index.d.ts","esm2022":"./esm2022/driver/magento/daffodil-external-router-driver-magento.mjs","esm":"./esm2022/driver/magento/daffodil-external-router-driver-magento.mjs","default":"./fesm2022/daffodil-external-router-driver-magento.mjs"},"./driver/testing":{"types":"./driver/testing/index.d.ts","esm2022":"./esm2022/driver/testing/daffodil-external-router-driver-testing.mjs","esm":"./esm2022/driver/testing/daffodil-external-router-driver-testing.mjs","default":"./fesm2022/daffodil-external-router-driver-testing.mjs"},"./driver/magento/2.4.1":{"types":"./driver/magento/2.4.1/index.d.ts","esm2022":"./esm2022/driver/magento/2.4.1/daffodil-external-router-driver-magento-2.4.1.mjs","esm":"./esm2022/driver/magento/2.4.1/daffodil-external-router-driver-magento-2.4.1.mjs","default":"./fesm2022/daffodil-external-router-driver-magento-2.4.1.mjs"},"./driver/magento/2.4.2":{"types":"./driver/magento/2.4.2/index.d.ts","esm2022":"./esm2022/driver/magento/2.4.2/daffodil-external-router-driver-magento-2.4.2.mjs","esm":"./esm2022/driver/magento/2.4.2/daffodil-external-router-driver-magento-2.4.2.mjs","default":"./fesm2022/daffodil-external-router-driver-magento-2.4.2.mjs"},"./driver/magento/2.4.3":{"types":"./driver/magento/2.4.3/index.d.ts","esm2022":"./esm2022/driver/magento/2.4.3/daffodil-external-router-driver-magento-2.4.3.mjs","esm":"./esm2022/driver/magento/2.4.3/daffodil-external-router-driver-magento-2.4.3.mjs","default":"./fesm2022/daffodil-external-router-driver-magento-2.4.3.mjs"}},"sideEffects":false,"dependencies":{"tslib":"^2.3.0"}}
@@ -0,0 +1,3 @@
1
+ import { EnvironmentProviders } from '@angular/core';
2
+ import { DaffExternalRouterConfiguration } from './config';
3
+ export declare const provideExternalRouter: (config?: Partial<DaffExternalRouterConfiguration>) => EnvironmentProviders;
package/public_api.d.ts CHANGED
@@ -1,11 +1,3 @@
1
- export { DaffExternalRouterModule } from './external-router.module';
2
1
  export { DAFF_EXTERNAL_ROUTER_CONFIG, DaffExternalRouterConfiguration, } from './config';
3
- export { daffProvideRouteResolvableByType } from './token/type-resolvable-routes.token';
4
2
  export * from './model/public_api';
5
- export { DaffExternalRouter } from './router/router.service';
6
- export { daffInsertRouteBeforeWildCardStrategy } from './router/strategies/insert-route-before-wildcard';
7
- export { daffInsertDataPathStrategy } from './router/strategies/insert-data-path';
8
- export { daffDataPathUrlMatcher } from './router/url-matcher/data-path-matcher';
9
- export { DaffExternalRouterNoWildcardError } from './errors/no-wildcard';
10
- export { DaffExternalRouterUnknownRouteTypeError } from './errors/unknown-type';
11
- export { daffExtractDaffPathData } from './util/extract-daff-path-data';
3
+ export { provideExternalRouter } from './provide-external-router';
@@ -0,0 +1,10 @@
1
+ import { UrlSegment, UrlTree } from '@angular/router';
2
+ import { Observable } from 'rxjs';
3
+ import { DaffRouteWithSeoData } from '@daffodil/external-router';
4
+ /**
5
+ * A `canMatch` guard function that will resolve a route externally, allowing Angular to match it.
6
+ *
7
+ * Depending on the resolution result, the route's data will contain `daffSeoData` with supplemental search engine data
8
+ * about the route. The data on the route is cumulative. If other data properties are set, they will be merged alongside daffSeoData.
9
+ */
10
+ export declare const daffExternalMatcherTypeGuard: (type: string) => (route: DaffRouteWithSeoData, segments: Array<UrlSegment>) => Observable<boolean | UrlTree>;
@@ -0,0 +1,7 @@
1
+ import { UrlSegment } from '@angular/router';
2
+ /**
3
+ * Converts a UrlSegment into its complete Url.
4
+ *
5
+ * @docs-private
6
+ */
7
+ export declare const daffConvertToPath: (segments: UrlSegment[]) => string;
@@ -1 +1 @@
1
- export { DaffExternalRouterExistenceGuard } from './guard/existence.guard';
1
+ export { daffExternalMatcherTypeGuard } from './guard/external-matcher-type.guard';
@@ -1,9 +0,0 @@
1
- import { DaffError, DaffInheritableError } from '@daffodil/core';
2
- /**
3
- * An error thrown when there was no wildcard route found in configuration
4
- * of the Angular Router.
5
- */
6
- export declare class DaffExternalRouterNoWildcardError extends DaffInheritableError implements DaffError {
7
- readonly code: string;
8
- constructor(message?: string);
9
- }
@@ -1,9 +0,0 @@
1
- import { DaffError, DaffInheritableError } from '@daffodil/core';
2
- /**
3
- * An error thrown when there is a failure matching a configured route to a
4
- * route type.
5
- */
6
- export declare class DaffExternalRouterUnknownRouteTypeError extends DaffInheritableError implements DaffError {
7
- readonly code: string;
8
- constructor(message?: string);
9
- }
@@ -1,12 +0,0 @@
1
- import { DaffInheritableError, } from '@daffodil/core';
2
- /**
3
- * An error thrown when there was no wildcard route found in configuration
4
- * of the Angular Router.
5
- */
6
- export class DaffExternalRouterNoWildcardError extends DaffInheritableError {
7
- constructor(message) {
8
- super(message);
9
- this.code = 'NO_WILDCARD_ROUTE';
10
- }
11
- }
12
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm8td2lsZGNhcmQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9saWJzL2V4dGVybmFsLXJvdXRlci9zcmMvZXJyb3JzL25vLXdpbGRjYXJkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFFTCxvQkFBb0IsR0FDckIsTUFBTSxnQkFBZ0IsQ0FBQztBQUV4Qjs7O0dBR0c7QUFDSCxNQUFNLE9BQU8saUNBQWtDLFNBQVEsb0JBQW9CO0lBSXpFLFlBQVksT0FBZ0I7UUFDMUIsS0FBSyxDQUFDLE9BQU8sQ0FBQyxDQUFDO1FBSEQsU0FBSSxHQUFXLG1CQUFtQixDQUFDO0lBSW5ELENBQUM7Q0FDRiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7XG4gIERhZmZFcnJvcixcbiAgRGFmZkluaGVyaXRhYmxlRXJyb3IsXG59IGZyb20gJ0BkYWZmb2RpbC9jb3JlJztcblxuLyoqXG4gKiBBbiBlcnJvciB0aHJvd24gd2hlbiB0aGVyZSB3YXMgbm8gd2lsZGNhcmQgcm91dGUgZm91bmQgaW4gY29uZmlndXJhdGlvblxuICogb2YgdGhlIEFuZ3VsYXIgUm91dGVyLlxuICovXG5leHBvcnQgY2xhc3MgRGFmZkV4dGVybmFsUm91dGVyTm9XaWxkY2FyZEVycm9yIGV4dGVuZHMgRGFmZkluaGVyaXRhYmxlRXJyb3JcbiAgaW1wbGVtZW50cyBEYWZmRXJyb3Ige1xuICBwdWJsaWMgcmVhZG9ubHkgY29kZTogc3RyaW5nID0gJ05PX1dJTERDQVJEX1JPVVRFJztcblxuICBjb25zdHJ1Y3RvcihtZXNzYWdlPzogc3RyaW5nKSB7XG4gICAgc3VwZXIobWVzc2FnZSk7XG4gIH1cbn1cbiJdfQ==
@@ -1,12 +0,0 @@
1
- import { DaffInheritableError, } from '@daffodil/core';
2
- /**
3
- * An error thrown when there is a failure matching a configured route to a
4
- * route type.
5
- */
6
- export class DaffExternalRouterUnknownRouteTypeError extends DaffInheritableError {
7
- constructor(message) {
8
- super(message);
9
- this.code = 'UNKNOWN_ROUTE_TYPE';
10
- }
11
- }
12
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidW5rbm93bi10eXBlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vbGlicy9leHRlcm5hbC1yb3V0ZXIvc3JjL2Vycm9ycy91bmtub3duLXR5cGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUVMLG9CQUFvQixHQUNyQixNQUFNLGdCQUFnQixDQUFDO0FBRXhCOzs7R0FHRztBQUNILE1BQU0sT0FBTyx1Q0FBd0MsU0FBUSxvQkFBb0I7SUFJL0UsWUFBWSxPQUFnQjtRQUMxQixLQUFLLENBQUMsT0FBTyxDQUFDLENBQUM7UUFIRCxTQUFJLEdBQVcsb0JBQW9CLENBQUM7SUFJcEQsQ0FBQztDQUNGIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHtcbiAgRGFmZkVycm9yLFxuICBEYWZmSW5oZXJpdGFibGVFcnJvcixcbn0gZnJvbSAnQGRhZmZvZGlsL2NvcmUnO1xuXG4vKipcbiAqIEFuIGVycm9yIHRocm93biB3aGVuIHRoZXJlIGlzIGEgZmFpbHVyZSBtYXRjaGluZyBhIGNvbmZpZ3VyZWQgcm91dGUgdG8gYVxuICogcm91dGUgdHlwZS5cbiAqL1xuZXhwb3J0IGNsYXNzIERhZmZFeHRlcm5hbFJvdXRlclVua25vd25Sb3V0ZVR5cGVFcnJvciBleHRlbmRzIERhZmZJbmhlcml0YWJsZUVycm9yXG4gIGltcGxlbWVudHMgRGFmZkVycm9yIHtcbiAgcHVibGljIHJlYWRvbmx5IGNvZGU6IHN0cmluZyA9ICdVTktOT1dOX1JPVVRFX1RZUEUnO1xuXG4gIGNvbnN0cnVjdG9yKG1lc3NhZ2U/OiBzdHJpbmcpIHtcbiAgICBzdXBlcihtZXNzYWdlKTtcbiAgfVxufVxuIl19
@@ -1,31 +0,0 @@
1
- import { CommonModule } from '@angular/common';
2
- import { NgModule, } from '@angular/core';
3
- import { DAFF_EXTERNAL_ROUTER_CONFIG, daffExternalRouterConfigurationDefault, } from './config';
4
- import { daffProvideRoutesResolvableByType } from './token/type-resolvable-routes.token';
5
- import * as i0 from "@angular/core";
6
- /**
7
- * The external `DaffExternalRouterModule` allows you to configure the
8
- * `@daffodil/external-router` package's behavior.
9
- */
10
- export class DaffExternalRouterModule {
11
- static forRoot(config, routes = []) {
12
- return {
13
- ngModule: DaffExternalRouterModule,
14
- providers: [
15
- { provide: DAFF_EXTERNAL_ROUTER_CONFIG, useValue: { ...daffExternalRouterConfigurationDefault, ...config } },
16
- ...daffProvideRoutesResolvableByType(routes),
17
- ],
18
- };
19
- }
20
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffExternalRouterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
21
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.2", ngImport: i0, type: DaffExternalRouterModule, imports: [CommonModule] }); }
22
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffExternalRouterModule, imports: [CommonModule] }); }
23
- }
24
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffExternalRouterModule, decorators: [{
25
- type: NgModule,
26
- args: [{
27
- declarations: [],
28
- imports: [CommonModule],
29
- }]
30
- }] });
31
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXh0ZXJuYWwtcm91dGVyLm1vZHVsZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYnMvZXh0ZXJuYWwtcm91dGVyL3NyYy9leHRlcm5hbC1yb3V0ZXIubW9kdWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUMvQyxPQUFPLEVBRUwsUUFBUSxHQUNULE1BQU0sZUFBZSxDQUFDO0FBRXZCLE9BQU8sRUFFTCwyQkFBMkIsRUFDM0Isc0NBQXNDLEdBQ3ZDLE1BQU0sVUFBVSxDQUFDO0FBRWxCLE9BQU8sRUFBRSxpQ0FBaUMsRUFBRSxNQUFNLHNDQUFzQyxDQUFDOztBQUV6Rjs7O0dBR0c7QUFLSCxNQUFNLE9BQU8sd0JBQXdCO0lBQ25DLE1BQU0sQ0FBQyxPQUFPLENBQ1osTUFBZ0QsRUFDaEQsU0FBOEIsRUFBRTtRQUVoQyxPQUFPO1lBQ0wsUUFBUSxFQUFFLHdCQUF3QjtZQUNsQyxTQUFTLEVBQUU7Z0JBQ1QsRUFBRSxPQUFPLE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appingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicm91dGUtd2l0aG91dC1wYXRoLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vbGlicy9leHRlcm5hbC1yb3V0ZXIvc3JjL21vZGVsL3JvdXRlLXdpdGhvdXQtcGF0aC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgUm91dGUgfSBmcm9tICdAYW5ndWxhci9yb3V0ZXInO1xuXG4vKipcbiAqIEEgRGFmZlJvdXRlV2l0aG91dFBhdGggaXMgYSBzcGVjaWFsIGtpbmQgb2Ygcm91dGUgZGVmaW5pdGlvbiB3aXRob3V0IGEgcGF0aC5cbiAqIFRoaXMgaXMgdXNlZnVsIHdoZW4gZGVmaW5pbmcgcm91dGVzIHRoYXQgYXJlbid0IHByb3ZpZGVkIGEgcGF0aCBpbml0aWFsbHksXG4gKiBidXQgd2lsbCBiZSBwcm92aWRlZCB3aXRoIG9uZSBhdCBhIGxhdGVyIHRpbWUsIGUuZy4gYXQgcnVudGltZS5cbiAqL1xuZXhwb3J0IHR5cGUgRGFmZlJvdXRlV2l0aG91dFBhdGggPSBPbWl0PFJvdXRlLCAncGF0aCc+O1xuIl19
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZS1yb3V0ZS1wYWlyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vbGlicy9leHRlcm5hbC1yb3V0ZXIvc3JjL21vZGVsL3R5cGUtcm91dGUtcGFpci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgRGFmZkV4dGVybmFsUm91dGVySW5zZXJ0aW9uU3RyYXRlZ3kgfSBmcm9tICcuL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