@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.
Files changed (105) hide show
  1. package/driver/in-memory/index.d.ts +59 -1
  2. package/driver/index.d.ts +32 -1
  3. package/driver/magento/index.d.ts +95 -1
  4. package/driver/testing/index.d.ts +29 -1
  5. package/fesm2022/daffodil-geography-driver-in-memory.mjs +10 -10
  6. package/fesm2022/daffodil-geography-driver-in-memory.mjs.map +1 -1
  7. package/fesm2022/daffodil-geography-driver-magento.mjs +13 -13
  8. package/fesm2022/daffodil-geography-driver-magento.mjs.map +1 -1
  9. package/fesm2022/daffodil-geography-driver-testing.mjs +7 -7
  10. package/fesm2022/daffodil-geography-driver-testing.mjs.map +1 -1
  11. package/fesm2022/daffodil-geography-driver.mjs.map +1 -1
  12. package/fesm2022/daffodil-geography-state-testing.mjs +7 -7
  13. package/fesm2022/daffodil-geography-state-testing.mjs.map +1 -1
  14. package/fesm2022/daffodil-geography-state.mjs +10 -10
  15. package/fesm2022/daffodil-geography-state.mjs.map +1 -1
  16. package/fesm2022/daffodil-geography-testing.mjs +17 -17
  17. package/fesm2022/daffodil-geography-testing.mjs.map +1 -1
  18. package/fesm2022/daffodil-geography.mjs.map +1 -1
  19. package/index.d.ts +77 -1
  20. package/package.json +1 -1
  21. package/state/index.d.ts +163 -1
  22. package/state/testing/index.d.ts +33 -1
  23. package/testing/index.d.ts +63 -1
  24. package/comparators/address.d.ts +0 -8
  25. package/comparators/personal-address.d.ts +0 -8
  26. package/comparators/public_api.d.ts +0 -2
  27. package/driver/errors/country-not-found.d.ts +0 -6
  28. package/driver/errors/invalid-api-response.d.ts +0 -6
  29. package/driver/errors/public_api.d.ts +0 -2
  30. package/driver/in-memory/backend/geography.service.d.ts +0 -32
  31. package/driver/in-memory/collection-name.const.d.ts +0 -1
  32. package/driver/in-memory/drivers/geography-driver.module.d.ts +0 -9
  33. package/driver/in-memory/drivers/geography.service.d.ts +0 -18
  34. package/driver/in-memory/drivers/public_api.d.ts +0 -2
  35. package/driver/in-memory/public_api.d.ts +0 -2
  36. package/driver/interfaces/geography-service.interface.d.ts +0 -13
  37. package/driver/magento/errors/codes.d.ts +0 -3
  38. package/driver/magento/errors/map.d.ts +0 -2
  39. package/driver/magento/errors/transform.d.ts +0 -1
  40. package/driver/magento/geography-driver.module.d.ts +0 -9
  41. package/driver/magento/geography.service.d.ts +0 -20
  42. package/driver/magento/models/responses/country.d.ts +0 -10
  43. package/driver/magento/models/responses/public_api.d.ts +0 -2
  44. package/driver/magento/models/responses/region.d.ts +0 -6
  45. package/driver/magento/public_api.d.ts +0 -6
  46. package/driver/magento/queries/fragments/country.d.ts +0 -1
  47. package/driver/magento/queries/fragments/public_api.d.ts +0 -2
  48. package/driver/magento/queries/fragments/region.d.ts +0 -1
  49. package/driver/magento/queries/get-countries.d.ts +0 -2
  50. package/driver/magento/queries/get-country.d.ts +0 -2
  51. package/driver/magento/queries/public_api.d.ts +0 -4
  52. package/driver/magento/queries/responses/get-countries.d.ts +0 -4
  53. package/driver/magento/queries/responses/get-country.d.ts +0 -4
  54. package/driver/magento/queries/responses/public_api.d.ts +0 -2
  55. package/driver/magento/transforms/responses/country.service.d.ts +0 -18
  56. package/driver/magento/transforms/responses/subdivision.service.d.ts +0 -14
  57. package/driver/magento/validators/get-countries.d.ts +0 -3
  58. package/driver/magento/validators/public_api.d.ts +0 -1
  59. package/driver/public_api.d.ts +0 -2
  60. package/driver/testing/drivers/geography-driver.module.d.ts +0 -9
  61. package/driver/testing/drivers/geography.service.d.ts +0 -17
  62. package/driver/testing/drivers/public_api.d.ts +0 -2
  63. package/driver/testing/public_api.d.ts +0 -1
  64. package/models/address.d.ts +0 -18
  65. package/models/country.d.ts +0 -18
  66. package/models/personal-address.d.ts +0 -14
  67. package/models/public_api.d.ts +0 -4
  68. package/models/subdivision.d.ts +0 -9
  69. package/public_api.d.ts +0 -2
  70. package/state/actions/geography.actions.d.ts +0 -40
  71. package/state/actions/public_api.d.ts +0 -1
  72. package/state/effects/geography.effects.d.ts +0 -16
  73. package/state/facades/geography/geography-facade.interface.d.ts +0 -16
  74. package/state/facades/geography/geography.facade.d.ts +0 -30
  75. package/state/geography-state.module.d.ts +0 -8
  76. package/state/injection-tokens/error-matcher.token.d.ts +0 -6
  77. package/state/injection-tokens/public_api.d.ts +0 -1
  78. package/state/public_api.d.ts +0 -7
  79. package/state/reducers/country-entities/country-entities-adapter.d.ts +0 -6
  80. package/state/reducers/country-entities/country-entities-initial-state.d.ts +0 -5
  81. package/state/reducers/country-entities/country-entities-state.interface.d.ts +0 -6
  82. package/state/reducers/country-entities/country-entities.reducer.d.ts +0 -7
  83. package/state/reducers/country-entities/public_api.d.ts +0 -4
  84. package/state/reducers/geography/geography-initial-state.d.ts +0 -2
  85. package/state/reducers/geography/geography-state.interface.d.ts +0 -5
  86. package/state/reducers/geography/geography.reducer.d.ts +0 -4
  87. package/state/reducers/geography/public_api.d.ts +0 -3
  88. package/state/reducers/geography-reducers-state.interface.d.ts +0 -11
  89. package/state/reducers/geography-reducers.d.ts +0 -3
  90. package/state/reducers/geography-store-feature-key.d.ts +0 -1
  91. package/state/reducers/public_api.d.ts +0 -5
  92. package/state/selectors/country-entities.selector.d.ts +0 -16
  93. package/state/selectors/geography-all.selector.d.ts +0 -7
  94. package/state/selectors/geography-feature.selector.d.ts +0 -8
  95. package/state/selectors/geography.selector.d.ts +0 -11
  96. package/state/selectors/public_api.d.ts +0 -1
  97. package/state/testing/geography-testing.module.d.ts +0 -6
  98. package/state/testing/mock-geography-facade.d.ts +0 -24
  99. package/state/testing/public_api.d.ts +0 -2
  100. package/testing/factories/address.factory.d.ts +0 -17
  101. package/testing/factories/country.factory.d.ts +0 -19
  102. package/testing/factories/personal-address.factory.d.ts +0 -18
  103. package/testing/factories/public_api.d.ts +0 -4
  104. package/testing/factories/subdivision.factory.d.ts +0 -13
  105. package/testing/public_api.d.ts +0 -1
@@ -1 +1,33 @@
1
- export * from './public_api';
1
+ import * as i0 from '@angular/core';
2
+ import { Dictionary } from '@ngrx/entity';
3
+ import { Action } from '@ngrx/store';
4
+ import { BehaviorSubject } from 'rxjs';
5
+ import { DaffStateError } from '@daffodil/core/state';
6
+ import { DaffCountry } from '@daffodil/geography';
7
+ import { DaffGeographyFacadeInterface } from '@daffodil/geography/state';
8
+
9
+ declare class DaffGeographyStateTestingModule {
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffGeographyStateTestingModule, never>;
11
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DaffGeographyStateTestingModule, never, never, never>;
12
+ static ɵinj: i0.ɵɵInjectorDeclaration<DaffGeographyStateTestingModule>;
13
+ }
14
+
15
+ /**
16
+ * @inheritdoc
17
+ */
18
+ declare class MockDaffGeographyFacade implements DaffGeographyFacadeInterface {
19
+ loading$: BehaviorSubject<boolean>;
20
+ errors$: BehaviorSubject<DaffStateError[]>;
21
+ countries$: BehaviorSubject<DaffCountry[]>;
22
+ countryIds$: BehaviorSubject<DaffCountry['id'][]>;
23
+ countryCount$: BehaviorSubject<number>;
24
+ countryEntities$: BehaviorSubject<Dictionary<DaffCountry>>;
25
+ getCountry(id: any): BehaviorSubject<any>;
26
+ getCountrySubdivisions(id: any): BehaviorSubject<any[]>;
27
+ isCountryFullyLoaded(id: any): BehaviorSubject<boolean>;
28
+ dispatch(action: Action): void;
29
+ static ɵfac: i0.ɵɵFactoryDeclaration<MockDaffGeographyFacade, never>;
30
+ static ɵprov: i0.ɵɵInjectableDeclaration<MockDaffGeographyFacade>;
31
+ }
32
+
33
+ export { DaffGeographyStateTestingModule, MockDaffGeographyFacade };
@@ -1 +1,63 @@
1
- export * from './public_api';
1
+ import { DaffModelFactory } from '@daffodil/core/testing';
2
+ import * as _daffodil_geography from '@daffodil/geography';
3
+ import { DaffAddress, DaffPersonalAddress, DaffSubdivision, DaffCountry } from '@daffodil/geography';
4
+ import * as i0 from '@angular/core';
5
+
6
+ declare class MockDaffAddress implements DaffAddress {
7
+ street: string;
8
+ street2: string;
9
+ city: string;
10
+ region: string;
11
+ region_code: string;
12
+ postcode: string;
13
+ country: string;
14
+ }
15
+ declare class DaffAddressFactory extends DaffModelFactory<DaffAddress> {
16
+ constructor();
17
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffAddressFactory, never>;
18
+ static ɵprov: i0.ɵɵInjectableDeclaration<DaffAddressFactory>;
19
+ }
20
+
21
+ declare class MockDaffPersonalAddress extends MockDaffAddress implements DaffPersonalAddress {
22
+ prefix: string;
23
+ suffix: string;
24
+ firstname: string;
25
+ middlename: string;
26
+ lastname: string;
27
+ email: string;
28
+ telephone: string;
29
+ }
30
+ declare class DaffPersonalAddressFactory extends DaffModelFactory<DaffPersonalAddress> {
31
+ constructor();
32
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffPersonalAddressFactory, never>;
33
+ static ɵprov: i0.ɵɵInjectableDeclaration<DaffPersonalAddressFactory>;
34
+ }
35
+
36
+ declare class MockSubdivision implements DaffSubdivision {
37
+ id: string;
38
+ name: string;
39
+ iso_3166_2: string;
40
+ }
41
+ declare class DaffSubdivisionFactory extends DaffModelFactory<DaffSubdivision> {
42
+ constructor();
43
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffSubdivisionFactory, never>;
44
+ static ɵprov: i0.ɵɵInjectableDeclaration<DaffSubdivisionFactory>;
45
+ }
46
+
47
+ declare class MockCountry implements DaffCountry {
48
+ protected subdivisionFactory: DaffSubdivisionFactory;
49
+ id: string;
50
+ name: string;
51
+ name_en: string;
52
+ alpha2: string;
53
+ alpha3: string;
54
+ subdivisions: _daffodil_geography.DaffSubdivision[];
55
+ constructor(subdivisionFactory: DaffSubdivisionFactory);
56
+ }
57
+ declare class DaffCountryFactory extends DaffModelFactory<DaffCountry> {
58
+ constructor(subdivisionFactory: DaffSubdivisionFactory);
59
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffCountryFactory, never>;
60
+ static ɵprov: i0.ɵɵInjectableDeclaration<DaffCountryFactory>;
61
+ }
62
+
63
+ export { DaffAddressFactory, DaffCountryFactory, DaffPersonalAddressFactory, DaffSubdivisionFactory, MockCountry, MockDaffAddress, MockDaffPersonalAddress, MockSubdivision };
@@ -1,8 +0,0 @@
1
- import { DaffAddress } from '../models/address';
2
- /**
3
- * Compares two addresses and returns true if all of their fields are equal.
4
- *
5
- * @param address0 An address.
6
- * @param address1 An address.
7
- */
8
- export declare function daffCompareAddresses(address0: DaffAddress, address1: DaffAddress): boolean;
@@ -1,8 +0,0 @@
1
- import { DaffPersonalAddress } from '../models/personal-address';
2
- /**
3
- * Compares two personal addresses and returns true if all of their fields are equal.
4
- *
5
- * @param address0 A personal address.
6
- * @param address1 A personal address.
7
- */
8
- export declare function daffComparePersonalAddresses(address0: DaffPersonalAddress, address1: DaffPersonalAddress): boolean;
@@ -1,2 +0,0 @@
1
- export { daffCompareAddresses } from './address';
2
- export { daffComparePersonalAddresses } from './personal-address';
@@ -1,6 +0,0 @@
1
- import { DaffError, DaffInheritableError } from '@daffodil/core';
2
- export declare class DaffCountryNotFoundError extends DaffInheritableError implements DaffError {
3
- message: string;
4
- readonly code: string;
5
- constructor(message: string);
6
- }
@@ -1,6 +0,0 @@
1
- import { DaffError, DaffInheritableError } from '@daffodil/core';
2
- export declare class DaffGeographyInvalidAPIResponseError extends DaffInheritableError implements DaffError {
3
- message: string;
4
- readonly code: string;
5
- constructor(message: string);
6
- }
@@ -1,2 +0,0 @@
1
- export { DaffCountryNotFoundError } from './country-not-found';
2
- export { DaffGeographyInvalidAPIResponseError } from './invalid-api-response';
@@ -1,32 +0,0 @@
1
- import { InMemoryDbService, RequestInfo } from 'angular-in-memory-web-api';
2
- import { DaffInMemorySingleRouteableBackend } from '@daffodil/driver/in-memory';
3
- import { DaffCountry } from '@daffodil/geography';
4
- import { DaffCountryFactory, DaffSubdivisionFactory } from '@daffodil/geography/testing';
5
- import * as i0 from "@angular/core";
6
- /**
7
- * An in-memory service that stubs out the backend services for getting countries.
8
- *
9
- * @inheritdoc
10
- */
11
- export declare class DaffInMemoryBackendGeographyService implements InMemoryDbService, DaffInMemorySingleRouteableBackend {
12
- private countryFactory;
13
- private subdivisionFactory;
14
- readonly collectionName = "countries";
15
- countries: DaffCountry[];
16
- constructor(countryFactory: DaffCountryFactory, subdivisionFactory: DaffSubdivisionFactory);
17
- /**
18
- * Creates a fake database of countries for the geography inmemory backend service.
19
- *
20
- * @docs-private
21
- * @returns A fake database of an array of countries
22
- */
23
- createDb(reqInfo: RequestInfo): any;
24
- /**
25
- * Responds to GET requests.
26
- */
27
- get(reqInfo: RequestInfo): any;
28
- private getCountry;
29
- private listCountries;
30
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffInMemoryBackendGeographyService, never>;
31
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffInMemoryBackendGeographyService>;
32
- }
@@ -1 +0,0 @@
1
- export declare const DAFF_GEOGRAPHY_IN_MEMORY_COLLECTION_NAME = "countries";
@@ -1,9 +0,0 @@
1
- import { ModuleWithProviders } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- import * as i1 from "@angular/common";
4
- export declare class DaffGeographyInMemoryDriverModule {
5
- static forRoot(): ModuleWithProviders<DaffGeographyInMemoryDriverModule>;
6
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffGeographyInMemoryDriverModule, never>;
7
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffGeographyInMemoryDriverModule, never, [typeof i1.CommonModule], never>;
8
- static ɵinj: i0.ɵɵInjectorDeclaration<DaffGeographyInMemoryDriverModule>;
9
- }
@@ -1,18 +0,0 @@
1
- import { HttpClient } from '@angular/common/http';
2
- import { InMemoryBackendConfig } from 'angular-in-memory-web-api';
3
- import { Observable } from 'rxjs';
4
- import { DaffInMemoryDriverBase } from '@daffodil/driver/in-memory';
5
- import { DaffCountry } from '@daffodil/geography';
6
- import { DaffGeographyServiceInterface } from '@daffodil/geography/driver';
7
- import * as i0 from "@angular/core";
8
- /**
9
- * @inheritdoc
10
- */
11
- export declare class DaffInMemoryGeographyService extends DaffInMemoryDriverBase implements DaffGeographyServiceInterface<DaffCountry> {
12
- private http;
13
- constructor(http: HttpClient, config: InMemoryBackendConfig);
14
- get(countryId: DaffCountry['id']): Observable<DaffCountry>;
15
- list(): Observable<DaffCountry[]>;
16
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffInMemoryGeographyService, never>;
17
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffInMemoryGeographyService>;
18
- }
@@ -1,2 +0,0 @@
1
- export { DaffGeographyInMemoryDriverModule } from './geography-driver.module';
2
- export { DaffInMemoryGeographyService } from './geography.service';
@@ -1,2 +0,0 @@
1
- export * from './drivers/public_api';
2
- export { DaffInMemoryBackendGeographyService } from './backend/geography.service';
@@ -1,13 +0,0 @@
1
- import { Observable } from 'rxjs';
2
- import { DaffCountry } from '@daffodil/geography';
3
- export declare const DaffGeographyDriver: import("@angular/core").InjectionToken<DaffGeographyServiceInterface<DaffCountry>>, provideDaffGeographyDriver: <R extends DaffGeographyServiceInterface<DaffCountry> = DaffGeographyServiceInterface<DaffCountry>>(klass: import("@angular/core").Type<R>) => import("@angular/core").ExistingProvider;
4
- export interface DaffGeographyServiceInterface<T extends DaffCountry = DaffCountry> {
5
- /**
6
- * Retrieves the list of countries available to the given store.
7
- */
8
- list(): Observable<T[]>;
9
- /**
10
- * Retrieve precise information about a specific country.
11
- */
12
- get(id: T['id']): Observable<T>;
13
- }
@@ -1,3 +0,0 @@
1
- export declare enum MagentoGeographyGraphQlErrorCode {
2
- COUNTRY_NOT_FOUND = "graphql-no-such-entity"
3
- }
@@ -1,2 +0,0 @@
1
- import { DaffErrorCodeMap } from '@daffodil/core';
2
- export declare const DaffGeographyMagentoErrorMap: DaffErrorCodeMap;
@@ -1 +0,0 @@
1
- export declare function transformMagentoGeographyError(error: any): import("@daffodil/core").DaffError;
@@ -1,9 +0,0 @@
1
- import { ModuleWithProviders } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- import * as i1 from "@angular/common";
4
- export declare class DaffGeographyMagentoDriverModule {
5
- static forRoot(): ModuleWithProviders<DaffGeographyMagentoDriverModule>;
6
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffGeographyMagentoDriverModule, never>;
7
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffGeographyMagentoDriverModule, never, [typeof i1.CommonModule], never>;
8
- static ɵinj: i0.ɵɵInjectorDeclaration<DaffGeographyMagentoDriverModule>;
9
- }
@@ -1,20 +0,0 @@
1
- import { Apollo } from 'apollo-angular';
2
- import { Observable } from 'rxjs';
3
- import { DaffCountry } from '@daffodil/geography';
4
- import { DaffGeographyServiceInterface } from '@daffodil/geography/driver';
5
- import { DaffMagentoCountryTransformer } from './transforms/responses/country.service';
6
- import * as i0 from "@angular/core";
7
- /**
8
- * A service for making Magento GraphQL queries for carts.
9
- *
10
- * @inheritdoc
11
- */
12
- export declare class DaffGeographyMagentoService implements DaffGeographyServiceInterface<DaffCountry> {
13
- private apollo;
14
- countryTransformer: DaffMagentoCountryTransformer;
15
- constructor(apollo: Apollo, countryTransformer: DaffMagentoCountryTransformer);
16
- list(): Observable<DaffCountry[]>;
17
- get(countryId: DaffCountry['id']): Observable<DaffCountry>;
18
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffGeographyMagentoService, never>;
19
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffGeographyMagentoService>;
20
- }
@@ -1,10 +0,0 @@
1
- import { MagentoRegion } from './region';
2
- export interface MagentoCountry {
3
- __typename?: 'Country';
4
- id: string;
5
- available_regions?: MagentoRegion[];
6
- full_name_english: string;
7
- full_name_locale: string;
8
- three_letter_abbreviation: string;
9
- two_letter_abbreviation: string;
10
- }
@@ -1,2 +0,0 @@
1
- export { MagentoCountry } from './country';
2
- export { MagentoRegion } from './region';
@@ -1,6 +0,0 @@
1
- export interface MagentoRegion {
2
- __typename?: 'Region';
3
- id: number;
4
- code: string;
5
- name: string;
6
- }
@@ -1,6 +0,0 @@
1
- export { DaffMagentoCountryTransformer } from './transforms/responses/country.service';
2
- export { DaffMagentoSubdivisionTransformer } from './transforms/responses/subdivision.service';
3
- export * from './models/responses/public_api';
4
- export * from './queries/public_api';
5
- export { DaffGeographyMagentoService } from './geography.service';
6
- export { DaffGeographyMagentoDriverModule } from './geography-driver.module';
@@ -1 +0,0 @@
1
- export declare const countryFragment: import("apollo-angular").TypedDocumentNode<unknown, unknown>;
@@ -1,2 +0,0 @@
1
- export { countryFragment } from './country';
2
- export { regionFragment } from './region';
@@ -1 +0,0 @@
1
- export declare const regionFragment: import("apollo-angular").TypedDocumentNode<unknown, unknown>;
@@ -1,2 +0,0 @@
1
- export declare const MAGENTO_GET_COUNTRIES_QUERY_NAME = "MagentoGetCountries";
2
- export declare const getCountries: import("apollo-angular").TypedDocumentNode<unknown, unknown>;
@@ -1,2 +0,0 @@
1
- export declare const MAGENTO_GET_COUNTRY_QUERY_NAME = "MagentoGetCountry";
2
- export declare const getCountry: import("apollo-angular").TypedDocumentNode<unknown, unknown>;
@@ -1,4 +0,0 @@
1
- export * from './fragments/public_api';
2
- export * from './responses/public_api';
3
- export * from './get-countries';
4
- export * from './get-country';
@@ -1,4 +0,0 @@
1
- import { MagentoCountry } from '../../models/responses/country';
2
- export interface MagentoGetCountriesResponse {
3
- countries: MagentoCountry[];
4
- }
@@ -1,4 +0,0 @@
1
- import { MagentoCountry } from '../../models/responses/country';
2
- export interface MagentoGetCountryResponse {
3
- country: MagentoCountry;
4
- }
@@ -1,2 +0,0 @@
1
- export { MagentoGetCountriesResponse } from './get-countries';
2
- export { MagentoGetCountryResponse } from './get-country';
@@ -1,18 +0,0 @@
1
- import { DaffCountry } from '@daffodil/geography';
2
- import { DaffMagentoSubdivisionTransformer } from './subdivision.service';
3
- import { MagentoCountry } from '../../models/responses/country';
4
- import * as i0 from "@angular/core";
5
- /**
6
- * Transforms magento carts into an object usable by daffodil.
7
- */
8
- export declare class DaffMagentoCountryTransformer {
9
- subdivisionTransformer: DaffMagentoSubdivisionTransformer;
10
- constructor(subdivisionTransformer: DaffMagentoSubdivisionTransformer);
11
- private transformSubdivisions;
12
- /**
13
- * Transforms the MagentoCountry from the magento country query into a DaffCountry.
14
- */
15
- transform(country: MagentoCountry): DaffCountry;
16
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffMagentoCountryTransformer, never>;
17
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffMagentoCountryTransformer>;
18
- }
@@ -1,14 +0,0 @@
1
- import { DaffSubdivision } from '@daffodil/geography';
2
- import { MagentoRegion } from '../../models/responses/region';
3
- import * as i0 from "@angular/core";
4
- /**
5
- * Transforms magento carts into an object usable by daffodil.
6
- */
7
- export declare class DaffMagentoSubdivisionTransformer {
8
- /**
9
- * Transforms the MagentoRegion from the magento region query into a DaffSubdivision.
10
- */
11
- transform(region: MagentoRegion): DaffSubdivision;
12
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffMagentoSubdivisionTransformer, never>;
13
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffMagentoSubdivisionTransformer>;
14
- }
@@ -1,3 +0,0 @@
1
- import { ApolloQueryResult } from '@apollo/client/core';
2
- import { MagentoGetCountriesResponse } from '../queries/public_api';
3
- export declare const validateGetCountriesResponse: (response: ApolloQueryResult<MagentoGetCountriesResponse>) => ApolloQueryResult<MagentoGetCountriesResponse>;
@@ -1 +0,0 @@
1
- export { validateGetCountriesResponse } from './get-countries';
@@ -1,2 +0,0 @@
1
- export * from './errors/public_api';
2
- export { DaffGeographyServiceInterface, DaffGeographyDriver, provideDaffGeographyDriver, } from './interfaces/geography-service.interface';
@@ -1,9 +0,0 @@
1
- import { ModuleWithProviders } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- import * as i1 from "@angular/common";
4
- export declare class DaffGeographyTestingDriverModule {
5
- static forRoot(): ModuleWithProviders<DaffGeographyTestingDriverModule>;
6
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffGeographyTestingDriverModule, never>;
7
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffGeographyTestingDriverModule, never, [typeof i1.CommonModule], never>;
8
- static ɵinj: i0.ɵɵInjectorDeclaration<DaffGeographyTestingDriverModule>;
9
- }
@@ -1,17 +0,0 @@
1
- import { Observable } from 'rxjs';
2
- import { DaffCountry } from '@daffodil/geography';
3
- import { DaffGeographyServiceInterface } from '@daffodil/geography/driver';
4
- import { DaffCountryFactory, DaffSubdivisionFactory } from '@daffodil/geography/testing';
5
- import * as i0 from "@angular/core";
6
- /**
7
- * @inheritdoc
8
- */
9
- export declare class DaffTestingGeographyService implements DaffGeographyServiceInterface<DaffCountry> {
10
- private countryFactory;
11
- private subdivisionFactory;
12
- constructor(countryFactory: DaffCountryFactory, subdivisionFactory: DaffSubdivisionFactory);
13
- get(countryId: DaffCountry['id']): Observable<DaffCountry>;
14
- list(): Observable<DaffCountry[]>;
15
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffTestingGeographyService, never>;
16
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffTestingGeographyService>;
17
- }
@@ -1,2 +0,0 @@
1
- export { DaffGeographyTestingDriverModule } from './geography-driver.module';
2
- export { DaffTestingGeographyService } from './geography.service';
@@ -1 +0,0 @@
1
- export * from './drivers/public_api';
@@ -1,18 +0,0 @@
1
- import { ID } from '@daffodil/core';
2
- import { DaffSubdivision } from './subdivision';
3
- /**
4
- * A basic model of an address
5
- */
6
- export interface DaffAddress {
7
- street: string;
8
- street2?: string;
9
- city: string;
10
- /**
11
- * The ID of the {@link DaffSubdivision}.
12
- */
13
- region: DaffSubdivision['id'];
14
- region_code?: DaffSubdivision['iso_3166_2'];
15
- country?: ID;
16
- country_id?: ID;
17
- postcode: string;
18
- }
@@ -1,18 +0,0 @@
1
- import { DaffIdentifiable } from '@daffodil/core';
2
- import { DaffSubdivision } from './subdivision';
3
- /**
4
- * A representation of a country on the planet Earth.
5
- * See: ISO-3166
6
- */
7
- export interface DaffCountry extends DaffIdentifiable {
8
- name: string;
9
- name_en: string;
10
- alpha2: string;
11
- alpha3: string;
12
- subdivisions: DaffSubdivision[];
13
- /**
14
- * Whether or not the country has been fully loaded.
15
- * If true, the subdivisions field will be populated if any exist.
16
- */
17
- loaded?: boolean;
18
- }
@@ -1,14 +0,0 @@
1
- import { DaffAddress } from './address';
2
- /**
3
- * A specialized type of address useful for associating a physical address
4
- * with a particular individual.
5
- */
6
- export interface DaffPersonalAddress extends DaffAddress {
7
- prefix?: string;
8
- suffix?: string;
9
- firstname: string;
10
- middlename?: string;
11
- lastname: string;
12
- telephone: string;
13
- email?: string;
14
- }
@@ -1,4 +0,0 @@
1
- export { DaffAddress } from './address';
2
- export { DaffPersonalAddress } from './personal-address';
3
- export { DaffCountry } from './country';
4
- export { DaffSubdivision } from './subdivision';
@@ -1,9 +0,0 @@
1
- import { DaffIdentifiable } from '@daffodil/core';
2
- /**
3
- * The subdivisions of a country as per ISO-3166-2
4
- * For the United States this is commonly termed as "States"
5
- */
6
- export interface DaffSubdivision extends DaffIdentifiable {
7
- name: string;
8
- iso_3166_2: string;
9
- }
package/public_api.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from './models/public_api';
2
- export * from './comparators/public_api';
@@ -1,40 +0,0 @@
1
- import { Action } from '@ngrx/store';
2
- import { DaffStateError } from '@daffodil/core/state';
3
- import { DaffCountry } from '@daffodil/geography';
4
- export declare enum DaffGeographyActionTypes {
5
- CountryLoadAction = "[@daffodil/geography] Country Load Action",
6
- CountryLoadSuccessAction = "[@daffodil/geography] Country Load Success Action",
7
- CountryLoadFailureAction = "[@daffodil/geography] Country Load Failure Action",
8
- CountryListAction = "[@daffodil/geography] Country List Action",
9
- CountryListSuccessAction = "[@daffodil/geography] Country List Success Action",
10
- CountryListFailureAction = "[@daffodil/geography] Country List Failure Action"
11
- }
12
- export declare class DaffCountryLoad<T extends DaffCountry> implements Action {
13
- payload: T['id'];
14
- readonly type = DaffGeographyActionTypes.CountryLoadAction;
15
- constructor(payload: T['id']);
16
- }
17
- export declare class DaffCountryLoadSuccess<T extends DaffCountry> implements Action {
18
- payload: T;
19
- readonly type = DaffGeographyActionTypes.CountryLoadSuccessAction;
20
- constructor(payload: T);
21
- }
22
- export declare class DaffCountryLoadFailure implements Action {
23
- payload: DaffStateError;
24
- readonly type = DaffGeographyActionTypes.CountryLoadFailureAction;
25
- constructor(payload: DaffStateError);
26
- }
27
- export declare class DaffCountryList implements Action {
28
- readonly type = DaffGeographyActionTypes.CountryListAction;
29
- }
30
- export declare class DaffCountryListSuccess<T extends DaffCountry> implements Action {
31
- payload: T[];
32
- readonly type = DaffGeographyActionTypes.CountryListSuccessAction;
33
- constructor(payload: T[]);
34
- }
35
- export declare class DaffCountryListFailure implements Action {
36
- payload: DaffStateError;
37
- readonly type = DaffGeographyActionTypes.CountryListFailureAction;
38
- constructor(payload: DaffStateError);
39
- }
40
- export type DaffGeographyActions<T extends DaffCountry> = DaffCountryLoad<T> | DaffCountryLoadSuccess<T> | DaffCountryLoadFailure | DaffCountryList | DaffCountryListSuccess<T> | DaffCountryListFailure;
@@ -1 +0,0 @@
1
- export * from './geography.actions';
@@ -1,16 +0,0 @@
1
- import { Actions } from '@ngrx/effects';
2
- import { ErrorTransformer } from '@daffodil/core/state';
3
- import { DaffCountry } from '@daffodil/geography';
4
- import { DaffGeographyServiceInterface } from '@daffodil/geography/driver';
5
- import { DaffCountryLoadSuccess, DaffCountryLoadFailure, DaffCountryListSuccess, DaffCountryListFailure } from '../actions/public_api';
6
- import * as i0 from "@angular/core";
7
- export declare class DaffGeographyEffects<T extends DaffCountry> {
8
- private actions$;
9
- private driver;
10
- private errorMatcher;
11
- constructor(actions$: Actions, driver: DaffGeographyServiceInterface<T>, errorMatcher: ErrorTransformer);
12
- get$: import("rxjs").Observable<DaffCountryLoadFailure | DaffCountryLoadSuccess<T>> & import("@ngrx/effects").CreateEffectMetadata;
13
- list$: import("rxjs").Observable<DaffCountryListFailure | DaffCountryListSuccess<T>> & import("@ngrx/effects").CreateEffectMetadata;
14
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffGeographyEffects<any>, never>;
15
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffGeographyEffects<any>>;
16
- }
@@ -1,16 +0,0 @@
1
- import { Dictionary } from '@ngrx/entity';
2
- import { Action } from '@ngrx/store';
3
- import { Observable } from 'rxjs';
4
- import { DaffStoreFacade, DaffStateError } from '@daffodil/core/state';
5
- import { DaffCountry } from '@daffodil/geography';
6
- export interface DaffGeographyFacadeInterface<T extends DaffCountry = DaffCountry> extends DaffStoreFacade<Action> {
7
- loading$: Observable<boolean>;
8
- errors$: Observable<DaffStateError[]>;
9
- countries$: Observable<T[]>;
10
- countryIds$: Observable<T['id'][]>;
11
- countryCount$: Observable<number>;
12
- countryEntities$: Observable<Dictionary<T>>;
13
- getCountry(id: T['id']): Observable<T>;
14
- getCountrySubdivisions(id: T['id']): Observable<T['subdivisions']>;
15
- isCountryFullyLoaded(id: T['id']): Observable<boolean>;
16
- }
@@ -1,30 +0,0 @@
1
- import { Dictionary } from '@ngrx/entity';
2
- import { Action, Store } from '@ngrx/store';
3
- import { Observable } from 'rxjs';
4
- import { DaffStateError } from '@daffodil/core/state';
5
- import { DaffCountry } from '@daffodil/geography';
6
- import { DaffGeographyFacadeInterface } from './geography-facade.interface';
7
- import { DaffGeographyStateRootSlice } from '../../reducers/public_api';
8
- import * as i0 from "@angular/core";
9
- /**
10
- * @inheritdoc
11
- */
12
- export declare class DaffGeographyFacade<T extends DaffCountry = DaffCountry> implements DaffGeographyFacadeInterface<T> {
13
- private store;
14
- loading$: Observable<boolean>;
15
- errors$: Observable<DaffStateError[]>;
16
- countries$: Observable<T[]>;
17
- countryIds$: Observable<T['id'][]>;
18
- countryCount$: Observable<number>;
19
- countryEntities$: Observable<Dictionary<T>>;
20
- private _selectCountry;
21
- private _selectCountrySubdivisions;
22
- private _selectIsCountryFullyLoaded;
23
- constructor(store: Store<DaffGeographyStateRootSlice<T>>);
24
- getCountry(id: T['id']): Observable<T>;
25
- getCountrySubdivisions(id: T['id']): Observable<T['subdivisions']>;
26
- isCountryFullyLoaded(id: T['id']): Observable<boolean>;
27
- dispatch(action: Action): void;
28
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffGeographyFacade<any>, never>;
29
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffGeographyFacade<any>>;
30
- }