@daffodil/customer-store-credit 0.76.0 → 0.78.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/README.md +9 -2
  2. package/driver/in-memory/backend/store-credit.service.d.ts +3 -1
  3. package/driver/in-memory/collection-name.const.d.ts +1 -0
  4. package/driver/in-memory/driver/store-credit.service.d.ts +4 -6
  5. package/esm2022/driver/in-memory/backend/store-credit.service.mjs +6 -4
  6. package/esm2022/driver/in-memory/collection-name.const.mjs +2 -0
  7. package/esm2022/driver/in-memory/driver/driver.module.mjs +8 -5
  8. package/esm2022/driver/in-memory/driver/store-credit.service.mjs +12 -11
  9. package/esm2022/driver/magento/customer-store-credit.service.mjs +4 -4
  10. package/esm2022/driver/magento/driver.module.mjs +5 -5
  11. package/esm2022/driver/magento/errors/transform.mjs +1 -1
  12. package/esm2022/driver/magento/testing/factories/customer-store-credit.factory.mjs +4 -4
  13. package/esm2022/driver/magento/validators/get-customer-store-credit.mjs +1 -1
  14. package/esm2022/driver/testing/drivers/driver.module.mjs +5 -5
  15. package/esm2022/driver/testing/drivers/store-credit.service.mjs +4 -4
  16. package/esm2022/routing/guards/clear-errors.guard.mjs +4 -4
  17. package/esm2022/routing/resolvers/customer-store-credit.resolver.mjs +4 -4
  18. package/esm2022/state/effects/store-credit.effects.mjs +4 -4
  19. package/esm2022/state/facades/store-credit/facade.mjs +4 -4
  20. package/esm2022/state/reducers/store-credit/reducer.mjs +1 -1
  21. package/esm2022/state/state.module.mjs +5 -5
  22. package/esm2022/state/testing/mock-facade.mjs +4 -4
  23. package/esm2022/state/testing/state-testing.module.mjs +5 -5
  24. package/esm2022/testing/factories/customer-store-credit.factory.mjs +4 -4
  25. package/fesm2022/daffodil-customer-store-credit-driver-in-memory.mjs +20 -17
  26. package/fesm2022/daffodil-customer-store-credit-driver-in-memory.mjs.map +1 -1
  27. package/fesm2022/daffodil-customer-store-credit-driver-magento-testing.mjs +3 -3
  28. package/fesm2022/daffodil-customer-store-credit-driver-magento-testing.mjs.map +1 -1
  29. package/fesm2022/daffodil-customer-store-credit-driver-magento.mjs +7 -7
  30. package/fesm2022/daffodil-customer-store-credit-driver-magento.mjs.map +1 -1
  31. package/fesm2022/daffodil-customer-store-credit-driver-testing.mjs +7 -7
  32. package/fesm2022/daffodil-customer-store-credit-driver-testing.mjs.map +1 -1
  33. package/fesm2022/daffodil-customer-store-credit-routing.mjs +6 -6
  34. package/fesm2022/daffodil-customer-store-credit-routing.mjs.map +1 -1
  35. package/fesm2022/daffodil-customer-store-credit-state-testing.mjs +7 -7
  36. package/fesm2022/daffodil-customer-store-credit-state-testing.mjs.map +1 -1
  37. package/fesm2022/daffodil-customer-store-credit-state.mjs +10 -10
  38. package/fesm2022/daffodil-customer-store-credit-state.mjs.map +1 -1
  39. package/fesm2022/daffodil-customer-store-credit-testing.mjs +3 -3
  40. package/fesm2022/daffodil-customer-store-credit-testing.mjs.map +1 -1
  41. package/package.json +1 -1
  42. package/state/reducers/token/extra.token.d.ts +1 -1
  43. package/state/reducers/token/reducers.token.d.ts +1 -1
@@ -162,10 +162,10 @@ class DaffCustomerStoreCreditPageFacade {
162
162
  dispatch(action) {
163
163
  this.store.dispatch(action);
164
164
  }
165
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: DaffCustomerStoreCreditPageFacade, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
166
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: DaffCustomerStoreCreditPageFacade, providedIn: 'root' }); }
165
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffCustomerStoreCreditPageFacade, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
166
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffCustomerStoreCreditPageFacade, providedIn: 'root' }); }
167
167
  }
168
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: DaffCustomerStoreCreditPageFacade, decorators: [{
168
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffCustomerStoreCreditPageFacade, decorators: [{
169
169
  type: Injectable,
170
170
  args: [{
171
171
  providedIn: 'root',
@@ -185,10 +185,10 @@ class DaffCustomerStoreCreditEffects {
185
185
  this.errorMatcher = errorMatcher;
186
186
  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))))))));
187
187
  }
188
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: DaffCustomerStoreCreditEffects, deps: [{ token: i1$1.Actions }, { token: DaffCustomerStoreCreditDriver }, { token: DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER }], target: i0.ɵɵFactoryTarget.Injectable }); }
189
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: DaffCustomerStoreCreditEffects }); }
188
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffCustomerStoreCreditEffects, deps: [{ token: i1$1.Actions }, { token: DaffCustomerStoreCreditDriver }, { token: DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER }], target: i0.ɵɵFactoryTarget.Injectable }); }
189
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffCustomerStoreCreditEffects }); }
190
190
  }
191
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: DaffCustomerStoreCreditEffects, decorators: [{
191
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffCustomerStoreCreditEffects, decorators: [{
192
192
  type: Injectable
193
193
  }], ctorParameters: () => [{ type: i1$1.Actions }, { type: undefined, decorators: [{
194
194
  type: Inject,
@@ -218,14 +218,14 @@ const DAFF_CUSTOMER_STORE_CREDIT_REDUCERS = new InjectionToken('DAFF_CUSTOMER_ST
218
218
  * Creates the customer store credit feature store.
219
219
  */
220
220
  class DaffCustomerStoreCreditStateModule {
221
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: DaffCustomerStoreCreditStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
222
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.10", ngImport: i0, type: DaffCustomerStoreCreditStateModule, imports: [i1.StoreFeatureModule, i1$1.EffectsFeatureModule] }); }
223
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: DaffCustomerStoreCreditStateModule, imports: [StoreModule.forFeature(DAFF_CUSTOMER_STORE_CREDIT_STORE_FEATURE_KEY, DAFF_CUSTOMER_STORE_CREDIT_REDUCERS),
221
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffCustomerStoreCreditStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
222
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.2", ngImport: i0, type: DaffCustomerStoreCreditStateModule, imports: [i1.StoreFeatureModule, i1$1.EffectsFeatureModule] }); }
223
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffCustomerStoreCreditStateModule, imports: [StoreModule.forFeature(DAFF_CUSTOMER_STORE_CREDIT_STORE_FEATURE_KEY, DAFF_CUSTOMER_STORE_CREDIT_REDUCERS),
224
224
  EffectsModule.forFeature([
225
225
  DaffCustomerStoreCreditEffects,
226
226
  ])] }); }
227
227
  }
228
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: DaffCustomerStoreCreditStateModule, decorators: [{
228
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffCustomerStoreCreditStateModule, decorators: [{
229
229
  type: NgModule,
230
230
  args: [{
231
231
  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 { 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;A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AlC,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;;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,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 {\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;A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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;;;;"}
@@ -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: "17.3.10", ngImport: i0, type: DaffCustomerStoreCreditFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
23
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: DaffCustomerStoreCreditFactory, providedIn: 'root' }); }
22
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffCustomerStoreCreditFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
23
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffCustomerStoreCreditFactory, providedIn: 'root' }); }
24
24
  }
25
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: DaffCustomerStoreCreditFactory, decorators: [{
25
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", 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.datatype.number({ 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,QAAQ,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC;KACxD;AAAA,CAAA;AAAA,CAAC;AAEF;;AAEG;AAIG,MAAO,8BAA+B,SAAQ,gBAAyC,CAAA;AAC3F,IAAA,WAAA,GAAA;QACE,KAAK,CAAC,2BAA2B,CAAC,CAAC;KACpC;kIAHU,8BAA8B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA,EAAA;AAA9B,uBAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,8BAA8B,cAF7B,MAAM,EAAA,CAAA,CAAA,EAAA;;4FAEP,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAH1C,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA,CAAA;;;AClBD;;AAEG;;;;"}
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.datatype.number({ 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,QAAQ,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC;KACxD;AAAA,CAAA;AAAA,CAAC;AAEF;;AAEG;AAIG,MAAO,8BAA+B,SAAQ,gBAAyC,CAAA;AAC3F,IAAA,WAAA,GAAA;QACE,KAAK,CAAC,2BAA2B,CAAC,CAAC;KACpC;iIAHU,8BAA8B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA,EAAA;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,EAAA;;2FAEP,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAH1C,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,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.76.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":"^17.0.0","@angular/core":"^17.0.0","@daffodil/customer":"0.76.0","@daffodil/customer-order":"0.76.0","@daffodil/core":"0.76.0","@ngrx/effects":"^17.0.0","@ngrx/store":"^17.0.0","rxjs":"7.8.1"},"optionalDependencies":{"@apollo/client":"^3.0.0","@daffodil/driver":"0.76.0","apollo-angular":"^6.0.0","@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
+ {"name":"@daffodil/customer-store-credit","nx":{"targets":{"build":{"outputs":["{workspaceRoot}/dist/customer-store-credit"]}}},"version":"0.78.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.78.0","@daffodil/customer-order":"0.78.0","@daffodil/core":"0.78.0","@ngrx/effects":"^18.0.2","@ngrx/store":"^18.0.2","rxjs":"7.8.1"},"optionalDependencies":{"@apollo/client":"^3.0.0","@daffodil/driver":"0.78.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"}}
@@ -6,7 +6,7 @@ import { DaffCustomerStoreCreditReducersState } from '../reducers.interface';
6
6
  *
7
7
  * Prefer using {@link daffCustomerStoreCreditProvideExtraReducers}.
8
8
  */
9
- export declare const DAFF_CUSTOMER_STORE_CREDIT_EXTRA_REDUCERS: InjectionToken<ActionReducer<DaffCustomerStoreCreditReducersState<import("@daffodil/customer-store-credit").DaffCustomerStoreCredit>, import("@ngrx/store").Action>[]>;
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
10
  /**
11
11
  * Provides additional reducers that run after the standard Daffodil customer reducers.
12
12
  *
@@ -8,4 +8,4 @@ import { DaffCustomerStoreCreditReducersState } from '../reducers.interface';
8
8
  *
9
9
  * @docs-private
10
10
  */
11
- export declare const DAFF_CUSTOMER_STORE_CREDIT_REDUCERS: InjectionToken<ActionReducer<DaffCustomerStoreCreditReducersState<DaffCustomerStoreCredit>, import("@ngrx/store").Action>>;
11
+ export declare const DAFF_CUSTOMER_STORE_CREDIT_REDUCERS: InjectionToken<ActionReducer<DaffCustomerStoreCreditReducersState<DaffCustomerStoreCredit>, import("@ngrx/store").Action<string>>>;