@unchainedshop/api 3.1.8 → 3.1.10

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 (202) hide show
  1. package/lib/errors.d.ts +0 -1
  2. package/lib/errors.d.ts.map +1 -1
  3. package/lib/errors.js +0 -1
  4. package/lib/errors.js.map +1 -1
  5. package/lib/loaders/buildTextMap.d.ts +6 -0
  6. package/lib/loaders/buildTextMap.d.ts.map +1 -0
  7. package/lib/loaders/buildTextMap.js +16 -0
  8. package/lib/loaders/buildTextMap.js.map +1 -0
  9. package/lib/loaders/index.d.ts.map +1 -1
  10. package/lib/loaders/index.js +6 -35
  11. package/lib/loaders/index.js.map +1 -1
  12. package/lib/resolvers/mutations/accounts/changePassword.d.ts +2 -2
  13. package/lib/resolvers/mutations/accounts/changePassword.d.ts.map +1 -1
  14. package/lib/resolvers/mutations/accounts/changePassword.js +0 -6
  15. package/lib/resolvers/mutations/accounts/changePassword.js.map +1 -1
  16. package/lib/resolvers/mutations/accounts/loginWithWebAuthn.js +2 -2
  17. package/lib/resolvers/mutations/accounts/loginWithWebAuthn.js.map +1 -1
  18. package/lib/resolvers/mutations/accounts/resetPassword.d.ts +1 -1
  19. package/lib/resolvers/mutations/accounts/resetPassword.d.ts.map +1 -1
  20. package/lib/resolvers/mutations/accounts/resetPassword.js +0 -3
  21. package/lib/resolvers/mutations/accounts/resetPassword.js.map +1 -1
  22. package/lib/resolvers/mutations/accounts/setPassword.d.ts.map +1 -1
  23. package/lib/resolvers/mutations/accounts/setPassword.js +0 -3
  24. package/lib/resolvers/mutations/accounts/setPassword.js.map +1 -1
  25. package/lib/resolvers/mutations/users/setRoles.d.ts +1 -1
  26. package/lib/resolvers/mutations/users/setRoles.d.ts.map +1 -1
  27. package/lib/resolvers/mutations/users/setRoles.js +1 -1
  28. package/lib/resolvers/mutations/users/setRoles.js.map +1 -1
  29. package/lib/resolvers/mutations/users/setUserTags.d.ts +1 -1
  30. package/lib/resolvers/mutations/users/setUserTags.d.ts.map +1 -1
  31. package/lib/resolvers/mutations/users/setUserTags.js +1 -1
  32. package/lib/resolvers/mutations/users/setUserTags.js.map +1 -1
  33. package/lib/resolvers/type/assortment/assortment-types.d.ts +1 -1
  34. package/lib/resolvers/type/assortment/assortment-types.d.ts.map +1 -1
  35. package/lib/resolvers/type/assortment/assortment-types.js +1 -1
  36. package/lib/resolvers/type/assortment/assortment-types.js.map +1 -1
  37. package/lib/resolvers/type/bookmark-types.d.ts.map +1 -1
  38. package/lib/resolvers/type/bookmark-types.js +1 -0
  39. package/lib/resolvers/type/bookmark-types.js.map +1 -1
  40. package/lib/resolvers/type/country-types.d.ts.map +1 -1
  41. package/lib/resolvers/type/country-types.js +1 -0
  42. package/lib/resolvers/type/country-types.js.map +1 -1
  43. package/lib/resolvers/type/delivery-provider-types.d.ts.map +1 -1
  44. package/lib/resolvers/type/delivery-provider-types.js +1 -0
  45. package/lib/resolvers/type/delivery-provider-types.js.map +1 -1
  46. package/lib/resolvers/type/enrollment/enrollment-delivery-types.d.ts.map +1 -1
  47. package/lib/resolvers/type/enrollment/enrollment-delivery-types.js +1 -0
  48. package/lib/resolvers/type/enrollment/enrollment-delivery-types.js.map +1 -1
  49. package/lib/resolvers/type/enrollment/enrollment-payment-types.d.ts.map +1 -1
  50. package/lib/resolvers/type/enrollment/enrollment-payment-types.js +1 -0
  51. package/lib/resolvers/type/enrollment/enrollment-payment-types.js.map +1 -1
  52. package/lib/resolvers/type/enrollment/enrollment-period-types.d.ts.map +1 -1
  53. package/lib/resolvers/type/enrollment/enrollment-period-types.js +1 -0
  54. package/lib/resolvers/type/enrollment/enrollment-period-types.js.map +1 -1
  55. package/lib/resolvers/type/enrollment/enrollment-types.d.ts.map +1 -1
  56. package/lib/resolvers/type/enrollment/enrollment-types.js +3 -0
  57. package/lib/resolvers/type/enrollment/enrollment-types.js.map +1 -1
  58. package/lib/resolvers/type/index.d.ts +1 -1
  59. package/lib/resolvers/type/index.d.ts.map +1 -1
  60. package/lib/resolvers/type/order/order-delivery-discount-types.d.ts.map +1 -1
  61. package/lib/resolvers/type/order/order-delivery-discount-types.js +1 -0
  62. package/lib/resolvers/type/order/order-delivery-discount-types.js.map +1 -1
  63. package/lib/resolvers/type/order/order-delivery-pickup-types.d.ts.map +1 -1
  64. package/lib/resolvers/type/order/order-delivery-pickup-types.js +3 -0
  65. package/lib/resolvers/type/order/order-delivery-pickup-types.js.map +1 -1
  66. package/lib/resolvers/type/order/order-delivery-shipping-types.d.ts.map +1 -1
  67. package/lib/resolvers/type/order/order-delivery-shipping-types.js +2 -0
  68. package/lib/resolvers/type/order/order-delivery-shipping-types.js.map +1 -1
  69. package/lib/resolvers/type/order/order-delivery-types.d.ts.map +1 -1
  70. package/lib/resolvers/type/order/order-delivery-types.js +1 -0
  71. package/lib/resolvers/type/order/order-delivery-types.js.map +1 -1
  72. package/lib/resolvers/type/order/order-discount-types.d.ts.map +1 -1
  73. package/lib/resolvers/type/order/order-discount-types.js +3 -0
  74. package/lib/resolvers/type/order/order-discount-types.js.map +1 -1
  75. package/lib/resolvers/type/order/order-global-discount-types.d.ts.map +1 -1
  76. package/lib/resolvers/type/order/order-global-discount-types.js +1 -0
  77. package/lib/resolvers/type/order/order-global-discount-types.js.map +1 -1
  78. package/lib/resolvers/type/order/order-item-discount-types.d.ts.map +1 -1
  79. package/lib/resolvers/type/order/order-item-discount-types.js +1 -0
  80. package/lib/resolvers/type/order/order-item-discount-types.js.map +1 -1
  81. package/lib/resolvers/type/order/order-item-types.d.ts.map +1 -1
  82. package/lib/resolvers/type/order/order-item-types.js +8 -0
  83. package/lib/resolvers/type/order/order-item-types.js.map +1 -1
  84. package/lib/resolvers/type/order/order-payment-card-types.d.ts.map +1 -1
  85. package/lib/resolvers/type/order/order-payment-card-types.js +2 -0
  86. package/lib/resolvers/type/order/order-payment-card-types.js.map +1 -1
  87. package/lib/resolvers/type/order/order-payment-discount-types.d.ts.map +1 -1
  88. package/lib/resolvers/type/order/order-payment-discount-types.js +3 -1
  89. package/lib/resolvers/type/order/order-payment-discount-types.js.map +1 -1
  90. package/lib/resolvers/type/order/order-payment-generic-types.d.ts.map +1 -1
  91. package/lib/resolvers/type/order/order-payment-generic-types.js +2 -0
  92. package/lib/resolvers/type/order/order-payment-generic-types.js.map +1 -1
  93. package/lib/resolvers/type/order/order-payment-invoice-types.d.ts.map +1 -1
  94. package/lib/resolvers/type/order/order-payment-invoice-types.js +2 -0
  95. package/lib/resolvers/type/order/order-payment-invoice-types.js.map +1 -1
  96. package/lib/resolvers/type/order/order-payment-types.d.ts.map +1 -1
  97. package/lib/resolvers/type/order/order-payment-types.js +1 -0
  98. package/lib/resolvers/type/order/order-payment-types.js.map +1 -1
  99. package/lib/resolvers/type/order/order-types.d.ts.map +1 -1
  100. package/lib/resolvers/type/order/order-types.js +8 -0
  101. package/lib/resolvers/type/order/order-types.js.map +1 -1
  102. package/lib/resolvers/type/payment/payment-credentials-types.d.ts.map +1 -1
  103. package/lib/resolvers/type/payment/payment-credentials-types.js +3 -0
  104. package/lib/resolvers/type/payment/payment-credentials-types.js.map +1 -1
  105. package/lib/resolvers/type/payment/payment-provider-types.d.ts.map +1 -1
  106. package/lib/resolvers/type/payment/payment-provider-types.js +1 -0
  107. package/lib/resolvers/type/payment/payment-provider-types.js.map +1 -1
  108. package/lib/resolvers/type/product/product-bundle-types.d.ts.map +1 -1
  109. package/lib/resolvers/type/product/product-catalog-price-types.d.ts.map +1 -1
  110. package/lib/resolvers/type/product/product-catalog-price-types.js +2 -0
  111. package/lib/resolvers/type/product/product-catalog-price-types.js.map +1 -1
  112. package/lib/resolvers/type/product/product-configurable-types.d.ts.map +1 -1
  113. package/lib/resolvers/type/product/product-configurable-types.js +1 -0
  114. package/lib/resolvers/type/product/product-configurable-types.js.map +1 -1
  115. package/lib/resolvers/type/product/product-plan-types.d.ts.map +1 -1
  116. package/lib/resolvers/type/product/product-review-types.d.ts.map +1 -1
  117. package/lib/resolvers/type/product/product-review-types.js +1 -0
  118. package/lib/resolvers/type/product/product-review-types.js.map +1 -1
  119. package/lib/resolvers/type/product/product-simple-types.d.ts.map +1 -1
  120. package/lib/resolvers/type/product/product-simple-types.js +2 -0
  121. package/lib/resolvers/type/product/product-simple-types.js.map +1 -1
  122. package/lib/resolvers/type/product/product-tokenized-types.d.ts.map +1 -1
  123. package/lib/resolvers/type/product/product-tokenized-types.js +2 -0
  124. package/lib/resolvers/type/product/product-tokenized-types.js.map +1 -1
  125. package/lib/resolvers/type/product/product-types.d.ts.map +1 -1
  126. package/lib/resolvers/type/product/product-types.js +2 -0
  127. package/lib/resolvers/type/product/product-types.js.map +1 -1
  128. package/lib/resolvers/type/product/product-variation-assignment-vector.d.ts.map +1 -1
  129. package/lib/resolvers/type/product/product-variation-assignment-vector.js +2 -0
  130. package/lib/resolvers/type/product/product-variation-assignment-vector.js.map +1 -1
  131. package/lib/resolvers/type/product/product-variation-option-types.d.ts.map +1 -1
  132. package/lib/resolvers/type/product/product-variation-option-types.js +1 -0
  133. package/lib/resolvers/type/product/product-variation-option-types.js.map +1 -1
  134. package/lib/resolvers/type/product/product-variation-types.d.ts.map +1 -1
  135. package/lib/resolvers/type/product/product-variation-types.js +1 -0
  136. package/lib/resolvers/type/product/product-variation-types.js.map +1 -1
  137. package/lib/resolvers/type/product-search-result-types.d.ts.map +1 -1
  138. package/lib/resolvers/type/quotation-types.d.ts.map +1 -1
  139. package/lib/resolvers/type/quotation-types.js +3 -0
  140. package/lib/resolvers/type/quotation-types.js.map +1 -1
  141. package/lib/resolvers/type/shop-types.d.ts.map +1 -1
  142. package/lib/resolvers/type/shop-types.js +2 -0
  143. package/lib/resolvers/type/shop-types.js.map +1 -1
  144. package/lib/resolvers/type/token-types.d.ts.map +1 -1
  145. package/lib/resolvers/type/token-types.js +7 -0
  146. package/lib/resolvers/type/token-types.js.map +1 -1
  147. package/lib/resolvers/type/user-types.d.ts.map +1 -1
  148. package/lib/resolvers/type/user-types.js +9 -0
  149. package/lib/resolvers/type/user-types.js.map +1 -1
  150. package/lib/resolvers/type/work-types.d.ts.map +1 -1
  151. package/lib/resolvers/type/work-types.js +1 -0
  152. package/lib/resolvers/type/work-types.js.map +1 -1
  153. package/lib/schema/mutation.js +3 -3
  154. package/package.json +1 -1
  155. package/src/errors.ts +0 -5
  156. package/src/loaders/buildTextMap.ts +19 -0
  157. package/src/loaders/index.ts +6 -40
  158. package/src/resolvers/mutations/accounts/changePassword.ts +2 -9
  159. package/src/resolvers/mutations/accounts/loginWithWebAuthn.ts +2 -2
  160. package/src/resolvers/mutations/accounts/resetPassword.ts +1 -5
  161. package/src/resolvers/mutations/accounts/setPassword.ts +1 -3
  162. package/src/resolvers/mutations/users/setRoles.ts +1 -1
  163. package/src/resolvers/mutations/users/setUserTags.ts +1 -1
  164. package/src/resolvers/type/assortment/assortment-types.ts +1 -1
  165. package/src/resolvers/type/bookmark-types.ts +1 -0
  166. package/src/resolvers/type/country-types.ts +1 -0
  167. package/src/resolvers/type/delivery-provider-types.ts +2 -0
  168. package/src/resolvers/type/enrollment/enrollment-delivery-types.ts +1 -0
  169. package/src/resolvers/type/enrollment/enrollment-payment-types.ts +1 -0
  170. package/src/resolvers/type/enrollment/enrollment-period-types.ts +1 -0
  171. package/src/resolvers/type/enrollment/enrollment-types.ts +3 -0
  172. package/src/resolvers/type/order/order-delivery-discount-types.ts +1 -0
  173. package/src/resolvers/type/order/order-delivery-pickup-types.ts +3 -0
  174. package/src/resolvers/type/order/order-delivery-shipping-types.ts +2 -0
  175. package/src/resolvers/type/order/order-delivery-types.ts +1 -0
  176. package/src/resolvers/type/order/order-discount-types.ts +3 -0
  177. package/src/resolvers/type/order/order-global-discount-types.ts +1 -0
  178. package/src/resolvers/type/order/order-item-discount-types.ts +1 -0
  179. package/src/resolvers/type/order/order-item-types.ts +9 -0
  180. package/src/resolvers/type/order/order-payment-card-types.ts +3 -0
  181. package/src/resolvers/type/order/order-payment-discount-types.ts +1 -0
  182. package/src/resolvers/type/order/order-payment-generic-types.ts +2 -0
  183. package/src/resolvers/type/order/order-payment-invoice-types.ts +2 -0
  184. package/src/resolvers/type/order/order-payment-types.ts +1 -0
  185. package/src/resolvers/type/order/order-types.ts +8 -0
  186. package/src/resolvers/type/payment/payment-credentials-types.ts +3 -0
  187. package/src/resolvers/type/payment/payment-provider-types.ts +2 -0
  188. package/src/resolvers/type/product/product-catalog-price-types.ts +2 -0
  189. package/src/resolvers/type/product/product-configurable-types.ts +1 -0
  190. package/src/resolvers/type/product/product-review-types.ts +1 -0
  191. package/src/resolvers/type/product/product-simple-types.ts +2 -0
  192. package/src/resolvers/type/product/product-tokenized-types.ts +2 -0
  193. package/src/resolvers/type/product/product-types.ts +2 -0
  194. package/src/resolvers/type/product/product-variation-assignment-vector.ts +2 -0
  195. package/src/resolvers/type/product/product-variation-option-types.ts +1 -0
  196. package/src/resolvers/type/product/product-variation-types.ts +1 -0
  197. package/src/resolvers/type/quotation-types.ts +3 -0
  198. package/src/resolvers/type/shop-types.ts +2 -0
  199. package/src/resolvers/type/token-types.ts +7 -0
  200. package/src/resolvers/type/user-types.ts +18 -0
  201. package/src/resolvers/type/work-types.ts +2 -0
  202. package/src/schema/mutation.ts +3 -3
@@ -48,6 +48,7 @@ export const User = {
48
48
  },
49
49
  bookmarks: async (user, params, context) => {
50
50
  await checkAction(context, viewUserPrivateInfos, [user, params]);
51
+ // TODO: use loader?
51
52
  return context.modules.bookmarks.findBookmarksByUserId(user._id);
52
53
  },
53
54
  async cart(user, params, context) {
@@ -64,6 +65,7 @@ export const User = {
64
65
  const walletAddresses = user.services?.web3?.flatMap((service) => {
65
66
  return service.verified ? [service.address] : [];
66
67
  }) || [];
68
+ // TODO: use loader?
67
69
  return context.modules.warehousing.findTokensForUser({
68
70
  userId: user._id,
69
71
  walletAddresses,
@@ -72,12 +74,14 @@ export const User = {
72
74
  async country(user, params, context) {
73
75
  await checkAction(context, viewUserPrivateInfos, [user, params]);
74
76
  const userLocale = context.modules.users.userLocale(user);
77
+ // TODO: use loader
75
78
  return context.modules.countries.findCountry({
76
79
  isoCode: userLocale.region?.toUpperCase(),
77
80
  });
78
81
  },
79
82
  async enrollments(user, params, context) {
80
83
  await checkAction(context, viewUserEnrollments, [user, params]);
84
+ // TODO: use loader?
81
85
  return context.modules.enrollments.findEnrollments({
82
86
  ...(params || {}),
83
87
  userId: user._id,
@@ -86,6 +90,7 @@ export const User = {
86
90
  language: async (user, params, context) => {
87
91
  await checkAction(context, viewUserPrivateInfos, [user, params]);
88
92
  const userLocale = context.modules.users.userLocale(user);
93
+ // TODO: use loader
89
94
  return context.modules.languages.findLanguage({
90
95
  isoCode: userLocale.language,
91
96
  });
@@ -97,6 +102,7 @@ export const User = {
97
102
  },
98
103
  orders: async (user, params, context) => {
99
104
  await checkAction(context, viewUserOrders, [user, params]);
105
+ // TODO: use loader?
100
106
  return context.modules.orders.findOrders({
101
107
  ...(params || {}),
102
108
  userId: user._id,
@@ -104,6 +110,7 @@ export const User = {
104
110
  },
105
111
  paymentCredentials: async (user, params, context) => {
106
112
  await checkAction(context, viewUserPrivateInfos, [user, params]);
113
+ // TODO: use loader?
107
114
  return context.modules.payment.paymentCredentials.findPaymentCredentials({ ...params.selector, userId: user._id }, {
108
115
  sort: {
109
116
  created: -1,
@@ -120,6 +127,7 @@ export const User = {
120
127
  },
121
128
  quotations: async (user, params, context) => {
122
129
  await checkAction(context, viewUserQuotations, [user, params]);
130
+ // TODO: use loader?
123
131
  return context.modules.quotations.findQuotations({
124
132
  ...(params || {}),
125
133
  userId: user._id,
@@ -137,6 +145,7 @@ export const User = {
137
145
  async reviews(user, params, context) {
138
146
  const { modules } = context;
139
147
  await checkAction(context, viewUserProductReviews, [user, params]);
148
+ // TODO: use loader?
140
149
  return modules.products.reviews.findProductReviews({
141
150
  ...(params || {}),
142
151
  authorId: user._id,
@@ -1 +1 @@
1
- {"version":3,"file":"user-types.js","sourceRoot":"","sources":["../../../src/resolvers/type/user-types.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,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AM,CAAC,CAAC;IAChC,MAAM,EAAE,UAAU,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC/B,KAAK,EAAE,UAAU,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC9B,KAAK,EAAE,UAAU,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC9B,QAAQ,EAAE,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;CAChD;AAED,eAAO,MAAM,IAAI,EAAE,eA4BlB,CAAC"}
1
+ {"version":3,"file":"work-types.d.ts","sourceRoot":"","sources":["../../../src/resolvers/type/work-types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAG9D,KAAK,UAAU,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,KAAK,CAAC,CAAC;AAE3E,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAClC,IAAI,EAAE,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAChC,MAAM,EAAE,UAAU,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC/B,KAAK,EAAE,UAAU,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC9B,KAAK,EAAE,UAAU,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC9B,QAAQ,EAAE,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;CAChD;AAED,eAAO,MAAM,IAAI,EAAE,eA8BlB,CAAC"}
@@ -13,6 +13,7 @@ export const Work = {
13
13
  original: async (obj, _, { modules }) => {
14
14
  if (!obj.originalWorkId)
15
15
  return null;
16
+ // TODO: use loader
16
17
  return modules.worker.findWork({ workId: obj.originalWorkId });
17
18
  },
18
19
  input: (obj, _, { options }) => {
@@ -1 +1 @@
1
- {"version":3,"file":"work-types.js","sourceRoot":"","sources":["../../../src/resolvers/type/work-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAGrD,OAAO,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AAanE,MAAM,CAAC,MAAM,IAAI,GAAoB;IACnC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAC9B,OAAO,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACpC,CAAC;IAED,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE;QACZ,IAAI,cAAc,CAAC,oBAAoB,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YAC7D,OAAO,GAAG,CAAC,IAAI,CAAC;QAClB,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QACtC,IAAI,CAAC,GAAG,CAAC,cAAc;YAAE,OAAO,IAAI,CAAC;QACrC,OAAO,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,cAAc,EAAE,CAAC,CAAC;IACjE,CAAC;IAED,KAAK,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,OAAO,EAAW,EAAE,EAAE;QACtC,OAAO,2BAA2B,CAAC,OAAO,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACtF,CAAC;IAED,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,OAAO,EAAW,EAAE,EAAE;QACvC,OAAO,2BAA2B,CAA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,EAAE;QACtC,OAAO,2BAA2B,CAAC,OAAO,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACtF,CAAC;IAED,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,OAAO,EAAW,EAAE,EAAE;QACvC,OAAO,2BAA2B,CAAC,OAAO,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACvF,CAAC;IAED,KAAK,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,OAAO,EAAW,EAAE,EAAE;QACtC,OAAO,2BAA2B,CAAC,OAAO,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACtF,CAAC;CACF,CAAC"}
@@ -40,7 +40,7 @@ export default [
40
40
  """
41
41
  Change the current user's password. Must be logged in.
42
42
  """
43
- changePassword(oldPassword: String, newPassword: String): SuccessResponse
43
+ changePassword(oldPassword: String!, newPassword: String!): SuccessResponse
44
44
 
45
45
  """
46
46
  Request a forgot password email.
@@ -50,7 +50,7 @@ export default [
50
50
  """
51
51
  Reset the password for a user using a token received in email. Logs the user in afterwards.
52
52
  """
53
- resetPassword(newPassword: String, token: String!): LoginMethodResponse
53
+ resetPassword(newPassword: String!, token: String!): LoginMethodResponse
54
54
 
55
55
  """
56
56
  Log the user out.
@@ -339,7 +339,7 @@ export default [
339
339
  """
340
340
  Set a new password for a specific user
341
341
  """
342
- setPassword(newPassword: String, userId: ID!): User!
342
+ setPassword(newPassword!: String, userId: ID!): User!
343
343
 
344
344
  """
345
345
  Set roles of a user
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unchainedshop/api",
3
- "version": "3.1.8",
3
+ "version": "3.1.10",
4
4
  "main": "lib/api-index.js",
5
5
  "types": "lib/api-index.d.ts",
6
6
  "type": "module",
package/src/errors.ts CHANGED
@@ -270,11 +270,6 @@ export const ResetPasswordLinkUnknownAddressError = createError(
270
270
  'Valid token but no email address found for the entry',
271
271
  );
272
272
 
273
- export const AuthenticationFailedError = createError(
274
- 'AuthenticationFailed',
275
- 'Failed to authenticate the user',
276
- );
277
-
278
273
  export const UserDeactivatedError = createError(
279
274
  'UserDeactivatedError',
280
275
  'User is deactivated, so not allowed to login',
@@ -0,0 +1,19 @@
1
+ type ArrayElement<T> = T extends (infer U)[] ? U : never;
2
+
3
+ export default function buildTextMap<T extends Array<{ locale?: string }>>(
4
+ localeMap: Record<string, string[]>,
5
+ texts: Readonly<T>,
6
+ buildId: (item: ArrayElement<T>) => string,
7
+ ) {
8
+ const textsMap = {};
9
+ for (const [originLocale, localesForText] of Object.entries(localeMap)) {
10
+ for (const text of texts) {
11
+ if (originLocale !== text.locale) continue;
12
+ for (const locale of localesForText) {
13
+ if (textsMap[locale + buildId(text as any)]) continue;
14
+ textsMap[locale + buildId(text as any)] = text;
15
+ }
16
+ }
17
+ }
18
+ return textsMap;
19
+ }
@@ -12,6 +12,7 @@ import {
12
12
  AssortmentMediaText,
13
13
  } from '@unchainedshop/core-assortments';
14
14
  import { File } from '@unchainedshop/core-files';
15
+ import buildTextMap from './buildTextMap.js';
15
16
 
16
17
  function getLocaleStrings(locale: string) {
17
18
  try {
@@ -76,14 +77,7 @@ const loaders = async (unchainedAPI: UnchainedCore) => {
76
77
  );
77
78
 
78
79
  const localeMap = buildLocaleMap(queries, texts);
79
-
80
- const textsMap = {};
81
- for (const text of texts) {
82
- const localesForText = localeMap[text.locale] || [];
83
- for (const locale of localesForText) {
84
- textsMap[locale + text.assortmentId] = text;
85
- }
86
- }
80
+ const textsMap = buildTextMap(localeMap, texts, (text) => text.assortmentId);
87
81
  return queries.map((q) => textsMap[q.locale + q.assortmentId]);
88
82
  },
89
83
  ),
@@ -104,14 +98,7 @@ const loaders = async (unchainedAPI: UnchainedCore) => {
104
98
  );
105
99
 
106
100
  const localeMap = buildLocaleMap(queries, texts);
107
-
108
- const textsMap = {};
109
- for (const text of texts) {
110
- const localesForText = localeMap[text.locale] || [];
111
- for (const locale of localesForText) {
112
- textsMap[locale + text.assortmentMediaId] = text;
113
- }
114
- }
101
+ const textsMap = buildTextMap(localeMap, texts, (text) => text.assortmentMediaId);
115
102
  return queries.map((q) => textsMap[q.locale + q.assortmentMediaId]);
116
103
  }),
117
104
 
@@ -276,14 +263,7 @@ const loaders = async (unchainedAPI: UnchainedCore) => {
276
263
  );
277
264
 
278
265
  const localeMap = buildLocaleMap(queries, texts);
279
-
280
- const textsMap = {};
281
- for (const text of texts) {
282
- const localesForText = localeMap[text.locale] || [];
283
- for (const locale of localesForText) {
284
- textsMap[locale + text.filterId + text.filterOptionValue] = text;
285
- }
286
- }
266
+ const textsMap = buildTextMap(localeMap, texts, (text) => text.filterId + text.filterOptionValue);
287
267
  return queries.map((q) => textsMap[q.locale + q.filterId + q.filterOptionValue]);
288
268
  }),
289
269
 
@@ -335,14 +315,7 @@ const loaders = async (unchainedAPI: UnchainedCore) => {
335
315
  },
336
316
  );
337
317
  const localeMap = buildLocaleMap(queries, texts);
338
-
339
- const textsMap = {};
340
- for (const text of texts) {
341
- const localesForText = localeMap[text.locale] || [];
342
- for (const locale of localesForText) {
343
- textsMap[locale + text.productId] = text;
344
- }
345
- }
318
+ const textsMap = buildTextMap(localeMap, texts, (text) => text.productId);
346
319
  return queries.map((q) => textsMap[q.locale + q.productId]);
347
320
  },
348
321
  ),
@@ -361,14 +334,7 @@ const loaders = async (unchainedAPI: UnchainedCore) => {
361
334
  );
362
335
 
363
336
  const localeMap = buildLocaleMap(queries, texts);
364
-
365
- const textsMap = {};
366
- for (const text of texts) {
367
- const localesForText = localeMap[text.locale] || [];
368
- for (const locale of localesForText) {
369
- textsMap[locale + text.productMediaId] = text;
370
- }
371
- }
337
+ const textsMap = buildTextMap(localeMap, texts, (text) => text.productMediaId);
372
338
  return queries.map((q) => textsMap[q.locale + q.productMediaId]);
373
339
  },
374
340
  ),
@@ -5,20 +5,13 @@ import { Context } from '../../../context.js';
5
5
  export default async function changePassword(
6
6
  root: never,
7
7
  params: {
8
- oldPassword?: string;
9
- newPassword?: string;
8
+ oldPassword: string;
9
+ newPassword: string;
10
10
  },
11
11
  { modules, userId }: Context,
12
12
  ) {
13
13
  log('mutation changePassword', { userId });
14
14
 
15
- if (!params.newPassword) {
16
- throw new Error('New password is required');
17
- }
18
- if (!params.oldPassword) {
19
- throw new Error('Old password is required');
20
- }
21
-
22
15
  const user = await modules.users.findUserById(userId);
23
16
 
24
17
  const isValidCurrentPassword =
@@ -1,6 +1,6 @@
1
1
  import { log } from '@unchainedshop/logger';
2
2
  import { Context } from '../../../context.js';
3
- import { WebAuthnDisabledError } from '../../../errors.js';
3
+ import { UserNotFoundError, WebAuthnDisabledError } from '../../../errors.js';
4
4
 
5
5
  export default async function loginWithWebAuthn(
6
6
  root: never,
@@ -15,7 +15,7 @@ export default async function loginWithWebAuthn(
15
15
  Buffer.from(params.webAuthnPublicKeyCredentials?.response?.userHandle, 'base64').toString() || '';
16
16
 
17
17
  let user = await context.modules.users.findUserByUsername(username);
18
- if (!user) throw new Error('User not found');
18
+ if (!user) throw new UserNotFoundError({ username });
19
19
 
20
20
  const verification = await context.modules.users.webAuthn.verifyCredentialRequest(
21
21
  user.services?.webAuthn,
@@ -4,17 +4,13 @@ import { Context } from '../../../context.js';
4
4
 
5
5
  export default async function resetPassword(
6
6
  root: never,
7
- params: { newPassword?: string; token: string },
7
+ params: { newPassword: string; token: string },
8
8
  context: Context,
9
9
  ) {
10
10
  const { modules, userId } = context;
11
11
 
12
12
  log('mutation resetPassword', { userId });
13
13
 
14
- if (!params.newPassword) {
15
- throw new Error('Password is required');
16
- }
17
-
18
14
  try {
19
15
  let user = await modules.users.resetPassword(params.token, params.newPassword);
20
16
  if (!user) throw new InvalidResetTokenError({});
@@ -12,9 +12,7 @@ export default async function setPassword(
12
12
  log(`mutation setPassword ${normalizedUserId}`, { userId });
13
13
 
14
14
  if (!normalizedUserId) throw new InvalidIdError({ userId: normalizedUserId });
15
- if (!params.newPassword) {
16
- throw new Error('Password is required');
17
- }
15
+
18
16
  if (!(await modules.users.userExists({ userId: normalizedUserId })))
19
17
  throw new UserNotFoundError({ userId: normalizedUserId });
20
18
 
@@ -2,7 +2,7 @@ import { Context } from '../../../context.js';
2
2
  import { log } from '@unchainedshop/logger';
3
3
  import { InvalidIdError, UserNotFoundError } from '../../../errors.js';
4
4
 
5
- export default async function updateUserProfile(
5
+ export default async function setRoles(
6
6
  root: never,
7
7
  params: { roles: Array<string>; userId: string },
8
8
  { modules, userId }: Context,
@@ -2,7 +2,7 @@ import { Context } from '../../../context.js';
2
2
  import { log } from '@unchainedshop/logger';
3
3
  import { InvalidIdError, UserNotFoundError } from '../../../errors.js';
4
4
 
5
- export default async function updateUserProfile(
5
+ export default async function setUserTags(
6
6
  root: never,
7
7
  params: { tags: Array<string>; userId: string },
8
8
  { modules, userId }: Context,
@@ -50,7 +50,7 @@ export const AssortmentTypes = {
50
50
  });
51
51
  },
52
52
 
53
- filterAssignments: async (obj: Assortment, _, { modules }: Context) => {
53
+ async filterAssignments(obj: Assortment, _, { modules }: Context) {
54
54
  // TODO: Loader & move default sort to module
55
55
  return modules.assortments.filters.findFilters(
56
56
  {
@@ -20,6 +20,7 @@ export const Bookmark: BookmarkHelperTypes = {
20
20
  },
21
21
 
22
22
  user: async (obj, _, { modules }) => {
23
+ // TODO: use loader
23
24
  return modules.users.findUserById(obj.userId);
24
25
  },
25
26
  };
@@ -14,6 +14,7 @@ export interface CountryHelperTypes {
14
14
  export const Country: CountryHelperTypes = {
15
15
  defaultCurrency: async (country, _, { modules }) => {
16
16
  if (country.defaultCurrencyCode) {
17
+ // TODO: use loader
17
18
  return modules.currencies.findCurrency({
18
19
  isoCode: country.defaultCurrencyCode,
19
20
  });
@@ -59,6 +59,8 @@ export const DeliveryProvider: DeliveryProviderHelperTypes = {
59
59
  requestContext,
60
60
  ) {
61
61
  const { modules, countryContext: country, user } = requestContext;
62
+
63
+ // TODO: use loader
62
64
  const order = await modules.orders.findOrder({ orderId });
63
65
  const currency = currencyCode || order?.currency || requestContext.currencyContext;
64
66
  const pricingContext = {
@@ -10,6 +10,7 @@ type EnrollmentDeliveryHelperTypes = {
10
10
 
11
11
  export const EnrollmentDelivery: EnrollmentDeliveryHelperTypes = {
12
12
  provider: async ({ deliveryProviderId }, _, { modules }) => {
13
+ // TODO: use loader
13
14
  return modules.delivery.findProvider({ deliveryProviderId });
14
15
  },
15
16
  };
@@ -10,6 +10,7 @@ type EnrollmentPaymentHelperTypes = {
10
10
 
11
11
  export const EnrollmentPayment: EnrollmentPaymentHelperTypes = {
12
12
  provider: async ({ paymentProviderId }, _, { modules }) => {
13
+ // TODO: use loader
13
14
  return modules.payment.paymentProviders.findProvider({
14
15
  paymentProviderId,
15
16
  });
@@ -10,6 +10,7 @@ type EnrollmentPeriodHelperTypes = {
10
10
 
11
11
  export const EnrollmentPeriod: EnrollmentPeriodHelperTypes = {
12
12
  order: async (period, _, { modules }) => {
13
+ // TODO: use loader
13
14
  return modules.orders.findOrder({ orderId: period.orderId });
14
15
  },
15
16
  };
@@ -27,9 +27,12 @@ export const Enrollment: EnrollmentHelperTypes = {
27
27
  };
28
28
  },
29
29
 
30
+ // TODO: use loader
30
31
  country: (obj, _, { modules }) => modules.countries.findCountry({ isoCode: obj.countryCode }),
31
32
 
33
+ // TODO: use loader
32
34
  currency: (obj, _, { modules }) => modules.currencies.findCurrency({ isoCode: obj.currencyCode }),
33
35
 
36
+ // TODO: use loader
34
37
  user: (obj, _, { modules }) => modules.users.findUserById(obj.userId),
35
38
  };
@@ -7,6 +7,7 @@ export const OrderDeliveryDiscount = {
7
7
  },
8
8
 
9
9
  orderDiscount: async (obj: OrderDeliveryDiscountType, _, { modules }: Context) => {
10
+ // TODO: use loader
10
11
  return modules.orders.discounts.findOrderDiscount({
11
12
  discountId: obj.discountId,
12
13
  });
@@ -17,6 +17,7 @@ export const OrderDeliveryPickUp: OrderDeliveryPickupHelperTypes = {
17
17
  activePickUpLocation: async (orderDelivery, _, requestContext) => {
18
18
  const { orderPickUpLocationId } = orderDelivery.context || {};
19
19
 
20
+ // TODO: use loader
20
21
  const provider = await requestContext.modules.delivery.findProvider({
21
22
  deliveryProviderId: orderDelivery.deliveryProviderId,
22
23
  });
@@ -30,6 +31,7 @@ export const OrderDeliveryPickUp: OrderDeliveryPickupHelperTypes = {
30
31
  },
31
32
 
32
33
  pickUpLocations: async (obj, _, context) => {
34
+ // TODO: use loader
33
35
  const provider = await context.modules.delivery.findProvider({
34
36
  deliveryProviderId: obj.deliveryProviderId,
35
37
  });
@@ -50,6 +52,7 @@ export const OrderDeliveryPickUp: OrderDeliveryPickupHelperTypes = {
50
52
 
51
53
  discounts: async (obj, _, context) => {
52
54
  const { modules } = context;
55
+ // TODO: use loader
53
56
  const order = await modules.orders.findOrder({ orderId: obj.orderId });
54
57
 
55
58
  const pricing = DeliveryPricingSheet({
@@ -23,6 +23,7 @@ export const OrderDeliveryShipping: OrderDeliveryShippingHelperTypes = {
23
23
  },
24
24
 
25
25
  provider: async (obj, _, { modules }) => {
26
+ // TODO: use loader
26
27
  return modules.delivery.findProvider({
27
28
  deliveryProviderId: obj.deliveryProviderId,
28
29
  });
@@ -30,6 +31,7 @@ export const OrderDeliveryShipping: OrderDeliveryShippingHelperTypes = {
30
31
 
31
32
  discounts: async (obj, _, context) => {
32
33
  const { modules } = context;
34
+ // TODO: use loader
33
35
  const order = await modules.orders.findOrder({ orderId: obj.orderId });
34
36
  const pricing = DeliveryPricingSheet({
35
37
  calculation: obj.calculation,
@@ -10,6 +10,7 @@ const OrderDeliveryMap = {
10
10
 
11
11
  export const OrderDelivery = {
12
12
  __resolveType: async (obj: OrderDeliveryType, { modules }: Context) => {
13
+ // TODO: use loader
13
14
  const provider = await modules.delivery.findProvider({
14
15
  deliveryProviderId: obj.deliveryProviderId,
15
16
  });
@@ -37,10 +37,12 @@ export const OrderDiscount: OrderDiscountHelperTypes = {
37
37
  },
38
38
 
39
39
  order: async (obj, _, { modules }) => {
40
+ // TODO: use loader
40
41
  return modules.orders.findOrder({ orderId: obj.orderId });
41
42
  },
42
43
 
43
44
  total: async (obj, _, context) => {
45
+ // TODO: use loader
44
46
  const order = await context.modules.orders.findOrder({
45
47
  orderId: obj.orderId,
46
48
  });
@@ -48,6 +50,7 @@ export const OrderDiscount: OrderDiscountHelperTypes = {
48
50
  },
49
51
 
50
52
  discounted: async (obj, _, context) => {
53
+ // TODO: use loader
51
54
  const order = await context.modules.orders.findOrder({
52
55
  orderId: obj.orderId,
53
56
  });
@@ -20,6 +20,7 @@ export const OrderGlobalDiscount = {
20
20
  _,
21
21
  { modules }: Context,
22
22
  ) => {
23
+ // TODO: use loader
23
24
  return modules.orders.discounts.findOrderDiscount({
24
25
  discountId: obj.discountId,
25
26
  });
@@ -7,6 +7,7 @@ export const OrderItemDiscount = {
7
7
  },
8
8
 
9
9
  orderDiscount: async (obj: OrderPositionDiscount, _, { modules }: Context) => {
10
+ // TODO: use loader
10
11
  return modules.orders.discounts.findOrderDiscount({
11
12
  discountId: obj.discountId,
12
13
  });
@@ -11,6 +11,7 @@ import { ProductPricingSheet } from '@unchainedshop/core';
11
11
  const getPricingSheet = async (orderPosition: OrderPosition, context: Context) => {
12
12
  const { modules } = context;
13
13
 
14
+ // TODO: use loader
14
15
  const order = await modules.orders.findOrder({
15
16
  orderId: orderPosition.orderId,
16
17
  });
@@ -53,12 +54,16 @@ export const OrderItem = {
53
54
  }>
54
55
  > {
55
56
  const scheduling = orderPosition.scheduling || [];
57
+ // TODO: use loader
56
58
  const order = await modules.orders.findOrder({ orderId: orderPosition.orderId });
57
59
  const { countryCode, userId } = order;
58
60
 
61
+ // TODO: use loader
59
62
  const orderDelivery = await modules.orders.deliveries.findDelivery({
60
63
  orderDeliveryId: order.deliveryId,
61
64
  });
65
+
66
+ // TODO: use loader
62
67
  const deliveryProvider = await modules.delivery.findProvider({
63
68
  deliveryProviderId: orderDelivery.deliveryProviderId,
64
69
  });
@@ -68,6 +73,7 @@ export const OrderItem = {
68
73
 
69
74
  return Promise.all(
70
75
  scheduling.map(async (schedule) => {
76
+ // TODO: use loader
71
77
  const warehousingProvider = await modules.warehousing.findProvider({
72
78
  warehousingProviderId: schedule.warehousingProviderId,
73
79
  });
@@ -90,6 +96,7 @@ export const OrderItem = {
90
96
  },
91
97
 
92
98
  async order(orderPosition: OrderPosition, _, { modules }: Context): Promise<Order> {
99
+ // TODO: use loader
93
100
  return modules.orders.findOrder({ orderId: orderPosition.orderId });
94
101
  },
95
102
 
@@ -109,6 +116,7 @@ export const OrderItem = {
109
116
 
110
117
  async quotation(orderPosition: OrderPosition, _, { modules }: Context): Promise<Quotation> {
111
118
  if (!orderPosition.quotationId) return null;
119
+ // TODO: use loader
112
120
  return modules.quotations.findQuotation({ quotationId: orderPosition.quotationId });
113
121
  },
114
122
 
@@ -143,6 +151,7 @@ export const OrderItem = {
143
151
  params: never,
144
152
  { modules }: Context,
145
153
  ): Promise<Array<TokenSurrogate>> {
154
+ // TODO: use loader?
146
155
  return modules.warehousing.findTokens({
147
156
  orderPositionId: orderPosition._id,
148
157
  });
@@ -17,6 +17,7 @@ export const OrderPaymentCard: OrderPaymentCardHelperTypes = {
17
17
  },
18
18
 
19
19
  provider: async (obj, _, { modules }) => {
20
+ // TODO: use loader
20
21
  return modules.payment.paymentProviders.findProvider({
21
22
  paymentProviderId: obj.paymentProviderId,
22
23
  });
@@ -24,6 +25,8 @@ export const OrderPaymentCard: OrderPaymentCardHelperTypes = {
24
25
 
25
26
  discounts: async (obj, _, context) => {
26
27
  const { modules } = context;
28
+
29
+ // TODO: use loader
27
30
  const order = await modules.orders.findOrder({ orderId: obj.orderId });
28
31
  const pricing = PaymentPricingSheet({
29
32
  calculation: obj.calculation,
@@ -11,6 +11,7 @@ export const OrderPaymentDiscount = {
11
11
  _,
12
12
  { modules }: Context,
13
13
  ) =>
14
+ // TODO: use loader
14
15
  modules.orders.discounts.findOrderDiscount({
15
16
  discountId: orderDelivery.discountId,
16
17
  }),