@daffodil/external-router 0.94.1 → 0.95.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 (34) hide show
  1. package/fesm2022/daffodil-external-router-driver-in-memory.mjs +70 -88
  2. package/fesm2022/daffodil-external-router-driver-in-memory.mjs.map +1 -1
  3. package/fesm2022/daffodil-external-router-driver-magento-2.4.1.mjs +117 -118
  4. package/fesm2022/daffodil-external-router-driver-magento-2.4.1.mjs.map +1 -1
  5. package/fesm2022/daffodil-external-router-driver-magento-2.4.2.mjs +117 -118
  6. package/fesm2022/daffodil-external-router-driver-magento-2.4.2.mjs.map +1 -1
  7. package/fesm2022/daffodil-external-router-driver-magento-2.4.3.mjs +216 -266
  8. package/fesm2022/daffodil-external-router-driver-magento-2.4.3.mjs.map +1 -1
  9. package/fesm2022/daffodil-external-router-driver-magento-auto.mjs +7 -0
  10. package/fesm2022/daffodil-external-router-driver-magento-auto.mjs.map +1 -0
  11. package/fesm2022/daffodil-external-router-driver-magento.mjs +6 -18
  12. package/fesm2022/daffodil-external-router-driver-magento.mjs.map +1 -1
  13. package/fesm2022/daffodil-external-router-driver-shopify.mjs +49 -39
  14. package/fesm2022/daffodil-external-router-driver-shopify.mjs.map +1 -1
  15. package/fesm2022/daffodil-external-router-driver-testing.mjs +118 -115
  16. package/fesm2022/daffodil-external-router-driver-testing.mjs.map +1 -1
  17. package/fesm2022/daffodil-external-router-driver.mjs +8 -32
  18. package/fesm2022/daffodil-external-router-driver.mjs.map +1 -1
  19. package/fesm2022/daffodil-external-router-routing.mjs +31 -66
  20. package/fesm2022/daffodil-external-router-routing.mjs.map +1 -1
  21. package/fesm2022/daffodil-external-router.mjs +37 -81
  22. package/fesm2022/daffodil-external-router.mjs.map +1 -1
  23. package/package.json +1 -1
  24. package/types/daffodil-external-router-driver-in-memory.d.ts +15 -21
  25. package/types/daffodil-external-router-driver-magento-2.4.1.d.ts +29 -25
  26. package/types/daffodil-external-router-driver-magento-2.4.2.d.ts +29 -25
  27. package/types/daffodil-external-router-driver-magento-2.4.3.d.ts +25 -28
  28. package/types/daffodil-external-router-driver-magento-auto.d.ts +1 -0
  29. package/types/daffodil-external-router-driver-magento.d.ts +251 -263
  30. package/types/daffodil-external-router-driver-shopify.d.ts +10 -14
  31. package/types/daffodil-external-router-driver-testing.d.ts +22 -27
  32. package/types/daffodil-external-router-driver.d.ts +12 -19
  33. package/types/daffodil-external-router-routing.d.ts +4 -7
  34. package/types/daffodil-external-router.d.ts +72 -86
@@ -1,71 +1,36 @@
1
- import { inject } from '@angular/core';
2
- import { Router } from '@angular/router';
3
- import { map, tap, catchError, of } from 'rxjs';
4
- import { DaffExternalRouterPermanentRedirectError, DaffExternalRouterTemporaryRedirectError, DAFF_EXTERNAL_ROUTER_CONFIG, DaffExternalRouterNotFoundError } from '@daffodil/external-router';
5
- import { DaffExternalRouterDriver } from '@daffodil/external-router/driver';
6
-
7
- /**
8
- * Converts a UrlSegment into its complete Url.
9
- *
10
- * @docs-private
11
- */
12
- const daffConvertToPath = (segments) => segments.map(seg => seg.path).join('/');
13
-
14
- /**
15
- * Processes resolvedUrls and throws the appropriate error so that External Router
16
- * can handle redirects.
17
- */
1
+ import { inject } from "@angular/core";
2
+ import { Router } from "@angular/router";
3
+ import { catchError, map, of, tap } from "rxjs";
4
+ import { DAFF_EXTERNAL_ROUTER_CONFIG, DaffExternalRouterNotFoundError, DaffExternalRouterPermanentRedirectError, DaffExternalRouterTemporaryRedirectError } from "@daffodil/external-router";
5
+ import { DaffExternalRouterDriver } from "@daffodil/external-router/driver";
6
+ const daffConvertToPath = (segments) => segments.map((seg) => seg.path).join("/");
18
7
  const processRedirects = (url) => {
19
- if (url.code === 301) {
20
- throw new DaffExternalRouterPermanentRedirectError(url.url);
21
- }
22
- else if (url.code === 302) {
23
- throw new DaffExternalRouterTemporaryRedirectError(url.url);
24
- }
25
- else {
26
- return url;
27
- }
8
+ if (url.code === 301) throw new DaffExternalRouterPermanentRedirectError(url.url);
9
+ else if (url.code === 302) throw new DaffExternalRouterTemporaryRedirectError(url.url);
10
+ else return url;
28
11
  };
29
-
30
- /**
31
- * A `canMatch` guard function that will resolve a route externally, allowing Angular to match it.
32
- *
33
- * Depending on the resolution result, the route's data will contain `daffSeoData` with supplemental search engine data
34
- * about the route. The data on the route is cumulative. If other data properties are set, they will be merged alongside daffSeoData.
35
- */
36
12
  const daffExternalMatcherTypeGuard = (type) => (route, segments) => {
37
- const router = inject(Router);
38
- const config = inject(DAFF_EXTERNAL_ROUTER_CONFIG);
39
- return inject(DaffExternalRouterDriver).resolve(daffConvertToPath(segments)).pipe(map(processRedirects), map((r) => ({ result: r, isMatch: type === r.type })), tap((r) => {
40
- if (r.isMatch) {
41
- route.title = r.result.data?.title ?? route.data?.daffSeoData?.title ?? route.title;
42
- route.data = { ...route.data, daffSeoData: r.result.data };
43
- }
44
- }), map((res) => res.isMatch), catchError(error => {
45
- if (!(error instanceof DaffExternalRouterPermanentRedirectError) &&
46
- !(error instanceof DaffExternalRouterTemporaryRedirectError)) {
47
- throw error;
48
- }
49
- return of(router.parseUrl(error.redirectUrl));
50
- }),
51
- // Handle "404"
52
- catchError((error) => {
53
- if (!(error instanceof DaffExternalRouterNotFoundError)) {
54
- throw error;
55
- }
56
- return of(false);
57
- }),
58
- //Otherwise something went horribly wrong and we need to bail out.
59
- catchError(() => of(router.parseUrl(config.failedResolutionPath))), catchError(() => of(false)));
13
+ const router = inject(Router);
14
+ const config = inject(DAFF_EXTERNAL_ROUTER_CONFIG);
15
+ return inject(DaffExternalRouterDriver).resolve(daffConvertToPath(segments)).pipe(map(processRedirects), map((r) => ({
16
+ result: r,
17
+ isMatch: type === r.type
18
+ })), tap((r) => {
19
+ if (r.isMatch) {
20
+ route.title = r.result.data?.title ?? route.data?.daffSeoData?.title ?? route.title;
21
+ route.data = {
22
+ ...route.data,
23
+ daffSeoData: r.result.data
24
+ };
25
+ }
26
+ }), map((res) => res.isMatch), catchError((error) => {
27
+ if (!(error instanceof DaffExternalRouterPermanentRedirectError) && !(error instanceof DaffExternalRouterTemporaryRedirectError)) throw error;
28
+ return of(router.parseUrl(error.redirectUrl));
29
+ }), catchError((error) => {
30
+ if (!(error instanceof DaffExternalRouterNotFoundError)) throw error;
31
+ return of(false);
32
+ }), catchError(() => of(router.parseUrl(config.failedResolutionPath))), catchError(() => of(false)));
60
33
  };
61
-
62
- /*
63
- * Public API Surface of @daffodil/external-router/routing
64
- */
65
-
66
- /**
67
- * Generated bundle index. Do not edit.
68
- */
69
-
70
34
  export { daffExternalMatcherTypeGuard };
71
- //# sourceMappingURL=daffodil-external-router-routing.mjs.map
35
+
36
+ //# sourceMappingURL=daffodil-external-router-routing.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-external-router-routing.mjs","sources":["../../../libs/external-router/routing/src/helper/convert-to-path.ts","../../../libs/external-router/routing/src/processors/process-redirect.ts","../../../libs/external-router/routing/src/guard/external-matcher-type.guard.ts","../../../libs/external-router/routing/src/public_api.ts","../../../libs/external-router/routing/src/daffodil-external-router-routing.ts"],"sourcesContent":["import { UrlSegment } from '@angular/router';\n\n/**\n * Converts a UrlSegment into its complete Url.\n *\n * @docs-private\n */\nexport const daffConvertToPath = (segments: UrlSegment[]) => segments.map(seg => seg.path).join('/');\n","import { DaffExternallyResolvableUrl } from '@daffodil/external-router';\n\nimport { DaffExternalRouterPermanentRedirectError } from '../errors/permanent-redirect';\nimport { DaffExternalRouterTemporaryRedirectError } from '../errors/temporary-redirect';\n\n/**\n * Processes resolvedUrls and throws the appropriate error so that External Router\n * can handle redirects.\n */\nexport const processRedirects = (url: DaffExternallyResolvableUrl): DaffExternallyResolvableUrl => {\n if(url.code === 301){\n throw new DaffExternalRouterPermanentRedirectError(url.url);\n } else if(url.code === 302) {\n throw new DaffExternalRouterTemporaryRedirectError(url.url);\n } else {\n return url;\n }\n};\n","import { inject } from '@angular/core';\nimport {\n Router,\n UrlSegment,\n UrlTree,\n} from '@angular/router';\nimport {\n Observable,\n catchError,\n map,\n of,\n tap,\n} from 'rxjs';\n\nimport {\n DAFF_EXTERNAL_ROUTER_CONFIG,\n DaffExternalRouterConfiguration,\n DaffRouteWithSeoData,\n} from '@daffodil/external-router';\nimport { DaffExternalRouterDriver } from '@daffodil/external-router/driver';\n\nimport { DaffExternalRouterNotFoundError } from '../errors/not-found-error';\nimport { DaffExternalRouterPermanentRedirectError } from '../errors/permanent-redirect';\nimport { DaffExternalRouterTemporaryRedirectError } from '../errors/temporary-redirect';\nimport { daffConvertToPath } from '../helper/convert-to-path';\nimport { processRedirects } from '../processors/process-redirect';\n\n/**\n * A `canMatch` guard function that will resolve a route externally, allowing Angular to match it.\n *\n * Depending on the resolution result, the route's data will contain `daffSeoData` with supplemental search engine data\n * about the route. The data on the route is cumulative. If other data properties are set, they will be merged alongside daffSeoData.\n */\nexport const daffExternalMatcherTypeGuard = (type: string) => (route: DaffRouteWithSeoData, segments: Array<UrlSegment>): Observable<boolean | UrlTree> => {\n const router = inject(Router);\n const config: DaffExternalRouterConfiguration = inject(DAFF_EXTERNAL_ROUTER_CONFIG);\n return inject(DaffExternalRouterDriver).resolve(daffConvertToPath(segments)).pipe(\n map(processRedirects),\n map((r) => ({ result: r, isMatch: type === r.type })),\n tap((r) => {\n if(r.isMatch) {\n route.title = r.result.data?.title ?? route.data?.daffSeoData?.title ?? route.title;\n route.data = { ...route.data, daffSeoData: r.result.data };\n }\n }),\n map((res) => res.isMatch),\n catchError(error => {\n if (\n !(error instanceof DaffExternalRouterPermanentRedirectError) &&\n !(error instanceof DaffExternalRouterTemporaryRedirectError)) {\n throw error;\n }\n\n return of(router.parseUrl(error.redirectUrl));\n }),\n // Handle \"404\"\n catchError((error) => {\n if (!(error instanceof DaffExternalRouterNotFoundError)) {\n throw error;\n }\n\n return of(false);\n }),\n //Otherwise something went horribly wrong and we need to bail out.\n catchError(() => of(router.parseUrl(config.failedResolutionPath))),\n catchError(() => of(false)),\n );\n};\n","/*\n * Public API Surface of @daffodil/external-router/routing\n */\nexport { daffExternalMatcherTypeGuard } from './guard/external-matcher-type.guard';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAEA;;;;AAIG;AACI,MAAM,iBAAiB,GAAG,CAAC,QAAsB,KAAK,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;;ACFpG;;;AAGG;AACI,MAAM,gBAAgB,GAAG,CAAC,GAAgC,KAAiC;AAChG,IAAA,IAAG,GAAG,CAAC,IAAI,KAAK,GAAG,EAAC;AAClB,QAAA,MAAM,IAAI,wCAAwC,CAAC,GAAG,CAAC,GAAG,CAAC;IAC7D;AAAO,SAAA,IAAG,GAAG,CAAC,IAAI,KAAK,GAAG,EAAE;AAC1B,QAAA,MAAM,IAAI,wCAAwC,CAAC,GAAG,CAAC,GAAG,CAAC;IAC7D;SAAO;AACL,QAAA,OAAO,GAAG;IACZ;AACF,CAAC;;ACUD;;;;;AAKG;AACI,MAAM,4BAA4B,GAAG,CAAC,IAAY,KAAK,CAAC,KAA2B,EAAE,QAA2B,KAAmC;AACxJ,IAAA,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AAC7B,IAAA,MAAM,MAAM,GAAoC,MAAM,CAAC,2BAA2B,CAAC;IACnF,OAAO,MAAM,CAAC,wBAAwB,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAC/E,GAAG,CAAC,gBAAgB,CAAC,EACrB,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,EACrD,GAAG,CAAC,CAAC,CAAC,KAAI;AACR,QAAA,IAAG,CAAC,CAAC,OAAO,EAAE;YACZ,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,IAAI,KAAK,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,IAAI,KAAK,CAAC,KAAK;AACnF,YAAA,KAAK,CAAC,IAAI,GAAG,EAAE,GAAG,KAAK,CAAC,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE;QAC5D;AACF,IAAA,CAAC,CAAC,EACF,GAAG,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,OAAO,CAAC,EACzB,UAAU,CAAC,KAAK,IAAG;AACjB,QAAA,IACE,EAAE,KAAK,YAAY,wCAAwC,CAAC;AAC5D,YAAA,EAAE,KAAK,YAAY,wCAAwC,CAAC,EAAE;AAC9D,YAAA,MAAM,KAAK;QACb;QAEA,OAAO,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;AAC/C,IAAA,CAAC,CAAC;;AAEF,IAAA,UAAU,CAAC,CAAC,KAAK,KAAI;AACnB,QAAA,IAAI,EAAE,KAAK,YAAY,+BAA+B,CAAC,EAAE;AACvD,YAAA,MAAM,KAAK;QACb;AAEA,QAAA,OAAO,EAAE,CAAC,KAAK,CAAC;AAClB,IAAA,CAAC,CAAC;;AAEF,IAAA,UAAU,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC,CAAC,EAClE,UAAU,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC,CAC5B;AACH;;ACnEA;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-external-router-routing.mjs","names":[],"sources":["../../../libs/external-router/routing/src/helper/convert-to-path.ts","../../../libs/external-router/routing/src/processors/process-redirect.ts","../../../libs/external-router/routing/src/guard/external-matcher-type.guard.ts"],"sourcesContent":["import { UrlSegment } from '@angular/router';\n\n/**\n * Converts a UrlSegment into its complete Url.\n *\n * @docs-private\n */\nexport const daffConvertToPath = (segments: UrlSegment[]) => segments.map(seg => seg.path).join('/');\n","import { DaffExternallyResolvableUrl } from '@daffodil/external-router';\n\nimport { DaffExternalRouterPermanentRedirectError } from '../errors/permanent-redirect';\nimport { DaffExternalRouterTemporaryRedirectError } from '../errors/temporary-redirect';\n\n/**\n * Processes resolvedUrls and throws the appropriate error so that External Router\n * can handle redirects.\n */\nexport const processRedirects = (url: DaffExternallyResolvableUrl): DaffExternallyResolvableUrl => {\n if(url.code === 301){\n throw new DaffExternalRouterPermanentRedirectError(url.url);\n } else if(url.code === 302) {\n throw new DaffExternalRouterTemporaryRedirectError(url.url);\n } else {\n return url;\n }\n};\n","import { inject } from '@angular/core';\nimport {\n Router,\n UrlSegment,\n UrlTree,\n} from '@angular/router';\nimport {\n Observable,\n catchError,\n map,\n of,\n tap,\n} from 'rxjs';\n\nimport {\n DAFF_EXTERNAL_ROUTER_CONFIG,\n DaffExternalRouterConfiguration,\n DaffRouteWithSeoData,\n} from '@daffodil/external-router';\nimport { DaffExternalRouterDriver } from '@daffodil/external-router/driver';\n\nimport { DaffExternalRouterNotFoundError } from '../errors/not-found-error';\nimport { DaffExternalRouterPermanentRedirectError } from '../errors/permanent-redirect';\nimport { DaffExternalRouterTemporaryRedirectError } from '../errors/temporary-redirect';\nimport { daffConvertToPath } from '../helper/convert-to-path';\nimport { processRedirects } from '../processors/process-redirect';\n\n/**\n * A `canMatch` guard function that will resolve a route externally, allowing Angular to match it.\n *\n * Depending on the resolution result, the route's data will contain `daffSeoData` with supplemental search engine data\n * about the route. The data on the route is cumulative. If other data properties are set, they will be merged alongside daffSeoData.\n */\nexport const daffExternalMatcherTypeGuard = (type: string) => (route: DaffRouteWithSeoData, segments: Array<UrlSegment>): Observable<boolean | UrlTree> => {\n const router = inject(Router);\n const config: DaffExternalRouterConfiguration = inject(DAFF_EXTERNAL_ROUTER_CONFIG);\n return inject(DaffExternalRouterDriver).resolve(daffConvertToPath(segments)).pipe(\n map(processRedirects),\n map((r) => ({ result: r, isMatch: type === r.type })),\n tap((r) => {\n if(r.isMatch) {\n route.title = r.result.data?.title ?? route.data?.daffSeoData?.title ?? route.title;\n route.data = { ...route.data, daffSeoData: r.result.data };\n }\n }),\n map((res) => res.isMatch),\n catchError(error => {\n if (\n !(error instanceof DaffExternalRouterPermanentRedirectError) &&\n !(error instanceof DaffExternalRouterTemporaryRedirectError)) {\n throw error;\n }\n\n return of(router.parseUrl(error.redirectUrl));\n }),\n // Handle \"404\"\n catchError((error) => {\n if (!(error instanceof DaffExternalRouterNotFoundError)) {\n throw error;\n }\n\n return of(false);\n }),\n //Otherwise something went horribly wrong and we need to bail out.\n catchError(() => of(router.parseUrl(config.failedResolutionPath))),\n catchError(() => of(false)),\n );\n};\n"],"mappings":";;;;;AAOA,MAAa,qBAAqB,aAA2B,SAAS,KAAI,QAAO,IAAI,IAAI,CAAC,CAAC,KAAK,GAAG;ACEnG,MAAa,oBAAoB,QAAiE;CAChG,IAAG,IAAI,SAAS,KACd,MAAM,IAAI,yCAAyC,IAAI,GAAG;MACrD,IAAG,IAAI,SAAS,KACrB,MAAM,IAAI,yCAAyC,IAAI,GAAG;MAE1D,OAAO;AAEX;ACgBA,MAAa,gCAAgC,UAAkB,OAA6B,aAA8D;CACxJ,MAAM,SAAS,OAAO,MAAM;CAC5B,MAAM,SAA0C,OAAO,2BAA2B;CAClF,OAAO,OAAO,wBAAwB,CAAC,CAAC,QAAQ,kBAAkB,QAAQ,CAAC,CAAC,CAAC,KAC3E,IAAI,gBAAgB,GACpB,KAAK,OAAO;EAAE,QAAQ;EAAG,SAAS,SAAS,EAAE;CAAI,EAAG,GACpD,KAAK,MAAK;EACR,IAAG,EAAE,SAAS;GACZ,MAAM,QAAQ,EAAE,OAAO,MAAM,SAAS,MAAM,MAAM,aAAa,SAAS,MAAM;GAC9E,MAAM,OAAO;IAAE,GAAG,MAAM;IAAM,aAAa,EAAE,OAAO;GAAI;EAC1D;CACF,CAAC,GACD,KAAK,QAAQ,IAAI,OAAO,GACxB,YAAW,UAAQ;EACjB,IACE,EAAE,iBAAiB,6CACnB,EAAE,iBAAiB,2CACnB,MAAM;EAGR,OAAO,GAAG,OAAO,SAAS,MAAM,WAAW,CAAC;CAC9C,CAAC,GAED,YAAY,UAAS;EACnB,IAAI,EAAE,iBAAiB,kCACrB,MAAM;EAGR,OAAO,GAAG,KAAK;CACjB,CAAC,GAED,iBAAiB,GAAG,OAAO,SAAS,OAAO,oBAAoB,CAAC,CAAC,GACjE,iBAAiB,GAAG,KAAK,CAAC,CAAC;AAE/B"}
@@ -1,83 +1,39 @@
1
- import { createConfigInjectionToken, DaffInheritableError } from '@daffodil/core';
2
- import { makeEnvironmentProviders } from '@angular/core';
3
-
4
- const daffExternalRouterConfigurationDefault = {
5
- failedResolutionPath: '/',
1
+ import { DaffInheritableError, createConfigInjectionToken } from "@daffodil/core";
2
+ import { makeEnvironmentProviders } from "@angular/core";
3
+ const { token: DAFF_EXTERNAL_ROUTER_CONFIG, provider: provideDaffExternalRouterConfig } = createConfigInjectionToken({ failedResolutionPath: "/" }, "DAFF_EXTERNAL_ROUTER_CONFIG");
4
+ const provideExternalRouter = (config = {}) => makeEnvironmentProviders([provideDaffExternalRouterConfig(config)]);
5
+ var DaffExternalRouterClientError = class extends DaffInheritableError {
6
+ constructor(message) {
7
+ super(message);
8
+ this.code = "4xx_CLIENT_ERROR";
9
+ }
10
+ };
11
+ var DaffExternalRouterNotFoundError = class extends DaffExternalRouterClientError {
12
+ constructor(message) {
13
+ super(message);
14
+ this.code = "404_NOT_FOUND";
15
+ }
16
+ };
17
+ var DaffExternalRouterPermanentRedirectError = class extends DaffInheritableError {
18
+ constructor(redirectUrl, message) {
19
+ super(message);
20
+ this.redirectUrl = redirectUrl;
21
+ this.code = "302_PERMANENT_REDIRECT";
22
+ }
23
+ };
24
+ var DaffExternalRouterServerError = class extends DaffInheritableError {
25
+ constructor(message) {
26
+ super(message);
27
+ this.code = "5xx_SERVER_ERROR";
28
+ }
29
+ };
30
+ var DaffExternalRouterTemporaryRedirectError = class extends DaffInheritableError {
31
+ constructor(redirectUrl, message) {
32
+ super(message);
33
+ this.redirectUrl = redirectUrl;
34
+ this.code = "TEMPORARY_REDIRECT";
35
+ }
6
36
  };
7
- const {
8
- /**
9
- * The token holding the runtime configuration for the behavior of the
10
- * `@daffodil/external-router` package.
11
- */
12
- token: DAFF_EXTERNAL_ROUTER_CONFIG,
13
- /**
14
- * Provider function for {@link DAFF_EXTERNAL_ROUTER_CONFIG}.
15
- */
16
- provider: provideDaffExternalRouterConfig, } = createConfigInjectionToken(daffExternalRouterConfigurationDefault, 'DAFF_EXTERNAL_ROUTER_CONFIG');
17
-
18
- const provideExternalRouter = (config = {}) => makeEnvironmentProviders([
19
- provideDaffExternalRouterConfig(config),
20
- ]);
21
-
22
- /**
23
- * Represents a 4xx client error encountered during external URL resolution.
24
- */
25
- class DaffExternalRouterClientError extends DaffInheritableError {
26
- constructor(message) {
27
- super(message);
28
- this.code = '4xx_CLIENT_ERROR';
29
- }
30
- }
31
-
32
- /**
33
- * Indicates that a URL could not be resolved by an external router driver.
34
- */
35
- class DaffExternalRouterNotFoundError extends DaffExternalRouterClientError {
36
- constructor(message) {
37
- super(message);
38
- this.code = '404_NOT_FOUND';
39
- }
40
- }
41
-
42
- /**
43
- * Signals that the resolved URL should permanently redirect to another location.
44
- */
45
- class DaffExternalRouterPermanentRedirectError extends DaffInheritableError {
46
- constructor(redirectUrl, message) {
47
- super(message);
48
- this.redirectUrl = redirectUrl;
49
- this.code = '302_PERMANENT_REDIRECT';
50
- }
51
- }
52
-
53
- /**
54
- * Indicates that the external routing platform experienced a server-side failure.
55
- */
56
- class DaffExternalRouterServerError extends DaffInheritableError {
57
- constructor(message) {
58
- super(message);
59
- this.code = '5xx_SERVER_ERROR';
60
- }
61
- }
62
-
63
- /**
64
- * Signals that the resolved URL should temporarily redirect to another location.
65
- */
66
- class DaffExternalRouterTemporaryRedirectError extends DaffInheritableError {
67
- constructor(redirectUrl, message) {
68
- super(message);
69
- this.redirectUrl = redirectUrl;
70
- this.code = 'TEMPORARY_REDIRECT';
71
- }
72
- }
73
-
74
- /*
75
- * Public API Surface of @daffodil/external-router
76
- */
77
-
78
- /**
79
- * Generated bundle index. Do not edit.
80
- */
81
-
82
37
  export { DAFF_EXTERNAL_ROUTER_CONFIG, DaffExternalRouterClientError, DaffExternalRouterNotFoundError, DaffExternalRouterPermanentRedirectError, DaffExternalRouterServerError, DaffExternalRouterTemporaryRedirectError, provideExternalRouter };
83
- //# sourceMappingURL=daffodil-external-router.mjs.map
38
+
39
+ //# 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/provide-external-router.ts","../../../libs/external-router/src/errors/client-error.ts","../../../libs/external-router/src/errors/not-found-error.ts","../../../libs/external-router/src/errors/permanent-redirect.ts","../../../libs/external-router/src/errors/server-error.ts","../../../libs/external-router/src/errors/temporary-redirect.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","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\n/**\n * Represents a 4xx client error encountered during external URL resolution.\n */\nexport class DaffExternalRouterClientError extends DaffInheritableError\n implements DaffError {\n readonly code: string = '4xx_CLIENT_ERROR';\n\n constructor(message?: string) {\n super(message);\n }\n}\n","import { DaffError } from '@daffodil/core';\n\nimport { DaffExternalRouterClientError } from './client-error';\n\n/**\n * Indicates that a URL could not be resolved by an external router driver.\n */\nexport class DaffExternalRouterNotFoundError extends DaffExternalRouterClientError\n implements DaffError {\n readonly code = '404_NOT_FOUND';\n\n constructor(message?: string) {\n super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\n/**\n * Signals that the resolved URL should permanently redirect to another location.\n */\nexport class DaffExternalRouterPermanentRedirectError extends DaffInheritableError\n implements DaffError {\n readonly code: string = '302_PERMANENT_REDIRECT';\n\n constructor(readonly redirectUrl: string, message?: string) {\n super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\n/**\n * Indicates that the external routing platform experienced a server-side failure.\n */\nexport class DaffExternalRouterServerError extends DaffInheritableError\n implements DaffError {\n readonly code: string = '5xx_SERVER_ERROR';\n\n constructor(message?: string) {\n super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\n/**\n * Signals that the resolved URL should temporarily redirect to another location.\n */\nexport class DaffExternalRouterTemporaryRedirectError extends DaffInheritableError\n implements DaffError {\n readonly code: string = 'TEMPORARY_REDIRECT';\n\n constructor(readonly redirectUrl: string, message?: string) {\n super(message);\n }\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';\nexport * from './errors';\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;AAEM,MAAM;AACX;;;AAGG;AACH,KAAK,EAAE,2BAA2B;AAClC;;AAEG;AACH,QAAQ,EAAE,+BAA+B,GAC1C,GAAG,0BAA0B,CAAkC,sCAAsC,EAAE,6BAA6B;;ACN9H,MAAM,qBAAqB,GAAG,CAAC,MAAA,GAAmD,EAAE,KAA2B,wBAAwB,CAAC;IAC7I,+BAA+B,CAAC,MAAM,CAAC;AACxC,CAAA;;ACPD;;AAEG;AACG,MAAO,6BAA8B,SAAQ,oBAAoB,CAAA;AAIrE,IAAA,WAAA,CAAY,OAAgB,EAAA;QAC1B,KAAK,CAAC,OAAO,CAAC;QAHP,IAAA,CAAA,IAAI,GAAW,kBAAkB;IAI1C;AACD;;ACXD;;AAEG;AACG,MAAO,+BAAgC,SAAQ,6BAA6B,CAAA;AAIhF,IAAA,WAAA,CAAY,OAAgB,EAAA;QAC1B,KAAK,CAAC,OAAO,CAAC;QAHP,IAAA,CAAA,IAAI,GAAG,eAAe;IAI/B;AACD;;ACTD;;AAEG;AACG,MAAO,wCAAyC,SAAQ,oBAAoB,CAAA;IAIhF,WAAA,CAAqB,WAAmB,EAAE,OAAgB,EAAA;QACxD,KAAK,CAAC,OAAO,CAAC;QADK,IAAA,CAAA,WAAW,GAAX,WAAW;QAFvB,IAAA,CAAA,IAAI,GAAW,wBAAwB;IAIhD;AACD;;ACVD;;AAEG;AACG,MAAO,6BAA8B,SAAQ,oBAAoB,CAAA;AAIrE,IAAA,WAAA,CAAY,OAAgB,EAAA;QAC1B,KAAK,CAAC,OAAO,CAAC;QAHP,IAAA,CAAA,IAAI,GAAW,kBAAkB;IAI1C;AACD;;ACVD;;AAEG;AACG,MAAO,wCAAyC,SAAQ,oBAAoB,CAAA;IAIhF,WAAA,CAAqB,WAAmB,EAAE,OAAgB,EAAA;QACxD,KAAK,CAAC,OAAO,CAAC;QADK,IAAA,CAAA,WAAW,GAAX,WAAW;QAFvB,IAAA,CAAA,IAAI,GAAW,oBAAoB;IAI5C;AACD;;ACfD;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-external-router.mjs","names":[],"sources":["../../../libs/external-router/src/config.ts","../../../libs/external-router/src/provide-external-router.ts","../../../libs/external-router/src/errors/client-error.ts","../../../libs/external-router/src/errors/not-found-error.ts","../../../libs/external-router/src/errors/permanent-redirect.ts","../../../libs/external-router/src/errors/server-error.ts","../../../libs/external-router/src/errors/temporary-redirect.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","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\n/**\n * Represents a 4xx client error encountered during external URL resolution.\n */\nexport class DaffExternalRouterClientError extends DaffInheritableError\n implements DaffError {\n readonly code: string = '4xx_CLIENT_ERROR';\n\n constructor(message?: string) {\n super(message);\n }\n}\n","import { DaffError } from '@daffodil/core';\n\nimport { DaffExternalRouterClientError } from './client-error';\n\n/**\n * Indicates that a URL could not be resolved by an external router driver.\n */\nexport class DaffExternalRouterNotFoundError extends DaffExternalRouterClientError\n implements DaffError {\n readonly code = '404_NOT_FOUND';\n\n constructor(message?: string) {\n super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\n/**\n * Signals that the resolved URL should permanently redirect to another location.\n */\nexport class DaffExternalRouterPermanentRedirectError extends DaffInheritableError\n implements DaffError {\n readonly code: string = '302_PERMANENT_REDIRECT';\n\n constructor(readonly redirectUrl: string, message?: string) {\n super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\n/**\n * Indicates that the external routing platform experienced a server-side failure.\n */\nexport class DaffExternalRouterServerError extends DaffInheritableError\n implements DaffError {\n readonly code: string = '5xx_SERVER_ERROR';\n\n constructor(message?: string) {\n super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\n/**\n * Signals that the resolved URL should temporarily redirect to another location.\n */\nexport class DaffExternalRouterTemporaryRedirectError extends DaffInheritableError\n implements DaffError {\n readonly code: string = 'TEMPORARY_REDIRECT';\n\n constructor(readonly redirectUrl: string, message?: string) {\n super(message);\n }\n}\n"],"mappings":";;AAMA,MAAa,EAKX,OAAO,6BAIP,UAAU,oCACR,2BAA4D,EAb9D,sBAAsB,IAawC,GAAwC,6BAA6B;ACNrI,MAAa,yBAAyB,SAAmD,CAAA,MAA6B,yBAAyB,CAC7I,gCAAgC,MAAM,CACvC,CAAA;ACJD,IAAa,gCAAb,cAAmD,qBAAoB;CAIrE,YAAY,SAAgB;EAC1B,MAAM,OAAO;EAHN,KAAA,OAAe;CAIxB;AACD;ACRD,IAAa,kCAAb,cAAqD,8BAA6B;CAIhF,YAAY,SAAgB;EAC1B,MAAM,OAAO;EAHN,KAAA,OAAO;CAIhB;AACD;ACND,IAAa,2CAAb,cAA8D,qBAAoB;CAIhF,YAAqB,aAAqB,SAAgB;EACxD,MAAM,OAAO;EADM,KAAA,cAAA;EAFZ,KAAA,OAAe;CAIxB;AACD;ACPD,IAAa,gCAAb,cAAmD,qBAAoB;CAIrE,YAAY,SAAgB;EAC1B,MAAM,OAAO;EAHN,KAAA,OAAe;CAIxB;AACD;ACPD,IAAa,2CAAb,cAA8D,qBAAoB;CAIhF,YAAqB,aAAqB,SAAgB;EACxD,MAAM,OAAO;EADM,KAAA,cAAA;EAFZ,KAAA,OAAe;CAIxB;AACD"}
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@daffodil/external-router","nx":{"targets":{"build":{"outputs":["{workspaceRoot}/dist/external-router"]}}},"version":"0.94.1","description":"Platform-agnostic package that connects the Angular router with an external routing service for runtime route resolution. Part of the Daffodil ecommerce framework.","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":"^21","@angular/core":"^21","@angular/router":"^21","@daffodil/core":"0.94.1","rxjs":"^7.0.0"},"optionalDependencies":{"apollo-angular":"^13.0.0","@daffodil/driver":"0.94.1"},"module":"fesm2022/daffodil-external-router.mjs","typings":"types/daffodil-external-router.d.ts","exports":{"./package.json":{"default":"./package.json"},".":{"types":"./types/daffodil-external-router.d.ts","default":"./fesm2022/daffodil-external-router.mjs"},"./driver":{"types":"./types/daffodil-external-router-driver.d.ts","default":"./fesm2022/daffodil-external-router-driver.mjs"},"./driver/in-memory":{"types":"./types/daffodil-external-router-driver-in-memory.d.ts","default":"./fesm2022/daffodil-external-router-driver-in-memory.mjs"},"./driver/magento":{"types":"./types/daffodil-external-router-driver-magento.d.ts","default":"./fesm2022/daffodil-external-router-driver-magento.mjs"},"./driver/magento/2.4.1":{"types":"./types/daffodil-external-router-driver-magento-2.4.1.d.ts","default":"./fesm2022/daffodil-external-router-driver-magento-2.4.1.mjs"},"./driver/magento/2.4.2":{"types":"./types/daffodil-external-router-driver-magento-2.4.2.d.ts","default":"./fesm2022/daffodil-external-router-driver-magento-2.4.2.mjs"},"./driver/magento/2.4.3":{"types":"./types/daffodil-external-router-driver-magento-2.4.3.d.ts","default":"./fesm2022/daffodil-external-router-driver-magento-2.4.3.mjs"},"./driver/shopify":{"types":"./types/daffodil-external-router-driver-shopify.d.ts","default":"./fesm2022/daffodil-external-router-driver-shopify.mjs"},"./driver/testing":{"types":"./types/daffodil-external-router-driver-testing.d.ts","default":"./fesm2022/daffodil-external-router-driver-testing.mjs"},"./routing":{"types":"./types/daffodil-external-router-routing.d.ts","default":"./fesm2022/daffodil-external-router-routing.mjs"}},"sideEffects":false,"type":"module","dependencies":{"tslib":"^2.6.2"}}
1
+ {"name":"@daffodil/external-router","nx":{"targets":{"build":{"outputs":["{workspaceRoot}/dist/external-router"]}}},"version":"0.95.0","description":"Platform-agnostic package that connects the Angular router with an external routing service for runtime route resolution. Part of the Daffodil ecommerce framework.","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":"^22","@angular/core":"^22","@angular/router":"^22","@daffodil/core":"0.95.0","rxjs":"^7.0.0"},"optionalDependencies":{"apollo-angular":"^14.0.0","@daffodil/driver":"0.95.0"},"exports":{"./driver/magento/auto":{"external-router-magento-2.4.1":{"types":"./types/daffodil-external-router-driver-magento-2.4.1.d.ts","default":"./fesm2022/daffodil-external-router-driver-magento-2.4.1.mjs"},"external-router-magento-2.4.2":{"types":"./types/daffodil-external-router-driver-magento-2.4.2.d.ts","default":"./fesm2022/daffodil-external-router-driver-magento-2.4.2.mjs"},"external-router-magento-2.4.3":{"types":"./types/daffodil-external-router-driver-magento-2.4.3.d.ts","default":"./fesm2022/daffodil-external-router-driver-magento-2.4.3.mjs"},"types":"./types/daffodil-external-router-driver-magento-auto.d.ts","default":"./fesm2022/daffodil-external-router-driver-magento-auto.mjs"},"./package.json":{"default":"./package.json"},".":{"types":"./types/daffodil-external-router.d.ts","default":"./fesm2022/daffodil-external-router.mjs"},"./driver":{"types":"./types/daffodil-external-router-driver.d.ts","default":"./fesm2022/daffodil-external-router-driver.mjs"},"./driver/in-memory":{"types":"./types/daffodil-external-router-driver-in-memory.d.ts","default":"./fesm2022/daffodil-external-router-driver-in-memory.mjs"},"./driver/magento":{"types":"./types/daffodil-external-router-driver-magento.d.ts","default":"./fesm2022/daffodil-external-router-driver-magento.mjs"},"./driver/magento/2.4.1":{"types":"./types/daffodil-external-router-driver-magento-2.4.1.d.ts","default":"./fesm2022/daffodil-external-router-driver-magento-2.4.1.mjs"},"./driver/magento/2.4.2":{"types":"./types/daffodil-external-router-driver-magento-2.4.2.d.ts","default":"./fesm2022/daffodil-external-router-driver-magento-2.4.2.mjs"},"./driver/magento/2.4.3":{"types":"./types/daffodil-external-router-driver-magento-2.4.3.d.ts","default":"./fesm2022/daffodil-external-router-driver-magento-2.4.3.mjs"},"./driver/shopify":{"types":"./types/daffodil-external-router-driver-shopify.d.ts","default":"./fesm2022/daffodil-external-router-driver-shopify.mjs"},"./driver/testing":{"types":"./types/daffodil-external-router-driver-testing.d.ts","default":"./fesm2022/daffodil-external-router-driver-testing.mjs"},"./routing":{"types":"./types/daffodil-external-router-routing.d.ts","default":"./fesm2022/daffodil-external-router-routing.mjs"}},"module":"fesm2022/daffodil-external-router.mjs","typings":"types/daffodil-external-router.d.ts","sideEffects":false,"type":"module","dependencies":{"tslib":"^2.6.2"}}
@@ -1,22 +1,20 @@
1
- import { Observable } from 'rxjs';
2
- import { DaffExternallyResolvableUrl } from '@daffodil/external-router';
3
- import { DaffExternalRouterDriverInterface } from '@daffodil/external-router/driver';
4
- import * as _angular_core from '@angular/core';
5
- import { InjectionToken, EnvironmentProviders } from '@angular/core';
6
-
1
+ import { Observable } from "rxjs";
2
+ import { DaffExternallyResolvableUrl } from "@daffodil/external-router";
3
+ import { DaffExternalRouterDriverInterface } from "@daffodil/external-router/driver";
4
+ import * as i0 from "@angular/core";
5
+ import { EnvironmentProviders, InjectionToken } from "@angular/core";
7
6
  /**
8
7
  * A lookup for a URL.
9
8
  * Returns an {@link DaffExternallyResolvableUrl} or
10
9
  * {@link DAFF_EXTERNAL_ROUTER_NOT_FOUND_RESOLUTION} if the URL cannot be resolved
11
10
  */
12
- type DaffExternalRouterDriverInMemoryResolver = (url: string) => DaffExternallyResolvableUrl;
11
+ export type DaffExternalRouterDriverInMemoryResolver = (url: string) => DaffExternallyResolvableUrl;
13
12
  /**
14
13
  * The configuration for the in-memory driver.
15
14
  */
16
- interface DaffExternalRouterDriverInMemoryConfig {
17
- resolver: DaffExternalRouterDriverInMemoryResolver;
15
+ export interface DaffExternalRouterDriverInMemoryConfig {
16
+ resolver: DaffExternalRouterDriverInMemoryResolver;
18
17
  }
19
-
20
18
  /**
21
19
  * The DaffExternalRouterInMemoryDriver is responsible for resolving
22
20
  * a URL using the resolver in the provided configuration.
@@ -25,18 +23,14 @@ interface DaffExternalRouterDriverInMemoryConfig {
25
23
  *
26
24
  * @see {@link DaffExternalRouterInMemoryDriver}
27
25
  */
28
- declare class DaffExternalRouterInMemoryDriver implements DaffExternalRouterDriverInterface {
29
- private configuration;
30
- constructor(configuration: DaffExternalRouterDriverInMemoryConfig);
31
- resolve(url: string): Observable<DaffExternallyResolvableUrl>;
32
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<DaffExternalRouterInMemoryDriver, never>;
33
- static ɵprov: _angular_core.ɵɵInjectableDeclaration<DaffExternalRouterInMemoryDriver>;
26
+ export declare class DaffExternalRouterInMemoryDriver implements DaffExternalRouterDriverInterface {
27
+ private configuration;
28
+ constructor(configuration: DaffExternalRouterDriverInMemoryConfig);
29
+ resolve(url: string): Observable<DaffExternallyResolvableUrl>;
30
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffExternalRouterInMemoryDriver, never>;
31
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
34
32
  }
35
-
36
33
  /**
37
34
  * Provides an in-memory implementation of {@link DaffExternalRouterDriver}
38
35
  */
39
- declare const provideDaffExternalRouterInMemoryDriver: (config?: DaffExternalRouterDriverInMemoryConfig | InjectionToken<DaffExternalRouterDriverInMemoryConfig>) => EnvironmentProviders;
40
-
41
- export { DaffExternalRouterInMemoryDriver, provideDaffExternalRouterInMemoryDriver };
42
- export type { DaffExternalRouterDriverInMemoryConfig, DaffExternalRouterDriverInMemoryResolver };
36
+ export declare const provideDaffExternalRouterInMemoryDriver: (config?: DaffExternalRouterDriverInMemoryConfig | InjectionToken<DaffExternalRouterDriverInMemoryConfig>) => EnvironmentProviders;
@@ -1,25 +1,23 @@
1
- import { Apollo } from 'apollo-angular';
2
- import { Observable } from 'rxjs';
3
- import { DaffExternallyResolvableUrl } from '@daffodil/external-router';
4
- import { DaffExternalRouterDriverInterface } from '@daffodil/external-router/driver';
5
- import * as i0 from '@angular/core';
6
- import { ModuleWithProviders } from '@angular/core';
7
- import * as i1 from '@angular/common';
8
-
1
+ import { Apollo } from "apollo-angular";
2
+ import { Observable } from "rxjs";
3
+ import { DaffExternallyResolvableUrl } from "@daffodil/external-router";
4
+ import { DaffExternalRouterDriverInterface } from "@daffodil/external-router/driver";
5
+ import * as i0 from "@angular/core";
6
+ import { EnvironmentProviders, ModuleWithProviders } from "@angular/core";
7
+ import * as i1 from "@angular/common";
9
8
  /**
10
9
  * The DaffExternalRouterMagentoDriver is responsible for translating an
11
10
  * arbitrary URI into a DaffExternallyResolvableUrl with Magento environments.
12
11
  *
13
12
  * @inheritdoc
14
13
  */
15
- declare class DaffExternalRouterMagentoDriver implements DaffExternalRouterDriverInterface {
16
- private apollo;
17
- constructor(apollo: Apollo);
18
- resolve(url: string): Observable<DaffExternallyResolvableUrl>;
19
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffExternalRouterMagentoDriver, never>;
20
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffExternalRouterMagentoDriver>;
14
+ export declare class DaffExternalRouterMagentoDriver implements DaffExternalRouterDriverInterface {
15
+ private apollo;
16
+ constructor(apollo: Apollo);
17
+ resolve(url: string): Observable<DaffExternallyResolvableUrl>;
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffExternalRouterMagentoDriver, never>;
19
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
21
20
  }
22
-
23
21
  /**
24
22
  * The module used to configure the {@link DaffExternalRouterDriver} for usage with Magento.
25
23
  *
@@ -36,15 +34,21 @@ declare class DaffExternalRouterMagentoDriver implements DaffExternalRouterDrive
36
34
  * ```
37
35
  *
38
36
  * Note that this package depends upon ApolloClient, as the Magento driver uses GraphQl to make it's API calls.
37
+ *
38
+ * @deprecated prefer {@link provideDaffExternalRouterMagentoDriver}. Deprecated in version 0.95.0. Will be removed in version 0.98.0.
39
39
  */
40
- declare class DaffExternalRouterDriverMagentoModule {
41
- /**
42
- * Configures the package for the root injector.
43
- */
44
- static forRoot(): ModuleWithProviders<DaffExternalRouterDriverMagentoModule>;
45
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffExternalRouterDriverMagentoModule, never>;
46
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffExternalRouterDriverMagentoModule, never, [typeof i1.CommonModule], never>;
47
- static ɵinj: i0.ɵɵInjectorDeclaration<DaffExternalRouterDriverMagentoModule>;
40
+ export declare class DaffExternalRouterDriverMagentoModule {
41
+ /**
42
+ * Configures the package for the root injector.
43
+ */
44
+ static forRoot(): ModuleWithProviders<DaffExternalRouterDriverMagentoModule>;
45
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffExternalRouterDriverMagentoModule, never>;
46
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DaffExternalRouterDriverMagentoModule, never, [typeof i1.CommonModule], never>;
47
+ static ɵinj: i0.ɵɵInjectorDeclaration<DaffExternalRouterDriverMagentoModule>;
48
48
  }
49
-
50
- export { DaffExternalRouterDriverMagentoModule, DaffExternalRouterMagentoDriver };
49
+ /**
50
+ * Provides a Magento v2.4.1 implementation of {@link DaffExternalRouterDriver}.
51
+ *
52
+ * @deprecated This version of Magento is unsupported. Use `@daffodil/external-router/driver/magento/2.4.3` instead. Deprecated in version 0.95.0. Will be removed in version 0.98.0.
53
+ */
54
+ export declare const provideDaffExternalRouterMagentoDriver: () => EnvironmentProviders;
@@ -1,25 +1,23 @@
1
- import { Apollo } from 'apollo-angular';
2
- import { Observable } from 'rxjs';
3
- import { DaffExternallyResolvableUrl } from '@daffodil/external-router';
4
- import { DaffExternalRouterDriverInterface } from '@daffodil/external-router/driver';
5
- import * as i0 from '@angular/core';
6
- import { ModuleWithProviders } from '@angular/core';
7
- import * as i1 from '@angular/common';
8
-
1
+ import { Apollo } from "apollo-angular";
2
+ import { Observable } from "rxjs";
3
+ import { DaffExternallyResolvableUrl } from "@daffodil/external-router";
4
+ import { DaffExternalRouterDriverInterface } from "@daffodil/external-router/driver";
5
+ import * as i0 from "@angular/core";
6
+ import { EnvironmentProviders, ModuleWithProviders } from "@angular/core";
7
+ import * as i1 from "@angular/common";
9
8
  /**
10
9
  * The DaffExternalRouterMagentoDriver is responsible for translating an
11
10
  * arbitrary URI into a DaffExternallyResolvableUrl with Magento environments.
12
11
  *
13
12
  * @inheritdoc
14
13
  */
15
- declare class DaffExternalRouterMagentoDriver implements DaffExternalRouterDriverInterface {
16
- private apollo;
17
- constructor(apollo: Apollo);
18
- resolve(url: string): Observable<DaffExternallyResolvableUrl>;
19
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffExternalRouterMagentoDriver, never>;
20
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffExternalRouterMagentoDriver>;
14
+ export declare class DaffExternalRouterMagentoDriver implements DaffExternalRouterDriverInterface {
15
+ private apollo;
16
+ constructor(apollo: Apollo);
17
+ resolve(url: string): Observable<DaffExternallyResolvableUrl>;
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffExternalRouterMagentoDriver, never>;
19
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
21
20
  }
22
-
23
21
  /**
24
22
  * The module used to configure the {@link DaffExternalRouterDriver} for usage with Magento.
25
23
  *
@@ -36,15 +34,21 @@ declare class DaffExternalRouterMagentoDriver implements DaffExternalRouterDrive
36
34
  * ```
37
35
  *
38
36
  * Note that this package depends upon ApolloClient, as the Magento driver uses GraphQl to make it's API calls.
37
+ *
38
+ * @deprecated prefer {@link provideDaffExternalRouterMagentoDriver}. Deprecated in version 0.95.0. Will be removed in version 0.98.0.
39
39
  */
40
- declare class DaffExternalRouterDriverMagentoModule {
41
- /**
42
- * Configures the package for the root injector.
43
- */
44
- static forRoot(): ModuleWithProviders<DaffExternalRouterDriverMagentoModule>;
45
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffExternalRouterDriverMagentoModule, never>;
46
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffExternalRouterDriverMagentoModule, never, [typeof i1.CommonModule], never>;
47
- static ɵinj: i0.ɵɵInjectorDeclaration<DaffExternalRouterDriverMagentoModule>;
40
+ export declare class DaffExternalRouterDriverMagentoModule {
41
+ /**
42
+ * Configures the package for the root injector.
43
+ */
44
+ static forRoot(): ModuleWithProviders<DaffExternalRouterDriverMagentoModule>;
45
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffExternalRouterDriverMagentoModule, never>;
46
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DaffExternalRouterDriverMagentoModule, never, [typeof i1.CommonModule], never>;
47
+ static ɵinj: i0.ɵɵInjectorDeclaration<DaffExternalRouterDriverMagentoModule>;
48
48
  }
49
-
50
- export { DaffExternalRouterDriverMagentoModule, DaffExternalRouterMagentoDriver };
49
+ /**
50
+ * Provides a Magento v2.4.2 implementation of {@link DaffExternalRouterDriver}.
51
+ *
52
+ * @deprecated This version of Magento is unsupported. Use `@daffodil/external-router/driver/magento/2.4.3` instead. Deprecated in version 0.95.0. Will be removed in version 0.98.0.
53
+ */
54
+ export declare const provideDaffExternalRouterMagentoDriver: () => EnvironmentProviders;
@@ -1,26 +1,24 @@
1
- import { Apollo } from 'apollo-angular';
2
- import { Observable } from 'rxjs';
3
- import { DaffExternallyResolvableUrl } from '@daffodil/external-router';
4
- import { DaffExternalRouterDriverInterface } from '@daffodil/external-router/driver';
5
- import * as i0 from '@angular/core';
6
- import { ModuleWithProviders, EnvironmentProviders } from '@angular/core';
7
- import * as i1 from '@angular/common';
8
-
1
+ import { Apollo } from "apollo-angular";
2
+ import { Observable } from "rxjs";
3
+ import { DaffExternallyResolvableUrl } from "@daffodil/external-router";
4
+ import { DaffExternalRouterDriverInterface } from "@daffodil/external-router/driver";
5
+ import * as i0 from "@angular/core";
6
+ import { EnvironmentProviders, ModuleWithProviders } from "@angular/core";
7
+ import * as i1 from "@angular/common";
9
8
  /**
10
9
  * The DaffExternalRouterMagentoDriver is responsible for translating an
11
10
  * arbitrary URI into a DaffExternallyResolvableUrl with Magento environments.
12
11
  *
13
12
  * @inheritdoc
14
13
  */
15
- declare class DaffExternalRouterMagentoDriver implements DaffExternalRouterDriverInterface {
16
- private apollo;
17
- private document;
18
- constructor(apollo: Apollo, document: Document);
19
- resolve(url: string): Observable<DaffExternallyResolvableUrl>;
20
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffExternalRouterMagentoDriver, never>;
21
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffExternalRouterMagentoDriver>;
14
+ export declare class DaffExternalRouterMagentoDriver implements DaffExternalRouterDriverInterface {
15
+ private apollo;
16
+ private document;
17
+ constructor(apollo: Apollo, document: Document);
18
+ resolve(url: string): Observable<DaffExternallyResolvableUrl>;
19
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffExternalRouterMagentoDriver, never>;
20
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
22
21
  }
23
-
24
22
  /**
25
23
  * The module used to configure the {@link DaffExternalRouterDriver} for usage with Magento.
26
24
  *
@@ -37,20 +35,19 @@ declare class DaffExternalRouterMagentoDriver implements DaffExternalRouterDrive
37
35
  * ```
38
36
  *
39
37
  * Note that this package depends upon ApolloClient, as the Magento driver uses GraphQl to make it's API calls.
38
+ *
39
+ * @deprecated prefer {@link provideDaffExternalRouterMagentoDriver}. Deprecated in version 0.95.0. Will be removed in version 0.98.0.
40
40
  */
41
- declare class DaffExternalRouterDriverMagentoModule {
42
- /**
43
- * Configures the package for the root injector.
44
- */
45
- static forRoot(): ModuleWithProviders<DaffExternalRouterDriverMagentoModule>;
46
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffExternalRouterDriverMagentoModule, never>;
47
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffExternalRouterDriverMagentoModule, never, [typeof i1.CommonModule], never>;
48
- static ɵinj: i0.ɵɵInjectorDeclaration<DaffExternalRouterDriverMagentoModule>;
41
+ export declare class DaffExternalRouterDriverMagentoModule {
42
+ /**
43
+ * Configures the package for the root injector.
44
+ */
45
+ static forRoot(): ModuleWithProviders<DaffExternalRouterDriverMagentoModule>;
46
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffExternalRouterDriverMagentoModule, never>;
47
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DaffExternalRouterDriverMagentoModule, never, [typeof i1.CommonModule], never>;
48
+ static ɵinj: i0.ɵɵInjectorDeclaration<DaffExternalRouterDriverMagentoModule>;
49
49
  }
50
-
51
50
  /**
52
51
  * Provides a Magento implementation of {@link DaffExternalRouterDriver}.
53
52
  */
54
- declare const provideDaffExternalRouterMagentoDriver: () => EnvironmentProviders;
55
-
56
- export { DaffExternalRouterDriverMagentoModule, DaffExternalRouterMagentoDriver, provideDaffExternalRouterMagentoDriver };
53
+ export declare const provideDaffExternalRouterMagentoDriver: () => EnvironmentProviders;