vanta-auditor-api-sdk 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.devcontainer/README.md +30 -0
- package/FUNCTIONS.md +104 -0
- package/README.md +440 -0
- package/RUNTIMES.md +48 -0
- package/core.d.ts +10 -0
- package/core.d.ts.map +1 -0
- package/core.js +17 -0
- package/core.js.map +1 -0
- package/docs/sdks/auditors/README.md +88 -0
- package/docs/sdks/audits/README.md +748 -0
- package/docs/sdks/vanta/README.md +7 -0
- package/funcs/auditorsCreate.d.ts +15 -0
- package/funcs/auditorsCreate.d.ts.map +1 -0
- package/funcs/auditorsCreate.js +106 -0
- package/funcs/auditorsCreate.js.map +1 -0
- package/funcs/auditsCreateCommentForEvidence.d.ts +16 -0
- package/funcs/auditsCreateCommentForEvidence.d.ts.map +1 -0
- package/funcs/auditsCreateCommentForEvidence.js +117 -0
- package/funcs/auditsCreateCommentForEvidence.js.map +1 -0
- package/funcs/auditsCreateCustomControl.d.ts +16 -0
- package/funcs/auditsCreateCustomControl.d.ts.map +1 -0
- package/funcs/auditsCreateCustomControl.js +115 -0
- package/funcs/auditsCreateCustomControl.js.map +1 -0
- package/funcs/auditsCreateCustomEvidenceRequest.d.ts +16 -0
- package/funcs/auditsCreateCustomEvidenceRequest.d.ts.map +1 -0
- package/funcs/auditsCreateCustomEvidenceRequest.js +115 -0
- package/funcs/auditsCreateCustomEvidenceRequest.js.map +1 -0
- package/funcs/auditsGetEvidenceUrls.d.ts +16 -0
- package/funcs/auditsGetEvidenceUrls.d.ts.map +1 -0
- package/funcs/auditsGetEvidenceUrls.js +121 -0
- package/funcs/auditsGetEvidenceUrls.js.map +1 -0
- package/funcs/auditsList.d.ts +16 -0
- package/funcs/auditsList.d.ts.map +1 -0
- package/funcs/auditsList.js +112 -0
- package/funcs/auditsList.js.map +1 -0
- package/funcs/auditsListComments.d.ts +16 -0
- package/funcs/auditsListComments.d.ts.map +1 -0
- package/funcs/auditsListComments.js +118 -0
- package/funcs/auditsListComments.js.map +1 -0
- package/funcs/auditsListControls.d.ts +16 -0
- package/funcs/auditsListControls.d.ts.map +1 -0
- package/funcs/auditsListControls.js +117 -0
- package/funcs/auditsListControls.js.map +1 -0
- package/funcs/auditsListEvidence.d.ts +16 -0
- package/funcs/auditsListEvidence.d.ts.map +1 -0
- package/funcs/auditsListEvidence.js +118 -0
- package/funcs/auditsListEvidence.js.map +1 -0
- package/funcs/auditsUpdateEvidence.d.ts +16 -0
- package/funcs/auditsUpdateEvidence.d.ts.map +1 -0
- package/funcs/auditsUpdateEvidence.js +119 -0
- package/funcs/auditsUpdateEvidence.js.map +1 -0
- package/hooks/hooks.d.ts +24 -0
- package/hooks/hooks.d.ts.map +1 -0
- package/hooks/hooks.js +86 -0
- package/hooks/hooks.js.map +1 -0
- package/hooks/index.d.ts +3 -0
- package/hooks/index.d.ts.map +1 -0
- package/hooks/index.js +22 -0
- package/hooks/index.js.map +1 -0
- package/hooks/registration.d.ts +3 -0
- package/hooks/registration.d.ts.map +1 -0
- package/hooks/registration.js +15 -0
- package/hooks/registration.js.map +1 -0
- package/hooks/types.d.ts +77 -0
- package/hooks/types.d.ts.map +1 -0
- package/hooks/types.js +6 -0
- package/hooks/types.js.map +1 -0
- package/index.d.ts +4 -0
- package/index.d.ts.map +1 -0
- package/index.js +46 -0
- package/index.js.map +1 -0
- package/lib/base64.d.ts +10 -0
- package/lib/base64.d.ts.map +1 -0
- package/lib/base64.js +71 -0
- package/lib/base64.js.map +1 -0
- package/lib/config.d.ts +34 -0
- package/lib/config.d.ts.map +1 -0
- package/lib/config.js +35 -0
- package/lib/config.js.map +1 -0
- package/lib/dlv.d.ts +14 -0
- package/lib/dlv.d.ts.map +1 -0
- package/lib/dlv.js +49 -0
- package/lib/dlv.js.map +1 -0
- package/lib/encodings.d.ts +51 -0
- package/lib/encodings.d.ts.map +1 -0
- package/lib/encodings.js +342 -0
- package/lib/encodings.js.map +1 -0
- package/lib/env.d.ts +15 -0
- package/lib/env.d.ts.map +1 -0
- package/lib/env.js +65 -0
- package/lib/env.js.map +1 -0
- package/lib/files.d.ts +8 -0
- package/lib/files.d.ts.map +1 -0
- package/lib/files.js +36 -0
- package/lib/files.js.map +1 -0
- package/lib/http.d.ts +67 -0
- package/lib/http.d.ts.map +1 -0
- package/lib/http.js +217 -0
- package/lib/http.js.map +1 -0
- package/lib/is-plain-object.d.ts +2 -0
- package/lib/is-plain-object.d.ts.map +1 -0
- package/lib/is-plain-object.js +41 -0
- package/lib/is-plain-object.js.map +1 -0
- package/lib/logger.d.ts +6 -0
- package/lib/logger.d.ts.map +1 -0
- package/lib/logger.js +6 -0
- package/lib/logger.js.map +1 -0
- package/lib/matchers.d.ts +64 -0
- package/lib/matchers.d.ts.map +1 -0
- package/lib/matchers.js +204 -0
- package/lib/matchers.js.map +1 -0
- package/lib/primitives.d.ts +22 -0
- package/lib/primitives.d.ts.map +1 -0
- package/lib/primitives.js +94 -0
- package/lib/primitives.js.map +1 -0
- package/lib/retries.d.ts +38 -0
- package/lib/retries.d.ts.map +1 -0
- package/lib/retries.js +154 -0
- package/lib/retries.js.map +1 -0
- package/lib/schemas.d.ts +19 -0
- package/lib/schemas.d.ts.map +1 -0
- package/lib/schemas.js +59 -0
- package/lib/schemas.js.map +1 -0
- package/lib/sdks.d.ts +60 -0
- package/lib/sdks.d.ts.map +1 -0
- package/lib/sdks.js +277 -0
- package/lib/sdks.js.map +1 -0
- package/lib/security.d.ts +82 -0
- package/lib/security.d.ts.map +1 -0
- package/lib/security.js +139 -0
- package/lib/security.js.map +1 -0
- package/lib/url.d.ts +5 -0
- package/lib/url.d.ts.map +1 -0
- package/lib/url.js +25 -0
- package/lib/url.js.map +1 -0
- package/models/components/addauditorinput.d.ts +42 -0
- package/models/components/addauditorinput.d.ts.map +1 -0
- package/models/components/addauditorinput.js +73 -0
- package/models/components/addauditorinput.js.map +1 -0
- package/models/components/addcommentinput.d.ts +42 -0
- package/models/components/addcommentinput.d.ts.map +1 -0
- package/models/components/addcommentinput.js +73 -0
- package/models/components/addcommentinput.js.map +1 -0
- package/models/components/audit.d.ts +97 -0
- package/models/components/audit.d.ts.map +1 -0
- package/models/components/audit.js +96 -0
- package/models/components/audit.js.map +1 -0
- package/models/components/auditevidencestate.d.ts +40 -0
- package/models/components/auditevidencestate.d.ts.map +1 -0
- package/models/components/auditevidencestate.js +64 -0
- package/models/components/auditevidencestate.js.map +1 -0
- package/models/components/auditevidencetype.d.ts +31 -0
- package/models/components/auditevidencetype.d.ts.map +1 -0
- package/models/components/auditevidencetype.js +61 -0
- package/models/components/auditevidencetype.js.map +1 -0
- package/models/components/auditevidenceupdateinput.d.ts +60 -0
- package/models/components/auditevidenceupdateinput.d.ts.map +1 -0
- package/models/components/auditevidenceupdateinput.js +99 -0
- package/models/components/auditevidenceupdateinput.js.map +1 -0
- package/models/components/auditor.d.ts +49 -0
- package/models/components/auditor.d.ts.map +1 -0
- package/models/components/auditor.js +77 -0
- package/models/components/auditor.js.map +1 -0
- package/models/components/auditorcontrol.d.ts +111 -0
- package/models/components/auditorcontrol.d.ts.map +1 -0
- package/models/components/auditorcontrol.js +118 -0
- package/models/components/auditorcontrol.js.map +1 -0
- package/models/components/auditorenabledstatetransition.d.ts +34 -0
- package/models/components/auditorenabledstatetransition.d.ts.map +1 -0
- package/models/components/auditorenabledstatetransition.js +62 -0
- package/models/components/auditorenabledstatetransition.js.map +1 -0
- package/models/components/comment.d.ts +57 -0
- package/models/components/comment.d.ts.map +1 -0
- package/models/components/comment.js +79 -0
- package/models/components/comment.js.map +1 -0
- package/models/components/control.d.ts +106 -0
- package/models/components/control.d.ts.map +1 -0
- package/models/components/control.js +115 -0
- package/models/components/control.js.map +1 -0
- package/models/components/controldomain.d.ts +136 -0
- package/models/components/controldomain.d.ts.map +1 -0
- package/models/components/controldomain.js +96 -0
- package/models/components/controldomain.js.map +1 -0
- package/models/components/controlsource.d.ts +28 -0
- package/models/components/controlsource.d.ts.map +1 -0
- package/models/components/controlsource.js +60 -0
- package/models/components/controlsource.js.map +1 -0
- package/models/components/createcustomcontrolinput.d.ts +105 -0
- package/models/components/createcustomcontrolinput.d.ts.map +1 -0
- package/models/components/createcustomcontrolinput.js +109 -0
- package/models/components/createcustomcontrolinput.js.map +1 -0
- package/models/components/createcustomevidencerequestinput.d.ts +52 -0
- package/models/components/createcustomevidencerequestinput.d.ts.map +1 -0
- package/models/components/createcustomevidencerequestinput.js +80 -0
- package/models/components/createcustomevidencerequestinput.js.map +1 -0
- package/models/components/customevidencerequest.d.ts +57 -0
- package/models/components/customevidencerequest.d.ts.map +1 -0
- package/models/components/customevidencerequest.js +82 -0
- package/models/components/customevidencerequest.js.map +1 -0
- package/models/components/evidence.d.ts +84 -0
- package/models/components/evidence.d.ts.map +1 -0
- package/models/components/evidence.js +94 -0
- package/models/components/evidence.js.map +1 -0
- package/models/components/evidencecontrol.d.ts +37 -0
- package/models/components/evidencecontrol.d.ts.map +1 -0
- package/models/components/evidencecontrol.js +71 -0
- package/models/components/evidencecontrol.js.map +1 -0
- package/models/components/evidenceurl.d.ts +47 -0
- package/models/components/evidenceurl.d.ts.map +1 -0
- package/models/components/evidenceurl.js +75 -0
- package/models/components/evidenceurl.js.map +1 -0
- package/models/components/frameworkid.d.ts +127 -0
- package/models/components/frameworkid.d.ts.map +1 -0
- package/models/components/frameworkid.js +94 -0
- package/models/components/frameworkid.js.map +1 -0
- package/models/components/frameworksection.d.ts +53 -0
- package/models/components/frameworksection.d.ts.map +1 -0
- package/models/components/frameworksection.js +95 -0
- package/models/components/frameworksection.js.map +1 -0
- package/models/components/index.d.ts +30 -0
- package/models/components/index.d.ts.map +1 -0
- package/models/components/index.js +49 -0
- package/models/components/index.js.map +1 -0
- package/models/components/pageinfo.d.ts +50 -0
- package/models/components/pageinfo.d.ts.map +1 -0
- package/models/components/pageinfo.js +75 -0
- package/models/components/pageinfo.js.map +1 -0
- package/models/components/paginatedresponseaudit.d.ts +61 -0
- package/models/components/paginatedresponseaudit.d.ts.map +1 -0
- package/models/components/paginatedresponseaudit.js +100 -0
- package/models/components/paginatedresponseaudit.js.map +1 -0
- package/models/components/paginatedresponseauditorcontrol.d.ts +61 -0
- package/models/components/paginatedresponseauditorcontrol.d.ts.map +1 -0
- package/models/components/paginatedresponseauditorcontrol.js +100 -0
- package/models/components/paginatedresponseauditorcontrol.js.map +1 -0
- package/models/components/paginatedresponsecomment.d.ts +61 -0
- package/models/components/paginatedresponsecomment.d.ts.map +1 -0
- package/models/components/paginatedresponsecomment.js +100 -0
- package/models/components/paginatedresponsecomment.js.map +1 -0
- package/models/components/paginatedresponseevidence.d.ts +61 -0
- package/models/components/paginatedresponseevidence.d.ts.map +1 -0
- package/models/components/paginatedresponseevidence.js +100 -0
- package/models/components/paginatedresponseevidence.js.map +1 -0
- package/models/components/paginatedresponseevidenceurl.d.ts +61 -0
- package/models/components/paginatedresponseevidenceurl.d.ts.map +1 -0
- package/models/components/paginatedresponseevidenceurl.js +100 -0
- package/models/components/paginatedresponseevidenceurl.js.map +1 -0
- package/models/components/recurrenceduration.d.ts +43 -0
- package/models/components/recurrenceduration.d.ts.map +1 -0
- package/models/components/recurrenceduration.js +65 -0
- package/models/components/recurrenceduration.js.map +1 -0
- package/models/components/security.d.ts +29 -0
- package/models/components/security.d.ts.map +1 -0
- package/models/components/security.js +69 -0
- package/models/components/security.js.map +1 -0
- package/models/errors/apierror.d.ts +8 -0
- package/models/errors/apierror.d.ts.map +1 -0
- package/models/errors/apierror.js +21 -0
- package/models/errors/apierror.js.map +1 -0
- package/models/errors/httpclienterrors.d.ts +44 -0
- package/models/errors/httpclienterrors.d.ts.map +1 -0
- package/models/errors/httpclienterrors.js +78 -0
- package/models/errors/httpclienterrors.js.map +1 -0
- package/models/errors/index.d.ts +4 -0
- package/models/errors/index.d.ts.map +1 -0
- package/models/errors/index.js +23 -0
- package/models/errors/index.js.map +1 -0
- package/models/errors/sdkvalidationerror.d.ts +20 -0
- package/models/errors/sdkvalidationerror.d.ts.map +1 -0
- package/models/errors/sdkvalidationerror.js +115 -0
- package/models/errors/sdkvalidationerror.js.map +1 -0
- package/models/operations/createcommentforauditevidence.d.ts +34 -0
- package/models/operations/createcommentforauditevidence.d.ts.map +1 -0
- package/models/operations/createcommentforauditevidence.js +83 -0
- package/models/operations/createcommentforauditevidence.js.map +1 -0
- package/models/operations/createcustomcontrol.d.ts +32 -0
- package/models/operations/createcustomcontrol.d.ts.map +1 -0
- package/models/operations/createcustomcontrol.js +81 -0
- package/models/operations/createcustomcontrol.js.map +1 -0
- package/models/operations/createcustomevidencerequest.d.ts +32 -0
- package/models/operations/createcustomevidencerequest.d.ts.map +1 -0
- package/models/operations/createcustomevidencerequest.js +81 -0
- package/models/operations/createcustomevidencerequest.js.map +1 -0
- package/models/operations/index.d.ts +10 -0
- package/models/operations/index.d.ts.map +1 -0
- package/models/operations/index.js +29 -0
- package/models/operations/index.js.map +1 -0
- package/models/operations/listauditcomments.d.ts +38 -0
- package/models/operations/listauditcomments.d.ts.map +1 -0
- package/models/operations/listauditcomments.js +75 -0
- package/models/operations/listauditcomments.js.map +1 -0
- package/models/operations/listauditcontrols.d.ts +33 -0
- package/models/operations/listauditcontrols.d.ts.map +1 -0
- package/models/operations/listauditcontrols.js +73 -0
- package/models/operations/listauditcontrols.js.map +1 -0
- package/models/operations/listauditevidence.d.ts +38 -0
- package/models/operations/listauditevidence.d.ts.map +1 -0
- package/models/operations/listauditevidence.js +75 -0
- package/models/operations/listauditevidence.js.map +1 -0
- package/models/operations/listauditevidenceurls.d.ts +35 -0
- package/models/operations/listauditevidenceurls.d.ts.map +1 -0
- package/models/operations/listauditevidenceurls.js +75 -0
- package/models/operations/listauditevidenceurls.js.map +1 -0
- package/models/operations/listaudits.d.ts +36 -0
- package/models/operations/listaudits.d.ts.map +1 -0
- package/models/operations/listaudits.js +73 -0
- package/models/operations/listaudits.js.map +1 -0
- package/models/operations/updateauditevidence.d.ts +34 -0
- package/models/operations/updateauditevidence.d.ts.map +1 -0
- package/models/operations/updateauditevidence.js +83 -0
- package/models/operations/updateauditevidence.js.map +1 -0
- package/package.json +27 -0
- package/sdk/auditors.d.ts +12 -0
- package/sdk/auditors.d.ts.map +1 -0
- package/sdk/auditors.js +22 -0
- package/sdk/auditors.js.map +1 -0
- package/sdk/audits.d.ts +69 -0
- package/sdk/audits.d.ts.map +1 -0
- package/sdk/audits.js +102 -0
- package/sdk/audits.js.map +1 -0
- package/sdk/index.d.ts +2 -0
- package/sdk/index.d.ts.map +1 -0
- package/sdk/index.js +21 -0
- package/sdk/index.js.map +1 -0
- package/sdk/sdk.d.ts +10 -0
- package/sdk/sdk.d.ts.map +1 -0
- package/sdk/sdk.js +19 -0
- package/sdk/sdk.js.map +1 -0
- package/src/core.ts +13 -0
- package/src/funcs/auditorsCreate.ts +124 -0
- package/src/funcs/auditsCreateCommentForEvidence.ts +141 -0
- package/src/funcs/auditsCreateCustomControl.ts +137 -0
- package/src/funcs/auditsCreateCustomEvidenceRequest.ts +137 -0
- package/src/funcs/auditsGetEvidenceUrls.ts +144 -0
- package/src/funcs/auditsList.ts +131 -0
- package/src/funcs/auditsListComments.ts +138 -0
- package/src/funcs/auditsListControls.ts +137 -0
- package/src/funcs/auditsListEvidence.ts +138 -0
- package/src/funcs/auditsUpdateEvidence.ts +141 -0
- package/src/hooks/hooks.ts +132 -0
- package/src/hooks/index.ts +6 -0
- package/src/hooks/registration.ts +14 -0
- package/src/hooks/types.ts +109 -0
- package/src/index.ts +7 -0
- package/src/lib/base64.ts +37 -0
- package/src/lib/config.ts +61 -0
- package/src/lib/dlv.ts +53 -0
- package/src/lib/encodings.ts +449 -0
- package/src/lib/env.ts +41 -0
- package/src/lib/files.ts +40 -0
- package/src/lib/http.ts +323 -0
- package/src/lib/is-plain-object.ts +43 -0
- package/src/lib/logger.ts +9 -0
- package/src/lib/matchers.ts +322 -0
- package/src/lib/primitives.ts +122 -0
- package/src/lib/retries.ts +219 -0
- package/src/lib/schemas.ts +86 -0
- package/src/lib/sdks.ts +397 -0
- package/src/lib/security.ts +254 -0
- package/src/lib/url.ts +33 -0
- package/src/models/components/addauditorinput.ts +81 -0
- package/src/models/components/addcommentinput.ts +83 -0
- package/src/models/components/audit.ts +167 -0
- package/src/models/components/auditevidencestate.ts +37 -0
- package/src/models/components/auditevidencetype.ts +34 -0
- package/src/models/components/auditevidenceupdateinput.ts +132 -0
- package/src/models/components/auditor.ts +87 -0
- package/src/models/components/auditorcontrol.ts +194 -0
- package/src/models/components/auditorenabledstatetransition.ts +37 -0
- package/src/models/components/comment.ts +101 -0
- package/src/models/components/control.ts +187 -0
- package/src/models/components/controldomain.ts +70 -0
- package/src/models/components/controlsource.ts +33 -0
- package/src/models/components/createcustomcontrolinput.ts +164 -0
- package/src/models/components/createcustomevidencerequestinput.ts +105 -0
- package/src/models/components/customevidencerequest.ts +110 -0
- package/src/models/components/evidence.ts +158 -0
- package/src/models/components/evidencecontrol.ts +74 -0
- package/src/models/components/evidenceurl.ts +86 -0
- package/src/models/components/frameworkid.ts +64 -0
- package/src/models/components/frameworksection.ts +127 -0
- package/src/models/components/index.ts +33 -0
- package/src/models/components/pageinfo.ts +89 -0
- package/src/models/components/paginatedresponseaudit.ts +136 -0
- package/src/models/components/paginatedresponseauditorcontrol.ts +151 -0
- package/src/models/components/paginatedresponsecomment.ts +145 -0
- package/src/models/components/paginatedresponseevidence.ts +145 -0
- package/src/models/components/paginatedresponseevidenceurl.ts +150 -0
- package/src/models/components/recurrenceduration.ts +38 -0
- package/src/models/components/security.ts +62 -0
- package/src/models/errors/apierror.ts +27 -0
- package/src/models/errors/httpclienterrors.ts +62 -0
- package/src/models/errors/index.ts +7 -0
- package/src/models/errors/sdkvalidationerror.ts +97 -0
- package/src/models/operations/createcommentforauditevidence.ts +89 -0
- package/src/models/operations/createcustomcontrol.ts +80 -0
- package/src/models/operations/createcustomevidencerequest.ts +87 -0
- package/src/models/operations/index.ts +13 -0
- package/src/models/operations/listauditcomments.ts +83 -0
- package/src/models/operations/listauditcontrols.ts +74 -0
- package/src/models/operations/listauditevidence.ts +83 -0
- package/src/models/operations/listauditevidenceurls.ts +80 -0
- package/src/models/operations/listaudits.ts +79 -0
- package/src/models/operations/updateauditevidence.ts +84 -0
- package/src/sdk/auditors.ts +27 -0
- package/src/sdk/audits.ts +172 -0
- package/src/sdk/index.ts +5 -0
- package/src/sdk/sdk.ts +19 -0
- package/src/types/blobs.ts +31 -0
- package/src/types/constdatetime.ts +15 -0
- package/src/types/enums.ts +16 -0
- package/src/types/fp.ts +50 -0
- package/src/types/index.ts +11 -0
- package/src/types/operations.ts +105 -0
- package/src/types/rfcdate.ts +54 -0
- package/src/types/streams.ts +21 -0
- package/types/blobs.d.ts +4 -0
- package/types/blobs.d.ts.map +1 -0
- package/types/blobs.js +62 -0
- package/types/blobs.js.map +1 -0
- package/types/constdatetime.d.ts +3 -0
- package/types/constdatetime.d.ts.map +1 -0
- package/types/constdatetime.js +46 -0
- package/types/constdatetime.js.map +1 -0
- package/types/enums.d.ts +12 -0
- package/types/enums.d.ts.map +1 -0
- package/types/enums.js +10 -0
- package/types/enums.js.map +1 -0
- package/types/fp.d.ts +31 -0
- package/types/fp.d.ts.map +1 -0
- package/types/fp.js +37 -0
- package/types/fp.js.map +1 -0
- package/types/index.d.ts +8 -0
- package/types/index.d.ts.map +1 -0
- package/types/index.js +16 -0
- package/types/index.js.map +1 -0
- package/types/operations.d.ts +27 -0
- package/types/operations.d.ts.map +1 -0
- package/types/operations.js +83 -0
- package/types/operations.js.map +1 -0
- package/types/rfcdate.d.ts +21 -0
- package/types/rfcdate.d.ts.map +1 -0
- package/types/rfcdate.js +46 -0
- package/types/rfcdate.js.map +1 -0
- package/types/streams.d.ts +2 -0
- package/types/streams.d.ts.map +1 -0
- package/types/streams.js +18 -0
- package/types/streams.js.map +1 -0
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { VantaCore } from "../core.js";
|
|
6
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { safeParse } from "../lib/schemas.js";
|
|
9
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
10
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
|
+
import { pathToFunc } from "../lib/url.js";
|
|
12
|
+
import * as components from "../models/components/index.js";
|
|
13
|
+
import { APIError } from "../models/errors/apierror.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/httpclienterrors.js";
|
|
21
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
22
|
+
import * as operations from "../models/operations/index.js";
|
|
23
|
+
import { Result } from "../types/fp.js";
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Create a comment for audit evidence
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
* Create a comment in Vanta for a piece of evidence.
|
|
30
|
+
*/
|
|
31
|
+
export async function auditsCreateCommentForEvidence(
|
|
32
|
+
client: VantaCore,
|
|
33
|
+
request: operations.CreateCommentForAuditEvidenceRequest,
|
|
34
|
+
options?: RequestOptions,
|
|
35
|
+
): Promise<
|
|
36
|
+
Result<
|
|
37
|
+
components.Comment,
|
|
38
|
+
| APIError
|
|
39
|
+
| SDKValidationError
|
|
40
|
+
| UnexpectedClientError
|
|
41
|
+
| InvalidRequestError
|
|
42
|
+
| RequestAbortedError
|
|
43
|
+
| RequestTimeoutError
|
|
44
|
+
| ConnectionError
|
|
45
|
+
>
|
|
46
|
+
> {
|
|
47
|
+
const parsed = safeParse(
|
|
48
|
+
request,
|
|
49
|
+
(value) =>
|
|
50
|
+
operations.CreateCommentForAuditEvidenceRequest$outboundSchema.parse(
|
|
51
|
+
value,
|
|
52
|
+
),
|
|
53
|
+
"Input validation failed",
|
|
54
|
+
);
|
|
55
|
+
if (!parsed.ok) {
|
|
56
|
+
return parsed;
|
|
57
|
+
}
|
|
58
|
+
const payload = parsed.value;
|
|
59
|
+
const body = encodeJSON("body", payload.AddCommentInput, { explode: true });
|
|
60
|
+
|
|
61
|
+
const pathParams = {
|
|
62
|
+
auditEvidenceId: encodeSimple("auditEvidenceId", payload.auditEvidenceId, {
|
|
63
|
+
explode: false,
|
|
64
|
+
charEncoding: "percent",
|
|
65
|
+
}),
|
|
66
|
+
auditId: encodeSimple("auditId", payload.auditId, {
|
|
67
|
+
explode: false,
|
|
68
|
+
charEncoding: "percent",
|
|
69
|
+
}),
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const path = pathToFunc(
|
|
73
|
+
"/audits/{auditId}/evidence/{auditEvidenceId}/comments",
|
|
74
|
+
)(pathParams);
|
|
75
|
+
|
|
76
|
+
const headers = new Headers({
|
|
77
|
+
"Content-Type": "application/json",
|
|
78
|
+
Accept: "application/json",
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
const secConfig = await extractSecurity(client._options.bearerAuth);
|
|
82
|
+
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
83
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
84
|
+
|
|
85
|
+
const context = {
|
|
86
|
+
operationID: "CreateCommentForAuditEvidence",
|
|
87
|
+
oAuth2Scopes: [],
|
|
88
|
+
|
|
89
|
+
resolvedSecurity: requestSecurity,
|
|
90
|
+
|
|
91
|
+
securitySource: client._options.bearerAuth,
|
|
92
|
+
retryConfig: options?.retries
|
|
93
|
+
|| client._options.retryConfig
|
|
94
|
+
|| { strategy: "none" },
|
|
95
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
const requestRes = client._createRequest(context, {
|
|
99
|
+
security: requestSecurity,
|
|
100
|
+
method: "POST",
|
|
101
|
+
baseURL: options?.serverURL,
|
|
102
|
+
path: path,
|
|
103
|
+
headers: headers,
|
|
104
|
+
body: body,
|
|
105
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
106
|
+
}, options);
|
|
107
|
+
if (!requestRes.ok) {
|
|
108
|
+
return requestRes;
|
|
109
|
+
}
|
|
110
|
+
const req = requestRes.value;
|
|
111
|
+
|
|
112
|
+
const doResult = await client._do(req, {
|
|
113
|
+
context,
|
|
114
|
+
errorCodes: ["4XX", "5XX"],
|
|
115
|
+
retryConfig: context.retryConfig,
|
|
116
|
+
retryCodes: context.retryCodes,
|
|
117
|
+
});
|
|
118
|
+
if (!doResult.ok) {
|
|
119
|
+
return doResult;
|
|
120
|
+
}
|
|
121
|
+
const response = doResult.value;
|
|
122
|
+
|
|
123
|
+
const [result] = await M.match<
|
|
124
|
+
components.Comment,
|
|
125
|
+
| APIError
|
|
126
|
+
| SDKValidationError
|
|
127
|
+
| UnexpectedClientError
|
|
128
|
+
| InvalidRequestError
|
|
129
|
+
| RequestAbortedError
|
|
130
|
+
| RequestTimeoutError
|
|
131
|
+
| ConnectionError
|
|
132
|
+
>(
|
|
133
|
+
M.json(200, components.Comment$inboundSchema),
|
|
134
|
+
M.fail(["4XX", "5XX"]),
|
|
135
|
+
)(response);
|
|
136
|
+
if (!result.ok) {
|
|
137
|
+
return result;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
return result;
|
|
141
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { VantaCore } from "../core.js";
|
|
6
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { safeParse } from "../lib/schemas.js";
|
|
9
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
10
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
|
+
import { pathToFunc } from "../lib/url.js";
|
|
12
|
+
import * as components from "../models/components/index.js";
|
|
13
|
+
import { APIError } from "../models/errors/apierror.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/httpclienterrors.js";
|
|
21
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
22
|
+
import * as operations from "../models/operations/index.js";
|
|
23
|
+
import { Result } from "../types/fp.js";
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Create a custom control for an audit
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
* Create a custom control for an audit.
|
|
30
|
+
*/
|
|
31
|
+
export async function auditsCreateCustomControl(
|
|
32
|
+
client: VantaCore,
|
|
33
|
+
request: operations.CreateCustomControlRequest,
|
|
34
|
+
options?: RequestOptions,
|
|
35
|
+
): Promise<
|
|
36
|
+
Result<
|
|
37
|
+
components.Control,
|
|
38
|
+
| APIError
|
|
39
|
+
| SDKValidationError
|
|
40
|
+
| UnexpectedClientError
|
|
41
|
+
| InvalidRequestError
|
|
42
|
+
| RequestAbortedError
|
|
43
|
+
| RequestTimeoutError
|
|
44
|
+
| ConnectionError
|
|
45
|
+
>
|
|
46
|
+
> {
|
|
47
|
+
const parsed = safeParse(
|
|
48
|
+
request,
|
|
49
|
+
(value) =>
|
|
50
|
+
operations.CreateCustomControlRequest$outboundSchema.parse(value),
|
|
51
|
+
"Input validation failed",
|
|
52
|
+
);
|
|
53
|
+
if (!parsed.ok) {
|
|
54
|
+
return parsed;
|
|
55
|
+
}
|
|
56
|
+
const payload = parsed.value;
|
|
57
|
+
const body = encodeJSON("body", payload.CreateCustomControlInput, {
|
|
58
|
+
explode: true,
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
const pathParams = {
|
|
62
|
+
auditId: encodeSimple("auditId", payload.auditId, {
|
|
63
|
+
explode: false,
|
|
64
|
+
charEncoding: "percent",
|
|
65
|
+
}),
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const path = pathToFunc("/audits/{auditId}/controls/custom-controls")(
|
|
69
|
+
pathParams,
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
const headers = new Headers({
|
|
73
|
+
"Content-Type": "application/json",
|
|
74
|
+
Accept: "application/json",
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
const secConfig = await extractSecurity(client._options.bearerAuth);
|
|
78
|
+
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
79
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
80
|
+
|
|
81
|
+
const context = {
|
|
82
|
+
operationID: "CreateCustomControl",
|
|
83
|
+
oAuth2Scopes: [],
|
|
84
|
+
|
|
85
|
+
resolvedSecurity: requestSecurity,
|
|
86
|
+
|
|
87
|
+
securitySource: client._options.bearerAuth,
|
|
88
|
+
retryConfig: options?.retries
|
|
89
|
+
|| client._options.retryConfig
|
|
90
|
+
|| { strategy: "none" },
|
|
91
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
const requestRes = client._createRequest(context, {
|
|
95
|
+
security: requestSecurity,
|
|
96
|
+
method: "POST",
|
|
97
|
+
baseURL: options?.serverURL,
|
|
98
|
+
path: path,
|
|
99
|
+
headers: headers,
|
|
100
|
+
body: body,
|
|
101
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
102
|
+
}, options);
|
|
103
|
+
if (!requestRes.ok) {
|
|
104
|
+
return requestRes;
|
|
105
|
+
}
|
|
106
|
+
const req = requestRes.value;
|
|
107
|
+
|
|
108
|
+
const doResult = await client._do(req, {
|
|
109
|
+
context,
|
|
110
|
+
errorCodes: ["4XX", "5XX"],
|
|
111
|
+
retryConfig: context.retryConfig,
|
|
112
|
+
retryCodes: context.retryCodes,
|
|
113
|
+
});
|
|
114
|
+
if (!doResult.ok) {
|
|
115
|
+
return doResult;
|
|
116
|
+
}
|
|
117
|
+
const response = doResult.value;
|
|
118
|
+
|
|
119
|
+
const [result] = await M.match<
|
|
120
|
+
components.Control,
|
|
121
|
+
| APIError
|
|
122
|
+
| SDKValidationError
|
|
123
|
+
| UnexpectedClientError
|
|
124
|
+
| InvalidRequestError
|
|
125
|
+
| RequestAbortedError
|
|
126
|
+
| RequestTimeoutError
|
|
127
|
+
| ConnectionError
|
|
128
|
+
>(
|
|
129
|
+
M.json(201, components.Control$inboundSchema),
|
|
130
|
+
M.fail(["4XX", "5XX"]),
|
|
131
|
+
)(response);
|
|
132
|
+
if (!result.ok) {
|
|
133
|
+
return result;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return result;
|
|
137
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { VantaCore } from "../core.js";
|
|
6
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { safeParse } from "../lib/schemas.js";
|
|
9
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
10
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
|
+
import { pathToFunc } from "../lib/url.js";
|
|
12
|
+
import * as components from "../models/components/index.js";
|
|
13
|
+
import { APIError } from "../models/errors/apierror.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/httpclienterrors.js";
|
|
21
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
22
|
+
import * as operations from "../models/operations/index.js";
|
|
23
|
+
import { Result } from "../types/fp.js";
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Create a custom evidence request for an audit
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
* Create a custom evidence request for an audit.
|
|
30
|
+
*/
|
|
31
|
+
export async function auditsCreateCustomEvidenceRequest(
|
|
32
|
+
client: VantaCore,
|
|
33
|
+
request: operations.CreateCustomEvidenceRequestRequest,
|
|
34
|
+
options?: RequestOptions,
|
|
35
|
+
): Promise<
|
|
36
|
+
Result<
|
|
37
|
+
components.CustomEvidenceRequest,
|
|
38
|
+
| APIError
|
|
39
|
+
| SDKValidationError
|
|
40
|
+
| UnexpectedClientError
|
|
41
|
+
| InvalidRequestError
|
|
42
|
+
| RequestAbortedError
|
|
43
|
+
| RequestTimeoutError
|
|
44
|
+
| ConnectionError
|
|
45
|
+
>
|
|
46
|
+
> {
|
|
47
|
+
const parsed = safeParse(
|
|
48
|
+
request,
|
|
49
|
+
(value) =>
|
|
50
|
+
operations.CreateCustomEvidenceRequestRequest$outboundSchema.parse(value),
|
|
51
|
+
"Input validation failed",
|
|
52
|
+
);
|
|
53
|
+
if (!parsed.ok) {
|
|
54
|
+
return parsed;
|
|
55
|
+
}
|
|
56
|
+
const payload = parsed.value;
|
|
57
|
+
const body = encodeJSON("body", payload.CreateCustomEvidenceRequestInput, {
|
|
58
|
+
explode: true,
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
const pathParams = {
|
|
62
|
+
auditId: encodeSimple("auditId", payload.auditId, {
|
|
63
|
+
explode: false,
|
|
64
|
+
charEncoding: "percent",
|
|
65
|
+
}),
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const path = pathToFunc(
|
|
69
|
+
"/audits/{auditId}/evidence/custom-evidence-requests",
|
|
70
|
+
)(pathParams);
|
|
71
|
+
|
|
72
|
+
const headers = new Headers({
|
|
73
|
+
"Content-Type": "application/json",
|
|
74
|
+
Accept: "application/json",
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
const secConfig = await extractSecurity(client._options.bearerAuth);
|
|
78
|
+
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
79
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
80
|
+
|
|
81
|
+
const context = {
|
|
82
|
+
operationID: "CreateCustomEvidenceRequest",
|
|
83
|
+
oAuth2Scopes: [],
|
|
84
|
+
|
|
85
|
+
resolvedSecurity: requestSecurity,
|
|
86
|
+
|
|
87
|
+
securitySource: client._options.bearerAuth,
|
|
88
|
+
retryConfig: options?.retries
|
|
89
|
+
|| client._options.retryConfig
|
|
90
|
+
|| { strategy: "none" },
|
|
91
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
const requestRes = client._createRequest(context, {
|
|
95
|
+
security: requestSecurity,
|
|
96
|
+
method: "POST",
|
|
97
|
+
baseURL: options?.serverURL,
|
|
98
|
+
path: path,
|
|
99
|
+
headers: headers,
|
|
100
|
+
body: body,
|
|
101
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
102
|
+
}, options);
|
|
103
|
+
if (!requestRes.ok) {
|
|
104
|
+
return requestRes;
|
|
105
|
+
}
|
|
106
|
+
const req = requestRes.value;
|
|
107
|
+
|
|
108
|
+
const doResult = await client._do(req, {
|
|
109
|
+
context,
|
|
110
|
+
errorCodes: ["4XX", "5XX"],
|
|
111
|
+
retryConfig: context.retryConfig,
|
|
112
|
+
retryCodes: context.retryCodes,
|
|
113
|
+
});
|
|
114
|
+
if (!doResult.ok) {
|
|
115
|
+
return doResult;
|
|
116
|
+
}
|
|
117
|
+
const response = doResult.value;
|
|
118
|
+
|
|
119
|
+
const [result] = await M.match<
|
|
120
|
+
components.CustomEvidenceRequest,
|
|
121
|
+
| APIError
|
|
122
|
+
| SDKValidationError
|
|
123
|
+
| UnexpectedClientError
|
|
124
|
+
| InvalidRequestError
|
|
125
|
+
| RequestAbortedError
|
|
126
|
+
| RequestTimeoutError
|
|
127
|
+
| ConnectionError
|
|
128
|
+
>(
|
|
129
|
+
M.json(200, components.CustomEvidenceRequest$inboundSchema),
|
|
130
|
+
M.fail(["4XX", "5XX"]),
|
|
131
|
+
)(response);
|
|
132
|
+
if (!result.ok) {
|
|
133
|
+
return result;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return result;
|
|
137
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
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 * as M from "../lib/matchers.js";
|
|
8
|
+
import { safeParse } from "../lib/schemas.js";
|
|
9
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
10
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
|
+
import { pathToFunc } from "../lib/url.js";
|
|
12
|
+
import * as components from "../models/components/index.js";
|
|
13
|
+
import { APIError } from "../models/errors/apierror.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/httpclienterrors.js";
|
|
21
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
22
|
+
import * as operations from "../models/operations/index.js";
|
|
23
|
+
import { Result } from "../types/fp.js";
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* List audit evidence url
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
* Returns a paginated list of evidence urls for an audit.
|
|
30
|
+
*/
|
|
31
|
+
export async function auditsGetEvidenceUrls(
|
|
32
|
+
client: VantaCore,
|
|
33
|
+
request: operations.ListAuditEvidenceUrlsRequest,
|
|
34
|
+
options?: RequestOptions,
|
|
35
|
+
): Promise<
|
|
36
|
+
Result<
|
|
37
|
+
components.PaginatedResponseEvidenceUrl,
|
|
38
|
+
| APIError
|
|
39
|
+
| SDKValidationError
|
|
40
|
+
| UnexpectedClientError
|
|
41
|
+
| InvalidRequestError
|
|
42
|
+
| RequestAbortedError
|
|
43
|
+
| RequestTimeoutError
|
|
44
|
+
| ConnectionError
|
|
45
|
+
>
|
|
46
|
+
> {
|
|
47
|
+
const parsed = safeParse(
|
|
48
|
+
request,
|
|
49
|
+
(value) =>
|
|
50
|
+
operations.ListAuditEvidenceUrlsRequest$outboundSchema.parse(value),
|
|
51
|
+
"Input validation failed",
|
|
52
|
+
);
|
|
53
|
+
if (!parsed.ok) {
|
|
54
|
+
return parsed;
|
|
55
|
+
}
|
|
56
|
+
const payload = parsed.value;
|
|
57
|
+
const body = null;
|
|
58
|
+
|
|
59
|
+
const pathParams = {
|
|
60
|
+
auditEvidenceId: encodeSimple("auditEvidenceId", payload.auditEvidenceId, {
|
|
61
|
+
explode: false,
|
|
62
|
+
charEncoding: "percent",
|
|
63
|
+
}),
|
|
64
|
+
auditId: encodeSimple("auditId", payload.auditId, {
|
|
65
|
+
explode: false,
|
|
66
|
+
charEncoding: "percent",
|
|
67
|
+
}),
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const path = pathToFunc("/audits/{auditId}/evidence/{auditEvidenceId}/urls")(
|
|
71
|
+
pathParams,
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
const query = encodeFormQuery({
|
|
75
|
+
"pageCursor": payload.pageCursor,
|
|
76
|
+
"pageSize": payload.pageSize,
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
const headers = new Headers({
|
|
80
|
+
Accept: "application/json",
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
const secConfig = await extractSecurity(client._options.bearerAuth);
|
|
84
|
+
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
85
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
86
|
+
|
|
87
|
+
const context = {
|
|
88
|
+
operationID: "ListAuditEvidenceUrls",
|
|
89
|
+
oAuth2Scopes: [],
|
|
90
|
+
|
|
91
|
+
resolvedSecurity: requestSecurity,
|
|
92
|
+
|
|
93
|
+
securitySource: client._options.bearerAuth,
|
|
94
|
+
retryConfig: options?.retries
|
|
95
|
+
|| client._options.retryConfig
|
|
96
|
+
|| { strategy: "none" },
|
|
97
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const requestRes = client._createRequest(context, {
|
|
101
|
+
security: requestSecurity,
|
|
102
|
+
method: "GET",
|
|
103
|
+
baseURL: options?.serverURL,
|
|
104
|
+
path: path,
|
|
105
|
+
headers: headers,
|
|
106
|
+
query: query,
|
|
107
|
+
body: body,
|
|
108
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
109
|
+
}, options);
|
|
110
|
+
if (!requestRes.ok) {
|
|
111
|
+
return requestRes;
|
|
112
|
+
}
|
|
113
|
+
const req = requestRes.value;
|
|
114
|
+
|
|
115
|
+
const doResult = await client._do(req, {
|
|
116
|
+
context,
|
|
117
|
+
errorCodes: ["4XX", "5XX"],
|
|
118
|
+
retryConfig: context.retryConfig,
|
|
119
|
+
retryCodes: context.retryCodes,
|
|
120
|
+
});
|
|
121
|
+
if (!doResult.ok) {
|
|
122
|
+
return doResult;
|
|
123
|
+
}
|
|
124
|
+
const response = doResult.value;
|
|
125
|
+
|
|
126
|
+
const [result] = await M.match<
|
|
127
|
+
components.PaginatedResponseEvidenceUrl,
|
|
128
|
+
| APIError
|
|
129
|
+
| SDKValidationError
|
|
130
|
+
| UnexpectedClientError
|
|
131
|
+
| InvalidRequestError
|
|
132
|
+
| RequestAbortedError
|
|
133
|
+
| RequestTimeoutError
|
|
134
|
+
| ConnectionError
|
|
135
|
+
>(
|
|
136
|
+
M.json(200, components.PaginatedResponseEvidenceUrl$inboundSchema),
|
|
137
|
+
M.fail(["4XX", "5XX"]),
|
|
138
|
+
)(response);
|
|
139
|
+
if (!result.ok) {
|
|
140
|
+
return result;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return result;
|
|
144
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { VantaCore } from "../core.js";
|
|
6
|
+
import { encodeFormQuery } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { safeParse } from "../lib/schemas.js";
|
|
9
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
10
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
|
+
import { pathToFunc } from "../lib/url.js";
|
|
12
|
+
import * as components from "../models/components/index.js";
|
|
13
|
+
import { APIError } from "../models/errors/apierror.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/httpclienterrors.js";
|
|
21
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
22
|
+
import * as operations from "../models/operations/index.js";
|
|
23
|
+
import { Result } from "../types/fp.js";
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* List audits
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
* Returns a paginated list of audits scoped to the audit firm.
|
|
30
|
+
*/
|
|
31
|
+
export async function auditsList(
|
|
32
|
+
client: VantaCore,
|
|
33
|
+
request: operations.ListAuditsRequest,
|
|
34
|
+
options?: RequestOptions,
|
|
35
|
+
): Promise<
|
|
36
|
+
Result<
|
|
37
|
+
components.PaginatedResponseAudit,
|
|
38
|
+
| APIError
|
|
39
|
+
| SDKValidationError
|
|
40
|
+
| UnexpectedClientError
|
|
41
|
+
| InvalidRequestError
|
|
42
|
+
| RequestAbortedError
|
|
43
|
+
| RequestTimeoutError
|
|
44
|
+
| ConnectionError
|
|
45
|
+
>
|
|
46
|
+
> {
|
|
47
|
+
const parsed = safeParse(
|
|
48
|
+
request,
|
|
49
|
+
(value) => operations.ListAuditsRequest$outboundSchema.parse(value),
|
|
50
|
+
"Input validation failed",
|
|
51
|
+
);
|
|
52
|
+
if (!parsed.ok) {
|
|
53
|
+
return parsed;
|
|
54
|
+
}
|
|
55
|
+
const payload = parsed.value;
|
|
56
|
+
const body = null;
|
|
57
|
+
|
|
58
|
+
const path = pathToFunc("/audits")();
|
|
59
|
+
|
|
60
|
+
const query = encodeFormQuery({
|
|
61
|
+
"changedSinceDate": payload.changedSinceDate,
|
|
62
|
+
"pageCursor": payload.pageCursor,
|
|
63
|
+
"pageSize": payload.pageSize,
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
const headers = new Headers({
|
|
67
|
+
Accept: "application/json",
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
const secConfig = await extractSecurity(client._options.bearerAuth);
|
|
71
|
+
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
72
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
73
|
+
|
|
74
|
+
const context = {
|
|
75
|
+
operationID: "ListAudits",
|
|
76
|
+
oAuth2Scopes: [],
|
|
77
|
+
|
|
78
|
+
resolvedSecurity: requestSecurity,
|
|
79
|
+
|
|
80
|
+
securitySource: client._options.bearerAuth,
|
|
81
|
+
retryConfig: options?.retries
|
|
82
|
+
|| client._options.retryConfig
|
|
83
|
+
|| { strategy: "none" },
|
|
84
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const requestRes = client._createRequest(context, {
|
|
88
|
+
security: requestSecurity,
|
|
89
|
+
method: "GET",
|
|
90
|
+
baseURL: options?.serverURL,
|
|
91
|
+
path: path,
|
|
92
|
+
headers: headers,
|
|
93
|
+
query: query,
|
|
94
|
+
body: body,
|
|
95
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
96
|
+
}, options);
|
|
97
|
+
if (!requestRes.ok) {
|
|
98
|
+
return requestRes;
|
|
99
|
+
}
|
|
100
|
+
const req = requestRes.value;
|
|
101
|
+
|
|
102
|
+
const doResult = await client._do(req, {
|
|
103
|
+
context,
|
|
104
|
+
errorCodes: ["4XX", "5XX"],
|
|
105
|
+
retryConfig: context.retryConfig,
|
|
106
|
+
retryCodes: context.retryCodes,
|
|
107
|
+
});
|
|
108
|
+
if (!doResult.ok) {
|
|
109
|
+
return doResult;
|
|
110
|
+
}
|
|
111
|
+
const response = doResult.value;
|
|
112
|
+
|
|
113
|
+
const [result] = await M.match<
|
|
114
|
+
components.PaginatedResponseAudit,
|
|
115
|
+
| APIError
|
|
116
|
+
| SDKValidationError
|
|
117
|
+
| UnexpectedClientError
|
|
118
|
+
| InvalidRequestError
|
|
119
|
+
| RequestAbortedError
|
|
120
|
+
| RequestTimeoutError
|
|
121
|
+
| ConnectionError
|
|
122
|
+
>(
|
|
123
|
+
M.json(200, components.PaginatedResponseAudit$inboundSchema),
|
|
124
|
+
M.fail(["4XX", "5XX"]),
|
|
125
|
+
)(response);
|
|
126
|
+
if (!result.ok) {
|
|
127
|
+
return result;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return result;
|
|
131
|
+
}
|