@unchainedshop/api 3.1.9 → 3.1.11

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 (127) 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/resolvers/mutations/accounts/changePassword.d.ts +2 -2
  6. package/lib/resolvers/mutations/accounts/changePassword.d.ts.map +1 -1
  7. package/lib/resolvers/mutations/accounts/changePassword.js +0 -6
  8. package/lib/resolvers/mutations/accounts/changePassword.js.map +1 -1
  9. package/lib/resolvers/mutations/accounts/loginWithWebAuthn.js +2 -2
  10. package/lib/resolvers/mutations/accounts/loginWithWebAuthn.js.map +1 -1
  11. package/lib/resolvers/mutations/accounts/resetPassword.d.ts +1 -1
  12. package/lib/resolvers/mutations/accounts/resetPassword.d.ts.map +1 -1
  13. package/lib/resolvers/mutations/accounts/resetPassword.js +0 -3
  14. package/lib/resolvers/mutations/accounts/resetPassword.js.map +1 -1
  15. package/lib/resolvers/mutations/accounts/setPassword.d.ts.map +1 -1
  16. package/lib/resolvers/mutations/accounts/setPassword.js +0 -3
  17. package/lib/resolvers/mutations/accounts/setPassword.js.map +1 -1
  18. package/lib/resolvers/mutations/users/setRoles.d.ts +1 -1
  19. package/lib/resolvers/mutations/users/setRoles.d.ts.map +1 -1
  20. package/lib/resolvers/mutations/users/setRoles.js +1 -1
  21. package/lib/resolvers/mutations/users/setRoles.js.map +1 -1
  22. package/lib/resolvers/mutations/users/setUserTags.d.ts +1 -1
  23. package/lib/resolvers/mutations/users/setUserTags.d.ts.map +1 -1
  24. package/lib/resolvers/mutations/users/setUserTags.js +1 -1
  25. package/lib/resolvers/mutations/users/setUserTags.js.map +1 -1
  26. package/lib/schema/mutation.js +3 -3
  27. package/package.json +1 -1
  28. package/src/errors.ts +0 -5
  29. package/src/resolvers/mutations/accounts/changePassword.ts +2 -9
  30. package/src/resolvers/mutations/accounts/loginWithWebAuthn.ts +2 -2
  31. package/src/resolvers/mutations/accounts/resetPassword.ts +1 -5
  32. package/src/resolvers/mutations/accounts/setPassword.ts +1 -3
  33. package/src/resolvers/mutations/users/setRoles.ts +1 -1
  34. package/src/resolvers/mutations/users/setUserTags.ts +1 -1
  35. package/src/schema/mutation.ts +3 -3
  36. package/lib/loaders/assortmentLinkLoader.d.ts +0 -12
  37. package/lib/loaders/assortmentLinkLoader.d.ts.map +0 -1
  38. package/lib/loaders/assortmentLinkLoader.js +0 -23
  39. package/lib/loaders/assortmentLinkLoader.js.map +0 -1
  40. package/lib/loaders/assortmentLinksLoader.d.ts +0 -14
  41. package/lib/loaders/assortmentLinksLoader.d.ts.map +0 -1
  42. package/lib/loaders/assortmentLinksLoader.js +0 -38
  43. package/lib/loaders/assortmentLinksLoader.js.map +0 -1
  44. package/lib/loaders/assortmentLoader.d.ts +0 -10
  45. package/lib/loaders/assortmentLoader.d.ts.map +0 -1
  46. package/lib/loaders/assortmentLoader.js +0 -15
  47. package/lib/loaders/assortmentLoader.js.map +0 -1
  48. package/lib/loaders/assortmentMediaTextLoader.d.ts +0 -12
  49. package/lib/loaders/assortmentMediaTextLoader.d.ts.map +0 -1
  50. package/lib/loaders/assortmentMediaTextLoader.js +0 -20
  51. package/lib/loaders/assortmentMediaTextLoader.js.map +0 -1
  52. package/lib/loaders/assortmentMediasLoader.d.ts +0 -10
  53. package/lib/loaders/assortmentMediasLoader.d.ts.map +0 -1
  54. package/lib/loaders/assortmentMediasLoader.js +0 -18
  55. package/lib/loaders/assortmentMediasLoader.js.map +0 -1
  56. package/lib/loaders/assortmentProductLoader.d.ts +0 -12
  57. package/lib/loaders/assortmentProductLoader.d.ts.map +0 -1
  58. package/lib/loaders/assortmentProductLoader.js +0 -14
  59. package/lib/loaders/assortmentProductLoader.js.map +0 -1
  60. package/lib/loaders/assortmentProductsLoader.d.ts +0 -10
  61. package/lib/loaders/assortmentProductsLoader.d.ts.map +0 -1
  62. package/lib/loaders/assortmentProductsLoader.js +0 -18
  63. package/lib/loaders/assortmentProductsLoader.js.map +0 -1
  64. package/lib/loaders/assortmentTextLoader.d.ts +0 -12
  65. package/lib/loaders/assortmentTextLoader.d.ts.map +0 -1
  66. package/lib/loaders/assortmentTextLoader.js +0 -20
  67. package/lib/loaders/assortmentTextLoader.js.map +0 -1
  68. package/lib/loaders/countryLoader.d.ts +0 -10
  69. package/lib/loaders/countryLoader.d.ts.map +0 -1
  70. package/lib/loaders/countryLoader.js +0 -14
  71. package/lib/loaders/countryLoader.js.map +0 -1
  72. package/lib/loaders/currencyLoader copy.d.ts +0 -10
  73. package/lib/loaders/currencyLoader copy.d.ts.map +0 -1
  74. package/lib/loaders/currencyLoader copy.js +0 -14
  75. package/lib/loaders/currencyLoader copy.js.map +0 -1
  76. package/lib/loaders/currencyLoader.d.ts +0 -10
  77. package/lib/loaders/currencyLoader.d.ts.map +0 -1
  78. package/lib/loaders/currencyLoader.js +0 -14
  79. package/lib/loaders/currencyLoader.js.map +0 -1
  80. package/lib/loaders/currencyLoaderByIsoCode.d.ts +0 -10
  81. package/lib/loaders/currencyLoaderByIsoCode.d.ts.map +0 -1
  82. package/lib/loaders/currencyLoaderByIsoCode.js +0 -13
  83. package/lib/loaders/currencyLoaderByIsoCode.js.map +0 -1
  84. package/lib/loaders/fileLoader.d.ts +0 -10
  85. package/lib/loaders/fileLoader.d.ts.map +0 -1
  86. package/lib/loaders/fileLoader.js +0 -13
  87. package/lib/loaders/fileLoader.js.map +0 -1
  88. package/lib/loaders/filterLoader.d.ts +0 -10
  89. package/lib/loaders/filterLoader.d.ts.map +0 -1
  90. package/lib/loaders/filterLoader.js +0 -14
  91. package/lib/loaders/filterLoader.js.map +0 -1
  92. package/lib/loaders/filterTextLoader.d.ts +0 -14
  93. package/lib/loaders/filterTextLoader.d.ts.map +0 -1
  94. package/lib/loaders/filterTextLoader.js +0 -20
  95. package/lib/loaders/filterTextLoader.js.map +0 -1
  96. package/lib/loaders/productLoader.d.ts +0 -10
  97. package/lib/loaders/productLoader.d.ts.map +0 -1
  98. package/lib/loaders/productLoader.js +0 -16
  99. package/lib/loaders/productLoader.js.map +0 -1
  100. package/lib/loaders/productLoaderBySKU.d.ts +0 -10
  101. package/lib/loaders/productLoaderBySKU.d.ts.map +0 -1
  102. package/lib/loaders/productLoaderBySKU.js +0 -16
  103. package/lib/loaders/productLoaderBySKU.js.map +0 -1
  104. package/lib/loaders/productMediaTextLoader.d.ts +0 -12
  105. package/lib/loaders/productMediaTextLoader.d.ts.map +0 -1
  106. package/lib/loaders/productMediaTextLoader.js +0 -20
  107. package/lib/loaders/productMediaTextLoader.js.map +0 -1
  108. package/lib/loaders/productMediasLoader.d.ts +0 -10
  109. package/lib/loaders/productMediasLoader.d.ts.map +0 -1
  110. package/lib/loaders/productMediasLoader.js +0 -18
  111. package/lib/loaders/productMediasLoader.js.map +0 -1
  112. package/lib/loaders/productTextLoader.d.ts +0 -12
  113. package/lib/loaders/productTextLoader.d.ts.map +0 -1
  114. package/lib/loaders/productTextLoader.js +0 -20
  115. package/lib/loaders/productTextLoader.js.map +0 -1
  116. package/lib/loaders/userLoader copy.d.ts +0 -10
  117. package/lib/loaders/userLoader copy.d.ts.map +0 -1
  118. package/lib/loaders/userLoader copy.js +0 -13
  119. package/lib/loaders/userLoader copy.js.map +0 -1
  120. package/lib/loaders/userLoader.d.ts +0 -10
  121. package/lib/loaders/userLoader.d.ts.map +0 -1
  122. package/lib/loaders/userLoader.js +0 -13
  123. package/lib/loaders/userLoader.js.map +0 -1
  124. package/lib/loaders/utils.d.ts +0 -7
  125. package/lib/loaders/utils.d.ts.map +0 -1
  126. package/lib/loaders/utils.js +0 -30
  127. package/lib/loaders/utils.js.map +0 -1
@@ -1,20 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,10 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,18 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,12 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,14 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,10 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,18 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,12 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,20 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,10 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,14 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,10 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,14 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,10 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,14 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,10 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,13 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,10 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,13 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,10 +0,0 @@
1
- import { UnchainedCore } from '@unchainedshop/core';
2
- import { Filter } from '@unchainedshop/core-filters';
3
- import DataLoader from 'dataloader';
4
- declare const _default: (unchainedAPI: UnchainedCore) => DataLoader<{
5
- filterId: string;
6
- }, Filter, {
7
- filterId: string;
8
- }>;
9
- export default _default;
10
- //# sourceMappingURL=filterLoader.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"filterLoader.d.ts","sourceRoot":"","sources":["../../src/loaders/filterLoader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,UAAU,MAAM,YAAY,CAAC;yBAEpB,cAAc,aAAa;cACd,MAAM;;cAAN,MAAM;;AADnC,wBAeK"}
@@ -1,14 +0,0 @@
1
- import DataLoader from 'dataloader';
2
- export default (unchainedAPI) => new DataLoader(async (queries) => {
3
- const filterIds = [...new Set(queries.map((q) => q.filterId).filter(Boolean))];
4
- const filters = await unchainedAPI.modules.filters.findFilters({
5
- filterIds,
6
- includeInactive: true,
7
- });
8
- const filterMap = {};
9
- for (const filter of filters) {
10
- filterMap[filter._id] = filter;
11
- }
12
- return queries.map((q) => filterMap[q.filterId]);
13
- });
14
- //# sourceMappingURL=filterLoader.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"filterLoader.js","sourceRoot":"","sources":["../../src/loaders/filterLoader.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,SAAS,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAE/E,MAAM,OAAO,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC;QAC7D,SAAS;QACT,eAAe,EAAE,IAAI;KACtB,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,EAAE,CAAC;IACrB,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC;IACjC,CAAC;IAED,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;AACnD,CAAC,CAAC,CAAC"}
@@ -1,14 +0,0 @@
1
- import { UnchainedCore } from '@unchainedshop/core';
2
- import DataLoader from 'dataloader';
3
- import { FilterText } from '@unchainedshop/core-filters';
4
- declare const _default: (unchainedAPI: UnchainedCore) => DataLoader<{
5
- filterId: string;
6
- filterOptionValue?: string;
7
- locale: string;
8
- }, FilterText, {
9
- filterId: string;
10
- filterOptionValue?: string;
11
- locale: string;
12
- }>;
13
- export default _default;
14
- //# sourceMappingURL=filterTextLoader.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"filterTextLoader.d.ts","sourceRoot":"","sources":["../../src/loaders/filterTextLoader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;yBAEzC,cAAc,aAAa;cACd,MAAM;wBAAsB,MAAM;YAAU,MAAM;;cAAlD,MAAM;wBAAsB,MAAM;YAAU,MAAM;;AAD/E,wBAyBI"}
@@ -1,20 +0,0 @@
1
- import DataLoader from 'dataloader';
2
- import { buildLocaleMap } from './utils.js';
3
- export default (unchainedAPI) => new DataLoader(async (queries) => {
4
- const filterIds = [...new Set(queries.map((q) => q.filterId).filter(Boolean))];
5
- const texts = await unchainedAPI.modules.filters.texts.findTexts({ filterId: { $in: filterIds } }, {
6
- sort: {
7
- filterId: 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.filterId + text.filterOptionValue] = text;
16
- }
17
- }
18
- return queries.map((q) => textsMap[q.locale + q.filterId + q.filterOptionValue]);
19
- });
20
- //# sourceMappingURL=filterTextLoader.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"filterTextLoader.js","sourceRoot":"","sources":["../../src/loaders/filterTextLoader.ts"],"names":[],"mappings":"AACA,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAG5C,eAAe,CAAC,YAA2B,EAAE,EAAE,CAC7C,IAAI,UAAU,CACZ,KAAK,EAAE,OAAO,EAAE,EAAE;IAChB,MAAM,SAAS,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAE/E,MAAM,KAAK,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,CAC9D,EAAE,QAAQ,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,EAChC;QACE,IAAI,EAAE;YACJ,QAAQ,EAAE,CAAC;SACZ;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,QAAQ,GAAG,IAAI,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAC;QACnE,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC;AACnF,CAAC,CACF,CAAC"}
@@ -1,10 +0,0 @@
1
- import { UnchainedCore } from '@unchainedshop/core';
2
- import { Product } from '@unchainedshop/core-products';
3
- import DataLoader from 'dataloader';
4
- declare const _default: (unchainedAPI: UnchainedCore) => DataLoader<{
5
- productId: string;
6
- }, Product, {
7
- productId: string;
8
- }>;
9
- export default _default;
10
- //# sourceMappingURL=productLoader.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"productLoader.d.ts","sourceRoot":"","sources":["../../src/loaders/productLoader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,UAAU,MAAM,YAAY,CAAC;yBAEpB,cAAc,aAAa;eACb,MAAM;;eAAN,MAAM;;AADpC,wBAiBK"}
@@ -1,16 +0,0 @@
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))]; // you don't need lodash, _.unique my ass
4
- const products = await unchainedAPI.modules.products.findProducts({
5
- productIds,
6
- productSelector: {
7
- status: { $exists: true },
8
- },
9
- });
10
- const productMap = {};
11
- for (const product of products) {
12
- productMap[product._id] = product;
13
- }
14
- return queries.map((q) => productMap[q.productId]);
15
- });
16
- //# sourceMappingURL=productLoader.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"productLoader.js","sourceRoot":"","sources":["../../src/loaders/productLoader.ts"],"names":[],"mappings":"AAEA,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,eAAe,CAAC,YAA2B,EAAE,EAAE,CAC7C,IAAI,UAAU,CAAiC,KAAK,EAAE,OAAO,EAAE,EAAE;IAC/D,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,CAAC,yCAAyC;IAE3H,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC;QAChE,UAAU;QACV,eAAe,EAAE;YACf,MAAM,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;SAC1B;KACF,CAAC,CAAC;IAEH,MAAM,UAAU,GAAG,EAAE,CAAC;IACtB,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC;IACpC,CAAC;IAED,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;AACrD,CAAC,CAAC,CAAC"}
@@ -1,10 +0,0 @@
1
- import { UnchainedCore } from '@unchainedshop/core';
2
- import { Product } from '@unchainedshop/core-products';
3
- import DataLoader from 'dataloader';
4
- declare const _default: (unchainedAPI: UnchainedCore) => DataLoader<{
5
- sku: string;
6
- }, Product, {
7
- sku: string;
8
- }>;
9
- export default _default;
10
- //# sourceMappingURL=productLoaderBySKU.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"productLoaderBySKU.d.ts","sourceRoot":"","sources":["../../src/loaders/productLoaderBySKU.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,UAAU,MAAM,YAAY,CAAC;yBAEpB,cAAc,aAAa;SACnB,MAAM;;SAAN,MAAM;;AAD9B,wBAiBK"}
@@ -1,16 +0,0 @@
1
- import DataLoader from 'dataloader';
2
- export default (unchainedAPI) => new DataLoader(async (queries) => {
3
- const skus = [...new Set(queries.map((q) => q.sku).filter(Boolean))]; // you don't need lodash, _.unique my ass
4
- const products = await unchainedAPI.modules.products.findProducts({
5
- productSelector: {
6
- 'warehousing.sku': { $in: skus },
7
- status: { $exists: true },
8
- },
9
- });
10
- const productMap = {};
11
- for (const product of products) {
12
- productMap[product.warehousing.sku] = product;
13
- }
14
- return queries.map((q) => productMap[q.sku]);
15
- });
16
- //# sourceMappingURL=productLoaderBySKU.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"productLoaderBySKU.js","sourceRoot":"","sources":["../../src/loaders/productLoaderBySKU.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,IAAI,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,yCAAyC;IAE/G,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC;QAChE,eAAe,EAAE;YACf,iBAAiB,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE;YAChC,MAAM,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;SAC1B;KACF,CAAC,CAAC;IAEH,MAAM,UAAU,GAAG,EAAE,CAAC;IACtB,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,UAAU,CAAC,OAAO,CAAC,WAAY,CAAC,GAAI,CAAC,GAAG,OAAO,CAAC;IAClD,CAAC;IAED,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/C,CAAC,CAAC,CAAC"}
@@ -1,12 +0,0 @@
1
- import { UnchainedCore } from '@unchainedshop/core';
2
- import DataLoader from 'dataloader';
3
- import { ProductMediaText } from '@unchainedshop/core-products';
4
- declare const _default: (unchainedAPI: UnchainedCore) => DataLoader<{
5
- productMediaId: string;
6
- locale: string;
7
- }, ProductMediaText, {
8
- productMediaId: string;
9
- locale: string;
10
- }>;
11
- export default _default;
12
- //# sourceMappingURL=productMediaTextLoader.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"productMediaTextLoader.d.ts","sourceRoot":"","sources":["../../src/loaders/productMediaTextLoader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;yBAEhD,cAAc,aAAa;oBACR,MAAM;YAAU,MAAM;;oBAAtB,MAAM;YAAU,MAAM;;AADzD,wBAuBK"}
@@ -1,20 +0,0 @@
1
- import DataLoader from 'dataloader';
2
- import { buildLocaleMap } from './utils.js';
3
- export default (unchainedAPI) => new DataLoader(async (queries) => {
4
- const productMediaIds = [...new Set(queries.map((q) => q.productMediaId).filter(Boolean))];
5
- const texts = await unchainedAPI.modules.products.media.texts.findMediaTexts({ productMediaId: { $in: productMediaIds } }, {
6
- sort: {
7
- productMediaId: 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.productMediaId] = text;
16
- }
17
- }
18
- return queries.map((q) => textsMap[q.locale + q.productMediaId]);
19
- });
20
- //# sourceMappingURL=productMediaTextLoader.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"productMediaTextLoader.js","sourceRoot":"","sources":["../../src/loaders/productMediaTextLoader.ts"],"names":[],"mappings":"AACA,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAG5C,eAAe,CAAC,YAA2B,EAAE,EAAE,CAC7C,IAAI,UAAU,CAA+D,KAAK,EAAE,OAAO,EAAE,EAAE;IAC7F,MAAM,eAAe,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAE3F,MAAM,KAAK,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,cAAc,CAC1E,EAAE,cAAc,EAAE,EAAE,GAAG,EAAE,eAAe,EAAE,EAAE,EAC5C;QACE,IAAI,EAAE;YACJ,cAAc,EAAE,CAAC;SAClB;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,cAAc,CAAC,GAAG,IAAI,CAAC;QAChD,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC;AACnE,CAAC,CAAC,CAAC"}
@@ -1,10 +0,0 @@
1
- import { UnchainedCore } from '@unchainedshop/core';
2
- import { ProductMedia } from '@unchainedshop/core-products';
3
- import DataLoader from 'dataloader';
4
- declare const _default: (unchainedAPI: UnchainedCore) => DataLoader<{
5
- productId?: string;
6
- }, ProductMedia[], {
7
- productId?: string;
8
- }>;
9
- export default _default;
10
- //# sourceMappingURL=productMediasLoader.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"productMediasLoader.d.ts","sourceRoot":"","sources":["../../src/loaders/productMediasLoader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,UAAU,MAAM,YAAY,CAAC;yBAEpB,cAAc,aAAa;gBACZ,MAAM;;gBAAN,MAAM;;AADrC,wBAgBK"}
@@ -1,18 +0,0 @@
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 productMediaItems = await unchainedAPI.modules.products.media.findProductMedias({
5
- productId: { $in: productIds },
6
- });
7
- const productMediaMap = {};
8
- for (const productMedia of productMediaItems) {
9
- if (!productMediaMap[productMedia.productId]) {
10
- productMediaMap[productMedia.productId] = [productMedia];
11
- }
12
- else {
13
- productMediaMap[productMedia.productId].push(productMedia);
14
- }
15
- }
16
- return queries.map((q) => productMediaMap[q.productId] || []);
17
- });
18
- //# sourceMappingURL=productMediasLoader.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"productMediasLoader.js","sourceRoot":"","sources":["../../src/loaders/productMediasLoader.ts"],"names":[],"mappings":"AAEA,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,eAAe,CAAC,YAA2B,EAAE,EAAE,CAC7C,IAAI,UAAU,CAAyC,KAAK,EAAE,OAAO,EAAE,EAAE;IACvE,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;IACjF,MAAM,iBAAiB,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,iBAAiB,CAAC;QACpF,SAAS,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE;KAC/B,CAAC,CAAC;IAEH,MAAM,eAAe,GAAG,EAAE,CAAC;IAC3B,KAAK,MAAM,YAAY,IAAI,iBAAiB,EAAE,CAAC;QAC7C,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,CAAC;YAC7C,eAAe,CAAC,YAAY,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAC3D,CAAC;aAAM,CAAC;YACN,eAAe,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC7D,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC;AAChE,CAAC,CAAC,CAAC"}