@hartl-services/medusa-contracts 1.5.0 → 1.6.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.
- package/README.md +9 -0
- package/dist/email/schemas.d.ts +7 -0
- package/dist/email/schemas.js +1 -0
- package/dist/esm/email/schemas.mjs +1 -0
- package/dist/esm/order-assistant/paths.mjs +7 -0
- package/dist/esm/order-assistant/schemas.mjs +183 -0
- package/dist/esm/order-assistant/types.mjs +1 -0
- package/dist/order-assistant/paths.d.ts +7 -0
- package/dist/order-assistant/paths.js +10 -0
- package/dist/order-assistant/schemas.d.ts +213 -0
- package/dist/order-assistant/schemas.js +186 -0
- package/dist/order-assistant/types.d.ts +15 -0
- package/dist/order-assistant/types.js +2 -0
- package/package.json +16 -1
package/README.md
CHANGED
|
@@ -28,6 +28,7 @@ Consumer subpaths:
|
|
|
28
28
|
- `@hartl-services/medusa-contracts/types/plugin-features-store`
|
|
29
29
|
- `@hartl-services/medusa-contracts/types/plugin-features-admin`
|
|
30
30
|
- `@hartl-services/medusa-contracts/types/tax-compliance-store`
|
|
31
|
+
- `@hartl-services/medusa-contracts/types/order-assistant`
|
|
31
32
|
- `@hartl-services/medusa-contracts/schemas/affiliate`
|
|
32
33
|
- `@hartl-services/medusa-contracts/schemas/batch-management`
|
|
33
34
|
- `@hartl-services/medusa-contracts/schemas/documents`
|
|
@@ -39,6 +40,7 @@ Consumer subpaths:
|
|
|
39
40
|
- `@hartl-services/medusa-contracts/schemas/checkout`
|
|
40
41
|
- `@hartl-services/medusa-contracts/schemas/plugin-features`
|
|
41
42
|
- `@hartl-services/medusa-contracts/schemas/tax-compliance`
|
|
43
|
+
- `@hartl-services/medusa-contracts/schemas/order-assistant`
|
|
42
44
|
- `@hartl-services/medusa-contracts/paths/affiliate`
|
|
43
45
|
- `@hartl-services/medusa-contracts/paths/batch-management`
|
|
44
46
|
- `@hartl-services/medusa-contracts/paths/documents`
|
|
@@ -49,6 +51,7 @@ Consumer subpaths:
|
|
|
49
51
|
- `@hartl-services/medusa-contracts/paths/checkout`
|
|
50
52
|
- `@hartl-services/medusa-contracts/paths/plugin-features`
|
|
51
53
|
- `@hartl-services/medusa-contracts/paths/tax-compliance`
|
|
54
|
+
- `@hartl-services/medusa-contracts/paths/order-assistant`
|
|
52
55
|
|
|
53
56
|
Server-only event subpaths (see "Server-only event contracts" below):
|
|
54
57
|
|
|
@@ -70,6 +73,12 @@ Packing-list DTOs are exported only from `types/documents-admin`. Use
|
|
|
70
73
|
`packingListsPaths` from `paths/documents` with the consuming Admin's configured
|
|
71
74
|
Medusa SDK; there is deliberately no packing-list Store contract or client.
|
|
72
75
|
|
|
76
|
+
The order assistant (`order-assistant`) is not a JSON REST route: `paths` holds
|
|
77
|
+
the MCP endpoint (`/mcp`), `schemas` the input and output schemas of its four
|
|
78
|
+
tools, the tool names and the order metadata keys the assistant writes, and
|
|
79
|
+
`types` their inferred types. A storefront never calls it; the consumer is an
|
|
80
|
+
MCP client (an AI chatbot) and the base's own tests.
|
|
81
|
+
|
|
73
82
|
File Gateway responses are binary and have no JSON response DTO. Public paths
|
|
74
83
|
come from `paths/files`. Private gateway URLs are opaque, signed server results
|
|
75
84
|
and must not be assembled by a consumer.
|
package/dist/email/schemas.d.ts
CHANGED
|
@@ -40,6 +40,7 @@ export declare const EmailSafeStatusCodeSchema: z.ZodEnum<{
|
|
|
40
40
|
connection_failed: "connection_failed";
|
|
41
41
|
invalid_content: "invalid_content";
|
|
42
42
|
lease_expired: "lease_expired";
|
|
43
|
+
no_recipient: "no_recipient";
|
|
43
44
|
not_configured: "not_configured";
|
|
44
45
|
notifications_disabled: "notifications_disabled";
|
|
45
46
|
outcome_unknown: "outcome_unknown";
|
|
@@ -179,6 +180,7 @@ export declare const AdminEmailMessageSchema: z.ZodObject<{
|
|
|
179
180
|
connection_failed: "connection_failed";
|
|
180
181
|
invalid_content: "invalid_content";
|
|
181
182
|
lease_expired: "lease_expired";
|
|
183
|
+
no_recipient: "no_recipient";
|
|
182
184
|
not_configured: "not_configured";
|
|
183
185
|
notifications_disabled: "notifications_disabled";
|
|
184
186
|
outcome_unknown: "outcome_unknown";
|
|
@@ -217,6 +219,7 @@ export declare const AdminEmailAttemptSchema: z.ZodObject<{
|
|
|
217
219
|
connection_failed: "connection_failed";
|
|
218
220
|
invalid_content: "invalid_content";
|
|
219
221
|
lease_expired: "lease_expired";
|
|
222
|
+
no_recipient: "no_recipient";
|
|
220
223
|
not_configured: "not_configured";
|
|
221
224
|
notifications_disabled: "notifications_disabled";
|
|
222
225
|
outcome_unknown: "outcome_unknown";
|
|
@@ -312,6 +315,7 @@ export declare const ListAdminEmailMessagesResponseSchema: z.ZodObject<{
|
|
|
312
315
|
connection_failed: "connection_failed";
|
|
313
316
|
invalid_content: "invalid_content";
|
|
314
317
|
lease_expired: "lease_expired";
|
|
318
|
+
no_recipient: "no_recipient";
|
|
315
319
|
not_configured: "not_configured";
|
|
316
320
|
notifications_disabled: "notifications_disabled";
|
|
317
321
|
outcome_unknown: "outcome_unknown";
|
|
@@ -382,6 +386,7 @@ export declare const GetAdminEmailMessageResponseSchema: z.ZodObject<{
|
|
|
382
386
|
connection_failed: "connection_failed";
|
|
383
387
|
invalid_content: "invalid_content";
|
|
384
388
|
lease_expired: "lease_expired";
|
|
389
|
+
no_recipient: "no_recipient";
|
|
385
390
|
not_configured: "not_configured";
|
|
386
391
|
notifications_disabled: "notifications_disabled";
|
|
387
392
|
outcome_unknown: "outcome_unknown";
|
|
@@ -420,6 +425,7 @@ export declare const GetAdminEmailMessageResponseSchema: z.ZodObject<{
|
|
|
420
425
|
connection_failed: "connection_failed";
|
|
421
426
|
invalid_content: "invalid_content";
|
|
422
427
|
lease_expired: "lease_expired";
|
|
428
|
+
no_recipient: "no_recipient";
|
|
423
429
|
not_configured: "not_configured";
|
|
424
430
|
notifications_disabled: "notifications_disabled";
|
|
425
431
|
outcome_unknown: "outcome_unknown";
|
|
@@ -486,6 +492,7 @@ export declare const ResendAdminEmailMessageResponseSchema: z.ZodObject<{
|
|
|
486
492
|
connection_failed: "connection_failed";
|
|
487
493
|
invalid_content: "invalid_content";
|
|
488
494
|
lease_expired: "lease_expired";
|
|
495
|
+
no_recipient: "no_recipient";
|
|
489
496
|
not_configured: "not_configured";
|
|
490
497
|
notifications_disabled: "notifications_disabled";
|
|
491
498
|
outcome_unknown: "outcome_unknown";
|
package/dist/email/schemas.js
CHANGED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { z } from "@medusajs/framework/zod";
|
|
2
|
+
import { NonEmptyStringSchema } from "../shared/primitives.mjs";
|
|
3
|
+
/** Plugin key and container key of the order assistant in the base. */
|
|
4
|
+
export const ORDER_ASSISTANT_PLUGIN_KEY = "order_assistant";
|
|
5
|
+
/** Tool names as the MCP client sees them. */
|
|
6
|
+
export const ORDER_ASSISTANT_TOOLS = {
|
|
7
|
+
searchCustomers: "kunden_suchen",
|
|
8
|
+
searchProducts: "produkte_suchen",
|
|
9
|
+
listShippingOptions: "versandarten_auflisten",
|
|
10
|
+
createDraftOrder: "bestellentwurf_anlegen",
|
|
11
|
+
};
|
|
12
|
+
/** How the order reached the shop; stored in the order metadata. */
|
|
13
|
+
export const OrderAssistantSourceSchema = z.enum(["fax", "telefon"]);
|
|
14
|
+
/** Order metadata keys the assistant writes. */
|
|
15
|
+
export const ORDER_ASSISTANT_METADATA = {
|
|
16
|
+
source: "order_source",
|
|
17
|
+
note: "order_note",
|
|
18
|
+
};
|
|
19
|
+
export const ORDER_ASSISTANT_LIMITS = {
|
|
20
|
+
customers: 10,
|
|
21
|
+
variants: 20,
|
|
22
|
+
items: 50,
|
|
23
|
+
noteLength: 2000,
|
|
24
|
+
};
|
|
25
|
+
const CountryCodeSchema = z
|
|
26
|
+
.string()
|
|
27
|
+
.trim()
|
|
28
|
+
.toLowerCase()
|
|
29
|
+
.regex(/^[a-z]{2}$/)
|
|
30
|
+
.describe("Land als ISO-3166-1-alpha-2-Code, z. B. at oder de.");
|
|
31
|
+
const OptionalTextSchema = z.string().trim().min(1).max(255).optional();
|
|
32
|
+
export const OrderAssistantAddressSchema = z
|
|
33
|
+
.object({
|
|
34
|
+
first_name: NonEmptyStringSchema.max(255),
|
|
35
|
+
last_name: NonEmptyStringSchema.max(255),
|
|
36
|
+
company: OptionalTextSchema.describe("Firma oder Praxis, falls angegeben."),
|
|
37
|
+
address_1: NonEmptyStringSchema.max(255).describe("Straße und Hausnummer."),
|
|
38
|
+
address_2: OptionalTextSchema.describe("Adresszusatz."),
|
|
39
|
+
postal_code: NonEmptyStringSchema.max(20),
|
|
40
|
+
city: NonEmptyStringSchema.max(255),
|
|
41
|
+
country_code: CountryCodeSchema,
|
|
42
|
+
phone: OptionalTextSchema,
|
|
43
|
+
})
|
|
44
|
+
.strict();
|
|
45
|
+
export const SearchCustomersInputSchema = z
|
|
46
|
+
.object({
|
|
47
|
+
query: OptionalTextSchema.describe("Name, Firma, Telefonnummer oder E-Mail-Adresse (auch Teile davon)."),
|
|
48
|
+
postal_code: OptionalTextSchema.describe("PLZ einer Adresse der Person."),
|
|
49
|
+
city: OptionalTextSchema.describe("Ort einer Adresse der Person."),
|
|
50
|
+
})
|
|
51
|
+
.strict()
|
|
52
|
+
.refine((value) => Boolean(value.query ?? value.postal_code ?? value.city), { message: "Mindestens ein Suchfeld ist nötig." });
|
|
53
|
+
export const OrderAssistantCustomerAddressSchema = z.object({
|
|
54
|
+
first_name: z.string().nullable(),
|
|
55
|
+
last_name: z.string().nullable(),
|
|
56
|
+
company: z.string().nullable(),
|
|
57
|
+
address_1: z.string().nullable(),
|
|
58
|
+
address_2: z.string().nullable(),
|
|
59
|
+
postal_code: z.string().nullable(),
|
|
60
|
+
city: z.string().nullable(),
|
|
61
|
+
country_code: z.string().nullable(),
|
|
62
|
+
phone: z.string().nullable(),
|
|
63
|
+
});
|
|
64
|
+
export const OrderAssistantCustomerSchema = z.object({
|
|
65
|
+
id: z.string(),
|
|
66
|
+
first_name: z.string().nullable(),
|
|
67
|
+
last_name: z.string().nullable(),
|
|
68
|
+
company_name: z.string().nullable(),
|
|
69
|
+
email: z.string().nullable(),
|
|
70
|
+
phone: z.string().nullable(),
|
|
71
|
+
/** Registered shop account (true) or a customer record without login. */
|
|
72
|
+
has_account: z.boolean(),
|
|
73
|
+
addresses: z.array(OrderAssistantCustomerAddressSchema),
|
|
74
|
+
});
|
|
75
|
+
export const SearchCustomersOutputSchema = z.object({
|
|
76
|
+
customers: z.array(OrderAssistantCustomerSchema),
|
|
77
|
+
});
|
|
78
|
+
export const SearchProductsInputSchema = z
|
|
79
|
+
.object({
|
|
80
|
+
query: NonEmptyStringSchema.max(255).describe("Produktname oder Artikelnummer (auch Teile davon)."),
|
|
81
|
+
country_code: CountryCodeSchema.describe("Lieferland als ISO-Code; bestimmt Preis und Währung."),
|
|
82
|
+
})
|
|
83
|
+
.strict();
|
|
84
|
+
export const OrderAssistantVariantSchema = z.object({
|
|
85
|
+
variant_id: z.string(),
|
|
86
|
+
product_title: z.string(),
|
|
87
|
+
variant_title: z.string().nullable(),
|
|
88
|
+
sku: z.string().nullable(),
|
|
89
|
+
/** Price per unit in major currency units (33.5 = 33,50); null without a price. */
|
|
90
|
+
unit_price: z.number().nullable(),
|
|
91
|
+
currency_code: z.string(),
|
|
92
|
+
/** Available quantity; null when the variant's stock is not managed. */
|
|
93
|
+
available_quantity: z.number().nullable(),
|
|
94
|
+
/** False when the variant cannot be ordered (no price or no stock). */
|
|
95
|
+
orderable: z.boolean(),
|
|
96
|
+
});
|
|
97
|
+
export const SearchProductsOutputSchema = z.object({
|
|
98
|
+
variants: z.array(OrderAssistantVariantSchema),
|
|
99
|
+
});
|
|
100
|
+
export const ListShippingOptionsInputSchema = z
|
|
101
|
+
.object({
|
|
102
|
+
country_code: CountryCodeSchema.describe("Lieferland als ISO-Code."),
|
|
103
|
+
})
|
|
104
|
+
.strict();
|
|
105
|
+
export const OrderAssistantShippingOptionSchema = z.object({
|
|
106
|
+
id: z.string(),
|
|
107
|
+
name: z.string(),
|
|
108
|
+
/** Flat price in major currency units; null when none is set for the currency. */
|
|
109
|
+
amount: z.number().nullable(),
|
|
110
|
+
currency_code: z.string(),
|
|
111
|
+
});
|
|
112
|
+
export const ListShippingOptionsOutputSchema = z.object({
|
|
113
|
+
shipping_options: z.array(OrderAssistantShippingOptionSchema),
|
|
114
|
+
});
|
|
115
|
+
export const OrderAssistantNewCustomerSchema = z
|
|
116
|
+
.object({
|
|
117
|
+
first_name: NonEmptyStringSchema.max(255),
|
|
118
|
+
last_name: NonEmptyStringSchema.max(255),
|
|
119
|
+
company_name: OptionalTextSchema,
|
|
120
|
+
email: z
|
|
121
|
+
.string()
|
|
122
|
+
.trim()
|
|
123
|
+
.toLowerCase()
|
|
124
|
+
.email()
|
|
125
|
+
.max(255)
|
|
126
|
+
.optional()
|
|
127
|
+
.describe("Nur angeben, wenn eine E-Mail-Adresse bekannt ist."),
|
|
128
|
+
phone: OptionalTextSchema,
|
|
129
|
+
})
|
|
130
|
+
.strict();
|
|
131
|
+
export const CreateDraftOrderInputSchema = z
|
|
132
|
+
.object({
|
|
133
|
+
customer_id: z
|
|
134
|
+
.string()
|
|
135
|
+
.trim()
|
|
136
|
+
.min(1)
|
|
137
|
+
.optional()
|
|
138
|
+
.describe("ID einer bestehenden Kund:in aus kunden_suchen."),
|
|
139
|
+
new_customer: OrderAssistantNewCustomerSchema.optional().describe("Neue Kund:in ohne Konto; nur wenn kunden_suchen niemanden findet."),
|
|
140
|
+
shipping_address: OrderAssistantAddressSchema,
|
|
141
|
+
billing_address: OrderAssistantAddressSchema.optional().describe("Rechnungsadresse; ohne Angabe gilt die Lieferadresse."),
|
|
142
|
+
items: z
|
|
143
|
+
.array(z
|
|
144
|
+
.object({
|
|
145
|
+
variant_id: NonEmptyStringSchema.describe("ID der Variante aus produkte_suchen."),
|
|
146
|
+
quantity: z.number().int().positive().max(9999),
|
|
147
|
+
})
|
|
148
|
+
.strict())
|
|
149
|
+
.min(1)
|
|
150
|
+
.max(ORDER_ASSISTANT_LIMITS.items),
|
|
151
|
+
shipping_option_id: NonEmptyStringSchema.describe("ID der Versandart aus versandarten_auflisten."),
|
|
152
|
+
source: OrderAssistantSourceSchema.describe("Wie die Bestellung eingegangen ist."),
|
|
153
|
+
note: z
|
|
154
|
+
.string()
|
|
155
|
+
.trim()
|
|
156
|
+
.min(1)
|
|
157
|
+
.max(ORDER_ASSISTANT_LIMITS.noteLength)
|
|
158
|
+
.optional()
|
|
159
|
+
.describe("Interne Notiz, z. B. Unklarheiten auf dem Fax."),
|
|
160
|
+
})
|
|
161
|
+
.strict()
|
|
162
|
+
.refine((value) => Boolean(value.customer_id) !== Boolean(value.new_customer), { message: "Genau eines von customer_id und new_customer ist nötig." });
|
|
163
|
+
export const OrderAssistantDraftItemSchema = z.object({
|
|
164
|
+
title: z.string(),
|
|
165
|
+
sku: z.string().nullable(),
|
|
166
|
+
quantity: z.number(),
|
|
167
|
+
unit_price: z.number(),
|
|
168
|
+
total: z.number(),
|
|
169
|
+
});
|
|
170
|
+
export const CreateDraftOrderOutputSchema = z.object({
|
|
171
|
+
draft_order_id: z.string(),
|
|
172
|
+
display_id: z.number().nullable(),
|
|
173
|
+
customer_id: z.string(),
|
|
174
|
+
/** True when the assistant created the customer record for this draft. */
|
|
175
|
+
customer_created: z.boolean(),
|
|
176
|
+
currency_code: z.string(),
|
|
177
|
+
items: z.array(OrderAssistantDraftItemSchema),
|
|
178
|
+
shipping_total: z.number(),
|
|
179
|
+
tax_total: z.number(),
|
|
180
|
+
total: z.number(),
|
|
181
|
+
/** Path of the draft in the Admin, relative to the backend URL. */
|
|
182
|
+
admin_path: z.string(),
|
|
183
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.orderAssistantPaths = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The shop's MCP endpoint for the order assistant (Streamable HTTP,
|
|
6
|
+
* stateless). Outside `/admin` and `/store`: it authenticates on its own.
|
|
7
|
+
*/
|
|
8
|
+
exports.orderAssistantPaths = {
|
|
9
|
+
mcp: "/mcp",
|
|
10
|
+
};
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { z } from "@medusajs/framework/zod";
|
|
2
|
+
/** Plugin key and container key of the order assistant in the base. */
|
|
3
|
+
export declare const ORDER_ASSISTANT_PLUGIN_KEY = "order_assistant";
|
|
4
|
+
/** Tool names as the MCP client sees them. */
|
|
5
|
+
export declare const ORDER_ASSISTANT_TOOLS: {
|
|
6
|
+
readonly searchCustomers: "kunden_suchen";
|
|
7
|
+
readonly searchProducts: "produkte_suchen";
|
|
8
|
+
readonly listShippingOptions: "versandarten_auflisten";
|
|
9
|
+
readonly createDraftOrder: "bestellentwurf_anlegen";
|
|
10
|
+
};
|
|
11
|
+
export type OrderAssistantToolName = (typeof ORDER_ASSISTANT_TOOLS)[keyof typeof ORDER_ASSISTANT_TOOLS];
|
|
12
|
+
/** How the order reached the shop; stored in the order metadata. */
|
|
13
|
+
export declare const OrderAssistantSourceSchema: z.ZodEnum<{
|
|
14
|
+
fax: "fax";
|
|
15
|
+
telefon: "telefon";
|
|
16
|
+
}>;
|
|
17
|
+
/** Order metadata keys the assistant writes. */
|
|
18
|
+
export declare const ORDER_ASSISTANT_METADATA: {
|
|
19
|
+
readonly source: "order_source";
|
|
20
|
+
readonly note: "order_note";
|
|
21
|
+
};
|
|
22
|
+
export declare const ORDER_ASSISTANT_LIMITS: {
|
|
23
|
+
readonly customers: 10;
|
|
24
|
+
readonly variants: 20;
|
|
25
|
+
readonly items: 50;
|
|
26
|
+
readonly noteLength: 2000;
|
|
27
|
+
};
|
|
28
|
+
export declare const OrderAssistantAddressSchema: z.ZodObject<{
|
|
29
|
+
first_name: z.ZodString;
|
|
30
|
+
last_name: z.ZodString;
|
|
31
|
+
company: z.ZodOptional<z.ZodString>;
|
|
32
|
+
address_1: z.ZodString;
|
|
33
|
+
address_2: z.ZodOptional<z.ZodString>;
|
|
34
|
+
postal_code: z.ZodString;
|
|
35
|
+
city: z.ZodString;
|
|
36
|
+
country_code: z.ZodString;
|
|
37
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
38
|
+
}, z.core.$strict>;
|
|
39
|
+
export declare const SearchCustomersInputSchema: z.ZodObject<{
|
|
40
|
+
query: z.ZodOptional<z.ZodString>;
|
|
41
|
+
postal_code: z.ZodOptional<z.ZodString>;
|
|
42
|
+
city: z.ZodOptional<z.ZodString>;
|
|
43
|
+
}, z.core.$strict>;
|
|
44
|
+
export declare const OrderAssistantCustomerAddressSchema: z.ZodObject<{
|
|
45
|
+
first_name: z.ZodNullable<z.ZodString>;
|
|
46
|
+
last_name: z.ZodNullable<z.ZodString>;
|
|
47
|
+
company: z.ZodNullable<z.ZodString>;
|
|
48
|
+
address_1: z.ZodNullable<z.ZodString>;
|
|
49
|
+
address_2: z.ZodNullable<z.ZodString>;
|
|
50
|
+
postal_code: z.ZodNullable<z.ZodString>;
|
|
51
|
+
city: z.ZodNullable<z.ZodString>;
|
|
52
|
+
country_code: z.ZodNullable<z.ZodString>;
|
|
53
|
+
phone: z.ZodNullable<z.ZodString>;
|
|
54
|
+
}, z.core.$strip>;
|
|
55
|
+
export declare const OrderAssistantCustomerSchema: z.ZodObject<{
|
|
56
|
+
id: z.ZodString;
|
|
57
|
+
first_name: z.ZodNullable<z.ZodString>;
|
|
58
|
+
last_name: z.ZodNullable<z.ZodString>;
|
|
59
|
+
company_name: z.ZodNullable<z.ZodString>;
|
|
60
|
+
email: z.ZodNullable<z.ZodString>;
|
|
61
|
+
phone: z.ZodNullable<z.ZodString>;
|
|
62
|
+
has_account: z.ZodBoolean;
|
|
63
|
+
addresses: z.ZodArray<z.ZodObject<{
|
|
64
|
+
first_name: z.ZodNullable<z.ZodString>;
|
|
65
|
+
last_name: z.ZodNullable<z.ZodString>;
|
|
66
|
+
company: z.ZodNullable<z.ZodString>;
|
|
67
|
+
address_1: z.ZodNullable<z.ZodString>;
|
|
68
|
+
address_2: z.ZodNullable<z.ZodString>;
|
|
69
|
+
postal_code: z.ZodNullable<z.ZodString>;
|
|
70
|
+
city: z.ZodNullable<z.ZodString>;
|
|
71
|
+
country_code: z.ZodNullable<z.ZodString>;
|
|
72
|
+
phone: z.ZodNullable<z.ZodString>;
|
|
73
|
+
}, z.core.$strip>>;
|
|
74
|
+
}, z.core.$strip>;
|
|
75
|
+
export declare const SearchCustomersOutputSchema: z.ZodObject<{
|
|
76
|
+
customers: z.ZodArray<z.ZodObject<{
|
|
77
|
+
id: z.ZodString;
|
|
78
|
+
first_name: z.ZodNullable<z.ZodString>;
|
|
79
|
+
last_name: z.ZodNullable<z.ZodString>;
|
|
80
|
+
company_name: z.ZodNullable<z.ZodString>;
|
|
81
|
+
email: z.ZodNullable<z.ZodString>;
|
|
82
|
+
phone: z.ZodNullable<z.ZodString>;
|
|
83
|
+
has_account: z.ZodBoolean;
|
|
84
|
+
addresses: z.ZodArray<z.ZodObject<{
|
|
85
|
+
first_name: z.ZodNullable<z.ZodString>;
|
|
86
|
+
last_name: z.ZodNullable<z.ZodString>;
|
|
87
|
+
company: z.ZodNullable<z.ZodString>;
|
|
88
|
+
address_1: z.ZodNullable<z.ZodString>;
|
|
89
|
+
address_2: z.ZodNullable<z.ZodString>;
|
|
90
|
+
postal_code: z.ZodNullable<z.ZodString>;
|
|
91
|
+
city: z.ZodNullable<z.ZodString>;
|
|
92
|
+
country_code: z.ZodNullable<z.ZodString>;
|
|
93
|
+
phone: z.ZodNullable<z.ZodString>;
|
|
94
|
+
}, z.core.$strip>>;
|
|
95
|
+
}, z.core.$strip>>;
|
|
96
|
+
}, z.core.$strip>;
|
|
97
|
+
export declare const SearchProductsInputSchema: z.ZodObject<{
|
|
98
|
+
query: z.ZodString;
|
|
99
|
+
country_code: z.ZodString;
|
|
100
|
+
}, z.core.$strict>;
|
|
101
|
+
export declare const OrderAssistantVariantSchema: z.ZodObject<{
|
|
102
|
+
variant_id: z.ZodString;
|
|
103
|
+
product_title: z.ZodString;
|
|
104
|
+
variant_title: z.ZodNullable<z.ZodString>;
|
|
105
|
+
sku: z.ZodNullable<z.ZodString>;
|
|
106
|
+
unit_price: z.ZodNullable<z.ZodNumber>;
|
|
107
|
+
currency_code: z.ZodString;
|
|
108
|
+
available_quantity: z.ZodNullable<z.ZodNumber>;
|
|
109
|
+
orderable: z.ZodBoolean;
|
|
110
|
+
}, z.core.$strip>;
|
|
111
|
+
export declare const SearchProductsOutputSchema: z.ZodObject<{
|
|
112
|
+
variants: z.ZodArray<z.ZodObject<{
|
|
113
|
+
variant_id: z.ZodString;
|
|
114
|
+
product_title: z.ZodString;
|
|
115
|
+
variant_title: z.ZodNullable<z.ZodString>;
|
|
116
|
+
sku: z.ZodNullable<z.ZodString>;
|
|
117
|
+
unit_price: z.ZodNullable<z.ZodNumber>;
|
|
118
|
+
currency_code: z.ZodString;
|
|
119
|
+
available_quantity: z.ZodNullable<z.ZodNumber>;
|
|
120
|
+
orderable: z.ZodBoolean;
|
|
121
|
+
}, z.core.$strip>>;
|
|
122
|
+
}, z.core.$strip>;
|
|
123
|
+
export declare const ListShippingOptionsInputSchema: z.ZodObject<{
|
|
124
|
+
country_code: z.ZodString;
|
|
125
|
+
}, z.core.$strict>;
|
|
126
|
+
export declare const OrderAssistantShippingOptionSchema: z.ZodObject<{
|
|
127
|
+
id: z.ZodString;
|
|
128
|
+
name: z.ZodString;
|
|
129
|
+
amount: z.ZodNullable<z.ZodNumber>;
|
|
130
|
+
currency_code: z.ZodString;
|
|
131
|
+
}, z.core.$strip>;
|
|
132
|
+
export declare const ListShippingOptionsOutputSchema: z.ZodObject<{
|
|
133
|
+
shipping_options: z.ZodArray<z.ZodObject<{
|
|
134
|
+
id: z.ZodString;
|
|
135
|
+
name: z.ZodString;
|
|
136
|
+
amount: z.ZodNullable<z.ZodNumber>;
|
|
137
|
+
currency_code: z.ZodString;
|
|
138
|
+
}, z.core.$strip>>;
|
|
139
|
+
}, z.core.$strip>;
|
|
140
|
+
export declare const OrderAssistantNewCustomerSchema: z.ZodObject<{
|
|
141
|
+
first_name: z.ZodString;
|
|
142
|
+
last_name: z.ZodString;
|
|
143
|
+
company_name: z.ZodOptional<z.ZodString>;
|
|
144
|
+
email: z.ZodOptional<z.ZodString>;
|
|
145
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
146
|
+
}, z.core.$strict>;
|
|
147
|
+
export declare const CreateDraftOrderInputSchema: z.ZodObject<{
|
|
148
|
+
customer_id: z.ZodOptional<z.ZodString>;
|
|
149
|
+
new_customer: z.ZodOptional<z.ZodObject<{
|
|
150
|
+
first_name: z.ZodString;
|
|
151
|
+
last_name: z.ZodString;
|
|
152
|
+
company_name: z.ZodOptional<z.ZodString>;
|
|
153
|
+
email: z.ZodOptional<z.ZodString>;
|
|
154
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
155
|
+
}, z.core.$strict>>;
|
|
156
|
+
shipping_address: z.ZodObject<{
|
|
157
|
+
first_name: z.ZodString;
|
|
158
|
+
last_name: z.ZodString;
|
|
159
|
+
company: z.ZodOptional<z.ZodString>;
|
|
160
|
+
address_1: z.ZodString;
|
|
161
|
+
address_2: z.ZodOptional<z.ZodString>;
|
|
162
|
+
postal_code: z.ZodString;
|
|
163
|
+
city: z.ZodString;
|
|
164
|
+
country_code: z.ZodString;
|
|
165
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
166
|
+
}, z.core.$strict>;
|
|
167
|
+
billing_address: z.ZodOptional<z.ZodObject<{
|
|
168
|
+
first_name: z.ZodString;
|
|
169
|
+
last_name: z.ZodString;
|
|
170
|
+
company: z.ZodOptional<z.ZodString>;
|
|
171
|
+
address_1: z.ZodString;
|
|
172
|
+
address_2: z.ZodOptional<z.ZodString>;
|
|
173
|
+
postal_code: z.ZodString;
|
|
174
|
+
city: z.ZodString;
|
|
175
|
+
country_code: z.ZodString;
|
|
176
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
177
|
+
}, z.core.$strict>>;
|
|
178
|
+
items: z.ZodArray<z.ZodObject<{
|
|
179
|
+
variant_id: z.ZodString;
|
|
180
|
+
quantity: z.ZodNumber;
|
|
181
|
+
}, z.core.$strict>>;
|
|
182
|
+
shipping_option_id: z.ZodString;
|
|
183
|
+
source: z.ZodEnum<{
|
|
184
|
+
fax: "fax";
|
|
185
|
+
telefon: "telefon";
|
|
186
|
+
}>;
|
|
187
|
+
note: z.ZodOptional<z.ZodString>;
|
|
188
|
+
}, z.core.$strict>;
|
|
189
|
+
export declare const OrderAssistantDraftItemSchema: z.ZodObject<{
|
|
190
|
+
title: z.ZodString;
|
|
191
|
+
sku: z.ZodNullable<z.ZodString>;
|
|
192
|
+
quantity: z.ZodNumber;
|
|
193
|
+
unit_price: z.ZodNumber;
|
|
194
|
+
total: z.ZodNumber;
|
|
195
|
+
}, z.core.$strip>;
|
|
196
|
+
export declare const CreateDraftOrderOutputSchema: z.ZodObject<{
|
|
197
|
+
draft_order_id: z.ZodString;
|
|
198
|
+
display_id: z.ZodNullable<z.ZodNumber>;
|
|
199
|
+
customer_id: z.ZodString;
|
|
200
|
+
customer_created: z.ZodBoolean;
|
|
201
|
+
currency_code: z.ZodString;
|
|
202
|
+
items: z.ZodArray<z.ZodObject<{
|
|
203
|
+
title: z.ZodString;
|
|
204
|
+
sku: z.ZodNullable<z.ZodString>;
|
|
205
|
+
quantity: z.ZodNumber;
|
|
206
|
+
unit_price: z.ZodNumber;
|
|
207
|
+
total: z.ZodNumber;
|
|
208
|
+
}, z.core.$strip>>;
|
|
209
|
+
shipping_total: z.ZodNumber;
|
|
210
|
+
tax_total: z.ZodNumber;
|
|
211
|
+
total: z.ZodNumber;
|
|
212
|
+
admin_path: z.ZodString;
|
|
213
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateDraftOrderOutputSchema = exports.OrderAssistantDraftItemSchema = exports.CreateDraftOrderInputSchema = exports.OrderAssistantNewCustomerSchema = exports.ListShippingOptionsOutputSchema = exports.OrderAssistantShippingOptionSchema = exports.ListShippingOptionsInputSchema = exports.SearchProductsOutputSchema = exports.OrderAssistantVariantSchema = exports.SearchProductsInputSchema = exports.SearchCustomersOutputSchema = exports.OrderAssistantCustomerSchema = exports.OrderAssistantCustomerAddressSchema = exports.SearchCustomersInputSchema = exports.OrderAssistantAddressSchema = exports.ORDER_ASSISTANT_LIMITS = exports.ORDER_ASSISTANT_METADATA = exports.OrderAssistantSourceSchema = exports.ORDER_ASSISTANT_TOOLS = exports.ORDER_ASSISTANT_PLUGIN_KEY = void 0;
|
|
4
|
+
const zod_1 = require("@medusajs/framework/zod");
|
|
5
|
+
const primitives_1 = require("../shared/primitives");
|
|
6
|
+
/** Plugin key and container key of the order assistant in the base. */
|
|
7
|
+
exports.ORDER_ASSISTANT_PLUGIN_KEY = "order_assistant";
|
|
8
|
+
/** Tool names as the MCP client sees them. */
|
|
9
|
+
exports.ORDER_ASSISTANT_TOOLS = {
|
|
10
|
+
searchCustomers: "kunden_suchen",
|
|
11
|
+
searchProducts: "produkte_suchen",
|
|
12
|
+
listShippingOptions: "versandarten_auflisten",
|
|
13
|
+
createDraftOrder: "bestellentwurf_anlegen",
|
|
14
|
+
};
|
|
15
|
+
/** How the order reached the shop; stored in the order metadata. */
|
|
16
|
+
exports.OrderAssistantSourceSchema = zod_1.z.enum(["fax", "telefon"]);
|
|
17
|
+
/** Order metadata keys the assistant writes. */
|
|
18
|
+
exports.ORDER_ASSISTANT_METADATA = {
|
|
19
|
+
source: "order_source",
|
|
20
|
+
note: "order_note",
|
|
21
|
+
};
|
|
22
|
+
exports.ORDER_ASSISTANT_LIMITS = {
|
|
23
|
+
customers: 10,
|
|
24
|
+
variants: 20,
|
|
25
|
+
items: 50,
|
|
26
|
+
noteLength: 2000,
|
|
27
|
+
};
|
|
28
|
+
const CountryCodeSchema = zod_1.z
|
|
29
|
+
.string()
|
|
30
|
+
.trim()
|
|
31
|
+
.toLowerCase()
|
|
32
|
+
.regex(/^[a-z]{2}$/)
|
|
33
|
+
.describe("Land als ISO-3166-1-alpha-2-Code, z. B. at oder de.");
|
|
34
|
+
const OptionalTextSchema = zod_1.z.string().trim().min(1).max(255).optional();
|
|
35
|
+
exports.OrderAssistantAddressSchema = zod_1.z
|
|
36
|
+
.object({
|
|
37
|
+
first_name: primitives_1.NonEmptyStringSchema.max(255),
|
|
38
|
+
last_name: primitives_1.NonEmptyStringSchema.max(255),
|
|
39
|
+
company: OptionalTextSchema.describe("Firma oder Praxis, falls angegeben."),
|
|
40
|
+
address_1: primitives_1.NonEmptyStringSchema.max(255).describe("Straße und Hausnummer."),
|
|
41
|
+
address_2: OptionalTextSchema.describe("Adresszusatz."),
|
|
42
|
+
postal_code: primitives_1.NonEmptyStringSchema.max(20),
|
|
43
|
+
city: primitives_1.NonEmptyStringSchema.max(255),
|
|
44
|
+
country_code: CountryCodeSchema,
|
|
45
|
+
phone: OptionalTextSchema,
|
|
46
|
+
})
|
|
47
|
+
.strict();
|
|
48
|
+
exports.SearchCustomersInputSchema = zod_1.z
|
|
49
|
+
.object({
|
|
50
|
+
query: OptionalTextSchema.describe("Name, Firma, Telefonnummer oder E-Mail-Adresse (auch Teile davon)."),
|
|
51
|
+
postal_code: OptionalTextSchema.describe("PLZ einer Adresse der Person."),
|
|
52
|
+
city: OptionalTextSchema.describe("Ort einer Adresse der Person."),
|
|
53
|
+
})
|
|
54
|
+
.strict()
|
|
55
|
+
.refine((value) => Boolean(value.query ?? value.postal_code ?? value.city), { message: "Mindestens ein Suchfeld ist nötig." });
|
|
56
|
+
exports.OrderAssistantCustomerAddressSchema = zod_1.z.object({
|
|
57
|
+
first_name: zod_1.z.string().nullable(),
|
|
58
|
+
last_name: zod_1.z.string().nullable(),
|
|
59
|
+
company: zod_1.z.string().nullable(),
|
|
60
|
+
address_1: zod_1.z.string().nullable(),
|
|
61
|
+
address_2: zod_1.z.string().nullable(),
|
|
62
|
+
postal_code: zod_1.z.string().nullable(),
|
|
63
|
+
city: zod_1.z.string().nullable(),
|
|
64
|
+
country_code: zod_1.z.string().nullable(),
|
|
65
|
+
phone: zod_1.z.string().nullable(),
|
|
66
|
+
});
|
|
67
|
+
exports.OrderAssistantCustomerSchema = zod_1.z.object({
|
|
68
|
+
id: zod_1.z.string(),
|
|
69
|
+
first_name: zod_1.z.string().nullable(),
|
|
70
|
+
last_name: zod_1.z.string().nullable(),
|
|
71
|
+
company_name: zod_1.z.string().nullable(),
|
|
72
|
+
email: zod_1.z.string().nullable(),
|
|
73
|
+
phone: zod_1.z.string().nullable(),
|
|
74
|
+
/** Registered shop account (true) or a customer record without login. */
|
|
75
|
+
has_account: zod_1.z.boolean(),
|
|
76
|
+
addresses: zod_1.z.array(exports.OrderAssistantCustomerAddressSchema),
|
|
77
|
+
});
|
|
78
|
+
exports.SearchCustomersOutputSchema = zod_1.z.object({
|
|
79
|
+
customers: zod_1.z.array(exports.OrderAssistantCustomerSchema),
|
|
80
|
+
});
|
|
81
|
+
exports.SearchProductsInputSchema = zod_1.z
|
|
82
|
+
.object({
|
|
83
|
+
query: primitives_1.NonEmptyStringSchema.max(255).describe("Produktname oder Artikelnummer (auch Teile davon)."),
|
|
84
|
+
country_code: CountryCodeSchema.describe("Lieferland als ISO-Code; bestimmt Preis und Währung."),
|
|
85
|
+
})
|
|
86
|
+
.strict();
|
|
87
|
+
exports.OrderAssistantVariantSchema = zod_1.z.object({
|
|
88
|
+
variant_id: zod_1.z.string(),
|
|
89
|
+
product_title: zod_1.z.string(),
|
|
90
|
+
variant_title: zod_1.z.string().nullable(),
|
|
91
|
+
sku: zod_1.z.string().nullable(),
|
|
92
|
+
/** Price per unit in major currency units (33.5 = 33,50); null without a price. */
|
|
93
|
+
unit_price: zod_1.z.number().nullable(),
|
|
94
|
+
currency_code: zod_1.z.string(),
|
|
95
|
+
/** Available quantity; null when the variant's stock is not managed. */
|
|
96
|
+
available_quantity: zod_1.z.number().nullable(),
|
|
97
|
+
/** False when the variant cannot be ordered (no price or no stock). */
|
|
98
|
+
orderable: zod_1.z.boolean(),
|
|
99
|
+
});
|
|
100
|
+
exports.SearchProductsOutputSchema = zod_1.z.object({
|
|
101
|
+
variants: zod_1.z.array(exports.OrderAssistantVariantSchema),
|
|
102
|
+
});
|
|
103
|
+
exports.ListShippingOptionsInputSchema = zod_1.z
|
|
104
|
+
.object({
|
|
105
|
+
country_code: CountryCodeSchema.describe("Lieferland als ISO-Code."),
|
|
106
|
+
})
|
|
107
|
+
.strict();
|
|
108
|
+
exports.OrderAssistantShippingOptionSchema = zod_1.z.object({
|
|
109
|
+
id: zod_1.z.string(),
|
|
110
|
+
name: zod_1.z.string(),
|
|
111
|
+
/** Flat price in major currency units; null when none is set for the currency. */
|
|
112
|
+
amount: zod_1.z.number().nullable(),
|
|
113
|
+
currency_code: zod_1.z.string(),
|
|
114
|
+
});
|
|
115
|
+
exports.ListShippingOptionsOutputSchema = zod_1.z.object({
|
|
116
|
+
shipping_options: zod_1.z.array(exports.OrderAssistantShippingOptionSchema),
|
|
117
|
+
});
|
|
118
|
+
exports.OrderAssistantNewCustomerSchema = zod_1.z
|
|
119
|
+
.object({
|
|
120
|
+
first_name: primitives_1.NonEmptyStringSchema.max(255),
|
|
121
|
+
last_name: primitives_1.NonEmptyStringSchema.max(255),
|
|
122
|
+
company_name: OptionalTextSchema,
|
|
123
|
+
email: zod_1.z
|
|
124
|
+
.string()
|
|
125
|
+
.trim()
|
|
126
|
+
.toLowerCase()
|
|
127
|
+
.email()
|
|
128
|
+
.max(255)
|
|
129
|
+
.optional()
|
|
130
|
+
.describe("Nur angeben, wenn eine E-Mail-Adresse bekannt ist."),
|
|
131
|
+
phone: OptionalTextSchema,
|
|
132
|
+
})
|
|
133
|
+
.strict();
|
|
134
|
+
exports.CreateDraftOrderInputSchema = zod_1.z
|
|
135
|
+
.object({
|
|
136
|
+
customer_id: zod_1.z
|
|
137
|
+
.string()
|
|
138
|
+
.trim()
|
|
139
|
+
.min(1)
|
|
140
|
+
.optional()
|
|
141
|
+
.describe("ID einer bestehenden Kund:in aus kunden_suchen."),
|
|
142
|
+
new_customer: exports.OrderAssistantNewCustomerSchema.optional().describe("Neue Kund:in ohne Konto; nur wenn kunden_suchen niemanden findet."),
|
|
143
|
+
shipping_address: exports.OrderAssistantAddressSchema,
|
|
144
|
+
billing_address: exports.OrderAssistantAddressSchema.optional().describe("Rechnungsadresse; ohne Angabe gilt die Lieferadresse."),
|
|
145
|
+
items: zod_1.z
|
|
146
|
+
.array(zod_1.z
|
|
147
|
+
.object({
|
|
148
|
+
variant_id: primitives_1.NonEmptyStringSchema.describe("ID der Variante aus produkte_suchen."),
|
|
149
|
+
quantity: zod_1.z.number().int().positive().max(9999),
|
|
150
|
+
})
|
|
151
|
+
.strict())
|
|
152
|
+
.min(1)
|
|
153
|
+
.max(exports.ORDER_ASSISTANT_LIMITS.items),
|
|
154
|
+
shipping_option_id: primitives_1.NonEmptyStringSchema.describe("ID der Versandart aus versandarten_auflisten."),
|
|
155
|
+
source: exports.OrderAssistantSourceSchema.describe("Wie die Bestellung eingegangen ist."),
|
|
156
|
+
note: zod_1.z
|
|
157
|
+
.string()
|
|
158
|
+
.trim()
|
|
159
|
+
.min(1)
|
|
160
|
+
.max(exports.ORDER_ASSISTANT_LIMITS.noteLength)
|
|
161
|
+
.optional()
|
|
162
|
+
.describe("Interne Notiz, z. B. Unklarheiten auf dem Fax."),
|
|
163
|
+
})
|
|
164
|
+
.strict()
|
|
165
|
+
.refine((value) => Boolean(value.customer_id) !== Boolean(value.new_customer), { message: "Genau eines von customer_id und new_customer ist nötig." });
|
|
166
|
+
exports.OrderAssistantDraftItemSchema = zod_1.z.object({
|
|
167
|
+
title: zod_1.z.string(),
|
|
168
|
+
sku: zod_1.z.string().nullable(),
|
|
169
|
+
quantity: zod_1.z.number(),
|
|
170
|
+
unit_price: zod_1.z.number(),
|
|
171
|
+
total: zod_1.z.number(),
|
|
172
|
+
});
|
|
173
|
+
exports.CreateDraftOrderOutputSchema = zod_1.z.object({
|
|
174
|
+
draft_order_id: zod_1.z.string(),
|
|
175
|
+
display_id: zod_1.z.number().nullable(),
|
|
176
|
+
customer_id: zod_1.z.string(),
|
|
177
|
+
/** True when the assistant created the customer record for this draft. */
|
|
178
|
+
customer_created: zod_1.z.boolean(),
|
|
179
|
+
currency_code: zod_1.z.string(),
|
|
180
|
+
items: zod_1.z.array(exports.OrderAssistantDraftItemSchema),
|
|
181
|
+
shipping_total: zod_1.z.number(),
|
|
182
|
+
tax_total: zod_1.z.number(),
|
|
183
|
+
total: zod_1.z.number(),
|
|
184
|
+
/** Path of the draft in the Admin, relative to the backend URL. */
|
|
185
|
+
admin_path: zod_1.z.string(),
|
|
186
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { z } from "@medusajs/framework/zod";
|
|
2
|
+
import type { CreateDraftOrderInputSchema, CreateDraftOrderOutputSchema, ListShippingOptionsInputSchema, ListShippingOptionsOutputSchema, OrderAssistantAddressSchema, OrderAssistantCustomerSchema, OrderAssistantShippingOptionSchema, OrderAssistantSourceSchema, OrderAssistantVariantSchema, SearchCustomersInputSchema, SearchCustomersOutputSchema, SearchProductsInputSchema, SearchProductsOutputSchema } from "./schemas";
|
|
3
|
+
export type OrderAssistantSource = z.infer<typeof OrderAssistantSourceSchema>;
|
|
4
|
+
export type OrderAssistantAddress = z.infer<typeof OrderAssistantAddressSchema>;
|
|
5
|
+
export type OrderAssistantCustomer = z.infer<typeof OrderAssistantCustomerSchema>;
|
|
6
|
+
export type OrderAssistantVariant = z.infer<typeof OrderAssistantVariantSchema>;
|
|
7
|
+
export type OrderAssistantShippingOption = z.infer<typeof OrderAssistantShippingOptionSchema>;
|
|
8
|
+
export type SearchCustomersInput = z.infer<typeof SearchCustomersInputSchema>;
|
|
9
|
+
export type SearchCustomersOutput = z.infer<typeof SearchCustomersOutputSchema>;
|
|
10
|
+
export type SearchProductsInput = z.infer<typeof SearchProductsInputSchema>;
|
|
11
|
+
export type SearchProductsOutput = z.infer<typeof SearchProductsOutputSchema>;
|
|
12
|
+
export type ListShippingOptionsInput = z.infer<typeof ListShippingOptionsInputSchema>;
|
|
13
|
+
export type ListShippingOptionsOutput = z.infer<typeof ListShippingOptionsOutputSchema>;
|
|
14
|
+
export type CreateDraftOrderInput = z.infer<typeof CreateDraftOrderInputSchema>;
|
|
15
|
+
export type CreateDraftOrderOutput = z.infer<typeof CreateDraftOrderOutputSchema>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hartl-services/medusa-contracts",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"files": [
|
|
@@ -51,6 +51,11 @@
|
|
|
51
51
|
"import": "./dist/esm/documents/admin-types.mjs",
|
|
52
52
|
"require": "./dist/documents/admin-types.js"
|
|
53
53
|
},
|
|
54
|
+
"./types/order-assistant": {
|
|
55
|
+
"types": "./dist/order-assistant/types.d.ts",
|
|
56
|
+
"import": "./dist/esm/order-assistant/types.mjs",
|
|
57
|
+
"require": "./dist/order-assistant/types.js"
|
|
58
|
+
},
|
|
54
59
|
"./types/files": {
|
|
55
60
|
"types": "./dist/files/types.d.ts",
|
|
56
61
|
"import": "./dist/esm/files/types.mjs",
|
|
@@ -106,6 +111,11 @@
|
|
|
106
111
|
"import": "./dist/esm/documents/schemas.mjs",
|
|
107
112
|
"require": "./dist/documents/schemas.js"
|
|
108
113
|
},
|
|
114
|
+
"./schemas/order-assistant": {
|
|
115
|
+
"types": "./dist/order-assistant/schemas.d.ts",
|
|
116
|
+
"import": "./dist/esm/order-assistant/schemas.mjs",
|
|
117
|
+
"require": "./dist/order-assistant/schemas.js"
|
|
118
|
+
},
|
|
109
119
|
"./schemas/files": {
|
|
110
120
|
"types": "./dist/files/schemas.d.ts",
|
|
111
121
|
"import": "./dist/esm/files/schemas.mjs",
|
|
@@ -161,6 +171,11 @@
|
|
|
161
171
|
"import": "./dist/esm/documents/paths.mjs",
|
|
162
172
|
"require": "./dist/documents/paths.js"
|
|
163
173
|
},
|
|
174
|
+
"./paths/order-assistant": {
|
|
175
|
+
"types": "./dist/order-assistant/paths.d.ts",
|
|
176
|
+
"import": "./dist/esm/order-assistant/paths.mjs",
|
|
177
|
+
"require": "./dist/order-assistant/paths.js"
|
|
178
|
+
},
|
|
164
179
|
"./paths/files": {
|
|
165
180
|
"types": "./dist/files/paths.d.ts",
|
|
166
181
|
"import": "./dist/esm/files/paths.mjs",
|