@medusajs/medusa 2.6.0-snapshot-20250221164338 → 3.0.0-preview-20250211091350
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/dist/api/admin/draft-orders/[id]/route.d.ts +1 -3
- package/dist/api/admin/draft-orders/[id]/route.d.ts.map +1 -1
- package/dist/api/admin/draft-orders/[id]/route.js +8 -33
- package/dist/api/admin/draft-orders/[id]/route.js.map +1 -1
- package/dist/api/admin/draft-orders/middlewares.d.ts.map +1 -1
- package/dist/api/admin/draft-orders/middlewares.js +4 -11
- package/dist/api/admin/draft-orders/middlewares.js.map +1 -1
- package/dist/api/admin/draft-orders/query-config.d.ts.map +1 -1
- package/dist/api/admin/draft-orders/query-config.js +0 -6
- package/dist/api/admin/draft-orders/query-config.js.map +1 -1
- package/dist/api/admin/draft-orders/route.d.ts +1 -1
- package/dist/api/admin/draft-orders/route.d.ts.map +1 -1
- package/dist/api/admin/draft-orders/route.js +16 -37
- package/dist/api/admin/draft-orders/route.js.map +1 -1
- package/dist/api/admin/draft-orders/validators.d.ts +38 -168
- package/dist/api/admin/draft-orders/validators.d.ts.map +1 -1
- package/dist/api/admin/draft-orders/validators.js +9 -20
- package/dist/api/admin/draft-orders/validators.js.map +1 -1
- package/dist/api/admin/products/middlewares.d.ts.map +1 -1
- package/dist/api/admin/products/middlewares.js +5 -11
- package/dist/api/admin/products/middlewares.js.map +1 -1
- package/dist/api/admin/products/route.d.ts.map +1 -1
- package/dist/api/admin/products/route.js +2 -34
- package/dist/api/admin/products/route.js.map +1 -1
- package/dist/api/admin/products/validators.d.ts +17 -17
- package/dist/api/admin/products/validators.js +2 -2
- package/dist/api/admin/products/validators.js.map +1 -1
- package/dist/api/store/products/helpers.d.ts.map +1 -1
- package/dist/api/store/products/helpers.js.map +1 -1
- package/dist/api/store/products/middlewares.d.ts.map +1 -1
- package/dist/api/store/products/middlewares.js +5 -14
- package/dist/api/store/products/middlewares.js.map +1 -1
- package/dist/api/store/products/route.d.ts +1 -1
- package/dist/api/store/products/route.d.ts.map +1 -1
- package/dist/api/store/products/route.js +2 -54
- package/dist/api/store/products/route.js.map +1 -1
- package/dist/api/store/products/validators.d.ts +6 -6
- package/dist/api/utils/common-validators/products/index.d.ts +12 -12
- package/dist/api/utils/common-validators/products/index.d.ts.map +1 -1
- package/dist/api/utils/common-validators/products/index.js +6 -10
- package/dist/api/utils/common-validators/products/index.js.map +1 -1
- package/dist/commands/plugin/db/generate.d.ts.map +1 -1
- package/dist/commands/plugin/db/generate.js +3 -7
- package/dist/commands/plugin/db/generate.js.map +1 -1
- package/dist/commands/start.d.ts.map +1 -1
- package/dist/commands/start.js +1 -1
- package/dist/commands/start.js.map +1 -1
- package/dist/instrumentation/index.d.ts +4 -3
- package/dist/instrumentation/index.d.ts.map +1 -1
- package/dist/instrumentation/index.js +20 -38
- package/dist/instrumentation/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +49 -52
- package/dist/loaders/feature-flags/index-engine.d.ts +0 -4
- package/dist/loaders/feature-flags/index-engine.d.ts.map +0 -1
- package/dist/loaders/feature-flags/index-engine.js +0 -10
- package/dist/loaders/feature-flags/index-engine.js.map +0 -1
@@ -1,6 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { MedusaRequest, MedusaResponse } from "@medusajs/framework/http";
|
2
2
|
import { HttpTypes } from "@medusajs/framework/types";
|
3
|
-
import { AdminUpdateDraftOrderType } from "../validators";
|
4
3
|
export declare const GET: (req: MedusaRequest, res: MedusaResponse<HttpTypes.AdminDraftOrderResponse>) => Promise<void>;
|
5
|
-
export declare const POST: (req: AuthenticatedMedusaRequest<AdminUpdateDraftOrderType>, res: MedusaResponse<HttpTypes.AdminDraftOrderResponse>) => Promise<void>;
|
6
4
|
//# sourceMappingURL=route.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../src/api/admin/draft-orders/[id]/route.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../src/api/admin/draft-orders/[id]/route.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAGxE,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAErD,eAAO,MAAM,GAAG,QACT,aAAa,OACb,cAAc,CAAC,SAAS,CAAC,uBAAuB,CAAC,kBAgBvD,CAAA"}
|
@@ -1,40 +1,15 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
4
|
-
const core_flows_1 = require("@medusajs/core-flows");
|
3
|
+
exports.GET = void 0;
|
5
4
|
const utils_1 = require("@medusajs/framework/utils");
|
5
|
+
const helpers_1 = require("../helpers");
|
6
|
+
const query_config_1 = require("../query-config");
|
6
7
|
const GET = async (req, res) => {
|
7
|
-
const
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
version: req.validatedQuery.version,
|
13
|
-
filters: {
|
14
|
-
is_draft_order: true,
|
15
|
-
},
|
16
|
-
},
|
17
|
-
});
|
18
|
-
res.status(200).json({ draft_order: result });
|
8
|
+
const draftOrder = await (0, helpers_1.refetchOrder)(req.params.id, req.scope, query_config_1.defaultAdminOrderFields);
|
9
|
+
if (!draftOrder) {
|
10
|
+
throw new utils_1.MedusaError(utils_1.MedusaError.Types.NOT_FOUND, `Draft order with id: ${req.params.id} was not found`);
|
11
|
+
}
|
12
|
+
res.status(200).json({ draft_order: draftOrder });
|
19
13
|
};
|
20
14
|
exports.GET = GET;
|
21
|
-
const POST = async (req, res) => {
|
22
|
-
const query = req.scope.resolve(utils_1.ContainerRegistrationKeys.QUERY);
|
23
|
-
await (0, core_flows_1.updateOrderWorkflow)(req.scope).run({
|
24
|
-
input: {
|
25
|
-
...req.validatedBody,
|
26
|
-
user_id: req.auth_context.actor_id,
|
27
|
-
id: req.params.id,
|
28
|
-
},
|
29
|
-
});
|
30
|
-
const result = await query.graph({
|
31
|
-
entity: "order",
|
32
|
-
filters: { id: req.params.id },
|
33
|
-
fields: req.queryConfig.fields,
|
34
|
-
});
|
35
|
-
res
|
36
|
-
.status(200)
|
37
|
-
.json({ draft_order: result.data[0] });
|
38
|
-
};
|
39
|
-
exports.POST = POST;
|
40
15
|
//# sourceMappingURL=route.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"route.js","sourceRoot":"","sources":["../../../../../src/api/admin/draft-orders/[id]/route.ts"],"names":[],"mappings":";;;AAAA,
|
1
|
+
{"version":3,"file":"route.js","sourceRoot":"","sources":["../../../../../src/api/admin/draft-orders/[id]/route.ts"],"names":[],"mappings":";;;AAAA,qDAAuD;AAEvD,wCAAyC;AACzC,kDAAyD;AAGlD,MAAM,GAAG,GAAG,KAAK,EACtB,GAAkB,EAClB,GAAsD,EACtD,EAAE;IACF,MAAM,UAAU,GAAG,MAAM,IAAA,sBAAY,EACnC,GAAG,CAAC,MAAM,CAAC,EAAE,EACb,GAAG,CAAC,KAAK,EACT,sCAAuB,CACxB,CAAA;IAED,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,mBAAW,CACnB,mBAAW,CAAC,KAAK,CAAC,SAAS,EAC3B,wBAAwB,GAAG,CAAC,MAAM,CAAC,EAAE,gBAAgB,CACtD,CAAA;IACH,CAAC;IAED,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC,CAAA;AACnD,CAAC,CAAA;AAlBY,QAAA,GAAG,OAkBf"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"middlewares.d.ts","sourceRoot":"","sources":["../../../../src/api/admin/draft-orders/middlewares.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"middlewares.d.ts","sourceRoot":"","sources":["../../../../src/api/admin/draft-orders/middlewares.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAU1D,eAAO,MAAM,gCAAgC,EAAE,eAAe,EAgC7D,CAAA"}
|
@@ -25,6 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
26
26
|
exports.adminDraftOrderRoutesMiddlewares = void 0;
|
27
27
|
const framework_1 = require("@medusajs/framework");
|
28
|
+
const framework_2 = require("@medusajs/framework");
|
28
29
|
const QueryConfig = __importStar(require("./query-config"));
|
29
30
|
const validators_1 = require("./validators");
|
30
31
|
exports.adminDraftOrderRoutesMiddlewares = [
|
@@ -32,14 +33,14 @@ exports.adminDraftOrderRoutesMiddlewares = [
|
|
32
33
|
method: ["GET"],
|
33
34
|
matcher: "/admin/draft-orders",
|
34
35
|
middlewares: [
|
35
|
-
(0,
|
36
|
+
(0, framework_2.validateAndTransformQuery)(validators_1.AdminGetOrdersParams, QueryConfig.listTransformQueryConfig),
|
36
37
|
],
|
37
38
|
},
|
38
39
|
{
|
39
40
|
method: ["GET"],
|
40
41
|
matcher: "/admin/draft-orders/:id",
|
41
42
|
middlewares: [
|
42
|
-
(0,
|
43
|
+
(0, framework_2.validateAndTransformQuery)(validators_1.AdminGetOrderParams, QueryConfig.retrieveTransformQueryConfig),
|
43
44
|
],
|
44
45
|
},
|
45
46
|
{
|
@@ -47,15 +48,7 @@ exports.adminDraftOrderRoutesMiddlewares = [
|
|
47
48
|
matcher: "/admin/draft-orders",
|
48
49
|
middlewares: [
|
49
50
|
(0, framework_1.validateAndTransformBody)(validators_1.AdminCreateDraftOrder),
|
50
|
-
(0,
|
51
|
-
],
|
52
|
-
},
|
53
|
-
{
|
54
|
-
method: ["POST"],
|
55
|
-
matcher: "/admin/draft-orders/:id",
|
56
|
-
middlewares: [
|
57
|
-
(0, framework_1.validateAndTransformBody)(validators_1.AdminUpdateDraftOrder),
|
58
|
-
(0, framework_1.validateAndTransformQuery)(validators_1.AdminGetDraftOrderParams, QueryConfig.retrieveTransformQueryConfig),
|
51
|
+
(0, framework_2.validateAndTransformQuery)(validators_1.AdminGetOrderParams, QueryConfig.retrieveTransformQueryConfig),
|
59
52
|
],
|
60
53
|
},
|
61
54
|
];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"middlewares.js","sourceRoot":"","sources":["../../../../src/api/admin/draft-orders/middlewares.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;
|
1
|
+
{"version":3,"file":"middlewares.js","sourceRoot":"","sources":["../../../../src/api/admin/draft-orders/middlewares.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,mDAA8D;AAC9D,mDAA+D;AAC/D,4DAA6C;AAC7C,6CAIqB;AAER,QAAA,gCAAgC,GAAsB;IACjE;QACE,MAAM,EAAE,CAAC,KAAK,CAAC;QACf,OAAO,EAAE,qBAAqB;QAC9B,WAAW,EAAE;YACX,IAAA,qCAAyB,EACvB,iCAAoB,EACpB,WAAW,CAAC,wBAAwB,CACrC;SACF;KACF;IACD;QACE,MAAM,EAAE,CAAC,KAAK,CAAC;QACf,OAAO,EAAE,yBAAyB;QAClC,WAAW,EAAE;YACX,IAAA,qCAAyB,EACvB,gCAAmB,EACnB,WAAW,CAAC,4BAA4B,CACzC;SACF;KACF;IACD;QACE,MAAM,EAAE,CAAC,MAAM,CAAC;QAChB,OAAO,EAAE,qBAAqB;QAC9B,WAAW,EAAE;YACX,IAAA,oCAAwB,EAAC,kCAAqB,CAAC;YAC/C,IAAA,qCAAyB,EACvB,gCAAmB,EACnB,WAAW,CAAC,4BAA4B,CACzC;SACF;KACF;CACF,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"query-config.d.ts","sourceRoot":"","sources":["../../../../src/api/admin/draft-orders/query-config.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B,
|
1
|
+
{"version":3,"file":"query-config.d.ts","sourceRoot":"","sources":["../../../../src/api/admin/draft-orders/query-config.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B,UASvC,CAAA;AAED,eAAO,MAAM,uBAAuB,UAmBnC,CAAA;AAED,eAAO,MAAM,4BAA4B;;;CAGxC,CAAA;AAED,eAAO,MAAM,wBAAwB;;;;CAIpC,CAAA"}
|
@@ -3,11 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.listTransformQueryConfig = exports.retrieveTransformQueryConfig = exports.defaultAdminOrderFields = exports.defaultAdminListOrderFields = void 0;
|
4
4
|
exports.defaultAdminListOrderFields = [
|
5
5
|
"id",
|
6
|
-
"display_id",
|
7
6
|
"status",
|
8
7
|
"version",
|
9
|
-
"email",
|
10
|
-
"region_id",
|
11
8
|
"*items",
|
12
9
|
"summary",
|
13
10
|
"metadata",
|
@@ -16,11 +13,8 @@ exports.defaultAdminListOrderFields = [
|
|
16
13
|
];
|
17
14
|
exports.defaultAdminOrderFields = [
|
18
15
|
"id",
|
19
|
-
"display_id",
|
20
16
|
"status",
|
21
17
|
"version",
|
22
|
-
"email",
|
23
|
-
"region_id",
|
24
18
|
"*items",
|
25
19
|
"*items.tax_lines",
|
26
20
|
"*items.adjustments",
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"query-config.js","sourceRoot":"","sources":["../../../../src/api/admin/draft-orders/query-config.ts"],"names":[],"mappings":";;;AAAa,QAAA,2BAA2B,GAAG;IACzC,IAAI;IACJ,
|
1
|
+
{"version":3,"file":"query-config.js","sourceRoot":"","sources":["../../../../src/api/admin/draft-orders/query-config.ts"],"names":[],"mappings":";;;AAAa,QAAA,2BAA2B,GAAG;IACzC,IAAI;IACJ,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,SAAS;IACT,UAAU;IACV,YAAY;IACZ,YAAY;CACb,CAAA;AAEY,QAAA,uBAAuB,GAAG;IACrC,IAAI;IACJ,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,kBAAkB;IAClB,oBAAoB;IACpB,eAAe;IACf,gBAAgB;IAChB,wBAAwB;IACxB,mBAAmB;IACnB,kBAAkB;IAClB,mBAAmB;IACnB,6BAA6B;IAC7B,+BAA+B;IAC/B,SAAS;IACT,UAAU;IACV,YAAY;IACZ,YAAY;CACb,CAAA;AAEY,QAAA,4BAA4B,GAAG;IAC1C,QAAQ,EAAE,+BAAuB;IACjC,MAAM,EAAE,KAAK;CACd,CAAA;AAEY,QAAA,wBAAwB,GAAG;IACtC,QAAQ,EAAE,mCAA2B;IACrC,YAAY,EAAE,EAAE;IAChB,MAAM,EAAE,IAAI;CACb,CAAA"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { AuthenticatedMedusaRequest, MedusaRequest, MedusaResponse } from "@medusajs/framework/http";
|
2
|
-
import { AdditionalData, HttpTypes } from "@medusajs/framework/types";
|
3
2
|
import { AdminCreateDraftOrderType } from "./validators";
|
3
|
+
import { AdditionalData, HttpTypes } from "@medusajs/framework/types";
|
4
4
|
export declare const GET: (req: MedusaRequest<HttpTypes.AdminOrderFilters>, res: MedusaResponse<HttpTypes.AdminDraftOrderListResponse>) => Promise<void>;
|
5
5
|
export declare const POST: (req: AuthenticatedMedusaRequest<AdminCreateDraftOrderType & AdditionalData>, res: MedusaResponse<HttpTypes.AdminDraftOrderResponse>) => Promise<void>;
|
6
6
|
//# sourceMappingURL=route.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../src/api/admin/draft-orders/route.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../src/api/admin/draft-orders/route.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,0BAA0B,EAC1B,aAAa,EACb,cAAc,EACf,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAA;AAExD,OAAO,EACL,cAAc,EAEd,SAAS,EACV,MAAM,2BAA2B,CAAA;AAElC,eAAO,MAAM,GAAG,QACT,aAAa,CAAC,SAAS,CAAC,iBAAiB,CAAC,OAC1C,cAAc,CAAC,SAAS,CAAC,2BAA2B,CAAC,kBAwB3D,CAAA;AAED,eAAO,MAAM,IAAI,QACV,0BAA0B,CAAC,yBAAyB,GAAG,cAAc,CAAC,OACtE,cAAc,CAAC,SAAS,CAAC,uBAAuB,CAAC,kBA+CvD,CAAA"}
|
@@ -5,23 +5,21 @@ const core_flows_1 = require("@medusajs/core-flows");
|
|
5
5
|
const utils_1 = require("@medusajs/framework/utils");
|
6
6
|
const helpers_1 = require("./helpers");
|
7
7
|
const GET = async (req, res) => {
|
8
|
-
const
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
input: {
|
18
|
-
fields: req.queryConfig.fields,
|
19
|
-
variables,
|
8
|
+
const remoteQuery = req.scope.resolve(utils_1.ContainerRegistrationKeys.REMOTE_QUERY);
|
9
|
+
const queryObject = (0, utils_1.remoteQueryObjectFromString)({
|
10
|
+
entryPoint: "order",
|
11
|
+
variables: {
|
12
|
+
filters: {
|
13
|
+
...req.filterableFields,
|
14
|
+
is_draft_order: true,
|
15
|
+
},
|
16
|
+
...req.queryConfig.pagination,
|
20
17
|
},
|
18
|
+
fields: req.queryConfig.fields,
|
21
19
|
});
|
22
|
-
const { rows, metadata } =
|
20
|
+
const { rows: draft_orders, metadata } = await remoteQuery(queryObject);
|
23
21
|
res.json({
|
24
|
-
draft_orders
|
22
|
+
draft_orders,
|
25
23
|
count: metadata.count,
|
26
24
|
offset: metadata.skip,
|
27
25
|
limit: metadata.take,
|
@@ -37,10 +35,7 @@ const POST = async (req, res) => {
|
|
37
35
|
is_draft_order: true,
|
38
36
|
};
|
39
37
|
const remoteQuery = req.scope.resolve(utils_1.ContainerRegistrationKeys.REMOTE_QUERY);
|
40
|
-
|
41
|
-
* If the currency code is not provided, we fetch the region and use the currency code from there.
|
42
|
-
*/
|
43
|
-
if (!workflowInput.currency_code) {
|
38
|
+
if (!input.currency_code) {
|
44
39
|
const queryObject = (0, utils_1.remoteQueryObjectFromString)({
|
45
40
|
entryPoint: "region",
|
46
41
|
variables: {
|
@@ -49,12 +44,9 @@ const POST = async (req, res) => {
|
|
49
44
|
fields: ["currency_code"],
|
50
45
|
});
|
51
46
|
const [region] = await remoteQuery(queryObject);
|
52
|
-
|
47
|
+
input.currency_code = region?.currency_code;
|
53
48
|
}
|
54
|
-
|
55
|
-
* If the email is not provided, we fetch the customer and use the email from there.
|
56
|
-
*/
|
57
|
-
if (!workflowInput.email) {
|
49
|
+
if (!input.email) {
|
58
50
|
const queryObject = (0, utils_1.remoteQueryObjectFromString)({
|
59
51
|
entryPoint: "customer",
|
60
52
|
variables: {
|
@@ -63,20 +55,7 @@ const POST = async (req, res) => {
|
|
63
55
|
fields: ["email"],
|
64
56
|
});
|
65
57
|
const [customer] = await remoteQuery(queryObject);
|
66
|
-
|
67
|
-
}
|
68
|
-
/**
|
69
|
-
* We accept either a ID or a payload for both billing and shipping addresses.
|
70
|
-
* If either field was received as a string, we assume it's an ID and
|
71
|
-
* then ensure that it is passed along correctly to the workflow.
|
72
|
-
*/
|
73
|
-
if (typeof input.billing_address === "string") {
|
74
|
-
workflowInput.billing_address_id = input.billing_address;
|
75
|
-
delete workflowInput.billing_address;
|
76
|
-
}
|
77
|
-
if (typeof input.shipping_address === "string") {
|
78
|
-
workflowInput.shipping_address_id = input.shipping_address;
|
79
|
-
delete workflowInput.shipping_address;
|
58
|
+
input.email = customer?.email;
|
80
59
|
}
|
81
60
|
const { result } = await (0, core_flows_1.createOrderWorkflow)(req.scope).run({
|
82
61
|
input: workflowInput,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"route.js","sourceRoot":"","sources":["../../../../src/api/admin/draft-orders/route.ts"],"names":[],"mappings":";;;AAAA,
|
1
|
+
{"version":3,"file":"route.js","sourceRoot":"","sources":["../../../../src/api/admin/draft-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1
1
|
import { z } from "zod";
|
2
|
-
export type
|
3
|
-
export declare const
|
2
|
+
export type AdminGetOrderParamsType = z.infer<typeof AdminGetOrderParams>;
|
3
|
+
export declare const AdminGetOrderParams: z.ZodObject<{
|
4
4
|
fields: z.ZodOptional<z.ZodString>;
|
5
5
|
}, "strip", z.ZodTypeAny, {
|
6
6
|
fields?: string | undefined;
|
7
7
|
}, {
|
8
8
|
fields?: string | undefined;
|
9
9
|
}>;
|
10
|
-
export
|
11
|
-
|
10
|
+
export declare const AdminGetOrdersParamsFields: z.ZodObject<{
|
11
|
+
id: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
13
|
+
id?: string | string[] | undefined;
|
14
|
+
}, {
|
15
|
+
id?: string | string[] | undefined;
|
16
|
+
}>;
|
17
|
+
export type AdminGetOrdersParamsType = z.infer<typeof AdminGetOrdersParams>;
|
18
|
+
export declare const AdminGetOrdersParams: z.ZodObject<{
|
12
19
|
[x: string]: any;
|
13
20
|
[x: number]: any;
|
14
21
|
[x: symbol]: any;
|
@@ -52,7 +59,7 @@ declare const CreateDraftOrder: z.ZodObject<{
|
|
52
59
|
sales_channel_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
53
60
|
email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
54
61
|
customer_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
55
|
-
billing_address: z.ZodOptional<z.
|
62
|
+
billing_address: z.ZodOptional<z.ZodObject<{
|
56
63
|
first_name: z.ZodOptional<z.ZodString>;
|
57
64
|
last_name: z.ZodOptional<z.ZodString>;
|
58
65
|
phone: z.ZodOptional<z.ZodString>;
|
@@ -88,8 +95,8 @@ declare const CreateDraftOrder: z.ZodObject<{
|
|
88
95
|
province?: string | undefined;
|
89
96
|
postal_code?: string | undefined;
|
90
97
|
metadata?: Record<string, unknown> | undefined;
|
91
|
-
}
|
92
|
-
shipping_address: z.ZodOptional<z.
|
98
|
+
}>>;
|
99
|
+
shipping_address: z.ZodOptional<z.ZodObject<{
|
93
100
|
first_name: z.ZodOptional<z.ZodString>;
|
94
101
|
last_name: z.ZodOptional<z.ZodString>;
|
95
102
|
phone: z.ZodOptional<z.ZodString>;
|
@@ -125,7 +132,7 @@ declare const CreateDraftOrder: z.ZodObject<{
|
|
125
132
|
province?: string | undefined;
|
126
133
|
postal_code?: string | undefined;
|
127
134
|
metadata?: Record<string, unknown> | undefined;
|
128
|
-
}
|
135
|
+
}>>;
|
129
136
|
items: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
130
137
|
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
131
138
|
variant_sku: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
@@ -184,7 +191,7 @@ declare const CreateDraftOrder: z.ZodObject<{
|
|
184
191
|
promo_codes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
185
192
|
currency_code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
186
193
|
no_notification_order: z.ZodOptional<z.ZodBoolean>;
|
187
|
-
shipping_methods: z.
|
194
|
+
shipping_methods: z.ZodArray<z.ZodObject<{
|
188
195
|
shipping_method_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
189
196
|
name: z.ZodString;
|
190
197
|
shipping_option_id: z.ZodString;
|
@@ -223,15 +230,28 @@ declare const CreateDraftOrder: z.ZodObject<{
|
|
223
230
|
} | undefined);
|
224
231
|
shipping_method_id?: string | null | undefined;
|
225
232
|
data?: Record<string, unknown> | undefined;
|
226
|
-
}>, "many"
|
233
|
+
}>, "many">;
|
227
234
|
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
228
235
|
}, "strict", z.ZodTypeAny, {
|
236
|
+
shipping_methods: {
|
237
|
+
name: string;
|
238
|
+
shipping_option_id: string;
|
239
|
+
amount: (string | number | {
|
240
|
+
value: string;
|
241
|
+
precision: number;
|
242
|
+
}) & (string | number | {
|
243
|
+
value: string;
|
244
|
+
precision: number;
|
245
|
+
} | undefined);
|
246
|
+
shipping_method_id?: string | null | undefined;
|
247
|
+
data?: Record<string, unknown> | undefined;
|
248
|
+
}[];
|
229
249
|
region_id: string;
|
230
250
|
status?: Status.completed | undefined;
|
231
251
|
sales_channel_id?: string | null | undefined;
|
232
252
|
email?: string | null | undefined;
|
233
253
|
customer_id?: string | null | undefined;
|
234
|
-
billing_address?:
|
254
|
+
billing_address?: {
|
235
255
|
first_name?: string | undefined;
|
236
256
|
last_name?: string | undefined;
|
237
257
|
phone?: string | undefined;
|
@@ -244,7 +264,7 @@ declare const CreateDraftOrder: z.ZodObject<{
|
|
244
264
|
postal_code?: string | undefined;
|
245
265
|
metadata?: Record<string, unknown> | undefined;
|
246
266
|
} | undefined;
|
247
|
-
shipping_address?:
|
267
|
+
shipping_address?: {
|
248
268
|
first_name?: string | undefined;
|
249
269
|
last_name?: string | undefined;
|
250
270
|
phone?: string | undefined;
|
@@ -274,7 +294,9 @@ declare const CreateDraftOrder: z.ZodObject<{
|
|
274
294
|
promo_codes?: string[] | undefined;
|
275
295
|
currency_code?: string | null | undefined;
|
276
296
|
no_notification_order?: boolean | undefined;
|
277
|
-
|
297
|
+
metadata?: Record<string, unknown> | null | undefined;
|
298
|
+
}, {
|
299
|
+
shipping_methods: {
|
278
300
|
name: string;
|
279
301
|
shipping_option_id: string;
|
280
302
|
amount: (string | number | {
|
@@ -286,15 +308,13 @@ declare const CreateDraftOrder: z.ZodObject<{
|
|
286
308
|
} | undefined);
|
287
309
|
shipping_method_id?: string | null | undefined;
|
288
310
|
data?: Record<string, unknown> | undefined;
|
289
|
-
}[]
|
290
|
-
metadata?: Record<string, unknown> | null | undefined;
|
291
|
-
}, {
|
311
|
+
}[];
|
292
312
|
region_id: string;
|
293
313
|
status?: Status.completed | undefined;
|
294
314
|
sales_channel_id?: string | null | undefined;
|
295
315
|
email?: string | null | undefined;
|
296
316
|
customer_id?: string | null | undefined;
|
297
|
-
billing_address?:
|
317
|
+
billing_address?: {
|
298
318
|
first_name?: string | undefined;
|
299
319
|
last_name?: string | undefined;
|
300
320
|
phone?: string | undefined;
|
@@ -307,7 +327,7 @@ declare const CreateDraftOrder: z.ZodObject<{
|
|
307
327
|
postal_code?: string | undefined;
|
308
328
|
metadata?: Record<string, unknown> | undefined;
|
309
329
|
} | undefined;
|
310
|
-
shipping_address?:
|
330
|
+
shipping_address?: {
|
311
331
|
first_name?: string | undefined;
|
312
332
|
last_name?: string | undefined;
|
313
333
|
phone?: string | undefined;
|
@@ -337,19 +357,6 @@ declare const CreateDraftOrder: z.ZodObject<{
|
|
337
357
|
promo_codes?: string[] | undefined;
|
338
358
|
currency_code?: string | null | undefined;
|
339
359
|
no_notification_order?: boolean | undefined;
|
340
|
-
shipping_methods?: {
|
341
|
-
name: string;
|
342
|
-
shipping_option_id: string;
|
343
|
-
amount: (string | number | {
|
344
|
-
value: string;
|
345
|
-
precision: number;
|
346
|
-
}) & (string | number | {
|
347
|
-
value: string;
|
348
|
-
precision: number;
|
349
|
-
} | undefined);
|
350
|
-
shipping_method_id?: string | null | undefined;
|
351
|
-
data?: Record<string, unknown> | undefined;
|
352
|
-
}[] | undefined;
|
353
360
|
metadata?: Record<string, unknown> | null | undefined;
|
354
361
|
}>;
|
355
362
|
export declare const AdminCreateDraftOrder: (additionalDataValidator?: z.ZodOptional<z.ZodNullable<z.ZodObject<any, any>>>) => z.ZodObject<any, any, z.ZodTypeAny, {
|
@@ -357,142 +364,5 @@ export declare const AdminCreateDraftOrder: (additionalDataValidator?: z.ZodOpti
|
|
357
364
|
}, {
|
358
365
|
[x: string]: any;
|
359
366
|
}> | z.ZodEffects<any, any, any>;
|
360
|
-
export type AdminUpdateDraftOrderType = z.infer<typeof AdminUpdateDraftOrder>;
|
361
|
-
export declare const AdminUpdateDraftOrder: z.ZodObject<{
|
362
|
-
email: z.ZodOptional<z.ZodString>;
|
363
|
-
shipping_address: z.ZodOptional<z.ZodObject<{
|
364
|
-
first_name: z.ZodOptional<z.ZodString>;
|
365
|
-
last_name: z.ZodOptional<z.ZodString>;
|
366
|
-
phone: z.ZodOptional<z.ZodString>;
|
367
|
-
company: z.ZodOptional<z.ZodString>;
|
368
|
-
address_1: z.ZodOptional<z.ZodString>;
|
369
|
-
address_2: z.ZodOptional<z.ZodString>;
|
370
|
-
city: z.ZodOptional<z.ZodString>;
|
371
|
-
country_code: z.ZodOptional<z.ZodString>;
|
372
|
-
province: z.ZodOptional<z.ZodString>;
|
373
|
-
postal_code: z.ZodOptional<z.ZodString>;
|
374
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
375
|
-
}, "strict", z.ZodTypeAny, {
|
376
|
-
first_name?: string | undefined;
|
377
|
-
last_name?: string | undefined;
|
378
|
-
phone?: string | undefined;
|
379
|
-
company?: string | undefined;
|
380
|
-
address_1?: string | undefined;
|
381
|
-
address_2?: string | undefined;
|
382
|
-
city?: string | undefined;
|
383
|
-
country_code?: string | undefined;
|
384
|
-
province?: string | undefined;
|
385
|
-
postal_code?: string | undefined;
|
386
|
-
metadata?: Record<string, unknown> | undefined;
|
387
|
-
}, {
|
388
|
-
first_name?: string | undefined;
|
389
|
-
last_name?: string | undefined;
|
390
|
-
phone?: string | undefined;
|
391
|
-
company?: string | undefined;
|
392
|
-
address_1?: string | undefined;
|
393
|
-
address_2?: string | undefined;
|
394
|
-
city?: string | undefined;
|
395
|
-
country_code?: string | undefined;
|
396
|
-
province?: string | undefined;
|
397
|
-
postal_code?: string | undefined;
|
398
|
-
metadata?: Record<string, unknown> | undefined;
|
399
|
-
}>>;
|
400
|
-
billing_address: z.ZodOptional<z.ZodObject<{
|
401
|
-
first_name: z.ZodOptional<z.ZodString>;
|
402
|
-
last_name: z.ZodOptional<z.ZodString>;
|
403
|
-
phone: z.ZodOptional<z.ZodString>;
|
404
|
-
company: z.ZodOptional<z.ZodString>;
|
405
|
-
address_1: z.ZodOptional<z.ZodString>;
|
406
|
-
address_2: z.ZodOptional<z.ZodString>;
|
407
|
-
city: z.ZodOptional<z.ZodString>;
|
408
|
-
country_code: z.ZodOptional<z.ZodString>;
|
409
|
-
province: z.ZodOptional<z.ZodString>;
|
410
|
-
postal_code: z.ZodOptional<z.ZodString>;
|
411
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
412
|
-
}, "strict", z.ZodTypeAny, {
|
413
|
-
first_name?: string | undefined;
|
414
|
-
last_name?: string | undefined;
|
415
|
-
phone?: string | undefined;
|
416
|
-
company?: string | undefined;
|
417
|
-
address_1?: string | undefined;
|
418
|
-
address_2?: string | undefined;
|
419
|
-
city?: string | undefined;
|
420
|
-
country_code?: string | undefined;
|
421
|
-
province?: string | undefined;
|
422
|
-
postal_code?: string | undefined;
|
423
|
-
metadata?: Record<string, unknown> | undefined;
|
424
|
-
}, {
|
425
|
-
first_name?: string | undefined;
|
426
|
-
last_name?: string | undefined;
|
427
|
-
phone?: string | undefined;
|
428
|
-
company?: string | undefined;
|
429
|
-
address_1?: string | undefined;
|
430
|
-
address_2?: string | undefined;
|
431
|
-
city?: string | undefined;
|
432
|
-
country_code?: string | undefined;
|
433
|
-
province?: string | undefined;
|
434
|
-
postal_code?: string | undefined;
|
435
|
-
metadata?: Record<string, unknown> | undefined;
|
436
|
-
}>>;
|
437
|
-
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
438
|
-
}, "strip", z.ZodTypeAny, {
|
439
|
-
email?: string | undefined;
|
440
|
-
shipping_address?: {
|
441
|
-
first_name?: string | undefined;
|
442
|
-
last_name?: string | undefined;
|
443
|
-
phone?: string | undefined;
|
444
|
-
company?: string | undefined;
|
445
|
-
address_1?: string | undefined;
|
446
|
-
address_2?: string | undefined;
|
447
|
-
city?: string | undefined;
|
448
|
-
country_code?: string | undefined;
|
449
|
-
province?: string | undefined;
|
450
|
-
postal_code?: string | undefined;
|
451
|
-
metadata?: Record<string, unknown> | undefined;
|
452
|
-
} | undefined;
|
453
|
-
billing_address?: {
|
454
|
-
first_name?: string | undefined;
|
455
|
-
last_name?: string | undefined;
|
456
|
-
phone?: string | undefined;
|
457
|
-
company?: string | undefined;
|
458
|
-
address_1?: string | undefined;
|
459
|
-
address_2?: string | undefined;
|
460
|
-
city?: string | undefined;
|
461
|
-
country_code?: string | undefined;
|
462
|
-
province?: string | undefined;
|
463
|
-
postal_code?: string | undefined;
|
464
|
-
metadata?: Record<string, unknown> | undefined;
|
465
|
-
} | undefined;
|
466
|
-
metadata?: Record<string, unknown> | null | undefined;
|
467
|
-
}, {
|
468
|
-
email?: string | undefined;
|
469
|
-
shipping_address?: {
|
470
|
-
first_name?: string | undefined;
|
471
|
-
last_name?: string | undefined;
|
472
|
-
phone?: string | undefined;
|
473
|
-
company?: string | undefined;
|
474
|
-
address_1?: string | undefined;
|
475
|
-
address_2?: string | undefined;
|
476
|
-
city?: string | undefined;
|
477
|
-
country_code?: string | undefined;
|
478
|
-
province?: string | undefined;
|
479
|
-
postal_code?: string | undefined;
|
480
|
-
metadata?: Record<string, unknown> | undefined;
|
481
|
-
} | undefined;
|
482
|
-
billing_address?: {
|
483
|
-
first_name?: string | undefined;
|
484
|
-
last_name?: string | undefined;
|
485
|
-
phone?: string | undefined;
|
486
|
-
company?: string | undefined;
|
487
|
-
address_1?: string | undefined;
|
488
|
-
address_2?: string | undefined;
|
489
|
-
city?: string | undefined;
|
490
|
-
country_code?: string | undefined;
|
491
|
-
province?: string | undefined;
|
492
|
-
postal_code?: string | undefined;
|
493
|
-
metadata?: Record<string, unknown> | undefined;
|
494
|
-
} | undefined;
|
495
|
-
metadata?: Record<string, unknown> | null | undefined;
|
496
|
-
}>;
|
497
367
|
export {};
|
498
368
|
//# sourceMappingURL=validators.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../../../src/api/admin/draft-orders/validators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;
|
1
|
+
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../../../src/api/admin/draft-orders/validators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAYvB,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AACzE,eAAO,MAAM,mBAAmB;;;;;;EAAuB,CAAA;AAEvD,eAAO,MAAM,0BAA0B;;;;;;EAErC,CAAA;AAEF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAC3E,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK2B,CAAA;AAE5D,aAAK,MAAM;IACT,SAAS,cAAc;CACxB;AA8BD,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AACxE,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAjBpB;;;WAGG;;QAEH;;;WAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyBM,CAAA;AAEX,eAAO,MAAM,qBAAqB;;;;gCAcjC,CAAA"}
|