Skip to content

Commit 86f9142

Browse files
committed
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.634.2
1 parent 590a2a7 commit 86f9142

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+1688
-723
lines changed

.devcontainer/setup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ curl -fsSL https://raw.githubusercontent.com/speakeasy-api/speakeasy/main/instal
77
rmdir samples || true
88
mkdir samples
99

10-
npm install
11-
npm install -g ts-node
10+
npm install --ignore-scripts
11+
npm install -g ts-node --ignore-scripts
1212
npm link
1313
npm link mcp-hubspot
1414
TS_CONFIG_CONTENT=$(cat <<EOL

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/examples/node_modules
2+
.DS_Store
3+
**/.speakeasy/temp/
4+
**/.speakeasy/logs/
5+
.DS_Store
6+
.env
7+
.env.local
8+
.env.*.local
19
/models
210
/models/errors
311
/types

.speakeasy/gen.lock

Lines changed: 45 additions & 41 deletions
Large diffs are not rendered by default.

.speakeasy/gen.yaml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,35 @@ generation:
77
maintainOpenAPIOrder: true
88
usageSnippets:
99
optionalPropertyRendering: withExample
10+
sdkInitStyle: constructor
1011
useClassNamesForArrayFields: true
1112
fixes:
1213
nameResolutionDec2023: true
1314
nameResolutionFeb2025: false
1415
parameterOrderingFeb2024: true
1516
requestResponseComponentNamesFeb2024: true
1617
securityFeb2025: true
18+
sharedErrorComponentsApr2025: false
1719
auth:
1820
oAuth2ClientCredentialsEnabled: true
1921
oAuth2PasswordEnabled: true
22+
hoistGlobalSecurity: true
23+
tests:
24+
generateTests: true
25+
generateNewTests: false
26+
skipResponseBodyAssertions: false
2027
typescript:
21-
version: 0.1.0
28+
version: 0.2.0
29+
acceptHeaderEnum: true
2230
additionalDependencies:
2331
dependencies: {}
2432
devDependencies: {}
2533
peerDependencies: {}
2634
additionalPackageJSON: {}
2735
author: speakeasyapi
36+
baseErrorName: HubspotError
2837
clientServerStatusCodesAsErrors: true
38+
constFieldsAlwaysOptional: true
2939
defaultErrorName: APIError
3040
enableCustomCodeRegions: false
3141
enableMCPServer: true
@@ -34,6 +44,7 @@ typescript:
3444
envVarPrefix: HUBSPOT
3545
flattenGlobalSecurity: true
3646
flatteningOrder: parameters-first
47+
generateExamples: true
3748
imports:
3849
option: openapi
3950
paths:
@@ -46,9 +57,12 @@ typescript:
4657
jsonpath: rfc9535
4758
maxMethodParams: 0
4859
methodArguments: require-security-and-request
60+
modelPropertyCasing: camel
4961
moduleFormat: dual
5062
outputModelSuffix: output
5163
packageName: mcp-hubspot
5264
responseFormat: flat
65+
sseFlatResponse: false
5366
templateVersion: v2
67+
usageSDKInitImports: []
5468
useIndexModules: true

.speakeasy/workflow.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
speakeasyVersion: 1.521.1
1+
speakeasyVersion: 1.634.2
22
sources:
33
CRM:
44
sourceNamespace: crm
@@ -9,20 +9,20 @@ sources:
99
- v3
1010
HubspotCRM:
1111
sourceNamespace: hubspot-crm
12-
sourceRevisionDigest: sha256:068f049648f508cd2c1f0b3f74fdec83a2920b10763541b84a05644ba5fac7f9
13-
sourceBlobDigest: sha256:fd3bb26f0d19170b271fae7398ffb1b2dbe48799b6e7c4dee95ec5c58302f332
12+
sourceRevisionDigest: sha256:bdaa622c04c7175412a08b756862795f1d99e297146f8e2b525f3963e534147e
13+
sourceBlobDigest: sha256:b1d0f16211f77123ade749fadc389b583fdf73c524f6bf7014da1fae2f4b2d6a
1414
tags:
1515
- latest
16-
- speakeasy-sdk-regen-1742493224
16+
- speakeasy-sdk-regen-1743711404
1717
- v3
1818
targets:
1919
hubspot:
2020
source: HubspotCRM
2121
sourceNamespace: hubspot-crm
22-
sourceRevisionDigest: sha256:068f049648f508cd2c1f0b3f74fdec83a2920b10763541b84a05644ba5fac7f9
23-
sourceBlobDigest: sha256:fd3bb26f0d19170b271fae7398ffb1b2dbe48799b6e7c4dee95ec5c58302f332
22+
sourceRevisionDigest: sha256:bdaa622c04c7175412a08b756862795f1d99e297146f8e2b525f3963e534147e
23+
sourceBlobDigest: sha256:b1d0f16211f77123ade749fadc389b583fdf73c524f6bf7014da1fae2f4b2d6a
2424
codeSamplesNamespace: hubspot-crm-typescript-code-samples
25-
codeSamplesRevisionDigest: sha256:d61859db7b587ca10a3a1abaff25b520db3c9e1e3f8cfde32e27cd069c6e5a2a
25+
codeSamplesRevisionDigest: sha256:9d63f8a7ebe06cb08da4c6542e29daea2a82959c4df9bb24a952e55d7fc476c3
2626
workflow:
2727
workflowVersion: 1.0.0
2828
speakeasyVersion: latest

FUNCTIONS.md

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ specific category of applications.
2121
```typescript
2222
import { HubspotCore } from "mcp-hubspot/core.js";
2323
import { basicGetProperties } from "mcp-hubspot/funcs/basicGetProperties.js";
24-
import { SDKValidationError } from "mcp-hubspot/models/errors/sdkvalidationerror.js";
2524

2625
// Use `HubspotCore` for best tree-shaking performance.
2726
// You can create one instance of it to use across an application.
@@ -31,30 +30,14 @@ const hubspot = new HubspotCore({
3130

3231
async function run() {
3332
const res = await basicGetProperties(hubspot, {
34-
objectType: "deals",
33+
objectType: "contacts",
3534
});
36-
37-
switch (true) {
38-
case res.ok:
39-
// The success case will be handled outside of the switch block
40-
break;
41-
case res.error instanceof SDKValidationError:
42-
// Pretty-print validation errors.
43-
return console.log(res.error.pretty());
44-
case res.error instanceof Error:
45-
return console.log(res.error);
46-
default:
47-
// TypeScript's type checking will fail on the following line if the above
48-
// cases were not exhaustive.
49-
res.error satisfies never;
50-
throw new Error("Assertion failed: expected error checks to be exhaustive: " + res.error);
35+
if (res.ok) {
36+
const { value: result } = res;
37+
console.log(result);
38+
} else {
39+
console.log("basicGetProperties failed:", res.error);
5140
}
52-
53-
54-
const { value: result } = res;
55-
56-
// Handle the result
57-
console.log(result);
5841
}
5942

6043
run();

README.md

Lines changed: 43 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,7 @@ bun add mcp-hubspot
6767
### Yarn
6868

6969
```bash
70-
yarn add mcp-hubspot zod
71-
72-
# Note that Yarn does not install peer dependencies automatically. You will need
73-
# to install zod as shown above.
70+
yarn add mcp-hubspot
7471
```
7572

7673
> [!NOTE]
@@ -181,10 +178,9 @@ const hubspot = new Hubspot({
181178

182179
async function run() {
183180
const result = await hubspot.basic.getProperties({
184-
objectType: "deals",
181+
objectType: "contacts",
185182
});
186183

187-
// Handle the result
188184
console.log(result);
189185
}
190186

@@ -214,10 +210,9 @@ const hubspot = new Hubspot({
214210

215211
async function run() {
216212
const result = await hubspot.basic.getProperties({
217-
objectType: "deals",
213+
objectType: "contacts",
218214
});
219215

220-
// Handle the result
221216
console.log(result);
222217
}
223218

@@ -300,7 +295,7 @@ const hubspot = new Hubspot({
300295

301296
async function run() {
302297
const result = await hubspot.basic.getProperties({
303-
objectType: "deals",
298+
objectType: "contacts",
304299
}, {
305300
retries: {
306301
strategy: "backoff",
@@ -314,7 +309,6 @@ async function run() {
314309
},
315310
});
316311

317-
// Handle the result
318312
console.log(result);
319313
}
320314

@@ -342,10 +336,9 @@ const hubspot = new Hubspot({
342336

343337
async function run() {
344338
const result = await hubspot.basic.getProperties({
345-
objectType: "deals",
339+
objectType: "contacts",
346340
});
347341

348-
// Handle the result
349342
console.log(result);
350343
}
351344

@@ -357,51 +350,38 @@ run();
357350
<!-- Start Error Handling [errors] -->
358351
## Error Handling
359352

360-
If the request fails due to, for example 4XX or 5XX status codes, it will throw a `APIError`.
353+
[`HubspotError`](./src/models/errors/hubspoterror.ts) is the base class for all HTTP error responses. It has the following properties:
361354

362-
| Error Type | Status Code | Content Type |
363-
| --------------- | ----------- | ------------ |
364-
| errors.APIError | 4XX, 5XX | \*/\* |
355+
| Property | Type | Description |
356+
| ------------------- | ---------- | ------------------------------------------------------ |
357+
| `error.message` | `string` | Error message |
358+
| `error.statusCode` | `number` | HTTP response status code eg `404` |
359+
| `error.headers` | `Headers` | HTTP response headers |
360+
| `error.body` | `string` | HTTP body. Can be empty string if no body is returned. |
361+
| `error.rawResponse` | `Response` | Raw HTTP response |
365362

363+
### Example
366364
```typescript
367365
import { Hubspot } from "mcp-hubspot";
368-
import { SDKValidationError } from "mcp-hubspot/models/errors";
366+
import * as errors from "mcp-hubspot/models/errors";
369367

370368
const hubspot = new Hubspot({
371369
hubspotToken: process.env["HUBSPOT_HUBSPOT_TOKEN"] ?? "",
372370
});
373371

374372
async function run() {
375-
let result;
376373
try {
377-
result = await hubspot.basic.getProperties({
378-
objectType: "deals",
374+
const result = await hubspot.basic.getProperties({
375+
objectType: "contacts",
379376
});
380377

381-
// Handle the result
382378
console.log(result);
383-
} catch (err) {
384-
switch (true) {
385-
// The server response does not match the expected SDK schema
386-
case (err instanceof SDKValidationError):
387-
{
388-
// Pretty-print will provide a human-readable multi-line error message
389-
console.error(err.pretty());
390-
// Raw value may also be inspected
391-
console.error(err.rawValue);
392-
return;
393-
}
394-
apierror.js;
395-
// Server returned an error status code or an unknown content type
396-
case (err instanceof APIError): {
397-
console.error(err.statusCode);
398-
console.error(err.rawResponse.body);
399-
return;
400-
}
401-
default: {
402-
// Other errors such as network errors, see HTTPClientErrors for more details
403-
throw err;
404-
}
379+
} catch (error) {
380+
if (error instanceof errors.HubspotError) {
381+
console.log(error.message);
382+
console.log(error.statusCode);
383+
console.log(error.body);
384+
console.log(error.headers);
405385
}
406386
}
407387
}
@@ -410,17 +390,26 @@ run();
410390

411391
```
412392

413-
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.
393+
### Error Classes
394+
**Primary error:**
395+
* [`HubspotError`](./src/models/errors/hubspoterror.ts): The base class for HTTP error responses.
396+
397+
<details><summary>Less common errors (6)</summary>
398+
399+
<br />
414400

415-
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:
401+
**Network errors:**
402+
* [`ConnectionError`](./src/models/errors/httpclienterrors.ts): HTTP client was unable to make a request to a server.
403+
* [`RequestTimeoutError`](./src/models/errors/httpclienterrors.ts): HTTP request timed out due to an AbortSignal signal.
404+
* [`RequestAbortedError`](./src/models/errors/httpclienterrors.ts): HTTP request was aborted by the client.
405+
* [`InvalidRequestError`](./src/models/errors/httpclienterrors.ts): Any input used to create a request is invalid.
406+
* [`UnexpectedClientError`](./src/models/errors/httpclienterrors.ts): Unrecognised or unexpected error.
416407

417-
| HTTP Client Error | Description |
418-
| ---------------------------------------------------- | ---------------------------------------------------- |
419-
| RequestAbortedError | HTTP request was aborted by the client |
420-
| RequestTimeoutError | HTTP request timed out due to an AbortSignal signal |
421-
| ConnectionError | HTTP client was unable to make a request to a server |
422-
| InvalidRequestError | Any input used to create a request is invalid |
423-
| UnexpectedClientError | Unrecognised or unexpected error |
408+
409+
**Inherit from [`HubspotError`](./src/models/errors/hubspoterror.ts)**:
410+
* [`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.
411+
412+
</details>
424413
<!-- End Error Handling [errors] -->
425414

426415
<!-- Start Server Selection [server] -->
@@ -439,10 +428,9 @@ const hubspot = new Hubspot({
439428

440429
async function run() {
441430
const result = await hubspot.basic.getProperties({
442-
objectType: "deals",
431+
objectType: "contacts",
443432
});
444433

445-
// Handle the result
446434
console.log(result);
447435
}
448436

@@ -496,7 +484,7 @@ httpClient.addHook("requestError", (error, request) => {
496484
console.groupEnd();
497485
});
498486

499-
const sdk = new Hubspot({ httpClient });
487+
const sdk = new Hubspot({ httpClient: httpClient });
500488
```
501489
<!-- End Custom HTTP Client [http-client] -->
502490

RELEASES.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,14 @@ Based on:
88
### Generated
99
- [typescript v0.1.0] .
1010
### Releases
11-
- [NPM v0.1.0] https://www.npmjs.com/package/mcp-hubspot/v/0.1.0 - .
11+
- [NPM v0.1.0] https://www.npmjs.com/package/mcp-hubspot/v/0.1.0 - .
12+
13+
## 2025-10-06 00:17:07
14+
### Changes
15+
Based on:
16+
- OpenAPI Doc
17+
- Speakeasy CLI 1.634.2 (2.721.3) https://github.com/speakeasy-api/speakeasy
18+
### Generated
19+
- [typescript v0.2.0] .
20+
### Releases
21+
- [NPM v0.2.0] https://www.npmjs.com/package/mcp-hubspot/v/0.2.0 - .

USAGE.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ const hubspot = new Hubspot({
88

99
async function run() {
1010
const result = await hubspot.basic.getProperties({
11-
objectType: "deals",
11+
objectType: "contacts",
1212
});
1313

14-
// Handle the result
1514
console.log(result);
1615
}
1716

docs/models/components/associationcategory.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
```typescript
66
import { AssociationCategory } from "mcp-hubspot/models/components";
77

8-
let value: AssociationCategory = "USER_DEFINED";
8+
let value: AssociationCategory = "HUBSPOT_DEFINED";
99
```
1010

1111
## Values

0 commit comments

Comments
 (0)