vanta-auditor-api-sdk 0.1.1 → 0.2.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 (266) hide show
  1. package/.devcontainer/README.md +5 -0
  2. package/.devcontainer/devcontainer.json +45 -0
  3. package/README.md +122 -8
  4. package/bin/mcp-server.js +39064 -0
  5. package/bin/mcp-server.js.map +312 -0
  6. package/docs/sdks/auditors/README.md +2 -2
  7. package/docs/sdks/audits/README.md +8 -5
  8. package/funcs/auditorsCreate.d.ts +2 -1
  9. package/funcs/auditorsCreate.d.ts.map +1 -1
  10. package/funcs/auditorsCreate.js +15 -9
  11. package/funcs/auditorsCreate.js.map +1 -1
  12. package/funcs/auditsCreateCommentForEvidence.d.ts +2 -1
  13. package/funcs/auditsCreateCommentForEvidence.d.ts.map +1 -1
  14. package/funcs/auditsCreateCommentForEvidence.js +15 -9
  15. package/funcs/auditsCreateCommentForEvidence.js.map +1 -1
  16. package/funcs/auditsCreateCustomControl.d.ts +2 -1
  17. package/funcs/auditsCreateCustomControl.d.ts.map +1 -1
  18. package/funcs/auditsCreateCustomControl.js +15 -9
  19. package/funcs/auditsCreateCustomControl.js.map +1 -1
  20. package/funcs/auditsCreateCustomEvidenceRequest.d.ts +2 -1
  21. package/funcs/auditsCreateCustomEvidenceRequest.d.ts.map +1 -1
  22. package/funcs/auditsCreateCustomEvidenceRequest.js +15 -9
  23. package/funcs/auditsCreateCustomEvidenceRequest.js.map +1 -1
  24. package/funcs/auditsGetEvidenceUrls.d.ts +4 -2
  25. package/funcs/auditsGetEvidenceUrls.d.ts.map +1 -1
  26. package/funcs/auditsGetEvidenceUrls.js +17 -10
  27. package/funcs/auditsGetEvidenceUrls.js.map +1 -1
  28. package/funcs/auditsList.d.ts +2 -1
  29. package/funcs/auditsList.d.ts.map +1 -1
  30. package/funcs/auditsList.js +15 -9
  31. package/funcs/auditsList.js.map +1 -1
  32. package/funcs/auditsListComments.d.ts +2 -1
  33. package/funcs/auditsListComments.d.ts.map +1 -1
  34. package/funcs/auditsListComments.js +15 -9
  35. package/funcs/auditsListComments.js.map +1 -1
  36. package/funcs/auditsListControls.d.ts +2 -1
  37. package/funcs/auditsListControls.d.ts.map +1 -1
  38. package/funcs/auditsListControls.js +15 -9
  39. package/funcs/auditsListControls.js.map +1 -1
  40. package/funcs/auditsListEvidence.d.ts +2 -1
  41. package/funcs/auditsListEvidence.d.ts.map +1 -1
  42. package/funcs/auditsListEvidence.js +15 -9
  43. package/funcs/auditsListEvidence.js.map +1 -1
  44. package/funcs/auditsUpdateEvidence.d.ts +2 -1
  45. package/funcs/auditsUpdateEvidence.d.ts.map +1 -1
  46. package/funcs/auditsUpdateEvidence.js +15 -9
  47. package/funcs/auditsUpdateEvidence.js.map +1 -1
  48. package/hooks/types.d.ts +2 -1
  49. package/hooks/types.d.ts.map +1 -1
  50. package/jsr.json +27 -0
  51. package/lib/config.d.ts +7 -7
  52. package/lib/config.d.ts.map +1 -1
  53. package/lib/config.js +14 -3
  54. package/lib/config.js.map +1 -1
  55. package/lib/encodings.d.ts +10 -9
  56. package/lib/encodings.d.ts.map +1 -1
  57. package/lib/encodings.js +73 -47
  58. package/lib/encodings.js.map +1 -1
  59. package/lib/files.js.map +1 -1
  60. package/lib/matchers.d.ts +3 -1
  61. package/lib/matchers.d.ts.map +1 -1
  62. package/lib/matchers.js +12 -0
  63. package/lib/matchers.js.map +1 -1
  64. package/lib/primitives.d.ts +4 -0
  65. package/lib/primitives.d.ts.map +1 -1
  66. package/lib/primitives.js +17 -0
  67. package/lib/primitives.js.map +1 -1
  68. package/lib/retries.js +0 -1
  69. package/lib/retries.js.map +1 -1
  70. package/lib/schemas.d.ts +1 -1
  71. package/lib/schemas.d.ts.map +1 -1
  72. package/lib/schemas.js +4 -1
  73. package/lib/schemas.js.map +1 -1
  74. package/lib/sdks.d.ts +1 -1
  75. package/lib/sdks.d.ts.map +1 -1
  76. package/lib/sdks.js +13 -11
  77. package/lib/sdks.js.map +1 -1
  78. package/lib/security.d.ts +4 -3
  79. package/lib/security.d.ts.map +1 -1
  80. package/lib/security.js +6 -1
  81. package/lib/security.js.map +1 -1
  82. package/mcp-server/build.d.mts.map +1 -0
  83. package/mcp-server/build.mjs +14 -0
  84. package/mcp-server/build.mjs.map +1 -0
  85. package/mcp-server/cli/start/command.d.ts +2 -0
  86. package/mcp-server/cli/start/command.d.ts.map +1 -0
  87. package/mcp-server/cli/start/command.js +138 -0
  88. package/mcp-server/cli/start/command.js.map +1 -0
  89. package/mcp-server/cli/start/impl.d.ts +18 -0
  90. package/mcp-server/cli/start/impl.d.ts.map +1 -0
  91. package/mcp-server/cli/start/impl.js +104 -0
  92. package/mcp-server/cli/start/impl.js.map +1 -0
  93. package/mcp-server/cli.d.ts +6 -0
  94. package/mcp-server/cli.d.ts.map +1 -0
  95. package/mcp-server/cli.js +10 -0
  96. package/mcp-server/cli.js.map +1 -0
  97. package/mcp-server/console-logger.d.ts +7 -0
  98. package/mcp-server/console-logger.d.ts.map +1 -0
  99. package/mcp-server/console-logger.js +59 -0
  100. package/mcp-server/console-logger.js.map +1 -0
  101. package/mcp-server/extensions.d.ts +11 -0
  102. package/mcp-server/extensions.d.ts.map +1 -0
  103. package/mcp-server/extensions.js +6 -0
  104. package/mcp-server/extensions.js.map +1 -0
  105. package/mcp-server/mcp-server.d.ts +2 -0
  106. package/mcp-server/mcp-server.d.ts.map +1 -0
  107. package/mcp-server/mcp-server.js +29 -0
  108. package/mcp-server/mcp-server.js.map +1 -0
  109. package/mcp-server/prompts.d.ts +26 -0
  110. package/mcp-server/prompts.d.ts.map +1 -0
  111. package/mcp-server/prompts.js +51 -0
  112. package/mcp-server/prompts.js.map +1 -0
  113. package/mcp-server/resources.d.ts +32 -0
  114. package/mcp-server/resources.d.ts.map +1 -0
  115. package/mcp-server/resources.js +87 -0
  116. package/mcp-server/resources.js.map +1 -0
  117. package/mcp-server/scopes.d.ts +3 -0
  118. package/mcp-server/scopes.d.ts.map +1 -0
  119. package/mcp-server/scopes.js +8 -0
  120. package/mcp-server/scopes.js.map +1 -0
  121. package/mcp-server/server.d.ts +13 -0
  122. package/mcp-server/server.d.ts.map +1 -0
  123. package/mcp-server/server.js +52 -0
  124. package/mcp-server/server.js.map +1 -0
  125. package/mcp-server/shared.d.ts +7 -0
  126. package/mcp-server/shared.d.ts.map +1 -0
  127. package/mcp-server/shared.js +98 -0
  128. package/mcp-server/shared.js.map +1 -0
  129. package/mcp-server/tools/auditorsCreate.d.ts +8 -0
  130. package/mcp-server/tools/auditorsCreate.d.ts.map +1 -0
  131. package/mcp-server/tools/auditorsCreate.js +64 -0
  132. package/mcp-server/tools/auditorsCreate.js.map +1 -0
  133. package/mcp-server/tools/auditsCreateCommentForEvidence.d.ts +8 -0
  134. package/mcp-server/tools/auditsCreateCommentForEvidence.d.ts.map +1 -0
  135. package/mcp-server/tools/auditsCreateCommentForEvidence.js +64 -0
  136. package/mcp-server/tools/auditsCreateCommentForEvidence.js.map +1 -0
  137. package/mcp-server/tools/auditsCreateCustomControl.d.ts +8 -0
  138. package/mcp-server/tools/auditsCreateCustomControl.d.ts.map +1 -0
  139. package/mcp-server/tools/auditsCreateCustomControl.js +64 -0
  140. package/mcp-server/tools/auditsCreateCustomControl.js.map +1 -0
  141. package/mcp-server/tools/auditsCreateCustomEvidenceRequest.d.ts +8 -0
  142. package/mcp-server/tools/auditsCreateCustomEvidenceRequest.d.ts.map +1 -0
  143. package/mcp-server/tools/auditsCreateCustomEvidenceRequest.js +64 -0
  144. package/mcp-server/tools/auditsCreateCustomEvidenceRequest.js.map +1 -0
  145. package/mcp-server/tools/auditsGetEvidenceUrls.d.ts +8 -0
  146. package/mcp-server/tools/auditsGetEvidenceUrls.d.ts.map +1 -0
  147. package/mcp-server/tools/auditsGetEvidenceUrls.js +65 -0
  148. package/mcp-server/tools/auditsGetEvidenceUrls.js.map +1 -0
  149. package/mcp-server/tools/auditsList.d.ts +8 -0
  150. package/mcp-server/tools/auditsList.d.ts.map +1 -0
  151. package/mcp-server/tools/auditsList.js +64 -0
  152. package/mcp-server/tools/auditsList.js.map +1 -0
  153. package/mcp-server/tools/auditsListComments.d.ts +8 -0
  154. package/mcp-server/tools/auditsListComments.d.ts.map +1 -0
  155. package/mcp-server/tools/auditsListComments.js +64 -0
  156. package/mcp-server/tools/auditsListComments.js.map +1 -0
  157. package/mcp-server/tools/auditsListControls.d.ts +8 -0
  158. package/mcp-server/tools/auditsListControls.d.ts.map +1 -0
  159. package/mcp-server/tools/auditsListControls.js +64 -0
  160. package/mcp-server/tools/auditsListControls.js.map +1 -0
  161. package/mcp-server/tools/auditsListEvidence.d.ts +8 -0
  162. package/mcp-server/tools/auditsListEvidence.d.ts.map +1 -0
  163. package/mcp-server/tools/auditsListEvidence.js +64 -0
  164. package/mcp-server/tools/auditsListEvidence.js.map +1 -0
  165. package/mcp-server/tools/auditsUpdateEvidence.d.ts +8 -0
  166. package/mcp-server/tools/auditsUpdateEvidence.d.ts.map +1 -0
  167. package/mcp-server/tools/auditsUpdateEvidence.js +64 -0
  168. package/mcp-server/tools/auditsUpdateEvidence.js.map +1 -0
  169. package/mcp-server/tools.d.ts +25 -0
  170. package/mcp-server/tools.d.ts.map +1 -0
  171. package/mcp-server/tools.js +82 -0
  172. package/mcp-server/tools.js.map +1 -0
  173. package/models/components/auditorcontrol.d.ts +14 -2
  174. package/models/components/auditorcontrol.d.ts.map +1 -1
  175. package/models/components/auditorcontrol.js +8 -2
  176. package/models/components/auditorcontrol.js.map +1 -1
  177. package/models/components/auditorenabledstatetransition.d.ts +3 -0
  178. package/models/components/auditorenabledstatetransition.d.ts.map +1 -1
  179. package/models/components/auditorenabledstatetransition.js +1 -0
  180. package/models/components/auditorenabledstatetransition.js.map +1 -1
  181. package/models/components/comment.d.ts +5 -0
  182. package/models/components/comment.d.ts.map +1 -1
  183. package/models/components/comment.js +2 -0
  184. package/models/components/comment.js.map +1 -1
  185. package/models/components/control.d.ts +8 -2
  186. package/models/components/control.d.ts.map +1 -1
  187. package/models/components/control.js +5 -2
  188. package/models/components/control.js.map +1 -1
  189. package/models/components/createcustomevidencerequestinput.d.ts +5 -0
  190. package/models/components/createcustomevidencerequestinput.d.ts.map +1 -1
  191. package/models/components/createcustomevidencerequestinput.js +2 -0
  192. package/models/components/createcustomevidencerequestinput.js.map +1 -1
  193. package/models/components/customfield.d.ts +52 -0
  194. package/models/components/customfield.d.ts.map +1 -0
  195. package/models/components/customfield.js +95 -0
  196. package/models/components/customfield.js.map +1 -0
  197. package/models/components/index.d.ts +2 -0
  198. package/models/components/index.d.ts.map +1 -1
  199. package/models/components/index.js +2 -0
  200. package/models/components/index.js.map +1 -1
  201. package/models/components/section.d.ts +37 -0
  202. package/models/components/section.d.ts.map +1 -0
  203. package/models/components/section.js +71 -0
  204. package/models/components/section.js.map +1 -0
  205. package/package.json +25 -8
  206. package/sdk/audits.d.ts +2 -1
  207. package/sdk/audits.d.ts.map +1 -1
  208. package/sdk/audits.js +2 -1
  209. package/sdk/audits.js.map +1 -1
  210. package/src/funcs/auditorsCreate.ts +40 -10
  211. package/src/funcs/auditsCreateCommentForEvidence.ts +40 -10
  212. package/src/funcs/auditsCreateCustomControl.ts +40 -10
  213. package/src/funcs/auditsCreateCustomEvidenceRequest.ts +40 -10
  214. package/src/funcs/auditsGetEvidenceUrls.ts +42 -11
  215. package/src/funcs/auditsList.ts +40 -10
  216. package/src/funcs/auditsListComments.ts +40 -10
  217. package/src/funcs/auditsListControls.ts +40 -10
  218. package/src/funcs/auditsListEvidence.ts +40 -10
  219. package/src/funcs/auditsUpdateEvidence.ts +40 -10
  220. package/src/hooks/types.ts +2 -1
  221. package/src/lib/config.ts +17 -6
  222. package/src/lib/encodings.ts +95 -61
  223. package/src/lib/files.ts +1 -1
  224. package/src/lib/matchers.ts +20 -0
  225. package/src/lib/primitives.ts +28 -0
  226. package/src/lib/retries.ts +0 -1
  227. package/src/lib/schemas.ts +5 -0
  228. package/src/lib/sdks.ts +15 -11
  229. package/src/lib/security.ts +10 -3
  230. package/src/mcp-server/cli/start/command.ts +107 -0
  231. package/src/mcp-server/cli/start/impl.ts +134 -0
  232. package/src/mcp-server/cli.ts +13 -0
  233. package/src/mcp-server/console-logger.ts +71 -0
  234. package/src/mcp-server/extensions.ts +17 -0
  235. package/src/mcp-server/mcp-server.ts +26 -0
  236. package/src/mcp-server/prompts.ts +117 -0
  237. package/src/mcp-server/resources.ts +172 -0
  238. package/src/mcp-server/scopes.ts +7 -0
  239. package/src/mcp-server/server.ts +79 -0
  240. package/src/mcp-server/shared.ts +75 -0
  241. package/src/mcp-server/tools/auditorsCreate.ts +37 -0
  242. package/src/mcp-server/tools/auditsCreateCommentForEvidence.ts +38 -0
  243. package/src/mcp-server/tools/auditsCreateCustomControl.ts +37 -0
  244. package/src/mcp-server/tools/auditsCreateCustomEvidenceRequest.ts +39 -0
  245. package/src/mcp-server/tools/auditsGetEvidenceUrls.ts +38 -0
  246. package/src/mcp-server/tools/auditsList.ts +37 -0
  247. package/src/mcp-server/tools/auditsListComments.ts +37 -0
  248. package/src/mcp-server/tools/auditsListControls.ts +37 -0
  249. package/src/mcp-server/tools/auditsListEvidence.ts +37 -0
  250. package/src/mcp-server/tools/auditsUpdateEvidence.ts +37 -0
  251. package/src/mcp-server/tools.ts +129 -0
  252. package/src/models/components/auditorcontrol.ts +30 -4
  253. package/src/models/components/auditorenabledstatetransition.ts +1 -0
  254. package/src/models/components/comment.ts +9 -0
  255. package/src/models/components/control.ts +17 -4
  256. package/src/models/components/createcustomevidencerequestinput.ts +7 -0
  257. package/src/models/components/customfield.ts +109 -0
  258. package/src/models/components/index.ts +2 -0
  259. package/src/models/components/section.ts +69 -0
  260. package/src/sdk/audits.ts +2 -1
  261. package/src/types/async.ts +68 -0
  262. package/tsconfig.json +41 -0
  263. package/types/async.d.ts +23 -0
  264. package/types/async.d.ts.map +1 -0
  265. package/types/async.js +44 -0
  266. package/types/async.js.map +1 -0
@@ -11,6 +11,18 @@ import {
11
11
  ControlSource$inboundSchema,
12
12
  ControlSource$outboundSchema,
13
13
  } from "./controlsource.js";
14
+ import {
15
+ CustomField,
16
+ CustomField$inboundSchema,
17
+ CustomField$Outbound,
18
+ CustomField$outboundSchema,
19
+ } from "./customfield.js";
20
+ import {
21
+ Section,
22
+ Section$inboundSchema,
23
+ Section$Outbound,
24
+ Section$outboundSchema,
25
+ } from "./section.js";
14
26
 
15
27
  /**
16
28
  * The control's owner.
@@ -59,11 +71,19 @@ export type AuditorControl = {
59
71
  /**
60
72
  * The control's GDPR role, if the control is a GDPR control.
61
73
  */
62
- role?: string | undefined;
74
+ role?: string | null | undefined;
75
+ /**
76
+ * The control's custom field values, if control custom fields is included in your Vanta instance.
77
+ */
78
+ customFields: Array<CustomField>;
63
79
  /**
64
80
  * The report standard framework fulfilled by the control.
65
81
  */
66
82
  framework: string;
83
+ /**
84
+ * Sections of a framework that this control satisfies
85
+ */
86
+ sections: Array<Section>;
67
87
  };
68
88
 
69
89
  /** @internal */
@@ -132,8 +152,10 @@ export const AuditorControl$inboundSchema: z.ZodType<
132
152
  source: ControlSource$inboundSchema,
133
153
  domains: z.array(z.string()),
134
154
  owner: z.nullable(z.lazy(() => Owner$inboundSchema)),
135
- role: z.string().optional(),
155
+ role: z.nullable(z.string()).optional(),
156
+ customFields: z.array(CustomField$inboundSchema),
136
157
  framework: z.string(),
158
+ sections: z.array(Section$inboundSchema),
137
159
  });
138
160
 
139
161
  /** @internal */
@@ -145,8 +167,10 @@ export type AuditorControl$Outbound = {
145
167
  source: string;
146
168
  domains: Array<string>;
147
169
  owner: Owner$Outbound | null;
148
- role?: string | undefined;
170
+ role?: string | null | undefined;
171
+ customFields: Array<CustomField$Outbound>;
149
172
  framework: string;
173
+ sections: Array<Section$Outbound>;
150
174
  };
151
175
 
152
176
  /** @internal */
@@ -162,8 +186,10 @@ export const AuditorControl$outboundSchema: z.ZodType<
162
186
  source: ControlSource$outboundSchema,
163
187
  domains: z.array(z.string()),
164
188
  owner: z.nullable(z.lazy(() => Owner$outboundSchema)),
165
- role: z.string().optional(),
189
+ role: z.nullable(z.string()).optional(),
190
+ customFields: z.array(CustomField$outboundSchema),
166
191
  framework: z.string(),
192
+ sections: z.array(Section$outboundSchema),
167
193
  });
168
194
 
169
195
  /**
@@ -10,6 +10,7 @@ export const AuditorEnabledStateTransition = {
10
10
  MarkApplicable: "MARK_APPLICABLE",
11
11
  Flag: "FLAG",
12
12
  MarkNa: "MARK_NA",
13
+ ReadyForAudit: "READY_FOR_AUDIT",
13
14
  } as const;
14
15
  export type AuditorEnabledStateTransition = ClosedEnum<
15
16
  typeof AuditorEnabledStateTransition
@@ -28,6 +28,10 @@ export type Comment = {
28
28
  * When the comment was updated
29
29
  */
30
30
  modificationDate: Date | null;
31
+ /**
32
+ * When the comment was deleted
33
+ */
34
+ deletionDate: Date | null;
31
35
  /**
32
36
  * The email of the comment author. This acts as a unique identifier to map users between Vanta and external systems.
33
37
  */
@@ -46,6 +50,9 @@ export const Comment$inboundSchema: z.ZodType<Comment, z.ZodTypeDef, unknown> =
46
50
  modificationDate: z.nullable(
47
51
  z.string().datetime({ offset: true }).transform(v => new Date(v)),
48
52
  ),
53
+ deletionDate: z.nullable(
54
+ z.string().datetime({ offset: true }).transform(v => new Date(v)),
55
+ ),
49
56
  email: z.nullable(z.string()),
50
57
  });
51
58
 
@@ -56,6 +63,7 @@ export type Comment$Outbound = {
56
63
  text: string;
57
64
  creationDate: string;
58
65
  modificationDate: string | null;
66
+ deletionDate: string | null;
59
67
  email: string | null;
60
68
  };
61
69
 
@@ -70,6 +78,7 @@ export const Comment$outboundSchema: z.ZodType<
70
78
  text: z.string(),
71
79
  creationDate: z.date().transform(v => v.toISOString()),
72
80
  modificationDate: z.nullable(z.date().transform(v => v.toISOString())),
81
+ deletionDate: z.nullable(z.date().transform(v => v.toISOString())),
73
82
  email: z.nullable(z.string()),
74
83
  });
75
84
 
@@ -11,6 +11,12 @@ import {
11
11
  ControlSource$inboundSchema,
12
12
  ControlSource$outboundSchema,
13
13
  } from "./controlsource.js";
14
+ import {
15
+ CustomField,
16
+ CustomField$inboundSchema,
17
+ CustomField$Outbound,
18
+ CustomField$outboundSchema,
19
+ } from "./customfield.js";
14
20
 
15
21
  /**
16
22
  * The control's owner.
@@ -59,7 +65,11 @@ export type Control = {
59
65
  /**
60
66
  * The control's GDPR role, if the control is a GDPR control.
61
67
  */
62
- role?: string | undefined;
68
+ role?: string | null | undefined;
69
+ /**
70
+ * The control's custom field values, if control custom fields is included in your Vanta instance.
71
+ */
72
+ customFields: Array<CustomField>;
63
73
  };
64
74
 
65
75
  /** @internal */
@@ -128,7 +138,8 @@ export const Control$inboundSchema: z.ZodType<Control, z.ZodTypeDef, unknown> =
128
138
  source: ControlSource$inboundSchema,
129
139
  domains: z.array(z.string()),
130
140
  owner: z.nullable(z.lazy(() => ControlOwner$inboundSchema)),
131
- role: z.string().optional(),
141
+ role: z.nullable(z.string()).optional(),
142
+ customFields: z.array(CustomField$inboundSchema),
132
143
  });
133
144
 
134
145
  /** @internal */
@@ -140,7 +151,8 @@ export type Control$Outbound = {
140
151
  source: string;
141
152
  domains: Array<string>;
142
153
  owner: ControlOwner$Outbound | null;
143
- role?: string | undefined;
154
+ role?: string | null | undefined;
155
+ customFields: Array<CustomField$Outbound>;
144
156
  };
145
157
 
146
158
  /** @internal */
@@ -156,7 +168,8 @@ export const Control$outboundSchema: z.ZodType<
156
168
  source: ControlSource$outboundSchema,
157
169
  domains: z.array(z.string()),
158
170
  owner: z.nullable(z.lazy(() => ControlOwner$outboundSchema)),
159
- role: z.string().optional(),
171
+ role: z.nullable(z.string()).optional(),
172
+ customFields: z.array(CustomField$outboundSchema),
160
173
  });
161
174
 
162
175
  /**
@@ -31,6 +31,10 @@ export type CreateCustomEvidenceRequestInput = {
31
31
  * Whether this document contains sensitive data and needs more restrictive read access
32
32
  */
33
33
  isRestricted: boolean;
34
+ /**
35
+ * Email of the auditor who created the custom evidence request.
36
+ */
37
+ auditorEmail: string;
34
38
  };
35
39
 
36
40
  /** @internal */
@@ -45,6 +49,7 @@ export const CreateCustomEvidenceRequestInput$inboundSchema: z.ZodType<
45
49
  cadence: RecurrenceDuration$inboundSchema,
46
50
  reminderWindow: RecurrenceDuration$inboundSchema,
47
51
  isRestricted: z.boolean(),
52
+ auditorEmail: z.string(),
48
53
  });
49
54
 
50
55
  /** @internal */
@@ -55,6 +60,7 @@ export type CreateCustomEvidenceRequestInput$Outbound = {
55
60
  cadence: string;
56
61
  reminderWindow: string;
57
62
  isRestricted: boolean;
63
+ auditorEmail: string;
58
64
  };
59
65
 
60
66
  /** @internal */
@@ -69,6 +75,7 @@ export const CreateCustomEvidenceRequestInput$outboundSchema: z.ZodType<
69
75
  cadence: RecurrenceDuration$outboundSchema,
70
76
  reminderWindow: RecurrenceDuration$outboundSchema,
71
77
  isRestricted: z.boolean(),
78
+ auditorEmail: z.string(),
72
79
  });
73
80
 
74
81
  /**
@@ -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
+ }
@@ -18,6 +18,7 @@ export * from "./controlsource.js";
18
18
  export * from "./createcustomcontrolinput.js";
19
19
  export * from "./createcustomevidencerequestinput.js";
20
20
  export * from "./customevidencerequest.js";
21
+ export * from "./customfield.js";
21
22
  export * from "./evidence.js";
22
23
  export * from "./evidencecontrol.js";
23
24
  export * from "./evidenceurl.js";
@@ -30,4 +31,5 @@ export * from "./paginatedresponsecomment.js";
30
31
  export * from "./paginatedresponseevidence.js";
31
32
  export * from "./paginatedresponseevidenceurl.js";
32
33
  export * from "./recurrenceduration.js";
34
+ export * from "./section.js";
33
35
  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
+ }
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
+ }
@@ -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"}