diff --git a/.devcontainer/setup.sh b/.devcontainer/setup.sh index 99077bb..46f2c5f 100644 --- a/.devcontainer/setup.sh +++ b/.devcontainer/setup.sh @@ -7,8 +7,8 @@ curl -fsSL https://raw.githubusercontent.com/speakeasy-api/speakeasy/main/instal rmdir samples || true mkdir samples -npm install -npm install -g ts-node +npm install --ignore-scripts +npm install -g ts-node --ignore-scripts npm link npm link mcp-hubspot TS_CONFIG_CONTENT=$(cat <", "key1": "", "key2": ""} default: - '*/*': "0xDC1CcbAA6F" + '*/*': "0x6AebEB6dfa" getCompany: speakeasy-default-get-company: parameters: @@ -219,22 +224,21 @@ examples: archived: false responses: "200": - application/json: {"associations": {"key": {"paging": {"next": {"link": "?after=NTI1Cg%3D%3D", "after": "NTI1Cg%3D%3D"}}, "results": []}}, "createdAt": "2025-10-24T12:05:59.595Z", "id": "", "properties": {"amount": "1500.00", "closedate": "2019-12-07T16:50:06.678Z", "createdate": "2019-10-30T03:30:17.883Z", "dealname": "Custom data integrations", "dealstage": "presentationscheduled", "hs_lastmodifieddate": "2019-12-07T16:50:06.678Z", "hubspot_owner_id": "910901", "pipeline": "default"}, "updatedAt": "2023-04-22T05:13:50.650Z"} + application/json: {"createdAt": "2025-08-25T15:16:09.699Z", "id": "", "properties": {"amount": "1500.00", "closedate": "2019-12-07T16:50:06.678Z", "createdate": "2019-10-30T03:30:17.883Z", "dealname": "Custom data integrations", "dealstage": "presentationscheduled", "hs_lastmodifieddate": "2019-12-07T16:50:06.678Z", "hubspot_owner_id": "910901", "pipeline": "default"}, "updatedAt": "2025-05-22T12:21:57.653Z"} default: - '*/*': "0xBCBF4Fa1AB" + '*/*': "0x095Bfee7E8" updateCompany: speakeasy-default-update-company: parameters: path: companyId: "" - query: {} requestBody: - application/json: {"properties": {"property_date": "1572480000000", "property_radio": "option_1", "property_number": "17", "property_string": "value", "property_checkbox": "false", "property_dropdown": "choice_b", "property_multiple_checkboxes": "chocolate;strawberry"}} + application/json: {"properties": {"amount": "1500.00", "dealname": "Custom data integrations", "pipeline": "default", "closedate": "2019-12-07T16:50:06.678Z", "dealstage": "presentationscheduled", "hubspot_owner_id": "910901"}} responses: "200": - application/json: {"createdAt": "2019-10-30T03:30:17.883Z", "archived": false, "id": "512", "properties": {"property_date": "1572480000000", "property_radio": "option_1", "property_number": "17", "property_string": "value", "property_checkbox": "false", "property_dropdown": "choice_b", "property_multiple_checkboxes": "chocolate;strawberry"}, "updatedAt": "2019-12-07T16:50:06.678Z"} + application/json: {"createdAt": "2019-10-30T03:30:17.883Z", "archived": false, "id": "512", "properties": {"amount": "1500.00", "closedate": "2019-12-07T16:50:06.678Z", "createdate": "2019-10-30T03:30:17.883Z", "dealname": "Custom data integrations", "dealstage": "presentationscheduled", "hs_lastmodifieddate": "2019-12-07T16:50:06.678Z", "hubspot_owner_id": "910901", "pipeline": "default"}, "updatedAt": "2019-12-07T16:50:06.678Z"} default: - '*/*': "0xb3E6c6BfBC" + '*/*': "0xdceFCcA8Bb" getContact: speakeasy-default-get-contact: parameters: @@ -244,30 +248,30 @@ examples: archived: false responses: "200": - application/json: {"associations": {"key": {"paging": {"next": {"link": "?after=NTI1Cg%3D%3D", "after": "NTI1Cg%3D%3D"}}, "results": []}}, "createdAt": "2024-08-17T15:34:51.440Z", "id": "", "properties": {"amount": "1500.00", "closedate": "2019-12-07T16:50:06.678Z", "createdate": "2019-10-30T03:30:17.883Z", "dealname": "Custom data integrations", "dealstage": "presentationscheduled", "hs_lastmodifieddate": "2019-12-07T16:50:06.678Z", "hubspot_owner_id": "910901", "pipeline": "default"}, "updatedAt": "2024-01-04T02:16:38.002Z"} + application/json: {"createdAt": "2024-04-26T22:09:40.861Z", "id": "", "properties": {"amount": "1500.00", "closedate": "2019-12-07T16:50:06.678Z", "createdate": "2019-10-30T03:30:17.883Z", "dealname": "Custom data integrations", "dealstage": "presentationscheduled", "hs_lastmodifieddate": "2019-12-07T16:50:06.678Z", "hubspot_owner_id": "910901", "pipeline": "default"}, "updatedAt": "2024-05-07T19:22:28.190Z"} default: - '*/*': "0xaE60343E90" + '*/*': "0x8ef9DAF6B0" updateContact: speakeasy-default-update-contact: parameters: path: contactId: "" requestBody: - application/json: {"properties": {"property_date": "1572480000000", "property_radio": "option_1", "property_number": "17", "property_string": "value", "property_checkbox": "false", "property_dropdown": "choice_b", "property_multiple_checkboxes": "chocolate;strawberry"}} + application/json: {"properties": {"amount": "1500.00", "dealname": "Custom data integrations", "pipeline": "default", "closedate": "2019-12-07T16:50:06.678Z", "dealstage": "presentationscheduled", "hubspot_owner_id": "910901"}} responses: "200": - application/json: {"createdAt": "2019-10-30T03:30:17.883Z", "archived": false, "id": "512", "properties": {"property_date": "1572480000000", "property_radio": "option_1", "property_number": "17", "property_string": "value", "property_checkbox": "false", "property_dropdown": "choice_b", "property_multiple_checkboxes": "chocolate;strawberry"}, "updatedAt": "2019-12-07T16:50:06.678Z"} + application/json: {"createdAt": "2019-10-30T03:30:17.883Z", "archived": false, "id": "512", "properties": {"amount": "1500.00", "closedate": "2019-12-07T16:50:06.678Z", "createdate": "2019-10-30T03:30:17.883Z", "dealname": "Custom data integrations", "dealstage": "presentationscheduled", "hs_lastmodifieddate": "2019-12-07T16:50:06.678Z", "hubspot_owner_id": "910901", "pipeline": "default"}, "updatedAt": "2019-12-07T16:50:06.678Z"} default: - '*/*': "0x3b85af6eBc" + '*/*': "0xded1d6FB0E" createContact: speakeasy-default-create-contact: requestBody: application/json: {"associations": [{"types": [{"associationCategory": "HUBSPOT_DEFINED", "associationTypeId": 2}], "to": {"id": "101"}}], "properties": {"amount": "1500.00", "dealname": "Custom data integrations", "pipeline": "default", "closedate": "2019-12-07T16:50:06.678Z", "dealstage": "presentationscheduled", "hubspot_owner_id": "910901"}} responses: "201": - application/json: {"createdAt": "2019-10-30T03:30:17.883Z", "archived": false, "id": "512", "properties": {"property_date": "1572480000000", "property_radio": "option_1", "property_number": "17", "property_string": "value", "property_checkbox": "false", "property_dropdown": "choice_b", "property_multiple_checkboxes": "chocolate;strawberry"}, "updatedAt": "2019-12-07T16:50:06.678Z"} + application/json: {"createdAt": "2019-10-30T03:30:17.883Z", "archived": false, "id": "512", "properties": {"amount": "1500.00", "closedate": "2019-12-07T16:50:06.678Z", "createdate": "2019-10-30T03:30:17.883Z", "dealname": "Custom data integrations", "dealstage": "presentationscheduled", "hs_lastmodifieddate": "2019-12-07T16:50:06.678Z", "hubspot_owner_id": "910901", "pipeline": "default"}, "updatedAt": "2019-12-07T16:50:06.678Z"} default: - '*/*': "0xCaDC2a12a5" + '*/*': "0x699Faed7d0" getDeal: speakeasy-default-get-deal: parameters: @@ -277,57 +281,56 @@ examples: archived: false responses: "200": - application/json: {"associations": {"key": {"paging": {"next": {"link": "?after=NTI1Cg%3D%3D", "after": "NTI1Cg%3D%3D"}}, "results": []}, "key1": {"paging": {"next": {"link": "?after=NTI1Cg%3D%3D", "after": "NTI1Cg%3D%3D"}}, "results": [{"id": "", "type": ""}, {"id": "", "type": ""}, {"id": "", "type": ""}]}}, "createdAt": "2023-07-20T20:21:19.136Z", "id": "", "properties": {"amount": "1500.00", "closedate": "2019-12-07T16:50:06.678Z", "createdate": "2019-10-30T03:30:17.883Z", "dealname": "Custom data integrations", "dealstage": "presentationscheduled", "hs_lastmodifieddate": "2019-12-07T16:50:06.678Z", "hubspot_owner_id": "910901", "pipeline": "default"}, "updatedAt": "2024-03-20T16:06:40.704Z"} + application/json: {"createdAt": "2023-09-13T04:14:42.703Z", "id": "", "properties": {"amount": "1500.00", "closedate": "2019-12-07T16:50:06.678Z", "createdate": "2019-10-30T03:30:17.883Z", "dealname": "Custom data integrations", "dealstage": "presentationscheduled", "hs_lastmodifieddate": "2019-12-07T16:50:06.678Z", "hubspot_owner_id": "910901", "pipeline": "default"}, "updatedAt": "2024-11-30T01:20:41.885Z"} default: - '*/*': "0xd7Dbec5428" + '*/*': "0x23d01cBbaF" updateDeal: speakeasy-default-update-deal: parameters: path: dealId: "" - query: {} requestBody: - application/json: {"properties": {"property_date": "1572480000000", "property_radio": "option_1", "property_number": "17", "property_string": "value", "property_checkbox": "false", "property_dropdown": "choice_b", "property_multiple_checkboxes": "chocolate;strawberry"}} + application/json: {"properties": {"amount": "1500.00", "dealname": "Custom data integrations", "pipeline": "default", "closedate": "2019-12-07T16:50:06.678Z", "dealstage": "presentationscheduled", "hubspot_owner_id": "910901"}} responses: "200": - application/json: {"createdAt": "2019-10-30T03:30:17.883Z", "archived": false, "id": "512", "properties": {"property_date": "1572480000000", "property_radio": "option_1", "property_number": "17", "property_string": "value", "property_checkbox": "false", "property_dropdown": "choice_b", "property_multiple_checkboxes": "chocolate;strawberry"}, "updatedAt": "2019-12-07T16:50:06.678Z"} + application/json: {"createdAt": "2019-10-30T03:30:17.883Z", "archived": false, "id": "512", "properties": {"amount": "1500.00", "closedate": "2019-12-07T16:50:06.678Z", "createdate": "2019-10-30T03:30:17.883Z", "dealname": "Custom data integrations", "dealstage": "presentationscheduled", "hs_lastmodifieddate": "2019-12-07T16:50:06.678Z", "hubspot_owner_id": "910901", "pipeline": "default"}, "updatedAt": "2019-12-07T16:50:06.678Z"} default: - '*/*': "0xbd6bf0D753" + '*/*': "0xa54Ebb05D3" createDeal: speakeasy-default-create-deal: requestBody: application/json: {"associations": [{"types": [{"associationCategory": "HUBSPOT_DEFINED", "associationTypeId": 2}], "to": {"id": "101"}}], "properties": {"amount": "1500.00", "dealname": "Custom data integrations", "pipeline": "default", "closedate": "2019-12-07T16:50:06.678Z", "dealstage": "presentationscheduled", "hubspot_owner_id": "910901"}} responses: "201": - application/json: {"createdAt": "2019-10-30T03:30:17.883Z", "archived": false, "id": "512", "properties": {"property_date": "1572480000000", "property_radio": "option_1", "property_number": "17", "property_string": "value", "property_checkbox": "false", "property_dropdown": "choice_b", "property_multiple_checkboxes": "chocolate;strawberry"}, "updatedAt": "2019-12-07T16:50:06.678Z"} + application/json: {"createdAt": "2019-10-30T03:30:17.883Z", "archived": false, "id": "512", "properties": {"amount": "1500.00", "closedate": "2019-12-07T16:50:06.678Z", "createdate": "2019-10-30T03:30:17.883Z", "dealname": "Custom data integrations", "dealstage": "presentationscheduled", "hs_lastmodifieddate": "2019-12-07T16:50:06.678Z", "hubspot_owner_id": "910901", "pipeline": "default"}, "updatedAt": "2019-12-07T16:50:06.678Z"} default: - '*/*': "0xad38C8Ad0A" + '*/*': "0xCB53a70BeA" searchCompanies: speakeasy-default-search-companies: requestBody: application/json: {} responses: "200": - application/json: {"total": 417690, "paging": {"next": {"link": "?after=NTI1Cg%3D%3D", "after": "NTI1Cg%3D%3D"}}, "results": [{"createdAt": "2019-10-30T03:30:17.883Z", "archived": false, "id": "512", "properties": {"amount": "1500.00", "closedate": "2019-12-07T16:50:06.678Z", "createdate": "2019-10-30T03:30:17.883Z", "dealname": "Custom data integrations", "dealstage": "presentationscheduled", "hs_lastmodifieddate": "2019-12-07T16:50:06.678Z", "hubspot_owner_id": "910901", "pipeline": "default"}, "updatedAt": "2019-12-07T16:50:06.678Z"}]} + application/json: {"total": 243268, "paging": {"next": {"link": "?after=NTI1Cg%3D%3D", "after": "NTI1Cg%3D%3D"}}, "results": [{"createdAt": "2019-10-30T03:30:17.883Z", "archived": false, "id": "512", "properties": {"amount": "1500.00", "closedate": "2019-12-07T16:50:06.678Z", "createdate": "2019-10-30T03:30:17.883Z", "dealname": "Custom data integrations", "dealstage": "presentationscheduled", "hs_lastmodifieddate": "2019-12-07T16:50:06.678Z", "hubspot_owner_id": "910901", "pipeline": "default"}, "updatedAt": "2019-12-07T16:50:06.678Z"}]} default: - '*/*': "0x35e6bBbc27" + '*/*': "0x7194B2Fbdc" searchContacts: speakeasy-default-search-contacts: requestBody: application/json: {} responses: "200": - application/json: {"total": 748860, "paging": {"next": {"link": "?after=NTI1Cg%3D%3D", "after": "NTI1Cg%3D%3D"}}, "results": [{"createdAt": "2019-10-30T03:30:17.883Z", "archived": false, "id": "512", "properties": {"amount": "1500.00", "closedate": "2019-12-07T16:50:06.678Z", "createdate": "2019-10-30T03:30:17.883Z", "dealname": "Custom data integrations", "dealstage": "presentationscheduled", "hs_lastmodifieddate": "2019-12-07T16:50:06.678Z", "hubspot_owner_id": "910901", "pipeline": "default"}, "updatedAt": "2019-12-07T16:50:06.678Z"}]} + application/json: {"total": 473738, "paging": {"next": {"link": "?after=NTI1Cg%3D%3D", "after": "NTI1Cg%3D%3D"}}, "results": [{"createdAt": "2019-10-30T03:30:17.883Z", "archived": false, "id": "512", "properties": {"amount": "1500.00", "closedate": "2019-12-07T16:50:06.678Z", "createdate": "2019-10-30T03:30:17.883Z", "dealname": "Custom data integrations", "dealstage": "presentationscheduled", "hs_lastmodifieddate": "2019-12-07T16:50:06.678Z", "hubspot_owner_id": "910901", "pipeline": "default"}, "updatedAt": "2019-12-07T16:50:06.678Z"}]} default: - '*/*': "0x2f94F8F016" + '*/*': "0xD472AaCEA0" searchDeals: speakeasy-default-search-deals: requestBody: application/json: {} responses: "200": - application/json: {"total": 265805, "paging": {"next": {"link": "?after=NTI1Cg%3D%3D", "after": "NTI1Cg%3D%3D"}}, "results": [{"createdAt": "2019-10-30T03:30:17.883Z", "archived": false, "id": "512", "properties": {"amount": "1500.00", "closedate": "2019-12-07T16:50:06.678Z", "createdate": "2019-10-30T03:30:17.883Z", "dealname": "Custom data integrations", "dealstage": "presentationscheduled", "hs_lastmodifieddate": "2019-12-07T16:50:06.678Z", "hubspot_owner_id": "910901", "pipeline": "default"}, "updatedAt": "2019-12-07T16:50:06.678Z"}]} + application/json: {"total": 99162, "paging": {"next": {"link": "?after=NTI1Cg%3D%3D", "after": "NTI1Cg%3D%3D"}}, "results": [{"createdAt": "2019-10-30T03:30:17.883Z", "archived": false, "id": "512", "properties": {"amount": "1500.00", "closedate": "2019-12-07T16:50:06.678Z", "createdate": "2019-10-30T03:30:17.883Z", "dealname": "Custom data integrations", "dealstage": "presentationscheduled", "hs_lastmodifieddate": "2019-12-07T16:50:06.678Z", "hubspot_owner_id": "910901", "pipeline": "default"}, "updatedAt": "2019-12-07T16:50:06.678Z"}]} default: - '*/*': "0x943fFbCFA3" -examplesVersion: 1.0.0 + '*/*': "0x1bbfBe91ad" +examplesVersion: 1.0.2 generatedTests: {} diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 8658bed..f002174 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -7,6 +7,7 @@ generation: maintainOpenAPIOrder: true usageSnippets: optionalPropertyRendering: withExample + sdkInitStyle: constructor useClassNamesForArrayFields: true fixes: nameResolutionDec2023: true @@ -14,26 +15,42 @@ generation: parameterOrderingFeb2024: true requestResponseComponentNamesFeb2024: true securityFeb2025: true + sharedErrorComponentsApr2025: false auth: oAuth2ClientCredentialsEnabled: true oAuth2PasswordEnabled: true + hoistGlobalSecurity: true + schemas: + allOfMergeStrategy: shallowMerge + requestBodyFieldName: "" + tests: + generateTests: true + generateNewTests: false + skipResponseBodyAssertions: false typescript: - version: 0.1.0 + version: 0.2.0 + acceptHeaderEnum: true additionalDependencies: dependencies: {} devDependencies: {} peerDependencies: {} additionalPackageJSON: {} + additionalScripts: {} + alwaysIncludeInboundAndOutbound: false author: speakeasyapi + baseErrorName: HubspotError clientServerStatusCodesAsErrors: true + constFieldsAlwaysOptional: true defaultErrorName: APIError enableCustomCodeRegions: false enableMCPServer: true enableReactQuery: false enumFormat: union envVarPrefix: HUBSPOT + exportZodModelNamespace: false flattenGlobalSecurity: true flatteningOrder: parameters-first + generateExamples: true imports: option: openapi paths: @@ -46,9 +63,13 @@ typescript: jsonpath: rfc9535 maxMethodParams: 0 methodArguments: require-security-and-request + modelPropertyCasing: camel moduleFormat: dual outputModelSuffix: output packageName: mcp-hubspot responseFormat: flat + sseFlatResponse: false templateVersion: v2 + usageSDKInitImports: [] useIndexModules: true + zodVersion: v3 diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index a2da036..c33d297 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,4 +1,4 @@ -speakeasyVersion: 1.521.1 +speakeasyVersion: 1.653.0 sources: CRM: sourceNamespace: crm @@ -9,20 +9,20 @@ sources: - v3 HubspotCRM: sourceNamespace: hubspot-crm - sourceRevisionDigest: sha256:068f049648f508cd2c1f0b3f74fdec83a2920b10763541b84a05644ba5fac7f9 - sourceBlobDigest: sha256:fd3bb26f0d19170b271fae7398ffb1b2dbe48799b6e7c4dee95ec5c58302f332 + sourceRevisionDigest: sha256:bdaa622c04c7175412a08b756862795f1d99e297146f8e2b525f3963e534147e + sourceBlobDigest: sha256:b1d0f16211f77123ade749fadc389b583fdf73c524f6bf7014da1fae2f4b2d6a tags: - latest - - speakeasy-sdk-regen-1742493224 + - speakeasy-sdk-regen-1743711404 - v3 targets: hubspot: source: HubspotCRM sourceNamespace: hubspot-crm - sourceRevisionDigest: sha256:068f049648f508cd2c1f0b3f74fdec83a2920b10763541b84a05644ba5fac7f9 - sourceBlobDigest: sha256:fd3bb26f0d19170b271fae7398ffb1b2dbe48799b6e7c4dee95ec5c58302f332 + sourceRevisionDigest: sha256:bdaa622c04c7175412a08b756862795f1d99e297146f8e2b525f3963e534147e + sourceBlobDigest: sha256:b1d0f16211f77123ade749fadc389b583fdf73c524f6bf7014da1fae2f4b2d6a codeSamplesNamespace: hubspot-crm-typescript-code-samples - codeSamplesRevisionDigest: sha256:d61859db7b587ca10a3a1abaff25b520db3c9e1e3f8cfde32e27cd069c6e5a2a + codeSamplesRevisionDigest: sha256:9d63f8a7ebe06cb08da4c6542e29daea2a82959c4df9bb24a952e55d7fc476c3 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/FUNCTIONS.md b/FUNCTIONS.md index 4dfef73..7b0d8f7 100644 --- a/FUNCTIONS.md +++ b/FUNCTIONS.md @@ -21,7 +21,6 @@ specific category of applications. ```typescript import { HubspotCore } from "mcp-hubspot/core.js"; import { basicGetProperties } from "mcp-hubspot/funcs/basicGetProperties.js"; -import { SDKValidationError } from "mcp-hubspot/models/errors/sdkvalidationerror.js"; // Use `HubspotCore` for best tree-shaking performance. // You can create one instance of it to use across an application. @@ -31,30 +30,14 @@ const hubspot = new HubspotCore({ async function run() { const res = await basicGetProperties(hubspot, { - objectType: "deals", + objectType: "contacts", }); - - switch (true) { - case res.ok: - // The success case will be handled outside of the switch block - break; - case res.error instanceof SDKValidationError: - // Pretty-print validation errors. - return console.log(res.error.pretty()); - case res.error instanceof Error: - return console.log(res.error); - default: - // TypeScript's type checking will fail on the following line if the above - // cases were not exhaustive. - res.error satisfies never; - throw new Error("Assertion failed: expected error checks to be exhaustive: " + res.error); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("basicGetProperties failed:", res.error); } - - - const { value: result } = res; - - // Handle the result - console.log(result); } run(); diff --git a/README.md b/README.md index f60284a..ad31e12 100644 --- a/README.md +++ b/README.md @@ -67,10 +67,7 @@ bun add mcp-hubspot ### Yarn ```bash -yarn add mcp-hubspot zod - -# Note that Yarn does not install peer dependencies automatically. You will need -# to install zod as shown above. +yarn add mcp-hubspot ``` > [!NOTE] @@ -181,10 +178,9 @@ const hubspot = new Hubspot({ async function run() { const result = await hubspot.basic.getProperties({ - objectType: "deals", + objectType: "contacts", }); - // Handle the result console.log(result); } @@ -214,10 +210,9 @@ const hubspot = new Hubspot({ async function run() { const result = await hubspot.basic.getProperties({ - objectType: "deals", + objectType: "contacts", }); - // Handle the result console.log(result); } @@ -244,7 +239,6 @@ run(); * [updateDeal](docs/sdks/basic/README.md#updatedeal) - Update * [createDeal](docs/sdks/basic/README.md#createdeal) - Create - ### [search](docs/sdks/search/README.md) * [searchCompanies](docs/sdks/search/README.md#searchcompanies) - Search for companies @@ -300,7 +294,7 @@ const hubspot = new Hubspot({ async function run() { const result = await hubspot.basic.getProperties({ - objectType: "deals", + objectType: "contacts", }, { retries: { strategy: "backoff", @@ -314,7 +308,6 @@ async function run() { }, }); - // Handle the result console.log(result); } @@ -342,10 +335,9 @@ const hubspot = new Hubspot({ async function run() { const result = await hubspot.basic.getProperties({ - objectType: "deals", + objectType: "contacts", }); - // Handle the result console.log(result); } @@ -357,51 +349,38 @@ run(); ## Error Handling -If the request fails due to, for example 4XX or 5XX status codes, it will throw a `APIError`. +[`HubspotError`](./src/models/errors/hubspoterror.ts) is the base class for all HTTP error responses. It has the following properties: -| Error Type | Status Code | Content Type | -| --------------- | ----------- | ------------ | -| errors.APIError | 4XX, 5XX | \*/\* | +| Property | Type | Description | +| ------------------- | ---------- | ------------------------------------------------------ | +| `error.message` | `string` | Error message | +| `error.statusCode` | `number` | HTTP response status code eg `404` | +| `error.headers` | `Headers` | HTTP response headers | +| `error.body` | `string` | HTTP body. Can be empty string if no body is returned. | +| `error.rawResponse` | `Response` | Raw HTTP response | +### Example ```typescript import { Hubspot } from "mcp-hubspot"; -import { SDKValidationError } from "mcp-hubspot/models/errors"; +import * as errors from "mcp-hubspot/models/errors"; const hubspot = new Hubspot({ hubspotToken: process.env["HUBSPOT_HUBSPOT_TOKEN"] ?? "", }); async function run() { - let result; try { - result = await hubspot.basic.getProperties({ - objectType: "deals", + const result = await hubspot.basic.getProperties({ + objectType: "contacts", }); - // Handle the result console.log(result); - } catch (err) { - switch (true) { - // The server response does not match the expected SDK schema - case (err instanceof SDKValidationError): - { - // Pretty-print will provide a human-readable multi-line error message - console.error(err.pretty()); - // Raw value may also be inspected - console.error(err.rawValue); - return; - } - apierror.js; - // Server returned an error status code or an unknown content type - case (err instanceof APIError): { - console.error(err.statusCode); - console.error(err.rawResponse.body); - return; - } - default: { - // Other errors such as network errors, see HTTPClientErrors for more details - throw err; - } + } catch (error) { + if (error instanceof errors.HubspotError) { + console.log(error.message); + console.log(error.statusCode); + console.log(error.body); + console.log(error.headers); } } } @@ -410,17 +389,26 @@ run(); ``` -Validation errors can also occur when either method arguments or data returned from the server do not match the expected format. The `SDKValidationError` that is thrown as a result will capture the raw value that failed validation in an attribute called `rawValue`. Additionally, a `pretty()` method is available on this error that can be used to log a nicely formatted multi-line string since validation errors can list many issues and the plain error string may be difficult read when debugging. +### Error Classes +**Primary error:** +* [`HubspotError`](./src/models/errors/hubspoterror.ts): The base class for HTTP error responses. + +
Less common errors (6) -In some rare cases, the SDK can fail to get a response from the server or even make the request due to unexpected circumstances such as network conditions. These types of errors are captured in the `models/errors/httpclienterrors.ts` module: +
-| HTTP Client Error | Description | -| ---------------------------------------------------- | ---------------------------------------------------- | -| RequestAbortedError | HTTP request was aborted by the client | -| RequestTimeoutError | HTTP request timed out due to an AbortSignal signal | -| ConnectionError | HTTP client was unable to make a request to a server | -| InvalidRequestError | Any input used to create a request is invalid | -| UnexpectedClientError | Unrecognised or unexpected error | +**Network errors:** +* [`ConnectionError`](./src/models/errors/httpclienterrors.ts): HTTP client was unable to make a request to a server. +* [`RequestTimeoutError`](./src/models/errors/httpclienterrors.ts): HTTP request timed out due to an AbortSignal signal. +* [`RequestAbortedError`](./src/models/errors/httpclienterrors.ts): HTTP request was aborted by the client. +* [`InvalidRequestError`](./src/models/errors/httpclienterrors.ts): Any input used to create a request is invalid. +* [`UnexpectedClientError`](./src/models/errors/httpclienterrors.ts): Unrecognised or unexpected error. + + +**Inherit from [`HubspotError`](./src/models/errors/hubspoterror.ts)**: +* [`ResponseValidationError`](./src/models/errors/responsevalidationerror.ts): Type mismatch between the data returned from the server and the structure expected by the SDK. See `error.rawValue` for the raw value and `error.pretty()` for a nicely formatted multi-line string. + +
@@ -439,10 +427,9 @@ const hubspot = new Hubspot({ async function run() { const result = await hubspot.basic.getProperties({ - objectType: "deals", + objectType: "contacts", }); - // Handle the result console.log(result); } @@ -496,7 +483,7 @@ httpClient.addHook("requestError", (error, request) => { console.groupEnd(); }); -const sdk = new Hubspot({ httpClient }); +const sdk = new Hubspot({ httpClient: httpClient }); ``` diff --git a/RELEASES.md b/RELEASES.md index 56553b9..44c518c 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -8,4 +8,14 @@ Based on: ### Generated - [typescript v0.1.0] . ### Releases -- [NPM v0.1.0] https://www.npmjs.com/package/mcp-hubspot/v/0.1.0 - . \ No newline at end of file +- [NPM v0.1.0] https://www.npmjs.com/package/mcp-hubspot/v/0.1.0 - . + +## 2025-11-11 00:18:18 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.653.0 (2.748.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v0.2.0] . +### Releases +- [NPM v0.2.0] https://www.npmjs.com/package/mcp-hubspot/v/0.2.0 - . \ No newline at end of file diff --git a/RUNTIMES.md b/RUNTIMES.md index db7ea94..27731c3 100644 --- a/RUNTIMES.md +++ b/RUNTIMES.md @@ -2,9 +2,9 @@ This SDK is intended to be used in JavaScript runtimes that support ECMAScript 2020 or newer. The SDK uses the following features: -* [Web Fetch API][web-fetch] -* [Web Streams API][web-streams] and in particular `ReadableStream` -* [Async iterables][async-iter] using `Symbol.asyncIterator` +- [Web Fetch API][web-fetch] +- [Web Streams API][web-streams] and in particular `ReadableStream` +- [Async iterables][async-iter] using `Symbol.asyncIterator` [web-fetch]: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API [web-streams]: https://developer.mozilla.org/en-US/docs/Web/API/Streams_API @@ -25,7 +25,7 @@ Runtime environments that are explicitly supported are: The following `tsconfig.json` options are recommended for projects using this SDK in order to get static type support for features like async iterables, -streams and `fetch`-related APIs ([`for await...of`][for-await-of], +streams and `fetch`-related APIs ([`for await...of`][for-await-of], [`AbortSignal`][abort-signal], [`Request`][request], [`Response`][response] and so on): @@ -38,11 +38,11 @@ so on): { "compilerOptions": { "target": "es2020", // or higher - "lib": ["es2020", "dom", "dom.iterable"], + "lib": ["es2020", "dom", "dom.iterable"] } } ``` While `target` can be set to older ECMAScript versions, it may result in extra, unnecessary compatibility code being generated if you are not targeting old -runtimes. \ No newline at end of file +runtimes. diff --git a/USAGE.md b/USAGE.md index d3a6648..5607053 100644 --- a/USAGE.md +++ b/USAGE.md @@ -8,10 +8,9 @@ const hubspot = new Hubspot({ async function run() { const result = await hubspot.basic.getProperties({ - objectType: "deals", + objectType: "contacts", }); - // Handle the result console.log(result); } diff --git a/docs/models/components/associationcategory.md b/docs/models/components/associationcategory.md index 456d300..107df11 100644 --- a/docs/models/components/associationcategory.md +++ b/docs/models/components/associationcategory.md @@ -5,7 +5,7 @@ ```typescript import { AssociationCategory } from "mcp-hubspot/models/components"; -let value: AssociationCategory = "USER_DEFINED"; +let value: AssociationCategory = "HUBSPOT_DEFINED"; ``` ## Values diff --git a/docs/models/components/associationspec.md b/docs/models/components/associationspec.md index 3b005ab..faf951e 100644 --- a/docs/models/components/associationspec.md +++ b/docs/models/components/associationspec.md @@ -7,7 +7,7 @@ import { AssociationSpec } from "mcp-hubspot/models/components"; let value: AssociationSpec = { associationCategory: "USER_DEFINED", - associationTypeId: 652103, + associationTypeId: 754129, }; ``` diff --git a/docs/models/components/collectionresponseassociatedid.md b/docs/models/components/collectionresponseassociatedid.md index 1f8da0b..3f8b019 100644 --- a/docs/models/components/collectionresponseassociatedid.md +++ b/docs/models/components/collectionresponseassociatedid.md @@ -12,12 +12,7 @@ let value: CollectionResponseAssociatedId = { after: "NTI1Cg%3D%3D", }, }, - results: [ - { - id: "", - type: "", - }, - ], + results: [], }; ``` diff --git a/docs/models/components/collectionresponsewithtotalsimplepublicobjectforwardpaging.md b/docs/models/components/collectionresponsewithtotalsimplepublicobjectforwardpaging.md index 5e7f002..b977c46 100644 --- a/docs/models/components/collectionresponsewithtotalsimplepublicobjectforwardpaging.md +++ b/docs/models/components/collectionresponsewithtotalsimplepublicobjectforwardpaging.md @@ -6,7 +6,7 @@ import { CollectionResponseWithTotalSimplePublicObjectForwardPaging } from "mcp-hubspot/models/components"; let value: CollectionResponseWithTotalSimplePublicObjectForwardPaging = { - total: 431418, + total: 371377, paging: { next: { link: "?after=NTI1Cg%3D%3D", diff --git a/docs/models/components/filter.md b/docs/models/components/filter.md index e4c624f..a2311f8 100644 --- a/docs/models/components/filter.md +++ b/docs/models/components/filter.md @@ -7,7 +7,7 @@ import { Filter } from "mcp-hubspot/models/components"; let value: Filter = { propertyName: "", - operator: "GTE", + operator: "IN", }; ``` diff --git a/docs/models/components/filtergroup.md b/docs/models/components/filtergroup.md index d0d05ef..92b98d9 100644 --- a/docs/models/components/filtergroup.md +++ b/docs/models/components/filtergroup.md @@ -9,7 +9,7 @@ let value: FilterGroup = { filters: [ { propertyName: "", - operator: "CONTAINS_TOKEN", + operator: "LT", }, ], }; diff --git a/docs/models/components/operator.md b/docs/models/components/operator.md index 573c908..c661f05 100644 --- a/docs/models/components/operator.md +++ b/docs/models/components/operator.md @@ -7,7 +7,7 @@ null ```typescript import { Operator } from "mcp-hubspot/models/components"; -let value: Operator = "GT"; +let value: Operator = "BETWEEN"; ``` ## Values diff --git a/docs/models/components/publicassociationsforobject.md b/docs/models/components/publicassociationsforobject.md index 755c099..6e8861a 100644 --- a/docs/models/components/publicassociationsforobject.md +++ b/docs/models/components/publicassociationsforobject.md @@ -8,8 +8,8 @@ import { PublicAssociationsForObject } from "mcp-hubspot/models/components"; let value: PublicAssociationsForObject = { types: [ { - associationCategory: "USER_DEFINED", - associationTypeId: 590873, + associationCategory: "HUBSPOT_DEFINED", + associationTypeId: 551132, }, ], to: { diff --git a/docs/models/components/simplepublicobjectwithassociations.md b/docs/models/components/simplepublicobjectwithassociations.md index 26ba23a..df787de 100644 --- a/docs/models/components/simplepublicobjectwithassociations.md +++ b/docs/models/components/simplepublicobjectwithassociations.md @@ -6,7 +6,7 @@ import { SimplePublicObjectWithAssociations } from "mcp-hubspot/models/components"; let value: SimplePublicObjectWithAssociations = { - createdAt: new Date("2024-04-14T22:19:54.875Z"), + createdAt: new Date("2025-06-21T16:54:22.539Z"), id: "", properties: { "amount": "1500.00", @@ -18,7 +18,7 @@ let value: SimplePublicObjectWithAssociations = { "hubspot_owner_id": "910901", "pipeline": "default", }, - updatedAt: new Date("2023-05-29T11:30:35.227Z"), + updatedAt: new Date("2024-10-01T05:33:36.814Z"), }; ``` diff --git a/docs/models/components/valuewithtimestamp.md b/docs/models/components/valuewithtimestamp.md index c1e60da..e4af599 100644 --- a/docs/models/components/valuewithtimestamp.md +++ b/docs/models/components/valuewithtimestamp.md @@ -8,7 +8,7 @@ import { ValueWithTimestamp } from "mcp-hubspot/models/components"; let value: ValueWithTimestamp = { sourceType: "", value: "", - timestamp: new Date("2023-11-23T22:01:05.887Z"), + timestamp: new Date("2023-03-21T16:01:07.532Z"), }; ``` diff --git a/docs/models/operations/createcontactresponse.md b/docs/models/operations/createcontactresponse.md index d80f09b..c3dd578 100644 --- a/docs/models/operations/createcontactresponse.md +++ b/docs/models/operations/createcontactresponse.md @@ -27,6 +27,6 @@ const value: components.SimplePublicObject = { ### `Uint8Array` ```typescript -const value: Uint8Array = new TextEncoder().encode("0xe5a532e348"); +const value: Uint8Array = new TextEncoder().encode("0xdC7D3f4be0"); ``` diff --git a/docs/models/operations/createdealresponse.md b/docs/models/operations/createdealresponse.md index 8f9213f..50ab258 100644 --- a/docs/models/operations/createdealresponse.md +++ b/docs/models/operations/createdealresponse.md @@ -27,6 +27,6 @@ const value: components.SimplePublicObject = { ### `Uint8Array` ```typescript -const value: Uint8Array = new TextEncoder().encode("0xcE7e2f64c0"); +const value: Uint8Array = new TextEncoder().encode("0xdC7D3f4be0"); ``` diff --git a/docs/models/operations/getcompanyresponse.md b/docs/models/operations/getcompanyresponse.md index af4cd47..53ee8b3 100644 --- a/docs/models/operations/getcompanyresponse.md +++ b/docs/models/operations/getcompanyresponse.md @@ -7,7 +7,7 @@ ```typescript const value: components.SimplePublicObjectWithAssociations = { - createdAt: new Date("2024-09-14T13:50:38.886Z"), + createdAt: new Date("2024-11-28T12:17:43.309Z"), id: "", properties: { "amount": "1500.00", @@ -19,13 +19,13 @@ const value: components.SimplePublicObjectWithAssociations = { "hubspot_owner_id": "910901", "pipeline": "default", }, - updatedAt: new Date("2025-10-11T10:53:38.306Z"), + updatedAt: new Date("2024-05-22T04:57:54.841Z"), }; ``` ### `Uint8Array` ```typescript -const value: Uint8Array = new TextEncoder().encode("0x110CBDFBaB"); +const value: Uint8Array = new TextEncoder().encode("0xdC7D3f4be0"); ``` diff --git a/docs/models/operations/getcontactresponse.md b/docs/models/operations/getcontactresponse.md index 4e8969c..373ef52 100644 --- a/docs/models/operations/getcontactresponse.md +++ b/docs/models/operations/getcontactresponse.md @@ -7,7 +7,7 @@ ```typescript const value: components.SimplePublicObjectWithAssociations = { - createdAt: new Date("2023-01-21T14:14:48.878Z"), + createdAt: new Date("2024-11-28T12:17:43.309Z"), id: "", properties: { "amount": "1500.00", @@ -19,13 +19,13 @@ const value: components.SimplePublicObjectWithAssociations = { "hubspot_owner_id": "910901", "pipeline": "default", }, - updatedAt: new Date("2024-11-07T22:17:02.814Z"), + updatedAt: new Date("2024-05-22T04:57:54.841Z"), }; ``` ### `Uint8Array` ```typescript -const value: Uint8Array = new TextEncoder().encode("0xddEf79f1ee"); +const value: Uint8Array = new TextEncoder().encode("0xdC7D3f4be0"); ``` diff --git a/docs/models/operations/getdealresponse.md b/docs/models/operations/getdealresponse.md index fa6cf21..bf53647 100644 --- a/docs/models/operations/getdealresponse.md +++ b/docs/models/operations/getdealresponse.md @@ -7,7 +7,7 @@ ```typescript const value: components.SimplePublicObjectWithAssociations = { - createdAt: new Date("2025-06-18T19:24:21.305Z"), + createdAt: new Date("2024-11-28T12:17:43.309Z"), id: "", properties: { "amount": "1500.00", @@ -19,13 +19,13 @@ const value: components.SimplePublicObjectWithAssociations = { "hubspot_owner_id": "910901", "pipeline": "default", }, - updatedAt: new Date("2023-04-17T10:09:07.050Z"), + updatedAt: new Date("2024-05-22T04:57:54.841Z"), }; ``` ### `Uint8Array` ```typescript -const value: Uint8Array = new TextEncoder().encode("0xC2FaFdA062"); +const value: Uint8Array = new TextEncoder().encode("0xdC7D3f4be0"); ``` diff --git a/docs/models/operations/getpropertiesrequest.md b/docs/models/operations/getpropertiesrequest.md index 319da33..0c5d37d 100644 --- a/docs/models/operations/getpropertiesrequest.md +++ b/docs/models/operations/getpropertiesrequest.md @@ -6,7 +6,7 @@ import { GetPropertiesRequest } from "mcp-hubspot/models/operations"; let value: GetPropertiesRequest = { - objectType: "deals", + objectType: "contacts", }; ``` diff --git a/docs/models/operations/getpropertiesresponse.md b/docs/models/operations/getpropertiesresponse.md index ec607c2..eaa9302 100644 --- a/docs/models/operations/getpropertiesresponse.md +++ b/docs/models/operations/getpropertiesresponse.md @@ -8,12 +8,14 @@ ```typescript const value: { [k: string]: any } = { "key": "", + "key1": "", + "key2": "", }; ``` ### `Uint8Array` ```typescript -const value: Uint8Array = new TextEncoder().encode("0xdb9e9DF8Bb"); +const value: Uint8Array = new TextEncoder().encode("0xdC7D3f4be0"); ``` diff --git a/docs/models/operations/objecttype.md b/docs/models/operations/objecttype.md index f8a012b..436909d 100644 --- a/docs/models/operations/objecttype.md +++ b/docs/models/operations/objecttype.md @@ -7,7 +7,7 @@ The type of the object for which to retrieve properties. ```typescript import { ObjectType } from "mcp-hubspot/models/operations"; -let value: ObjectType = "companies"; +let value: ObjectType = "contacts"; ``` ## Values diff --git a/docs/models/operations/searchcompaniesresponse.md b/docs/models/operations/searchcompaniesresponse.md index 57c93fd..f4b8a83 100644 --- a/docs/models/operations/searchcompaniesresponse.md +++ b/docs/models/operations/searchcompaniesresponse.md @@ -8,7 +8,7 @@ ```typescript const value: components.CollectionResponseWithTotalSimplePublicObjectForwardPaging = { - total: 828940, + total: 371377, paging: { next: { link: "?after=NTI1Cg%3D%3D", @@ -39,6 +39,6 @@ const value: ### `Uint8Array` ```typescript -const value: Uint8Array = new TextEncoder().encode("0x0e5AF5cdc4"); +const value: Uint8Array = new TextEncoder().encode("0xdC7D3f4be0"); ``` diff --git a/docs/models/operations/searchcontactsresponse.md b/docs/models/operations/searchcontactsresponse.md index 1f9b196..b1e5e54 100644 --- a/docs/models/operations/searchcontactsresponse.md +++ b/docs/models/operations/searchcontactsresponse.md @@ -8,7 +8,7 @@ ```typescript const value: components.CollectionResponseWithTotalSimplePublicObjectForwardPaging = { - total: 952749, + total: 371377, paging: { next: { link: "?after=NTI1Cg%3D%3D", @@ -39,6 +39,6 @@ const value: ### `Uint8Array` ```typescript -const value: Uint8Array = new TextEncoder().encode("0x9Cf6B8DcDf"); +const value: Uint8Array = new TextEncoder().encode("0xdC7D3f4be0"); ``` diff --git a/docs/models/operations/searchdealsresponse.md b/docs/models/operations/searchdealsresponse.md index db9454c..e5cb79a 100644 --- a/docs/models/operations/searchdealsresponse.md +++ b/docs/models/operations/searchdealsresponse.md @@ -8,7 +8,7 @@ ```typescript const value: components.CollectionResponseWithTotalSimplePublicObjectForwardPaging = { - total: 725255, + total: 371377, paging: { next: { link: "?after=NTI1Cg%3D%3D", @@ -39,6 +39,6 @@ const value: ### `Uint8Array` ```typescript -const value: Uint8Array = new TextEncoder().encode("0xbFe9d06e6d"); +const value: Uint8Array = new TextEncoder().encode("0xdC7D3f4be0"); ``` diff --git a/docs/models/operations/updatecompanyresponse.md b/docs/models/operations/updatecompanyresponse.md index b952837..95d47a9 100644 --- a/docs/models/operations/updatecompanyresponse.md +++ b/docs/models/operations/updatecompanyresponse.md @@ -27,6 +27,6 @@ const value: components.SimplePublicObject = { ### `Uint8Array` ```typescript -const value: Uint8Array = new TextEncoder().encode("0x2e3Eb95Bac"); +const value: Uint8Array = new TextEncoder().encode("0xdC7D3f4be0"); ``` diff --git a/docs/models/operations/updatecontactresponse.md b/docs/models/operations/updatecontactresponse.md index b64f945..4e54d41 100644 --- a/docs/models/operations/updatecontactresponse.md +++ b/docs/models/operations/updatecontactresponse.md @@ -27,6 +27,6 @@ const value: components.SimplePublicObject = { ### `Uint8Array` ```typescript -const value: Uint8Array = new TextEncoder().encode("0x4268c9F243"); +const value: Uint8Array = new TextEncoder().encode("0xdC7D3f4be0"); ``` diff --git a/docs/models/operations/updatedealresponse.md b/docs/models/operations/updatedealresponse.md index d0d2bdd..2797620 100644 --- a/docs/models/operations/updatedealresponse.md +++ b/docs/models/operations/updatedealresponse.md @@ -27,6 +27,6 @@ const value: components.SimplePublicObject = { ### `Uint8Array` ```typescript -const value: Uint8Array = new TextEncoder().encode("0x62691fc5b2"); +const value: Uint8Array = new TextEncoder().encode("0xdC7D3f4be0"); ``` diff --git a/docs/sdks/basic/README.md b/docs/sdks/basic/README.md index 211df99..4b5242c 100644 --- a/docs/sdks/basic/README.md +++ b/docs/sdks/basic/README.md @@ -21,6 +21,7 @@ Get the list of all properties that are available on any hubspot object. ### Example Usage + ```typescript import { Hubspot } from "mcp-hubspot"; @@ -30,10 +31,9 @@ const hubspot = new Hubspot({ async function run() { const result = await hubspot.basic.getProperties({ - objectType: "deals", + objectType: "contacts", }); - // Handle the result console.log(result); } @@ -56,17 +56,14 @@ const hubspot = new HubspotCore({ async function run() { const res = await basicGetProperties(hubspot, { - objectType: "deals", + objectType: "contacts", }); - - if (!res.ok) { - throw res.error; + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("basicGetProperties failed:", res.error); } - - const { value: result } = res; - - // Handle the result - console.log(result); } run(); @@ -97,6 +94,7 @@ Retrieve a company by its ID (`companyId`) or by a unique property (`idProperty` ### Example Usage + ```typescript import { Hubspot } from "mcp-hubspot"; @@ -109,7 +107,6 @@ async function run() { companyId: "", }); - // Handle the result console.log(result); } @@ -134,15 +131,12 @@ async function run() { const res = await basicGetCompany(hubspot, { companyId: "", }); - - if (!res.ok) { - throw res.error; + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("basicGetCompany failed:", res.error); } - - const { value: result } = res; - - // Handle the result - console.log(result); } run(); @@ -173,6 +167,7 @@ Update a company by ID (`companyId`) or unique property value (`idProperty`). Pr ### Example Usage + ```typescript import { Hubspot } from "mcp-hubspot"; @@ -185,18 +180,16 @@ async function run() { companyId: "", simplePublicObjectInput: { properties: { - "property_date": "1572480000000", - "property_radio": "option_1", - "property_number": "17", - "property_string": "value", - "property_checkbox": "false", - "property_dropdown": "choice_b", - "property_multiple_checkboxes": "chocolate;strawberry", + "amount": "1500.00", + "dealname": "Custom data integrations", + "pipeline": "default", + "closedate": "2019-12-07T16:50:06.678Z", + "dealstage": "presentationscheduled", + "hubspot_owner_id": "910901", }, }, }); - // Handle the result console.log(result); } @@ -222,25 +215,21 @@ async function run() { companyId: "", simplePublicObjectInput: { properties: { - "property_date": "1572480000000", - "property_radio": "option_1", - "property_number": "17", - "property_string": "value", - "property_checkbox": "false", - "property_dropdown": "choice_b", - "property_multiple_checkboxes": "chocolate;strawberry", + "amount": "1500.00", + "dealname": "Custom data integrations", + "pipeline": "default", + "closedate": "2019-12-07T16:50:06.678Z", + "dealstage": "presentationscheduled", + "hubspot_owner_id": "910901", }, }, }); - - if (!res.ok) { - throw res.error; + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("basicUpdateCompany failed:", res.error); } - - const { value: result } = res; - - // Handle the result - console.log(result); } run(); @@ -271,6 +260,7 @@ Retrieve a contact by its ID (`contactId`) or by a unique property (`idProperty` ### Example Usage + ```typescript import { Hubspot } from "mcp-hubspot"; @@ -283,7 +273,6 @@ async function run() { contactId: "", }); - // Handle the result console.log(result); } @@ -308,15 +297,12 @@ async function run() { const res = await basicGetContact(hubspot, { contactId: "", }); - - if (!res.ok) { - throw res.error; + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("basicGetContact failed:", res.error); } - - const { value: result } = res; - - // Handle the result - console.log(result); } run(); @@ -347,6 +333,7 @@ Update a contact by ID (`contactId`) or unique property value (`idProperty`). Pr ### Example Usage + ```typescript import { Hubspot } from "mcp-hubspot"; @@ -359,18 +346,16 @@ async function run() { contactId: "", simplePublicObjectInput: { properties: { - "property_date": "1572480000000", - "property_radio": "option_1", - "property_number": "17", - "property_string": "value", - "property_checkbox": "false", - "property_dropdown": "choice_b", - "property_multiple_checkboxes": "chocolate;strawberry", + "amount": "1500.00", + "dealname": "Custom data integrations", + "pipeline": "default", + "closedate": "2019-12-07T16:50:06.678Z", + "dealstage": "presentationscheduled", + "hubspot_owner_id": "910901", }, }, }); - // Handle the result console.log(result); } @@ -396,25 +381,21 @@ async function run() { contactId: "", simplePublicObjectInput: { properties: { - "property_date": "1572480000000", - "property_radio": "option_1", - "property_number": "17", - "property_string": "value", - "property_checkbox": "false", - "property_dropdown": "choice_b", - "property_multiple_checkboxes": "chocolate;strawberry", + "amount": "1500.00", + "dealname": "Custom data integrations", + "pipeline": "default", + "closedate": "2019-12-07T16:50:06.678Z", + "dealstage": "presentationscheduled", + "hubspot_owner_id": "910901", }, }, }); - - if (!res.ok) { - throw res.error; + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("basicUpdateContact failed:", res.error); } - - const { value: result } = res; - - // Handle the result - console.log(result); } run(); @@ -445,6 +426,7 @@ Create a single contact. Include a `properties` object to define [property value ### Example Usage + ```typescript import { Hubspot } from "mcp-hubspot"; @@ -477,7 +459,6 @@ async function run() { }, }); - // Handle the result console.log(result); } @@ -522,15 +503,12 @@ async function run() { "hubspot_owner_id": "910901", }, }); - - if (!res.ok) { - throw res.error; + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("basicCreateContact failed:", res.error); } - - const { value: result } = res; - - // Handle the result - console.log(result); } run(); @@ -561,6 +539,7 @@ Read a Deal Object identified by `{dealId}`. `{dealId}` refers to the internal o ### Example Usage + ```typescript import { Hubspot } from "mcp-hubspot"; @@ -573,7 +552,6 @@ async function run() { dealId: "", }); - // Handle the result console.log(result); } @@ -598,15 +576,12 @@ async function run() { const res = await basicGetDeal(hubspot, { dealId: "", }); - - if (!res.ok) { - throw res.error; + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("basicGetDeal failed:", res.error); } - - const { value: result } = res; - - // Handle the result - console.log(result); } run(); @@ -637,6 +612,7 @@ Perform a partial update of an Object identified by `{dealId}`. `{dealId}` refer ### Example Usage + ```typescript import { Hubspot } from "mcp-hubspot"; @@ -649,18 +625,16 @@ async function run() { dealId: "", simplePublicObjectInput: { properties: { - "property_date": "1572480000000", - "property_radio": "option_1", - "property_number": "17", - "property_string": "value", - "property_checkbox": "false", - "property_dropdown": "choice_b", - "property_multiple_checkboxes": "chocolate;strawberry", + "amount": "1500.00", + "dealname": "Custom data integrations", + "pipeline": "default", + "closedate": "2019-12-07T16:50:06.678Z", + "dealstage": "presentationscheduled", + "hubspot_owner_id": "910901", }, }, }); - // Handle the result console.log(result); } @@ -686,25 +660,21 @@ async function run() { dealId: "", simplePublicObjectInput: { properties: { - "property_date": "1572480000000", - "property_radio": "option_1", - "property_number": "17", - "property_string": "value", - "property_checkbox": "false", - "property_dropdown": "choice_b", - "property_multiple_checkboxes": "chocolate;strawberry", + "amount": "1500.00", + "dealname": "Custom data integrations", + "pipeline": "default", + "closedate": "2019-12-07T16:50:06.678Z", + "dealstage": "presentationscheduled", + "hubspot_owner_id": "910901", }, }, }); - - if (!res.ok) { - throw res.error; + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("basicUpdateDeal failed:", res.error); } - - const { value: result } = res; - - // Handle the result - console.log(result); } run(); @@ -735,6 +705,7 @@ Create a deal with the given properties and return a copy of the object, includi ### Example Usage + ```typescript import { Hubspot } from "mcp-hubspot"; @@ -767,7 +738,6 @@ async function run() { }, }); - // Handle the result console.log(result); } @@ -812,15 +782,12 @@ async function run() { "hubspot_owner_id": "910901", }, }); - - if (!res.ok) { - throw res.error; + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("basicCreateDeal failed:", res.error); } - - const { value: result } = res; - - // Handle the result - console.log(result); } run(); diff --git a/docs/sdks/hubspot/README.md b/docs/sdks/hubspot/README.md deleted file mode 100644 index 23c4768..0000000 --- a/docs/sdks/hubspot/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Hubspot SDK - -## Overview - -### Available Operations diff --git a/docs/sdks/search/README.md b/docs/sdks/search/README.md index 23bf370..d007e7b 100644 --- a/docs/sdks/search/README.md +++ b/docs/sdks/search/README.md @@ -15,6 +15,7 @@ Search for companies by filtering on properties, searching through associations, ### Example Usage + ```typescript import { Hubspot } from "mcp-hubspot"; @@ -25,7 +26,6 @@ const hubspot = new Hubspot({ async function run() { const result = await hubspot.search.searchCompanies({}); - // Handle the result console.log(result); } @@ -48,15 +48,12 @@ const hubspot = new HubspotCore({ async function run() { const res = await searchSearchCompanies(hubspot, {}); - - if (!res.ok) { - throw res.error; + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("searchSearchCompanies failed:", res.error); } - - const { value: result } = res; - - // Handle the result - console.log(result); } run(); @@ -87,6 +84,7 @@ Search for contacts by filtering on properties, searching through associations, ### Example Usage + ```typescript import { Hubspot } from "mcp-hubspot"; @@ -97,7 +95,6 @@ const hubspot = new Hubspot({ async function run() { const result = await hubspot.search.searchContacts({}); - // Handle the result console.log(result); } @@ -120,15 +117,12 @@ const hubspot = new HubspotCore({ async function run() { const res = await searchSearchContacts(hubspot, {}); - - if (!res.ok) { - throw res.error; + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("searchSearchContacts failed:", res.error); } - - const { value: result } = res; - - // Handle the result - console.log(result); } run(); @@ -157,6 +151,7 @@ run(); ### Example Usage + ```typescript import { Hubspot } from "mcp-hubspot"; @@ -167,7 +162,6 @@ const hubspot = new Hubspot({ async function run() { const result = await hubspot.search.searchDeals({}); - // Handle the result console.log(result); } @@ -190,15 +184,12 @@ const hubspot = new HubspotCore({ async function run() { const res = await searchSearchDeals(hubspot, {}); - - if (!res.ok) { - throw res.error; + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("searchSearchDeals failed:", res.error); } - - const { value: result } = res; - - // Handle the result - console.log(result); } run(); diff --git a/eslint.config.mjs b/eslint.config.mjs index 3483f71..67bccfe 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -11,6 +11,7 @@ export default [ { rules: { "no-constant-condition": "off", + "no-useless-escape": "off", // Handled by typescript compiler "@typescript-eslint/no-unused-vars": "off", "@typescript-eslint/no-explicit-any": "off", diff --git a/examples/.env.template b/examples/.env.template new file mode 100644 index 0000000..7163108 --- /dev/null +++ b/examples/.env.template @@ -0,0 +1,14 @@ +# mcp-hubspot SDK Environment Variables +# Copy this file to .env and fill in your actual values +# DO NOT commit the .env file to version control + +# Security Configuration +# The SDK supports loading security credentials from environment variables +# with the prefix: HUBSPOT_ +# +# Security environment variables: +HUBSPOT_HUBSPOT_TOKEN=your_hubspot_token_here + +# Debug Configuration +# Enable HTTP request/response logging for debugging +HUBSPOT_DEBUG=true diff --git a/examples/README.md b/examples/README.md new file mode 100644 index 0000000..63975a9 --- /dev/null +++ b/examples/README.md @@ -0,0 +1,31 @@ +# mcp-hubspot Examples + +This directory contains example scripts demonstrating how to use the mcp-hubspot SDK. + +## Prerequisites + +- Node.js (v18 or higher) +- npm + +## Setup + +1. Copy `.env.template` to `.env`: + ```bash + cp .env.template .env + ``` + +2. Edit `.env` and add your actual credentials (API keys, tokens, etc.) + +## Running the Examples + +To run an example file from the examples directory: + +```bash +npm run build && npx tsx example.ts +``` + +## Creating new examples + +Duplicate an existing example file, they won't be overwritten by the generation process. + + diff --git a/examples/basicGetProperties.example.ts b/examples/basicGetProperties.example.ts new file mode 100644 index 0000000..edfb785 --- /dev/null +++ b/examples/basicGetProperties.example.ts @@ -0,0 +1,28 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import dotenv from "dotenv"; +dotenv.config(); +/** + * Example usage of the mcp-hubspot SDK + * + * To run this example from the examples directory: + * npm run build && npx tsx basicGetProperties.example.ts + */ + +import { Hubspot } from "mcp-hubspot"; + +const hubspot = new Hubspot({ + hubspotToken: process.env["HUBSPOT_HUBSPOT_TOKEN"] ?? "", +}); + +async function main() { + const result = await hubspot.basic.getProperties({ + objectType: "contacts", + }); + + console.log(result); +} + +main().catch(console.error); diff --git a/examples/package-lock.json b/examples/package-lock.json new file mode 100644 index 0000000..83ca407 --- /dev/null +++ b/examples/package-lock.json @@ -0,0 +1,628 @@ +{ + "name": "mcp-hubspot-examples", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "mcp-hubspot-examples", + "version": "1.0.0", + "dependencies": { + "mcp-hubspot": "file:.." + }, + "devDependencies": { + "@types/node": "^20.0.0", + "dotenv": "^16.4.5", + "tsx": "^4.19.2" + } + }, + "..": { + "name": "mcp-hubspot", + "version": "0.2.0", + "dependencies": { + "zod": "^3.25.0 || ^4.0.0" + }, + "bin": { + "mcp": "bin/mcp-server.js" + }, + "devDependencies": { + "@eslint/js": "^9.19.0", + "@modelcontextprotocol/sdk": ">=1.5.0 <1.10.0", + "@stricli/core": "^1.1.1", + "@types/express": "^4.17.21", + "bun": "1.2.17", + "bun-types": "1.2.17", + "eslint": "^9.19.0", + "express": "^4.21.2", + "globals": "^15.14.0", + "tshy": "^2.0.0", + "typescript": "~5.8.3", + "typescript-eslint": "^8.26.0" + }, + "peerDependencies": { + "@modelcontextprotocol/sdk": ">=1.5.0 <1.10.0" + }, + "peerDependenciesMeta": { + "@modelcontextprotocol/sdk": { + "optional": true + } + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz", + "integrity": "sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.12.tgz", + "integrity": "sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.12.tgz", + "integrity": "sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.12.tgz", + "integrity": "sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.12.tgz", + "integrity": "sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.12.tgz", + "integrity": "sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.12.tgz", + "integrity": "sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.12.tgz", + "integrity": "sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.12.tgz", + "integrity": "sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.12.tgz", + "integrity": "sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.12.tgz", + "integrity": "sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.12.tgz", + "integrity": "sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.12.tgz", + "integrity": "sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.12.tgz", + "integrity": "sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.12.tgz", + "integrity": "sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.12.tgz", + "integrity": "sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.12.tgz", + "integrity": "sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.12.tgz", + "integrity": "sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.12.tgz", + "integrity": "sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.12.tgz", + "integrity": "sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.12.tgz", + "integrity": "sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.12.tgz", + "integrity": "sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.12.tgz", + "integrity": "sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.12.tgz", + "integrity": "sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.12.tgz", + "integrity": "sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.12.tgz", + "integrity": "sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@types/node": { + "version": "20.19.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.24.tgz", + "integrity": "sha512-FE5u0ezmi6y9OZEzlJfg37mqqf6ZDSF2V/NLjUyGrR9uTZ7Sb9F7bLNZ03S4XVUNRWGA7Ck4c1kK+YnuWjl+DA==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/dotenv": { + "version": "16.6.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.6.1.tgz", + "integrity": "sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/esbuild": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.12.tgz", + "integrity": "sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.25.12", + "@esbuild/android-arm": "0.25.12", + "@esbuild/android-arm64": "0.25.12", + "@esbuild/android-x64": "0.25.12", + "@esbuild/darwin-arm64": "0.25.12", + "@esbuild/darwin-x64": "0.25.12", + "@esbuild/freebsd-arm64": "0.25.12", + "@esbuild/freebsd-x64": "0.25.12", + "@esbuild/linux-arm": "0.25.12", + "@esbuild/linux-arm64": "0.25.12", + "@esbuild/linux-ia32": "0.25.12", + "@esbuild/linux-loong64": "0.25.12", + "@esbuild/linux-mips64el": "0.25.12", + "@esbuild/linux-ppc64": "0.25.12", + "@esbuild/linux-riscv64": "0.25.12", + "@esbuild/linux-s390x": "0.25.12", + "@esbuild/linux-x64": "0.25.12", + "@esbuild/netbsd-arm64": "0.25.12", + "@esbuild/netbsd-x64": "0.25.12", + "@esbuild/openbsd-arm64": "0.25.12", + "@esbuild/openbsd-x64": "0.25.12", + "@esbuild/openharmony-arm64": "0.25.12", + "@esbuild/sunos-x64": "0.25.12", + "@esbuild/win32-arm64": "0.25.12", + "@esbuild/win32-ia32": "0.25.12", + "@esbuild/win32-x64": "0.25.12" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/get-tsconfig": { + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.13.0.tgz", + "integrity": "sha512-1VKTZJCwBrvbd+Wn3AOgQP/2Av+TfTCOlE4AcRJE72W1ksZXbAx8PPBR9RzgTeSPzlPMHrbANMH3LbltH73wxQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, + "node_modules/mcp-hubspot": { + "resolved": "..", + "link": true + }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, + "node_modules/tsx": { + "version": "4.20.6", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.20.6.tgz", + "integrity": "sha512-ytQKuwgmrrkDTFP4LjR0ToE2nqgy886GpvRSpU0JAnrdBYppuY5rLkRUYPU1yCryb24SsKBTL/hlDQAEFVwtZg==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "~0.25.0", + "get-tsconfig": "^4.7.5" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true, + "license": "MIT" + } + } +} diff --git a/examples/package.json b/examples/package.json new file mode 100644 index 0000000..3b6486d --- /dev/null +++ b/examples/package.json @@ -0,0 +1,18 @@ +{ + "name": "mcp-hubspot-examples", + "version": "1.0.0", + "private": true, + "scripts": { + "build:parent": "cd .. && npm i && npm run build && cd -", + "build:examples": "npm i", + "build": "npm run build:parent && npm run build:examples" + }, + "devDependencies": { + "@types/node": "^20.0.0", + "dotenv": "^16.4.5", + "tsx": "^4.19.2" + }, + "dependencies": { + "mcp-hubspot": "file:.." + } +} \ No newline at end of file diff --git a/jsr.json b/jsr.json index 69cb3c6..65c224d 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "mcp-hubspot", - "version": "0.1.0", + "version": "0.2.0", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package-lock.json b/package-lock.json index ed0ca07..175783c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,33 +1,34 @@ { "name": "mcp-hubspot", - "version": "0.1.0", + "version": "0.2.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "mcp-hubspot", - "version": "0.1.0", + "version": "0.2.0", + "dependencies": { + "zod": "^3.25.0 || ^4.0.0" + }, "bin": { "mcp": "bin/mcp-server.js" }, "devDependencies": { "@eslint/js": "^9.19.0", - "@modelcontextprotocol/sdk": "^1.5.0", + "@modelcontextprotocol/sdk": ">=1.5.0 <1.10.0", "@stricli/core": "^1.1.1", "@types/express": "^4.17.21", - "bun": "^1.2.2", - "bun-types": "^1.2.2", + "bun": "1.2.17", + "bun-types": "1.2.17", "eslint": "^9.19.0", "express": "^4.21.2", "globals": "^15.14.0", "tshy": "^2.0.0", - "typescript": "^5.4.5", - "typescript-eslint": "^8.22.0", - "zod": "^3.23.4" + "typescript": "~5.8.3", + "typescript-eslint": "^8.26.0" }, "peerDependencies": { - "@modelcontextprotocol/sdk": "^1.5.0", - "zod": ">= 3" + "@modelcontextprotocol/sdk": ">=1.5.0 <1.10.0" }, "peerDependenciesMeta": { "@modelcontextprotocol/sdk": { @@ -658,9 +659,9 @@ } }, "node_modules/@oven/bun-darwin-aarch64": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/@oven/bun-darwin-aarch64/-/bun-darwin-aarch64-1.2.5.tgz", - "integrity": "sha512-ggZfdpgUJ/OiWrfcfTgHeSTHcec5HAjkGrZHL9FJ/R60sydRKPYHgAgexdIoJAGfsCVAL+x7y8NSTRIAX8J4Ng==", + "version": "1.2.17", + "resolved": "https://registry.npmjs.org/@oven/bun-darwin-aarch64/-/bun-darwin-aarch64-1.2.17.tgz", + "integrity": "sha512-66Xjz3NZXUUWKZJPvWKuwEkaqMZpir1Gm4SbhbB2iiRSSTW8jqwdkSb9RhgTCDt5OnSPd3+Cq0WsP/T5ExJbhA==", "cpu": [ "arm64" ], @@ -672,9 +673,9 @@ ] }, "node_modules/@oven/bun-darwin-x64": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/@oven/bun-darwin-x64/-/bun-darwin-x64-1.2.5.tgz", - "integrity": "sha512-4zqyQLJB33s99KcTxH6yQqH5EYBmF1qofQTtLsToIFbIZN1NqSp/aegYiGmxO5Kj/BuWsy8Wf8MS6vX2O0o2Lw==", + "version": "1.2.17", + "resolved": "https://registry.npmjs.org/@oven/bun-darwin-x64/-/bun-darwin-x64-1.2.17.tgz", + "integrity": "sha512-OMJMHpcpBlWcVnWfSQ6x+8fF7HpkQLqBfoIvzxgUjIZZvj2d8K46XX4N/h62RglDEinRC9VDGxt24vwvlk5tTw==", "cpu": [ "x64" ], @@ -686,9 +687,9 @@ ] }, "node_modules/@oven/bun-darwin-x64-baseline": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/@oven/bun-darwin-x64-baseline/-/bun-darwin-x64-baseline-1.2.5.tgz", - "integrity": "sha512-3W1RO3/D6Z1S79J47F/DLzmK+dgkYq5hS1ShOCSBAYTTA2b1ZuymaN8avGzSb9ed5W0QfxtyeAksfEY2xUBOqA==", + "version": "1.2.17", + "resolved": "https://registry.npmjs.org/@oven/bun-darwin-x64-baseline/-/bun-darwin-x64-baseline-1.2.17.tgz", + "integrity": "sha512-VSIctl90tV8yg1LRMvPg/8LgUzl55Q7Jcxe+u6PfuvLQIJOTIPbNn7HtRpJg7MGc3+qyztB5KDd70xC7qI2yEg==", "cpu": [ "x64" ], @@ -700,9 +701,9 @@ ] }, "node_modules/@oven/bun-linux-aarch64": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/@oven/bun-linux-aarch64/-/bun-linux-aarch64-1.2.5.tgz", - "integrity": "sha512-NQFtAVyQyJhLYrhFVxKdh6cqrDNc60pBnBGLQSO8PU+oyFyiJ3e3gGXjLzMbxd6cJxNIK5FZ0JIq96WljKAhlg==", + "version": "1.2.17", + "resolved": "https://registry.npmjs.org/@oven/bun-linux-aarch64/-/bun-linux-aarch64-1.2.17.tgz", + "integrity": "sha512-KPoMqaibCXcSv+VZ3uMqKUNZqMxE6Hho1be6+laolYGOIJxJTMnZPfmKfIlQmnnW3vLlm3g2Rm8pPPC7doSHWg==", "cpu": [ "arm64" ], @@ -714,9 +715,9 @@ ] }, "node_modules/@oven/bun-linux-aarch64-musl": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/@oven/bun-linux-aarch64-musl/-/bun-linux-aarch64-musl-1.2.5.tgz", - "integrity": "sha512-URlISBOE2HQi8qdru691OYywJRwChxMfXFbk26tCgdZ01LgGAKsIjAYylefuSsPuA697imDN3Pel3D7rveusmw==", + "version": "1.2.17", + "resolved": "https://registry.npmjs.org/@oven/bun-linux-aarch64-musl/-/bun-linux-aarch64-musl-1.2.17.tgz", + "integrity": "sha512-PH+hUV+I6DGD1VRHdAIAKEAOed+GSdvn6S1b3qqX27/VuHBU781V+hzt+6DBlcWBHYLw8PIg9sfIdNp485gQmw==", "cpu": [ "aarch64" ], @@ -728,9 +729,9 @@ ] }, "node_modules/@oven/bun-linux-x64": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/@oven/bun-linux-x64/-/bun-linux-x64-1.2.5.tgz", - "integrity": "sha512-pa3kQ4cXNV0jk5aM8+Hdmxr+b4QoPVgeAIA454SN5l3hMGfNsHjczKpsz0ksInZ8506iMMTCPEBXpyQJcSme+Q==", + "version": "1.2.17", + "resolved": "https://registry.npmjs.org/@oven/bun-linux-x64/-/bun-linux-x64-1.2.17.tgz", + "integrity": "sha512-BfySnrTxp7D9hVUi9JEpviJl8ndsuESiRiQKTzgmdTLrMjUxP4SwrwMtYt6R9X20n9rREG6a47C0IyQMhbwG/g==", "cpu": [ "x64" ], @@ -742,9 +743,9 @@ ] }, "node_modules/@oven/bun-linux-x64-baseline": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/@oven/bun-linux-x64-baseline/-/bun-linux-x64-baseline-1.2.5.tgz", - "integrity": "sha512-fCm/qp7e3VYlaoRs6NIEsKubPqyxjzLv8/qZkxeLLOlPd7CS8L26UY4KPOSjA+wrhPT+Nxsyvl/EEJq2R/iauA==", + "version": "1.2.17", + "resolved": "https://registry.npmjs.org/@oven/bun-linux-x64-baseline/-/bun-linux-x64-baseline-1.2.17.tgz", + "integrity": "sha512-IrnFMUwYWxoKICQgK8ZlJ6rI/HU2gITFNEW0MIOPIcuT0s3j0/33631M9EzYDoL4NuLQPks6569JDvSHEVqdeA==", "cpu": [ "x64" ], @@ -756,9 +757,9 @@ ] }, "node_modules/@oven/bun-linux-x64-musl": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/@oven/bun-linux-x64-musl/-/bun-linux-x64-musl-1.2.5.tgz", - "integrity": "sha512-DuU2kQnY48g9tNWjFrZqyG+U2emCBwlhOPxbuY/TMVVNSTMAcQbE/bb3s2pZdhZH5ssjc5SH/ZyWU1TePcYB2A==", + "version": "1.2.17", + "resolved": "https://registry.npmjs.org/@oven/bun-linux-x64-musl/-/bun-linux-x64-musl-1.2.17.tgz", + "integrity": "sha512-fW9qn/WqO131/qSIkIPW8zN+thQnYUWa/k98EWubLG87htKSPh1v023E5ikKb7WlUv4Yb6UlE/z4NmMYKffmAg==", "cpu": [ "x64" ], @@ -770,9 +771,9 @@ ] }, "node_modules/@oven/bun-linux-x64-musl-baseline": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/@oven/bun-linux-x64-musl-baseline/-/bun-linux-x64-musl-baseline-1.2.5.tgz", - "integrity": "sha512-H7tuJz7mZvOTPo4yLbIXIxkiDGWSGd2DbwGl4zNol/FURqGsKQVqpomv86yl9KCXsUUOm5FX2i5Ed+ro8N//Cg==", + "version": "1.2.17", + "resolved": "https://registry.npmjs.org/@oven/bun-linux-x64-musl-baseline/-/bun-linux-x64-musl-baseline-1.2.17.tgz", + "integrity": "sha512-YE5wQ/YA79BykMLhuwgdoF8Yjj5dRipD8dwmXs8n7gzR+/L9tL7Q69NQgskW2KkAalmWPoGAv3TV0IwbU+1dFw==", "cpu": [ "x64" ], @@ -784,9 +785,9 @@ ] }, "node_modules/@oven/bun-windows-x64": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/@oven/bun-windows-x64/-/bun-windows-x64-1.2.5.tgz", - "integrity": "sha512-oNDdPmzsCyvCATiYgkKWgxOeEx2F7m/i2MGUba+YJAeVXJsJg9iPJrLVBtETvKoSAgkXViwoUEw2U25jRYsp4g==", + "version": "1.2.17", + "resolved": "https://registry.npmjs.org/@oven/bun-windows-x64/-/bun-windows-x64-1.2.17.tgz", + "integrity": "sha512-GJUg1oA59DWH6eyV8uccpgfTEVxjmgfTWQCOl2ySMXR3IfRoFwS4aQfpjcVzNmEZrv8eYt+yMuw1K7aNcWTTIg==", "cpu": [ "x64" ], @@ -798,9 +799,9 @@ ] }, "node_modules/@oven/bun-windows-x64-baseline": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/@oven/bun-windows-x64-baseline/-/bun-windows-x64-baseline-1.2.5.tgz", - "integrity": "sha512-j5FxI8FeKfWI6rEXA+1O3ASBMTp5CFcZ7MR+/aCpiBKrDse32wLaZMVGnvqQqs4y0YHUvR8b7eXHHTboezjL1w==", + "version": "1.2.17", + "resolved": "https://registry.npmjs.org/@oven/bun-windows-x64-baseline/-/bun-windows-x64-baseline-1.2.17.tgz", + "integrity": "sha512-aVkq4l1yZ9VKfBOtZ2HEj0OCU5kUe3Fx6LbAG6oY6OglWVYj051i3RGaE2OdR4L4F2jDyxzfGYRTM/qs8nU5qA==", "cpu": [ "x64" ], @@ -951,16 +952,6 @@ "@types/send": "*" } }, - "node_modules/@types/ws": { - "version": "8.5.14", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.14.tgz", - "integrity": "sha512-bd/YFLW+URhBzMXurx7lWByOu+xzU9+kb3RboOteXYDfW+tr+JZa99OyNmPINEGB/ahzKrEuc8rcv4gnpJmxTw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "8.27.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.27.0.tgz", @@ -1381,9 +1372,9 @@ } }, "node_modules/bun": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/bun/-/bun-1.2.5.tgz", - "integrity": "sha512-fbQLt+DPiGUrPKdmsHRRT7cQAlfjdxPVFvLZrsUPmKiTdv+pU50ypdx9yRJluknSbyaZchFVV7Lx2KXikXKX2Q==", + "version": "1.2.17", + "resolved": "https://registry.npmjs.org/bun/-/bun-1.2.17.tgz", + "integrity": "sha512-lrUZTWS24eVy6v+Eph8VTwqFPcG7/XQ0rLBQEMNoQs2Vd7ctVdMGAzJKKGZRUQH+rgkD8rBeHGIVoWxX4vJLCA==", "cpu": [ "arm64", "x64", @@ -1399,31 +1390,30 @@ ], "bin": { "bun": "bin/bun.exe", - "bunx": "bin/bun.exe" + "bunx": "bin/bunx.exe" }, "optionalDependencies": { - "@oven/bun-darwin-aarch64": "1.2.5", - "@oven/bun-darwin-x64": "1.2.5", - "@oven/bun-darwin-x64-baseline": "1.2.5", - "@oven/bun-linux-aarch64": "1.2.5", - "@oven/bun-linux-aarch64-musl": "1.2.5", - "@oven/bun-linux-x64": "1.2.5", - "@oven/bun-linux-x64-baseline": "1.2.5", - "@oven/bun-linux-x64-musl": "1.2.5", - "@oven/bun-linux-x64-musl-baseline": "1.2.5", - "@oven/bun-windows-x64": "1.2.5", - "@oven/bun-windows-x64-baseline": "1.2.5" + "@oven/bun-darwin-aarch64": "1.2.17", + "@oven/bun-darwin-x64": "1.2.17", + "@oven/bun-darwin-x64-baseline": "1.2.17", + "@oven/bun-linux-aarch64": "1.2.17", + "@oven/bun-linux-aarch64-musl": "1.2.17", + "@oven/bun-linux-x64": "1.2.17", + "@oven/bun-linux-x64-baseline": "1.2.17", + "@oven/bun-linux-x64-musl": "1.2.17", + "@oven/bun-linux-x64-musl-baseline": "1.2.17", + "@oven/bun-windows-x64": "1.2.17", + "@oven/bun-windows-x64-baseline": "1.2.17" } }, "node_modules/bun-types": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/bun-types/-/bun-types-1.2.5.tgz", - "integrity": "sha512-3oO6LVGGRRKI4kHINx5PIdIgnLRb7l/SprhzqXapmoYkFl5m4j6EvALvbDVuuBFaamB46Ap6HCUxIXNLCGy+tg==", + "version": "1.2.17", + "resolved": "https://registry.npmjs.org/bun-types/-/bun-types-1.2.17.tgz", + "integrity": "sha512-ElC7ItwT3SCQwYZDYoAH+q6KT4Fxjl8DtZ6qDulUFBmXA8YB4xo+l54J9ZJN+k2pphfn9vk7kfubeSd5QfTVJQ==", "dev": true, "license": "MIT", "dependencies": { - "@types/node": "*", - "@types/ws": "~8.5.10" + "@types/node": "*" } }, "node_modules/bytes": { @@ -3814,9 +3804,9 @@ } }, "node_modules/typescript": { - "version": "5.8.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.2.tgz", - "integrity": "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==", + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", + "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", "dev": true, "license": "Apache-2.0", "bin": { @@ -4046,19 +4036,18 @@ } }, "node_modules/zod": { - "version": "3.24.2", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.24.2.tgz", - "integrity": "sha512-lY7CDW43ECgW9u1TcT3IoXHflywfVqDYze4waEz812jR/bZ8FHDsl7pFQoSZTz5N+2NqRXs8GBwnAwo3ZNxqhQ==", - "dev": true, + "version": "3.25.76", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/colinhacks" } }, "node_modules/zod-to-json-schema": { - "version": "3.24.4", - "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.24.4.tgz", - "integrity": "sha512-0uNlcvgabyrni9Ag8Vghj21drk7+7tp7VTwwR7KxxXXc/3pbXz2PHlDgj3cICahgF1kHm4dExBFj7BXrZJXzig==", + "version": "3.24.6", + "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.24.6.tgz", + "integrity": "sha512-h/z3PKvcTcTetyjl1fkj79MHNEjm+HpD6NXheWjzOekY7kV+lwDYnHw+ivHkijnCSMz1yJaWBD9vu/Fcmk+vEg==", "dev": true, "license": "ISC", "peerDependencies": { diff --git a/package.json b/package.json index 8006f37..8f8b5fe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mcp-hubspot", - "version": "0.1.0", + "version": "0.2.0", "author": "speakeasyapi", "type": "module", "bin": { @@ -33,8 +33,7 @@ "prepublishOnly": "npm run build" }, "peerDependencies": { - "@modelcontextprotocol/sdk": "^1.5.0", - "zod": ">= 3" + "@modelcontextprotocol/sdk": ">=1.5.0 <1.10.0" }, "peerDependenciesMeta": { "@modelcontextprotocol/sdk": { @@ -43,20 +42,21 @@ }, "devDependencies": { "@eslint/js": "^9.19.0", - "@modelcontextprotocol/sdk": "^1.5.0", + "@modelcontextprotocol/sdk": ">=1.5.0 <1.10.0", "@stricli/core": "^1.1.1", "@types/express": "^4.17.21", - "bun": "^1.2.2", - "bun-types": "^1.2.2", + "bun": "1.2.17", + "bun-types": "1.2.17", "eslint": "^9.19.0", "express": "^4.21.2", "globals": "^15.14.0", "tshy": "^2.0.0", - "typescript": "^5.4.5", - "typescript-eslint": "^8.22.0", - "zod": "^3.23.4" + "typescript": "~5.8.3", + "typescript-eslint": "^8.26.0" + }, + "dependencies": { + "zod": "^3.25.0 || ^4.0.0" }, - "dependencies": {}, "exports": { ".": { "import": { diff --git a/src/funcs/basicCreateContact.ts b/src/funcs/basicCreateContact.ts index 99c0788..5dc72ee 100644 --- a/src/funcs/basicCreateContact.ts +++ b/src/funcs/basicCreateContact.ts @@ -11,7 +11,6 @@ import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; import * as components from "../models/components/index.js"; -import { APIError } from "../models/errors/apierror.js"; import { ConnectionError, InvalidRequestError, @@ -19,6 +18,8 @@ import { RequestTimeoutError, UnexpectedClientError, } from "../models/errors/httpclienterrors.js"; +import { HubspotError } from "../models/errors/hubspoterror.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; import * as operations from "../models/operations/index.js"; import { APICall, APIPromise } from "../types/async.js"; @@ -42,13 +43,14 @@ export function basicCreateContact( ): APIPromise< Result< operations.CreateContactResponse, - | APIError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError + | HubspotError + | ResponseValidationError + | ConnectionError | RequestAbortedError | RequestTimeoutError - | ConnectionError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError > > { return new APIPromise($do( @@ -66,13 +68,14 @@ async function $do( [ Result< operations.CreateContactResponse, - | APIError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError + | HubspotError + | ResponseValidationError + | ConnectionError | RequestAbortedError | RequestTimeoutError - | ConnectionError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError >, APICall, ] @@ -101,9 +104,10 @@ async function $do( const requestSecurity = resolveGlobalSecurity(securityInput); const context = { + options: client._options, baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "createContact", - oAuth2Scopes: [], + oAuth2Scopes: null, resolvedSecurity: requestSecurity, @@ -121,6 +125,7 @@ async function $do( path: path, headers: headers, body: body, + userAgent: client._options.userAgent, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { @@ -141,13 +146,14 @@ async function $do( const [result] = await M.match< operations.CreateContactResponse, - | APIError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError + | HubspotError + | ResponseValidationError + | ConnectionError | RequestAbortedError | RequestTimeoutError - | ConnectionError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError >( M.json(201, operations.CreateContactResponse$inboundSchema), M.fail("4XX"), @@ -155,7 +161,7 @@ async function $do( M.bytes("default", operations.CreateContactResponse$inboundSchema, { ctype: "*/*", }), - )(response); + )(response, req); if (!result.ok) { return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/basicCreateDeal.ts b/src/funcs/basicCreateDeal.ts index d5771ea..46edb3f 100644 --- a/src/funcs/basicCreateDeal.ts +++ b/src/funcs/basicCreateDeal.ts @@ -11,7 +11,6 @@ import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; import * as components from "../models/components/index.js"; -import { APIError } from "../models/errors/apierror.js"; import { ConnectionError, InvalidRequestError, @@ -19,6 +18,8 @@ import { RequestTimeoutError, UnexpectedClientError, } from "../models/errors/httpclienterrors.js"; +import { HubspotError } from "../models/errors/hubspoterror.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; import * as operations from "../models/operations/index.js"; import { APICall, APIPromise } from "../types/async.js"; @@ -42,13 +43,14 @@ export function basicCreateDeal( ): APIPromise< Result< operations.CreateDealResponse, - | APIError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError + | HubspotError + | ResponseValidationError + | ConnectionError | RequestAbortedError | RequestTimeoutError - | ConnectionError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError > > { return new APIPromise($do( @@ -66,13 +68,14 @@ async function $do( [ Result< operations.CreateDealResponse, - | APIError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError + | HubspotError + | ResponseValidationError + | ConnectionError | RequestAbortedError | RequestTimeoutError - | ConnectionError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError >, APICall, ] @@ -101,9 +104,10 @@ async function $do( const requestSecurity = resolveGlobalSecurity(securityInput); const context = { + options: client._options, baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "createDeal", - oAuth2Scopes: [], + oAuth2Scopes: null, resolvedSecurity: requestSecurity, @@ -121,6 +125,7 @@ async function $do( path: path, headers: headers, body: body, + userAgent: client._options.userAgent, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { @@ -141,13 +146,14 @@ async function $do( const [result] = await M.match< operations.CreateDealResponse, - | APIError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError + | HubspotError + | ResponseValidationError + | ConnectionError | RequestAbortedError | RequestTimeoutError - | ConnectionError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError >( M.json(201, operations.CreateDealResponse$inboundSchema), M.fail("4XX"), @@ -155,7 +161,7 @@ async function $do( M.bytes("default", operations.CreateDealResponse$inboundSchema, { ctype: "*/*", }), - )(response); + )(response, req); if (!result.ok) { return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/basicGetCompany.ts b/src/funcs/basicGetCompany.ts index bf43d16..54ea76b 100644 --- a/src/funcs/basicGetCompany.ts +++ b/src/funcs/basicGetCompany.ts @@ -10,7 +10,6 @@ import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; -import { APIError } from "../models/errors/apierror.js"; import { ConnectionError, InvalidRequestError, @@ -18,6 +17,8 @@ import { RequestTimeoutError, UnexpectedClientError, } from "../models/errors/httpclienterrors.js"; +import { HubspotError } from "../models/errors/hubspoterror.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; import * as operations from "../models/operations/index.js"; import { APICall, APIPromise } from "../types/async.js"; @@ -41,13 +42,14 @@ export function basicGetCompany( ): APIPromise< Result< operations.GetCompanyResponse, - | APIError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError + | HubspotError + | ResponseValidationError + | ConnectionError | RequestAbortedError | RequestTimeoutError - | ConnectionError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError > > { return new APIPromise($do( @@ -65,13 +67,14 @@ async function $do( [ Result< operations.GetCompanyResponse, - | APIError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError + | HubspotError + | ResponseValidationError + | ConnectionError | RequestAbortedError | RequestTimeoutError - | ConnectionError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError >, APICall, ] @@ -113,9 +116,10 @@ async function $do( const requestSecurity = resolveGlobalSecurity(securityInput); const context = { + options: client._options, baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "getCompany", - oAuth2Scopes: [], + oAuth2Scopes: null, resolvedSecurity: requestSecurity, @@ -134,6 +138,7 @@ async function $do( headers: headers, query: query, body: body, + userAgent: client._options.userAgent, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { @@ -154,13 +159,14 @@ async function $do( const [result] = await M.match< operations.GetCompanyResponse, - | APIError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError + | HubspotError + | ResponseValidationError + | ConnectionError | RequestAbortedError | RequestTimeoutError - | ConnectionError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError >( M.json(200, operations.GetCompanyResponse$inboundSchema), M.fail("4XX"), @@ -168,7 +174,7 @@ async function $do( M.bytes("default", operations.GetCompanyResponse$inboundSchema, { ctype: "*/*", }), - )(response); + )(response, req); if (!result.ok) { return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/basicGetContact.ts b/src/funcs/basicGetContact.ts index 3953627..af70ad4 100644 --- a/src/funcs/basicGetContact.ts +++ b/src/funcs/basicGetContact.ts @@ -10,7 +10,6 @@ import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; -import { APIError } from "../models/errors/apierror.js"; import { ConnectionError, InvalidRequestError, @@ -18,6 +17,8 @@ import { RequestTimeoutError, UnexpectedClientError, } from "../models/errors/httpclienterrors.js"; +import { HubspotError } from "../models/errors/hubspoterror.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; import * as operations from "../models/operations/index.js"; import { APICall, APIPromise } from "../types/async.js"; @@ -41,13 +42,14 @@ export function basicGetContact( ): APIPromise< Result< operations.GetContactResponse, - | APIError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError + | HubspotError + | ResponseValidationError + | ConnectionError | RequestAbortedError | RequestTimeoutError - | ConnectionError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError > > { return new APIPromise($do( @@ -65,13 +67,14 @@ async function $do( [ Result< operations.GetContactResponse, - | APIError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError + | HubspotError + | ResponseValidationError + | ConnectionError | RequestAbortedError | RequestTimeoutError - | ConnectionError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError >, APICall, ] @@ -112,9 +115,10 @@ async function $do( const requestSecurity = resolveGlobalSecurity(securityInput); const context = { + options: client._options, baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "getContact", - oAuth2Scopes: [], + oAuth2Scopes: null, resolvedSecurity: requestSecurity, @@ -133,6 +137,7 @@ async function $do( headers: headers, query: query, body: body, + userAgent: client._options.userAgent, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { @@ -153,13 +158,14 @@ async function $do( const [result] = await M.match< operations.GetContactResponse, - | APIError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError + | HubspotError + | ResponseValidationError + | ConnectionError | RequestAbortedError | RequestTimeoutError - | ConnectionError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError >( M.json(200, operations.GetContactResponse$inboundSchema), M.fail("4XX"), @@ -167,7 +173,7 @@ async function $do( M.bytes("default", operations.GetContactResponse$inboundSchema, { ctype: "*/*", }), - )(response); + )(response, req); if (!result.ok) { return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/basicGetDeal.ts b/src/funcs/basicGetDeal.ts index 9796c26..5f00ade 100644 --- a/src/funcs/basicGetDeal.ts +++ b/src/funcs/basicGetDeal.ts @@ -10,7 +10,6 @@ import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; -import { APIError } from "../models/errors/apierror.js"; import { ConnectionError, InvalidRequestError, @@ -18,6 +17,8 @@ import { RequestTimeoutError, UnexpectedClientError, } from "../models/errors/httpclienterrors.js"; +import { HubspotError } from "../models/errors/hubspoterror.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; import * as operations from "../models/operations/index.js"; import { APICall, APIPromise } from "../types/async.js"; @@ -41,13 +42,14 @@ export function basicGetDeal( ): APIPromise< Result< operations.GetDealResponse, - | APIError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError + | HubspotError + | ResponseValidationError + | ConnectionError | RequestAbortedError | RequestTimeoutError - | ConnectionError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError > > { return new APIPromise($do( @@ -65,13 +67,14 @@ async function $do( [ Result< operations.GetDealResponse, - | APIError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError + | HubspotError + | ResponseValidationError + | ConnectionError | RequestAbortedError | RequestTimeoutError - | ConnectionError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError >, APICall, ] @@ -113,9 +116,10 @@ async function $do( const requestSecurity = resolveGlobalSecurity(securityInput); const context = { + options: client._options, baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "getDeal", - oAuth2Scopes: [], + oAuth2Scopes: null, resolvedSecurity: requestSecurity, @@ -134,6 +138,7 @@ async function $do( headers: headers, query: query, body: body, + userAgent: client._options.userAgent, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { @@ -154,13 +159,14 @@ async function $do( const [result] = await M.match< operations.GetDealResponse, - | APIError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError + | HubspotError + | ResponseValidationError + | ConnectionError | RequestAbortedError | RequestTimeoutError - | ConnectionError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError >( M.json(200, operations.GetDealResponse$inboundSchema), M.fail("4XX"), @@ -168,7 +174,7 @@ async function $do( M.bytes("default", operations.GetDealResponse$inboundSchema, { ctype: "*/*", }), - )(response); + )(response, req); if (!result.ok) { return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/basicGetProperties.ts b/src/funcs/basicGetProperties.ts index 75b539c..e3b3733 100644 --- a/src/funcs/basicGetProperties.ts +++ b/src/funcs/basicGetProperties.ts @@ -10,7 +10,6 @@ import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; -import { APIError } from "../models/errors/apierror.js"; import { ConnectionError, InvalidRequestError, @@ -18,6 +17,8 @@ import { RequestTimeoutError, UnexpectedClientError, } from "../models/errors/httpclienterrors.js"; +import { HubspotError } from "../models/errors/hubspoterror.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; import * as operations from "../models/operations/index.js"; import { APICall, APIPromise } from "../types/async.js"; @@ -41,13 +42,14 @@ export function basicGetProperties( ): APIPromise< Result< operations.GetPropertiesResponse, - | APIError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError + | HubspotError + | ResponseValidationError + | ConnectionError | RequestAbortedError | RequestTimeoutError - | ConnectionError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError > > { return new APIPromise($do( @@ -65,13 +67,14 @@ async function $do( [ Result< operations.GetPropertiesResponse, - | APIError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError + | HubspotError + | ResponseValidationError + | ConnectionError | RequestAbortedError | RequestTimeoutError - | ConnectionError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError >, APICall, ] @@ -105,9 +108,10 @@ async function $do( const requestSecurity = resolveGlobalSecurity(securityInput); const context = { + options: client._options, baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "getProperties", - oAuth2Scopes: [], + oAuth2Scopes: null, resolvedSecurity: requestSecurity, @@ -125,6 +129,7 @@ async function $do( path: path, headers: headers, body: body, + userAgent: client._options.userAgent, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { @@ -145,13 +150,14 @@ async function $do( const [result] = await M.match< operations.GetPropertiesResponse, - | APIError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError + | HubspotError + | ResponseValidationError + | ConnectionError | RequestAbortedError | RequestTimeoutError - | ConnectionError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError >( M.json(200, operations.GetPropertiesResponse$inboundSchema), M.fail("4XX"), @@ -159,7 +165,7 @@ async function $do( M.bytes("default", operations.GetPropertiesResponse$inboundSchema, { ctype: "*/*", }), - )(response); + )(response, req); if (!result.ok) { return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/basicUpdateCompany.ts b/src/funcs/basicUpdateCompany.ts index a9c1adf..7b7623e 100644 --- a/src/funcs/basicUpdateCompany.ts +++ b/src/funcs/basicUpdateCompany.ts @@ -10,7 +10,6 @@ import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; -import { APIError } from "../models/errors/apierror.js"; import { ConnectionError, InvalidRequestError, @@ -18,6 +17,8 @@ import { RequestTimeoutError, UnexpectedClientError, } from "../models/errors/httpclienterrors.js"; +import { HubspotError } from "../models/errors/hubspoterror.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; import * as operations from "../models/operations/index.js"; import { APICall, APIPromise } from "../types/async.js"; @@ -41,13 +42,14 @@ export function basicUpdateCompany( ): APIPromise< Result< operations.UpdateCompanyResponse, - | APIError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError + | HubspotError + | ResponseValidationError + | ConnectionError | RequestAbortedError | RequestTimeoutError - | ConnectionError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError > > { return new APIPromise($do( @@ -65,13 +67,14 @@ async function $do( [ Result< operations.UpdateCompanyResponse, - | APIError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError + | HubspotError + | ResponseValidationError + | ConnectionError | RequestAbortedError | RequestTimeoutError - | ConnectionError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError >, APICall, ] @@ -112,9 +115,10 @@ async function $do( const requestSecurity = resolveGlobalSecurity(securityInput); const context = { + options: client._options, baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "updateCompany", - oAuth2Scopes: [], + oAuth2Scopes: null, resolvedSecurity: requestSecurity, @@ -133,6 +137,7 @@ async function $do( headers: headers, query: query, body: body, + userAgent: client._options.userAgent, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { @@ -153,13 +158,14 @@ async function $do( const [result] = await M.match< operations.UpdateCompanyResponse, - | APIError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError + | HubspotError + | ResponseValidationError + | ConnectionError | RequestAbortedError | RequestTimeoutError - | ConnectionError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError >( M.json(200, operations.UpdateCompanyResponse$inboundSchema), M.fail("4XX"), @@ -167,7 +173,7 @@ async function $do( M.bytes("default", operations.UpdateCompanyResponse$inboundSchema, { ctype: "*/*", }), - )(response); + )(response, req); if (!result.ok) { return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/basicUpdateContact.ts b/src/funcs/basicUpdateContact.ts index cecc217..ed008cb 100644 --- a/src/funcs/basicUpdateContact.ts +++ b/src/funcs/basicUpdateContact.ts @@ -10,7 +10,6 @@ import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; -import { APIError } from "../models/errors/apierror.js"; import { ConnectionError, InvalidRequestError, @@ -18,6 +17,8 @@ import { RequestTimeoutError, UnexpectedClientError, } from "../models/errors/httpclienterrors.js"; +import { HubspotError } from "../models/errors/hubspoterror.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; import * as operations from "../models/operations/index.js"; import { APICall, APIPromise } from "../types/async.js"; @@ -41,13 +42,14 @@ export function basicUpdateContact( ): APIPromise< Result< operations.UpdateContactResponse, - | APIError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError + | HubspotError + | ResponseValidationError + | ConnectionError | RequestAbortedError | RequestTimeoutError - | ConnectionError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError > > { return new APIPromise($do( @@ -65,13 +67,14 @@ async function $do( [ Result< operations.UpdateContactResponse, - | APIError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError + | HubspotError + | ResponseValidationError + | ConnectionError | RequestAbortedError | RequestTimeoutError - | ConnectionError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError >, APICall, ] @@ -108,9 +111,10 @@ async function $do( const requestSecurity = resolveGlobalSecurity(securityInput); const context = { + options: client._options, baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "updateContact", - oAuth2Scopes: [], + oAuth2Scopes: null, resolvedSecurity: requestSecurity, @@ -128,6 +132,7 @@ async function $do( path: path, headers: headers, body: body, + userAgent: client._options.userAgent, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { @@ -148,13 +153,14 @@ async function $do( const [result] = await M.match< operations.UpdateContactResponse, - | APIError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError + | HubspotError + | ResponseValidationError + | ConnectionError | RequestAbortedError | RequestTimeoutError - | ConnectionError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError >( M.json(200, operations.UpdateContactResponse$inboundSchema), M.fail("4XX"), @@ -162,7 +168,7 @@ async function $do( M.bytes("default", operations.UpdateContactResponse$inboundSchema, { ctype: "*/*", }), - )(response); + )(response, req); if (!result.ok) { return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/basicUpdateDeal.ts b/src/funcs/basicUpdateDeal.ts index 4fd922a..8a8ffb1 100644 --- a/src/funcs/basicUpdateDeal.ts +++ b/src/funcs/basicUpdateDeal.ts @@ -10,7 +10,6 @@ import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; -import { APIError } from "../models/errors/apierror.js"; import { ConnectionError, InvalidRequestError, @@ -18,6 +17,8 @@ import { RequestTimeoutError, UnexpectedClientError, } from "../models/errors/httpclienterrors.js"; +import { HubspotError } from "../models/errors/hubspoterror.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; import * as operations from "../models/operations/index.js"; import { APICall, APIPromise } from "../types/async.js"; @@ -41,13 +42,14 @@ export function basicUpdateDeal( ): APIPromise< Result< operations.UpdateDealResponse, - | APIError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError + | HubspotError + | ResponseValidationError + | ConnectionError | RequestAbortedError | RequestTimeoutError - | ConnectionError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError > > { return new APIPromise($do( @@ -65,13 +67,14 @@ async function $do( [ Result< operations.UpdateDealResponse, - | APIError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError + | HubspotError + | ResponseValidationError + | ConnectionError | RequestAbortedError | RequestTimeoutError - | ConnectionError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError >, APICall, ] @@ -112,9 +115,10 @@ async function $do( const requestSecurity = resolveGlobalSecurity(securityInput); const context = { + options: client._options, baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "updateDeal", - oAuth2Scopes: [], + oAuth2Scopes: null, resolvedSecurity: requestSecurity, @@ -133,6 +137,7 @@ async function $do( headers: headers, query: query, body: body, + userAgent: client._options.userAgent, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { @@ -153,13 +158,14 @@ async function $do( const [result] = await M.match< operations.UpdateDealResponse, - | APIError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError + | HubspotError + | ResponseValidationError + | ConnectionError | RequestAbortedError | RequestTimeoutError - | ConnectionError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError >( M.json(200, operations.UpdateDealResponse$inboundSchema), M.fail("4XX"), @@ -167,7 +173,7 @@ async function $do( M.bytes("default", operations.UpdateDealResponse$inboundSchema, { ctype: "*/*", }), - )(response); + )(response, req); if (!result.ok) { return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/searchSearchCompanies.ts b/src/funcs/searchSearchCompanies.ts index cd0be6a..583c5b8 100644 --- a/src/funcs/searchSearchCompanies.ts +++ b/src/funcs/searchSearchCompanies.ts @@ -11,7 +11,6 @@ import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; import * as components from "../models/components/index.js"; -import { APIError } from "../models/errors/apierror.js"; import { ConnectionError, InvalidRequestError, @@ -19,6 +18,8 @@ import { RequestTimeoutError, UnexpectedClientError, } from "../models/errors/httpclienterrors.js"; +import { HubspotError } from "../models/errors/hubspoterror.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; import * as operations from "../models/operations/index.js"; import { APICall, APIPromise } from "../types/async.js"; @@ -44,13 +45,14 @@ export function searchSearchCompanies( ): APIPromise< Result< operations.SearchCompaniesResponse, - | APIError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError + | HubspotError + | ResponseValidationError + | ConnectionError | RequestAbortedError | RequestTimeoutError - | ConnectionError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError > > { return new APIPromise($do( @@ -70,13 +72,14 @@ async function $do( [ Result< operations.SearchCompaniesResponse, - | APIError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError + | HubspotError + | ResponseValidationError + | ConnectionError | RequestAbortedError | RequestTimeoutError - | ConnectionError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError >, APICall, ] @@ -104,9 +107,10 @@ async function $do( const requestSecurity = resolveGlobalSecurity(securityInput); const context = { + options: client._options, baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "searchCompanies", - oAuth2Scopes: [], + oAuth2Scopes: null, resolvedSecurity: requestSecurity, @@ -124,6 +128,7 @@ async function $do( path: path, headers: headers, body: body, + userAgent: client._options.userAgent, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { @@ -144,13 +149,14 @@ async function $do( const [result] = await M.match< operations.SearchCompaniesResponse, - | APIError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError + | HubspotError + | ResponseValidationError + | ConnectionError | RequestAbortedError | RequestTimeoutError - | ConnectionError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError >( M.json(200, operations.SearchCompaniesResponse$inboundSchema), M.fail("4XX"), @@ -158,7 +164,7 @@ async function $do( M.bytes("default", operations.SearchCompaniesResponse$inboundSchema, { ctype: "*/*", }), - )(response); + )(response, req); if (!result.ok) { return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/searchSearchContacts.ts b/src/funcs/searchSearchContacts.ts index cb848b7..eeea111 100644 --- a/src/funcs/searchSearchContacts.ts +++ b/src/funcs/searchSearchContacts.ts @@ -11,7 +11,6 @@ import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; import * as components from "../models/components/index.js"; -import { APIError } from "../models/errors/apierror.js"; import { ConnectionError, InvalidRequestError, @@ -19,6 +18,8 @@ import { RequestTimeoutError, UnexpectedClientError, } from "../models/errors/httpclienterrors.js"; +import { HubspotError } from "../models/errors/hubspoterror.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; import * as operations from "../models/operations/index.js"; import { APICall, APIPromise } from "../types/async.js"; @@ -44,13 +45,14 @@ export function searchSearchContacts( ): APIPromise< Result< operations.SearchContactsResponse, - | APIError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError + | HubspotError + | ResponseValidationError + | ConnectionError | RequestAbortedError | RequestTimeoutError - | ConnectionError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError > > { return new APIPromise($do( @@ -70,13 +72,14 @@ async function $do( [ Result< operations.SearchContactsResponse, - | APIError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError + | HubspotError + | ResponseValidationError + | ConnectionError | RequestAbortedError | RequestTimeoutError - | ConnectionError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError >, APICall, ] @@ -104,9 +107,10 @@ async function $do( const requestSecurity = resolveGlobalSecurity(securityInput); const context = { + options: client._options, baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "searchContacts", - oAuth2Scopes: [], + oAuth2Scopes: null, resolvedSecurity: requestSecurity, @@ -124,6 +128,7 @@ async function $do( path: path, headers: headers, body: body, + userAgent: client._options.userAgent, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { @@ -144,13 +149,14 @@ async function $do( const [result] = await M.match< operations.SearchContactsResponse, - | APIError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError + | HubspotError + | ResponseValidationError + | ConnectionError | RequestAbortedError | RequestTimeoutError - | ConnectionError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError >( M.json(200, operations.SearchContactsResponse$inboundSchema), M.fail("4XX"), @@ -158,7 +164,7 @@ async function $do( M.bytes("default", operations.SearchContactsResponse$inboundSchema, { ctype: "*/*", }), - )(response); + )(response, req); if (!result.ok) { return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/searchSearchDeals.ts b/src/funcs/searchSearchDeals.ts index 65581c2..7f91482 100644 --- a/src/funcs/searchSearchDeals.ts +++ b/src/funcs/searchSearchDeals.ts @@ -11,7 +11,6 @@ import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; import * as components from "../models/components/index.js"; -import { APIError } from "../models/errors/apierror.js"; import { ConnectionError, InvalidRequestError, @@ -19,6 +18,8 @@ import { RequestTimeoutError, UnexpectedClientError, } from "../models/errors/httpclienterrors.js"; +import { HubspotError } from "../models/errors/hubspoterror.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; import * as operations from "../models/operations/index.js"; import { APICall, APIPromise } from "../types/async.js"; @@ -36,13 +37,14 @@ export function searchSearchDeals( ): APIPromise< Result< operations.SearchDealsResponse, - | APIError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError + | HubspotError + | ResponseValidationError + | ConnectionError | RequestAbortedError | RequestTimeoutError - | ConnectionError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError > > { return new APIPromise($do( @@ -60,13 +62,14 @@ async function $do( [ Result< operations.SearchDealsResponse, - | APIError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError + | HubspotError + | ResponseValidationError + | ConnectionError | RequestAbortedError | RequestTimeoutError - | ConnectionError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError >, APICall, ] @@ -94,9 +97,10 @@ async function $do( const requestSecurity = resolveGlobalSecurity(securityInput); const context = { + options: client._options, baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "searchDeals", - oAuth2Scopes: [], + oAuth2Scopes: null, resolvedSecurity: requestSecurity, @@ -114,6 +118,7 @@ async function $do( path: path, headers: headers, body: body, + userAgent: client._options.userAgent, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { @@ -134,13 +139,14 @@ async function $do( const [result] = await M.match< operations.SearchDealsResponse, - | APIError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError + | HubspotError + | ResponseValidationError + | ConnectionError | RequestAbortedError | RequestTimeoutError - | ConnectionError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError >( M.json(200, operations.SearchDealsResponse$inboundSchema), M.fail("4XX"), @@ -148,7 +154,7 @@ async function $do( M.bytes("default", operations.SearchDealsResponse$inboundSchema, { ctype: "*/*", }), - )(response); + )(response, req); if (!result.ok) { return [result, { status: "complete", request: req, response }]; } diff --git a/src/hooks/types.ts b/src/hooks/types.ts index f34898c..8bfe4fe 100644 --- a/src/hooks/types.ts +++ b/src/hooks/types.ts @@ -2,6 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ +import { SDKOptions } from "../lib/config.js"; import { HTTPClient, RequestInput } from "../lib/http.js"; import { RetryConfig } from "../lib/retries.js"; import { SecurityState } from "../lib/security.js"; @@ -9,10 +10,11 @@ import { SecurityState } from "../lib/security.js"; export type HookContext = { baseURL: string | URL; operationID: string; - oAuth2Scopes?: string[]; + oAuth2Scopes: string[] | null; securitySource?: any | (() => Promise); retryConfig: RetryConfig; resolvedSecurity: SecurityState | null; + options: SDKOptions; }; export type Awaitable = T | Promise; diff --git a/src/index.ts b/src/index.ts index 5ddc765..dbcba16 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,4 +4,6 @@ export * from "./lib/config.js"; export * as files from "./lib/files.js"; +export { HTTPClient } from "./lib/http.js"; +export type { Fetcher, HTTPClientOptions } from "./lib/http.js"; export * from "./sdk/sdk.js"; diff --git a/src/lib/base64.ts b/src/lib/base64.ts index c2d5b38..0aebd8b 100644 --- a/src/lib/base64.ts +++ b/src/lib/base64.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; export function bytesToBase64(u8arr: Uint8Array): string { return btoa(String.fromCodePoint(...u8arr)); diff --git a/src/lib/config.ts b/src/lib/config.ts index a65a933..759a1e2 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -26,6 +26,10 @@ export type SDKOptions = { * Allows overriding the default server URL used by the SDK */ serverURL?: string | undefined; + /** + * Allows overriding the default user agent used by the SDK + */ + userAgent?: string | undefined; /** * Allows overriding the default retry config used by the SDK */ @@ -54,7 +58,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "v3", - sdkVersion: "0.1.0", - genVersion: "2.558.5", - userAgent: "speakeasy-sdk/typescript 0.1.0 2.558.5 v3 mcp-hubspot", + sdkVersion: "0.2.0", + genVersion: "2.748.0", + userAgent: "speakeasy-sdk/typescript 0.2.0 2.748.0 v3 mcp-hubspot", } as const; diff --git a/src/lib/env.ts b/src/lib/env.ts index dbb5504..79cb530 100644 --- a/src/lib/env.ts +++ b/src/lib/env.ts @@ -2,10 +2,9 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ +import * as z from "zod/v3"; import { dlv } from "./dlv.js"; -import * as z from "zod"; - export interface Env { HUBSPOT_HUBSPOT_TOKEN?: string | undefined; @@ -18,6 +17,18 @@ export const envSchema: z.ZodType = z.object({ HUBSPOT_DEBUG: z.coerce.boolean().optional(), }); +/** + * Checks for the existence of the Deno global object to determine the environment. + * @returns {boolean} True if the runtime is Deno, false otherwise. + */ +function isDeno() { + if ("Deno" in globalThis) { + return true; + } + + return false; +} + let envMemo: Env | undefined = undefined; /** * Reads and validates environment variables. @@ -27,9 +38,14 @@ export function env(): Env { return envMemo; } - envMemo = envSchema.parse( - dlv(globalThis, "process.env") ?? dlv(globalThis, "Deno.env") ?? {}, - ); + let envObject: Record = {}; + if (isDeno()) { + envObject = (globalThis as any).Deno?.env?.toObject?.() ?? {}; + } else { + envObject = dlv(globalThis, "process.env") ?? {}; + } + + envMemo = envSchema.parse(envObject); return envMemo; } diff --git a/src/lib/files.ts b/src/lib/files.ts index 59d15f0..0344cd0 100644 --- a/src/lib/files.ts +++ b/src/lib/files.ts @@ -38,3 +38,45 @@ export async function readableStreamToArrayBuffer( return concatenatedChunks.buffer as ArrayBuffer; } + +/** + * Determines the MIME content type based on a file's extension. + * Returns null if the extension is not recognized. + */ +export function getContentTypeFromFileName(fileName: string): string | null { + if (!fileName) return null; + + const ext = fileName.toLowerCase().split(".").pop(); + if (!ext) return null; + + const mimeTypes: Record = { + json: "application/json", + xml: "application/xml", + html: "text/html", + htm: "text/html", + txt: "text/plain", + csv: "text/csv", + pdf: "application/pdf", + png: "image/png", + jpg: "image/jpeg", + jpeg: "image/jpeg", + gif: "image/gif", + svg: "image/svg+xml", + js: "application/javascript", + css: "text/css", + zip: "application/zip", + tar: "application/x-tar", + gz: "application/gzip", + mp4: "video/mp4", + mp3: "audio/mpeg", + wav: "audio/wav", + webp: "image/webp", + ico: "image/x-icon", + woff: "font/woff", + woff2: "font/woff2", + ttf: "font/ttf", + otf: "font/otf", + }; + + return mimeTypes[ext] || null; +} diff --git a/src/lib/matchers.ts b/src/lib/matchers.ts index 65858ac..77d4108 100644 --- a/src/lib/matchers.ts +++ b/src/lib/matchers.ts @@ -3,13 +3,13 @@ */ import { APIError } from "../models/errors/apierror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import { Result } from "../types/fp.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { ERR, OK, Result } from "../types/fp.js"; import { matchResponse, matchStatusCode, StatusCodePredicate } from "./http.js"; import { isPlainObject } from "./is-plain-object.js"; -import { safeParse } from "./schemas.js"; export type Encoding = + | "jsonl" | "json" | "text" | "bytes" @@ -19,6 +19,7 @@ export type Encoding = | "fail"; const DEFAULT_CONTENT_TYPES: Record = { + jsonl: "application/jsonl", json: "application/json", text: "text/plain", bytes: "application/octet-stream", @@ -72,6 +73,21 @@ export function json( return { ...options, enc: "json", codes, schema }; } +export function jsonl( + codes: StatusCodePredicate, + schema: Schema, + options?: MatchOptions, +): ValueMatcher { + return { ...options, enc: "jsonl", codes, schema }; +} + +export function jsonlErr( + codes: StatusCodePredicate, + schema: Schema, + options?: MatchOptions, +): ErrorMatcher { + return { ...options, err: true, enc: "jsonl", codes, schema }; +} export function textErr( codes: StatusCodePredicate, schema: Schema, @@ -159,17 +175,19 @@ export type MatchedError = Matchers extends Matcher[] : never; export type MatchFunc = ( response: Response, + request: Request, options?: { resultKey?: string; extraFields?: Record }, ) => Promise<[result: Result, raw: unknown]>; export function match( ...matchers: Array> -): MatchFunc { +): MatchFunc { return async function matchFunc( response: Response, + request: Request, options?: { resultKey?: string; extraFields?: Record }, ): Promise< - [result: Result, raw: unknown] + [result: Result, raw: unknown] > { let raw: unknown; let matcher: Matcher | undefined; @@ -188,21 +206,25 @@ export function match( } if (!matcher) { - const responseBody = await response.text(); return [{ ok: false, - error: new APIError( - "Unexpected API response status or content-type", + error: new APIError("Unexpected Status or Content-Type", { response, - responseBody, - ), - }, responseBody]; + request, + body: await response.text().catch(() => ""), + }), + }, raw]; } const encoding = matcher.enc; + let body = ""; switch (encoding) { case "json": - raw = await response.json(); + body = await response.text(); + raw = JSON.parse(body); + break; + case "jsonl": + raw = response.body; break; case "bytes": raw = new Uint8Array(await response.arrayBuffer()); @@ -211,16 +233,19 @@ export function match( raw = response.body; break; case "text": - raw = await response.text(); + body = await response.text(); + raw = body; break; case "sse": raw = response.body; break; case "nil": - raw = await discardResponseBody(response); + body = await response.text(); + raw = undefined; break; case "fail": - raw = await response.text(); + body = await response.text(); + raw = body; break; default: encoding satisfies never; @@ -230,11 +255,7 @@ export function match( if (matcher.enc === "fail") { return [{ ok: false, - error: new APIError( - "API error occurred", - response, - typeof raw === "string" ? raw : "", - ), + error: new APIError("API error occurred", { request, response, body }), }, raw]; } @@ -246,6 +267,9 @@ export function match( ...options?.extraFields, ...(matcher.hdrs ? { Headers: unpackHeaders(response.headers) } : null), ...(isPlainObject(raw) ? raw : null), + request$: request, + response$: response, + body$: body, }; } else if (resultKey) { data = { @@ -264,18 +288,20 @@ export function match( } if ("err" in matcher) { - const result = safeParse( + const result = safeParseResponse( data, (v: unknown) => matcher.schema.parse(v), "Response validation failed", + { request, response, body }, ); return [result.ok ? { ok: false, error: result.value } : result, raw]; } else { return [ - safeParse( + safeParseResponse( data, (v: unknown) => matcher.schema.parse(v), "Response validation failed", + { request, response, body }, ), raw, ]; @@ -298,25 +324,22 @@ export function unpackHeaders(headers: Headers): Record { return out; } -/** - * Discards the response body to free up resources. - * - * To learn why this is need, see the undici docs: - * https://undici.nodejs.org/#/?id=garbage-collection - */ -export async function discardResponseBody(res: Response) { - const reader = res.body?.getReader(); - if (reader == null) { - return; - } - +function safeParseResponse( + rawValue: Inp, + fn: (value: Inp) => Out, + errorMessage: string, + httpMeta: { response: Response; request: Request; body: string }, +): Result { try { - let done = false; - while (!done) { - const res = await reader.read(); - done = res.done; - } - } finally { - reader.releaseLock(); + return OK(fn(rawValue)); + } catch (err) { + return ERR( + new ResponseValidationError(errorMessage, { + cause: err, + rawValue, + rawMessage: errorMessage, + ...httpMeta, + }), + ); } } diff --git a/src/lib/schemas.ts b/src/lib/schemas.ts index 0e340b7..47edb97 100644 --- a/src/lib/schemas.ts +++ b/src/lib/schemas.ts @@ -9,7 +9,7 @@ import { ZodObject, ZodRawShape, ZodTypeAny, -} from "zod"; +} from "zod/v3"; import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; import { ERR, OK, Result } from "../types/fp.js"; diff --git a/src/lib/sdks.ts b/src/lib/sdks.ts index 7812805..03b9ce0 100644 --- a/src/lib/sdks.ts +++ b/src/lib/sdks.ts @@ -47,12 +47,14 @@ export type RequestOptions = { */ serverURL?: string | URL; /** + * @deprecated `fetchOptions` has been flattened into `RequestOptions`. + * * Sets various request options on the `fetch` call made by an SDK method. * * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options|Request} */ fetchOptions?: Omit; -}; +} & Omit; type RequestConfig = { method: string; @@ -63,6 +65,7 @@ type RequestConfig = { headers?: HeadersInit; security?: SecurityState | null; uaHeader?: string; + userAgent?: string | undefined; timeoutMs?: number; }; @@ -94,19 +97,21 @@ export class ClientSDK { } else { this.#hooks = new SDKHooks(); } - this._options = { ...options, hooks: this.#hooks }; - const url = serverURLFromOptions(options); if (url) { url.pathname = url.pathname.replace(/\/+$/, "") + "/"; } + const { baseURL, client } = this.#hooks.sdkInit({ baseURL: url, client: options.httpClient || new HTTPClient(), }); this._baseURL = baseURL; this.#httpClient = client; - this.#logger = options.debugLogger; + + this._options = { ...options, hooks: this.#hooks }; + + this.#logger = this._options.debugLogger; if (!this.#logger && env().HUBSPOT_DEBUG) { this.#logger = console; } @@ -172,7 +177,9 @@ export class ClientSDK { cookie = cookie.startsWith("; ") ? cookie.slice(2) : cookie; headers.set("cookie", cookie); - const userHeaders = new Headers(options?.fetchOptions?.headers); + const userHeaders = new Headers( + options?.headers ?? options?.fetchOptions?.headers, + ); for (const [k, v] of userHeaders) { headers.set(k, v); } @@ -180,23 +187,22 @@ export class ClientSDK { // Only set user agent header in non-browser-like environments since CORS // policy disallows setting it in browsers e.g. Chrome throws an error. if (!isBrowserLike) { - headers.set(conf.uaHeader ?? "user-agent", SDK_METADATA.userAgent); + headers.set( + conf.uaHeader ?? "user-agent", + conf.userAgent ?? SDK_METADATA.userAgent, + ); } - let fetchOptions = options?.fetchOptions; + const fetchOptions: Omit = { + ...options?.fetchOptions, + ...options, + }; if (!fetchOptions?.signal && conf.timeoutMs && conf.timeoutMs > 0) { const timeoutSignal = AbortSignal.timeout(conf.timeoutMs); - if (!fetchOptions) { - fetchOptions = { signal: timeoutSignal }; - } else { - fetchOptions.signal = timeoutSignal; - } + fetchOptions.signal = timeoutSignal; } if (conf.body instanceof ReadableStream) { - if (!fetchOptions) { - fetchOptions = {}; - } Object.assign(fetchOptions, { duplex: "half" }); } @@ -302,7 +308,9 @@ export class ClientSDK { } } -const jsonLikeContentTypeRE = /^application\/(?:.{0,100}\+)?json/; +const jsonLikeContentTypeRE = /(application|text)\/.*?\+*json.*/; +const jsonlLikeContentTypeRE = + /(application|text)\/(.*?\+*\bjsonl\b.*|.*?\+*\bx-ndjson\b.*)/; async function logRequest(logger: Logger | undefined, req: Request) { if (!logger) { return; @@ -368,9 +376,13 @@ async function logResponse( logger.group("Body:"); switch (true) { case matchContentType(res, "application/json") - || jsonLikeContentTypeRE.test(ct): + || jsonLikeContentTypeRE.test(ct) && !jsonlLikeContentTypeRE.test(ct): logger.log(await res.clone().json()); break; + case matchContentType(res, "application/jsonl") + || jsonlLikeContentTypeRE.test(ct): + logger.log(await res.clone().text()); + break; case matchContentType(res, "text/event-stream"): logger.log(`<${contentType}>`); break; diff --git a/src/lib/security.ts b/src/lib/security.ts index c986051..3114bef 100644 --- a/src/lib/security.ts +++ b/src/lib/security.ts @@ -7,8 +7,8 @@ import { env } from "./env.js"; type OAuth2PasswordFlow = { username: string; - password?: string | undefined; - clientID: string; + password: string; + clientID?: string | undefined; clientSecret?: string | undefined; tokenURL: string; }; @@ -84,7 +84,10 @@ type SecurityInputOAuth2 = { type SecurityInputOAuth2ClientCredentials = { type: "oauth2:client_credentials"; value: - | { clientID?: string | undefined; clientSecret?: string | undefined } + | { + clientID?: string | undefined; + clientSecret?: string | undefined; + } | null | string | undefined; diff --git a/src/lib/url.ts b/src/lib/url.ts index 6bc6356..f3a8de6 100644 --- a/src/lib/url.ts +++ b/src/lib/url.ts @@ -10,7 +10,7 @@ export function pathToFunc( pathPattern: string, options?: { charEncoding?: "percent" | "none" }, ): (params?: Params) => string { - const paramRE = /\{([a-zA-Z0-9_]+?)\}/g; + const paramRE = /\{([a-zA-Z0-9_][a-zA-Z0-9_-]*?)\}/g; return function buildURLPath(params: Record = {}): string { return pathPattern.replace(paramRE, function (_, placeholder) { diff --git a/src/mcp-server/cli/start/command.ts b/src/mcp-server/cli/start/command.ts index c5f4595..02edbd6 100644 --- a/src/mcp-server/cli/start/command.ts +++ b/src/mcp-server/cli/start/command.ts @@ -2,9 +2,8 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { buildCommand } from "@stricli/core"; -import { numberParser } from "@stricli/core"; -import * as z from "zod"; +import { buildCommand, numberParser } from "@stricli/core"; +import * as z from "zod/v3"; import { consoleLoggerLevels } from "../../console-logger.js"; import { mcpScopes } from "../../scopes.js"; @@ -37,18 +36,13 @@ export const startCommand = buildCommand({ return z.string().parse(value); }, }, - ...(mcpScopes.length - ? { - scope: { - kind: "enum", - brief: - "Mount tools/resources that match given scope (repeatable flag)", - values: mcpScopes, - variadic: true, - optional: true, - }, - } - : {}), + scope: { + kind: "enum", + brief: "Mount tools/resources that match given scope (repeatable flag)", + values: mcpScopes, + variadic: true, + optional: true, + }, "hubspot-token": { kind: "parsed", brief: "Sets the hubspotToken auth field for the API", diff --git a/src/mcp-server/cli/start/impl.ts b/src/mcp-server/cli/start/impl.ts index 0cbef8e..593f8f7 100644 --- a/src/mcp-server/cli/start/impl.ts +++ b/src/mcp-server/cli/start/impl.ts @@ -50,7 +50,7 @@ async function startStdio(flags: StartCommandFlags) { logger, allowedTools: flags.tool, scopes: flags.scope, - ...{ hubspotToken: flags["hubspot-token"] }, + ...{ hubspotToken: flags["hubspot-token"] ?? "" }, serverURL: flags["server-url"], serverIdx: flags["server-index"], }); @@ -71,7 +71,7 @@ async function startSSE(flags: StartCommandFlags) { logger, allowedTools: flags.tool, scopes: flags.scope, - ...{ hubspotToken: flags["hubspot-token"] }, + ...{ hubspotToken: flags["hubspot-token"] ?? "" }, serverURL: flags["server-url"], serverIdx: flags["server-index"], }); diff --git a/src/mcp-server/extensions.ts b/src/mcp-server/extensions.ts index 7aab280..0955a57 100644 --- a/src/mcp-server/extensions.ts +++ b/src/mcp-server/extensions.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { ZodRawShape } from "zod"; +import { ZodRawShape } from "zod/v3"; import { PromptArgsRawShape, PromptDefinition } from "./prompts.js"; import { ResourceDefinition, ResourceTemplateDefinition } from "./resources.js"; import { ToolDefinition } from "./tools.js"; diff --git a/src/mcp-server/mcp-server.ts b/src/mcp-server/mcp-server.ts index 549dc47..d643b83 100644 --- a/src/mcp-server/mcp-server.ts +++ b/src/mcp-server/mcp-server.ts @@ -19,7 +19,7 @@ const routes = buildRouteMap({ export const app = buildApplication(routes, { name: "mcp", versionInfo: { - currentVersion: "0.1.0", + currentVersion: "0.2.0", }, }); diff --git a/src/mcp-server/prompts.ts b/src/mcp-server/prompts.ts index 48080de..daca645 100644 --- a/src/mcp-server/prompts.ts +++ b/src/mcp-server/prompts.ts @@ -11,7 +11,7 @@ import { ZodType, ZodTypeAny, ZodTypeDef, -} from "zod"; +} from "zod/v3"; import { HubspotCore } from "../core.js"; import { ConsoleLogger } from "./console-logger.js"; import { MCPScope } from "./scopes.js"; @@ -74,7 +74,14 @@ export function createRegisterPrompt( prompt: PromptDefinition, ): void => { const scopes = prompt.scopes ?? []; - if (!scopes.every((s: MCPScope) => allowedScopes.has(s))) { + if (allowedScopes.size > 0 && scopes.length === 0) { + return; + } + + if ( + allowedScopes.size > 0 + && !scopes.every((s: MCPScope) => allowedScopes.has(s)) + ) { return; } diff --git a/src/mcp-server/resources.ts b/src/mcp-server/resources.ts index 70ea028..c433843 100644 --- a/src/mcp-server/resources.ts +++ b/src/mcp-server/resources.ts @@ -109,7 +109,14 @@ export function createRegisterResource( ): (resource: ResourceDefinition) => void { return (resource: ResourceDefinition): void => { const scopes = resource.scopes ?? []; - if (!scopes.every((s: MCPScope) => allowedScopes.has(s))) { + if (allowedScopes.size > 0 && scopes.length === 0) { + return; + } + + if ( + allowedScopes.size > 0 + && !scopes.every((s: MCPScope) => allowedScopes.has(s)) + ) { return; } @@ -137,7 +144,14 @@ export function createRegisterResourceTemplate( ): (resource: ResourceTemplateDefinition) => void { return (resource: ResourceTemplateDefinition): void => { const scopes = resource.scopes ?? []; - if (!scopes.every((s: MCPScope) => allowedScopes.has(s))) { + if (allowedScopes.size > 0 && scopes.length === 0) { + return; + } + + if ( + allowedScopes.size > 0 + && !scopes.every((s: MCPScope) => allowedScopes.has(s)) + ) { return; } diff --git a/src/mcp-server/server.ts b/src/mcp-server/server.ts index 0d51f98..e7fa68e 100644 --- a/src/mcp-server/server.ts +++ b/src/mcp-server/server.ts @@ -6,12 +6,14 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { HubspotCore } from "../core.js"; import { SDKOptions } from "../lib/config.js"; import type { ConsoleLogger } from "./console-logger.js"; +import { Register } from "./extensions.js"; import { createRegisterPrompt } from "./prompts.js"; import { createRegisterResource, createRegisterResourceTemplate, } from "./resources.js"; -import { MCPScope, mcpScopes } from "./scopes.js"; +import { MCPScope } from "./scopes.js"; +import { registerMCPExtensions } from "./server.extensions.js"; import { createRegisterTool } from "./tools.js"; import { tool$basicCreateContact } from "./tools/basicCreateContact.js"; import { tool$basicCreateDeal } from "./tools/basicCreateDeal.js"; @@ -36,7 +38,7 @@ export function createMCPServer(deps: { }) { const server = new McpServer({ name: "Hubspot", - version: "0.1.0", + version: "0.2.0", }); const client = new HubspotCore({ @@ -45,7 +47,7 @@ export function createMCPServer(deps: { serverIdx: deps.serverIdx, }); - const scopes = new Set(deps.scopes ?? mcpScopes); + const scopes = new Set(deps.scopes); const allowedTools = deps.allowedTools && new Set(deps.allowedTools); const tool = createRegisterTool( @@ -79,5 +81,7 @@ export function createMCPServer(deps: { tool(tool$searchSearchContacts); tool(tool$searchSearchDeals); + registerMCPExtensions(register satisfies Register); + return server; } diff --git a/src/mcp-server/shared.ts b/src/mcp-server/shared.ts index 9dc6d2f..3e94144 100644 --- a/src/mcp-server/shared.ts +++ b/src/mcp-server/shared.ts @@ -2,9 +2,8 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; import { bytesToBase64 } from "../lib/base64.js"; - type BinaryData = | Uint8Array | ArrayBuffer diff --git a/src/mcp-server/tools.ts b/src/mcp-server/tools.ts index 690f648..23e69e0 100644 --- a/src/mcp-server/tools.ts +++ b/src/mcp-server/tools.ts @@ -5,7 +5,7 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { RequestHandlerExtra } from "@modelcontextprotocol/sdk/shared/protocol.js"; import { CallToolResult } from "@modelcontextprotocol/sdk/types.js"; -import { objectOutputType, ZodRawShape, ZodTypeAny } from "zod"; +import { objectOutputType, ZodRawShape, ZodTypeAny } from "zod/v3"; import { HubspotCore } from "../core.js"; import { ConsoleLogger } from "./console-logger.js"; import { MCPScope } from "./scopes.js"; @@ -102,12 +102,15 @@ export function createRegisterTool( return; } - const toolScopes = tool.scopes ?? []; - if (allowedScopes.size > 0 && toolScopes.length === 0) { + const scopes = tool.scopes ?? []; + if (allowedScopes.size > 0 && scopes.length === 0) { return; } - if (!toolScopes.every((s) => allowedScopes.has(s))) { + if ( + allowedScopes.size > 0 + && !scopes.every((s: MCPScope) => allowedScopes.has(s)) + ) { return; } diff --git a/src/models/components/associatedid.ts b/src/models/components/associatedid.ts index 53c18b4..7e86506 100644 --- a/src/models/components/associatedid.ts +++ b/src/models/components/associatedid.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; @@ -21,7 +21,6 @@ export const AssociatedId$inboundSchema: z.ZodType< id: z.string(), type: z.string(), }); - /** @internal */ export type AssociatedId$Outbound = { id: string; @@ -38,23 +37,9 @@ export const AssociatedId$outboundSchema: z.ZodType< type: z.string(), }); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace AssociatedId$ { - /** @deprecated use `AssociatedId$inboundSchema` instead. */ - export const inboundSchema = AssociatedId$inboundSchema; - /** @deprecated use `AssociatedId$outboundSchema` instead. */ - export const outboundSchema = AssociatedId$outboundSchema; - /** @deprecated use `AssociatedId$Outbound` instead. */ - export type Outbound = AssociatedId$Outbound; -} - export function associatedIdToJSON(associatedId: AssociatedId): string { return JSON.stringify(AssociatedId$outboundSchema.parse(associatedId)); } - export function associatedIdFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/components/associationspec.ts b/src/models/components/associationspec.ts index e6de603..3df4316 100644 --- a/src/models/components/associationspec.ts +++ b/src/models/components/associationspec.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; @@ -24,23 +24,11 @@ export type AssociationSpec = { export const AssociationCategory$inboundSchema: z.ZodNativeEnum< typeof AssociationCategory > = z.nativeEnum(AssociationCategory); - /** @internal */ export const AssociationCategory$outboundSchema: z.ZodNativeEnum< typeof AssociationCategory > = AssociationCategory$inboundSchema; -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace AssociationCategory$ { - /** @deprecated use `AssociationCategory$inboundSchema` instead. */ - export const inboundSchema = AssociationCategory$inboundSchema; - /** @deprecated use `AssociationCategory$outboundSchema` instead. */ - export const outboundSchema = AssociationCategory$outboundSchema; -} - /** @internal */ export const AssociationSpec$inboundSchema: z.ZodType< AssociationSpec, @@ -50,7 +38,6 @@ export const AssociationSpec$inboundSchema: z.ZodType< associationCategory: AssociationCategory$inboundSchema, associationTypeId: z.number().int(), }); - /** @internal */ export type AssociationSpec$Outbound = { associationCategory: string; @@ -67,25 +54,11 @@ export const AssociationSpec$outboundSchema: z.ZodType< associationTypeId: z.number().int(), }); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace AssociationSpec$ { - /** @deprecated use `AssociationSpec$inboundSchema` instead. */ - export const inboundSchema = AssociationSpec$inboundSchema; - /** @deprecated use `AssociationSpec$outboundSchema` instead. */ - export const outboundSchema = AssociationSpec$outboundSchema; - /** @deprecated use `AssociationSpec$Outbound` instead. */ - export type Outbound = AssociationSpec$Outbound; -} - export function associationSpecToJSON( associationSpec: AssociationSpec, ): string { return JSON.stringify(AssociationSpec$outboundSchema.parse(associationSpec)); } - export function associationSpecFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/components/collectionresponseassociatedid.ts b/src/models/components/collectionresponseassociatedid.ts index 7a58e21..095b151 100644 --- a/src/models/components/collectionresponseassociatedid.ts +++ b/src/models/components/collectionresponseassociatedid.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; @@ -33,7 +33,6 @@ export const CollectionResponseAssociatedId$inboundSchema: z.ZodType< paging: Paging$inboundSchema.optional(), results: z.array(AssociatedId$inboundSchema), }); - /** @internal */ export type CollectionResponseAssociatedId$Outbound = { paging?: Paging$Outbound | undefined; @@ -50,19 +49,6 @@ export const CollectionResponseAssociatedId$outboundSchema: z.ZodType< results: z.array(AssociatedId$outboundSchema), }); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace CollectionResponseAssociatedId$ { - /** @deprecated use `CollectionResponseAssociatedId$inboundSchema` instead. */ - export const inboundSchema = CollectionResponseAssociatedId$inboundSchema; - /** @deprecated use `CollectionResponseAssociatedId$outboundSchema` instead. */ - export const outboundSchema = CollectionResponseAssociatedId$outboundSchema; - /** @deprecated use `CollectionResponseAssociatedId$Outbound` instead. */ - export type Outbound = CollectionResponseAssociatedId$Outbound; -} - export function collectionResponseAssociatedIdToJSON( collectionResponseAssociatedId: CollectionResponseAssociatedId, ): string { @@ -72,7 +58,6 @@ export function collectionResponseAssociatedIdToJSON( ), ); } - export function collectionResponseAssociatedIdFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/components/collectionresponsewithtotalsimplepublicobjectforwardpaging.ts b/src/models/components/collectionresponsewithtotalsimplepublicobjectforwardpaging.ts index a646a04..9d873be 100644 --- a/src/models/components/collectionresponsewithtotalsimplepublicobjectforwardpaging.ts +++ b/src/models/components/collectionresponsewithtotalsimplepublicobjectforwardpaging.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; @@ -36,7 +36,6 @@ export const CollectionResponseWithTotalSimplePublicObjectForwardPaging$inboundS paging: ForwardPaging$inboundSchema.optional(), results: z.array(SimplePublicObject$inboundSchema), }); - /** @internal */ export type CollectionResponseWithTotalSimplePublicObjectForwardPaging$Outbound = { @@ -57,22 +56,6 @@ export const CollectionResponseWithTotalSimplePublicObjectForwardPaging$outbound results: z.array(SimplePublicObject$outboundSchema), }); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace CollectionResponseWithTotalSimplePublicObjectForwardPaging$ { - /** @deprecated use `CollectionResponseWithTotalSimplePublicObjectForwardPaging$inboundSchema` instead. */ - export const inboundSchema = - CollectionResponseWithTotalSimplePublicObjectForwardPaging$inboundSchema; - /** @deprecated use `CollectionResponseWithTotalSimplePublicObjectForwardPaging$outboundSchema` instead. */ - export const outboundSchema = - CollectionResponseWithTotalSimplePublicObjectForwardPaging$outboundSchema; - /** @deprecated use `CollectionResponseWithTotalSimplePublicObjectForwardPaging$Outbound` instead. */ - export type Outbound = - CollectionResponseWithTotalSimplePublicObjectForwardPaging$Outbound; -} - export function collectionResponseWithTotalSimplePublicObjectForwardPagingToJSON( collectionResponseWithTotalSimplePublicObjectForwardPaging: CollectionResponseWithTotalSimplePublicObjectForwardPaging, @@ -82,7 +65,6 @@ export function collectionResponseWithTotalSimplePublicObjectForwardPagingToJSON .parse(collectionResponseWithTotalSimplePublicObjectForwardPaging), ); } - export function collectionResponseWithTotalSimplePublicObjectForwardPagingFromJSON( jsonString: string, ): SafeParseResult< diff --git a/src/models/components/error.ts b/src/models/components/error.ts index 26669f2..b201a84 100644 --- a/src/models/components/error.ts +++ b/src/models/components/error.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; @@ -58,7 +58,6 @@ export const ErrorT$inboundSchema: z.ZodType = z category: z.string(), errors: z.array(ErrorDetail$inboundSchema).optional(), }); - /** @internal */ export type ErrorT$Outbound = { subCategory?: string | undefined; @@ -85,23 +84,9 @@ export const ErrorT$outboundSchema: z.ZodType< errors: z.array(ErrorDetail$outboundSchema).optional(), }); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace ErrorT$ { - /** @deprecated use `ErrorT$inboundSchema` instead. */ - export const inboundSchema = ErrorT$inboundSchema; - /** @deprecated use `ErrorT$outboundSchema` instead. */ - export const outboundSchema = ErrorT$outboundSchema; - /** @deprecated use `ErrorT$Outbound` instead. */ - export type Outbound = ErrorT$Outbound; -} - export function errorToJSON(errorT: ErrorT): string { return JSON.stringify(ErrorT$outboundSchema.parse(errorT)); } - export function errorFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/components/errordetail.ts b/src/models/components/errordetail.ts index f3ab945..06e91a9 100644 --- a/src/models/components/errordetail.ts +++ b/src/models/components/errordetail.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; @@ -42,7 +42,6 @@ export const ErrorDetail$inboundSchema: z.ZodType< context: z.record(z.array(z.string())).optional(), message: z.string(), }); - /** @internal */ export type ErrorDetail$Outbound = { subCategory?: string | undefined; @@ -65,23 +64,9 @@ export const ErrorDetail$outboundSchema: z.ZodType< message: z.string(), }); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace ErrorDetail$ { - /** @deprecated use `ErrorDetail$inboundSchema` instead. */ - export const inboundSchema = ErrorDetail$inboundSchema; - /** @deprecated use `ErrorDetail$outboundSchema` instead. */ - export const outboundSchema = ErrorDetail$outboundSchema; - /** @deprecated use `ErrorDetail$Outbound` instead. */ - export type Outbound = ErrorDetail$Outbound; -} - export function errorDetailToJSON(errorDetail: ErrorDetail): string { return JSON.stringify(ErrorDetail$outboundSchema.parse(errorDetail)); } - export function errorDetailFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/components/filter.ts b/src/models/components/filter.ts index be6d593..eb83168 100644 --- a/src/models/components/filter.ts +++ b/src/models/components/filter.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; @@ -45,22 +45,10 @@ export type Filter = { /** @internal */ export const Operator$inboundSchema: z.ZodNativeEnum = z .nativeEnum(Operator); - /** @internal */ export const Operator$outboundSchema: z.ZodNativeEnum = Operator$inboundSchema; -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace Operator$ { - /** @deprecated use `Operator$inboundSchema` instead. */ - export const inboundSchema = Operator$inboundSchema; - /** @deprecated use `Operator$outboundSchema` instead. */ - export const outboundSchema = Operator$outboundSchema; -} - /** @internal */ export const Filter$inboundSchema: z.ZodType = z .object({ @@ -70,7 +58,6 @@ export const Filter$inboundSchema: z.ZodType = z value: z.string().optional(), operator: Operator$inboundSchema, }); - /** @internal */ export type Filter$Outbound = { highValue?: string | undefined; @@ -93,23 +80,9 @@ export const Filter$outboundSchema: z.ZodType< operator: Operator$outboundSchema, }); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace Filter$ { - /** @deprecated use `Filter$inboundSchema` instead. */ - export const inboundSchema = Filter$inboundSchema; - /** @deprecated use `Filter$outboundSchema` instead. */ - export const outboundSchema = Filter$outboundSchema; - /** @deprecated use `Filter$Outbound` instead. */ - export type Outbound = Filter$Outbound; -} - export function filterToJSON(filter: Filter): string { return JSON.stringify(Filter$outboundSchema.parse(filter)); } - export function filterFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/components/filtergroup.ts b/src/models/components/filtergroup.ts index 4786ce2..9194098 100644 --- a/src/models/components/filtergroup.ts +++ b/src/models/components/filtergroup.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; @@ -25,7 +25,6 @@ export const FilterGroup$inboundSchema: z.ZodType< > = z.object({ filters: z.array(Filter$inboundSchema), }); - /** @internal */ export type FilterGroup$Outbound = { filters: Array; @@ -40,23 +39,9 @@ export const FilterGroup$outboundSchema: z.ZodType< filters: z.array(Filter$outboundSchema), }); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace FilterGroup$ { - /** @deprecated use `FilterGroup$inboundSchema` instead. */ - export const inboundSchema = FilterGroup$inboundSchema; - /** @deprecated use `FilterGroup$outboundSchema` instead. */ - export const outboundSchema = FilterGroup$outboundSchema; - /** @deprecated use `FilterGroup$Outbound` instead. */ - export type Outbound = FilterGroup$Outbound; -} - export function filterGroupToJSON(filterGroup: FilterGroup): string { return JSON.stringify(FilterGroup$outboundSchema.parse(filterGroup)); } - export function filterGroupFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/components/forwardpaging.ts b/src/models/components/forwardpaging.ts index 4294bac..e3b56f3 100644 --- a/src/models/components/forwardpaging.ts +++ b/src/models/components/forwardpaging.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; @@ -25,7 +25,6 @@ export const ForwardPaging$inboundSchema: z.ZodType< > = z.object({ next: NextPage$inboundSchema.optional(), }); - /** @internal */ export type ForwardPaging$Outbound = { next?: NextPage$Outbound | undefined; @@ -40,23 +39,9 @@ export const ForwardPaging$outboundSchema: z.ZodType< next: NextPage$outboundSchema.optional(), }); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace ForwardPaging$ { - /** @deprecated use `ForwardPaging$inboundSchema` instead. */ - export const inboundSchema = ForwardPaging$inboundSchema; - /** @deprecated use `ForwardPaging$outboundSchema` instead. */ - export const outboundSchema = ForwardPaging$outboundSchema; - /** @deprecated use `ForwardPaging$Outbound` instead. */ - export type Outbound = ForwardPaging$Outbound; -} - export function forwardPagingToJSON(forwardPaging: ForwardPaging): string { return JSON.stringify(ForwardPaging$outboundSchema.parse(forwardPaging)); } - export function forwardPagingFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/components/nextpage.ts b/src/models/components/nextpage.ts index 1637f0e..544fcdf 100644 --- a/src/models/components/nextpage.ts +++ b/src/models/components/nextpage.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; @@ -21,7 +21,6 @@ export const NextPage$inboundSchema: z.ZodType< link: z.string().optional(), after: z.string(), }); - /** @internal */ export type NextPage$Outbound = { link?: string | undefined; @@ -38,23 +37,9 @@ export const NextPage$outboundSchema: z.ZodType< after: z.string(), }); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace NextPage$ { - /** @deprecated use `NextPage$inboundSchema` instead. */ - export const inboundSchema = NextPage$inboundSchema; - /** @deprecated use `NextPage$outboundSchema` instead. */ - export const outboundSchema = NextPage$outboundSchema; - /** @deprecated use `NextPage$Outbound` instead. */ - export type Outbound = NextPage$Outbound; -} - export function nextPageToJSON(nextPage: NextPage): string { return JSON.stringify(NextPage$outboundSchema.parse(nextPage)); } - export function nextPageFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/components/paging.ts b/src/models/components/paging.ts index 24bf353..3d4a299 100644 --- a/src/models/components/paging.ts +++ b/src/models/components/paging.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; @@ -30,7 +30,6 @@ export const Paging$inboundSchema: z.ZodType = z next: NextPage$inboundSchema.optional(), prev: PreviousPage$inboundSchema.optional(), }); - /** @internal */ export type Paging$Outbound = { next?: NextPage$Outbound | undefined; @@ -47,23 +46,9 @@ export const Paging$outboundSchema: z.ZodType< prev: PreviousPage$outboundSchema.optional(), }); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace Paging$ { - /** @deprecated use `Paging$inboundSchema` instead. */ - export const inboundSchema = Paging$inboundSchema; - /** @deprecated use `Paging$outboundSchema` instead. */ - export const outboundSchema = Paging$outboundSchema; - /** @deprecated use `Paging$Outbound` instead. */ - export type Outbound = Paging$Outbound; -} - export function pagingToJSON(paging: Paging): string { return JSON.stringify(Paging$outboundSchema.parse(paging)); } - export function pagingFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/components/previouspage.ts b/src/models/components/previouspage.ts index f59a471..fb4f1b3 100644 --- a/src/models/components/previouspage.ts +++ b/src/models/components/previouspage.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; @@ -21,7 +21,6 @@ export const PreviousPage$inboundSchema: z.ZodType< before: z.string(), link: z.string().optional(), }); - /** @internal */ export type PreviousPage$Outbound = { before: string; @@ -38,23 +37,9 @@ export const PreviousPage$outboundSchema: z.ZodType< link: z.string().optional(), }); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace PreviousPage$ { - /** @deprecated use `PreviousPage$inboundSchema` instead. */ - export const inboundSchema = PreviousPage$inboundSchema; - /** @deprecated use `PreviousPage$outboundSchema` instead. */ - export const outboundSchema = PreviousPage$outboundSchema; - /** @deprecated use `PreviousPage$Outbound` instead. */ - export type Outbound = PreviousPage$Outbound; -} - export function previousPageToJSON(previousPage: PreviousPage): string { return JSON.stringify(PreviousPage$outboundSchema.parse(previousPage)); } - export function previousPageFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/components/publicassociationsforobject.ts b/src/models/components/publicassociationsforobject.ts index aee7db8..519e57a 100644 --- a/src/models/components/publicassociationsforobject.ts +++ b/src/models/components/publicassociationsforobject.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; @@ -33,7 +33,6 @@ export const PublicAssociationsForObject$inboundSchema: z.ZodType< types: z.array(AssociationSpec$inboundSchema), to: PublicObjectId$inboundSchema, }); - /** @internal */ export type PublicAssociationsForObject$Outbound = { types: Array; @@ -50,19 +49,6 @@ export const PublicAssociationsForObject$outboundSchema: z.ZodType< to: PublicObjectId$outboundSchema, }); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace PublicAssociationsForObject$ { - /** @deprecated use `PublicAssociationsForObject$inboundSchema` instead. */ - export const inboundSchema = PublicAssociationsForObject$inboundSchema; - /** @deprecated use `PublicAssociationsForObject$outboundSchema` instead. */ - export const outboundSchema = PublicAssociationsForObject$outboundSchema; - /** @deprecated use `PublicAssociationsForObject$Outbound` instead. */ - export type Outbound = PublicAssociationsForObject$Outbound; -} - export function publicAssociationsForObjectToJSON( publicAssociationsForObject: PublicAssociationsForObject, ): string { @@ -72,7 +58,6 @@ export function publicAssociationsForObjectToJSON( ), ); } - export function publicAssociationsForObjectFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/components/publicobjectid.ts b/src/models/components/publicobjectid.ts index ae46726..04c0bac 100644 --- a/src/models/components/publicobjectid.ts +++ b/src/models/components/publicobjectid.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; @@ -19,7 +19,6 @@ export const PublicObjectId$inboundSchema: z.ZodType< > = z.object({ id: z.string(), }); - /** @internal */ export type PublicObjectId$Outbound = { id: string; @@ -34,23 +33,9 @@ export const PublicObjectId$outboundSchema: z.ZodType< id: z.string(), }); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace PublicObjectId$ { - /** @deprecated use `PublicObjectId$inboundSchema` instead. */ - export const inboundSchema = PublicObjectId$inboundSchema; - /** @deprecated use `PublicObjectId$outboundSchema` instead. */ - export const outboundSchema = PublicObjectId$outboundSchema; - /** @deprecated use `PublicObjectId$Outbound` instead. */ - export type Outbound = PublicObjectId$Outbound; -} - export function publicObjectIdToJSON(publicObjectId: PublicObjectId): string { return JSON.stringify(PublicObjectId$outboundSchema.parse(publicObjectId)); } - export function publicObjectIdFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/components/publicobjectsearchrequest.ts b/src/models/components/publicobjectsearchrequest.ts index 8108fdf..3fe677f 100644 --- a/src/models/components/publicobjectsearchrequest.ts +++ b/src/models/components/publicobjectsearchrequest.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; @@ -35,7 +35,6 @@ export const PublicObjectSearchRequest$inboundSchema: z.ZodType< properties: z.array(z.string()).optional(), filterGroups: z.array(FilterGroup$inboundSchema).optional(), }); - /** @internal */ export type PublicObjectSearchRequest$Outbound = { query?: string | undefined; @@ -60,19 +59,6 @@ export const PublicObjectSearchRequest$outboundSchema: z.ZodType< filterGroups: z.array(FilterGroup$outboundSchema).optional(), }); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace PublicObjectSearchRequest$ { - /** @deprecated use `PublicObjectSearchRequest$inboundSchema` instead. */ - export const inboundSchema = PublicObjectSearchRequest$inboundSchema; - /** @deprecated use `PublicObjectSearchRequest$outboundSchema` instead. */ - export const outboundSchema = PublicObjectSearchRequest$outboundSchema; - /** @deprecated use `PublicObjectSearchRequest$Outbound` instead. */ - export type Outbound = PublicObjectSearchRequest$Outbound; -} - export function publicObjectSearchRequestToJSON( publicObjectSearchRequest: PublicObjectSearchRequest, ): string { @@ -80,7 +66,6 @@ export function publicObjectSearchRequestToJSON( PublicObjectSearchRequest$outboundSchema.parse(publicObjectSearchRequest), ); } - export function publicObjectSearchRequestFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/components/security.ts b/src/models/components/security.ts index 2a1481c..6efb20a 100644 --- a/src/models/components/security.ts +++ b/src/models/components/security.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; @@ -24,7 +24,6 @@ export const Security$inboundSchema: z.ZodType< "hubspot_token": "hubspotToken", }); }); - /** @internal */ export type Security$Outbound = { hubspot_token?: string | undefined; @@ -43,23 +42,9 @@ export const Security$outboundSchema: z.ZodType< }); }); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace Security$ { - /** @deprecated use `Security$inboundSchema` instead. */ - export const inboundSchema = Security$inboundSchema; - /** @deprecated use `Security$outboundSchema` instead. */ - export const outboundSchema = Security$outboundSchema; - /** @deprecated use `Security$Outbound` instead. */ - export type Outbound = Security$Outbound; -} - export function securityToJSON(security: Security): string { return JSON.stringify(Security$outboundSchema.parse(security)); } - export function securityFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/components/simplepublicobject.ts b/src/models/components/simplepublicobject.ts index 8ddb33d..bc52edc 100644 --- a/src/models/components/simplepublicobject.ts +++ b/src/models/components/simplepublicobject.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; @@ -41,7 +41,6 @@ export const SimplePublicObject$inboundSchema: z.ZodType< properties: z.record(z.nullable(z.string())), updatedAt: z.string().datetime({ offset: true }).transform(v => new Date(v)), }); - /** @internal */ export type SimplePublicObject$Outbound = { createdAt: string; @@ -71,19 +70,6 @@ export const SimplePublicObject$outboundSchema: z.ZodType< updatedAt: z.date().transform(v => v.toISOString()), }); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace SimplePublicObject$ { - /** @deprecated use `SimplePublicObject$inboundSchema` instead. */ - export const inboundSchema = SimplePublicObject$inboundSchema; - /** @deprecated use `SimplePublicObject$outboundSchema` instead. */ - export const outboundSchema = SimplePublicObject$outboundSchema; - /** @deprecated use `SimplePublicObject$Outbound` instead. */ - export type Outbound = SimplePublicObject$Outbound; -} - export function simplePublicObjectToJSON( simplePublicObject: SimplePublicObject, ): string { @@ -91,7 +77,6 @@ export function simplePublicObjectToJSON( SimplePublicObject$outboundSchema.parse(simplePublicObject), ); } - export function simplePublicObjectFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/components/simplepublicobjectinput.ts b/src/models/components/simplepublicobjectinput.ts index 7b85838..f9f4370 100644 --- a/src/models/components/simplepublicobjectinput.ts +++ b/src/models/components/simplepublicobjectinput.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; @@ -21,7 +21,6 @@ export const SimplePublicObjectInput$inboundSchema: z.ZodType< objectWriteTraceId: z.string().optional(), properties: z.record(z.string()), }); - /** @internal */ export type SimplePublicObjectInput$Outbound = { objectWriteTraceId?: string | undefined; @@ -38,19 +37,6 @@ export const SimplePublicObjectInput$outboundSchema: z.ZodType< properties: z.record(z.string()), }); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace SimplePublicObjectInput$ { - /** @deprecated use `SimplePublicObjectInput$inboundSchema` instead. */ - export const inboundSchema = SimplePublicObjectInput$inboundSchema; - /** @deprecated use `SimplePublicObjectInput$outboundSchema` instead. */ - export const outboundSchema = SimplePublicObjectInput$outboundSchema; - /** @deprecated use `SimplePublicObjectInput$Outbound` instead. */ - export type Outbound = SimplePublicObjectInput$Outbound; -} - export function simplePublicObjectInputToJSON( simplePublicObjectInput: SimplePublicObjectInput, ): string { @@ -58,7 +44,6 @@ export function simplePublicObjectInputToJSON( SimplePublicObjectInput$outboundSchema.parse(simplePublicObjectInput), ); } - export function simplePublicObjectInputFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/components/simplepublicobjectinputforcreate.ts b/src/models/components/simplepublicobjectinputforcreate.ts index c892868..57df5be 100644 --- a/src/models/components/simplepublicobjectinputforcreate.ts +++ b/src/models/components/simplepublicobjectinputforcreate.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; @@ -29,7 +29,6 @@ export const SimplePublicObjectInputForCreate$inboundSchema: z.ZodType< objectWriteTraceId: z.string().optional(), properties: z.record(z.string()), }); - /** @internal */ export type SimplePublicObjectInputForCreate$Outbound = { associations: Array; @@ -48,19 +47,6 @@ export const SimplePublicObjectInputForCreate$outboundSchema: z.ZodType< properties: z.record(z.string()), }); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace SimplePublicObjectInputForCreate$ { - /** @deprecated use `SimplePublicObjectInputForCreate$inboundSchema` instead. */ - export const inboundSchema = SimplePublicObjectInputForCreate$inboundSchema; - /** @deprecated use `SimplePublicObjectInputForCreate$outboundSchema` instead. */ - export const outboundSchema = SimplePublicObjectInputForCreate$outboundSchema; - /** @deprecated use `SimplePublicObjectInputForCreate$Outbound` instead. */ - export type Outbound = SimplePublicObjectInputForCreate$Outbound; -} - export function simplePublicObjectInputForCreateToJSON( simplePublicObjectInputForCreate: SimplePublicObjectInputForCreate, ): string { @@ -70,7 +56,6 @@ export function simplePublicObjectInputForCreateToJSON( ), ); } - export function simplePublicObjectInputForCreateFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/components/simplepublicobjectwithassociations.ts b/src/models/components/simplepublicobjectwithassociations.ts index 3d7dc1c..ec38507 100644 --- a/src/models/components/simplepublicobjectwithassociations.ts +++ b/src/models/components/simplepublicobjectwithassociations.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; @@ -50,7 +50,6 @@ export const SimplePublicObjectWithAssociations$inboundSchema: z.ZodType< properties: z.record(z.nullable(z.string())), updatedAt: z.string().datetime({ offset: true }).transform(v => new Date(v)), }); - /** @internal */ export type SimplePublicObjectWithAssociations$Outbound = { associations?: @@ -85,20 +84,6 @@ export const SimplePublicObjectWithAssociations$outboundSchema: z.ZodType< updatedAt: z.date().transform(v => v.toISOString()), }); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace SimplePublicObjectWithAssociations$ { - /** @deprecated use `SimplePublicObjectWithAssociations$inboundSchema` instead. */ - export const inboundSchema = SimplePublicObjectWithAssociations$inboundSchema; - /** @deprecated use `SimplePublicObjectWithAssociations$outboundSchema` instead. */ - export const outboundSchema = - SimplePublicObjectWithAssociations$outboundSchema; - /** @deprecated use `SimplePublicObjectWithAssociations$Outbound` instead. */ - export type Outbound = SimplePublicObjectWithAssociations$Outbound; -} - export function simplePublicObjectWithAssociationsToJSON( simplePublicObjectWithAssociations: SimplePublicObjectWithAssociations, ): string { @@ -108,7 +93,6 @@ export function simplePublicObjectWithAssociationsToJSON( ), ); } - export function simplePublicObjectWithAssociationsFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/components/valuewithtimestamp.ts b/src/models/components/valuewithtimestamp.ts index 5579aea..a9d3f94 100644 --- a/src/models/components/valuewithtimestamp.ts +++ b/src/models/components/valuewithtimestamp.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; @@ -29,7 +29,6 @@ export const ValueWithTimestamp$inboundSchema: z.ZodType< value: z.string(), timestamp: z.string().datetime({ offset: true }).transform(v => new Date(v)), }); - /** @internal */ export type ValueWithTimestamp$Outbound = { sourceId?: string | undefined; @@ -54,19 +53,6 @@ export const ValueWithTimestamp$outboundSchema: z.ZodType< timestamp: z.date().transform(v => v.toISOString()), }); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace ValueWithTimestamp$ { - /** @deprecated use `ValueWithTimestamp$inboundSchema` instead. */ - export const inboundSchema = ValueWithTimestamp$inboundSchema; - /** @deprecated use `ValueWithTimestamp$outboundSchema` instead. */ - export const outboundSchema = ValueWithTimestamp$outboundSchema; - /** @deprecated use `ValueWithTimestamp$Outbound` instead. */ - export type Outbound = ValueWithTimestamp$Outbound; -} - export function valueWithTimestampToJSON( valueWithTimestamp: ValueWithTimestamp, ): string { @@ -74,7 +60,6 @@ export function valueWithTimestampToJSON( ValueWithTimestamp$outboundSchema.parse(valueWithTimestamp), ); } - export function valueWithTimestampFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/errors/apierror.ts b/src/models/errors/apierror.ts index 3a04a1c..1f4684c 100644 --- a/src/models/errors/apierror.ts +++ b/src/models/errors/apierror.ts @@ -2,26 +2,39 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -export class APIError extends Error { - public readonly statusCode: number; - public readonly contentType: string; +import { HubspotError } from "./hubspoterror.js"; +/** The fallback error class if no more specific error class is matched */ +export class APIError extends HubspotError { constructor( message: string, - public readonly rawResponse: Response, - public readonly body: string = "", + httpMeta: { + response: Response; + request: Request; + body: string; + }, ) { - const statusCode = rawResponse.status; - const contentType = rawResponse.headers.get("content-type") || ""; - const bodyString = body.length > 0 ? `\n${body}` : ""; - - super( - `${message}: Status ${statusCode} Content-Type ${contentType} Body ${bodyString}`, - ); - - this.statusCode = statusCode; - this.contentType = contentType; - + if (message) { + message += `: `; + } + message += `Status ${httpMeta.response.status}`; + const contentType = httpMeta.response.headers.get("content-type") || `""`; + if (contentType !== "application/json") { + message += ` Content-Type ${ + contentType.includes(" ") ? `"${contentType}"` : contentType + }`; + } + const body = httpMeta.body || `""`; + message += body.length > 100 ? "\n" : ". "; + let bodyDisplay = body; + if (body.length > 10000) { + const truncated = body.substring(0, 10000); + const remaining = body.length - 10000; + bodyDisplay = `${truncated}...and ${remaining} more chars`; + } + message += `Body: ${bodyDisplay}`; + message = message.trim(); + super(message, httpMeta); this.name = "APIError"; } } diff --git a/src/models/errors/hubspoterror.ts b/src/models/errors/hubspoterror.ts new file mode 100644 index 0000000..93eb3b3 --- /dev/null +++ b/src/models/errors/hubspoterror.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +/** The base class for all HTTP error responses */ +export class HubspotError extends Error { + /** HTTP status code */ + public readonly statusCode: number; + /** HTTP body */ + public readonly body: string; + /** HTTP headers */ + public readonly headers: Headers; + /** HTTP content type */ + public readonly contentType: string; + /** Raw response */ + public readonly rawResponse: Response; + + constructor( + message: string, + httpMeta: { + response: Response; + request: Request; + body: string; + }, + ) { + super(message); + this.statusCode = httpMeta.response.status; + this.body = httpMeta.body; + this.headers = httpMeta.response.headers; + this.contentType = httpMeta.response.headers.get("content-type") || ""; + this.rawResponse = httpMeta.response; + + this.name = "HubspotError"; + } +} diff --git a/src/models/errors/index.ts b/src/models/errors/index.ts index 7b2a3be..aa4506e 100644 --- a/src/models/errors/index.ts +++ b/src/models/errors/index.ts @@ -4,4 +4,6 @@ export * from "./apierror.js"; export * from "./httpclienterrors.js"; +export * from "./hubspoterror.js"; +export * from "./responsevalidationerror.js"; export * from "./sdkvalidationerror.js"; diff --git a/src/models/errors/responsevalidationerror.ts b/src/models/errors/responsevalidationerror.ts new file mode 100644 index 0000000..b60d227 --- /dev/null +++ b/src/models/errors/responsevalidationerror.ts @@ -0,0 +1,50 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v3"; +import { HubspotError } from "./hubspoterror.js"; +import { formatZodError } from "./sdkvalidationerror.js"; + +export class ResponseValidationError extends HubspotError { + /** + * The raw value that failed validation. + */ + public readonly rawValue: unknown; + + /** + * The raw message that failed validation. + */ + public readonly rawMessage: unknown; + + constructor( + message: string, + extra: { + response: Response; + request: Request; + body: string; + cause: unknown; + rawValue: unknown; + rawMessage: unknown; + }, + ) { + super(message, extra); + this.name = "ResponseValidationError"; + this.cause = extra.cause; + this.rawValue = extra.rawValue; + this.rawMessage = extra.rawMessage; + } + + /** + * Return a pretty-formatted error message if the underlying validation error + * is a ZodError or some other recognized error type, otherwise return the + * default error message. + */ + public pretty(): string { + if (this.cause instanceof z.ZodError) { + return `${this.rawMessage}\n${formatZodError(this.cause)}`; + } else { + return this.toString(); + } + } +} diff --git a/src/models/errors/sdkvalidationerror.ts b/src/models/errors/sdkvalidationerror.ts index 16929b9..6826e12 100644 --- a/src/models/errors/sdkvalidationerror.ts +++ b/src/models/errors/sdkvalidationerror.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; export class SDKValidationError extends Error { /** @@ -15,6 +15,18 @@ export class SDKValidationError extends Error { */ public readonly rawMessage: unknown; + // Allows for backwards compatibility for `instanceof` checks of `ResponseValidationError` + static override [Symbol.hasInstance]( + instance: unknown, + ): instance is SDKValidationError { + if (!(instance instanceof Error)) return false; + if (!("rawValue" in instance)) return false; + if (!("rawMessage" in instance)) return false; + if (!("pretty" in instance)) return false; + if (typeof instance.pretty !== "function") return false; + return true; + } + constructor(message: string, cause: unknown, rawValue: unknown) { super(`${message}: ${cause}`); this.name = "SDKValidationError"; diff --git a/src/models/operations/createcontact.ts b/src/models/operations/createcontact.ts index 866e4c1..ce5c277 100644 --- a/src/models/operations/createcontact.ts +++ b/src/models/operations/createcontact.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; import * as b64$ from "../../lib/base64.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; @@ -20,7 +20,6 @@ export const CreateContactResponse$inboundSchema: z.ZodType< z.ZodTypeDef, unknown > = z.union([components.SimplePublicObject$inboundSchema, b64$.zodInbound]); - /** @internal */ export type CreateContactResponse$Outbound = | components.SimplePublicObject$Outbound @@ -33,19 +32,6 @@ export const CreateContactResponse$outboundSchema: z.ZodType< CreateContactResponse > = z.union([components.SimplePublicObject$outboundSchema, b64$.zodOutbound]); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace CreateContactResponse$ { - /** @deprecated use `CreateContactResponse$inboundSchema` instead. */ - export const inboundSchema = CreateContactResponse$inboundSchema; - /** @deprecated use `CreateContactResponse$outboundSchema` instead. */ - export const outboundSchema = CreateContactResponse$outboundSchema; - /** @deprecated use `CreateContactResponse$Outbound` instead. */ - export type Outbound = CreateContactResponse$Outbound; -} - export function createContactResponseToJSON( createContactResponse: CreateContactResponse, ): string { @@ -53,7 +39,6 @@ export function createContactResponseToJSON( CreateContactResponse$outboundSchema.parse(createContactResponse), ); } - export function createContactResponseFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/operations/createdeal.ts b/src/models/operations/createdeal.ts index fe41f30..2f4a328 100644 --- a/src/models/operations/createdeal.ts +++ b/src/models/operations/createdeal.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; import * as b64$ from "../../lib/base64.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; @@ -20,7 +20,6 @@ export const CreateDealResponse$inboundSchema: z.ZodType< z.ZodTypeDef, unknown > = z.union([components.SimplePublicObject$inboundSchema, b64$.zodInbound]); - /** @internal */ export type CreateDealResponse$Outbound = | components.SimplePublicObject$Outbound @@ -33,19 +32,6 @@ export const CreateDealResponse$outboundSchema: z.ZodType< CreateDealResponse > = z.union([components.SimplePublicObject$outboundSchema, b64$.zodOutbound]); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace CreateDealResponse$ { - /** @deprecated use `CreateDealResponse$inboundSchema` instead. */ - export const inboundSchema = CreateDealResponse$inboundSchema; - /** @deprecated use `CreateDealResponse$outboundSchema` instead. */ - export const outboundSchema = CreateDealResponse$outboundSchema; - /** @deprecated use `CreateDealResponse$Outbound` instead. */ - export type Outbound = CreateDealResponse$Outbound; -} - export function createDealResponseToJSON( createDealResponse: CreateDealResponse, ): string { @@ -53,7 +39,6 @@ export function createDealResponseToJSON( CreateDealResponse$outboundSchema.parse(createDealResponse), ); } - export function createDealResponseFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/operations/getcompany.ts b/src/models/operations/getcompany.ts index 1be6b78..930b021 100644 --- a/src/models/operations/getcompany.ts +++ b/src/models/operations/getcompany.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; import * as b64$ from "../../lib/base64.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; @@ -54,7 +54,6 @@ export const GetCompanyRequest$inboundSchema: z.ZodType< archived: z.boolean().default(false), idProperty: z.string().optional(), }); - /** @internal */ export type GetCompanyRequest$Outbound = { companyId: string; @@ -79,19 +78,6 @@ export const GetCompanyRequest$outboundSchema: z.ZodType< idProperty: z.string().optional(), }); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GetCompanyRequest$ { - /** @deprecated use `GetCompanyRequest$inboundSchema` instead. */ - export const inboundSchema = GetCompanyRequest$inboundSchema; - /** @deprecated use `GetCompanyRequest$outboundSchema` instead. */ - export const outboundSchema = GetCompanyRequest$outboundSchema; - /** @deprecated use `GetCompanyRequest$Outbound` instead. */ - export type Outbound = GetCompanyRequest$Outbound; -} - export function getCompanyRequestToJSON( getCompanyRequest: GetCompanyRequest, ): string { @@ -99,7 +85,6 @@ export function getCompanyRequestToJSON( GetCompanyRequest$outboundSchema.parse(getCompanyRequest), ); } - export function getCompanyRequestFromJSON( jsonString: string, ): SafeParseResult { @@ -119,7 +104,6 @@ export const GetCompanyResponse$inboundSchema: z.ZodType< components.SimplePublicObjectWithAssociations$inboundSchema, b64$.zodInbound, ]); - /** @internal */ export type GetCompanyResponse$Outbound = | components.SimplePublicObjectWithAssociations$Outbound @@ -135,19 +119,6 @@ export const GetCompanyResponse$outboundSchema: z.ZodType< b64$.zodOutbound, ]); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GetCompanyResponse$ { - /** @deprecated use `GetCompanyResponse$inboundSchema` instead. */ - export const inboundSchema = GetCompanyResponse$inboundSchema; - /** @deprecated use `GetCompanyResponse$outboundSchema` instead. */ - export const outboundSchema = GetCompanyResponse$outboundSchema; - /** @deprecated use `GetCompanyResponse$Outbound` instead. */ - export type Outbound = GetCompanyResponse$Outbound; -} - export function getCompanyResponseToJSON( getCompanyResponse: GetCompanyResponse, ): string { @@ -155,7 +126,6 @@ export function getCompanyResponseToJSON( GetCompanyResponse$outboundSchema.parse(getCompanyResponse), ); } - export function getCompanyResponseFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/operations/getcontact.ts b/src/models/operations/getcontact.ts index 77fdc64..c710d0d 100644 --- a/src/models/operations/getcontact.ts +++ b/src/models/operations/getcontact.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; import * as b64$ from "../../lib/base64.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; @@ -49,7 +49,6 @@ export const GetContactRequest$inboundSchema: z.ZodType< associations: z.array(z.string()).optional(), archived: z.boolean().default(false), }); - /** @internal */ export type GetContactRequest$Outbound = { contactId: string; @@ -72,19 +71,6 @@ export const GetContactRequest$outboundSchema: z.ZodType< archived: z.boolean().default(false), }); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GetContactRequest$ { - /** @deprecated use `GetContactRequest$inboundSchema` instead. */ - export const inboundSchema = GetContactRequest$inboundSchema; - /** @deprecated use `GetContactRequest$outboundSchema` instead. */ - export const outboundSchema = GetContactRequest$outboundSchema; - /** @deprecated use `GetContactRequest$Outbound` instead. */ - export type Outbound = GetContactRequest$Outbound; -} - export function getContactRequestToJSON( getContactRequest: GetContactRequest, ): string { @@ -92,7 +78,6 @@ export function getContactRequestToJSON( GetContactRequest$outboundSchema.parse(getContactRequest), ); } - export function getContactRequestFromJSON( jsonString: string, ): SafeParseResult { @@ -112,7 +97,6 @@ export const GetContactResponse$inboundSchema: z.ZodType< components.SimplePublicObjectWithAssociations$inboundSchema, b64$.zodInbound, ]); - /** @internal */ export type GetContactResponse$Outbound = | components.SimplePublicObjectWithAssociations$Outbound @@ -128,19 +112,6 @@ export const GetContactResponse$outboundSchema: z.ZodType< b64$.zodOutbound, ]); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GetContactResponse$ { - /** @deprecated use `GetContactResponse$inboundSchema` instead. */ - export const inboundSchema = GetContactResponse$inboundSchema; - /** @deprecated use `GetContactResponse$outboundSchema` instead. */ - export const outboundSchema = GetContactResponse$outboundSchema; - /** @deprecated use `GetContactResponse$Outbound` instead. */ - export type Outbound = GetContactResponse$Outbound; -} - export function getContactResponseToJSON( getContactResponse: GetContactResponse, ): string { @@ -148,7 +119,6 @@ export function getContactResponseToJSON( GetContactResponse$outboundSchema.parse(getContactResponse), ); } - export function getContactResponseFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/operations/getdeal.ts b/src/models/operations/getdeal.ts index 911902b..fc35a12 100644 --- a/src/models/operations/getdeal.ts +++ b/src/models/operations/getdeal.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; import * as b64$ from "../../lib/base64.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; @@ -51,7 +51,6 @@ export const GetDealRequest$inboundSchema: z.ZodType< archived: z.boolean().default(false), idProperty: z.string().optional(), }); - /** @internal */ export type GetDealRequest$Outbound = { dealId: string; @@ -76,23 +75,9 @@ export const GetDealRequest$outboundSchema: z.ZodType< idProperty: z.string().optional(), }); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GetDealRequest$ { - /** @deprecated use `GetDealRequest$inboundSchema` instead. */ - export const inboundSchema = GetDealRequest$inboundSchema; - /** @deprecated use `GetDealRequest$outboundSchema` instead. */ - export const outboundSchema = GetDealRequest$outboundSchema; - /** @deprecated use `GetDealRequest$Outbound` instead. */ - export type Outbound = GetDealRequest$Outbound; -} - export function getDealRequestToJSON(getDealRequest: GetDealRequest): string { return JSON.stringify(GetDealRequest$outboundSchema.parse(getDealRequest)); } - export function getDealRequestFromJSON( jsonString: string, ): SafeParseResult { @@ -112,7 +97,6 @@ export const GetDealResponse$inboundSchema: z.ZodType< components.SimplePublicObjectWithAssociations$inboundSchema, b64$.zodInbound, ]); - /** @internal */ export type GetDealResponse$Outbound = | components.SimplePublicObjectWithAssociations$Outbound @@ -128,25 +112,11 @@ export const GetDealResponse$outboundSchema: z.ZodType< b64$.zodOutbound, ]); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GetDealResponse$ { - /** @deprecated use `GetDealResponse$inboundSchema` instead. */ - export const inboundSchema = GetDealResponse$inboundSchema; - /** @deprecated use `GetDealResponse$outboundSchema` instead. */ - export const outboundSchema = GetDealResponse$outboundSchema; - /** @deprecated use `GetDealResponse$Outbound` instead. */ - export type Outbound = GetDealResponse$Outbound; -} - export function getDealResponseToJSON( getDealResponse: GetDealResponse, ): string { return JSON.stringify(GetDealResponse$outboundSchema.parse(getDealResponse)); } - export function getDealResponseFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/operations/getproperties.ts b/src/models/operations/getproperties.ts index 6652d85..9f755ae 100644 --- a/src/models/operations/getproperties.ts +++ b/src/models/operations/getproperties.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; import * as b64$ from "../../lib/base64.js"; import { safeParse } from "../../lib/schemas.js"; import { ClosedEnum } from "../../types/enums.js"; @@ -34,22 +34,10 @@ export type GetPropertiesResponse = { [k: string]: any } | Uint8Array | string; /** @internal */ export const ObjectType$inboundSchema: z.ZodNativeEnum = z .nativeEnum(ObjectType); - /** @internal */ export const ObjectType$outboundSchema: z.ZodNativeEnum = ObjectType$inboundSchema; -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace ObjectType$ { - /** @deprecated use `ObjectType$inboundSchema` instead. */ - export const inboundSchema = ObjectType$inboundSchema; - /** @deprecated use `ObjectType$outboundSchema` instead. */ - export const outboundSchema = ObjectType$outboundSchema; -} - /** @internal */ export const GetPropertiesRequest$inboundSchema: z.ZodType< GetPropertiesRequest, @@ -58,7 +46,6 @@ export const GetPropertiesRequest$inboundSchema: z.ZodType< > = z.object({ objectType: ObjectType$inboundSchema, }); - /** @internal */ export type GetPropertiesRequest$Outbound = { objectType: string; @@ -73,19 +60,6 @@ export const GetPropertiesRequest$outboundSchema: z.ZodType< objectType: ObjectType$outboundSchema, }); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GetPropertiesRequest$ { - /** @deprecated use `GetPropertiesRequest$inboundSchema` instead. */ - export const inboundSchema = GetPropertiesRequest$inboundSchema; - /** @deprecated use `GetPropertiesRequest$outboundSchema` instead. */ - export const outboundSchema = GetPropertiesRequest$outboundSchema; - /** @deprecated use `GetPropertiesRequest$Outbound` instead. */ - export type Outbound = GetPropertiesRequest$Outbound; -} - export function getPropertiesRequestToJSON( getPropertiesRequest: GetPropertiesRequest, ): string { @@ -93,7 +67,6 @@ export function getPropertiesRequestToJSON( GetPropertiesRequest$outboundSchema.parse(getPropertiesRequest), ); } - export function getPropertiesRequestFromJSON( jsonString: string, ): SafeParseResult { @@ -110,7 +83,6 @@ export const GetPropertiesResponse$inboundSchema: z.ZodType< z.ZodTypeDef, unknown > = z.union([z.record(z.any()), b64$.zodInbound]); - /** @internal */ export type GetPropertiesResponse$Outbound = { [k: string]: any } | Uint8Array; @@ -121,19 +93,6 @@ export const GetPropertiesResponse$outboundSchema: z.ZodType< GetPropertiesResponse > = z.union([z.record(z.any()), b64$.zodOutbound]); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GetPropertiesResponse$ { - /** @deprecated use `GetPropertiesResponse$inboundSchema` instead. */ - export const inboundSchema = GetPropertiesResponse$inboundSchema; - /** @deprecated use `GetPropertiesResponse$outboundSchema` instead. */ - export const outboundSchema = GetPropertiesResponse$outboundSchema; - /** @deprecated use `GetPropertiesResponse$Outbound` instead. */ - export type Outbound = GetPropertiesResponse$Outbound; -} - export function getPropertiesResponseToJSON( getPropertiesResponse: GetPropertiesResponse, ): string { @@ -141,7 +100,6 @@ export function getPropertiesResponseToJSON( GetPropertiesResponse$outboundSchema.parse(getPropertiesResponse), ); } - export function getPropertiesResponseFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/operations/searchcompanies.ts b/src/models/operations/searchcompanies.ts index 77d40f3..f2d2cc5 100644 --- a/src/models/operations/searchcompanies.ts +++ b/src/models/operations/searchcompanies.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; import * as b64$ from "../../lib/base64.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; @@ -24,7 +24,6 @@ export const SearchCompaniesResponse$inboundSchema: z.ZodType< .CollectionResponseWithTotalSimplePublicObjectForwardPaging$inboundSchema, b64$.zodInbound, ]); - /** @internal */ export type SearchCompaniesResponse$Outbound = | components.CollectionResponseWithTotalSimplePublicObjectForwardPaging$Outbound @@ -41,19 +40,6 @@ export const SearchCompaniesResponse$outboundSchema: z.ZodType< b64$.zodOutbound, ]); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace SearchCompaniesResponse$ { - /** @deprecated use `SearchCompaniesResponse$inboundSchema` instead. */ - export const inboundSchema = SearchCompaniesResponse$inboundSchema; - /** @deprecated use `SearchCompaniesResponse$outboundSchema` instead. */ - export const outboundSchema = SearchCompaniesResponse$outboundSchema; - /** @deprecated use `SearchCompaniesResponse$Outbound` instead. */ - export type Outbound = SearchCompaniesResponse$Outbound; -} - export function searchCompaniesResponseToJSON( searchCompaniesResponse: SearchCompaniesResponse, ): string { @@ -61,7 +47,6 @@ export function searchCompaniesResponseToJSON( SearchCompaniesResponse$outboundSchema.parse(searchCompaniesResponse), ); } - export function searchCompaniesResponseFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/operations/searchcontacts.ts b/src/models/operations/searchcontacts.ts index 796019e..1b33ca9 100644 --- a/src/models/operations/searchcontacts.ts +++ b/src/models/operations/searchcontacts.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; import * as b64$ from "../../lib/base64.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; @@ -24,7 +24,6 @@ export const SearchContactsResponse$inboundSchema: z.ZodType< .CollectionResponseWithTotalSimplePublicObjectForwardPaging$inboundSchema, b64$.zodInbound, ]); - /** @internal */ export type SearchContactsResponse$Outbound = | components.CollectionResponseWithTotalSimplePublicObjectForwardPaging$Outbound @@ -41,19 +40,6 @@ export const SearchContactsResponse$outboundSchema: z.ZodType< b64$.zodOutbound, ]); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace SearchContactsResponse$ { - /** @deprecated use `SearchContactsResponse$inboundSchema` instead. */ - export const inboundSchema = SearchContactsResponse$inboundSchema; - /** @deprecated use `SearchContactsResponse$outboundSchema` instead. */ - export const outboundSchema = SearchContactsResponse$outboundSchema; - /** @deprecated use `SearchContactsResponse$Outbound` instead. */ - export type Outbound = SearchContactsResponse$Outbound; -} - export function searchContactsResponseToJSON( searchContactsResponse: SearchContactsResponse, ): string { @@ -61,7 +47,6 @@ export function searchContactsResponseToJSON( SearchContactsResponse$outboundSchema.parse(searchContactsResponse), ); } - export function searchContactsResponseFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/operations/searchdeals.ts b/src/models/operations/searchdeals.ts index 350f5fd..5a11b2e 100644 --- a/src/models/operations/searchdeals.ts +++ b/src/models/operations/searchdeals.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; import * as b64$ from "../../lib/base64.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; @@ -24,7 +24,6 @@ export const SearchDealsResponse$inboundSchema: z.ZodType< .CollectionResponseWithTotalSimplePublicObjectForwardPaging$inboundSchema, b64$.zodInbound, ]); - /** @internal */ export type SearchDealsResponse$Outbound = | components.CollectionResponseWithTotalSimplePublicObjectForwardPaging$Outbound @@ -41,19 +40,6 @@ export const SearchDealsResponse$outboundSchema: z.ZodType< b64$.zodOutbound, ]); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace SearchDealsResponse$ { - /** @deprecated use `SearchDealsResponse$inboundSchema` instead. */ - export const inboundSchema = SearchDealsResponse$inboundSchema; - /** @deprecated use `SearchDealsResponse$outboundSchema` instead. */ - export const outboundSchema = SearchDealsResponse$outboundSchema; - /** @deprecated use `SearchDealsResponse$Outbound` instead. */ - export type Outbound = SearchDealsResponse$Outbound; -} - export function searchDealsResponseToJSON( searchDealsResponse: SearchDealsResponse, ): string { @@ -61,7 +47,6 @@ export function searchDealsResponseToJSON( SearchDealsResponse$outboundSchema.parse(searchDealsResponse), ); } - export function searchDealsResponseFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/operations/updatecompany.ts b/src/models/operations/updatecompany.ts index d1583c4..8db66f4 100644 --- a/src/models/operations/updatecompany.ts +++ b/src/models/operations/updatecompany.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; import * as b64$ from "../../lib/base64.js"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; @@ -38,7 +38,6 @@ export const UpdateCompanyRequest$inboundSchema: z.ZodType< "SimplePublicObjectInput": "simplePublicObjectInput", }); }); - /** @internal */ export type UpdateCompanyRequest$Outbound = { companyId: string; @@ -61,19 +60,6 @@ export const UpdateCompanyRequest$outboundSchema: z.ZodType< }); }); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace UpdateCompanyRequest$ { - /** @deprecated use `UpdateCompanyRequest$inboundSchema` instead. */ - export const inboundSchema = UpdateCompanyRequest$inboundSchema; - /** @deprecated use `UpdateCompanyRequest$outboundSchema` instead. */ - export const outboundSchema = UpdateCompanyRequest$outboundSchema; - /** @deprecated use `UpdateCompanyRequest$Outbound` instead. */ - export type Outbound = UpdateCompanyRequest$Outbound; -} - export function updateCompanyRequestToJSON( updateCompanyRequest: UpdateCompanyRequest, ): string { @@ -81,7 +67,6 @@ export function updateCompanyRequestToJSON( UpdateCompanyRequest$outboundSchema.parse(updateCompanyRequest), ); } - export function updateCompanyRequestFromJSON( jsonString: string, ): SafeParseResult { @@ -98,7 +83,6 @@ export const UpdateCompanyResponse$inboundSchema: z.ZodType< z.ZodTypeDef, unknown > = z.union([components.SimplePublicObject$inboundSchema, b64$.zodInbound]); - /** @internal */ export type UpdateCompanyResponse$Outbound = | components.SimplePublicObject$Outbound @@ -111,19 +95,6 @@ export const UpdateCompanyResponse$outboundSchema: z.ZodType< UpdateCompanyResponse > = z.union([components.SimplePublicObject$outboundSchema, b64$.zodOutbound]); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace UpdateCompanyResponse$ { - /** @deprecated use `UpdateCompanyResponse$inboundSchema` instead. */ - export const inboundSchema = UpdateCompanyResponse$inboundSchema; - /** @deprecated use `UpdateCompanyResponse$outboundSchema` instead. */ - export const outboundSchema = UpdateCompanyResponse$outboundSchema; - /** @deprecated use `UpdateCompanyResponse$Outbound` instead. */ - export type Outbound = UpdateCompanyResponse$Outbound; -} - export function updateCompanyResponseToJSON( updateCompanyResponse: UpdateCompanyResponse, ): string { @@ -131,7 +102,6 @@ export function updateCompanyResponseToJSON( UpdateCompanyResponse$outboundSchema.parse(updateCompanyResponse), ); } - export function updateCompanyResponseFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/operations/updatecontact.ts b/src/models/operations/updatecontact.ts index e99554a..e7def5d 100644 --- a/src/models/operations/updatecontact.ts +++ b/src/models/operations/updatecontact.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; import * as b64$ from "../../lib/base64.js"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; @@ -36,7 +36,6 @@ export const UpdateContactRequest$inboundSchema: z.ZodType< "SimplePublicObjectInput": "simplePublicObjectInput", }); }); - /** @internal */ export type UpdateContactRequest$Outbound = { contactId: string; @@ -57,19 +56,6 @@ export const UpdateContactRequest$outboundSchema: z.ZodType< }); }); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace UpdateContactRequest$ { - /** @deprecated use `UpdateContactRequest$inboundSchema` instead. */ - export const inboundSchema = UpdateContactRequest$inboundSchema; - /** @deprecated use `UpdateContactRequest$outboundSchema` instead. */ - export const outboundSchema = UpdateContactRequest$outboundSchema; - /** @deprecated use `UpdateContactRequest$Outbound` instead. */ - export type Outbound = UpdateContactRequest$Outbound; -} - export function updateContactRequestToJSON( updateContactRequest: UpdateContactRequest, ): string { @@ -77,7 +63,6 @@ export function updateContactRequestToJSON( UpdateContactRequest$outboundSchema.parse(updateContactRequest), ); } - export function updateContactRequestFromJSON( jsonString: string, ): SafeParseResult { @@ -94,7 +79,6 @@ export const UpdateContactResponse$inboundSchema: z.ZodType< z.ZodTypeDef, unknown > = z.union([components.SimplePublicObject$inboundSchema, b64$.zodInbound]); - /** @internal */ export type UpdateContactResponse$Outbound = | components.SimplePublicObject$Outbound @@ -107,19 +91,6 @@ export const UpdateContactResponse$outboundSchema: z.ZodType< UpdateContactResponse > = z.union([components.SimplePublicObject$outboundSchema, b64$.zodOutbound]); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace UpdateContactResponse$ { - /** @deprecated use `UpdateContactResponse$inboundSchema` instead. */ - export const inboundSchema = UpdateContactResponse$inboundSchema; - /** @deprecated use `UpdateContactResponse$outboundSchema` instead. */ - export const outboundSchema = UpdateContactResponse$outboundSchema; - /** @deprecated use `UpdateContactResponse$Outbound` instead. */ - export type Outbound = UpdateContactResponse$Outbound; -} - export function updateContactResponseToJSON( updateContactResponse: UpdateContactResponse, ): string { @@ -127,7 +98,6 @@ export function updateContactResponseToJSON( UpdateContactResponse$outboundSchema.parse(updateContactResponse), ); } - export function updateContactResponseFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/operations/updatedeal.ts b/src/models/operations/updatedeal.ts index 81ac808..0a67bd5 100644 --- a/src/models/operations/updatedeal.ts +++ b/src/models/operations/updatedeal.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; import * as b64$ from "../../lib/base64.js"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; @@ -38,7 +38,6 @@ export const UpdateDealRequest$inboundSchema: z.ZodType< "SimplePublicObjectInput": "simplePublicObjectInput", }); }); - /** @internal */ export type UpdateDealRequest$Outbound = { dealId: string; @@ -61,19 +60,6 @@ export const UpdateDealRequest$outboundSchema: z.ZodType< }); }); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace UpdateDealRequest$ { - /** @deprecated use `UpdateDealRequest$inboundSchema` instead. */ - export const inboundSchema = UpdateDealRequest$inboundSchema; - /** @deprecated use `UpdateDealRequest$outboundSchema` instead. */ - export const outboundSchema = UpdateDealRequest$outboundSchema; - /** @deprecated use `UpdateDealRequest$Outbound` instead. */ - export type Outbound = UpdateDealRequest$Outbound; -} - export function updateDealRequestToJSON( updateDealRequest: UpdateDealRequest, ): string { @@ -81,7 +67,6 @@ export function updateDealRequestToJSON( UpdateDealRequest$outboundSchema.parse(updateDealRequest), ); } - export function updateDealRequestFromJSON( jsonString: string, ): SafeParseResult { @@ -98,7 +83,6 @@ export const UpdateDealResponse$inboundSchema: z.ZodType< z.ZodTypeDef, unknown > = z.union([components.SimplePublicObject$inboundSchema, b64$.zodInbound]); - /** @internal */ export type UpdateDealResponse$Outbound = | components.SimplePublicObject$Outbound @@ -111,19 +95,6 @@ export const UpdateDealResponse$outboundSchema: z.ZodType< UpdateDealResponse > = z.union([components.SimplePublicObject$outboundSchema, b64$.zodOutbound]); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace UpdateDealResponse$ { - /** @deprecated use `UpdateDealResponse$inboundSchema` instead. */ - export const inboundSchema = UpdateDealResponse$inboundSchema; - /** @deprecated use `UpdateDealResponse$outboundSchema` instead. */ - export const outboundSchema = UpdateDealResponse$outboundSchema; - /** @deprecated use `UpdateDealResponse$Outbound` instead. */ - export type Outbound = UpdateDealResponse$Outbound; -} - export function updateDealResponseToJSON( updateDealResponse: UpdateDealResponse, ): string { @@ -131,7 +102,6 @@ export function updateDealResponseToJSON( UpdateDealResponse$outboundSchema.parse(updateDealResponse), ); } - export function updateDealResponseFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/types/blobs.ts b/src/types/blobs.ts index 4ce8460..cce2892 100644 --- a/src/types/blobs.ts +++ b/src/types/blobs.ts @@ -2,13 +2,14 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; -export const blobLikeSchema: z.ZodType = - z.custom(isBlobLike, { - message: "expected a Blob, File or Blob-like object", - fatal: true, - }); +export const blobLikeSchema: z.ZodType = z.custom< + Blob +>(isBlobLike, { + message: "expected a Blob, File or Blob-like object", + fatal: true, +}); export function isBlobLike(val: unknown): val is Blob { if (val instanceof Blob) { diff --git a/src/types/constdatetime.ts b/src/types/constdatetime.ts index c0a4409..fe62144 100644 --- a/src/types/constdatetime.ts +++ b/src/types/constdatetime.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; export function constDateTime( val: string, @@ -11,5 +11,5 @@ export function constDateTime( return ( typeof v === "string" && new Date(v).getTime() === new Date(val).getTime() ); - }, `Value must be equivelant to ${val}`); + }, `Value must be equivalent to ${val}`); }