@daffodil/external-router 0.51.0 → 0.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/driver/testing/testing.service.mjs +2 -2
- package/fesm2015/daffodil-external-router-driver-testing.mjs +1 -1
- package/fesm2015/daffodil-external-router-driver-testing.mjs.map +1 -1
- package/fesm2020/daffodil-external-router-driver-testing.mjs +1 -1
- package/fesm2020/daffodil-external-router-driver-testing.mjs.map +1 -1
- package/package.json +3 -3
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Injectable, Inject, } from '@angular/core';
|
2
|
-
import
|
2
|
+
import { faker } from '@faker-js/faker';
|
3
3
|
import { of, throwError, } from 'rxjs';
|
4
4
|
import { daffUriTruncateLeadingSlash, daffUriTruncateQueryFragment, } from '@daffodil/core/routing';
|
5
5
|
import { DAFF_EXTERNAL_ROUTER_DRIVER_TESTING_CONFIG, } from './config';
|
@@ -42,4 +42,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
|
|
42
42
|
type: Inject,
|
43
43
|
args: [DAFF_EXTERNAL_ROUTER_DRIVER_TESTING_CONFIG]
|
44
44
|
}] }]; } });
|
45
|
-
//# sourceMappingURL=data:application/json;base64,
|
45
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdGluZy5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vbGlicy9leHRlcm5hbC1yb3V0ZXIvZHJpdmVyL3Rlc3Rpbmcvc3JjL3Rlc3Rpbmcuc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQ0wsVUFBVSxFQUNWLE1BQU0sR0FDUCxNQUFNLGVBQWUsQ0FBQztBQUN2QixPQUFPLEVBQUUsS0FBSyxFQUFFLE1BQU0saUJBQWlCL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LFxuICAgICAgdHlwZTogdGhpcy50ZXN0aW5nQ29uZmlndXJhdGlvblt0cnVuY2F0ZWRVcmxdLFxuICAgICAgY29kZTogMjAwLFxuICAgIH0pO1xuICB9XG59XG4iXX0=
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as i0 from '@angular/core';
|
2
2
|
import { InjectionToken, Injectable, Inject, NgModule } from '@angular/core';
|
3
|
-
import
|
3
|
+
import { faker } from '@faker-js/faker';
|
4
4
|
import { throwError, of } from 'rxjs';
|
5
5
|
import { daffUriTruncateLeadingSlash, daffUriTruncateQueryFragment } from '@daffodil/core/routing';
|
6
6
|
import { CommonModule } from '@angular/common';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"daffodil-external-router-driver-testing.mjs","sources":["../../../libs/external-router/driver/testing/src/config.ts","../../../libs/external-router/driver/testing/src/testing.service.ts","../../../libs/external-router/driver/testing/src/testing.module.ts","../../../libs/external-router/driver/testing/src/public_api.ts","../../../libs/external-router/driver/testing/src/daffodil-external-router-driver-testing.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nimport { DaffExternalRouteType } from '@daffodil/external-router';\n\n/**\n * The configuration for the testing driver. It is a dictionary of \"url\": \"type\",\n * pairs, where the URL is a URL-safe routeable path, e.g. \"sweatshirts\" or \"t-shirts\"\n * and the type is a known type to your application, e.g. \"CATEGORY\".\n */\nexport interface DaffExternalRouterDriverTestingConfig {\n [url: string]: DaffExternalRouteType;\n}\n\n/**\n * The token used by Daffodil to hold the driver's configuration.\n *\n * @docs-private\n */\nexport const DAFF_EXTERNAL_ROUTER_DRIVER_TESTING_CONFIG = new InjectionToken<\nDaffExternalRouterDriverTestingConfig\n>('DAFF_EXTERNAL_ROUTER_DRIVER_TESTING_CONFIG', {\n providedIn: 'root',\n factory: () => ({}),\n});\n","import {\n Injectable,\n Inject,\n} from '@angular/core';\nimport
|
1
|
+
{"version":3,"file":"daffodil-external-router-driver-testing.mjs","sources":["../../../libs/external-router/driver/testing/src/config.ts","../../../libs/external-router/driver/testing/src/testing.service.ts","../../../libs/external-router/driver/testing/src/testing.module.ts","../../../libs/external-router/driver/testing/src/public_api.ts","../../../libs/external-router/driver/testing/src/daffodil-external-router-driver-testing.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nimport { DaffExternalRouteType } from '@daffodil/external-router';\n\n/**\n * The configuration for the testing driver. It is a dictionary of \"url\": \"type\",\n * pairs, where the URL is a URL-safe routeable path, e.g. \"sweatshirts\" or \"t-shirts\"\n * and the type is a known type to your application, e.g. \"CATEGORY\".\n */\nexport interface DaffExternalRouterDriverTestingConfig {\n [url: string]: DaffExternalRouteType;\n}\n\n/**\n * The token used by Daffodil to hold the driver's configuration.\n *\n * @docs-private\n */\nexport const DAFF_EXTERNAL_ROUTER_DRIVER_TESTING_CONFIG = new InjectionToken<\nDaffExternalRouterDriverTestingConfig\n>('DAFF_EXTERNAL_ROUTER_DRIVER_TESTING_CONFIG', {\n providedIn: 'root',\n factory: () => ({}),\n});\n","import {\n Injectable,\n Inject,\n} from '@angular/core';\nimport { faker } from '@faker-js/faker';\nimport {\n Observable,\n of,\n throwError,\n} from 'rxjs';\n\nimport {\n daffUriTruncateLeadingSlash,\n daffUriTruncateQueryFragment,\n} from '@daffodil/core/routing';\nimport { DaffExternallyResolvableUrl } from '@daffodil/external-router';\nimport { DaffExternalRouterDriverInterface } from '@daffodil/external-router/driver';\n\nimport {\n DaffExternalRouterDriverTestingConfig,\n DAFF_EXTERNAL_ROUTER_DRIVER_TESTING_CONFIG,\n} from './config';\n\n/**\n * The DaffExternalRouterTestingDriver is responsible for translating an\n * arbitrary URI into a DaffExternallyResolvableUrl in testing environments.\n *\n * @inheritdoc\n *\n * @see {@link DaffExternalRouterTestingDriver}\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffExternalRouterTestingDriver\nimplements DaffExternalRouterDriverInterface {\n constructor(\n @Inject(DAFF_EXTERNAL_ROUTER_DRIVER_TESTING_CONFIG)\n private testingConfiguration: DaffExternalRouterDriverTestingConfig = {},\n ) {}\n\n resolve(url: string): Observable<DaffExternallyResolvableUrl> {\n const truncatedUrl = daffUriTruncateLeadingSlash(daffUriTruncateQueryFragment(url));\n\n if (!this.testingConfiguration[truncatedUrl]) {\n return throwError(`\\\nThe route '${truncatedUrl}' wasn't provided with a matching type by the testing driver. \\\nDid you configure the available route types with DaffExternalRouterDriverTestingModule.forRoot(config)`);\n }\n\n return of({\n id: faker.datatype.uuid(),\n url: truncatedUrl,\n type: this.testingConfiguration[truncatedUrl],\n code: 200,\n });\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { DaffExternalRouterDriver } from '@daffodil/external-router/driver';\n\nimport {\n DaffExternalRouterDriverTestingConfig,\n DAFF_EXTERNAL_ROUTER_DRIVER_TESTING_CONFIG,\n} from './config';\nimport { DaffExternalRouterTestingDriver } from './testing.service';\n\n/**\n * The `DaffExternalRouterDriverTestingModule` is an importable NgModule that can\n * be used to configure the {@link DaffExternalRouterTestingDriver}.\n */\n@NgModule({\n declarations: [],\n imports: [CommonModule],\n})\nexport class DaffExternalRouterDriverTestingModule {\n static forRoot(\n config: DaffExternalRouterDriverTestingConfig,\n ): ModuleWithProviders<DaffExternalRouterDriverTestingModule> {\n return {\n ngModule: DaffExternalRouterDriverTestingModule,\n providers: [\n {\n provide: DaffExternalRouterDriver,\n useExisting: DaffExternalRouterTestingDriver,\n },\n {\n provide: DAFF_EXTERNAL_ROUTER_DRIVER_TESTING_CONFIG,\n useValue: config,\n },\n ],\n };\n }\n}\n","/*\n * Public API Surface of @daffodil/external-router/driver/testing\n */\n\nexport { DaffExternalRouterTestingDriver } from './testing.service';\nexport { DaffExternalRouterDriverTestingModule } from './testing.module';\n\nexport { DaffExternalRouterDriverTestingConfig } from './config';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAaA;;;;AAIG;AACI,MAA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, NgModule } from '@angular/core';
|
3
|
-
import
|
3
|
+
import { faker } from '@faker-js/faker';
|
4
4
|
import { throwError, of } from 'rxjs';
|
5
5
|
import { daffUriTruncateLeadingSlash, daffUriTruncateQueryFragment } from '@daffodil/core/routing';
|
6
6
|
import { CommonModule } from '@angular/common';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"daffodil-external-router-driver-testing.mjs","sources":["../../../libs/external-router/driver/testing/src/config.ts","../../../libs/external-router/driver/testing/src/testing.service.ts","../../../libs/external-router/driver/testing/src/testing.module.ts","../../../libs/external-router/driver/testing/src/public_api.ts","../../../libs/external-router/driver/testing/src/daffodil-external-router-driver-testing.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nimport { DaffExternalRouteType } from '@daffodil/external-router';\n\n/**\n * The configuration for the testing driver. It is a dictionary of \"url\": \"type\",\n * pairs, where the URL is a URL-safe routeable path, e.g. \"sweatshirts\" or \"t-shirts\"\n * and the type is a known type to your application, e.g. \"CATEGORY\".\n */\nexport interface DaffExternalRouterDriverTestingConfig {\n [url: string]: DaffExternalRouteType;\n}\n\n/**\n * The token used by Daffodil to hold the driver's configuration.\n *\n * @docs-private\n */\nexport const DAFF_EXTERNAL_ROUTER_DRIVER_TESTING_CONFIG = new InjectionToken<\nDaffExternalRouterDriverTestingConfig\n>('DAFF_EXTERNAL_ROUTER_DRIVER_TESTING_CONFIG', {\n providedIn: 'root',\n factory: () => ({}),\n});\n","import {\n Injectable,\n Inject,\n} from '@angular/core';\nimport
|
1
|
+
{"version":3,"file":"daffodil-external-router-driver-testing.mjs","sources":["../../../libs/external-router/driver/testing/src/config.ts","../../../libs/external-router/driver/testing/src/testing.service.ts","../../../libs/external-router/driver/testing/src/testing.module.ts","../../../libs/external-router/driver/testing/src/public_api.ts","../../../libs/external-router/driver/testing/src/daffodil-external-router-driver-testing.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nimport { DaffExternalRouteType } from '@daffodil/external-router';\n\n/**\n * The configuration for the testing driver. It is a dictionary of \"url\": \"type\",\n * pairs, where the URL is a URL-safe routeable path, e.g. \"sweatshirts\" or \"t-shirts\"\n * and the type is a known type to your application, e.g. \"CATEGORY\".\n */\nexport interface DaffExternalRouterDriverTestingConfig {\n [url: string]: DaffExternalRouteType;\n}\n\n/**\n * The token used by Daffodil to hold the driver's configuration.\n *\n * @docs-private\n */\nexport const DAFF_EXTERNAL_ROUTER_DRIVER_TESTING_CONFIG = new InjectionToken<\nDaffExternalRouterDriverTestingConfig\n>('DAFF_EXTERNAL_ROUTER_DRIVER_TESTING_CONFIG', {\n providedIn: 'root',\n factory: () => ({}),\n});\n","import {\n Injectable,\n Inject,\n} from '@angular/core';\nimport { faker } from '@faker-js/faker';\nimport {\n Observable,\n of,\n throwError,\n} from 'rxjs';\n\nimport {\n daffUriTruncateLeadingSlash,\n daffUriTruncateQueryFragment,\n} from '@daffodil/core/routing';\nimport { DaffExternallyResolvableUrl } from '@daffodil/external-router';\nimport { DaffExternalRouterDriverInterface } from '@daffodil/external-router/driver';\n\nimport {\n DaffExternalRouterDriverTestingConfig,\n DAFF_EXTERNAL_ROUTER_DRIVER_TESTING_CONFIG,\n} from './config';\n\n/**\n * The DaffExternalRouterTestingDriver is responsible for translating an\n * arbitrary URI into a DaffExternallyResolvableUrl in testing environments.\n *\n * @inheritdoc\n *\n * @see {@link DaffExternalRouterTestingDriver}\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffExternalRouterTestingDriver\nimplements DaffExternalRouterDriverInterface {\n constructor(\n @Inject(DAFF_EXTERNAL_ROUTER_DRIVER_TESTING_CONFIG)\n private testingConfiguration: DaffExternalRouterDriverTestingConfig = {},\n ) {}\n\n resolve(url: string): Observable<DaffExternallyResolvableUrl> {\n const truncatedUrl = daffUriTruncateLeadingSlash(daffUriTruncateQueryFragment(url));\n\n if (!this.testingConfiguration[truncatedUrl]) {\n return throwError(`\\\nThe route '${truncatedUrl}' wasn't provided with a matching type by the testing driver. \\\nDid you configure the available route types with DaffExternalRouterDriverTestingModule.forRoot(config)`);\n }\n\n return of({\n id: faker.datatype.uuid(),\n url: truncatedUrl,\n type: this.testingConfiguration[truncatedUrl],\n code: 200,\n });\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { DaffExternalRouterDriver } from '@daffodil/external-router/driver';\n\nimport {\n DaffExternalRouterDriverTestingConfig,\n DAFF_EXTERNAL_ROUTER_DRIVER_TESTING_CONFIG,\n} from './config';\nimport { DaffExternalRouterTestingDriver } from './testing.service';\n\n/**\n * The `DaffExternalRouterDriverTestingModule` is an importable NgModule that can\n * be used to configure the {@link DaffExternalRouterTestingDriver}.\n */\n@NgModule({\n declarations: [],\n imports: [CommonModule],\n})\nexport class DaffExternalRouterDriverTestingModule {\n static forRoot(\n config: DaffExternalRouterDriverTestingConfig,\n ): ModuleWithProviders<DaffExternalRouterDriverTestingModule> {\n return {\n ngModule: DaffExternalRouterDriverTestingModule,\n providers: [\n {\n provide: DaffExternalRouterDriver,\n useExisting: DaffExternalRouterTestingDriver,\n },\n {\n provide: DAFF_EXTERNAL_ROUTER_DRIVER_TESTING_CONFIG,\n useValue: config,\n },\n ],\n };\n }\n}\n","/*\n * Public API Surface of @daffodil/external-router/driver/testing\n */\n\nexport { DaffExternalRouterTestingDriver } from './testing.service';\nexport { DaffExternalRouterDriverTestingModule } from './testing.module';\n\nexport { DaffExternalRouterDriverTestingConfig } from './config';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAaA;;;;AAIG;AACI,MAAM,0CAA0C,GAAG,IAAI,cAAc,CAE1E,4CAA4C,EAAE;AAC9C,IAAA,UAAU,EAAE,MAAM;AAClB,IAAA,OAAO,EAAE,OAAO,EAAE,CAAC;AACpB,CAAA,CAAC;;ACAF;;;;;;;AAOG;MAIU,+BAA+B,CAAA;AAE1C,IAAA,WAAA,CAEU,uBAA8D,EAAE,E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,qCAAqC,CAAA;IAChD,OAAO,OAAO,CACZ,MAA6C,EAAA;QAE7C,OAAO;AACL,YAAA,QAAQ,EAAE,qCAAqC;AAC/C,YAAA,SAAS,EAAE;AACT,gBAAA;AACE,oBAAA,OAAO,EAAE,wBAAwB;AACjC,oBAAA,WAAW,EAAE,+BAA+B;AAC7C,iBAAA;AACD,gBAAA;AACE,oBAAA,OAAO,EAAE,0CAA0C;AACnD,oBAAA,QAAQ,EAAE,MAAM;AACjB,iBAAA;AACF,aAAA;SACF,CAAC;KACH;;qJAjBU,qCAAqC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAArC,mBAAA,qCAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qCAAqC,YAFtC,YAAY,CAAA,EAAA,CAAA,CAAA;sJAEX,qCAAqC,EAAA,OAAA,EAAA,CAFvC,CAAC,YAAY,CAAC,CAAA,EAAA,CAAA,CAAA;2FAEZ,qCAAqC,EAAA,UAAA,EAAA,CAAA;kBAJjD,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,EAAE;oBAChB,OAAO,EAAE,CAAC,YAAY,CAAC;AACxB,iBAAA,CAAA;;;ACrBD;;AAEG;;ACFH;;AAEG;;;;"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@daffodil/external-router",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.53.0",
|
4
4
|
"description": "A platform-agnostic package that connects the @angular/router with an external routing service (e.g. an API), allowing for runtime route resolution.",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -16,12 +16,12 @@
|
|
16
16
|
"@angular/common": "^13.0.0",
|
17
17
|
"@angular/core": "^13.0.0",
|
18
18
|
"@angular/router": "^13.0.0",
|
19
|
-
"@daffodil/core": "0.
|
19
|
+
"@daffodil/core": "0.53.0",
|
20
20
|
"rxjs": "7.5.5"
|
21
21
|
},
|
22
22
|
"optionalDependencies": {
|
23
23
|
"apollo-angular": "^3.0.1",
|
24
|
-
"@daffodil/driver": "0.
|
24
|
+
"@daffodil/driver": "0.53.0"
|
25
25
|
},
|
26
26
|
"module": "fesm2015/daffodil-external-router.mjs",
|
27
27
|
"es2020": "fesm2020/daffodil-external-router.mjs",
|