@unchainedshop/api 3.1.7 → 3.1.9

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 (264) hide show
  1. package/lib/express/index.d.ts.map +1 -1
  2. package/lib/express/index.js +1 -0
  3. package/lib/express/index.js.map +1 -1
  4. package/lib/loaders/assortmentLinkLoader.d.ts +12 -0
  5. package/lib/loaders/assortmentLinkLoader.d.ts.map +1 -0
  6. package/lib/loaders/assortmentLinkLoader.js +23 -0
  7. package/lib/loaders/assortmentLinkLoader.js.map +1 -0
  8. package/lib/loaders/assortmentLinksLoader.d.ts +14 -0
  9. package/lib/loaders/assortmentLinksLoader.d.ts.map +1 -0
  10. package/lib/loaders/assortmentLinksLoader.js +38 -0
  11. package/lib/loaders/assortmentLinksLoader.js.map +1 -0
  12. package/lib/loaders/assortmentLoader.d.ts +10 -0
  13. package/lib/loaders/assortmentLoader.d.ts.map +1 -0
  14. package/lib/loaders/assortmentLoader.js +15 -0
  15. package/lib/loaders/assortmentLoader.js.map +1 -0
  16. package/lib/loaders/assortmentMediaTextLoader.d.ts +12 -0
  17. package/lib/loaders/assortmentMediaTextLoader.d.ts.map +1 -0
  18. package/lib/loaders/assortmentMediaTextLoader.js +20 -0
  19. package/lib/loaders/assortmentMediaTextLoader.js.map +1 -0
  20. package/lib/loaders/assortmentMediasLoader.d.ts +10 -0
  21. package/lib/loaders/assortmentMediasLoader.d.ts.map +1 -0
  22. package/lib/loaders/assortmentMediasLoader.js +18 -0
  23. package/lib/loaders/assortmentMediasLoader.js.map +1 -0
  24. package/lib/loaders/assortmentProductLoader.d.ts +12 -0
  25. package/lib/loaders/assortmentProductLoader.d.ts.map +1 -0
  26. package/lib/loaders/assortmentProductLoader.js +14 -0
  27. package/lib/loaders/assortmentProductLoader.js.map +1 -0
  28. package/lib/loaders/assortmentProductsLoader.d.ts +10 -0
  29. package/lib/loaders/assortmentProductsLoader.d.ts.map +1 -0
  30. package/lib/loaders/assortmentProductsLoader.js +18 -0
  31. package/lib/loaders/assortmentProductsLoader.js.map +1 -0
  32. package/lib/loaders/assortmentTextLoader.d.ts +12 -0
  33. package/lib/loaders/assortmentTextLoader.d.ts.map +1 -0
  34. package/lib/loaders/assortmentTextLoader.js +20 -0
  35. package/lib/loaders/assortmentTextLoader.js.map +1 -0
  36. package/lib/loaders/buildTextMap.d.ts +6 -0
  37. package/lib/loaders/buildTextMap.d.ts.map +1 -0
  38. package/lib/loaders/buildTextMap.js +16 -0
  39. package/lib/loaders/buildTextMap.js.map +1 -0
  40. package/lib/loaders/countryLoader.d.ts +10 -0
  41. package/lib/loaders/countryLoader.d.ts.map +1 -0
  42. package/lib/loaders/countryLoader.js +14 -0
  43. package/lib/loaders/countryLoader.js.map +1 -0
  44. package/lib/loaders/currencyLoader copy.d.ts +10 -0
  45. package/lib/loaders/currencyLoader copy.d.ts.map +1 -0
  46. package/lib/loaders/currencyLoader copy.js +14 -0
  47. package/lib/loaders/currencyLoader copy.js.map +1 -0
  48. package/lib/loaders/currencyLoader.d.ts +10 -0
  49. package/lib/loaders/currencyLoader.d.ts.map +1 -0
  50. package/lib/loaders/currencyLoader.js +14 -0
  51. package/lib/loaders/currencyLoader.js.map +1 -0
  52. package/lib/loaders/currencyLoaderByIsoCode.d.ts +10 -0
  53. package/lib/loaders/currencyLoaderByIsoCode.d.ts.map +1 -0
  54. package/lib/loaders/currencyLoaderByIsoCode.js +13 -0
  55. package/lib/loaders/currencyLoaderByIsoCode.js.map +1 -0
  56. package/lib/loaders/fileLoader.d.ts +10 -0
  57. package/lib/loaders/fileLoader.d.ts.map +1 -0
  58. package/lib/loaders/fileLoader.js +13 -0
  59. package/lib/loaders/fileLoader.js.map +1 -0
  60. package/lib/loaders/filterLoader.d.ts +10 -0
  61. package/lib/loaders/filterLoader.d.ts.map +1 -0
  62. package/lib/loaders/filterLoader.js +14 -0
  63. package/lib/loaders/filterLoader.js.map +1 -0
  64. package/lib/loaders/filterTextLoader.d.ts +14 -0
  65. package/lib/loaders/filterTextLoader.d.ts.map +1 -0
  66. package/lib/loaders/filterTextLoader.js +20 -0
  67. package/lib/loaders/filterTextLoader.js.map +1 -0
  68. package/lib/loaders/index.d.ts.map +1 -1
  69. package/lib/loaders/index.js +6 -35
  70. package/lib/loaders/index.js.map +1 -1
  71. package/lib/loaders/productLoader.d.ts +10 -0
  72. package/lib/loaders/productLoader.d.ts.map +1 -0
  73. package/lib/loaders/productLoader.js +16 -0
  74. package/lib/loaders/productLoader.js.map +1 -0
  75. package/lib/loaders/productLoaderBySKU.d.ts +10 -0
  76. package/lib/loaders/productLoaderBySKU.d.ts.map +1 -0
  77. package/lib/loaders/productLoaderBySKU.js +16 -0
  78. package/lib/loaders/productLoaderBySKU.js.map +1 -0
  79. package/lib/loaders/productMediaTextLoader.d.ts +12 -0
  80. package/lib/loaders/productMediaTextLoader.d.ts.map +1 -0
  81. package/lib/loaders/productMediaTextLoader.js +20 -0
  82. package/lib/loaders/productMediaTextLoader.js.map +1 -0
  83. package/lib/loaders/productMediasLoader.d.ts +10 -0
  84. package/lib/loaders/productMediasLoader.d.ts.map +1 -0
  85. package/lib/loaders/productMediasLoader.js +18 -0
  86. package/lib/loaders/productMediasLoader.js.map +1 -0
  87. package/lib/loaders/productTextLoader.d.ts +12 -0
  88. package/lib/loaders/productTextLoader.d.ts.map +1 -0
  89. package/lib/loaders/productTextLoader.js +20 -0
  90. package/lib/loaders/productTextLoader.js.map +1 -0
  91. package/lib/loaders/userLoader copy.d.ts +10 -0
  92. package/lib/loaders/userLoader copy.d.ts.map +1 -0
  93. package/lib/loaders/userLoader copy.js +13 -0
  94. package/lib/loaders/userLoader copy.js.map +1 -0
  95. package/lib/loaders/userLoader.d.ts +10 -0
  96. package/lib/loaders/userLoader.d.ts.map +1 -0
  97. package/lib/loaders/userLoader.js +13 -0
  98. package/lib/loaders/userLoader.js.map +1 -0
  99. package/lib/loaders/utils.d.ts +7 -0
  100. package/lib/loaders/utils.d.ts.map +1 -0
  101. package/lib/loaders/utils.js +30 -0
  102. package/lib/loaders/utils.js.map +1 -0
  103. package/lib/resolvers/type/assortment/assortment-types.d.ts +1 -1
  104. package/lib/resolvers/type/assortment/assortment-types.d.ts.map +1 -1
  105. package/lib/resolvers/type/assortment/assortment-types.js +1 -1
  106. package/lib/resolvers/type/assortment/assortment-types.js.map +1 -1
  107. package/lib/resolvers/type/bookmark-types.d.ts.map +1 -1
  108. package/lib/resolvers/type/bookmark-types.js +1 -0
  109. package/lib/resolvers/type/bookmark-types.js.map +1 -1
  110. package/lib/resolvers/type/country-types.d.ts.map +1 -1
  111. package/lib/resolvers/type/country-types.js +1 -0
  112. package/lib/resolvers/type/country-types.js.map +1 -1
  113. package/lib/resolvers/type/delivery-provider-types.d.ts.map +1 -1
  114. package/lib/resolvers/type/delivery-provider-types.js +1 -0
  115. package/lib/resolvers/type/delivery-provider-types.js.map +1 -1
  116. package/lib/resolvers/type/enrollment/enrollment-delivery-types.d.ts.map +1 -1
  117. package/lib/resolvers/type/enrollment/enrollment-delivery-types.js +1 -0
  118. package/lib/resolvers/type/enrollment/enrollment-delivery-types.js.map +1 -1
  119. package/lib/resolvers/type/enrollment/enrollment-payment-types.d.ts.map +1 -1
  120. package/lib/resolvers/type/enrollment/enrollment-payment-types.js +1 -0
  121. package/lib/resolvers/type/enrollment/enrollment-payment-types.js.map +1 -1
  122. package/lib/resolvers/type/enrollment/enrollment-period-types.d.ts.map +1 -1
  123. package/lib/resolvers/type/enrollment/enrollment-period-types.js +1 -0
  124. package/lib/resolvers/type/enrollment/enrollment-period-types.js.map +1 -1
  125. package/lib/resolvers/type/enrollment/enrollment-types.d.ts.map +1 -1
  126. package/lib/resolvers/type/enrollment/enrollment-types.js +3 -0
  127. package/lib/resolvers/type/enrollment/enrollment-types.js.map +1 -1
  128. package/lib/resolvers/type/index.d.ts +1 -1
  129. package/lib/resolvers/type/index.d.ts.map +1 -1
  130. package/lib/resolvers/type/order/order-delivery-discount-types.d.ts.map +1 -1
  131. package/lib/resolvers/type/order/order-delivery-discount-types.js +1 -0
  132. package/lib/resolvers/type/order/order-delivery-discount-types.js.map +1 -1
  133. package/lib/resolvers/type/order/order-delivery-pickup-types.d.ts.map +1 -1
  134. package/lib/resolvers/type/order/order-delivery-pickup-types.js +3 -0
  135. package/lib/resolvers/type/order/order-delivery-pickup-types.js.map +1 -1
  136. package/lib/resolvers/type/order/order-delivery-shipping-types.d.ts.map +1 -1
  137. package/lib/resolvers/type/order/order-delivery-shipping-types.js +2 -0
  138. package/lib/resolvers/type/order/order-delivery-shipping-types.js.map +1 -1
  139. package/lib/resolvers/type/order/order-delivery-types.d.ts.map +1 -1
  140. package/lib/resolvers/type/order/order-delivery-types.js +1 -0
  141. package/lib/resolvers/type/order/order-delivery-types.js.map +1 -1
  142. package/lib/resolvers/type/order/order-discount-types.d.ts.map +1 -1
  143. package/lib/resolvers/type/order/order-discount-types.js +3 -0
  144. package/lib/resolvers/type/order/order-discount-types.js.map +1 -1
  145. package/lib/resolvers/type/order/order-global-discount-types.d.ts.map +1 -1
  146. package/lib/resolvers/type/order/order-global-discount-types.js +1 -0
  147. package/lib/resolvers/type/order/order-global-discount-types.js.map +1 -1
  148. package/lib/resolvers/type/order/order-item-discount-types.d.ts.map +1 -1
  149. package/lib/resolvers/type/order/order-item-discount-types.js +1 -0
  150. package/lib/resolvers/type/order/order-item-discount-types.js.map +1 -1
  151. package/lib/resolvers/type/order/order-item-types.d.ts.map +1 -1
  152. package/lib/resolvers/type/order/order-item-types.js +8 -0
  153. package/lib/resolvers/type/order/order-item-types.js.map +1 -1
  154. package/lib/resolvers/type/order/order-payment-card-types.d.ts.map +1 -1
  155. package/lib/resolvers/type/order/order-payment-card-types.js +2 -0
  156. package/lib/resolvers/type/order/order-payment-card-types.js.map +1 -1
  157. package/lib/resolvers/type/order/order-payment-discount-types.d.ts.map +1 -1
  158. package/lib/resolvers/type/order/order-payment-discount-types.js +3 -1
  159. package/lib/resolvers/type/order/order-payment-discount-types.js.map +1 -1
  160. package/lib/resolvers/type/order/order-payment-generic-types.d.ts.map +1 -1
  161. package/lib/resolvers/type/order/order-payment-generic-types.js +2 -0
  162. package/lib/resolvers/type/order/order-payment-generic-types.js.map +1 -1
  163. package/lib/resolvers/type/order/order-payment-invoice-types.d.ts.map +1 -1
  164. package/lib/resolvers/type/order/order-payment-invoice-types.js +2 -0
  165. package/lib/resolvers/type/order/order-payment-invoice-types.js.map +1 -1
  166. package/lib/resolvers/type/order/order-payment-types.d.ts.map +1 -1
  167. package/lib/resolvers/type/order/order-payment-types.js +1 -0
  168. package/lib/resolvers/type/order/order-payment-types.js.map +1 -1
  169. package/lib/resolvers/type/order/order-types.d.ts.map +1 -1
  170. package/lib/resolvers/type/order/order-types.js +8 -0
  171. package/lib/resolvers/type/order/order-types.js.map +1 -1
  172. package/lib/resolvers/type/payment/payment-credentials-types.d.ts.map +1 -1
  173. package/lib/resolvers/type/payment/payment-credentials-types.js +3 -0
  174. package/lib/resolvers/type/payment/payment-credentials-types.js.map +1 -1
  175. package/lib/resolvers/type/payment/payment-provider-types.d.ts.map +1 -1
  176. package/lib/resolvers/type/payment/payment-provider-types.js +1 -0
  177. package/lib/resolvers/type/payment/payment-provider-types.js.map +1 -1
  178. package/lib/resolvers/type/product/product-bundle-types.d.ts.map +1 -1
  179. package/lib/resolvers/type/product/product-catalog-price-types.d.ts.map +1 -1
  180. package/lib/resolvers/type/product/product-catalog-price-types.js +2 -0
  181. package/lib/resolvers/type/product/product-catalog-price-types.js.map +1 -1
  182. package/lib/resolvers/type/product/product-configurable-types.d.ts.map +1 -1
  183. package/lib/resolvers/type/product/product-configurable-types.js +1 -0
  184. package/lib/resolvers/type/product/product-configurable-types.js.map +1 -1
  185. package/lib/resolvers/type/product/product-plan-types.d.ts.map +1 -1
  186. package/lib/resolvers/type/product/product-review-types.d.ts.map +1 -1
  187. package/lib/resolvers/type/product/product-review-types.js +1 -0
  188. package/lib/resolvers/type/product/product-review-types.js.map +1 -1
  189. package/lib/resolvers/type/product/product-simple-types.d.ts.map +1 -1
  190. package/lib/resolvers/type/product/product-simple-types.js +2 -0
  191. package/lib/resolvers/type/product/product-simple-types.js.map +1 -1
  192. package/lib/resolvers/type/product/product-tokenized-types.d.ts.map +1 -1
  193. package/lib/resolvers/type/product/product-tokenized-types.js +2 -0
  194. package/lib/resolvers/type/product/product-tokenized-types.js.map +1 -1
  195. package/lib/resolvers/type/product/product-types.d.ts.map +1 -1
  196. package/lib/resolvers/type/product/product-types.js +2 -0
  197. package/lib/resolvers/type/product/product-types.js.map +1 -1
  198. package/lib/resolvers/type/product/product-variation-assignment-vector.d.ts.map +1 -1
  199. package/lib/resolvers/type/product/product-variation-assignment-vector.js +2 -0
  200. package/lib/resolvers/type/product/product-variation-assignment-vector.js.map +1 -1
  201. package/lib/resolvers/type/product/product-variation-option-types.d.ts.map +1 -1
  202. package/lib/resolvers/type/product/product-variation-option-types.js +1 -0
  203. package/lib/resolvers/type/product/product-variation-option-types.js.map +1 -1
  204. package/lib/resolvers/type/product/product-variation-types.d.ts.map +1 -1
  205. package/lib/resolvers/type/product/product-variation-types.js +1 -0
  206. package/lib/resolvers/type/product/product-variation-types.js.map +1 -1
  207. package/lib/resolvers/type/product-search-result-types.d.ts.map +1 -1
  208. package/lib/resolvers/type/quotation-types.d.ts.map +1 -1
  209. package/lib/resolvers/type/quotation-types.js +3 -0
  210. package/lib/resolvers/type/quotation-types.js.map +1 -1
  211. package/lib/resolvers/type/shop-types.d.ts.map +1 -1
  212. package/lib/resolvers/type/shop-types.js +2 -0
  213. package/lib/resolvers/type/shop-types.js.map +1 -1
  214. package/lib/resolvers/type/token-types.d.ts.map +1 -1
  215. package/lib/resolvers/type/token-types.js +7 -0
  216. package/lib/resolvers/type/token-types.js.map +1 -1
  217. package/lib/resolvers/type/user-types.d.ts.map +1 -1
  218. package/lib/resolvers/type/user-types.js +9 -0
  219. package/lib/resolvers/type/user-types.js.map +1 -1
  220. package/lib/resolvers/type/work-types.d.ts.map +1 -1
  221. package/lib/resolvers/type/work-types.js +1 -0
  222. package/lib/resolvers/type/work-types.js.map +1 -1
  223. package/package.json +1 -1
  224. package/src/express/index.ts +1 -0
  225. package/src/loaders/buildTextMap.ts +19 -0
  226. package/src/loaders/index.ts +6 -40
  227. package/src/resolvers/type/assortment/assortment-types.ts +1 -1
  228. package/src/resolvers/type/bookmark-types.ts +1 -0
  229. package/src/resolvers/type/country-types.ts +1 -0
  230. package/src/resolvers/type/delivery-provider-types.ts +2 -0
  231. package/src/resolvers/type/enrollment/enrollment-delivery-types.ts +1 -0
  232. package/src/resolvers/type/enrollment/enrollment-payment-types.ts +1 -0
  233. package/src/resolvers/type/enrollment/enrollment-period-types.ts +1 -0
  234. package/src/resolvers/type/enrollment/enrollment-types.ts +3 -0
  235. package/src/resolvers/type/order/order-delivery-discount-types.ts +1 -0
  236. package/src/resolvers/type/order/order-delivery-pickup-types.ts +3 -0
  237. package/src/resolvers/type/order/order-delivery-shipping-types.ts +2 -0
  238. package/src/resolvers/type/order/order-delivery-types.ts +1 -0
  239. package/src/resolvers/type/order/order-discount-types.ts +3 -0
  240. package/src/resolvers/type/order/order-global-discount-types.ts +1 -0
  241. package/src/resolvers/type/order/order-item-discount-types.ts +1 -0
  242. package/src/resolvers/type/order/order-item-types.ts +9 -0
  243. package/src/resolvers/type/order/order-payment-card-types.ts +3 -0
  244. package/src/resolvers/type/order/order-payment-discount-types.ts +1 -0
  245. package/src/resolvers/type/order/order-payment-generic-types.ts +2 -0
  246. package/src/resolvers/type/order/order-payment-invoice-types.ts +2 -0
  247. package/src/resolvers/type/order/order-payment-types.ts +1 -0
  248. package/src/resolvers/type/order/order-types.ts +8 -0
  249. package/src/resolvers/type/payment/payment-credentials-types.ts +3 -0
  250. package/src/resolvers/type/payment/payment-provider-types.ts +2 -0
  251. package/src/resolvers/type/product/product-catalog-price-types.ts +2 -0
  252. package/src/resolvers/type/product/product-configurable-types.ts +1 -0
  253. package/src/resolvers/type/product/product-review-types.ts +1 -0
  254. package/src/resolvers/type/product/product-simple-types.ts +2 -0
  255. package/src/resolvers/type/product/product-tokenized-types.ts +2 -0
  256. package/src/resolvers/type/product/product-types.ts +2 -0
  257. package/src/resolvers/type/product/product-variation-assignment-vector.ts +2 -0
  258. package/src/resolvers/type/product/product-variation-option-types.ts +1 -0
  259. package/src/resolvers/type/product/product-variation-types.ts +1 -0
  260. package/src/resolvers/type/quotation-types.ts +3 -0
  261. package/src/resolvers/type/shop-types.ts +2 -0
  262. package/src/resolvers/type/token-types.ts +7 -0
  263. package/src/resolvers/type/user-types.ts +18 -0
  264. package/src/resolvers/type/work-types.ts +2 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/express/index.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,SAAS,CAAC;AAOxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAmHpD,eAAO,MAAM,OAAO,GAClB,YAAY,CAAC,CAAC,OAAO,EACrB,yBAGG;IAAE,cAAc,EAAE,kBAAkB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAAC,EAAE,EAAE,OAAO,CAAC,EAAE,CAAC;IAAC,YAAY,EAAE,aAAa,CAAA;CAAE,EAChG,2CAEG;IAAE,mCAAmC,CAAC,EAAE,OAAO,CAAA;CAAO,SA2D1D,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/express/index.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,SAAS,CAAC;AAOxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAmHpD,eAAO,MAAM,OAAO,GAClB,YAAY,CAAC,CAAC,OAAO,EACrB,yBAGG;IAAE,cAAc,EAAE,kBAAkB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAAC,EAAE,EAAE,OAAO,CAAC,EAAE,CAAC;IAAC,YAAY,EAAE,aAAa,CAAA;CAAE,EAChG,2CAEG;IAAE,mCAAmC,CAAC,EAAE,OAAO,CAAA;CAAO,SA4D1D,CAAC"}
@@ -117,6 +117,7 @@ export const connect = (expressApp, { graphqlHandler, db, }, { allowRemoteToLoca
117
117
  client: db.client,
118
118
  dbName: db.databaseName,
119
119
  collectionName: 'sessions',
120
+ touchAfter: 24 * 3600 /* 24 hours */,
120
121
  }),
121
122
  name,
122
123
  saveUninitialized: false,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/express/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAqB,MAAM,eAAe,CAAC;AAC7E,OAAO,0BAA0B,MAAM,iCAAiC,CAAC;AACzE,OAAO,2BAA2B,MAAM,kCAAkC,CAAC;AAC3E,OAAO,OAAO,MAAM,iBAAiB,CAAC;AACtC,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAIpC,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,MAAM,wBAAwB,GAAG,CAAC,GAAc,EAAE,EAAE;IAClD,MAAM,aAAa,GAChB,GAAG,CAAC,OAAO,CAAC,WAAW,CAAY;QACnC,GAAG,CAAC,OAAO,CAAC,iBAAiB,CAAY;QAC1C,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC;IAE5B,MAAM,UAAU,GAAG,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC;IAE1C,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,CAAC;AACvC,CAAC,CAAC;AAEF,MAAM,EACJ,oBAAoB,GAA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E,KAAK;KACX,CAAC,yBAAyB,EAAE,IAAI,EAAE,EAAE,WAAW,EAAE,CAAC,IAAI,KAAK,CAAwC,CAAC;IAErG,UAAU,CAAC,GAAG,CACZ,OAAO,CAAC;QACN,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,sBAAsB;QAC1C,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC;YACvB,MAAM,EAAG,EAAU,CAAC,MAAM;YAC1B,MAAM,EAAE,EAAE,CAAC,YAAY;YACvB,cAAc,EAAE,UAAU;YAC1B,UAAU,EAAE,EAAE,GAAG,IAAI,CAAC,cAAc;SACrC,CAAC;QACF,IAAI;QACJ,iBAAiB,EAAE,KAAK;QACxB,MAAM,EAAE,KAAK;QACb,MAAM,EAAE;YACN,MAAM;YACN,IAAI;YACJ,QAAQ;YACR,MAAM;YACN,QAAQ,EAAE,IAAI;YACd,MAAM,EAAE,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;SAChC;KACF,CAAC,EACF,QAAQ,CAAC,UAAU,EAAE,EACrB,QAAQ,CAAC,OAAO,EAAE,EAClB,UAAU,CACX,CAAC;IACF,UAAU,CAAC,GAAG,CAAC,gBAAgB,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IACxD,UAAU,CAAC,GAAG,CAAC,qBAAqB,EAAE,2BAA2B,CAAC,CAAC;IACnE,UAAU,CAAC,GAAG,CAAC,oBAAoB,EAAE,0BAA0B,CAAC,CAAC;AACnE,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { UnchainedCore } from '@unchainedshop/core';
2
+ import { AssortmentLink } from '@unchainedshop/core-assortments';
3
+ import DataLoader from 'dataloader';
4
+ declare const _default: (unchainedAPI: UnchainedCore) => DataLoader<{
5
+ parentAssortmentId: string;
6
+ childAssortmentId: string;
7
+ }, AssortmentLink, {
8
+ parentAssortmentId: string;
9
+ childAssortmentId: string;
10
+ }>;
11
+ export default _default;
12
+ //# sourceMappingURL=assortmentLinkLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assortmentLinkLoader.d.ts","sourceRoot":"","sources":["../../src/loaders/assortmentLinkLoader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,UAAU,MAAM,YAAY,CAAC;yBAEpB,cAAc,aAAa;wBACJ,MAAM;uBAAqB,MAAM;;wBAAjC,MAAM;uBAAqB,MAAM;;AADxE,wBA2BI"}
@@ -0,0 +1,23 @@
1
+ import DataLoader from 'dataloader';
2
+ export default (unchainedAPI) => new DataLoader(async (queries) => {
3
+ const parentAssortmentIds = [...new Set(queries.map((q) => q.parentAssortmentId).filter(Boolean))];
4
+ const links = await unchainedAPI.modules.assortments.links.findLinks({
5
+ parentAssortmentIds,
6
+ });
7
+ const assortmentLinkMap = {};
8
+ for (const link of links) {
9
+ if (!assortmentLinkMap[link.parentAssortmentId]) {
10
+ assortmentLinkMap[link.parentAssortmentId] = [link];
11
+ }
12
+ else {
13
+ assortmentLinkMap[link.parentAssortmentId].push(link);
14
+ }
15
+ }
16
+ return queries.map((q) => {
17
+ if (q.childAssortmentId) {
18
+ return assortmentLinkMap[q.parentAssortmentId].find((link) => link.childAssortmentId === q.childAssortmentId);
19
+ }
20
+ return assortmentLinkMap[q.parentAssortmentId][0];
21
+ });
22
+ });
23
+ //# sourceMappingURL=assortmentLinkLoader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assortmentLinkLoader.js","sourceRoot":"","sources":["../../src/loaders/assortmentLinkLoader.ts"],"names":[],"mappings":"AAEA,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,eAAe,CAAC,YAA2B,EAAE,EAAE,CAC7C,IAAI,UAAU,CACZ,KAAK,EAAE,OAAO,EAAE,EAAE;IAChB,MAAM,mBAAmB,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAEnG,MAAM,KAAK,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,SAAS,CAAC;QACnE,mBAAmB;KACpB,CAAC,CAAC;IAEH,MAAM,iBAAiB,GAAG,EAAE,CAAC;IAC7B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,kBAAkB,CAAC,EAAE,CAAC;YAChD,iBAAiB,CAAC,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACtD,CAAC;aAAM,CAAC;YACN,iBAAiB,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QACvB,IAAI,CAAC,CAAC,iBAAiB,EAAE,CAAC;YACxB,OAAO,iBAAiB,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,IAAI,CACjD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,iBAAiB,KAAK,CAAC,CAAC,iBAAiB,CACzD,CAAC;QACJ,CAAC;QACD,OAAO,iBAAiB,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;AACL,CAAC,CACF,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { UnchainedCore } from '@unchainedshop/core';
2
+ import { AssortmentLink } from '@unchainedshop/core-assortments';
3
+ import DataLoader from 'dataloader';
4
+ declare const _default: (unchainedAPI: UnchainedCore) => DataLoader<{
5
+ parentAssortmentId?: string;
6
+ childAssortmentId?: string;
7
+ assortmentId?: string;
8
+ }, AssortmentLink[], {
9
+ parentAssortmentId?: string;
10
+ childAssortmentId?: string;
11
+ assortmentId?: string;
12
+ }>;
13
+ export default _default;
14
+ //# sourceMappingURL=assortmentLinksLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assortmentLinksLoader.d.ts","sourceRoot":"","sources":["../../src/loaders/assortmentLinksLoader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,UAAU,MAAM,YAAY,CAAC;yBAEpB,cAAc,aAAa;yBAEhB,MAAM;wBAAsB,MAAM;mBAAiB,MAAM;;yBAAzD,MAAM;wBAAsB,MAAM;mBAAiB,MAAM;;AAFpF,wBAyCK"}
@@ -0,0 +1,38 @@
1
+ import DataLoader from 'dataloader';
2
+ export default (unchainedAPI) => new DataLoader(async (queries) => {
3
+ const parentAssortmentIds = queries.flatMap((q) => q.parentAssortmentId).filter(Boolean);
4
+ const childAssortmentIds = queries.flatMap((q) => q.childAssortmentId).filter(Boolean);
5
+ const assortmentIds = queries.flatMap((q) => q.assortmentId).filter(Boolean);
6
+ const allLinks = await unchainedAPI.modules.assortments.links.findLinks({
7
+ assortmentIds: [...new Set([...parentAssortmentIds, ...childAssortmentIds, ...assortmentIds])],
8
+ });
9
+ const parentAssortmentLinkMap = {};
10
+ const childAssortmentLinkMap = {};
11
+ for (const link of allLinks) {
12
+ if (!parentAssortmentLinkMap[link.parentAssortmentId]) {
13
+ parentAssortmentLinkMap[link.parentAssortmentId] = [link];
14
+ }
15
+ else {
16
+ parentAssortmentLinkMap[link.parentAssortmentId].push(link);
17
+ }
18
+ if (!childAssortmentLinkMap[link.childAssortmentId]) {
19
+ childAssortmentLinkMap[link.childAssortmentId] = [link];
20
+ }
21
+ else {
22
+ childAssortmentLinkMap[link.childAssortmentId].push(link);
23
+ }
24
+ }
25
+ return queries.map((q) => {
26
+ if (q.parentAssortmentId) {
27
+ return parentAssortmentLinkMap[q.parentAssortmentId] || [];
28
+ }
29
+ else if (q.childAssortmentId) {
30
+ return childAssortmentLinkMap[q.childAssortmentId] || [];
31
+ }
32
+ return [
33
+ ...(parentAssortmentLinkMap[q.assortmentId] || []),
34
+ ...(childAssortmentLinkMap[q.assortmentId] || []),
35
+ ];
36
+ });
37
+ });
38
+ //# sourceMappingURL=assortmentLinksLoader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assortmentLinksLoader.js","sourceRoot":"","sources":["../../src/loaders/assortmentLinksLoader.ts"],"names":[],"mappings":"AAEA,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,eAAe,CAAC,YAA2B,EAAE,EAAE,CAC7C,IAAI,UAAU,CAGZ,KAAK,EAAE,OAAO,EAAE,EAAE;IAClB,MAAM,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACzF,MAAM,kBAAkB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACvF,MAAM,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAE7E,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,SAAS,CAAC;QACtE,aAAa,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,mBAAmB,EAAE,GAAG,kBAAkB,EAAE,GAAG,aAAa,CAAC,CAAC,CAAC;KAC/F,CAAC,CAAC;IAEH,MAAM,uBAAuB,GAAG,EAAE,CAAC;IACnC,MAAM,sBAAsB,GAAG,EAAE,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DataLoader from 'dataloader';
4
+ declare const _default: (unchainedAPI: UnchainedCore) => DataLoader<{
5
+ assortmentId: string;
6
+ }, Assortment, {
7
+ assortmentId: string;
8
+ }>;
9
+ export default _default;
10
+ //# sourceMappingURL=assortmentLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assortmentLoader.d.ts","sourceRoot":"","sources":["../../src/loaders/assortmentLoader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,UAAU,MAAM,YAAY,CAAC;yBAEpB,cAAc,aAAa;kBACV,MAAM;;kBAAN,MAAM;;AADvC,wBAeK"}
@@ -0,0 +1,15 @@
1
+ import DataLoader from 'dataloader';
2
+ export default (unchainedAPI) => new DataLoader(async (queries) => {
3
+ const assortmentIds = [...new Set(queries.map((q) => q.assortmentId).filter(Boolean))];
4
+ const assortments = await unchainedAPI.modules.assortments.findAssortments({
5
+ assortmentIds,
6
+ includeInactive: true,
7
+ includeLeaves: true,
8
+ });
9
+ const assortmentMap = {};
10
+ for (const assortment of assortments) {
11
+ assortmentMap[assortment._id] = assortment;
12
+ }
13
+ return queries.map((q) => assortmentMap[q.assortmentId]);
14
+ });
15
+ //# sourceMappingURL=assortmentLoader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assortmentLoader.js","sourceRoot":"","sources":["../../src/loaders/assortmentLoader.ts"],"names":[],"mappings":"AAEA,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,eAAe,CAAC,YAA2B,EAAE,EAAE,CAC7C,IAAI,UAAU,CAAuC,KAAK,EAAE,OAAO,EAAE,EAAE;IACrE,MAAM,aAAa,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAEvF,MAAM,WAAW,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,eAAe,CAAC;QACzE,aAAa;QACb,eAAe,EAAE,IAAI;QACrB,aAAa,EAAE,IAAI;KACpB,CAAC,CAAC;IAEH,MAAM,aAAa,GAAG,EAAE,CAAC;IACzB,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;QACrC,aAAa,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC;IAC7C,CAAC;IACD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;AAC3D,CAAC,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { UnchainedCore } from '@unchainedshop/core';
2
+ import { AssortmentMediaText } from '@unchainedshop/core-assortments';
3
+ import DataLoader from 'dataloader';
4
+ declare const _default: (unchainedAPI: UnchainedCore) => DataLoader<{
5
+ assortmentMediaId: string;
6
+ locale: string;
7
+ }, AssortmentMediaText, {
8
+ assortmentMediaId: string;
9
+ locale: string;
10
+ }>;
11
+ export default _default;
12
+ //# sourceMappingURL=assortmentMediaTextLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assortmentMediaTextLoader.d.ts","sourceRoot":"","sources":["../../src/loaders/assortmentMediaTextLoader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,UAAU,MAAM,YAAY,CAAC;yBAGpB,cAAc,aAAa;uBACL,MAAM;YAAU,MAAM;;uBAAtB,MAAM;YAAU,MAAM;;AAD5D,wBAuBK"}
@@ -0,0 +1,20 @@
1
+ import DataLoader from 'dataloader';
2
+ import { buildLocaleMap } from './utils.js';
3
+ export default (unchainedAPI) => new DataLoader(async (queries) => {
4
+ const assortmentMediaIds = [...new Set(queries.map((q) => q.assortmentMediaId).filter(Boolean))];
5
+ const texts = await unchainedAPI.modules.assortments.media.texts.findMediaTexts({ assortmentMediaId: { $in: assortmentMediaIds } }, {
6
+ sort: {
7
+ assortmentMediaId: 1,
8
+ },
9
+ });
10
+ const localeMap = buildLocaleMap(queries, texts);
11
+ const textsMap = {};
12
+ for (const text of texts) {
13
+ const localesForText = localeMap[text.locale] || [];
14
+ for (const locale of localesForText) {
15
+ textsMap[locale + text.assortmentMediaId] = text;
16
+ }
17
+ }
18
+ return queries.map((q) => textsMap[q.locale + q.assortmentMediaId]);
19
+ });
20
+ //# sourceMappingURL=assortmentMediaTextLoader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assortmentMediaTextLoader.js","sourceRoot":"","sources":["../../src/loaders/assortmentMediaTextLoader.ts"],"names":[],"mappings":"AAEA,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,eAAe,CAAC,YAA2B,EAAE,EAAE,CAC7C,IAAI,UAAU,CAAqE,KAAK,EAAE,OAAO,EAAE,EAAE;IACnG,MAAM,kBAAkB,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAEjG,MAAM,KAAK,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,cAAc,CAC7E,EAAE,iBAAiB,EAAE,EAAE,GAAG,EAAE,kBAAkB,EAAE,EAAE,EAClD;QACE,IAAI,EAAE;YACJ,iBAAiB,EAAE,CAAC;SACrB;KACF,CACF,CAAC;IAEF,MAAM,SAAS,GAAG,cAAc,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAEjD,MAAM,QAAQ,GAAG,EAAE,CAAC;IACpB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,cAAc,GAAG,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QACpD,KAAK,MAAM,MAAM,IAAI,cAAc,EAAE,CAAC;YACpC,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAC;QACnD,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC;AACtE,CAAC,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { UnchainedCore } from '@unchainedshop/core';
2
+ import { AssortmentMediaType } from '@unchainedshop/core-assortments';
3
+ import DataLoader from 'dataloader';
4
+ declare const _default: (unchainedAPI: UnchainedCore) => DataLoader<{
5
+ assortmentId?: string;
6
+ }, AssortmentMediaType[], {
7
+ assortmentId?: string;
8
+ }>;
9
+ export default _default;
10
+ //# sourceMappingURL=assortmentMediasLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assortmentMediasLoader.d.ts","sourceRoot":"","sources":["../../src/loaders/assortmentMediasLoader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,UAAU,MAAM,YAAY,CAAC;yBAEpB,cAAc,aAAa;mBACT,MAAM;;mBAAN,MAAM;;AADxC,wBAgBK"}
@@ -0,0 +1,18 @@
1
+ import DataLoader from 'dataloader';
2
+ export default (unchainedAPI) => new DataLoader(async (queries) => {
3
+ const assortmentIds = [...new Set(queries.map((q) => q.assortmentId).filter(Boolean))];
4
+ const assortmentMediaItems = await unchainedAPI.modules.assortments.media.findAssortmentMedias({
5
+ assortmentId: { $in: assortmentIds },
6
+ });
7
+ const assortmentMediaMap = {};
8
+ for (const assortmentMedia of assortmentMediaItems) {
9
+ if (!assortmentMediaMap[assortmentMedia.assortmentId]) {
10
+ assortmentMediaMap[assortmentMedia.assortmentId] = [assortmentMedia];
11
+ }
12
+ else {
13
+ assortmentMediaMap[assortmentMedia.assortmentId].push(assortmentMedia);
14
+ }
15
+ }
16
+ return queries.map((q) => assortmentMediaMap[q.assortmentId] || []);
17
+ });
18
+ //# sourceMappingURL=assortmentMediasLoader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assortmentMediasLoader.js","sourceRoot":"","sources":["../../src/loaders/assortmentMediasLoader.ts"],"names":[],"mappings":"AAEA,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,eAAe,CAAC,YAA2B,EAAE,EAAE,CAC7C,IAAI,UAAU,CAAmD,KAAK,EAAE,OAAO,EAAE,EAAE;IACjF,MAAM,aAAa,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACvF,MAAM,oBAAoB,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,oBAAoB,CAAC;QAC7F,YAAY,EAAE,EAAE,GAAG,EAAE,aAAa,EAAE;KACrC,CAAC,CAAC;IAEH,MAAM,kBAAkB,GAAG,EAAE,CAAC;IAC9B,KAAK,MAAM,eAAe,IAAI,oBAAoB,EAAE,CAAC;QACnD,IAAI,CAAC,kBAAkB,CAAC,eAAe,CAAC,YAAY,CAAC,EAAE,CAAC;YACtD,kBAAkB,CAAC,eAAe,CAAC,YAAY,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;QACvE,CAAC;aAAM,CAAC;YACN,kBAAkB,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QACzE,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC;AACtE,CAAC,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { UnchainedCore } from '@unchainedshop/core';
2
+ import { AssortmentProduct } from '@unchainedshop/core-assortments';
3
+ import DataLoader from 'dataloader';
4
+ declare const _default: (unchainedAPI: UnchainedCore) => DataLoader<{
5
+ assortmentId: string;
6
+ productId: string;
7
+ }, AssortmentProduct, {
8
+ assortmentId: string;
9
+ productId: string;
10
+ }>;
11
+ export default _default;
12
+ //# sourceMappingURL=assortmentProductLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assortmentProductLoader.d.ts","sourceRoot":"","sources":["../../src/loaders/assortmentProductLoader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,UAAU,MAAM,YAAY,CAAC;yBAEpB,cAAc,aAAa;kBACV,MAAM;eAAa,MAAM;;kBAAzB,MAAM;eAAa,MAAM;;AAD1D,wBAcK"}
@@ -0,0 +1,14 @@
1
+ import DataLoader from 'dataloader';
2
+ export default (unchainedAPI) => new DataLoader(async (queries) => {
3
+ const assortmentIds = [...new Set(queries.map((q) => q.assortmentId).filter(Boolean))];
4
+ const assortmentProducts = await unchainedAPI.modules.assortments.products.findAssortmentProducts({
5
+ assortmentIds,
6
+ });
7
+ const assortmentProductMap = {};
8
+ for (const assortmentProduct of assortmentProducts) {
9
+ assortmentProductMap[assortmentProduct.assortmentId + assortmentProduct.productId] =
10
+ assortmentProduct;
11
+ }
12
+ return queries.map((q) => assortmentProductMap[q.assortmentId + q.productId]);
13
+ });
14
+ //# sourceMappingURL=assortmentProductLoader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assortmentProductLoader.js","sourceRoot":"","sources":["../../src/loaders/assortmentProductLoader.ts"],"names":[],"mappings":"AAEA,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,eAAe,CAAC,YAA2B,EAAE,EAAE,CAC7C,IAAI,UAAU,CAAiE,KAAK,EAAE,OAAO,EAAE,EAAE;IAC/F,MAAM,aAAa,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAEvF,MAAM,kBAAkB,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,sBAAsB,CAAC;QAChG,aAAa;KACd,CAAC,CAAC;IAEH,MAAM,oBAAoB,GAAG,EAAE,CAAC;IAChC,KAAK,MAAM,iBAAiB,IAAI,kBAAkB,EAAE,CAAC;QACnD,oBAAoB,CAAC,iBAAiB,CAAC,YAAY,GAAG,iBAAiB,CAAC,SAAS,CAAC;YAChF,iBAAiB,CAAC;IACtB,CAAC;IACD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,oBAAoB,CAAC,CAAC,CAAC,YAAY,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;AAChF,CAAC,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { UnchainedCore } from '@unchainedshop/core';
2
+ import { AssortmentProduct } from '@unchainedshop/core-assortments';
3
+ import DataLoader from 'dataloader';
4
+ declare const _default: (unchainedAPI: UnchainedCore) => DataLoader<{
5
+ productId: string;
6
+ }, AssortmentProduct[], {
7
+ productId: string;
8
+ }>;
9
+ export default _default;
10
+ //# sourceMappingURL=assortmentProductsLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assortmentProductsLoader.d.ts","sourceRoot":"","sources":["../../src/loaders/assortmentProductsLoader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,UAAU,MAAM,YAAY,CAAC;yBAEpB,cAAc,aAAa;eACb,MAAM;;eAAN,MAAM;;AADpC,wBAiBK"}
@@ -0,0 +1,18 @@
1
+ import DataLoader from 'dataloader';
2
+ export default (unchainedAPI) => new DataLoader(async (queries) => {
3
+ const productIds = [...new Set(queries.map((q) => q.productId).filter(Boolean))];
4
+ const assortmentProducts = await unchainedAPI.modules.assortments.products.findAssortmentProducts({
5
+ productIds,
6
+ });
7
+ const assortmentProductsMap = {};
8
+ for (const assortmentProduct of assortmentProducts) {
9
+ if (!assortmentProductsMap[assortmentProduct.productId]) {
10
+ assortmentProductsMap[assortmentProduct.productId] = [assortmentProduct];
11
+ }
12
+ else {
13
+ assortmentProductsMap[assortmentProduct.productId].push(assortmentProduct);
14
+ }
15
+ }
16
+ return queries.map((q) => assortmentProductsMap[q.productId] || []);
17
+ });
18
+ //# sourceMappingURL=assortmentProductsLoader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assortmentProductsLoader.js","sourceRoot":"","sources":["../../src/loaders/assortmentProductsLoader.ts"],"names":[],"mappings":"AAEA,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,eAAe,CAAC,YAA2B,EAAE,EAAE,CAC7C,IAAI,UAAU,CAA6C,KAAK,EAAE,OAAO,EAAE,EAAE;IAC3E,MAAM,UAAU,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAEjF,MAAM,kBAAkB,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,sBAAsB,CAAC;QAChG,UAAU;KACX,CAAC,CAAC;IAEH,MAAM,qBAAqB,GAAG,EAAE,CAAC;IACjC,KAAK,MAAM,iBAAiB,IAAI,kBAAkB,EAAE,CAAC;QACnD,IAAI,CAAC,qBAAqB,CAAC,iBAAiB,CAAC,SAAS,CAAC,EAAE,CAAC;YACxD,qBAAqB,CAAC,iBAAiB,CAAC,SAAS,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC3E,CAAC;aAAM,CAAC;YACN,qBAAqB,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QAC7E,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,qBAAqB,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC;AACtE,CAAC,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { UnchainedCore } from '@unchainedshop/core';
2
+ import { AssortmentText } from '@unchainedshop/core-assortments';
3
+ import DataLoader from 'dataloader';
4
+ declare const _default: (unchainedAPI: UnchainedCore) => DataLoader<{
5
+ assortmentId: string;
6
+ locale: string;
7
+ }, AssortmentText, {
8
+ assortmentId: string;
9
+ locale: string;
10
+ }>;
11
+ export default _default;
12
+ //# sourceMappingURL=assortmentTextLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assortmentTextLoader.d.ts","sourceRoot":"","sources":["../../src/loaders/assortmentTextLoader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,UAAU,MAAM,YAAY,CAAC;yBAGpB,cAAc,aAAa;kBACV,MAAM;YAAU,MAAM;;kBAAtB,MAAM;YAAU,MAAM;;AADvD,wBAuBK"}
@@ -0,0 +1,20 @@
1
+ import DataLoader from 'dataloader';
2
+ import { buildLocaleMap } from './utils.js';
3
+ export default (unchainedAPI) => new DataLoader(async (queries) => {
4
+ const assortmentIds = [...new Set(queries.map((q) => q.assortmentId).filter(Boolean))];
5
+ const texts = await unchainedAPI.modules.assortments.texts.findTexts({ assortmentId: { $in: assortmentIds } }, {
6
+ sort: {
7
+ assortmentId: 1,
8
+ },
9
+ });
10
+ const localeMap = buildLocaleMap(queries, texts);
11
+ const textsMap = {};
12
+ for (const text of texts) {
13
+ const localesForText = localeMap[text.locale] || [];
14
+ for (const locale of localesForText) {
15
+ textsMap[locale + text.assortmentId] = text;
16
+ }
17
+ }
18
+ return queries.map((q) => textsMap[q.locale + q.assortmentId]);
19
+ });
20
+ //# sourceMappingURL=assortmentTextLoader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assortmentTextLoader.js","sourceRoot":"","sources":["../../src/loaders/assortmentTextLoader.ts"],"names":[],"mappings":"AAEA,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,eAAe,CAAC,YAA2B,EAAE,EAAE,CAC7C,IAAI,UAAU,CAA2D,KAAK,EAAE,OAAO,EAAE,EAAE;IACzF,MAAM,aAAa,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAEvF,MAAM,KAAK,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,SAAS,CAClE,EAAE,YAAY,EAAE,EAAE,GAAG,EAAE,aAAa,EAAE,EAAE,EACxC;QACE,IAAI,EAAE;YACJ,YAAY,EAAE,CAAC;SAChB;KACF,CACF,CAAC;IAEF,MAAM,SAAS,GAAG,cAAc,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAEjD,MAAM,QAAQ,GAAG,EAAE,CAAC;IACpB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,cAAc,GAAG,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QACpD,KAAK,MAAM,MAAM,IAAI,cAAc,EAAE,CAAC;YACpC,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC;QAC9C,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;AACjE,CAAC,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ type ArrayElement<T> = T extends (infer U)[] ? U : never;
2
+ export default function buildTextMap<T extends Array<{
3
+ locale?: string;
4
+ }>>(localeMap: Record<string, string[]>, texts: Readonly<T>, buildId: (item: ArrayElement<T>) => string): {};
5
+ export {};
6
+ //# sourceMappingURL=buildTextMap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildTextMap.d.ts","sourceRoot":"","sources":["../../src/loaders/buildTextMap.ts"],"names":[],"mappings":"AAAA,KAAK,YAAY,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,KAAK,CAAC;AAEzD,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,CAAC,SAAS,KAAK,CAAC;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,EACvE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EACnC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,EAClB,OAAO,EAAE,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK,MAAM,MAa3C"}
@@ -0,0 +1,16 @@
1
+ export default function buildTextMap(localeMap, texts, buildId) {
2
+ const textsMap = {};
3
+ for (const [originLocale, localesForText] of Object.entries(localeMap)) {
4
+ for (const text of texts) {
5
+ if (originLocale !== text.locale)
6
+ continue;
7
+ for (const locale of localesForText) {
8
+ if (textsMap[locale + buildId(text)])
9
+ continue;
10
+ textsMap[locale + buildId(text)] = text;
11
+ }
12
+ }
13
+ }
14
+ return textsMap;
15
+ }
16
+ //# sourceMappingURL=buildTextMap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildTextMap.js","sourceRoot":"","sources":["../../src/loaders/buildTextMap.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,SAAmC,EACnC,KAAkB,EAClB,OAA0C;IAE1C,MAAM,QAAQ,GAAG,EAAE,CAAC;IACpB,KAAK,MAAM,CAAC,YAAY,EAAE,cAAc,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;QACvE,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,IAAI,YAAY,KAAK,IAAI,CAAC,MAAM;gBAAE,SAAS;YAC3C,KAAK,MAAM,MAAM,IAAI,cAAc,EAAE,CAAC;gBACpC,IAAI,QAAQ,CAAC,MAAM,GAAG,OAAO,CAAC,IAAW,CAAC,CAAC;oBAAE,SAAS;gBACtD,QAAQ,CAAC,MAAM,GAAG,OAAO,CAAC,IAAW,CAAC,CAAC,GAAG,IAAI,CAAC;YACjD,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { UnchainedCore } from '@unchainedshop/core';
2
+ import { Country } from '@unchainedshop/core-countries';
3
+ import DataLoader from 'dataloader';
4
+ declare const _default: (unchainedAPI: UnchainedCore) => DataLoader<{
5
+ isoCode: string;
6
+ }, Country, {
7
+ isoCode: string;
8
+ }>;
9
+ export default _default;
10
+ //# sourceMappingURL=countryLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"countryLoader.d.ts","sourceRoot":"","sources":["../../src/loaders/countryLoader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,UAAU,MAAM,YAAY,CAAC;yBAEpB,cAAc,aAAa;aACf,MAAM;;aAAN,MAAM;;AADlC,wBAeK"}
@@ -0,0 +1,14 @@
1
+ import DataLoader from 'dataloader';
2
+ export default (unchainedAPI) => new DataLoader(async (queries) => {
3
+ const isoCodes = [...new Set(queries.map((q) => q.isoCode).filter(Boolean))]; // you don't need lodash, _.unique my ass
4
+ const countries = await unchainedAPI.modules.countries.findCountries({
5
+ isoCode: { $in: isoCodes },
6
+ includeInactive: true,
7
+ });
8
+ const countryMap = {};
9
+ for (const country of countries) {
10
+ countryMap[country.isoCode] = country;
11
+ }
12
+ return queries.map((q) => countryMap[q.isoCode]);
13
+ });
14
+ //# sourceMappingURL=countryLoader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"countryLoader.js","sourceRoot":"","sources":["../../src/loaders/countryLoader.ts"],"names":[],"mappings":"AAEA,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,eAAe,CAAC,YAA2B,EAAE,EAAE,CAC7C,IAAI,UAAU,CAA+B,KAAK,EAAE,OAAO,EAAE,EAAE;IAC7D,MAAM,QAAQ,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,yCAAyC;IAEvH,MAAM,SAAS,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,aAAa,CAAC;QACnE,OAAO,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE;QAC1B,eAAe,EAAE,IAAI;KACtB,CAAC,CAAC;IAEH,MAAM,UAAU,GAAG,EAAE,CAAC;IACtB,KAAK,MAAM,OAAO,IAAI,SAAS,EAAE,CAAC;QAChC,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IACxC,CAAC;IAED,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;AACnD,CAAC,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { UnchainedCore } from '@unchainedshop/core';
2
+ import { Currency } from '@unchainedshop/core-currencies';
3
+ import DataLoader from 'dataloader';
4
+ declare const _default: (unchainedAPI: UnchainedCore) => DataLoader<{
5
+ isoCode: string;
6
+ }, Currency, {
7
+ isoCode: string;
8
+ }>;
9
+ export default _default;
10
+ //# sourceMappingURL=currencyLoader%20copy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"currencyLoader copy.d.ts","sourceRoot":"","sources":["../../src/loaders/currencyLoader copy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC1D,OAAO,UAAU,MAAM,YAAY,CAAC;yBAEpB,cAAc,aAAa;aACf,MAAM;;aAAN,MAAM;;AADlC,wBAeK"}
@@ -0,0 +1,14 @@
1
+ import DataLoader from 'dataloader';
2
+ export default (unchainedAPI) => new DataLoader(async (queries) => {
3
+ const isoCodes = [...new Set(queries.map((q) => q.isoCode).filter(Boolean))]; // you don't need lodash, _.unique my ass
4
+ const currencies = await unchainedAPI.modules.currencies.findCurrencies({
5
+ isoCode: { $in: isoCodes },
6
+ includeInactive: true,
7
+ });
8
+ const currencyMap = {};
9
+ for (const currency of currencies) {
10
+ currencyMap[currency._id] = currency;
11
+ }
12
+ return queries.map((q) => currencyMap[q.isoCode]);
13
+ });
14
+ //# sourceMappingURL=currencyLoader%20copy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"currencyLoader copy.js","sourceRoot":"","sources":["../../src/loaders/currencyLoader copy.ts"],"names":[],"mappings":"AAEA,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,eAAe,CAAC,YAA2B,EAAE,EAAE,CAC7C,IAAI,UAAU,CAAgC,KAAK,EAAE,OAAO,EAAE,EAAE;IAC9D,MAAM,QAAQ,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,yCAAyC;IAEvH,MAAM,UAAU,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC;QACtE,OAAO,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE;QAC1B,eAAe,EAAE,IAAI;KACtB,CAAC,CAAC;IAEH,MAAM,WAAW,GAAG,EAAE,CAAC;IACvB,KAAK,MAAM,QAAQ,IAAI,UAAU,EAAE,CAAC;QAClC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;IACvC,CAAC;IAED,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;AACpD,CAAC,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { UnchainedCore } from '@unchainedshop/core';
2
+ import { Currency } from '@unchainedshop/core-currencies';
3
+ import DataLoader from 'dataloader';
4
+ declare const _default: (unchainedAPI: UnchainedCore) => DataLoader<{
5
+ isoCode: string;
6
+ }, Currency, {
7
+ isoCode: string;
8
+ }>;
9
+ export default _default;
10
+ //# sourceMappingURL=currencyLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"currencyLoader.d.ts","sourceRoot":"","sources":["../../src/loaders/currencyLoader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC1D,OAAO,UAAU,MAAM,YAAY,CAAC;yBAEpB,cAAc,aAAa;aACf,MAAM;;aAAN,MAAM;;AADlC,wBAeK"}
@@ -0,0 +1,14 @@
1
+ import DataLoader from 'dataloader';
2
+ export default (unchainedAPI) => new DataLoader(async (queries) => {
3
+ const isoCodes = [...new Set(queries.map((q) => q.isoCode).filter(Boolean))]; // you don't need lodash, _.unique my ass
4
+ const currencies = await unchainedAPI.modules.currencies.findCurrencies({
5
+ isoCode: { $in: isoCodes },
6
+ includeInactive: true,
7
+ });
8
+ const currencyMap = {};
9
+ for (const currency of currencies) {
10
+ currencyMap[currency.isoCode] = currency;
11
+ }
12
+ return queries.map((q) => currencyMap[q.isoCode]);
13
+ });
14
+ //# sourceMappingURL=currencyLoader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"currencyLoader.js","sourceRoot":"","sources":["../../src/loaders/currencyLoader.ts"],"names":[],"mappings":"AAEA,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,eAAe,CAAC,YAA2B,EAAE,EAAE,CAC7C,IAAI,UAAU,CAAgC,KAAK,EAAE,OAAO,EAAE,EAAE;IAC9D,MAAM,QAAQ,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,yCAAyC;IAEvH,MAAM,UAAU,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC;QACtE,OAAO,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE;QAC1B,eAAe,EAAE,IAAI;KACtB,CAAC,CAAC;IAEH,MAAM,WAAW,GAAG,EAAE,CAAC;IACvB,KAAK,MAAM,QAAQ,IAAI,UAAU,EAAE,CAAC;QAClC,WAAW,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,QAAQ,CAAC;IAC3C,CAAC;IAED,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;AACpD,CAAC,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { UnchainedCore } from '@unchainedshop/core';
2
+ import { User } from '@unchainedshop/core-users';
3
+ import DataLoader from 'dataloader';
4
+ declare const _default: (unchainedAPI: UnchainedCore) => DataLoader<{
5
+ currencyId: string;
6
+ }, User, {
7
+ currencyId: string;
8
+ }>;
9
+ export default _default;
10
+ //# sourceMappingURL=currencyLoaderByIsoCode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"currencyLoaderByIsoCode.d.ts","sourceRoot":"","sources":["../../src/loaders/currencyLoaderByIsoCode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACjD,OAAO,UAAU,MAAM,YAAY,CAAC;yBAEpB,cAAc,aAAa;gBACZ,MAAM;;gBAAN,MAAM;;AADrC,wBAcK"}
@@ -0,0 +1,13 @@
1
+ import DataLoader from 'dataloader';
2
+ export default (unchainedAPI) => new DataLoader(async (queries) => {
3
+ const currencyIds = [...new Set(queries.map((q) => q.currencyId).filter(Boolean))]; // you don't need lodash, _.unique my ass
4
+ const users = await unchainedAPI.modules.users.findUsers({
5
+ _id: { $in: currencyIds },
6
+ });
7
+ const userMap = {};
8
+ for (const user of users) {
9
+ userMap[user._id] = user;
10
+ }
11
+ return queries.map((q) => userMap[q.currencyId]);
12
+ });
13
+ //# sourceMappingURL=currencyLoaderByIsoCode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"currencyLoaderByIsoCode.js","sourceRoot":"","sources":["../../src/loaders/currencyLoaderByIsoCode.ts"],"names":[],"mappings":"AAEA,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,eAAe,CAAC,YAA2B,EAAE,EAAE,CAC7C,IAAI,UAAU,CAA+B,KAAK,EAAE,OAAO,EAAE,EAAE;IAC7D,MAAM,WAAW,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,yCAAyC;IAE7H,MAAM,KAAK,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC;QACvD,GAAG,EAAE,EAAE,GAAG,EAAE,WAAW,EAAE;KAC1B,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,EAAE,CAAC;IACnB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;IAC3B,CAAC;IAED,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;AACnD,CAAC,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { UnchainedCore } from '@unchainedshop/core';
2
+ import { File } from '@unchainedshop/core-files';
3
+ import DataLoader from 'dataloader';
4
+ declare const _default: (unchainedAPI: UnchainedCore) => DataLoader<{
5
+ fileId: string;
6
+ }, File, {
7
+ fileId: string;
8
+ }>;
9
+ export default _default;
10
+ //# sourceMappingURL=fileLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fileLoader.d.ts","sourceRoot":"","sources":["../../src/loaders/fileLoader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACjD,OAAO,UAAU,MAAM,YAAY,CAAC;yBAEpB,cAAc,aAAa;YAChB,MAAM;;YAAN,MAAM;;AADjC,wBAcK"}
@@ -0,0 +1,13 @@
1
+ import DataLoader from 'dataloader';
2
+ export default (unchainedAPI) => new DataLoader(async (queries) => {
3
+ const fileIds = [...new Set(queries.map((q) => q.fileId).filter(Boolean))]; // you don't need lodash, _.unique my ass
4
+ const files = await unchainedAPI.modules.files.findFiles({
5
+ _id: { $in: fileIds },
6
+ });
7
+ const fileMap = {};
8
+ for (const file of files) {
9
+ fileMap[file._id] = file;
10
+ }
11
+ return queries.map((q) => fileMap[q.fileId]);
12
+ });
13
+ //# sourceMappingURL=fileLoader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fileLoader.js","sourceRoot":"","sources":["../../src/loaders/fileLoader.ts"],"names":[],"mappings":"AAEA,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,eAAe,CAAC,YAA2B,EAAE,EAAE,CAC7C,IAAI,UAAU,CAA2B,KAAK,EAAE,OAAO,EAAE,EAAE;IACzD,MAAM,OAAO,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,yCAAyC;IAErH,MAAM,KAAK,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC;QACvD,GAAG,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE;KACtB,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,EAAE,CAAC;IACnB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;IAC3B,CAAC;IAED,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAC/C,CAAC,CAAC,CAAC"}