@medusajs/medusa 1.4.0 → 1.4.1
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.
- package/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +8 -0
- package/dist/api/index.d.ts +2 -0
- package/dist/api/index.js +2 -0
- package/dist/api/index.js.map +1 -1
- package/dist/api/routes/admin/currencies/index.js +2 -2
- package/dist/api/routes/admin/currencies/index.js.map +1 -1
- package/dist/api/routes/admin/currencies/list-currencies.d.ts +1 -1
- package/dist/api/routes/admin/currencies/list-currencies.js +9 -2
- package/dist/api/routes/admin/currencies/list-currencies.js.map +1 -1
- package/dist/api/routes/admin/currencies/update-currency.d.ts +2 -2
- package/dist/api/routes/admin/currencies/update-currency.js +2 -2
- package/dist/api/routes/admin/index.js +2 -0
- package/dist/api/routes/admin/index.js.map +1 -1
- package/dist/api/routes/admin/order-edits/get-order-edit.d.ts +54 -0
- package/dist/api/routes/admin/order-edits/get-order-edit.js +110 -0
- package/dist/api/routes/admin/order-edits/get-order-edit.js.map +1 -0
- package/dist/api/routes/admin/order-edits/index.d.ts +6 -0
- package/dist/api/routes/admin/order-edits/index.js +45 -0
- package/dist/api/routes/admin/order-edits/index.js.map +1 -0
- package/dist/api/routes/admin/regions/update-region.d.ts +1 -1
- package/dist/api/routes/admin/regions/update-region.js +1 -1
- package/dist/api/routes/admin/uploads/create-upload.d.ts +4 -3
- package/dist/api/routes/admin/uploads/create-upload.js +4 -3
- package/dist/api/routes/admin/uploads/create-upload.js.map +1 -1
- package/dist/api/routes/admin/users/delete-user.d.ts +1 -1
- package/dist/api/routes/admin/users/delete-user.js +1 -1
- package/dist/api/routes/store/customers/list-orders.d.ts +10 -1
- package/dist/api/routes/store/customers/list-orders.js +10 -1
- package/dist/api/routes/store/customers/list-orders.js.map +1 -1
- package/dist/api/routes/store/index.js +2 -0
- package/dist/api/routes/store/index.js.map +1 -1
- package/dist/api/routes/store/order-edits/get-order-edit.d.ts +48 -0
- package/dist/api/routes/store/order-edits/get-order-edit.js +104 -0
- package/dist/api/routes/store/order-edits/get-order-edit.js.map +1 -0
- package/dist/api/routes/store/order-edits/index.d.ts +7 -0
- package/dist/api/routes/store/order-edits/index.js +53 -0
- package/dist/api/routes/store/order-edits/index.js.map +1 -0
- package/dist/api/routes/store/products/get-product.d.ts +12 -0
- package/dist/api/routes/store/products/get-product.js +12 -0
- package/dist/api/routes/store/products/get-product.js.map +1 -1
- package/dist/models/custom-shipping-option.d.ts +1 -1
- package/dist/models/custom-shipping-option.js +1 -1
- package/dist/models/index.d.ts +2 -0
- package/dist/models/index.js +2 -0
- package/dist/models/index.js.map +1 -1
- package/dist/models/order-edit.d.ts +7 -1
- package/dist/models/order-edit.js +6 -1
- package/dist/models/order-edit.js.map +1 -1
- package/dist/models/order.d.ts +1 -1
- package/dist/models/order.js +1 -1
- package/dist/models/price-list.d.ts +3 -2
- package/dist/models/price-list.js +3 -2
- package/dist/models/price-list.js.map +1 -1
- package/dist/repositories/order-edit.d.ts +3 -1
- package/dist/repositories/order-edit.js +162 -0
- package/dist/repositories/order-edit.js.map +1 -1
- package/dist/services/cart.d.ts +1 -0
- package/dist/services/cart.js +49 -5
- package/dist/services/cart.js.map +1 -1
- package/dist/services/idempotency-key.js +3 -1
- package/dist/services/idempotency-key.js.map +1 -1
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.js +3 -1
- package/dist/services/index.js.map +1 -1
- package/dist/services/order-edit.d.ts +24 -0
- package/dist/services/order-edit.js +160 -0
- package/dist/services/order-edit.js.map +1 -0
- package/dist/strategies/cart-completion.js +39 -21
- package/dist/strategies/cart-completion.js.map +1 -1
- package/dist/types/order-edit.d.ts +3 -0
- package/dist/types/order-edit.js +25 -0
- package/dist/types/order-edit.js.map +1 -0
- package/dist/utils/get-query-config.js +10 -2
- package/dist/utils/get-query-config.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Request, Response } from "express";
|
|
2
|
+
/**
|
|
3
|
+
* @oas [get] /order-edits/{id}
|
|
4
|
+
* operationId: "GetOrderEditsOrderEdit"
|
|
5
|
+
* summary: "Retrieve an OrderEdit"
|
|
6
|
+
* description: "Retrieves a OrderEdit."
|
|
7
|
+
* parameters:
|
|
8
|
+
* - (path) id=* {string} The ID of the OrderEdit.
|
|
9
|
+
* x-codeSamples:
|
|
10
|
+
* - lang: JavaScript
|
|
11
|
+
* label: JS Client
|
|
12
|
+
* source: |
|
|
13
|
+
* import Medusa from "@medusajs/medusa-js"
|
|
14
|
+
* const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
|
15
|
+
* medusa.orderEdit.retrieve(orderEditId)
|
|
16
|
+
* .then(({ order_edit }) => {
|
|
17
|
+
* console.log(order_edit.id);
|
|
18
|
+
* });
|
|
19
|
+
* - lang: Shell
|
|
20
|
+
* label: cURL
|
|
21
|
+
* source: |
|
|
22
|
+
* curl --location --request GET 'https://medusa-url.com/store/order-edits/{id}'
|
|
23
|
+
* tags:
|
|
24
|
+
* - OrderEdit
|
|
25
|
+
* responses:
|
|
26
|
+
* 200:
|
|
27
|
+
* description: OK
|
|
28
|
+
* content:
|
|
29
|
+
* application/json:
|
|
30
|
+
* schema:
|
|
31
|
+
* properties:
|
|
32
|
+
* order_edit:
|
|
33
|
+
* $ref: "#/components/schemas/order_edit"
|
|
34
|
+
* "400":
|
|
35
|
+
* $ref: "#/components/responses/400_error"
|
|
36
|
+
* "401":
|
|
37
|
+
* $ref: "#/components/responses/unauthorized"
|
|
38
|
+
* "404":
|
|
39
|
+
* $ref: "#/components/responses/not_found_error"
|
|
40
|
+
* "409":
|
|
41
|
+
* $ref: "#/components/responses/invalid_state_error"
|
|
42
|
+
* "422":
|
|
43
|
+
* $ref: "#/components/responses/invalid_request_error"
|
|
44
|
+
* "500":
|
|
45
|
+
* $ref: "#/components/responses/500_error"
|
|
46
|
+
*/
|
|
47
|
+
declare const _default: (req: Request, res: Response) => Promise<Response<any, Record<string, any>>>;
|
|
48
|
+
export default _default;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
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;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
/**
|
|
40
|
+
* @oas [get] /order-edits/{id}
|
|
41
|
+
* operationId: "GetOrderEditsOrderEdit"
|
|
42
|
+
* summary: "Retrieve an OrderEdit"
|
|
43
|
+
* description: "Retrieves a OrderEdit."
|
|
44
|
+
* parameters:
|
|
45
|
+
* - (path) id=* {string} The ID of the OrderEdit.
|
|
46
|
+
* x-codeSamples:
|
|
47
|
+
* - lang: JavaScript
|
|
48
|
+
* label: JS Client
|
|
49
|
+
* source: |
|
|
50
|
+
* import Medusa from "@medusajs/medusa-js"
|
|
51
|
+
* const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
|
52
|
+
* medusa.orderEdit.retrieve(orderEditId)
|
|
53
|
+
* .then(({ order_edit }) => {
|
|
54
|
+
* console.log(order_edit.id);
|
|
55
|
+
* });
|
|
56
|
+
* - lang: Shell
|
|
57
|
+
* label: cURL
|
|
58
|
+
* source: |
|
|
59
|
+
* curl --location --request GET 'https://medusa-url.com/store/order-edits/{id}'
|
|
60
|
+
* tags:
|
|
61
|
+
* - OrderEdit
|
|
62
|
+
* responses:
|
|
63
|
+
* 200:
|
|
64
|
+
* description: OK
|
|
65
|
+
* content:
|
|
66
|
+
* application/json:
|
|
67
|
+
* schema:
|
|
68
|
+
* properties:
|
|
69
|
+
* order_edit:
|
|
70
|
+
* $ref: "#/components/schemas/order_edit"
|
|
71
|
+
* "400":
|
|
72
|
+
* $ref: "#/components/responses/400_error"
|
|
73
|
+
* "401":
|
|
74
|
+
* $ref: "#/components/responses/unauthorized"
|
|
75
|
+
* "404":
|
|
76
|
+
* $ref: "#/components/responses/not_found_error"
|
|
77
|
+
* "409":
|
|
78
|
+
* $ref: "#/components/responses/invalid_state_error"
|
|
79
|
+
* "422":
|
|
80
|
+
* $ref: "#/components/responses/invalid_request_error"
|
|
81
|
+
* "500":
|
|
82
|
+
* $ref: "#/components/responses/500_error"
|
|
83
|
+
*/
|
|
84
|
+
exports.default = (function (req, res) { return __awaiter(void 0, void 0, void 0, function () {
|
|
85
|
+
var orderEditService, id, retrieveConfig, orderEdit, _a, items, removedItems;
|
|
86
|
+
return __generator(this, function (_b) {
|
|
87
|
+
switch (_b.label) {
|
|
88
|
+
case 0:
|
|
89
|
+
orderEditService = req.scope.resolve("orderEditService");
|
|
90
|
+
id = req.params.id;
|
|
91
|
+
retrieveConfig = req.retrieveConfig;
|
|
92
|
+
return [4 /*yield*/, orderEditService.retrieve(id, retrieveConfig)];
|
|
93
|
+
case 1:
|
|
94
|
+
orderEdit = _b.sent();
|
|
95
|
+
return [4 /*yield*/, orderEditService.computeLineItems(id)];
|
|
96
|
+
case 2:
|
|
97
|
+
_a = _b.sent(), items = _a.items, removedItems = _a.removedItems;
|
|
98
|
+
orderEdit.items = items;
|
|
99
|
+
orderEdit.removed_items = removedItems;
|
|
100
|
+
return [2 /*return*/, res.json({ order_edit: orderEdit })];
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
}); });
|
|
104
|
+
//# sourceMappingURL=get-order-edit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-order-edit.js","sourceRoot":"","sources":["../../../../../src/api/routes/store/order-edits/get-order-edit.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,mBAAe,UAAO,GAAY,EAAE,GAAa;;;;;gBACzC,gBAAgB,GACpB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAA;gBAE/B,EAAE,GAAK,GAAG,CAAC,MAAM,GAAf,CAAe;gBACnB,cAAc,GAAG,GAAG,CAAC,cAAc,CAAA;gBAEvB,qBAAM,gBAAgB,CAAC,QAAQ,CAAC,EAAE,EAAE,cAAc,CAAC,EAAA;;gBAA/D,SAAS,GAAG,SAAmD;gBACrC,qBAAM,gBAAgB,CAAC,gBAAgB,CAAC,EAAE,CAAC,EAAA;;gBAArE,KAA0B,SAA2C,EAAnE,KAAK,WAAA,EAAE,YAAY,kBAAA;gBAC3B,SAAS,CAAC,KAAK,GAAG,KAAK,CAAA;gBACvB,SAAS,CAAC,aAAa,GAAG,YAAY,CAAA;gBAEtC,sBAAO,GAAG,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,EAAA;;;KAC3C,EAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { OrderEdit } from "../../../../models";
|
|
2
|
+
declare const _default: (app: any) => any;
|
|
3
|
+
export default _default;
|
|
4
|
+
export declare type StoreOrderEditsRes = {
|
|
5
|
+
order_edit: Omit<OrderEdit, "internal_note" | "created_by" | "confirmed_by" | "canceled_by">;
|
|
6
|
+
};
|
|
7
|
+
export declare const storeOrderEditNotAllowedFields: string[];
|
|
@@ -0,0 +1,53 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.storeOrderEditNotAllowedFields = void 0;
|
|
30
|
+
var express_1 = require("express");
|
|
31
|
+
var middlewares_1 = __importStar(require("../../../middlewares"));
|
|
32
|
+
var common_1 = require("../../../../types/common");
|
|
33
|
+
var feature_flag_enabled_1 = require("../../../middlewares/feature-flag-enabled");
|
|
34
|
+
var order_editing_1 = __importDefault(require("../../../../loaders/feature-flags/order-editing"));
|
|
35
|
+
var order_edit_1 = require("../../../../types/order-edit");
|
|
36
|
+
var route = (0, express_1.Router)();
|
|
37
|
+
exports.default = (function (app) {
|
|
38
|
+
app.use("/order-edits", (0, feature_flag_enabled_1.isFeatureFlagEnabled)(order_editing_1.default.key), route);
|
|
39
|
+
route.get("/:id", (0, middlewares_1.transformQuery)(common_1.EmptyQueryParams, {
|
|
40
|
+
defaultRelations: order_edit_1.defaultOrderEditRelations.filter(function (field) { return !exports.storeOrderEditNotAllowedFields.includes(field); }),
|
|
41
|
+
defaultFields: order_edit_1.defaultOrderEditFields.filter(function (field) { return !exports.storeOrderEditNotAllowedFields.includes(field); }),
|
|
42
|
+
allowedFields: order_edit_1.defaultOrderEditFields,
|
|
43
|
+
isList: false,
|
|
44
|
+
}), middlewares_1.default.wrap(require("./get-order-edit").default));
|
|
45
|
+
return app;
|
|
46
|
+
});
|
|
47
|
+
exports.storeOrderEditNotAllowedFields = [
|
|
48
|
+
"internal_note",
|
|
49
|
+
"created_by",
|
|
50
|
+
"confirmed_by",
|
|
51
|
+
"canceled_by",
|
|
52
|
+
];
|
|
53
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/api/routes/store/order-edits/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAgC;AAChC,kEAAkE;AAClE,mDAA2D;AAC3D,kFAAgF;AAChF,kGAAqF;AACrF,2DAGqC;AAGrC,IAAM,KAAK,GAAG,IAAA,gBAAM,GAAE,CAAA;AAEtB,mBAAe,UAAC,GAAG;IACjB,GAAG,CAAC,GAAG,CACL,cAAc,EACd,IAAA,2CAAoB,EAAC,uBAAuB,CAAC,GAAG,CAAC,EACjD,KAAK,CACN,CAAA;IAED,KAAK,CAAC,GAAG,CACP,MAAM,EACN,IAAA,4BAAc,EAAC,yBAAgB,EAAE;QAC/B,gBAAgB,EAAE,sCAAyB,CAAC,MAAM,CAChD,UAAC,KAAK,IAAK,OAAA,CAAC,sCAA8B,CAAC,QAAQ,CAAC,KAAK,CAAC,EAA/C,CAA+C,CAC3D;QACD,aAAa,EAAE,mCAAsB,CAAC,MAAM,CAC1C,UAAC,KAAK,IAAK,OAAA,CAAC,sCAA8B,CAAC,QAAQ,CAAC,KAAK,CAAC,EAA/C,CAA+C,CAC3D;QACD,aAAa,EAAE,mCAAsB;QACrC,MAAM,EAAE,KAAK;KACd,CAAC,EACF,qBAAW,CAAC,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,OAAO,CAAC,CACtD,CAAA;IAED,OAAO,GAAG,CAAA;AACZ,CAAC,EAAA;AASY,QAAA,8BAA8B,GAAG;IAC5C,eAAe;IACf,YAAY;IACZ,cAAc;IACd,aAAa;CACd,CAAA"}
|
|
@@ -5,6 +5,18 @@
|
|
|
5
5
|
* description: "Retrieves a Product."
|
|
6
6
|
* parameters:
|
|
7
7
|
* - (path) id=* {string} The id of the Product.
|
|
8
|
+
* - (query) cart_id {string} The ID of the customer's cart.
|
|
9
|
+
* - (query) region_id {string} The ID of the region the customer is using. This is helpful to ensure correct prices are retrieved for a region.
|
|
10
|
+
* - in: query
|
|
11
|
+
* name: currency_code
|
|
12
|
+
* style: form
|
|
13
|
+
* explode: false
|
|
14
|
+
* description: The 3 character ISO currency code to set prices based on. This is helpful to ensure correct prices are retrieved for a currency.
|
|
15
|
+
* schema:
|
|
16
|
+
* type: string
|
|
17
|
+
* externalDocs:
|
|
18
|
+
* url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes
|
|
19
|
+
* description: See a list of codes.
|
|
8
20
|
* x-codeSamples:
|
|
9
21
|
* - lang: JavaScript
|
|
10
22
|
* label: JS Client
|
|
@@ -62,6 +62,18 @@ var validator_1 = require("../../../../utils/validator");
|
|
|
62
62
|
* description: "Retrieves a Product."
|
|
63
63
|
* parameters:
|
|
64
64
|
* - (path) id=* {string} The id of the Product.
|
|
65
|
+
* - (query) cart_id {string} The ID of the customer's cart.
|
|
66
|
+
* - (query) region_id {string} The ID of the region the customer is using. This is helpful to ensure correct prices are retrieved for a region.
|
|
67
|
+
* - in: query
|
|
68
|
+
* name: currency_code
|
|
69
|
+
* style: form
|
|
70
|
+
* explode: false
|
|
71
|
+
* description: The 3 character ISO currency code to set prices based on. This is helpful to ensure correct prices are retrieved for a currency.
|
|
72
|
+
* schema:
|
|
73
|
+
* type: string
|
|
74
|
+
* externalDocs:
|
|
75
|
+
* url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes
|
|
76
|
+
* description: See a list of codes.
|
|
65
77
|
* x-codeSamples:
|
|
66
78
|
* - lang: JavaScript
|
|
67
79
|
* label: JS Client
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-product.js","sourceRoot":"","sources":["../../../../../src/api/routes/store/products/get-product.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sBAAiD;AAOjD,qEAAwE;AACxE,yDAAuD;AAEvD
|
|
1
|
+
{"version":3,"file":"get-product.js","sourceRoot":"","sources":["../../../../../src/api/routes/store/products/get-product.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sBAAiD;AAOjD,qEAAwE;AACxE,yDAAuD;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,mBAAe,UAAO,GAAG,EAAE,GAAG;;;;;;gBACpB,EAAE,GAAK,GAAG,CAAC,MAAM,GAAf,CAAe;gBAEP,qBAAM,IAAA,qBAAS,EAAC,sCAAoB,EAAE,GAAG,CAAC,KAAK,CAAC,EAAA;;gBAA5D,SAAS,GAAG,SAAgD;gBAE5D,WAAW,GAAG,MAAA,GAAG,CAAC,IAAI,0CAAE,WAAW,CAAA;gBAEnC,cAAc,GAAmB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAA;gBACpE,cAAc,GAAmB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAA;gBACpE,WAAW,GAAgB,GAAG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|
58
58
|
* description: An optional key-value map with additional details
|
|
59
59
|
* example: {car: "white"}
|
|
60
|
-
*
|
|
60
|
+
* includes_tax:
|
|
61
61
|
* description: "[EXPERIMENTAL] Indicates if the custom shipping option price include tax"
|
|
62
62
|
* type: boolean
|
|
63
63
|
*/
|
|
@@ -127,7 +127,7 @@ exports.CustomShippingOption = CustomShippingOption;
|
|
|
127
127
|
* type: object
|
|
128
128
|
* description: An optional key-value map with additional details
|
|
129
129
|
* example: {car: "white"}
|
|
130
|
-
*
|
|
130
|
+
* includes_tax:
|
|
131
131
|
* description: "[EXPERIMENTAL] Indicates if the custom shipping option price include tax"
|
|
132
132
|
* type: boolean
|
|
133
133
|
*/
|
package/dist/models/index.d.ts
CHANGED
|
@@ -35,6 +35,8 @@ export * from "./note";
|
|
|
35
35
|
export * from "./notification";
|
|
36
36
|
export * from "./oauth";
|
|
37
37
|
export * from "./order";
|
|
38
|
+
export * from "./order-edit";
|
|
39
|
+
export * from "./order-item-change";
|
|
38
40
|
export * from "./payment";
|
|
39
41
|
export * from "./payment-provider";
|
|
40
42
|
export * from "./payment-session";
|
package/dist/models/index.js
CHANGED
|
@@ -51,6 +51,8 @@ __exportStar(require("./note"), exports);
|
|
|
51
51
|
__exportStar(require("./notification"), exports);
|
|
52
52
|
__exportStar(require("./oauth"), exports);
|
|
53
53
|
__exportStar(require("./order"), exports);
|
|
54
|
+
__exportStar(require("./order-edit"), exports);
|
|
55
|
+
__exportStar(require("./order-item-change"), exports);
|
|
54
56
|
__exportStar(require("./payment"), exports);
|
|
55
57
|
__exportStar(require("./payment-provider"), exports);
|
|
56
58
|
__exportStar(require("./payment-session"), exports);
|
package/dist/models/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAAyB;AACzB,8CAA2B;AAC3B,yCAAsB;AACtB,gDAA6B;AAC7B,+CAA4B;AAC5B,gDAA6B;AAC7B,8CAA2B;AAC3B,4CAAyB;AACzB,6CAA0B;AAC1B,2DAAwC;AACxC,6CAA0B;AAC1B,mDAAgC;AAChC,6CAA0B;AAC1B,uDAAoC;AACpC,sEAAmD;AACnD,+DAA4C;AAC5C,0EAAuD;AACvD,mEAAgD;AAChD,oEAAiD;AACjD,kDAA+B;AAC/B,gDAA6B;AAC7B,gDAA6B;AAC7B,qDAAkC;AAClC,yDAAsC;AACtC,8CAA2B;AAC3B,0DAAuC;AACvC,oDAAiC;AACjC,0CAAuB;AACvB,2CAAwB;AACxB,8CAA2B;AAC3B,yDAAsC;AACtC,uDAAoC;AACpC,iDAA8B;AAC9B,yCAAsB;AACtB,iDAA8B;AAC9B,0CAAuB;AACvB,0CAAuB;AACvB,4CAAyB;AACzB,qDAAkC;AAClC,oDAAiC;AACjC,+CAA4B;AAC5B,4CAAyB;AACzB,uDAAoC;AACpC,mDAAgC;AAChC,yDAAsC;AACtC,gDAA6B;AAC7B,qDAAkC;AAClC,iDAA8B;AAC9B,0DAAuC;AACvC,oDAAiC;AACjC,2CAAwB;AACxB,2CAAwB;AACxB,2CAAwB;AACxB,gDAA6B;AAC7B,kDAA+B;AAC/B,kDAA+B;AAC/B,oDAAiC;AACjC,6DAA0C;AAC1C,oDAAiC;AACjC,gEAA6C;AAC7C,qDAAkC;AAClC,sDAAmC;AACnC,+CAA4B;AAC5B,0CAAuB;AACvB,yCAAsB;AACtB,iDAA8B;AAC9B,6CAA0B;AAC1B,kDAA+B;AAC/B,yCAAsB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAAyB;AACzB,8CAA2B;AAC3B,yCAAsB;AACtB,gDAA6B;AAC7B,+CAA4B;AAC5B,gDAA6B;AAC7B,8CAA2B;AAC3B,4CAAyB;AACzB,6CAA0B;AAC1B,2DAAwC;AACxC,6CAA0B;AAC1B,mDAAgC;AAChC,6CAA0B;AAC1B,uDAAoC;AACpC,sEAAmD;AACnD,+DAA4C;AAC5C,0EAAuD;AACvD,mEAAgD;AAChD,oEAAiD;AACjD,kDAA+B;AAC/B,gDAA6B;AAC7B,gDAA6B;AAC7B,qDAAkC;AAClC,yDAAsC;AACtC,8CAA2B;AAC3B,0DAAuC;AACvC,oDAAiC;AACjC,0CAAuB;AACvB,2CAAwB;AACxB,8CAA2B;AAC3B,yDAAsC;AACtC,uDAAoC;AACpC,iDAA8B;AAC9B,yCAAsB;AACtB,iDAA8B;AAC9B,0CAAuB;AACvB,0CAAuB;AACvB,+CAA4B;AAC5B,sDAAmC;AACnC,4CAAyB;AACzB,qDAAkC;AAClC,oDAAiC;AACjC,+CAA4B;AAC5B,4CAAyB;AACzB,uDAAoC;AACpC,mDAAgC;AAChC,yDAAsC;AACtC,gDAA6B;AAC7B,qDAAkC;AAClC,iDAA8B;AAC9B,0DAAuC;AACvC,oDAAiC;AACjC,2CAAwB;AACxB,2CAAwB;AACxB,2CAAwB;AACxB,gDAA6B;AAC7B,kDAA+B;AAC/B,kDAA+B;AAC/B,oDAAiC;AACjC,6DAA0C;AAC1C,oDAAiC;AACjC,gEAA6C;AAC7C,qDAAkC;AAClC,sDAAmC;AACnC,+CAA4B;AAC5B,0CAAuB;AACvB,yCAAsB;AACtB,iDAA8B;AAC9B,6CAA0B;AAC1B,kDAA+B;AAC/B,yCAAsB"}
|
|
@@ -23,6 +23,7 @@ export declare class OrderEdit extends SoftDeletableEntity {
|
|
|
23
23
|
total: number;
|
|
24
24
|
difference_due: number;
|
|
25
25
|
items: LineItem[];
|
|
26
|
+
removed_items: LineItem[];
|
|
26
27
|
private beforeInsert;
|
|
27
28
|
}
|
|
28
29
|
/**
|
|
@@ -51,7 +52,7 @@ export declare class OrderEdit extends SoftDeletableEntity {
|
|
|
51
52
|
* type: array
|
|
52
53
|
* description: Line item changes array.
|
|
53
54
|
* items:
|
|
54
|
-
* $ref: "#/components/schemas/
|
|
55
|
+
* $ref: "#/components/schemas/order_item_change"
|
|
55
56
|
* internal_note:
|
|
56
57
|
* description: "An optional note with additional details about the order edit."
|
|
57
58
|
* type: string
|
|
@@ -108,4 +109,9 @@ export declare class OrderEdit extends SoftDeletableEntity {
|
|
|
108
109
|
* description: Computed line items from the changes.
|
|
109
110
|
* items:
|
|
110
111
|
* $ref: "#/components/schemas/line_item"
|
|
112
|
+
* removed_items:
|
|
113
|
+
* type: array
|
|
114
|
+
* description: Computed line items from the changes that have been marked as deleted.
|
|
115
|
+
* removed_items:
|
|
116
|
+
* $ref: "#/components/schemas/line_item"
|
|
111
117
|
*/
|
|
@@ -143,7 +143,7 @@ exports.OrderEdit = OrderEdit;
|
|
|
143
143
|
* type: array
|
|
144
144
|
* description: Line item changes array.
|
|
145
145
|
* items:
|
|
146
|
-
* $ref: "#/components/schemas/
|
|
146
|
+
* $ref: "#/components/schemas/order_item_change"
|
|
147
147
|
* internal_note:
|
|
148
148
|
* description: "An optional note with additional details about the order edit."
|
|
149
149
|
* type: string
|
|
@@ -200,5 +200,10 @@ exports.OrderEdit = OrderEdit;
|
|
|
200
200
|
* description: Computed line items from the changes.
|
|
201
201
|
* items:
|
|
202
202
|
* $ref: "#/components/schemas/line_item"
|
|
203
|
+
* removed_items:
|
|
204
|
+
* type: array
|
|
205
|
+
* description: Computed line items from the changes that have been marked as deleted.
|
|
206
|
+
* removed_items:
|
|
207
|
+
* $ref: "#/components/schemas/line_item"
|
|
203
208
|
*/
|
|
204
209
|
//# sourceMappingURL=order-edit.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"order-edit.js","sourceRoot":"","sources":["../../src/models/order-edit.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAgF;AAEhF,yFAA4E;AAC5E,4EAAoE;AACpE,4DAAwD;AACxD,yDAAqD;AACrD,4CAAmD;AACnD,kCAA2C;AAE3C,iCAA+B;AAG/B;IAA+B,6BAAmB;IAAlD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;IAGrB;QADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,IAAA,+BAAa,EAAC,aAAa,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;kCAChD,IAAI;mDAAA;IAGnB;QADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACP;IAGpB;QADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDACH;IAGxB;QADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,IAAA,+BAAa,EAAC,aAAa,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;kCACjD,IAAI;kDAAA;IAGlB;QADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACP;IAGpB;QADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,IAAA,+BAAa,EAAC,aAAa,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;kCACjD,IAAI;QAElB,WAAW;;kDAFO;IAalB;QADC,IAAA,sBAAY,GAAE;;;;iDAGd;IA3DU,SAAS;QADrB,IAAA,2CAAiB,EAAC,uBAAuB,CAAC,GAAG,CAAC;OAClC,SAAS,CA4DrB;IAAD,gBAAC;CAAA,AA5DD,CAA+B,gCAAmB,GA4DjD;AA5DY,8BAAS;AA8DtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwFG"}
|
package/dist/models/order.d.ts
CHANGED
|
@@ -271,7 +271,7 @@ export declare class Order extends BaseEntity {
|
|
|
271
271
|
* $ref: "#/components/schemas/line_item"
|
|
272
272
|
* edits:
|
|
273
273
|
* type: array
|
|
274
|
-
* description: [EXPERIMENTAL] Order edits done on the order. Available if the relation `edits` is expanded.
|
|
274
|
+
* description: "[EXPERIMENTAL] Order edits done on the order. Available if the relation `edits` is expanded."
|
|
275
275
|
* items:
|
|
276
276
|
* $ref: "#/components/schemas/order_edit"
|
|
277
277
|
* gift_card_transactions:
|
package/dist/models/order.js
CHANGED
|
@@ -541,7 +541,7 @@ exports.Order = Order;
|
|
|
541
541
|
* $ref: "#/components/schemas/line_item"
|
|
542
542
|
* edits:
|
|
543
543
|
* type: array
|
|
544
|
-
* description: [EXPERIMENTAL] Order edits done on the order. Available if the relation `edits` is expanded.
|
|
544
|
+
* description: "[EXPERIMENTAL] Order edits done on the order. Available if the relation `edits` is expanded."
|
|
545
545
|
* items:
|
|
546
546
|
* $ref: "#/components/schemas/order_edit"
|
|
547
547
|
* gift_card_transactions:
|
|
@@ -67,8 +67,9 @@ export declare class PriceList extends SoftDeletableEntity {
|
|
|
67
67
|
* description: The Money Amounts that are associated with the Price List. Available if the relation `prices` is expanded.
|
|
68
68
|
* type: array
|
|
69
69
|
* items:
|
|
70
|
-
*
|
|
71
|
-
*
|
|
70
|
+
* oneOf:
|
|
71
|
+
* - $ref: "#/components/schemas/money_amount"
|
|
72
|
+
* - $ref: "#/components/schemas/customer_group"
|
|
72
73
|
* includes_tax:
|
|
73
74
|
* description: "[EXPERIMENTAL] Does the price list prices include tax"
|
|
74
75
|
* type: boolean
|
|
@@ -164,8 +164,9 @@ exports.PriceList = PriceList;
|
|
|
164
164
|
* description: The Money Amounts that are associated with the Price List. Available if the relation `prices` is expanded.
|
|
165
165
|
* type: array
|
|
166
166
|
* items:
|
|
167
|
-
*
|
|
168
|
-
*
|
|
167
|
+
* oneOf:
|
|
168
|
+
* - $ref: "#/components/schemas/money_amount"
|
|
169
|
+
* - $ref: "#/components/schemas/customer_group"
|
|
169
170
|
* includes_tax:
|
|
170
171
|
* description: "[EXPERIMENTAL] Does the price list prices include tax"
|
|
171
172
|
* type: boolean
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"price-list.js","sourceRoot":"","sources":["../../src/models/price-list.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;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,4 +1,6 @@
|
|
|
1
|
-
import { Repository } from "typeorm";
|
|
1
|
+
import { FindManyOptions, Repository } from "typeorm";
|
|
2
2
|
import { OrderEdit } from "../models/order-edit";
|
|
3
3
|
export declare class OrderEditRepository extends Repository<OrderEdit> {
|
|
4
|
+
findWithRelations(relations?: (keyof OrderEdit | string)[], idsOrOptionsWithoutRelations?: Omit<FindManyOptions<OrderEdit>, "relations"> | string[]): Promise<[OrderEdit[], number]>;
|
|
5
|
+
findOneWithRelations(relations?: Array<keyof OrderEdit>, optionsWithoutRelations?: Omit<FindManyOptions<OrderEdit>, "relations">): Promise<OrderEdit>;
|
|
4
6
|
}
|
|
@@ -20,15 +20,177 @@ 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
|
+
};
|
|
59
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
60
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
61
|
+
if (!m) return o;
|
|
62
|
+
var i = m.call(o), r, ar = [], e;
|
|
63
|
+
try {
|
|
64
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
65
|
+
}
|
|
66
|
+
catch (error) { e = { error: error }; }
|
|
67
|
+
finally {
|
|
68
|
+
try {
|
|
69
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
70
|
+
}
|
|
71
|
+
finally { if (e) throw e.error; }
|
|
72
|
+
}
|
|
73
|
+
return ar;
|
|
74
|
+
};
|
|
75
|
+
var __values = (this && this.__values) || function(o) {
|
|
76
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
77
|
+
if (m) return m.call(o);
|
|
78
|
+
if (o && typeof o.length === "number") return {
|
|
79
|
+
next: function () {
|
|
80
|
+
if (o && i >= o.length) o = void 0;
|
|
81
|
+
return { value: o && o[i++], done: !o };
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
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
|
+
};
|
|
23
95
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
96
|
exports.OrderEditRepository = void 0;
|
|
25
97
|
var typeorm_1 = require("typeorm");
|
|
26
98
|
var order_edit_1 = require("../models/order-edit");
|
|
99
|
+
var lodash_1 = require("lodash");
|
|
27
100
|
var OrderEditRepository = /** @class */ (function (_super) {
|
|
28
101
|
__extends(OrderEditRepository, _super);
|
|
29
102
|
function OrderEditRepository() {
|
|
30
103
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
31
104
|
}
|
|
105
|
+
OrderEditRepository.prototype.findWithRelations = function (relations, idsOrOptionsWithoutRelations) {
|
|
106
|
+
if (relations === void 0) { relations = []; }
|
|
107
|
+
if (idsOrOptionsWithoutRelations === void 0) { idsOrOptionsWithoutRelations = {}; }
|
|
108
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
109
|
+
var entities, count, _a, results, resultCount, entitiesIds, groupedRelations, relations_1, relations_1_1, rel, _b, topLevel, entitiesIdsWithRelations, entitiesAndRelations, entitiesAndRelationsById;
|
|
110
|
+
var e_1, _c;
|
|
111
|
+
var _this = this;
|
|
112
|
+
return __generator(this, function (_d) {
|
|
113
|
+
switch (_d.label) {
|
|
114
|
+
case 0:
|
|
115
|
+
entities = [];
|
|
116
|
+
if (!Array.isArray(idsOrOptionsWithoutRelations)) return [3 /*break*/, 2];
|
|
117
|
+
return [4 /*yield*/, this.findByIds(idsOrOptionsWithoutRelations)];
|
|
118
|
+
case 1:
|
|
119
|
+
entities = _d.sent();
|
|
120
|
+
count = idsOrOptionsWithoutRelations.length;
|
|
121
|
+
return [3 /*break*/, 4];
|
|
122
|
+
case 2: return [4 /*yield*/, this.findAndCount(idsOrOptionsWithoutRelations)];
|
|
123
|
+
case 3:
|
|
124
|
+
_a = __read.apply(void 0, [_d.sent(), 2]), results = _a[0], resultCount = _a[1];
|
|
125
|
+
entities = results;
|
|
126
|
+
count = resultCount;
|
|
127
|
+
_d.label = 4;
|
|
128
|
+
case 4:
|
|
129
|
+
entitiesIds = entities.map(function (_a) {
|
|
130
|
+
var id = _a.id;
|
|
131
|
+
return id;
|
|
132
|
+
});
|
|
133
|
+
groupedRelations = {};
|
|
134
|
+
try {
|
|
135
|
+
for (relations_1 = __values(relations), relations_1_1 = relations_1.next(); !relations_1_1.done; relations_1_1 = relations_1.next()) {
|
|
136
|
+
rel = relations_1_1.value;
|
|
137
|
+
_b = __read(rel.split("."), 1), topLevel = _b[0];
|
|
138
|
+
if (groupedRelations[topLevel]) {
|
|
139
|
+
groupedRelations[topLevel].push(rel);
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
groupedRelations[topLevel] = [rel];
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
147
|
+
finally {
|
|
148
|
+
try {
|
|
149
|
+
if (relations_1_1 && !relations_1_1.done && (_c = relations_1.return)) _c.call(relations_1);
|
|
150
|
+
}
|
|
151
|
+
finally { if (e_1) throw e_1.error; }
|
|
152
|
+
}
|
|
153
|
+
return [4 /*yield*/, Promise.all(Object.entries(groupedRelations).map(function (_a) {
|
|
154
|
+
var _b = __read(_a, 2), _ = _b[0], rels = _b[1];
|
|
155
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
156
|
+
return __generator(this, function (_c) {
|
|
157
|
+
return [2 /*return*/, this.findByIds(entitiesIds, {
|
|
158
|
+
select: ["id"],
|
|
159
|
+
relations: rels,
|
|
160
|
+
})];
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
})).then(lodash_1.flatten)];
|
|
164
|
+
case 5:
|
|
165
|
+
entitiesIdsWithRelations = _d.sent();
|
|
166
|
+
entitiesAndRelations = entitiesIdsWithRelations.concat(entities);
|
|
167
|
+
entitiesAndRelationsById = (0, lodash_1.groupBy)(entitiesAndRelations, "id");
|
|
168
|
+
return [2 /*return*/, [
|
|
169
|
+
Object.values(entitiesAndRelationsById).map(function (v) { return lodash_1.merge.apply(void 0, __spreadArray([{}], __read(v), false)); }),
|
|
170
|
+
count,
|
|
171
|
+
]];
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
};
|
|
176
|
+
OrderEditRepository.prototype.findOneWithRelations = function (relations, optionsWithoutRelations) {
|
|
177
|
+
if (relations === void 0) { relations = []; }
|
|
178
|
+
if (optionsWithoutRelations === void 0) { optionsWithoutRelations = {}; }
|
|
179
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
180
|
+
var _a, result;
|
|
181
|
+
return __generator(this, function (_b) {
|
|
182
|
+
switch (_b.label) {
|
|
183
|
+
case 0:
|
|
184
|
+
// Limit 1
|
|
185
|
+
optionsWithoutRelations.take = 1;
|
|
186
|
+
return [4 /*yield*/, this.findWithRelations(relations, optionsWithoutRelations)];
|
|
187
|
+
case 1:
|
|
188
|
+
_a = __read.apply(void 0, [_b.sent(), 1]), result = _a[0];
|
|
189
|
+
return [2 /*return*/, result[0]];
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
});
|
|
193
|
+
};
|
|
32
194
|
OrderEditRepository = __decorate([
|
|
33
195
|
(0, typeorm_1.EntityRepository)(order_edit_1.OrderEdit)
|
|
34
196
|
], OrderEditRepository);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"order-edit.js","sourceRoot":"","sources":["../../src/repositories/order-edit.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"order-edit.js","sourceRoot":"","sources":["../../src/repositories/order-edit.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAuE;AAEvE,mDAAgD;AAChD,iCAAgD;AAGhD;IAAyC,uCAAqB;IAA9D;;IA6DA,CAAC;IA5Dc,+CAAiB,GAA9B,UACE,SAA4C,EAC5C,4BAEiB;QAHjB,0BAAA,EAAA,cAA4C;QAC5C,6CAAA,EAAA,iCAEiB;;;;;;;;wBAEb,QAAQ,GAAgB,EAAE,CAAA;6BAE1B,KAAK,CAAC,OAAO,CAAC,4BAA4B,CAAC,EAA3C,wBAA2C;wBAClC,qBAAM,IAAI,CAAC,SAAS,CAAC,4BAA4B,CAAC,EAAA;;wBAA7D,QAAQ,GAAG,SAAkD,CAAA;wBAC7D,KAAK,GAAG,4BAA4B,CAAC,MAAM,CAAA;;4BAEZ,qBAAM,IAAI,CAAC,YAAY,CACpD,4BAA4B,CAC7B,EAAA;;wBAFK,KAAA,sBAAyB,SAE9B,KAA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