@daffodil/geography 0.87.2 → 0.89.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/driver/in-memory/index.d.ts +59 -1
- package/driver/index.d.ts +32 -1
- package/driver/magento/index.d.ts +95 -1
- package/driver/testing/index.d.ts +29 -1
- package/fesm2022/daffodil-geography-driver-in-memory.mjs +10 -10
- package/fesm2022/daffodil-geography-driver-in-memory.mjs.map +1 -1
- package/fesm2022/daffodil-geography-driver-magento.mjs +13 -13
- package/fesm2022/daffodil-geography-driver-magento.mjs.map +1 -1
- package/fesm2022/daffodil-geography-driver-testing.mjs +7 -7
- package/fesm2022/daffodil-geography-driver-testing.mjs.map +1 -1
- package/fesm2022/daffodil-geography-driver.mjs.map +1 -1
- package/fesm2022/daffodil-geography-state-testing.mjs +7 -7
- package/fesm2022/daffodil-geography-state-testing.mjs.map +1 -1
- package/fesm2022/daffodil-geography-state.mjs +10 -10
- package/fesm2022/daffodil-geography-state.mjs.map +1 -1
- package/fesm2022/daffodil-geography-testing.mjs +17 -17
- package/fesm2022/daffodil-geography-testing.mjs.map +1 -1
- package/fesm2022/daffodil-geography.mjs.map +1 -1
- package/index.d.ts +77 -1
- package/package.json +1 -1
- package/state/index.d.ts +163 -1
- package/state/testing/index.d.ts +33 -1
- package/testing/index.d.ts +63 -1
- package/comparators/address.d.ts +0 -8
- package/comparators/personal-address.d.ts +0 -8
- package/comparators/public_api.d.ts +0 -2
- package/driver/errors/country-not-found.d.ts +0 -6
- package/driver/errors/invalid-api-response.d.ts +0 -6
- package/driver/errors/public_api.d.ts +0 -2
- package/driver/in-memory/backend/geography.service.d.ts +0 -32
- package/driver/in-memory/collection-name.const.d.ts +0 -1
- package/driver/in-memory/drivers/geography-driver.module.d.ts +0 -9
- package/driver/in-memory/drivers/geography.service.d.ts +0 -18
- package/driver/in-memory/drivers/public_api.d.ts +0 -2
- package/driver/in-memory/public_api.d.ts +0 -2
- package/driver/interfaces/geography-service.interface.d.ts +0 -13
- package/driver/magento/errors/codes.d.ts +0 -3
- package/driver/magento/errors/map.d.ts +0 -2
- package/driver/magento/errors/transform.d.ts +0 -1
- package/driver/magento/geography-driver.module.d.ts +0 -9
- package/driver/magento/geography.service.d.ts +0 -20
- package/driver/magento/models/responses/country.d.ts +0 -10
- package/driver/magento/models/responses/public_api.d.ts +0 -2
- package/driver/magento/models/responses/region.d.ts +0 -6
- package/driver/magento/public_api.d.ts +0 -6
- package/driver/magento/queries/fragments/country.d.ts +0 -1
- package/driver/magento/queries/fragments/public_api.d.ts +0 -2
- package/driver/magento/queries/fragments/region.d.ts +0 -1
- package/driver/magento/queries/get-countries.d.ts +0 -2
- package/driver/magento/queries/get-country.d.ts +0 -2
- package/driver/magento/queries/public_api.d.ts +0 -4
- package/driver/magento/queries/responses/get-countries.d.ts +0 -4
- package/driver/magento/queries/responses/get-country.d.ts +0 -4
- package/driver/magento/queries/responses/public_api.d.ts +0 -2
- package/driver/magento/transforms/responses/country.service.d.ts +0 -18
- package/driver/magento/transforms/responses/subdivision.service.d.ts +0 -14
- package/driver/magento/validators/get-countries.d.ts +0 -3
- package/driver/magento/validators/public_api.d.ts +0 -1
- package/driver/public_api.d.ts +0 -2
- package/driver/testing/drivers/geography-driver.module.d.ts +0 -9
- package/driver/testing/drivers/geography.service.d.ts +0 -17
- package/driver/testing/drivers/public_api.d.ts +0 -2
- package/driver/testing/public_api.d.ts +0 -1
- package/models/address.d.ts +0 -18
- package/models/country.d.ts +0 -18
- package/models/personal-address.d.ts +0 -14
- package/models/public_api.d.ts +0 -4
- package/models/subdivision.d.ts +0 -9
- package/public_api.d.ts +0 -2
- package/state/actions/geography.actions.d.ts +0 -40
- package/state/actions/public_api.d.ts +0 -1
- package/state/effects/geography.effects.d.ts +0 -16
- package/state/facades/geography/geography-facade.interface.d.ts +0 -16
- package/state/facades/geography/geography.facade.d.ts +0 -30
- package/state/geography-state.module.d.ts +0 -8
- package/state/injection-tokens/error-matcher.token.d.ts +0 -6
- package/state/injection-tokens/public_api.d.ts +0 -1
- package/state/public_api.d.ts +0 -7
- package/state/reducers/country-entities/country-entities-adapter.d.ts +0 -6
- package/state/reducers/country-entities/country-entities-initial-state.d.ts +0 -5
- package/state/reducers/country-entities/country-entities-state.interface.d.ts +0 -6
- package/state/reducers/country-entities/country-entities.reducer.d.ts +0 -7
- package/state/reducers/country-entities/public_api.d.ts +0 -4
- package/state/reducers/geography/geography-initial-state.d.ts +0 -2
- package/state/reducers/geography/geography-state.interface.d.ts +0 -5
- package/state/reducers/geography/geography.reducer.d.ts +0 -4
- package/state/reducers/geography/public_api.d.ts +0 -3
- package/state/reducers/geography-reducers-state.interface.d.ts +0 -11
- package/state/reducers/geography-reducers.d.ts +0 -3
- package/state/reducers/geography-store-feature-key.d.ts +0 -1
- package/state/reducers/public_api.d.ts +0 -5
- package/state/selectors/country-entities.selector.d.ts +0 -16
- package/state/selectors/geography-all.selector.d.ts +0 -7
- package/state/selectors/geography-feature.selector.d.ts +0 -8
- package/state/selectors/geography.selector.d.ts +0 -11
- package/state/selectors/public_api.d.ts +0 -1
- package/state/testing/geography-testing.module.d.ts +0 -6
- package/state/testing/mock-geography-facade.d.ts +0 -24
- package/state/testing/public_api.d.ts +0 -2
- package/testing/factories/address.factory.d.ts +0 -17
- package/testing/factories/country.factory.d.ts +0 -19
- package/testing/factories/personal-address.factory.d.ts +0 -18
- package/testing/factories/public_api.d.ts +0 -4
- package/testing/factories/subdivision.factory.d.ts +0 -13
- package/testing/public_api.d.ts +0 -1
|
@@ -250,10 +250,10 @@ class DaffGeographyFacade {
|
|
|
250
250
|
dispatch(action) {
|
|
251
251
|
this.store.dispatch(action);
|
|
252
252
|
}
|
|
253
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
254
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
253
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffGeographyFacade, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
254
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffGeographyFacade, providedIn: 'root' }); }
|
|
255
255
|
}
|
|
256
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
256
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffGeographyFacade, decorators: [{
|
|
257
257
|
type: Injectable,
|
|
258
258
|
args: [{
|
|
259
259
|
providedIn: 'root',
|
|
@@ -268,10 +268,10 @@ class DaffGeographyEffects {
|
|
|
268
268
|
this.get$ = createEffect(() => this.actions$.pipe(ofType(DaffGeographyActionTypes.CountryLoadAction), switchMap((action) => this.driver.get(action.payload).pipe(map(resp => new DaffCountryLoadSuccess(resp)), catchError((error) => of(new DaffCountryLoadFailure(this.errorMatcher(error))))))));
|
|
269
269
|
this.list$ = createEffect(() => this.actions$.pipe(ofType(DaffGeographyActionTypes.CountryListAction), switchMap((action) => this.driver.list().pipe(map(resp => new DaffCountryListSuccess(resp)), catchError((error) => of(new DaffCountryListFailure(this.errorMatcher(error))))))));
|
|
270
270
|
}
|
|
271
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
272
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
271
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffGeographyEffects, deps: [{ token: i1$1.Actions }, { token: DaffGeographyDriver }, { token: DAFF_GEOGRAPHY_ERROR_MATCHER }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
272
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffGeographyEffects }); }
|
|
273
273
|
}
|
|
274
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
274
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffGeographyEffects, decorators: [{
|
|
275
275
|
type: Injectable
|
|
276
276
|
}], ctorParameters: () => [{ type: i1$1.Actions }, { type: undefined, decorators: [{
|
|
277
277
|
type: Inject,
|
|
@@ -282,14 +282,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
|
|
|
282
282
|
}] }] });
|
|
283
283
|
|
|
284
284
|
class DaffGeographyStateModule {
|
|
285
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
286
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
287
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
285
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffGeographyStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
286
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.1", ngImport: i0, type: DaffGeographyStateModule, imports: [i1.StoreFeatureModule, i1$1.EffectsFeatureModule] }); }
|
|
287
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffGeographyStateModule, imports: [StoreModule.forFeature(DAFF_GEOGRAPHY_STORE_FEATURE_KEY, daffGeographyReducers),
|
|
288
288
|
EffectsModule.forFeature([
|
|
289
289
|
DaffGeographyEffects,
|
|
290
290
|
])] }); }
|
|
291
291
|
}
|
|
292
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
292
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffGeographyStateModule, decorators: [{
|
|
293
293
|
type: NgModule,
|
|
294
294
|
args: [{
|
|
295
295
|
imports: [
|
|
@@ -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/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 = '[@daffodil/geography] Country Load Action',\n CountryLoadSuccessAction = '[@daffodil/geography] Country Load Success Action',\n CountryLoadFailureAction = '[@daffodil/geography] Country Load Failure Action',\n CountryListAction = '[@daffodil/geography] Country List Action',\n CountryListSuccessAction = '[@daffodil/geography] Country List Success Action',\n CountryListFailureAction = '[@daffodil/geography] 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 { createSingleInjectionToken } from '@daffodil/core';\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 {\n token: DAFF_GEOGRAPHY_ERROR_MATCHER,\n /**\n * Provider function for {@link DAFF_GEOGRAPHY_ERROR_MATCHER}.\n */\n provider: provideDaffGeographyErrorMatcher,\n} = createSingleInjectionToken<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;AAC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A;;4FAGO,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;AACF,iBAAA;;;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 = '[@daffodil/geography] Country Load Action',\n CountryLoadSuccessAction = '[@daffodil/geography] Country Load Success Action',\n CountryLoadFailureAction = '[@daffodil/geography] Country Load Failure Action',\n CountryListAction = '[@daffodil/geography] Country List Action',\n CountryListSuccessAction = '[@daffodil/geography] Country List Success Action',\n CountryListFailureAction = '[@daffodil/geography] 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 { createSingleInjectionToken } from '@daffodil/core';\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 {\n token: DAFF_GEOGRAPHY_ERROR_MATCHER,\n /**\n * Provider function for {@link DAFF_GEOGRAPHY_ERROR_MATCHER}.\n */\n provider: provideDaffGeographyErrorMatcher,\n} = createSingleInjectionToken<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;AACI,MAAM,iBAAiB,GAAG,CAAC,MAAK;AACrC,IAAA,IAAI,KAAK;IACT,OAAO,MACL,KAAK,GAAG,KAAK,IA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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;AACF,iBAAA;;;ACjBD;;AAEG;;;;"}
|
|
@@ -18,10 +18,10 @@ class DaffAddressFactory extends DaffModelFactory {
|
|
|
18
18
|
constructor() {
|
|
19
19
|
super(MockDaffAddress);
|
|
20
20
|
}
|
|
21
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
22
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
21
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffAddressFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
22
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffAddressFactory, providedIn: 'root' }); }
|
|
23
23
|
}
|
|
24
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
24
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffAddressFactory, decorators: [{
|
|
25
25
|
type: Injectable,
|
|
26
26
|
args: [{
|
|
27
27
|
providedIn: 'root',
|
|
@@ -31,11 +31,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
|
|
|
31
31
|
class MockDaffPersonalAddress extends MockDaffAddress {
|
|
32
32
|
constructor() {
|
|
33
33
|
super(...arguments);
|
|
34
|
-
this.prefix = faker.
|
|
35
|
-
this.suffix = faker.
|
|
36
|
-
this.firstname = faker.
|
|
37
|
-
this.middlename = faker.
|
|
38
|
-
this.lastname = faker.
|
|
34
|
+
this.prefix = faker.person.prefix();
|
|
35
|
+
this.suffix = faker.person.suffix();
|
|
36
|
+
this.firstname = faker.person.firstName();
|
|
37
|
+
this.middlename = faker.person.firstName();
|
|
38
|
+
this.lastname = faker.person.lastName();
|
|
39
39
|
this.email = faker.internet.email();
|
|
40
40
|
this.telephone = faker.phone.number();
|
|
41
41
|
}
|
|
@@ -44,10 +44,10 @@ class DaffPersonalAddressFactory extends DaffModelFactory {
|
|
|
44
44
|
constructor() {
|
|
45
45
|
super(MockDaffPersonalAddress);
|
|
46
46
|
}
|
|
47
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
48
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
47
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPersonalAddressFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
48
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPersonalAddressFactory, providedIn: 'root' }); }
|
|
49
49
|
}
|
|
50
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
50
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPersonalAddressFactory, decorators: [{
|
|
51
51
|
type: Injectable,
|
|
52
52
|
args: [{
|
|
53
53
|
providedIn: 'root',
|
|
@@ -65,10 +65,10 @@ class DaffSubdivisionFactory extends DaffModelFactory {
|
|
|
65
65
|
constructor() {
|
|
66
66
|
super(MockSubdivision);
|
|
67
67
|
}
|
|
68
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
69
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
68
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffSubdivisionFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
69
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffSubdivisionFactory, providedIn: 'root' }); }
|
|
70
70
|
}
|
|
71
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
71
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffSubdivisionFactory, decorators: [{
|
|
72
72
|
type: Injectable,
|
|
73
73
|
args: [{
|
|
74
74
|
providedIn: 'root',
|
|
@@ -90,10 +90,10 @@ class DaffCountryFactory extends DaffModelFactory {
|
|
|
90
90
|
constructor(subdivisionFactory) {
|
|
91
91
|
super(MockCountry, subdivisionFactory);
|
|
92
92
|
}
|
|
93
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
94
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
93
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCountryFactory, deps: [{ token: DaffSubdivisionFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
94
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCountryFactory, providedIn: 'root' }); }
|
|
95
95
|
}
|
|
96
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
96
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCountryFactory, decorators: [{
|
|
97
97
|
type: Injectable,
|
|
98
98
|
args: [{
|
|
99
99
|
providedIn: 'root',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-geography-testing.mjs","sources":["../../../libs/geography/testing/src/factories/address.factory.ts","../../../libs/geography/testing/src/factories/personal-address.factory.ts","../../../libs/geography/testing/src/factories/subdivision.factory.ts","../../../libs/geography/testing/src/factories/country.factory.ts","../../../libs/geography/testing/src/daffodil-geography-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffAddress } from '@daffodil/geography';\n\n\nexport class MockDaffAddress implements DaffAddress {\n street = faker.location.street();\n street2 = faker.location.secondaryAddress();\n city = faker.location.city();\n region = faker.string.uuid();\n region_code = faker.location.state({ abbreviated: true });\n postcode = faker.location.zipCode();\n country = faker.location.countryCode();\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffAddressFactory extends DaffModelFactory<DaffAddress>{\n constructor(){\n super(MockDaffAddress);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffPersonalAddress } from '@daffodil/geography';\n\nimport { MockDaffAddress } from './address.factory';\n\nexport class MockDaffPersonalAddress extends MockDaffAddress implements DaffPersonalAddress {\n prefix = faker.
|
|
1
|
+
{"version":3,"file":"daffodil-geography-testing.mjs","sources":["../../../libs/geography/testing/src/factories/address.factory.ts","../../../libs/geography/testing/src/factories/personal-address.factory.ts","../../../libs/geography/testing/src/factories/subdivision.factory.ts","../../../libs/geography/testing/src/factories/country.factory.ts","../../../libs/geography/testing/src/daffodil-geography-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffAddress } from '@daffodil/geography';\n\n\nexport class MockDaffAddress implements DaffAddress {\n street = faker.location.street();\n street2 = faker.location.secondaryAddress();\n city = faker.location.city();\n region = faker.string.uuid();\n region_code = faker.location.state({ abbreviated: true });\n postcode = faker.location.zipCode();\n country = faker.location.countryCode();\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffAddressFactory extends DaffModelFactory<DaffAddress>{\n constructor(){\n super(MockDaffAddress);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffPersonalAddress } from '@daffodil/geography';\n\nimport { MockDaffAddress } from './address.factory';\n\nexport class MockDaffPersonalAddress extends MockDaffAddress implements DaffPersonalAddress {\n prefix = faker.person.prefix();\n suffix = faker.person.suffix();\n firstname = faker.person.firstName();\n middlename = faker.person.firstName();\n lastname = faker.person.lastName();\n email = faker.internet.email();\n telephone = faker.phone.number();\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffPersonalAddressFactory extends DaffModelFactory<DaffPersonalAddress>{\n constructor() {\n super(MockDaffPersonalAddress);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffSubdivision } from '@daffodil/geography';\n\nexport class MockSubdivision implements DaffSubdivision {\n id = faker.string.uuid();\n name = faker.lorem.word();\n iso_3166_2 = faker.string.alphanumeric(2);\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffSubdivisionFactory extends DaffModelFactory<DaffSubdivision> {\n constructor() {\n super(MockSubdivision);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffCountry } from '@daffodil/geography';\n\nimport { DaffSubdivisionFactory } from './subdivision.factory';\n\nexport class MockCountry implements DaffCountry {\n id = faker.string.uuid();\n name = faker.lorem.word();\n name_en = faker.lorem.word();\n alpha2 = faker.string.alphanumeric(2);\n alpha3 = faker.string.alphanumeric(3);\n subdivisions = this.subdivisionFactory.createMany(faker.number.int({ min: 0, max: 10 }));\n\n constructor(\n protected subdivisionFactory: DaffSubdivisionFactory,\n ) {}\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCountryFactory extends DaffModelFactory<DaffCountry> {\n constructor(\n subdivisionFactory: DaffSubdivisionFactory,\n ) {\n super(MockCountry, subdivisionFactory);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.DaffSubdivisionFactory"],"mappings":";;;;;MAOa,eAAe,CAAA;AAA5B,IAAA,WAAA,GAAA;AACE,QAAA,IAAA,CAAA,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE;AAChC,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC,gBAAgB,EAAE;AAC3C,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAE;AAC5B,QAAA,IAAA,CAAA,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE;AAC5B,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;AACzD,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,OAAO,EAAE;AACnC,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC,WAAW,EAAE;IACxC;AAAC;AAKK,MAAO,kBAAmB,SAAQ,gBAA6B,CAAA;AACnE,IAAA,WA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;;ACvBD;;AAEG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-geography.mjs","sources":["../../../libs/geography/src/comparators/address.ts","../../../libs/geography/src/comparators/personal-address.ts","../../../libs/geography/src/public_api.ts","../../../libs/geography/src/daffodil-geography.ts"],"sourcesContent":["import { shallowCompare } from '@daffodil/core';\n\nimport { DaffAddress } from '../models/address';\n\n/**\n * Compares two addresses and returns true if all of their fields are equal.\n *\n * @param address0 An address.\n * @param address1 An address.\n */\nexport function daffCompareAddresses(address0: DaffAddress, address1: DaffAddress): boolean {\n return shallowCompare(\n address0,\n address1,\n [\n 'street',\n 'street2',\n 'city',\n 'region',\n 'country',\n 'country_id',\n 'postcode',\n ],\n );\n}\n","import { shallowCompare } from '@daffodil/core';\n\nimport { daffCompareAddresses } from './address';\nimport { DaffPersonalAddress } from '../models/personal-address';\n\n/**\n * Compares two personal addresses and returns true if all of their fields are equal.\n *\n * @param address0 A personal address.\n * @param address1 A personal address.\n */\nexport function daffComparePersonalAddresses(address0: DaffPersonalAddress, address1: DaffPersonalAddress): boolean {\n return shallowCompare(\n address0,\n address1,\n [\n 'prefix',\n 'suffix',\n 'firstname',\n 'middlename',\n 'lastname',\n 'telephone',\n 'email',\n ],\n ) && daffCompareAddresses(address0, address1);\n}\n","/*\n * Public API Surface of @daffodil/geography\n */\nexport * from './models/public_api';\nexport * from './comparators/public_api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAIA;;;;;AAKG;
|
|
1
|
+
{"version":3,"file":"daffodil-geography.mjs","sources":["../../../libs/geography/src/comparators/address.ts","../../../libs/geography/src/comparators/personal-address.ts","../../../libs/geography/src/public_api.ts","../../../libs/geography/src/daffodil-geography.ts"],"sourcesContent":["import { shallowCompare } from '@daffodil/core';\n\nimport { DaffAddress } from '../models/address';\n\n/**\n * Compares two addresses and returns true if all of their fields are equal.\n *\n * @param address0 An address.\n * @param address1 An address.\n */\nexport function daffCompareAddresses(address0: DaffAddress, address1: DaffAddress): boolean {\n return shallowCompare(\n address0,\n address1,\n [\n 'street',\n 'street2',\n 'city',\n 'region',\n 'country',\n 'country_id',\n 'postcode',\n ],\n );\n}\n","import { shallowCompare } from '@daffodil/core';\n\nimport { daffCompareAddresses } from './address';\nimport { DaffPersonalAddress } from '../models/personal-address';\n\n/**\n * Compares two personal addresses and returns true if all of their fields are equal.\n *\n * @param address0 A personal address.\n * @param address1 A personal address.\n */\nexport function daffComparePersonalAddresses(address0: DaffPersonalAddress, address1: DaffPersonalAddress): boolean {\n return shallowCompare(\n address0,\n address1,\n [\n 'prefix',\n 'suffix',\n 'firstname',\n 'middlename',\n 'lastname',\n 'telephone',\n 'email',\n ],\n ) && daffCompareAddresses(address0, address1);\n}\n","/*\n * Public API Surface of @daffodil/geography\n */\nexport * from './models/public_api';\nexport * from './comparators/public_api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAIA;;;;;AAKG;AACG,SAAU,oBAAoB,CAAC,QAAqB,EAAE,QAAqB,EAAA;AAC/E,IAAA,OAAO,cAAc,CACnB,QAAQ,EACR,QAAQ,EACR;QACE,QAAQ;QACR,SAAS;QACT,MAAM;QACN,QAAQ;QACR,SAAS;QACT,YAAY;QACZ,UAAU;AACX,KAAA,CACF;AACH;;ACnBA;;;;;AAKG;AACG,SAAU,4BAA4B,CAAC,QAA6B,EAAE,QAA6B,EAAA;AACvG,IAAA,OAAO,cAAc,CACnB,QAAQ,EACR,QAAQ,EACR;QACE,QAAQ;QACR,QAAQ;QACR,WAAW;QACX,YAAY;QACZ,UAAU;QACV,WAAW;QACX,OAAO;AACR,KAAA,CACF,IAAI,oBAAoB,CAAC,QAAQ,EAAE,QAAQ,CAAC;AAC/C;;ACzBA;;AAEG;;ACFH;;AAEG;;;;"}
|
package/index.d.ts
CHANGED
|
@@ -1 +1,77 @@
|
|
|
1
|
-
|
|
1
|
+
import { DaffIdentifiable, ID } from '@daffodil/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The subdivisions of a country as per ISO-3166-2
|
|
5
|
+
* For the United States this is commonly termed as "States"
|
|
6
|
+
*/
|
|
7
|
+
interface DaffSubdivision extends DaffIdentifiable {
|
|
8
|
+
name: string;
|
|
9
|
+
iso_3166_2: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* A basic model of an address
|
|
14
|
+
*/
|
|
15
|
+
interface DaffAddress {
|
|
16
|
+
street: string;
|
|
17
|
+
street2?: string;
|
|
18
|
+
city: string;
|
|
19
|
+
/**
|
|
20
|
+
* The ID of the {@link DaffSubdivision}.
|
|
21
|
+
*/
|
|
22
|
+
region: DaffSubdivision['id'];
|
|
23
|
+
region_code?: DaffSubdivision['iso_3166_2'];
|
|
24
|
+
country?: ID;
|
|
25
|
+
country_id?: ID;
|
|
26
|
+
postcode: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* A specialized type of address useful for associating a physical address
|
|
31
|
+
* with a particular individual.
|
|
32
|
+
*/
|
|
33
|
+
interface DaffPersonalAddress extends DaffAddress {
|
|
34
|
+
prefix?: string;
|
|
35
|
+
suffix?: string;
|
|
36
|
+
firstname: string;
|
|
37
|
+
middlename?: string;
|
|
38
|
+
lastname: string;
|
|
39
|
+
telephone: string;
|
|
40
|
+
email?: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* A representation of a country on the planet Earth.
|
|
45
|
+
* See: ISO-3166
|
|
46
|
+
*/
|
|
47
|
+
interface DaffCountry extends DaffIdentifiable {
|
|
48
|
+
name: string;
|
|
49
|
+
name_en: string;
|
|
50
|
+
alpha2: string;
|
|
51
|
+
alpha3: string;
|
|
52
|
+
subdivisions: DaffSubdivision[];
|
|
53
|
+
/**
|
|
54
|
+
* Whether or not the country has been fully loaded.
|
|
55
|
+
* If true, the subdivisions field will be populated if any exist.
|
|
56
|
+
*/
|
|
57
|
+
loaded?: boolean;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Compares two addresses and returns true if all of their fields are equal.
|
|
62
|
+
*
|
|
63
|
+
* @param address0 An address.
|
|
64
|
+
* @param address1 An address.
|
|
65
|
+
*/
|
|
66
|
+
declare function daffCompareAddresses(address0: DaffAddress, address1: DaffAddress): boolean;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Compares two personal addresses and returns true if all of their fields are equal.
|
|
70
|
+
*
|
|
71
|
+
* @param address0 A personal address.
|
|
72
|
+
* @param address1 A personal address.
|
|
73
|
+
*/
|
|
74
|
+
declare function daffComparePersonalAddresses(address0: DaffPersonalAddress, address1: DaffPersonalAddress): boolean;
|
|
75
|
+
|
|
76
|
+
export { daffCompareAddresses, daffComparePersonalAddresses };
|
|
77
|
+
export type { DaffAddress, DaffCountry, DaffPersonalAddress, DaffSubdivision };
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@daffodil/geography","nx":{"targets":{"build":{"outputs":["{workspaceRoot}/dist/geography"]}}},"version":"0.
|
|
1
|
+
{"name":"@daffodil/geography","nx":{"targets":{"build":{"outputs":["{workspaceRoot}/dist/geography"]}}},"version":"0.89.0","description":"A package for interacting with platforms that provide geographic data information like States and Countries","repository":{"type":"git","url":"https://github.com/graycoreio/daffodil"},"author":"Graycore LLC","license":"MIT","bugs":{"url":"https://github.com/graycoreio/daffodil/issues"},"homepage":"https://github.com/graycoreio/daffodil","peerDependencies":{"@angular/core":"^20.0.0","@daffodil/core":"0.89.0"},"optionalDependencies":{"@daffodil/driver":"0.89.0"},"module":"fesm2022/daffodil-geography.mjs","typings":"index.d.ts","exports":{"./package.json":{"default":"./package.json"},".":{"types":"./index.d.ts","default":"./fesm2022/daffodil-geography.mjs"},"./driver":{"types":"./driver/index.d.ts","default":"./fesm2022/daffodil-geography-driver.mjs"},"./state":{"types":"./state/index.d.ts","default":"./fesm2022/daffodil-geography-state.mjs"},"./testing":{"types":"./testing/index.d.ts","default":"./fesm2022/daffodil-geography-testing.mjs"},"./driver/in-memory":{"types":"./driver/in-memory/index.d.ts","default":"./fesm2022/daffodil-geography-driver-in-memory.mjs"},"./driver/magento":{"types":"./driver/magento/index.d.ts","default":"./fesm2022/daffodil-geography-driver-magento.mjs"},"./driver/testing":{"types":"./driver/testing/index.d.ts","default":"./fesm2022/daffodil-geography-driver-testing.mjs"},"./state/testing":{"types":"./state/testing/index.d.ts","default":"./fesm2022/daffodil-geography-state-testing.mjs"}},"sideEffects":false,"dependencies":{"tslib":"^2.3.0"}}
|
package/state/index.d.ts
CHANGED
|
@@ -1 +1,163 @@
|
|
|
1
|
-
|
|
1
|
+
import { DaffCountry } from '@daffodil/geography';
|
|
2
|
+
import { EntityState, EntityAdapter, Dictionary } from '@ngrx/entity';
|
|
3
|
+
import * as i1 from '@ngrx/store';
|
|
4
|
+
import { ActionReducerMap, Action, MemoizedSelector, Store } from '@ngrx/store';
|
|
5
|
+
import { DaffStateError, daffTransformErrorToStateError, DaffStoreFacade } from '@daffodil/core/state';
|
|
6
|
+
import * as i0 from '@angular/core';
|
|
7
|
+
import { Observable } from 'rxjs';
|
|
8
|
+
import * as i2 from '@ngrx/effects';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Interface for country entity state.
|
|
12
|
+
*/
|
|
13
|
+
type DaffCountryEntityState<T extends DaffCountry = DaffCountry> = EntityState<T>;
|
|
14
|
+
|
|
15
|
+
interface DaffGeographyReducerState {
|
|
16
|
+
loading: boolean;
|
|
17
|
+
errors: DaffStateError[];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
declare const DAFF_GEOGRAPHY_STORE_FEATURE_KEY = "daffGeography";
|
|
21
|
+
|
|
22
|
+
interface DaffGeographyFeatureState<T extends DaffCountry = DaffCountry> {
|
|
23
|
+
geography: DaffGeographyReducerState;
|
|
24
|
+
countries: DaffCountryEntityState<T>;
|
|
25
|
+
}
|
|
26
|
+
interface DaffGeographyStateRootSlice<T extends DaffCountry = DaffCountry> {
|
|
27
|
+
[DAFF_GEOGRAPHY_STORE_FEATURE_KEY]: DaffGeographyFeatureState<T>;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
declare const daffGeographyReducers: ActionReducerMap<DaffGeographyFeatureState>;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Country Adapter for changing/overwriting entity state.
|
|
34
|
+
*/
|
|
35
|
+
declare const getCountryAdapter: <T extends DaffCountry = DaffCountry>() => EntityAdapter<T>;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Initial state for country entity state.
|
|
39
|
+
*/
|
|
40
|
+
declare const daffCountryEntitiesInitialState: DaffCountryEntityState<any>;
|
|
41
|
+
|
|
42
|
+
declare enum DaffGeographyActionTypes {
|
|
43
|
+
CountryLoadAction = "[@daffodil/geography] Country Load Action",
|
|
44
|
+
CountryLoadSuccessAction = "[@daffodil/geography] Country Load Success Action",
|
|
45
|
+
CountryLoadFailureAction = "[@daffodil/geography] Country Load Failure Action",
|
|
46
|
+
CountryListAction = "[@daffodil/geography] Country List Action",
|
|
47
|
+
CountryListSuccessAction = "[@daffodil/geography] Country List Success Action",
|
|
48
|
+
CountryListFailureAction = "[@daffodil/geography] Country List Failure Action"
|
|
49
|
+
}
|
|
50
|
+
declare class DaffCountryLoad<T extends DaffCountry> implements Action {
|
|
51
|
+
payload: T['id'];
|
|
52
|
+
readonly type = DaffGeographyActionTypes.CountryLoadAction;
|
|
53
|
+
constructor(payload: T['id']);
|
|
54
|
+
}
|
|
55
|
+
declare class DaffCountryLoadSuccess<T extends DaffCountry> implements Action {
|
|
56
|
+
payload: T;
|
|
57
|
+
readonly type = DaffGeographyActionTypes.CountryLoadSuccessAction;
|
|
58
|
+
constructor(payload: T);
|
|
59
|
+
}
|
|
60
|
+
declare class DaffCountryLoadFailure implements Action {
|
|
61
|
+
payload: DaffStateError;
|
|
62
|
+
readonly type = DaffGeographyActionTypes.CountryLoadFailureAction;
|
|
63
|
+
constructor(payload: DaffStateError);
|
|
64
|
+
}
|
|
65
|
+
declare class DaffCountryList implements Action {
|
|
66
|
+
readonly type = DaffGeographyActionTypes.CountryListAction;
|
|
67
|
+
}
|
|
68
|
+
declare class DaffCountryListSuccess<T extends DaffCountry> implements Action {
|
|
69
|
+
payload: T[];
|
|
70
|
+
readonly type = DaffGeographyActionTypes.CountryListSuccessAction;
|
|
71
|
+
constructor(payload: T[]);
|
|
72
|
+
}
|
|
73
|
+
declare class DaffCountryListFailure implements Action {
|
|
74
|
+
payload: DaffStateError;
|
|
75
|
+
readonly type = DaffGeographyActionTypes.CountryListFailureAction;
|
|
76
|
+
constructor(payload: DaffStateError);
|
|
77
|
+
}
|
|
78
|
+
type DaffGeographyActions<T extends DaffCountry> = DaffCountryLoad<T> | DaffCountryLoadSuccess<T> | DaffCountryLoadFailure | DaffCountryList | DaffCountryListSuccess<T> | DaffCountryListFailure;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Reducer function that catches actions and changes/overwrites country entities state.
|
|
82
|
+
*/
|
|
83
|
+
declare function daffCountryEntitiesReducer<T extends DaffCountry = DaffCountry>(state: DaffCountryEntityState<any>, action: DaffGeographyActions<T>): DaffCountryEntityState<T>;
|
|
84
|
+
|
|
85
|
+
declare function daffGeographyReducer<T extends DaffCountry>(state: DaffGeographyReducerState, action: DaffGeographyActions<T>): DaffGeographyReducerState;
|
|
86
|
+
|
|
87
|
+
declare const daffGeographyInitialState: DaffGeographyReducerState;
|
|
88
|
+
|
|
89
|
+
interface DaffCountryEntitySelectors<T extends DaffCountry = DaffCountry> {
|
|
90
|
+
selectCountryEntitiesState: MemoizedSelector<DaffGeographyStateRootSlice<T>, DaffCountryEntityState<T>>;
|
|
91
|
+
selectCountryIds: MemoizedSelector<DaffGeographyStateRootSlice<T>, T['id'][]>;
|
|
92
|
+
selectCountryEntities: MemoizedSelector<DaffGeographyStateRootSlice<T>, Dictionary<T>>;
|
|
93
|
+
selectAllCountries: MemoizedSelector<DaffGeographyStateRootSlice<T>, T[]>;
|
|
94
|
+
selectCountryTotal: MemoizedSelector<DaffGeographyStateRootSlice<T>, number>;
|
|
95
|
+
selectCountry: (id: T['id']) => MemoizedSelector<DaffGeographyStateRootSlice<T>, T>;
|
|
96
|
+
selectCountrySubdivisions: (id: T['id']) => MemoizedSelector<DaffGeographyStateRootSlice<T>, T['subdivisions']>;
|
|
97
|
+
selectIsCountryFullyLoaded: (id: T['id']) => MemoizedSelector<DaffGeographyStateRootSlice<T>, boolean>;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
interface DaffGeographyFeatureSelector<T extends DaffCountry = DaffCountry> {
|
|
101
|
+
selectGeographyFeatureState: MemoizedSelector<DaffGeographyStateRootSlice<T>, DaffGeographyFeatureState<T>>;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
interface DaffGeographySelectors {
|
|
105
|
+
selectGeographyState: MemoizedSelector<DaffGeographyStateRootSlice, DaffGeographyReducerState>;
|
|
106
|
+
selectGeographyLoading: MemoizedSelector<DaffGeographyStateRootSlice, boolean>;
|
|
107
|
+
selectGeographyErrors: MemoizedSelector<DaffGeographyStateRootSlice, DaffStateError[]>;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
interface DaffGeographyAllSelectors<T extends DaffCountry = DaffCountry> extends DaffCountryEntitySelectors<T>, DaffGeographySelectors, DaffGeographyFeatureSelector<T> {
|
|
111
|
+
}
|
|
112
|
+
declare const getDaffGeographySelectors: <T extends DaffCountry = DaffCountry>() => DaffGeographyAllSelectors<T>;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Transforms `DaffError`s into `DaffStateError`s before they are serialized into state.
|
|
116
|
+
* Can be used to further refine Daffodil errors into more specific app errors.
|
|
117
|
+
*/
|
|
118
|
+
declare const DAFF_GEOGRAPHY_ERROR_MATCHER: i0.InjectionToken<typeof daffTransformErrorToStateError>;
|
|
119
|
+
declare const provideDaffGeographyErrorMatcher: <R extends typeof daffTransformErrorToStateError = typeof daffTransformErrorToStateError>(value: R) => i0.ValueProvider;
|
|
120
|
+
|
|
121
|
+
interface DaffGeographyFacadeInterface<T extends DaffCountry = DaffCountry> extends DaffStoreFacade<Action> {
|
|
122
|
+
loading$: Observable<boolean>;
|
|
123
|
+
errors$: Observable<DaffStateError[]>;
|
|
124
|
+
countries$: Observable<T[]>;
|
|
125
|
+
countryIds$: Observable<T['id'][]>;
|
|
126
|
+
countryCount$: Observable<number>;
|
|
127
|
+
countryEntities$: Observable<Dictionary<T>>;
|
|
128
|
+
getCountry(id: T['id']): Observable<T>;
|
|
129
|
+
getCountrySubdivisions(id: T['id']): Observable<T['subdivisions']>;
|
|
130
|
+
isCountryFullyLoaded(id: T['id']): Observable<boolean>;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* @inheritdoc
|
|
135
|
+
*/
|
|
136
|
+
declare class DaffGeographyFacade<T extends DaffCountry = DaffCountry> implements DaffGeographyFacadeInterface<T> {
|
|
137
|
+
private store;
|
|
138
|
+
loading$: Observable<boolean>;
|
|
139
|
+
errors$: Observable<DaffStateError[]>;
|
|
140
|
+
countries$: Observable<T[]>;
|
|
141
|
+
countryIds$: Observable<T['id'][]>;
|
|
142
|
+
countryCount$: Observable<number>;
|
|
143
|
+
countryEntities$: Observable<Dictionary<T>>;
|
|
144
|
+
private _selectCountry;
|
|
145
|
+
private _selectCountrySubdivisions;
|
|
146
|
+
private _selectIsCountryFullyLoaded;
|
|
147
|
+
constructor(store: Store<DaffGeographyStateRootSlice<T>>);
|
|
148
|
+
getCountry(id: T['id']): Observable<T>;
|
|
149
|
+
getCountrySubdivisions(id: T['id']): Observable<T['subdivisions']>;
|
|
150
|
+
isCountryFullyLoaded(id: T['id']): Observable<boolean>;
|
|
151
|
+
dispatch(action: Action): void;
|
|
152
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffGeographyFacade<any>, never>;
|
|
153
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffGeographyFacade<any>>;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
declare class DaffGeographyStateModule {
|
|
157
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffGeographyStateModule, never>;
|
|
158
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffGeographyStateModule, never, [typeof i1.StoreFeatureModule, typeof i2.EffectsFeatureModule], never>;
|
|
159
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DaffGeographyStateModule>;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
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, provideDaffGeographyErrorMatcher };
|
|
163
|
+
export type { DaffCountryEntityState, DaffGeographyActions, DaffGeographyAllSelectors, DaffGeographyFacadeInterface, DaffGeographyFeatureState, DaffGeographyReducerState, DaffGeographyStateRootSlice };
|