@daffodil/customer-store-credit 0.64.2 → 0.66.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.
@@ -1,4 +1,3 @@
1
1
  export * from './models/public_api';
2
- export * from './injection-tokens/public_api';
3
2
  export * from './constants/public_api';
4
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYnMvY3VzdG9tZXItc3RvcmUtY3JlZGl0L3NyYy9wdWJsaWNfYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMscUJBQXFCLENBQUM7QUFDcEMsY0FBYywrQkFBK0IsQ0FBQztBQUM5QyxjQUFjLHdCQUF3QixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSAnLi9tb2RlbHMvcHVibGljX2FwaSc7XG5leHBvcnQgKiBmcm9tICcuL2luamVjdGlvbi10b2tlbnMvcHVibGljX2FwaSc7XG5leHBvcnQgKiBmcm9tICcuL2NvbnN0YW50cy9wdWJsaWNfYXBpJztcbiJdfQ==
3
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYnMvY3VzdG9tZXItc3RvcmUtY3JlZGl0L3NyYy9wdWJsaWNfYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMscUJBQXFCLENBQUM7QUFDcEMsY0FBYyx3QkFBd0IsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gJy4vbW9kZWxzL3B1YmxpY19hcGknO1xuZXhwb3J0ICogZnJvbSAnLi9jb25zdGFudHMvcHVibGljX2FwaSc7XG4iXX0=
@@ -2,9 +2,9 @@ import { Injectable, Inject, } from '@angular/core';
2
2
  import { Actions, createEffect, ofType, } from '@ngrx/effects';
3
3
  import { of } from 'rxjs';
4
4
  import { switchMap, map, catchError, } from 'rxjs/operators';
5
- import { DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER, } from '@daffodil/customer-store-credit';
6
5
  import { DaffCustomerStoreCreditDriver, } from '@daffodil/customer-store-credit/driver';
7
6
  import { DaffCustomerStoreCreditActionTypes, DaffCustomerStoreCreditLoadFailure, DaffCustomerStoreCreditLoadSuccess, } from '../actions/store-credit.actions';
7
+ import { DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER } from '../injection-tokens/public_api';
8
8
  import * as i0 from "@angular/core";
9
9
  import * as i1 from "@ngrx/effects";
10
10
  export class DaffCustomerStoreCreditEffects {
@@ -26,4 +26,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
26
26
  type: Inject,
27
27
  args: [DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER]
28
28
  }] }]; } });
29
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RvcmUtY3JlZGl0LmVmZmVjdHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9saWJzL2N1c3RvbWVyLXN0b3JlLWNyZWRpdC9zdGF0ZS9zcmMvZWZmZWN0cy9zdG9yZS1jcmVkaXQuZWZmZWN0cy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQ0wsVUFBVSxFQUNWLE1BQU0sR0FDUCxNQUFNLGVBQWUsQ0FBQztBQUN2QixPQUFPLEVBQ0wsT0FBTyxFQUNQLFlBQVksRUFDWixNQUFNLEdBQ1AsTUFBTSxlQUFlLENBQUM7QUFDdkIsT0FBTyxFQUFFLEVBQUUsRUFBRSxNQUFNL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'@angular/core';
2
+ import { daffTransformErrorToStateError } from '@daffodil/core/state';
3
+ /**
4
+ * Transforms `DaffError`s into `DaffStateError`s before they are serialized into state.
5
+ * Can be used to further refine Daffodil errors into more specific app errors.
6
+ */
7
+ export const DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER = new InjectionToken('DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER', { factory: () => daffTransformErrorToStateError });
8
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXJyb3ItbWF0Y2hlci50b2tlbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL2xpYnMvY3VzdG9tZXItc3RvcmUtY3JlZGl0L3N0YXRlL3NyYy9pbmplY3Rpb24tdG9rZW5zL2Vycm9yLW1hdGNoZXIudG9rZW4udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUUvQyxPQUFPLEVBQUUsOEJBQThCLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUV0RTs7O0dBR0c7QUFDSCxNQUFNLENBQUMsTUFBTSx3Q0FBd0MsR0FBRyxJQUFJLGNBQWMsQ0FDeEUsMENBQTBDLEVBQzFDLEVBQUUsT0FBTyxFQUFFLEdBQUcsRUFBRSxDQUFDLDhCQUE4QixFQUFFLENBQ2xELENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBJbmplY3Rpb25Ub2tlbiB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuXG5pbXBvcnQgeyBkYWZmVHJhbnNmb3JtRXJyb3JUb1N0YXRlRXJyb3IgfSBmcm9tICdAZGFmZm9kaWwvY29yZS9zdGF0ZSc7XG5cbi8qKlxuICogVHJhbnNmb3JtcyBgRGFmZkVycm9yYHMgaW50byBgRGFmZlN0YXRlRXJyb3JgcyBiZWZvcmUgdGhleSBhcmUgc2VyaWFsaXplZCBpbnRvIHN0YXRlLlxuICogQ2FuIGJlIHVzZWQgdG8gZnVydGhlciByZWZpbmUgRGFmZm9kaWwgZXJyb3JzIGludG8gbW9yZSBzcGVjaWZpYyBhcHAgZXJyb3JzLlxuICovXG5leHBvcnQgY29uc3QgREFGRl9DVVNUT01FUl9TVE9SRV9DUkVESVRfRVJST1JfTUFUQ0hFUiA9IG5ldyBJbmplY3Rpb25Ub2tlbjx0eXBlb2YgZGFmZlRyYW5zZm9ybUVycm9yVG9TdGF0ZUVycm9yPihcbiAgJ0RBRkZfQ1VTVE9NRVJfU1RPUkVfQ1JFRElUX0VSUk9SX01BVENIRVInLFxuICB7IGZhY3Rvcnk6ICgpID0+IGRhZmZUcmFuc2Zvcm1FcnJvclRvU3RhdGVFcnJvciB9LFxuKTtcbiJdfQ==
@@ -0,0 +1,2 @@
1
+ export { DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER } from './error-matcher.token';
2
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL2xpYnMvY3VzdG9tZXItc3RvcmUtY3JlZGl0L3N0YXRlL3NyYy9pbmplY3Rpb24tdG9rZW5zL3B1YmxpY19hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLHdDQUF3QyxFQUFFLE1BQU0sdUJBQXVCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgeyBEQUZGX0NVU1RPTUVSX1NUT1JFX0NSRURJVF9FUlJPUl9NQVRDSEVSIH0gZnJvbSAnLi9lcnJvci1tYXRjaGVyLnRva2VuJztcbiJdfQ==
@@ -2,5 +2,6 @@ export * from './actions/public_api';
2
2
  export * from './reducers/public_api';
3
3
  export * from './selectors/public_api';
4
4
  export * from './facades/public_api';
5
+ export * from './injection-tokens/public_api';
5
6
  export * from './state.module';
6
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYnMvY3VzdG9tZXItc3RvcmUtY3JlZGl0L3N0YXRlL3NyYy9wdWJsaWNfYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsc0JBQXNCLENBQUM7QUFDckMsY0FBYyx1QkFBdUIsQ0FBQztBQUN0QyxjQUFjLHdCQUF3QixDQUFDO0FBQ3ZDLGNBQWMsc0JBQXNCLENBQUM7QUFFckMsY0FBYyxnQkFBZ0IsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gJy4vYWN0aW9ucy9wdWJsaWNfYXBpJztcbmV4cG9ydCAqIGZyb20gJy4vcmVkdWNlcnMvcHVibGljX2FwaSc7XG5leHBvcnQgKiBmcm9tICcuL3NlbGVjdG9ycy9wdWJsaWNfYXBpJztcbmV4cG9ydCAqIGZyb20gJy4vZmFjYWRlcy9wdWJsaWNfYXBpJztcblxuZXhwb3J0ICogZnJvbSAnLi9zdGF0ZS5tb2R1bGUnO1xuIl19
7
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYnMvY3VzdG9tZXItc3RvcmUtY3JlZGl0L3N0YXRlL3NyYy9wdWJsaWNfYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsc0JBQXNCLENBQUM7QUFDckMsY0FBYyx1QkFBdUIsQ0FBQztBQUN0QyxjQUFjLHdCQUF3QixDQUFDO0FBQ3ZDLGNBQWMsc0JBQXNCLENBQUM7QUFDckMsY0FBYywrQkFBK0IsQ0FBQztBQUU5QyxjQUFjLGdCQUFnQixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSAnLi9hY3Rpb25zL3B1YmxpY19hcGknO1xuZXhwb3J0ICogZnJvbSAnLi9yZWR1Y2Vycy9wdWJsaWNfYXBpJztcbmV4cG9ydCAqIGZyb20gJy4vc2VsZWN0b3JzL3B1YmxpY19hcGknO1xuZXhwb3J0ICogZnJvbSAnLi9mYWNhZGVzL3B1YmxpY19hcGknO1xuZXhwb3J0ICogZnJvbSAnLi9pbmplY3Rpb24tdG9rZW5zL3B1YmxpY19hcGknO1xuXG5leHBvcnQgKiBmcm9tICcuL3N0YXRlLm1vZHVsZSc7XG4iXX0=
@@ -1,13 +1,12 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { InjectionToken, Injectable, Inject, inject, NgModule } from '@angular/core';
3
- import { daffOperationInitialState, daffOperationFailed, daffCompleteOperation, daffStartResolution, daffOperationStateSelectorFactory, daffComposeReducers } from '@daffodil/core/state';
3
+ import { daffOperationInitialState, daffOperationFailed, daffCompleteOperation, daffStartResolution, daffOperationStateSelectorFactory, daffTransformErrorToStateError, daffComposeReducers } from '@daffodil/core/state';
4
4
  import * as i1 from '@ngrx/store';
5
5
  import { createFeatureSelector, createSelector, select, combineReducers, StoreModule } from '@ngrx/store';
6
6
  import * as i1$1 from '@ngrx/effects';
7
7
  import { createEffect, ofType, EffectsModule } from '@ngrx/effects';
8
8
  import { of } from 'rxjs';
9
9
  import { switchMap, map, catchError } from 'rxjs/operators';
10
- import { DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER } from '@daffodil/customer-store-credit';
11
10
  import { DaffCustomerStoreCreditDriver } from '@daffodil/customer-store-credit/driver';
12
11
 
13
12
  /**
@@ -164,6 +163,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
164
163
  }]
165
164
  }], ctorParameters: function () { return [{ type: i1.Store }]; } });
166
165
 
166
+ /**
167
+ * Transforms `DaffError`s into `DaffStateError`s before they are serialized into state.
168
+ * Can be used to further refine Daffodil errors into more specific app errors.
169
+ */
170
+ const DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER = new InjectionToken('DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER', { factory: () => daffTransformErrorToStateError });
171
+
167
172
  class DaffCustomerStoreCreditEffects {
168
173
  constructor(actions$, driver, errorMatcher) {
169
174
  this.actions$ = actions$;
@@ -229,5 +234,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
229
234
  * Generated bundle index. Do not edit.
230
235
  */
231
236
 
232
- export { DAFF_CUSTOMER_STORE_CREDIT_EXTRA_REDUCERS, DAFF_CUSTOMER_STORE_CREDIT_STORE_FEATURE_KEY, DaffCustomerStoreCreditActionTypes, DaffCustomerStoreCreditClearErrors, DaffCustomerStoreCreditLoad, DaffCustomerStoreCreditLoadFailure, DaffCustomerStoreCreditLoadSuccess, DaffCustomerStoreCreditPageFacade, DaffCustomerStoreCreditStateModule, daffCustomerProvideExtraReducers, daffCustomerStoreCreditGetSelectors, daffCustomerStoreCreditInitialState, daffCustomerStoreCreditReducer, getDaffCustomerStoreCreditReducersStateSelector };
237
+ 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, daffCustomerProvideExtraReducers, daffCustomerStoreCreditGetSelectors, daffCustomerStoreCreditInitialState, daffCustomerStoreCreditReducer, getDaffCustomerStoreCreditReducersStateSelector };
233
238
  //# sourceMappingURL=daffodil-customer-store-credit-state.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-customer-store-credit-state.mjs","sources":["../../../libs/customer-store-credit/state/src/actions/store-credit.actions.ts","../../../libs/customer-store-credit/state/src/reducers/store-feature-key.ts","../../../libs/customer-store-credit/state/src/reducers/token/extra.token.ts","../../../libs/customer-store-credit/state/src/reducers/store-credit/initial-state.ts","../../../libs/customer-store-credit/state/src/reducers/store-credit/reducer.ts","../../../libs/customer-store-credit/state/src/selectors/feature.selector.ts","../../../libs/customer-store-credit/state/src/selectors/store-credit/selector.ts","../../../libs/customer-store-credit/state/src/facades/store-credit/facade.ts","../../../libs/customer-store-credit/state/src/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 daffCustomerProvideExtraReducers}.\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 * ...daffCustomerProvideExtraReducers(\n * myReducer1,\n * myReducer2\n * )\n * ]\n * ```\n */\nexport function daffCustomerProvideExtraReducers(\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 {\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 {\n DaffCustomerStoreCredit,\n DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER,\n} 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';\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\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CAAyC,CAAC;KACrD,CAAC;AACH,CAAA,CACF;;AC1BD;;AAEG;MASU,kCAAkC,CAAA;;kJAAlC,kCAAkC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;mJAAlC,kCAAkC,EAAA,OAAA,EAAA,CAAA,EAAA,CAAA,kBAAA,EAAAC,IAAA,CAAA,oBAAA,CAAA,EAAA,CAAA,CAAA;mJAAlC,kCAAkC,EAAA,OAAA,EAAA,CAN3C,WAAW,CAAC,UAAU,CAAC,4CAA4C,EAAE,mCAAmC,CAAC;QACzG,aAAa,CAAC,UAAU,CAAC;YACvB,8BAA8B;SAC/B,CAAC,CAAA,EAAA,CAAA,CAAA;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;iBACF,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 daffCustomerProvideExtraReducers}.\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 * ...daffCustomerProvideExtraReducers(\n * myReducer1,\n * myReducer2\n * )\n * ]\n * ```\n */\nexport function daffCustomerProvideExtraReducers(\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;AACS,IAAA,mCAKX;AALD,CAAA,UAAY,kCAAkC,EAAA;AAC5C,IAAA,kCAAA,CAAA,uBAAA,CAAA,GAAA,4DAAoF,CAAA;AACpF,IAAA,k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,CAAA;;kJAAlC,kCAAkC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;mJAAlC,kCAAkC,EAAA,OAAA,EAAA,CAAA,EAAA,CAAA,kBAAA,EAAAC,IAAA,CAAA,oBAAA,CAAA,EAAA,CAAA,CAAA;mJAAlC,kCAAkC,EAAA,OAAA,EAAA,CAN3C,WAAW,CAAC,UAAU,CAAC,4CAA4C,EAAE,mCAAmC,CAAC;QACzG,aAAa,CAAC,UAAU,CAAC;YACvB,8BAA8B;SAC/B,CAAC,CAAA,EAAA,CAAA,CAAA;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;iBACF,CAAA;;;AClBD;;AAEG;;;;"}
@@ -1,17 +1,8 @@
1
- import { InjectionToken } from '@angular/core';
2
- import { daffTransformErrorToStateError } from '@daffodil/core/state';
3
-
4
- /**
5
- * Transforms `DaffError`s into `DaffStateError`s before they are serialized into state.
6
- * Can be used to further refine Daffodil errors into more specific app errors.
7
- */
8
- const DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER = new InjectionToken('DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER', { factory: () => daffTransformErrorToStateError });
9
-
10
1
  const DAFF_CUSTOMER_STORE_CREDIT_ORDER_TOTAL_TYPE = 'storeCredit';
11
2
 
12
3
  /**
13
4
  * Generated bundle index. Do not edit.
14
5
  */
15
6
 
16
- export { DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER, DAFF_CUSTOMER_STORE_CREDIT_ORDER_TOTAL_TYPE };
7
+ export { DAFF_CUSTOMER_STORE_CREDIT_ORDER_TOTAL_TYPE };
17
8
  //# sourceMappingURL=daffodil-customer-store-credit.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-customer-store-credit.mjs","sources":["../../../libs/customer-store-credit/src/injection-tokens/error-matcher.token.ts","../../../libs/customer-store-credit/src/constants/store-credit-order-total-type.ts","../../../libs/customer-store-credit/src/daffodil-customer-store-credit.ts"],"sourcesContent":["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","export const DAFF_CUSTOMER_STORE_CREDIT_ORDER_TOTAL_TYPE = 'storeCredit';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAIA;;;AAGG;AACU,MAAA,wCAAwC,GAAG,IAAI,cAAc,CACxE,0CAA0C,EAC1C,EAAE,OAAO,EAAE,MAAM,8BAA8B,EAAE;;ACV5C,MAAM,2CAA2C,GAAG;;ACA3D;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-customer-store-credit.mjs","sources":["../../../libs/customer-store-credit/src/constants/store-credit-order-total-type.ts","../../../libs/customer-store-credit/src/daffodil-customer-store-credit.ts"],"sourcesContent":["export const DAFF_CUSTOMER_STORE_CREDIT_ORDER_TOTAL_TYPE = 'storeCredit';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAAO,MAAM,2CAA2C,GAAG;;ACA3D;;AAEG;;;;"}
@@ -1,13 +1,12 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { InjectionToken, Injectable, Inject, inject, NgModule } from '@angular/core';
3
- import { daffOperationInitialState, daffOperationFailed, daffCompleteOperation, daffStartResolution, daffOperationStateSelectorFactory, daffComposeReducers } from '@daffodil/core/state';
3
+ import { daffOperationInitialState, daffOperationFailed, daffCompleteOperation, daffStartResolution, daffOperationStateSelectorFactory, daffTransformErrorToStateError, daffComposeReducers } from '@daffodil/core/state';
4
4
  import * as i1 from '@ngrx/store';
5
5
  import { createFeatureSelector, createSelector, select, combineReducers, StoreModule } from '@ngrx/store';
6
6
  import * as i1$1 from '@ngrx/effects';
7
7
  import { createEffect, ofType, EffectsModule } from '@ngrx/effects';
8
8
  import { of } from 'rxjs';
9
9
  import { switchMap, map, catchError } from 'rxjs/operators';
10
- import { DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER } from '@daffodil/customer-store-credit';
11
10
  import { DaffCustomerStoreCreditDriver } from '@daffodil/customer-store-credit/driver';
12
11
 
13
12
  /**
@@ -173,6 +172,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
173
172
  }]
174
173
  }], ctorParameters: function () { return [{ type: i1.Store }]; } });
175
174
 
175
+ /**
176
+ * Transforms `DaffError`s into `DaffStateError`s before they are serialized into state.
177
+ * Can be used to further refine Daffodil errors into more specific app errors.
178
+ */
179
+ const DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER = new InjectionToken('DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER', { factory: () => daffTransformErrorToStateError });
180
+
176
181
  class DaffCustomerStoreCreditEffects {
177
182
  constructor(actions$, driver, errorMatcher) {
178
183
  this.actions$ = actions$;
@@ -236,5 +241,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
236
241
  * Generated bundle index. Do not edit.
237
242
  */
238
243
 
239
- export { DAFF_CUSTOMER_STORE_CREDIT_EXTRA_REDUCERS, DAFF_CUSTOMER_STORE_CREDIT_STORE_FEATURE_KEY, DaffCustomerStoreCreditActionTypes, DaffCustomerStoreCreditClearErrors, DaffCustomerStoreCreditLoad, DaffCustomerStoreCreditLoadFailure, DaffCustomerStoreCreditLoadSuccess, DaffCustomerStoreCreditPageFacade, DaffCustomerStoreCreditStateModule, daffCustomerProvideExtraReducers, daffCustomerStoreCreditGetSelectors, daffCustomerStoreCreditInitialState, daffCustomerStoreCreditReducer, getDaffCustomerStoreCreditReducersStateSelector };
244
+ export { DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER, DAFF_CUSTOMER_STORE_CREDIT_EXTRA_REDUCERS, DAFF_CUSTOMER_STORE_CREDIT_STORE_FEATURE_KEY, DaffCustomerStoreCreditActionTypes, DaffCustomerStoreCreditClearErrors, DaffCustomerStoreCreditLoad, DaffCustomerStoreCreditLoadFailure, DaffCustomerStoreCreditLoadSuccess, DaffCustomerStoreCreditPageFacade, DaffCustomerStoreCreditStateModule, daffCustomerProvideExtraReducers, daffCustomerStoreCreditGetSelectors, daffCustomerStoreCreditInitialState, daffCustomerStoreCreditReducer, getDaffCustomerStoreCreditReducersStateSelector };
240
245
  //# sourceMappingURL=daffodil-customer-store-credit-state.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-customer-store-credit-state.mjs","sources":["../../../libs/customer-store-credit/state/src/actions/store-credit.actions.ts","../../../libs/customer-store-credit/state/src/reducers/store-feature-key.ts","../../../libs/customer-store-credit/state/src/reducers/token/extra.token.ts","../../../libs/customer-store-credit/state/src/reducers/store-credit/initial-state.ts","../../../libs/customer-store-credit/state/src/reducers/store-credit/reducer.ts","../../../libs/customer-store-credit/state/src/selectors/feature.selector.ts","../../../libs/customer-store-credit/state/src/selectors/store-credit/selector.ts","../../../libs/customer-store-credit/state/src/facades/store-credit/facade.ts","../../../libs/customer-store-credit/state/src/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 daffCustomerProvideExtraReducers}.\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 * ...daffCustomerProvideExtraReducers(\n * myReducer1,\n * myReducer2\n * )\n * ]\n * ```\n */\nexport function daffCustomerProvideExtraReducers(\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 {\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 {\n DaffCustomerStoreCredit,\n DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER,\n} 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';\n\n@Injectable()\nexport class DaffCustomerStoreCreditEffects<\n T extends DaffCustomerStoreCredit = DaffCustomerStoreCredit,\n> {\n constructor(\n private actions$: Actions<DaffCustomerStoreCreditActions<T>>,\n @Inject(DaffCustomerStoreCreditDriver) private driver: DaffCustomerStoreCreditDriverInterface<T>,\n @Inject(DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER) private errorMatcher: ErrorTransformer,\n ) {}\n\n list$ = createEffect(() => this.actions$.pipe(\n ofType(DaffCustomerStoreCreditActionTypes.StoreCreditLoadAction),\n switchMap((action) =>\n this.driver.get().pipe(\n map(resp => new DaffCustomerStoreCreditLoadSuccess<T>(resp)),\n catchError((error: DaffError) => of(new DaffCustomerStoreCreditLoadFailure(this.errorMatcher(error)))),\n ),\n ),\n ));\n}\n","import {\n inject,\n InjectionToken,\n} from '@angular/core';\nimport {\n ActionReducer,\n combineReducers,\n} from '@ngrx/store';\n\nimport { daffComposeReducers } from '@daffodil/core/state';\n// these unused imports are a workaround\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\n\nimport { DAFF_CUSTOMER_STORE_CREDIT_EXTRA_REDUCERS } from './extra.token';\nimport { DaffCustomerStoreCreditReducersState } from '../reducers.interface';\nimport { daffCustomerStoreCreditReducer } from '../store-credit/public_api';\n\n/**\n * An internal token to hold the Daffodil customer reducers.\n * Includes the extra and standard reducers.\n *\n * @docs-private\n */\nexport const DAFF_CUSTOMER_STORE_CREDIT_REDUCERS = new InjectionToken<ActionReducer<DaffCustomerStoreCreditReducersState>>(\n 'DAFF_CUSTOMER_STORE_CREDIT_REDUCERS',\n {\n providedIn: 'any',\n factory: () => daffComposeReducers([\n combineReducers({\n storeCredit: daffCustomerStoreCreditReducer,\n }),\n ...inject(DAFF_CUSTOMER_STORE_CREDIT_EXTRA_REDUCERS),\n ]),\n },\n);\n","import { NgModule } from '@angular/core';\nimport { EffectsModule } from '@ngrx/effects';\nimport { StoreModule } from '@ngrx/store';\n\nimport { DaffCustomerStoreCreditEffects } from './effects/store-credit.effects';\nimport { DAFF_CUSTOMER_STORE_CREDIT_STORE_FEATURE_KEY } from './reducers/public_api';\nimport { DAFF_CUSTOMER_STORE_CREDIT_REDUCERS } from './reducers/token/reducers.token';\n\n/**\n * Creates the customer store credit feature store.\n */\n@NgModule({\n imports: [\n StoreModule.forFeature(DAFF_CUSTOMER_STORE_CREDIT_STORE_FEATURE_KEY, DAFF_CUSTOMER_STORE_CREDIT_REDUCERS),\n EffectsModule.forFeature([\n DaffCustomerStoreCreditEffects,\n ]),\n ],\n})\nexport class DaffCustomerStoreCreditStateModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2"],"mappings":";;;;;;;;;;;;AAMA;;AAEG;IACS,mCAKX;AALD,CAAA,UAAY,kCAAkC,EAAA;AAC5C,IAAA,kCAAA,CAAA,uBAAA,CAAA,GAAA,4DAAoF,CAAA;AACpF,IAAA,kCAAA,CAAA,8BAAA,CAAA,GAAA,oEAAmG,CAAA;AACnG,IAAA,kCAAA,CAAA,8BAAA,CAAA,GAAA,oEAAmG,CAAA;AACnG,IAAA,kCAAA,CAAA,8BAAA,CAAA,GAAA,oEAAmG,CAAA;AACrG,CAAC,EALW,kCAAkC,KAAlC,kCAAkC,GAK7C,EAAA,CAAA,CAAA,CAAA;AAED;;AAEG;MACU,2BAA2B,CAAA;AAAxC,IAAA,WAAA,GAAA;AACW,QAAA,IAAA,CAAA,IAAI,GAAG,kCAAkC,CAAC,qBAAqB,CAAC;KAC1E;AAAA,CAAA;AAED;;AAEG;MACU,kCAAkC,CAAA;A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;;"}
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 daffCustomerProvideExtraReducers}.\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 * ...daffCustomerProvideExtraReducers(\n * myReducer1,\n * myReducer2\n * )\n * ]\n * ```\n */\nexport function daffCustomerProvideExtraReducers(\n ...reducers: ActionReducer<DaffCustomerStoreCreditReducersState>[]\n): Provider[] {\n return reducers.map(reducer => ({\n provide: DAFF_CUSTOMER_STORE_CREDIT_EXTRA_REDUCERS,\n useValue: reducer,\n multi: true,\n }));\n}\n","import { daffOperationInitialState } from '@daffodil/core/state';\n\nimport { DaffCustomerStoreCreditReducerState } from './type';\n\n/**\n * The initial state for the main customer store credit state, see {@link DaffCustomerStoreCreditReducerState}.\n */\nexport const daffCustomerStoreCreditInitialState: DaffCustomerStoreCreditReducerState = {\n ...daffOperationInitialState,\n storeCredit: {\n balance: 0,\n },\n};\n","import {\n daffCompleteOperation,\n daffOperationFailed,\n daffStartMutation,\n daffStartResolution,\n} from '@daffodil/core/state';\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\n\nimport { daffCustomerStoreCreditInitialState } from './initial-state';\nimport { DaffCustomerStoreCreditReducerState } from './type';\nimport {\n DaffCustomerStoreCreditActions,\n DaffCustomerStoreCreditActionTypes,\n DaffCustomerStoreCreditLoadFailure,\n} from '../../actions/store-credit.actions';\n\n/**\n * The reducer for the customer store credit page state, see {@link DaffCustomerStoreCreditReducerState}.\n */\nexport const daffCustomerStoreCreditReducer = <T extends DaffCustomerStoreCredit = DaffCustomerStoreCredit>(\n state = daffCustomerStoreCreditInitialState,\n action: DaffCustomerStoreCreditActions<T>,\n): DaffCustomerStoreCreditReducerState => {\n switch (action.type) {\n case DaffCustomerStoreCreditActionTypes.StoreCreditLoadAction:\n case DaffCustomerStoreCreditActionTypes.StoreCreditLoadAction:\n return daffStartResolution(state);\n\n case DaffCustomerStoreCreditActionTypes.StoreCreditLoadSuccessAction:\n return {\n ...daffCompleteOperation(state),\n storeCredit: action.payload,\n };\n\n case DaffCustomerStoreCreditActionTypes.StoreCreditClearErrorsAction:\n return daffCompleteOperation(state);\n\n case DaffCustomerStoreCreditActionTypes.StoreCreditLoadFailureAction:\n return daffOperationFailed([(<DaffCustomerStoreCreditLoadFailure>action).payload], state);\n\n default:\n return state;\n }\n};\n","import {\n createFeatureSelector,\n MemoizedSelector,\n} from '@ngrx/store';\n\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\n\nimport {\n DaffCustomerStoreCreditStateRootSlice,\n DaffCustomerStoreCreditReducersState,\n DAFF_CUSTOMER_STORE_CREDIT_STORE_FEATURE_KEY,\n} from '../reducers/public_api';\n\n/**\n * Selector for the customer store credit feature state.\n */\nexport interface DaffCustomerStoreCreditFeatureSelector<\n TStoreCredit extends DaffCustomerStoreCredit = DaffCustomerStoreCredit\n> {\n selectCustomerStoreCreditFeatureState: MemoizedSelector<DaffCustomerStoreCreditStateRootSlice<TStoreCredit>, DaffCustomerStoreCreditReducersState<TStoreCredit>>;\n}\n\nexport const getDaffCustomerStoreCreditReducersStateSelector = (() => {\n let cache;\n return <TStoreCredit extends DaffCustomerStoreCredit = DaffCustomerStoreCredit>(): DaffCustomerStoreCreditFeatureSelector<TStoreCredit> =>\n cache = cache || {\n selectCustomerStoreCreditFeatureState: createFeatureSelector<DaffCustomerStoreCreditReducersState<TStoreCredit>>(DAFF_CUSTOMER_STORE_CREDIT_STORE_FEATURE_KEY),\n };\n})();\n","import {\n createSelector,\n MemoizedSelector,\n} from '@ngrx/store';\n\nimport {\n daffOperationStateSelectorFactory,\n DaffOperationStateSelectors,\n} from '@daffodil/core/state';\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\n\nimport {\n DaffCustomerStoreCreditReducerState,\n DaffCustomerStoreCreditStateRootSlice,\n} from '../../reducers/public_api';\nimport { getDaffCustomerStoreCreditReducersStateSelector } from '../feature.selector';\n\n/**\n * Selectors for the main part of customer store credit state.\n */\nexport interface DaffCustomerStoreCreditSelectors<T extends DaffCustomerStoreCredit = DaffCustomerStoreCredit> extends DaffOperationStateSelectors<DaffCustomerStoreCreditStateRootSlice<T>, DaffCustomerStoreCreditReducerState<T>> {\n /**\n * Selects the customer's current store credit balance.\n */\n selectStoreCredit: MemoizedSelector<DaffCustomerStoreCreditStateRootSlice<T>, T>;\n}\n\n/**\n * Creates a group of selectors for {@link DaffCustomerStoreCreditReducerState} that use the passed state selector as the basis.\n */\nconst daffCustomerStoreCreditCreateSelectors = <T extends DaffCustomerStoreCredit = DaffCustomerStoreCredit>(): DaffCustomerStoreCreditSelectors<T> => {\n const { selectCustomerStoreCreditFeatureState } = getDaffCustomerStoreCreditReducersStateSelector<T>();\n const selectCustomerStoreCreditState = createSelector(\n selectCustomerStoreCreditFeatureState,\n state => state.storeCredit,\n );\n const selectStoreCredit = createSelector(\n selectCustomerStoreCreditState,\n state => state.storeCredit,\n );\n\n return {\n ...daffOperationStateSelectorFactory(selectCustomerStoreCreditState),\n selectStoreCredit,\n };\n};\n\nexport const daffCustomerStoreCreditGetSelectors = (() => {\n let cache;\n return <T extends DaffCustomerStoreCredit = DaffCustomerStoreCredit>(): DaffCustomerStoreCreditSelectors<T> =>\n cache = cache || daffCustomerStoreCreditCreateSelectors<T>();\n})();\n\n","import { Injectable } from '@angular/core';\nimport {\n Store,\n select,\n Action,\n} from '@ngrx/store';\nimport { Observable } from 'rxjs';\n\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\n\nimport { DaffCustomerStoreCreditPageFacadeInterface } from './interface';\nimport {\n DaffCustomerStoreCreditReducerState,\n DaffCustomerStoreCreditStateRootSlice,\n} from '../../reducers/public_api';\nimport { daffCustomerStoreCreditGetSelectors } from '../../selectors/public_api';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCustomerStoreCreditPageFacade<T extends DaffCustomerStoreCredit = DaffCustomerStoreCredit> implements DaffCustomerStoreCreditPageFacadeInterface<T> {\n storeCredit$: Observable<T>;\n loadingState$: Observable<DaffCustomerStoreCreditReducerState['daffState']>;\n loading$: Observable<boolean>;\n resolving$: Observable<boolean>;\n mutating$: Observable<boolean>;\n errors$: Observable<DaffCustomerStoreCreditReducerState['daffErrors']>;\n hasErrors$: Observable<boolean>;\n\n constructor(\n private store: Store<DaffCustomerStoreCreditStateRootSlice>,\n ) {\n const {\n selectStoreCredit,\n selectErrors,\n selectHasErrors,\n selectLoading,\n selectLoadingState,\n selectMutating,\n selectResolving,\n } = daffCustomerStoreCreditGetSelectors<T>();\n\n this.storeCredit$ = this.store.pipe(select(selectStoreCredit));\n this.loadingState$ = this.store.pipe(select(selectLoadingState));\n this.loading$ = this.store.pipe(select(selectLoading));\n this.resolving$ = this.store.pipe(select(selectResolving));\n this.mutating$ = this.store.pipe(select(selectMutating));\n this.errors$ = this.store.pipe(select(selectErrors));\n this.hasErrors$ = this.store.pipe(select(selectHasErrors));\n }\n\n dispatch(action: Action) {\n this.store.dispatch(action);\n }\n}\n","import { InjectionToken } from '@angular/core';\n\nimport { daffTransformErrorToStateError } from '@daffodil/core/state';\n\n/**\n * Transforms `DaffError`s into `DaffStateError`s before they are serialized into state.\n * Can be used to further refine Daffodil errors into more specific app errors.\n */\nexport const DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER = new InjectionToken<typeof daffTransformErrorToStateError>(\n 'DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER',\n { factory: () => daffTransformErrorToStateError },\n);\n","import {\n Injectable,\n Inject,\n} from '@angular/core';\nimport {\n Actions,\n createEffect,\n ofType,\n} from '@ngrx/effects';\nimport { of } from 'rxjs';\nimport {\n switchMap,\n map,\n catchError,\n} from 'rxjs/operators';\n\nimport { DaffError } from '@daffodil/core';\nimport { ErrorTransformer } from '@daffodil/core/state';\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\nimport {\n DaffCustomerStoreCreditDriver,\n DaffCustomerStoreCreditDriverInterface,\n} from '@daffodil/customer-store-credit/driver';\n\nimport {\n DaffCustomerStoreCreditActionTypes,\n DaffCustomerStoreCreditLoadFailure,\n DaffCustomerStoreCreditLoadSuccess,\n DaffCustomerStoreCreditActions,\n} from '../actions/store-credit.actions';\nimport { DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER } from '../injection-tokens/public_api';\n\n@Injectable()\nexport class DaffCustomerStoreCreditEffects<\n T extends DaffCustomerStoreCredit = DaffCustomerStoreCredit,\n> {\n constructor(\n private actions$: Actions<DaffCustomerStoreCreditActions<T>>,\n @Inject(DaffCustomerStoreCreditDriver) private driver: DaffCustomerStoreCreditDriverInterface<T>,\n @Inject(DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER) private errorMatcher: ErrorTransformer,\n ) {}\n\n list$ = createEffect(() => this.actions$.pipe(\n ofType(DaffCustomerStoreCreditActionTypes.StoreCreditLoadAction),\n switchMap((action) =>\n this.driver.get().pipe(\n map(resp => new DaffCustomerStoreCreditLoadSuccess<T>(resp)),\n catchError((error: DaffError) => of(new DaffCustomerStoreCreditLoadFailure(this.errorMatcher(error)))),\n ),\n ),\n ));\n}\n","import {\n inject,\n InjectionToken,\n} from '@angular/core';\nimport {\n ActionReducer,\n combineReducers,\n} from '@ngrx/store';\n\nimport { daffComposeReducers } from '@daffodil/core/state';\n// these unused imports are a workaround\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\n\nimport { DAFF_CUSTOMER_STORE_CREDIT_EXTRA_REDUCERS } from './extra.token';\nimport { DaffCustomerStoreCreditReducersState } from '../reducers.interface';\nimport { daffCustomerStoreCreditReducer } from '../store-credit/public_api';\n\n/**\n * An internal token to hold the Daffodil customer reducers.\n * Includes the extra and standard reducers.\n *\n * @docs-private\n */\nexport const DAFF_CUSTOMER_STORE_CREDIT_REDUCERS = new InjectionToken<ActionReducer<DaffCustomerStoreCreditReducersState>>(\n 'DAFF_CUSTOMER_STORE_CREDIT_REDUCERS',\n {\n providedIn: 'any',\n factory: () => daffComposeReducers([\n combineReducers({\n storeCredit: daffCustomerStoreCreditReducer,\n }),\n ...inject(DAFF_CUSTOMER_STORE_CREDIT_EXTRA_REDUCERS),\n ]),\n },\n);\n","import { NgModule } from '@angular/core';\nimport { EffectsModule } from '@ngrx/effects';\nimport { StoreModule } from '@ngrx/store';\n\nimport { DaffCustomerStoreCreditEffects } from './effects/store-credit.effects';\nimport { DAFF_CUSTOMER_STORE_CREDIT_STORE_FEATURE_KEY } from './reducers/public_api';\nimport { DAFF_CUSTOMER_STORE_CREDIT_REDUCERS } from './reducers/token/reducers.token';\n\n/**\n * Creates the customer store credit feature store.\n */\n@NgModule({\n imports: [\n StoreModule.forFeature(DAFF_CUSTOMER_STORE_CREDIT_STORE_FEATURE_KEY, DAFF_CUSTOMER_STORE_CREDIT_REDUCERS),\n EffectsModule.forFeature([\n DaffCustomerStoreCreditEffects,\n ]),\n ],\n})\nexport class DaffCustomerStoreCreditStateModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2"],"mappings":";;;;;;;;;;;AAMA;;AAEG;IACS,mCAKX;AALD,CAAA,UAAY,kCAAkC,EAAA;AAC5C,IAAA,kCAAA,CAAA,uBAAA,CAAA,GAAA,4DAAoF,CAAA;AACpF,IAAA,kCAAA,CAAA,8BAAA,CAAA,GAAA,oEAAmG,CAAA;AACnG,IAAA,kCAAA,CAAA,8BAAA,CAAA,GAAA,oEAAmG,CAAA;AACnG,IAAA,kCAAA,CAAA,8BAAA,CAAA,GAAA,oEAAmG,CAAA;AACrG,CAAC,EALW,kCAAkC,KAAlC,kCAAkC,GAK7C,EAAA,CAAA,CAAA,CAAA;AAED;;AAEG;MACU,2BAA2B,CAAA;AAAxC,IAAA,WAAA,GAAA;AACW,QAAA,IAAA,CAAA,IAAI,GAAG,kCAAkC,CAAC,qBAAqB,CAAC;KAC1E;AAAA,CAAA;AAED;;AAEG;MACU,kCAAkC,CAAA;AAG7C,IAAA,WAAA,CAAmB,OAAU,EAAA;QAAV,IAAO,CAAA,OAAA,GAAP,OAAO,CAAG;AAFpB,QAAA,IAAA,CAAA,IAAI,GAAG,kCAAkC,CAAC,4BAA4B,CAAC;KAE/C;AAClC,CAAA;AAED;;AAEG;MACU,kCAAkC,CAAA;AAG7C,IAAA,WAAA,CAAmB,OAAuB,EAAA;QAAvB,IAAO,CAAA,OAAA,GAAP,OAAO,CAAgB;AAFjC,QAAA,IAAA,CAAA,IAAI,GAAG,kCAAkC,CAAC,4BAA4B,CAAC;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;;;ACtBpD;;;;;AAKG;AACI,MAAM,mCAAmC,GAAG,IAAI,cAAc,CACnE,qCAAqC,EACrC;AACE,IAAA,UAAU,EAAE,KAAK;AACjB,IAAA,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjC,QAAA,eAAe,CAAC;AACd,YAAA,WAAW,EAAE,8BAA8B;SAC5C,CAAC;QACF,GAAG,MAAM,CAAC,yCAAyC,CAAC;KACrD,CAAC;AACH,CAAA,CACF;;AC1BD;;AAEG;MASU,kCAAkC,CAAA;;kJAAlC,kCAAkC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;mJAAlC,kCAAkC,EAAA,OAAA,EAAA,CAAA,EAAA,CAAA,kBAAA,EAAAC,IAAA,CAAA,oBAAA,CAAA,EAAA,CAAA,CAAA;mJAAlC,kCAAkC,EAAA,OAAA,EAAA,CAN3C,WAAW,CAAC,UAAU,CAAC,4CAA4C,EAAE,mCAAmC,CAAC;QACzG,aAAa,CAAC,UAAU,CAAC;YACvB,8BAA8B;SAC/B,CAAC,CAAA,EAAA,CAAA,CAAA;2FAGO,kCAAkC,EAAA,UAAA,EAAA,CAAA;kBAR9C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;AACP,wBAAA,WAAW,CAAC,UAAU,CAAC,4CAA4C,EAAE,mCAAmC,CAAC;wBACzG,aAAa,CAAC,UAAU,CAAC;4BACvB,8BAA8B;yBAC/B,CAAC;AACH,qBAAA;AACF,iBAAA,CAAA;;;AClBD;;AAEG;;;;"}
@@ -1,17 +1,8 @@
1
- import { InjectionToken } from '@angular/core';
2
- import { daffTransformErrorToStateError } from '@daffodil/core/state';
3
-
4
- /**
5
- * Transforms `DaffError`s into `DaffStateError`s before they are serialized into state.
6
- * Can be used to further refine Daffodil errors into more specific app errors.
7
- */
8
- const DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER = new InjectionToken('DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER', { factory: () => daffTransformErrorToStateError });
9
-
10
1
  const DAFF_CUSTOMER_STORE_CREDIT_ORDER_TOTAL_TYPE = 'storeCredit';
11
2
 
12
3
  /**
13
4
  * Generated bundle index. Do not edit.
14
5
  */
15
6
 
16
- export { DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER, DAFF_CUSTOMER_STORE_CREDIT_ORDER_TOTAL_TYPE };
7
+ export { DAFF_CUSTOMER_STORE_CREDIT_ORDER_TOTAL_TYPE };
17
8
  //# sourceMappingURL=daffodil-customer-store-credit.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-customer-store-credit.mjs","sources":["../../../libs/customer-store-credit/src/injection-tokens/error-matcher.token.ts","../../../libs/customer-store-credit/src/constants/store-credit-order-total-type.ts","../../../libs/customer-store-credit/src/daffodil-customer-store-credit.ts"],"sourcesContent":["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","export const DAFF_CUSTOMER_STORE_CREDIT_ORDER_TOTAL_TYPE = 'storeCredit';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAIA;;;AAGG;AACU,MAAA,wCAAwC,GAAG,IAAI,cAAc,CACxE,0CAA0C,EAC1C,EAAE,OAAO,EAAE,MAAM,8BAA8B,EAAE;;ACV5C,MAAM,2CAA2C,GAAG;;ACA3D;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-customer-store-credit.mjs","sources":["../../../libs/customer-store-credit/src/constants/store-credit-order-total-type.ts","../../../libs/customer-store-credit/src/daffodil-customer-store-credit.ts"],"sourcesContent":["export const DAFF_CUSTOMER_STORE_CREDIT_ORDER_TOTAL_TYPE = 'storeCredit';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAAO,MAAM,2CAA2C,GAAG;;ACA3D;;AAEG;;;;"}
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@daffodil/customer-store-credit","nx":{"targets":{"build":{"outputs":["{workspaceRoot}/dist/customer-store-credit"]}}},"version":"0.64.2","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":"^15.0.0","@angular/core":"^15.0.0","@daffodil/customer":"0.64.2","@daffodil/customer-order":"0.64.2","@daffodil/core":"0.64.2","@ngrx/effects":"^15.0.0","@ngrx/store":"^15.0.0","rxjs":"7.8.1"},"optionalDependencies":{"@apollo/client":"^3.0.0","@daffodil/driver":"0.64.2","apollo-angular":"^5.0.0","@faker-js/faker":"^7.6.0"},"module":"fesm2015/daffodil-customer-store-credit.mjs","es2020":"fesm2020/daffodil-customer-store-credit.mjs","esm2020":"esm2020/daffodil-customer-store-credit.mjs","fesm2020":"fesm2020/daffodil-customer-store-credit.mjs","fesm2015":"fesm2015/daffodil-customer-store-credit.mjs","typings":"index.d.ts","exports":{"./package.json":{"default":"./package.json"},".":{"types":"./index.d.ts","esm2020":"./esm2020/daffodil-customer-store-credit.mjs","es2020":"./fesm2020/daffodil-customer-store-credit.mjs","es2015":"./fesm2015/daffodil-customer-store-credit.mjs","node":"./fesm2015/daffodil-customer-store-credit.mjs","default":"./fesm2020/daffodil-customer-store-credit.mjs"},"./driver/in-memory":{"types":"./driver/in-memory/index.d.ts","esm2020":"./esm2020/driver/in-memory/daffodil-customer-store-credit-driver-in-memory.mjs","es2020":"./fesm2020/daffodil-customer-store-credit-driver-in-memory.mjs","es2015":"./fesm2015/daffodil-customer-store-credit-driver-in-memory.mjs","node":"./fesm2015/daffodil-customer-store-credit-driver-in-memory.mjs","default":"./fesm2020/daffodil-customer-store-credit-driver-in-memory.mjs"},"./driver/magento":{"types":"./driver/magento/index.d.ts","esm2020":"./esm2020/driver/magento/daffodil-customer-store-credit-driver-magento.mjs","es2020":"./fesm2020/daffodil-customer-store-credit-driver-magento.mjs","es2015":"./fesm2015/daffodil-customer-store-credit-driver-magento.mjs","node":"./fesm2015/daffodil-customer-store-credit-driver-magento.mjs","default":"./fesm2020/daffodil-customer-store-credit-driver-magento.mjs"},"./driver/magento/testing":{"types":"./driver/magento/testing/index.d.ts","esm2020":"./esm2020/driver/magento/testing/daffodil-customer-store-credit-driver-magento-testing.mjs","es2020":"./fesm2020/daffodil-customer-store-credit-driver-magento-testing.mjs","es2015":"./fesm2015/daffodil-customer-store-credit-driver-magento-testing.mjs","node":"./fesm2015/daffodil-customer-store-credit-driver-magento-testing.mjs","default":"./fesm2020/daffodil-customer-store-credit-driver-magento-testing.mjs"},"./driver":{"types":"./driver/index.d.ts","esm2020":"./esm2020/driver/daffodil-customer-store-credit-driver.mjs","es2020":"./fesm2020/daffodil-customer-store-credit-driver.mjs","es2015":"./fesm2015/daffodil-customer-store-credit-driver.mjs","node":"./fesm2015/daffodil-customer-store-credit-driver.mjs","default":"./fesm2020/daffodil-customer-store-credit-driver.mjs"},"./driver/testing":{"types":"./driver/testing/index.d.ts","esm2020":"./esm2020/driver/testing/daffodil-customer-store-credit-driver-testing.mjs","es2020":"./fesm2020/daffodil-customer-store-credit-driver-testing.mjs","es2015":"./fesm2015/daffodil-customer-store-credit-driver-testing.mjs","node":"./fesm2015/daffodil-customer-store-credit-driver-testing.mjs","default":"./fesm2020/daffodil-customer-store-credit-driver-testing.mjs"},"./routing":{"types":"./routing/index.d.ts","esm2020":"./esm2020/routing/daffodil-customer-store-credit-routing.mjs","es2020":"./fesm2020/daffodil-customer-store-credit-routing.mjs","es2015":"./fesm2015/daffodil-customer-store-credit-routing.mjs","node":"./fesm2015/daffodil-customer-store-credit-routing.mjs","default":"./fesm2020/daffodil-customer-store-credit-routing.mjs"},"./state":{"types":"./state/index.d.ts","esm2020":"./esm2020/state/daffodil-customer-store-credit-state.mjs","es2020":"./fesm2020/daffodil-customer-store-credit-state.mjs","es2015":"./fesm2015/daffodil-customer-store-credit-state.mjs","node":"./fesm2015/daffodil-customer-store-credit-state.mjs","default":"./fesm2020/daffodil-customer-store-credit-state.mjs"},"./state/testing":{"types":"./state/testing/index.d.ts","esm2020":"./esm2020/state/testing/daffodil-customer-store-credit-state-testing.mjs","es2020":"./fesm2020/daffodil-customer-store-credit-state-testing.mjs","es2015":"./fesm2015/daffodil-customer-store-credit-state-testing.mjs","node":"./fesm2015/daffodil-customer-store-credit-state-testing.mjs","default":"./fesm2020/daffodil-customer-store-credit-state-testing.mjs"},"./testing":{"types":"./testing/index.d.ts","esm2020":"./esm2020/testing/daffodil-customer-store-credit-testing.mjs","es2020":"./fesm2020/daffodil-customer-store-credit-testing.mjs","es2015":"./fesm2015/daffodil-customer-store-credit-testing.mjs","node":"./fesm2015/daffodil-customer-store-credit-testing.mjs","default":"./fesm2020/daffodil-customer-store-credit-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.66.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":"^15.0.0","@angular/core":"^15.0.0","@daffodil/customer":"0.66.0","@daffodil/customer-order":"0.66.0","@daffodil/core":"0.66.0","@ngrx/effects":"^15.0.0","@ngrx/store":"^15.0.0","rxjs":"7.8.1"},"optionalDependencies":{"@apollo/client":"^3.0.0","@daffodil/driver":"0.66.0","apollo-angular":"^5.0.2","@faker-js/faker":"^7.6.0"},"module":"fesm2015/daffodil-customer-store-credit.mjs","es2020":"fesm2020/daffodil-customer-store-credit.mjs","esm2020":"esm2020/daffodil-customer-store-credit.mjs","fesm2020":"fesm2020/daffodil-customer-store-credit.mjs","fesm2015":"fesm2015/daffodil-customer-store-credit.mjs","typings":"index.d.ts","exports":{"./package.json":{"default":"./package.json"},".":{"types":"./index.d.ts","esm2020":"./esm2020/daffodil-customer-store-credit.mjs","es2020":"./fesm2020/daffodil-customer-store-credit.mjs","es2015":"./fesm2015/daffodil-customer-store-credit.mjs","node":"./fesm2015/daffodil-customer-store-credit.mjs","default":"./fesm2020/daffodil-customer-store-credit.mjs"},"./driver/in-memory":{"types":"./driver/in-memory/index.d.ts","esm2020":"./esm2020/driver/in-memory/daffodil-customer-store-credit-driver-in-memory.mjs","es2020":"./fesm2020/daffodil-customer-store-credit-driver-in-memory.mjs","es2015":"./fesm2015/daffodil-customer-store-credit-driver-in-memory.mjs","node":"./fesm2015/daffodil-customer-store-credit-driver-in-memory.mjs","default":"./fesm2020/daffodil-customer-store-credit-driver-in-memory.mjs"},"./driver/magento":{"types":"./driver/magento/index.d.ts","esm2020":"./esm2020/driver/magento/daffodil-customer-store-credit-driver-magento.mjs","es2020":"./fesm2020/daffodil-customer-store-credit-driver-magento.mjs","es2015":"./fesm2015/daffodil-customer-store-credit-driver-magento.mjs","node":"./fesm2015/daffodil-customer-store-credit-driver-magento.mjs","default":"./fesm2020/daffodil-customer-store-credit-driver-magento.mjs"},"./driver/magento/testing":{"types":"./driver/magento/testing/index.d.ts","esm2020":"./esm2020/driver/magento/testing/daffodil-customer-store-credit-driver-magento-testing.mjs","es2020":"./fesm2020/daffodil-customer-store-credit-driver-magento-testing.mjs","es2015":"./fesm2015/daffodil-customer-store-credit-driver-magento-testing.mjs","node":"./fesm2015/daffodil-customer-store-credit-driver-magento-testing.mjs","default":"./fesm2020/daffodil-customer-store-credit-driver-magento-testing.mjs"},"./driver":{"types":"./driver/index.d.ts","esm2020":"./esm2020/driver/daffodil-customer-store-credit-driver.mjs","es2020":"./fesm2020/daffodil-customer-store-credit-driver.mjs","es2015":"./fesm2015/daffodil-customer-store-credit-driver.mjs","node":"./fesm2015/daffodil-customer-store-credit-driver.mjs","default":"./fesm2020/daffodil-customer-store-credit-driver.mjs"},"./driver/testing":{"types":"./driver/testing/index.d.ts","esm2020":"./esm2020/driver/testing/daffodil-customer-store-credit-driver-testing.mjs","es2020":"./fesm2020/daffodil-customer-store-credit-driver-testing.mjs","es2015":"./fesm2015/daffodil-customer-store-credit-driver-testing.mjs","node":"./fesm2015/daffodil-customer-store-credit-driver-testing.mjs","default":"./fesm2020/daffodil-customer-store-credit-driver-testing.mjs"},"./routing":{"types":"./routing/index.d.ts","esm2020":"./esm2020/routing/daffodil-customer-store-credit-routing.mjs","es2020":"./fesm2020/daffodil-customer-store-credit-routing.mjs","es2015":"./fesm2015/daffodil-customer-store-credit-routing.mjs","node":"./fesm2015/daffodil-customer-store-credit-routing.mjs","default":"./fesm2020/daffodil-customer-store-credit-routing.mjs"},"./state":{"types":"./state/index.d.ts","esm2020":"./esm2020/state/daffodil-customer-store-credit-state.mjs","es2020":"./fesm2020/daffodil-customer-store-credit-state.mjs","es2015":"./fesm2015/daffodil-customer-store-credit-state.mjs","node":"./fesm2015/daffodil-customer-store-credit-state.mjs","default":"./fesm2020/daffodil-customer-store-credit-state.mjs"},"./state/testing":{"types":"./state/testing/index.d.ts","esm2020":"./esm2020/state/testing/daffodil-customer-store-credit-state-testing.mjs","es2020":"./fesm2020/daffodil-customer-store-credit-state-testing.mjs","es2015":"./fesm2015/daffodil-customer-store-credit-state-testing.mjs","node":"./fesm2015/daffodil-customer-store-credit-state-testing.mjs","default":"./fesm2020/daffodil-customer-store-credit-state-testing.mjs"},"./testing":{"types":"./testing/index.d.ts","esm2020":"./esm2020/testing/daffodil-customer-store-credit-testing.mjs","es2020":"./fesm2020/daffodil-customer-store-credit-testing.mjs","es2015":"./fesm2015/daffodil-customer-store-credit-testing.mjs","node":"./fesm2015/daffodil-customer-store-credit-testing.mjs","default":"./fesm2020/daffodil-customer-store-credit-testing.mjs"}},"sideEffects":false,"dependencies":{"tslib":"^2.3.0"}}
package/public_api.d.ts CHANGED
@@ -1,3 +1,2 @@
1
1
  export * from './models/public_api';
2
- export * from './injection-tokens/public_api';
3
2
  export * from './constants/public_api';
@@ -2,4 +2,5 @@ export * from './actions/public_api';
2
2
  export * from './reducers/public_api';
3
3
  export * from './selectors/public_api';
4
4
  export * from './facades/public_api';
5
+ export * from './injection-tokens/public_api';
5
6
  export * from './state.module';
@@ -1,8 +0,0 @@
1
- import { InjectionToken } from '@angular/core';
2
- import { daffTransformErrorToStateError } from '@daffodil/core/state';
3
- /**
4
- * Transforms `DaffError`s into `DaffStateError`s before they are serialized into state.
5
- * Can be used to further refine Daffodil errors into more specific app errors.
6
- */
7
- export const DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER = new InjectionToken('DAFF_CUSTOMER_STORE_CREDIT_ERROR_MATCHER', { factory: () => daffTransformErrorToStateError });
8
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXJyb3ItbWF0Y2hlci50b2tlbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYnMvY3VzdG9tZXItc3RvcmUtY3JlZGl0L3NyYy9pbmplY3Rpb24tdG9rZW5zL2Vycm9yLW1hdGNoZXIudG9rZW4udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUUvQyxPQUFPLEVBQUUsOEJBQThCLEVBQUUsTUFBTSxzQk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InNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYnMvY3VzdG9tZXItc3RvcmUtY3JlZGl0L3NyYy9pbmplY3Rpb24tdG9rZW5zL3B1YmxpY19hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLHdDQUF3QyxFQUFFLE1BQU0sdUJBQXVCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgeyBEQUZGX0NVU1RPTUVSX1NUT1JFX0NSRURJVF9FUlJPUl9NQVRDSEVSIH0gZnJvbSAnLi9lcnJvci1tYXRjaGVyLnRva2VuJztcbiJdfQ==