@daffodil/category 0.92.3-rc.2 → 0.93.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/daffodil-category-driver-in-memory.mjs +10 -10
- package/fesm2022/daffodil-category-driver-in-memory.mjs.map +1 -1
- package/fesm2022/daffodil-category-driver-magento-testing.mjs +3 -3
- package/fesm2022/daffodil-category-driver-magento-testing.mjs.map +1 -1
- package/fesm2022/daffodil-category-driver-magento.mjs +23 -22
- package/fesm2022/daffodil-category-driver-magento.mjs.map +1 -1
- package/fesm2022/daffodil-category-driver-shopify.mjs +3 -3
- package/fesm2022/daffodil-category-driver-shopify.mjs.map +1 -1
- package/fesm2022/daffodil-category-driver-testing.mjs +7 -7
- package/fesm2022/daffodil-category-driver-testing.mjs.map +1 -1
- package/fesm2022/daffodil-category-routing.mjs +16 -16
- package/fesm2022/daffodil-category-routing.mjs.map +1 -1
- package/fesm2022/daffodil-category-state-testing.mjs +7 -7
- package/fesm2022/daffodil-category-state-testing.mjs.map +1 -1
- package/fesm2022/daffodil-category-state.mjs +23 -23
- package/fesm2022/daffodil-category-state.mjs.map +1 -1
- package/fesm2022/daffodil-category-testing.mjs +9 -9
- package/fesm2022/daffodil-category-testing.mjs.map +1 -1
- package/package.json +1 -1
- package/{driver/magento/index.d.ts → types/daffodil-category-driver-magento.d.ts} +10 -2
- package/{state/index.d.ts → types/daffodil-category-state.d.ts} +3 -2
- package/{testing/index.d.ts → types/daffodil-category-testing.d.ts} +1 -1
- /package/{driver/in-memory/index.d.ts → types/daffodil-category-driver-in-memory.d.ts} +0 -0
- /package/{driver/magento/testing/index.d.ts → types/daffodil-category-driver-magento-testing.d.ts} +0 -0
- /package/{driver/shopify/index.d.ts → types/daffodil-category-driver-shopify.d.ts} +0 -0
- /package/{driver/testing/index.d.ts → types/daffodil-category-driver-testing.d.ts} +0 -0
- /package/{driver/index.d.ts → types/daffodil-category-driver.d.ts} +0 -0
- /package/{routing/index.d.ts → types/daffodil-category-routing.d.ts} +0 -0
- /package/{state/testing/index.d.ts → types/daffodil-category-state-testing.d.ts} +0 -0
- /package/{index.d.ts → types/daffodil-category.d.ts} +0 -0
|
@@ -36,10 +36,10 @@ class DaffInMemoryCategoryService extends DaffInMemoryDriverBase {
|
|
|
36
36
|
.set('currentPage', categoryRequest.currentPage ? categoryRequest.currentPage.toString() : null);
|
|
37
37
|
return this.http.get(`${this.url}/${daffUriTruncateLeadingSlash(categoryRequest.url)}`, { params });
|
|
38
38
|
}
|
|
39
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
40
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
39
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffInMemoryCategoryService, deps: [{ token: i1.HttpClient }, { token: i2.InMemoryBackendConfig }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
40
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffInMemoryCategoryService, providedIn: 'root' }); }
|
|
41
41
|
}
|
|
42
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
42
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffInMemoryCategoryService, decorators: [{
|
|
43
43
|
type: Injectable,
|
|
44
44
|
args: [{
|
|
45
45
|
providedIn: 'root',
|
|
@@ -143,10 +143,10 @@ class DaffInMemoryBackendCategoryService {
|
|
|
143
143
|
}
|
|
144
144
|
return 1;
|
|
145
145
|
}
|
|
146
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
147
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
146
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffInMemoryBackendCategoryService, deps: [{ token: i1$1.DaffCategoryFactory }, { token: i1$1.DaffCategoryPageMetadataFactory }, { token: i2$1.DaffInMemoryBackendProductService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
147
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffInMemoryBackendCategoryService, providedIn: 'root' }); }
|
|
148
148
|
}
|
|
149
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
149
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffInMemoryBackendCategoryService, decorators: [{
|
|
150
150
|
type: Injectable,
|
|
151
151
|
args: [{
|
|
152
152
|
providedIn: 'root',
|
|
@@ -166,11 +166,11 @@ class DaffCategoryInMemoryDriverModule {
|
|
|
166
166
|
],
|
|
167
167
|
};
|
|
168
168
|
}
|
|
169
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
170
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
171
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
169
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffCategoryInMemoryDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
170
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: DaffCategoryInMemoryDriverModule, imports: [CommonModule] }); }
|
|
171
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffCategoryInMemoryDriverModule, imports: [CommonModule] }); }
|
|
172
172
|
}
|
|
173
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
173
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffCategoryInMemoryDriverModule, decorators: [{
|
|
174
174
|
type: NgModule,
|
|
175
175
|
args: [{
|
|
176
176
|
imports: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-category-driver-in-memory.mjs","sources":["../../../libs/category/driver/in-memory/src/collection-name.const.ts","../../../libs/category/driver/in-memory/src/drivers/category.service.ts","../../../libs/category/driver/in-memory/src/backend/category.service.ts","../../../libs/category/driver/in-memory/src/drivers/category-driver.module.ts","../../../libs/category/driver/in-memory/src/daffodil-category-driver-in-memory.ts"],"sourcesContent":["export const DAFF_CATEGORY_IN_MEMORY_COLLECTION_NAME = 'category';\n","import {\n HttpClient,\n HttpParams,\n} from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { InMemoryBackendConfig } from 'angular-in-memory-web-api';\nimport { Observable } from 'rxjs';\n\nimport {\n DaffGetCategoryResponse,\n DaffCategoryIdRequest,\n DaffCategoryUrlRequest,\n} from '@daffodil/category';\nimport { DaffCategoryServiceInterface } from '@daffodil/category/driver';\nimport { daffUriTruncateLeadingSlash } from '@daffodil/core/routing';\nimport { DaffInMemoryDriverBase } from '@daffodil/driver/in-memory';\n\nimport { DAFF_CATEGORY_IN_MEMORY_COLLECTION_NAME } from '../collection-name.const';\n\n/**\n * The category in memory driver for mocking the {@link DaffCategoryDriver} with in memory data.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryCategoryService extends DaffInMemoryDriverBase implements DaffCategoryServiceInterface {\n constructor(\n private http: HttpClient,\n config: InMemoryBackendConfig,\n ) {\n super(config, DAFF_CATEGORY_IN_MEMORY_COLLECTION_NAME);\n }\n\n get(categoryRequest: DaffCategoryIdRequest): Observable<DaffGetCategoryResponse> {\n const params = new HttpParams()\n .set('pageSize', categoryRequest.pageSize ? categoryRequest.pageSize.toString() : null)\n .set('currentPage', categoryRequest.currentPage ? categoryRequest.currentPage.toString() : null);\n\n return this.http.get<DaffGetCategoryResponse>(`${this.url}/${categoryRequest.id}`, { params });\n }\n\n getByUrl(categoryRequest: DaffCategoryUrlRequest): Observable<DaffGetCategoryResponse> {\n const params = new HttpParams()\n .set('pageSize', categoryRequest.pageSize ? categoryRequest.pageSize.toString() : null)\n .set('currentPage', categoryRequest.currentPage ? categoryRequest.currentPage.toString() : null);\n\n return this.http.get<DaffGetCategoryResponse>(`${this.url}/${daffUriTruncateLeadingSlash(categoryRequest.url)}`, { params });\n }\n}\n","import { Injectable } from '@angular/core';\nimport {\n InMemoryDbService,\n RequestInfoUtilities,\n ParsedRequestUrl,\n STATUS,\n} from 'angular-in-memory-web-api';\n\nimport {\n DaffCategory,\n DaffCategoryPageMetadata,\n} from '@daffodil/category';\nimport {\n DaffCategoryFactory,\n DaffCategoryPageMetadataFactory,\n} from '@daffodil/category/testing';\nimport { collect } from '@daffodil/core';\nimport { daffUriTruncateLeadingSlash } from '@daffodil/core/routing';\nimport { DaffInMemorySingleRouteableBackend } from '@daffodil/driver/in-memory';\nimport { DaffProduct } from '@daffodil/product';\nimport { DaffInMemoryBackendProductService } from '@daffodil/product/driver/in-memory';\n\nimport { DAFF_CATEGORY_IN_MEMORY_COLLECTION_NAME } from '../collection-name.const';\n\n/**\n * An in-memory service that mocks out the backend services for getting categories. See the angular in memory documentation for more details.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryBackendCategoryService implements InMemoryDbService, DaffInMemorySingleRouteableBackend {\n readonly collectionName = DAFF_CATEGORY_IN_MEMORY_COLLECTION_NAME;\n\n protected _root: DaffCategory;\n protected _categories: DaffCategory[] = [];\n protected _categoryPageMetadata: DaffCategoryPageMetadata;\n\n get rootCategory(): DaffCategory {\n return this._root;\n }\n\n /**\n * The collection of categories in the backend.\n */\n get categories(): DaffCategory[] {\n return this._categories;\n }\n\n /**\n * The metadata associated with the current page.\n */\n get categoryPageMetadata(): DaffCategoryPageMetadata {\n return this._categoryPageMetadata;\n }\n\n constructor(\n private categoryFactory: DaffCategoryFactory,\n private metadataFactory: DaffCategoryPageMetadataFactory,\n private productInMemoryBackendService: DaffInMemoryBackendProductService,\n ) {\n this._root = this.categoryFactory.createTree(\n 3,\n this.productInMemoryBackendService.products.map(({ id }) => id),\n );\n this._categories = collect(\n this._root,\n (category) => category?.children || [],\n );\n }\n\n /**\n * @docs-private\n */\n parseRequestUrl(url: string, utils: RequestInfoUtilities): ParsedRequestUrl {\n return utils.parseRequestUrl(url);\n }\n\n /**\n * @docs-private\n */\n createDb(): any {\n return {\n categories: this.categories,\n };\n }\n\n /**\n * Get a category.\n *\n * @param reqInfo\n */\n get(reqInfo: any) {\n // this method is overloaded for both get by ID and URL so we check both\n const category = this.categories.filter(({ id, url }) => id === reqInfo.id || daffUriTruncateLeadingSlash(url) === reqInfo.id)[0];\n\n if (category) {\n this._categoryPageMetadata = this.metadataFactory.create({\n id: reqInfo.id,\n pageSize: this.generatePageSize(reqInfo),\n currentPage: this.getCurrentPageParam(reqInfo),\n totalPages: this.getTotalPages(category.product_ids, this.generatePageSize(reqInfo)),\n ids: this.trimProductIdsToSinglePage(category.product_ids, this.getCurrentPageParam(reqInfo), this.generatePageSize(reqInfo)),\n count: category.total_products,\n });\n\n return reqInfo.utils.createResponse$(() => ({\n body: {\n category,\n categoryPageMetadata: this._categoryPageMetadata,\n products: this.productInMemoryBackendService.products,\n },\n status: STATUS.OK,\n }));\n } else {\n this._categoryPageMetadata = null;\n return reqInfo.utils.createResponse$(() => ({\n body: {},\n status: STATUS.NOT_FOUND,\n }));\n }\n\n }\n\n protected getTotalPages(allIds: DaffProduct['id'][], pageSize: number) {\n return Math.ceil(allIds.length/pageSize);\n }\n\n protected trimProductIdsToSinglePage(allIds: any[], currentPage: number, pageSize: number) {\n const tempIds = [...allIds];\n tempIds.splice(0, (currentPage-1) * pageSize);\n tempIds.splice(pageSize, tempIds.length-pageSize);\n\n return tempIds;\n }\n\n protected generatePageSize(reqInfo) {\n if(reqInfo.req.params.map && reqInfo.req.params.map.get('pageSize') && reqInfo.req.params.map.get('pageSize')[0]) {\n return parseInt(reqInfo.req.params.map.get('pageSize')[0], 10);\n }\n return 10;\n }\n\n protected getCurrentPageParam(reqInfo) {\n if(reqInfo.req.params.map && reqInfo.req.params.map.get('currentPage') && reqInfo.req.params.map.get('currentPage')[0]) {\n return parseInt(reqInfo.req.params.map.get('currentPage')[0], 10);\n }\n return 1;\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { provideDaffCategoryDriver } from '@daffodil/category/driver';\nimport { provideDaffInMemoryBackends } from '@daffodil/driver/in-memory';\n\nimport { DaffInMemoryCategoryService } from './category.service';\nimport { DaffInMemoryBackendCategoryService } from '../backend/category.service';\n\n/**\n * A module that provides the {@link DaffInMemoryCategoryService} for the {@link DaffCategoryDriver} token.\n */\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffCategoryInMemoryDriverModule {\n static forRoot(): ModuleWithProviders<DaffCategoryInMemoryDriverModule> {\n return {\n ngModule: DaffCategoryInMemoryDriverModule,\n providers: [\n provideDaffCategoryDriver(DaffInMemoryCategoryService),\n provideDaffInMemoryBackends(DaffInMemoryBackendCategoryService),\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2"],"mappings":";;;;;;;;;;;;;;AAAO,MAAM,uCAAuC,GAAG,UAAU;;ACmBjE;;;;AAIG;AAIG,MAAO,2BAA4B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AAC;AAChE,aAAA;SACF;IACH;kIATW,gCAAgC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAhC,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gCAAgC,YAHzC,YAAY,CAAA,EAAA,CAAA,CAAA;AAGH,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gCAAgC,YAHzC,YAAY,CAAA,EAAA,CAAA,CAAA;;4FAGH,gCAAgC,EAAA,UAAA,EAAA,CAAA;kBAL5C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACF,iBAAA;;;ACnBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"daffodil-category-driver-in-memory.mjs","sources":["../../../libs/category/driver/in-memory/src/collection-name.const.ts","../../../libs/category/driver/in-memory/src/drivers/category.service.ts","../../../libs/category/driver/in-memory/src/backend/category.service.ts","../../../libs/category/driver/in-memory/src/drivers/category-driver.module.ts","../../../libs/category/driver/in-memory/src/daffodil-category-driver-in-memory.ts"],"sourcesContent":["export const DAFF_CATEGORY_IN_MEMORY_COLLECTION_NAME = 'category';\n","import {\n HttpClient,\n HttpParams,\n} from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { InMemoryBackendConfig } from 'angular-in-memory-web-api';\nimport { Observable } from 'rxjs';\n\nimport {\n DaffGetCategoryResponse,\n DaffCategoryIdRequest,\n DaffCategoryUrlRequest,\n} from '@daffodil/category';\nimport { DaffCategoryServiceInterface } from '@daffodil/category/driver';\nimport { daffUriTruncateLeadingSlash } from '@daffodil/core/routing';\nimport { DaffInMemoryDriverBase } from '@daffodil/driver/in-memory';\n\nimport { DAFF_CATEGORY_IN_MEMORY_COLLECTION_NAME } from '../collection-name.const';\n\n/**\n * The category in memory driver for mocking the {@link DaffCategoryDriver} with in memory data.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryCategoryService extends DaffInMemoryDriverBase implements DaffCategoryServiceInterface {\n constructor(\n private http: HttpClient,\n config: InMemoryBackendConfig,\n ) {\n super(config, DAFF_CATEGORY_IN_MEMORY_COLLECTION_NAME);\n }\n\n get(categoryRequest: DaffCategoryIdRequest): Observable<DaffGetCategoryResponse> {\n const params = new HttpParams()\n .set('pageSize', categoryRequest.pageSize ? categoryRequest.pageSize.toString() : null)\n .set('currentPage', categoryRequest.currentPage ? categoryRequest.currentPage.toString() : null);\n\n return this.http.get<DaffGetCategoryResponse>(`${this.url}/${categoryRequest.id}`, { params });\n }\n\n getByUrl(categoryRequest: DaffCategoryUrlRequest): Observable<DaffGetCategoryResponse> {\n const params = new HttpParams()\n .set('pageSize', categoryRequest.pageSize ? categoryRequest.pageSize.toString() : null)\n .set('currentPage', categoryRequest.currentPage ? categoryRequest.currentPage.toString() : null);\n\n return this.http.get<DaffGetCategoryResponse>(`${this.url}/${daffUriTruncateLeadingSlash(categoryRequest.url)}`, { params });\n }\n}\n","import { Injectable } from '@angular/core';\nimport {\n InMemoryDbService,\n RequestInfoUtilities,\n ParsedRequestUrl,\n STATUS,\n} from 'angular-in-memory-web-api';\n\nimport {\n DaffCategory,\n DaffCategoryPageMetadata,\n} from '@daffodil/category';\nimport {\n DaffCategoryFactory,\n DaffCategoryPageMetadataFactory,\n} from '@daffodil/category/testing';\nimport { collect } from '@daffodil/core';\nimport { daffUriTruncateLeadingSlash } from '@daffodil/core/routing';\nimport { DaffInMemorySingleRouteableBackend } from '@daffodil/driver/in-memory';\nimport { DaffProduct } from '@daffodil/product';\nimport { DaffInMemoryBackendProductService } from '@daffodil/product/driver/in-memory';\n\nimport { DAFF_CATEGORY_IN_MEMORY_COLLECTION_NAME } from '../collection-name.const';\n\n/**\n * An in-memory service that mocks out the backend services for getting categories. See the angular in memory documentation for more details.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryBackendCategoryService implements InMemoryDbService, DaffInMemorySingleRouteableBackend {\n readonly collectionName = DAFF_CATEGORY_IN_MEMORY_COLLECTION_NAME;\n\n protected _root: DaffCategory;\n protected _categories: DaffCategory[] = [];\n protected _categoryPageMetadata: DaffCategoryPageMetadata;\n\n get rootCategory(): DaffCategory {\n return this._root;\n }\n\n /**\n * The collection of categories in the backend.\n */\n get categories(): DaffCategory[] {\n return this._categories;\n }\n\n /**\n * The metadata associated with the current page.\n */\n get categoryPageMetadata(): DaffCategoryPageMetadata {\n return this._categoryPageMetadata;\n }\n\n constructor(\n private categoryFactory: DaffCategoryFactory,\n private metadataFactory: DaffCategoryPageMetadataFactory,\n private productInMemoryBackendService: DaffInMemoryBackendProductService,\n ) {\n this._root = this.categoryFactory.createTree(\n 3,\n this.productInMemoryBackendService.products.map(({ id }) => id),\n );\n this._categories = collect(\n this._root,\n (category) => category?.children || [],\n );\n }\n\n /**\n * @docs-private\n */\n parseRequestUrl(url: string, utils: RequestInfoUtilities): ParsedRequestUrl {\n return utils.parseRequestUrl(url);\n }\n\n /**\n * @docs-private\n */\n createDb(): any {\n return {\n categories: this.categories,\n };\n }\n\n /**\n * Get a category.\n *\n * @param reqInfo\n */\n get(reqInfo: any) {\n // this method is overloaded for both get by ID and URL so we check both\n const category = this.categories.filter(({ id, url }) => id === reqInfo.id || daffUriTruncateLeadingSlash(url) === reqInfo.id)[0];\n\n if (category) {\n this._categoryPageMetadata = this.metadataFactory.create({\n id: reqInfo.id,\n pageSize: this.generatePageSize(reqInfo),\n currentPage: this.getCurrentPageParam(reqInfo),\n totalPages: this.getTotalPages(category.product_ids, this.generatePageSize(reqInfo)),\n ids: this.trimProductIdsToSinglePage(category.product_ids, this.getCurrentPageParam(reqInfo), this.generatePageSize(reqInfo)),\n count: category.total_products,\n });\n\n return reqInfo.utils.createResponse$(() => ({\n body: {\n category,\n categoryPageMetadata: this._categoryPageMetadata,\n products: this.productInMemoryBackendService.products,\n },\n status: STATUS.OK,\n }));\n } else {\n this._categoryPageMetadata = null;\n return reqInfo.utils.createResponse$(() => ({\n body: {},\n status: STATUS.NOT_FOUND,\n }));\n }\n\n }\n\n protected getTotalPages(allIds: DaffProduct['id'][], pageSize: number) {\n return Math.ceil(allIds.length/pageSize);\n }\n\n protected trimProductIdsToSinglePage(allIds: any[], currentPage: number, pageSize: number) {\n const tempIds = [...allIds];\n tempIds.splice(0, (currentPage-1) * pageSize);\n tempIds.splice(pageSize, tempIds.length-pageSize);\n\n return tempIds;\n }\n\n protected generatePageSize(reqInfo) {\n if(reqInfo.req.params.map && reqInfo.req.params.map.get('pageSize') && reqInfo.req.params.map.get('pageSize')[0]) {\n return parseInt(reqInfo.req.params.map.get('pageSize')[0], 10);\n }\n return 10;\n }\n\n protected getCurrentPageParam(reqInfo) {\n if(reqInfo.req.params.map && reqInfo.req.params.map.get('currentPage') && reqInfo.req.params.map.get('currentPage')[0]) {\n return parseInt(reqInfo.req.params.map.get('currentPage')[0], 10);\n }\n return 1;\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { provideDaffCategoryDriver } from '@daffodil/category/driver';\nimport { provideDaffInMemoryBackends } from '@daffodil/driver/in-memory';\n\nimport { DaffInMemoryCategoryService } from './category.service';\nimport { DaffInMemoryBackendCategoryService } from '../backend/category.service';\n\n/**\n * A module that provides the {@link DaffInMemoryCategoryService} for the {@link DaffCategoryDriver} token.\n */\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffCategoryInMemoryDriverModule {\n static forRoot(): ModuleWithProviders<DaffCategoryInMemoryDriverModule> {\n return {\n ngModule: DaffCategoryInMemoryDriverModule,\n providers: [\n provideDaffCategoryDriver(DaffInMemoryCategoryService),\n provideDaffInMemoryBackends(DaffInMemoryBackendCategoryService),\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2"],"mappings":";;;;;;;;;;;;;;AAAO,MAAM,uCAAuC,GAAG,UAAU;;ACmBjE;;;;AAIG;AAIG,MAAO,2BAA4B,SAAQ,sBAAsB,CAAA;IACrE,WAAA,CACU,IAAgB,EACxB,MAA6B,EAAA;AAE7B,QAAA,KAAK,CAAC,MAAM,EAAE,uCAAuC,CAAC;QAH9C,IAAA,CAAA,IAAI,GAAJ,IAAI;IAId;AAEA,IAAA,GAAG,CAAC,eAAsC,EAAA;AACxC,QAAA,MAAM,MAAM,GAAG,IAAI,UAAU;AAC1B,aAAA,GAAG,CAAC,UAAU,EAAE,eAAe,CAAC,QAAQ,GAAG,eAAe,CAAC,QAAQ,CAAC,QAAQ,EAAE,GAAG,IAAI;aACrF,GAAG,CAAC,aAAa,EAAE,eAAe,CAAC,WAAW,GAAG,eAAe,CAAC,WAAW,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC;QAElG,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAA0B,CAAA,EAAG,IAAI,CAAC,GAAG,IAAI,eAAe,CAAC,EAAE,CAAA,CAAE,EAAE,EAAE,MAAM,EAAE,CAAC;IAChG;AAEA,IAAA,QAAQ,CAAC,eAAuC,EAAA;AAC9C,QAAA,MAAM,MAAM,GAAG,IAAI,UAAU;AAC1B,aAAA,GAAG,CAAC,UAAU,EAAE,eAAe,CAAC,QAAQ,GAAG,eAAe,CAAC,QAAQ,CAAC,QAAQ,EAAE,GAAG,IAAI;aACrF,GAAG,CAAC,aAAa,EAAE,eAAe,CAAC,WAAW,GAAG,eAAe,CAAC,WAAW,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC;QAElG,OAAO,IAAI,CAAC,IAAI,CAA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;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACjBD;;AAEG;MAMU,gCAAgC,CAAA;AAC3C,IAAA,OAAO,OAAO,GAAA;QACZ,OAAO;AACL,YAAA,QAAQ,EAAE,gCAAgC;AAC1C,YAAA,SAAS,EAAE;gBACT,yBAAyB,CAAC,2BAA2B,CAAC;gBACtD,2BAA2B,CAAC,kCAAkC,CAAC;AAChE,aAAA;SACF;IACH;iIATW,gCAAgC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAhC,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gCAAgC,YAHzC,YAAY,CAAA,EAAA,CAAA,CAAA;AAGH,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gCAAgC,YAHzC,YAAY,CAAA,EAAA,CAAA,CAAA;;2FAGH,gCAAgC,EAAA,UAAA,EAAA,CAAA;kBAL5C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACF,iBAAA;;;ACnBD;;AAEG;;;;"}
|
|
@@ -25,10 +25,10 @@ class DaffCategoryDriverMagentoCategoryFactory extends DaffModelFactory {
|
|
|
25
25
|
constructor() {
|
|
26
26
|
super(MockMagentoCategory);
|
|
27
27
|
}
|
|
28
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
29
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
28
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffCategoryDriverMagentoCategoryFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
29
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffCategoryDriverMagentoCategoryFactory, providedIn: 'root' }); }
|
|
30
30
|
}
|
|
31
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
31
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffCategoryDriverMagentoCategoryFactory, decorators: [{
|
|
32
32
|
type: Injectable,
|
|
33
33
|
args: [{
|
|
34
34
|
providedIn: 'root',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-category-driver-magento-testing.mjs","sources":["../../../libs/category/driver/magento/testing/src/factories/category.factory.ts","../../../libs/category/driver/magento/testing/src/daffodil-category-driver-magento-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker/locale/en_US';\n\nimport { MagentoCategory } from '@daffodil/category/driver/magento';\nimport { DaffModelFactory } from '@daffodil/core/testing';\n\nclass MockMagentoCategory implements MagentoCategory {\n __typename = 'CategoryTree';\n uid = faker.string.alphanumeric(10);\n url_path = faker.lorem.word();\n url_suffix = '.html';\n canonical_url = faker.internet.url();\n name? = faker.lorem.word();\n description? = faker.lorem.words(40);\n meta_title? = faker.lorem.words(2);\n meta_description? = faker.lorem.words(40);\n breadcrumbs? = [];\n level? = faker.number.int(15);\n children_count? = faker.number.int(15);\n products? = { items: []};\n children?: MagentoCategory[] = [];\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCategoryDriverMagentoCategoryFactory extends DaffModelFactory<MagentoCategory> {\n constructor(){\n super(MockMagentoCategory);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAMA,MAAM,mBAAmB,CAAA;AAAzB,IAAA,WAAA,GAAA;QACE,IAAA,CAAA,UAAU,GAAG,cAAc;QAC3B,IAAA,CAAA,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC;AACnC,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE;QAC7B,IAAA,CAAA,UAAU,GAAG,OAAO;AACpB,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE;AACpC,QAAA,IAAA,CAAA,IAAI,GAAI,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE;QAC1B,IAAA,CAAA,WAAW,GAAI,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;QACpC,IAAA,CAAA,UAAU,GAAI,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;QAClC,IAAA,CAAA,gBAAgB,GAAI,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;QACzC,IAAA,CAAA,WAAW,GAAK,EAAE;QAClB,IAAA,CAAA,KAAK,GAAK,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9B,IAAA,CAAA,cAAc,GAAI,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;AACtC,QAAA,IAAA,CAAA,QAAQ,GAAK,EAAE,KAAK,EAAE,EAAE,EAAC;QACzB,IAAA,CAAA,QAAQ,GAAuB,EAAE;IACnC;AAAC;AAKK,MAAO,wCAAyC,SAAQ,gBAAiC,CAAA;AAC7F,IAAA,WAAA,GAAA;QACE,KAAK,CAAC,mBAAmB,CAAC;IAC5B;
|
|
1
|
+
{"version":3,"file":"daffodil-category-driver-magento-testing.mjs","sources":["../../../libs/category/driver/magento/testing/src/factories/category.factory.ts","../../../libs/category/driver/magento/testing/src/daffodil-category-driver-magento-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker/locale/en_US';\n\nimport { MagentoCategory } from '@daffodil/category/driver/magento';\nimport { DaffModelFactory } from '@daffodil/core/testing';\n\nclass MockMagentoCategory implements MagentoCategory {\n __typename = 'CategoryTree';\n uid = faker.string.alphanumeric(10);\n url_path = faker.lorem.word();\n url_suffix = '.html';\n canonical_url = faker.internet.url();\n name? = faker.lorem.word();\n description? = faker.lorem.words(40);\n meta_title? = faker.lorem.words(2);\n meta_description? = faker.lorem.words(40);\n breadcrumbs? = [];\n level? = faker.number.int(15);\n children_count? = faker.number.int(15);\n products? = { items: []};\n children?: MagentoCategory[] = [];\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCategoryDriverMagentoCategoryFactory extends DaffModelFactory<MagentoCategory> {\n constructor(){\n super(MockMagentoCategory);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAMA,MAAM,mBAAmB,CAAA;AAAzB,IAAA,WAAA,GAAA;QACE,IAAA,CAAA,UAAU,GAAG,cAAc;QAC3B,IAAA,CAAA,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC;AACnC,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE;QAC7B,IAAA,CAAA,UAAU,GAAG,OAAO;AACpB,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE;AACpC,QAAA,IAAA,CAAA,IAAI,GAAI,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE;QAC1B,IAAA,CAAA,WAAW,GAAI,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;QACpC,IAAA,CAAA,UAAU,GAAI,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;QAClC,IAAA,CAAA,gBAAgB,GAAI,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;QACzC,IAAA,CAAA,WAAW,GAAK,EAAE;QAClB,IAAA,CAAA,KAAK,GAAK,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9B,IAAA,CAAA,cAAc,GAAI,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;AACtC,QAAA,IAAA,CAAA,QAAQ,GAAK,EAAE,KAAK,EAAE,EAAE,EAAC;QACzB,IAAA,CAAA,QAAQ,GAAuB,EAAE;IACnC;AAAC;AAKK,MAAO,wCAAyC,SAAQ,gBAAiC,CAAA;AAC7F,IAAA,WAAA,GAAA;QACE,KAAK,CAAC,mBAAmB,CAAC;IAC5B;iIAHW,wCAAwC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAxC,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,wCAAwC,cAFvC,MAAM,EAAA,CAAA,CAAA;;2FAEP,wCAAwC,EAAA,UAAA,EAAA,CAAA;kBAHpD,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACzBD;;AAEG;;;;"}
|
|
@@ -52,11 +52,12 @@ const MagentoResolveCategoryUrl = gql `
|
|
|
52
52
|
}
|
|
53
53
|
`;
|
|
54
54
|
|
|
55
|
+
const isValid = (response) => !!response.data?.route?.uid;
|
|
55
56
|
const magentoCategoryGetByUrlValidator = (response) => {
|
|
56
|
-
if (
|
|
57
|
-
|
|
57
|
+
if (isValid(response)) {
|
|
58
|
+
return response;
|
|
58
59
|
}
|
|
59
|
-
|
|
60
|
+
throw new Error('The platform did not respond with a category.');
|
|
60
61
|
};
|
|
61
62
|
|
|
62
63
|
const magentoCategoryTreeFragment = gql `
|
|
@@ -133,10 +134,10 @@ class DaffMagentoAppliedFiltersTransformService {
|
|
|
133
134
|
...this.productFilterRequestsTransformer.transform(daffFilters),
|
|
134
135
|
};
|
|
135
136
|
}
|
|
136
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
137
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
137
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoAppliedFiltersTransformService, deps: [{ token: i1.MagentoProductAppliedFiltersTransformService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
138
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoAppliedFiltersTransformService, providedIn: 'root' }); }
|
|
138
139
|
}
|
|
139
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
140
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoAppliedFiltersTransformService, decorators: [{
|
|
140
141
|
type: Injectable,
|
|
141
142
|
args: [{
|
|
142
143
|
providedIn: 'root',
|
|
@@ -151,10 +152,10 @@ class DaffMagentoCategoryPageConfigTransformerService {
|
|
|
151
152
|
id: categoryResponse.category.uid,
|
|
152
153
|
};
|
|
153
154
|
}
|
|
154
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
155
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
155
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoCategoryPageConfigTransformerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
156
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoCategoryPageConfigTransformerService, providedIn: 'root' }); }
|
|
156
157
|
}
|
|
157
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
158
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoCategoryPageConfigTransformerService, decorators: [{
|
|
158
159
|
type: Injectable,
|
|
159
160
|
args: [{
|
|
160
161
|
providedIn: 'root',
|
|
@@ -212,10 +213,10 @@ class DaffMagentoCategoryTransformerService {
|
|
|
212
213
|
url: `/${breadcrumb.category_url_path}${category.url_suffix}`,
|
|
213
214
|
};
|
|
214
215
|
}
|
|
215
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
216
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
216
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoCategoryTransformerService, deps: [{ token: MAGENTO_CATEGORY_EXTRA_TRANSFORMS }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
217
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoCategoryTransformerService, providedIn: 'root' }); }
|
|
217
218
|
}
|
|
218
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
219
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoCategoryTransformerService, decorators: [{
|
|
219
220
|
type: Injectable,
|
|
220
221
|
args: [{
|
|
221
222
|
providedIn: 'root',
|
|
@@ -239,10 +240,10 @@ class DaffMagentoCategoryResponseTransformService {
|
|
|
239
240
|
products: completeCategory.products.map(product => this.magentoProductsTransform(product, mediaUrl)),
|
|
240
241
|
};
|
|
241
242
|
}
|
|
242
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
243
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
243
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoCategoryResponseTransformService, deps: [{ token: DaffMagentoCategoryTransformerService }, { token: DaffMagentoCategoryPageConfigTransformerService }, { token: DAFF_PRODUCT_MAGENTO_PRODUCT_TRANSFORM }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
244
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoCategoryResponseTransformService, providedIn: 'root' }); }
|
|
244
245
|
}
|
|
245
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
246
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoCategoryResponseTransformService, decorators: [{
|
|
246
247
|
type: Injectable,
|
|
247
248
|
args: [{
|
|
248
249
|
providedIn: 'root',
|
|
@@ -364,10 +365,10 @@ class DaffMagentoCategoryService {
|
|
|
364
365
|
};
|
|
365
366
|
return this.magentoCategoryResponseTransformer.transform(completeCategory, mediaUrl);
|
|
366
367
|
}
|
|
367
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
368
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
368
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoCategoryService, deps: [{ token: i1$1.Apollo }, { token: DaffMagentoCategoryResponseTransformService }, { token: DaffMagentoAppliedFiltersTransformService }, { token: MAGENTO_PRODUCT_CONFIG_TOKEN }, { token: DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_FRAGMENTS }, { token: DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_PREVIEW_FRAGMENTS }, { token: MAGENTO_CATEGORY_EXTRA_FRAGMENTS }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
369
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoCategoryService, providedIn: 'root' }); }
|
|
369
370
|
}
|
|
370
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
371
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoCategoryService, decorators: [{
|
|
371
372
|
type: Injectable,
|
|
372
373
|
args: [{
|
|
373
374
|
providedIn: 'root',
|
|
@@ -404,11 +405,11 @@ class DaffCategoryMagentoDriverModule {
|
|
|
404
405
|
],
|
|
405
406
|
};
|
|
406
407
|
}
|
|
407
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
408
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
409
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
408
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffCategoryMagentoDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
409
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: DaffCategoryMagentoDriverModule, imports: [CommonModule] }); }
|
|
410
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffCategoryMagentoDriverModule, imports: [CommonModule] }); }
|
|
410
411
|
}
|
|
411
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
412
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffCategoryMagentoDriverModule, decorators: [{
|
|
412
413
|
type: NgModule,
|
|
413
414
|
args: [{
|
|
414
415
|
imports: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-category-driver-magento.mjs","sources":["../../../libs/category/driver/magento/src/fragments/token.ts","../../../libs/category/driver/magento/src/queries/resolve-url/query.ts","../../../libs/category/driver/magento/src/queries/resolve-url/validator.ts","../../../libs/category/driver/magento/src/queries/fragments/category-tree.ts","../../../libs/category/driver/magento/src/queries/get-category-and-products.ts","../../../libs/category/driver/magento/src/transformers/applied-filter-transformer.service.ts","../../../libs/category/driver/magento/src/transformers/category-page-config-transformer.service.ts","../../../libs/category/driver/magento/src/transforms/token.ts","../../../libs/category/driver/magento/src/transformers/category-transformer.service.ts","../../../libs/category/driver/magento/src/transformers/category-response-transform.service.ts","../../../libs/category/driver/magento/src/transformers/pure/add-metadata-types-to-aggregates.ts","../../../libs/category/driver/magento/src/category.service.ts","../../../libs/category/driver/magento/src/category-driver.module.ts","../../../libs/category/driver/magento/src/daffodil-category-driver-magento.ts"],"sourcesContent":["import { DocumentNode } from '@apollo/client/core';\n\nimport { createMultiInjectionToken } from '@daffodil/core';\n\n\nexport const {\n /**\n * A multi-provider injection token for providing category tree transform logic in the Magento driver.\n * It is run after the standard transforms and passed both the current transformed Daffodil category and the Magento category.\n */\n token: MAGENTO_CATEGORY_EXTRA_FRAGMENTS,\n /**\n * Provides category tree transforms for the Magento category driver.\n *\n * See {@link MAGENTO_CATEGORY_EXTRA_FRAGMENTS}.\n *\n * @example\n * ```ts\n * providers: [\n * ...magentoProvideCategoryExtraFragments(\n * myCategoryExtraFragment\n * )\n * ]\n * ```\n */\n provider: magentoProvideCategoryExtraFragments,\n} = createMultiInjectionToken<DocumentNode>('MAGENTO_CATEGORY_EXTRA_FRAGMENTS');\n","import { gql } from 'apollo-angular';\n\nimport { MagentoCategoryUrlResolverResponse } from './response.type';\nimport { MagentoResolveCategoryUrlVariables } from './variables.type';\n\nexport const DAFF_MAGENTO_RESOLVE_CATEGORY_URL_QUERY_NAME = 'MagentoResolveCategoryUrl';\n\n/**\n * This query retrieves a URL resolution from Magento and informs you about\n * what type of route the URL is.\n */\nexport const MagentoResolveCategoryUrl = gql<MagentoCategoryUrlResolverResponse, MagentoResolveCategoryUrlVariables>`\n\tquery ${DAFF_MAGENTO_RESOLVE_CATEGORY_URL_QUERY_NAME}($url: String!) {\n\t\troute(url: $url) {\n __typename\n\t\t\t... on CategoryInterface {\n\t\t\t\tuid\n\t\t\t}\n\t\t}\n\t}\n`;\n","import { GraphQlApolloValidator } from '@daffodil/core/graphql';\n\nimport { MagentoCategoryUrlResolverResponse } from './response.type';\n\nexport const magentoCategoryGetByUrlValidator: GraphQlApolloValidator<MagentoCategoryUrlResolverResponse>\n\t= (response) => {\n\t if (!response.data?.route?.uid) {\n\t throw new Error('The platform did not respond with a category.');\n\t }\n\n\t return response;\n\t};\n","import { gql } from 'apollo-angular';\n\nexport const magentoCategoryTreeFragment = gql`\n fragment categoryTree on CategoryTree {\n uid\n url_path\n url_suffix\n canonical_url\n\t\tname\n\t\tlevel\n\t\tmeta_title\n\t\tmeta_description\n\t\tdescription\n\t\tbreadcrumbs {\n\t\t\tcategory_uid\n\t\t\tcategory_name\n\t\t\tcategory_level\n\t\t\tcategory_url_path\n\t\t}\n\t\tchildren_count\n }\n`;\n","import { gql } from 'apollo-angular';\nimport { DocumentNode } from 'graphql';\n\nimport {\n daffBuildFragmentDefinition,\n daffBuildFragmentNameSpread,\n} from '@daffodil/core/graphql';\nimport { magentoSearchResultPageInfoFragment } from '@daffodil/driver/magento';\nimport {\n magentoProductAggregationsFragment,\n magentoProductFragment,\n magentoProductSortFieldsFragment,\n} from '@daffodil/product/driver/magento';\n\nimport { magentoCategoryTreeFragment } from './fragments/public_api';\n\nexport const DAFF_MAGENTO_GET_CATEGORY_AND_PRODUCTS_QUERY_NAME = 'MagentoGetCategoryAndProducts';\n\nexport const MagentoGetCategoryAndProductsQuery = (extraCategoryFragments: DocumentNode[] = [], extraProductFragments: DocumentNode[] = []) => gql`\nquery ${DAFF_MAGENTO_GET_CATEGORY_AND_PRODUCTS_QUERY_NAME}($categoryFilters: CategoryFilterInput, $productFilter: ProductAttributeFilterInput!, $search: String, $pageSize: Int, $currentPage: Int, $sort: ProductAttributeSortInput)\n{\n categoryList(filters: $categoryFilters) {\n\t\t...categoryTree\n ${daffBuildFragmentNameSpread(...extraCategoryFragments)}\n\t}\n\tproducts(filter: $productFilter, search: $search, pageSize: $pageSize, currentPage: $currentPage, sort: $sort)\n\t{\n\t\ttotal_count\n\t\titems {\n\t\t\t...product\n ${daffBuildFragmentNameSpread(...extraProductFragments)}\n\t\t}\n\t\tpage_info {\n\t\t\t...magentoSearchResultPageInfo\n\t\t}\n\t\taggregations {\n\t\t\t...magentoProductAggregations\n\t\t}\n\t\tsort_fields {\n\t\t\t...magentoProductSortFields\n\t\t}\n\t}\n}\n${magentoCategoryTreeFragment}\n${magentoProductFragment}\n${magentoSearchResultPageInfoFragment}\n${magentoProductSortFieldsFragment}\n${magentoProductAggregationsFragment}\n${daffBuildFragmentDefinition(...extraCategoryFragments)}\n${daffBuildFragmentDefinition(...extraProductFragments)}\n`;\n","import { Injectable } from '@angular/core';\n\nimport { DaffCategory } from '@daffodil/category';\nimport { DaffFilterRequest } from '@daffodil/core';\nimport {\n MagentoProductFilterActionEnum,\n MagentoProductFilters,\n MagentoProductAppliedFiltersTransformService,\n} from '@daffodil/product/driver/magento';\n\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffMagentoAppliedFiltersTransformService {\n constructor(\n private productFilterRequestsTransformer: MagentoProductAppliedFiltersTransformService,\n ) {}\n\n transform(categoryId: DaffCategory['id'], daffFilters: DaffFilterRequest[]): MagentoProductFilters {\n const magentoFilters: MagentoProductFilters = {\n category_uid: {\n [MagentoProductFilterActionEnum.Equal]: categoryId,\n },\n };\n\n if(!daffFilters) {\n return magentoFilters;\n }\n\n return {\n ...magentoFilters,\n ...this.productFilterRequestsTransformer.transform(daffFilters),\n };\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { DaffCategoryPageMetadata } from '@daffodil/category';\nimport { magentoProductCollectionMetadataTransform } from '@daffodil/product/driver/magento';\n\nimport { MagentoCompleteCategoryResponse } from '../models/public_api';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffMagentoCategoryPageConfigTransformerService {\n\n transform(categoryResponse: MagentoCompleteCategoryResponse): DaffCategoryPageMetadata {\n const aggregatesWithoutCategories = categoryResponse.aggregates.filter(aggregate => aggregate.attribute_code !== 'category_id');\n\n return {\n ...magentoProductCollectionMetadataTransform(\n aggregatesWithoutCategories,\n categoryResponse.page_info,\n categoryResponse.sort_fields,\n categoryResponse.products,\n categoryResponse.total_count,\n categoryResponse.appliedSortOption,\n categoryResponse.appliedSortDirection,\n ),\n id: categoryResponse.category.uid,\n };\n }\n}\n","import { createMultiInjectionToken } from '@daffodil/core';\n\nimport { MagentoCategoryTreeTransform } from './type';\n\nexport const {\n /**\n * A multi-provider injection token for providing category transform logic in the Magento driver.\n * It is run after the standard transforms and passed both the current transformed Daffodil category and the Magento category.\n */\n token: MAGENTO_CATEGORY_EXTRA_TRANSFORMS,\n /**\n * Provides category transforms for the Magento category driver.\n *\n * See {@link MAGENTO_CATEGORY_EXTRA_TRANSFORMS}.\n *\n * @example\n * ```ts\n * providers: [\n * ...magentoProvideCategoryExtraTransforms(\n * myCategoryExtraTransform\n * )\n * ]\n * ```\n */\n provider: magentoProvideCategoryExtraTransforms,\n} = createMultiInjectionToken<MagentoCategoryTreeTransform>('MAGENTO_CATEGORY_EXTRA_TRANSFORMS');\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\n\nimport {\n DaffCategory,\n DaffCategoryBreadcrumb,\n} from '@daffodil/category';\nimport { MagentoProduct } from '@daffodil/product/driver/magento';\n\nimport {\n MagentoBreadcrumb,\n MagentoCategory,\n} from '../models/public_api';\nimport {\n MAGENTO_CATEGORY_EXTRA_TRANSFORMS,\n MagentoCategoryTreeTransform,\n} from '../transforms/public_api';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffMagentoCategoryTransformerService {\n constructor(\n @Inject(MAGENTO_CATEGORY_EXTRA_TRANSFORMS) private extraTransforms: Array<MagentoCategoryTreeTransform>,\n ) {}\n\n transform(category: MagentoCategory, products: MagentoProduct[]): DaffCategory {\n return this.extraTransforms.reduce<DaffCategory>((acc, transform) => transform(acc, category, products), {\n id: category.uid,\n url: `/${category.url_path}${category.url_suffix}`,\n canonicalUrl: category.canonical_url,\n name: category.name,\n description: category.description,\n meta_title: category.meta_title,\n meta_description: category.meta_description,\n children_count: category.children_count,\n breadcrumbs: category.breadcrumbs\n ?.map(breadcrumb => this.transformBreadcrumb(breadcrumb, category))\n .sort((a, b) => a.level - b.level) || null,\n product_ids: products.map(product => product.sku),\n total_products: products.length,\n });\n }\n\n private transformBreadcrumb(breadcrumb: MagentoBreadcrumb, category: MagentoCategory): DaffCategoryBreadcrumb {\n return {\n id: breadcrumb.category_uid,\n name: breadcrumb.category_name,\n level: breadcrumb.category_level,\n url: `/${breadcrumb.category_url_path}${category.url_suffix}`,\n };\n }\n}\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\n\nimport { DaffGetCategoryResponse } from '@daffodil/category';\nimport {\n DAFF_PRODUCT_MAGENTO_PRODUCT_TRANSFORM,\n DaffMagentoProductTransform,\n} from '@daffodil/product/driver/magento';\n\nimport { DaffMagentoCategoryPageConfigTransformerService } from './category-page-config-transformer.service';\nimport { DaffMagentoCategoryTransformerService } from './category-transformer.service';\nimport { MagentoCompleteCategoryResponse } from '../models/public_api';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffMagentoCategoryResponseTransformService {\n\n constructor(\n private magentoCategoryTransformerService: DaffMagentoCategoryTransformerService,\n private magentoCategoryPageConfigurationTransformerService: DaffMagentoCategoryPageConfigTransformerService,\n @Inject(DAFF_PRODUCT_MAGENTO_PRODUCT_TRANSFORM) private magentoProductsTransform: DaffMagentoProductTransform,\n ) {}\n\n transform(completeCategory: MagentoCompleteCategoryResponse, mediaUrl: string): DaffGetCategoryResponse {\n return {\n ...{ magentoCompleteCategoryResponse: completeCategory },\n category: this.magentoCategoryTransformerService.transform(completeCategory.category, completeCategory.products),\n categoryPageMetadata: this.magentoCategoryPageConfigurationTransformerService.transform(completeCategory),\n products: completeCategory.products.map(product => this.magentoProductsTransform(product, mediaUrl)),\n };\n }\n}\n","import {\n MagentoProductGetFilterTypesResponse,\n magentoProductGetMatchedAttributeType,\n} from '@daffodil/product/driver/magento';\n\nimport { MagentoGetCategoryAndProductsResponse } from '../../models/public_api';\n\nexport function addMetadataTypesToProductsResponse(\n attributeResponse: MagentoProductGetFilterTypesResponse,\n aggregationResponse: MagentoGetCategoryAndProductsResponse,\n): MagentoGetCategoryAndProductsResponse {\n return {\n ...aggregationResponse,\n products: {\n ...aggregationResponse.products,\n aggregations: [\n ...aggregationResponse.products.aggregations.map((aggregate) => ({\n ...aggregate,\n type: magentoProductGetMatchedAttributeType(aggregate, attributeResponse.__type.inputFields),\n })),\n ],\n },\n };\n}\n","import {\n Injectable,\n Inject,\n} from '@angular/core';\nimport { Apollo } from 'apollo-angular';\nimport { DocumentNode } from 'graphql';\nimport {\n Observable,\n combineLatest,\n} from 'rxjs';\nimport {\n map,\n switchMap,\n} from 'rxjs/operators';\n\nimport {\n DaffGetCategoryResponse,\n DaffCategoryUrlRequest,\n DaffCategoryRequestKind,\n DaffCategoryIdRequest,\n DaffCategoryRequest,\n} from '@daffodil/category';\nimport { DaffCategoryServiceInterface } from '@daffodil/category/driver';\nimport {\n daffApplyRequestsToFilters,\n DaffFilterRequest,\n} from '@daffodil/core';\nimport { daffUriTruncateQueryFragment } from '@daffodil/core/routing';\nimport {\n DaffProductMagentoDriverConfig,\n DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_FRAGMENTS,\n MagentoProductGetFilterTypes,\n MagentoProductGetFilterTypesResponse,\n MAGENTO_PRODUCT_CONFIG_TOKEN,\n magentoAppliedSortOptionTransform,\n DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_PREVIEW_FRAGMENTS,\n} from '@daffodil/product/driver/magento';\n\nimport { MAGENTO_CATEGORY_EXTRA_FRAGMENTS } from './fragments/public_api';\nimport {\n MagentoGetCategoryAndProductsRequest,\n MagentoGetCategoryAndProductsResponse,\n MagentoCompleteCategoryResponse,\n} from './models/public_api';\nimport {\n magentoCategoryGetByUrlValidator,\n MagentoGetCategoryAndProductsQuery,\n MagentoResolveCategoryUrl,\n} from './queries/public_api';\nimport {\n DaffMagentoCategoryResponseTransformService,\n DaffMagentoAppliedFiltersTransformService,\n} from './transformers/public_api';\nimport { addMetadataTypesToProductsResponse } from './transformers/pure/add-metadata-types-to-aggregates';\n\nconst applyFiltersOnResponse = (requests: DaffFilterRequest[], response: DaffGetCategoryResponse): DaffGetCategoryResponse => ({\n ...response,\n categoryPageMetadata: {\n ...response.categoryPageMetadata,\n filters: daffApplyRequestsToFilters(requests, response.categoryPageMetadata.filters),\n },\n});\n\n/**\n * A service for making magento apollo queries for categories. Should be provided via the {@link DaffCategoryDriver} token.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffMagentoCategoryService implements DaffCategoryServiceInterface {\n\n constructor(\n private apollo: Apollo,\n private magentoCategoryResponseTransformer: DaffMagentoCategoryResponseTransformService,\n private magentoAppliedFiltersTransformer: DaffMagentoAppliedFiltersTransformService,\n @Inject(MAGENTO_PRODUCT_CONFIG_TOKEN) private productConfig: DaffProductMagentoDriverConfig,\n @Inject(DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_FRAGMENTS) private extraProductFragments: DocumentNode[],\n @Inject(DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_PREVIEW_FRAGMENTS) private extraProductPreviewFragments: DocumentNode[],\n @Inject(MAGENTO_CATEGORY_EXTRA_FRAGMENTS) private extraCategoryFragments: DocumentNode[],\n ) {}\n\n get(categoryRequest: DaffCategoryIdRequest): Observable<DaffGetCategoryResponse> {\n return combineLatest([\n this.apollo.query<MagentoProductGetFilterTypesResponse>({\n query: MagentoProductGetFilterTypes,\n }),\n this.apollo.query<MagentoGetCategoryAndProductsResponse>({\n query: MagentoGetCategoryAndProductsQuery(this.extraCategoryFragments, [\n ...this.extraProductFragments,\n ...this.extraProductPreviewFragments,\n ]),\n variables: this.getCategoryAndProductsQueryVariables(categoryRequest),\n }),\n ]).pipe(\n map(([\n filterTypes,\n categoryAndProducts,\n ]) => this.transformCategory(categoryAndProducts.data, filterTypes.data, categoryRequest,this.productConfig.baseMediaUrl)),\n map(result => categoryRequest.filterRequests\n ? applyFiltersOnResponse(categoryRequest.filterRequests, result)\n : result,\n ),\n );\n }\n\n getByUrl(categoryRequest: DaffCategoryUrlRequest): Observable<DaffGetCategoryResponse> {\n return combineLatest([\n this.apollo.query({\n query: MagentoResolveCategoryUrl,\n variables: {\n url: daffUriTruncateQueryFragment(categoryRequest.url),\n },\n }).pipe(\n map(magentoCategoryGetByUrlValidator),\n ),\n this.apollo.query<MagentoProductGetFilterTypesResponse>({\n query: MagentoProductGetFilterTypes,\n }),\n ]).pipe(\n switchMap(([\n category,\n filterTypes,\n ]) => this.apollo.query<MagentoGetCategoryAndProductsResponse>({\n query: MagentoGetCategoryAndProductsQuery(this.extraCategoryFragments, [\n ...this.extraProductFragments,\n ...this.extraProductPreviewFragments,\n ]),\n variables: this.getCategoryAndProductsQueryVariables({\n ...categoryRequest,\n id: category.data.route?.uid,\n kind: DaffCategoryRequestKind.ID,\n }),\n }).pipe(\n map(categoryAndProducts => this.transformCategory(categoryAndProducts.data, filterTypes.data, categoryRequest, this.productConfig.baseMediaUrl)),\n map(result => categoryRequest.filterRequests\n ? applyFiltersOnResponse(categoryRequest.filterRequests, result)\n : result,\n ),\n )),\n );\n }\n\n private getCategoryAndProductsQueryVariables(request: DaffCategoryIdRequest): MagentoGetCategoryAndProductsRequest {\n const queryVariables = {\n productFilter: this.magentoAppliedFiltersTransformer.transform(request.id, request.filterRequests),\n categoryFilters: {\n category_uid: {\n eq: request.id,\n },\n },\n };\n if(request.pageSize) {\n queryVariables['pageSize'] = request.pageSize;\n }\n if(request.currentPage) {\n queryVariables['currentPage'] = request.currentPage;\n }\n if(request.appliedSortOption && request.appliedSortDirection) {\n queryVariables['sort'] = magentoAppliedSortOptionTransform(request.appliedSortOption, request.appliedSortDirection);\n }\n\n return queryVariables;\n }\n\n private transformCategory(\n categoryResponse: MagentoGetCategoryAndProductsResponse,\n filterTypesResponse: MagentoProductGetFilterTypesResponse,\n request: DaffCategoryRequest,\n mediaUrl: string,\n ): DaffGetCategoryResponse {\n const aggregations = addMetadataTypesToProductsResponse(filterTypesResponse, categoryResponse);\n const completeCategory: MagentoCompleteCategoryResponse = {\n category: categoryResponse.categoryList[0],\n products: categoryResponse.products.items,\n aggregates: aggregations.products.aggregations,\n sort_fields: aggregations.products.sort_fields,\n total_count: categoryResponse.products.total_count,\n page_info: categoryResponse.products.page_info,\n appliedSortOption: request.appliedSortOption,\n appliedSortDirection: request.appliedSortDirection,\n };\n\n return this.magentoCategoryResponseTransformer.transform(completeCategory, mediaUrl);\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n ModuleWithProviders,\n NgModule,\n} from '@angular/core';\n\nimport { provideDaffCategoryDriver } from '@daffodil/category/driver';\nimport { provideManyDaffMagentoCacheableOperations } from '@daffodil/driver/magento';\nimport { DAFF_MAGENTO_GET_FILTER_TYPES_QUERY_NAME } from '@daffodil/product/driver/magento';\n\nimport { DaffMagentoCategoryService } from './category.service';\nimport {\n DAFF_MAGENTO_GET_CATEGORY_AND_PRODUCTS_QUERY_NAME,\n DAFF_MAGENTO_RESOLVE_CATEGORY_URL_QUERY_NAME,\n} from './queries/public_api';\nimport { DaffMagentoAppliedFiltersTransformService } from './transformers/applied-filter-transformer.service';\nimport { DaffMagentoCategoryPageConfigTransformerService } from './transformers/category-page-config-transformer.service';\nimport { DaffMagentoCategoryResponseTransformService } from './transformers/category-response-transform.service';\nimport { DaffMagentoCategoryTransformerService } from './transformers/category-transformer.service';\n\n/**\n * A module that provides the {@link DaffCategoryDriver} and {@link MAGENTO_CATEGORY_CONFIG_TOKEN} as the {@link DaffMagentoCategoryService} and\n * {@link MAGENTO_CATEGORY_CONFIG_DEFAULT} respectively\n */\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffCategoryMagentoDriverModule {\n static forRoot(): ModuleWithProviders<DaffCategoryMagentoDriverModule> {\n return {\n ngModule: DaffCategoryMagentoDriverModule,\n providers: [\n provideDaffCategoryDriver(DaffMagentoCategoryService),\n DaffMagentoCategoryPageConfigTransformerService,\n DaffMagentoCategoryResponseTransformService,\n DaffMagentoCategoryTransformerService,\n DaffMagentoAppliedFiltersTransformService,\n provideManyDaffMagentoCacheableOperations(\n DAFF_MAGENTO_GET_FILTER_TYPES_QUERY_NAME,\n DAFF_MAGENTO_GET_CATEGORY_AND_PRODUCTS_QUERY_NAME,\n DAFF_MAGENTO_RESOLVE_CATEGORY_UR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AA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,+BAA+B,YAHxC,YAAY,CAAA,EAAA,CAAA,CAAA;;4FAGH,+BAA+B,EAAA,UAAA,EAAA,CAAA;kBAL3C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACF,iBAAA;;;AC5BD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"daffodil-category-driver-magento.mjs","sources":["../../../libs/category/driver/magento/src/fragments/token.ts","../../../libs/category/driver/magento/src/queries/resolve-url/query.ts","../../../libs/category/driver/magento/src/queries/resolve-url/validator.ts","../../../libs/category/driver/magento/src/queries/fragments/category-tree.ts","../../../libs/category/driver/magento/src/queries/get-category-and-products.ts","../../../libs/category/driver/magento/src/transformers/applied-filter-transformer.service.ts","../../../libs/category/driver/magento/src/transformers/category-page-config-transformer.service.ts","../../../libs/category/driver/magento/src/transforms/token.ts","../../../libs/category/driver/magento/src/transformers/category-transformer.service.ts","../../../libs/category/driver/magento/src/transformers/category-response-transform.service.ts","../../../libs/category/driver/magento/src/transformers/pure/add-metadata-types-to-aggregates.ts","../../../libs/category/driver/magento/src/category.service.ts","../../../libs/category/driver/magento/src/category-driver.module.ts","../../../libs/category/driver/magento/src/daffodil-category-driver-magento.ts"],"sourcesContent":["import { DocumentNode } from '@apollo/client';\n\nimport { createMultiInjectionToken } from '@daffodil/core';\n\n\nexport const {\n /**\n * A multi-provider injection token for providing category tree transform logic in the Magento driver.\n * It is run after the standard transforms and passed both the current transformed Daffodil category and the Magento category.\n */\n token: MAGENTO_CATEGORY_EXTRA_FRAGMENTS,\n /**\n * Provides category tree transforms for the Magento category driver.\n *\n * See {@link MAGENTO_CATEGORY_EXTRA_FRAGMENTS}.\n *\n * @example\n * ```ts\n * providers: [\n * ...magentoProvideCategoryExtraFragments(\n * myCategoryExtraFragment\n * )\n * ]\n * ```\n */\n provider: magentoProvideCategoryExtraFragments,\n} = createMultiInjectionToken<DocumentNode>('MAGENTO_CATEGORY_EXTRA_FRAGMENTS');\n","import { gql } from 'apollo-angular';\n\nimport { MagentoCategoryUrlResolverResponse } from './response.type';\nimport { MagentoResolveCategoryUrlVariables } from './variables.type';\n\nexport const DAFF_MAGENTO_RESOLVE_CATEGORY_URL_QUERY_NAME = 'MagentoResolveCategoryUrl';\n\n/**\n * This query retrieves a URL resolution from Magento and informs you about\n * what type of route the URL is.\n */\nexport const MagentoResolveCategoryUrl = gql<MagentoCategoryUrlResolverResponse, MagentoResolveCategoryUrlVariables>`\n\tquery ${DAFF_MAGENTO_RESOLVE_CATEGORY_URL_QUERY_NAME}($url: String!) {\n\t\troute(url: $url) {\n __typename\n\t\t\t... on CategoryInterface {\n\t\t\t\tuid\n\t\t\t}\n\t\t}\n\t}\n`;\n","import { GraphQlApolloValidator } from '@daffodil/core/graphql';\n\nimport { MagentoCategoryUrlResolverResponse } from './response.type';\n\ninterface Shape {\n data: { route: { uid: true } };\n}\ntype ValidatorFn = GraphQlApolloValidator<MagentoCategoryUrlResolverResponse, Shape>;\n\nconst isValid = (\n response: Parameters<ValidatorFn>[0],\n): response is ReturnType<ValidatorFn> => !!response.data?.route?.uid;\n\nexport const magentoCategoryGetByUrlValidator: ValidatorFn = (response) => {\n if (isValid(response)) {\n return response;\n }\n\n throw new Error('The platform did not respond with a category.');\n};\n","import { gql } from 'apollo-angular';\n\nexport const magentoCategoryTreeFragment = gql`\n fragment categoryTree on CategoryTree {\n uid\n url_path\n url_suffix\n canonical_url\n\t\tname\n\t\tlevel\n\t\tmeta_title\n\t\tmeta_description\n\t\tdescription\n\t\tbreadcrumbs {\n\t\t\tcategory_uid\n\t\t\tcategory_name\n\t\t\tcategory_level\n\t\t\tcategory_url_path\n\t\t}\n\t\tchildren_count\n }\n`;\n","import { gql } from 'apollo-angular';\nimport { DocumentNode } from 'graphql';\n\nimport {\n daffBuildFragmentDefinition,\n daffBuildFragmentNameSpread,\n} from '@daffodil/core/graphql';\nimport { magentoSearchResultPageInfoFragment } from '@daffodil/driver/magento';\nimport {\n magentoProductAggregationsFragment,\n magentoProductFragment,\n magentoProductSortFieldsFragment,\n} from '@daffodil/product/driver/magento';\n\nimport { magentoCategoryTreeFragment } from './fragments/public_api';\n\nexport const DAFF_MAGENTO_GET_CATEGORY_AND_PRODUCTS_QUERY_NAME = 'MagentoGetCategoryAndProducts';\n\nexport const MagentoGetCategoryAndProductsQuery = (extraCategoryFragments: DocumentNode[] = [], extraProductFragments: DocumentNode[] = []) => gql`\nquery ${DAFF_MAGENTO_GET_CATEGORY_AND_PRODUCTS_QUERY_NAME}($categoryFilters: CategoryFilterInput, $productFilter: ProductAttributeFilterInput!, $search: String, $pageSize: Int, $currentPage: Int, $sort: ProductAttributeSortInput)\n{\n categoryList(filters: $categoryFilters) {\n\t\t...categoryTree\n ${daffBuildFragmentNameSpread(...extraCategoryFragments)}\n\t}\n\tproducts(filter: $productFilter, search: $search, pageSize: $pageSize, currentPage: $currentPage, sort: $sort)\n\t{\n\t\ttotal_count\n\t\titems {\n\t\t\t...product\n ${daffBuildFragmentNameSpread(...extraProductFragments)}\n\t\t}\n\t\tpage_info {\n\t\t\t...magentoSearchResultPageInfo\n\t\t}\n\t\taggregations {\n\t\t\t...magentoProductAggregations\n\t\t}\n\t\tsort_fields {\n\t\t\t...magentoProductSortFields\n\t\t}\n\t}\n}\n${magentoCategoryTreeFragment}\n${magentoProductFragment}\n${magentoSearchResultPageInfoFragment}\n${magentoProductSortFieldsFragment}\n${magentoProductAggregationsFragment}\n${daffBuildFragmentDefinition(...extraCategoryFragments)}\n${daffBuildFragmentDefinition(...extraProductFragments)}\n`;\n","import { Injectable } from '@angular/core';\n\nimport { DaffCategory } from '@daffodil/category';\nimport { DaffFilterRequest } from '@daffodil/core';\nimport {\n MagentoProductFilterActionEnum,\n MagentoProductFilters,\n MagentoProductAppliedFiltersTransformService,\n} from '@daffodil/product/driver/magento';\n\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffMagentoAppliedFiltersTransformService {\n constructor(\n private productFilterRequestsTransformer: MagentoProductAppliedFiltersTransformService,\n ) {}\n\n transform(categoryId: DaffCategory['id'], daffFilters: DaffFilterRequest[]): MagentoProductFilters {\n const magentoFilters: MagentoProductFilters = {\n category_uid: {\n [MagentoProductFilterActionEnum.Equal]: categoryId,\n },\n };\n\n if(!daffFilters) {\n return magentoFilters;\n }\n\n return {\n ...magentoFilters,\n ...this.productFilterRequestsTransformer.transform(daffFilters),\n };\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { DaffCategoryPageMetadata } from '@daffodil/category';\nimport { magentoProductCollectionMetadataTransform } from '@daffodil/product/driver/magento';\n\nimport { MagentoCompleteCategoryResponse } from '../models/public_api';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffMagentoCategoryPageConfigTransformerService {\n\n transform(categoryResponse: MagentoCompleteCategoryResponse): DaffCategoryPageMetadata {\n const aggregatesWithoutCategories = categoryResponse.aggregates.filter(aggregate => aggregate.attribute_code !== 'category_id');\n\n return {\n ...magentoProductCollectionMetadataTransform(\n aggregatesWithoutCategories,\n categoryResponse.page_info,\n categoryResponse.sort_fields,\n categoryResponse.products,\n categoryResponse.total_count,\n categoryResponse.appliedSortOption,\n categoryResponse.appliedSortDirection,\n ),\n id: categoryResponse.category.uid,\n };\n }\n}\n","import { createMultiInjectionToken } from '@daffodil/core';\n\nimport { MagentoCategoryTreeTransform } from './type';\n\nexport const {\n /**\n * A multi-provider injection token for providing category transform logic in the Magento driver.\n * It is run after the standard transforms and passed both the current transformed Daffodil category and the Magento category.\n */\n token: MAGENTO_CATEGORY_EXTRA_TRANSFORMS,\n /**\n * Provides category transforms for the Magento category driver.\n *\n * See {@link MAGENTO_CATEGORY_EXTRA_TRANSFORMS}.\n *\n * @example\n * ```ts\n * providers: [\n * ...magentoProvideCategoryExtraTransforms(\n * myCategoryExtraTransform\n * )\n * ]\n * ```\n */\n provider: magentoProvideCategoryExtraTransforms,\n} = createMultiInjectionToken<MagentoCategoryTreeTransform>('MAGENTO_CATEGORY_EXTRA_TRANSFORMS');\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\n\nimport {\n DaffCategory,\n DaffCategoryBreadcrumb,\n} from '@daffodil/category';\nimport { MagentoProduct } from '@daffodil/product/driver/magento';\n\nimport {\n MagentoBreadcrumb,\n MagentoCategory,\n} from '../models/public_api';\nimport {\n MAGENTO_CATEGORY_EXTRA_TRANSFORMS,\n MagentoCategoryTreeTransform,\n} from '../transforms/public_api';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffMagentoCategoryTransformerService {\n constructor(\n @Inject(MAGENTO_CATEGORY_EXTRA_TRANSFORMS) private extraTransforms: Array<MagentoCategoryTreeTransform>,\n ) {}\n\n transform(category: MagentoCategory, products: MagentoProduct[]): DaffCategory {\n return this.extraTransforms.reduce<DaffCategory>((acc, transform) => transform(acc, category, products), {\n id: category.uid,\n url: `/${category.url_path}${category.url_suffix}`,\n canonicalUrl: category.canonical_url,\n name: category.name,\n description: category.description,\n meta_title: category.meta_title,\n meta_description: category.meta_description,\n children_count: category.children_count,\n breadcrumbs: category.breadcrumbs\n ?.map(breadcrumb => this.transformBreadcrumb(breadcrumb, category))\n .sort((a, b) => a.level - b.level) || null,\n product_ids: products.map(product => product.sku),\n total_products: products.length,\n });\n }\n\n private transformBreadcrumb(breadcrumb: MagentoBreadcrumb, category: MagentoCategory): DaffCategoryBreadcrumb {\n return {\n id: breadcrumb.category_uid,\n name: breadcrumb.category_name,\n level: breadcrumb.category_level,\n url: `/${breadcrumb.category_url_path}${category.url_suffix}`,\n };\n }\n}\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\n\nimport { DaffGetCategoryResponse } from '@daffodil/category';\nimport {\n DAFF_PRODUCT_MAGENTO_PRODUCT_TRANSFORM,\n DaffMagentoProductTransform,\n} from '@daffodil/product/driver/magento';\n\nimport { DaffMagentoCategoryPageConfigTransformerService } from './category-page-config-transformer.service';\nimport { DaffMagentoCategoryTransformerService } from './category-transformer.service';\nimport { MagentoCompleteCategoryResponse } from '../models/public_api';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffMagentoCategoryResponseTransformService {\n\n constructor(\n private magentoCategoryTransformerService: DaffMagentoCategoryTransformerService,\n private magentoCategoryPageConfigurationTransformerService: DaffMagentoCategoryPageConfigTransformerService,\n @Inject(DAFF_PRODUCT_MAGENTO_PRODUCT_TRANSFORM) private magentoProductsTransform: DaffMagentoProductTransform,\n ) {}\n\n transform(completeCategory: MagentoCompleteCategoryResponse, mediaUrl: string): DaffGetCategoryResponse {\n return {\n ...{ magentoCompleteCategoryResponse: completeCategory },\n category: this.magentoCategoryTransformerService.transform(completeCategory.category, completeCategory.products),\n categoryPageMetadata: this.magentoCategoryPageConfigurationTransformerService.transform(completeCategory),\n products: completeCategory.products.map(product => this.magentoProductsTransform(product, mediaUrl)),\n };\n }\n}\n","import {\n MagentoProductGetFilterTypesResponse,\n magentoProductGetMatchedAttributeType,\n} from '@daffodil/product/driver/magento';\n\nimport { MagentoGetCategoryAndProductsResponse } from '../../models/public_api';\n\nexport function addMetadataTypesToProductsResponse(\n attributeResponse: MagentoProductGetFilterTypesResponse,\n aggregationResponse: MagentoGetCategoryAndProductsResponse,\n): MagentoGetCategoryAndProductsResponse {\n return {\n ...aggregationResponse,\n products: {\n ...aggregationResponse.products,\n aggregations: [\n ...aggregationResponse.products.aggregations.map((aggregate) => ({\n ...aggregate,\n type: magentoProductGetMatchedAttributeType(aggregate, attributeResponse.__type.inputFields),\n })),\n ],\n },\n };\n}\n","import {\n Injectable,\n Inject,\n} from '@angular/core';\nimport { Apollo } from 'apollo-angular';\nimport { DocumentNode } from 'graphql';\nimport {\n Observable,\n combineLatest,\n} from 'rxjs';\nimport {\n map,\n switchMap,\n} from 'rxjs/operators';\n\nimport {\n DaffGetCategoryResponse,\n DaffCategoryUrlRequest,\n DaffCategoryRequestKind,\n DaffCategoryIdRequest,\n DaffCategoryRequest,\n} from '@daffodil/category';\nimport { DaffCategoryServiceInterface } from '@daffodil/category/driver';\nimport {\n daffApplyRequestsToFilters,\n DaffFilterRequest,\n} from '@daffodil/core';\nimport { daffUriTruncateQueryFragment } from '@daffodil/core/routing';\nimport {\n DaffProductMagentoDriverConfig,\n DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_FRAGMENTS,\n MagentoProductGetFilterTypes,\n MagentoProductGetFilterTypesResponse,\n MAGENTO_PRODUCT_CONFIG_TOKEN,\n magentoAppliedSortOptionTransform,\n DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_PREVIEW_FRAGMENTS,\n} from '@daffodil/product/driver/magento';\n\nimport { MAGENTO_CATEGORY_EXTRA_FRAGMENTS } from './fragments/public_api';\nimport {\n MagentoGetCategoryAndProductsRequest,\n MagentoGetCategoryAndProductsResponse,\n MagentoCompleteCategoryResponse,\n} from './models/public_api';\nimport {\n magentoCategoryGetByUrlValidator,\n MagentoGetCategoryAndProductsQuery,\n MagentoResolveCategoryUrl,\n} from './queries/public_api';\nimport {\n DaffMagentoCategoryResponseTransformService,\n DaffMagentoAppliedFiltersTransformService,\n} from './transformers/public_api';\nimport { addMetadataTypesToProductsResponse } from './transformers/pure/add-metadata-types-to-aggregates';\n\nconst applyFiltersOnResponse = (requests: DaffFilterRequest[], response: DaffGetCategoryResponse): DaffGetCategoryResponse => ({\n ...response,\n categoryPageMetadata: {\n ...response.categoryPageMetadata,\n filters: daffApplyRequestsToFilters(requests, response.categoryPageMetadata.filters),\n },\n});\n\n/**\n * A service for making magento apollo queries for categories. Should be provided via the {@link DaffCategoryDriver} token.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffMagentoCategoryService implements DaffCategoryServiceInterface {\n\n constructor(\n private apollo: Apollo,\n private magentoCategoryResponseTransformer: DaffMagentoCategoryResponseTransformService,\n private magentoAppliedFiltersTransformer: DaffMagentoAppliedFiltersTransformService,\n @Inject(MAGENTO_PRODUCT_CONFIG_TOKEN) private productConfig: DaffProductMagentoDriverConfig,\n @Inject(DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_FRAGMENTS) private extraProductFragments: DocumentNode[],\n @Inject(DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_PREVIEW_FRAGMENTS) private extraProductPreviewFragments: DocumentNode[],\n @Inject(MAGENTO_CATEGORY_EXTRA_FRAGMENTS) private extraCategoryFragments: DocumentNode[],\n ) {}\n\n get(categoryRequest: DaffCategoryIdRequest): Observable<DaffGetCategoryResponse> {\n return combineLatest([\n this.apollo.query<MagentoProductGetFilterTypesResponse>({\n query: MagentoProductGetFilterTypes,\n }),\n this.apollo.query<MagentoGetCategoryAndProductsResponse>({\n query: MagentoGetCategoryAndProductsQuery(this.extraCategoryFragments, [\n ...this.extraProductFragments,\n ...this.extraProductPreviewFragments,\n ]),\n variables: this.getCategoryAndProductsQueryVariables(categoryRequest),\n }),\n ]).pipe(\n map(([\n filterTypes,\n categoryAndProducts,\n ]) => this.transformCategory(categoryAndProducts.data, filterTypes.data, categoryRequest,this.productConfig.baseMediaUrl)),\n map(result => categoryRequest.filterRequests\n ? applyFiltersOnResponse(categoryRequest.filterRequests, result)\n : result,\n ),\n );\n }\n\n getByUrl(categoryRequest: DaffCategoryUrlRequest): Observable<DaffGetCategoryResponse> {\n return combineLatest([\n this.apollo.query({\n query: MagentoResolveCategoryUrl,\n variables: {\n url: daffUriTruncateQueryFragment(categoryRequest.url),\n },\n }).pipe(\n map(magentoCategoryGetByUrlValidator),\n ),\n this.apollo.query<MagentoProductGetFilterTypesResponse>({\n query: MagentoProductGetFilterTypes,\n }),\n ]).pipe(\n switchMap(([\n category,\n filterTypes,\n ]) => this.apollo.query<MagentoGetCategoryAndProductsResponse>({\n query: MagentoGetCategoryAndProductsQuery(this.extraCategoryFragments, [\n ...this.extraProductFragments,\n ...this.extraProductPreviewFragments,\n ]),\n variables: this.getCategoryAndProductsQueryVariables({\n ...categoryRequest,\n id: category.data.route?.uid,\n kind: DaffCategoryRequestKind.ID,\n }),\n }).pipe(\n map(categoryAndProducts => this.transformCategory(categoryAndProducts.data, filterTypes.data, categoryRequest, this.productConfig.baseMediaUrl)),\n map(result => categoryRequest.filterRequests\n ? applyFiltersOnResponse(categoryRequest.filterRequests, result)\n : result,\n ),\n )),\n );\n }\n\n private getCategoryAndProductsQueryVariables(request: DaffCategoryIdRequest): MagentoGetCategoryAndProductsRequest {\n const queryVariables = {\n productFilter: this.magentoAppliedFiltersTransformer.transform(request.id, request.filterRequests),\n categoryFilters: {\n category_uid: {\n eq: request.id,\n },\n },\n };\n if(request.pageSize) {\n queryVariables['pageSize'] = request.pageSize;\n }\n if(request.currentPage) {\n queryVariables['currentPage'] = request.currentPage;\n }\n if(request.appliedSortOption && request.appliedSortDirection) {\n queryVariables['sort'] = magentoAppliedSortOptionTransform(request.appliedSortOption, request.appliedSortDirection);\n }\n\n return queryVariables;\n }\n\n private transformCategory(\n categoryResponse: MagentoGetCategoryAndProductsResponse,\n filterTypesResponse: MagentoProductGetFilterTypesResponse,\n request: DaffCategoryRequest,\n mediaUrl: string,\n ): DaffGetCategoryResponse {\n const aggregations = addMetadataTypesToProductsResponse(filterTypesResponse, categoryResponse);\n const completeCategory: MagentoCompleteCategoryResponse = {\n category: categoryResponse.categoryList[0],\n products: categoryResponse.products.items,\n aggregates: aggregations.products.aggregations,\n sort_fields: aggregations.products.sort_fields,\n total_count: categoryResponse.products.total_count,\n page_info: categoryResponse.products.page_info,\n appliedSortOption: request.appliedSortOption,\n appliedSortDirection: request.appliedSortDirection,\n };\n\n return this.magentoCategoryResponseTransformer.transform(completeCategory, mediaUrl);\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n ModuleWithProviders,\n NgModule,\n} from '@angular/core';\n\nimport { provideDaffCategoryDriver } from '@daffodil/category/driver';\nimport { provideManyDaffMagentoCacheableOperations } from '@daffodil/driver/magento';\nimport { DAFF_MAGENTO_GET_FILTER_TYPES_QUERY_NAME } from '@daffodil/product/driver/magento';\n\nimport { DaffMagentoCategoryService } from './category.service';\nimport {\n DAFF_MAGENTO_GET_CATEGORY_AND_PRODUCTS_QUERY_NAME,\n DAFF_MAGENTO_RESOLVE_CATEGORY_URL_QUERY_NAME,\n} from './queries/public_api';\nimport { DaffMagentoAppliedFiltersTransformService } from './transformers/applied-filter-transformer.service';\nimport { DaffMagentoCategoryPageConfigTransformerService } from './transformers/category-page-config-transformer.service';\nimport { DaffMagentoCategoryResponseTransformService } from './transformers/category-response-transform.service';\nimport { DaffMagentoCategoryTransformerService } from './transformers/category-transformer.service';\n\n/**\n * A module that provides the {@link DaffCategoryDriver} and {@link MAGENTO_CATEGORY_CONFIG_TOKEN} as the {@link DaffMagentoCategoryService} and\n * {@link MAGENTO_CATEGORY_CONFIG_DEFAULT} respectively\n */\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffCategoryMagentoDriverModule {\n static forRoot(): ModuleWithProviders<DaffCategoryMagentoDriverModule> {\n return {\n ngModule: DaffCategoryMagentoDriverModule,\n providers: [\n provideDaffCategoryDriver(DaffMagentoCategoryService),\n DaffMagentoCategoryPageConfigTransformerService,\n DaffMagentoCategoryResponseTransformService,\n DaffMagentoCategoryTransformerService,\n DaffMagentoAppliedFiltersTransformService,\n provideManyDaffMagentoCacheableOperations(\n DAFF_MAGENTO_GET_FILTER_TYPES_QUERY_NAME,\n DAFF_MAGENTO_GET_CATEGORY_AND_PRODUCTS_QUERY_NAME,\n DAFF_MAGENTO_RESOLVE_CATEGORY_URL_QUERY_NAME,\n ),\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAKO,MAAM;AACX;;;AAGG;AACH,KAAK,EAAE,gCAAgC;AACvC;;;;;;;;;;;;;AAaG;AACH,QAAQ,EAAE,oCAAoC,GAC/C,GAAG,yBAAyB,CAAe,kCAAkC;;ACrBvE,MA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A;kBAL3C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACF,iBAAA;;;AC5BD;;AAEG;;;;"}
|
|
@@ -252,10 +252,10 @@ class DaffShopifyCategoryService {
|
|
|
252
252
|
return daffShopifyCategoryTransformer(collection, shopifyVariables);
|
|
253
253
|
}));
|
|
254
254
|
}
|
|
255
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
256
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
255
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffShopifyCategoryService, deps: [{ token: i1.Apollo }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
256
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffShopifyCategoryService, providedIn: 'root' }); }
|
|
257
257
|
}
|
|
258
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
258
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffShopifyCategoryService, decorators: [{
|
|
259
259
|
type: Injectable,
|
|
260
260
|
args: [{
|
|
261
261
|
providedIn: 'root',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-category-driver-shopify.mjs","sources":["../../../libs/category/driver/shopify/src/queries/gql/get-category-by-url.ts","../../../libs/category/driver/shopify/src/queries/gql/get-category.ts","../../../libs/category/driver/shopify/src/queries/response.types.ts","../../../libs/category/driver/shopify/src/transforms/shopify-daff-product-filters-transform.ts","../../../libs/category/driver/shopify/src/transforms/shopify-daff-category-transform.ts","../../../libs/category/driver/shopify/src/transforms/shopify-daff-filter-requests-transformer.ts","../../../libs/category/driver/shopify/src/transforms/shopify-product-collection-variables-transform.ts.ts","../../../libs/category/driver/shopify/src/category.service.ts","../../../libs/category/driver/shopify/src/category-driver.module.ts","../../../libs/category/driver/shopify/src/daffodil-category-driver-shopify.ts"],"sourcesContent":["import { gql } from 'apollo-angular';\n\nimport {\n shopifyCollectionCoreFragment,\n shopifyCollectionFiltersFragment,\n shopifyImageFragment,\n shopifyProductCoreFragment,\n shopifyProductPriceRangeFragment,\n} from '@daffodil/driver/shopify';\n\nimport { ShopifyCategoryResponse } from '../response.types';\nimport { ShopifyCategoryUrlVariables } from '../variables.types';\n\n/**\n * GraphQL query object for getting a category (Shopify Collection) by url (handle).\n */\nexport const getCategoryByUrl = gql<ShopifyCategoryResponse, ShopifyCategoryUrlVariables>`\n query GetCategoryByUrl($handle: String!, $reverse: Boolean, $sortKey: ProductCollectionSortKeys, $filters: [ProductFilter!]!, $first: Int) {\n collection(handle: $handle) {\n ...collectionCoreFragment\n image {\n ...imageFragment\n }\n products(first: $first, reverse: $reverse, sortKey: $sortKey, filters: $filters) { \n nodes { \n ...productCoreFragment\n ...productPriceRangeFragment\n } \n filters {\n ...collectionFiltersFragment\n }\n } \n }\n }\n ${shopifyCollectionCoreFragment}\n ${shopifyImageFragment}\n ${shopifyProductCoreFragment}\n ${shopifyProductPriceRangeFragment}\n ${shopifyCollectionFiltersFragment}\n`;\n","import { gql } from 'apollo-angular';\n\nimport {\n shopifyCollectionCoreFragment,\n shopifyCollectionFiltersFragment,\n shopifyImageFragment,\n shopifyProductCoreFragment,\n shopifyProductPriceRangeFragment,\n} from '@daffodil/driver/shopify';\n\nimport { ShopifyCategoryResponse } from '../response.types';\nimport { ShopifyCategoryIDVariables } from '../variables.types';\n\n/**\n * GraphQL query object for getting a category (Shopify Collection) by ID.\n */\nexport const getCategory = gql<ShopifyCategoryResponse, ShopifyCategoryIDVariables>`\n query GetACategory($id: ID, $reverse: Boolean, $sortKey: ProductCollectionSortKeys, $filters: [ProductFilter!]!, $first: Int) {\n collection(id: $id) {\n ...collectionCoreFragment\n image {\n ...imageFragment\n }\n products(first: $first, reverse: $reverse, sortKey: $sortKey, filters: $filters) { \n nodes { \n ...productCoreFragment\n ...productPriceRangeFragment\n } \n filters {\n ...collectionFiltersFragment\n }\n } \n }\n }\n ${shopifyCollectionCoreFragment}\n ${shopifyImageFragment}\n ${shopifyProductCoreFragment}\n ${shopifyProductPriceRangeFragment}\n ${shopifyCollectionFiltersFragment}\n`;\n","import { ShopifyCategory } from '@daffodil/driver/shopify';\n\nexport interface ShopifyCategoryResponse {\n collection: ShopifyCategory;\n}\n\nexport interface ShopifyCategoryResponse extends ShopifyCategory {};\n","import {\n DaffFilterEqual,\n DaffFilterRangeNumeric,\n DaffFilters,\n DaffFilterType,\n} from '@daffodil/core';\nimport {\n daffShopifyFilterJSONInputResultTransformer,\n daffShopifyFilterOptionsTransformer,\n ShopifyFilter,\n ShopifyProductFilter,\n} from '@daffodil/driver/shopify';\n\n/**\n * Transforms an array of Shopify {@link ShopifyProductFilter} objects into a {@link DaffFilters} object.\n */\nexport const daffShopifyProductFiltersTransformer = (shopifyQueryFilters: ShopifyProductFilter[], shopifyResultFilters: ShopifyFilter[]): DaffFilters => {\n const daffFilters: DaffFilters = {};\n for (const resultFilter of shopifyResultFilters) {\n if (resultFilter.type === 'PRICE_RANGE') {\n daffFilters[resultFilter.label] = transformNumericRangeFilter(resultFilter);\n } else {\n daffFilters[resultFilter.label] = transformEqualsFilter(resultFilter, shopifyQueryFilters);\n }\n }\n return daffFilters;\n};\n\n/**\n * Transforms a Shopify numeric range into a {@link DaffFilterRangeNumeric}.\n */\nfunction transformNumericRangeFilter(shopifyFilter: ShopifyFilter): DaffFilterRangeNumeric {\n const inputData = daffShopifyFilterJSONInputResultTransformer(shopifyFilter.values[0].input);\n return {\n type: DaffFilterType.RangeNumeric,\n min: inputData.price.min,\n max: inputData.price.max,\n label: shopifyFilter.label,\n name: shopifyFilter.id,\n options: {\n price: {\n applied: true,\n min: { value: inputData.price.min, label: 'low' },\n max: { value: inputData.price.max, label: 'high' },\n },\n },\n };\n}\n\n/**\n * Transforms a Shopify equals filter into a {@link DaffFilterEqual}.\n */\nfunction transformEqualsFilter(shopifyResultFilter: ShopifyFilter, shopifyQueryFilters: ShopifyProductFilter[]): DaffFilterEqual {\n return {\n type: DaffFilterType.Equal,\n label: shopifyResultFilter.label,\n name: shopifyResultFilter.id,\n options: daffShopifyFilterOptionsTransformer(shopifyResultFilter.values, shopifyQueryFilters),\n };\n}\n","import { DaffGetCategoryResponse } from '@daffodil/category';\nimport { DaffSortDirectionEnum } from '@daffodil/core';\nimport {\n ShopifyCategory,\n ShopifyProductCollectionSortKeys,\n} from '@daffodil/driver/shopify';\nimport { daffShopifyProductTransformer } from '@daffodil/product/driver/shopify';\n\nimport { daffShopifyProductFiltersTransformer } from './shopify-daff-product-filters-transform';\nimport { ShopifyCollectionProductVariables } from '../queries/public_api';\n\n/**\n * Transforms a {@link ShopifyCategory} into a {@link DaffGetCategoryResponse} object.\n *\n * @param collection\n * @param variables - variables used in getCategory/getCategoryByUrl request query\n */\nexport const daffShopifyCategoryTransformer = (collection: ShopifyCategory, variables: ShopifyCollectionProductVariables): DaffGetCategoryResponse => ({\n products: collection.products.nodes.map(daffShopifyProductTransformer),\n category: {\n name: collection.title,\n description: collection.description,\n product_ids: collection.products.nodes.map(node => node.id),\n url: `/Collection/${collection.handle}`,\n id: `/${collection.id}`,\n meta_description: collection.description,\n meta_title: collection.title,\n children_count: 0,\n children: [],\n breadcrumbs: [\n {\n id: `/`,\n url: `/`,\n name: 'Store',\n level: 0,\n },\n {\n id: `/${collection.id}`,\n url: `/Collection/${collection.handle}`,\n name: collection.title,\n level: 1,\n },\n ],\n },\n categoryPageMetadata: {\n id: `/${collection.id}`,\n ids: collection.products.nodes.map(node => node.id),\n currentPage: 1,\n totalPages: 1,\n pageSize: variables.first,\n count: undefined,\n sortOptions: {\n default: ShopifyProductCollectionSortKeys.CollectionDefault,\n options: Object.entries(ShopifyProductCollectionSortKeys).map(([label, value]) => ({ label, value })),\n },\n appliedSortOption: {\n label: variables.sortKey,\n value: variables.sortKey,\n },\n appliedSortDirection: variables.reverse ? DaffSortDirectionEnum.Descending : DaffSortDirectionEnum.Ascending,\n filters: daffShopifyProductFiltersTransformer(variables.filters, collection.products.filters),\n },\n});\n","import {\n DaffFilterRequest,\n DaffFilterType,\n} from '@daffodil/core';\nimport { ShopifyProductFilter } from '@daffodil/driver/shopify';\n\n/**\n * Transforms a {@link DaffFilterRequest} array into a {@link ShopifyProductFilter} object.\n *\n * @param daffFilters - array of daffodil filter requests\n * @returns A corresponding array of shopify-readable filters\n */\nexport const shopifyProductFilterRequestsTransformer = (daffFilterRequests: DaffFilterRequest[]): ShopifyProductFilter[] => {\n if (!daffFilterRequests) {\n return [];\n }\n const result: ShopifyProductFilter[] = [];\n for (const filter of daffFilterRequests) {\n if (filter.type === DaffFilterType.Equal) {\n // Each `jsonInputStr` is a JSON input string from Shopify's FilterValue.input\n // e.g., '{\"tag\":\"summer\"}' or '{\"variantOption\":{\"name\":\"Color\",\"value\":\"Red\"}}'\n for (const jsonInputStr of filter.value) {\n result.push(JSON.parse(jsonInputStr));\n }\n } else if (filter.type === DaffFilterType.RangeNumeric) {\n // Hardcoded ProductFilter type to 'price' because PRICE_RANGE is currently the only\n // range filter type in Shopify's ProductFilter schema\n result.push({ price: { min: filter.value.min, max: filter.value.max }});\n }\n }\n return result;\n};\n","import {\n DaffCategoryIdRequest,\n DaffCategoryUrlRequest,\n} from '@daffodil/category';\nimport { DaffSortDirectionEnum } from '@daffodil/core';\nimport { shopifyProductCollectionSortKeyCoercer } from '@daffodil/driver/shopify';\n\nimport { shopifyProductFilterRequestsTransformer } from './shopify-daff-filter-requests-transformer';\nimport { ShopifyCollectionProductVariables } from '../queries/variables.types';\n\n/**\n * Transforms a categoryRequest into a {@link ShopifyCollectionProductVariables} object.\n *\n * @param categoryRequest\n * @returns shopify-readable product collection variables for the Storefront API query\n */\nexport const shopifyProductCollectionVariablesTransformer = (categoryRequest: DaffCategoryIdRequest | DaffCategoryUrlRequest): ShopifyCollectionProductVariables => ({\n sortKey: shopifyProductCollectionSortKeyCoercer(categoryRequest.appliedSortOption),\n reverse: categoryRequest.appliedSortDirection === DaffSortDirectionEnum.Descending ? true : false,\n filters: shopifyProductFilterRequestsTransformer(categoryRequest.filterRequests),\n first: categoryRequest.pageSize,\n});\n","import { Injectable } from '@angular/core';\nimport { Apollo } from 'apollo-angular';\nimport { Observable } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\nimport {\n DaffGetCategoryResponse,\n DaffCategoryUrlRequest,\n DaffCategoryIdRequest,\n} from '@daffodil/category';\nimport { DaffCategoryServiceInterface } from '@daffodil/category/driver';\nimport {\n shopifyIdTransformer,\n shopifyUrlTransformer,\n} from '@daffodil/driver/shopify';\n\nimport {\n getCategory,\n getCategoryByUrl,\n} from './queries/public_api';\nimport { daffShopifyCategoryTransformer } from './transforms/public_api';\nimport { shopifyProductCollectionVariablesTransformer } from './transforms/shopify-product-collection-variables-transform.ts';\n\n/**\n * A service for making shopify apollo queries for categories. Should be provided via the {@link DaffCategoryDriver} token.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffShopifyCategoryService implements DaffCategoryServiceInterface {\n\n constructor(private apollo: Apollo) {}\n\n get(categoryRequest: DaffCategoryIdRequest): Observable<DaffGetCategoryResponse> {\n const shopifyVariables = shopifyProductCollectionVariablesTransformer(categoryRequest);\n return this.apollo\n .query({\n query: getCategory,\n variables: {\n id: shopifyIdTransformer(categoryRequest.id, 'Collection'),\n sortKey: shopifyVariables.sortKey,\n reverse: shopifyVariables.reverse,\n filters: shopifyVariables.filters,\n first: shopifyVariables.first,\n },\n })\n .pipe(\n map((result) => {\n const collection = result.data.collection;\n return daffShopifyCategoryTransformer(collection, shopifyVariables);\n }),\n );\n }\n\n getByUrl(categoryRequest: DaffCategoryUrlRequest): Observable<DaffGetCategoryResponse> {\n const shopifyVariables = shopifyProductCollectionVariablesTransformer(categoryRequest);\n return this.apollo\n .query({\n query: getCategoryByUrl,\n variables: {\n handle: shopifyUrlTransformer(categoryRequest.url),\n sortKey: shopifyVariables.sortKey,\n reverse: shopifyVariables.reverse,\n filters: shopifyVariables.filters,\n first: shopifyVariables.first,\n },\n })\n .pipe(\n map((result) => {\n const collection = result.data.collection;\n return daffShopifyCategoryTransformer(collection, shopifyVariables);\n }),\n );\n }\n}\n","import { provideDaffCategoryDriver } from '@daffodil/category/driver';\n\nimport { DaffShopifyCategoryService } from './category.service';\n\n/**\n * Provides the {@link DaffCategoryDriver} as the {@link DaffShopifyCategoryService}.\n */\nexport const provideDaffCategoryShopifyDriver = () =>\n provideDaffCategoryDriver(DaffShopifyCategoryService);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAaA;;AAEG;AACI,MAAM,gBAAgB,GAAG,GAAG,CAAsD;;;;;;;;;;;;;;;;;;IAkBrF,6BAA6B;IAC7B,oBAAoB;IACpB,0BAA0B;IAC1B,gCAAgC;IAChC,gCAAgC;;;ACzBpC;;AAEG;AACI,MAAM,WAAW,GAAG,GAAG,CAAqD;;;;;;;;;;;;;;;;;;IAkB/E,6BAA6B;IAC7B,oBAAoB;IACpB,0BAA0B;IAC1B,gCAAgC;IAChC,gCAAgC;;;AChC+B;;ACOnE;;AAEG;AACI,MAAM,oCAAoC,GAAG,CAAC,mBAA2C,EAAE,oBAAqC,KAAiB;IACtJ,MAAM,WAAW,GAAgB,EAAE;AACnC,IAAA,KAAK,MAAM,YAAY,IAAI,oBAAoB,EAAE;AAC/C,QAAA,IAAI,YAAY,CAAC,IAAI,KAAK,aAAa,EAAE;YACvC,WAAW,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,2BAA2B,CAAC,YAAY,CAAC;QAC7E;aAAO;AACL,YAAA,WAAW,CAAC,YAAY,CAAC,KAAK,CAAC,GA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C,CAAC,eAAe,CAAC;QACtF,OAAO,IAAI,CAAC;AACT,aAAA,KAAK,CAAC;AACL,YAAA,KAAK,EAAE,gBAAgB;AACvB,YAAA,SAAS,EAAE;AACT,gBAAA,MAAM,EAAE,qBAAqB,CAAC,eAAe,CAAC,GAAG,CAAC;gBAClD,OAAO,EAAE,gBAAgB,CAAC,OAAO;gBACjC,OAAO,EAAE,gBAAgB,CAAC,OAAO;gBACjC,OAAO,EAAE,gBAAgB,CAAC,OAAO;gBACjC,KAAK,EAAE,gBAAgB,CAAC,KAAK;AAC9B,aAAA;SACF;AACA,aAAA,IAAI,CACH,GAAG,CAAC,CAAC,MAAM,KAAI;AACb,YAAA,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU;AACzC,YAAA,OAAO,8BAA8B,CAAC,UAAU,EAAE,gBAAgB,CAAC;QACrE,CAAC,CAAC,CACH;IACL;kIA5CW,0BAA0B,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,MAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA1B,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,0BAA0B,cAFzB,MAAM,EAAA,CAAA,CAAA;;4FAEP,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAHtC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;AC1BD;;AAEG;AACI,MAAM,gCAAgC,GAAG,MAC9C,yBAAyB,CAAC,0BAA0B;;ACRtD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"daffodil-category-driver-shopify.mjs","sources":["../../../libs/category/driver/shopify/src/queries/gql/get-category-by-url.ts","../../../libs/category/driver/shopify/src/queries/gql/get-category.ts","../../../libs/category/driver/shopify/src/queries/response.types.ts","../../../libs/category/driver/shopify/src/transforms/shopify-daff-product-filters-transform.ts","../../../libs/category/driver/shopify/src/transforms/shopify-daff-category-transform.ts","../../../libs/category/driver/shopify/src/transforms/shopify-daff-filter-requests-transformer.ts","../../../libs/category/driver/shopify/src/transforms/shopify-product-collection-variables-transform.ts.ts","../../../libs/category/driver/shopify/src/category.service.ts","../../../libs/category/driver/shopify/src/category-driver.module.ts","../../../libs/category/driver/shopify/src/daffodil-category-driver-shopify.ts"],"sourcesContent":["import { gql } from 'apollo-angular';\n\nimport {\n shopifyCollectionCoreFragment,\n shopifyCollectionFiltersFragment,\n shopifyImageFragment,\n shopifyProductCoreFragment,\n shopifyProductPriceRangeFragment,\n} from '@daffodil/driver/shopify';\n\nimport { ShopifyCategoryResponse } from '../response.types';\nimport { ShopifyCategoryUrlVariables } from '../variables.types';\n\n/**\n * GraphQL query object for getting a category (Shopify Collection) by url (handle).\n */\nexport const getCategoryByUrl = gql<ShopifyCategoryResponse, ShopifyCategoryUrlVariables>`\n query GetCategoryByUrl($handle: String!, $reverse: Boolean, $sortKey: ProductCollectionSortKeys, $filters: [ProductFilter!]!, $first: Int) {\n collection(handle: $handle) {\n ...collectionCoreFragment\n image {\n ...imageFragment\n }\n products(first: $first, reverse: $reverse, sortKey: $sortKey, filters: $filters) { \n nodes { \n ...productCoreFragment\n ...productPriceRangeFragment\n } \n filters {\n ...collectionFiltersFragment\n }\n } \n }\n }\n ${shopifyCollectionCoreFragment}\n ${shopifyImageFragment}\n ${shopifyProductCoreFragment}\n ${shopifyProductPriceRangeFragment}\n ${shopifyCollectionFiltersFragment}\n`;\n","import { gql } from 'apollo-angular';\n\nimport {\n shopifyCollectionCoreFragment,\n shopifyCollectionFiltersFragment,\n shopifyImageFragment,\n shopifyProductCoreFragment,\n shopifyProductPriceRangeFragment,\n} from '@daffodil/driver/shopify';\n\nimport { ShopifyCategoryResponse } from '../response.types';\nimport { ShopifyCategoryIDVariables } from '../variables.types';\n\n/**\n * GraphQL query object for getting a category (Shopify Collection) by ID.\n */\nexport const getCategory = gql<ShopifyCategoryResponse, ShopifyCategoryIDVariables>`\n query GetACategory($id: ID, $reverse: Boolean, $sortKey: ProductCollectionSortKeys, $filters: [ProductFilter!]!, $first: Int) {\n collection(id: $id) {\n ...collectionCoreFragment\n image {\n ...imageFragment\n }\n products(first: $first, reverse: $reverse, sortKey: $sortKey, filters: $filters) { \n nodes { \n ...productCoreFragment\n ...productPriceRangeFragment\n } \n filters {\n ...collectionFiltersFragment\n }\n } \n }\n }\n ${shopifyCollectionCoreFragment}\n ${shopifyImageFragment}\n ${shopifyProductCoreFragment}\n ${shopifyProductPriceRangeFragment}\n ${shopifyCollectionFiltersFragment}\n`;\n","import { ShopifyCategory } from '@daffodil/driver/shopify';\n\nexport interface ShopifyCategoryResponse {\n collection: ShopifyCategory;\n}\n\nexport interface ShopifyCategoryResponse extends ShopifyCategory {};\n","import {\n DaffFilterEqual,\n DaffFilterRangeNumeric,\n DaffFilters,\n DaffFilterType,\n} from '@daffodil/core';\nimport {\n daffShopifyFilterJSONInputResultTransformer,\n daffShopifyFilterOptionsTransformer,\n ShopifyFilter,\n ShopifyProductFilter,\n} from '@daffodil/driver/shopify';\n\n/**\n * Transforms an array of Shopify {@link ShopifyProductFilter} objects into a {@link DaffFilters} object.\n */\nexport const daffShopifyProductFiltersTransformer = (shopifyQueryFilters: ShopifyProductFilter[], shopifyResultFilters: ShopifyFilter[]): DaffFilters => {\n const daffFilters: DaffFilters = {};\n for (const resultFilter of shopifyResultFilters) {\n if (resultFilter.type === 'PRICE_RANGE') {\n daffFilters[resultFilter.label] = transformNumericRangeFilter(resultFilter);\n } else {\n daffFilters[resultFilter.label] = transformEqualsFilter(resultFilter, shopifyQueryFilters);\n }\n }\n return daffFilters;\n};\n\n/**\n * Transforms a Shopify numeric range into a {@link DaffFilterRangeNumeric}.\n */\nfunction transformNumericRangeFilter(shopifyFilter: ShopifyFilter): DaffFilterRangeNumeric {\n const inputData = daffShopifyFilterJSONInputResultTransformer(shopifyFilter.values[0].input);\n return {\n type: DaffFilterType.RangeNumeric,\n min: inputData.price.min,\n max: inputData.price.max,\n label: shopifyFilter.label,\n name: shopifyFilter.id,\n options: {\n price: {\n applied: true,\n min: { value: inputData.price.min, label: 'low' },\n max: { value: inputData.price.max, label: 'high' },\n },\n },\n };\n}\n\n/**\n * Transforms a Shopify equals filter into a {@link DaffFilterEqual}.\n */\nfunction transformEqualsFilter(shopifyResultFilter: ShopifyFilter, shopifyQueryFilters: ShopifyProductFilter[]): DaffFilterEqual {\n return {\n type: DaffFilterType.Equal,\n label: shopifyResultFilter.label,\n name: shopifyResultFilter.id,\n options: daffShopifyFilterOptionsTransformer(shopifyResultFilter.values, shopifyQueryFilters),\n };\n}\n","import { DaffGetCategoryResponse } from '@daffodil/category';\nimport { DaffSortDirectionEnum } from '@daffodil/core';\nimport {\n ShopifyCategory,\n ShopifyProductCollectionSortKeys,\n} from '@daffodil/driver/shopify';\nimport { daffShopifyProductTransformer } from '@daffodil/product/driver/shopify';\n\nimport { daffShopifyProductFiltersTransformer } from './shopify-daff-product-filters-transform';\nimport { ShopifyCollectionProductVariables } from '../queries/public_api';\n\n/**\n * Transforms a {@link ShopifyCategory} into a {@link DaffGetCategoryResponse} object.\n *\n * @param collection\n * @param variables - variables used in getCategory/getCategoryByUrl request query\n */\nexport const daffShopifyCategoryTransformer = (collection: ShopifyCategory, variables: ShopifyCollectionProductVariables): DaffGetCategoryResponse => ({\n products: collection.products.nodes.map(daffShopifyProductTransformer),\n category: {\n name: collection.title,\n description: collection.description,\n product_ids: collection.products.nodes.map(node => node.id),\n url: `/Collection/${collection.handle}`,\n id: `/${collection.id}`,\n meta_description: collection.description,\n meta_title: collection.title,\n children_count: 0,\n children: [],\n breadcrumbs: [\n {\n id: `/`,\n url: `/`,\n name: 'Store',\n level: 0,\n },\n {\n id: `/${collection.id}`,\n url: `/Collection/${collection.handle}`,\n name: collection.title,\n level: 1,\n },\n ],\n },\n categoryPageMetadata: {\n id: `/${collection.id}`,\n ids: collection.products.nodes.map(node => node.id),\n currentPage: 1,\n totalPages: 1,\n pageSize: variables.first,\n count: undefined,\n sortOptions: {\n default: ShopifyProductCollectionSortKeys.CollectionDefault,\n options: Object.entries(ShopifyProductCollectionSortKeys).map(([label, value]) => ({ label, value })),\n },\n appliedSortOption: {\n label: variables.sortKey,\n value: variables.sortKey,\n },\n appliedSortDirection: variables.reverse ? DaffSortDirectionEnum.Descending : DaffSortDirectionEnum.Ascending,\n filters: daffShopifyProductFiltersTransformer(variables.filters, collection.products.filters),\n },\n});\n","import {\n DaffFilterRequest,\n DaffFilterType,\n} from '@daffodil/core';\nimport { ShopifyProductFilter } from '@daffodil/driver/shopify';\n\n/**\n * Transforms a {@link DaffFilterRequest} array into a {@link ShopifyProductFilter} object.\n *\n * @param daffFilters - array of daffodil filter requests\n * @returns A corresponding array of shopify-readable filters\n */\nexport const shopifyProductFilterRequestsTransformer = (daffFilterRequests: DaffFilterRequest[]): ShopifyProductFilter[] => {\n if (!daffFilterRequests) {\n return [];\n }\n const result: ShopifyProductFilter[] = [];\n for (const filter of daffFilterRequests) {\n if (filter.type === DaffFilterType.Equal) {\n // Each `jsonInputStr` is a JSON input string from Shopify's FilterValue.input\n // e.g., '{\"tag\":\"summer\"}' or '{\"variantOption\":{\"name\":\"Color\",\"value\":\"Red\"}}'\n for (const jsonInputStr of filter.value) {\n result.push(JSON.parse(jsonInputStr));\n }\n } else if (filter.type === DaffFilterType.RangeNumeric) {\n // Hardcoded ProductFilter type to 'price' because PRICE_RANGE is currently the only\n // range filter type in Shopify's ProductFilter schema\n result.push({ price: { min: filter.value.min, max: filter.value.max }});\n }\n }\n return result;\n};\n","import {\n DaffCategoryIdRequest,\n DaffCategoryUrlRequest,\n} from '@daffodil/category';\nimport { DaffSortDirectionEnum } from '@daffodil/core';\nimport { shopifyProductCollectionSortKeyCoercer } from '@daffodil/driver/shopify';\n\nimport { shopifyProductFilterRequestsTransformer } from './shopify-daff-filter-requests-transformer';\nimport { ShopifyCollectionProductVariables } from '../queries/variables.types';\n\n/**\n * Transforms a categoryRequest into a {@link ShopifyCollectionProductVariables} object.\n *\n * @param categoryRequest\n * @returns shopify-readable product collection variables for the Storefront API query\n */\nexport const shopifyProductCollectionVariablesTransformer = (categoryRequest: DaffCategoryIdRequest | DaffCategoryUrlRequest): ShopifyCollectionProductVariables => ({\n sortKey: shopifyProductCollectionSortKeyCoercer(categoryRequest.appliedSortOption),\n reverse: categoryRequest.appliedSortDirection === DaffSortDirectionEnum.Descending ? true : false,\n filters: shopifyProductFilterRequestsTransformer(categoryRequest.filterRequests),\n first: categoryRequest.pageSize,\n});\n","import { Injectable } from '@angular/core';\nimport { Apollo } from 'apollo-angular';\nimport { Observable } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\nimport {\n DaffGetCategoryResponse,\n DaffCategoryUrlRequest,\n DaffCategoryIdRequest,\n} from '@daffodil/category';\nimport { DaffCategoryServiceInterface } from '@daffodil/category/driver';\nimport {\n shopifyIdTransformer,\n shopifyUrlTransformer,\n} from '@daffodil/driver/shopify';\n\nimport {\n getCategory,\n getCategoryByUrl,\n} from './queries/public_api';\nimport { daffShopifyCategoryTransformer } from './transforms/public_api';\nimport { shopifyProductCollectionVariablesTransformer } from './transforms/shopify-product-collection-variables-transform.ts';\n\n/**\n * A service for making shopify apollo queries for categories. Should be provided via the {@link DaffCategoryDriver} token.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffShopifyCategoryService implements DaffCategoryServiceInterface {\n\n constructor(private apollo: Apollo) {}\n\n get(categoryRequest: DaffCategoryIdRequest): Observable<DaffGetCategoryResponse> {\n const shopifyVariables = shopifyProductCollectionVariablesTransformer(categoryRequest);\n return this.apollo\n .query({\n query: getCategory,\n variables: {\n id: shopifyIdTransformer(categoryRequest.id, 'Collection'),\n sortKey: shopifyVariables.sortKey,\n reverse: shopifyVariables.reverse,\n filters: shopifyVariables.filters,\n first: shopifyVariables.first,\n },\n })\n .pipe(\n map((result) => {\n const collection = result.data.collection;\n return daffShopifyCategoryTransformer(collection, shopifyVariables);\n }),\n );\n }\n\n getByUrl(categoryRequest: DaffCategoryUrlRequest): Observable<DaffGetCategoryResponse> {\n const shopifyVariables = shopifyProductCollectionVariablesTransformer(categoryRequest);\n return this.apollo\n .query({\n query: getCategoryByUrl,\n variables: {\n handle: shopifyUrlTransformer(categoryRequest.url),\n sortKey: shopifyVariables.sortKey,\n reverse: shopifyVariables.reverse,\n filters: shopifyVariables.filters,\n first: shopifyVariables.first,\n },\n })\n .pipe(\n map((result) => {\n const collection = result.data.collection;\n return daffShopifyCategoryTransformer(collection, shopifyVariables);\n }),\n );\n }\n}\n","import { provideDaffCategoryDriver } from '@daffodil/category/driver';\n\nimport { DaffShopifyCategoryService } from './category.service';\n\n/**\n * Provides the {@link DaffCategoryDriver} as the {@link DaffShopifyCategoryService}.\n */\nexport const provideDaffCategoryShopifyDriver = () =>\n provideDaffCategoryDriver(DaffShopifyCategoryService);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAaA;;AAEG;AACI,MAAM,gBAAgB,GAAG,GAAG,CAAsD;;;;;;;;;;;;;;;;;;IAkBrF,6BAA6B;IAC7B,oBAAoB;IACpB,0BAA0B;IAC1B,gCAAgC;IAChC,gCAAgC;;;ACzBpC;;AAEG;AACI,MAAM,WAAW,GAAG,GAAG,CAAqD;;;;;;;;;;;;;;;;;;IAkB/E,6BAA6B;IAC7B,oBAAoB;IACpB,0BAA0B;IAC1B,gCAAgC;IAChC,gCAAgC;;;AChC+B;;ACOnE;;AAEG;AACI,MAAM,oCAAoC,GAAG,CAAC,mBAA2C,EAAE,oBAAqC,KAAiB;IACtJ,MAAM,WAAW,GAAgB,EAAE;AACnC,IAAA,KAAK,MAAM,YAAY,IAAI,oBAAoB,EAAE;AAC/C,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C1BD;;AAEG;AACI,MAAM,gCAAgC,GAAG,MAC9C,yBAAyB,CAAC,0BAA0B;;ACRtD;;AAEG;;;;"}
|
|
@@ -31,10 +31,10 @@ class DaffTestingCategoryService {
|
|
|
31
31
|
products: this.productFactory.createMany(3),
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
35
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
34
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffTestingCategoryService, deps: [{ token: i1.DaffCategoryFactory }, { token: i1.DaffCategoryPageMetadataFactory }, { token: i2.DaffProductFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
35
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffTestingCategoryService, providedIn: 'root' }); }
|
|
36
36
|
}
|
|
37
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
37
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffTestingCategoryService, decorators: [{
|
|
38
38
|
type: Injectable,
|
|
39
39
|
args: [{
|
|
40
40
|
providedIn: 'root',
|
|
@@ -53,11 +53,11 @@ class DaffCategoryTestingDriverModule {
|
|
|
53
53
|
],
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
57
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
58
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
56
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffCategoryTestingDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
57
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: DaffCategoryTestingDriverModule, imports: [CommonModule] }); }
|
|
58
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffCategoryTestingDriverModule, imports: [CommonModule] }); }
|
|
59
59
|
}
|
|
60
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
60
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffCategoryTestingDriverModule, decorators: [{
|
|
61
61
|
type: NgModule,
|
|
62
62
|
args: [{
|
|
63
63
|
imports: [
|