@vendure/core 1.9.4 → 2.0.0-beta.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 (1065) hide show
  1. package/cli/index.js +5 -1
  2. package/cli/index.js.map +1 -1
  3. package/cli/populate.js +7 -25
  4. package/cli/populate.js.map +1 -1
  5. package/cli/vendure-cli.js +12 -12
  6. package/cli/vendure-cli.js.map +1 -1
  7. package/dist/api/api-internal-modules.d.ts +4 -2
  8. package/dist/api/api-internal-modules.js +15 -7
  9. package/dist/api/api-internal-modules.js.map +1 -1
  10. package/dist/api/api.module.d.ts +1 -1
  11. package/dist/api/api.module.js +7 -6
  12. package/dist/api/api.module.js.map +1 -1
  13. package/dist/api/common/configurable-operation-codec.js +1 -1
  14. package/dist/api/common/configurable-operation-codec.js.map +1 -1
  15. package/dist/api/common/custom-field-relation-resolver.service.js +2 -2
  16. package/dist/api/common/custom-field-relation-resolver.service.js.map +1 -1
  17. package/dist/api/common/get-api-type.d.ts +1 -1
  18. package/dist/api/common/graphql-value-transformer.d.ts +2 -2
  19. package/dist/api/common/graphql-value-transformer.js +9 -9
  20. package/dist/api/common/graphql-value-transformer.js.map +1 -1
  21. package/dist/api/common/id-codec.d.ts +1 -1
  22. package/dist/api/common/id-codec.js +6 -3
  23. package/dist/api/common/id-codec.js.map +1 -1
  24. package/dist/api/common/id-codec.service.js +1 -1
  25. package/dist/api/common/id-codec.service.js.map +1 -1
  26. package/dist/api/common/parse-context.d.ts +2 -2
  27. package/dist/api/common/request-context.d.ts +5 -2
  28. package/dist/api/common/request-context.js +10 -6
  29. package/dist/api/common/request-context.js.map +1 -1
  30. package/dist/api/common/set-session-token.js +1 -1
  31. package/dist/api/common/set-session-token.js.map +1 -1
  32. package/dist/api/common/validate-custom-field-value.js +2 -1
  33. package/dist/api/common/validate-custom-field-value.js.map +1 -1
  34. package/dist/api/config/configure-graphql-module.js +24 -21
  35. package/dist/api/config/configure-graphql-module.js.map +1 -1
  36. package/dist/api/config/generate-active-order-types.d.ts +1 -1
  37. package/dist/api/config/generate-active-order-types.js +6 -5
  38. package/dist/api/config/generate-active-order-types.js.map +1 -1
  39. package/dist/api/config/generate-auth-types.js +3 -3
  40. package/dist/api/config/generate-auth-types.js.map +1 -1
  41. package/dist/api/config/generate-error-code-enum.js +2 -2
  42. package/dist/api/config/generate-error-code-enum.js.map +1 -1
  43. package/dist/api/config/generate-list-options.d.ts +1 -1
  44. package/dist/api/config/generate-list-options.js +40 -31
  45. package/dist/api/config/generate-list-options.js.map +1 -1
  46. package/dist/api/config/generate-permissions.js +2 -2
  47. package/dist/api/config/generate-permissions.js.map +1 -1
  48. package/dist/api/config/generate-resolvers.d.ts +53 -51
  49. package/dist/api/config/generate-resolvers.js +9 -4
  50. package/dist/api/config/generate-resolvers.js.map +1 -1
  51. package/dist/api/config/graphql-custom-fields.js +59 -51
  52. package/dist/api/config/graphql-custom-fields.js.map +1 -1
  53. package/dist/api/config/money-scalar.d.ts +9 -0
  54. package/dist/api/config/money-scalar.js +74 -0
  55. package/dist/api/config/money-scalar.js.map +1 -0
  56. package/dist/api/decorators/allow.decorator.js +1 -1
  57. package/dist/api/decorators/allow.decorator.js.map +1 -1
  58. package/dist/api/decorators/api.decorator.js +2 -2
  59. package/dist/api/decorators/api.decorator.js.map +1 -1
  60. package/dist/api/decorators/relations.decorator.d.ts +5 -5
  61. package/dist/api/decorators/relations.decorator.js +14 -15
  62. package/dist/api/decorators/relations.decorator.js.map +1 -1
  63. package/dist/api/decorators/request-context.decorator.js +2 -1
  64. package/dist/api/decorators/request-context.decorator.js.map +1 -1
  65. package/dist/api/decorators/transaction.decorator.d.ts +1 -1
  66. package/dist/api/decorators/transaction.decorator.js +1 -1
  67. package/dist/api/decorators/transaction.decorator.js.map +1 -1
  68. package/dist/api/index.js +5 -1
  69. package/dist/api/index.js.map +1 -1
  70. package/dist/api/middleware/asset-interceptor-plugin.d.ts +2 -2
  71. package/dist/api/middleware/asset-interceptor-plugin.js +4 -4
  72. package/dist/api/middleware/asset-interceptor-plugin.js.map +1 -1
  73. package/dist/api/middleware/auth-guard.js +5 -5
  74. package/dist/api/middleware/auth-guard.js.map +1 -1
  75. package/dist/api/middleware/exception-logger.filter.js +1 -1
  76. package/dist/api/middleware/exception-logger.filter.js.map +1 -1
  77. package/dist/api/middleware/id-codec-plugin.d.ts +2 -2
  78. package/dist/api/middleware/id-codec-plugin.js +5 -4
  79. package/dist/api/middleware/id-codec-plugin.js.map +1 -1
  80. package/dist/api/middleware/id-interceptor.js +2 -2
  81. package/dist/api/middleware/id-interceptor.js.map +1 -1
  82. package/dist/api/middleware/transaction-interceptor.js +6 -4
  83. package/dist/api/middleware/transaction-interceptor.js.map +1 -1
  84. package/dist/api/middleware/translate-error-result-interceptor.js +3 -3
  85. package/dist/api/middleware/translate-error-result-interceptor.js.map +1 -1
  86. package/dist/api/middleware/translate-errors-plugin.d.ts +1 -1
  87. package/dist/api/middleware/translate-errors-plugin.js +2 -2
  88. package/dist/api/middleware/translate-errors-plugin.js.map +1 -1
  89. package/dist/api/middleware/validate-custom-fields-interceptor.js +4 -4
  90. package/dist/api/middleware/validate-custom-fields-interceptor.js.map +1 -1
  91. package/dist/api/resolvers/admin/administrator.resolver.js +39 -39
  92. package/dist/api/resolvers/admin/administrator.resolver.js.map +1 -1
  93. package/dist/api/resolvers/admin/asset.resolver.js +36 -36
  94. package/dist/api/resolvers/admin/asset.resolver.js.map +1 -1
  95. package/dist/api/resolvers/admin/auth.resolver.js +24 -24
  96. package/dist/api/resolvers/admin/auth.resolver.js.map +1 -1
  97. package/dist/api/resolvers/admin/channel.resolver.js +31 -30
  98. package/dist/api/resolvers/admin/channel.resolver.js.map +1 -1
  99. package/dist/api/resolvers/admin/collection.resolver.d.ts +1 -1
  100. package/dist/api/resolvers/admin/collection.resolver.js +56 -56
  101. package/dist/api/resolvers/admin/collection.resolver.js.map +1 -1
  102. package/dist/api/resolvers/admin/country.resolver.js +26 -26
  103. package/dist/api/resolvers/admin/country.resolver.js.map +1 -1
  104. package/dist/api/resolvers/admin/customer-group.resolver.js +36 -36
  105. package/dist/api/resolvers/admin/customer-group.resolver.js.map +1 -1
  106. package/dist/api/resolvers/admin/customer.resolver.js +56 -56
  107. package/dist/api/resolvers/admin/customer.resolver.js.map +1 -1
  108. package/dist/api/resolvers/admin/draft-order.resolver.d.ts +3 -3
  109. package/dist/api/resolvers/admin/draft-order.resolver.js +62 -62
  110. package/dist/api/resolvers/admin/draft-order.resolver.js.map +1 -1
  111. package/dist/api/resolvers/admin/facet.resolver.d.ts +1 -1
  112. package/dist/api/resolvers/admin/facet.resolver.js +62 -62
  113. package/dist/api/resolvers/admin/facet.resolver.js.map +1 -1
  114. package/dist/api/resolvers/admin/global-settings.resolver.js +20 -17
  115. package/dist/api/resolvers/admin/global-settings.resolver.js.map +1 -1
  116. package/dist/api/resolvers/admin/import.resolver.d.ts +2 -2
  117. package/dist/api/resolvers/admin/import.resolver.js +5 -5
  118. package/dist/api/resolvers/admin/import.resolver.js.map +1 -1
  119. package/dist/api/resolvers/admin/job.resolver.js +25 -25
  120. package/dist/api/resolvers/admin/job.resolver.js.map +1 -1
  121. package/dist/api/resolvers/admin/order.resolver.d.ts +1 -1
  122. package/dist/api/resolvers/admin/order.resolver.js +87 -87
  123. package/dist/api/resolvers/admin/order.resolver.js.map +1 -1
  124. package/dist/api/resolvers/admin/payment-method.resolver.js +32 -32
  125. package/dist/api/resolvers/admin/payment-method.resolver.js.map +1 -1
  126. package/dist/api/resolvers/admin/product-option.resolver.d.ts +1 -1
  127. package/dist/api/resolvers/admin/product-option.resolver.js +36 -36
  128. package/dist/api/resolvers/admin/product-option.resolver.js.map +1 -1
  129. package/dist/api/resolvers/admin/product.resolver.d.ts +1 -1
  130. package/dist/api/resolvers/admin/product.resolver.js +98 -98
  131. package/dist/api/resolvers/admin/product.resolver.js.map +1 -1
  132. package/dist/api/resolvers/admin/promotion.resolver.js +42 -42
  133. package/dist/api/resolvers/admin/promotion.resolver.js.map +1 -1
  134. package/dist/api/resolvers/admin/role.resolver.js +26 -26
  135. package/dist/api/resolvers/admin/role.resolver.js.map +1 -1
  136. package/dist/api/resolvers/admin/search.resolver.js +17 -17
  137. package/dist/api/resolvers/admin/search.resolver.js.map +1 -1
  138. package/dist/api/resolvers/admin/seller.resolver.d.ts +13 -0
  139. package/dist/api/resolvers/admin/seller.resolver.js +96 -0
  140. package/dist/api/resolvers/admin/seller.resolver.js.map +1 -0
  141. package/dist/api/resolvers/admin/shipping-method.resolver.js +43 -43
  142. package/dist/api/resolvers/admin/shipping-method.resolver.js.map +1 -1
  143. package/dist/api/resolvers/admin/stock-location.resolver.d.ts +12 -0
  144. package/dist/api/resolvers/admin/stock-location.resolver.js +96 -0
  145. package/dist/api/resolvers/admin/stock-location.resolver.js.map +1 -0
  146. package/dist/api/resolvers/admin/tag.resolver.js +24 -24
  147. package/dist/api/resolvers/admin/tag.resolver.js.map +1 -1
  148. package/dist/api/resolvers/admin/tax-category.resolver.js +23 -23
  149. package/dist/api/resolvers/admin/tax-category.resolver.js.map +1 -1
  150. package/dist/api/resolvers/admin/tax-rate.resolver.js +26 -26
  151. package/dist/api/resolvers/admin/tax-rate.resolver.js.map +1 -1
  152. package/dist/api/resolvers/admin/zone.resolver.js +33 -33
  153. package/dist/api/resolvers/admin/zone.resolver.js.map +1 -1
  154. package/dist/api/resolvers/base/base-auth.resolver.js +6 -6
  155. package/dist/api/resolvers/base/base-auth.resolver.js.map +1 -1
  156. package/dist/api/resolvers/entity/administrator-entity.resolver.js +4 -4
  157. package/dist/api/resolvers/entity/administrator-entity.resolver.js.map +1 -1
  158. package/dist/api/resolvers/entity/asset-entity.resolver.js +4 -4
  159. package/dist/api/resolvers/entity/asset-entity.resolver.js.map +1 -1
  160. package/dist/api/resolvers/entity/channel-entity.resolver.d.ts +10 -0
  161. package/dist/api/resolvers/entity/channel-entity.resolver.js +56 -0
  162. package/dist/api/resolvers/entity/channel-entity.resolver.js.map +1 -0
  163. package/dist/api/resolvers/entity/collection-entity.resolver.js +42 -42
  164. package/dist/api/resolvers/entity/collection-entity.resolver.js.map +1 -1
  165. package/dist/api/resolvers/entity/country-entity.resolver.js +7 -7
  166. package/dist/api/resolvers/entity/country-entity.resolver.js.map +1 -1
  167. package/dist/api/resolvers/entity/customer-entity.resolver.d.ts +2 -2
  168. package/dist/api/resolvers/entity/customer-entity.resolver.js +23 -23
  169. package/dist/api/resolvers/entity/customer-entity.resolver.js.map +1 -1
  170. package/dist/api/resolvers/entity/customer-group-entity.resolver.d.ts +1 -1
  171. package/dist/api/resolvers/entity/customer-group-entity.resolver.js +6 -6
  172. package/dist/api/resolvers/entity/customer-group-entity.resolver.js.map +1 -1
  173. package/dist/api/resolvers/entity/facet-entity.resolver.d.ts +1 -1
  174. package/dist/api/resolvers/entity/facet-entity.resolver.js +11 -11
  175. package/dist/api/resolvers/entity/facet-entity.resolver.js.map +1 -1
  176. package/dist/api/resolvers/entity/facet-value-entity.resolver.d.ts +1 -1
  177. package/dist/api/resolvers/entity/facet-value-entity.resolver.js +10 -10
  178. package/dist/api/resolvers/entity/facet-value-entity.resolver.js.map +1 -1
  179. package/dist/api/resolvers/entity/fulfillment-entity.resolver.d.ts +3 -6
  180. package/dist/api/resolvers/entity/fulfillment-entity.resolver.js +14 -14
  181. package/dist/api/resolvers/entity/fulfillment-entity.resolver.js.map +1 -1
  182. package/dist/api/resolvers/entity/fulfillment-line-entity.resolver.d.ts +11 -0
  183. package/dist/api/resolvers/entity/fulfillment-line-entity.resolver.js +59 -0
  184. package/dist/api/resolvers/entity/fulfillment-line-entity.resolver.js.map +1 -0
  185. package/dist/api/resolvers/entity/job-entity.resolver.js +7 -7
  186. package/dist/api/resolvers/entity/job-entity.resolver.js.map +1 -1
  187. package/dist/api/resolvers/entity/order-entity.resolver.d.ts +12 -7
  188. package/dist/api/resolvers/entity/order-entity.resolver.js +88 -32
  189. package/dist/api/resolvers/entity/order-entity.resolver.js.map +1 -1
  190. package/dist/api/resolvers/entity/order-line-entity.resolver.d.ts +2 -2
  191. package/dist/api/resolvers/entity/order-line-entity.resolver.js +18 -20
  192. package/dist/api/resolvers/entity/order-line-entity.resolver.js.map +1 -1
  193. package/dist/api/resolvers/entity/payment-entity.resolver.js +11 -11
  194. package/dist/api/resolvers/entity/payment-entity.resolver.js.map +1 -1
  195. package/dist/api/resolvers/entity/payment-method-entity.resolver.js +1 -1
  196. package/dist/api/resolvers/entity/payment-method-entity.resolver.js.map +1 -1
  197. package/dist/api/resolvers/entity/product-entity.resolver.d.ts +1 -1
  198. package/dist/api/resolvers/entity/product-entity.resolver.js +47 -47
  199. package/dist/api/resolvers/entity/product-entity.resolver.js.map +1 -1
  200. package/dist/api/resolvers/entity/product-option-entity.resolver.d.ts +1 -1
  201. package/dist/api/resolvers/entity/product-option-entity.resolver.js +12 -12
  202. package/dist/api/resolvers/entity/product-option-entity.resolver.js.map +1 -1
  203. package/dist/api/resolvers/entity/product-option-group-entity.resolver.d.ts +1 -1
  204. package/dist/api/resolvers/entity/product-option-group-entity.resolver.js +11 -11
  205. package/dist/api/resolvers/entity/product-option-group-entity.resolver.js.map +1 -1
  206. package/dist/api/resolvers/entity/product-variant-entity.resolver.d.ts +11 -2
  207. package/dist/api/resolvers/entity/product-variant-entity.resolver.js +93 -50
  208. package/dist/api/resolvers/entity/product-variant-entity.resolver.js.map +1 -1
  209. package/dist/api/resolvers/entity/refund-entity.resolver.d.ts +0 -4
  210. package/dist/api/resolvers/entity/refund-entity.resolver.js +1 -23
  211. package/dist/api/resolvers/entity/refund-entity.resolver.js.map +1 -1
  212. package/dist/api/resolvers/entity/refund-line-entity.resolver.d.ts +11 -0
  213. package/dist/api/resolvers/entity/refund-line-entity.resolver.js +55 -0
  214. package/dist/api/resolvers/entity/refund-line-entity.resolver.js.map +1 -0
  215. package/dist/api/resolvers/entity/role-entity.resolver.js +4 -4
  216. package/dist/api/resolvers/entity/role-entity.resolver.js.map +1 -1
  217. package/dist/api/resolvers/entity/shipping-line-entity.resolver.d.ts +1 -1
  218. package/dist/api/resolvers/entity/shipping-line-entity.resolver.js +4 -4
  219. package/dist/api/resolvers/entity/shipping-line-entity.resolver.js.map +1 -1
  220. package/dist/api/resolvers/entity/shipping-method-entity.resolver.d.ts +1 -1
  221. package/dist/api/resolvers/entity/shipping-method-entity.resolver.js +14 -14
  222. package/dist/api/resolvers/entity/shipping-method-entity.resolver.js.map +1 -1
  223. package/dist/api/resolvers/entity/tax-rate-entity.resolver.js +5 -5
  224. package/dist/api/resolvers/entity/tax-rate-entity.resolver.js.map +1 -1
  225. package/dist/api/resolvers/entity/user-entity.resolver.js +4 -4
  226. package/dist/api/resolvers/entity/user-entity.resolver.js.map +1 -1
  227. package/dist/api/resolvers/entity/zone-entity.resolver.d.ts +3 -2
  228. package/dist/api/resolvers/entity/zone-entity.resolver.js +8 -8
  229. package/dist/api/resolvers/entity/zone-entity.resolver.js.map +1 -1
  230. package/dist/api/resolvers/shop/shop-auth.resolver.js +80 -80
  231. package/dist/api/resolvers/shop/shop-auth.resolver.js.map +1 -1
  232. package/dist/api/resolvers/shop/shop-customer.resolver.js +27 -27
  233. package/dist/api/resolvers/shop/shop-customer.resolver.js.map +1 -1
  234. package/dist/api/resolvers/shop/shop-environment.resolver.js +3 -3
  235. package/dist/api/resolvers/shop/shop-environment.resolver.js.map +1 -1
  236. package/dist/api/resolvers/shop/shop-order.resolver.d.ts +2 -2
  237. package/dist/api/resolvers/shop/shop-order.resolver.js +105 -107
  238. package/dist/api/resolvers/shop/shop-order.resolver.js.map +1 -1
  239. package/dist/api/resolvers/shop/shop-products.resolver.js +30 -30
  240. package/dist/api/resolvers/shop/shop-products.resolver.js.map +1 -1
  241. package/dist/api/schema/admin-api/channel.api.graphql +2 -0
  242. package/dist/api/schema/admin-api/collection-admin.type.graphql +1 -0
  243. package/dist/api/schema/admin-api/collection.api.graphql +3 -0
  244. package/dist/api/schema/admin-api/order-admin.type.graphql +14 -2
  245. package/dist/api/schema/admin-api/order.api.graphql +4 -9
  246. package/dist/api/schema/admin-api/payment-method.api.graphql +9 -4
  247. package/dist/api/schema/admin-api/product-admin.type.graphql +3 -2
  248. package/dist/api/schema/admin-api/product.api.graphql +9 -2
  249. package/dist/api/schema/admin-api/promotion.api.graphql +8 -2
  250. package/dist/api/schema/admin-api/seller.api.graphql +29 -0
  251. package/dist/api/schema/admin-api/shipping-method.api.graphql +2 -2
  252. package/dist/api/schema/admin-api/stock-level.type.graphql +9 -0
  253. package/dist/api/schema/admin-api/stock-location.api.graphql +34 -0
  254. package/dist/api/schema/admin-api/stock-location.type.graphql +7 -0
  255. package/dist/api/schema/common/asset.type.graphql +1 -0
  256. package/dist/api/schema/common/channel.type.graphql +3 -1
  257. package/dist/api/schema/common/common-error-results.graphql +7 -0
  258. package/dist/api/schema/common/common-types.graphql +7 -3
  259. package/dist/api/schema/common/custom-field-types.graphql +13 -0
  260. package/dist/api/schema/common/order.type.graphql +68 -49
  261. package/dist/api/schema/common/payment-method.type.graphql +9 -0
  262. package/dist/api/schema/common/product-search.type.graphql +3 -3
  263. package/dist/api/schema/common/product.type.graphql +2 -2
  264. package/dist/api/schema/common/promotion.type.graphql +12 -0
  265. package/dist/api/schema/common/seller.type.graphql +6 -0
  266. package/dist/api/schema/shop-api/shop.api.graphql +8 -3
  267. package/dist/app.module.js +1 -1
  268. package/dist/app.module.js.map +1 -1
  269. package/dist/bootstrap.d.ts +1 -1
  270. package/dist/bootstrap.js +27 -43
  271. package/dist/bootstrap.js.map +1 -1
  272. package/dist/cache/cache.module.js +1 -1
  273. package/dist/cache/cache.module.js.map +1 -1
  274. package/dist/cache/index.js +5 -1
  275. package/dist/cache/index.js.map +1 -1
  276. package/dist/common/async-queue.d.ts +3 -3
  277. package/dist/common/async-queue.js +2 -2
  278. package/dist/common/async-queue.js.map +1 -1
  279. package/dist/common/configurable-operation.d.ts +11 -11
  280. package/dist/common/configurable-operation.js +5 -5
  281. package/dist/common/configurable-operation.js.map +1 -1
  282. package/dist/common/constants.js +4 -3
  283. package/dist/common/constants.js.map +1 -1
  284. package/dist/common/error/error-result.d.ts +3 -3
  285. package/dist/common/error/errors.d.ts +1 -2
  286. package/dist/common/error/errors.js.map +1 -1
  287. package/dist/common/error/generated-graphql-admin-errors.d.ts +160 -89
  288. package/dist/common/error/generated-graphql-admin-errors.js +123 -113
  289. package/dist/common/error/generated-graphql-admin-errors.js.map +1 -1
  290. package/dist/common/error/generated-graphql-shop-errors.d.ts +79 -43
  291. package/dist/common/error/generated-graphql-shop-errors.js +65 -55
  292. package/dist/common/error/generated-graphql-shop-errors.js.map +1 -1
  293. package/dist/common/finite-state-machine/finite-state-machine.d.ts +4 -2
  294. package/dist/common/finite-state-machine/finite-state-machine.js +20 -8
  295. package/dist/common/finite-state-machine/finite-state-machine.js.map +1 -1
  296. package/dist/common/finite-state-machine/merge-transition-definitions.js +1 -1
  297. package/dist/common/finite-state-machine/merge-transition-definitions.js.map +1 -1
  298. package/dist/common/finite-state-machine/types.d.ts +4 -4
  299. package/dist/common/generate-public-id.js +3 -2
  300. package/dist/common/generate-public-id.js.map +1 -1
  301. package/dist/common/index.js +5 -1
  302. package/dist/common/index.js.map +1 -1
  303. package/dist/common/permission-definition.d.ts +1 -1
  304. package/dist/common/round-money.d.ts +1 -0
  305. package/dist/common/round-money.js +13 -0
  306. package/dist/common/round-money.js.map +1 -0
  307. package/dist/common/self-refreshing-cache.d.ts +1 -2
  308. package/dist/common/self-refreshing-cache.js +11 -7
  309. package/dist/common/self-refreshing-cache.js.map +1 -1
  310. package/dist/common/tax-utils.js +2 -2
  311. package/dist/common/tax-utils.js.map +1 -1
  312. package/dist/common/types/adjustment-source.d.ts +1 -1
  313. package/dist/common/types/common-types.d.ts +11 -11
  314. package/dist/common/types/entity-relation-paths.d.ts +8 -8
  315. package/dist/common/types/locale-types.d.ts +7 -7
  316. package/dist/common/utils.d.ts +5 -1
  317. package/dist/common/utils.js +21 -3
  318. package/dist/common/utils.js.map +1 -1
  319. package/dist/config/asset-import-strategy/default-asset-import-strategy.js +4 -6
  320. package/dist/config/asset-import-strategy/default-asset-import-strategy.js.map +1 -1
  321. package/dist/config/asset-naming-strategy/default-asset-naming-strategy.js +1 -1
  322. package/dist/config/asset-naming-strategy/default-asset-naming-strategy.js.map +1 -1
  323. package/dist/config/asset-storage-strategy/asset-storage-strategy.d.ts +1 -0
  324. package/dist/config/asset-storage-strategy/no-asset-storage-strategy.d.ts +1 -0
  325. package/dist/config/auth/native-authentication-strategy.js +7 -26
  326. package/dist/config/auth/native-authentication-strategy.js.map +1 -1
  327. package/dist/config/catalog/collection-filter.d.ts +1 -1
  328. package/dist/config/catalog/collection-filter.js +1 -1
  329. package/dist/config/catalog/collection-filter.js.map +1 -1
  330. package/dist/config/catalog/default-collection-filters.js +10 -7
  331. package/dist/config/catalog/default-collection-filters.js.map +1 -1
  332. package/dist/config/catalog/default-product-variant-price-calculation-strategy.js +3 -2
  333. package/dist/config/catalog/default-product-variant-price-calculation-strategy.js.map +1 -1
  334. package/dist/config/catalog/default-product-variant-price-selection-strategy.d.ts +10 -0
  335. package/dist/config/catalog/default-product-variant-price-selection-strategy.js +15 -0
  336. package/dist/config/catalog/default-product-variant-price-selection-strategy.js.map +1 -0
  337. package/dist/config/catalog/default-stock-location-strategy.d.ts +25 -0
  338. package/dist/config/catalog/default-stock-location-strategy.js +70 -0
  339. package/dist/config/catalog/default-stock-location-strategy.js.map +1 -0
  340. package/dist/config/catalog/product-variant-price-calculation-strategy.d.ts +3 -2
  341. package/dist/config/catalog/product-variant-price-selection-strategy.d.ts +6 -0
  342. package/dist/config/catalog/product-variant-price-selection-strategy.js +3 -0
  343. package/dist/config/catalog/product-variant-price-selection-strategy.js.map +1 -0
  344. package/dist/config/catalog/stock-location-strategy.d.ts +74 -0
  345. package/dist/config/{fulfillment/custom-fulfillment-process.js → catalog/stock-location-strategy.js} +1 -1
  346. package/dist/config/catalog/stock-location-strategy.js.map +1 -0
  347. package/dist/config/config-helpers.d.ts +6 -1
  348. package/dist/config/config-helpers.js +34 -6
  349. package/dist/config/config-helpers.js.map +1 -1
  350. package/dist/config/config.module.js +14 -7
  351. package/dist/config/config.module.js.map +1 -1
  352. package/dist/config/config.service.d.ts +3 -3
  353. package/dist/config/config.service.js +3 -3
  354. package/dist/config/config.service.js.map +1 -1
  355. package/dist/config/custom-field/custom-field-types.d.ts +18 -15
  356. package/dist/config/default-config.js +21 -2
  357. package/dist/config/default-config.js.map +1 -1
  358. package/dist/config/entity/auto-increment-id-strategy.js.map +1 -0
  359. package/dist/config/entity/bigint-money-strategy.d.ts +17 -0
  360. package/dist/config/entity/bigint-money-strategy.js +45 -0
  361. package/dist/config/entity/bigint-money-strategy.js.map +1 -0
  362. package/dist/config/entity/default-money-strategy.d.ts +14 -0
  363. package/dist/config/entity/default-money-strategy.js +23 -0
  364. package/dist/config/entity/default-money-strategy.js.map +1 -0
  365. package/dist/config/{entity-id-strategy → entity}/entity-id-strategy.d.ts +1 -1
  366. package/dist/config/entity/entity-id-strategy.js.map +1 -0
  367. package/dist/config/entity/money-strategy.d.ts +61 -0
  368. package/dist/config/{order/custom-order-process.js → entity/money-strategy.js} +1 -1
  369. package/dist/config/entity/money-strategy.js.map +1 -0
  370. package/dist/config/entity/uuid-id-strategy.js.map +1 -0
  371. package/dist/config/entity-metadata/add-foreign-key-indices.js +1 -1
  372. package/dist/config/entity-metadata/add-foreign-key-indices.js.map +1 -1
  373. package/dist/config/entity-metadata/entity-metadata-modifier.d.ts +1 -1
  374. package/dist/config/fulfillment/default-fulfillment-process.d.ts +24 -0
  375. package/dist/config/fulfillment/default-fulfillment-process.js +131 -0
  376. package/dist/config/fulfillment/default-fulfillment-process.js.map +1 -0
  377. package/dist/config/fulfillment/fulfillment-handler.d.ts +5 -6
  378. package/dist/config/fulfillment/fulfillment-handler.js +3 -3
  379. package/dist/config/fulfillment/fulfillment-handler.js.map +1 -1
  380. package/dist/config/fulfillment/{custom-fulfillment-process.d.ts → fulfillment-process.d.ts} +16 -2
  381. package/dist/config/{payment/custom-payment-process.js → fulfillment/fulfillment-process.js} +1 -1
  382. package/dist/config/fulfillment/fulfillment-process.js.map +1 -0
  383. package/dist/config/index.d.ts +27 -8
  384. package/dist/config/index.js +32 -9
  385. package/dist/config/index.js.map +1 -1
  386. package/dist/config/job-queue/job-queue-strategy.d.ts +3 -3
  387. package/dist/config/logger/default-logger.js +5 -5
  388. package/dist/config/logger/typeorm-logger.js +4 -3
  389. package/dist/config/logger/typeorm-logger.js.map +1 -1
  390. package/dist/config/merge-config.js +4 -4
  391. package/dist/config/merge-config.js.map +1 -1
  392. package/dist/config/order/active-order-strategy.d.ts +1 -1
  393. package/dist/config/order/changed-price-handling-strategy.d.ts +3 -3
  394. package/dist/config/order/default-active-order-strategy.js +3 -22
  395. package/dist/config/order/default-active-order-strategy.js.map +1 -1
  396. package/dist/config/order/default-guest-checkout-strategy.d.ts +63 -0
  397. package/dist/config/order/default-guest-checkout-strategy.js +55 -0
  398. package/dist/config/order/default-guest-checkout-strategy.js.map +1 -0
  399. package/dist/config/order/default-order-process.d.ts +143 -0
  400. package/dist/config/order/default-order-process.js +307 -0
  401. package/dist/config/order/default-order-process.js.map +1 -0
  402. package/dist/config/order/default-order-seller-strategy.d.ts +11 -0
  403. package/dist/config/order/default-order-seller-strategy.js +15 -0
  404. package/dist/config/order/default-order-seller-strategy.js.map +1 -0
  405. package/dist/config/order/guest-checkout-strategy.d.ts +30 -0
  406. package/dist/config/order/guest-checkout-strategy.js +3 -0
  407. package/dist/config/order/guest-checkout-strategy.js.map +1 -0
  408. package/dist/config/order/merge-orders-strategy.js +1 -1
  409. package/dist/config/order/merge-orders-strategy.js.map +1 -1
  410. package/dist/config/order/order-by-code-access-strategy.js +1 -1
  411. package/dist/config/order/order-by-code-access-strategy.js.map +1 -1
  412. package/dist/config/order/order-code-strategy.js +1 -1
  413. package/dist/config/order/order-code-strategy.js.map +1 -1
  414. package/dist/config/order/order-merge-strategy.d.ts +1 -1
  415. package/dist/config/order/{custom-order-process.d.ts → order-process.d.ts} +15 -2
  416. package/dist/config/order/order-process.js +3 -0
  417. package/dist/config/order/order-process.js.map +1 -0
  418. package/dist/config/order/order-seller-strategy.d.ts +56 -0
  419. package/dist/config/order/order-seller-strategy.js +3 -0
  420. package/dist/config/order/order-seller-strategy.js.map +1 -0
  421. package/dist/config/payment/default-payment-process.d.ts +16 -0
  422. package/dist/config/payment/default-payment-process.js +70 -0
  423. package/dist/config/payment/default-payment-process.js.map +1 -0
  424. package/dist/config/payment/example-payment-method-handler.js +1 -1
  425. package/dist/config/payment/example-payment-method-handler.js.map +1 -1
  426. package/dist/config/payment/payment-method-eligibility-checker.d.ts +2 -2
  427. package/dist/config/payment/payment-method-eligibility-checker.js.map +1 -1
  428. package/dist/config/payment/payment-method-handler.d.ts +9 -9
  429. package/dist/config/payment/payment-method-handler.js +1 -1
  430. package/dist/config/payment/payment-method-handler.js.map +1 -1
  431. package/dist/config/payment/{custom-payment-process.d.ts → payment-process.d.ts} +17 -3
  432. package/dist/config/payment/payment-process.js +3 -0
  433. package/dist/config/payment/payment-process.js.map +1 -0
  434. package/dist/config/promotion/actions/buy-x-get-y-free-action.d.ts +4 -3
  435. package/dist/config/promotion/actions/buy-x-get-y-free-action.js +6 -9
  436. package/dist/config/promotion/actions/buy-x-get-y-free-action.js.map +1 -1
  437. package/dist/config/promotion/actions/facet-values-percentage-discount-action.js +1 -1
  438. package/dist/config/promotion/actions/facet-values-percentage-discount-action.js.map +1 -1
  439. package/dist/config/promotion/actions/product-percentage-discount-action.js +2 -2
  440. package/dist/config/promotion/actions/product-percentage-discount-action.js.map +1 -1
  441. package/dist/config/promotion/conditions/buy-x-get-y-free-condition.d.ts +3 -2
  442. package/dist/config/promotion/conditions/buy-x-get-y-free-condition.js +16 -10
  443. package/dist/config/promotion/conditions/buy-x-get-y-free-condition.js.map +1 -1
  444. package/dist/config/promotion/conditions/contains-products-condition.js +1 -1
  445. package/dist/config/promotion/conditions/contains-products-condition.js.map +1 -1
  446. package/dist/config/promotion/conditions/customer-group-condition.js +2 -21
  447. package/dist/config/promotion/conditions/customer-group-condition.js.map +1 -1
  448. package/dist/config/promotion/conditions/has-facet-values-condition.js +1 -1
  449. package/dist/config/promotion/conditions/has-facet-values-condition.js.map +1 -1
  450. package/dist/config/promotion/index.d.ts +6 -2
  451. package/dist/config/promotion/index.js +5 -1
  452. package/dist/config/promotion/index.js.map +1 -1
  453. package/dist/config/promotion/promotion-action.d.ts +13 -14
  454. package/dist/config/promotion/promotion-action.js +5 -5
  455. package/dist/config/promotion/promotion-action.js.map +1 -1
  456. package/dist/config/promotion/promotion-condition.d.ts +4 -4
  457. package/dist/config/promotion/promotion-condition.js +3 -3
  458. package/dist/config/promotion/promotion-condition.js.map +1 -1
  459. package/dist/config/promotion/utils/facet-value-checker.d.ts +0 -1
  460. package/dist/config/promotion/utils/facet-value-checker.js +6 -5
  461. package/dist/config/promotion/utils/facet-value-checker.js.map +1 -1
  462. package/dist/config/session-cache/in-memory-session-cache-strategy.js +1 -1
  463. package/dist/config/session-cache/session-cache-strategy.d.ts +6 -6
  464. package/dist/config/shipping-method/default-shipping-calculator.d.ts +1 -2
  465. package/dist/config/shipping-method/default-shipping-calculator.js +2 -2
  466. package/dist/config/shipping-method/default-shipping-calculator.js.map +1 -1
  467. package/dist/config/shipping-method/default-shipping-line-assignment-strategy.d.ts +8 -0
  468. package/dist/config/shipping-method/default-shipping-line-assignment-strategy.js +10 -0
  469. package/dist/config/shipping-method/default-shipping-line-assignment-strategy.js.map +1 -0
  470. package/dist/config/shipping-method/shipping-calculator.d.ts +2 -2
  471. package/dist/config/shipping-method/shipping-eligibility-checker.d.ts +2 -2
  472. package/dist/config/shipping-method/shipping-eligibility-checker.js +1 -1
  473. package/dist/config/shipping-method/shipping-eligibility-checker.js.map +1 -1
  474. package/dist/config/shipping-method/shipping-line-assignment-strategy.d.ts +20 -0
  475. package/dist/config/shipping-method/shipping-line-assignment-strategy.js +3 -0
  476. package/dist/config/shipping-method/shipping-line-assignment-strategy.js.map +1 -0
  477. package/dist/config/tax/default-tax-line-calculation-strategy.js +2 -2
  478. package/dist/config/tax/tax-line-calculation-strategy.d.ts +1 -3
  479. package/dist/config/vendure-config.d.ts +90 -14
  480. package/dist/connection/connection.module.d.ts +2 -2
  481. package/dist/connection/connection.module.js +1 -1
  482. package/dist/connection/connection.module.js.map +1 -1
  483. package/dist/connection/index.js +5 -1
  484. package/dist/connection/index.js.map +1 -1
  485. package/dist/connection/transaction-subscriber.d.ts +1 -1
  486. package/dist/connection/transaction-subscriber.js +6 -7
  487. package/dist/connection/transaction-subscriber.js.map +1 -1
  488. package/dist/connection/transaction-wrapper.js +2 -4
  489. package/dist/connection/transaction-wrapper.js.map +1 -1
  490. package/dist/connection/transactional-connection.d.ts +7 -6
  491. package/dist/connection/transactional-connection.js +18 -37
  492. package/dist/connection/transactional-connection.js.map +1 -1
  493. package/dist/data-import/data-import.module.js +1 -1
  494. package/dist/data-import/data-import.module.js.map +1 -1
  495. package/dist/data-import/index.js +5 -1
  496. package/dist/data-import/index.js.map +1 -1
  497. package/dist/data-import/providers/asset-importer/asset-importer.js +2 -2
  498. package/dist/data-import/providers/asset-importer/asset-importer.js.map +1 -1
  499. package/dist/data-import/providers/import-parser/import-parser.js +7 -7
  500. package/dist/data-import/providers/import-parser/import-parser.js.map +1 -1
  501. package/dist/data-import/providers/importer/fast-importer.service.d.ts +1 -2
  502. package/dist/data-import/providers/importer/fast-importer.service.js +15 -16
  503. package/dist/data-import/providers/importer/fast-importer.service.js.map +1 -1
  504. package/dist/data-import/providers/importer/importer.d.ts +1 -1
  505. package/dist/data-import/providers/importer/importer.js +6 -6
  506. package/dist/data-import/providers/importer/importer.js.map +1 -1
  507. package/dist/data-import/providers/populator/populator.js +11 -12
  508. package/dist/data-import/providers/populator/populator.js.map +1 -1
  509. package/dist/data-import/types.d.ts +2 -2
  510. package/dist/entity/address/address.entity.d.ts +1 -1
  511. package/dist/entity/address/address.entity.js +17 -15
  512. package/dist/entity/address/address.entity.js.map +1 -1
  513. package/dist/entity/administrator/administrator.entity.js +8 -8
  514. package/dist/entity/administrator/administrator.entity.js.map +1 -1
  515. package/dist/entity/asset/asset.entity.js +15 -15
  516. package/dist/entity/asset/asset.entity.js.map +1 -1
  517. package/dist/entity/asset/orderable-asset.entity.js +4 -3
  518. package/dist/entity/asset/orderable-asset.entity.js.map +1 -1
  519. package/dist/entity/authentication-method/authentication-method.entity.js +4 -3
  520. package/dist/entity/authentication-method/authentication-method.entity.js.map +1 -1
  521. package/dist/entity/authentication-method/external-authentication-method.entity.js +4 -4
  522. package/dist/entity/authentication-method/external-authentication-method.entity.js.map +1 -1
  523. package/dist/entity/authentication-method/native-authentication-method.entity.js +7 -7
  524. package/dist/entity/authentication-method/native-authentication-method.entity.js.map +1 -1
  525. package/dist/entity/base/base.entity.js +3 -3
  526. package/dist/entity/base/base.entity.js.map +1 -1
  527. package/dist/entity/channel/channel.entity.d.ts +6 -2
  528. package/dist/entity/channel/channel.entity.js +26 -10
  529. package/dist/entity/channel/channel.entity.js.map +1 -1
  530. package/dist/entity/collection/collection-asset.entity.js +3 -3
  531. package/dist/entity/collection/collection-asset.entity.js.map +1 -1
  532. package/dist/entity/collection/collection-translation.entity.js +9 -7
  533. package/dist/entity/collection/collection-translation.entity.js.map +1 -1
  534. package/dist/entity/collection/collection.entity.d.ts +4 -0
  535. package/dist/entity/collection/collection.entity.js +22 -28
  536. package/dist/entity/collection/collection.entity.js.map +1 -1
  537. package/dist/entity/country/country-translation.entity.js +6 -5
  538. package/dist/entity/country/country-translation.entity.js.map +1 -1
  539. package/dist/entity/country/country.entity.js +5 -5
  540. package/dist/entity/country/country.entity.js.map +1 -1
  541. package/dist/entity/custom-entity-fields.d.ts +8 -0
  542. package/dist/entity/custom-entity-fields.js +13 -1
  543. package/dist/entity/custom-entity-fields.js.map +1 -1
  544. package/dist/entity/customer/customer.entity.js +16 -16
  545. package/dist/entity/customer/customer.entity.js.map +1 -1
  546. package/dist/entity/customer-group/customer-group.entity.js +4 -4
  547. package/dist/entity/customer-group/customer-group.entity.js.map +1 -1
  548. package/dist/entity/entities.d.ts +28 -12
  549. package/dist/entity/entities.js +28 -12
  550. package/dist/entity/entities.js.map +1 -1
  551. package/dist/entity/entity-id.decorator.js +1 -1
  552. package/dist/entity/facet/facet-translation.entity.js +6 -5
  553. package/dist/entity/facet/facet-translation.entity.js.map +1 -1
  554. package/dist/entity/facet/facet.entity.js +8 -8
  555. package/dist/entity/facet/facet.entity.js.map +1 -1
  556. package/dist/entity/facet-value/facet-value-translation.entity.js +6 -5
  557. package/dist/entity/facet-value/facet-value-translation.entity.js.map +1 -1
  558. package/dist/entity/facet-value/facet-value.entity.js +8 -7
  559. package/dist/entity/facet-value/facet-value.entity.js.map +1 -1
  560. package/dist/entity/fulfillment/fulfillment.entity.d.ts +3 -3
  561. package/dist/entity/fulfillment/fulfillment.entity.js +10 -10
  562. package/dist/entity/fulfillment/fulfillment.entity.js.map +1 -1
  563. package/dist/entity/global-settings/global-settings.entity.js +5 -5
  564. package/dist/entity/global-settings/global-settings.entity.js.map +1 -1
  565. package/dist/entity/history-entry/customer-history-entry.entity.js +3 -2
  566. package/dist/entity/history-entry/customer-history-entry.entity.js.map +1 -1
  567. package/dist/entity/history-entry/history-entry.entity.js +7 -6
  568. package/dist/entity/history-entry/history-entry.entity.js.map +1 -1
  569. package/dist/entity/history-entry/order-history-entry.entity.js +3 -2
  570. package/dist/entity/history-entry/order-history-entry.entity.js.map +1 -1
  571. package/dist/entity/index.d.ts +30 -18
  572. package/dist/entity/index.js +35 -19
  573. package/dist/entity/index.js.map +1 -1
  574. package/dist/entity/money.decorator.d.ts +27 -0
  575. package/dist/entity/money.decorator.js +36 -0
  576. package/dist/entity/money.decorator.js.map +1 -0
  577. package/dist/entity/order/order.entity.d.ts +7 -3
  578. package/dist/entity/order/order.entity.js +60 -42
  579. package/dist/entity/order/order.entity.js.map +1 -1
  580. package/dist/entity/order-line/order-line.entity.d.ts +79 -20
  581. package/dist/entity/order-line/order-line.entity.js +205 -107
  582. package/dist/entity/order-line/order-line.entity.js.map +1 -1
  583. package/dist/entity/order-line-reference/fulfillment-line.entity.d.ts +15 -0
  584. package/dist/entity/order-line-reference/fulfillment-line.entity.js +43 -0
  585. package/dist/entity/order-line-reference/fulfillment-line.entity.js.map +1 -0
  586. package/dist/entity/order-line-reference/order-line-reference.entity.d.ts +15 -0
  587. package/dist/entity/order-line-reference/order-line-reference.entity.js +44 -0
  588. package/dist/entity/order-line-reference/order-line-reference.entity.js.map +1 -0
  589. package/dist/entity/order-line-reference/order-modification-line.entity.d.ts +15 -0
  590. package/dist/entity/order-line-reference/order-modification-line.entity.js +43 -0
  591. package/dist/entity/order-line-reference/order-modification-line.entity.js.map +1 -0
  592. package/dist/entity/order-line-reference/refund-line.entity.d.ts +15 -0
  593. package/dist/entity/order-line-reference/refund-line.entity.js +43 -0
  594. package/dist/entity/order-line-reference/refund-line.entity.js.map +1 -0
  595. package/dist/entity/order-modification/order-modification.entity.d.ts +2 -2
  596. package/dist/entity/order-modification/order-modification.entity.js +17 -16
  597. package/dist/entity/order-modification/order-modification.entity.js.map +1 -1
  598. package/dist/entity/payment/payment.entity.js +11 -9
  599. package/dist/entity/payment/payment.entity.js.map +1 -1
  600. package/dist/entity/payment-method/payment-method-translation.entity.d.ts +15 -0
  601. package/dist/entity/payment-method/payment-method-translation.entity.js +49 -0
  602. package/dist/entity/payment-method/payment-method-translation.entity.js.map +1 -0
  603. package/dist/entity/payment-method/payment-method.entity.d.ts +5 -3
  604. package/dist/entity/payment-method/payment-method.entity.js +12 -15
  605. package/dist/entity/payment-method/payment-method.entity.js.map +1 -1
  606. package/dist/entity/product/product-asset.entity.js +3 -3
  607. package/dist/entity/product/product-asset.entity.js.map +1 -1
  608. package/dist/entity/product/product-translation.entity.js +9 -7
  609. package/dist/entity/product/product-translation.entity.js.map +1 -1
  610. package/dist/entity/product/product.entity.js +14 -13
  611. package/dist/entity/product/product.entity.js.map +1 -1
  612. package/dist/entity/product-option/product-option-translation.entity.js +6 -5
  613. package/dist/entity/product-option/product-option-translation.entity.js.map +1 -1
  614. package/dist/entity/product-option/product-option.entity.js +8 -7
  615. package/dist/entity/product-option/product-option.entity.js.map +1 -1
  616. package/dist/entity/product-option-group/product-option-group-translation.entity.js +6 -5
  617. package/dist/entity/product-option-group/product-option-group-translation.entity.js.map +1 -1
  618. package/dist/entity/product-option-group/product-option-group.entity.d.ts +1 -1
  619. package/dist/entity/product-option-group/product-option-group.entity.js +9 -8
  620. package/dist/entity/product-option-group/product-option-group.entity.js.map +1 -1
  621. package/dist/entity/product-variant/product-variant-asset.entity.js +3 -3
  622. package/dist/entity/product-variant/product-variant-asset.entity.js.map +1 -1
  623. package/dist/entity/product-variant/product-variant-price.entity.d.ts +2 -0
  624. package/dist/entity/product-variant/product-variant-price.entity.js +11 -4
  625. package/dist/entity/product-variant/product-variant-price.entity.js.map +1 -1
  626. package/dist/entity/product-variant/product-variant-translation.entity.js +6 -5
  627. package/dist/entity/product-variant/product-variant-translation.entity.js.map +1 -1
  628. package/dist/entity/product-variant/product-variant.entity.d.ts +3 -3
  629. package/dist/entity/product-variant/product-variant.entity.js +37 -36
  630. package/dist/entity/product-variant/product-variant.entity.js.map +1 -1
  631. package/dist/entity/promotion/promotion-translation.entity.d.ts +15 -0
  632. package/dist/entity/promotion/promotion-translation.entity.js +49 -0
  633. package/dist/entity/promotion/promotion-translation.entity.js.map +1 -0
  634. package/dist/entity/promotion/promotion.entity.d.ts +7 -6
  635. package/dist/entity/promotion/promotion.entity.js +26 -23
  636. package/dist/entity/promotion/promotion.entity.js.map +1 -1
  637. package/dist/entity/refund/refund.entity.d.ts +2 -2
  638. package/dist/entity/refund/refund.entity.js +19 -17
  639. package/dist/entity/refund/refund.entity.js.map +1 -1
  640. package/dist/entity/register-custom-entity-fields.js +16 -12
  641. package/dist/entity/register-custom-entity-fields.js.map +1 -1
  642. package/dist/entity/role/role.entity.js +6 -6
  643. package/dist/entity/role/role.entity.js.map +1 -1
  644. package/dist/entity/run-entity-metadata-modifiers.d.ts +1 -1
  645. package/dist/entity/run-entity-metadata-modifiers.js +1 -1
  646. package/dist/entity/run-entity-metadata-modifiers.js.map +1 -1
  647. package/dist/entity/seller/seller.entity.d.ts +17 -0
  648. package/dist/entity/seller/seller.entity.js +44 -0
  649. package/dist/entity/seller/seller.entity.js.map +1 -0
  650. package/dist/entity/session/anonymous-session.entity.js +1 -1
  651. package/dist/entity/session/anonymous-session.entity.js.map +1 -1
  652. package/dist/entity/session/authenticated-session.entity.js +4 -3
  653. package/dist/entity/session/authenticated-session.entity.js.map +1 -1
  654. package/dist/entity/session/session.entity.js +12 -10
  655. package/dist/entity/session/session.entity.js.map +1 -1
  656. package/dist/entity/set-entity-id-strategy.d.ts +1 -1
  657. package/dist/entity/set-entity-id-strategy.js +4 -4
  658. package/dist/entity/set-entity-id-strategy.js.map +1 -1
  659. package/dist/entity/set-money-strategy.d.ts +3 -0
  660. package/dist/entity/set-money-strategy.js +16 -0
  661. package/dist/entity/set-money-strategy.js.map +1 -0
  662. package/dist/entity/shipping-line/shipping-line.entity.d.ts +1 -1
  663. package/dist/entity/shipping-line/shipping-line.entity.js +30 -26
  664. package/dist/entity/shipping-line/shipping-line.entity.js.map +1 -1
  665. package/dist/entity/shipping-method/shipping-method-translation.entity.js +7 -6
  666. package/dist/entity/shipping-method/shipping-method-translation.entity.js.map +1 -1
  667. package/dist/entity/shipping-method/shipping-method.entity.js +14 -13
  668. package/dist/entity/shipping-method/shipping-method.entity.js.map +1 -1
  669. package/dist/entity/stock-level/stock-level.entity.d.ts +20 -0
  670. package/dist/entity/stock-level/stock-level.entity.js +60 -0
  671. package/dist/entity/stock-level/stock-level.entity.js.map +1 -0
  672. package/dist/entity/stock-location/stock-location.entity.d.ts +19 -0
  673. package/dist/entity/stock-location/stock-location.entity.js +50 -0
  674. package/dist/entity/stock-location/stock-location.entity.js.map +1 -0
  675. package/dist/entity/stock-movement/allocation.entity.js +3 -2
  676. package/dist/entity/stock-movement/allocation.entity.js.map +1 -1
  677. package/dist/entity/stock-movement/cancellation.entity.d.ts +2 -2
  678. package/dist/entity/stock-movement/cancellation.entity.js +5 -5
  679. package/dist/entity/stock-movement/cancellation.entity.js.map +1 -1
  680. package/dist/entity/stock-movement/release.entity.d.ts +2 -2
  681. package/dist/entity/stock-movement/release.entity.js +5 -5
  682. package/dist/entity/stock-movement/release.entity.js.map +1 -1
  683. package/dist/entity/stock-movement/sale.entity.js +2 -2
  684. package/dist/entity/stock-movement/sale.entity.js.map +1 -1
  685. package/dist/entity/stock-movement/stock-adjustment.entity.js +1 -1
  686. package/dist/entity/stock-movement/stock-adjustment.entity.js.map +1 -1
  687. package/dist/entity/stock-movement/stock-movement.entity.d.ts +4 -0
  688. package/dist/entity/stock-movement/stock-movement.entity.js +17 -5
  689. package/dist/entity/stock-movement/stock-movement.entity.js.map +1 -1
  690. package/dist/entity/subscribers.js +2 -1
  691. package/dist/entity/subscribers.js.map +1 -1
  692. package/dist/entity/surcharge/surcharge.entity.d.ts +1 -1
  693. package/dist/entity/surcharge/surcharge.entity.js +18 -15
  694. package/dist/entity/surcharge/surcharge.entity.js.map +1 -1
  695. package/dist/entity/tag/tag.entity.js +2 -2
  696. package/dist/entity/tag/tag.entity.js.map +1 -1
  697. package/dist/entity/tax-category/tax-category.entity.js +4 -4
  698. package/dist/entity/tax-category/tax-category.entity.js.map +1 -1
  699. package/dist/entity/tax-rate/tax-rate.entity.js +16 -13
  700. package/dist/entity/tax-rate/tax-rate.entity.js.map +1 -1
  701. package/dist/entity/user/user.entity.js +9 -9
  702. package/dist/entity/user/user.entity.js.map +1 -1
  703. package/dist/entity/validate-custom-fields-config.js +5 -3
  704. package/dist/entity/validate-custom-fields-config.js.map +1 -1
  705. package/dist/entity/zone/zone.entity.js +5 -5
  706. package/dist/entity/zone/zone.entity.js.map +1 -1
  707. package/dist/event-bus/event-bus.d.ts +10 -0
  708. package/dist/event-bus/event-bus.js +14 -2
  709. package/dist/event-bus/event-bus.js.map +1 -1
  710. package/dist/event-bus/event-bus.module.js +1 -1
  711. package/dist/event-bus/event-bus.module.js.map +1 -1
  712. package/dist/event-bus/events/administrator-event.d.ts +1 -1
  713. package/dist/event-bus/events/asset-event.d.ts +1 -1
  714. package/dist/event-bus/events/channel-event.d.ts +1 -1
  715. package/dist/event-bus/events/collection-event.d.ts +1 -1
  716. package/dist/event-bus/events/country-event.d.ts +1 -1
  717. package/dist/event-bus/events/customer-address-event.d.ts +1 -1
  718. package/dist/event-bus/events/customer-event.d.ts +1 -1
  719. package/dist/event-bus/events/customer-group-entity-event.d.ts +1 -1
  720. package/dist/event-bus/events/customer-group-event.d.ts +1 -1
  721. package/dist/event-bus/events/facet-event.d.ts +1 -1
  722. package/dist/event-bus/events/facet-value-event.d.ts +1 -1
  723. package/dist/event-bus/events/fulfillment-event.d.ts +4 -4
  724. package/dist/event-bus/events/history-entry-event.d.ts +1 -1
  725. package/dist/event-bus/events/payment-method-event.d.ts +1 -1
  726. package/dist/event-bus/events/product-event.d.ts +1 -1
  727. package/dist/event-bus/events/product-option-event.d.ts +1 -1
  728. package/dist/event-bus/events/product-option-group-event.d.ts +1 -1
  729. package/dist/event-bus/events/product-variant-event.d.ts +1 -1
  730. package/dist/event-bus/events/promotion-event.d.ts +1 -1
  731. package/dist/event-bus/events/role-event.d.ts +1 -1
  732. package/dist/event-bus/events/search-event.d.ts +1 -1
  733. package/dist/event-bus/events/shipping-method-event.d.ts +1 -1
  734. package/dist/event-bus/events/tax-category-event.d.ts +1 -1
  735. package/dist/event-bus/events/tax-rate-event.d.ts +1 -1
  736. package/dist/event-bus/events/zone-event.d.ts +1 -1
  737. package/dist/event-bus/index.js +5 -1
  738. package/dist/event-bus/index.js.map +1 -1
  739. package/dist/health-check/health-check.controller.js +3 -3
  740. package/dist/health-check/health-check.controller.js.map +1 -1
  741. package/dist/health-check/health-check.module.js +2 -2
  742. package/dist/health-check/health-check.module.js.map +1 -1
  743. package/dist/health-check/index.js +5 -1
  744. package/dist/health-check/index.js.map +1 -1
  745. package/dist/health-check/worker-health-indicator.js +2 -2
  746. package/dist/health-check/worker-health-indicator.js.map +1 -1
  747. package/dist/i18n/i18n.module.js +1 -1
  748. package/dist/i18n/i18n.module.js.map +1 -1
  749. package/dist/i18n/i18n.service.js +11 -5
  750. package/dist/i18n/i18n.service.js.map +1 -1
  751. package/dist/i18n/index.js +5 -1
  752. package/dist/i18n/index.js.map +1 -1
  753. package/dist/index.js +5 -1
  754. package/dist/index.js.map +1 -1
  755. package/dist/job-queue/in-memory-job-queue-strategy.d.ts +1 -1
  756. package/dist/job-queue/in-memory-job-queue-strategy.js +14 -15
  757. package/dist/job-queue/in-memory-job-queue-strategy.js.map +1 -1
  758. package/dist/job-queue/index.js +5 -1
  759. package/dist/job-queue/index.js.map +1 -1
  760. package/dist/job-queue/injectable-job-queue-strategy.d.ts +2 -2
  761. package/dist/job-queue/job-buffer/job-buffer.d.ts +1 -1
  762. package/dist/job-queue/job-buffer/job-buffer.service.js +2 -2
  763. package/dist/job-queue/job-buffer/job-buffer.service.js.map +1 -1
  764. package/dist/job-queue/job-queue.d.ts +1 -1
  765. package/dist/job-queue/job-queue.js +6 -6
  766. package/dist/job-queue/job-queue.js.map +1 -1
  767. package/dist/job-queue/job-queue.module.js +1 -1
  768. package/dist/job-queue/job-queue.module.js.map +1 -1
  769. package/dist/job-queue/job-queue.service.js +4 -4
  770. package/dist/job-queue/job-queue.service.js.map +1 -1
  771. package/dist/job-queue/job.d.ts +2 -2
  772. package/dist/job-queue/job.js +36 -27
  773. package/dist/job-queue/job.js.map +1 -1
  774. package/dist/job-queue/polling-job-queue-strategy.d.ts +3 -3
  775. package/dist/job-queue/polling-job-queue-strategy.js +12 -13
  776. package/dist/job-queue/polling-job-queue-strategy.js.map +1 -1
  777. package/dist/job-queue/subscribable-job.d.ts +2 -2
  778. package/dist/job-queue/subscribable-job.js +11 -10
  779. package/dist/job-queue/subscribable-job.js.map +1 -1
  780. package/dist/job-queue/types.d.ts +1 -1
  781. package/dist/migrate.js +19 -19
  782. package/dist/migrate.js.map +1 -1
  783. package/dist/plugin/default-job-queue-plugin/default-job-queue-plugin.d.ts +1 -1
  784. package/dist/plugin/default-job-queue-plugin/default-job-queue-plugin.js +1 -1
  785. package/dist/plugin/default-job-queue-plugin/default-job-queue-plugin.js.map +1 -1
  786. package/dist/plugin/default-job-queue-plugin/job-record-buffer.entity.js +3 -3
  787. package/dist/plugin/default-job-queue-plugin/job-record-buffer.entity.js.map +1 -1
  788. package/dist/plugin/default-job-queue-plugin/job-record.entity.js +12 -12
  789. package/dist/plugin/default-job-queue-plugin/job-record.entity.js.map +1 -1
  790. package/dist/plugin/default-job-queue-plugin/sql-job-buffer-storage-strategy.js +6 -7
  791. package/dist/plugin/default-job-queue-plugin/sql-job-buffer-storage-strategy.js.map +1 -1
  792. package/dist/plugin/default-job-queue-plugin/sql-job-queue-strategy.d.ts +1 -1
  793. package/dist/plugin/default-job-queue-plugin/sql-job-queue-strategy.js +3 -3
  794. package/dist/plugin/default-job-queue-plugin/sql-job-queue-strategy.js.map +1 -1
  795. package/dist/plugin/default-search-plugin/api/api-extensions.js +1 -1
  796. package/dist/plugin/default-search-plugin/api/api-extensions.js.map +1 -1
  797. package/dist/plugin/default-search-plugin/api/fulltext-search.resolver.d.ts +3 -2
  798. package/dist/plugin/default-search-plugin/api/fulltext-search.resolver.js +30 -30
  799. package/dist/plugin/default-search-plugin/api/fulltext-search.resolver.js.map +1 -1
  800. package/dist/plugin/default-search-plugin/default-search-plugin.js +8 -8
  801. package/dist/plugin/default-search-plugin/default-search-plugin.js.map +1 -1
  802. package/dist/plugin/default-search-plugin/entities/search-index-item.entity.js +28 -27
  803. package/dist/plugin/default-search-plugin/entities/search-index-item.entity.js.map +1 -1
  804. package/dist/plugin/default-search-plugin/fulltext-search.service.js +5 -5
  805. package/dist/plugin/default-search-plugin/fulltext-search.service.js.map +1 -1
  806. package/dist/plugin/default-search-plugin/index.js +5 -1
  807. package/dist/plugin/default-search-plugin/index.js.map +1 -1
  808. package/dist/plugin/default-search-plugin/indexer/indexer.controller.js +48 -31
  809. package/dist/plugin/default-search-plugin/indexer/indexer.controller.js.map +1 -1
  810. package/dist/plugin/default-search-plugin/indexer/mutable-request-context.js.map +1 -1
  811. package/dist/plugin/default-search-plugin/indexer/search-index.service.d.ts +12 -12
  812. package/dist/plugin/default-search-plugin/indexer/search-index.service.js +22 -14
  813. package/dist/plugin/default-search-plugin/indexer/search-index.service.js.map +1 -1
  814. package/dist/plugin/default-search-plugin/search-job-buffer/collection-job-buffer.js +1 -1
  815. package/dist/plugin/default-search-plugin/search-job-buffer/collection-job-buffer.js.map +1 -1
  816. package/dist/plugin/default-search-plugin/search-job-buffer/search-index-job-buffer.js +1 -1
  817. package/dist/plugin/default-search-plugin/search-job-buffer/search-index-job-buffer.js.map +1 -1
  818. package/dist/plugin/default-search-plugin/search-job-buffer/search-job-buffer.service.js +4 -4
  819. package/dist/plugin/default-search-plugin/search-job-buffer/search-job-buffer.service.js.map +1 -1
  820. package/dist/plugin/default-search-plugin/search-strategy/mysql-search-strategy.js +11 -11
  821. package/dist/plugin/default-search-plugin/search-strategy/mysql-search-strategy.js.map +1 -1
  822. package/dist/plugin/default-search-plugin/search-strategy/postgres-search-strategy.js +12 -12
  823. package/dist/plugin/default-search-plugin/search-strategy/postgres-search-strategy.js.map +1 -1
  824. package/dist/plugin/default-search-plugin/search-strategy/search-strategy-common.js.map +1 -1
  825. package/dist/plugin/default-search-plugin/search-strategy/search-strategy-utils.js +12 -8
  826. package/dist/plugin/default-search-plugin/search-strategy/search-strategy-utils.js.map +1 -1
  827. package/dist/plugin/default-search-plugin/search-strategy/sqlite-search-strategy.js +9 -9
  828. package/dist/plugin/default-search-plugin/search-strategy/sqlite-search-strategy.js.map +1 -1
  829. package/dist/plugin/default-search-plugin/types.d.ts +22 -22
  830. package/dist/plugin/dynamic-plugin-api.module.js +8 -8
  831. package/dist/plugin/dynamic-plugin-api.module.js.map +1 -1
  832. package/dist/plugin/index.js +5 -1
  833. package/dist/plugin/index.js.map +1 -1
  834. package/dist/plugin/plugin-common.module.js +1 -1
  835. package/dist/plugin/plugin-common.module.js.map +1 -1
  836. package/dist/plugin/plugin-utils.js +2 -2
  837. package/dist/plugin/plugin-utils.js.map +1 -1
  838. package/dist/plugin/plugin.module.js +2 -2
  839. package/dist/plugin/plugin.module.js.map +1 -1
  840. package/dist/plugin/vendure-plugin.d.ts +1 -1
  841. package/dist/plugin/vendure-plugin.js +3 -3
  842. package/dist/plugin/vendure-plugin.js.map +1 -1
  843. package/dist/process-context/process-context.d.ts +1 -1
  844. package/dist/process-context/process-context.module.js +2 -2
  845. package/dist/process-context/process-context.module.js.map +1 -1
  846. package/dist/service/helpers/active-order/active-order.service.d.ts +2 -2
  847. package/dist/service/helpers/active-order/active-order.service.js +8 -8
  848. package/dist/service/helpers/active-order/active-order.service.js.map +1 -1
  849. package/dist/service/helpers/config-arg/config-arg.service.d.ts +2 -2
  850. package/dist/service/helpers/config-arg/config-arg.service.js +2 -2
  851. package/dist/service/helpers/config-arg/config-arg.service.js.map +1 -1
  852. package/dist/service/helpers/custom-field-relation/custom-field-relation.service.js +10 -5
  853. package/dist/service/helpers/custom-field-relation/custom-field-relation.service.js.map +1 -1
  854. package/dist/service/helpers/entity-hydrator/entity-hydrator.service.js +7 -8
  855. package/dist/service/helpers/entity-hydrator/entity-hydrator.service.js.map +1 -1
  856. package/dist/service/helpers/external-authentication/external-authentication.service.js +2 -2
  857. package/dist/service/helpers/external-authentication/external-authentication.service.js.map +1 -1
  858. package/dist/service/helpers/fulfillment-state-machine/fulfillment-state-machine.d.ts +7 -13
  859. package/dist/service/helpers/fulfillment-state-machine/fulfillment-state-machine.js +18 -48
  860. package/dist/service/helpers/fulfillment-state-machine/fulfillment-state-machine.js.map +1 -1
  861. package/dist/service/helpers/fulfillment-state-machine/fulfillment-state.d.ts +13 -5
  862. package/dist/service/helpers/fulfillment-state-machine/fulfillment-state.js +0 -18
  863. package/dist/service/helpers/fulfillment-state-machine/fulfillment-state.js.map +1 -1
  864. package/dist/service/helpers/list-query-builder/list-query-builder.d.ts +3 -3
  865. package/dist/service/helpers/list-query-builder/list-query-builder.js +25 -21
  866. package/dist/service/helpers/list-query-builder/list-query-builder.js.map +1 -1
  867. package/dist/service/helpers/list-query-builder/parse-filter-params.js +8 -6
  868. package/dist/service/helpers/list-query-builder/parse-filter-params.js.map +1 -1
  869. package/dist/service/helpers/list-query-builder/parse-sort-params.d.ts +1 -1
  870. package/dist/service/helpers/list-query-builder/parse-sort-params.js +4 -4
  871. package/dist/service/helpers/list-query-builder/parse-sort-params.js.map +1 -1
  872. package/dist/service/helpers/locale-string-hydrator/locale-string-hydrator.js +5 -3
  873. package/dist/service/helpers/locale-string-hydrator/locale-string-hydrator.js.map +1 -1
  874. package/dist/service/helpers/order-calculator/order-calculator.d.ts +3 -14
  875. package/dist/service/helpers/order-calculator/order-calculator.js +46 -118
  876. package/dist/service/helpers/order-calculator/order-calculator.js.map +1 -1
  877. package/dist/service/helpers/order-merger/order-merger.d.ts +5 -5
  878. package/dist/service/helpers/order-merger/order-merger.js +4 -4
  879. package/dist/service/helpers/order-merger/order-merger.js.map +1 -1
  880. package/dist/service/helpers/order-modifier/order-modifier.d.ts +4 -2
  881. package/dist/service/helpers/order-modifier/order-modifier.js +205 -104
  882. package/dist/service/helpers/order-modifier/order-modifier.js.map +1 -1
  883. package/dist/service/helpers/order-splitter/order-splitter.d.ts +16 -0
  884. package/dist/service/helpers/order-splitter/order-splitter.js +122 -0
  885. package/dist/service/helpers/order-splitter/order-splitter.js.map +1 -0
  886. package/dist/service/helpers/order-state-machine/order-state-machine.d.ts +6 -23
  887. package/dist/service/helpers/order-state-machine/order-state-machine.js +16 -188
  888. package/dist/service/helpers/order-state-machine/order-state-machine.js.map +1 -1
  889. package/dist/service/helpers/order-state-machine/order-state.d.ts +32 -4
  890. package/dist/service/helpers/order-state-machine/order-state.js +0 -64
  891. package/dist/service/helpers/order-state-machine/order-state.js.map +1 -1
  892. package/dist/service/helpers/password-cipher/password-cipher.js +1 -1
  893. package/dist/service/helpers/password-cipher/password-cipher.js.map +1 -1
  894. package/dist/service/helpers/payment-state-machine/payment-state-machine.d.ts +5 -10
  895. package/dist/service/helpers/payment-state-machine/payment-state-machine.js +16 -38
  896. package/dist/service/helpers/payment-state-machine/payment-state-machine.js.map +1 -1
  897. package/dist/service/helpers/payment-state-machine/payment-state.d.ts +10 -4
  898. package/dist/service/helpers/payment-state-machine/payment-state.js +0 -21
  899. package/dist/service/helpers/payment-state-machine/payment-state.js.map +1 -1
  900. package/dist/service/helpers/product-price-applicator/product-price-applicator.js +7 -8
  901. package/dist/service/helpers/product-price-applicator/product-price-applicator.js.map +1 -1
  902. package/dist/service/helpers/refund-state-machine/refund-state-machine.d.ts +4 -2
  903. package/dist/service/helpers/refund-state-machine/refund-state-machine.js +3 -2
  904. package/dist/service/helpers/refund-state-machine/refund-state-machine.js.map +1 -1
  905. package/dist/service/helpers/refund-state-machine/refund-state.d.ts +1 -1
  906. package/dist/service/helpers/request-context/request-context.service.d.ts +2 -1
  907. package/dist/service/helpers/request-context/request-context.service.js +12 -6
  908. package/dist/service/helpers/request-context/request-context.service.js.map +1 -1
  909. package/dist/service/helpers/shipping-calculator/shipping-calculator.d.ts +1 -1
  910. package/dist/service/helpers/shipping-calculator/shipping-calculator.js +1 -1
  911. package/dist/service/helpers/shipping-calculator/shipping-calculator.js.map +1 -1
  912. package/dist/service/helpers/slug-validator/slug-validator.d.ts +2 -2
  913. package/dist/service/helpers/slug-validator/slug-validator.js +7 -7
  914. package/dist/service/helpers/slug-validator/slug-validator.js.map +1 -1
  915. package/dist/service/helpers/translatable-saver/translatable-saver.js +3 -3
  916. package/dist/service/helpers/translatable-saver/translatable-saver.js.map +1 -1
  917. package/dist/service/helpers/translatable-saver/translation-differ.d.ts +1 -1
  918. package/dist/service/helpers/translatable-saver/translation-differ.js +2 -2
  919. package/dist/service/helpers/translatable-saver/translation-differ.js.map +1 -1
  920. package/dist/service/helpers/translator/translator.service.js +2 -2
  921. package/dist/service/helpers/translator/translator.service.js.map +1 -1
  922. package/dist/service/helpers/utils/get-user-channels-permissions.d.ts +1 -1
  923. package/dist/service/helpers/utils/get-user-channels-permissions.js +1 -1
  924. package/dist/service/helpers/utils/get-user-channels-permissions.js.map +1 -1
  925. package/dist/service/helpers/utils/move-to-index.js +2 -2
  926. package/dist/service/helpers/utils/move-to-index.js.map +1 -1
  927. package/dist/service/helpers/utils/order-utils.d.ts +5 -1
  928. package/dist/service/helpers/utils/order-utils.js +58 -27
  929. package/dist/service/helpers/utils/order-utils.js.map +1 -1
  930. package/dist/service/helpers/utils/patch-entity.d.ts +1 -1
  931. package/dist/service/helpers/utils/translate-entity.d.ts +5 -5
  932. package/dist/service/helpers/utils/translate-entity.js +1 -1
  933. package/dist/service/helpers/utils/translate-entity.js.map +1 -1
  934. package/dist/service/helpers/verification-token-generator/verification-token-generator.js +3 -3
  935. package/dist/service/helpers/verification-token-generator/verification-token-generator.js.map +1 -1
  936. package/dist/service/index.d.ts +7 -2
  937. package/dist/service/index.js +12 -3
  938. package/dist/service/index.js.map +1 -1
  939. package/dist/service/initializer.service.d.ts +5 -1
  940. package/dist/service/initializer.service.js +12 -4
  941. package/dist/service/initializer.service.js.map +1 -1
  942. package/dist/service/service.module.js +10 -2
  943. package/dist/service/service.module.js.map +1 -1
  944. package/dist/service/services/administrator.service.js +30 -18
  945. package/dist/service/services/administrator.service.js.map +1 -1
  946. package/dist/service/services/asset.service.d.ts +1 -0
  947. package/dist/service/services/asset.service.js +36 -27
  948. package/dist/service/services/asset.service.js.map +1 -1
  949. package/dist/service/services/auth.service.js +5 -5
  950. package/dist/service/services/auth.service.js.map +1 -1
  951. package/dist/service/services/channel.service.d.ts +7 -4
  952. package/dist/service/services/channel.service.js +64 -28
  953. package/dist/service/services/channel.service.js.map +1 -1
  954. package/dist/service/services/collection.service.d.ts +6 -1
  955. package/dist/service/services/collection.service.js +50 -30
  956. package/dist/service/services/collection.service.js.map +1 -1
  957. package/dist/service/services/country.service.js +5 -5
  958. package/dist/service/services/country.service.js.map +1 -1
  959. package/dist/service/services/customer-group.service.d.ts +1 -1
  960. package/dist/service/services/customer-group.service.js +13 -10
  961. package/dist/service/services/customer-group.service.js.map +1 -1
  962. package/dist/service/services/customer.service.d.ts +2 -2
  963. package/dist/service/services/customer.service.js +40 -37
  964. package/dist/service/services/customer.service.js.map +1 -1
  965. package/dist/service/services/facet-value.service.d.ts +1 -1
  966. package/dist/service/services/facet-value.service.js +9 -8
  967. package/dist/service/services/facet-value.service.js.map +1 -1
  968. package/dist/service/services/facet.service.js +26 -17
  969. package/dist/service/services/facet.service.js.map +1 -1
  970. package/dist/service/services/fulfillment.service.d.ts +6 -24
  971. package/dist/service/services/fulfillment.service.js +50 -70
  972. package/dist/service/services/fulfillment.service.js.map +1 -1
  973. package/dist/service/services/global-settings.service.d.ts +3 -1
  974. package/dist/service/services/global-settings.service.js +16 -11
  975. package/dist/service/services/global-settings.service.js.map +1 -1
  976. package/dist/service/services/history.service.d.ts +5 -5
  977. package/dist/service/services/history.service.js +3 -3
  978. package/dist/service/services/history.service.js.map +1 -1
  979. package/dist/service/services/order-testing.service.js +11 -18
  980. package/dist/service/services/order-testing.service.js.map +1 -1
  981. package/dist/service/services/order.service.d.ts +11 -18
  982. package/dist/service/services/order.service.js +250 -411
  983. package/dist/service/services/order.service.js.map +1 -1
  984. package/dist/service/services/payment-method.service.d.ts +5 -1
  985. package/dist/service/services/payment-method.service.js +62 -35
  986. package/dist/service/services/payment-method.service.js.map +1 -1
  987. package/dist/service/services/payment.service.d.ts +2 -3
  988. package/dist/service/services/payment.service.js +74 -20
  989. package/dist/service/services/payment.service.js.map +1 -1
  990. package/dist/service/services/product-option-group.service.js +19 -16
  991. package/dist/service/services/product-option-group.service.js.map +1 -1
  992. package/dist/service/services/product-option.service.d.ts +1 -1
  993. package/dist/service/services/product-option.service.js +11 -10
  994. package/dist/service/services/product-option.service.js.map +1 -1
  995. package/dist/service/services/product-variant.service.d.ts +4 -2
  996. package/dist/service/services/product-variant.service.js +51 -32
  997. package/dist/service/services/product-variant.service.js.map +1 -1
  998. package/dist/service/services/product.service.js +43 -36
  999. package/dist/service/services/product.service.js.map +1 -1
  1000. package/dist/service/services/promotion.service.d.ts +7 -3
  1001. package/dist/service/services/promotion.service.js +80 -55
  1002. package/dist/service/services/promotion.service.js.map +1 -1
  1003. package/dist/service/services/role.service.js +20 -16
  1004. package/dist/service/services/role.service.js.map +1 -1
  1005. package/dist/service/services/search.service.js +2 -2
  1006. package/dist/service/services/search.service.js.map +1 -1
  1007. package/dist/service/services/seller.service.d.ts +25 -0
  1008. package/dist/service/services/seller.service.js +79 -0
  1009. package/dist/service/services/seller.service.js.map +1 -0
  1010. package/dist/service/services/session.service.d.ts +3 -3
  1011. package/dist/service/services/session.service.js +22 -19
  1012. package/dist/service/services/session.service.js.map +1 -1
  1013. package/dist/service/services/shipping-method.service.js +15 -12
  1014. package/dist/service/services/shipping-method.service.js.map +1 -1
  1015. package/dist/service/services/stock-level.service.d.ts +43 -0
  1016. package/dist/service/services/stock-level.service.js +125 -0
  1017. package/dist/service/services/stock-level.service.js.map +1 -0
  1018. package/dist/service/services/stock-location.service.d.ts +34 -0
  1019. package/dist/service/services/stock-location.service.js +129 -0
  1020. package/dist/service/services/stock-location.service.js.map +1 -0
  1021. package/dist/service/services/stock-movement.service.d.ts +14 -13
  1022. package/dist/service/services/stock-movement.service.js +128 -105
  1023. package/dist/service/services/stock-movement.service.js.map +1 -1
  1024. package/dist/service/services/tag.service.js +6 -3
  1025. package/dist/service/services/tag.service.js.map +1 -1
  1026. package/dist/service/services/tax-category.service.js +9 -6
  1027. package/dist/service/services/tax-category.service.js.map +1 -1
  1028. package/dist/service/services/tax-rate.service.d.ts +2 -2
  1029. package/dist/service/services/tax-rate.service.js +14 -10
  1030. package/dist/service/services/tax-rate.service.js.map +1 -1
  1031. package/dist/service/services/user.service.js +26 -13
  1032. package/dist/service/services/user.service.js.map +1 -1
  1033. package/dist/service/services/zone.service.js +12 -10
  1034. package/dist/service/services/zone.service.js.map +1 -1
  1035. package/dist/worker/index.js +5 -1
  1036. package/dist/worker/index.js.map +1 -1
  1037. package/dist/worker/worker-health.service.js +2 -2
  1038. package/dist/worker/worker-health.service.js.map +1 -1
  1039. package/dist/worker/worker.module.js +1 -1
  1040. package/dist/worker/worker.module.js.map +1 -1
  1041. package/package.json +105 -103
  1042. package/dist/api/resolvers/entity/order-item-entity.resolver.d.ts +0 -10
  1043. package/dist/api/resolvers/entity/order-item-entity.resolver.js +0 -52
  1044. package/dist/api/resolvers/entity/order-item-entity.resolver.js.map +0 -1
  1045. package/dist/api/schema/admin-api/asset-admin.type.graphql +0 -3
  1046. package/dist/config/entity-id-strategy/auto-increment-id-strategy.js.map +0 -1
  1047. package/dist/config/entity-id-strategy/entity-id-strategy.js.map +0 -1
  1048. package/dist/config/entity-id-strategy/uuid-id-strategy.js.map +0 -1
  1049. package/dist/config/fulfillment/custom-fulfillment-process.js.map +0 -1
  1050. package/dist/config/order/custom-order-process.js.map +0 -1
  1051. package/dist/config/payment/custom-payment-process.js.map +0 -1
  1052. package/dist/connection/remove-custom-fields-with-eager-relations.d.ts +0 -34
  1053. package/dist/connection/remove-custom-fields-with-eager-relations.js +0 -58
  1054. package/dist/connection/remove-custom-fields-with-eager-relations.js.map +0 -1
  1055. package/dist/entity/order-item/order-item.entity.d.ts +0 -97
  1056. package/dist/entity/order-item/order-item.entity.js +0 -228
  1057. package/dist/entity/order-item/order-item.entity.js.map +0 -1
  1058. package/dist/service/helpers/list-query-builder/parse-channel-param.d.ts +0 -9
  1059. package/dist/service/helpers/list-query-builder/parse-channel-param.js +0 -22
  1060. package/dist/service/helpers/list-query-builder/parse-channel-param.js.map +0 -1
  1061. /package/dist/config/{entity-id-strategy → entity}/auto-increment-id-strategy.d.ts +0 -0
  1062. /package/dist/config/{entity-id-strategy → entity}/auto-increment-id-strategy.js +0 -0
  1063. /package/dist/config/{entity-id-strategy → entity}/entity-id-strategy.js +0 -0
  1064. /package/dist/config/{entity-id-strategy → entity}/uuid-id-strategy.d.ts +0 -0
  1065. /package/dist/config/{entity-id-strategy → entity}/uuid-id-strategy.js +0 -0
@@ -1,23 +1,4 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
- Object.defineProperty(o, "default", { enumerable: true, value: v });
11
- }) : function(o, v) {
12
- o["default"] = v;
13
- });
14
- var __importStar = (this && this.__importStar) || function (mod) {
15
- if (mod && mod.__esModule) return mod;
16
- var result = {};
17
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
- __setModuleDefault(result, mod);
19
- return result;
20
- };
21
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
22
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
23
4
  };
@@ -43,13 +24,13 @@ class NativeAuthenticationStrategy {
43
24
  async init(injector) {
44
25
  this.connection = injector.get(transactional_connection_1.TransactionalConnection);
45
26
  // These are lazily-loaded to avoid a circular dependency
46
- const { PasswordCipher } = await Promise.resolve().then(() => __importStar(require('../../service/helpers/password-cipher/password-cipher')));
47
- const { UserService } = await Promise.resolve().then(() => __importStar(require('../../service/services/user.service')));
27
+ const { PasswordCipher } = await import('../../service/helpers/password-cipher/password-cipher.js');
28
+ const { UserService } = await import('../../service/services/user.service.js');
48
29
  this.passwordCipher = injector.get(PasswordCipher);
49
30
  this.userService = injector.get(UserService);
50
31
  }
51
32
  defineInputType() {
52
- return graphql_tag_1.default `
33
+ return (0, graphql_tag_1.default) `
53
34
  input NativeAuthInput {
54
35
  username: String!
55
36
  password: String!
@@ -72,7 +53,8 @@ class NativeAuthenticationStrategy {
72
53
  */
73
54
  async verifyUserPassword(ctx, userId, password) {
74
55
  var _a, _b;
75
- const user = await this.connection.getRepository(ctx, user_entity_1.User).findOne(userId, {
56
+ const user = await this.connection.getRepository(ctx, user_entity_1.User).findOne({
57
+ where: { id: userId },
76
58
  relations: ['authenticationMethods'],
77
59
  });
78
60
  if (!user) {
@@ -82,9 +64,8 @@ class NativeAuthenticationStrategy {
82
64
  if (!nativeAuthMethod) {
83
65
  return false;
84
66
  }
85
- const pw = (_b = (_a = (await this.connection
86
- .getRepository(ctx, native_authentication_method_entity_1.NativeAuthenticationMethod)
87
- .findOne(nativeAuthMethod.id, {
67
+ const pw = (_b = (_a = (await this.connection.getRepository(ctx, native_authentication_method_entity_1.NativeAuthenticationMethod).findOne({
68
+ where: { id: nativeAuthMethod.id },
88
69
  select: ['passwordHash'],
89
70
  }))) === null || _a === void 0 ? void 0 : _a.passwordHash) !== null && _b !== void 0 ? _b : '';
90
71
  const passwordMatches = await this.passwordCipher.check(password, pw);
@@ -1 +1 @@
1
- {"version":3,"file":"native-authentication-strategy.js","sourceRoot":"","sources":["../../../src/config/auth/native-authentication-strategy.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAEA,8DAA8B;AAI9B,wFAAoF;AACpF,gIAAoH;AACpH,+DAAqD;AASxC,QAAA,yBAAyB,GAAG,QAAQ,CAAC;AAElD;;;;;;;GAOG;AACH,MAAa,4BAA4B;IAAzC;QACa,SAAI,GAAG,iCAAyB,CAAC;IAgE9C,CAAC;IA1DG,KAAK,CAAC,IAAI,CAAC,QAAkB;QACzB,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC,GAAG,CAAC,kDAAuB,CAAC,CAAC;QACxD,yDAAyD;QACzD,MAAM,EAAE,cAAc,EAAE,GAAG,wDAAa,uDAAuD,GAAC,CAAC;QACjG,MAAM,EAAE,WAAW,EAAE,GAAG,wD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B,CAAC;aAC9C,OAAO,CAAC,gBAAgB,CAAC,EAAE,EAAE;YAC1B,MAAM,EAAE,CAAC,cAAc,CAAC;SAC3B,CAAC,CACT,0CAAE,YAAY,mCAAI,EAAE,CAAC;QAC1B,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QACtE,IAAI,CAAC,eAAe,EAAE;YAClB,OAAO,KAAK,CAAC;SAChB;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAjED,oEAiEC"}
1
+ {"version":3,"file":"native-authentication-strategy.js","sourceRoot":"","sources":["../../../src/config/auth/native-authentication-strategy.ts"],"names":[],"mappings":";;;;;;AAEA,8DAA8B;AAI9B,wFAAoF;AACpF,gIAAoH;AACpH,+DAAqD;AASxC,QAAA,yBAAyB,GAAG,QAAQ,CAAC;AAElD;;;;;;;GAOG;AACH,MAAa,4BAA4B;IAAzC;QACa,SAAI,GAAG,iCAAyB,CAAC;IAgE9C,CAAC;IA1DG,KAAK,CAAC,IAAI,CAAC,QAAkB;QACzB,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC,GAAG,CAAC,kDAAuB,CAAC,CAAC;QACxD,yDAAyD;QACzD,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,MAAM,CAAC,0DAA0D,CAAC,CAAC;QACpG,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,MAAM,CAAC,wCAAwC,CAAC,CAAC;QAC/E,IAAI,CAAC,cAAc,GAAG,QAAQ,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QACnD,IAAI,CAAC,WAAW,GAAG,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IACjD,CAAC;IAED,eAAe;QACX,OAAO,IAAA,qBAAG,EAAA;;;;;SAKT,CAAC;IACN,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,GAAmB,EAAE,IAA8B;QAClE,MAAM,IAAI,GAAG,MAAM,IA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AAe,EAAE;YAClB,OAAO,KAAK,CAAC;SAChB;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAjED,oEAiEC"}
@@ -2,7 +2,7 @@ import { ConfigArg } from '@vendure/common/lib/generated-types';
2
2
  import { SelectQueryBuilder } from 'typeorm';
3
3
  import { ConfigArgs, ConfigArgValues, ConfigurableOperationDef, ConfigurableOperationDefOptions } from '../../common/configurable-operation';
4
4
  import { ProductVariant } from '../../entity/product-variant/product-variant.entity';
5
- export declare type ApplyCollectionFilterFn<T extends ConfigArgs> = (qb: SelectQueryBuilder<ProductVariant>, args: ConfigArgValues<T>) => SelectQueryBuilder<ProductVariant>;
5
+ export type ApplyCollectionFilterFn<T extends ConfigArgs> = (qb: SelectQueryBuilder<ProductVariant>, args: ConfigArgValues<T>) => SelectQueryBuilder<ProductVariant>;
6
6
  export interface CollectionFilterConfig<T extends ConfigArgs> extends ConfigurableOperationDefOptions<T> {
7
7
  apply: ApplyCollectionFilterFn<T>;
8
8
  }
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CollectionFilter = void 0;
4
4
  const configurable_operation_1 = require("../../common/configurable-operation");
5
- // tslint:disable:max-line-length
5
+ /* eslint-disable max-len */
6
6
  /**
7
7
  * @description
8
8
  * A CollectionFilter defines a rule which can be used to associate ProductVariants with a Collection.
@@ -1 +1 @@
1
- {"version":3,"file":"collection-filter.js","sourceRoot":"","sources":["../../../src/config/catalog/collection-filter.ts"],"names":[],"mappings":";;;AAGA,gFAK6C;AAW7C,iCAAiC;AACjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,MAAa,gBAAoD,SAAQ,iDAA2B;IAGhG,YAAY,MAAiC;QACzC,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC;IAChC,CAAC;IAED,KAAK,CAAC,EAAsC,EAAE,IAAiB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC;IACxD,CAAC;CACJ;AAXD,4CAWC"}
1
+ {"version":3,"file":"collection-filter.js","sourceRoot":"","sources":["../../../src/config/catalog/collection-filter.ts"],"names":[],"mappings":";;;AAGA,gFAK6C;AAW7C,4BAA4B;AAC5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,MAAa,gBAAoD,SAAQ,iDAA2B;IAGhG,YAAY,MAAiC;QACzC,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC;IAChC,CAAC;IAED,KAAK,CAAC,EAAsC,EAAE,IAAiB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC;IACxD,CAAC;CACJ;AAXD,4CAWC"}
@@ -2,17 +2,18 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.defaultCollectionFilters = exports.productIdCollectionFilter = exports.variantIdCollectionFilter = exports.variantNameCollectionFilter = exports.facetValueCollectionFilter = exports.combineWithAndArg = exports.randomSuffix = void 0;
4
4
  const generated_types_1 = require("@vendure/common/lib/generated-types");
5
- const nanoid_1 = require("nanoid");
6
5
  const errors_1 = require("../../common/error/errors");
7
6
  const product_variant_entity_1 = require("../../entity/product-variant/product-variant.entity");
8
7
  const collection_filter_1 = require("./collection-filter");
8
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
9
+ const { customAlphabet } = require('nanoid');
9
10
  /**
10
11
  * @description
11
12
  * Used to created unique key names for DB query parameters, to avoid conflicts if the
12
13
  * same filter is applied multiple times.
13
14
  */
14
15
  function randomSuffix(prefix) {
15
- const nanoid = nanoid_1.customAlphabet('123456789abcdefghijklmnopqrstuvwxyz', 6);
16
+ const nanoid = customAlphabet('123456789abcdefghijklmnopqrstuvwxyz', 6);
16
17
  return `${prefix}_${nanoid()}`;
17
18
  }
18
19
  exports.randomSuffix = randomSuffix;
@@ -27,6 +28,7 @@ exports.combineWithAndArg = {
27
28
  description: [
28
29
  {
29
30
  languageCode: generated_types_1.LanguageCode.en,
31
+ // eslint-disable-next-line max-len
30
32
  value: 'If this filter is being combined with other filters, do all conditions need to be satisfied (AND), or just one or the other (OR)?',
31
33
  },
32
34
  ],
@@ -54,7 +56,8 @@ exports.facetValueCollectionFilter = new collection_filter_1.CollectionFilter({
54
56
  description: [
55
57
  {
56
58
  languageCode: generated_types_1.LanguageCode.en,
57
- value: 'If checked, product variants must have at least one of the selected facet values. If not checked, the variant must have all selected values.',
59
+ value: 'If checked, product variants must have at least one of the selected facet values. ' +
60
+ 'If not checked, the variant must have all selected values.',
58
61
  },
59
62
  ],
60
63
  },
@@ -133,8 +136,8 @@ exports.variantNameCollectionFilter = new collection_filter_1.CollectionFilter({
133
136
  code: 'variant-name-filter',
134
137
  description: [{ languageCode: generated_types_1.LanguageCode.en, value: 'Filter by product variant name' }],
135
138
  apply: (qb, args) => {
136
- let translationAlias = `variant_name_filter_translation`;
137
- const termName = randomSuffix(`term`);
139
+ let translationAlias = 'variant_name_filter_translation';
140
+ const termName = randomSuffix('term');
138
141
  const translationsJoin = qb.expressionMap.joinAttributes.find(ja => ja.entityOrProperty === 'productVariant.translations');
139
142
  if (!translationsJoin) {
140
143
  qb.leftJoin('productVariant.translations', translationAlias);
@@ -200,7 +203,7 @@ exports.variantIdCollectionFilter = new collection_filter_1.CollectionFilter({
200
203
  if (args.variantIds.length === 0) {
201
204
  return qb;
202
205
  }
203
- const variantIdsKey = randomSuffix(`variantIds`);
206
+ const variantIdsKey = randomSuffix('variantIds');
204
207
  const clause = `productVariant.id IN (:...${variantIdsKey})`;
205
208
  const params = { [variantIdsKey]: args.variantIds };
206
209
  if (args.combineWithAnd === false) {
@@ -230,7 +233,7 @@ exports.productIdCollectionFilter = new collection_filter_1.CollectionFilter({
230
233
  if (args.productIds.length === 0) {
231
234
  return qb;
232
235
  }
233
- const productIdsKey = randomSuffix(`productIds`);
236
+ const productIdsKey = randomSuffix('productIds');
234
237
  const clause = `productVariant.productId IN (:...${productIdsKey})`;
235
238
  const params = { [productIdsKey]: args.productIds };
236
239
  if (args.combineWithAnd === false) {
@@ -1 +1 @@
1
- {"version":3,"file":"default-collection-filters.js","sourceRoot":"","sources":["../../../src/config/catalog/default-collection-filters.ts"],"names":[],"mappings":";;;AAAA,yEAAmE;AACnE,mCAAwC;AAGxC,sDAA2D;AAC3D,gGAAqF;AAErF,2DAAuD;AAEvD;;;;GAIG;AACH,SAAgB,YAAY,CAAC,MAAc;IACvC,MAAM,MAAM,GAAG,uBAAc,CAAC,qCAAqC,EAAE,CAAC,CAAC,CAAC;IACxE,OAAO,GAAG,MAAM,IAAI,MAAM,EAAE,EAAE,CAAC;AACnC,CAAC;AAHD,oCAGC;AAED;;;;GAIG;AACU,QAAA,iBAAiB,GAA4B;IACtD,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,CAAC,EAAE,YAAY,EAAE,8BAAY,CAAC,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE,CAAC;IACrE,WAAW,EAAE;QACT;YACI,YAAY,EAAE,8BAAY,CAAC,EAAE;YAC7B,KAAK,EAAE,mIAAmI;SAC7I;KACJ;IACD,YAAY,EAAE,IAAI;IAClB,EAAE,EAAE;QACA,SAAS,EAAE,6BAA6B;KAC3C;CACJ,CAAC;AAEF;;GAEG;AACU,QAAA,0BAA0B,GAAG,IAAI,oCAAgB,CAAC;IAC3D,IAAI,EAAE;QACF,aAAa,EAAE;YACX,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,IAAI;YACV,EAAE,EAAE;gBACA,SAAS,EAAE,wBAAwB;aACtC;YACD,KAAK,EAAE,CAAC,EAAE,YAAY,EAAE,8BAAY,CAAC,EAAE,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC;SACpE;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AAE,0BAA0B;gBACrC,aAAa,EAAE,SAAS;aAC3B;SACJ;QACD,cAAc,EAAE,yBAAiB;KACpC;IACD,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,CAAC,EAAE,YAAY,EAAE,8BAAY,CAAC,EAAE,EAAE,KAAK,EAAE,0BAA0B,EAAE,CAAC;IACnF,KAAK,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE;QAChB,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,OAAO,EAAE,CAAC;SACb;QACD,MAAM,aAAa,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC;QACjD,MAAM,MAAM,GAAG,oCAAoC,aAAa,GAAG,CAAC;QACpE,MAAM,MAAM,GAAG,EAAE,CAAC,aAAa,CAAC,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC;QACpD,IAAI,IAAI,CAAC,cAAc,KAAK,KAAK,EAAE;YAC/B,OAAO,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;SACrC;aAAM;YACH,OAAO,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;SACtC;IACL,CAAC;CACJ,CAAC,CAAC;AAEU,QAAA,wBAAwB,GAAG;IACpC,kCAA0B;IAC1B,mCAA2B;IAC3B,iCAAyB;IACzB,iCAAyB;CAC5B,CAAC"}
1
+ {"version":3,"file":"default-collection-filters.js","sourceRoot":"","sources":["../../../src/config/catalog/default-collection-filters.ts"],"names":[],"mappings":";;;AAAA,yEAAmE;AAKnE,sDAA2D;AAC3D,gGAAqF;AAErF,2DAAuD;AAEvD,8DAA8D;AAC9D,MAAM,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAE7C;;;;GAIG;AACH,SAAgB,YAAY,CAAC,MAAc;IACvC,MAAM,MAAM,GAAG,cAAc,CAAC,qCAAqC,EAAE,CAAC,CAAC,CAAC;IACxE,OAAO,G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a,CAAC,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC;QACpD,IAAI,IAAI,CAAC,cAAc,KAAK,KAAK,EAAE;YAC/B,OAAO,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;SACrC;aAAM;YACH,OAAO,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;SACtC;IACL,CAAC;CACJ,CAAC,CAAC;AAEU,QAAA,wBAAwB,GAAG;IACpC,kCAA0B;IAC1B,mCAA2B;IAC3B,iCAAyB;IACzB,iCAAyB;CAC5B,CAAC"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DefaultProductVariantPriceCalculationStrategy = void 0;
4
+ const round_money_1 = require("../../common/round-money");
4
5
  const utils_1 = require("../../common/utils");
5
6
  const tax_rate_service_1 = require("../../service/services/tax-rate.service");
6
7
  /**
@@ -18,13 +19,13 @@ class DefaultProductVariantPriceCalculationStrategy {
18
19
  let price = inputPrice;
19
20
  let priceIncludesTax = false;
20
21
  if (ctx.channel.pricesIncludeTax) {
21
- const isDefaultZone = utils_1.idsAreEqual(activeTaxZone.id, ctx.channel.defaultTaxZone.id);
22
+ const isDefaultZone = (0, utils_1.idsAreEqual)(activeTaxZone.id, ctx.channel.defaultTaxZone.id);
22
23
  if (isDefaultZone) {
23
24
  priceIncludesTax = true;
24
25
  }
25
26
  else {
26
27
  const taxRateForDefaultZone = await this.taxRateService.getApplicableTaxRate(ctx, ctx.channel.defaultTaxZone, taxCategory);
27
- price = taxRateForDefaultZone.netPriceOf(inputPrice);
28
+ price = (0, round_money_1.roundMoney)(taxRateForDefaultZone.netPriceOf(inputPrice));
28
29
  }
29
30
  }
30
31
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"default-product-variant-price-calculation-strategy.js","sourceRoot":"","sources":["../../../src/config/catalog/default-product-variant-price-calculation-strategy.ts"],"names":[],"mappings":";;;AAEA,8CAAiD;AACjD,8EAAyE;AAOzE;;;;;GAKG;AACH,MAAa,6CAA6C;IAGtD,IAAI,CAAC,QAAkB;QACnB,IAAI,CAAC,cAAc,GAAG,QAAQ,CAAC,GAAG,CAAC,iCAAc,CAAC,CAAC;IACvD,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,IAAwC;QACpD,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,GAAG,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;QAC7D,IAAI,KAAK,GAAG,UAAU,CAAC;QACvB,IAAI,gBAAgB,GAAG,KAAK,CAAC;QAE7B,IAAI,GAAG,CAAC,OAAO,CAAC,gBAAgB,EAAE;YAC9B,MAAM,aAAa,GAAG,mBAAW,CAAC,aAAa,CAAC,EAAE,EAAE,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;YACnF,IAAI,aAAa,EAAE;gBACf,gBAAgB,GAAG,IAAI,CAAC;aAC3B;iBAAM;gBACH,MAAM,qBAAqB,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,oBAAoB,CACxE,GAAG,EACH,GAAG,CAAC,OAAO,CAAC,cAAc,EAC1B,WAAW,CACd,CAAC;gBACF,KAAK,GAAG,qBAAqB,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;aACxD;SACJ;QAED,OAAO;YACH,KAAK;YACL,gBAAgB;SACnB,CAAC;IACN,CAAC;CACJ;AA/BD,sGA+BC"}
1
+ {"version":3,"file":"default-product-variant-price-calculation-strategy.js","sourceRoot":"","sources":["../../../src/config/catalog/default-product-variant-price-calculation-strategy.ts"],"names":[],"mappings":";;;AACA,0DAAsD;AAEtD,8CAAiD;AACjD,8EAAyE;AAOzE;;;;;GAKG;AACH,MAAa,6CAA6C;IAGtD,IAAI,CAAC,QAAkB;QACnB,IAAI,CAAC,cAAc,GAAG,QAAQ,CAAC,GAAG,CAAC,iCAAc,CAAC,CAAC;IACvD,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,IAAwC;QACpD,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,GAAG,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;QAC7D,IAAI,KAAK,GAAG,UAAU,CAAC;QACvB,IAAI,gBAAgB,GAAG,KAAK,CAAC;QAE7B,IAAI,GAAG,CAAC,OAAO,CAAC,gBAAgB,EAAE;YAC9B,MAAM,aAAa,GAAG,IAAA,mBAAW,EAAC,aAAa,CAAC,EAAE,EAAE,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;YACnF,IAAI,aAAa,EAAE;gBACf,gBAAgB,GAAG,IAAI,CAAC;aAC3B;iBAAM;gBACH,MAAM,qBAAqB,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,oBAAoB,CACxE,GAAG,EACH,GAAG,CAAC,OAAO,CAAC,cAAc,EAC1B,WAAW,CACd,CAAC;gBACF,KAAK,GAAG,IAAA,wBAAU,EAAC,qBAAqB,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;aACpE;SACJ;QAED,OAAO;YACH,KAAK;YACL,gBAAgB;SACnB,CAAC;IACN,CAAC;CACJ;AA/BD,sGA+BC"}
@@ -0,0 +1,10 @@
1
+ import { RequestContext } from '../../api/common/request-context';
2
+ import { ProductVariantPrice } from '../../entity/product-variant/product-variant-price.entity';
3
+ import { ProductVariantPriceSelectionStrategy } from './product-variant-price-selection-strategy';
4
+ /**
5
+ * @description
6
+ * The default strategy for selecting the price for a ProductVariant in a given Channel.
7
+ */
8
+ export declare class DefaultProductVariantPriceSelectionStrategy implements ProductVariantPriceSelectionStrategy {
9
+ selectPrice(ctx: RequestContext, prices: ProductVariantPrice[]): ProductVariantPrice | undefined;
10
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DefaultProductVariantPriceSelectionStrategy = void 0;
4
+ const utils_1 = require("../../common/utils");
5
+ /**
6
+ * @description
7
+ * The default strategy for selecting the price for a ProductVariant in a given Channel.
8
+ */
9
+ class DefaultProductVariantPriceSelectionStrategy {
10
+ selectPrice(ctx, prices) {
11
+ return prices.find(p => (0, utils_1.idsAreEqual)(p.channelId, ctx.channelId));
12
+ }
13
+ }
14
+ exports.DefaultProductVariantPriceSelectionStrategy = DefaultProductVariantPriceSelectionStrategy;
15
+ //# sourceMappingURL=default-product-variant-price-selection-strategy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default-product-variant-price-selection-strategy.js","sourceRoot":"","sources":["../../../src/config/catalog/default-product-variant-price-selection-strategy.ts"],"names":[],"mappings":";;;AACA,8CAAiD;AAKjD;;;GAGG;AACH,MAAa,2CAA2C;IACpD,WAAW,CAAC,GAAmB,EAAE,MAA6B;QAC1D,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAA,mBAAW,EAAC,CAAC,CAAC,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC;IACrE,CAAC;CACJ;AAJD,kGAIC"}
@@ -0,0 +1,25 @@
1
+ import { ID } from '@vendure/common/lib/shared-types';
2
+ import { RequestContext } from '../../api/index';
3
+ import { Injector } from '../../common/index';
4
+ import { OrderLine } from '../../entity/order-line/order-line.entity';
5
+ import { StockLevel } from '../../entity/stock-level/stock-level.entity';
6
+ import { StockLocation } from '../../entity/stock-location/stock-location.entity';
7
+ import { AvailableStock, LocationWithQuantity, StockLocationStrategy } from './stock-location-strategy';
8
+ /**
9
+ * @description
10
+ * The DefaultStockLocationStrategy is the default implementation of the {@link StockLocationStrategy}.
11
+ * It assumes only a single StockLocation and that all stock is allocated from that location.
12
+ *
13
+ * @docsCategory catalog
14
+ * @since 2.0.0
15
+ */
16
+ export declare class DefaultStockLocationStrategy implements StockLocationStrategy {
17
+ private connection;
18
+ init(injector: Injector): void;
19
+ getAvailableStock(ctx: RequestContext, productVariantId: ID, stockLevels: StockLevel[]): AvailableStock;
20
+ forAllocation(ctx: RequestContext, stockLocations: StockLocation[], orderLine: OrderLine, quantity: number): LocationWithQuantity[] | Promise<LocationWithQuantity[]>;
21
+ forCancellation(ctx: RequestContext, stockLocations: StockLocation[], orderLine: OrderLine, quantity: number): Promise<LocationWithQuantity[]>;
22
+ forRelease(ctx: RequestContext, stockLocations: StockLocation[], orderLine: OrderLine, quantity: number): Promise<LocationWithQuantity[]>;
23
+ forSale(ctx: RequestContext, stockLocations: StockLocation[], orderLine: OrderLine, quantity: number): Promise<LocationWithQuantity[]>;
24
+ private getLocationsBasedOnAllocations;
25
+ }
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DefaultStockLocationStrategy = void 0;
4
+ const index_1 = require("../../common/index");
5
+ const index_2 = require("../../connection/index");
6
+ const allocation_entity_1 = require("../../entity/stock-movement/allocation.entity");
7
+ /**
8
+ * @description
9
+ * The DefaultStockLocationStrategy is the default implementation of the {@link StockLocationStrategy}.
10
+ * It assumes only a single StockLocation and that all stock is allocated from that location.
11
+ *
12
+ * @docsCategory catalog
13
+ * @since 2.0.0
14
+ */
15
+ class DefaultStockLocationStrategy {
16
+ init(injector) {
17
+ this.connection = injector.get(index_2.TransactionalConnection);
18
+ }
19
+ getAvailableStock(ctx, productVariantId, stockLevels) {
20
+ let stockOnHand = 0;
21
+ let stockAllocated = 0;
22
+ for (const stockLevel of stockLevels) {
23
+ stockOnHand += stockLevel.stockOnHand;
24
+ stockAllocated += stockLevel.stockAllocated;
25
+ }
26
+ return { stockOnHand, stockAllocated };
27
+ }
28
+ forAllocation(ctx, stockLocations, orderLine, quantity) {
29
+ return [{ location: stockLocations[0], quantity }];
30
+ }
31
+ async forCancellation(ctx, stockLocations, orderLine, quantity) {
32
+ return this.getLocationsBasedOnAllocations(ctx, stockLocations, orderLine, quantity);
33
+ }
34
+ async forRelease(ctx, stockLocations, orderLine, quantity) {
35
+ return this.getLocationsBasedOnAllocations(ctx, stockLocations, orderLine, quantity);
36
+ }
37
+ async forSale(ctx, stockLocations, orderLine, quantity) {
38
+ return this.getLocationsBasedOnAllocations(ctx, stockLocations, orderLine, quantity);
39
+ }
40
+ async getLocationsBasedOnAllocations(ctx, stockLocations, orderLine, quantity) {
41
+ const allocations = await this.connection.getRepository(ctx, allocation_entity_1.Allocation).find({
42
+ where: {
43
+ orderLine: { id: orderLine.id },
44
+ },
45
+ });
46
+ let unallocated = quantity;
47
+ const quantityByLocationId = new Map();
48
+ for (const allocation of allocations) {
49
+ if (unallocated <= 0) {
50
+ break;
51
+ }
52
+ const qtyAtLocation = quantityByLocationId.get(allocation.stockLocationId);
53
+ const qtyToAdd = Math.min(allocation.quantity, unallocated);
54
+ if (qtyAtLocation != null) {
55
+ quantityByLocationId.set(allocation.stockLocationId, qtyAtLocation + qtyToAdd);
56
+ }
57
+ else {
58
+ quantityByLocationId.set(allocation.stockLocationId, qtyToAdd);
59
+ }
60
+ unallocated -= qtyToAdd;
61
+ }
62
+ return [...quantityByLocationId.entries()].map(([locationId, qty]) => ({
63
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
64
+ location: stockLocations.find(l => (0, index_1.idsAreEqual)(l.id, locationId)),
65
+ quantity: qty,
66
+ }));
67
+ }
68
+ }
69
+ exports.DefaultStockLocationStrategy = DefaultStockLocationStrategy;
70
+ //# sourceMappingURL=default-stock-location-strategy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default-stock-location-strategy.js","sourceRoot":"","sources":["../../../src/config/catalog/default-stock-location-strategy.ts"],"names":[],"mappings":";;;AAGA,8CAA2D;AAC3D,kDAAiE;AAIjE,qFAA2E;AAI3E;;;;;;;GAOG;AACH,MAAa,4BAA4B;IAGrC,IAAI,CAAC,QAAkB;QACnB,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC,GAAG,CAAC,+BAAuB,CAAC,CAAC;IAC5D,CAAC;IAED,iBAAiB,CAAC,GAAmB,EAAE,gBAAoB,EAAE,WAAyB;QAClF,IAAI,WAAW,GAAG,CAAC,CAAC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,CAAC,CAAC;QACH,IAAI,WAAW,GAAG,QAAQ,CAAC;QAC3B,MAAM,oBAAoB,GAAG,IAAI,GAAG,EAAc,CAAC;QACnD,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE;YAClC,IAAI,WAAW,IAAI,CAAC,EAAE;gBAClB,MAAM;aACT;YACD,MAAM,aAAa,GAAG,oBAAoB,CAAC,GAAG,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;YAC3E,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;YAC5D,IAAI,aAAa,IAAI,IAAI,EAAE;gBACvB,oBAAoB,CAAC,GAAG,CAAC,UAAU,CAAC,eAAe,EAAE,aAAa,GAAG,QAAQ,CAAC,CAAC;aAClF;iBAAM;gBACH,oBAAoB,CAAC,GAAG,CAAC,UAAU,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC;aAClE;YACD,WAAW,IAAI,QAAQ,CAAC;SAC3B;QACD,OAAO,CAAC,GAAG,oBAAoB,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,UAAU,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;YACnE,oEAAoE;YACpE,QAAQ,EAAE,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAA,mBAAW,EAAC,CAAC,CAAC,EAAE,EAAE,UAAU,CAAC,CAAE;YAClE,QAAQ,EAAE,GAAG;SAChB,CAAC,CAAC,CAAC;IACR,CAAC;CACJ;AArFD,oEAqFC"}
@@ -1,7 +1,8 @@
1
1
  import { RequestContext } from '../../api/common/request-context';
2
2
  import { PriceCalculationResult } from '../../common/types/common-types';
3
3
  import { InjectableStrategy } from '../../common/types/injectable-strategy';
4
- import { TaxCategory, Zone } from '../../entity/index';
4
+ import { TaxCategory } from '../../entity/tax-category/tax-category.entity';
5
+ import { Zone } from '../../entity/zone/zone.entity';
5
6
  /**
6
7
  * @description
7
8
  * Defines how ProductVariant are calculated based on the input price, tax zone and current request context.
@@ -14,7 +15,7 @@ export interface ProductVariantPriceCalculationStrategy extends InjectableStrate
14
15
  }
15
16
  /**
16
17
  * @description
17
- * The arguments passed the the `calculate` method of the configured {@link ProductVariantPriceCalculationStrategy}.
18
+ * The arguments passed the `calculate` method of the configured {@link ProductVariantPriceCalculationStrategy}.
18
19
  *
19
20
  * @docsCategory configuration
20
21
  * @docsPage ProductVariantPriceCalculationStrategy
@@ -0,0 +1,6 @@
1
+ import { RequestContext } from '../../api/common/request-context';
2
+ import { InjectableStrategy } from '../../common/types/injectable-strategy';
3
+ import { ProductVariantPrice } from '../../entity/product-variant/product-variant-price.entity';
4
+ export interface ProductVariantPriceSelectionStrategy extends InjectableStrategy {
5
+ selectPrice(ctx: RequestContext, prices: ProductVariantPrice[]): ProductVariantPrice | undefined | Promise<ProductVariantPrice | undefined>;
6
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=product-variant-price-selection-strategy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"product-variant-price-selection-strategy.js","sourceRoot":"","sources":["../../../src/config/catalog/product-variant-price-selection-strategy.ts"],"names":[],"mappings":""}
@@ -0,0 +1,74 @@
1
+ import { ID } from '@vendure/common/lib/shared-types';
2
+ import { RequestContext } from '../../api/common/request-context';
3
+ import { InjectableStrategy } from '../../common/types/injectable-strategy';
4
+ import { OrderLine } from '../../entity/order-line/order-line.entity';
5
+ import { StockLevel } from '../../entity/stock-level/stock-level.entity';
6
+ import { StockLocation } from '../../entity/stock-location/stock-location.entity';
7
+ /**
8
+ * @description
9
+ * The overall available stock for a ProductVariant as determined by the logic of the
10
+ * {@link StockLocationStrategy}'s `getAvailableStock` method.
11
+ *
12
+ * @docsCategory catalog
13
+ * @since 2.0.0
14
+ * @docsPage StockLocationStrategy
15
+ */
16
+ export interface AvailableStock {
17
+ stockOnHand: number;
18
+ stockAllocated: number;
19
+ }
20
+ /**
21
+ * @description
22
+ * Returned by the `StockLocationStrategy` methods to indicate how much stock from each
23
+ * location should be used in the allocation/sale/release/cancellation of an OrderLine.
24
+ *
25
+ * @docsCategory catalog
26
+ * @since 2.0.0
27
+ * @docsPage StockLocationStrategy
28
+ */
29
+ export interface LocationWithQuantity {
30
+ location: StockLocation;
31
+ quantity: number;
32
+ }
33
+ /**
34
+ * @description
35
+ * The StockLocationStrategy is responsible for determining which {@link StockLocation}s
36
+ * should be used to fulfill an {@link OrderLine} and how much stock should be allocated
37
+ * from each location. It is also used to determine the available stock for a given
38
+ * {@link ProductVariant}.
39
+ *
40
+ * @docsCategory catalog
41
+ * @since 2.0.0
42
+ */
43
+ export interface StockLocationStrategy extends InjectableStrategy {
44
+ /**
45
+ * @description
46
+ * Returns the available stock for the given ProductVariant, taking into account
47
+ * the stock levels at each StockLocation.
48
+ */
49
+ getAvailableStock(ctx: RequestContext, productVariantId: ID, stockLevels: StockLevel[]): AvailableStock | Promise<AvailableStock>;
50
+ /**
51
+ * @description
52
+ * Determines which StockLocations should be used to when allocating stock when
53
+ * and Order is placed.
54
+ */
55
+ forAllocation(ctx: RequestContext, stockLocations: StockLocation[], orderLine: OrderLine, quantity: number): LocationWithQuantity[] | Promise<LocationWithQuantity[]>;
56
+ /**
57
+ * @description
58
+ * Determines which StockLocations should be used to when releasing allocated
59
+ * stock when an OrderLine is cancelled before being fulfilled.
60
+ */
61
+ forRelease(ctx: RequestContext, stockLocations: StockLocation[], orderLine: OrderLine, quantity: number): LocationWithQuantity[] | Promise<LocationWithQuantity[]>;
62
+ /**
63
+ * @description
64
+ * Determines which StockLocations should be used to when creating a Sale
65
+ * and reducing the stockOnHand upon fulfillment.
66
+ */
67
+ forSale(ctx: RequestContext, stockLocations: StockLocation[], orderLine: OrderLine, quantity: number): LocationWithQuantity[] | Promise<LocationWithQuantity[]>;
68
+ /**
69
+ * @description
70
+ * Determines which StockLocations should be used to when creating a Cancellation
71
+ * of an OrderLine which has already been fulfilled.
72
+ */
73
+ forCancellation(ctx: RequestContext, stockLocations: StockLocation[], orderLine: OrderLine, quantity: number): LocationWithQuantity[] | Promise<LocationWithQuantity[]>;
74
+ }
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=custom-fulfillment-process.js.map
3
+ //# sourceMappingURL=stock-location-strategy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stock-location-strategy.js","sourceRoot":"","sources":["../../../src/config/catalog/stock-location-strategy.ts"],"names":[],"mappings":""}
@@ -7,7 +7,12 @@ export declare function resetConfig(): void;
7
7
  * Override the default config by merging in the supplied values. Should only be used prior to
8
8
  * bootstrapping the app.
9
9
  */
10
- export declare function setConfig(userConfig: PartialVendureConfig): void;
10
+ export declare function setConfig(userConfig: PartialVendureConfig): Promise<void>;
11
+ /**
12
+ * Ensures that the config has been loaded. This is necessary for tests which
13
+ * do not go through the normal bootstrap process.
14
+ */
15
+ export declare function ensureConfigLoaded(): Promise<void>;
11
16
  /**
12
17
  * Returns the app config object. In general this function should only be
13
18
  * used before bootstrapping the app. In all other contexts, the {@link ConfigService}
@@ -1,30 +1,58 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getConfig = exports.setConfig = exports.resetConfig = void 0;
4
- const default_config_1 = require("./default-config");
6
+ exports.getConfig = exports.ensureConfigLoaded = exports.setConfig = exports.resetConfig = void 0;
7
+ const path_1 = __importDefault(require("path"));
5
8
  const merge_config_1 = require("./merge-config");
6
- let activeConfig = default_config_1.defaultConfig;
9
+ let activeConfig;
10
+ const defaultConfigPath = path_1.default.join(__dirname, 'default-config');
7
11
  /**
8
12
  * Reset the activeConfig object back to the initial default state.
9
13
  */
10
14
  function resetConfig() {
11
- activeConfig = default_config_1.defaultConfig;
15
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
16
+ activeConfig = require(defaultConfigPath).defaultConfig;
12
17
  }
13
18
  exports.resetConfig = resetConfig;
14
19
  /**
15
20
  * Override the default config by merging in the supplied values. Should only be used prior to
16
21
  * bootstrapping the app.
17
22
  */
18
- function setConfig(userConfig) {
19
- activeConfig = merge_config_1.mergeConfig(activeConfig, userConfig);
23
+ async function setConfig(userConfig) {
24
+ if (!activeConfig) {
25
+ activeConfig = (await import(defaultConfigPath)).defaultConfig;
26
+ }
27
+ activeConfig = (0, merge_config_1.mergeConfig)(activeConfig, userConfig);
20
28
  }
21
29
  exports.setConfig = setConfig;
30
+ /**
31
+ * Ensures that the config has been loaded. This is necessary for tests which
32
+ * do not go through the normal bootstrap process.
33
+ */
34
+ async function ensureConfigLoaded() {
35
+ if (!activeConfig) {
36
+ activeConfig = (await import(defaultConfigPath)).defaultConfig;
37
+ }
38
+ }
39
+ exports.ensureConfigLoaded = ensureConfigLoaded;
22
40
  /**
23
41
  * Returns the app config object. In general this function should only be
24
42
  * used before bootstrapping the app. In all other contexts, the {@link ConfigService}
25
43
  * should be used to access config settings.
26
44
  */
27
45
  function getConfig() {
46
+ if (!activeConfig) {
47
+ try {
48
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
49
+ activeConfig = require(defaultConfigPath).defaultConfig;
50
+ }
51
+ catch (e) {
52
+ // eslint-disable-next-line no-console
53
+ console.log('Error loading config. If this is a test, make sure you have called ensureConfigLoaded() before using the config.');
54
+ }
55
+ }
28
56
  return activeConfig;
29
57
  }
30
58
  exports.getConfig = getConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"config-helpers.js","sourceRoot":"","sources":["../../src/config/config-helpers.ts"],"names":[],"mappings":";;;AAAA,qDAAiD;AACjD,iDAA6C;AAG7C,IAAI,YAAY,GAAG,8BAAa,CAAC;AAEjC;;GAEG;AACH,SAAgB,WAAW;IACvB,YAAY,GAAG,8BAAa,CAAC;AACjC,CAAC;AAFD,kCAEC;AAED;;;GAGG;AACH,SAAgB,SAAS,CAAC,UAAgC;IACtD,YAAY,GAAG,0BAAW,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;AACzD,CAAC;AAFD,8BAEC;AAED;;;;GAIG;AACH,SAAgB,SAAS;IACrB,OAAO,YAAY,CAAC;AACxB,CAAC;AAFD,8BAEC"}
1
+ {"version":3,"file":"config-helpers.js","sourceRoot":"","sources":["../../src/config/config-helpers.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,iDAA6C;AAG7C,IAAI,YAAkC,CAAC;AACvC,MAAM,iBAAiB,GAAG,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;AACjE;;GAEG;AACH,SAAgB,WAAW;IACvB,8DAA8D;IAC9D,YAAY,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC,aAAa,CAAC;AAC5D,CAAC;AAHD,kCAGC;AAED;;;GAGG;AACI,KAAK,UAAU,SAAS,CAAC,UAAgC;IAC5D,IAAI,CAAC,YAAY,EAAE;QACf,YAAY,GAAG,CAAC,MAAM,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC,aAAa,CAAC;KAClE;IACD,YAAY,GAAG,IAAA,0BAAW,EAAC,YAAY,EAAE,UAAU,CAAC,CAAC;AACzD,CAAC;AALD,8BAKC;AAED;;;GAGG;AACI,KAAK,UAAU,kBAAkB;IACpC,IAAI,CAAC,YAAY,EAAE;QACf,YAAY,GAAG,CAAC,MAAM,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC,aAAa,CAAC;KAClE;AACL,CAAC;AAJD,gDAIC;AAED;;;;GAIG;AACH,SAAgB,SAAS;IACrB,IAAI,CAAC,YAAY,EAAE;QACf,IAAI;YACA,8DAA8D;YAC9D,YAAY,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC,aAAa,CAAC;SAC3D;QAAC,OAAO,CAAM,EAAE;YACb,sCAAsC;YACtC,OAAO,CAAC,GAAG,CACP,kHAAkH,CACrH,CAAC;SACL;KACJ;IACD,OAAO,YAAY,CAAC;AACxB,CAAC;AAbD,8BAaC"}