@daffodil/product 0.38.9 → 0.39.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 (257) hide show
  1. package/bundles/daffodil-product-driver-in-memory.umd.js +77 -160
  2. package/bundles/daffodil-product-driver-in-memory.umd.js.map +1 -1
  3. package/bundles/daffodil-product-driver-in-memory.umd.min.js +1 -1
  4. package/bundles/daffodil-product-driver-in-memory.umd.min.js.map +1 -1
  5. package/bundles/daffodil-product-driver-magento-testing.umd.js +12 -140
  6. package/bundles/daffodil-product-driver-magento-testing.umd.js.map +1 -1
  7. package/bundles/daffodil-product-driver-magento-testing.umd.min.js +1 -1
  8. package/bundles/daffodil-product-driver-magento-testing.umd.min.js.map +1 -1
  9. package/bundles/daffodil-product-driver-magento.umd.js +87 -676
  10. package/bundles/daffodil-product-driver-magento.umd.js.map +1 -1
  11. package/bundles/daffodil-product-driver-magento.umd.min.js +2 -2
  12. package/bundles/daffodil-product-driver-magento.umd.min.js.map +1 -1
  13. package/bundles/daffodil-product-driver-shopify.umd.js +14 -160
  14. package/bundles/daffodil-product-driver-shopify.umd.js.map +1 -1
  15. package/bundles/daffodil-product-driver-shopify.umd.min.js +1 -1
  16. package/bundles/daffodil-product-driver-shopify.umd.min.js.map +1 -1
  17. package/bundles/daffodil-product-driver-testing.umd.js +4 -62
  18. package/bundles/daffodil-product-driver-testing.umd.js.map +1 -1
  19. package/bundles/daffodil-product-driver-testing.umd.min.js +1 -1
  20. package/bundles/daffodil-product-driver-testing.umd.min.js.map +1 -1
  21. package/bundles/daffodil-product-driver.umd.js +12 -64
  22. package/bundles/daffodil-product-driver.umd.js.map +1 -1
  23. package/bundles/daffodil-product-routing.umd.js +4 -112
  24. package/bundles/daffodil-product-routing.umd.js.map +1 -1
  25. package/bundles/daffodil-product-routing.umd.min.js +1 -1
  26. package/bundles/daffodil-product-routing.umd.min.js.map +1 -1
  27. package/bundles/daffodil-product-state-testing.umd.js +15 -240
  28. package/bundles/daffodil-product-state-testing.umd.js.map +1 -1
  29. package/bundles/daffodil-product-state-testing.umd.min.js +1 -1
  30. package/bundles/daffodil-product-state-testing.umd.min.js.map +1 -1
  31. package/bundles/daffodil-product-state.umd.js +347 -2359
  32. package/bundles/daffodil-product-state.umd.js.map +1 -1
  33. package/bundles/daffodil-product-state.umd.min.js +1 -1
  34. package/bundles/daffodil-product-state.umd.min.js.map +1 -1
  35. package/bundles/daffodil-product-testing.umd.js +20 -230
  36. package/bundles/daffodil-product-testing.umd.js.map +1 -1
  37. package/bundles/daffodil-product-testing.umd.min.js +1 -1
  38. package/bundles/daffodil-product-testing.umd.min.js.map +1 -1
  39. package/bundles/daffodil-product.umd.js +21 -209
  40. package/bundles/daffodil-product.umd.js.map +1 -1
  41. package/bundles/daffodil-product.umd.min.js +1 -1
  42. package/bundles/daffodil-product.umd.min.js.map +1 -1
  43. package/driver/in-memory/backend/product.service.d.ts +3 -2
  44. package/driver/in-memory/daffodil-product-driver-in-memory.metadata.json +1 -1
  45. package/driver/in-memory/package.json +1 -1
  46. package/driver/magento/package.json +1 -1
  47. package/driver/magento/testing/package.json +1 -1
  48. package/driver/package.json +1 -1
  49. package/driver/shopify/package.json +1 -1
  50. package/driver/testing/package.json +1 -1
  51. package/esm2015/daffodil-product.js +2 -7
  52. package/esm2015/driver/daffodil-product-driver.js +2 -7
  53. package/esm2015/driver/in-memory/backend/product.service.js +62 -83
  54. package/esm2015/driver/in-memory/daffodil-product-driver-in-memory.js +2 -7
  55. package/esm2015/driver/in-memory/driver/product-driver.module.js +1 -9
  56. package/esm2015/driver/in-memory/driver/product.service.js +11 -53
  57. package/esm2015/driver/in-memory/index.js +2 -7
  58. package/esm2015/driver/in-memory/public_api.js +1 -6
  59. package/esm2015/driver/index.js +2 -7
  60. package/esm2015/driver/interfaces/product-service.interface.js +1 -39
  61. package/esm2015/driver/magento/config/default.js +2 -8
  62. package/esm2015/driver/magento/config/public_api.js +1 -6
  63. package/esm2015/driver/magento/daffodil-product-driver-magento.js +2 -7
  64. package/esm2015/driver/magento/index.js +2 -7
  65. package/esm2015/driver/magento/injection-tokens/fragments/product-preview.token.js +7 -22
  66. package/esm2015/driver/magento/injection-tokens/fragments/product.token.js +5 -20
  67. package/esm2015/driver/magento/injection-tokens/public_api.js +1 -6
  68. package/esm2015/driver/magento/injection-tokens/transforms/product-preview/preview-extra.token.js +6 -21
  69. package/esm2015/driver/magento/injection-tokens/transforms/product-preview/preview.token.js +4 -24
  70. package/esm2015/driver/magento/injection-tokens/transforms/product-response/response-extra.token.js +5 -20
  71. package/esm2015/driver/magento/injection-tokens/transforms/product-response/response.token.js +4 -25
  72. package/esm2015/driver/magento/interfaces/config.interface.js +3 -38
  73. package/esm2015/driver/magento/interfaces/product-preview-extra-transform.type.js +2 -6
  74. package/esm2015/driver/magento/interfaces/product-preview-transform.type.js +2 -6
  75. package/esm2015/driver/magento/interfaces/product-response-extra-transform.type.js +2 -6
  76. package/esm2015/driver/magento/interfaces/product-response-transform.type.js +2 -6
  77. package/esm2015/driver/magento/interfaces/public_api.js +6 -11
  78. package/esm2015/driver/magento/models/bundled-product.js +9 -65
  79. package/esm2015/driver/magento/models/configurable-product.js +2 -72
  80. package/esm2015/driver/magento/models/get-product-response.interface.js +2 -16
  81. package/esm2015/driver/magento/models/magento-product.js +7 -38
  82. package/esm2015/driver/magento/models/product-preview.interface.js +6 -40
  83. package/esm2015/driver/magento/models/public_api.js +4 -9
  84. package/esm2015/driver/magento/models/simple-product.js +2 -18
  85. package/esm2015/driver/magento/product-driver.module.js +3 -12
  86. package/esm2015/driver/magento/product.service.js +7 -78
  87. package/esm2015/driver/magento/public_api.js +7 -12
  88. package/esm2015/driver/magento/queries/fragments/bundled-product.js +2 -8
  89. package/esm2015/driver/magento/queries/fragments/configurable-product.js +1 -7
  90. package/esm2015/driver/magento/queries/fragments/product-preview.js +1 -7
  91. package/esm2015/driver/magento/queries/fragments/product.js +1 -7
  92. package/esm2015/driver/magento/queries/fragments/simple-product.js +1 -7
  93. package/esm2015/driver/magento/queries/get-all-products.js +3 -14
  94. package/esm2015/driver/magento/queries/get-product-by-url.js +3 -14
  95. package/esm2015/driver/magento/queries/get-product.js +3 -14
  96. package/esm2015/driver/magento/queries/public_api.js +4 -9
  97. package/esm2015/driver/magento/testing/daffodil-product-driver-magento-testing.js +2 -7
  98. package/esm2015/driver/magento/testing/factories/bundle/bundle.factory.js +4 -15
  99. package/esm2015/driver/magento/testing/factories/configurable/configurable.factory.js +3 -46
  100. package/esm2015/driver/magento/testing/factories/core/product-preview.factory.js +2 -29
  101. package/esm2015/driver/magento/testing/factories/core/product.factory.js +3 -46
  102. package/esm2015/driver/magento/testing/factories/public_api.js +6 -11
  103. package/esm2015/driver/magento/testing/factories/simple/simple.factory.js +3 -12
  104. package/esm2015/driver/magento/testing/index.js +2 -7
  105. package/esm2015/driver/magento/testing/public_api.js +2 -7
  106. package/esm2015/driver/magento/transforms/bundled-product-transformers.js +4 -25
  107. package/esm2015/driver/magento/transforms/configurable-product-transformers.js +4 -38
  108. package/esm2015/driver/magento/transforms/product-preview.js +5 -35
  109. package/esm2015/driver/magento/transforms/product-response.js +2 -23
  110. package/esm2015/driver/magento/transforms/product-transformers.js +5 -32
  111. package/esm2015/driver/magento/transforms/public_api.js +7 -12
  112. package/esm2015/driver/magento/transforms/simple-product-transformers.js +3 -31
  113. package/esm2015/driver/magento/transforms/truncate-url.js +2 -12
  114. package/esm2015/driver/models/public_api.js +2 -6
  115. package/esm2015/driver/models/response.interface.js +2 -28
  116. package/esm2015/driver/public_api.js +2 -7
  117. package/esm2015/driver/shopify/daffodil-product-driver-shopify.js +2 -7
  118. package/esm2015/driver/shopify/index.js +2 -7
  119. package/esm2015/driver/shopify/product-driver.module.js +2 -10
  120. package/esm2015/driver/shopify/product.service.js +12 -132
  121. package/esm2015/driver/shopify/public_api.js +1 -6
  122. package/esm2015/driver/testing/daffodil-product-driver-testing.js +2 -7
  123. package/esm2015/driver/testing/drivers/product-driver.module.js +2 -10
  124. package/esm2015/driver/testing/drivers/product.service.js +3 -39
  125. package/esm2015/driver/testing/index.js +2 -7
  126. package/esm2015/driver/testing/public_api.js +1 -6
  127. package/esm2015/helpers.js +7 -22
  128. package/esm2015/index.js +2 -7
  129. package/esm2015/injection-tokens/error-matcher.token.js +3 -12
  130. package/esm2015/injection-tokens/public_api.js +1 -6
  131. package/esm2015/models/composite-configuration-item.js +2 -25
  132. package/esm2015/models/composite-product-item.js +8 -62
  133. package/esm2015/models/composite-product.js +2 -25
  134. package/esm2015/models/configurable-product.js +2 -125
  135. package/esm2015/models/prices.js +2 -45
  136. package/esm2015/models/product-image.js +2 -18
  137. package/esm2015/models/product.js +8 -105
  138. package/esm2015/public_api.js +10 -15
  139. package/esm2015/routing/daffodil-product-routing.js +2 -7
  140. package/esm2015/routing/index.js +2 -7
  141. package/esm2015/routing/public_api.js +2 -7
  142. package/esm2015/routing/resolvers/product-page/product-page.resolver.js +2 -21
  143. package/esm2015/routing/resolvers/product-page-id/product-page-id.resolver.js +2 -33
  144. package/esm2015/routing/resolvers/product-page-url/product-page-url.resolver.js +2 -40
  145. package/esm2015/routing/resolvers/public_api.js +1 -6
  146. package/esm2015/state/actions/best-sellers.actions.js +9 -39
  147. package/esm2015/state/actions/composite-product.actions.js +9 -29
  148. package/esm2015/state/actions/configurable-product.actions.js +8 -56
  149. package/esm2015/state/actions/product-grid.actions.js +9 -39
  150. package/esm2015/state/actions/product-page.actions.js +10 -60
  151. package/esm2015/state/actions/product.actions.js +8 -39
  152. package/esm2015/state/actions/public_api.js +7 -12
  153. package/esm2015/state/daffodil-product-state.js +2 -7
  154. package/esm2015/state/effects/best-seller.effects.js +4 -52
  155. package/esm2015/state/effects/product-grid.effects.js +4 -52
  156. package/esm2015/state/effects/product-page.effects.js +6 -68
  157. package/esm2015/state/effects/product.effects.js +4 -52
  158. package/esm2015/state/effects/public_api.js +1 -6
  159. package/esm2015/state/facades/best-sellers/best-sellers.facade.js +4 -31
  160. package/esm2015/state/facades/composite-product/composite-product-facade.interface.js +2 -86
  161. package/esm2015/state/facades/composite-product/composite-product.facade.js +4 -61
  162. package/esm2015/state/facades/configurable-product/configurable-product-facade.interface.js +2 -108
  163. package/esm2015/state/facades/configurable-product/configurable-product.facade.js +4 -78
  164. package/esm2015/state/facades/product/product-facade.interface.js +2 -70
  165. package/esm2015/state/facades/product/product.facade.js +3 -58
  166. package/esm2015/state/facades/product-grid/product-grid-facade.interface.js +2 -23
  167. package/esm2015/state/facades/product-grid/product-grid.facade.js +3 -27
  168. package/esm2015/state/facades/product-page/facade.interface.js +2 -24
  169. package/esm2015/state/facades/product-page/facade.js +3 -32
  170. package/esm2015/state/facades/public_api.js +1 -6
  171. package/esm2015/state/index.js +2 -7
  172. package/esm2015/state/product-state.module.js +1 -6
  173. package/esm2015/state/public_api.js +6 -11
  174. package/esm2015/state/reducers/best-sellers/best-sellers-reducer-state.interface.js +2 -28
  175. package/esm2015/state/reducers/best-sellers/best-sellers.reducer.js +3 -24
  176. package/esm2015/state/reducers/composite-product-entities/composite-product-entities-reducer-adapter.js +5 -18
  177. package/esm2015/state/reducers/composite-product-entities/composite-product-entities.reducer.js +12 -46
  178. package/esm2015/state/reducers/composite-product-entities/composite-product-entity.js +2 -25
  179. package/esm2015/state/reducers/configurable-product-entities/configurable-product-entities-reducer-adapter.js +4 -17
  180. package/esm2015/state/reducers/configurable-product-entities/configurable-product-entities.reducer.js +11 -67
  181. package/esm2015/state/reducers/configurable-product-entities/configurable-product-entity.js +2 -40
  182. package/esm2015/state/reducers/injection-tokens/config.token.js +4 -13
  183. package/esm2015/state/reducers/injection-tokens/meta.token.js +5 -21
  184. package/esm2015/state/reducers/injection-tokens/public_api.js +1 -6
  185. package/esm2015/state/reducers/product/product-reducer-state.interface.js +2 -33
  186. package/esm2015/state/reducers/product/product.reducer.js +4 -11
  187. package/esm2015/state/reducers/product-entities/product-entities-reducer-adapter.js +4 -18
  188. package/esm2015/state/reducers/product-entities/product-entities.reducer.js +4 -11
  189. package/esm2015/state/reducers/product-grid/product-grid-reducer-state.interface.js +2 -29
  190. package/esm2015/state/reducers/product-grid/product-grid.reducer.js +4 -11
  191. package/esm2015/state/reducers/product-reducers-state.interface.js +1 -35
  192. package/esm2015/state/reducers/product-reducers.js +1 -7
  193. package/esm2015/state/reducers/product-store-feature-key.js +1 -7
  194. package/esm2015/state/reducers/public_api.js +3 -8
  195. package/esm2015/state/selectors/all-selectors.selectors.js +3 -19
  196. package/esm2015/state/selectors/best-sellers/best-sellers.selectors.js +12 -84
  197. package/esm2015/state/selectors/composite-product/composite-product.selectors.js +48 -254
  198. package/esm2015/state/selectors/composite-product-entities/composite-product-entities.selectors.js +16 -122
  199. package/esm2015/state/selectors/configurable-product/configurable-product.selectors.js +41 -387
  200. package/esm2015/state/selectors/configurable-product-entities/configurable-product-entities.selectors.js +12 -106
  201. package/esm2015/state/selectors/product/product.selectors.js +12 -80
  202. package/esm2015/state/selectors/product-entities/product-entities.selectors.js +16 -191
  203. package/esm2015/state/selectors/product-feature.selector.js +5 -29
  204. package/esm2015/state/selectors/product-grid/product-grid.selectors.js +10 -57
  205. package/esm2015/state/selectors/public_api.js +11 -16
  206. package/esm2015/state/testing/daffodil-product-state-testing.js +2 -7
  207. package/esm2015/state/testing/index.js +2 -7
  208. package/esm2015/state/testing/mock-best-sellers.facade.js +3 -18
  209. package/esm2015/state/testing/mock-composite-product-facade.js +4 -52
  210. package/esm2015/state/testing/mock-configurable-product-facade.js +4 -65
  211. package/esm2015/state/testing/mock-product-facade.js +3 -53
  212. package/esm2015/state/testing/mock-product-grid-facade.js +3 -19
  213. package/esm2015/state/testing/mock-product-page-facade.js +3 -19
  214. package/esm2015/state/testing/product-testing.module.js +1 -6
  215. package/esm2015/state/testing/public_api.js +1 -6
  216. package/esm2015/testing/daffodil-product-testing.js +2 -7
  217. package/esm2015/testing/factories/composite-product.factory.js +3 -14
  218. package/esm2015/testing/factories/configurable-product.factory.js +2 -45
  219. package/esm2015/testing/factories/default-product.factory.js +2 -53
  220. package/esm2015/testing/factories/extension.factory.js +3 -30
  221. package/esm2015/testing/factories/kind.factory.js +2 -23
  222. package/esm2015/testing/factories/product-image.factory.js +2 -16
  223. package/esm2015/testing/factories/public_api.js +7 -12
  224. package/esm2015/testing/helpers.js +2 -8
  225. package/esm2015/testing/index.js +2 -7
  226. package/esm2015/testing/injection-tokens/factories/extra.token.js +6 -22
  227. package/esm2015/testing/injection-tokens/factories/type.token.js +5 -21
  228. package/esm2015/testing/injection-tokens/public_api.js +1 -6
  229. package/esm2015/testing/public_api.js +4 -9
  230. package/esm2015/testing/testing.module.js +1 -6
  231. package/fesm2015/daffodil-product-driver-in-memory.js +73 -158
  232. package/fesm2015/daffodil-product-driver-in-memory.js.map +1 -1
  233. package/fesm2015/daffodil-product-driver-magento-testing.js +12 -165
  234. package/fesm2015/daffodil-product-driver-magento-testing.js.map +1 -1
  235. package/fesm2015/daffodil-product-driver-magento.js +81 -801
  236. package/fesm2015/daffodil-product-driver-magento.js.map +1 -1
  237. package/fesm2015/daffodil-product-driver-shopify.js +14 -156
  238. package/fesm2015/daffodil-product-driver-shopify.js.map +1 -1
  239. package/fesm2015/daffodil-product-driver-testing.js +5 -63
  240. package/fesm2015/daffodil-product-driver-testing.js.map +1 -1
  241. package/fesm2015/daffodil-product-driver.js +1 -59
  242. package/fesm2015/daffodil-product-driver.js.map +1 -1
  243. package/fesm2015/daffodil-product-routing.js +5 -113
  244. package/fesm2015/daffodil-product-routing.js.map +1 -1
  245. package/fesm2015/daffodil-product-state-testing.js +16 -241
  246. package/fesm2015/daffodil-product-state-testing.js.map +1 -1
  247. package/fesm2015/daffodil-product-state.js +294 -2412
  248. package/fesm2015/daffodil-product-state.js.map +1 -1
  249. package/fesm2015/daffodil-product-testing.js +20 -256
  250. package/fesm2015/daffodil-product-testing.js.map +1 -1
  251. package/fesm2015/daffodil-product.js +23 -454
  252. package/fesm2015/daffodil-product.js.map +1 -1
  253. package/package.json +3 -3
  254. package/routing/package.json +1 -1
  255. package/state/package.json +1 -1
  256. package/state/testing/package.json +1 -1
  257. package/testing/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { Injectable, ɵɵdefineInjectable, ɵɵinject, NgModule } from '@angular/core';
1
+ import { ɵɵdefineInjectable, ɵɵinject, Injectable, NgModule } from '@angular/core';
2
2
  import { STATUS } from 'angular-in-memory-web-api';
3
3
  import { DaffProductExtensionFactory, DaffProductImageFactory, DaffProductTestingModule } from '@daffodil/product/testing';
4
4
  import { HttpClient } from '@angular/common/http';
@@ -6,71 +6,70 @@ import { map } from 'rxjs/operators';
6
6
  import { CommonModule } from '@angular/common';
7
7
  import { DaffProductDriver } from '@daffodil/product/driver';
8
8
 
9
- /**
10
- * @fileoverview added by tsickle
11
- * Generated from: backend/product.service.ts
12
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
13
- */
14
9
  /**
15
10
  * An in-memory service that stubs out the backend services for getting products.
16
11
  *
17
- * \@Param productFactory: DaffProductFactory instance
18
- * \@Param productImageFactory: DaffProductImageFactory instance
19
- * \@Param products: An array of Products
12
+ * @Param productFactory: DaffProductFactory instance
13
+ * @Param productImageFactory: DaffProductImageFactory instance
14
+ * @Param products: An array of Products
20
15
  */
21
16
  class DaffInMemoryBackendProductService {
22
- /**
23
- * @param {?} productFactory
24
- * @param {?} productImageFactory
25
- */
26
17
  constructor(productFactory, productImageFactory) {
27
18
  this.productFactory = productFactory;
28
19
  this.productImageFactory = productImageFactory;
29
- this.products = [
30
- this.productFactory.create({ id: '1001', url: '1001', images: this.productImageFactory.createMany(5) }),
31
- this.productFactory.create({ id: '1002', url: '1002', images: this.productImageFactory.createMany(5) }),
32
- this.productFactory.create({ id: '1003', url: '1003', images: this.productImageFactory.createMany(5) }),
33
- this.productFactory.create({ id: '1004', url: '1004', images: this.productImageFactory.createMany(5) }),
34
- this.productFactory.create({ id: '1005', url: '1005', images: this.productImageFactory.createMany(5) }),
35
- this.productFactory.create({ id: '1006', url: '1006', images: this.productImageFactory.createMany(5) }),
36
- this.productFactory.create({ id: '1007', url: '1007', images: this.productImageFactory.createMany(5) }),
37
- this.productFactory.create({ id: '1008', url: '1008', images: this.productImageFactory.createMany(5) }),
38
- this.productFactory.create({ id: '1009', url: '1009', images: this.productImageFactory.createMany(5) }),
39
- this.productFactory.create({ id: '1010', url: '1010', images: this.productImageFactory.createMany(5) }),
40
- this.productFactory.create({ id: '1011', url: '1011', images: this.productImageFactory.createMany(5) }),
41
- this.productFactory.create({ id: '1012', url: '1012', images: this.productImageFactory.createMany(5) }),
42
- this.productFactory.create({ id: '1013', url: '1013', images: this.productImageFactory.createMany(5) }),
43
- this.productFactory.create({ id: '1014', url: '1014', images: this.productImageFactory.createMany(5) }),
44
- this.productFactory.create({ id: '1015', url: '1015', images: this.productImageFactory.createMany(5) }),
45
- this.productFactory.create({ id: '1016', url: '1016', images: this.productImageFactory.createMany(5) }),
46
- this.productFactory.create({ id: '1017', url: '1017', images: this.productImageFactory.createMany(5) }),
47
- this.productFactory.create({ id: '1018', url: '1018', images: this.productImageFactory.createMany(5) }),
48
- this.productFactory.create({ id: '1019', url: '1019', images: this.productImageFactory.createMany(5) }),
49
- this.productFactory.create({ id: '1020', url: '1020', images: this.productImageFactory.createMany(5) }),
50
- this.productFactory.create({ id: '1021', url: '1021', images: this.productImageFactory.createMany(5) }),
51
- this.productFactory.create({ id: '1022', url: '1022', images: this.productImageFactory.createMany(5) }),
52
- this.productFactory.create({ id: '1023', url: '1023', images: this.productImageFactory.createMany(5) }),
53
- this.productFactory.create({ id: '1024', url: '1024', images: this.productImageFactory.createMany(5) }),
54
- this.productFactory.create({ id: '1025', url: '1025', images: this.productImageFactory.createMany(5) }),
55
- this.productFactory.create({ id: '1026', url: '1026', images: this.productImageFactory.createMany(5) }),
56
- this.productFactory.create({ id: '1027', url: '1027', images: this.productImageFactory.createMany(5) }),
57
- this.productFactory.create({ id: '1028', url: '1028', images: this.productImageFactory.createMany(5) }),
58
- this.productFactory.create({ id: '1029', url: '1029', images: this.productImageFactory.createMany(5) }),
59
- this.productFactory.create({ id: '1030', url: '1030', images: this.productImageFactory.createMany(5) }),
60
- this.productFactory.create({ id: '1031', url: '1031', images: this.productImageFactory.createMany(5) }),
61
- this.productFactory.create({ id: '1032', url: '1032', images: this.productImageFactory.createMany(5) }),
62
- this.productFactory.create({ id: '1033', url: '1033', images: this.productImageFactory.createMany(5) }),
63
- this.productFactory.create({ id: '1034', url: '1034', images: this.productImageFactory.createMany(5) }),
64
- this.productFactory.create({ id: '1035', url: '1035', images: this.productImageFactory.createMany(5) }),
65
- ];
20
+ this._products = [];
21
+ this._products = [
22
+ '1001',
23
+ '1002',
24
+ '1003',
25
+ '1004',
26
+ '1005',
27
+ '1006',
28
+ '1007',
29
+ '1008',
30
+ '1009',
31
+ '1010',
32
+ '1011',
33
+ '1012',
34
+ '1013',
35
+ '1014',
36
+ '1015',
37
+ '1016',
38
+ '1017',
39
+ '1018',
40
+ '1019',
41
+ '1020',
42
+ '1021',
43
+ '1022',
44
+ '1023',
45
+ '1024',
46
+ '1025',
47
+ '1026',
48
+ '1027',
49
+ '1028',
50
+ '1029',
51
+ '1030',
52
+ '1031',
53
+ '1032',
54
+ '1033',
55
+ '1034',
56
+ '1035',
57
+ ].map(id => this.productFactory.create({ id, url: `/${id}`, images: this.productImageFactory.createMany(5) }));
58
+ }
59
+ /**
60
+ * The collection of products in the backend.
61
+ */
62
+ get products() {
63
+ return this._products;
66
64
  }
65
+ ;
67
66
  /**
68
67
  * Automatically called as part of the InMemoryDbService to parse incoming urls to match the InMemory backend urls.
69
68
  *
70
- * \@docs-private
71
- * @param {?} url initial url
72
- * @param {?} utils utility to parse url
73
- * @return {?} ParsedRequestUrl
69
+ * @param url initial url
70
+ * @param utils utility to parse url
71
+ * @returns ParsedRequestUrl
72
+ * @docs-private
74
73
  */
75
74
  parseRequestUrl(url, utils) {
76
75
  return utils.parseRequestUrl(url);
@@ -78,33 +77,31 @@ class DaffInMemoryBackendProductService {
78
77
  /**
79
78
  * Creates a fake database of products for the product inmemory backend service.
80
79
  *
81
- * \@docs-private
82
- * @return {?} A fake database of an array of products
80
+ * @returns A fake database of an array of products
81
+ * @docs-private
83
82
  */
84
83
  createDb() {
85
84
  return {
86
- products: this.products,
85
+ products: this._products,
87
86
  };
88
87
  }
89
88
  /**
90
89
  * Returns products based on the url given.
91
90
  *
92
- * @param {?} reqInfo request object
93
- * @return {?} An http response object
91
+ * @param reqInfo request object
92
+ * @returns An http response object
94
93
  */
95
94
  get(reqInfo) {
96
95
  if (reqInfo.id === 'best-sellers') {
97
- return reqInfo.utils.createResponse$((/**
98
- * @return {?}
99
- */
100
- () => ({
101
- body: this.products.slice(0, 4),
96
+ return reqInfo.utils.createResponse$(() => ({
97
+ body: this._products.slice(0, 4),
102
98
  status: STATUS.OK,
103
- })));
99
+ }));
104
100
  }
105
101
  return undefined;
106
102
  }
107
103
  }
104
+ /** @nocollapse */ DaffInMemoryBackendProductService.ɵprov = ɵɵdefineInjectable({ factory: function DaffInMemoryBackendProductService_Factory() { return new DaffInMemoryBackendProductService(ɵɵinject(DaffProductExtensionFactory), ɵɵinject(DaffProductImageFactory)); }, token: DaffInMemoryBackendProductService, providedIn: "root" });
108
105
  DaffInMemoryBackendProductService.decorators = [
109
106
  { type: Injectable, args: [{
110
107
  providedIn: 'root',
@@ -115,88 +112,41 @@ DaffInMemoryBackendProductService.ctorParameters = () => [
115
112
  { type: DaffProductExtensionFactory },
116
113
  { type: DaffProductImageFactory }
117
114
  ];
118
- /** @nocollapse */ DaffInMemoryBackendProductService.ɵprov = ɵɵdefineInjectable({ factory: function DaffInMemoryBackendProductService_Factory() { return new DaffInMemoryBackendProductService(ɵɵinject(DaffProductExtensionFactory), ɵɵinject(DaffProductImageFactory)); }, token: DaffInMemoryBackendProductService, providedIn: "root" });
119
- if (false) {
120
- /**
121
- * \@docs-private
122
- * @type {?}
123
- */
124
- DaffInMemoryBackendProductService.prototype.products;
125
- /**
126
- * @type {?}
127
- * @private
128
- */
129
- DaffInMemoryBackendProductService.prototype.productFactory;
130
- /**
131
- * @type {?}
132
- * @private
133
- */
134
- DaffInMemoryBackendProductService.prototype.productImageFactory;
135
- }
136
115
 
137
- /**
138
- * @fileoverview added by tsickle
139
- * Generated from: driver/product.service.ts
140
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
141
- */
142
116
  /**
143
117
  * The product inmemory driver to mock the product backend service.
144
118
  *
145
- * \@inheritdoc
146
- * \@Param HttpClient
119
+ * @inheritdoc
120
+ * @Param HttpClient
147
121
  */
148
122
  class DaffInMemoryProductService {
149
- /**
150
- * @param {?} http
151
- */
152
123
  constructor(http) {
153
124
  this.http = http;
154
125
  /**
155
- * \@docs-private
126
+ * @docs-private
156
127
  */
157
- this.url = '/api/products/';
128
+ this.url = '/api/products';
158
129
  }
159
- /**
160
- * @return {?}
161
- */
162
130
  getAll() {
163
131
  return this.http.get(this.url);
164
132
  }
165
- /**
166
- * @return {?}
167
- */
168
133
  getBestSellers() {
169
- return this.http.get(this.url + 'best-sellers');
134
+ return this.http.get(`${this.url}/best-sellers`);
170
135
  }
171
- /**
172
- * @param {?} productId
173
- * @return {?}
174
- */
175
136
  get(productId) {
176
- return this.http.get(this.url + productId).pipe(map((/**
177
- * @param {?} product
178
- * @return {?}
179
- */
180
- product => ({
137
+ return this.http.get(`${this.url}/${productId}`).pipe(map(product => ({
181
138
  id: productId,
182
139
  products: [product],
183
- }))));
140
+ })));
184
141
  }
185
- /**
186
- * @param {?} url
187
- * @return {?}
188
- */
189
142
  getByUrl(url) {
190
- return this.http.get(`${this.url}${url}`).pipe(map((/**
191
- * @param {?} product
192
- * @return {?}
193
- */
194
- product => ({
143
+ return this.http.get(`${this.url}${url}`).pipe(map(product => ({
195
144
  id: product.id,
196
145
  products: [product],
197
- }))));
146
+ })));
198
147
  }
199
148
  }
149
+ /** @nocollapse */ DaffInMemoryProductService.ɵprov = ɵɵdefineInjectable({ factory: function DaffInMemoryProductService_Factory() { return new DaffInMemoryProductService(ɵɵinject(HttpClient)); }, token: DaffInMemoryProductService, providedIn: "root" });
200
150
  DaffInMemoryProductService.decorators = [
201
151
  { type: Injectable, args: [{
202
152
  providedIn: 'root',
@@ -206,32 +156,11 @@ DaffInMemoryProductService.decorators = [
206
156
  DaffInMemoryProductService.ctorParameters = () => [
207
157
  { type: HttpClient }
208
158
  ];
209
- /** @nocollapse */ DaffInMemoryProductService.ɵprov = ɵɵdefineInjectable({ factory: function DaffInMemoryProductService_Factory() { return new DaffInMemoryProductService(ɵɵinject(HttpClient)); }, token: DaffInMemoryProductService, providedIn: "root" });
210
- if (false) {
211
- /**
212
- * \@docs-private
213
- * @type {?}
214
- */
215
- DaffInMemoryProductService.prototype.url;
216
- /**
217
- * @type {?}
218
- * @private
219
- */
220
- DaffInMemoryProductService.prototype.http;
221
- }
222
159
 
223
- /**
224
- * @fileoverview added by tsickle
225
- * Generated from: driver/product-driver.module.ts
226
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
227
- */
228
160
  /**
229
161
  * Module for providing the DaffInMemoryProductService driver to your application.
230
162
  */
231
163
  class DaffProductInMemoryDriverModule {
232
- /**
233
- * @return {?}
234
- */
235
164
  static forRoot() {
236
165
  return {
237
166
  ngModule: DaffProductInMemoryDriverModule,
@@ -254,21 +183,7 @@ DaffProductInMemoryDriverModule.decorators = [
254
183
  ];
255
184
 
256
185
  /**
257
- * @fileoverview added by tsickle
258
- * Generated from: public_api.ts
259
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
260
- */
261
-
262
- /**
263
- * @fileoverview added by tsickle
264
- * Generated from: index.ts
265
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
266
- */
267
-
268
- /**
269
- * @fileoverview added by tsickle
270
- * Generated from: daffodil-product-driver-in-memory.ts
271
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
186
+ * Generated bundle index. Do not edit.
272
187
  */
273
188
 
274
189
  export { DaffInMemoryBackendProductService, DaffInMemoryProductService, DaffProductInMemoryDriverModule };
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-product-driver-in-memory.js","sources":["../../../libs/product/driver/in-memory/src/backend/product.service.ts","../../../libs/product/driver/in-memory/src/driver/product.service.ts","../../../libs/product/driver/in-memory/src/driver/product-driver.module.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n InMemoryDbService,\n RequestInfoUtilities,\n ParsedRequestUrl,\n STATUS,\n} from 'angular-in-memory-web-api';\n\nimport { DaffProduct } from '@daffodil/product';\nimport {\n DaffProductImageFactory,\n DaffProductExtensionFactory,\n} from '@daffodil/product/testing';\n\n/**\n * An in-memory service that stubs out the backend services for getting products.\n *\n * @Param productFactory: DaffProductFactory instance\n * @Param productImageFactory: DaffProductImageFactory instance\n * @Param products: An array of Products\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryBackendProductService implements InMemoryDbService {\n /**\n * @docs-private\n */\n products: DaffProduct[];\n\n constructor(\n private productFactory: DaffProductExtensionFactory,\n private productImageFactory: DaffProductImageFactory) {\n this.products = [\n this.productFactory.create({ id: '1001', url: '1001', images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ id: '1002', url: '1002', images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ id: '1003', url: '1003', images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ id: '1004', url: '1004', images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ id: '1005', url: '1005', images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ id: '1006', url: '1006', images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ id: '1007', url: '1007', images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ id: '1008', url: '1008', images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ id: '1009', url: '1009', images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ id: '1010', url: '1010', images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ id: '1011', url: '1011', images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ id: '1012', url: '1012', images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ id: '1013', url: '1013', images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ id: '1014', url: '1014', images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ id: '1015', url: '1015', images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ id: '1016', url: '1016', images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ id: '1017', url: '1017', images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ id: '1018', url: '1018', images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ id: '1019', url: '1019', images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ id: '1020', url: '1020', images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ id: '1021', url: '1021', images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ id: '1022', url: '1022', images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ id: '1023', url: '1023', images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ id: '1024', url: '1024', images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ id: '1025', url: '1025', images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ id: '1026', url: '1026', images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ id: '1027', url: '1027', images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ id: '1028', url: '1028', images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ id: '1029', url: '1029', images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ id: '1030', url: '1030', images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ id: '1031', url: '1031', images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ id: '1032', url: '1032', images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ id: '1033', url: '1033', images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ id: '1034', url: '1034', images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ id: '1035', url: '1035', images: this.productImageFactory.createMany(5) }),\n ];\n }\n\n /**\n * Automatically called as part of the InMemoryDbService to parse incoming urls to match the InMemory backend urls.\n *\n * @param url initial url\n * @param utils utility to parse url\n * @returns ParsedRequestUrl\n * @docs-private\n */\n parseRequestUrl(url: string, utils: RequestInfoUtilities): ParsedRequestUrl {\n return utils.parseRequestUrl(url);\n }\n\n /**\n * Creates a fake database of products for the product inmemory backend service.\n *\n * @returns A fake database of an array of products\n * @docs-private\n */\n createDb(): any {\n return {\n products: this.products,\n };\n }\n\n /**\n * Returns products based on the url given.\n *\n * @param reqInfo request object\n * @returns An http response object\n */\n get(reqInfo: any) {\n if(reqInfo.id === 'best-sellers') {\n return reqInfo.utils.createResponse$(() => ({\n body: this.products.slice(0,4),\n status: STATUS.OK,\n }));\n }\n\n return undefined;\n }\n}\n","import { HttpClient } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\nimport { DaffProduct } from '@daffodil/product';\nimport {\n DaffProductDriverResponse,\n DaffProductServiceInterface,\n} from '@daffodil/product/driver';\n\n/**\n * The product inmemory driver to mock the product backend service.\n *\n * @inheritdoc\n * @Param HttpClient\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryProductService implements DaffProductServiceInterface {\n /**\n * @docs-private\n */\n url = '/api/products/';\n\n constructor(private http: HttpClient) {}\n\n getAll(): Observable<DaffProduct[]> {\n return this.http.get<DaffProduct[]>(this.url);\n }\n\n getBestSellers(): Observable<DaffProduct[]> {\n return this.http.get<DaffProduct[]>(this.url + 'best-sellers');\n }\n\n get(productId: DaffProduct['id']): Observable<DaffProductDriverResponse> {\n return this.http.get<DaffProduct>(this.url + productId).pipe(\n map(product => ({\n id: productId,\n products: [product],\n })),\n );\n }\n\n getByUrl(url: DaffProduct['url']): Observable<DaffProductDriverResponse> {\n return this.http.get<DaffProduct>(`${this.url}${url}`).pipe(\n map(product => ({\n id: product.id,\n products: [product],\n })),\n );\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { DaffProductDriver } from '@daffodil/product/driver';\nimport { DaffProductTestingModule } from '@daffodil/product/testing';\n\nimport { DaffInMemoryProductService } from './product.service';\n\n/**\n * Module for providing the DaffInMemoryProductService driver to your application.\n */\n@NgModule({\n imports: [\n CommonModule,\n DaffProductTestingModule,\n ],\n})\nexport class DaffProductInMemoryDriverModule {\n static forRoot(): ModuleWithProviders<DaffProductInMemoryDriverModule> {\n return {\n ngModule: DaffProductInMemoryDriverModule,\n providers: [\n {\n provide: DaffProductDriver,\n useExisting: DaffInMemoryProductService,\n },\n ],\n };\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;MAwBa,iCAAiC;;;;;IAM5C,YACU,cAA2C,EAC3C,mBAA4C;QAD5C,mBAAc,GAAd,cAAc,CAA6B;QAC3C,wBAAmB,GAAnB,mBAAmB,CAAyB;QACpD,IAAI,CAAC,QAAQ,GAAG;YACd,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;YACvG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;YACvG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,E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AE,iBAAiB;oBAC1B,WAAW,EAAE,0BAA0B;iBACxC;aACF;SACF,CAAC;KACH;;;YAjBF,QAAQ,SAAC;gBACR,OAAO,EAAE;oBACP,YAAY;oBACZ,wBAAwB;iBACzB;aACF;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"daffodil-product-driver-in-memory.js","sources":["../../../libs/product/driver/in-memory/src/backend/product.service.ts","../../../libs/product/driver/in-memory/src/driver/product.service.ts","../../../libs/product/driver/in-memory/src/driver/product-driver.module.ts","../../../libs/product/driver/in-memory/src/daffodil-product-driver-in-memory.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n InMemoryDbService,\n RequestInfoUtilities,\n ParsedRequestUrl,\n STATUS,\n} from 'angular-in-memory-web-api';\n\nimport { DaffProduct } from '@daffodil/product';\nimport {\n DaffProductImageFactory,\n DaffProductExtensionFactory,\n} from '@daffodil/product/testing';\n\n/**\n * An in-memory service that stubs out the backend services for getting products.\n *\n * @Param productFactory: DaffProductFactory instance\n * @Param productImageFactory: DaffProductImageFactory instance\n * @Param products: An array of Products\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryBackendProductService implements InMemoryDbService {\n protected _products: DaffProduct[] = [];\n\n /**\n * The collection of products in the backend.\n */\n get products(): DaffProduct[] {\n return this._products;\n };\n\n constructor(\n private productFactory: DaffProductExtensionFactory,\n private productImageFactory: DaffProductImageFactory) {\n this._products = [\n '1001',\n '1002',\n '1003',\n '1004',\n '1005',\n '1006',\n '1007',\n '1008',\n '1009',\n '1010',\n '1011',\n '1012',\n '1013',\n '1014',\n '1015',\n '1016',\n '1017',\n '1018',\n '1019',\n '1020',\n '1021',\n '1022',\n '1023',\n '1024',\n '1025',\n '1026',\n '1027',\n '1028',\n '1029',\n '1030',\n '1031',\n '1032',\n '1033',\n '1034',\n '1035',\n ].map(id => this.productFactory.create({ id, url: `/${id}`, images: this.productImageFactory.createMany(5) }));\n }\n\n /**\n * Automatically called as part of the InMemoryDbService to parse incoming urls to match the InMemory backend urls.\n *\n * @param url initial url\n * @param utils utility to parse url\n * @returns ParsedRequestUrl\n * @docs-private\n */\n parseRequestUrl(url: string, utils: RequestInfoUtilities): ParsedRequestUrl {\n return utils.parseRequestUrl(url);\n }\n\n /**\n * Creates a fake database of products for the product inmemory backend service.\n *\n * @returns A fake database of an array of products\n * @docs-private\n */\n createDb(): any {\n return {\n products: this._products,\n };\n }\n\n /**\n * Returns products based on the url given.\n *\n * @param reqInfo request object\n * @returns An http response object\n */\n get(reqInfo: any) {\n if(reqInfo.id === 'best-sellers') {\n return reqInfo.utils.createResponse$(() => ({\n body: this._products.slice(0,4),\n status: STATUS.OK,\n }));\n }\n\n return undefined;\n }\n}\n","import { HttpClient } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\nimport { DaffProduct } from '@daffodil/product';\nimport {\n DaffProductDriverResponse,\n DaffProductServiceInterface,\n} from '@daffodil/product/driver';\n\n/**\n * The product inmemory driver to mock the product backend service.\n *\n * @inheritdoc\n * @Param HttpClient\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryProductService implements DaffProductServiceInterface {\n /**\n * @docs-private\n */\n url = '/api/products';\n\n constructor(private http: HttpClient) {}\n\n getAll(): Observable<DaffProduct[]> {\n return this.http.get<DaffProduct[]>(this.url);\n }\n\n getBestSellers(): Observable<DaffProduct[]> {\n return this.http.get<DaffProduct[]>(`${this.url}/best-sellers`);\n }\n\n get(productId: DaffProduct['id']): Observable<DaffProductDriverResponse> {\n return this.http.get<DaffProduct>(`${this.url}/${productId}`).pipe(\n map(product => ({\n id: productId,\n products: [product],\n })),\n );\n }\n\n getByUrl(url: DaffProduct['url']): Observable<DaffProductDriverResponse> {\n return this.http.get<DaffProduct>(`${this.url}${url}`).pipe(\n map(product => ({\n id: product.id,\n products: [product],\n })),\n );\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { DaffProductDriver } from '@daffodil/product/driver';\nimport { DaffProductTestingModule } from '@daffodil/product/testing';\n\nimport { DaffInMemoryProductService } from './product.service';\n\n/**\n * Module for providing the DaffInMemoryProductService driver to your application.\n */\n@NgModule({\n imports: [\n CommonModule,\n DaffProductTestingModule,\n ],\n})\nexport class DaffProductInMemoryDriverModule {\n static forRoot(): ModuleWithProviders<DaffProductInMemoryDriverModule> {\n return {\n ngModule: DaffProductInMemoryDriverModule,\n providers: [\n {\n provide: DaffProductDriver,\n useExisting: DaffInMemoryProductService,\n },\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAcA;;;;;;;MAUa,iCAAiC;IAU5C,YACU,cAA2C,EAC3C,mBAA4C;QAD5C,mBAAc,GAAd,cAAc,CAA6B;QAC3C,wBAAmB,GAAnB,mBAAmB,CAAyB;QAX5C,cAAS,GAAkB,EAAE,CAAC;QAYtC,IAAI,CAAC,SAAS,GAAG;YACf,MAAM;YACN,MAAM;YACN,MAAM;YACN,MAAM;YACN,MAAM;YACN,MAAM;YACN,MAAM;YACN,MAAM;YACN,MAAM;YACN,MAAM;YACN,MAAM;YACN,MAAM;YACN,MAAM;YACN,MAAM;YACN,MAAM;YACN,MAAM;YACN,MAAM;YACN,MAAM;YACN,MAAM;YACN,MAAM;YACN,MAAM;YACN,MAAM;YACN,MAAM;YACN,MAAM;YACN,MAAM;YACN,MAAM;YACN,MAAM;YACN,MAAM;YACN,MAAM;YACN,MAAM;YACN,MAAM;YACN,MAAM;YACN,MAAM;YACN,MAAM;YACN,MAAM;SACP,CAAC,GAAG,CAAC,EAAE,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC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