@daffodil/geography 0.94.1-rc.0 → 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 (31) hide show
  1. package/fesm2022/daffodil-geography-driver-in-memory.mjs +161 -121
  2. package/fesm2022/daffodil-geography-driver-in-memory.mjs.map +1 -1
  3. package/fesm2022/daffodil-geography-driver-magento-2.4.7.mjs +246 -0
  4. package/fesm2022/daffodil-geography-driver-magento-2.4.7.mjs.map +1 -0
  5. package/fesm2022/daffodil-geography-driver-magento-auto.mjs +7 -0
  6. package/fesm2022/daffodil-geography-driver-magento-auto.mjs.map +1 -0
  7. package/fesm2022/daffodil-geography-driver-testing.mjs +100 -61
  8. package/fesm2022/daffodil-geography-driver-testing.mjs.map +1 -1
  9. package/fesm2022/daffodil-geography-driver.mjs +18 -29
  10. package/fesm2022/daffodil-geography-driver.mjs.map +1 -1
  11. package/fesm2022/daffodil-geography-state-testing.mjs +98 -57
  12. package/fesm2022/daffodil-geography-state-testing.mjs.map +1 -1
  13. package/fesm2022/daffodil-geography-state.mjs +275 -275
  14. package/fesm2022/daffodil-geography-state.mjs.map +1 -1
  15. package/fesm2022/daffodil-geography-testing.mjs +190 -107
  16. package/fesm2022/daffodil-geography-testing.mjs.map +1 -1
  17. package/fesm2022/daffodil-geography.mjs +21 -43
  18. package/fesm2022/daffodil-geography.mjs.map +1 -1
  19. package/package.json +1 -1
  20. package/types/daffodil-geography-driver-in-memory.d.ts +51 -49
  21. package/types/daffodil-geography-driver-magento-2.4.7.d.ts +86 -0
  22. package/types/daffodil-geography-driver-magento-auto.d.ts +1 -0
  23. package/types/daffodil-geography-driver-testing.d.ts +28 -25
  24. package/types/daffodil-geography-driver.d.ts +22 -30
  25. package/types/daffodil-geography-state-testing.d.ts +33 -29
  26. package/types/daffodil-geography-state.d.ts +124 -139
  27. package/types/daffodil-geography-testing.d.ts +56 -63
  28. package/types/daffodil-geography.d.ts +37 -46
  29. package/fesm2022/daffodil-geography-driver-magento.mjs +0 -196
  30. package/fesm2022/daffodil-geography-driver-magento.mjs.map +0 -1
  31. package/types/daffodil-geography-driver-magento.d.ts +0 -95
@@ -1,62 +1,101 @@
1
- import { CommonModule } from '@angular/common';
2
- import * as i0 from '@angular/core';
3
- import { Injectable, NgModule } from '@angular/core';
4
- import { provideDaffGeographyDriver } from '@daffodil/geography/driver';
5
- import { of } from 'rxjs';
6
- import * as i1 from '@daffodil/geography/testing';
1
+ import { CommonModule } from "@angular/common";
2
+ import * as i0 from "@angular/core";
3
+ import { Injectable, NgModule, makeEnvironmentProviders } from "@angular/core";
4
+ import { provideDaffGeographyDriver } from "@daffodil/geography/driver";
5
+ import { of } from "rxjs";
6
+ import * as i1 from "@daffodil/geography/testing";
7
+ var DaffTestingGeographyService = class DaffTestingGeographyService {
8
+ constructor(countryFactory, subdivisionFactory) {
9
+ this.countryFactory = countryFactory;
10
+ this.subdivisionFactory = subdivisionFactory;
11
+ }
12
+ get(countryId) {
13
+ return of(this.countryFactory.create({
14
+ id: countryId,
15
+ subdivisions: this.subdivisionFactory.createMany(3)
16
+ }));
17
+ }
18
+ list() {
19
+ return of(this.countryFactory.createMany(5));
20
+ }
21
+ static {
22
+ this.ɵfac = i0.ɵɵngDeclareFactory({
23
+ minVersion: "12.0.0",
24
+ version: "22.2.4",
25
+ ngImport: i0,
26
+ type: DaffTestingGeographyService,
27
+ deps: [{ token: i1.DaffCountryFactory }, { token: i1.DaffSubdivisionFactory }],
28
+ target: i0.ɵɵFactoryTarget.Injectable
29
+ });
30
+ }
31
+ static {
32
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
33
+ minVersion: "12.0.0",
34
+ version: "22.2.4",
35
+ ngImport: i0,
36
+ type: DaffTestingGeographyService,
37
+ providedIn: "root"
38
+ });
39
+ }
40
+ };
41
+ i0.ɵɵngDeclareClassMetadata({
42
+ minVersion: "12.0.0",
43
+ version: "22.2.4",
44
+ ngImport: i0,
45
+ type: DaffTestingGeographyService,
46
+ decorators: [{
47
+ type: Injectable,
48
+ args: [{ providedIn: "root" }]
49
+ }],
50
+ ctorParameters: () => [{ type: i1.DaffCountryFactory }, { type: i1.DaffSubdivisionFactory }]
51
+ });
52
+ const provideDaffGeographyTestingDriver = () => makeEnvironmentProviders([provideDaffGeographyDriver(DaffTestingGeographyService)]);
53
+ var DaffGeographyTestingDriverModule = class DaffGeographyTestingDriverModule {
54
+ static forRoot() {
55
+ return {
56
+ ngModule: DaffGeographyTestingDriverModule,
57
+ providers: [provideDaffGeographyTestingDriver()]
58
+ };
59
+ }
60
+ static {
61
+ this.ɵfac = i0.ɵɵngDeclareFactory({
62
+ minVersion: "12.0.0",
63
+ version: "22.2.4",
64
+ ngImport: i0,
65
+ type: DaffGeographyTestingDriverModule,
66
+ deps: [],
67
+ target: i0.ɵɵFactoryTarget.NgModule
68
+ });
69
+ }
70
+ static {
71
+ this.ɵmod = i0.ɵɵngDeclareNgModule({
72
+ minVersion: "14.0.0",
73
+ version: "22.2.4",
74
+ ngImport: i0,
75
+ type: DaffGeographyTestingDriverModule,
76
+ imports: [CommonModule]
77
+ });
78
+ }
79
+ static {
80
+ this.ɵinj = i0.ɵɵngDeclareInjector({
81
+ minVersion: "12.0.0",
82
+ version: "22.2.4",
83
+ ngImport: i0,
84
+ type: DaffGeographyTestingDriverModule,
85
+ imports: [CommonModule]
86
+ });
87
+ }
88
+ };
89
+ i0.ɵɵngDeclareClassMetadata({
90
+ minVersion: "12.0.0",
91
+ version: "22.2.4",
92
+ ngImport: i0,
93
+ type: DaffGeographyTestingDriverModule,
94
+ decorators: [{
95
+ type: NgModule,
96
+ args: [{ imports: [CommonModule] }]
97
+ }]
98
+ });
99
+ export { DaffGeographyTestingDriverModule, DaffTestingGeographyService, provideDaffGeographyTestingDriver };
7
100
 
8
- /**
9
- * @inheritdoc
10
- */
11
- class DaffTestingGeographyService {
12
- constructor(countryFactory, subdivisionFactory) {
13
- this.countryFactory = countryFactory;
14
- this.subdivisionFactory = subdivisionFactory;
15
- }
16
- get(countryId) {
17
- return of(this.countryFactory.create({
18
- id: countryId,
19
- subdivisions: this.subdivisionFactory.createMany(3),
20
- }));
21
- }
22
- list() {
23
- return of(this.countryFactory.createMany(5));
24
- }
25
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffTestingGeographyService, deps: [{ token: i1.DaffCountryFactory }, { token: i1.DaffSubdivisionFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
26
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffTestingGeographyService, providedIn: 'root' }); }
27
- }
28
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffTestingGeographyService, decorators: [{
29
- type: Injectable,
30
- args: [{
31
- providedIn: 'root',
32
- }]
33
- }], ctorParameters: () => [{ type: i1.DaffCountryFactory }, { type: i1.DaffSubdivisionFactory }] });
34
-
35
- class DaffGeographyTestingDriverModule {
36
- static forRoot() {
37
- return {
38
- ngModule: DaffGeographyTestingDriverModule,
39
- providers: [
40
- provideDaffGeographyDriver(DaffTestingGeographyService),
41
- ],
42
- };
43
- }
44
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffGeographyTestingDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
45
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: DaffGeographyTestingDriverModule, imports: [CommonModule] }); }
46
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffGeographyTestingDriverModule, imports: [CommonModule] }); }
47
- }
48
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffGeographyTestingDriverModule, decorators: [{
49
- type: NgModule,
50
- args: [{
51
- imports: [
52
- CommonModule,
53
- ],
54
- }]
55
- }] });
56
-
57
- /**
58
- * Generated bundle index. Do not edit.
59
- */
60
-
61
- export { DaffGeographyTestingDriverModule, DaffTestingGeographyService };
62
- //# sourceMappingURL=daffodil-geography-driver-testing.mjs.map
101
+ //# sourceMappingURL=daffodil-geography-driver-testing.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-geography-driver-testing.mjs","sources":["../../../libs/geography/driver/testing/src/drivers/geography.service.ts","../../../libs/geography/driver/testing/src/drivers/geography-driver.module.ts","../../../libs/geography/driver/testing/src/daffodil-geography-driver-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n Observable,\n of,\n} from 'rxjs';\n\nimport { DaffCountry } from '@daffodil/geography';\nimport { DaffGeographyServiceInterface } from '@daffodil/geography/driver';\nimport {\n DaffCountryFactory,\n DaffSubdivisionFactory,\n} from '@daffodil/geography/testing';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffTestingGeographyService implements DaffGeographyServiceInterface<DaffCountry> {\n\n constructor(\n private countryFactory: DaffCountryFactory,\n private subdivisionFactory: DaffSubdivisionFactory,\n ) {}\n\n get(countryId: DaffCountry['id']): Observable<DaffCountry> {\n return of(this.countryFactory.create({\n id: countryId,\n subdivisions: this.subdivisionFactory.createMany(3),\n }));\n }\n\n list(): Observable<DaffCountry[]> {\n return of(this.countryFactory.createMany(5));\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { provideDaffGeographyDriver } from '@daffodil/geography/driver';\n\nimport { DaffTestingGeographyService } from './geography.service';\n\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffGeographyTestingDriverModule {\n static forRoot(): ModuleWithProviders<DaffGeographyTestingDriverModule> {\n return {\n ngModule: DaffGeographyTestingDriverModule,\n providers: [\n provideDaffGeographyDriver(DaffTestingGeographyService),\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAaA;;AAEG;MAIU,2BAA2B,CAAA;IAEtC,WAAA,CACU,cAAkC,EAClC,kBAA0C,EAAA;QAD1C,IAAA,CAAA,cAAc,GAAd,cAAc;QACd,IAAA,CAAA,kBAAkB,GAAlB,kBAAkB;IACzB;AAEH,IAAA,GAAG,CAAC,SAA4B,EAAA;AAC9B,QAAA,OAAO,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC;AACnC,YAAA,EAAE,EAAE,SAAS;YACb,YAAY,EAAE,IAAI,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC,CAAC;AACpD,SAAA,CAAC,CAAC;IACL;IAEA,IAAI,GAAA;QACF,OAAO,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAC9C;iIAhBW,2BAA2B,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,kBAAA,EAAA,EAAA,EAAA,KAAA,EAAA,EAAA,CAAA,sBAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA3B,uBAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,2BAA2B,cAF1B,MAAM,EAAA,CAAA,CAAA;;2FAEP,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBAHvC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;MCHY,gCAAgC,CAAA;AAC3C,IAAA,OAAO,OAAO,GAAA;QACZ,OAAO;AACL,YAAA,QAAQ,EAAE,gCAAgC;AAC1C,YAAA,SAAS,EAAE;gBACT,0BAA0B,CAAC,2BAA2B,CAAC;AACxD,aAAA;SACF;IACH;iIARW,gCAAgC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAhC,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gCAAgC,YAHzC,YAAY,CAAA,EAAA,CAAA,CAAA;AAGH,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gCAAgC,YAHzC,YAAY,CAAA,EAAA,CAAA,CAAA;;2FAGH,gCAAgC,EAAA,UAAA,EAAA,CAAA;kBAL5C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACF,iBAAA;;;ACdD;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-geography-driver-testing.mjs","names":[],"sources":["../../../libs/geography/driver/testing/src/drivers/geography.service.ts","../../../libs/geography/driver/testing/src/drivers/provider.ts","../../../libs/geography/driver/testing/src/drivers/geography-driver.module.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n Observable,\n of,\n} from 'rxjs';\n\nimport { DaffCountry } from '@daffodil/geography';\nimport { DaffGeographyServiceInterface } from '@daffodil/geography/driver';\nimport {\n DaffCountryFactory,\n DaffSubdivisionFactory,\n} from '@daffodil/geography/testing';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffTestingGeographyService implements DaffGeographyServiceInterface<DaffCountry> {\n\n constructor(\n private countryFactory: DaffCountryFactory,\n private subdivisionFactory: DaffSubdivisionFactory,\n ) {}\n\n get(countryId: DaffCountry['id']): Observable<DaffCountry> {\n return of(this.countryFactory.create({\n id: countryId,\n subdivisions: this.subdivisionFactory.createMany(3),\n }));\n }\n\n list(): Observable<DaffCountry[]> {\n return of(this.countryFactory.createMany(5));\n }\n}\n","import {\n EnvironmentProviders,\n makeEnvironmentProviders,\n} from '@angular/core';\n\nimport { provideDaffGeographyDriver } from '@daffodil/geography/driver';\n\nimport { DaffTestingGeographyService } from './geography.service';\n\n/**\n * Provides the testing implementation of the `@daffodil/geography/driver` interfaces.\n */\nexport const provideDaffGeographyTestingDriver = (): EnvironmentProviders => makeEnvironmentProviders([\n provideDaffGeographyDriver(DaffTestingGeographyService),\n]);\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { provideDaffGeographyTestingDriver } from './provider';\n\n/**\n * @deprecated in favor of {@link provideDaffGeographyTestingDriver} Deprecated in version 0.95.0. Will be removed in version 0.98.0.\n */\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffGeographyTestingDriverModule {\n static forRoot(): ModuleWithProviders<DaffGeographyTestingDriverModule> {\n return {\n ngModule: DaffGeographyTestingDriverModule,\n providers: [\n provideDaffGeographyTestingDriver(),\n ],\n };\n }\n}\n"],"mappings":";;;;;;AAmBA,IAAa,8BAAb,MAAa,4BAA2B;CAEtC,YACU,gBACA,oBAA0C;EAD1C,KAAA,iBAAA;EACA,KAAA,qBAAA;CACP;CAEH,IAAI,WAA4B;EAC9B,OAAO,GAAG,KAAK,eAAe,OAAO;GACnC,IAAI;GACJ,cAAc,KAAK,mBAAmB,WAAW,CAAC;EACnD,CAAA,CAAC;CACJ;CAEA,OAAI;EACF,OAAO,GAAG,KAAK,eAAe,WAAW,CAAC,CAAC;CAC7C;CAhBW;EAAA,KAAA,OAAA,GAAA,mBAAA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odil/core';
2
-
3
- class DaffCountryNotFoundError extends DaffInheritableError {
4
- constructor(message) {
5
- super(message);
6
- this.message = message;
7
- this.code = 'DAFF_GEOGRAPHY_COUNTRY_NOT_FOUND';
8
- }
9
- }
10
-
11
- class DaffGeographyInvalidAPIResponseError extends DaffInheritableError {
12
- constructor(message) {
13
- super(message);
14
- this.message = message;
15
- this.code = 'DAFF_GEOGRAPHY_INVALID_API_RESPONSE';
16
- }
17
- }
18
-
19
- const { token: DaffGeographyDriver,
20
- /**
21
- * Provider function for {@link DaffGeographyDriver}.
22
- */
23
- provider: provideDaffGeographyDriver, } = createSingletonInjectionToken('DaffGeographyDriver');
24
-
25
- /**
26
- * Generated bundle index. Do not edit.
27
- */
28
-
1
+ import { DaffInheritableError, createSingletonInjectionToken } from "@daffodil/core";
2
+ var DaffCountryNotFoundError = class extends DaffInheritableError {
3
+ constructor(message) {
4
+ super(message);
5
+ this.message = message;
6
+ this.code = "DAFF_GEOGRAPHY_COUNTRY_NOT_FOUND";
7
+ }
8
+ };
9
+ var DaffGeographyInvalidAPIResponseError = class extends DaffInheritableError {
10
+ constructor(message) {
11
+ super(message);
12
+ this.message = message;
13
+ this.code = "DAFF_GEOGRAPHY_INVALID_API_RESPONSE";
14
+ }
15
+ };
16
+ const { token: DaffGeographyDriver, provider: provideDaffGeographyDriver } = createSingletonInjectionToken("DaffGeographyDriver");
29
17
  export { DaffCountryNotFoundError, DaffGeographyDriver, DaffGeographyInvalidAPIResponseError, provideDaffGeographyDriver };
30
- //# sourceMappingURL=daffodil-geography-driver.mjs.map
18
+
19
+ //# sourceMappingURL=daffodil-geography-driver.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-geography-driver.mjs","sources":["../../../libs/geography/driver/src/errors/country-not-found.ts","../../../libs/geography/driver/src/errors/invalid-api-response.ts","../../../libs/geography/driver/src/interfaces/geography-service.interface.ts","../../../libs/geography/driver/src/daffodil-geography-driver.ts"],"sourcesContent":["import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nexport class DaffCountryNotFoundError extends DaffInheritableError implements DaffError {\n public readonly code: string = 'DAFF_GEOGRAPHY_COUNTRY_NOT_FOUND';\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nexport class DaffGeographyInvalidAPIResponseError extends DaffInheritableError implements DaffError {\n public readonly code: string = 'DAFF_GEOGRAPHY_INVALID_API_RESPONSE';\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import { Observable } from 'rxjs';\n\nimport { createSingletonInjectionToken } from '@daffodil/core';\nimport { DaffCountry } from '@daffodil/geography';\n\nexport const {\n token: DaffGeographyDriver,\n /**\n * Provider function for {@link DaffGeographyDriver}.\n */\n provider: provideDaffGeographyDriver,\n} = createSingletonInjectionToken<DaffGeographyServiceInterface>('DaffGeographyDriver');\n\nexport interface DaffGeographyServiceInterface<T extends DaffCountry = DaffCountry> {\n /**\n * Retrieves the list of countries available to the given store.\n */\n list(): Observable<T[]>;\n\n /**\n * Retrieve precise information about a specific country.\n */\n get(id: T['id']): Observable<T>;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAKM,MAAO,wBAAyB,SAAQ,oBAAoB,CAAA;AAGhE,IAAA,WAAA,CAAmB,OAAe,EAAA;QAChC,KAAK,CAAC,OAAO,CAAC;QADG,IAAA,CAAA,OAAO,GAAP,OAAO;QAFV,IAAA,CAAA,IAAI,GAAW,kCAAkC;IAIjE;AACD;;ACNK,MAAO,oCAAqC,SAAQ,oBAAoB,CAAA;AAG5E,IAAA,WAAA,CAAmB,OAAe,EAAA;QAChC,KAAK,CAAC,OAAO,CAAC;QADG,IAAA,CAAA,OAAO,GAAP,OAAO;QAFV,IAAA,CAAA,IAAI,GAAW,qCAAqC;IAIpE;AACD;;ACNM,MAAM,EACX,KAAK,EAAE,mBAAmB;AAC1B;;AAEG;AACH,QAAQ,EAAE,0BAA0B,GACrC,GAAG,6BAA6B,CAAgC,qBAAqB;;ACXtF;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-geography-driver.mjs","names":[],"sources":["../../../libs/geography/driver/src/errors/country-not-found.ts","../../../libs/geography/driver/src/errors/invalid-api-response.ts","../../../libs/geography/driver/src/interfaces/geography-service.interface.ts"],"sourcesContent":["import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nexport class DaffCountryNotFoundError extends DaffInheritableError implements DaffError {\n public readonly code: string = 'DAFF_GEOGRAPHY_COUNTRY_NOT_FOUND';\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nexport class DaffGeographyInvalidAPIResponseError extends DaffInheritableError implements DaffError {\n public readonly code: string = 'DAFF_GEOGRAPHY_INVALID_API_RESPONSE';\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import { Observable } from 'rxjs';\n\nimport { createSingletonInjectionToken } from '@daffodil/core';\nimport { DaffCountry } from '@daffodil/geography';\n\nexport const {\n token: DaffGeographyDriver,\n /**\n * Provider function for {@link DaffGeographyDriver}.\n */\n provider: provideDaffGeographyDriver,\n} = createSingletonInjectionToken<DaffGeographyServiceInterface>('DaffGeographyDriver');\n\nexport interface DaffGeographyServiceInterface<T extends DaffCountry = DaffCountry> {\n /**\n * Retrieves the list of countries available to the given store.\n */\n list(): Observable<T[]>;\n\n /**\n * Retrieve precise information about a specific country.\n */\n get(id: T['id']): Observable<T>;\n}\n"],"mappings":";AAKA,IAAa,2BAAb,cAA8C,qBAAoB;CAGhE,YAAmB,SAAe;EAChC,MAAM,OAAO;EADI,KAAA,UAAA;EAFH,KAAA,OAAe;CAI/B;AACD;ACND,IAAa,uCAAb,cAA0D,qBAAoB;CAG5E,YAAmB,SAAe;EAChC,MAAM,OAAO;EADI,KAAA,UAAA;EAFH,KAAA,OAAe;CAI/B;AACD;ACND,MAAa,EACX,OAAO,qBAIP,UAAU,+BACR,8BAA6D,qBAAqB"}
@@ -1,58 +1,99 @@
1
- import * as i0 from '@angular/core';
2
- import { Injectable, NgModule } from '@angular/core';
3
- import { DaffGeographyFacade } from '@daffodil/geography/state';
4
- import { BehaviorSubject } from 'rxjs';
1
+ import * as i0 from "@angular/core";
2
+ import { Injectable, NgModule, makeEnvironmentProviders } from "@angular/core";
3
+ import { DaffGeographyFacade } from "@daffodil/geography/state";
4
+ import { BehaviorSubject } from "rxjs";
5
+ var MockDaffGeographyFacade = class MockDaffGeographyFacade {
6
+ constructor() {
7
+ this.loading$ = new BehaviorSubject(null);
8
+ this.errors$ = new BehaviorSubject([]);
9
+ this.countries$ = new BehaviorSubject([]);
10
+ this.countryIds$ = new BehaviorSubject([]);
11
+ this.countryCount$ = new BehaviorSubject(null);
12
+ this.countryEntities$ = new BehaviorSubject(null);
13
+ }
14
+ getCountry(id) {
15
+ return new BehaviorSubject(null);
16
+ }
17
+ getCountrySubdivisions(id) {
18
+ return new BehaviorSubject([]);
19
+ }
20
+ isCountryFullyLoaded(id) {
21
+ return new BehaviorSubject(false);
22
+ }
23
+ dispatch(action) {}
24
+ static {
25
+ this.ɵfac = i0.ɵɵngDeclareFactory({
26
+ minVersion: "12.0.0",
27
+ version: "22.2.4",
28
+ ngImport: i0,
29
+ type: MockDaffGeographyFacade,
30
+ deps: [],
31
+ target: i0.ɵɵFactoryTarget.Injectable
32
+ });
33
+ }
34
+ static {
35
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
36
+ minVersion: "12.0.0",
37
+ version: "22.2.4",
38
+ ngImport: i0,
39
+ type: MockDaffGeographyFacade,
40
+ providedIn: "root"
41
+ });
42
+ }
43
+ };
44
+ i0.ɵɵngDeclareClassMetadata({
45
+ minVersion: "12.0.0",
46
+ version: "22.2.4",
47
+ ngImport: i0,
48
+ type: MockDaffGeographyFacade,
49
+ decorators: [{
50
+ type: Injectable,
51
+ args: [{ providedIn: "root" }]
52
+ }]
53
+ });
54
+ const provideDaffGeographyStateTesting = () => makeEnvironmentProviders([{
55
+ provide: DaffGeographyFacade,
56
+ useExisting: MockDaffGeographyFacade
57
+ }]);
58
+ var DaffGeographyStateTestingModule = class DaffGeographyStateTestingModule {
59
+ static {
60
+ this.ɵfac = i0.ɵɵngDeclareFactory({
61
+ minVersion: "12.0.0",
62
+ version: "22.2.4",
63
+ ngImport: i0,
64
+ type: DaffGeographyStateTestingModule,
65
+ deps: [],
66
+ target: i0.ɵɵFactoryTarget.NgModule
67
+ });
68
+ }
69
+ static {
70
+ this.ɵmod = i0.ɵɵngDeclareNgModule({
71
+ minVersion: "14.0.0",
72
+ version: "22.2.4",
73
+ ngImport: i0,
74
+ type: DaffGeographyStateTestingModule
75
+ });
76
+ }
77
+ static {
78
+ this.ɵinj = i0.ɵɵngDeclareInjector({
79
+ minVersion: "12.0.0",
80
+ version: "22.2.4",
81
+ ngImport: i0,
82
+ type: DaffGeographyStateTestingModule,
83
+ providers: [provideDaffGeographyStateTesting()]
84
+ });
85
+ }
86
+ };
87
+ i0.ɵɵngDeclareClassMetadata({
88
+ minVersion: "12.0.0",
89
+ version: "22.2.4",
90
+ ngImport: i0,
91
+ type: DaffGeographyStateTestingModule,
92
+ decorators: [{
93
+ type: NgModule,
94
+ args: [{ providers: [provideDaffGeographyStateTesting()] }]
95
+ }]
96
+ });
97
+ export { DaffGeographyStateTestingModule, MockDaffGeographyFacade, provideDaffGeographyStateTesting };
5
98
 
6
- /**
7
- * @inheritdoc
8
- */
9
- class MockDaffGeographyFacade {
10
- constructor() {
11
- this.loading$ = new BehaviorSubject(null);
12
- this.errors$ = new BehaviorSubject([]);
13
- this.countries$ = new BehaviorSubject([]);
14
- this.countryIds$ = new BehaviorSubject([]);
15
- this.countryCount$ = new BehaviorSubject(null);
16
- this.countryEntities$ = new BehaviorSubject(null);
17
- }
18
- getCountry(id) {
19
- return new BehaviorSubject(null);
20
- }
21
- getCountrySubdivisions(id) {
22
- return new BehaviorSubject([]);
23
- }
24
- isCountryFullyLoaded(id) {
25
- return new BehaviorSubject(false);
26
- }
27
- dispatch(action) { }
28
- ;
29
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MockDaffGeographyFacade, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
30
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MockDaffGeographyFacade, providedIn: 'root' }); }
31
- }
32
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MockDaffGeographyFacade, decorators: [{
33
- type: Injectable,
34
- args: [{ providedIn: 'root' }]
35
- }] });
36
-
37
- class DaffGeographyStateTestingModule {
38
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffGeographyStateTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
39
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: DaffGeographyStateTestingModule }); }
40
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffGeographyStateTestingModule, providers: [
41
- { provide: DaffGeographyFacade, useExisting: MockDaffGeographyFacade },
42
- ] }); }
43
- }
44
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffGeographyStateTestingModule, decorators: [{
45
- type: NgModule,
46
- args: [{
47
- providers: [
48
- { provide: DaffGeographyFacade, useExisting: MockDaffGeographyFacade },
49
- ],
50
- }]
51
- }] });
52
-
53
- /**
54
- * Generated bundle index. Do not edit.
55
- */
56
-
57
- export { DaffGeographyStateTestingModule, MockDaffGeographyFacade };
58
- //# sourceMappingURL=daffodil-geography-state-testing.mjs.map
99
+ //# sourceMappingURL=daffodil-geography-state-testing.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-geography-state-testing.mjs","sources":["../../../libs/geography/state/testing/src/mock-geography-facade.ts","../../../libs/geography/state/testing/src/geography-testing.module.ts","../../../libs/geography/state/testing/src/daffodil-geography-state-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { Dictionary } from '@ngrx/entity';\nimport { Action } from '@ngrx/store';\nimport { BehaviorSubject } from 'rxjs';\n\nimport { DaffStateError } from '@daffodil/core/state';\nimport { DaffCountry } from '@daffodil/geography';\nimport { DaffGeographyFacadeInterface } from '@daffodil/geography/state';\n\n/**\n * @inheritdoc\n */\n@Injectable({ providedIn: 'root' })\nexport class MockDaffGeographyFacade implements DaffGeographyFacadeInterface {\n loading$: BehaviorSubject<boolean> = new BehaviorSubject(null);\n errors$: BehaviorSubject<DaffStateError[]> = new BehaviorSubject([]);\n countries$: BehaviorSubject<DaffCountry[]> = new BehaviorSubject([]);\n countryIds$: BehaviorSubject<DaffCountry['id'][]> = new BehaviorSubject([]);\n countryCount$: BehaviorSubject<number> = new BehaviorSubject(null);\n countryEntities$: BehaviorSubject<Dictionary<DaffCountry>> = new BehaviorSubject(null);\n\n getCountry(id) {\n return new BehaviorSubject(null);\n }\n\n getCountrySubdivisions(id) {\n return new BehaviorSubject([]);\n }\n\n isCountryFullyLoaded(id) {\n return new BehaviorSubject(false);\n }\n\n dispatch(action: Action) {};\n}\n","import { NgModule } from '@angular/core';\n\nimport { DaffGeographyFacade } from '@daffodil/geography/state';\n\nimport { MockDaffGeographyFacade } from './mock-geography-facade';\n\n@NgModule({\n providers: [\n { provide: DaffGeographyFacade, useExisting: MockDaffGeographyFacade },\n ],\n})\nexport class DaffGeographyStateTestingModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AASA;;AAEG;MAEU,uBAAuB,CAAA;AADpC,IAAA,WAAA,GAAA;AAEE,QAAA,IAAA,CAAA,QAAQ,GAA6B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+BAA+B,EAAA,CAAA,CAAA;AAA/B,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,+BAA+B,EAAA,SAAA,EAJ/B;AACT,YAAA,EAAE,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,uBAAuB,EAAE;AACvE,SAAA,EAAA,CAAA,CAAA;;2FAEU,+BAA+B,EAAA,UAAA,EAAA,CAAA;kBAL3C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,SAAS,EAAE;AACT,wBAAA,EAAE,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,uBAAuB,EAAE;AACvE,qBAAA;AACF,iBAAA;;;ACVD;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-geography-state-testing.mjs","names":[],"sources":["../../../libs/geography/state/testing/src/mock-geography-facade.ts","../../../libs/geography/state/testing/src/provider.ts","../../../libs/geography/state/testing/src/geography-testing.module.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { Dictionary } from '@ngrx/entity';\nimport { Action } from '@ngrx/store';\nimport { BehaviorSubject } from 'rxjs';\n\nimport { DaffStateError } from '@daffodil/core/state';\nimport { DaffCountry } from '@daffodil/geography';\nimport { DaffGeographyFacadeInterface } from '@daffodil/geography/state';\n\n/**\n * @inheritdoc\n */\n@Injectable({ providedIn: 'root' })\nexport class MockDaffGeographyFacade implements DaffGeographyFacadeInterface {\n loading$: BehaviorSubject<boolean> = new BehaviorSubject(null);\n errors$: BehaviorSubject<DaffStateError[]> = new BehaviorSubject([]);\n countries$: BehaviorSubject<DaffCountry[]> = new BehaviorSubject([]);\n countryIds$: BehaviorSubject<DaffCountry['id'][]> = new BehaviorSubject([]);\n countryCount$: BehaviorSubject<number> = new BehaviorSubject(null);\n countryEntities$: BehaviorSubject<Dictionary<DaffCountry>> = new BehaviorSubject(null);\n\n getCountry(id) {\n return new BehaviorSubject(null);\n }\n\n getCountrySubdivisions(id) {\n return new BehaviorSubject([]);\n }\n\n isCountryFullyLoaded(id) {\n return new BehaviorSubject(false);\n }\n\n dispatch(action: Action) {};\n}\n","import {\n EnvironmentProviders,\n makeEnvironmentProviders,\n} from '@angular/core';\n\nimport { DaffGeographyFacade } from '@daffodil/geography/state';\n\nimport { MockDaffGeographyFacade } from './mock-geography-facade';\n\n/**\n * Provides {@link MockDaffGeographyFacade} in place of {@link DaffGeographyFacade}.\n */\nexport const provideDaffGeographyStateTesting = (): EnvironmentProviders => makeEnvironmentProviders([\n { provide: DaffGeographyFacade, useExisting: MockDaffGeographyFacade },\n]);\n","import { NgModule } from '@angular/core';\n\nimport { provideDaffGeographyStateTesting } from './provider';\n\n/**\n * @deprecated in favor of {@link provideDaffGeographyStateTesting} Deprecated in version 0.95.0. Will be removed in version 0.98.0.\n */\n@NgModule({\n providers: [\n provideDaffGeographyStateTesting(),\n ],\n})\nexport class DaffGeographyStateTestingModule {}\n"],"mappings":";;;;AAaA,IAAa,0BAAb,MAAa,wBAAuB;CADpC,cAAA;EAEE,KAAA,WAAqC,IAAI,gBAAgB,IAAI;EAC7D,KAAA,UAA6C,IAAI,gBAAgB,CAAA,CAAE;EACnE,KAAA,aAA6C,IAAI,gBAAgB,CAAA,CAAE;EACnE,KAAA,cAAoD,IAAI,gBAAgB,CAAA,CAAE;EAC1E,KAAA,gBAAyC,IAAI,gBAAgB,IAAI;EACjE,KAAA,mBAA6D,IAAI,gBAAgB,IAAI;CAetF;CAbC,WAAW,IAAE;EACX,OAAO,IAAI,gBAAgB,IAAI;CACjC;CAEA,uBAAuB,IAAE;EACvB,OAAO,IAAI,gBAAgB,CAAA,CAAE;CAC/B;CAEA,qBAAqB,IAAE;EACrB,OAAO,IAAI,gBAAgB,KAAK;CAClC;CAEA,SAAS,QAAc,CAAG;CApBf;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAA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