@daffodil/geography 0.64.2 → 0.66.1
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/in-memory/backend/geography.service.mjs +3 -3
- package/esm2020/public_api.mjs +1 -2
- package/esm2020/state/effects/geography.effects.mjs +2 -2
- package/esm2020/state/index.mjs +2 -6
- package/esm2020/state/injection-tokens/error-matcher.token.mjs +8 -0
- package/esm2020/state/injection-tokens/public_api.mjs +2 -0
- package/esm2020/state/public_api.mjs +7 -0
- package/esm2020/state/testing/geography-testing.module.mjs +6 -6
- package/esm2020/state/testing/public_api.mjs +2 -2
- package/esm2020/testing/factories/country.factory.mjs +10 -7
- package/fesm2015/daffodil-geography-driver-in-memory.mjs +2 -2
- package/fesm2015/daffodil-geography-driver-in-memory.mjs.map +1 -1
- package/fesm2015/daffodil-geography-state-testing.mjs +6 -6
- package/fesm2015/daffodil-geography-state-testing.mjs.map +1 -1
- package/fesm2015/daffodil-geography-state.mjs +9 -3
- package/fesm2015/daffodil-geography-state.mjs.map +1 -1
- package/fesm2015/daffodil-geography-testing.mjs +21 -20
- package/fesm2015/daffodil-geography-testing.mjs.map +1 -1
- package/fesm2015/daffodil-geography.mjs +1 -9
- package/fesm2015/daffodil-geography.mjs.map +1 -1
- package/fesm2020/daffodil-geography-driver-in-memory.mjs +2 -2
- package/fesm2020/daffodil-geography-driver-in-memory.mjs.map +1 -1
- package/fesm2020/daffodil-geography-state-testing.mjs +6 -6
- package/fesm2020/daffodil-geography-state-testing.mjs.map +1 -1
- package/fesm2020/daffodil-geography-state.mjs +9 -3
- package/fesm2020/daffodil-geography-state.mjs.map +1 -1
- package/fesm2020/daffodil-geography-testing.mjs +21 -20
- package/fesm2020/daffodil-geography-testing.mjs.map +1 -1
- package/fesm2020/daffodil-geography.mjs +1 -9
- package/fesm2020/daffodil-geography.mjs.map +1 -1
- package/package.json +1 -1
- package/public_api.d.ts +0 -1
- package/state/index.d.ts +1 -6
- package/state/public_api.d.ts +7 -0
- package/state/testing/geography-testing.module.d.ts +4 -4
- package/state/testing/public_api.d.ts +1 -1
- package/testing/factories/country.factory.d.ts +5 -2
- package/esm2020/injection-tokens/error-matcher.token.mjs +0 -8
- package/esm2020/injection-tokens/public_api.mjs +0 -2
- /package/{injection-tokens → state/injection-tokens}/error-matcher.token.d.ts +0 -0
- /package/{injection-tokens → state/injection-tokens}/public_api.d.ts +0 -0
|
@@ -42,10 +42,10 @@ export class DaffInMemoryBackendGeographyService {
|
|
|
42
42
|
}));
|
|
43
43
|
}
|
|
44
44
|
getCountry(reqInfo) {
|
|
45
|
-
return
|
|
45
|
+
return this.countries.find(country => country.id === reqInfo.id);
|
|
46
46
|
}
|
|
47
47
|
listCountries(reqInfo) {
|
|
48
|
-
return
|
|
48
|
+
return this.countries;
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
/** @nocollapse */ DaffInMemoryBackendGeographyService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryBackendGeographyService, deps: [{ token: i1.DaffCountryFactory }, { token: i1.DaffSubdivisionFactory }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -56,4 +56,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
56
56
|
providedIn: 'root',
|
|
57
57
|
}]
|
|
58
58
|
}], ctorParameters: function () { return [{ type: i1.DaffCountryFactory }, { type: i1.DaffSubdivisionFactory }]; } });
|
|
59
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
59
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2VvZ3JhcGh5LnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL2dlb2dyYXBoeS9kcml2ZXIvaW4tbWVtb3J5L3NyYy9iYWNrZW5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RyaWVzKHJlcUluZm86IFJlcXVlc3RJbmZvKSB7XG4gICAgcmV0dXJuIHRoaXMuY291bnRyaWVzO1xuICB9XG59XG4iXX0=
|
package/esm2020/public_api.mjs
CHANGED
|
@@ -3,5 +3,4 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export * from './models/public_api';
|
|
5
5
|
export * from './comparators/public_api';
|
|
6
|
-
|
|
7
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYnMvZ2VvZ3JhcGh5L3NyYy9wdWJsaWNfYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsY0FBYyxxQkFBcUIsQ0FBQztBQUNwQyxjQUFjLDBCQUEwQixDQUFDO0FBQ3pDLGNBQWMsK0JBQStCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKlxuICogUHVibGljIEFQSSBTdXJmYWNlIG9mIEBkYWZmb2RpbC9nZW9ncmFwaHlcbiAqL1xuZXhwb3J0ICogZnJvbSAnLi9tb2RlbHMvcHVibGljX2FwaSc7XG5leHBvcnQgKiBmcm9tICcuL2NvbXBhcmF0b3JzL3B1YmxpY19hcGknO1xuZXhwb3J0ICogZnJvbSAnLi9pbmplY3Rpb24tdG9rZW5zL3B1YmxpY19hcGknO1xuIl19
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYnMvZ2VvZ3JhcGh5L3NyYy9wdWJsaWNfYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsY0FBYyxxQkFBcUIsQ0FBQztBQUNwQyxjQUFjLDBCQUEwQixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLypcbiAqIFB1YmxpYyBBUEkgU3VyZmFjZSBvZiBAZGFmZm9kaWwvZ2VvZ3JhcGh5XG4gKi9cbmV4cG9ydCAqIGZyb20gJy4vbW9kZWxzL3B1YmxpY19hcGknO1xuZXhwb3J0ICogZnJvbSAnLi9jb21wYXJhdG9ycy9wdWJsaWNfYXBpJztcbiJdfQ==
|
|
@@ -2,9 +2,9 @@ import { Injectable, Inject, } from '@angular/core';
|
|
|
2
2
|
import { Actions, createEffect, ofType, } from '@ngrx/effects';
|
|
3
3
|
import { of } from 'rxjs';
|
|
4
4
|
import { switchMap, map, catchError, } from 'rxjs/operators';
|
|
5
|
-
import { DAFF_GEOGRAPHY_ERROR_MATCHER, } from '@daffodil/geography';
|
|
6
5
|
import { DaffGeographyDriver, } from '@daffodil/geography/driver';
|
|
7
6
|
import { DaffGeographyActionTypes, DaffCountryLoadSuccess, DaffCountryLoadFailure, DaffCountryListSuccess, DaffCountryListFailure, } from '../actions/public_api';
|
|
7
|
+
import { DAFF_GEOGRAPHY_ERROR_MATCHER } from '../injection-tokens/public_api';
|
|
8
8
|
import * as i0 from "@angular/core";
|
|
9
9
|
import * as i1 from "@ngrx/effects";
|
|
10
10
|
export class DaffGeographyEffects {
|
|
@@ -27,4 +27,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
27
27
|
type: Inject,
|
|
28
28
|
args: [DAFF_GEOGRAPHY_ERROR_MATCHER]
|
|
29
29
|
}] }]; } });
|
|
30
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
30
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2VvZ3JhcGh5LmVmZmVjdHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9saWJzL2dlb2dyYXBoeS9zdGF0ZS9zcmMvZWZ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oKGFjdGlvbjogRGFmZkNvdW50cnlMaXN0KSA9PiB0aGlzLmRyaXZlci5saXN0KCkucGlwZShcbiAgICAgIG1hcChyZXNwID0+IG5ldyBEYWZmQ291bnRyeUxpc3RTdWNjZXNzKHJlc3ApKSxcbiAgICAgIGNhdGNoRXJyb3IoKGVycm9yOiBEYWZmRXJyb3IpID0+IG9mKG5ldyBEYWZmQ291bnRyeUxpc3RGYWlsdXJlKHRoaXMuZXJyb3JNYXRjaGVyKGVycm9yKSkpKSxcbiAgICApKSxcbiAgKSk7XG59XG4iXX0=
|
package/esm2020/state/index.mjs
CHANGED
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
|
|
3
|
-
export * from './actions/public_api';
|
|
4
|
-
export { DaffGeographyFacade } from './facades/geography/geography.facade';
|
|
5
|
-
export { DaffGeographyStateModule } from './geography-state.module';
|
|
6
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9saWJzL2dlb2dyYXBoeS9zdGF0ZS9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyx3QkFBd0IsQ0FBQztBQUN2QyxjQUFjLHVCQUF1QixDQUFDO0FBQ3RDLGNBQWMsc0JBQXNCLENBQUM7QUFFckMsT0FBTyxFQUFFLG1CQUFtQixFQUFFLE1BQU0sc0NBQXNDLENBQUM7QUFFM0UsT0FBTyxFQUFFLHdCQUF3QixFQUFFLE1BQU0sMEJBQTBCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL3NlbGVjdG9ycy9wdWJsaWNfYXBpJztcbmV4cG9ydCAqIGZyb20gJy4vcmVkdWNlcnMvcHVibGljX2FwaSc7XG5leHBvcnQgKiBmcm9tICcuL2FjdGlvbnMvcHVibGljX2FwaSc7XG5cbmV4cG9ydCB7IERhZmZHZW9ncmFwaHlGYWNhZGUgfSBmcm9tICcuL2ZhY2FkZXMvZ2VvZ3JhcGh5L2dlb2dyYXBoeS5mYWNhZGUnO1xuZXhwb3J0IHsgRGFmZkdlb2dyYXBoeUZhY2FkZUludGVyZmFjZSB9IGZyb20gJy4vZmFjYWRlcy9nZW9ncmFwaHkvZ2VvZ3JhcGh5LWZhY2FkZS5pbnRlcmZhY2UnO1xuZXhwb3J0IHsgRGFmZkdlb2dyYXBoeVN0YXRlTW9kdWxlIH0gZnJvbSAnLi9nZW9ncmFwaHktc3RhdGUubW9kdWxlJztcbiJdfQ==
|
|
1
|
+
export * from './public_api';
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9saWJzL2dlb2dyYXBoeS9zdGF0ZS9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxjQUFjLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL3B1YmxpY19hcGknO1xuIl19
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
import { daffTransformErrorToStateError } from '@daffodil/core/state';
|
|
3
|
+
/**
|
|
4
|
+
* Transforms `DaffError`s into `DaffStateError`s before they are serialized into state.
|
|
5
|
+
* Can be used to further refine Daffodil errors into more specific app errors.
|
|
6
|
+
*/
|
|
7
|
+
export const DAFF_GEOGRAPHY_ERROR_MATCHER = new InjectionToken('DAFF_GEOGRAPHY_ERROR_MATCHER', { factory: () => daffTransformErrorToStateError });
|
|
8
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXJyb3ItbWF0Y2hlci50b2tlbi5qcyIsInNvdXJjZVJv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01BVENIRVInLFxuICB7IGZhY3Rvcnk6ICgpID0+IGRhZmZUcmFuc2Zvcm1FcnJvclRvU3RhdGVFcnJvciB9LFxuKTtcbiJdfQ==
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { DAFF_GEOGRAPHY_ERROR_MATCHER } from './error-matcher.token';
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL2xpYnMvZ2VvZ3JhcGh5L3N0YXRlL3NyYy9pbmplY3Rpb24tdG9rZW5zL3B1YmxpY19hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLDRCQUE0QixFQUFFLE1BQU0sdUJBQXVCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgeyBEQUZGX0dFT0dSQVBIWV9FUlJPUl9NQVRDSEVSIH0gZnJvbSAnLi9lcnJvci1tYXRjaGVyLnRva2VuJztcbiJdfQ==
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './selectors/public_api';
|
|
2
|
+
export * from './reducers/public_api';
|
|
3
|
+
export * from './actions/public_api';
|
|
4
|
+
export * from './injection-tokens/public_api';
|
|
5
|
+
export { DaffGeographyFacade } from './facades/geography/geography.facade';
|
|
6
|
+
export { DaffGeographyStateModule } from './geography-state.module';
|
|
7
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYnMvZ2VvZ3JhcGh5L3N0YXRlL3NyYy9wdWJsaWNfYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsd0JBQXdCLENBQUM7QUFDdkMsY0FBYyx1QkFBdUIsQ0FBQztBQUN0QyxjQUFjLHNCQUFzQixDQUFDO0FBQ3JDLGNBQWMsK0JBQStCLENBQUM7QUFFOUMsT0FBTyxFQUFFLG1CQUFtQixFQUFFLE1BQU0sc0NBQXNDLENBQUM7QUFFM0UsT0FBTyxFQUFFLHdCQUF3QixFQUFFLE1BQU0sMEJBQTBCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL3NlbGVjdG9ycy9wdWJsaWNfYXBpJztcbmV4cG9ydCAqIGZyb20gJy4vcmVkdWNlcnMvcHVibGljX2FwaSc7XG5leHBvcnQgKiBmcm9tICcuL2FjdGlvbnMvcHVibGljX2FwaSc7XG5leHBvcnQgKiBmcm9tICcuL2luamVjdGlvbi10b2tlbnMvcHVibGljX2FwaSc7XG5cbmV4cG9ydCB7IERhZmZHZW9ncmFwaHlGYWNhZGUgfSBmcm9tICcuL2ZhY2FkZXMvZ2VvZ3JhcGh5L2dlb2dyYXBoeS5mYWNhZGUnO1xuZXhwb3J0IHsgRGFmZkdlb2dyYXBoeUZhY2FkZUludGVyZmFjZSB9IGZyb20gJy4vZmFjYWRlcy9nZW9ncmFwaHkvZ2VvZ3JhcGh5LWZhY2FkZS5pbnRlcmZhY2UnO1xuZXhwb3J0IHsgRGFmZkdlb2dyYXBoeVN0YXRlTW9kdWxlIH0gZnJvbSAnLi9nZW9ncmFwaHktc3RhdGUubW9kdWxlJztcbiJdfQ==
|
|
@@ -2,14 +2,14 @@ import { NgModule } from '@angular/core';
|
|
|
2
2
|
import { DaffGeographyFacade } from '@daffodil/geography/state';
|
|
3
3
|
import { MockDaffGeographyFacade } from './mock-geography-facade';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
|
-
export class
|
|
5
|
+
export class DaffGeographyStateTestingModule {
|
|
6
6
|
}
|
|
7
|
-
/** @nocollapse */
|
|
8
|
-
/** @nocollapse */
|
|
9
|
-
/** @nocollapse */
|
|
7
|
+
/** @nocollapse */ DaffGeographyStateTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffGeographyStateTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
8
|
+
/** @nocollapse */ DaffGeographyStateTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: DaffGeographyStateTestingModule });
|
|
9
|
+
/** @nocollapse */ DaffGeographyStateTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffGeographyStateTestingModule, providers: [
|
|
10
10
|
{ provide: DaffGeographyFacade, useExisting: MockDaffGeographyFacade },
|
|
11
11
|
] });
|
|
12
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type:
|
|
12
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffGeographyStateTestingModule, decorators: [{
|
|
13
13
|
type: NgModule,
|
|
14
14
|
args: [{
|
|
15
15
|
providers: [
|
|
@@ -17,4 +17,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
17
17
|
],
|
|
18
18
|
}]
|
|
19
19
|
}] });
|
|
20
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
20
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2VvZ3JhcGh5LXRlc3RpbmcubW9kdWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vbGlicy9nZW9ncmFwaHkvc3RhdGUvdGVzdGluZy9zcmMvZ2VvZ3JhcGh5LXRlc3RpbmcubW9kdWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxRQUFRLEVBQ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
2
|
export { MockDaffGeographyFacade } from './mock-geography-facade';
|
|
3
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL2xpYnMvZ2VvZ3JhcGh5L3N0YXRlL3Rlc3Rpbmcvc3JjL3B1YmxpY19hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLCtCQUErQixFQUFFLE1BQU0sNEJBQTRCLENBQUM7QUFDN0UsT0FBTyxFQUFFLHVCQUF1QixFQUFFLE1BQU0seUJBQXlCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgeyBEYWZmR2VvZ3JhcGh5U3RhdGVUZXN0aW5nTW9kdWxlIH0gZnJvbSAnLi9nZW9ncmFwaHktdGVzdGluZy5tb2R1bGUnO1xuZXhwb3J0IHsgTW9ja0RhZmZHZW9ncmFwaHlGYWNhZGUgfSBmcm9tICcuL21vY2stZ2VvZ3JhcGh5LWZhY2FkZSc7XG4iXX0=
|
|
@@ -1,28 +1,31 @@
|
|
|
1
1
|
import { Injectable } from '@angular/core';
|
|
2
2
|
import { faker } from '@faker-js/faker/locale/en_US';
|
|
3
3
|
import { DaffModelFactory } from '@daffodil/core/testing';
|
|
4
|
+
import { DaffSubdivisionFactory } from './subdivision.factory';
|
|
4
5
|
import * as i0 from "@angular/core";
|
|
6
|
+
import * as i1 from "./subdivision.factory";
|
|
5
7
|
export class MockCountry {
|
|
6
|
-
constructor() {
|
|
8
|
+
constructor(subdivisionFactory) {
|
|
9
|
+
this.subdivisionFactory = subdivisionFactory;
|
|
7
10
|
this.id = faker.datatype.uuid();
|
|
8
11
|
this.name = faker.random.word();
|
|
9
12
|
this.name_en = faker.random.word();
|
|
10
13
|
this.alpha2 = faker.random.alphaNumeric(2);
|
|
11
14
|
this.alpha3 = faker.random.alphaNumeric(3);
|
|
12
|
-
this.subdivisions =
|
|
15
|
+
this.subdivisions = this.subdivisionFactory.createMany(faker.datatype.number({ min: 0, max: 10 }));
|
|
13
16
|
}
|
|
14
17
|
}
|
|
15
18
|
export class DaffCountryFactory extends DaffModelFactory {
|
|
16
|
-
constructor() {
|
|
17
|
-
super(MockCountry);
|
|
19
|
+
constructor(subdivisionFactory) {
|
|
20
|
+
super(MockCountry, subdivisionFactory);
|
|
18
21
|
}
|
|
19
22
|
}
|
|
20
|
-
/** @nocollapse */ DaffCountryFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCountryFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
23
|
+
/** @nocollapse */ DaffCountryFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCountryFactory, deps: [{ token: i1.DaffSubdivisionFactory }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
21
24
|
/** @nocollapse */ DaffCountryFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCountryFactory, providedIn: 'root' });
|
|
22
25
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCountryFactory, decorators: [{
|
|
23
26
|
type: Injectable,
|
|
24
27
|
args: [{
|
|
25
28
|
providedIn: 'root',
|
|
26
29
|
}]
|
|
27
|
-
}], ctorParameters: function () { return []; } });
|
|
28
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
30
|
+
}], ctorParameters: function () { return [{ type: i1.DaffSubdivisionFactory }]; } });
|
|
31
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY291bnRyeS5mYWN0b3J5LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZX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RhdHlwZS5udW1iZXIoeyBtaW46IDAsIG1heDogMTAgfSkpO1xuXG4gIGNvbnN0cnVjdG9yKFxuICAgIHByb3RlY3RlZCBzdWJkaXZpc2lvbkZhY3Rvcnk6IERhZmZTdWJkaXZpc2lvbkZhY3RvcnksXG4gICkge31cbn1cblxuQEluamVjdGFibGUoe1xuICBwcm92aWRlZEluOiAncm9vdCcsXG59KVxuZXhwb3J0IGNsYXNzIERhZmZDb3VudHJ5RmFjdG9yeSBleHRlbmRzIERhZmZNb2RlbEZhY3Rvcnk8RGFmZkNvdW50cnk+IHtcbiAgY29uc3RydWN0b3IoXG4gICAgc3ViZGl2aXNpb25GYWN0b3J5OiBEYWZmU3ViZGl2aXNpb25GYWN0b3J5LFxuICApIHtcbiAgICBzdXBlcihNb2NrQ291bnRyeSwgc3ViZGl2aXNpb25GYWN0b3J5KTtcbiAgfVxufVxuIl19
|
|
@@ -96,10 +96,10 @@ class DaffInMemoryBackendGeographyService {
|
|
|
96
96
|
}));
|
|
97
97
|
}
|
|
98
98
|
getCountry(reqInfo) {
|
|
99
|
-
return
|
|
99
|
+
return this.countries.find(country => country.id === reqInfo.id);
|
|
100
100
|
}
|
|
101
101
|
listCountries(reqInfo) {
|
|
102
|
-
return
|
|
102
|
+
return this.countries;
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
/** @nocollapse */ DaffInMemoryBackendGeographyService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryBackendGeographyService, deps: [{ token: i1$1.DaffCountryFactory }, { token: i1$1.DaffSubdivisionFactory }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-geography-driver-in-memory.mjs","sources":["../../../libs/geography/driver/in-memory/src/drivers/geography.service.ts","../../../libs/geography/driver/in-memory/src/drivers/geography-driver.module.ts","../../../libs/geography/driver/in-memory/src/backend/geography.service.ts","../../../libs/geography/driver/in-memory/src/daffodil-geography-driver-in-memory.ts"],"sourcesContent":["import { HttpClient } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport {\n Observable,\n throwError,\n} from 'rxjs';\nimport {\n catchError,\n map,\n} from 'rxjs/operators';\n\nimport { DaffCountry } from '@daffodil/geography';\nimport {\n DaffGeographyServiceInterface,\n DaffCountryNotFoundError,\n} from '@daffodil/geography/driver';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryGeographyService implements DaffGeographyServiceInterface<DaffCountry> {\n url = '/api/countries';\n\n constructor(private http: HttpClient) {}\n\n get(countryId: DaffCountry['id']): Observable<DaffCountry> {\n return this.http.get<DaffCountry>(`${this.url}/${countryId}`).pipe(\n catchError((error: Error) => throwError(() => new DaffCountryNotFoundError('Country could not be found'))),\n map(result => result),\n );\n }\n\n list(): Observable<DaffCountry[]> {\n return this.http.get<DaffCountry[]>(`${this.url}/`);\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { DaffGeographyDriver } from '@daffodil/geography/driver';\n\nimport { DaffInMemoryGeographyService } from './geography.service';\n\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffGeographyInMemoryDriverModule {\n static forRoot(): ModuleWithProviders<DaffGeographyInMemoryDriverModule> {\n return {\n ngModule: DaffGeographyInMemoryDriverModule,\n providers: [\n {\n provide: DaffGeographyDriver,\n useExisting: DaffInMemoryGeographyService,\n },\n ],\n };\n }\n}\n","import { Injectable } from '@angular/core';\nimport {\n InMemoryDbService,\n RequestInfo,\n STATUS,\n} from 'angular-in-memory-web-api';\n\nimport { DaffInMemoryDataServiceInterface } from '@daffodil/core/testing';\nimport { DaffCountry } from '@daffodil/geography';\nimport {\n DaffCountryFactory,\n DaffSubdivisionFactory,\n} from '@daffodil/geography/testing';\n\n/**\n * An in-memory service that stubs out the backend services for getting countries.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryBackendGeographyService implements InMemoryDbService, DaffInMemoryDataServiceInterface {\n countries: DaffCountry[];\n\n constructor(\n private countryFactory: DaffCountryFactory,\n private subdivisionFactory: DaffSubdivisionFactory,\n ) {\n this.countries = this.countryFactory.createMany(5);\n this.countries.forEach(country => country.subdivisions = this.subdivisionFactory.createMany(5));\n }\n\n /**\n * Creates a fake database of countries for the geography inmemory backend service.\n *\n * @docs-private\n * @returns A fake database of an array of countries\n */\n createDb(reqInfo: RequestInfo): any {\n if (reqInfo) {\n const seedData = reqInfo.utils.getJsonBody(reqInfo.req).countries;\n if (seedData) {\n this.countries = seedData;\n }\n }\n\n return {\n countries: this.countries,\n };\n }\n\n /**\n * Responds to GET requests.\n */\n get(reqInfo: RequestInfo): any {\n return reqInfo.utils.createResponse$(() => ({\n body: reqInfo.id ? this.getCountry(reqInfo) : this.listCountries(reqInfo),\n status: STATUS.OK,\n }));\n }\n\n private getCountry(reqInfo: RequestInfo) {\n return
|
|
1
|
+
{"version":3,"file":"daffodil-geography-driver-in-memory.mjs","sources":["../../../libs/geography/driver/in-memory/src/drivers/geography.service.ts","../../../libs/geography/driver/in-memory/src/drivers/geography-driver.module.ts","../../../libs/geography/driver/in-memory/src/backend/geography.service.ts","../../../libs/geography/driver/in-memory/src/daffodil-geography-driver-in-memory.ts"],"sourcesContent":["import { HttpClient } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport {\n Observable,\n throwError,\n} from 'rxjs';\nimport {\n catchError,\n map,\n} from 'rxjs/operators';\n\nimport { DaffCountry } from '@daffodil/geography';\nimport {\n DaffGeographyServiceInterface,\n DaffCountryNotFoundError,\n} from '@daffodil/geography/driver';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryGeographyService implements DaffGeographyServiceInterface<DaffCountry> {\n url = '/api/countries';\n\n constructor(private http: HttpClient) {}\n\n get(countryId: DaffCountry['id']): Observable<DaffCountry> {\n return this.http.get<DaffCountry>(`${this.url}/${countryId}`).pipe(\n catchError((error: Error) => throwError(() => new DaffCountryNotFoundError('Country could not be found'))),\n map(result => result),\n );\n }\n\n list(): Observable<DaffCountry[]> {\n return this.http.get<DaffCountry[]>(`${this.url}/`);\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { DaffGeographyDriver } from '@daffodil/geography/driver';\n\nimport { DaffInMemoryGeographyService } from './geography.service';\n\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffGeographyInMemoryDriverModule {\n static forRoot(): ModuleWithProviders<DaffGeographyInMemoryDriverModule> {\n return {\n ngModule: DaffGeographyInMemoryDriverModule,\n providers: [\n {\n provide: DaffGeographyDriver,\n useExisting: DaffInMemoryGeographyService,\n },\n ],\n };\n }\n}\n","import { Injectable } from '@angular/core';\nimport {\n InMemoryDbService,\n RequestInfo,\n STATUS,\n} from 'angular-in-memory-web-api';\n\nimport { DaffInMemoryDataServiceInterface } from '@daffodil/core/testing';\nimport { DaffCountry } from '@daffodil/geography';\nimport {\n DaffCountryFactory,\n DaffSubdivisionFactory,\n} from '@daffodil/geography/testing';\n\n/**\n * An in-memory service that stubs out the backend services for getting countries.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryBackendGeographyService implements InMemoryDbService, DaffInMemoryDataServiceInterface {\n countries: DaffCountry[];\n\n constructor(\n private countryFactory: DaffCountryFactory,\n private subdivisionFactory: DaffSubdivisionFactory,\n ) {\n this.countries = this.countryFactory.createMany(5);\n this.countries.forEach(country => country.subdivisions = this.subdivisionFactory.createMany(5));\n }\n\n /**\n * Creates a fake database of countries for the geography inmemory backend service.\n *\n * @docs-private\n * @returns A fake database of an array of countries\n */\n createDb(reqInfo: RequestInfo): any {\n if (reqInfo) {\n const seedData = reqInfo.utils.getJsonBody(reqInfo.req).countries;\n if (seedData) {\n this.countries = seedData;\n }\n }\n\n return {\n countries: this.countries,\n };\n }\n\n /**\n * Responds to GET requests.\n */\n get(reqInfo: RequestInfo): any {\n return reqInfo.utils.createResponse$(() => ({\n body: reqInfo.id ? this.getCountry(reqInfo) : this.listCountries(reqInfo),\n status: STATUS.OK,\n }));\n }\n\n private getCountry(reqInfo: RequestInfo) {\n return this.countries.find(country => country.id === reqInfo.id);\n }\n\n private listCountries(reqInfo: RequestInfo) {\n return this.countries;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;AAiBA;;AAEG;MAIU,4BAA4B,CAAA;AAGvC,IAAA,WAAA,CAAoB,IAAgB,EAAA;AAAhB,QAAA,IAAI,CAAA,IAAA,GAAJ,IAAI,CAAY;AAFpC,QAAA,IAAG,CAAA,GAAA,GAAG,gBAAgB,CAAC;KAEiB;AAExC,IAAA,GAAG,CAAC,SAA4B,EAAA;QAC9B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAc,CAAA,EAAG,IAAI,CAAC,GAAG,IAAI,SAAS,CAAA,CAAE,CAAC,CAAC,IAAI,CAChE,UAAU,CAAC,CAAC,KAAY,KAAK,UAAU,CAAC,MAAM,IAAI,wBAAwB,CAAC,4BAA4B,CAAC,CAAC,CAAC,EAC1G,GAAG,CAAC,MAAM,IAAI,MAAM,CAAC,CACtB,CAAC;KACH;IAED,IAAI,GAAA;AACF,QAAA,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAgB,CAAG,EAAA,IAAI,CAAC,GAAG,CAAG,CAAA,CAAA,CAAC,CAAC;KACrD;;4IAdU,4BAA4B,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,UAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA5B,mBAAA,4BAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,E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mJA9CU,mCAAmC,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAAA,IAAA,CAAA,kBAAA,EAAA,EAAA,EAAA,KAAA,EAAAA,IAAA,CAAA,sBAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAnC,mBAAA,mCAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mCAAmC,cAFlC,MAAM,EAAA,CAAA,CAAA;2FAEP,mCAAmC,EAAA,UAAA,EAAA,CAAA;kBAH/C,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;iBACnB,CAAA;;;ACrBD;;AAEG;;;;"}
|
|
@@ -34,14 +34,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
34
34
|
args: [{ providedIn: 'root' }]
|
|
35
35
|
}] });
|
|
36
36
|
|
|
37
|
-
class
|
|
37
|
+
class DaffGeographyStateTestingModule {
|
|
38
38
|
}
|
|
39
|
-
/** @nocollapse */
|
|
40
|
-
/** @nocollapse */
|
|
41
|
-
/** @nocollapse */
|
|
39
|
+
/** @nocollapse */ DaffGeographyStateTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffGeographyStateTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
40
|
+
/** @nocollapse */ DaffGeographyStateTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: DaffGeographyStateTestingModule });
|
|
41
|
+
/** @nocollapse */ DaffGeographyStateTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffGeographyStateTestingModule, providers: [
|
|
42
42
|
{ provide: DaffGeographyFacade, useExisting: MockDaffGeographyFacade },
|
|
43
43
|
] });
|
|
44
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type:
|
|
44
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffGeographyStateTestingModule, decorators: [{
|
|
45
45
|
type: NgModule,
|
|
46
46
|
args: [{
|
|
47
47
|
providers: [
|
|
@@ -54,5 +54,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
54
54
|
* Generated bundle index. Do not edit.
|
|
55
55
|
*/
|
|
56
56
|
|
|
57
|
-
export {
|
|
57
|
+
export { DaffGeographyStateTestingModule, MockDaffGeographyFacade };
|
|
58
58
|
//# 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
|
|
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;QAEE,IAAA,CAAA,QAAQ,GAA6B,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;QAC/D,IAAA,CAAA,OAAO,GAAsC,IAAI,eAAe,CAAC,EAAE,CAAC,CAAC;QACrE,IAAA,CAAA,UAAU,GAAmC,IAAI,eAAe,CAAC,EAAE,CAAC,CAAC;QACrE,IAAA,CAAA,WAAW,GAAyC,IAAI,eAAe,CAAC,EAAE,CAAC,CAAC;QAC5E,IAAA,CAAA,aAAa,GAA4B,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;QACnE,IAAA,CAAA,gBAAgB,GAA6C,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;KAexF;AAbC,IAAA,UAAU,CAAC,EAAE,EAAA;AACX,QAAA,OAAO,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;KAClC;AAED,IAAA,sBAAsB,CAAC,EAAE,EAAA;AACvB,QAAA,OAAO,IAAI,eAAe,CAAC,EAAE,CAAC,CAAC;KAChC;AAED,IAAA,oBAAoB,CAAC,EAAE,EAAA;AACrB,QAAA,OAAO,IAAI,eAAe,CAAC,KAAK,CAAC,CAAC;KACnC;IAED,QAAQ,CAAC,MAAc,EAAA,GAAI;;;uIApBhB,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAvB,mBAAA,uBAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uBAAuB,cADV,MAAM,EAAA,CAAA,CAAA;2FACnB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBADnC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAA;;;MCDrB,+BAA+B,CAAA;;+IAA/B,+BAA+B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;gJAA/B,+BAA+B,EAAA,CAAA,CAAA;AAA/B,mBAAA,+BAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,+BAA+B,EAJ/B,SAAA,EAAA;AACT,QAAA,EAAE,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,uBAAuB,EAAE;AACvE,KAAA,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;iBACF,CAAA;;;ACVD;;AAEG;;;;"}
|
|
@@ -2,12 +2,12 @@ import * as i1 from '@ngrx/store';
|
|
|
2
2
|
import { createFeatureSelector, createSelector, defaultMemoize, select, StoreModule } from '@ngrx/store';
|
|
3
3
|
import { createEntityAdapter } from '@ngrx/entity';
|
|
4
4
|
import * as i0 from '@angular/core';
|
|
5
|
-
import { Injectable, Inject, NgModule } from '@angular/core';
|
|
5
|
+
import { InjectionToken, Injectable, Inject, NgModule } from '@angular/core';
|
|
6
|
+
import { daffTransformErrorToStateError } from '@daffodil/core/state';
|
|
6
7
|
import * as i1$1 from '@ngrx/effects';
|
|
7
8
|
import { createEffect, ofType, EffectsModule } from '@ngrx/effects';
|
|
8
9
|
import { of } from 'rxjs';
|
|
9
10
|
import { switchMap, map, catchError } from 'rxjs/operators';
|
|
10
|
-
import { DAFF_GEOGRAPHY_ERROR_MATCHER } from '@daffodil/geography';
|
|
11
11
|
import { DaffGeographyDriver } from '@daffodil/geography/driver';
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -193,6 +193,12 @@ const getDaffGeographySelectors = (() => {
|
|
|
193
193
|
return () => cache = cache || Object.assign(Object.assign(Object.assign({}, getGeographySelectors()), getDaffCountryEntitySelectors()), getDaffGeographyFeatureStateSelector());
|
|
194
194
|
})();
|
|
195
195
|
|
|
196
|
+
/**
|
|
197
|
+
* Transforms `DaffError`s into `DaffStateError`s before they are serialized into state.
|
|
198
|
+
* Can be used to further refine Daffodil errors into more specific app errors.
|
|
199
|
+
*/
|
|
200
|
+
const DAFF_GEOGRAPHY_ERROR_MATCHER = new InjectionToken('DAFF_GEOGRAPHY_ERROR_MATCHER', { factory: () => daffTransformErrorToStateError });
|
|
201
|
+
|
|
196
202
|
/**
|
|
197
203
|
* @inheritdoc
|
|
198
204
|
*/
|
|
@@ -279,5 +285,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
279
285
|
* Generated bundle index. Do not edit.
|
|
280
286
|
*/
|
|
281
287
|
|
|
282
|
-
export { DAFF_GEOGRAPHY_STORE_FEATURE_KEY, DaffCountryList, DaffCountryListFailure, DaffCountryListSuccess, DaffCountryLoad, DaffCountryLoadFailure, DaffCountryLoadSuccess, DaffGeographyActionTypes, DaffGeographyFacade, DaffGeographyStateModule, daffCountryEntitiesInitialState, daffCountryEntitiesReducer, daffGeographyInitialState, daffGeographyReducer, daffGeographyReducers, getCountryAdapter, getDaffGeographySelectors };
|
|
288
|
+
export { DAFF_GEOGRAPHY_ERROR_MATCHER, DAFF_GEOGRAPHY_STORE_FEATURE_KEY, DaffCountryList, DaffCountryListFailure, DaffCountryListSuccess, DaffCountryLoad, DaffCountryLoadFailure, DaffCountryLoadSuccess, DaffGeographyActionTypes, DaffGeographyFacade, DaffGeographyStateModule, daffCountryEntitiesInitialState, daffCountryEntitiesReducer, daffGeographyInitialState, daffGeographyReducer, daffGeographyReducers, getCountryAdapter, getDaffGeographySelectors };
|
|
283
289
|
//# sourceMappingURL=daffodil-geography-state.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-geography-state.mjs","sources":["../../../libs/geography/state/src/reducers/country-entities/country-entities-adapter.ts","../../../libs/geography/state/src/reducers/country-entities/country-entities-initial-state.ts","../../../libs/geography/state/src/actions/geography.actions.ts","../../../libs/geography/state/src/reducers/country-entities/country-entities.reducer.ts","../../../libs/geography/state/src/reducers/geography/geography-initial-state.ts","../../../libs/geography/state/src/reducers/geography/geography.reducer.ts","../../../libs/geography/state/src/reducers/geography-reducers.ts","../../../libs/geography/state/src/reducers/geography-store-feature-key.ts","../../../libs/geography/state/src/selectors/geography-feature.selector.ts","../../../libs/geography/state/src/selectors/country-entities.selector.ts","../../../libs/geography/state/src/selectors/geography.selector.ts","../../../libs/geography/state/src/selectors/geography-all.selector.ts","../../../libs/geography/state/src/facades/geography/geography.facade.ts","../../../libs/geography/state/src/effects/geography.effects.ts","../../../libs/geography/state/src/geography-state.module.ts","../../../libs/geography/state/src/daffodil-geography-state.ts"],"sourcesContent":["import {\n EntityAdapter,\n createEntityAdapter,\n} from '@ngrx/entity';\n\nimport { DaffCountry } from '@daffodil/geography';\n\n/**\n * Country Adapter for changing/overwriting entity state.\n */\nexport const getCountryAdapter = (() => {\n let cache;\n return <T extends DaffCountry = DaffCountry>(): EntityAdapter<T> =>\n cache = cache || createEntityAdapter<T>();\n})();\n","import { getCountryAdapter } from './country-entities-adapter';\nimport { DaffCountryEntityState } from './country-entities-state.interface';\n\n/**\n * Initial state for country entity state.\n */\nexport const daffCountryEntitiesInitialState: DaffCountryEntityState<any> = getCountryAdapter().getInitialState();\n","import { Action } from '@ngrx/store';\n\nimport { DaffStateError } from '@daffodil/core/state';\nimport { DaffCountry } from '@daffodil/geography';\n\nexport enum DaffGeographyActionTypes {\n CountryLoadAction = '[DaffGeography] Country Load Action',\n CountryLoadSuccessAction = '[DaffGeography] Country Load Success Action',\n CountryLoadFailureAction = '[DaffGeography] Country Load Failure Action',\n CountryListAction = '[DaffGeography] Country List Action',\n CountryListSuccessAction = '[DaffGeography] Country List Success Action',\n CountryListFailureAction = '[DaffGeography] Country List Failure Action',\n}\n\nexport class DaffCountryLoad<T extends DaffCountry> implements Action {\n readonly type = DaffGeographyActionTypes.CountryLoadAction;\n\n constructor(public payload: T['id']) {}\n}\n\nexport class DaffCountryLoadSuccess<T extends DaffCountry> implements Action {\n readonly type = DaffGeographyActionTypes.CountryLoadSuccessAction;\n\n constructor(public payload: T) {}\n}\n\nexport class DaffCountryLoadFailure implements Action {\n readonly type = DaffGeographyActionTypes.CountryLoadFailureAction;\n\n constructor(public payload: DaffStateError) {}\n}\n\nexport class DaffCountryList implements Action {\n readonly type = DaffGeographyActionTypes.CountryListAction;\n}\n\nexport class DaffCountryListSuccess<T extends DaffCountry> implements Action {\n readonly type = DaffGeographyActionTypes.CountryListSuccessAction;\n\n constructor(public payload: T[]) {}\n}\n\nexport class DaffCountryListFailure implements Action {\n readonly type = DaffGeographyActionTypes.CountryListFailureAction;\n\n constructor(public payload: DaffStateError) {}\n}\n\nexport type DaffGeographyActions<T extends DaffCountry> =\n | DaffCountryLoad<T>\n | DaffCountryLoadSuccess<T>\n | DaffCountryLoadFailure\n | DaffCountryList\n | DaffCountryListSuccess<T>\n | DaffCountryListFailure;\n","import { DaffCountry } from '@daffodil/geography';\n\nimport { getCountryAdapter } from './country-entities-adapter';\nimport { daffCountryEntitiesInitialState } from './country-entities-initial-state';\nimport { DaffCountryEntityState } from './country-entities-state.interface';\nimport {\n DaffGeographyActions,\n DaffGeographyActionTypes,\n} from '../../actions/public_api';\n\n/**\n * Reducer function that catches actions and changes/overwrites country entities state.\n */\nexport function daffCountryEntitiesReducer<T extends DaffCountry = DaffCountry>(\n state = daffCountryEntitiesInitialState,\n action: DaffGeographyActions<T>,\n): DaffCountryEntityState<T> {\n const adapter = getCountryAdapter<T>();\n\n switch (action.type) {\n case DaffGeographyActionTypes.CountryLoadSuccessAction:\n return adapter.upsertOne({\n ...action.payload,\n loaded: true,\n }, state);\n\n case DaffGeographyActionTypes.CountryListSuccessAction:\n return adapter.upsertMany(\n action.payload.map(country => ({\n ...country,\n // defer to the loaded state of the country already in state (if it exists) but init field to false if it does not\n loaded: (state.entities[country.id] && state.entities[country.id].loaded) || false,\n // if the country coming in has no subdivisions and the same country in state does, use the subdivisions in state\n subdivisions: country.subdivisions.length === 0 && state.entities[country.id] && state.entities[country.id].subdivisions.length > 0\n ? state.entities[country.id].subdivisions\n : country.subdivisions,\n })),\n state,\n );\n\n default:\n return state;\n }\n}\n","import { DaffGeographyReducerState } from './geography-state.interface';\n\nexport const daffGeographyInitialState: DaffGeographyReducerState = {\n loading: false,\n errors: [],\n};\n","import { DaffCountry } from '@daffodil/geography';\n\nimport { daffGeographyInitialState } from './geography-initial-state';\nimport { DaffGeographyReducerState } from './geography-state.interface';\nimport {\n DaffGeographyActions,\n DaffGeographyActionTypes,\n} from '../../actions/public_api';\n\nexport function daffGeographyReducer<T extends DaffCountry>(\n state = daffGeographyInitialState,\n action: DaffGeographyActions<T>,\n): DaffGeographyReducerState {\n switch (action.type) {\n case DaffGeographyActionTypes.CountryLoadAction:\n case DaffGeographyActionTypes.CountryListAction:\n return { ...state, loading: true };\n\n case DaffGeographyActionTypes.CountryLoadSuccessAction:\n case DaffGeographyActionTypes.CountryListSuccessAction:\n return {\n ...state,\n errors: [],\n loading: false,\n };\n\n case DaffGeographyActionTypes.CountryLoadFailureAction:\n case DaffGeographyActionTypes.CountryListFailureAction:\n return {\n ...state,\n errors: [\n ...state.errors,\n action.payload,\n ],\n loading: false,\n };\n\n default:\n return state;\n }\n}\n","import { ActionReducerMap } from '@ngrx/store';\n\nimport { daffCountryEntitiesReducer } from './country-entities/country-entities.reducer';\nimport { daffGeographyReducer } from './geography/geography.reducer';\nimport { DaffGeographyFeatureState } from './geography-reducers-state.interface';\n\nexport const daffGeographyReducers: ActionReducerMap<DaffGeographyFeatureState> = {\n geography: daffGeographyReducer,\n countries: daffCountryEntitiesReducer,\n};\n","export const DAFF_GEOGRAPHY_STORE_FEATURE_KEY = 'daffGeography';\n","import {\n createFeatureSelector,\n MemoizedSelector,\n} from '@ngrx/store';\n\nimport { DaffCountry } from '@daffodil/geography';\n\nimport { DaffGeographyStateRootSlice } from '../reducers/geography-reducers-state.interface';\nimport {\n DaffGeographyFeatureState,\n DAFF_GEOGRAPHY_STORE_FEATURE_KEY,\n} from '../reducers/public_api';\n\nexport interface DaffGeographyFeatureSelector<T extends DaffCountry = DaffCountry> {\n selectGeographyFeatureState: MemoizedSelector<DaffGeographyStateRootSlice<T>, DaffGeographyFeatureState<T>>;\n}\n\nexport const getDaffGeographyFeatureStateSelector = (() => {\n let cache;\n return <T extends DaffCountry = DaffCountry>(): DaffGeographyFeatureSelector<T> =>\n cache = cache || {\n selectGeographyFeatureState: createFeatureSelector<DaffGeographyFeatureState<T>>(DAFF_GEOGRAPHY_STORE_FEATURE_KEY),\n };\n})();\n","import { Dictionary } from '@ngrx/entity';\nimport {\n createSelector,\n MemoizedSelector,\n defaultMemoize,\n} from '@ngrx/store';\n\nimport { DaffCountry } from '@daffodil/geography';\n\nimport { getDaffGeographyFeatureStateSelector } from './geography-feature.selector';\nimport { DaffGeographyStateRootSlice } from '../reducers/geography-reducers-state.interface';\nimport {\n getCountryAdapter,\n DaffCountryEntityState,\n} from '../reducers/public_api';\n\nexport interface DaffCountryEntitySelectors<T extends DaffCountry = DaffCountry> {\n selectCountryEntitiesState: MemoizedSelector<DaffGeographyStateRootSlice<T>, DaffCountryEntityState<T>>;\n selectCountryIds: MemoizedSelector<DaffGeographyStateRootSlice<T>, T['id'][]>;\n selectCountryEntities: MemoizedSelector<DaffGeographyStateRootSlice<T>, Dictionary<T>>;\n selectAllCountries: MemoizedSelector<DaffGeographyStateRootSlice<T>, T[]>;\n selectCountryTotal: MemoizedSelector<DaffGeographyStateRootSlice<T>, number>;\n selectCountry: (id: T['id']) => MemoizedSelector<DaffGeographyStateRootSlice<T>, T>;\n selectCountrySubdivisions: (id: T['id']) => MemoizedSelector<DaffGeographyStateRootSlice<T>, T['subdivisions']>;\n selectIsCountryFullyLoaded: (id: T['id']) => MemoizedSelector<DaffGeographyStateRootSlice<T>, boolean>;\n}\n\nconst createCountryEntitySelectors = <T extends DaffCountry = DaffCountry>() => {\n const { selectGeographyFeatureState } = getDaffGeographyFeatureStateSelector<T>();\n const selectCountryEntitiesState = createSelector(\n selectGeographyFeatureState,\n state => state.countries,\n );\n const { selectIds, selectEntities, selectAll, selectTotal } = getCountryAdapter<T>().getSelectors(selectCountryEntitiesState);\n\n const selectCountry = defaultMemoize((countryId: T['id']) => createSelector(\n selectEntities,\n (countries: Dictionary<T>) => countries[countryId],\n )).memoized;\n\n const selectCountrySubdivisions = defaultMemoize((countryId: T['id']) => createSelector(\n selectCountry(countryId),\n (country: T) => country?.subdivisions || [],\n )).memoized;\n\n const selectIsCountryFullyLoaded = defaultMemoize((countryId: T['id']) => createSelector(\n selectCountry(countryId),\n (country: T) => country?.loaded,\n )).memoized;\n\n return {\n selectCountryEntitiesState,\n /**\n * Selector for country IDs.\n */\n selectCountryIds: selectIds,\n /**\n * Selector for country entities.\n */\n selectCountryEntities: selectEntities,\n /**\n * Selector for all countries.\n */\n selectAllCountries: selectAll,\n /**\n * Selector for total number of countries.\n */\n selectCountryTotal: selectTotal,\n /**\n * Selector for a specific country.\n */\n selectCountry,\n /**\n * Selector for a specific country's subdivisions.\n */\n selectCountrySubdivisions,\n /**\n * Selector for checking if a country has been fully loaded.\n * If true, then a country's subdivisions will be populated if any exist.\n */\n selectIsCountryFullyLoaded,\n };\n};\n\nexport const getDaffCountryEntitySelectors = (() => {\n let cache;\n return <T extends DaffCountry>(): DaffCountryEntitySelectors<T> =>\n cache = cache || createCountryEntitySelectors<T>();\n})();\n\n","import {\n createSelector,\n MemoizedSelector,\n} from '@ngrx/store';\n\nimport { DaffStateError } from '@daffodil/core/state';\nimport { DaffCountry } from '@daffodil/geography';\n\nimport { getDaffGeographyFeatureStateSelector } from './geography-feature.selector';\nimport { DaffGeographyStateRootSlice } from '../reducers/geography-reducers-state.interface';\nimport { DaffGeographyReducerState } from '../reducers/public_api';\n\nexport interface DaffGeographySelectors {\n selectGeographyState: MemoizedSelector<DaffGeographyStateRootSlice, DaffGeographyReducerState>;\n selectGeographyLoading: MemoizedSelector<DaffGeographyStateRootSlice, boolean>;\n selectGeographyErrors: MemoizedSelector<DaffGeographyStateRootSlice, DaffStateError[]>;\n}\n\nconst createGeographySelectors = <T extends DaffCountry = DaffCountry>() => {\n const { selectGeographyFeatureState } = getDaffGeographyFeatureStateSelector<T>();\n const selectGeographyState = createSelector(\n selectGeographyFeatureState,\n state => state.geography,\n );\n\n const selectGeographyLoading = createSelector(\n selectGeographyState,\n state => state.loading,\n );\n\n const selectGeographyErrors = createSelector(\n selectGeographyState,\n state => state.errors,\n );\n\n return {\n selectGeographyState,\n selectGeographyLoading,\n selectGeographyErrors,\n };\n};\n\nexport const getGeographySelectors = (() => {\n let cache;\n return <T extends DaffCountry = DaffCountry>(): DaffGeographySelectors =>\n cache = cache || createGeographySelectors<T>();\n})();\n","import { DaffCountry } from '@daffodil/geography';\n\nimport {\n DaffCountryEntitySelectors,\n getDaffCountryEntitySelectors,\n} from './country-entities.selector';\nimport {\n DaffGeographyFeatureSelector,\n getDaffGeographyFeatureStateSelector,\n} from './geography-feature.selector';\nimport {\n DaffGeographySelectors,\n getGeographySelectors,\n} from './geography.selector';\n\nexport interface DaffGeographyAllSelectors<T extends DaffCountry = DaffCountry> extends\n DaffCountryEntitySelectors<T>,\n DaffGeographySelectors,\n DaffGeographyFeatureSelector<T> {}\n\nexport const getDaffGeographySelectors = (() => {\n let cache;\n return <T extends DaffCountry = DaffCountry>(): DaffGeographyAllSelectors<T> =>\n cache = cache || {\n ...getGeographySelectors<T>(),\n ...getDaffCountryEntitySelectors<T>(),\n ...getDaffGeographyFeatureStateSelector<T>(),\n };\n})();\n","import { Injectable } from '@angular/core';\nimport { Dictionary } from '@ngrx/entity';\nimport {\n Action,\n Store,\n select,\n} from '@ngrx/store';\nimport { Observable } from 'rxjs';\n\nimport { DaffStateError } from '@daffodil/core/state';\nimport { DaffCountry } from '@daffodil/geography';\n\nimport { DaffGeographyFacadeInterface } from './geography-facade.interface';\nimport { DaffGeographyStateRootSlice } from '../../reducers/public_api';\nimport {\n getDaffGeographySelectors,\n DaffGeographyAllSelectors,\n} from '../../selectors/public_api';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffGeographyFacade<T extends DaffCountry = DaffCountry> implements DaffGeographyFacadeInterface<T> {\n loading$: Observable<boolean>;\n errors$: Observable<DaffStateError[]>;\n\n countries$: Observable<T[]>;\n countryIds$: Observable<T['id'][]>;\n countryCount$: Observable<number>;\n countryEntities$: Observable<Dictionary<T>>;\n\n private _selectCountry: DaffGeographyAllSelectors<T>['selectCountry'];\n private _selectCountrySubdivisions: DaffGeographyAllSelectors<T>['selectCountrySubdivisions'];\n private _selectIsCountryFullyLoaded: DaffGeographyAllSelectors<T>['selectIsCountryFullyLoaded'];\n\n constructor(private store: Store<DaffGeographyStateRootSlice<T>>) {\n const {\n selectCountryIds,\n selectCountryEntities,\n selectAllCountries,\n selectCountryTotal,\n selectGeographyLoading,\n selectGeographyErrors,\n selectCountry,\n selectCountrySubdivisions,\n selectIsCountryFullyLoaded,\n } = getDaffGeographySelectors<T>();\n\n this._selectCountry = selectCountry;\n this._selectCountrySubdivisions = selectCountrySubdivisions;\n this._selectIsCountryFullyLoaded = selectIsCountryFullyLoaded;\n\n this.loading$ = this.store.pipe(select(selectGeographyLoading));\n this.errors$ = this.store.pipe(select(selectGeographyErrors));\n\n this.countries$ = this.store.pipe(select(selectAllCountries));\n this.countryIds$ = this.store.pipe(select(selectCountryIds));\n this.countryCount$ = this.store.pipe(select(selectCountryTotal));\n this.countryEntities$ = this.store.pipe(select(selectCountryEntities));\n }\n\n getCountry(id: T['id']): Observable<T> {\n return this.store.pipe(select(this._selectCountry(id)));\n }\n\n getCountrySubdivisions(id: T['id']): Observable<T['subdivisions']> {\n return this.store.pipe(select(this._selectCountrySubdivisions(id)));\n }\n\n isCountryFullyLoaded(id: T['id']): Observable<boolean> {\n return this.store.pipe(select(this._selectIsCountryFullyLoaded(id)));\n }\n\n dispatch(action: Action) {\n this.store.dispatch(action);\n }\n}\n","import {\n Injectable,\n Inject,\n} from '@angular/core';\nimport {\n Actions,\n createEffect,\n ofType,\n} from '@ngrx/effects';\nimport { of } from 'rxjs';\nimport {\n switchMap,\n map,\n catchError,\n} from 'rxjs/operators';\n\nimport { DaffError } from '@daffodil/core';\nimport { ErrorTransformer } from '@daffodil/core/state';\nimport {\n DaffCountry,\n DAFF_GEOGRAPHY_ERROR_MATCHER,\n} from '@daffodil/geography';\nimport {\n DaffGeographyServiceInterface,\n DaffGeographyDriver,\n} from '@daffodil/geography/driver';\n\nimport {\n DaffGeographyActionTypes,\n DaffCountryLoad,\n DaffCountryLoadSuccess,\n DaffCountryLoadFailure,\n DaffCountryList,\n DaffCountryListSuccess,\n DaffCountryListFailure,\n} from '../actions/public_api';\n\n@Injectable()\nexport class DaffGeographyEffects<T extends DaffCountry> {\n constructor(\n private actions$: Actions,\n @Inject(DaffGeographyDriver) private driver: DaffGeographyServiceInterface<T>,\n @Inject(DAFF_GEOGRAPHY_ERROR_MATCHER) private errorMatcher: ErrorTransformer,\n ) {}\n\n\n get$ = createEffect(() => this.actions$.pipe(\n ofType(DaffGeographyActionTypes.CountryLoadAction),\n switchMap((action: DaffCountryLoad<T>) => this.driver.get(action.payload).pipe(\n map(resp => new DaffCountryLoadSuccess(resp)),\n catchError((error: DaffError) => of(new DaffCountryLoadFailure(this.errorMatcher(error)))),\n )),\n ));\n\n\n list$ = createEffect(() => this.actions$.pipe(\n ofType(DaffGeographyActionTypes.CountryListAction),\n switchMap((action: DaffCountryList) => this.driver.list().pipe(\n map(resp => new DaffCountryListSuccess(resp)),\n catchError((error: DaffError) => of(new DaffCountryListFailure(this.errorMatcher(error)))),\n )),\n ));\n}\n","import { NgModule } from '@angular/core';\nimport { EffectsModule } from '@ngrx/effects';\nimport { StoreModule } from '@ngrx/store';\n\nimport { DaffGeographyEffects } from './effects/geography.effects';\nimport {\n daffGeographyReducers,\n DAFF_GEOGRAPHY_STORE_FEATURE_KEY,\n} from './reducers/public_api';\n\n@NgModule({\n imports: [\n StoreModule.forFeature(DAFF_GEOGRAPHY_STORE_FEATURE_KEY, daffGeographyReducers),\n EffectsModule.forFeature([\n DaffGeographyEffects,\n ]),\n ],\n})\nexport class DaffGeographyStateModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2"],"mappings":";;;;;;;;;;;;AAOA;;AAEG;AACU,MAAA,iBAAiB,GAAG,CAAC,MAAK;AACrC,IAAA,IAAI,KAAK,CAAC;IACV,OAAO,MACL,KAAK,GAAG,KAAK,IAAI,mBAAmB,EAAK,CAAC;AAC9C,CAAC;;ACXD;;AAEG;MACU,+BAA+B,GAAgC,iBAAiB,EAAE,CAAC,eAAe;;ACDnG,IAAA,yBAOX;AAPD,CAAA,UAAY,wBAAwB,EAAA;AAClC,IAAA,wBAAA,CAAA,mBAAA,CAAA,GAAA,qCAAyD,CAAA;AACzD,IAAA,wBAAA,CAAA,0BAAA,CAAA,GAAA,6CAAwE,CAAA;AACxE,IAAA,wBAAA,CAAA,0BAAA,CAAA,GAAA,6CAAwE,CAAA;AACxE,IAAA,wBAAA,CAAA,mBAAA,CAAA,GAAA,qCA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CAAA;;wIAAxB,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;yIAAxB,wBAAwB,EAAA,OAAA,EAAA,CAAA,EAAA,CAAA,kBAAA,EAAAC,IAAA,CAAA,oBAAA,CAAA,EAAA,CAAA,CAAA;yIAAxB,wBAAwB,EAAA,OAAA,EAAA,CANjC,WAAW,CAAC,UAAU,CAAC,gCAAgC,EAAE,qBAAqB,CAAC;QAC/E,aAAa,CAAC,UAAU,CAAC;YACvB,oBAAoB;SACrB,CAAC,CAAA,EAAA,CAAA,CAAA;2FAGO,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBARpC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;AACP,wBAAA,WAAW,CAAC,UAAU,CAAC,gCAAgC,EAAE,qBAAqB,CAAC;wBAC/E,aAAa,CAAC,UAAU,CAAC;4BACvB,oBAAoB;yBACrB,CAAC;AACH,qBAAA;iBACF,CAAA;;;ACjBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"daffodil-geography-state.mjs","sources":["../../../libs/geography/state/src/reducers/country-entities/country-entities-adapter.ts","../../../libs/geography/state/src/reducers/country-entities/country-entities-initial-state.ts","../../../libs/geography/state/src/actions/geography.actions.ts","../../../libs/geography/state/src/reducers/country-entities/country-entities.reducer.ts","../../../libs/geography/state/src/reducers/geography/geography-initial-state.ts","../../../libs/geography/state/src/reducers/geography/geography.reducer.ts","../../../libs/geography/state/src/reducers/geography-reducers.ts","../../../libs/geography/state/src/reducers/geography-store-feature-key.ts","../../../libs/geography/state/src/selectors/geography-feature.selector.ts","../../../libs/geography/state/src/selectors/country-entities.selector.ts","../../../libs/geography/state/src/selectors/geography.selector.ts","../../../libs/geography/state/src/selectors/geography-all.selector.ts","../../../libs/geography/state/src/injection-tokens/error-matcher.token.ts","../../../libs/geography/state/src/facades/geography/geography.facade.ts","../../../libs/geography/state/src/effects/geography.effects.ts","../../../libs/geography/state/src/geography-state.module.ts","../../../libs/geography/state/src/daffodil-geography-state.ts"],"sourcesContent":["import {\n EntityAdapter,\n createEntityAdapter,\n} from '@ngrx/entity';\n\nimport { DaffCountry } from '@daffodil/geography';\n\n/**\n * Country Adapter for changing/overwriting entity state.\n */\nexport const getCountryAdapter = (() => {\n let cache;\n return <T extends DaffCountry = DaffCountry>(): EntityAdapter<T> =>\n cache = cache || createEntityAdapter<T>();\n})();\n","import { getCountryAdapter } from './country-entities-adapter';\nimport { DaffCountryEntityState } from './country-entities-state.interface';\n\n/**\n * Initial state for country entity state.\n */\nexport const daffCountryEntitiesInitialState: DaffCountryEntityState<any> = getCountryAdapter().getInitialState();\n","import { Action } from '@ngrx/store';\n\nimport { DaffStateError } from '@daffodil/core/state';\nimport { DaffCountry } from '@daffodil/geography';\n\nexport enum DaffGeographyActionTypes {\n CountryLoadAction = '[DaffGeography] Country Load Action',\n CountryLoadSuccessAction = '[DaffGeography] Country Load Success Action',\n CountryLoadFailureAction = '[DaffGeography] Country Load Failure Action',\n CountryListAction = '[DaffGeography] Country List Action',\n CountryListSuccessAction = '[DaffGeography] Country List Success Action',\n CountryListFailureAction = '[DaffGeography] Country List Failure Action',\n}\n\nexport class DaffCountryLoad<T extends DaffCountry> implements Action {\n readonly type = DaffGeographyActionTypes.CountryLoadAction;\n\n constructor(public payload: T['id']) {}\n}\n\nexport class DaffCountryLoadSuccess<T extends DaffCountry> implements Action {\n readonly type = DaffGeographyActionTypes.CountryLoadSuccessAction;\n\n constructor(public payload: T) {}\n}\n\nexport class DaffCountryLoadFailure implements Action {\n readonly type = DaffGeographyActionTypes.CountryLoadFailureAction;\n\n constructor(public payload: DaffStateError) {}\n}\n\nexport class DaffCountryList implements Action {\n readonly type = DaffGeographyActionTypes.CountryListAction;\n}\n\nexport class DaffCountryListSuccess<T extends DaffCountry> implements Action {\n readonly type = DaffGeographyActionTypes.CountryListSuccessAction;\n\n constructor(public payload: T[]) {}\n}\n\nexport class DaffCountryListFailure implements Action {\n readonly type = DaffGeographyActionTypes.CountryListFailureAction;\n\n constructor(public payload: DaffStateError) {}\n}\n\nexport type DaffGeographyActions<T extends DaffCountry> =\n | DaffCountryLoad<T>\n | DaffCountryLoadSuccess<T>\n | DaffCountryLoadFailure\n | DaffCountryList\n | DaffCountryListSuccess<T>\n | DaffCountryListFailure;\n","import { DaffCountry } from '@daffodil/geography';\n\nimport { getCountryAdapter } from './country-entities-adapter';\nimport { daffCountryEntitiesInitialState } from './country-entities-initial-state';\nimport { DaffCountryEntityState } from './country-entities-state.interface';\nimport {\n DaffGeographyActions,\n DaffGeographyActionTypes,\n} from '../../actions/public_api';\n\n/**\n * Reducer function that catches actions and changes/overwrites country entities state.\n */\nexport function daffCountryEntitiesReducer<T extends DaffCountry = DaffCountry>(\n state = daffCountryEntitiesInitialState,\n action: DaffGeographyActions<T>,\n): DaffCountryEntityState<T> {\n const adapter = getCountryAdapter<T>();\n\n switch (action.type) {\n case DaffGeographyActionTypes.CountryLoadSuccessAction:\n return adapter.upsertOne({\n ...action.payload,\n loaded: true,\n }, state);\n\n case DaffGeographyActionTypes.CountryListSuccessAction:\n return adapter.upsertMany(\n action.payload.map(country => ({\n ...country,\n // defer to the loaded state of the country already in state (if it exists) but init field to false if it does not\n loaded: (state.entities[country.id] && state.entities[country.id].loaded) || false,\n // if the country coming in has no subdivisions and the same country in state does, use the subdivisions in state\n subdivisions: country.subdivisions.length === 0 && state.entities[country.id] && state.entities[country.id].subdivisions.length > 0\n ? state.entities[country.id].subdivisions\n : country.subdivisions,\n })),\n state,\n );\n\n default:\n return state;\n }\n}\n","import { DaffGeographyReducerState } from './geography-state.interface';\n\nexport const daffGeographyInitialState: DaffGeographyReducerState = {\n loading: false,\n errors: [],\n};\n","import { DaffCountry } from '@daffodil/geography';\n\nimport { daffGeographyInitialState } from './geography-initial-state';\nimport { DaffGeographyReducerState } from './geography-state.interface';\nimport {\n DaffGeographyActions,\n DaffGeographyActionTypes,\n} from '../../actions/public_api';\n\nexport function daffGeographyReducer<T extends DaffCountry>(\n state = daffGeographyInitialState,\n action: DaffGeographyActions<T>,\n): DaffGeographyReducerState {\n switch (action.type) {\n case DaffGeographyActionTypes.CountryLoadAction:\n case DaffGeographyActionTypes.CountryListAction:\n return { ...state, loading: true };\n\n case DaffGeographyActionTypes.CountryLoadSuccessAction:\n case DaffGeographyActionTypes.CountryListSuccessAction:\n return {\n ...state,\n errors: [],\n loading: false,\n };\n\n case DaffGeographyActionTypes.CountryLoadFailureAction:\n case DaffGeographyActionTypes.CountryListFailureAction:\n return {\n ...state,\n errors: [\n ...state.errors,\n action.payload,\n ],\n loading: false,\n };\n\n default:\n return state;\n }\n}\n","import { ActionReducerMap } from '@ngrx/store';\n\nimport { daffCountryEntitiesReducer } from './country-entities/country-entities.reducer';\nimport { daffGeographyReducer } from './geography/geography.reducer';\nimport { DaffGeographyFeatureState } from './geography-reducers-state.interface';\n\nexport const daffGeographyReducers: ActionReducerMap<DaffGeographyFeatureState> = {\n geography: daffGeographyReducer,\n countries: daffCountryEntitiesReducer,\n};\n","export const DAFF_GEOGRAPHY_STORE_FEATURE_KEY = 'daffGeography';\n","import {\n createFeatureSelector,\n MemoizedSelector,\n} from '@ngrx/store';\n\nimport { DaffCountry } from '@daffodil/geography';\n\nimport { DaffGeographyStateRootSlice } from '../reducers/geography-reducers-state.interface';\nimport {\n DaffGeographyFeatureState,\n DAFF_GEOGRAPHY_STORE_FEATURE_KEY,\n} from '../reducers/public_api';\n\nexport interface DaffGeographyFeatureSelector<T extends DaffCountry = DaffCountry> {\n selectGeographyFeatureState: MemoizedSelector<DaffGeographyStateRootSlice<T>, DaffGeographyFeatureState<T>>;\n}\n\nexport const getDaffGeographyFeatureStateSelector = (() => {\n let cache;\n return <T extends DaffCountry = DaffCountry>(): DaffGeographyFeatureSelector<T> =>\n cache = cache || {\n selectGeographyFeatureState: createFeatureSelector<DaffGeographyFeatureState<T>>(DAFF_GEOGRAPHY_STORE_FEATURE_KEY),\n };\n})();\n","import { Dictionary } from '@ngrx/entity';\nimport {\n createSelector,\n MemoizedSelector,\n defaultMemoize,\n} from '@ngrx/store';\n\nimport { DaffCountry } from '@daffodil/geography';\n\nimport { getDaffGeographyFeatureStateSelector } from './geography-feature.selector';\nimport { DaffGeographyStateRootSlice } from '../reducers/geography-reducers-state.interface';\nimport {\n getCountryAdapter,\n DaffCountryEntityState,\n} from '../reducers/public_api';\n\nexport interface DaffCountryEntitySelectors<T extends DaffCountry = DaffCountry> {\n selectCountryEntitiesState: MemoizedSelector<DaffGeographyStateRootSlice<T>, DaffCountryEntityState<T>>;\n selectCountryIds: MemoizedSelector<DaffGeographyStateRootSlice<T>, T['id'][]>;\n selectCountryEntities: MemoizedSelector<DaffGeographyStateRootSlice<T>, Dictionary<T>>;\n selectAllCountries: MemoizedSelector<DaffGeographyStateRootSlice<T>, T[]>;\n selectCountryTotal: MemoizedSelector<DaffGeographyStateRootSlice<T>, number>;\n selectCountry: (id: T['id']) => MemoizedSelector<DaffGeographyStateRootSlice<T>, T>;\n selectCountrySubdivisions: (id: T['id']) => MemoizedSelector<DaffGeographyStateRootSlice<T>, T['subdivisions']>;\n selectIsCountryFullyLoaded: (id: T['id']) => MemoizedSelector<DaffGeographyStateRootSlice<T>, boolean>;\n}\n\nconst createCountryEntitySelectors = <T extends DaffCountry = DaffCountry>() => {\n const { selectGeographyFeatureState } = getDaffGeographyFeatureStateSelector<T>();\n const selectCountryEntitiesState = createSelector(\n selectGeographyFeatureState,\n state => state.countries,\n );\n const { selectIds, selectEntities, selectAll, selectTotal } = getCountryAdapter<T>().getSelectors(selectCountryEntitiesState);\n\n const selectCountry = defaultMemoize((countryId: T['id']) => createSelector(\n selectEntities,\n (countries: Dictionary<T>) => countries[countryId],\n )).memoized;\n\n const selectCountrySubdivisions = defaultMemoize((countryId: T['id']) => createSelector(\n selectCountry(countryId),\n (country: T) => country?.subdivisions || [],\n )).memoized;\n\n const selectIsCountryFullyLoaded = defaultMemoize((countryId: T['id']) => createSelector(\n selectCountry(countryId),\n (country: T) => country?.loaded,\n )).memoized;\n\n return {\n selectCountryEntitiesState,\n /**\n * Selector for country IDs.\n */\n selectCountryIds: selectIds,\n /**\n * Selector for country entities.\n */\n selectCountryEntities: selectEntities,\n /**\n * Selector for all countries.\n */\n selectAllCountries: selectAll,\n /**\n * Selector for total number of countries.\n */\n selectCountryTotal: selectTotal,\n /**\n * Selector for a specific country.\n */\n selectCountry,\n /**\n * Selector for a specific country's subdivisions.\n */\n selectCountrySubdivisions,\n /**\n * Selector for checking if a country has been fully loaded.\n * If true, then a country's subdivisions will be populated if any exist.\n */\n selectIsCountryFullyLoaded,\n };\n};\n\nexport const getDaffCountryEntitySelectors = (() => {\n let cache;\n return <T extends DaffCountry>(): DaffCountryEntitySelectors<T> =>\n cache = cache || createCountryEntitySelectors<T>();\n})();\n\n","import {\n createSelector,\n MemoizedSelector,\n} from '@ngrx/store';\n\nimport { DaffStateError } from '@daffodil/core/state';\nimport { DaffCountry } from '@daffodil/geography';\n\nimport { getDaffGeographyFeatureStateSelector } from './geography-feature.selector';\nimport { DaffGeographyStateRootSlice } from '../reducers/geography-reducers-state.interface';\nimport { DaffGeographyReducerState } from '../reducers/public_api';\n\nexport interface DaffGeographySelectors {\n selectGeographyState: MemoizedSelector<DaffGeographyStateRootSlice, DaffGeographyReducerState>;\n selectGeographyLoading: MemoizedSelector<DaffGeographyStateRootSlice, boolean>;\n selectGeographyErrors: MemoizedSelector<DaffGeographyStateRootSlice, DaffStateError[]>;\n}\n\nconst createGeographySelectors = <T extends DaffCountry = DaffCountry>() => {\n const { selectGeographyFeatureState } = getDaffGeographyFeatureStateSelector<T>();\n const selectGeographyState = createSelector(\n selectGeographyFeatureState,\n state => state.geography,\n );\n\n const selectGeographyLoading = createSelector(\n selectGeographyState,\n state => state.loading,\n );\n\n const selectGeographyErrors = createSelector(\n selectGeographyState,\n state => state.errors,\n );\n\n return {\n selectGeographyState,\n selectGeographyLoading,\n selectGeographyErrors,\n };\n};\n\nexport const getGeographySelectors = (() => {\n let cache;\n return <T extends DaffCountry = DaffCountry>(): DaffGeographySelectors =>\n cache = cache || createGeographySelectors<T>();\n})();\n","import { DaffCountry } from '@daffodil/geography';\n\nimport {\n DaffCountryEntitySelectors,\n getDaffCountryEntitySelectors,\n} from './country-entities.selector';\nimport {\n DaffGeographyFeatureSelector,\n getDaffGeographyFeatureStateSelector,\n} from './geography-feature.selector';\nimport {\n DaffGeographySelectors,\n getGeographySelectors,\n} from './geography.selector';\n\nexport interface DaffGeographyAllSelectors<T extends DaffCountry = DaffCountry> extends\n DaffCountryEntitySelectors<T>,\n DaffGeographySelectors,\n DaffGeographyFeatureSelector<T> {}\n\nexport const getDaffGeographySelectors = (() => {\n let cache;\n return <T extends DaffCountry = DaffCountry>(): DaffGeographyAllSelectors<T> =>\n cache = cache || {\n ...getGeographySelectors<T>(),\n ...getDaffCountryEntitySelectors<T>(),\n ...getDaffGeographyFeatureStateSelector<T>(),\n };\n})();\n","import { InjectionToken } from '@angular/core';\n\nimport { daffTransformErrorToStateError } from '@daffodil/core/state';\n\n/**\n * Transforms `DaffError`s into `DaffStateError`s before they are serialized into state.\n * Can be used to further refine Daffodil errors into more specific app errors.\n */\nexport const DAFF_GEOGRAPHY_ERROR_MATCHER = new InjectionToken<typeof daffTransformErrorToStateError>(\n 'DAFF_GEOGRAPHY_ERROR_MATCHER',\n { factory: () => daffTransformErrorToStateError },\n);\n","import { Injectable } from '@angular/core';\nimport { Dictionary } from '@ngrx/entity';\nimport {\n Action,\n Store,\n select,\n} from '@ngrx/store';\nimport { Observable } from 'rxjs';\n\nimport { DaffStateError } from '@daffodil/core/state';\nimport { DaffCountry } from '@daffodil/geography';\n\nimport { DaffGeographyFacadeInterface } from './geography-facade.interface';\nimport { DaffGeographyStateRootSlice } from '../../reducers/public_api';\nimport {\n getDaffGeographySelectors,\n DaffGeographyAllSelectors,\n} from '../../selectors/public_api';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffGeographyFacade<T extends DaffCountry = DaffCountry> implements DaffGeographyFacadeInterface<T> {\n loading$: Observable<boolean>;\n errors$: Observable<DaffStateError[]>;\n\n countries$: Observable<T[]>;\n countryIds$: Observable<T['id'][]>;\n countryCount$: Observable<number>;\n countryEntities$: Observable<Dictionary<T>>;\n\n private _selectCountry: DaffGeographyAllSelectors<T>['selectCountry'];\n private _selectCountrySubdivisions: DaffGeographyAllSelectors<T>['selectCountrySubdivisions'];\n private _selectIsCountryFullyLoaded: DaffGeographyAllSelectors<T>['selectIsCountryFullyLoaded'];\n\n constructor(private store: Store<DaffGeographyStateRootSlice<T>>) {\n const {\n selectCountryIds,\n selectCountryEntities,\n selectAllCountries,\n selectCountryTotal,\n selectGeographyLoading,\n selectGeographyErrors,\n selectCountry,\n selectCountrySubdivisions,\n selectIsCountryFullyLoaded,\n } = getDaffGeographySelectors<T>();\n\n this._selectCountry = selectCountry;\n this._selectCountrySubdivisions = selectCountrySubdivisions;\n this._selectIsCountryFullyLoaded = selectIsCountryFullyLoaded;\n\n this.loading$ = this.store.pipe(select(selectGeographyLoading));\n this.errors$ = this.store.pipe(select(selectGeographyErrors));\n\n this.countries$ = this.store.pipe(select(selectAllCountries));\n this.countryIds$ = this.store.pipe(select(selectCountryIds));\n this.countryCount$ = this.store.pipe(select(selectCountryTotal));\n this.countryEntities$ = this.store.pipe(select(selectCountryEntities));\n }\n\n getCountry(id: T['id']): Observable<T> {\n return this.store.pipe(select(this._selectCountry(id)));\n }\n\n getCountrySubdivisions(id: T['id']): Observable<T['subdivisions']> {\n return this.store.pipe(select(this._selectCountrySubdivisions(id)));\n }\n\n isCountryFullyLoaded(id: T['id']): Observable<boolean> {\n return this.store.pipe(select(this._selectIsCountryFullyLoaded(id)));\n }\n\n dispatch(action: Action) {\n this.store.dispatch(action);\n }\n}\n","import {\n Injectable,\n Inject,\n} from '@angular/core';\nimport {\n Actions,\n createEffect,\n ofType,\n} from '@ngrx/effects';\nimport { of } from 'rxjs';\nimport {\n switchMap,\n map,\n catchError,\n} from 'rxjs/operators';\n\nimport { DaffError } from '@daffodil/core';\nimport { ErrorTransformer } from '@daffodil/core/state';\nimport { DaffCountry } from '@daffodil/geography';\nimport {\n DaffGeographyServiceInterface,\n DaffGeographyDriver,\n} from '@daffodil/geography/driver';\n\nimport {\n DaffGeographyActionTypes,\n DaffCountryLoad,\n DaffCountryLoadSuccess,\n DaffCountryLoadFailure,\n DaffCountryList,\n DaffCountryListSuccess,\n DaffCountryListFailure,\n} from '../actions/public_api';\nimport { DAFF_GEOGRAPHY_ERROR_MATCHER } from '../injection-tokens/public_api';\n\n@Injectable()\nexport class DaffGeographyEffects<T extends DaffCountry> {\n constructor(\n private actions$: Actions,\n @Inject(DaffGeographyDriver) private driver: DaffGeographyServiceInterface<T>,\n @Inject(DAFF_GEOGRAPHY_ERROR_MATCHER) private errorMatcher: ErrorTransformer,\n ) {}\n\n\n get$ = createEffect(() => this.actions$.pipe(\n ofType(DaffGeographyActionTypes.CountryLoadAction),\n switchMap((action: DaffCountryLoad<T>) => this.driver.get(action.payload).pipe(\n map(resp => new DaffCountryLoadSuccess(resp)),\n catchError((error: DaffError) => of(new DaffCountryLoadFailure(this.errorMatcher(error)))),\n )),\n ));\n\n\n list$ = createEffect(() => this.actions$.pipe(\n ofType(DaffGeographyActionTypes.CountryListAction),\n switchMap((action: DaffCountryList) => this.driver.list().pipe(\n map(resp => new DaffCountryListSuccess(resp)),\n catchError((error: DaffError) => of(new DaffCountryListFailure(this.errorMatcher(error)))),\n )),\n ));\n}\n","import { NgModule } from '@angular/core';\nimport { EffectsModule } from '@ngrx/effects';\nimport { StoreModule } from '@ngrx/store';\n\nimport { DaffGeographyEffects } from './effects/geography.effects';\nimport {\n daffGeographyReducers,\n DAFF_GEOGRAPHY_STORE_FEATURE_KEY,\n} from './reducers/public_api';\n\n@NgModule({\n imports: [\n StoreModule.forFeature(DAFF_GEOGRAPHY_STORE_FEATURE_KEY, daffGeographyReducers),\n EffectsModule.forFeature([\n DaffGeographyEffects,\n ]),\n ],\n})\nexport class DaffGeographyStateModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2"],"mappings":";;;;;;;;;;;;AAOA;;AAEG;AACU,MAAA,iBAAiB,GAAG,CAAC,MAAK;AACrC,IAAA,IAAI,KAAK,CAAC;IACV,OAAO,MACL,KAAK,GAAG,KAAK,IAAI,mBAAmB,EAAK,CAAC;AAC9C,CAAC;;ACXD;;AAEG;MACU,+BAA+B,GAAgC,iBAAiB,EAAE,CAAC,eAAe;;ACDnG,IAAA,yBAOX;AAPD,CAAA,UAAY,wBAAwB,EAAA;AAClC,IAAA,wBAAA,CAAA,mBAAA,CAAA,GAAA,qCAAyD,CAAA;AACzD,IAAA,wBAAA,CAAA,0BAAA,CAAA,GAAA,6CAAwE,CAAA;AACxE,IAAA,wBAAA,CAAA,0BAAA,CAAA,GAAA,6CAAwE,CAAA;AACxE,IAAA,wBAAA,CAAA,mBAAA,CAAA,GAAA,qCAAyD,CAAA;AACzD,IAAA,wBAAA,CAAA,0BAAA,CAAA,GAAA,6CAAwE,CAAA;AACxE,IAAA,wBAAA,CAAA,0BAAA,CAAA,GAAA,6CAAwE,CAAA;AAC1E,CAAC,EAPW,wBAAwB,KAAxB,wBAAwB,GAOnC,EAAA,CAAA,CAAA,CAAA;MAEY,eAAe,CAAA;AAG1B,IAAA,WAAA,CAAmB,OAAgB,EAAA;AAAhB,QAAA,IAAO,CAAA,OAAA,GAAP,OAAO,CAAS;AAF1B,QAAA,IAAA,CAAA,IAAI,GAAG,wBAAwB,CAAC,iBAAiB,CAAC;KAEpB;AACxC,CAAA;MAEY,sBAAsB,CAAA;AAGjC,IAAA,WAAA,CAAmB,OAAU,EAAA;AAAV,QAAA,IAAO,CAAA,OAAA,GAAP,OAAO,CAAG;AAFpB,QAAA,IAAA,CAAA,IAAI,GAAG,wBAAwB,CAAC,wBAAwB,CAA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AQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;AACP,wBAAA,WAAW,CAAC,UAAU,CAAC,gCAAgC,EAAE,qBAAqB,CAAC;wBAC/E,aAAa,CAAC,UAAU,CAAC;4BACvB,oBAAoB;yBACrB,CAAC;AACH,qBAAA;iBACF,CAAA;;;ACjBD;;AAEG;;;;"}
|
|
@@ -54,50 +54,51 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
54
54
|
}]
|
|
55
55
|
}], ctorParameters: function () { return []; } });
|
|
56
56
|
|
|
57
|
-
class
|
|
57
|
+
class MockSubdivision {
|
|
58
58
|
constructor() {
|
|
59
59
|
this.id = faker.datatype.uuid();
|
|
60
60
|
this.name = faker.random.word();
|
|
61
|
-
this.
|
|
62
|
-
this.alpha2 = faker.random.alphaNumeric(2);
|
|
63
|
-
this.alpha3 = faker.random.alphaNumeric(3);
|
|
64
|
-
this.subdivisions = [];
|
|
61
|
+
this.iso_3166_2 = faker.random.alphaNumeric(2);
|
|
65
62
|
}
|
|
66
63
|
}
|
|
67
|
-
class
|
|
64
|
+
class DaffSubdivisionFactory extends DaffModelFactory {
|
|
68
65
|
constructor() {
|
|
69
|
-
super(
|
|
66
|
+
super(MockSubdivision);
|
|
70
67
|
}
|
|
71
68
|
}
|
|
72
|
-
/** @nocollapse */
|
|
73
|
-
/** @nocollapse */
|
|
74
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type:
|
|
69
|
+
/** @nocollapse */ DaffSubdivisionFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffSubdivisionFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
70
|
+
/** @nocollapse */ DaffSubdivisionFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffSubdivisionFactory, providedIn: 'root' });
|
|
71
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffSubdivisionFactory, decorators: [{
|
|
75
72
|
type: Injectable,
|
|
76
73
|
args: [{
|
|
77
74
|
providedIn: 'root',
|
|
78
75
|
}]
|
|
79
76
|
}], ctorParameters: function () { return []; } });
|
|
80
77
|
|
|
81
|
-
class
|
|
82
|
-
constructor() {
|
|
78
|
+
class MockCountry {
|
|
79
|
+
constructor(subdivisionFactory) {
|
|
80
|
+
this.subdivisionFactory = subdivisionFactory;
|
|
83
81
|
this.id = faker.datatype.uuid();
|
|
84
82
|
this.name = faker.random.word();
|
|
85
|
-
this.
|
|
83
|
+
this.name_en = faker.random.word();
|
|
84
|
+
this.alpha2 = faker.random.alphaNumeric(2);
|
|
85
|
+
this.alpha3 = faker.random.alphaNumeric(3);
|
|
86
|
+
this.subdivisions = this.subdivisionFactory.createMany(faker.datatype.number({ min: 0, max: 10 }));
|
|
86
87
|
}
|
|
87
88
|
}
|
|
88
|
-
class
|
|
89
|
-
constructor() {
|
|
90
|
-
super(
|
|
89
|
+
class DaffCountryFactory extends DaffModelFactory {
|
|
90
|
+
constructor(subdivisionFactory) {
|
|
91
|
+
super(MockCountry, subdivisionFactory);
|
|
91
92
|
}
|
|
92
93
|
}
|
|
93
|
-
/** @nocollapse */
|
|
94
|
-
/** @nocollapse */
|
|
95
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type:
|
|
94
|
+
/** @nocollapse */ DaffCountryFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCountryFactory, deps: [{ token: DaffSubdivisionFactory }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
95
|
+
/** @nocollapse */ DaffCountryFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCountryFactory, providedIn: 'root' });
|
|
96
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCountryFactory, decorators: [{
|
|
96
97
|
type: Injectable,
|
|
97
98
|
args: [{
|
|
98
99
|
providedIn: 'root',
|
|
99
100
|
}]
|
|
100
|
-
}], ctorParameters: function () { return []; } });
|
|
101
|
+
}], ctorParameters: function () { return [{ type: DaffSubdivisionFactory }]; } });
|
|
101
102
|
|
|
102
103
|
/**
|
|
103
104
|
* Generated bundle index. Do not edit.
|