@shipengine/elements 1.3.1 → 1.3.2

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/index.cjs CHANGED
@@ -15190,14 +15190,21 @@ const getShipmentSchema = ({
15190
15190
  insuredValue: moneySchema.extend({
15191
15191
  amount: zod.z.number().positive()
15192
15192
  }).optional(),
15193
- products: zod.z.object({
15193
+ products: _isCustomsRequired ? zod.z.object({
15194
15194
  countryOfOrigin: zod.z.string().nullishDefault(undefined),
15195
15195
  description: zod.z.string().nullishDefault(undefined),
15196
15196
  harmonizedTariffCode: zod.z.string().nullishDefault(undefined),
15197
15197
  productId: zod.z.string().nullishDefault(undefined),
15198
15198
  quantity: zod.z.number().int(),
15199
15199
  value: moneySchema
15200
- }).array().min(1),
15200
+ }).array().min(1) : zod.z.object({
15201
+ countryOfOrigin: zod.z.string().nullishDefault(undefined),
15202
+ description: zod.z.string().nullishDefault(undefined),
15203
+ harmonizedTariffCode: zod.z.string().nullishDefault(undefined),
15204
+ productId: zod.z.string().nullishDefault(undefined),
15205
+ quantity: zod.z.number().int(),
15206
+ value: moneySchema
15207
+ }).array().nullish(),
15201
15208
  type: zod.z.object({
15202
15209
  carrierId: zod.z.string().nullish(),
15203
15210
  code: zod.z.string().nullish()
@@ -15263,7 +15270,7 @@ const getShipmentSchema = ({
15263
15270
  carrierId: (_b = schema.carrierId) !== null && _b !== void 0 ? _b : undefined,
15264
15271
  // Clear customs if not required
15265
15272
  customs: _isCustomsRequired ? schema.customs : undefined,
15266
- packages: [Object.assign(Object.assign(Object.assign({}, pkg), !_requireMeasurements && !((_c = pkg.weight) === null || _c === void 0 ? void 0 : _c.value) && {
15273
+ packages: [Object.assign(Object.assign(Object.assign(Object.assign({}, pkg), !_requireMeasurements && !((_c = pkg.weight) === null || _c === void 0 ? void 0 : _c.value) && {
15267
15274
  weight: {
15268
15275
  unit: "ounce",
15269
15276
  value: 16
@@ -15276,6 +15283,9 @@ const getShipmentSchema = ({
15276
15283
  } : {
15277
15284
  // set the value for packageId if it doesn't have a carrier (custom package)
15278
15285
  packageId: code
15286
+ }), {
15287
+ // Clear products if customs not required
15288
+ products: _isCustomsRequired ? schema.packages[0].products : []
15279
15289
  })],
15280
15290
  serviceCode: (_d = service === null || service === void 0 ? void 0 : service.serviceCode) !== null && _d !== void 0 ? _d : undefined
15281
15291
  });
@@ -15514,9 +15524,13 @@ const ShipmentForm = ({
15514
15524
  const date = parseLocaleDate(shipDate, defaultLocale);
15515
15525
  shipDate = formatByDateAndLocale(date, "en-US", "MM/dd/yyyy");
15516
15526
  }
15517
- const updatedShipment = yield onSubmit(___default["default"].merge(shipment || {}, Object.assign({
15518
- shipDate
15519
- }, payload)));
15527
+ const updatedShipment = yield onSubmit(
15528
+ // using mergeWith to get a deep merge and also respect undefined values
15529
+ ___default["default"].mergeWith(shipment, payload, (objValue, srcValue, key, obj) => {
15530
+ if (objValue !== srcValue && typeof srcValue === "undefined") {
15531
+ obj[key] = srcValue;
15532
+ }
15533
+ }));
15520
15534
  // Defer shipment hydration to the task queue so that the submission promise resolves first, otherwise the
15521
15535
  // submission count will increment after hydration resets the form, keeping it in revalidate mode
15522
15536
  if (updatedShipment) setTimeout(() => hydrateShipment(updatedShipment), 0);
@@ -15657,7 +15671,6 @@ const ShipmentForm = ({
15657
15671
  });
15658
15672
  if (!shipment) throw new Error("errorMessages.unableToLoad.shipment");
15659
15673
  const addressPreferenceIsEmpty = !addressLoading && isEmptyAddress(addressPreference === null || addressPreference === void 0 ? void 0 : addressPreference.selection); // undefined means it's still loading
15660
- console.log(addressLoading || isEditShipFormToOpen || addressPreferenceIsEmpty);
15661
15674
  return jsxRuntime.jsxs("form", Object.assign({
15662
15675
  id: "shipment-form",
15663
15676
  onSubmit: formLogger.capture(handleSubmit)
@@ -17075,20 +17088,23 @@ const usePendingShipment = ({
17075
17088
  const customsFromSalesOrder = getCustomsFromSalesOrder(salesOrder, defaultWarehouse);
17076
17089
  try {
17077
17090
  setIsCreatingShipment(true);
17091
+ const isCustomsRequired = getIsCustomsRequiredForSalesOrder(salesOrder, defaultWarehouse);
17078
17092
  const shipment = yield createShipment(Object.assign(Object.assign({
17079
17093
  salesOrderId: salesOrder.salesOrderId,
17080
17094
  warehouseId: defaultWarehouse.warehouseId
17081
- }, getIsCustomsRequiredForSalesOrder(salesOrder, defaultWarehouse) && {
17095
+ }, isCustomsRequired && {
17082
17096
  customs: customsFromSalesOrder.customs
17083
17097
  }), {
17084
- packages: [{
17085
- packageCode: "package",
17086
- products: customsFromSalesOrder.products,
17098
+ packages: [Object.assign(Object.assign({
17099
+ packageCode: "package"
17100
+ }, isCustomsRequired && {
17101
+ products: customsFromSalesOrder.products
17102
+ }), {
17087
17103
  weight: {
17088
17104
  unit: "pound",
17089
17105
  value: 0
17090
17106
  }
17091
- }]
17107
+ })]
17092
17108
  }));
17093
17109
  if (shipment) {
17094
17110
  yield reloadShipments();
package/index.js CHANGED
@@ -15158,14 +15158,21 @@ const getShipmentSchema = ({
15158
15158
  insuredValue: moneySchema.extend({
15159
15159
  amount: z.number().positive()
15160
15160
  }).optional(),
15161
- products: z.object({
15161
+ products: _isCustomsRequired ? z.object({
15162
15162
  countryOfOrigin: z.string().nullishDefault(undefined),
15163
15163
  description: z.string().nullishDefault(undefined),
15164
15164
  harmonizedTariffCode: z.string().nullishDefault(undefined),
15165
15165
  productId: z.string().nullishDefault(undefined),
15166
15166
  quantity: z.number().int(),
15167
15167
  value: moneySchema
15168
- }).array().min(1),
15168
+ }).array().min(1) : z.object({
15169
+ countryOfOrigin: z.string().nullishDefault(undefined),
15170
+ description: z.string().nullishDefault(undefined),
15171
+ harmonizedTariffCode: z.string().nullishDefault(undefined),
15172
+ productId: z.string().nullishDefault(undefined),
15173
+ quantity: z.number().int(),
15174
+ value: moneySchema
15175
+ }).array().nullish(),
15169
15176
  type: z.object({
15170
15177
  carrierId: z.string().nullish(),
15171
15178
  code: z.string().nullish()
@@ -15231,7 +15238,7 @@ const getShipmentSchema = ({
15231
15238
  carrierId: (_b = schema.carrierId) !== null && _b !== void 0 ? _b : undefined,
15232
15239
  // Clear customs if not required
15233
15240
  customs: _isCustomsRequired ? schema.customs : undefined,
15234
- packages: [Object.assign(Object.assign(Object.assign({}, pkg), !_requireMeasurements && !((_c = pkg.weight) === null || _c === void 0 ? void 0 : _c.value) && {
15241
+ packages: [Object.assign(Object.assign(Object.assign(Object.assign({}, pkg), !_requireMeasurements && !((_c = pkg.weight) === null || _c === void 0 ? void 0 : _c.value) && {
15235
15242
  weight: {
15236
15243
  unit: "ounce",
15237
15244
  value: 16
@@ -15244,6 +15251,9 @@ const getShipmentSchema = ({
15244
15251
  } : {
15245
15252
  // set the value for packageId if it doesn't have a carrier (custom package)
15246
15253
  packageId: code
15254
+ }), {
15255
+ // Clear products if customs not required
15256
+ products: _isCustomsRequired ? schema.packages[0].products : []
15247
15257
  })],
15248
15258
  serviceCode: (_d = service === null || service === void 0 ? void 0 : service.serviceCode) !== null && _d !== void 0 ? _d : undefined
15249
15259
  });
@@ -15482,9 +15492,13 @@ const ShipmentForm = ({
15482
15492
  const date = parseLocaleDate(shipDate, defaultLocale);
15483
15493
  shipDate = formatByDateAndLocale(date, "en-US", "MM/dd/yyyy");
15484
15494
  }
15485
- const updatedShipment = yield onSubmit(_$3.merge(shipment || {}, Object.assign({
15486
- shipDate
15487
- }, payload)));
15495
+ const updatedShipment = yield onSubmit(
15496
+ // using mergeWith to get a deep merge and also respect undefined values
15497
+ _$3.mergeWith(shipment, payload, (objValue, srcValue, key, obj) => {
15498
+ if (objValue !== srcValue && typeof srcValue === "undefined") {
15499
+ obj[key] = srcValue;
15500
+ }
15501
+ }));
15488
15502
  // Defer shipment hydration to the task queue so that the submission promise resolves first, otherwise the
15489
15503
  // submission count will increment after hydration resets the form, keeping it in revalidate mode
15490
15504
  if (updatedShipment) setTimeout(() => hydrateShipment(updatedShipment), 0);
@@ -15625,7 +15639,6 @@ const ShipmentForm = ({
15625
15639
  });
15626
15640
  if (!shipment) throw new Error("errorMessages.unableToLoad.shipment");
15627
15641
  const addressPreferenceIsEmpty = !addressLoading && isEmptyAddress(addressPreference === null || addressPreference === void 0 ? void 0 : addressPreference.selection); // undefined means it's still loading
15628
- console.log(addressLoading || isEditShipFormToOpen || addressPreferenceIsEmpty);
15629
15642
  return jsxs("form", Object.assign({
15630
15643
  id: "shipment-form",
15631
15644
  onSubmit: formLogger.capture(handleSubmit)
@@ -17043,20 +17056,23 @@ const usePendingShipment = ({
17043
17056
  const customsFromSalesOrder = getCustomsFromSalesOrder(salesOrder, defaultWarehouse);
17044
17057
  try {
17045
17058
  setIsCreatingShipment(true);
17059
+ const isCustomsRequired = getIsCustomsRequiredForSalesOrder(salesOrder, defaultWarehouse);
17046
17060
  const shipment = yield createShipment(Object.assign(Object.assign({
17047
17061
  salesOrderId: salesOrder.salesOrderId,
17048
17062
  warehouseId: defaultWarehouse.warehouseId
17049
- }, getIsCustomsRequiredForSalesOrder(salesOrder, defaultWarehouse) && {
17063
+ }, isCustomsRequired && {
17050
17064
  customs: customsFromSalesOrder.customs
17051
17065
  }), {
17052
- packages: [{
17053
- packageCode: "package",
17054
- products: customsFromSalesOrder.products,
17066
+ packages: [Object.assign(Object.assign({
17067
+ packageCode: "package"
17068
+ }, isCustomsRequired && {
17069
+ products: customsFromSalesOrder.products
17070
+ }), {
17055
17071
  weight: {
17056
17072
  unit: "pound",
17057
17073
  value: 0
17058
17074
  }
17059
- }]
17075
+ })]
17060
17076
  }));
17061
17077
  if (shipment) {
17062
17078
  yield reloadShipments();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipengine/elements",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "peerDependencies": {
5
5
  "@shipengine/alchemy": "5.x.x",
6
6
  "@emotion/react": "11.x",
@@ -132,7 +132,43 @@ export declare const getShipmentSchema: ({ dimensionsUnit, isContentDescriptionR
132
132
  currency: SE.Currency;
133
133
  };
134
134
  quantity: number;
135
- }>, "many">;
135
+ }>, "many"> | z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodObject<{
136
+ countryOfOrigin: z.ZodEffects<z.ZodNullable<z.ZodOptional<z.ZodString>>, string | undefined, string | null | undefined>;
137
+ description: z.ZodEffects<z.ZodNullable<z.ZodOptional<z.ZodString>>, string | undefined, string | null | undefined>;
138
+ harmonizedTariffCode: z.ZodEffects<z.ZodNullable<z.ZodOptional<z.ZodString>>, string | undefined, string | null | undefined>;
139
+ productId: z.ZodEffects<z.ZodNullable<z.ZodOptional<z.ZodString>>, string | undefined, string | null | undefined>;
140
+ quantity: z.ZodNumber;
141
+ value: z.ZodObject<{
142
+ amount: z.ZodNumber;
143
+ currency: z.ZodNativeEnum<typeof SE.Currency>;
144
+ }, "strip", z.ZodTypeAny, {
145
+ amount: number;
146
+ currency: SE.Currency;
147
+ }, {
148
+ amount: number;
149
+ currency: SE.Currency;
150
+ }>;
151
+ }, "strip", z.ZodTypeAny, {
152
+ countryOfOrigin?: string | undefined;
153
+ description?: string | undefined;
154
+ harmonizedTariffCode?: string | undefined;
155
+ productId?: string | undefined;
156
+ value: {
157
+ amount: number;
158
+ currency: SE.Currency;
159
+ };
160
+ quantity: number;
161
+ }, {
162
+ countryOfOrigin?: string | null | undefined;
163
+ description?: string | null | undefined;
164
+ harmonizedTariffCode?: string | null | undefined;
165
+ productId?: string | null | undefined;
166
+ value: {
167
+ amount: number;
168
+ currency: SE.Currency;
169
+ };
170
+ quantity: number;
171
+ }>, "many">>>;
136
172
  type: z.ZodObject<{
137
173
  carrierId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
138
174
  code: z.ZodNullable<z.ZodOptional<z.ZodString>>;
@@ -191,12 +227,17 @@ export declare const getShipmentSchema: ({ dimensionsUnit, isContentDescriptionR
191
227
  amount: number;
192
228
  currency: SE.Currency;
193
229
  } | undefined;
194
- weight?: SE.WeightWithUnit | undefined;
195
- type: {
196
- code?: string | null | undefined;
197
- carrierId?: string | null | undefined;
198
- };
199
- products: {
230
+ products?: {
231
+ countryOfOrigin?: string | undefined;
232
+ description?: string | undefined;
233
+ harmonizedTariffCode?: string | undefined;
234
+ productId?: string | undefined;
235
+ value: {
236
+ amount: number;
237
+ currency: SE.Currency;
238
+ };
239
+ quantity: number;
240
+ }[] | {
200
241
  countryOfOrigin?: string | undefined;
201
242
  description?: string | undefined;
202
243
  harmonizedTariffCode?: string | undefined;
@@ -206,7 +247,12 @@ export declare const getShipmentSchema: ({ dimensionsUnit, isContentDescriptionR
206
247
  currency: SE.Currency;
207
248
  };
208
249
  quantity: number;
209
- }[];
250
+ }[] | null | undefined;
251
+ weight?: SE.WeightWithUnit | undefined;
252
+ type: {
253
+ code?: string | null | undefined;
254
+ carrierId?: string | null | undefined;
255
+ };
210
256
  }, {
211
257
  contentDescription?: string | null | undefined;
212
258
  dimensions?: {
@@ -222,6 +268,27 @@ export declare const getShipmentSchema: ({ dimensionsUnit, isContentDescriptionR
222
268
  amount: number;
223
269
  currency: SE.Currency;
224
270
  } | undefined;
271
+ products?: {
272
+ countryOfOrigin?: string | null | undefined;
273
+ description?: string | null | undefined;
274
+ harmonizedTariffCode?: string | null | undefined;
275
+ productId?: string | null | undefined;
276
+ value: {
277
+ amount: number;
278
+ currency: SE.Currency;
279
+ };
280
+ quantity: number;
281
+ }[] | {
282
+ countryOfOrigin?: string | null | undefined;
283
+ description?: string | null | undefined;
284
+ harmonizedTariffCode?: string | null | undefined;
285
+ productId?: string | null | undefined;
286
+ value: {
287
+ amount: number;
288
+ currency: SE.Currency;
289
+ };
290
+ quantity: number;
291
+ }[] | null | undefined;
225
292
  weight?: {
226
293
  fractional?: number | null | undefined;
227
294
  whole?: number | null | undefined;
@@ -233,17 +300,6 @@ export declare const getShipmentSchema: ({ dimensionsUnit, isContentDescriptionR
233
300
  code?: string | null | undefined;
234
301
  carrierId?: string | null | undefined;
235
302
  };
236
- products: {
237
- countryOfOrigin?: string | null | undefined;
238
- description?: string | null | undefined;
239
- harmonizedTariffCode?: string | null | undefined;
240
- productId?: string | null | undefined;
241
- value: {
242
- amount: number;
243
- currency: SE.Currency;
244
- };
245
- quantity: number;
246
- }[];
247
303
  }>, "many">;
248
304
  service: z.ZodNullable<z.ZodOptional<z.ZodObject<{
249
305
  carrierId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
@@ -294,12 +350,17 @@ export declare const getShipmentSchema: ({ dimensionsUnit, isContentDescriptionR
294
350
  amount: number;
295
351
  currency: SE.Currency;
296
352
  } | undefined;
297
- weight?: SE.WeightWithUnit | undefined;
298
- type: {
299
- code?: string | null | undefined;
300
- carrierId?: string | null | undefined;
301
- };
302
- products: {
353
+ products?: {
354
+ countryOfOrigin?: string | undefined;
355
+ description?: string | undefined;
356
+ harmonizedTariffCode?: string | undefined;
357
+ productId?: string | undefined;
358
+ value: {
359
+ amount: number;
360
+ currency: SE.Currency;
361
+ };
362
+ quantity: number;
363
+ }[] | {
303
364
  countryOfOrigin?: string | undefined;
304
365
  description?: string | undefined;
305
366
  harmonizedTariffCode?: string | undefined;
@@ -309,7 +370,12 @@ export declare const getShipmentSchema: ({ dimensionsUnit, isContentDescriptionR
309
370
  currency: SE.Currency;
310
371
  };
311
372
  quantity: number;
312
- }[];
373
+ }[] | null | undefined;
374
+ weight?: SE.WeightWithUnit | undefined;
375
+ type: {
376
+ code?: string | null | undefined;
377
+ carrierId?: string | null | undefined;
378
+ };
313
379
  }[];
314
380
  shipDate: string;
315
381
  warehouseId: string;
@@ -345,6 +411,27 @@ export declare const getShipmentSchema: ({ dimensionsUnit, isContentDescriptionR
345
411
  amount: number;
346
412
  currency: SE.Currency;
347
413
  } | undefined;
414
+ products?: {
415
+ countryOfOrigin?: string | null | undefined;
416
+ description?: string | null | undefined;
417
+ harmonizedTariffCode?: string | null | undefined;
418
+ productId?: string | null | undefined;
419
+ value: {
420
+ amount: number;
421
+ currency: SE.Currency;
422
+ };
423
+ quantity: number;
424
+ }[] | {
425
+ countryOfOrigin?: string | null | undefined;
426
+ description?: string | null | undefined;
427
+ harmonizedTariffCode?: string | null | undefined;
428
+ productId?: string | null | undefined;
429
+ value: {
430
+ amount: number;
431
+ currency: SE.Currency;
432
+ };
433
+ quantity: number;
434
+ }[] | null | undefined;
348
435
  weight?: {
349
436
  fractional?: number | null | undefined;
350
437
  whole?: number | null | undefined;
@@ -356,17 +443,6 @@ export declare const getShipmentSchema: ({ dimensionsUnit, isContentDescriptionR
356
443
  code?: string | null | undefined;
357
444
  carrierId?: string | null | undefined;
358
445
  };
359
- products: {
360
- countryOfOrigin?: string | null | undefined;
361
- description?: string | null | undefined;
362
- harmonizedTariffCode?: string | null | undefined;
363
- productId?: string | null | undefined;
364
- value: {
365
- amount: number;
366
- currency: SE.Currency;
367
- };
368
- quantity: number;
369
- }[];
370
446
  }[];
371
447
  shipDate: string;
372
448
  warehouseId: string;
@@ -494,7 +570,43 @@ export declare const getShipmentSchema: ({ dimensionsUnit, isContentDescriptionR
494
570
  currency: SE.Currency;
495
571
  };
496
572
  quantity: number;
497
- }>, "many">;
573
+ }>, "many"> | z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodObject<{
574
+ countryOfOrigin: z.ZodEffects<z.ZodNullable<z.ZodOptional<z.ZodString>>, string | undefined, string | null | undefined>;
575
+ description: z.ZodEffects<z.ZodNullable<z.ZodOptional<z.ZodString>>, string | undefined, string | null | undefined>;
576
+ harmonizedTariffCode: z.ZodEffects<z.ZodNullable<z.ZodOptional<z.ZodString>>, string | undefined, string | null | undefined>;
577
+ productId: z.ZodEffects<z.ZodNullable<z.ZodOptional<z.ZodString>>, string | undefined, string | null | undefined>;
578
+ quantity: z.ZodNumber;
579
+ value: z.ZodObject<{
580
+ amount: z.ZodNumber;
581
+ currency: z.ZodNativeEnum<typeof SE.Currency>;
582
+ }, "strip", z.ZodTypeAny, {
583
+ amount: number;
584
+ currency: SE.Currency;
585
+ }, {
586
+ amount: number;
587
+ currency: SE.Currency;
588
+ }>;
589
+ }, "strip", z.ZodTypeAny, {
590
+ countryOfOrigin?: string | undefined;
591
+ description?: string | undefined;
592
+ harmonizedTariffCode?: string | undefined;
593
+ productId?: string | undefined;
594
+ value: {
595
+ amount: number;
596
+ currency: SE.Currency;
597
+ };
598
+ quantity: number;
599
+ }, {
600
+ countryOfOrigin?: string | null | undefined;
601
+ description?: string | null | undefined;
602
+ harmonizedTariffCode?: string | null | undefined;
603
+ productId?: string | null | undefined;
604
+ value: {
605
+ amount: number;
606
+ currency: SE.Currency;
607
+ };
608
+ quantity: number;
609
+ }>, "many">>>;
498
610
  type: z.ZodObject<{
499
611
  carrierId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
500
612
  code: z.ZodNullable<z.ZodOptional<z.ZodString>>;
@@ -553,12 +665,17 @@ export declare const getShipmentSchema: ({ dimensionsUnit, isContentDescriptionR
553
665
  amount: number;
554
666
  currency: SE.Currency;
555
667
  } | undefined;
556
- weight?: SE.WeightWithUnit | undefined;
557
- type: {
558
- code?: string | null | undefined;
559
- carrierId?: string | null | undefined;
560
- };
561
- products: {
668
+ products?: {
669
+ countryOfOrigin?: string | undefined;
670
+ description?: string | undefined;
671
+ harmonizedTariffCode?: string | undefined;
672
+ productId?: string | undefined;
673
+ value: {
674
+ amount: number;
675
+ currency: SE.Currency;
676
+ };
677
+ quantity: number;
678
+ }[] | {
562
679
  countryOfOrigin?: string | undefined;
563
680
  description?: string | undefined;
564
681
  harmonizedTariffCode?: string | undefined;
@@ -568,7 +685,12 @@ export declare const getShipmentSchema: ({ dimensionsUnit, isContentDescriptionR
568
685
  currency: SE.Currency;
569
686
  };
570
687
  quantity: number;
571
- }[];
688
+ }[] | null | undefined;
689
+ weight?: SE.WeightWithUnit | undefined;
690
+ type: {
691
+ code?: string | null | undefined;
692
+ carrierId?: string | null | undefined;
693
+ };
572
694
  }, {
573
695
  contentDescription?: string | null | undefined;
574
696
  dimensions?: {
@@ -584,6 +706,27 @@ export declare const getShipmentSchema: ({ dimensionsUnit, isContentDescriptionR
584
706
  amount: number;
585
707
  currency: SE.Currency;
586
708
  } | undefined;
709
+ products?: {
710
+ countryOfOrigin?: string | null | undefined;
711
+ description?: string | null | undefined;
712
+ harmonizedTariffCode?: string | null | undefined;
713
+ productId?: string | null | undefined;
714
+ value: {
715
+ amount: number;
716
+ currency: SE.Currency;
717
+ };
718
+ quantity: number;
719
+ }[] | {
720
+ countryOfOrigin?: string | null | undefined;
721
+ description?: string | null | undefined;
722
+ harmonizedTariffCode?: string | null | undefined;
723
+ productId?: string | null | undefined;
724
+ value: {
725
+ amount: number;
726
+ currency: SE.Currency;
727
+ };
728
+ quantity: number;
729
+ }[] | null | undefined;
587
730
  weight?: {
588
731
  fractional?: number | null | undefined;
589
732
  whole?: number | null | undefined;
@@ -595,17 +738,6 @@ export declare const getShipmentSchema: ({ dimensionsUnit, isContentDescriptionR
595
738
  code?: string | null | undefined;
596
739
  carrierId?: string | null | undefined;
597
740
  };
598
- products: {
599
- countryOfOrigin?: string | null | undefined;
600
- description?: string | null | undefined;
601
- harmonizedTariffCode?: string | null | undefined;
602
- productId?: string | null | undefined;
603
- value: {
604
- amount: number;
605
- currency: SE.Currency;
606
- };
607
- quantity: number;
608
- }[];
609
741
  }>, "many">;
610
742
  service: z.ZodNullable<z.ZodOptional<z.ZodObject<{
611
743
  carrierId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
@@ -725,7 +857,43 @@ export declare const getShipmentSchema: ({ dimensionsUnit, isContentDescriptionR
725
857
  currency: SE.Currency;
726
858
  };
727
859
  quantity: number;
728
- }>, "many">;
860
+ }>, "many"> | z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodObject<{
861
+ countryOfOrigin: z.ZodEffects<z.ZodNullable<z.ZodOptional<z.ZodString>>, string | undefined, string | null | undefined>;
862
+ description: z.ZodEffects<z.ZodNullable<z.ZodOptional<z.ZodString>>, string | undefined, string | null | undefined>;
863
+ harmonizedTariffCode: z.ZodEffects<z.ZodNullable<z.ZodOptional<z.ZodString>>, string | undefined, string | null | undefined>;
864
+ productId: z.ZodEffects<z.ZodNullable<z.ZodOptional<z.ZodString>>, string | undefined, string | null | undefined>;
865
+ quantity: z.ZodNumber;
866
+ value: z.ZodObject<{
867
+ amount: z.ZodNumber;
868
+ currency: z.ZodNativeEnum<typeof SE.Currency>;
869
+ }, "strip", z.ZodTypeAny, {
870
+ amount: number;
871
+ currency: SE.Currency;
872
+ }, {
873
+ amount: number;
874
+ currency: SE.Currency;
875
+ }>;
876
+ }, "strip", z.ZodTypeAny, {
877
+ countryOfOrigin?: string | undefined;
878
+ description?: string | undefined;
879
+ harmonizedTariffCode?: string | undefined;
880
+ productId?: string | undefined;
881
+ value: {
882
+ amount: number;
883
+ currency: SE.Currency;
884
+ };
885
+ quantity: number;
886
+ }, {
887
+ countryOfOrigin?: string | null | undefined;
888
+ description?: string | null | undefined;
889
+ harmonizedTariffCode?: string | null | undefined;
890
+ productId?: string | null | undefined;
891
+ value: {
892
+ amount: number;
893
+ currency: SE.Currency;
894
+ };
895
+ quantity: number;
896
+ }>, "many">>>;
729
897
  type: z.ZodObject<{
730
898
  carrierId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
731
899
  code: z.ZodNullable<z.ZodOptional<z.ZodString>>;
@@ -820,12 +988,7 @@ export declare const getShipmentSchema: ({ dimensionsUnit, isContentDescriptionR
820
988
  amount: number;
821
989
  currency: SE.Currency;
822
990
  } | undefined;
823
- weight?: SE.WeightWithUnit | undefined;
824
- type: {
825
- code?: string | null | undefined;
826
- carrierId?: string | null | undefined;
827
- };
828
- products: {
991
+ products?: {
829
992
  countryOfOrigin?: string | undefined;
830
993
  description?: string | undefined;
831
994
  harmonizedTariffCode?: string | undefined;
@@ -835,7 +998,22 @@ export declare const getShipmentSchema: ({ dimensionsUnit, isContentDescriptionR
835
998
  currency: SE.Currency;
836
999
  };
837
1000
  quantity: number;
838
- }[];
1001
+ }[] | {
1002
+ countryOfOrigin?: string | undefined;
1003
+ description?: string | undefined;
1004
+ harmonizedTariffCode?: string | undefined;
1005
+ productId?: string | undefined;
1006
+ value: {
1007
+ amount: number;
1008
+ currency: SE.Currency;
1009
+ };
1010
+ quantity: number;
1011
+ }[] | null | undefined;
1012
+ weight?: SE.WeightWithUnit | undefined;
1013
+ type: {
1014
+ code?: string | null | undefined;
1015
+ carrierId?: string | null | undefined;
1016
+ };
839
1017
  }, {
840
1018
  contentDescription?: string | null | undefined;
841
1019
  dimensions?: {
@@ -847,6 +1025,27 @@ export declare const getShipmentSchema: ({ dimensionsUnit, isContentDescriptionR
847
1025
  amount: number;
848
1026
  currency: SE.Currency;
849
1027
  } | undefined;
1028
+ products?: {
1029
+ countryOfOrigin?: string | null | undefined;
1030
+ description?: string | null | undefined;
1031
+ harmonizedTariffCode?: string | null | undefined;
1032
+ productId?: string | null | undefined;
1033
+ value: {
1034
+ amount: number;
1035
+ currency: SE.Currency;
1036
+ };
1037
+ quantity: number;
1038
+ }[] | {
1039
+ countryOfOrigin?: string | null | undefined;
1040
+ description?: string | null | undefined;
1041
+ harmonizedTariffCode?: string | null | undefined;
1042
+ productId?: string | null | undefined;
1043
+ value: {
1044
+ amount: number;
1045
+ currency: SE.Currency;
1046
+ };
1047
+ quantity: number;
1048
+ }[] | null | undefined;
850
1049
  weight?: {
851
1050
  fractional?: number | null | undefined;
852
1051
  whole?: number | null | undefined;
@@ -858,17 +1057,6 @@ export declare const getShipmentSchema: ({ dimensionsUnit, isContentDescriptionR
858
1057
  code?: string | null | undefined;
859
1058
  carrierId?: string | null | undefined;
860
1059
  };
861
- products: {
862
- countryOfOrigin?: string | null | undefined;
863
- description?: string | null | undefined;
864
- harmonizedTariffCode?: string | null | undefined;
865
- productId?: string | null | undefined;
866
- value: {
867
- amount: number;
868
- currency: SE.Currency;
869
- };
870
- quantity: number;
871
- }[];
872
1060
  }>, "many">;
873
1061
  service: z.ZodObject<{
874
1062
  carrierId: z.ZodString;
@@ -910,12 +1098,17 @@ export declare const getShipmentSchema: ({ dimensionsUnit, isContentDescriptionR
910
1098
  amount: number;
911
1099
  currency: SE.Currency;
912
1100
  } | undefined;
913
- weight?: SE.WeightWithUnit | undefined;
914
- type: {
915
- code?: string | null | undefined;
916
- carrierId?: string | null | undefined;
917
- };
918
- products: {
1101
+ products?: {
1102
+ countryOfOrigin?: string | undefined;
1103
+ description?: string | undefined;
1104
+ harmonizedTariffCode?: string | undefined;
1105
+ productId?: string | undefined;
1106
+ value: {
1107
+ amount: number;
1108
+ currency: SE.Currency;
1109
+ };
1110
+ quantity: number;
1111
+ }[] | {
919
1112
  countryOfOrigin?: string | undefined;
920
1113
  description?: string | undefined;
921
1114
  harmonizedTariffCode?: string | undefined;
@@ -925,7 +1118,12 @@ export declare const getShipmentSchema: ({ dimensionsUnit, isContentDescriptionR
925
1118
  currency: SE.Currency;
926
1119
  };
927
1120
  quantity: number;
928
- }[];
1121
+ }[] | null | undefined;
1122
+ weight?: SE.WeightWithUnit | undefined;
1123
+ type: {
1124
+ code?: string | null | undefined;
1125
+ carrierId?: string | null | undefined;
1126
+ };
929
1127
  }[];
930
1128
  service: {
931
1129
  carrierId: string;
@@ -957,6 +1155,27 @@ export declare const getShipmentSchema: ({ dimensionsUnit, isContentDescriptionR
957
1155
  amount: number;
958
1156
  currency: SE.Currency;
959
1157
  } | undefined;
1158
+ products?: {
1159
+ countryOfOrigin?: string | null | undefined;
1160
+ description?: string | null | undefined;
1161
+ harmonizedTariffCode?: string | null | undefined;
1162
+ productId?: string | null | undefined;
1163
+ value: {
1164
+ amount: number;
1165
+ currency: SE.Currency;
1166
+ };
1167
+ quantity: number;
1168
+ }[] | {
1169
+ countryOfOrigin?: string | null | undefined;
1170
+ description?: string | null | undefined;
1171
+ harmonizedTariffCode?: string | null | undefined;
1172
+ productId?: string | null | undefined;
1173
+ value: {
1174
+ amount: number;
1175
+ currency: SE.Currency;
1176
+ };
1177
+ quantity: number;
1178
+ }[] | null | undefined;
960
1179
  weight?: {
961
1180
  fractional?: number | null | undefined;
962
1181
  whole?: number | null | undefined;
@@ -968,17 +1187,6 @@ export declare const getShipmentSchema: ({ dimensionsUnit, isContentDescriptionR
968
1187
  code?: string | null | undefined;
969
1188
  carrierId?: string | null | undefined;
970
1189
  };
971
- products: {
972
- countryOfOrigin?: string | null | undefined;
973
- description?: string | null | undefined;
974
- harmonizedTariffCode?: string | null | undefined;
975
- productId?: string | null | undefined;
976
- value: {
977
- amount: number;
978
- currency: SE.Currency;
979
- };
980
- quantity: number;
981
- }[];
982
1190
  }[];
983
1191
  service: {
984
1192
  carrierId: string;
@@ -993,6 +1201,17 @@ export declare const getShipmentSchema: ({ dimensionsUnit, isContentDescriptionR
993
1201
  nonDelivery: SE.CustomsNonDeliveryType;
994
1202
  } | null | undefined;
995
1203
  packages: ({
1204
+ products: {
1205
+ countryOfOrigin?: string | undefined;
1206
+ description?: string | undefined;
1207
+ harmonizedTariffCode?: string | undefined;
1208
+ productId?: string | undefined;
1209
+ value: {
1210
+ amount: number;
1211
+ currency: SE.Currency;
1212
+ };
1213
+ quantity: number;
1214
+ }[] | null | undefined;
996
1215
  dimensions: {
997
1216
  unit: SE.DimensionUnit;
998
1217
  girth?: number | undefined;
@@ -1014,6 +1233,7 @@ export declare const getShipmentSchema: ({ dimensionsUnit, isContentDescriptionR
1014
1233
  amount: number;
1015
1234
  currency: SE.Currency;
1016
1235
  } | undefined;
1236
+ } | {
1017
1237
  products: {
1018
1238
  countryOfOrigin?: string | undefined;
1019
1239
  description?: string | undefined;
@@ -1024,8 +1244,7 @@ export declare const getShipmentSchema: ({ dimensionsUnit, isContentDescriptionR
1024
1244
  currency: SE.Currency;
1025
1245
  };
1026
1246
  quantity: number;
1027
- }[];
1028
- } | {
1247
+ }[] | null | undefined;
1029
1248
  packageId: string | null | undefined;
1030
1249
  weight?: {
1031
1250
  unit: string;
@@ -1036,6 +1255,7 @@ export declare const getShipmentSchema: ({ dimensionsUnit, isContentDescriptionR
1036
1255
  amount: number;
1037
1256
  currency: SE.Currency;
1038
1257
  } | undefined;
1258
+ } | {
1039
1259
  products: {
1040
1260
  countryOfOrigin?: string | undefined;
1041
1261
  description?: string | undefined;
@@ -1046,8 +1266,7 @@ export declare const getShipmentSchema: ({ dimensionsUnit, isContentDescriptionR
1046
1266
  currency: SE.Currency;
1047
1267
  };
1048
1268
  quantity: number;
1049
- }[];
1050
- } | {
1269
+ }[] | null | undefined;
1051
1270
  dimensions: {
1052
1271
  unit: SE.DimensionUnit;
1053
1272
  girth?: number | undefined;
@@ -1069,6 +1288,7 @@ export declare const getShipmentSchema: ({ dimensionsUnit, isContentDescriptionR
1069
1288
  amount: number;
1070
1289
  currency: SE.Currency;
1071
1290
  } | undefined;
1291
+ } | {
1072
1292
  products: {
1073
1293
  countryOfOrigin?: string | undefined;
1074
1294
  description?: string | undefined;
@@ -1079,8 +1299,7 @@ export declare const getShipmentSchema: ({ dimensionsUnit, isContentDescriptionR
1079
1299
  currency: SE.Currency;
1080
1300
  };
1081
1301
  quantity: number;
1082
- }[];
1083
- } | {
1302
+ }[] | null | undefined;
1084
1303
  packageId: string | null | undefined;
1085
1304
  weight?: {
1086
1305
  unit: string;
@@ -1091,17 +1310,6 @@ export declare const getShipmentSchema: ({ dimensionsUnit, isContentDescriptionR
1091
1310
  amount: number;
1092
1311
  currency: SE.Currency;
1093
1312
  } | undefined;
1094
- products: {
1095
- countryOfOrigin?: string | undefined;
1096
- description?: string | undefined;
1097
- harmonizedTariffCode?: string | undefined;
1098
- productId?: string | undefined;
1099
- value: {
1100
- amount: number;
1101
- currency: SE.Currency;
1102
- };
1103
- quantity: number;
1104
- }[];
1105
1313
  })[];
1106
1314
  serviceCode: string | undefined;
1107
1315
  advancedOptions?: {
@@ -1120,6 +1328,17 @@ export declare const getShipmentSchema: ({ dimensionsUnit, isContentDescriptionR
1120
1328
  nonDelivery: SE.CustomsNonDeliveryType;
1121
1329
  } | null | undefined;
1122
1330
  packages: ({
1331
+ products: {
1332
+ countryOfOrigin?: string | undefined;
1333
+ description?: string | undefined;
1334
+ harmonizedTariffCode?: string | undefined;
1335
+ productId?: string | undefined;
1336
+ value: {
1337
+ amount: number;
1338
+ currency: SE.Currency;
1339
+ };
1340
+ quantity: number;
1341
+ }[] | null | undefined;
1123
1342
  dimensions: {
1124
1343
  unit: SE.DimensionUnit;
1125
1344
  girth?: number | undefined;
@@ -1141,6 +1360,7 @@ export declare const getShipmentSchema: ({ dimensionsUnit, isContentDescriptionR
1141
1360
  amount: number;
1142
1361
  currency: SE.Currency;
1143
1362
  } | undefined;
1363
+ } | {
1144
1364
  products: {
1145
1365
  countryOfOrigin?: string | undefined;
1146
1366
  description?: string | undefined;
@@ -1151,8 +1371,7 @@ export declare const getShipmentSchema: ({ dimensionsUnit, isContentDescriptionR
1151
1371
  currency: SE.Currency;
1152
1372
  };
1153
1373
  quantity: number;
1154
- }[];
1155
- } | {
1374
+ }[] | null | undefined;
1156
1375
  packageId: string | null | undefined;
1157
1376
  weight?: {
1158
1377
  unit: string;
@@ -1163,6 +1382,7 @@ export declare const getShipmentSchema: ({ dimensionsUnit, isContentDescriptionR
1163
1382
  amount: number;
1164
1383
  currency: SE.Currency;
1165
1384
  } | undefined;
1385
+ } | {
1166
1386
  products: {
1167
1387
  countryOfOrigin?: string | undefined;
1168
1388
  description?: string | undefined;
@@ -1173,8 +1393,7 @@ export declare const getShipmentSchema: ({ dimensionsUnit, isContentDescriptionR
1173
1393
  currency: SE.Currency;
1174
1394
  };
1175
1395
  quantity: number;
1176
- }[];
1177
- } | {
1396
+ }[] | null | undefined;
1178
1397
  dimensions: {
1179
1398
  unit: SE.DimensionUnit;
1180
1399
  girth?: number | undefined;
@@ -1196,6 +1415,7 @@ export declare const getShipmentSchema: ({ dimensionsUnit, isContentDescriptionR
1196
1415
  amount: number;
1197
1416
  currency: SE.Currency;
1198
1417
  } | undefined;
1418
+ } | {
1199
1419
  products: {
1200
1420
  countryOfOrigin?: string | undefined;
1201
1421
  description?: string | undefined;
@@ -1206,8 +1426,7 @@ export declare const getShipmentSchema: ({ dimensionsUnit, isContentDescriptionR
1206
1426
  currency: SE.Currency;
1207
1427
  };
1208
1428
  quantity: number;
1209
- }[];
1210
- } | {
1429
+ }[] | null | undefined;
1211
1430
  packageId: string | null | undefined;
1212
1431
  weight?: {
1213
1432
  unit: string;
@@ -1218,17 +1437,6 @@ export declare const getShipmentSchema: ({ dimensionsUnit, isContentDescriptionR
1218
1437
  amount: number;
1219
1438
  currency: SE.Currency;
1220
1439
  } | undefined;
1221
- products: {
1222
- countryOfOrigin?: string | undefined;
1223
- description?: string | undefined;
1224
- harmonizedTariffCode?: string | undefined;
1225
- productId?: string | undefined;
1226
- value: {
1227
- amount: number;
1228
- currency: SE.Currency;
1229
- };
1230
- quantity: number;
1231
- }[];
1232
1440
  })[];
1233
1441
  serviceCode: string | undefined;
1234
1442
  advancedOptions?: {
@@ -1272,6 +1480,27 @@ export declare const getShipmentSchema: ({ dimensionsUnit, isContentDescriptionR
1272
1480
  amount: number;
1273
1481
  currency: SE.Currency;
1274
1482
  } | undefined;
1483
+ products?: {
1484
+ countryOfOrigin?: string | null | undefined;
1485
+ description?: string | null | undefined;
1486
+ harmonizedTariffCode?: string | null | undefined;
1487
+ productId?: string | null | undefined;
1488
+ value: {
1489
+ amount: number;
1490
+ currency: SE.Currency;
1491
+ };
1492
+ quantity: number;
1493
+ }[] | {
1494
+ countryOfOrigin?: string | null | undefined;
1495
+ description?: string | null | undefined;
1496
+ harmonizedTariffCode?: string | null | undefined;
1497
+ productId?: string | null | undefined;
1498
+ value: {
1499
+ amount: number;
1500
+ currency: SE.Currency;
1501
+ };
1502
+ quantity: number;
1503
+ }[] | null | undefined;
1275
1504
  weight?: {
1276
1505
  fractional?: number | null | undefined;
1277
1506
  whole?: number | null | undefined;
@@ -1283,17 +1512,6 @@ export declare const getShipmentSchema: ({ dimensionsUnit, isContentDescriptionR
1283
1512
  code?: string | null | undefined;
1284
1513
  carrierId?: string | null | undefined;
1285
1514
  };
1286
- products: {
1287
- countryOfOrigin?: string | null | undefined;
1288
- description?: string | null | undefined;
1289
- harmonizedTariffCode?: string | null | undefined;
1290
- productId?: string | null | undefined;
1291
- value: {
1292
- amount: number;
1293
- currency: SE.Currency;
1294
- };
1295
- quantity: number;
1296
- }[];
1297
1515
  }[];
1298
1516
  shipDate: string;
1299
1517
  warehouseId: string;
@@ -1321,6 +1539,27 @@ export declare const getShipmentSchema: ({ dimensionsUnit, isContentDescriptionR
1321
1539
  amount: number;
1322
1540
  currency: SE.Currency;
1323
1541
  } | undefined;
1542
+ products?: {
1543
+ countryOfOrigin?: string | null | undefined;
1544
+ description?: string | null | undefined;
1545
+ harmonizedTariffCode?: string | null | undefined;
1546
+ productId?: string | null | undefined;
1547
+ value: {
1548
+ amount: number;
1549
+ currency: SE.Currency;
1550
+ };
1551
+ quantity: number;
1552
+ }[] | {
1553
+ countryOfOrigin?: string | null | undefined;
1554
+ description?: string | null | undefined;
1555
+ harmonizedTariffCode?: string | null | undefined;
1556
+ productId?: string | null | undefined;
1557
+ value: {
1558
+ amount: number;
1559
+ currency: SE.Currency;
1560
+ };
1561
+ quantity: number;
1562
+ }[] | null | undefined;
1324
1563
  weight?: {
1325
1564
  fractional?: number | null | undefined;
1326
1565
  whole?: number | null | undefined;
@@ -1332,17 +1571,6 @@ export declare const getShipmentSchema: ({ dimensionsUnit, isContentDescriptionR
1332
1571
  code?: string | null | undefined;
1333
1572
  carrierId?: string | null | undefined;
1334
1573
  };
1335
- products: {
1336
- countryOfOrigin?: string | null | undefined;
1337
- description?: string | null | undefined;
1338
- harmonizedTariffCode?: string | null | undefined;
1339
- productId?: string | null | undefined;
1340
- value: {
1341
- amount: number;
1342
- currency: SE.Currency;
1343
- };
1344
- quantity: number;
1345
- }[];
1346
1574
  }[];
1347
1575
  service: {
1348
1576
  carrierId: string;