@medusajs/medusa 1.3.2 → 1.3.3

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 (507) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/dist/api/index.d.ts +15 -14
  3. package/dist/api/index.js +15 -14
  4. package/dist/api/index.js.map +1 -1
  5. package/dist/api/middlewares/authenticate-customer.d.ts +2 -1
  6. package/dist/api/middlewares/authenticate-customer.js +1 -2
  7. package/dist/api/middlewares/authenticate-customer.js.map +1 -1
  8. package/dist/api/middlewares/authenticate.d.ts +2 -1
  9. package/dist/api/middlewares/authenticate.js.map +1 -1
  10. package/dist/api/middlewares/await-middleware.d.ts +3 -1
  11. package/dist/api/middlewares/await-middleware.js +2 -31
  12. package/dist/api/middlewares/await-middleware.js.map +1 -1
  13. package/dist/api/middlewares/error-handler.d.ts +3 -1
  14. package/dist/api/middlewares/error-handler.js.map +1 -1
  15. package/dist/api/middlewares/feature-flag-enabled.d.ts +2 -0
  16. package/dist/api/middlewares/feature-flag-enabled.js +57 -0
  17. package/dist/api/middlewares/feature-flag-enabled.js.map +1 -0
  18. package/dist/api/middlewares/index.d.ts +10 -10
  19. package/dist/api/middlewares/index.js +5 -1
  20. package/dist/api/middlewares/index.js.map +1 -1
  21. package/dist/api/middlewares/normalized-query.d.ts +6 -1
  22. package/dist/api/middlewares/normalized-query.js +5 -2
  23. package/dist/api/middlewares/normalized-query.js.map +1 -1
  24. package/dist/api/middlewares/transform-body.d.ts +4 -0
  25. package/dist/api/middlewares/transform-body.js +66 -0
  26. package/dist/api/middlewares/transform-body.js.map +1 -0
  27. package/dist/api/middlewares/transform-query.d.ts +6 -0
  28. package/dist/api/middlewares/transform-query.js +86 -0
  29. package/dist/api/middlewares/transform-query.js.map +1 -0
  30. package/dist/api/routes/admin/batch/cancel-batch-job.d.ts +22 -0
  31. package/dist/api/routes/admin/batch/cancel-batch-job.js +74 -0
  32. package/dist/api/routes/admin/batch/cancel-batch-job.js.map +1 -0
  33. package/dist/api/routes/admin/batch/confirm-batch-job.d.ts +22 -0
  34. package/dist/api/routes/admin/batch/confirm-batch-job.js +74 -0
  35. package/dist/api/routes/admin/batch/confirm-batch-job.js.map +1 -0
  36. package/dist/api/routes/admin/batch/create-batch-job.d.ts +30 -0
  37. package/dist/api/routes/admin/batch/create-batch-job.js +125 -0
  38. package/dist/api/routes/admin/batch/create-batch-job.js.map +1 -0
  39. package/dist/api/routes/admin/batch/get-batch-job.d.ts +22 -0
  40. package/dist/api/routes/admin/batch/get-batch-job.js +67 -0
  41. package/dist/api/routes/admin/batch/get-batch-job.js.map +1 -0
  42. package/dist/api/routes/admin/batch/index.d.ts +4 -0
  43. package/dist/api/routes/admin/batch/index.js +36 -7
  44. package/dist/api/routes/admin/batch/index.js.map +1 -1
  45. package/dist/api/routes/admin/batch/list-batch-jobs.d.ts +15 -7
  46. package/dist/api/routes/admin/batch/list-batch-jobs.js +61 -46
  47. package/dist/api/routes/admin/batch/list-batch-jobs.js.map +1 -1
  48. package/dist/api/routes/admin/collections/add-products.d.ts +2 -1
  49. package/dist/api/routes/admin/collections/add-products.js +4 -7
  50. package/dist/api/routes/admin/collections/add-products.js.map +1 -1
  51. package/dist/api/routes/admin/collections/create-collection.d.ts +2 -1
  52. package/dist/api/routes/admin/collections/create-collection.js +6 -8
  53. package/dist/api/routes/admin/collections/create-collection.js.map +1 -1
  54. package/dist/api/routes/admin/collections/delete-collection.d.ts +2 -1
  55. package/dist/api/routes/admin/collections/delete-collection.js.map +1 -1
  56. package/dist/api/routes/admin/collections/get-collection.d.ts +2 -1
  57. package/dist/api/routes/admin/collections/get-collection.js +4 -5
  58. package/dist/api/routes/admin/collections/get-collection.js.map +1 -1
  59. package/dist/api/routes/admin/collections/index.js +32 -12
  60. package/dist/api/routes/admin/collections/index.js.map +1 -1
  61. package/dist/api/routes/admin/collections/list-collections.d.ts +2 -1
  62. package/dist/api/routes/admin/collections/list-collections.js +9 -19
  63. package/dist/api/routes/admin/collections/list-collections.js.map +1 -1
  64. package/dist/api/routes/admin/collections/remove-products.d.ts +2 -1
  65. package/dist/api/routes/admin/collections/remove-products.js +5 -8
  66. package/dist/api/routes/admin/collections/remove-products.js.map +1 -1
  67. package/dist/api/routes/admin/collections/update-collection.d.ts +2 -1
  68. package/dist/api/routes/admin/collections/update-collection.js +5 -8
  69. package/dist/api/routes/admin/collections/update-collection.js.map +1 -1
  70. package/dist/api/routes/admin/customer-groups/add-customers-batch.d.ts +2 -1
  71. package/dist/api/routes/admin/customer-groups/add-customers-batch.js.map +1 -1
  72. package/dist/api/routes/admin/customer-groups/create-customer-group.d.ts +2 -1
  73. package/dist/api/routes/admin/customer-groups/create-customer-group.js.map +1 -1
  74. package/dist/api/routes/admin/customer-groups/delete-customer-group.d.ts +2 -1
  75. package/dist/api/routes/admin/customer-groups/delete-customer-group.js.map +1 -1
  76. package/dist/api/routes/admin/customer-groups/delete-customers-batch.d.ts +2 -1
  77. package/dist/api/routes/admin/customer-groups/delete-customers-batch.js.map +1 -1
  78. package/dist/api/routes/admin/customer-groups/get-customer-group-customers.d.ts +2 -1
  79. package/dist/api/routes/admin/customer-groups/get-customer-group-customers.js.map +1 -1
  80. package/dist/api/routes/admin/customer-groups/get-customer-group.d.ts +2 -1
  81. package/dist/api/routes/admin/customer-groups/get-customer-group.js +3 -17
  82. package/dist/api/routes/admin/customer-groups/get-customer-group.js.map +1 -1
  83. package/dist/api/routes/admin/customer-groups/index.js +29 -11
  84. package/dist/api/routes/admin/customer-groups/index.js.map +1 -1
  85. package/dist/api/routes/admin/customer-groups/list-customer-groups.d.ts +2 -1
  86. package/dist/api/routes/admin/customer-groups/list-customer-groups.js +10 -45
  87. package/dist/api/routes/admin/customer-groups/list-customer-groups.js.map +1 -1
  88. package/dist/api/routes/admin/customer-groups/update-customer-group.d.ts +2 -1
  89. package/dist/api/routes/admin/customer-groups/update-customer-group.js.map +1 -1
  90. package/dist/api/routes/admin/customers/create-customer.d.ts +1 -1
  91. package/dist/api/routes/admin/customers/create-customer.js.map +1 -1
  92. package/dist/api/routes/admin/customers/update-customer.d.ts +1 -1
  93. package/dist/api/routes/admin/customers/update-customer.js.map +1 -1
  94. package/dist/api/routes/admin/discounts/add-valid-product.d.ts +23 -0
  95. package/dist/api/routes/admin/discounts/add-valid-product.js +82 -0
  96. package/dist/api/routes/admin/discounts/add-valid-product.js.map +1 -0
  97. package/dist/api/routes/admin/discounts/remove-valid-product.d.ts +23 -0
  98. package/dist/api/routes/admin/discounts/remove-valid-product.js +82 -0
  99. package/dist/api/routes/admin/discounts/remove-valid-product.js.map +1 -0
  100. package/dist/api/routes/admin/draft-orders/index.d.ts +1 -1
  101. package/dist/api/routes/admin/draft-orders/index.js +1 -0
  102. package/dist/api/routes/admin/draft-orders/index.js.map +1 -1
  103. package/dist/api/routes/admin/draft-orders/list-draft-orders.js +7 -6
  104. package/dist/api/routes/admin/draft-orders/list-draft-orders.js.map +1 -1
  105. package/dist/api/routes/admin/gift-cards/create-gift-card.d.ts +2 -2
  106. package/dist/api/routes/admin/gift-cards/create-gift-card.js +0 -1
  107. package/dist/api/routes/admin/gift-cards/create-gift-card.js.map +1 -1
  108. package/dist/api/routes/admin/gift-cards/index.d.ts +1 -1
  109. package/dist/api/routes/admin/gift-cards/index.js +19 -5
  110. package/dist/api/routes/admin/gift-cards/index.js.map +1 -1
  111. package/dist/api/routes/admin/gift-cards/list-gift-cards.js +24 -18
  112. package/dist/api/routes/admin/gift-cards/list-gift-cards.js.map +1 -1
  113. package/dist/api/routes/admin/gift-cards/update-gift-card.d.ts +1 -1
  114. package/dist/api/routes/admin/gift-cards/update-gift-card.js.map +1 -1
  115. package/dist/api/routes/admin/orders/create-claim.d.ts +4 -14
  116. package/dist/api/routes/admin/orders/create-claim.js +3 -14
  117. package/dist/api/routes/admin/orders/create-claim.js.map +1 -1
  118. package/dist/api/routes/admin/orders/fulfill-claim.d.ts +1 -1
  119. package/dist/api/routes/admin/orders/fulfill-claim.js.map +1 -1
  120. package/dist/api/routes/admin/orders/update-claim.d.ts +1 -1
  121. package/dist/api/routes/admin/orders/update-claim.js.map +1 -1
  122. package/dist/api/routes/admin/price-lists/create-price-list.d.ts +2 -1
  123. package/dist/api/routes/admin/price-lists/create-price-list.js +4 -7
  124. package/dist/api/routes/admin/price-lists/create-price-list.js.map +1 -1
  125. package/dist/api/routes/admin/price-lists/index.js +26 -7
  126. package/dist/api/routes/admin/price-lists/index.js.map +1 -1
  127. package/dist/api/routes/admin/price-lists/list-price-list-products.d.ts +3 -7
  128. package/dist/api/routes/admin/price-lists/list-price-list-products.js +21 -59
  129. package/dist/api/routes/admin/price-lists/list-price-list-products.js.map +1 -1
  130. package/dist/api/routes/admin/price-lists/list-price-lists.d.ts +2 -1
  131. package/dist/api/routes/admin/price-lists/list-price-lists.js +8 -40
  132. package/dist/api/routes/admin/price-lists/list-price-lists.js.map +1 -1
  133. package/dist/api/routes/admin/products/add-option.js +26 -6
  134. package/dist/api/routes/admin/products/add-option.js.map +1 -1
  135. package/dist/api/routes/admin/products/create-product.d.ts +3 -3
  136. package/dist/api/routes/admin/products/create-product.js +13 -9
  137. package/dist/api/routes/admin/products/create-product.js.map +1 -1
  138. package/dist/api/routes/admin/products/delete-variant.js +26 -6
  139. package/dist/api/routes/admin/products/delete-variant.js.map +1 -1
  140. package/dist/api/routes/admin/products/get-product.js +24 -4
  141. package/dist/api/routes/admin/products/get-product.js.map +1 -1
  142. package/dist/api/routes/admin/products/get-variants.d.ts +24 -0
  143. package/dist/api/routes/admin/products/get-variants.js +76 -0
  144. package/dist/api/routes/admin/products/get-variants.js.map +1 -0
  145. package/dist/api/routes/admin/products/index.d.ts +3 -2
  146. package/dist/api/routes/admin/products/index.js +1 -4
  147. package/dist/api/routes/admin/products/index.js.map +1 -1
  148. package/dist/api/routes/admin/products/list-products.d.ts +1 -6
  149. package/dist/api/routes/admin/products/list-products.js +3 -9
  150. package/dist/api/routes/admin/products/list-products.js.map +1 -1
  151. package/dist/api/routes/admin/products/update-product.d.ts +3 -3
  152. package/dist/api/routes/admin/products/update-product.js +28 -7
  153. package/dist/api/routes/admin/products/update-product.js.map +1 -1
  154. package/dist/api/routes/admin/products/update-variant.js +27 -10
  155. package/dist/api/routes/admin/products/update-variant.js.map +1 -1
  156. package/dist/api/routes/admin/shipping-options/list-shipping-options.js +6 -2
  157. package/dist/api/routes/admin/shipping-options/list-shipping-options.js.map +1 -1
  158. package/dist/api/routes/admin/store/get-store.js +4 -2
  159. package/dist/api/routes/admin/store/get-store.js.map +1 -1
  160. package/dist/api/routes/admin/store/update-store.d.ts +1 -0
  161. package/dist/api/routes/admin/store/update-store.js +5 -0
  162. package/dist/api/routes/admin/store/update-store.js.map +1 -1
  163. package/dist/api/routes/admin/uploads/create-upload.d.ts +1 -1
  164. package/dist/api/routes/admin/uploads/create-upload.js +5 -5
  165. package/dist/api/routes/admin/uploads/create-upload.js.map +1 -1
  166. package/dist/api/routes/admin/uploads/delete-upload.d.ts +4 -1
  167. package/dist/api/routes/admin/uploads/delete-upload.js +29 -11
  168. package/dist/api/routes/admin/uploads/delete-upload.js.map +1 -1
  169. package/dist/api/routes/admin/uploads/get-download-url.d.ts +28 -0
  170. package/dist/api/routes/admin/uploads/get-download-url.js +99 -0
  171. package/dist/api/routes/admin/uploads/get-download-url.js.map +1 -0
  172. package/dist/api/routes/admin/uploads/index.d.ts +10 -3
  173. package/dist/api/routes/admin/uploads/index.js +19 -4
  174. package/dist/api/routes/admin/uploads/index.js.map +1 -1
  175. package/dist/api/routes/store/carts/add-shipping-method.js +6 -2
  176. package/dist/api/routes/store/carts/add-shipping-method.js.map +1 -1
  177. package/dist/api/routes/store/carts/calculate-taxes.js +9 -2
  178. package/dist/api/routes/store/carts/calculate-taxes.js.map +1 -1
  179. package/dist/api/routes/store/carts/create-cart.js +6 -2
  180. package/dist/api/routes/store/carts/create-cart.js.map +1 -1
  181. package/dist/api/routes/store/carts/create-line-item.js +6 -2
  182. package/dist/api/routes/store/carts/create-line-item.js.map +1 -1
  183. package/dist/api/routes/store/carts/create-payment-sessions.js +6 -2
  184. package/dist/api/routes/store/carts/create-payment-sessions.js.map +1 -1
  185. package/dist/api/routes/store/carts/decorate-line-items-with-totals.d.ts +5 -0
  186. package/dist/api/routes/store/carts/decorate-line-items-with-totals.js +71 -0
  187. package/dist/api/routes/store/carts/decorate-line-items-with-totals.js.map +1 -0
  188. package/dist/api/routes/store/carts/delete-discount.js +6 -2
  189. package/dist/api/routes/store/carts/delete-discount.js.map +1 -1
  190. package/dist/api/routes/store/carts/delete-line-item.js +6 -2
  191. package/dist/api/routes/store/carts/delete-line-item.js.map +1 -1
  192. package/dist/api/routes/store/carts/delete-payment-session.js +6 -2
  193. package/dist/api/routes/store/carts/delete-payment-session.js.map +1 -1
  194. package/dist/api/routes/store/carts/get-cart.js +6 -2
  195. package/dist/api/routes/store/carts/get-cart.js.map +1 -1
  196. package/dist/api/routes/store/carts/refresh-payment-session.js +6 -2
  197. package/dist/api/routes/store/carts/refresh-payment-session.js.map +1 -1
  198. package/dist/api/routes/store/carts/set-payment-session.js +6 -2
  199. package/dist/api/routes/store/carts/set-payment-session.js.map +1 -1
  200. package/dist/api/routes/store/carts/update-cart.js +6 -2
  201. package/dist/api/routes/store/carts/update-cart.js.map +1 -1
  202. package/dist/api/routes/store/carts/update-line-item.js +6 -2
  203. package/dist/api/routes/store/carts/update-line-item.js.map +1 -1
  204. package/dist/api/routes/store/carts/update-payment-method.d.ts +38 -0
  205. package/dist/api/routes/store/carts/update-payment-method.js +122 -0
  206. package/dist/api/routes/store/carts/update-payment-method.js.map +1 -0
  207. package/dist/api/routes/store/carts/update-payment-session.js +6 -2
  208. package/dist/api/routes/store/carts/update-payment-session.js.map +1 -1
  209. package/dist/api/routes/store/customers/get-payment-methods.js +6 -7
  210. package/dist/api/routes/store/customers/get-payment-methods.js.map +1 -1
  211. package/dist/api/routes/store/customers/index.d.ts +1 -1
  212. package/dist/api/routes/store/customers/index.js.map +1 -1
  213. package/dist/api/routes/store/customers/update-address.js +1 -1
  214. package/dist/api/routes/store/customers/update-address.js.map +1 -1
  215. package/dist/api/routes/store/customers/update-customer.d.ts +1 -1
  216. package/dist/api/routes/store/customers/update-customer.js.map +1 -1
  217. package/dist/api/routes/store/gift-cards/index.d.ts +1 -1
  218. package/dist/api/routes/store/gift-cards/index.js +6 -1
  219. package/dist/api/routes/store/gift-cards/index.js.map +1 -1
  220. package/dist/api/routes/store/products/get-product.js +51 -12
  221. package/dist/api/routes/store/products/get-product.js.map +1 -1
  222. package/dist/api/routes/store/products/list-products.js +30 -7
  223. package/dist/api/routes/store/products/list-products.js.map +1 -1
  224. package/dist/api/routes/store/shipping-options/list-options.js +6 -2
  225. package/dist/api/routes/store/shipping-options/list-options.js.map +1 -1
  226. package/dist/api/routes/store/shipping-options/list-shipping-options.js +8 -2
  227. package/dist/api/routes/store/shipping-options/list-shipping-options.js.map +1 -1
  228. package/dist/api/routes/store/variants/get-variant.js +51 -12
  229. package/dist/api/routes/store/variants/get-variant.js.map +1 -1
  230. package/dist/api/routes/store/variants/list-variants.js +29 -6
  231. package/dist/api/routes/store/variants/list-variants.js.map +1 -1
  232. package/dist/commands/migrate.js +29 -14
  233. package/dist/commands/migrate.js.map +1 -1
  234. package/dist/commands/seed.js +14 -10
  235. package/dist/commands/seed.js.map +1 -1
  236. package/dist/commands/start.js +1 -1
  237. package/dist/commands/utils/get-migrations.d.ts +2 -1
  238. package/dist/commands/utils/get-migrations.js +95 -36
  239. package/dist/commands/utils/get-migrations.js.map +1 -1
  240. package/dist/config/index.d.ts +14 -0
  241. package/dist/config/index.js +40 -0
  242. package/dist/config/index.js.map +1 -0
  243. package/dist/controllers/products/admin-list-products.js +16 -8
  244. package/dist/controllers/products/admin-list-products.js.map +1 -1
  245. package/dist/helpers/test-request.js +21 -15
  246. package/dist/helpers/test-request.js.map +1 -1
  247. package/dist/interfaces/abstract-parser.d.ts +25 -0
  248. package/dist/interfaces/abstract-parser.js +14 -0
  249. package/dist/interfaces/abstract-parser.js.map +1 -0
  250. package/dist/interfaces/base-service.d.ts +66 -0
  251. package/dist/interfaces/base-service.js +377 -0
  252. package/dist/interfaces/base-service.js.map +1 -0
  253. package/dist/interfaces/batch-job-strategy.d.ts +34 -0
  254. package/dist/interfaces/batch-job-strategy.js +182 -0
  255. package/dist/interfaces/batch-job-strategy.js.map +1 -0
  256. package/dist/interfaces/csv-parser.d.ts +46 -0
  257. package/dist/interfaces/csv-parser.js +15 -0
  258. package/dist/interfaces/csv-parser.js.map +1 -0
  259. package/dist/interfaces/file-service.d.ts +66 -0
  260. package/dist/interfaces/file-service.js +32 -0
  261. package/dist/interfaces/file-service.js.map +1 -0
  262. package/dist/interfaces/index.d.ts +2 -0
  263. package/dist/interfaces/index.js +2 -0
  264. package/dist/interfaces/index.js.map +1 -1
  265. package/dist/loaders/config.js +3 -2
  266. package/dist/loaders/config.js.map +1 -1
  267. package/dist/loaders/feature-flags/index.d.ts +6 -0
  268. package/dist/loaders/feature-flags/index.js +71 -0
  269. package/dist/loaders/feature-flags/index.js.map +1 -0
  270. package/dist/loaders/index.d.ts +1 -1
  271. package/dist/loaders/index.js +8 -5
  272. package/dist/loaders/index.js.map +1 -1
  273. package/dist/loaders/plugins.d.ts +4 -3
  274. package/dist/loaders/plugins.js +71 -34
  275. package/dist/loaders/plugins.js.map +1 -1
  276. package/dist/loaders/redis.d.ts +1 -1
  277. package/dist/loaders/redis.js.map +1 -1
  278. package/dist/loaders/search-index.js +1 -0
  279. package/dist/loaders/search-index.js.map +1 -1
  280. package/dist/loaders/strategies.d.ts +2 -2
  281. package/dist/loaders/strategies.js +21 -7
  282. package/dist/loaders/strategies.js.map +1 -1
  283. package/dist/migrations/1649775522087-add_batch_job_model.js +4 -4
  284. package/dist/migrations/1649775522087-add_batch_job_model.js.map +1 -1
  285. package/dist/models/batch-job.d.ts +45 -4
  286. package/dist/models/batch-job.js +94 -7
  287. package/dist/models/batch-job.js.map +1 -1
  288. package/dist/models/customer.d.ts +1 -1
  289. package/dist/models/customer.js +1 -1
  290. package/dist/models/customer.js.map +1 -1
  291. package/dist/models/draft-order.d.ts +1 -2
  292. package/dist/models/draft-order.js +2 -2
  293. package/dist/models/draft-order.js.map +1 -1
  294. package/dist/models/line-item.d.ts +9 -2
  295. package/dist/models/line-item.js +2 -2
  296. package/dist/models/line-item.js.map +1 -1
  297. package/dist/models/product.d.ts +17 -17
  298. package/dist/models/product.js +34 -34
  299. package/dist/models/product.js.map +1 -1
  300. package/dist/models/shipping-method.d.ts +1 -1
  301. package/dist/models/shipping-method.js +1 -1
  302. package/dist/models/shipping-method.js.map +1 -1
  303. package/dist/models/shipping-option.d.ts +1 -1
  304. package/dist/models/shipping-option.js +1 -1
  305. package/dist/models/shipping-option.js.map +1 -1
  306. package/dist/repositories/customer.d.ts +2 -1
  307. package/dist/repositories/customer.js +18 -7
  308. package/dist/repositories/customer.js.map +1 -1
  309. package/dist/repositories/gift-card.d.ts +5 -1
  310. package/dist/repositories/gift-card.js +124 -29
  311. package/dist/repositories/gift-card.js.map +1 -1
  312. package/dist/repositories/image.d.ts +1 -0
  313. package/dist/repositories/image.js +100 -0
  314. package/dist/repositories/image.js.map +1 -1
  315. package/dist/repositories/price-list.js.map +1 -1
  316. package/dist/repositories/product-tag.d.ts +6 -0
  317. package/dist/repositories/product-tag.js +113 -0
  318. package/dist/repositories/product-tag.js.map +1 -1
  319. package/dist/repositories/product-type.d.ts +5 -0
  320. package/dist/repositories/product-type.js +64 -0
  321. package/dist/repositories/product-type.js.map +1 -1
  322. package/dist/repositories/product-variant.js +4 -5
  323. package/dist/repositories/product-variant.js.map +1 -1
  324. package/dist/repositories/product.d.ts +14 -17
  325. package/dist/repositories/product.js +64 -2
  326. package/dist/repositories/product.js.map +1 -1
  327. package/dist/repositories/tax-rate.d.ts +1 -1
  328. package/dist/repositories/tax-rate.js +2 -9
  329. package/dist/repositories/tax-rate.js.map +1 -1
  330. package/dist/services/auth.d.ts +16 -7
  331. package/dist/services/auth.js +130 -93
  332. package/dist/services/auth.js.map +1 -1
  333. package/dist/services/batch-job.d.ts +30 -5
  334. package/dist/services/batch-job.js +437 -2
  335. package/dist/services/batch-job.js.map +1 -1
  336. package/dist/services/cart.js +34 -13
  337. package/dist/services/cart.js.map +1 -1
  338. package/dist/services/claim-item.d.ts +23 -27
  339. package/dist/services/claim-item.js +217 -247
  340. package/dist/services/claim-item.js.map +1 -1
  341. package/dist/services/claim.d.ts +89 -71
  342. package/dist/services/claim.js +911 -879
  343. package/dist/services/claim.js.map +1 -1
  344. package/dist/services/csv-parser.d.ts +17 -0
  345. package/dist/services/csv-parser.js +319 -0
  346. package/dist/services/csv-parser.js.map +1 -0
  347. package/dist/services/custom-shipping-option.d.ts +30 -32
  348. package/dist/services/custom-shipping-option.js +78 -74
  349. package/dist/services/custom-shipping-option.js.map +1 -1
  350. package/dist/services/customer.d.ts +48 -50
  351. package/dist/services/customer.js +465 -428
  352. package/dist/services/customer.js.map +1 -1
  353. package/dist/services/discount-condition.d.ts +13 -13
  354. package/dist/services/discount-condition.js +5 -16
  355. package/dist/services/discount-condition.js.map +1 -1
  356. package/dist/services/discount.d.ts +22 -16
  357. package/dist/services/discount.js +530 -484
  358. package/dist/services/discount.js.map +1 -1
  359. package/dist/services/draft-order.d.ts +69 -66
  360. package/dist/services/draft-order.js +375 -353
  361. package/dist/services/draft-order.js.map +1 -1
  362. package/dist/services/event-bus.d.ts +72 -56
  363. package/dist/services/event-bus.js +122 -99
  364. package/dist/services/event-bus.js.map +1 -1
  365. package/dist/services/file.d.ts +14 -0
  366. package/dist/services/file.js +43 -0
  367. package/dist/services/file.js.map +1 -0
  368. package/dist/services/fulfillment.d.ts +63 -64
  369. package/dist/services/fulfillment.js +200 -194
  370. package/dist/services/fulfillment.js.map +1 -1
  371. package/dist/services/gift-card.d.ts +54 -45
  372. package/dist/services/gift-card.js +239 -221
  373. package/dist/services/gift-card.js.map +1 -1
  374. package/dist/services/idempotency-key.d.ts +1 -5
  375. package/dist/services/idempotency-key.js +2 -5
  376. package/dist/services/idempotency-key.js.map +1 -1
  377. package/dist/services/index.d.ts +11 -9
  378. package/dist/services/index.js +23 -19
  379. package/dist/services/index.js.map +1 -1
  380. package/dist/services/line-item.d.ts +3 -2
  381. package/dist/services/line-item.js +9 -7
  382. package/dist/services/line-item.js.map +1 -1
  383. package/dist/services/price-list.d.ts +4 -1
  384. package/dist/services/price-list.js +7 -4
  385. package/dist/services/price-list.js.map +1 -1
  386. package/dist/services/pricing.d.ts +101 -0
  387. package/dist/services/pricing.js +588 -0
  388. package/dist/services/pricing.js.map +1 -0
  389. package/dist/services/product-variant.d.ts +0 -11
  390. package/dist/services/product-variant.js +28 -138
  391. package/dist/services/product-variant.js.map +1 -1
  392. package/dist/services/product.d.ts +107 -145
  393. package/dist/services/product.js +708 -1036
  394. package/dist/services/product.js.map +1 -1
  395. package/dist/services/region.js +4 -4
  396. package/dist/services/region.js.map +1 -1
  397. package/dist/services/shipping-option.d.ts +43 -108
  398. package/dist/services/shipping-option.js +305 -352
  399. package/dist/services/shipping-option.js.map +1 -1
  400. package/dist/services/shipping-profile.d.ts +2 -2
  401. package/dist/services/shipping-profile.js +1 -1
  402. package/dist/services/store.d.ts +36 -45
  403. package/dist/services/store.js +207 -217
  404. package/dist/services/store.js.map +1 -1
  405. package/dist/services/strategy-resolver.d.ts +13 -0
  406. package/dist/services/strategy-resolver.js +40 -0
  407. package/dist/services/strategy-resolver.js.map +1 -0
  408. package/dist/services/tax-provider.d.ts +7 -3
  409. package/dist/services/tax-provider.js +6 -6
  410. package/dist/services/tax-provider.js.map +1 -1
  411. package/dist/services/tax-rate.d.ts +1 -1
  412. package/dist/services/tax-rate.js +2 -2
  413. package/dist/services/tax-rate.js.map +1 -1
  414. package/dist/services/totals.js.map +1 -1
  415. package/dist/services/user.d.ts +8 -9
  416. package/dist/services/user.js +216 -168
  417. package/dist/services/user.js.map +1 -1
  418. package/dist/strategies/__fixtures__/order-export-data.d.ts +3 -0
  419. package/dist/strategies/__fixtures__/order-export-data.js +70 -0
  420. package/dist/strategies/__fixtures__/order-export-data.js.map +1 -0
  421. package/dist/strategies/__fixtures__/product-export-data.d.ts +319 -0
  422. package/dist/strategies/__fixtures__/product-export-data.js +401 -0
  423. package/dist/strategies/__fixtures__/product-export-data.js.map +1 -0
  424. package/dist/strategies/batch-jobs/order/export.d.ts +36 -0
  425. package/dist/strategies/batch-jobs/order/export.js +351 -0
  426. package/dist/strategies/batch-jobs/order/export.js.map +1 -0
  427. package/dist/strategies/batch-jobs/order/index.d.ts +29 -0
  428. package/dist/strategies/batch-jobs/order/index.js +115 -0
  429. package/dist/strategies/batch-jobs/order/index.js.map +1 -0
  430. package/dist/strategies/batch-jobs/product/export.d.ts +36 -0
  431. package/dist/strategies/batch-jobs/product/export.js +546 -0
  432. package/dist/strategies/batch-jobs/product/export.js.map +1 -0
  433. package/dist/strategies/batch-jobs/product/index.d.ts +45 -0
  434. package/dist/strategies/batch-jobs/product/index.js +272 -0
  435. package/dist/strategies/batch-jobs/product/index.js.map +1 -0
  436. package/dist/subscribers/batch-job.d.ts +17 -0
  437. package/dist/subscribers/batch-job.js +96 -0
  438. package/dist/subscribers/batch-job.js.map +1 -0
  439. package/dist/types/batch-job.d.ts +23 -2
  440. package/dist/types/batch-job.js +4 -1
  441. package/dist/types/batch-job.js.map +1 -1
  442. package/dist/types/claim.d.ts +67 -0
  443. package/dist/types/claim.js +3 -0
  444. package/dist/types/claim.js.map +1 -0
  445. package/dist/types/common.d.ts +27 -3
  446. package/dist/types/common.js.map +1 -1
  447. package/dist/types/customers.d.ts +24 -0
  448. package/dist/types/customers.js.map +1 -1
  449. package/dist/types/discount.d.ts +2 -1
  450. package/dist/types/discount.js.map +1 -1
  451. package/dist/types/feature-flags.d.ts +9 -0
  452. package/dist/types/feature-flags.js +3 -0
  453. package/dist/types/feature-flags.js.map +1 -0
  454. package/dist/types/fulfillment.d.ts +27 -0
  455. package/dist/types/fulfillment.js +3 -0
  456. package/dist/types/fulfillment.js.map +1 -0
  457. package/dist/types/gift-card.d.ts +21 -0
  458. package/dist/types/gift-card.js +3 -0
  459. package/dist/types/gift-card.js.map +1 -0
  460. package/dist/types/global.d.ts +12 -1
  461. package/dist/types/price-list.d.ts +9 -0
  462. package/dist/types/pricing.d.ts +30 -0
  463. package/dist/types/pricing.js +3 -0
  464. package/dist/types/pricing.js.map +1 -0
  465. package/dist/types/product-variant.d.ts +4 -3
  466. package/dist/types/product-variant.js.map +1 -1
  467. package/dist/types/product.d.ts +110 -8
  468. package/dist/types/product.js +8 -11
  469. package/dist/types/product.js.map +1 -1
  470. package/dist/types/shipping-options.d.ts +62 -0
  471. package/dist/types/shipping-options.js +3 -0
  472. package/dist/types/shipping-options.js.map +1 -0
  473. package/dist/types/store.d.ts +9 -0
  474. package/dist/types/store.js +3 -0
  475. package/dist/types/store.js.map +1 -0
  476. package/dist/utils/build-query.d.ts +7 -7
  477. package/dist/utils/build-query.js +9 -5
  478. package/dist/utils/build-query.js.map +1 -1
  479. package/dist/utils/countries.d.ts +3 -2
  480. package/dist/utils/countries.js.map +1 -1
  481. package/dist/utils/currencies.d.ts +10 -1899
  482. package/dist/utils/currencies.js.map +1 -1
  483. package/dist/utils/db-aware-column.js +2 -2
  484. package/dist/utils/db-aware-column.js.map +1 -1
  485. package/dist/utils/feature-flag-decorators.d.ts +4 -0
  486. package/dist/utils/feature-flag-decorators.js +52 -0
  487. package/dist/utils/feature-flag-decorators.js.map +1 -0
  488. package/dist/utils/flag-router.d.ts +7 -0
  489. package/dist/utils/flag-router.js +19 -0
  490. package/dist/utils/flag-router.js.map +1 -0
  491. package/dist/utils/format-registration-name.d.ts +4 -4
  492. package/dist/utils/format-registration-name.js +7 -10
  493. package/dist/utils/format-registration-name.js.map +1 -1
  494. package/dist/utils/get-query-config.d.ts +4 -6
  495. package/dist/utils/get-query-config.js +46 -1
  496. package/dist/utils/get-query-config.js.map +1 -1
  497. package/dist/utils/omit-relation-if-exists.d.ts +7 -0
  498. package/dist/utils/omit-relation-if-exists.js +16 -0
  499. package/dist/utils/omit-relation-if-exists.js.map +1 -0
  500. package/dist/utils/set-metadata.d.ts +6 -6
  501. package/dist/utils/set-metadata.js +5 -5
  502. package/dist/utils/set-metadata.js.map +1 -1
  503. package/dist/utils/sleep.d.ts +1 -0
  504. package/dist/utils/sleep.js +50 -0
  505. package/dist/utils/sleep.js.map +1 -0
  506. package/package.json +6 -4
  507. package/yarn-error.log +29038 -0
@@ -1,129 +1,124 @@
1
- export default ProductService;
2
- declare const ProductService_base: any;
3
- /**
4
- * Provides layer to manipulate products.
5
- * @extends BaseService
6
- */
7
- declare class ProductService extends ProductService_base {
8
- [x: string]: any;
9
- static IndexName: string;
10
- static Events: {
1
+ import { EntityManager } from "typeorm";
2
+ import { SearchService } from ".";
3
+ import { TransactionBaseService } from "../interfaces";
4
+ import { Product, ProductTag, ProductType, ProductVariant } from "../models";
5
+ import { ImageRepository } from "../repositories/image";
6
+ import { FindWithoutRelationsOptions, ProductRepository } from "../repositories/product";
7
+ import { ProductOptionRepository } from "../repositories/product-option";
8
+ import { ProductTagRepository } from "../repositories/product-tag";
9
+ import { ProductTypeRepository } from "../repositories/product-type";
10
+ import { ProductVariantRepository } from "../repositories/product-variant";
11
+ import { Selector } from "../types/common";
12
+ import { CreateProductInput, FilterableProductProps, FindProductConfig, ProductOptionInput, UpdateProductInput } from "../types/product";
13
+ import EventBusService from "./event-bus";
14
+ import ProductVariantService from "./product-variant";
15
+ declare type InjectedDependencies = {
16
+ manager: EntityManager;
17
+ productOptionRepository: typeof ProductOptionRepository;
18
+ productRepository: typeof ProductRepository;
19
+ productVariantRepository: typeof ProductVariantRepository;
20
+ productTypeRepository: typeof ProductTypeRepository;
21
+ productTagRepository: typeof ProductTagRepository;
22
+ imageRepository: typeof ImageRepository;
23
+ productVariantService: ProductVariantService;
24
+ searchService: SearchService;
25
+ eventBusService: EventBusService;
26
+ };
27
+ declare class ProductService extends TransactionBaseService<ProductService> {
28
+ protected manager_: EntityManager;
29
+ protected transactionManager_: EntityManager | undefined;
30
+ protected readonly productOptionRepository_: typeof ProductOptionRepository;
31
+ protected readonly productRepository_: typeof ProductRepository;
32
+ protected readonly productVariantRepository_: typeof ProductVariantRepository;
33
+ protected readonly productTypeRepository_: typeof ProductTypeRepository;
34
+ protected readonly productTagRepository_: typeof ProductTagRepository;
35
+ protected readonly imageRepository_: typeof ImageRepository;
36
+ protected readonly productVariantService_: ProductVariantService;
37
+ protected readonly searchService_: SearchService;
38
+ protected readonly eventBus_: EventBusService;
39
+ static readonly IndexName = "products";
40
+ static readonly Events: {
11
41
  UPDATED: string;
12
42
  CREATED: string;
13
43
  DELETED: string;
14
44
  };
15
- constructor({ manager, productRepository, productVariantRepository, productOptionRepository, eventBusService, productVariantService, productCollectionService, productTypeRepository, productTagRepository, imageRepository, searchService, cartRepository, priceSelectionStrategy, }: {
16
- manager: any;
17
- productRepository: any;
18
- productVariantRepository: any;
19
- productOptionRepository: any;
20
- eventBusService: any;
21
- productVariantService: any;
22
- productCollectionService: any;
23
- productTypeRepository: any;
24
- productTagRepository: any;
25
- imageRepository: any;
26
- searchService: any;
27
- cartRepository: any;
28
- priceSelectionStrategy: any;
29
- });
30
- /** @private @const {EntityManager} */
31
- private manager_;
32
- /** @private @const {ProductOption} */
33
- private productOptionRepository_;
34
- /** @private @const {Product} */
35
- private productRepository_;
36
- /** @private @const {ProductVariant} */
37
- private productVariantRepository_;
38
- /** @private @const {EventBus} */
39
- private eventBus_;
40
- /** @private @const {ProductVariantService} */
41
- private productVariantService_;
42
- /** @private @const {ProductCollectionService} */
43
- private productCollectionService_;
44
- /** @private @const {ProductCollectionService} */
45
- private productTypeRepository_;
46
- /** @private @const {ProductCollectionService} */
47
- private productTagRepository_;
48
- /** @private @const {ImageRepository} */
49
- private imageRepository_;
50
- /** @private @const {SearchService} */
51
- private searchService_;
52
- /** @private @const {CartRepository} */
53
- private cartRepository_;
54
- /** @private @const {IPriceSelectionStrategy} */
55
- private priceSelectionStrategy_;
56
- withTransaction(transactionManager: any): ProductService;
45
+ constructor({ manager, productRepository, productVariantRepository, productOptionRepository, eventBusService, productVariantService, productTypeRepository, productTagRepository, imageRepository, searchService, }: InjectedDependencies);
57
46
  /**
58
47
  * Lists products based on the provided parameters.
59
- * @param {object} selector - an object that defines rules to filter products
48
+ * @param selector - an object that defines rules to filter products
60
49
  * by
61
- * @param {object} config - object that defines the scope for what should be
50
+ * @param config - object that defines the scope for what should be
62
51
  * returned
63
- * @return {Promise<Product[]>} the result of the find operation
52
+ * @return the result of the find operation
64
53
  */
65
- list(selector?: object, config?: object): Promise<Product[]>;
54
+ list(selector?: FilterableProductProps | Selector<Product>, config?: FindProductConfig): Promise<Product[]>;
66
55
  /**
67
56
  * Lists products based on the provided parameters and includes the count of
68
57
  * products that match the query.
69
- * @param {object} selector - an object that defines rules to filter products
58
+ * @param selector - an object that defines rules to filter products
70
59
  * by
71
- * @param {object} config - object that defines the scope for what should be
60
+ * @param config - object that defines the scope for what should be
72
61
  * returned
73
- * @return {Promise<[Product[], number]>} an array containing the products as
62
+ * @return an array containing the products as
74
63
  * the first element and the total count of products that matches the query
75
64
  * as the second element.
76
65
  */
77
- listAndCount(selector?: object, config?: object): Promise<[Product[], number]>;
66
+ listAndCount(selector: FilterableProductProps | Selector<Product>, config?: FindProductConfig): Promise<[Product[], number]>;
78
67
  /**
79
68
  * Return the total number of documents in database
80
69
  * @param {object} selector - the selector to choose products by
81
70
  * @return {Promise} the result of the count operation
82
71
  */
83
- count(selector?: object): Promise<any>;
72
+ count(selector?: Selector<Product>): Promise<number>;
84
73
  /**
85
74
  * Gets a product by id.
86
75
  * Throws in case of DB Error and if product was not found.
87
- * @param {string} productId - id of the product to get.
88
- * @param {object} config - object that defines what should be included in the
76
+ * @param productId - id of the product to get.
77
+ * @param config - object that defines what should be included in the
89
78
  * query response
90
- * @return {Promise<Product>} the result of the find one operation.
79
+ * @return the result of the find one operation.
91
80
  */
92
- retrieve(productId: string, config?: object): Promise<Product>;
81
+ retrieve(productId: string, config?: FindProductConfig): Promise<Product>;
93
82
  /**
94
83
  * Gets a product by handle.
95
84
  * Throws in case of DB Error and if product was not found.
96
- * @param {string} productHandle - handle of the product to get.
97
- * @param {object} config - details about what to get from the product
98
- * @return {Promise<Product>} the result of the find one operation.
85
+ * @param productHandle - handle of the product to get.
86
+ * @param config - details about what to get from the product
87
+ * @return the result of the find one operation.
99
88
  */
100
- retrieveByHandle(productHandle: string, config?: object): Promise<Product>;
89
+ retrieveByHandle(productHandle: string, config?: FindProductConfig): Promise<Product>;
101
90
  /**
102
91
  * Gets a product by external id.
103
92
  * Throws in case of DB Error and if product was not found.
104
- * @param {string} externalId - handle of the product to get.
105
- * @param {object} config - details about what to get from the product
106
- * @return {Promise<Product>} the result of the find one operation.
93
+ * @param externalId - handle of the product to get.
94
+ * @param config - details about what to get from the product
95
+ * @return the result of the find one operation.
96
+ */
97
+ retrieveByExternalId(externalId: string, config?: FindProductConfig): Promise<Product>;
98
+ /**
99
+ * Gets a product by selector.
100
+ * Throws in case of DB Error and if product was not found.
101
+ * @param selector - selector object
102
+ * @param config - object that defines what should be included in the
103
+ * query response
104
+ * @return the result of the find one operation.
107
105
  */
108
- retrieveByExternalId(externalId: string, config?: object): Promise<Product>;
106
+ retrieve_(selector: Selector<Product>, config?: FindProductConfig): Promise<Product>;
109
107
  /**
110
108
  * Gets all variants belonging to a product.
111
- * @param {string} productId - the id of the product to get variants from.
112
- * @param {FindConfig<Product>} config - The config to select and configure relations etc...
113
- * @return {Promise} an array of variants
109
+ * @param productId - the id of the product to get variants from.
110
+ * @param config - The config to select and configure relations etc...
111
+ * @return an array of variants
114
112
  */
115
- retrieveVariants(productId: string, config?: FindConfig<Product>): Promise<any>;
116
- listTypes(): Promise<any>;
117
- listTagsByUsage(count?: number): Promise<any>;
118
- upsertProductType_(type: any): Promise<any>;
119
- upsertProductTags_(tags: any): Promise<any[]>;
113
+ retrieveVariants(productId: string, config?: FindProductConfig): Promise<ProductVariant[]>;
114
+ listTypes(): Promise<ProductType[]>;
115
+ listTagsByUsage(count?: number): Promise<ProductTag[]>;
120
116
  /**
121
117
  * Creates a product.
122
- * @param {object} productObject - the product to create
123
- * @return {Promise} resolves to the creation result.
118
+ * @param productObject - the product to create
119
+ * @return resolves to the creation result.
124
120
  */
125
- create(productObject: object): Promise<any>;
126
- upsertImages_(images: any): Promise<any[]>;
121
+ create(productObject: CreateProductInput): Promise<Product>;
127
122
  /**
128
123
  * Updates a product. Product variant updates should use dedicated methods,
129
124
  * e.g. `addVariant`, etc. The function will throw errors if metadata or
@@ -133,85 +128,52 @@ declare class ProductService extends ProductService_base {
133
128
  * @param {object} update - an object with the update values.
134
129
  * @return {Promise} resolves to the update result.
135
130
  */
136
- update(productId: string, update: object): Promise<any>;
131
+ update(productId: string, update: UpdateProductInput): Promise<Product>;
137
132
  /**
138
133
  * Deletes a product from a given product id. The product's associated
139
134
  * variants will also be deleted.
140
- * @param {string} productId - the id of the product to delete. Must be
135
+ * @param productId - the id of the product to delete. Must be
141
136
  * castable as an ObjectId
142
- * @return {Promise} empty promise
137
+ * @return empty promise
143
138
  */
144
- delete(productId: string): Promise<any>;
139
+ delete(productId: string): Promise<void>;
145
140
  /**
146
141
  * Adds an option to a product. Options can, for example, be "Size", "Color",
147
142
  * etc. Will update all the products variants with a dummy value for the newly
148
143
  * created option. The same option cannot be added more than once.
149
- * @param {string} productId - the product to apply the new option to
150
- * @param {string} optionTitle - the display title of the option, e.g. "Size"
151
- * @return {Promise} the result of the model update operation
152
- */
153
- addOption(productId: string, optionTitle: string): Promise<any>;
154
- reorderVariants(productId: any, variantOrder: any): Promise<any>;
155
- /**
156
- * Changes the order of a product's options. Will throw if the length of
157
- * optionOrder and the length of the product's options are different. Will
158
- * throw optionOrder contains an id not associated with the product.
159
- * @param {string} productId - the product whose options we are reordering
160
- * @param {string[]} optionOrder - the ids of the product's options in the
161
- * new order
162
- * @return {Promise} the result of the update operation
144
+ * @param productId - the product to apply the new option to
145
+ * @param optionTitle - the display title of the option, e.g. "Size"
146
+ * @return the result of the model update operation
163
147
  */
164
- reorderOptions(productId: string, optionOrder: string[]): Promise<any>;
148
+ addOption(productId: string, optionTitle: string): Promise<Product>;
149
+ reorderVariants(productId: string, variantOrder: string[]): Promise<Product>;
165
150
  /**
166
151
  * Updates a product's option. Throws if the call tries to update an option
167
152
  * not associated with the product. Throws if the updated title already exists.
168
- * @param {string} productId - the product whose option we are updating
169
- * @param {string} optionId - the id of the option we are updating
170
- * @param {object} data - the data to update the option with
171
- * @return {Promise} the updated product
153
+ * @param productId - the product whose option we are updating
154
+ * @param optionId - the id of the option we are updating
155
+ * @param data - the data to update the option with
156
+ * @return the updated product
172
157
  */
173
- updateOption(productId: string, optionId: string, data: object): Promise<any>;
158
+ updateOption(productId: string, optionId: string, data: ProductOptionInput): Promise<Product>;
174
159
  /**
175
160
  * Delete an option from a product.
176
- * @param {string} productId - the product to delete an option from
177
- * @param {string} optionId - the option to delete
178
- * @return {Promise} the updated product
161
+ * @param productId - the product to delete an option from
162
+ * @param optionId - the option to delete
163
+ * @return the updated product
179
164
  */
180
- deleteOption(productId: string, optionId: string): Promise<any>;
181
- /**
182
- * Decorates a product with product variants.
183
- * @param {string} productId - the productId to decorate.
184
- * @param {string[]} fields - the fields to include.
185
- * @param {string[]} expandFields - fields to expand.
186
- * @param {object} config - retrieve config for price calculation.
187
- * @return {Product} return the decorated product.
188
- */
189
- decorate(productId: string, fields?: string[], expandFields?: string[], config?: object): Product;
165
+ deleteOption(productId: string, optionId: string): Promise<Product | void>;
190
166
  /**
191
167
  * Creates a query object to be used for list queries.
192
- * @param {object} selector - the selector to create the query from
193
- * @param {object} config - the config to use for the query
194
- * @return {object} an object containing the query, relations and free-text
168
+ * @param selector - the selector to create the query from
169
+ * @param config - the config to use for the query
170
+ * @return an object containing the query, relations and free-text
195
171
  * search param.
196
172
  */
197
- prepareListQuery_(selector: object, config: object): object;
198
- /**
199
- * Creates a QueryBuilder that can fetch products based on free text.
200
- * @param {ProductRepository} productRepo - an instance of a ProductRepositry
201
- * @param {FindOptions<Product>} query - the query to get products by
202
- * @param {string} q - the text to perform free text search from
203
- * @return {QueryBuilder<Product>} a query builder that can fetch products
204
- */
205
- getFreeTextQueryBuilder_(productRepo: ProductRepository, query: FindOptions<Product>, q: string): QueryBuilder<Product>;
206
- /**
207
- * Set additional prices on a list of products.
208
- * @param {Product[] | Product} products list of products on which to set additional prices
209
- * @param {string} currency_code currency code to fetch prices for
210
- * @param {string} region_id region to fetch prices for
211
- * @param {string} cart_id string of cart to use as a basis for getting currency and region
212
- * @param {string} customer_id id of potentially logged in customer, used to get prices valid for their customer groups
213
- * @param {boolean} include_discount_prices indication wether or not to include sales prices in result
214
- * @return {Promise<Product[]>} A list of products with variants decorated with "additional_prices"
215
- */
216
- setAdditionalPrices(products: Product[] | Product, currency_code: string, region_id: string, cart_id: string, customer_id: string, include_discount_prices?: boolean): Promise<Product[]>;
173
+ protected prepareListQuery_(selector: FilterableProductProps | Selector<Product>, config: FindProductConfig): {
174
+ q: string;
175
+ relations: (keyof Product)[];
176
+ query: FindWithoutRelationsOptions;
177
+ };
217
178
  }
179
+ export default ProductService;