@medusajs/medusa 1.2.0 → 1.2.2-dev.53

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 (95) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/api/index.d.ts +1 -0
  3. package/dist/api/index.js +1 -0
  4. package/dist/api/index.js.map +1 -1
  5. package/dist/api/middlewares/error-handler.js +6 -0
  6. package/dist/api/middlewares/error-handler.js.map +1 -1
  7. package/dist/api/routes/admin/customer-groups/add-customers-batch.d.ts +27 -0
  8. package/dist/{db-subscribers/region.js → api/routes/admin/customer-groups/add-customers-batch.js} +60 -38
  9. package/dist/api/routes/admin/customer-groups/add-customers-batch.js.map +1 -0
  10. package/dist/api/routes/admin/customer-groups/get-customer-group-customers.d.ts +20 -0
  11. package/dist/{subscribers/region.js → api/routes/admin/customer-groups/get-customer-group-customers.js} +38 -27
  12. package/dist/api/routes/admin/customer-groups/get-customer-group-customers.js.map +1 -0
  13. package/dist/api/routes/admin/customer-groups/get-customer-group.d.ts +1 -1
  14. package/dist/api/routes/admin/customer-groups/get-customer-group.js +1 -1
  15. package/dist/api/routes/admin/customer-groups/index.d.ts +5 -0
  16. package/dist/api/routes/admin/customer-groups/index.js +8 -0
  17. package/dist/api/routes/admin/customer-groups/index.js.map +1 -1
  18. package/dist/api/routes/admin/customer-groups/list-customer-groups.d.ts +38 -0
  19. package/dist/api/routes/admin/customer-groups/list-customer-groups.js +200 -0
  20. package/dist/api/routes/admin/customer-groups/list-customer-groups.js.map +1 -0
  21. package/dist/api/routes/admin/customers/index.js +1 -1
  22. package/dist/api/routes/admin/customers/index.js.map +1 -1
  23. package/dist/api/routes/admin/customers/list-customers.js +12 -46
  24. package/dist/api/routes/admin/customers/list-customers.js.map +1 -1
  25. package/dist/api/routes/admin/discounts/update-discount.d.ts +2 -2
  26. package/dist/api/routes/admin/discounts/update-discount.js +3 -3
  27. package/dist/api/routes/admin/discounts/update-discount.js.map +1 -1
  28. package/dist/api/routes/admin/products/index.js +6 -0
  29. package/dist/api/routes/admin/products/index.js.map +1 -1
  30. package/dist/api/routes/store/auth/exists.js +4 -2
  31. package/dist/api/routes/store/auth/exists.js.map +1 -1
  32. package/dist/api/routes/store/products/list-products.d.ts +3 -1
  33. package/dist/api/routes/store/products/list-products.js +39 -4
  34. package/dist/api/routes/store/products/list-products.js.map +1 -1
  35. package/dist/api/routes/store/variants/list-variants.d.ts +4 -0
  36. package/dist/api/routes/store/variants/list-variants.js +33 -9
  37. package/dist/api/routes/store/variants/list-variants.js.map +1 -1
  38. package/dist/controllers/customers/index.d.ts +4 -0
  39. package/dist/controllers/customers/index.js +8 -0
  40. package/dist/controllers/customers/index.js.map +1 -0
  41. package/dist/controllers/customers/list-customers.d.ts +3 -0
  42. package/dist/controllers/customers/list-customers.js +96 -0
  43. package/dist/controllers/customers/list-customers.js.map +1 -0
  44. package/dist/models/customer.js +3 -1
  45. package/dist/models/customer.js.map +1 -1
  46. package/dist/repositories/customer-group.d.ts +1 -0
  47. package/dist/repositories/customer-group.js +24 -0
  48. package/dist/repositories/customer-group.js.map +1 -1
  49. package/dist/repositories/customer.d.ts +1 -0
  50. package/dist/repositories/customer.js +65 -0
  51. package/dist/repositories/customer.js.map +1 -1
  52. package/dist/repositories/product.d.ts +1 -0
  53. package/dist/repositories/product.js +6 -2
  54. package/dist/repositories/product.js.map +1 -1
  55. package/dist/services/customer-group.d.ts +24 -1
  56. package/dist/services/customer-group.js +95 -2
  57. package/dist/services/customer-group.js.map +1 -1
  58. package/dist/services/customer.d.ts +1 -3
  59. package/dist/services/customer.js +40 -44
  60. package/dist/services/customer.js.map +1 -1
  61. package/dist/services/discount.js +17 -9
  62. package/dist/services/discount.js.map +1 -1
  63. package/dist/services/product-collection.js +29 -8
  64. package/dist/services/product-collection.js.map +1 -1
  65. package/dist/services/product.js +38 -26
  66. package/dist/services/product.js.map +1 -1
  67. package/dist/services/region.js +1 -0
  68. package/dist/services/region.js.map +1 -1
  69. package/dist/types/customer-groups.d.ts +5 -1
  70. package/dist/types/customer-groups.js +25 -0
  71. package/dist/types/customer-groups.js.map +1 -1
  72. package/dist/types/customers.d.ts +1 -0
  73. package/dist/types/customers.js +5 -0
  74. package/dist/types/customers.js.map +1 -1
  75. package/dist/types/product-variant.d.ts +2 -2
  76. package/dist/types/product-variant.js +4 -4
  77. package/dist/types/product-variant.js.map +1 -1
  78. package/dist/utils/exception-formatter.d.ts +5 -0
  79. package/dist/utils/exception-formatter.js +29 -0
  80. package/dist/utils/exception-formatter.js.map +1 -0
  81. package/package.json +7 -7
  82. package/yarn-error.log +79 -5
  83. package/dist/api/routes/admin/orders/receive-swap.d.ts +0 -46
  84. package/dist/api/routes/admin/orders/receive-swap.js +0 -159
  85. package/dist/api/routes/admin/orders/receive-swap.js.map +0 -1
  86. package/dist/db-subscribers/region.d.ts +0 -6
  87. package/dist/db-subscribers/region.js.map +0 -1
  88. package/dist/entity-subscribers/region.d.ts +0 -6
  89. package/dist/entity-subscribers/region.js +0 -27
  90. package/dist/entity-subscribers/region.js.map +0 -1
  91. package/dist/loaders/db-subscribers.d.ts +0 -6
  92. package/dist/loaders/db-subscribers.js +0 -53
  93. package/dist/loaders/db-subscribers.js.map +0 -1
  94. package/dist/subscribers/region.d.ts +0 -14
  95. package/dist/subscribers/region.js.map +0 -1
@@ -1,5 +1,6 @@
1
1
  import { DeleteResult, Repository } from "typeorm";
2
2
  import { CustomerGroup } from "../models/customer-group";
3
3
  export declare class CustomerGroupRepository extends Repository<CustomerGroup> {
4
+ addCustomers(groupId: string, customerIds: string[]): Promise<CustomerGroup>;
4
5
  removeCustomers(groupId: string, customerIds: string[]): Promise<DeleteResult>;
5
6
  }
@@ -65,6 +65,30 @@ var CustomerGroupRepository = /** @class */ (function (_super) {
65
65
  function CustomerGroupRepository() {
66
66
  return _super !== null && _super.apply(this, arguments) || this;
67
67
  }
68
+ CustomerGroupRepository.prototype.addCustomers = function (groupId, customerIds) {
69
+ return __awaiter(this, void 0, void 0, function () {
70
+ var customerGroup;
71
+ return __generator(this, function (_a) {
72
+ switch (_a.label) {
73
+ case 0: return [4 /*yield*/, this.findOne(groupId)];
74
+ case 1:
75
+ customerGroup = _a.sent();
76
+ return [4 /*yield*/, this.createQueryBuilder()
77
+ .insert()
78
+ .into("customer_group_customers")
79
+ .values(customerIds.map(function (id) { return ({
80
+ customer_id: id,
81
+ customer_group_id: groupId,
82
+ }); }))
83
+ .orIgnore()
84
+ .execute()];
85
+ case 2:
86
+ _a.sent();
87
+ return [2 /*return*/, customerGroup];
88
+ }
89
+ });
90
+ });
91
+ };
68
92
  CustomerGroupRepository.prototype.removeCustomers = function (groupId, customerIds) {
69
93
  return __awaiter(this, void 0, void 0, function () {
70
94
  return __generator(this, function (_a) {
@@ -1 +1 @@
1
- {"version":3,"file":"customer-group.js","sourceRoot":"","sources":["../../src/repositories/customer-group.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAwE;AACxE,2DAAwD;AAGxD;IAA6C,2CAAyB;IAAtE;;IAcA,CAAC;IAbO,iDAAe,GAArB,UACE,OAAe,EACf,WAAqB;;;;4BAEd,qBAAM,IAAI,CAAC,kBAAkB,EAAE;6BACnC,MAAM,EAAE;6BACR,IAAI,CAAC,0BAA0B,CAAC;6BAChC,KAAK,CAAC;4BACL,iBAAiB,EAAE,OAAO;4BAC1B,WAAW,EAAE,IAAA,YAAE,EAAC,WAAW,CAAC;yBAC7B,CAAC;6BACD,OAAO,EAAE,EAAA;4BAPZ,sBAAO,SAOK,EAAA;;;;KACb;IAbU,uBAAuB;QADnC,IAAA,0BAAgB,EAAC,8BAAa,CAAC;OACnB,uBAAuB,CAcnC;IAAD,8BAAC;CAAA,AAdD,CAA6C,oBAAU,GActD;AAdY,0DAAuB"}
1
+ {"version":3,"file":"customer-group.js","sourceRoot":"","sources":["../../src/repositories/customer-group.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAwE;AACxE,2DAAwD;AAGxD;IAA6C,2CAAyB;IAAtE;;IAmCA,CAAC;IAlCO,8CAAY,GAAlB,UACE,OAAe,EACf,WAAqB;;;;;4BAEC,qBAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAA;;wBAA3C,aAAa,GAAG,SAA2B;wBAEjD,qBAAM,IAAI,CAAC,kBAAkB,EAAE;iCAC5B,MAAM,EAAE;iCACR,IAAI,CAAC,0BAA0B,CAAC;iCAChC,MAAM,CACL,WAAW,CAAC,GAAG,CAAC,UAAC,EAAE,IAAK,OAAA,CAAC;gCACvB,WAAW,EAAE,EAAE;gCACf,iBAAiB,EAAE,OAAO;6BAC3B,CAAC,EAHsB,CAGtB,CAAC,CACJ;iCACA,QAAQ,EAAE;iCACV,OAAO,EAAE,EAAA;;wBAVZ,SAUY,CAAA;wBAEZ,sBAAO,aAA8B,EAAA;;;;KACtC;IAEK,iDAAe,GAArB,UACE,OAAe,EACf,WAAqB;;;;4BAEd,qBAAM,IAAI,CAAC,kBAAkB,EAAE;6BACnC,MAAM,EAAE;6BACR,IAAI,CAAC,0BAA0B,CAAC;6BAChC,KAAK,CAAC;4BACL,iBAAiB,EAAE,OAAO;4BAC1B,WAAW,EAAE,IAAA,YAAE,EAAC,WAAW,CAAC;yBAC7B,CAAC;6BACD,OAAO,EAAE,EAAA;4BAPZ,sBAAO,SAOK,EAAA;;;;KACb;IAlCU,uBAAuB;QADnC,IAAA,0BAAgB,EAAC,8BAAa,CAAC;OACnB,uBAAuB,CAmCnC;IAAD,8BAAC;CAAA,AAnCD,CAA6C,oBAAU,GAmCtD;AAnCY,0DAAuB"}
@@ -1,4 +1,5 @@
1
1
  import { Repository } from "typeorm";
2
2
  import { Customer } from "../models/customer";
3
3
  export declare class CustomerRepository extends Repository<Customer> {
4
+ listAndCount(query: any): Promise<[Customer[], number]>;
4
5
  }
@@ -20,6 +20,42 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
20
20
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
21
  return c > 3 && r && Object.defineProperty(target, key, r), r;
22
22
  };
23
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
24
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
25
+ return new (P || (P = Promise))(function (resolve, reject) {
26
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
27
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
28
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
29
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
30
+ });
31
+ };
32
+ var __generator = (this && this.__generator) || function (thisArg, body) {
33
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
34
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
35
+ function verb(n) { return function (v) { return step([n, v]); }; }
36
+ function step(op) {
37
+ if (f) throw new TypeError("Generator is already executing.");
38
+ while (_) try {
39
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
40
+ if (y = 0, t) op = [op[0] & 2, t.value];
41
+ switch (op[0]) {
42
+ case 0: case 1: t = op; break;
43
+ case 4: _.label++; return { value: op[1], done: false };
44
+ case 5: _.label++; y = op[1]; op = [0]; continue;
45
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
46
+ default:
47
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
48
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
49
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
50
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
51
+ if (t[2]) _.ops.pop();
52
+ _.trys.pop(); continue;
53
+ }
54
+ op = body.call(thisArg, _);
55
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
56
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
57
+ }
58
+ };
23
59
  Object.defineProperty(exports, "__esModule", { value: true });
24
60
  exports.CustomerRepository = void 0;
25
61
  var typeorm_1 = require("typeorm");
@@ -29,6 +65,35 @@ var CustomerRepository = /** @class */ (function (_super) {
29
65
  function CustomerRepository() {
30
66
  return _super !== null && _super.apply(this, arguments) || this;
31
67
  }
68
+ CustomerRepository.prototype.listAndCount = function (query) {
69
+ var _a, _b, _c;
70
+ return __awaiter(this, void 0, void 0, function () {
71
+ var groups, qb;
72
+ return __generator(this, function (_d) {
73
+ switch (_d.label) {
74
+ case 0:
75
+ groups = (_a = query === null || query === void 0 ? void 0 : query.where) === null || _a === void 0 ? void 0 : _a.groups;
76
+ (_b = query === null || query === void 0 ? void 0 : query.where) === null || _b === void 0 ? true : delete _b.groups;
77
+ qb = this.createQueryBuilder("customer")
78
+ .where(query.where)
79
+ .skip(query.skip)
80
+ .take(query.take);
81
+ if (groups) {
82
+ qb = qb
83
+ .leftJoinAndSelect("customer.groups", "group")
84
+ .andWhere("group.id IN (:...ids)", { ids: groups.value });
85
+ }
86
+ if ((_c = query.relations) === null || _c === void 0 ? void 0 : _c.length) {
87
+ query.relations.forEach(function (rel) {
88
+ qb = qb.leftJoinAndSelect("customer.".concat(rel), rel);
89
+ });
90
+ }
91
+ return [4 /*yield*/, qb.getManyAndCount()];
92
+ case 1: return [2 /*return*/, _d.sent()];
93
+ }
94
+ });
95
+ });
96
+ };
32
97
  CustomerRepository = __decorate([
33
98
  (0, typeorm_1.EntityRepository)(customer_1.Customer)
34
99
  ], CustomerRepository);
@@ -1 +1 @@
1
- {"version":3,"file":"customer.js","sourceRoot":"","sources":["../../src/repositories/customer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAsD;AACtD,+CAA6C;AAG7C;IAAwC,sCAAoB;IAA5D;;IAA8D,CAAC;IAAlD,kBAAkB;QAD9B,IAAA,0BAAgB,EAAC,mBAAQ,CAAC;OACd,kBAAkB,CAAgC;IAAD,yBAAC;CAAA,AAA/D,CAAwC,oBAAU,GAAa;AAAlD,gDAAkB"}
1
+ {"version":3,"file":"customer.js","sourceRoot":"","sources":["../../src/repositories/customer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAsD;AACtD,+CAA6C;AAG7C;IAAwC,sCAAoB;IAA5D;;IAwBA,CAAC;IAvBO,yCAAY,GAAlB,UAAmB,KAAK;;;;;;;wBAChB,MAAM,GAAG,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,KAAK,0CAAE,MAAM,CAAA;wBAC5B,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,KAAK,+CAAE,MAAM,CAAA;wBAEvB,EAAE,GAAG,IAAI,CAAC,kBAAkB,CAAC,UAAU,CAAC;6BACzC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC;6BAClB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;6BAChB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;wBAEnB,IAAI,MAAM,EAAE;4BACV,EAAE,GAAG,EAAE;iCACJ,iBAAiB,CAAC,iBAAiB,EAAE,OAAO,CAAC;iCAC7C,QAAQ,CAAC,uBAAuB,EAAE,EAAE,GAAG,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAA;yBAC5D;wBAED,IAAI,MAAA,KAAK,CAAC,SAAS,0CAAE,MAAM,EAAE;4BAC3B,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,UAAC,GAAG;gCAC1B,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,mBAAY,GAAG,CAAE,EAAE,GAAG,CAAC,CAAA;4BACnD,CAAC,CAAC,CAAA;yBACH;wBAEM,qBAAM,EAAE,CAAC,eAAe,EAAE,EAAA;4BAAjC,sBAAO,SAA0B,EAAA;;;;KAClC;IAvBU,kBAAkB;QAD9B,IAAA,0BAAgB,EAAC,mBAAQ,CAAC;OACd,kBAAkB,CAwB9B;IAAD,yBAAC;CAAA,AAxBD,CAAwC,oBAAU,GAwBjD;AAxBY,gDAAkB"}
@@ -3,6 +3,7 @@ import { ProductTag } from "..";
3
3
  import { Product } from "../models/product";
4
4
  declare type DefaultWithoutRelations = Omit<FindManyOptions<Product>, "relations">;
5
5
  declare type CustomOptions = {
6
+ select?: DefaultWithoutRelations["select"];
6
7
  where?: DefaultWithoutRelations["where"] & {
7
8
  tags?: FindOperator<ProductTag>;
8
9
  };
@@ -177,8 +177,9 @@ var ProductRepository = /** @class */ (function (_super) {
177
177
  }
178
178
  return groupedRelations;
179
179
  };
180
- ProductRepository.prototype.queryProductsWithIds = function (entityIds, groupedRelations, withDeleted) {
180
+ ProductRepository.prototype.queryProductsWithIds = function (entityIds, groupedRelations, withDeleted, select) {
181
181
  if (withDeleted === void 0) { withDeleted = false; }
182
+ if (select === void 0) { select = []; }
182
183
  return __awaiter(this, void 0, void 0, function () {
183
184
  var entitiesIdsWithRelations;
184
185
  var _this = this;
@@ -188,6 +189,9 @@ var ProductRepository = /** @class */ (function (_super) {
188
189
  var e_2, _b;
189
190
  var _c = __read(_a, 2), toplevel = _c[0], rels = _c[1];
190
191
  var querybuilder = _this.createQueryBuilder("products");
192
+ if (select && select.length) {
193
+ querybuilder.select(select.map(function (f) { return "products.".concat(f); }));
194
+ }
191
195
  if (toplevel === "variants") {
192
196
  querybuilder = querybuilder
193
197
  .leftJoinAndSelect("products.".concat(toplevel), toplevel, "variants.deleted_at IS NULL")
@@ -276,7 +280,7 @@ var ProductRepository = /** @class */ (function (_super) {
276
280
  return [2 /*return*/, [toReturn, toReturn.length]];
277
281
  case 6:
278
282
  groupedRelations = this.getGroupedRelations(relations);
279
- return [4 /*yield*/, this.queryProductsWithIds(entitiesIds, groupedRelations, idsOrOptionsWithoutRelations.withDeleted)];
283
+ return [4 /*yield*/, this.queryProductsWithIds(entitiesIds, groupedRelations, idsOrOptionsWithoutRelations.withDeleted, idsOrOptionsWithoutRelations.select)];
280
284
  case 7:
281
285
  entitiesIdsWithRelations = _b.sent();
282
286
  entitiesAndRelations = entitiesIdsWithRelations.concat(entities);
@@ -1 +1 @@
1
- {"version":3,"file":"product.js","sourceRoot":"","sources":["../../src/repositories/product.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAAqD;AACrD,mCAOgB;AAEhB,6CAA2C;AAiB3C;IAAuC,qCAAmB;IAA1D;;IAqQA,CAAC;IApQS,sDAA0B,GAAlC,UACE,oBAA6C;QAE7C,IAAM,wBAAwB,GAAG,IAAA,gBAAO,EAAC,oBAAoB,EAAE,IAAI,CAAC,CAAA;QACpE,OAAO,IAAA,YAAG,EAAC,wBAAwB,EAAE,UAAC,kBAAkB;YACtD,OAAA,cAAK,8BAAC,EAAE,UAAK,kBAAkB;QAA/B,CAAgC,CACjC,CAAA;IACH,CAAC;IAEa,yCAAa,GAA3B,UACE,uBAAiD,EACjD,WAAmB;;QAAnB,4BAAA,EAAA,mBAAmB;;;;;;wBAEb,IAAI,GAAG,MAAA,uBAAuB,aAAvB,uBAAuB,uBAAvB,uBAAuB,CAAE,KAAK,0CAAE,IAAI,CAAA;wBAC1C,MAAA,uBAAuB,aAAvB,uBAAuB,uBAAvB,uBAAuB,CAAE,KAAK,+CAAE,IAAI,CAAA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,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,EAAA;;;;KAClC;IAEY,oDAAwB,GAArC,UACE,UAAoB,EACpB,YAAoB;;;;4BAEpB,qBAAM,IAAI,CAAC,kBAAkB,EAAE;6BAC5B,MAAM,CAAC,iBAAO,CAAC;6BACf,GAAG,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;6BAC5B,KAAK,CAAC,EAAE,EAAE,EAAE,IAAA,YAAE,EAAC,UAAU,CAAC,EAAE,aAAa,EAAE,YAAY,EAAE,CAAC;6BAC1D,OAAO,EAAE,EAAA;;wBAJZ,SAIY,CAAA;wBAEZ,sBAAO,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,EAAA;;;;KAClC;IAtQU,iBAAiB;QAD7B,IAAA,0BAAgB,EAAC,iBAAO,CAAC;OACb,iBAAiB,CAuQ7B;IAAD,wBAAC;CAAA,AAvQD,CAAuC,oBAAU,GAuQhD;AAvQY,8CAAiB"}
@@ -1,5 +1,6 @@
1
1
  import { BaseService } from "medusa-interfaces";
2
2
  import { DeepPartial, EntityManager } from "typeorm";
3
+ import { CustomerService } from ".";
3
4
  import { CustomerGroup } from "..";
4
5
  import { CustomerGroupRepository } from "../repositories/customer-group";
5
6
  import { FindConfig } from "../types/common";
@@ -7,11 +8,17 @@ import { CustomerGroupUpdate, FilterableCustomerGroupProps } from "../types/cust
7
8
  declare type CustomerGroupConstructorProps = {
8
9
  manager: EntityManager;
9
10
  customerGroupRepository: typeof CustomerGroupRepository;
11
+ customerService: CustomerService;
10
12
  };
13
+ /**
14
+ * Provides layer to manipulate discounts.
15
+ * @implements {BaseService}
16
+ */
11
17
  declare class CustomerGroupService extends BaseService {
12
18
  private manager_;
13
19
  private customerGroupRepository_;
14
- constructor({ manager, customerGroupRepository, }: CustomerGroupConstructorProps);
20
+ private customerService_;
21
+ constructor({ manager, customerGroupRepository, customerService, }: CustomerGroupConstructorProps);
15
22
  withTransaction(transactionManager: EntityManager): CustomerGroupService;
16
23
  retrieve(id: string, config?: {}): Promise<CustomerGroup>;
17
24
  /**
@@ -20,11 +27,19 @@ declare class CustomerGroupService extends BaseService {
20
27
  * @return {Promise} the result of the create operation
21
28
  */
22
29
  create(group: DeepPartial<CustomerGroup>): Promise<CustomerGroup>;
30
+ /**
31
+ * Add a batch of customers to a customer group at once
32
+ * @param {string} id id of the customer group to add customers to
33
+ * @param {string[]} customerIds customer id's to add to the group
34
+ * @return {Promise<CustomerGroup>} the customer group after insertion
35
+ */
36
+ addCustomers(id: string, customerIds: string | string[]): Promise<CustomerGroup>;
23
37
  /**
24
38
  * Update a customer group.
25
39
  *
26
40
  * @param {string} customerGroupId - id of the customer group
27
41
  * @param {CustomerGroupUpdate} update - customer group partial data
42
+ * @returns resulting customer group
28
43
  */
29
44
  update(customerGroupId: string, update: CustomerGroupUpdate): Promise<CustomerGroup[]>;
30
45
  /**
@@ -42,6 +57,14 @@ declare class CustomerGroupService extends BaseService {
42
57
  * @return {Promise} the result of the find operation
43
58
  */
44
59
  list(selector: FilterableCustomerGroupProps | undefined, config: FindConfig<CustomerGroup>): Promise<CustomerGroup[]>;
60
+ /**
61
+ * Retrieve a list of customer groups and total count of records that match the query.
62
+ *
63
+ * @param {Object} selector - the query object for find
64
+ * @param {Object} config - the config to be used for find
65
+ * @return {Promise} the result of the find operation
66
+ */
67
+ listAndCount(selector: FilterableCustomerGroupProps | undefined, config: FindConfig<CustomerGroup>): Promise<[CustomerGroup[], number]>;
45
68
  /**
46
69
  * Remove list of customers from a customergroup
47
70
  *
@@ -64,13 +64,21 @@ var __rest = (this && this.__rest) || function (s, e) {
64
64
  Object.defineProperty(exports, "__esModule", { value: true });
65
65
  var medusa_core_utils_1 = require("medusa-core-utils");
66
66
  var medusa_interfaces_1 = require("medusa-interfaces");
67
+ var typeorm_1 = require("typeorm");
68
+ var exception_formatter_1 = require("../utils/exception-formatter");
69
+ /**
70
+ * Provides layer to manipulate discounts.
71
+ * @implements {BaseService}
72
+ */
67
73
  var CustomerGroupService = /** @class */ (function (_super) {
68
74
  __extends(CustomerGroupService, _super);
69
75
  function CustomerGroupService(_a) {
70
- var manager = _a.manager, customerGroupRepository = _a.customerGroupRepository;
76
+ var manager = _a.manager, customerGroupRepository = _a.customerGroupRepository, customerService = _a.customerService;
71
77
  var _this = _super.call(this) || this;
72
78
  _this.manager_ = manager;
73
79
  _this.customerGroupRepository_ = customerGroupRepository;
80
+ /** @private @const {CustomerGroupService} */
81
+ _this.customerService_ = customerService;
74
82
  return _this;
75
83
  }
76
84
  CustomerGroupService.prototype.withTransaction = function (transactionManager) {
@@ -80,6 +88,7 @@ var CustomerGroupService = /** @class */ (function (_super) {
80
88
  var cloned = new CustomerGroupService({
81
89
  manager: transactionManager,
82
90
  customerGroupRepository: this.customerGroupRepository_,
91
+ customerService: this.customerService_,
83
92
  });
84
93
  cloned.transactionManager_ = transactionManager;
85
94
  return cloned;
@@ -98,7 +107,7 @@ var CustomerGroupService = /** @class */ (function (_super) {
98
107
  case 1:
99
108
  customerGroup = _a.sent();
100
109
  if (!customerGroup) {
101
- throw new medusa_core_utils_1.MedusaError(medusa_core_utils_1.MedusaError.Types.NOT_FOUND, "CustomerGroup with ".concat(id, " was not found"));
110
+ throw new medusa_core_utils_1.MedusaError(medusa_core_utils_1.MedusaError.Types.NOT_FOUND, "CustomerGroup with id ".concat(id, " was not found"));
102
111
  }
103
112
  return [2 /*return*/, customerGroup];
104
113
  }
@@ -139,11 +148,62 @@ var CustomerGroupService = /** @class */ (function (_super) {
139
148
  });
140
149
  });
141
150
  };
151
+ /**
152
+ * Add a batch of customers to a customer group at once
153
+ * @param {string} id id of the customer group to add customers to
154
+ * @param {string[]} customerIds customer id's to add to the group
155
+ * @return {Promise<CustomerGroup>} the customer group after insertion
156
+ */
157
+ CustomerGroupService.prototype.addCustomers = function (id, customerIds) {
158
+ return __awaiter(this, void 0, void 0, function () {
159
+ var ids;
160
+ var _this = this;
161
+ return __generator(this, function (_a) {
162
+ if (typeof customerIds === "string") {
163
+ ids = [customerIds];
164
+ }
165
+ else {
166
+ ids = customerIds;
167
+ }
168
+ return [2 /*return*/, this.atomicPhase_(function (manager) { return __awaiter(_this, void 0, void 0, function () {
169
+ var cgRepo;
170
+ return __generator(this, function (_a) {
171
+ switch (_a.label) {
172
+ case 0:
173
+ cgRepo = manager.getCustomRepository(this.customerGroupRepository_);
174
+ return [4 /*yield*/, cgRepo.addCustomers(id, ids)];
175
+ case 1: return [2 /*return*/, _a.sent()];
176
+ }
177
+ });
178
+ }); }, function (error) { return __awaiter(_this, void 0, void 0, function () {
179
+ var existingCustomers_1, nonExistingCustomers;
180
+ return __generator(this, function (_a) {
181
+ switch (_a.label) {
182
+ case 0:
183
+ if (!(error.code === "23503")) return [3 /*break*/, 3];
184
+ return [4 /*yield*/, this.retrieve(id)];
185
+ case 1:
186
+ _a.sent();
187
+ return [4 /*yield*/, this.customerService_.list({
188
+ id: ids,
189
+ })];
190
+ case 2:
191
+ existingCustomers_1 = _a.sent();
192
+ nonExistingCustomers = ids.filter(function (cId) { return existingCustomers_1.findIndex(function (el) { return el.id === cId; }) === -1; });
193
+ throw new medusa_core_utils_1.MedusaError(medusa_core_utils_1.MedusaError.Types.NOT_FOUND, "The following customer ids do not exist: ".concat(JSON.stringify(nonExistingCustomers.join(", "))));
194
+ case 3: throw (0, exception_formatter_1.formatException)(error);
195
+ }
196
+ });
197
+ }); })];
198
+ });
199
+ });
200
+ };
142
201
  /**
143
202
  * Update a customer group.
144
203
  *
145
204
  * @param {string} customerGroupId - id of the customer group
146
205
  * @param {CustomerGroupUpdate} update - customer group partial data
206
+ * @returns resulting customer group
147
207
  */
148
208
  CustomerGroupService.prototype.update = function (customerGroupId, update) {
149
209
  return __awaiter(this, void 0, void 0, function () {
@@ -228,6 +288,39 @@ var CustomerGroupService = /** @class */ (function (_super) {
228
288
  });
229
289
  });
230
290
  };
291
+ /**
292
+ * Retrieve a list of customer groups and total count of records that match the query.
293
+ *
294
+ * @param {Object} selector - the query object for find
295
+ * @param {Object} config - the config to be used for find
296
+ * @return {Promise} the result of the find operation
297
+ */
298
+ CustomerGroupService.prototype.listAndCount = function (selector, config) {
299
+ if (selector === void 0) { selector = {}; }
300
+ return __awaiter(this, void 0, void 0, function () {
301
+ var cgRepo, q, query, where_1;
302
+ return __generator(this, function (_a) {
303
+ switch (_a.label) {
304
+ case 0:
305
+ cgRepo = this.manager_.getCustomRepository(this.customerGroupRepository_);
306
+ if ("q" in selector) {
307
+ q = selector.q;
308
+ delete selector.q;
309
+ }
310
+ query = this.buildQuery_(selector, config);
311
+ if (q) {
312
+ where_1 = query.where;
313
+ delete where_1.name;
314
+ query.where = function (qb) {
315
+ qb.where(where_1).andWhere([{ name: (0, typeorm_1.ILike)("%".concat(q, "%")) }]);
316
+ };
317
+ }
318
+ return [4 /*yield*/, cgRepo.findAndCount(query)];
319
+ case 1: return [2 /*return*/, _a.sent()];
320
+ }
321
+ });
322
+ });
323
+ };
231
324
  /**
232
325
  * Remove list of customers from a customergroup
233
326
  *
@@ -1 +1 @@
1
- {"version":3,"file":"customer-group.js","sourceRoot":"","sources":["../../src/services/customer-group.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAA+C;AAC/C,uDAA+C;AAc/C;IAAmC,wCAAW;IAK5C,8BAAY,EAGoB;YAF9B,OAAO,aAAA,EACP,uBAAuB,6BAAA;QAFzB,YAIE,iBAAO,SAKR;QAHC,KAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;QAEvB,KAAI,CAAC,wBAAwB,GAAG,uBAAuB,CAAA;;IACzD,CAAC;IAED,8CAAe,GAAf,UAAgB,kBAAiC;QAC/C,IAAI,CAAC,kBAAkB,EAAE;YACvB,OAAO,IAAI,CAAA;SACZ;QAED,IAAM,MAAM,GAAG,IAAI,oBAAoB,CAAC;YACtC,OAAO,EAAE,kBAAkB;YAC3B,uBAAuB,EAAE,IAAI,CAAC,wBAAw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+12,11 @@ declare class CustomerService extends CustomerService_base implements BaseServic
12
12
  CREATED: string;
13
13
  UPDATED: string;
14
14
  };
15
- constructor({ manager, customerRepository, eventBusService, addressRepository, customerGroupService, }: {
15
+ constructor({ manager, customerRepository, eventBusService, addressRepository, }: {
16
16
  manager: any;
17
17
  customerRepository: any;
18
18
  eventBusService: any;
19
19
  addressRepository: any;
20
- customerGroupService: any;
21
20
  });
22
21
  /** @private @const {EntityManager} */
23
22
  private manager_;
@@ -27,7 +26,6 @@ declare class CustomerService extends CustomerService_base implements BaseServic
27
26
  private eventBus_;
28
27
  /** @private @const {AddressRepository} */
29
28
  private addressRepository_;
30
- customerGroupService_: any;
31
29
  withTransaction(transactionManager: any): CustomerService;
32
30
  /**
33
31
  * Used to validate customer email.