@shippo/shippo-mcp 2.0.2 → 2.0.8

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 (163) hide show
  1. package/bin/mcp-server.js +1504 -718
  2. package/bin/mcp-server.js.map +36 -16
  3. package/esm/funcs/addressesCreateV1.d.ts +17 -0
  4. package/esm/funcs/addressesCreateV1.d.ts.map +1 -0
  5. package/esm/funcs/addressesCreateV1.js +86 -0
  6. package/esm/funcs/addressesCreateV1.js.map +1 -0
  7. package/esm/funcs/addressesCreateV2.d.ts +18 -0
  8. package/esm/funcs/addressesCreateV2.d.ts.map +1 -0
  9. package/esm/funcs/addressesCreateV2.js +93 -0
  10. package/esm/funcs/addressesCreateV2.js.map +1 -0
  11. package/esm/funcs/addressesParse.d.ts +24 -0
  12. package/esm/funcs/addressesParse.d.ts.map +1 -0
  13. package/esm/funcs/addressesParse.js +96 -0
  14. package/esm/funcs/addressesParse.js.map +1 -0
  15. package/esm/funcs/addressesValidateV2.d.ts +24 -0
  16. package/esm/funcs/addressesValidateV2.d.ts.map +1 -0
  17. package/esm/funcs/addressesValidateV2.js +105 -0
  18. package/esm/funcs/addressesValidateV2.js.map +1 -0
  19. package/esm/lib/config.d.ts +2 -2
  20. package/esm/lib/config.js +2 -2
  21. package/esm/mcp-server/mcp-server.js +1 -1
  22. package/esm/mcp-server/server.d.ts.map +1 -1
  23. package/esm/mcp-server/server.js +9 -3
  24. package/esm/mcp-server/server.js.map +1 -1
  25. package/esm/mcp-server/tools/addressesCreateV1.d.ts +7 -0
  26. package/esm/mcp-server/tools/addressesCreateV1.d.ts.map +1 -0
  27. package/esm/mcp-server/tools/addressesCreateV1.js +48 -0
  28. package/esm/mcp-server/tools/addressesCreateV1.js.map +1 -0
  29. package/esm/mcp-server/tools/addressesCreateV2.d.ts +7 -0
  30. package/esm/mcp-server/tools/addressesCreateV2.d.ts.map +1 -0
  31. package/esm/mcp-server/tools/addressesCreateV2.js +82 -0
  32. package/esm/mcp-server/tools/addressesCreateV2.js.map +1 -0
  33. package/esm/mcp-server/tools/addressesParse.d.ts +7 -0
  34. package/esm/mcp-server/tools/addressesParse.d.ts.map +1 -0
  35. package/esm/mcp-server/tools/addressesParse.js +66 -0
  36. package/esm/mcp-server/tools/addressesParse.js.map +1 -0
  37. package/esm/mcp-server/tools/addressesValidate.d.ts.map +1 -1
  38. package/esm/mcp-server/tools/addressesValidate.js +12 -3
  39. package/esm/mcp-server/tools/addressesValidate.js.map +1 -1
  40. package/esm/mcp-server/tools/addressesValidateV2.d.ts +7 -0
  41. package/esm/mcp-server/tools/addressesValidateV2.d.ts.map +1 -0
  42. package/esm/mcp-server/tools/addressesValidateV2.js +95 -0
  43. package/esm/mcp-server/tools/addressesValidateV2.js.map +1 -0
  44. package/esm/mcp-server/tools/ordersList.d.ts.map +1 -1
  45. package/esm/mcp-server/tools/ordersList.js +20 -2
  46. package/esm/mcp-server/tools/ordersList.js.map +1 -1
  47. package/esm/models/addressanalysisv2.d.ts +24 -0
  48. package/esm/models/addressanalysisv2.d.ts.map +1 -0
  49. package/esm/models/addressanalysisv2.js +22 -0
  50. package/esm/models/addressanalysisv2.js.map +1 -0
  51. package/esm/models/addresscreaterequestv2.d.ts +41 -0
  52. package/esm/models/addresscreaterequestv2.d.ts.map +1 -0
  53. package/esm/models/addresscreaterequestv2.js +35 -0
  54. package/esm/models/addresscreaterequestv2.js.map +1 -0
  55. package/esm/models/addressdatav2.d.ts +35 -0
  56. package/esm/models/addressdatav2.d.ts.map +1 -0
  57. package/esm/models/addressdatav2.js +32 -0
  58. package/esm/models/addressdatav2.js.map +1 -0
  59. package/esm/models/addressv2.d.ts +18 -0
  60. package/esm/models/addressv2.d.ts.map +1 -0
  61. package/esm/models/addressv2.js +17 -0
  62. package/esm/models/addressv2.js.map +1 -0
  63. package/esm/models/addressvalidationresultv2.d.ts +16 -0
  64. package/esm/models/addressvalidationresultv2.d.ts.map +1 -0
  65. package/esm/models/addressvalidationresultv2.js +15 -0
  66. package/esm/models/addressvalidationresultv2.js.map +1 -0
  67. package/esm/models/addresswithmetadataresponse.d.ts +13 -0
  68. package/esm/models/addresswithmetadataresponse.d.ts.map +1 -0
  69. package/esm/models/addresswithmetadataresponse.js +12 -0
  70. package/esm/models/addresswithmetadataresponse.js.map +1 -0
  71. package/esm/models/confidenceresult.d.ts +23 -0
  72. package/esm/models/confidenceresult.d.ts.map +1 -0
  73. package/esm/models/confidenceresult.js +20 -0
  74. package/esm/models/confidenceresult.js.map +1 -0
  75. package/esm/models/createaddressv2op.d.ts +30 -0
  76. package/esm/models/createaddressv2op.d.ts.map +1 -0
  77. package/esm/models/createaddressv2op.js +22 -0
  78. package/esm/models/createaddressv2op.js.map +1 -0
  79. package/esm/models/customsdeclarationcreaterequest.d.ts +27 -27
  80. package/esm/models/customsdeclarationcreaterequest.d.ts.map +1 -1
  81. package/esm/models/customsdeclarationcreaterequest.js +27 -27
  82. package/esm/models/customsdeclarationcreaterequest.js.map +1 -1
  83. package/esm/models/defaultparceltemplate.d.ts +2 -71
  84. package/esm/models/defaultparceltemplate.d.ts.map +1 -1
  85. package/esm/models/defaultparceltemplate.js +2 -62
  86. package/esm/models/defaultparceltemplate.js.map +1 -1
  87. package/esm/models/geocoordinates.d.ts +10 -0
  88. package/esm/models/geocoordinates.d.ts.map +1 -0
  89. package/esm/models/geocoordinates.js +9 -0
  90. package/esm/models/geocoordinates.js.map +1 -0
  91. package/esm/models/order.d.ts +1 -29
  92. package/esm/models/order.d.ts.map +1 -1
  93. package/esm/models/order.js +1 -25
  94. package/esm/models/order.js.map +1 -1
  95. package/esm/models/parseaddressop.d.ts +20 -0
  96. package/esm/models/parseaddressop.d.ts.map +1 -0
  97. package/esm/models/parseaddressop.js +25 -0
  98. package/esm/models/parseaddressop.js.map +1 -0
  99. package/esm/models/parsedaddress.d.ts +16 -0
  100. package/esm/models/parsedaddress.d.ts.map +1 -0
  101. package/esm/models/parsedaddress.js +15 -0
  102. package/esm/models/parsedaddress.js.map +1 -0
  103. package/esm/models/recommendedaddressv2.d.ts +21 -0
  104. package/esm/models/recommendedaddressv2.d.ts.map +1 -0
  105. package/esm/models/recommendedaddressv2.js +21 -0
  106. package/esm/models/recommendedaddressv2.js.map +1 -0
  107. package/esm/models/shipment.d.ts +1 -1
  108. package/esm/models/userparceltemplate.d.ts +5 -57
  109. package/esm/models/userparceltemplate.d.ts.map +1 -1
  110. package/esm/models/userparceltemplate.js +5 -49
  111. package/esm/models/userparceltemplate.js.map +1 -1
  112. package/esm/models/userparceltemplateupdaterequest.d.ts +4 -45
  113. package/esm/models/userparceltemplateupdaterequest.d.ts.map +1 -1
  114. package/esm/models/userparceltemplateupdaterequest.js +4 -38
  115. package/esm/models/userparceltemplateupdaterequest.js.map +1 -1
  116. package/esm/models/userparceltemplatewithoutcarriertemplatecreaterequest.d.ts +4 -45
  117. package/esm/models/userparceltemplatewithoutcarriertemplatecreaterequest.d.ts.map +1 -1
  118. package/esm/models/userparceltemplatewithoutcarriertemplatecreaterequest.js +4 -38
  119. package/esm/models/userparceltemplatewithoutcarriertemplatecreaterequest.js.map +1 -1
  120. package/esm/models/validateaddressv2op.d.ts +265 -0
  121. package/esm/models/validateaddressv2op.d.ts.map +1 -0
  122. package/esm/models/validateaddressv2op.js +258 -0
  123. package/esm/models/validateaddressv2op.js.map +1 -0
  124. package/esm/models/validationresultv2.d.ts +15 -0
  125. package/esm/models/validationresultv2.d.ts.map +1 -0
  126. package/esm/models/validationresultv2.js +14 -0
  127. package/esm/models/validationresultv2.js.map +1 -0
  128. package/manifest.json +17 -5
  129. package/package.json +1 -1
  130. package/src/funcs/{addressesCreate.ts → addressesCreateV1.ts} +1 -1
  131. package/src/funcs/addressesCreateV2.ts +178 -0
  132. package/src/funcs/addressesParse.ts +178 -0
  133. package/src/funcs/addressesValidateV2.ts +188 -0
  134. package/src/lib/config.ts +2 -2
  135. package/src/mcp-server/mcp-server.ts +1 -1
  136. package/src/mcp-server/server.ts +9 -3
  137. package/src/mcp-server/tools/addressesCreateV1.ts +58 -0
  138. package/src/mcp-server/tools/addressesCreateV2.ts +92 -0
  139. package/src/mcp-server/tools/addressesParse.ts +76 -0
  140. package/src/mcp-server/tools/addressesValidate.ts +12 -3
  141. package/src/mcp-server/tools/addressesValidateV2.ts +105 -0
  142. package/src/mcp-server/tools/ordersList.ts +20 -2
  143. package/src/models/addressanalysisv2.ts +41 -0
  144. package/src/models/addresscreaterequestv2.ts +64 -0
  145. package/src/models/addressdatav2.ts +56 -0
  146. package/src/models/addressv2.ts +34 -0
  147. package/src/models/addressvalidationresultv2.ts +34 -0
  148. package/src/models/addresswithmetadataresponse.ts +25 -0
  149. package/src/models/confidenceresult.ts +36 -0
  150. package/src/models/createaddressv2op.ts +73 -0
  151. package/src/models/customsdeclarationcreaterequest.ts +54 -54
  152. package/src/models/defaultparceltemplate.ts +5 -122
  153. package/src/models/geocoordinates.ts +18 -0
  154. package/src/models/order.ts +2 -61
  155. package/src/models/parseaddressop.ts +44 -0
  156. package/src/models/parsedaddress.ts +32 -0
  157. package/src/models/recommendedaddressv2.ts +43 -0
  158. package/src/models/userparceltemplate.ts +11 -90
  159. package/src/models/userparceltemplateupdaterequest.ts +9 -62
  160. package/src/models/userparceltemplatewithoutcarriertemplatecreaterequest.ts +9 -70
  161. package/src/models/validateaddressv2op.ts +319 -0
  162. package/src/models/validationresultv2.ts +29 -0
  163. package/src/mcp-server/tools/addressesCreate.ts +0 -74
@@ -0,0 +1,105 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { addressesValidateV2 } from "../../funcs/addressesValidateV2.js";
6
+ import { ValidateAddressV2Request$zodSchema } from "../../models/validateaddressv2op.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: ValidateAddressV2Request$zodSchema,
11
+ };
12
+
13
+ export const tool$addressesValidateV2: ToolDefinition<typeof args> = {
14
+ name: "addresses-validate-v2",
15
+ description:
16
+ `**PRIMARY ADDRESS VALIDATION TOOL** - Use this tool whenever asked to validate an address.
17
+
18
+ This is the recommended v2 validation endpoint that provides comprehensive results:
19
+ - Original address as submitted
20
+ - Recommended address with corrections
21
+ - Confidence score (high/medium/low)
22
+ - Validation result (valid/invalid/unknown)
23
+ - Address type (residential/commercial/unknown)
24
+ - List of changed attributes
25
+ - Geographic coordinates (latitude/longitude)
26
+
27
+ **Required Fields:**
28
+ - \`address_line_1\`: The street address (required)
29
+ - \`country_code\`: ISO 3166 country code (required)
30
+
31
+ **US Address Requirements (one of):**
32
+ - state_province + city_locality + address_line_1
33
+ - OR address_line_1 + postal_code
34
+
35
+ **International Requirements:**
36
+ - city_locality + address_line_1
37
+
38
+ **Example Request:**
39
+ \`\`\`
40
+ address_line_1: "731 Market Street"
41
+ address_line_2: "#200"
42
+ city_locality: "San Francisco"
43
+ state_province: "CA"
44
+ postal_code: "94103"
45
+ country_code: "US"
46
+ \`\`\`
47
+
48
+ **Example Response:**
49
+ \`\`\`json
50
+ {
51
+ "recommended_address": {
52
+ "address_line_1": "731 MARKET ST",
53
+ "city_locality": "SAN FRANCISCO",
54
+ "state_province": "CA",
55
+ "postal_code": "94103-2007",
56
+ "country_code": "US",
57
+ "confidence_result": {
58
+ "score": "high",
59
+ "description": "Address verified"
60
+ }
61
+ },
62
+ "analysis": {
63
+ "validation_result": {"value": "valid"},
64
+ "address_type": "commercial",
65
+ "changed_attributes": ["address_line_1", "postal_code"]
66
+ },
67
+ "geo": {"latitude": 37.7879, "longitude": -122.4074}
68
+ }
69
+ \`\`\`
70
+
71
+ **Use Cases:**
72
+ - Validate customer shipping addresses before label purchase
73
+ - Get corrected/standardized address formatting
74
+ - Determine if address is residential or commercial
75
+ - Get ZIP+4 extended postal codes
76
+ - Geocode addresses for mapping
77
+ `,
78
+ scopes: ["read", "validation"],
79
+ annotations: {
80
+ "title": "",
81
+ "destructiveHint": false,
82
+ "idempotentHint": false,
83
+ "openWorldHint": false,
84
+ "readOnlyHint": false,
85
+ },
86
+ args,
87
+ tool: async (client, args, ctx) => {
88
+ const [result, apiCall] = await addressesValidateV2(
89
+ client,
90
+ args.request,
91
+ { fetchOptions: { signal: ctx.signal } },
92
+ ).$inspect();
93
+
94
+ if (!result.ok) {
95
+ return {
96
+ content: [{ type: "text", text: result.error.message }],
97
+ isError: true,
98
+ };
99
+ }
100
+
101
+ const value = result.value;
102
+
103
+ return formatResult(value, apiCall);
104
+ },
105
+ };
@@ -14,13 +14,31 @@ export const tool$ordersList: ToolDefinition<typeof args> = {
14
14
  name: "orders-list",
15
15
  description: `List all orders
16
16
 
17
- Returns a list of all order objects.`,
17
+ Returns a list of all order objects.
18
+
19
+ **Available Filters:**
20
+ - \`orderStatus\`: Filter by order status. Can pass multiple values as an array.
21
+ - Values: UNKNOWN, AWAITPAY, PAID, REFUNDED, CANCELLED, PARTIALLY_FULFILLED, SHIPPED
22
+ - \`shop_app\`: Filter by platform/source where order was created
23
+ - Values: Amazon, Bigcommerce, CSV_Import, eBay, ePages, Etsy, Godaddy, Magento, Shippo, Shopify, Spreecommerce, StripeRelay, Walmart, Weebly, WooCommerce
24
+ - \`start_date\`: Filter orders placed AFTER this date/time (ISO 8601 UTC format, e.g., "2025-01-01T00:00:00Z")
25
+ - \`end_date\`: Filter orders placed BEFORE this date/time (ISO 8601 UTC format)
26
+ - \`page/results\`: Pagination controls
27
+
28
+ **Example Use Cases:**
29
+ - "Show all paid orders" → filter by \`orderStatus: ["PAID"]\`
30
+ - "Show Shopify orders from last week" → combine \`shop_app: "Shopify"\` with date filters
31
+ - "Show orders ready to ship" → filter by \`orderStatus: ["PAID"]\`
32
+ - "Show cancelled or refunded orders" → filter by \`orderStatus: ["CANCELLED", "REFUNDED"]\`
33
+
34
+ **Note:** Date filters are based on \`placed_at\` field (when order was placed), not when the order object was created in Shippo.
35
+ `,
18
36
  annotations: {
19
37
  "title": "",
20
38
  "destructiveHint": false,
21
39
  "idempotentHint": false,
22
40
  "openWorldHint": false,
23
- "readOnlyHint": true,
41
+ "readOnlyHint": false,
24
42
  },
25
43
  args,
26
44
  tool: async (client, args, ctx) => {
@@ -0,0 +1,41 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { ClosedEnum } from "../types/enums.js";
7
+ import {
8
+ ValidationResultV2,
9
+ ValidationResultV2$zodSchema,
10
+ } from "./validationresultv2.js";
11
+
12
+ export const AddressAnalysisV2AddressType = {
13
+ Residential: "residential",
14
+ Commercial: "commercial",
15
+ Unknown: "unknown",
16
+ } as const;
17
+ export type AddressAnalysisV2AddressType = ClosedEnum<
18
+ typeof AddressAnalysisV2AddressType
19
+ >;
20
+
21
+ export const AddressAnalysisV2AddressType$zodSchema = z.enum([
22
+ "residential",
23
+ "commercial",
24
+ "unknown",
25
+ ]);
26
+
27
+ /**
28
+ * Analysis details for the address validation
29
+ */
30
+ export type AddressAnalysisV2 = {
31
+ validation_result?: ValidationResultV2 | undefined;
32
+ address_type?: AddressAnalysisV2AddressType | null | undefined;
33
+ changed_attributes?: Array<string> | null | undefined;
34
+ };
35
+
36
+ export const AddressAnalysisV2$zodSchema: z.ZodType<AddressAnalysisV2> = z
37
+ .object({
38
+ address_type: AddressAnalysisV2AddressType$zodSchema.nullable().optional(),
39
+ changed_attributes: z.array(z.string()).nullable().optional(),
40
+ validation_result: ValidationResultV2$zodSchema.optional(),
41
+ }).describe("Analysis details for the address validation");
@@ -0,0 +1,64 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { ClosedEnum } from "../types/enums.js";
7
+
8
+ /**
9
+ * The category of the address. May affect carrier charges.
10
+ */
11
+ export const AddressCreateRequestV2AddressType = {
12
+ Unknown: "unknown",
13
+ Residential: "residential",
14
+ Commercial: "commercial",
15
+ PoBox: "po_box",
16
+ Military: "military",
17
+ } as const;
18
+ /**
19
+ * The category of the address. May affect carrier charges.
20
+ */
21
+ export type AddressCreateRequestV2AddressType = ClosedEnum<
22
+ typeof AddressCreateRequestV2AddressType
23
+ >;
24
+
25
+ export const AddressCreateRequestV2AddressType$zodSchema = z.enum([
26
+ "unknown",
27
+ "residential",
28
+ "commercial",
29
+ "po_box",
30
+ "military",
31
+ ]).describe("The category of the address. May affect carrier charges.");
32
+
33
+ /**
34
+ * Request body for creating a new address (v2)
35
+ */
36
+ export type AddressCreateRequestV2 = {
37
+ name: string;
38
+ organization?: string | null | undefined;
39
+ email?: string | null | undefined;
40
+ phone?: string | null | undefined;
41
+ address_line_1: string;
42
+ address_line_2?: string | null | undefined;
43
+ city_locality?: string | null | undefined;
44
+ state_province?: string | null | undefined;
45
+ postal_code?: string | null | undefined;
46
+ country_code: string;
47
+ address_type?: AddressCreateRequestV2AddressType | undefined;
48
+ };
49
+
50
+ export const AddressCreateRequestV2$zodSchema: z.ZodType<
51
+ AddressCreateRequestV2
52
+ > = z.object({
53
+ address_line_1: z.string(),
54
+ address_line_2: z.string().nullable().optional(),
55
+ address_type: AddressCreateRequestV2AddressType$zodSchema.default("unknown"),
56
+ city_locality: z.string().nullable().optional(),
57
+ country_code: z.string(),
58
+ email: z.string().nullable().optional(),
59
+ name: z.string(),
60
+ organization: z.string().nullable().optional(),
61
+ phone: z.string().nullable().optional(),
62
+ postal_code: z.string().nullable().optional(),
63
+ state_province: z.string().nullable().optional(),
64
+ }).describe("Request body for creating a new address (v2)");
@@ -0,0 +1,56 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { ClosedEnum } from "../types/enums.js";
7
+
8
+ export const AddressDataV2AddressType = {
9
+ Unknown: "unknown",
10
+ Residential: "residential",
11
+ Commercial: "commercial",
12
+ PoBox: "po_box",
13
+ Military: "military",
14
+ } as const;
15
+ export type AddressDataV2AddressType = ClosedEnum<
16
+ typeof AddressDataV2AddressType
17
+ >;
18
+
19
+ export const AddressDataV2AddressType$zodSchema = z.enum([
20
+ "unknown",
21
+ "residential",
22
+ "commercial",
23
+ "po_box",
24
+ "military",
25
+ ]);
26
+
27
+ /**
28
+ * Address data in v2 format
29
+ */
30
+ export type AddressDataV2 = {
31
+ name?: string | null | undefined;
32
+ email?: string | null | undefined;
33
+ phone?: string | null | undefined;
34
+ organization?: string | null | undefined;
35
+ address_line_1?: string | null | undefined;
36
+ address_line_2?: string | null | undefined;
37
+ city_locality?: string | null | undefined;
38
+ state_province?: string | null | undefined;
39
+ postal_code?: string | null | undefined;
40
+ country_code?: string | null | undefined;
41
+ address_type?: AddressDataV2AddressType | null | undefined;
42
+ };
43
+
44
+ export const AddressDataV2$zodSchema: z.ZodType<AddressDataV2> = z.object({
45
+ address_line_1: z.string().nullable().optional(),
46
+ address_line_2: z.string().nullable().optional(),
47
+ address_type: AddressDataV2AddressType$zodSchema.nullable().optional(),
48
+ city_locality: z.string().nullable().optional(),
49
+ country_code: z.string().nullable().optional(),
50
+ email: z.string().nullable().optional(),
51
+ name: z.string().nullable().optional(),
52
+ organization: z.string().nullable().optional(),
53
+ phone: z.string().nullable().optional(),
54
+ postal_code: z.string().nullable().optional(),
55
+ state_province: z.string().nullable().optional(),
56
+ }).describe("Address data in v2 format");
@@ -0,0 +1,34 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+
7
+ /**
8
+ * Address object in v2 format
9
+ */
10
+ export type AddressV2 = {
11
+ address_line_1?: string | null | undefined;
12
+ address_line_2?: string | null | undefined;
13
+ city_locality?: string | null | undefined;
14
+ state_province?: string | null | undefined;
15
+ postal_code?: string | null | undefined;
16
+ country_code?: string | null | undefined;
17
+ name?: string | null | undefined;
18
+ organization?: string | null | undefined;
19
+ phone?: string | null | undefined;
20
+ email?: string | null | undefined;
21
+ };
22
+
23
+ export const AddressV2$zodSchema: z.ZodType<AddressV2> = z.object({
24
+ address_line_1: z.string().nullable().optional(),
25
+ address_line_2: z.string().nullable().optional(),
26
+ city_locality: z.string().nullable().optional(),
27
+ country_code: z.string().nullable().optional(),
28
+ email: z.string().nullable().optional(),
29
+ name: z.string().nullable().optional(),
30
+ organization: z.string().nullable().optional(),
31
+ phone: z.string().nullable().optional(),
32
+ postal_code: z.string().nullable().optional(),
33
+ state_province: z.string().nullable().optional(),
34
+ }).describe("Address object in v2 format");
@@ -0,0 +1,34 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import {
7
+ AddressAnalysisV2,
8
+ AddressAnalysisV2$zodSchema,
9
+ } from "./addressanalysisv2.js";
10
+ import { AddressV2, AddressV2$zodSchema } from "./addressv2.js";
11
+ import { GeoCoordinates, GeoCoordinates$zodSchema } from "./geocoordinates.js";
12
+ import {
13
+ RecommendedAddressV2,
14
+ RecommendedAddressV2$zodSchema,
15
+ } from "./recommendedaddressv2.js";
16
+
17
+ /**
18
+ * Address validation result from v2 API
19
+ */
20
+ export type AddressValidationResultV2 = {
21
+ original_address?: AddressV2 | undefined;
22
+ recommended_address?: RecommendedAddressV2 | undefined;
23
+ analysis?: AddressAnalysisV2 | undefined;
24
+ geo?: GeoCoordinates | undefined;
25
+ };
26
+
27
+ export const AddressValidationResultV2$zodSchema: z.ZodType<
28
+ AddressValidationResultV2
29
+ > = z.object({
30
+ analysis: AddressAnalysisV2$zodSchema.optional(),
31
+ geo: GeoCoordinates$zodSchema.optional(),
32
+ original_address: AddressV2$zodSchema.optional(),
33
+ recommended_address: RecommendedAddressV2$zodSchema.optional(),
34
+ }).describe("Address validation result from v2 API");
@@ -0,0 +1,25 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { AddressDataV2, AddressDataV2$zodSchema } from "./addressdatav2.js";
7
+
8
+ /**
9
+ * Response from creating a new address (v2)
10
+ */
11
+ export type AddressWithMetadataResponse = {
12
+ id?: string | undefined;
13
+ address?: AddressDataV2 | undefined;
14
+ updated_at?: string | undefined;
15
+ created_at?: string | undefined;
16
+ };
17
+
18
+ export const AddressWithMetadataResponse$zodSchema: z.ZodType<
19
+ AddressWithMetadataResponse
20
+ > = z.object({
21
+ address: AddressDataV2$zodSchema.optional(),
22
+ created_at: z.iso.datetime({ offset: true }).optional(),
23
+ id: z.string().optional(),
24
+ updated_at: z.iso.datetime({ offset: true }).optional(),
25
+ }).describe("Response from creating a new address (v2)");
@@ -0,0 +1,36 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { ClosedEnum } from "../types/enums.js";
7
+
8
+ export const Score = {
9
+ High: "high",
10
+ Medium: "medium",
11
+ Low: "low",
12
+ } as const;
13
+ export type Score = ClosedEnum<typeof Score>;
14
+
15
+ export const Score$zodSchema = z.enum([
16
+ "high",
17
+ "medium",
18
+ "low",
19
+ ]);
20
+
21
+ /**
22
+ * Confidence score and details for the address validation
23
+ */
24
+ export type ConfidenceResult = {
25
+ score?: Score | null | undefined;
26
+ code?: string | null | undefined;
27
+ description?: string | null | undefined;
28
+ };
29
+
30
+ export const ConfidenceResult$zodSchema: z.ZodType<ConfidenceResult> = z.object(
31
+ {
32
+ code: z.string().nullable().optional(),
33
+ description: z.string().nullable().optional(),
34
+ score: Score$zodSchema.nullable().optional(),
35
+ },
36
+ ).describe("Confidence score and details for the address validation");
@@ -0,0 +1,73 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import {
7
+ AddressWithMetadataResponse,
8
+ AddressWithMetadataResponse$zodSchema,
9
+ } from "./addresswithmetadataresponse.js";
10
+
11
+ export type CreateAddressV2Globals = { shippoApiVersion?: string | undefined };
12
+
13
+ export const CreateAddressV2Globals$zodSchema: z.ZodType<
14
+ CreateAddressV2Globals
15
+ > = z.object({
16
+ shippoApiVersion: z.string().describe(
17
+ "Optional string used to pick a non-default API version to use. See our <a href=\"https://docs.goshippo.com/docs/api_concepts/apiversioning/\">API version</a> guide.",
18
+ ).optional(),
19
+ });
20
+
21
+ export type CreateAddressV2Detail = {};
22
+
23
+ export const CreateAddressV2Detail$zodSchema: z.ZodType<CreateAddressV2Detail> =
24
+ z.object({});
25
+
26
+ /**
27
+ * Unprocessable Entity
28
+ */
29
+ export type CreateAddressV2UnprocessableEntityResponseBody = {
30
+ detail?: Array<CreateAddressV2Detail> | undefined;
31
+ };
32
+
33
+ export const CreateAddressV2UnprocessableEntityResponseBody$zodSchema:
34
+ z.ZodType<CreateAddressV2UnprocessableEntityResponseBody> = z.object({
35
+ detail: z.array(z.lazy(() => CreateAddressV2Detail$zodSchema)).optional(),
36
+ }).describe("Unprocessable Entity");
37
+
38
+ /**
39
+ * Conflict - Address already exists
40
+ */
41
+ export type CreateAddressV2ConflictResponseBody = {};
42
+
43
+ export const CreateAddressV2ConflictResponseBody$zodSchema: z.ZodType<
44
+ CreateAddressV2ConflictResponseBody
45
+ > = z.object({}).describe("Conflict - Address already exists");
46
+
47
+ export type CreateAddressV2Response = {
48
+ ContentType: string;
49
+ StatusCode: number;
50
+ RawResponse: Response;
51
+ AddressWithMetadataResponse?: AddressWithMetadataResponse | undefined;
52
+ fourHundredAndNineApplicationJsonObject?:
53
+ | CreateAddressV2ConflictResponseBody
54
+ | undefined;
55
+ fourHundredAndTwentyTwoApplicationJsonObject?:
56
+ | CreateAddressV2UnprocessableEntityResponseBody
57
+ | undefined;
58
+ };
59
+
60
+ export const CreateAddressV2Response$zodSchema: z.ZodType<
61
+ CreateAddressV2Response
62
+ > = z.object({
63
+ AddressWithMetadataResponse: AddressWithMetadataResponse$zodSchema.optional(),
64
+ ContentType: z.string(),
65
+ RawResponse: z.custom<Response>(x => x instanceof Response),
66
+ StatusCode: z.int(),
67
+ fourHundredAndNineApplicationJsonObject: z.lazy(() =>
68
+ CreateAddressV2ConflictResponseBody$zodSchema
69
+ ).optional(),
70
+ fourHundredAndTwentyTwoApplicationJsonObject: z.lazy(() =>
71
+ CreateAddressV2UnprocessableEntityResponseBody$zodSchema
72
+ ).optional(),
73
+ });