@daffodil/customer-store-credit 0.78.0 → 0.80.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/driver/interfaces/store-credit-service.interface.d.ts +1 -5
- package/driver/public_api.d.ts +1 -1
- package/esm2022/driver/in-memory/driver/driver.module.mjs +3 -6
- package/esm2022/driver/interfaces/store-credit-service.interface.mjs +8 -3
- package/esm2022/driver/magento/driver.module.mjs +6 -9
- package/esm2022/driver/public_api.mjs +2 -2
- package/esm2022/driver/testing/drivers/driver.module.mjs +3 -6
- package/esm2022/state/injection-tokens/error-matcher.token.mjs +8 -3
- package/esm2022/state/injection-tokens/public_api.mjs +2 -2
- package/esm2022/state/reducers/token/extra.token.mjs +5 -13
- package/esm2022/state/reducers/token/reducers.token.mjs +9 -3
- package/fesm2022/daffodil-customer-store-credit-driver-in-memory.mjs +2 -5
- package/fesm2022/daffodil-customer-store-credit-driver-in-memory.mjs.map +1 -1
- package/fesm2022/daffodil-customer-store-credit-driver-magento.mjs +5 -8
- package/fesm2022/daffodil-customer-store-credit-driver-magento.mjs.map +1 -1
- package/fesm2022/daffodil-customer-store-credit-driver-testing.mjs +2 -5
- package/fesm2022/daffodil-customer-store-credit-driver-testing.mjs.map +1 -1
- package/fesm2022/daffodil-customer-store-credit-driver.mjs +8 -4
- package/fesm2022/daffodil-customer-store-credit-driver.mjs.map +1 -1
- package/fesm2022/daffodil-customer-store-credit-state.mjs +19 -16
- package/fesm2022/daffodil-customer-store-credit-state.mjs.map +1 -1
- package/package.json +1 -1
- package/state/injection-tokens/error-matcher.token.d.ts +1 -6
- package/state/injection-tokens/public_api.d.ts +1 -1
- package/state/reducers/token/extra.token.d.ts +1 -20
- package/state/reducers/token/reducers.token.d.ts +1 -8
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import { InjectionToken } from '@angular/core';
|
|
2
1
|
import { Observable } from 'rxjs';
|
|
3
2
|
import { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';
|
|
4
|
-
|
|
5
|
-
* An injection token for the customer store credit driver.
|
|
6
|
-
*/
|
|
7
|
-
export declare const DaffCustomerStoreCreditDriver: InjectionToken<DaffCustomerStoreCreditDriverInterface<DaffCustomerStoreCredit>>;
|
|
3
|
+
export declare const DaffCustomerStoreCreditDriver: import("@angular/core").InjectionToken<DaffCustomerStoreCreditDriverInterface<DaffCustomerStoreCredit>>, provideDaffCustomerStoreCreditDriver: <R extends DaffCustomerStoreCreditDriverInterface<DaffCustomerStoreCredit> = DaffCustomerStoreCreditDriverInterface<DaffCustomerStoreCredit>>(klass: import("@angular/core").Type<R>) => import("@angular/core").ExistingProvider;
|
|
8
4
|
/**
|
|
9
5
|
* The customer store credit driver is responsible for loading customers.
|
|
10
6
|
*/
|
package/driver/public_api.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { DaffCustomerStoreCreditDriver,
|
|
1
|
+
export { DaffCustomerStoreCreditDriverInterface, DaffCustomerStoreCreditDriver, provideDaffCustomerStoreCreditDriver, } from './interfaces/store-credit-service.interface';
|
|
2
2
|
export * from './errors/public_api';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CommonModule } from '@angular/common';
|
|
2
2
|
import { NgModule, } from '@angular/core';
|
|
3
|
-
import {
|
|
3
|
+
import { provideDaffCustomerStoreCreditDriver } from '@daffodil/customer-store-credit/driver';
|
|
4
4
|
import { provideDaffInMemoryBackends } from '@daffodil/driver/in-memory';
|
|
5
5
|
import { DaffCustomerStoreCreditInMemoryDriver } from './store-credit.service';
|
|
6
6
|
import { DaffCustomerStoreCreditInMemoryBackendService } from '../backend/store-credit.service';
|
|
@@ -13,10 +13,7 @@ export class DaffCustomerStoreCreditInMemoryDriverModule {
|
|
|
13
13
|
return {
|
|
14
14
|
ngModule: DaffCustomerStoreCreditInMemoryDriverModule,
|
|
15
15
|
providers: [
|
|
16
|
-
|
|
17
|
-
provide: DaffCustomerStoreCreditDriver,
|
|
18
|
-
useExisting: DaffCustomerStoreCreditInMemoryDriver,
|
|
19
|
-
},
|
|
16
|
+
provideDaffCustomerStoreCreditDriver(DaffCustomerStoreCreditInMemoryDriver),
|
|
20
17
|
provideDaffInMemoryBackends(DaffCustomerStoreCreditInMemoryBackendService),
|
|
21
18
|
],
|
|
22
19
|
};
|
|
@@ -33,4 +30,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
33
30
|
],
|
|
34
31
|
}]
|
|
35
32
|
}] });
|
|
36
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
33
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZHJpdmVyLm1vZHVsZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvY3VzdG9tZXItc3RvcmUtY3JlZGl0L2RyaXZlci9pbi1tZW1vcnkvc3JjL2RyaXZlci9kcml2ZXIubW9kdWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUMvQyxPQUFPLEVBQ0wsUUFBUSxHQUVULE1BQU0sZUFBZSxDQUFDO0FBRXZCLE9BQU8sRUFBRSxvQ0FBb0MsRUFBRSxNQUFNLHdDQUF3QyxDQUFDO0FBQzlGLE9BQU8sRUFBRSwyQkFBMkIsRUFBRSxNQUFNLDRCQUE0QixDQUFDO0FBRXpFLE9BQU8sRUFBRSxxQ0FBcUMsRUFBRSxNQUFNLHdCQUF3QixDQUFDO0FBQy9FLE9BQU8sRUFBRSw2Q0FBNkMsRUFBRSxNQUFNLGlDQUFpQyxDQUFDOztBQUVoRzs7R0FFRztBQU1ILE1BQU0sT0FBTywyQ0FBMkM7SUFDdEQsTUFBTSxDQUFDLE9BQU87UUFDWixPQUFPO1lBQ0wsUUFBUSxFQ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3JlZGl0SW5NZW1vcnlEcml2ZXJ9IGFzIHRoZSB7QGxpbmsgRGFmZkN1c3RvbWVyU3RvcmVDcmVkaXREcml2ZXJ9LlxuICovXG5ATmdNb2R1bGUoe1xuICBpbXBvcnRzOiBbXG4gICAgQ29tbW9uTW9kdWxlLFxuICBdLFxufSlcbmV4cG9ydCBjbGFzcyBEYWZmQ3VzdG9tZXJTdG9yZUNyZWRpdEluTWVtb3J5RHJpdmVyTW9kdWxlIHtcbiAgc3RhdGljIGZvclJvb3QoKTogTW9kdWxlV2l0aFByb3ZpZGVyczxEYWZmQ3VzdG9tZXJTdG9yZUNyZWRpdEluTWVtb3J5RHJpdmVyTW9kdWxlPiB7XG4gICAgcmV0dXJuIHtcbiAgICAgIG5nTW9kdWxlOiBEYWZmQ3VzdG9tZXJTdG9yZUNyZWRpdEluTWVtb3J5RHJpdmVyTW9kdWxlLFxuICAgICAgcHJvdmlkZXJzOiBbXG4gICAgICAgIHByb3ZpZGVEYWZmQ3VzdG9tZXJTdG9yZUNyZWRpdERyaXZlcihEYWZmQ3VzdG9tZXJTdG9yZUNyZWRpdEluTWVtb3J5RHJpdmVyKSxcbiAgICAgICAgcHJvdmlkZURhZmZJbk1lbW9yeUJhY2tlbmRzKERhZmZDdXN0b21lclN0b3JlQ3JlZGl0SW5NZW1vcnlCYWNrZW5kU2VydmljZSksXG4gICAgICBdLFxuICAgIH07XG4gIH1cbn1cbiJdfQ==
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createSingletonInjectionToken } from '@daffodil/core';
|
|
2
|
+
export const {
|
|
2
3
|
/**
|
|
3
4
|
* An injection token for the customer store credit driver.
|
|
4
5
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
token: DaffCustomerStoreCreditDriver,
|
|
7
|
+
/**
|
|
8
|
+
* Provider function for {@link DaffCustomerStoreCreditDriver}.
|
|
9
|
+
*/
|
|
10
|
+
provider: provideDaffCustomerStoreCreditDriver, } = createSingletonInjectionToken('DaffCustomerStoreCreditDriver');
|
|
11
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RvcmUtY3JlZGl0LXNlcnZpY2UuaW50ZXJmYWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vbGlicy9jdXN0b21lci1zdG9yZS1jcmVkaXQvZHJpdmVyL3NyYy9pbnRlcmZhY2VzL3N0b3JlLWNyZWRpdC1zZXJ2aWNlLmludGVyZmFjZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFFQSxPQUFPLEVBQUUsNkJBQTZCLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQztBQUcvRCxNQUFNLENBQUMsTUFBTTtBQUNYOztHQUVHO0FBQ0gsS0FBSyxFQUFFLDZCQUE2QjtBQUNwQzs7R0FFRztBQUNILFFBQVEsRUFBRSxvQ0FBb0MsR0FDL0MsR0FBRyw2QkFBNkIsQ0FBeUMsK0JBQStCLENBQUMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IE9ic2VydmFibGUgfSBmcm9tICdyeGpzJztcblxuaW1wb3J0IHsgY3JlYXRlU2luZ2xldG9uSW5qZWN0aW9uVG9rZW4gfSBmcm9tICdAZGFmZm9kaWwvY29yZSc7XG5pbXBvcnQgeyBEYWZmQ3VzdG9tZXJTdG9yZUNyZWRpdCB9IGZyb20gJ0BkYWZmb2RpbC9jdXN0b21lci1zdG9yZS1jcmVkaXQnO1xuXG5leHBvcnQgY29uc3Qge1xuICAvKipcbiAgICogQW4gaW5qZWN0aW9uIHRva2VuIGZvciB0aGUgY3VzdG9tZXIgc3RvcmUgY3JlZGl0IGRyaXZlci5cbiAgICovXG4gIHRva2VuOiBEYWZmQ3VzdG9tZXJTdG9yZUNyZWRpdERyaXZlcixcbiAgLyoqXG4gICAqIFByb3ZpZGVyIGZ1bmN0aW9uIGZvciB7QGxpbmsgRGFmZkN1c3RvbWVyU3RvcmVDcmVkaXREcml2ZXJ9LlxuICAgKi9cbiAgcHJvdmlkZXI6IHByb3ZpZGVEYWZmQ3VzdG9tZXJTdG9yZUNyZWRpdERyaXZlcixcbn0gPSBjcmVhdGVTaW5nbGV0b25JbmplY3Rpb25Ub2tlbjxEYWZmQ3VzdG9tZXJTdG9yZUNyZWRpdERyaXZlckludGVyZmFjZT4oJ0RhZmZDdXN0b21lclN0b3JlQ3JlZGl0RHJpdmVyJyk7XG5cbi8qKlxuICogVGhlIGN1c3RvbWVyIHN0b3JlIGNyZWRpdCBkcml2ZXIgaXMgcmVzcG9uc2libGUgZm9yIGxvYWRpbmcgY3VzdG9tZXJzLlxuICovXG5leHBvcnQgaW50ZXJmYWNlIERhZmZDdXN0b21lclN0b3JlQ3JlZGl0RHJpdmVySW50ZXJmYWNlPFxuICBUU3RvcmVDcmVkaXQgZXh0ZW5kcyBEYWZmQ3VzdG9tZXJTdG9yZUNyZWRpdCA9IERhZmZDdXN0b21lclN0b3JlQ3JlZGl0LFxuPiB7XG4gIC8qKlxuICAgKiBHZXQgdGhlIGN1c3RvbWVyJ3Mgc3RvcmUgY3JlZGl0LlxuICAgKi9cbiAgZ2V0KCk6IE9ic2VydmFibGU8VFN0b3JlQ3JlZGl0Pjtcbn1cbiJdfQ==
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CommonModule } from '@angular/common';
|
|
2
2
|
import { NgModule, } from '@angular/core';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { provideDaffCustomerOrderMagentoExtraOrderFragments, provideDaffCustomerOrderMagentoExtraOrderTransforms, } from '@daffodil/customer-order/driver/magento/2-4-6';
|
|
4
|
+
import { provideDaffCustomerStoreCreditDriver } from '@daffodil/customer-store-credit/driver';
|
|
5
5
|
import { DaffCustomerStoreCreditMagentoService } from './customer-store-credit.service';
|
|
6
6
|
import { magentoCustomerOrderStoreCreditTotalFragment } from './queries/public_api';
|
|
7
7
|
import { magentoCustomerOrderWithStoreCreditTransform } from './transforms/public_api';
|
|
@@ -11,12 +11,9 @@ export class DaffCustomerStoreCreditMagentoDriverModule {
|
|
|
11
11
|
return {
|
|
12
12
|
ngModule: DaffCustomerStoreCreditMagentoDriverModule,
|
|
13
13
|
providers: [
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
daffProvideCustomerOrderMagentoExtraOrderFragments(magentoCustomerOrderStoreCreditTotalFragment),
|
|
19
|
-
daffProvideCustomerOrderMagentoExtraOrderTransforms(magentoCustomerOrderWithStoreCreditTransform),
|
|
14
|
+
provideDaffCustomerStoreCreditDriver(DaffCustomerStoreCreditMagentoService),
|
|
15
|
+
provideDaffCustomerOrderMagentoExtraOrderFragments(magentoCustomerOrderStoreCreditTotalFragment),
|
|
16
|
+
provideDaffCustomerOrderMagentoExtraOrderTransforms(magentoCustomerOrderWithStoreCreditTransform),
|
|
20
17
|
],
|
|
21
18
|
};
|
|
22
19
|
}
|
|
@@ -32,4 +29,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
32
29
|
],
|
|
33
30
|
}]
|
|
34
31
|
}] });
|
|
35
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
32
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZHJpdmVyLm1vZHVsZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL2xpYnMvY3VzdG9tZXItc3RvcmUtY3JlZGl0L2RyaXZlci9tYWdlbnRvL3NyYy9kcml2ZXIubW9kdWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUMvQyxPQUFPLEVBQ0wsUUFBUSxHQUVULE1BQU0sZUFBZSxDQUF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kN1c3RvbWVyU3RvcmVDcmVkaXREcml2ZXIoRGFmZkN1c3RvbWVyU3RvcmVDcmVkaXRNYWdlbnRvU2VydmljZSksXG4gICAgICAgIHByb3ZpZGVEYWZmQ3VzdG9tZXJPcmRlck1hZ2VudG9FeHRyYU9yZGVyRnJhZ21lbnRzKFxuICAgICAgICAgIG1hZ2VudG9DdXN0b21lck9yZGVyU3RvcmVDcmVkaXRUb3RhbEZyYWdtZW50LFxuICAgICAgICApLFxuICAgICAgICBwcm92aWRlRGFmZkN1c3RvbWVyT3JkZXJNYWdlbnRvRXh0cmFPcmRlclRyYW5zZm9ybXMoXG4gICAgICAgICAgbWFnZW50b0N1c3RvbWVyT3JkZXJXaXRoU3RvcmVDcmVkaXRUcmFuc2Zvcm0sXG4gICAgICAgICksXG4gICAgICBdLFxuICAgIH07XG4gIH1cbn1cbiJdfQ==
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { DaffCustomerStoreCreditDriver, } from './interfaces/store-credit-service.interface';
|
|
1
|
+
export { DaffCustomerStoreCreditDriver, provideDaffCustomerStoreCreditDriver, } from './interfaces/store-credit-service.interface';
|
|
2
2
|
export * from './errors/public_api';
|
|
3
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYnMvY3VzdG9tZXItc3RvcmUtY3JlZGl0L2RyaXZlci9zcmMvcHVibGljX2FwaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBRUwsNkJBQTZCLEVBQzdCLG9DQUFvQyxHQUNyQyxNQUFNLDZDQUE2QyxDQUFDO0FBRXJELGNBQWMscUJBQXFCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQge1xuICBEYWZmQ3VzdG9tZXJTdG9yZUNyZWRpdERyaXZlckludGVyZmFjZSxcbiAgRGFmZkN1c3RvbWVyU3RvcmVDcmVkaXREcml2ZXIsXG4gIHByb3ZpZGVEYWZmQ3VzdG9tZXJTdG9yZUNyZWRpdERyaXZlcixcbn0gZnJvbSAnLi9pbnRlcmZhY2VzL3N0b3JlLWNyZWRpdC1zZXJ2aWNlLmludGVyZmFjZSc7XG5cbmV4cG9ydCAqIGZyb20gJy4vZXJyb3JzL3B1YmxpY19hcGknO1xuIl19
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CommonModule } from '@angular/common';
|
|
2
2
|
import { NgModule, } from '@angular/core';
|
|
3
|
-
import {
|
|
3
|
+
import { provideDaffCustomerStoreCreditDriver } from '@daffodil/customer-store-credit/driver';
|
|
4
4
|
import { DaffCustomerStoreCreditTestingDriver } from './store-credit.service';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
/**
|
|
@@ -11,10 +11,7 @@ export class DaffCustomerStoreCreditTestingDriverModule {
|
|
|
11
11
|
return {
|
|
12
12
|
ngModule: DaffCustomerStoreCreditTestingDriverModule,
|
|
13
13
|
providers: [
|
|
14
|
-
|
|
15
|
-
provide: DaffCustomerStoreCreditDriver,
|
|
16
|
-
useExisting: DaffCustomerStoreCreditTestingDriver,
|
|
17
|
-
},
|
|
14
|
+
provideDaffCustomerStoreCreditDriver(DaffCustomerStoreCreditTestingDriver),
|
|
18
15
|
],
|
|
19
16
|
};
|
|
20
17
|
}
|
|
@@ -30,4 +27,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
30
27
|
],
|
|
31
28
|
}]
|
|
32
29
|
}] });
|
|
33
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
30
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZHJpdmVyLm1vZHVsZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpb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lci1zdG9yZS1jcmVkaXQvZHJpdmVyJztcblxuaW1wb3J0IHsgRGFmZkN1c3RvbWVyU3RvcmVDcmVkaXRUZXN0aW5nRHJpdmVyIH0gZnJvbSAnLi9zdG9yZS1jcmVkaXQuc2VydmljZSc7XG5cbi8qKlxuICogUHJvdmlkZXMgdGhlIHtAbGluayBEYWZmQ3VzdG9tZXJTdG9yZUNyZWRpdFRlc3RpbmdEcml2ZXJ9IGFzIHRoZSB7QGxpbmsgRGFmZkN1c3RvbWVyU3RvcmVDcmVkaXREcml2ZXJ9LlxuICovXG5ATmdNb2R1bGUoe1xuICBpbXBvcnRzOiBbXG4gICAgQ29tbW9uTW9kdWxlLFxuICBdLFxufSlcbmV4cG9ydCBjbGFzcyBEYWZmQ3VzdG9tZXJTdG9yZUNyZWRpdFRlc3RpbmdEcml2ZXJNb2R1bGUge1xuICBzdGF0aWMgZm9yUm9vdCgpOiBNb2R1bGVXaXRoUHJvdmlkZXJzPERhZmZDdXN0b21lclN0b3JlQ3JlZGl0VGVzdGluZ0RyaXZlck1vZHVsZT4ge1xuICAgIHJldHVybiB7XG4gICAgICBuZ01vZHVsZTogRGFmZkN1c3RvbWVyU3RvcmVDcmVkaXRUZXN0aW5nRHJpdmVyTW9kdWxlLFxuICAgICAgcHJvdmlkZXJzOiBbXG4gICAgICAgIHByb3ZpZGVEYWZmQ3VzdG9tZXJTdG9yZUNyZWRpdERyaXZlcihEYWZmQ3VzdG9tZXJTdG9yZUNyZWRpdFRlc3RpbmdEcml2ZXIpLFxuICAgICAgXSxcbiAgICB9O1xuICB9XG59XG4iXX0=
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createSingleInjectionToken } from '@daffodil/core';
|
|
2
2
|
import { daffTransformErrorToStateError } from '@daffodil/core/state';
|
|
3
|
+
export const {
|
|
3
4
|
/**
|
|
4
5
|
* Transforms `DaffError`s into `DaffStateError`s before they are serialized into state.
|
|
5
6
|
* Can be used to further refine Daffodil errors into more specific app errors.
|
|
6
7
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
token: DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER,
|
|
9
|
+
/**
|
|
10
|
+
* Provider function for {@link DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER}.
|
|
11
|
+
*/
|
|
12
|
+
provider: provideDaffCustomerStoreCreditErrorMatcher, } = createSingleInjectionToken('DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER', { factory: () => daffTransformErrorToStateError });
|
|
13
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXJyb3ItbWF0Y2hlci50b2tlbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL2xpYnMvY3VzdG9tZXItc3RvcmUtY3JlZGl0L3N0YXRlL3NyYy9pbmplY3Rpb24tdG9rZW5zL2Vycm9yLW1hdGNoZXIudG9rZW4udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLDBCQUEwQixFQUFFLE1BQU0sZ0JBQWdCLENBQUM7QUFDNUQsT0FBTyxFQUFFLDhCQUE4QixFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFFdEUsTUFBTSxDQUFDLE1BQU07QUFDWDs7O0dBR0c7QUFDSCxLQUFLLEVBQUUsd0NBQXdDO0FBQy9DOztHQUVHO0FBQ0gsUUFBUSxFQUFFLDBDQUEwQyxHQUNyRCxHQUFHLDBCQUEwQixDQUM1QiwwQ0FBMEMsRUFDMUMsRUFBRSxPQUFPLEVBQUUsR0FBRyxFQUFFLENBQUMsOEJBQThCLEVBQUUsQ0FDbEQsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNyZWF0ZVNpbmdsZUluamVjdGlvblRva2VuIH0gZnJvbSAnQGRhZmZvZGlsL2NvcmUnO1xuaW1wb3J0IHsgZGFmZlRyYW5zZm9ybUVycm9yVG9TdGF0ZUVycm9yIH0gZnJvbSAnQGRhZmZvZGlsL2NvcmUvc3RhdGUnO1xuXG5leHBvcnQgY29uc3Qge1xuICAvKipcbiAgICogVHJhbnNmb3JtcyBgRGFmZkVycm9yYHMgaW50byBgRGFmZlN0YXRlRXJyb3JgcyBiZWZvcmUgdGhleSBhcmUgc2VyaWFsaXplZCBpbnRvIHN0YXRlLlxuICAgKiBDYW4gYmUgdXNlZCB0byBmdXJ0aGVyIHJlZmluZSBEYWZmb2RpbCBlcnJvcnMgaW50byBtb3JlIHNwZWNpZmljIGFwcCBlcnJvcnMuXG4gICAqL1xuICB0b2tlbjogREFGRl9DVVNUT01FUl9TVE9SRV9DUkVESVRfRVJST1JfTUFUQ0hFUixcbiAgLyoqXG4gICAqIFByb3ZpZGVyIGZ1bmN0aW9uIGZvciB7QGxpbmsgREFGRl9DVVNUT01FUl9TVE9SRV9DUkVESVRfRVJST1JfTUFUQ0hFUn0uXG4gICAqL1xuICBwcm92aWRlcjogcHJvdmlkZURhZmZDdXN0b21lclN0b3JlQ3JlZGl0RXJyb3JNYXRjaGVyLFxufSA9IGNyZWF0ZVNpbmdsZUluamVjdGlvblRva2VuPHR5cGVvZiBkYWZmVHJhbnNmb3JtRXJyb3JUb1N0YXRlRXJyb3I+KFxuICAnREFGRl9DVVNUT01FUl9TVE9SRV9DUkVESVRfRVJST1JfTUFUQ0hFUicsXG4gIHsgZmFjdG9yeTogKCkgPT4gZGFmZlRyYW5zZm9ybUVycm9yVG9TdGF0ZUVycm9yIH0sXG4pO1xuIl19
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
export * from './error-matcher.token';
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL2xpYnMvY3VzdG9tZXItc3RvcmUtY3JlZGl0L3N0YXRlL3NyYy9pbmplY3Rpb24tdG9rZW5zL3B1YmxpY19hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyx1QkFBdUIsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gJy4vZXJyb3ItbWF0Y2hlci50b2tlbic7XG4iXX0=
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createMultiInjectionToken } from '@daffodil/core';
|
|
2
|
+
export const {
|
|
2
3
|
/**
|
|
3
4
|
* A token to hold the injectable extra reducers.
|
|
4
5
|
*
|
|
5
6
|
* Prefer using {@link daffCustomerStoreCreditProvideExtraReducers}.
|
|
6
7
|
*/
|
|
7
|
-
|
|
8
|
-
factory: () => [],
|
|
9
|
-
providedIn: 'any',
|
|
10
|
-
});
|
|
8
|
+
token: DAFF_CUSTOMER_STORE_CREDIT_EXTRA_REDUCERS,
|
|
11
9
|
/**
|
|
12
10
|
* Provides additional reducers that run after the standard Daffodil customer reducers.
|
|
13
11
|
*
|
|
@@ -20,11 +18,5 @@ export const DAFF_CUSTOMER_STORE_CREDIT_EXTRA_REDUCERS = new InjectionToken('DAF
|
|
|
20
18
|
* ]
|
|
21
19
|
* ```
|
|
22
20
|
*/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
provide: DAFF_CUSTOMER_STORE_CREDIT_EXTRA_REDUCERS,
|
|
26
|
-
useValue: reducer,
|
|
27
|
-
multi: true,
|
|
28
|
-
}));
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXh0cmEudG9rZW4uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL2N1c3RvbWVyLXN0b3JlLWNyZWRpdC9zdGF0ZS9z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pO1xufVxuIl19
|
|
21
|
+
provider: daffCustomerStoreCreditProvideExtraReducers, } = createMultiInjectionToken('DAFF_CUSTOMER_STORE_CREDIT_EXTRA_REDUCERS', { providedIn: 'any' });
|
|
22
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXh0cmEudG9rZW4uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL2N1c3RvbWVyLXN0b3JlLWNyZWRpdC9zdGF0ZS9zcmMvcmVkdWNlcnMvdG9rZW4vZXh0cmEudG9rZW4udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsT0FBTyxFQUFFLHlCQUF5QixFQUFFLE1BQU0sZ0JBQWdCLENBQUM7QUFJM0QsTUFBTSxDQUFDLE1BQU07QUFDWDs7OztHQUlHO0FBQ0gsS0FBSyxFQUFFLHlDQUF5QztBQUVoRDs7Ozs7Ozs7Ozs7R0FXRztBQUNILFFBQVEsRUFBRSwyQ0FBMkMsR0FDdEQsR0FBRyx5QkFBeUIsQ0FDM0IsMkNBQTJDLEVBQzNDLEVBQUUsVUFBVSxFQUFFLEtBQUssRUFBRSxDQUN0QixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgQWN0aW9uUmVkdWNlciB9IGZyb20gJ0BuZ3J4L3N0b3JlJztcblxuaW1wb3J0IHsgY3JlYXRlTXVsdGlJbmplY3Rpb25Ub2tlbiB9IGZyb20gJ0BkYWZmb2RpbC9jb3JlJztcblxuaW1wb3J0IHsgRGFmZkN1c3RvbWVyU3RvcmVDcmVkaXRSZWR1Y2Vyc1N0YXRlIH0gZnJvbSAnLi4vcmVkdWNlcnMuaW50ZXJmYWNlJztcblxuZXhwb3J0IGNvbnN0IHtcbiAgLyoqXG4gICAqIEEgdG9rZW4gdG8gaG9sZCB0aGUgaW5qZWN0YWJsZSBleHRyYSByZWR1Y2Vycy5cbiAgICpcbiAgICogUHJlZmVyIHVzaW5nIHtAbGluayBkYWZmQ3VzdG9tZXJTdG9yZUNyZWRpdFByb3ZpZGVFeHRyYVJlZHVjZXJzfS5cbiAgICovXG4gIHRva2VuOiBEQUZGX0NVU1RPTUVSX1NUT1JFX0NSRURJVF9FWFRSQV9SRURVQ0VSUyxcblxuICAvKipcbiAgICogUHJvdmlkZXMgYWRkaXRpb25hbCByZWR1Y2VycyB0aGF0IHJ1biBhZnRlciB0aGUgc3RhbmRhcmQgRGFmZm9kaWwgY3VzdG9tZXIgcmVkdWNlcnMuXG4gICAqXG4gICAqIGBgYHRzXG4gICAqIHByb3ZpZGVyczogW1xuICAgKiAgIC4uLmRhZmZDdXN0b21lclN0b3JlQ3JlZGl0UHJvdmlkZUV4dHJhUmVkdWNlcnMoXG4gICAqICAgICBteVJlZHVjZXIxLFxuICAgKiAgICAgbXlSZWR1Y2VyMlxuICAgKiAgIClcbiAgICogXVxuICAgKiBgYGBcbiAgICovXG4gIHByb3ZpZGVyOiBkYWZmQ3VzdG9tZXJTdG9yZUNyZWRpdFByb3ZpZGVFeHRyYVJlZHVjZXJzLFxufSA9IGNyZWF0ZU11bHRpSW5qZWN0aW9uVG9rZW48QWN0aW9uUmVkdWNlcjxEYWZmQ3VzdG9tZXJTdG9yZUNyZWRpdFJlZHVjZXJzU3RhdGU+PihcbiAgJ0RBRkZfQ1VTVE9NRVJfU1RPUkVfQ1JFRElUX0VYVFJBX1JFRFVDRVJTJyxcbiAgeyBwcm92aWRlZEluOiAnYW55JyB9LFxuKTtcbiJdfQ==
|
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
import { inject
|
|
1
|
+
import { inject } from '@angular/core';
|
|
2
2
|
import { combineReducers, } from '@ngrx/store';
|
|
3
|
+
import { createSingleInjectionToken } from '@daffodil/core';
|
|
3
4
|
import { daffComposeReducers } from '@daffodil/core/state';
|
|
4
5
|
import { DAFF_CUSTOMER_STORE_CREDIT_EXTRA_REDUCERS } from './extra.token';
|
|
5
6
|
import { daffCustomerStoreCreditReducer } from '../store-credit/public_api';
|
|
7
|
+
export const {
|
|
6
8
|
/**
|
|
7
9
|
* An internal token to hold the Daffodil customer reducers.
|
|
8
10
|
* Includes the extra and standard reducers.
|
|
9
11
|
*
|
|
10
12
|
* @docs-private
|
|
11
13
|
*/
|
|
12
|
-
|
|
14
|
+
token: DAFF_CUSTOMER_STORE_CREDIT_REDUCERS,
|
|
15
|
+
/**
|
|
16
|
+
* Provider function for {@link DAFF_CUSTOMER_STORE_CREDIT_REDUCERS}.
|
|
17
|
+
*/
|
|
18
|
+
provider: provideDaffCustomerStoreCreditReducers, } = createSingleInjectionToken('DAFF_CUSTOMER_STORE_CREDIT_REDUCERS', {
|
|
13
19
|
providedIn: 'any',
|
|
14
20
|
factory: () => daffComposeReducers([
|
|
15
21
|
combineReducers({
|
|
@@ -18,4 +24,4 @@ export const DAFF_CUSTOMER_STORE_CREDIT_REDUCERS = new InjectionToken('DAFF_CUST
|
|
|
18
24
|
...inject(DAFF_CUSTOMER_STORE_CREDIT_EXTRA_REDUCERS),
|
|
19
25
|
]),
|
|
20
26
|
});
|
|
21
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
27
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVkdWNlcnMudG9rZW4uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL2N1c3RvbWVyLXN0b3JlLWNyZWRpdC9zdGF0ZS9zcmMvcmVkdWNlcnMvdG9rZW4vcmVkdWNlcnMudG9rZW4udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLE1BQU0sRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUN2QyxPQUFPLEVBRUwsZUFBZSxHQUNoQixNQUFNLGFBQWEsQ0FBQztBQUVyQixPQUFPLEVBQUUsMEJBQTBCLEVBQUUsTUFBTS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IGRhZmZDb21wb3NlUmVkdWNlcnMoW1xuICAgICAgY29tYmluZVJlZHVjZXJzKHtcbiAgICAgICAgc3RvcmVDcmVkaXQ6IGRhZmZDdXN0b21lclN0b3JlQ3JlZGl0UmVkdWNlcixcbiAgICAgIH0pLFxuICAgICAgLi4uaW5qZWN0KERBRkZfQ1VTVE9NRVJfU1RPUkVfQ1JFRElUX0VYVFJBX1JFRFVDRVJTKSxcbiAgICBdKSxcbiAgfSxcbik7XG4iXX0=
|
|
@@ -6,7 +6,7 @@ import * as i1 from '@daffodil/customer-store-credit/testing';
|
|
|
6
6
|
import * as i1$1 from '@angular/common/http';
|
|
7
7
|
import { DaffInMemoryDriverBase, provideDaffInMemoryBackends } from '@daffodil/driver/in-memory';
|
|
8
8
|
import { CommonModule } from '@angular/common';
|
|
9
|
-
import {
|
|
9
|
+
import { provideDaffCustomerStoreCreditDriver } from '@daffodil/customer-store-credit/driver';
|
|
10
10
|
|
|
11
11
|
const DAFF_CUSTOMER_STORE_CREDIT_IN_MEMORY_COLLECTION_NAME = 'customer-store-credit';
|
|
12
12
|
|
|
@@ -91,10 +91,7 @@ class DaffCustomerStoreCreditInMemoryDriverModule {
|
|
|
91
91
|
return {
|
|
92
92
|
ngModule: DaffCustomerStoreCreditInMemoryDriverModule,
|
|
93
93
|
providers: [
|
|
94
|
-
|
|
95
|
-
provide: DaffCustomerStoreCreditDriver,
|
|
96
|
-
useExisting: DaffCustomerStoreCreditInMemoryDriver,
|
|
97
|
-
},
|
|
94
|
+
provideDaffCustomerStoreCreditDriver(DaffCustomerStoreCreditInMemoryDriver),
|
|
98
95
|
provideDaffInMemoryBackends(DaffCustomerStoreCreditInMemoryBackendService),
|
|
99
96
|
],
|
|
100
97
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-customer-store-credit-driver-in-memory.mjs","sources":["../../../libs/customer-store-credit/driver/in-memory/src/collection-name.const.ts","../../../libs/customer-store-credit/driver/in-memory/src/backend/store-credit.service.ts","../../../libs/customer-store-credit/driver/in-memory/src/driver/store-credit.service.ts","../../../libs/customer-store-credit/driver/in-memory/src/driver/driver.module.ts","../../../libs/customer-store-credit/driver/in-memory/src/daffodil-customer-store-credit-driver-in-memory.ts"],"sourcesContent":["export const DAFF_CUSTOMER_STORE_CREDIT_IN_MEMORY_COLLECTION_NAME = 'customer-store-credit';\n","import { Injectable } from '@angular/core';\nimport {\n InMemoryDbService,\n RequestInfoUtilities,\n ParsedRequestUrl,\n STATUS,\n RequestInfo,\n} from 'angular-in-memory-web-api';\n\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\nimport { DaffCustomerStoreCreditFactory } from '@daffodil/customer-store-credit/testing';\nimport { DaffInMemorySingleRouteableBackend } from '@daffodil/driver/in-memory';\n\nimport { DAFF_CUSTOMER_STORE_CREDIT_IN_MEMORY_COLLECTION_NAME } from '../collection-name.const';\n\n/**\n * An in-memory service that handles customer store credit HTTP requests.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCustomerStoreCreditInMemoryBackendService implements InMemoryDbService, DaffInMemorySingleRouteableBackend {\n readonly collectionName = DAFF_CUSTOMER_STORE_CREDIT_IN_MEMORY_COLLECTION_NAME;\n\n storeCredit: DaffCustomerStoreCredit;\n\n constructor(\n private factory: DaffCustomerStoreCreditFactory,\n ) {\n this.storeCredit = this.factory.create();\n }\n\n /**\n * Automatically called as part of the InMemoryDbService to parse incoming urls to match the InMemory backend urls.\n *\n * @param url initial url\n * @param utils utility to parse url\n * @returns ParsedRequestUrl\n * @docs-private\n */\n parseRequestUrl(url: string, utils: RequestInfoUtilities): ParsedRequestUrl {\n return utils.parseRequestUrl(url);\n }\n\n /**\n * @docs-private\n */\n createDb(): any {\n return {\n storeCredit: this.storeCredit,\n };\n }\n\n /**\n * Gets the customer's store credit.\n *\n * @param reqInfo request object\n * @returns An http response object\n */\n get(reqInfo: RequestInfo) {\n return reqInfo.utils.createResponse$(() => ({\n status: STATUS.OK,\n body: this.storeCredit,\n }));\n }\n}\n","import { HttpClient } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { InMemoryBackendConfig } from 'angular-in-memory-web-api';\nimport { Observable } from 'rxjs';\n\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\nimport { DaffCustomerStoreCreditDriverInterface } from '@daffodil/customer-store-credit/driver';\nimport { DaffInMemoryDriverBase } from '@daffodil/driver/in-memory';\n\nimport { DAFF_CUSTOMER_STORE_CREDIT_IN_MEMORY_COLLECTION_NAME } from '../collection-name.const';\n\n/**\n * The customer store credit in-memory driver to mock the customer store credit backend service.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCustomerStoreCreditInMemoryDriver extends DaffInMemoryDriverBase implements DaffCustomerStoreCreditDriverInterface {\n constructor(\n private http: HttpClient,\n config: InMemoryBackendConfig,\n ) {\n super(config, DAFF_CUSTOMER_STORE_CREDIT_IN_MEMORY_COLLECTION_NAME);\n }\n\n get(): Observable<DaffCustomerStoreCredit> {\n return this.http.get<DaffCustomerStoreCredit>(this.url);\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport {
|
|
1
|
+
{"version":3,"file":"daffodil-customer-store-credit-driver-in-memory.mjs","sources":["../../../libs/customer-store-credit/driver/in-memory/src/collection-name.const.ts","../../../libs/customer-store-credit/driver/in-memory/src/backend/store-credit.service.ts","../../../libs/customer-store-credit/driver/in-memory/src/driver/store-credit.service.ts","../../../libs/customer-store-credit/driver/in-memory/src/driver/driver.module.ts","../../../libs/customer-store-credit/driver/in-memory/src/daffodil-customer-store-credit-driver-in-memory.ts"],"sourcesContent":["export const DAFF_CUSTOMER_STORE_CREDIT_IN_MEMORY_COLLECTION_NAME = 'customer-store-credit';\n","import { Injectable } from '@angular/core';\nimport {\n InMemoryDbService,\n RequestInfoUtilities,\n ParsedRequestUrl,\n STATUS,\n RequestInfo,\n} from 'angular-in-memory-web-api';\n\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\nimport { DaffCustomerStoreCreditFactory } from '@daffodil/customer-store-credit/testing';\nimport { DaffInMemorySingleRouteableBackend } from '@daffodil/driver/in-memory';\n\nimport { DAFF_CUSTOMER_STORE_CREDIT_IN_MEMORY_COLLECTION_NAME } from '../collection-name.const';\n\n/**\n * An in-memory service that handles customer store credit HTTP requests.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCustomerStoreCreditInMemoryBackendService implements InMemoryDbService, DaffInMemorySingleRouteableBackend {\n readonly collectionName = DAFF_CUSTOMER_STORE_CREDIT_IN_MEMORY_COLLECTION_NAME;\n\n storeCredit: DaffCustomerStoreCredit;\n\n constructor(\n private factory: DaffCustomerStoreCreditFactory,\n ) {\n this.storeCredit = this.factory.create();\n }\n\n /**\n * Automatically called as part of the InMemoryDbService to parse incoming urls to match the InMemory backend urls.\n *\n * @param url initial url\n * @param utils utility to parse url\n * @returns ParsedRequestUrl\n * @docs-private\n */\n parseRequestUrl(url: string, utils: RequestInfoUtilities): ParsedRequestUrl {\n return utils.parseRequestUrl(url);\n }\n\n /**\n * @docs-private\n */\n createDb(): any {\n return {\n storeCredit: this.storeCredit,\n };\n }\n\n /**\n * Gets the customer's store credit.\n *\n * @param reqInfo request object\n * @returns An http response object\n */\n get(reqInfo: RequestInfo) {\n return reqInfo.utils.createResponse$(() => ({\n status: STATUS.OK,\n body: this.storeCredit,\n }));\n }\n}\n","import { HttpClient } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { InMemoryBackendConfig } from 'angular-in-memory-web-api';\nimport { Observable } from 'rxjs';\n\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\nimport { DaffCustomerStoreCreditDriverInterface } from '@daffodil/customer-store-credit/driver';\nimport { DaffInMemoryDriverBase } from '@daffodil/driver/in-memory';\n\nimport { DAFF_CUSTOMER_STORE_CREDIT_IN_MEMORY_COLLECTION_NAME } from '../collection-name.const';\n\n/**\n * The customer store credit in-memory driver to mock the customer store credit backend service.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCustomerStoreCreditInMemoryDriver extends DaffInMemoryDriverBase implements DaffCustomerStoreCreditDriverInterface {\n constructor(\n private http: HttpClient,\n config: InMemoryBackendConfig,\n ) {\n super(config, DAFF_CUSTOMER_STORE_CREDIT_IN_MEMORY_COLLECTION_NAME);\n }\n\n get(): Observable<DaffCustomerStoreCredit> {\n return this.http.get<DaffCustomerStoreCredit>(this.url);\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { provideDaffCustomerStoreCreditDriver } from '@daffodil/customer-store-credit/driver';\nimport { provideDaffInMemoryBackends } from '@daffodil/driver/in-memory';\n\nimport { DaffCustomerStoreCreditInMemoryDriver } from './store-credit.service';\nimport { DaffCustomerStoreCreditInMemoryBackendService } from '../backend/store-credit.service';\n\n/**\n * Provides the {@link DaffCustomerStoreCreditInMemoryDriver} as the {@link DaffCustomerStoreCreditDriver}.\n */\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffCustomerStoreCreditInMemoryDriverModule {\n static forRoot(): ModuleWithProviders<DaffCustomerStoreCreditInMemoryDriverModule> {\n return {\n ngModule: DaffCustomerStoreCreditInMemoryDriverModule,\n providers: [\n provideDaffCustomerStoreCreditDriver(DaffCustomerStoreCreditInMemoryDriver),\n provideDaffInMemoryBackends(DaffCustomerStoreCreditInMemoryBackendService),\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;AAAO,MAAM,oDAAoD,GAAG,uBAAuB;;ACe3F;;AAEG;MAIU,6CAA6C,CAAA;AAKxD,IAAA,WAAA,CACU,OAAuC,EAAA;QAAvC,IAAO,CAAA,OAAA,GAAP,OAAO,CAAgC;QALxC,IAAc,CAAA,cAAA,GAAG,oDAAoD,CAAC;QAO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AA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,2CAA2C,YAHpD,YAAY,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAGH,2CAA2C,EAAA,UAAA,EAAA,CAAA;kBALvD,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACF,iBAAA,CAAA;;;ACnBD;;AAEG;;;;"}
|
|
@@ -2,13 +2,13 @@ import { DAFF_CUSTOMER_STORE_CREDIT_ORDER_TOTAL_TYPE } from '@daffodil/customer-
|
|
|
2
2
|
import * as i1 from 'apollo-angular';
|
|
3
3
|
import { gql } from 'apollo-angular';
|
|
4
4
|
import { magentoMoneyFragment, daffTransformMagentoError } from '@daffodil/driver/magento';
|
|
5
|
-
import { DaffCustomerStoreCreditDriverErrorMap, DaffCustomerStoreCreditInvalidAPIResponseError,
|
|
5
|
+
import { DaffCustomerStoreCreditDriverErrorMap, DaffCustomerStoreCreditInvalidAPIResponseError, provideDaffCustomerStoreCreditDriver } from '@daffodil/customer-store-credit/driver';
|
|
6
6
|
import * as i0 from '@angular/core';
|
|
7
7
|
import { Injectable, NgModule } from '@angular/core';
|
|
8
8
|
import { throwError } from 'rxjs';
|
|
9
9
|
import { map, catchError } from 'rxjs/operators';
|
|
10
10
|
import { CommonModule } from '@angular/common';
|
|
11
|
-
import {
|
|
11
|
+
import { provideDaffCustomerOrderMagentoExtraOrderFragments, provideDaffCustomerOrderMagentoExtraOrderTransforms } from '@daffodil/customer-order/driver/magento/2-4-6';
|
|
12
12
|
|
|
13
13
|
const magentoCustomerStoreCreditTransform = (storeCredit) => ({
|
|
14
14
|
balance: storeCredit.current_balance.value,
|
|
@@ -127,12 +127,9 @@ class DaffCustomerStoreCreditMagentoDriverModule {
|
|
|
127
127
|
return {
|
|
128
128
|
ngModule: DaffCustomerStoreCreditMagentoDriverModule,
|
|
129
129
|
providers: [
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
},
|
|
134
|
-
daffProvideCustomerOrderMagentoExtraOrderFragments(magentoCustomerOrderStoreCreditTotalFragment),
|
|
135
|
-
daffProvideCustomerOrderMagentoExtraOrderTransforms(magentoCustomerOrderWithStoreCreditTransform),
|
|
130
|
+
provideDaffCustomerStoreCreditDriver(DaffCustomerStoreCreditMagentoService),
|
|
131
|
+
provideDaffCustomerOrderMagentoExtraOrderFragments(magentoCustomerOrderStoreCreditTotalFragment),
|
|
132
|
+
provideDaffCustomerOrderMagentoExtraOrderTransforms(magentoCustomerOrderWithStoreCreditTransform),
|
|
136
133
|
],
|
|
137
134
|
};
|
|
138
135
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-customer-store-credit-driver-magento.mjs","sources":["../../../libs/customer-store-credit/driver/magento/src/transforms/responses/customer-store-credit.ts","../../../libs/customer-store-credit/driver/magento/src/transforms/responses/customer-order.ts","../../../libs/customer-store-credit/driver/magento/src/queries/fragments/store-credit.ts","../../../libs/customer-store-credit/driver/magento/src/queries/fragments/customer-order.ts","../../../libs/customer-store-credit/driver/magento/src/queries/get-store-credit.ts","../../../libs/customer-store-credit/driver/magento/src/errors/map.ts","../../../libs/customer-store-credit/driver/magento/src/errors/transform.ts","../../../libs/customer-store-credit/driver/magento/src/validators/get-customer-store-credit.ts","../../../libs/customer-store-credit/driver/magento/src/customer-store-credit.service.ts","../../../libs/customer-store-credit/driver/magento/src/driver.module.ts","../../../libs/customer-store-credit/driver/magento/src/daffodil-customer-store-credit-driver-magento.ts"],"sourcesContent":["import { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\n\nimport { MagentoCustomerStoreCredit } from '../../models/public_api';\n\nexport const magentoCustomerStoreCreditTransform = (storeCredit: MagentoCustomerStoreCredit): DaffCustomerStoreCredit => ({\n balance: storeCredit.current_balance.value,\n});\n","import { DaffMagentoCustomerOrderExtraTransform } from '@daffodil/customer-order/driver/magento/2-4-6';\nimport { DAFF_CUSTOMER_STORE_CREDIT_ORDER_TOTAL_TYPE } from '@daffodil/customer-store-credit';\nimport { DaffOrder } from '@daffodil/order';\n\nimport { MagentoCustomerOrderWithStoreCredit } from '../../models/public_api';\n\nexport const magentoCustomerOrderWithStoreCreditTransform: DaffMagentoCustomerOrderExtraTransform<MagentoCustomerOrderWithStoreCredit> = (daffOrder: DaffOrder, magentoOrder: MagentoCustomerOrderWithStoreCredit, email: string): DaffOrder => ({\n ...daffOrder,\n totals: [\n ...daffOrder.totals,\n {\n type: DAFF_CUSTOMER_STORE_CREDIT_ORDER_TOTAL_TYPE,\n label: 'Store Credit',\n value: magentoOrder.total?.total_store_credit.value,\n // before grand total and after tax\n sort_order: 35,\n },\n ].sort((a, b) => a.sort_order - b.sort_order),\n});\n","import { gql } from 'apollo-angular';\n\nimport { magentoMoneyFragment } from '@daffodil/driver/magento';\n\nexport const magentoCustomerStoreCreditFragment = gql`\n fragment magentoCustomerStoreCredit on CustomerStoreCredit {\n current_balance {\n ...moneyFragment\n }\n enabled\n }\n ${magentoMoneyFragment}\n`;\n","import { gql } from 'apollo-angular';\n\nimport { magentoMoneyFragment } from '@daffodil/driver/magento';\n\nexport const magentoCustomerOrderStoreCreditTotalFragment = gql`\n fragment magentoCustomerOrderStoreCreditTotal on CustomerOrder {\n total {\n total_store_credit {\n ...moneyFragment\n }\n }\n }\n ${magentoMoneyFragment}\n`;\n","import { gql } from 'apollo-angular';\n\nimport { magentoCustomerStoreCreditFragment } from './fragments/public_api';\n\nexport const MAGENTO_GET_CUSTOMER_STORE_CREDIT_QUERY_NAME = 'MagentoGetCustomerStoreCredit';\n\nexport const getCustomerStoreCredit = gql`\n query ${MAGENTO_GET_CUSTOMER_STORE_CREDIT_QUERY_NAME} {\n customer {\n store_credit {\n ...magentoCustomerStoreCredit\n }\n }\n }\n ${magentoCustomerStoreCreditFragment}\n`;\n","export const DaffCustomerStoreCreditMagentoErrorMessageRegexMap = {\n};\n","import { ApolloError } from '@apollo/client/core';\nimport { GraphQLError } from 'graphql';\n\nimport { DaffError } from '@daffodil/core';\nimport {\n DaffCustomerStoreCreditDriverErrorMap,\n DaffCustomerStoreCreditInvalidAPIResponseError,\n} from '@daffodil/customer-store-credit/driver';\nimport { daffTransformMagentoError } from '@daffodil/driver/magento';\n\nimport { DaffCustomerStoreCreditMagentoErrorMessageRegexMap } from './map';\n\n/**\n * Transforms a single GraphQL error.\n * Optionally accepts a request payload which can be used in certain cases\n * to add supplemental info to the error.\n */\nexport function transformMagentoCartGraphQlError(error: GraphQLError, requestPayload?: unknown): DaffError {\n // eslint-disable-next-line\n for (const code in DaffCustomerStoreCreditMagentoErrorMessageRegexMap) {\n const matchIndex = error.message.search(DaffCustomerStoreCreditMagentoErrorMessageRegexMap[code]);\n\n if (matchIndex > -1 && DaffCustomerStoreCreditDriverErrorMap[code]) {\n const errObj = new DaffCustomerStoreCreditDriverErrorMap[code](error.message);\n\n return errObj;\n }\n }\n\n return daffTransformMagentoError(error, {});\n};\n\nexport function transformMagentoReviewsError(error: any, requestPayload?: unknown) {\n if (error.graphQLErrors?.length) {\n return transformMagentoCartGraphQlError((<ApolloError>error).graphQLErrors[0], requestPayload);\n } else {\n return daffTransformMagentoError(error, {}) || new DaffCustomerStoreCreditInvalidAPIResponseError(error.message);\n }\n}\n","import { ApolloQueryResult } from '@apollo/client/core';\n\nimport { DaffCustomerStoreCreditInvalidAPIResponseError } from '@daffodil/customer-store-credit/driver';\n\nimport { MagentoGetCustomerStoreCreditResponse } from '../models/public_api';\n\nexport const validateGetCustomerStoreCreditResponse = (response: ApolloQueryResult<MagentoGetCustomerStoreCreditResponse>) => {\n if (response.data.customer?.store_credit?.enabled) {\n return response;\n } else {\n throw new DaffCustomerStoreCreditInvalidAPIResponseError('The store credit feature is not enabled on this platform.');\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 { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\nimport { DaffCustomerStoreCreditDriverInterface } from '@daffodil/customer-store-credit/driver';\n\nimport { transformMagentoReviewsError } from './errors/transform';\nimport { MagentoGetCustomerStoreCreditResponse } from './models/public_api';\nimport { getCustomerStoreCredit } from './queries/public_api';\nimport { magentoCustomerStoreCreditTransform } from './transforms/public_api';\nimport { validateGetCustomerStoreCreditResponse } from './validators/public_api';\n\n/**\n * A service for making Magento GraphQL queries for customers.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCustomerStoreCreditMagentoService implements DaffCustomerStoreCreditDriverInterface {\n constructor(\n private apollo: Apollo,\n ) {}\n\n get(): Observable<DaffCustomerStoreCredit> {\n return this.apollo.query<MagentoGetCustomerStoreCreditResponse>({\n query: getCustomerStoreCredit,\n }).pipe(\n map(validateGetCustomerStoreCreditResponse),\n map((response) => magentoCustomerStoreCreditTransform(response.data.customer.store_credit)),\n catchError(err => throwError(() => transformMagentoReviewsError(err))),\n );\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport {\n daffProvideCustomerOrderMagentoExtraOrderFragments,\n daffProvideCustomerOrderMagentoExtraOrderTransforms,\n} from '@daffodil/customer-order/driver/magento/2-4-6';\nimport { DaffCustomerStoreCreditDriver } from '@daffodil/customer-store-credit/driver';\n\nimport { DaffCustomerStoreCreditMagentoService } from './customer-store-credit.service';\nimport { magentoCustomerOrderStoreCreditTotalFragment } from './queries/public_api';\nimport { magentoCustomerOrderWithStoreCreditTransform } from './transforms/public_api';\n\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffCustomerStoreCreditMagentoDriverModule {\n static forRoot(): ModuleWithProviders<DaffCustomerStoreCreditMagentoDriverModule> {\n return {\n ngModule: DaffCustomerStoreCreditMagentoDriverModule,\n providers: [\n {\n provide: DaffCustomerStoreCreditDriver,\n useExisting: DaffCustomerStoreCreditMagentoService,\n },\n daffProvideCustomerOrderMagentoExtraOrderFragments(\n magentoCustomerOrderStoreCreditTotalFragment,\n ),\n daffProvideCustomerOrderMagentoExtraOrderTransforms(\n magentoCustomerOrderWithStoreCreditTransform,\n ),\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;MAIa,mCAAmC,GAAG,CAAC,WAAuC,MAA+B;AACxH,IAAA,OAAO,EAAE,WAAW,CAAC,eAAe,CAAC,KAAK;AAC3C,CAAA;;ACAM,MAAM,4CAA4C,GAAgF,CAAC,SAAoB,EAAE,YAAiD,EAAE,KAAa,MAAiB;AAC/O,IAAA,GAAG,SAAS;AACZ,IAAA,MAAM,EAAE;QACN,GAAG,SAAS,CAAC,MAAM;AACnB,QAAA;AACE,YAAA,IAAI,EAAE,2CAA2C;AACjD,YAAA,KAAK,EAAE,cAAc;AACrB,YAAA,KAAK,EAAE,YAAY,CAAC,KAAK,EAAE,kBAAkB,CAAC,KAAK;;AAEnD,YAAA,UAAU,EAAE,EAAE;AACf,SAAA;AACF,KAAA,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC,UAAU,CAAC;AAC9C,CAAA;;ACdM,MAAM,kCAAkC,GAAG,GAAG,CAAA,CAAA;;;;;;;IAOjD,oBAAoB,CAAA;;;ACPjB,MAAM,4CAA4C,GAAG,GAAG,CAAA,CAAA;;;;;;;;IAQ3D,oBAAoB,CAAA;;;ACRjB,MAAM,4CAA4C,GAAG,gCAAgC;AAErF,MAAM,sBAAsB,GAAG,GAAG,CAAA,CAAA;UAC/B,4CAA4C,CAAA;;;;;;;IAOlD,kCAAkC,CAAA;;;ACd/B,MAAM,kDAAkD,GAAG,EACjE;;ACWD;;;;AAIG;AACa,SAAA,gC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A,CAAA,CAAA,EAAA;AAA1C,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,0CAA0C,YAHnD,YAAY,CAAA,EAAA,CAAA,CAAA,EAAA;AAGH,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,0CAA0C,YAHnD,YAAY,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAGH,0CAA0C,EAAA,UAAA,EAAA,CAAA;kBALtD,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACF,iBAAA,CAAA;;;ACpBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"daffodil-customer-store-credit-driver-magento.mjs","sources":["../../../libs/customer-store-credit/driver/magento/src/transforms/responses/customer-store-credit.ts","../../../libs/customer-store-credit/driver/magento/src/transforms/responses/customer-order.ts","../../../libs/customer-store-credit/driver/magento/src/queries/fragments/store-credit.ts","../../../libs/customer-store-credit/driver/magento/src/queries/fragments/customer-order.ts","../../../libs/customer-store-credit/driver/magento/src/queries/get-store-credit.ts","../../../libs/customer-store-credit/driver/magento/src/errors/map.ts","../../../libs/customer-store-credit/driver/magento/src/errors/transform.ts","../../../libs/customer-store-credit/driver/magento/src/validators/get-customer-store-credit.ts","../../../libs/customer-store-credit/driver/magento/src/customer-store-credit.service.ts","../../../libs/customer-store-credit/driver/magento/src/driver.module.ts","../../../libs/customer-store-credit/driver/magento/src/daffodil-customer-store-credit-driver-magento.ts"],"sourcesContent":["import { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\n\nimport { MagentoCustomerStoreCredit } from '../../models/public_api';\n\nexport const magentoCustomerStoreCreditTransform = (storeCredit: MagentoCustomerStoreCredit): DaffCustomerStoreCredit => ({\n balance: storeCredit.current_balance.value,\n});\n","import { DaffMagentoCustomerOrderExtraTransform } from '@daffodil/customer-order/driver/magento/2-4-6';\nimport { DAFF_CUSTOMER_STORE_CREDIT_ORDER_TOTAL_TYPE } from '@daffodil/customer-store-credit';\nimport { DaffOrder } from '@daffodil/order';\n\nimport { MagentoCustomerOrderWithStoreCredit } from '../../models/public_api';\n\nexport const magentoCustomerOrderWithStoreCreditTransform: DaffMagentoCustomerOrderExtraTransform<MagentoCustomerOrderWithStoreCredit> = (daffOrder: DaffOrder, magentoOrder: MagentoCustomerOrderWithStoreCredit, email: string): DaffOrder => ({\n ...daffOrder,\n totals: [\n ...daffOrder.totals,\n {\n type: DAFF_CUSTOMER_STORE_CREDIT_ORDER_TOTAL_TYPE,\n label: 'Store Credit',\n value: magentoOrder.total?.total_store_credit.value,\n // before grand total and after tax\n sort_order: 35,\n },\n ].sort((a, b) => a.sort_order - b.sort_order),\n});\n","import { gql } from 'apollo-angular';\n\nimport { magentoMoneyFragment } from '@daffodil/driver/magento';\n\nexport const magentoCustomerStoreCreditFragment = gql`\n fragment magentoCustomerStoreCredit on CustomerStoreCredit {\n current_balance {\n ...moneyFragment\n }\n enabled\n }\n ${magentoMoneyFragment}\n`;\n","import { gql } from 'apollo-angular';\n\nimport { magentoMoneyFragment } from '@daffodil/driver/magento';\n\nexport const magentoCustomerOrderStoreCreditTotalFragment = gql`\n fragment magentoCustomerOrderStoreCreditTotal on CustomerOrder {\n total {\n total_store_credit {\n ...moneyFragment\n }\n }\n }\n ${magentoMoneyFragment}\n`;\n","import { gql } from 'apollo-angular';\n\nimport { magentoCustomerStoreCreditFragment } from './fragments/public_api';\n\nexport const MAGENTO_GET_CUSTOMER_STORE_CREDIT_QUERY_NAME = 'MagentoGetCustomerStoreCredit';\n\nexport const getCustomerStoreCredit = gql`\n query ${MAGENTO_GET_CUSTOMER_STORE_CREDIT_QUERY_NAME} {\n customer {\n store_credit {\n ...magentoCustomerStoreCredit\n }\n }\n }\n ${magentoCustomerStoreCreditFragment}\n`;\n","export const DaffCustomerStoreCreditMagentoErrorMessageRegexMap = {\n};\n","import { ApolloError } from '@apollo/client/core';\nimport { GraphQLError } from 'graphql';\n\nimport { DaffError } from '@daffodil/core';\nimport {\n DaffCustomerStoreCreditDriverErrorMap,\n DaffCustomerStoreCreditInvalidAPIResponseError,\n} from '@daffodil/customer-store-credit/driver';\nimport { daffTransformMagentoError } from '@daffodil/driver/magento';\n\nimport { DaffCustomerStoreCreditMagentoErrorMessageRegexMap } from './map';\n\n/**\n * Transforms a single GraphQL error.\n * Optionally accepts a request payload which can be used in certain cases\n * to add supplemental info to the error.\n */\nexport function transformMagentoCartGraphQlError(error: GraphQLError, requestPayload?: unknown): DaffError {\n // eslint-disable-next-line\n for (const code in DaffCustomerStoreCreditMagentoErrorMessageRegexMap) {\n const matchIndex = error.message.search(DaffCustomerStoreCreditMagentoErrorMessageRegexMap[code]);\n\n if (matchIndex > -1 && DaffCustomerStoreCreditDriverErrorMap[code]) {\n const errObj = new DaffCustomerStoreCreditDriverErrorMap[code](error.message);\n\n return errObj;\n }\n }\n\n return daffTransformMagentoError(error, {});\n};\n\nexport function transformMagentoReviewsError(error: any, requestPayload?: unknown) {\n if (error.graphQLErrors?.length) {\n return transformMagentoCartGraphQlError((<ApolloError>error).graphQLErrors[0], requestPayload);\n } else {\n return daffTransformMagentoError(error, {}) || new DaffCustomerStoreCreditInvalidAPIResponseError(error.message);\n }\n}\n","import { ApolloQueryResult } from '@apollo/client/core';\n\nimport { DaffCustomerStoreCreditInvalidAPIResponseError } from '@daffodil/customer-store-credit/driver';\n\nimport { MagentoGetCustomerStoreCreditResponse } from '../models/public_api';\n\nexport const validateGetCustomerStoreCreditResponse = (response: ApolloQueryResult<MagentoGetCustomerStoreCreditResponse>) => {\n if (response.data.customer?.store_credit?.enabled) {\n return response;\n } else {\n throw new DaffCustomerStoreCreditInvalidAPIResponseError('The store credit feature is not enabled on this platform.');\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 { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\nimport { DaffCustomerStoreCreditDriverInterface } from '@daffodil/customer-store-credit/driver';\n\nimport { transformMagentoReviewsError } from './errors/transform';\nimport { MagentoGetCustomerStoreCreditResponse } from './models/public_api';\nimport { getCustomerStoreCredit } from './queries/public_api';\nimport { magentoCustomerStoreCreditTransform } from './transforms/public_api';\nimport { validateGetCustomerStoreCreditResponse } from './validators/public_api';\n\n/**\n * A service for making Magento GraphQL queries for customers.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCustomerStoreCreditMagentoService implements DaffCustomerStoreCreditDriverInterface {\n constructor(\n private apollo: Apollo,\n ) {}\n\n get(): Observable<DaffCustomerStoreCredit> {\n return this.apollo.query<MagentoGetCustomerStoreCreditResponse>({\n query: getCustomerStoreCredit,\n }).pipe(\n map(validateGetCustomerStoreCreditResponse),\n map((response) => magentoCustomerStoreCreditTransform(response.data.customer.store_credit)),\n catchError(err => throwError(() => transformMagentoReviewsError(err))),\n );\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport {\n provideDaffCustomerOrderMagentoExtraOrderFragments,\n provideDaffCustomerOrderMagentoExtraOrderTransforms,\n} from '@daffodil/customer-order/driver/magento/2-4-6';\nimport { provideDaffCustomerStoreCreditDriver } from '@daffodil/customer-store-credit/driver';\n\nimport { DaffCustomerStoreCreditMagentoService } from './customer-store-credit.service';\nimport { magentoCustomerOrderStoreCreditTotalFragment } from './queries/public_api';\nimport { magentoCustomerOrderWithStoreCreditTransform } from './transforms/public_api';\n\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffCustomerStoreCreditMagentoDriverModule {\n static forRoot(): ModuleWithProviders<DaffCustomerStoreCreditMagentoDriverModule> {\n return {\n ngModule: DaffCustomerStoreCreditMagentoDriverModule,\n providers: [\n provideDaffCustomerStoreCreditDriver(DaffCustomerStoreCreditMagentoService),\n provideDaffCustomerOrderMagentoExtraOrderFragments(\n magentoCustomerOrderStoreCreditTotalFragment,\n ),\n provideDaffCustomerOrderMagentoExtraOrderTransforms(\n magentoCustomerOrderWithStoreCreditTransform,\n ),\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;MAIa,mCAAmC,GAAG,CAAC,WAAuC,MAA+B;AACxH,IAAA,OAAO,EAAE,WAAW,CAAC,eAAe,CAAC,KAAK;AAC3C,CAAA;;ACAM,MAAM,4CAA4C,GAAgF,CAAC,SAAoB,EAAE,YAAiD,EAAE,KAAa,MAAiB;AAC/O,IAAA,GAAG,SAAS;AACZ,IAAA,MAAM,EAAE;QACN,GAAG,SAAS,CAAC,MAAM;AACnB,QAAA;AACE,YAAA,IAAI,EAAE,2CAA2C;AACjD,YAAA,KAAK,EAAE,cAAc;AACrB,YAAA,KAAK,EAAE,YAAY,CAAC,KAAK,EAAE,kBAAkB,CAAC,KAAK;;AAEnD,YAAA,UAAU,EAAE,EAAE;AACf,SAAA;AACF,KAAA,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC,UAAU,CAAC;AAC9C,CAAA;;ACdM,MAAM,kCAAkC,GAAG,GAAG,CAAA,CAAA;;;;;;;IAOjD,oBAAoB,CAAA;;;ACPjB,MAAM,4CAA4C,GAAG,GAAG,CAAA,CAAA;;;;;;;;IAQ3D,oBAAoB,CAAA;;;ACRjB,MAAM,4CAA4C,GAAG,gCAAgC;AAErF,MAAM,sBAAsB,GAAG,GAAG,CAAA,CAAA;UAC/B,4CAA4C,CAAA;;;;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A,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;AAA1C,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,0CAA0C,YAHnD,YAAY,CAAA,EAAA,CAAA,CAAA,EAAA;AAGH,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,0CAA0C,YAHnD,YAAY,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAGH,0CAA0C,EAAA,UAAA,EAAA,CAAA;kBALtD,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACF,iBAAA,CAAA;;;ACpBD;;AAEG;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CommonModule } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { Injectable, NgModule } from '@angular/core';
|
|
4
|
-
import {
|
|
4
|
+
import { provideDaffCustomerStoreCreditDriver } from '@daffodil/customer-store-credit/driver';
|
|
5
5
|
import { of } from 'rxjs';
|
|
6
6
|
import * as i1 from '@daffodil/customer-store-credit/testing';
|
|
7
7
|
|
|
@@ -36,10 +36,7 @@ class DaffCustomerStoreCreditTestingDriverModule {
|
|
|
36
36
|
return {
|
|
37
37
|
ngModule: DaffCustomerStoreCreditTestingDriverModule,
|
|
38
38
|
providers: [
|
|
39
|
-
|
|
40
|
-
provide: DaffCustomerStoreCreditDriver,
|
|
41
|
-
useExisting: DaffCustomerStoreCreditTestingDriver,
|
|
42
|
-
},
|
|
39
|
+
provideDaffCustomerStoreCreditDriver(DaffCustomerStoreCreditTestingDriver),
|
|
43
40
|
],
|
|
44
41
|
};
|
|
45
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-customer-store-credit-driver-testing.mjs","sources":["../../../libs/customer-store-credit/driver/testing/src/drivers/store-credit.service.ts","../../../libs/customer-store-credit/driver/testing/src/drivers/driver.module.ts","../../../libs/customer-store-credit/driver/testing/src/daffodil-customer-store-credit-driver-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n Observable,\n of,\n} from 'rxjs';\n\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\nimport { DaffCustomerStoreCreditDriverInterface } from '@daffodil/customer-store-credit/driver';\nimport { DaffCustomerStoreCreditFactory } from '@daffodil/customer-store-credit/testing';\n\n/**\n * A basic customer driver that creates mock customer results of different kinds.\n * For testing purposes.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCustomerStoreCreditTestingDriver implements DaffCustomerStoreCreditDriverInterface {\n constructor(\n private factory: DaffCustomerStoreCreditFactory,\n ) {}\n\n get(): Observable<DaffCustomerStoreCredit> {\n return of(this.factory.create());\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport {
|
|
1
|
+
{"version":3,"file":"daffodil-customer-store-credit-driver-testing.mjs","sources":["../../../libs/customer-store-credit/driver/testing/src/drivers/store-credit.service.ts","../../../libs/customer-store-credit/driver/testing/src/drivers/driver.module.ts","../../../libs/customer-store-credit/driver/testing/src/daffodil-customer-store-credit-driver-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n Observable,\n of,\n} from 'rxjs';\n\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\nimport { DaffCustomerStoreCreditDriverInterface } from '@daffodil/customer-store-credit/driver';\nimport { DaffCustomerStoreCreditFactory } from '@daffodil/customer-store-credit/testing';\n\n/**\n * A basic customer driver that creates mock customer results of different kinds.\n * For testing purposes.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCustomerStoreCreditTestingDriver implements DaffCustomerStoreCreditDriverInterface {\n constructor(\n private factory: DaffCustomerStoreCreditFactory,\n ) {}\n\n get(): Observable<DaffCustomerStoreCredit> {\n return of(this.factory.create());\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { provideDaffCustomerStoreCreditDriver } from '@daffodil/customer-store-credit/driver';\n\nimport { DaffCustomerStoreCreditTestingDriver } from './store-credit.service';\n\n/**\n * Provides the {@link DaffCustomerStoreCreditTestingDriver} as the {@link DaffCustomerStoreCreditDriver}.\n */\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffCustomerStoreCreditTestingDriverModule {\n static forRoot(): ModuleWithProviders<DaffCustomerStoreCreditTestingDriverModule> {\n return {\n ngModule: DaffCustomerStoreCreditTestingDriverModule,\n providers: [\n provideDaffCustomerStoreCreditDriver(DaffCustomerStoreCreditTestingDriver),\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAUA;;;;;AAKG;MAIU,oCAAoC,CAAA;AAC/C,IAAA,WAAA,CACU,OAAuC,EAAA;QAAvC,IAAO,CAAA,OAAA,GAAP,OAAO,CAAgC;KAC7C;IAEJ,GAAG,GAAA;QACD,OAAO,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;KAClC;iIAPU,oCAAoC,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA,EAAA;AAApC,uBAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAA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|
+
import { createSingletonInjectionToken, DaffInheritableError } from '@daffodil/core';
|
|
3
2
|
|
|
3
|
+
const {
|
|
4
4
|
/**
|
|
5
5
|
* An injection token for the customer store credit driver.
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
token: DaffCustomerStoreCreditDriver,
|
|
8
|
+
/**
|
|
9
|
+
* Provider function for {@link DaffCustomerStoreCreditDriver}.
|
|
10
|
+
*/
|
|
11
|
+
provider: provideDaffCustomerStoreCreditDriver, } = createSingletonInjectionToken('DaffCustomerStoreCreditDriver');
|
|
8
12
|
|
|
9
13
|
const DAFF_CUSTOMER_STORE_CREDIT_INVALID_API_RESPONSE_ERROR_CODE = 'DAFF_CUSTOMER_STORE_CREDIT_INVALID_API_RESPONSE';
|
|
10
14
|
/**
|
|
@@ -33,5 +37,5 @@ const DaffCustomerStoreCreditDriverErrorCodes = {
|
|
|
33
37
|
* Generated bundle index. Do not edit.
|
|
34
38
|
*/
|
|
35
39
|
|
|
36
|
-
export { DAFF_CUSTOMER_STORE_CREDIT_INVALID_API_RESPONSE_ERROR_CODE, DaffCustomerStoreCreditDriver, DaffCustomerStoreCreditDriverErrorCodes, DaffCustomerStoreCreditDriverErrorMap, DaffCustomerStoreCreditInvalidAPIResponseError };
|
|
40
|
+
export { DAFF_CUSTOMER_STORE_CREDIT_INVALID_API_RESPONSE_ERROR_CODE, DaffCustomerStoreCreditDriver, DaffCustomerStoreCreditDriverErrorCodes, DaffCustomerStoreCreditDriverErrorMap, DaffCustomerStoreCreditInvalidAPIResponseError, provideDaffCustomerStoreCreditDriver };
|
|
37
41
|
//# sourceMappingURL=daffodil-customer-store-credit-driver.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-customer-store-credit-driver.mjs","sources":["../../../libs/customer-store-credit/driver/src/interfaces/store-credit-service.interface.ts","../../../libs/customer-store-credit/driver/src/errors/invalid-api-response.ts","../../../libs/customer-store-credit/driver/src/errors/map.ts","../../../libs/customer-store-credit/driver/src/errors/codes.ts","../../../libs/customer-store-credit/driver/src/daffodil-customer-store-credit-driver.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"daffodil-customer-store-credit-driver.mjs","sources":["../../../libs/customer-store-credit/driver/src/interfaces/store-credit-service.interface.ts","../../../libs/customer-store-credit/driver/src/errors/invalid-api-response.ts","../../../libs/customer-store-credit/driver/src/errors/map.ts","../../../libs/customer-store-credit/driver/src/errors/codes.ts","../../../libs/customer-store-credit/driver/src/daffodil-customer-store-credit-driver.ts"],"sourcesContent":["import { Observable } from 'rxjs';\n\nimport { createSingletonInjectionToken } from '@daffodil/core';\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\n\nexport const {\n /**\n * An injection token for the customer store credit driver.\n */\n token: DaffCustomerStoreCreditDriver,\n /**\n * Provider function for {@link DaffCustomerStoreCreditDriver}.\n */\n provider: provideDaffCustomerStoreCreditDriver,\n} = createSingletonInjectionToken<DaffCustomerStoreCreditDriverInterface>('DaffCustomerStoreCreditDriver');\n\n/**\n * The customer store credit driver is responsible for loading customers.\n */\nexport interface DaffCustomerStoreCreditDriverInterface<\n TStoreCredit extends DaffCustomerStoreCredit = DaffCustomerStoreCredit,\n> {\n /**\n * Get the customer's store credit.\n */\n get(): Observable<TStoreCredit>;\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nexport const DAFF_CUSTOMER_STORE_CREDIT_INVALID_API_RESPONSE_ERROR_CODE = 'DAFF_CUSTOMER_STORE_CREDIT_INVALID_API_RESPONSE';\n\n/**\n * A general error indicating that the platform returned a response which cannot be processed.\n */\nexport class DaffCustomerStoreCreditInvalidAPIResponseError extends DaffInheritableError implements DaffError {\n public readonly code: string = DAFF_CUSTOMER_STORE_CREDIT_INVALID_API_RESPONSE_ERROR_CODE;\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import {\n DaffCustomerStoreCreditInvalidAPIResponseError,\n DAFF_CUSTOMER_STORE_CREDIT_INVALID_API_RESPONSE_ERROR_CODE,\n} from './invalid-api-response';\n\n/**\n * A mapping from error codes to error class constructors.\n */\nexport const DaffCustomerStoreCreditDriverErrorMap = {\n [DAFF_CUSTOMER_STORE_CREDIT_INVALID_API_RESPONSE_ERROR_CODE]: DaffCustomerStoreCreditInvalidAPIResponseError,\n};\n","import { DAFF_CUSTOMER_STORE_CREDIT_INVALID_API_RESPONSE_ERROR_CODE } from './invalid-api-response';\n\nexport const DaffCustomerStoreCreditDriverErrorCodes = {\n INVALID_API_RESPONSE: DAFF_CUSTOMER_STORE_CREDIT_INVALID_API_RESPONSE_ERROR_CODE,\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAKa,MAAA;AACX;;AAEG;AACH,KAAK,EAAE,6BAA6B;AACpC;;AAEG;AACH,QAAQ,EAAE,oCAAoC,GAC/C,GAAG,6BAA6B,CAAyC,+BAA+B;;ACTlG,MAAM,0DAA0D,GAAG,kDAAkD;AAE5H;;AAEG;AACG,MAAO,8CAA+C,SAAQ,oBAAoB,CAAA;AAGtF,IAAA,WAAA,CAAmB,OAAe,EAAA;QAChC,KAAK,CAAC,OAAO,CAAC,CAAC;QADE,IAAO,CAAA,OAAA,GAAP,OAAO,CAAQ;QAFlB,IAAI,CAAA,IAAA,GAAW,0DAA0D,CAAC;KAIzF;AACF;;ACXD;;AAEG;AACU,MAAA,qCAAqC,GAAG;IACnD,CAAC,0DAA0D,GAAG,8CAA8C;;;ACPjG,MAAA,uCAAuC,GAAG;AACrD,IAAA,oBAAoB,EAAE,0DAA0D;;;ACHlF;;AAEG;;;;"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { InjectionToken, Injectable, Inject, inject, NgModule } from '@angular/core';
|
|
1
|
+
import { createMultiInjectionToken, createSingleInjectionToken } from '@daffodil/core';
|
|
3
2
|
import { daffOperationInitialState, daffOperationFailed, daffCompleteOperation, daffStartResolution, daffOperationStateSelectorFactory, daffTransformErrorToStateError, daffComposeReducers } from '@daffodil/core/state';
|
|
4
3
|
import * as i1 from '@ngrx/store';
|
|
5
4
|
import { createFeatureSelector, createSelector, select, combineReducers, StoreModule } from '@ngrx/store';
|
|
5
|
+
import * as i0 from '@angular/core';
|
|
6
|
+
import { Injectable, Inject, inject, NgModule } from '@angular/core';
|
|
6
7
|
import * as i1$1 from '@ngrx/effects';
|
|
7
8
|
import { createEffect, ofType, EffectsModule } from '@ngrx/effects';
|
|
8
9
|
import { of } from 'rxjs';
|
|
@@ -59,15 +60,13 @@ class DaffCustomerStoreCreditClearErrors {
|
|
|
59
60
|
*/
|
|
60
61
|
const DAFF_CUSTOMER_STORE_CREDIT_STORE_FEATURE_KEY = 'daffCustomerStoreCredit';
|
|
61
62
|
|
|
63
|
+
const {
|
|
62
64
|
/**
|
|
63
65
|
* A token to hold the injectable extra reducers.
|
|
64
66
|
*
|
|
65
67
|
* Prefer using {@link daffCustomerStoreCreditProvideExtraReducers}.
|
|
66
68
|
*/
|
|
67
|
-
|
|
68
|
-
factory: () => [],
|
|
69
|
-
providedIn: 'any',
|
|
70
|
-
});
|
|
69
|
+
token: DAFF_CUSTOMER_STORE_CREDIT_EXTRA_REDUCERS,
|
|
71
70
|
/**
|
|
72
71
|
* Provides additional reducers that run after the standard Daffodil customer reducers.
|
|
73
72
|
*
|
|
@@ -80,13 +79,7 @@ const DAFF_CUSTOMER_STORE_CREDIT_EXTRA_REDUCERS = new InjectionToken('DAFF_CUSTO
|
|
|
80
79
|
* ]
|
|
81
80
|
* ```
|
|
82
81
|
*/
|
|
83
|
-
|
|
84
|
-
return reducers.map(reducer => ({
|
|
85
|
-
provide: DAFF_CUSTOMER_STORE_CREDIT_EXTRA_REDUCERS,
|
|
86
|
-
useValue: reducer,
|
|
87
|
-
multi: true,
|
|
88
|
-
}));
|
|
89
|
-
}
|
|
82
|
+
provider: daffCustomerStoreCreditProvideExtraReducers, } = createMultiInjectionToken('DAFF_CUSTOMER_STORE_CREDIT_EXTRA_REDUCERS', { providedIn: 'any' });
|
|
90
83
|
|
|
91
84
|
/**
|
|
92
85
|
* The initial state for the main customer store credit state, see {@link DaffCustomerStoreCreditReducerState}.
|
|
@@ -172,11 +165,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
172
165
|
}]
|
|
173
166
|
}], ctorParameters: () => [{ type: i1.Store }] });
|
|
174
167
|
|
|
168
|
+
const {
|
|
175
169
|
/**
|
|
176
170
|
* Transforms `DaffError`s into `DaffStateError`s before they are serialized into state.
|
|
177
171
|
* Can be used to further refine Daffodil errors into more specific app errors.
|
|
178
172
|
*/
|
|
179
|
-
|
|
173
|
+
token: DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER,
|
|
174
|
+
/**
|
|
175
|
+
* Provider function for {@link DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER}.
|
|
176
|
+
*/
|
|
177
|
+
provider: provideDaffCustomerStoreCreditErrorMatcher, } = createSingleInjectionToken('DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER', { factory: () => daffTransformErrorToStateError });
|
|
180
178
|
|
|
181
179
|
class DaffCustomerStoreCreditEffects {
|
|
182
180
|
constructor(actions$, driver, errorMatcher) {
|
|
@@ -198,13 +196,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
198
196
|
args: [DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER]
|
|
199
197
|
}] }] });
|
|
200
198
|
|
|
199
|
+
const {
|
|
201
200
|
/**
|
|
202
201
|
* An internal token to hold the Daffodil customer reducers.
|
|
203
202
|
* Includes the extra and standard reducers.
|
|
204
203
|
*
|
|
205
204
|
* @docs-private
|
|
206
205
|
*/
|
|
207
|
-
|
|
206
|
+
token: DAFF_CUSTOMER_STORE_CREDIT_REDUCERS,
|
|
207
|
+
/**
|
|
208
|
+
* Provider function for {@link DAFF_CUSTOMER_STORE_CREDIT_REDUCERS}.
|
|
209
|
+
*/
|
|
210
|
+
provider: provideDaffCustomerStoreCreditReducers, } = createSingleInjectionToken('DAFF_CUSTOMER_STORE_CREDIT_REDUCERS', {
|
|
208
211
|
providedIn: 'any',
|
|
209
212
|
factory: () => daffComposeReducers([
|
|
210
213
|
combineReducers({
|
|
@@ -241,5 +244,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
241
244
|
* Generated bundle index. Do not edit.
|
|
242
245
|
*/
|
|
243
246
|
|
|
244
|
-
export { DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER, DAFF_CUSTOMER_STORE_CREDIT_EXTRA_REDUCERS, DAFF_CUSTOMER_STORE_CREDIT_STORE_FEATURE_KEY, DaffCustomerStoreCreditActionTypes, DaffCustomerStoreCreditClearErrors, DaffCustomerStoreCreditLoad, DaffCustomerStoreCreditLoadFailure, DaffCustomerStoreCreditLoadSuccess, DaffCustomerStoreCreditPageFacade, DaffCustomerStoreCreditStateModule, daffCustomerStoreCreditGetSelectors, daffCustomerStoreCreditInitialState, daffCustomerStoreCreditProvideExtraReducers, daffCustomerStoreCreditReducer, getDaffCustomerStoreCreditReducersStateSelector };
|
|
247
|
+
export { DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER, DAFF_CUSTOMER_STORE_CREDIT_EXTRA_REDUCERS, DAFF_CUSTOMER_STORE_CREDIT_STORE_FEATURE_KEY, DaffCustomerStoreCreditActionTypes, DaffCustomerStoreCreditClearErrors, DaffCustomerStoreCreditLoad, DaffCustomerStoreCreditLoadFailure, DaffCustomerStoreCreditLoadSuccess, DaffCustomerStoreCreditPageFacade, DaffCustomerStoreCreditStateModule, daffCustomerStoreCreditGetSelectors, daffCustomerStoreCreditInitialState, daffCustomerStoreCreditProvideExtraReducers, daffCustomerStoreCreditReducer, getDaffCustomerStoreCreditReducersStateSelector, provideDaffCustomerStoreCreditErrorMatcher };
|
|
245
248
|
//# sourceMappingURL=daffodil-customer-store-credit-state.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-customer-store-credit-state.mjs","sources":["../../../libs/customer-store-credit/state/src/actions/store-credit.actions.ts","../../../libs/customer-store-credit/state/src/reducers/store-feature-key.ts","../../../libs/customer-store-credit/state/src/reducers/token/extra.token.ts","../../../libs/customer-store-credit/state/src/reducers/store-credit/initial-state.ts","../../../libs/customer-store-credit/state/src/reducers/store-credit/reducer.ts","../../../libs/customer-store-credit/state/src/selectors/feature.selector.ts","../../../libs/customer-store-credit/state/src/selectors/store-credit/selector.ts","../../../libs/customer-store-credit/state/src/facades/store-credit/facade.ts","../../../libs/customer-store-credit/state/src/injection-tokens/error-matcher.token.ts","../../../libs/customer-store-credit/state/src/effects/store-credit.effects.ts","../../../libs/customer-store-credit/state/src/reducers/token/reducers.token.ts","../../../libs/customer-store-credit/state/src/state.module.ts","../../../libs/customer-store-credit/state/src/daffodil-customer-store-credit-state.ts"],"sourcesContent":["import { Action } from '@ngrx/store';\n\nimport { DaffIdentifiable } from '@daffodil/core';\nimport { DaffStateError } from '@daffodil/core/state';\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\n\n/**\n * The customer store credit action types enum.\n */\nexport enum DaffCustomerStoreCreditActionTypes {\n StoreCreditLoadAction = '[@daffodil/customer-store-credit] Store Credit Load Action',\n StoreCreditLoadSuccessAction = '[@daffodil/customer-store-credit] Store Credit Load Success Action',\n StoreCreditLoadFailureAction = '[@daffodil/customer-store-credit] Store Credit Load Failure Action',\n StoreCreditClearErrorsAction = '[@daffodil/customer-store-credit] Store Credit Clear Errors Action',\n}\n\n/**\n * Loads the store credit of the current customer.\n */\nexport class DaffCustomerStoreCreditLoad implements Action {\n readonly type = DaffCustomerStoreCreditActionTypes.StoreCreditLoadAction;\n}\n\n/**\n * Indicates a successful load of the customer's store credit.\n */\nexport class DaffCustomerStoreCreditLoadSuccess<T extends DaffCustomerStoreCredit = DaffCustomerStoreCredit> implements Action {\n readonly type = DaffCustomerStoreCreditActionTypes.StoreCreditLoadSuccessAction;\n\n constructor(public payload: T) {}\n}\n\n/**\n * A failed customer store credit load with the error message.\n */\nexport class DaffCustomerStoreCreditLoadFailure implements Action {\n readonly type = DaffCustomerStoreCreditActionTypes.StoreCreditLoadFailureAction;\n\n constructor(public payload: DaffStateError) {}\n}\n\n/**\n * An action to clear all errors in state.\n */\nexport class DaffCustomerStoreCreditClearErrors implements Action {\n readonly type = DaffCustomerStoreCreditActionTypes.StoreCreditClearErrorsAction;\n}\n\n/**\n * A union of the customer action types.\n */\nexport type DaffCustomerStoreCreditActions<\n TStoreCredit extends DaffCustomerStoreCredit = DaffCustomerStoreCredit,\n> =\n | DaffCustomerStoreCreditLoad\n | DaffCustomerStoreCreditLoadSuccess<TStoreCredit>\n | DaffCustomerStoreCreditLoadFailure\n | DaffCustomerStoreCreditClearErrors;\n","/**\n * The key under which the customer store credit feature state will be stored.\n */\nexport const DAFF_CUSTOMER_STORE_CREDIT_STORE_FEATURE_KEY = 'daffCustomerStoreCredit';\n","import {\n InjectionToken,\n Provider,\n} from '@angular/core';\nimport { ActionReducer } from '@ngrx/store';\n\nimport { DaffCustomerStoreCreditReducersState } from '../reducers.interface';\n\n/**\n * A token to hold the injectable extra reducers.\n *\n * Prefer using {@link daffCustomerStoreCreditProvideExtraReducers}.\n */\nexport const DAFF_CUSTOMER_STORE_CREDIT_EXTRA_REDUCERS = new InjectionToken<ActionReducer<DaffCustomerStoreCreditReducersState>[]>(\n 'DAFF_CUSTOMER_STORE_CREDIT_EXTRA_REDUCERS',\n {\n factory: () => [],\n providedIn: 'any',\n },\n);\n\n/**\n * Provides additional reducers that run after the standard Daffodil customer reducers.\n *\n * ```ts\n * providers: [\n * ...daffCustomerStoreCreditProvideExtraReducers(\n * myReducer1,\n * myReducer2\n * )\n * ]\n * ```\n */\nexport function daffCustomerStoreCreditProvideExtraReducers(\n ...reducers: ActionReducer<DaffCustomerStoreCreditReducersState>[]\n): Provider[] {\n return reducers.map(reducer => ({\n provide: DAFF_CUSTOMER_STORE_CREDIT_EXTRA_REDUCERS,\n useValue: reducer,\n multi: true,\n }));\n}\n","import { daffOperationInitialState } from '@daffodil/core/state';\n\nimport { DaffCustomerStoreCreditReducerState } from './type';\n\n/**\n * The initial state for the main customer store credit state, see {@link DaffCustomerStoreCreditReducerState}.\n */\nexport const daffCustomerStoreCreditInitialState: DaffCustomerStoreCreditReducerState = {\n ...daffOperationInitialState,\n storeCredit: {\n balance: 0,\n },\n};\n","import {\n daffCompleteOperation,\n daffOperationFailed,\n daffStartMutation,\n daffStartResolution,\n} from '@daffodil/core/state';\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\n\nimport { daffCustomerStoreCreditInitialState } from './initial-state';\nimport { DaffCustomerStoreCreditReducerState } from './type';\nimport {\n DaffCustomerStoreCreditActions,\n DaffCustomerStoreCreditActionTypes,\n DaffCustomerStoreCreditLoadFailure,\n} from '../../actions/store-credit.actions';\n\n/**\n * The reducer for the customer store credit page state, see {@link DaffCustomerStoreCreditReducerState}.\n */\nexport const daffCustomerStoreCreditReducer = <T extends DaffCustomerStoreCredit = DaffCustomerStoreCredit>(\n state = daffCustomerStoreCreditInitialState,\n action: DaffCustomerStoreCreditActions<T>,\n): DaffCustomerStoreCreditReducerState => {\n switch (action.type) {\n case DaffCustomerStoreCreditActionTypes.StoreCreditLoadAction:\n case DaffCustomerStoreCreditActionTypes.StoreCreditLoadAction:\n return daffStartResolution(state);\n\n case DaffCustomerStoreCreditActionTypes.StoreCreditLoadSuccessAction:\n return {\n ...daffCompleteOperation(state),\n storeCredit: action.payload,\n };\n\n case DaffCustomerStoreCreditActionTypes.StoreCreditClearErrorsAction:\n return daffCompleteOperation(state);\n\n case DaffCustomerStoreCreditActionTypes.StoreCreditLoadFailureAction:\n return daffOperationFailed([(<DaffCustomerStoreCreditLoadFailure>action).payload], state);\n\n default:\n return state;\n }\n};\n","import {\n createFeatureSelector,\n MemoizedSelector,\n} from '@ngrx/store';\n\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\n\nimport {\n DaffCustomerStoreCreditStateRootSlice,\n DaffCustomerStoreCreditReducersState,\n DAFF_CUSTOMER_STORE_CREDIT_STORE_FEATURE_KEY,\n} from '../reducers/public_api';\n\n/**\n * Selector for the customer store credit feature state.\n */\nexport interface DaffCustomerStoreCreditFeatureSelector<\n TStoreCredit extends DaffCustomerStoreCredit = DaffCustomerStoreCredit\n> {\n selectCustomerStoreCreditFeatureState: MemoizedSelector<DaffCustomerStoreCreditStateRootSlice<TStoreCredit>, DaffCustomerStoreCreditReducersState<TStoreCredit>>;\n}\n\nexport const getDaffCustomerStoreCreditReducersStateSelector = (() => {\n let cache;\n return <TStoreCredit extends DaffCustomerStoreCredit = DaffCustomerStoreCredit>(): DaffCustomerStoreCreditFeatureSelector<TStoreCredit> =>\n cache = cache || {\n selectCustomerStoreCreditFeatureState: createFeatureSelector<DaffCustomerStoreCreditReducersState<TStoreCredit>>(DAFF_CUSTOMER_STORE_CREDIT_STORE_FEATURE_KEY),\n };\n})();\n","import {\n createSelector,\n MemoizedSelector,\n} from '@ngrx/store';\n\nimport {\n daffOperationStateSelectorFactory,\n DaffOperationStateSelectors,\n} from '@daffodil/core/state';\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\n\nimport {\n DaffCustomerStoreCreditReducerState,\n DaffCustomerStoreCreditStateRootSlice,\n} from '../../reducers/public_api';\nimport { getDaffCustomerStoreCreditReducersStateSelector } from '../feature.selector';\n\n/**\n * Selectors for the main part of customer store credit state.\n */\nexport interface DaffCustomerStoreCreditSelectors<T extends DaffCustomerStoreCredit = DaffCustomerStoreCredit> extends DaffOperationStateSelectors<DaffCustomerStoreCreditStateRootSlice<T>, DaffCustomerStoreCreditReducerState<T>> {\n /**\n * Selects the customer's current store credit balance.\n */\n selectStoreCredit: MemoizedSelector<DaffCustomerStoreCreditStateRootSlice<T>, T>;\n}\n\n/**\n * Creates a group of selectors for {@link DaffCustomerStoreCreditReducerState} that use the passed state selector as the basis.\n */\nconst daffCustomerStoreCreditCreateSelectors = <T extends DaffCustomerStoreCredit = DaffCustomerStoreCredit>(): DaffCustomerStoreCreditSelectors<T> => {\n const { selectCustomerStoreCreditFeatureState } = getDaffCustomerStoreCreditReducersStateSelector<T>();\n const selectCustomerStoreCreditState = createSelector(\n selectCustomerStoreCreditFeatureState,\n state => state.storeCredit,\n );\n const selectStoreCredit = createSelector(\n selectCustomerStoreCreditState,\n state => state.storeCredit,\n );\n\n return {\n ...daffOperationStateSelectorFactory(selectCustomerStoreCreditState),\n selectStoreCredit,\n };\n};\n\nexport const daffCustomerStoreCreditGetSelectors = (() => {\n let cache;\n return <T extends DaffCustomerStoreCredit = DaffCustomerStoreCredit>(): DaffCustomerStoreCreditSelectors<T> =>\n cache = cache || daffCustomerStoreCreditCreateSelectors<T>();\n})();\n\n","import { Injectable } from '@angular/core';\nimport {\n Store,\n select,\n Action,\n} from '@ngrx/store';\nimport { Observable } from 'rxjs';\n\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\n\nimport { DaffCustomerStoreCreditPageFacadeInterface } from './interface';\nimport {\n DaffCustomerStoreCreditReducerState,\n DaffCustomerStoreCreditStateRootSlice,\n} from '../../reducers/public_api';\nimport { daffCustomerStoreCreditGetSelectors } from '../../selectors/public_api';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCustomerStoreCreditPageFacade<T extends DaffCustomerStoreCredit = DaffCustomerStoreCredit> implements DaffCustomerStoreCreditPageFacadeInterface<T> {\n storeCredit$: Observable<T>;\n loadingState$: Observable<DaffCustomerStoreCreditReducerState['daffState']>;\n loading$: Observable<boolean>;\n resolving$: Observable<boolean>;\n mutating$: Observable<boolean>;\n errors$: Observable<DaffCustomerStoreCreditReducerState['daffErrors']>;\n hasErrors$: Observable<boolean>;\n\n constructor(\n private store: Store<DaffCustomerStoreCreditStateRootSlice>,\n ) {\n const {\n selectStoreCredit,\n selectErrors,\n selectHasErrors,\n selectLoading,\n selectLoadingState,\n selectMutating,\n selectResolving,\n } = daffCustomerStoreCreditGetSelectors<T>();\n\n this.storeCredit$ = this.store.pipe(select(selectStoreCredit));\n this.loadingState$ = this.store.pipe(select(selectLoadingState));\n this.loading$ = this.store.pipe(select(selectLoading));\n this.resolving$ = this.store.pipe(select(selectResolving));\n this.mutating$ = this.store.pipe(select(selectMutating));\n this.errors$ = this.store.pipe(select(selectErrors));\n this.hasErrors$ = this.store.pipe(select(selectHasErrors));\n }\n\n dispatch(action: Action) {\n this.store.dispatch(action);\n }\n}\n","import { InjectionToken } from '@angular/core';\n\nimport { daffTransformErrorToStateError } from '@daffodil/core/state';\n\n/**\n * Transforms `DaffError`s into `DaffStateError`s before they are serialized into state.\n * Can be used to further refine Daffodil errors into more specific app errors.\n */\nexport const DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER = new InjectionToken<typeof daffTransformErrorToStateError>(\n 'DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER',\n { factory: () => daffTransformErrorToStateError },\n);\n","import {\n Injectable,\n Inject,\n} from '@angular/core';\nimport {\n Actions,\n createEffect,\n ofType,\n} from '@ngrx/effects';\nimport { of } from 'rxjs';\nimport {\n switchMap,\n map,\n catchError,\n} from 'rxjs/operators';\n\nimport { DaffError } from '@daffodil/core';\nimport { ErrorTransformer } from '@daffodil/core/state';\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\nimport {\n DaffCustomerStoreCreditDriver,\n DaffCustomerStoreCreditDriverInterface,\n} from '@daffodil/customer-store-credit/driver';\n\nimport {\n DaffCustomerStoreCreditActionTypes,\n DaffCustomerStoreCreditLoadFailure,\n DaffCustomerStoreCreditLoadSuccess,\n DaffCustomerStoreCreditActions,\n} from '../actions/store-credit.actions';\nimport { DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER } from '../injection-tokens/public_api';\n\n@Injectable()\nexport class DaffCustomerStoreCreditEffects<\n T extends DaffCustomerStoreCredit = DaffCustomerStoreCredit,\n> {\n constructor(\n private actions$: Actions<DaffCustomerStoreCreditActions<T>>,\n @Inject(DaffCustomerStoreCreditDriver) private driver: DaffCustomerStoreCreditDriverInterface<T>,\n @Inject(DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER) private errorMatcher: ErrorTransformer,\n ) {}\n\n list$ = createEffect(() => this.actions$.pipe(\n ofType(DaffCustomerStoreCreditActionTypes.StoreCreditLoadAction),\n switchMap((action) =>\n this.driver.get().pipe(\n map(resp => new DaffCustomerStoreCreditLoadSuccess<T>(resp)),\n catchError((error: DaffError) => of(new DaffCustomerStoreCreditLoadFailure(this.errorMatcher(error)))),\n ),\n ),\n ));\n}\n","import {\n inject,\n InjectionToken,\n} from '@angular/core';\nimport {\n ActionReducer,\n combineReducers,\n} from '@ngrx/store';\n\nimport { daffComposeReducers } from '@daffodil/core/state';\n// these unused imports are a workaround\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\n\nimport { DAFF_CUSTOMER_STORE_CREDIT_EXTRA_REDUCERS } from './extra.token';\nimport { DaffCustomerStoreCreditReducersState } from '../reducers.interface';\nimport { daffCustomerStoreCreditReducer } from '../store-credit/public_api';\n\n/**\n * An internal token to hold the Daffodil customer reducers.\n * Includes the extra and standard reducers.\n *\n * @docs-private\n */\nexport const DAFF_CUSTOMER_STORE_CREDIT_REDUCERS = new InjectionToken<ActionReducer<DaffCustomerStoreCreditReducersState>>(\n 'DAFF_CUSTOMER_STORE_CREDIT_REDUCERS',\n {\n providedIn: 'any',\n factory: () => daffComposeReducers([\n combineReducers({\n storeCredit: daffCustomerStoreCreditReducer,\n }),\n ...inject(DAFF_CUSTOMER_STORE_CREDIT_EXTRA_REDUCERS),\n ]),\n },\n);\n","import { NgModule } from '@angular/core';\nimport { EffectsModule } from '@ngrx/effects';\nimport { StoreModule } from '@ngrx/store';\n\nimport { DaffCustomerStoreCreditEffects } from './effects/store-credit.effects';\nimport { DAFF_CUSTOMER_STORE_CREDIT_STORE_FEATURE_KEY } from './reducers/public_api';\nimport { DAFF_CUSTOMER_STORE_CREDIT_REDUCERS } from './reducers/token/reducers.token';\n\n/**\n * Creates the customer store credit feature store.\n */\n@NgModule({\n imports: [\n StoreModule.forFeature(DAFF_CUSTOMER_STORE_CREDIT_STORE_FEATURE_KEY, DAFF_CUSTOMER_STORE_CREDIT_REDUCERS),\n EffectsModule.forFeature([\n DaffCustomerStoreCreditEffects,\n ]),\n ],\n})\nexport class DaffCustomerStoreCreditStateModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2"],"mappings":";;;;;;;;;;;AAMA;;AAEG;IACS,mCAKX;AALD,CAAA,UAAY,kCAAkC,EAAA;AAC5C,IAAA,kCAAA,CAAA,uBAAA,CAAA,GAAA,4DAAoF,CAAA;AACpF,IAAA,kCAAA,CAAA,8BAAA,CAAA,GAAA,oEAAmG,CAAA;AACnG,IAAA,kCAAA,CAAA,8BAAA,CAAA,GAAA,oEAAmG,CAAA;AACnG,IAAA,kCAAA,CAAA,8BAAA,CAAA,GAAA,oEAAmG,CAAA;AACrG,CAAC,EALW,kCAAkC,KAAlC,kCAAkC,GAK7C,EAAA,CAAA,CAAA,CAAA;AAED;;AAEG;MACU,2BAA2B,CAAA;AAAxC,IAAA,WAAA,GAAA;AACW,QAAA,IAAA,CAAA,IAAI,GAAG,kCAAkC,CAAC,qBAAqB,CAAC;KAC1E;AAAA,CAAA;AAED;;AAEG;MACU,kCAAkC,CAAA;AAG7C,IAAA,WAAA,CAAmB,OAAU,EAAA;QAAV,IAAO,CAAA,OAAA,GAAP,OAAO,CAAG;AAFpB,QAAA,IAAA,CAAA,IAAI,GAAG,kCAAkC,CAAC,4BAA4B,CAAC;KAE/C;AAClC,CAAA;AAED;;AAEG;MACU,kCAAkC,CAAA;AAG7C,IAAA,WAAA,CAAmB,OAAuB,EAAA;QAAvB,IAAO,CAAA,OAAA,GAAP,OAAO,CAA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EAAA,CAAA;kBAD1C,UAAU;;0BAMN,MAAM;2BAAC,6BAA6B,CAAA;;0BACpC,MAAM;2BAAC,wCAAwC,CAAA;;;ACtBpD;;;;;AAKG;AACI,MAAM,mCAAmC,GAAG,IAAI,cAAc,CACnE,qCAAqC,EACrC;AACE,IAAA,UAAU,EAAE,KAAK;AACjB,IAAA,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjC,QAAA,eAAe,CAAC;AACd,YAAA,WAAW,EAAE,8BAA8B;SAC5C,CAAC;QACF,GAAG,MAAM,CAAC,yCAAyC,CAAC;KACrD,CAAC;AACH,CAAA,CACF;;AC1BD;;AAEG;MASU,kCAAkC,CAAA;iIAAlC,kCAAkC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;kIAAlC,kCAAkC,EAAA,OAAA,EAAA,CAAA,EAAA,CAAA,kBAAA,EAAAC,IAAA,CAAA,oBAAA,CAAA,EAAA,CAAA,CAAA,EAAA;kIAAlC,kCAAkC,EAAA,OAAA,EAAA,CAN3C,WAAW,CAAC,UAAU,CAAC,4CAA4C,EAAE,mCAAmC,CAAC;YACzG,aAAa,CAAC,UAAU,CAAC;gBACvB,8BAA8B;aAC/B,CAAC,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAGO,kCAAkC,EAAA,UAAA,EAAA,CAAA;kBAR9C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;AACP,wBAAA,WAAW,CAAC,UAAU,CAAC,4CAA4C,EAAE,mCAAmC,CAAC;wBACzG,aAAa,CAAC,UAAU,CAAC;4BACvB,8BAA8B;yBAC/B,CAAC;AACH,qBAAA;AACF,iBAAA,CAAA;;;AClBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"daffodil-customer-store-credit-state.mjs","sources":["../../../libs/customer-store-credit/state/src/actions/store-credit.actions.ts","../../../libs/customer-store-credit/state/src/reducers/store-feature-key.ts","../../../libs/customer-store-credit/state/src/reducers/token/extra.token.ts","../../../libs/customer-store-credit/state/src/reducers/store-credit/initial-state.ts","../../../libs/customer-store-credit/state/src/reducers/store-credit/reducer.ts","../../../libs/customer-store-credit/state/src/selectors/feature.selector.ts","../../../libs/customer-store-credit/state/src/selectors/store-credit/selector.ts","../../../libs/customer-store-credit/state/src/facades/store-credit/facade.ts","../../../libs/customer-store-credit/state/src/injection-tokens/error-matcher.token.ts","../../../libs/customer-store-credit/state/src/effects/store-credit.effects.ts","../../../libs/customer-store-credit/state/src/reducers/token/reducers.token.ts","../../../libs/customer-store-credit/state/src/state.module.ts","../../../libs/customer-store-credit/state/src/daffodil-customer-store-credit-state.ts"],"sourcesContent":["import { Action } from '@ngrx/store';\n\nimport { DaffIdentifiable } from '@daffodil/core';\nimport { DaffStateError } from '@daffodil/core/state';\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\n\n/**\n * The customer store credit action types enum.\n */\nexport enum DaffCustomerStoreCreditActionTypes {\n StoreCreditLoadAction = '[@daffodil/customer-store-credit] Store Credit Load Action',\n StoreCreditLoadSuccessAction = '[@daffodil/customer-store-credit] Store Credit Load Success Action',\n StoreCreditLoadFailureAction = '[@daffodil/customer-store-credit] Store Credit Load Failure Action',\n StoreCreditClearErrorsAction = '[@daffodil/customer-store-credit] Store Credit Clear Errors Action',\n}\n\n/**\n * Loads the store credit of the current customer.\n */\nexport class DaffCustomerStoreCreditLoad implements Action {\n readonly type = DaffCustomerStoreCreditActionTypes.StoreCreditLoadAction;\n}\n\n/**\n * Indicates a successful load of the customer's store credit.\n */\nexport class DaffCustomerStoreCreditLoadSuccess<T extends DaffCustomerStoreCredit = DaffCustomerStoreCredit> implements Action {\n readonly type = DaffCustomerStoreCreditActionTypes.StoreCreditLoadSuccessAction;\n\n constructor(public payload: T) {}\n}\n\n/**\n * A failed customer store credit load with the error message.\n */\nexport class DaffCustomerStoreCreditLoadFailure implements Action {\n readonly type = DaffCustomerStoreCreditActionTypes.StoreCreditLoadFailureAction;\n\n constructor(public payload: DaffStateError) {}\n}\n\n/**\n * An action to clear all errors in state.\n */\nexport class DaffCustomerStoreCreditClearErrors implements Action {\n readonly type = DaffCustomerStoreCreditActionTypes.StoreCreditClearErrorsAction;\n}\n\n/**\n * A union of the customer action types.\n */\nexport type DaffCustomerStoreCreditActions<\n TStoreCredit extends DaffCustomerStoreCredit = DaffCustomerStoreCredit,\n> =\n | DaffCustomerStoreCreditLoad\n | DaffCustomerStoreCreditLoadSuccess<TStoreCredit>\n | DaffCustomerStoreCreditLoadFailure\n | DaffCustomerStoreCreditClearErrors;\n","/**\n * The key under which the customer store credit feature state will be stored.\n */\nexport const DAFF_CUSTOMER_STORE_CREDIT_STORE_FEATURE_KEY = 'daffCustomerStoreCredit';\n","import { ActionReducer } from '@ngrx/store';\n\nimport { createMultiInjectionToken } from '@daffodil/core';\n\nimport { DaffCustomerStoreCreditReducersState } from '../reducers.interface';\n\nexport const {\n /**\n * A token to hold the injectable extra reducers.\n *\n * Prefer using {@link daffCustomerStoreCreditProvideExtraReducers}.\n */\n token: DAFF_CUSTOMER_STORE_CREDIT_EXTRA_REDUCERS,\n\n /**\n * Provides additional reducers that run after the standard Daffodil customer reducers.\n *\n * ```ts\n * providers: [\n * ...daffCustomerStoreCreditProvideExtraReducers(\n * myReducer1,\n * myReducer2\n * )\n * ]\n * ```\n */\n provider: daffCustomerStoreCreditProvideExtraReducers,\n} = createMultiInjectionToken<ActionReducer<DaffCustomerStoreCreditReducersState>>(\n 'DAFF_CUSTOMER_STORE_CREDIT_EXTRA_REDUCERS',\n { providedIn: 'any' },\n);\n","import { daffOperationInitialState } from '@daffodil/core/state';\n\nimport { DaffCustomerStoreCreditReducerState } from './type';\n\n/**\n * The initial state for the main customer store credit state, see {@link DaffCustomerStoreCreditReducerState}.\n */\nexport const daffCustomerStoreCreditInitialState: DaffCustomerStoreCreditReducerState = {\n ...daffOperationInitialState,\n storeCredit: {\n balance: 0,\n },\n};\n","import {\n daffCompleteOperation,\n daffOperationFailed,\n daffStartMutation,\n daffStartResolution,\n} from '@daffodil/core/state';\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\n\nimport { daffCustomerStoreCreditInitialState } from './initial-state';\nimport { DaffCustomerStoreCreditReducerState } from './type';\nimport {\n DaffCustomerStoreCreditActions,\n DaffCustomerStoreCreditActionTypes,\n DaffCustomerStoreCreditLoadFailure,\n} from '../../actions/store-credit.actions';\n\n/**\n * The reducer for the customer store credit page state, see {@link DaffCustomerStoreCreditReducerState}.\n */\nexport const daffCustomerStoreCreditReducer = <T extends DaffCustomerStoreCredit = DaffCustomerStoreCredit>(\n state = daffCustomerStoreCreditInitialState,\n action: DaffCustomerStoreCreditActions<T>,\n): DaffCustomerStoreCreditReducerState => {\n switch (action.type) {\n case DaffCustomerStoreCreditActionTypes.StoreCreditLoadAction:\n case DaffCustomerStoreCreditActionTypes.StoreCreditLoadAction:\n return daffStartResolution(state);\n\n case DaffCustomerStoreCreditActionTypes.StoreCreditLoadSuccessAction:\n return {\n ...daffCompleteOperation(state),\n storeCredit: action.payload,\n };\n\n case DaffCustomerStoreCreditActionTypes.StoreCreditClearErrorsAction:\n return daffCompleteOperation(state);\n\n case DaffCustomerStoreCreditActionTypes.StoreCreditLoadFailureAction:\n return daffOperationFailed([(<DaffCustomerStoreCreditLoadFailure>action).payload], state);\n\n default:\n return state;\n }\n};\n","import {\n createFeatureSelector,\n MemoizedSelector,\n} from '@ngrx/store';\n\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\n\nimport {\n DaffCustomerStoreCreditStateRootSlice,\n DaffCustomerStoreCreditReducersState,\n DAFF_CUSTOMER_STORE_CREDIT_STORE_FEATURE_KEY,\n} from '../reducers/public_api';\n\n/**\n * Selector for the customer store credit feature state.\n */\nexport interface DaffCustomerStoreCreditFeatureSelector<\n TStoreCredit extends DaffCustomerStoreCredit = DaffCustomerStoreCredit\n> {\n selectCustomerStoreCreditFeatureState: MemoizedSelector<DaffCustomerStoreCreditStateRootSlice<TStoreCredit>, DaffCustomerStoreCreditReducersState<TStoreCredit>>;\n}\n\nexport const getDaffCustomerStoreCreditReducersStateSelector = (() => {\n let cache;\n return <TStoreCredit extends DaffCustomerStoreCredit = DaffCustomerStoreCredit>(): DaffCustomerStoreCreditFeatureSelector<TStoreCredit> =>\n cache = cache || {\n selectCustomerStoreCreditFeatureState: createFeatureSelector<DaffCustomerStoreCreditReducersState<TStoreCredit>>(DAFF_CUSTOMER_STORE_CREDIT_STORE_FEATURE_KEY),\n };\n})();\n","import {\n createSelector,\n MemoizedSelector,\n} from '@ngrx/store';\n\nimport {\n daffOperationStateSelectorFactory,\n DaffOperationStateSelectors,\n} from '@daffodil/core/state';\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\n\nimport {\n DaffCustomerStoreCreditReducerState,\n DaffCustomerStoreCreditStateRootSlice,\n} from '../../reducers/public_api';\nimport { getDaffCustomerStoreCreditReducersStateSelector } from '../feature.selector';\n\n/**\n * Selectors for the main part of customer store credit state.\n */\nexport interface DaffCustomerStoreCreditSelectors<T extends DaffCustomerStoreCredit = DaffCustomerStoreCredit> extends DaffOperationStateSelectors<DaffCustomerStoreCreditStateRootSlice<T>, DaffCustomerStoreCreditReducerState<T>> {\n /**\n * Selects the customer's current store credit balance.\n */\n selectStoreCredit: MemoizedSelector<DaffCustomerStoreCreditStateRootSlice<T>, T>;\n}\n\n/**\n * Creates a group of selectors for {@link DaffCustomerStoreCreditReducerState} that use the passed state selector as the basis.\n */\nconst daffCustomerStoreCreditCreateSelectors = <T extends DaffCustomerStoreCredit = DaffCustomerStoreCredit>(): DaffCustomerStoreCreditSelectors<T> => {\n const { selectCustomerStoreCreditFeatureState } = getDaffCustomerStoreCreditReducersStateSelector<T>();\n const selectCustomerStoreCreditState = createSelector(\n selectCustomerStoreCreditFeatureState,\n state => state.storeCredit,\n );\n const selectStoreCredit = createSelector(\n selectCustomerStoreCreditState,\n state => state.storeCredit,\n );\n\n return {\n ...daffOperationStateSelectorFactory(selectCustomerStoreCreditState),\n selectStoreCredit,\n };\n};\n\nexport const daffCustomerStoreCreditGetSelectors = (() => {\n let cache;\n return <T extends DaffCustomerStoreCredit = DaffCustomerStoreCredit>(): DaffCustomerStoreCreditSelectors<T> =>\n cache = cache || daffCustomerStoreCreditCreateSelectors<T>();\n})();\n\n","import { Injectable } from '@angular/core';\nimport {\n Store,\n select,\n Action,\n} from '@ngrx/store';\nimport { Observable } from 'rxjs';\n\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\n\nimport { DaffCustomerStoreCreditPageFacadeInterface } from './interface';\nimport {\n DaffCustomerStoreCreditReducerState,\n DaffCustomerStoreCreditStateRootSlice,\n} from '../../reducers/public_api';\nimport { daffCustomerStoreCreditGetSelectors } from '../../selectors/public_api';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCustomerStoreCreditPageFacade<T extends DaffCustomerStoreCredit = DaffCustomerStoreCredit> implements DaffCustomerStoreCreditPageFacadeInterface<T> {\n storeCredit$: Observable<T>;\n loadingState$: Observable<DaffCustomerStoreCreditReducerState['daffState']>;\n loading$: Observable<boolean>;\n resolving$: Observable<boolean>;\n mutating$: Observable<boolean>;\n errors$: Observable<DaffCustomerStoreCreditReducerState['daffErrors']>;\n hasErrors$: Observable<boolean>;\n\n constructor(\n private store: Store<DaffCustomerStoreCreditStateRootSlice>,\n ) {\n const {\n selectStoreCredit,\n selectErrors,\n selectHasErrors,\n selectLoading,\n selectLoadingState,\n selectMutating,\n selectResolving,\n } = daffCustomerStoreCreditGetSelectors<T>();\n\n this.storeCredit$ = this.store.pipe(select(selectStoreCredit));\n this.loadingState$ = this.store.pipe(select(selectLoadingState));\n this.loading$ = this.store.pipe(select(selectLoading));\n this.resolving$ = this.store.pipe(select(selectResolving));\n this.mutating$ = this.store.pipe(select(selectMutating));\n this.errors$ = this.store.pipe(select(selectErrors));\n this.hasErrors$ = this.store.pipe(select(selectHasErrors));\n }\n\n dispatch(action: Action) {\n this.store.dispatch(action);\n }\n}\n","import { createSingleInjectionToken } from '@daffodil/core';\nimport { daffTransformErrorToStateError } from '@daffodil/core/state';\n\nexport const {\n /**\n * Transforms `DaffError`s into `DaffStateError`s before they are serialized into state.\n * Can be used to further refine Daffodil errors into more specific app errors.\n */\n token: DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER,\n /**\n * Provider function for {@link DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER}.\n */\n provider: provideDaffCustomerStoreCreditErrorMatcher,\n} = createSingleInjectionToken<typeof daffTransformErrorToStateError>(\n 'DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER',\n { factory: () => daffTransformErrorToStateError },\n);\n","import {\n Injectable,\n Inject,\n} from '@angular/core';\nimport {\n Actions,\n createEffect,\n ofType,\n} from '@ngrx/effects';\nimport { of } from 'rxjs';\nimport {\n switchMap,\n map,\n catchError,\n} from 'rxjs/operators';\n\nimport { DaffError } from '@daffodil/core';\nimport { ErrorTransformer } from '@daffodil/core/state';\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\nimport {\n DaffCustomerStoreCreditDriver,\n DaffCustomerStoreCreditDriverInterface,\n} from '@daffodil/customer-store-credit/driver';\n\nimport {\n DaffCustomerStoreCreditActionTypes,\n DaffCustomerStoreCreditLoadFailure,\n DaffCustomerStoreCreditLoadSuccess,\n DaffCustomerStoreCreditActions,\n} from '../actions/store-credit.actions';\nimport { DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER } from '../injection-tokens/public_api';\n\n@Injectable()\nexport class DaffCustomerStoreCreditEffects<\n T extends DaffCustomerStoreCredit = DaffCustomerStoreCredit,\n> {\n constructor(\n private actions$: Actions<DaffCustomerStoreCreditActions<T>>,\n @Inject(DaffCustomerStoreCreditDriver) private driver: DaffCustomerStoreCreditDriverInterface<T>,\n @Inject(DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER) private errorMatcher: ErrorTransformer,\n ) {}\n\n list$ = createEffect(() => this.actions$.pipe(\n ofType(DaffCustomerStoreCreditActionTypes.StoreCreditLoadAction),\n switchMap((action) =>\n this.driver.get().pipe(\n map(resp => new DaffCustomerStoreCreditLoadSuccess<T>(resp)),\n catchError((error: DaffError) => of(new DaffCustomerStoreCreditLoadFailure(this.errorMatcher(error)))),\n ),\n ),\n ));\n}\n","import { inject } from '@angular/core';\nimport {\n ActionReducer,\n combineReducers,\n} from '@ngrx/store';\n\nimport { createSingleInjectionToken } from '@daffodil/core';\nimport { daffComposeReducers } from '@daffodil/core/state';\n// these unused imports are a workaround\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\n\nimport { DAFF_CUSTOMER_STORE_CREDIT_EXTRA_REDUCERS } from './extra.token';\nimport { DaffCustomerStoreCreditReducersState } from '../reducers.interface';\nimport { daffCustomerStoreCreditReducer } from '../store-credit/public_api';\n\nexport const {\n /**\n * An internal token to hold the Daffodil customer reducers.\n * Includes the extra and standard reducers.\n *\n * @docs-private\n */\n token: DAFF_CUSTOMER_STORE_CREDIT_REDUCERS,\n /**\n * Provider function for {@link DAFF_CUSTOMER_STORE_CREDIT_REDUCERS}.\n */\n provider: provideDaffCustomerStoreCreditReducers,\n} = createSingleInjectionToken<ActionReducer<DaffCustomerStoreCreditReducersState>>(\n 'DAFF_CUSTOMER_STORE_CREDIT_REDUCERS',\n {\n providedIn: 'any',\n factory: () => daffComposeReducers([\n combineReducers({\n storeCredit: daffCustomerStoreCreditReducer,\n }),\n ...inject(DAFF_CUSTOMER_STORE_CREDIT_EXTRA_REDUCERS),\n ]),\n },\n);\n","import { NgModule } from '@angular/core';\nimport { EffectsModule } from '@ngrx/effects';\nimport { StoreModule } from '@ngrx/store';\n\nimport { DaffCustomerStoreCreditEffects } from './effects/store-credit.effects';\nimport { DAFF_CUSTOMER_STORE_CREDIT_STORE_FEATURE_KEY } from './reducers/public_api';\nimport { DAFF_CUSTOMER_STORE_CREDIT_REDUCERS } from './reducers/token/reducers.token';\n\n/**\n * Creates the customer store credit feature store.\n */\n@NgModule({\n imports: [\n StoreModule.forFeature(DAFF_CUSTOMER_STORE_CREDIT_STORE_FEATURE_KEY, DAFF_CUSTOMER_STORE_CREDIT_REDUCERS),\n EffectsModule.forFeature([\n DaffCustomerStoreCreditEffects,\n ]),\n ],\n})\nexport class DaffCustomerStoreCreditStateModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2"],"mappings":";;;;;;;;;;;;AAMA;;AAEG;IACS,mCAKX;AALD,CAAA,UAAY,kCAAkC,EAAA;AAC5C,IAAA,kCAAA,CAAA,uBAAA,CAAA,GAAA,4DAAoF,CAAA;AACpF,IAAA,kCAAA,CAAA,8BAAA,CAAA,GAAA,oEAAmG,CAAA;AACnG,IAAA,kCAAA,CAAA,8BAAA,CAAA,GAAA,oEAAmG,CAAA;AACnG,IAAA,kCAAA,CAAA,8BAAA,CAAA,GAAA,oEAAmG,CAAA;AACrG,CAAC,EALW,kCAAkC,KAAlC,kCAAkC,GAK7C,EAAA,CAAA,CAAA,CAAA;AAED;;AAEG;MACU,2BAA2B,CAAA;AAAxC,IAAA,WAAA,GAAA;AACW,QAAA,IAAA,CAAA,IAAI,GAAG,kCAAkC,CAAC,qBAAqB,CAAC;KAC1E;AAAA,CAAA;AAED;;AAEG;MACU,kCAAkC,CAAA;AAG7C,IAAA,WAAA,CAAmB,OAAU,EAAA;QAAV,IAAO,CAAA,OAAA,GAAP,OAAO,CAAG;AAFpB,QAAA,IAAA,CAAA,IAAI,GAAG,kCAAkC,CAAC,4BAA4B,CAAC;KAE/C;AAClC,CAAA;AAED;;AAEG;MACU,kCAAkC,CAAA;AAG7C,IAAA,WAAA,CAAmB,OAAuB,EAAA;QAAvB,IAAO,CAAA,OAAA,GAAP,OAAO,CAAgB;AAFjC,QAAA,IAAA,CAAA,IAAI,GAAG,kCAAkC,CAAC,4BAA4B,CAAC;KAElC;A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ACrC;AACE,IAAA,UAAU,EAAE,KAAK;AACjB,IAAA,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjC,QAAA,eAAe,CAAC;AACd,YAAA,WAAW,EAAE,8BAA8B;SAC5C,CAAC;QACF,GAAG,MAAM,CAAC,yCAAyC,CAAC;KACrD,CAAC;AACH,CAAA,CACF;;AC9BD;;AAEG;MASU,kCAAkC,CAAA;iIAAlC,kCAAkC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;kIAAlC,kCAAkC,EAAA,OAAA,EAAA,CAAA,EAAA,CAAA,kBAAA,EAAAC,IAAA,CAAA,oBAAA,CAAA,EAAA,CAAA,CAAA,EAAA;kIAAlC,kCAAkC,EAAA,OAAA,EAAA,CAN3C,WAAW,CAAC,UAAU,CAAC,4CAA4C,EAAE,mCAAmC,CAAC;YACzG,aAAa,CAAC,UAAU,CAAC;gBACvB,8BAA8B;aAC/B,CAAC,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAGO,kCAAkC,EAAA,UAAA,EAAA,CAAA;kBAR9C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;AACP,wBAAA,WAAW,CAAC,UAAU,CAAC,4CAA4C,EAAE,mCAAmC,CAAC;wBACzG,aAAa,CAAC,UAAU,CAAC;4BACvB,8BAA8B;yBAC/B,CAAC;AACH,qBAAA;AACF,iBAAA,CAAA;;;AClBD;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@daffodil/customer-store-credit","nx":{"targets":{"build":{"outputs":["{workspaceRoot}/dist/customer-store-credit"]}}},"version":"0.
|
|
1
|
+
{"name":"@daffodil/customer-store-credit","nx":{"targets":{"build":{"outputs":["{workspaceRoot}/dist/customer-store-credit"]}}},"version":"0.80.0","description":"A client-side Angular package for managing ecommerce customer-store-credits agnostic to the ecommerce platform.","repository":{"type":"git","url":"https://github.com/graycoreio/daffodil"},"author":"Graycore LLC","license":"MIT","bugs":{"url":"https://github.com/graycoreio/daffodil/issues"},"homepage":"https://github.com/graycoreio/daffodil","peerDependencies":{"@angular/common":"^18.2.2","@angular/core":"^18.2.2","@daffodil/customer":"0.80.0","@daffodil/customer-order":"0.80.0","@daffodil/core":"0.80.0","@ngrx/effects":"^18.0.2","@ngrx/store":"^18.0.2","rxjs":"7.8.1"},"optionalDependencies":{"@apollo/client":"^3.0.0","@daffodil/driver":"0.80.0","apollo-angular":"^7.1.2","@faker-js/faker":"^7.6.0"},"module":"fesm2022/daffodil-customer-store-credit.mjs","typings":"index.d.ts","exports":{"./package.json":{"default":"./package.json"},".":{"types":"./index.d.ts","esm2022":"./esm2022/daffodil-customer-store-credit.mjs","esm":"./esm2022/daffodil-customer-store-credit.mjs","default":"./fesm2022/daffodil-customer-store-credit.mjs"},"./driver":{"types":"./driver/index.d.ts","esm2022":"./esm2022/driver/daffodil-customer-store-credit-driver.mjs","esm":"./esm2022/driver/daffodil-customer-store-credit-driver.mjs","default":"./fesm2022/daffodil-customer-store-credit-driver.mjs"},"./routing":{"types":"./routing/index.d.ts","esm2022":"./esm2022/routing/daffodil-customer-store-credit-routing.mjs","esm":"./esm2022/routing/daffodil-customer-store-credit-routing.mjs","default":"./fesm2022/daffodil-customer-store-credit-routing.mjs"},"./state":{"types":"./state/index.d.ts","esm2022":"./esm2022/state/daffodil-customer-store-credit-state.mjs","esm":"./esm2022/state/daffodil-customer-store-credit-state.mjs","default":"./fesm2022/daffodil-customer-store-credit-state.mjs"},"./testing":{"types":"./testing/index.d.ts","esm2022":"./esm2022/testing/daffodil-customer-store-credit-testing.mjs","esm":"./esm2022/testing/daffodil-customer-store-credit-testing.mjs","default":"./fesm2022/daffodil-customer-store-credit-testing.mjs"},"./driver/in-memory":{"types":"./driver/in-memory/index.d.ts","esm2022":"./esm2022/driver/in-memory/daffodil-customer-store-credit-driver-in-memory.mjs","esm":"./esm2022/driver/in-memory/daffodil-customer-store-credit-driver-in-memory.mjs","default":"./fesm2022/daffodil-customer-store-credit-driver-in-memory.mjs"},"./driver/magento":{"types":"./driver/magento/index.d.ts","esm2022":"./esm2022/driver/magento/daffodil-customer-store-credit-driver-magento.mjs","esm":"./esm2022/driver/magento/daffodil-customer-store-credit-driver-magento.mjs","default":"./fesm2022/daffodil-customer-store-credit-driver-magento.mjs"},"./driver/testing":{"types":"./driver/testing/index.d.ts","esm2022":"./esm2022/driver/testing/daffodil-customer-store-credit-driver-testing.mjs","esm":"./esm2022/driver/testing/daffodil-customer-store-credit-driver-testing.mjs","default":"./fesm2022/daffodil-customer-store-credit-driver-testing.mjs"},"./state/testing":{"types":"./state/testing/index.d.ts","esm2022":"./esm2022/state/testing/daffodil-customer-store-credit-state-testing.mjs","esm":"./esm2022/state/testing/daffodil-customer-store-credit-state-testing.mjs","default":"./fesm2022/daffodil-customer-store-credit-state-testing.mjs"},"./driver/magento/testing":{"types":"./driver/magento/testing/index.d.ts","esm2022":"./esm2022/driver/magento/testing/daffodil-customer-store-credit-driver-magento-testing.mjs","esm":"./esm2022/driver/magento/testing/daffodil-customer-store-credit-driver-magento-testing.mjs","default":"./fesm2022/daffodil-customer-store-credit-driver-magento-testing.mjs"}},"sideEffects":false,"dependencies":{"tslib":"^2.3.0"}}
|
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
import { InjectionToken } from '@angular/core';
|
|
2
1
|
import { daffTransformErrorToStateError } from '@daffodil/core/state';
|
|
3
|
-
|
|
4
|
-
* Transforms `DaffError`s into `DaffStateError`s before they are serialized into state.
|
|
5
|
-
* Can be used to further refine Daffodil errors into more specific app errors.
|
|
6
|
-
*/
|
|
7
|
-
export declare const DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER: InjectionToken<typeof daffTransformErrorToStateError>;
|
|
2
|
+
export declare const DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER: import("@angular/core").InjectionToken<typeof daffTransformErrorToStateError>, provideDaffCustomerStoreCreditErrorMatcher: <R extends typeof daffTransformErrorToStateError = typeof daffTransformErrorToStateError>(value: R) => import("@angular/core").ValueProvider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './error-matcher.token';
|
|
@@ -1,22 +1,3 @@
|
|
|
1
|
-
import { InjectionToken, Provider } from '@angular/core';
|
|
2
1
|
import { ActionReducer } from '@ngrx/store';
|
|
3
2
|
import { DaffCustomerStoreCreditReducersState } from '../reducers.interface';
|
|
4
|
-
|
|
5
|
-
* A token to hold the injectable extra reducers.
|
|
6
|
-
*
|
|
7
|
-
* Prefer using {@link daffCustomerStoreCreditProvideExtraReducers}.
|
|
8
|
-
*/
|
|
9
|
-
export declare const DAFF_CUSTOMER_STORE_CREDIT_EXTRA_REDUCERS: InjectionToken<ActionReducer<DaffCustomerStoreCreditReducersState<import("@daffodil/customer-store-credit").DaffCustomerStoreCredit>, import("@ngrx/store").Action<string>>[]>;
|
|
10
|
-
/**
|
|
11
|
-
* Provides additional reducers that run after the standard Daffodil customer reducers.
|
|
12
|
-
*
|
|
13
|
-
* ```ts
|
|
14
|
-
* providers: [
|
|
15
|
-
* ...daffCustomerStoreCreditProvideExtraReducers(
|
|
16
|
-
* myReducer1,
|
|
17
|
-
* myReducer2
|
|
18
|
-
* )
|
|
19
|
-
* ]
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
export declare function daffCustomerStoreCreditProvideExtraReducers(...reducers: ActionReducer<DaffCustomerStoreCreditReducersState>[]): Provider[];
|
|
3
|
+
export declare const DAFF_CUSTOMER_STORE_CREDIT_EXTRA_REDUCERS: import("@angular/core").InjectionToken<ActionReducer<DaffCustomerStoreCreditReducersState<import("@daffodil/customer-store-credit").DaffCustomerStoreCredit>, import("@ngrx/store").Action<string>>[]>, daffCustomerStoreCreditProvideExtraReducers: <R extends ActionReducer<DaffCustomerStoreCreditReducersState<import("@daffodil/customer-store-credit").DaffCustomerStoreCredit>, import("@ngrx/store").Action<string>> = ActionReducer<DaffCustomerStoreCreditReducersState<import("@daffodil/customer-store-credit").DaffCustomerStoreCredit>, import("@ngrx/store").Action<string>>>(...values: R[]) => Array<import("@angular/core").ValueProvider>;
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
import { InjectionToken } from '@angular/core';
|
|
2
1
|
import { ActionReducer } from '@ngrx/store';
|
|
3
2
|
import { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';
|
|
4
3
|
import { DaffCustomerStoreCreditReducersState } from '../reducers.interface';
|
|
5
|
-
|
|
6
|
-
* An internal token to hold the Daffodil customer reducers.
|
|
7
|
-
* Includes the extra and standard reducers.
|
|
8
|
-
*
|
|
9
|
-
* @docs-private
|
|
10
|
-
*/
|
|
11
|
-
export declare const DAFF_CUSTOMER_STORE_CREDIT_REDUCERS: InjectionToken<ActionReducer<DaffCustomerStoreCreditReducersState<DaffCustomerStoreCredit>, import("@ngrx/store").Action<string>>>;
|
|
4
|
+
export declare const DAFF_CUSTOMER_STORE_CREDIT_REDUCERS: import("@angular/core").InjectionToken<ActionReducer<DaffCustomerStoreCreditReducersState<DaffCustomerStoreCredit>, import("@ngrx/store").Action<string>>>, provideDaffCustomerStoreCreditReducers: <R extends ActionReducer<DaffCustomerStoreCreditReducersState<DaffCustomerStoreCredit>, import("@ngrx/store").Action<string>> = ActionReducer<DaffCustomerStoreCreditReducersState<DaffCustomerStoreCredit>, import("@ngrx/store").Action<string>>>(value: R) => import("@angular/core").ValueProvider;
|