vanta-auditor-api-sdk 0.1.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.devcontainer/README.md +5 -0
- package/.devcontainer/devcontainer.json +45 -0
- package/FUNCTIONS.md +5 -22
- package/README.md +157 -58
- package/bin/mcp-server.js +39200 -0
- package/bin/mcp-server.js.map +322 -0
- package/docs/sdks/auditors/README.md +7 -11
- package/docs/sdks/audits/README.md +71 -102
- package/examples/README.md +31 -0
- package/examples/auditsList.example.ts +26 -0
- package/examples/package-lock.json +626 -0
- package/examples/package.json +18 -0
- package/funcs/auditorsCreate.d.ts +4 -2
- package/funcs/auditorsCreate.d.ts.map +1 -1
- package/funcs/auditorsCreate.js +17 -9
- package/funcs/auditorsCreate.js.map +1 -1
- package/funcs/auditsCreateCommentForEvidence.d.ts +4 -2
- package/funcs/auditsCreateCommentForEvidence.d.ts.map +1 -1
- package/funcs/auditsCreateCommentForEvidence.js +17 -9
- package/funcs/auditsCreateCommentForEvidence.js.map +1 -1
- package/funcs/auditsCreateCustomControl.d.ts +4 -2
- package/funcs/auditsCreateCustomControl.d.ts.map +1 -1
- package/funcs/auditsCreateCustomControl.js +17 -9
- package/funcs/auditsCreateCustomControl.js.map +1 -1
- package/funcs/auditsCreateCustomEvidenceRequest.d.ts +4 -2
- package/funcs/auditsCreateCustomEvidenceRequest.d.ts.map +1 -1
- package/funcs/auditsCreateCustomEvidenceRequest.js +17 -9
- package/funcs/auditsCreateCustomEvidenceRequest.js.map +1 -1
- package/funcs/auditsGetEvidenceUrls.d.ts +6 -3
- package/funcs/auditsGetEvidenceUrls.d.ts.map +1 -1
- package/funcs/auditsGetEvidenceUrls.js +19 -10
- package/funcs/auditsGetEvidenceUrls.js.map +1 -1
- package/funcs/auditsList.d.ts +4 -2
- package/funcs/auditsList.d.ts.map +1 -1
- package/funcs/auditsList.js +18 -9
- package/funcs/auditsList.js.map +1 -1
- package/funcs/auditsListComments.d.ts +4 -2
- package/funcs/auditsListComments.d.ts.map +1 -1
- package/funcs/auditsListComments.js +17 -9
- package/funcs/auditsListComments.js.map +1 -1
- package/funcs/auditsListControls.d.ts +4 -2
- package/funcs/auditsListControls.d.ts.map +1 -1
- package/funcs/auditsListControls.js +17 -9
- package/funcs/auditsListControls.js.map +1 -1
- package/funcs/auditsListEvidence.d.ts +4 -2
- package/funcs/auditsListEvidence.d.ts.map +1 -1
- package/funcs/auditsListEvidence.js +17 -9
- package/funcs/auditsListEvidence.js.map +1 -1
- package/funcs/auditsUpdateEvidence.d.ts +4 -2
- package/funcs/auditsUpdateEvidence.d.ts.map +1 -1
- package/funcs/auditsUpdateEvidence.js +17 -9
- package/funcs/auditsUpdateEvidence.js.map +1 -1
- package/hooks/types.d.ts +4 -1
- package/hooks/types.d.ts.map +1 -1
- package/index.d.ts +2 -0
- package/index.d.ts.map +1 -1
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/jsr.json +27 -0
- package/lib/config.d.ts +11 -7
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js +14 -3
- package/lib/config.js.map +1 -1
- package/lib/encodings.d.ts +10 -9
- package/lib/encodings.d.ts.map +1 -1
- package/lib/encodings.js +73 -47
- package/lib/encodings.js.map +1 -1
- package/lib/files.d.ts +5 -0
- package/lib/files.d.ts.map +1 -1
- package/lib/files.js +41 -0
- package/lib/files.js.map +1 -1
- package/lib/matchers.d.ts +6 -11
- package/lib/matchers.d.ts.map +1 -1
- package/lib/matchers.js +45 -31
- package/lib/matchers.js.map +1 -1
- package/lib/primitives.d.ts +4 -0
- package/lib/primitives.d.ts.map +1 -1
- package/lib/primitives.js +17 -0
- package/lib/primitives.js.map +1 -1
- package/lib/retries.js +0 -1
- package/lib/retries.js.map +1 -1
- package/lib/schemas.d.ts +1 -1
- package/lib/schemas.d.ts.map +1 -1
- package/lib/schemas.js +4 -1
- package/lib/schemas.js.map +1 -1
- package/lib/sdks.d.ts +5 -2
- package/lib/sdks.d.ts.map +1 -1
- package/lib/sdks.js +21 -24
- package/lib/sdks.js.map +1 -1
- package/lib/security.d.ts +6 -5
- package/lib/security.d.ts.map +1 -1
- package/lib/security.js +6 -1
- package/lib/security.js.map +1 -1
- package/mcp-server/build.d.mts.map +1 -0
- package/mcp-server/build.mjs +14 -0
- package/mcp-server/build.mjs.map +1 -0
- package/mcp-server/cli/start/command.d.ts +2 -0
- package/mcp-server/cli/start/command.d.ts.map +1 -0
- package/mcp-server/cli/start/command.js +126 -0
- package/mcp-server/cli/start/command.js.map +1 -0
- package/mcp-server/cli/start/impl.d.ts +16 -0
- package/mcp-server/cli/start/impl.d.ts.map +1 -0
- package/mcp-server/cli/start/impl.js +102 -0
- package/mcp-server/cli/start/impl.js.map +1 -0
- package/mcp-server/cli.d.ts +6 -0
- package/mcp-server/cli.d.ts.map +1 -0
- package/mcp-server/cli.js +10 -0
- package/mcp-server/cli.js.map +1 -0
- package/mcp-server/console-logger.d.ts +7 -0
- package/mcp-server/console-logger.d.ts.map +1 -0
- package/mcp-server/console-logger.js +59 -0
- package/mcp-server/console-logger.js.map +1 -0
- package/mcp-server/extensions.d.ts +11 -0
- package/mcp-server/extensions.d.ts.map +1 -0
- package/mcp-server/extensions.js +6 -0
- package/mcp-server/extensions.js.map +1 -0
- package/mcp-server/mcp-server.d.ts +2 -0
- package/mcp-server/mcp-server.d.ts.map +1 -0
- package/mcp-server/mcp-server.js +29 -0
- package/mcp-server/mcp-server.js.map +1 -0
- package/mcp-server/prompts.d.ts +26 -0
- package/mcp-server/prompts.d.ts.map +1 -0
- package/mcp-server/prompts.js +51 -0
- package/mcp-server/prompts.js.map +1 -0
- package/mcp-server/resources.d.ts +32 -0
- package/mcp-server/resources.d.ts.map +1 -0
- package/mcp-server/resources.js +87 -0
- package/mcp-server/resources.js.map +1 -0
- package/mcp-server/scopes.d.ts +3 -0
- package/mcp-server/scopes.d.ts.map +1 -0
- package/mcp-server/scopes.js +8 -0
- package/mcp-server/scopes.js.map +1 -0
- package/mcp-server/server.d.ts +13 -0
- package/mcp-server/server.d.ts.map +1 -0
- package/mcp-server/server.js +52 -0
- package/mcp-server/server.js.map +1 -0
- package/mcp-server/shared.d.ts +7 -0
- package/mcp-server/shared.d.ts.map +1 -0
- package/mcp-server/shared.js +98 -0
- package/mcp-server/shared.js.map +1 -0
- package/mcp-server/tools/auditorsCreate.d.ts +8 -0
- package/mcp-server/tools/auditorsCreate.d.ts.map +1 -0
- package/mcp-server/tools/auditorsCreate.js +64 -0
- package/mcp-server/tools/auditorsCreate.js.map +1 -0
- package/mcp-server/tools/auditsCreateCommentForEvidence.d.ts +8 -0
- package/mcp-server/tools/auditsCreateCommentForEvidence.d.ts.map +1 -0
- package/mcp-server/tools/auditsCreateCommentForEvidence.js +64 -0
- package/mcp-server/tools/auditsCreateCommentForEvidence.js.map +1 -0
- package/mcp-server/tools/auditsCreateCustomControl.d.ts +8 -0
- package/mcp-server/tools/auditsCreateCustomControl.d.ts.map +1 -0
- package/mcp-server/tools/auditsCreateCustomControl.js +64 -0
- package/mcp-server/tools/auditsCreateCustomControl.js.map +1 -0
- package/mcp-server/tools/auditsCreateCustomEvidenceRequest.d.ts +8 -0
- package/mcp-server/tools/auditsCreateCustomEvidenceRequest.d.ts.map +1 -0
- package/mcp-server/tools/auditsCreateCustomEvidenceRequest.js +64 -0
- package/mcp-server/tools/auditsCreateCustomEvidenceRequest.js.map +1 -0
- package/mcp-server/tools/auditsGetEvidenceUrls.d.ts +8 -0
- package/mcp-server/tools/auditsGetEvidenceUrls.d.ts.map +1 -0
- package/mcp-server/tools/auditsGetEvidenceUrls.js +65 -0
- package/mcp-server/tools/auditsGetEvidenceUrls.js.map +1 -0
- package/mcp-server/tools/auditsList.d.ts +8 -0
- package/mcp-server/tools/auditsList.d.ts.map +1 -0
- package/mcp-server/tools/auditsList.js +64 -0
- package/mcp-server/tools/auditsList.js.map +1 -0
- package/mcp-server/tools/auditsListComments.d.ts +8 -0
- package/mcp-server/tools/auditsListComments.d.ts.map +1 -0
- package/mcp-server/tools/auditsListComments.js +64 -0
- package/mcp-server/tools/auditsListComments.js.map +1 -0
- package/mcp-server/tools/auditsListControls.d.ts +8 -0
- package/mcp-server/tools/auditsListControls.d.ts.map +1 -0
- package/mcp-server/tools/auditsListControls.js +64 -0
- package/mcp-server/tools/auditsListControls.js.map +1 -0
- package/mcp-server/tools/auditsListEvidence.d.ts +8 -0
- package/mcp-server/tools/auditsListEvidence.d.ts.map +1 -0
- package/mcp-server/tools/auditsListEvidence.js +64 -0
- package/mcp-server/tools/auditsListEvidence.js.map +1 -0
- package/mcp-server/tools/auditsUpdateEvidence.d.ts +8 -0
- package/mcp-server/tools/auditsUpdateEvidence.d.ts.map +1 -0
- package/mcp-server/tools/auditsUpdateEvidence.js +64 -0
- package/mcp-server/tools/auditsUpdateEvidence.js.map +1 -0
- package/mcp-server/tools.d.ts +25 -0
- package/mcp-server/tools.d.ts.map +1 -0
- package/mcp-server/tools.js +82 -0
- package/mcp-server/tools.js.map +1 -0
- package/models/components/audit.d.ts +5 -2
- package/models/components/audit.d.ts.map +1 -1
- package/models/components/audit.js +5 -2
- package/models/components/audit.js.map +1 -1
- package/models/components/auditfocus.d.ts +28 -0
- package/models/components/auditfocus.d.ts.map +1 -0
- package/models/components/auditfocus.js +61 -0
- package/models/components/auditfocus.js.map +1 -0
- package/models/components/auditorcontrol.d.ts +14 -2
- package/models/components/auditorcontrol.d.ts.map +1 -1
- package/models/components/auditorcontrol.js +8 -2
- package/models/components/auditorcontrol.js.map +1 -1
- package/models/components/auditorenabledstatetransition.d.ts +3 -0
- package/models/components/auditorenabledstatetransition.d.ts.map +1 -1
- package/models/components/auditorenabledstatetransition.js +1 -0
- package/models/components/auditorenabledstatetransition.js.map +1 -1
- package/models/components/comment.d.ts +5 -0
- package/models/components/comment.d.ts.map +1 -1
- package/models/components/comment.js +2 -0
- package/models/components/comment.js.map +1 -1
- package/models/components/control.d.ts +8 -2
- package/models/components/control.d.ts.map +1 -1
- package/models/components/control.js +5 -2
- package/models/components/control.js.map +1 -1
- package/models/components/createcustomevidencerequestinput.d.ts +5 -0
- package/models/components/createcustomevidencerequestinput.d.ts.map +1 -1
- package/models/components/createcustomevidencerequestinput.js +2 -0
- package/models/components/createcustomevidencerequestinput.js.map +1 -1
- package/models/components/customfield.d.ts +52 -0
- package/models/components/customfield.d.ts.map +1 -0
- package/models/components/customfield.js +95 -0
- package/models/components/customfield.js.map +1 -0
- package/models/components/index.d.ts +3 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +3 -0
- package/models/components/index.js.map +1 -1
- package/models/components/section.d.ts +37 -0
- package/models/components/section.d.ts.map +1 -0
- package/models/components/section.js +71 -0
- package/models/components/section.js.map +1 -0
- package/models/errors/apierror.d.ts +8 -6
- package/models/errors/apierror.d.ts.map +1 -1
- package/models/errors/apierror.js +23 -10
- package/models/errors/apierror.js.map +1 -1
- package/models/errors/index.d.ts +1 -0
- package/models/errors/index.d.ts.map +1 -1
- package/models/errors/index.js +1 -0
- package/models/errors/index.js.map +1 -1
- package/models/errors/responsevalidationerror.d.ts +26 -0
- package/models/errors/responsevalidationerror.d.ts.map +1 -0
- package/models/errors/responsevalidationerror.js +66 -0
- package/models/errors/responsevalidationerror.js.map +1 -0
- package/models/errors/sdkvalidationerror.d.ts +1 -0
- package/models/errors/sdkvalidationerror.d.ts.map +1 -1
- package/models/errors/sdkvalidationerror.js +14 -0
- package/models/errors/sdkvalidationerror.js.map +1 -1
- package/models/errors/vantaerror.d.ts +19 -0
- package/models/errors/vantaerror.d.ts.map +1 -0
- package/models/errors/vantaerror.js +20 -0
- package/models/errors/vantaerror.js.map +1 -0
- package/models/operations/listaudits.d.ts +5 -0
- package/models/operations/listaudits.d.ts.map +1 -1
- package/models/operations/listaudits.js +2 -0
- package/models/operations/listaudits.js.map +1 -1
- package/package.json +27 -10
- package/sdk/audits.d.ts +2 -1
- package/sdk/audits.d.ts.map +1 -1
- package/sdk/audits.js +2 -1
- package/sdk/audits.js.map +1 -1
- package/src/funcs/auditorsCreate.ts +58 -22
- package/src/funcs/auditsCreateCommentForEvidence.ts +58 -22
- package/src/funcs/auditsCreateCustomControl.ts +58 -22
- package/src/funcs/auditsCreateCustomEvidenceRequest.ts +58 -22
- package/src/funcs/auditsGetEvidenceUrls.ts +60 -23
- package/src/funcs/auditsList.ts +59 -22
- package/src/funcs/auditsListComments.ts +58 -22
- package/src/funcs/auditsListControls.ts +58 -22
- package/src/funcs/auditsListEvidence.ts +58 -22
- package/src/funcs/auditsUpdateEvidence.ts +58 -22
- package/src/hooks/types.ts +4 -1
- package/src/index.ts +2 -0
- package/src/lib/config.ts +21 -6
- package/src/lib/encodings.ts +95 -61
- package/src/lib/files.ts +43 -1
- package/src/lib/matchers.ts +64 -41
- package/src/lib/primitives.ts +28 -0
- package/src/lib/retries.ts +0 -1
- package/src/lib/schemas.ts +5 -0
- package/src/lib/sdks.ts +35 -25
- package/src/lib/security.ts +12 -5
- package/src/mcp-server/cli/start/command.ts +94 -0
- package/src/mcp-server/cli/start/impl.ts +130 -0
- package/src/mcp-server/cli.ts +13 -0
- package/src/mcp-server/console-logger.ts +71 -0
- package/src/mcp-server/extensions.ts +17 -0
- package/src/mcp-server/mcp-server.ts +26 -0
- package/src/mcp-server/prompts.ts +117 -0
- package/src/mcp-server/resources.ts +172 -0
- package/src/mcp-server/scopes.ts +7 -0
- package/src/mcp-server/server.ts +79 -0
- package/src/mcp-server/shared.ts +75 -0
- package/src/mcp-server/tools/auditorsCreate.ts +37 -0
- package/src/mcp-server/tools/auditsCreateCommentForEvidence.ts +38 -0
- package/src/mcp-server/tools/auditsCreateCustomControl.ts +37 -0
- package/src/mcp-server/tools/auditsCreateCustomEvidenceRequest.ts +39 -0
- package/src/mcp-server/tools/auditsGetEvidenceUrls.ts +38 -0
- package/src/mcp-server/tools/auditsList.ts +37 -0
- package/src/mcp-server/tools/auditsListComments.ts +37 -0
- package/src/mcp-server/tools/auditsListControls.ts +37 -0
- package/src/mcp-server/tools/auditsListEvidence.ts +37 -0
- package/src/mcp-server/tools/auditsUpdateEvidence.ts +37 -0
- package/src/mcp-server/tools.ts +129 -0
- package/src/models/components/audit.ts +13 -4
- package/src/models/components/auditfocus.ts +31 -0
- package/src/models/components/auditorcontrol.ts +30 -4
- package/src/models/components/auditorenabledstatetransition.ts +1 -0
- package/src/models/components/comment.ts +9 -0
- package/src/models/components/control.ts +17 -4
- package/src/models/components/createcustomevidencerequestinput.ts +7 -0
- package/src/models/components/customfield.ts +109 -0
- package/src/models/components/index.ts +3 -0
- package/src/models/components/section.ts +69 -0
- package/src/models/errors/apierror.ts +29 -16
- package/src/models/errors/index.ts +1 -0
- package/src/models/errors/responsevalidationerror.ts +50 -0
- package/src/models/errors/sdkvalidationerror.ts +12 -0
- package/src/models/errors/vantaerror.ts +35 -0
- package/src/models/operations/listaudits.ts +7 -0
- package/src/sdk/audits.ts +2 -1
- package/src/types/async.ts +68 -0
- package/src/types/constdatetime.ts +1 -1
- package/tsconfig.json +41 -0
- package/types/async.d.ts +23 -0
- package/types/async.d.ts.map +1 -0
- package/types/async.js +44 -0
- package/types/async.js.map +1 -0
- package/types/constdatetime.js +1 -1
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
|
|
10
|
+
export type Value = string | Array<string>;
|
|
11
|
+
|
|
12
|
+
export type CustomField = {
|
|
13
|
+
label: string;
|
|
14
|
+
value: string | Array<string>;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/** @internal */
|
|
18
|
+
export const Value$inboundSchema: z.ZodType<Value, z.ZodTypeDef, unknown> = z
|
|
19
|
+
.union([z.string(), z.array(z.string())]);
|
|
20
|
+
|
|
21
|
+
/** @internal */
|
|
22
|
+
export type Value$Outbound = string | Array<string>;
|
|
23
|
+
|
|
24
|
+
/** @internal */
|
|
25
|
+
export const Value$outboundSchema: z.ZodType<
|
|
26
|
+
Value$Outbound,
|
|
27
|
+
z.ZodTypeDef,
|
|
28
|
+
Value
|
|
29
|
+
> = z.union([z.string(), z.array(z.string())]);
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @internal
|
|
33
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
34
|
+
*/
|
|
35
|
+
export namespace Value$ {
|
|
36
|
+
/** @deprecated use `Value$inboundSchema` instead. */
|
|
37
|
+
export const inboundSchema = Value$inboundSchema;
|
|
38
|
+
/** @deprecated use `Value$outboundSchema` instead. */
|
|
39
|
+
export const outboundSchema = Value$outboundSchema;
|
|
40
|
+
/** @deprecated use `Value$Outbound` instead. */
|
|
41
|
+
export type Outbound = Value$Outbound;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function valueToJSON(value: Value): string {
|
|
45
|
+
return JSON.stringify(Value$outboundSchema.parse(value));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function valueFromJSON(
|
|
49
|
+
jsonString: string,
|
|
50
|
+
): SafeParseResult<Value, SDKValidationError> {
|
|
51
|
+
return safeParse(
|
|
52
|
+
jsonString,
|
|
53
|
+
(x) => Value$inboundSchema.parse(JSON.parse(x)),
|
|
54
|
+
`Failed to parse 'Value' from JSON`,
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** @internal */
|
|
59
|
+
export const CustomField$inboundSchema: z.ZodType<
|
|
60
|
+
CustomField,
|
|
61
|
+
z.ZodTypeDef,
|
|
62
|
+
unknown
|
|
63
|
+
> = z.object({
|
|
64
|
+
label: z.string(),
|
|
65
|
+
value: z.union([z.string(), z.array(z.string())]),
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
/** @internal */
|
|
69
|
+
export type CustomField$Outbound = {
|
|
70
|
+
label: string;
|
|
71
|
+
value: string | Array<string>;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/** @internal */
|
|
75
|
+
export const CustomField$outboundSchema: z.ZodType<
|
|
76
|
+
CustomField$Outbound,
|
|
77
|
+
z.ZodTypeDef,
|
|
78
|
+
CustomField
|
|
79
|
+
> = z.object({
|
|
80
|
+
label: z.string(),
|
|
81
|
+
value: z.union([z.string(), z.array(z.string())]),
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* @internal
|
|
86
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
87
|
+
*/
|
|
88
|
+
export namespace CustomField$ {
|
|
89
|
+
/** @deprecated use `CustomField$inboundSchema` instead. */
|
|
90
|
+
export const inboundSchema = CustomField$inboundSchema;
|
|
91
|
+
/** @deprecated use `CustomField$outboundSchema` instead. */
|
|
92
|
+
export const outboundSchema = CustomField$outboundSchema;
|
|
93
|
+
/** @deprecated use `CustomField$Outbound` instead. */
|
|
94
|
+
export type Outbound = CustomField$Outbound;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export function customFieldToJSON(customField: CustomField): string {
|
|
98
|
+
return JSON.stringify(CustomField$outboundSchema.parse(customField));
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export function customFieldFromJSON(
|
|
102
|
+
jsonString: string,
|
|
103
|
+
): SafeParseResult<CustomField, SDKValidationError> {
|
|
104
|
+
return safeParse(
|
|
105
|
+
jsonString,
|
|
106
|
+
(x) => CustomField$inboundSchema.parse(JSON.parse(x)),
|
|
107
|
+
`Failed to parse 'CustomField' from JSON`,
|
|
108
|
+
);
|
|
109
|
+
}
|
|
@@ -8,6 +8,7 @@ export * from "./audit.js";
|
|
|
8
8
|
export * from "./auditevidencestate.js";
|
|
9
9
|
export * from "./auditevidencetype.js";
|
|
10
10
|
export * from "./auditevidenceupdateinput.js";
|
|
11
|
+
export * from "./auditfocus.js";
|
|
11
12
|
export * from "./auditor.js";
|
|
12
13
|
export * from "./auditorcontrol.js";
|
|
13
14
|
export * from "./auditorenabledstatetransition.js";
|
|
@@ -18,6 +19,7 @@ export * from "./controlsource.js";
|
|
|
18
19
|
export * from "./createcustomcontrolinput.js";
|
|
19
20
|
export * from "./createcustomevidencerequestinput.js";
|
|
20
21
|
export * from "./customevidencerequest.js";
|
|
22
|
+
export * from "./customfield.js";
|
|
21
23
|
export * from "./evidence.js";
|
|
22
24
|
export * from "./evidencecontrol.js";
|
|
23
25
|
export * from "./evidenceurl.js";
|
|
@@ -30,4 +32,5 @@ export * from "./paginatedresponsecomment.js";
|
|
|
30
32
|
export * from "./paginatedresponseevidence.js";
|
|
31
33
|
export * from "./paginatedresponseevidenceurl.js";
|
|
32
34
|
export * from "./recurrenceduration.js";
|
|
35
|
+
export * from "./section.js";
|
|
33
36
|
export * from "./security.js";
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
|
|
10
|
+
export type Section = {
|
|
11
|
+
/**
|
|
12
|
+
* The section name
|
|
13
|
+
*/
|
|
14
|
+
name: string;
|
|
15
|
+
/**
|
|
16
|
+
* The section framework
|
|
17
|
+
*/
|
|
18
|
+
framework: string;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/** @internal */
|
|
22
|
+
export const Section$inboundSchema: z.ZodType<Section, z.ZodTypeDef, unknown> =
|
|
23
|
+
z.object({
|
|
24
|
+
name: z.string(),
|
|
25
|
+
framework: z.string(),
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
/** @internal */
|
|
29
|
+
export type Section$Outbound = {
|
|
30
|
+
name: string;
|
|
31
|
+
framework: string;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/** @internal */
|
|
35
|
+
export const Section$outboundSchema: z.ZodType<
|
|
36
|
+
Section$Outbound,
|
|
37
|
+
z.ZodTypeDef,
|
|
38
|
+
Section
|
|
39
|
+
> = z.object({
|
|
40
|
+
name: z.string(),
|
|
41
|
+
framework: z.string(),
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* @internal
|
|
46
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
47
|
+
*/
|
|
48
|
+
export namespace Section$ {
|
|
49
|
+
/** @deprecated use `Section$inboundSchema` instead. */
|
|
50
|
+
export const inboundSchema = Section$inboundSchema;
|
|
51
|
+
/** @deprecated use `Section$outboundSchema` instead. */
|
|
52
|
+
export const outboundSchema = Section$outboundSchema;
|
|
53
|
+
/** @deprecated use `Section$Outbound` instead. */
|
|
54
|
+
export type Outbound = Section$Outbound;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function sectionToJSON(section: Section): string {
|
|
58
|
+
return JSON.stringify(Section$outboundSchema.parse(section));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function sectionFromJSON(
|
|
62
|
+
jsonString: string,
|
|
63
|
+
): SafeParseResult<Section, SDKValidationError> {
|
|
64
|
+
return safeParse(
|
|
65
|
+
jsonString,
|
|
66
|
+
(x) => Section$inboundSchema.parse(JSON.parse(x)),
|
|
67
|
+
`Failed to parse 'Section' from JSON`,
|
|
68
|
+
);
|
|
69
|
+
}
|
|
@@ -2,26 +2,39 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
public readonly statusCode: number;
|
|
7
|
-
public readonly contentType: string;
|
|
5
|
+
import { VantaError } from "./vantaerror.js";
|
|
8
6
|
|
|
7
|
+
/** The fallback error class if no more specific error class is matched */
|
|
8
|
+
export class APIError extends VantaError {
|
|
9
9
|
constructor(
|
|
10
10
|
message: string,
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
httpMeta: {
|
|
12
|
+
response: Response;
|
|
13
|
+
request: Request;
|
|
14
|
+
body: string;
|
|
15
|
+
},
|
|
13
16
|
) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
if (message) {
|
|
18
|
+
message += `: `;
|
|
19
|
+
}
|
|
20
|
+
message += `Status ${httpMeta.response.status}`;
|
|
21
|
+
const contentType = httpMeta.response.headers.get("content-type") || `""`;
|
|
22
|
+
if (contentType !== "application/json") {
|
|
23
|
+
message += ` Content-Type ${
|
|
24
|
+
contentType.includes(" ") ? `"${contentType}"` : contentType
|
|
25
|
+
}`;
|
|
26
|
+
}
|
|
27
|
+
const body = httpMeta.body || `""`;
|
|
28
|
+
message += body.length > 100 ? "\n" : ". ";
|
|
29
|
+
let bodyDisplay = body;
|
|
30
|
+
if (body.length > 10000) {
|
|
31
|
+
const truncated = body.substring(0, 10000);
|
|
32
|
+
const remaining = body.length - 10000;
|
|
33
|
+
bodyDisplay = `${truncated}...and ${remaining} more chars`;
|
|
34
|
+
}
|
|
35
|
+
message += `Body: ${bodyDisplay}`;
|
|
36
|
+
message = message.trim();
|
|
37
|
+
super(message, httpMeta);
|
|
25
38
|
this.name = "APIError";
|
|
26
39
|
}
|
|
27
40
|
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { formatZodError } from "./sdkvalidationerror.js";
|
|
7
|
+
import { VantaError } from "./vantaerror.js";
|
|
8
|
+
|
|
9
|
+
export class ResponseValidationError extends VantaError {
|
|
10
|
+
/**
|
|
11
|
+
* The raw value that failed validation.
|
|
12
|
+
*/
|
|
13
|
+
public readonly rawValue: unknown;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The raw message that failed validation.
|
|
17
|
+
*/
|
|
18
|
+
public readonly rawMessage: unknown;
|
|
19
|
+
|
|
20
|
+
constructor(
|
|
21
|
+
message: string,
|
|
22
|
+
extra: {
|
|
23
|
+
response: Response;
|
|
24
|
+
request: Request;
|
|
25
|
+
body: string;
|
|
26
|
+
cause: unknown;
|
|
27
|
+
rawValue: unknown;
|
|
28
|
+
rawMessage: unknown;
|
|
29
|
+
},
|
|
30
|
+
) {
|
|
31
|
+
super(message, extra);
|
|
32
|
+
this.name = "ResponseValidationError";
|
|
33
|
+
this.cause = extra.cause;
|
|
34
|
+
this.rawValue = extra.rawValue;
|
|
35
|
+
this.rawMessage = extra.rawMessage;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Return a pretty-formatted error message if the underlying validation error
|
|
40
|
+
* is a ZodError or some other recognized error type, otherwise return the
|
|
41
|
+
* default error message.
|
|
42
|
+
*/
|
|
43
|
+
public pretty(): string {
|
|
44
|
+
if (this.cause instanceof z.ZodError) {
|
|
45
|
+
return `${this.rawMessage}\n${formatZodError(this.cause)}`;
|
|
46
|
+
} else {
|
|
47
|
+
return this.toString();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -15,6 +15,18 @@ export class SDKValidationError extends Error {
|
|
|
15
15
|
*/
|
|
16
16
|
public readonly rawMessage: unknown;
|
|
17
17
|
|
|
18
|
+
// Allows for backwards compatibility for `instanceof` checks of `ResponseValidationError`
|
|
19
|
+
static override [Symbol.hasInstance](
|
|
20
|
+
instance: unknown,
|
|
21
|
+
): instance is SDKValidationError {
|
|
22
|
+
if (!(instance instanceof Error)) return false;
|
|
23
|
+
if (!("rawValue" in instance)) return false;
|
|
24
|
+
if (!("rawMessage" in instance)) return false;
|
|
25
|
+
if (!("pretty" in instance)) return false;
|
|
26
|
+
if (typeof instance.pretty !== "function") return false;
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
|
|
18
30
|
constructor(message: string, cause: unknown, rawValue: unknown) {
|
|
19
31
|
super(`${message}: ${cause}`);
|
|
20
32
|
this.name = "SDKValidationError";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/** The base class for all HTTP error responses */
|
|
6
|
+
export class VantaError extends Error {
|
|
7
|
+
/** HTTP status code */
|
|
8
|
+
public readonly statusCode: number;
|
|
9
|
+
/** HTTP body */
|
|
10
|
+
public readonly body: string;
|
|
11
|
+
/** HTTP headers */
|
|
12
|
+
public readonly headers: Headers;
|
|
13
|
+
/** HTTP content type */
|
|
14
|
+
public readonly contentType: string;
|
|
15
|
+
/** Raw response */
|
|
16
|
+
public readonly rawResponse: Response;
|
|
17
|
+
|
|
18
|
+
constructor(
|
|
19
|
+
message: string,
|
|
20
|
+
httpMeta: {
|
|
21
|
+
response: Response;
|
|
22
|
+
request: Request;
|
|
23
|
+
body: string;
|
|
24
|
+
},
|
|
25
|
+
) {
|
|
26
|
+
super(message);
|
|
27
|
+
this.statusCode = httpMeta.response.status;
|
|
28
|
+
this.body = httpMeta.body;
|
|
29
|
+
this.headers = httpMeta.response.headers;
|
|
30
|
+
this.contentType = httpMeta.response.headers.get("content-type") || "";
|
|
31
|
+
this.rawResponse = httpMeta.response;
|
|
32
|
+
|
|
33
|
+
this.name = "VantaError";
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -14,6 +14,10 @@ export type ListAuditsRequest = {
|
|
|
14
14
|
* Includes all audits that have changed since changedSinceDate.
|
|
15
15
|
*/
|
|
16
16
|
changedSinceDate?: Date | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Includes only audits with no audit report uploaded
|
|
19
|
+
*/
|
|
20
|
+
isActiveAudit?: boolean | undefined;
|
|
17
21
|
};
|
|
18
22
|
|
|
19
23
|
/** @internal */
|
|
@@ -27,6 +31,7 @@ export const ListAuditsRequest$inboundSchema: z.ZodType<
|
|
|
27
31
|
changedSinceDate: z.string().datetime({ offset: true }).transform(v =>
|
|
28
32
|
new Date(v)
|
|
29
33
|
).optional(),
|
|
34
|
+
isActiveAudit: z.boolean().optional(),
|
|
30
35
|
});
|
|
31
36
|
|
|
32
37
|
/** @internal */
|
|
@@ -34,6 +39,7 @@ export type ListAuditsRequest$Outbound = {
|
|
|
34
39
|
pageSize: number;
|
|
35
40
|
pageCursor?: string | undefined;
|
|
36
41
|
changedSinceDate?: string | undefined;
|
|
42
|
+
isActiveAudit?: boolean | undefined;
|
|
37
43
|
};
|
|
38
44
|
|
|
39
45
|
/** @internal */
|
|
@@ -45,6 +51,7 @@ export const ListAuditsRequest$outboundSchema: z.ZodType<
|
|
|
45
51
|
pageSize: z.number().int().default(10),
|
|
46
52
|
pageCursor: z.string().optional(),
|
|
47
53
|
changedSinceDate: z.date().transform(v => v.toISOString()).optional(),
|
|
54
|
+
isActiveAudit: z.boolean().optional(),
|
|
48
55
|
});
|
|
49
56
|
|
|
50
57
|
/**
|
package/src/sdk/audits.ts
CHANGED
|
@@ -38,7 +38,8 @@ export class Audits extends ClientSDK {
|
|
|
38
38
|
* List audit evidence url
|
|
39
39
|
*
|
|
40
40
|
* @remarks
|
|
41
|
-
* Returns a paginated list of evidence urls for an audit.
|
|
41
|
+
* Returns a paginated list of evidence urls for an audit. This endpoint should be called whenever an
|
|
42
|
+
* evidence is created or has a statusUpdatedAt field that is more recent than the most recent polling event.
|
|
42
43
|
*/
|
|
43
44
|
async getEvidenceUrls(
|
|
44
45
|
request: operations.ListAuditEvidenceUrlsRequest,
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export type APICall =
|
|
6
|
+
| {
|
|
7
|
+
status: "complete";
|
|
8
|
+
request: Request;
|
|
9
|
+
response: Response;
|
|
10
|
+
}
|
|
11
|
+
| {
|
|
12
|
+
status: "request-error";
|
|
13
|
+
request: Request;
|
|
14
|
+
response?: undefined;
|
|
15
|
+
}
|
|
16
|
+
| {
|
|
17
|
+
status: "invalid";
|
|
18
|
+
request?: undefined;
|
|
19
|
+
response?: undefined;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export class APIPromise<T> implements Promise<T> {
|
|
23
|
+
readonly #promise: Promise<[T, APICall]>;
|
|
24
|
+
readonly #unwrapped: Promise<T>;
|
|
25
|
+
|
|
26
|
+
readonly [Symbol.toStringTag] = "APIPromise";
|
|
27
|
+
|
|
28
|
+
constructor(p: [T, APICall] | Promise<[T, APICall]>) {
|
|
29
|
+
this.#promise = p instanceof Promise ? p : Promise.resolve(p);
|
|
30
|
+
this.#unwrapped =
|
|
31
|
+
p instanceof Promise
|
|
32
|
+
? this.#promise.then(([value]) => value)
|
|
33
|
+
: Promise.resolve(p[0]);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
then<TResult1 = T, TResult2 = never>(
|
|
37
|
+
onfulfilled?:
|
|
38
|
+
| ((value: T) => TResult1 | PromiseLike<TResult1>)
|
|
39
|
+
| null
|
|
40
|
+
| undefined,
|
|
41
|
+
onrejected?:
|
|
42
|
+
| ((reason: any) => TResult2 | PromiseLike<TResult2>)
|
|
43
|
+
| null
|
|
44
|
+
| undefined,
|
|
45
|
+
): Promise<TResult1 | TResult2> {
|
|
46
|
+
return this.#promise.then(
|
|
47
|
+
onfulfilled ? ([value]) => onfulfilled(value) : void 0,
|
|
48
|
+
onrejected,
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
catch<TResult = never>(
|
|
53
|
+
onrejected?:
|
|
54
|
+
| ((reason: any) => TResult | PromiseLike<TResult>)
|
|
55
|
+
| null
|
|
56
|
+
| undefined,
|
|
57
|
+
): Promise<T | TResult> {
|
|
58
|
+
return this.#unwrapped.catch(onrejected);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
finally(onfinally?: (() => void) | null | undefined): Promise<T> {
|
|
62
|
+
return this.#unwrapped.finally(onfinally);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
$inspect(): Promise<[T, APICall]> {
|
|
66
|
+
return this.#promise;
|
|
67
|
+
}
|
|
68
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"incremental": true,
|
|
4
|
+
"tsBuildInfoFile": ".tsbuildinfo",
|
|
5
|
+
"target": "ES2020",
|
|
6
|
+
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
7
|
+
"jsx": "react-jsx",
|
|
8
|
+
|
|
9
|
+
"module": "Node16",
|
|
10
|
+
"moduleResolution": "Node16",
|
|
11
|
+
|
|
12
|
+
"allowJs": true,
|
|
13
|
+
|
|
14
|
+
"declaration": true,
|
|
15
|
+
"declarationMap": true,
|
|
16
|
+
"sourceMap": true,
|
|
17
|
+
"outDir": ".",
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
// https://github.com/tsconfig/bases/blob/a1bf7c0fa2e094b068ca3e1448ca2ece4157977e/bases/strictest.json
|
|
21
|
+
"strict": true,
|
|
22
|
+
"allowUnusedLabels": false,
|
|
23
|
+
"allowUnreachableCode": false,
|
|
24
|
+
"exactOptionalPropertyTypes": true,
|
|
25
|
+
"useUnknownInCatchVariables": true,
|
|
26
|
+
"noFallthroughCasesInSwitch": true,
|
|
27
|
+
"noImplicitOverride": true,
|
|
28
|
+
"noImplicitReturns": true,
|
|
29
|
+
"noPropertyAccessFromIndexSignature": true,
|
|
30
|
+
"noUncheckedIndexedAccess": true,
|
|
31
|
+
"noUnusedLocals": true,
|
|
32
|
+
"noUnusedParameters": true,
|
|
33
|
+
"isolatedModules": true,
|
|
34
|
+
"checkJs": true,
|
|
35
|
+
"esModuleInterop": true,
|
|
36
|
+
"skipLibCheck": true,
|
|
37
|
+
"forceConsistentCasingInFileNames": true
|
|
38
|
+
},
|
|
39
|
+
"include": ["src"],
|
|
40
|
+
"exclude": ["node_modules"]
|
|
41
|
+
}
|
package/types/async.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type APICall = {
|
|
2
|
+
status: "complete";
|
|
3
|
+
request: Request;
|
|
4
|
+
response: Response;
|
|
5
|
+
} | {
|
|
6
|
+
status: "request-error";
|
|
7
|
+
request: Request;
|
|
8
|
+
response?: undefined;
|
|
9
|
+
} | {
|
|
10
|
+
status: "invalid";
|
|
11
|
+
request?: undefined;
|
|
12
|
+
response?: undefined;
|
|
13
|
+
};
|
|
14
|
+
export declare class APIPromise<T> implements Promise<T> {
|
|
15
|
+
#private;
|
|
16
|
+
readonly [Symbol.toStringTag] = "APIPromise";
|
|
17
|
+
constructor(p: [T, APICall] | Promise<[T, APICall]>);
|
|
18
|
+
then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>;
|
|
19
|
+
catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null | undefined): Promise<T | TResult>;
|
|
20
|
+
finally(onfinally?: (() => void) | null | undefined): Promise<T>;
|
|
21
|
+
$inspect(): Promise<[T, APICall]>;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=async.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"async.d.ts","sourceRoot":"","sources":["../src/types/async.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,OAAO,GACf;IACE,MAAM,EAAE,UAAU,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,QAAQ,CAAC;CACpB,GACD;IACE,MAAM,EAAE,eAAe,CAAC;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,GACD;IACE,MAAM,EAAE,SAAS,CAAC;IAClB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEN,qBAAa,UAAU,CAAC,CAAC,CAAE,YAAW,OAAO,CAAC,CAAC,CAAC;;IAI9C,QAAQ,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,gBAAgB;gBAEjC,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAQnD,IAAI,CAAC,QAAQ,GAAG,CAAC,EAAE,QAAQ,GAAG,KAAK,EACjC,WAAW,CAAC,EACR,CAAC,CAAC,KAAK,EAAE,CAAC,KAAK,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,GAChD,IAAI,GACJ,SAAS,EACb,UAAU,CAAC,EACP,CAAC,CAAC,MAAM,EAAE,GAAG,KAAK,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,GACnD,IAAI,GACJ,SAAS,GACZ,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAO/B,KAAK,CAAC,OAAO,GAAG,KAAK,EACnB,UAAU,CAAC,EACP,CAAC,CAAC,MAAM,EAAE,GAAG,KAAK,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,GACjD,IAAI,GACJ,SAAS,GACZ,OAAO,CAAC,CAAC,GAAG,OAAO,CAAC;IAIvB,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC;IAIhE,QAAQ,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;CAGlC"}
|
package/types/async.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
6
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
7
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
8
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
9
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
10
|
+
};
|
|
11
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
12
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
13
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
14
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
15
|
+
};
|
|
16
|
+
var _APIPromise_promise, _APIPromise_unwrapped, _a;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.APIPromise = void 0;
|
|
19
|
+
class APIPromise {
|
|
20
|
+
constructor(p) {
|
|
21
|
+
_APIPromise_promise.set(this, void 0);
|
|
22
|
+
_APIPromise_unwrapped.set(this, void 0);
|
|
23
|
+
this[_a] = "APIPromise";
|
|
24
|
+
__classPrivateFieldSet(this, _APIPromise_promise, p instanceof Promise ? p : Promise.resolve(p), "f");
|
|
25
|
+
__classPrivateFieldSet(this, _APIPromise_unwrapped, p instanceof Promise
|
|
26
|
+
? __classPrivateFieldGet(this, _APIPromise_promise, "f").then(([value]) => value)
|
|
27
|
+
: Promise.resolve(p[0]), "f");
|
|
28
|
+
}
|
|
29
|
+
then(onfulfilled, onrejected) {
|
|
30
|
+
return __classPrivateFieldGet(this, _APIPromise_promise, "f").then(onfulfilled ? ([value]) => onfulfilled(value) : void 0, onrejected);
|
|
31
|
+
}
|
|
32
|
+
catch(onrejected) {
|
|
33
|
+
return __classPrivateFieldGet(this, _APIPromise_unwrapped, "f").catch(onrejected);
|
|
34
|
+
}
|
|
35
|
+
finally(onfinally) {
|
|
36
|
+
return __classPrivateFieldGet(this, _APIPromise_unwrapped, "f").finally(onfinally);
|
|
37
|
+
}
|
|
38
|
+
$inspect() {
|
|
39
|
+
return __classPrivateFieldGet(this, _APIPromise_promise, "f");
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.APIPromise = APIPromise;
|
|
43
|
+
_APIPromise_promise = new WeakMap(), _APIPromise_unwrapped = new WeakMap(), _a = Symbol.toStringTag;
|
|
44
|
+
//# sourceMappingURL=async.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"async.js","sourceRoot":"","sources":["../src/types/async.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;AAmBH,MAAa,UAAU;IAMrB,YAAY,CAAuC;QAL1C,sCAAgC;QAChC,wCAAuB;QAEvB,QAAoB,GAAG,YAAY,CAAC;QAG3C,uBAAA,IAAI,uBAAY,CAAC,YAAY,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,MAAA,CAAC;QAC9D,uBAAA,IAAI,yBACF,CAAC,YAAY,OAAO;YAClB,CAAC,CAAC,uBAAA,IAAI,2BAAS,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC;YACxC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAA,CAAC;IAC9B,CAAC;IAED,IAAI,CACF,WAGa,EACb,UAGa;QAEb,OAAO,uBAAA,IAAI,2BAAS,CAAC,IAAI,CACvB,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EACtD,UAAU,CACX,CAAC;IACJ,CAAC;IAED,KAAK,CACH,UAGa;QAEb,OAAO,uBAAA,IAAI,6BAAW,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAC3C,CAAC;IAED,OAAO,CAAC,SAA2C;QACjD,OAAO,uBAAA,IAAI,6BAAW,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAC5C,CAAC;IAED,QAAQ;QACN,OAAO,uBAAA,IAAI,2BAAS,CAAC;IACvB,CAAC;CACF;AA9CD,gCA8CC;iFA1CW,MAAM,CAAC,WAAW"}
|
package/types/constdatetime.js
CHANGED
|
@@ -41,6 +41,6 @@ const z = __importStar(require("zod"));
|
|
|
41
41
|
function constDateTime(val) {
|
|
42
42
|
return z.custom((v) => {
|
|
43
43
|
return (typeof v === "string" && new Date(v).getTime() === new Date(val).getTime());
|
|
44
|
-
}, `Value must be
|
|
44
|
+
}, `Value must be equivalent to ${val}`);
|
|
45
45
|
}
|
|
46
46
|
//# sourceMappingURL=constdatetime.js.map
|