@shippo/shippo-mcp 2.0.3 → 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 (157) hide show
  1. package/bin/mcp-server.js +1477 -691
  2. package/bin/mcp-server.js.map +35 -15
  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/defaultparceltemplate.d.ts +2 -71
  80. package/esm/models/defaultparceltemplate.d.ts.map +1 -1
  81. package/esm/models/defaultparceltemplate.js +2 -62
  82. package/esm/models/defaultparceltemplate.js.map +1 -1
  83. package/esm/models/geocoordinates.d.ts +10 -0
  84. package/esm/models/geocoordinates.d.ts.map +1 -0
  85. package/esm/models/geocoordinates.js +9 -0
  86. package/esm/models/geocoordinates.js.map +1 -0
  87. package/esm/models/order.d.ts +1 -29
  88. package/esm/models/order.d.ts.map +1 -1
  89. package/esm/models/order.js +1 -25
  90. package/esm/models/order.js.map +1 -1
  91. package/esm/models/parseaddressop.d.ts +20 -0
  92. package/esm/models/parseaddressop.d.ts.map +1 -0
  93. package/esm/models/parseaddressop.js +25 -0
  94. package/esm/models/parseaddressop.js.map +1 -0
  95. package/esm/models/parsedaddress.d.ts +16 -0
  96. package/esm/models/parsedaddress.d.ts.map +1 -0
  97. package/esm/models/parsedaddress.js +15 -0
  98. package/esm/models/parsedaddress.js.map +1 -0
  99. package/esm/models/recommendedaddressv2.d.ts +21 -0
  100. package/esm/models/recommendedaddressv2.d.ts.map +1 -0
  101. package/esm/models/recommendedaddressv2.js +21 -0
  102. package/esm/models/recommendedaddressv2.js.map +1 -0
  103. package/esm/models/userparceltemplate.d.ts +5 -57
  104. package/esm/models/userparceltemplate.d.ts.map +1 -1
  105. package/esm/models/userparceltemplate.js +5 -49
  106. package/esm/models/userparceltemplate.js.map +1 -1
  107. package/esm/models/userparceltemplateupdaterequest.d.ts +4 -45
  108. package/esm/models/userparceltemplateupdaterequest.d.ts.map +1 -1
  109. package/esm/models/userparceltemplateupdaterequest.js +4 -38
  110. package/esm/models/userparceltemplateupdaterequest.js.map +1 -1
  111. package/esm/models/userparceltemplatewithoutcarriertemplatecreaterequest.d.ts +4 -45
  112. package/esm/models/userparceltemplatewithoutcarriertemplatecreaterequest.d.ts.map +1 -1
  113. package/esm/models/userparceltemplatewithoutcarriertemplatecreaterequest.js +4 -38
  114. package/esm/models/userparceltemplatewithoutcarriertemplatecreaterequest.js.map +1 -1
  115. package/esm/models/validateaddressv2op.d.ts +265 -0
  116. package/esm/models/validateaddressv2op.d.ts.map +1 -0
  117. package/esm/models/validateaddressv2op.js +258 -0
  118. package/esm/models/validateaddressv2op.js.map +1 -0
  119. package/esm/models/validationresultv2.d.ts +15 -0
  120. package/esm/models/validationresultv2.d.ts.map +1 -0
  121. package/esm/models/validationresultv2.js +14 -0
  122. package/esm/models/validationresultv2.js.map +1 -0
  123. package/manifest.json +17 -5
  124. package/package.json +1 -1
  125. package/src/funcs/{addressesCreate.ts → addressesCreateV1.ts} +1 -1
  126. package/src/funcs/addressesCreateV2.ts +178 -0
  127. package/src/funcs/addressesParse.ts +178 -0
  128. package/src/funcs/addressesValidateV2.ts +188 -0
  129. package/src/lib/config.ts +2 -2
  130. package/src/mcp-server/mcp-server.ts +1 -1
  131. package/src/mcp-server/server.ts +9 -3
  132. package/src/mcp-server/tools/addressesCreateV1.ts +58 -0
  133. package/src/mcp-server/tools/addressesCreateV2.ts +92 -0
  134. package/src/mcp-server/tools/addressesParse.ts +76 -0
  135. package/src/mcp-server/tools/addressesValidate.ts +12 -3
  136. package/src/mcp-server/tools/addressesValidateV2.ts +105 -0
  137. package/src/mcp-server/tools/ordersList.ts +20 -2
  138. package/src/models/addressanalysisv2.ts +41 -0
  139. package/src/models/addresscreaterequestv2.ts +64 -0
  140. package/src/models/addressdatav2.ts +56 -0
  141. package/src/models/addressv2.ts +34 -0
  142. package/src/models/addressvalidationresultv2.ts +34 -0
  143. package/src/models/addresswithmetadataresponse.ts +25 -0
  144. package/src/models/confidenceresult.ts +36 -0
  145. package/src/models/createaddressv2op.ts +73 -0
  146. package/src/models/defaultparceltemplate.ts +5 -122
  147. package/src/models/geocoordinates.ts +18 -0
  148. package/src/models/order.ts +2 -61
  149. package/src/models/parseaddressop.ts +44 -0
  150. package/src/models/parsedaddress.ts +32 -0
  151. package/src/models/recommendedaddressv2.ts +43 -0
  152. package/src/models/userparceltemplate.ts +11 -90
  153. package/src/models/userparceltemplateupdaterequest.ts +9 -62
  154. package/src/models/userparceltemplatewithoutcarriertemplatecreaterequest.ts +9 -70
  155. package/src/models/validateaddressv2op.ts +319 -0
  156. package/src/models/validationresultv2.ts +29 -0
  157. package/src/mcp-server/tools/addressesCreate.ts +0 -74
@@ -0,0 +1,92 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { addressesCreateV2 } from "../../funcs/addressesCreateV2.js";
6
+ import { AddressCreateRequestV2$zodSchema } from "../../models/addresscreaterequestv2.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: AddressCreateRequestV2$zodSchema,
11
+ };
12
+
13
+ export const tool$addressesCreateV2: ToolDefinition<typeof args> = {
14
+ name: "addresses-create-v2",
15
+ description:
16
+ `**PRIMARY ADDRESS CREATION TOOL** - Use this tool to create and save address records.
17
+
18
+ This is the recommended v2 endpoint for creating addresses with a cleaner, standardized format.
19
+
20
+ **Required Fields:**
21
+ - \`name\`: The addressee's name (max 64 chars)
22
+ - \`address_line_1\`: Street address (1-100 chars)
23
+ - \`country_code\`: ISO 3166 country code (2 chars, e.g., "US")
24
+
25
+ **Optional Fields:**
26
+ - \`organization\`: Company/organization name
27
+ - \`email\`: Email address
28
+ - \`phone\`: Phone number
29
+ - \`address_line_2\`: Apt, suite, unit, etc.
30
+ - \`city_locality\`: City name
31
+ - \`state_province\`: State/province abbreviation
32
+ - \`postal_code\`: ZIP/postal code
33
+ - \`address_type\`: unknown, residential, commercial, po_box, military
34
+
35
+ **Example Request:**
36
+ \`\`\`json
37
+ {
38
+ "name": "Wilson",
39
+ "organization": "Shippo",
40
+ "email": "user@shippo.com",
41
+ "phone": "+1-4155550132",
42
+ "address_line_1": "731 Market Street",
43
+ "address_line_2": "#200",
44
+ "city_locality": "San Francisco",
45
+ "state_province": "CA",
46
+ "postal_code": "94103",
47
+ "country_code": "US",
48
+ "address_type": "commercial"
49
+ }
50
+ \`\`\`
51
+
52
+ **Response includes:**
53
+ - \`id\`: Unique address identifier for future reference
54
+ - \`address\`: The saved address data
55
+ - \`created_at\`/\`updated_at\`: Timestamps
56
+
57
+ **Use Cases:**
58
+ - Save addresses for reuse in shipments
59
+ - Build an address book
60
+ - Store customer shipping addresses
61
+
62
+ **For address validation, use \`addresses-validate-v2\`** which provides
63
+ confidence scores, geo coordinates, and recommended corrections.
64
+ `,
65
+ scopes: ["write"],
66
+ annotations: {
67
+ "title": "",
68
+ "destructiveHint": false,
69
+ "idempotentHint": false,
70
+ "openWorldHint": false,
71
+ "readOnlyHint": false,
72
+ },
73
+ args,
74
+ tool: async (client, args, ctx) => {
75
+ const [result, apiCall] = await addressesCreateV2(
76
+ client,
77
+ args.request,
78
+ { fetchOptions: { signal: ctx.signal } },
79
+ ).$inspect();
80
+
81
+ if (!result.ok) {
82
+ return {
83
+ content: [{ type: "text", text: result.error.message }],
84
+ isError: true,
85
+ };
86
+ }
87
+
88
+ const value = result.value;
89
+
90
+ return formatResult(value, apiCall);
91
+ },
92
+ };
@@ -0,0 +1,76 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { addressesParse } from "../../funcs/addressesParse.js";
6
+ import { ParseAddressRequest$zodSchema } from "../../models/parseaddressop.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: ParseAddressRequest$zodSchema,
11
+ };
12
+
13
+ export const tool$addressesParse: ToolDefinition<typeof args> = {
14
+ name: "addresses-parse",
15
+ description:
16
+ `**ADDRESS PARSER** - Converts an unstructured address string into a structured address object.
17
+
18
+ Use this tool when you have a single address string (like from customer input, emails,
19
+ or CSV imports) and need to parse it into structured components.
20
+
21
+ **Input Format Tips:**
22
+ - Use commas (,) as delimiters between address parts
23
+ - Follow this order: street address, city, state, postal code, country
24
+ - Phone and email can be anywhere in the string
25
+
26
+ **Example Input:**
27
+ "Shippo 731 Market St #200, San Francisco, CA 94103 US shippo@shippo.com +1-555-999-8888"
28
+
29
+ **Example Output:**
30
+ \`\`\`json
31
+ {
32
+ "address_line_1": "731 MARKET ST",
33
+ "address_line_2": "#200",
34
+ "city_locality": "SAN FRANCISCO",
35
+ "state_province": "CA",
36
+ "postal_code": "94103",
37
+ "country_code": "US",
38
+ "email": "shippo@shippo.com",
39
+ "phone": "+1-555-999-8888"
40
+ }
41
+ \`\`\`
42
+
43
+ **Use Cases:**
44
+ - Parse addresses from customer contact forms
45
+ - Extract structured data from email signatures
46
+ - Process bulk address imports
47
+ - Clean up poorly formatted address data
48
+ `,
49
+ scopes: ["read"],
50
+ annotations: {
51
+ "title": "",
52
+ "destructiveHint": false,
53
+ "idempotentHint": false,
54
+ "openWorldHint": false,
55
+ "readOnlyHint": false,
56
+ },
57
+ args,
58
+ tool: async (client, args, ctx) => {
59
+ const [result, apiCall] = await addressesParse(
60
+ client,
61
+ args.request,
62
+ { fetchOptions: { signal: ctx.signal } },
63
+ ).$inspect();
64
+
65
+ if (!result.ok) {
66
+ return {
67
+ content: [{ type: "text", text: result.error.message }],
68
+ isError: true,
69
+ };
70
+ }
71
+
72
+ const value = result.value;
73
+
74
+ return formatResult(value, apiCall);
75
+ },
76
+ };
@@ -13,10 +13,19 @@ const args = {
13
13
  export const tool$addressesValidate: ToolDefinition<typeof args> = {
14
14
  name: "addresses-validate-existing",
15
15
  description:
16
- `**SECONDARY VALIDATION TOOL** - Validates an already created address using its ID.
16
+ `**DEPRECATED - Use \`addresses-validate-v2\` instead for better validation results.**
17
17
 
18
- Use this tool only when you have an existing address ID and need to re-validate it.
19
- For new address validation, prefer the addresses-create tool with validate=true.
18
+ This v1 endpoint validates an already created address using its ID.
19
+ It only works on addresses that have been saved to Shippo's address book.
20
+
21
+ **Prefer \`addresses-validate-v2\`** which:
22
+ - Validates any address (no need to create first)
23
+ - Returns confidence scores (high/medium/low)
24
+ - Provides recommended address corrections
25
+ - Returns geo coordinates (latitude/longitude)
26
+ - Identifies residential vs commercial addresses
27
+
28
+ Only use this tool if you specifically need to re-validate an existing address record by ID.
20
29
  `,
21
30
  scopes: ["read", "validation"],
22
31
  annotations: {
@@ -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");