@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
@@ -4,71 +4,75 @@
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.daffodil = global.daffodil || {}, global.daffodil.product = global.daffodil.product || {}, global.daffodil.product.driver = global.daffodil.product.driver || {}, global.daffodil.product.driver['in-memory'] = {}), global.ng.core, global.angularInMemoryWebApi, global.daffodil.product.testing, global.ng.common.http, global.rxjs.operators, global.ng.common, global.daffodil.product.driver));
5
5
  }(this, (function (exports, i0, angularInMemoryWebApi, i1, i1$1, operators, common, driver) { 'use strict';
6
6
 
7
- /**
8
- * @fileoverview added by tsickle
9
- * Generated from: backend/product.service.ts
10
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
11
- */
12
7
  /**
13
8
  * An in-memory service that stubs out the backend services for getting products.
14
9
  *
15
- * \@Param productFactory: DaffProductFactory instance
16
- * \@Param productImageFactory: DaffProductImageFactory instance
17
- * \@Param products: An array of Products
10
+ * @Param productFactory: DaffProductFactory instance
11
+ * @Param productImageFactory: DaffProductImageFactory instance
12
+ * @Param products: An array of Products
18
13
  */
19
14
  var DaffInMemoryBackendProductService = /** @class */ (function () {
20
- /**
21
- * @param {?} productFactory
22
- * @param {?} productImageFactory
23
- */
24
15
  function DaffInMemoryBackendProductService(productFactory, productImageFactory) {
16
+ var _this = this;
25
17
  this.productFactory = productFactory;
26
18
  this.productImageFactory = productImageFactory;
27
- this.products = [
28
- this.productFactory.create({ id: '1001', url: '1001', images: this.productImageFactory.createMany(5) }),
29
- this.productFactory.create({ id: '1002', url: '1002', images: this.productImageFactory.createMany(5) }),
30
- this.productFactory.create({ id: '1003', url: '1003', images: this.productImageFactory.createMany(5) }),
31
- this.productFactory.create({ id: '1004', url: '1004', images: this.productImageFactory.createMany(5) }),
32
- this.productFactory.create({ id: '1005', url: '1005', images: this.productImageFactory.createMany(5) }),
33
- this.productFactory.create({ id: '1006', url: '1006', images: this.productImageFactory.createMany(5) }),
34
- this.productFactory.create({ id: '1007', url: '1007', images: this.productImageFactory.createMany(5) }),
35
- this.productFactory.create({ id: '1008', url: '1008', images: this.productImageFactory.createMany(5) }),
36
- this.productFactory.create({ id: '1009', url: '1009', images: this.productImageFactory.createMany(5) }),
37
- this.productFactory.create({ id: '1010', url: '1010', images: this.productImageFactory.createMany(5) }),
38
- this.productFactory.create({ id: '1011', url: '1011', images: this.productImageFactory.createMany(5) }),
39
- this.productFactory.create({ id: '1012', url: '1012', images: this.productImageFactory.createMany(5) }),
40
- this.productFactory.create({ id: '1013', url: '1013', images: this.productImageFactory.createMany(5) }),
41
- this.productFactory.create({ id: '1014', url: '1014', images: this.productImageFactory.createMany(5) }),
42
- this.productFactory.create({ id: '1015', url: '1015', images: this.productImageFactory.createMany(5) }),
43
- this.productFactory.create({ id: '1016', url: '1016', images: this.productImageFactory.createMany(5) }),
44
- this.productFactory.create({ id: '1017', url: '1017', images: this.productImageFactory.createMany(5) }),
45
- this.productFactory.create({ id: '1018', url: '1018', images: this.productImageFactory.createMany(5) }),
46
- this.productFactory.create({ id: '1019', url: '1019', images: this.productImageFactory.createMany(5) }),
47
- this.productFactory.create({ id: '1020', url: '1020', images: this.productImageFactory.createMany(5) }),
48
- this.productFactory.create({ id: '1021', url: '1021', images: this.productImageFactory.createMany(5) }),
49
- this.productFactory.create({ id: '1022', url: '1022', images: this.productImageFactory.createMany(5) }),
50
- this.productFactory.create({ id: '1023', url: '1023', images: this.productImageFactory.createMany(5) }),
51
- this.productFactory.create({ id: '1024', url: '1024', images: this.productImageFactory.createMany(5) }),
52
- this.productFactory.create({ id: '1025', url: '1025', images: this.productImageFactory.createMany(5) }),
53
- this.productFactory.create({ id: '1026', url: '1026', images: this.productImageFactory.createMany(5) }),
54
- this.productFactory.create({ id: '1027', url: '1027', images: this.productImageFactory.createMany(5) }),
55
- this.productFactory.create({ id: '1028', url: '1028', images: this.productImageFactory.createMany(5) }),
56
- this.productFactory.create({ id: '1029', url: '1029', images: this.productImageFactory.createMany(5) }),
57
- this.productFactory.create({ id: '1030', url: '1030', images: this.productImageFactory.createMany(5) }),
58
- this.productFactory.create({ id: '1031', url: '1031', images: this.productImageFactory.createMany(5) }),
59
- this.productFactory.create({ id: '1032', url: '1032', images: this.productImageFactory.createMany(5) }),
60
- this.productFactory.create({ id: '1033', url: '1033', images: this.productImageFactory.createMany(5) }),
61
- this.productFactory.create({ id: '1034', url: '1034', images: this.productImageFactory.createMany(5) }),
62
- this.productFactory.create({ id: '1035', url: '1035', images: this.productImageFactory.createMany(5) }),
63
- ];
19
+ this._products = [];
20
+ this._products = [
21
+ '1001',
22
+ '1002',
23
+ '1003',
24
+ '1004',
25
+ '1005',
26
+ '1006',
27
+ '1007',
28
+ '1008',
29
+ '1009',
30
+ '1010',
31
+ '1011',
32
+ '1012',
33
+ '1013',
34
+ '1014',
35
+ '1015',
36
+ '1016',
37
+ '1017',
38
+ '1018',
39
+ '1019',
40
+ '1020',
41
+ '1021',
42
+ '1022',
43
+ '1023',
44
+ '1024',
45
+ '1025',
46
+ '1026',
47
+ '1027',
48
+ '1028',
49
+ '1029',
50
+ '1030',
51
+ '1031',
52
+ '1032',
53
+ '1033',
54
+ '1034',
55
+ '1035',
56
+ ].map(function (id) { return _this.productFactory.create({ id: id, url: "/" + id, images: _this.productImageFactory.createMany(5) }); });
64
57
  }
58
+ Object.defineProperty(DaffInMemoryBackendProductService.prototype, "products", {
59
+ /**
60
+ * The collection of products in the backend.
61
+ */
62
+ get: function () {
63
+ return this._products;
64
+ },
65
+ enumerable: false,
66
+ configurable: true
67
+ });
68
+ ;
65
69
  /**
66
70
  * Automatically called as part of the InMemoryDbService to parse incoming urls to match the InMemory backend urls.
67
71
  *
68
- * \@docs-private
69
- * @param {?} url initial url
70
- * @param {?} utils utility to parse url
71
- * @return {?} ParsedRequestUrl
72
+ * @param url initial url
73
+ * @param utils utility to parse url
74
+ * @returns ParsedRequestUrl
75
+ * @docs-private
72
76
  */
73
77
  DaffInMemoryBackendProductService.prototype.parseRequestUrl = function (url, utils) {
74
78
  return utils.parseRequestUrl(url);
@@ -76,34 +80,33 @@
76
80
  /**
77
81
  * Creates a fake database of products for the product inmemory backend service.
78
82
  *
79
- * \@docs-private
80
- * @return {?} A fake database of an array of products
83
+ * @returns A fake database of an array of products
84
+ * @docs-private
81
85
  */
82
86
  DaffInMemoryBackendProductService.prototype.createDb = function () {
83
87
  return {
84
- products: this.products,
88
+ products: this._products,
85
89
  };
86
90
  };
87
91
  /**
88
92
  * Returns products based on the url given.
89
93
  *
90
- * @param {?} reqInfo request object
91
- * @return {?} An http response object
94
+ * @param reqInfo request object
95
+ * @returns An http response object
92
96
  */
93
97
  DaffInMemoryBackendProductService.prototype.get = function (reqInfo) {
94
98
  var _this = this;
95
99
  if (reqInfo.id === 'best-sellers') {
96
- return reqInfo.utils.createResponse$(( /**
97
- * @return {?}
98
- */function () { return ({
99
- body: _this.products.slice(0, 4),
100
+ return reqInfo.utils.createResponse$(function () { return ({
101
+ body: _this._products.slice(0, 4),
100
102
  status: angularInMemoryWebApi.STATUS.OK,
101
- }); }));
103
+ }); });
102
104
  }
103
105
  return undefined;
104
106
  };
105
107
  return DaffInMemoryBackendProductService;
106
108
  }());
109
+ /** @nocollapse */ DaffInMemoryBackendProductService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryBackendProductService_Factory() { return new DaffInMemoryBackendProductService(i0.ɵɵinject(i1.DaffProductExtensionFactory), i0.ɵɵinject(i1.DaffProductImageFactory)); }, token: DaffInMemoryBackendProductService, providedIn: "root" });
107
110
  DaffInMemoryBackendProductService.decorators = [
108
111
  { type: i0.Injectable, args: [{
109
112
  providedIn: 'root',
@@ -114,93 +117,42 @@
114
117
  { type: i1.DaffProductExtensionFactory },
115
118
  { type: i1.DaffProductImageFactory }
116
119
  ]; };
117
- /** @nocollapse */ DaffInMemoryBackendProductService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryBackendProductService_Factory() { return new DaffInMemoryBackendProductService(i0.ɵɵinject(i1.DaffProductExtensionFactory), i0.ɵɵinject(i1.DaffProductImageFactory)); }, token: DaffInMemoryBackendProductService, providedIn: "root" });
118
- if (false) {
119
- /**
120
- * \@docs-private
121
- * @type {?}
122
- */
123
- DaffInMemoryBackendProductService.prototype.products;
124
- /**
125
- * @type {?}
126
- * @private
127
- */
128
- DaffInMemoryBackendProductService.prototype.productFactory;
129
- /**
130
- * @type {?}
131
- * @private
132
- */
133
- DaffInMemoryBackendProductService.prototype.productImageFactory;
134
- }
135
120
 
136
- /**
137
- * @fileoverview added by tsickle
138
- * Generated from: driver/product.service.ts
139
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
140
- */
141
121
  /**
142
122
  * The product inmemory driver to mock the product backend service.
143
123
  *
144
- * \@inheritdoc
145
- * \@Param HttpClient
124
+ * @inheritdoc
125
+ * @Param HttpClient
146
126
  */
147
127
  var DaffInMemoryProductService = /** @class */ (function () {
148
- /**
149
- * @param {?} http
150
- */
151
128
  function DaffInMemoryProductService(http) {
152
129
  this.http = http;
153
130
  /**
154
- * \@docs-private
131
+ * @docs-private
155
132
  */
156
- this.url = '/api/products/';
133
+ this.url = '/api/products';
157
134
  }
158
- /**
159
- * @return {?}
160
- */
161
135
  DaffInMemoryProductService.prototype.getAll = function () {
162
136
  return this.http.get(this.url);
163
137
  };
164
- /**
165
- * @return {?}
166
- */
167
138
  DaffInMemoryProductService.prototype.getBestSellers = function () {
168
- return this.http.get(this.url + 'best-sellers');
139
+ return this.http.get(this.url + "/best-sellers");
169
140
  };
170
- /**
171
- * @param {?} productId
172
- * @return {?}
173
- */
174
141
  DaffInMemoryProductService.prototype.get = function (productId) {
175
- return this.http.get(this.url + productId).pipe(operators.map(( /**
176
- * @param {?} product
177
- * @return {?}
178
- */function (/**
179
- * @param {?} product
180
- * @return {?}
181
- */ product) { return ({
142
+ return this.http.get(this.url + "/" + productId).pipe(operators.map(function (product) { return ({
182
143
  id: productId,
183
144
  products: [product],
184
- }); })));
145
+ }); }));
185
146
  };
186
- /**
187
- * @param {?} url
188
- * @return {?}
189
- */
190
147
  DaffInMemoryProductService.prototype.getByUrl = function (url) {
191
- return this.http.get("" + this.url + url).pipe(operators.map(( /**
192
- * @param {?} product
193
- * @return {?}
194
- */function (/**
195
- * @param {?} product
196
- * @return {?}
197
- */ product) { return ({
148
+ return this.http.get("" + this.url + url).pipe(operators.map(function (product) { return ({
198
149
  id: product.id,
199
150
  products: [product],
200
- }); })));
151
+ }); }));
201
152
  };
202
153
  return DaffInMemoryProductService;
203
154
  }());
155
+ /** @nocollapse */ DaffInMemoryProductService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryProductService_Factory() { return new DaffInMemoryProductService(i0.ɵɵinject(i1$1.HttpClient)); }, token: DaffInMemoryProductService, providedIn: "root" });
204
156
  DaffInMemoryProductService.decorators = [
205
157
  { type: i0.Injectable, args: [{
206
158
  providedIn: 'root',
@@ -210,34 +162,13 @@
210
162
  DaffInMemoryProductService.ctorParameters = function () { return [
211
163
  { type: i1$1.HttpClient }
212
164
  ]; };
213
- /** @nocollapse */ DaffInMemoryProductService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryProductService_Factory() { return new DaffInMemoryProductService(i0.ɵɵinject(i1$1.HttpClient)); }, token: DaffInMemoryProductService, providedIn: "root" });
214
- if (false) {
215
- /**
216
- * \@docs-private
217
- * @type {?}
218
- */
219
- DaffInMemoryProductService.prototype.url;
220
- /**
221
- * @type {?}
222
- * @private
223
- */
224
- DaffInMemoryProductService.prototype.http;
225
- }
226
165
 
227
- /**
228
- * @fileoverview added by tsickle
229
- * Generated from: driver/product-driver.module.ts
230
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
231
- */
232
166
  /**
233
167
  * Module for providing the DaffInMemoryProductService driver to your application.
234
168
  */
235
169
  var DaffProductInMemoryDriverModule = /** @class */ (function () {
236
170
  function DaffProductInMemoryDriverModule() {
237
171
  }
238
- /**
239
- * @return {?}
240
- */
241
172
  DaffProductInMemoryDriverModule.forRoot = function () {
242
173
  return {
243
174
  ngModule: DaffProductInMemoryDriverModule,
@@ -261,21 +192,7 @@
261
192
  ];
262
193
 
263
194
  /**
264
- * @fileoverview added by tsickle
265
- * Generated from: public_api.ts
266
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
267
- */
268
-
269
- /**
270
- * @fileoverview added by tsickle
271
- * Generated from: index.ts
272
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
273
- */
274
-
275
- /**
276
- * @fileoverview added by tsickle
277
- * Generated from: daffodil-product-driver-in-memory.ts
278
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
195
+ * Generated bundle index. Do not edit.
279
196
  */
280
197
 
281
198
  exports.DaffInMemoryBackendProductService = DaffInMemoryBackendProductService;
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-product-driver-in-memory.umd.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":["STATUS","Injectable","DaffProductExtensionFactory","DaffProductImageFactory","map","HttpClient","DaffProductDriver","NgModule","Common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GAAG,SAAS,CAAC,CAAC,IAAI,CAC1DC,aAAG;;;eAAC;;;gBAAA,OAAO,IAAI,QAAC;gBACd,EAAE,EAAE,SAAS;gBACb,QAAQ,EAAE,CAAC,OAAO,CAAC;aACpB,IAAC,EAAC,CACJ,CAAC;SACH;;;;;QAED,6CAAQ,GAAR,UAAS,GAAuB;YAC9B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAc,KAAG,IAAI,CAAC,GAAG,GAAG,GAAK,CAAC,CAAC,IAAI,CACzDA,aAAG;;;eAAC;;;gBAAA,OAAO,IAAI,QAAC;gBACd,EAAE,EAAE,OAAO,CAAC,EAAE;gBACd,QAAQ,EAAE,CAAC,OAAO,CAAC;aACpB,IAAC,EAAC,CACJ,CAAC;SACH;;;;gBAnCFH,aAAU,SAAC;oBACV,UAAU,EAAE,MAAM;iBACnB;;;;gBAnBQI,eAAU;;;;;;;;QAwBjB,yCAAuB;;;;;QAEX,0CAAwB;;;;;;;;;;;;QCNtC;;;;;QACS,uCAAO,GAAd;YACE,OAAO;gBACL,QAAQ,EAAE,+BAA+B;gBACzC,SAAS,EAAE;oBACT;wBACE,OAAO,EAAEC,wBAAiB;wBAC1B,WAAW,EAAE,0BAA0B;qBACxC;iBACF;aACF,CAAC;SACH;;;;gBAjBFC,WAAQ,SAAC;oBACR,OAAO,EAAE;wBACPC,mBAAY;wBACZC,2BAAwB;qBACzB;iBACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"daffodil-product-driver-in-memory.umd.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":["STATUS","Injectable","DaffProductExtensionFactory","DaffProductImageFactory","map","HttpClient","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E;gBACd,QAAQ,EAAE,CAAC,OAAO,CAAC;aACpB,IAAC,CAAC,CACJ,CAAC;SACH;;;;;gBAnCFH,aAAU,SAAC;oBACV,UAAU,EAAE,MAAM;iBACnB;;;;gBAnBQI,eAAU;;;ICWnB;;;;QASA;;QACS,uCAAO,GAAd;YACE,OAAO;gBACL,QAAQ,EAAE,+BAA+B;gBACzC,SAAS,EAAE;oBACT;wBACE,OAAO,EAAEC,wBAAiB;wBAC1B,WAAW,EAAE,0BAA0B;qBACxC;iBACF;aACF,CAAC;SACH;;;;gBAjBFC,WAAQ,SAAC;oBACR,OAAO,EAAE;wBACPC,mBAAY;wBACZC,2BAAwB;qBACzB;iBACF;;;ICnBD;;;;;;;;;;;;;;"}
@@ -1,2 +1,2 @@
1
- !function(t,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("@angular/core"),require("angular-in-memory-web-api"),require("@daffodil/product/testing"),require("@angular/common/http"),require("rxjs/operators"),require("@angular/common"),require("@daffodil/product/driver")):"function"==typeof define&&define.amd?define("@daffodil/product/driver/in-memory",["exports","@angular/core","angular-in-memory-web-api","@daffodil/product/testing","@angular/common/http","rxjs/operators","@angular/common","@daffodil/product/driver"],r):r(((t="undefined"!=typeof globalThis?globalThis:t||self).daffodil=t.daffodil||{},t.daffodil.product=t.daffodil.product||{},t.daffodil.product.driver=t.daffodil.product.driver||{},t.daffodil.product.driver["in-memory"]={}),t.ng.core,t.angularInMemoryWebApi,t.daffodil.product.testing,t.ng.common.http,t.rxjs.operators,t.ng.common,t.daffodil.product.driver)}(this,(function(t,r,e,a,o,c,i,u){"use strict";var d=function(){function t(t,r){this.productFactory=t,this.productImageFactory=r,this.products=[this.productFactory.create({id:"1001",url:"1001",images:this.productImageFactory.createMany(5)}),this.productFactory.create({id:"1002",url:"1002",images:this.productImageFactory.createMany(5)}),this.productFactory.create({id:"1003",url:"1003",images:this.productImageFactory.createMany(5)}),this.productFactory.create({id:"1004",url:"1004",images:this.productImageFactory.createMany(5)}),this.productFactory.create({id:"1005",url:"1005",images:this.productImageFactory.createMany(5)}),this.productFactory.create({id:"1006",url:"1006",images:this.productImageFactory.createMany(5)}),this.productFactory.create({id:"1007",url:"1007",images:this.productImageFactory.createMany(5)}),this.productFactory.create({id:"1008",url:"1008",images:this.productImageFactory.createMany(5)}),this.productFactory.create({id:"1009",url:"1009",images:this.productImageFactory.createMany(5)}),this.productFactory.create({id:"1010",url:"1010",images:this.productImageFactory.createMany(5)}),this.productFactory.create({id:"1011",url:"1011",images:this.productImageFactory.createMany(5)}),this.productFactory.create({id:"1012",url:"1012",images:this.productImageFactory.createMany(5)}),this.productFactory.create({id:"1013",url:"1013",images:this.productImageFactory.createMany(5)}),this.productFactory.create({id:"1014",url:"1014",images:this.productImageFactory.createMany(5)}),this.productFactory.create({id:"1015",url:"1015",images:this.productImageFactory.createMany(5)}),this.productFactory.create({id:"1016",url:"1016",images:this.productImageFactory.createMany(5)}),this.productFactory.create({id:"1017",url:"1017",images:this.productImageFactory.createMany(5)}),this.productFactory.create({id:"1018",url:"1018",images:this.productImageFactory.createMany(5)}),this.productFactory.create({id:"1019",url:"1019",images:this.productImageFactory.createMany(5)}),this.productFactory.create({id:"1020",url:"1020",images:this.productImageFactory.createMany(5)}),this.productFactory.create({id:"1021",url:"1021",images:this.productImageFactory.createMany(5)}),this.productFactory.create({id:"1022",url:"1022",images:this.productImageFactory.createMany(5)}),this.productFactory.create({id:"1023",url:"1023",images:this.productImageFactory.createMany(5)}),this.productFactory.create({id:"1024",url:"1024",images:this.productImageFactory.createMany(5)}),this.productFactory.create({id:"1025",url:"1025",images:this.productImageFactory.createMany(5)}),this.productFactory.create({id:"1026",url:"1026",images:this.productImageFactory.createMany(5)}),this.productFactory.create({id:"1027",url:"1027",images:this.productImageFactory.createMany(5)}),this.productFactory.create({id:"1028",url:"1028",images:this.productImageFactory.createMany(5)}),this.productFactory.create({id:"1029",url:"1029",images:this.productImageFactory.createMany(5)}),this.productFactory.create({id:"1030",url:"1030",images:this.productImageFactory.createMany(5)}),this.productFactory.create({id:"1031",url:"1031",images:this.productImageFactory.createMany(5)}),this.productFactory.create({id:"1032",url:"1032",images:this.productImageFactory.createMany(5)}),this.productFactory.create({id:"1033",url:"1033",images:this.productImageFactory.createMany(5)}),this.productFactory.create({id:"1034",url:"1034",images:this.productImageFactory.createMany(5)}),this.productFactory.create({id:"1035",url:"1035",images:this.productImageFactory.createMany(5)})]}return t.prototype.parseRequestUrl=function(t,r){return r.parseRequestUrl(t)},t.prototype.createDb=function(){return{products:this.products}},t.prototype.get=function(t){var r=this;if("best-sellers"===t.id)return t.utils.createResponse$((function(){return{body:r.products.slice(0,4),status:e.STATUS.OK}}))},t}();d.decorators=[{type:r.Injectable,args:[{providedIn:"root"}]}],d.ctorParameters=function(){return[{type:a.DaffProductExtensionFactory},{type:a.DaffProductImageFactory}]},d.ɵprov=r.ɵɵdefineInjectable({factory:function(){return new d(r.ɵɵinject(a.DaffProductExtensionFactory),r.ɵɵinject(a.DaffProductImageFactory))},token:d,providedIn:"root"});var s=function(){function t(t){this.http=t,this.url="/api/products/"}return t.prototype.getAll=function(){return this.http.get(this.url)},t.prototype.getBestSellers=function(){return this.http.get(this.url+"best-sellers")},t.prototype.get=function(t){return this.http.get(this.url+t).pipe(c.map((function(r){return{id:t,products:[r]}})))},t.prototype.getByUrl=function(t){return this.http.get(""+this.url+t).pipe(c.map((function(t){return{id:t.id,products:[t]}})))},t}();s.decorators=[{type:r.Injectable,args:[{providedIn:"root"}]}],s.ctorParameters=function(){return[{type:o.HttpClient}]},s.ɵprov=r.ɵɵdefineInjectable({factory:function(){return new s(r.ɵɵinject(o.HttpClient))},token:s,providedIn:"root"});var n=function(){function t(){}return t.forRoot=function(){return{ngModule:t,providers:[{provide:u.DaffProductDriver,useExisting:s}]}},t}();n.decorators=[{type:r.NgModule,args:[{imports:[i.CommonModule,a.DaffProductTestingModule]}]}],t.DaffInMemoryBackendProductService=d,t.DaffInMemoryProductService=s,t.DaffProductInMemoryDriverModule=n,Object.defineProperty(t,"__esModule",{value:!0})}));
1
+ !function(t,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("@angular/core"),require("angular-in-memory-web-api"),require("@daffodil/product/testing"),require("@angular/common/http"),require("rxjs/operators"),require("@angular/common"),require("@daffodil/product/driver")):"function"==typeof define&&define.amd?define("@daffodil/product/driver/in-memory",["exports","@angular/core","angular-in-memory-web-api","@daffodil/product/testing","@angular/common/http","rxjs/operators","@angular/common","@daffodil/product/driver"],r):r(((t="undefined"!=typeof globalThis?globalThis:t||self).daffodil=t.daffodil||{},t.daffodil.product=t.daffodil.product||{},t.daffodil.product.driver=t.daffodil.product.driver||{},t.daffodil.product.driver["in-memory"]={}),t.ng.core,t.angularInMemoryWebApi,t.daffodil.product.testing,t.ng.common.http,t.rxjs.operators,t.ng.common,t.daffodil.product.driver)}(this,(function(t,r,e,o,n,i,u,d){"use strict";var c=function(){function t(t,r){var e=this;this.productFactory=t,this.productImageFactory=r,this._products=[],this._products=["1001","1002","1003","1004","1005","1006","1007","1008","1009","1010","1011","1012","1013","1014","1015","1016","1017","1018","1019","1020","1021","1022","1023","1024","1025","1026","1027","1028","1029","1030","1031","1032","1033","1034","1035"].map((function(t){return e.productFactory.create({id:t,url:"/"+t,images:e.productImageFactory.createMany(5)})}))}return Object.defineProperty(t.prototype,"products",{get:function(){return this._products},enumerable:!1,configurable:!0}),t.prototype.parseRequestUrl=function(t,r){return r.parseRequestUrl(t)},t.prototype.createDb=function(){return{products:this._products}},t.prototype.get=function(t){var r=this;if("best-sellers"===t.id)return t.utils.createResponse$((function(){return{body:r._products.slice(0,4),status:e.STATUS.OK}}))},t}();c.ɵprov=r.ɵɵdefineInjectable({factory:function(){return new c(r.ɵɵinject(o.DaffProductExtensionFactory),r.ɵɵinject(o.DaffProductImageFactory))},token:c,providedIn:"root"}),c.decorators=[{type:r.Injectable,args:[{providedIn:"root"}]}],c.ctorParameters=function(){return[{type:o.DaffProductExtensionFactory},{type:o.DaffProductImageFactory}]};var a=function(){function t(t){this.http=t,this.url="/api/products"}return t.prototype.getAll=function(){return this.http.get(this.url)},t.prototype.getBestSellers=function(){return this.http.get(this.url+"/best-sellers")},t.prototype.get=function(t){return this.http.get(this.url+"/"+t).pipe(i.map((function(r){return{id:t,products:[r]}})))},t.prototype.getByUrl=function(t){return this.http.get(""+this.url+t).pipe(i.map((function(t){return{id:t.id,products:[t]}})))},t}();a.ɵprov=r.ɵɵdefineInjectable({factory:function(){return new a(r.ɵɵinject(n.HttpClient))},token:a,providedIn:"root"}),a.decorators=[{type:r.Injectable,args:[{providedIn:"root"}]}],a.ctorParameters=function(){return[{type:n.HttpClient}]};var p=function(){function t(){}return t.forRoot=function(){return{ngModule:t,providers:[{provide:d.DaffProductDriver,useExisting:a}]}},t}();p.decorators=[{type:r.NgModule,args:[{imports:[u.CommonModule,o.DaffProductTestingModule]}]}],t.DaffInMemoryBackendProductService=c,t.DaffInMemoryProductService=a,t.DaffProductInMemoryDriverModule=p,Object.defineProperty(t,"__esModule",{value:!0})}));
2
2
  //# sourceMappingURL=daffodil-product-driver-in-memory.umd.min.js.map
@@ -1 +1 @@
1
- {"version":3,"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"],"names":["DaffInMemoryBackendProductService","productFactory","productImageFactory","this","products","create","id","url","images","createMany","prototype","parseRequestUrl","utils","createDb","get","reqInfo","_this","createResponse$","body","slice","status","STATUS","OK","Injectable","args","providedIn","DaffProductExtensionFactory","DaffProductImageFactory","DaffInMemoryProductService","http","getAll","getBestSellers","productId","pipe","map","product","getByUrl","HttpClient","DaffProductInMemoryDriverModule","forRoot","ngModule","providers","provide","DaffProductDriver","useExisting","NgModule","imports","CommonModule","DaffProductTestingModule"],"mappings":"48BA8BE,SAAAA,EACUC,EACAC,GADAC,KAAAF,eAAAA,EACAE,KAAAD,oBAAAA,EACRC,KAAKC,SAAW,CACdD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AAAlB,UAAAoB,OAAA,WACE,OAAO3B,KAAK0B,KAAKf,IAAmBX,KAAKI,MAG3CqB,EAAAlB,UAAAqB,eAAA,WACE,OAAO5B,KAAK0B,KAAKf,IAAmBX,KAAKI,IAAM,iBAGjDqB,EAAAlB,UAAAI,IAAA,SAAIkB,GACF,OAAO7B,KAAK0B,KAAKf,IAAiBX,KAAKI,IAAMyB,GAAWC,KACtDC,EAAAA,KAAG,SAACC,GAAW,MAAA,CACb7B,GAAI0B,EACJ5B,SAAU,CAAC+B,SAKjBP,EAAAlB,UAAA0B,SAAA,SAAS7B,GACP,OAAOJ,KAAK0B,KAAKf,IAAiB,GAAGX,KAAKI,IAAMA,GAAO0B,KACrDC,EAAAA,KAAG,SAACC,GAAW,MAAA,CACb7B,GAAI6B,EAAQ7B,GACZF,SAAU,CAAC+B,kCAhClBZ,EAAAA,WAAUC,KAAA,CAAC,CACVC,WAAY,oDAlBLY,EAAAA,oJCoBT,SAAAC,YACSA,EAAAC,QAAP,WACE,MAAO,CACLC,SAAUF,EACVG,UAAW,CACT,CACEC,QAASC,EAAAA,kBACTC,YAAahB,+BAbtBiB,EAAAA,SAAQrB,KAAA,CAAC,CACRsB,QAAS,CACPC,EAAAA,aACAC,EAAAA","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"]}
1
+ {"version":3,"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"],"names":["DaffInMemoryBackendProductService","productFactory","productImageFactory","_this","this","_products","map","id","create","url","images","createMany","Object","defineProperty","prototype","parseRequestUrl","utils","createDb","products","get","reqInfo","createResponse$","body","slice","status","STATUS","OK","Injectable","args","providedIn","DaffProductExtensionFactory","DaffProductImageFactory","DaffInMemoryProductService","http","getAll","getBestSellers","productId","pipe","product","getByUrl","HttpClient","DaffProductInMemoryDriverModule","forRoot","ngModule","providers","provide","DaffProductDriver","useExisting","NgModule","imports","CommonModule","DaffProductTestingModule"],"mappings":"48BAkCE,SAAAA,EACUC,EACAC,GAFV,IAAAC,EAAAC,KACUA,KAAAH,eAAAA,EACAG,KAAAF,oBAAAA,EAXAE,KAAAC,UAA2B,GAYnCD,KAAKC,UAAY,CACf,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,QACAC,KAAI,SAAAC,GAAM,OAAAJ,EAAKF,eAAeO,OAAO,CAAED,GAAEA,EAAEE,IAAK,IAAIF,EAAMG,OAAQP,EAAKD,oBAAoBS,WAAW,eA3C1GC,OAAAC,eAAIb,EAAAc,UAAA,WAAQ,KAAZ,WACE,OAAOV,KAAKC,2CAqDdL,EAAAc,UAAAC,gBAAA,SAAgBN,EAAaO,GAC3B,OAAOA,EAAMD,gBAAgBN,IAS/BT,EAAAc,UAAAG,SAAA,WACE,MAAO,CACLC,SAAUd,KAAKC,YAUnBL,EAAAc,UAAAK,IAAA,SAAIC,GAAJ,IAAAjB,EAAAC,KACE,GAAkB,iBAAfgB,EAAQb,GACT,OAAOa,EAAQJ,MAAMK,iBAAgB,WAAM,MAAA,CACzCC,KAAMnB,EAAKE,UAAUkB,MAAM,EAAE,GAC7BC,OAAQC,EAAAA,OAAOC,6MAzFtBC,EAAAA,WAAUC,KAAA,CAAC,CACVC,WAAY,oDAXZC,EAAAA,mCADAC,EAAAA,4CCgBA,SAAAC,EAAoBC,GAAA7B,KAAA6B,KAAAA,EAFpB7B,KAAAK,IAAM,uBAINuB,EAAAlB,UAAAoB,OAAA,WACE,OAAO9B,KAAK6B,KAAKd,IAAmBf,KAAKK,MAG3CuB,EAAAlB,UAAAqB,eAAA,WACE,OAAO/B,KAAK6B,KAAKd,IAAsBf,KAAKK,IAAG,kBAGjDuB,EAAAlB,UAAAK,IAAA,SAAIiB,GACF,OAAOhC,KAAK6B,KAAKd,IAAoBf,KAAKK,IAAG,IAAI2B,GAAaC,KAC5D/B,EAAAA,KAAI,SAAAgC,GAAW,MAAA,CACb/B,GAAI6B,EACJlB,SAAU,CAACoB,SAKjBN,EAAAlB,UAAAyB,SAAA,SAAS9B,GACP,OAAOL,KAAK6B,KAAKd,IAAiB,GAAGf,KAAKK,IAAMA,GAAO4B,KACrD/B,EAAAA,KAAI,SAAAgC,GAAW,MAAA,CACb/B,GAAI+B,EAAQ/B,GACZW,SAAU,CAACoB,uJAhClBX,EAAAA,WAAUC,KAAA,CAAC,CACVC,WAAY,oDAlBLW,EAAAA,+BCoBT,SAAAC,YACSA,EAAAC,QAAP,WACE,MAAO,CACLC,SAAUF,EACVG,UAAW,CACT,CACEC,QAASC,EAAAA,kBACTC,YAAaf,+BAbtBgB,EAAAA,SAAQpB,KAAA,CAAC,CACRqB,QAAS,CACPC,EAAAA,aACAC,EAAAA","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"]}