@shippo/shippo-mcp 0.8.34 → 0.8.43

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 (74) hide show
  1. package/bin/mcp-server.js +175 -71
  2. package/bin/mcp-server.js.map +18 -18
  3. package/esm/funcs/batchesCreate.d.ts +9 -0
  4. package/esm/funcs/batchesCreate.d.ts.map +1 -1
  5. package/esm/funcs/batchesCreate.js +9 -0
  6. package/esm/funcs/batchesCreate.js.map +1 -1
  7. package/esm/funcs/batchesGet.d.ts +5 -4
  8. package/esm/funcs/batchesGet.d.ts.map +1 -1
  9. package/esm/funcs/batchesGet.js +5 -4
  10. package/esm/funcs/batchesGet.js.map +1 -1
  11. package/esm/lib/config.d.ts +2 -2
  12. package/esm/lib/config.js +2 -2
  13. package/esm/mcp-server/mcp-server.js +1 -1
  14. package/esm/mcp-server/server.js +1 -1
  15. package/esm/mcp-server/tools/batchesCreate.d.ts.map +1 -1
  16. package/esm/mcp-server/tools/batchesCreate.js +11 -1
  17. package/esm/mcp-server/tools/batchesCreate.js.map +1 -1
  18. package/esm/mcp-server/tools/batchesGet.d.ts.map +1 -1
  19. package/esm/mcp-server/tools/batchesGet.js +6 -4
  20. package/esm/mcp-server/tools/batchesGet.js.map +1 -1
  21. package/esm/models/defaultparceltemplate.d.ts +25 -6
  22. package/esm/models/defaultparceltemplate.d.ts.map +1 -1
  23. package/esm/models/defaultparceltemplate.js +37 -7
  24. package/esm/models/defaultparceltemplate.js.map +1 -1
  25. package/esm/models/order.d.ts +39 -11
  26. package/esm/models/order.d.ts.map +1 -1
  27. package/esm/models/order.js +36 -11
  28. package/esm/models/order.js.map +1 -1
  29. package/esm/models/ordercreaterequest.d.ts +10 -10
  30. package/esm/models/ordercreaterequest.d.ts.map +1 -1
  31. package/esm/models/ordercreaterequest.js +10 -10
  32. package/esm/models/ordercreaterequest.js.map +1 -1
  33. package/esm/models/servicegroup.d.ts +1 -1
  34. package/esm/models/servicegroup.d.ts.map +1 -1
  35. package/esm/models/servicegroup.js +1 -1
  36. package/esm/models/servicegroup.js.map +1 -1
  37. package/esm/models/servicegroupcreaterequest.d.ts +1 -1
  38. package/esm/models/servicegroupcreaterequest.d.ts.map +1 -1
  39. package/esm/models/servicegroupcreaterequest.js +1 -1
  40. package/esm/models/servicegroupcreaterequest.js.map +1 -1
  41. package/esm/models/servicegroupupdaterequest.d.ts +1 -1
  42. package/esm/models/servicegroupupdaterequest.d.ts.map +1 -1
  43. package/esm/models/servicegroupupdaterequest.js +1 -1
  44. package/esm/models/servicegroupupdaterequest.js.map +1 -1
  45. package/esm/models/userparceltemplate.d.ts +25 -6
  46. package/esm/models/userparceltemplate.d.ts.map +1 -1
  47. package/esm/models/userparceltemplate.js +36 -7
  48. package/esm/models/userparceltemplate.js.map +1 -1
  49. package/esm/models/userparceltemplateupdaterequest.d.ts +17 -9
  50. package/esm/models/userparceltemplateupdaterequest.d.ts.map +1 -1
  51. package/esm/models/userparceltemplateupdaterequest.js +29 -9
  52. package/esm/models/userparceltemplateupdaterequest.js.map +1 -1
  53. package/esm/models/userparceltemplatewithoutcarriertemplatecreaterequest.d.ts +17 -9
  54. package/esm/models/userparceltemplatewithoutcarriertemplatecreaterequest.d.ts.map +1 -1
  55. package/esm/models/userparceltemplatewithoutcarriertemplatecreaterequest.js +29 -9
  56. package/esm/models/userparceltemplatewithoutcarriertemplatecreaterequest.js.map +1 -1
  57. package/manifest.json +3 -3
  58. package/package.json +1 -1
  59. package/src/funcs/batchesCreate.ts +9 -0
  60. package/src/funcs/batchesGet.ts +5 -4
  61. package/src/lib/config.ts +2 -2
  62. package/src/mcp-server/mcp-server.ts +1 -1
  63. package/src/mcp-server/server.ts +1 -1
  64. package/src/mcp-server/tools/batchesCreate.ts +11 -1
  65. package/src/mcp-server/tools/batchesGet.ts +6 -4
  66. package/src/models/defaultparceltemplate.ts +81 -21
  67. package/src/models/order.ts +84 -22
  68. package/src/models/ordercreaterequest.ts +20 -20
  69. package/src/models/servicegroup.ts +2 -2
  70. package/src/models/servicegroupcreaterequest.ts +2 -2
  71. package/src/models/servicegroupupdaterequest.ts +2 -2
  72. package/src/models/userparceltemplate.ts +80 -21
  73. package/src/models/userparceltemplateupdaterequest.ts +51 -19
  74. package/src/models/userparceltemplatewithoutcarriertemplatecreaterequest.ts +57 -19
@@ -3,29 +3,85 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod";
6
- import {
7
- CarrierParcelTemplate,
8
- CarrierParcelTemplate$zodSchema,
9
- } from "./carrierparceltemplate.js";
10
6
  import {
11
7
  DistanceUnitEnum,
12
8
  DistanceUnitEnum$zodSchema,
13
9
  } from "./distanceunitenum.js";
14
- import { WeightUnitEnum, WeightUnitEnum$zodSchema } from "./weightunitenum.js";
10
+
11
+ /**
12
+ * The measure unit used for length, width and height.
13
+ */
14
+ export const DefaultParcelTemplateDistanceUnitEnum$zodSchema = z.enum([
15
+ "cm",
16
+ "in",
17
+ "ft",
18
+ "m",
19
+ "mm",
20
+ "yd",
21
+ ]).describe("The measure unit used for length, width and height.");
22
+
23
+ export type DefaultParcelTemplateDistanceUnitEnum = z.infer<
24
+ typeof DefaultParcelTemplateDistanceUnitEnum$zodSchema
25
+ >;
26
+
27
+ /**
28
+ * The unit used for weight.
29
+ */
30
+ export const DefaultParcelTemplateWeightUnitEnum$zodSchema = z.enum([
31
+ "g",
32
+ "kg",
33
+ "lb",
34
+ "oz",
35
+ ]).describe("The unit used for weight.");
36
+
37
+ export type DefaultParcelTemplateWeightUnitEnum = z.infer<
38
+ typeof DefaultParcelTemplateWeightUnitEnum$zodSchema
39
+ >;
40
+
41
+ export type DefaultParcelTemplateCarrierParcelTemplateRepresentsTheFieldsOfATemplateBeforeSavingItToTheDb =
42
+ {
43
+ carrier?: string | undefined;
44
+ distance_unit?: DistanceUnitEnum | undefined;
45
+ height?: string | undefined;
46
+ is_variable_dimensions?: boolean | undefined;
47
+ length?: string | undefined;
48
+ name?: string | undefined;
49
+ token?: string | undefined;
50
+ width?: string | undefined;
51
+ };
52
+
53
+ export const DefaultParcelTemplateCarrierParcelTemplateRepresentsTheFieldsOfATemplateBeforeSavingItToTheDb$zodSchema:
54
+ z.ZodType<
55
+ DefaultParcelTemplateCarrierParcelTemplateRepresentsTheFieldsOfATemplateBeforeSavingItToTheDb,
56
+ z.ZodTypeDef,
57
+ unknown
58
+ > = z.object({
59
+ carrier: z.string().optional(),
60
+ distance_unit: DistanceUnitEnum$zodSchema.optional(),
61
+ height: z.string().optional(),
62
+ is_variable_dimensions: z.boolean().optional(),
63
+ length: z.string().optional(),
64
+ name: z.string().optional(),
65
+ token: z.string().optional(),
66
+ width: z.string().optional(),
67
+ });
15
68
 
16
69
  export type TheFieldsOfAParcelTemplateBeforeSavingItToTheDb = {
17
- distance_unit?: DistanceUnitEnum | undefined;
18
- height?: string | undefined;
19
- length?: string | undefined;
20
- name?: string | undefined;
21
- weight?: string | undefined;
22
- weight_unit?: WeightUnitEnum | undefined;
23
- width?: string | undefined;
70
+ distance_unit?: DefaultParcelTemplateDistanceUnitEnum | null | undefined;
71
+ height?: string | null | undefined;
72
+ length?: string | null | undefined;
73
+ name?: string | null | undefined;
74
+ weight?: string | null | undefined;
75
+ weight_unit?: DefaultParcelTemplateWeightUnitEnum | null | undefined;
76
+ width?: string | null | undefined;
24
77
  object_created?: string | undefined;
25
78
  object_id?: string | undefined;
26
79
  object_owner?: string | undefined;
27
80
  object_updated?: string | undefined;
28
- template?: CarrierParcelTemplate | undefined;
81
+ template?:
82
+ | DefaultParcelTemplateCarrierParcelTemplateRepresentsTheFieldsOfATemplateBeforeSavingItToTheDb
83
+ | null
84
+ | undefined;
29
85
  };
30
86
 
31
87
  export const TheFieldsOfAParcelTemplateBeforeSavingItToTheDb$zodSchema:
@@ -34,18 +90,22 @@ export const TheFieldsOfAParcelTemplateBeforeSavingItToTheDb$zodSchema:
34
90
  z.ZodTypeDef,
35
91
  unknown
36
92
  > = z.object({
37
- distance_unit: DistanceUnitEnum$zodSchema.optional(),
38
- height: z.string().optional(),
39
- length: z.string().optional(),
40
- name: z.string().optional(),
93
+ distance_unit: DefaultParcelTemplateDistanceUnitEnum$zodSchema.nullable()
94
+ .optional(),
95
+ height: z.string().nullable().optional(),
96
+ length: z.string().nullable().optional(),
97
+ name: z.string().nullable().optional(),
41
98
  object_created: z.string().optional(),
42
99
  object_id: z.string().optional(),
43
100
  object_owner: z.string().optional(),
44
101
  object_updated: z.string().optional(),
45
- template: CarrierParcelTemplate$zodSchema.optional(),
46
- weight: z.string().optional(),
47
- weight_unit: WeightUnitEnum$zodSchema.optional(),
48
- width: z.string().optional(),
102
+ template: z.lazy(() =>
103
+ DefaultParcelTemplateCarrierParcelTemplateRepresentsTheFieldsOfATemplateBeforeSavingItToTheDb$zodSchema
104
+ ).nullable().optional(),
105
+ weight: z.string().nullable().optional(),
106
+ weight_unit: DefaultParcelTemplateWeightUnitEnum$zodSchema.nullable()
107
+ .optional(),
108
+ width: z.string().nullable().optional(),
49
109
  });
50
110
 
51
111
  export type DefaultParcelTemplate = {
@@ -4,6 +4,10 @@
4
4
 
5
5
  import * as z from "zod";
6
6
  import { Address, Address$zodSchema } from "./address.js";
7
+ import {
8
+ AddressValidationResults,
9
+ AddressValidationResults$zodSchema,
10
+ } from "./addressvalidationresults.js";
7
11
  import { LineItem, LineItem$zodSchema } from "./lineitem.js";
8
12
  import {
9
13
  OrderShopAppEnum,
@@ -15,6 +19,63 @@ import {
15
19
  } from "./orderstatusenum.js";
16
20
  import { WeightUnitEnum, WeightUnitEnum$zodSchema } from "./weightunitenum.js";
17
21
 
22
+ /**
23
+ * <a href="#tag/Addresses">Address</a> object of the sender / seller. Will be returned expanded by default.
24
+ */
25
+ export type OrderAddressFrom = {
26
+ name?: string | undefined;
27
+ company?: string | undefined;
28
+ street1?: string | undefined;
29
+ street2?: string | undefined;
30
+ street3?: string | undefined;
31
+ street_no?: string | undefined;
32
+ city?: string | undefined;
33
+ state?: string | undefined;
34
+ zip?: string | undefined;
35
+ country: string;
36
+ phone?: string | undefined;
37
+ email?: string | undefined;
38
+ is_residential?: boolean | null | undefined;
39
+ metadata?: string | undefined;
40
+ is_complete?: boolean | undefined;
41
+ object_created?: string | undefined;
42
+ object_id?: string | undefined;
43
+ object_owner?: string | undefined;
44
+ object_updated?: string | undefined;
45
+ validation_results?: AddressValidationResults | undefined;
46
+ test?: boolean | null | undefined;
47
+ };
48
+
49
+ export const OrderAddressFrom$zodSchema: z.ZodType<
50
+ OrderAddressFrom,
51
+ z.ZodTypeDef,
52
+ unknown
53
+ > = z.object({
54
+ city: z.string().optional(),
55
+ company: z.string().optional(),
56
+ country: z.string(),
57
+ email: z.string().optional(),
58
+ is_complete: z.boolean().optional(),
59
+ is_residential: z.boolean().nullable().optional(),
60
+ metadata: z.string().optional(),
61
+ name: z.string().optional(),
62
+ object_created: z.string().datetime({ offset: true }).optional(),
63
+ object_id: z.string().optional(),
64
+ object_owner: z.string().optional(),
65
+ object_updated: z.string().datetime({ offset: true }).optional(),
66
+ phone: z.string().optional(),
67
+ state: z.string().optional(),
68
+ street1: z.string().optional(),
69
+ street2: z.string().optional(),
70
+ street3: z.string().optional(),
71
+ street_no: z.string().optional(),
72
+ test: z.boolean().nullable().optional(),
73
+ validation_results: AddressValidationResults$zodSchema.optional(),
74
+ zip: z.string().optional(),
75
+ }).describe(
76
+ "<a href=\"#tag/Addresses\">Address</a> object of the sender / seller. Will be returned expanded by default.",
77
+ );
78
+
18
79
  export type OrderTransaction = {};
19
80
 
20
81
  export const OrderTransaction$zodSchema: z.ZodType<
@@ -24,20 +85,20 @@ export const OrderTransaction$zodSchema: z.ZodType<
24
85
  > = z.object({});
25
86
 
26
87
  export type Order = {
27
- currency?: string | undefined;
28
- notes?: string | undefined;
29
- order_number?: string | undefined;
88
+ currency?: string | null | undefined;
89
+ notes?: string | null | undefined;
90
+ order_number?: string | null | undefined;
30
91
  order_status?: OrderStatusEnum | undefined;
31
92
  placed_at: string;
32
- shipping_cost?: string | undefined;
33
- shipping_cost_currency?: string | undefined;
34
- shipping_method?: string | undefined;
35
- subtotal_price?: string | undefined;
36
- total_price?: string | undefined;
37
- total_tax?: string | undefined;
38
- weight?: string | undefined;
93
+ shipping_cost?: string | null | undefined;
94
+ shipping_cost_currency?: string | null | undefined;
95
+ shipping_method?: string | null | undefined;
96
+ subtotal_price?: string | null | undefined;
97
+ total_price?: string | null | undefined;
98
+ total_tax?: string | null | undefined;
99
+ weight?: string | null | undefined;
39
100
  weight_unit?: WeightUnitEnum | undefined;
40
- from_address?: Address | undefined;
101
+ from_address?: OrderAddressFrom | null | undefined;
41
102
  to_address: Address;
42
103
  line_items?: Array<LineItem> | undefined;
43
104
  object_id?: string | undefined;
@@ -48,24 +109,25 @@ export type Order = {
48
109
 
49
110
  export const Order$zodSchema: z.ZodType<Order, z.ZodTypeDef, unknown> = z
50
111
  .object({
51
- currency: z.string().optional(),
52
- from_address: Address$zodSchema.optional(),
112
+ currency: z.string().nullable().optional(),
113
+ from_address: z.lazy(() => OrderAddressFrom$zodSchema).nullable()
114
+ .optional(),
53
115
  line_items: z.array(LineItem$zodSchema).optional(),
54
- notes: z.string().optional(),
116
+ notes: z.string().nullable().optional(),
55
117
  object_id: z.string().optional(),
56
118
  object_owner: z.string().optional(),
57
- order_number: z.string().optional(),
119
+ order_number: z.string().nullable().optional(),
58
120
  order_status: OrderStatusEnum$zodSchema.optional(),
59
121
  placed_at: z.string(),
60
- shipping_cost: z.string().optional(),
61
- shipping_cost_currency: z.string().optional(),
62
- shipping_method: z.string().optional(),
122
+ shipping_cost: z.string().nullable().optional(),
123
+ shipping_cost_currency: z.string().nullable().optional(),
124
+ shipping_method: z.string().nullable().optional(),
63
125
  shop_app: OrderShopAppEnum$zodSchema.optional(),
64
- subtotal_price: z.string().optional(),
126
+ subtotal_price: z.string().nullable().optional(),
65
127
  to_address: Address$zodSchema,
66
- total_price: z.string().optional(),
67
- total_tax: z.string().optional(),
128
+ total_price: z.string().nullable().optional(),
129
+ total_tax: z.string().nullable().optional(),
68
130
  transactions: z.array(z.lazy(() => OrderTransaction$zodSchema)).optional(),
69
- weight: z.string().optional(),
131
+ weight: z.string().nullable().optional(),
70
132
  weight_unit: WeightUnitEnum$zodSchema.optional(),
71
133
  });
@@ -15,18 +15,18 @@ import {
15
15
  import { WeightUnitEnum, WeightUnitEnum$zodSchema } from "./weightunitenum.js";
16
16
 
17
17
  export type OrderCreateRequest = {
18
- currency?: string | undefined;
19
- notes?: string | undefined;
20
- order_number?: string | undefined;
18
+ currency?: string | null | undefined;
19
+ notes?: string | null | undefined;
20
+ order_number?: string | null | undefined;
21
21
  order_status?: OrderStatusEnum | undefined;
22
22
  placed_at: string;
23
- shipping_cost?: string | undefined;
24
- shipping_cost_currency?: string | undefined;
25
- shipping_method?: string | undefined;
26
- subtotal_price?: string | undefined;
27
- total_price?: string | undefined;
28
- total_tax?: string | undefined;
29
- weight?: string | undefined;
23
+ shipping_cost?: string | null | undefined;
24
+ shipping_cost_currency?: string | null | undefined;
25
+ shipping_method?: string | null | undefined;
26
+ subtotal_price?: string | null | undefined;
27
+ total_price?: string | null | undefined;
28
+ total_tax?: string | null | undefined;
29
+ weight?: string | null | undefined;
30
30
  weight_unit?: WeightUnitEnum | undefined;
31
31
  from_address?: AddressCreateRequest | undefined;
32
32
  to_address: AddressCreateRequest;
@@ -38,20 +38,20 @@ export const OrderCreateRequest$zodSchema: z.ZodType<
38
38
  z.ZodTypeDef,
39
39
  unknown
40
40
  > = z.object({
41
- currency: z.string().optional(),
41
+ currency: z.string().nullable().optional(),
42
42
  from_address: AddressCreateRequest$zodSchema.optional(),
43
43
  line_items: z.array(LineItemBase$zodSchema).optional(),
44
- notes: z.string().optional(),
45
- order_number: z.string().optional(),
44
+ notes: z.string().nullable().optional(),
45
+ order_number: z.string().nullable().optional(),
46
46
  order_status: OrderStatusEnum$zodSchema.optional(),
47
47
  placed_at: z.string(),
48
- shipping_cost: z.string().optional(),
49
- shipping_cost_currency: z.string().optional(),
50
- shipping_method: z.string().optional(),
51
- subtotal_price: z.string().optional(),
48
+ shipping_cost: z.string().nullable().optional(),
49
+ shipping_cost_currency: z.string().nullable().optional(),
50
+ shipping_method: z.string().nullable().optional(),
51
+ subtotal_price: z.string().nullable().optional(),
52
52
  to_address: AddressCreateRequest$zodSchema,
53
- total_price: z.string().optional(),
54
- total_tax: z.string().optional(),
55
- weight: z.string().optional(),
53
+ total_price: z.string().nullable().optional(),
54
+ total_tax: z.string().nullable().optional(),
55
+ weight: z.string().nullable().optional(),
56
56
  weight_unit: WeightUnitEnum$zodSchema.optional(),
57
57
  });
@@ -19,7 +19,7 @@ export type ServiceGroup = {
19
19
  free_shipping_threshold_currency?: string | null | undefined;
20
20
  free_shipping_threshold_min?: string | null | undefined;
21
21
  name: string;
22
- rate_adjustment?: number | undefined;
22
+ rate_adjustment?: number | null | undefined;
23
23
  type: ServiceGroupTypeEnum;
24
24
  object_id: string;
25
25
  is_active?: boolean | undefined;
@@ -39,7 +39,7 @@ export const ServiceGroup$zodSchema: z.ZodType<
39
39
  is_active: z.boolean().optional(),
40
40
  name: z.string(),
41
41
  object_id: z.string(),
42
- rate_adjustment: z.number().int().optional(),
42
+ rate_adjustment: z.number().int().nullable().optional(),
43
43
  service_levels: z.array(ServiceGroupAccountAndServiceLevel$zodSchema)
44
44
  .nullable(),
45
45
  type: ServiceGroupTypeEnum$zodSchema,
@@ -19,7 +19,7 @@ export type ServiceGroupCreateRequest = {
19
19
  free_shipping_threshold_currency?: string | null | undefined;
20
20
  free_shipping_threshold_min?: string | null | undefined;
21
21
  name: string;
22
- rate_adjustment?: number | undefined;
22
+ rate_adjustment?: number | null | undefined;
23
23
  type: ServiceGroupTypeEnum;
24
24
  service_levels: Array<ServiceGroupAccountAndServiceLevel>;
25
25
  };
@@ -35,7 +35,7 @@ export const ServiceGroupCreateRequest$zodSchema: z.ZodType<
35
35
  free_shipping_threshold_currency: z.string().nullable().optional(),
36
36
  free_shipping_threshold_min: z.string().nullable().optional(),
37
37
  name: z.string(),
38
- rate_adjustment: z.number().int().optional(),
38
+ rate_adjustment: z.number().int().nullable().optional(),
39
39
  service_levels: z.array(ServiceGroupAccountAndServiceLevel$zodSchema),
40
40
  type: ServiceGroupTypeEnum$zodSchema,
41
41
  });
@@ -19,7 +19,7 @@ export type ServiceGroupUpdateRequest = {
19
19
  free_shipping_threshold_currency?: string | null | undefined;
20
20
  free_shipping_threshold_min?: string | null | undefined;
21
21
  name: string;
22
- rate_adjustment?: number | undefined;
22
+ rate_adjustment?: number | null | undefined;
23
23
  type: ServiceGroupTypeEnum;
24
24
  object_id: string;
25
25
  is_active: boolean;
@@ -39,7 +39,7 @@ export const ServiceGroupUpdateRequest$zodSchema: z.ZodType<
39
39
  is_active: z.boolean(),
40
40
  name: z.string(),
41
41
  object_id: z.string(),
42
- rate_adjustment: z.number().int().optional(),
42
+ rate_adjustment: z.number().int().nullable().optional(),
43
43
  service_levels: z.array(ServiceGroupAccountAndServiceLevel$zodSchema),
44
44
  type: ServiceGroupTypeEnum$zodSchema,
45
45
  });
@@ -3,29 +3,85 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod";
6
- import {
7
- CarrierParcelTemplate,
8
- CarrierParcelTemplate$zodSchema,
9
- } from "./carrierparceltemplate.js";
10
6
  import {
11
7
  DistanceUnitEnum,
12
8
  DistanceUnitEnum$zodSchema,
13
9
  } from "./distanceunitenum.js";
14
- import { WeightUnitEnum, WeightUnitEnum$zodSchema } from "./weightunitenum.js";
10
+
11
+ /**
12
+ * The measure unit used for length, width and height.
13
+ */
14
+ export const UserParcelTemplateDistanceUnitEnum$zodSchema = z.enum([
15
+ "cm",
16
+ "in",
17
+ "ft",
18
+ "m",
19
+ "mm",
20
+ "yd",
21
+ ]).describe("The measure unit used for length, width and height.");
22
+
23
+ export type UserParcelTemplateDistanceUnitEnum = z.infer<
24
+ typeof UserParcelTemplateDistanceUnitEnum$zodSchema
25
+ >;
26
+
27
+ /**
28
+ * The unit used for weight.
29
+ */
30
+ export const UserParcelTemplateWeightUnitEnum$zodSchema = z.enum([
31
+ "g",
32
+ "kg",
33
+ "lb",
34
+ "oz",
35
+ ]).describe("The unit used for weight.");
36
+
37
+ export type UserParcelTemplateWeightUnitEnum = z.infer<
38
+ typeof UserParcelTemplateWeightUnitEnum$zodSchema
39
+ >;
40
+
41
+ export type CarrierParcelTemplateRepresentsTheFieldsOfATemplateBeforeSavingItToTheDb =
42
+ {
43
+ carrier?: string | undefined;
44
+ distance_unit?: DistanceUnitEnum | undefined;
45
+ height?: string | undefined;
46
+ is_variable_dimensions?: boolean | undefined;
47
+ length?: string | undefined;
48
+ name?: string | undefined;
49
+ token?: string | undefined;
50
+ width?: string | undefined;
51
+ };
52
+
53
+ export const CarrierParcelTemplateRepresentsTheFieldsOfATemplateBeforeSavingItToTheDb$zodSchema:
54
+ z.ZodType<
55
+ CarrierParcelTemplateRepresentsTheFieldsOfATemplateBeforeSavingItToTheDb,
56
+ z.ZodTypeDef,
57
+ unknown
58
+ > = z.object({
59
+ carrier: z.string().optional(),
60
+ distance_unit: DistanceUnitEnum$zodSchema.optional(),
61
+ height: z.string().optional(),
62
+ is_variable_dimensions: z.boolean().optional(),
63
+ length: z.string().optional(),
64
+ name: z.string().optional(),
65
+ token: z.string().optional(),
66
+ width: z.string().optional(),
67
+ });
15
68
 
16
69
  export type UserParcelTemplate = {
17
- distance_unit?: DistanceUnitEnum | undefined;
18
- height?: string | undefined;
19
- length?: string | undefined;
20
- name?: string | undefined;
21
- weight?: string | undefined;
22
- weight_unit?: WeightUnitEnum | undefined;
23
- width?: string | undefined;
70
+ distance_unit?: UserParcelTemplateDistanceUnitEnum | null | undefined;
71
+ height?: string | null | undefined;
72
+ length?: string | null | undefined;
73
+ name?: string | null | undefined;
74
+ weight?: string | null | undefined;
75
+ weight_unit?: UserParcelTemplateWeightUnitEnum | null | undefined;
76
+ width?: string | null | undefined;
24
77
  object_created?: string | undefined;
25
78
  object_id?: string | undefined;
26
79
  object_owner?: string | undefined;
27
80
  object_updated?: string | undefined;
28
- template?: CarrierParcelTemplate | undefined;
81
+ template?:
82
+ | CarrierParcelTemplateRepresentsTheFieldsOfATemplateBeforeSavingItToTheDb
83
+ | null
84
+ | undefined;
29
85
  };
30
86
 
31
87
  export const UserParcelTemplate$zodSchema: z.ZodType<
@@ -33,16 +89,19 @@ export const UserParcelTemplate$zodSchema: z.ZodType<
33
89
  z.ZodTypeDef,
34
90
  unknown
35
91
  > = z.object({
36
- distance_unit: DistanceUnitEnum$zodSchema.optional(),
37
- height: z.string().optional(),
38
- length: z.string().optional(),
39
- name: z.string().optional(),
92
+ distance_unit: UserParcelTemplateDistanceUnitEnum$zodSchema.nullable()
93
+ .optional(),
94
+ height: z.string().nullable().optional(),
95
+ length: z.string().nullable().optional(),
96
+ name: z.string().nullable().optional(),
40
97
  object_created: z.string().optional(),
41
98
  object_id: z.string().optional(),
42
99
  object_owner: z.string().optional(),
43
100
  object_updated: z.string().optional(),
44
- template: CarrierParcelTemplate$zodSchema.optional(),
45
- weight: z.string().optional(),
46
- weight_unit: WeightUnitEnum$zodSchema.optional(),
47
- width: z.string().optional(),
101
+ template: z.lazy(() =>
102
+ CarrierParcelTemplateRepresentsTheFieldsOfATemplateBeforeSavingItToTheDb$zodSchema
103
+ ).nullable().optional(),
104
+ weight: z.string().nullable().optional(),
105
+ weight_unit: UserParcelTemplateWeightUnitEnum$zodSchema.nullable().optional(),
106
+ width: z.string().nullable().optional(),
48
107
  });
@@ -3,20 +3,50 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod";
6
- import {
7
- DistanceUnitEnum,
8
- DistanceUnitEnum$zodSchema,
9
- } from "./distanceunitenum.js";
10
- import { WeightUnitEnum, WeightUnitEnum$zodSchema } from "./weightunitenum.js";
6
+
7
+ /**
8
+ * The measure unit used for length, width and height.
9
+ */
10
+ export const UserParcelTemplateUpdateRequestDistanceUnitEnum$zodSchema = z.enum(
11
+ [
12
+ "cm",
13
+ "in",
14
+ "ft",
15
+ "m",
16
+ "mm",
17
+ "yd",
18
+ ],
19
+ ).describe("The measure unit used for length, width and height.");
20
+
21
+ export type UserParcelTemplateUpdateRequestDistanceUnitEnum = z.infer<
22
+ typeof UserParcelTemplateUpdateRequestDistanceUnitEnum$zodSchema
23
+ >;
24
+
25
+ /**
26
+ * The unit used for weight.
27
+ */
28
+ export const UserParcelTemplateUpdateRequestWeightUnitEnum$zodSchema = z.enum([
29
+ "g",
30
+ "kg",
31
+ "lb",
32
+ "oz",
33
+ ]).describe("The unit used for weight.");
34
+
35
+ export type UserParcelTemplateUpdateRequestWeightUnitEnum = z.infer<
36
+ typeof UserParcelTemplateUpdateRequestWeightUnitEnum$zodSchema
37
+ >;
11
38
 
12
39
  export type UserParcelTemplateUpdateRequest = {
13
- distance_unit: DistanceUnitEnum;
14
- height: string;
15
- length: string;
16
- name: string;
17
- weight?: string | undefined;
18
- weight_unit?: WeightUnitEnum | undefined;
19
- width: string;
40
+ distance_unit: UserParcelTemplateUpdateRequestDistanceUnitEnum | null;
41
+ height: string | null;
42
+ length: string | null;
43
+ name: string | null;
44
+ weight?: string | null | undefined;
45
+ weight_unit?:
46
+ | UserParcelTemplateUpdateRequestWeightUnitEnum
47
+ | null
48
+ | undefined;
49
+ width: string | null;
20
50
  };
21
51
 
22
52
  export const UserParcelTemplateUpdateRequest$zodSchema: z.ZodType<
@@ -24,11 +54,13 @@ export const UserParcelTemplateUpdateRequest$zodSchema: z.ZodType<
24
54
  z.ZodTypeDef,
25
55
  unknown
26
56
  > = z.object({
27
- distance_unit: DistanceUnitEnum$zodSchema,
28
- height: z.string(),
29
- length: z.string(),
30
- name: z.string(),
31
- weight: z.string().optional(),
32
- weight_unit: WeightUnitEnum$zodSchema.optional(),
33
- width: z.string(),
57
+ distance_unit: UserParcelTemplateUpdateRequestDistanceUnitEnum$zodSchema
58
+ .nullable(),
59
+ height: z.string().nullable(),
60
+ length: z.string().nullable(),
61
+ name: z.string().nullable(),
62
+ weight: z.string().nullable().optional(),
63
+ weight_unit: UserParcelTemplateUpdateRequestWeightUnitEnum$zodSchema
64
+ .nullable().optional(),
65
+ width: z.string().nullable(),
34
66
  });