@daffodil/geography 0.40.1 → 0.42.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/driver/magento/geography.service.d.ts +1 -1
- package/driver/magento/queries/fragments/country.d.ts +1 -1
- package/driver/magento/queries/fragments/region.d.ts +1 -1
- package/driver/magento/queries/get-countries.d.ts +1 -1
- package/driver/magento/queries/get-country.d.ts +1 -1
- package/esm2020/driver/in-memory/drivers/geography.service.mjs +2 -2
- package/esm2020/driver/interfaces/geography-service.interface.mjs +1 -1
- package/esm2020/driver/magento/errors/codes.mjs +1 -1
- package/esm2020/driver/magento/geography.service.mjs +5 -5
- package/esm2020/driver/magento/queries/fragments/country.mjs +2 -2
- package/esm2020/driver/magento/queries/fragments/region.mjs +2 -2
- package/esm2020/driver/magento/queries/get-countries.mjs +2 -2
- package/esm2020/driver/magento/queries/get-country.mjs +2 -2
- package/esm2020/models/address.mjs +1 -1
- package/esm2020/models/country.mjs +1 -1
- package/esm2020/models/personal-address.mjs +1 -1
- package/esm2020/testing/factories/country.factory.mjs +1 -1
- package/esm2020/testing/factories/subdivision.factory.mjs +1 -1
- package/fesm2015/daffodil-geography-driver-in-memory.mjs +1 -1
- package/fesm2015/daffodil-geography-driver-in-memory.mjs.map +1 -1
- package/fesm2015/daffodil-geography-driver-magento.mjs +4 -4
- package/fesm2015/daffodil-geography-driver-magento.mjs.map +1 -1
- package/fesm2015/daffodil-geography-driver.mjs.map +1 -1
- package/fesm2015/daffodil-geography-testing.mjs.map +1 -1
- package/fesm2020/daffodil-geography-driver-in-memory.mjs +1 -1
- package/fesm2020/daffodil-geography-driver-in-memory.mjs.map +1 -1
- package/fesm2020/daffodil-geography-driver-magento.mjs +4 -4
- package/fesm2020/daffodil-geography-driver-magento.mjs.map +1 -1
- package/fesm2020/daffodil-geography-driver.mjs.map +1 -1
- package/fesm2020/daffodil-geography-testing.mjs.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const countryFragment: import("
|
|
1
|
+
export declare const countryFragment: import("apollo-angular").TypedDocumentNode<unknown, unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const regionFragment: import("
|
|
1
|
+
export declare const regionFragment: import("apollo-angular").TypedDocumentNode<unknown, unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getCountries: import("
|
|
1
|
+
export declare const getCountries: import("apollo-angular").TypedDocumentNode<unknown, unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getCountry: import("
|
|
1
|
+
export declare const getCountry: import("apollo-angular").TypedDocumentNode<unknown, unknown>;
|
|
@@ -14,7 +14,7 @@ export class DaffInMemoryGeographyService {
|
|
|
14
14
|
this.url = '/api/countries';
|
|
15
15
|
}
|
|
16
16
|
get(countryId) {
|
|
17
|
-
return this.http.get(`${this.url}/${countryId}`).pipe(catchError((error) => throwError(DaffCountryNotFoundError)), map(result => result));
|
|
17
|
+
return this.http.get(`${this.url}/${countryId}`).pipe(catchError((error) => throwError(() => new DaffCountryNotFoundError('Country could not be found'))), map(result => result));
|
|
18
18
|
}
|
|
19
19
|
list() {
|
|
20
20
|
return this.http.get(`${this.url}/`);
|
|
@@ -28,4 +28,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
|
|
|
28
28
|
providedIn: 'root',
|
|
29
29
|
}]
|
|
30
30
|
}], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
|
|
31
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
31
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2VvZ3JhcGh5LnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL2dlb2dyYXBoeS9kcml2ZXIvaW4tbWVtb3J5L3NyYy9kcml2ZXJzL2dlb2dyYXBoeS5zZXJ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7dGhpcy51cmx9LyR7Y291bnRyeUlkfWApLnBpcGUoXG4gICAgICBjYXRjaEVycm9yKChlcnJvcjogRXJyb3IpID0+IHRocm93RXJyb3IoKCkgPT4gbmV3IERhZmZDb3VudHJ5Tm90Rm91bmRFcnJvcignQ291bnRyeSBjb3VsZCBub3QgYmUgZm91bmQnKSkpLFxuICAgICAgbWFwKHJlc3VsdCA9PiByZXN1bHQpLFxuICAgICk7XG4gIH1cblxuICBsaXN0KCk6IE9ic2VydmFibGU8RGFmZkNvdW50cnlbXT4ge1xuICAgIHJldHVybiB0aGlzLmh0dHAuZ2V0PERhZmZDb3VudHJ5W10+KGAke3RoaXMudXJsfS9gKTtcbiAgfVxufVxuIl19
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { InjectionToken } from '@angular/core';
|
|
2
2
|
export const DaffGeographyDriver = new InjectionToken('DaffGeographyDriver');
|
|
3
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2VvZ3JhcGh5LXNlcnZpY2UuaW50ZXJmYWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vbGlicy9nZW9ncmFwaHkvZHJpdmVyL3NyYy9pbnRlcmZhY2VzL2dlb2dyYXBoeS1zZXJ2aWNlLmludGVyZmFjZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBSy9DLE1BQU0sQ0FBQyxNQUFNLG1CQUFtQixHQUFHLElBQUksY0FBYyxDQUFnQyxxQkFBcUIsQ0FBQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgSW5qZWN0aW9uVG9rZW4gfSBmcm9tICdAYW5ndWxhci9jb3JlJztcbmltcG9ydCB7IE9ic2VydmFibGUgfSBmcm9tICdyeGpzJztcblxuaW1wb3J0IHsgRGFm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2VJbnRlcmZhY2U+KCdEYWZmR2VvZ3JhcGh5RHJpdmVyJyk7XG5cbmV4cG9ydCBpbnRlcmZhY2UgRGFmZkdlb2dyYXBoeVNlcnZpY2VJbnRlcmZhY2U8VCBleHRlbmRzIERhZmZDb3VudHJ5ID0gRGFmZkNvdW50cnk+IHtcbiAgLyoqXG4gICAqIFJldHJpZXZlcyB0aGUgbGlzdCBvZiBjb3VudHJpZXMgYXZhaWxhYmxlIHRvIHRoZSBnaXZlbiBzdG9yZS5cbiAgICovXG4gIGxpc3QoKTogT2JzZXJ2YWJsZTxUW10+O1xuXG4gIC8qKlxuICAgKiBSZXRyaWV2ZSBwcmVjaXNlIGluZm9ybWF0aW9uIGFib3V0IGEgc3BlY2lmaWMgY291bnRyeS5cbiAgICovXG4gIGdldChpZDogVFsnaWQnXSk6IE9ic2VydmFibGU8VD47XG59XG4iXX0=
|
|
@@ -2,4 +2,4 @@ export var MagentoGeographyGraphQlErrorCode;
|
|
|
2
2
|
(function (MagentoGeographyGraphQlErrorCode) {
|
|
3
3
|
MagentoGeographyGraphQlErrorCode["COUNTRY_NOT_FOUND"] = "graphql-no-such-entity";
|
|
4
4
|
})(MagentoGeographyGraphQlErrorCode || (MagentoGeographyGraphQlErrorCode = {}));
|
|
5
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29kZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL2dlb2dyYXBoeS9kcml2ZXIvbWFnZW50by9zcmMvZXJyb3JzL2NvZGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE1BQU0sQ0FBTixJQUFZLGdDQUVYO0FBRkQsV0FBWSxnQ0FBZ0M7SUFDMUMsZ0ZBQTRDLENBQUE7QUFDOUMsQ0FBQyxFQUZXLGdDQUFnQyxLQUFoQyxnQ0FBZ0MsUUFFM0MiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZW51bSBNYWdlbnRvR2VvZ3JhcGh5R3JhcGhRbEVycm9yQ29kZSB7XG4gIENPVU5UUllfTk9UX0ZPVU5EID0gJ2dyYXBocWwtbm8tc3VjaC1lbnRpdHknLFxufVxuIl19
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Injectable } from '@angular/core';
|
|
2
|
-
import { Apollo } from '
|
|
2
|
+
import { Apollo } from 'apollo-angular';
|
|
3
3
|
import { throwError, } from 'rxjs';
|
|
4
4
|
import { map, catchError, } from 'rxjs/operators';
|
|
5
5
|
import { transformMagentoGeographyError } from './errors/transform';
|
|
@@ -8,7 +8,7 @@ import { getCountries, } from './queries/public_api';
|
|
|
8
8
|
import { DaffMagentoCountryTransformer } from './transforms/responses/country.service';
|
|
9
9
|
import { validateGetCountriesResponse } from './validators/public_api';
|
|
10
10
|
import * as i0 from "@angular/core";
|
|
11
|
-
import * as i1 from "
|
|
11
|
+
import * as i1 from "apollo-angular";
|
|
12
12
|
import * as i2 from "./transforms/responses/country.service";
|
|
13
13
|
/**
|
|
14
14
|
* A service for making Magento GraphQL queries for carts.
|
|
@@ -23,7 +23,7 @@ export class DaffGeographyMagentoService {
|
|
|
23
23
|
list() {
|
|
24
24
|
return this.apollo.query({
|
|
25
25
|
query: getCountries,
|
|
26
|
-
}).pipe(map(validateGetCountriesResponse), map(result => result.data.countries.map(country => this.countryTransformer.transform(country))), catchError(err => throwError(transformMagentoGeographyError(err))));
|
|
26
|
+
}).pipe(map(validateGetCountriesResponse), map(result => result.data.countries.map(country => this.countryTransformer.transform(country))), catchError(err => throwError(() => transformMagentoGeographyError(err))));
|
|
27
27
|
}
|
|
28
28
|
get(countryId) {
|
|
29
29
|
return this.apollo.query({
|
|
@@ -31,7 +31,7 @@ export class DaffGeographyMagentoService {
|
|
|
31
31
|
variables: {
|
|
32
32
|
countryId,
|
|
33
33
|
},
|
|
34
|
-
}).pipe(map(result => this.countryTransformer.transform(result.data.country)), catchError(err => throwError(transformMagentoGeographyError(err))));
|
|
34
|
+
}).pipe(map(result => this.countryTransformer.transform(result.data.country)), catchError(err => throwError(() => transformMagentoGeographyError(err))));
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
/** @nocollapse */ /** @nocollapse */ DaffGeographyMagentoService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffGeographyMagentoService, deps: [{ token: i1.Apollo }, { token: i2.DaffMagentoCountryTransformer }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -42,4 +42,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
|
|
|
42
42
|
providedIn: 'root',
|
|
43
43
|
}]
|
|
44
44
|
}], ctorParameters: function () { return [{ type: i1.Apollo }, { type: i2.DaffMagentoCountryTransformer }]; } });
|
|
45
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
45
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2VvZ3JhcGh5LnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9saWJzL2dlb2dyYXBoeS9kcml2ZXIvbWFnZW50by9zcmMvZ2VvZ3JhcGh5LnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUMzQyxPQUFPLEVBQUUsTUFBTSxFQUFFLE1BQU0sZ0JBQWdCLENBQUM7QUFDeEMsT0FBTyxFQUVMLFVBQVUsR0FDWCxNQUFNLE1BQU0sQ0FBQztBQUNkLE9BQU8sRUFDTCxHQUFHLEVBQ0gsVUFBVSxHQUNYLE1BQU0sZ0JBQWdCLENBQUM7QUFLeEIsT0FBTyxFQUFFLDhCQ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VtdPiB7XG4gICAgcmV0dXJuIHRoaXMuYXBvbGxvLnF1ZXJ5PE1hZ2VudG9HZXRDb3VudHJpZXNSZXNwb25zZT4oe1xuICAgICAgcXVlcnk6IGdldENvdW50cmllcyxcbiAgICB9KS5waXBlKFxuICAgICAgbWFwKHZhbGlkYXRlR2V0Q291bnRyaWVzUmVzcG9uc2UpLFxuICAgICAgbWFwKHJlc3VsdCA9PiByZXN1bHQuZGF0YS5jb3VudHJpZXMubWFwKGNvdW50cnkgPT4gdGhpcy5jb3VudHJ5VHJhbnNmb3JtZXIudHJhbnNmb3JtKGNvdW50cnkpKSksXG4gICAgICBjYXRjaEVycm9yKGVyciA9PiB0aHJvd0Vycm9yKCgpID0+IHRyYW5zZm9ybU1hZ2VudG9HZW9ncmFwaHlFcnJvcihlcnIpKSksXG4gICAgKTtcbiAgfVxuXG4gIGdldChjb3VudHJ5SWQ6IERhZmZDb3VudHJ5WydpZCddKTogT2JzZXJ2YWJsZTxEYWZmQ291bnRyeT4ge1xuICAgIHJldHVybiB0aGlzLmFwb2xsby5xdWVyeTxNYWdlbnRvR2V0Q291bnRyeVJlc3BvbnNlPih7XG4gICAgICBxdWVyeTogZ2V0Q291bnRyeSxcbiAgICAgIHZhcmlhYmxlczoge1xuICAgICAgICBjb3VudHJ5SWQsXG4gICAgICB9LFxuICAgIH0pLnBpcGUoXG4gICAgICBtYXAocmVzdWx0ID0+IHRoaXMuY291bnRyeVRyYW5zZm9ybWVyLnRyYW5zZm9ybShyZXN1bHQuZGF0YS5jb3VudHJ5KSksXG4gICAgICBjYXRjaEVycm9yKGVyciA9PiB0aHJvd0Vycm9yKCgpID0+IHRyYW5zZm9ybU1hZ2VudG9HZW9ncmFwaHlFcnJvcihlcnIpKSksXG4gICAgKTtcbiAgfVxufVxuIl19
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { gql } from '
|
|
1
|
+
import { gql } from 'apollo-angular';
|
|
2
2
|
export const countryFragment = gql `
|
|
3
3
|
fragment country on Country {
|
|
4
4
|
id
|
|
@@ -8,4 +8,4 @@ export const countryFragment = gql `
|
|
|
8
8
|
two_letter_abbreviation
|
|
9
9
|
}
|
|
10
10
|
`;
|
|
11
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
11
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY291bnRyeS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvZ2VvZ3JhcGh5L2RyaXZlci9tYWdlbnRvL3NyYy9xdWVyaWVzL2ZyYWdtZW50cy9jb3VudHJ5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxHQUFHLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQztBQUdyQyxNQUFNLENBQUMsTUFBTSxlQUFlLEdBQUcsR0FBRyxDQUFBOzs7Ozs7OztDQVFqQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgZ3FsIH0gZnJvbSAnYXBvbGxvLWFuZ3VsYXInO1xuXG5cbmV4cG9ydCBjb25zdCBjb3VudHJ5RnJhZ21lbnQgPSBncWxgXG4gIGZyYWdtZW50IGNvdW50cnkgb24gQ291bnRyeSB7XG4gICAgaWRcbiAgICBmdWxsX25hbWVfZW5nbGlzaFxuICAgIGZ1bGxfbmFtZV9sb2NhbGVcbiAgICB0aHJlZV9sZXR0ZXJfYWJicmV2aWF0aW9uXG4gICAgdHdvX2xldHRlcl9hYmJyZXZpYXRpb25cbiAgfVxuYDtcbiJdfQ==
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { gql } from '
|
|
1
|
+
import { gql } from 'apollo-angular';
|
|
2
2
|
export const regionFragment = gql `
|
|
3
3
|
fragment region on Region {
|
|
4
4
|
code
|
|
@@ -6,4 +6,4 @@ export const regionFragment = gql `
|
|
|
6
6
|
name
|
|
7
7
|
}
|
|
8
8
|
`;
|
|
9
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
9
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVnaW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9nZW9ncmFwaHkvZHJpdmVyL21hZ2VudG8vc3JjL3F1ZXJpZXMvZnJhZ21lbnRzL3JlZ2lvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsR0FBRyxFQUFFLE1BQU0sZ0JBQWdCLENBQUM7QUFHckMsTUFBTSxDQUFDLE1BQU0sY0FBYyxHQUFHLEdBQUcsQ0FBQTs7Ozs7O0NBTWhDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBncWwgfSBmcm9tICdhcG9sbG8tYW5ndWxhcic7XG5cblxuZXhwb3J0IGNvbnN0IHJlZ2lvbkZyYWdtZW50ID0gZ3FsYFxuICBmcmFnbWVudCByZWdpb24gb24gUmVnaW9uIHtcbiAgICBjb2RlXG4gICAgaWRcbiAgICBuYW1lXG4gIH1cbmA7XG4iXX0=
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { gql } from '
|
|
1
|
+
import { gql } from 'apollo-angular';
|
|
2
2
|
import { countryFragment } from './fragments/public_api';
|
|
3
3
|
export const getCountries = gql `
|
|
4
4
|
query MagentoGetCountries {
|
|
@@ -8,4 +8,4 @@ export const getCountries = gql `
|
|
|
8
8
|
}
|
|
9
9
|
${countryFragment}
|
|
10
10
|
`;
|
|
11
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
11
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0LWNvdW50cmllcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvZ2VvZ3JhcGh5L2RyaXZlci9tYWdlbnRvL3NyYy9xdWVyaWVzL2dldC1jb3VudHJpZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLEdBQUcsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBRXJDLE9BQU8sRUFBRSxlQUFlLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUV6RCxNQUFNLENBQUMsTUFBTSxZQUFZLEdBQUcsR0FBRyxDQUFBOzs7Ozs7SUFNM0IsZUFBZTtDQUNsQixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgZ3FsIH0gZnJvbSAnYXBvbGxvLWFuZ3VsYXInO1xuXG5pbXBvcnQgeyBjb3VudHJ5RnJhZ21lbnQgfSBmcm9tICcuL2ZyYWdtZW50cy9wdWJsaWNfYXBpJztcblxuZXhwb3J0IGNvbnN0IGdldENvdW50cmllcyA9IGdxbGBcbiAgcXVlcnkgTWFnZW50b0dldENvdW50cmllcyB7XG4gICAgY291bnRyaWVzIHtcbiAgICAgIC4uLmNvdW50cnlcbiAgICB9XG4gIH1cbiAgJHtjb3VudHJ5RnJhZ21lbnR9XG5gO1xuIl19
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { gql } from '
|
|
1
|
+
import { gql } from 'apollo-angular';
|
|
2
2
|
import { countryFragment, regionFragment, } from './fragments/public_api';
|
|
3
3
|
export const getCountry = gql `
|
|
4
4
|
query MagentoGetCountry($countryId: String!) {
|
|
@@ -12,4 +12,4 @@ export const getCountry = gql `
|
|
|
12
12
|
${countryFragment}
|
|
13
13
|
${regionFragment}
|
|
14
14
|
`;
|
|
15
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
15
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0LWNvdW50cnkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL2dlb2dyYXBoeS9kcml2ZXIvbWFnZW50by9zcmMvcXVlcmllcy9nZXQtY291bnRyeS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsR0FBRyxFQUFFLE1BQU0sZ0JBQWdCLENBQUM7QUFFckMsT0FBTyxFQUNMLGVBQWUsRUFDZixjQUFjLEdBQ2YsTUFBTSx3QkFBd0IsQ0FBQztBQUVoQyxNQUFNLENBQUMsTUFBTSxVQUFVLEdBQUcsR0FBRyxDQUFBOzs7Ozs7Ozs7SUFTekIsZUFBZTtJQUNmLGNBQWM7Q0FDakIsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGdxbCB9IGZyb20gJ2Fwb2xsby1hbmd1bGFyJztcblxuaW1wb3J0IHtcbiAgY291bnRyeUZyYWdtZW50LFxuICByZWdpb25GcmFnbWVudCxcbn0gZnJvbSAnLi9mcmFnbWVudHMvcHVibGljX2FwaSc7XG5cbmV4cG9ydCBjb25zdCBnZXRDb3VudHJ5ID0gZ3FsYFxuICBxdWVyeSBNYWdlbnRvR2V0Q291bnRyeSgkY291bnRyeUlkOiBTdHJpbmchKSB7XG4gICAgY291bnRyeShpZDogJGNvdW50cnlJZCkge1xuICAgICAgLi4uY291bnRyeVxuICAgICAgYXZhaWxhYmxlX3JlZ2lvbnMge1xuICAgICAgICAuLi5yZWdpb25cbiAgICAgIH1cbiAgICB9XG4gIH1cbiAgJHtjb3VudHJ5RnJhZ21lbnR9XG4gICR7cmVnaW9uRnJhZ21lbnR9XG5gO1xuIl19
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export {};
|
|
2
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWRkcmVzcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYnMvZ2VvZ3JhcGh5L3NyYy9tb2RlbHMvYWRkcmVzcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgSUQgfSBmcm9tICdAZGFmZm9kaWwvY29yZSc7XG5cbi8qKlxuICogQSBiYXNpYyBtb2RlbCBvZiBhbiBhZGRyZXNzXG4gKi9cbmV4cG9ydCBpbnRlcmZhY2UgRGFmZkFkZHJlc3Mge1xuICBzdHJlZXQ6IHN0cmluZztcbiAgc3RyZWV0Mj86IHN0cmluZztcbiAgY2l0eTogc3RyaW5nO1xuICByZWdpb246IElEO1xuICAvKipcbiAgICogVXNlIERhZmZBZGRyZXNzI3JlZ2lvbiBpbnN0ZWFkLlxuICAgKlxuICAgKiBAZGVwcmVjYXRlZFxuICAgKi9cbiAgcmVnaW9uX2lkPzogSUQ7XG4gIGNvdW50cnk/OiBJRDtcbiAgY291bnRyeV9pZD86IElEO1xuICBwb3N0Y29kZTogc3RyaW5nO1xufVxuIl19
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export {};
|
|
2
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY291bnRyeS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYnMvZ2VvZ3JhcGh5L3NyYy9tb2RlbHMvY291bnRyeS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgRGFmZklkZW50aWZpYWJsZSB9IGZyb20gJ0BkYWZmb2RpbC9jb3JlJztcblxuaW1wb3J0IHsgRGFmZlN1YmRpdmlzaW9uIH0gZnJvbSAnLi9zdWJkaXZpc2lvbic7XG5cbi8qKlxuICogQSByZXByZXNlbnRhdGlvbiBvZiBhIGNvdW50cnkgb24gdGhlIHBsYW5ldCBFYXJ0aC5cbiAqIFNlZTogSVNPLTMxNjZcbiAqL1xuZXhwb3J0IGludGVyZmFjZSBEYWZmQ291bnRyeSBleHRlbmRzIERhZmZJZGVudGlmaWFibGUge1xuICBuYW1lOiBzdHJpbmc7XG4gIG5hbWVfZW46IHN0cmluZztcbiAgYWxwaGEyOiBzdHJpbmc7XG4gIGFscGhhMzogc3RyaW5nO1xuICBzdWJkaXZpc2lvbnM6IERhZmZTdWJkaXZpc2lvbltdO1xuICAvKipcbiAgICogV2hldGhlciBvciBub3QgdGhlIGNvdW50cnkgaGFzIGJlZW4gZnVsbHkgbG9hZGVkLlxuICAgKiBJZiB0cnVlLCB0aGUgc3ViZGl2aXNpb25zIGZpZWxkIHdpbGwgYmUgcG9wdWxhdGVkIGlmIGFueSBleGlzdC5cbiAgICovXG4gIGxvYWRlZD86IGJvb2xlYW47XG59XG4iXX0=
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export {};
|
|
2
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGVyc29uYWwtYWRkcmVzcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYnMvZ2VvZ3JhcGh5L3NyYy9tb2RlbHMvcGVyc29uYWwtYWRkcmVzcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgRGFmZkFkZHJlc3MgfSBmcm9tICcuL2FkZHJlc3MnO1xuXG4vKipcbiAqIEEgc3BlY2lhbGl6ZWQgdHlwZSBvZiBhZGRyZXNzIHVzZWZ1bCBmb3IgYXNzb2NpYXRpbmcgYSBwaHlzaWNhbCBhZGRyZXNzXG4gKiB3aXRoIGEgcGFydGljdWxhciBpbmRpdmlkdWFsLlxuICovXG5leHBvcnQgaW50ZXJmYWNlIERhZmZQZXJzb25hbEFkZHJlc3MgZXh0ZW5kcyBEYWZmQWRkcmVzcyB7XG4gIHByZWZpeD86IHN0cmluZztcbiAgc3VmZml4Pzogc3RyaW5nO1xuICBmaXJzdG5hbWU6IHN0cmluZztcbiAgbWlkZGxlbmFtZT86IHN0cmluZztcbiAgbGFzdG5hbWU6IHN0cmluZztcbiAgdGVsZXBob25lOiBzdHJpbmc7XG4gIGVtYWlsPzogc3RyaW5nO1xufVxuIl19
|
|
@@ -25,4 +25,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
|
|
|
25
25
|
providedIn: 'root',
|
|
26
26
|
}]
|
|
27
27
|
}], ctorParameters: function () { return []; } });
|
|
28
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
28
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY291bnRyeS5mYWN0b3J5LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vbGlicy9nZW9ncmFwaHkvdGVzdGluZy9zcmMvZmFjdG9yaWVzL2NvdW50cnkuZmFjdG9yeS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQzNDLE9BQU8sS0FBSyxLQUFLLE1BQU0sOEJBQThCLENBQUM7QUFFdEQsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sd0JBQXdCLENBQUM7O0FBRzFELE1BQU0sT0FBTyxXQUFXO0lBQXhCO1FBQ0UsT0FBRSxHQUFHLEtBQUssQ0FBQyxRQUFRLENBQUMsSUFBSSxFQUFFLENBQUM7UUFDM0IsU0FBSSxHQUFHLEtBQUssQ0FBQyxNQUFNLENBQUMsSUFBSSxFQUFFLENBQUM7UUFDM0IsWUFBTyxHQUFHLEtBQUssQ0F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gIGFscGhhMyA9IGZha2VyLnJhbmRvbS5hbHBoYU51bWVyaWMoMyk7XG4gIHN1YmRpdmlzaW9ucyA9IFtdO1xufVxuXG5ASW5qZWN0YWJsZSh7XG4gIHByb3ZpZGVkSW46ICdyb290Jyxcbn0pXG5leHBvcnQgY2xhc3MgRGFmZkNvdW50cnlGYWN0b3J5IGV4dGVuZHMgRGFmZk1vZGVsRmFjdG9yeTxEYWZmQ291bnRyeT4ge1xuICBjb25zdHJ1Y3RvcigpIHtcbiAgICBzdXBlcihNb2NrQ291bnRyeSk7XG4gIH1cbn1cbiJdfQ==
|
|
@@ -22,4 +22,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
|
|
|
22
22
|
providedIn: 'root',
|
|
23
23
|
}]
|
|
24
24
|
}], ctorParameters: function () { return []; } });
|
|
25
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
25
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3ViZGl2aXNpb24uZmFjdG9yeS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL2xpYnMvZ2VvZ3JhcGh5L3Rlc3Rpbmcvc3JjL2ZhY3Rvcmllcy9zdWJkaXZpc2lvbi5mYWN0b3J5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDM0MsT0FBTyxLQUFLLEtBQUssTUFBTSw4QkFBOEIsQ0FBQztBQUV0RCxPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQzs7QUFHMUQsTUFBTSxPQUFPLGVBQWU7SUFBNUI7UUFDRSxPQUFFLEdBQUcsS0FBSyxDQUFDLFFBQVEsQ0FBQyxJQUFJLEVBQUUsQ0FBQztRQUMzQixTQUFJLEdBQUcsS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Nb2RlbEZhY3Rvcnk8RGFmZlN1YmRpdmlzaW9uPiB7XG4gIGNvbnN0cnVjdG9yKCkge1xuICAgIHN1cGVyKE1vY2tTdWJkaXZpc2lvbik7XG4gIH1cbn1cbiJdfQ==
|
|
@@ -17,7 +17,7 @@ class DaffInMemoryGeographyService {
|
|
|
17
17
|
this.url = '/api/countries';
|
|
18
18
|
}
|
|
19
19
|
get(countryId) {
|
|
20
|
-
return this.http.get(`${this.url}/${countryId}`).pipe(catchError((error) => throwError(DaffCountryNotFoundError)), map(result => result));
|
|
20
|
+
return this.http.get(`${this.url}/${countryId}`).pipe(catchError((error) => throwError(() => new DaffCountryNotFoundError('Country could not be found'))), map(result => result));
|
|
21
21
|
}
|
|
22
22
|
list() {
|
|
23
23
|
return this.http.get(`${this.url}/`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-geography-driver-in-memory.mjs","sources":["../../../libs/geography/driver/in-memory/src/drivers/geography.service.ts","../../../libs/geography/driver/in-memory/src/drivers/geography-driver.module.ts","../../../libs/geography/driver/in-memory/src/backend/geography.service.ts","../../../libs/geography/driver/in-memory/src/daffodil-geography-driver-in-memory.ts"],"sourcesContent":["import { HttpClient } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport {\n Observable,\n throwError,\n} from 'rxjs';\nimport {\n catchError,\n map,\n} from 'rxjs/operators';\n\nimport { DaffCountry } from '@daffodil/geography';\nimport {\n DaffGeographyServiceInterface,\n DaffCountryNotFoundError,\n} from '@daffodil/geography/driver';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryGeographyService implements DaffGeographyServiceInterface<DaffCountry> {\n url = '/api/countries';\n\n constructor(private http: HttpClient) {}\n\n get(countryId: DaffCountry['id']): Observable<DaffCountry> {\n return this.http.get<DaffCountry>(`${this.url}/${countryId}`).pipe(\n catchError((error: Error) => throwError(DaffCountryNotFoundError)),\n map(result => result),\n );\n }\n\n list(): Observable<DaffCountry[]> {\n return this.http.get<DaffCountry[]>(`${this.url}/`);\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { DaffGeographyDriver } from '@daffodil/geography/driver';\n\nimport { DaffInMemoryGeographyService } from './geography.service';\n\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffGeographyInMemoryDriverModule {\n static forRoot(): ModuleWithProviders<DaffGeographyInMemoryDriverModule> {\n return {\n ngModule: DaffGeographyInMemoryDriverModule,\n providers: [\n {\n provide: DaffGeographyDriver,\n useExisting: DaffInMemoryGeographyService,\n },\n ],\n };\n }\n}\n","import { Injectable } from '@angular/core';\nimport {\n InMemoryDbService,\n RequestInfo,\n STATUS,\n} from 'angular-in-memory-web-api';\n\nimport { DaffInMemoryDataServiceInterface } from '@daffodil/core/testing';\nimport { DaffCountry } from '@daffodil/geography';\nimport {\n DaffCountryFactory,\n DaffSubdivisionFactory,\n} from '@daffodil/geography/testing';\n\n/**\n * An in-memory service that stubs out the backend services for getting countries.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryBackendGeographyService implements InMemoryDbService, DaffInMemoryDataServiceInterface {\n countries: DaffCountry[];\n\n constructor(\n private countryFactory: DaffCountryFactory,\n private subdivisionFactory: DaffSubdivisionFactory,\n ) {\n this.countries = this.countryFactory.createMany(5);\n this.countries.forEach(country => country.subdivisions = this.subdivisionFactory.createMany(5));\n }\n\n /**\n * Creates a fake database of countries for the geography inmemory backend service.\n *\n * @docs-private\n * @returns A fake database of an array of countries\n */\n createDb(reqInfo: RequestInfo): any {\n if (reqInfo) {\n const seedData = reqInfo.utils.getJsonBody(reqInfo.req).countries;\n if (seedData) {\n this.countries = seedData;\n }\n }\n\n return {\n countries: this.countries,\n };\n }\n\n /**\n * Responds to GET requests.\n */\n get(reqInfo: RequestInfo): any {\n return reqInfo.utils.createResponse$(() => ({\n body: reqInfo.id ? this.getCountry(reqInfo) : this.listCountries(reqInfo),\n status: STATUS.OK,\n }));\n }\n\n private getCountry(reqInfo: RequestInfo) {\n return reqInfo.collection.find(country => country.id === reqInfo.id);\n }\n\n private listCountries(reqInfo: RequestInfo) {\n return reqInfo.collection;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;AAiBA;;AAEG;MAIU,4BAA4B,CAAA;AAGvC,IAAA,WAAA,CAAoB,IAAgB,EAAA;AAAhB,QAAA,IAAI,CAAA,IAAA,GAAJ,IAAI,CAAY;AAFpC,QAAA,IAAG,CAAA,GAAA,GAAG,gBAAgB,CAAC;KAEiB;AAExC,IAAA,GAAG,CAAC,SAA4B,EAAA;
|
|
1
|
+
{"version":3,"file":"daffodil-geography-driver-in-memory.mjs","sources":["../../../libs/geography/driver/in-memory/src/drivers/geography.service.ts","../../../libs/geography/driver/in-memory/src/drivers/geography-driver.module.ts","../../../libs/geography/driver/in-memory/src/backend/geography.service.ts","../../../libs/geography/driver/in-memory/src/daffodil-geography-driver-in-memory.ts"],"sourcesContent":["import { HttpClient } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport {\n Observable,\n throwError,\n} from 'rxjs';\nimport {\n catchError,\n map,\n} from 'rxjs/operators';\n\nimport { DaffCountry } from '@daffodil/geography';\nimport {\n DaffGeographyServiceInterface,\n DaffCountryNotFoundError,\n} from '@daffodil/geography/driver';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryGeographyService implements DaffGeographyServiceInterface<DaffCountry> {\n url = '/api/countries';\n\n constructor(private http: HttpClient) {}\n\n get(countryId: DaffCountry['id']): Observable<DaffCountry> {\n return this.http.get<DaffCountry>(`${this.url}/${countryId}`).pipe(\n catchError((error: Error) => throwError(() => new DaffCountryNotFoundError('Country could not be found'))),\n map(result => result),\n );\n }\n\n list(): Observable<DaffCountry[]> {\n return this.http.get<DaffCountry[]>(`${this.url}/`);\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { DaffGeographyDriver } from '@daffodil/geography/driver';\n\nimport { DaffInMemoryGeographyService } from './geography.service';\n\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffGeographyInMemoryDriverModule {\n static forRoot(): ModuleWithProviders<DaffGeographyInMemoryDriverModule> {\n return {\n ngModule: DaffGeographyInMemoryDriverModule,\n providers: [\n {\n provide: DaffGeographyDriver,\n useExisting: DaffInMemoryGeographyService,\n },\n ],\n };\n }\n}\n","import { Injectable } from '@angular/core';\nimport {\n InMemoryDbService,\n RequestInfo,\n STATUS,\n} from 'angular-in-memory-web-api';\n\nimport { DaffInMemoryDataServiceInterface } from '@daffodil/core/testing';\nimport { DaffCountry } from '@daffodil/geography';\nimport {\n DaffCountryFactory,\n DaffSubdivisionFactory,\n} from '@daffodil/geography/testing';\n\n/**\n * An in-memory service that stubs out the backend services for getting countries.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryBackendGeographyService implements InMemoryDbService, DaffInMemoryDataServiceInterface {\n countries: DaffCountry[];\n\n constructor(\n private countryFactory: DaffCountryFactory,\n private subdivisionFactory: DaffSubdivisionFactory,\n ) {\n this.countries = this.countryFactory.createMany(5);\n this.countries.forEach(country => country.subdivisions = this.subdivisionFactory.createMany(5));\n }\n\n /**\n * Creates a fake database of countries for the geography inmemory backend service.\n *\n * @docs-private\n * @returns A fake database of an array of countries\n */\n createDb(reqInfo: RequestInfo): any {\n if (reqInfo) {\n const seedData = reqInfo.utils.getJsonBody(reqInfo.req).countries;\n if (seedData) {\n this.countries = seedData;\n }\n }\n\n return {\n countries: this.countries,\n };\n }\n\n /**\n * Responds to GET requests.\n */\n get(reqInfo: RequestInfo): any {\n return reqInfo.utils.createResponse$(() => ({\n body: reqInfo.id ? this.getCountry(reqInfo) : this.listCountries(reqInfo),\n status: STATUS.OK,\n }));\n }\n\n private getCountry(reqInfo: RequestInfo) {\n return reqInfo.collection.find(country => country.id === reqInfo.id);\n }\n\n private listCountries(reqInfo: RequestInfo) {\n return reqInfo.collection;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;AAiBA;;AAEG;MAIU,4BAA4B,CAAA;AAGvC,IAAA,WAAA,CAAoB,IAAgB,EAAA;AAAhB,QAAA,IAAI,CAAA,IAAA,GAAJ,IAAI,CAAY;AAFpC,QAAA,IAAG,CAAA,GAAA,GAAG,gBAAgB,CAAC;KAEiB;AAExC,IAAA,GAAG,CAAC,SAA4B,EAAA;QAC9B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAc,CAAA,EAAG,IAAI,CAAC,GAAG,IAAI,SAAS,CAAA,CAAE,CAAC,CAAC,IAAI,CAChE,UAAU,CAAC,CAAC,KAAY,KAAK,UAAU,CAAC,MAAM,IAAI,wBAAwB,CAAC,4BAA4B,CAAC,CAAC,CAAC,EAC1G,GAAG,CAAC,MAAM,IAAI,MAAM,CAAC,CACtB,CAAC;KACH;IAED,IAAI,GAAA;AACF,QAAA,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAgB,CAAG,EAAA,IAAI,CAAC,GAAG,CAAG,CAAA,CAAA,CAAC,CAAC;KACrD;;+JAdU,4BAA4B,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,UAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA5B,sCAAA,4BAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,4BAA4B,cAF3B,MAAM,EAAA,CAAA,CAAA;2FAEP,4BAA4B,EAAA,UAAA,EAAA,CAAA;kBAHx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A,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAnC,sCAAA,mCAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mCAAmC,cAFlC,MAAM,EAAA,CAAA,CAAA;2FAEP,mCAAmC,EAAA,UAAA,EAAA,CAAA;kBAH/C,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;iBACnB,CAAA;;;ACrBD;;AAEG;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Injectable, NgModule } from '@angular/core';
|
|
3
|
-
import * as i1 from '
|
|
4
|
-
import { gql } from '
|
|
3
|
+
import * as i1 from 'apollo-angular';
|
|
4
|
+
import { gql } from 'apollo-angular';
|
|
5
5
|
import { throwError } from 'rxjs';
|
|
6
6
|
import { map, catchError } from 'rxjs/operators';
|
|
7
7
|
import { daffTransformMagentoError } from '@daffodil/driver/magento';
|
|
@@ -129,7 +129,7 @@ class DaffGeographyMagentoService {
|
|
|
129
129
|
list() {
|
|
130
130
|
return this.apollo.query({
|
|
131
131
|
query: getCountries,
|
|
132
|
-
}).pipe(map(validateGetCountriesResponse), map(result => result.data.countries.map(country => this.countryTransformer.transform(country))), catchError(err => throwError(transformMagentoGeographyError(err))));
|
|
132
|
+
}).pipe(map(validateGetCountriesResponse), map(result => result.data.countries.map(country => this.countryTransformer.transform(country))), catchError(err => throwError(() => transformMagentoGeographyError(err))));
|
|
133
133
|
}
|
|
134
134
|
get(countryId) {
|
|
135
135
|
return this.apollo.query({
|
|
@@ -137,7 +137,7 @@ class DaffGeographyMagentoService {
|
|
|
137
137
|
variables: {
|
|
138
138
|
countryId,
|
|
139
139
|
},
|
|
140
|
-
}).pipe(map(result => this.countryTransformer.transform(result.data.country)), catchError(err => throwError(transformMagentoGeographyError(err))));
|
|
140
|
+
}).pipe(map(result => this.countryTransformer.transform(result.data.country)), catchError(err => throwError(() => transformMagentoGeographyError(err))));
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
/** @nocollapse */ /** @nocollapse */ DaffGeographyMagentoService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffGeographyMagentoService, deps: [{ token: i1.Apollo }, { token: DaffMagentoCountryTransformer }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -1 +1 @@
|
|
|
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 { MagentoCountry } from '../../models/responses/country';\nimport { DaffMagentoSubdivisionTransformer } from './subdivision.service';\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 '@damienwebdev/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 '@damienwebdev/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 '@damienwebdev/apollo-angular';\n\nimport { countryFragment } from './fragments/public_api';\n\nexport const getCountries = gql`\n query MagentoGetCountries {\n countries {\n ...country\n }\n }\n ${countryFragment}\n`;\n","import { gql } from '@damienwebdev/apollo-angular';\n\nimport {\n countryFragment,\n regionFragment,\n} from './fragments/public_api';\n\nexport const getCountry = gql`\n query MagentoGetCountry($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\tCOUNTRY_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 { ApolloQueryResult } from '@apollo/client/core';\n\nimport { DaffGeographyInvalidAPIResponseError } from '@daffodil/geography/driver';\n\nimport { MagentoGetCountriesResponse } from '../queries/public_api';\n\nexport const validateGetCountriesResponse = (response: ApolloQueryResult<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 '@damienwebdev/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 { DaffGeographyDriver } from '@daffodil/geography/driver';\n\nimport { DaffGeographyMagentoService } from './geography.service';\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 {\n provide: DaffGeographyDriver,\n useExisting: DaffGeographyMagentoService,\n },\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,iCAAiC,CAAA;AAC5C;;AAEG;AACH,IAAA,SAAS,CAAC,MAAqB,EAAA;AAC7B,QAAA,OAAO,MAAM,GAAE,MAAA,CAAA,MAAA,CACV,EAAE,cAAc,EAAE,MAAM,EAAE,IAE7B,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,EACrB,IAAI,EAAE,MAAM,CAAC,IAAI,EACjB,UAAU,EAAE,MAAM,CAAC,IAAI,EAAA,CAAA,GACrB,IAAI,CAAC;KACV;;oKAZU,iCAAiC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAjC,sCAAA,iCAAA,CAAA,KAAA,GAAA,EAA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ento/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 { MagentoCountry } from '../../models/responses/country';\nimport { DaffMagentoSubdivisionTransformer } from './subdivision.service';\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 getCountries = gql`\n query MagentoGetCountries {\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 getCountry = gql`\n query MagentoGetCountry($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 { ApolloQueryResult } from '@apollo/client/core';\n\nimport { DaffGeographyInvalidAPIResponseError } from '@daffodil/geography/driver';\n\nimport { MagentoGetCountriesResponse } from '../queries/public_api';\n\nexport const validateGetCountriesResponse = (response: ApolloQueryResult<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 { DaffGeographyDriver } from '@daffodil/geography/driver';\n\nimport { DaffGeographyMagentoService } from './geography.service';\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 {\n provide: DaffGeographyDriver,\n useExisting: DaffGeographyMagentoService,\n },\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,iCAAiC,CAAA;AAC5C;;AAEG;AACH,IAAA,SAAS,CAAC,MAAqB,EAAA;AAC7B,QAAA,OAAO,MAAM,GAAE,MAAA,CAAA,MAAA,CACV,EAAE,cAAc,EAAE,MAAM,EAAE,IAE7B,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,EACrB,IAAI,EAAE,MAAM,CAAC,IAAI,EACjB,UAAU,EAAE,MAAM,CAAC,IAAI,EAAA,CAAA,GACrB,IAAI,CAAC;KACV;;oKAZU,iCAAiC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAjC,sCAAA,iCAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iCAAiC,cAFhC,MAAM,EAAA,CAAA,CAAA;2FAEP,iCAAiC,EAAA,UAAA,EAAA,CAAA;kBAH7C,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;iBACnB,CAAA;;;ACJD;;AAEG;MAIU,6BAA6B,CAAA;AACxC,IAAA,WAAA,CAAmB,sBAAyD,EAAA;AAAzD,QAAA,IAAsB,CAAA,sBAAA,GAAtB,sBAAsB,CAAmC;KAAI;AAExE,IAAA,qBAAqB,CAAC,OAA4C,EAAA;AACxE,QAAA,OAAO,OAAO,CAAC,GAAG,CAA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IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAhC,sCAAA,gCAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gCAAgC,YAHzC,YAAY,CAAA,EAAA,CAAA,CAAA;AAGH,sCAAA,gCAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gCAAgC,EAJlC,OAAA,EAAA,CAAA;YACP,YAAY;SACb,CAAA,EAAA,CAAA,CAAA;2FAEU,gCAAgC,EAAA,UAAA,EAAA,CAAA;kBAL5C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;iBACF,CAAA;;;ACdD;;AAEG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-geography-driver.mjs","sources":["../../../libs/geography/driver/src/errors/country-not-found.ts","../../../libs/geography/driver/src/errors/invalid-api-response.ts","../../../libs/geography/driver/src/interfaces/geography-service.interface.ts","../../../libs/geography/driver/src/daffodil-geography-driver.ts"],"sourcesContent":["import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nexport class DaffCountryNotFoundError extends DaffInheritableError implements DaffError {\n public readonly code: string = 'DAFF_GEOGRAPHY_COUNTRY_NOT_FOUND';\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nexport class DaffGeographyInvalidAPIResponseError extends DaffInheritableError implements DaffError {\n public readonly code: string = 'DAFF_GEOGRAPHY_INVALID_API_RESPONSE';\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { DaffCountry } from '@daffodil/geography';\n\nexport const DaffGeographyDriver = new InjectionToken<DaffGeographyServiceInterface>('DaffGeographyDriver');\n\nexport interface DaffGeographyServiceInterface<T extends DaffCountry = DaffCountry> {\n
|
|
1
|
+
{"version":3,"file":"daffodil-geography-driver.mjs","sources":["../../../libs/geography/driver/src/errors/country-not-found.ts","../../../libs/geography/driver/src/errors/invalid-api-response.ts","../../../libs/geography/driver/src/interfaces/geography-service.interface.ts","../../../libs/geography/driver/src/daffodil-geography-driver.ts"],"sourcesContent":["import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nexport class DaffCountryNotFoundError extends DaffInheritableError implements DaffError {\n public readonly code: string = 'DAFF_GEOGRAPHY_COUNTRY_NOT_FOUND';\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nexport class DaffGeographyInvalidAPIResponseError extends DaffInheritableError implements DaffError {\n public readonly code: string = 'DAFF_GEOGRAPHY_INVALID_API_RESPONSE';\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { DaffCountry } from '@daffodil/geography';\n\nexport const DaffGeographyDriver = new InjectionToken<DaffGeographyServiceInterface>('DaffGeographyDriver');\n\nexport interface DaffGeographyServiceInterface<T extends DaffCountry = DaffCountry> {\n /**\n * Retrieves the list of countries available to the given store.\n */\n list(): Observable<T[]>;\n\n /**\n * Retrieve precise information about a specific country.\n */\n get(id: T['id']): Observable<T>;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAKM,MAAO,wBAAyB,SAAQ,oBAAoB,CAAA;AAGhE,IAAA,WAAA,CAAmB,OAAe,EAAA;QAChC,KAAK,CAAC,OAAO,CAAC,CAAC;AADE,QAAA,IAAO,CAAA,OAAA,GAAP,OAAO,CAAQ;AAFlB,QAAA,IAAI,CAAA,IAAA,GAAW,kCAAkC,CAAC;KAIjE;AACF;;ACNK,MAAO,oCAAqC,SAAQ,oBAAoB,CAAA;AAG5E,IAAA,WAAA,CAAmB,OAAe,EAAA;QAChC,KAAK,CAAC,OAAO,CAAC,CAAC;AADE,QAAA,IAAO,CAAA,OAAA,GAAP,OAAO,CAAQ;AAFlB,QAAA,IAAI,CAAA,IAAA,GAAW,qCAAqC,CAAC;KAIpE;AACF;;MCNY,mBAAmB,GAAG,IAAI,cAAc,CAAgC,qBAAqB;;ACL1G;;AAEG;;;;"}
|
|
@@ -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/country.factory.ts","../../../libs/geography/testing/src/factories/subdivision.factory.ts","../../../libs/geography/testing/src/daffodil-geography-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport * as 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.address.streetName();\n street2 = faker.address.secondaryAddress();\n city = faker.address.city();\n region = faker.address.stateAbbr();\n postcode = faker.address.zipCode();\n country = faker.address.zipCode();\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 * as 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.name.prefix();\n suffix = faker.name.suffix();\n firstname = faker.name.firstName();\n middlename = faker.name.firstName();\n lastname = faker.name.lastName();\n email = faker.internet.email();\n telephone = faker.phone.phoneNumber();\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 * as faker from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffCountry } from '@daffodil/geography';\n\nexport class MockCountry implements DaffCountry {\n id = faker.datatype.uuid();\n name = faker.random.word();\n
|
|
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/country.factory.ts","../../../libs/geography/testing/src/factories/subdivision.factory.ts","../../../libs/geography/testing/src/daffodil-geography-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport * as 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.address.streetName();\n street2 = faker.address.secondaryAddress();\n city = faker.address.city();\n region = faker.address.stateAbbr();\n postcode = faker.address.zipCode();\n country = faker.address.zipCode();\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 * as 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.name.prefix();\n suffix = faker.name.suffix();\n firstname = faker.name.firstName();\n middlename = faker.name.firstName();\n lastname = faker.name.lastName();\n email = faker.internet.email();\n telephone = faker.phone.phoneNumber();\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 * as faker from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffCountry } from '@daffodil/geography';\n\nexport class MockCountry implements DaffCountry {\n id = faker.datatype.uuid();\n name = faker.random.word();\n name_en = faker.random.word();\n alpha2 = faker.random.alphaNumeric(2);\n alpha3 = faker.random.alphaNumeric(3);\n subdivisions = [];\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCountryFactory extends DaffModelFactory<DaffCountry> {\n constructor() {\n super(MockCountry);\n }\n}\n","import { Injectable } from '@angular/core';\nimport * as 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.datatype.uuid();\n name = faker.random.word();\n iso_3166_2 = faker.random.alphaNumeric(2);\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffSubdivisionFactory extends DaffModelFactory<DaffSubdivision> {\n constructor() {\n super(MockSubdivision);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAOa,eAAe,CAAA;AAA5B,IAAA,WAAA,GAAA;QACE,IAAA,CAAA,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;QACpC,IAAA,CAAA,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC;QAC3C,IAAA,CAAA,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QAC5B,IAAA,CAAA,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;QACnC,I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AAA;;;ACdD;;AAEG;;;;"}
|
|
@@ -17,7 +17,7 @@ class DaffInMemoryGeographyService {
|
|
|
17
17
|
this.url = '/api/countries';
|
|
18
18
|
}
|
|
19
19
|
get(countryId) {
|
|
20
|
-
return this.http.get(`${this.url}/${countryId}`).pipe(catchError((error) => throwError(DaffCountryNotFoundError)), map(result => result));
|
|
20
|
+
return this.http.get(`${this.url}/${countryId}`).pipe(catchError((error) => throwError(() => new DaffCountryNotFoundError('Country could not be found'))), map(result => result));
|
|
21
21
|
}
|
|
22
22
|
list() {
|
|
23
23
|
return this.http.get(`${this.url}/`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-geography-driver-in-memory.mjs","sources":["../../../libs/geography/driver/in-memory/src/drivers/geography.service.ts","../../../libs/geography/driver/in-memory/src/drivers/geography-driver.module.ts","../../../libs/geography/driver/in-memory/src/backend/geography.service.ts","../../../libs/geography/driver/in-memory/src/daffodil-geography-driver-in-memory.ts"],"sourcesContent":["import { HttpClient } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport {\n Observable,\n throwError,\n} from 'rxjs';\nimport {\n catchError,\n map,\n} from 'rxjs/operators';\n\nimport { DaffCountry } from '@daffodil/geography';\nimport {\n DaffGeographyServiceInterface,\n DaffCountryNotFoundError,\n} from '@daffodil/geography/driver';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryGeographyService implements DaffGeographyServiceInterface<DaffCountry> {\n url = '/api/countries';\n\n constructor(private http: HttpClient) {}\n\n get(countryId: DaffCountry['id']): Observable<DaffCountry> {\n return this.http.get<DaffCountry>(`${this.url}/${countryId}`).pipe(\n catchError((error: Error) => throwError(DaffCountryNotFoundError)),\n map(result => result),\n );\n }\n\n list(): Observable<DaffCountry[]> {\n return this.http.get<DaffCountry[]>(`${this.url}/`);\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { DaffGeographyDriver } from '@daffodil/geography/driver';\n\nimport { DaffInMemoryGeographyService } from './geography.service';\n\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffGeographyInMemoryDriverModule {\n static forRoot(): ModuleWithProviders<DaffGeographyInMemoryDriverModule> {\n return {\n ngModule: DaffGeographyInMemoryDriverModule,\n providers: [\n {\n provide: DaffGeographyDriver,\n useExisting: DaffInMemoryGeographyService,\n },\n ],\n };\n }\n}\n","import { Injectable } from '@angular/core';\nimport {\n InMemoryDbService,\n RequestInfo,\n STATUS,\n} from 'angular-in-memory-web-api';\n\nimport { DaffInMemoryDataServiceInterface } from '@daffodil/core/testing';\nimport { DaffCountry } from '@daffodil/geography';\nimport {\n DaffCountryFactory,\n DaffSubdivisionFactory,\n} from '@daffodil/geography/testing';\n\n/**\n * An in-memory service that stubs out the backend services for getting countries.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryBackendGeographyService implements InMemoryDbService, DaffInMemoryDataServiceInterface {\n countries: DaffCountry[];\n\n constructor(\n private countryFactory: DaffCountryFactory,\n private subdivisionFactory: DaffSubdivisionFactory,\n ) {\n this.countries = this.countryFactory.createMany(5);\n this.countries.forEach(country => country.subdivisions = this.subdivisionFactory.createMany(5));\n }\n\n /**\n * Creates a fake database of countries for the geography inmemory backend service.\n *\n * @docs-private\n * @returns A fake database of an array of countries\n */\n createDb(reqInfo: RequestInfo): any {\n if (reqInfo) {\n const seedData = reqInfo.utils.getJsonBody(reqInfo.req).countries;\n if (seedData) {\n this.countries = seedData;\n }\n }\n\n return {\n countries: this.countries,\n };\n }\n\n /**\n * Responds to GET requests.\n */\n get(reqInfo: RequestInfo): any {\n return reqInfo.utils.createResponse$(() => ({\n body: reqInfo.id ? this.getCountry(reqInfo) : this.listCountries(reqInfo),\n status: STATUS.OK,\n }));\n }\n\n private getCountry(reqInfo: RequestInfo) {\n return reqInfo.collection.find(country => country.id === reqInfo.id);\n }\n\n private listCountries(reqInfo: RequestInfo) {\n return reqInfo.collection;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;AAiBA;;AAEG;MAIU,4BAA4B,CAAA;AAGvC,IAAA,WAAA,CAAoB,IAAgB,EAAA;QAAhB,IAAI,CAAA,IAAA,GAAJ,IAAI,CAAY;QAFpC,IAAG,CAAA,GAAA,GAAG,gBAAgB,CAAC;KAEiB;AAExC,IAAA,GAAG,CAAC,SAA4B,EAAA;
|
|
1
|
+
{"version":3,"file":"daffodil-geography-driver-in-memory.mjs","sources":["../../../libs/geography/driver/in-memory/src/drivers/geography.service.ts","../../../libs/geography/driver/in-memory/src/drivers/geography-driver.module.ts","../../../libs/geography/driver/in-memory/src/backend/geography.service.ts","../../../libs/geography/driver/in-memory/src/daffodil-geography-driver-in-memory.ts"],"sourcesContent":["import { HttpClient } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport {\n Observable,\n throwError,\n} from 'rxjs';\nimport {\n catchError,\n map,\n} from 'rxjs/operators';\n\nimport { DaffCountry } from '@daffodil/geography';\nimport {\n DaffGeographyServiceInterface,\n DaffCountryNotFoundError,\n} from '@daffodil/geography/driver';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryGeographyService implements DaffGeographyServiceInterface<DaffCountry> {\n url = '/api/countries';\n\n constructor(private http: HttpClient) {}\n\n get(countryId: DaffCountry['id']): Observable<DaffCountry> {\n return this.http.get<DaffCountry>(`${this.url}/${countryId}`).pipe(\n catchError((error: Error) => throwError(() => new DaffCountryNotFoundError('Country could not be found'))),\n map(result => result),\n );\n }\n\n list(): Observable<DaffCountry[]> {\n return this.http.get<DaffCountry[]>(`${this.url}/`);\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { DaffGeographyDriver } from '@daffodil/geography/driver';\n\nimport { DaffInMemoryGeographyService } from './geography.service';\n\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffGeographyInMemoryDriverModule {\n static forRoot(): ModuleWithProviders<DaffGeographyInMemoryDriverModule> {\n return {\n ngModule: DaffGeographyInMemoryDriverModule,\n providers: [\n {\n provide: DaffGeographyDriver,\n useExisting: DaffInMemoryGeographyService,\n },\n ],\n };\n }\n}\n","import { Injectable } from '@angular/core';\nimport {\n InMemoryDbService,\n RequestInfo,\n STATUS,\n} from 'angular-in-memory-web-api';\n\nimport { DaffInMemoryDataServiceInterface } from '@daffodil/core/testing';\nimport { DaffCountry } from '@daffodil/geography';\nimport {\n DaffCountryFactory,\n DaffSubdivisionFactory,\n} from '@daffodil/geography/testing';\n\n/**\n * An in-memory service that stubs out the backend services for getting countries.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryBackendGeographyService implements InMemoryDbService, DaffInMemoryDataServiceInterface {\n countries: DaffCountry[];\n\n constructor(\n private countryFactory: DaffCountryFactory,\n private subdivisionFactory: DaffSubdivisionFactory,\n ) {\n this.countries = this.countryFactory.createMany(5);\n this.countries.forEach(country => country.subdivisions = this.subdivisionFactory.createMany(5));\n }\n\n /**\n * Creates a fake database of countries for the geography inmemory backend service.\n *\n * @docs-private\n * @returns A fake database of an array of countries\n */\n createDb(reqInfo: RequestInfo): any {\n if (reqInfo) {\n const seedData = reqInfo.utils.getJsonBody(reqInfo.req).countries;\n if (seedData) {\n this.countries = seedData;\n }\n }\n\n return {\n countries: this.countries,\n };\n }\n\n /**\n * Responds to GET requests.\n */\n get(reqInfo: RequestInfo): any {\n return reqInfo.utils.createResponse$(() => ({\n body: reqInfo.id ? this.getCountry(reqInfo) : this.listCountries(reqInfo),\n status: STATUS.OK,\n }));\n }\n\n private getCountry(reqInfo: RequestInfo) {\n return reqInfo.collection.find(country => country.id === reqInfo.id);\n }\n\n private listCountries(reqInfo: RequestInfo) {\n return reqInfo.collection;\n }\n}\n","/**\n * Generated b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EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mCAAmC,cAFlC,MAAM,EAAA,CAAA,CAAA;2FAEP,mCAAmC,EAAA,UAAA,EAAA,CAAA;kBAH/C,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA,CAAA;;;ACrBD;;AAEG;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Injectable, NgModule } from '@angular/core';
|
|
3
|
-
import * as i1 from '
|
|
4
|
-
import { gql } from '
|
|
3
|
+
import * as i1 from 'apollo-angular';
|
|
4
|
+
import { gql } from 'apollo-angular';
|
|
5
5
|
import { throwError } from 'rxjs';
|
|
6
6
|
import { map, catchError } from 'rxjs/operators';
|
|
7
7
|
import { daffTransformMagentoError } from '@daffodil/driver/magento';
|
|
@@ -142,7 +142,7 @@ class DaffGeographyMagentoService {
|
|
|
142
142
|
list() {
|
|
143
143
|
return this.apollo.query({
|
|
144
144
|
query: getCountries,
|
|
145
|
-
}).pipe(map(validateGetCountriesResponse), map(result => result.data.countries.map(country => this.countryTransformer.transform(country))), catchError(err => throwError(transformMagentoGeographyError(err))));
|
|
145
|
+
}).pipe(map(validateGetCountriesResponse), map(result => result.data.countries.map(country => this.countryTransformer.transform(country))), catchError(err => throwError(() => transformMagentoGeographyError(err))));
|
|
146
146
|
}
|
|
147
147
|
get(countryId) {
|
|
148
148
|
return this.apollo.query({
|
|
@@ -150,7 +150,7 @@ class DaffGeographyMagentoService {
|
|
|
150
150
|
variables: {
|
|
151
151
|
countryId,
|
|
152
152
|
},
|
|
153
|
-
}).pipe(map(result => this.countryTransformer.transform(result.data.country)), catchError(err => throwError(transformMagentoGeographyError(err))));
|
|
153
|
+
}).pipe(map(result => this.countryTransformer.transform(result.data.country)), catchError(err => throwError(() => transformMagentoGeographyError(err))));
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
/** @nocollapse */ /** @nocollapse */ DaffGeographyMagentoService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffGeographyMagentoService, deps: [{ token: i1.Apollo }, { token: DaffMagentoCountryTransformer }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -1 +1 @@
|
|
|
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 { MagentoCountry } from '../../models/responses/country';\nimport { DaffMagentoSubdivisionTransformer } from './subdivision.service';\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 '@damienwebdev/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 '@damienwebdev/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 '@damienwebdev/apollo-angular';\n\nimport { countryFragment } from './fragments/public_api';\n\nexport const getCountries = gql`\n query MagentoGetCountries {\n countries {\n ...country\n }\n }\n ${countryFragment}\n`;\n","import { gql } from '@damienwebdev/apollo-angular';\n\nimport {\n countryFragment,\n regionFragment,\n} from './fragments/public_api';\n\nexport const getCountry = gql`\n query MagentoGetCountry($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\tCOUNTRY_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 { ApolloQueryResult } from '@apollo/client/core';\n\nimport { DaffGeographyInvalidAPIResponseError } from '@daffodil/geography/driver';\n\nimport { MagentoGetCountriesResponse } from '../queries/public_api';\n\nexport const validateGetCountriesResponse = (response: ApolloQueryResult<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 '@damienwebdev/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 { DaffGeographyDriver } from '@daffodil/geography/driver';\n\nimport { DaffGeographyMagentoService } from './geography.service';\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 {\n provide: DaffGeographyDriver,\n useExisting: DaffGeographyMagentoService,\n },\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,iCAAiC,CAAA;AAC5C;;AAEG;AACH,IAAA,SAAS,CAAC,MAAqB,EAAA;QAC7B,OAAO,MAAM,GAAG;AACd,YAAA,GAAG,EAAE,cAAc,EAAE,MAAM,EAAE;AAE7B,YAAA,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;YACrB,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,UAAU,EAAE,MAAM,CAAC,IAAI;SACxB,GAAG,IAAI,CAAC;KACV;;oKAZU,iCAAiC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAjC,sCAAA,iCAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iCAAiC,cAFhC,MAAM,EAAA,CAAA,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,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA,CAAA;;;MChBY,gCAAgC,CAAA;AAC3C,IAAA,OAAO,OAAO,GAAA;QACZ,OAAO;AACL,YAAA,QAAQ,EAAE,gCAAgC;AAC1C,YAAA,SAAS,EAAE;AACT,gBAAA;AACE,oBAAA,OAAO,EAAE,mBAAmB;AAC5B,oBAAA,WAAW,EAAE,2BAA2B;AACzC,iBAAA;AACF,aAAA;SACF,CAAC;KACH;;mKAXU,gCAAgC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAhC,sCAAA,gCAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gCAAgC,YAHzC,YAAY,CAAA,EAAA,CAAA,CAAA;AAGH,sCAAA,gCAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gCAAgC,EAJlC,OAAA,EAAA,CAAA;YACP,YAAY;AACb,SAAA,CAAA,EAAA,CAAA,CAAA;2FAEU,gCAAgC,EAAA,UAAA,EAAA,CAAA;kBAL5C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACF,iBAAA,CAAA;;;ACdD;;AAEG;;;;"}
|
|
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 { MagentoCountry } from '../../models/responses/country';\nimport { DaffMagentoSubdivisionTransformer } from './subdivision.service';\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 getCountries = gql`\n query MagentoGetCountries {\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 getCountry = gql`\n query MagentoGetCountry($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 { ApolloQueryResult } from '@apollo/client/core';\n\nimport { DaffGeographyInvalidAPIResponseError } from '@daffodil/geography/driver';\n\nimport { MagentoGetCountriesResponse } from '../queries/public_api';\n\nexport const validateGetCountriesResponse = (response: ApolloQueryResult<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 { DaffGeographyDriver } from '@daffodil/geography/driver';\n\nimport { DaffGeographyMagentoService } from './geography.service';\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 {\n provide: DaffGeographyDriver,\n useExisting: DaffGeographyMagentoService,\n },\n ],\n };\n }\n}\n","/**\n * Generated bund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OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gCAAgC,YAHzC,YAAY,CAAA,EAAA,CAAA,CAAA;AAGH,sCAAA,gCAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gCAAgC,EAJlC,OAAA,EAAA,CAAA;YACP,YAAY;AACb,SAAA,CAAA,EAAA,CAAA,CAAA;2FAEU,gCAAgC,EAAA,UAAA,EAAA,CAAA;kBAL5C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACF,iBAAA,CAAA;;;ACdD;;AAEG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-geography-driver.mjs","sources":["../../../libs/geography/driver/src/errors/country-not-found.ts","../../../libs/geography/driver/src/errors/invalid-api-response.ts","../../../libs/geography/driver/src/interfaces/geography-service.interface.ts","../../../libs/geography/driver/src/daffodil-geography-driver.ts"],"sourcesContent":["import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nexport class DaffCountryNotFoundError extends DaffInheritableError implements DaffError {\n public readonly code: string = 'DAFF_GEOGRAPHY_COUNTRY_NOT_FOUND';\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nexport class DaffGeographyInvalidAPIResponseError extends DaffInheritableError implements DaffError {\n public readonly code: string = 'DAFF_GEOGRAPHY_INVALID_API_RESPONSE';\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { DaffCountry } from '@daffodil/geography';\n\nexport const DaffGeographyDriver = new InjectionToken<DaffGeographyServiceInterface>('DaffGeographyDriver');\n\nexport interface DaffGeographyServiceInterface<T extends DaffCountry = DaffCountry> {\n
|
|
1
|
+
{"version":3,"file":"daffodil-geography-driver.mjs","sources":["../../../libs/geography/driver/src/errors/country-not-found.ts","../../../libs/geography/driver/src/errors/invalid-api-response.ts","../../../libs/geography/driver/src/interfaces/geography-service.interface.ts","../../../libs/geography/driver/src/daffodil-geography-driver.ts"],"sourcesContent":["import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nexport class DaffCountryNotFoundError extends DaffInheritableError implements DaffError {\n public readonly code: string = 'DAFF_GEOGRAPHY_COUNTRY_NOT_FOUND';\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nexport class DaffGeographyInvalidAPIResponseError extends DaffInheritableError implements DaffError {\n public readonly code: string = 'DAFF_GEOGRAPHY_INVALID_API_RESPONSE';\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { DaffCountry } from '@daffodil/geography';\n\nexport const DaffGeographyDriver = new InjectionToken<DaffGeographyServiceInterface>('DaffGeographyDriver');\n\nexport interface DaffGeographyServiceInterface<T extends DaffCountry = DaffCountry> {\n /**\n * Retrieves the list of countries available to the given store.\n */\n list(): Observable<T[]>;\n\n /**\n * Retrieve precise information about a specific country.\n */\n get(id: T['id']): Observable<T>;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAKM,MAAO,wBAAyB,SAAQ,oBAAoB,CAAA;AAGhE,IAAA,WAAA,CAAmB,OAAe,EAAA;QAChC,KAAK,CAAC,OAAO,CAAC,CAAC;QADE,IAAO,CAAA,OAAA,GAAP,OAAO,CAAQ;QAFlB,IAAI,CAAA,IAAA,GAAW,kCAAkC,CAAC;KAIjE;AACF;;ACNK,MAAO,oCAAqC,SAAQ,oBAAoB,CAAA;AAG5E,IAAA,WAAA,CAAmB,OAAe,EAAA;QAChC,KAAK,CAAC,OAAO,CAAC,CAAC;QADE,IAAO,CAAA,OAAA,GAAP,OAAO,CAAQ;QAFlB,IAAI,CAAA,IAAA,GAAW,qCAAqC,CAAC;KAIpE;AACF;;MCNY,mBAAmB,GAAG,IAAI,cAAc,CAAgC,qBAAqB;;ACL1G;;AAEG;;;;"}
|
|
@@ -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/country.factory.ts","../../../libs/geography/testing/src/factories/subdivision.factory.ts","../../../libs/geography/testing/src/daffodil-geography-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport * as 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.address.streetName();\n street2 = faker.address.secondaryAddress();\n city = faker.address.city();\n region = faker.address.stateAbbr();\n postcode = faker.address.zipCode();\n country = faker.address.zipCode();\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 * as 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.name.prefix();\n suffix = faker.name.suffix();\n firstname = faker.name.firstName();\n middlename = faker.name.firstName();\n lastname = faker.name.lastName();\n email = faker.internet.email();\n telephone = faker.phone.phoneNumber();\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 * as faker from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffCountry } from '@daffodil/geography';\n\nexport class MockCountry implements DaffCountry {\n id = faker.datatype.uuid();\n name = faker.random.word();\n
|
|
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/country.factory.ts","../../../libs/geography/testing/src/factories/subdivision.factory.ts","../../../libs/geography/testing/src/daffodil-geography-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport * as 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.address.streetName();\n street2 = faker.address.secondaryAddress();\n city = faker.address.city();\n region = faker.address.stateAbbr();\n postcode = faker.address.zipCode();\n country = faker.address.zipCode();\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 * as 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.name.prefix();\n suffix = faker.name.suffix();\n firstname = faker.name.firstName();\n middlename = faker.name.firstName();\n lastname = faker.name.lastName();\n email = faker.internet.email();\n telephone = faker.phone.phoneNumber();\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 * as faker from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffCountry } from '@daffodil/geography';\n\nexport class MockCountry implements DaffCountry {\n id = faker.datatype.uuid();\n name = faker.random.word();\n name_en = faker.random.word();\n alpha2 = faker.random.alphaNumeric(2);\n alpha3 = faker.random.alphaNumeric(3);\n subdivisions = [];\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCountryFactory extends DaffModelFactory<DaffCountry> {\n constructor() {\n super(MockCountry);\n }\n}\n","import { Injectable } from '@angular/core';\nimport * as 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.datatype.uuid();\n name = faker.random.word();\n iso_3166_2 = faker.random.alphaNumeric(2);\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffSubdivisionFactory extends DaffModelFactory<DaffSubdivision> {\n constructor() {\n super(MockSubdivision);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAOa,eAAe,CAAA;AAA5B,IAAA,WAAA,GAAA;AACE,QAAA,IAAA,CAAA,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;AACpC,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC;AAC3C,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;AAC5B,QAAA,IAAA,CAAA,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;AACnC,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;AACnC,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;KACnC;AAAA,CAAA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
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@daffodil/geography",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.42.1",
|
|
4
4
|
"description": "A package for interacting with platforms that provide geographic data information like States and Countries",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
"homepage": "https://github.com/graycoreio/daffodil",
|
|
15
15
|
"peerDependencies": {
|
|
16
16
|
"@angular/core": "^13.0.0",
|
|
17
|
-
"@daffodil/core": "0.
|
|
17
|
+
"@daffodil/core": "0.42.1"
|
|
18
18
|
},
|
|
19
19
|
"optionalDependencies": {
|
|
20
|
-
"@daffodil/driver": "0.
|
|
20
|
+
"@daffodil/driver": "0.42.1"
|
|
21
21
|
},
|
|
22
22
|
"module": "fesm2015/daffodil-geography.mjs",
|
|
23
23
|
"es2020": "fesm2020/daffodil-geography.mjs",
|