Skip to content

Commit 64f4ec1

Browse files
Merge pull request #16 from speakeasy-api/speakeasy-sdk-regen-1746577270
chore: 🐝 Update SDK - Generate 5.0.0-rc.4
1 parent 565a177 commit 64f4ec1

File tree

164 files changed

+3011
-2743
lines changed

Some content is hidden

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

164 files changed

+3011
-2743
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
.DS_Store
2+
**/.speakeasy/temp/
3+
**/.speakeasy/logs/
4+
.DS_Store
15
/react-query
26
/mcp-server
37
/bin

.speakeasy/gen.lock

Lines changed: 182 additions & 185 deletions
Large diffs are not rendered by default.

.speakeasy/workflow.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
speakeasyVersion: 1.535.1
1+
speakeasyVersion: 1.561.0
22
sources:
33
my-source:
44
sourceNamespace: my-source
5-
sourceRevisionDigest: sha256:d129bc81c00731f2a8ccd071c1c4428724a8408c8d485647c5420c7c1137b99f
6-
sourceBlobDigest: sha256:f2d1e073b00081bfb7918b31d08cb00e7cd6c8563bf488872251583b98c8be5c
5+
sourceRevisionDigest: sha256:2e5dc78239617b9501f2028df534aa4601c61396c89a582390d75a797fc228cc
6+
sourceBlobDigest: sha256:0442ef7698d8979dd825b3eab0ab868ac86580f4cffcd3e0dff7afdd6191e6d9
77
tags:
88
- latest
9-
- speakeasy-sdk-regen-1744843770
9+
- speakeasy-sdk-regen-1746577270
1010
- 0.4.0
1111
targets:
1212
speakeasy-client-sdk-typescript:
1313
source: my-source
1414
sourceNamespace: my-source
15-
sourceRevisionDigest: sha256:d129bc81c00731f2a8ccd071c1c4428724a8408c8d485647c5420c7c1137b99f
16-
sourceBlobDigest: sha256:f2d1e073b00081bfb7918b31d08cb00e7cd6c8563bf488872251583b98c8be5c
15+
sourceRevisionDigest: sha256:2e5dc78239617b9501f2028df534aa4601c61396c89a582390d75a797fc228cc
16+
sourceBlobDigest: sha256:0442ef7698d8979dd825b3eab0ab868ac86580f4cffcd3e0dff7afdd6191e6d9
1717
codeSamplesNamespace: my-source-typescript-code-samples
18-
codeSamplesRevisionDigest: sha256:922b531a8f6d9c761b42f7c0c7b551a0545c0cf435b48cabdcc1382e9ca5a530
18+
codeSamplesRevisionDigest: sha256:65717f579dccb319b073cb22e553e23bd3419cf420967387c00d148c041f5dc1
1919
workflow:
2020
workflowVersion: 1.0.0
2121
speakeasyVersion: latest

FUNCTIONS.md

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ specific category of applications.
2121
```typescript
2222
import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js";
2323
import { artifactsCreateRemoteSource } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/artifactsCreateRemoteSource.js";
24-
import { SDKValidationError } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/errors/sdkvalidationerror.js";
2524

2625
// Use `SpeakeasyCore` for best tree-shaking performance.
2726
// You can create one instance of it to use across an application.
@@ -33,27 +32,12 @@ const speakeasy = new SpeakeasyCore({
3332

3433
async function run() {
3534
const res = await artifactsCreateRemoteSource(speakeasy);
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+
38+
} else {
39+
console.log("artifactsCreateRemoteSource failed:", res.error);
5140
}
52-
53-
54-
const { value: result } = res;
55-
56-
5741
}
5842

5943
run();

README.md

Lines changed: 51 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -334,21 +334,21 @@ run();
334334
<!-- Start Error Handling [errors] -->
335335
## Error Handling
336336

337-
Some methods specify known errors which can be thrown. All the known errors are enumerated in the `sdk/models/errors/errors.ts` module. The known errors for a method are documented under the *Errors* tables in SDK docs. For example, the `createRemoteSource` method may throw the following errors:
337+
[`SpeakeasyError`](./src/sdk/models/errors/speakeasyerror.ts) is the base class for all HTTP error responses. It has the following properties:
338338

339-
| Error Type | Status Code | Content Type |
340-
| --------------- | ----------- | ---------------- |
341-
| errors.ErrorT | 4XX | application/json |
342-
| errors.SDKError | 5XX | \*/\* |
343-
344-
If the method throws an error and it is not captured by the known errors, it will default to throwing a `SDKError`.
339+
| Property | Type | Description |
340+
| ------------------- | ---------- | --------------------------------------------------------------------------------------- |
341+
| `error.message` | `string` | Error message |
342+
| `error.statusCode` | `number` | HTTP response status code eg `404` |
343+
| `error.headers` | `Headers` | HTTP response headers |
344+
| `error.body` | `string` | HTTP body. Can be empty string if no body is returned. |
345+
| `error.rawResponse` | `Response` | Raw HTTP response |
346+
| `error.data$` | | Optional. Some errors may contain structured data. [See Error Classes](#error-classes). |
345347

348+
### Example
346349
```typescript
347350
import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript";
348-
import {
349-
ErrorT,
350-
SDKValidationError,
351-
} from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/errors";
351+
import * as errors from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/errors";
352352

353353
const speakeasy = new Speakeasy({
354354
security: {
@@ -359,24 +359,18 @@ const speakeasy = new Speakeasy({
359359
async function run() {
360360
try {
361361
await speakeasy.artifacts.createRemoteSource();
362-
} catch (err) {
363-
switch (true) {
364-
// The server response does not match the expected SDK schema
365-
case (err instanceof SDKValidationError): {
366-
// Pretty-print will provide a human-readable multi-line error message
367-
console.error(err.pretty());
368-
// Raw value may also be inspected
369-
console.error(err.rawValue);
370-
return;
371-
}
372-
case (err instanceof ErrorT): {
373-
// Handle err.data$: ErrorTData
374-
console.error(err);
375-
return;
376-
}
377-
default: {
378-
// Other errors such as network errors, see HTTPClientErrors for more details
379-
throw err;
362+
} catch (error) {
363+
// The base class for HTTP error responses
364+
if (error instanceof errors.SpeakeasyError) {
365+
console.log(error.message);
366+
console.log(error.statusCode);
367+
console.log(error.body);
368+
console.log(error.headers);
369+
370+
// Depending on the method different errors may be thrown
371+
if (error instanceof errors.ErrorT) {
372+
console.log(error.data$.message); // string
373+
console.log(error.data$.statusCode); // number
380374
}
381375
}
382376
}
@@ -386,17 +380,29 @@ run();
386380

387381
```
388382

389-
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.
383+
### Error Classes
384+
**Primary errors:**
385+
* [`SpeakeasyError`](./src/sdk/models/errors/speakeasyerror.ts): The base class for HTTP error responses.
386+
* [`ErrorT`](docs/sdk/models/errors/errort.md): The `Status` type defines a logical error model. *
387+
388+
<details><summary>Less common errors (6)</summary>
389+
390+
<br />
390391

391-
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 `sdk/models/errors/httpclienterrors.ts` module:
392+
**Network errors:**
393+
* [`ConnectionError`](./src/sdk/models/errors/httpclienterrors.ts): HTTP client was unable to make a request to a server.
394+
* [`RequestTimeoutError`](./src/sdk/models/errors/httpclienterrors.ts): HTTP request timed out due to an AbortSignal signal.
395+
* [`RequestAbortedError`](./src/sdk/models/errors/httpclienterrors.ts): HTTP request was aborted by the client.
396+
* [`InvalidRequestError`](./src/sdk/models/errors/httpclienterrors.ts): Any input used to create a request is invalid.
397+
* [`UnexpectedClientError`](./src/sdk/models/errors/httpclienterrors.ts): Unrecognised or unexpected error.
392398

393-
| HTTP Client Error | Description |
394-
| ---------------------------------------------------- | ---------------------------------------------------- |
395-
| RequestAbortedError | HTTP request was aborted by the client |
396-
| RequestTimeoutError | HTTP request timed out due to an AbortSignal signal |
397-
| ConnectionError | HTTP client was unable to make a request to a server |
398-
| InvalidRequestError | Any input used to create a request is invalid |
399-
| UnexpectedClientError | Unrecognised or unexpected error |
399+
400+
**Inherit from [`SpeakeasyError`](./src/sdk/models/errors/speakeasyerror.ts)**:
401+
* [`ResponseValidationError`](./src/sdk/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.
402+
403+
</details>
404+
405+
\* Check [the method documentation](#available-resources-and-operations) to see if the error is applicable.
400406
<!-- End Error Handling [errors] -->
401407

402408

@@ -408,9 +414,9 @@ In some rare cases, the SDK can fail to get a response from the server or even m
408414

409415
You can override the default server globally by passing a server name to the `server: keyof typeof ServerList` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the names associated with the available servers:
410416

411-
| Name | Server | Description |
412-
| ------ | ----------------------------------- | ----------- |
413-
| `prod` | `https://api.prod.speakeasyapi.dev` | |
417+
| Name | Server | Description |
418+
| ------ | -------------------------------- | ----------- |
419+
| `prod` | `https://api.prod.speakeasy.com` | |
414420

415421
#### Example
416422

@@ -439,7 +445,7 @@ The default server can also be overridden globally by passing a URL to the `serv
439445
import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript";
440446

441447
const speakeasy = new Speakeasy({
442-
serverURL: "https://api.prod.speakeasyapi.dev",
448+
serverURL: "https://api.prod.speakeasy.com",
443449
security: {
444450
apiKey: "<YOUR_API_KEY_HERE>",
445451
},
@@ -826,14 +832,15 @@ The following global parameter is available.
826832
```typescript
827833
import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript";
828834

829-
const speakeasy = new Speakeasy();
835+
const speakeasy = new Speakeasy({
836+
workspaceId: "<id>",
837+
});
830838

831839
async function run() {
832840
const result = await speakeasy.auth.getAccessToken({
833841
workspaceId: "<id>",
834842
});
835843

836-
// Handle the result
837844
console.log(result);
838845
}
839846

@@ -872,7 +879,6 @@ async function run() {
872879
schemaFile: await openAsBlob("example.file"),
873880
});
874881

875-
// Handle the result
876882
console.log(result);
877883
}
878884

RELEASES.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1696,4 +1696,14 @@ Based on:
16961696
### Generated
16971697
- [typescript v5.0.0-rc.3] .
16981698
### Releases
1699-
- [NPM v5.0.0-rc.3] https://www.npmjs.com/package/@speakeasy-api/speakeasy-client-sdk-typescript/v/5.0.0-rc.3 - .
1699+
- [NPM v5.0.0-rc.3] https://www.npmjs.com/package/@speakeasy-api/speakeasy-client-sdk-typescript/v/5.0.0-rc.3 - .
1700+
1701+
## 2025-06-13 00:21:42
1702+
### Changes
1703+
Based on:
1704+
- OpenAPI Doc
1705+
- Speakeasy CLI 1.561.0 (2.628.0) https://github.com/speakeasy-api/speakeasy
1706+
### Generated
1707+
- [typescript v5.0.0-rc.4] .
1708+
### Releases
1709+
- [NPM v5.0.0-rc.4] https://www.npmjs.com/package/@speakeasy-api/speakeasy-client-sdk-typescript/v/5.0.0-rc.4 - .

docs/sdk/models/operations/createworkspacetokenrequest.md

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,7 @@
55
```typescript
66
import { CreateWorkspaceTokenRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations";
77

8-
let value: CreateWorkspaceTokenRequest = {
9-
workspaceId: "<id>",
10-
workspaceToken: {
11-
alg: "<value>",
12-
createdAt: new Date("2023-10-18T04:12:26.286Z"),
13-
id: "<id>",
14-
key: "<key>",
15-
name: "<value>",
16-
workspaceId: "<id>",
17-
},
18-
};
8+
let value: CreateWorkspaceTokenRequest = {};
199
```
2010

2111
## Fields

docs/sdk/models/operations/deleteworkspacetokenrequest.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import { DeleteWorkspaceTokenRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations";
77

88
let value: DeleteWorkspaceTokenRequest = {
9-
workspaceId: "<id>",
109
tokenID: "<id>",
1110
};
1211
```

docs/sdk/models/operations/getcodesamplepreviewasyncresponse.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,7 @@
77

88
```typescript
99
const value: shared.UsageSnippets = {
10-
snippets: [
11-
{
12-
code: "<value>",
13-
language: "<value>",
14-
method: "<value>",
15-
operationId: "<id>",
16-
path: "/home/user/dir",
17-
},
18-
],
10+
snippets: [],
1911
};
2012
```
2113

docs/sdk/models/operations/getworkspaceeventsbytargetrequest.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import { GetWorkspaceEventsByTargetRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations";
77

88
let value: GetWorkspaceEventsByTargetRequest = {
9-
workspaceId: "<id>",
109
targetId: "<id>",
1110
};
1211
```

docs/sdk/models/operations/getworkspacefeatureflagsrequest.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
```typescript
66
import { GetWorkspaceFeatureFlagsRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations";
77

8-
let value: GetWorkspaceFeatureFlagsRequest = {
9-
workspaceId: "<id>",
10-
};
8+
let value: GetWorkspaceFeatureFlagsRequest = {};
119
```
1210

1311
## Fields

docs/sdk/models/operations/getworkspacerequest.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
```typescript
66
import { GetWorkspaceRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations";
77

8-
let value: GetWorkspaceRequest = {
9-
workspaceId: "<id>",
10-
};
8+
let value: GetWorkspaceRequest = {};
119
```
1210

1311
## Fields

docs/sdk/models/operations/getworkspacesettingsrequest.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
```typescript
66
import { GetWorkspaceSettingsRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations";
77

8-
let value: GetWorkspaceSettingsRequest = {
9-
workspaceId: "<id>",
10-
};
8+
let value: GetWorkspaceSettingsRequest = {};
119
```
1210

1311
## Fields

docs/sdk/models/operations/getworkspacetargetsdeprecatedrequest.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
```typescript
66
import { GetWorkspaceTargetsDeprecatedRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations";
77

8-
let value: GetWorkspaceTargetsDeprecatedRequest = {
9-
workspaceId: "<id>",
10-
};
8+
let value: GetWorkspaceTargetsDeprecatedRequest = {};
119
```
1210

1311
## Fields

docs/sdk/models/operations/getworkspaceteamrequest.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
```typescript
66
import { GetWorkspaceTeamRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations";
77

8-
let value: GetWorkspaceTeamRequest = {
9-
workspaceId: "<id>",
10-
};
8+
let value: GetWorkspaceTeamRequest = {};
119
```
1210

1311
## Fields

docs/sdk/models/operations/getworkspacetokensrequest.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
```typescript
66
import { GetWorkspaceTokensRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations";
77

8-
let value: GetWorkspaceTokensRequest = {
9-
workspaceId: "<id>",
10-
};
8+
let value: GetWorkspaceTokensRequest = {};
119
```
1210

1311
## Fields

docs/sdk/models/operations/grantuseraccesstoworkspacerequest.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import { GrantUserAccessToWorkspaceRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations";
77

88
let value: GrantUserAccessToWorkspaceRequest = {
9-
workspaceId: "<id>",
109
email: "Sebastian.Paucek6@yahoo.com",
1110
};
1211
```

0 commit comments

Comments
 (0)