vanta-auditor-api-sdk 0.6.1 → 0.6.3

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 (275) hide show
  1. package/README.md +21 -1
  2. package/docs/sdks/audits/README.md +760 -1
  3. package/funcs/auditsList.js +10 -0
  4. package/funcs/auditsList.js.map +1 -1
  5. package/funcs/auditsListAccountAccessServices.d.ts +33 -0
  6. package/funcs/auditsListAccountAccessServices.d.ts.map +1 -0
  7. package/funcs/auditsListAccountAccessServices.js +141 -0
  8. package/funcs/auditsListAccountAccessServices.js.map +1 -0
  9. package/funcs/auditsListAuditIssues.d.ts +3 -1
  10. package/funcs/auditsListAuditIssues.d.ts.map +1 -1
  11. package/funcs/auditsListAuditIssues.js +5 -1
  12. package/funcs/auditsListAuditIssues.js.map +1 -1
  13. package/funcs/auditsListAuditRisks.d.ts +37 -0
  14. package/funcs/auditsListAuditRisks.d.ts.map +1 -0
  15. package/funcs/auditsListAuditRisks.js +152 -0
  16. package/funcs/auditsListAuditRisks.js.map +1 -0
  17. package/funcs/auditsListCodeChanges.d.ts +34 -0
  18. package/funcs/auditsListCodeChanges.d.ts.map +1 -0
  19. package/funcs/auditsListCodeChanges.js +146 -0
  20. package/funcs/auditsListCodeChanges.js.map +1 -0
  21. package/funcs/auditsListPersonnelAccountAccess.d.ts +58 -0
  22. package/funcs/auditsListPersonnelAccountAccess.d.ts.map +1 -0
  23. package/funcs/auditsListPersonnelAccountAccess.js +172 -0
  24. package/funcs/auditsListPersonnelAccountAccess.js.map +1 -0
  25. package/funcs/auditsListPersonnelGroups.d.ts +39 -0
  26. package/funcs/auditsListPersonnelGroups.d.ts.map +1 -0
  27. package/funcs/auditsListPersonnelGroups.js +151 -0
  28. package/funcs/auditsListPersonnelGroups.js.map +1 -0
  29. package/funcs/auditsListPersonnelPeople.d.ts +36 -0
  30. package/funcs/auditsListPersonnelPeople.d.ts.map +1 -0
  31. package/funcs/auditsListPersonnelPeople.js +149 -0
  32. package/funcs/auditsListPersonnelPeople.js.map +1 -0
  33. package/funcs/auditsListRiskSnapshots.d.ts +32 -0
  34. package/funcs/auditsListRiskSnapshots.d.ts.map +1 -0
  35. package/funcs/auditsListRiskSnapshots.js +140 -0
  36. package/funcs/auditsListRiskSnapshots.js.map +1 -0
  37. package/funcs/auditsListVendors.d.ts +35 -0
  38. package/funcs/auditsListVendors.d.ts.map +1 -0
  39. package/funcs/auditsListVendors.js +148 -0
  40. package/funcs/auditsListVendors.js.map +1 -0
  41. package/jsr.json +1 -1
  42. package/lib/config.d.ts +3 -3
  43. package/lib/config.js +3 -3
  44. package/lib/config.js.map +1 -1
  45. package/models/components/accountaccess.d.ts +64 -0
  46. package/models/components/accountaccess.d.ts.map +1 -0
  47. package/models/components/accountaccess.js +58 -0
  48. package/models/components/accountaccess.js.map +1 -0
  49. package/models/components/accountaccessservice.d.ts +36 -0
  50. package/models/components/accountaccessservice.d.ts.map +1 -0
  51. package/models/components/accountaccessservice.js +53 -0
  52. package/models/components/accountaccessservice.js.map +1 -0
  53. package/models/components/accountaccessstatus.d.ts +25 -0
  54. package/models/components/accountaccessstatus.d.ts.map +1 -0
  55. package/models/components/accountaccessstatus.js +56 -0
  56. package/models/components/accountaccessstatus.js.map +1 -0
  57. package/models/components/apicodechangesource.d.ts +18 -0
  58. package/models/components/apicodechangesource.d.ts.map +1 -0
  59. package/models/components/apicodechangesource.js +52 -0
  60. package/models/components/apicodechangesource.js.map +1 -0
  61. package/models/components/auditrisk.d.ts +153 -0
  62. package/models/components/auditrisk.d.ts.map +1 -0
  63. package/models/components/auditrisk.js +108 -0
  64. package/models/components/auditrisk.js.map +1 -0
  65. package/models/components/auditriskcia.d.ts +17 -0
  66. package/models/components/auditriskcia.d.ts.map +1 -0
  67. package/models/components/auditriskcia.js +51 -0
  68. package/models/components/auditriskcia.js.map +1 -0
  69. package/models/components/auditvendor.d.ts +96 -0
  70. package/models/components/auditvendor.d.ts.map +1 -0
  71. package/models/components/auditvendor.js +86 -0
  72. package/models/components/auditvendor.js.map +1 -0
  73. package/models/components/auditvendorrisklevel.d.ts +15 -0
  74. package/models/components/auditvendorrisklevel.d.ts.map +1 -0
  75. package/models/components/auditvendorrisklevel.js +52 -0
  76. package/models/components/auditvendorrisklevel.js.map +1 -0
  77. package/models/components/auditvendorstatus.d.ts +13 -0
  78. package/models/components/auditvendorstatus.d.ts.map +1 -0
  79. package/models/components/auditvendorstatus.js +50 -0
  80. package/models/components/auditvendorstatus.js.map +1 -0
  81. package/models/components/codechange.d.ts +50 -0
  82. package/models/components/codechange.d.ts.map +1 -0
  83. package/models/components/codechange.js +58 -0
  84. package/models/components/codechange.js.map +1 -0
  85. package/models/components/grouporderby.d.ts +13 -0
  86. package/models/components/grouporderby.d.ts.map +1 -0
  87. package/models/components/grouporderby.js +50 -0
  88. package/models/components/grouporderby.js.map +1 -0
  89. package/models/components/index.d.ts +31 -0
  90. package/models/components/index.d.ts.map +1 -1
  91. package/models/components/index.js +31 -0
  92. package/models/components/index.js.map +1 -1
  93. package/models/components/issuesnapshotitemorderby.d.ts +16 -0
  94. package/models/components/issuesnapshotitemorderby.d.ts.map +1 -0
  95. package/models/components/issuesnapshotitemorderby.js +50 -0
  96. package/models/components/issuesnapshotitemorderby.js.map +1 -0
  97. package/models/components/orderdirection.d.ts +16 -0
  98. package/models/components/orderdirection.d.ts.map +1 -0
  99. package/models/components/orderdirection.js +50 -0
  100. package/models/components/orderdirection.js.map +1 -0
  101. package/models/components/paginatedresponseaccountaccess.d.ts +22 -0
  102. package/models/components/paginatedresponseaccountaccess.d.ts.map +1 -0
  103. package/models/components/paginatedresponseaccountaccess.js +61 -0
  104. package/models/components/paginatedresponseaccountaccess.js.map +1 -0
  105. package/models/components/paginatedresponseaccountaccessservice.d.ts +22 -0
  106. package/models/components/paginatedresponseaccountaccessservice.d.ts.map +1 -0
  107. package/models/components/paginatedresponseaccountaccessservice.js +61 -0
  108. package/models/components/paginatedresponseaccountaccessservice.js.map +1 -0
  109. package/models/components/paginatedresponseauditrisk.d.ts +22 -0
  110. package/models/components/paginatedresponseauditrisk.d.ts.map +1 -0
  111. package/models/components/paginatedresponseauditrisk.js +61 -0
  112. package/models/components/paginatedresponseauditrisk.js.map +1 -0
  113. package/models/components/paginatedresponseauditvendor.d.ts +22 -0
  114. package/models/components/paginatedresponseauditvendor.d.ts.map +1 -0
  115. package/models/components/paginatedresponseauditvendor.js +61 -0
  116. package/models/components/paginatedresponseauditvendor.js.map +1 -0
  117. package/models/components/paginatedresponsecodechange.d.ts +22 -0
  118. package/models/components/paginatedresponsecodechange.d.ts.map +1 -0
  119. package/models/components/paginatedresponsecodechange.js +61 -0
  120. package/models/components/paginatedresponsecodechange.js.map +1 -0
  121. package/models/components/paginatedresponsepersonnelgroup.d.ts +22 -0
  122. package/models/components/paginatedresponsepersonnelgroup.d.ts.map +1 -0
  123. package/models/components/paginatedresponsepersonnelgroup.js +61 -0
  124. package/models/components/paginatedresponsepersonnelgroup.js.map +1 -0
  125. package/models/components/paginatedresponsepersonnelperson.d.ts +22 -0
  126. package/models/components/paginatedresponsepersonnelperson.d.ts.map +1 -0
  127. package/models/components/paginatedresponsepersonnelperson.js +61 -0
  128. package/models/components/paginatedresponsepersonnelperson.js.map +1 -0
  129. package/models/components/paginatedresponserisksnapshot.d.ts +22 -0
  130. package/models/components/paginatedresponserisksnapshot.d.ts.map +1 -0
  131. package/models/components/paginatedresponserisksnapshot.js +61 -0
  132. package/models/components/paginatedresponserisksnapshot.js.map +1 -0
  133. package/models/components/peopleemploymentstatus.d.ts +20 -0
  134. package/models/components/peopleemploymentstatus.d.ts.map +1 -0
  135. package/models/components/peopleemploymentstatus.js +54 -0
  136. package/models/components/peopleemploymentstatus.js.map +1 -0
  137. package/models/components/peopleorderby.d.ts +10 -0
  138. package/models/components/peopleorderby.d.ts.map +1 -0
  139. package/models/components/peopleorderby.js +47 -0
  140. package/models/components/peopleorderby.js.map +1 -0
  141. package/models/components/peoplesecuritytaskstatus.d.ts +18 -0
  142. package/models/components/peoplesecuritytaskstatus.d.ts.map +1 -0
  143. package/models/components/peoplesecuritytaskstatus.js +52 -0
  144. package/models/components/peoplesecuritytaskstatus.js.map +1 -0
  145. package/models/components/peopletaskstatus.d.ts +22 -0
  146. package/models/components/peopletaskstatus.d.ts.map +1 -0
  147. package/models/components/peopletaskstatus.js +56 -0
  148. package/models/components/peopletaskstatus.js.map +1 -0
  149. package/models/components/personnelgroup.d.ts +54 -0
  150. package/models/components/personnelgroup.d.ts.map +1 -0
  151. package/models/components/personnelgroup.js +57 -0
  152. package/models/components/personnelgroup.js.map +1 -0
  153. package/models/components/personnelgrouptask.d.ts +16 -0
  154. package/models/components/personnelgrouptask.d.ts.map +1 -0
  155. package/models/components/personnelgrouptask.js +50 -0
  156. package/models/components/personnelgrouptask.js.map +1 -0
  157. package/models/components/personnelperson.d.ts +338 -0
  158. package/models/components/personnelperson.d.ts.map +1 -0
  159. package/models/components/personnelperson.js +177 -0
  160. package/models/components/personnelperson.js.map +1 -0
  161. package/models/components/riskorderby.d.ts +18 -0
  162. package/models/components/riskorderby.d.ts.map +1 -0
  163. package/models/components/riskorderby.js +56 -0
  164. package/models/components/riskorderby.js.map +1 -0
  165. package/models/components/risksnapshot.d.ts +26 -0
  166. package/models/components/risksnapshot.d.ts.map +1 -0
  167. package/models/components/risksnapshot.js +51 -0
  168. package/models/components/risksnapshot.js.map +1 -0
  169. package/models/components/vendororderby.d.ts +10 -0
  170. package/models/components/vendororderby.d.ts.map +1 -0
  171. package/models/components/vendororderby.js +47 -0
  172. package/models/components/vendororderby.js.map +1 -0
  173. package/models/operations/index.d.ts +8 -0
  174. package/models/operations/index.d.ts.map +1 -1
  175. package/models/operations/index.js +8 -0
  176. package/models/operations/index.js.map +1 -1
  177. package/models/operations/listaccountaccessservices.d.ts +25 -0
  178. package/models/operations/listaccountaccessservices.d.ts.map +1 -0
  179. package/models/operations/listaccountaccessservices.js +51 -0
  180. package/models/operations/listaccountaccessservices.js.map +1 -0
  181. package/models/operations/listauditissues.d.ts +11 -0
  182. package/models/operations/listauditissues.d.ts.map +1 -1
  183. package/models/operations/listauditissues.js +3 -0
  184. package/models/operations/listauditissues.js.map +1 -1
  185. package/models/operations/listauditrisks.d.ts +46 -0
  186. package/models/operations/listauditrisks.d.ts.map +1 -0
  187. package/models/operations/listauditrisks.js +56 -0
  188. package/models/operations/listauditrisks.js.map +1 -0
  189. package/models/operations/listcodechanges.d.ts +46 -0
  190. package/models/operations/listcodechanges.d.ts.map +1 -0
  191. package/models/operations/listcodechanges.js +57 -0
  192. package/models/operations/listcodechanges.js.map +1 -0
  193. package/models/operations/listpersonnelaccountaccess.d.ts +41 -0
  194. package/models/operations/listpersonnelaccountaccess.d.ts.map +1 -0
  195. package/models/operations/listpersonnelaccountaccess.js +55 -0
  196. package/models/operations/listpersonnelaccountaccess.js.map +1 -0
  197. package/models/operations/listpersonnelgroups.d.ts +46 -0
  198. package/models/operations/listpersonnelgroups.d.ts.map +1 -0
  199. package/models/operations/listpersonnelgroups.js +56 -0
  200. package/models/operations/listpersonnelgroups.js.map +1 -0
  201. package/models/operations/listpersonnelpeople.d.ts +51 -0
  202. package/models/operations/listpersonnelpeople.d.ts.map +1 -0
  203. package/models/operations/listpersonnelpeople.js +57 -0
  204. package/models/operations/listpersonnelpeople.js.map +1 -0
  205. package/models/operations/listrisksnapshots.d.ts +25 -0
  206. package/models/operations/listrisksnapshots.d.ts.map +1 -0
  207. package/models/operations/listrisksnapshots.js +51 -0
  208. package/models/operations/listrisksnapshots.js.map +1 -0
  209. package/models/operations/listvendors.d.ts +51 -0
  210. package/models/operations/listvendors.d.ts.map +1 -0
  211. package/models/operations/listvendors.js +58 -0
  212. package/models/operations/listvendors.js.map +1 -0
  213. package/package.json +1 -1
  214. package/sdk/audits.d.ts +219 -1
  215. package/sdk/audits.d.ts.map +1 -1
  216. package/sdk/audits.js +243 -1
  217. package/sdk/audits.js.map +1 -1
  218. package/src/funcs/auditsList.ts +10 -0
  219. package/src/funcs/auditsListAccountAccessServices.ts +192 -0
  220. package/src/funcs/auditsListAuditIssues.ts +5 -1
  221. package/src/funcs/auditsListAuditRisks.ts +200 -0
  222. package/src/funcs/auditsListCodeChanges.ts +194 -0
  223. package/src/funcs/auditsListPersonnelAccountAccess.ts +223 -0
  224. package/src/funcs/auditsListPersonnelGroups.ts +200 -0
  225. package/src/funcs/auditsListPersonnelPeople.ts +198 -0
  226. package/src/funcs/auditsListRiskSnapshots.ts +188 -0
  227. package/src/funcs/auditsListVendors.ts +196 -0
  228. package/src/lib/config.ts +3 -3
  229. package/src/models/components/accountaccess.ts +99 -0
  230. package/src/models/components/accountaccessservice.ts +60 -0
  231. package/src/models/components/accountaccessstatus.ts +34 -0
  232. package/src/models/components/apicodechangesource.ts +25 -0
  233. package/src/models/components/auditrisk.ts +216 -0
  234. package/src/models/components/auditriskcia.ts +23 -0
  235. package/src/models/components/auditvendor.ts +158 -0
  236. package/src/models/components/auditvendorrisklevel.ts +24 -0
  237. package/src/models/components/auditvendorstatus.ts +22 -0
  238. package/src/models/components/codechange.ts +79 -0
  239. package/src/models/components/grouporderby.ts +19 -0
  240. package/src/models/components/index.ts +31 -0
  241. package/src/models/components/issuesnapshotitemorderby.ts +25 -0
  242. package/src/models/components/orderdirection.ts +23 -0
  243. package/src/models/components/paginatedresponseaccountaccess.ts +62 -0
  244. package/src/models/components/paginatedresponseaccountaccessservice.ts +74 -0
  245. package/src/models/components/paginatedresponseauditrisk.ts +61 -0
  246. package/src/models/components/paginatedresponseauditvendor.ts +62 -0
  247. package/src/models/components/paginatedresponsecodechange.ts +62 -0
  248. package/src/models/components/paginatedresponsepersonnelgroup.ts +65 -0
  249. package/src/models/components/paginatedresponsepersonnelperson.ts +70 -0
  250. package/src/models/components/paginatedresponserisksnapshot.ts +62 -0
  251. package/src/models/components/peopleemploymentstatus.ts +27 -0
  252. package/src/models/components/peopleorderby.ts +17 -0
  253. package/src/models/components/peoplesecuritytaskstatus.ts +27 -0
  254. package/src/models/components/peopletaskstatus.ts +29 -0
  255. package/src/models/components/personnelgroup.ts +84 -0
  256. package/src/models/components/personnelgrouptask.ts +37 -0
  257. package/src/models/components/personnelperson.ts +554 -0
  258. package/src/models/components/riskorderby.ts +24 -0
  259. package/src/models/components/risksnapshot.ts +48 -0
  260. package/src/models/components/vendororderby.ts +17 -0
  261. package/src/models/operations/index.ts +8 -0
  262. package/src/models/operations/listaccountaccessservices.ts +48 -0
  263. package/src/models/operations/listauditissues.ts +13 -0
  264. package/src/models/operations/listauditrisks.ts +71 -0
  265. package/src/models/operations/listcodechanges.ts +72 -0
  266. package/src/models/operations/listpersonnelaccountaccess.ts +67 -0
  267. package/src/models/operations/listpersonnelgroups.ts +71 -0
  268. package/src/models/operations/listpersonnelpeople.ts +77 -0
  269. package/src/models/operations/listrisksnapshots.ts +46 -0
  270. package/src/models/operations/listvendors.ts +80 -0
  271. package/src/sdk/audits.ts +307 -1
  272. package/src/types/async.ts +8 -7
  273. package/types/async.d.ts.map +1 -1
  274. package/types/async.js +8 -7
  275. package/types/async.js.map +1 -1
@@ -0,0 +1,188 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { VantaCore } from "../core.js";
6
+ import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
7
+ import { matchStatusCode } from "../lib/http.js";
8
+ import * as M from "../lib/matchers.js";
9
+ import { compactMap } from "../lib/primitives.js";
10
+ import { safeParse } from "../lib/schemas.js";
11
+ import { RequestOptions } from "../lib/sdks.js";
12
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
13
+ import { pathToFunc } from "../lib/url.js";
14
+ import * as components from "../models/components/index.js";
15
+ import {
16
+ ConnectionError,
17
+ InvalidRequestError,
18
+ RequestAbortedError,
19
+ RequestTimeoutError,
20
+ UnexpectedClientError,
21
+ } from "../models/errors/httpclienterrors.js";
22
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
23
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
24
+ import { VantaError } from "../models/errors/vantaerror.js";
25
+ import * as operations from "../models/operations/index.js";
26
+ import { APICall, APIPromise } from "../types/async.js";
27
+ import { Result } from "../types/fp.js";
28
+
29
+ /**
30
+ * List risk snapshots for an audit
31
+ *
32
+ * @remarks
33
+ * Returns a paginated list of risk assessment snapshots available for an audit.
34
+ *
35
+ * Risk snapshots capture the state of an organization's risk register at a
36
+ * point in time. Each snapshot has an `id` that can be used with the
37
+ * `/audits/{auditId}/risks` endpoint to retrieve the individual risk
38
+ * scenarios within that snapshot.
39
+ *
40
+ * Results are sorted by creation date (newest first). This sort order is
41
+ * fixed and cannot be customized via query parameters. Only snapshots
42
+ * that are shared with auditors are included.
43
+ *
44
+ * Uses cursor-based pagination. To paginate:
45
+ * 1. Make initial request with desired `pageSize`
46
+ * 2. Check `results.pageInfo.hasNextPage`
47
+ * 3. Use `results.pageInfo.endCursor` as `pageCursor` for next request
48
+ */
49
+ export function auditsListRiskSnapshots(
50
+ client: VantaCore,
51
+ request: operations.ListRiskSnapshotsRequest,
52
+ options?: RequestOptions,
53
+ ): APIPromise<
54
+ Result<
55
+ components.PaginatedResponseRiskSnapshot,
56
+ | VantaError
57
+ | ResponseValidationError
58
+ | ConnectionError
59
+ | RequestAbortedError
60
+ | RequestTimeoutError
61
+ | InvalidRequestError
62
+ | UnexpectedClientError
63
+ | SDKValidationError
64
+ >
65
+ > {
66
+ return new APIPromise($do(
67
+ client,
68
+ request,
69
+ options,
70
+ ));
71
+ }
72
+
73
+ async function $do(
74
+ client: VantaCore,
75
+ request: operations.ListRiskSnapshotsRequest,
76
+ options?: RequestOptions,
77
+ ): Promise<
78
+ [
79
+ Result<
80
+ components.PaginatedResponseRiskSnapshot,
81
+ | VantaError
82
+ | ResponseValidationError
83
+ | ConnectionError
84
+ | RequestAbortedError
85
+ | RequestTimeoutError
86
+ | InvalidRequestError
87
+ | UnexpectedClientError
88
+ | SDKValidationError
89
+ >,
90
+ APICall,
91
+ ]
92
+ > {
93
+ const parsed = safeParse(
94
+ request,
95
+ (value) => operations.ListRiskSnapshotsRequest$outboundSchema.parse(value),
96
+ "Input validation failed",
97
+ );
98
+ if (!parsed.ok) {
99
+ return [parsed, { status: "invalid" }];
100
+ }
101
+ const payload = parsed.value;
102
+ const body = null;
103
+
104
+ const pathParams = {
105
+ auditId: encodeSimple("auditId", payload.auditId, {
106
+ explode: false,
107
+ charEncoding: "percent",
108
+ }),
109
+ };
110
+ const path = pathToFunc("/audits/{auditId}/risks/snapshots")(pathParams);
111
+
112
+ const query = encodeFormQuery({
113
+ "pageCursor": payload.pageCursor,
114
+ "pageSize": payload.pageSize,
115
+ });
116
+
117
+ const headers = new Headers(compactMap({
118
+ Accept: "application/json",
119
+ }));
120
+
121
+ const secConfig = await extractSecurity(client._options.bearerAuth);
122
+ const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
123
+ const requestSecurity = resolveGlobalSecurity(securityInput);
124
+
125
+ const context = {
126
+ options: client._options,
127
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
128
+ operationID: "ListRiskSnapshots",
129
+ oAuth2Scopes: null,
130
+
131
+ resolvedSecurity: requestSecurity,
132
+
133
+ securitySource: client._options.bearerAuth,
134
+ retryConfig: options?.retries
135
+ || client._options.retryConfig
136
+ || { strategy: "none" },
137
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
138
+ };
139
+
140
+ const requestRes = client._createRequest(context, {
141
+ security: requestSecurity,
142
+ method: "GET",
143
+ baseURL: options?.serverURL,
144
+ path: path,
145
+ headers: headers,
146
+ query: query,
147
+ body: body,
148
+ userAgent: client._options.userAgent,
149
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
150
+ }, options);
151
+ if (!requestRes.ok) {
152
+ return [requestRes, { status: "invalid" }];
153
+ }
154
+ const req = requestRes.value;
155
+
156
+ const doResult = await client._do(req, {
157
+ context,
158
+ isErrorStatusCode: (statusCode: number) =>
159
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
160
+ retryConfig: context.retryConfig,
161
+ retryCodes: context.retryCodes,
162
+ });
163
+ if (!doResult.ok) {
164
+ return [doResult, { status: "request-error", request: req }];
165
+ }
166
+ const response = doResult.value;
167
+
168
+ const [result] = await M.match<
169
+ components.PaginatedResponseRiskSnapshot,
170
+ | VantaError
171
+ | ResponseValidationError
172
+ | ConnectionError
173
+ | RequestAbortedError
174
+ | RequestTimeoutError
175
+ | InvalidRequestError
176
+ | UnexpectedClientError
177
+ | SDKValidationError
178
+ >(
179
+ M.json(200, components.PaginatedResponseRiskSnapshot$inboundSchema),
180
+ M.fail("4XX"),
181
+ M.fail("5XX"),
182
+ )(response, req);
183
+ if (!result.ok) {
184
+ return [result, { status: "complete", request: req, response }];
185
+ }
186
+
187
+ return [result, { status: "complete", request: req, response }];
188
+ }
@@ -0,0 +1,196 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { VantaCore } from "../core.js";
6
+ import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
7
+ import { matchStatusCode } from "../lib/http.js";
8
+ import * as M from "../lib/matchers.js";
9
+ import { compactMap } from "../lib/primitives.js";
10
+ import { safeParse } from "../lib/schemas.js";
11
+ import { RequestOptions } from "../lib/sdks.js";
12
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
13
+ import { pathToFunc } from "../lib/url.js";
14
+ import * as components from "../models/components/index.js";
15
+ import {
16
+ ConnectionError,
17
+ InvalidRequestError,
18
+ RequestAbortedError,
19
+ RequestTimeoutError,
20
+ UnexpectedClientError,
21
+ } from "../models/errors/httpclienterrors.js";
22
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
23
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
24
+ import { VantaError } from "../models/errors/vantaerror.js";
25
+ import * as operations from "../models/operations/index.js";
26
+ import { APICall, APIPromise } from "../types/async.js";
27
+ import { Result } from "../types/fp.js";
28
+
29
+ /**
30
+ * List vendors for an audit
31
+ *
32
+ * @remarks
33
+ * Retrieves vendor population data for an audit.
34
+ *
35
+ * This endpoint provides access to vendor records visible to auditors
36
+ * during an audit engagement.
37
+ *
38
+ * Supports filtering by:
39
+ * - `search`: Searches vendor names (case-insensitive)
40
+ * - `vendorStatusesMatchesAny`: Filters by vendor status (ACTIVE, ARCHIVED, IN_PROCUREMENT)
41
+ * - `inherentRiskMatchesAny`: Filters by inherent risk level
42
+ *
43
+ * Results are sorted by name (ascending) by default.
44
+ * Use `orderBy` and `orderDirection` to customize sorting.
45
+ * Sort parameters must remain consistent across paginated requests.
46
+ *
47
+ * Uses cursor-based pagination. To paginate:
48
+ * 1. Make initial request with desired `pageSize`
49
+ * 2. Check `results.pageInfo.hasNextPage`
50
+ * 3. Use `results.pageInfo.endCursor` as `pageCursor` for next request
51
+ */
52
+ export function auditsListVendors(
53
+ client: VantaCore,
54
+ request: operations.ListVendorsRequest,
55
+ options?: RequestOptions,
56
+ ): APIPromise<
57
+ Result<
58
+ components.PaginatedResponseAuditVendor,
59
+ | VantaError
60
+ | ResponseValidationError
61
+ | ConnectionError
62
+ | RequestAbortedError
63
+ | RequestTimeoutError
64
+ | InvalidRequestError
65
+ | UnexpectedClientError
66
+ | SDKValidationError
67
+ >
68
+ > {
69
+ return new APIPromise($do(
70
+ client,
71
+ request,
72
+ options,
73
+ ));
74
+ }
75
+
76
+ async function $do(
77
+ client: VantaCore,
78
+ request: operations.ListVendorsRequest,
79
+ options?: RequestOptions,
80
+ ): Promise<
81
+ [
82
+ Result<
83
+ components.PaginatedResponseAuditVendor,
84
+ | VantaError
85
+ | ResponseValidationError
86
+ | ConnectionError
87
+ | RequestAbortedError
88
+ | RequestTimeoutError
89
+ | InvalidRequestError
90
+ | UnexpectedClientError
91
+ | SDKValidationError
92
+ >,
93
+ APICall,
94
+ ]
95
+ > {
96
+ const parsed = safeParse(
97
+ request,
98
+ (value) => operations.ListVendorsRequest$outboundSchema.parse(value),
99
+ "Input validation failed",
100
+ );
101
+ if (!parsed.ok) {
102
+ return [parsed, { status: "invalid" }];
103
+ }
104
+ const payload = parsed.value;
105
+ const body = null;
106
+
107
+ const pathParams = {
108
+ auditId: encodeSimple("auditId", payload.auditId, {
109
+ explode: false,
110
+ charEncoding: "percent",
111
+ }),
112
+ };
113
+ const path = pathToFunc("/audits/{auditId}/managed-vendors")(pathParams);
114
+
115
+ const query = encodeFormQuery({
116
+ "inherentRiskMatchesAny": payload.inherentRiskMatchesAny,
117
+ "orderBy": payload.orderBy,
118
+ "orderDirection": payload.orderDirection,
119
+ "pageCursor": payload.pageCursor,
120
+ "pageSize": payload.pageSize,
121
+ "search": payload.search,
122
+ "vendorStatusesMatchesAny": payload.vendorStatusesMatchesAny,
123
+ });
124
+
125
+ const headers = new Headers(compactMap({
126
+ Accept: "application/json",
127
+ }));
128
+
129
+ const secConfig = await extractSecurity(client._options.bearerAuth);
130
+ const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
131
+ const requestSecurity = resolveGlobalSecurity(securityInput);
132
+
133
+ const context = {
134
+ options: client._options,
135
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
136
+ operationID: "ListVendors",
137
+ oAuth2Scopes: null,
138
+
139
+ resolvedSecurity: requestSecurity,
140
+
141
+ securitySource: client._options.bearerAuth,
142
+ retryConfig: options?.retries
143
+ || client._options.retryConfig
144
+ || { strategy: "none" },
145
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
146
+ };
147
+
148
+ const requestRes = client._createRequest(context, {
149
+ security: requestSecurity,
150
+ method: "GET",
151
+ baseURL: options?.serverURL,
152
+ path: path,
153
+ headers: headers,
154
+ query: query,
155
+ body: body,
156
+ userAgent: client._options.userAgent,
157
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
158
+ }, options);
159
+ if (!requestRes.ok) {
160
+ return [requestRes, { status: "invalid" }];
161
+ }
162
+ const req = requestRes.value;
163
+
164
+ const doResult = await client._do(req, {
165
+ context,
166
+ isErrorStatusCode: (statusCode: number) =>
167
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
168
+ retryConfig: context.retryConfig,
169
+ retryCodes: context.retryCodes,
170
+ });
171
+ if (!doResult.ok) {
172
+ return [doResult, { status: "request-error", request: req }];
173
+ }
174
+ const response = doResult.value;
175
+
176
+ const [result] = await M.match<
177
+ components.PaginatedResponseAuditVendor,
178
+ | VantaError
179
+ | ResponseValidationError
180
+ | ConnectionError
181
+ | RequestAbortedError
182
+ | RequestTimeoutError
183
+ | InvalidRequestError
184
+ | UnexpectedClientError
185
+ | SDKValidationError
186
+ >(
187
+ M.json(200, components.PaginatedResponseAuditVendor$inboundSchema),
188
+ M.fail("4XX"),
189
+ M.fail("5XX"),
190
+ )(response, req);
191
+ if (!result.ok) {
192
+ return [result, { status: "complete", request: req, response }];
193
+ }
194
+
195
+ return [result, { status: "complete", request: req, response }];
196
+ }
package/src/lib/config.ts CHANGED
@@ -65,8 +65,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
65
65
  export const SDK_METADATA = {
66
66
  language: "typescript",
67
67
  openapiDocVersion: "1.0.0",
68
- sdkVersion: "0.6.1",
69
- genVersion: "2.884.4",
68
+ sdkVersion: "0.6.3",
69
+ genVersion: "2.884.13",
70
70
  userAgent:
71
- "speakeasy-sdk/typescript 0.6.1 2.884.4 1.0.0 vanta-auditor-api-sdk",
71
+ "speakeasy-sdk/typescript 0.6.3 2.884.13 1.0.0 vanta-auditor-api-sdk",
72
72
  } as const;
@@ -0,0 +1,99 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+ import {
10
+ AccountAccessStatus,
11
+ AccountAccessStatus$inboundSchema,
12
+ } from "./accountaccessstatus.js";
13
+
14
+ /**
15
+ * Account access record from personnel population.
16
+ *
17
+ * @remarks
18
+ *
19
+ * This unified interface represents account access data from all service types:
20
+ * - IDP services (Okta, Azure AD, Google Workspace, etc.)
21
+ * - First-party account services (AWS, Azure, GCP, Oracle Cloud, etc.)
22
+ * - Role grants services (GCP, Azure role grants)
23
+ * - Received/third-party applications
24
+ *
25
+ * Only `id` and `accountName` are always present. Other fields are optional so
26
+ * disallowed columns can be omitted (for example under controlled audit view).
27
+ * When an optional field is present, `null` means the column is visible but empty
28
+ * (only fields that are nullable in population data use `null`).
29
+ */
30
+ export type AccountAccess = {
31
+ /**
32
+ * Unique identifier for the account.
33
+ */
34
+ id: string;
35
+ /**
36
+ * Account name or email address (primary identifier).
37
+ */
38
+ accountName: string;
39
+ /**
40
+ * Display name of the account owner, or null when the column is visible but unknown.
41
+ */
42
+ owner?: string | null | undefined;
43
+ /**
44
+ * Account roles; empty array when the column is visible but has no roles.
45
+ */
46
+ role?: Array<string> | undefined;
47
+ /**
48
+ * Account status values for account access records.
49
+ *
50
+ * @remarks
51
+ * Unified status enum that covers all service types.
52
+ */
53
+ status?: AccountAccessStatus | undefined;
54
+ /**
55
+ * Multi-factor authentication (MFA) status when present.
56
+ *
57
+ * @remarks
58
+ * `true` = MFA enabled, `false` = MFA not enabled, `null` = visible but unknown.
59
+ */
60
+ mfa?: boolean | null | undefined;
61
+ /**
62
+ * Account creation date when present, or null when visible but absent.
63
+ */
64
+ createdDate?: Date | null | undefined;
65
+ /**
66
+ * Account deactivation date when present, or null when active.
67
+ */
68
+ deactivatedDate?: Date | null | undefined;
69
+ };
70
+
71
+ /** @internal */
72
+ export const AccountAccess$inboundSchema: z.ZodType<
73
+ AccountAccess,
74
+ z.ZodTypeDef,
75
+ unknown
76
+ > = z.object({
77
+ id: z.string(),
78
+ accountName: z.string(),
79
+ owner: z.nullable(z.string()).optional(),
80
+ role: z.array(z.string()).optional(),
81
+ status: AccountAccessStatus$inboundSchema.optional(),
82
+ mfa: z.nullable(z.boolean()).optional(),
83
+ createdDate: z.nullable(
84
+ z.string().datetime({ offset: true }).transform(v => new Date(v)),
85
+ ).optional(),
86
+ deactivatedDate: z.nullable(
87
+ z.string().datetime({ offset: true }).transform(v => new Date(v)),
88
+ ).optional(),
89
+ });
90
+
91
+ export function accountAccessFromJSON(
92
+ jsonString: string,
93
+ ): SafeParseResult<AccountAccess, SDKValidationError> {
94
+ return safeParse(
95
+ jsonString,
96
+ (x) => AccountAccess$inboundSchema.parse(JSON.parse(x)),
97
+ `Failed to parse 'AccountAccess' from JSON`,
98
+ );
99
+ }
@@ -0,0 +1,60 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
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
+ /**
11
+ * An account access service (identity provider, access credential, or external application)
12
+ *
13
+ * @remarks
14
+ * connected to the organization.
15
+ *
16
+ * These represent credentials for integrations like Okta, Azure AD,
17
+ * Google Workspace, etc. that provide identity and access management
18
+ * data for personnel, as well as external applications that provide
19
+ * received user accounts.
20
+ */
21
+ export type AccountAccessService = {
22
+ /**
23
+ * Unique identifier for the service.
24
+ */
25
+ id: string;
26
+ /**
27
+ * Display name of the service shown to users.
28
+ */
29
+ credentialDisplayName: string;
30
+ /**
31
+ * The service name or integration ID.
32
+ */
33
+ service: string;
34
+ /**
35
+ * Sub-account identifier for multi-account integrations, or null if not applicable.
36
+ */
37
+ subAccountId: string | null;
38
+ };
39
+
40
+ /** @internal */
41
+ export const AccountAccessService$inboundSchema: z.ZodType<
42
+ AccountAccessService,
43
+ z.ZodTypeDef,
44
+ unknown
45
+ > = z.object({
46
+ id: z.string(),
47
+ credentialDisplayName: z.string(),
48
+ service: z.string(),
49
+ subAccountId: z.nullable(z.string()),
50
+ });
51
+
52
+ export function accountAccessServiceFromJSON(
53
+ jsonString: string,
54
+ ): SafeParseResult<AccountAccessService, SDKValidationError> {
55
+ return safeParse(
56
+ jsonString,
57
+ (x) => AccountAccessService$inboundSchema.parse(JSON.parse(x)),
58
+ `Failed to parse 'AccountAccessService' from JSON`,
59
+ );
60
+ }
@@ -0,0 +1,34 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { ClosedEnum } from "../../types/enums.js";
7
+
8
+ /**
9
+ * Account status values for account access records.
10
+ *
11
+ * @remarks
12
+ * Unified status enum that covers all service types.
13
+ */
14
+ export const AccountAccessStatus = {
15
+ Active: "ACTIVE",
16
+ Deactivated: "DEACTIVATED",
17
+ Unknown: "UNKNOWN",
18
+ } as const;
19
+ /**
20
+ * Account status values for account access records.
21
+ *
22
+ * @remarks
23
+ * Unified status enum that covers all service types.
24
+ */
25
+ export type AccountAccessStatus = ClosedEnum<typeof AccountAccessStatus>;
26
+
27
+ /** @internal */
28
+ export const AccountAccessStatus$inboundSchema: z.ZodNativeEnum<
29
+ typeof AccountAccessStatus
30
+ > = z.nativeEnum(AccountAccessStatus);
31
+ /** @internal */
32
+ export const AccountAccessStatus$outboundSchema: z.ZodNativeEnum<
33
+ typeof AccountAccessStatus
34
+ > = AccountAccessStatus$inboundSchema;
@@ -0,0 +1,25 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { ClosedEnum } from "../../types/enums.js";
7
+
8
+ /**
9
+ * Version control source service name for code changes.
10
+ */
11
+ export const ApiCodeChangeSource = {
12
+ Github: "github",
13
+ Gitlab: "gitlab",
14
+ Bitbucket: "bitbucket",
15
+ Azuredevops: "azuredevops",
16
+ } as const;
17
+ /**
18
+ * Version control source service name for code changes.
19
+ */
20
+ export type ApiCodeChangeSource = ClosedEnum<typeof ApiCodeChangeSource>;
21
+
22
+ /** @internal */
23
+ export const ApiCodeChangeSource$outboundSchema: z.ZodNativeEnum<
24
+ typeof ApiCodeChangeSource
25
+ > = z.nativeEnum(ApiCodeChangeSource);