@daffodil/product 0.78.0 → 0.80.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/driver/in-memory/injection-tokens/public_api.d.ts +1 -1
- package/driver/in-memory/injection-tokens/transforms/product-response/response-extra.token.d.ts +1 -20
- package/driver/in-memory/injection-tokens/transforms/product-response/response.token.d.ts +1 -5
- package/driver/interfaces/product-service.interface.d.ts +1 -5
- package/driver/magento/injection-tokens/fragments/product-page.token.d.ts +1 -27
- package/driver/magento/injection-tokens/fragments/product-preview.token.d.ts +1 -31
- package/driver/magento/injection-tokens/fragments/product.token.d.ts +1 -27
- package/driver/magento/injection-tokens/public_api.d.ts +6 -6
- package/driver/magento/injection-tokens/transforms/product/extra.token.d.ts +4 -10
- package/driver/magento/injection-tokens/transforms/product/token.d.ts +1 -4
- package/driver/magento/injection-tokens/transforms/product-preview/preview-extra.token.d.ts +4 -10
- package/driver/magento/injection-tokens/transforms/product-preview/preview.token.d.ts +1 -5
- package/driver/magento/injection-tokens/transforms/product-response/response-extra.token.d.ts +1 -22
- package/driver/magento/injection-tokens/transforms/product-response/response.token.d.ts +1 -5
- package/driver/magento/interfaces/config.interface.d.ts +1 -6
- package/driver/public_api.d.ts +1 -1
- package/esm2022/driver/in-memory/driver/product-driver.module.mjs +5 -8
- package/esm2022/driver/in-memory/injection-tokens/public_api.mjs +2 -2
- package/esm2022/driver/in-memory/injection-tokens/transforms/product-response/response-extra.token.mjs +6 -11
- package/esm2022/driver/in-memory/injection-tokens/transforms/product-response/response.token.mjs +9 -3
- package/esm2022/driver/interfaces/product-service.interface.mjs +8 -3
- package/esm2022/driver/magento/injection-tokens/fragments/product-page.token.mjs +6 -11
- package/esm2022/driver/magento/injection-tokens/fragments/product-preview.token.mjs +6 -11
- package/esm2022/driver/magento/injection-tokens/fragments/product.token.mjs +6 -11
- package/esm2022/driver/magento/injection-tokens/public_api.mjs +7 -7
- package/esm2022/driver/magento/injection-tokens/transforms/product/extra.token.mjs +7 -10
- package/esm2022/driver/magento/injection-tokens/transforms/product/token.mjs +9 -3
- package/esm2022/driver/magento/injection-tokens/transforms/product-preview/preview-extra.token.mjs +7 -10
- package/esm2022/driver/magento/injection-tokens/transforms/product-preview/preview.token.mjs +9 -3
- package/esm2022/driver/magento/injection-tokens/transforms/product-response/response-extra.token.mjs +6 -11
- package/esm2022/driver/magento/injection-tokens/transforms/product-response/response.token.mjs +9 -3
- package/esm2022/driver/magento/interfaces/config.interface.mjs +8 -3
- package/esm2022/driver/magento/product-driver.module.mjs +7 -30
- package/esm2022/driver/public_api.mjs +2 -2
- package/esm2022/driver/shopify/product-driver.module.mjs +3 -6
- package/esm2022/driver/testing/drivers/product-driver.module.mjs +3 -6
- package/esm2022/routing/config/default.mjs +4 -1
- package/esm2022/routing/config/public_api.mjs +3 -3
- package/esm2022/routing/config/token.mjs +9 -7
- package/esm2022/routing/discrete-filter-params/token.mjs +4 -6
- package/esm2022/routing/module.mjs +4 -11
- package/esm2022/routing/resolvers/product-page/product-page.resolver.mjs +2 -2
- package/esm2022/state/facades/product/product-facade.interface.mjs +1 -1
- package/esm2022/state/injection-tokens/error-matcher.token.mjs +8 -3
- package/esm2022/state/injection-tokens/public_api.mjs +2 -2
- package/esm2022/state/reducers/injection-tokens/config.token.mjs +9 -3
- package/esm2022/state/reducers/injection-tokens/extra.token.mjs +5 -10
- package/esm2022/state/reducers/injection-tokens/meta.token.mjs +5 -10
- package/esm2022/state/reducers/injection-tokens/reducers.token.mjs +9 -3
- package/esm2022/state/testing/mock-product-facade.mjs +3 -3
- package/esm2022/testing/injection-tokens/factories/extra.token.mjs +6 -11
- package/esm2022/testing/injection-tokens/factories/type.token.mjs +6 -11
- package/esm2022/testing/injection-tokens/public_api.mjs +3 -3
- package/esm2022/testing/testing.module.mjs +4 -12
- package/fesm2022/daffodil-product-driver-in-memory.mjs +17 -19
- package/fesm2022/daffodil-product-driver-in-memory.mjs.map +1 -1
- package/fesm2022/daffodil-product-driver-magento.mjs +58 -87
- package/fesm2022/daffodil-product-driver-magento.mjs.map +1 -1
- package/fesm2022/daffodil-product-driver-shopify.mjs +2 -5
- package/fesm2022/daffodil-product-driver-shopify.mjs.map +1 -1
- package/fesm2022/daffodil-product-driver-testing.mjs +2 -5
- package/fesm2022/daffodil-product-driver-testing.mjs.map +1 -1
- package/fesm2022/daffodil-product-driver.mjs +8 -4
- package/fesm2022/daffodil-product-driver.mjs.map +1 -1
- package/fesm2022/daffodil-product-routing.mjs +13 -17
- package/fesm2022/daffodil-product-routing.mjs.map +1 -1
- package/fesm2022/daffodil-product-state-testing.mjs +2 -2
- package/fesm2022/daffodil-product-state-testing.mjs.map +1 -1
- package/fesm2022/daffodil-product-state.mjs +27 -22
- package/fesm2022/daffodil-product-state.mjs.map +1 -1
- package/fesm2022/daffodil-product-testing.mjs +13 -31
- package/fesm2022/daffodil-product-testing.mjs.map +1 -1
- package/package.json +1 -1
- package/routing/config/default.d.ts +2 -0
- package/routing/config/public_api.d.ts +2 -2
- package/routing/config/token.d.ts +1 -5
- package/routing/discrete-filter-params/token.d.ts +2 -9
- package/routing/resolvers/product-page/product-page.resolver.d.ts +1 -1
- package/state/facades/product/product-facade.interface.d.ts +1 -1
- package/state/injection-tokens/error-matcher.token.d.ts +1 -6
- package/state/injection-tokens/public_api.d.ts +1 -1
- package/state/reducers/injection-tokens/config.token.d.ts +1 -7
- package/state/reducers/injection-tokens/extra.token.d.ts +1 -20
- package/state/reducers/injection-tokens/meta.token.d.ts +1 -20
- package/state/reducers/injection-tokens/reducers.token.d.ts +1 -8
- package/state/testing/mock-product-facade.d.ts +2 -2
- package/testing/injection-tokens/factories/extra.token.d.ts +1 -24
- package/testing/injection-tokens/factories/type.token.d.ts +1 -22
- package/testing/injection-tokens/public_api.d.ts +2 -2
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { Injectable, inject, Inject, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1 from 'apollo-angular';
|
|
4
4
|
import { gql } from 'apollo-angular';
|
|
5
5
|
import { of } from 'rxjs';
|
|
6
6
|
import { map } from 'rxjs/operators';
|
|
7
|
-
import { DaffFilterType, DaffSortDirectionEnum, daffFilterArrayToDict } from '@daffodil/core';
|
|
7
|
+
import { createMultiInjectionToken, DaffFilterType, createSingleInjectionToken, DaffSortDirectionEnum, daffFilterArrayToDict, createConfigInjectionToken } from '@daffodil/core';
|
|
8
8
|
import { DaffProductTypeEnum } from '@daffodil/product';
|
|
9
9
|
import { daffUriTruncateLeadingPathSegments, daffUriTruncateFileExtension, daffUriTruncateQueryFragment } from '@daffodil/core/routing';
|
|
10
10
|
import { daffBuildFragmentNameSpread, daffBuildFragmentDefinition } from '@daffodil/core/graphql';
|
|
11
11
|
import { CommonModule } from '@angular/common';
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
12
|
+
import { provideManyDaffMagentoCacheableOperations } from '@daffodil/driver/magento';
|
|
13
|
+
import { provideDaffProductDriver } from '@daffodil/product/driver';
|
|
14
14
|
|
|
15
|
+
const {
|
|
15
16
|
/**
|
|
16
17
|
* A multi-provider injection token for providing extra transform logic in the Product Magento driver.
|
|
17
18
|
* It is run after the standard transforms and passed both the current transformed Daffodil response and the Magento product response.
|
|
18
19
|
*/
|
|
19
|
-
|
|
20
|
+
token: DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_RESPONSE_TRANSFORMS,
|
|
20
21
|
/**
|
|
21
22
|
* Provides extra product transforms for the Magento product driver.
|
|
22
23
|
*
|
|
@@ -24,19 +25,13 @@ const DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_RESPONSE_TRANSFORMS = new InjectionToke
|
|
|
24
25
|
*
|
|
25
26
|
* ```ts
|
|
26
27
|
* providers: [
|
|
27
|
-
* ...
|
|
28
|
+
* ...provideDaffProductMagentoExtraProductResponseTransforms(
|
|
28
29
|
* myExtraProductTransform
|
|
29
30
|
* )
|
|
30
31
|
* ]
|
|
31
32
|
* ```
|
|
32
33
|
*/
|
|
33
|
-
|
|
34
|
-
return transforms.map(transform => ({
|
|
35
|
-
provide: DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_RESPONSE_TRANSFORMS,
|
|
36
|
-
useValue: transform,
|
|
37
|
-
multi: true,
|
|
38
|
-
}));
|
|
39
|
-
}
|
|
34
|
+
provider: provideDaffProductMagentoExtraProductResponseTransforms, } = createMultiInjectionToken('DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_RESPONSE_TRANSFORMS');
|
|
40
35
|
|
|
41
36
|
var MagentoProductTypeEnum;
|
|
42
37
|
(function (MagentoProductTypeEnum) {
|
|
@@ -128,13 +123,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
128
123
|
}]
|
|
129
124
|
}] });
|
|
130
125
|
|
|
126
|
+
const {
|
|
131
127
|
/**
|
|
132
128
|
* A multi-provider injection token for providing extra transform logic in the Product Magento driver.
|
|
133
129
|
* It is run after the standard transforms for each product preview and passed both the current transformed Daffodil product and the Magento product.
|
|
134
130
|
*
|
|
135
131
|
* See {@link MagentoProductPreview} for more info.
|
|
136
132
|
*/
|
|
137
|
-
|
|
133
|
+
token: DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_PREVIEW_TRANSFORMS, provider: provider$1, } = createMultiInjectionToken('DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_PREVIEW_TRANSFORMS');
|
|
138
134
|
/**
|
|
139
135
|
* Provides extra product preview transforms for the Magento product driver.
|
|
140
136
|
*
|
|
@@ -142,18 +138,14 @@ const DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_PREVIEW_TRANSFORMS = new InjectionToken
|
|
|
142
138
|
*
|
|
143
139
|
* ```ts
|
|
144
140
|
* providers: [
|
|
145
|
-
* ...
|
|
141
|
+
* ...provideDaffProductMagentoExtraProductPreviewTransforms(
|
|
146
142
|
* myExtraProductTransform
|
|
147
143
|
* )
|
|
148
144
|
* ]
|
|
149
145
|
* ```
|
|
150
146
|
*/
|
|
151
|
-
function
|
|
152
|
-
return transforms
|
|
153
|
-
provide: DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_PREVIEW_TRANSFORMS,
|
|
154
|
-
useValue: transform,
|
|
155
|
-
multi: true,
|
|
156
|
-
}));
|
|
147
|
+
function provideDaffProductMagentoExtraProductPreviewTransforms(...transforms) {
|
|
148
|
+
return provider$1(...transforms);
|
|
157
149
|
}
|
|
158
150
|
|
|
159
151
|
/**
|
|
@@ -209,10 +201,15 @@ function getDiscount(product) {
|
|
|
209
201
|
} : { amount: null, percent: null };
|
|
210
202
|
}
|
|
211
203
|
|
|
204
|
+
const {
|
|
212
205
|
/**
|
|
213
206
|
* An internal token to combine the Magento preview transform with the injected transforms.
|
|
214
207
|
*/
|
|
215
|
-
|
|
208
|
+
token: DAFF_PRODUCT_MAGENTO_PRODUCT_PREVIEW_TRANSFORM,
|
|
209
|
+
/**
|
|
210
|
+
* Provider function for {@link DAFF_PRODUCT_MAGENTO_PRODUCT_PREVIEW_TRANSFORM}.
|
|
211
|
+
*/
|
|
212
|
+
provider: provideDaffProductMagentoProductPreviewTransform, } = createSingleInjectionToken('DAFF_PRODUCT_MAGENTO_PRODUCT_PREVIEW_TRANSFORM', {
|
|
216
213
|
factory: () => {
|
|
217
214
|
const transforms = inject(DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_PREVIEW_TRANSFORMS);
|
|
218
215
|
return (magentoProduct, mediaUrl) => transforms.reduce((daffProduct, transform) => transform(daffProduct, magentoProduct, mediaUrl), transformMagentoProductPreview(magentoProduct));
|
|
@@ -287,13 +284,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
287
284
|
}]
|
|
288
285
|
}], ctorParameters: () => [{ type: DaffMagentoSimpleProductTransformers }] });
|
|
289
286
|
|
|
287
|
+
const {
|
|
290
288
|
/**
|
|
291
289
|
* A multi-provider injection token for providing extra transform logic in the Product Magento driver.
|
|
292
290
|
* It is run after the standard transforms for each product preview and passed both the current transformed Daffodil product and the Magento product.
|
|
293
291
|
*
|
|
294
292
|
* See {@link MagentoProduct} for more info.
|
|
295
293
|
*/
|
|
296
|
-
|
|
294
|
+
token: DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_TRANSFORMS, provider, } = createMultiInjectionToken('DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_TRANSFORMS');
|
|
297
295
|
/**
|
|
298
296
|
* Provides extra product preview transforms for the Magento product driver.
|
|
299
297
|
*
|
|
@@ -301,24 +299,25 @@ const DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_TRANSFORMS = new InjectionToken('DAFF_P
|
|
|
301
299
|
*
|
|
302
300
|
* ```ts
|
|
303
301
|
* providers: [
|
|
304
|
-
* ...
|
|
302
|
+
* ...provideDaffProductMagentoExtraProductTransforms(
|
|
305
303
|
* myExtraProductTransform
|
|
306
304
|
* )
|
|
307
305
|
* ]
|
|
308
306
|
* ```
|
|
309
307
|
*/
|
|
310
|
-
function
|
|
311
|
-
return transforms
|
|
312
|
-
provide: DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_TRANSFORMS,
|
|
313
|
-
useValue: transform,
|
|
314
|
-
multi: true,
|
|
315
|
-
}));
|
|
308
|
+
function provideDaffProductMagentoExtraProductTransforms(...transforms) {
|
|
309
|
+
return provider(...transforms);
|
|
316
310
|
}
|
|
317
311
|
|
|
312
|
+
const {
|
|
318
313
|
/**
|
|
319
314
|
* An internal token to combine the Magento preview transform with the injected transforms.
|
|
320
315
|
*/
|
|
321
|
-
|
|
316
|
+
token: DAFF_PRODUCT_MAGENTO_PRODUCT_TRANSFORM,
|
|
317
|
+
/**
|
|
318
|
+
* Provider function for {@link DAFF_PRODUCT_MAGENTO_PRODUCT_TRANSFORM}.
|
|
319
|
+
*/
|
|
320
|
+
provider: provideDaffProductMagentoProductTransform, } = createSingleInjectionToken('DAFF_PRODUCT_MAGENTO_PRODUCT_TRANSFORM', {
|
|
322
321
|
factory: () => {
|
|
323
322
|
const transforms = inject(DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_TRANSFORMS);
|
|
324
323
|
const transformer = inject(DaffMagentoProductsTransformer);
|
|
@@ -453,10 +452,15 @@ const magentoProductCollectionMetadataTransform = (aggregates, pageInfo, sortFie
|
|
|
453
452
|
appliedSortOption: appliedSortOption || sortFields.default,
|
|
454
453
|
});
|
|
455
454
|
|
|
455
|
+
const {
|
|
456
456
|
/**
|
|
457
457
|
* An internal token to combine the Magento response transform with the injected transforms.
|
|
458
458
|
*/
|
|
459
|
-
|
|
459
|
+
token: DAFF_PRODUCT_MAGENTO_PRODUCT_RESPONSE_TRANSFORM,
|
|
460
|
+
/**
|
|
461
|
+
* Provider function for {@link DAFF_PRODUCT_MAGENTO_PRODUCT_RESPONSE_TRANSFORM}.
|
|
462
|
+
*/
|
|
463
|
+
provider: provideDaffProductMagentoProductResponseTransform, } = createSingleInjectionToken('DAFF_PRODUCT_MAGENTO_PRODUCT_RESPONSE_TRANSFORM', {
|
|
460
464
|
factory: () => {
|
|
461
465
|
const transforms = inject(DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_RESPONSE_TRANSFORMS);
|
|
462
466
|
const daffResponseTransformer = inject(DaffMagentoProductResponseTransformers);
|
|
@@ -464,6 +468,7 @@ const DAFF_PRODUCT_MAGENTO_PRODUCT_RESPONSE_TRANSFORM = new InjectionToken('DAFF
|
|
|
464
468
|
},
|
|
465
469
|
});
|
|
466
470
|
|
|
471
|
+
const {
|
|
467
472
|
/**
|
|
468
473
|
* A multi-provider injection token for providing extra GraphQL fragments that will be spread into product queries.
|
|
469
474
|
* This can be used to retrieve additional data that is not covered by the standard Daffodil interfaces.
|
|
@@ -475,7 +480,7 @@ const DAFF_PRODUCT_MAGENTO_PRODUCT_RESPONSE_TRANSFORM = new InjectionToken('DAFF
|
|
|
475
480
|
* Apps using this token should therefore increase the query complexity limit
|
|
476
481
|
* to accommodate the extra complexity contributed by the provided fragments.
|
|
477
482
|
*/
|
|
478
|
-
|
|
483
|
+
token: DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_PAGE_FRAGMENTS,
|
|
479
484
|
/**
|
|
480
485
|
* Provides extra GraphQL fragments for the Magento product driver.
|
|
481
486
|
*
|
|
@@ -483,20 +488,15 @@ const DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_PAGE_FRAGMENTS = new InjectionToken('DA
|
|
|
483
488
|
*
|
|
484
489
|
* ```ts
|
|
485
490
|
* providers: [
|
|
486
|
-
* ...
|
|
491
|
+
* ...provideDaffProductMagentoExtraProductPageFragments(
|
|
487
492
|
* myExtraProductFragment
|
|
488
493
|
* )
|
|
489
494
|
* ]
|
|
490
495
|
* ```
|
|
491
496
|
*/
|
|
492
|
-
|
|
493
|
-
return fragments.map(fragment => ({
|
|
494
|
-
provide: DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_PAGE_FRAGMENTS,
|
|
495
|
-
useValue: fragment,
|
|
496
|
-
multi: true,
|
|
497
|
-
}));
|
|
498
|
-
}
|
|
497
|
+
provider: provideDaffProductMagentoExtraProductPageFragments, } = createMultiInjectionToken('DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_PAGE_FRAGMENTS');
|
|
499
498
|
|
|
499
|
+
const {
|
|
500
500
|
/**
|
|
501
501
|
* A multi-provider injection token for providing extra GraphQL fragments that will be spread into product preview queries.
|
|
502
502
|
* This can be used to retrieve additional data that is not covered by the standard Daffodil interfaces.
|
|
@@ -512,7 +512,7 @@ function daffProvideProductMagentoExtraProductPageFragments(...fragments) {
|
|
|
512
512
|
* Apps using this token should therefore increase the query complexity limit
|
|
513
513
|
* to accommodate the extra complexity contributed by the provided fragments.
|
|
514
514
|
*/
|
|
515
|
-
|
|
515
|
+
token: DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_PREVIEW_FRAGMENTS,
|
|
516
516
|
/**
|
|
517
517
|
* Provides extra GraphQL fragments for the Magento product preview query.
|
|
518
518
|
*
|
|
@@ -520,20 +520,15 @@ const DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_PREVIEW_FRAGMENTS = new InjectionToken(
|
|
|
520
520
|
*
|
|
521
521
|
* ```ts
|
|
522
522
|
* providers: [
|
|
523
|
-
* ...
|
|
523
|
+
* ...provideDaffProductMagentoExtraProductPreviewFragments(
|
|
524
524
|
* myExtraProductPreviewFragment
|
|
525
525
|
* )
|
|
526
526
|
* ]
|
|
527
527
|
* ```
|
|
528
528
|
*/
|
|
529
|
-
|
|
530
|
-
return fragments.map(fragment => ({
|
|
531
|
-
provide: DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_PREVIEW_FRAGMENTS,
|
|
532
|
-
useValue: fragment,
|
|
533
|
-
multi: true,
|
|
534
|
-
}));
|
|
535
|
-
}
|
|
529
|
+
provider: provideDaffProductMagentoExtraProductPreviewFragments, } = createMultiInjectionToken('DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_PREVIEW_FRAGMENTS');
|
|
536
530
|
|
|
531
|
+
const {
|
|
537
532
|
/**
|
|
538
533
|
* A multi-provider injection token for providing extra GraphQL fragments that will be spread into product queries.
|
|
539
534
|
* This can be used to retrieve additional data that is not covered by the standard Daffodil interfaces.
|
|
@@ -545,7 +540,7 @@ function daffProvideProductMagentoExtraProductPreviewFragments(...fragments) {
|
|
|
545
540
|
* Apps using this token should therefore increase the query complexity limit
|
|
546
541
|
* to accommodate the extra complexity contributed by the provided fragments.
|
|
547
542
|
*/
|
|
548
|
-
|
|
543
|
+
token: DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_FRAGMENTS,
|
|
549
544
|
/**
|
|
550
545
|
* Provides extra GraphQL fragments for the Magento product driver.
|
|
551
546
|
*
|
|
@@ -553,19 +548,13 @@ const DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_FRAGMENTS = new InjectionToken('DAFF_PR
|
|
|
553
548
|
*
|
|
554
549
|
* ```ts
|
|
555
550
|
* providers: [
|
|
556
|
-
* ...
|
|
551
|
+
* ...provideDaffProductMagentoExtraProductFragments(
|
|
557
552
|
* myExtraProductFragment
|
|
558
553
|
* )
|
|
559
554
|
* ]
|
|
560
555
|
* ```
|
|
561
556
|
*/
|
|
562
|
-
|
|
563
|
-
return fragments.map(fragment => ({
|
|
564
|
-
provide: DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_FRAGMENTS,
|
|
565
|
-
useValue: fragment,
|
|
566
|
-
multi: true,
|
|
567
|
-
}));
|
|
568
|
-
}
|
|
557
|
+
provider: provideDaffProductMagentoExtraProductFragments, } = createMultiInjectionToken('DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_FRAGMENTS');
|
|
569
558
|
|
|
570
559
|
/**
|
|
571
560
|
* The default configuration for the {@link DaffProductMagentoDriverConfig}.
|
|
@@ -576,11 +565,16 @@ const MAGENTO_PRODUCT_CONFIG_DEFAULT = {
|
|
|
576
565
|
urlTruncationStrategy: magentoProductTruncateUrl,
|
|
577
566
|
};
|
|
578
567
|
|
|
568
|
+
const {
|
|
579
569
|
/**
|
|
580
570
|
* The token used to provide @daffodil/product/driver/magento config data.
|
|
581
571
|
* Mandatory for the Magento driver.
|
|
582
572
|
*/
|
|
583
|
-
|
|
573
|
+
token: MAGENTO_PRODUCT_CONFIG_TOKEN,
|
|
574
|
+
/**
|
|
575
|
+
* Provider function for {@link MAGENTO_PRODUCT_CONFIG_TOKEN}.
|
|
576
|
+
*/
|
|
577
|
+
provider: provideMagentoProductConfig, } = createConfigInjectionToken(MAGENTO_PRODUCT_CONFIG_DEFAULT, 'MAGENTO_PRODUCT_CONFIG_TOKEN');
|
|
584
578
|
|
|
585
579
|
const magentoProductPreviewFragment = gql `
|
|
586
580
|
fragment magentoProductPreview on ProductInterface {
|
|
@@ -809,32 +803,9 @@ class DaffProductMagentoDriverModule {
|
|
|
809
803
|
return {
|
|
810
804
|
ngModule: DaffProductMagentoDriverModule,
|
|
811
805
|
providers: [
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
},
|
|
816
|
-
{
|
|
817
|
-
provide: DAFF_MAGENTO_CACHEABLE_OPERATIONS,
|
|
818
|
-
useValue: DAFF_MAGENTO_GET_ALL_PRODUCTS_QUERY_NAME,
|
|
819
|
-
multi: true,
|
|
820
|
-
},
|
|
821
|
-
{
|
|
822
|
-
provide: DAFF_MAGENTO_CACHEABLE_OPERATIONS,
|
|
823
|
-
useValue: DAFF_MAGENTO_GET_A_PRODUCT_QUERY_NAME,
|
|
824
|
-
multi: true,
|
|
825
|
-
},
|
|
826
|
-
{
|
|
827
|
-
provide: DAFF_MAGENTO_CACHEABLE_OPERATIONS,
|
|
828
|
-
useValue: DAFF_MAGENTO_GET_A_PRODUCT_BY_URL_QUERY_NAME,
|
|
829
|
-
multi: true,
|
|
830
|
-
},
|
|
831
|
-
{
|
|
832
|
-
provide: MAGENTO_PRODUCT_CONFIG_TOKEN,
|
|
833
|
-
useValue: {
|
|
834
|
-
...MAGENTO_PRODUCT_CONFIG_DEFAULT,
|
|
835
|
-
...config,
|
|
836
|
-
},
|
|
837
|
-
},
|
|
806
|
+
provideDaffProductDriver(DaffMagentoProductService),
|
|
807
|
+
provideManyDaffMagentoCacheableOperations(DAFF_MAGENTO_GET_ALL_PRODUCTS_QUERY_NAME, DAFF_MAGENTO_GET_A_PRODUCT_QUERY_NAME, DAFF_MAGENTO_GET_A_PRODUCT_BY_URL_QUERY_NAME),
|
|
808
|
+
provideMagentoProductConfig(config),
|
|
838
809
|
],
|
|
839
810
|
};
|
|
840
811
|
}
|
|
@@ -869,5 +840,5 @@ query ${DAFF_MAGENTO_GET_FILTER_TYPES_QUERY_NAME} {
|
|
|
869
840
|
* Generated bundle index. Do not edit.
|
|
870
841
|
*/
|
|
871
842
|
|
|
872
|
-
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,
|
|
843
|
+
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, magentoProductGetMatchedAttributeType, magentoProductPageFragment, magentoProductPreviewFragment, magentoProductSortFieldsFragment, magentoProductTransformAggregate, magentoProductTruncateUrl, provideDaffProductMagentoExtraProductFragments, provideDaffProductMagentoExtraProductPageFragments, provideDaffProductMagentoExtraProductPreviewFragments, provideDaffProductMagentoExtraProductPreviewTransforms, provideDaffProductMagentoExtraProductResponseTransforms, provideDaffProductMagentoExtraProductTransforms, provideMagentoProductConfig };
|
|
873
844
|
//# sourceMappingURL=daffodil-product-driver-magento.mjs.map
|