@medusajs/medusa 1.1.62 → 1.1.63-adminc.21

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 (150) hide show
  1. package/dist/api/routes/admin/collections/list-collections.d.ts +16 -3
  2. package/dist/api/routes/admin/collections/list-collections.js +88 -10
  3. package/dist/api/routes/admin/collections/list-collections.js.map +1 -1
  4. package/dist/api/routes/admin/discounts/list-discounts.d.ts +6 -0
  5. package/dist/api/routes/admin/discounts/list-discounts.js +45 -8
  6. package/dist/api/routes/admin/discounts/list-discounts.js.map +1 -1
  7. package/dist/api/routes/admin/orders/list-orders.js +1 -1
  8. package/dist/api/routes/admin/orders/list-orders.js.map +1 -1
  9. package/dist/api/routes/admin/products/list-products.js +1 -2
  10. package/dist/api/routes/admin/products/list-products.js.map +1 -1
  11. package/dist/api/routes/admin/tax-rates/add-to-product-types.d.ts +29 -0
  12. package/dist/api/routes/admin/tax-rates/add-to-product-types.js +177 -0
  13. package/dist/api/routes/admin/tax-rates/add-to-product-types.js.map +1 -0
  14. package/dist/api/routes/admin/tax-rates/add-to-products.d.ts +29 -0
  15. package/dist/api/routes/admin/tax-rates/add-to-products.js +173 -0
  16. package/dist/api/routes/admin/tax-rates/add-to-products.js.map +1 -0
  17. package/dist/api/routes/admin/tax-rates/add-to-shipping-options.d.ts +29 -0
  18. package/dist/api/routes/admin/tax-rates/add-to-shipping-options.js +177 -0
  19. package/dist/api/routes/admin/tax-rates/add-to-shipping-options.js.map +1 -0
  20. package/dist/api/routes/admin/tax-rates/create-tax-rate.d.ts +35 -0
  21. package/dist/api/routes/admin/tax-rates/create-tax-rate.js +286 -0
  22. package/dist/api/routes/admin/tax-rates/create-tax-rate.js.map +1 -0
  23. package/dist/api/routes/admin/tax-rates/delete-tax-rate.d.ts +28 -0
  24. package/dist/api/routes/admin/tax-rates/delete-tax-rate.js +84 -0
  25. package/dist/api/routes/admin/tax-rates/delete-tax-rate.js.map +1 -0
  26. package/dist/api/routes/admin/tax-rates/get-tax-rate.d.ts +26 -0
  27. package/dist/api/routes/admin/tax-rates/get-tax-rate.js +106 -0
  28. package/dist/api/routes/admin/tax-rates/get-tax-rate.js.map +1 -0
  29. package/dist/api/routes/admin/tax-rates/index.d.ts +21 -0
  30. package/dist/api/routes/admin/tax-rates/index.js +74 -0
  31. package/dist/api/routes/admin/tax-rates/index.js.map +1 -0
  32. package/dist/api/routes/admin/tax-rates/list-tax-rates.d.ts +44 -0
  33. package/dist/api/routes/admin/tax-rates/list-tax-rates.js +178 -0
  34. package/dist/api/routes/admin/tax-rates/list-tax-rates.js.map +1 -0
  35. package/dist/api/routes/admin/tax-rates/update-tax-rate.d.ts +35 -0
  36. package/dist/api/routes/admin/tax-rates/update-tax-rate.js +286 -0
  37. package/dist/api/routes/admin/tax-rates/update-tax-rate.js.map +1 -0
  38. package/dist/api/routes/admin/tax-rates/utils/get-query-config.d.ts +7 -0
  39. package/dist/api/routes/admin/tax-rates/utils/get-query-config.js +91 -0
  40. package/dist/api/routes/admin/tax-rates/utils/get-query-config.js.map +1 -0
  41. package/dist/api/routes/store/carts/calculate-taxes.d.ts +24 -0
  42. package/dist/api/routes/store/carts/calculate-taxes.js +153 -0
  43. package/dist/api/routes/store/carts/calculate-taxes.js.map +1 -0
  44. package/dist/interfaces/cart-completion-strategy.d.ts +20 -0
  45. package/dist/interfaces/cart-completion-strategy.js +10 -0
  46. package/dist/interfaces/cart-completion-strategy.js.map +1 -0
  47. package/dist/interfaces/index.d.ts +3 -0
  48. package/dist/interfaces/index.js +16 -0
  49. package/dist/interfaces/index.js.map +1 -0
  50. package/dist/interfaces/tax-calculation-strategy.d.ts +16 -0
  51. package/dist/interfaces/tax-calculation-strategy.js +10 -0
  52. package/dist/interfaces/tax-calculation-strategy.js.map +1 -0
  53. package/dist/interfaces/tax-service.d.ts +51 -0
  54. package/dist/interfaces/tax-service.js +3 -0
  55. package/dist/interfaces/tax-service.js.map +1 -0
  56. package/dist/loaders/strategies.d.ts +12 -0
  57. package/dist/loaders/strategies.js +32 -0
  58. package/dist/loaders/strategies.js.map +1 -0
  59. package/dist/migrations/1641636508055-new_tax_system.d.ts +6 -0
  60. package/dist/migrations/1641636508055-new_tax_system.js +248 -0
  61. package/dist/migrations/1641636508055-new_tax_system.js.map +1 -0
  62. package/dist/models/discount.js +2 -1
  63. package/dist/models/discount.js.map +1 -1
  64. package/dist/models/line-item-tax-line.d.ts +7 -0
  65. package/dist/models/line-item-tax-line.js +65 -0
  66. package/dist/models/line-item-tax-line.js.map +1 -0
  67. package/dist/models/product-tax-rate.d.ts +40 -0
  68. package/dist/models/product-tax-rate.js +88 -0
  69. package/dist/models/product-tax-rate.js.map +1 -0
  70. package/dist/models/product-type-tax-rate.d.ts +40 -0
  71. package/dist/models/product-type-tax-rate.js +88 -0
  72. package/dist/models/product-type-tax-rate.js.map +1 -0
  73. package/dist/models/shipping-method-tax-line.d.ts +7 -0
  74. package/dist/models/shipping-method-tax-line.js +65 -0
  75. package/dist/models/shipping-method-tax-line.js.map +1 -0
  76. package/dist/models/shipping-tax-rate.d.ts +40 -0
  77. package/dist/models/shipping-tax-rate.js +88 -0
  78. package/dist/models/shipping-tax-rate.js.map +1 -0
  79. package/dist/models/tax-line.d.ts +39 -0
  80. package/dist/models/tax-line.js +79 -0
  81. package/dist/models/tax-line.js.map +1 -0
  82. package/dist/models/tax-provider.d.ts +17 -0
  83. package/dist/models/tax-provider.js +44 -0
  84. package/dist/models/tax-provider.js.map +1 -0
  85. package/dist/models/tax-rate.d.ts +58 -0
  86. package/dist/models/tax-rate.js +159 -0
  87. package/dist/models/tax-rate.js.map +1 -0
  88. package/dist/repositories/line-item-tax-line.d.ts +4 -0
  89. package/dist/repositories/line-item-tax-line.js +38 -0
  90. package/dist/repositories/line-item-tax-line.js.map +1 -0
  91. package/dist/repositories/product-tax-rate.d.ts +4 -0
  92. package/dist/repositories/product-tax-rate.js +38 -0
  93. package/dist/repositories/product-tax-rate.js.map +1 -0
  94. package/dist/repositories/shipping-method-tax-line.d.ts +4 -0
  95. package/dist/repositories/shipping-method-tax-line.js +38 -0
  96. package/dist/repositories/shipping-method-tax-line.js.map +1 -0
  97. package/dist/repositories/shipping-tax-rate.d.ts +4 -0
  98. package/dist/repositories/shipping-tax-rate.js +38 -0
  99. package/dist/repositories/shipping-tax-rate.js.map +1 -0
  100. package/dist/repositories/tax-rate.d.ts +18 -0
  101. package/dist/repositories/tax-rate.js +359 -0
  102. package/dist/repositories/tax-rate.js.map +1 -0
  103. package/dist/services/product-tax-rate.d.ts +25 -0
  104. package/dist/services/product-tax-rate.js +104 -0
  105. package/dist/services/product-tax-rate.js.map +1 -0
  106. package/dist/services/product-type.d.ts +27 -0
  107. package/dist/services/product-type.js +112 -0
  108. package/dist/services/product-type.js.map +1 -0
  109. package/dist/services/shipping-tax-rate.d.ts +26 -0
  110. package/dist/services/shipping-tax-rate.js +105 -0
  111. package/dist/services/shipping-tax-rate.js.map +1 -0
  112. package/dist/services/system-tax.d.ts +9 -0
  113. package/dist/services/system-tax.js +89 -0
  114. package/dist/services/system-tax.js.map +1 -0
  115. package/dist/services/tax-provider.d.ts +105 -0
  116. package/dist/services/tax-provider.js +455 -0
  117. package/dist/services/tax-provider.js.map +1 -0
  118. package/dist/services/tax-rate.d.ts +31 -0
  119. package/dist/services/tax-rate.js +405 -0
  120. package/dist/services/tax-rate.js.map +1 -0
  121. package/dist/strategies/cart-completion.d.ts +17 -0
  122. package/dist/strategies/cart-completion.js +336 -0
  123. package/dist/strategies/cart-completion.js.map +1 -0
  124. package/dist/strategies/tax-calculation.d.ts +11 -0
  125. package/dist/strategies/tax-calculation.js +147 -0
  126. package/dist/strategies/tax-calculation.js.map +1 -0
  127. package/dist/types/discount.js.map +1 -1
  128. package/dist/types/orders.js +1 -1
  129. package/dist/types/orders.js.map +1 -1
  130. package/dist/types/product-tax-rate.d.ts +10 -0
  131. package/dist/types/product-tax-rate.js +13 -0
  132. package/dist/types/product-tax-rate.js.map +1 -0
  133. package/dist/types/request.d.ts +3 -0
  134. package/dist/types/request.js +3 -0
  135. package/dist/types/request.js.map +1 -0
  136. package/dist/types/shipping-tax-rate.d.ts +10 -0
  137. package/dist/types/shipping-tax-rate.js +13 -0
  138. package/dist/types/shipping-tax-rate.js.map +1 -0
  139. package/dist/types/tax-rate.d.ts +25 -0
  140. package/dist/types/tax-rate.js +3 -0
  141. package/dist/types/tax-rate.js.map +1 -0
  142. package/dist/types/tax-service.d.ts +34 -0
  143. package/dist/types/tax-service.js +3 -0
  144. package/dist/types/tax-service.js.map +1 -0
  145. package/dist/types/totals.d.ts +42 -0
  146. package/dist/types/totals.js +3 -0
  147. package/dist/types/totals.js.map +1 -0
  148. package/jest.config.js +17 -0
  149. package/package.json +3 -3
  150. package/yarn-error.log +79 -5
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.LineItemTaxLineRepository = void 0;
25
+ var typeorm_1 = require("typeorm");
26
+ var line_item_tax_line_1 = require("../models/line-item-tax-line");
27
+ var LineItemTaxLineRepository = /** @class */ (function (_super) {
28
+ __extends(LineItemTaxLineRepository, _super);
29
+ function LineItemTaxLineRepository() {
30
+ return _super !== null && _super.apply(this, arguments) || this;
31
+ }
32
+ LineItemTaxLineRepository = __decorate([
33
+ (0, typeorm_1.EntityRepository)(line_item_tax_line_1.LineItemTaxLine)
34
+ ], LineItemTaxLineRepository);
35
+ return LineItemTaxLineRepository;
36
+ }(typeorm_1.Repository));
37
+ exports.LineItemTaxLineRepository = LineItemTaxLineRepository;
38
+ //# sourceMappingURL=line-item-tax-line.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"line-item-tax-line.js","sourceRoot":"","sources":["../../src/repositories/line-item-tax-line.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAsD;AACtD,mEAA8D;AAG9D;IAA+C,6CAA2B;IAA1E;;IAA4E,CAAC;IAAhE,yBAAyB;QADrC,IAAA,0BAAgB,EAAC,oCAAe,CAAC;OACrB,yBAAyB,CAAuC;IAAD,gCAAC;CAAA,AAA7E,CAA+C,oBAAU,GAAoB;AAAhE,8DAAyB"}
@@ -0,0 +1,4 @@
1
+ import { Repository } from "typeorm";
2
+ import { ProductTaxRate } from "../models/product-tax-rate";
3
+ export declare class ProductTaxRateRepository extends Repository<ProductTaxRate> {
4
+ }
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.ProductTaxRateRepository = void 0;
25
+ var typeorm_1 = require("typeorm");
26
+ var product_tax_rate_1 = require("../models/product-tax-rate");
27
+ var ProductTaxRateRepository = /** @class */ (function (_super) {
28
+ __extends(ProductTaxRateRepository, _super);
29
+ function ProductTaxRateRepository() {
30
+ return _super !== null && _super.apply(this, arguments) || this;
31
+ }
32
+ ProductTaxRateRepository = __decorate([
33
+ (0, typeorm_1.EntityRepository)(product_tax_rate_1.ProductTaxRate)
34
+ ], ProductTaxRateRepository);
35
+ return ProductTaxRateRepository;
36
+ }(typeorm_1.Repository));
37
+ exports.ProductTaxRateRepository = ProductTaxRateRepository;
38
+ //# sourceMappingURL=product-tax-rate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"product-tax-rate.js","sourceRoot":"","sources":["../../src/repositories/product-tax-rate.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAsD;AACtD,+DAA2D;AAG3D;IAA8C,4CAA0B;IAAxE;;IAA0E,CAAC;IAA9D,wBAAwB;QADpC,IAAA,0BAAgB,EAAC,iCAAc,CAAC;OACpB,wBAAwB,CAAsC;IAAD,+BAAC;CAAA,AAA3E,CAA8C,oBAAU,GAAmB;AAA9D,4DAAwB"}
@@ -0,0 +1,4 @@
1
+ import { Repository } from "typeorm";
2
+ import { ShippingMethodTaxLine } from "../models/shipping-method-tax-line";
3
+ export declare class ShippingMethodTaxLineRepository extends Repository<ShippingMethodTaxLine> {
4
+ }
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.ShippingMethodTaxLineRepository = void 0;
25
+ var typeorm_1 = require("typeorm");
26
+ var shipping_method_tax_line_1 = require("../models/shipping-method-tax-line");
27
+ var ShippingMethodTaxLineRepository = /** @class */ (function (_super) {
28
+ __extends(ShippingMethodTaxLineRepository, _super);
29
+ function ShippingMethodTaxLineRepository() {
30
+ return _super !== null && _super.apply(this, arguments) || this;
31
+ }
32
+ ShippingMethodTaxLineRepository = __decorate([
33
+ (0, typeorm_1.EntityRepository)(shipping_method_tax_line_1.ShippingMethodTaxLine)
34
+ ], ShippingMethodTaxLineRepository);
35
+ return ShippingMethodTaxLineRepository;
36
+ }(typeorm_1.Repository));
37
+ exports.ShippingMethodTaxLineRepository = ShippingMethodTaxLineRepository;
38
+ //# sourceMappingURL=shipping-method-tax-line.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shipping-method-tax-line.js","sourceRoot":"","sources":["../../src/repositories/shipping-method-tax-line.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAsD;AACtD,+EAA0E;AAG1E;IAAqD,mDAAiC;IAAtF;;IAAwF,CAAC;IAA5E,+BAA+B;QAD3C,IAAA,0BAAgB,EAAC,gDAAqB,CAAC;OAC3B,+BAA+B,CAA6C;IAAD,sCAAC;CAAA,AAAzF,CAAqD,oBAAU,GAA0B;AAA5E,0EAA+B"}
@@ -0,0 +1,4 @@
1
+ import { Repository } from "typeorm";
2
+ import { ShippingTaxRate } from "../models/shipping-tax-rate";
3
+ export declare class ShippingTaxRateRepository extends Repository<ShippingTaxRate> {
4
+ }
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.ShippingTaxRateRepository = void 0;
25
+ var typeorm_1 = require("typeorm");
26
+ var shipping_tax_rate_1 = require("../models/shipping-tax-rate");
27
+ var ShippingTaxRateRepository = /** @class */ (function (_super) {
28
+ __extends(ShippingTaxRateRepository, _super);
29
+ function ShippingTaxRateRepository() {
30
+ return _super !== null && _super.apply(this, arguments) || this;
31
+ }
32
+ ShippingTaxRateRepository = __decorate([
33
+ (0, typeorm_1.EntityRepository)(shipping_tax_rate_1.ShippingTaxRate)
34
+ ], ShippingTaxRateRepository);
35
+ return ShippingTaxRateRepository;
36
+ }(typeorm_1.Repository));
37
+ exports.ShippingTaxRateRepository = ShippingTaxRateRepository;
38
+ //# sourceMappingURL=shipping-tax-rate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shipping-tax-rate.js","sourceRoot":"","sources":["../../src/repositories/shipping-tax-rate.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAsD;AACtD,iEAA6D;AAG7D;IAA+C,6CAA2B;IAA1E;;IAA4E,CAAC;IAAhE,yBAAyB;QADrC,IAAA,0BAAgB,EAAC,mCAAe,CAAC;OACrB,yBAAyB,CAAuC;IAAD,gCAAC;CAAA,AAA7E,CAA+C,oBAAU,GAAoB;AAAhE,8DAAyB"}
@@ -0,0 +1,18 @@
1
+ import { SelectQueryBuilder, FindManyOptions, Repository } from "typeorm";
2
+ import { TaxRate } from "../models/tax-rate";
3
+ import { ProductTaxRate } from "../models/product-tax-rate";
4
+ import { ProductTypeTaxRate } from "../models/product-type-tax-rate";
5
+ import { ShippingTaxRate } from "../models/shipping-tax-rate";
6
+ import { TaxRateListByConfig } from "../types/tax-rate";
7
+ export declare class TaxRateRepository extends Repository<TaxRate> {
8
+ getFindQueryBuilder(findOptions: FindManyOptions<TaxRate>): SelectQueryBuilder<TaxRate>;
9
+ findWithResolution(findOptions: FindManyOptions<TaxRate>): Promise<TaxRate[]>;
10
+ findOneWithResolution(findOptions: FindManyOptions<TaxRate>): Promise<TaxRate | undefined>;
11
+ findAndCountWithResolution(findOptions: FindManyOptions<TaxRate>): Promise<[TaxRate[], number]>;
12
+ applyResolutionsToQueryBuilder(qb: SelectQueryBuilder<TaxRate>, resolverFields: string[]): SelectQueryBuilder<TaxRate>;
13
+ addToProduct(id: string, productIds: string[]): Promise<ProductTaxRate[]>;
14
+ addToProductType(id: string, productTypeIds: string[]): Promise<ProductTypeTaxRate[]>;
15
+ addToShippingOption(id: string, optionIds: string[]): Promise<ShippingTaxRate[]>;
16
+ listByProduct(productId: string, config: TaxRateListByConfig): Promise<TaxRate[]>;
17
+ listByShippingOption(optionId: string, config: TaxRateListByConfig): Promise<TaxRate[]>;
18
+ }
@@ -0,0 +1,359 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
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
+ };
59
+ var __values = (this && this.__values) || function(o) {
60
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
61
+ if (m) return m.call(o);
62
+ if (o && typeof o.length === "number") return {
63
+ next: function () {
64
+ if (o && i >= o.length) o = void 0;
65
+ return { value: o && o[i++], done: !o };
66
+ }
67
+ };
68
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
69
+ };
70
+ var __read = (this && this.__read) || function (o, n) {
71
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
72
+ if (!m) return o;
73
+ var i = m.call(o), r, ar = [], e;
74
+ try {
75
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
76
+ }
77
+ catch (error) { e = { error: error }; }
78
+ finally {
79
+ try {
80
+ if (r && !r.done && (m = i["return"])) m.call(i);
81
+ }
82
+ finally { if (e) throw e.error; }
83
+ }
84
+ return ar;
85
+ };
86
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
87
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
88
+ if (ar || !(i in from)) {
89
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
90
+ ar[i] = from[i];
91
+ }
92
+ }
93
+ return to.concat(ar || Array.prototype.slice.call(from));
94
+ };
95
+ Object.defineProperty(exports, "__esModule", { value: true });
96
+ exports.TaxRateRepository = void 0;
97
+ var lodash_1 = require("lodash");
98
+ var typeorm_1 = require("typeorm");
99
+ var tax_rate_1 = require("../models/tax-rate");
100
+ var product_tax_rate_1 = require("../models/product-tax-rate");
101
+ var product_type_tax_rate_1 = require("../models/product-type-tax-rate");
102
+ var shipping_tax_rate_1 = require("../models/shipping-tax-rate");
103
+ var product_1 = require("../models/product");
104
+ var shipping_method_1 = require("../models/shipping-method");
105
+ var resolveableFields = [
106
+ "product_count",
107
+ "product_type_count",
108
+ "shipping_option_count",
109
+ ];
110
+ var TaxRateRepository = /** @class */ (function (_super) {
111
+ __extends(TaxRateRepository, _super);
112
+ function TaxRateRepository() {
113
+ return _super !== null && _super.apply(this, arguments) || this;
114
+ }
115
+ TaxRateRepository.prototype.getFindQueryBuilder = function (findOptions) {
116
+ var e_1, _a;
117
+ var qb = this.createQueryBuilder("tr");
118
+ var cleanOptions = findOptions;
119
+ var resolverFields = [];
120
+ if (typeof findOptions.select !== "undefined") {
121
+ var selectableCols = [];
122
+ try {
123
+ for (var _b = __values(findOptions.select), _c = _b.next(); !_c.done; _c = _b.next()) {
124
+ var k = _c.value;
125
+ if (!resolveableFields.includes(k)) {
126
+ selectableCols.push(k);
127
+ }
128
+ else {
129
+ resolverFields.push(k);
130
+ }
131
+ }
132
+ }
133
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
134
+ finally {
135
+ try {
136
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
137
+ }
138
+ finally { if (e_1) throw e_1.error; }
139
+ }
140
+ cleanOptions.select = selectableCols;
141
+ }
142
+ typeorm_1.FindOptionsUtils.applyFindManyOptionsOrConditionsToQueryBuilder(qb, cleanOptions);
143
+ if (resolverFields.length > 0) {
144
+ this.applyResolutionsToQueryBuilder(qb, resolverFields);
145
+ }
146
+ return qb;
147
+ };
148
+ TaxRateRepository.prototype.findWithResolution = function (findOptions) {
149
+ return __awaiter(this, void 0, void 0, function () {
150
+ var qb;
151
+ return __generator(this, function (_a) {
152
+ switch (_a.label) {
153
+ case 0:
154
+ qb = this.getFindQueryBuilder(findOptions);
155
+ return [4 /*yield*/, qb.getMany()];
156
+ case 1: return [2 /*return*/, _a.sent()];
157
+ }
158
+ });
159
+ });
160
+ };
161
+ TaxRateRepository.prototype.findOneWithResolution = function (findOptions) {
162
+ return __awaiter(this, void 0, void 0, function () {
163
+ var qb;
164
+ return __generator(this, function (_a) {
165
+ switch (_a.label) {
166
+ case 0:
167
+ qb = this.getFindQueryBuilder(findOptions);
168
+ return [4 /*yield*/, qb.getOne()];
169
+ case 1: return [2 /*return*/, _a.sent()];
170
+ }
171
+ });
172
+ });
173
+ };
174
+ TaxRateRepository.prototype.findAndCountWithResolution = function (findOptions) {
175
+ return __awaiter(this, void 0, void 0, function () {
176
+ var qb;
177
+ return __generator(this, function (_a) {
178
+ switch (_a.label) {
179
+ case 0:
180
+ qb = this.getFindQueryBuilder(findOptions);
181
+ return [4 /*yield*/, qb.getManyAndCount()];
182
+ case 1: return [2 /*return*/, _a.sent()];
183
+ }
184
+ });
185
+ });
186
+ };
187
+ TaxRateRepository.prototype.applyResolutionsToQueryBuilder = function (qb, resolverFields) {
188
+ var e_2, _a;
189
+ try {
190
+ for (var resolverFields_1 = __values(resolverFields), resolverFields_1_1 = resolverFields_1.next(); !resolverFields_1_1.done; resolverFields_1_1 = resolverFields_1.next()) {
191
+ var k = resolverFields_1_1.value;
192
+ switch (k) {
193
+ case "product_count":
194
+ qb.loadRelationCountAndMap("".concat(qb.alias, ".product_count"), "".concat(qb.alias, ".products"));
195
+ break;
196
+ case "product_type_count":
197
+ qb.loadRelationCountAndMap("".concat(qb.alias, ".product_type_count"), "".concat(qb.alias, ".product_types"));
198
+ break;
199
+ case "shipping_option_count":
200
+ qb.loadRelationCountAndMap("".concat(qb.alias, ".shipping_option_count"), "".concat(qb.alias, ".shipping_options"));
201
+ break;
202
+ default:
203
+ break;
204
+ }
205
+ }
206
+ }
207
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
208
+ finally {
209
+ try {
210
+ if (resolverFields_1_1 && !resolverFields_1_1.done && (_a = resolverFields_1.return)) _a.call(resolverFields_1);
211
+ }
212
+ finally { if (e_2) throw e_2.error; }
213
+ }
214
+ return qb;
215
+ };
216
+ TaxRateRepository.prototype.addToProduct = function (id, productIds) {
217
+ return __awaiter(this, void 0, void 0, function () {
218
+ var toInsert, insertResult;
219
+ return __generator(this, function (_a) {
220
+ switch (_a.label) {
221
+ case 0:
222
+ toInsert = productIds.map(function (pId) { return ({ rate_id: id, product_id: pId }); });
223
+ return [4 /*yield*/, this.createQueryBuilder()
224
+ .insert()
225
+ .into(product_tax_rate_1.ProductTaxRate)
226
+ .values(toInsert)
227
+ .execute()];
228
+ case 1:
229
+ insertResult = _a.sent();
230
+ return [4 /*yield*/, this.manager
231
+ .createQueryBuilder(product_tax_rate_1.ProductTaxRate, "ptr")
232
+ .select()
233
+ .where(insertResult.identifiers)
234
+ .getMany()];
235
+ case 2: return [2 /*return*/, _a.sent()];
236
+ }
237
+ });
238
+ });
239
+ };
240
+ TaxRateRepository.prototype.addToProductType = function (id, productTypeIds) {
241
+ return __awaiter(this, void 0, void 0, function () {
242
+ var toInsert, insertResult;
243
+ return __generator(this, function (_a) {
244
+ switch (_a.label) {
245
+ case 0:
246
+ toInsert = productTypeIds.map(function (pId) { return ({
247
+ rate_id: id,
248
+ product_type_id: pId,
249
+ }); });
250
+ return [4 /*yield*/, this.createQueryBuilder()
251
+ .insert()
252
+ .into(product_type_tax_rate_1.ProductTypeTaxRate)
253
+ .values(toInsert)
254
+ .execute()];
255
+ case 1:
256
+ insertResult = _a.sent();
257
+ return [4 /*yield*/, this.manager
258
+ .createQueryBuilder(product_type_tax_rate_1.ProductTypeTaxRate, "ptr")
259
+ .select()
260
+ .where(insertResult.identifiers)
261
+ .getMany()];
262
+ case 2: return [2 /*return*/, _a.sent()];
263
+ }
264
+ });
265
+ });
266
+ };
267
+ TaxRateRepository.prototype.addToShippingOption = function (id, optionIds) {
268
+ return __awaiter(this, void 0, void 0, function () {
269
+ var toInsert, insertResult;
270
+ return __generator(this, function (_a) {
271
+ switch (_a.label) {
272
+ case 0:
273
+ toInsert = optionIds.map(function (pId) { return ({
274
+ rate_id: id,
275
+ shipping_option_id: pId,
276
+ }); });
277
+ return [4 /*yield*/, this.createQueryBuilder()
278
+ .insert()
279
+ .into(shipping_tax_rate_1.ShippingTaxRate)
280
+ .values(toInsert)
281
+ .execute()];
282
+ case 1:
283
+ insertResult = _a.sent();
284
+ return [4 /*yield*/, this.manager
285
+ .createQueryBuilder(shipping_tax_rate_1.ShippingTaxRate, "str")
286
+ .select()
287
+ .where(insertResult.identifiers)
288
+ .getMany()];
289
+ case 2: return [2 /*return*/, _a.sent()];
290
+ }
291
+ });
292
+ });
293
+ };
294
+ TaxRateRepository.prototype.listByProduct = function (productId, config) {
295
+ return __awaiter(this, void 0, void 0, function () {
296
+ var productRates, typeRates, results;
297
+ return __generator(this, function (_a) {
298
+ switch (_a.label) {
299
+ case 0:
300
+ productRates = this.createQueryBuilder("txr")
301
+ .leftJoin(product_tax_rate_1.ProductTaxRate, "ptr", "ptr.rate_id = txr.id")
302
+ .leftJoin(product_1.Product, "prod", "prod.id = ptr.product_id")
303
+ .where("prod.id = :productId", { productId: productId });
304
+ typeRates = this.createQueryBuilder("txr")
305
+ .leftJoin(product_type_tax_rate_1.ProductTypeTaxRate, "pttr", "pttr.rate_id = txr.id")
306
+ .leftJoin(product_1.Product, "prod", "prod.type_id = pttr.product_type_id")
307
+ .where("prod.id = :productId", { productId: productId });
308
+ if (typeof config.region_id !== "undefined") {
309
+ productRates.andWhere("txr.region_id = :regionId", {
310
+ regionId: config.region_id,
311
+ });
312
+ typeRates.andWhere("txr.region_id = :regionId", {
313
+ regionId: config.region_id,
314
+ });
315
+ }
316
+ return [4 /*yield*/, Promise.all([
317
+ productRates.getMany(),
318
+ typeRates.getMany(),
319
+ ])
320
+ // Only return unique rates by joining the two arrays from typeRates and
321
+ // productRates matching based on the id
322
+ ];
323
+ case 1:
324
+ results = _a.sent();
325
+ // Only return unique rates by joining the two arrays from typeRates and
326
+ // productRates matching based on the id
327
+ return [2 /*return*/, lodash_1.unionBy.apply(void 0, __spreadArray(__spreadArray([], __read(results), false), [function (txr) { return txr.id; }], false))];
328
+ }
329
+ });
330
+ });
331
+ };
332
+ TaxRateRepository.prototype.listByShippingOption = function (optionId, config) {
333
+ return __awaiter(this, void 0, void 0, function () {
334
+ var rates;
335
+ return __generator(this, function (_a) {
336
+ switch (_a.label) {
337
+ case 0:
338
+ rates = this.createQueryBuilder("txr")
339
+ .leftJoin(shipping_tax_rate_1.ShippingTaxRate, "ptr", "ptr.rate_id = txr.id")
340
+ .leftJoin(shipping_method_1.ShippingMethod, "sm", "sm.shipping_option_id = ptr.shipping_option_id")
341
+ .where("sm.shipping_option_id = :optionId", { optionId: optionId });
342
+ if (typeof config.region_id !== "undefined") {
343
+ rates.andWhere("txr.region_id = :regionId", {
344
+ regionId: config.region_id,
345
+ });
346
+ }
347
+ return [4 /*yield*/, rates.getMany()];
348
+ case 1: return [2 /*return*/, _a.sent()];
349
+ }
350
+ });
351
+ });
352
+ };
353
+ TaxRateRepository = __decorate([
354
+ (0, typeorm_1.EntityRepository)(tax_rate_1.TaxRate)
355
+ ], TaxRateRepository);
356
+ return TaxRateRepository;
357
+ }(typeorm_1.Repository));
358
+ exports.TaxRateRepository = TaxRateRepository;
359
+ //# sourceMappingURL=tax-rate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tax-rate.js","sourceRoot":"","sources":["../../src/repositories/tax-rate.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAAgC;AAChC,mCAMgB;AA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O,CAAC,GAAG,CAAC;gCAChC,YAAY,CAAC,OAAO,EAAE;gCACtB,SAAS,CAAC,OAAO,EAAE;6BACpB,CAAC;4BAEF,wEAAwE;4BACxE,wCAAwC;0BAHtC;;wBAHI,OAAO,GAAG,SAGd;wBAEF,wEAAwE;wBACxE,wCAAwC;wBACxC,sBAAO,gBAAO,sDAAI,OAAO,YAAE,UAAC,GAAG,IAAK,OAAA,GAAG,CAAC,EAAE,EAAN,CAAM,YAAC;;;;KAC5C;IAEK,gDAAoB,GAA1B,UAA2B,QAAgB,EAAE,MAA2B;;;;;;wBAClE,KAAK,GAAG,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC;6BACvC,QAAQ,CAAC,mCAAe,EAAE,KAAK,EAAE,sBAAsB,CAAC;6BACxD,QAAQ,CACP,gCAAc,EACd,IAAI,EACJ,gDAAgD,CACjD;6BACA,KAAK,CAAC,mCAAmC,EAAE,EAAE,QAAQ,UAAA,EAAE,CAAC,CAAA;wBAE3D,IAAI,OAAO,MAAM,CAAC,SAAS,KAAK,WAAW,EAAE;4BAC3C,KAAK,CAAC,QAAQ,CAAC,2BAA2B,EAAE;gCAC1C,QAAQ,EAAE,MAAM,CAAC,SAAS;6BAC3B,CAAC,CAAA;yBACH;wBACM,qBAAM,KAAK,CAAC,OAAO,EAAE,EAAA;4BAA5B,sBAAO,SAAqB,EAAA;;;;KAC7B;IAvLU,iBAAiB;QAD7B,IAAA,0BAAgB,EAAC,kBAAO,CAAC;OACb,iBAAiB,CAwL7B;IAAD,wBAAC;CAAA,AAxLD,CAAuC,oBAAU,GAwLhD;AAxLY,8CAAiB"}
@@ -0,0 +1,25 @@
1
+ import { BaseService } from "medusa-interfaces";
2
+ import { EntityManager } from "typeorm";
3
+ import { ProductTaxRate } from "../models/product-tax-rate";
4
+ import { FindConfig } from "../types/common";
5
+ import { FilterableProductTaxRateProps } from "../types/product-tax-rate";
6
+ /**
7
+ * Provides layer to manipulate product variants.
8
+ * @extends BaseService
9
+ */
10
+ declare class ProductTaxRateService extends BaseService {
11
+ private manager_;
12
+ private productTaxRateRepository_;
13
+ constructor({ manager, productTaxRateRepository }: {
14
+ manager: any;
15
+ productTaxRateRepository: any;
16
+ });
17
+ withTransaction(transactionManager: EntityManager): ProductTaxRateService;
18
+ /**
19
+ * @param {FilterableProductVariantProps} selector - the query object for find
20
+ * @param {FindConfig<ProductVariant>} config - query config object for variant retrieval
21
+ * @return {Promise} the result of the find operation
22
+ */
23
+ list(selector: FilterableProductTaxRateProps, config?: FindConfig<ProductTaxRate>): Promise<ProductTaxRate[]>;
24
+ }
25
+ export default ProductTaxRateService;