@daffodil/geography 0.94.1 → 0.95.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/daffodil-geography-driver-in-memory.mjs +161 -121
- package/fesm2022/daffodil-geography-driver-in-memory.mjs.map +1 -1
- package/fesm2022/daffodil-geography-driver-magento-2.4.7.mjs +246 -0
- package/fesm2022/daffodil-geography-driver-magento-2.4.7.mjs.map +1 -0
- package/fesm2022/daffodil-geography-driver-magento-auto.mjs +7 -0
- package/fesm2022/daffodil-geography-driver-magento-auto.mjs.map +1 -0
- package/fesm2022/daffodil-geography-driver-testing.mjs +100 -61
- package/fesm2022/daffodil-geography-driver-testing.mjs.map +1 -1
- package/fesm2022/daffodil-geography-driver.mjs +18 -29
- package/fesm2022/daffodil-geography-driver.mjs.map +1 -1
- package/fesm2022/daffodil-geography-state-testing.mjs +98 -57
- package/fesm2022/daffodil-geography-state-testing.mjs.map +1 -1
- package/fesm2022/daffodil-geography-state.mjs +275 -275
- package/fesm2022/daffodil-geography-state.mjs.map +1 -1
- package/fesm2022/daffodil-geography-testing.mjs +190 -107
- package/fesm2022/daffodil-geography-testing.mjs.map +1 -1
- package/fesm2022/daffodil-geography.mjs +21 -43
- package/fesm2022/daffodil-geography.mjs.map +1 -1
- package/package.json +1 -1
- package/types/daffodil-geography-driver-in-memory.d.ts +51 -49
- package/types/daffodil-geography-driver-magento-2.4.7.d.ts +86 -0
- package/types/daffodil-geography-driver-magento-auto.d.ts +1 -0
- package/types/daffodil-geography-driver-testing.d.ts +28 -25
- package/types/daffodil-geography-driver.d.ts +22 -30
- package/types/daffodil-geography-state-testing.d.ts +33 -29
- package/types/daffodil-geography-state.d.ts +124 -139
- package/types/daffodil-geography-testing.d.ts +56 -63
- package/types/daffodil-geography.d.ts +37 -46
- package/fesm2022/daffodil-geography-driver-magento.mjs +0 -196
- package/fesm2022/daffodil-geography-driver-magento.mjs.map +0 -1
- package/types/daffodil-geography-driver-magento.d.ts +0 -95
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, NgModule } from '@angular/core';
|
|
3
|
-
import * as i1 from 'apollo-angular';
|
|
4
|
-
import { gql } from 'apollo-angular';
|
|
5
|
-
import { throwError } from 'rxjs';
|
|
6
|
-
import { map, catchError } from 'rxjs/operators';
|
|
7
|
-
import { daffTransformMagentoError, provideDaffMagentoCacheableOperation } from '@daffodil/driver/magento';
|
|
8
|
-
import { DaffCountryNotFoundError, DaffGeographyInvalidAPIResponseError, provideDaffGeographyDriver } from '@daffodil/geography/driver';
|
|
9
|
-
import { CommonModule } from '@angular/common';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Transforms magento carts into an object usable by daffodil.
|
|
13
|
-
*/
|
|
14
|
-
class DaffMagentoSubdivisionTransformer {
|
|
15
|
-
/**
|
|
16
|
-
* Transforms the MagentoRegion from the magento region query into a DaffSubdivision.
|
|
17
|
-
*/
|
|
18
|
-
transform(region) {
|
|
19
|
-
return region ? {
|
|
20
|
-
...{ magento_region: region },
|
|
21
|
-
id: String(region.id),
|
|
22
|
-
name: region.name,
|
|
23
|
-
iso_3166_2: region.code,
|
|
24
|
-
} : null;
|
|
25
|
-
}
|
|
26
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoSubdivisionTransformer, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
27
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoSubdivisionTransformer, providedIn: 'root' }); }
|
|
28
|
-
}
|
|
29
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoSubdivisionTransformer, decorators: [{
|
|
30
|
-
type: Injectable,
|
|
31
|
-
args: [{
|
|
32
|
-
providedIn: 'root',
|
|
33
|
-
}]
|
|
34
|
-
}] });
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Transforms magento carts into an object usable by daffodil.
|
|
38
|
-
*/
|
|
39
|
-
class DaffMagentoCountryTransformer {
|
|
40
|
-
constructor(subdivisionTransformer) {
|
|
41
|
-
this.subdivisionTransformer = subdivisionTransformer;
|
|
42
|
-
}
|
|
43
|
-
transformSubdivisions(regions) {
|
|
44
|
-
return regions.map(region => this.subdivisionTransformer.transform(region));
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Transforms the MagentoCountry from the magento country query into a DaffCountry.
|
|
48
|
-
*/
|
|
49
|
-
transform(country) {
|
|
50
|
-
return country ? {
|
|
51
|
-
...{ magento_country: country },
|
|
52
|
-
subdivisions: this.transformSubdivisions(country.available_regions || []),
|
|
53
|
-
id: country.id,
|
|
54
|
-
name: country.full_name_locale,
|
|
55
|
-
name_en: country.full_name_english,
|
|
56
|
-
alpha2: country.two_letter_abbreviation,
|
|
57
|
-
alpha3: country.three_letter_abbreviation,
|
|
58
|
-
} : null;
|
|
59
|
-
}
|
|
60
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoCountryTransformer, deps: [{ token: DaffMagentoSubdivisionTransformer }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
61
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoCountryTransformer, providedIn: 'root' }); }
|
|
62
|
-
}
|
|
63
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoCountryTransformer, decorators: [{
|
|
64
|
-
type: Injectable,
|
|
65
|
-
args: [{
|
|
66
|
-
providedIn: 'root',
|
|
67
|
-
}]
|
|
68
|
-
}], ctorParameters: () => [{ type: DaffMagentoSubdivisionTransformer }] });
|
|
69
|
-
|
|
70
|
-
const countryFragment = gql `
|
|
71
|
-
fragment country on Country {
|
|
72
|
-
id
|
|
73
|
-
full_name_english
|
|
74
|
-
full_name_locale
|
|
75
|
-
three_letter_abbreviation
|
|
76
|
-
two_letter_abbreviation
|
|
77
|
-
}
|
|
78
|
-
`;
|
|
79
|
-
|
|
80
|
-
const regionFragment = gql `
|
|
81
|
-
fragment region on Region {
|
|
82
|
-
code
|
|
83
|
-
id
|
|
84
|
-
name
|
|
85
|
-
}
|
|
86
|
-
`;
|
|
87
|
-
|
|
88
|
-
const MAGENTO_GET_COUNTRIES_QUERY_NAME = 'MagentoGetCountries';
|
|
89
|
-
const getCountries = gql `
|
|
90
|
-
query ${MAGENTO_GET_COUNTRIES_QUERY_NAME} {
|
|
91
|
-
countries {
|
|
92
|
-
...country
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
${countryFragment}
|
|
96
|
-
`;
|
|
97
|
-
|
|
98
|
-
const MAGENTO_GET_COUNTRY_QUERY_NAME = 'MagentoGetCountry';
|
|
99
|
-
const getCountry = gql `
|
|
100
|
-
query ${MAGENTO_GET_COUNTRY_QUERY_NAME}($countryId: String!) {
|
|
101
|
-
country(id: $countryId) {
|
|
102
|
-
...country
|
|
103
|
-
available_regions {
|
|
104
|
-
...region
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
${countryFragment}
|
|
109
|
-
${regionFragment}
|
|
110
|
-
`;
|
|
111
|
-
|
|
112
|
-
var MagentoGeographyGraphQlErrorCode;
|
|
113
|
-
(function (MagentoGeographyGraphQlErrorCode) {
|
|
114
|
-
MagentoGeographyGraphQlErrorCode["COUNTRY_NOT_FOUND"] = "graphql-no-such-entity";
|
|
115
|
-
})(MagentoGeographyGraphQlErrorCode || (MagentoGeographyGraphQlErrorCode = {}));
|
|
116
|
-
|
|
117
|
-
const DaffGeographyMagentoErrorMap = {
|
|
118
|
-
[MagentoGeographyGraphQlErrorCode.COUNTRY_NOT_FOUND]: DaffCountryNotFoundError,
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
function transformMagentoGeographyError(error) {
|
|
122
|
-
return daffTransformMagentoError(error, DaffGeographyMagentoErrorMap);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
const validateGetCountriesResponse = (response) => {
|
|
126
|
-
if (response.data.countries) {
|
|
127
|
-
return response;
|
|
128
|
-
}
|
|
129
|
-
else {
|
|
130
|
-
throw new DaffGeographyInvalidAPIResponseError('Get countries response does not contain a valid list of countries.');
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* A service for making Magento GraphQL queries for carts.
|
|
136
|
-
*
|
|
137
|
-
* @inheritdoc
|
|
138
|
-
*/
|
|
139
|
-
class DaffGeographyMagentoService {
|
|
140
|
-
constructor(apollo, countryTransformer) {
|
|
141
|
-
this.apollo = apollo;
|
|
142
|
-
this.countryTransformer = countryTransformer;
|
|
143
|
-
}
|
|
144
|
-
list() {
|
|
145
|
-
return this.apollo.query({
|
|
146
|
-
query: getCountries,
|
|
147
|
-
}).pipe(map(validateGetCountriesResponse), map(result => result.data.countries.map(country => this.countryTransformer.transform(country))), catchError(err => throwError(() => transformMagentoGeographyError(err))));
|
|
148
|
-
}
|
|
149
|
-
get(countryId) {
|
|
150
|
-
return this.apollo.query({
|
|
151
|
-
query: getCountry,
|
|
152
|
-
variables: {
|
|
153
|
-
countryId,
|
|
154
|
-
},
|
|
155
|
-
}).pipe(map(result => this.countryTransformer.transform(result.data.country)), catchError(err => throwError(() => transformMagentoGeographyError(err))));
|
|
156
|
-
}
|
|
157
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffGeographyMagentoService, deps: [{ token: i1.Apollo }, { token: DaffMagentoCountryTransformer }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
158
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffGeographyMagentoService, providedIn: 'root' }); }
|
|
159
|
-
}
|
|
160
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffGeographyMagentoService, decorators: [{
|
|
161
|
-
type: Injectable,
|
|
162
|
-
args: [{
|
|
163
|
-
providedIn: 'root',
|
|
164
|
-
}]
|
|
165
|
-
}], ctorParameters: () => [{ type: i1.Apollo }, { type: DaffMagentoCountryTransformer }] });
|
|
166
|
-
|
|
167
|
-
class DaffGeographyMagentoDriverModule {
|
|
168
|
-
static forRoot() {
|
|
169
|
-
return {
|
|
170
|
-
ngModule: DaffGeographyMagentoDriverModule,
|
|
171
|
-
providers: [
|
|
172
|
-
provideDaffGeographyDriver(DaffGeographyMagentoService),
|
|
173
|
-
provideDaffMagentoCacheableOperation(MAGENTO_GET_COUNTRY_QUERY_NAME),
|
|
174
|
-
provideDaffMagentoCacheableOperation(MAGENTO_GET_COUNTRIES_QUERY_NAME),
|
|
175
|
-
],
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffGeographyMagentoDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
179
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: DaffGeographyMagentoDriverModule, imports: [CommonModule] }); }
|
|
180
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffGeographyMagentoDriverModule, imports: [CommonModule] }); }
|
|
181
|
-
}
|
|
182
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffGeographyMagentoDriverModule, decorators: [{
|
|
183
|
-
type: NgModule,
|
|
184
|
-
args: [{
|
|
185
|
-
imports: [
|
|
186
|
-
CommonModule,
|
|
187
|
-
],
|
|
188
|
-
}]
|
|
189
|
-
}] });
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* Generated bundle index. Do not edit.
|
|
193
|
-
*/
|
|
194
|
-
|
|
195
|
-
export { DaffGeographyMagentoDriverModule, DaffGeographyMagentoService, DaffMagentoCountryTransformer, DaffMagentoSubdivisionTransformer, MAGENTO_GET_COUNTRIES_QUERY_NAME, MAGENTO_GET_COUNTRY_QUERY_NAME, countryFragment, getCountries, getCountry, regionFragment };
|
|
196
|
-
//# sourceMappingURL=daffodil-geography-driver-magento.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-geography-driver-magento.mjs","sources":["../../../libs/geography/driver/magento/src/transforms/responses/subdivision.service.ts","../../../libs/geography/driver/magento/src/transforms/responses/country.service.ts","../../../libs/geography/driver/magento/src/queries/fragments/country.ts","../../../libs/geography/driver/magento/src/queries/fragments/region.ts","../../../libs/geography/driver/magento/src/queries/get-countries.ts","../../../libs/geography/driver/magento/src/queries/get-country.ts","../../../libs/geography/driver/magento/src/errors/codes.ts","../../../libs/geography/driver/magento/src/errors/map.ts","../../../libs/geography/driver/magento/src/errors/transform.ts","../../../libs/geography/driver/magento/src/validators/get-countries.ts","../../../libs/geography/driver/magento/src/geography.service.ts","../../../libs/geography/driver/magento/src/geography-driver.module.ts","../../../libs/geography/driver/magento/src/daffodil-geography-driver-magento.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\n\nimport { DaffSubdivision } from '@daffodil/geography';\n\nimport { MagentoRegion } from '../../models/responses/region';\n\n/**\n * Transforms magento carts into an object usable by daffodil.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffMagentoSubdivisionTransformer {\n /**\n * Transforms the MagentoRegion from the magento region query into a DaffSubdivision.\n */\n transform(region: MagentoRegion): DaffSubdivision {\n return region ? {\n ...{ magento_region: region },\n\n id: String(region.id),\n name: region.name,\n iso_3166_2: region.code,\n } : null;\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { DaffCountry } from '@daffodil/geography';\n\nimport { DaffMagentoSubdivisionTransformer } from './subdivision.service';\nimport { MagentoCountry } from '../../models/responses/country';\n\n/**\n * Transforms magento carts into an object usable by daffodil.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffMagentoCountryTransformer {\n constructor(public subdivisionTransformer: DaffMagentoSubdivisionTransformer) {}\n\n private transformSubdivisions(regions: MagentoCountry['available_regions']): DaffCountry['subdivisions'] {\n return regions.map(region => this.subdivisionTransformer.transform(region));\n }\n\n /**\n * Transforms the MagentoCountry from the magento country query into a DaffCountry.\n */\n transform(country: MagentoCountry): DaffCountry {\n return country ? {\n ...{ magento_country: country },\n\n subdivisions: this.transformSubdivisions(country.available_regions || []),\n\n id: country.id,\n name: country.full_name_locale,\n name_en: country.full_name_english,\n alpha2: country.two_letter_abbreviation,\n alpha3: country.three_letter_abbreviation,\n } : null;\n }\n}\n","import { gql } from 'apollo-angular';\n\n\nexport const countryFragment = gql`\n fragment country on Country {\n id\n full_name_english\n full_name_locale\n three_letter_abbreviation\n two_letter_abbreviation\n }\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const regionFragment = gql`\n fragment region on Region {\n code\n id\n name\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { countryFragment } from './fragments/public_api';\n\nexport const MAGENTO_GET_COUNTRIES_QUERY_NAME = 'MagentoGetCountries';\n\nexport const getCountries = gql`\n query ${MAGENTO_GET_COUNTRIES_QUERY_NAME} {\n countries {\n ...country\n }\n }\n ${countryFragment}\n`;\n","import { gql } from 'apollo-angular';\n\nimport {\n countryFragment,\n regionFragment,\n} from './fragments/public_api';\n\nexport const MAGENTO_GET_COUNTRY_QUERY_NAME = 'MagentoGetCountry';\n\nexport const getCountry = gql`\n query ${MAGENTO_GET_COUNTRY_QUERY_NAME}($countryId: String!) {\n country(id: $countryId) {\n ...country\n available_regions {\n ...region\n }\n }\n }\n ${countryFragment}\n ${regionFragment}\n`;\n","export enum MagentoGeographyGraphQlErrorCode {\n COUNTRY_NOT_FOUND = 'graphql-no-such-entity',\n}\n","import { DaffErrorCodeMap } from '@daffodil/core';\nimport { DaffCountryNotFoundError } from '@daffodil/geography/driver';\n\nimport { MagentoGeographyGraphQlErrorCode } from './codes';\n\nexport const DaffGeographyMagentoErrorMap: DaffErrorCodeMap = {\n [MagentoGeographyGraphQlErrorCode.COUNTRY_NOT_FOUND]: DaffCountryNotFoundError,\n};\n","import { daffTransformMagentoError } from '@daffodil/driver/magento';\n\nimport { DaffGeographyMagentoErrorMap } from './map';\n\nexport function transformMagentoGeographyError(error: any) {\n return daffTransformMagentoError(error, DaffGeographyMagentoErrorMap);\n}\n","import { Apollo } from 'apollo-angular';\n\nimport { DaffGeographyInvalidAPIResponseError } from '@daffodil/geography/driver';\n\nimport { MagentoGetCountriesResponse } from '../queries/public_api';\n\nexport const validateGetCountriesResponse = (response: Apollo.QueryResult<MagentoGetCountriesResponse>) => {\n if (response.data.countries) {\n return response;\n } else {\n throw new DaffGeographyInvalidAPIResponseError('Get countries response does not contain a valid list of countries.');\n }\n};\n","import { Injectable } from '@angular/core';\nimport { Apollo } from 'apollo-angular';\nimport {\n Observable,\n throwError,\n} from 'rxjs';\nimport {\n map,\n catchError,\n} from 'rxjs/operators';\n\nimport { DaffCountry } from '@daffodil/geography';\nimport { DaffGeographyServiceInterface } from '@daffodil/geography/driver';\n\nimport { transformMagentoGeographyError } from './errors/transform';\nimport { getCountry } from './queries/get-country';\nimport {\n getCountries,\n MagentoGetCountriesResponse,\n} from './queries/public_api';\nimport { MagentoGetCountryResponse } from './queries/responses/get-country';\nimport { DaffMagentoCountryTransformer } from './transforms/responses/country.service';\nimport { validateGetCountriesResponse } from './validators/public_api';\n\n/**\n * A service for making Magento GraphQL queries for carts.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffGeographyMagentoService implements DaffGeographyServiceInterface<DaffCountry> {\n constructor(\n private apollo: Apollo,\n public countryTransformer: DaffMagentoCountryTransformer,\n ) {}\n\n list(): Observable<DaffCountry[]> {\n return this.apollo.query<MagentoGetCountriesResponse>({\n query: getCountries,\n }).pipe(\n map(validateGetCountriesResponse),\n map(result => result.data.countries.map(country => this.countryTransformer.transform(country))),\n catchError(err => throwError(() => transformMagentoGeographyError(err))),\n );\n }\n\n get(countryId: DaffCountry['id']): Observable<DaffCountry> {\n return this.apollo.query<MagentoGetCountryResponse>({\n query: getCountry,\n variables: {\n countryId,\n },\n }).pipe(\n map(result => this.countryTransformer.transform(result.data.country)),\n catchError(err => throwError(() => transformMagentoGeographyError(err))),\n );\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { provideDaffMagentoCacheableOperation } from '@daffodil/driver/magento';\nimport { provideDaffGeographyDriver } from '@daffodil/geography/driver';\n\nimport { DaffGeographyMagentoService } from './geography.service';\nimport {\n MAGENTO_GET_COUNTRIES_QUERY_NAME,\n MAGENTO_GET_COUNTRY_QUERY_NAME,\n} from './queries/public_api';\n\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffGeographyMagentoDriverModule {\n static forRoot(): ModuleWithProviders<DaffGeographyMagentoDriverModule> {\n return {\n ngModule: DaffGeographyMagentoDriverModule,\n providers: [\n provideDaffGeographyDriver(DaffGeographyMagentoService),\n provideDaffMagentoCacheableOperation(MAGENTO_GET_COUNTRY_QUERY_NAME),\n provideDaffMagentoCacheableOperation(MAGENTO_GET_COUNTRIES_QUERY_NAME),\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.DaffMagentoSubdivisionTransformer","i2.DaffMagentoCountryTransformer"],"mappings":";;;;;;;;;;AAMA;;AAEG;MAIU,i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AA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gCAAgC,YAHzC,YAAY,CAAA,EAAA,CAAA,CAAA;;2FAGH,gCAAgC,EAAA,UAAA,EAAA,CAAA;kBAL5C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACF,iBAAA;;;ACnBD;;AAEG;;;;"}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { DaffSubdivision, DaffCountry } from '@daffodil/geography';
|
|
2
|
-
import * as i0 from '@angular/core';
|
|
3
|
-
import { ModuleWithProviders } from '@angular/core';
|
|
4
|
-
import * as apollo_angular from 'apollo-angular';
|
|
5
|
-
import { Apollo } from 'apollo-angular';
|
|
6
|
-
import { Observable } from 'rxjs';
|
|
7
|
-
import { DaffGeographyServiceInterface } from '@daffodil/geography/driver';
|
|
8
|
-
import * as i1 from '@angular/common';
|
|
9
|
-
|
|
10
|
-
interface MagentoRegion {
|
|
11
|
-
__typename?: 'Region';
|
|
12
|
-
id: number;
|
|
13
|
-
code: string;
|
|
14
|
-
name: string;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Transforms magento carts into an object usable by daffodil.
|
|
19
|
-
*/
|
|
20
|
-
declare class DaffMagentoSubdivisionTransformer {
|
|
21
|
-
/**
|
|
22
|
-
* Transforms the MagentoRegion from the magento region query into a DaffSubdivision.
|
|
23
|
-
*/
|
|
24
|
-
transform(region: MagentoRegion): DaffSubdivision;
|
|
25
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DaffMagentoSubdivisionTransformer, never>;
|
|
26
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<DaffMagentoSubdivisionTransformer>;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
interface MagentoCountry {
|
|
30
|
-
__typename?: 'Country';
|
|
31
|
-
id: string;
|
|
32
|
-
available_regions?: MagentoRegion[];
|
|
33
|
-
full_name_english: string;
|
|
34
|
-
full_name_locale: string;
|
|
35
|
-
three_letter_abbreviation: string;
|
|
36
|
-
two_letter_abbreviation: string;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Transforms magento carts into an object usable by daffodil.
|
|
41
|
-
*/
|
|
42
|
-
declare class DaffMagentoCountryTransformer {
|
|
43
|
-
subdivisionTransformer: DaffMagentoSubdivisionTransformer;
|
|
44
|
-
constructor(subdivisionTransformer: DaffMagentoSubdivisionTransformer);
|
|
45
|
-
private transformSubdivisions;
|
|
46
|
-
/**
|
|
47
|
-
* Transforms the MagentoCountry from the magento country query into a DaffCountry.
|
|
48
|
-
*/
|
|
49
|
-
transform(country: MagentoCountry): DaffCountry;
|
|
50
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DaffMagentoCountryTransformer, never>;
|
|
51
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<DaffMagentoCountryTransformer>;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
declare const countryFragment: apollo_angular.TypedDocumentNode<unknown, unknown>;
|
|
55
|
-
|
|
56
|
-
declare const regionFragment: apollo_angular.TypedDocumentNode<unknown, unknown>;
|
|
57
|
-
|
|
58
|
-
interface MagentoGetCountriesResponse {
|
|
59
|
-
countries: MagentoCountry[];
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
interface MagentoGetCountryResponse {
|
|
63
|
-
country: MagentoCountry;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
declare const MAGENTO_GET_COUNTRIES_QUERY_NAME = "MagentoGetCountries";
|
|
67
|
-
declare const getCountries: apollo_angular.TypedDocumentNode<unknown, unknown>;
|
|
68
|
-
|
|
69
|
-
declare const MAGENTO_GET_COUNTRY_QUERY_NAME = "MagentoGetCountry";
|
|
70
|
-
declare const getCountry: apollo_angular.TypedDocumentNode<unknown, unknown>;
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* A service for making Magento GraphQL queries for carts.
|
|
74
|
-
*
|
|
75
|
-
* @inheritdoc
|
|
76
|
-
*/
|
|
77
|
-
declare class DaffGeographyMagentoService implements DaffGeographyServiceInterface<DaffCountry> {
|
|
78
|
-
private apollo;
|
|
79
|
-
countryTransformer: DaffMagentoCountryTransformer;
|
|
80
|
-
constructor(apollo: Apollo, countryTransformer: DaffMagentoCountryTransformer);
|
|
81
|
-
list(): Observable<DaffCountry[]>;
|
|
82
|
-
get(countryId: DaffCountry['id']): Observable<DaffCountry>;
|
|
83
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DaffGeographyMagentoService, never>;
|
|
84
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<DaffGeographyMagentoService>;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
declare class DaffGeographyMagentoDriverModule {
|
|
88
|
-
static forRoot(): ModuleWithProviders<DaffGeographyMagentoDriverModule>;
|
|
89
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DaffGeographyMagentoDriverModule, never>;
|
|
90
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffGeographyMagentoDriverModule, never, [typeof i1.CommonModule], never>;
|
|
91
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<DaffGeographyMagentoDriverModule>;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
export { DaffGeographyMagentoDriverModule, DaffGeographyMagentoService, DaffMagentoCountryTransformer, DaffMagentoSubdivisionTransformer, MAGENTO_GET_COUNTRIES_QUERY_NAME, MAGENTO_GET_COUNTRY_QUERY_NAME, countryFragment, getCountries, getCountry, regionFragment };
|
|
95
|
-
export type { MagentoCountry, MagentoGetCountriesResponse, MagentoGetCountryResponse, MagentoRegion };
|