@daffodil/driver 0.83.0 → 0.85.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/daffodil-driver-hubspot-testing.mjs +7 -7
- package/fesm2022/daffodil-driver-hubspot-testing.mjs.map +1 -1
- package/fesm2022/daffodil-driver-in-memory.mjs +8 -8
- package/fesm2022/daffodil-driver-in-memory.mjs.map +1 -1
- package/fesm2022/daffodil-driver-magento-testing.mjs +13 -13
- package/fesm2022/daffodil-driver-magento-testing.mjs.map +1 -1
- package/fesm2022/daffodil-driver-magento.mjs +14 -14
- package/fesm2022/daffodil-driver-magento.mjs.map +1 -1
- package/fesm2022/daffodil-driver-shopify-testing.mjs +22 -22
- package/fesm2022/daffodil-driver-shopify-testing.mjs.map +1 -1
- package/fesm2022/daffodil-driver-shopify.mjs +9 -9
- package/fesm2022/daffodil-driver-shopify.mjs.map +1 -1
- package/fesm2022/daffodil-driver.mjs +3 -3
- package/fesm2022/daffodil-driver.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -4,14 +4,14 @@ import { faker } from '@faker-js/faker';
|
|
|
4
4
|
import { DaffModelFactory } from '@daffodil/core/testing';
|
|
5
5
|
|
|
6
6
|
const MockHubspotError = () => ({
|
|
7
|
-
message: faker.
|
|
8
|
-
errorType: faker.
|
|
7
|
+
message: faker.lorem.words(5),
|
|
8
|
+
errorType: faker.lorem.word(),
|
|
9
9
|
});
|
|
10
10
|
class MockHubspotResponse {
|
|
11
11
|
constructor() {
|
|
12
12
|
this.redirectUri = faker.internet.url();
|
|
13
|
-
this.inlineMessage = faker.
|
|
14
|
-
this.errors = Array(faker.
|
|
13
|
+
this.inlineMessage = faker.lorem.words(5);
|
|
14
|
+
this.errors = Array(faker.number.int({ min: 1, max: 5 })).fill(MockHubspotError);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
@@ -23,10 +23,10 @@ class DaffHubspotResponseFactory extends DaffModelFactory {
|
|
|
23
23
|
constructor() {
|
|
24
24
|
super(MockHubspotResponse);
|
|
25
25
|
}
|
|
26
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
27
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
|
26
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffHubspotResponseFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
27
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffHubspotResponseFactory, providedIn: 'root' }); }
|
|
28
28
|
}
|
|
29
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
29
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffHubspotResponseFactory, decorators: [{
|
|
30
30
|
type: Injectable,
|
|
31
31
|
args: [{
|
|
32
32
|
providedIn: 'root',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-driver-hubspot-testing.mjs","sources":["../../../libs/driver/hubspot/testing/src/factories/hubspot-response.factory.ts","../../../libs/driver/hubspot/testing/src/daffodil-driver-hubspot-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport {\n HubspotError,\n HubspotResponse,\n} from '@daffodil/driver/hubspot';\n\nconst MockHubspotError = (): HubspotError => ({\n message: faker.
|
|
1
|
+
{"version":3,"file":"daffodil-driver-hubspot-testing.mjs","sources":["../../../libs/driver/hubspot/testing/src/factories/hubspot-response.factory.ts","../../../libs/driver/hubspot/testing/src/daffodil-driver-hubspot-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport {\n HubspotError,\n HubspotResponse,\n} from '@daffodil/driver/hubspot';\n\nconst MockHubspotError = (): HubspotError => ({\n message: faker.lorem.words(5),\n errorType: faker.lorem.word(),\n});\n\nexport class MockHubspotResponse implements HubspotResponse {\n redirectUri? = faker.internet.url();\n inlineMessage = faker.lorem.words(5);\n errors: HubspotError[] = Array(faker.number.int({ min: 1, max: 5 })).fill(MockHubspotError);\n}\n\n/**\n * Model factory for {@link MockHubspotResponse}s.\n *\n * Should be used to create {@link MockHubspotResponse}s for testing purposes.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffHubspotResponseFactory extends DaffModelFactory<HubspotResponse>{\n constructor() {\n super(MockHubspotResponse);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AASA,MAAM,gBAAgB,GAAG,OAAqB;IAC5C,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AAC7B,IAAA,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE;AAC9B,CAAA,CAAC;MAEW,mBAAmB,CAAA;AAAhC,IAAA,WAAA,GAAA;AACE,QAAA,IAAA,CAAA,WAAW,GAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE;QACnC,IAAa,CAAA,aAAA,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;QACpC,IAAM,CAAA,MAAA,GAAmB,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC;;AAC5F;AAED;;;;AAIG;AAIG,MAAO,0BAA2B,SAAQ,gBAAiC,CAAA;AAC/E,IAAA,WAAA,GAAA;QACE,KAAK,CAAC,mBAAmB,CAAC;;+GAFjB,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA1B,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,0BAA0B,cAFzB,MAAM,EAAA,CAAA,CAAA;;4FAEP,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAHtC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;AC3BD;;AAEG;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createServicesInjectionToken, observe, createConfigInjectionToken } from '@daffodil/core';
|
|
2
2
|
import { STATUS, HttpClientInMemoryWebApiModule } from 'angular-in-memory-web-api';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import {
|
|
4
|
+
import { Inject, Injectable, importProvidersFrom, NgModule } from '@angular/core';
|
|
5
5
|
import { combineLatest, take, map } from 'rxjs';
|
|
6
6
|
|
|
7
7
|
const {
|
|
@@ -72,10 +72,10 @@ class DaffInMemoryRootBackend extends DaffInMemoryBackendDelegate {
|
|
|
72
72
|
...backend.createDb(reqInfo),
|
|
73
73
|
}), {})));
|
|
74
74
|
}
|
|
75
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
76
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
|
75
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffInMemoryRootBackend, deps: [{ token: DAFF_IN_MEMORY_BACKENDS }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
76
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffInMemoryRootBackend, providedIn: 'root' }); }
|
|
77
77
|
}
|
|
78
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
78
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffInMemoryRootBackend, decorators: [{
|
|
79
79
|
type: Injectable,
|
|
80
80
|
args: [{
|
|
81
81
|
providedIn: 'root',
|
|
@@ -123,11 +123,11 @@ class DaffInMemoryDriverModule {
|
|
|
123
123
|
],
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
127
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.
|
|
128
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.
|
|
126
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffInMemoryDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
127
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.11", ngImport: i0, type: DaffInMemoryDriverModule }); }
|
|
128
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffInMemoryDriverModule }); }
|
|
129
129
|
}
|
|
130
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
130
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffInMemoryDriverModule, decorators: [{
|
|
131
131
|
type: NgModule
|
|
132
132
|
}] });
|
|
133
133
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-driver-in-memory.mjs","sources":["../../../libs/driver/in-memory/src/backend/backends.token.ts","../../../libs/driver/in-memory/src/backend/delegate.class.ts","../../../libs/driver/in-memory/src/backend/root.service.ts","../../../libs/driver/in-memory/src/driver/base.class.ts","../../../libs/driver/in-memory/src/config/default.ts","../../../libs/driver/in-memory/src/config/token.ts","../../../libs/driver/in-memory/src/module.ts","../../../libs/driver/in-memory/src/daffodil-driver-in-memory.ts"],"sourcesContent":["import { createServicesInjectionToken } from '@daffodil/core';\n\nimport { DaffInMemoryBackendInterface } from './type';\n\nexport const {\n /**\n * A token that holds the currently loaded in-memory backends.\n */\n token: DAFF_IN_MEMORY_BACKENDS,\n /**\n * Provide backend classes to {@link DAFF_IN_MEMORY_BACKENDS}.\n */\n provider: provideDaffInMemoryBackends,\n} = createServicesInjectionToken<DaffInMemoryBackendInterface>('DAFF_IN_MEMORY_BACKENDS');\n","import {\n RequestInfo,\n STATUS,\n} from 'angular-in-memory-web-api';\nimport { Observable } from 'rxjs';\n\nimport { DaffInMemoryDataServiceInterface } from './data-service.type';\nimport { DaffInMemoryRouteableBackend } from './routeable.type';\n\nenum Method {\n GET = 'get',\n POST = 'post',\n PUT = 'put',\n DELETE = 'delete',\n}\n\n/**\n * An class that automatically delegates requests to in-memory backends.\n *\n * @inheritdoc\n */\nexport class DaffInMemoryBackendDelegate implements DaffInMemoryDataServiceInterface {\n constructor(\n protected backends: Array<DaffInMemoryRouteableBackend>,\n ) {}\n\n protected delegateRequest(reqInfo: RequestInfo, method: Method): Observable<any> {\n const backend = this.backends.find((b) => 'collectionName' in b ? b.collectionName === reqInfo.collectionName : b.canHandle(reqInfo.collectionName));\n const request = backend?.[method];\n return request\n // allow child backends to return nully values\n // which will fall back to default request behavior (https://github.com/angular/angular/tree/main/packages/misc/angular-in-memory-web-api#http-request-handling)\n ? request.call(backend, reqInfo)\n : reqInfo.utils.createResponse$(() => ({\n status: STATUS.NOT_FOUND,\n statusText: `Backend ${reqInfo.collectionName} not found or does not support the ${method} request method`,\n }));\n }\n\n get?(reqInfo: RequestInfo): Observable<any> {\n return this.delegateRequest(reqInfo, Method.GET);\n }\n\n post?(reqInfo: RequestInfo): Observable<any> {\n return this.delegateRequest(reqInfo, Method.POST);\n }\n\n put?(reqInfo: RequestInfo): Observable<any> {\n return this.delegateRequest(reqInfo, Method.PUT);\n }\n\n delete?(reqInfo: RequestInfo): Observable<any> {\n return this.delegateRequest(reqInfo, Method.DELETE);\n }\n}\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\nimport {\n InMemoryDbService,\n RequestInfo,\n} from 'angular-in-memory-web-api';\nimport {\n combineLatest,\n map,\n take,\n} from 'rxjs';\n\nimport { observe } from '@daffodil/core';\n\nimport { DAFF_IN_MEMORY_BACKENDS } from './backends.token';\nimport { DaffInMemoryDataServiceInterface } from './data-service.type';\nimport { DaffInMemoryBackendDelegate } from './delegate.class';\nimport { DaffInMemoryBackendInterface } from './type';\n\n/**\n * An in-memory backend that automatically delegates requests to backends provided to {@link DAFF_IN_MEMORY_BACKENDS}.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryRootBackend extends DaffInMemoryBackendDelegate implements DaffInMemoryDataServiceInterface, InMemoryDbService {\n constructor(\n @Inject(DAFF_IN_MEMORY_BACKENDS) private _backends: Array<DaffInMemoryBackendInterface>,\n ) {\n super(_backends);\n }\n\n createDb(reqInfo?: RequestInfo) {\n return combineLatest(this._backends.map(observe)).pipe(\n take(1),\n map((backends) => backends.reduce((db, backend) => ({\n ...db,\n ...backend.createDb(reqInfo),\n }), {})),\n );\n }\n}\n","import { InMemoryBackendConfigArgs } from 'angular-in-memory-web-api';\n\n/**\n * The base class for in-memory drivers.\n */\nexport abstract class DaffInMemoryDriverBase {\n /**\n * The URL of the corresponding backend.\n * Does not include a trailing slash, it is of the form: `/<api base>/<collection name>`.\n */\n protected readonly url = `/${this.config.apiBase}/${this.collectionName}`;\n\n constructor(\n private config: InMemoryBackendConfigArgs,\n private collectionName: string,\n ) {}\n}\n","import { DaffInMemoryDriverConfig } from './type';\n\nexport const DAFF_IN_MEMORY_DRIVER_CONFIG_DEFAULT: DaffInMemoryDriverConfig = {\n apiBase: 'api',\n};\n","import { createConfigInjectionToken } from '@daffodil/core';\n\nimport { DAFF_IN_MEMORY_DRIVER_CONFIG_DEFAULT } from './default';\nimport { DaffInMemoryDriverConfig } from './type';\n\nexport const {\n token: DAFF_IN_MEMORY_DRIVER_CONFIG,\n /**\n * Provider function for {@link DAFF_IN_MEMORY_DRIVER_CONFIG}.\n */\n provider: provideDaffInMemoryDriverConfig,\n} = createConfigInjectionToken<DaffInMemoryDriverConfig>(DAFF_IN_MEMORY_DRIVER_CONFIG_DEFAULT, 'DAFF_IN_MEMORY_DRIVER_CONFIG');\n","import {\n NgModule,\n ModuleWithProviders,\n importProvidersFrom,\n} from '@angular/core';\nimport { HttpClientInMemoryWebApiModule } from 'angular-in-memory-web-api';\n\nimport { DaffInMemoryRootBackend } from './backend/public_api';\nimport {\n DAFF_IN_MEMORY_DRIVER_CONFIG_DEFAULT,\n DaffInMemoryDriverConfig,\n provideDaffInMemoryDriverConfig,\n} from './config/public_api';\n\n/**\n * Sets up the angular in memory web API with the {@link DaffInMemoryRootBackend}.\n */\n@NgModule()\nexport class DaffInMemoryDriverModule {\n static forRoot(config: DaffInMemoryDriverConfig = DAFF_IN_MEMORY_DRIVER_CONFIG_DEFAULT): ModuleWithProviders<DaffInMemoryDriverModule> {\n return {\n ngModule: DaffInMemoryDriverModule,\n providers: [\n importProvidersFrom(HttpClientInMemoryWebApiModule.forRoot(DaffInMemoryRootBackend, config)),\n provideDaffInMemoryDriverConfig(config),\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAIa,MAAA;AACX;;AAEG;AACH,KAAK,EAAE,uBAAuB;AAC9B;;AAEG;AACH,QAAQ,EAAE,2BAA2B,GACtC,GAAG,4BAA4B,CAA+B,yBAAyB;;ACJxF,IAAK,M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GAAG,CAAE,OAAoB,EAAA;QACvB,OAAO,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC;;AAGlD,IAAA,MAAM,CAAE,OAAoB,EAAA;QAC1B,OAAO,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC;;AAEtD;;ACjCD;;;;AAIG;AAIG,MAAO,uBAAwB,SAAQ,2BAA2B,CAAA;AACtE,IAAA,WAAA,CAC2C,SAA8C,EAAA;QAEvF,KAAK,CAAC,SAAS,CAAC;QAFyB,IAAS,CAAA,SAAA,GAAT,SAAS;;AAKpD,IAAA,QAAQ,CAAC,OAAqB,EAAA;AAC5B,QAAA,OAAO,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CACpD,IAAI,CAAC,CAAC,CAAC,EACP,GAAG,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,OAAO,MAAM;AAClD,YAAA,GAAG,EAAE;AACL,YAAA,GAAG,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;AAC7B,SAAA,CAAC,EAAE,EAAE,CAAC,CAAC,CACT;;AAdQ,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,
|
|
1
|
+
{"version":3,"file":"daffodil-driver-in-memory.mjs","sources":["../../../libs/driver/in-memory/src/backend/backends.token.ts","../../../libs/driver/in-memory/src/backend/delegate.class.ts","../../../libs/driver/in-memory/src/backend/root.service.ts","../../../libs/driver/in-memory/src/driver/base.class.ts","../../../libs/driver/in-memory/src/config/default.ts","../../../libs/driver/in-memory/src/config/token.ts","../../../libs/driver/in-memory/src/module.ts","../../../libs/driver/in-memory/src/daffodil-driver-in-memory.ts"],"sourcesContent":["import { createServicesInjectionToken } from '@daffodil/core';\n\nimport { DaffInMemoryBackendInterface } from './type';\n\nexport const {\n /**\n * A token that holds the currently loaded in-memory backends.\n */\n token: DAFF_IN_MEMORY_BACKENDS,\n /**\n * Provide backend classes to {@link DAFF_IN_MEMORY_BACKENDS}.\n */\n provider: provideDaffInMemoryBackends,\n} = createServicesInjectionToken<DaffInMemoryBackendInterface>('DAFF_IN_MEMORY_BACKENDS');\n","import {\n RequestInfo,\n STATUS,\n} from 'angular-in-memory-web-api';\nimport { Observable } from 'rxjs';\n\nimport { DaffInMemoryDataServiceInterface } from './data-service.type';\nimport { DaffInMemoryRouteableBackend } from './routeable.type';\n\nenum Method {\n GET = 'get',\n POST = 'post',\n PUT = 'put',\n DELETE = 'delete',\n}\n\n/**\n * An class that automatically delegates requests to in-memory backends.\n *\n * @inheritdoc\n */\nexport class DaffInMemoryBackendDelegate implements DaffInMemoryDataServiceInterface {\n constructor(\n protected backends: Array<DaffInMemoryRouteableBackend>,\n ) {}\n\n protected delegateRequest(reqInfo: RequestInfo, method: Method): Observable<any> {\n const backend = this.backends.find((b) => 'collectionName' in b ? b.collectionName === reqInfo.collectionName : b.canHandle(reqInfo.collectionName));\n const request = backend?.[method];\n return request\n // allow child backends to return nully values\n // which will fall back to default request behavior (https://github.com/angular/angular/tree/main/packages/misc/angular-in-memory-web-api#http-request-handling)\n ? request.call(backend, reqInfo)\n : reqInfo.utils.createResponse$(() => ({\n status: STATUS.NOT_FOUND,\n statusText: `Backend ${reqInfo.collectionName} not found or does not support the ${method} request method`,\n }));\n }\n\n get?(reqInfo: RequestInfo): Observable<any> {\n return this.delegateRequest(reqInfo, Method.GET);\n }\n\n post?(reqInfo: RequestInfo): Observable<any> {\n return this.delegateRequest(reqInfo, Method.POST);\n }\n\n put?(reqInfo: RequestInfo): Observable<any> {\n return this.delegateRequest(reqInfo, Method.PUT);\n }\n\n delete?(reqInfo: RequestInfo): Observable<any> {\n return this.delegateRequest(reqInfo, Method.DELETE);\n }\n}\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\nimport {\n InMemoryDbService,\n RequestInfo,\n} from 'angular-in-memory-web-api';\nimport {\n combineLatest,\n map,\n take,\n} from 'rxjs';\n\nimport { observe } from '@daffodil/core';\n\nimport { DAFF_IN_MEMORY_BACKENDS } from './backends.token';\nimport { DaffInMemoryDataServiceInterface } from './data-service.type';\nimport { DaffInMemoryBackendDelegate } from './delegate.class';\nimport { DaffInMemoryBackendInterface } from './type';\n\n/**\n * An in-memory backend that automatically delegates requests to backends provided to {@link DAFF_IN_MEMORY_BACKENDS}.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryRootBackend extends DaffInMemoryBackendDelegate implements DaffInMemoryDataServiceInterface, InMemoryDbService {\n constructor(\n @Inject(DAFF_IN_MEMORY_BACKENDS) private _backends: Array<DaffInMemoryBackendInterface>,\n ) {\n super(_backends);\n }\n\n createDb(reqInfo?: RequestInfo) {\n return combineLatest(this._backends.map(observe)).pipe(\n take(1),\n map((backends) => backends.reduce((db, backend) => ({\n ...db,\n ...backend.createDb(reqInfo),\n }), {})),\n );\n }\n}\n","import { InMemoryBackendConfigArgs } from 'angular-in-memory-web-api';\n\n/**\n * The base class for in-memory drivers.\n */\nexport abstract class DaffInMemoryDriverBase {\n /**\n * The URL of the corresponding backend.\n * Does not include a trailing slash, it is of the form: `/<api base>/<collection name>`.\n */\n protected readonly url = `/${this.config.apiBase}/${this.collectionName}`;\n\n constructor(\n private config: InMemoryBackendConfigArgs,\n private collectionName: string,\n ) {}\n}\n","import { DaffInMemoryDriverConfig } from './type';\n\nexport const DAFF_IN_MEMORY_DRIVER_CONFIG_DEFAULT: DaffInMemoryDriverConfig = {\n apiBase: 'api',\n};\n","import { createConfigInjectionToken } from '@daffodil/core';\n\nimport { DAFF_IN_MEMORY_DRIVER_CONFIG_DEFAULT } from './default';\nimport { DaffInMemoryDriverConfig } from './type';\n\nexport const {\n token: DAFF_IN_MEMORY_DRIVER_CONFIG,\n /**\n * Provider function for {@link DAFF_IN_MEMORY_DRIVER_CONFIG}.\n */\n provider: provideDaffInMemoryDriverConfig,\n} = createConfigInjectionToken<DaffInMemoryDriverConfig>(DAFF_IN_MEMORY_DRIVER_CONFIG_DEFAULT, 'DAFF_IN_MEMORY_DRIVER_CONFIG');\n","import {\n NgModule,\n ModuleWithProviders,\n importProvidersFrom,\n} from '@angular/core';\nimport { HttpClientInMemoryWebApiModule } from 'angular-in-memory-web-api';\n\nimport { DaffInMemoryRootBackend } from './backend/public_api';\nimport {\n DAFF_IN_MEMORY_DRIVER_CONFIG_DEFAULT,\n DaffInMemoryDriverConfig,\n provideDaffInMemoryDriverConfig,\n} from './config/public_api';\n\n/**\n * Sets up the angular in memory web API with the {@link DaffInMemoryRootBackend}.\n */\n@NgModule()\nexport class DaffInMemoryDriverModule {\n static forRoot(config: DaffInMemoryDriverConfig = DAFF_IN_MEMORY_DRIVER_CONFIG_DEFAULT): ModuleWithProviders<DaffInMemoryDriverModule> {\n return {\n ngModule: DaffInMemoryDriverModule,\n providers: [\n importProvidersFrom(HttpClientInMemoryWebApiModule.forRoot(DaffInMemoryRootBackend, config)),\n provideDaffInMemoryDriverConfig(config),\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAIa,MAAA;AACX;;AAEG;AACH,KAAK,EAAE,uBAAuB;AAC9B;;AAEG;AACH,QAAQ,EAAE,2BAA2B,GACtC,GAAG,4BAA4B,CAA+B,yBAAyB;;ACJxF,IAAK,MAKJ;AALD,CAAA,UAAK,MAAM,EAAA;AACT,IAAA,MAAA,CAAA,KAAA,CAAA,GAAA,KAAW;AACX,IAAA,MAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,MAAA,CAAA,KAAA,CAAA,GAAA,KAAW;AACX,IAAA,MAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACnB,CAAC,EALI,MAAM,KAAN,MAAM,GAKV,EAAA,CAAA,CAAA;AAED;;;;AA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A,cAAA,GAAd,cAAc;AARxB;;;AAGG;AACgB,QAAA,IAAA,CAAA,GAAG,GAAG,CAAA,CAAA,EAAI,IAAI,CAAC,MAAM,CAAC,OAAO,CAAA,CAAA,EAAI,IAAI,CAAC,cAAc,CAAA,CAAE;;AAM1E;;ACdY,MAAA,oCAAoC,GAA6B;AAC5E,IAAA,OAAO,EAAE,KAAK;;;ACET,MAAM,EACX,KAAK,EAAE,4BAA4B;AACnC;;AAEG;AACH,QAAQ,EAAE,+BAA+B,GAC1C,GAAG,0BAA0B,CAA2B,oCAAoC,EAAE,8BAA8B;;ACG7H;;AAEG;MAEU,wBAAwB,CAAA;AACnC,IAAA,OAAO,OAAO,CAAC,MAAA,GAAmC,oCAAoC,EAAA;QACpF,OAAO;AACL,YAAA,QAAQ,EAAE,wBAAwB;AAClC,YAAA,SAAS,EAAE;gBACT,mBAAmB,CAAC,8BAA8B,CAAC,OAAO,CAAC,uBAAuB,EAAE,MAAM,CAAC,CAAC;gBAC5F,+BAA+B,CAAC,MAAM,CAAC;AACxC,aAAA;SACF;;+GARQ,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;gHAAxB,wBAAwB,EAAA,CAAA,CAAA;gHAAxB,wBAAwB,EAAA,CAAA,CAAA;;4FAAxB,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBADpC;;;ACjBD;;AAEG;;;;"}
|
|
@@ -6,7 +6,7 @@ import { DaffModelFactory } from '@daffodil/core/testing';
|
|
|
6
6
|
class MockMagentoMoney {
|
|
7
7
|
constructor() {
|
|
8
8
|
this.__typename = 'Money';
|
|
9
|
-
this.value = faker.
|
|
9
|
+
this.value = faker.number.int({ min: 1, max: 10000 });
|
|
10
10
|
this.currency = faker.finance.currencyCode();
|
|
11
11
|
}
|
|
12
12
|
}
|
|
@@ -15,10 +15,10 @@ class MagentoMoneyFactory extends DaffModelFactory {
|
|
|
15
15
|
constructor() {
|
|
16
16
|
super(MockMagentoMoney);
|
|
17
17
|
}
|
|
18
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
19
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
|
18
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: MagentoMoneyFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
19
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: MagentoMoneyFactory, providedIn: 'root' }); }
|
|
20
20
|
}
|
|
21
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
21
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: MagentoMoneyFactory, decorators: [{
|
|
22
22
|
type: Injectable,
|
|
23
23
|
args: [{
|
|
24
24
|
providedIn: 'root',
|
|
@@ -29,7 +29,7 @@ class MockMagentoDiscount {
|
|
|
29
29
|
constructor() {
|
|
30
30
|
this.__typename = 'Discount';
|
|
31
31
|
this.amount = this.money();
|
|
32
|
-
this.label = faker.
|
|
32
|
+
this.label = faker.lorem.word();
|
|
33
33
|
}
|
|
34
34
|
money() {
|
|
35
35
|
return (new MagentoMoneyFactory()).create();
|
|
@@ -40,10 +40,10 @@ class MagentoDiscountFactory extends DaffModelFactory {
|
|
|
40
40
|
constructor() {
|
|
41
41
|
super(MockMagentoDiscount);
|
|
42
42
|
}
|
|
43
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
44
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
|
43
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: MagentoDiscountFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
44
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: MagentoDiscountFactory, providedIn: 'root' }); }
|
|
45
45
|
}
|
|
46
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
46
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: MagentoDiscountFactory, decorators: [{
|
|
47
47
|
type: Injectable,
|
|
48
48
|
args: [{
|
|
49
49
|
providedIn: 'root',
|
|
@@ -53,18 +53,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
|
|
|
53
53
|
class MockMagentoSearchResultPageInfo {
|
|
54
54
|
constructor() {
|
|
55
55
|
this.current_page = 1;
|
|
56
|
-
this.page_size = faker.
|
|
57
|
-
this.total_pages = faker.
|
|
56
|
+
this.page_size = faker.number.int(100);
|
|
57
|
+
this.total_pages = faker.number.int(100);
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
class MagentoSearchResultPageInfoFactory extends DaffModelFactory {
|
|
61
61
|
constructor() {
|
|
62
62
|
super(MockMagentoSearchResultPageInfo);
|
|
63
63
|
}
|
|
64
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
65
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
|
64
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: MagentoSearchResultPageInfoFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
65
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: MagentoSearchResultPageInfoFactory, providedIn: 'root' }); }
|
|
66
66
|
}
|
|
67
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
67
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: MagentoSearchResultPageInfoFactory, decorators: [{
|
|
68
68
|
type: Injectable,
|
|
69
69
|
args: [{
|
|
70
70
|
providedIn: 'root',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-driver-magento-testing.mjs","sources":["../../../libs/driver/magento/testing/src/factories/money.factory.ts","../../../libs/driver/magento/testing/src/factories/discount.factory.ts","../../../libs/driver/magento/testing/src/factories/page-info.factory.ts","../../../libs/driver/magento/testing/src/daffodil-driver-magento-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 { MagentoMoney } from '@daffodil/driver/magento';\n\nexport class MockMagentoMoney implements MagentoMoney {\n __typename = 'Money';\n value = faker.
|
|
1
|
+
{"version":3,"file":"daffodil-driver-magento-testing.mjs","sources":["../../../libs/driver/magento/testing/src/factories/money.factory.ts","../../../libs/driver/magento/testing/src/factories/discount.factory.ts","../../../libs/driver/magento/testing/src/factories/page-info.factory.ts","../../../libs/driver/magento/testing/src/daffodil-driver-magento-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 { MagentoMoney } from '@daffodil/driver/magento';\n\nexport class MockMagentoMoney implements MagentoMoney {\n __typename = 'Money';\n value = faker.number.int({ min: 1, max: 10000 });\n currency = faker.finance.currencyCode();\n};\n\n@Injectable({\n providedIn: 'root',\n})\nexport class MagentoMoneyFactory extends DaffModelFactory<MagentoMoney> {\n constructor() {\n super(MockMagentoMoney);\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 {\n MagentoDiscount,\n MagentoMoney,\n} from '@daffodil/driver/magento';\n\nimport { MagentoMoneyFactory } from './money.factory';\n\nexport class MockMagentoDiscount implements MagentoDiscount {\n __typename = 'Discount';\n amount = this.money();\n label = faker.lorem.word();\n\n private money(): MagentoMoney {\n return (new MagentoMoneyFactory()).create();\n }\n};\n\n@Injectable({\n providedIn: 'root',\n})\nexport class MagentoDiscountFactory extends DaffModelFactory<MagentoDiscount> {\n constructor() {\n super(MockMagentoDiscount);\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 { MagentoSearchResultPageInfo } from '@daffodil/driver/magento';\n\nclass MockMagentoSearchResultPageInfo implements MagentoSearchResultPageInfo {\n current_page = 1;\n page_size = faker.number.int(100);\n total_pages = faker.number.int(100);\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class MagentoSearchResultPageInfoFactory extends DaffModelFactory<MagentoSearchResultPageInfo> {\n constructor(){\n super(MockMagentoSearchResultPageInfo);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAMa,gBAAgB,CAAA;AAA7B,IAAA,WAAA,GAAA;QACE,IAAU,CAAA,UAAA,GAAG,OAAO;AACpB,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;AAChD,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,YAAY,EAAE;;AACxC;AAAA;AAKK,MAAO,mBAAoB,SAAQ,gBAA8B,CAAA;AACrE,IAAA,WAAA,GAAA;QACE,KAAK,CAAC,gBAAgB,CAAC;;+GAFd,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,C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AAA,WAAA,GAAA;QACE,IAAY,CAAA,YAAA,GAAI,CAAC;QACjB,IAAS,CAAA,SAAA,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC;QACjC,IAAW,CAAA,WAAA,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC;;AACpC;AAKK,MAAO,kCAAmC,SAAQ,gBAA6C,CAAA;AACnG,IAAA,WAAA,GAAA;QACE,KAAK,CAAC,+BAA+B,CAAC;;+GAF7B,kCAAkC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAlC,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kCAAkC,cAFjC,MAAM,EAAA,CAAA,CAAA;;4FAEP,kCAAkC,EAAA,UAAA,EAAA,CAAA;kBAH9C,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACdD;;AAEG;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DaffInheritableError, daffIsError, createMultiInjectionToken, DaffSortDirectionEnum } from '@daffodil/core';
|
|
2
2
|
import { DaffDriverNetworkError, provideDaffDriverHttpClientCacheService } from '@daffodil/driver';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import {
|
|
4
|
+
import { Inject, Injectable, PLATFORM_ID, NgModule } from '@angular/core';
|
|
5
5
|
import { ApolloLink } from '@apollo/client/core';
|
|
6
6
|
import { isPlatformBrowser } from '@angular/common';
|
|
7
7
|
import { gql } from 'apollo-angular';
|
|
@@ -183,10 +183,10 @@ class DaffMagentoApolloCacheableOperationsLinkGenerator {
|
|
|
183
183
|
return forward(operation);
|
|
184
184
|
});
|
|
185
185
|
}
|
|
186
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
187
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
|
186
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffMagentoApolloCacheableOperationsLinkGenerator, deps: [{ token: DAFF_MAGENTO_CACHEABLE_OPERATIONS }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
187
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffMagentoApolloCacheableOperationsLinkGenerator, providedIn: 'root' }); }
|
|
188
188
|
}
|
|
189
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
189
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffMagentoApolloCacheableOperationsLinkGenerator, decorators: [{
|
|
190
190
|
type: Injectable,
|
|
191
191
|
args: [{
|
|
192
192
|
providedIn: 'root',
|
|
@@ -441,10 +441,10 @@ class DaffDriverHttpClientCacheMagentoService {
|
|
|
441
441
|
location.reload();
|
|
442
442
|
}
|
|
443
443
|
}
|
|
444
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
445
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
|
444
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffDriverHttpClientCacheMagentoService, deps: [{ token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
445
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffDriverHttpClientCacheMagentoService, providedIn: 'root' }); }
|
|
446
446
|
}
|
|
447
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
447
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffDriverHttpClientCacheMagentoService, decorators: [{
|
|
448
448
|
type: Injectable,
|
|
449
449
|
args: [{
|
|
450
450
|
providedIn: 'root',
|
|
@@ -482,10 +482,10 @@ class DaffMagentoCacheHeaderApolloLinkGenerator {
|
|
|
482
482
|
});
|
|
483
483
|
});
|
|
484
484
|
}
|
|
485
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
486
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
|
485
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffMagentoCacheHeaderApolloLinkGenerator, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
486
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffMagentoCacheHeaderApolloLinkGenerator, providedIn: 'root' }); }
|
|
487
487
|
}
|
|
488
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
488
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffMagentoCacheHeaderApolloLinkGenerator, decorators: [{
|
|
489
489
|
type: Injectable,
|
|
490
490
|
args: [{
|
|
491
491
|
providedIn: 'root',
|
|
@@ -532,13 +532,13 @@ const magentoMoneyFragment = gql `
|
|
|
532
532
|
`;
|
|
533
533
|
|
|
534
534
|
class DaffDriverMagentoModule {
|
|
535
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
536
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.
|
|
537
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.
|
|
535
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffDriverMagentoModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
536
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.11", ngImport: i0, type: DaffDriverMagentoModule }); }
|
|
537
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffDriverMagentoModule, providers: [
|
|
538
538
|
provideDaffDriverHttpClientCacheService(DaffDriverHttpClientCacheMagentoService),
|
|
539
539
|
] }); }
|
|
540
540
|
}
|
|
541
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
541
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffDriverMagentoModule, decorators: [{
|
|
542
542
|
type: NgModule,
|
|
543
543
|
args: [{
|
|
544
544
|
providers: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-driver-magento.mjs","sources":["../../../libs/driver/magento/src/schema/schema.ts","../../../libs/driver/magento/src/errors/error.class.ts","../../../libs/driver/magento/src/errors/transform-graphql.ts","../../../libs/driver/magento/src/errors/transform.ts","../../../libs/driver/magento/src/models/sort.enum.ts","../../../libs/driver/magento/src/graphql/cacheable-operations/cacheable-operations-token.ts","../../../libs/driver/magento/src/graphql/cacheable-operations/apollo-cacheable-operations-link-generator.ts","../../../libs/driver/magento/src/graphql/type-policies.ts","../../../libs/driver/magento/src/graphql/cache.service.ts","../../../libs/driver/magento/src/graphql/cache-header/cache-header-apollo-link.ts","../../../libs/driver/magento/src/transforms/responses/page-info.ts","../../../libs/driver/magento/src/transforms/responses/sort-direction.ts","../../../libs/driver/magento/src/transforms/requests/sort-direction.ts","../../../libs/driver/magento/src/fragments/page-info.ts","../../../libs/driver/magento/src/fragments/money.ts","../../../libs/driver/magento/src/magento.module.ts","../../../libs/driver/magento/src/daffodil-driver-magento.ts"],"sourcesContent":["import introspectionQueryResultData from './introspection.json';\n\nexport const schema = introspectionQueryResultData;\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nexport const DAFF_DRIVER_MAGENTO_ERROR_CODE = 'DAFF_DRIVER_MAGENTO_ERROR';\n\n/**\n * A very general error thrown when a more specific error type cannot be determined.\n */\nexport class DaffDriverMagentoError extends DaffInheritableError implements DaffError {\n public readonly code: string = DAFF_DRIVER_MAGENTO_ERROR_CODE;\n\n constructor(message?: string) {\n super(message);\n }\n}\n","import { GraphQLFormattedError } from 'graphql';\n\nimport {\n DaffError,\n DaffErrorCodeMap,\n} from '@daffodil/core';\n\nimport { DaffDriverMagentoError } from './error.class';\n\nexport function daffMagentoTransformGraphQlError<T extends DaffErrorCodeMap>(\n error: GraphQLFormattedError,\n map: T,\n): DaffError {\n const ErrorClass = map[<string>error?.extensions?.category] || DaffDriverMagentoError;\n\n return new ErrorClass(error.message) ;\n};\n","import { ApolloError } from '@apollo/client/core';\n\nimport {\n DaffError,\n DaffErrorCodeMap,\n daffIsError,\n} from '@daffodil/core';\nimport { DaffDriverNetworkError } from '@daffodil/driver';\n\nimport { DaffDriverMagentoError } from './error.class';\nimport { daffMagentoTransformGraphQlError } from './transform-graphql';\n\n/**\n * Transforms the passed error according to the lookup in the passed map.\n */\n// TODO: return array of errors\nexport function daffTransformMagentoError<T extends DaffErrorCodeMap>(error: any, map: T): DaffError {\n if (error.graphQLErrors?.length > 0) {\n return (<ApolloError>error).graphQLErrors.map(err => daffMagentoTransformGraphQlError<T>(err, map))[0];\n } else if (error.networkError) {\n return new DaffDriverNetworkError((<ApolloError>error).networkError.message);\n } else if (daffIsError(error)) {\n return error;\n } else {\n return new DaffDriverMagentoError(error.message);\n }\n};\n","export enum MagentoSortEnum {\n ASC = 'ASC',\n DESC = 'DESC'\n}\n","import { createMultiInjectionToken } from '@daffodil/core';\n\nexport const {\n /**\n * A multi-provider injection token of the operation names of magento queries that should\n * be cached. This is needed because queries need to be converted into GET queries in order for Magento\n * to cache them. This token should be used by daffodil driver platform modules to register operation names that are cacheable, and is\n * intended for internal daffodil use only.\n */\n token: DAFF_MAGENTO_CACHEABLE_OPERATIONS,\n /**\n * Adds many operation names to the list of cacheable Magento operations. Use only with Angular 9+.\n */\n provider: provideManyDaffMagentoCacheableOperations,\n} = createMultiInjectionToken<string>('DAFF_MAGENTO_CACHEABLE_OPERATIONS');\n\n/**\n * Adds an operation name to the list of cacheable Magento operations. Use only with Angular 9+.\n */\nexport function provideDaffMagentoCacheableOperation(operationName: string) {\n return {\n provide: DAFF_MAGENTO_CACHEABLE_OPERATIONS,\n useValue: operationName,\n multi: true,\n };\n}\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\nimport { ApolloLink } from '@apollo/client/core';\n\nimport { DaffApolloLinkGenerator } from '@daffodil/core/graphql';\n\nimport { DAFF_MAGENTO_CACHEABLE_OPERATIONS } from './cacheable-operations-token';\n\n/**\n * A service that will convert cacheable apollo operations into a format that Magento will understand as cacheable.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffMagentoApolloCacheableOperationsLinkGenerator implements DaffApolloLinkGenerator {\n constructor(\n @Inject(DAFF_MAGENTO_CACHEABLE_OPERATIONS) private apolloGetRequests: string[],\n ) {}\n\n getLink(): ApolloLink {\n return new ApolloLink((operation, forward) => {\n if(this.apolloGetRequests.indexOf(operation.operationName) > -1) {\n operation.setContext({ method: 'GET' });\n }\n return forward(operation);\n });\n }\n}\n","import { TypePolicies } from '@apollo/client/core';\n\n/**\n * Custom type policies that allow us to have more granular control\n * over how ApolloClient reads from and writes to the cache.\n *\n * This is applicable to Magento 2.4.3 and up.\n * Heavily based on https://github.com/magento/pwa-studio/blob/99270701b2b607551f2e5881af272ed48ba7064c/packages/peregrine/lib/Apollo/policies/index.js.\n *\n * https://www.apollographql.com/docs/react/caching/cache-configuration/#typepolicy-fields\n * https://www.apollographql.com/docs/react/caching/cache-field-behavior/\n */\nexport const DAFF_MAGENTO_2_4_3_TYPE_POLICIES: TypePolicies = {\n Query: {\n fields: {\n cart: {\n // Replaces @connection(key: \"Cart\")\n keyArgs: () => 'Cart',\n },\n customer: {\n keyArgs: () => 'Customer',\n },\n customerCart: {\n keyArgs: () => 'Cart',\n },\n },\n },\n AppliedGiftCard: {\n keyFields: ['code'],\n },\n AvailablePaymentMethod: {\n keyFields: ['code'],\n },\n AvailableShippingMethod: {\n // The combination of these fields makes an instance of\n // AvailableShippingMethod unique.\n keyFields: ['carrier_code', 'method_code'],\n },\n Breadcrumb: {\n // Uses provided fields on the object as the `id`.\n keyFields: ['category_uid'],\n },\n Cart: {\n keyFields: () => 'Cart',\n fields: {\n applied_gift_cards: {\n // eslint-disable-next-line no-unused-vars\n merge: (existing, incoming) => incoming,\n },\n available_payment_methods: {\n // eslint-disable-next-line no-unused-vars\n merge: (existing, incoming) => incoming,\n },\n items: {\n // eslint-disable-next-line no-unused-vars\n merge: (existing, incoming) => incoming,\n },\n prices: {\n // `merge: true` can be used for an object field.\n merge: true,\n },\n shipping_addresses: {\n merge:(existing = [], incoming, { readField, mergeObjects }) => {\n // street makes these things unique\n const mergeResult = new Set();\n const streetToIndex = new Map();\n\n existing.forEach((existingShippingAddress, index) => {\n // Use readField instead of existingShippingAddress.street directly because it will follow cache references.\n const street = readField(\n 'street',\n existingShippingAddress,\n );\n streetToIndex.set(street, index);\n });\n\n incoming.forEach(incomingShippingAddress => {\n const street = readField(\n 'street',\n incomingShippingAddress,\n );\n\n if (streetToIndex.has(street)) {\n const targetIndex = streetToIndex.get(street);\n const existingShippingAddress = existing[targetIndex];\n const merged = mergeObjects(\n existingShippingAddress,\n incomingShippingAddress,\n );\n mergeResult.add(merged);\n } else {\n // We do not have an address with this street yet, add it on to the end.\n streetToIndex.set(street, streetToIndex.size);\n mergeResult.add(incomingShippingAddress);\n }\n });\n\n return Array.from(mergeResult);\n },\n },\n },\n },\n Customer: {\n keyFields: () => 'Customer',\n fields: {\n addresses: {\n merge: (existing, incoming) => incoming,\n read: (cachedAddresses, { toReference }) => {\n if (cachedAddresses) {\n return cachedAddresses.map(address => {\n // Update v2 identifiers to new references. Previous\n // entries had `id: CustomerAddress:1` which caused\n // v3's lookup to fail. If we find a legacy id,\n // point it at the object using a reference.\n if (address.id?.includes('CustomerAddress')) {\n return toReference(address.id);\n } else {\n return address;\n }\n });\n }\n // If there are no cached addresses that's fine - the schema\n // shows that it is a nullable field.\n },\n },\n orders: {\n keyArgs: ['filter'],\n // TODO: write merge function that handles pagination\n // items: {\n // merge: true,\n // },\n },\n },\n },\n CustomerAddress: {\n fields: {\n street: {\n // eslint-disable-next-line no-unused-vars\n merge: (existing, incoming) => incoming,\n },\n },\n },\n CustomerPaymentTokens: {\n keyFields: () => 'CustomerPaymentTokens',\n fields: {\n items: {\n // eslint-disable-next-line no-unused-vars\n merge: (existing, incoming) => incoming,\n },\n },\n },\n ProductImage: {\n keyFields: ['url'],\n },\n SelectedConfigurableOption: {\n // id alone is not enough to identify a selected option as it can refer\n // to something like \"size\" where value_id refers to \"large\".\n keyFields: ['id', 'value_id'],\n },\n SelectedPaymentMethod: {\n keyFields: ['code'],\n },\n ShippingCartAddress: {\n keyFields: ['street'],\n fields: {\n available_shipping_methods: {\n merge: (existing = [], incoming, { readField, mergeObjects }) => {\n // carrier_code + method_code makes these things unique\n const mergeResult = new Set();\n const carrierToIndex = new Map();\n\n existing.forEach((existingShippingMethod, index) => {\n // Use readField because it will follow cache references.\n const carrierCode = readField(\n 'carrier_code',\n existingShippingMethod,\n );\n const methodCode = readField(\n 'method_code',\n existingShippingMethod,\n );\n const carrierKey = `${carrierCode}|${methodCode}`;\n carrierToIndex.set(carrierKey, index);\n });\n\n incoming.forEach(incomingShippingMethod => {\n // Use readField because it will follow cache references.\n const carrierCode = readField(\n 'carrier_code',\n incomingShippingMethod,\n );\n const methodCode = readField(\n 'method_code',\n incomingShippingMethod,\n );\n const carrierKey = `${carrierCode}|${methodCode}`;\n if (carrierToIndex.has(carrierKey)) {\n const targetIndex = carrierToIndex.get(carrierKey);\n const existingShippingMethod = existing[targetIndex];\n const merged = mergeObjects(\n existingShippingMethod,\n incomingShippingMethod,\n );\n mergeResult.add(merged);\n } else {\n // We do not have a method with this key yet, add it on to the end.\n carrierToIndex.set(carrierKey, carrierToIndex.size);\n mergeResult.add(incomingShippingMethod);\n }\n });\n\n return Array.from(mergeResult);\n },\n },\n country: {\n merge: true,\n },\n region: {\n merge: true,\n },\n selected_shipping_method: {\n merge: true,\n },\n },\n },\n CategoryTree: {\n fields: {\n children: {\n merge: (existing, incoming) => incoming,\n },\n },\n },\n Wishlist: {\n keyFields: ({ id }) => `CustomerWishlist:${id}`,\n },\n WishlistItem: {\n keyFields: ({ id }) => `CustomerWishlistItem:${id}`,\n },\n SimpleWishlistItem: {\n keyFields: ({ id }) => `CustomerSimpleWishlistItem:${id}`,\n },\n VirtualWishlistItem: {\n keyFields: ({ id }) => `CustomerVirtualWishlistItem:${id}`,\n },\n DownloadableWishlistItem: {\n keyFields: ({ id }) => `CustomerDownloadableWishlistItem:${id}`,\n },\n BundleWishlistItem: {\n keyFields: ({ id }) => `CustomerBundleWishlistItem:${id}`,\n },\n GroupedProductWishlistItem: {\n keyFields: ({ id }) => `CustomerGroupedProductWishlistItem:${id}`,\n },\n ConfigurableWishlistItem: {\n keyFields: ({ id }) => `CustomerConfigurableWishlistItem:${id}`,\n },\n GiftCardWishlistItem: {\n keyFields: ({ id }) => `CustomerGiftCardWishlistItem:${id}`,\n },\n};\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n Inject,\n Injectable,\n PLATFORM_ID,\n} from '@angular/core';\n\nimport { DaffDriverHttpClientCacheServiceInterface } from '@daffodil/driver';\n\n/**\n * Interacts with the Apollo client.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffDriverHttpClientCacheMagentoService implements DaffDriverHttpClientCacheServiceInterface {\n constructor(\n @Inject(PLATFORM_ID) private platformId: string,\n ) {}\n\n reset(): void {\n if (isPlatformBrowser(this.platformId)) {\n location.reload();\n }\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ApolloLink } from '@apollo/client/core';\n\nimport { DaffApolloLinkGenerator } from '@daffodil/core/graphql';\n\nexport const MAGENTO_CUSTOMER_CACHE_ID_HEADER = 'X-Magento-Cache-Id';\n\n/**\n * Stores and sets the Magento cache ID header.\n * This will set the `X-Magento-Cache-Id` header from the most recent value encountered\n * on a response, if there was a response with that header set.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffMagentoCacheHeaderApolloLinkGenerator implements DaffApolloLinkGenerator {\n private _cacheHeader?: string;\n\n getLink(): ApolloLink {\n return new ApolloLink((operation, forward) => {\n if (this._cacheHeader) {\n operation.setContext({\n headers: {\n ...operation.getContext().headers,\n [MAGENTO_CUSTOMER_CACHE_ID_HEADER]: this._cacheHeader,\n },\n });\n }\n return forward(operation).map((response) => {\n const { headers } = operation.getContext().response;\n if (headers.get(MAGENTO_CUSTOMER_CACHE_ID_HEADER)) {\n this._cacheHeader = headers.get(MAGENTO_CUSTOMER_CACHE_ID_HEADER);\n }\n return response;\n });\n });\n }\n}\n","import { DaffCollectionMetadata } from '@daffodil/core';\n\nimport { MagentoSearchResultPageInfo } from '../../models/public_api';\n\nexport function magentoPageInfoTransform(pageInfo: MagentoSearchResultPageInfo): Pick<DaffCollectionMetadata, 'pageSize' | 'currentPage' | 'totalPages'> {\n return {\n pageSize: pageInfo.page_size,\n currentPage: pageInfo.current_page,\n totalPages: pageInfo.total_pages,\n };\n}\n","import { DaffSortDirectionEnum } from '@daffodil/core';\n\nimport { MagentoSortEnum } from '../../models/public_api';\n\nconst map = <const>{\n [MagentoSortEnum.ASC]: DaffSortDirectionEnum.Ascending,\n [MagentoSortEnum.DESC]: DaffSortDirectionEnum.Descending,\n};\n\nexport function magentoSortDirectionResponseTransform(direction: MagentoSortEnum): DaffSortDirectionEnum {\n return map[direction];\n}\n","import { DaffSortDirectionEnum } from '@daffodil/core';\n\nimport { MagentoSortEnum } from '../../models/public_api';\n\nconst map = <const>{\n [DaffSortDirectionEnum.Ascending]: MagentoSortEnum.ASC,\n [DaffSortDirectionEnum.Descending]: MagentoSortEnum.DESC,\n};\n\nexport function magentoSortDirectionRequestTransform(direction: DaffSortDirectionEnum): MagentoSortEnum {\n return map[direction];\n}\n","import { gql } from 'apollo-angular';\n\nexport const magentoSearchResultPageInfoFragment = gql`\n fragment magentoSearchResultPageInfo on SearchResultPageInfo {\n page_size\n current_page\n total_pages\n }\n`;\n","import { gql } from 'apollo-angular';\n\nexport const magentoMoneyFragment = gql`\n fragment moneyFragment on Money {\n value\n currency\n }\n`;\n","import { NgModule } from '@angular/core';\n\nimport { provideDaffDriverHttpClientCacheService } from '@daffodil/driver';\n\nimport { DaffDriverHttpClientCacheMagentoService } from './graphql/cache.service';\n\n@NgModule({\n providers: [\n provideDaffDriverHttpClientCacheService(DaffDriverHttpClientCacheMagentoService),\n ],\n})\nexport class DaffDriverMagentoModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEO,MAAM,MAAM,GAAG;;ACGf,MAAM,8BAA8B,GAAG;AAE9C;;AAEG;AACG,MAAO,sBAAuB,SAAQ,oBAAoB,CAAA;AAG9D,IAAA,WAAA,CAAY,OAAgB,EAAA;QAC1B,KAAK,CAAC,OAAO,CAAC;QAHA,IAAI,CAAA,IAAA,GAAW,8BAA8B;;AAK9D;;ACPe,SAAA,gCAAgC,CAC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PA,MAAM,GAAG,GAAU;AACjB,IAAA,CAAC,qBAAqB,CAAC,SAAS,GAAG,eAAe,CAAC,GAAG;AACtD,IAAA,CAAC,qBAAqB,CAAC,UAAU,GAAG,eAAe,CAAC,IAAI;CACzD;AAEK,SAAU,oCAAoC,CAAC,SAAgC,EAAA;AACnF,IAAA,OAAO,GAAG,CAAC,SAAS,CAAC;AACvB;;ACTO,MAAM,mCAAmC,GAAG,GAAG,CAAA;;;;;;;;ACA/C,MAAM,oBAAoB,GAAG,GAAG,CAAA;;;;;;;MCS1B,uBAAuB,CAAA;8GAAvB,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAAvB,uBAAuB,EAAA,CAAA,CAAA;AAAvB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uBAAuB,EAJvB,SAAA,EAAA;YACT,uCAAuC,CAAC,uCAAuC,CAAC;AACjF,SAAA,EAAA,CAAA,CAAA;;2FAEU,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBALnC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,SAAS,EAAE;wBACT,uCAAuC,CAAC,uCAAuC,CAAC;AACjF,qBAAA;AACF,iBAAA;;;ACVD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"daffodil-driver-magento.mjs","sources":["../../../libs/driver/magento/src/schema/schema.ts","../../../libs/driver/magento/src/errors/error.class.ts","../../../libs/driver/magento/src/errors/transform-graphql.ts","../../../libs/driver/magento/src/errors/transform.ts","../../../libs/driver/magento/src/models/sort.enum.ts","../../../libs/driver/magento/src/graphql/cacheable-operations/cacheable-operations-token.ts","../../../libs/driver/magento/src/graphql/cacheable-operations/apollo-cacheable-operations-link-generator.ts","../../../libs/driver/magento/src/graphql/type-policies.ts","../../../libs/driver/magento/src/graphql/cache.service.ts","../../../libs/driver/magento/src/graphql/cache-header/cache-header-apollo-link.ts","../../../libs/driver/magento/src/transforms/responses/page-info.ts","../../../libs/driver/magento/src/transforms/responses/sort-direction.ts","../../../libs/driver/magento/src/transforms/requests/sort-direction.ts","../../../libs/driver/magento/src/fragments/page-info.ts","../../../libs/driver/magento/src/fragments/money.ts","../../../libs/driver/magento/src/magento.module.ts","../../../libs/driver/magento/src/daffodil-driver-magento.ts"],"sourcesContent":["import introspectionQueryResultData from './introspection.json';\n\nexport const schema = introspectionQueryResultData;\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nexport const DAFF_DRIVER_MAGENTO_ERROR_CODE = 'DAFF_DRIVER_MAGENTO_ERROR';\n\n/**\n * A very general error thrown when a more specific error type cannot be determined.\n */\nexport class DaffDriverMagentoError extends DaffInheritableError implements DaffError {\n public readonly code: string = DAFF_DRIVER_MAGENTO_ERROR_CODE;\n\n constructor(message?: string) {\n super(message);\n }\n}\n","import { GraphQLFormattedError } from 'graphql';\n\nimport {\n DaffError,\n DaffErrorCodeMap,\n} from '@daffodil/core';\n\nimport { DaffDriverMagentoError } from './error.class';\n\nexport function daffMagentoTransformGraphQlError<T extends DaffErrorCodeMap>(\n error: GraphQLFormattedError,\n map: T,\n): DaffError {\n const ErrorClass = map[<string>error?.extensions?.category] || DaffDriverMagentoError;\n\n return new ErrorClass(error.message) ;\n};\n","import { ApolloError } from '@apollo/client/core';\n\nimport {\n DaffError,\n DaffErrorCodeMap,\n daffIsError,\n} from '@daffodil/core';\nimport { DaffDriverNetworkError } from '@daffodil/driver';\n\nimport { DaffDriverMagentoError } from './error.class';\nimport { daffMagentoTransformGraphQlError } from './transform-graphql';\n\n/**\n * Transforms the passed error according to the lookup in the passed map.\n */\n// TODO: return array of errors\nexport function daffTransformMagentoError<T extends DaffErrorCodeMap>(error: any, map: T): DaffError {\n if (error.graphQLErrors?.length > 0) {\n return (<ApolloError>error).graphQLErrors.map(err => daffMagentoTransformGraphQlError<T>(err, map))[0];\n } else if (error.networkError) {\n return new DaffDriverNetworkError((<ApolloError>error).networkError.message);\n } else if (daffIsError(error)) {\n return error;\n } else {\n return new DaffDriverMagentoError(error.message);\n }\n};\n","export enum MagentoSortEnum {\n ASC = 'ASC',\n DESC = 'DESC'\n}\n","import { createMultiInjectionToken } from '@daffodil/core';\n\nexport const {\n /**\n * A multi-provider injection token of the operation names of magento queries that should\n * be cached. This is needed because queries need to be converted into GET queries in order for Magento\n * to cache them. This token should be used by daffodil driver platform modules to register operation names that are cacheable, and is\n * intended for internal daffodil use only.\n */\n token: DAFF_MAGENTO_CACHEABLE_OPERATIONS,\n /**\n * Adds many operation names to the list of cacheable Magento operations. Use only with Angular 9+.\n */\n provider: provideManyDaffMagentoCacheableOperations,\n} = createMultiInjectionToken<string>('DAFF_MAGENTO_CACHEABLE_OPERATIONS');\n\n/**\n * Adds an operation name to the list of cacheable Magento operations. Use only with Angular 9+.\n */\nexport function provideDaffMagentoCacheableOperation(operationName: string) {\n return {\n provide: DAFF_MAGENTO_CACHEABLE_OPERATIONS,\n useValue: operationName,\n multi: true,\n };\n}\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\nimport { ApolloLink } from '@apollo/client/core';\n\nimport { DaffApolloLinkGenerator } from '@daffodil/core/graphql';\n\nimport { DAFF_MAGENTO_CACHEABLE_OPERATIONS } from './cacheable-operations-token';\n\n/**\n * A service that will convert cacheable apollo operations into a format that Magento will understand as cacheable.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffMagentoApolloCacheableOperationsLinkGenerator implements DaffApolloLinkGenerator {\n constructor(\n @Inject(DAFF_MAGENTO_CACHEABLE_OPERATIONS) private apolloGetRequests: string[],\n ) {}\n\n getLink(): ApolloLink {\n return new ApolloLink((operation, forward) => {\n if(this.apolloGetRequests.indexOf(operation.operationName) > -1) {\n operation.setContext({ method: 'GET' });\n }\n return forward(operation);\n });\n }\n}\n","import { TypePolicies } from '@apollo/client/core';\n\n/**\n * Custom type policies that allow us to have more granular control\n * over how ApolloClient reads from and writes to the cache.\n *\n * This is applicable to Magento 2.4.3 and up.\n * Heavily based on https://github.com/magento/pwa-studio/blob/99270701b2b607551f2e5881af272ed48ba7064c/packages/peregrine/lib/Apollo/policies/index.js.\n *\n * https://www.apollographql.com/docs/react/caching/cache-configuration/#typepolicy-fields\n * https://www.apollographql.com/docs/react/caching/cache-field-behavior/\n */\nexport const DAFF_MAGENTO_2_4_3_TYPE_POLICIES: TypePolicies = {\n Query: {\n fields: {\n cart: {\n // Replaces @connection(key: \"Cart\")\n keyArgs: () => 'Cart',\n },\n customer: {\n keyArgs: () => 'Customer',\n },\n customerCart: {\n keyArgs: () => 'Cart',\n },\n },\n },\n AppliedGiftCard: {\n keyFields: ['code'],\n },\n AvailablePaymentMethod: {\n keyFields: ['code'],\n },\n AvailableShippingMethod: {\n // The combination of these fields makes an instance of\n // AvailableShippingMethod unique.\n keyFields: ['carrier_code', 'method_code'],\n },\n Breadcrumb: {\n // Uses provided fields on the object as the `id`.\n keyFields: ['category_uid'],\n },\n Cart: {\n keyFields: () => 'Cart',\n fields: {\n applied_gift_cards: {\n // eslint-disable-next-line no-unused-vars\n merge: (existing, incoming) => incoming,\n },\n available_payment_methods: {\n // eslint-disable-next-line no-unused-vars\n merge: (existing, incoming) => incoming,\n },\n items: {\n // eslint-disable-next-line no-unused-vars\n merge: (existing, incoming) => incoming,\n },\n prices: {\n // `merge: true` can be used for an object field.\n merge: true,\n },\n shipping_addresses: {\n merge:(existing = [], incoming, { readField, mergeObjects }) => {\n // street makes these things unique\n const mergeResult = new Set();\n const streetToIndex = new Map();\n\n existing.forEach((existingShippingAddress, index) => {\n // Use readField instead of existingShippingAddress.street directly because it will follow cache references.\n const street = readField(\n 'street',\n existingShippingAddress,\n );\n streetToIndex.set(street, index);\n });\n\n incoming.forEach(incomingShippingAddress => {\n const street = readField(\n 'street',\n incomingShippingAddress,\n );\n\n if (streetToIndex.has(street)) {\n const targetIndex = streetToIndex.get(street);\n const existingShippingAddress = existing[targetIndex];\n const merged = mergeObjects(\n existingShippingAddress,\n incomingShippingAddress,\n );\n mergeResult.add(merged);\n } else {\n // We do not have an address with this street yet, add it on to the end.\n streetToIndex.set(street, streetToIndex.size);\n mergeResult.add(incomingShippingAddress);\n }\n });\n\n return Array.from(mergeResult);\n },\n },\n },\n },\n Customer: {\n keyFields: () => 'Customer',\n fields: {\n addresses: {\n merge: (existing, incoming) => incoming,\n read: (cachedAddresses, { toReference }) => {\n if (cachedAddresses) {\n return cachedAddresses.map(address => {\n // Update v2 identifiers to new references. Previous\n // entries had `id: CustomerAddress:1` which caused\n // v3's lookup to fail. If we find a legacy id,\n // point it at the object using a reference.\n if (address.id?.includes('CustomerAddress')) {\n return toReference(address.id);\n } else {\n return address;\n }\n });\n }\n // If there are no cached addresses that's fine - the schema\n // shows that it is a nullable field.\n },\n },\n orders: {\n keyArgs: ['filter'],\n // TODO: write merge function that handles pagination\n // items: {\n // merge: true,\n // },\n },\n },\n },\n CustomerAddress: {\n fields: {\n street: {\n // eslint-disable-next-line no-unused-vars\n merge: (existing, incoming) => incoming,\n },\n },\n },\n CustomerPaymentTokens: {\n keyFields: () => 'CustomerPaymentTokens',\n fields: {\n items: {\n // eslint-disable-next-line no-unused-vars\n merge: (existing, incoming) => incoming,\n },\n },\n },\n ProductImage: {\n keyFields: ['url'],\n },\n SelectedConfigurableOption: {\n // id alone is not enough to identify a selected option as it can refer\n // to something like \"size\" where value_id refers to \"large\".\n keyFields: ['id', 'value_id'],\n },\n SelectedPaymentMethod: {\n keyFields: ['code'],\n },\n ShippingCartAddress: {\n keyFields: ['street'],\n fields: {\n available_shipping_methods: {\n merge: (existing = [], incoming, { readField, mergeObjects }) => {\n // carrier_code + method_code makes these things unique\n const mergeResult = new Set();\n const carrierToIndex = new Map();\n\n existing.forEach((existingShippingMethod, index) => {\n // Use readField because it will follow cache references.\n const carrierCode = readField(\n 'carrier_code',\n existingShippingMethod,\n );\n const methodCode = readField(\n 'method_code',\n existingShippingMethod,\n );\n const carrierKey = `${carrierCode}|${methodCode}`;\n carrierToIndex.set(carrierKey, index);\n });\n\n incoming.forEach(incomingShippingMethod => {\n // Use readField because it will follow cache references.\n const carrierCode = readField(\n 'carrier_code',\n incomingShippingMethod,\n );\n const methodCode = readField(\n 'method_code',\n incomingShippingMethod,\n );\n const carrierKey = `${carrierCode}|${methodCode}`;\n if (carrierToIndex.has(carrierKey)) {\n const targetIndex = carrierToIndex.get(carrierKey);\n const existingShippingMethod = existing[targetIndex];\n const merged = mergeObjects(\n existingShippingMethod,\n incomingShippingMethod,\n );\n mergeResult.add(merged);\n } else {\n // We do not have a method with this key yet, add it on to the end.\n carrierToIndex.set(carrierKey, carrierToIndex.size);\n mergeResult.add(incomingShippingMethod);\n }\n });\n\n return Array.from(mergeResult);\n },\n },\n country: {\n merge: true,\n },\n region: {\n merge: true,\n },\n selected_shipping_method: {\n merge: true,\n },\n },\n },\n CategoryTree: {\n fields: {\n children: {\n merge: (existing, incoming) => incoming,\n },\n },\n },\n Wishlist: {\n keyFields: ({ id }) => `CustomerWishlist:${id}`,\n },\n WishlistItem: {\n keyFields: ({ id }) => `CustomerWishlistItem:${id}`,\n },\n SimpleWishlistItem: {\n keyFields: ({ id }) => `CustomerSimpleWishlistItem:${id}`,\n },\n VirtualWishlistItem: {\n keyFields: ({ id }) => `CustomerVirtualWishlistItem:${id}`,\n },\n DownloadableWishlistItem: {\n keyFields: ({ id }) => `CustomerDownloadableWishlistItem:${id}`,\n },\n BundleWishlistItem: {\n keyFields: ({ id }) => `CustomerBundleWishlistItem:${id}`,\n },\n GroupedProductWishlistItem: {\n keyFields: ({ id }) => `CustomerGroupedProductWishlistItem:${id}`,\n },\n ConfigurableWishlistItem: {\n keyFields: ({ id }) => `CustomerConfigurableWishlistItem:${id}`,\n },\n GiftCardWishlistItem: {\n keyFields: ({ id }) => `CustomerGiftCardWishlistItem:${id}`,\n },\n};\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n Inject,\n Injectable,\n PLATFORM_ID,\n} from '@angular/core';\n\nimport { DaffDriverHttpClientCacheServiceInterface } from '@daffodil/driver';\n\n/**\n * Interacts with the Apollo client.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffDriverHttpClientCacheMagentoService implements DaffDriverHttpClientCacheServiceInterface {\n constructor(\n @Inject(PLATFORM_ID) private platformId: string,\n ) {}\n\n reset(): void {\n if (isPlatformBrowser(this.platformId)) {\n location.reload();\n }\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ApolloLink } from '@apollo/client/core';\n\nimport { DaffApolloLinkGenerator } from '@daffodil/core/graphql';\n\nexport const MAGENTO_CUSTOMER_CACHE_ID_HEADER = 'X-Magento-Cache-Id';\n\n/**\n * Stores and sets the Magento cache ID header.\n * This will set the `X-Magento-Cache-Id` header from the most recent value encountered\n * on a response, if there was a response with that header set.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffMagentoCacheHeaderApolloLinkGenerator implements DaffApolloLinkGenerator {\n private _cacheHeader?: string;\n\n getLink(): ApolloLink {\n return new ApolloLink((operation, forward) => {\n if (this._cacheHeader) {\n operation.setContext({\n headers: {\n ...operation.getContext().headers,\n [MAGENTO_CUSTOMER_CACHE_ID_HEADER]: this._cacheHeader,\n },\n });\n }\n return forward(operation).map((response) => {\n const { headers } = operation.getContext().response;\n if (headers.get(MAGENTO_CUSTOMER_CACHE_ID_HEADER)) {\n this._cacheHeader = headers.get(MAGENTO_CUSTOMER_CACHE_ID_HEADER);\n }\n return response;\n });\n });\n }\n}\n","import { DaffCollectionMetadata } from '@daffodil/core';\n\nimport { MagentoSearchResultPageInfo } from '../../models/public_api';\n\nexport function magentoPageInfoTransform(pageInfo: MagentoSearchResultPageInfo): Pick<DaffCollectionMetadata, 'pageSize' | 'currentPage' | 'totalPages'> {\n return {\n pageSize: pageInfo.page_size,\n currentPage: pageInfo.current_page,\n totalPages: pageInfo.total_pages,\n };\n}\n","import { DaffSortDirectionEnum } from '@daffodil/core';\n\nimport { MagentoSortEnum } from '../../models/public_api';\n\nconst map = <const>{\n [MagentoSortEnum.ASC]: DaffSortDirectionEnum.Ascending,\n [MagentoSortEnum.DESC]: DaffSortDirectionEnum.Descending,\n};\n\nexport function magentoSortDirectionResponseTransform(direction: MagentoSortEnum): DaffSortDirectionEnum {\n return map[direction];\n}\n","import { DaffSortDirectionEnum } from '@daffodil/core';\n\nimport { MagentoSortEnum } from '../../models/public_api';\n\nconst map = <const>{\n [DaffSortDirectionEnum.Ascending]: MagentoSortEnum.ASC,\n [DaffSortDirectionEnum.Descending]: MagentoSortEnum.DESC,\n};\n\nexport function magentoSortDirectionRequestTransform(direction: DaffSortDirectionEnum): MagentoSortEnum {\n return map[direction];\n}\n","import { gql } from 'apollo-angular';\n\nexport const magentoSearchResultPageInfoFragment = gql`\n fragment magentoSearchResultPageInfo on SearchResultPageInfo {\n page_size\n current_page\n total_pages\n }\n`;\n","import { gql } from 'apollo-angular';\n\nexport const magentoMoneyFragment = gql`\n fragment moneyFragment on Money {\n value\n currency\n }\n`;\n","import { NgModule } from '@angular/core';\n\nimport { provideDaffDriverHttpClientCacheService } from '@daffodil/driver';\n\nimport { DaffDriverHttpClientCacheMagentoService } from './graphql/cache.service';\n\n@NgModule({\n providers: [\n provideDaffDriverHttpClientCacheService(DaffDriverHttpClientCacheMagentoService),\n ],\n})\nexport class DaffDriverMagentoModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEO,MAAM,MAAM,GAAG;;ACGf,MAAM,8BAA8B,GAAG;AAE9C;;AAEG;AACG,MAAO,sBAAuB,SA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or() {
|
|
9
|
-
this.id = shopifyIdTransformer(`${faker.
|
|
10
|
-
this.url = faker.image.
|
|
11
|
-
this.altText = faker.
|
|
9
|
+
this.id = shopifyIdTransformer(`${faker.number.int({ min: 10000000000 })}`, 'ProductImage');
|
|
10
|
+
this.url = faker.image.url();
|
|
11
|
+
this.altText = faker.lorem.words(5);
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
class ShopifyProductImageNodeFactory extends DaffModelFactory {
|
|
15
15
|
constructor() {
|
|
16
16
|
super(MockShopifyProductImageNode);
|
|
17
17
|
}
|
|
18
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
19
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
|
18
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: ShopifyProductImageNodeFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
19
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: ShopifyProductImageNodeFactory, providedIn: 'root' }); }
|
|
20
20
|
}
|
|
21
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
21
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: ShopifyProductImageNodeFactory, decorators: [{
|
|
22
22
|
type: Injectable,
|
|
23
23
|
args: [{
|
|
24
24
|
providedIn: 'root',
|
|
@@ -35,10 +35,10 @@ class ShopifyProductImagesFactory extends DaffModelFactory {
|
|
|
35
35
|
constructor(shopifyProductImageNodeFactory) {
|
|
36
36
|
super(MockShopifyProductImages, shopifyProductImageNodeFactory);
|
|
37
37
|
}
|
|
38
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
39
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
|
38
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: ShopifyProductImagesFactory, deps: [{ token: ShopifyProductImageNodeFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
39
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: ShopifyProductImagesFactory, providedIn: 'root' }); }
|
|
40
40
|
}
|
|
41
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
41
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: ShopifyProductImagesFactory, decorators: [{
|
|
42
42
|
type: Injectable,
|
|
43
43
|
args: [{
|
|
44
44
|
providedIn: 'root',
|
|
@@ -55,10 +55,10 @@ class ShopifyMoneyFactory extends DaffModelFactory {
|
|
|
55
55
|
constructor() {
|
|
56
56
|
super(MockShopifyMoney);
|
|
57
57
|
}
|
|
58
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
59
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
|
58
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: ShopifyMoneyFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
59
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: ShopifyMoneyFactory, providedIn: 'root' }); }
|
|
60
60
|
}
|
|
61
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
61
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: ShopifyMoneyFactory, decorators: [{
|
|
62
62
|
type: Injectable,
|
|
63
63
|
args: [{
|
|
64
64
|
providedIn: 'root',
|
|
@@ -76,10 +76,10 @@ class ShopifyProductPriceRangeFactory extends DaffModelFactory {
|
|
|
76
76
|
constructor(shopifyMoneyFactory) {
|
|
77
77
|
super(MockShopifyProductPriceRange, shopifyMoneyFactory);
|
|
78
78
|
}
|
|
79
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
80
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
|
79
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: ShopifyProductPriceRangeFactory, deps: [{ token: ShopifyMoneyFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
80
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: ShopifyProductPriceRangeFactory, providedIn: 'root' }); }
|
|
81
81
|
}
|
|
82
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
82
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: ShopifyProductPriceRangeFactory, decorators: [{
|
|
83
83
|
type: Injectable,
|
|
84
84
|
args: [{
|
|
85
85
|
providedIn: 'root',
|
|
@@ -92,7 +92,7 @@ class MockShopifyProductNode {
|
|
|
92
92
|
this.shopifyProductImagesFactory = shopifyProductImagesFactory;
|
|
93
93
|
this.title = faker.commerce.productName();
|
|
94
94
|
this.handle = shopifyHandleTransformer(faker.commerce.productName());
|
|
95
|
-
this.id = shopifyIdTransformer(`${faker.
|
|
95
|
+
this.id = shopifyIdTransformer(`${faker.number.int({ min: 100000000000 })}`, 'Product');
|
|
96
96
|
this.description = faker.commerce.productDescription();
|
|
97
97
|
this.onlineStoreUrl = faker.internet.domainName();
|
|
98
98
|
this.availableForSale = faker.datatype.boolean();
|
|
@@ -104,10 +104,10 @@ class ShopifyProductNodeFactory extends DaffModelFactory {
|
|
|
104
104
|
constructor(shopifyProductPriceRangeFactory, shopifyProductImagesFactory) {
|
|
105
105
|
super(MockShopifyProductNode, shopifyProductPriceRangeFactory, shopifyProductImagesFactory);
|
|
106
106
|
}
|
|
107
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
108
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
|
107
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: ShopifyProductNodeFactory, deps: [{ token: ShopifyProductPriceRangeFactory }, { token: ShopifyProductImagesFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
108
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: ShopifyProductNodeFactory, providedIn: 'root' }); }
|
|
109
109
|
}
|
|
110
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
110
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: ShopifyProductNodeFactory, decorators: [{
|
|
111
111
|
type: Injectable,
|
|
112
112
|
args: [{
|
|
113
113
|
providedIn: 'root',
|
|
@@ -124,10 +124,10 @@ class ShopifyProductGraphFactory extends DaffModelFactory {
|
|
|
124
124
|
constructor(shopifyProductNodeFactory) {
|
|
125
125
|
super(MockShopifyProductGraph, shopifyProductNodeFactory);
|
|
126
126
|
}
|
|
127
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
128
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
|
127
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: ShopifyProductGraphFactory, deps: [{ token: ShopifyProductNodeFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
128
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: ShopifyProductGraphFactory, providedIn: 'root' }); }
|
|
129
129
|
}
|
|
130
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
130
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: ShopifyProductGraphFactory, decorators: [{
|
|
131
131
|
type: Injectable,
|
|
132
132
|
args: [{
|
|
133
133
|
providedIn: 'root',
|