vanta-auditor-api-sdk 0.2.0 → 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.
Files changed (153) hide show
  1. package/FUNCTIONS.md +5 -22
  2. package/README.md +36 -51
  3. package/bin/mcp-server.js +1159 -1023
  4. package/bin/mcp-server.js.map +39 -29
  5. package/docs/sdks/auditors/README.md +7 -11
  6. package/docs/sdks/audits/README.md +67 -101
  7. package/examples/README.md +31 -0
  8. package/examples/auditsList.example.ts +26 -0
  9. package/examples/package-lock.json +626 -0
  10. package/examples/package.json +18 -0
  11. package/funcs/auditorsCreate.d.ts +3 -2
  12. package/funcs/auditorsCreate.d.ts.map +1 -1
  13. package/funcs/auditorsCreate.js +3 -1
  14. package/funcs/auditorsCreate.js.map +1 -1
  15. package/funcs/auditsCreateCommentForEvidence.d.ts +3 -2
  16. package/funcs/auditsCreateCommentForEvidence.d.ts.map +1 -1
  17. package/funcs/auditsCreateCommentForEvidence.js +3 -1
  18. package/funcs/auditsCreateCommentForEvidence.js.map +1 -1
  19. package/funcs/auditsCreateCustomControl.d.ts +3 -2
  20. package/funcs/auditsCreateCustomControl.d.ts.map +1 -1
  21. package/funcs/auditsCreateCustomControl.js +3 -1
  22. package/funcs/auditsCreateCustomControl.js.map +1 -1
  23. package/funcs/auditsCreateCustomEvidenceRequest.d.ts +3 -2
  24. package/funcs/auditsCreateCustomEvidenceRequest.d.ts.map +1 -1
  25. package/funcs/auditsCreateCustomEvidenceRequest.js +3 -1
  26. package/funcs/auditsCreateCustomEvidenceRequest.js.map +1 -1
  27. package/funcs/auditsGetEvidenceUrls.d.ts +3 -2
  28. package/funcs/auditsGetEvidenceUrls.d.ts.map +1 -1
  29. package/funcs/auditsGetEvidenceUrls.js +3 -1
  30. package/funcs/auditsGetEvidenceUrls.js.map +1 -1
  31. package/funcs/auditsList.d.ts +3 -2
  32. package/funcs/auditsList.d.ts.map +1 -1
  33. package/funcs/auditsList.js +4 -1
  34. package/funcs/auditsList.js.map +1 -1
  35. package/funcs/auditsListComments.d.ts +3 -2
  36. package/funcs/auditsListComments.d.ts.map +1 -1
  37. package/funcs/auditsListComments.js +3 -1
  38. package/funcs/auditsListComments.js.map +1 -1
  39. package/funcs/auditsListControls.d.ts +3 -2
  40. package/funcs/auditsListControls.d.ts.map +1 -1
  41. package/funcs/auditsListControls.js +3 -1
  42. package/funcs/auditsListControls.js.map +1 -1
  43. package/funcs/auditsListEvidence.d.ts +3 -2
  44. package/funcs/auditsListEvidence.d.ts.map +1 -1
  45. package/funcs/auditsListEvidence.js +3 -1
  46. package/funcs/auditsListEvidence.js.map +1 -1
  47. package/funcs/auditsUpdateEvidence.d.ts +3 -2
  48. package/funcs/auditsUpdateEvidence.d.ts.map +1 -1
  49. package/funcs/auditsUpdateEvidence.js +3 -1
  50. package/funcs/auditsUpdateEvidence.js.map +1 -1
  51. package/hooks/types.d.ts +2 -0
  52. package/hooks/types.d.ts.map +1 -1
  53. package/index.d.ts +2 -0
  54. package/index.d.ts.map +1 -1
  55. package/index.js +3 -1
  56. package/index.js.map +1 -1
  57. package/jsr.json +1 -1
  58. package/lib/config.d.ts +7 -3
  59. package/lib/config.d.ts.map +1 -1
  60. package/lib/config.js +3 -3
  61. package/lib/config.js.map +1 -1
  62. package/lib/files.d.ts +5 -0
  63. package/lib/files.d.ts.map +1 -1
  64. package/lib/files.js +41 -0
  65. package/lib/files.js.map +1 -1
  66. package/lib/matchers.d.ts +3 -10
  67. package/lib/matchers.d.ts.map +1 -1
  68. package/lib/matchers.js +33 -31
  69. package/lib/matchers.js.map +1 -1
  70. package/lib/sdks.d.ts +4 -1
  71. package/lib/sdks.d.ts.map +1 -1
  72. package/lib/sdks.js +9 -14
  73. package/lib/sdks.js.map +1 -1
  74. package/lib/security.d.ts +2 -2
  75. package/lib/security.d.ts.map +1 -1
  76. package/mcp-server/cli/start/command.d.ts.map +1 -1
  77. package/mcp-server/cli/start/command.js +0 -12
  78. package/mcp-server/cli/start/command.js.map +1 -1
  79. package/mcp-server/cli/start/impl.d.ts +0 -2
  80. package/mcp-server/cli/start/impl.d.ts.map +1 -1
  81. package/mcp-server/cli/start/impl.js +2 -4
  82. package/mcp-server/cli/start/impl.js.map +1 -1
  83. package/mcp-server/mcp-server.js +1 -1
  84. package/mcp-server/server.js +1 -1
  85. package/models/components/audit.d.ts +5 -2
  86. package/models/components/audit.d.ts.map +1 -1
  87. package/models/components/audit.js +5 -2
  88. package/models/components/audit.js.map +1 -1
  89. package/models/components/auditfocus.d.ts +28 -0
  90. package/models/components/auditfocus.d.ts.map +1 -0
  91. package/models/components/auditfocus.js +61 -0
  92. package/models/components/auditfocus.js.map +1 -0
  93. package/models/components/index.d.ts +1 -0
  94. package/models/components/index.d.ts.map +1 -1
  95. package/models/components/index.js +1 -0
  96. package/models/components/index.js.map +1 -1
  97. package/models/errors/apierror.d.ts +8 -6
  98. package/models/errors/apierror.d.ts.map +1 -1
  99. package/models/errors/apierror.js +23 -10
  100. package/models/errors/apierror.js.map +1 -1
  101. package/models/errors/index.d.ts +1 -0
  102. package/models/errors/index.d.ts.map +1 -1
  103. package/models/errors/index.js +1 -0
  104. package/models/errors/index.js.map +1 -1
  105. package/models/errors/responsevalidationerror.d.ts +26 -0
  106. package/models/errors/responsevalidationerror.d.ts.map +1 -0
  107. package/models/errors/responsevalidationerror.js +66 -0
  108. package/models/errors/responsevalidationerror.js.map +1 -0
  109. package/models/errors/sdkvalidationerror.d.ts +1 -0
  110. package/models/errors/sdkvalidationerror.d.ts.map +1 -1
  111. package/models/errors/sdkvalidationerror.js +14 -0
  112. package/models/errors/sdkvalidationerror.js.map +1 -1
  113. package/models/errors/vantaerror.d.ts +19 -0
  114. package/models/errors/vantaerror.d.ts.map +1 -0
  115. package/models/errors/vantaerror.js +20 -0
  116. package/models/errors/vantaerror.js.map +1 -0
  117. package/models/operations/listaudits.d.ts +5 -0
  118. package/models/operations/listaudits.d.ts.map +1 -1
  119. package/models/operations/listaudits.js +2 -0
  120. package/models/operations/listaudits.js.map +1 -1
  121. package/package.json +7 -7
  122. package/src/funcs/auditorsCreate.ts +23 -17
  123. package/src/funcs/auditsCreateCommentForEvidence.ts +23 -17
  124. package/src/funcs/auditsCreateCustomControl.ts +23 -17
  125. package/src/funcs/auditsCreateCustomEvidenceRequest.ts +23 -17
  126. package/src/funcs/auditsGetEvidenceUrls.ts +23 -17
  127. package/src/funcs/auditsList.ts +24 -17
  128. package/src/funcs/auditsListComments.ts +23 -17
  129. package/src/funcs/auditsListControls.ts +23 -17
  130. package/src/funcs/auditsListEvidence.ts +23 -17
  131. package/src/funcs/auditsUpdateEvidence.ts +23 -17
  132. package/src/hooks/types.ts +2 -0
  133. package/src/index.ts +2 -0
  134. package/src/lib/config.ts +7 -3
  135. package/src/lib/files.ts +42 -0
  136. package/src/lib/matchers.ts +44 -41
  137. package/src/lib/sdks.ts +21 -15
  138. package/src/lib/security.ts +2 -2
  139. package/src/mcp-server/cli/start/command.ts +0 -13
  140. package/src/mcp-server/cli/start/impl.ts +2 -6
  141. package/src/mcp-server/mcp-server.ts +1 -1
  142. package/src/mcp-server/server.ts +1 -1
  143. package/src/models/components/audit.ts +13 -4
  144. package/src/models/components/auditfocus.ts +31 -0
  145. package/src/models/components/index.ts +1 -0
  146. package/src/models/errors/apierror.ts +29 -16
  147. package/src/models/errors/index.ts +1 -0
  148. package/src/models/errors/responsevalidationerror.ts +50 -0
  149. package/src/models/errors/sdkvalidationerror.ts +12 -0
  150. package/src/models/errors/vantaerror.ts +35 -0
  151. package/src/models/operations/listaudits.ts +7 -0
  152. package/src/types/constdatetime.ts +1 -1
  153. package/types/constdatetime.js +1 -1
@@ -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
  /**
@@ -11,5 +11,5 @@ export function constDateTime(
11
11
  return (
12
12
  typeof v === "string" && new Date(v).getTime() === new Date(val).getTime()
13
13
  );
14
- }, `Value must be equivelant to ${val}`);
14
+ }, `Value must be equivalent to ${val}`);
15
15
  }
@@ -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 equivelant to ${val}`);
44
+ }, `Value must be equivalent to ${val}`);
45
45
  }
46
46
  //# sourceMappingURL=constdatetime.js.map