@daffodil/payment 0.91.0 → 0.92.3-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -49,10 +49,10 @@ class DaffPaymentInMemoryBackendService {
49
49
  body: this.factory.create(),
50
50
  }));
51
51
  }
52
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPaymentInMemoryBackendService, deps: [{ token: i1.DaffPaymentResponseKindFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
53
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPaymentInMemoryBackendService, providedIn: 'root' }); }
52
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffPaymentInMemoryBackendService, deps: [{ token: i1.DaffPaymentResponseKindFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
53
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffPaymentInMemoryBackendService, providedIn: 'root' }); }
54
54
  }
55
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPaymentInMemoryBackendService, decorators: [{
55
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffPaymentInMemoryBackendService, decorators: [{
56
56
  type: Injectable,
57
57
  args: [{
58
58
  providedIn: 'root',
@@ -72,10 +72,10 @@ class DaffPaymentInMemoryDriver extends DaffInMemoryDriverBase {
72
72
  generateToken(request) {
73
73
  return this.http.get(this.url);
74
74
  }
75
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPaymentInMemoryDriver, deps: [{ token: i1$1.HttpClient }, { token: i2.InMemoryBackendConfig }], target: i0.ɵɵFactoryTarget.Injectable }); }
76
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPaymentInMemoryDriver, providedIn: 'root' }); }
75
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffPaymentInMemoryDriver, deps: [{ token: i1$1.HttpClient }, { token: i2.InMemoryBackendConfig }], target: i0.ɵɵFactoryTarget.Injectable }); }
76
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffPaymentInMemoryDriver, providedIn: 'root' }); }
77
77
  }
78
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPaymentInMemoryDriver, decorators: [{
78
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffPaymentInMemoryDriver, decorators: [{
79
79
  type: Injectable,
80
80
  args: [{
81
81
  providedIn: 'root',
@@ -95,13 +95,13 @@ class DaffPaymentInMemoryDriverModule {
95
95
  ],
96
96
  };
97
97
  }
98
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPaymentInMemoryDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
99
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.1", ngImport: i0, type: DaffPaymentInMemoryDriverModule, imports: [CommonModule,
98
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffPaymentInMemoryDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
99
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.18", ngImport: i0, type: DaffPaymentInMemoryDriverModule, imports: [CommonModule,
100
100
  DaffPaymentTestingModule] }); }
101
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPaymentInMemoryDriverModule, imports: [CommonModule,
101
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffPaymentInMemoryDriverModule, imports: [CommonModule,
102
102
  DaffPaymentTestingModule] }); }
103
103
  }
104
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPaymentInMemoryDriverModule, decorators: [{
104
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffPaymentInMemoryDriverModule, decorators: [{
105
105
  type: NgModule,
106
106
  args: [{
107
107
  imports: [
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-payment-driver-in-memory.mjs","sources":["../../../libs/payment/driver/in-memory/src/collection-name.const.ts","../../../libs/payment/driver/in-memory/src/backend/payment.service.ts","../../../libs/payment/driver/in-memory/src/driver/payment.service.ts","../../../libs/payment/driver/in-memory/src/driver/payment-driver.module.ts","../../../libs/payment/driver/in-memory/src/daffodil-payment-driver-in-memory.ts"],"sourcesContent":["export const DAFF_PAYMENT_IN_MEMORY_COLLECTION_NAME = 'payment';\n","import { Injectable } from '@angular/core';\nimport {\n InMemoryDbService,\n RequestInfoUtilities,\n ParsedRequestUrl,\n STATUS,\n RequestInfo,\n} from 'angular-in-memory-web-api';\n\nimport { DaffInMemorySingleRouteableBackend } from '@daffodil/driver/in-memory';\nimport { DaffPaymentResponseKindFactory } from '@daffodil/payment/testing';\n\nimport { DAFF_PAYMENT_IN_MEMORY_COLLECTION_NAME } from '../collection-name.const';\n\n/**\n * An in-memory service that delegates payment queries to child backends\n * via the {@link DAFF_PAYMENT_IN_MEMORY_BACKENDS}.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffPaymentInMemoryBackendService implements InMemoryDbService, DaffInMemorySingleRouteableBackend {\n readonly collectionName = DAFF_PAYMENT_IN_MEMORY_COLLECTION_NAME;\n\n constructor(\n private factory: DaffPaymentResponseKindFactory,\n ) {}\n\n /**\n * Automatically called as part of the InMemoryDbService to parse incoming urls to match the InMemory backend urls.\n *\n * @param url initial url\n * @param utils utility to parse url\n * @returns ParsedRequestUrl\n * @docs-private\n */\n parseRequestUrl(url: string, utils: RequestInfoUtilities): ParsedRequestUrl {\n return utils.parseRequestUrl(url);\n }\n\n /**\n * @docs-private\n */\n createDb(): any {\n return {};\n }\n\n /**\n * Generates a token from a processor backend.\n *\n * @param reqInfo request object\n * @returns An http response object\n */\n get(reqInfo: RequestInfo) {\n return reqInfo.utils.createResponse$(() => ({\n status: STATUS.OK,\n body: this.factory.create(),\n }));\n }\n}\n","import { HttpClient } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { InMemoryBackendConfig } from 'angular-in-memory-web-api';\nimport { Observable } from 'rxjs';\n\nimport { DaffInMemoryDriverBase } from '@daffodil/driver/in-memory';\nimport {\n DaffPaymentRequest,\n DaffPaymentResponse,\n} from '@daffodil/payment';\nimport { DaffPaymentDriverInterface } from '@daffodil/payment/driver';\n\nimport { DAFF_PAYMENT_IN_MEMORY_COLLECTION_NAME } from '../collection-name.const';\n\n/**\n * The payment inmemory driver to mock the payment backend service.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffPaymentInMemoryDriver extends DaffInMemoryDriverBase implements DaffPaymentDriverInterface {\n constructor(\n private http: HttpClient,\n config: InMemoryBackendConfig,\n ) {\n super(config, DAFF_PAYMENT_IN_MEMORY_COLLECTION_NAME);\n }\n\n generateToken(request: DaffPaymentRequest): Observable<DaffPaymentResponse> {\n return this.http.get<DaffPaymentResponse>(this.url);\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { provideDaffInMemoryBackends } from '@daffodil/driver/in-memory';\nimport { provideDaffPaymentDriver } from '@daffodil/payment/driver';\nimport { DaffPaymentTestingModule } from '@daffodil/payment/testing';\n\nimport { DaffPaymentInMemoryDriver } from './payment.service';\nimport { DaffPaymentInMemoryBackendService } from '../backend/payment.service';\n\n/**\n * Provides the {@link DaffPaymentInMemoryDriver} as the {@link DaffPaymentDriver}.\n */\n@NgModule({\n imports: [\n CommonModule,\n DaffPaymentTestingModule,\n ],\n})\nexport class DaffPaymentInMemoryDriverModule {\n static forRoot(): ModuleWithProviders<DaffPaymentInMemoryDriverModule> {\n return {\n ngModule: DaffPaymentInMemoryDriverModule,\n providers: [\n provideDaffPaymentDriver(DaffPaymentInMemoryDriver),\n provideDaffInMemoryBackends(DaffPaymentInMemoryBackendService),\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;;AAAO,MAAM,sCAAsC,GAAG,SAAS;;ACc/D;;;AAGG;MAIU,iCAAiC,CAAA;AAG5C,IAAA,WAAA,CACU,OAAuC,EAAA;QAAvC,IAAA,CAAA,OAAO,GAAP,OAAO;QAHR,IAAA,CAAA,cAAc,GAAG,sCAAsC;IAI7D;AAEH;;;;;;;AAOG;IACH,eAAe,CAAC,GAAW,EAAE,KAA2B,EAAA;AACtD,QAAA,OAAO,KAAK,CAAC,eAAe,CAAC,GAAG,CAAC;IACnC;AAEA;;AAEG;IACH,QAAQ,GAAA;AACN,QAAA,OAAO,EAAE;IACX;AAEA;;;;;AAKG;AACH,IAAA,GAAG,CAAC,OAAoB,EAAA;QACtB,OAAO,OAAO,CAAC,KAAK,CAAC,eAAe,CAAC,OAAO;YAC1C,MAAM,EAAE,MAAM,CAAC,EAAE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../../../libs/payment/driver/in-memory/src/backend/payment.service.ts","../../../libs/payment/driver/in-memory/src/driver/payment.service.ts","../../../libs/payment/driver/in-memory/src/driver/payment-driver.module.ts","../../../libs/payment/driver/in-memory/src/daffodil-payment-driver-in-memory.ts"],"sourcesContent":["export const DAFF_PAYMENT_IN_MEMORY_COLLECTION_NAME = 'payment';\n","import { Injectable } from '@angular/core';\nimport {\n InMemoryDbService,\n RequestInfoUtilities,\n ParsedRequestUrl,\n STATUS,\n RequestInfo,\n} from 'angular-in-memory-web-api';\n\nimport { DaffInMemorySingleRouteableBackend } from '@daffodil/driver/in-memory';\nimport { DaffPaymentResponseKindFactory } from '@daffodil/payment/testing';\n\nimport { DAFF_PAYMENT_IN_MEMORY_COLLECTION_NAME } from '../collection-name.const';\n\n/**\n * An in-memory service that delegates payment queries to child backends\n * via the {@link DAFF_PAYMENT_IN_MEMORY_BACKENDS}.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffPaymentInMemoryBackendService implements InMemoryDbService, DaffInMemorySingleRouteableBackend {\n readonly collectionName = DAFF_PAYMENT_IN_MEMORY_COLLECTION_NAME;\n\n constructor(\n private factory: DaffPaymentResponseKindFactory,\n ) {}\n\n /**\n * Automatically called as part of the InMemoryDbService to parse incoming urls to match the InMemory backend urls.\n *\n * @param url initial url\n * @param utils utility to parse url\n * @returns ParsedRequestUrl\n * @docs-private\n */\n parseRequestUrl(url: string, utils: RequestInfoUtilities): ParsedRequestUrl {\n return utils.parseRequestUrl(url);\n }\n\n /**\n * @docs-private\n */\n createDb(): any {\n return {};\n }\n\n /**\n * Generates a token from a processor backend.\n *\n * @param reqInfo request object\n * @returns An http response object\n */\n get(reqInfo: RequestInfo) {\n return reqInfo.utils.createResponse$(() => ({\n status: STATUS.OK,\n body: this.factory.create(),\n }));\n }\n}\n","import { HttpClient } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { InMemoryBackendConfig } from 'angular-in-memory-web-api';\nimport { Observable } from 'rxjs';\n\nimport { DaffInMemoryDriverBase } from '@daffodil/driver/in-memory';\nimport {\n DaffPaymentRequest,\n DaffPaymentResponse,\n} from '@daffodil/payment';\nimport { DaffPaymentDriverInterface } from '@daffodil/payment/driver';\n\nimport { DAFF_PAYMENT_IN_MEMORY_COLLECTION_NAME } from '../collection-name.const';\n\n/**\n * The payment inmemory driver to mock the payment backend service.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffPaymentInMemoryDriver extends DaffInMemoryDriverBase implements DaffPaymentDriverInterface {\n constructor(\n private http: HttpClient,\n config: InMemoryBackendConfig,\n ) {\n super(config, DAFF_PAYMENT_IN_MEMORY_COLLECTION_NAME);\n }\n\n generateToken(request: DaffPaymentRequest): Observable<DaffPaymentResponse> {\n return this.http.get<DaffPaymentResponse>(this.url);\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { provideDaffInMemoryBackends } from '@daffodil/driver/in-memory';\nimport { provideDaffPaymentDriver } from '@daffodil/payment/driver';\nimport { DaffPaymentTestingModule } from '@daffodil/payment/testing';\n\nimport { DaffPaymentInMemoryDriver } from './payment.service';\nimport { DaffPaymentInMemoryBackendService } from '../backend/payment.service';\n\n/**\n * Provides the {@link DaffPaymentInMemoryDriver} as the {@link DaffPaymentDriver}.\n */\n@NgModule({\n imports: [\n CommonModule,\n DaffPaymentTestingModule,\n ],\n})\nexport class DaffPaymentInMemoryDriverModule {\n static forRoot(): ModuleWithProviders<DaffPaymentInMemoryDriverModule> {\n return {\n ngModule: DaffPaymentInMemoryDriverModule,\n providers: [\n provideDaffPaymentDriver(DaffPaymentInMemoryDriver),\n provideDaffInMemoryBackends(DaffPaymentInMemoryBackendService),\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;;AAAO,MAAM,sCAAsC,GAAG,SAAS;;ACc/D;;;AAGG;MAIU,iCA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AAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,+BAA+B,YAJxC,YAAY;YACZ,wBAAwB,CAAA,EAAA,CAAA,CAAA;;4FAGf,+BAA+B,EAAA,UAAA,EAAA,CAAA;kBAN3C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,wBAAwB;AACzB,qBAAA;AACF,iBAAA;;;ACrBD;;AAEG;;;;"}
@@ -18,10 +18,10 @@ class DaffPaymentTestingDriver {
18
18
  generateToken(request) {
19
19
  return of(this.paymentResponseFactory.create());
20
20
  }
21
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPaymentTestingDriver, deps: [{ token: i1.DaffPaymentResponseKindFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
22
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPaymentTestingDriver, providedIn: 'root' }); }
21
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffPaymentTestingDriver, deps: [{ token: i1.DaffPaymentResponseKindFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
22
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffPaymentTestingDriver, providedIn: 'root' }); }
23
23
  }
24
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPaymentTestingDriver, decorators: [{
24
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffPaymentTestingDriver, decorators: [{
25
25
  type: Injectable,
26
26
  args: [{
27
27
  providedIn: 'root',
@@ -40,11 +40,11 @@ class DaffPaymentTestingDriverModule {
40
40
  ],
41
41
  };
42
42
  }
43
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPaymentTestingDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
44
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.1", ngImport: i0, type: DaffPaymentTestingDriverModule, imports: [CommonModule] }); }
45
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPaymentTestingDriverModule, imports: [CommonModule] }); }
43
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffPaymentTestingDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
44
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.18", ngImport: i0, type: DaffPaymentTestingDriverModule, imports: [CommonModule] }); }
45
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffPaymentTestingDriverModule, imports: [CommonModule] }); }
46
46
  }
47
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPaymentTestingDriverModule, decorators: [{
47
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffPaymentTestingDriverModule, decorators: [{
48
48
  type: NgModule,
49
49
  args: [{
50
50
  imports: [
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-payment-driver-testing.mjs","sources":["../../../libs/payment/driver/testing/src/drivers/payment.service.ts","../../../libs/payment/driver/testing/src/drivers/payment-driver.module.ts","../../../libs/payment/driver/testing/src/daffodil-payment-driver-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n Observable,\n of,\n} from 'rxjs';\n\nimport {\n DaffPaymentRequest,\n DaffPaymentResponse,\n} from '@daffodil/payment';\nimport { DaffPaymentDriverInterface } from '@daffodil/payment/driver';\nimport { DaffPaymentResponseKindFactory } from '@daffodil/payment/testing';\n\n/**\n * A basic payment driver that creates mock payment results of different kinds.\n * For testing purposes.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffPaymentTestingDriver implements DaffPaymentDriverInterface {\n\n constructor(\n private paymentResponseFactory: DaffPaymentResponseKindFactory,\n ) {}\n\n generateToken(request: DaffPaymentRequest): Observable<DaffPaymentResponse> {\n return of(this.paymentResponseFactory.create());\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { provideDaffPaymentDriver } from '@daffodil/payment/driver';\n\nimport { DaffPaymentTestingDriver } from './payment.service';\n\n/**\n * Provides the {@link DaffPaymentTestingDriver} as the {@link DaffPaymentDriver}.\n */\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffPaymentTestingDriverModule {\n static forRoot(): ModuleWithProviders<DaffPaymentTestingDriverModule> {\n return {\n ngModule: DaffPaymentTestingDriverModule,\n providers: [\n provideDaffPaymentDriver(DaffPaymentTestingDriver),\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAaA;;;;;AAKG;MAIU,wBAAwB,CAAA;AAEnC,IAAA,WAAA,CACU,sBAAsD,EAAA;QAAtD,IAAA,CAAA,sBAAsB,GAAtB,sBAAsB;IAC7B;AAEH,IAAA,aAAa,CAAC,OAA2B,EAAA;QACvC,OAAO,EAAE,CAAC,IAAI,CAAC,sBAAsB,CAAC,MAAM,EAAE,CAA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CAAA;kBAL1C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACF,iBAAA;;;ACjBD;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-payment-driver-testing.mjs","sources":["../../../libs/payment/driver/testing/src/drivers/payment.service.ts","../../../libs/payment/driver/testing/src/drivers/payment-driver.module.ts","../../../libs/payment/driver/testing/src/daffodil-payment-driver-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n Observable,\n of,\n} from 'rxjs';\n\nimport {\n DaffPaymentRequest,\n DaffPaymentResponse,\n} from '@daffodil/payment';\nimport { DaffPaymentDriverInterface } from '@daffodil/payment/driver';\nimport { DaffPaymentResponseKindFactory } from '@daffodil/payment/testing';\n\n/**\n * A basic payment driver that creates mock payment results of different kinds.\n * For testing purposes.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffPaymentTestingDriver implements DaffPaymentDriverInterface {\n\n constructor(\n private paymentResponseFactory: DaffPaymentResponseKindFactory,\n ) {}\n\n generateToken(request: DaffPaymentRequest): Observable<DaffPaymentResponse> {\n return of(this.paymentResponseFactory.create());\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { provideDaffPaymentDriver } from '@daffodil/payment/driver';\n\nimport { DaffPaymentTestingDriver } from './payment.service';\n\n/**\n * Provides the {@link DaffPaymentTestingDriver} as the {@link DaffPaymentDriver}.\n */\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffPaymentTestingDriverModule {\n static forRoot(): ModuleWithProviders<DaffPaymentTestingDriverModule> {\n return {\n ngModule: DaffPaymentTestingDriverModule,\n providers: [\n provideDaffPaymentDriver(DaffPaymentTestingDriver),\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAaA;;;;;AAK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,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,8BAA8B,YAHvC,YAAY,CAAA,EAAA,CAAA,CAAA;;4FAGH,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAL1C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACF,iBAAA;;;ACjBD;;AAEG;;;;"}
@@ -15,10 +15,10 @@ class MockDaffPaymentPageFacade {
15
15
  }
16
16
  dispatch(action) { }
17
17
  ;
18
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: MockDaffPaymentPageFacade, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
19
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: MockDaffPaymentPageFacade, providedIn: 'root' }); }
18
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MockDaffPaymentPageFacade, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
19
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MockDaffPaymentPageFacade, providedIn: 'root' }); }
20
20
  }
21
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: MockDaffPaymentPageFacade, decorators: [{
21
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MockDaffPaymentPageFacade, decorators: [{
22
22
  type: Injectable,
23
23
  args: [{ providedIn: 'root' }]
24
24
  }] });
@@ -27,13 +27,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
27
27
  * Provides the {@link MockDaffPaymentPageFacade} for {@link DaffPaymentPageFacade}.
28
28
  */
29
29
  class DaffPaymentStateTestingModule {
30
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPaymentStateTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
31
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.1", ngImport: i0, type: DaffPaymentStateTestingModule }); }
32
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPaymentStateTestingModule, providers: [
30
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffPaymentStateTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
31
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.18", ngImport: i0, type: DaffPaymentStateTestingModule }); }
32
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffPaymentStateTestingModule, providers: [
33
33
  { provide: DaffPaymentPageFacade, useExisting: MockDaffPaymentPageFacade },
34
34
  ] }); }
35
35
  }
36
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPaymentStateTestingModule, decorators: [{
36
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffPaymentStateTestingModule, decorators: [{
37
37
  type: NgModule,
38
38
  args: [{
39
39
  providers: [
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-payment-state-testing.mjs","sources":["../../../libs/payment/state/testing/src/mock-payment-facade.ts","../../../libs/payment/state/testing/src/payment-testing.module.ts","../../../libs/payment/state/testing/src/daffodil-payment-state-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { Action } from '@ngrx/store';\nimport { BehaviorSubject } from 'rxjs';\n\nimport { DaffStateError } from '@daffodil/core/state';\nimport { DaffPaymentPageFacadeInterface } from '@daffodil/payment/state';\n\n/**\n * Mocks out facade fields and methods for testing purposes.\n *\n * @inheritdoc\n */\n@Injectable({ providedIn: 'root' })\nexport class MockDaffPaymentPageFacade implements DaffPaymentPageFacadeInterface {\n loading$ = new BehaviorSubject<boolean>(null);\n errors$ = new BehaviorSubject<DaffStateError[]>([]);\n\n dispatch(action: Action) {};\n}\n","import { NgModule } from '@angular/core';\n\nimport { DaffPaymentPageFacade } from '@daffodil/payment/state';\n\nimport { MockDaffPaymentPageFacade } from './mock-payment-facade';\n\n/**\n * Provides the {@link MockDaffPaymentPageFacade} for {@link DaffPaymentPageFacade}.\n */\n@NgModule({\n providers: [\n { provide: DaffPaymentPageFacade, useExisting: MockDaffPaymentPageFacade },\n ],\n})\nexport class DaffPaymentStateTestingModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAOA;;;;AAIG;MAEU,yBAAyB,CAAA;AADtC,IAAA,WAAA,GAAA;AAEE,QAAA,IAAA,CAAA,QAAQ,GAAG,IAAI,eAAe,CAAU,IAAI,CAAC;AAC7C,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,eAAe,CAAmB,EAAE,CAAC;AAGpD,IAAA;IADC,QAAQ,CAAC,MAAc,EAAA,EAAG;;iIAJf,yBAAyB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAzB,uBAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,yBAAyB,cADZ,MAAM,EAAA,CAAA,CAAA;;2FACnB,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBADrC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACNlC;;AAEG;MAMU,6BAA6B,CAAA;iIAA7B,6BAA6B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;kIAA7B,6BAA6B,EAAA,CAAA,CAAA;AAA7B,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,6BAA6B,EAAA,SAAA,EAJ7B;AACT,YAAA,EAAE,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,yBAAyB,EAAE;AAC3E,SAAA,EAAA,CAAA,CAAA;;2FAEU,6BAA6B,EAAA,UAAA,EAAA,CAAA;kBALzC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,SAAS,EAAE;AACT,wBAAA,EAAE,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,yBAAyB,EAAE;AAC3E,qBAAA;AACF,iBAAA;;;ACbD;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-payment-state-testing.mjs","sources":["../../../libs/payment/state/testing/src/mock-payment-facade.ts","../../../libs/payment/state/testing/src/payment-testing.module.ts","../../../libs/payment/state/testing/src/daffodil-payment-state-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { Action } from '@ngrx/store';\nimport { BehaviorSubject } from 'rxjs';\n\nimport { DaffStateError } from '@daffodil/core/state';\nimport { DaffPaymentPageFacadeInterface } from '@daffodil/payment/state';\n\n/**\n * Mocks out facade fields and methods for testing purposes.\n *\n * @inheritdoc\n */\n@Injectable({ providedIn: 'root' })\nexport class MockDaffPaymentPageFacade implements DaffPaymentPageFacadeInterface {\n loading$ = new BehaviorSubject<boolean>(null);\n errors$ = new BehaviorSubject<DaffStateError[]>([]);\n\n dispatch(action: Action) {};\n}\n","import { NgModule } from '@angular/core';\n\nimport { DaffPaymentPageFacade } from '@daffodil/payment/state';\n\nimport { MockDaffPaymentPageFacade } from './mock-payment-facade';\n\n/**\n * Provides the {@link MockDaffPaymentPageFacade} for {@link DaffPaymentPageFacade}.\n */\n@NgModule({\n providers: [\n { provide: DaffPaymentPageFacade, useExisting: MockDaffPaymentPageFacade },\n ],\n})\nexport class DaffPaymentStateTestingModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAOA;;;;AAIG;MAEU,yBAAyB,CAAA;AADtC,IAAA,WAAA,GAAA;AAEE,QAAA,IAAA,CAAA,QAAQ,GAAG,IAAI,eAAe,CAAU,IAAI,CAAC;AAC7C,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,eAAe,CAAmB,EAAE,CAAC;AAGpD,IAAA;IADC,QAAQ,CAAC,MAAc,EAAA,EAAG;;kIAJf,yBAAyB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAzB,uBAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,yBAAyB,cADZ,MAAM,EAAA,CAAA,CAAA;;4FACnB,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBADrC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACNlC;;AAEG;MAMU,6BAA6B,CAAA;kIAA7B,6BAA6B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;mIAA7B,6BAA6B,EAAA,CAAA,CAAA;AAA7B,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,6BAA6B,EAAA,SAAA,EAJ7B;AACT,YAAA,EAAE,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,yBAAyB,EAAE;AAC3E,SAAA,EAAA,CAAA,CAAA;;4FAEU,6BAA6B,EAAA,UAAA,EAAA,CAAA;kBALzC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,SAAS,EAAE;AACT,wBAAA,EAAE,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,yBAAyB,EAAE;AAC3E,qBAAA;AACF,iBAAA;;;ACbD;;AAEG;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { createMultiInjectionToken, createSingleInjectionToken, daffArrayToDict } from '@daffodil/core';
2
2
  import * as i1 from '@ngrx/store';
3
- import { createFeatureSelector, createSelector, select, combineReducers, StoreModule } from '@ngrx/store';
3
+ import { defaultMemoize, createFeatureSelector, createSelector, select, combineReducers, StoreModule } from '@ngrx/store';
4
4
  import * as i0 from '@angular/core';
5
5
  import { Injectable, inject, NgModule } from '@angular/core';
6
6
  import { daffTransformErrorToStateError, daffComposeReducers } from '@daffodil/core/state';
@@ -121,12 +121,9 @@ const daffPaymentReducerFactory = (actions) => (state = daffPaymentInitialState,
121
121
  }
122
122
  };
123
123
 
124
- const getDaffPaymentReducersStateSelector = (() => {
125
- let cache;
126
- return () => cache = cache || {
127
- selectPaymentFeatureState: createFeatureSelector(DAFF_PAYMENT_STORE_FEATURE_KEY),
128
- };
129
- })();
124
+ const getDaffPaymentReducersStateSelector = defaultMemoize(() => ({
125
+ selectPaymentFeatureState: createFeatureSelector(DAFF_PAYMENT_STORE_FEATURE_KEY),
126
+ })).memoized;
130
127
 
131
128
  /**
132
129
  * Creates a group of selectors for {@link DaffPaymentReducerState} that use the passed state selector as the basis.
@@ -141,10 +138,7 @@ const daffPaymentCreateSelectors = () => {
141
138
  selectPaymentErrors,
142
139
  };
143
140
  };
144
- const daffPaymentGetSelectors = (() => {
145
- let cache;
146
- return () => cache = cache || daffPaymentCreateSelectors();
147
- })();
141
+ const daffPaymentGetSelectors = defaultMemoize(() => daffPaymentCreateSelectors()).memoized;
148
142
 
149
143
  /**
150
144
  * @inheritdoc
@@ -162,10 +156,10 @@ class DaffPaymentPageFacade {
162
156
  dispatch(action) {
163
157
  this.store.dispatch(action);
164
158
  }
165
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPaymentPageFacade, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
166
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPaymentPageFacade, providedIn: 'root' }); }
159
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffPaymentPageFacade, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
160
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffPaymentPageFacade, providedIn: 'root' }); }
167
161
  }
168
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPaymentPageFacade, decorators: [{
162
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffPaymentPageFacade, decorators: [{
169
163
  type: Injectable,
170
164
  args: [{
171
165
  providedIn: 'root',
@@ -235,11 +229,11 @@ provider: provideDaffPaymentReducers, } = createSingleInjectionToken('DAFF_PAYME
235
229
  * Creates the payment feature store.
236
230
  */
237
231
  class DaffPaymentStateModule {
238
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPaymentStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
239
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.1", ngImport: i0, type: DaffPaymentStateModule, imports: [i1.StoreFeatureModule] }); }
240
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPaymentStateModule, imports: [StoreModule.forFeature(DAFF_PAYMENT_STORE_FEATURE_KEY, DAFF_PAYMENT_REDUCERS)] }); }
232
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffPaymentStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
233
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.18", ngImport: i0, type: DaffPaymentStateModule, imports: [i1.StoreFeatureModule] }); }
234
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffPaymentStateModule, imports: [StoreModule.forFeature(DAFF_PAYMENT_STORE_FEATURE_KEY, DAFF_PAYMENT_REDUCERS)] }); }
241
235
  }
242
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPaymentStateModule, decorators: [{
236
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffPaymentStateModule, decorators: [{
243
237
  type: NgModule,
244
238
  args: [{
245
239
  imports: [
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-payment-state.mjs","sources":["../../../libs/payment/state/src/actions/payment.actions.ts","../../../libs/payment/state/src/reducers/store-feature-key.ts","../../../libs/payment/state/src/reducers/token/extra.token.ts","../../../libs/payment/state/src/reducers/payment/adapter.ts","../../../libs/payment/state/src/reducers/payment/initial-state.ts","../../../libs/payment/state/src/reducers/payment/reducer.ts","../../../libs/payment/state/src/selectors/feature.selector.ts","../../../libs/payment/state/src/selectors/payment.selector.ts","../../../libs/payment/state/src/facades/payment/facade.ts","../../../libs/payment/state/src/injection-tokens/available-processors.token.ts","../../../libs/payment/state/src/injection-tokens/processor-collection.token.ts","../../../libs/payment/state/src/injection-tokens/error-matcher.token.ts","../../../libs/payment/state/src/reducers/token/reducers.token.ts","../../../libs/payment/state/src/payment.module.ts","../../../libs/payment/state/src/daffodil-payment-state.ts"],"sourcesContent":["import { Action } from '@ngrx/store';\n\nimport { DaffIdentifiable } from '@daffodil/core';\nimport { DaffStateError } from '@daffodil/core/state';\nimport { DaffPersonalAddress } from '@daffodil/geography';\nimport {\n DaffPaymentRequest,\n DaffPaymentResponse,\n} from '@daffodil/payment';\n\n/**\n * The payment action types enum.\n */\nexport enum DaffPaymentActionTypes {\n GenerateTokenSuccessAction = '[@daffodil/payment] Generate Token Success Action',\n GenerateTokenFailureAction = '[@daffodil/payment] Generate Token Failure Action',\n}\n\n/**\n * Generates a payment token.\n *\n * @param query The payment query.\n */\nexport interface DaffPaymentGenerateTokenPayload<T extends DaffPaymentRequest = DaffPaymentRequest> {\n readonly request: T;\n readonly address?: DaffPersonalAddress | DaffIdentifiable;\n}\nexport interface DaffPaymentGenerateToken<T extends DaffPaymentRequest = DaffPaymentRequest> extends DaffPaymentGenerateTokenPayload<T>, Action {}\n\n/**\n * Indicates a successful generation of a payment token.\n */\nexport class DaffPaymentGenerateTokenSuccess<T extends DaffPaymentResponse = DaffPaymentResponse> implements Action {\n readonly type = DaffPaymentActionTypes.GenerateTokenSuccessAction;\n\n constructor(public payload: T) {}\n}\n\n/**\n * A failed payment with the error message.\n */\nexport class DaffPaymentGenerateTokenFailure implements Action {\n readonly type = DaffPaymentActionTypes.GenerateTokenFailureAction;\n\n constructor(public payload: DaffStateError) {}\n}\n\n/**\n * A union of the payment action types.\n */\nexport type DaffPaymentActions<\n T extends DaffPaymentResponse = DaffPaymentResponse,\n> =\n | DaffPaymentGenerateTokenSuccess<T>\n | DaffPaymentGenerateTokenFailure;\n","/**\n * The key under which the payment feature state will be stored.\n */\nexport const DAFF_PAYMENT_STORE_FEATURE_KEY = 'daffPayment';\n","import { ActionReducer } from '@ngrx/store';\n\nimport { createMultiInjectionToken } from '@daffodil/core';\n\nimport { DaffPaymentReducersState } from '../reducers.interface';\n\nexport const {\n /**\n * A token to hold the injectable extra reducers.\n *\n * Prefer using {@link daffPaymentProvideExtraReducers}.\n */\n token: DAFF_PAYMENT_EXTRA_REDUCERS,\n\n /**\n * Provides additional reducers that run after the standard Daffodil cart reducers.\n *\n * @example\n * ```ts\n * providers: [\n * ...daffPaymentProvideExtraReducers(\n * myReducer1,\n * myReducer2\n * )\n * ]\n * ```\n */\n provider: daffPaymentProvideExtraReducers,\n} = createMultiInjectionToken<ActionReducer<DaffPaymentReducersState>>(\n 'DAFF_PAYMENT_EXTRA_REDUCERS',\n { providedIn: 'any' },\n);\n","import { DaffStateError } from '@daffodil/core/state';\n\nimport { DaffPaymentReducerState } from './interface';\n\n/**\n * Manages {@link DaffPaymentReducerState}.\n */\nexport class DaffPaymentStateReducerAdapter {\n\n /**\n * Begins the payment operation flow.\n * Sets loading to true.\n */\n generateToken(state: DaffPaymentReducerState): DaffPaymentReducerState {\n return {\n ...state,\n loading: true,\n };\n }\n\n /**\n * Sets loading to false and resets errors.\n */\n tokenGenerated(state: DaffPaymentReducerState): DaffPaymentReducerState {\n return {\n ...state,\n loading: false,\n errors: [],\n };\n }\n\n /**\n * Stores the from a failed payment.\n * Also sets loading to false.\n */\n storeError(errors: DaffStateError[], state: DaffPaymentReducerState): DaffPaymentReducerState {\n return {\n ...state,\n errors,\n loading: false,\n };\n }\n}\n","import { DaffPaymentReducerState } from './interface';\n\n/**\n * The initial state for the main payment state, see {@link DaffPaymentReducerState}.\n */\nexport const daffPaymentInitialState: DaffPaymentReducerState = {\n loading: false,\n errors: [],\n};\n","import { DaffPaymentResponse } from '@daffodil/payment';\n\nimport { DaffPaymentStateReducerAdapter } from './adapter';\nimport { daffPaymentInitialState } from './initial-state';\nimport { DaffPaymentReducerState } from './interface';\nimport {\n DaffPaymentGenerateToken,\n DaffPaymentActionTypes,\n DaffPaymentActions,\n DaffPaymentGenerateTokenFailure,\n} from '../../actions/payment.actions';\n\n/**\n * The reducer for the payment page state, see {@link DaffPaymentReducerState}.\n */\nexport const daffPaymentReducerFactory = <T extends DaffPaymentResponse = DaffPaymentResponse>(actions: DaffPaymentGenerateToken['type'][]) =>\n (\n state = daffPaymentInitialState,\n action: DaffPaymentActions<T>,\n ): DaffPaymentReducerState => {\n const adapter = new DaffPaymentStateReducerAdapter();\n switch (true) {\n case actions.includes(action.type):\n return adapter.generateToken(state);\n\n case action.type === DaffPaymentActionTypes.GenerateTokenSuccessAction:\n return adapter.tokenGenerated(state);\n\n case action.type === DaffPaymentActionTypes.GenerateTokenFailureAction:\n return adapter.storeError([(<DaffPaymentGenerateTokenFailure>action).payload], state);\n\n default:\n return state;\n }\n };\n","import {\n createFeatureSelector,\n MemoizedSelector,\n} from '@ngrx/store';\n\nimport {\n DaffPaymentStateRootSlice,\n DaffPaymentReducersState,\n DAFF_PAYMENT_STORE_FEATURE_KEY,\n} from '../reducers/public_api';\n\n/**\n * Selector for the payment feature state.\n */\nexport interface DaffPaymentFeatureSelector {\n selectPaymentFeatureState: MemoizedSelector<DaffPaymentStateRootSlice, DaffPaymentReducersState>;\n}\n\nexport const getDaffPaymentReducersStateSelector = (() => {\n let cache;\n return (): DaffPaymentFeatureSelector =>\n cache = cache || {\n selectPaymentFeatureState: createFeatureSelector<DaffPaymentReducersState>(DAFF_PAYMENT_STORE_FEATURE_KEY),\n };\n})();\n","import {\n createSelector,\n MemoizedSelector,\n} from '@ngrx/store';\n\nimport { DaffStateError } from '@daffodil/core/state';\n\nimport { getDaffPaymentReducersStateSelector } from './feature.selector';\nimport { DaffPaymentStateRootSlice } from '../reducers/public_api';\n\n/**\n * Selectors for the main part of payment state.\n */\nexport interface DaffPaymentSelectors {\n /**\n * Selects whether there is a pending payment operation.\n */\n selectPaymentLoading: MemoizedSelector<DaffPaymentStateRootSlice, boolean>;\n /**\n * Selects the list of payment errors, if any.\n */\n selectPaymentErrors: MemoizedSelector<DaffPaymentStateRootSlice, DaffStateError[]>;\n}\n\n/**\n * Creates a group of selectors for {@link DaffPaymentReducerState} that use the passed state selector as the basis.\n */\nconst daffPaymentCreateSelectors = () => {\n const { selectPaymentFeatureState } = getDaffPaymentReducersStateSelector();\n const selectPaymentState = createSelector(\n selectPaymentFeatureState,\n state => state.payment,\n );\n\n const selectPaymentLoading = createSelector(\n selectPaymentState,\n state => state.loading,\n );\n\n const selectPaymentErrors = createSelector(\n selectPaymentState,\n state => state.errors,\n );\n\n return {\n selectPaymentLoading,\n selectPaymentErrors,\n };\n};\n\n\nexport const daffPaymentGetSelectors = (() => {\n let cache;\n return (): DaffPaymentSelectors =>\n cache = cache || daffPaymentCreateSelectors();\n})();\n\n","import { Injectable } from '@angular/core';\nimport {\n Action,\n Store,\n select,\n} from '@ngrx/store';\nimport { Observable } from 'rxjs';\n\nimport { DaffStateError } from '@daffodil/core/state';\n\nimport { DaffPaymentPageFacadeInterface } from './interface';\nimport { DaffPaymentStateRootSlice } from '../../reducers/public_api';\nimport { daffPaymentGetSelectors } from '../../selectors/public_api';\n\n/**\n * @inheritdoc\n *\n * Serves as the base for a payment facade.\n * Extend this class and pass in the selectors for the specific state you wish to target.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffPaymentPageFacade implements DaffPaymentPageFacadeInterface {\n loading$: Observable<boolean>;\n errors$: Observable<DaffStateError[]>;\n\n constructor(\n private store: Store<DaffPaymentStateRootSlice>,\n ) {\n const {\n selectPaymentLoading,\n selectPaymentErrors,\n } = daffPaymentGetSelectors();\n\n this.loading$ = this.store.pipe(select(selectPaymentLoading));\n this.errors$ = this.store.pipe(select(selectPaymentErrors));\n }\n\n dispatch(action: Action) {\n this.store.dispatch(action);\n }\n}\n","import { createMultiInjectionToken } from '@daffodil/core';\n\nimport { DaffPaymentAvailableProcessor } from '../models/public_api';\n\nexport const {\n /**\n * A multi-provider injection token for registering payment processors.\n */\n token: DAFF_PAYMENT_AVAILABLE_PROCESSORS,\n\n /**\n * Provides a payment processor registration.\n *\n * See {@link DaffPaymentAvailableProcessor}.\n */\n provider: daffPaymentProvideAvailableProcessors,\n} = createMultiInjectionToken<DaffPaymentAvailableProcessor>(\n 'DAFF_PAYMENT_AVAILABLE_PROCESSORS',\n { providedIn: 'any' },\n);\n","import { inject } from '@angular/core';\n\nimport {\n createSingleInjectionToken,\n daffArrayToDict,\n} from '@daffodil/core';\n\nimport { DAFF_PAYMENT_AVAILABLE_PROCESSORS } from './available-processors.token';\nimport { DaffPaymentProcessorCollection } from '../models/public_api';\n\nexport const {\n /**\n * An internal token to combine the available payment processors into a single collection.\n */\n token: DAFF_PAYMENT_PROCESSOR_COLLECTION,\n /**\n * Provider function for {@link DAFF_PAYMENT_PROCESSOR_COLLECTION}.\n */\n provider: provideDaffPaymentProcessorCollection,\n} = createSingleInjectionToken<DaffPaymentProcessorCollection>(\n 'DAFF_PAYMENT_PROCESSOR_COLLECTION',\n {\n factory: () => {\n const processors = inject(DAFF_PAYMENT_AVAILABLE_PROCESSORS);\n return daffArrayToDict(processors, ({ kind }) => kind);\n },\n },\n);\n","import { createSingleInjectionToken } from '@daffodil/core';\nimport { daffTransformErrorToStateError } from '@daffodil/core/state';\n\nexport const {\n /**\n * Transforms `DaffError`s into `DaffStateError`s before they are serialized into state.\n * Can be used to further refine Daffodil errors into more specific app errors.\n */\n token: DAFF_PAYMENT_ERROR_MATCHER,\n /**\n * Provider function for {@link DAFF_PAYMENT_ERROR_MATCHER}.\n */\n provider: provideDaffPaymentErrorMatcher,\n} = createSingleInjectionToken<typeof daffTransformErrorToStateError>(\n 'DAFF_PAYMENT_ERROR_MATCHER',\n { factory: () => daffTransformErrorToStateError },\n);\n","import { inject } from '@angular/core';\nimport {\n ActionReducer,\n combineReducers,\n} from '@ngrx/store';\n\nimport { createSingleInjectionToken } from '@daffodil/core';\nimport { daffComposeReducers } from '@daffodil/core/state';\n\nimport { DAFF_PAYMENT_EXTRA_REDUCERS } from './extra.token';\nimport { DAFF_PAYMENT_AVAILABLE_PROCESSORS } from '../../injection-tokens/public_api';\nimport { daffPaymentReducerFactory } from '../payment/reducer';\nimport { DaffPaymentReducersState } from '../reducers.interface';\n\nexport const {\n /**\n * An internal token to hold the Daffodil payment reducers.\n * Includes the extra and standard reducers.\n *\n * @docs-private\n */\n token: DAFF_PAYMENT_REDUCERS,\n /**\n * Provider function for {@link DAFF_PAYMENT_REDUCERS}.\n */\n provider: provideDaffPaymentReducers,\n} = createSingleInjectionToken<ActionReducer<DaffPaymentReducersState>>(\n 'DAFF_PAYMENT_REDUCERS',\n {\n providedIn: 'any',\n factory: () => daffComposeReducers([\n combineReducers({\n payment: daffPaymentReducerFactory(inject(DAFF_PAYMENT_AVAILABLE_PROCESSORS).map(({ action }) => action)),\n }),\n ...inject(DAFF_PAYMENT_EXTRA_REDUCERS),\n ]),\n },\n);\n","import { NgModule } from '@angular/core';\nimport { StoreModule } from '@ngrx/store';\n\nimport { DAFF_PAYMENT_STORE_FEATURE_KEY } from './reducers/public_api';\nimport { DAFF_PAYMENT_REDUCERS } from './reducers/token/reducers.token';\n\n/**\n * Creates the payment feature store.\n */\n@NgModule({\n imports: [\n StoreModule.forFeature(DAFF_PAYMENT_STORE_FEATURE_KEY, DAFF_PAYMENT_REDUCERS),\n ],\n})\nexport class DaffPaymentStateModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n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,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;kIAAtB,sBAAsB,EAAA,OAAA,EAAA,CAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,CAAA,CAAA;kIAAtB,sBAAsB,EAAA,OAAA,EAAA,CAH/B,WAAW,CAAC,UAAU,CAAC,8BAA8B,EAAE,qBAAqB,CAAC,CAAA,EAAA,CAAA,CAAA;;2FAGpE,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBALlC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;AACP,wBAAA,WAAW,CAAC,UAAU,CAAC,8BAA8B,EAAE,qBAAqB,CAAC;AAC9E,qBAAA;AACF,iBAAA;;;ACbD;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-payment-state.mjs","sources":["../../../libs/payment/state/src/actions/payment.actions.ts","../../../libs/payment/state/src/reducers/store-feature-key.ts","../../../libs/payment/state/src/reducers/token/extra.token.ts","../../../libs/payment/state/src/reducers/payment/adapter.ts","../../../libs/payment/state/src/reducers/payment/initial-state.ts","../../../libs/payment/state/src/reducers/payment/reducer.ts","../../../libs/payment/state/src/selectors/feature.selector.ts","../../../libs/payment/state/src/selectors/payment.selector.ts","../../../libs/payment/state/src/facades/payment/facade.ts","../../../libs/payment/state/src/injection-tokens/available-processors.token.ts","../../../libs/payment/state/src/injection-tokens/processor-collection.token.ts","../../../libs/payment/state/src/injection-tokens/error-matcher.token.ts","../../../libs/payment/state/src/reducers/token/reducers.token.ts","../../../libs/payment/state/src/payment.module.ts","../../../libs/payment/state/src/daffodil-payment-state.ts"],"sourcesContent":["import { Action } from '@ngrx/store';\n\nimport { DaffIdentifiable } from '@daffodil/core';\nimport { DaffStateError } from '@daffodil/core/state';\nimport { DaffPersonalAddress } from '@daffodil/geography';\nimport {\n DaffPaymentRequest,\n DaffPaymentResponse,\n} from '@daffodil/payment';\n\n/**\n * The payment action types enum.\n */\nexport enum DaffPaymentActionTypes {\n GenerateTokenSuccessAction = '[@daffodil/payment] Generate Token Success Action',\n GenerateTokenFailureAction = '[@daffodil/payment] Generate Token Failure Action',\n}\n\n/**\n * Generates a payment token.\n *\n * @param query The payment query.\n */\nexport interface DaffPaymentGenerateTokenPayload<T extends DaffPaymentRequest = DaffPaymentRequest> {\n readonly request: T;\n readonly address?: DaffPersonalAddress | DaffIdentifiable;\n}\nexport interface DaffPaymentGenerateToken<T extends DaffPaymentRequest = DaffPaymentRequest> extends DaffPaymentGenerateTokenPayload<T>, Action {}\n\n/**\n * Indicates a successful generation of a payment token.\n */\nexport class DaffPaymentGenerateTokenSuccess<T extends DaffPaymentResponse = DaffPaymentResponse> implements Action {\n readonly type = DaffPaymentActionTypes.GenerateTokenSuccessAction;\n\n constructor(public payload: T) {}\n}\n\n/**\n * A failed payment with the error message.\n */\nexport class DaffPaymentGenerateTokenFailure implements Action {\n readonly type = DaffPaymentActionTypes.GenerateTokenFailureAction;\n\n constructor(public payload: DaffStateError) {}\n}\n\n/**\n * A union of the payment action types.\n */\nexport type DaffPaymentActions<\n T extends DaffPaymentResponse = DaffPaymentResponse,\n> =\n | DaffPaymentGenerateTokenSuccess<T>\n | DaffPaymentGenerateTokenFailure;\n","/**\n * The key under which the payment feature state will be stored.\n */\nexport const DAFF_PAYMENT_STORE_FEATURE_KEY = 'daffPayment';\n","import { ActionReducer } from '@ngrx/store';\n\nimport { createMultiInjectionToken } from '@daffodil/core';\n\nimport { DaffPaymentReducersState } from '../reducers.interface';\n\nexport const {\n /**\n * A token to hold the injectable extra reducers.\n *\n * Prefer using {@link daffPaymentProvideExtraReducers}.\n */\n token: DAFF_PAYMENT_EXTRA_REDUCERS,\n\n /**\n * Provides additional reducers that run after the standard Daffodil cart reducers.\n *\n * @example\n * ```ts\n * providers: [\n * ...daffPaymentProvideExtraReducers(\n * myReducer1,\n * myReducer2\n * )\n * ]\n * ```\n */\n provider: daffPaymentProvideExtraReducers,\n} = createMultiInjectionToken<ActionReducer<DaffPaymentReducersState>>(\n 'DAFF_PAYMENT_EXTRA_REDUCERS',\n { providedIn: 'any' },\n);\n","import { DaffStateError } from '@daffodil/core/state';\n\nimport { DaffPaymentReducerState } from './interface';\n\n/**\n * Manages {@link DaffPaymentReducerState}.\n */\nexport class DaffPaymentStateReducerAdapter {\n\n /**\n * Begins the payment operation flow.\n * Sets loading to true.\n */\n generateToken(state: DaffPaymentReducerState): DaffPaymentReducerState {\n return {\n ...state,\n loading: true,\n };\n }\n\n /**\n * Sets loading to false and resets errors.\n */\n tokenGenerated(state: DaffPaymentReducerState): DaffPaymentReducerState {\n return {\n ...state,\n loading: false,\n errors: [],\n };\n }\n\n /**\n * Stores the from a failed payment.\n * Also sets loading to false.\n */\n storeError(errors: DaffStateError[], state: DaffPaymentReducerState): DaffPaymentReducerState {\n return {\n ...state,\n errors,\n loading: false,\n };\n }\n}\n","import { DaffPaymentReducerState } from './interface';\n\n/**\n * The initial state for the main payment state, see {@link DaffPaymentReducerState}.\n */\nexport const daffPaymentInitialState: DaffPaymentReducerState = {\n loading: false,\n errors: [],\n};\n","import { DaffPaymentResponse } from '@daffodil/payment';\n\nimport { DaffPaymentStateReducerAdapter } from './adapter';\nimport { daffPaymentInitialState } from './initial-state';\nimport { DaffPaymentReducerState } from './interface';\nimport {\n DaffPaymentGenerateToken,\n DaffPaymentActionTypes,\n DaffPaymentActions,\n DaffPaymentGenerateTokenFailure,\n} from '../../actions/payment.actions';\n\n/**\n * The reducer for the payment page state, see {@link DaffPaymentReducerState}.\n */\nexport const daffPaymentReducerFactory = <T extends DaffPaymentResponse = DaffPaymentResponse>(actions: DaffPaymentGenerateToken['type'][]) =>\n (\n state = daffPaymentInitialState,\n action: DaffPaymentActions<T>,\n ): DaffPaymentReducerState => {\n const adapter = new DaffPaymentStateReducerAdapter();\n switch (true) {\n case actions.includes(action.type):\n return adapter.generateToken(state);\n\n case action.type === DaffPaymentActionTypes.GenerateTokenSuccessAction:\n return adapter.tokenGenerated(state);\n\n case action.type === DaffPaymentActionTypes.GenerateTokenFailureAction:\n return adapter.storeError([(<DaffPaymentGenerateTokenFailure>action).payload], state);\n\n default:\n return state;\n }\n };\n","import {\n createFeatureSelector,\n MemoizedSelector,\n defaultMemoize,\n} from '@ngrx/store';\n\nimport {\n DaffPaymentStateRootSlice,\n DaffPaymentReducersState,\n DAFF_PAYMENT_STORE_FEATURE_KEY,\n} from '../reducers/public_api';\n\n/**\n * Selector for the payment feature state.\n */\nexport interface DaffPaymentFeatureSelector {\n selectPaymentFeatureState: MemoizedSelector<DaffPaymentStateRootSlice, DaffPaymentReducersState>;\n}\n\nexport const getDaffPaymentReducersStateSelector: () => DaffPaymentFeatureSelector = defaultMemoize(() => ({\n selectPaymentFeatureState: createFeatureSelector<DaffPaymentReducersState>(DAFF_PAYMENT_STORE_FEATURE_KEY),\n})).memoized;\n","import {\n createSelector,\n MemoizedSelector,\n defaultMemoize,\n} from '@ngrx/store';\n\nimport { DaffStateError } from '@daffodil/core/state';\n\nimport { getDaffPaymentReducersStateSelector } from './feature.selector';\nimport { DaffPaymentStateRootSlice } from '../reducers/public_api';\n\n/**\n * Selectors for the main part of payment state.\n */\nexport interface DaffPaymentSelectors {\n /**\n * Selects whether there is a pending payment operation.\n */\n selectPaymentLoading: MemoizedSelector<DaffPaymentStateRootSlice, boolean>;\n /**\n * Selects the list of payment errors, if any.\n */\n selectPaymentErrors: MemoizedSelector<DaffPaymentStateRootSlice, DaffStateError[]>;\n}\n\n/**\n * Creates a group of selectors for {@link DaffPaymentReducerState} that use the passed state selector as the basis.\n */\nconst daffPaymentCreateSelectors = () => {\n const { selectPaymentFeatureState } = getDaffPaymentReducersStateSelector();\n const selectPaymentState = createSelector(\n selectPaymentFeatureState,\n state => state.payment,\n );\n\n const selectPaymentLoading = createSelector(\n selectPaymentState,\n state => state.loading,\n );\n\n const selectPaymentErrors = createSelector(\n selectPaymentState,\n state => state.errors,\n );\n\n return {\n selectPaymentLoading,\n selectPaymentErrors,\n };\n};\n\n\nexport const daffPaymentGetSelectors: () => DaffPaymentSelectors = defaultMemoize(() => daffPaymentCreateSelectors()).memoized;\n\n","import { Injectable } from '@angular/core';\nimport {\n Action,\n Store,\n select,\n} from '@ngrx/store';\nimport { Observable } from 'rxjs';\n\nimport { DaffStateError } from '@daffodil/core/state';\n\nimport { DaffPaymentPageFacadeInterface } from './interface';\nimport { DaffPaymentStateRootSlice } from '../../reducers/public_api';\nimport { daffPaymentGetSelectors } from '../../selectors/public_api';\n\n/**\n * @inheritdoc\n *\n * Serves as the base for a payment facade.\n * Extend this class and pass in the selectors for the specific state you wish to target.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffPaymentPageFacade implements DaffPaymentPageFacadeInterface {\n loading$: Observable<boolean>;\n errors$: Observable<DaffStateError[]>;\n\n constructor(\n private store: Store<DaffPaymentStateRootSlice>,\n ) {\n const {\n selectPaymentLoading,\n selectPaymentErrors,\n } = daffPaymentGetSelectors();\n\n this.loading$ = this.store.pipe(select(selectPaymentLoading));\n this.errors$ = this.store.pipe(select(selectPaymentErrors));\n }\n\n dispatch(action: Action) {\n this.store.dispatch(action);\n }\n}\n","import { createMultiInjectionToken } from '@daffodil/core';\n\nimport { DaffPaymentAvailableProcessor } from '../models/public_api';\n\nexport const {\n /**\n * A multi-provider injection token for registering payment processors.\n */\n token: DAFF_PAYMENT_AVAILABLE_PROCESSORS,\n\n /**\n * Provides a payment processor registration.\n *\n * See {@link DaffPaymentAvailableProcessor}.\n */\n provider: daffPaymentProvideAvailableProcessors,\n} = createMultiInjectionToken<DaffPaymentAvailableProcessor>(\n 'DAFF_PAYMENT_AVAILABLE_PROCESSORS',\n { providedIn: 'any' },\n);\n","import { inject } from '@angular/core';\n\nimport {\n createSingleInjectionToken,\n daffArrayToDict,\n} from '@daffodil/core';\n\nimport { DAFF_PAYMENT_AVAILABLE_PROCESSORS } from './available-processors.token';\nimport { DaffPaymentProcessorCollection } from '../models/public_api';\n\nexport const {\n /**\n * An internal token to combine the available payment processors into a single collection.\n */\n token: DAFF_PAYMENT_PROCESSOR_COLLECTION,\n /**\n * Provider function for {@link DAFF_PAYMENT_PROCESSOR_COLLECTION}.\n */\n provider: provideDaffPaymentProcessorCollection,\n} = createSingleInjectionToken<DaffPaymentProcessorCollection>(\n 'DAFF_PAYMENT_PROCESSOR_COLLECTION',\n {\n factory: () => {\n const processors = inject(DAFF_PAYMENT_AVAILABLE_PROCESSORS);\n return daffArrayToDict(processors, ({ kind }) => kind);\n },\n },\n);\n","import { createSingleInjectionToken } from '@daffodil/core';\nimport { daffTransformErrorToStateError } from '@daffodil/core/state';\n\nexport const {\n /**\n * Transforms `DaffError`s into `DaffStateError`s before they are serialized into state.\n * Can be used to further refine Daffodil errors into more specific app errors.\n */\n token: DAFF_PAYMENT_ERROR_MATCHER,\n /**\n * Provider function for {@link DAFF_PAYMENT_ERROR_MATCHER}.\n */\n provider: provideDaffPaymentErrorMatcher,\n} = createSingleInjectionToken<typeof daffTransformErrorToStateError>(\n 'DAFF_PAYMENT_ERROR_MATCHER',\n { factory: () => daffTransformErrorToStateError },\n);\n","import { inject } from '@angular/core';\nimport {\n ActionReducer,\n combineReducers,\n} from '@ngrx/store';\n\nimport { createSingleInjectionToken } from '@daffodil/core';\nimport { daffComposeReducers } from '@daffodil/core/state';\n\nimport { DAFF_PAYMENT_EXTRA_REDUCERS } from './extra.token';\nimport { DAFF_PAYMENT_AVAILABLE_PROCESSORS } from '../../injection-tokens/public_api';\nimport { daffPaymentReducerFactory } from '../payment/reducer';\nimport { DaffPaymentReducersState } from '../reducers.interface';\n\nexport const {\n /**\n * An internal token to hold the Daffodil payment reducers.\n * Includes the extra and standard reducers.\n *\n * @docs-private\n */\n token: DAFF_PAYMENT_REDUCERS,\n /**\n * Provider function for {@link DAFF_PAYMENT_REDUCERS}.\n */\n provider: provideDaffPaymentReducers,\n} = createSingleInjectionToken<ActionReducer<DaffPaymentReducersState>>(\n 'DAFF_PAYMENT_REDUCERS',\n {\n providedIn: 'any',\n factory: () => daffComposeReducers([\n combineReducers({\n payment: daffPaymentReducerFactory(inject(DAFF_PAYMENT_AVAILABLE_PROCESSORS).map(({ action }) => action)),\n }),\n ...inject(DAFF_PAYMENT_EXTRA_REDUCERS),\n ]),\n },\n);\n","import { NgModule } from '@angular/core';\nimport { StoreModule } from '@ngrx/store';\n\nimport { DAFF_PAYMENT_STORE_FEATURE_KEY } from './reducers/public_api';\nimport { DAFF_PAYMENT_REDUCERS } from './reducers/token/reducers.token';\n\n/**\n * Creates the payment feature store.\n */\n@NgModule({\n imports: [\n StoreModule.forFeature(DAFF_PAYMENT_STORE_FEATURE_KEY, DAFF_PAYMENT_REDUCERS),\n ],\n})\nexport class DaffPaymentStateModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAUA;;AAEG;IACS;AAAZ,CAAA,UAAY,sBAAsB,EAAA;AAChC,IAAA,sBAAA,CAAA,4BAAA,CAAA,GAAA,mDAAgF;AAChF,IAAA,sBAAA,CAAA,4BAAA,CAAA,GAAA,mDAAgF;AAClF,CAAC,EAHW,sBAAsB,KAAtB,sBAAsB,GAAA,EAAA,CAAA,CAAA;AAgBlC;;AAEG;MACU,+BAA+B,CAAA;AAG1C,IAAA,WAAA,CAAmB,OAAU,EAAA;QAAV,IAAA,CAAA,OAAO,GAAP,OAAO;AAFjB,QAAA,IAAA,CAAA,IAAI,GAAG,sBAAsB,CAAC,0BAA0B;IAEjC;AACjC;AAED;;AAEG;MACU,+BAA+B,CAAA;AAG1C,IAAA,WAAA,CAAmB,OAAuB,EAAA;QAAvB,IAAA,CAAA,OAAO,GAAP,OAAO;AAFjB,QAAA,IAAA,CAAA,IAAI,GAAG,sBAAsB,CAAC,0BAA0B;IAEpB;AAC9C;;AC7CD;;AAEG;AACI,MAAM,8BAA8B,GAAG;;ACGvC,MAAM;AACX;;;;AAIG;AACH,KAAK,EAAE,2BAA2B;AAElC;;;;;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A0B,GACrC,GAAG,0BAA0B,CAC5B,uBAAuB,EACvB;AACE,IAAA,UAAU,EAAE,KAAK;AACjB,IAAA,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjC,QAAA,eAAe,CAAC;AACd,YAAA,OAAO,EAAE,yBAAyB,CAAC,MAAM,CAAC,iCAAiC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,MAAM,CAAC,CAAC;SAC1G,CAAC;QACF,GAAG,MAAM,CAAC,2BAA2B,CAAC;KACvC,CAAC;AACH,CAAA,CACF;;AC/BD;;AAEG;MAMU,sBAAsB,CAAA;kIAAtB,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;mIAAtB,sBAAsB,EAAA,OAAA,EAAA,CAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,CAAA,CAAA;mIAAtB,sBAAsB,EAAA,OAAA,EAAA,CAH/B,WAAW,CAAC,UAAU,CAAC,8BAA8B,EAAE,qBAAqB,CAAC,CAAA,EAAA,CAAA,CAAA;;4FAGpE,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBALlC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;AACP,wBAAA,WAAW,CAAC,UAAU,CAAC,8BAA8B,EAAE,qBAAqB,CAAC;AAC9E,qBAAA;AACF,iBAAA;;;ACbD;;AAEG;;;;"}
@@ -20,10 +20,10 @@ class DaffPaymentResponseFactory extends DaffModelFactory {
20
20
  constructor() {
21
21
  super(MockPaymentResponse);
22
22
  }
23
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPaymentResponseFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
24
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPaymentResponseFactory, providedIn: 'root' }); }
23
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffPaymentResponseFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
24
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffPaymentResponseFactory, providedIn: 'root' }); }
25
25
  }
26
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPaymentResponseFactory, decorators: [{
26
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffPaymentResponseFactory, decorators: [{
27
27
  type: Injectable,
28
28
  args: [{
29
29
  providedIn: 'root',
@@ -46,10 +46,10 @@ class DaffPaymentRequestFactory extends DaffModelFactory {
46
46
  constructor() {
47
47
  super(MockPaymentRequest);
48
48
  }
49
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPaymentRequestFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
50
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPaymentRequestFactory, providedIn: 'root' }); }
49
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffPaymentRequestFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
50
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffPaymentRequestFactory, providedIn: 'root' }); }
51
51
  }
52
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPaymentRequestFactory, decorators: [{
52
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffPaymentRequestFactory, decorators: [{
53
53
  type: Injectable,
54
54
  args: [{
55
55
  providedIn: 'root',
@@ -101,10 +101,10 @@ class DaffPaymentResponseKindFactory extends DaffModelFactory {
101
101
  create(partial = {}) {
102
102
  return this._randomFactory.create(partial);
103
103
  }
104
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPaymentResponseKindFactory, deps: [{ token: DAFF_PAYMENT_RESPONSE_KIND_FACTORIES }], target: i0.ɵɵFactoryTarget.Injectable }); }
105
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPaymentResponseKindFactory, providedIn: 'root' }); }
104
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffPaymentResponseKindFactory, deps: [{ token: DAFF_PAYMENT_RESPONSE_KIND_FACTORIES }], target: i0.ɵɵFactoryTarget.Injectable }); }
105
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffPaymentResponseKindFactory, providedIn: 'root' }); }
106
106
  }
107
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPaymentResponseKindFactory, decorators: [{
107
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffPaymentResponseKindFactory, decorators: [{
108
108
  type: Injectable,
109
109
  args: [{
110
110
  providedIn: 'root',
@@ -118,13 +118,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
118
118
  * Provides the default payment result factory as a payment result type factory.
119
119
  */
120
120
  class DaffPaymentTestingModule {
121
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPaymentTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
122
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.1", ngImport: i0, type: DaffPaymentTestingModule }); }
123
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPaymentTestingModule, providers: [
121
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffPaymentTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
122
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.18", ngImport: i0, type: DaffPaymentTestingModule }); }
123
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffPaymentTestingModule, providers: [
124
124
  provideDaffPaymentResponseKindFactories(DaffPaymentResponseFactory),
125
125
  ] }); }
126
126
  }
127
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPaymentTestingModule, decorators: [{
127
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffPaymentTestingModule, decorators: [{
128
128
  type: NgModule,
129
129
  args: [{
130
130
  providers: [
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-payment-testing.mjs","sources":["../../../libs/payment/testing/src/factories/payment-response.factory.ts","../../../libs/payment/testing/src/factories/payment-request.factory.ts","../../../libs/payment/testing/src/injection-tokens/factories/kind.token.ts","../../../libs/payment/testing/src/factories/kind.factory.ts","../../../libs/payment/testing/src/testing.module.ts","../../../libs/payment/testing/src/daffodil-payment-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffPaymentResponse } from '@daffodil/payment';\n\n/**\n * Mock class for {@link DaffPaymentResponse}.\n */\nexport class MockPaymentResponse implements DaffPaymentResponse {\n method = faker.lorem.word();\n};\n\n/**\n * Model factory for {@link DaffPaymentResponse}.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffPaymentResponseFactory extends DaffModelFactory<DaffPaymentResponse, typeof MockPaymentResponse>{\n constructor() {\n super(MockPaymentResponse);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffPaymentRequest } from '@daffodil/payment';\n\n/**\n * Mock class for {@link DaffPaymentRequest}.\n */\nexport class MockPaymentRequest implements DaffPaymentRequest {\n kind = faker.lorem.word();\n};\n\n/**\n * Model factory for {@link DaffPaymentRequest}.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffPaymentRequestFactory extends DaffModelFactory<DaffPaymentRequest>{\n constructor() {\n super(MockPaymentRequest);\n }\n}\n","import { inject } from '@angular/core';\n\nimport { createServicesInjectionToken } from '@daffodil/core';\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffPaymentResponse } from '@daffodil/payment';\n\nimport { DaffPaymentResponseFactory } from '../../factories/payment-response.factory';\n\nexport const {\n /**\n * A multi-provider injection token for providing extra payment result kind factories.\n * These factories correspond to different types of payment results that may be added by other packages.\n * This is useful for backend mocks (such as the testing driver) to generate an accurate representation\n * of the variety of results that an application can receive in production.\n */\n token: DAFF_PAYMENT_RESPONSE_KIND_FACTORIES,\n\n /**\n * Provides extra payment result factory kinds.\n *\n * See {@link DAFF_PAYMENT_RESPONSE_KIND_FACTORIES}.\n *\n * @example\n * ```ts\n * providers: [\n * ...provideDaffPaymentResponseKindFactories(\n * MyPaymentResponseFactory\n * )\n * ]\n * ```\n */\n provider: provideDaffPaymentResponseKindFactories,\n} = createServicesInjectionToken<DaffModelFactory<DaffPaymentResponse>>(\n 'DAFF_PAYMENT_RESPONSE_KIND_FACTORIES',\n {\n factory: () => [inject(DaffPaymentResponseFactory)],\n providedIn: 'root',\n },\n);\n","import {\n Injectable,\n Inject,\n} from '@angular/core';\n\nimport { sample } from '@daffodil/core';\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffPaymentResponse } from '@daffodil/payment';\n\nimport { MockPaymentResponse } from './payment-response.factory';\nimport { DAFF_PAYMENT_RESPONSE_KIND_FACTORIES } from '../injection-tokens/factories/kind.token';\n\n/**\n * Factory for creating DaffPaymentResponses.\n * This will create a payment response of random kind.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffPaymentResponseKindFactory extends DaffModelFactory<DaffPaymentResponse> {\n constructor(\n @Inject(DAFF_PAYMENT_RESPONSE_KIND_FACTORIES) private kindFactories: DaffModelFactory<DaffPaymentResponse>[],\n ) {\n super(MockPaymentResponse);\n }\n\n private get _randomFactory(): DaffModelFactory<DaffPaymentResponse> {\n return sample(this.kindFactories);\n }\n\n /**\n * Creates a payment result of random kind.\n */\n create(partial = {}): DaffPaymentResponse {\n return this._randomFactory.create(partial);\n }\n}\n","import { NgModule } from '@angular/core';\n\nimport { DaffPaymentResponseFactory } from './factories/public_api';\nimport { provideDaffPaymentResponseKindFactories } from './injection-tokens/public_api';\n\n/**\n * Provides the default payment result factory as a payment result type factory.\n */\n@NgModule({\n providers: [\n provideDaffPaymentResponseKindFactories(DaffPaymentResponseFactory),\n ],\n})\nexport class DaffPaymentTestingModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAMA;;AAEG;MACU,mBAAmB,CAAA;AAAhC,IAAA,WAAA,GAAA;AACE,QAAA,IAAA,CAAA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AA;kBAH1C,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;0BAGI,MAAM;2BAAC,oCAAoC;;;AChBhD;;AAEG;MAMU,wBAAwB,CAAA;iIAAxB,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;kIAAxB,wBAAwB,EAAA,CAAA,CAAA;AAAxB,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,wBAAwB,EAAA,SAAA,EAJxB;YACT,uCAAuC,CAAC,0BAA0B,CAAC;AACpE,SAAA,EAAA,CAAA,CAAA;;2FAEU,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBALpC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,SAAS,EAAE;wBACT,uCAAuC,CAAC,0BAA0B,CAAC;AACpE,qBAAA;AACF,iBAAA;;;ACZD;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-payment-testing.mjs","sources":["../../../libs/payment/testing/src/factories/payment-response.factory.ts","../../../libs/payment/testing/src/factories/payment-request.factory.ts","../../../libs/payment/testing/src/injection-tokens/factories/kind.token.ts","../../../libs/payment/testing/src/factories/kind.factory.ts","../../../libs/payment/testing/src/testing.module.ts","../../../libs/payment/testing/src/daffodil-payment-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffPaymentResponse } from '@daffodil/payment';\n\n/**\n * Mock class for {@link DaffPaymentResponse}.\n */\nexport class MockPaymentResponse implements DaffPaymentResponse {\n method = faker.lorem.word();\n};\n\n/**\n * Model factory for {@link DaffPaymentResponse}.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffPaymentResponseFactory extends DaffModelFactory<DaffPaymentResponse, typeof MockPaymentResponse>{\n constructor() {\n super(MockPaymentResponse);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffPaymentRequest } from '@daffodil/payment';\n\n/**\n * Mock class for {@link DaffPaymentRequest}.\n */\nexport class MockPaymentRequest implements DaffPaymentRequest {\n kind = faker.lorem.word();\n};\n\n/**\n * Model factory for {@link DaffPaymentRequest}.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffPaymentRequestFactory extends DaffModelFactory<DaffPaymentRequest>{\n constructor() {\n super(MockPaymentRequest);\n }\n}\n","import { inject } from '@angular/core';\n\nimport { createServicesInjectionToken } from '@daffodil/core';\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffPaymentResponse } from '@daffodil/payment';\n\nimport { DaffPaymentResponseFactory } from '../../factories/payment-response.factory';\n\nexport const {\n /**\n * A multi-provider injection token for providing extra payment result kind factories.\n * These factories correspond to different types of payment results that may be added by other packages.\n * This is useful for backend mocks (such as the testing driver) to generate an accurate representation\n * of the variety of results that an application can receive in production.\n */\n token: DAFF_PAYMENT_RESPONSE_KIND_FACTORIES,\n\n /**\n * Provides extra payment result factory kinds.\n *\n * See {@link DAFF_PAYMENT_RESPONSE_KIND_FACTORIES}.\n *\n * @example\n * ```ts\n * providers: [\n * ...provideDaffPaymentResponseKindFactories(\n * MyPaymentResponseFactory\n * )\n * ]\n * ```\n */\n provider: provideDaffPaymentResponseKindFactories,\n} = createServicesInjectionToken<DaffModelFactory<DaffPaymentResponse>>(\n 'DAFF_PAYMENT_RESPONSE_KIND_FACTORIES',\n {\n factory: () => [inject(DaffPaymentResponseFactory)],\n providedIn: 'root',\n },\n);\n","import {\n Injectable,\n Inject,\n} from '@angular/core';\n\nimport { sample } from '@daffodil/core';\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffPaymentResponse } from '@daffodil/payment';\n\nimport { MockPaymentResponse } from './payment-response.factory';\nimport { DAFF_PAYMENT_RESPONSE_KIND_FACTORIES } from '../injection-tokens/factories/kind.token';\n\n/**\n * Factory for creating DaffPaymentResponses.\n * This will create a payment response of random kind.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffPaymentResponseKindFactory extends DaffModelFactory<DaffPaymentResponse> {\n constructor(\n @Inject(DAFF_PAYMENT_RESPONSE_KIND_FACTORIES) private kindFactories: DaffModelFactory<DaffPaymentResponse>[],\n ) {\n super(MockPaymentResponse);\n }\n\n private get _randomFactory(): DaffModelFactory<DaffPaymentResponse> {\n return sample(this.kindFactories);\n }\n\n /**\n * Creates a payment result of random kind.\n */\n create(partial = {}): DaffPaymentResponse {\n return this._randomFactory.create(partial);\n }\n}\n","import { NgModule } from '@angular/core';\n\nimport { DaffPaymentResponseFactory } from './factories/public_api';\nimport { provideDaffPaymentResponseKindFactories } from './injection-tokens/public_api';\n\n/**\n * Provides the default payment result factory as a payment result type factory.\n */\n@NgModule({\n providers: [\n provideDaffPaymentResponseKindFactories(DaffPaymentResponseFactory),\n ],\n})\nexport class DaffPaymentTestingModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAMA;;AAEG;MACU,mBAAmB,CAAA;AAAhC,IAAA,WAAA,GAAA;AACE,QAAA,IAAA,CAAA,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE;IAC7B;AAAC;AAAA;AAED;;AAEG;AAIG,MAAO,0BAA2B,SAAQ,gBAAiE,CAAA;AAC/G,IAAA,WAAA,GAAA;QACE,KAAK,CAAC,mBAAmB,CAAC;IAC5B;kIAHW,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA1B,uBAAA,SAAA,IA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SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,wBAAwB,EAAA,SAAA,EAJxB;YACT,uCAAuC,CAAC,0BAA0B,CAAC;AACpE,SAAA,EAAA,CAAA,CAAA;;4FAEU,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBALpC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,SAAS,EAAE;wBACT,uCAAuC,CAAC,0BAA0B,CAAC;AACpE,qBAAA;AACF,iBAAA;;;ACZD;;AAEG;;;;"}
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@daffodil/payment","nx":{"targets":{"build":{"outputs":["{workspaceRoot}/dist/payment"]}}},"version":"0.91.0","description":"A client-side Angular package for managing ecommerce payments agnostic to the ecommerce platform.","repository":{"type":"git","url":"https://github.com/graycoreio/daffodil"},"author":"Graycore LLC","license":"MIT","bugs":{"url":"https://github.com/graycoreio/daffodil/issues"},"homepage":"https://github.com/graycoreio/daffodil","peerDependencies":{"@angular/common":"^20.0.0","@angular/core":"^20.0.0","@daffodil/core":"0.91.0","@ngrx/effects":"^20.0.0","@ngrx/store":"^20.0.0","rxjs":"^7.0.0"},"optionalDependencies":{"@apollo/client":"^3.12.6","@daffodil/driver":"0.91.0","apollo-angular":"^11.0.0","@faker-js/faker":"^9.8.0"},"module":"fesm2022/daffodil-payment.mjs","typings":"index.d.ts","exports":{"./package.json":{"default":"./package.json"},".":{"types":"./index.d.ts","default":"./fesm2022/daffodil-payment.mjs"},"./driver":{"types":"./driver/index.d.ts","default":"./fesm2022/daffodil-payment-driver.mjs"},"./state":{"types":"./state/index.d.ts","default":"./fesm2022/daffodil-payment-state.mjs"},"./testing":{"types":"./testing/index.d.ts","default":"./fesm2022/daffodil-payment-testing.mjs"},"./driver/in-memory":{"types":"./driver/in-memory/index.d.ts","default":"./fesm2022/daffodil-payment-driver-in-memory.mjs"},"./driver/testing":{"types":"./driver/testing/index.d.ts","default":"./fesm2022/daffodil-payment-driver-testing.mjs"},"./state/testing":{"types":"./state/testing/index.d.ts","default":"./fesm2022/daffodil-payment-state-testing.mjs"}},"sideEffects":false,"dependencies":{"tslib":"^2.6.2"}}
1
+ {"name":"@daffodil/payment","nx":{"targets":{"build":{"outputs":["{workspaceRoot}/dist/payment"]}}},"version":"0.92.3-rc.1","description":"Platform-agnostic models, state management, and drivers for ecommerce payment processing. Part of the Daffodil ecommerce framework.","repository":{"type":"git","url":"https://github.com/graycoreio/daffodil"},"author":"Graycore LLC","license":"MIT","bugs":{"url":"https://github.com/graycoreio/daffodil/issues"},"homepage":"https://github.com/graycoreio/daffodil","peerDependencies":{"@angular/common":"^20.0.0","@angular/core":"^20.0.0","@daffodil/core":"0.92.3-rc.1","@ngrx/effects":"^20.0.0","@ngrx/store":"^20.0.0","rxjs":"^7.0.0"},"optionalDependencies":{"@apollo/client":"^3.12.6","@daffodil/driver":"0.92.3-rc.1","apollo-angular":"^11.0.0","@faker-js/faker":"^10.3.0"},"module":"fesm2022/daffodil-payment.mjs","typings":"index.d.ts","exports":{"./package.json":{"default":"./package.json"},".":{"types":"./index.d.ts","default":"./fesm2022/daffodil-payment.mjs"},"./driver":{"types":"./driver/index.d.ts","default":"./fesm2022/daffodil-payment-driver.mjs"},"./state":{"types":"./state/index.d.ts","default":"./fesm2022/daffodil-payment-state.mjs"},"./testing":{"types":"./testing/index.d.ts","default":"./fesm2022/daffodil-payment-testing.mjs"},"./driver/in-memory":{"types":"./driver/in-memory/index.d.ts","default":"./fesm2022/daffodil-payment-driver-in-memory.mjs"},"./driver/testing":{"types":"./driver/testing/index.d.ts","default":"./fesm2022/daffodil-payment-driver-testing.mjs"},"./state/testing":{"types":"./state/testing/index.d.ts","default":"./fesm2022/daffodil-payment-state-testing.mjs"}},"sideEffects":false,"dependencies":{"tslib":"^2.6.2"}}