@daffodil/product 0.92.3 → 0.93.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.
Files changed (30) hide show
  1. package/fesm2022/daffodil-product-driver-in-memory.mjs +10 -10
  2. package/fesm2022/daffodil-product-driver-in-memory.mjs.map +1 -1
  3. package/fesm2022/daffodil-product-driver-magento-testing.mjs +24 -24
  4. package/fesm2022/daffodil-product-driver-magento-testing.mjs.map +1 -1
  5. package/fesm2022/daffodil-product-driver-magento.mjs +33 -24
  6. package/fesm2022/daffodil-product-driver-magento.mjs.map +1 -1
  7. package/fesm2022/daffodil-product-driver-shopify.mjs +3 -3
  8. package/fesm2022/daffodil-product-driver-shopify.mjs.map +1 -1
  9. package/fesm2022/daffodil-product-driver-testing.mjs +7 -7
  10. package/fesm2022/daffodil-product-driver-testing.mjs.map +1 -1
  11. package/fesm2022/daffodil-product-routing.mjs +16 -16
  12. package/fesm2022/daffodil-product-routing.mjs.map +1 -1
  13. package/fesm2022/daffodil-product-state-testing.mjs +13 -13
  14. package/fesm2022/daffodil-product-state-testing.mjs.map +1 -1
  15. package/fesm2022/daffodil-product-state.mjs +24 -24
  16. package/fesm2022/daffodil-product-state.mjs.map +1 -1
  17. package/fesm2022/daffodil-product-testing.mjs +19 -19
  18. package/fesm2022/daffodil-product-testing.mjs.map +1 -1
  19. package/package.json +1 -1
  20. package/{driver/magento/index.d.ts → types/daffodil-product-driver-magento.d.ts} +20 -2
  21. package/{state/index.d.ts → types/daffodil-product-state.d.ts} +7 -6
  22. package/{testing/index.d.ts → types/daffodil-product-testing.d.ts} +1 -1
  23. /package/{driver/in-memory/index.d.ts → types/daffodil-product-driver-in-memory.d.ts} +0 -0
  24. /package/{driver/magento/testing/index.d.ts → types/daffodil-product-driver-magento-testing.d.ts} +0 -0
  25. /package/{driver/shopify/index.d.ts → types/daffodil-product-driver-shopify.d.ts} +0 -0
  26. /package/{driver/testing/index.d.ts → types/daffodil-product-driver-testing.d.ts} +0 -0
  27. /package/{driver/index.d.ts → types/daffodil-product-driver.d.ts} +0 -0
  28. /package/{routing/index.d.ts → types/daffodil-product-routing.d.ts} +0 -0
  29. /package/{state/testing/index.d.ts → types/daffodil-product-state-testing.d.ts} +0 -0
  30. /package/{index.d.ts → types/daffodil-product.d.ts} +0 -0
@@ -85,10 +85,10 @@ class DaffInMemoryBackendProductService {
85
85
  }
86
86
  return undefined;
87
87
  }
88
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffInMemoryBackendProductService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
89
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffInMemoryBackendProductService, providedIn: 'root' }); }
88
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffInMemoryBackendProductService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
89
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffInMemoryBackendProductService, providedIn: 'root' }); }
90
90
  }
91
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffInMemoryBackendProductService, decorators: [{
91
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffInMemoryBackendProductService, decorators: [{
92
92
  type: Injectable,
93
93
  args: [{
94
94
  providedIn: 'root',
@@ -156,10 +156,10 @@ class DaffInMemoryProductService extends DaffInMemoryDriverBase {
156
156
  getByUrl(url) {
157
157
  return this.http.get(`${this.url}/${daffUriTruncateLeadingSlash(url)}`).pipe(map(this.transform));
158
158
  }
159
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffInMemoryProductService, deps: [{ token: i1.HttpClient }, { token: InMemoryBackendConfig }, { token: DAFF_PRODUCT_IN_MEMORY_PRODUCT_RESPONSE_TRANSFORM }], target: i0.ɵɵFactoryTarget.Injectable }); }
160
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffInMemoryProductService }); }
159
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffInMemoryProductService, deps: [{ token: i1.HttpClient }, { token: InMemoryBackendConfig }, { token: DAFF_PRODUCT_IN_MEMORY_PRODUCT_RESPONSE_TRANSFORM }], target: i0.ɵɵFactoryTarget.Injectable }); }
160
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffInMemoryProductService }); }
161
161
  }
162
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffInMemoryProductService, decorators: [{
162
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffInMemoryProductService, decorators: [{
163
163
  type: Injectable
164
164
  }], ctorParameters: () => [{ type: i1.HttpClient }, { type: i2.InMemoryBackendConfigArgs, decorators: [{
165
165
  type: Inject,
@@ -184,13 +184,13 @@ class DaffProductInMemoryDriverModule {
184
184
  ],
185
185
  };
186
186
  }
187
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffProductInMemoryDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
188
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.18", ngImport: i0, type: DaffProductInMemoryDriverModule, imports: [CommonModule,
187
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffProductInMemoryDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
188
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: DaffProductInMemoryDriverModule, imports: [CommonModule,
189
189
  DaffProductTestingModule] }); }
190
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffProductInMemoryDriverModule, imports: [CommonModule,
190
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffProductInMemoryDriverModule, imports: [CommonModule,
191
191
  DaffProductTestingModule] }); }
192
192
  }
193
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffProductInMemoryDriverModule, decorators: [{
193
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffProductInMemoryDriverModule, decorators: [{
194
194
  type: NgModule,
195
195
  args: [{
196
196
  imports: [
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-product-driver-in-memory.mjs","sources":["../../../libs/product/driver/in-memory/src/collection-name.const.ts","../../../libs/product/driver/in-memory/src/backend/transfer-state-key.ts","../../../libs/product/driver/in-memory/src/backend/product.service.ts","../../../libs/product/driver/in-memory/src/injection-tokens/transforms/product-response/response-extra.token.ts","../../../libs/product/driver/in-memory/src/injection-tokens/transforms/product-response/response.token.ts","../../../libs/product/driver/in-memory/src/driver/product.service.ts","../../../libs/product/driver/in-memory/src/driver/product-driver.module.ts","../../../libs/product/driver/in-memory/src/driver/routable-objects.token.ts","../../../libs/product/driver/in-memory/src/driver/provider.ts","../../../libs/product/driver/in-memory/src/daffodil-product-driver-in-memory.ts"],"sourcesContent":["export const DAFF_PRODUCT_IN_MEMORY_COLLECTION_NAME = 'products';\n","import { makeStateKey } from '@angular/core';\n\nimport { DaffProduct } from '@daffodil/product';\n\nexport const TRANSFER_STATE_KEY = makeStateKey<DaffProduct[]>('DAFF_PRODUCTS_INMEMORY_DATA');\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n inject,\n Injectable,\n PLATFORM_ID,\n TransferState,\n} from '@angular/core';\nimport {\n InMemoryDbService,\n RequestInfoUtilities,\n ParsedRequestUrl,\n RequestInfo,\n STATUS,\n} from 'angular-in-memory-web-api';\n\nimport { daffUriTruncateLeadingSlash } from '@daffodil/core/routing';\nimport { DaffInMemorySingleRouteableBackend } from '@daffodil/driver/in-memory';\nimport { DaffProduct } from '@daffodil/product';\nimport { DaffProductExtensionFactory } from '@daffodil/product/testing';\n\nimport { DAFF_PRODUCT_IN_MEMORY_COLLECTION_NAME } from '../collection-name.const';\nimport { TRANSFER_STATE_KEY } from './transfer-state-key';\n/**\n * An in-memory service that stubs out the backend services for getting products.\n *\n * @Param productFactory: DaffProductFactory instance\n * @Param productImageFactory: DaffProductImageFactory instance\n * @Param products: An array of Products\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryBackendProductService implements InMemoryDbService, DaffInMemorySingleRouteableBackend {\n readonly collectionName = DAFF_PRODUCT_IN_MEMORY_COLLECTION_NAME;\n\n protected _products: DaffProduct[] = [];\n\n /**\n * The collection of products in the backend.\n */\n get products(): DaffProduct[] {\n return this._products;\n };\n\n constructor(){\n const transferState = inject(TransferState);\n const platform = inject(PLATFORM_ID);\n const productFactory = inject(DaffProductExtensionFactory);\n\n if(isPlatformBrowser(platform)) {\n this._products = transferState.get(TRANSFER_STATE_KEY, productFactory.createMany(35));\n } else {\n this._products = productFactory.createMany(35);\n transferState.set(TRANSFER_STATE_KEY, this._products);\n }\n }\n\n /**\n * Automatically called as part of the InMemoryDbService to parse incoming urls to match the InMemory backend urls.\n *\n * @param url initial url\n * @param utils utility to parse url\n * @returns ParsedRequestUrl\n * @docs-private\n */\n parseRequestUrl(url: string, utils: RequestInfoUtilities): ParsedRequestUrl {\n return utils.parseRequestUrl(url);\n }\n\n /**\n * Creates a fake database of products for the product inmemory backend service.\n *\n * @returns A fake database of an array of products\n * @docs-private\n */\n createDb(): any {\n return {\n products: this._products,\n };\n }\n\n /**\n * Returns products based on the url given.\n *\n * @param reqInfo request object\n * @returns An http response object\n */\n get(reqInfo: RequestInfo) {\n if(reqInfo.id?.includes('.html')) {\n const product = this._products.find((p) => daffUriTruncateLeadingSlash(p.url) === reqInfo.id);\n\n if(!product) {\n return undefined;\n }\n\n return reqInfo.utils.createResponse$(() => ({\n body: product,\n status: STATUS.OK,\n }));\n }\n return undefined;\n }\n}\n","import { createMultiInjectionToken } from '@daffodil/core';\n\nimport { DaffInMemoryProductResponseExtraTransform } from '../../../interfaces/public_api';\n\nexport const {\n /**\n * A multi-provider injection token for providing extra transform logic in the Product In-Memory driver.\n * It is run after the standard transforms and passed both the current transformed Daffodil response and the In-Memory product response.\n */\n token: DAFF_PRODUCT_IN_MEMORY_EXTRA_PRODUCT_RESPONSE_TRANSFORMS,\n\n /**\n * Provides extra product transforms for the In-Memory product driver.\n *\n * See {@link DAFF_PRODUCT_IN_MEMORY_EXTRA_PRODUCT_RESPONSE_TRANSFORMS}.\n *\n * @example\n * ```ts\n * providers: [\n * ...provideDaffProductInMemoryExtraProductResponseTransforms(\n * myExtraProductTransform\n * )\n * ]\n * ```\n */\n provider: provideDaffProductInMemoryExtraProductResponseTransforms,\n} = createMultiInjectionToken<DaffInMemoryProductResponseExtraTransform>('DAFF_PRODUCT_IN_MEMORY_EXTRA_PRODUCT_RESPONSE_TRANSFORMS');\n","import { inject } from '@angular/core';\n\nimport { createSingleInjectionToken } from '@daffodil/core';\nimport { DaffProduct } from '@daffodil/product';\n\nimport { DAFF_PRODUCT_IN_MEMORY_EXTRA_PRODUCT_RESPONSE_TRANSFORMS } from './response-extra.token';\nimport { DaffInMemoryProductResponseTransform } from '../../../interfaces/public_api';\n\nexport const {\n /**\n * An internal token to combine the In-Memory response transform with the injected transforms.\n */\n token: DAFF_PRODUCT_IN_MEMORY_PRODUCT_RESPONSE_TRANSFORM,\n /**\n * Provider function for {@link DAFF_PRODUCT_IN_MEMORY_PRODUCT_RESPONSE_TRANSFORM}.\n */\n provider: provideDaffProductInMemoryProductResponseTransform,\n} = createSingleInjectionToken<DaffInMemoryProductResponseTransform>(\n 'DAFF_PRODUCT_IN_MEMORY_PRODUCT_RESPONSE_TRANSFORM',\n {\n factory: () => {\n const transforms = inject(DAFF_PRODUCT_IN_MEMORY_EXTRA_PRODUCT_RESPONSE_TRANSFORMS);\n return (product: DaffProduct) =>\n transforms.reduce(\n (daffProductResponse, transform) => transform(daffProductResponse, product),\n {\n id: product.id,\n products: [product],\n },\n );\n },\n },\n);\n","import { HttpClient } from '@angular/common/http';\nimport {\n Inject,\n Injectable,\n} from '@angular/core';\nimport {\n InMemoryBackendConfig,\n InMemoryBackendConfigArgs,\n} from 'angular-in-memory-web-api';\nimport { Observable } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\nimport { daffUriTruncateLeadingSlash } from '@daffodil/core/routing';\nimport { DaffInMemoryDriverBase } from '@daffodil/driver/in-memory';\nimport { DaffProduct } from '@daffodil/product';\nimport {\n DaffProductDriverResponse,\n DaffProductServiceInterface,\n} from '@daffodil/product/driver';\n\nimport { DAFF_PRODUCT_IN_MEMORY_COLLECTION_NAME } from '../collection-name.const';\nimport { DAFF_PRODUCT_IN_MEMORY_PRODUCT_RESPONSE_TRANSFORM } from '../injection-tokens/public_api';\nimport { DaffInMemoryProductResponseTransform } from '../interfaces/public_api';\n\n/**\n * The product inmemory driver to mock the product backend service.\n *\n * @inheritdoc\n * @Param HttpClient\n */\n@Injectable()\nexport class DaffInMemoryProductService extends DaffInMemoryDriverBase implements DaffProductServiceInterface {\n constructor(\n private http: HttpClient,\n @Inject(InMemoryBackendConfig) config: InMemoryBackendConfigArgs,\n @Inject(DAFF_PRODUCT_IN_MEMORY_PRODUCT_RESPONSE_TRANSFORM) private transform: DaffInMemoryProductResponseTransform,\n ) {\n super(config, DAFF_PRODUCT_IN_MEMORY_COLLECTION_NAME);\n }\n\n getAll(): Observable<DaffProduct[]> {\n return this.http.get<DaffProduct[]>(this.url);\n }\n\n get(productId: DaffProduct['id']): Observable<DaffProductDriverResponse> {\n return this.http.get<DaffProduct>(`${this.url}/${productId}`).pipe(\n map(this.transform),\n );\n }\n\n getByUrl(url: DaffProduct['url']): Observable<DaffProductDriverResponse> {\n return this.http.get<DaffProduct>(`${this.url}/${daffUriTruncateLeadingSlash(url)}`).pipe(\n map(this.transform),\n );\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { provideDaffInMemoryBackends } from '@daffodil/driver/in-memory';\nimport { provideDaffProductDriver } from '@daffodil/product/driver';\nimport {\n DaffDefaultProductFactory,\n DaffProductTestingModule,\n provideDaffProductExtraFactoryTypes,\n} from '@daffodil/product/testing';\n\nimport { DaffInMemoryProductService } from './product.service';\nimport { DaffInMemoryBackendProductService } from '../backend/product.service';\n\n/**\n * Module for providing the DaffInMemoryProductService driver to your application.\n */\n@NgModule({\n imports: [\n CommonModule,\n DaffProductTestingModule,\n ],\n})\nexport class DaffProductInMemoryDriverModule {\n static forRoot(): ModuleWithProviders<DaffProductInMemoryDriverModule> {\n return {\n ngModule: DaffProductInMemoryDriverModule,\n providers: [\n DaffInMemoryProductService,\n provideDaffProductDriver(DaffInMemoryProductService),\n provideDaffProductExtraFactoryTypes(DaffDefaultProductFactory),\n provideDaffInMemoryBackends(DaffInMemoryBackendProductService),\n ],\n };\n }\n}\n","import { inject } from '@angular/core';\n\n\nimport { DaffInMemoryBackendProductService } from '../backend/product.service';\n\n/**\n * A factory function that provides routable product objects for the in-memory driver.\n *\n * Returns a function that provides all product entities with their URL properties.\n * Used internally by {@link provideDaffProductInMemoryDriver} with\n * {@link provideDaffInMemoryRoutableObjects} to enable automatic URL resolution for products.\n *\n * @docs-private\n */\nexport const daffProductInMemoryRoutableObjects = () => {\n const service = inject(DaffInMemoryBackendProductService);\n return service.products.map((p) => ({ url: p.url }));\n};\n","import {\n EnvironmentProviders,\n Provider,\n} from '@angular/core';\n\nimport {\n provideDaffInMemoryBackends,\n provideDaffInMemoryRoutableObjects,\n} from '@daffodil/driver/in-memory';\nimport { provideDaffProductDriver } from '@daffodil/product/driver';\nimport {\n DaffDefaultProductFactory,\n provideDaffProductExtraFactoryTypes,\n} from '@daffodil/product/testing';\n\nimport {\n DaffInMemoryBackendProductService,\n DaffInMemoryProductService,\n} from '../public_api';\nimport { daffProductInMemoryRoutableObjects } from './routable-objects.token';\n\n/**\n * Provides the Daffodil product in-memory driver and its dependencies.\n */\nexport const provideDaffProductInMemoryDriver = (): Array<Provider | EnvironmentProviders> => [\n DaffInMemoryProductService,\n provideDaffProductDriver(DaffInMemoryProductService),\n provideDaffProductExtraFactoryTypes(DaffDefaultProductFactory),\n provideDaffInMemoryBackends(DaffInMemoryBackendProductService),\n provideDaffInMemoryRoutableObjects('PRODUCT', daffProductInMemoryRoutableObjects),\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAAO,MAAM,sCAAsC,GAAG,UAAU;;ACIzD,MAAM,kBAAkB,GAAG,YAAY,CAAgB,6BAA6B,CAAC;;ACkB5F;;;;;;AAMG;MAIU,iCAAiC,CAAA;AAK5C;;AAEG;AACH,IAAA,IAAI,QAAQ,GAAA;QACV,OAAO,IAAI,CAAC,SAAS;IACvB;;AAEA,IAAA,WAAA,GAAA;QAXS,IAAA,CAAA,cAAc,GAAG,sCAAsC;QAEtD,IAAA,CAAA,SAAS,GAAkB,EAAE;AAUrC,QAAA,MAAM,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC;AAC3C,QAAA,MAAM,QAAQ,GAAG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","../../../libs/product/driver/in-memory/src/backend/transfer-state-key.ts","../../../libs/product/driver/in-memory/src/backend/product.service.ts","../../../libs/product/driver/in-memory/src/injection-tokens/transforms/product-response/response-extra.token.ts","../../../libs/product/driver/in-memory/src/injection-tokens/transforms/product-response/response.token.ts","../../../libs/product/driver/in-memory/src/driver/product.service.ts","../../../libs/product/driver/in-memory/src/driver/product-driver.module.ts","../../../libs/product/driver/in-memory/src/driver/routable-objects.token.ts","../../../libs/product/driver/in-memory/src/driver/provider.ts","../../../libs/product/driver/in-memory/src/daffodil-product-driver-in-memory.ts"],"sourcesContent":["export const DAFF_PRODUCT_IN_MEMORY_COLLECTION_NAME = 'products';\n","import { makeStateKey } from '@angular/core';\n\nimport { DaffProduct } from '@daffodil/product';\n\nexport const TRANSFER_STATE_KEY = makeStateKey<DaffProduct[]>('DAFF_PRODUCTS_INMEMORY_DATA');\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n inject,\n Injectable,\n PLATFORM_ID,\n TransferState,\n} from '@angular/core';\nimport {\n InMemoryDbService,\n RequestInfoUtilities,\n ParsedRequestUrl,\n RequestInfo,\n STATUS,\n} from 'angular-in-memory-web-api';\n\nimport { daffUriTruncateLeadingSlash } from '@daffodil/core/routing';\nimport { DaffInMemorySingleRouteableBackend } from '@daffodil/driver/in-memory';\nimport { DaffProduct } from '@daffodil/product';\nimport { DaffProductExtensionFactory } from '@daffodil/product/testing';\n\nimport { DAFF_PRODUCT_IN_MEMORY_COLLECTION_NAME } from '../collection-name.const';\nimport { TRANSFER_STATE_KEY } from './transfer-state-key';\n/**\n * An in-memory service that stubs out the backend services for getting products.\n *\n * @Param productFactory: DaffProductFactory instance\n * @Param productImageFactory: DaffProductImageFactory instance\n * @Param products: An array of Products\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryBackendProductService implements InMemoryDbService, DaffInMemorySingleRouteableBackend {\n readonly collectionName = DAFF_PRODUCT_IN_MEMORY_COLLECTION_NAME;\n\n protected _products: DaffProduct[] = [];\n\n /**\n * The collection of products in the backend.\n */\n get products(): DaffProduct[] {\n return this._products;\n };\n\n constructor(){\n const transferState = inject(TransferState);\n const platform = inject(PLATFORM_ID);\n const productFactory = inject(DaffProductExtensionFactory);\n\n if(isPlatformBrowser(platform)) {\n this._products = transferState.get(TRANSFER_STATE_KEY, productFactory.createMany(35));\n } else {\n this._products = productFactory.createMany(35);\n transferState.set(TRANSFER_STATE_KEY, this._products);\n }\n }\n\n /**\n * Automatically called as part of the InMemoryDbService to parse incoming urls to match the InMemory backend urls.\n *\n * @param url initial url\n * @param utils utility to parse url\n * @returns ParsedRequestUrl\n * @docs-private\n */\n parseRequestUrl(url: string, utils: RequestInfoUtilities): ParsedRequestUrl {\n return utils.parseRequestUrl(url);\n }\n\n /**\n * Creates a fake database of products for the product inmemory backend service.\n *\n * @returns A fake database of an array of products\n * @docs-private\n */\n createDb(): any {\n return {\n products: this._products,\n };\n }\n\n /**\n * Returns products based on the url given.\n *\n * @param reqInfo request object\n * @returns An http response object\n */\n get(reqInfo: RequestInfo) {\n if(reqInfo.id?.includes('.html')) {\n const product = this._products.find((p) => daffUriTruncateLeadingSlash(p.url) === reqInfo.id);\n\n if(!product) {\n return undefined;\n }\n\n return reqInfo.utils.createResponse$(() => ({\n body: product,\n status: STATUS.OK,\n }));\n }\n return undefined;\n }\n}\n","import { createMultiInjectionToken } from '@daffodil/core';\n\nimport { DaffInMemoryProductResponseExtraTransform } from '../../../interfaces/public_api';\n\nexport const {\n /**\n * A multi-provider injection token for providing extra transform logic in the Product In-Memory driver.\n * It is run after the standard transforms and passed both the current transformed Daffodil response and the In-Memory product response.\n */\n token: DAFF_PRODUCT_IN_MEMORY_EXTRA_PRODUCT_RESPONSE_TRANSFORMS,\n\n /**\n * Provides extra product transforms for the In-Memory product driver.\n *\n * See {@link DAFF_PRODUCT_IN_MEMORY_EXTRA_PRODUCT_RESPONSE_TRANSFORMS}.\n *\n * @example\n * ```ts\n * providers: [\n * ...provideDaffProductInMemoryExtraProductResponseTransforms(\n * myExtraProductTransform\n * )\n * ]\n * ```\n */\n provider: provideDaffProductInMemoryExtraProductResponseTransforms,\n} = createMultiInjectionToken<DaffInMemoryProductResponseExtraTransform>('DAFF_PRODUCT_IN_MEMORY_EXTRA_PRODUCT_RESPONSE_TRANSFORMS');\n","import { inject } from '@angular/core';\n\nimport { createSingleInjectionToken } from '@daffodil/core';\nimport { DaffProduct } from '@daffodil/product';\n\nimport { DAFF_PRODUCT_IN_MEMORY_EXTRA_PRODUCT_RESPONSE_TRANSFORMS } from './response-extra.token';\nimport { DaffInMemoryProductResponseTransform } from '../../../interfaces/public_api';\n\nexport const {\n /**\n * An internal token to combine the In-Memory response transform with the injected transforms.\n */\n token: DAFF_PRODUCT_IN_MEMORY_PRODUCT_RESPONSE_TRANSFORM,\n /**\n * Provider function for {@link DAFF_PRODUCT_IN_MEMORY_PRODUCT_RESPONSE_TRANSFORM}.\n */\n provider: provideDaffProductInMemoryProductResponseTransform,\n} = createSingleInjectionToken<DaffInMemoryProductResponseTransform>(\n 'DAFF_PRODUCT_IN_MEMORY_PRODUCT_RESPONSE_TRANSFORM',\n {\n factory: () => {\n const transforms = inject(DAFF_PRODUCT_IN_MEMORY_EXTRA_PRODUCT_RESPONSE_TRANSFORMS);\n return (product: DaffProduct) =>\n transforms.reduce(\n (daffProductResponse, transform) => transform(daffProductResponse, product),\n {\n id: product.id,\n products: [product],\n },\n );\n },\n },\n);\n","import { HttpClient } from '@angular/common/http';\nimport {\n Inject,\n Injectable,\n} from '@angular/core';\nimport {\n InMemoryBackendConfig,\n InMemoryBackendConfigArgs,\n} from 'angular-in-memory-web-api';\nimport { Observable } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\nimport { daffUriTruncateLeadingSlash } from '@daffodil/core/routing';\nimport { DaffInMemoryDriverBase } from '@daffodil/driver/in-memory';\nimport { DaffProduct } from '@daffodil/product';\nimport {\n DaffProductDriverResponse,\n DaffProductServiceInterface,\n} from '@daffodil/product/driver';\n\nimport { DAFF_PRODUCT_IN_MEMORY_COLLECTION_NAME } from '../collection-name.const';\nimport { DAFF_PRODUCT_IN_MEMORY_PRODUCT_RESPONSE_TRANSFORM } from '../injection-tokens/public_api';\nimport { DaffInMemoryProductResponseTransform } from '../interfaces/public_api';\n\n/**\n * The product inmemory driver to mock the product backend service.\n *\n * @inheritdoc\n * @Param HttpClient\n */\n@Injectable()\nexport class DaffInMemoryProductService extends DaffInMemoryDriverBase implements DaffProductServiceInterface {\n constructor(\n private http: HttpClient,\n @Inject(InMemoryBackendConfig) config: InMemoryBackendConfigArgs,\n @Inject(DAFF_PRODUCT_IN_MEMORY_PRODUCT_RESPONSE_TRANSFORM) private transform: DaffInMemoryProductResponseTransform,\n ) {\n super(config, DAFF_PRODUCT_IN_MEMORY_COLLECTION_NAME);\n }\n\n getAll(): Observable<DaffProduct[]> {\n return this.http.get<DaffProduct[]>(this.url);\n }\n\n get(productId: DaffProduct['id']): Observable<DaffProductDriverResponse> {\n return this.http.get<DaffProduct>(`${this.url}/${productId}`).pipe(\n map(this.transform),\n );\n }\n\n getByUrl(url: DaffProduct['url']): Observable<DaffProductDriverResponse> {\n return this.http.get<DaffProduct>(`${this.url}/${daffUriTruncateLeadingSlash(url)}`).pipe(\n map(this.transform),\n );\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { provideDaffInMemoryBackends } from '@daffodil/driver/in-memory';\nimport { provideDaffProductDriver } from '@daffodil/product/driver';\nimport {\n DaffDefaultProductFactory,\n DaffProductTestingModule,\n provideDaffProductExtraFactoryTypes,\n} from '@daffodil/product/testing';\n\nimport { DaffInMemoryProductService } from './product.service';\nimport { DaffInMemoryBackendProductService } from '../backend/product.service';\n\n/**\n * Module for providing the DaffInMemoryProductService driver to your application.\n */\n@NgModule({\n imports: [\n CommonModule,\n DaffProductTestingModule,\n ],\n})\nexport class DaffProductInMemoryDriverModule {\n static forRoot(): ModuleWithProviders<DaffProductInMemoryDriverModule> {\n return {\n ngModule: DaffProductInMemoryDriverModule,\n providers: [\n DaffInMemoryProductService,\n provideDaffProductDriver(DaffInMemoryProductService),\n provideDaffProductExtraFactoryTypes(DaffDefaultProductFactory),\n provideDaffInMemoryBackends(DaffInMemoryBackendProductService),\n ],\n };\n }\n}\n","import { inject } from '@angular/core';\n\n\nimport { DaffInMemoryBackendProductService } from '../backend/product.service';\n\n/**\n * A factory function that provides routable product objects for the in-memory driver.\n *\n * Returns a function that provides all product entities with their URL properties.\n * Used internally by {@link provideDaffProductInMemoryDriver} with\n * {@link provideDaffInMemoryRoutableObjects} to enable automatic URL resolution for products.\n *\n * @docs-private\n */\nexport const daffProductInMemoryRoutableObjects = () => {\n const service = inject(DaffInMemoryBackendProductService);\n return service.products.map((p) => ({ url: p.url }));\n};\n","import {\n EnvironmentProviders,\n Provider,\n} from '@angular/core';\n\nimport {\n provideDaffInMemoryBackends,\n provideDaffInMemoryRoutableObjects,\n} from '@daffodil/driver/in-memory';\nimport { provideDaffProductDriver } from '@daffodil/product/driver';\nimport {\n DaffDefaultProductFactory,\n provideDaffProductExtraFactoryTypes,\n} from '@daffodil/product/testing';\n\nimport {\n DaffInMemoryBackendProductService,\n DaffInMemoryProductService,\n} from '../public_api';\nimport { daffProductInMemoryRoutableObjects } from './routable-objects.token';\n\n/**\n * Provides the Daffodil product in-memory driver and its dependencies.\n */\nexport const provideDaffProductInMemoryDriver = (): Array<Provider | EnvironmentProviders> => [\n DaffInMemoryProductService,\n provideDaffProductDriver(DaffInMemoryProductService),\n provideDaffProductExtraFactoryTypes(DaffDefaultProductFactory),\n provideDaffInMemoryBackends(DaffInMemoryBackendProductService),\n provideDaffInMemoryRoutableObjects('PRODUCT', daffProductInMemoryRoutableObjects),\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAAO,MAAM,sCAAsC,GAAG,UAAU;;ACIzD,MAAM,kBAAkB,GAAG,YA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ACtD,CAAC;;ACID;;AAEG;AACI,MAAM,gCAAgC,GAAG,MAA8C;IAC5F,0BAA0B;IAC1B,wBAAwB,CAAC,0BAA0B,CAAC;IACpD,mCAAmC,CAAC,yBAAyB,CAAC;IAC9D,2BAA2B,CAAC,iCAAiC,CAAC;AAC9D,IAAA,kCAAkC,CAAC,SAAS,EAAE,kCAAkC,CAAC;;;AC7BnF;;AAEG;;;;"}
@@ -44,10 +44,10 @@ class MagentoProductPreviewFactory extends DaffModelFactory {
44
44
  constructor() {
45
45
  super(MockMagentoProductPreview);
46
46
  }
47
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MagentoProductPreviewFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
48
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MagentoProductPreviewFactory, providedIn: 'root' }); }
47
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoProductPreviewFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
48
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoProductPreviewFactory, providedIn: 'root' }); }
49
49
  }
50
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MagentoProductPreviewFactory, decorators: [{
50
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoProductPreviewFactory, decorators: [{
51
51
  type: Injectable,
52
52
  args: [{
53
53
  providedIn: 'root',
@@ -80,10 +80,10 @@ class MagentoCoreProductFactory extends DaffModelFactory {
80
80
  constructor() {
81
81
  super(MockMagentoCoreProduct);
82
82
  }
83
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MagentoCoreProductFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
84
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MagentoCoreProductFactory, providedIn: 'root' }); }
83
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoCoreProductFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
84
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoCoreProductFactory, providedIn: 'root' }); }
85
85
  }
86
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MagentoCoreProductFactory, decorators: [{
86
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoCoreProductFactory, decorators: [{
87
87
  type: Injectable,
88
88
  args: [{
89
89
  providedIn: 'root',
@@ -103,10 +103,10 @@ class MagentoSimpleProductFactory extends DaffModelFactory {
103
103
  constructor() {
104
104
  super(MockMagentoSimpleProduct);
105
105
  }
106
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MagentoSimpleProductFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
107
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MagentoSimpleProductFactory, providedIn: 'root' }); }
106
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoSimpleProductFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
107
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoSimpleProductFactory, providedIn: 'root' }); }
108
108
  }
109
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MagentoSimpleProductFactory, decorators: [{
109
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoSimpleProductFactory, decorators: [{
110
110
  type: Injectable,
111
111
  args: [{
112
112
  providedIn: 'root',
@@ -148,10 +148,10 @@ class MagentoProductAggregationPriceFactory extends DaffModelFactory {
148
148
  constructor() {
149
149
  super(MockMagentoAggregationPrice);
150
150
  }
151
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MagentoProductAggregationPriceFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
152
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MagentoProductAggregationPriceFactory, providedIn: 'root' }); }
151
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoProductAggregationPriceFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
152
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoProductAggregationPriceFactory, providedIn: 'root' }); }
153
153
  }
154
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MagentoProductAggregationPriceFactory, decorators: [{
154
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoProductAggregationPriceFactory, decorators: [{
155
155
  type: Injectable,
156
156
  args: [{
157
157
  providedIn: 'root',
@@ -188,10 +188,10 @@ class MagentoProductAggregationSelectFactory extends DaffModelFactory {
188
188
  constructor() {
189
189
  super(MockMagentoAggregationSelect);
190
190
  }
191
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MagentoProductAggregationSelectFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
192
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MagentoProductAggregationSelectFactory, providedIn: 'root' }); }
191
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoProductAggregationSelectFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
192
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoProductAggregationSelectFactory, providedIn: 'root' }); }
193
193
  }
194
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MagentoProductAggregationSelectFactory, decorators: [{
194
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoProductAggregationSelectFactory, decorators: [{
195
195
  type: Injectable,
196
196
  args: [{
197
197
  providedIn: 'root',
@@ -204,10 +204,10 @@ class MagentoProductAggregationFactory extends DaffModelFactory {
204
204
  this.selectFactory = selectFactory;
205
205
  this.priceFactory = priceFactory;
206
206
  }
207
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MagentoProductAggregationFactory, deps: [{ token: MagentoProductAggregationSelectFactory }, { token: MagentoProductAggregationPriceFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
208
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MagentoProductAggregationFactory, providedIn: 'root' }); }
207
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoProductAggregationFactory, deps: [{ token: MagentoProductAggregationSelectFactory }, { token: MagentoProductAggregationPriceFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
208
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoProductAggregationFactory, providedIn: 'root' }); }
209
209
  }
210
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MagentoProductAggregationFactory, decorators: [{
210
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoProductAggregationFactory, decorators: [{
211
211
  type: Injectable,
212
212
  args: [{
213
213
  providedIn: 'root',
@@ -231,10 +231,10 @@ class MagentoProductFilterTypeFieldFactory extends DaffModelFactory {
231
231
  constructor() {
232
232
  super(MockMagentoProductFilterTypeField);
233
233
  }
234
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MagentoProductFilterTypeFieldFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
235
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MagentoProductFilterTypeFieldFactory, providedIn: 'root' }); }
234
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoProductFilterTypeFieldFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
235
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoProductFilterTypeFieldFactory, providedIn: 'root' }); }
236
236
  }
237
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MagentoProductFilterTypeFieldFactory, decorators: [{
237
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoProductFilterTypeFieldFactory, decorators: [{
238
238
  type: Injectable,
239
239
  args: [{
240
240
  providedIn: 'root',
@@ -257,10 +257,10 @@ class MagentoProductSortFieldsFactory extends DaffModelFactory {
257
257
  constructor() {
258
258
  super(MockMagentoProductSortFields);
259
259
  }
260
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MagentoProductSortFieldsFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
261
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MagentoProductSortFieldsFactory, providedIn: 'root' }); }
260
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoProductSortFieldsFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
261
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoProductSortFieldsFactory, providedIn: 'root' }); }
262
262
  }
263
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MagentoProductSortFieldsFactory, decorators: [{
263
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoProductSortFieldsFactory, decorators: [{
264
264
  type: Injectable,
265
265
  args: [{
266
266
  providedIn: 'root',
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-product-driver-magento-testing.mjs","sources":["../../../libs/product/driver/magento/testing/src/factories/core/product-preview.factory.ts","../../../libs/product/driver/magento/testing/src/factories/core/product.factory.ts","../../../libs/product/driver/magento/testing/src/factories/simple/simple.factory.ts","../../../libs/product/driver/magento/testing/src/factories/aggregation/type/price.factory.ts","../../../libs/product/driver/magento/testing/src/factories/aggregation/type/select.factory.ts","../../../libs/product/driver/magento/testing/src/factories/aggregation/aggregation.factory.ts","../../../libs/product/driver/magento/testing/src/factories/filter-type-field.factory.ts","../../../libs/product/driver/magento/testing/src/factories/sort-fields.factory.ts","../../../libs/product/driver/magento/testing/src/daffodil-product-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 {\n MagentoProductPreview,\n MagentoProductTypeEnum,\n MagentoProductStockStatusEnum,\n} from '@daffodil/product/driver/magento';\n\nexport class MockMagentoProductPreview implements MagentoProductPreview {\n __typename = MagentoProductTypeEnum.SimpleProduct;\n uid = faker.string.uuid();\n url_key = faker.string.alphanumeric(16);\n url_suffix = '.html';\n name = faker.lorem.word();\n sku = faker.string.alphanumeric(16);\n stock_status = MagentoProductStockStatusEnum.InStock;\n image = {\n __typename: 'ProductImage',\n label: faker.lorem.words(3),\n url: faker.image.url(),\n };\n description = {\n __typename: 'ComplexTextValue',\n html: faker.lorem.words(5),\n };\n price_range = {\n __typename: 'PriceRange',\n maximum_price: {\n __typename: 'ProductPrice',\n regular_price: {\n __typename: 'Money',\n value: faker.number.int({ min: 100, max: 1000 }),\n currency: null,\n },\n discount: {\n __typename: 'ProductDiscount',\n amount_off: faker.number.int({ min: 1, max: 99 }),\n percent_off: faker.number.int({ min: 1, max: 99 }),\n },\n },\n };\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class MagentoProductPreviewFactory extends DaffModelFactory<MagentoProductPreview> {\n\n constructor(){\n super(MockMagentoProductPreview);\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 MagentoProduct,\n MagentoProductTypeEnum,\n MagentoProductStockStatusEnum,\n} from '@daffodil/product/driver/magento';\n\nimport { MockMagentoProductPreview } from './product-preview.factory';\n\nexport class MockMagentoCoreProduct extends MockMagentoProductPreview implements MagentoProduct {\n __typename = MagentoProductTypeEnum.SimpleProduct;\n canonical_url = faker.internet.url();\n meta_title = faker.lorem.word();\n meta_description = faker.lorem.words(3);\n stock_status = MagentoProductStockStatusEnum.InStock;\n description = {\n __typename: 'ComplexTextValue',\n html: faker.lorem.words(5),\n };\n short_description = {\n __typename: 'ComplexTextValue',\n html: faker.lorem.words(3),\n };\n media_gallery_entries = [];\n}\n\n/**\n * A factory for creating stub data for {@link MagentoProduct}s.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class MagentoCoreProductFactory extends DaffModelFactory<MagentoProduct> {\n\n constructor(){\n super(MockMagentoCoreProduct);\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport {\n MagentoProductTypeEnum,\n MagentoSimpleProduct,\n} from '@daffodil/product/driver/magento';\n\nimport { MockMagentoCoreProduct } from '../core/product.factory';\n\nexport class MockMagentoSimpleProduct extends MockMagentoCoreProduct implements MagentoSimpleProduct {\n __typename = MagentoProductTypeEnum.SimpleProduct;\n}\n\n/**\n * A factory for creating stub data for {@link MagentoSimpleProduct}s.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class MagentoSimpleProductFactory extends DaffModelFactory<MagentoSimpleProduct> {\n\n constructor(){\n super(MockMagentoSimpleProduct);\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 MagentoAggregation,\n MagentoProductFilterType,\n} from '@daffodil/product/driver/magento';\n\nclass MockMagentoAggregationPrice implements MagentoAggregation {\n __typename = 'Aggregation';\n attribute_code = 'price';\n type = MagentoProductFilterType.Range;\n count = faker.number.int();\n label = 'Price';\n options = [\n {\n value: '0-10',\n count: faker.number.int(),\n label: '0-10',\n },\n {\n value: '10-20',\n count: faker.number.int(),\n label: '10-20',\n },\n {\n value: '20-30',\n count: faker.number.int(),\n label: '20-30',\n },\n {\n value: '30-40',\n count: faker.number.int(),\n label: '30-40',\n },\n ];\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class MagentoProductAggregationPriceFactory extends DaffModelFactory<MagentoAggregation> {\n constructor(){\n super(MockMagentoAggregationPrice);\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 MagentoAggregation,\n MagentoProductFilterType,\n} from '@daffodil/product/driver/magento';\n\nclass MockMagentoAggregationSelect implements MagentoAggregation {\n __typename = 'Aggregation';\n attribute_code = 'select';\n type = MagentoProductFilterType.Equal;\n count = faker.number.int();\n label = faker.lorem.word();\n options = [\n {\n count: faker.number.int(),\n label: faker.lorem.word(),\n value: faker.string.uuid(),\n },\n {\n count: faker.number.int(),\n label: faker.lorem.word(),\n value: faker.string.uuid(),\n },\n {\n count: faker.number.int(),\n label: faker.lorem.word(),\n value: faker.string.uuid(),\n },\n ];\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class MagentoProductAggregationSelectFactory extends DaffModelFactory<MagentoAggregation> {\n constructor(){\n super(MockMagentoAggregationSelect);\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 { MagentoAggregation } from '@daffodil/product/driver/magento';\n\nimport { MagentoProductAggregationPriceFactory } from './type/price.factory';\nimport { MagentoProductAggregationSelectFactory } from './type/select.factory';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class MagentoProductAggregationFactory extends DaffModelFactory<MagentoAggregation> {\n constructor(private selectFactory: MagentoProductAggregationSelectFactory, private priceFactory: MagentoProductAggregationPriceFactory){\n super(faker.number.int({ min: 1, max: 2 }) === 2 ? selectFactory.type : priceFactory.type);\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 MagentoProductFilterTypeField,\n MagentoProductFilterType,\n} from '@daffodil/product/driver/magento';\n\nconst TYPES = [\n MagentoProductFilterType.Equal,\n MagentoProductFilterType.Range,\n MagentoProductFilterType.Match,\n];\n\nclass MockMagentoProductFilterTypeField implements MagentoProductFilterTypeField {\n name = faker.lorem.word();\n type = {\n name: TYPES[faker.number.int({ min: 0, max: TYPES.length - 1 })],\n };\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class MagentoProductFilterTypeFieldFactory extends DaffModelFactory<MagentoProductFilterTypeField> {\n constructor(){\n super(MockMagentoProductFilterTypeField);\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { MagentoProductSortFields } from '@daffodil/product/driver/magento';\n\nclass MockMagentoProductSortFields implements MagentoProductSortFields {\n __typename = <const>'SortFields';\n default = 'position';\n options = [\n {\n label: 'string',\n value: 'position',\n },\n ];\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class MagentoProductSortFieldsFactory extends DaffModelFactory<MagentoProductSortFields> {\n constructor(){\n super(MockMagentoProductSortFields);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.MagentoProductAggregationSelectFactory","i2.MagentoProductAggregationPriceFactory"],"mappings":";;;;;;MAUa,yBAAyB,CAAA;AAAtC,IAAA,WAAA,GAAA;AACE,QAAA,IAAA,CAAA,UAAU,GAAG,sBAAsB,CAAC,aAAa;AACjD,QAAA,IAAA,CAAA,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE;QACzB,IAAA,CAAA,OAAO,GAAG,K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BAHhD,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACnBD,MAAM,4BAA4B,CAAA;AAAlC,IAAA,WAAA,GAAA;QACE,IAAA,CAAA,UAAU,GAAU,YAAY;QAChC,IAAA,CAAA,OAAO,GAAG,UAAU;AACpB,QAAA,IAAA,CAAA,OAAO,GAAG;AACR,YAAA;AACE,gBAAA,KAAK,EAAE,QAAQ;AACf,gBAAA,KAAK,EAAE,UAAU;AAClB,aAAA;SACF;IACH;AAAC;AAKK,MAAO,+BAAgC,SAAQ,gBAA0C,CAAA;AAC7F,IAAA,WAAA,GAAA;QACE,KAAK,CAAC,4BAA4B,CAAC;IACrC;kIAHW,+BAA+B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA/B,uBAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,+BAA+B,cAF9B,MAAM,EAAA,CAAA,CAAA;;4FAEP,+BAA+B,EAAA,UAAA,EAAA,CAAA;kBAH3C,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;AClBD;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-product-driver-magento-testing.mjs","sources":["../../../libs/product/driver/magento/testing/src/factories/core/product-preview.factory.ts","../../../libs/product/driver/magento/testing/src/factories/core/product.factory.ts","../../../libs/product/driver/magento/testing/src/factories/simple/simple.factory.ts","../../../libs/product/driver/magento/testing/src/factories/aggregation/type/price.factory.ts","../../../libs/product/driver/magento/testing/src/factories/aggregation/type/select.factory.ts","../../../libs/product/driver/magento/testing/src/factories/aggregation/aggregation.factory.ts","../../../libs/product/driver/magento/testing/src/factories/filter-type-field.factory.ts","../../../libs/product/driver/magento/testing/src/factories/sort-fields.factory.ts","../../../libs/product/driver/magento/testing/src/daffodil-product-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 {\n MagentoProductPreview,\n MagentoProductTypeEnum,\n MagentoProductStockStatusEnum,\n} from '@daffodil/product/driver/magento';\n\nexport class MockMagentoProductPreview implements MagentoProductPreview {\n __typename = MagentoProductTypeEnum.SimpleProduct;\n uid = faker.string.uuid();\n url_key = faker.string.alphanumeric(16);\n url_suffix = '.html';\n name = faker.lorem.word();\n sku = faker.string.alphanumeric(16);\n stock_status = MagentoProductStockStatusEnum.InStock;\n image = {\n __typename: 'ProductImage',\n label: faker.lorem.words(3),\n url: faker.image.url(),\n };\n description = {\n __typename: 'ComplexTextValue',\n html: faker.lorem.words(5),\n };\n price_range = {\n __typename: 'PriceRange',\n maximum_price: {\n __typename: 'ProductPrice',\n regular_price: {\n __typename: 'Money',\n value: faker.number.int({ min: 100, max: 1000 }),\n currency: null,\n },\n discount: {\n __typename: 'ProductDiscount',\n amount_off: faker.number.int({ min: 1, max: 99 }),\n percent_off: faker.number.int({ min: 1, max: 99 }),\n },\n },\n };\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class MagentoProductPreviewFactory extends DaffModelFactory<MagentoProductPreview> {\n\n constructor(){\n super(MockMagentoProductPreview);\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 MagentoProduct,\n MagentoProductTypeEnum,\n MagentoProductStockStatusEnum,\n} from '@daffodil/product/driver/magento';\n\nimport { MockMagentoProductPreview } from './product-preview.factory';\n\nexport class MockMagentoCoreProduct extends MockMagentoProductPreview implements MagentoProduct {\n __typename = MagentoProductTypeEnum.SimpleProduct;\n canonical_url = faker.internet.url();\n meta_title = faker.lorem.word();\n meta_description = faker.lorem.words(3);\n stock_status = MagentoProductStockStatusEnum.InStock;\n description = {\n __typename: 'ComplexTextValue',\n html: faker.lorem.words(5),\n };\n short_description = {\n __typename: 'ComplexTextValue',\n html: faker.lorem.words(3),\n };\n media_gallery_entries = [];\n}\n\n/**\n * A factory for creating stub data for {@link MagentoProduct}s.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class MagentoCoreProductFactory extends DaffModelFactory<MagentoProduct> {\n\n constructor(){\n super(MockMagentoCoreProduct);\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport {\n MagentoProductTypeEnum,\n MagentoSimpleProduct,\n} from '@daffodil/product/driver/magento';\n\nimport { MockMagentoCoreProduct } from '../core/product.factory';\n\nexport class MockMagentoSimpleProduct extends MockMagentoCoreProduct implements MagentoSimpleProduct {\n __typename = MagentoProductTypeEnum.SimpleProduct;\n}\n\n/**\n * A factory for creating stub data for {@link MagentoSimpleProduct}s.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class MagentoSimpleProductFactory extends DaffModelFactory<MagentoSimpleProduct> {\n\n constructor(){\n super(MockMagentoSimpleProduct);\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 MagentoAggregation,\n MagentoProductFilterType,\n} from '@daffodil/product/driver/magento';\n\nclass MockMagentoAggregationPrice implements MagentoAggregation {\n __typename = 'Aggregation';\n attribute_code = 'price';\n type = MagentoProductFilterType.Range;\n count = faker.number.int();\n label = 'Price';\n options = [\n {\n value: '0-10',\n count: faker.number.int(),\n label: '0-10',\n },\n {\n value: '10-20',\n count: faker.number.int(),\n label: '10-20',\n },\n {\n value: '20-30',\n count: faker.number.int(),\n label: '20-30',\n },\n {\n value: '30-40',\n count: faker.number.int(),\n label: '30-40',\n },\n ];\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class MagentoProductAggregationPriceFactory extends DaffModelFactory<MagentoAggregation> {\n constructor(){\n super(MockMagentoAggregationPrice);\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 MagentoAggregation,\n MagentoProductFilterType,\n} from '@daffodil/product/driver/magento';\n\nclass MockMagentoAggregationSelect implements MagentoAggregation {\n __typename = 'Aggregation';\n attribute_code = 'select';\n type = MagentoProductFilterType.Equal;\n count = faker.number.int();\n label = faker.lorem.word();\n options = [\n {\n count: faker.number.int(),\n label: faker.lorem.word(),\n value: faker.string.uuid(),\n },\n {\n count: faker.number.int(),\n label: faker.lorem.word(),\n value: faker.string.uuid(),\n },\n {\n count: faker.number.int(),\n label: faker.lorem.word(),\n value: faker.string.uuid(),\n },\n ];\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class MagentoProductAggregationSelectFactory extends DaffModelFactory<MagentoAggregation> {\n constructor(){\n super(MockMagentoAggregationSelect);\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 { MagentoAggregation } from '@daffodil/product/driver/magento';\n\nimport { MagentoProductAggregationPriceFactory } from './type/price.factory';\nimport { MagentoProductAggregationSelectFactory } from './type/select.factory';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class MagentoProductAggregationFactory extends DaffModelFactory<MagentoAggregation> {\n constructor(private selectFactory: MagentoProductAggregationSelectFactory, private priceFactory: MagentoProductAggregationPriceFactory){\n super(faker.number.int({ min: 1, max: 2 }) === 2 ? selectFactory.type : priceFactory.type);\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 MagentoProductFilterTypeField,\n MagentoProductFilterType,\n} from '@daffodil/product/driver/magento';\n\nconst TYPES = [\n MagentoProductFilterType.Equal,\n MagentoProductFilterType.Range,\n MagentoProductFilterType.Match,\n];\n\nclass MockMagentoProductFilterTypeField implements MagentoProductFilterTypeField {\n name = faker.lorem.word();\n type = {\n name: TYPES[faker.number.int({ min: 0, max: TYPES.length - 1 })],\n };\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class MagentoProductFilterTypeFieldFactory extends DaffModelFactory<MagentoProductFilterTypeField> {\n constructor(){\n super(MockMagentoProductFilterTypeField);\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { MagentoProductSortFields } from '@daffodil/product/driver/magento';\n\nclass MockMagentoProductSortFields implements MagentoProductSortFields {\n __typename = <const>'SortFields';\n default = 'position';\n options = [\n {\n label: 'string',\n value: 'position',\n },\n ];\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class MagentoProductSortFieldsFactory extends DaffModelFactory<MagentoProductSortFields> {\n constructor(){\n super(MockMagentoProductSortFields);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.MagentoProductAggregationSelectFactory","i2.MagentoProductAggregationPriceFactory"],"mappings":";;;;;;MAUa,yBAAyB,CAAA;AAAtC,IAAA,WAAA,GAAA;AACE,QAAA,IAAA,CAAA,UAAU,GAAG,sBAAsB,CAAC,aAAa;AACjD,QAAA,IAAA,CAAA,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE;QACzB,IAAA,CAAA,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC;QACvC,IAAA,CAAA,UAAU,GAAG,OAAO;AACpB,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE;QACzB,IAAA,CAAA,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC;AACnC,QAAA,IAAA,CAAA,YAAY,GAAG,6BAA6B,CAAC,OAAO;AACpD,QAAA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A,KAAK,EAAE,UAAU;AAClB,aAAA;SACF;IACH;AAAC;AAKK,MAAO,+BAAgC,SAAQ,gBAA0C,CAAA;AAC7F,IAAA,WAAA,GAAA;QACE,KAAK,CAAC,4BAA4B,CAAC;IACrC;iIAHW,+BAA+B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA/B,uBAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,+BAA+B,cAF9B,MAAM,EAAA,CAAA,CAAA;;2FAEP,+BAA+B,EAAA,UAAA,EAAA,CAAA;kBAH3C,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;AClBD;;AAEG;;;;"}
@@ -113,10 +113,10 @@ class MagentoProductAppliedFiltersTransformService {
113
113
  getRangeToValue(toValue) {
114
114
  return toValue !== '*' ? { [MagentoProductFilterActionEnum.To]: toValue } : null;
115
115
  }
116
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MagentoProductAppliedFiltersTransformService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
117
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MagentoProductAppliedFiltersTransformService, providedIn: 'root' }); }
116
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoProductAppliedFiltersTransformService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
117
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoProductAppliedFiltersTransformService, providedIn: 'root' }); }
118
118
  }
119
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MagentoProductAppliedFiltersTransformService, decorators: [{
119
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoProductAppliedFiltersTransformService, decorators: [{
120
120
  type: Injectable,
121
121
  args: [{
122
122
  providedIn: 'root',
@@ -237,10 +237,10 @@ class DaffMagentoSimpleProductTransformers {
237
237
  ...product.media_gallery_entries && { images: transformMediaGalleryEntries(product, mediaUrl) },
238
238
  };
239
239
  }
240
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffMagentoSimpleProductTransformers, deps: [{ token: DAFF_PRODUCT_MAGENTO_PRODUCT_PREVIEW_TRANSFORM }], target: i0.ɵɵFactoryTarget.Injectable }); }
241
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffMagentoSimpleProductTransformers, providedIn: 'root' }); }
240
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoSimpleProductTransformers, deps: [{ token: DAFF_PRODUCT_MAGENTO_PRODUCT_PREVIEW_TRANSFORM }], target: i0.ɵɵFactoryTarget.Injectable }); }
241
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoSimpleProductTransformers, providedIn: 'root' }); }
242
242
  }
243
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffMagentoSimpleProductTransformers, decorators: [{
243
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoSimpleProductTransformers, decorators: [{
244
244
  type: Injectable,
245
245
  args: [{
246
246
  providedIn: 'root',
@@ -275,10 +275,10 @@ class DaffMagentoProductsTransformer {
275
275
  transformManyMagentoProducts(products, mediaUrl) {
276
276
  return products.map(product => this.transformMagentoProduct(product, mediaUrl));
277
277
  }
278
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffMagentoProductsTransformer, deps: [{ token: DaffMagentoSimpleProductTransformers }], target: i0.ɵɵFactoryTarget.Injectable }); }
279
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffMagentoProductsTransformer, providedIn: 'root' }); }
278
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoProductsTransformer, deps: [{ token: DaffMagentoSimpleProductTransformers }], target: i0.ɵɵFactoryTarget.Injectable }); }
279
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoProductsTransformer, providedIn: 'root' }); }
280
280
  }
281
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffMagentoProductsTransformer, decorators: [{
281
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoProductsTransformer, decorators: [{
282
282
  type: Injectable,
283
283
  args: [{
284
284
  providedIn: 'root',
@@ -344,10 +344,10 @@ class DaffMagentoProductResponseTransformers {
344
344
  products: [daffProduct],
345
345
  };
346
346
  }
347
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffMagentoProductResponseTransformers, deps: [{ token: DAFF_PRODUCT_MAGENTO_PRODUCT_TRANSFORM }], target: i0.ɵɵFactoryTarget.Injectable }); }
348
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffMagentoProductResponseTransformers, providedIn: 'root' }); }
347
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoProductResponseTransformers, deps: [{ token: DAFF_PRODUCT_MAGENTO_PRODUCT_TRANSFORM }], target: i0.ɵɵFactoryTarget.Injectable }); }
348
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoProductResponseTransformers, providedIn: 'root' }); }
349
349
  }
350
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffMagentoProductResponseTransformers, decorators: [{
350
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoProductResponseTransformers, decorators: [{
351
351
  type: Injectable,
352
352
  args: [{
353
353
  providedIn: 'root',
@@ -710,11 +710,12 @@ const getProductByUrl = (extraProductFragments = []) => gql `
710
710
  ${daffBuildFragmentDefinition(...extraProductFragments)}
711
711
  `;
712
712
 
713
+ const isValid$1 = (response) => !!response.data?.route?.sku;
713
714
  const magentoProductGetByUrlValidator = (response) => {
714
- if (!response.data?.route?.sku) {
715
- throw new DaffProductInvalidAPIResponseError('The platform did not respond with a product.');
715
+ if (isValid$1(response)) {
716
+ return response;
716
717
  }
717
- return response;
718
+ throw new DaffProductInvalidAPIResponseError('The platform did not respond with a product.');
718
719
  };
719
720
 
720
721
  const DAFF_MAGENTO_GET_FILTER_TYPES_QUERY_NAME = 'MagentoGetProductFilterFieldTypes';
@@ -731,6 +732,14 @@ query ${DAFF_MAGENTO_GET_FILTER_TYPES_QUERY_NAME} {
731
732
  }
732
733
  `;
733
734
 
735
+ const isValid = (response) => !!response.data?.products?.items;
736
+ const magentoProductGetAllValidator = (response) => {
737
+ if (isValid(response)) {
738
+ return response;
739
+ }
740
+ throw new DaffProductInvalidAPIResponseError('The platform did not respond with products.');
741
+ };
742
+
734
743
  /**
735
744
  * A service for making magento apollo queries for products of type, {@link DaffProduct}.
736
745
  *
@@ -777,12 +786,12 @@ class DaffMagentoProductService {
777
786
  ...this.extraFragments,
778
787
  ...this.extraPageFragments,
779
788
  ]),
780
- }).pipe(map(result => this.magentoProductsTransformer.transformManyMagentoProducts(result.data.products.items, this.config.baseMediaUrl)));
789
+ }).pipe(map(magentoProductGetAllValidator), map(result => this.magentoProductsTransformer.transformManyMagentoProducts(result.data.products.items, this.config.baseMediaUrl)));
781
790
  }
782
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffMagentoProductService, deps: [{ token: i1.Apollo }, { token: MAGENTO_PRODUCT_CONFIG_TOKEN }, { token: DAFF_PRODUCT_MAGENTO_PRODUCT_RESPONSE_TRANSFORM }, { token: DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_PAGE_FRAGMENTS }, { token: DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_FRAGMENTS }, { token: DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_PREVIEW_FRAGMENTS }, { token: DaffMagentoProductsTransformer }], target: i0.ɵɵFactoryTarget.Injectable }); }
783
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffMagentoProductService, providedIn: 'root' }); }
791
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoProductService, deps: [{ token: i1.Apollo }, { token: MAGENTO_PRODUCT_CONFIG_TOKEN }, { token: DAFF_PRODUCT_MAGENTO_PRODUCT_RESPONSE_TRANSFORM }, { token: DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_PAGE_FRAGMENTS }, { token: DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_FRAGMENTS }, { token: DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_PREVIEW_FRAGMENTS }, { token: DaffMagentoProductsTransformer }], target: i0.ɵɵFactoryTarget.Injectable }); }
792
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoProductService, providedIn: 'root' }); }
784
793
  }
785
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffMagentoProductService, decorators: [{
794
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoProductService, decorators: [{
786
795
  type: Injectable,
787
796
  args: [{
788
797
  providedIn: 'root',
@@ -819,11 +828,11 @@ class DaffProductMagentoDriverModule {
819
828
  ],
820
829
  };
821
830
  }
822
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffProductMagentoDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
823
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.18", ngImport: i0, type: DaffProductMagentoDriverModule, imports: [CommonModule] }); }
824
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffProductMagentoDriverModule, imports: [CommonModule] }); }
831
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffProductMagentoDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
832
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: DaffProductMagentoDriverModule, imports: [CommonModule] }); }
833
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffProductMagentoDriverModule, imports: [CommonModule] }); }
825
834
  }
826
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffProductMagentoDriverModule, decorators: [{
835
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffProductMagentoDriverModule, decorators: [{
827
836
  type: NgModule,
828
837
  args: [{
829
838
  imports: [
@@ -842,5 +851,5 @@ const provideDaffProductMagentoDriver = (config = MAGENTO_PRODUCT_CONFIG_DEFAULT
842
851
  * Generated bundle index. Do not edit.
843
852
  */
844
853
 
845
- export { DAFF_MAGENTO_GET_ALL_PRODUCTS_QUERY_NAME, DAFF_MAGENTO_GET_A_PRODUCT_BY_URL_QUERY_NAME, DAFF_MAGENTO_GET_A_PRODUCT_QUERY_NAME, DAFF_MAGENTO_GET_FILTER_TYPES_QUERY_NAME, DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_FRAGMENTS, DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_PAGE_FRAGMENTS, DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_PREVIEW_FRAGMENTS, DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_PREVIEW_TRANSFORMS, DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_RESPONSE_TRANSFORMS, DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_TRANSFORMS, DAFF_PRODUCT_MAGENTO_PRODUCT_PREVIEW_TRANSFORM, DAFF_PRODUCT_MAGENTO_PRODUCT_RESPONSE_TRANSFORM, DAFF_PRODUCT_MAGENTO_PRODUCT_TRANSFORM, DaffMagentoProductResponseTransformers, DaffMagentoProductService, DaffMagentoProductsTransformer, DaffMagentoSimpleProductTransformers, DaffProductMagentoDriverModule, MAGENTO_PRODUCT_CONFIG_DEFAULT, MAGENTO_PRODUCT_CONFIG_TOKEN, MagentoProductAppliedFiltersTransformService, MagentoProductFilterActionEnum, MagentoProductFilterType, MagentoProductGetFilterTypes, MagentoProductStockStatusEnum, MagentoProductTypeEnum, MagentoSortDirectionEnum, getAllProducts, getProduct, getProductByUrl, magentoAppliedSortOptionTransform, magentoProductAddMetadataTypesToAggregates, magentoProductAggregationsFragment, magentoProductCollectionMetadataTransform, magentoProductFragment, magentoProductGetByUrlValidator, magentoProductGetMatchedAttributeType, magentoProductPageFragment, magentoProductPreviewFragment, magentoProductSortFieldsFragment, magentoProductTransformAggregate, provideDaffProductMagentoDriver, provideDaffProductMagentoExtraProductFragments, provideDaffProductMagentoExtraProductPageFragments, provideDaffProductMagentoExtraProductPreviewFragments, provideDaffProductMagentoExtraProductPreviewTransforms, provideDaffProductMagentoExtraProductResponseTransforms, provideDaffProductMagentoExtraProductTransforms, provideMagentoProductConfig };
854
+ export { DAFF_MAGENTO_GET_ALL_PRODUCTS_QUERY_NAME, DAFF_MAGENTO_GET_A_PRODUCT_BY_URL_QUERY_NAME, DAFF_MAGENTO_GET_A_PRODUCT_QUERY_NAME, DAFF_MAGENTO_GET_FILTER_TYPES_QUERY_NAME, DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_FRAGMENTS, DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_PAGE_FRAGMENTS, DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_PREVIEW_FRAGMENTS, DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_PREVIEW_TRANSFORMS, DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_RESPONSE_TRANSFORMS, DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_TRANSFORMS, DAFF_PRODUCT_MAGENTO_PRODUCT_PREVIEW_TRANSFORM, DAFF_PRODUCT_MAGENTO_PRODUCT_RESPONSE_TRANSFORM, DAFF_PRODUCT_MAGENTO_PRODUCT_TRANSFORM, DaffMagentoProductResponseTransformers, DaffMagentoProductService, DaffMagentoProductsTransformer, DaffMagentoSimpleProductTransformers, DaffProductMagentoDriverModule, MAGENTO_PRODUCT_CONFIG_DEFAULT, MAGENTO_PRODUCT_CONFIG_TOKEN, MagentoProductAppliedFiltersTransformService, MagentoProductFilterActionEnum, MagentoProductFilterType, MagentoProductGetFilterTypes, MagentoProductStockStatusEnum, MagentoProductTypeEnum, MagentoSortDirectionEnum, getAllProducts, getProduct, getProductByUrl, magentoAppliedSortOptionTransform, magentoProductAddMetadataTypesToAggregates, magentoProductAggregationsFragment, magentoProductCollectionMetadataTransform, magentoProductFragment, magentoProductGetAllValidator, magentoProductGetByUrlValidator, magentoProductGetMatchedAttributeType, magentoProductPageFragment, magentoProductPreviewFragment, magentoProductSortFieldsFragment, magentoProductTransformAggregate, provideDaffProductMagentoDriver, provideDaffProductMagentoExtraProductFragments, provideDaffProductMagentoExtraProductPageFragments, provideDaffProductMagentoExtraProductPreviewFragments, provideDaffProductMagentoExtraProductPreviewTransforms, provideDaffProductMagentoExtraProductResponseTransforms, provideDaffProductMagentoExtraProductTransforms, provideMagentoProductConfig };
846
855
  //# sourceMappingURL=daffodil-product-driver-magento.mjs.map