@daffodil/product 0.88.1 → 0.89.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.
Files changed (230) hide show
  1. package/driver/in-memory/index.d.ts +99 -1
  2. package/driver/index.d.ts +78 -1
  3. package/driver/magento/index.d.ts +378 -1
  4. package/driver/magento/testing/index.d.ts +114 -1
  5. package/driver/shopify/index.d.ts +89 -1
  6. package/driver/testing/index.d.ts +38 -1
  7. package/fesm2022/daffodil-product-driver-in-memory.mjs +10 -10
  8. package/fesm2022/daffodil-product-driver-in-memory.mjs.map +1 -1
  9. package/fesm2022/daffodil-product-driver-magento-testing.mjs +24 -24
  10. package/fesm2022/daffodil-product-driver-magento-testing.mjs.map +1 -1
  11. package/fesm2022/daffodil-product-driver-magento.mjs +19 -19
  12. package/fesm2022/daffodil-product-driver-magento.mjs.map +1 -1
  13. package/fesm2022/daffodil-product-driver-shopify.mjs +27 -15
  14. package/fesm2022/daffodil-product-driver-shopify.mjs.map +1 -1
  15. package/fesm2022/daffodil-product-driver-testing.mjs +7 -7
  16. package/fesm2022/daffodil-product-driver-testing.mjs.map +1 -1
  17. package/fesm2022/daffodil-product-driver.mjs.map +1 -1
  18. package/fesm2022/daffodil-product-routing.mjs +16 -16
  19. package/fesm2022/daffodil-product-routing.mjs.map +1 -1
  20. package/fesm2022/daffodil-product-state-testing.mjs +13 -13
  21. package/fesm2022/daffodil-product-state-testing.mjs.map +1 -1
  22. package/fesm2022/daffodil-product-state.mjs +22 -22
  23. package/fesm2022/daffodil-product-state.mjs.map +1 -1
  24. package/fesm2022/daffodil-product-testing.mjs +19 -19
  25. package/fesm2022/daffodil-product-testing.mjs.map +1 -1
  26. package/fesm2022/daffodil-product.mjs.map +1 -1
  27. package/index.d.ts +141 -1
  28. package/package.json +1 -1
  29. package/routing/index.d.ts +168 -1
  30. package/state/index.d.ts +574 -1
  31. package/state/testing/index.d.ts +56 -1
  32. package/testing/index.d.ts +133 -1
  33. package/driver/errors/codes.enum.d.ts +0 -4
  34. package/driver/errors/invalid-api-response.d.ts +0 -6
  35. package/driver/errors/map.d.ts +0 -9
  36. package/driver/errors/product-not-found.d.ts +0 -8
  37. package/driver/errors/public_api.d.ts +0 -4
  38. package/driver/in-memory/backend/product.service.d.ts +0 -48
  39. package/driver/in-memory/collection-name.const.d.ts +0 -1
  40. package/driver/in-memory/driver/product-driver.module.d.ts +0 -13
  41. package/driver/in-memory/driver/product.service.d.ts +0 -24
  42. package/driver/in-memory/driver/provider.d.ts +0 -5
  43. package/driver/in-memory/injection-tokens/public_api.d.ts +0 -2
  44. package/driver/in-memory/injection-tokens/transforms/product-response/response-extra.token.d.ts +0 -2
  45. package/driver/in-memory/injection-tokens/transforms/product-response/response.token.d.ts +0 -2
  46. package/driver/in-memory/interfaces/product-response-extra-transform.type.d.ts +0 -3
  47. package/driver/in-memory/interfaces/product-response-transform.type.d.ts +0 -3
  48. package/driver/in-memory/interfaces/public_api.d.ts +0 -2
  49. package/driver/in-memory/public_api.d.ts +0 -6
  50. package/driver/interfaces/product-service.interface.d.ts +0 -27
  51. package/driver/magento/config/default.d.ts +0 -5
  52. package/driver/magento/config/public_api.d.ts +0 -1
  53. package/driver/magento/injection-tokens/fragments/product-page.token.d.ts +0 -2
  54. package/driver/magento/injection-tokens/fragments/product-preview.token.d.ts +0 -2
  55. package/driver/magento/injection-tokens/fragments/product.token.d.ts +0 -2
  56. package/driver/magento/injection-tokens/public_api.d.ts +0 -9
  57. package/driver/magento/injection-tokens/transforms/product/extra.token.d.ts +0 -20
  58. package/driver/magento/injection-tokens/transforms/product/token.d.ts +0 -2
  59. package/driver/magento/injection-tokens/transforms/product-preview/preview-extra.token.d.ts +0 -20
  60. package/driver/magento/injection-tokens/transforms/product-preview/preview.token.d.ts +0 -2
  61. package/driver/magento/injection-tokens/transforms/product-response/response-extra.token.d.ts +0 -2
  62. package/driver/magento/injection-tokens/transforms/product-response/response.token.d.ts +0 -2
  63. package/driver/magento/interfaces/config.interface.d.ts +0 -11
  64. package/driver/magento/interfaces/product-preview-extra-transform.type.d.ts +0 -3
  65. package/driver/magento/interfaces/product-preview-transform.type.d.ts +0 -3
  66. package/driver/magento/interfaces/product-response-extra-transform.type.d.ts +0 -3
  67. package/driver/magento/interfaces/product-response-transform.type.d.ts +0 -3
  68. package/driver/magento/interfaces/public_api.d.ts +0 -5
  69. package/driver/magento/models/aggregation.d.ts +0 -17
  70. package/driver/magento/models/filter-type-field.interface.d.ts +0 -7
  71. package/driver/magento/models/filter-type.enum.d.ts +0 -5
  72. package/driver/magento/models/filters.d.ts +0 -13
  73. package/driver/magento/models/get-filter-types-response.interface.d.ts +0 -6
  74. package/driver/magento/models/get-product-response.interface.d.ts +0 -8
  75. package/driver/magento/models/magento-product.d.ts +0 -27
  76. package/driver/magento/models/product-preview.interface.d.ts +0 -35
  77. package/driver/magento/models/public_api.d.ts +0 -11
  78. package/driver/magento/models/simple-product.d.ts +0 -6
  79. package/driver/magento/models/sort-fields.d.ts +0 -9
  80. package/driver/magento/models/sort.d.ts +0 -7
  81. package/driver/magento/product-driver.module.d.ts +0 -14
  82. package/driver/magento/product.service.d.ts +0 -28
  83. package/driver/magento/provider.d.ts +0 -3
  84. package/driver/magento/public_api.d.ts +0 -9
  85. package/driver/magento/queries/fragments/product-aggregations.d.ts +0 -1
  86. package/driver/magento/queries/fragments/product-page.d.ts +0 -1
  87. package/driver/magento/queries/fragments/product-preview.d.ts +0 -1
  88. package/driver/magento/queries/fragments/product.d.ts +0 -1
  89. package/driver/magento/queries/fragments/public_api.d.ts +0 -5
  90. package/driver/magento/queries/fragments/sort-fields.d.ts +0 -1
  91. package/driver/magento/queries/get-all-products.d.ts +0 -3
  92. package/driver/magento/queries/get-filter-types.d.ts +0 -2
  93. package/driver/magento/queries/get-product-by-url/public_api.d.ts +0 -4
  94. package/driver/magento/queries/get-product-by-url/query.d.ts +0 -5
  95. package/driver/magento/queries/get-product-by-url/response.type.d.ts +0 -5
  96. package/driver/magento/queries/get-product-by-url/validator.d.ts +0 -3
  97. package/driver/magento/queries/get-product-by-url/variables.type.d.ts +0 -3
  98. package/driver/magento/queries/get-product.d.ts +0 -3
  99. package/driver/magento/queries/public_api.d.ts +0 -5
  100. package/driver/magento/testing/factories/aggregation/aggregation.factory.d.ts +0 -12
  101. package/driver/magento/testing/factories/aggregation/public_api.d.ts +0 -3
  102. package/driver/magento/testing/factories/aggregation/type/price.factory.d.ts +0 -8
  103. package/driver/magento/testing/factories/aggregation/type/select.factory.d.ts +0 -8
  104. package/driver/magento/testing/factories/core/product-preview.factory.d.ts +0 -42
  105. package/driver/magento/testing/factories/core/product.factory.d.ts +0 -28
  106. package/driver/magento/testing/factories/filter-type-field.factory.d.ts +0 -8
  107. package/driver/magento/testing/factories/public_api.d.ts +0 -7
  108. package/driver/magento/testing/factories/simple/simple.factory.d.ts +0 -15
  109. package/driver/magento/testing/factories/sort-fields.factory.d.ts +0 -8
  110. package/driver/magento/testing/public_api.d.ts +0 -1
  111. package/driver/magento/transforms/aggregate/add-metadata-types-to-aggregates.d.ts +0 -2
  112. package/driver/magento/transforms/aggregate/get-matched-attribute-type.d.ts +0 -2
  113. package/driver/magento/transforms/aggregate/public_api.d.ts +0 -3
  114. package/driver/magento/transforms/aggregate/transform.d.ts +0 -3
  115. package/driver/magento/transforms/aggregate/type/equal.d.ts +0 -3
  116. package/driver/magento/transforms/aggregate/type/range.d.ts +0 -8
  117. package/driver/magento/transforms/applied-filter-transformer.service.d.ts +0 -18
  118. package/driver/magento/transforms/applied-sort-option.d.ts +0 -3
  119. package/driver/magento/transforms/collection-metadata.d.ts +0 -8
  120. package/driver/magento/transforms/product-preview.d.ts +0 -12
  121. package/driver/magento/transforms/product-response.d.ts +0 -17
  122. package/driver/magento/transforms/product-transformers.d.ts +0 -20
  123. package/driver/magento/transforms/public_api.d.ts +0 -7
  124. package/driver/magento/transforms/simple-product-transformers.d.ts +0 -16
  125. package/driver/magento/transforms/sort-options/sort-default-option-first.d.ts +0 -2
  126. package/driver/models/public_api.d.ts +0 -1
  127. package/driver/models/response.interface.d.ts +0 -18
  128. package/driver/public_api.d.ts +0 -3
  129. package/driver/shopify/product-driver.module.d.ts +0 -12
  130. package/driver/shopify/product.service.d.ts +0 -20
  131. package/driver/shopify/public_api.d.ts +0 -4
  132. package/driver/shopify/queries/gql/get-all-products.d.ts +0 -6
  133. package/driver/shopify/queries/gql/get-product-by-url.d.ts +0 -8
  134. package/driver/shopify/queries/gql/get-product.d.ts +0 -6
  135. package/driver/shopify/queries/gql/public_api.d.ts +0 -3
  136. package/driver/shopify/queries/public_api.d.ts +0 -3
  137. package/driver/shopify/queries/response.types.d.ts +0 -6
  138. package/driver/shopify/queries/variables.types.d.ts +0 -9
  139. package/driver/shopify/transforms/public_api.d.ts +0 -1
  140. package/driver/shopify/transforms/shopify-daff-product-transform.d.ts +0 -9
  141. package/driver/testing/drivers/product-driver.module.d.ts +0 -13
  142. package/driver/testing/drivers/product.service.d.ts +0 -22
  143. package/driver/testing/public_api.d.ts +0 -2
  144. package/helpers/has-discount.d.ts +0 -7
  145. package/helpers/has-price-range.d.ts +0 -7
  146. package/helpers/public_api.d.ts +0 -2
  147. package/models/collection.interface.d.ts +0 -8
  148. package/models/prices.d.ts +0 -31
  149. package/models/product-image.d.ts +0 -10
  150. package/models/product.d.ts +0 -76
  151. package/models/public_api.d.ts +0 -4
  152. package/public_api.d.ts +0 -2
  153. package/routing/config/default.d.ts +0 -9
  154. package/routing/config/interface.d.ts +0 -18
  155. package/routing/config/public_api.d.ts +0 -3
  156. package/routing/config/token.d.ts +0 -2
  157. package/routing/constants/collection-request-fields.d.ts +0 -5
  158. package/routing/constants/public_api.d.ts +0 -1
  159. package/routing/discrete-filter-params/public_api.d.ts +0 -1
  160. package/routing/discrete-filter-params/token.d.ts +0 -10
  161. package/routing/effects/collection.effects.d.ts +0 -20
  162. package/routing/effects/public_api.d.ts +0 -1
  163. package/routing/models/collection-request-query-param-transforms.interface.d.ts +0 -22
  164. package/routing/models/collection-request-query-params.interface.d.ts +0 -8
  165. package/routing/models/public_api.d.ts +0 -2
  166. package/routing/module.d.ts +0 -9
  167. package/routing/public_api.d.ts +0 -8
  168. package/routing/resolvers/product-page-id/product-page-id.resolver.d.ts +0 -18
  169. package/routing/resolvers/product-page-url/product-page-url.resolver.d.ts +0 -22
  170. package/routing/resolvers/public_api.d.ts +0 -2
  171. package/routing/services/get-query-params-from-request.service.d.ts +0 -17
  172. package/routing/services/get-request-from-route.service.d.ts +0 -18
  173. package/routing/services/public_api.d.ts +0 -2
  174. package/state/actions/product-grid.actions.d.ts +0 -47
  175. package/state/actions/product-page.actions.d.ts +0 -67
  176. package/state/actions/product.actions.d.ts +0 -43
  177. package/state/actions/public_api.d.ts +0 -3
  178. package/state/effects/product-grid.effects.d.ts +0 -27
  179. package/state/effects/product-page.effects.d.ts +0 -28
  180. package/state/effects/product.effects.d.ts +0 -27
  181. package/state/effects/public_api.d.ts +0 -2
  182. package/state/facades/product/product-facade.interface.d.ts +0 -51
  183. package/state/facades/product/product.facade.d.ts +0 -26
  184. package/state/facades/product-grid/product-grid-facade.interface.d.ts +0 -14
  185. package/state/facades/product-grid/product-grid.facade.d.ts +0 -20
  186. package/state/facades/product-page/facade.d.ts +0 -27
  187. package/state/facades/product-page/facade.interface.d.ts +0 -13
  188. package/state/facades/public_api.d.ts +0 -6
  189. package/state/injection-tokens/error-matcher.token.d.ts +0 -2
  190. package/state/injection-tokens/public_api.d.ts +0 -1
  191. package/state/product-state.module.d.ts +0 -11
  192. package/state/public_api.d.ts +0 -7
  193. package/state/reducers/injection-tokens/config.token.d.ts +0 -3
  194. package/state/reducers/injection-tokens/extra.token.d.ts +0 -3
  195. package/state/reducers/injection-tokens/meta.token.d.ts +0 -3
  196. package/state/reducers/injection-tokens/public_api.d.ts +0 -2
  197. package/state/reducers/injection-tokens/reducers.token.d.ts +0 -3
  198. package/state/reducers/product/product-reducer-state.interface.d.ts +0 -15
  199. package/state/reducers/product/product.reducer.d.ts +0 -15
  200. package/state/reducers/product-entities/product-entities-reducer-adapter.d.ts +0 -6
  201. package/state/reducers/product-entities/product-entities.reducer.d.ts +0 -11
  202. package/state/reducers/product-grid/product-grid-reducer-state.interface.d.ts +0 -19
  203. package/state/reducers/product-grid/product-grid.reducer.d.ts +0 -15
  204. package/state/reducers/product-reducers-state.interface.d.ts +0 -16
  205. package/state/reducers/product-reducers.d.ts +0 -6
  206. package/state/reducers/product-store-feature-key.d.ts +0 -1
  207. package/state/reducers/public_api.d.ts +0 -10
  208. package/state/selectors/all-selectors.selectors.d.ts +0 -15
  209. package/state/selectors/product/product.selectors.d.ts +0 -27
  210. package/state/selectors/product-entities/product-entities.selectors.d.ts +0 -75
  211. package/state/selectors/product-feature.selector.d.ts +0 -13
  212. package/state/selectors/product-grid/product-grid.selectors.d.ts +0 -22
  213. package/state/selectors/public_api.d.ts +0 -5
  214. package/state/testing/mock-product-facade.d.ts +0 -19
  215. package/state/testing/mock-product-grid-facade.d.ts +0 -14
  216. package/state/testing/mock-product-page-facade.d.ts +0 -20
  217. package/state/testing/product-testing.module.d.ts +0 -6
  218. package/state/testing/public_api.d.ts +0 -4
  219. package/testing/factories/collection.factory.d.ts +0 -18
  220. package/testing/factories/default-product.factory.d.ts +0 -39
  221. package/testing/factories/extension.factory.d.ts +0 -21
  222. package/testing/factories/kind.factory.d.ts +0 -20
  223. package/testing/factories/product-image.factory.d.ts +0 -19
  224. package/testing/factories/public_api.d.ts +0 -6
  225. package/testing/helpers.d.ts +0 -7
  226. package/testing/injection-tokens/factories/extra.token.d.ts +0 -3
  227. package/testing/injection-tokens/factories/type.token.d.ts +0 -3
  228. package/testing/injection-tokens/public_api.d.ts +0 -2
  229. package/testing/public_api.d.ts +0 -4
  230. package/testing/testing.module.d.ts +0 -9
@@ -1,13 +0,0 @@
1
- import { ModuleWithProviders } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- import * as i1 from "@angular/common";
4
- import * as i2 from "@daffodil/product/testing";
5
- /**
6
- * Module for providing the {@link DaffProductTestingService} driver as the {@link DaffProductDriver}.
7
- */
8
- export declare class DaffProductTestingDriverModule {
9
- static forRoot(): ModuleWithProviders<DaffProductTestingDriverModule>;
10
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffProductTestingDriverModule, never>;
11
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffProductTestingDriverModule, never, [typeof i1.CommonModule, typeof i2.DaffProductTestingModule], never>;
12
- static ɵinj: i0.ɵɵInjectorDeclaration<DaffProductTestingDriverModule>;
13
- }
@@ -1,22 +0,0 @@
1
- import { Observable } from 'rxjs';
2
- import { DaffProduct } from '@daffodil/product';
3
- import { DaffProductDriverResponse, DaffProductServiceInterface } from '@daffodil/product/driver';
4
- import { DaffProductImageFactory, DaffProductExtensionFactory } from '@daffodil/product/testing';
5
- import * as i0 from "@angular/core";
6
- /**
7
- * The product testing driver to mock the backend product service.
8
- *
9
- * @inheritdoc
10
- * @param productFactory - A DaffProductFactory instance
11
- * @param productImageFactory - A DaffProductImageFactory instance
12
- */
13
- export declare class DaffTestingProductService implements DaffProductServiceInterface {
14
- private productFactory;
15
- private productImageFactory;
16
- constructor(productFactory: DaffProductExtensionFactory, productImageFactory: DaffProductImageFactory);
17
- getAll(): Observable<DaffProduct[]>;
18
- get(productId: DaffProduct['id']): Observable<DaffProductDriverResponse>;
19
- getByUrl(url: DaffProduct['url']): Observable<DaffProductDriverResponse>;
20
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffTestingProductService, never>;
21
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffTestingProductService>;
22
- }
@@ -1,2 +0,0 @@
1
- export { DaffTestingProductService } from './drivers/product.service';
2
- export { DaffProductTestingDriverModule } from './drivers/product-driver.module';
@@ -1,7 +0,0 @@
1
- import { DaffPriceRange } from '../models/public_api';
2
- /**
3
- * Returns whether a DaffPriceRange has a discount.
4
- *
5
- * @param priceRange a DaffPriceRange
6
- */
7
- export declare const productPriceRangeHasDiscount: (priceRange: DaffPriceRange) => boolean;
@@ -1,7 +0,0 @@
1
- import { DaffPriceRange } from '../models/public_api';
2
- /**
3
- * Returns whether the min and max prices of a DaffPriceRange are different.
4
- *
5
- * @param priceRange a DaffPriceRange
6
- */
7
- export declare const productPriceRangeHasPriceRange: (priceRange: DaffPriceRange) => boolean;
@@ -1,2 +0,0 @@
1
- export { productPriceRangeHasDiscount } from './has-discount';
2
- export { productPriceRangeHasPriceRange } from './has-price-range';
@@ -1,8 +0,0 @@
1
- import { DaffCollection } from '@daffodil/core';
2
- import { DaffProduct } from './product';
3
- /**
4
- * A product collection.
5
- *
6
- * @inheritdoc
7
- */
8
- export type DaffProductCollection = DaffCollection<DaffProduct>;
@@ -1,31 +0,0 @@
1
- import { DaffProductDiscount } from './product';
2
- /**
3
- * A model for product prices that holds discounts, discounted price, and original price for the associated product.
4
- */
5
- export interface DaffProductPrices {
6
- /**
7
- * The discounted price of the product.
8
- */
9
- discountedPrice: number;
10
- /**
11
- * The discount of the product.
12
- */
13
- discount: DaffProductDiscount;
14
- /**
15
- * The price of the product before discounts.
16
- */
17
- originalPrice: number;
18
- }
19
- /**
20
- * A ranged price for products that could have more than one possible price, depending on the configurations.
21
- */
22
- export interface DaffPriceRange {
23
- /**
24
- * The maximum prices of the product. Includes discounts, the maximum discounted price, and the maximum original price.
25
- */
26
- maxPrice: DaffProductPrices;
27
- /**
28
- * The minimum prices of the product. Includes discounts, the minimum discounted price, and the minimum original price.
29
- */
30
- minPrice: DaffProductPrices;
31
- }
@@ -1,10 +0,0 @@
1
- import { DaffIdentifiable, DaffLocatable } from '@daffodil/core';
2
- /**
3
- * Interface for an image on a DaffProduct.
4
- */
5
- export interface DaffProductImage extends DaffLocatable, DaffIdentifiable {
6
- /**
7
- * A label describing the image.
8
- */
9
- label: string;
10
- }
@@ -1,76 +0,0 @@
1
- import { DaffIdentifiable, DaffLocatable, DaffCanonicallyLocatable } from '@daffodil/core';
2
- import { DaffProductImage } from './product-image';
3
- /**
4
- * The possible product types.
5
- */
6
- export declare enum DaffProductTypeEnum {
7
- Simple = "simple",
8
- Composite = "composite",
9
- Configurable = "configurable"
10
- }
11
- /**
12
- * An interface for a product usable by the @daffodil/product library.
13
- */
14
- export interface DaffProduct extends DaffLocatable, DaffIdentifiable, Partial<DaffCanonicallyLocatable> {
15
- /**
16
- * The type of product.
17
- */
18
- type: DaffProductTypeEnum;
19
- /**
20
- * The product name.
21
- */
22
- name: string;
23
- /**
24
- * An image to concisely visualize the product.
25
- */
26
- thumbnail: DaffProductImage;
27
- /**
28
- * An array of images for the product.
29
- */
30
- images?: DaffProductImage[];
31
- /**
32
- * The price of the product.
33
- */
34
- price?: number;
35
- /**
36
- * The total discounts associated with this product.
37
- */
38
- discount?: DaffProductDiscount;
39
- /**
40
- * Whether or not the product is in stock.
41
- */
42
- in_stock?: boolean;
43
- /**
44
- * The product brand.
45
- */
46
- brand?: string;
47
- /**
48
- * Describes the product.
49
- */
50
- description?: string;
51
- /**
52
- * A shorter description of the product.
53
- */
54
- short_description?: string;
55
- /**
56
- * A title for the product to display in the browser tab title.
57
- */
58
- meta_title?: string;
59
- /**
60
- * A description of the product for usage in search engine results.
61
- */
62
- meta_description?: string;
63
- }
64
- /**
65
- * The discount for a product.
66
- */
67
- export interface DaffProductDiscount {
68
- /**
69
- * The discount represented as some amount of currency.
70
- */
71
- amount: number;
72
- /**
73
- * The discount represented as a percent of the original product price.
74
- */
75
- percent: number;
76
- }
@@ -1,4 +0,0 @@
1
- export * from './prices';
2
- export * from './product';
3
- export * from './product-image';
4
- export * from './collection.interface';
package/public_api.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from './models/public_api';
2
- export * from './helpers/public_api';
@@ -1,9 +0,0 @@
1
- import { InjectionToken } from '@angular/core';
2
- import { DaffBase64Service } from '@daffodil/core';
3
- import { DaffProductRoutingConfig } from './interface';
4
- export declare const DAFF_PRODUCT_ROUTING_QUERY_PARAM_REQUEST_MAP: DaffProductRoutingConfig['params'];
5
- /**
6
- * The default configuration for the {@link DaffProductRoutingConfig}.
7
- */
8
- export declare const daffProductRoutingConfigDefaultFactory: (base64: DaffBase64Service) => DaffProductRoutingConfig;
9
- export declare const DAFF_PRODUCT_ROUTING_CONFIG_DEFAULT: InjectionToken<DaffProductRoutingConfig>;
@@ -1,18 +0,0 @@
1
- import { DaffCollectionRequestQueryParams, DaffCollectionRequestQueryParamTransforms } from '../models/public_api';
2
- /**
3
- * An interface for providing `@daffodil/product/routing` with necessary config values.
4
- */
5
- export interface DaffProductRoutingConfig {
6
- /**
7
- * The query params transforms for each product collection request field.
8
- *
9
- * See {@link DaffCollectionRequestQueryParamTransforms}.
10
- */
11
- transforms?: DaffCollectionRequestQueryParamTransforms;
12
- /**
13
- * The mapping of query param fields.
14
- *
15
- * See {@link DaffCollectionRequestQueryParams}.
16
- */
17
- params?: DaffCollectionRequestQueryParams;
18
- }
@@ -1,3 +0,0 @@
1
- export * from './default';
2
- export { DaffProductRoutingConfig } from './interface';
3
- export * from './token';
@@ -1,2 +0,0 @@
1
- import { DaffProductRoutingConfig } from './interface';
2
- export declare const DAFF_PRODUCT_ROUTING_CONFIG: import("@angular/core").InjectionToken<DaffProductRoutingConfig>, provideDaffProductRoutingConfig: <R extends DaffProductRoutingConfig = DaffProductRoutingConfig>(config: Partial<R> | import("@angular/core").InjectionToken<Partial<R>>) => import("@angular/core").FactoryProvider;
@@ -1,5 +0,0 @@
1
- import { DaffCollectionRequest } from '@daffodil/core';
2
- /**
3
- * A list of request fields that can be transformed to and from query params.
4
- */
5
- export declare const DAFF_PRODUCT_COLLECTION_REQUEST_FIELDS: (keyof DaffCollectionRequest)[];
@@ -1 +0,0 @@
1
- export { DAFF_PRODUCT_COLLECTION_REQUEST_FIELDS } from './collection-request-fields';
@@ -1 +0,0 @@
1
- export * from './token';
@@ -1,10 +0,0 @@
1
- import { ValueProvider } from '@angular/core';
2
- import { DaffRoutingQueryParamFilter } from '@daffodil/core/routing';
3
- export declare const DAFF_PRODUCT_ROUTING_DISCRETE_FILTER_PARAMS: import("@angular/core").InjectionToken<DaffRoutingQueryParamFilter[]>;
4
- /**
5
- * A multi-provider for {@link DAFF_PRODUCT_ROUTING_DISCRETE_FILTER_PARAMS}.
6
- *
7
- * @param queryParam Defaults to `filterName`.
8
- * @param builder Defaults to {@link daffRoutingQueryParamFilterRequestEqualBuilder}.
9
- */
10
- export declare function daffProductRoutingProvideDiscreteFilterParam(filterName: DaffRoutingQueryParamFilter['filterName'], queryParam?: DaffRoutingQueryParamFilter['queryParam'], builder?: DaffRoutingQueryParamFilter['builder']): ValueProvider;
@@ -1,20 +0,0 @@
1
- import { ActivatedRoute, Router } from '@angular/router';
2
- import { Actions } from '@ngrx/effects';
3
- import { DaffCollectionFacadeInterface } from '@daffodil/core/state';
4
- import { DaffProductGetQueryParamsFromRequest } from '../services/public_api';
5
- /**
6
- * An abstract class that provides an effect for modifying the browser URL.
7
- */
8
- export declare abstract class DaffProductRoutingCollectionEffects {
9
- private actions$;
10
- private router;
11
- private actionTypes;
12
- private facade;
13
- private getQueryParams;
14
- private route;
15
- constructor(actions$: Actions, router: Router, actionTypes: string[], facade: DaffCollectionFacadeInterface, getQueryParams: DaffProductGetQueryParamsFromRequest, route: ActivatedRoute);
16
- /**
17
- * Updates the URL according to the product collection request in state.
18
- */
19
- update$: import("rxjs").Observable<never> & import("@ngrx/effects").CreateEffectMetadata;
20
- }
@@ -1 +0,0 @@
1
- export { DaffProductRoutingCollectionEffects } from './collection.effects';
@@ -1,22 +0,0 @@
1
- import { DaffCollectionRequest } from '@daffodil/core';
2
- type DaffCollectionRequestValue = DaffCollectionRequest[keyof DaffCollectionRequest];
3
- /**
4
- * Transforms for storing and retrieving {@link DaffCollectionRequest} values in a route's query params.
5
- */
6
- export interface DaffCollectionRequestQueryParamTransform<T extends DaffCollectionRequestValue = DaffCollectionRequestValue> {
7
- /**
8
- * A function that is given the value of a query param and
9
- * returns the value that will be set to the product collection request.
10
- */
11
- request?: (queryParam: string) => T;
12
- /**
13
- * A function that is given the value of a product collection request field and
14
- * returns the value that will be set to the query params.
15
- */
16
- queryParam?: (requestValue: T) => string;
17
- }
18
- /**
19
- * A collection of optional {@link DaffCollectionRequestQueryParamTransform}s.
20
- */
21
- export type DaffCollectionRequestQueryParamTransforms = Partial<Record<keyof DaffCollectionRequest, DaffCollectionRequestQueryParamTransform>>;
22
- export {};
@@ -1,8 +0,0 @@
1
- import { DaffCollectionRequest } from '@daffodil/core';
2
- /**
3
- * An object containing a mapping of a {@link DaffCollectionRequest} field to a query param name.
4
- * Setting a value for one of these fields will cause a resolver that operates on a product collection
5
- * to include the value of that specified query param after transforming it according to {@link DaffCollectionRequestQueryParamTransforms}.
6
- * Omitting a value for a field will disable using a query param for the request value.
7
- */
8
- export type DaffCollectionRequestQueryParams = Partial<Record<keyof DaffCollectionRequest, string>>;
@@ -1,2 +0,0 @@
1
- export { DaffCollectionRequestQueryParamTransform, DaffCollectionRequestQueryParamTransforms, } from './collection-request-query-param-transforms.interface';
2
- export { DaffCollectionRequestQueryParams } from './collection-request-query-params.interface';
@@ -1,9 +0,0 @@
1
- import { ModuleWithProviders } from '@angular/core';
2
- import { DaffProductRoutingConfig } from './config/public_api';
3
- import * as i0 from "@angular/core";
4
- export declare class DaffProductRoutingModule {
5
- static withConfig(config?: DaffProductRoutingConfig): ModuleWithProviders<DaffProductRoutingModule>;
6
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffProductRoutingModule, never>;
7
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffProductRoutingModule, never, never, never>;
8
- static ɵinj: i0.ɵɵInjectorDeclaration<DaffProductRoutingModule>;
9
- }
@@ -1,8 +0,0 @@
1
- export * from './resolvers/public_api';
2
- export * from './config/public_api';
3
- export * from './services/public_api';
4
- export * from './models/public_api';
5
- export * from './constants/public_api';
6
- export * from './effects/public_api';
7
- export * from './discrete-filter-params/public_api';
8
- export * from './module';
@@ -1,18 +0,0 @@
1
- import { ActivatedRouteSnapshot } from '@angular/router';
2
- import { ActionsSubject, Store } from '@ngrx/store';
3
- import { Observable } from 'rxjs';
4
- import { DaffProductStateRootSlice } from '@daffodil/product/state';
5
- import * as i0 from "@angular/core";
6
- /**
7
- * Resolves product data for product pages, and will only resolve the url after a product request succeeds or fails. This resolver expects a url
8
- * of the form `some/url/{id}` where `{id}` is the product id.
9
- */
10
- export declare class DaffProductPageIdResolver {
11
- private platformId;
12
- private store;
13
- private dispatcher;
14
- constructor(platformId: string, store: Store<DaffProductStateRootSlice>, dispatcher: ActionsSubject);
15
- resolve(route: ActivatedRouteSnapshot): Observable<boolean>;
16
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffProductPageIdResolver, never>;
17
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffProductPageIdResolver>;
18
- }
@@ -1,22 +0,0 @@
1
- import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
2
- import { ActionsSubject, Store } from '@ngrx/store';
3
- import { Observable } from 'rxjs';
4
- import { DaffRoutingUriNormalizer } from '@daffodil/core/routing';
5
- import { DaffProductStateRootSlice } from '@daffodil/product/state';
6
- import * as i0 from "@angular/core";
7
- /**
8
- * Resolves product data for product pages, and will only resolve the url
9
- * after a product request succeeds or fails. This resolver will take a full
10
- * a url of the form `some/url.html(secondary:outlet)?query=param#fragment` and attempt to resolve a product from it.
11
- * Assumes that the URL to be resolved is the primary outlet.
12
- */
13
- export declare class DaffProductPageUrlResolver {
14
- private platformId;
15
- private store;
16
- private dispatcher;
17
- private urlNormalizer;
18
- constructor(platformId: string, store: Store<DaffProductStateRootSlice>, dispatcher: ActionsSubject, urlNormalizer: DaffRoutingUriNormalizer);
19
- resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean>;
20
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffProductPageUrlResolver, never>;
21
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffProductPageUrlResolver>;
22
- }
@@ -1,2 +0,0 @@
1
- export { DaffProductPageIdResolver } from './product-page-id/product-page-id.resolver';
2
- export { DaffProductPageUrlResolver } from './product-page-url/product-page-url.resolver';
@@ -1,17 +0,0 @@
1
- import { Params } from '@angular/router';
2
- import { DaffCollectionRequest } from '@daffodil/core';
3
- import { DaffRoutingQueryParamFilter } from '@daffodil/core/routing';
4
- import { DaffProductRoutingConfig } from '../config/public_api';
5
- import * as i0 from "@angular/core";
6
- /**
7
- * Builds a query param map from a {@link DaffCollectionRequest}.
8
- * Its behavior can be configured via the {@link DAFF_PRODUCT_ROUTING_CONFIG} injection token.
9
- */
10
- export declare class DaffProductGetQueryParamsFromRequest {
11
- private config;
12
- private discreteFilters;
13
- constructor(config: DaffProductRoutingConfig, discreteFilters: DaffRoutingQueryParamFilter[]);
14
- getQueryParams(request: DaffCollectionRequest): Params;
15
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffProductGetQueryParamsFromRequest, never>;
16
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffProductGetQueryParamsFromRequest>;
17
- }
@@ -1,18 +0,0 @@
1
- import { ParamMap } from '@angular/router';
2
- import { DaffCollectionRequest } from '@daffodil/core';
3
- import { DaffRoutingQueryParamFilter } from '@daffodil/core/routing';
4
- import { DaffProductRoutingConfig } from '../config/public_api';
5
- import * as i0 from "@angular/core";
6
- /**
7
- * Builds a {@link DaffCollectionRequest} from the query params of the passed route.
8
- * Its behavior can be configured via the {@link DAFF_PRODUCT_COLLECTION_QUERY_PARAMS} and
9
- * {@link DAFF_PRODUCT_COLLECTION_QUERY_PARAM_TRANSFORMS} injection tokens.
10
- */
11
- export declare class DaffProductGetCollectionRequestFromRoute {
12
- private config;
13
- private discreteFilters;
14
- constructor(config: DaffProductRoutingConfig, discreteFilters: DaffRoutingQueryParamFilter[]);
15
- getRequest(queryParamMap: ParamMap): DaffCollectionRequest;
16
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffProductGetCollectionRequestFromRoute, never>;
17
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffProductGetCollectionRequestFromRoute>;
18
- }
@@ -1,2 +0,0 @@
1
- export { DaffProductGetCollectionRequestFromRoute } from './get-request-from-route.service';
2
- export { DaffProductGetQueryParamsFromRequest } from './get-query-params-from-request.service';
@@ -1,47 +0,0 @@
1
- import { Action } from '@ngrx/store';
2
- import { DaffStateError } from '@daffodil/core/state';
3
- import { DaffProduct } from '@daffodil/product';
4
- /**
5
- * Action types for Product Grid Actions.
6
- */
7
- export declare enum DaffProductGridActionTypes {
8
- ProductGridLoadAction = "[@daffodil/product] ProductGrid Load Action",
9
- ProductGridLoadSuccessAction = "[@daffodil/product] ProductGrid Load Success Action",
10
- ProductGridLoadFailureAction = "[@daffodil/product] ProductGrid Load Failure Action",
11
- ProductGridResetAction = "[@daffodil/product] ProductGrid Reset Action"
12
- }
13
- /**
14
- * Triggers a request for an array of products.
15
- */
16
- export declare class DaffProductGridLoad implements Action {
17
- readonly type = DaffProductGridActionTypes.ProductGridLoadAction;
18
- constructor();
19
- }
20
- /**
21
- * An action called when a request for of an array of products succeeded.
22
- *
23
- * @param payload - An array of Products
24
- */
25
- export declare class DaffProductGridLoadSuccess<T extends DaffProduct = DaffProduct> implements Action {
26
- payload: T[];
27
- readonly type = DaffProductGridActionTypes.ProductGridLoadSuccessAction;
28
- constructor(payload: T[]);
29
- }
30
- /**
31
- * An action called when a request for an array of products failed.
32
- *
33
- * @param payload - An error message
34
- */
35
- export declare class DaffProductGridLoadFailure implements Action {
36
- payload: DaffStateError;
37
- readonly type = DaffProductGridActionTypes.ProductGridLoadFailureAction;
38
- constructor(payload: DaffStateError);
39
- }
40
- /**
41
- * Resets the state of the product grid redux store to its initial state.
42
- */
43
- export declare class DaffProductGridReset implements Action {
44
- readonly type = DaffProductGridActionTypes.ProductGridResetAction;
45
- constructor();
46
- }
47
- export type DaffProductGridActions<T extends DaffProduct = DaffProduct> = DaffProductGridLoad | DaffProductGridLoadSuccess<T> | DaffProductGridLoadFailure | DaffProductGridReset;
@@ -1,67 +0,0 @@
1
- import { Action } from '@ngrx/store';
2
- import { DaffStateError } from '@daffodil/core/state';
3
- import { DaffProduct } from '@daffodil/product';
4
- import { DaffProductDriverResponse } from '@daffodil/product/driver';
5
- /**
6
- * Action types for Product Page Actions.
7
- */
8
- export declare enum DaffProductPageActionTypes {
9
- ProductPageLoadByUrlAction = "[@daffodil/product] Product Page Load By URL Action",
10
- ProductPageLoadAction = "[@daffodil/product] Product Page Load Action",
11
- ProductPageLoadSuccessAction = "[@daffodil/product] Product Page Load Success Action",
12
- ProductPageLoadFailureAction = "[@daffodil/product] Product Page Load Failure Action",
13
- UpdateQtyAction = "[@daffodil/product] Product Page Update Qty Action"
14
- }
15
- /**
16
- * An action triggered to initialize a product page load.
17
- * This is intended to be used for loading a product page rather than only a product.
18
- *
19
- * @param payload - URL of the requested product
20
- */
21
- export declare class DaffProductPageLoadByUrl<T extends DaffProduct = DaffProduct> implements Action {
22
- payload: T['url'];
23
- readonly type = DaffProductPageActionTypes.ProductPageLoadByUrlAction;
24
- constructor(payload: T['url']);
25
- }
26
- /**
27
- * An action triggered to initialize a product page load.
28
- * This is intended to be used for loading a product page rather than only a product.
29
- *
30
- * @param payload - Id of the requested product
31
- */
32
- export declare class DaffProductPageLoad implements Action {
33
- payload: string;
34
- readonly type = DaffProductPageActionTypes.ProductPageLoadAction;
35
- constructor(payload: string);
36
- }
37
- /**
38
- * An action triggered upon a successful product page request.
39
- *
40
- * @param payload - A DaffProduct
41
- */
42
- export declare class DaffProductPageLoadSuccess<T extends DaffProduct = DaffProduct> implements Action {
43
- payload: DaffProductDriverResponse<T>;
44
- readonly type = DaffProductPageActionTypes.ProductPageLoadSuccessAction;
45
- constructor(payload: DaffProductDriverResponse<T>);
46
- }
47
- /**
48
- * An action triggered upon a failed product page request.
49
- *
50
- * @param payload - an error message
51
- */
52
- export declare class DaffProductPageLoadFailure implements Action {
53
- payload: DaffStateError;
54
- readonly type = DaffProductPageActionTypes.ProductPageLoadFailureAction;
55
- constructor(payload: DaffStateError);
56
- }
57
- /**
58
- * Update the qty of the current product.
59
- *
60
- * @param payload - The qty of the product.
61
- */
62
- export declare class DaffProductPageUpdateQty implements Action {
63
- payload: number;
64
- readonly type = DaffProductPageActionTypes.UpdateQtyAction;
65
- constructor(payload: number);
66
- }
67
- export type DaffProductPageActions<T extends DaffProduct = DaffProduct> = DaffProductPageLoadByUrl<T> | DaffProductPageLoad | DaffProductPageLoadSuccess<T> | DaffProductPageLoadFailure | DaffProductPageUpdateQty;
@@ -1,43 +0,0 @@
1
- import { Action } from '@ngrx/store';
2
- import { DaffStateError } from '@daffodil/core/state';
3
- import { DaffProduct } from '@daffodil/product';
4
- import { DaffProductDriverResponse } from '@daffodil/product/driver';
5
- /**
6
- * Action types for Product Actions.
7
- */
8
- export declare enum DaffProductActionTypes {
9
- ProductLoadAction = "[@daffodil/product] Product Load Action",
10
- ProductLoadSuccessAction = "[@daffodil/product] Product Load Success Action",
11
- ProductLoadFailureAction = "[@daffodil/product] Product Load Failure Action"
12
- }
13
- /**
14
- * Triggers a request for a Product.
15
- *
16
- * @param payload - Id of requested Product
17
- */
18
- export declare class DaffProductLoad implements Action {
19
- payload: string;
20
- readonly type = DaffProductActionTypes.ProductLoadAction;
21
- constructor(payload: string);
22
- }
23
- /**
24
- * An action called when a request for a Product succeeded.
25
- *
26
- * @param payload - A Product
27
- */
28
- export declare class DaffProductLoadSuccess<T extends DaffProduct = DaffProduct> implements Action {
29
- payload: DaffProductDriverResponse<T>;
30
- readonly type = DaffProductActionTypes.ProductLoadSuccessAction;
31
- constructor(payload: DaffProductDriverResponse<T>);
32
- }
33
- /**
34
- * An action called when a request for a Product failed.
35
- *
36
- * @param payload - An error message
37
- */
38
- export declare class DaffProductLoadFailure implements Action {
39
- payload: DaffStateError;
40
- readonly type = DaffProductActionTypes.ProductLoadFailureAction;
41
- constructor(payload: DaffStateError);
42
- }
43
- export type DaffProductActions<T extends DaffProduct = DaffProduct> = DaffProductLoad | DaffProductLoadSuccess<T> | DaffProductLoadFailure;
@@ -1,3 +0,0 @@
1
- export * from './product-grid.actions';
2
- export * from './product.actions';
3
- export * from './product-page.actions';
@@ -1,27 +0,0 @@
1
- import { Actions } from '@ngrx/effects';
2
- import { Observable } from 'rxjs';
3
- import { ErrorTransformer } from '@daffodil/core/state';
4
- import { DaffProduct } from '@daffodil/product';
5
- import { DaffProductServiceInterface } from '@daffodil/product/driver';
6
- import * as i0 from "@angular/core";
7
- /**
8
- * Effects for handling product grid actions and for triggering corresponding service requests.
9
- *
10
- * @param action$ - Redux action object
11
- * @param driver - A product service driver
12
- */
13
- export declare class DaffProductGridEffects<T extends DaffProduct> {
14
- private actions$;
15
- private driver;
16
- private errorMatcher;
17
- constructor(actions$: Actions, driver: DaffProductServiceInterface<T>, errorMatcher: ErrorTransformer);
18
- /**
19
- * Handles ProductGridLoadAction by making a service call for products and returning a success or failure action
20
- * to the action stream.
21
- *
22
- * @returns An Observable of a DaffProductGridAction
23
- */
24
- loadAll$: Observable<any>;
25
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffProductGridEffects<any>, never>;
26
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffProductGridEffects<any>>;
27
- }