@daffodil/category 0.91.0 → 0.92.3-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,275 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable } from '@angular/core';
3
+ import * as i1 from 'apollo-angular';
4
+ import { gql } from 'apollo-angular';
5
+ import { map } from 'rxjs/operators';
6
+ import { shopifyCollectionCoreFragment, shopifyImageFragment, shopifyProductCoreFragment, shopifyProductPriceRangeFragment, shopifyCollectionFiltersFragment, daffShopifyFilterJSONInputResultTransformer, daffShopifyFilterOptionsTransformer, ShopifyProductCollectionSortKeys, shopifyProductCollectionSortKeyCoercer, shopifyIdTransformer, shopifyUrlTransformer } from '@daffodil/driver/shopify';
7
+ import { DaffFilterType, DaffSortDirectionEnum } from '@daffodil/core';
8
+ import { daffShopifyProductTransformer } from '@daffodil/product/driver/shopify';
9
+ import { provideDaffCategoryDriver } from '@daffodil/category/driver';
10
+
11
+ /**
12
+ * GraphQL query object for getting a category (Shopify Collection) by url (handle).
13
+ */
14
+ const getCategoryByUrl = gql `
15
+ query GetCategoryByUrl($handle: String!, $reverse: Boolean, $sortKey: ProductCollectionSortKeys, $filters: [ProductFilter!]!, $first: Int) {
16
+ collection(handle: $handle) {
17
+ ...collectionCoreFragment
18
+ image {
19
+ ...imageFragment
20
+ }
21
+ products(first: $first, reverse: $reverse, sortKey: $sortKey, filters: $filters) {
22
+ nodes {
23
+ ...productCoreFragment
24
+ ...productPriceRangeFragment
25
+ }
26
+ filters {
27
+ ...collectionFiltersFragment
28
+ }
29
+ }
30
+ }
31
+ }
32
+ ${shopifyCollectionCoreFragment}
33
+ ${shopifyImageFragment}
34
+ ${shopifyProductCoreFragment}
35
+ ${shopifyProductPriceRangeFragment}
36
+ ${shopifyCollectionFiltersFragment}
37
+ `;
38
+
39
+ /**
40
+ * GraphQL query object for getting a category (Shopify Collection) by ID.
41
+ */
42
+ const getCategory = gql `
43
+ query GetACategory($id: ID, $reverse: Boolean, $sortKey: ProductCollectionSortKeys, $filters: [ProductFilter!]!, $first: Int) {
44
+ collection(id: $id) {
45
+ ...collectionCoreFragment
46
+ image {
47
+ ...imageFragment
48
+ }
49
+ products(first: $first, reverse: $reverse, sortKey: $sortKey, filters: $filters) {
50
+ nodes {
51
+ ...productCoreFragment
52
+ ...productPriceRangeFragment
53
+ }
54
+ filters {
55
+ ...collectionFiltersFragment
56
+ }
57
+ }
58
+ }
59
+ }
60
+ ${shopifyCollectionCoreFragment}
61
+ ${shopifyImageFragment}
62
+ ${shopifyProductCoreFragment}
63
+ ${shopifyProductPriceRangeFragment}
64
+ ${shopifyCollectionFiltersFragment}
65
+ `;
66
+
67
+ ;
68
+
69
+ /**
70
+ * Transforms an array of Shopify {@link ShopifyProductFilter} objects into a {@link DaffFilters} object.
71
+ */
72
+ const daffShopifyProductFiltersTransformer = (shopifyQueryFilters, shopifyResultFilters) => {
73
+ const daffFilters = {};
74
+ for (const resultFilter of shopifyResultFilters) {
75
+ if (resultFilter.type === 'PRICE_RANGE') {
76
+ daffFilters[resultFilter.label] = transformNumericRangeFilter(resultFilter);
77
+ }
78
+ else {
79
+ daffFilters[resultFilter.label] = transformEqualsFilter(resultFilter, shopifyQueryFilters);
80
+ }
81
+ }
82
+ return daffFilters;
83
+ };
84
+ /**
85
+ * Transforms a Shopify numeric range into a {@link DaffFilterRangeNumeric}.
86
+ */
87
+ function transformNumericRangeFilter(shopifyFilter) {
88
+ const inputData = daffShopifyFilterJSONInputResultTransformer(shopifyFilter.values[0].input);
89
+ return {
90
+ type: DaffFilterType.RangeNumeric,
91
+ min: inputData.price.min,
92
+ max: inputData.price.max,
93
+ label: shopifyFilter.label,
94
+ name: shopifyFilter.id,
95
+ options: {
96
+ price: {
97
+ applied: true,
98
+ min: { value: inputData.price.min, label: 'low' },
99
+ max: { value: inputData.price.max, label: 'high' },
100
+ },
101
+ },
102
+ };
103
+ }
104
+ /**
105
+ * Transforms a Shopify equals filter into a {@link DaffFilterEqual}.
106
+ */
107
+ function transformEqualsFilter(shopifyResultFilter, shopifyQueryFilters) {
108
+ return {
109
+ type: DaffFilterType.Equal,
110
+ label: shopifyResultFilter.label,
111
+ name: shopifyResultFilter.id,
112
+ options: daffShopifyFilterOptionsTransformer(shopifyResultFilter.values, shopifyQueryFilters),
113
+ };
114
+ }
115
+
116
+ /**
117
+ * Transforms a {@link ShopifyCategory} into a {@link DaffGetCategoryResponse} object.
118
+ *
119
+ * @param collection
120
+ * @param variables - variables used in getCategory/getCategoryByUrl request query
121
+ */
122
+ const daffShopifyCategoryTransformer = (collection, variables) => ({
123
+ products: collection.products.nodes.map(daffShopifyProductTransformer),
124
+ category: {
125
+ name: collection.title,
126
+ description: collection.description,
127
+ product_ids: collection.products.nodes.map(node => node.id),
128
+ url: `/Collection/${collection.handle}`,
129
+ id: `/${collection.id}`,
130
+ meta_description: collection.description,
131
+ meta_title: collection.title,
132
+ children_count: 0,
133
+ children: [],
134
+ breadcrumbs: [
135
+ {
136
+ id: `/`,
137
+ url: `/`,
138
+ name: 'Store',
139
+ level: 0,
140
+ },
141
+ {
142
+ id: `/${collection.id}`,
143
+ url: `/Collection/${collection.handle}`,
144
+ name: collection.title,
145
+ level: 1,
146
+ },
147
+ ],
148
+ },
149
+ categoryPageMetadata: {
150
+ id: `/${collection.id}`,
151
+ ids: collection.products.nodes.map(node => node.id),
152
+ currentPage: 1,
153
+ totalPages: 1,
154
+ pageSize: variables.first,
155
+ count: undefined,
156
+ sortOptions: {
157
+ default: ShopifyProductCollectionSortKeys.CollectionDefault,
158
+ options: Object.entries(ShopifyProductCollectionSortKeys).map(([label, value]) => ({ label, value })),
159
+ },
160
+ appliedSortOption: {
161
+ label: variables.sortKey,
162
+ value: variables.sortKey,
163
+ },
164
+ appliedSortDirection: variables.reverse ? DaffSortDirectionEnum.Descending : DaffSortDirectionEnum.Ascending,
165
+ filters: daffShopifyProductFiltersTransformer(variables.filters, collection.products.filters),
166
+ },
167
+ });
168
+
169
+ /**
170
+ * Transforms a {@link DaffFilterRequest} array into a {@link ShopifyProductFilter} object.
171
+ *
172
+ * @param daffFilters - array of daffodil filter requests
173
+ * @returns A corresponding array of shopify-readable filters
174
+ */
175
+ const shopifyProductFilterRequestsTransformer = (daffFilterRequests) => {
176
+ if (!daffFilterRequests) {
177
+ return [];
178
+ }
179
+ const result = [];
180
+ for (const filter of daffFilterRequests) {
181
+ if (filter.type === DaffFilterType.Equal) {
182
+ // Each `jsonInputStr` is a JSON input string from Shopify's FilterValue.input
183
+ // e.g., '{"tag":"summer"}' or '{"variantOption":{"name":"Color","value":"Red"}}'
184
+ for (const jsonInputStr of filter.value) {
185
+ result.push(JSON.parse(jsonInputStr));
186
+ }
187
+ }
188
+ else if (filter.type === DaffFilterType.RangeNumeric) {
189
+ // Hardcoded ProductFilter type to 'price' because PRICE_RANGE is currently the only
190
+ // range filter type in Shopify's ProductFilter schema
191
+ result.push({ price: { min: filter.value.min, max: filter.value.max } });
192
+ }
193
+ }
194
+ return result;
195
+ };
196
+
197
+ /**
198
+ * Transforms a categoryRequest into a {@link ShopifyCollectionProductVariables} object.
199
+ *
200
+ * @param categoryRequest
201
+ * @returns shopify-readable product collection variables for the Storefront API query
202
+ */
203
+ const shopifyProductCollectionVariablesTransformer = (categoryRequest) => ({
204
+ sortKey: shopifyProductCollectionSortKeyCoercer(categoryRequest.appliedSortOption),
205
+ reverse: categoryRequest.appliedSortDirection === DaffSortDirectionEnum.Descending ? true : false,
206
+ filters: shopifyProductFilterRequestsTransformer(categoryRequest.filterRequests),
207
+ first: categoryRequest.pageSize,
208
+ });
209
+
210
+ /**
211
+ * A service for making shopify apollo queries for categories. Should be provided via the {@link DaffCategoryDriver} token.
212
+ *
213
+ * @inheritdoc
214
+ */
215
+ class DaffShopifyCategoryService {
216
+ constructor(apollo) {
217
+ this.apollo = apollo;
218
+ }
219
+ get(categoryRequest) {
220
+ const shopifyVariables = shopifyProductCollectionVariablesTransformer(categoryRequest);
221
+ return this.apollo
222
+ .query({
223
+ query: getCategory,
224
+ variables: {
225
+ id: shopifyIdTransformer(categoryRequest.id, 'Collection'),
226
+ sortKey: shopifyVariables.sortKey,
227
+ reverse: shopifyVariables.reverse,
228
+ filters: shopifyVariables.filters,
229
+ first: shopifyVariables.first,
230
+ },
231
+ })
232
+ .pipe(map((result) => {
233
+ const collection = result.data.collection;
234
+ return daffShopifyCategoryTransformer(collection, shopifyVariables);
235
+ }));
236
+ }
237
+ getByUrl(categoryRequest) {
238
+ const shopifyVariables = shopifyProductCollectionVariablesTransformer(categoryRequest);
239
+ return this.apollo
240
+ .query({
241
+ query: getCategoryByUrl,
242
+ variables: {
243
+ handle: shopifyUrlTransformer(categoryRequest.url),
244
+ sortKey: shopifyVariables.sortKey,
245
+ reverse: shopifyVariables.reverse,
246
+ filters: shopifyVariables.filters,
247
+ first: shopifyVariables.first,
248
+ },
249
+ })
250
+ .pipe(map((result) => {
251
+ const collection = result.data.collection;
252
+ return daffShopifyCategoryTransformer(collection, shopifyVariables);
253
+ }));
254
+ }
255
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffShopifyCategoryService, deps: [{ token: i1.Apollo }], target: i0.ɵɵFactoryTarget.Injectable }); }
256
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffShopifyCategoryService, providedIn: 'root' }); }
257
+ }
258
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffShopifyCategoryService, decorators: [{
259
+ type: Injectable,
260
+ args: [{
261
+ providedIn: 'root',
262
+ }]
263
+ }], ctorParameters: () => [{ type: i1.Apollo }] });
264
+
265
+ /**
266
+ * Provides the {@link DaffCategoryDriver} as the {@link DaffShopifyCategoryService}.
267
+ */
268
+ const provideDaffCategoryShopifyDriver = () => provideDaffCategoryDriver(DaffShopifyCategoryService);
269
+
270
+ /**
271
+ * Generated bundle index. Do not edit.
272
+ */
273
+
274
+ export { DaffShopifyCategoryService, daffShopifyCategoryTransformer, getCategory, getCategoryByUrl, provideDaffCategoryShopifyDriver };
275
+ //# sourceMappingURL=daffodil-category-driver-shopify.mjs.map
@@ -0,0 +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,GAA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A,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;;;;"}
@@ -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: "20.3.1", 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: "20.3.1", ngImport: i0, type: DaffTestingCategoryService, providedIn: 'root' }); }
34
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", 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: "20.3.18", ngImport: i0, type: DaffTestingCategoryService, providedIn: 'root' }); }
36
36
  }
37
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffTestingCategoryService, decorators: [{
37
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", 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: "20.3.1", ngImport: i0, type: DaffCategoryTestingDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
57
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.1", ngImport: i0, type: DaffCategoryTestingDriverModule, imports: [CommonModule] }); }
58
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCategoryTestingDriverModule, imports: [CommonModule] }); }
56
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffCategoryTestingDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
57
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.18", ngImport: i0, type: DaffCategoryTestingDriverModule, imports: [CommonModule] }); }
58
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffCategoryTestingDriverModule, imports: [CommonModule] }); }
59
59
  }
60
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCategoryTestingDriverModule, decorators: [{
60
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffCategoryTestingDriverModule, decorators: [{
61
61
  type: NgModule,
62
62
  args: [{
63
63
  imports: [
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-category-driver-testing.mjs","sources":["../../../libs/category/driver/testing/src/drivers/category.service.ts","../../../libs/category/driver/testing/src/drivers/category-driver.module.ts","../../../libs/category/driver/testing/src/daffodil-category-driver-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n Observable,\n of,\n} from 'rxjs';\n\nimport {\n DaffGetCategoryResponse,\n DaffCategoryIdRequest,\n DaffCategoryUrlRequest,\n} from '@daffodil/category';\nimport { DaffCategoryServiceInterface } from '@daffodil/category/driver';\nimport {\n DaffCategoryFactory,\n DaffCategoryPageMetadataFactory,\n} from '@daffodil/category/testing';\nimport { DaffProductFactory } from '@daffodil/product/testing';\n\n/**\n * The category testing driver to mock {@link DaffCategoryServiceInterface}.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffTestingCategoryService implements DaffCategoryServiceInterface {\n\n constructor(\n private categoryFactory: DaffCategoryFactory,\n private categoryPageMetadataFactory: DaffCategoryPageMetadataFactory,\n private productFactory: DaffProductFactory,\n ) {}\n\n get(categoryRequest: DaffCategoryIdRequest): Observable<DaffGetCategoryResponse> {\n return of({\n category: this.categoryFactory.create(),\n categoryPageMetadata: this.categoryPageMetadataFactory.create(),\n products: this.productFactory.createMany(3),\n });\n }\n\n getByUrl(categoryRequest: DaffCategoryUrlRequest): Observable<DaffGetCategoryResponse> {\n return of({\n category: this.categoryFactory.create(),\n categoryPageMetadata: this.categoryPageMetadataFactory.create(),\n products: this.productFactory.createMany(3),\n });\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { provideDaffCategoryDriver } from '@daffodil/category/driver';\n\nimport { DaffTestingCategoryService } from './category.service';\n\n/**\n * A module for providing the {@link DaffTestingCategoryService} for the {@link DaffCategoryDriver} token.\n */\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffCategoryTestingDriverModule {\n static forRoot(): ModuleWithProviders<DaffCategoryTestingDriverModule> {\n return {\n ngModule: DaffCategoryTestingDriverModule,\n providers: [\n provideDaffCategoryDriver(DaffTestingCategoryService),\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAkBA;;;;AAIG;MAIU,0BAA0B,CAAA;AAErC,IAAA,WAAA,CACU,eAAoC,EACpC,2BAA4D,EAC5D,cAAkC,EAAA;QAFlC,IAAA,CAAA,eAAe,GAAf,eAAe;QACf,IAAA,CAAA,2BAA2B,GAA3B,2BAA2B;QAC3B,IAAA,CAAA,cAAc,GAAd,cAAc;IACrB;AAEH,IAAA,GAAG,CAAC,eAAsC,EAAA;AACxC,QAAA,OAAO,EAAE,CAAC;AACR,YAAA,QAAQ,EAAE,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE;AACvC,YAAA,oBAAoB,EAAE,IAAI,CAAC,2BAA2B,CAAC,MAAM,EAAE;YAC/D,QAAQ,EAAE,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC;AAC5C,SAAA,CAAC;IACJ;AAEA,IAAA,QAAQ,CAAC,eAAuC,EAAA;AAC9C,QAAA,OAAO,EAAE,CAAC;AACR,YAAA,QAAQ,EAAE,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE;AACvC,YAAA,oBAAoB,EAAE,IAAI,CAAC,2BAA2B,CAAC,MAAM,EAAE;YAC/D,QAAQ,EAAE,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC;AAC5C,SAAA,CAAC;IACJ;iIAtBW,0BAA0B,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,mBAAA,EAAA,EAAA,EAAA,KAAA,EAAA,EAAA,CAAA,+BAAA,EAAA,EAAA,EAAA,KAAA,EAAA,EAAA,CAAA,kBAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA1B,uBAAA,SAAA,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libs/category/driver/testing/src/drivers/category.service.ts","../../../libs/category/driver/testing/src/drivers/category-driver.module.ts","../../../libs/category/driver/testing/src/daffodil-category-driver-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n Observable,\n of,\n} from 'rxjs';\n\nimport {\n DaffGetCategoryResponse,\n DaffCategoryIdRequest,\n DaffCategoryUrlRequest,\n} from '@daffodil/category';\nimport { DaffCategoryServiceInterface } from '@daffodil/category/driver';\nimport {\n DaffCategoryFactory,\n DaffCategoryPageMetadataFactory,\n} from '@daffodil/category/testing';\nimport { DaffProductFactory } from '@daffodil/product/testing';\n\n/**\n * The category testing driver to mock {@link DaffCategoryServiceInterface}.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffTestingCategoryService implements DaffCategoryServiceInterface {\n\n constructor(\n private categoryFactory: DaffCategoryFactory,\n private categoryPageMetadataFactory: DaffCategoryPageMetadataFactory,\n private productFactory: DaffProductFactory,\n ) {}\n\n get(categoryRequest: DaffCategoryIdRequest): Observable<DaffGetCategoryResponse> {\n return of({\n category: this.categoryFactory.create(),\n categoryPageMetadata: this.categoryPageMetadataFactory.create(),\n products: this.productFactory.createMany(3),\n });\n }\n\n getByUrl(categoryRequest: DaffCategoryUrlRequest): Observable<DaffGetCategoryResponse> {\n return of({\n category: this.categoryFactory.create(),\n categoryPageMetadata: this.categoryPageMetadataFactory.create(),\n products: this.productFactory.createMany(3),\n });\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { provideDaffCategoryDriver } from '@daffodil/category/driver';\n\nimport { DaffTestingCategoryService } from './category.service';\n\n/**\n * A module for providing the {@link DaffTestingCategoryService} for the {@link DaffCategoryDriver} token.\n */\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffCategoryTestingDriverModule {\n static forRoot(): ModuleWithProviders<DaffCategoryTestingDriverModule> {\n return {\n ngModule: DaffCategoryTestingDriverModule,\n providers: [\n provideDaffCategoryDriver(DaffTestingCategoryService),\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAkBA;;;;AAIG;MAIU,0BAA0B,CAAA;AAErC,IAAA,WAAA,CACU,eAAoC,EACpC,2BAA4D,EAC5D,cAAkC,EAAA;QAFlC,IAAA,CAAA,eAAe,GAAf,eAAe;QACf,IAAA,CAAA,2BAA2B,GAA3B,2BAA2B;QAC3B,IAAA,CAAA,cAAc,GAAd,cAAc;IACrB;AAEH,IAAA,GAAG,CAAC,eAAsC,EAAA;AACxC,QAAA,OAAO,EAAE,CAAC;AACR,YAAA,QAAQ,EAAE,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE;AACvC,YAAA,oBAAoB,EAAE,IAAI,CAAC,2BAA2B,CAAC,MAAM,EAAE;YAC/D,QAAQ,EAAE,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC;AAC5C,SAAA,CAAC;IACJ;AAEA,IAAA,QAAQ,CAAC,eAAuC,EAAA;AAC9C,QAAA,OAAO,EAAE,CAAC;AACR,YAAA,QAAQ,EAAE,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE;AACvC,YAAA,oBAAoB,EAAE,IAAI,CAAC,2BAA2B,CAAC,MAAM,EAAE;YAC/D,QAAQ,EAAE,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC;AAC5C,SAAA,CAAC;IACJ;kIAtBW,0BAA0B,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,mBAAA,EAAA,EAAA,EAAA,KAAA,EAAA,EAAA,CAAA,+BAAA,EAAA,EAAA,EAAA,KAAA,EAAA,EAAA,CAAA,kBAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA1B,uBAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,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? of(true) : this.dispatcher.pipe(ofType(DaffCategoryPageActionTypes.CategoryPageLoadSuccessAction, DaffCategoryPageActionTypes.CategoryPageLoadFailureAction), map(() => true), take(1));
48
48
  }
49
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCategoryPageIdResolver, deps: [{ token: PLATFORM_ID }, { token: DAFF_CATEGORY_ROUTING_OPTIONS_BUILDER }, { token: i1.Store }, { token: i1.ActionsSubject }], target: i0.ɵɵFactoryTarget.Injectable }); }
50
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCategoryPageIdResolver }); }
49
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffCategoryPageIdResolver, deps: [{ token: PLATFORM_ID }, { token: DAFF_CATEGORY_ROUTING_OPTIONS_BUILDER }, { token: i1.Store }, { token: i1.ActionsSubject }], target: i0.ɵɵFactoryTarget.Injectable }); }
50
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffCategoryPageIdResolver }); }
51
51
  }
52
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCategoryPageIdResolver, decorators: [{
52
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffCategoryPageIdResolver, decorators: [{
53
53
  type: Injectable
54
54
  }], ctorParameters: () => [{ type: undefined, decorators: [{
55
55
  type: Inject,
@@ -75,10 +75,10 @@ class DaffCategoryRoutingUrlRequestBuilder {
75
75
  kind: DaffCategoryRequestKind.URL,
76
76
  };
77
77
  }
78
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCategoryRoutingUrlRequestBuilder, deps: [{ token: DAFF_CATEGORY_ROUTING_OPTIONS_BUILDER }, { token: i1$1.DaffRoutingUriNormalizer }], target: i0.ɵɵFactoryTarget.Injectable }); }
79
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCategoryRoutingUrlRequestBuilder, providedIn: 'any' }); }
78
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffCategoryRoutingUrlRequestBuilder, deps: [{ token: DAFF_CATEGORY_ROUTING_OPTIONS_BUILDER }, { token: i1$1.DaffRoutingUriNormalizer }], target: i0.ɵɵFactoryTarget.Injectable }); }
79
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffCategoryRoutingUrlRequestBuilder, providedIn: 'any' }); }
80
80
  }
81
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCategoryRoutingUrlRequestBuilder, decorators: [{
81
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffCategoryRoutingUrlRequestBuilder, decorators: [{
82
82
  type: Injectable,
83
83
  args: [{
84
84
  providedIn: 'any',
@@ -105,10 +105,10 @@ class DaffCategoryPageUrlResolver {
105
105
  this.store.dispatch(new DaffCategoryPageLoadByUrl(this.requestBuilder.build(route, state)));
106
106
  return isPlatformBrowser(this.platformId) ? of(true) : this.dispatcher.pipe(ofType(DaffCategoryPageActionTypes.CategoryPageLoadSuccessAction, DaffCategoryPageActionTypes.CategoryPageLoadFailureAction), map(() => true), take(1));
107
107
  }
108
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCategoryPageUrlResolver, deps: [{ token: PLATFORM_ID }, { token: i1.Store }, { token: i1.ActionsSubject }, { token: DaffCategoryRoutingUrlRequestBuilder }], target: i0.ɵɵFactoryTarget.Injectable }); }
109
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCategoryPageUrlResolver }); }
108
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffCategoryPageUrlResolver, deps: [{ token: PLATFORM_ID }, { token: i1.Store }, { token: i1.ActionsSubject }, { token: DaffCategoryRoutingUrlRequestBuilder }], target: i0.ɵɵFactoryTarget.Injectable }); }
109
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffCategoryPageUrlResolver }); }
110
110
  }
111
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCategoryPageUrlResolver, decorators: [{
111
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffCategoryPageUrlResolver, decorators: [{
112
112
  type: Injectable
113
113
  }], ctorParameters: () => [{ type: undefined, decorators: [{
114
114
  type: Inject,
@@ -144,17 +144,17 @@ class DaffCategoryRoutingCollectionEffects extends DaffProductRoutingCollectionE
144
144
  constructor(actions$, router, collectionFacade, getQueryParams, route) {
145
145
  super(actions$, router, Object.values(DaffCategoryPageProductCollectionActionTypes), collectionFacade, getQueryParams, route);
146
146
  }
147
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCategoryRoutingCollectionEffects, deps: [{ token: i1$2.Actions }, { token: i2.Router }, { token: i3.DaffCategoryProductCollectionFacade }, { token: i4.DaffProductGetQueryParamsFromRequest }, { token: i2.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Injectable }); }
148
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCategoryRoutingCollectionEffects }); }
147
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffCategoryRoutingCollectionEffects, deps: [{ token: i1$2.Actions }, { token: i2.Router }, { token: i3.DaffCategoryProductCollectionFacade }, { token: i4.DaffProductGetQueryParamsFromRequest }, { token: i2.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Injectable }); }
148
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffCategoryRoutingCollectionEffects }); }
149
149
  }
150
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCategoryRoutingCollectionEffects, decorators: [{
150
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffCategoryRoutingCollectionEffects, decorators: [{
151
151
  type: Injectable
152
152
  }], ctorParameters: () => [{ type: i1$2.Actions }, { type: i2.Router }, { type: i3.DaffCategoryProductCollectionFacade }, { type: i4.DaffProductGetQueryParamsFromRequest }, { type: i2.ActivatedRoute }] });
153
153
 
154
154
  class DaffCategoryRoutingModule {
155
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCategoryRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
156
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.1", ngImport: i0, type: DaffCategoryRoutingModule, imports: [DaffProductRoutingModule, i1$2.EffectsFeatureModule] }); }
157
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCategoryRoutingModule, providers: [
155
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffCategoryRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
156
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.18", ngImport: i0, type: DaffCategoryRoutingModule, imports: [DaffProductRoutingModule, i1$2.EffectsFeatureModule] }); }
157
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffCategoryRoutingModule, providers: [
158
158
  DaffCategoryPageIdResolver,
159
159
  DaffCategoryPageUrlResolver,
160
160
  DaffCategoryRoutingUrlRequestBuilder,
@@ -179,7 +179,7 @@ class DaffCategoryRoutingModule {
179
179
  DaffCategoryRoutingCollectionEffects,
180
180
  ])] }); }
181
181
  }
182
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCategoryRoutingModule, decorators: [{
182
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffCategoryRoutingModule, decorators: [{
183
183
  type: NgModule,
184
184
  args: [{
185
185
  imports: [
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-category-routing.mjs","sources":["../../../libs/category/routing/src/injection-tokens/request/builder.token.ts","../../../libs/category/routing/src/resolvers/category-page-id/category-page-id.resolver.ts","../../../libs/category/routing/src/services/url-request-builder.service.ts","../../../libs/category/routing/src/resolvers/category-page-url/category-page-url.resolver.ts","../../../libs/category/routing/src/injection-tokens/request/builders.token.ts","../../../libs/category/routing/src/effects/collection-route.effects.ts","../../../libs/category/routing/src/module.ts","../../../libs/category/routing/src/daffodil-category-routing.ts"],"sourcesContent":["import { createSingleInjectionToken } from '@daffodil/core';\n\nimport { DaffCategoryRoutingRequestBuilder } from './builders.token';\n\n\nexport const {\n /**\n * An internal token to combine the {@link DAFF_CATEGORY_ROUTING_OPTIONS_BUILDERS} into a single builder.\n */\n token: DAFF_CATEGORY_ROUTING_OPTIONS_BUILDER,\n /**\n * Provider function for {@link DAFF_CATEGORY_ROUTING_OPTIONS_BUILDER}.\n */\n provider: provideDaffCategoryRoutingOptionsBuilder,\n} = createSingleInjectionToken<DaffCategoryRoutingRequestBuilder>(\n 'DAFF_CATEGORY_ROUTING_OPTIONS_BUILDER',\n {\n factory: () => () => ({}),\n },\n);\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n Inject,\n Injectable,\n PLATFORM_ID,\n} from '@angular/core';\nimport { ActivatedRouteSnapshot } from '@angular/router';\nimport { ofType } from '@ngrx/effects';\nimport {\n ActionsSubject,\n Store,\n} from '@ngrx/store';\nimport {\n Observable,\n of,\n} from 'rxjs';\nimport {\n map,\n take,\n} from 'rxjs/operators';\n\nimport { DaffCategoryRequestKind } from '@daffodil/category';\nimport {\n DaffCategoryReducersState,\n DaffCategoryPageLoad,\n DaffCategoryPageActionTypes,\n} from '@daffodil/category/state';\n\nimport { DaffCategoryRoutingRequestBuilder } from '../../injection-tokens/public_api';\nimport { DAFF_CATEGORY_ROUTING_OPTIONS_BUILDER } from '../../injection-tokens/request/builder.token';\n\n/**\n * Resolves category data for category pages, and will only resolve the url after a category request succeeds or fails. This resolver expects a url\n * of the form `some/url/{id}` where `{id}` is the category id.\n */\n@Injectable()\nexport class DaffCategoryPageIdResolver {\n constructor(\n @Inject(PLATFORM_ID) private platformId: string,\n @Inject(DAFF_CATEGORY_ROUTING_OPTIONS_BUILDER) private requestBuilder: DaffCategoryRoutingRequestBuilder,\n private store: Store<DaffCategoryReducersState>,\n private dispatcher: ActionsSubject,\n ) { }\n\n resolve(route: ActivatedRouteSnapshot): Observable<boolean> {\n this.store.dispatch(new DaffCategoryPageLoad({\n ...this.requestBuilder(route),\n id: route.paramMap.get('id'),\n kind: DaffCategoryRequestKind.ID,\n }));\n\n return isPlatformBrowser(this.platformId) ? of(true) : this.dispatcher.pipe(\n ofType(DaffCategoryPageActionTypes.CategoryPageLoadSuccessAction, DaffCategoryPageActionTypes.CategoryPageLoadFailureAction),\n map(() => true),\n take(1),\n );\n }\n}\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\nimport {\n ActivatedRouteSnapshot,\n RouterStateSnapshot,\n} from '@angular/router';\n\nimport {\n DaffCategoryRequestKind,\n DaffCategoryUrlRequest,\n} from '@daffodil/category';\nimport { DaffRoutingUriNormalizer } from '@daffodil/core/routing';\n\nimport { DaffCategoryRoutingRequestBuilder } from '../injection-tokens/public_api';\nimport { DAFF_CATEGORY_ROUTING_OPTIONS_BUILDER } from '../injection-tokens/request/builder.token';\n\n@Injectable({\n providedIn: 'any',\n})\nexport class DaffCategoryRoutingUrlRequestBuilder {\n constructor(\n @Inject(DAFF_CATEGORY_ROUTING_OPTIONS_BUILDER) private requestBuilder: DaffCategoryRoutingRequestBuilder,\n private urlNormalizer: DaffRoutingUriNormalizer,\n ) { }\n\n /**\n * Builds a category URL request from the provided route and router state that\n * is suitable for passing to {@link DaffCategoryPageLoadByUrl}.\n */\n build(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): DaffCategoryUrlRequest {\n return {\n ...this.requestBuilder(route),\n url: this.urlNormalizer.normalize(state.url),\n kind: DaffCategoryRequestKind.URL,\n };\n }\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n Inject,\n Injectable,\n PLATFORM_ID,\n} from '@angular/core';\nimport {\n ActivatedRouteSnapshot,\n RouterStateSnapshot,\n} from '@angular/router';\nimport { ofType } from '@ngrx/effects';\nimport {\n ActionsSubject,\n Store,\n} from '@ngrx/store';\nimport {\n Observable,\n of,\n} from 'rxjs';\nimport {\n map,\n take,\n} from 'rxjs/operators';\n\nimport {\n DaffCategoryReducersState,\n DaffCategoryPageActionTypes,\n DaffCategoryPageLoadByUrl,\n} from '@daffodil/category/state';\n\nimport { DaffCategoryRoutingUrlRequestBuilder } from '../../services/public_api';\n\n/**\n * Resolves category data for category pages, and will only resolve the url\n * after a category request succeeds or fails. This resolver will take a full\n * a url of the form `some/url.html(secondary:outlet)?query=param#fragment` and attempt to resolve a product from it.\n * Assumes that the URL to be resolved is the primary outlet.\n */\n@Injectable()\nexport class DaffCategoryPageUrlResolver {\n constructor(\n @Inject(PLATFORM_ID) private platformId: string,\n private store: Store<DaffCategoryReducersState>,\n private dispatcher: ActionsSubject,\n private requestBuilder: DaffCategoryRoutingUrlRequestBuilder,\n ) { }\n\n resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> {\n this.store.dispatch(new DaffCategoryPageLoadByUrl(this.requestBuilder.build(route, state)));\n\n return isPlatformBrowser(this.platformId) ? of(true) : this.dispatcher.pipe(\n ofType(DaffCategoryPageActionTypes.CategoryPageLoadSuccessAction, DaffCategoryPageActionTypes.CategoryPageLoadFailureAction),\n map(() => true),\n take(1),\n );\n }\n}\n","import { ActivatedRouteSnapshot } from '@angular/router';\n\nimport {\n DaffCollectionRequest,\n createMultiInjectionToken,\n} from '@daffodil/core';\n\nexport type DaffCategoryRoutingRequestBuilder<T extends DaffCollectionRequest = DaffCollectionRequest> = (route: ActivatedRouteSnapshot) => T;\n\nexport const {\n /**\n * A multi-provider injection token for category request builders.\n * These builders are called with the requested route during the resolve step\n * and return options to pass to the category driver.\n */\n token: DAFF_CATEGORY_ROUTING_OPTIONS_BUILDERS,\n\n /**\n * Provides category request builders for the routing layer.\n *\n * See {@link DAFF_CATEGORY_ROUTING_OPTIONS_BUILDERS}.\n *\n * @example\n * ```ts\n * providers: [\n * ...provideDaffCategoryRoutingRequestBuilders(\n * route => ({\n * currentPage: route.queryParams.page\n * })\n * )\n * ]\n * ```\n */\n provider: provideDaffCategoryRoutingRequestBuilders,\n} = createMultiInjectionToken<DaffCategoryRoutingRequestBuilder>('DAFF_CATEGORY_ROUTING_OPTIONS_BUILDERS');\n","import { Injectable } from '@angular/core';\nimport {\n ActivatedRoute,\n Router,\n} from '@angular/router';\nimport { Actions } from '@ngrx/effects';\n\nimport {\n DaffCategoryPageProductCollectionActionTypes,\n DaffCategoryProductCollectionFacade,\n} from '@daffodil/category/state';\nimport {\n DaffProductGetQueryParamsFromRequest,\n DaffProductRoutingCollectionEffects,\n} from '@daffodil/product/routing';\n\n@Injectable()\nexport class DaffCategoryRoutingCollectionEffects extends DaffProductRoutingCollectionEffects {\n constructor(\n actions$: Actions,\n router: Router,\n collectionFacade: DaffCategoryProductCollectionFacade,\n getQueryParams: DaffProductGetQueryParamsFromRequest,\n route: ActivatedRoute,\n ) {\n super(\n actions$,\n router,\n Object.values(DaffCategoryPageProductCollectionActionTypes),\n collectionFacade,\n getQueryParams,\n route,\n );\n }\n}\n","import {\n inject,\n NgModule,\n} from '@angular/core';\nimport { ActivatedRouteSnapshot } from '@angular/router';\nimport { EffectsModule } from '@ngrx/effects';\n\nimport {\n DaffProductGetCollectionRequestFromRoute,\n DaffProductRoutingModule,\n} from '@daffodil/product/routing';\n\nimport { DaffCategoryRoutingCollectionEffects } from './effects/collection-route.effects';\nimport {\n DAFF_CATEGORY_ROUTING_OPTIONS_BUILDERS,\n DaffCategoryRoutingRequestBuilder,\n} from './injection-tokens/public_api';\nimport { DAFF_CATEGORY_ROUTING_OPTIONS_BUILDER } from './injection-tokens/request/builder.token';\nimport {\n DaffCategoryPageIdResolver,\n DaffCategoryPageUrlResolver,\n} from './resolvers/public_api';\nimport { DaffCategoryRoutingUrlRequestBuilder } from './services/public_api';\n\n@NgModule({\n imports: [\n DaffProductRoutingModule,\n EffectsModule.forFeature([\n DaffCategoryRoutingCollectionEffects,\n ]),\n ],\n providers: [\n DaffCategoryPageIdResolver,\n DaffCategoryPageUrlResolver,\n DaffCategoryRoutingUrlRequestBuilder,\n {\n provide: DAFF_CATEGORY_ROUTING_OPTIONS_BUILDERS,\n useFactory: () => {\n const service = inject(DaffProductGetCollectionRequestFromRoute);\n const builder: DaffCategoryRoutingRequestBuilder = route => service.getRequest(route.queryParamMap);\n return builder;\n },\n multi: true,\n },\n {\n provide: DAFF_CATEGORY_ROUTING_OPTIONS_BUILDER,\n useFactory: () => {\n const builders = inject(DAFF_CATEGORY_ROUTING_OPTIONS_BUILDERS);\n return (route: ActivatedRouteSnapshot) =>\n Object.assign({}, ...builders.map(builder => builder(route)));\n },\n },\n ],\n})\nexport class DaffCategoryRoutingModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2.DaffCategoryRoutingUrlRequestBuilder"],"mappings":";;;;;;;;;;;;;;;;;AAKO,MAAM;AACX;;AAEG;AACH,KAAK,EAAE,qCAAqC;AAC5C;;AAEG;AACH,QAAQ,EAAE,wCAAwC,GACnD,GAAG,0BAA0B,CAC5B,uCAAuC,EACvC;IACE,OAAO,EAAE,MAAM,OAAO,EAAE,CAAC;AAC1B,CAAA,CACF;;ACYD;;;AAGG;MAEU,0BAA0B,CAAA;AACrC,IAAA,WAAA,CAC+B,UAAkB,EACQ,cAAiD,EAChG,KAAuC,EACvC,UAA0B,EAAA;QAHL,IAAA,CAAA,UAAU,GAAV,UAAU;QACgB,IAAA,CAAA,cAAc,GAAd,cAAc;QAC7D,IAAA,CAAA,KAAK,GAAL,KAAK;QACL,IAAA,CAAA,UAAU,GAAV,UAAU;IAChB;AAEJ,IAAA,OAAO,CAAC,KAA6B,EAAA;AACnC,QAAA,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,oBAAoB,CAAC;AAC3C,YAAA,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC;YAC7B,EAAE,EAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC;YAC5B,IAAI,EAAE,uBAAuB,CAAC,EAAE;AACjC,SAAA,CAAC,CAAC;QAEH,OAAO,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,I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O,CAAC,KAAK,CAAC,EAAC,CAAC;AACjE,gBAAA,CAAC,CAAA;AACF,aAAA;AACF,SAAA,EAAA,OAAA,EAAA,CA1BC,wBAAwB;YACxB,aAAa,CAAC,UAAU,CAAC;gBACvB,oCAAoC;aACrC,CAAC,CAAA,EAAA,CAAA,CAAA;;2FAyBO,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBA9BrC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,wBAAwB;wBACxB,aAAa,CAAC,UAAU,CAAC;4BACvB,oCAAoC;yBACrC,CAAC;AACH,qBAAA;AACD,oBAAA,SAAS,EAAE;wBACT,0BAA0B;wBAC1B,2BAA2B;wBAC3B,oCAAoC;AACpC,wBAAA;AACE,4BAAA,OAAO,EAAE,sCAAsC;4BAC/C,UAAU,GAAE,MAAK;AACf,gCAAA,MAAM,OAAO,GAAG,MAAM,CAAC,wCAAwC,CAAC;AAChE,gCAAA,MAAM,OAAO,IAAsC,KAAK,IAAI,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,aAAa,CAAC,CAAA;AACnG,gCAAA,OAAO,OAAO;AAChB,4BAAA,CAAC,CAAA;AACD,4BAAA,KAAK,EAAE,IAAI;AACZ,yBAAA;AACD,wBAAA;AACE,4BAAA,OAAO,EAAE,qCAAqC;4BAC9C,UAAU,GAAE,MAAK;AACf,gCAAA,MAAM,QAAQ,GAAG,MAAM,CAAC,sCAAsC,CAAC;gCAC/D,QAAO,CAAC,KAA6B,KACnC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG,QAAQ,CAAC,GAAG,EAAC,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC,EAAC,CAAC;AACjE,4BAAA,CAAC,CAAA;AACF,yBAAA;AACF,qBAAA;AACF,iBAAA;;;ACrDD;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-category-routing.mjs","sources":["../../../libs/category/routing/src/injection-tokens/request/builder.token.ts","../../../libs/category/routing/src/resolvers/category-page-id/category-page-id.resolver.ts","../../../libs/category/routing/src/services/url-request-builder.service.ts","../../../libs/category/routing/src/resolvers/category-page-url/category-page-url.resolver.ts","../../../libs/category/routing/src/injection-tokens/request/builders.token.ts","../../../libs/category/routing/src/effects/collection-route.effects.ts","../../../libs/category/routing/src/module.ts","../../../libs/category/routing/src/daffodil-category-routing.ts"],"sourcesContent":["import { createSingleInjectionToken } from '@daffodil/core';\n\nimport { DaffCategoryRoutingRequestBuilder } from './builders.token';\n\n\nexport const {\n /**\n * An internal token to combine the {@link DAFF_CATEGORY_ROUTING_OPTIONS_BUILDERS} into a single builder.\n */\n token: DAFF_CATEGORY_ROUTING_OPTIONS_BUILDER,\n /**\n * Provider function for {@link DAFF_CATEGORY_ROUTING_OPTIONS_BUILDER}.\n */\n provider: provideDaffCategoryRoutingOptionsBuilder,\n} = createSingleInjectionToken<DaffCategoryRoutingRequestBuilder>(\n 'DAFF_CATEGORY_ROUTING_OPTIONS_BUILDER',\n {\n factory: () => () => ({}),\n },\n);\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n Inject,\n Injectable,\n PLATFORM_ID,\n} from '@angular/core';\nimport { ActivatedRouteSnapshot } from '@angular/router';\nimport { ofType } from '@ngrx/effects';\nimport {\n ActionsSubject,\n Store,\n} from '@ngrx/store';\nimport {\n Observable,\n of,\n} from 'rxjs';\nimport {\n map,\n take,\n} from 'rxjs/operators';\n\nimport { DaffCategoryRequestKind } from '@daffodil/category';\nimport {\n DaffCategoryReducersState,\n DaffCategoryPageLoad,\n DaffCategoryPageActionTypes,\n} from '@daffodil/category/state';\n\nimport { DaffCategoryRoutingRequestBuilder } from '../../injection-tokens/public_api';\nimport { DAFF_CATEGORY_ROUTING_OPTIONS_BUILDER } from '../../injection-tokens/request/builder.token';\n\n/**\n * Resolves category data for category pages, and will only resolve the url after a category request succeeds or fails. This resolver expects a url\n * of the form `some/url/{id}` where `{id}` is the category id.\n */\n@Injectable()\nexport class DaffCategoryPageIdResolver {\n constructor(\n @Inject(PLATFORM_ID) private platformId: string,\n @Inject(DAFF_CATEGORY_ROUTING_OPTIONS_BUILDER) private requestBuilder: DaffCategoryRoutingRequestBuilder,\n private store: Store<DaffCategoryReducersState>,\n private dispatcher: ActionsSubject,\n ) { }\n\n resolve(route: ActivatedRouteSnapshot): Observable<boolean> {\n this.store.dispatch(new DaffCategoryPageLoad({\n ...this.requestBuilder(route),\n id: route.paramMap.get('id'),\n kind: DaffCategoryRequestKind.ID,\n }));\n\n return isPlatformBrowser(this.platformId) ? of(true) : this.dispatcher.pipe(\n ofType(DaffCategoryPageActionTypes.CategoryPageLoadSuccessAction, DaffCategoryPageActionTypes.CategoryPageLoadFailureAction),\n map(() => true),\n take(1),\n );\n }\n}\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\nimport {\n ActivatedRouteSnapshot,\n RouterStateSnapshot,\n} from '@angular/router';\n\nimport {\n DaffCategoryRequestKind,\n DaffCategoryUrlRequest,\n} from '@daffodil/category';\nimport { DaffRoutingUriNormalizer } from '@daffodil/core/routing';\n\nimport { DaffCategoryRoutingRequestBuilder } from '../injection-tokens/public_api';\nimport { DAFF_CATEGORY_ROUTING_OPTIONS_BUILDER } from '../injection-tokens/request/builder.token';\n\n@Injectable({\n providedIn: 'any',\n})\nexport class DaffCategoryRoutingUrlRequestBuilder {\n constructor(\n @Inject(DAFF_CATEGORY_ROUTING_OPTIONS_BUILDER) private requestBuilder: DaffCategoryRoutingRequestBuilder,\n private urlNormalizer: DaffRoutingUriNormalizer,\n ) { }\n\n /**\n * Builds a category URL request from the provided route and router state that\n * is suitable for passing to {@link DaffCategoryPageLoadByUrl}.\n */\n build(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): DaffCategoryUrlRequest {\n return {\n ...this.requestBuilder(route),\n url: this.urlNormalizer.normalize(state.url),\n kind: DaffCategoryRequestKind.URL,\n };\n }\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n Inject,\n Injectable,\n PLATFORM_ID,\n} from '@angular/core';\nimport {\n ActivatedRouteSnapshot,\n RouterStateSnapshot,\n} from '@angular/router';\nimport { ofType } from '@ngrx/effects';\nimport {\n ActionsSubject,\n Store,\n} from '@ngrx/store';\nimport {\n Observable,\n of,\n} from 'rxjs';\nimport {\n map,\n take,\n} from 'rxjs/operators';\n\nimport {\n DaffCategoryReducersState,\n DaffCategoryPageActionTypes,\n DaffCategoryPageLoadByUrl,\n} from '@daffodil/category/state';\n\nimport { DaffCategoryRoutingUrlRequestBuilder } from '../../services/public_api';\n\n/**\n * Resolves category data for category pages, and will only resolve the url\n * after a category request succeeds or fails. This resolver will take a full\n * a url of the form `some/url.html(secondary:outlet)?query=param#fragment` and attempt to resolve a product from it.\n * Assumes that the URL to be resolved is the primary outlet.\n */\n@Injectable()\nexport class DaffCategoryPageUrlResolver {\n constructor(\n @Inject(PLATFORM_ID) private platformId: string,\n private store: Store<DaffCategoryReducersState>,\n private dispatcher: ActionsSubject,\n private requestBuilder: DaffCategoryRoutingUrlRequestBuilder,\n ) { }\n\n resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> {\n this.store.dispatch(new DaffCategoryPageLoadByUrl(this.requestBuilder.build(route, state)));\n\n return isPlatformBrowser(this.platformId) ? of(true) : this.dispatcher.pipe(\n ofType(DaffCategoryPageActionTypes.CategoryPageLoadSuccessAction, DaffCategoryPageActionTypes.CategoryPageLoadFailureAction),\n map(() => true),\n take(1),\n );\n }\n}\n","import { ActivatedRouteSnapshot } from '@angular/router';\n\nimport {\n DaffCollectionRequest,\n createMultiInjectionToken,\n} from '@daffodil/core';\n\nexport type DaffCategoryRoutingRequestBuilder<T extends DaffCollectionRequest = DaffCollectionRequest> = (route: ActivatedRouteSnapshot) => T;\n\nexport const {\n /**\n * A multi-provider injection token for category request builders.\n * These builders are called with the requested route during the resolve step\n * and return options to pass to the category driver.\n */\n token: DAFF_CATEGORY_ROUTING_OPTIONS_BUILDERS,\n\n /**\n * Provides category request builders for the routing layer.\n *\n * See {@link DAFF_CATEGORY_ROUTING_OPTIONS_BUILDERS}.\n *\n * @example\n * ```ts\n * providers: [\n * ...provideDaffCategoryRoutingRequestBuilders(\n * route => ({\n * currentPage: route.queryParams.page\n * })\n * )\n * ]\n * ```\n */\n provider: provideDaffCategoryRoutingRequestBuilders,\n} = createMultiInjectionToken<DaffCategoryRoutingRequestBuilder>('DAFF_CATEGORY_ROUTING_OPTIONS_BUILDERS');\n","import { Injectable } from '@angular/core';\nimport {\n ActivatedRoute,\n Router,\n} from '@angular/router';\nimport { Actions } from '@ngrx/effects';\n\nimport {\n DaffCategoryPageProductCollectionActionTypes,\n DaffCategoryProductCollectionFacade,\n} from '@daffodil/category/state';\nimport {\n DaffProductGetQueryParamsFromRequest,\n DaffProductRoutingCollectionEffects,\n} from '@daffodil/product/routing';\n\n@Injectable()\nexport class DaffCategoryRoutingCollectionEffects extends DaffProductRoutingCollectionEffects {\n constructor(\n actions$: Actions,\n router: Router,\n collectionFacade: DaffCategoryProductCollectionFacade,\n getQueryParams: DaffProductGetQueryParamsFromRequest,\n route: ActivatedRoute,\n ) {\n super(\n actions$,\n router,\n Object.values(DaffCategoryPageProductCollectionActionTypes),\n collectionFacade,\n getQueryParams,\n route,\n );\n }\n}\n","import {\n inject,\n NgModule,\n} from '@angular/core';\nimport { ActivatedRouteSnapshot } from '@angular/router';\nimport { EffectsModule } from '@ngrx/effects';\n\nimport {\n DaffProductGetCollectionRequestFromRoute,\n DaffProductRoutingModule,\n} from '@daffodil/product/routing';\n\nimport { DaffCategoryRoutingCollectionEffects } from './effects/collection-route.effects';\nimport {\n DAFF_CATEGORY_ROUTING_OPTIONS_BUILDERS,\n DaffCategoryRoutingRequestBuilder,\n} from './injection-tokens/public_api';\nimport { DAFF_CATEGORY_ROUTING_OPTIONS_BUILDER } from './injection-tokens/request/builder.token';\nimport {\n DaffCategoryPageIdResolver,\n DaffCategoryPageUrlResolver,\n} from './resolvers/public_api';\nimport { DaffCategoryRoutingUrlRequestBuilder } from './services/public_api';\n\n@NgModule({\n imports: [\n DaffProductRoutingModule,\n EffectsModule.forFeature([\n DaffCategoryRoutingCollectionEffects,\n ]),\n ],\n providers: [\n DaffCategoryPageIdResolver,\n DaffCategoryPageUrlResolver,\n DaffCategoryRoutingUrlRequestBuilder,\n {\n provide: DAFF_CATEGORY_ROUTING_OPTIONS_BUILDERS,\n useFactory: () => {\n const service = inject(DaffProductGetCollectionRequestFromRoute);\n const builder: DaffCategoryRoutingRequestBuilder = route => service.getRequest(route.queryParamMap);\n return builder;\n },\n multi: true,\n },\n {\n provide: DAFF_CATEGORY_ROUTING_OPTIONS_BUILDER,\n useFactory: () => {\n const builders = inject(DAFF_CATEGORY_ROUTING_OPTIONS_BUILDERS);\n return (route: ActivatedRouteSnapshot) =>\n Object.assign({}, ...builders.map(builder => builder(route)));\n },\n },\n ],\n})\nexport class DaffCategoryRoutingModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2.DaffCategoryRoutingUrlRequestBuilder"],"mappings":";;;;;;;;;;;;;;;;;AAKO,MAAM;AACX;;AAEG;AACH,KAAK,EAAE,qCAAqC;AAC5C;;AAEG;AACH,QAAQ,EAAE,wCAAwC,GACnD,GAAG,0BAA0B,CAC5B,uCAAuC,EACvC;IACE,OAAO,EAAE,MAAM,OAAO,EAAE,CAAC;AAC1B,CAAA,CACF;;ACYD;;;AAGG;MAEU,0BAA0B,CAAA;AACrC,IAAA,WAAA,CAC+B,UAAkB,EACQ,cAAiD,EAChG,KAAuC,EACvC,UAA0B,EAAA;QAHL,IAAA,CAAA,UAAU,GAAV,UAAU;QACgB,IAAA,CAAA,cAAc,GAAd,cAAc;QAC7D,IAAA,CAAA,KAAK,GAAL,KAAK;QACL,IAAA,CAAA,UAAU,GAAV,UAAU;IAChB;AAEJ,IAAA,OAAO,CAAC,KAA6B,EAAA;AACnC,QAAA,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,oBAAoB,CAA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C,EAAE,EAAE,GAAG,QAAQ,CAAC,GAAG,EAAC,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC,EAAC,CAAC;AACjE,4BAAA,CAAC,CAAA;AACF,yBAAA;AACF,qBAAA;AACF,iBAAA;;;ACrDD;;AAEG;;;;"}
@@ -35,10 +35,10 @@ class MockDaffCategoryFacade {
35
35
  ;
36
36
  dispatch(action) { }
37
37
  ;
38
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: MockDaffCategoryFacade, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
39
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: MockDaffCategoryFacade, providedIn: 'root' }); }
38
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MockDaffCategoryFacade, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
39
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MockDaffCategoryFacade, providedIn: 'root' }); }
40
40
  }
41
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: MockDaffCategoryFacade, decorators: [{
41
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MockDaffCategoryFacade, decorators: [{
42
42
  type: Injectable,
43
43
  args: [{ providedIn: 'root' }]
44
44
  }] });
@@ -47,14 +47,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
47
47
  * A module that mocks out the {@link DaffCategoryFacade} with {@link MockDaffCategoryFacade} for testing environments.
48
48
  */
49
49
  class DaffCategoryStateTestingModule {
50
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCategoryStateTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
51
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.1", ngImport: i0, type: DaffCategoryStateTestingModule }); }
52
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCategoryStateTestingModule, providers: [
50
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffCategoryStateTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
51
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.18", ngImport: i0, type: DaffCategoryStateTestingModule }); }
52
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffCategoryStateTestingModule, providers: [
53
53
  { provide: DaffCategoryFacade, useExisting: MockDaffCategoryFacade },
54
54
  { provide: DaffCategoryProductCollectionFacade, useExisting: MockDaffCollectionFacade },
55
55
  ] }); }
56
56
  }
57
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCategoryStateTestingModule, decorators: [{
57
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffCategoryStateTestingModule, decorators: [{
58
58
  type: NgModule,
59
59
  args: [{
60
60
  providers: [
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-category-state-testing.mjs","sources":["../../../libs/category/state/testing/src/mock-category-facade.ts","../../../libs/category/state/testing/src/category-testing.module.ts","../../../libs/category/state/testing/src/daffodil-category-state-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { Action } from '@ngrx/store';\nimport { BehaviorSubject } from 'rxjs';\n\nimport { DaffCategory } from '@daffodil/category';\nimport {\n DaffCategoryFacadeInterface ,\n DaffCategoryReducerState,\n} from '@daffodil/category/state';\nimport { DaffStateError } from '@daffodil/core/state';\nimport { DaffProduct } from '@daffodil/product';\n\n/**\n * Can be used to mock out the {@link DaffCategoryFacade} in testing environments.\n *\n * @inheritdoc\n */\n@Injectable({ providedIn: 'root' })\nexport class MockDaffCategoryFacade implements DaffCategoryFacadeInterface {\n category$: BehaviorSubject<DaffCategory> = new BehaviorSubject(null);\n loadingState$: BehaviorSubject<DaffCategoryReducerState['daffState']> = new BehaviorSubject(null);\n loading$: BehaviorSubject<boolean> = new BehaviorSubject(false);\n mutating$: BehaviorSubject<boolean> = new BehaviorSubject(false);\n resolving$: BehaviorSubject<boolean> = new BehaviorSubject(false);\n hasErrors$: BehaviorSubject<boolean> = new BehaviorSubject(false);\n products$: BehaviorSubject<DaffProduct[]> = new BehaviorSubject([]);\n errors$: BehaviorSubject<DaffStateError[]> = new BehaviorSubject([]);\n isCategoryEmpty$: BehaviorSubject<boolean> = new BehaviorSubject(true);\n\n getCategoryById(id: DaffCategory['id']): BehaviorSubject<DaffCategory> {\n return new BehaviorSubject(null);\n };\n\n getProductsByCategory(categoryId: DaffCategory['id']): BehaviorSubject<DaffProduct[]> {\n return new BehaviorSubject([]);\n };\n\n getTotalProductsByCategory(categoryId: DaffCategory['id']): BehaviorSubject<number> {\n return new BehaviorSubject(null);\n };\n\n dispatch(action: Action) {};\n}\n","import { NgModule } from '@angular/core';\n\nimport {\n DaffCategoryFacade,\n DaffCategoryProductCollectionFacade,\n} from '@daffodil/category/state';\nimport { MockDaffCollectionFacade } from '@daffodil/core/state/testing';\n\nimport { MockDaffCategoryFacade } from './mock-category-facade';\n\n/**\n * A module that mocks out the {@link DaffCategoryFacade} with {@link MockDaffCategoryFacade} for testing environments.\n */\n@NgModule({\n providers: [\n { provide: DaffCategoryFacade, useExisting: MockDaffCategoryFacade },\n { provide: DaffCategoryProductCollectionFacade, useExisting: MockDaffCollectionFacade },\n ],\n})\nexport class DaffCategoryStateTestingModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAYA;;;;AAIG;MAEU,sBAAsB,CAAA;AADnC,IAAA,WAAA,GAAA;AAEE,QAAA,IAAA,CAAA,SAAS,GAAkC,IAAI,eAAe,CAAC,IAAI,CAAC;AACpE,QAAA,IAAA,CAAA,aAAa,GAA2D,IAAI,eAAe,CAAC,IAAI,CAAC;AACjG,QAAA,IAAA,CAAA,QAAQ,GAA6B,IAAI,eAAe,CAAC,KAAK,CAAC;AAC/D,QAAA,IAAA,CAAA,SAAS,GAA6B,IAAI,eAAe,CAAC,KAAK,CAAC;AAChE,QAAA,IAAA,CAAA,UAAU,GAA6B,IAAI,eAAe,CAAC,KAAK,CAAC;AACjE,QAAA,IAAA,CAAA,UAAU,GAA6B,IAAI,eAAe,CAAC,KAAK,CAAC;AACjE,QAAA,IAAA,CAAA,SAAS,GAAmC,IAAI,eAAe,CAAC,EAAE,CAAC;AACnE,QAAA,IAAA,CAAA,OAAO,GAAsC,IAAI,eAAe,CAAC,EAAE,CAAC;AACpE,QAAA,IAAA,CAAA,gBAAgB,GAA6B,IAAI,eAAe,CAAC,IAAI,CAAC;AAevE,IAAA;AAbC,IAAA,eAAe,CAAC,EAAsB,EAAA;AACpC,QAAA,OAAO,IAAI,eAAe,CAAC,IAAI,CAAC;IAClC;;AAEA,IAAA,qBAAqB,CAAC,UAA8B,EAAA;AAClD,QAAA,OAAO,IAAI,eAAe,CAAC,EAAE,CAAC;IAChC;;AAEA,IAAA,0BAA0B,CAAC,UAA8B,EAAA;AACvD,QAAA,OAAO,IAAI,eAAe,CAAC,IAAI,CAAC;IAClC;;IAEA,QAAQ,CAAC,MAAc,EAAA,EAAG;;iIAvBf,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eA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ts","../../../libs/category/state/testing/src/category-testing.module.ts","../../../libs/category/state/testing/src/daffodil-category-state-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { Action } from '@ngrx/store';\nimport { BehaviorSubject } from 'rxjs';\n\nimport { DaffCategory } from '@daffodil/category';\nimport {\n DaffCategoryFacadeInterface ,\n DaffCategoryReducerState,\n} from '@daffodil/category/state';\nimport { DaffStateError } from '@daffodil/core/state';\nimport { DaffProduct } from '@daffodil/product';\n\n/**\n * Can be used to mock out the {@link DaffCategoryFacade} in testing environments.\n *\n * @inheritdoc\n */\n@Injectable({ providedIn: 'root' })\nexport class MockDaffCategoryFacade implements DaffCategoryFacadeInterface {\n category$: BehaviorSubject<DaffCategory> = new BehaviorSubject(null);\n loadingState$: BehaviorSubject<DaffCategoryReducerState['daffState']> = new BehaviorSubject(null);\n loading$: BehaviorSubject<boolean> = new BehaviorSubject(false);\n mutating$: BehaviorSubject<boolean> = new BehaviorSubject(false);\n resolving$: BehaviorSubject<boolean> = new BehaviorSubject(false);\n hasErrors$: BehaviorSubject<boolean> = new BehaviorSubject(false);\n products$: BehaviorSubject<DaffProduct[]> = new BehaviorSubject([]);\n errors$: BehaviorSubject<DaffStateError[]> = new BehaviorSubject([]);\n isCategoryEmpty$: BehaviorSubject<boolean> = new BehaviorSubject(true);\n\n getCategoryById(id: DaffCategory['id']): BehaviorSubject<DaffCategory> {\n return new BehaviorSubject(null);\n };\n\n getProductsByCategory(categoryId: DaffCategory['id']): BehaviorSubject<DaffProduct[]> {\n return new BehaviorSubject([]);\n };\n\n getTotalProductsByCategory(categoryId: DaffCategory['id']): BehaviorSubject<number> {\n return new BehaviorSubject(null);\n };\n\n dispatch(action: Action) {};\n}\n","import { NgModule } from '@angular/core';\n\nimport {\n DaffCategoryFacade,\n DaffCategoryProductCollectionFacade,\n} from '@daffodil/category/state';\nimport { MockDaffCollectionFacade } from '@daffodil/core/state/testing';\n\nimport { MockDaffCategoryFacade } from './mock-category-facade';\n\n/**\n * A module that mocks out the {@link DaffCategoryFacade} with {@link MockDaffCategoryFacade} for testing environments.\n */\n@NgModule({\n providers: [\n { provide: DaffCategoryFacade, useExisting: MockDaffCategoryFacade },\n { provide: DaffCategoryProductCollectionFacade, useExisting: MockDaffCollectionFacade },\n ],\n})\nexport class DaffCategoryStateTestingModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAYA;;;;AAIG;MAEU,sBAAsB,CAAA;AADnC,IAAA,WAAA,GAAA;AAEE,QAAA,IAAA,CAAA,SAAS,GAAkC,IAAI,eAAe,CAAC,IAAI,CAAC;AACpE,QAAA,IAAA,CAAA,aAAa,GAA2D,IAAI,eAAe,CAAC,IAAI,CAAC;AACjG,QAAA,IAAA,CAAA,QAAQ,GAA6B,IAAI,eAAe,CAAC,KAAK,CAAC;AAC/D,QAAA,IAAA,CAAA,SAAS,GAA6B,IAAI,eAAe,CAAC,KAAK,CAAC;AAChE,QAAA,IAAA,CAAA,UAAU,GAA6B,IAAI,eAAe,CAAC,KAAK,CAAC;AACjE,QAAA,IAAA,CAAA,UAAU,GAA6B,IAAI,eAAe,CAAC,KAAK,CAAC;AACjE,QAAA,IAAA,CAAA,SAAS,GAAmC,IAAI,eAAe,CAAC,EAAE,CAAC;AACnE,QAAA,IAAA,CAAA,OAAO,GAAsC,IAAI,eAAe,CAAC,EAAE,CAAC;AACpE,QAAA,IAAA,CAAA,gBAAgB,GAA6B,IAAI,eAAe,CAAC,IAAI,CAAC;AAevE,IAAA;AAbC,IAAA,eAAe,CAAC,EAAsB,EAAA;AACpC,QAAA,OAAO,IAAI,eAAe,CAAC,IAAI,CAAC;IAClC;;AAEA,IAAA,qBAAqB,CAAC,UAA8B,EAAA;AAClD,QAAA,OAAO,IAAI,eAAe,CAAC,EAAE,CAAC;IAChC;;AAEA,IAAA,0BAA0B,CAAC,UAA8B,EAAA;AACvD,QAAA,OAAO,IAAI,eAAe,CAAC,IAAI,CAAC;IAClC;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