@unchainedshop/api 3.1.13 → 4.0.0-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (726) hide show
  1. package/lib/api-index.d.ts.map +1 -1
  2. package/lib/api-index.js +4 -1
  3. package/lib/api-index.js.map +1 -1
  4. package/lib/context.d.ts +2 -2
  5. package/lib/context.d.ts.map +1 -1
  6. package/lib/context.js +1 -1
  7. package/lib/context.js.map +1 -1
  8. package/lib/createGraphQLServer.d.ts +2 -2
  9. package/lib/createGraphQLServer.d.ts.map +1 -1
  10. package/lib/errors.d.ts +2 -1
  11. package/lib/errors.d.ts.map +1 -1
  12. package/lib/errors.js +2 -1
  13. package/lib/errors.js.map +1 -1
  14. package/lib/express/createBulkImportMiddleware copy.d.ts +6 -0
  15. package/lib/express/createBulkImportMiddleware copy.d.ts.map +1 -0
  16. package/lib/express/createBulkImportMiddleware copy.js +49 -0
  17. package/lib/express/createBulkImportMiddleware copy.js.map +1 -0
  18. package/lib/express/createERCMetadataMiddleware.d.ts.map +1 -1
  19. package/lib/express/createERCMetadataMiddleware.js +9 -5
  20. package/lib/express/createERCMetadataMiddleware.js.map +1 -1
  21. package/lib/express/createMCPMiddleware.d.ts.map +1 -1
  22. package/lib/express/createMCPMiddleware.js +12 -3
  23. package/lib/express/createMCPMiddleware.js.map +1 -1
  24. package/lib/express/createTempUploadMiddleware.d.ts +7 -0
  25. package/lib/express/createTempUploadMiddleware.d.ts.map +1 -0
  26. package/lib/express/createTempUploadMiddleware.js +48 -0
  27. package/lib/express/createTempUploadMiddleware.js.map +1 -0
  28. package/lib/express/index.d.ts.map +1 -1
  29. package/lib/express/index.js +17 -6
  30. package/lib/express/index.js.map +1 -1
  31. package/lib/express/setupMCPChatHandler.d.ts +3 -0
  32. package/lib/express/setupMCPChatHandler.d.ts.map +1 -0
  33. package/lib/express/setupMCPChatHandler.js +57 -0
  34. package/lib/express/setupMCPChatHandler.js.map +1 -0
  35. package/lib/fastify/ercMetadataHandler.d.ts.map +1 -1
  36. package/lib/fastify/ercMetadataHandler.js +9 -5
  37. package/lib/fastify/ercMetadataHandler.js.map +1 -1
  38. package/lib/fastify/index.d.ts.map +1 -1
  39. package/lib/fastify/index.js +24 -5
  40. package/lib/fastify/index.js.map +1 -1
  41. package/lib/fastify/mcpChatHandler.d.ts +3 -0
  42. package/lib/fastify/mcpChatHandler.d.ts.map +1 -0
  43. package/lib/fastify/mcpChatHandler.js +60 -0
  44. package/lib/fastify/mcpChatHandler.js.map +1 -0
  45. package/lib/fastify/mcpHandler copy.d.ts +4 -0
  46. package/lib/fastify/mcpHandler copy.d.ts.map +1 -0
  47. package/lib/fastify/mcpHandler copy.js +72 -0
  48. package/lib/fastify/mcpHandler copy.js.map +1 -0
  49. package/lib/fastify/mcpHandler.d.ts +4 -0
  50. package/lib/fastify/mcpHandler.d.ts.map +1 -0
  51. package/lib/fastify/mcpHandler.js +78 -0
  52. package/lib/fastify/mcpHandler.js.map +1 -0
  53. package/lib/fastify/tempUploadHandler.d.ts +4 -0
  54. package/lib/fastify/tempUploadHandler.d.ts.map +1 -0
  55. package/lib/fastify/tempUploadHandler.js +41 -0
  56. package/lib/fastify/tempUploadHandler.js.map +1 -0
  57. package/lib/loaders/buildLocaleMap.d.ts +4 -4
  58. package/lib/loaders/buildLocaleMap.d.ts.map +1 -1
  59. package/lib/loaders/buildLocaleMap.js +34 -5
  60. package/lib/loaders/buildLocaleMap.js.map +1 -1
  61. package/lib/loaders/buildTextMap.d.ts +2 -2
  62. package/lib/loaders/buildTextMap.d.ts.map +1 -1
  63. package/lib/loaders/buildTextMap.js +3 -0
  64. package/lib/loaders/buildTextMap.js.map +1 -1
  65. package/lib/loaders/index.d.ts +79 -49
  66. package/lib/loaders/index.d.ts.map +1 -1
  67. package/lib/loaders/index.js +47 -240
  68. package/lib/loaders/index.js.map +1 -1
  69. package/lib/locale-context.d.ts +3 -3
  70. package/lib/locale-context.d.ts.map +1 -1
  71. package/lib/locale-context.js +9 -10
  72. package/lib/locale-context.js.map +1 -1
  73. package/lib/mcp/index.d.ts +1 -1
  74. package/lib/mcp/index.d.ts.map +1 -1
  75. package/lib/mcp/index.js +38 -2
  76. package/lib/mcp/index.js.map +1 -1
  77. package/lib/mcp/tools/addProductAssignmentHandler.js.map +1 -1
  78. package/lib/mcp/tools/addProductMediaUploadHandler.d.ts +28 -0
  79. package/lib/mcp/tools/addProductMediaUploadHandler.d.ts.map +1 -0
  80. package/lib/mcp/tools/addProductMediaUploadHandler.js +62 -0
  81. package/lib/mcp/tools/addProductMediaUploadHandler.js.map +1 -0
  82. package/lib/mcp/tools/createLanguageHandler.d.ts +36 -0
  83. package/lib/mcp/tools/createLanguageHandler.d.ts.map +1 -0
  84. package/lib/mcp/tools/createLanguageHandler.js +39 -0
  85. package/lib/mcp/tools/createLanguageHandler.js.map +1 -0
  86. package/lib/mcp/tools/createProductVariationHandler.d.ts +2 -2
  87. package/lib/mcp/tools/createProductVariationHandler.d.ts.map +1 -1
  88. package/lib/mcp/tools/createProductVariationHandler.js +10 -4
  89. package/lib/mcp/tools/createProductVariationHandler.js.map +1 -1
  90. package/lib/mcp/tools/createProductVariationOptionHandler.d.ts +60 -0
  91. package/lib/mcp/tools/createProductVariationOptionHandler.d.ts.map +1 -0
  92. package/lib/mcp/tools/createProductVariationOptionHandler.js +59 -0
  93. package/lib/mcp/tools/createProductVariationOptionHandler.js.map +1 -0
  94. package/lib/mcp/tools/getProduct.d.ts.map +1 -1
  95. package/lib/mcp/tools/getProduct.js +2 -45
  96. package/lib/mcp/tools/getProduct.js.map +1 -1
  97. package/lib/mcp/tools/index.d.ts +33 -0
  98. package/lib/mcp/tools/index.d.ts.map +1 -1
  99. package/lib/mcp/tools/index.js +33 -0
  100. package/lib/mcp/tools/index.js.map +1 -1
  101. package/lib/mcp/tools/listProducts.d.ts.map +1 -1
  102. package/lib/mcp/tools/listProducts.js +29 -17
  103. package/lib/mcp/tools/listProducts.js.map +1 -1
  104. package/lib/mcp/tools/productReviewsCountHandler.d.ts +20 -0
  105. package/lib/mcp/tools/productReviewsCountHandler.d.ts.map +1 -0
  106. package/lib/mcp/tools/productReviewsCountHandler.js +30 -0
  107. package/lib/mcp/tools/productReviewsCountHandler.js.map +1 -0
  108. package/lib/mcp/tools/productReviewsHandler.d.ts +56 -0
  109. package/lib/mcp/tools/productReviewsHandler.d.ts.map +1 -0
  110. package/lib/mcp/tools/productReviewsHandler.js +45 -0
  111. package/lib/mcp/tools/productReviewsHandler.js.map +1 -0
  112. package/lib/mcp/tools/removeLanguageHandler.d.ts +20 -0
  113. package/lib/mcp/tools/removeLanguageHandler.d.ts.map +1 -0
  114. package/lib/mcp/tools/removeLanguageHandler.js +35 -0
  115. package/lib/mcp/tools/removeLanguageHandler.js.map +1 -0
  116. package/lib/mcp/tools/removeProductAssignmentHandler.d.ts +48 -0
  117. package/lib/mcp/tools/removeProductAssignmentHandler.d.ts.map +1 -0
  118. package/lib/mcp/tools/removeProductAssignmentHandler.js +51 -0
  119. package/lib/mcp/tools/removeProductAssignmentHandler.js.map +1 -0
  120. package/lib/mcp/tools/removeProductHandler.d.ts +20 -0
  121. package/lib/mcp/tools/removeProductHandler.d.ts.map +1 -0
  122. package/lib/mcp/tools/removeProductHandler.js +34 -0
  123. package/lib/mcp/tools/removeProductHandler.js.map +1 -0
  124. package/lib/mcp/tools/removeProductMediaHandler.d.ts +20 -0
  125. package/lib/mcp/tools/removeProductMediaHandler.d.ts.map +1 -0
  126. package/lib/mcp/tools/removeProductMediaHandler.js +42 -0
  127. package/lib/mcp/tools/removeProductMediaHandler.js.map +1 -0
  128. package/lib/mcp/tools/removeProductVariationOptionHandler.d.ts +24 -0
  129. package/lib/mcp/tools/removeProductVariationOptionHandler.d.ts.map +1 -0
  130. package/lib/mcp/tools/removeProductVariationOptionHandler.js +47 -0
  131. package/lib/mcp/tools/removeProductVariationOptionHandler.js.map +1 -0
  132. package/lib/mcp/tools/reorderProductMediaHandler.d.ts +44 -0
  133. package/lib/mcp/tools/reorderProductMediaHandler.d.ts.map +1 -0
  134. package/lib/mcp/tools/reorderProductMediaHandler.js +39 -0
  135. package/lib/mcp/tools/reorderProductMediaHandler.js.map +1 -0
  136. package/lib/mcp/tools/updateLanguageHandler.d.ts +48 -0
  137. package/lib/mcp/tools/updateLanguageHandler.d.ts.map +1 -0
  138. package/lib/mcp/tools/updateLanguageHandler.js +40 -0
  139. package/lib/mcp/tools/updateLanguageHandler.js.map +1 -0
  140. package/lib/mcp/tools/updateProductMediaTextsHandler.d.ts +56 -0
  141. package/lib/mcp/tools/updateProductMediaTextsHandler.d.ts.map +1 -0
  142. package/lib/mcp/tools/updateProductMediaTextsHandler.js +45 -0
  143. package/lib/mcp/tools/updateProductMediaTextsHandler.js.map +1 -0
  144. package/lib/mcp/utils/getNormalizedProductDetails.d.ts.map +1 -1
  145. package/lib/mcp/utils/getNormalizedProductDetails.js +2 -0
  146. package/lib/mcp/utils/getNormalizedProductDetails.js.map +1 -1
  147. package/lib/resolvers/mutations/accounts/createUser.d.ts.map +1 -1
  148. package/lib/resolvers/mutations/accounts/createUser.js +4 -5
  149. package/lib/resolvers/mutations/accounts/createUser.js.map +1 -1
  150. package/lib/resolvers/mutations/accounts/impersonate.js +1 -1
  151. package/lib/resolvers/mutations/accounts/impersonate.js.map +1 -1
  152. package/lib/resolvers/mutations/accounts/loginAsGuest.d.ts.map +1 -1
  153. package/lib/resolvers/mutations/accounts/loginAsGuest.js +4 -5
  154. package/lib/resolvers/mutations/accounts/loginAsGuest.js.map +1 -1
  155. package/lib/resolvers/mutations/accounts/loginWithPassword.js +3 -3
  156. package/lib/resolvers/mutations/accounts/loginWithPassword.js.map +1 -1
  157. package/lib/resolvers/mutations/accounts/loginWithWebAuthn.js +3 -3
  158. package/lib/resolvers/mutations/accounts/loginWithWebAuthn.js.map +1 -1
  159. package/lib/resolvers/mutations/accounts/resetPassword.js +3 -3
  160. package/lib/resolvers/mutations/accounts/resetPassword.js.map +1 -1
  161. package/lib/resolvers/mutations/accounts/stopImpersonation.js +1 -1
  162. package/lib/resolvers/mutations/accounts/stopImpersonation.js.map +1 -1
  163. package/lib/resolvers/mutations/accounts/verifyEmail.js +3 -3
  164. package/lib/resolvers/mutations/accounts/verifyEmail.js.map +1 -1
  165. package/lib/resolvers/mutations/assortments/reorderAssortmentFilters.d.ts +2 -2
  166. package/lib/resolvers/mutations/assortments/reorderAssortmentFilters.d.ts.map +1 -1
  167. package/lib/resolvers/mutations/assortments/reorderAssortmentFilters.js.map +1 -1
  168. package/lib/resolvers/mutations/assortments/reorderAssortmentLinks.d.ts +2 -2
  169. package/lib/resolvers/mutations/assortments/reorderAssortmentLinks.d.ts.map +1 -1
  170. package/lib/resolvers/mutations/assortments/reorderAssortmentLinks.js.map +1 -1
  171. package/lib/resolvers/mutations/assortments/reorderAssortmentMedia.d.ts +2 -2
  172. package/lib/resolvers/mutations/assortments/reorderAssortmentMedia.d.ts.map +1 -1
  173. package/lib/resolvers/mutations/assortments/reorderAssortmentMedia.js.map +1 -1
  174. package/lib/resolvers/mutations/assortments/reorderAssortmentProducts.d.ts +2 -2
  175. package/lib/resolvers/mutations/assortments/reorderAssortmentProducts.d.ts.map +1 -1
  176. package/lib/resolvers/mutations/assortments/reorderAssortmentProducts.js.map +1 -1
  177. package/lib/resolvers/mutations/assortments/updateAssortmentMediaTexts.d.ts +1 -1
  178. package/lib/resolvers/mutations/assortments/updateAssortmentMediaTexts.d.ts.map +1 -1
  179. package/lib/resolvers/mutations/assortments/updateAssortmentMediaTexts.js.map +1 -1
  180. package/lib/resolvers/mutations/assortments/updateAssortmentTexts.d.ts +1 -1
  181. package/lib/resolvers/mutations/assortments/updateAssortmentTexts.d.ts.map +1 -1
  182. package/lib/resolvers/mutations/assortments/updateAssortmentTexts.js.map +1 -1
  183. package/lib/resolvers/mutations/enrollments/createEnrollment.js +3 -3
  184. package/lib/resolvers/mutations/enrollments/createEnrollment.js.map +1 -1
  185. package/lib/resolvers/mutations/enrollments/updateEnrollment.d.ts +2 -2
  186. package/lib/resolvers/mutations/enrollments/updateEnrollment.d.ts.map +1 -1
  187. package/lib/resolvers/mutations/filters/createFilter.d.ts.map +1 -1
  188. package/lib/resolvers/mutations/filters/createFilter.js +2 -6
  189. package/lib/resolvers/mutations/filters/createFilter.js.map +1 -1
  190. package/lib/resolvers/mutations/filters/updateFilterTexts.d.ts +2 -2
  191. package/lib/resolvers/mutations/filters/updateFilterTexts.d.ts.map +1 -1
  192. package/lib/resolvers/mutations/orders/addCartDiscount.js +1 -1
  193. package/lib/resolvers/mutations/orders/addCartDiscount.js.map +1 -1
  194. package/lib/resolvers/mutations/orders/addCartProduct.js +1 -1
  195. package/lib/resolvers/mutations/orders/addCartProduct.js.map +1 -1
  196. package/lib/resolvers/mutations/orders/addCartQuotation.d.ts +2 -2
  197. package/lib/resolvers/mutations/orders/addCartQuotation.d.ts.map +1 -1
  198. package/lib/resolvers/mutations/orders/addCartQuotation.js +1 -1
  199. package/lib/resolvers/mutations/orders/addCartQuotation.js.map +1 -1
  200. package/lib/resolvers/mutations/orders/addMultipleCartProducts.d.ts +4 -4
  201. package/lib/resolvers/mutations/orders/addMultipleCartProducts.d.ts.map +1 -1
  202. package/lib/resolvers/mutations/orders/addMultipleCartProducts.js +1 -1
  203. package/lib/resolvers/mutations/orders/addMultipleCartProducts.js.map +1 -1
  204. package/lib/resolvers/mutations/orders/checkoutCart.js +1 -1
  205. package/lib/resolvers/mutations/orders/checkoutCart.js.map +1 -1
  206. package/lib/resolvers/mutations/orders/createCart.js +1 -1
  207. package/lib/resolvers/mutations/orders/createCart.js.map +1 -1
  208. package/lib/resolvers/mutations/orders/emptyCart.js +1 -1
  209. package/lib/resolvers/mutations/orders/emptyCart.js.map +1 -1
  210. package/lib/resolvers/mutations/orders/signPaymentProviderForCheckout.js +1 -1
  211. package/lib/resolvers/mutations/orders/signPaymentProviderForCheckout.js.map +1 -1
  212. package/lib/resolvers/mutations/orders/updateCart.js +1 -1
  213. package/lib/resolvers/mutations/orders/updateCart.js.map +1 -1
  214. package/lib/resolvers/mutations/orders/updateCartItem.d.ts +2 -2
  215. package/lib/resolvers/mutations/orders/updateCartItem.d.ts.map +1 -1
  216. package/lib/resolvers/mutations/products/addProductAssignment.d.ts +1 -1
  217. package/lib/resolvers/mutations/products/addProductAssignment.d.ts.map +1 -1
  218. package/lib/resolvers/mutations/products/addProductAssignment.js +35 -2
  219. package/lib/resolvers/mutations/products/addProductAssignment.js.map +1 -1
  220. package/lib/resolvers/mutations/products/createProductVariation.d.ts +2 -2
  221. package/lib/resolvers/mutations/products/createProductVariation.d.ts.map +1 -1
  222. package/lib/resolvers/mutations/products/createProductVariation.js.map +1 -1
  223. package/lib/resolvers/mutations/products/removeProductAssignment.d.ts +1 -1
  224. package/lib/resolvers/mutations/products/removeProductAssignment.d.ts.map +1 -1
  225. package/lib/resolvers/mutations/products/removeProductAssignment.js.map +1 -1
  226. package/lib/resolvers/mutations/products/reorderProductMedia.d.ts +2 -2
  227. package/lib/resolvers/mutations/products/reorderProductMedia.d.ts.map +1 -1
  228. package/lib/resolvers/mutations/products/reorderProductMedia.js.map +1 -1
  229. package/lib/resolvers/mutations/products/updateProductMediaTexts.d.ts +1 -1
  230. package/lib/resolvers/mutations/products/updateProductMediaTexts.d.ts.map +1 -1
  231. package/lib/resolvers/mutations/products/updateProductMediaTexts.js.map +1 -1
  232. package/lib/resolvers/mutations/products/updateProductVariationTexts.d.ts +1 -1
  233. package/lib/resolvers/mutations/products/updateProductVariationTexts.d.ts.map +1 -1
  234. package/lib/resolvers/mutations/quotations/requestQuotation.d.ts +2 -2
  235. package/lib/resolvers/mutations/quotations/requestQuotation.d.ts.map +1 -1
  236. package/lib/resolvers/mutations/quotations/requestQuotation.js +3 -3
  237. package/lib/resolvers/mutations/quotations/requestQuotation.js.map +1 -1
  238. package/lib/resolvers/mutations/users/heartbeat.d.ts +1 -1
  239. package/lib/resolvers/mutations/users/heartbeat.d.ts.map +1 -1
  240. package/lib/resolvers/mutations/users/heartbeat.js +3 -3
  241. package/lib/resolvers/mutations/users/heartbeat.js.map +1 -1
  242. package/lib/resolvers/mutations/users/setRoles.d.ts +1 -1
  243. package/lib/resolvers/mutations/users/setRoles.d.ts.map +1 -1
  244. package/lib/resolvers/mutations/users/setRoles.js.map +1 -1
  245. package/lib/resolvers/mutations/users/setUserTags.d.ts +1 -1
  246. package/lib/resolvers/mutations/users/setUserTags.d.ts.map +1 -1
  247. package/lib/resolvers/mutations/users/setUserTags.js.map +1 -1
  248. package/lib/resolvers/mutations/warehousing/invalidateToken.js +1 -3
  249. package/lib/resolvers/mutations/warehousing/invalidateToken.js.map +1 -1
  250. package/lib/resolvers/mutations/worker/allocateWork.d.ts +1 -1
  251. package/lib/resolvers/mutations/worker/allocateWork.d.ts.map +1 -1
  252. package/lib/resolvers/mutations/worker/allocateWork.js.map +1 -1
  253. package/lib/resolvers/queries/assortments/assortments.d.ts +1 -1
  254. package/lib/resolvers/queries/assortments/assortments.d.ts.map +1 -1
  255. package/lib/resolvers/queries/countries/countries.d.ts +1 -1
  256. package/lib/resolvers/queries/countries/countries.d.ts.map +1 -1
  257. package/lib/resolvers/queries/countries/countries.js.map +1 -1
  258. package/lib/resolvers/queries/currencies/currencies.d.ts +1 -1
  259. package/lib/resolvers/queries/currencies/currencies.d.ts.map +1 -1
  260. package/lib/resolvers/queries/currencies/currencies.js.map +1 -1
  261. package/lib/resolvers/queries/enrollments/enrollments.d.ts +1 -1
  262. package/lib/resolvers/queries/enrollments/enrollments.d.ts.map +1 -1
  263. package/lib/resolvers/queries/filters/filters.d.ts +1 -1
  264. package/lib/resolvers/queries/filters/filters.d.ts.map +1 -1
  265. package/lib/resolvers/queries/filters/searchAssortments.d.ts.map +1 -1
  266. package/lib/resolvers/queries/filters/searchAssortments.js +2 -7
  267. package/lib/resolvers/queries/filters/searchAssortments.js.map +1 -1
  268. package/lib/resolvers/queries/filters/searchProducts.d.ts.map +1 -1
  269. package/lib/resolvers/queries/filters/searchProducts.js +3 -8
  270. package/lib/resolvers/queries/filters/searchProducts.js.map +1 -1
  271. package/lib/resolvers/queries/languages/languages.d.ts +1 -1
  272. package/lib/resolvers/queries/languages/languages.d.ts.map +1 -1
  273. package/lib/resolvers/queries/languages/languages.js.map +1 -1
  274. package/lib/resolvers/queries/orders/orders.d.ts +1 -1
  275. package/lib/resolvers/queries/orders/orders.d.ts.map +1 -1
  276. package/lib/resolvers/queries/orders/orders.js.map +1 -1
  277. package/lib/resolvers/queries/products/productReviews.d.ts +1 -1
  278. package/lib/resolvers/queries/products/productReviews.d.ts.map +1 -1
  279. package/lib/resolvers/queries/products/products.d.ts +1 -1
  280. package/lib/resolvers/queries/products/products.d.ts.map +1 -1
  281. package/lib/resolvers/queries/quotations/quotations.d.ts +1 -1
  282. package/lib/resolvers/queries/quotations/quotations.d.ts.map +1 -1
  283. package/lib/resolvers/queries/quotations/quotations.js.map +1 -1
  284. package/lib/resolvers/queries/users/impersonator.d.ts.map +1 -1
  285. package/lib/resolvers/queries/users/impersonator.js +1 -1
  286. package/lib/resolvers/queries/users/impersonator.js.map +1 -1
  287. package/lib/resolvers/queries/users/user.d.ts.map +1 -1
  288. package/lib/resolvers/queries/users/user.js.map +1 -1
  289. package/lib/resolvers/queries/users/users.d.ts +1 -1
  290. package/lib/resolvers/queries/users/users.d.ts.map +1 -1
  291. package/lib/resolvers/queries/worker/workQueue.d.ts +3 -3
  292. package/lib/resolvers/queries/worker/workQueue.d.ts.map +1 -1
  293. package/lib/resolvers/type/assortment/assortment-filter-types.d.ts +4 -8
  294. package/lib/resolvers/type/assortment/assortment-filter-types.d.ts.map +1 -1
  295. package/lib/resolvers/type/assortment/assortment-filter-types.js +4 -6
  296. package/lib/resolvers/type/assortment/assortment-filter-types.js.map +1 -1
  297. package/lib/resolvers/type/assortment/assortment-link-types.d.ts +2 -2
  298. package/lib/resolvers/type/assortment/assortment-link-types.d.ts.map +1 -1
  299. package/lib/resolvers/type/assortment/assortment-media-types.js +2 -2
  300. package/lib/resolvers/type/assortment/assortment-media-types.js.map +1 -1
  301. package/lib/resolvers/type/assortment/assortment-path-link-types.d.ts +2 -2
  302. package/lib/resolvers/type/assortment/assortment-path-link-types.d.ts.map +1 -1
  303. package/lib/resolvers/type/assortment/assortment-path-link-types.js +2 -2
  304. package/lib/resolvers/type/assortment/assortment-path-link-types.js.map +1 -1
  305. package/lib/resolvers/type/assortment/assortment-product-types.d.ts +2 -2
  306. package/lib/resolvers/type/assortment/assortment-product-types.d.ts.map +1 -1
  307. package/lib/resolvers/type/assortment/assortment-types.d.ts +2 -2
  308. package/lib/resolvers/type/assortment/assortment-types.d.ts.map +1 -1
  309. package/lib/resolvers/type/assortment/assortment-types.js +5 -5
  310. package/lib/resolvers/type/assortment/assortment-types.js.map +1 -1
  311. package/lib/resolvers/type/bookmark-types.d.ts.map +1 -1
  312. package/lib/resolvers/type/bookmark-types.js +2 -3
  313. package/lib/resolvers/type/bookmark-types.js.map +1 -1
  314. package/lib/resolvers/type/country-types.d.ts +1 -1
  315. package/lib/resolvers/type/country-types.d.ts.map +1 -1
  316. package/lib/resolvers/type/country-types.js +4 -7
  317. package/lib/resolvers/type/country-types.js.map +1 -1
  318. package/lib/resolvers/type/delivery-provider-types.d.ts +10 -13
  319. package/lib/resolvers/type/delivery-provider-types.d.ts.map +1 -1
  320. package/lib/resolvers/type/delivery-provider-types.js +8 -9
  321. package/lib/resolvers/type/delivery-provider-types.js.map +1 -1
  322. package/lib/resolvers/type/enrollment/enrollment-delivery-types.d.ts +2 -6
  323. package/lib/resolvers/type/enrollment/enrollment-delivery-types.d.ts.map +1 -1
  324. package/lib/resolvers/type/enrollment/enrollment-delivery-types.js +4 -3
  325. package/lib/resolvers/type/enrollment/enrollment-delivery-types.js.map +1 -1
  326. package/lib/resolvers/type/enrollment/enrollment-payment-types.d.ts +2 -6
  327. package/lib/resolvers/type/enrollment/enrollment-payment-types.d.ts.map +1 -1
  328. package/lib/resolvers/type/enrollment/enrollment-payment-types.js +2 -3
  329. package/lib/resolvers/type/enrollment/enrollment-payment-types.js.map +1 -1
  330. package/lib/resolvers/type/enrollment/enrollment-period-types.d.ts +2 -6
  331. package/lib/resolvers/type/enrollment/enrollment-period-types.d.ts.map +1 -1
  332. package/lib/resolvers/type/enrollment/enrollment-period-types.js +2 -3
  333. package/lib/resolvers/type/enrollment/enrollment-period-types.js.map +1 -1
  334. package/lib/resolvers/type/enrollment/enrollment-plan-tyes.d.ts +2 -6
  335. package/lib/resolvers/type/enrollment/enrollment-plan-tyes.d.ts.map +1 -1
  336. package/lib/resolvers/type/enrollment/enrollment-plan-tyes.js +2 -3
  337. package/lib/resolvers/type/enrollment/enrollment-plan-tyes.js.map +1 -1
  338. package/lib/resolvers/type/enrollment/enrollment-types.d.ts +15 -14
  339. package/lib/resolvers/type/enrollment/enrollment-types.d.ts.map +1 -1
  340. package/lib/resolvers/type/enrollment/enrollment-types.js +3 -6
  341. package/lib/resolvers/type/enrollment/enrollment-types.js.map +1 -1
  342. package/lib/resolvers/type/filter/filter-option-types.d.ts +6 -9
  343. package/lib/resolvers/type/filter/filter-option-types.d.ts.map +1 -1
  344. package/lib/resolvers/type/filter/filter-option-types.js +2 -3
  345. package/lib/resolvers/type/filter/filter-option-types.js.map +1 -1
  346. package/lib/resolvers/type/filter/filter-types.d.ts +16 -8
  347. package/lib/resolvers/type/filter/filter-types.d.ts.map +1 -1
  348. package/lib/resolvers/type/filter/filter-types.js +2 -3
  349. package/lib/resolvers/type/filter/filter-types.js.map +1 -1
  350. package/lib/resolvers/type/filter/loaded-filter-types.d.ts +2 -3
  351. package/lib/resolvers/type/filter/loaded-filter-types.d.ts.map +1 -1
  352. package/lib/resolvers/type/index.d.ts +273 -261
  353. package/lib/resolvers/type/index.d.ts.map +1 -1
  354. package/lib/resolvers/type/login-method-response-types.js +1 -1
  355. package/lib/resolvers/type/login-method-response-types.js.map +1 -1
  356. package/lib/resolvers/type/order/order-delivery-discount-types.d.ts +1 -1
  357. package/lib/resolvers/type/order/order-delivery-discount-types.d.ts.map +1 -1
  358. package/lib/resolvers/type/order/order-delivery-discount-types.js +1 -2
  359. package/lib/resolvers/type/order/order-delivery-discount-types.js.map +1 -1
  360. package/lib/resolvers/type/order/order-delivery-pickup-types.d.ts +13 -12
  361. package/lib/resolvers/type/order/order-delivery-pickup-types.d.ts.map +1 -1
  362. package/lib/resolvers/type/order/order-delivery-pickup-types.js +10 -14
  363. package/lib/resolvers/type/order/order-delivery-pickup-types.js.map +1 -1
  364. package/lib/resolvers/type/order/order-delivery-shipping-types.d.ts +12 -12
  365. package/lib/resolvers/type/order/order-delivery-shipping-types.d.ts.map +1 -1
  366. package/lib/resolvers/type/order/order-delivery-shipping-types.js +7 -10
  367. package/lib/resolvers/type/order/order-delivery-shipping-types.js.map +1 -1
  368. package/lib/resolvers/type/order/order-delivery-types.d.ts +1 -1
  369. package/lib/resolvers/type/order/order-delivery-types.d.ts.map +1 -1
  370. package/lib/resolvers/type/order/order-delivery-types.js +2 -3
  371. package/lib/resolvers/type/order/order-delivery-types.js.map +1 -1
  372. package/lib/resolvers/type/order/order-discount-types.d.ts +11 -13
  373. package/lib/resolvers/type/order/order-discount-types.d.ts.map +1 -1
  374. package/lib/resolvers/type/order/order-discount-types.js +9 -16
  375. package/lib/resolvers/type/order/order-discount-types.js.map +1 -1
  376. package/lib/resolvers/type/order/order-global-discount-types.d.ts +1 -1
  377. package/lib/resolvers/type/order/order-global-discount-types.d.ts.map +1 -1
  378. package/lib/resolvers/type/order/order-global-discount-types.js +1 -2
  379. package/lib/resolvers/type/order/order-global-discount-types.js.map +1 -1
  380. package/lib/resolvers/type/order/order-item-discount-types.d.ts +1 -1
  381. package/lib/resolvers/type/order/order-item-discount-types.d.ts.map +1 -1
  382. package/lib/resolvers/type/order/order-item-discount-types.js +1 -2
  383. package/lib/resolvers/type/order/order-item-discount-types.js.map +1 -1
  384. package/lib/resolvers/type/order/order-item-types.d.ts +5 -5
  385. package/lib/resolvers/type/order/order-item-types.d.ts.map +1 -1
  386. package/lib/resolvers/type/order/order-item-types.js +14 -17
  387. package/lib/resolvers/type/order/order-item-types.js.map +1 -1
  388. package/lib/resolvers/type/order/order-payment-card-types.d.ts +11 -10
  389. package/lib/resolvers/type/order/order-payment-card-types.d.ts.map +1 -1
  390. package/lib/resolvers/type/order/order-payment-card-types.js +6 -9
  391. package/lib/resolvers/type/order/order-payment-card-types.js.map +1 -1
  392. package/lib/resolvers/type/order/order-payment-discount-types.d.ts +1 -1
  393. package/lib/resolvers/type/order/order-payment-discount-types.d.ts.map +1 -1
  394. package/lib/resolvers/type/order/order-payment-discount-types.js +2 -4
  395. package/lib/resolvers/type/order/order-payment-discount-types.js.map +1 -1
  396. package/lib/resolvers/type/order/order-payment-generic-types.d.ts +11 -10
  397. package/lib/resolvers/type/order/order-payment-generic-types.d.ts.map +1 -1
  398. package/lib/resolvers/type/order/order-payment-generic-types.js +6 -9
  399. package/lib/resolvers/type/order/order-payment-generic-types.js.map +1 -1
  400. package/lib/resolvers/type/order/order-payment-invoice-types.d.ts +11 -10
  401. package/lib/resolvers/type/order/order-payment-invoice-types.d.ts.map +1 -1
  402. package/lib/resolvers/type/order/order-payment-invoice-types.js +6 -9
  403. package/lib/resolvers/type/order/order-payment-invoice-types.js.map +1 -1
  404. package/lib/resolvers/type/order/order-payment-types.d.ts +1 -1
  405. package/lib/resolvers/type/order/order-payment-types.d.ts.map +1 -1
  406. package/lib/resolvers/type/order/order-payment-types.js +2 -3
  407. package/lib/resolvers/type/order/order-payment-types.js.map +1 -1
  408. package/lib/resolvers/type/order/order-types.d.ts +6 -6
  409. package/lib/resolvers/type/order/order-types.d.ts.map +1 -1
  410. package/lib/resolvers/type/order/order-types.js +7 -15
  411. package/lib/resolvers/type/order/order-types.js.map +1 -1
  412. package/lib/resolvers/type/payment/payment-credentials-types.d.ts.map +1 -1
  413. package/lib/resolvers/type/payment/payment-credentials-types.js +6 -9
  414. package/lib/resolvers/type/payment/payment-credentials-types.js.map +1 -1
  415. package/lib/resolvers/type/payment/payment-provider-types.d.ts +2 -2
  416. package/lib/resolvers/type/payment/payment-provider-types.d.ts.map +1 -1
  417. package/lib/resolvers/type/payment/payment-provider-types.js +8 -9
  418. package/lib/resolvers/type/payment/payment-provider-types.js.map +1 -1
  419. package/lib/resolvers/type/price-types.d.ts +3 -4
  420. package/lib/resolvers/type/price-types.d.ts.map +1 -1
  421. package/lib/resolvers/type/price-types.js +2 -2
  422. package/lib/resolvers/type/price-types.js.map +1 -1
  423. package/lib/resolvers/type/product/product-assortment-path-types.d.ts +1 -1
  424. package/lib/resolvers/type/product/product-assortment-path-types.d.ts.map +1 -1
  425. package/lib/resolvers/type/product/product-bundle-types.d.ts +10 -10
  426. package/lib/resolvers/type/product/product-bundle-types.d.ts.map +1 -1
  427. package/lib/resolvers/type/product/product-catalog-price-types.d.ts.map +1 -1
  428. package/lib/resolvers/type/product/product-catalog-price-types.js +4 -6
  429. package/lib/resolvers/type/product/product-catalog-price-types.js.map +1 -1
  430. package/lib/resolvers/type/product/product-configurable-types.d.ts +20 -20
  431. package/lib/resolvers/type/product/product-configurable-types.d.ts.map +1 -1
  432. package/lib/resolvers/type/product/product-configurable-types.js +10 -12
  433. package/lib/resolvers/type/product/product-configurable-types.js.map +1 -1
  434. package/lib/resolvers/type/product/product-discount.d.ts +1 -1
  435. package/lib/resolvers/type/product/product-discount.js +1 -1
  436. package/lib/resolvers/type/product/product-discount.js.map +1 -1
  437. package/lib/resolvers/type/product/product-media-types.js +2 -2
  438. package/lib/resolvers/type/product/product-media-types.js.map +1 -1
  439. package/lib/resolvers/type/product/product-plan-types.d.ts +18 -18
  440. package/lib/resolvers/type/product/product-plan-types.d.ts.map +1 -1
  441. package/lib/resolvers/type/product/product-plan-types.js +16 -16
  442. package/lib/resolvers/type/product/product-plan-types.js.map +1 -1
  443. package/lib/resolvers/type/product/product-review-types.d.ts +1 -1
  444. package/lib/resolvers/type/product/product-review-types.d.ts.map +1 -1
  445. package/lib/resolvers/type/product/product-review-types.js +2 -3
  446. package/lib/resolvers/type/product/product-review-types.js.map +1 -1
  447. package/lib/resolvers/type/product/product-simple-types.d.ts +22 -22
  448. package/lib/resolvers/type/product/product-simple-types.d.ts.map +1 -1
  449. package/lib/resolvers/type/product/product-simple-types.js +3 -11
  450. package/lib/resolvers/type/product/product-simple-types.js.map +1 -1
  451. package/lib/resolvers/type/product/product-tokenized-types.d.ts +20 -20
  452. package/lib/resolvers/type/product/product-tokenized-types.d.ts.map +1 -1
  453. package/lib/resolvers/type/product/product-tokenized-types.js +1 -5
  454. package/lib/resolvers/type/product/product-tokenized-types.js.map +1 -1
  455. package/lib/resolvers/type/product/product-types.d.ts +9 -9
  456. package/lib/resolvers/type/product/product-types.d.ts.map +1 -1
  457. package/lib/resolvers/type/product/product-types.js +2 -5
  458. package/lib/resolvers/type/product/product-types.js.map +1 -1
  459. package/lib/resolvers/type/product/product-variation-assignment-types.d.ts +2 -2
  460. package/lib/resolvers/type/product/product-variation-assignment-types.d.ts.map +1 -1
  461. package/lib/resolvers/type/product/product-variation-assignment-types.js +1 -1
  462. package/lib/resolvers/type/product/product-variation-assignment-types.js.map +1 -1
  463. package/lib/resolvers/type/product/product-variation-assignment-vector.js +2 -2
  464. package/lib/resolvers/type/product/product-variation-assignment-vector.js.map +1 -1
  465. package/lib/resolvers/type/product/product-variation-option-types.js +3 -3
  466. package/lib/resolvers/type/product/product-variation-option-types.js.map +1 -1
  467. package/lib/resolvers/type/product/product-variation-types.d.ts +2 -2
  468. package/lib/resolvers/type/product/product-variation-types.d.ts.map +1 -1
  469. package/lib/resolvers/type/product/product-variation-types.js +3 -3
  470. package/lib/resolvers/type/product/product-variation-types.js.map +1 -1
  471. package/lib/resolvers/type/product-search-result-types.d.ts +5 -6
  472. package/lib/resolvers/type/product-search-result-types.d.ts.map +1 -1
  473. package/lib/resolvers/type/quotation-types.d.ts +8 -15
  474. package/lib/resolvers/type/quotation-types.d.ts.map +1 -1
  475. package/lib/resolvers/type/quotation-types.js +3 -6
  476. package/lib/resolvers/type/quotation-types.js.map +1 -1
  477. package/lib/resolvers/type/shop-types.d.ts +1 -1
  478. package/lib/resolvers/type/shop-types.d.ts.map +1 -1
  479. package/lib/resolvers/type/shop-types.js +4 -6
  480. package/lib/resolvers/type/shop-types.js.map +1 -1
  481. package/lib/resolvers/type/token-types.d.ts +2 -2
  482. package/lib/resolvers/type/token-types.d.ts.map +1 -1
  483. package/lib/resolvers/type/token-types.js +12 -26
  484. package/lib/resolvers/type/token-types.js.map +1 -1
  485. package/lib/resolvers/type/user-types.d.ts +22 -22
  486. package/lib/resolvers/type/user-types.d.ts.map +1 -1
  487. package/lib/resolvers/type/user-types.js +5 -16
  488. package/lib/resolvers/type/user-types.js.map +1 -1
  489. package/lib/resolvers/type/work-types.d.ts.map +1 -1
  490. package/lib/resolvers/type/work-types.js +0 -1
  491. package/lib/resolvers/type/work-types.js.map +1 -1
  492. package/lib/roles/all.js +1 -1
  493. package/lib/roles/all.js.map +1 -1
  494. package/lib/roles/index.d.ts.map +1 -1
  495. package/lib/roles/index.js +1 -0
  496. package/lib/roles/index.js.map +1 -1
  497. package/lib/roles/loggedIn.d.ts.map +1 -1
  498. package/lib/roles/loggedIn.js +1 -0
  499. package/lib/roles/loggedIn.js.map +1 -1
  500. package/lib/schema/types/assortment.js +5 -5
  501. package/lib/schema/types/country.js +1 -1
  502. package/lib/schema/types/delivery.d.ts.map +1 -1
  503. package/lib/schema/types/delivery.js +6 -2
  504. package/lib/schema/types/delivery.js.map +1 -1
  505. package/lib/schema/types/filter.js +3 -3
  506. package/lib/schema/types/payment.d.ts.map +1 -1
  507. package/lib/schema/types/payment.js +6 -2
  508. package/lib/schema/types/payment.js.map +1 -1
  509. package/lib/schema/types/price.js +1 -1
  510. package/lib/schema/types/product/bundle-product.js +1 -1
  511. package/lib/schema/types/product/configurable-product.js +6 -6
  512. package/lib/schema/types/product/plan-product.js +5 -5
  513. package/lib/schema/types/product/product.js +4 -4
  514. package/lib/schema/types/product/simple-product.js +4 -4
  515. package/lib/schema/types/product/tokenized-product.js +5 -5
  516. package/lib/schema/types/warehousing.js +1 -1
  517. package/package.json +32 -16
  518. package/src/api-index.ts +4 -1
  519. package/src/context.ts +3 -3
  520. package/src/createGraphQLServer.ts +2 -2
  521. package/src/errors.ts +10 -4
  522. package/src/express/createERCMetadataMiddleware.ts +11 -5
  523. package/src/express/createMCPMiddleware.ts +91 -0
  524. package/src/express/createTempUploadMiddleware.ts +60 -0
  525. package/src/express/index.ts +37 -9
  526. package/src/fastify/ercMetadataHandler.ts +11 -5
  527. package/src/fastify/index.ts +34 -5
  528. package/src/fastify/mcpHandler.ts +97 -0
  529. package/src/fastify/tempUploadHandler.ts +52 -0
  530. package/src/loaders/assortmentLinkLoader.ts +32 -0
  531. package/src/loaders/assortmentLinksLoader.ts +46 -0
  532. package/src/loaders/assortmentLoader.ts +20 -0
  533. package/src/loaders/assortmentMediaTextLoader.ts +26 -0
  534. package/src/loaders/assortmentMediasLoader.ts +21 -0
  535. package/src/loaders/assortmentProductLoader.ts +19 -0
  536. package/src/loaders/assortmentProductsLoader.ts +22 -0
  537. package/src/loaders/assortmentTextLoader.ts +24 -0
  538. package/src/loaders/buildLocaleMap.test.ts +9 -5
  539. package/src/loaders/buildLocaleMap.ts +43 -9
  540. package/src/loaders/buildTextMap.ts +4 -1
  541. package/src/loaders/countryLoader.ts +20 -0
  542. package/src/loaders/currencyLoader.ts +20 -0
  543. package/src/loaders/deliveryProviderLoader.ts +19 -0
  544. package/src/loaders/fileLoader.ts +19 -0
  545. package/src/loaders/filterLoader.ts +20 -0
  546. package/src/loaders/filterTextLoader.ts +26 -0
  547. package/src/loaders/index.ts +48 -329
  548. package/src/loaders/languageLoader.ts +20 -0
  549. package/src/loaders/orderLoader.ts +22 -0
  550. package/src/loaders/paymentProviderLoader.ts +19 -0
  551. package/src/loaders/productLoader.ts +22 -0
  552. package/src/loaders/productLoaderBySKU.ts +22 -0
  553. package/src/loaders/productMediaTextLoader.ts +24 -0
  554. package/src/loaders/productMediasLoader.ts +21 -0
  555. package/src/loaders/productTextLoader.ts +22 -0
  556. package/src/loaders/userLoader.ts +23 -0
  557. package/src/loaders/utils.ts +35 -0
  558. package/src/locale-context.ts +16 -22
  559. package/src/mcp/README.md +25 -0
  560. package/src/mcp/index.ts +313 -0
  561. package/src/mcp/tools/addProductAssignmentHandler.ts +118 -0
  562. package/src/mcp/tools/addProductMediaUploadHandler.ts +79 -0
  563. package/src/mcp/tools/countriesHandler.ts +60 -0
  564. package/src/mcp/tools/countryHandler.ts +40 -0
  565. package/src/mcp/tools/createLanguageHandler.ts +46 -0
  566. package/src/mcp/tools/createProduct.ts +75 -0
  567. package/src/mcp/tools/createProductVariationHandler.ts +93 -0
  568. package/src/mcp/tools/createProductVariationOptionHandler.ts +73 -0
  569. package/src/mcp/tools/currenciesHandler.ts +63 -0
  570. package/src/mcp/tools/currencyHandler.ts +40 -0
  571. package/src/mcp/tools/getProduct.ts +74 -0
  572. package/src/mcp/tools/index.ts +39 -0
  573. package/src/mcp/tools/languageHandler.ts +37 -0
  574. package/src/mcp/tools/languagesHandler.ts +54 -0
  575. package/src/mcp/tools/listProducts.ts +148 -0
  576. package/src/mcp/tools/productReviewsCountHandler.ts +36 -0
  577. package/src/mcp/tools/productReviewsHandler.ts +54 -0
  578. package/src/mcp/tools/productsCountHandler.ts +38 -0
  579. package/src/mcp/tools/publishProduct.ts +45 -0
  580. package/src/mcp/tools/removeLanguageHandler.ts +42 -0
  581. package/src/mcp/tools/removeProductAssignmentHandler.ts +61 -0
  582. package/src/mcp/tools/removeProductHandler.ts +40 -0
  583. package/src/mcp/tools/removeProductMediaHandler.ts +49 -0
  584. package/src/mcp/tools/removeProductVariationHandler.ts +51 -0
  585. package/src/mcp/tools/removeProductVariationOptionHandler.ts +58 -0
  586. package/src/mcp/tools/reorderProductMediaHandler.ts +48 -0
  587. package/src/mcp/tools/unPublishProduct.ts +46 -0
  588. package/src/mcp/tools/updateLanguageHandler.ts +47 -0
  589. package/src/mcp/tools/updateProduct.ts +51 -0
  590. package/src/mcp/tools/updateProductCommerceHandler.ts +79 -0
  591. package/src/mcp/tools/updateProductMediaTextsHandler.ts +56 -0
  592. package/src/mcp/tools/updateProductPlanHandler.ts +58 -0
  593. package/src/mcp/tools/updateProductSupplyHandler.ts +59 -0
  594. package/src/mcp/tools/updateProductTextsHandler.ts +59 -0
  595. package/src/mcp/tools/updateProductTokenizationHandler.ts +58 -0
  596. package/src/mcp/tools/updateProductWarehousingHandler.ts +54 -0
  597. package/src/mcp/utils/getNormalizedProductDetails.ts +42 -0
  598. package/src/mcp/utils/normalizeMediaUrl.ts +26 -0
  599. package/src/resolvers/mutations/accounts/createUser.ts +4 -6
  600. package/src/resolvers/mutations/accounts/impersonate.ts +1 -1
  601. package/src/resolvers/mutations/accounts/loginAsGuest.ts +4 -6
  602. package/src/resolvers/mutations/accounts/loginWithPassword.ts +3 -3
  603. package/src/resolvers/mutations/accounts/loginWithWebAuthn.ts +3 -3
  604. package/src/resolvers/mutations/accounts/resetPassword.ts +3 -3
  605. package/src/resolvers/mutations/accounts/stopImpersonation.ts +1 -1
  606. package/src/resolvers/mutations/accounts/verifyEmail.ts +3 -3
  607. package/src/resolvers/mutations/assortments/reorderAssortmentFilters.ts +1 -1
  608. package/src/resolvers/mutations/assortments/reorderAssortmentLinks.ts +1 -1
  609. package/src/resolvers/mutations/assortments/reorderAssortmentMedia.ts +1 -1
  610. package/src/resolvers/mutations/assortments/reorderAssortmentProducts.ts +1 -1
  611. package/src/resolvers/mutations/assortments/updateAssortmentMediaTexts.ts +1 -1
  612. package/src/resolvers/mutations/assortments/updateAssortmentTexts.ts +1 -1
  613. package/src/resolvers/mutations/enrollments/createEnrollment.ts +3 -3
  614. package/src/resolvers/mutations/enrollments/updateEnrollment.ts +2 -2
  615. package/src/resolvers/mutations/filters/createFilter.ts +2 -6
  616. package/src/resolvers/mutations/filters/updateFilterTexts.ts +1 -1
  617. package/src/resolvers/mutations/orders/addCartDiscount.ts +1 -1
  618. package/src/resolvers/mutations/orders/addCartProduct.ts +1 -1
  619. package/src/resolvers/mutations/orders/addCartQuotation.ts +2 -2
  620. package/src/resolvers/mutations/orders/addMultipleCartProducts.ts +4 -4
  621. package/src/resolvers/mutations/orders/checkoutCart.ts +1 -1
  622. package/src/resolvers/mutations/orders/createCart.ts +1 -1
  623. package/src/resolvers/mutations/orders/emptyCart.ts +1 -1
  624. package/src/resolvers/mutations/orders/signPaymentProviderForCheckout.ts +1 -1
  625. package/src/resolvers/mutations/orders/updateCart.ts +1 -1
  626. package/src/resolvers/mutations/orders/updateCartItem.ts +1 -1
  627. package/src/resolvers/mutations/products/addProductAssignment.ts +45 -2
  628. package/src/resolvers/mutations/products/createProductVariation.ts +5 -1
  629. package/src/resolvers/mutations/products/removeProductAssignment.ts +1 -1
  630. package/src/resolvers/mutations/products/reorderProductMedia.ts +1 -1
  631. package/src/resolvers/mutations/products/updateProductMediaTexts.ts +1 -1
  632. package/src/resolvers/mutations/products/updateProductVariationTexts.ts +1 -1
  633. package/src/resolvers/mutations/quotations/requestQuotation.ts +4 -4
  634. package/src/resolvers/mutations/users/heartbeat.ts +3 -3
  635. package/src/resolvers/mutations/users/setRoles.ts +1 -1
  636. package/src/resolvers/mutations/users/setUserTags.ts +1 -1
  637. package/src/resolvers/mutations/warehousing/invalidateToken.ts +3 -3
  638. package/src/resolvers/mutations/worker/allocateWork.ts +1 -1
  639. package/src/resolvers/queries/assortments/assortments.ts +1 -1
  640. package/src/resolvers/queries/countries/countries.ts +1 -1
  641. package/src/resolvers/queries/currencies/currencies.ts +1 -1
  642. package/src/resolvers/queries/enrollments/enrollments.ts +1 -1
  643. package/src/resolvers/queries/filters/filters.ts +1 -1
  644. package/src/resolvers/queries/filters/searchAssortments.ts +2 -7
  645. package/src/resolvers/queries/filters/searchProducts.ts +3 -8
  646. package/src/resolvers/queries/languages/languages.ts +1 -1
  647. package/src/resolvers/queries/orders/orders.ts +1 -1
  648. package/src/resolvers/queries/products/productReviews.ts +1 -1
  649. package/src/resolvers/queries/products/products.ts +1 -1
  650. package/src/resolvers/queries/quotations/quotations.ts +1 -1
  651. package/src/resolvers/queries/users/impersonator.ts +2 -1
  652. package/src/resolvers/queries/users/user.ts +1 -0
  653. package/src/resolvers/queries/users/users.ts +1 -1
  654. package/src/resolvers/queries/worker/workQueue.ts +3 -3
  655. package/src/resolvers/type/assortment/assortment-filter-types.ts +6 -16
  656. package/src/resolvers/type/assortment/assortment-link-types.ts +2 -2
  657. package/src/resolvers/type/assortment/assortment-media-types.ts +2 -2
  658. package/src/resolvers/type/assortment/assortment-path-link-types.ts +3 -3
  659. package/src/resolvers/type/assortment/assortment-product-types.ts +2 -2
  660. package/src/resolvers/type/assortment/assortment-types.ts +6 -6
  661. package/src/resolvers/type/bookmark-types.ts +2 -3
  662. package/src/resolvers/type/country-types.ts +5 -8
  663. package/src/resolvers/type/delivery-provider-types.ts +26 -47
  664. package/src/resolvers/type/enrollment/enrollment-delivery-types.ts +5 -11
  665. package/src/resolvers/type/enrollment/enrollment-payment-types.ts +3 -11
  666. package/src/resolvers/type/enrollment/enrollment-period-types.ts +3 -11
  667. package/src/resolvers/type/enrollment/enrollment-plan-tyes.ts +3 -11
  668. package/src/resolvers/type/enrollment/enrollment-types.ts +10 -25
  669. package/src/resolvers/type/filter/filter-option-types.ts +10 -15
  670. package/src/resolvers/type/filter/filter-types.ts +5 -13
  671. package/src/resolvers/type/filter/loaded-filter-types.ts +2 -2
  672. package/src/resolvers/type/login-method-response-types.ts +1 -1
  673. package/src/resolvers/type/order/order-delivery-discount-types.ts +1 -2
  674. package/src/resolvers/type/order/order-delivery-pickup-types.ts +12 -28
  675. package/src/resolvers/type/order/order-delivery-shipping-types.ts +9 -23
  676. package/src/resolvers/type/order/order-delivery-types.ts +2 -3
  677. package/src/resolvers/type/order/order-discount-types.ts +12 -39
  678. package/src/resolvers/type/order/order-global-discount-types.ts +1 -2
  679. package/src/resolvers/type/order/order-item-discount-types.ts +1 -2
  680. package/src/resolvers/type/order/order-item-types.ts +19 -27
  681. package/src/resolvers/type/order/order-payment-card-types.ts +8 -21
  682. package/src/resolvers/type/order/order-payment-discount-types.ts +1 -2
  683. package/src/resolvers/type/order/order-payment-generic-types.ts +8 -20
  684. package/src/resolvers/type/order/order-payment-invoice-types.ts +8 -20
  685. package/src/resolvers/type/order/order-payment-types.ts +2 -3
  686. package/src/resolvers/type/order/order-types.ts +10 -22
  687. package/src/resolvers/type/payment/payment-credentials-types.ts +6 -10
  688. package/src/resolvers/type/payment/payment-provider-types.ts +9 -10
  689. package/src/resolvers/type/price-types.ts +4 -4
  690. package/src/resolvers/type/product/product-assortment-path-types.ts +1 -1
  691. package/src/resolvers/type/product/product-bundle-types.ts +1 -1
  692. package/src/resolvers/type/product/product-catalog-price-types.ts +4 -6
  693. package/src/resolvers/type/product/product-configurable-types.ts +20 -21
  694. package/src/resolvers/type/product/product-discount.ts +1 -1
  695. package/src/resolvers/type/product/product-media-types.ts +2 -2
  696. package/src/resolvers/type/product/product-plan-types.ts +22 -22
  697. package/src/resolvers/type/product/product-review-types.ts +3 -4
  698. package/src/resolvers/type/product/product-simple-types.ts +7 -19
  699. package/src/resolvers/type/product/product-tokenized-types.ts +3 -10
  700. package/src/resolvers/type/product/product-types.ts +10 -13
  701. package/src/resolvers/type/product/product-variation-assignment-types.ts +2 -2
  702. package/src/resolvers/type/product/product-variation-assignment-vector.ts +2 -2
  703. package/src/resolvers/type/product/product-variation-option-types.ts +3 -3
  704. package/src/resolvers/type/product/product-variation-types.ts +5 -5
  705. package/src/resolvers/type/product-search-result-types.ts +5 -5
  706. package/src/resolvers/type/quotation-types.ts +11 -25
  707. package/src/resolvers/type/shop-types.ts +5 -7
  708. package/src/resolvers/type/token-types.ts +15 -32
  709. package/src/resolvers/type/user-types.ts +27 -39
  710. package/src/resolvers/type/work-types.ts +0 -2
  711. package/src/roles/all.ts +1 -1
  712. package/src/roles/index.ts +1 -0
  713. package/src/roles/loggedIn.ts +1 -0
  714. package/src/schema/types/assortment.ts +5 -5
  715. package/src/schema/types/country.ts +1 -1
  716. package/src/schema/types/delivery.ts +6 -2
  717. package/src/schema/types/filter.ts +3 -3
  718. package/src/schema/types/payment.ts +6 -2
  719. package/src/schema/types/price.ts +1 -1
  720. package/src/schema/types/product/bundle-product.ts +1 -1
  721. package/src/schema/types/product/configurable-product.ts +6 -6
  722. package/src/schema/types/product/plan-product.ts +5 -5
  723. package/src/schema/types/product/product.ts +4 -4
  724. package/src/schema/types/product/simple-product.ts +4 -4
  725. package/src/schema/types/product/tokenized-product.ts +5 -5
  726. package/src/schema/types/warehousing.ts +1 -1
@@ -20,12 +20,12 @@ export const ProductVariationOption: ProductVariationOptionHelperTypes = {
20
20
  return obj.productVariationOption;
21
21
  },
22
22
 
23
- texts: async (obj, { forceLocale }, { modules, localeContext }) => {
24
- // TODO: use loader
23
+ texts: async (obj, { forceLocale }, { modules, locale }) => {
24
+ // TODO: use variation text loader
25
25
  return modules.products.variations.texts.findLocalizedVariationText({
26
- locale: forceLocale || localeContext.baseName,
27
26
  productVariationId: obj._id,
28
27
  productVariationOptionValue: obj.productVariationOption,
28
+ locale: forceLocale ? new Intl.Locale(forceLocale) : locale,
29
29
  });
30
30
  },
31
31
  };
@@ -13,10 +13,10 @@ export type HelperType<P, T> = (
13
13
  export interface ProductVariationHelperTypes {
14
14
  options: HelperType<
15
15
  never,
16
- Array<{
16
+ {
17
17
  _id: string;
18
18
  productVariationOption: string;
19
- }>
19
+ }[]
20
20
  >;
21
21
  texts: HelperType<{ forceLocale?: string }, Promise<ProductVariationText>>;
22
22
  }
@@ -28,11 +28,11 @@ export const ProductVariation: ProductVariationHelperTypes = {
28
28
  }));
29
29
  },
30
30
 
31
- texts: async (obj, { forceLocale }, { modules, localeContext }) => {
32
- // TODO: use loader
31
+ texts: async (obj, { forceLocale }, { modules, locale }) => {
32
+ // TODO: use variation text loader
33
33
  return modules.products.variations.texts.findLocalizedVariationText({
34
34
  productVariationId: obj._id,
35
- locale: forceLocale || localeContext.baseName,
35
+ locale: forceLocale ? new Intl.Locale(forceLocale) : locale,
36
36
  });
37
37
  },
38
38
  };
@@ -1,12 +1,12 @@
1
1
  import { Context } from '../../context.js';
2
2
  import { SearchConfiguration } from '@unchainedshop/core-filters';
3
3
 
4
- type SearchResultData = {
4
+ export interface SearchResultData {
5
5
  searchConfiguration: SearchConfiguration & { productSelector: any };
6
- totalProductIds: Array<string>;
7
- aggregatedTotalProductIds: Array<string>;
8
- aggregatedFilteredProductIds: Array<string>;
9
- };
6
+ totalProductIds: string[];
7
+ aggregatedTotalProductIds: string[];
8
+ aggregatedFilteredProductIds: string[];
9
+ }
10
10
 
11
11
  export const ProductSearchResult = {
12
12
  productsCount: async (
@@ -1,40 +1,26 @@
1
1
  import { Quotation as QuotationType } from '@unchainedshop/core-quotations';
2
2
  import { Context } from '../../context.js';
3
- import { User } from '@unchainedshop/core-users';
4
- import { Product } from '@unchainedshop/core-products';
5
- import { Country } from '@unchainedshop/core-countries';
6
- import { Currency } from '@unchainedshop/core-currencies';
7
3
 
8
- type HelperType<P, T> = (quotation: QuotationType, params: P, context: Context) => T;
4
+ export const Quotation = {
5
+ country: async (obj: QuotationType, _: never, { loaders }: Context) =>
6
+ loaders.countryLoader.load({ isoCode: obj.countryCode }),
9
7
 
10
- type QuotationHelperTypes = {
11
- country: HelperType<never, Promise<Country>>;
12
- currency: HelperType<never, Promise<Currency>>;
13
- isExpired: HelperType<{ referenceDate: Date }, boolean>;
14
- status: HelperType<never, string>;
15
- product: HelperType<never, Promise<Product>>;
16
- user: HelperType<never, Promise<User>>;
17
- };
18
-
19
- export const Quotation: QuotationHelperTypes = {
20
- // TODO: use loader
21
- country: async (obj, _, { modules }) => modules.countries.findCountry({ isoCode: obj.countryCode }),
22
-
23
- // TODO: use loader
24
- currency: async (obj, _, { modules }) => modules.currencies.findCurrency({ isoCode: obj.currency }),
8
+ currency: async (obj: QuotationType, _: never, { loaders }: Context) =>
9
+ loaders.currencyLoader.load({ isoCode: obj.currencyCode }),
25
10
 
26
- isExpired: (obj, { referenceDate }, { modules }) =>
11
+ isExpired: (obj: QuotationType, { referenceDate }: { referenceDate: Date }, { modules }: Context) =>
27
12
  modules.quotations.isExpired(obj, { referenceDate }),
28
13
 
29
- product: async (obj, _, { loaders }) => {
14
+ product: async (obj: QuotationType, _: never, { loaders }: Context) => {
30
15
  const product = await loaders.productLoader.load({
31
16
  productId: obj.productId,
32
17
  });
33
18
  return product;
34
19
  },
35
20
 
36
- status: (obj, _, { modules }) => modules.quotations.normalizedStatus(obj),
21
+ status: (obj: QuotationType, _: never, { modules }: Context) =>
22
+ modules.quotations.normalizedStatus(obj),
37
23
 
38
- // TODO: use loader
39
- user: (obj, _, { modules }) => modules.users.findUserById(obj.userId),
24
+ user: async (obj: QuotationType, _: never, { loaders }: Context) =>
25
+ loaders.userLoader.load({ userId: obj.userId }),
40
26
  };
@@ -10,7 +10,7 @@ export interface ShopHelperTypes {
10
10
  _id: () => string;
11
11
  country: HelperType<Country>;
12
12
  language: HelperType<Language>;
13
- userRoles: HelperType<Array<string>>;
13
+ userRoles: HelperType<string[]>;
14
14
  }
15
15
 
16
16
  export const Shop: ShopHelperTypes = {
@@ -18,13 +18,11 @@ export const Shop: ShopHelperTypes = {
18
18
  return 'root';
19
19
  },
20
20
 
21
- language: async (_root, _params, { localeContext, modules }) => {
22
- // TODO: use loader
23
- return modules.languages.findLanguage({ isoCode: localeContext.language });
21
+ language: async (_root, _params, { locale, loaders }) => {
22
+ return loaders.languageLoader.load({ isoCode: locale.language });
24
23
  },
25
- country: async (_root, _params, { countryContext, modules }) => {
26
- // TODO: use loader
27
- return modules.countries.findCountry({ isoCode: countryContext });
24
+ country: async (_root, _params, { countryCode, loaders }) => {
25
+ return loaders.countryLoader.load({ isoCode: countryCode });
28
26
  },
29
27
 
30
28
  userRoles: async (_root, _params, context) => {
@@ -6,22 +6,19 @@ import { actions } from '../../roles/index.js';
6
6
  import { WarehousingDirector } from '@unchainedshop/core';
7
7
 
8
8
  export const Token = {
9
- product: async (token: TokenSurrogate, params: never, { modules }: Context) => {
10
- // TODO: use loader
11
- return modules.products.findProduct({ productId: token.productId });
9
+ product: async (token: TokenSurrogate, params: never, { loaders }: Context) => {
10
+ return loaders.productLoader.load({ productId: token.productId });
12
11
  },
13
12
 
14
- user: async (token: TokenSurrogate, params: never, { modules }: Context) => {
13
+ user: async (token: TokenSurrogate, params: never, { loaders }: Context) => {
15
14
  if (!token.userId) return null;
16
- // TODO: use loader
17
- return modules.users.findUserById(token.userId);
15
+ return loaders.userLoader.load({ userId: token.userId });
18
16
  },
19
17
 
20
18
  status: async (token: TokenSurrogate, params: never, { modules }: Context) => {
21
19
  if (token.walletAddress && !token.userId) {
22
20
  return TokenStatus.DECENTRALIZED;
23
21
  }
24
- // TODO: use loader?
25
22
  const workItems = await modules.worker.findWorkQueue({
26
23
  types: ['EXPORT_TOKEN'],
27
24
  status: [WorkStatus.NEW, WorkStatus.ALLOCATED],
@@ -35,37 +32,23 @@ export const Token = {
35
32
  { forceLocale }: { forceLocale: string },
36
33
  context: Context,
37
34
  ) => {
38
- const { modules } = context;
39
- // TODO: use loader
40
- const product = await modules.products.findProduct({ productId: token.productId });
35
+ const { loaders, services } = context;
36
+ const product = await loaders.productLoader.load({ productId: token.productId });
41
37
 
42
- // TODO: use loader
43
- const virtualProviders = await context.modules.warehousing.findProviders({
44
- type: WarehousingProviderType.VIRTUAL,
38
+ return services.warehousing.ercMetadata({
39
+ product,
40
+ token,
41
+ locale: forceLocale ? new Intl.Locale(forceLocale) : context.locale,
45
42
  });
46
-
47
- return WarehousingDirector.tokenMetadata(
48
- virtualProviders,
49
- {
50
- product,
51
- token,
52
- locale: forceLocale ? new Intl.Locale(forceLocale) : context.localeContext,
53
- quantity: token?.quantity || 1,
54
- referenceDate: new Date(),
55
- },
56
- context,
57
- );
58
43
  },
59
44
 
60
45
  isInvalidateable: async (token: TokenSurrogate, _params: never, context: Context) => {
61
- const { modules } = context;
62
- // TODO: use loader
63
- const product = await modules.products.findProduct({ productId: token.productId });
46
+ const { loaders } = context;
47
+ const product = await loaders.productLoader.load({ productId: token.productId });
64
48
 
65
- // TODO: use loader
66
- const virtualProviders = await context.modules.warehousing.findProviders({
67
- type: WarehousingProviderType.VIRTUAL,
68
- });
49
+ const virtualProviders = (await context.modules.warehousing.allProviders()).filter(
50
+ ({ type }) => type === WarehousingProviderType.VIRTUAL,
51
+ );
69
52
 
70
53
  const isInvalidateable = await WarehousingDirector.isInvalidateable(
71
54
  virtualProviders,
@@ -44,62 +44,62 @@ export interface UserHelperTypes {
44
44
  created: HelperType<any, Date>;
45
45
  updated: HelperType<any, Date>;
46
46
  deleted: HelperType<any, Date>;
47
- avatar: HelperType<{ localeContext: Intl.Locale }, File>;
48
- bookmarks: HelperType<any, Array<Bookmark>>;
47
+ avatar: HelperType<{ locale: Intl.Locale }, File>;
48
+ bookmarks: HelperType<any, Bookmark[]>;
49
49
  cart: HelperType<{ orderNumber?: string }, Order>;
50
- country: HelperType<{ localeContext: Intl.Locale }, Country>;
51
- emails: HelperType<any, Array<string>>;
50
+ country: HelperType<{ locale: Intl.Locale }, Country>;
51
+ emails: HelperType<any, string[]>;
52
52
  enrollments: HelperType<
53
53
  {
54
- sort?: Array<SortOption>;
54
+ sort?: SortOption[];
55
55
  queryString?: string;
56
56
  limit?: number;
57
57
  offset?: number;
58
- status?: Array<EnrollmentStatus>;
58
+ status?: EnrollmentStatus[];
59
59
  },
60
- Array<Enrollment>
60
+ Enrollment[]
61
61
  >;
62
62
  isGuest: HelperType<any, boolean>;
63
63
  isInitialPassword: HelperType<any, boolean>;
64
- language: HelperType<{ localeContext: Intl.Locale }, Language>;
64
+ language: HelperType<{ locale: Intl.Locale }, Language>;
65
65
  lastBillingAddress: HelperType<any, UserType['lastBillingAddress']>;
66
66
  lastContact: HelperType<any, Contact>;
67
67
  lastLogin: HelperType<any, UserType['lastLogin']>;
68
- allowedActions: HelperType<any, Array<string>>;
68
+ allowedActions: HelperType<any, string[]>;
69
69
  name: HelperType<any, string>;
70
70
  orders: HelperType<
71
71
  {
72
72
  includeCarts: boolean;
73
- sort?: Array<SortOption>;
73
+ sort?: SortOption[];
74
74
  queryString?: string;
75
75
  status?: OrderStatus[];
76
76
  userId?: string;
77
77
  limit?: number;
78
78
  offset?: number;
79
79
  },
80
- Array<Order>
80
+ Order[]
81
81
  >;
82
- paymentCredentials: HelperType<any, Array<PaymentCredentials>>;
83
- tokens: HelperType<any, Array<TokenSurrogate>>;
84
- webAuthnCredentials: HelperType<any, Array<WebAuthnCredentials>>;
85
- web3Addresses: HelperType<any, Array<Web3Address>>;
82
+ paymentCredentials: HelperType<any, PaymentCredentials[]>;
83
+ tokens: HelperType<any, TokenSurrogate[]>;
84
+ webAuthnCredentials: HelperType<any, WebAuthnCredentials[]>;
85
+ web3Addresses: HelperType<any, Web3Address[]>;
86
86
  primaryEmail: HelperType<any, Email>;
87
87
  profile: HelperType<any, UserProfile>;
88
88
  quotations: HelperType<
89
- { sort?: Array<SortOption>; queryString?: string; userId?: string; limit?: number; offset?: number },
90
- Array<Quotation>
89
+ { sort?: SortOption[]; queryString?: string; userId?: string; limit?: number; offset?: number },
90
+ Quotation[]
91
91
  >;
92
- roles: HelperType<any, Array<string>>;
93
- tags: HelperType<any, Array<string>>;
92
+ roles: HelperType<any, string[]>;
93
+ tags: HelperType<any, string[]>;
94
94
  username: HelperType<any, string>;
95
- pushSubscriptions: HelperType<any, Array<PushSubscription>>;
95
+ pushSubscriptions: HelperType<any, PushSubscription[]>;
96
96
  reviews: HelperType<
97
97
  {
98
- sort?: Array<SortOption>;
98
+ sort?: SortOption[];
99
99
  limit?: number;
100
100
  offset?: number;
101
101
  },
102
- Array<ProductReview>
102
+ ProductReview[]
103
103
  >;
104
104
  reviewsCount: HelperType<any, number>;
105
105
  }
@@ -170,15 +170,14 @@ export const User: UserHelperTypes = {
170
170
  bookmarks: async (user, params, context) => {
171
171
  await checkAction(context, viewUserPrivateInfos, [user, params]);
172
172
 
173
- // TODO: use loader?
174
173
  return context.modules.bookmarks.findBookmarksByUserId(user._id);
175
174
  },
176
175
 
177
176
  async cart(user, params, context) {
178
- const { modules, countryContext } = context;
177
+ const { modules, countryCode } = context;
179
178
  await checkAction(context, viewUserOrders, [user, params]);
180
179
  return modules.orders.cart({
181
- countryCode: countryContext,
180
+ countryCode,
182
181
  orderNumber: params.orderNumber,
183
182
  userId: user._id,
184
183
  });
@@ -191,7 +190,6 @@ export const User: UserHelperTypes = {
191
190
  return service.verified ? [service.address] : [];
192
191
  }) || [];
193
192
 
194
- // TODO: use loader?
195
193
  return context.modules.warehousing.findTokensForUser({
196
194
  userId: user._id,
197
195
  walletAddresses,
@@ -202,16 +200,14 @@ export const User: UserHelperTypes = {
202
200
  await checkAction(context, viewUserPrivateInfos, [user, params]);
203
201
  const userLocale = context.modules.users.userLocale(user);
204
202
 
205
- // TODO: use loader
206
- return context.modules.countries.findCountry({
207
- isoCode: userLocale.region?.toUpperCase(),
203
+ return context.loaders.countryLoader.load({
204
+ isoCode: userLocale.region,
208
205
  });
209
206
  },
210
207
 
211
208
  async enrollments(user, params, context) {
212
209
  await checkAction(context, viewUserEnrollments, [user, params]);
213
210
 
214
- // TODO: use loader?
215
211
  return context.modules.enrollments.findEnrollments({
216
212
  ...(params || {}),
217
213
  userId: user._id,
@@ -221,11 +217,7 @@ export const User: UserHelperTypes = {
221
217
  language: async (user, params, context) => {
222
218
  await checkAction(context, viewUserPrivateInfos, [user, params]);
223
219
  const userLocale = context.modules.users.userLocale(user);
224
-
225
- // TODO: use loader
226
- return context.modules.languages.findLanguage({
227
- isoCode: userLocale.language,
228
- });
220
+ return context.loaders.languageLoader.load({ isoCode: userLocale.language });
229
221
  },
230
222
 
231
223
  allowedActions: async (user, params, context) => {
@@ -238,7 +230,6 @@ export const User: UserHelperTypes = {
238
230
  orders: async (user, params, context) => {
239
231
  await checkAction(context, viewUserOrders, [user, params]);
240
232
 
241
- // TODO: use loader?
242
233
  return context.modules.orders.findOrders({
243
234
  ...(params || {}),
244
235
  userId: user._id,
@@ -248,7 +239,6 @@ export const User: UserHelperTypes = {
248
239
  paymentCredentials: async (user, params, context) => {
249
240
  await checkAction(context, viewUserPrivateInfos, [user, params]);
250
241
 
251
- // TODO: use loader?
252
242
  return context.modules.payment.paymentCredentials.findPaymentCredentials(
253
243
  { ...params.selector, userId: user._id },
254
244
  {
@@ -271,7 +261,6 @@ export const User: UserHelperTypes = {
271
261
  quotations: async (user, params, context) => {
272
262
  await checkAction(context, viewUserQuotations, [user, params]);
273
263
 
274
- // TODO: use loader?
275
264
  return context.modules.quotations.findQuotations({
276
265
  ...(params || {}),
277
266
  userId: user._id,
@@ -290,7 +279,6 @@ export const User: UserHelperTypes = {
290
279
  const { modules } = context;
291
280
  await checkAction(context, viewUserProductReviews, [user, params]);
292
281
 
293
- // TODO: use loader?
294
282
  return modules.products.reviews.findProductReviews({
295
283
  ...(params || {}),
296
284
  authorId: user._id,
@@ -28,8 +28,6 @@ export const Work: WorkHelperTypes = {
28
28
 
29
29
  original: async (obj, _, { modules }) => {
30
30
  if (!obj.originalWorkId) return null;
31
-
32
- // TODO: use loader
33
31
  return modules.worker.findWork({ workId: obj.originalWorkId });
34
32
  },
35
33
 
package/src/roles/all.ts CHANGED
@@ -2,7 +2,6 @@ import { Context } from '../context.js';
2
2
 
3
3
  export const all = (role, actions) => {
4
4
  const isInLoginMutationResponse = (root) => {
5
- // eslint-disable-next-line
6
5
  if (root && root._inLoginMethodResponse) {
7
6
  return true;
8
7
  }
@@ -102,6 +101,7 @@ export const all = (role, actions) => {
102
101
  role.allow(actions.viewTokens, () => false);
103
102
  role.allow(actions.viewStatistics, () => false);
104
103
  role.allow(actions.uploadUserAvatar, () => false);
104
+ role.allow(actions.uploadTempFile, () => false);
105
105
  role.allow(actions.impersonate, () => false);
106
106
 
107
107
  // special case: when doing a login mutation, the user is not logged in technically yet,
@@ -118,6 +118,7 @@ const actions: Record<string, string> = [
118
118
  'removeUser',
119
119
  'downloadFile',
120
120
  'uploadUserAvatar',
121
+ 'uploadTempFile',
121
122
  ].reduce((oldValue, actionValue) => {
122
123
  const newValue = oldValue;
123
124
  newValue[actionValue] = actionValue;
@@ -248,4 +248,5 @@ export const loggedIn = (role: any, actions: Record<string, string>) => {
248
248
  role.allow(actions.confirmMediaUpload, () => true);
249
249
  role.allow(actions.downloadFile, isFileAccessible);
250
250
  role.allow(actions.uploadUserAvatar, canUpdateAvatar);
251
+ role.allow(actions.uploadTempFile, canUpdateAvatar);
251
252
  };
@@ -2,7 +2,7 @@ export default [
2
2
  /* GraphQL */ `
3
3
  type AssortmentMediaTexts @cacheControl(maxAge: 180) {
4
4
  _id: ID!
5
- locale: Locale
5
+ locale: Locale!
6
6
  title: String
7
7
  subtitle: String
8
8
  }
@@ -12,7 +12,7 @@ export default [
12
12
  tags: [LowerCaseString!]
13
13
  file: Media
14
14
  sortKey: Int!
15
- texts(forceLocale: String): AssortmentMediaTexts
15
+ texts(forceLocale: Locale): AssortmentMediaTexts
16
16
  }
17
17
 
18
18
  """
@@ -29,7 +29,7 @@ export default [
29
29
  sequence: Int!
30
30
  tags: [LowerCaseString!]
31
31
  media(limit: Int = 10, offset: Int = 0, tags: [LowerCaseString!]): [AssortmentMedia!]!
32
- texts(forceLocale: String): AssortmentTexts
32
+ texts(forceLocale: Locale): AssortmentTexts
33
33
  productAssignments: [AssortmentProduct!]
34
34
  filterAssignments: [AssortmentFilter!]
35
35
  linkedAssortments: [AssortmentLink!]
@@ -59,7 +59,7 @@ export default [
59
59
  """
60
60
  type AssortmentPathLink @cacheControl(maxAge: 180) {
61
61
  assortmentId: ID!
62
- assortmentTexts(forceLocale: String): AssortmentTexts!
62
+ assortmentTexts(forceLocale: Locale): AssortmentTexts!
63
63
  link: AssortmentLink
64
64
  }
65
65
 
@@ -89,7 +89,7 @@ export default [
89
89
 
90
90
  type AssortmentTexts @cacheControl(maxAge: 180) {
91
91
  _id: ID!
92
- locale: Locale
92
+ locale: Locale!
93
93
  slug: String
94
94
  title: String
95
95
  subtitle: String
@@ -10,7 +10,7 @@ export default [
10
10
  isBase: Boolean
11
11
  defaultCurrency: Currency
12
12
  flagEmoji: String
13
- name(forceLocale: String): String
13
+ name(forceLocale: Locale): String
14
14
  }
15
15
  `,
16
16
  ];
@@ -35,8 +35,12 @@ export default [
35
35
  configuration: JSON
36
36
  configurationError: DeliveryProviderError
37
37
  isActive: Boolean
38
- simulatedPrice(currency: String, useNetPrice: Boolean = false, orderId: ID, context: JSON): Price
39
- @cacheControl(scope: PRIVATE, maxAge: 10)
38
+ simulatedPrice(
39
+ currencyCode: String
40
+ useNetPrice: Boolean = false
41
+ orderId: ID
42
+ context: JSON
43
+ ): Price @cacheControl(scope: PRIVATE, maxAge: 10)
40
44
  }
41
45
  `,
42
46
  ];
@@ -24,14 +24,14 @@ export default [
24
24
 
25
25
  type FilterTexts @cacheControl(maxAge: 180) {
26
26
  _id: ID!
27
- locale: Locale
27
+ locale: Locale!
28
28
  title: String
29
29
  subtitle: String
30
30
  }
31
31
 
32
32
  type FilterOption @cacheControl(maxAge: 180) {
33
33
  _id: ID!
34
- texts(forceLocale: String): FilterTexts
34
+ texts(forceLocale: Locale): FilterTexts
35
35
  value: String
36
36
  }
37
37
 
@@ -40,7 +40,7 @@ export default [
40
40
  updated: DateTime
41
41
  created: DateTime
42
42
  isActive: Boolean
43
- texts(forceLocale: String): FilterTexts
43
+ texts(forceLocale: Locale): FilterTexts
44
44
  type: FilterType
45
45
  key: String
46
46
  options: [FilterOption!]
@@ -50,8 +50,12 @@ export default [
50
50
  configuration: JSON
51
51
  configurationError: PaymentProviderError
52
52
  isActive: Boolean
53
- simulatedPrice(currency: String, useNetPrice: Boolean = false, orderId: ID, context: JSON): Price
54
- @cacheControl(scope: PRIVATE, maxAge: 10)
53
+ simulatedPrice(
54
+ currencyCode: String
55
+ useNetPrice: Boolean = false
56
+ orderId: ID
57
+ context: JSON
58
+ ): Price @cacheControl(scope: PRIVATE, maxAge: 10)
55
59
  }
56
60
  `,
57
61
  ];
@@ -4,7 +4,7 @@ export default [
4
4
  isTaxable: Boolean!
5
5
  isNetPrice: Boolean!
6
6
  amount: Int!
7
- currency: String!
7
+ currencyCode: String!
8
8
  }
9
9
 
10
10
  type PriceRange @cacheControl(maxAge: 60) {
@@ -12,7 +12,7 @@ export default [
12
12
  updated: DateTime
13
13
  published: DateTime
14
14
  media(limit: Int = 10, offset: Int = 0, tags: [LowerCaseString!]): [ProductMedia!]!
15
- texts(forceLocale: String): ProductTexts
15
+ texts(forceLocale: Locale): ProductTexts
16
16
  bundleItems: [ProductBundleItem!]
17
17
  reviews(
18
18
  limit: Int = 10
@@ -14,20 +14,20 @@ export default [
14
14
 
15
15
  type ProductVariationTexts @cacheControl(maxAge: 180) {
16
16
  _id: ID!
17
- locale: Locale
17
+ locale: Locale!
18
18
  title: String
19
19
  subtitle: String
20
20
  }
21
21
 
22
22
  type ProductVariationOption @cacheControl(maxAge: 180) {
23
23
  _id: ID!
24
- texts(forceLocale: String): ProductVariationTexts
24
+ texts(forceLocale: Locale): ProductVariationTexts
25
25
  value: String
26
26
  }
27
27
 
28
28
  type ProductVariation @cacheControl(maxAge: 180) {
29
29
  _id: ID!
30
- texts(forceLocale: String): ProductVariationTexts
30
+ texts(forceLocale: Locale): ProductVariationTexts
31
31
  type: ProductVariationType
32
32
  key: String
33
33
  options: [ProductVariationOption!]
@@ -71,7 +71,7 @@ export default [
71
71
  updated: DateTime
72
72
  published: DateTime
73
73
  media(limit: Int = 10, offset: Int = 0, tags: [LowerCaseString!]): [ProductMedia!]!
74
- texts(forceLocale: String): ProductTexts
74
+ texts(forceLocale: Locale): ProductTexts
75
75
  assortmentPaths: [ProductAssortmentPath!]!
76
76
  siblings(
77
77
  assortmentId: ID
@@ -90,13 +90,13 @@ export default [
90
90
  quantity: Int = 0
91
91
  vectors: [ProductAssignmentVectorInput!]
92
92
  includeInactive: Boolean = false
93
- currency: String
93
+ currencyCode: String
94
94
  ): PriceRange
95
95
  simulatedPriceRange(
96
96
  quantity: Int
97
97
  vectors: [ProductAssignmentVectorInput!]
98
98
  includeInactive: Boolean = false
99
- currency: String
99
+ currencyCode: String
100
100
  useNetPrice: Boolean = false
101
101
  ): PriceRange @cacheControl(scope: PRIVATE)
102
102
 
@@ -41,16 +41,16 @@ export default [
41
41
  updated: DateTime
42
42
  published: DateTime
43
43
  media(limit: Int = 10, offset: Int = 0, tags: [LowerCaseString!]): [ProductMedia!]!
44
- texts(forceLocale: String): ProductTexts
45
- catalogPrice(quantity: Int = 1, currency: String): Price
46
- leveledCatalogPrices(currency: String): [PriceLevel!]!
44
+ texts(forceLocale: Locale): ProductTexts
45
+ catalogPrice(quantity: Int = 1, currencyCode: String): Price
46
+ leveledCatalogPrices(currencyCode: String): [PriceLevel!]!
47
47
  simulatedPrice(
48
- currency: String
48
+ currencyCode: String
49
49
  useNetPrice: Boolean = false
50
50
  quantity: Int = 1
51
51
  configuration: [ProductConfigurationParameterInput!]
52
52
  ): Price @cacheControl(scope: PRIVATE)
53
- assortmentPaths(forceLocale: String): [ProductAssortmentPath!]!
53
+ assortmentPaths(forceLocale: Locale): [ProductAssortmentPath!]!
54
54
  siblings(
55
55
  assortmentId: ID
56
56
  limit: Int = 10