vanta-auditor-api-sdk 0.6.0 → 0.6.2

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 (281) hide show
  1. package/README.md +19 -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/vantatestrunstatus.d.ts +1 -1
  170. package/models/components/vantatestrunstatus.js +1 -1
  171. package/models/components/vantatestsnapshotevidence.d.ts +1 -1
  172. package/models/components/vantatestsnapshotevidence.js +1 -1
  173. package/models/components/vendororderby.d.ts +10 -0
  174. package/models/components/vendororderby.d.ts.map +1 -0
  175. package/models/components/vendororderby.js +47 -0
  176. package/models/components/vendororderby.js.map +1 -0
  177. package/models/operations/index.d.ts +8 -0
  178. package/models/operations/index.d.ts.map +1 -1
  179. package/models/operations/index.js +8 -0
  180. package/models/operations/index.js.map +1 -1
  181. package/models/operations/listaccountaccessservices.d.ts +25 -0
  182. package/models/operations/listaccountaccessservices.d.ts.map +1 -0
  183. package/models/operations/listaccountaccessservices.js +51 -0
  184. package/models/operations/listaccountaccessservices.js.map +1 -0
  185. package/models/operations/listauditissues.d.ts +11 -0
  186. package/models/operations/listauditissues.d.ts.map +1 -1
  187. package/models/operations/listauditissues.js +3 -0
  188. package/models/operations/listauditissues.js.map +1 -1
  189. package/models/operations/listauditrisks.d.ts +46 -0
  190. package/models/operations/listauditrisks.d.ts.map +1 -0
  191. package/models/operations/listauditrisks.js +56 -0
  192. package/models/operations/listauditrisks.js.map +1 -0
  193. package/models/operations/listcodechanges.d.ts +46 -0
  194. package/models/operations/listcodechanges.d.ts.map +1 -0
  195. package/models/operations/listcodechanges.js +57 -0
  196. package/models/operations/listcodechanges.js.map +1 -0
  197. package/models/operations/listpersonnelaccountaccess.d.ts +41 -0
  198. package/models/operations/listpersonnelaccountaccess.d.ts.map +1 -0
  199. package/models/operations/listpersonnelaccountaccess.js +55 -0
  200. package/models/operations/listpersonnelaccountaccess.js.map +1 -0
  201. package/models/operations/listpersonnelgroups.d.ts +46 -0
  202. package/models/operations/listpersonnelgroups.d.ts.map +1 -0
  203. package/models/operations/listpersonnelgroups.js +56 -0
  204. package/models/operations/listpersonnelgroups.js.map +1 -0
  205. package/models/operations/listpersonnelpeople.d.ts +51 -0
  206. package/models/operations/listpersonnelpeople.d.ts.map +1 -0
  207. package/models/operations/listpersonnelpeople.js +57 -0
  208. package/models/operations/listpersonnelpeople.js.map +1 -0
  209. package/models/operations/listrisksnapshots.d.ts +25 -0
  210. package/models/operations/listrisksnapshots.d.ts.map +1 -0
  211. package/models/operations/listrisksnapshots.js +51 -0
  212. package/models/operations/listrisksnapshots.js.map +1 -0
  213. package/models/operations/listvendors.d.ts +51 -0
  214. package/models/operations/listvendors.d.ts.map +1 -0
  215. package/models/operations/listvendors.js +58 -0
  216. package/models/operations/listvendors.js.map +1 -0
  217. package/package.json +1 -1
  218. package/sdk/audits.d.ts +219 -1
  219. package/sdk/audits.d.ts.map +1 -1
  220. package/sdk/audits.js +243 -1
  221. package/sdk/audits.js.map +1 -1
  222. package/src/funcs/auditsList.ts +10 -0
  223. package/src/funcs/auditsListAccountAccessServices.ts +192 -0
  224. package/src/funcs/auditsListAuditIssues.ts +5 -1
  225. package/src/funcs/auditsListAuditRisks.ts +200 -0
  226. package/src/funcs/auditsListCodeChanges.ts +194 -0
  227. package/src/funcs/auditsListPersonnelAccountAccess.ts +223 -0
  228. package/src/funcs/auditsListPersonnelGroups.ts +200 -0
  229. package/src/funcs/auditsListPersonnelPeople.ts +198 -0
  230. package/src/funcs/auditsListRiskSnapshots.ts +188 -0
  231. package/src/funcs/auditsListVendors.ts +196 -0
  232. package/src/lib/config.ts +3 -3
  233. package/src/models/components/accountaccess.ts +99 -0
  234. package/src/models/components/accountaccessservice.ts +60 -0
  235. package/src/models/components/accountaccessstatus.ts +34 -0
  236. package/src/models/components/apicodechangesource.ts +25 -0
  237. package/src/models/components/auditrisk.ts +216 -0
  238. package/src/models/components/auditriskcia.ts +23 -0
  239. package/src/models/components/auditvendor.ts +158 -0
  240. package/src/models/components/auditvendorrisklevel.ts +24 -0
  241. package/src/models/components/auditvendorstatus.ts +22 -0
  242. package/src/models/components/codechange.ts +79 -0
  243. package/src/models/components/grouporderby.ts +19 -0
  244. package/src/models/components/index.ts +31 -0
  245. package/src/models/components/issuesnapshotitemorderby.ts +25 -0
  246. package/src/models/components/orderdirection.ts +23 -0
  247. package/src/models/components/paginatedresponseaccountaccess.ts +62 -0
  248. package/src/models/components/paginatedresponseaccountaccessservice.ts +74 -0
  249. package/src/models/components/paginatedresponseauditrisk.ts +61 -0
  250. package/src/models/components/paginatedresponseauditvendor.ts +62 -0
  251. package/src/models/components/paginatedresponsecodechange.ts +62 -0
  252. package/src/models/components/paginatedresponsepersonnelgroup.ts +65 -0
  253. package/src/models/components/paginatedresponsepersonnelperson.ts +70 -0
  254. package/src/models/components/paginatedresponserisksnapshot.ts +62 -0
  255. package/src/models/components/peopleemploymentstatus.ts +27 -0
  256. package/src/models/components/peopleorderby.ts +17 -0
  257. package/src/models/components/peoplesecuritytaskstatus.ts +27 -0
  258. package/src/models/components/peopletaskstatus.ts +29 -0
  259. package/src/models/components/personnelgroup.ts +84 -0
  260. package/src/models/components/personnelgrouptask.ts +37 -0
  261. package/src/models/components/personnelperson.ts +554 -0
  262. package/src/models/components/riskorderby.ts +24 -0
  263. package/src/models/components/risksnapshot.ts +48 -0
  264. package/src/models/components/vantatestrunstatus.ts +1 -1
  265. package/src/models/components/vantatestsnapshotevidence.ts +1 -1
  266. package/src/models/components/vendororderby.ts +17 -0
  267. package/src/models/operations/index.ts +8 -0
  268. package/src/models/operations/listaccountaccessservices.ts +48 -0
  269. package/src/models/operations/listauditissues.ts +13 -0
  270. package/src/models/operations/listauditrisks.ts +71 -0
  271. package/src/models/operations/listcodechanges.ts +72 -0
  272. package/src/models/operations/listpersonnelaccountaccess.ts +67 -0
  273. package/src/models/operations/listpersonnelgroups.ts +71 -0
  274. package/src/models/operations/listpersonnelpeople.ts +77 -0
  275. package/src/models/operations/listrisksnapshots.ts +46 -0
  276. package/src/models/operations/listvendors.ts +80 -0
  277. package/src/sdk/audits.ts +307 -1
  278. package/src/types/async.ts +8 -7
  279. package/types/async.d.ts.map +1 -1
  280. package/types/async.js +8 -7
  281. package/types/async.js.map +1 -1
@@ -0,0 +1,192 @@
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 account access services for an audit
31
+ *
32
+ * @remarks
33
+ * Retrieves connected account access services for an audit.
34
+ *
35
+ * Returns the list of identity providers and access integrations (such as
36
+ * Okta, Azure AD, Google Workspace, AWS IAM) that are connected to the
37
+ * organization and provide account access data for personnel.
38
+ *
39
+ * These integrations are used to verify user access and identity management
40
+ * during an audit engagement.
41
+ *
42
+ * Uses cursor-based pagination. To paginate:
43
+ * 1. Make initial request with desired `pageSize`
44
+ * 2. Check `results.pageInfo.hasNextPage`
45
+ * 3. Use `results.pageInfo.endCursor` as `pageCursor` for next request
46
+ *
47
+ * Results are returned in connection order. Sort order is not guaranteed
48
+ * and cannot be customized via query parameters.
49
+ */
50
+ export function auditsListAccountAccessServices(
51
+ client: VantaCore,
52
+ request: operations.ListAccountAccessServicesRequest,
53
+ options?: RequestOptions,
54
+ ): APIPromise<
55
+ Result<
56
+ components.PaginatedResponseAccountAccessService,
57
+ | VantaError
58
+ | ResponseValidationError
59
+ | ConnectionError
60
+ | RequestAbortedError
61
+ | RequestTimeoutError
62
+ | InvalidRequestError
63
+ | UnexpectedClientError
64
+ | SDKValidationError
65
+ >
66
+ > {
67
+ return new APIPromise($do(
68
+ client,
69
+ request,
70
+ options,
71
+ ));
72
+ }
73
+
74
+ async function $do(
75
+ client: VantaCore,
76
+ request: operations.ListAccountAccessServicesRequest,
77
+ options?: RequestOptions,
78
+ ): Promise<
79
+ [
80
+ Result<
81
+ components.PaginatedResponseAccountAccessService,
82
+ | VantaError
83
+ | ResponseValidationError
84
+ | ConnectionError
85
+ | RequestAbortedError
86
+ | RequestTimeoutError
87
+ | InvalidRequestError
88
+ | UnexpectedClientError
89
+ | SDKValidationError
90
+ >,
91
+ APICall,
92
+ ]
93
+ > {
94
+ const parsed = safeParse(
95
+ request,
96
+ (value) =>
97
+ operations.ListAccountAccessServicesRequest$outboundSchema.parse(value),
98
+ "Input validation failed",
99
+ );
100
+ if (!parsed.ok) {
101
+ return [parsed, { status: "invalid" }];
102
+ }
103
+ const payload = parsed.value;
104
+ const body = null;
105
+
106
+ const pathParams = {
107
+ auditId: encodeSimple("auditId", payload.auditId, {
108
+ explode: false,
109
+ charEncoding: "percent",
110
+ }),
111
+ };
112
+ const path = pathToFunc(
113
+ "/audits/{auditId}/personnel/account-access/services",
114
+ )(pathParams);
115
+
116
+ const query = encodeFormQuery({
117
+ "pageCursor": payload.pageCursor,
118
+ "pageSize": payload.pageSize,
119
+ });
120
+
121
+ const headers = new Headers(compactMap({
122
+ Accept: "application/json",
123
+ }));
124
+
125
+ const secConfig = await extractSecurity(client._options.bearerAuth);
126
+ const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
127
+ const requestSecurity = resolveGlobalSecurity(securityInput);
128
+
129
+ const context = {
130
+ options: client._options,
131
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
132
+ operationID: "ListAccountAccessServices",
133
+ oAuth2Scopes: null,
134
+
135
+ resolvedSecurity: requestSecurity,
136
+
137
+ securitySource: client._options.bearerAuth,
138
+ retryConfig: options?.retries
139
+ || client._options.retryConfig
140
+ || { strategy: "none" },
141
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
142
+ };
143
+
144
+ const requestRes = client._createRequest(context, {
145
+ security: requestSecurity,
146
+ method: "GET",
147
+ baseURL: options?.serverURL,
148
+ path: path,
149
+ headers: headers,
150
+ query: query,
151
+ body: body,
152
+ userAgent: client._options.userAgent,
153
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
154
+ }, options);
155
+ if (!requestRes.ok) {
156
+ return [requestRes, { status: "invalid" }];
157
+ }
158
+ const req = requestRes.value;
159
+
160
+ const doResult = await client._do(req, {
161
+ context,
162
+ isErrorStatusCode: (statusCode: number) =>
163
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
164
+ retryConfig: context.retryConfig,
165
+ retryCodes: context.retryCodes,
166
+ });
167
+ if (!doResult.ok) {
168
+ return [doResult, { status: "request-error", request: req }];
169
+ }
170
+ const response = doResult.value;
171
+
172
+ const [result] = await M.match<
173
+ components.PaginatedResponseAccountAccessService,
174
+ | VantaError
175
+ | ResponseValidationError
176
+ | ConnectionError
177
+ | RequestAbortedError
178
+ | RequestTimeoutError
179
+ | InvalidRequestError
180
+ | UnexpectedClientError
181
+ | SDKValidationError
182
+ >(
183
+ M.json(200, components.PaginatedResponseAccountAccessService$inboundSchema),
184
+ M.fail("4XX"),
185
+ M.fail("5XX"),
186
+ )(response, req);
187
+ if (!result.ok) {
188
+ return [result, { status: "complete", request: req, response }];
189
+ }
190
+
191
+ return [result, { status: "complete", request: req, response }];
192
+ }
@@ -40,7 +40,9 @@ import { Result } from "../types/fp.js";
40
40
  * - `search`: full text search across issue title and description
41
41
  * - `snapshotId`: filtering to a specific snapshot or snapshots, which represent point-in-time captures of issues. Use the GET /audits/{auditId}/issues/snapshots endpoint to retrieve snapshot IDs and metadata.
42
42
  *
43
- * Results are sorted by issue creation date in descending order (newest first).
43
+ * Results are sorted by issue creation date in descending order (newest first) by default.
44
+ * Use `orderBy` and `orderDirection` to customize sorting.
45
+ * Sort parameters must remain consistent across paginated requests.
44
46
  *
45
47
  * Uses cursor-based pagination. To paginate:
46
48
  * 1. Make initial request with desired `pageSize`
@@ -111,6 +113,8 @@ async function $do(
111
113
  const path = pathToFunc("/audits/{auditId}/issues/items")(pathParams);
112
114
 
113
115
  const query = encodeFormQuery({
116
+ "orderBy": payload.orderBy,
117
+ "orderDirection": payload.orderDirection,
114
118
  "pageCursor": payload.pageCursor,
115
119
  "pageSize": payload.pageSize,
116
120
  "search": payload.search,
@@ -0,0 +1,200 @@
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 risks for an audit
31
+ *
32
+ * @remarks
33
+ * Retrieves risk population data for an audit.
34
+ *
35
+ * This endpoint provides access to the risk records visible to auditors
36
+ * during an audit engagement. Risk data is scoped to a specific risk
37
+ * assessment snapshot identified by the `snapshotId` parameter.
38
+ *
39
+ * Only Controlled Audit View (CAV) audits are supported. Full Audit
40
+ * View audits are rejected with 403.
41
+ *
42
+ * Supports filtering by:
43
+ * - `search`: Searches risk scenario descriptions (case-insensitive)
44
+ *
45
+ * Results are sorted by identified date (newest first) by default.
46
+ * Use `orderBy` and `orderDirection` to customize sorting.
47
+ * Sort parameters must remain consistent across paginated requests.
48
+ *
49
+ * Uses cursor-based pagination. To paginate:
50
+ * 1. Make initial request with desired `pageSize`
51
+ * 2. Check `results.pageInfo.hasNextPage`
52
+ * 3. Use `results.pageInfo.endCursor` as `pageCursor` for next request
53
+ */
54
+ export function auditsListAuditRisks(
55
+ client: VantaCore,
56
+ request: operations.ListAuditRisksRequest,
57
+ options?: RequestOptions,
58
+ ): APIPromise<
59
+ Result<
60
+ components.PaginatedResponseAuditRisk,
61
+ | VantaError
62
+ | ResponseValidationError
63
+ | ConnectionError
64
+ | RequestAbortedError
65
+ | RequestTimeoutError
66
+ | InvalidRequestError
67
+ | UnexpectedClientError
68
+ | SDKValidationError
69
+ >
70
+ > {
71
+ return new APIPromise($do(
72
+ client,
73
+ request,
74
+ options,
75
+ ));
76
+ }
77
+
78
+ async function $do(
79
+ client: VantaCore,
80
+ request: operations.ListAuditRisksRequest,
81
+ options?: RequestOptions,
82
+ ): Promise<
83
+ [
84
+ Result<
85
+ components.PaginatedResponseAuditRisk,
86
+ | VantaError
87
+ | ResponseValidationError
88
+ | ConnectionError
89
+ | RequestAbortedError
90
+ | RequestTimeoutError
91
+ | InvalidRequestError
92
+ | UnexpectedClientError
93
+ | SDKValidationError
94
+ >,
95
+ APICall,
96
+ ]
97
+ > {
98
+ const parsed = safeParse(
99
+ request,
100
+ (value) => operations.ListAuditRisksRequest$outboundSchema.parse(value),
101
+ "Input validation failed",
102
+ );
103
+ if (!parsed.ok) {
104
+ return [parsed, { status: "invalid" }];
105
+ }
106
+ const payload = parsed.value;
107
+ const body = null;
108
+
109
+ const pathParams = {
110
+ auditId: encodeSimple("auditId", payload.auditId, {
111
+ explode: false,
112
+ charEncoding: "percent",
113
+ }),
114
+ snapshotId: encodeSimple("snapshotId", payload.snapshotId, {
115
+ explode: false,
116
+ charEncoding: "percent",
117
+ }),
118
+ };
119
+ const path = pathToFunc("/audits/{auditId}/risks/{snapshotId}")(pathParams);
120
+
121
+ const query = encodeFormQuery({
122
+ "orderBy": payload.orderBy,
123
+ "orderDirection": payload.orderDirection,
124
+ "pageCursor": payload.pageCursor,
125
+ "pageSize": payload.pageSize,
126
+ "search": payload.search,
127
+ });
128
+
129
+ const headers = new Headers(compactMap({
130
+ Accept: "application/json",
131
+ }));
132
+
133
+ const secConfig = await extractSecurity(client._options.bearerAuth);
134
+ const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
135
+ const requestSecurity = resolveGlobalSecurity(securityInput);
136
+
137
+ const context = {
138
+ options: client._options,
139
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
140
+ operationID: "ListAuditRisks",
141
+ oAuth2Scopes: null,
142
+
143
+ resolvedSecurity: requestSecurity,
144
+
145
+ securitySource: client._options.bearerAuth,
146
+ retryConfig: options?.retries
147
+ || client._options.retryConfig
148
+ || { strategy: "none" },
149
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
150
+ };
151
+
152
+ const requestRes = client._createRequest(context, {
153
+ security: requestSecurity,
154
+ method: "GET",
155
+ baseURL: options?.serverURL,
156
+ path: path,
157
+ headers: headers,
158
+ query: query,
159
+ body: body,
160
+ userAgent: client._options.userAgent,
161
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
162
+ }, options);
163
+ if (!requestRes.ok) {
164
+ return [requestRes, { status: "invalid" }];
165
+ }
166
+ const req = requestRes.value;
167
+
168
+ const doResult = await client._do(req, {
169
+ context,
170
+ isErrorStatusCode: (statusCode: number) =>
171
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
172
+ retryConfig: context.retryConfig,
173
+ retryCodes: context.retryCodes,
174
+ });
175
+ if (!doResult.ok) {
176
+ return [doResult, { status: "request-error", request: req }];
177
+ }
178
+ const response = doResult.value;
179
+
180
+ const [result] = await M.match<
181
+ components.PaginatedResponseAuditRisk,
182
+ | VantaError
183
+ | ResponseValidationError
184
+ | ConnectionError
185
+ | RequestAbortedError
186
+ | RequestTimeoutError
187
+ | InvalidRequestError
188
+ | UnexpectedClientError
189
+ | SDKValidationError
190
+ >(
191
+ M.json(200, components.PaginatedResponseAuditRisk$inboundSchema),
192
+ M.fail("4XX"),
193
+ M.fail("5XX"),
194
+ )(response, req);
195
+ if (!result.ok) {
196
+ return [result, { status: "complete", request: req, response }];
197
+ }
198
+
199
+ return [result, { status: "complete", request: req, response }];
200
+ }
@@ -0,0 +1,194 @@
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 code changes for an audit
31
+ *
32
+ * @remarks
33
+ * Retrieves code changes population data for an audit.
34
+ *
35
+ * This endpoint provides access to code change records (pull requests)
36
+ * visible to auditors during an audit engagement.
37
+ *
38
+ * Supports filtering by:
39
+ * - `search`: Searches code change titles and repository names (case-insensitive)
40
+ * - `sourcesMatchesAny`: Filters by version control source (accepted values: github, gitlab, bitbucket, azuredevops)
41
+ * - `startDate` / `endDate`: Filters by the closed date range
42
+ *
43
+ * Uses cursor-based pagination. To paginate:
44
+ * 1. Make initial request with desired `pageSize`
45
+ * 2. Check `results.pageInfo.hasNextPage`
46
+ * 3. Use `results.pageInfo.endCursor` as `pageCursor` for next request
47
+ *
48
+ * Results are sorted by closed date (newest first). This sort order is
49
+ * fixed and cannot be customized via query parameters.
50
+ */
51
+ export function auditsListCodeChanges(
52
+ client: VantaCore,
53
+ request: operations.ListCodeChangesRequest,
54
+ options?: RequestOptions,
55
+ ): APIPromise<
56
+ Result<
57
+ components.PaginatedResponseCodeChange,
58
+ | VantaError
59
+ | ResponseValidationError
60
+ | ConnectionError
61
+ | RequestAbortedError
62
+ | RequestTimeoutError
63
+ | InvalidRequestError
64
+ | UnexpectedClientError
65
+ | SDKValidationError
66
+ >
67
+ > {
68
+ return new APIPromise($do(
69
+ client,
70
+ request,
71
+ options,
72
+ ));
73
+ }
74
+
75
+ async function $do(
76
+ client: VantaCore,
77
+ request: operations.ListCodeChangesRequest,
78
+ options?: RequestOptions,
79
+ ): Promise<
80
+ [
81
+ Result<
82
+ components.PaginatedResponseCodeChange,
83
+ | VantaError
84
+ | ResponseValidationError
85
+ | ConnectionError
86
+ | RequestAbortedError
87
+ | RequestTimeoutError
88
+ | InvalidRequestError
89
+ | UnexpectedClientError
90
+ | SDKValidationError
91
+ >,
92
+ APICall,
93
+ ]
94
+ > {
95
+ const parsed = safeParse(
96
+ request,
97
+ (value) => operations.ListCodeChangesRequest$outboundSchema.parse(value),
98
+ "Input validation failed",
99
+ );
100
+ if (!parsed.ok) {
101
+ return [parsed, { status: "invalid" }];
102
+ }
103
+ const payload = parsed.value;
104
+ const body = null;
105
+
106
+ const pathParams = {
107
+ auditId: encodeSimple("auditId", payload.auditId, {
108
+ explode: false,
109
+ charEncoding: "percent",
110
+ }),
111
+ };
112
+ const path = pathToFunc("/audits/{auditId}/assets/code-changes")(pathParams);
113
+
114
+ const query = encodeFormQuery({
115
+ "endDate": payload.endDate,
116
+ "pageCursor": payload.pageCursor,
117
+ "pageSize": payload.pageSize,
118
+ "search": payload.search,
119
+ "sourcesMatchesAny": payload.sourcesMatchesAny,
120
+ "startDate": payload.startDate,
121
+ });
122
+
123
+ const headers = new Headers(compactMap({
124
+ Accept: "application/json",
125
+ }));
126
+
127
+ const secConfig = await extractSecurity(client._options.bearerAuth);
128
+ const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
129
+ const requestSecurity = resolveGlobalSecurity(securityInput);
130
+
131
+ const context = {
132
+ options: client._options,
133
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
134
+ operationID: "ListCodeChanges",
135
+ oAuth2Scopes: null,
136
+
137
+ resolvedSecurity: requestSecurity,
138
+
139
+ securitySource: client._options.bearerAuth,
140
+ retryConfig: options?.retries
141
+ || client._options.retryConfig
142
+ || { strategy: "none" },
143
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
144
+ };
145
+
146
+ const requestRes = client._createRequest(context, {
147
+ security: requestSecurity,
148
+ method: "GET",
149
+ baseURL: options?.serverURL,
150
+ path: path,
151
+ headers: headers,
152
+ query: query,
153
+ body: body,
154
+ userAgent: client._options.userAgent,
155
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
156
+ }, options);
157
+ if (!requestRes.ok) {
158
+ return [requestRes, { status: "invalid" }];
159
+ }
160
+ const req = requestRes.value;
161
+
162
+ const doResult = await client._do(req, {
163
+ context,
164
+ isErrorStatusCode: (statusCode: number) =>
165
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
166
+ retryConfig: context.retryConfig,
167
+ retryCodes: context.retryCodes,
168
+ });
169
+ if (!doResult.ok) {
170
+ return [doResult, { status: "request-error", request: req }];
171
+ }
172
+ const response = doResult.value;
173
+
174
+ const [result] = await M.match<
175
+ components.PaginatedResponseCodeChange,
176
+ | VantaError
177
+ | ResponseValidationError
178
+ | ConnectionError
179
+ | RequestAbortedError
180
+ | RequestTimeoutError
181
+ | InvalidRequestError
182
+ | UnexpectedClientError
183
+ | SDKValidationError
184
+ >(
185
+ M.json(200, components.PaginatedResponseCodeChange$inboundSchema),
186
+ M.fail("4XX"),
187
+ M.fail("5XX"),
188
+ )(response, req);
189
+ if (!result.ok) {
190
+ return [result, { status: "complete", request: req, response }];
191
+ }
192
+
193
+ return [result, { status: "complete", request: req, response }];
194
+ }