@shopickup/adapters-mpl 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/README.md +43 -0
  2. package/dist/capabilities/auth.d.ts +39 -0
  3. package/dist/capabilities/auth.d.ts.map +1 -0
  4. package/dist/capabilities/auth.js +130 -0
  5. package/dist/capabilities/close.d.ts +8 -0
  6. package/dist/capabilities/close.d.ts.map +1 -0
  7. package/dist/capabilities/close.js +70 -0
  8. package/dist/capabilities/get-shipment-details.d.ts +63 -0
  9. package/dist/capabilities/get-shipment-details.d.ts.map +1 -0
  10. package/dist/capabilities/get-shipment-details.js +97 -0
  11. package/dist/capabilities/index.d.ts +10 -0
  12. package/dist/capabilities/index.d.ts.map +1 -0
  13. package/dist/capabilities/index.js +9 -0
  14. package/dist/capabilities/label.d.ts +33 -0
  15. package/dist/capabilities/label.d.ts.map +1 -0
  16. package/dist/capabilities/label.js +328 -0
  17. package/dist/capabilities/parcels.d.ts +33 -0
  18. package/dist/capabilities/parcels.d.ts.map +1 -0
  19. package/dist/capabilities/parcels.js +284 -0
  20. package/dist/capabilities/pickup-points.d.ts +41 -0
  21. package/dist/capabilities/pickup-points.d.ts.map +1 -0
  22. package/dist/capabilities/pickup-points.js +294 -0
  23. package/dist/capabilities/track.d.ts +72 -0
  24. package/dist/capabilities/track.d.ts.map +1 -0
  25. package/dist/capabilities/track.js +331 -0
  26. package/dist/index.d.ts +83 -0
  27. package/dist/index.d.ts.map +1 -0
  28. package/dist/index.js +142 -0
  29. package/dist/mappers/label.d.ts +67 -0
  30. package/dist/mappers/label.d.ts.map +1 -0
  31. package/dist/mappers/label.js +83 -0
  32. package/dist/mappers/shipment.d.ts +110 -0
  33. package/dist/mappers/shipment.d.ts.map +1 -0
  34. package/dist/mappers/shipment.js +258 -0
  35. package/dist/mappers/tracking.d.ts +60 -0
  36. package/dist/mappers/tracking.d.ts.map +1 -0
  37. package/dist/mappers/tracking.js +187 -0
  38. package/dist/utils/httpUtils.d.ts +36 -0
  39. package/dist/utils/httpUtils.d.ts.map +1 -0
  40. package/dist/utils/httpUtils.js +76 -0
  41. package/dist/utils/oauthFallback.d.ts +47 -0
  42. package/dist/utils/oauthFallback.d.ts.map +1 -0
  43. package/dist/utils/oauthFallback.js +250 -0
  44. package/dist/utils/resolveBaseUrl.d.ts +75 -0
  45. package/dist/utils/resolveBaseUrl.d.ts.map +1 -0
  46. package/dist/utils/resolveBaseUrl.js +65 -0
  47. package/dist/validation.d.ts +1890 -0
  48. package/dist/validation.d.ts.map +1 -0
  49. package/dist/validation.js +726 -0
  50. package/package.json +69 -0
@@ -0,0 +1,1890 @@
1
+ import { z } from 'zod';
2
+ import type { Parcel, FetchPickupPointsRequest as CoreFetchPickupPointsRequest } from '@shopickup/core';
3
+ /**
4
+ * Injects authType discriminant based on presence of oAuth2Token or apiKey.
5
+ * Allows callers to pass credentials without explicitly setting authType.
6
+ */
7
+ export declare const MPLCredentialsSchema: z.ZodPipe<z.ZodTransform<any, unknown>, z.ZodDiscriminatedUnion<[z.ZodObject<{
8
+ authType: z.ZodLiteral<"apiKey">;
9
+ apiKey: z.ZodString;
10
+ apiSecret: z.ZodString;
11
+ accountingCode: z.ZodOptional<z.ZodString>;
12
+ }, z.core.$strip>, z.ZodObject<{
13
+ authType: z.ZodLiteral<"oauth2">;
14
+ oAuth2Token: z.ZodString;
15
+ accountingCode: z.ZodOptional<z.ZodString>;
16
+ }, z.core.$strip>], "authType">>;
17
+ export type MPLCredentials = z.infer<typeof MPLCredentialsSchema>;
18
+ /**
19
+ * Schema for servicePointTypes
20
+ *
21
+ * 'PM' - Postán Maradó (Post Office)
22
+ * 'HA' - Házhozszállítás (Home Delivery)
23
+ * 'RA' - Raklapos Kézbesítés (Pallet Delivery)
24
+ * 'PP' - PostaPont (Post Point)
25
+ * 'CS' - Csomagautomata (Parcel Locker)
26
+ */
27
+ declare const ServicePointTypeSchema: z.ZodEnum<{
28
+ PM: "PM";
29
+ PP: "PP";
30
+ CS: "CS";
31
+ HA: "HA";
32
+ RA: "RA";
33
+ }>;
34
+ export type ServicePointType = z.infer<typeof ServicePointTypeSchema>;
35
+ declare const PickupServicePointTypeSchema: z.ZodEnum<{
36
+ PM: "PM";
37
+ PP: "PP";
38
+ CS: "CS";
39
+ }>;
40
+ export type PickupServicePointType = z.infer<typeof PickupServicePointTypeSchema>;
41
+ export declare const FetchPickupPointsMPLCarrierOptionsSchema: z.ZodObject<{
42
+ accountingCode: z.ZodString;
43
+ postCode: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodString>>;
44
+ city: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodString>>;
45
+ servicePointType: z.ZodOptional<z.ZodArray<z.ZodEnum<{
46
+ PM: "PM";
47
+ PP: "PP";
48
+ CS: "CS";
49
+ }>>>;
50
+ }, z.core.$strip>;
51
+ export type FetchPickupPointsMPLCarrierOptions = z.infer<typeof FetchPickupPointsMPLCarrierOptionsSchema>;
52
+ export declare const FetchPickupPointsMPLOptionsSchema: z.ZodObject<{
53
+ useTestApi: z.ZodOptional<z.ZodBoolean>;
54
+ mpl: z.ZodObject<{
55
+ accountingCode: z.ZodString;
56
+ postCode: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodString>>;
57
+ city: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodString>>;
58
+ servicePointType: z.ZodOptional<z.ZodArray<z.ZodEnum<{
59
+ PM: "PM";
60
+ PP: "PP";
61
+ CS: "CS";
62
+ }>>>;
63
+ }, z.core.$strip>;
64
+ }, z.core.$catchall<z.ZodUnknown>>;
65
+ export type FetchPickupPointsMPLOptions = z.infer<typeof FetchPickupPointsMPLOptionsSchema>;
66
+ export interface FetchPickupPointsRequestMPL extends Omit<CoreFetchPickupPointsRequest, 'options' | 'credentials'> {
67
+ credentials: MPLCredentials;
68
+ options: FetchPickupPointsMPLOptions;
69
+ }
70
+ /**
71
+ * Schema for fetchPickupPoints request
72
+ *
73
+ * Requires MPLCredentials
74
+ *
75
+ * Optional filters:
76
+ * - postCode: 4-character string
77
+ * - city: string
78
+ * - servicePointType: one of the defined ServicePointType values
79
+ */
80
+ export declare const FetchPickupPointsMPLSchema: z.ZodObject<{
81
+ credentials: z.ZodPipe<z.ZodTransform<any, unknown>, z.ZodDiscriminatedUnion<[z.ZodObject<{
82
+ authType: z.ZodLiteral<"apiKey">;
83
+ apiKey: z.ZodString;
84
+ apiSecret: z.ZodString;
85
+ accountingCode: z.ZodOptional<z.ZodString>;
86
+ }, z.core.$strip>, z.ZodObject<{
87
+ authType: z.ZodLiteral<"oauth2">;
88
+ oAuth2Token: z.ZodString;
89
+ accountingCode: z.ZodOptional<z.ZodString>;
90
+ }, z.core.$strip>], "authType">>;
91
+ options: z.ZodObject<{
92
+ useTestApi: z.ZodOptional<z.ZodBoolean>;
93
+ mpl: z.ZodObject<{
94
+ accountingCode: z.ZodString;
95
+ postCode: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodString>>;
96
+ city: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodString>>;
97
+ servicePointType: z.ZodOptional<z.ZodArray<z.ZodEnum<{
98
+ PM: "PM";
99
+ PP: "PP";
100
+ CS: "CS";
101
+ }>>>;
102
+ }, z.core.$strip>;
103
+ }, z.core.$catchall<z.ZodUnknown>>;
104
+ }, z.core.$strip>;
105
+ export type FetchPickupPointsMPLRequest = FetchPickupPointsRequestMPL;
106
+ /**
107
+ * Schema for exchangeAuthToken request
108
+ *
109
+ * Requires Basic auth credentials (apiKey + apiSecret)
110
+ * Optional: useTestApi flag to use sandbox OAuth endpoint
111
+ */
112
+ export declare const ExchangeAuthTokenRequestSchema: z.ZodObject<{
113
+ credentials: z.ZodPipe<z.ZodTransform<any, unknown>, z.ZodDiscriminatedUnion<[z.ZodObject<{
114
+ authType: z.ZodLiteral<"apiKey">;
115
+ apiKey: z.ZodString;
116
+ apiSecret: z.ZodString;
117
+ accountingCode: z.ZodOptional<z.ZodString>;
118
+ }, z.core.$strip>, z.ZodObject<{
119
+ authType: z.ZodLiteral<"oauth2">;
120
+ oAuth2Token: z.ZodString;
121
+ accountingCode: z.ZodOptional<z.ZodString>;
122
+ }, z.core.$strip>], "authType">> & z.ZodType<{
123
+ authType: "apiKey";
124
+ apiKey: string;
125
+ apiSecret: string;
126
+ accountingCode?: string | undefined;
127
+ }, unknown, z.core.$ZodTypeInternals<{
128
+ authType: "apiKey";
129
+ apiKey: string;
130
+ apiSecret: string;
131
+ accountingCode?: string | undefined;
132
+ }, unknown>>;
133
+ options: z.ZodOptional<z.ZodObject<{
134
+ useTestApi: z.ZodOptional<z.ZodBoolean>;
135
+ }, z.core.$strip>>;
136
+ }, z.core.$strip>;
137
+ export type ExchangeAuthTokenRequest = z.infer<typeof ExchangeAuthTokenRequestSchema>;
138
+ /**
139
+ * OAuth token response from MPL /oauth2/token endpoint
140
+ */
141
+ export interface MPLOAuthTokenResponse {
142
+ access_token: string;
143
+ token_type: 'Bearer';
144
+ expires_in: number;
145
+ issued_at?: number;
146
+ }
147
+ /**
148
+ * Normalized response for exchangeAuthToken capability
149
+ */
150
+ export interface ExchangeAuthTokenResponse {
151
+ access_token: string;
152
+ token_type: 'Bearer';
153
+ expires_in: number;
154
+ issued_at?: number;
155
+ raw: MPLOAuthTokenResponse;
156
+ }
157
+ /**
158
+ * Types for the MPL fetchPickupPoints response
159
+ * Returns either an array of pickup points (200 OK) or a gateway error (4xx/5xx)
160
+ */
161
+ export type MPLPickupPointResponse = MPLAPIGatewayErrorResponse | MPLPickupPointEntry[];
162
+ /**
163
+ * Single delivery place entry from the 200 response
164
+ */
165
+ export interface MPLPickupPointEntry {
166
+ deliveryplacesQueryResult: {
167
+ deliveryplace: string;
168
+ postCode: string;
169
+ city: string;
170
+ address: string;
171
+ geocodeLat: number;
172
+ geocodeLong: number;
173
+ id: string;
174
+ errors: MPLPickupPointEntryError[] | null;
175
+ };
176
+ servicePointType: PickupServicePointType[];
177
+ }
178
+ /**
179
+ * Error details within a pickup point entry
180
+ */
181
+ export interface MPLPickupPointEntryError {
182
+ code: string;
183
+ parameter: string;
184
+ text: string;
185
+ text_eng: string;
186
+ }
187
+ /**
188
+ * Gateway error response structure
189
+ *
190
+ * Returned for HTTP error statuses:
191
+ * - 400 Bad request. - Invalid request format or parameters.
192
+ * - 401 Unauthorized. - The provided access token is not valid.
193
+ * - 403 Forbidden. - The caller client is not configured to call the APIs published on the requested host:port.
194
+ * - 404 Not found. - The given path is not mapped to any valid path in the API Proxy.
195
+ * - 429 Too many requests. - Spike Arrest Fault or Quota Limit Fault. Check X-Quota-Reset, X-Quota-Allowed, X-Quota-Available response headers.
196
+ * - 500 Internal server error. - An unexpected error occurred in the backend system.
197
+ * - 503 Service unavailable. - The backend service is unavailable for some reason.
198
+ *
199
+ * Check the value of the X-Error-Source response header:
200
+ * - If "Backend", the error was generated in the backend system.
201
+ * - If "Gateway", the error was generated in the API Gateway.
202
+ */
203
+ export interface MPLAPIGatewayErrorResponse {
204
+ fault: {
205
+ faultstring: string;
206
+ detail: {
207
+ errorcode: string;
208
+ };
209
+ };
210
+ }
211
+ /**
212
+ * Helper functions to validate MPL adapter requests
213
+ */
214
+ /**
215
+ * Helper: validate credentials in one pass and get authType
216
+ */
217
+ export declare function safeValidateCredentials(input: unknown): z.ZodSafeParseResult<{
218
+ authType: "apiKey";
219
+ apiKey: string;
220
+ apiSecret: string;
221
+ accountingCode?: string | undefined;
222
+ } | {
223
+ authType: "oauth2";
224
+ oAuth2Token: string;
225
+ accountingCode?: string | undefined;
226
+ }>;
227
+ /**
228
+ * Helper: validate full fetchPickupPoints request
229
+ */
230
+ export declare function safeValidateFetchPickupPointsRequest(input: unknown): z.ZodSafeParseResult<{
231
+ credentials: {
232
+ authType: "apiKey";
233
+ apiKey: string;
234
+ apiSecret: string;
235
+ accountingCode?: string | undefined;
236
+ } | {
237
+ authType: "oauth2";
238
+ oAuth2Token: string;
239
+ accountingCode?: string | undefined;
240
+ };
241
+ options: {
242
+ [x: string]: unknown;
243
+ mpl: {
244
+ accountingCode: string;
245
+ postCode?: string | undefined;
246
+ city?: string | undefined;
247
+ servicePointType?: ("PM" | "PP" | "CS")[] | undefined;
248
+ };
249
+ useTestApi?: boolean | undefined;
250
+ };
251
+ }>;
252
+ /**
253
+ * Helper: validate exchangeAuthToken request
254
+ */
255
+ export declare function safeValidateExchangeAuthTokenRequest(input: unknown): z.ZodSafeParseResult<{
256
+ credentials: {
257
+ authType: "apiKey";
258
+ apiKey: string;
259
+ apiSecret: string;
260
+ accountingCode?: string | undefined;
261
+ };
262
+ options?: {
263
+ useTestApi?: boolean | undefined;
264
+ } | undefined;
265
+ }>;
266
+ /**
267
+ * Type guard: check if response is a gateway error
268
+ */
269
+ export declare function isGatewayError(response: unknown): response is MPLAPIGatewayErrorResponse;
270
+ /**
271
+ * Type guard: check if response is a successful 200 response
272
+ *
273
+ * Strict validation: response MUST be an array of MPL pickup point entries.
274
+ * Follows Foxpost pattern for consistency across adapters.
275
+ */
276
+ export declare function isSuccessResponse(response: unknown): response is MPLPickupPointEntry[];
277
+ /**
278
+ * Basic service codes from OpenAPI
279
+ * Represents available postal services
280
+ */
281
+ export declare const BasicServiceCodeSchema: z.ZodEnum<{
282
+ A_175_UZL: "A_175_UZL";
283
+ A_177_MPC: "A_177_MPC";
284
+ A_176_NET: "A_176_NET";
285
+ A_176_NKP: "A_176_NKP";
286
+ A_122_ECS: "A_122_ECS";
287
+ A_121_CSG: "A_121_CSG";
288
+ A_13_EMS: "A_13_EMS";
289
+ A_123_EUP: "A_123_EUP";
290
+ A_123_HAR: "A_123_HAR";
291
+ A_123_HAI: "A_123_HAI";
292
+ A_125_HAR: "A_125_HAR";
293
+ A_125_HAI: "A_125_HAI";
294
+ }>;
295
+ export type BasicServiceCode = z.infer<typeof BasicServiceCodeSchema>;
296
+ /**
297
+ * Delivery modes from OpenAPI
298
+ * HA - Házhozszállítás (Home Delivery)
299
+ * RA - Raklapos Kézbesítés (Pallet Delivery)
300
+ * PP - PostaPont (Post Point)
301
+ * CS - Csomagautomata (Parcel Locker)
302
+ * PM - Postán Maradó (Post Office)
303
+ */
304
+ export declare const DeliveryModeSchema: z.ZodEnum<{
305
+ PM: "PM";
306
+ PP: "PP";
307
+ CS: "CS";
308
+ HA: "HA";
309
+ RA: "RA";
310
+ }>;
311
+ export type DeliveryMode = z.infer<typeof DeliveryModeSchema>;
312
+ /**
313
+ * Label type/format for address labels
314
+ */
315
+ export declare const LabelTypeSchema: z.ZodEnum<{
316
+ A4: "A4";
317
+ A5: "A5";
318
+ A5inA4: "A5inA4";
319
+ A5E: "A5E";
320
+ A5E_EXTRA: "A5E_EXTRA";
321
+ A5E_STAND: "A5E_STAND";
322
+ A6: "A6";
323
+ A6inA4: "A6inA4";
324
+ A4ONE: "A4ONE";
325
+ }>;
326
+ export type LabelType = z.infer<typeof LabelTypeSchema>;
327
+ /**
328
+ * Label file format
329
+ */
330
+ export declare const LabelFormatSchema: z.ZodEnum<{
331
+ PDF: "PDF";
332
+ ZPL: "ZPL";
333
+ }>;
334
+ export type LabelFormat = z.infer<typeof LabelFormatSchema>;
335
+ /**
336
+ * Package size enum
337
+ */
338
+ export declare const PackageSizeSchema: z.ZodEnum<{
339
+ S: "S";
340
+ M: "M";
341
+ L: "L";
342
+ PRINT: "PRINT";
343
+ PACK: "PACK";
344
+ }>;
345
+ export type PackageSize = z.infer<typeof PackageSizeSchema>;
346
+ /**
347
+ * Extra services codes (subset relevant for CREATE_SHIPMENT)
348
+ * These are additional paid services that can be added to shipments
349
+ */
350
+ export declare const ExtraServiceCodeSchema: z.ZodEnum<{
351
+ K_ENY: "K_ENY";
352
+ K_TER: "K_TER";
353
+ K_UVT: "K_UVT";
354
+ K_TOR: "K_TOR";
355
+ K_ORZ: "K_ORZ";
356
+ K_IDO: "K_IDO";
357
+ K_RLC: "K_RLC";
358
+ K_TEV: "K_TEV";
359
+ K_CSE: "K_CSE";
360
+ K_CSA: "K_CSA";
361
+ K_IDA: "K_IDA";
362
+ K_FNK: "K_FNK";
363
+ }>;
364
+ export type ExtraServiceCode = z.infer<typeof ExtraServiceCodeSchema>;
365
+ /**
366
+ * Delivery time preference (for time window delivery)
367
+ */
368
+ export declare const DeliveryTimeSchema: z.ZodEnum<{
369
+ earlyMorning: "earlyMorning";
370
+ morning: "morning";
371
+ afternoon: "afternoon";
372
+ evening: "evening";
373
+ }>;
374
+ export type DeliveryTime = z.infer<typeof DeliveryTimeSchema>;
375
+ /**
376
+ * UnitValue - weight/size with unit
377
+ */
378
+ export declare const UnitValueSchema: z.ZodObject<{
379
+ value: z.ZodNumber;
380
+ unit: z.ZodOptional<z.ZodEnum<{
381
+ kg: "kg";
382
+ g: "g";
383
+ }>>;
384
+ }, z.core.$strip>;
385
+ export type UnitValue = z.infer<typeof UnitValueSchema>;
386
+ /**
387
+ * Contact information (name, organization, phone, email)
388
+ */
389
+ export declare const ContactSchema: z.ZodObject<{
390
+ name: z.ZodString;
391
+ organization: z.ZodOptional<z.ZodString>;
392
+ phone: z.ZodOptional<z.ZodString>;
393
+ email: z.ZodOptional<z.ZodString>;
394
+ }, z.core.$strip>;
395
+ export type Contact = z.infer<typeof ContactSchema>;
396
+ /**
397
+ * Address information
398
+ */
399
+ export declare const AddressSchema: z.ZodObject<{
400
+ postCode: z.ZodString;
401
+ city: z.ZodString;
402
+ address: z.ZodString;
403
+ }, z.core.$strip>;
404
+ export type Address = z.infer<typeof AddressSchema>;
405
+ /**
406
+ * Delivery address (same as regular address but includes optional parcelPickupSite)
407
+ */
408
+ export declare const DeliveryAddressSchema: z.ZodObject<{
409
+ postCode: z.ZodString;
410
+ city: z.ZodString;
411
+ address: z.ZodString;
412
+ parcelPickupSite: z.ZodOptional<z.ZodString>;
413
+ countryCode: z.ZodOptional<z.ZodString>;
414
+ }, z.core.$strip>;
415
+ export type DeliveryAddress = z.infer<typeof DeliveryAddressSchema>;
416
+ /**
417
+ * Recipient information
418
+ */
419
+ export declare const RecipientSchema: z.ZodObject<{
420
+ contact: z.ZodObject<{
421
+ name: z.ZodString;
422
+ organization: z.ZodOptional<z.ZodString>;
423
+ phone: z.ZodOptional<z.ZodString>;
424
+ email: z.ZodOptional<z.ZodString>;
425
+ }, z.core.$strip>;
426
+ address: z.ZodObject<{
427
+ postCode: z.ZodString;
428
+ city: z.ZodString;
429
+ address: z.ZodString;
430
+ parcelPickupSite: z.ZodOptional<z.ZodString>;
431
+ countryCode: z.ZodOptional<z.ZodString>;
432
+ }, z.core.$strip>;
433
+ luaCode: z.ZodOptional<z.ZodString>;
434
+ disabled: z.ZodOptional<z.ZodBoolean>;
435
+ }, z.core.$strip>;
436
+ export type Recipient = z.infer<typeof RecipientSchema>;
437
+ /**
438
+ * Sender information
439
+ */
440
+ export declare const SenderSchema: z.ZodObject<{
441
+ agreement: z.ZodString;
442
+ accountNo: z.ZodOptional<z.ZodString>;
443
+ contact: z.ZodObject<{
444
+ name: z.ZodString;
445
+ organization: z.ZodOptional<z.ZodString>;
446
+ phone: z.ZodOptional<z.ZodString>;
447
+ email: z.ZodOptional<z.ZodString>;
448
+ }, z.core.$strip>;
449
+ address: z.ZodObject<{
450
+ postCode: z.ZodString;
451
+ city: z.ZodString;
452
+ address: z.ZodString;
453
+ }, z.core.$strip>;
454
+ parcelTerminal: z.ZodOptional<z.ZodBoolean>;
455
+ }, z.core.$strip>;
456
+ export type Sender = z.infer<typeof SenderSchema>;
457
+ /**
458
+ * Service configuration for a shipment item
459
+ */
460
+ export declare const ServiceSchema: z.ZodObject<{
461
+ basic: z.ZodEnum<{
462
+ A_175_UZL: "A_175_UZL";
463
+ A_177_MPC: "A_177_MPC";
464
+ A_176_NET: "A_176_NET";
465
+ A_176_NKP: "A_176_NKP";
466
+ A_122_ECS: "A_122_ECS";
467
+ A_121_CSG: "A_121_CSG";
468
+ A_13_EMS: "A_13_EMS";
469
+ A_123_EUP: "A_123_EUP";
470
+ A_123_HAR: "A_123_HAR";
471
+ A_123_HAI: "A_123_HAI";
472
+ A_125_HAR: "A_125_HAR";
473
+ A_125_HAI: "A_125_HAI";
474
+ }>;
475
+ deliveryMode: z.ZodEnum<{
476
+ PM: "PM";
477
+ PP: "PP";
478
+ CS: "CS";
479
+ HA: "HA";
480
+ RA: "RA";
481
+ }>;
482
+ extra: z.ZodOptional<z.ZodArray<z.ZodEnum<{
483
+ K_ENY: "K_ENY";
484
+ K_TER: "K_TER";
485
+ K_UVT: "K_UVT";
486
+ K_TOR: "K_TOR";
487
+ K_ORZ: "K_ORZ";
488
+ K_IDO: "K_IDO";
489
+ K_RLC: "K_RLC";
490
+ K_TEV: "K_TEV";
491
+ K_CSE: "K_CSE";
492
+ K_CSA: "K_CSA";
493
+ K_IDA: "K_IDA";
494
+ K_FNK: "K_FNK";
495
+ }>>>;
496
+ cod: z.ZodOptional<z.ZodNumber>;
497
+ value: z.ZodOptional<z.ZodNumber>;
498
+ codCurrency: z.ZodOptional<z.ZodString>;
499
+ customsValue: z.ZodOptional<z.ZodNumber>;
500
+ }, z.core.$strip>;
501
+ export type Service = z.infer<typeof ServiceSchema>;
502
+ /**
503
+ * Item/Parcel information
504
+ */
505
+ export declare const ItemSchema: z.ZodObject<{
506
+ customData1: z.ZodOptional<z.ZodString>;
507
+ customData2: z.ZodOptional<z.ZodString>;
508
+ weight: z.ZodOptional<z.ZodObject<{
509
+ value: z.ZodNumber;
510
+ unit: z.ZodOptional<z.ZodEnum<{
511
+ kg: "kg";
512
+ g: "g";
513
+ }>>;
514
+ }, z.core.$strip>>;
515
+ size: z.ZodOptional<z.ZodEnum<{
516
+ S: "S";
517
+ M: "M";
518
+ L: "L";
519
+ PRINT: "PRINT";
520
+ PACK: "PACK";
521
+ }>>;
522
+ services: z.ZodObject<{
523
+ basic: z.ZodEnum<{
524
+ A_175_UZL: "A_175_UZL";
525
+ A_177_MPC: "A_177_MPC";
526
+ A_176_NET: "A_176_NET";
527
+ A_176_NKP: "A_176_NKP";
528
+ A_122_ECS: "A_122_ECS";
529
+ A_121_CSG: "A_121_CSG";
530
+ A_13_EMS: "A_13_EMS";
531
+ A_123_EUP: "A_123_EUP";
532
+ A_123_HAR: "A_123_HAR";
533
+ A_123_HAI: "A_123_HAI";
534
+ A_125_HAR: "A_125_HAR";
535
+ A_125_HAI: "A_125_HAI";
536
+ }>;
537
+ deliveryMode: z.ZodEnum<{
538
+ PM: "PM";
539
+ PP: "PP";
540
+ CS: "CS";
541
+ HA: "HA";
542
+ RA: "RA";
543
+ }>;
544
+ extra: z.ZodOptional<z.ZodArray<z.ZodEnum<{
545
+ K_ENY: "K_ENY";
546
+ K_TER: "K_TER";
547
+ K_UVT: "K_UVT";
548
+ K_TOR: "K_TOR";
549
+ K_ORZ: "K_ORZ";
550
+ K_IDO: "K_IDO";
551
+ K_RLC: "K_RLC";
552
+ K_TEV: "K_TEV";
553
+ K_CSE: "K_CSE";
554
+ K_CSA: "K_CSA";
555
+ K_IDA: "K_IDA";
556
+ K_FNK: "K_FNK";
557
+ }>>>;
558
+ cod: z.ZodOptional<z.ZodNumber>;
559
+ value: z.ZodOptional<z.ZodNumber>;
560
+ codCurrency: z.ZodOptional<z.ZodString>;
561
+ customsValue: z.ZodOptional<z.ZodNumber>;
562
+ }, z.core.$strip>;
563
+ senderParcelPickupSite: z.ZodOptional<z.ZodString>;
564
+ }, z.core.$strip>;
565
+ export type Item = z.infer<typeof ItemSchema>;
566
+ /**
567
+ * Invoice information (optional, for billing)
568
+ */
569
+ export declare const InvoiceSchema: z.ZodObject<{
570
+ name: z.ZodString;
571
+ postCode: z.ZodString;
572
+ city: z.ZodString;
573
+ address: z.ZodString;
574
+ vatIdentificationNumber: z.ZodString;
575
+ }, z.core.$strip>;
576
+ export type Invoice = z.infer<typeof InvoiceSchema>;
577
+ /**
578
+ * Shipment creation request (maps to OpenAPI ShipmentCreateRequest)
579
+ * This is ONE shipment that can contain multiple items (parcels)
580
+ */
581
+ export declare const ShipmentCreateRequestSchema: z.ZodObject<{
582
+ developer: z.ZodString;
583
+ sender: z.ZodObject<{
584
+ agreement: z.ZodString;
585
+ accountNo: z.ZodOptional<z.ZodString>;
586
+ contact: z.ZodObject<{
587
+ name: z.ZodString;
588
+ organization: z.ZodOptional<z.ZodString>;
589
+ phone: z.ZodOptional<z.ZodString>;
590
+ email: z.ZodOptional<z.ZodString>;
591
+ }, z.core.$strip>;
592
+ address: z.ZodObject<{
593
+ postCode: z.ZodString;
594
+ city: z.ZodString;
595
+ address: z.ZodString;
596
+ }, z.core.$strip>;
597
+ parcelTerminal: z.ZodOptional<z.ZodBoolean>;
598
+ }, z.core.$strip>;
599
+ recipient: z.ZodObject<{
600
+ contact: z.ZodObject<{
601
+ name: z.ZodString;
602
+ organization: z.ZodOptional<z.ZodString>;
603
+ phone: z.ZodOptional<z.ZodString>;
604
+ email: z.ZodOptional<z.ZodString>;
605
+ }, z.core.$strip>;
606
+ address: z.ZodObject<{
607
+ postCode: z.ZodString;
608
+ city: z.ZodString;
609
+ address: z.ZodString;
610
+ parcelPickupSite: z.ZodOptional<z.ZodString>;
611
+ countryCode: z.ZodOptional<z.ZodString>;
612
+ }, z.core.$strip>;
613
+ luaCode: z.ZodOptional<z.ZodString>;
614
+ disabled: z.ZodOptional<z.ZodBoolean>;
615
+ }, z.core.$strip>;
616
+ webshopId: z.ZodString;
617
+ orderId: z.ZodOptional<z.ZodString>;
618
+ shipmentDate: z.ZodOptional<z.ZodString>;
619
+ labelType: z.ZodOptional<z.ZodEnum<{
620
+ A4: "A4";
621
+ A5: "A5";
622
+ A5inA4: "A5inA4";
623
+ A5E: "A5E";
624
+ A5E_EXTRA: "A5E_EXTRA";
625
+ A5E_STAND: "A5E_STAND";
626
+ A6: "A6";
627
+ A6inA4: "A6inA4";
628
+ A4ONE: "A4ONE";
629
+ }>>;
630
+ labelFormat: z.ZodOptional<z.ZodEnum<{
631
+ PDF: "PDF";
632
+ ZPL: "ZPL";
633
+ }>>;
634
+ tag: z.ZodOptional<z.ZodString>;
635
+ groupTogether: z.ZodOptional<z.ZodBoolean>;
636
+ deliveryTime: z.ZodOptional<z.ZodEnum<{
637
+ earlyMorning: "earlyMorning";
638
+ morning: "morning";
639
+ afternoon: "afternoon";
640
+ evening: "evening";
641
+ }>>;
642
+ deliveryDate: z.ZodOptional<z.ZodString>;
643
+ item: z.ZodOptional<z.ZodArray<z.ZodObject<{
644
+ customData1: z.ZodOptional<z.ZodString>;
645
+ customData2: z.ZodOptional<z.ZodString>;
646
+ weight: z.ZodOptional<z.ZodObject<{
647
+ value: z.ZodNumber;
648
+ unit: z.ZodOptional<z.ZodEnum<{
649
+ kg: "kg";
650
+ g: "g";
651
+ }>>;
652
+ }, z.core.$strip>>;
653
+ size: z.ZodOptional<z.ZodEnum<{
654
+ S: "S";
655
+ M: "M";
656
+ L: "L";
657
+ PRINT: "PRINT";
658
+ PACK: "PACK";
659
+ }>>;
660
+ services: z.ZodObject<{
661
+ basic: z.ZodEnum<{
662
+ A_175_UZL: "A_175_UZL";
663
+ A_177_MPC: "A_177_MPC";
664
+ A_176_NET: "A_176_NET";
665
+ A_176_NKP: "A_176_NKP";
666
+ A_122_ECS: "A_122_ECS";
667
+ A_121_CSG: "A_121_CSG";
668
+ A_13_EMS: "A_13_EMS";
669
+ A_123_EUP: "A_123_EUP";
670
+ A_123_HAR: "A_123_HAR";
671
+ A_123_HAI: "A_123_HAI";
672
+ A_125_HAR: "A_125_HAR";
673
+ A_125_HAI: "A_125_HAI";
674
+ }>;
675
+ deliveryMode: z.ZodEnum<{
676
+ PM: "PM";
677
+ PP: "PP";
678
+ CS: "CS";
679
+ HA: "HA";
680
+ RA: "RA";
681
+ }>;
682
+ extra: z.ZodOptional<z.ZodArray<z.ZodEnum<{
683
+ K_ENY: "K_ENY";
684
+ K_TER: "K_TER";
685
+ K_UVT: "K_UVT";
686
+ K_TOR: "K_TOR";
687
+ K_ORZ: "K_ORZ";
688
+ K_IDO: "K_IDO";
689
+ K_RLC: "K_RLC";
690
+ K_TEV: "K_TEV";
691
+ K_CSE: "K_CSE";
692
+ K_CSA: "K_CSA";
693
+ K_IDA: "K_IDA";
694
+ K_FNK: "K_FNK";
695
+ }>>>;
696
+ cod: z.ZodOptional<z.ZodNumber>;
697
+ value: z.ZodOptional<z.ZodNumber>;
698
+ codCurrency: z.ZodOptional<z.ZodString>;
699
+ customsValue: z.ZodOptional<z.ZodNumber>;
700
+ }, z.core.$strip>;
701
+ senderParcelPickupSite: z.ZodOptional<z.ZodString>;
702
+ }, z.core.$strip>>>;
703
+ paymentMode: z.ZodOptional<z.ZodEnum<{
704
+ UV_AT: "UV_AT";
705
+ UV_KP: "UV_KP";
706
+ }>>;
707
+ packageRetention: z.ZodOptional<z.ZodNumber>;
708
+ printRecipientData: z.ZodOptional<z.ZodEnum<{
709
+ PRINTALL: "PRINTALL";
710
+ PRINTPHONENUMBER: "PRINTPHONENUMBER";
711
+ PRINTEMAIL: "PRINTEMAIL";
712
+ PRINTNOTHING: "PRINTNOTHING";
713
+ }>>;
714
+ }, z.core.$strip>;
715
+ export type ShipmentCreateRequest = z.infer<typeof ShipmentCreateRequestSchema>;
716
+ /**
717
+ * Replacement label information in response
718
+ */
719
+ export declare const ReplacementLabelSchema: z.ZodObject<{
720
+ trackingNumber: z.ZodOptional<z.ZodString>;
721
+ label: z.ZodOptional<z.ZodString>;
722
+ }, z.core.$strip>;
723
+ export type ReplacementLabel = z.infer<typeof ReplacementLabelSchema>;
724
+ /**
725
+ * Error descriptor from MPL API
726
+ */
727
+ export declare const ErrorDescriptorSchema: z.ZodObject<{
728
+ code: z.ZodOptional<z.ZodString>;
729
+ parameter: z.ZodOptional<z.ZodString>;
730
+ text: z.ZodOptional<z.ZodString>;
731
+ text_eng: z.ZodOptional<z.ZodString>;
732
+ }, z.core.$strip>;
733
+ export type ErrorDescriptor = z.infer<typeof ErrorDescriptorSchema>;
734
+ /**
735
+ * Warning descriptor from MPL API
736
+ */
737
+ export declare const WarningDescriptorSchema: z.ZodObject<{
738
+ code: z.ZodOptional<z.ZodString>;
739
+ parameter: z.ZodOptional<z.ZodString>;
740
+ text: z.ZodOptional<z.ZodString>;
741
+ text_eng: z.ZodOptional<z.ZodString>;
742
+ }, z.core.$strip>;
743
+ export type WarningDescriptor = z.infer<typeof WarningDescriptorSchema>;
744
+ /**
745
+ * Shipment creation result (maps to OpenAPI ShipmentCreateResult)
746
+ * Response for ONE shipment
747
+ */
748
+ export declare const ShipmentCreateResultSchema: z.ZodObject<{
749
+ webshopId: z.ZodOptional<z.ZodString>;
750
+ trackingNumber: z.ZodOptional<z.ZodString>;
751
+ replacementTrackingNumber: z.ZodOptional<z.ZodString>;
752
+ replacementLabels: z.ZodOptional<z.ZodArray<z.ZodObject<{
753
+ trackingNumber: z.ZodOptional<z.ZodString>;
754
+ label: z.ZodOptional<z.ZodString>;
755
+ }, z.core.$strip>>>;
756
+ packageTrackingNumbers: z.ZodOptional<z.ZodArray<z.ZodString>>;
757
+ dispatchId: z.ZodOptional<z.ZodNumber>;
758
+ suggestedRecipientPostCode: z.ZodOptional<z.ZodString>;
759
+ suggestedRecipientCity: z.ZodOptional<z.ZodString>;
760
+ suggestedRecipientAddress: z.ZodOptional<z.ZodString>;
761
+ label: z.ZodOptional<z.ZodString>;
762
+ errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
763
+ code: z.ZodOptional<z.ZodString>;
764
+ parameter: z.ZodOptional<z.ZodString>;
765
+ text: z.ZodOptional<z.ZodString>;
766
+ text_eng: z.ZodOptional<z.ZodString>;
767
+ }, z.core.$strip>>>;
768
+ warnings: z.ZodOptional<z.ZodArray<z.ZodObject<{
769
+ code: z.ZodOptional<z.ZodString>;
770
+ parameter: z.ZodOptional<z.ZodString>;
771
+ text: z.ZodOptional<z.ZodString>;
772
+ text_eng: z.ZodOptional<z.ZodString>;
773
+ }, z.core.$strip>>>;
774
+ }, z.core.$strip>;
775
+ export type ShipmentCreateResult = z.infer<typeof ShipmentCreateResultSchema>;
776
+ /**
777
+ * Helper: validate shipment creation request
778
+ */
779
+ export declare function safeValidateShipmentCreateRequest(input: unknown): z.ZodSafeParseResult<{
780
+ developer: string;
781
+ sender: {
782
+ agreement: string;
783
+ contact: {
784
+ name: string;
785
+ organization?: string | undefined;
786
+ phone?: string | undefined;
787
+ email?: string | undefined;
788
+ };
789
+ address: {
790
+ postCode: string;
791
+ city: string;
792
+ address: string;
793
+ };
794
+ accountNo?: string | undefined;
795
+ parcelTerminal?: boolean | undefined;
796
+ };
797
+ recipient: {
798
+ contact: {
799
+ name: string;
800
+ organization?: string | undefined;
801
+ phone?: string | undefined;
802
+ email?: string | undefined;
803
+ };
804
+ address: {
805
+ postCode: string;
806
+ city: string;
807
+ address: string;
808
+ parcelPickupSite?: string | undefined;
809
+ countryCode?: string | undefined;
810
+ };
811
+ luaCode?: string | undefined;
812
+ disabled?: boolean | undefined;
813
+ };
814
+ webshopId: string;
815
+ orderId?: string | undefined;
816
+ shipmentDate?: string | undefined;
817
+ labelType?: "A4" | "A5" | "A5inA4" | "A5E" | "A5E_EXTRA" | "A5E_STAND" | "A6" | "A6inA4" | "A4ONE" | undefined;
818
+ labelFormat?: "PDF" | "ZPL" | undefined;
819
+ tag?: string | undefined;
820
+ groupTogether?: boolean | undefined;
821
+ deliveryTime?: "earlyMorning" | "morning" | "afternoon" | "evening" | undefined;
822
+ deliveryDate?: string | undefined;
823
+ item?: {
824
+ services: {
825
+ basic: "A_175_UZL" | "A_177_MPC" | "A_176_NET" | "A_176_NKP" | "A_122_ECS" | "A_121_CSG" | "A_13_EMS" | "A_123_EUP" | "A_123_HAR" | "A_123_HAI" | "A_125_HAR" | "A_125_HAI";
826
+ deliveryMode: "PM" | "PP" | "CS" | "HA" | "RA";
827
+ extra?: ("K_ENY" | "K_TER" | "K_UVT" | "K_TOR" | "K_ORZ" | "K_IDO" | "K_RLC" | "K_TEV" | "K_CSE" | "K_CSA" | "K_IDA" | "K_FNK")[] | undefined;
828
+ cod?: number | undefined;
829
+ value?: number | undefined;
830
+ codCurrency?: string | undefined;
831
+ customsValue?: number | undefined;
832
+ };
833
+ customData1?: string | undefined;
834
+ customData2?: string | undefined;
835
+ weight?: {
836
+ value: number;
837
+ unit?: "kg" | "g" | undefined;
838
+ } | undefined;
839
+ size?: "S" | "M" | "L" | "PRINT" | "PACK" | undefined;
840
+ senderParcelPickupSite?: string | undefined;
841
+ }[] | undefined;
842
+ paymentMode?: "UV_AT" | "UV_KP" | undefined;
843
+ packageRetention?: number | undefined;
844
+ printRecipientData?: "PRINTALL" | "PRINTPHONENUMBER" | "PRINTEMAIL" | "PRINTNOTHING" | undefined;
845
+ }>;
846
+ /**
847
+ * Helper: validate shipment creation result
848
+ */
849
+ export declare function safeValidateShipmentCreateResult(input: unknown): z.ZodSafeParseResult<{
850
+ webshopId?: string | undefined;
851
+ trackingNumber?: string | undefined;
852
+ replacementTrackingNumber?: string | undefined;
853
+ replacementLabels?: {
854
+ trackingNumber?: string | undefined;
855
+ label?: string | undefined;
856
+ }[] | undefined;
857
+ packageTrackingNumbers?: string[] | undefined;
858
+ dispatchId?: number | undefined;
859
+ suggestedRecipientPostCode?: string | undefined;
860
+ suggestedRecipientCity?: string | undefined;
861
+ suggestedRecipientAddress?: string | undefined;
862
+ label?: string | undefined;
863
+ errors?: {
864
+ code?: string | undefined;
865
+ parameter?: string | undefined;
866
+ text?: string | undefined;
867
+ text_eng?: string | undefined;
868
+ }[] | undefined;
869
+ warnings?: {
870
+ code?: string | undefined;
871
+ parameter?: string | undefined;
872
+ text?: string | undefined;
873
+ text_eng?: string | undefined;
874
+ }[] | undefined;
875
+ }>;
876
+ /**
877
+ * MPL-specific request options for CREATE_PARCELS.
878
+ *
879
+ * Cross-cutting fields stay at options root (e.g. useTestApi),
880
+ * while carrier-specific fields are namespaced under `options.mpl`.
881
+ * `accountingCode` is required for MPL.
882
+ */
883
+ export declare const CreateParcelsMPLCarrierOptionsSchema: z.ZodObject<{
884
+ accountingCode: z.ZodString;
885
+ agreementCode: z.ZodString;
886
+ bankAccountNumber: z.ZodString;
887
+ labelType: z.ZodOptional<z.ZodEnum<{
888
+ A4: "A4";
889
+ A5: "A5";
890
+ A5inA4: "A5inA4";
891
+ A5E: "A5E";
892
+ A5E_EXTRA: "A5E_EXTRA";
893
+ A5E_STAND: "A5E_STAND";
894
+ A6: "A6";
895
+ A6inA4: "A6inA4";
896
+ A4ONE: "A4ONE";
897
+ }>>;
898
+ }, z.core.$strip>;
899
+ export type CreateParcelsMPLCarrierOptions = z.infer<typeof CreateParcelsMPLCarrierOptionsSchema>;
900
+ export declare const CreateParcelsMPLOptionsSchema: z.ZodObject<{
901
+ useTestApi: z.ZodOptional<z.ZodBoolean>;
902
+ mpl: z.ZodObject<{
903
+ accountingCode: z.ZodString;
904
+ agreementCode: z.ZodString;
905
+ bankAccountNumber: z.ZodString;
906
+ labelType: z.ZodOptional<z.ZodEnum<{
907
+ A4: "A4";
908
+ A5: "A5";
909
+ A5inA4: "A5inA4";
910
+ A5E: "A5E";
911
+ A5E_EXTRA: "A5E_EXTRA";
912
+ A5E_STAND: "A5E_STAND";
913
+ A6: "A6";
914
+ A6inA4: "A6inA4";
915
+ A4ONE: "A4ONE";
916
+ }>>;
917
+ }, z.core.$strip>;
918
+ }, z.core.$catchall<z.ZodUnknown>>;
919
+ export type CreateParcelsMPLOptions = z.infer<typeof CreateParcelsMPLOptionsSchema>;
920
+ /**
921
+ * Full CREATE_PARCELS request validator for MPL.
922
+ *
923
+ * This validates request envelope + credentials first, then capability-specific
924
+ * shipment payload validation continues in the mapper/Shipment schemas.
925
+ */
926
+ export declare const CreateParcelsMPLRequestSchema: z.ZodObject<{
927
+ parcels: z.ZodArray<z.ZodCustom<Parcel, Parcel>>;
928
+ credentials: z.ZodPipe<z.ZodTransform<any, unknown>, z.ZodDiscriminatedUnion<[z.ZodObject<{
929
+ authType: z.ZodLiteral<"apiKey">;
930
+ apiKey: z.ZodString;
931
+ apiSecret: z.ZodString;
932
+ accountingCode: z.ZodOptional<z.ZodString>;
933
+ }, z.core.$strip>, z.ZodObject<{
934
+ authType: z.ZodLiteral<"oauth2">;
935
+ oAuth2Token: z.ZodString;
936
+ accountingCode: z.ZodOptional<z.ZodString>;
937
+ }, z.core.$strip>], "authType">>;
938
+ options: z.ZodObject<{
939
+ useTestApi: z.ZodOptional<z.ZodBoolean>;
940
+ mpl: z.ZodObject<{
941
+ accountingCode: z.ZodString;
942
+ agreementCode: z.ZodString;
943
+ bankAccountNumber: z.ZodString;
944
+ labelType: z.ZodOptional<z.ZodEnum<{
945
+ A4: "A4";
946
+ A5: "A5";
947
+ A5inA4: "A5inA4";
948
+ A5E: "A5E";
949
+ A5E_EXTRA: "A5E_EXTRA";
950
+ A5E_STAND: "A5E_STAND";
951
+ A6: "A6";
952
+ A6inA4: "A6inA4";
953
+ A4ONE: "A4ONE";
954
+ }>>;
955
+ }, z.core.$strip>;
956
+ }, z.core.$catchall<z.ZodUnknown>>;
957
+ }, z.core.$strip>;
958
+ export type CreateParcelsMPLRequest = z.infer<typeof CreateParcelsMPLRequestSchema>;
959
+ /**
960
+ * Helper: validate full createParcels request
961
+ */
962
+ export declare function safeValidateCreateParcelsRequest(input: unknown): z.ZodSafeParseResult<{
963
+ parcels: Parcel[];
964
+ credentials: {
965
+ authType: "apiKey";
966
+ apiKey: string;
967
+ apiSecret: string;
968
+ accountingCode?: string | undefined;
969
+ } | {
970
+ authType: "oauth2";
971
+ oAuth2Token: string;
972
+ accountingCode?: string | undefined;
973
+ };
974
+ options: {
975
+ [x: string]: unknown;
976
+ mpl: {
977
+ accountingCode: string;
978
+ agreementCode: string;
979
+ bankAccountNumber: string;
980
+ labelType?: "A4" | "A5" | "A5inA4" | "A5E" | "A5E_EXTRA" | "A5E_STAND" | "A6" | "A6inA4" | "A4ONE" | undefined;
981
+ };
982
+ useTestApi?: boolean | undefined;
983
+ };
984
+ }>;
985
+ /**
986
+ * Full CREATE_PARCEL request validator for MPL.
987
+ *
988
+ * Mirrors CREATE_PARCELS requirements for a single parcel envelope.
989
+ */
990
+ export declare const CreateParcelMPLRequestSchema: z.ZodObject<{
991
+ parcel: z.ZodCustom<Parcel, Parcel>;
992
+ credentials: z.ZodPipe<z.ZodTransform<any, unknown>, z.ZodDiscriminatedUnion<[z.ZodObject<{
993
+ authType: z.ZodLiteral<"apiKey">;
994
+ apiKey: z.ZodString;
995
+ apiSecret: z.ZodString;
996
+ accountingCode: z.ZodOptional<z.ZodString>;
997
+ }, z.core.$strip>, z.ZodObject<{
998
+ authType: z.ZodLiteral<"oauth2">;
999
+ oAuth2Token: z.ZodString;
1000
+ accountingCode: z.ZodOptional<z.ZodString>;
1001
+ }, z.core.$strip>], "authType">>;
1002
+ options: z.ZodObject<{
1003
+ useTestApi: z.ZodOptional<z.ZodBoolean>;
1004
+ mpl: z.ZodObject<{
1005
+ accountingCode: z.ZodString;
1006
+ agreementCode: z.ZodString;
1007
+ bankAccountNumber: z.ZodString;
1008
+ labelType: z.ZodOptional<z.ZodEnum<{
1009
+ A4: "A4";
1010
+ A5: "A5";
1011
+ A5inA4: "A5inA4";
1012
+ A5E: "A5E";
1013
+ A5E_EXTRA: "A5E_EXTRA";
1014
+ A5E_STAND: "A5E_STAND";
1015
+ A6: "A6";
1016
+ A6inA4: "A6inA4";
1017
+ A4ONE: "A4ONE";
1018
+ }>>;
1019
+ }, z.core.$strip>;
1020
+ }, z.core.$catchall<z.ZodUnknown>>;
1021
+ }, z.core.$strip>;
1022
+ export type CreateParcelMPLRequest = z.infer<typeof CreateParcelMPLRequestSchema>;
1023
+ /**
1024
+ * Helper: validate full createParcel request
1025
+ */
1026
+ export declare function safeValidateCreateParcelRequest(input: unknown): z.ZodSafeParseResult<{
1027
+ parcel: Parcel;
1028
+ credentials: {
1029
+ authType: "apiKey";
1030
+ apiKey: string;
1031
+ apiSecret: string;
1032
+ accountingCode?: string | undefined;
1033
+ } | {
1034
+ authType: "oauth2";
1035
+ oAuth2Token: string;
1036
+ accountingCode?: string | undefined;
1037
+ };
1038
+ options: {
1039
+ [x: string]: unknown;
1040
+ mpl: {
1041
+ accountingCode: string;
1042
+ agreementCode: string;
1043
+ bankAccountNumber: string;
1044
+ labelType?: "A4" | "A5" | "A5inA4" | "A5E" | "A5E_EXTRA" | "A5E_STAND" | "A6" | "A6inA4" | "A4ONE" | undefined;
1045
+ };
1046
+ useTestApi?: boolean | undefined;
1047
+ };
1048
+ }>;
1049
+ /**
1050
+ * Label order type from OpenAPI
1051
+ * SENDING - Order by sending sequence
1052
+ * IDENTIFIER - Order by tracking number identifier
1053
+ */
1054
+ export declare const LabelOrderBySchema: z.ZodEnum<{
1055
+ SENDING: "SENDING";
1056
+ IDENTIFIER: "IDENTIFIER";
1057
+ }>;
1058
+ export type LabelOrderBy = z.infer<typeof LabelOrderBySchema>;
1059
+ /**
1060
+ * Single label query result from MPL API
1061
+ * Response for each tracking number requested
1062
+ */
1063
+ export declare const LabelQueryResultSchema: z.ZodObject<{
1064
+ trackingNumber: z.ZodOptional<z.ZodString>;
1065
+ label: z.ZodOptional<z.ZodString>;
1066
+ errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
1067
+ code: z.ZodOptional<z.ZodString>;
1068
+ parameter: z.ZodOptional<z.ZodString>;
1069
+ text: z.ZodOptional<z.ZodString>;
1070
+ text_eng: z.ZodOptional<z.ZodString>;
1071
+ }, z.core.$strip>>>;
1072
+ warnings: z.ZodOptional<z.ZodArray<z.ZodObject<{
1073
+ code: z.ZodOptional<z.ZodString>;
1074
+ parameter: z.ZodOptional<z.ZodString>;
1075
+ text: z.ZodOptional<z.ZodString>;
1076
+ text_eng: z.ZodOptional<z.ZodString>;
1077
+ }, z.core.$strip>>>;
1078
+ }, z.core.$strip>;
1079
+ export type LabelQueryResult = z.infer<typeof LabelQueryResultSchema>;
1080
+ /**
1081
+ * Request for creating labels via GET /shipments/label
1082
+ *
1083
+ * Pattern: cross-cutting options (e.g. `size`) live at `options.size` and
1084
+ * MPL-specific knobs (accountingCode, labelFormat, singleFile, orderBy)
1085
+ * live under `options.mpl`.
1086
+ */
1087
+ export declare const CreateLabelsMPLCarrierOptionsSchema: z.ZodObject<{
1088
+ accountingCode: z.ZodString;
1089
+ labelFormat: z.ZodOptional<z.ZodEnum<{
1090
+ PDF: "PDF";
1091
+ ZPL: "ZPL";
1092
+ }>>;
1093
+ singleFile: z.ZodOptional<z.ZodBoolean>;
1094
+ orderBy: z.ZodOptional<z.ZodEnum<{
1095
+ SENDING: "SENDING";
1096
+ IDENTIFIER: "IDENTIFIER";
1097
+ }>>;
1098
+ labelType: z.ZodOptional<z.ZodEnum<{
1099
+ A4: "A4";
1100
+ A5: "A5";
1101
+ A5inA4: "A5inA4";
1102
+ A5E: "A5E";
1103
+ A5E_EXTRA: "A5E_EXTRA";
1104
+ A5E_STAND: "A5E_STAND";
1105
+ A6: "A6";
1106
+ A6inA4: "A6inA4";
1107
+ A4ONE: "A4ONE";
1108
+ }>>;
1109
+ }, z.core.$catchall<z.ZodUnknown>>;
1110
+ export type CreateLabelsMPLCarrierOptions = z.infer<typeof CreateLabelsMPLCarrierOptionsSchema>;
1111
+ export declare const CreateLabelsMPLOptionsSchema: z.ZodObject<{
1112
+ useTestApi: z.ZodBoolean;
1113
+ size: z.ZodOptional<z.ZodEnum<{
1114
+ A4: "A4";
1115
+ A5: "A5";
1116
+ A5inA4: "A5inA4";
1117
+ A5E: "A5E";
1118
+ A5E_EXTRA: "A5E_EXTRA";
1119
+ A5E_STAND: "A5E_STAND";
1120
+ A6: "A6";
1121
+ A6inA4: "A6inA4";
1122
+ A4ONE: "A4ONE";
1123
+ }>>;
1124
+ mpl: z.ZodObject<{
1125
+ accountingCode: z.ZodString;
1126
+ labelFormat: z.ZodOptional<z.ZodEnum<{
1127
+ PDF: "PDF";
1128
+ ZPL: "ZPL";
1129
+ }>>;
1130
+ singleFile: z.ZodOptional<z.ZodBoolean>;
1131
+ orderBy: z.ZodOptional<z.ZodEnum<{
1132
+ SENDING: "SENDING";
1133
+ IDENTIFIER: "IDENTIFIER";
1134
+ }>>;
1135
+ labelType: z.ZodOptional<z.ZodEnum<{
1136
+ A4: "A4";
1137
+ A5: "A5";
1138
+ A5inA4: "A5inA4";
1139
+ A5E: "A5E";
1140
+ A5E_EXTRA: "A5E_EXTRA";
1141
+ A5E_STAND: "A5E_STAND";
1142
+ A6: "A6";
1143
+ A6inA4: "A6inA4";
1144
+ A4ONE: "A4ONE";
1145
+ }>>;
1146
+ }, z.core.$catchall<z.ZodUnknown>>;
1147
+ }, z.core.$catchall<z.ZodUnknown>>;
1148
+ export type CreateLabelsMPLOptions = z.infer<typeof CreateLabelsMPLOptionsSchema>;
1149
+ export declare const CreateLabelsMPLRequestSchema: z.ZodObject<{
1150
+ parcelCarrierIds: z.ZodArray<z.ZodString>;
1151
+ credentials: z.ZodPipe<z.ZodTransform<any, unknown>, z.ZodDiscriminatedUnion<[z.ZodObject<{
1152
+ authType: z.ZodLiteral<"apiKey">;
1153
+ apiKey: z.ZodString;
1154
+ apiSecret: z.ZodString;
1155
+ accountingCode: z.ZodOptional<z.ZodString>;
1156
+ }, z.core.$strip>, z.ZodObject<{
1157
+ authType: z.ZodLiteral<"oauth2">;
1158
+ oAuth2Token: z.ZodString;
1159
+ accountingCode: z.ZodOptional<z.ZodString>;
1160
+ }, z.core.$strip>], "authType">>;
1161
+ options: z.ZodObject<{
1162
+ useTestApi: z.ZodBoolean;
1163
+ size: z.ZodOptional<z.ZodEnum<{
1164
+ A4: "A4";
1165
+ A5: "A5";
1166
+ A5inA4: "A5inA4";
1167
+ A5E: "A5E";
1168
+ A5E_EXTRA: "A5E_EXTRA";
1169
+ A5E_STAND: "A5E_STAND";
1170
+ A6: "A6";
1171
+ A6inA4: "A6inA4";
1172
+ A4ONE: "A4ONE";
1173
+ }>>;
1174
+ mpl: z.ZodObject<{
1175
+ accountingCode: z.ZodString;
1176
+ labelFormat: z.ZodOptional<z.ZodEnum<{
1177
+ PDF: "PDF";
1178
+ ZPL: "ZPL";
1179
+ }>>;
1180
+ singleFile: z.ZodOptional<z.ZodBoolean>;
1181
+ orderBy: z.ZodOptional<z.ZodEnum<{
1182
+ SENDING: "SENDING";
1183
+ IDENTIFIER: "IDENTIFIER";
1184
+ }>>;
1185
+ labelType: z.ZodOptional<z.ZodEnum<{
1186
+ A4: "A4";
1187
+ A5: "A5";
1188
+ A5inA4: "A5inA4";
1189
+ A5E: "A5E";
1190
+ A5E_EXTRA: "A5E_EXTRA";
1191
+ A5E_STAND: "A5E_STAND";
1192
+ A6: "A6";
1193
+ A6inA4: "A6inA4";
1194
+ A4ONE: "A4ONE";
1195
+ }>>;
1196
+ }, z.core.$catchall<z.ZodUnknown>>;
1197
+ }, z.core.$catchall<z.ZodUnknown>>;
1198
+ }, z.core.$strip>;
1199
+ export type CreateLabelsMPLRequest = z.infer<typeof CreateLabelsMPLRequestSchema>;
1200
+ /**
1201
+ * Helper: validate label creation request
1202
+ */
1203
+ export declare function safeValidateCreateLabelsRequest(input: unknown): z.ZodSafeParseResult<{
1204
+ parcelCarrierIds: string[];
1205
+ credentials: {
1206
+ authType: "apiKey";
1207
+ apiKey: string;
1208
+ apiSecret: string;
1209
+ accountingCode?: string | undefined;
1210
+ } | {
1211
+ authType: "oauth2";
1212
+ oAuth2Token: string;
1213
+ accountingCode?: string | undefined;
1214
+ };
1215
+ options: {
1216
+ [x: string]: unknown;
1217
+ useTestApi: boolean;
1218
+ mpl: {
1219
+ [x: string]: unknown;
1220
+ accountingCode: string;
1221
+ labelFormat?: "PDF" | "ZPL" | undefined;
1222
+ singleFile?: boolean | undefined;
1223
+ orderBy?: "SENDING" | "IDENTIFIER" | undefined;
1224
+ labelType?: "A4" | "A5" | "A5inA4" | "A5E" | "A5E_EXTRA" | "A5E_STAND" | "A6" | "A6inA4" | "A4ONE" | undefined;
1225
+ };
1226
+ size?: "A4" | "A5" | "A5inA4" | "A5E" | "A5E_EXTRA" | "A5E_STAND" | "A6" | "A6inA4" | "A4ONE" | undefined;
1227
+ };
1228
+ }>;
1229
+ /**
1230
+ * Single-label request schema (carrier-specific)
1231
+ * Mirrors the batch request but for a single `parcelCarrierId`.
1232
+ */
1233
+ export declare const CreateLabelMPLRequestSchema: z.ZodObject<{
1234
+ parcelCarrierId: z.ZodString;
1235
+ credentials: z.ZodPipe<z.ZodTransform<any, unknown>, z.ZodDiscriminatedUnion<[z.ZodObject<{
1236
+ authType: z.ZodLiteral<"apiKey">;
1237
+ apiKey: z.ZodString;
1238
+ apiSecret: z.ZodString;
1239
+ accountingCode: z.ZodOptional<z.ZodString>;
1240
+ }, z.core.$strip>, z.ZodObject<{
1241
+ authType: z.ZodLiteral<"oauth2">;
1242
+ oAuth2Token: z.ZodString;
1243
+ accountingCode: z.ZodOptional<z.ZodString>;
1244
+ }, z.core.$strip>], "authType">>;
1245
+ options: z.ZodObject<{
1246
+ useTestApi: z.ZodBoolean;
1247
+ size: z.ZodOptional<z.ZodEnum<{
1248
+ A4: "A4";
1249
+ A5: "A5";
1250
+ A5inA4: "A5inA4";
1251
+ A5E: "A5E";
1252
+ A5E_EXTRA: "A5E_EXTRA";
1253
+ A5E_STAND: "A5E_STAND";
1254
+ A6: "A6";
1255
+ A6inA4: "A6inA4";
1256
+ A4ONE: "A4ONE";
1257
+ }>>;
1258
+ mpl: z.ZodObject<{
1259
+ accountingCode: z.ZodString;
1260
+ labelFormat: z.ZodOptional<z.ZodEnum<{
1261
+ PDF: "PDF";
1262
+ ZPL: "ZPL";
1263
+ }>>;
1264
+ singleFile: z.ZodOptional<z.ZodBoolean>;
1265
+ orderBy: z.ZodOptional<z.ZodEnum<{
1266
+ SENDING: "SENDING";
1267
+ IDENTIFIER: "IDENTIFIER";
1268
+ }>>;
1269
+ labelType: z.ZodOptional<z.ZodEnum<{
1270
+ A4: "A4";
1271
+ A5: "A5";
1272
+ A5inA4: "A5inA4";
1273
+ A5E: "A5E";
1274
+ A5E_EXTRA: "A5E_EXTRA";
1275
+ A5E_STAND: "A5E_STAND";
1276
+ A6: "A6";
1277
+ A6inA4: "A6inA4";
1278
+ A4ONE: "A4ONE";
1279
+ }>>;
1280
+ }, z.core.$catchall<z.ZodUnknown>>;
1281
+ }, z.core.$catchall<z.ZodUnknown>>;
1282
+ }, z.core.$strip>;
1283
+ export type CreateLabelMPLRequest = z.infer<typeof CreateLabelMPLRequestSchema>;
1284
+ export declare function safeValidateCreateLabelRequest(input: unknown): z.ZodSafeParseResult<{
1285
+ parcelCarrierId: string;
1286
+ credentials: {
1287
+ authType: "apiKey";
1288
+ apiKey: string;
1289
+ apiSecret: string;
1290
+ accountingCode?: string | undefined;
1291
+ } | {
1292
+ authType: "oauth2";
1293
+ oAuth2Token: string;
1294
+ accountingCode?: string | undefined;
1295
+ };
1296
+ options: {
1297
+ [x: string]: unknown;
1298
+ useTestApi: boolean;
1299
+ mpl: {
1300
+ [x: string]: unknown;
1301
+ accountingCode: string;
1302
+ labelFormat?: "PDF" | "ZPL" | undefined;
1303
+ singleFile?: boolean | undefined;
1304
+ orderBy?: "SENDING" | "IDENTIFIER" | undefined;
1305
+ labelType?: "A4" | "A5" | "A5inA4" | "A5E" | "A5E_EXTRA" | "A5E_STAND" | "A6" | "A6inA4" | "A4ONE" | undefined;
1306
+ };
1307
+ size?: "A4" | "A5" | "A5inA4" | "A5E" | "A5E_EXTRA" | "A5E_STAND" | "A6" | "A6inA4" | "A4ONE" | undefined;
1308
+ };
1309
+ }>;
1310
+ /**
1311
+ * ShipmentCloseRequest mirrors OpenAPI components.schemas.ShipmentCloseRequest
1312
+ * Only includes fields we need for building the MPL /shipments/close request.
1313
+ */
1314
+ export declare const ShipmentCloseRequestSchema: z.ZodObject<{
1315
+ fromDate: z.ZodOptional<z.ZodString>;
1316
+ toDate: z.ZodOptional<z.ZodString>;
1317
+ trackingNumbers: z.ZodOptional<z.ZodArray<z.ZodString>>;
1318
+ checkList: z.ZodOptional<z.ZodBoolean>;
1319
+ checkListWithPrice: z.ZodOptional<z.ZodBoolean>;
1320
+ tag: z.ZodOptional<z.ZodString>;
1321
+ requestId: z.ZodOptional<z.ZodString>;
1322
+ summaryList: z.ZodOptional<z.ZodBoolean>;
1323
+ singleFile: z.ZodOptional<z.ZodBoolean>;
1324
+ }, z.core.$strip>;
1325
+ export type ShipmentCloseRequest = z.infer<typeof ShipmentCloseRequestSchema>;
1326
+ /**
1327
+ * Full CLOSE_SHIPMENTS request envelope for MPL adapter
1328
+ */
1329
+ export declare const CloseShipmentsMPLRequestSchema: z.ZodObject<{
1330
+ close: z.ZodOptional<z.ZodObject<{
1331
+ fromDate: z.ZodOptional<z.ZodString>;
1332
+ toDate: z.ZodOptional<z.ZodString>;
1333
+ trackingNumbers: z.ZodOptional<z.ZodArray<z.ZodString>>;
1334
+ checkList: z.ZodOptional<z.ZodBoolean>;
1335
+ checkListWithPrice: z.ZodOptional<z.ZodBoolean>;
1336
+ tag: z.ZodOptional<z.ZodString>;
1337
+ requestId: z.ZodOptional<z.ZodString>;
1338
+ summaryList: z.ZodOptional<z.ZodBoolean>;
1339
+ singleFile: z.ZodOptional<z.ZodBoolean>;
1340
+ }, z.core.$strip>>;
1341
+ trackingNumbers: z.ZodOptional<z.ZodArray<z.ZodString>>;
1342
+ credentials: z.ZodPipe<z.ZodTransform<any, unknown>, z.ZodDiscriminatedUnion<[z.ZodObject<{
1343
+ authType: z.ZodLiteral<"apiKey">;
1344
+ apiKey: z.ZodString;
1345
+ apiSecret: z.ZodString;
1346
+ accountingCode: z.ZodOptional<z.ZodString>;
1347
+ }, z.core.$strip>, z.ZodObject<{
1348
+ authType: z.ZodLiteral<"oauth2">;
1349
+ oAuth2Token: z.ZodString;
1350
+ accountingCode: z.ZodOptional<z.ZodString>;
1351
+ }, z.core.$strip>], "authType">>;
1352
+ options: z.ZodOptional<z.ZodObject<{
1353
+ useTestApi: z.ZodOptional<z.ZodBoolean>;
1354
+ mpl: z.ZodOptional<z.ZodObject<{
1355
+ accountingCode: z.ZodString;
1356
+ }, z.core.$strip>>;
1357
+ }, z.core.$strip>>;
1358
+ }, z.core.$catchall<z.ZodUnknown>>;
1359
+ export type CloseShipmentsMPLRequest = z.infer<typeof CloseShipmentsMPLRequestSchema>;
1360
+ export declare function safeValidateCloseShipmentsRequest(input: unknown): z.ZodSafeParseResult<{
1361
+ [x: string]: unknown;
1362
+ credentials: {
1363
+ authType: "apiKey";
1364
+ apiKey: string;
1365
+ apiSecret: string;
1366
+ accountingCode?: string | undefined;
1367
+ } | {
1368
+ authType: "oauth2";
1369
+ oAuth2Token: string;
1370
+ accountingCode?: string | undefined;
1371
+ };
1372
+ close?: {
1373
+ fromDate?: string | undefined;
1374
+ toDate?: string | undefined;
1375
+ trackingNumbers?: string[] | undefined;
1376
+ checkList?: boolean | undefined;
1377
+ checkListWithPrice?: boolean | undefined;
1378
+ tag?: string | undefined;
1379
+ requestId?: string | undefined;
1380
+ summaryList?: boolean | undefined;
1381
+ singleFile?: boolean | undefined;
1382
+ } | undefined;
1383
+ trackingNumbers?: string[] | undefined;
1384
+ options?: {
1385
+ useTestApi?: boolean | undefined;
1386
+ mpl?: {
1387
+ accountingCode: string;
1388
+ } | undefined;
1389
+ } | undefined;
1390
+ }>;
1391
+ /**
1392
+ * Schema for GET_SHIPMENT_DETAILS request
1393
+ * Retrieves shipment metadata by tracking number
1394
+ */
1395
+ export declare const GetShipmentDetailsRequestSchema: z.ZodObject<{
1396
+ trackingNumber: z.ZodString;
1397
+ credentials: z.ZodPipe<z.ZodTransform<any, unknown>, z.ZodDiscriminatedUnion<[z.ZodObject<{
1398
+ authType: z.ZodLiteral<"apiKey">;
1399
+ apiKey: z.ZodString;
1400
+ apiSecret: z.ZodString;
1401
+ accountingCode: z.ZodOptional<z.ZodString>;
1402
+ }, z.core.$strip>, z.ZodObject<{
1403
+ authType: z.ZodLiteral<"oauth2">;
1404
+ oAuth2Token: z.ZodString;
1405
+ accountingCode: z.ZodOptional<z.ZodString>;
1406
+ }, z.core.$strip>], "authType">>;
1407
+ options: z.ZodOptional<z.ZodObject<{
1408
+ useTestApi: z.ZodOptional<z.ZodBoolean>;
1409
+ }, z.core.$strip>>;
1410
+ }, z.core.$strip>;
1411
+ export type GetShipmentDetailsRequest = z.infer<typeof GetShipmentDetailsRequestSchema>;
1412
+ /**
1413
+ * Helper: validate get shipment details request
1414
+ */
1415
+ export declare function safeValidateGetShipmentDetailsRequest(input: unknown): z.ZodSafeParseResult<{
1416
+ trackingNumber: string;
1417
+ credentials: {
1418
+ authType: "apiKey";
1419
+ apiKey: string;
1420
+ apiSecret: string;
1421
+ accountingCode?: string | undefined;
1422
+ } | {
1423
+ authType: "oauth2";
1424
+ oAuth2Token: string;
1425
+ accountingCode?: string | undefined;
1426
+ };
1427
+ options?: {
1428
+ useTestApi?: boolean | undefined;
1429
+ } | undefined;
1430
+ }>;
1431
+ /**
1432
+ * Helper: validate shipment query response
1433
+ */
1434
+ export declare function safeValidateShipmentQueryResponse(input: unknown): z.ZodSafeParseResult<{
1435
+ shipment?: {
1436
+ trackingNumber?: string | undefined;
1437
+ orderId?: string | undefined;
1438
+ tag?: string | undefined;
1439
+ shipmentDate?: string | undefined;
1440
+ packageRetention?: number | undefined;
1441
+ paymentMode?: "UV_AT" | "UV_KP" | undefined;
1442
+ sender?: {
1443
+ name?: string | undefined;
1444
+ street?: string | undefined;
1445
+ city?: string | undefined;
1446
+ postalCode?: string | undefined;
1447
+ country?: string | undefined;
1448
+ phone?: string | undefined;
1449
+ } | undefined;
1450
+ recipient?: {
1451
+ name?: string | undefined;
1452
+ street?: string | undefined;
1453
+ city?: string | undefined;
1454
+ postalCode?: string | undefined;
1455
+ country?: string | undefined;
1456
+ phone?: string | undefined;
1457
+ } | undefined;
1458
+ items?: {
1459
+ [x: string]: unknown;
1460
+ id?: string | undefined;
1461
+ weight?: number | undefined;
1462
+ }[] | undefined;
1463
+ } | null | undefined;
1464
+ errors?: {
1465
+ code?: string | undefined;
1466
+ parameter?: string | undefined;
1467
+ text?: string | undefined;
1468
+ text_eng?: string | undefined;
1469
+ }[] | null | undefined;
1470
+ metadata?: any;
1471
+ }>;
1472
+ /**
1473
+ * Schema for Shipment query response
1474
+ * Response from GET /shipments/{trackingNumber}
1475
+ */
1476
+ export declare const ShipmentStateSchema: z.ZodObject<{
1477
+ trackingNumber: z.ZodOptional<z.ZodString>;
1478
+ orderId: z.ZodOptional<z.ZodString>;
1479
+ tag: z.ZodOptional<z.ZodString>;
1480
+ shipmentDate: z.ZodOptional<z.ZodString>;
1481
+ packageRetention: z.ZodOptional<z.ZodNumber>;
1482
+ paymentMode: z.ZodOptional<z.ZodEnum<{
1483
+ UV_AT: "UV_AT";
1484
+ UV_KP: "UV_KP";
1485
+ }>>;
1486
+ sender: z.ZodOptional<z.ZodObject<{
1487
+ name: z.ZodOptional<z.ZodString>;
1488
+ street: z.ZodOptional<z.ZodString>;
1489
+ city: z.ZodOptional<z.ZodString>;
1490
+ postalCode: z.ZodOptional<z.ZodString>;
1491
+ country: z.ZodOptional<z.ZodString>;
1492
+ phone: z.ZodOptional<z.ZodString>;
1493
+ }, z.core.$strip>>;
1494
+ recipient: z.ZodOptional<z.ZodObject<{
1495
+ name: z.ZodOptional<z.ZodString>;
1496
+ street: z.ZodOptional<z.ZodString>;
1497
+ city: z.ZodOptional<z.ZodString>;
1498
+ postalCode: z.ZodOptional<z.ZodString>;
1499
+ country: z.ZodOptional<z.ZodString>;
1500
+ phone: z.ZodOptional<z.ZodString>;
1501
+ }, z.core.$strip>>;
1502
+ items: z.ZodOptional<z.ZodArray<z.ZodObject<{
1503
+ id: z.ZodOptional<z.ZodString>;
1504
+ weight: z.ZodOptional<z.ZodNumber>;
1505
+ }, z.core.$loose>>>;
1506
+ }, z.core.$strip>;
1507
+ export type ShipmentState = z.infer<typeof ShipmentStateSchema>;
1508
+ /**
1509
+ * Schema for the response from GET /shipments/{trackingNumber}
1510
+ */
1511
+ export declare const MPLShipmentQueryResultSchema: z.ZodObject<{
1512
+ shipment: z.ZodNullable<z.ZodOptional<z.ZodObject<{
1513
+ trackingNumber: z.ZodOptional<z.ZodString>;
1514
+ orderId: z.ZodOptional<z.ZodString>;
1515
+ tag: z.ZodOptional<z.ZodString>;
1516
+ shipmentDate: z.ZodOptional<z.ZodString>;
1517
+ packageRetention: z.ZodOptional<z.ZodNumber>;
1518
+ paymentMode: z.ZodOptional<z.ZodEnum<{
1519
+ UV_AT: "UV_AT";
1520
+ UV_KP: "UV_KP";
1521
+ }>>;
1522
+ sender: z.ZodOptional<z.ZodObject<{
1523
+ name: z.ZodOptional<z.ZodString>;
1524
+ street: z.ZodOptional<z.ZodString>;
1525
+ city: z.ZodOptional<z.ZodString>;
1526
+ postalCode: z.ZodOptional<z.ZodString>;
1527
+ country: z.ZodOptional<z.ZodString>;
1528
+ phone: z.ZodOptional<z.ZodString>;
1529
+ }, z.core.$strip>>;
1530
+ recipient: z.ZodOptional<z.ZodObject<{
1531
+ name: z.ZodOptional<z.ZodString>;
1532
+ street: z.ZodOptional<z.ZodString>;
1533
+ city: z.ZodOptional<z.ZodString>;
1534
+ postalCode: z.ZodOptional<z.ZodString>;
1535
+ country: z.ZodOptional<z.ZodString>;
1536
+ phone: z.ZodOptional<z.ZodString>;
1537
+ }, z.core.$strip>>;
1538
+ items: z.ZodOptional<z.ZodArray<z.ZodObject<{
1539
+ id: z.ZodOptional<z.ZodString>;
1540
+ weight: z.ZodOptional<z.ZodNumber>;
1541
+ }, z.core.$loose>>>;
1542
+ }, z.core.$strip>>>;
1543
+ errors: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodObject<{
1544
+ code: z.ZodOptional<z.ZodString>;
1545
+ parameter: z.ZodOptional<z.ZodString>;
1546
+ text: z.ZodOptional<z.ZodString>;
1547
+ text_eng: z.ZodOptional<z.ZodString>;
1548
+ }, z.core.$strip>>>>;
1549
+ metadata: z.ZodOptional<z.ZodAny>;
1550
+ }, z.core.$strip>;
1551
+ export type MPLShipmentQueryResult = z.infer<typeof MPLShipmentQueryResultSchema>;
1552
+ /**
1553
+ * Schema for tracking request (Pull-1 endpoint)
1554
+ * Retrieves tracking/trace information for one or more parcels
1555
+ *
1556
+ * Required:
1557
+ * - trackingNumbers: array of one or more tracking numbers
1558
+ * - credentials: MPLCredentials
1559
+ *
1560
+ * Optional:
1561
+ * - state: 'last' (latest event only, faster) or 'all' (complete history)
1562
+ * - useRegisteredEndpoint: false (Guest) or true (Registered with financial data)
1563
+ * - useTestApi: use sandbox API instead of production
1564
+ */
1565
+ export declare const TrackingRequestMPLSchema: z.ZodObject<{
1566
+ trackingNumbers: z.ZodArray<z.ZodString>;
1567
+ credentials: z.ZodPipe<z.ZodTransform<any, unknown>, z.ZodDiscriminatedUnion<[z.ZodObject<{
1568
+ authType: z.ZodLiteral<"apiKey">;
1569
+ apiKey: z.ZodString;
1570
+ apiSecret: z.ZodString;
1571
+ accountingCode: z.ZodOptional<z.ZodString>;
1572
+ }, z.core.$strip>, z.ZodObject<{
1573
+ authType: z.ZodLiteral<"oauth2">;
1574
+ oAuth2Token: z.ZodString;
1575
+ accountingCode: z.ZodOptional<z.ZodString>;
1576
+ }, z.core.$strip>], "authType">>;
1577
+ state: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
1578
+ last: "last";
1579
+ all: "all";
1580
+ }>>>;
1581
+ useRegisteredEndpoint: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1582
+ options: z.ZodOptional<z.ZodObject<{
1583
+ useTestApi: z.ZodOptional<z.ZodBoolean>;
1584
+ }, z.core.$strip>>;
1585
+ }, z.core.$strip>;
1586
+ export type TrackingRequestMPL = z.infer<typeof TrackingRequestMPLSchema>;
1587
+ /**
1588
+ * Helper: validate tracking request
1589
+ */
1590
+ export declare function safeValidateTrackingRequest(input: unknown): z.ZodSafeParseResult<{
1591
+ trackingNumbers: string[];
1592
+ credentials: {
1593
+ authType: "apiKey";
1594
+ apiKey: string;
1595
+ apiSecret: string;
1596
+ accountingCode?: string | undefined;
1597
+ } | {
1598
+ authType: "oauth2";
1599
+ oAuth2Token: string;
1600
+ accountingCode?: string | undefined;
1601
+ };
1602
+ state: "last" | "all";
1603
+ useRegisteredEndpoint: boolean;
1604
+ options?: {
1605
+ useTestApi?: boolean | undefined;
1606
+ } | undefined;
1607
+ }>;
1608
+ /**
1609
+ * MPL C-Code Tracking Record from Pull-1 API response
1610
+ *
1611
+ * Contains C0-C63 fields representing different tracking data.
1612
+ * Guest endpoint excludes financial data (C2, C5, C41, C42, C58)
1613
+ * Registered endpoint includes all fields
1614
+ */
1615
+ export declare const MPLTrackingRecordSchema: z.ZodObject<{
1616
+ c0: z.ZodOptional<z.ZodString>;
1617
+ c1: z.ZodString;
1618
+ c2: z.ZodOptional<z.ZodString>;
1619
+ c4: z.ZodOptional<z.ZodString>;
1620
+ c5: z.ZodOptional<z.ZodString>;
1621
+ c6: z.ZodOptional<z.ZodString>;
1622
+ c8: z.ZodOptional<z.ZodString>;
1623
+ c9: z.ZodOptional<z.ZodString>;
1624
+ c10: z.ZodOptional<z.ZodString>;
1625
+ c11: z.ZodOptional<z.ZodString>;
1626
+ c12: z.ZodOptional<z.ZodString>;
1627
+ c13: z.ZodOptional<z.ZodString>;
1628
+ c38: z.ZodOptional<z.ZodString>;
1629
+ c39: z.ZodOptional<z.ZodString>;
1630
+ c41: z.ZodOptional<z.ZodString>;
1631
+ c42: z.ZodOptional<z.ZodString>;
1632
+ c43: z.ZodOptional<z.ZodString>;
1633
+ c49: z.ZodOptional<z.ZodString>;
1634
+ c53: z.ZodOptional<z.ZodString>;
1635
+ c55: z.ZodOptional<z.ZodString>;
1636
+ c56: z.ZodOptional<z.ZodString>;
1637
+ c57: z.ZodOptional<z.ZodString>;
1638
+ c59: z.ZodOptional<z.ZodString>;
1639
+ c60: z.ZodOptional<z.ZodString>;
1640
+ c61: z.ZodOptional<z.ZodString>;
1641
+ c63: z.ZodOptional<z.ZodString>;
1642
+ }, z.core.$loose>;
1643
+ export type MPLTrackingRecord = z.infer<typeof MPLTrackingRecordSchema>;
1644
+ /**
1645
+ * Schema for tracking response from Pull-1 API
1646
+ * Returns array of tracking records (one per tracking number) or error
1647
+ */
1648
+ export declare const TrackingResponseMPLSchema: z.ZodObject<{
1649
+ trackAndTrace: z.ZodOptional<z.ZodArray<z.ZodObject<{
1650
+ c0: z.ZodOptional<z.ZodString>;
1651
+ c1: z.ZodString;
1652
+ c2: z.ZodOptional<z.ZodString>;
1653
+ c4: z.ZodOptional<z.ZodString>;
1654
+ c5: z.ZodOptional<z.ZodString>;
1655
+ c6: z.ZodOptional<z.ZodString>;
1656
+ c8: z.ZodOptional<z.ZodString>;
1657
+ c9: z.ZodOptional<z.ZodString>;
1658
+ c10: z.ZodOptional<z.ZodString>;
1659
+ c11: z.ZodOptional<z.ZodString>;
1660
+ c12: z.ZodOptional<z.ZodString>;
1661
+ c13: z.ZodOptional<z.ZodString>;
1662
+ c38: z.ZodOptional<z.ZodString>;
1663
+ c39: z.ZodOptional<z.ZodString>;
1664
+ c41: z.ZodOptional<z.ZodString>;
1665
+ c42: z.ZodOptional<z.ZodString>;
1666
+ c43: z.ZodOptional<z.ZodString>;
1667
+ c49: z.ZodOptional<z.ZodString>;
1668
+ c53: z.ZodOptional<z.ZodString>;
1669
+ c55: z.ZodOptional<z.ZodString>;
1670
+ c56: z.ZodOptional<z.ZodString>;
1671
+ c57: z.ZodOptional<z.ZodString>;
1672
+ c59: z.ZodOptional<z.ZodString>;
1673
+ c60: z.ZodOptional<z.ZodString>;
1674
+ c61: z.ZodOptional<z.ZodString>;
1675
+ c63: z.ZodOptional<z.ZodString>;
1676
+ }, z.core.$loose>>>;
1677
+ }, z.core.$loose>;
1678
+ export type TrackingResponseMPL = z.infer<typeof TrackingResponseMPLSchema>;
1679
+ /**
1680
+ * Helper: validate tracking response
1681
+ */
1682
+ export declare function safeValidateTrackingResponse(input: unknown): z.ZodSafeParseResult<{
1683
+ [x: string]: unknown;
1684
+ trackAndTrace?: {
1685
+ [x: string]: unknown;
1686
+ c1: string;
1687
+ c0?: string | undefined;
1688
+ c2?: string | undefined;
1689
+ c4?: string | undefined;
1690
+ c5?: string | undefined;
1691
+ c6?: string | undefined;
1692
+ c8?: string | undefined;
1693
+ c9?: string | undefined;
1694
+ c10?: string | undefined;
1695
+ c11?: string | undefined;
1696
+ c12?: string | undefined;
1697
+ c13?: string | undefined;
1698
+ c38?: string | undefined;
1699
+ c39?: string | undefined;
1700
+ c41?: string | undefined;
1701
+ c42?: string | undefined;
1702
+ c43?: string | undefined;
1703
+ c49?: string | undefined;
1704
+ c53?: string | undefined;
1705
+ c55?: string | undefined;
1706
+ c56?: string | undefined;
1707
+ c57?: string | undefined;
1708
+ c59?: string | undefined;
1709
+ c60?: string | undefined;
1710
+ c61?: string | undefined;
1711
+ c63?: string | undefined;
1712
+ }[] | undefined;
1713
+ }>;
1714
+ /**
1715
+ * Schema for Pull-500 start request (batch tracking submission)
1716
+ *
1717
+ * Required:
1718
+ * - trackingNumbers: array of 1-500 tracking numbers
1719
+ * - credentials: MPLCredentials
1720
+ *
1721
+ * Optional:
1722
+ * - language: 'hu' (Hungarian, default) or 'en' (English)
1723
+ * - useTestApi: use sandbox API
1724
+ */
1725
+ export declare const Pull500StartRequestSchema: z.ZodObject<{
1726
+ trackingNumbers: z.ZodArray<z.ZodString>;
1727
+ credentials: z.ZodPipe<z.ZodTransform<any, unknown>, z.ZodDiscriminatedUnion<[z.ZodObject<{
1728
+ authType: z.ZodLiteral<"apiKey">;
1729
+ apiKey: z.ZodString;
1730
+ apiSecret: z.ZodString;
1731
+ accountingCode: z.ZodOptional<z.ZodString>;
1732
+ }, z.core.$strip>, z.ZodObject<{
1733
+ authType: z.ZodLiteral<"oauth2">;
1734
+ oAuth2Token: z.ZodString;
1735
+ accountingCode: z.ZodOptional<z.ZodString>;
1736
+ }, z.core.$strip>], "authType">>;
1737
+ language: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
1738
+ hu: "hu";
1739
+ en: "en";
1740
+ }>>>;
1741
+ options: z.ZodOptional<z.ZodObject<{
1742
+ useTestApi: z.ZodOptional<z.ZodBoolean>;
1743
+ }, z.core.$strip>>;
1744
+ }, z.core.$strip>;
1745
+ export type Pull500StartRequest = z.infer<typeof Pull500StartRequestSchema>;
1746
+ /**
1747
+ * Helper: validate Pull-500 start request
1748
+ */
1749
+ export declare function safeValidatePull500StartRequest(input: unknown): z.ZodSafeParseResult<{
1750
+ trackingNumbers: string[];
1751
+ credentials: {
1752
+ authType: "apiKey";
1753
+ apiKey: string;
1754
+ apiSecret: string;
1755
+ accountingCode?: string | undefined;
1756
+ } | {
1757
+ authType: "oauth2";
1758
+ oAuth2Token: string;
1759
+ accountingCode?: string | undefined;
1760
+ };
1761
+ language?: "hu" | "en" | undefined;
1762
+ options?: {
1763
+ useTestApi?: boolean | undefined;
1764
+ } | undefined;
1765
+ }>;
1766
+ /**
1767
+ * Schema for Pull-500 start response
1768
+ * Returns trackingGUID for polling, plus any submission errors
1769
+ */
1770
+ export declare const Pull500StartResponseSchema: z.ZodObject<{
1771
+ trackingGUID: z.ZodString;
1772
+ errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
1773
+ code: z.ZodOptional<z.ZodString>;
1774
+ parameter: z.ZodOptional<z.ZodString>;
1775
+ text: z.ZodOptional<z.ZodString>;
1776
+ text_eng: z.ZodOptional<z.ZodString>;
1777
+ }, z.core.$strip>>>;
1778
+ }, z.core.$loose>;
1779
+ export type Pull500StartResponse = z.infer<typeof Pull500StartResponseSchema>;
1780
+ /**
1781
+ * Helper: validate Pull-500 start response
1782
+ */
1783
+ export declare function safeValidatePull500StartResponse(input: unknown): z.ZodSafeParseResult<{
1784
+ [x: string]: unknown;
1785
+ trackingGUID: string;
1786
+ errors?: {
1787
+ code?: string | undefined;
1788
+ parameter?: string | undefined;
1789
+ text?: string | undefined;
1790
+ text_eng?: string | undefined;
1791
+ }[] | undefined;
1792
+ }>;
1793
+ /**
1794
+ * Schema for Pull-500 check request (poll for results)
1795
+ *
1796
+ * Required:
1797
+ * - trackingGUID: UUID returned from start request
1798
+ * - credentials: MPLCredentials
1799
+ */
1800
+ export declare const Pull500CheckRequestSchema: z.ZodObject<{
1801
+ trackingGUID: z.ZodString;
1802
+ credentials: z.ZodPipe<z.ZodTransform<any, unknown>, z.ZodDiscriminatedUnion<[z.ZodObject<{
1803
+ authType: z.ZodLiteral<"apiKey">;
1804
+ apiKey: z.ZodString;
1805
+ apiSecret: z.ZodString;
1806
+ accountingCode: z.ZodOptional<z.ZodString>;
1807
+ }, z.core.$strip>, z.ZodObject<{
1808
+ authType: z.ZodLiteral<"oauth2">;
1809
+ oAuth2Token: z.ZodString;
1810
+ accountingCode: z.ZodOptional<z.ZodString>;
1811
+ }, z.core.$strip>], "authType">>;
1812
+ options: z.ZodOptional<z.ZodObject<{
1813
+ useTestApi: z.ZodOptional<z.ZodBoolean>;
1814
+ }, z.core.$strip>>;
1815
+ }, z.core.$strip>;
1816
+ export type Pull500CheckRequest = z.infer<typeof Pull500CheckRequestSchema>;
1817
+ /**
1818
+ * Helper: validate Pull-500 check request
1819
+ */
1820
+ export declare function safeValidatePull500CheckRequest(input: unknown): z.ZodSafeParseResult<{
1821
+ trackingGUID: string;
1822
+ credentials: {
1823
+ authType: "apiKey";
1824
+ apiKey: string;
1825
+ apiSecret: string;
1826
+ accountingCode?: string | undefined;
1827
+ } | {
1828
+ authType: "oauth2";
1829
+ oAuth2Token: string;
1830
+ accountingCode?: string | undefined;
1831
+ };
1832
+ options?: {
1833
+ useTestApi?: boolean | undefined;
1834
+ } | undefined;
1835
+ }>;
1836
+ /**
1837
+ * Status values for Pull-500 check response
1838
+ * NEW - Request received, queued
1839
+ * INPROGRESS - Processing
1840
+ * READY - Results available
1841
+ * ERROR - Processing failed
1842
+ */
1843
+ export declare const Pull500StatusSchema: z.ZodEnum<{
1844
+ NEW: "NEW";
1845
+ INPROGRESS: "INPROGRESS";
1846
+ READY: "READY";
1847
+ ERROR: "ERROR";
1848
+ }>;
1849
+ export type Pull500Status = z.infer<typeof Pull500StatusSchema>;
1850
+ /**
1851
+ * Schema for Pull-500 check response
1852
+ *
1853
+ * Status progression: NEW -> INPROGRESS -> READY (or ERROR)
1854
+ * When status=READY, report contains CSV-formatted tracking data
1855
+ * report_fields contains column headers
1856
+ */
1857
+ export declare const Pull500CheckResponseSchema: z.ZodObject<{
1858
+ status: z.ZodEnum<{
1859
+ NEW: "NEW";
1860
+ INPROGRESS: "INPROGRESS";
1861
+ READY: "READY";
1862
+ ERROR: "ERROR";
1863
+ }>;
1864
+ report: z.ZodOptional<z.ZodString>;
1865
+ report_fields: z.ZodOptional<z.ZodString>;
1866
+ errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
1867
+ code: z.ZodOptional<z.ZodString>;
1868
+ parameter: z.ZodOptional<z.ZodString>;
1869
+ text: z.ZodOptional<z.ZodString>;
1870
+ text_eng: z.ZodOptional<z.ZodString>;
1871
+ }, z.core.$strip>>>;
1872
+ }, z.core.$loose>;
1873
+ export type Pull500CheckResponse = z.infer<typeof Pull500CheckResponseSchema>;
1874
+ /**
1875
+ * Helper: validate Pull-500 check response
1876
+ */
1877
+ export declare function safeValidatePull500CheckResponse(input: unknown): z.ZodSafeParseResult<{
1878
+ [x: string]: unknown;
1879
+ status: "NEW" | "INPROGRESS" | "READY" | "ERROR";
1880
+ report?: string | undefined;
1881
+ report_fields?: string | undefined;
1882
+ errors?: {
1883
+ code?: string | undefined;
1884
+ parameter?: string | undefined;
1885
+ text?: string | undefined;
1886
+ text_eng?: string | undefined;
1887
+ }[] | undefined;
1888
+ }>;
1889
+ export {};
1890
+ //# sourceMappingURL=validation.d.ts.map