Skip to content

Commit 6cca19d

Browse files
committed
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.582.0
1 parent 2b80b12 commit 6cca19d

Some content is hidden

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

71 files changed

+1549
-740
lines changed

.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
/mcp-server
210
/bin
311
/.eslintcache

.speakeasy/gen.lock

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,33 @@ id: 48344567-ff5d-4d9e-92eb-dfe908f362f2
33
management:
44
docChecksum: 1a2b10b336197dc97b4e05876d814f28
55
docVersion: 1.0.0
6-
speakeasyVersion: 1.533.0
7-
generationVersion: 2.578.0
8-
releaseVersion: 0.2.0
9-
configChecksum: 277f79a4bad56237db4b079381471e19
6+
speakeasyVersion: 1.582.0
7+
generationVersion: 2.657.1
8+
releaseVersion: 0.3.0
9+
configChecksum: b91da7768fbb2f57f5060768e05e54e1
1010
repoURL: https://github.com/VantaInc/vanta-auditor-api-sdk-typescript.git
1111
installationURL: https://github.com/VantaInc/vanta-auditor-api-sdk-typescript
1212
published: true
1313
features:
1414
typescript:
1515
additionalDependencies: 0.1.0
16-
constsAndDefaults: 0.1.11
17-
core: 3.21.6
16+
constsAndDefaults: 0.1.12
17+
core: 3.21.14
1818
defaultEnabledRetries: 0.1.0
1919
devContainers: 2.90.0
2020
enumUnions: 0.1.0
2121
envVarSecurityUsage: 0.1.2
2222
globalSecurity: 2.82.13
2323
globalSecurityCallbacks: 0.1.0
2424
globalSecurityFlattening: 0.1.0
25-
globalServerURLs: 2.82.4
26-
mcpServer: 0.9.1
25+
globalServerURLs: 2.82.5
26+
mcpServer: 0.9.3
2727
nameOverrides: 2.81.2
2828
nullables: 0.1.1
2929
responseFormat: 0.2.3
3030
retries: 2.83.0
31-
sdkHooks: 0.2.0
32-
unions: 2.85.8
31+
sdkHooks: 0.3.0
32+
unions: 2.85.11
3333
generatedFiles:
3434
- .devcontainer/README.md
3535
- .devcontainer/devcontainer.json
@@ -95,6 +95,10 @@ generatedFiles:
9595
- docs/sdks/audits/README.md
9696
- docs/sdks/vanta/README.md
9797
- eslint.config.mjs
98+
- examples/.env.template
99+
- examples/README.md
100+
- examples/auditsList.example.ts
101+
- examples/package.json
98102
- jsr.json
99103
- package.json
100104
- src/core.ts
@@ -186,7 +190,9 @@ generatedFiles:
186190
- src/models/errors/apierror.ts
187191
- src/models/errors/httpclienterrors.ts
188192
- src/models/errors/index.ts
193+
- src/models/errors/responsevalidationerror.ts
189194
- src/models/errors/sdkvalidationerror.ts
195+
- src/models/errors/vantaerror.ts
190196
- src/models/operations/createcommentforauditevidence.ts
191197
- src/models/operations/createcustomcontrol.ts
192198
- src/models/operations/createcustomevidencerequest.ts
@@ -268,7 +274,7 @@ examples:
268274
auditId: "<id>"
269275
auditEvidenceId: "<id>"
270276
requestBody:
271-
application/json: {"text": "<value>", "email": "Alexis74@hotmail.com", "creationDate": "2024-08-13T11:18:40.035Z"}
277+
application/json: {"text": "<value>", "email": "Carmen.Bogan@yahoo.com", "creationDate": "2024-05-28T11:04:29.369Z"}
272278
responses:
273279
"200":
274280
application/json: {"id": "65fc81a3359c8508c9af880f", "auditEvidenceId": "65fc81a3359c8508c9af880f", "text": "Some comment", "creationDate": "2024-03-07T21:25:56Z", "modificationDate": "2024-03-07T21:25:56Z", "deletionDate": "2024-03-07T21:25:56Z", "email": "[email protected]"}
@@ -289,7 +295,7 @@ examples:
289295
path:
290296
auditId: "<id>"
291297
requestBody:
292-
application/json: {"controlIds": ["<value>"], "title": "<value>", "description": "now whoa while", "cadence": "P3M", "reminderWindow": "P0D", "isRestricted": true, "auditorEmail": "<value>"}
298+
application/json: {"controlIds": ["<value 1>", "<value 2>"], "title": "<value>", "description": "pure bludgeon deliberately question although", "cadence": "P1D", "reminderWindow": "P0D", "isRestricted": false, "auditorEmail": "<value>"}
293299
responses:
294300
"200":
295301
application/json: {"id": "65fc81a3359c8508c9af880f", "controlIds": ["1.1.2.a"], "title": "Access Control Policy", "description": "Description for Access Control Policy", "cadence": "P6M", "reminderWindow": "P6M", "isRestricted": true}
@@ -299,16 +305,16 @@ examples:
299305
path:
300306
auditId: "<id>"
301307
requestBody:
302-
application/json: {"externalId": "<id>", "name": "<value>", "description": "even keenly afore mmm yearningly ouch tough yearly intent", "effectiveDate": "2024-07-08T11:52:30.590Z", "category": "THREAT_MANAGEMENT"}
308+
application/json: {"externalId": "<id>", "name": null, "description": "yet plus utter queasily what juvenile wound", "effectiveDate": "2024-11-10T13:58:54.564Z", "category": "CLOUD_SECURITY"}
303309
responses:
304310
"201":
305311
application/json: {"id": "a2f7e1b9d0c3f4e5a6c7b8d9", "externalId": "CRY-104", "name": "Data encryption utilized", "description": "Access reviews are performed to ensure that access is appropriate for the user's role and responsibilities.", "source": "Vanta", "domains": ["CRYPTOGRAPHIC_PROTECTIONS"], "owner": {"id": "65e1efde08e8478f143a8ff9", "displayName": "Example Owner", "emailAddress": "[email protected]"}, "role": "CONTROLLER", "customFields": [{"label": "Additional context", "value": "This control is critical for GDPR compliance"}]}
306312
CreateAuditor:
307313
Example 1:
308314
requestBody:
309-
application/json: {"email": "Loyal79@yahoo.com", "givenName": "<value>", "familyName": "<value>"}
315+
application/json: {"email": "Genesis_Kunze87@yahoo.com", "givenName": "<value>", "familyName": "<value>"}
310316
responses:
311317
"200":
312318
application/json: {"id": "65fc81a3359c8508c9af880f", "organizationId": "8c9af880f1a335965fc850c8", "email": "[email protected]", "givenName": "Sam", "familyName": "Auditor"}
313-
examplesVersion: 1.0.1
319+
examplesVersion: 1.0.2
314320
generatedTests: {}

.speakeasy/gen.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,33 @@ 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: false
18+
sharedErrorComponentsApr2025: false
1719
auth:
1820
oAuth2ClientCredentialsEnabled: true
1921
oAuth2PasswordEnabled: true
22+
tests:
23+
generateTests: true
24+
generateNewTests: false
25+
skipResponseBodyAssertions: false
2026
typescript:
21-
version: 0.2.0
27+
version: 0.3.0
2228
additionalDependencies:
2329
dependencies: {}
2430
devDependencies: {}
2531
peerDependencies: {}
2632
additionalPackageJSON: {}
2733
author: Speakeasy
34+
baseErrorName: VantaError
2835
clientServerStatusCodesAsErrors: true
36+
constFieldsAlwaysOptional: true
2937
defaultErrorName: APIError
3038
enableCustomCodeRegions: false
3139
enableMCPServer: true
@@ -34,6 +42,7 @@ typescript:
3442
envVarPrefix: VANTA
3543
flattenGlobalSecurity: true
3644
flatteningOrder: parameters-first
45+
generateExamples: true
3746
imports:
3847
option: openapi
3948
paths:

.speakeasy/workflow.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
speakeasyVersion: 1.533.0
1+
speakeasyVersion: 1.582.0
22
sources:
33
Conduct an audit:
44
sourceNamespace: conduct-an-audit
5-
sourceRevisionDigest: sha256:ec0e5f7188da957554a2175874ee7a7c671251cddb84a0911cf73f1e6b4ae612
6-
sourceBlobDigest: sha256:bbe79169dea0b06f442a5b981fda5eb09f04b5ea369ef9832e48e6feabdccc08
5+
sourceRevisionDigest: sha256:9a8a8f03e9116b497a915b76d6b9f6842d3b77257d71cec8155d8921ed3caae7
6+
sourceBlobDigest: sha256:68a76dacb1a40336ba8779c5d21d1ff8e3292cfdac49fdf1748572b8131f6da4
77
tags:
88
- latest
9-
- speakeasy-sdk-regen-1744653558
9+
- speakeasy-sdk-regen-1752107287
1010
- 1.0.0
1111
targets:
1212
vanta:
1313
source: Conduct an audit
1414
sourceNamespace: conduct-an-audit
15-
sourceRevisionDigest: sha256:ec0e5f7188da957554a2175874ee7a7c671251cddb84a0911cf73f1e6b4ae612
16-
sourceBlobDigest: sha256:bbe79169dea0b06f442a5b981fda5eb09f04b5ea369ef9832e48e6feabdccc08
15+
sourceRevisionDigest: sha256:9a8a8f03e9116b497a915b76d6b9f6842d3b77257d71cec8155d8921ed3caae7
16+
sourceBlobDigest: sha256:68a76dacb1a40336ba8779c5d21d1ff8e3292cfdac49fdf1748572b8131f6da4
1717
codeSamplesNamespace: conduct-an-audit-typescript-code-samples
18-
codeSamplesRevisionDigest: sha256:6e53c3e5e71c376fb2f45ab25697dad7892b83b774caaaabffbc63d3df63c95e
18+
codeSamplesRevisionDigest: sha256:1028a2b73e29549c2113fff7fe68f86b54fa1c1ca9dd1d2d637780a5aefef03b
1919
workflow:
2020
workflowVersion: 1.0.0
2121
speakeasyVersion: latest

FUNCTIONS.md

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

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

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

5841
run();

README.md

Lines changed: 36 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ const vanta = new Vanta({
177177
async function run() {
178178
const result = await vanta.audits.list({});
179179

180-
// Handle the result
181180
console.log(result);
182181
}
183182

@@ -208,7 +207,6 @@ const vanta = new Vanta({
208207
async function run() {
209208
const result = await vanta.audits.list({});
210209

211-
// Handle the result
212210
console.log(result);
213211
}
214212

@@ -299,7 +297,6 @@ async function run() {
299297
},
300298
});
301299

302-
// Handle the result
303300
console.log(result);
304301
}
305302

@@ -328,7 +325,6 @@ const vanta = new Vanta({
328325
async function run() {
329326
const result = await vanta.audits.list({});
330327

331-
// Handle the result
332328
console.log(result);
333329
}
334330

@@ -340,49 +336,36 @@ run();
340336
<!-- Start Error Handling [errors] -->
341337
## Error Handling
342338

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

345-
| Error Type | Status Code | Content Type |
346-
| --------------- | ----------- | ------------ |
347-
| errors.APIError | 4XX, 5XX | \*/\* |
341+
| Property | Type | Description |
342+
| ------------------- | ---------- | ------------------------------------------------------ |
343+
| `error.message` | `string` | Error message |
344+
| `error.statusCode` | `number` | HTTP response status code eg `404` |
345+
| `error.headers` | `Headers` | HTTP response headers |
346+
| `error.body` | `string` | HTTP body. Can be empty string if no body is returned. |
347+
| `error.rawResponse` | `Response` | Raw HTTP response |
348348

349+
### Example
349350
```typescript
350351
import { Vanta } from "vanta-auditor-api-sdk";
351-
import { SDKValidationError } from "vanta-auditor-api-sdk/models/errors";
352+
import * as errors from "vanta-auditor-api-sdk/models/errors";
352353

353354
const vanta = new Vanta({
354355
bearerAuth: process.env["VANTA_BEARER_AUTH"] ?? "",
355356
});
356357

357358
async function run() {
358-
let result;
359359
try {
360-
result = await vanta.audits.list({});
360+
const result = await vanta.audits.list({});
361361

362-
// Handle the result
363362
console.log(result);
364-
} catch (err) {
365-
switch (true) {
366-
// The server response does not match the expected SDK schema
367-
case (err instanceof SDKValidationError):
368-
{
369-
// Pretty-print will provide a human-readable multi-line error message
370-
console.error(err.pretty());
371-
// Raw value may also be inspected
372-
console.error(err.rawValue);
373-
return;
374-
}
375-
apierror.js;
376-
// Server returned an error status code or an unknown content type
377-
case (err instanceof APIError): {
378-
console.error(err.statusCode);
379-
console.error(err.rawResponse.body);
380-
return;
381-
}
382-
default: {
383-
// Other errors such as network errors, see HTTPClientErrors for more details
384-
throw err;
385-
}
363+
} catch (error) {
364+
if (error instanceof errors.VantaError) {
365+
console.log(error.message);
366+
console.log(error.statusCode);
367+
console.log(error.body);
368+
console.log(error.headers);
386369
}
387370
}
388371
}
@@ -391,17 +374,26 @@ run();
391374

392375
```
393376

394-
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.
377+
### Error Classes
378+
**Primary error:**
379+
* [`VantaError`](./src/models/errors/vantaerror.ts): The base class for HTTP error responses.
380+
381+
<details><summary>Less common errors (6)</summary>
382+
383+
<br />
395384

396-
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:
385+
**Network errors:**
386+
* [`ConnectionError`](./src/models/errors/httpclienterrors.ts): HTTP client was unable to make a request to a server.
387+
* [`RequestTimeoutError`](./src/models/errors/httpclienterrors.ts): HTTP request timed out due to an AbortSignal signal.
388+
* [`RequestAbortedError`](./src/models/errors/httpclienterrors.ts): HTTP request was aborted by the client.
389+
* [`InvalidRequestError`](./src/models/errors/httpclienterrors.ts): Any input used to create a request is invalid.
390+
* [`UnexpectedClientError`](./src/models/errors/httpclienterrors.ts): Unrecognised or unexpected error.
397391

398-
| HTTP Client Error | Description |
399-
| ---------------------------------------------------- | ---------------------------------------------------- |
400-
| RequestAbortedError | HTTP request was aborted by the client |
401-
| RequestTimeoutError | HTTP request timed out due to an AbortSignal signal |
402-
| ConnectionError | HTTP client was unable to make a request to a server |
403-
| InvalidRequestError | Any input used to create a request is invalid |
404-
| UnexpectedClientError | Unrecognised or unexpected error |
392+
393+
**Inherit from [`VantaError`](./src/models/errors/vantaerror.ts)**:
394+
* [`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.
395+
396+
</details>
405397
<!-- End Error Handling [errors] -->
406398

407399
<!-- Start Server Selection [server] -->
@@ -430,7 +422,6 @@ const vanta = new Vanta({
430422
async function run() {
431423
const result = await vanta.audits.list({});
432424

433-
// Handle the result
434425
console.log(result);
435426
}
436427

@@ -445,14 +436,13 @@ The default server can also be overridden globally by passing a URL to the `serv
445436
import { Vanta } from "vanta-auditor-api-sdk";
446437

447438
const vanta = new Vanta({
448-
serverURL: "https://api.vanta.com/v1",
439+
serverURL: "https://api.aus.vanta.com/v1",
449440
bearerAuth: process.env["VANTA_BEARER_AUTH"] ?? "",
450441
});
451442

452443
async function run() {
453444
const result = await vanta.audits.list({});
454445

455-
// Handle the result
456446
console.log(result);
457447
}
458448

0 commit comments

Comments
 (0)