@daffodil/customer-store-credit 0.87.2 → 0.89.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/driver/in-memory/index.d.ts +68 -1
- package/driver/index.d.ts +40 -1
- package/driver/magento/index.d.ts +68 -1
- package/driver/magento/testing/index.d.ts +20 -1
- package/driver/testing/index.d.ts +33 -1
- package/fesm2022/daffodil-customer-store-credit-driver-in-memory.mjs +10 -10
- package/fesm2022/daffodil-customer-store-credit-driver-in-memory.mjs.map +1 -1
- package/fesm2022/daffodil-customer-store-credit-driver-magento-testing.mjs +3 -3
- package/fesm2022/daffodil-customer-store-credit-driver-magento-testing.mjs.map +1 -1
- package/fesm2022/daffodil-customer-store-credit-driver-magento.mjs +7 -7
- package/fesm2022/daffodil-customer-store-credit-driver-magento.mjs.map +1 -1
- package/fesm2022/daffodil-customer-store-credit-driver-testing.mjs +7 -7
- package/fesm2022/daffodil-customer-store-credit-driver-testing.mjs.map +1 -1
- package/fesm2022/daffodil-customer-store-credit-driver.mjs.map +1 -1
- package/fesm2022/daffodil-customer-store-credit-routing.mjs +6 -6
- package/fesm2022/daffodil-customer-store-credit-routing.mjs.map +1 -1
- package/fesm2022/daffodil-customer-store-credit-state-testing.mjs +7 -7
- package/fesm2022/daffodil-customer-store-credit-state-testing.mjs.map +1 -1
- package/fesm2022/daffodil-customer-store-credit-state.mjs +10 -11
- package/fesm2022/daffodil-customer-store-credit-state.mjs.map +1 -1
- package/fesm2022/daffodil-customer-store-credit-testing.mjs +3 -3
- package/fesm2022/daffodil-customer-store-credit-testing.mjs.map +1 -1
- package/index.d.ts +14 -1
- package/package.json +1 -1
- package/routing/index.d.ts +29 -1
- package/state/index.d.ts +150 -1
- package/state/testing/index.d.ts +29 -1
- package/testing/index.d.ts +20 -1
- package/constants/public_api.d.ts +0 -1
- package/constants/store-credit-order-total-type.d.ts +0 -1
- package/driver/errors/codes.d.ts +0 -3
- package/driver/errors/invalid-api-response.d.ts +0 -10
- package/driver/errors/map.d.ts +0 -7
- package/driver/errors/public_api.d.ts +0 -3
- package/driver/in-memory/backend/store-credit.service.d.ts +0 -36
- package/driver/in-memory/collection-name.const.d.ts +0 -1
- package/driver/in-memory/driver/driver.module.d.ts +0 -12
- package/driver/in-memory/driver/store-credit.service.d.ts +0 -19
- package/driver/in-memory/public_api.d.ts +0 -3
- package/driver/interfaces/store-credit-service.interface.d.ts +0 -12
- package/driver/magento/customer-store-credit.service.d.ts +0 -17
- package/driver/magento/driver.module.d.ts +0 -9
- package/driver/magento/errors/map.d.ts +0 -1
- package/driver/magento/errors/public_api.d.ts +0 -1
- package/driver/magento/errors/transform.d.ts +0 -10
- package/driver/magento/models/public_api.d.ts +0 -1
- package/driver/magento/models/responses/customer-order-with-store-credit.type.d.ts +0 -7
- package/driver/magento/models/responses/get-customer-store-credit.type.d.ts +0 -6
- package/driver/magento/models/responses/public_api.d.ts +0 -3
- package/driver/magento/models/responses/store-credit.type.d.ts +0 -6
- package/driver/magento/public_api.d.ts +0 -7
- package/driver/magento/queries/fragments/customer-order.d.ts +0 -1
- package/driver/magento/queries/fragments/public_api.d.ts +0 -2
- package/driver/magento/queries/fragments/store-credit.d.ts +0 -1
- package/driver/magento/queries/get-store-credit.d.ts +0 -2
- package/driver/magento/queries/public_api.d.ts +0 -2
- package/driver/magento/testing/factories/customer-store-credit.factory.d.ts +0 -16
- package/driver/magento/testing/factories/public_api.d.ts +0 -1
- package/driver/magento/testing/public_api.d.ts +0 -1
- package/driver/magento/transforms/public_api.d.ts +0 -1
- package/driver/magento/transforms/responses/customer-order.d.ts +0 -3
- package/driver/magento/transforms/responses/customer-store-credit.d.ts +0 -3
- package/driver/magento/transforms/responses/public_api.d.ts +0 -2
- package/driver/magento/validators/get-customer-store-credit.d.ts +0 -3
- package/driver/magento/validators/public_api.d.ts +0 -1
- package/driver/public_api.d.ts +0 -2
- package/driver/testing/drivers/driver.module.d.ts +0 -12
- package/driver/testing/drivers/public_api.d.ts +0 -2
- package/driver/testing/drivers/store-credit.service.d.ts +0 -18
- package/driver/testing/public_api.d.ts +0 -1
- package/models/public_api.d.ts +0 -1
- package/models/store-credit.type.d.ts +0 -9
- package/public_api.d.ts +0 -2
- package/routing/guards/clear-errors.guard.d.ts +0 -14
- package/routing/guards/public_api.d.ts +0 -1
- package/routing/public_api.d.ts +0 -2
- package/routing/resolvers/customer-store-credit.resolver.d.ts +0 -13
- package/routing/resolvers/public_api.d.ts +0 -1
- package/state/actions/public_api.d.ts +0 -1
- package/state/actions/store-credit.actions.d.ts +0 -44
- package/state/effects/store-credit.effects.d.ts +0 -15
- package/state/facades/public_api.d.ts +0 -2
- package/state/facades/store-credit/facade.d.ts +0 -23
- package/state/facades/store-credit/interface.d.ts +0 -13
- package/state/injection-tokens/error-matcher.token.d.ts +0 -2
- package/state/injection-tokens/public_api.d.ts +0 -1
- package/state/public_api.d.ts +0 -6
- package/state/reducers/public_api.d.ts +0 -4
- package/state/reducers/reducers.interface.d.ts +0 -15
- package/state/reducers/store-credit/initial-state.d.ts +0 -5
- package/state/reducers/store-credit/public_api.d.ts +0 -3
- package/state/reducers/store-credit/reducer.d.ts +0 -7
- package/state/reducers/store-credit/type.d.ts +0 -8
- package/state/reducers/store-feature-key.d.ts +0 -4
- package/state/reducers/token/extra.token.d.ts +0 -3
- package/state/reducers/token/public_api.d.ts +0 -1
- package/state/reducers/token/reducers.token.d.ts +0 -3
- package/state/selectors/feature.selector.d.ts +0 -10
- package/state/selectors/public_api.d.ts +0 -2
- package/state/selectors/store-credit/selector.d.ts +0 -14
- package/state/state.module.d.ts +0 -11
- package/state/testing/mock-facade.d.ts +0 -17
- package/state/testing/public_api.d.ts +0 -2
- package/state/testing/state-testing.module.d.ts +0 -9
- package/testing/factories/customer-store-credit.factory.d.ts +0 -17
- package/testing/factories/public_api.d.ts +0 -1
- package/testing/public_api.d.ts +0 -1
|
@@ -16,10 +16,10 @@ class MockDaffCustomerStoreCreditPageFacade extends MockDaffOperationStateFacade
|
|
|
16
16
|
}
|
|
17
17
|
dispatch(action) { }
|
|
18
18
|
;
|
|
19
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
20
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
19
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: MockDaffCustomerStoreCreditPageFacade, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
20
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: MockDaffCustomerStoreCreditPageFacade, providedIn: 'root' }); }
|
|
21
21
|
}
|
|
22
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
22
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: MockDaffCustomerStoreCreditPageFacade, decorators: [{
|
|
23
23
|
type: Injectable,
|
|
24
24
|
args: [{ providedIn: 'root' }]
|
|
25
25
|
}] });
|
|
@@ -28,13 +28,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
|
|
|
28
28
|
* Provides the {@link MockDaffCustomerStoreCreditPageFacade} for {@link DaffCustomerStoreCreditPageFacade}.
|
|
29
29
|
*/
|
|
30
30
|
class DaffCustomerStoreCreditStateTestingModule {
|
|
31
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
32
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
33
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
31
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCustomerStoreCreditStateTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
32
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.1", ngImport: i0, type: DaffCustomerStoreCreditStateTestingModule }); }
|
|
33
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCustomerStoreCreditStateTestingModule, providers: [
|
|
34
34
|
{ provide: DaffCustomerStoreCreditPageFacade, useExisting: MockDaffCustomerStoreCreditPageFacade },
|
|
35
35
|
] }); }
|
|
36
36
|
}
|
|
37
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
37
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCustomerStoreCreditStateTestingModule, decorators: [{
|
|
38
38
|
type: NgModule,
|
|
39
39
|
args: [{
|
|
40
40
|
providers: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-customer-store-credit-state-testing.mjs","sources":["../../../libs/customer-store-credit/state/testing/src/mock-facade.ts","../../../libs/customer-store-credit/state/testing/src/state-testing.module.ts","../../../libs/customer-store-credit/state/testing/src/daffodil-customer-store-credit-state-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { Action } from '@ngrx/store';\nimport { BehaviorSubject } from 'rxjs';\n\nimport { MockDaffOperationStateFacade } from '@daffodil/core/state/testing';\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\nimport { DaffCustomerStoreCreditPageFacadeInterface } from '@daffodil/customer-store-credit/state';\n\n/**\n * Mocks out facade fields and methods for testing purposes.\n *\n * @inheritdoc\n */\n@Injectable({ providedIn: 'root' })\nexport class MockDaffCustomerStoreCreditPageFacade extends MockDaffOperationStateFacade implements DaffCustomerStoreCreditPageFacadeInterface {\n storeCredit$ = new BehaviorSubject<DaffCustomerStoreCredit>(null);\n\n dispatch(action: Action) {};\n}\n","import { NgModule } from '@angular/core';\n\nimport { DaffCustomerStoreCreditPageFacade } from '@daffodil/customer-store-credit/state';\n\nimport { MockDaffCustomerStoreCreditPageFacade } from './mock-facade';\n\n/**\n * Provides the {@link MockDaffCustomerStoreCreditPageFacade} for {@link DaffCustomerStoreCreditPageFacade}.\n */\n@NgModule({\n providers: [\n { provide: DaffCustomerStoreCreditPageFacade, useExisting: MockDaffCustomerStoreCreditPageFacade },\n ],\n})\nexport class DaffCustomerStoreCreditStateTestingModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAQA;;;;AAIG;AAEG,MAAO,qCAAsC,SAAQ,4BAA4B,CAAA;AADvF,IAAA,WAAA,GAAA;;AAEE,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI,eAAe,CAA0B,IAAI,CAAC;AAGlE;IADC,QAAQ,CAAC,MAAc,EAAA;;
|
|
1
|
+
{"version":3,"file":"daffodil-customer-store-credit-state-testing.mjs","sources":["../../../libs/customer-store-credit/state/testing/src/mock-facade.ts","../../../libs/customer-store-credit/state/testing/src/state-testing.module.ts","../../../libs/customer-store-credit/state/testing/src/daffodil-customer-store-credit-state-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { Action } from '@ngrx/store';\nimport { BehaviorSubject } from 'rxjs';\n\nimport { MockDaffOperationStateFacade } from '@daffodil/core/state/testing';\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\nimport { DaffCustomerStoreCreditPageFacadeInterface } from '@daffodil/customer-store-credit/state';\n\n/**\n * Mocks out facade fields and methods for testing purposes.\n *\n * @inheritdoc\n */\n@Injectable({ providedIn: 'root' })\nexport class MockDaffCustomerStoreCreditPageFacade extends MockDaffOperationStateFacade implements DaffCustomerStoreCreditPageFacadeInterface {\n storeCredit$ = new BehaviorSubject<DaffCustomerStoreCredit>(null);\n\n dispatch(action: Action) {};\n}\n","import { NgModule } from '@angular/core';\n\nimport { DaffCustomerStoreCreditPageFacade } from '@daffodil/customer-store-credit/state';\n\nimport { MockDaffCustomerStoreCreditPageFacade } from './mock-facade';\n\n/**\n * Provides the {@link MockDaffCustomerStoreCreditPageFacade} for {@link DaffCustomerStoreCreditPageFacade}.\n */\n@NgModule({\n providers: [\n { provide: DaffCustomerStoreCreditPageFacade, useExisting: MockDaffCustomerStoreCreditPageFacade },\n ],\n})\nexport class DaffCustomerStoreCreditStateTestingModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAQA;;;;AAIG;AAEG,MAAO,qCAAsC,SAAQ,4BAA4B,CAAA;AADvF,IAAA,WAAA,GAAA;;AAEE,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI,eAAe,CAA0B,IAAI,CAAC;AAGlE,IAAA;IADC,QAAQ,CAAC,MAAc,EAAA,EAAG;;iIAHf,qCAAqC,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAArC,uBAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qCAAqC,cADxB,MAAM,EAAA,CAAA,CAAA;;2FACnB,qCAAqC,EAAA,UAAA,EAAA,CAAA;kBADjD,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACPlC;;AAEG;MAMU,yCAAyC,CAAA;iIAAzC,yCAAyC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;kIAAzC,yCAAyC,EAAA,CAAA,CAAA;AAAzC,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,yCAAyC,EAAA,SAAA,EAJzC;AACT,YAAA,EAAE,OAAO,EAAE,iCAAiC,EAAE,WAAW,EAAE,qCAAqC,EAAE;AACnG,SAAA,EAAA,CAAA,CAAA;;2FAEU,yCAAyC,EAAA,UAAA,EAAA,CAAA;kBALrD,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,SAAS,EAAE;AACT,wBAAA,EAAE,OAAO,EAAE,iCAAiC,EAAE,WAAW,EAAE,qCAAqC,EAAE;AACnG,qBAAA;AACF,iBAAA;;;ACbD;;AAEG;;;;"}
|
|
@@ -97,7 +97,6 @@ const daffCustomerStoreCreditInitialState = {
|
|
|
97
97
|
*/
|
|
98
98
|
const daffCustomerStoreCreditReducer = (state = daffCustomerStoreCreditInitialState, action) => {
|
|
99
99
|
switch (action.type) {
|
|
100
|
-
case DaffCustomerStoreCreditActionTypes.StoreCreditLoadAction:
|
|
101
100
|
case DaffCustomerStoreCreditActionTypes.StoreCreditLoadAction:
|
|
102
101
|
return daffStartResolution(state);
|
|
103
102
|
case DaffCustomerStoreCreditActionTypes.StoreCreditLoadSuccessAction:
|
|
@@ -156,10 +155,10 @@ class DaffCustomerStoreCreditPageFacade {
|
|
|
156
155
|
dispatch(action) {
|
|
157
156
|
this.store.dispatch(action);
|
|
158
157
|
}
|
|
159
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
160
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
158
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCustomerStoreCreditPageFacade, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
159
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCustomerStoreCreditPageFacade, providedIn: 'root' }); }
|
|
161
160
|
}
|
|
162
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
161
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCustomerStoreCreditPageFacade, decorators: [{
|
|
163
162
|
type: Injectable,
|
|
164
163
|
args: [{
|
|
165
164
|
providedIn: 'root',
|
|
@@ -184,10 +183,10 @@ class DaffCustomerStoreCreditEffects {
|
|
|
184
183
|
this.errorMatcher = errorMatcher;
|
|
185
184
|
this.list$ = createEffect(() => this.actions$.pipe(ofType(DaffCustomerStoreCreditActionTypes.StoreCreditLoadAction), switchMap((action) => this.driver.get().pipe(map(resp => new DaffCustomerStoreCreditLoadSuccess(resp)), catchError((error) => of(new DaffCustomerStoreCreditLoadFailure(this.errorMatcher(error))))))));
|
|
186
185
|
}
|
|
187
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
188
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
186
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCustomerStoreCreditEffects, deps: [{ token: i1$1.Actions }, { token: DaffCustomerStoreCreditDriver }, { token: DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
187
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCustomerStoreCreditEffects }); }
|
|
189
188
|
}
|
|
190
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
189
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCustomerStoreCreditEffects, decorators: [{
|
|
191
190
|
type: Injectable
|
|
192
191
|
}], ctorParameters: () => [{ type: i1$1.Actions }, { type: undefined, decorators: [{
|
|
193
192
|
type: Inject,
|
|
@@ -222,14 +221,14 @@ provider: provideDaffCustomerStoreCreditReducers, } = createSingleInjectionToken
|
|
|
222
221
|
* Creates the customer store credit feature store.
|
|
223
222
|
*/
|
|
224
223
|
class DaffCustomerStoreCreditStateModule {
|
|
225
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
226
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
227
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
224
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCustomerStoreCreditStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
225
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.1", ngImport: i0, type: DaffCustomerStoreCreditStateModule, imports: [i1.StoreFeatureModule, i1$1.EffectsFeatureModule] }); }
|
|
226
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCustomerStoreCreditStateModule, imports: [StoreModule.forFeature(DAFF_CUSTOMER_STORE_CREDIT_STORE_FEATURE_KEY, DAFF_CUSTOMER_STORE_CREDIT_REDUCERS),
|
|
228
227
|
EffectsModule.forFeature([
|
|
229
228
|
DaffCustomerStoreCreditEffects,
|
|
230
229
|
])] }); }
|
|
231
230
|
}
|
|
232
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
231
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCustomerStoreCreditStateModule, decorators: [{
|
|
233
232
|
type: NgModule,
|
|
234
233
|
args: [{
|
|
235
234
|
imports: [
|
|
@@ -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 { 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 * @example\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 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\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":";;;;;;;;;;;;AAKA;;AAEG;IACS;AAAZ,CAAA,UAAY,kCAAkC,EAAA;AAC5C,IAAA,kCAAA,CAAA,uBAAA,CAAA,GAAA,4DAAoF;AACpF,IAAA,kCAAA,CAAA,8BAAA,CAAA,GAAA,oEAAmG;AACnG,IAAA,kCAAA,CAAA,8BAAA,CAAA,GAAA,oEAAmG;AACnG,IAAA,kCAAA,CAAA,8BAAA,CAAA,GAAA,oEAAmG;AACrG,CAAC,EALW,kCAAkC,KAAlC,kCAAkC,GAK7C,EAAA,CAAA,CAAA;AAED;;AAEG;MACU,2BAA2B,CAAA;AAAxC,IAAA,WAAA,GAAA;AACW,QAAA,IAAA,CAAA,IAAI,GAAG,kCAAkC,CAAC,qBAAqB;;AACzE;AAED;;AAEG;MACU,kCAAkC,CAAA;AAG7C,IAAA,WAAA,CAAmB,OAAU,EAAA;QAAV,IAAO,CAAA,OAAA,GAAP,OAAO;AAFjB,QA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ACjB,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;;AC5BD;;AAEG;MASU,kCAAkC,CAAA;kIAAlC,kCAAkC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;mIAAlC,kCAAkC,EAAA,OAAA,EAAA,CAAA,EAAA,CAAA,kBAAA,EAAAC,IAAA,CAAA,oBAAA,CAAA,EAAA,CAAA,CAAA;mIAAlC,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;;4FAGO,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;;;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 { 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 * @example\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 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 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\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":";;;;;;;;;;;;AAKA;;AAEG;IACS;AAAZ,C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AAA;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;;;AClBD;;AAEG;;;;"}
|
|
@@ -19,10 +19,10 @@ class DaffCustomerStoreCreditFactory extends DaffModelFactory {
|
|
|
19
19
|
constructor() {
|
|
20
20
|
super(MockDaffCustomerStoreCredit);
|
|
21
21
|
}
|
|
22
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
23
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
22
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCustomerStoreCreditFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
23
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCustomerStoreCreditFactory, providedIn: 'root' }); }
|
|
24
24
|
}
|
|
25
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
25
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCustomerStoreCreditFactory, decorators: [{
|
|
26
26
|
type: Injectable,
|
|
27
27
|
args: [{
|
|
28
28
|
providedIn: 'root',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-customer-store-credit-testing.mjs","sources":["../../../libs/customer-store-credit/testing/src/factories/customer-store-credit.factory.ts","../../../libs/customer-store-credit/testing/src/daffodil-customer-store-credit-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\n\n/**\n * Mock class for {@link DaffCustomerStoreCredit}.\n */\nexport class MockDaffCustomerStoreCredit implements DaffCustomerStoreCredit {\n balance = faker.number.int({ min: 0, max: 1000 });\n};\n\n/**\n * Model factory for {@link DaffCustomerStoreCredit}.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCustomerStoreCreditFactory extends DaffModelFactory<DaffCustomerStoreCredit>{\n constructor() {\n super(MockDaffCustomerStoreCredit);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAMA;;AAEG;MACU,2BAA2B,CAAA;AAAxC,IAAA,WAAA,GAAA;AACE,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC
|
|
1
|
+
{"version":3,"file":"daffodil-customer-store-credit-testing.mjs","sources":["../../../libs/customer-store-credit/testing/src/factories/customer-store-credit.factory.ts","../../../libs/customer-store-credit/testing/src/daffodil-customer-store-credit-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\n\n/**\n * Mock class for {@link DaffCustomerStoreCredit}.\n */\nexport class MockDaffCustomerStoreCredit implements DaffCustomerStoreCredit {\n balance = faker.number.int({ min: 0, max: 1000 });\n};\n\n/**\n * Model factory for {@link DaffCustomerStoreCredit}.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCustomerStoreCreditFactory extends DaffModelFactory<DaffCustomerStoreCredit>{\n constructor() {\n super(MockDaffCustomerStoreCredit);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAMA;;AAEG;MACU,2BAA2B,CAAA;AAAxC,IAAA,WAAA,GAAA;AACE,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;IACnD;AAAC;AAAA;AAED;;AAEG;AAIG,MAAO,8BAA+B,SAAQ,gBAAyC,CAAA;AAC3F,IAAA,WAAA,GAAA;QACE,KAAK,CAAC,2BAA2B,CAAC;IACpC;iIAHW,8BAA8B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA9B,uBAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,8BAA8B,cAF7B,MAAM,EAAA,CAAA,CAAA;;2FAEP,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAH1C,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;AClBD;;AAEG;;;;"}
|
package/index.d.ts
CHANGED
|
@@ -1 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* A {@link DaffCustomer}'s store credit
|
|
3
|
+
*/
|
|
4
|
+
interface DaffCustomerStoreCredit {
|
|
5
|
+
/**
|
|
6
|
+
* The current balance of the customer's store credit.
|
|
7
|
+
*/
|
|
8
|
+
balance: number;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
declare const DAFF_CUSTOMER_STORE_CREDIT_ORDER_TOTAL_TYPE = "storeCredit";
|
|
12
|
+
|
|
13
|
+
export { DAFF_CUSTOMER_STORE_CREDIT_ORDER_TOTAL_TYPE };
|
|
14
|
+
export type { DaffCustomerStoreCredit };
|
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.89.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":"^20.0.0","@angular/core":"^20.0.0","@daffodil/customer":"0.89.0","@daffodil/customer-order":"0.89.0","@daffodil/core":"0.89.0","@ngrx/effects":"^20.0.0","@ngrx/store":"^20.0.0","rxjs":"7.8.1"},"optionalDependencies":{"@apollo/client":"^3.12.6","@daffodil/driver":"0.89.0","apollo-angular":"^11.0.0","@faker-js/faker":"^9.8.0"},"module":"fesm2022/daffodil-customer-store-credit.mjs","typings":"index.d.ts","exports":{"./package.json":{"default":"./package.json"},".":{"types":"./index.d.ts","default":"./fesm2022/daffodil-customer-store-credit.mjs"},"./driver":{"types":"./driver/index.d.ts","default":"./fesm2022/daffodil-customer-store-credit-driver.mjs"},"./routing":{"types":"./routing/index.d.ts","default":"./fesm2022/daffodil-customer-store-credit-routing.mjs"},"./state":{"types":"./state/index.d.ts","default":"./fesm2022/daffodil-customer-store-credit-state.mjs"},"./testing":{"types":"./testing/index.d.ts","default":"./fesm2022/daffodil-customer-store-credit-testing.mjs"},"./driver/in-memory":{"types":"./driver/in-memory/index.d.ts","default":"./fesm2022/daffodil-customer-store-credit-driver-in-memory.mjs"},"./driver/magento":{"types":"./driver/magento/index.d.ts","default":"./fesm2022/daffodil-customer-store-credit-driver-magento.mjs"},"./driver/testing":{"types":"./driver/testing/index.d.ts","default":"./fesm2022/daffodil-customer-store-credit-driver-testing.mjs"},"./state/testing":{"types":"./state/testing/index.d.ts","default":"./fesm2022/daffodil-customer-store-credit-state-testing.mjs"},"./driver/magento/testing":{"types":"./driver/magento/testing/index.d.ts","default":"./fesm2022/daffodil-customer-store-credit-driver-magento-testing.mjs"}},"sideEffects":false,"dependencies":{"tslib":"^2.3.0"}}
|
package/routing/index.d.ts
CHANGED
|
@@ -1 +1,29 @@
|
|
|
1
|
-
|
|
1
|
+
import { UrlTree } from '@angular/router';
|
|
2
|
+
import { Store } from '@ngrx/store';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
import * as i0 from '@angular/core';
|
|
5
|
+
import { DaffCustomerStoreCreditPageFacade } from '@daffodil/customer-store-credit/state';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* A guard that will clear customer state errors before allowing route deactivation.
|
|
9
|
+
*/
|
|
10
|
+
declare class DaffCustomerStoreCreditClearErrorsGuard {
|
|
11
|
+
private store;
|
|
12
|
+
constructor(store: Store<any>);
|
|
13
|
+
canDeactivate(): boolean | UrlTree | Observable<boolean | UrlTree> | Promise<boolean | UrlTree>;
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCustomerStoreCreditClearErrorsGuard, never>;
|
|
15
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffCustomerStoreCreditClearErrorsGuard>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Dispatches customer load.
|
|
20
|
+
*/
|
|
21
|
+
declare class DaffCustomerStoreCreditResolver {
|
|
22
|
+
private facade;
|
|
23
|
+
constructor(facade: DaffCustomerStoreCreditPageFacade);
|
|
24
|
+
resolve(): Observable<boolean>;
|
|
25
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCustomerStoreCreditResolver, never>;
|
|
26
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffCustomerStoreCreditResolver>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { DaffCustomerStoreCreditClearErrorsGuard, DaffCustomerStoreCreditResolver };
|
package/state/index.d.ts
CHANGED
|
@@ -1 +1,150 @@
|
|
|
1
|
-
|
|
1
|
+
import * as _ngrx_store from '@ngrx/store';
|
|
2
|
+
import { Action, ActionReducer, MemoizedSelector, Store } from '@ngrx/store';
|
|
3
|
+
import { DaffStateError, DaffOperationState, DaffOperationStateSelectors, DaffOperationStateFacadeInterface, daffTransformErrorToStateError } from '@daffodil/core/state';
|
|
4
|
+
import * as _daffodil_customer_store_credit from '@daffodil/customer-store-credit';
|
|
5
|
+
import { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';
|
|
6
|
+
import * as i0 from '@angular/core';
|
|
7
|
+
import { Observable } from 'rxjs';
|
|
8
|
+
import * as i2 from '@ngrx/effects';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The customer store credit action types enum.
|
|
12
|
+
*/
|
|
13
|
+
declare enum DaffCustomerStoreCreditActionTypes {
|
|
14
|
+
StoreCreditLoadAction = "[@daffodil/customer-store-credit] Store Credit Load Action",
|
|
15
|
+
StoreCreditLoadSuccessAction = "[@daffodil/customer-store-credit] Store Credit Load Success Action",
|
|
16
|
+
StoreCreditLoadFailureAction = "[@daffodil/customer-store-credit] Store Credit Load Failure Action",
|
|
17
|
+
StoreCreditClearErrorsAction = "[@daffodil/customer-store-credit] Store Credit Clear Errors Action"
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Loads the store credit of the current customer.
|
|
21
|
+
*/
|
|
22
|
+
declare class DaffCustomerStoreCreditLoad implements Action {
|
|
23
|
+
readonly type = DaffCustomerStoreCreditActionTypes.StoreCreditLoadAction;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Indicates a successful load of the customer's store credit.
|
|
27
|
+
*/
|
|
28
|
+
declare class DaffCustomerStoreCreditLoadSuccess<T extends DaffCustomerStoreCredit = DaffCustomerStoreCredit> implements Action {
|
|
29
|
+
payload: T;
|
|
30
|
+
readonly type = DaffCustomerStoreCreditActionTypes.StoreCreditLoadSuccessAction;
|
|
31
|
+
constructor(payload: T);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* A failed customer store credit load with the error message.
|
|
35
|
+
*/
|
|
36
|
+
declare class DaffCustomerStoreCreditLoadFailure implements Action {
|
|
37
|
+
payload: DaffStateError;
|
|
38
|
+
readonly type = DaffCustomerStoreCreditActionTypes.StoreCreditLoadFailureAction;
|
|
39
|
+
constructor(payload: DaffStateError);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* An action to clear all errors in state.
|
|
43
|
+
*/
|
|
44
|
+
declare class DaffCustomerStoreCreditClearErrors implements Action {
|
|
45
|
+
readonly type = DaffCustomerStoreCreditActionTypes.StoreCreditClearErrorsAction;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* A union of the customer action types.
|
|
49
|
+
*/
|
|
50
|
+
type DaffCustomerStoreCreditActions<TStoreCredit extends DaffCustomerStoreCredit = DaffCustomerStoreCredit> = DaffCustomerStoreCreditLoad | DaffCustomerStoreCreditLoadSuccess<TStoreCredit> | DaffCustomerStoreCreditLoadFailure | DaffCustomerStoreCreditClearErrors;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The customer store credit state.
|
|
54
|
+
*/
|
|
55
|
+
interface DaffCustomerStoreCreditReducerState<TStoreCredit extends DaffCustomerStoreCredit = DaffCustomerStoreCredit> extends DaffOperationState {
|
|
56
|
+
storeCredit: TStoreCredit;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* The initial state for the main customer store credit state, see {@link DaffCustomerStoreCreditReducerState}.
|
|
61
|
+
*/
|
|
62
|
+
declare const daffCustomerStoreCreditInitialState: DaffCustomerStoreCreditReducerState;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* The reducer for the customer store credit page state, see {@link DaffCustomerStoreCreditReducerState}.
|
|
66
|
+
*/
|
|
67
|
+
declare const daffCustomerStoreCreditReducer: <T extends DaffCustomerStoreCredit = DaffCustomerStoreCredit>(state: DaffCustomerStoreCreditReducerState<DaffCustomerStoreCredit>, action: DaffCustomerStoreCreditActions<T>) => DaffCustomerStoreCreditReducerState;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* The key under which the customer store credit feature state will be stored.
|
|
71
|
+
*/
|
|
72
|
+
declare const DAFF_CUSTOMER_STORE_CREDIT_STORE_FEATURE_KEY = "daffCustomerStoreCredit";
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* The feature state for customer store credit.
|
|
76
|
+
*/
|
|
77
|
+
interface DaffCustomerStoreCreditReducersState<TStoreCredit extends DaffCustomerStoreCredit = DaffCustomerStoreCredit> {
|
|
78
|
+
storeCredit: DaffCustomerStoreCreditReducerState<TStoreCredit>;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* The footprint of customer store credit feature state in the root application state.
|
|
82
|
+
*/
|
|
83
|
+
interface DaffCustomerStoreCreditStateRootSlice<TStoreCredit extends DaffCustomerStoreCredit = DaffCustomerStoreCredit> {
|
|
84
|
+
[DAFF_CUSTOMER_STORE_CREDIT_STORE_FEATURE_KEY]: DaffCustomerStoreCreditReducersState<TStoreCredit>;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
declare const DAFF_CUSTOMER_STORE_CREDIT_EXTRA_REDUCERS: i0.InjectionToken<ActionReducer<DaffCustomerStoreCreditReducersState<_daffodil_customer_store_credit.DaffCustomerStoreCredit>, _ngrx_store.Action<string>>[]>;
|
|
88
|
+
declare const daffCustomerStoreCreditProvideExtraReducers: <R extends ActionReducer<DaffCustomerStoreCreditReducersState<_daffodil_customer_store_credit.DaffCustomerStoreCredit>, _ngrx_store.Action<string>> = ActionReducer<DaffCustomerStoreCreditReducersState<_daffodil_customer_store_credit.DaffCustomerStoreCredit>, _ngrx_store.Action<string>>>(...values: R[]) => Array<i0.ValueProvider>;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Selectors for the main part of customer store credit state.
|
|
92
|
+
*/
|
|
93
|
+
interface DaffCustomerStoreCreditSelectors<T extends DaffCustomerStoreCredit = DaffCustomerStoreCredit> extends DaffOperationStateSelectors<DaffCustomerStoreCreditStateRootSlice<T>, DaffCustomerStoreCreditReducerState<T>> {
|
|
94
|
+
/**
|
|
95
|
+
* Selects the customer's current store credit balance.
|
|
96
|
+
*/
|
|
97
|
+
selectStoreCredit: MemoizedSelector<DaffCustomerStoreCreditStateRootSlice<T>, T>;
|
|
98
|
+
}
|
|
99
|
+
declare const daffCustomerStoreCreditGetSelectors: <T extends DaffCustomerStoreCredit = DaffCustomerStoreCredit>() => DaffCustomerStoreCreditSelectors<T>;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Selector for the customer store credit feature state.
|
|
103
|
+
*/
|
|
104
|
+
interface DaffCustomerStoreCreditFeatureSelector<TStoreCredit extends DaffCustomerStoreCredit = DaffCustomerStoreCredit> {
|
|
105
|
+
selectCustomerStoreCreditFeatureState: MemoizedSelector<DaffCustomerStoreCreditStateRootSlice<TStoreCredit>, DaffCustomerStoreCreditReducersState<TStoreCredit>>;
|
|
106
|
+
}
|
|
107
|
+
declare const getDaffCustomerStoreCreditReducersStateSelector: <TStoreCredit extends DaffCustomerStoreCredit = DaffCustomerStoreCredit>() => DaffCustomerStoreCreditFeatureSelector<TStoreCredit>;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Exposes the customer store credit state selectors.
|
|
111
|
+
*/
|
|
112
|
+
interface DaffCustomerStoreCreditPageFacadeInterface<T extends DaffCustomerStoreCredit = DaffCustomerStoreCredit> extends DaffOperationStateFacadeInterface<DaffCustomerStoreCreditReducerState> {
|
|
113
|
+
/**
|
|
114
|
+
* The customer's current store credit.
|
|
115
|
+
*/
|
|
116
|
+
storeCredit$: Observable<T>;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* @inheritdoc
|
|
121
|
+
*/
|
|
122
|
+
declare class DaffCustomerStoreCreditPageFacade<T extends DaffCustomerStoreCredit = DaffCustomerStoreCredit> implements DaffCustomerStoreCreditPageFacadeInterface<T> {
|
|
123
|
+
private store;
|
|
124
|
+
storeCredit$: Observable<T>;
|
|
125
|
+
loadingState$: Observable<DaffCustomerStoreCreditReducerState['daffState']>;
|
|
126
|
+
loading$: Observable<boolean>;
|
|
127
|
+
resolving$: Observable<boolean>;
|
|
128
|
+
mutating$: Observable<boolean>;
|
|
129
|
+
errors$: Observable<DaffCustomerStoreCreditReducerState['daffErrors']>;
|
|
130
|
+
hasErrors$: Observable<boolean>;
|
|
131
|
+
constructor(store: Store<DaffCustomerStoreCreditStateRootSlice>);
|
|
132
|
+
dispatch(action: Action): void;
|
|
133
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCustomerStoreCreditPageFacade<any>, never>;
|
|
134
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffCustomerStoreCreditPageFacade<any>>;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
declare const DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER: i0.InjectionToken<typeof daffTransformErrorToStateError>;
|
|
138
|
+
declare const provideDaffCustomerStoreCreditErrorMatcher: <R extends typeof daffTransformErrorToStateError = typeof daffTransformErrorToStateError>(value: R) => i0.ValueProvider;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Creates the customer store credit feature store.
|
|
142
|
+
*/
|
|
143
|
+
declare class DaffCustomerStoreCreditStateModule {
|
|
144
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCustomerStoreCreditStateModule, never>;
|
|
145
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffCustomerStoreCreditStateModule, never, [typeof _ngrx_store.StoreFeatureModule, typeof i2.EffectsFeatureModule], never>;
|
|
146
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DaffCustomerStoreCreditStateModule>;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
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 };
|
|
150
|
+
export type { DaffCustomerStoreCreditActions, DaffCustomerStoreCreditFeatureSelector, DaffCustomerStoreCreditPageFacadeInterface, DaffCustomerStoreCreditReducerState, DaffCustomerStoreCreditReducersState, DaffCustomerStoreCreditSelectors, DaffCustomerStoreCreditStateRootSlice };
|
package/state/testing/index.d.ts
CHANGED
|
@@ -1 +1,29 @@
|
|
|
1
|
-
|
|
1
|
+
import { Action } from '@ngrx/store';
|
|
2
|
+
import { BehaviorSubject } from 'rxjs';
|
|
3
|
+
import { MockDaffOperationStateFacade } from '@daffodil/core/state/testing';
|
|
4
|
+
import { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';
|
|
5
|
+
import { DaffCustomerStoreCreditPageFacadeInterface } from '@daffodil/customer-store-credit/state';
|
|
6
|
+
import * as i0 from '@angular/core';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Mocks out facade fields and methods for testing purposes.
|
|
10
|
+
*
|
|
11
|
+
* @inheritdoc
|
|
12
|
+
*/
|
|
13
|
+
declare class MockDaffCustomerStoreCreditPageFacade extends MockDaffOperationStateFacade implements DaffCustomerStoreCreditPageFacadeInterface {
|
|
14
|
+
storeCredit$: BehaviorSubject<DaffCustomerStoreCredit>;
|
|
15
|
+
dispatch(action: Action): void;
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MockDaffCustomerStoreCreditPageFacade, never>;
|
|
17
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MockDaffCustomerStoreCreditPageFacade>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Provides the {@link MockDaffCustomerStoreCreditPageFacade} for {@link DaffCustomerStoreCreditPageFacade}.
|
|
22
|
+
*/
|
|
23
|
+
declare class DaffCustomerStoreCreditStateTestingModule {
|
|
24
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCustomerStoreCreditStateTestingModule, never>;
|
|
25
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffCustomerStoreCreditStateTestingModule, never, never, never>;
|
|
26
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DaffCustomerStoreCreditStateTestingModule>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { DaffCustomerStoreCreditStateTestingModule, MockDaffCustomerStoreCreditPageFacade };
|
package/testing/index.d.ts
CHANGED
|
@@ -1 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
import { DaffModelFactory } from '@daffodil/core/testing';
|
|
2
|
+
import { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Mock class for {@link DaffCustomerStoreCredit}.
|
|
7
|
+
*/
|
|
8
|
+
declare class MockDaffCustomerStoreCredit implements DaffCustomerStoreCredit {
|
|
9
|
+
balance: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Model factory for {@link DaffCustomerStoreCredit}.
|
|
13
|
+
*/
|
|
14
|
+
declare class DaffCustomerStoreCreditFactory extends DaffModelFactory<DaffCustomerStoreCredit> {
|
|
15
|
+
constructor();
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCustomerStoreCreditFactory, never>;
|
|
17
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffCustomerStoreCreditFactory>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { DaffCustomerStoreCreditFactory, MockDaffCustomerStoreCredit };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { DAFF_CUSTOMER_STORE_CREDIT_ORDER_TOTAL_TYPE } from './store-credit-order-total-type';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const DAFF_CUSTOMER_STORE_CREDIT_ORDER_TOTAL_TYPE = "storeCredit";
|
package/driver/errors/codes.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { DaffError, DaffInheritableError } from '@daffodil/core';
|
|
2
|
-
export declare const DAFF_CUSTOMER_STORE_CREDIT_INVALID_API_RESPONSE_ERROR_CODE = "DAFF_CUSTOMER_STORE_CREDIT_INVALID_API_RESPONSE";
|
|
3
|
-
/**
|
|
4
|
-
* A general error indicating that the platform returned a response which cannot be processed.
|
|
5
|
-
*/
|
|
6
|
-
export declare class DaffCustomerStoreCreditInvalidAPIResponseError extends DaffInheritableError implements DaffError {
|
|
7
|
-
message: string;
|
|
8
|
-
readonly code: string;
|
|
9
|
-
constructor(message: string);
|
|
10
|
-
}
|
package/driver/errors/map.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { DaffCustomerStoreCreditInvalidAPIResponseError } from './invalid-api-response';
|
|
2
|
-
/**
|
|
3
|
-
* A mapping from error codes to error class constructors.
|
|
4
|
-
*/
|
|
5
|
-
export declare const DaffCustomerStoreCreditDriverErrorMap: {
|
|
6
|
-
DAFF_CUSTOMER_STORE_CREDIT_INVALID_API_RESPONSE: typeof DaffCustomerStoreCreditInvalidAPIResponseError;
|
|
7
|
-
};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export { DaffCustomerStoreCreditInvalidAPIResponseError, DAFF_CUSTOMER_STORE_CREDIT_INVALID_API_RESPONSE_ERROR_CODE, } from './invalid-api-response';
|
|
2
|
-
export { DaffCustomerStoreCreditDriverErrorMap } from './map';
|
|
3
|
-
export { DaffCustomerStoreCreditDriverErrorCodes } from './codes';
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { InMemoryDbService, RequestInfoUtilities, ParsedRequestUrl, RequestInfo } from 'angular-in-memory-web-api';
|
|
2
|
-
import { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';
|
|
3
|
-
import { DaffCustomerStoreCreditFactory } from '@daffodil/customer-store-credit/testing';
|
|
4
|
-
import { DaffInMemorySingleRouteableBackend } from '@daffodil/driver/in-memory';
|
|
5
|
-
import * as i0 from "@angular/core";
|
|
6
|
-
/**
|
|
7
|
-
* An in-memory service that handles customer store credit HTTP requests.
|
|
8
|
-
*/
|
|
9
|
-
export declare class DaffCustomerStoreCreditInMemoryBackendService implements InMemoryDbService, DaffInMemorySingleRouteableBackend {
|
|
10
|
-
private factory;
|
|
11
|
-
readonly collectionName = "customer-store-credit";
|
|
12
|
-
storeCredit: DaffCustomerStoreCredit;
|
|
13
|
-
constructor(factory: DaffCustomerStoreCreditFactory);
|
|
14
|
-
/**
|
|
15
|
-
* Automatically called as part of the InMemoryDbService to parse incoming urls to match the InMemory backend urls.
|
|
16
|
-
*
|
|
17
|
-
* @param url initial url
|
|
18
|
-
* @param utils utility to parse url
|
|
19
|
-
* @returns ParsedRequestUrl
|
|
20
|
-
* @docs-private
|
|
21
|
-
*/
|
|
22
|
-
parseRequestUrl(url: string, utils: RequestInfoUtilities): ParsedRequestUrl;
|
|
23
|
-
/**
|
|
24
|
-
* @docs-private
|
|
25
|
-
*/
|
|
26
|
-
createDb(): any;
|
|
27
|
-
/**
|
|
28
|
-
* Gets the customer's store credit.
|
|
29
|
-
*
|
|
30
|
-
* @param reqInfo request object
|
|
31
|
-
* @returns An http response object
|
|
32
|
-
*/
|
|
33
|
-
get(reqInfo: RequestInfo): import("rxjs").Observable<any>;
|
|
34
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCustomerStoreCreditInMemoryBackendService, never>;
|
|
35
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<DaffCustomerStoreCreditInMemoryBackendService>;
|
|
36
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const DAFF_CUSTOMER_STORE_CREDIT_IN_MEMORY_COLLECTION_NAME = "customer-store-credit";
|