@voltade/envoy-sdk 1.0.4 → 1.1.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/dist/client.d.ts +5 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +2 -1
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +7 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/resources/index.d.ts +1 -0
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/resources/index.js +1 -0
- package/dist/resources/index.js.map +1 -1
- package/dist/resources/orders/index.d.ts +83 -0
- package/dist/resources/orders/index.d.ts.map +1 -0
- package/dist/resources/orders/index.js +110 -0
- package/dist/resources/orders/index.js.map +1 -0
- package/dist/resources/orders/types.d.ts +338 -0
- package/dist/resources/orders/types.d.ts.map +1 -0
- package/dist/resources/orders/types.js +69 -0
- package/dist/resources/orders/types.js.map +1 -0
- package/dist/resources/webhooks/index.d.ts +3 -3
- package/dist/resources/webhooks/index.d.ts.map +1 -1
- package/dist/resources/webhooks/index.js +3 -3
- package/dist/resources/webhooks/index.js.map +1 -1
- package/dist/resources/webhooks/types.d.ts +3350 -0
- package/dist/resources/webhooks/types.d.ts.map +1 -1
- package/dist/resources/webhooks/types.js +14 -2
- package/dist/resources/webhooks/types.js.map +1 -1
- package/dist/test.d.ts +6 -0
- package/dist/test.d.ts.map +1 -0
- package/dist/test.js +115 -0
- package/dist/test.js.map +1 -0
- package/package.json +3 -1
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Zod Schemas for Orders
|
|
4
|
+
*/
|
|
5
|
+
export declare const OrderSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
6
|
+
export declare const UpsertOrderParamsSchema: z.ZodObject<{
|
|
7
|
+
name: z.ZodOptional<z.ZodString>;
|
|
8
|
+
contact_id: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
total_amount: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
currency_code: z.ZodOptional<z.ZodString>;
|
|
11
|
+
financial_status: z.ZodOptional<z.ZodString>;
|
|
12
|
+
fulfillment_status: z.ZodOptional<z.ZodString>;
|
|
13
|
+
source: z.ZodString;
|
|
14
|
+
source_id: z.ZodString;
|
|
15
|
+
order_url: z.ZodOptional<z.ZodString>;
|
|
16
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
17
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
18
|
+
}, "strip", z.ZodTypeAny, {
|
|
19
|
+
source_id: string;
|
|
20
|
+
source: string;
|
|
21
|
+
name?: string | undefined;
|
|
22
|
+
contact_id?: number | undefined;
|
|
23
|
+
total_amount?: number | undefined;
|
|
24
|
+
currency_code?: string | undefined;
|
|
25
|
+
financial_status?: string | undefined;
|
|
26
|
+
fulfillment_status?: string | undefined;
|
|
27
|
+
order_url?: string | undefined;
|
|
28
|
+
notes?: string | undefined;
|
|
29
|
+
metadata?: Record<string, unknown> | undefined;
|
|
30
|
+
}, {
|
|
31
|
+
source_id: string;
|
|
32
|
+
source: string;
|
|
33
|
+
name?: string | undefined;
|
|
34
|
+
contact_id?: number | undefined;
|
|
35
|
+
total_amount?: number | undefined;
|
|
36
|
+
currency_code?: string | undefined;
|
|
37
|
+
financial_status?: string | undefined;
|
|
38
|
+
fulfillment_status?: string | undefined;
|
|
39
|
+
order_url?: string | undefined;
|
|
40
|
+
notes?: string | undefined;
|
|
41
|
+
metadata?: Record<string, unknown> | undefined;
|
|
42
|
+
}>;
|
|
43
|
+
export declare const UpsertOrderRequestSchema: z.ZodObject<{
|
|
44
|
+
order: z.ZodObject<{
|
|
45
|
+
name: z.ZodOptional<z.ZodString>;
|
|
46
|
+
contact_id: z.ZodOptional<z.ZodNumber>;
|
|
47
|
+
total_amount: z.ZodOptional<z.ZodNumber>;
|
|
48
|
+
currency_code: z.ZodOptional<z.ZodString>;
|
|
49
|
+
financial_status: z.ZodOptional<z.ZodString>;
|
|
50
|
+
fulfillment_status: z.ZodOptional<z.ZodString>;
|
|
51
|
+
source: z.ZodString;
|
|
52
|
+
source_id: z.ZodString;
|
|
53
|
+
order_url: z.ZodOptional<z.ZodString>;
|
|
54
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
55
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
56
|
+
}, "strip", z.ZodTypeAny, {
|
|
57
|
+
source_id: string;
|
|
58
|
+
source: string;
|
|
59
|
+
name?: string | undefined;
|
|
60
|
+
contact_id?: number | undefined;
|
|
61
|
+
total_amount?: number | undefined;
|
|
62
|
+
currency_code?: string | undefined;
|
|
63
|
+
financial_status?: string | undefined;
|
|
64
|
+
fulfillment_status?: string | undefined;
|
|
65
|
+
order_url?: string | undefined;
|
|
66
|
+
notes?: string | undefined;
|
|
67
|
+
metadata?: Record<string, unknown> | undefined;
|
|
68
|
+
}, {
|
|
69
|
+
source_id: string;
|
|
70
|
+
source: string;
|
|
71
|
+
name?: string | undefined;
|
|
72
|
+
contact_id?: number | undefined;
|
|
73
|
+
total_amount?: number | undefined;
|
|
74
|
+
currency_code?: string | undefined;
|
|
75
|
+
financial_status?: string | undefined;
|
|
76
|
+
fulfillment_status?: string | undefined;
|
|
77
|
+
order_url?: string | undefined;
|
|
78
|
+
notes?: string | undefined;
|
|
79
|
+
metadata?: Record<string, unknown> | undefined;
|
|
80
|
+
}>;
|
|
81
|
+
}, "strip", z.ZodTypeAny, {
|
|
82
|
+
order: {
|
|
83
|
+
source_id: string;
|
|
84
|
+
source: string;
|
|
85
|
+
name?: string | undefined;
|
|
86
|
+
contact_id?: number | undefined;
|
|
87
|
+
total_amount?: number | undefined;
|
|
88
|
+
currency_code?: string | undefined;
|
|
89
|
+
financial_status?: string | undefined;
|
|
90
|
+
fulfillment_status?: string | undefined;
|
|
91
|
+
order_url?: string | undefined;
|
|
92
|
+
notes?: string | undefined;
|
|
93
|
+
metadata?: Record<string, unknown> | undefined;
|
|
94
|
+
};
|
|
95
|
+
}, {
|
|
96
|
+
order: {
|
|
97
|
+
source_id: string;
|
|
98
|
+
source: string;
|
|
99
|
+
name?: string | undefined;
|
|
100
|
+
contact_id?: number | undefined;
|
|
101
|
+
total_amount?: number | undefined;
|
|
102
|
+
currency_code?: string | undefined;
|
|
103
|
+
financial_status?: string | undefined;
|
|
104
|
+
fulfillment_status?: string | undefined;
|
|
105
|
+
order_url?: string | undefined;
|
|
106
|
+
notes?: string | undefined;
|
|
107
|
+
metadata?: Record<string, unknown> | undefined;
|
|
108
|
+
};
|
|
109
|
+
}>;
|
|
110
|
+
export declare const UpsertOrderResponsePayloadSchema: z.ZodObject<{
|
|
111
|
+
id: z.ZodNumber;
|
|
112
|
+
name: z.ZodOptional<z.ZodString>;
|
|
113
|
+
contact_id: z.ZodOptional<z.ZodNumber>;
|
|
114
|
+
contact_name: z.ZodOptional<z.ZodString>;
|
|
115
|
+
total_amount: z.ZodOptional<z.ZodNumber>;
|
|
116
|
+
currency_code: z.ZodOptional<z.ZodString>;
|
|
117
|
+
financial_status: z.ZodOptional<z.ZodString>;
|
|
118
|
+
fulfillment_status: z.ZodOptional<z.ZodString>;
|
|
119
|
+
source: z.ZodString;
|
|
120
|
+
source_id: z.ZodString;
|
|
121
|
+
order_url: z.ZodOptional<z.ZodString>;
|
|
122
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
123
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
124
|
+
created_at: z.ZodString;
|
|
125
|
+
updated_at: z.ZodString;
|
|
126
|
+
}, "strip", z.ZodTypeAny, {
|
|
127
|
+
id: number;
|
|
128
|
+
created_at: string;
|
|
129
|
+
source_id: string;
|
|
130
|
+
updated_at: string;
|
|
131
|
+
source: string;
|
|
132
|
+
name?: string | undefined;
|
|
133
|
+
contact_id?: number | undefined;
|
|
134
|
+
total_amount?: number | undefined;
|
|
135
|
+
currency_code?: string | undefined;
|
|
136
|
+
financial_status?: string | undefined;
|
|
137
|
+
fulfillment_status?: string | undefined;
|
|
138
|
+
order_url?: string | undefined;
|
|
139
|
+
notes?: string | undefined;
|
|
140
|
+
metadata?: Record<string, unknown> | undefined;
|
|
141
|
+
contact_name?: string | undefined;
|
|
142
|
+
}, {
|
|
143
|
+
id: number;
|
|
144
|
+
created_at: string;
|
|
145
|
+
source_id: string;
|
|
146
|
+
updated_at: string;
|
|
147
|
+
source: string;
|
|
148
|
+
name?: string | undefined;
|
|
149
|
+
contact_id?: number | undefined;
|
|
150
|
+
total_amount?: number | undefined;
|
|
151
|
+
currency_code?: string | undefined;
|
|
152
|
+
financial_status?: string | undefined;
|
|
153
|
+
fulfillment_status?: string | undefined;
|
|
154
|
+
order_url?: string | undefined;
|
|
155
|
+
notes?: string | undefined;
|
|
156
|
+
metadata?: Record<string, unknown> | undefined;
|
|
157
|
+
contact_name?: string | undefined;
|
|
158
|
+
}>;
|
|
159
|
+
export declare const UpsertOrderResponseSchema: z.ZodObject<{
|
|
160
|
+
payload: z.ZodObject<{
|
|
161
|
+
id: z.ZodNumber;
|
|
162
|
+
name: z.ZodOptional<z.ZodString>;
|
|
163
|
+
contact_id: z.ZodOptional<z.ZodNumber>;
|
|
164
|
+
contact_name: z.ZodOptional<z.ZodString>;
|
|
165
|
+
total_amount: z.ZodOptional<z.ZodNumber>;
|
|
166
|
+
currency_code: z.ZodOptional<z.ZodString>;
|
|
167
|
+
financial_status: z.ZodOptional<z.ZodString>;
|
|
168
|
+
fulfillment_status: z.ZodOptional<z.ZodString>;
|
|
169
|
+
source: z.ZodString;
|
|
170
|
+
source_id: z.ZodString;
|
|
171
|
+
order_url: z.ZodOptional<z.ZodString>;
|
|
172
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
173
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
174
|
+
created_at: z.ZodString;
|
|
175
|
+
updated_at: z.ZodString;
|
|
176
|
+
}, "strip", z.ZodTypeAny, {
|
|
177
|
+
id: number;
|
|
178
|
+
created_at: string;
|
|
179
|
+
source_id: string;
|
|
180
|
+
updated_at: string;
|
|
181
|
+
source: string;
|
|
182
|
+
name?: string | undefined;
|
|
183
|
+
contact_id?: number | undefined;
|
|
184
|
+
total_amount?: number | undefined;
|
|
185
|
+
currency_code?: string | undefined;
|
|
186
|
+
financial_status?: string | undefined;
|
|
187
|
+
fulfillment_status?: string | undefined;
|
|
188
|
+
order_url?: string | undefined;
|
|
189
|
+
notes?: string | undefined;
|
|
190
|
+
metadata?: Record<string, unknown> | undefined;
|
|
191
|
+
contact_name?: string | undefined;
|
|
192
|
+
}, {
|
|
193
|
+
id: number;
|
|
194
|
+
created_at: string;
|
|
195
|
+
source_id: string;
|
|
196
|
+
updated_at: string;
|
|
197
|
+
source: string;
|
|
198
|
+
name?: string | undefined;
|
|
199
|
+
contact_id?: number | undefined;
|
|
200
|
+
total_amount?: number | undefined;
|
|
201
|
+
currency_code?: string | undefined;
|
|
202
|
+
financial_status?: string | undefined;
|
|
203
|
+
fulfillment_status?: string | undefined;
|
|
204
|
+
order_url?: string | undefined;
|
|
205
|
+
notes?: string | undefined;
|
|
206
|
+
metadata?: Record<string, unknown> | undefined;
|
|
207
|
+
contact_name?: string | undefined;
|
|
208
|
+
}>;
|
|
209
|
+
}, "strip", z.ZodTypeAny, {
|
|
210
|
+
payload: {
|
|
211
|
+
id: number;
|
|
212
|
+
created_at: string;
|
|
213
|
+
source_id: string;
|
|
214
|
+
updated_at: string;
|
|
215
|
+
source: string;
|
|
216
|
+
name?: string | undefined;
|
|
217
|
+
contact_id?: number | undefined;
|
|
218
|
+
total_amount?: number | undefined;
|
|
219
|
+
currency_code?: string | undefined;
|
|
220
|
+
financial_status?: string | undefined;
|
|
221
|
+
fulfillment_status?: string | undefined;
|
|
222
|
+
order_url?: string | undefined;
|
|
223
|
+
notes?: string | undefined;
|
|
224
|
+
metadata?: Record<string, unknown> | undefined;
|
|
225
|
+
contact_name?: string | undefined;
|
|
226
|
+
};
|
|
227
|
+
}, {
|
|
228
|
+
payload: {
|
|
229
|
+
id: number;
|
|
230
|
+
created_at: string;
|
|
231
|
+
source_id: string;
|
|
232
|
+
updated_at: string;
|
|
233
|
+
source: string;
|
|
234
|
+
name?: string | undefined;
|
|
235
|
+
contact_id?: number | undefined;
|
|
236
|
+
total_amount?: number | undefined;
|
|
237
|
+
currency_code?: string | undefined;
|
|
238
|
+
financial_status?: string | undefined;
|
|
239
|
+
fulfillment_status?: string | undefined;
|
|
240
|
+
order_url?: string | undefined;
|
|
241
|
+
notes?: string | undefined;
|
|
242
|
+
metadata?: Record<string, unknown> | undefined;
|
|
243
|
+
contact_name?: string | undefined;
|
|
244
|
+
};
|
|
245
|
+
}>;
|
|
246
|
+
export declare const ListOrdersParamsSchema: z.ZodObject<{
|
|
247
|
+
page: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
248
|
+
per_page: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
249
|
+
since: z.ZodOptional<z.ZodString>;
|
|
250
|
+
until: z.ZodOptional<z.ZodString>;
|
|
251
|
+
sort: z.ZodOptional<z.ZodString>;
|
|
252
|
+
payload: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
|
|
253
|
+
}, "strip", z.ZodTypeAny, {
|
|
254
|
+
page: number;
|
|
255
|
+
per_page: number;
|
|
256
|
+
sort?: string | undefined;
|
|
257
|
+
payload?: Record<string, unknown>[] | undefined;
|
|
258
|
+
since?: string | undefined;
|
|
259
|
+
until?: string | undefined;
|
|
260
|
+
}, {
|
|
261
|
+
sort?: string | undefined;
|
|
262
|
+
payload?: Record<string, unknown>[] | undefined;
|
|
263
|
+
page?: number | undefined;
|
|
264
|
+
per_page?: number | undefined;
|
|
265
|
+
since?: string | undefined;
|
|
266
|
+
until?: string | undefined;
|
|
267
|
+
}>;
|
|
268
|
+
export declare const OrdersMetaSchema: z.ZodObject<{
|
|
269
|
+
count: z.ZodNumber;
|
|
270
|
+
current_page: z.ZodNumber;
|
|
271
|
+
per_page: z.ZodNumber;
|
|
272
|
+
total_pages: z.ZodNumber;
|
|
273
|
+
summary: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
274
|
+
}, "strip", z.ZodTypeAny, {
|
|
275
|
+
per_page: number;
|
|
276
|
+
count: number;
|
|
277
|
+
current_page: number;
|
|
278
|
+
total_pages: number;
|
|
279
|
+
summary: Record<string, unknown>;
|
|
280
|
+
}, {
|
|
281
|
+
per_page: number;
|
|
282
|
+
count: number;
|
|
283
|
+
current_page: number;
|
|
284
|
+
total_pages: number;
|
|
285
|
+
summary: Record<string, unknown>;
|
|
286
|
+
}>;
|
|
287
|
+
export declare const ListOrdersResponseSchema: z.ZodObject<{
|
|
288
|
+
meta: z.ZodObject<{
|
|
289
|
+
count: z.ZodNumber;
|
|
290
|
+
current_page: z.ZodNumber;
|
|
291
|
+
per_page: z.ZodNumber;
|
|
292
|
+
total_pages: z.ZodNumber;
|
|
293
|
+
summary: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
294
|
+
}, "strip", z.ZodTypeAny, {
|
|
295
|
+
per_page: number;
|
|
296
|
+
count: number;
|
|
297
|
+
current_page: number;
|
|
298
|
+
total_pages: number;
|
|
299
|
+
summary: Record<string, unknown>;
|
|
300
|
+
}, {
|
|
301
|
+
per_page: number;
|
|
302
|
+
count: number;
|
|
303
|
+
current_page: number;
|
|
304
|
+
total_pages: number;
|
|
305
|
+
summary: Record<string, unknown>;
|
|
306
|
+
}>;
|
|
307
|
+
data: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
|
|
308
|
+
}, "strip", z.ZodTypeAny, {
|
|
309
|
+
meta: {
|
|
310
|
+
per_page: number;
|
|
311
|
+
count: number;
|
|
312
|
+
current_page: number;
|
|
313
|
+
total_pages: number;
|
|
314
|
+
summary: Record<string, unknown>;
|
|
315
|
+
};
|
|
316
|
+
data: Record<string, unknown>[];
|
|
317
|
+
}, {
|
|
318
|
+
meta: {
|
|
319
|
+
per_page: number;
|
|
320
|
+
count: number;
|
|
321
|
+
current_page: number;
|
|
322
|
+
total_pages: number;
|
|
323
|
+
summary: Record<string, unknown>;
|
|
324
|
+
};
|
|
325
|
+
data: Record<string, unknown>[];
|
|
326
|
+
}>;
|
|
327
|
+
/**
|
|
328
|
+
* TypeScript Types (inferred from Zod schemas)
|
|
329
|
+
*/
|
|
330
|
+
export type Order = z.infer<typeof OrderSchema>;
|
|
331
|
+
export type ListOrdersParams = z.infer<typeof ListOrdersParamsSchema>;
|
|
332
|
+
export type OrdersMeta = z.infer<typeof OrdersMetaSchema>;
|
|
333
|
+
export type ListOrdersResponse = z.infer<typeof ListOrdersResponseSchema>;
|
|
334
|
+
export type UpsertOrderParams = z.infer<typeof UpsertOrderParamsSchema>;
|
|
335
|
+
export type UpsertOrderRequest = z.infer<typeof UpsertOrderRequestSchema>;
|
|
336
|
+
export type UpsertOrderResponsePayload = z.infer<typeof UpsertOrderResponsePayloadSchema>;
|
|
337
|
+
export type UpsertOrderResponse = z.infer<typeof UpsertOrderResponseSchema>;
|
|
338
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../resources/orders/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AAGH,eAAO,MAAM,WAAW,wCAAwB,CAAC;AAGjD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYlC,CAAC;AAGH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEnC,CAAC;AAGH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;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
|
+
export const OrderSchema = z.record(z.unknown());
|
|
7
|
+
// Upsert order parameters schema
|
|
8
|
+
export const UpsertOrderParamsSchema = z.object({
|
|
9
|
+
name: z.string().optional(),
|
|
10
|
+
contact_id: z.number().optional(),
|
|
11
|
+
total_amount: z.number().optional(),
|
|
12
|
+
currency_code: z.string().optional(),
|
|
13
|
+
financial_status: z.string().optional(),
|
|
14
|
+
fulfillment_status: z.string().optional(),
|
|
15
|
+
source: z.string(),
|
|
16
|
+
source_id: z.string(),
|
|
17
|
+
order_url: z.string().optional(),
|
|
18
|
+
notes: z.string().optional(),
|
|
19
|
+
metadata: z.record(z.unknown()).optional(),
|
|
20
|
+
});
|
|
21
|
+
// Upsert order request schema (wraps order in an object)
|
|
22
|
+
export const UpsertOrderRequestSchema = z.object({
|
|
23
|
+
order: UpsertOrderParamsSchema,
|
|
24
|
+
});
|
|
25
|
+
// Upsert order response payload schema
|
|
26
|
+
export const UpsertOrderResponsePayloadSchema = z.object({
|
|
27
|
+
id: z.number(),
|
|
28
|
+
name: z.string().optional(),
|
|
29
|
+
contact_id: z.number().optional(),
|
|
30
|
+
contact_name: z.string().optional(),
|
|
31
|
+
total_amount: z.number().optional(),
|
|
32
|
+
currency_code: z.string().optional(),
|
|
33
|
+
financial_status: z.string().optional(),
|
|
34
|
+
fulfillment_status: z.string().optional(),
|
|
35
|
+
source: z.string(),
|
|
36
|
+
source_id: z.string(),
|
|
37
|
+
order_url: z.string().optional(),
|
|
38
|
+
notes: z.string().optional(),
|
|
39
|
+
metadata: z.record(z.unknown()).optional(),
|
|
40
|
+
created_at: z.string(),
|
|
41
|
+
updated_at: z.string(),
|
|
42
|
+
});
|
|
43
|
+
// Upsert order response schema
|
|
44
|
+
export const UpsertOrderResponseSchema = z.object({
|
|
45
|
+
payload: UpsertOrderResponsePayloadSchema,
|
|
46
|
+
});
|
|
47
|
+
// List orders query parameters schema
|
|
48
|
+
export const ListOrdersParamsSchema = z.object({
|
|
49
|
+
page: z.number().int().positive().optional().default(1),
|
|
50
|
+
per_page: z.number().int().positive().max(100).optional().default(25),
|
|
51
|
+
since: z.string().optional(),
|
|
52
|
+
until: z.string().optional(),
|
|
53
|
+
sort: z.string().optional(),
|
|
54
|
+
payload: z.array(z.record(z.unknown())).optional(),
|
|
55
|
+
});
|
|
56
|
+
// List orders response meta schema
|
|
57
|
+
export const OrdersMetaSchema = z.object({
|
|
58
|
+
count: z.number(),
|
|
59
|
+
current_page: z.number(),
|
|
60
|
+
per_page: z.number(),
|
|
61
|
+
total_pages: z.number(),
|
|
62
|
+
summary: z.record(z.unknown()),
|
|
63
|
+
});
|
|
64
|
+
// List orders response schema
|
|
65
|
+
export const ListOrdersResponseSchema = z.object({
|
|
66
|
+
meta: OrdersMetaSchema,
|
|
67
|
+
data: z.array(OrderSchema),
|
|
68
|
+
});
|
|
69
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../resources/orders/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AAEH,mDAAmD;AACnD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;AAEjD,iCAAiC;AACjC,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACvC,kBAAkB,EAAE,CAAC,CA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,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;CAC/B,CAAC,CAAC;AAEH,8BAA8B;AAC9B,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,IAAI,EAAE,gBAAgB;IACtB,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC;CAC3B,CAAC,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type WebhookEvent } from "./types.js";
|
|
2
2
|
export * from "./types.js";
|
|
3
3
|
export declare const webhookEvent: {
|
|
4
4
|
/** Throws ZodError if invalid */
|
|
5
|
-
parse: (body: unknown) =>
|
|
5
|
+
parse: (body: unknown) => WebhookEvent;
|
|
6
6
|
/** Returns null if invalid */
|
|
7
|
-
safeParse: (body: unknown) =>
|
|
7
|
+
safeParse: (body: unknown) => WebhookEvent | null;
|
|
8
8
|
};
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../resources/webhooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../resources/webhooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAEnE,cAAc,YAAY,CAAC;AAE3B,eAAO,MAAM,YAAY;IACvB,iCAAiC;kBACnB,OAAO,KAAG,YAAY;IAGpC,8BAA8B;sBACZ,OAAO,KAAG,YAAY,GAAG,IAAI;CAIhD,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { WebhookEventSchema } from "./types.js";
|
|
2
2
|
export * from "./types.js";
|
|
3
3
|
export const webhookEvent = {
|
|
4
4
|
/** Throws ZodError if invalid */
|
|
5
5
|
parse: (body) => {
|
|
6
|
-
return
|
|
6
|
+
return WebhookEventSchema.parse(body);
|
|
7
7
|
},
|
|
8
8
|
/** Returns null if invalid */
|
|
9
9
|
safeParse: (body) => {
|
|
10
|
-
const result =
|
|
10
|
+
const result = WebhookEventSchema.safeParse(body);
|
|
11
11
|
return result.success ? result.data : null;
|
|
12
12
|
},
|
|
13
13
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../resources/webhooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../resources/webhooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAqB,MAAM,YAAY,CAAC;AAEnE,cAAc,YAAY,CAAC;AAE3B,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,iCAAiC;IACjC,KAAK,EAAE,CAAC,IAAa,EAAgB,EAAE;QACrC,OAAO,kBAAkB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;IACD,8BAA8B;IAC9B,SAAS,EAAE,CAAC,IAAa,EAAuB,EAAE;QAChD,MAAM,MAAM,GAAG,kBAAkB,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAClD,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IAC7C,CAAC;CACF,CAAC"}
|