@medusajs/medusa 1.3.7 → 1.3.8-fix-2124.0

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 (62) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/CHANGELOG.md +6 -0
  3. package/dist/api/routes/admin/currency/index.d.ts +4 -0
  4. package/dist/api/routes/admin/currency/index.js +49 -0
  5. package/dist/api/routes/admin/currency/index.js.map +1 -0
  6. package/dist/api/routes/admin/currency/list-currencies.d.ts +45 -0
  7. package/dist/api/routes/admin/currency/list-currencies.js +164 -0
  8. package/dist/api/routes/admin/currency/list-currencies.js.map +1 -0
  9. package/dist/api/routes/admin/currency/update-currency.d.ts +35 -0
  10. package/dist/api/routes/admin/currency/update-currency.js +112 -0
  11. package/dist/api/routes/admin/currency/update-currency.js.map +1 -0
  12. package/dist/api/routes/admin/products/create-product.d.ts +1 -1
  13. package/dist/api/routes/admin/products/create-product.js +1 -1
  14. package/dist/api/routes/admin/products/update-variant.d.ts +1 -1
  15. package/dist/api/routes/admin/products/update-variant.js +1 -1
  16. package/dist/loaders/feature-flags/tax-inclusive-pricing.d.ts +3 -0
  17. package/dist/loaders/feature-flags/tax-inclusive-pricing.js +10 -0
  18. package/dist/loaders/feature-flags/tax-inclusive-pricing.js.map +1 -0
  19. package/dist/loaders/strategies.js +9 -1
  20. package/dist/loaders/strategies.js.map +1 -1
  21. package/dist/migrations/1659501357661-tax_inclusive_pricing.d.ts +7 -0
  22. package/dist/migrations/1659501357661-tax_inclusive_pricing.js +106 -0
  23. package/dist/migrations/1659501357661-tax_inclusive_pricing.js.map +1 -0
  24. package/dist/repositories/sales-channel.d.ts +3 -1
  25. package/dist/repositories/sales-channel.js +123 -0
  26. package/dist/repositories/sales-channel.js.map +1 -1
  27. package/dist/services/batch-job.js.map +1 -1
  28. package/dist/services/csv-parser.d.ts +1 -3
  29. package/dist/services/csv-parser.js +4 -4
  30. package/dist/services/csv-parser.js.map +1 -1
  31. package/dist/services/currency.d.ts +51 -0
  32. package/dist/services/currency.js +174 -0
  33. package/dist/services/currency.js.map +1 -0
  34. package/dist/services/event-bus.d.ts +4 -4
  35. package/dist/services/product-variant.d.ts +2 -2
  36. package/dist/services/product-variant.js +43 -35
  37. package/dist/services/product-variant.js.map +1 -1
  38. package/dist/services/product.d.ts +9 -1
  39. package/dist/services/product.js +36 -15
  40. package/dist/services/product.js.map +1 -1
  41. package/dist/services/region.d.ts +7 -0
  42. package/dist/services/region.js +22 -0
  43. package/dist/services/region.js.map +1 -1
  44. package/dist/services/sales-channel.d.ts +19 -1
  45. package/dist/services/sales-channel.js +64 -14
  46. package/dist/services/sales-channel.js.map +1 -1
  47. package/dist/services/tax-provider.d.ts +1 -1
  48. package/dist/strategies/batch-jobs/product/import.d.ts +140 -0
  49. package/dist/strategies/batch-jobs/product/import.js +1162 -0
  50. package/dist/strategies/batch-jobs/product/import.js.map +1 -0
  51. package/dist/strategies/batch-jobs/product/types.d.ts +47 -0
  52. package/dist/strategies/batch-jobs/product/types.js +14 -0
  53. package/dist/strategies/batch-jobs/product/types.js.map +1 -0
  54. package/dist/strategies/batch-jobs/product/utils.d.ts +15 -0
  55. package/dist/strategies/batch-jobs/product/utils.js +44 -0
  56. package/dist/strategies/batch-jobs/product/utils.js.map +1 -0
  57. package/dist/subscribers/batch-job.js +28 -8
  58. package/dist/subscribers/batch-job.js.map +1 -1
  59. package/dist/types/currency.d.ts +3 -0
  60. package/dist/types/currency.js +3 -0
  61. package/dist/types/currency.js.map +1 -0
  62. package/package.json +2 -1
@@ -1 +1 @@
1
- @medusajs/medusa:build: cache hit, replaying output ef9d9e7f4ae60a2a
1
+ @medusajs/medusa:build: cache hit, replaying output fb6bda2832b08e10
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Change Log
2
2
 
3
+ ## 1.3.8-fix-2124.0
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1846](https://github.com/medusajs/medusa/pull/1846) [`d14a0398f`](https://github.com/medusajs/medusa/commit/d14a0398fb884a1cd472c147af8ff5fa6fdbe4cb) Thanks [@olivermrbl](https://github.com/olivermrbl)! - Fixes an error thrown when deleting product options on a product without variants
8
+
3
9
  ## 1.3.7
4
10
 
5
11
  ### Patch Changes
@@ -0,0 +1,4 @@
1
+ declare const _default: (app: any) => any;
2
+ export default _default;
3
+ export * from "./list-currencies";
4
+ export * from "./update-currency";
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
26
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
27
+ };
28
+ var __importDefault = (this && this.__importDefault) || function (mod) {
29
+ return (mod && mod.__esModule) ? mod : { "default": mod };
30
+ };
31
+ Object.defineProperty(exports, "__esModule", { value: true });
32
+ var express_1 = require("express");
33
+ var middlewares_1 = __importStar(require("../../../middlewares"));
34
+ var list_currencies_1 = require("./list-currencies");
35
+ var update_currency_1 = require("./update-currency");
36
+ var feature_flag_enabled_1 = require("../../../middlewares/feature-flag-enabled");
37
+ var tax_inclusive_pricing_1 = __importDefault(require("../../../../loaders/feature-flags/tax-inclusive-pricing"));
38
+ exports.default = (function (app) {
39
+ var route = (0, express_1.Router)();
40
+ app.use("/currencies", (0, feature_flag_enabled_1.isFeatureFlagEnabled)(tax_inclusive_pricing_1.default.key), route);
41
+ route.get("/", (0, middlewares_1.transformQuery)(list_currencies_1.AdminGetCurrenciesParams, {
42
+ isList: true,
43
+ }), middlewares_1.default.wrap(require("./list-currencies").default));
44
+ route.post("/:code", (0, middlewares_1.transformBody)(update_currency_1.AdminPostCurrenciesCurrencyReq), middlewares_1.default.wrap(require("./update-currency").default));
45
+ return app;
46
+ });
47
+ __exportStar(require("./list-currencies"), exports);
48
+ __exportStar(require("./update-currency"), exports);
49
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/currency/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAgC;AAChC,kEAG6B;AAC7B,qDAA4D;AAC5D,qDAAkE;AAClE,kFAAgF;AAChF,kHAAoG;AAEpG,mBAAe,UAAC,GAAG;IACjB,IAAM,KAAK,GAAG,IAAA,gBAAM,GAAE,CAAA;IACtB,GAAG,CAAC,GAAG,CACL,aAAa,EACb,IAAA,2CAAoB,EAAC,+BAA8B,CAAC,GAAG,CAAC,EACxD,KAAK,CACN,CAAA;IAED,KAAK,CAAC,GAAG,CACP,GAAG,EACH,IAAA,4BAAc,EAAC,0CAAwB,EAAE;QACvC,MAAM,EAAE,IAAI;KACb,CAAC,EACF,qBAAW,CAAC,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC,OAAO,CAAC,CACvD,CAAA;IAED,KAAK,CAAC,IAAI,CACR,QAAQ,EACR,IAAA,2BAAa,EAAC,gDAA8B,CAAC,EAC7C,qBAAW,CAAC,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC,OAAO,CAAC,CACvD,CAAA;IAED,OAAO,GAAG,CAAA;AACZ,CAAC,EAAA;AAED,oDAAiC;AACjC,oDAAiC"}
@@ -0,0 +1,45 @@
1
+ import { Currency } from "../../../../models";
2
+ import { ExtendedRequest } from "../../../../types/global";
3
+ import { FindPaginationParams } from "../../../../types/common";
4
+ /**
5
+ * @oas [get] /currencies
6
+ * operationId: "GetCurrencies"
7
+ * summary: "List Currency"
8
+ * description: "Retrieves a list of Currency"
9
+ * x-authenticated: true
10
+ * parameters:
11
+ * - (query) code {string} Code of the currency to search for.
12
+ * - (query) includes_tax {boolean} Search for tax inclusive currencies.
13
+ * - (query) order {string} to retrieve products in.
14
+ * - (query) offset {string} How many products to skip in the result.
15
+ * - (query) limit {string} Limit the number of products returned.
16
+ * tags:
17
+ * - Currency
18
+ * responses:
19
+ * 200:
20
+ * description: OK
21
+ * content:
22
+ * application/json:
23
+ * schema:
24
+ * properties:
25
+ * count:
26
+ * description: The number of Currency.
27
+ * type: integer
28
+ * offset:
29
+ * description: The offset of the Currency query.
30
+ * type: integer
31
+ * limit:
32
+ * description: The limit of the currency query.
33
+ * type: integer
34
+ * currencies:
35
+ * type: array
36
+ * items:
37
+ * $ref: "#/components/schemas/currency"
38
+ */
39
+ declare const _default: (req: ExtendedRequest<Currency>, res: any) => Promise<void>;
40
+ export default _default;
41
+ export declare class AdminGetCurrenciesParams extends FindPaginationParams {
42
+ code?: string;
43
+ includes_tax?: boolean;
44
+ order?: string;
45
+ }
@@ -0,0 +1,164 @@
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 __metadata = (this && this.__metadata) || function (k, v) {
24
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
+ };
26
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
27
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
28
+ return new (P || (P = Promise))(function (resolve, reject) {
29
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
30
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
31
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
32
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
33
+ });
34
+ };
35
+ var __generator = (this && this.__generator) || function (thisArg, body) {
36
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
37
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
38
+ function verb(n) { return function (v) { return step([n, v]); }; }
39
+ function step(op) {
40
+ if (f) throw new TypeError("Generator is already executing.");
41
+ while (_) try {
42
+ 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;
43
+ if (y = 0, t) op = [op[0] & 2, t.value];
44
+ switch (op[0]) {
45
+ case 0: case 1: t = op; break;
46
+ case 4: _.label++; return { value: op[1], done: false };
47
+ case 5: _.label++; y = op[1]; op = [0]; continue;
48
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
49
+ default:
50
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
51
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
52
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
53
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
54
+ if (t[2]) _.ops.pop();
55
+ _.trys.pop(); continue;
56
+ }
57
+ op = body.call(thisArg, _);
58
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
59
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
60
+ }
61
+ };
62
+ var __read = (this && this.__read) || function (o, n) {
63
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
64
+ if (!m) return o;
65
+ var i = m.call(o), r, ar = [], e;
66
+ try {
67
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
68
+ }
69
+ catch (error) { e = { error: error }; }
70
+ finally {
71
+ try {
72
+ if (r && !r.done && (m = i["return"])) m.call(i);
73
+ }
74
+ finally { if (e) throw e.error; }
75
+ }
76
+ return ar;
77
+ };
78
+ Object.defineProperty(exports, "__esModule", { value: true });
79
+ exports.AdminGetCurrenciesParams = void 0;
80
+ var class_validator_1 = require("class-validator");
81
+ var common_1 = require("../../../../types/common");
82
+ /**
83
+ * @oas [get] /currencies
84
+ * operationId: "GetCurrencies"
85
+ * summary: "List Currency"
86
+ * description: "Retrieves a list of Currency"
87
+ * x-authenticated: true
88
+ * parameters:
89
+ * - (query) code {string} Code of the currency to search for.
90
+ * - (query) includes_tax {boolean} Search for tax inclusive currencies.
91
+ * - (query) order {string} to retrieve products in.
92
+ * - (query) offset {string} How many products to skip in the result.
93
+ * - (query) limit {string} Limit the number of products returned.
94
+ * tags:
95
+ * - Currency
96
+ * responses:
97
+ * 200:
98
+ * description: OK
99
+ * content:
100
+ * application/json:
101
+ * schema:
102
+ * properties:
103
+ * count:
104
+ * description: The number of Currency.
105
+ * type: integer
106
+ * offset:
107
+ * description: The offset of the Currency query.
108
+ * type: integer
109
+ * limit:
110
+ * description: The limit of the currency query.
111
+ * type: integer
112
+ * currencies:
113
+ * type: array
114
+ * items:
115
+ * $ref: "#/components/schemas/currency"
116
+ */
117
+ exports.default = (function (req, res) { return __awaiter(void 0, void 0, void 0, function () {
118
+ var currencyService, _a, skip, take, _b, currencies, count;
119
+ return __generator(this, function (_c) {
120
+ switch (_c.label) {
121
+ case 0:
122
+ currencyService = req.scope.resolve("currencyService");
123
+ _a = req.listConfig, skip = _a.skip, take = _a.take;
124
+ req.listConfig.select = undefined;
125
+ if (req.listConfig.order && req.listConfig.order["created_at"]) {
126
+ delete req.listConfig.order["created_at"];
127
+ }
128
+ return [4 /*yield*/, currencyService.listAndCount(req.filterableFields, req.listConfig)];
129
+ case 1:
130
+ _b = __read.apply(void 0, [_c.sent(), 2]), currencies = _b[0], count = _b[1];
131
+ res.json({
132
+ currencies: currencies,
133
+ count: count,
134
+ offset: skip,
135
+ limit: take,
136
+ });
137
+ return [2 /*return*/];
138
+ }
139
+ });
140
+ }); });
141
+ var AdminGetCurrenciesParams = /** @class */ (function (_super) {
142
+ __extends(AdminGetCurrenciesParams, _super);
143
+ function AdminGetCurrenciesParams() {
144
+ return _super !== null && _super.apply(this, arguments) || this;
145
+ }
146
+ __decorate([
147
+ (0, class_validator_1.IsString)(),
148
+ (0, class_validator_1.IsOptional)(),
149
+ __metadata("design:type", String)
150
+ ], AdminGetCurrenciesParams.prototype, "code", void 0);
151
+ __decorate([
152
+ (0, class_validator_1.IsBoolean)(),
153
+ (0, class_validator_1.IsOptional)(),
154
+ __metadata("design:type", Boolean)
155
+ ], AdminGetCurrenciesParams.prototype, "includes_tax", void 0);
156
+ __decorate([
157
+ (0, class_validator_1.IsString)(),
158
+ (0, class_validator_1.IsOptional)(),
159
+ __metadata("design:type", String)
160
+ ], AdminGetCurrenciesParams.prototype, "order", void 0);
161
+ return AdminGetCurrenciesParams;
162
+ }(common_1.FindPaginationParams));
163
+ exports.AdminGetCurrenciesParams = AdminGetCurrenciesParams;
164
+ //# sourceMappingURL=list-currencies.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-currencies.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/currency/list-currencies.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAiE;AAIjE,mDAA2E;AAE3E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,mBAAe,UAAO,GAA8B,EAAE,GAAG;;;;;gBACjD,eAAe,GAAoB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAA;gBAEvE,KAAiB,GAAG,CAAC,UAAU,EAA7B,IAAI,UAAA,EAAE,IAAI,UAAA,CAAmB;gBAErC,GAAG,CAAC,UAAU,CAAC,MAAM,GAAG,SAAS,CAAA;gBACjC,IAAI,GAAG,CAAC,UAAU,CAAC,KAAK,IAAI,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE;oBAC9D,OAAO,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,YAAY,CAAC,CAAA;iBAC1C;gBAC2B,qBAAM,eAAe,CAAC,YAAY,CAC5D,GAAG,CAAC,gBAAgB,EACpB,GAAG,CAAC,UAAU,CACf,EAAA;;gBAHK,KAAA,sBAAsB,SAG3B,KAAA,EAHM,UAAU,QAAA,EAAE,KAAK,QAAA;gBAKxB,GAAG,CAAC,IAAI,CAAC;oBACP,UAAU,YAAA;oBACV,KAAK,OAAA;oBACL,MAAM,EAAE,IAAI;oBACZ,KAAK,EAAE,IAAI;iBACZ,CAAC,CAAA;;;;KACH,EAAA;AAED;IAA8C,4CAAoB;IAAlE;;IAYA,CAAC;IATC;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;0DACA;IAIb;QAFC,IAAA,2BAAS,GAAE;QACX,IAAA,4BAAU,GAAE;;kEACS;IAItB;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;2DACC;IAChB,+BAAC;CAAA,AAZD,CAA8C,6BAAoB,GAYjE;AAZY,4DAAwB"}
@@ -0,0 +1,35 @@
1
+ import { Currency } from "../../../../models";
2
+ import { ExtendedRequest } from "../../../../types/global";
3
+ /**
4
+ * @oas [post] /currencies/:code
5
+ * operationId: "PostCurrenciesCurrency"
6
+ * summary: "Update a Currency"
7
+ * description: "Update a Currency"
8
+ * x-authenticated: true
9
+ * parameters:
10
+ * - (path) code=* {string} The code of the Currency.
11
+ * requestBody:
12
+ * content:
13
+ * application/json:
14
+ * schema:
15
+ * properties:
16
+ * includes_tax:
17
+ * type: boolean
18
+ * description: [EXPERIMENTAL] Tax included in prices of currency.
19
+ * tags:
20
+ * - Currency
21
+ * responses:
22
+ * 200:
23
+ * description: OK
24
+ * content:
25
+ * application/json:
26
+ * schema:
27
+ * properties:
28
+ * currency:
29
+ * $ref: "#/components/schemas/currency"
30
+ */
31
+ declare const _default: (req: ExtendedRequest<Currency>, res: any) => Promise<void>;
32
+ export default _default;
33
+ export declare class AdminPostCurrenciesCurrencyReq {
34
+ includes_tax?: boolean;
35
+ }
@@ -0,0 +1,112 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
12
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
13
+ return new (P || (P = Promise))(function (resolve, reject) {
14
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
15
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
16
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
17
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
18
+ });
19
+ };
20
+ var __generator = (this && this.__generator) || function (thisArg, body) {
21
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
22
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
23
+ function verb(n) { return function (v) { return step([n, v]); }; }
24
+ function step(op) {
25
+ if (f) throw new TypeError("Generator is already executing.");
26
+ while (_) try {
27
+ 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;
28
+ if (y = 0, t) op = [op[0] & 2, t.value];
29
+ switch (op[0]) {
30
+ case 0: case 1: t = op; break;
31
+ case 4: _.label++; return { value: op[1], done: false };
32
+ case 5: _.label++; y = op[1]; op = [0]; continue;
33
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
34
+ default:
35
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
36
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
37
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
38
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
39
+ if (t[2]) _.ops.pop();
40
+ _.trys.pop(); continue;
41
+ }
42
+ op = body.call(thisArg, _);
43
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
44
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
45
+ }
46
+ };
47
+ var __importDefault = (this && this.__importDefault) || function (mod) {
48
+ return (mod && mod.__esModule) ? mod : { "default": mod };
49
+ };
50
+ Object.defineProperty(exports, "__esModule", { value: true });
51
+ exports.AdminPostCurrenciesCurrencyReq = void 0;
52
+ var class_validator_1 = require("class-validator");
53
+ var feature_flag_decorators_1 = require("../../../../utils/feature-flag-decorators");
54
+ var tax_inclusive_pricing_1 = __importDefault(require("../../../../loaders/feature-flags/tax-inclusive-pricing"));
55
+ /**
56
+ * @oas [post] /currencies/:code
57
+ * operationId: "PostCurrenciesCurrency"
58
+ * summary: "Update a Currency"
59
+ * description: "Update a Currency"
60
+ * x-authenticated: true
61
+ * parameters:
62
+ * - (path) code=* {string} The code of the Currency.
63
+ * requestBody:
64
+ * content:
65
+ * application/json:
66
+ * schema:
67
+ * properties:
68
+ * includes_tax:
69
+ * type: boolean
70
+ * description: [EXPERIMENTAL] Tax included in prices of currency.
71
+ * tags:
72
+ * - Currency
73
+ * responses:
74
+ * 200:
75
+ * description: OK
76
+ * content:
77
+ * application/json:
78
+ * schema:
79
+ * properties:
80
+ * currency:
81
+ * $ref: "#/components/schemas/currency"
82
+ */
83
+ exports.default = (function (req, res) { return __awaiter(void 0, void 0, void 0, function () {
84
+ var code, data, currencyService, currency;
85
+ return __generator(this, function (_a) {
86
+ switch (_a.label) {
87
+ case 0:
88
+ code = req.params.code;
89
+ data = req.validatedBody;
90
+ currencyService = req.scope.resolve("currencyService");
91
+ return [4 /*yield*/, currencyService.update(code, data)];
92
+ case 1:
93
+ currency = _a.sent();
94
+ res.json({ currency: currency });
95
+ return [2 /*return*/];
96
+ }
97
+ });
98
+ }); });
99
+ var AdminPostCurrenciesCurrencyReq = /** @class */ (function () {
100
+ function AdminPostCurrenciesCurrencyReq() {
101
+ }
102
+ __decorate([
103
+ (0, feature_flag_decorators_1.FeatureFlagDecorators)(tax_inclusive_pricing_1.default.key, [
104
+ (0, class_validator_1.IsOptional)(),
105
+ (0, class_validator_1.IsBoolean)(),
106
+ ]),
107
+ __metadata("design:type", Boolean)
108
+ ], AdminPostCurrenciesCurrencyReq.prototype, "includes_tax", void 0);
109
+ return AdminPostCurrenciesCurrencyReq;
110
+ }());
111
+ exports.AdminPostCurrenciesCurrencyReq = AdminPostCurrenciesCurrencyReq;
112
+ //# sourceMappingURL=update-currency.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-currency.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/currency/update-currency.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAuD;AAIvD,qFAAiF;AACjF,kHAAoG;AAEpG;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,mBAAe,UAAO,GAA8B,EAAE,GAAG;;;;;gBACjD,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,IAAc,CAAA;gBAChC,IAAI,GAAG,GAAG,CAAC,aAA+C,CAAA;gBAC1D,eAAe,GAAoB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAA;gBAE5D,qBAAM,eAAe,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,EAAA;;gBAAnD,QAAQ,GAAG,SAAwC;gBAEzD,GAAG,CAAC,IAAI,CAAC,EAAE,QAAQ,UAAA,EAAE,CAAC,CAAA;;;;KACvB,EAAA;AAED;IAAA;IAMA,CAAC;IADC;QAJC,IAAA,+CAAqB,EAAC,+BAA8B,CAAC,GAAG,EAAE;YACzD,IAAA,4BAAU,GAAE;YACZ,IAAA,2BAAS,GAAE;SACZ,CAAC;;wEACoB;IACxB,qCAAC;CAAA,AAND,IAMC;AANY,wEAA8B"}
@@ -188,7 +188,7 @@ import { ProductStatus } from "../../../../models";
188
188
  * description: The value to give for the Product Option at the same index in the Product's `options` field.
189
189
  * type: string
190
190
  * weight:
191
- * description: The wieght of the Product.
191
+ * description: The weight of the Product.
192
192
  * type: number
193
193
  * length:
194
194
  * description: The length of the Product.
@@ -283,7 +283,7 @@ var validator_1 = require("../../../../utils/validator");
283
283
  * description: The value to give for the Product Option at the same index in the Product's `options` field.
284
284
  * type: string
285
285
  * weight:
286
- * description: The wieght of the Product.
286
+ * description: The weight of the Product.
287
287
  * type: number
288
288
  * length:
289
289
  * description: The length of the Product.
@@ -41,7 +41,7 @@ import { ProductVariantPricesUpdateReq } from "../../../../types/product-variant
41
41
  * description: Whether Medusa should keep track of the inventory for this Product Variant.
42
42
  * type: boolean
43
43
  * weight:
44
- * description: The wieght of the Product Variant.
44
+ * description: The weight of the Product Variant.
45
45
  * type: number
46
46
  * length:
47
47
  * description: The length of the Product Variant.
@@ -121,7 +121,7 @@ var validator_1 = require("../../../../utils/validator");
121
121
  * description: Whether Medusa should keep track of the inventory for this Product Variant.
122
122
  * type: boolean
123
123
  * weight:
124
- * description: The wieght of the Product Variant.
124
+ * description: The weight of the Product Variant.
125
125
  * type: number
126
126
  * length:
127
127
  * description: The length of the Product Variant.
@@ -0,0 +1,3 @@
1
+ import { FlagSettings } from "../../types/feature-flags";
2
+ declare const TaxInclusivePricingFeatureFlag: FlagSettings;
3
+ export default TaxInclusivePricingFeatureFlag;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var TaxInclusivePricingFeatureFlag = {
4
+ key: "tax_inclusive_pricing",
5
+ default_val: false,
6
+ env_key: "MEDUSA_FF_TAX_INCLUSIVE_PRICING",
7
+ description: "[WIP] Enable tax inclusive pricing",
8
+ };
9
+ exports.default = TaxInclusivePricingFeatureFlag;
10
+ //# sourceMappingURL=tax-inclusive-pricing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tax-inclusive-pricing.js","sourceRoot":"","sources":["../../../src/loaders/feature-flags/tax-inclusive-pricing.ts"],"names":[],"mappings":";;AAEA,IAAM,8BAA8B,GAAiB;IACnD,GAAG,EAAE,uBAAuB;IAC5B,WAAW,EAAE,KAAK;IAClB,OAAO,EAAE,iCAAiC;IAC1C,WAAW,EAAE,oCAAoC;CAClD,CAAA;AAED,kBAAe,8BAA8B,CAAA"}
@@ -22,7 +22,15 @@ exports.default = (function (_a) {
22
22
  var coreFull = path_1.default.join(__dirname, corePath);
23
23
  var core = glob_1.default.sync(coreFull, {
24
24
  cwd: __dirname,
25
- ignore: ["**/__fixtures__/**", "**/index.js", "**/index.ts"],
25
+ ignore: [
26
+ "**/__fixtures__/**",
27
+ "**/index.js",
28
+ "**/index.ts",
29
+ "**/utils.js",
30
+ "**/utils.ts",
31
+ "**/types.js",
32
+ "**/types.ts",
33
+ ],
26
34
  });
27
35
  core.forEach(function (fn) {
28
36
  var _a, _b;
@@ -1 +1 @@
1
- {"version":3,"file":"strategies.js","sourceRoot":"","sources":["../../src/loaders/strategies.ts"],"names":[],"mappings":";;;;;AAAA,8CAAuB;AACvB,8CAAuB;AACvB,iCAA4C;AAE5C,+FAAsE;AACtE,4CAAkD;AAElD,kCAAoC;AAQpC;;;GAGG;AACH,mBAAe,UAAC,EAAkD;QAAhD,SAAS,eAAA,EAAE,YAAY,kBAAA,EAAE,MAAM,Y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AE,CAAC,CAAA;QAEvC,IAAI,IAAA,+BAAkB,EAAC,MAAM,CAAC,SAAS,CAAC,EAAE;YACxC,SAAS,CAAC,WAAW,CACnB,oBAAoB,EACpB,IAAA,mBAAU,EAAC,UAAC,MAAM,IAAK,OAAA,IAAI,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,EAAhC,CAAgC,CAAC,CACzD,CAAA;YAED,SAAS,CAAC,QAAQ;gBAChB,GAAC,IAAI,IAAG,IAAA,mBAAU,EAChB,UAAC,MAAM,IAAK,OAAA,IAAI,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,EAAhC,CAAgC,CAC7C,CAAC,SAAS,EAAE;gBACb,GAAC,gBAAS,MAAM,CAAC,UAAU,CAAE,IAAG,IAAA,gBAAO,EAAC,IAAI,CAAC;gBAC7C,GAAC,oBAAa,MAAM,CAAC,SAAS,CAAE,IAAG,IAAA,gBAAO,EAAC,IAAI,CAAC;oBAChD,CAAA;SACH;aAAM;YACL,SAAS,CAAC,QAAQ;gBAChB,GAAC,IAAI,IAAG,IAAA,mBAAU,EAChB,UAAC,MAAM,IAAK,OAAA,IAAI,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,EAAhC,CAAgC,CAC7C,CAAC,SAAS,EAAE;oBACb,CAAA;SACH;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,EAAA"}
@@ -0,0 +1,7 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+ export declare const featureFlag: string;
3
+ export declare class test1659501357661 implements MigrationInterface {
4
+ name: string;
5
+ up(queryRunner: QueryRunner): Promise<void>;
6
+ down(queryRunner: QueryRunner): Promise<void>;
7
+ }