@daffodil/driver 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.
- package/fesm2022/daffodil-driver-hubspot-testing.mjs +3 -3
- package/fesm2022/daffodil-driver-hubspot-testing.mjs.map +1 -1
- package/fesm2022/daffodil-driver-in-memory.mjs +7 -7
- package/fesm2022/daffodil-driver-in-memory.mjs.map +1 -1
- package/fesm2022/daffodil-driver-magento-testing.mjs +9 -9
- package/fesm2022/daffodil-driver-magento-testing.mjs.map +1 -1
- package/fesm2022/daffodil-driver-magento.mjs +86 -88
- package/fesm2022/daffodil-driver-magento.mjs.map +1 -1
- package/fesm2022/daffodil-driver-shopify-testing.mjs +85 -59
- package/fesm2022/daffodil-driver-shopify-testing.mjs.map +1 -1
- package/fesm2022/daffodil-driver-shopify.mjs +383 -242
- 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/magento/index.d.ts +20 -26
- package/package.json +1 -1
- package/shopify/index.d.ts +2933 -1530
- package/shopify/testing/index.d.ts +55 -29
|
@@ -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: "20.3.
|
|
27
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
26
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffHubspotResponseFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
27
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffHubspotResponseFactory, providedIn: 'root' }); }
|
|
28
28
|
}
|
|
29
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
29
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", 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.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,IAAA,CAAA,MAAM,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;IAC7F;AAAC;AAED;;;;AAIG;AAIG,MAAO,0BAA2B,SAAQ,gBAAiC,CAAA;AAC/E,IAAA,WAAA,GAAA;QACE,KAAK,CAAC,mBAAmB,CAAC;IAC5B
|
|
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,OAA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|
|
80
80
|
}
|
|
81
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
82
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
81
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffInMemoryRootBackend, deps: [{ token: DAFF_IN_MEMORY_BACKENDS }, { token: DAFF_IN_MEMORY_DRIVER_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
82
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffInMemoryRootBackend, providedIn: 'root' }); }
|
|
83
83
|
}
|
|
84
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
84
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffInMemoryRootBackend, decorators: [{
|
|
85
85
|
type: Injectable,
|
|
86
86
|
args: [{
|
|
87
87
|
providedIn: 'root',
|
|
@@ -133,11 +133,11 @@ class DaffInMemoryDriverModule {
|
|
|
133
133
|
],
|
|
134
134
|
};
|
|
135
135
|
}
|
|
136
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
137
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.
|
|
138
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.
|
|
136
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffInMemoryDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
137
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.18", ngImport: i0, type: DaffInMemoryDriverModule }); }
|
|
138
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffInMemoryDriverModule }); }
|
|
139
139
|
}
|
|
140
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
140
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffInMemoryDriverModule, decorators: [{
|
|
141
141
|
type: NgModule
|
|
142
142
|
}] });
|
|
143
143
|
|
|
@@ -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/provider.ts","../../../libs/driver/in-memory/src/routing/provider.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';\nimport { DaffInMemoryDriverConfig } from '../public_api';\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\n constructor(\n protected backends: Array<DaffInMemoryRouteableBackend>,\n protected config: DaffInMemoryDriverConfig,\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\n if(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 return request.call(backend, reqInfo);\n }\n\n if(!this.config.passThroughUnknownRequests) {\n return 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 return undefined;\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';\nimport {\n DAFF_IN_MEMORY_DRIVER_CONFIG,\n DaffInMemoryDriverConfig,\n} from '../public_api';\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 @Inject(DAFF_IN_MEMORY_DRIVER_CONFIG) private _config: DaffInMemoryDriverConfig,\n ) {\n super(_backends, _config);\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 passThroughUnknownRequests: false,\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","import {\n EnvironmentProviders,\n importProvidersFrom,\n makeEnvironmentProviders,\n Type,\n} from '@angular/core';\nimport { HttpClientInMemoryWebApiModule } from 'angular-in-memory-web-api';\n\nimport {\n DAFF_IN_MEMORY_DRIVER_CONFIG_DEFAULT,\n DaffInMemoryBackendInterface,\n DaffInMemoryDriverConfig,\n DaffInMemoryRootBackend,\n provideDaffInMemoryBackends,\n provideDaffInMemoryDriverConfig,\n} from './public_api';\n\n/**\n * Configures the Angular in-memory web API with Daffodil backend services.\n *\n * @example\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideDaffInMemoryDriver(\n * { delay: 300 },\n * DaffProductInMemoryBackendService,\n * DaffCartInMemoryBackendService\n * )\n * ]\n * });\n * ```\n */\nexport const provideDaffInMemoryDriver = (config: DaffInMemoryDriverConfig = DAFF_IN_MEMORY_DRIVER_CONFIG_DEFAULT, ...backends: Array<Type<DaffInMemoryBackendInterface>>): EnvironmentProviders[] => {\n config = { ...DAFF_IN_MEMORY_DRIVER_CONFIG_DEFAULT,...config };\n return [\n importProvidersFrom(HttpClientInMemoryWebApiModule.forRoot(DaffInMemoryRootBackend, { ...config, passThruUnknownUrl: config.passThroughUnknownRequests })),\n makeEnvironmentProviders([\n provideDaffInMemoryDriverConfig(config),\n provideDaffInMemoryBackends(...backends),\n ]),\n ];\n};\n","import {\n EnvironmentProviders,\n inject,\n InjectionToken,\n makeEnvironmentProviders,\n} from '@angular/core';\n\nimport {\n DaffInMemoryRoutableObject,\n DaffInMemoryRoutableObjects,\n} from './routable-object';\n\n/**\n * A function that returns an array of entities with URL properties.\n * Used to provide routable in-memory object information to the routing system.\n */\nexport type DaffInMemoryRoutableObjectsResolver = () => Array<{ url: string }>;\n\n/**\n * Multi-injection token for routable object resolvers.\n *\n * Each in-memory driver (e.g., product, navigation) can register a resolver\n * that provides its entities with URL properties. This token collects all\n * such resolvers so they can be processed together to build the routing map.\n *\n * @docs-private\n */\nconst DAFF_INMEMORY_ROUTABLE_OBJECTS_RESOLVER = new InjectionToken<{ type: string; resolver: DaffInMemoryRoutableObjectsResolver }[]>(\n 'DAFF_INMEMORY_ROUTABLE_OBJECTS_RESOLVER', {\n providedIn: 'root',\n factory: () => [],\n },\n);\n\n/**\n * Internal injection token that builds and provides the complete map of routable objects.\n *\n * This token automatically collects all registered routable object resolvers and builds\n * a Map where the key is the URL path and the value is an object containing both the URL\n * and its associated type. This map is used by in-memory drivers to resolve URLs to their types.\n *\n * @docs-private\n */\nexport const DAFF_INMEMORY_ROUTABLE_OBJECTS = new InjectionToken<DaffInMemoryRoutableObjects>(\n 'DAFF_INMEMORY_ROUTABLE_OBJECTS',\n {\n providedIn: 'root',\n factory: () => {\n const resolvers = inject(DAFF_INMEMORY_ROUTABLE_OBJECTS_RESOLVER, { optional: true }) || [];\n const map = new Map<string, DaffInMemoryRoutableObject>();\n\n if (!Array.isArray(resolvers)) {\n throw new Error('DAFF_INMEMORY_ROUTABLE_OBJECTS_RESOLVER must be an array');\n }\n\n resolvers.forEach((entry) => {\n const entities = entry.resolver();\n entities.forEach(entity => {\n if (map.has(entity.url)) {\n const existing = map.get(entity.url);\n console.warn(\n `[@daffodil/driver/in-memory] Duplicate entity URL detected: \"${entity.url}\". ` +\n `Already registered with type \"${existing?.type}\", attempting to register again with type \"${entry.type}\". ` +\n `The first registration will be used.`,\n );\n return;\n }\n map.set(entity.url, { url: entity.url, type: entry.type });\n });\n });\n\n return map;\n },\n },\n);\n\n/**\n * Registers routable objects from an in-memory driver with the routing system.\n *\n * This function allows in-memory drivers to provide their entities (with URL properties)\n * to enable automatic URL resolution. Each driver provides a resolver function that\n * returns its entities with URL properties, along with a type identifier.\n *\n * The resolver function runs in an injection context, which means you can use Angular's\n * `inject()` function within it to access services and dependencies.\n *\n * @param type - The type identifier for these routable objects (e.g., \"PRODUCTS\")\n * @param resolver - A function that returns an array of entities with URL properties.\n * This function runs in an injection context, allowing use of `inject()`.\n * @returns Environment providers that register the routable objects\n *\n * @usageNotes\n *\n * ### Basic Usage\n *\n * In your driver package, create a resolver function:\n *\n * ```typescript\n * const productResolver = (): Array<{ url: string }> => {\n * return inject(DaffInMemoryBackendProductService).products.map((p) => ({ url: p.url }));\n * };\n * ```\n *\n * Then in your app configuration:\n *\n * ```typescript\n * export const appConfig: ApplicationConfig = {\n * providers: [\n * provideDaffInMemoryRoutableObjects(\"PRODUCTS\", productResolver),\n * ]\n * };\n * ```\n */\nexport const provideDaffInMemoryRoutableObjects = (\n type: string,\n resolver: DaffInMemoryRoutableObjectsResolver,\n): EnvironmentProviders => makeEnvironmentProviders([\n {\n provide: DAFF_INMEMORY_ROUTABLE_OBJECTS_RESOLVER,\n useValue: { type, resolver },\n multi: true,\n },\n]);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAIO,MAAM;AACX;;AAEG;AACH,KAAK,EAAE,uBAAuB;AAC9B;;AAEG;AACH,QAAQ,EAAE,2BAA2B,GACtC,GAAG,4BAA4B,CAA+B,yBAAyB;;ACHxF,IAAK,MAKJ;AALD,CAAA,UAAK,MAAM,EAAA;A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AI;AAC1B,YAAA,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,EAAE;AACjC,YAAA,QAAQ,CAAC,OAAO,CAAC,MAAM,IAAG;gBACxB,IAAI,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;oBACvB,MAAM,QAAQ,GAAG,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC;AACpC,oBAAA,OAAO,CAAC,IAAI,CACV,gEAAgE,MAAM,CAAC,GAAG,CAAA,GAAA,CAAK;AAC/E,wBAAA,CAAA,8BAAA,EAAiC,QAAQ,EAAE,IAAI,8CAA8C,KAAK,CAAC,IAAI,CAAA,GAAA,CAAK;AAC5G,wBAAA,CAAA,oCAAA,CAAsC,CACvC;oBACD;gBACF;gBACA,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC;AAC5D,YAAA,CAAC,CAAC;AACJ,QAAA,CAAC,CAAC;AAEF,QAAA,OAAO,GAAG;IACZ,CAAC;AACF,CAAA;AAGH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCG;AACI,MAAM,kCAAkC,GAAG,CAChD,IAAY,EACZ,QAA6C,KACpB,wBAAwB,CAAC;AAClD,IAAA;AACE,QAAA,OAAO,EAAE,uCAAuC;AAChD,QAAA,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;AAC5B,QAAA,KAAK,EAAE,IAAI;AACZ,KAAA;AACF,CAAA;;AC1HD;;AAEG;;;;"}
|
|
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/provider.ts","../../../libs/driver/in-memory/src/routing/provider.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';\nimport { DaffInMemoryDriverConfig } from '../public_api';\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\n constructor(\n protected backends: Array<DaffInMemoryRouteableBackend>,\n protected config: DaffInMemoryDriverConfig,\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\n if(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 return request.call(backend, reqInfo);\n }\n\n if(!this.config.passThroughUnknownRequests) {\n return 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 return undefined;\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';\nimport {\n DAFF_IN_MEMORY_DRIVER_CONFIG,\n DaffInMemoryDriverConfig,\n} from '../public_api';\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 @Inject(DAFF_IN_MEMORY_DRIVER_CONFIG) private _config: DaffInMemoryDriverConfig,\n ) {\n super(_backends, _config);\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 passThroughUnknownRequests: false,\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","import {\n EnvironmentProviders,\n importProvidersFrom,\n makeEnvironmentProviders,\n Type,\n} from '@angular/core';\nimport { HttpClientInMemoryWebApiModule } from 'angular-in-memory-web-api';\n\nimport {\n DAFF_IN_MEMORY_DRIVER_CONFIG_DEFAULT,\n DaffInMemoryBackendInterface,\n DaffInMemoryDriverConfig,\n DaffInMemoryRootBackend,\n provideDaffInMemoryBackends,\n provideDaffInMemoryDriverConfig,\n} from './public_api';\n\n/**\n * Configures the Angular in-memory web API with Daffodil backend services.\n *\n * @example\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideDaffInMemoryDriver(\n * { delay: 300 },\n * DaffProductInMemoryBackendService,\n * DaffCartInMemoryBackendService\n * )\n * ]\n * });\n * ```\n */\nexport const provideDaffInMemoryDriver = (config: DaffInMemoryDriverConfig = DAFF_IN_MEMORY_DRIVER_CONFIG_DEFAULT, ...backends: Array<Type<DaffInMemoryBackendInterface>>): EnvironmentProviders[] => {\n config = { ...DAFF_IN_MEMORY_DRIVER_CONFIG_DEFAULT,...config };\n return [\n importProvidersFrom(HttpClientInMemoryWebApiModule.forRoot(DaffInMemoryRootBackend, { ...config, passThruUnknownUrl: config.passThroughUnknownRequests })),\n makeEnvironmentProviders([\n provideDaffInMemoryDriverConfig(config),\n provideDaffInMemoryBackends(...backends),\n ]),\n ];\n};\n","import {\n EnvironmentProviders,\n inject,\n InjectionToken,\n makeEnvironmentProviders,\n} from '@angular/core';\n\nimport {\n DaffInMemoryRoutableObject,\n DaffInMemoryRoutableObjects,\n} from './routable-object';\n\n/**\n * A function that returns an array of entities with URL properties.\n * Used to provide routable in-memory object information to the routing system.\n */\nexport type DaffInMemoryRoutableObjectsResolver = () => Array<{ url: string }>;\n\n/**\n * Multi-injection token for routable object resolvers.\n *\n * Each in-memory driver (e.g., product, navigation) can register a resolver\n * that provides its entities with URL properties. This token collects all\n * such resolvers so they can be processed together to build the routing map.\n *\n * @docs-private\n */\nconst DAFF_INMEMORY_ROUTABLE_OBJECTS_RESOLVER = new InjectionToken<{ type: string; resolver: DaffInMemoryRoutableObjectsResolver }[]>(\n 'DAFF_INMEMORY_ROUTABLE_OBJECTS_RESOLVER', {\n providedIn: 'root',\n factory: () => [],\n },\n);\n\n/**\n * Internal injection token that builds and provides the complete map of routable objects.\n *\n * This token automatically collects all registered routable object resolvers and builds\n * a Map where the key is the URL path and the value is an object containing both the URL\n * and its associated type. This map is used by in-memory drivers to resolve URLs to their types.\n *\n * @docs-private\n */\nexport const DAFF_INMEMORY_ROUTABLE_OBJECTS = new InjectionToken<DaffInMemoryRoutableObjects>(\n 'DAFF_INMEMORY_ROUTABLE_OBJECTS',\n {\n providedIn: 'root',\n factory: () => {\n const resolvers = inject(DAFF_INMEMORY_ROUTABLE_OBJECTS_RESOLVER, { optional: true }) || [];\n const map = new Map<string, DaffInMemoryRoutableObject>();\n\n if (!Array.isArray(resolvers)) {\n throw new Error('DAFF_INMEMORY_ROUTABLE_OBJECTS_RESOLVER must be an array');\n }\n\n resolvers.forEach((entry) => {\n const entities = entry.resolver();\n entities.forEach(entity => {\n if (map.has(entity.url)) {\n const existing = map.get(entity.url);\n console.warn(\n `[@daffodil/driver/in-memory] Duplicate entity URL detected: \"${entity.url}\". ` +\n `Already registered with type \"${existing?.type}\", attempting to register again with type \"${entry.type}\". ` +\n `The first registration will be used.`,\n );\n return;\n }\n map.set(entity.url, { url: entity.url, type: entry.type });\n });\n });\n\n return map;\n },\n },\n);\n\n/**\n * Registers routable objects from an in-memory driver with the routing system.\n *\n * This function allows in-memory drivers to provide their entities (with URL properties)\n * to enable automatic URL resolution. Each driver provides a resolver function that\n * returns its entities with URL properties, along with a type identifier.\n *\n * The resolver function runs in an injection context, which means you can use Angular's\n * `inject()` function within it to access services and dependencies.\n *\n * @param type - The type identifier for these routable objects (e.g., \"PRODUCTS\")\n * @param resolver - A function that returns an array of entities with URL properties.\n * This function runs in an injection context, allowing use of `inject()`.\n * @returns Environment providers that register the routable objects\n *\n * @usageNotes\n *\n * ### Basic Usage\n *\n * In your driver package, create a resolver function:\n *\n * ```typescript\n * const productResolver = (): Array<{ url: string }> => {\n * return inject(DaffInMemoryBackendProductService).products.map((p) => ({ url: p.url }));\n * };\n * ```\n *\n * Then in your app configuration:\n *\n * ```typescript\n * export const appConfig: ApplicationConfig = {\n * providers: [\n * provideDaffInMemoryRoutableObjects(\"PRODUCTS\", productResolver),\n * ]\n * };\n * ```\n */\nexport const provideDaffInMemoryRoutableObjects = (\n type: string,\n resolver: DaffInMemoryRoutableObjectsResolver,\n): EnvironmentProviders => makeEnvironmentProviders([\n {\n provide: DAFF_INMEMORY_ROUTABLE_OBJECTS_RESOLVER,\n useValue: { type, resolver },\n multi: true,\n },\n]);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAIO,MAAM;AACX;;AAEG;AACH,KAAK,EAAE,uBAAuB;AAC9B;;AAEG;AACH,QAAQ,EAAE,2BAA2B,GACtC,GAAG,4BAA4B,CAA+B,yBAAyB;;ACHxF,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,GAAA,EAAA,CAAA,CAAA;AAOX;;;;AAIG;MACU,2BAA2B,CAAA;IAEtC,WAAA,CACY,QAA6C,EAC7C,MAAgC,EAAA;QADhC,IAAA,CAAA,QAAQ,GAAR,QAAQ;QACR,IAAA,CAAA,MAAM,GAAN,MAAM;IACf;IAEO,eAAe,CAAC,OAAoB,EAAE,MAAc,EAAA;AAC5D,QAAA,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,gBAAgB,IAAI,CAAC,GAAG,CAAC,CAAC,cAAc,KAA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AI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC;AAC5D,YAAA,CAAC,CAAC;AACJ,QAAA,CAAC,CAAC;AAEF,QAAA,OAAO,GAAG;IACZ,CAAC;AACF,CAAA;AAGH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCG;AACI,MAAM,kCAAkC,GAAG,CAChD,IAAY,EACZ,QAA6C,KACpB,wBAAwB,CAAC;AAClD,IAAA;AACE,QAAA,OAAO,EAAE,uCAAuC;AAChD,QAAA,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;AAC5B,QAAA,KAAK,EAAE,IAAI;AACZ,KAAA;AACF,CAAA;;AC1HD;;AAEG;;;;"}
|
|
@@ -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: "20.3.
|
|
19
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
18
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MagentoMoneyFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
19
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MagentoMoneyFactory, providedIn: 'root' }); }
|
|
20
20
|
}
|
|
21
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
21
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MagentoMoneyFactory, decorators: [{
|
|
22
22
|
type: Injectable,
|
|
23
23
|
args: [{
|
|
24
24
|
providedIn: 'root',
|
|
@@ -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: "20.3.
|
|
44
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
43
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MagentoDiscountFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
44
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MagentoDiscountFactory, providedIn: 'root' }); }
|
|
45
45
|
}
|
|
46
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
46
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MagentoDiscountFactory, decorators: [{
|
|
47
47
|
type: Injectable,
|
|
48
48
|
args: [{
|
|
49
49
|
providedIn: 'root',
|
|
@@ -61,10 +61,10 @@ class MagentoSearchResultPageInfoFactory extends DaffModelFactory {
|
|
|
61
61
|
constructor() {
|
|
62
62
|
super(MockMagentoSearchResultPageInfo);
|
|
63
63
|
}
|
|
64
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
65
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
64
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MagentoSearchResultPageInfoFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
65
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MagentoSearchResultPageInfoFactory, providedIn: 'root' }); }
|
|
66
66
|
}
|
|
67
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
67
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", 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.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,IAAA,CAAA,UAAU,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;IACzC;AAAC;AAAA;AAKK,MAAO,mBAAoB,SAAQ,gBAA8B,CAAA;AACrE,IAAA,WAAA,GAAA;QACE,KAAK,CAAC,gBAAgB,CAAC;IACzB
|
|
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,IAAA,CAAA,UAAU,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;IACzC;AAAC;AAAA;AAKK,MAAO,m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AA,CAAA,CAAA;;4FAEP,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAHlC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACjBD,MAAM,+BAA+B,CAAA;AAArC,IAAA,WAAA,GAAA;QACE,IAAA,CAAA,YAAY,GAAI,CAAC;QACjB,IAAA,CAAA,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC;QACjC,IAAA,CAAA,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC;IACrC;AAAC;AAKK,MAAO,kCAAmC,SAAQ,gBAA6C,CAAA;AACnG,IAAA,WAAA,GAAA;QACE,KAAK,CAAC,+BAA+B,CAAC;IACxC;+GAHW,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,12 +1,13 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import { InMemoryCache, from
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { makeEnvironmentProviders, inject, Inject, Injectable, PLATFORM_ID, provideAppInitializer, TransferState, InjectionToken } from '@angular/core';
|
|
3
|
+
import { ApolloLink, InMemoryCache, from } from '@apollo/client/core';
|
|
4
|
+
import { onError } from '@apollo/client/link/error';
|
|
5
|
+
import { Apollo, provideApollo, gql } from 'apollo-angular';
|
|
6
6
|
import { HttpLink } from 'apollo-angular/http';
|
|
7
|
-
import {
|
|
7
|
+
import { provideDaffApolloRequestHandlerFactories, DAFF_APOLLO_REQUEST_HANDLERS } from '@daffodil/core/graphql';
|
|
8
|
+
import { provideDaffDriverHttpClientCacheService, DaffDriverNetworkError } from '@daffodil/driver';
|
|
8
9
|
import { createSingleInjectionToken, createMultiInjectionToken, DaffInheritableError, daffIsError, DaffSortDirectionEnum } from '@daffodil/core';
|
|
9
|
-
import {
|
|
10
|
+
import { isPlatformBrowser } from '@angular/common';
|
|
10
11
|
|
|
11
12
|
var possibleTypes = {
|
|
12
13
|
AggregationOptionInterface: [
|
|
@@ -145,17 +146,6 @@ var introspectionQueryResultData = {
|
|
|
145
146
|
|
|
146
147
|
const MAGENTO_POSSIBLE_TYPES = introspectionQueryResultData;
|
|
147
148
|
|
|
148
|
-
/**
|
|
149
|
-
* Creates an Apollo HTTP link for GraphQL requests.
|
|
150
|
-
*
|
|
151
|
-
* @param url - The Shopify Storefront API endpoint URL for GraphQL requests.
|
|
152
|
-
* @returns An ApolloLink instance configured with the provided URL.
|
|
153
|
-
*/
|
|
154
|
-
function createHttpLink(url) {
|
|
155
|
-
const httpLink = inject(HttpLink);
|
|
156
|
-
return httpLink.create({ uri: url });
|
|
157
|
-
}
|
|
158
|
-
|
|
159
149
|
/**
|
|
160
150
|
* Custom type policies that allow us to have more granular control
|
|
161
151
|
* over how ApolloClient reads from and writes to the cache.
|
|
@@ -451,55 +441,6 @@ const typePolicies = {
|
|
|
451
441
|
},
|
|
452
442
|
};
|
|
453
443
|
|
|
454
|
-
/**
|
|
455
|
-
* Interacts with the Apollo client.
|
|
456
|
-
*
|
|
457
|
-
* @inheritdoc
|
|
458
|
-
*/
|
|
459
|
-
class DaffDriverHttpClientCacheMagentoService {
|
|
460
|
-
constructor(platformId) {
|
|
461
|
-
this.platformId = platformId;
|
|
462
|
-
}
|
|
463
|
-
reset() {
|
|
464
|
-
if (isPlatformBrowser(this.platformId)) {
|
|
465
|
-
location.reload();
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffDriverHttpClientCacheMagentoService, deps: [{ token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
469
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffDriverHttpClientCacheMagentoService, providedIn: 'root' }); }
|
|
470
|
-
}
|
|
471
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffDriverHttpClientCacheMagentoService, decorators: [{
|
|
472
|
-
type: Injectable,
|
|
473
|
-
args: [{
|
|
474
|
-
providedIn: 'root',
|
|
475
|
-
}]
|
|
476
|
-
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
477
|
-
type: Inject,
|
|
478
|
-
args: [PLATFORM_ID]
|
|
479
|
-
}] }] });
|
|
480
|
-
|
|
481
|
-
/**
|
|
482
|
-
* Sets up the Magento Daffodil driver configuration for Magento's GraphQl API.
|
|
483
|
-
*
|
|
484
|
-
* Under the hood, this creates an Apollo Client configuration.
|
|
485
|
-
*
|
|
486
|
-
* @param endpoint - The Magento store domain (e.g. "https://www.my-store.com/graphql") or an injection token for a string or function that returns a string
|
|
487
|
-
*/
|
|
488
|
-
function provideMagentoDriver(endpoint, options = {
|
|
489
|
-
possibleTypes: MAGENTO_POSSIBLE_TYPES.possibleTypes,
|
|
490
|
-
typePolicies,
|
|
491
|
-
}) {
|
|
492
|
-
return [
|
|
493
|
-
provideApollo(() => ({
|
|
494
|
-
link: from([
|
|
495
|
-
createHttpLink(typeof endpoint === 'string' ? endpoint : inject(endpoint)),
|
|
496
|
-
]),
|
|
497
|
-
cache: new InMemoryCache({ typePolicies: options.typePolicies, possibleTypes: options.possibleTypes }),
|
|
498
|
-
})),
|
|
499
|
-
provideDaffDriverHttpClientCacheService(DaffDriverHttpClientCacheMagentoService),
|
|
500
|
-
];
|
|
501
|
-
}
|
|
502
|
-
|
|
503
444
|
/**
|
|
504
445
|
* A non-exhaustive list of feature kinds that exist for {@link provideMagentoDriver}.
|
|
505
446
|
*/
|
|
@@ -527,7 +468,11 @@ token: DAFF_DRIVER_MAGENTO_EXTRA_APOLLO_OPTIONS,
|
|
|
527
468
|
/**
|
|
528
469
|
* A provider for {@link DAFF_DRIVER_MAGENTO_EXTRA_APOLLO_OPTIONS}.
|
|
529
470
|
*/
|
|
530
|
-
provider: provideDaffDriverMagentoExtraApolloOptions,
|
|
471
|
+
provider: provideDaffDriverMagentoExtraApolloOptions,
|
|
472
|
+
/**
|
|
473
|
+
* A factory provider for {@link DAFF_DRIVER_MAGENTO_EXTRA_APOLLO_OPTIONS}.
|
|
474
|
+
*/
|
|
475
|
+
factoryProvider: provideDaffDriverMagentoExtraApolloOptionsFactory, } = createSingleInjectionToken('DAFF_DRIVER_MAGENTO_EXTRA_APOLLO_OPTIONS', {
|
|
531
476
|
factory: () => ({}),
|
|
532
477
|
});
|
|
533
478
|
/**
|
|
@@ -592,10 +537,10 @@ class DaffMagentoApolloCacheableOperationsLinkGenerator {
|
|
|
592
537
|
return forward(operation);
|
|
593
538
|
});
|
|
594
539
|
}
|
|
595
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
596
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
540
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffMagentoApolloCacheableOperationsLinkGenerator, deps: [{ token: DAFF_MAGENTO_CACHEABLE_OPERATIONS }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
541
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffMagentoApolloCacheableOperationsLinkGenerator, providedIn: 'root' }); }
|
|
597
542
|
}
|
|
598
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
543
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffMagentoApolloCacheableOperationsLinkGenerator, decorators: [{
|
|
599
544
|
type: Injectable,
|
|
600
545
|
args: [{
|
|
601
546
|
providedIn: 'root',
|
|
@@ -831,6 +776,33 @@ const DAFF_MAGENTO_2_4_3_TYPE_POLICIES = {
|
|
|
831
776
|
},
|
|
832
777
|
};
|
|
833
778
|
|
|
779
|
+
/**
|
|
780
|
+
* Interacts with the Apollo client.
|
|
781
|
+
*
|
|
782
|
+
* @inheritdoc
|
|
783
|
+
*/
|
|
784
|
+
class DaffDriverHttpClientCacheMagentoService {
|
|
785
|
+
constructor(platformId) {
|
|
786
|
+
this.platformId = platformId;
|
|
787
|
+
}
|
|
788
|
+
reset() {
|
|
789
|
+
if (isPlatformBrowser(this.platformId)) {
|
|
790
|
+
location.reload();
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffDriverHttpClientCacheMagentoService, deps: [{ token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
794
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffDriverHttpClientCacheMagentoService, providedIn: 'root' }); }
|
|
795
|
+
}
|
|
796
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffDriverHttpClientCacheMagentoService, decorators: [{
|
|
797
|
+
type: Injectable,
|
|
798
|
+
args: [{
|
|
799
|
+
providedIn: 'root',
|
|
800
|
+
}]
|
|
801
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
802
|
+
type: Inject,
|
|
803
|
+
args: [PLATFORM_ID]
|
|
804
|
+
}] }] });
|
|
805
|
+
|
|
834
806
|
const MAGENTO_CUSTOMER_CACHE_ID_HEADER = 'X-Magento-Cache-Id';
|
|
835
807
|
/**
|
|
836
808
|
* Stores and sets the Magento cache ID header.
|
|
@@ -887,27 +859,20 @@ class DaffMagentoCacheHeaderApolloLinkGenerator {
|
|
|
887
859
|
});
|
|
888
860
|
});
|
|
889
861
|
}
|
|
890
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
891
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
862
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffMagentoCacheHeaderApolloLinkGenerator, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
863
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffMagentoCacheHeaderApolloLinkGenerator, providedIn: 'root' }); }
|
|
892
864
|
}
|
|
893
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
865
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffMagentoCacheHeaderApolloLinkGenerator, decorators: [{
|
|
894
866
|
type: Injectable,
|
|
895
867
|
args: [{
|
|
896
868
|
providedIn: 'root',
|
|
897
869
|
}]
|
|
898
870
|
}] });
|
|
899
871
|
|
|
900
|
-
/**
|
|
901
|
-
* A {@link provideMagentoDriver} feature that sets up {@link provideDaffMagentoCacheHeader}.
|
|
902
|
-
*/
|
|
903
|
-
const withDaffMagentoCacheHeader = () => makeMagentoDriverFeature(MagentoDriverFeatureKind.CacheHeader, [
|
|
904
|
-
provideDaffMagentoCacheHeader(),
|
|
905
|
-
]);
|
|
906
|
-
|
|
907
872
|
/**
|
|
908
873
|
* A {@link provideMagentoDriver} feature that sets up {@link provideDaffMagentoApolloCacheableOperations}.
|
|
909
874
|
*/
|
|
910
|
-
const
|
|
875
|
+
const withOperationCache = (...extraOperations) => makeMagentoDriverFeature(MagentoDriverFeatureKind.CacheableOperations, [
|
|
911
876
|
provideDaffMagentoApolloCacheableOperations(),
|
|
912
877
|
makeEnvironmentProviders(provideManyDaffMagentoCacheableOperations(...extraOperations)),
|
|
913
878
|
]);
|
|
@@ -958,27 +923,60 @@ const withDaffDriverMagentoTransferState = (stateKey) => makeMagentoDriverFeatur
|
|
|
958
923
|
* Holds the logic for hydrating the Apollo cache with the server's transferred state.
|
|
959
924
|
* It is recommended to use {@link withDaffDriverMagentoTransferState} with {@link provideMagentoDriver}
|
|
960
925
|
* to provide this functionality automatically.
|
|
961
|
-
*
|
|
962
|
-
* @param cache The Apollo cache instance.
|
|
963
926
|
*/
|
|
964
|
-
const provideDaffDriverMagentoTransferState = (
|
|
927
|
+
const provideDaffDriverMagentoTransferState = () => makeEnvironmentProviders([
|
|
965
928
|
provideAppInitializer(() => {
|
|
929
|
+
const cache = inject(Apollo).client.cache;
|
|
966
930
|
const transferState = inject(TransferState);
|
|
967
931
|
const stateKey = inject(DAFF_DRIVER_MAGENTO_TRANSFER_STATE_KEY);
|
|
968
932
|
const hasStateKey = transferState.hasKey(stateKey);
|
|
969
933
|
if (hasStateKey) {
|
|
970
|
-
// reads the serialized cache
|
|
971
934
|
const state = transferState.get(stateKey, null);
|
|
972
|
-
// and puts it in the Apollo
|
|
973
935
|
cache.restore(state);
|
|
974
936
|
}
|
|
975
937
|
else {
|
|
976
|
-
// serializes the cache and puts it under a key
|
|
977
938
|
transferState.onSerialize(stateKey, () => cache.extract());
|
|
978
939
|
}
|
|
979
940
|
}),
|
|
980
941
|
]);
|
|
981
942
|
|
|
943
|
+
/**
|
|
944
|
+
* Sets up the Magento Daffodil driver configuration for Magento's GraphQl API.
|
|
945
|
+
*
|
|
946
|
+
* Under the hood, this creates an Apollo Client configuration.
|
|
947
|
+
*
|
|
948
|
+
* @param endpoint - The Magento store domain (e.g. "https://www.my-store.com/graphql") or an injection token for a string or function that returns a string
|
|
949
|
+
*/
|
|
950
|
+
function provideMagentoDriver(options, ...features) {
|
|
951
|
+
const providers = [
|
|
952
|
+
...features.flatMap(({ ɵproviders }) => ɵproviders),
|
|
953
|
+
provideApollo(() => {
|
|
954
|
+
const opts = {
|
|
955
|
+
possibleTypes: MAGENTO_POSSIBLE_TYPES.possibleTypes,
|
|
956
|
+
typePolicies,
|
|
957
|
+
...(options instanceof InjectionToken ? inject(options) : options),
|
|
958
|
+
};
|
|
959
|
+
return {
|
|
960
|
+
...inject(DAFF_DRIVER_MAGENTO_EXTRA_APOLLO_OPTIONS),
|
|
961
|
+
link: from([
|
|
962
|
+
...inject(DAFF_APOLLO_REQUEST_HANDLERS),
|
|
963
|
+
onError(inject(DAFF_DRIVER_MAGENTO_ERROR_HANDLER)),
|
|
964
|
+
inject(HttpLink).create(opts),
|
|
965
|
+
]),
|
|
966
|
+
cache: new InMemoryCache({ typePolicies: opts.typePolicies, possibleTypes: opts.possibleTypes }),
|
|
967
|
+
};
|
|
968
|
+
}),
|
|
969
|
+
provideDaffDriverHttpClientCacheService(DaffDriverHttpClientCacheMagentoService),
|
|
970
|
+
// enable caching by default
|
|
971
|
+
provideDaffMagentoApolloCacheableOperations(),
|
|
972
|
+
provideDaffMagentoCacheHeader(),
|
|
973
|
+
];
|
|
974
|
+
if (features.find(({ ɵkind }) => ɵkind === MagentoDriverFeatureKind.TransferState)) {
|
|
975
|
+
providers.push(provideDaffDriverMagentoTransferState());
|
|
976
|
+
}
|
|
977
|
+
return makeEnvironmentProviders(providers);
|
|
978
|
+
}
|
|
979
|
+
|
|
982
980
|
const DAFF_DRIVER_MAGENTO_ERROR_CODE = 'DAFF_DRIVER_MAGENTO_ERROR';
|
|
983
981
|
/**
|
|
984
982
|
* A very general error thrown when a more specific error type cannot be determined.
|
|
@@ -1065,5 +1063,5 @@ const magentoMoneyFragment = gql `
|
|
|
1065
1063
|
* Generated bundle index. Do not edit.
|
|
1066
1064
|
*/
|
|
1067
1065
|
|
|
1068
|
-
export { DAFF_DRIVER_MAGENTO_ERROR_CODE, DAFF_DRIVER_MAGENTO_ERROR_HANDLER, DAFF_DRIVER_MAGENTO_EXTRA_APOLLO_OPTIONS, DAFF_DRIVER_MAGENTO_TRANSFER_STATE_KEY, DAFF_MAGENTO_2_4_3_TYPE_POLICIES, DAFF_MAGENTO_CACHEABLE_OPERATIONS, DaffDriverHttpClientCacheMagentoService, DaffDriverMagentoError, DaffMagentoApolloCacheableOperationsLinkGenerator, DaffMagentoCacheHeaderApolloLinkGenerator, MAGENTO_CUSTOMER_CACHE_ID_HEADER, MAGENTO_POSSIBLE_TYPES, MagentoDriverFeatureKind, MagentoSortEnum, daffMagentoTransformGraphQlError, daffTransformMagentoError, magentoMoneyFragment, magentoPageInfoTransform, magentoSearchResultPageInfoFragment, magentoSortDirectionRequestTransform, magentoSortDirectionResponseTransform, makeMagentoDriverFeature, provideDaffDriverMagentoErrorHandler, provideDaffDriverMagentoExtraApolloOptions, provideDaffDriverMagentoTransferState, provideDaffDriverMagentoTransferStateKey, provideDaffMagentoApolloCacheableOperations, provideDaffMagentoCacheHeader, provideDaffMagentoCacheableOperation, provideMagentoDriver, provideManyDaffMagentoCacheableOperations, MAGENTO_POSSIBLE_TYPES as schema, withDaffDriverMagentoErrorHandler, withDaffDriverMagentoExtraApolloOptions, withDaffDriverMagentoTransferState,
|
|
1066
|
+
export { DAFF_DRIVER_MAGENTO_ERROR_CODE, DAFF_DRIVER_MAGENTO_ERROR_HANDLER, DAFF_DRIVER_MAGENTO_EXTRA_APOLLO_OPTIONS, DAFF_DRIVER_MAGENTO_TRANSFER_STATE_KEY, DAFF_MAGENTO_2_4_3_TYPE_POLICIES, DAFF_MAGENTO_CACHEABLE_OPERATIONS, DaffDriverHttpClientCacheMagentoService, DaffDriverMagentoError, DaffMagentoApolloCacheableOperationsLinkGenerator, DaffMagentoCacheHeaderApolloLinkGenerator, MAGENTO_CUSTOMER_CACHE_ID_HEADER, MAGENTO_POSSIBLE_TYPES, MagentoDriverFeatureKind, MagentoSortEnum, daffMagentoTransformGraphQlError, daffTransformMagentoError, magentoMoneyFragment, magentoPageInfoTransform, magentoSearchResultPageInfoFragment, magentoSortDirectionRequestTransform, magentoSortDirectionResponseTransform, makeMagentoDriverFeature, provideDaffDriverMagentoErrorHandler, provideDaffDriverMagentoExtraApolloOptions, provideDaffDriverMagentoExtraApolloOptionsFactory, provideDaffDriverMagentoTransferState, provideDaffDriverMagentoTransferStateKey, provideDaffMagentoApolloCacheableOperations, provideDaffMagentoCacheHeader, provideDaffMagentoCacheableOperation, provideMagentoDriver, provideManyDaffMagentoCacheableOperations, MAGENTO_POSSIBLE_TYPES as schema, withDaffDriverMagentoErrorHandler, withDaffDriverMagentoExtraApolloOptions, withDaffDriverMagentoTransferState, withOperationCache };
|
|
1069
1067
|
//# sourceMappingURL=daffodil-driver-magento.mjs.map
|