@skyvern/client 1.0.24 → 1.0.55
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/README.md +2 -49
- package/dist/cjs/Client.d.ts +587 -170
- package/dist/cjs/Client.js +2478 -682
- package/dist/cjs/api/client/requests/BatchGetRunTagsRequest.d.ts +10 -0
- package/dist/cjs/api/client/requests/BatchGetWorkflowTagsRequest.d.ts +10 -0
- package/dist/cjs/api/client/requests/BodyUploadFileV1UploadFilePost.d.ts +2 -3
- package/dist/cjs/api/client/requests/BulkCancelRunsRequest.d.ts +10 -0
- package/dist/cjs/api/client/requests/CreateBrowserProfileRequest.d.ts +13 -2
- package/dist/cjs/api/client/requests/CreateBrowserSessionRequest.d.ts +51 -1
- package/dist/cjs/api/client/requests/CustomLlmCreateRequest.d.ts +14 -0
- package/dist/cjs/api/client/requests/CustomLlmUpdateRequest.d.ts +14 -0
- package/dist/cjs/api/client/requests/DownloadFilesRequest.d.ts +4 -0
- package/dist/cjs/api/client/requests/GetCredentialsRequest.d.ts +11 -1
- package/dist/cjs/api/client/requests/GetRunTagHistoryRequest.d.ts +16 -0
- package/dist/cjs/api/client/requests/GetRunsV2Request.d.ts +17 -0
- package/dist/cjs/api/client/requests/GetWorkflowRunsByIdRequest.d.ts +28 -0
- package/dist/cjs/api/client/requests/GetWorkflowTagHistoryRequest.d.ts +16 -0
- package/dist/cjs/api/client/requests/GetWorkflowsRequest.d.ts +2 -0
- package/dist/cjs/api/client/requests/ListBrowserProfilesRequest.d.ts +11 -1
- package/dist/cjs/api/client/requests/ListTagValuesRequest.d.ts +10 -0
- package/dist/cjs/api/client/requests/LoginRequest.d.ts +5 -1
- package/dist/cjs/api/client/requests/RetryWorkflowRunRequest.d.ts +11 -0
- package/dist/cjs/api/client/requests/RetryWorkflowRunRequest.js +3 -0
- package/dist/cjs/api/client/requests/RunTagsBatchRequest.d.ts +8 -0
- package/dist/cjs/api/client/requests/RunTagsBatchRequest.js +3 -0
- package/dist/cjs/api/client/requests/TagKeyUpdate.d.ts +8 -0
- package/dist/cjs/api/client/requests/TagKeyUpdate.js +3 -0
- package/dist/cjs/api/client/requests/TagValueDelete.d.ts +10 -0
- package/dist/cjs/api/client/requests/TagValueDelete.js +3 -0
- package/dist/cjs/api/client/requests/TagValueRename.d.ts +13 -0
- package/dist/cjs/api/client/requests/TagValueRename.js +3 -0
- package/dist/cjs/api/client/requests/TagValueUpdate.d.ts +13 -0
- package/dist/cjs/api/client/requests/TagValueUpdate.js +3 -0
- package/dist/cjs/api/client/requests/TaskRunRequestInput.d.ts +153 -0
- package/dist/cjs/api/client/requests/TaskRunRequestInput.js +3 -0
- package/dist/cjs/api/client/requests/UpdateBrowserProfileRequest.d.ts +23 -0
- package/dist/cjs/api/client/requests/UpdateBrowserProfileRequest.js +3 -0
- package/dist/cjs/api/client/requests/UpdateBrowserSessionRequest.d.ts +10 -0
- package/dist/cjs/api/client/requests/UpdateBrowserSessionRequest.js +3 -0
- package/dist/cjs/api/client/requests/WorkflowRunRequestInput.d.ts +128 -0
- package/dist/cjs/api/client/requests/WorkflowRunRequestInput.js +3 -0
- package/dist/cjs/api/client/requests/WorkflowTagsBatchRequest.d.ts +8 -0
- package/dist/cjs/api/client/requests/WorkflowTagsBatchRequest.js +3 -0
- package/dist/cjs/api/client/requests/index.d.ts +21 -4
- package/dist/cjs/api/errors/InternalServerError.d.ts +5 -0
- package/dist/cjs/api/errors/InternalServerError.js +50 -0
- package/dist/cjs/api/errors/RangeNotSatisfiableError.d.ts +5 -0
- package/dist/cjs/api/errors/RangeNotSatisfiableError.js +50 -0
- package/dist/cjs/api/errors/index.d.ts +2 -0
- package/dist/cjs/api/errors/index.js +2 -0
- package/dist/cjs/api/resources/agents/client/Client.d.ts +27 -0
- package/dist/cjs/api/resources/agents/client/Client.js +122 -0
- package/dist/cjs/api/resources/agents/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/agents/client/index.js +2 -0
- package/dist/cjs/api/resources/agents/index.d.ts +1 -0
- package/dist/cjs/api/resources/agents/index.js +17 -0
- package/dist/cjs/api/resources/artifacts/client/Client.d.ts +28 -0
- package/dist/cjs/api/resources/artifacts/client/Client.js +125 -0
- package/dist/cjs/api/resources/artifacts/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/artifacts/client/index.js +2 -0
- package/dist/cjs/api/resources/artifacts/index.d.ts +1 -0
- package/dist/cjs/api/resources/artifacts/index.js +17 -0
- package/dist/cjs/api/resources/index.d.ts +5 -0
- package/dist/cjs/api/resources/index.js +9 -1
- package/dist/cjs/api/resources/schedules/client/Client.d.ts +119 -0
- package/dist/cjs/api/resources/schedules/client/Client.js +554 -0
- package/dist/cjs/api/resources/schedules/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/schedules/client/index.js +17 -0
- package/dist/cjs/api/resources/schedules/client/requests/SchedulesListAllRequest.d.ts +18 -0
- package/dist/cjs/api/resources/schedules/client/requests/SchedulesListAllRequest.js +3 -0
- package/dist/cjs/api/resources/schedules/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/schedules/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/schedules/index.d.ts +2 -0
- package/dist/cjs/api/resources/schedules/index.js +18 -0
- package/dist/cjs/api/resources/schedules/types/SchedulesListAllRequestStatus.d.ts +5 -0
- package/dist/cjs/api/resources/schedules/types/SchedulesListAllRequestStatus.js +8 -0
- package/dist/cjs/api/resources/schedules/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/schedules/types/index.js +17 -0
- package/dist/cjs/api/types/Action.d.ts +5 -0
- package/dist/cjs/api/types/ActionBlock.d.ts +4 -0
- package/dist/cjs/api/types/ActionBlockYaml.d.ts +3 -0
- package/dist/cjs/api/types/ActionType.d.ts +5 -0
- package/dist/cjs/api/types/ActionType.js +5 -0
- package/dist/cjs/api/types/AiFallbackMode.d.ts +14 -0
- package/dist/cjs/api/types/AiFallbackMode.js +17 -0
- package/dist/cjs/api/types/Artifact.d.ts +5 -0
- package/dist/cjs/api/types/ArtifactType.d.ts +5 -0
- package/dist/cjs/api/types/ArtifactType.js +5 -0
- package/dist/cjs/api/types/BlockType.d.ts +6 -0
- package/dist/cjs/api/types/BlockType.js +6 -0
- package/dist/cjs/api/types/BrowserProfile.d.ts +10 -0
- package/dist/cjs/api/types/BrowserSessionResponse.d.ts +2 -0
- package/dist/cjs/api/types/BulkCancelRunsResponse.d.ts +6 -0
- package/dist/cjs/api/types/BulkCancelRunsResponse.js +3 -0
- package/dist/cjs/api/types/ClearOrganizationAuthTokenResponse.d.ts +7 -0
- package/dist/cjs/api/types/ClearOrganizationAuthTokenResponse.js +3 -0
- package/dist/cjs/api/types/CodeBlock.d.ts +3 -0
- package/dist/cjs/api/types/CodeBlockStep.d.ts +8 -0
- package/dist/cjs/api/types/CodeBlockStep.js +3 -0
- package/dist/cjs/api/types/CodeBlockStepYaml.d.ts +7 -0
- package/dist/cjs/api/types/CodeBlockStepYaml.js +3 -0
- package/dist/cjs/api/types/CodeBlockYaml.d.ts +4 -0
- package/dist/cjs/api/types/ConditionalBlock.d.ts +1 -0
- package/dist/cjs/api/types/ConditionalBlockYaml.d.ts +1 -0
- package/dist/cjs/api/types/CreateCredentialRequest.d.ts +12 -0
- package/dist/cjs/api/types/CredentialParameter.d.ts +2 -0
- package/dist/cjs/api/types/CredentialParameterYaml.d.ts +2 -0
- package/dist/cjs/api/types/CredentialResponse.d.ts +16 -0
- package/dist/cjs/api/types/CredentialVaultType.d.ts +8 -0
- package/dist/cjs/api/types/CredentialVaultType.js +11 -0
- package/dist/cjs/api/types/CreditCardBillingAddress.d.ts +21 -0
- package/dist/cjs/api/types/CreditCardBillingAddress.js +3 -0
- package/dist/cjs/api/types/CreditCardCredentialResponse.d.ts +2 -1
- package/dist/cjs/api/types/CustomLlm.d.ts +9 -0
- package/dist/cjs/api/types/CustomLlm.js +3 -0
- package/dist/cjs/api/types/CustomLlmConfig.d.ts +14 -0
- package/dist/cjs/api/types/CustomLlmConfig.js +3 -0
- package/dist/cjs/api/types/CustomLlmListResponse.d.ts +4 -0
- package/dist/cjs/api/types/CustomLlmListResponse.js +3 -0
- package/dist/cjs/api/types/CustomLlmProvider.d.ts +6 -0
- package/dist/cjs/api/types/CustomLlmProvider.js +9 -0
- package/dist/cjs/api/types/CustomLlmResponse.d.ts +4 -0
- package/dist/cjs/api/types/CustomLlmResponse.js +3 -0
- package/dist/cjs/api/types/DeleteScheduleResponse.d.ts +3 -0
- package/dist/cjs/api/types/DeleteScheduleResponse.js +3 -0
- package/dist/cjs/api/types/DownloadToS3Block.d.ts +1 -0
- package/dist/cjs/api/types/DownloadToS3BlockYaml.d.ts +1 -0
- package/dist/cjs/api/types/EmailInboxBlock.d.ts +30 -0
- package/dist/cjs/api/types/EmailInboxBlock.js +11 -0
- package/dist/cjs/api/types/EmailInboxBlockParametersItem.d.ts +37 -0
- package/dist/cjs/api/types/EmailInboxBlockParametersItem.js +3 -0
- package/dist/cjs/api/types/EmailInboxBlockYaml.d.ts +27 -0
- package/dist/cjs/api/types/EmailInboxBlockYaml.js +11 -0
- package/dist/cjs/api/types/ExtractionBlock.d.ts +2 -0
- package/dist/cjs/api/types/ExtractionBlockYaml.d.ts +1 -0
- package/dist/cjs/api/types/FileDownloadBlock.d.ts +2 -0
- package/dist/cjs/api/types/FileDownloadBlockYaml.d.ts +1 -0
- package/dist/cjs/api/types/FileInfo.d.ts +4 -0
- package/dist/cjs/api/types/FileParserBlock.d.ts +2 -1
- package/dist/cjs/api/types/FileParserBlockYaml.d.ts +2 -1
- package/dist/cjs/api/types/FileStorageType.d.ts +2 -0
- package/dist/cjs/api/types/FileStorageType.js +2 -0
- package/dist/cjs/api/types/FileType.d.ts +2 -0
- package/dist/cjs/api/types/FileType.js +2 -0
- package/dist/cjs/api/types/FileUploadBlock.d.ts +15 -0
- package/dist/cjs/api/types/FileUploadBlockYaml.d.ts +13 -0
- package/dist/cjs/api/types/ForLoopBlock.d.ts +1 -0
- package/dist/cjs/api/types/ForLoopBlockLoopBlocksItem.d.ts +19 -1
- package/dist/cjs/api/types/ForLoopBlockYaml.d.ts +1 -0
- package/dist/cjs/api/types/ForLoopBlockYamlLoopBlocksItem.d.ts +19 -1
- package/dist/cjs/api/types/GeoTarget.d.ts +1 -11
- package/dist/cjs/api/types/GetRunResponse.d.ts +4 -1
- package/dist/cjs/api/types/GoogleSheetsReadBlock.d.ts +19 -0
- package/dist/cjs/api/types/GoogleSheetsReadBlock.js +3 -0
- package/dist/cjs/api/types/GoogleSheetsReadBlockParametersItem.d.ts +37 -0
- package/dist/cjs/api/types/GoogleSheetsReadBlockParametersItem.js +3 -0
- package/dist/cjs/api/types/GoogleSheetsReadBlockYaml.d.ts +16 -0
- package/dist/cjs/api/types/GoogleSheetsReadBlockYaml.js +3 -0
- package/dist/cjs/api/types/GoogleSheetsWriteBlock.d.ts +29 -0
- package/dist/cjs/api/types/GoogleSheetsWriteBlock.js +11 -0
- package/dist/cjs/api/types/GoogleSheetsWriteBlockParametersItem.d.ts +37 -0
- package/dist/cjs/api/types/GoogleSheetsWriteBlockParametersItem.js +3 -0
- package/dist/cjs/api/types/GoogleSheetsWriteBlockYaml.d.ts +26 -0
- package/dist/cjs/api/types/GoogleSheetsWriteBlockYaml.js +11 -0
- package/dist/cjs/api/types/HttpRequestBlock.d.ts +2 -0
- package/dist/cjs/api/types/HttpRequestBlockYaml.d.ts +2 -0
- package/dist/cjs/api/types/HumanInteractionBlock.d.ts +2 -0
- package/dist/cjs/api/types/HumanInteractionBlockYaml.d.ts +1 -0
- package/dist/cjs/api/types/LoginBlock.d.ts +3 -0
- package/dist/cjs/api/types/LoginBlockYaml.d.ts +2 -0
- package/dist/cjs/api/types/NavigationBlock.d.ts +2 -0
- package/dist/cjs/api/types/NavigationBlockYaml.d.ts +1 -0
- package/dist/cjs/api/types/NonEmptyCreditCardCredential.d.ts +9 -0
- package/dist/cjs/api/types/OrganizationScheduleItem.d.ts +23 -0
- package/dist/cjs/api/types/OrganizationScheduleItem.js +3 -0
- package/dist/cjs/api/types/OrganizationScheduleListResponse.d.ts +7 -0
- package/dist/cjs/api/types/OrganizationScheduleListResponse.js +3 -0
- package/dist/cjs/api/types/PasswordCredentialResponse.d.ts +1 -1
- package/dist/cjs/api/types/PdfFillBlock.d.ts +21 -0
- package/dist/cjs/api/types/PdfFillBlock.js +3 -0
- package/dist/cjs/api/types/PdfFillBlockParametersItem.d.ts +37 -0
- package/dist/cjs/api/types/PdfFillBlockParametersItem.js +3 -0
- package/dist/cjs/api/types/PdfFillBlockYaml.d.ts +18 -0
- package/dist/cjs/api/types/PdfFillBlockYaml.js +3 -0
- package/dist/cjs/api/types/PdfParserBlock.d.ts +1 -0
- package/dist/cjs/api/types/PdfParserBlockYaml.d.ts +1 -0
- package/dist/cjs/api/types/PersistentBrowserType.d.ts +1 -0
- package/dist/cjs/api/types/PersistentBrowserType.js +1 -0
- package/dist/cjs/api/types/PrintPageBlock.d.ts +1 -0
- package/dist/cjs/api/types/PrintPageBlockYaml.d.ts +1 -0
- package/dist/cjs/api/types/ProxyLocation.d.ts +1 -0
- package/dist/cjs/api/types/ProxyLocation.js +1 -0
- package/dist/cjs/api/types/RunEngine.d.ts +1 -0
- package/dist/cjs/api/types/RunEngine.js +1 -0
- package/dist/cjs/api/types/RunTagHistoryResponse.d.ts +5 -0
- package/dist/cjs/api/types/RunTagHistoryResponse.js +3 -0
- package/dist/cjs/api/types/RunTagsBatchResponse.d.ts +11 -0
- package/dist/cjs/api/types/RunTagsBatchResponse.js +3 -0
- package/dist/cjs/api/types/RunTagsResponse.d.ts +8 -0
- package/dist/cjs/api/types/RunTagsResponse.js +3 -0
- package/dist/cjs/api/types/RunType.d.ts +10 -0
- package/dist/cjs/api/types/RunType.js +13 -0
- package/dist/cjs/api/types/RunWebhookReplayResponse.d.ts +22 -0
- package/dist/cjs/api/types/RunWebhookReplayResponse.js +3 -0
- package/dist/cjs/api/types/ScriptRunResponse.d.ts +2 -0
- package/dist/cjs/api/types/SendEmailBlock.d.ts +1 -0
- package/dist/cjs/api/types/SendEmailBlockYaml.d.ts +1 -0
- package/dist/cjs/api/types/SkyvernSchemasCredentialTypeCredentialType.d.ts +7 -0
- package/dist/cjs/api/types/{SkyvernSchemasRunBlocksCredentialType.js → SkyvernSchemasCredentialTypeCredentialType.js} +2 -2
- package/dist/cjs/api/types/SplitPdfBlock.d.ts +17 -0
- package/dist/cjs/api/types/SplitPdfBlock.js +3 -0
- package/dist/cjs/api/types/SplitPdfBlockParametersItem.d.ts +37 -0
- package/dist/cjs/api/types/SplitPdfBlockParametersItem.js +3 -0
- package/dist/cjs/api/types/SplitPdfBlockYaml.d.ts +14 -0
- package/dist/cjs/api/types/SplitPdfBlockYaml.js +3 -0
- package/dist/cjs/api/types/TagApplyRequest.d.ts +13 -0
- package/dist/cjs/api/types/TagApplyRequest.js +3 -0
- package/dist/cjs/api/types/TagDeleteInput.d.ts +10 -0
- package/dist/cjs/api/types/TagDeleteInput.js +3 -0
- package/dist/cjs/api/types/TagHistoryItem.d.ts +13 -0
- package/dist/cjs/api/types/TagHistoryItem.js +3 -0
- package/dist/cjs/api/types/TagHistoryResponse.d.ts +5 -0
- package/dist/cjs/api/types/TagHistoryResponse.js +3 -0
- package/dist/cjs/api/types/TagInput.d.ts +10 -0
- package/dist/cjs/api/types/TagInput.js +3 -0
- package/dist/cjs/api/types/TagItem.d.ts +8 -0
- package/dist/cjs/api/types/TagItem.js +3 -0
- package/dist/cjs/api/types/TagKey.d.ts +8 -0
- package/dist/cjs/api/types/TagKey.js +3 -0
- package/dist/cjs/api/types/TagKeyDeleteResponse.d.ts +9 -0
- package/dist/cjs/api/types/TagKeyDeleteResponse.js +3 -0
- package/dist/cjs/api/types/TagResponse.d.ts +11 -0
- package/dist/cjs/api/types/TagResponse.js +3 -0
- package/dist/cjs/api/types/TagValue.d.ts +11 -0
- package/dist/cjs/api/types/TagValue.js +3 -0
- package/dist/cjs/api/types/TagValueDeleteResponse.d.ts +10 -0
- package/dist/cjs/api/types/TagValueDeleteResponse.js +3 -0
- package/dist/cjs/api/types/TagValueRenameResponse.d.ts +10 -0
- package/dist/cjs/api/types/TagValueRenameResponse.js +3 -0
- package/dist/cjs/api/types/TagsResponse.d.ts +9 -0
- package/dist/cjs/api/types/TagsResponse.js +3 -0
- package/dist/cjs/api/types/TaskBlock.d.ts +2 -0
- package/dist/cjs/api/types/TaskBlockYaml.d.ts +1 -0
- package/dist/cjs/api/types/TaskRunListItem.d.ts +18 -0
- package/dist/cjs/api/types/TaskRunListItem.js +3 -0
- package/dist/cjs/api/types/{TaskRunRequest.d.ts → TaskRunRequestOutput.d.ts} +15 -7
- package/dist/cjs/api/types/TaskRunRequestOutput.js +3 -0
- package/dist/cjs/api/types/TaskRunResponse.d.ts +3 -1
- package/dist/cjs/api/types/TaskV2Block.d.ts +1 -0
- package/dist/cjs/api/types/TaskV2BlockYaml.d.ts +1 -0
- package/dist/cjs/api/types/TextPromptBlock.d.ts +1 -0
- package/dist/cjs/api/types/TextPromptBlockYaml.d.ts +1 -0
- package/dist/cjs/api/types/Thought.d.ts +1 -0
- package/dist/cjs/api/types/UploadToS3Block.d.ts +1 -0
- package/dist/cjs/api/types/UploadToS3BlockYaml.d.ts +1 -0
- package/dist/cjs/api/types/UrlBlock.d.ts +2 -0
- package/dist/cjs/api/types/UrlBlockYaml.d.ts +1 -0
- package/dist/cjs/api/types/UserDefinedError.d.ts +1 -0
- package/dist/cjs/api/types/ValidationBlock.d.ts +3 -0
- package/dist/cjs/api/types/ValidationBlockYaml.d.ts +2 -0
- package/dist/cjs/api/types/WaitBlock.d.ts +1 -0
- package/dist/cjs/api/types/WaitBlockYaml.d.ts +1 -0
- package/dist/cjs/api/types/WhileLoopBlock.d.ts +25 -0
- package/dist/cjs/api/types/WhileLoopBlock.js +3 -0
- package/dist/cjs/api/types/WhileLoopBlockCondition.d.ts +10 -0
- package/dist/cjs/api/types/WhileLoopBlockCondition.js +3 -0
- package/dist/cjs/api/types/WhileLoopBlockLoopBlocksItem.d.ts +94 -0
- package/dist/cjs/api/types/WhileLoopBlockLoopBlocksItem.js +3 -0
- package/dist/cjs/api/types/WhileLoopBlockYaml.d.ts +13 -0
- package/dist/cjs/api/types/WhileLoopBlockYaml.js +3 -0
- package/dist/cjs/api/types/WhileLoopBlockYamlLoopBlocksItem.d.ts +94 -0
- package/dist/cjs/api/types/WhileLoopBlockYamlLoopBlocksItem.js +3 -0
- package/dist/cjs/api/types/Workflow.d.ts +12 -0
- package/dist/cjs/api/types/WorkflowCreateYamlRequest.d.ts +7 -0
- package/dist/cjs/api/types/WorkflowDefinition.d.ts +2 -0
- package/dist/cjs/api/types/WorkflowDefinitionBlocksItem.d.ts +19 -1
- package/dist/cjs/api/types/WorkflowDefinitionYaml.d.ts +2 -0
- package/dist/cjs/api/types/WorkflowDefinitionYamlBlocksItem.d.ts +19 -1
- package/dist/cjs/api/types/WorkflowRun.d.ts +9 -0
- package/dist/cjs/api/types/WorkflowRunBlock.d.ts +5 -0
- package/dist/cjs/api/types/{WorkflowRunRequest.d.ts → WorkflowRunRequestOutput.d.ts} +17 -5
- package/dist/cjs/api/types/WorkflowRunRequestOutput.js +3 -0
- package/dist/cjs/api/types/WorkflowRunResponse.d.ts +6 -2
- package/dist/cjs/api/types/WorkflowRunTriggerType.d.ts +17 -0
- package/dist/cjs/api/types/WorkflowRunTriggerType.js +20 -0
- package/dist/cjs/api/types/WorkflowSchedule.d.ts +15 -0
- package/dist/cjs/api/types/WorkflowSchedule.js +3 -0
- package/dist/cjs/api/types/WorkflowScheduleListResponse.d.ts +4 -0
- package/dist/cjs/api/types/WorkflowScheduleListResponse.js +3 -0
- package/dist/cjs/api/types/WorkflowScheduleResponse.d.ts +5 -0
- package/dist/cjs/api/types/WorkflowScheduleResponse.js +3 -0
- package/dist/cjs/api/types/WorkflowScheduleUpsertRequest.d.ts +8 -0
- package/dist/cjs/api/types/WorkflowScheduleUpsertRequest.js +3 -0
- package/dist/cjs/api/types/WorkflowTagsBatchResponse.d.ts +11 -0
- package/dist/cjs/api/types/WorkflowTagsBatchResponse.js +3 -0
- package/dist/cjs/api/types/WorkflowTriggerBlock.d.ts +1 -0
- package/dist/cjs/api/types/WorkflowTriggerBlockYaml.d.ts +1 -0
- package/dist/cjs/api/types/index.d.ts +63 -8
- package/dist/cjs/api/types/index.js +63 -8
- package/dist/cjs/library/Skyvern.d.ts +2 -2
- package/dist/cjs/library/SkyvernBrowserPageAgent.js +21 -25
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.d.mts +587 -170
- package/dist/esm/Client.mjs +2476 -680
- package/dist/esm/api/client/requests/BatchGetRunTagsRequest.d.mts +10 -0
- package/dist/esm/api/client/requests/BatchGetWorkflowTagsRequest.d.mts +10 -0
- package/dist/esm/api/client/requests/BodyUploadFileV1UploadFilePost.d.mts +2 -3
- package/dist/esm/api/client/requests/BulkCancelRunsRequest.d.mts +10 -0
- package/dist/esm/api/client/requests/CreateBrowserProfileRequest.d.mts +13 -2
- package/dist/esm/api/client/requests/CreateBrowserSessionRequest.d.mts +51 -1
- package/dist/esm/api/client/requests/CustomLlmCreateRequest.d.mts +14 -0
- package/dist/esm/api/client/requests/CustomLlmUpdateRequest.d.mts +14 -0
- package/dist/esm/api/client/requests/DownloadFilesRequest.d.mts +4 -0
- package/dist/esm/api/client/requests/GetCredentialsRequest.d.mts +11 -1
- package/dist/esm/api/client/requests/GetRunTagHistoryRequest.d.mts +16 -0
- package/dist/esm/api/client/requests/GetRunsV2Request.d.mts +17 -0
- package/dist/esm/api/client/requests/GetWorkflowRunsByIdRequest.d.mts +28 -0
- package/dist/esm/api/client/requests/GetWorkflowTagHistoryRequest.d.mts +16 -0
- package/dist/esm/api/client/requests/GetWorkflowsRequest.d.mts +2 -0
- package/dist/esm/api/client/requests/ListBrowserProfilesRequest.d.mts +11 -1
- package/dist/esm/api/client/requests/ListTagValuesRequest.d.mts +10 -0
- package/dist/esm/api/client/requests/LoginRequest.d.mts +5 -1
- package/dist/esm/api/client/requests/RetryWorkflowRunRequest.d.mts +11 -0
- package/dist/esm/api/client/requests/RetryWorkflowRunRequest.mjs +2 -0
- package/dist/esm/api/client/requests/RunTagsBatchRequest.d.mts +8 -0
- package/dist/esm/api/client/requests/RunTagsBatchRequest.mjs +2 -0
- package/dist/esm/api/client/requests/TagKeyUpdate.d.mts +8 -0
- package/dist/esm/api/client/requests/TagKeyUpdate.mjs +2 -0
- package/dist/esm/api/client/requests/TagValueDelete.d.mts +10 -0
- package/dist/esm/api/client/requests/TagValueDelete.mjs +2 -0
- package/dist/esm/api/client/requests/TagValueRename.d.mts +13 -0
- package/dist/esm/api/client/requests/TagValueRename.mjs +2 -0
- package/dist/esm/api/client/requests/TagValueUpdate.d.mts +13 -0
- package/dist/esm/api/client/requests/TagValueUpdate.mjs +2 -0
- package/dist/esm/api/client/requests/TaskRunRequestInput.d.mts +153 -0
- package/dist/esm/api/client/requests/TaskRunRequestInput.mjs +2 -0
- package/dist/esm/api/client/requests/UpdateBrowserProfileRequest.d.mts +23 -0
- package/dist/esm/api/client/requests/UpdateBrowserProfileRequest.mjs +2 -0
- package/dist/esm/api/client/requests/UpdateBrowserSessionRequest.d.mts +10 -0
- package/dist/esm/api/client/requests/UpdateBrowserSessionRequest.mjs +2 -0
- package/dist/esm/api/client/requests/WorkflowRunRequestInput.d.mts +128 -0
- package/dist/esm/api/client/requests/WorkflowRunRequestInput.mjs +2 -0
- package/dist/esm/api/client/requests/WorkflowTagsBatchRequest.d.mts +8 -0
- package/dist/esm/api/client/requests/WorkflowTagsBatchRequest.mjs +2 -0
- package/dist/esm/api/client/requests/index.d.mts +21 -4
- package/dist/esm/api/errors/InternalServerError.d.mts +5 -0
- package/dist/esm/api/errors/InternalServerError.mjs +13 -0
- package/dist/esm/api/errors/RangeNotSatisfiableError.d.mts +5 -0
- package/dist/esm/api/errors/RangeNotSatisfiableError.mjs +13 -0
- package/dist/esm/api/errors/index.d.mts +2 -0
- package/dist/esm/api/errors/index.mjs +2 -0
- package/dist/esm/api/resources/agents/client/Client.d.mts +27 -0
- package/dist/esm/api/resources/agents/client/Client.mjs +85 -0
- package/dist/esm/api/resources/agents/client/index.d.mts +1 -0
- package/dist/esm/api/resources/agents/client/index.mjs +1 -0
- package/dist/esm/api/resources/agents/index.d.mts +1 -0
- package/dist/esm/api/resources/agents/index.mjs +1 -0
- package/dist/esm/api/resources/artifacts/client/Client.d.mts +28 -0
- package/dist/esm/api/resources/artifacts/client/Client.mjs +88 -0
- package/dist/esm/api/resources/artifacts/client/index.d.mts +1 -0
- package/dist/esm/api/resources/artifacts/client/index.mjs +1 -0
- package/dist/esm/api/resources/artifacts/index.d.mts +1 -0
- package/dist/esm/api/resources/artifacts/index.mjs +1 -0
- package/dist/esm/api/resources/index.d.mts +5 -0
- package/dist/esm/api/resources/index.mjs +5 -0
- package/dist/esm/api/resources/schedules/client/Client.d.mts +119 -0
- package/dist/esm/api/resources/schedules/client/Client.mjs +517 -0
- package/dist/esm/api/resources/schedules/client/index.d.mts +1 -0
- package/dist/esm/api/resources/schedules/client/index.mjs +1 -0
- package/dist/esm/api/resources/schedules/client/requests/SchedulesListAllRequest.d.mts +18 -0
- package/dist/esm/api/resources/schedules/client/requests/SchedulesListAllRequest.mjs +2 -0
- package/dist/esm/api/resources/schedules/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/schedules/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/schedules/index.d.mts +2 -0
- package/dist/esm/api/resources/schedules/index.mjs +2 -0
- package/dist/esm/api/resources/schedules/types/SchedulesListAllRequestStatus.d.mts +5 -0
- package/dist/esm/api/resources/schedules/types/SchedulesListAllRequestStatus.mjs +5 -0
- package/dist/esm/api/resources/schedules/types/index.d.mts +1 -0
- package/dist/esm/api/resources/schedules/types/index.mjs +1 -0
- package/dist/esm/api/types/Action.d.mts +5 -0
- package/dist/esm/api/types/ActionBlock.d.mts +4 -0
- package/dist/esm/api/types/ActionBlockYaml.d.mts +3 -0
- package/dist/esm/api/types/ActionType.d.mts +5 -0
- package/dist/esm/api/types/ActionType.mjs +5 -0
- package/dist/esm/api/types/AiFallbackMode.d.mts +14 -0
- package/dist/esm/api/types/AiFallbackMode.mjs +14 -0
- package/dist/esm/api/types/Artifact.d.mts +5 -0
- package/dist/esm/api/types/ArtifactType.d.mts +5 -0
- package/dist/esm/api/types/ArtifactType.mjs +5 -0
- package/dist/esm/api/types/BlockType.d.mts +6 -0
- package/dist/esm/api/types/BlockType.mjs +6 -0
- package/dist/esm/api/types/BrowserProfile.d.mts +10 -0
- package/dist/esm/api/types/BrowserSessionResponse.d.mts +2 -0
- package/dist/esm/api/types/BulkCancelRunsResponse.d.mts +6 -0
- package/dist/esm/api/types/BulkCancelRunsResponse.mjs +2 -0
- package/dist/esm/api/types/ClearOrganizationAuthTokenResponse.d.mts +7 -0
- package/dist/esm/api/types/ClearOrganizationAuthTokenResponse.mjs +2 -0
- package/dist/esm/api/types/CodeBlock.d.mts +3 -0
- package/dist/esm/api/types/CodeBlockStep.d.mts +8 -0
- package/dist/esm/api/types/CodeBlockStep.mjs +2 -0
- package/dist/esm/api/types/CodeBlockStepYaml.d.mts +7 -0
- package/dist/esm/api/types/CodeBlockStepYaml.mjs +2 -0
- package/dist/esm/api/types/CodeBlockYaml.d.mts +4 -0
- package/dist/esm/api/types/ConditionalBlock.d.mts +1 -0
- package/dist/esm/api/types/ConditionalBlockYaml.d.mts +1 -0
- package/dist/esm/api/types/CreateCredentialRequest.d.mts +12 -0
- package/dist/esm/api/types/CredentialParameter.d.mts +2 -0
- package/dist/esm/api/types/CredentialParameterYaml.d.mts +2 -0
- package/dist/esm/api/types/CredentialResponse.d.mts +16 -0
- package/dist/esm/api/types/CredentialVaultType.d.mts +8 -0
- package/dist/esm/api/types/CredentialVaultType.mjs +8 -0
- package/dist/esm/api/types/CreditCardBillingAddress.d.mts +21 -0
- package/dist/esm/api/types/CreditCardBillingAddress.mjs +2 -0
- package/dist/esm/api/types/CreditCardCredentialResponse.d.mts +2 -1
- package/dist/esm/api/types/CustomLlm.d.mts +9 -0
- package/dist/esm/api/types/CustomLlm.mjs +2 -0
- package/dist/esm/api/types/CustomLlmConfig.d.mts +14 -0
- package/dist/esm/api/types/CustomLlmConfig.mjs +2 -0
- package/dist/esm/api/types/CustomLlmListResponse.d.mts +4 -0
- package/dist/esm/api/types/CustomLlmListResponse.mjs +2 -0
- package/dist/esm/api/types/CustomLlmProvider.d.mts +6 -0
- package/dist/esm/api/types/CustomLlmProvider.mjs +6 -0
- package/dist/esm/api/types/CustomLlmResponse.d.mts +4 -0
- package/dist/esm/api/types/CustomLlmResponse.mjs +2 -0
- package/dist/esm/api/types/DeleteScheduleResponse.d.mts +3 -0
- package/dist/esm/api/types/DeleteScheduleResponse.mjs +2 -0
- package/dist/esm/api/types/DownloadToS3Block.d.mts +1 -0
- package/dist/esm/api/types/DownloadToS3BlockYaml.d.mts +1 -0
- package/dist/esm/api/types/EmailInboxBlock.d.mts +30 -0
- package/dist/esm/api/types/EmailInboxBlock.mjs +8 -0
- package/dist/esm/api/types/EmailInboxBlockParametersItem.d.mts +37 -0
- package/dist/esm/api/types/EmailInboxBlockParametersItem.mjs +2 -0
- package/dist/esm/api/types/EmailInboxBlockYaml.d.mts +27 -0
- package/dist/esm/api/types/EmailInboxBlockYaml.mjs +8 -0
- package/dist/esm/api/types/ExtractionBlock.d.mts +2 -0
- package/dist/esm/api/types/ExtractionBlockYaml.d.mts +1 -0
- package/dist/esm/api/types/FileDownloadBlock.d.mts +2 -0
- package/dist/esm/api/types/FileDownloadBlockYaml.d.mts +1 -0
- package/dist/esm/api/types/FileInfo.d.mts +4 -0
- package/dist/esm/api/types/FileParserBlock.d.mts +2 -1
- package/dist/esm/api/types/FileParserBlockYaml.d.mts +2 -1
- package/dist/esm/api/types/FileStorageType.d.mts +2 -0
- package/dist/esm/api/types/FileStorageType.mjs +2 -0
- package/dist/esm/api/types/FileType.d.mts +2 -0
- package/dist/esm/api/types/FileType.mjs +2 -0
- package/dist/esm/api/types/FileUploadBlock.d.mts +15 -0
- package/dist/esm/api/types/FileUploadBlockYaml.d.mts +13 -0
- package/dist/esm/api/types/ForLoopBlock.d.mts +1 -0
- package/dist/esm/api/types/ForLoopBlockLoopBlocksItem.d.mts +19 -1
- package/dist/esm/api/types/ForLoopBlockYaml.d.mts +1 -0
- package/dist/esm/api/types/ForLoopBlockYamlLoopBlocksItem.d.mts +19 -1
- package/dist/esm/api/types/GeoTarget.d.mts +1 -11
- package/dist/esm/api/types/GetRunResponse.d.mts +4 -1
- package/dist/esm/api/types/GoogleSheetsReadBlock.d.mts +19 -0
- package/dist/esm/api/types/GoogleSheetsReadBlock.mjs +2 -0
- package/dist/esm/api/types/GoogleSheetsReadBlockParametersItem.d.mts +37 -0
- package/dist/esm/api/types/GoogleSheetsReadBlockParametersItem.mjs +2 -0
- package/dist/esm/api/types/GoogleSheetsReadBlockYaml.d.mts +16 -0
- package/dist/esm/api/types/GoogleSheetsReadBlockYaml.mjs +2 -0
- package/dist/esm/api/types/GoogleSheetsWriteBlock.d.mts +29 -0
- package/dist/esm/api/types/GoogleSheetsWriteBlock.mjs +8 -0
- package/dist/esm/api/types/GoogleSheetsWriteBlockParametersItem.d.mts +37 -0
- package/dist/esm/api/types/GoogleSheetsWriteBlockParametersItem.mjs +2 -0
- package/dist/esm/api/types/GoogleSheetsWriteBlockYaml.d.mts +26 -0
- package/dist/esm/api/types/GoogleSheetsWriteBlockYaml.mjs +8 -0
- package/dist/esm/api/types/HttpRequestBlock.d.mts +2 -0
- package/dist/esm/api/types/HttpRequestBlockYaml.d.mts +2 -0
- package/dist/esm/api/types/HumanInteractionBlock.d.mts +2 -0
- package/dist/esm/api/types/HumanInteractionBlockYaml.d.mts +1 -0
- package/dist/esm/api/types/LoginBlock.d.mts +3 -0
- package/dist/esm/api/types/LoginBlockYaml.d.mts +2 -0
- package/dist/esm/api/types/NavigationBlock.d.mts +2 -0
- package/dist/esm/api/types/NavigationBlockYaml.d.mts +1 -0
- package/dist/esm/api/types/NonEmptyCreditCardCredential.d.mts +9 -0
- package/dist/esm/api/types/OrganizationScheduleItem.d.mts +23 -0
- package/dist/esm/api/types/OrganizationScheduleItem.mjs +2 -0
- package/dist/esm/api/types/OrganizationScheduleListResponse.d.mts +7 -0
- package/dist/esm/api/types/OrganizationScheduleListResponse.mjs +2 -0
- package/dist/esm/api/types/PasswordCredentialResponse.d.mts +1 -1
- package/dist/esm/api/types/PdfFillBlock.d.mts +21 -0
- package/dist/esm/api/types/PdfFillBlock.mjs +2 -0
- package/dist/esm/api/types/PdfFillBlockParametersItem.d.mts +37 -0
- package/dist/esm/api/types/PdfFillBlockParametersItem.mjs +2 -0
- package/dist/esm/api/types/PdfFillBlockYaml.d.mts +18 -0
- package/dist/esm/api/types/PdfFillBlockYaml.mjs +2 -0
- package/dist/esm/api/types/PdfParserBlock.d.mts +1 -0
- package/dist/esm/api/types/PdfParserBlockYaml.d.mts +1 -0
- package/dist/esm/api/types/PersistentBrowserType.d.mts +1 -0
- package/dist/esm/api/types/PersistentBrowserType.mjs +1 -0
- package/dist/esm/api/types/PrintPageBlock.d.mts +1 -0
- package/dist/esm/api/types/PrintPageBlockYaml.d.mts +1 -0
- package/dist/esm/api/types/ProxyLocation.d.mts +1 -0
- package/dist/esm/api/types/ProxyLocation.mjs +1 -0
- package/dist/esm/api/types/RunEngine.d.mts +1 -0
- package/dist/esm/api/types/RunEngine.mjs +1 -0
- package/dist/esm/api/types/RunTagHistoryResponse.d.mts +5 -0
- package/dist/esm/api/types/RunTagHistoryResponse.mjs +2 -0
- package/dist/esm/api/types/RunTagsBatchResponse.d.mts +11 -0
- package/dist/esm/api/types/RunTagsBatchResponse.mjs +2 -0
- package/dist/esm/api/types/RunTagsResponse.d.mts +8 -0
- package/dist/esm/api/types/RunTagsResponse.mjs +2 -0
- package/dist/esm/api/types/RunType.d.mts +10 -0
- package/dist/esm/api/types/RunType.mjs +10 -0
- package/dist/esm/api/types/RunWebhookReplayResponse.d.mts +22 -0
- package/dist/esm/api/types/RunWebhookReplayResponse.mjs +2 -0
- package/dist/esm/api/types/ScriptRunResponse.d.mts +2 -0
- package/dist/esm/api/types/SendEmailBlock.d.mts +1 -0
- package/dist/esm/api/types/SendEmailBlockYaml.d.mts +1 -0
- package/dist/esm/api/types/SkyvernSchemasCredentialTypeCredentialType.d.mts +7 -0
- package/dist/esm/api/types/{SkyvernSchemasRunBlocksCredentialType.mjs → SkyvernSchemasCredentialTypeCredentialType.mjs} +1 -1
- package/dist/esm/api/types/SplitPdfBlock.d.mts +17 -0
- package/dist/esm/api/types/SplitPdfBlock.mjs +2 -0
- package/dist/esm/api/types/SplitPdfBlockParametersItem.d.mts +37 -0
- package/dist/esm/api/types/SplitPdfBlockParametersItem.mjs +2 -0
- package/dist/esm/api/types/SplitPdfBlockYaml.d.mts +14 -0
- package/dist/esm/api/types/SplitPdfBlockYaml.mjs +2 -0
- package/dist/esm/api/types/TagApplyRequest.d.mts +13 -0
- package/dist/esm/api/types/TagApplyRequest.mjs +2 -0
- package/dist/esm/api/types/TagDeleteInput.d.mts +10 -0
- package/dist/esm/api/types/TagDeleteInput.mjs +2 -0
- package/dist/esm/api/types/TagHistoryItem.d.mts +13 -0
- package/dist/esm/api/types/TagHistoryItem.mjs +2 -0
- package/dist/esm/api/types/TagHistoryResponse.d.mts +5 -0
- package/dist/esm/api/types/TagHistoryResponse.mjs +2 -0
- package/dist/esm/api/types/TagInput.d.mts +10 -0
- package/dist/esm/api/types/TagInput.mjs +2 -0
- package/dist/esm/api/types/TagItem.d.mts +8 -0
- package/dist/esm/api/types/TagItem.mjs +2 -0
- package/dist/esm/api/types/TagKey.d.mts +8 -0
- package/dist/esm/api/types/TagKey.mjs +2 -0
- package/dist/esm/api/types/TagKeyDeleteResponse.d.mts +9 -0
- package/dist/esm/api/types/TagKeyDeleteResponse.mjs +2 -0
- package/dist/esm/api/types/TagResponse.d.mts +11 -0
- package/dist/esm/api/types/TagResponse.mjs +2 -0
- package/dist/esm/api/types/TagValue.d.mts +11 -0
- package/dist/esm/api/types/TagValue.mjs +2 -0
- package/dist/esm/api/types/TagValueDeleteResponse.d.mts +10 -0
- package/dist/esm/api/types/TagValueDeleteResponse.mjs +2 -0
- package/dist/esm/api/types/TagValueRenameResponse.d.mts +10 -0
- package/dist/esm/api/types/TagValueRenameResponse.mjs +2 -0
- package/dist/esm/api/types/TagsResponse.d.mts +9 -0
- package/dist/esm/api/types/TagsResponse.mjs +2 -0
- package/dist/esm/api/types/TaskBlock.d.mts +2 -0
- package/dist/esm/api/types/TaskBlockYaml.d.mts +1 -0
- package/dist/esm/api/types/TaskRunListItem.d.mts +18 -0
- package/dist/esm/api/types/TaskRunListItem.mjs +2 -0
- package/dist/esm/api/types/{TaskRunRequest.d.mts → TaskRunRequestOutput.d.mts} +15 -7
- package/dist/esm/api/types/TaskRunRequestOutput.mjs +2 -0
- package/dist/esm/api/types/TaskRunResponse.d.mts +3 -1
- package/dist/esm/api/types/TaskV2Block.d.mts +1 -0
- package/dist/esm/api/types/TaskV2BlockYaml.d.mts +1 -0
- package/dist/esm/api/types/TextPromptBlock.d.mts +1 -0
- package/dist/esm/api/types/TextPromptBlockYaml.d.mts +1 -0
- package/dist/esm/api/types/Thought.d.mts +1 -0
- package/dist/esm/api/types/UploadToS3Block.d.mts +1 -0
- package/dist/esm/api/types/UploadToS3BlockYaml.d.mts +1 -0
- package/dist/esm/api/types/UrlBlock.d.mts +2 -0
- package/dist/esm/api/types/UrlBlockYaml.d.mts +1 -0
- package/dist/esm/api/types/UserDefinedError.d.mts +1 -0
- package/dist/esm/api/types/ValidationBlock.d.mts +3 -0
- package/dist/esm/api/types/ValidationBlockYaml.d.mts +2 -0
- package/dist/esm/api/types/WaitBlock.d.mts +1 -0
- package/dist/esm/api/types/WaitBlockYaml.d.mts +1 -0
- package/dist/esm/api/types/WhileLoopBlock.d.mts +25 -0
- package/dist/esm/api/types/WhileLoopBlock.mjs +2 -0
- package/dist/esm/api/types/WhileLoopBlockCondition.d.mts +10 -0
- package/dist/esm/api/types/WhileLoopBlockCondition.mjs +2 -0
- package/dist/esm/api/types/WhileLoopBlockLoopBlocksItem.d.mts +94 -0
- package/dist/esm/api/types/WhileLoopBlockLoopBlocksItem.mjs +2 -0
- package/dist/esm/api/types/WhileLoopBlockYaml.d.mts +13 -0
- package/dist/esm/api/types/WhileLoopBlockYaml.mjs +2 -0
- package/dist/esm/api/types/WhileLoopBlockYamlLoopBlocksItem.d.mts +94 -0
- package/dist/esm/api/types/WhileLoopBlockYamlLoopBlocksItem.mjs +2 -0
- package/dist/esm/api/types/Workflow.d.mts +12 -0
- package/dist/esm/api/types/WorkflowCreateYamlRequest.d.mts +7 -0
- package/dist/esm/api/types/WorkflowDefinition.d.mts +2 -0
- package/dist/esm/api/types/WorkflowDefinitionBlocksItem.d.mts +19 -1
- package/dist/esm/api/types/WorkflowDefinitionYaml.d.mts +2 -0
- package/dist/esm/api/types/WorkflowDefinitionYamlBlocksItem.d.mts +19 -1
- package/dist/esm/api/types/WorkflowRun.d.mts +9 -0
- package/dist/esm/api/types/WorkflowRunBlock.d.mts +5 -0
- package/dist/esm/api/types/{WorkflowRunRequest.d.mts → WorkflowRunRequestOutput.d.mts} +17 -5
- package/dist/esm/api/types/WorkflowRunRequestOutput.mjs +2 -0
- package/dist/esm/api/types/WorkflowRunResponse.d.mts +6 -2
- package/dist/esm/api/types/WorkflowRunTriggerType.d.mts +17 -0
- package/dist/esm/api/types/WorkflowRunTriggerType.mjs +17 -0
- package/dist/esm/api/types/WorkflowSchedule.d.mts +15 -0
- package/dist/esm/api/types/WorkflowSchedule.mjs +2 -0
- package/dist/esm/api/types/WorkflowScheduleListResponse.d.mts +4 -0
- package/dist/esm/api/types/WorkflowScheduleListResponse.mjs +2 -0
- package/dist/esm/api/types/WorkflowScheduleResponse.d.mts +5 -0
- package/dist/esm/api/types/WorkflowScheduleResponse.mjs +2 -0
- package/dist/esm/api/types/WorkflowScheduleUpsertRequest.d.mts +8 -0
- package/dist/esm/api/types/WorkflowScheduleUpsertRequest.mjs +2 -0
- package/dist/esm/api/types/WorkflowTagsBatchResponse.d.mts +11 -0
- package/dist/esm/api/types/WorkflowTagsBatchResponse.mjs +2 -0
- package/dist/esm/api/types/WorkflowTriggerBlock.d.mts +1 -0
- package/dist/esm/api/types/WorkflowTriggerBlockYaml.d.mts +1 -0
- package/dist/esm/api/types/index.d.mts +63 -8
- package/dist/esm/api/types/index.mjs +63 -8
- package/dist/esm/library/Skyvern.d.mts +2 -2
- package/dist/esm/library/SkyvernBrowserPageAgent.mjs +21 -25
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +11 -2
- package/reference.md +595 -5
- package/dist/cjs/api/client/requests/ChangeTierRequest.d.ts +0 -10
- package/dist/cjs/api/client/requests/CheckoutSubscriptionRequest.d.ts +0 -10
- package/dist/cjs/api/client/requests/RunTaskRequest.d.ts +0 -14
- package/dist/cjs/api/client/requests/RunWorkflowRequest.d.ts +0 -18
- package/dist/cjs/api/types/BillingStateResponse.d.ts +0 -20
- package/dist/cjs/api/types/ChangeTierResponse.d.ts +0 -5
- package/dist/cjs/api/types/CheckoutSessionResponse.d.ts +0 -4
- package/dist/cjs/api/types/PlanTier.d.ts +0 -7
- package/dist/cjs/api/types/PlanTier.js +0 -10
- package/dist/cjs/api/types/PortalSessionResponse.d.ts +0 -3
- package/dist/cjs/api/types/SkyvernSchemasRunBlocksCredentialType.d.ts +0 -7
- package/dist/esm/api/client/requests/ChangeTierRequest.d.mts +0 -10
- package/dist/esm/api/client/requests/CheckoutSubscriptionRequest.d.mts +0 -10
- package/dist/esm/api/client/requests/RunTaskRequest.d.mts +0 -14
- package/dist/esm/api/client/requests/RunWorkflowRequest.d.mts +0 -18
- package/dist/esm/api/types/BillingStateResponse.d.mts +0 -20
- package/dist/esm/api/types/ChangeTierResponse.d.mts +0 -5
- package/dist/esm/api/types/CheckoutSessionResponse.d.mts +0 -4
- package/dist/esm/api/types/PlanTier.d.mts +0 -7
- package/dist/esm/api/types/PlanTier.mjs +0 -7
- package/dist/esm/api/types/PortalSessionResponse.d.mts +0 -3
- package/dist/esm/api/types/SkyvernSchemasRunBlocksCredentialType.d.mts +0 -7
- /package/dist/cjs/api/client/requests/{ChangeTierRequest.js → BatchGetRunTagsRequest.js} +0 -0
- /package/dist/cjs/api/client/requests/{CheckoutSubscriptionRequest.js → BatchGetWorkflowTagsRequest.js} +0 -0
- /package/dist/cjs/api/client/requests/{RunTaskRequest.js → BulkCancelRunsRequest.js} +0 -0
- /package/dist/cjs/api/client/requests/{RunWorkflowRequest.js → CustomLlmCreateRequest.js} +0 -0
- /package/dist/cjs/api/{types/BillingStateResponse.js → client/requests/CustomLlmUpdateRequest.js} +0 -0
- /package/dist/cjs/api/{types/ChangeTierResponse.js → client/requests/GetRunTagHistoryRequest.js} +0 -0
- /package/dist/cjs/api/{types/CheckoutSessionResponse.js → client/requests/GetRunsV2Request.js} +0 -0
- /package/dist/cjs/api/{types/PortalSessionResponse.js → client/requests/GetWorkflowRunsByIdRequest.js} +0 -0
- /package/dist/cjs/api/{types/TaskRunRequest.js → client/requests/GetWorkflowTagHistoryRequest.js} +0 -0
- /package/dist/cjs/api/{types/WorkflowRunRequest.js → client/requests/ListTagValuesRequest.js} +0 -0
- /package/dist/esm/api/client/requests/{ChangeTierRequest.mjs → BatchGetRunTagsRequest.mjs} +0 -0
- /package/dist/esm/api/client/requests/{CheckoutSubscriptionRequest.mjs → BatchGetWorkflowTagsRequest.mjs} +0 -0
- /package/dist/esm/api/client/requests/{RunTaskRequest.mjs → BulkCancelRunsRequest.mjs} +0 -0
- /package/dist/esm/api/client/requests/{RunWorkflowRequest.mjs → CustomLlmCreateRequest.mjs} +0 -0
- /package/dist/esm/api/{types/BillingStateResponse.mjs → client/requests/CustomLlmUpdateRequest.mjs} +0 -0
- /package/dist/esm/api/{types/ChangeTierResponse.mjs → client/requests/GetRunTagHistoryRequest.mjs} +0 -0
- /package/dist/esm/api/{types/CheckoutSessionResponse.mjs → client/requests/GetRunsV2Request.mjs} +0 -0
- /package/dist/esm/api/{types/PortalSessionResponse.mjs → client/requests/GetWorkflowRunsByIdRequest.mjs} +0 -0
- /package/dist/esm/api/{types/TaskRunRequest.mjs → client/requests/GetWorkflowTagHistoryRequest.mjs} +0 -0
- /package/dist/esm/api/{types/WorkflowRunRequest.mjs → client/requests/ListTagValuesRequest.mjs} +0 -0
package/dist/cjs/Client.js
CHANGED
|
@@ -42,10 +42,24 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
42
42
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
43
|
});
|
|
44
44
|
};
|
|
45
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
46
|
+
var t = {};
|
|
47
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
48
|
+
t[p] = s[p];
|
|
49
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
50
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
51
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
52
|
+
t[p[i]] = s[p[i]];
|
|
53
|
+
}
|
|
54
|
+
return t;
|
|
55
|
+
};
|
|
45
56
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
57
|
exports.SkyvernClient = void 0;
|
|
47
58
|
const Skyvern = __importStar(require("./api/index.js"));
|
|
48
|
-
const Client_js_1 = require("./api/resources/
|
|
59
|
+
const Client_js_1 = require("./api/resources/agents/client/Client.js");
|
|
60
|
+
const Client_js_2 = require("./api/resources/artifacts/client/Client.js");
|
|
61
|
+
const Client_js_3 = require("./api/resources/schedules/client/Client.js");
|
|
62
|
+
const Client_js_4 = require("./api/resources/scripts/client/Client.js");
|
|
49
63
|
const headers_js_1 = require("./core/headers.js");
|
|
50
64
|
const core = __importStar(require("./core/index.js"));
|
|
51
65
|
const environments = __importStar(require("./environments.js"));
|
|
@@ -56,20 +70,32 @@ class SkyvernClient {
|
|
|
56
70
|
"x-api-key": _options === null || _options === void 0 ? void 0 : _options.apiKey,
|
|
57
71
|
"X-Fern-Language": "JavaScript",
|
|
58
72
|
"X-Fern-SDK-Name": "@skyvern/client",
|
|
59
|
-
"X-Fern-SDK-Version": "1.0.
|
|
60
|
-
"User-Agent": "@skyvern/client/1.0.
|
|
73
|
+
"X-Fern-SDK-Version": "1.0.47",
|
|
74
|
+
"User-Agent": "@skyvern/client/1.0.47",
|
|
61
75
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
62
76
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
63
77
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
64
78
|
}
|
|
79
|
+
get artifacts() {
|
|
80
|
+
var _a;
|
|
81
|
+
return ((_a = this._artifacts) !== null && _a !== void 0 ? _a : (this._artifacts = new Client_js_2.Artifacts(this._options)));
|
|
82
|
+
}
|
|
65
83
|
get scripts() {
|
|
66
84
|
var _a;
|
|
67
|
-
return ((_a = this._scripts) !== null && _a !== void 0 ? _a : (this._scripts = new
|
|
85
|
+
return ((_a = this._scripts) !== null && _a !== void 0 ? _a : (this._scripts = new Client_js_4.Scripts(this._options)));
|
|
86
|
+
}
|
|
87
|
+
get schedules() {
|
|
88
|
+
var _a;
|
|
89
|
+
return ((_a = this._schedules) !== null && _a !== void 0 ? _a : (this._schedules = new Client_js_3.Schedules(this._options)));
|
|
90
|
+
}
|
|
91
|
+
get agents() {
|
|
92
|
+
var _a;
|
|
93
|
+
return ((_a = this._agents) !== null && _a !== void 0 ? _a : (this._agents = new Client_js_1.Agents(this._options)));
|
|
68
94
|
}
|
|
69
95
|
/**
|
|
70
96
|
* Run a task
|
|
71
97
|
*
|
|
72
|
-
* @param {Skyvern.
|
|
98
|
+
* @param {Skyvern.TaskRunRequestInput} request
|
|
73
99
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
74
100
|
*
|
|
75
101
|
* @throws {@link Skyvern.BadRequestError}
|
|
@@ -78,9 +104,7 @@ class SkyvernClient {
|
|
|
78
104
|
* @example
|
|
79
105
|
* await client.runTask({
|
|
80
106
|
* "x-user-agent": "x-user-agent",
|
|
81
|
-
*
|
|
82
|
-
* prompt: "Find the top 3 posts on Hacker News."
|
|
83
|
-
* }
|
|
107
|
+
* prompt: "Find the top 3 posts on Hacker News."
|
|
84
108
|
* })
|
|
85
109
|
*/
|
|
86
110
|
runTask(request, requestOptions) {
|
|
@@ -89,7 +113,7 @@ class SkyvernClient {
|
|
|
89
113
|
__runTask(request, requestOptions) {
|
|
90
114
|
return __awaiter(this, void 0, void 0, function* () {
|
|
91
115
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
92
|
-
const { "x-user-agent": userAgent,
|
|
116
|
+
const { "x-user-agent": userAgent } = request, _body = __rest(request, ["x-user-agent"]);
|
|
93
117
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
94
118
|
"x-user-agent": userAgent != null ? userAgent : undefined,
|
|
95
119
|
"x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey,
|
|
@@ -141,9 +165,9 @@ class SkyvernClient {
|
|
|
141
165
|
});
|
|
142
166
|
}
|
|
143
167
|
/**
|
|
144
|
-
* Run
|
|
168
|
+
* Run an agent
|
|
145
169
|
*
|
|
146
|
-
* @param {Skyvern.
|
|
170
|
+
* @param {Skyvern.WorkflowRunRequestInput} request
|
|
147
171
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
148
172
|
*
|
|
149
173
|
* @throws {@link Skyvern.BadRequestError}
|
|
@@ -154,9 +178,7 @@ class SkyvernClient {
|
|
|
154
178
|
* "x-max-steps-override": 1,
|
|
155
179
|
* "x-user-agent": "x-user-agent",
|
|
156
180
|
* template: true,
|
|
157
|
-
*
|
|
158
|
-
* workflow_id: "wpid_123"
|
|
159
|
-
* }
|
|
181
|
+
* agent_id: "wpid_123"
|
|
160
182
|
* })
|
|
161
183
|
*/
|
|
162
184
|
runWorkflow(request, requestOptions) {
|
|
@@ -165,7 +187,7 @@ class SkyvernClient {
|
|
|
165
187
|
__runWorkflow(request, requestOptions) {
|
|
166
188
|
return __awaiter(this, void 0, void 0, function* () {
|
|
167
189
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
168
|
-
const { template, "x-max-steps-override": maxStepsOverride, "x-user-agent": userAgent,
|
|
190
|
+
const { template, "x-max-steps-override": maxStepsOverride, "x-user-agent": userAgent } = request, _body = __rest(request, ["template", "x-max-steps-override", "x-user-agent"]);
|
|
169
191
|
const _queryParams = {};
|
|
170
192
|
if (template != null) {
|
|
171
193
|
_queryParams.template = template.toString();
|
|
@@ -176,7 +198,7 @@ class SkyvernClient {
|
|
|
176
198
|
"x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey,
|
|
177
199
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
178
200
|
const _response = yield core.fetcher({
|
|
179
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "v1/run/
|
|
201
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "v1/run/agents"),
|
|
180
202
|
method: "POST",
|
|
181
203
|
headers: _headers,
|
|
182
204
|
contentType: "application/json",
|
|
@@ -212,7 +234,7 @@ class SkyvernClient {
|
|
|
212
234
|
rawResponse: _response.rawResponse,
|
|
213
235
|
});
|
|
214
236
|
case "timeout":
|
|
215
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /v1/run/
|
|
237
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /v1/run/agents.");
|
|
216
238
|
case "unknown":
|
|
217
239
|
throw new errors.SkyvernError({
|
|
218
240
|
message: _response.error.errorMessage,
|
|
@@ -342,6 +364,70 @@ class SkyvernClient {
|
|
|
342
364
|
}
|
|
343
365
|
});
|
|
344
366
|
}
|
|
367
|
+
/**
|
|
368
|
+
* Cancel multiple runs (tasks or workflows) in a single request
|
|
369
|
+
*
|
|
370
|
+
* @param {Skyvern.BulkCancelRunsRequest} request
|
|
371
|
+
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
372
|
+
*
|
|
373
|
+
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
374
|
+
*
|
|
375
|
+
* @example
|
|
376
|
+
* await client.bulkCancelRuns({
|
|
377
|
+
* run_ids: ["run_ids"]
|
|
378
|
+
* })
|
|
379
|
+
*/
|
|
380
|
+
bulkCancelRuns(request, requestOptions) {
|
|
381
|
+
return core.HttpResponsePromise.fromPromise(this.__bulkCancelRuns(request, requestOptions));
|
|
382
|
+
}
|
|
383
|
+
__bulkCancelRuns(request, requestOptions) {
|
|
384
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
385
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
386
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
387
|
+
const _response = yield core.fetcher({
|
|
388
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "v1/runs/cancel"),
|
|
389
|
+
method: "POST",
|
|
390
|
+
headers: _headers,
|
|
391
|
+
contentType: "application/json",
|
|
392
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
393
|
+
requestType: "json",
|
|
394
|
+
body: request,
|
|
395
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
396
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
397
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
398
|
+
});
|
|
399
|
+
if (_response.ok) {
|
|
400
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
401
|
+
}
|
|
402
|
+
if (_response.error.reason === "status-code") {
|
|
403
|
+
switch (_response.error.statusCode) {
|
|
404
|
+
case 422:
|
|
405
|
+
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
406
|
+
default:
|
|
407
|
+
throw new errors.SkyvernError({
|
|
408
|
+
statusCode: _response.error.statusCode,
|
|
409
|
+
body: _response.error.body,
|
|
410
|
+
rawResponse: _response.rawResponse,
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
switch (_response.error.reason) {
|
|
415
|
+
case "non-json":
|
|
416
|
+
throw new errors.SkyvernError({
|
|
417
|
+
statusCode: _response.error.statusCode,
|
|
418
|
+
body: _response.error.rawBody,
|
|
419
|
+
rawResponse: _response.rawResponse,
|
|
420
|
+
});
|
|
421
|
+
case "timeout":
|
|
422
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /v1/runs/cancel.");
|
|
423
|
+
case "unknown":
|
|
424
|
+
throw new errors.SkyvernError({
|
|
425
|
+
message: _response.error.errorMessage,
|
|
426
|
+
rawResponse: _response.rawResponse,
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
});
|
|
430
|
+
}
|
|
345
431
|
/**
|
|
346
432
|
* Get all workflows with the latest version for the organization.
|
|
347
433
|
*
|
|
@@ -376,7 +462,7 @@ class SkyvernClient {
|
|
|
376
462
|
__getWorkflows() {
|
|
377
463
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
378
464
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
379
|
-
const { page, page_size: pageSize, only_saved_tasks: onlySavedTasks, only_workflows: onlyWorkflows, only_templates: onlyTemplates, search_key: searchKey, title, folder_id: folderId, status, template, } = request;
|
|
465
|
+
const { page, page_size: pageSize, only_saved_tasks: onlySavedTasks, only_workflows: onlyWorkflows, only_templates: onlyTemplates, search_key: searchKey, title, folder_id: folderId, status, tags, template, } = request;
|
|
380
466
|
const _queryParams = {};
|
|
381
467
|
if (page != null) {
|
|
382
468
|
_queryParams.page = page.toString();
|
|
@@ -410,12 +496,20 @@ class SkyvernClient {
|
|
|
410
496
|
_queryParams.status = status;
|
|
411
497
|
}
|
|
412
498
|
}
|
|
499
|
+
if (tags != null) {
|
|
500
|
+
if (Array.isArray(tags)) {
|
|
501
|
+
_queryParams.tags = tags.map((item) => item);
|
|
502
|
+
}
|
|
503
|
+
else {
|
|
504
|
+
_queryParams.tags = tags;
|
|
505
|
+
}
|
|
506
|
+
}
|
|
413
507
|
if (template != null) {
|
|
414
508
|
_queryParams.template = template.toString();
|
|
415
509
|
}
|
|
416
510
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
417
511
|
const _response = yield core.fetcher({
|
|
418
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "v1/
|
|
512
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "v1/agents"),
|
|
419
513
|
method: "GET",
|
|
420
514
|
headers: _headers,
|
|
421
515
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -446,7 +540,7 @@ class SkyvernClient {
|
|
|
446
540
|
rawResponse: _response.rawResponse,
|
|
447
541
|
});
|
|
448
542
|
case "timeout":
|
|
449
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/
|
|
543
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/agents.");
|
|
450
544
|
case "unknown":
|
|
451
545
|
throw new errors.SkyvernError({
|
|
452
546
|
message: _response.error.errorMessage,
|
|
@@ -456,7 +550,7 @@ class SkyvernClient {
|
|
|
456
550
|
});
|
|
457
551
|
}
|
|
458
552
|
/**
|
|
459
|
-
* Create a new
|
|
553
|
+
* Create a new agent
|
|
460
554
|
*
|
|
461
555
|
* @param {Skyvern.CreateWorkflowRequest} request
|
|
462
556
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -482,7 +576,7 @@ class SkyvernClient {
|
|
|
482
576
|
}
|
|
483
577
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
484
578
|
const _response = yield core.fetcher({
|
|
485
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "v1/
|
|
579
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "v1/agents"),
|
|
486
580
|
method: "POST",
|
|
487
581
|
headers: _headers,
|
|
488
582
|
contentType: "application/json",
|
|
@@ -516,7 +610,7 @@ class SkyvernClient {
|
|
|
516
610
|
rawResponse: _response.rawResponse,
|
|
517
611
|
});
|
|
518
612
|
case "timeout":
|
|
519
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /v1/
|
|
613
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /v1/agents.");
|
|
520
614
|
case "unknown":
|
|
521
615
|
throw new errors.SkyvernError({
|
|
522
616
|
message: _response.error.errorMessage,
|
|
@@ -526,9 +620,9 @@ class SkyvernClient {
|
|
|
526
620
|
});
|
|
527
621
|
}
|
|
528
622
|
/**
|
|
529
|
-
* Update
|
|
623
|
+
* Update an agent
|
|
530
624
|
*
|
|
531
|
-
* @param {string} workflowId - The ID of the
|
|
625
|
+
* @param {string} workflowId - The ID of the agent to update. Starts with `wpid_`.
|
|
532
626
|
* @param {Skyvern.WorkflowRequest} request
|
|
533
627
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
534
628
|
*
|
|
@@ -545,7 +639,7 @@ class SkyvernClient {
|
|
|
545
639
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
546
640
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
547
641
|
const _response = yield core.fetcher({
|
|
548
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/
|
|
642
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/agents/${core.url.encodePathParam(workflowId)}`),
|
|
549
643
|
method: "POST",
|
|
550
644
|
headers: _headers,
|
|
551
645
|
contentType: "application/json",
|
|
@@ -579,7 +673,7 @@ class SkyvernClient {
|
|
|
579
673
|
rawResponse: _response.rawResponse,
|
|
580
674
|
});
|
|
581
675
|
case "timeout":
|
|
582
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /v1/
|
|
676
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /v1/agents/{workflow_id}.");
|
|
583
677
|
case "unknown":
|
|
584
678
|
throw new errors.SkyvernError({
|
|
585
679
|
message: _response.error.errorMessage,
|
|
@@ -589,9 +683,9 @@ class SkyvernClient {
|
|
|
589
683
|
});
|
|
590
684
|
}
|
|
591
685
|
/**
|
|
592
|
-
* Delete
|
|
686
|
+
* Delete an agent
|
|
593
687
|
*
|
|
594
|
-
* @param {string} workflowId - The ID of the
|
|
688
|
+
* @param {string} workflowId - The ID of the agent to delete. Starts with `wpid_`.
|
|
595
689
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
596
690
|
*
|
|
597
691
|
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
@@ -607,7 +701,7 @@ class SkyvernClient {
|
|
|
607
701
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
608
702
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
609
703
|
const _response = yield core.fetcher({
|
|
610
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/
|
|
704
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/agents/${core.url.encodePathParam(workflowId)}/delete`),
|
|
611
705
|
method: "POST",
|
|
612
706
|
headers: _headers,
|
|
613
707
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -638,7 +732,7 @@ class SkyvernClient {
|
|
|
638
732
|
rawResponse: _response.rawResponse,
|
|
639
733
|
});
|
|
640
734
|
case "timeout":
|
|
641
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /v1/
|
|
735
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /v1/agents/{workflow_id}/delete.");
|
|
642
736
|
case "unknown":
|
|
643
737
|
throw new errors.SkyvernError({
|
|
644
738
|
message: _response.error.errorMessage,
|
|
@@ -648,29 +742,43 @@ class SkyvernClient {
|
|
|
648
742
|
});
|
|
649
743
|
}
|
|
650
744
|
/**
|
|
651
|
-
* Get
|
|
745
|
+
* Get all folders for the organization
|
|
652
746
|
*
|
|
653
|
-
* @param {
|
|
747
|
+
* @param {Skyvern.GetFoldersRequest} request
|
|
654
748
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
655
749
|
*
|
|
656
|
-
* @throws {@link Skyvern.NotFoundError}
|
|
657
750
|
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
658
751
|
*
|
|
659
752
|
* @example
|
|
660
|
-
* await client.
|
|
753
|
+
* await client.getFolders({
|
|
754
|
+
* page: 1,
|
|
755
|
+
* page_size: 1,
|
|
756
|
+
* search: "search"
|
|
757
|
+
* })
|
|
661
758
|
*/
|
|
662
|
-
|
|
663
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
759
|
+
getFolders(request = {}, requestOptions) {
|
|
760
|
+
return core.HttpResponsePromise.fromPromise(this.__getFolders(request, requestOptions));
|
|
664
761
|
}
|
|
665
|
-
|
|
666
|
-
return __awaiter(this,
|
|
762
|
+
__getFolders() {
|
|
763
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
667
764
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
765
|
+
const { page, page_size: pageSize, search } = request;
|
|
766
|
+
const _queryParams = {};
|
|
767
|
+
if (page != null) {
|
|
768
|
+
_queryParams.page = page.toString();
|
|
769
|
+
}
|
|
770
|
+
if (pageSize != null) {
|
|
771
|
+
_queryParams.page_size = pageSize.toString();
|
|
772
|
+
}
|
|
773
|
+
if (search != null) {
|
|
774
|
+
_queryParams.search = search;
|
|
775
|
+
}
|
|
668
776
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
669
777
|
const _response = yield core.fetcher({
|
|
670
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud,
|
|
778
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "v1/folders"),
|
|
671
779
|
method: "GET",
|
|
672
780
|
headers: _headers,
|
|
673
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
781
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
674
782
|
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
675
783
|
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
676
784
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -680,8 +788,6 @@ class SkyvernClient {
|
|
|
680
788
|
}
|
|
681
789
|
if (_response.error.reason === "status-code") {
|
|
682
790
|
switch (_response.error.statusCode) {
|
|
683
|
-
case 404:
|
|
684
|
-
throw new Skyvern.NotFoundError(_response.error.body, _response.rawResponse);
|
|
685
791
|
case 422:
|
|
686
792
|
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
687
793
|
default:
|
|
@@ -700,7 +806,7 @@ class SkyvernClient {
|
|
|
700
806
|
rawResponse: _response.rawResponse,
|
|
701
807
|
});
|
|
702
808
|
case "timeout":
|
|
703
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/
|
|
809
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/folders.");
|
|
704
810
|
case "unknown":
|
|
705
811
|
throw new errors.SkyvernError({
|
|
706
812
|
message: _response.error.errorMessage,
|
|
@@ -710,39 +816,34 @@ class SkyvernClient {
|
|
|
710
816
|
});
|
|
711
817
|
}
|
|
712
818
|
/**
|
|
713
|
-
*
|
|
819
|
+
* Create a new folder to organize workflows
|
|
714
820
|
*
|
|
715
|
-
* @param {
|
|
716
|
-
* @param {Skyvern.GetRunArtifactsRequest} request
|
|
821
|
+
* @param {Skyvern.FolderCreate} request
|
|
717
822
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
718
823
|
*
|
|
824
|
+
* @throws {@link Skyvern.BadRequestError}
|
|
719
825
|
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
720
826
|
*
|
|
721
827
|
* @example
|
|
722
|
-
* await client.
|
|
828
|
+
* await client.createFolder({
|
|
829
|
+
* title: "title"
|
|
830
|
+
* })
|
|
723
831
|
*/
|
|
724
|
-
|
|
725
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
832
|
+
createFolder(request, requestOptions) {
|
|
833
|
+
return core.HttpResponsePromise.fromPromise(this.__createFolder(request, requestOptions));
|
|
726
834
|
}
|
|
727
|
-
|
|
728
|
-
return __awaiter(this,
|
|
835
|
+
__createFolder(request, requestOptions) {
|
|
836
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
729
837
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
730
|
-
const { artifact_type: artifactType } = request;
|
|
731
|
-
const _queryParams = {};
|
|
732
|
-
if (artifactType != null) {
|
|
733
|
-
if (Array.isArray(artifactType)) {
|
|
734
|
-
_queryParams.artifact_type = artifactType.map((item) => item);
|
|
735
|
-
}
|
|
736
|
-
else {
|
|
737
|
-
_queryParams.artifact_type = artifactType;
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
838
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
741
839
|
const _response = yield core.fetcher({
|
|
742
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud,
|
|
743
|
-
method: "
|
|
840
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "v1/folders"),
|
|
841
|
+
method: "POST",
|
|
744
842
|
headers: _headers,
|
|
745
|
-
|
|
843
|
+
contentType: "application/json",
|
|
844
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
845
|
+
requestType: "json",
|
|
846
|
+
body: request,
|
|
746
847
|
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
747
848
|
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
748
849
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -752,6 +853,8 @@ class SkyvernClient {
|
|
|
752
853
|
}
|
|
753
854
|
if (_response.error.reason === "status-code") {
|
|
754
855
|
switch (_response.error.statusCode) {
|
|
856
|
+
case 400:
|
|
857
|
+
throw new Skyvern.BadRequestError(_response.error.body, _response.rawResponse);
|
|
755
858
|
case 422:
|
|
756
859
|
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
757
860
|
default:
|
|
@@ -770,7 +873,7 @@ class SkyvernClient {
|
|
|
770
873
|
rawResponse: _response.rawResponse,
|
|
771
874
|
});
|
|
772
875
|
case "timeout":
|
|
773
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling
|
|
876
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /v1/folders.");
|
|
774
877
|
case "unknown":
|
|
775
878
|
throw new errors.SkyvernError({
|
|
776
879
|
message: _response.error.errorMessage,
|
|
@@ -780,32 +883,29 @@ class SkyvernClient {
|
|
|
780
883
|
});
|
|
781
884
|
}
|
|
782
885
|
/**
|
|
783
|
-
*
|
|
886
|
+
* Get a specific folder by ID
|
|
784
887
|
*
|
|
785
|
-
* @param {string}
|
|
786
|
-
* @param {Skyvern.RetryRunWebhookRequest} request
|
|
888
|
+
* @param {string} folderId - Folder ID
|
|
787
889
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
788
890
|
*
|
|
891
|
+
* @throws {@link Skyvern.NotFoundError}
|
|
789
892
|
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
790
893
|
*
|
|
791
894
|
* @example
|
|
792
|
-
* await client.
|
|
895
|
+
* await client.getFolder("fld_123")
|
|
793
896
|
*/
|
|
794
|
-
|
|
795
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
897
|
+
getFolder(folderId, requestOptions) {
|
|
898
|
+
return core.HttpResponsePromise.fromPromise(this.__getFolder(folderId, requestOptions));
|
|
796
899
|
}
|
|
797
|
-
|
|
900
|
+
__getFolder(folderId, requestOptions) {
|
|
798
901
|
return __awaiter(this, void 0, void 0, function* () {
|
|
799
902
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
800
903
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
801
904
|
const _response = yield core.fetcher({
|
|
802
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/
|
|
803
|
-
method: "
|
|
905
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/folders/${core.url.encodePathParam(folderId)}`),
|
|
906
|
+
method: "GET",
|
|
804
907
|
headers: _headers,
|
|
805
|
-
contentType: "application/json",
|
|
806
908
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
807
|
-
requestType: "json",
|
|
808
|
-
body: request != null ? request : undefined,
|
|
809
909
|
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
810
910
|
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
811
911
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -815,6 +915,8 @@ class SkyvernClient {
|
|
|
815
915
|
}
|
|
816
916
|
if (_response.error.reason === "status-code") {
|
|
817
917
|
switch (_response.error.statusCode) {
|
|
918
|
+
case 404:
|
|
919
|
+
throw new Skyvern.NotFoundError(_response.error.body, _response.rawResponse);
|
|
818
920
|
case 422:
|
|
819
921
|
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
820
922
|
default:
|
|
@@ -833,7 +935,7 @@ class SkyvernClient {
|
|
|
833
935
|
rawResponse: _response.rawResponse,
|
|
834
936
|
});
|
|
835
937
|
case "timeout":
|
|
836
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling
|
|
938
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/folders/{folder_id}.");
|
|
837
939
|
case "unknown":
|
|
838
940
|
throw new errors.SkyvernError({
|
|
839
941
|
message: _response.error.errorMessage,
|
|
@@ -843,30 +945,33 @@ class SkyvernClient {
|
|
|
843
945
|
});
|
|
844
946
|
}
|
|
845
947
|
/**
|
|
846
|
-
*
|
|
948
|
+
* Update a folder's title or description
|
|
847
949
|
*
|
|
848
|
-
* @param {string}
|
|
950
|
+
* @param {string} folderId - Folder ID
|
|
951
|
+
* @param {Skyvern.FolderUpdate} request
|
|
849
952
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
850
953
|
*
|
|
851
|
-
* @throws {@link Skyvern.BadRequestError}
|
|
852
954
|
* @throws {@link Skyvern.NotFoundError}
|
|
853
955
|
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
854
956
|
*
|
|
855
957
|
* @example
|
|
856
|
-
* await client.
|
|
958
|
+
* await client.updateFolder("fld_123")
|
|
857
959
|
*/
|
|
858
|
-
|
|
859
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
960
|
+
updateFolder(folderId, request = {}, requestOptions) {
|
|
961
|
+
return core.HttpResponsePromise.fromPromise(this.__updateFolder(folderId, request, requestOptions));
|
|
860
962
|
}
|
|
861
|
-
|
|
862
|
-
return __awaiter(this,
|
|
963
|
+
__updateFolder(folderId_1) {
|
|
964
|
+
return __awaiter(this, arguments, void 0, function* (folderId, request = {}, requestOptions) {
|
|
863
965
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
864
966
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
865
967
|
const _response = yield core.fetcher({
|
|
866
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/
|
|
867
|
-
method: "
|
|
968
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/folders/${core.url.encodePathParam(folderId)}`),
|
|
969
|
+
method: "PUT",
|
|
868
970
|
headers: _headers,
|
|
971
|
+
contentType: "application/json",
|
|
869
972
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
973
|
+
requestType: "json",
|
|
974
|
+
body: request,
|
|
870
975
|
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
871
976
|
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
872
977
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -876,8 +981,6 @@ class SkyvernClient {
|
|
|
876
981
|
}
|
|
877
982
|
if (_response.error.reason === "status-code") {
|
|
878
983
|
switch (_response.error.statusCode) {
|
|
879
|
-
case 400:
|
|
880
|
-
throw new Skyvern.BadRequestError(_response.error.body, _response.rawResponse);
|
|
881
984
|
case 404:
|
|
882
985
|
throw new Skyvern.NotFoundError(_response.error.body, _response.rawResponse);
|
|
883
986
|
case 422:
|
|
@@ -898,7 +1001,7 @@ class SkyvernClient {
|
|
|
898
1001
|
rawResponse: _response.rawResponse,
|
|
899
1002
|
});
|
|
900
1003
|
case "timeout":
|
|
901
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling
|
|
1004
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling PUT /v1/folders/{folder_id}.");
|
|
902
1005
|
case "unknown":
|
|
903
1006
|
throw new errors.SkyvernError({
|
|
904
1007
|
message: _response.error.errorMessage,
|
|
@@ -908,80 +1011,35 @@ class SkyvernClient {
|
|
|
908
1011
|
});
|
|
909
1012
|
}
|
|
910
1013
|
/**
|
|
911
|
-
*
|
|
912
|
-
*
|
|
913
|
-
* Results are paginated and can be filtered by **status**, **search_key**, and **error_code**. All filters are combined with **AND** logic — a run must match every supplied filter to be returned.
|
|
914
|
-
*
|
|
915
|
-
* ### search_key
|
|
916
|
-
*
|
|
917
|
-
* A case-insensitive substring search that matches against **any** of the following fields:
|
|
918
|
-
*
|
|
919
|
-
* | Searched field | Description |
|
|
920
|
-
* |---|---|
|
|
921
|
-
* | `workflow_run_id` | The unique run identifier (e.g. `wr_123…`) |
|
|
922
|
-
* | Parameter **key** | The `key` of any workflow parameter definition associated with the run |
|
|
923
|
-
* | Parameter **description** | The `description` of any workflow parameter definition |
|
|
924
|
-
* | Run parameter **value** | The actual value supplied for any parameter when the run was created |
|
|
925
|
-
* | `extra_http_headers` | Extra HTTP headers attached to the run (searched as raw JSON text) |
|
|
926
|
-
*
|
|
927
|
-
* Soft-deleted parameter definitions are excluded from key/description matching. A run is returned if **any** of the fields above contain the search term.
|
|
928
|
-
*
|
|
929
|
-
* ### error_code
|
|
930
|
-
*
|
|
931
|
-
* An **exact-match** filter against the `error_code` field inside each task's `errors` JSON array. A run matches if **any** of its tasks contains an error object with a matching `error_code` value. Error codes are user-defined strings set during workflow execution (e.g. `INVALID_CREDENTIALS`, `LOGIN_FAILED`, `CAPTCHA_DETECTED`).
|
|
932
|
-
*
|
|
933
|
-
* ### Combining filters
|
|
934
|
-
*
|
|
935
|
-
* All query parameters use AND logic:
|
|
936
|
-
* - `?status=failed` — only failed runs
|
|
937
|
-
* - `?status=failed&error_code=LOGIN_FAILED` — failed runs **and** have a LOGIN_FAILED error
|
|
938
|
-
* - `?status=failed&error_code=LOGIN_FAILED&search_key=prod_credential` — all three conditions must match
|
|
1014
|
+
* Delete a folder. Optionally delete all workflows in the folder.
|
|
939
1015
|
*
|
|
940
|
-
* @param {
|
|
1016
|
+
* @param {string} folderId - Folder ID
|
|
1017
|
+
* @param {Skyvern.DeleteFolderRequest} request
|
|
941
1018
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
942
1019
|
*
|
|
1020
|
+
* @throws {@link Skyvern.NotFoundError}
|
|
943
1021
|
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
944
1022
|
*
|
|
945
1023
|
* @example
|
|
946
|
-
* await client.
|
|
947
|
-
*
|
|
948
|
-
* page_size: 1,
|
|
949
|
-
* search_key: "search_key",
|
|
950
|
-
* error_code: "error_code"
|
|
1024
|
+
* await client.deleteFolder("fld_123", {
|
|
1025
|
+
* delete_workflows: true
|
|
951
1026
|
* })
|
|
952
1027
|
*/
|
|
953
|
-
|
|
954
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
1028
|
+
deleteFolder(folderId, request = {}, requestOptions) {
|
|
1029
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteFolder(folderId, request, requestOptions));
|
|
955
1030
|
}
|
|
956
|
-
|
|
957
|
-
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
1031
|
+
__deleteFolder(folderId_1) {
|
|
1032
|
+
return __awaiter(this, arguments, void 0, function* (folderId, request = {}, requestOptions) {
|
|
958
1033
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
959
|
-
const {
|
|
1034
|
+
const { delete_workflows: deleteWorkflows } = request;
|
|
960
1035
|
const _queryParams = {};
|
|
961
|
-
if (
|
|
962
|
-
_queryParams.
|
|
963
|
-
}
|
|
964
|
-
if (pageSize != null) {
|
|
965
|
-
_queryParams.page_size = pageSize.toString();
|
|
966
|
-
}
|
|
967
|
-
if (status != null) {
|
|
968
|
-
if (Array.isArray(status)) {
|
|
969
|
-
_queryParams.status = status.map((item) => item);
|
|
970
|
-
}
|
|
971
|
-
else {
|
|
972
|
-
_queryParams.status = status;
|
|
973
|
-
}
|
|
974
|
-
}
|
|
975
|
-
if (searchKey != null) {
|
|
976
|
-
_queryParams.search_key = searchKey;
|
|
977
|
-
}
|
|
978
|
-
if (errorCode != null) {
|
|
979
|
-
_queryParams.error_code = errorCode;
|
|
1036
|
+
if (deleteWorkflows != null) {
|
|
1037
|
+
_queryParams.delete_workflows = deleteWorkflows.toString();
|
|
980
1038
|
}
|
|
981
1039
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
982
1040
|
const _response = yield core.fetcher({
|
|
983
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud,
|
|
984
|
-
method: "
|
|
1041
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/folders/${core.url.encodePathParam(folderId)}`),
|
|
1042
|
+
method: "DELETE",
|
|
985
1043
|
headers: _headers,
|
|
986
1044
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
987
1045
|
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
@@ -993,6 +1051,8 @@ class SkyvernClient {
|
|
|
993
1051
|
}
|
|
994
1052
|
if (_response.error.reason === "status-code") {
|
|
995
1053
|
switch (_response.error.statusCode) {
|
|
1054
|
+
case 404:
|
|
1055
|
+
throw new Skyvern.NotFoundError(_response.error.body, _response.rawResponse);
|
|
996
1056
|
case 422:
|
|
997
1057
|
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
998
1058
|
default:
|
|
@@ -1011,7 +1071,7 @@ class SkyvernClient {
|
|
|
1011
1071
|
rawResponse: _response.rawResponse,
|
|
1012
1072
|
});
|
|
1013
1073
|
case "timeout":
|
|
1014
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling
|
|
1074
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling DELETE /v1/folders/{folder_id}.");
|
|
1015
1075
|
case "unknown":
|
|
1016
1076
|
throw new errors.SkyvernError({
|
|
1017
1077
|
message: _response.error.errorMessage,
|
|
@@ -1021,38 +1081,29 @@ class SkyvernClient {
|
|
|
1021
1081
|
});
|
|
1022
1082
|
}
|
|
1023
1083
|
/**
|
|
1024
|
-
*
|
|
1025
|
-
*
|
|
1084
|
+
* Get the current tag state for a workflow run.
|
|
1085
|
+
*
|
|
1086
|
+
* @param {string} workflowRunId - Workflow run ID
|
|
1026
1087
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1027
1088
|
*
|
|
1089
|
+
* @throws {@link Skyvern.NotFoundError}
|
|
1028
1090
|
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
1029
1091
|
*
|
|
1030
1092
|
* @example
|
|
1031
|
-
* await client.
|
|
1032
|
-
* version: 1,
|
|
1033
|
-
* template: true
|
|
1034
|
-
* })
|
|
1093
|
+
* await client.getRunTags("wr_123")
|
|
1035
1094
|
*/
|
|
1036
|
-
|
|
1037
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
1095
|
+
getRunTags(workflowRunId, requestOptions) {
|
|
1096
|
+
return core.HttpResponsePromise.fromPromise(this.__getRunTags(workflowRunId, requestOptions));
|
|
1038
1097
|
}
|
|
1039
|
-
|
|
1040
|
-
return __awaiter(this,
|
|
1098
|
+
__getRunTags(workflowRunId, requestOptions) {
|
|
1099
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1041
1100
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
1042
|
-
const { version, template } = request;
|
|
1043
|
-
const _queryParams = {};
|
|
1044
|
-
if (version != null) {
|
|
1045
|
-
_queryParams.version = version.toString();
|
|
1046
|
-
}
|
|
1047
|
-
if (template != null) {
|
|
1048
|
-
_queryParams.template = template.toString();
|
|
1049
|
-
}
|
|
1050
1101
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1051
1102
|
const _response = yield core.fetcher({
|
|
1052
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/
|
|
1103
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/runs/${core.url.encodePathParam(workflowRunId)}/tags`),
|
|
1053
1104
|
method: "GET",
|
|
1054
1105
|
headers: _headers,
|
|
1055
|
-
queryParameters:
|
|
1106
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
1056
1107
|
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
1057
1108
|
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
1058
1109
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -1062,6 +1113,8 @@ class SkyvernClient {
|
|
|
1062
1113
|
}
|
|
1063
1114
|
if (_response.error.reason === "status-code") {
|
|
1064
1115
|
switch (_response.error.statusCode) {
|
|
1116
|
+
case 404:
|
|
1117
|
+
throw new Skyvern.NotFoundError(_response.error.body, _response.rawResponse);
|
|
1065
1118
|
case 422:
|
|
1066
1119
|
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
1067
1120
|
default:
|
|
@@ -1080,7 +1133,7 @@ class SkyvernClient {
|
|
|
1080
1133
|
rawResponse: _response.rawResponse,
|
|
1081
1134
|
});
|
|
1082
1135
|
case "timeout":
|
|
1083
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/
|
|
1136
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/runs/{workflow_run_id}/tags.");
|
|
1084
1137
|
case "unknown":
|
|
1085
1138
|
throw new errors.SkyvernError({
|
|
1086
1139
|
message: _response.error.errorMessage,
|
|
@@ -1090,36 +1143,33 @@ class SkyvernClient {
|
|
|
1090
1143
|
});
|
|
1091
1144
|
}
|
|
1092
1145
|
/**
|
|
1093
|
-
*
|
|
1146
|
+
* Atomically apply tag changes to a workflow run. Sets and deletes happen in one transaction; same-key collisions resolve set-wins.
|
|
1094
1147
|
*
|
|
1095
|
-
* @param {string}
|
|
1096
|
-
* @param {Skyvern.
|
|
1148
|
+
* @param {string} workflowRunId - Workflow run ID
|
|
1149
|
+
* @param {Skyvern.TagApplyRequest} request
|
|
1097
1150
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1098
1151
|
*
|
|
1152
|
+
* @throws {@link Skyvern.NotFoundError}
|
|
1099
1153
|
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
1100
1154
|
*
|
|
1101
1155
|
* @example
|
|
1102
|
-
* await client.
|
|
1103
|
-
* template: true
|
|
1104
|
-
* })
|
|
1156
|
+
* await client.applyRunTags("wr_123", {})
|
|
1105
1157
|
*/
|
|
1106
|
-
|
|
1107
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
1158
|
+
applyRunTags(workflowRunId, request, requestOptions) {
|
|
1159
|
+
return core.HttpResponsePromise.fromPromise(this.__applyRunTags(workflowRunId, request, requestOptions));
|
|
1108
1160
|
}
|
|
1109
|
-
|
|
1110
|
-
return __awaiter(this,
|
|
1161
|
+
__applyRunTags(workflowRunId, request, requestOptions) {
|
|
1162
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1111
1163
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
1112
|
-
const { template } = request;
|
|
1113
|
-
const _queryParams = {};
|
|
1114
|
-
if (template != null) {
|
|
1115
|
-
_queryParams.template = template.toString();
|
|
1116
|
-
}
|
|
1117
1164
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1118
1165
|
const _response = yield core.fetcher({
|
|
1119
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/
|
|
1120
|
-
method: "
|
|
1166
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/runs/${core.url.encodePathParam(workflowRunId)}/tags`),
|
|
1167
|
+
method: "POST",
|
|
1121
1168
|
headers: _headers,
|
|
1122
|
-
|
|
1169
|
+
contentType: "application/json",
|
|
1170
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
1171
|
+
requestType: "json",
|
|
1172
|
+
body: request,
|
|
1123
1173
|
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
1124
1174
|
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
1125
1175
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -1129,6 +1179,8 @@ class SkyvernClient {
|
|
|
1129
1179
|
}
|
|
1130
1180
|
if (_response.error.reason === "status-code") {
|
|
1131
1181
|
switch (_response.error.statusCode) {
|
|
1182
|
+
case 404:
|
|
1183
|
+
throw new Skyvern.NotFoundError(_response.error.body, _response.rawResponse);
|
|
1132
1184
|
case 422:
|
|
1133
1185
|
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
1134
1186
|
default:
|
|
@@ -1147,7 +1199,7 @@ class SkyvernClient {
|
|
|
1147
1199
|
rawResponse: _response.rawResponse,
|
|
1148
1200
|
});
|
|
1149
1201
|
case "timeout":
|
|
1150
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling
|
|
1202
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /v1/runs/{workflow_run_id}/tags.");
|
|
1151
1203
|
case "unknown":
|
|
1152
1204
|
throw new errors.SkyvernError({
|
|
1153
1205
|
message: _response.error.errorMessage,
|
|
@@ -1157,35 +1209,30 @@ class SkyvernClient {
|
|
|
1157
1209
|
});
|
|
1158
1210
|
}
|
|
1159
1211
|
/**
|
|
1160
|
-
*
|
|
1212
|
+
* Soft-delete a single grouped tag from a workflow run. Writes a DELETE event row.
|
|
1213
|
+
*
|
|
1214
|
+
* @param {string} workflowRunId - Workflow run ID
|
|
1215
|
+
* @param {string} key - Tag key to delete
|
|
1161
1216
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1162
1217
|
*
|
|
1218
|
+
* @throws {@link Skyvern.NotFoundError}
|
|
1163
1219
|
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
1164
1220
|
*
|
|
1165
1221
|
* @example
|
|
1166
|
-
*
|
|
1167
|
-
* await client.uploadFile({
|
|
1168
|
-
* file: fs.createReadStream("/path/to/your/file")
|
|
1169
|
-
* })
|
|
1222
|
+
* await client.deleteRunTag("wr_123", "env")
|
|
1170
1223
|
*/
|
|
1171
|
-
|
|
1172
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
1224
|
+
deleteRunTag(workflowRunId, key, requestOptions) {
|
|
1225
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteRunTag(workflowRunId, key, requestOptions));
|
|
1173
1226
|
}
|
|
1174
|
-
|
|
1227
|
+
__deleteRunTag(workflowRunId, key, requestOptions) {
|
|
1175
1228
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1176
1229
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
1177
|
-
const
|
|
1178
|
-
yield _request.appendFile("file", request.file);
|
|
1179
|
-
const _maybeEncodedRequest = yield _request.getRequest();
|
|
1180
|
-
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1230
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1181
1231
|
const _response = yield core.fetcher({
|
|
1182
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud,
|
|
1183
|
-
method: "
|
|
1232
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/runs/${core.url.encodePathParam(workflowRunId)}/tags/${core.url.encodePathParam(key)}`),
|
|
1233
|
+
method: "DELETE",
|
|
1184
1234
|
headers: _headers,
|
|
1185
1235
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
1186
|
-
requestType: "file",
|
|
1187
|
-
duplex: _maybeEncodedRequest.duplex,
|
|
1188
|
-
body: _maybeEncodedRequest.body,
|
|
1189
1236
|
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
1190
1237
|
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
1191
1238
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -1195,6 +1242,8 @@ class SkyvernClient {
|
|
|
1195
1242
|
}
|
|
1196
1243
|
if (_response.error.reason === "status-code") {
|
|
1197
1244
|
switch (_response.error.statusCode) {
|
|
1245
|
+
case 404:
|
|
1246
|
+
throw new Skyvern.NotFoundError(_response.error.body, _response.rawResponse);
|
|
1198
1247
|
case 422:
|
|
1199
1248
|
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
1200
1249
|
default:
|
|
@@ -1213,7 +1262,7 @@ class SkyvernClient {
|
|
|
1213
1262
|
rawResponse: _response.rawResponse,
|
|
1214
1263
|
});
|
|
1215
1264
|
case "timeout":
|
|
1216
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling
|
|
1265
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling DELETE /v1/runs/{workflow_run_id}/tags/{key}.");
|
|
1217
1266
|
case "unknown":
|
|
1218
1267
|
throw new errors.SkyvernError({
|
|
1219
1268
|
message: _response.error.errorMessage,
|
|
@@ -1223,32 +1272,42 @@ class SkyvernClient {
|
|
|
1223
1272
|
});
|
|
1224
1273
|
}
|
|
1225
1274
|
/**
|
|
1226
|
-
*
|
|
1275
|
+
* Chronological tag-event log for a workflow run (newest first). Includes SET and DELETE events.
|
|
1227
1276
|
*
|
|
1228
|
-
* @param {
|
|
1277
|
+
* @param {string} workflowRunId - Workflow run ID
|
|
1278
|
+
* @param {Skyvern.GetRunTagHistoryRequest} request
|
|
1229
1279
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1230
1280
|
*
|
|
1281
|
+
* @throws {@link Skyvern.NotFoundError}
|
|
1231
1282
|
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
1232
1283
|
*
|
|
1233
1284
|
* @example
|
|
1234
|
-
* await client.
|
|
1235
|
-
*
|
|
1285
|
+
* await client.getRunTagHistory("wr_123", {
|
|
1286
|
+
* limit: 1,
|
|
1287
|
+
* since: "2024-01-15T09:30:00Z",
|
|
1288
|
+
* key: "key"
|
|
1236
1289
|
* })
|
|
1237
1290
|
*/
|
|
1238
|
-
|
|
1239
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
1291
|
+
getRunTagHistory(workflowRunId, request = {}, requestOptions) {
|
|
1292
|
+
return core.HttpResponsePromise.fromPromise(this.__getRunTagHistory(workflowRunId, request, requestOptions));
|
|
1240
1293
|
}
|
|
1241
|
-
|
|
1242
|
-
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
1294
|
+
__getRunTagHistory(workflowRunId_1) {
|
|
1295
|
+
return __awaiter(this, arguments, void 0, function* (workflowRunId, request = {}, requestOptions) {
|
|
1243
1296
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
1244
|
-
const {
|
|
1297
|
+
const { limit, since, key } = request;
|
|
1245
1298
|
const _queryParams = {};
|
|
1246
|
-
if (
|
|
1247
|
-
_queryParams.
|
|
1299
|
+
if (limit != null) {
|
|
1300
|
+
_queryParams.limit = limit.toString();
|
|
1301
|
+
}
|
|
1302
|
+
if (since != null) {
|
|
1303
|
+
_queryParams.since = since;
|
|
1304
|
+
}
|
|
1305
|
+
if (key != null) {
|
|
1306
|
+
_queryParams.key = key;
|
|
1248
1307
|
}
|
|
1249
1308
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1250
1309
|
const _response = yield core.fetcher({
|
|
1251
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud,
|
|
1310
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/runs/${core.url.encodePathParam(workflowRunId)}/tags/history`),
|
|
1252
1311
|
method: "GET",
|
|
1253
1312
|
headers: _headers,
|
|
1254
1313
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -1261,6 +1320,8 @@ class SkyvernClient {
|
|
|
1261
1320
|
}
|
|
1262
1321
|
if (_response.error.reason === "status-code") {
|
|
1263
1322
|
switch (_response.error.statusCode) {
|
|
1323
|
+
case 404:
|
|
1324
|
+
throw new Skyvern.NotFoundError(_response.error.body, _response.rawResponse);
|
|
1264
1325
|
case 422:
|
|
1265
1326
|
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
1266
1327
|
default:
|
|
@@ -1279,7 +1340,7 @@ class SkyvernClient {
|
|
|
1279
1340
|
rawResponse: _response.rawResponse,
|
|
1280
1341
|
});
|
|
1281
1342
|
case "timeout":
|
|
1282
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/
|
|
1343
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/runs/{workflow_run_id}/tags/history.");
|
|
1283
1344
|
case "unknown":
|
|
1284
1345
|
throw new errors.SkyvernError({
|
|
1285
1346
|
message: _response.error.errorMessage,
|
|
@@ -1289,35 +1350,27 @@ class SkyvernClient {
|
|
|
1289
1350
|
});
|
|
1290
1351
|
}
|
|
1291
1352
|
/**
|
|
1292
|
-
*
|
|
1353
|
+
* List all tag keys registered for the organization with their descriptions.
|
|
1293
1354
|
*
|
|
1294
|
-
* @param {Skyvern.CreateBrowserProfileRequest} request
|
|
1295
1355
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1296
1356
|
*
|
|
1297
|
-
* @throws {@link Skyvern.BadRequestError}
|
|
1298
|
-
* @throws {@link Skyvern.ConflictError}
|
|
1299
1357
|
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
1300
1358
|
*
|
|
1301
1359
|
* @example
|
|
1302
|
-
* await client.
|
|
1303
|
-
* name: "name"
|
|
1304
|
-
* })
|
|
1360
|
+
* await client.listTagKeys()
|
|
1305
1361
|
*/
|
|
1306
|
-
|
|
1307
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
1362
|
+
listTagKeys(requestOptions) {
|
|
1363
|
+
return core.HttpResponsePromise.fromPromise(this.__listTagKeys(requestOptions));
|
|
1308
1364
|
}
|
|
1309
|
-
|
|
1365
|
+
__listTagKeys(requestOptions) {
|
|
1310
1366
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1311
1367
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
1312
1368
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1313
1369
|
const _response = yield core.fetcher({
|
|
1314
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "v1/
|
|
1315
|
-
method: "
|
|
1370
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "v1/tag-keys"),
|
|
1371
|
+
method: "GET",
|
|
1316
1372
|
headers: _headers,
|
|
1317
|
-
contentType: "application/json",
|
|
1318
1373
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
1319
|
-
requestType: "json",
|
|
1320
|
-
body: request,
|
|
1321
1374
|
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
1322
1375
|
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
1323
1376
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -1327,10 +1380,6 @@ class SkyvernClient {
|
|
|
1327
1380
|
}
|
|
1328
1381
|
if (_response.error.reason === "status-code") {
|
|
1329
1382
|
switch (_response.error.statusCode) {
|
|
1330
|
-
case 400:
|
|
1331
|
-
throw new Skyvern.BadRequestError(_response.error.body, _response.rawResponse);
|
|
1332
|
-
case 409:
|
|
1333
|
-
throw new Skyvern.ConflictError(_response.error.body, _response.rawResponse);
|
|
1334
1383
|
case 422:
|
|
1335
1384
|
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
1336
1385
|
default:
|
|
@@ -1349,7 +1398,7 @@ class SkyvernClient {
|
|
|
1349
1398
|
rawResponse: _response.rawResponse,
|
|
1350
1399
|
});
|
|
1351
1400
|
case "timeout":
|
|
1352
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling
|
|
1401
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/tag-keys.");
|
|
1353
1402
|
case "unknown":
|
|
1354
1403
|
throw new errors.SkyvernError({
|
|
1355
1404
|
message: _response.error.errorMessage,
|
|
@@ -1359,27 +1408,27 @@ class SkyvernClient {
|
|
|
1359
1408
|
});
|
|
1360
1409
|
}
|
|
1361
1410
|
/**
|
|
1362
|
-
*
|
|
1411
|
+
* Delete a tag key from the organization registry and remove that tag from every workflow that currently has it (cascade). Returns how many workflows the tag was removed from.
|
|
1363
1412
|
*
|
|
1364
|
-
* @param {string}
|
|
1413
|
+
* @param {string} key - Tag key to delete
|
|
1365
1414
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1366
1415
|
*
|
|
1367
1416
|
* @throws {@link Skyvern.NotFoundError}
|
|
1368
1417
|
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
1369
1418
|
*
|
|
1370
1419
|
* @example
|
|
1371
|
-
* await client.
|
|
1420
|
+
* await client.deleteTagKey("env")
|
|
1372
1421
|
*/
|
|
1373
|
-
|
|
1374
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
1422
|
+
deleteTagKey(key, requestOptions) {
|
|
1423
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteTagKey(key, requestOptions));
|
|
1375
1424
|
}
|
|
1376
|
-
|
|
1425
|
+
__deleteTagKey(key, requestOptions) {
|
|
1377
1426
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1378
1427
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
1379
1428
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1380
1429
|
const _response = yield core.fetcher({
|
|
1381
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/
|
|
1382
|
-
method: "
|
|
1430
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/tag-keys/${core.url.encodePathParam(key)}`),
|
|
1431
|
+
method: "DELETE",
|
|
1383
1432
|
headers: _headers,
|
|
1384
1433
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
1385
1434
|
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
@@ -1411,7 +1460,7 @@ class SkyvernClient {
|
|
|
1411
1460
|
rawResponse: _response.rawResponse,
|
|
1412
1461
|
});
|
|
1413
1462
|
case "timeout":
|
|
1414
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling
|
|
1463
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling DELETE /v1/tag-keys/{key}.");
|
|
1415
1464
|
case "unknown":
|
|
1416
1465
|
throw new errors.SkyvernError({
|
|
1417
1466
|
message: _response.error.errorMessage,
|
|
@@ -1421,35 +1470,39 @@ class SkyvernClient {
|
|
|
1421
1470
|
});
|
|
1422
1471
|
}
|
|
1423
1472
|
/**
|
|
1424
|
-
*
|
|
1473
|
+
* Update the description for a tag key.
|
|
1425
1474
|
*
|
|
1426
|
-
* @param {string}
|
|
1475
|
+
* @param {string} key - Tag key to update
|
|
1476
|
+
* @param {Skyvern.TagKeyUpdate} request
|
|
1427
1477
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1428
1478
|
*
|
|
1429
1479
|
* @throws {@link Skyvern.NotFoundError}
|
|
1430
1480
|
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
1431
1481
|
*
|
|
1432
1482
|
* @example
|
|
1433
|
-
* await client.
|
|
1483
|
+
* await client.updateTagKey("key")
|
|
1434
1484
|
*/
|
|
1435
|
-
|
|
1436
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
1485
|
+
updateTagKey(key, request = {}, requestOptions) {
|
|
1486
|
+
return core.HttpResponsePromise.fromPromise(this.__updateTagKey(key, request, requestOptions));
|
|
1437
1487
|
}
|
|
1438
|
-
|
|
1439
|
-
return __awaiter(this,
|
|
1488
|
+
__updateTagKey(key_1) {
|
|
1489
|
+
return __awaiter(this, arguments, void 0, function* (key, request = {}, requestOptions) {
|
|
1440
1490
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
1441
1491
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1442
1492
|
const _response = yield core.fetcher({
|
|
1443
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/
|
|
1444
|
-
method: "
|
|
1493
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/tag-keys/${core.url.encodePathParam(key)}`),
|
|
1494
|
+
method: "PATCH",
|
|
1445
1495
|
headers: _headers,
|
|
1496
|
+
contentType: "application/json",
|
|
1446
1497
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
1498
|
+
requestType: "json",
|
|
1499
|
+
body: request,
|
|
1447
1500
|
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
1448
1501
|
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
1449
1502
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1450
1503
|
});
|
|
1451
1504
|
if (_response.ok) {
|
|
1452
|
-
return { data:
|
|
1505
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
1453
1506
|
}
|
|
1454
1507
|
if (_response.error.reason === "status-code") {
|
|
1455
1508
|
switch (_response.error.statusCode) {
|
|
@@ -1473,7 +1526,7 @@ class SkyvernClient {
|
|
|
1473
1526
|
rawResponse: _response.rawResponse,
|
|
1474
1527
|
});
|
|
1475
1528
|
case "timeout":
|
|
1476
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling
|
|
1529
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling PATCH /v1/tag-keys/{key}.");
|
|
1477
1530
|
case "unknown":
|
|
1478
1531
|
throw new errors.SkyvernError({
|
|
1479
1532
|
message: _response.error.errorMessage,
|
|
@@ -1483,28 +1536,35 @@ class SkyvernClient {
|
|
|
1483
1536
|
});
|
|
1484
1537
|
}
|
|
1485
1538
|
/**
|
|
1486
|
-
*
|
|
1539
|
+
* List the palette color and current workflow usage count for each grouped tag (key, value) for the organization. The frontend joins these onto tags by (key, value); workflow_count is the number of non-deleted workflows carrying the label and powers the per-label usage and delete blast-radius warnings.
|
|
1487
1540
|
*
|
|
1541
|
+
* @param {Skyvern.ListTagValuesRequest} request
|
|
1488
1542
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1489
1543
|
*
|
|
1490
|
-
* @throws {@link Skyvern.ForbiddenError}
|
|
1491
1544
|
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
1492
1545
|
*
|
|
1493
1546
|
* @example
|
|
1494
|
-
* await client.
|
|
1547
|
+
* await client.listTagValues({
|
|
1548
|
+
* key: "key"
|
|
1549
|
+
* })
|
|
1495
1550
|
*/
|
|
1496
|
-
|
|
1497
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
1551
|
+
listTagValues(request = {}, requestOptions) {
|
|
1552
|
+
return core.HttpResponsePromise.fromPromise(this.__listTagValues(request, requestOptions));
|
|
1498
1553
|
}
|
|
1499
|
-
|
|
1500
|
-
return __awaiter(this,
|
|
1554
|
+
__listTagValues() {
|
|
1555
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
1501
1556
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
1557
|
+
const { key } = request;
|
|
1558
|
+
const _queryParams = {};
|
|
1559
|
+
if (key != null) {
|
|
1560
|
+
_queryParams.key = key;
|
|
1561
|
+
}
|
|
1502
1562
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1503
1563
|
const _response = yield core.fetcher({
|
|
1504
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "v1/
|
|
1564
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "v1/tag-values"),
|
|
1505
1565
|
method: "GET",
|
|
1506
1566
|
headers: _headers,
|
|
1507
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
1567
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
1508
1568
|
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
1509
1569
|
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
1510
1570
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -1514,8 +1574,6 @@ class SkyvernClient {
|
|
|
1514
1574
|
}
|
|
1515
1575
|
if (_response.error.reason === "status-code") {
|
|
1516
1576
|
switch (_response.error.statusCode) {
|
|
1517
|
-
case 403:
|
|
1518
|
-
throw new Skyvern.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
1519
1577
|
case 422:
|
|
1520
1578
|
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
1521
1579
|
default:
|
|
@@ -1534,7 +1592,7 @@ class SkyvernClient {
|
|
|
1534
1592
|
rawResponse: _response.rawResponse,
|
|
1535
1593
|
});
|
|
1536
1594
|
case "timeout":
|
|
1537
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/
|
|
1595
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/tag-values.");
|
|
1538
1596
|
case "unknown":
|
|
1539
1597
|
throw new errors.SkyvernError({
|
|
1540
1598
|
message: _response.error.errorMessage,
|
|
@@ -1544,28 +1602,30 @@ class SkyvernClient {
|
|
|
1544
1602
|
});
|
|
1545
1603
|
}
|
|
1546
1604
|
/**
|
|
1547
|
-
*
|
|
1605
|
+
* Soft-delete a grouped tag (key, value) and remove that label from every workflow carrying it (cascade). The value rides in the body so values containing '/' stay addressable. Returns how many workflows the label was removed from.
|
|
1548
1606
|
*
|
|
1549
|
-
* @param {
|
|
1607
|
+
* @param {string} key - Tag key (group)
|
|
1608
|
+
* @param {Skyvern.TagValueDelete} request
|
|
1550
1609
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1551
1610
|
*
|
|
1552
|
-
* @throws {@link Skyvern.ForbiddenError}
|
|
1553
1611
|
* @throws {@link Skyvern.NotFoundError}
|
|
1554
1612
|
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
1555
1613
|
*
|
|
1556
1614
|
* @example
|
|
1557
|
-
* await client.
|
|
1615
|
+
* await client.deleteTagValue("env", {
|
|
1616
|
+
* value: "value"
|
|
1617
|
+
* })
|
|
1558
1618
|
*/
|
|
1559
|
-
|
|
1560
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
1619
|
+
deleteTagValue(key, request, requestOptions) {
|
|
1620
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteTagValue(key, request, requestOptions));
|
|
1561
1621
|
}
|
|
1562
|
-
|
|
1563
|
-
return __awaiter(this,
|
|
1622
|
+
__deleteTagValue(key, request, requestOptions) {
|
|
1623
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1564
1624
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
1565
1625
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1566
1626
|
const _response = yield core.fetcher({
|
|
1567
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud,
|
|
1568
|
-
method: "
|
|
1627
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/tag-values/${core.url.encodePathParam(key)}`),
|
|
1628
|
+
method: "DELETE",
|
|
1569
1629
|
headers: _headers,
|
|
1570
1630
|
contentType: "application/json",
|
|
1571
1631
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -1580,8 +1640,6 @@ class SkyvernClient {
|
|
|
1580
1640
|
}
|
|
1581
1641
|
if (_response.error.reason === "status-code") {
|
|
1582
1642
|
switch (_response.error.statusCode) {
|
|
1583
|
-
case 403:
|
|
1584
|
-
throw new Skyvern.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
1585
1643
|
case 404:
|
|
1586
1644
|
throw new Skyvern.NotFoundError(_response.error.body, _response.rawResponse);
|
|
1587
1645
|
case 422:
|
|
@@ -1602,7 +1660,7 @@ class SkyvernClient {
|
|
|
1602
1660
|
rawResponse: _response.rawResponse,
|
|
1603
1661
|
});
|
|
1604
1662
|
case "timeout":
|
|
1605
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling
|
|
1663
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling DELETE /v1/tag-values/{key}.");
|
|
1606
1664
|
case "unknown":
|
|
1607
1665
|
throw new errors.SkyvernError({
|
|
1608
1666
|
message: _response.error.errorMessage,
|
|
@@ -1612,29 +1670,36 @@ class SkyvernClient {
|
|
|
1612
1670
|
});
|
|
1613
1671
|
}
|
|
1614
1672
|
/**
|
|
1615
|
-
*
|
|
1673
|
+
* Recolor a grouped tag (key, value). The value is supplied in the body so values containing '/' stay addressable. The new color must be a palette name.
|
|
1616
1674
|
*
|
|
1617
|
-
* @param {string}
|
|
1675
|
+
* @param {string} key - Tag key (group)
|
|
1676
|
+
* @param {Skyvern.TagValueUpdate} request
|
|
1618
1677
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1619
1678
|
*
|
|
1620
|
-
* @throws {@link Skyvern.
|
|
1679
|
+
* @throws {@link Skyvern.NotFoundError}
|
|
1621
1680
|
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
1622
1681
|
*
|
|
1623
1682
|
* @example
|
|
1624
|
-
* await client.
|
|
1683
|
+
* await client.updateTagValue("env", {
|
|
1684
|
+
* value: "value",
|
|
1685
|
+
* color: "color"
|
|
1686
|
+
* })
|
|
1625
1687
|
*/
|
|
1626
|
-
|
|
1627
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
1688
|
+
updateTagValue(key, request, requestOptions) {
|
|
1689
|
+
return core.HttpResponsePromise.fromPromise(this.__updateTagValue(key, request, requestOptions));
|
|
1628
1690
|
}
|
|
1629
|
-
|
|
1691
|
+
__updateTagValue(key, request, requestOptions) {
|
|
1630
1692
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1631
1693
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
1632
1694
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1633
1695
|
const _response = yield core.fetcher({
|
|
1634
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/
|
|
1635
|
-
method: "
|
|
1696
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/tag-values/${core.url.encodePathParam(key)}`),
|
|
1697
|
+
method: "PATCH",
|
|
1636
1698
|
headers: _headers,
|
|
1699
|
+
contentType: "application/json",
|
|
1637
1700
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
1701
|
+
requestType: "json",
|
|
1702
|
+
body: request,
|
|
1638
1703
|
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
1639
1704
|
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
1640
1705
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -1644,8 +1709,8 @@ class SkyvernClient {
|
|
|
1644
1709
|
}
|
|
1645
1710
|
if (_response.error.reason === "status-code") {
|
|
1646
1711
|
switch (_response.error.statusCode) {
|
|
1647
|
-
case
|
|
1648
|
-
throw new Skyvern.
|
|
1712
|
+
case 404:
|
|
1713
|
+
throw new Skyvern.NotFoundError(_response.error.body, _response.rawResponse);
|
|
1649
1714
|
case 422:
|
|
1650
1715
|
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
1651
1716
|
default:
|
|
@@ -1664,7 +1729,7 @@ class SkyvernClient {
|
|
|
1664
1729
|
rawResponse: _response.rawResponse,
|
|
1665
1730
|
});
|
|
1666
1731
|
case "timeout":
|
|
1667
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling
|
|
1732
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling PATCH /v1/tag-values/{key}.");
|
|
1668
1733
|
case "unknown":
|
|
1669
1734
|
throw new errors.SkyvernError({
|
|
1670
1735
|
message: _response.error.errorMessage,
|
|
@@ -1674,30 +1739,37 @@ class SkyvernClient {
|
|
|
1674
1739
|
});
|
|
1675
1740
|
}
|
|
1676
1741
|
/**
|
|
1677
|
-
*
|
|
1742
|
+
* Rename a grouped tag (key, value) to (key, new_value). The cascade re-tags every workflow carrying the old label; the new label inherits the old color. Both values ride in the body so values containing '/' stay addressable. Rejects with 409 when the new value already exists for the key.
|
|
1678
1743
|
*
|
|
1679
|
-
* @param {string}
|
|
1744
|
+
* @param {string} key - Tag key (group)
|
|
1745
|
+
* @param {Skyvern.TagValueRename} request
|
|
1680
1746
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1681
1747
|
*
|
|
1682
|
-
* @throws {@link Skyvern.ForbiddenError}
|
|
1683
1748
|
* @throws {@link Skyvern.NotFoundError}
|
|
1749
|
+
* @throws {@link Skyvern.ConflictError}
|
|
1684
1750
|
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
1685
1751
|
*
|
|
1686
1752
|
* @example
|
|
1687
|
-
* await client.
|
|
1753
|
+
* await client.renameTagValue("env", {
|
|
1754
|
+
* value: "value",
|
|
1755
|
+
* new_value: "new_value"
|
|
1756
|
+
* })
|
|
1688
1757
|
*/
|
|
1689
|
-
|
|
1690
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
1758
|
+
renameTagValue(key, request, requestOptions) {
|
|
1759
|
+
return core.HttpResponsePromise.fromPromise(this.__renameTagValue(key, request, requestOptions));
|
|
1691
1760
|
}
|
|
1692
|
-
|
|
1761
|
+
__renameTagValue(key, request, requestOptions) {
|
|
1693
1762
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1694
1763
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
1695
1764
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1696
1765
|
const _response = yield core.fetcher({
|
|
1697
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/
|
|
1698
|
-
method: "
|
|
1766
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/tag-values/${core.url.encodePathParam(key)}/rename`),
|
|
1767
|
+
method: "PATCH",
|
|
1699
1768
|
headers: _headers,
|
|
1769
|
+
contentType: "application/json",
|
|
1700
1770
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
1771
|
+
requestType: "json",
|
|
1772
|
+
body: request,
|
|
1701
1773
|
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
1702
1774
|
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
1703
1775
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -1707,10 +1779,10 @@ class SkyvernClient {
|
|
|
1707
1779
|
}
|
|
1708
1780
|
if (_response.error.reason === "status-code") {
|
|
1709
1781
|
switch (_response.error.statusCode) {
|
|
1710
|
-
case 403:
|
|
1711
|
-
throw new Skyvern.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
1712
1782
|
case 404:
|
|
1713
1783
|
throw new Skyvern.NotFoundError(_response.error.body, _response.rawResponse);
|
|
1784
|
+
case 409:
|
|
1785
|
+
throw new Skyvern.ConflictError(_response.error.body, _response.rawResponse);
|
|
1714
1786
|
case 422:
|
|
1715
1787
|
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
1716
1788
|
default:
|
|
@@ -1729,7 +1801,7 @@ class SkyvernClient {
|
|
|
1729
1801
|
rawResponse: _response.rawResponse,
|
|
1730
1802
|
});
|
|
1731
1803
|
case "timeout":
|
|
1732
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling
|
|
1804
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling PATCH /v1/tag-values/{key}/rename.");
|
|
1733
1805
|
case "unknown":
|
|
1734
1806
|
throw new errors.SkyvernError({
|
|
1735
1807
|
message: _response.error.errorMessage,
|
|
@@ -1739,34 +1811,36 @@ class SkyvernClient {
|
|
|
1739
1811
|
});
|
|
1740
1812
|
}
|
|
1741
1813
|
/**
|
|
1742
|
-
*
|
|
1814
|
+
* Batch fetch current tags for many workflows. Avoids N+1 on the workflows-list page.
|
|
1743
1815
|
*
|
|
1744
|
-
* @param {Skyvern.
|
|
1816
|
+
* @param {Skyvern.BatchGetWorkflowTagsRequest} request
|
|
1745
1817
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1746
1818
|
*
|
|
1819
|
+
* @throws {@link Skyvern.BadRequestError}
|
|
1747
1820
|
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
1748
1821
|
*
|
|
1749
1822
|
* @example
|
|
1750
|
-
* await client.
|
|
1751
|
-
*
|
|
1752
|
-
* content: "Hello, your verification code is 123456"
|
|
1823
|
+
* await client.batchGetWorkflowTags({
|
|
1824
|
+
* workflow_permanent_ids: "workflow_permanent_ids"
|
|
1753
1825
|
* })
|
|
1754
1826
|
*/
|
|
1755
|
-
|
|
1756
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
1827
|
+
batchGetWorkflowTags(request = {}, requestOptions) {
|
|
1828
|
+
return core.HttpResponsePromise.fromPromise(this.__batchGetWorkflowTags(request, requestOptions));
|
|
1757
1829
|
}
|
|
1758
|
-
|
|
1759
|
-
return __awaiter(this,
|
|
1830
|
+
__batchGetWorkflowTags() {
|
|
1831
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
1760
1832
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
1833
|
+
const { workflow_permanent_ids: workflowPermanentIds } = request;
|
|
1834
|
+
const _queryParams = {};
|
|
1835
|
+
if (workflowPermanentIds != null) {
|
|
1836
|
+
_queryParams.workflow_permanent_ids = workflowPermanentIds;
|
|
1837
|
+
}
|
|
1761
1838
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1762
1839
|
const _response = yield core.fetcher({
|
|
1763
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "v1/
|
|
1764
|
-
method: "
|
|
1840
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "v1/workflow-tags"),
|
|
1841
|
+
method: "GET",
|
|
1765
1842
|
headers: _headers,
|
|
1766
|
-
|
|
1767
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
1768
|
-
requestType: "json",
|
|
1769
|
-
body: request,
|
|
1843
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
1770
1844
|
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
1771
1845
|
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
1772
1846
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -1776,6 +1850,8 @@ class SkyvernClient {
|
|
|
1776
1850
|
}
|
|
1777
1851
|
if (_response.error.reason === "status-code") {
|
|
1778
1852
|
switch (_response.error.statusCode) {
|
|
1853
|
+
case 400:
|
|
1854
|
+
throw new Skyvern.BadRequestError(_response.error.body, _response.rawResponse);
|
|
1779
1855
|
case 422:
|
|
1780
1856
|
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
1781
1857
|
default:
|
|
@@ -1794,7 +1870,7 @@ class SkyvernClient {
|
|
|
1794
1870
|
rawResponse: _response.rawResponse,
|
|
1795
1871
|
});
|
|
1796
1872
|
case "timeout":
|
|
1797
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling
|
|
1873
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/workflow-tags.");
|
|
1798
1874
|
case "unknown":
|
|
1799
1875
|
throw new errors.SkyvernError({
|
|
1800
1876
|
message: _response.error.errorMessage,
|
|
@@ -1804,39 +1880,32 @@ class SkyvernClient {
|
|
|
1804
1880
|
});
|
|
1805
1881
|
}
|
|
1806
1882
|
/**
|
|
1807
|
-
*
|
|
1883
|
+
* Batch fetch current tags for many workflows (POST variant for id lists exceeding URL length).
|
|
1808
1884
|
*
|
|
1809
|
-
* @param {Skyvern.
|
|
1885
|
+
* @param {Skyvern.WorkflowTagsBatchRequest} request
|
|
1810
1886
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1811
1887
|
*
|
|
1888
|
+
* @throws {@link Skyvern.BadRequestError}
|
|
1812
1889
|
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
1813
1890
|
*
|
|
1814
1891
|
* @example
|
|
1815
|
-
* await client.
|
|
1816
|
-
* page: 1,
|
|
1817
|
-
* page_size: 10
|
|
1818
|
-
* })
|
|
1892
|
+
* await client.batchGetWorkflowTagsPost()
|
|
1819
1893
|
*/
|
|
1820
|
-
|
|
1821
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
1894
|
+
batchGetWorkflowTagsPost(request = {}, requestOptions) {
|
|
1895
|
+
return core.HttpResponsePromise.fromPromise(this.__batchGetWorkflowTagsPost(request, requestOptions));
|
|
1822
1896
|
}
|
|
1823
|
-
|
|
1897
|
+
__batchGetWorkflowTagsPost() {
|
|
1824
1898
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
1825
1899
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
1826
|
-
const { page, page_size: pageSize } = request;
|
|
1827
|
-
const _queryParams = {};
|
|
1828
|
-
if (page != null) {
|
|
1829
|
-
_queryParams.page = page.toString();
|
|
1830
|
-
}
|
|
1831
|
-
if (pageSize != null) {
|
|
1832
|
-
_queryParams.page_size = pageSize.toString();
|
|
1833
|
-
}
|
|
1834
1900
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1835
1901
|
const _response = yield core.fetcher({
|
|
1836
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "v1/
|
|
1837
|
-
method: "
|
|
1902
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "v1/workflow-tags"),
|
|
1903
|
+
method: "POST",
|
|
1838
1904
|
headers: _headers,
|
|
1839
|
-
|
|
1905
|
+
contentType: "application/json",
|
|
1906
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
1907
|
+
requestType: "json",
|
|
1908
|
+
body: request,
|
|
1840
1909
|
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
1841
1910
|
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
1842
1911
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -1846,6 +1915,8 @@ class SkyvernClient {
|
|
|
1846
1915
|
}
|
|
1847
1916
|
if (_response.error.reason === "status-code") {
|
|
1848
1917
|
switch (_response.error.statusCode) {
|
|
1918
|
+
case 400:
|
|
1919
|
+
throw new Skyvern.BadRequestError(_response.error.body, _response.rawResponse);
|
|
1849
1920
|
case 422:
|
|
1850
1921
|
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
1851
1922
|
default:
|
|
@@ -1864,7 +1935,7 @@ class SkyvernClient {
|
|
|
1864
1935
|
rawResponse: _response.rawResponse,
|
|
1865
1936
|
});
|
|
1866
1937
|
case "timeout":
|
|
1867
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling
|
|
1938
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /v1/workflow-tags.");
|
|
1868
1939
|
case "unknown":
|
|
1869
1940
|
throw new errors.SkyvernError({
|
|
1870
1941
|
message: _response.error.errorMessage,
|
|
@@ -1874,39 +1945,36 @@ class SkyvernClient {
|
|
|
1874
1945
|
});
|
|
1875
1946
|
}
|
|
1876
1947
|
/**
|
|
1877
|
-
*
|
|
1948
|
+
* Batch fetch current tags for many workflow runs. Avoids N+1 on run-list pages.
|
|
1878
1949
|
*
|
|
1879
|
-
* @param {Skyvern.
|
|
1950
|
+
* @param {Skyvern.BatchGetRunTagsRequest} request
|
|
1880
1951
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1881
1952
|
*
|
|
1953
|
+
* @throws {@link Skyvern.BadRequestError}
|
|
1882
1954
|
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
1883
1955
|
*
|
|
1884
1956
|
* @example
|
|
1885
|
-
* await client.
|
|
1886
|
-
*
|
|
1887
|
-
* credential_type: "password",
|
|
1888
|
-
* credential: {
|
|
1889
|
-
* password: "securepassword123",
|
|
1890
|
-
* username: "user@example.com",
|
|
1891
|
-
* totp: "JBSWY3DPEHPK3PXP"
|
|
1892
|
-
* }
|
|
1957
|
+
* await client.batchGetRunTags({
|
|
1958
|
+
* workflow_run_ids: "workflow_run_ids"
|
|
1893
1959
|
* })
|
|
1894
1960
|
*/
|
|
1895
|
-
|
|
1896
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
1961
|
+
batchGetRunTags(request = {}, requestOptions) {
|
|
1962
|
+
return core.HttpResponsePromise.fromPromise(this.__batchGetRunTags(request, requestOptions));
|
|
1897
1963
|
}
|
|
1898
|
-
|
|
1899
|
-
return __awaiter(this,
|
|
1964
|
+
__batchGetRunTags() {
|
|
1965
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
1900
1966
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
1967
|
+
const { workflow_run_ids: workflowRunIds } = request;
|
|
1968
|
+
const _queryParams = {};
|
|
1969
|
+
if (workflowRunIds != null) {
|
|
1970
|
+
_queryParams.workflow_run_ids = workflowRunIds;
|
|
1971
|
+
}
|
|
1901
1972
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1902
1973
|
const _response = yield core.fetcher({
|
|
1903
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "v1/
|
|
1904
|
-
method: "
|
|
1974
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "v1/run-tags"),
|
|
1975
|
+
method: "GET",
|
|
1905
1976
|
headers: _headers,
|
|
1906
|
-
|
|
1907
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
1908
|
-
requestType: "json",
|
|
1909
|
-
body: request,
|
|
1977
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
1910
1978
|
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
1911
1979
|
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
1912
1980
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -1916,6 +1984,8 @@ class SkyvernClient {
|
|
|
1916
1984
|
}
|
|
1917
1985
|
if (_response.error.reason === "status-code") {
|
|
1918
1986
|
switch (_response.error.statusCode) {
|
|
1987
|
+
case 400:
|
|
1988
|
+
throw new Skyvern.BadRequestError(_response.error.body, _response.rawResponse);
|
|
1919
1989
|
case 422:
|
|
1920
1990
|
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
1921
1991
|
default:
|
|
@@ -1934,7 +2004,7 @@ class SkyvernClient {
|
|
|
1934
2004
|
rawResponse: _response.rawResponse,
|
|
1935
2005
|
});
|
|
1936
2006
|
case "timeout":
|
|
1937
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling
|
|
2007
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/run-tags.");
|
|
1938
2008
|
case "unknown":
|
|
1939
2009
|
throw new errors.SkyvernError({
|
|
1940
2010
|
message: _response.error.errorMessage,
|
|
@@ -1944,33 +2014,26 @@ class SkyvernClient {
|
|
|
1944
2014
|
});
|
|
1945
2015
|
}
|
|
1946
2016
|
/**
|
|
1947
|
-
*
|
|
2017
|
+
* Batch fetch current tags for many workflow runs (POST variant for id lists exceeding URL length).
|
|
1948
2018
|
*
|
|
1949
|
-
* @param {
|
|
1950
|
-
* @param {Skyvern.CreateCredentialRequest} request
|
|
2019
|
+
* @param {Skyvern.RunTagsBatchRequest} request
|
|
1951
2020
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1952
2021
|
*
|
|
2022
|
+
* @throws {@link Skyvern.BadRequestError}
|
|
1953
2023
|
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
1954
2024
|
*
|
|
1955
2025
|
* @example
|
|
1956
|
-
* await client.
|
|
1957
|
-
* name: "My Credential",
|
|
1958
|
-
* credential_type: "password",
|
|
1959
|
-
* credential: {
|
|
1960
|
-
* password: "newpassword123",
|
|
1961
|
-
* username: "user@example.com"
|
|
1962
|
-
* }
|
|
1963
|
-
* })
|
|
2026
|
+
* await client.batchGetRunTagsPost()
|
|
1964
2027
|
*/
|
|
1965
|
-
|
|
1966
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
2028
|
+
batchGetRunTagsPost(request = {}, requestOptions) {
|
|
2029
|
+
return core.HttpResponsePromise.fromPromise(this.__batchGetRunTagsPost(request, requestOptions));
|
|
1967
2030
|
}
|
|
1968
|
-
|
|
1969
|
-
return __awaiter(this,
|
|
2031
|
+
__batchGetRunTagsPost() {
|
|
2032
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
1970
2033
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
1971
2034
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1972
2035
|
const _response = yield core.fetcher({
|
|
1973
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud,
|
|
2036
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "v1/run-tags"),
|
|
1974
2037
|
method: "POST",
|
|
1975
2038
|
headers: _headers,
|
|
1976
2039
|
contentType: "application/json",
|
|
@@ -1986,6 +2049,8 @@ class SkyvernClient {
|
|
|
1986
2049
|
}
|
|
1987
2050
|
if (_response.error.reason === "status-code") {
|
|
1988
2051
|
switch (_response.error.statusCode) {
|
|
2052
|
+
case 400:
|
|
2053
|
+
throw new Skyvern.BadRequestError(_response.error.body, _response.rawResponse);
|
|
1989
2054
|
case 422:
|
|
1990
2055
|
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
1991
2056
|
default:
|
|
@@ -2004,7 +2069,7 @@ class SkyvernClient {
|
|
|
2004
2069
|
rawResponse: _response.rawResponse,
|
|
2005
2070
|
});
|
|
2006
2071
|
case "timeout":
|
|
2007
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /v1/
|
|
2072
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /v1/run-tags.");
|
|
2008
2073
|
case "unknown":
|
|
2009
2074
|
throw new errors.SkyvernError({
|
|
2010
2075
|
message: _response.error.errorMessage,
|
|
@@ -2014,34 +2079,45 @@ class SkyvernClient {
|
|
|
2014
2079
|
});
|
|
2015
2080
|
}
|
|
2016
2081
|
/**
|
|
2017
|
-
*
|
|
2082
|
+
* Get artifacts for a run
|
|
2018
2083
|
*
|
|
2019
|
-
* @param {string}
|
|
2084
|
+
* @param {string} runId - The id of the task run or the workflow run.
|
|
2085
|
+
* @param {Skyvern.GetRunArtifactsRequest} request
|
|
2020
2086
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
2021
2087
|
*
|
|
2022
2088
|
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
2023
2089
|
*
|
|
2024
2090
|
* @example
|
|
2025
|
-
* await client.
|
|
2091
|
+
* await client.getRunArtifacts("run_id")
|
|
2026
2092
|
*/
|
|
2027
|
-
|
|
2028
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
2093
|
+
getRunArtifacts(runId, request = {}, requestOptions) {
|
|
2094
|
+
return core.HttpResponsePromise.fromPromise(this.__getRunArtifacts(runId, request, requestOptions));
|
|
2029
2095
|
}
|
|
2030
|
-
|
|
2031
|
-
return __awaiter(this,
|
|
2096
|
+
__getRunArtifacts(runId_1) {
|
|
2097
|
+
return __awaiter(this, arguments, void 0, function* (runId, request = {}, requestOptions) {
|
|
2032
2098
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
2099
|
+
const { artifact_type: artifactType } = request;
|
|
2100
|
+
const _queryParams = {};
|
|
2101
|
+
if (artifactType != null) {
|
|
2102
|
+
if (Array.isArray(artifactType)) {
|
|
2103
|
+
_queryParams.artifact_type = artifactType.map((item) => item);
|
|
2104
|
+
}
|
|
2105
|
+
else {
|
|
2106
|
+
_queryParams.artifact_type = artifactType;
|
|
2107
|
+
}
|
|
2108
|
+
}
|
|
2033
2109
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
2034
2110
|
const _response = yield core.fetcher({
|
|
2035
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/
|
|
2036
|
-
method: "
|
|
2111
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/runs/${core.url.encodePathParam(runId)}/artifacts`),
|
|
2112
|
+
method: "GET",
|
|
2037
2113
|
headers: _headers,
|
|
2038
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
2114
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
2039
2115
|
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
2040
2116
|
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
2041
2117
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2042
2118
|
});
|
|
2043
2119
|
if (_response.ok) {
|
|
2044
|
-
return { data:
|
|
2120
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
2045
2121
|
}
|
|
2046
2122
|
if (_response.error.reason === "status-code") {
|
|
2047
2123
|
switch (_response.error.statusCode) {
|
|
@@ -2063,7 +2139,7 @@ class SkyvernClient {
|
|
|
2063
2139
|
rawResponse: _response.rawResponse,
|
|
2064
2140
|
});
|
|
2065
2141
|
case "timeout":
|
|
2066
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling
|
|
2142
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/runs/{run_id}/artifacts.");
|
|
2067
2143
|
case "unknown":
|
|
2068
2144
|
throw new errors.SkyvernError({
|
|
2069
2145
|
message: _response.error.errorMessage,
|
|
@@ -2073,28 +2149,32 @@ class SkyvernClient {
|
|
|
2073
2149
|
});
|
|
2074
2150
|
}
|
|
2075
2151
|
/**
|
|
2076
|
-
*
|
|
2152
|
+
* Retry sending the webhook for a run
|
|
2077
2153
|
*
|
|
2078
|
-
* @param {string}
|
|
2154
|
+
* @param {string} runId - The id of the task run or the workflow run.
|
|
2155
|
+
* @param {Skyvern.RetryRunWebhookRequest} request
|
|
2079
2156
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
2080
2157
|
*
|
|
2081
2158
|
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
2082
2159
|
*
|
|
2083
2160
|
* @example
|
|
2084
|
-
* await client.
|
|
2161
|
+
* await client.retryRunWebhook("tsk_123")
|
|
2085
2162
|
*/
|
|
2086
|
-
|
|
2087
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
2163
|
+
retryRunWebhook(runId, request, requestOptions) {
|
|
2164
|
+
return core.HttpResponsePromise.fromPromise(this.__retryRunWebhook(runId, request, requestOptions));
|
|
2088
2165
|
}
|
|
2089
|
-
|
|
2166
|
+
__retryRunWebhook(runId, request, requestOptions) {
|
|
2090
2167
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2091
2168
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
2092
2169
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
2093
2170
|
const _response = yield core.fetcher({
|
|
2094
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/
|
|
2095
|
-
method: "
|
|
2171
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/runs/${core.url.encodePathParam(runId)}/retry_webhook`),
|
|
2172
|
+
method: "POST",
|
|
2096
2173
|
headers: _headers,
|
|
2174
|
+
contentType: "application/json",
|
|
2097
2175
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
2176
|
+
requestType: "json",
|
|
2177
|
+
body: request != null ? request : undefined,
|
|
2098
2178
|
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
2099
2179
|
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
2100
2180
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -2122,7 +2202,7 @@ class SkyvernClient {
|
|
|
2122
2202
|
rawResponse: _response.rawResponse,
|
|
2123
2203
|
});
|
|
2124
2204
|
case "timeout":
|
|
2125
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling
|
|
2205
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /v1/runs/{run_id}/retry_webhook.");
|
|
2126
2206
|
case "unknown":
|
|
2127
2207
|
throw new errors.SkyvernError({
|
|
2128
2208
|
message: _response.error.errorMessage,
|
|
@@ -2132,33 +2212,30 @@ class SkyvernClient {
|
|
|
2132
2212
|
});
|
|
2133
2213
|
}
|
|
2134
2214
|
/**
|
|
2135
|
-
*
|
|
2215
|
+
* Get timeline for a run (workflow run or task_v2 run)
|
|
2136
2216
|
*
|
|
2137
|
-
* @param {
|
|
2217
|
+
* @param {string} runId - The id of the workflow run or task_v2 run.
|
|
2138
2218
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
2139
2219
|
*
|
|
2220
|
+
* @throws {@link Skyvern.BadRequestError}
|
|
2221
|
+
* @throws {@link Skyvern.NotFoundError}
|
|
2140
2222
|
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
2141
2223
|
*
|
|
2142
2224
|
* @example
|
|
2143
|
-
* await client.
|
|
2144
|
-
* credential_type: "skyvern"
|
|
2145
|
-
* })
|
|
2225
|
+
* await client.getRunTimeline("wr_123")
|
|
2146
2226
|
*/
|
|
2147
|
-
|
|
2148
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
2227
|
+
getRunTimeline(runId, requestOptions) {
|
|
2228
|
+
return core.HttpResponsePromise.fromPromise(this.__getRunTimeline(runId, requestOptions));
|
|
2149
2229
|
}
|
|
2150
|
-
|
|
2230
|
+
__getRunTimeline(runId, requestOptions) {
|
|
2151
2231
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2152
2232
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
2153
2233
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
2154
2234
|
const _response = yield core.fetcher({
|
|
2155
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud,
|
|
2156
|
-
method: "
|
|
2235
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/runs/${core.url.encodePathParam(runId)}/timeline`),
|
|
2236
|
+
method: "GET",
|
|
2157
2237
|
headers: _headers,
|
|
2158
|
-
contentType: "application/json",
|
|
2159
2238
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
2160
|
-
requestType: "json",
|
|
2161
|
-
body: request,
|
|
2162
2239
|
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
2163
2240
|
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
2164
2241
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -2168,6 +2245,10 @@ class SkyvernClient {
|
|
|
2168
2245
|
}
|
|
2169
2246
|
if (_response.error.reason === "status-code") {
|
|
2170
2247
|
switch (_response.error.statusCode) {
|
|
2248
|
+
case 400:
|
|
2249
|
+
throw new Skyvern.BadRequestError(_response.error.body, _response.rawResponse);
|
|
2250
|
+
case 404:
|
|
2251
|
+
throw new Skyvern.NotFoundError(_response.error.body, _response.rawResponse);
|
|
2171
2252
|
case 422:
|
|
2172
2253
|
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
2173
2254
|
default:
|
|
@@ -2186,7 +2267,7 @@ class SkyvernClient {
|
|
|
2186
2267
|
rawResponse: _response.rawResponse,
|
|
2187
2268
|
});
|
|
2188
2269
|
case "timeout":
|
|
2189
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling
|
|
2270
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/runs/{run_id}/timeline.");
|
|
2190
2271
|
case "unknown":
|
|
2191
2272
|
throw new errors.SkyvernError({
|
|
2192
2273
|
message: _response.error.errorMessage,
|
|
@@ -2196,33 +2277,25 @@ class SkyvernClient {
|
|
|
2196
2277
|
});
|
|
2197
2278
|
}
|
|
2198
2279
|
/**
|
|
2199
|
-
*
|
|
2280
|
+
* Returns the current Skyvern server version (git SHA for official builds).
|
|
2200
2281
|
*
|
|
2201
|
-
* @param {Skyvern.DownloadFilesRequest} request
|
|
2202
2282
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
2203
2283
|
*
|
|
2204
|
-
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
2205
|
-
*
|
|
2206
2284
|
* @example
|
|
2207
|
-
* await client.
|
|
2208
|
-
* navigation_goal: "navigation_goal"
|
|
2209
|
-
* })
|
|
2285
|
+
* await client.getVersion()
|
|
2210
2286
|
*/
|
|
2211
|
-
|
|
2212
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
2287
|
+
getVersion(requestOptions) {
|
|
2288
|
+
return core.HttpResponsePromise.fromPromise(this.__getVersion(requestOptions));
|
|
2213
2289
|
}
|
|
2214
|
-
|
|
2290
|
+
__getVersion(requestOptions) {
|
|
2215
2291
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2216
2292
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
2217
2293
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
2218
2294
|
const _response = yield core.fetcher({
|
|
2219
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "v1/
|
|
2220
|
-
method: "
|
|
2295
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "v1/version"),
|
|
2296
|
+
method: "GET",
|
|
2221
2297
|
headers: _headers,
|
|
2222
|
-
contentType: "application/json",
|
|
2223
2298
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
2224
|
-
requestType: "json",
|
|
2225
|
-
body: request,
|
|
2226
2299
|
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
2227
2300
|
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
2228
2301
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -2231,16 +2304,11 @@ class SkyvernClient {
|
|
|
2231
2304
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
2232
2305
|
}
|
|
2233
2306
|
if (_response.error.reason === "status-code") {
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
statusCode: _response.error.statusCode,
|
|
2240
|
-
body: _response.error.body,
|
|
2241
|
-
rawResponse: _response.rawResponse,
|
|
2242
|
-
});
|
|
2243
|
-
}
|
|
2307
|
+
throw new errors.SkyvernError({
|
|
2308
|
+
statusCode: _response.error.statusCode,
|
|
2309
|
+
body: _response.error.body,
|
|
2310
|
+
rawResponse: _response.rawResponse,
|
|
2311
|
+
});
|
|
2244
2312
|
}
|
|
2245
2313
|
switch (_response.error.reason) {
|
|
2246
2314
|
case "non-json":
|
|
@@ -2250,7 +2318,7 @@ class SkyvernClient {
|
|
|
2250
2318
|
rawResponse: _response.rawResponse,
|
|
2251
2319
|
});
|
|
2252
2320
|
case "timeout":
|
|
2253
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling
|
|
2321
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/version.");
|
|
2254
2322
|
case "unknown":
|
|
2255
2323
|
throw new errors.SkyvernError({
|
|
2256
2324
|
message: _response.error.errorMessage,
|
|
@@ -2260,26 +2328,25 @@ class SkyvernClient {
|
|
|
2260
2328
|
});
|
|
2261
2329
|
}
|
|
2262
2330
|
/**
|
|
2263
|
-
*
|
|
2264
|
-
*
|
|
2265
|
-
* @param {Skyvern.GetScriptsRequest} request
|
|
2331
|
+
* @param {Skyvern.GetRunsV2Request} request
|
|
2266
2332
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
2267
2333
|
*
|
|
2268
2334
|
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
2269
2335
|
*
|
|
2270
2336
|
* @example
|
|
2271
|
-
* await client.
|
|
2337
|
+
* await client.getRunsV2({
|
|
2272
2338
|
* page: 1,
|
|
2273
|
-
* page_size:
|
|
2339
|
+
* page_size: 1,
|
|
2340
|
+
* search_key: "search_key"
|
|
2274
2341
|
* })
|
|
2275
2342
|
*/
|
|
2276
|
-
|
|
2277
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
2343
|
+
getRunsV2(request = {}, requestOptions) {
|
|
2344
|
+
return core.HttpResponsePromise.fromPromise(this.__getRunsV2(request, requestOptions));
|
|
2278
2345
|
}
|
|
2279
|
-
|
|
2346
|
+
__getRunsV2() {
|
|
2280
2347
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
2281
2348
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
2282
|
-
const { page, page_size: pageSize } = request;
|
|
2349
|
+
const { page, page_size: pageSize, status, search_key: searchKey, run_type: runType } = request;
|
|
2283
2350
|
const _queryParams = {};
|
|
2284
2351
|
if (page != null) {
|
|
2285
2352
|
_queryParams.page = page.toString();
|
|
@@ -2287,9 +2354,28 @@ class SkyvernClient {
|
|
|
2287
2354
|
if (pageSize != null) {
|
|
2288
2355
|
_queryParams.page_size = pageSize.toString();
|
|
2289
2356
|
}
|
|
2357
|
+
if (status != null) {
|
|
2358
|
+
if (Array.isArray(status)) {
|
|
2359
|
+
_queryParams.status = status.map((item) => item);
|
|
2360
|
+
}
|
|
2361
|
+
else {
|
|
2362
|
+
_queryParams.status = status;
|
|
2363
|
+
}
|
|
2364
|
+
}
|
|
2365
|
+
if (searchKey != null) {
|
|
2366
|
+
_queryParams.search_key = searchKey;
|
|
2367
|
+
}
|
|
2368
|
+
if (runType != null) {
|
|
2369
|
+
if (Array.isArray(runType)) {
|
|
2370
|
+
_queryParams.run_type = runType.map((item) => item);
|
|
2371
|
+
}
|
|
2372
|
+
else {
|
|
2373
|
+
_queryParams.run_type = runType;
|
|
2374
|
+
}
|
|
2375
|
+
}
|
|
2290
2376
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
2291
2377
|
const _response = yield core.fetcher({
|
|
2292
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "v1/
|
|
2378
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "v1/runs"),
|
|
2293
2379
|
method: "GET",
|
|
2294
2380
|
headers: _headers,
|
|
2295
2381
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -2320,7 +2406,7 @@ class SkyvernClient {
|
|
|
2320
2406
|
rawResponse: _response.rawResponse,
|
|
2321
2407
|
});
|
|
2322
2408
|
case "timeout":
|
|
2323
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/
|
|
2409
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/runs.");
|
|
2324
2410
|
case "unknown":
|
|
2325
2411
|
throw new errors.SkyvernError({
|
|
2326
2412
|
message: _response.error.errorMessage,
|
|
@@ -2330,31 +2416,35 @@ class SkyvernClient {
|
|
|
2330
2416
|
});
|
|
2331
2417
|
}
|
|
2332
2418
|
/**
|
|
2333
|
-
*
|
|
2334
|
-
*
|
|
2335
|
-
* @param {Skyvern.CreateScriptRequest} request
|
|
2419
|
+
* @param {Skyvern.BodyUploadFileV1UploadFilePost} request
|
|
2336
2420
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
2337
2421
|
*
|
|
2338
2422
|
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
2339
2423
|
*
|
|
2340
2424
|
* @example
|
|
2341
|
-
*
|
|
2425
|
+
* import { createReadStream } from "fs";
|
|
2426
|
+
* await client.uploadFile({
|
|
2427
|
+
* file: "file"
|
|
2428
|
+
* })
|
|
2342
2429
|
*/
|
|
2343
|
-
|
|
2344
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
2430
|
+
uploadFile(request, requestOptions) {
|
|
2431
|
+
return core.HttpResponsePromise.fromPromise(this.__uploadFile(request, requestOptions));
|
|
2345
2432
|
}
|
|
2346
|
-
|
|
2347
|
-
return __awaiter(this,
|
|
2433
|
+
__uploadFile(request, requestOptions) {
|
|
2434
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2348
2435
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
2349
|
-
const
|
|
2436
|
+
const _request = yield core.newFormData();
|
|
2437
|
+
_request.append("file", request.file);
|
|
2438
|
+
const _maybeEncodedRequest = yield _request.getRequest();
|
|
2439
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
2350
2440
|
const _response = yield core.fetcher({
|
|
2351
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "v1/
|
|
2441
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "v1/upload_file"),
|
|
2352
2442
|
method: "POST",
|
|
2353
2443
|
headers: _headers,
|
|
2354
|
-
contentType: "application/json",
|
|
2355
2444
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
2356
|
-
requestType: "
|
|
2357
|
-
|
|
2445
|
+
requestType: "file",
|
|
2446
|
+
duplex: _maybeEncodedRequest.duplex,
|
|
2447
|
+
body: _maybeEncodedRequest.body,
|
|
2358
2448
|
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
2359
2449
|
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
2360
2450
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -2382,7 +2472,7 @@ class SkyvernClient {
|
|
|
2382
2472
|
rawResponse: _response.rawResponse,
|
|
2383
2473
|
});
|
|
2384
2474
|
case "timeout":
|
|
2385
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /v1/
|
|
2475
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /v1/upload_file.");
|
|
2386
2476
|
case "unknown":
|
|
2387
2477
|
throw new errors.SkyvernError({
|
|
2388
2478
|
message: _response.error.errorMessage,
|
|
@@ -2392,30 +2482,53 @@ class SkyvernClient {
|
|
|
2392
2482
|
});
|
|
2393
2483
|
}
|
|
2394
2484
|
/**
|
|
2395
|
-
*
|
|
2485
|
+
* Get all browser profiles for the organization
|
|
2396
2486
|
*
|
|
2397
|
-
* @param {
|
|
2487
|
+
* @param {Skyvern.ListBrowserProfilesRequest} request
|
|
2398
2488
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
2399
2489
|
*
|
|
2400
2490
|
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
2401
2491
|
*
|
|
2402
2492
|
* @example
|
|
2403
|
-
* await client.
|
|
2493
|
+
* await client.listBrowserProfiles({
|
|
2494
|
+
* page: 1,
|
|
2495
|
+
* page_size: 1,
|
|
2496
|
+
* include_deleted: true,
|
|
2497
|
+
* search_key: "search_key",
|
|
2498
|
+
* managed: true
|
|
2499
|
+
* })
|
|
2404
2500
|
*/
|
|
2405
|
-
|
|
2406
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
2501
|
+
listBrowserProfiles(request = {}, requestOptions) {
|
|
2502
|
+
return core.HttpResponsePromise.fromPromise(this.__listBrowserProfiles(request, requestOptions));
|
|
2407
2503
|
}
|
|
2408
|
-
|
|
2409
|
-
return __awaiter(this,
|
|
2504
|
+
__listBrowserProfiles() {
|
|
2505
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
2410
2506
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
2411
|
-
const
|
|
2412
|
-
const
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2507
|
+
const { page, page_size: pageSize, include_deleted: includeDeleted, search_key: searchKey, managed } = request;
|
|
2508
|
+
const _queryParams = {};
|
|
2509
|
+
if (page != null) {
|
|
2510
|
+
_queryParams.page = page.toString();
|
|
2511
|
+
}
|
|
2512
|
+
if (pageSize != null) {
|
|
2513
|
+
_queryParams.page_size = pageSize.toString();
|
|
2514
|
+
}
|
|
2515
|
+
if (includeDeleted != null) {
|
|
2516
|
+
_queryParams.include_deleted = includeDeleted.toString();
|
|
2517
|
+
}
|
|
2518
|
+
if (searchKey != null) {
|
|
2519
|
+
_queryParams.search_key = searchKey;
|
|
2520
|
+
}
|
|
2521
|
+
if (managed != null) {
|
|
2522
|
+
_queryParams.managed = managed.toString();
|
|
2523
|
+
}
|
|
2524
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
2525
|
+
const _response = yield core.fetcher({
|
|
2526
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "v1/browser_profiles"),
|
|
2527
|
+
method: "GET",
|
|
2528
|
+
headers: _headers,
|
|
2529
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
2530
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
2531
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
2419
2532
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2420
2533
|
});
|
|
2421
2534
|
if (_response.ok) {
|
|
@@ -2441,7 +2554,7 @@ class SkyvernClient {
|
|
|
2441
2554
|
rawResponse: _response.rawResponse,
|
|
2442
2555
|
});
|
|
2443
2556
|
case "timeout":
|
|
2444
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/
|
|
2557
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/browser_profiles.");
|
|
2445
2558
|
case "unknown":
|
|
2446
2559
|
throw new errors.SkyvernError({
|
|
2447
2560
|
message: _response.error.errorMessage,
|
|
@@ -2451,31 +2564,29 @@ class SkyvernClient {
|
|
|
2451
2564
|
});
|
|
2452
2565
|
}
|
|
2453
2566
|
/**
|
|
2454
|
-
*
|
|
2567
|
+
* Create a blank browser profile, or create one from a persistent browser session or workflow run.
|
|
2455
2568
|
*
|
|
2456
|
-
* @param {
|
|
2457
|
-
* @param {Skyvern.DeployScriptRequest} request
|
|
2569
|
+
* @param {Skyvern.CreateBrowserProfileRequest} request
|
|
2458
2570
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
2459
2571
|
*
|
|
2572
|
+
* @throws {@link Skyvern.BadRequestError}
|
|
2573
|
+
* @throws {@link Skyvern.ConflictError}
|
|
2460
2574
|
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
2461
2575
|
*
|
|
2462
2576
|
* @example
|
|
2463
|
-
* await client.
|
|
2464
|
-
*
|
|
2465
|
-
* path: "src/main.py",
|
|
2466
|
-
* content: "content"
|
|
2467
|
-
* }]
|
|
2577
|
+
* await client.createBrowserProfile({
|
|
2578
|
+
* name: "name"
|
|
2468
2579
|
* })
|
|
2469
2580
|
*/
|
|
2470
|
-
|
|
2471
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
2581
|
+
createBrowserProfile(request, requestOptions) {
|
|
2582
|
+
return core.HttpResponsePromise.fromPromise(this.__createBrowserProfile(request, requestOptions));
|
|
2472
2583
|
}
|
|
2473
|
-
|
|
2584
|
+
__createBrowserProfile(request, requestOptions) {
|
|
2474
2585
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2475
2586
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
2476
2587
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
2477
2588
|
const _response = yield core.fetcher({
|
|
2478
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud,
|
|
2589
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "v1/browser_profiles"),
|
|
2479
2590
|
method: "POST",
|
|
2480
2591
|
headers: _headers,
|
|
2481
2592
|
contentType: "application/json",
|
|
@@ -2491,6 +2602,10 @@ class SkyvernClient {
|
|
|
2491
2602
|
}
|
|
2492
2603
|
if (_response.error.reason === "status-code") {
|
|
2493
2604
|
switch (_response.error.statusCode) {
|
|
2605
|
+
case 400:
|
|
2606
|
+
throw new Skyvern.BadRequestError(_response.error.body, _response.rawResponse);
|
|
2607
|
+
case 409:
|
|
2608
|
+
throw new Skyvern.ConflictError(_response.error.body, _response.rawResponse);
|
|
2494
2609
|
case 422:
|
|
2495
2610
|
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
2496
2611
|
default:
|
|
@@ -2509,7 +2624,7 @@ class SkyvernClient {
|
|
|
2509
2624
|
rawResponse: _response.rawResponse,
|
|
2510
2625
|
});
|
|
2511
2626
|
case "timeout":
|
|
2512
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /v1/
|
|
2627
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /v1/browser_profiles.");
|
|
2513
2628
|
case "unknown":
|
|
2514
2629
|
throw new errors.SkyvernError({
|
|
2515
2630
|
message: _response.error.errorMessage,
|
|
@@ -2519,36 +2634,29 @@ class SkyvernClient {
|
|
|
2519
2634
|
});
|
|
2520
2635
|
}
|
|
2521
2636
|
/**
|
|
2522
|
-
*
|
|
2637
|
+
* Get a specific browser profile by ID
|
|
2523
2638
|
*
|
|
2524
|
-
* @param {
|
|
2639
|
+
* @param {string} profileId - The ID of the browser profile. browser_profile_id starts with `bp_`
|
|
2525
2640
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
2526
2641
|
*
|
|
2642
|
+
* @throws {@link Skyvern.NotFoundError}
|
|
2527
2643
|
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
2528
2644
|
*
|
|
2529
2645
|
* @example
|
|
2530
|
-
* await client.
|
|
2531
|
-
* url: "url",
|
|
2532
|
-
* action: {
|
|
2533
|
-
* type: "ai_act"
|
|
2534
|
-
* }
|
|
2535
|
-
* })
|
|
2646
|
+
* await client.getBrowserProfile("bp_123456")
|
|
2536
2647
|
*/
|
|
2537
|
-
|
|
2538
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
2648
|
+
getBrowserProfile(profileId, requestOptions) {
|
|
2649
|
+
return core.HttpResponsePromise.fromPromise(this.__getBrowserProfile(profileId, requestOptions));
|
|
2539
2650
|
}
|
|
2540
|
-
|
|
2651
|
+
__getBrowserProfile(profileId, requestOptions) {
|
|
2541
2652
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2542
2653
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
2543
2654
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
2544
2655
|
const _response = yield core.fetcher({
|
|
2545
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud,
|
|
2546
|
-
method: "
|
|
2656
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/browser_profiles/${core.url.encodePathParam(profileId)}`),
|
|
2657
|
+
method: "GET",
|
|
2547
2658
|
headers: _headers,
|
|
2548
|
-
contentType: "application/json",
|
|
2549
2659
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
2550
|
-
requestType: "json",
|
|
2551
|
-
body: request,
|
|
2552
2660
|
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
2553
2661
|
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
2554
2662
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -2558,6 +2666,8 @@ class SkyvernClient {
|
|
|
2558
2666
|
}
|
|
2559
2667
|
if (_response.error.reason === "status-code") {
|
|
2560
2668
|
switch (_response.error.statusCode) {
|
|
2669
|
+
case 404:
|
|
2670
|
+
throw new Skyvern.NotFoundError(_response.error.body, _response.rawResponse);
|
|
2561
2671
|
case 422:
|
|
2562
2672
|
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
2563
2673
|
default:
|
|
@@ -2576,7 +2686,7 @@ class SkyvernClient {
|
|
|
2576
2686
|
rawResponse: _response.rawResponse,
|
|
2577
2687
|
});
|
|
2578
2688
|
case "timeout":
|
|
2579
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling
|
|
2689
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/browser_profiles/{profile_id}.");
|
|
2580
2690
|
case "unknown":
|
|
2581
2691
|
throw new errors.SkyvernError({
|
|
2582
2692
|
message: _response.error.errorMessage,
|
|
@@ -2586,48 +2696,40 @@ class SkyvernClient {
|
|
|
2586
2696
|
});
|
|
2587
2697
|
}
|
|
2588
2698
|
/**
|
|
2589
|
-
*
|
|
2590
|
-
*
|
|
2591
|
-
* Frontend should redirect the user to the returned URL.
|
|
2592
|
-
* After successful checkout, Stripe will send a webhook that we handle
|
|
2593
|
-
* to store the subscription and initialize billing state.
|
|
2594
|
-
*
|
|
2595
|
-
* Returns 400 if org already has an active subscription (use portal instead).
|
|
2699
|
+
* Delete a browser profile (soft delete)
|
|
2596
2700
|
*
|
|
2597
|
-
* @param {
|
|
2701
|
+
* @param {string} profileId - The ID of the browser profile to delete. browser_profile_id starts with `bp_`
|
|
2598
2702
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
2599
2703
|
*
|
|
2704
|
+
* @throws {@link Skyvern.NotFoundError}
|
|
2600
2705
|
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
2601
2706
|
*
|
|
2602
2707
|
* @example
|
|
2603
|
-
* await client.
|
|
2604
|
-
* tier: "free"
|
|
2605
|
-
* })
|
|
2708
|
+
* await client.deleteBrowserProfile("bp_123456")
|
|
2606
2709
|
*/
|
|
2607
|
-
|
|
2608
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
2710
|
+
deleteBrowserProfile(profileId, requestOptions) {
|
|
2711
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteBrowserProfile(profileId, requestOptions));
|
|
2609
2712
|
}
|
|
2610
|
-
|
|
2713
|
+
__deleteBrowserProfile(profileId, requestOptions) {
|
|
2611
2714
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2612
2715
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
2613
2716
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
2614
2717
|
const _response = yield core.fetcher({
|
|
2615
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud,
|
|
2616
|
-
method: "
|
|
2718
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/browser_profiles/${core.url.encodePathParam(profileId)}`),
|
|
2719
|
+
method: "DELETE",
|
|
2617
2720
|
headers: _headers,
|
|
2618
|
-
contentType: "application/json",
|
|
2619
2721
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
2620
|
-
requestType: "json",
|
|
2621
|
-
body: request,
|
|
2622
2722
|
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
2623
2723
|
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
2624
2724
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2625
2725
|
});
|
|
2626
2726
|
if (_response.ok) {
|
|
2627
|
-
return { data:
|
|
2727
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
2628
2728
|
}
|
|
2629
2729
|
if (_response.error.reason === "status-code") {
|
|
2630
2730
|
switch (_response.error.statusCode) {
|
|
2731
|
+
case 404:
|
|
2732
|
+
throw new Skyvern.NotFoundError(_response.error.body, _response.rawResponse);
|
|
2631
2733
|
case 422:
|
|
2632
2734
|
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
2633
2735
|
default:
|
|
@@ -2646,7 +2748,7 @@ class SkyvernClient {
|
|
|
2646
2748
|
rawResponse: _response.rawResponse,
|
|
2647
2749
|
});
|
|
2648
2750
|
case "timeout":
|
|
2649
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling
|
|
2751
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling DELETE /v1/browser_profiles/{profile_id}.");
|
|
2650
2752
|
case "unknown":
|
|
2651
2753
|
throw new errors.SkyvernError({
|
|
2652
2754
|
message: _response.error.errorMessage,
|
|
@@ -2656,34 +2758,34 @@ class SkyvernClient {
|
|
|
2656
2758
|
});
|
|
2657
2759
|
}
|
|
2658
2760
|
/**
|
|
2659
|
-
*
|
|
2660
|
-
*
|
|
2661
|
-
* Frontend should redirect the user to the returned URL.
|
|
2662
|
-
* The portal allows users to:
|
|
2663
|
-
* - Update payment methods
|
|
2664
|
-
* - Upgrade/downgrade plans
|
|
2665
|
-
* - Cancel subscription
|
|
2666
|
-
* - View invoices
|
|
2761
|
+
* Update a browser profile's name and/or description
|
|
2667
2762
|
*
|
|
2763
|
+
* @param {string} profileId - The ID of the browser profile to update. browser_profile_id starts with `bp_`
|
|
2764
|
+
* @param {Skyvern.UpdateBrowserProfileRequest} request
|
|
2668
2765
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
2669
2766
|
*
|
|
2767
|
+
* @throws {@link Skyvern.NotFoundError}
|
|
2768
|
+
* @throws {@link Skyvern.ConflictError}
|
|
2670
2769
|
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
2671
2770
|
*
|
|
2672
2771
|
* @example
|
|
2673
|
-
* await client.
|
|
2772
|
+
* await client.updateBrowserProfile("bp_123456")
|
|
2674
2773
|
*/
|
|
2675
|
-
|
|
2676
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
2774
|
+
updateBrowserProfile(profileId, request = {}, requestOptions) {
|
|
2775
|
+
return core.HttpResponsePromise.fromPromise(this.__updateBrowserProfile(profileId, request, requestOptions));
|
|
2677
2776
|
}
|
|
2678
|
-
|
|
2679
|
-
return __awaiter(this,
|
|
2777
|
+
__updateBrowserProfile(profileId_1) {
|
|
2778
|
+
return __awaiter(this, arguments, void 0, function* (profileId, request = {}, requestOptions) {
|
|
2680
2779
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
2681
2780
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
2682
2781
|
const _response = yield core.fetcher({
|
|
2683
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud,
|
|
2684
|
-
method: "
|
|
2782
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/browser_profiles/${core.url.encodePathParam(profileId)}`),
|
|
2783
|
+
method: "PATCH",
|
|
2685
2784
|
headers: _headers,
|
|
2785
|
+
contentType: "application/json",
|
|
2686
2786
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
2787
|
+
requestType: "json",
|
|
2788
|
+
body: request,
|
|
2687
2789
|
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
2688
2790
|
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
2689
2791
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -2693,6 +2795,10 @@ class SkyvernClient {
|
|
|
2693
2795
|
}
|
|
2694
2796
|
if (_response.error.reason === "status-code") {
|
|
2695
2797
|
switch (_response.error.statusCode) {
|
|
2798
|
+
case 404:
|
|
2799
|
+
throw new Skyvern.NotFoundError(_response.error.body, _response.rawResponse);
|
|
2800
|
+
case 409:
|
|
2801
|
+
throw new Skyvern.ConflictError(_response.error.body, _response.rawResponse);
|
|
2696
2802
|
case 422:
|
|
2697
2803
|
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
2698
2804
|
default:
|
|
@@ -2711,7 +2817,7 @@ class SkyvernClient {
|
|
|
2711
2817
|
rawResponse: _response.rawResponse,
|
|
2712
2818
|
});
|
|
2713
2819
|
case "timeout":
|
|
2714
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling
|
|
2820
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling PATCH /v1/browser_profiles/{profile_id}.");
|
|
2715
2821
|
case "unknown":
|
|
2716
2822
|
throw new errors.SkyvernError({
|
|
2717
2823
|
message: _response.error.errorMessage,
|
|
@@ -2721,22 +2827,25 @@ class SkyvernClient {
|
|
|
2721
2827
|
});
|
|
2722
2828
|
}
|
|
2723
2829
|
/**
|
|
2830
|
+
* Get all active browser sessions for the organization
|
|
2831
|
+
*
|
|
2724
2832
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
2725
2833
|
*
|
|
2834
|
+
* @throws {@link Skyvern.ForbiddenError}
|
|
2726
2835
|
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
2727
2836
|
*
|
|
2728
2837
|
* @example
|
|
2729
|
-
* await client.
|
|
2838
|
+
* await client.getBrowserSessions()
|
|
2730
2839
|
*/
|
|
2731
|
-
|
|
2732
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
2840
|
+
getBrowserSessions(requestOptions) {
|
|
2841
|
+
return core.HttpResponsePromise.fromPromise(this.__getBrowserSessions(requestOptions));
|
|
2733
2842
|
}
|
|
2734
|
-
|
|
2843
|
+
__getBrowserSessions(requestOptions) {
|
|
2735
2844
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2736
2845
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
2737
2846
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
2738
2847
|
const _response = yield core.fetcher({
|
|
2739
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "
|
|
2848
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "v1/browser_sessions"),
|
|
2740
2849
|
method: "GET",
|
|
2741
2850
|
headers: _headers,
|
|
2742
2851
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -2745,13 +2854,12 @@ class SkyvernClient {
|
|
|
2745
2854
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2746
2855
|
});
|
|
2747
2856
|
if (_response.ok) {
|
|
2748
|
-
return {
|
|
2749
|
-
data: _response.body,
|
|
2750
|
-
rawResponse: _response.rawResponse,
|
|
2751
|
-
};
|
|
2857
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
2752
2858
|
}
|
|
2753
2859
|
if (_response.error.reason === "status-code") {
|
|
2754
2860
|
switch (_response.error.statusCode) {
|
|
2861
|
+
case 403:
|
|
2862
|
+
throw new Skyvern.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2755
2863
|
case 422:
|
|
2756
2864
|
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
2757
2865
|
default:
|
|
@@ -2770,7 +2878,7 @@ class SkyvernClient {
|
|
|
2770
2878
|
rawResponse: _response.rawResponse,
|
|
2771
2879
|
});
|
|
2772
2880
|
case "timeout":
|
|
2773
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /
|
|
2881
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/browser_sessions.");
|
|
2774
2882
|
case "unknown":
|
|
2775
2883
|
throw new errors.SkyvernError({
|
|
2776
2884
|
message: _response.error.errorMessage,
|
|
@@ -2780,30 +2888,27 @@ class SkyvernClient {
|
|
|
2780
2888
|
});
|
|
2781
2889
|
}
|
|
2782
2890
|
/**
|
|
2783
|
-
*
|
|
2784
|
-
* Portal handles proration based on configured settings:
|
|
2785
|
-
* - Upgrades: Immediate proration charge
|
|
2786
|
-
* - Downgrades: Apply at end of billing period
|
|
2891
|
+
* Create a browser session that persists across multiple runs
|
|
2787
2892
|
*
|
|
2788
|
-
* @param {Skyvern.
|
|
2893
|
+
* @param {Skyvern.CreateBrowserSessionRequest} request
|
|
2789
2894
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
2790
2895
|
*
|
|
2896
|
+
* @throws {@link Skyvern.ForbiddenError}
|
|
2897
|
+
* @throws {@link Skyvern.NotFoundError}
|
|
2791
2898
|
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
2792
2899
|
*
|
|
2793
2900
|
* @example
|
|
2794
|
-
* await client.
|
|
2795
|
-
* tier: "free"
|
|
2796
|
-
* })
|
|
2901
|
+
* await client.createBrowserSession()
|
|
2797
2902
|
*/
|
|
2798
|
-
|
|
2799
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
2903
|
+
createBrowserSession(request = {}, requestOptions) {
|
|
2904
|
+
return core.HttpResponsePromise.fromPromise(this.__createBrowserSession(request, requestOptions));
|
|
2800
2905
|
}
|
|
2801
|
-
|
|
2802
|
-
return __awaiter(this,
|
|
2906
|
+
__createBrowserSession() {
|
|
2907
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
2803
2908
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
2804
2909
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
2805
2910
|
const _response = yield core.fetcher({
|
|
2806
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "
|
|
2911
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "v1/browser_sessions"),
|
|
2807
2912
|
method: "POST",
|
|
2808
2913
|
headers: _headers,
|
|
2809
2914
|
contentType: "application/json",
|
|
@@ -2819,6 +2924,10 @@ class SkyvernClient {
|
|
|
2819
2924
|
}
|
|
2820
2925
|
if (_response.error.reason === "status-code") {
|
|
2821
2926
|
switch (_response.error.statusCode) {
|
|
2927
|
+
case 403:
|
|
2928
|
+
throw new Skyvern.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2929
|
+
case 404:
|
|
2930
|
+
throw new Skyvern.NotFoundError(_response.error.body, _response.rawResponse);
|
|
2822
2931
|
case 422:
|
|
2823
2932
|
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
2824
2933
|
default:
|
|
@@ -2837,7 +2946,7 @@ class SkyvernClient {
|
|
|
2837
2946
|
rawResponse: _response.rawResponse,
|
|
2838
2947
|
});
|
|
2839
2948
|
case "timeout":
|
|
2840
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /
|
|
2949
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /v1/browser_sessions.");
|
|
2841
2950
|
case "unknown":
|
|
2842
2951
|
throw new errors.SkyvernError({
|
|
2843
2952
|
message: _response.error.errorMessage,
|
|
@@ -2847,43 +2956,30 @@ class SkyvernClient {
|
|
|
2847
2956
|
});
|
|
2848
2957
|
}
|
|
2849
2958
|
/**
|
|
2850
|
-
*
|
|
2959
|
+
* Close a session. Once closed, the session cannot be used again.
|
|
2851
2960
|
*
|
|
2852
|
-
* @param {
|
|
2961
|
+
* @param {string} browserSessionId - The ID of the browser session to close. completed_at will be set when the browser session is closed. browser_session_id starts with `pbs_`
|
|
2853
2962
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
2854
2963
|
*
|
|
2964
|
+
* @throws {@link Skyvern.ForbiddenError}
|
|
2965
|
+
* @throws {@link Skyvern.NotFoundError}
|
|
2855
2966
|
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
2856
2967
|
*
|
|
2857
2968
|
* @example
|
|
2858
|
-
* await client.
|
|
2859
|
-
* page: 1,
|
|
2860
|
-
* page_size: 1,
|
|
2861
|
-
* search: "search"
|
|
2862
|
-
* })
|
|
2969
|
+
* await client.closeBrowserSession("pbs_123456")
|
|
2863
2970
|
*/
|
|
2864
|
-
|
|
2865
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
2971
|
+
closeBrowserSession(browserSessionId, requestOptions) {
|
|
2972
|
+
return core.HttpResponsePromise.fromPromise(this.__closeBrowserSession(browserSessionId, requestOptions));
|
|
2866
2973
|
}
|
|
2867
|
-
|
|
2868
|
-
return __awaiter(this,
|
|
2974
|
+
__closeBrowserSession(browserSessionId, requestOptions) {
|
|
2975
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2869
2976
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
2870
|
-
const { page, page_size: pageSize, search } = request;
|
|
2871
|
-
const _queryParams = {};
|
|
2872
|
-
if (page != null) {
|
|
2873
|
-
_queryParams.page = page.toString();
|
|
2874
|
-
}
|
|
2875
|
-
if (pageSize != null) {
|
|
2876
|
-
_queryParams.page_size = pageSize.toString();
|
|
2877
|
-
}
|
|
2878
|
-
if (search != null) {
|
|
2879
|
-
_queryParams.search = search;
|
|
2880
|
-
}
|
|
2881
2977
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
2882
2978
|
const _response = yield core.fetcher({
|
|
2883
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud,
|
|
2884
|
-
method: "
|
|
2979
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/browser_sessions/${core.url.encodePathParam(browserSessionId)}/close`),
|
|
2980
|
+
method: "POST",
|
|
2885
2981
|
headers: _headers,
|
|
2886
|
-
queryParameters:
|
|
2982
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
2887
2983
|
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
2888
2984
|
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
2889
2985
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -2893,6 +2989,10 @@ class SkyvernClient {
|
|
|
2893
2989
|
}
|
|
2894
2990
|
if (_response.error.reason === "status-code") {
|
|
2895
2991
|
switch (_response.error.statusCode) {
|
|
2992
|
+
case 403:
|
|
2993
|
+
throw new Skyvern.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2994
|
+
case 404:
|
|
2995
|
+
throw new Skyvern.NotFoundError(_response.error.body, _response.rawResponse);
|
|
2896
2996
|
case 422:
|
|
2897
2997
|
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
2898
2998
|
default:
|
|
@@ -2911,7 +3011,7 @@ class SkyvernClient {
|
|
|
2911
3011
|
rawResponse: _response.rawResponse,
|
|
2912
3012
|
});
|
|
2913
3013
|
case "timeout":
|
|
2914
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling
|
|
3014
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /v1/browser_sessions/{browser_session_id}/close.");
|
|
2915
3015
|
case "unknown":
|
|
2916
3016
|
throw new errors.SkyvernError({
|
|
2917
3017
|
message: _response.error.errorMessage,
|
|
@@ -2921,34 +3021,30 @@ class SkyvernClient {
|
|
|
2921
3021
|
});
|
|
2922
3022
|
}
|
|
2923
3023
|
/**
|
|
2924
|
-
*
|
|
3024
|
+
* Get details about a specific browser session, including the browser address for cdp connection.
|
|
2925
3025
|
*
|
|
2926
|
-
* @param {
|
|
3026
|
+
* @param {string} browserSessionId - The ID of the browser session. browser_session_id starts with `pbs_`
|
|
2927
3027
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
2928
3028
|
*
|
|
2929
|
-
* @throws {@link Skyvern.
|
|
3029
|
+
* @throws {@link Skyvern.ForbiddenError}
|
|
3030
|
+
* @throws {@link Skyvern.NotFoundError}
|
|
2930
3031
|
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
2931
3032
|
*
|
|
2932
3033
|
* @example
|
|
2933
|
-
* await client.
|
|
2934
|
-
* title: "title"
|
|
2935
|
-
* })
|
|
3034
|
+
* await client.getBrowserSession("pbs_123456")
|
|
2936
3035
|
*/
|
|
2937
|
-
|
|
2938
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
3036
|
+
getBrowserSession(browserSessionId, requestOptions) {
|
|
3037
|
+
return core.HttpResponsePromise.fromPromise(this.__getBrowserSession(browserSessionId, requestOptions));
|
|
2939
3038
|
}
|
|
2940
|
-
|
|
3039
|
+
__getBrowserSession(browserSessionId, requestOptions) {
|
|
2941
3040
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2942
3041
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
2943
3042
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
2944
3043
|
const _response = yield core.fetcher({
|
|
2945
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud,
|
|
2946
|
-
method: "
|
|
3044
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/browser_sessions/${core.url.encodePathParam(browserSessionId)}`),
|
|
3045
|
+
method: "GET",
|
|
2947
3046
|
headers: _headers,
|
|
2948
|
-
contentType: "application/json",
|
|
2949
3047
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
2950
|
-
requestType: "json",
|
|
2951
|
-
body: request,
|
|
2952
3048
|
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
2953
3049
|
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
2954
3050
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -2958,8 +3054,10 @@ class SkyvernClient {
|
|
|
2958
3054
|
}
|
|
2959
3055
|
if (_response.error.reason === "status-code") {
|
|
2960
3056
|
switch (_response.error.statusCode) {
|
|
2961
|
-
case
|
|
2962
|
-
throw new Skyvern.
|
|
3057
|
+
case 403:
|
|
3058
|
+
throw new Skyvern.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3059
|
+
case 404:
|
|
3060
|
+
throw new Skyvern.NotFoundError(_response.error.body, _response.rawResponse);
|
|
2963
3061
|
case 422:
|
|
2964
3062
|
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
2965
3063
|
default:
|
|
@@ -2978,7 +3076,7 @@ class SkyvernClient {
|
|
|
2978
3076
|
rawResponse: _response.rawResponse,
|
|
2979
3077
|
});
|
|
2980
3078
|
case "timeout":
|
|
2981
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling
|
|
3079
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/browser_sessions/{browser_session_id}.");
|
|
2982
3080
|
case "unknown":
|
|
2983
3081
|
throw new errors.SkyvernError({
|
|
2984
3082
|
message: _response.error.errorMessage,
|
|
@@ -2988,29 +3086,37 @@ class SkyvernClient {
|
|
|
2988
3086
|
});
|
|
2989
3087
|
}
|
|
2990
3088
|
/**
|
|
2991
|
-
*
|
|
3089
|
+
* Update a live browser session. Currently supports toggling generate_browser_profile, which is read when the session ends to decide whether to save its browser profile.
|
|
2992
3090
|
*
|
|
2993
|
-
* @param {string}
|
|
3091
|
+
* @param {string} browserSessionId - The ID of the browser session. browser_session_id starts with `pbs_`
|
|
3092
|
+
* @param {Skyvern.UpdateBrowserSessionRequest} request
|
|
2994
3093
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
2995
3094
|
*
|
|
3095
|
+
* @throws {@link Skyvern.ForbiddenError}
|
|
2996
3096
|
* @throws {@link Skyvern.NotFoundError}
|
|
3097
|
+
* @throws {@link Skyvern.ConflictError}
|
|
2997
3098
|
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
2998
3099
|
*
|
|
2999
3100
|
* @example
|
|
3000
|
-
* await client.
|
|
3101
|
+
* await client.updateBrowserSession("pbs_123456", {
|
|
3102
|
+
* generate_browser_profile: true
|
|
3103
|
+
* })
|
|
3001
3104
|
*/
|
|
3002
|
-
|
|
3003
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
3105
|
+
updateBrowserSession(browserSessionId, request, requestOptions) {
|
|
3106
|
+
return core.HttpResponsePromise.fromPromise(this.__updateBrowserSession(browserSessionId, request, requestOptions));
|
|
3004
3107
|
}
|
|
3005
|
-
|
|
3108
|
+
__updateBrowserSession(browserSessionId, request, requestOptions) {
|
|
3006
3109
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3007
3110
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
3008
3111
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
3009
3112
|
const _response = yield core.fetcher({
|
|
3010
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/
|
|
3011
|
-
method: "
|
|
3113
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/browser_sessions/${core.url.encodePathParam(browserSessionId)}`),
|
|
3114
|
+
method: "PATCH",
|
|
3012
3115
|
headers: _headers,
|
|
3116
|
+
contentType: "application/json",
|
|
3013
3117
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
3118
|
+
requestType: "json",
|
|
3119
|
+
body: request,
|
|
3014
3120
|
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
3015
3121
|
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
3016
3122
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -3020,8 +3126,12 @@ class SkyvernClient {
|
|
|
3020
3126
|
}
|
|
3021
3127
|
if (_response.error.reason === "status-code") {
|
|
3022
3128
|
switch (_response.error.statusCode) {
|
|
3129
|
+
case 403:
|
|
3130
|
+
throw new Skyvern.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3023
3131
|
case 404:
|
|
3024
3132
|
throw new Skyvern.NotFoundError(_response.error.body, _response.rawResponse);
|
|
3133
|
+
case 409:
|
|
3134
|
+
throw new Skyvern.ConflictError(_response.error.body, _response.rawResponse);
|
|
3025
3135
|
case 422:
|
|
3026
3136
|
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
3027
3137
|
default:
|
|
@@ -3040,7 +3150,7 @@ class SkyvernClient {
|
|
|
3040
3150
|
rawResponse: _response.rawResponse,
|
|
3041
3151
|
});
|
|
3042
3152
|
case "timeout":
|
|
3043
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling
|
|
3153
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling PATCH /v1/browser_sessions/{browser_session_id}.");
|
|
3044
3154
|
case "unknown":
|
|
3045
3155
|
throw new errors.SkyvernError({
|
|
3046
3156
|
message: _response.error.errorMessage,
|
|
@@ -3050,28 +3160,29 @@ class SkyvernClient {
|
|
|
3050
3160
|
});
|
|
3051
3161
|
}
|
|
3052
3162
|
/**
|
|
3053
|
-
*
|
|
3163
|
+
* Forward a TOTP (2FA, MFA) email or sms message containing the code to Skyvern. This endpoint stores the code in database so that Skyvern can use it while running tasks/workflows.
|
|
3054
3164
|
*
|
|
3055
|
-
* @param {
|
|
3056
|
-
* @param {Skyvern.FolderUpdate} request
|
|
3165
|
+
* @param {Skyvern.TotpCodeCreate} request
|
|
3057
3166
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
3058
3167
|
*
|
|
3059
|
-
* @throws {@link Skyvern.NotFoundError}
|
|
3060
3168
|
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
3061
3169
|
*
|
|
3062
3170
|
* @example
|
|
3063
|
-
* await client.
|
|
3171
|
+
* await client.sendTotpCode({
|
|
3172
|
+
* totp_identifier: "john.doe@example.com",
|
|
3173
|
+
* content: "Hello, your verification code is 123456"
|
|
3174
|
+
* })
|
|
3064
3175
|
*/
|
|
3065
|
-
|
|
3066
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
3176
|
+
sendTotpCode(request, requestOptions) {
|
|
3177
|
+
return core.HttpResponsePromise.fromPromise(this.__sendTotpCode(request, requestOptions));
|
|
3067
3178
|
}
|
|
3068
|
-
|
|
3069
|
-
return __awaiter(this,
|
|
3179
|
+
__sendTotpCode(request, requestOptions) {
|
|
3180
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3070
3181
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
3071
3182
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
3072
3183
|
const _response = yield core.fetcher({
|
|
3073
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud,
|
|
3074
|
-
method: "
|
|
3184
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "v1/credentials/totp"),
|
|
3185
|
+
method: "POST",
|
|
3075
3186
|
headers: _headers,
|
|
3076
3187
|
contentType: "application/json",
|
|
3077
3188
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -3086,8 +3197,6 @@ class SkyvernClient {
|
|
|
3086
3197
|
}
|
|
3087
3198
|
if (_response.error.reason === "status-code") {
|
|
3088
3199
|
switch (_response.error.statusCode) {
|
|
3089
|
-
case 404:
|
|
3090
|
-
throw new Skyvern.NotFoundError(_response.error.body, _response.rawResponse);
|
|
3091
3200
|
case 422:
|
|
3092
3201
|
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
3093
3202
|
default:
|
|
@@ -3106,7 +3215,7 @@ class SkyvernClient {
|
|
|
3106
3215
|
rawResponse: _response.rawResponse,
|
|
3107
3216
|
});
|
|
3108
3217
|
case "timeout":
|
|
3109
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling
|
|
3218
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /v1/credentials/totp.");
|
|
3110
3219
|
case "unknown":
|
|
3111
3220
|
throw new errors.SkyvernError({
|
|
3112
3221
|
message: _response.error.errorMessage,
|
|
@@ -3116,35 +3225,49 @@ class SkyvernClient {
|
|
|
3116
3225
|
});
|
|
3117
3226
|
}
|
|
3118
3227
|
/**
|
|
3119
|
-
*
|
|
3228
|
+
* Retrieves a paginated list of credentials for the current organization
|
|
3120
3229
|
*
|
|
3121
|
-
* @param {
|
|
3122
|
-
* @param {Skyvern.DeleteFolderRequest} request
|
|
3230
|
+
* @param {Skyvern.GetCredentialsRequest} request
|
|
3123
3231
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
3124
3232
|
*
|
|
3125
|
-
* @throws {@link Skyvern.NotFoundError}
|
|
3126
3233
|
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
3127
3234
|
*
|
|
3128
3235
|
* @example
|
|
3129
|
-
* await client.
|
|
3130
|
-
*
|
|
3236
|
+
* await client.getCredentials({
|
|
3237
|
+
* page: 1,
|
|
3238
|
+
* page_size: 10,
|
|
3239
|
+
* vault_type: "skyvern",
|
|
3240
|
+
* credential_type: "password",
|
|
3241
|
+
* search: "search"
|
|
3131
3242
|
* })
|
|
3132
3243
|
*/
|
|
3133
|
-
|
|
3134
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
3244
|
+
getCredentials(request = {}, requestOptions) {
|
|
3245
|
+
return core.HttpResponsePromise.fromPromise(this.__getCredentials(request, requestOptions));
|
|
3135
3246
|
}
|
|
3136
|
-
|
|
3137
|
-
return __awaiter(this, arguments, void 0, function* (
|
|
3247
|
+
__getCredentials() {
|
|
3248
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
3138
3249
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
3139
|
-
const {
|
|
3250
|
+
const { page, page_size: pageSize, vault_type: vaultType, credential_type: credentialType, search } = request;
|
|
3140
3251
|
const _queryParams = {};
|
|
3141
|
-
if (
|
|
3142
|
-
_queryParams.
|
|
3252
|
+
if (page != null) {
|
|
3253
|
+
_queryParams.page = page.toString();
|
|
3254
|
+
}
|
|
3255
|
+
if (pageSize != null) {
|
|
3256
|
+
_queryParams.page_size = pageSize.toString();
|
|
3257
|
+
}
|
|
3258
|
+
if (vaultType != null) {
|
|
3259
|
+
_queryParams.vault_type = vaultType;
|
|
3260
|
+
}
|
|
3261
|
+
if (credentialType != null) {
|
|
3262
|
+
_queryParams.credential_type = credentialType;
|
|
3263
|
+
}
|
|
3264
|
+
if (search != null) {
|
|
3265
|
+
_queryParams.search = search;
|
|
3143
3266
|
}
|
|
3144
3267
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
3145
3268
|
const _response = yield core.fetcher({
|
|
3146
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud,
|
|
3147
|
-
method: "
|
|
3269
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "v1/credentials"),
|
|
3270
|
+
method: "GET",
|
|
3148
3271
|
headers: _headers,
|
|
3149
3272
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
3150
3273
|
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
@@ -3156,8 +3279,6 @@ class SkyvernClient {
|
|
|
3156
3279
|
}
|
|
3157
3280
|
if (_response.error.reason === "status-code") {
|
|
3158
3281
|
switch (_response.error.statusCode) {
|
|
3159
|
-
case 404:
|
|
3160
|
-
throw new Skyvern.NotFoundError(_response.error.body, _response.rawResponse);
|
|
3161
3282
|
case 422:
|
|
3162
3283
|
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
3163
3284
|
default:
|
|
@@ -3176,7 +3297,7 @@ class SkyvernClient {
|
|
|
3176
3297
|
rawResponse: _response.rawResponse,
|
|
3177
3298
|
});
|
|
3178
3299
|
case "timeout":
|
|
3179
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling
|
|
3300
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/credentials.");
|
|
3180
3301
|
case "unknown":
|
|
3181
3302
|
throw new errors.SkyvernError({
|
|
3182
3303
|
message: _response.error.errorMessage,
|
|
@@ -3186,29 +3307,33 @@ class SkyvernClient {
|
|
|
3186
3307
|
});
|
|
3187
3308
|
}
|
|
3188
3309
|
/**
|
|
3189
|
-
*
|
|
3310
|
+
* Creates a new credential for the current organization
|
|
3190
3311
|
*
|
|
3191
|
-
* @param {
|
|
3192
|
-
* @param {Skyvern.UpdateWorkflowFolderRequest} request
|
|
3312
|
+
* @param {Skyvern.CreateCredentialRequest} request
|
|
3193
3313
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
3194
3314
|
*
|
|
3195
|
-
* @throws {@link Skyvern.BadRequestError}
|
|
3196
|
-
* @throws {@link Skyvern.NotFoundError}
|
|
3197
3315
|
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
3198
3316
|
*
|
|
3199
3317
|
* @example
|
|
3200
|
-
* await client.
|
|
3318
|
+
* await client.createCredential({
|
|
3319
|
+
* name: "Amazon Login",
|
|
3320
|
+
* credential_type: "password",
|
|
3321
|
+
* credential: {
|
|
3322
|
+
* password: "securepassword123",
|
|
3323
|
+
* username: "user@example.com"
|
|
3324
|
+
* }
|
|
3325
|
+
* })
|
|
3201
3326
|
*/
|
|
3202
|
-
|
|
3203
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
3327
|
+
createCredential(request, requestOptions) {
|
|
3328
|
+
return core.HttpResponsePromise.fromPromise(this.__createCredential(request, requestOptions));
|
|
3204
3329
|
}
|
|
3205
|
-
|
|
3206
|
-
return __awaiter(this,
|
|
3330
|
+
__createCredential(request, requestOptions) {
|
|
3331
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3207
3332
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
3208
3333
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
3209
3334
|
const _response = yield core.fetcher({
|
|
3210
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud,
|
|
3211
|
-
method: "
|
|
3335
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "v1/credentials"),
|
|
3336
|
+
method: "POST",
|
|
3212
3337
|
headers: _headers,
|
|
3213
3338
|
contentType: "application/json",
|
|
3214
3339
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -3223,10 +3348,6 @@ class SkyvernClient {
|
|
|
3223
3348
|
}
|
|
3224
3349
|
if (_response.error.reason === "status-code") {
|
|
3225
3350
|
switch (_response.error.statusCode) {
|
|
3226
|
-
case 400:
|
|
3227
|
-
throw new Skyvern.BadRequestError(_response.error.body, _response.rawResponse);
|
|
3228
|
-
case 404:
|
|
3229
|
-
throw new Skyvern.NotFoundError(_response.error.body, _response.rawResponse);
|
|
3230
3351
|
case 422:
|
|
3231
3352
|
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
3232
3353
|
default:
|
|
@@ -3245,7 +3366,1682 @@ class SkyvernClient {
|
|
|
3245
3366
|
rawResponse: _response.rawResponse,
|
|
3246
3367
|
});
|
|
3247
3368
|
case "timeout":
|
|
3248
|
-
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling
|
|
3369
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /v1/credentials.");
|
|
3370
|
+
case "unknown":
|
|
3371
|
+
throw new errors.SkyvernError({
|
|
3372
|
+
message: _response.error.errorMessage,
|
|
3373
|
+
rawResponse: _response.rawResponse,
|
|
3374
|
+
});
|
|
3375
|
+
}
|
|
3376
|
+
});
|
|
3377
|
+
}
|
|
3378
|
+
/**
|
|
3379
|
+
* Overwrites the stored credential data (e.g. username/password) while keeping the same credential_id.
|
|
3380
|
+
*
|
|
3381
|
+
* @param {string} credentialId - The unique identifier of the credential to update
|
|
3382
|
+
* @param {Skyvern.CreateCredentialRequest} request
|
|
3383
|
+
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
3384
|
+
*
|
|
3385
|
+
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
3386
|
+
*
|
|
3387
|
+
* @example
|
|
3388
|
+
* await client.updateCredential("cred_1234567890", {
|
|
3389
|
+
* name: "Amazon Login",
|
|
3390
|
+
* credential_type: "password",
|
|
3391
|
+
* credential: {
|
|
3392
|
+
* password: "securepassword123",
|
|
3393
|
+
* username: "user@example.com"
|
|
3394
|
+
* }
|
|
3395
|
+
* })
|
|
3396
|
+
*/
|
|
3397
|
+
updateCredential(credentialId, request, requestOptions) {
|
|
3398
|
+
return core.HttpResponsePromise.fromPromise(this.__updateCredential(credentialId, request, requestOptions));
|
|
3399
|
+
}
|
|
3400
|
+
__updateCredential(credentialId, request, requestOptions) {
|
|
3401
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3402
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
3403
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
3404
|
+
const _response = yield core.fetcher({
|
|
3405
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/credentials/${core.url.encodePathParam(credentialId)}/update`),
|
|
3406
|
+
method: "POST",
|
|
3407
|
+
headers: _headers,
|
|
3408
|
+
contentType: "application/json",
|
|
3409
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
3410
|
+
requestType: "json",
|
|
3411
|
+
body: request,
|
|
3412
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
3413
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
3414
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3415
|
+
});
|
|
3416
|
+
if (_response.ok) {
|
|
3417
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
3418
|
+
}
|
|
3419
|
+
if (_response.error.reason === "status-code") {
|
|
3420
|
+
switch (_response.error.statusCode) {
|
|
3421
|
+
case 422:
|
|
3422
|
+
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
3423
|
+
default:
|
|
3424
|
+
throw new errors.SkyvernError({
|
|
3425
|
+
statusCode: _response.error.statusCode,
|
|
3426
|
+
body: _response.error.body,
|
|
3427
|
+
rawResponse: _response.rawResponse,
|
|
3428
|
+
});
|
|
3429
|
+
}
|
|
3430
|
+
}
|
|
3431
|
+
switch (_response.error.reason) {
|
|
3432
|
+
case "non-json":
|
|
3433
|
+
throw new errors.SkyvernError({
|
|
3434
|
+
statusCode: _response.error.statusCode,
|
|
3435
|
+
body: _response.error.rawBody,
|
|
3436
|
+
rawResponse: _response.rawResponse,
|
|
3437
|
+
});
|
|
3438
|
+
case "timeout":
|
|
3439
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /v1/credentials/{credential_id}/update.");
|
|
3440
|
+
case "unknown":
|
|
3441
|
+
throw new errors.SkyvernError({
|
|
3442
|
+
message: _response.error.errorMessage,
|
|
3443
|
+
rawResponse: _response.rawResponse,
|
|
3444
|
+
});
|
|
3445
|
+
}
|
|
3446
|
+
});
|
|
3447
|
+
}
|
|
3448
|
+
/**
|
|
3449
|
+
* Deletes a specific credential by its ID
|
|
3450
|
+
*
|
|
3451
|
+
* @param {string} credentialId - The unique identifier of the credential to delete
|
|
3452
|
+
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
3453
|
+
*
|
|
3454
|
+
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
3455
|
+
*
|
|
3456
|
+
* @example
|
|
3457
|
+
* await client.deleteCredential("cred_1234567890")
|
|
3458
|
+
*/
|
|
3459
|
+
deleteCredential(credentialId, requestOptions) {
|
|
3460
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteCredential(credentialId, requestOptions));
|
|
3461
|
+
}
|
|
3462
|
+
__deleteCredential(credentialId, requestOptions) {
|
|
3463
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3464
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
3465
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
3466
|
+
const _response = yield core.fetcher({
|
|
3467
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/credentials/${core.url.encodePathParam(credentialId)}/delete`),
|
|
3468
|
+
method: "POST",
|
|
3469
|
+
headers: _headers,
|
|
3470
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
3471
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
3472
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
3473
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3474
|
+
});
|
|
3475
|
+
if (_response.ok) {
|
|
3476
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
3477
|
+
}
|
|
3478
|
+
if (_response.error.reason === "status-code") {
|
|
3479
|
+
switch (_response.error.statusCode) {
|
|
3480
|
+
case 422:
|
|
3481
|
+
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
3482
|
+
default:
|
|
3483
|
+
throw new errors.SkyvernError({
|
|
3484
|
+
statusCode: _response.error.statusCode,
|
|
3485
|
+
body: _response.error.body,
|
|
3486
|
+
rawResponse: _response.rawResponse,
|
|
3487
|
+
});
|
|
3488
|
+
}
|
|
3489
|
+
}
|
|
3490
|
+
switch (_response.error.reason) {
|
|
3491
|
+
case "non-json":
|
|
3492
|
+
throw new errors.SkyvernError({
|
|
3493
|
+
statusCode: _response.error.statusCode,
|
|
3494
|
+
body: _response.error.rawBody,
|
|
3495
|
+
rawResponse: _response.rawResponse,
|
|
3496
|
+
});
|
|
3497
|
+
case "timeout":
|
|
3498
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /v1/credentials/{credential_id}/delete.");
|
|
3499
|
+
case "unknown":
|
|
3500
|
+
throw new errors.SkyvernError({
|
|
3501
|
+
message: _response.error.errorMessage,
|
|
3502
|
+
rawResponse: _response.rawResponse,
|
|
3503
|
+
});
|
|
3504
|
+
}
|
|
3505
|
+
});
|
|
3506
|
+
}
|
|
3507
|
+
/**
|
|
3508
|
+
* Retrieves a specific credential by its ID
|
|
3509
|
+
*
|
|
3510
|
+
* @param {string} credentialId - The unique identifier of the credential
|
|
3511
|
+
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
3512
|
+
*
|
|
3513
|
+
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
3514
|
+
*
|
|
3515
|
+
* @example
|
|
3516
|
+
* await client.getCredential("cred_1234567890")
|
|
3517
|
+
*/
|
|
3518
|
+
getCredential(credentialId, requestOptions) {
|
|
3519
|
+
return core.HttpResponsePromise.fromPromise(this.__getCredential(credentialId, requestOptions));
|
|
3520
|
+
}
|
|
3521
|
+
__getCredential(credentialId, requestOptions) {
|
|
3522
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3523
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
3524
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
3525
|
+
const _response = yield core.fetcher({
|
|
3526
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/credentials/${core.url.encodePathParam(credentialId)}`),
|
|
3527
|
+
method: "GET",
|
|
3528
|
+
headers: _headers,
|
|
3529
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
3530
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
3531
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
3532
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3533
|
+
});
|
|
3534
|
+
if (_response.ok) {
|
|
3535
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
3536
|
+
}
|
|
3537
|
+
if (_response.error.reason === "status-code") {
|
|
3538
|
+
switch (_response.error.statusCode) {
|
|
3539
|
+
case 422:
|
|
3540
|
+
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
3541
|
+
default:
|
|
3542
|
+
throw new errors.SkyvernError({
|
|
3543
|
+
statusCode: _response.error.statusCode,
|
|
3544
|
+
body: _response.error.body,
|
|
3545
|
+
rawResponse: _response.rawResponse,
|
|
3546
|
+
});
|
|
3547
|
+
}
|
|
3548
|
+
}
|
|
3549
|
+
switch (_response.error.reason) {
|
|
3550
|
+
case "non-json":
|
|
3551
|
+
throw new errors.SkyvernError({
|
|
3552
|
+
statusCode: _response.error.statusCode,
|
|
3553
|
+
body: _response.error.rawBody,
|
|
3554
|
+
rawResponse: _response.rawResponse,
|
|
3555
|
+
});
|
|
3556
|
+
case "timeout":
|
|
3557
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/credentials/{credential_id}.");
|
|
3558
|
+
case "unknown":
|
|
3559
|
+
throw new errors.SkyvernError({
|
|
3560
|
+
message: _response.error.errorMessage,
|
|
3561
|
+
rawResponse: _response.rawResponse,
|
|
3562
|
+
});
|
|
3563
|
+
}
|
|
3564
|
+
});
|
|
3565
|
+
}
|
|
3566
|
+
/**
|
|
3567
|
+
* List the custom LLM configurations available to the current organization.
|
|
3568
|
+
*
|
|
3569
|
+
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
3570
|
+
*
|
|
3571
|
+
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
3572
|
+
*
|
|
3573
|
+
* @example
|
|
3574
|
+
* await client.listCustomLlms()
|
|
3575
|
+
*/
|
|
3576
|
+
listCustomLlms(requestOptions) {
|
|
3577
|
+
return core.HttpResponsePromise.fromPromise(this.__listCustomLlms(requestOptions));
|
|
3578
|
+
}
|
|
3579
|
+
__listCustomLlms(requestOptions) {
|
|
3580
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3581
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
3582
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
3583
|
+
const _response = yield core.fetcher({
|
|
3584
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "v1/custom-llms"),
|
|
3585
|
+
method: "GET",
|
|
3586
|
+
headers: _headers,
|
|
3587
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
3588
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
3589
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
3590
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3591
|
+
});
|
|
3592
|
+
if (_response.ok) {
|
|
3593
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
3594
|
+
}
|
|
3595
|
+
if (_response.error.reason === "status-code") {
|
|
3596
|
+
switch (_response.error.statusCode) {
|
|
3597
|
+
case 422:
|
|
3598
|
+
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
3599
|
+
default:
|
|
3600
|
+
throw new errors.SkyvernError({
|
|
3601
|
+
statusCode: _response.error.statusCode,
|
|
3602
|
+
body: _response.error.body,
|
|
3603
|
+
rawResponse: _response.rawResponse,
|
|
3604
|
+
});
|
|
3605
|
+
}
|
|
3606
|
+
}
|
|
3607
|
+
switch (_response.error.reason) {
|
|
3608
|
+
case "non-json":
|
|
3609
|
+
throw new errors.SkyvernError({
|
|
3610
|
+
statusCode: _response.error.statusCode,
|
|
3611
|
+
body: _response.error.rawBody,
|
|
3612
|
+
rawResponse: _response.rawResponse,
|
|
3613
|
+
});
|
|
3614
|
+
case "timeout":
|
|
3615
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/custom-llms.");
|
|
3616
|
+
case "unknown":
|
|
3617
|
+
throw new errors.SkyvernError({
|
|
3618
|
+
message: _response.error.errorMessage,
|
|
3619
|
+
rawResponse: _response.rawResponse,
|
|
3620
|
+
});
|
|
3621
|
+
}
|
|
3622
|
+
});
|
|
3623
|
+
}
|
|
3624
|
+
/**
|
|
3625
|
+
* Create a custom LLM configuration for the current organization.
|
|
3626
|
+
*
|
|
3627
|
+
* @param {Skyvern.CustomLlmCreateRequest} request
|
|
3628
|
+
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
3629
|
+
*
|
|
3630
|
+
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
3631
|
+
*
|
|
3632
|
+
* @example
|
|
3633
|
+
* await client.createCustomLlm({
|
|
3634
|
+
* config: {
|
|
3635
|
+
* display_name: "display_name",
|
|
3636
|
+
* provider: "openai_compatible",
|
|
3637
|
+
* model_name: "model_name"
|
|
3638
|
+
* }
|
|
3639
|
+
* })
|
|
3640
|
+
*/
|
|
3641
|
+
createCustomLlm(request, requestOptions) {
|
|
3642
|
+
return core.HttpResponsePromise.fromPromise(this.__createCustomLlm(request, requestOptions));
|
|
3643
|
+
}
|
|
3644
|
+
__createCustomLlm(request, requestOptions) {
|
|
3645
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3646
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
3647
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
3648
|
+
const _response = yield core.fetcher({
|
|
3649
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "v1/custom-llms"),
|
|
3650
|
+
method: "POST",
|
|
3651
|
+
headers: _headers,
|
|
3652
|
+
contentType: "application/json",
|
|
3653
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
3654
|
+
requestType: "json",
|
|
3655
|
+
body: request,
|
|
3656
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
3657
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
3658
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3659
|
+
});
|
|
3660
|
+
if (_response.ok) {
|
|
3661
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
3662
|
+
}
|
|
3663
|
+
if (_response.error.reason === "status-code") {
|
|
3664
|
+
switch (_response.error.statusCode) {
|
|
3665
|
+
case 422:
|
|
3666
|
+
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
3667
|
+
default:
|
|
3668
|
+
throw new errors.SkyvernError({
|
|
3669
|
+
statusCode: _response.error.statusCode,
|
|
3670
|
+
body: _response.error.body,
|
|
3671
|
+
rawResponse: _response.rawResponse,
|
|
3672
|
+
});
|
|
3673
|
+
}
|
|
3674
|
+
}
|
|
3675
|
+
switch (_response.error.reason) {
|
|
3676
|
+
case "non-json":
|
|
3677
|
+
throw new errors.SkyvernError({
|
|
3678
|
+
statusCode: _response.error.statusCode,
|
|
3679
|
+
body: _response.error.rawBody,
|
|
3680
|
+
rawResponse: _response.rawResponse,
|
|
3681
|
+
});
|
|
3682
|
+
case "timeout":
|
|
3683
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /v1/custom-llms.");
|
|
3684
|
+
case "unknown":
|
|
3685
|
+
throw new errors.SkyvernError({
|
|
3686
|
+
message: _response.error.errorMessage,
|
|
3687
|
+
rawResponse: _response.rawResponse,
|
|
3688
|
+
});
|
|
3689
|
+
}
|
|
3690
|
+
});
|
|
3691
|
+
}
|
|
3692
|
+
/**
|
|
3693
|
+
* Update a custom LLM configuration for the current organization.
|
|
3694
|
+
*
|
|
3695
|
+
* @param {string} customLlmId - The custom LLM id.
|
|
3696
|
+
* @param {Skyvern.CustomLlmUpdateRequest} request
|
|
3697
|
+
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
3698
|
+
*
|
|
3699
|
+
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
3700
|
+
*
|
|
3701
|
+
* @example
|
|
3702
|
+
* await client.updateCustomLlm("custom_llm_id", {
|
|
3703
|
+
* config: {
|
|
3704
|
+
* display_name: "display_name",
|
|
3705
|
+
* provider: "openai_compatible",
|
|
3706
|
+
* model_name: "model_name"
|
|
3707
|
+
* }
|
|
3708
|
+
* })
|
|
3709
|
+
*/
|
|
3710
|
+
updateCustomLlm(customLlmId, request, requestOptions) {
|
|
3711
|
+
return core.HttpResponsePromise.fromPromise(this.__updateCustomLlm(customLlmId, request, requestOptions));
|
|
3712
|
+
}
|
|
3713
|
+
__updateCustomLlm(customLlmId, request, requestOptions) {
|
|
3714
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3715
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
3716
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
3717
|
+
const _response = yield core.fetcher({
|
|
3718
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/custom-llms/${core.url.encodePathParam(customLlmId)}`),
|
|
3719
|
+
method: "PUT",
|
|
3720
|
+
headers: _headers,
|
|
3721
|
+
contentType: "application/json",
|
|
3722
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
3723
|
+
requestType: "json",
|
|
3724
|
+
body: request,
|
|
3725
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
3726
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
3727
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3728
|
+
});
|
|
3729
|
+
if (_response.ok) {
|
|
3730
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
3731
|
+
}
|
|
3732
|
+
if (_response.error.reason === "status-code") {
|
|
3733
|
+
switch (_response.error.statusCode) {
|
|
3734
|
+
case 422:
|
|
3735
|
+
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
3736
|
+
default:
|
|
3737
|
+
throw new errors.SkyvernError({
|
|
3738
|
+
statusCode: _response.error.statusCode,
|
|
3739
|
+
body: _response.error.body,
|
|
3740
|
+
rawResponse: _response.rawResponse,
|
|
3741
|
+
});
|
|
3742
|
+
}
|
|
3743
|
+
}
|
|
3744
|
+
switch (_response.error.reason) {
|
|
3745
|
+
case "non-json":
|
|
3746
|
+
throw new errors.SkyvernError({
|
|
3747
|
+
statusCode: _response.error.statusCode,
|
|
3748
|
+
body: _response.error.rawBody,
|
|
3749
|
+
rawResponse: _response.rawResponse,
|
|
3750
|
+
});
|
|
3751
|
+
case "timeout":
|
|
3752
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling PUT /v1/custom-llms/{custom_llm_id}.");
|
|
3753
|
+
case "unknown":
|
|
3754
|
+
throw new errors.SkyvernError({
|
|
3755
|
+
message: _response.error.errorMessage,
|
|
3756
|
+
rawResponse: _response.rawResponse,
|
|
3757
|
+
});
|
|
3758
|
+
}
|
|
3759
|
+
});
|
|
3760
|
+
}
|
|
3761
|
+
/**
|
|
3762
|
+
* Delete a custom LLM configuration for the current organization.
|
|
3763
|
+
*
|
|
3764
|
+
* @param {string} customLlmId - The custom LLM id.
|
|
3765
|
+
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
3766
|
+
*
|
|
3767
|
+
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
3768
|
+
*
|
|
3769
|
+
* @example
|
|
3770
|
+
* await client.deleteCustomLlm("custom_llm_id")
|
|
3771
|
+
*/
|
|
3772
|
+
deleteCustomLlm(customLlmId, requestOptions) {
|
|
3773
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteCustomLlm(customLlmId, requestOptions));
|
|
3774
|
+
}
|
|
3775
|
+
__deleteCustomLlm(customLlmId, requestOptions) {
|
|
3776
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3777
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
3778
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
3779
|
+
const _response = yield core.fetcher({
|
|
3780
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/custom-llms/${core.url.encodePathParam(customLlmId)}`),
|
|
3781
|
+
method: "DELETE",
|
|
3782
|
+
headers: _headers,
|
|
3783
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
3784
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
3785
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
3786
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3787
|
+
});
|
|
3788
|
+
if (_response.ok) {
|
|
3789
|
+
return {
|
|
3790
|
+
data: _response.body,
|
|
3791
|
+
rawResponse: _response.rawResponse,
|
|
3792
|
+
};
|
|
3793
|
+
}
|
|
3794
|
+
if (_response.error.reason === "status-code") {
|
|
3795
|
+
switch (_response.error.statusCode) {
|
|
3796
|
+
case 422:
|
|
3797
|
+
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
3798
|
+
default:
|
|
3799
|
+
throw new errors.SkyvernError({
|
|
3800
|
+
statusCode: _response.error.statusCode,
|
|
3801
|
+
body: _response.error.body,
|
|
3802
|
+
rawResponse: _response.rawResponse,
|
|
3803
|
+
});
|
|
3804
|
+
}
|
|
3805
|
+
}
|
|
3806
|
+
switch (_response.error.reason) {
|
|
3807
|
+
case "non-json":
|
|
3808
|
+
throw new errors.SkyvernError({
|
|
3809
|
+
statusCode: _response.error.statusCode,
|
|
3810
|
+
body: _response.error.rawBody,
|
|
3811
|
+
rawResponse: _response.rawResponse,
|
|
3812
|
+
});
|
|
3813
|
+
case "timeout":
|
|
3814
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling DELETE /v1/custom-llms/{custom_llm_id}.");
|
|
3815
|
+
case "unknown":
|
|
3816
|
+
throw new errors.SkyvernError({
|
|
3817
|
+
message: _response.error.errorMessage,
|
|
3818
|
+
rawResponse: _response.rawResponse,
|
|
3819
|
+
});
|
|
3820
|
+
}
|
|
3821
|
+
});
|
|
3822
|
+
}
|
|
3823
|
+
/**
|
|
3824
|
+
* Log in to a website using either credential stored in Skyvern, Bitwarden, 1Password, or Azure Vault
|
|
3825
|
+
*
|
|
3826
|
+
* @param {Skyvern.LoginRequest} request
|
|
3827
|
+
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
3828
|
+
*
|
|
3829
|
+
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
3830
|
+
*
|
|
3831
|
+
* @example
|
|
3832
|
+
* await client.login({
|
|
3833
|
+
* "x-user-agent": "x-user-agent",
|
|
3834
|
+
* credential_type: "skyvern"
|
|
3835
|
+
* })
|
|
3836
|
+
*/
|
|
3837
|
+
login(request, requestOptions) {
|
|
3838
|
+
return core.HttpResponsePromise.fromPromise(this.__login(request, requestOptions));
|
|
3839
|
+
}
|
|
3840
|
+
__login(request, requestOptions) {
|
|
3841
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3842
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
3843
|
+
const { "x-user-agent": userAgent } = request, _body = __rest(request, ["x-user-agent"]);
|
|
3844
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
3845
|
+
"x-user-agent": userAgent != null ? userAgent : undefined,
|
|
3846
|
+
"x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey,
|
|
3847
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
3848
|
+
const _response = yield core.fetcher({
|
|
3849
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "v1/run/tasks/login"),
|
|
3850
|
+
method: "POST",
|
|
3851
|
+
headers: _headers,
|
|
3852
|
+
contentType: "application/json",
|
|
3853
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
3854
|
+
requestType: "json",
|
|
3855
|
+
body: _body,
|
|
3856
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
3857
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
3858
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3859
|
+
});
|
|
3860
|
+
if (_response.ok) {
|
|
3861
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
3862
|
+
}
|
|
3863
|
+
if (_response.error.reason === "status-code") {
|
|
3864
|
+
switch (_response.error.statusCode) {
|
|
3865
|
+
case 422:
|
|
3866
|
+
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
3867
|
+
default:
|
|
3868
|
+
throw new errors.SkyvernError({
|
|
3869
|
+
statusCode: _response.error.statusCode,
|
|
3870
|
+
body: _response.error.body,
|
|
3871
|
+
rawResponse: _response.rawResponse,
|
|
3872
|
+
});
|
|
3873
|
+
}
|
|
3874
|
+
}
|
|
3875
|
+
switch (_response.error.reason) {
|
|
3876
|
+
case "non-json":
|
|
3877
|
+
throw new errors.SkyvernError({
|
|
3878
|
+
statusCode: _response.error.statusCode,
|
|
3879
|
+
body: _response.error.rawBody,
|
|
3880
|
+
rawResponse: _response.rawResponse,
|
|
3881
|
+
});
|
|
3882
|
+
case "timeout":
|
|
3883
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /v1/run/tasks/login.");
|
|
3884
|
+
case "unknown":
|
|
3885
|
+
throw new errors.SkyvernError({
|
|
3886
|
+
message: _response.error.errorMessage,
|
|
3887
|
+
rawResponse: _response.rawResponse,
|
|
3888
|
+
});
|
|
3889
|
+
}
|
|
3890
|
+
});
|
|
3891
|
+
}
|
|
3892
|
+
/**
|
|
3893
|
+
* Download a file from a website by navigating and clicking download buttons
|
|
3894
|
+
*
|
|
3895
|
+
* @param {Skyvern.DownloadFilesRequest} request
|
|
3896
|
+
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
3897
|
+
*
|
|
3898
|
+
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
3899
|
+
*
|
|
3900
|
+
* @example
|
|
3901
|
+
* await client.downloadFiles({
|
|
3902
|
+
* "x-user-agent": "x-user-agent",
|
|
3903
|
+
* navigation_goal: "navigation_goal"
|
|
3904
|
+
* })
|
|
3905
|
+
*/
|
|
3906
|
+
downloadFiles(request, requestOptions) {
|
|
3907
|
+
return core.HttpResponsePromise.fromPromise(this.__downloadFiles(request, requestOptions));
|
|
3908
|
+
}
|
|
3909
|
+
__downloadFiles(request, requestOptions) {
|
|
3910
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3911
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
3912
|
+
const { "x-user-agent": userAgent } = request, _body = __rest(request, ["x-user-agent"]);
|
|
3913
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
3914
|
+
"x-user-agent": userAgent != null ? userAgent : undefined,
|
|
3915
|
+
"x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey,
|
|
3916
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
3917
|
+
const _response = yield core.fetcher({
|
|
3918
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "v1/run/tasks/download_files"),
|
|
3919
|
+
method: "POST",
|
|
3920
|
+
headers: _headers,
|
|
3921
|
+
contentType: "application/json",
|
|
3922
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
3923
|
+
requestType: "json",
|
|
3924
|
+
body: _body,
|
|
3925
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
3926
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
3927
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3928
|
+
});
|
|
3929
|
+
if (_response.ok) {
|
|
3930
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
3931
|
+
}
|
|
3932
|
+
if (_response.error.reason === "status-code") {
|
|
3933
|
+
switch (_response.error.statusCode) {
|
|
3934
|
+
case 422:
|
|
3935
|
+
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
3936
|
+
default:
|
|
3937
|
+
throw new errors.SkyvernError({
|
|
3938
|
+
statusCode: _response.error.statusCode,
|
|
3939
|
+
body: _response.error.body,
|
|
3940
|
+
rawResponse: _response.rawResponse,
|
|
3941
|
+
});
|
|
3942
|
+
}
|
|
3943
|
+
}
|
|
3944
|
+
switch (_response.error.reason) {
|
|
3945
|
+
case "non-json":
|
|
3946
|
+
throw new errors.SkyvernError({
|
|
3947
|
+
statusCode: _response.error.statusCode,
|
|
3948
|
+
body: _response.error.rawBody,
|
|
3949
|
+
rawResponse: _response.rawResponse,
|
|
3950
|
+
});
|
|
3951
|
+
case "timeout":
|
|
3952
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /v1/run/tasks/download_files.");
|
|
3953
|
+
case "unknown":
|
|
3954
|
+
throw new errors.SkyvernError({
|
|
3955
|
+
message: _response.error.errorMessage,
|
|
3956
|
+
rawResponse: _response.rawResponse,
|
|
3957
|
+
});
|
|
3958
|
+
}
|
|
3959
|
+
});
|
|
3960
|
+
}
|
|
3961
|
+
/**
|
|
3962
|
+
* Retrieves a paginated list of scripts for the current organization
|
|
3963
|
+
*
|
|
3964
|
+
* @param {Skyvern.GetScriptsRequest} request
|
|
3965
|
+
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
3966
|
+
*
|
|
3967
|
+
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
3968
|
+
*
|
|
3969
|
+
* @example
|
|
3970
|
+
* await client.getScripts({
|
|
3971
|
+
* page: 1,
|
|
3972
|
+
* page_size: 10
|
|
3973
|
+
* })
|
|
3974
|
+
*/
|
|
3975
|
+
getScripts(request = {}, requestOptions) {
|
|
3976
|
+
return core.HttpResponsePromise.fromPromise(this.__getScripts(request, requestOptions));
|
|
3977
|
+
}
|
|
3978
|
+
__getScripts() {
|
|
3979
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
3980
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
3981
|
+
const { page, page_size: pageSize } = request;
|
|
3982
|
+
const _queryParams = {};
|
|
3983
|
+
if (page != null) {
|
|
3984
|
+
_queryParams.page = page.toString();
|
|
3985
|
+
}
|
|
3986
|
+
if (pageSize != null) {
|
|
3987
|
+
_queryParams.page_size = pageSize.toString();
|
|
3988
|
+
}
|
|
3989
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
3990
|
+
const _response = yield core.fetcher({
|
|
3991
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "v1/scripts"),
|
|
3992
|
+
method: "GET",
|
|
3993
|
+
headers: _headers,
|
|
3994
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
3995
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
3996
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
3997
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3998
|
+
});
|
|
3999
|
+
if (_response.ok) {
|
|
4000
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4001
|
+
}
|
|
4002
|
+
if (_response.error.reason === "status-code") {
|
|
4003
|
+
switch (_response.error.statusCode) {
|
|
4004
|
+
case 422:
|
|
4005
|
+
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
4006
|
+
default:
|
|
4007
|
+
throw new errors.SkyvernError({
|
|
4008
|
+
statusCode: _response.error.statusCode,
|
|
4009
|
+
body: _response.error.body,
|
|
4010
|
+
rawResponse: _response.rawResponse,
|
|
4011
|
+
});
|
|
4012
|
+
}
|
|
4013
|
+
}
|
|
4014
|
+
switch (_response.error.reason) {
|
|
4015
|
+
case "non-json":
|
|
4016
|
+
throw new errors.SkyvernError({
|
|
4017
|
+
statusCode: _response.error.statusCode,
|
|
4018
|
+
body: _response.error.rawBody,
|
|
4019
|
+
rawResponse: _response.rawResponse,
|
|
4020
|
+
});
|
|
4021
|
+
case "timeout":
|
|
4022
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/scripts.");
|
|
4023
|
+
case "unknown":
|
|
4024
|
+
throw new errors.SkyvernError({
|
|
4025
|
+
message: _response.error.errorMessage,
|
|
4026
|
+
rawResponse: _response.rawResponse,
|
|
4027
|
+
});
|
|
4028
|
+
}
|
|
4029
|
+
});
|
|
4030
|
+
}
|
|
4031
|
+
/**
|
|
4032
|
+
* Create a new script with optional files and metadata
|
|
4033
|
+
*
|
|
4034
|
+
* @param {Skyvern.CreateScriptRequest} request
|
|
4035
|
+
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4036
|
+
*
|
|
4037
|
+
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
4038
|
+
*
|
|
4039
|
+
* @example
|
|
4040
|
+
* await client.createScript()
|
|
4041
|
+
*/
|
|
4042
|
+
createScript(request = {}, requestOptions) {
|
|
4043
|
+
return core.HttpResponsePromise.fromPromise(this.__createScript(request, requestOptions));
|
|
4044
|
+
}
|
|
4045
|
+
__createScript() {
|
|
4046
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
4047
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
4048
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
4049
|
+
const _response = yield core.fetcher({
|
|
4050
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "v1/scripts"),
|
|
4051
|
+
method: "POST",
|
|
4052
|
+
headers: _headers,
|
|
4053
|
+
contentType: "application/json",
|
|
4054
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
4055
|
+
requestType: "json",
|
|
4056
|
+
body: request,
|
|
4057
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
4058
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
4059
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
4060
|
+
});
|
|
4061
|
+
if (_response.ok) {
|
|
4062
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4063
|
+
}
|
|
4064
|
+
if (_response.error.reason === "status-code") {
|
|
4065
|
+
switch (_response.error.statusCode) {
|
|
4066
|
+
case 422:
|
|
4067
|
+
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
4068
|
+
default:
|
|
4069
|
+
throw new errors.SkyvernError({
|
|
4070
|
+
statusCode: _response.error.statusCode,
|
|
4071
|
+
body: _response.error.body,
|
|
4072
|
+
rawResponse: _response.rawResponse,
|
|
4073
|
+
});
|
|
4074
|
+
}
|
|
4075
|
+
}
|
|
4076
|
+
switch (_response.error.reason) {
|
|
4077
|
+
case "non-json":
|
|
4078
|
+
throw new errors.SkyvernError({
|
|
4079
|
+
statusCode: _response.error.statusCode,
|
|
4080
|
+
body: _response.error.rawBody,
|
|
4081
|
+
rawResponse: _response.rawResponse,
|
|
4082
|
+
});
|
|
4083
|
+
case "timeout":
|
|
4084
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /v1/scripts.");
|
|
4085
|
+
case "unknown":
|
|
4086
|
+
throw new errors.SkyvernError({
|
|
4087
|
+
message: _response.error.errorMessage,
|
|
4088
|
+
rawResponse: _response.rawResponse,
|
|
4089
|
+
});
|
|
4090
|
+
}
|
|
4091
|
+
});
|
|
4092
|
+
}
|
|
4093
|
+
/**
|
|
4094
|
+
* Retrieves a specific script by its ID
|
|
4095
|
+
*
|
|
4096
|
+
* @param {string} scriptId - The unique identifier of the script
|
|
4097
|
+
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4098
|
+
*
|
|
4099
|
+
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
4100
|
+
*
|
|
4101
|
+
* @example
|
|
4102
|
+
* await client.getScript("s_abc123")
|
|
4103
|
+
*/
|
|
4104
|
+
getScript(scriptId, requestOptions) {
|
|
4105
|
+
return core.HttpResponsePromise.fromPromise(this.__getScript(scriptId, requestOptions));
|
|
4106
|
+
}
|
|
4107
|
+
__getScript(scriptId, requestOptions) {
|
|
4108
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4109
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
4110
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
4111
|
+
const _response = yield core.fetcher({
|
|
4112
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/scripts/${core.url.encodePathParam(scriptId)}`),
|
|
4113
|
+
method: "GET",
|
|
4114
|
+
headers: _headers,
|
|
4115
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
4116
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
4117
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
4118
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
4119
|
+
});
|
|
4120
|
+
if (_response.ok) {
|
|
4121
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4122
|
+
}
|
|
4123
|
+
if (_response.error.reason === "status-code") {
|
|
4124
|
+
switch (_response.error.statusCode) {
|
|
4125
|
+
case 422:
|
|
4126
|
+
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
4127
|
+
default:
|
|
4128
|
+
throw new errors.SkyvernError({
|
|
4129
|
+
statusCode: _response.error.statusCode,
|
|
4130
|
+
body: _response.error.body,
|
|
4131
|
+
rawResponse: _response.rawResponse,
|
|
4132
|
+
});
|
|
4133
|
+
}
|
|
4134
|
+
}
|
|
4135
|
+
switch (_response.error.reason) {
|
|
4136
|
+
case "non-json":
|
|
4137
|
+
throw new errors.SkyvernError({
|
|
4138
|
+
statusCode: _response.error.statusCode,
|
|
4139
|
+
body: _response.error.rawBody,
|
|
4140
|
+
rawResponse: _response.rawResponse,
|
|
4141
|
+
});
|
|
4142
|
+
case "timeout":
|
|
4143
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/scripts/{script_id}.");
|
|
4144
|
+
case "unknown":
|
|
4145
|
+
throw new errors.SkyvernError({
|
|
4146
|
+
message: _response.error.errorMessage,
|
|
4147
|
+
rawResponse: _response.rawResponse,
|
|
4148
|
+
});
|
|
4149
|
+
}
|
|
4150
|
+
});
|
|
4151
|
+
}
|
|
4152
|
+
/**
|
|
4153
|
+
* Deploy a script with updated files, creating a new version
|
|
4154
|
+
*
|
|
4155
|
+
* @param {string} scriptId - The unique identifier of the script
|
|
4156
|
+
* @param {Skyvern.DeployScriptRequest} request
|
|
4157
|
+
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4158
|
+
*
|
|
4159
|
+
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
4160
|
+
*
|
|
4161
|
+
* @example
|
|
4162
|
+
* await client.deployScript("s_abc123", {
|
|
4163
|
+
* files: [{
|
|
4164
|
+
* path: "src/main.py",
|
|
4165
|
+
* content: "content"
|
|
4166
|
+
* }]
|
|
4167
|
+
* })
|
|
4168
|
+
*/
|
|
4169
|
+
deployScript(scriptId, request, requestOptions) {
|
|
4170
|
+
return core.HttpResponsePromise.fromPromise(this.__deployScript(scriptId, request, requestOptions));
|
|
4171
|
+
}
|
|
4172
|
+
__deployScript(scriptId, request, requestOptions) {
|
|
4173
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4174
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
4175
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
4176
|
+
const _response = yield core.fetcher({
|
|
4177
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/scripts/${core.url.encodePathParam(scriptId)}/deploy`),
|
|
4178
|
+
method: "POST",
|
|
4179
|
+
headers: _headers,
|
|
4180
|
+
contentType: "application/json",
|
|
4181
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
4182
|
+
requestType: "json",
|
|
4183
|
+
body: request,
|
|
4184
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
4185
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
4186
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
4187
|
+
});
|
|
4188
|
+
if (_response.ok) {
|
|
4189
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4190
|
+
}
|
|
4191
|
+
if (_response.error.reason === "status-code") {
|
|
4192
|
+
switch (_response.error.statusCode) {
|
|
4193
|
+
case 422:
|
|
4194
|
+
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
4195
|
+
default:
|
|
4196
|
+
throw new errors.SkyvernError({
|
|
4197
|
+
statusCode: _response.error.statusCode,
|
|
4198
|
+
body: _response.error.body,
|
|
4199
|
+
rawResponse: _response.rawResponse,
|
|
4200
|
+
});
|
|
4201
|
+
}
|
|
4202
|
+
}
|
|
4203
|
+
switch (_response.error.reason) {
|
|
4204
|
+
case "non-json":
|
|
4205
|
+
throw new errors.SkyvernError({
|
|
4206
|
+
statusCode: _response.error.statusCode,
|
|
4207
|
+
body: _response.error.rawBody,
|
|
4208
|
+
rawResponse: _response.rawResponse,
|
|
4209
|
+
});
|
|
4210
|
+
case "timeout":
|
|
4211
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /v1/scripts/{script_id}/deploy.");
|
|
4212
|
+
case "unknown":
|
|
4213
|
+
throw new errors.SkyvernError({
|
|
4214
|
+
message: _response.error.errorMessage,
|
|
4215
|
+
rawResponse: _response.rawResponse,
|
|
4216
|
+
});
|
|
4217
|
+
}
|
|
4218
|
+
});
|
|
4219
|
+
}
|
|
4220
|
+
/**
|
|
4221
|
+
* Execute a single SDK action with the specified parameters
|
|
4222
|
+
*
|
|
4223
|
+
* @param {Skyvern.RunSdkActionRequest} request
|
|
4224
|
+
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4225
|
+
*
|
|
4226
|
+
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
4227
|
+
*
|
|
4228
|
+
* @example
|
|
4229
|
+
* await client.runSdkAction({
|
|
4230
|
+
* url: "url",
|
|
4231
|
+
* action: {
|
|
4232
|
+
* type: "ai_act"
|
|
4233
|
+
* }
|
|
4234
|
+
* })
|
|
4235
|
+
*/
|
|
4236
|
+
runSdkAction(request, requestOptions) {
|
|
4237
|
+
return core.HttpResponsePromise.fromPromise(this.__runSdkAction(request, requestOptions));
|
|
4238
|
+
}
|
|
4239
|
+
__runSdkAction(request, requestOptions) {
|
|
4240
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4241
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
4242
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
4243
|
+
const _response = yield core.fetcher({
|
|
4244
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "v1/sdk/run_action"),
|
|
4245
|
+
method: "POST",
|
|
4246
|
+
headers: _headers,
|
|
4247
|
+
contentType: "application/json",
|
|
4248
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
4249
|
+
requestType: "json",
|
|
4250
|
+
body: request,
|
|
4251
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
4252
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
4253
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
4254
|
+
});
|
|
4255
|
+
if (_response.ok) {
|
|
4256
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4257
|
+
}
|
|
4258
|
+
if (_response.error.reason === "status-code") {
|
|
4259
|
+
switch (_response.error.statusCode) {
|
|
4260
|
+
case 422:
|
|
4261
|
+
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
4262
|
+
default:
|
|
4263
|
+
throw new errors.SkyvernError({
|
|
4264
|
+
statusCode: _response.error.statusCode,
|
|
4265
|
+
body: _response.error.body,
|
|
4266
|
+
rawResponse: _response.rawResponse,
|
|
4267
|
+
});
|
|
4268
|
+
}
|
|
4269
|
+
}
|
|
4270
|
+
switch (_response.error.reason) {
|
|
4271
|
+
case "non-json":
|
|
4272
|
+
throw new errors.SkyvernError({
|
|
4273
|
+
statusCode: _response.error.statusCode,
|
|
4274
|
+
body: _response.error.rawBody,
|
|
4275
|
+
rawResponse: _response.rawResponse,
|
|
4276
|
+
});
|
|
4277
|
+
case "timeout":
|
|
4278
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /v1/sdk/run_action.");
|
|
4279
|
+
case "unknown":
|
|
4280
|
+
throw new errors.SkyvernError({
|
|
4281
|
+
message: _response.error.errorMessage,
|
|
4282
|
+
rawResponse: _response.rawResponse,
|
|
4283
|
+
});
|
|
4284
|
+
}
|
|
4285
|
+
});
|
|
4286
|
+
}
|
|
4287
|
+
/**
|
|
4288
|
+
* Update a workflow's folder assignment for the latest version
|
|
4289
|
+
*
|
|
4290
|
+
* @param {string} workflowPermanentId - Workflow permanent ID
|
|
4291
|
+
* @param {Skyvern.UpdateWorkflowFolderRequest} request
|
|
4292
|
+
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4293
|
+
*
|
|
4294
|
+
* @throws {@link Skyvern.BadRequestError}
|
|
4295
|
+
* @throws {@link Skyvern.NotFoundError}
|
|
4296
|
+
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
4297
|
+
*
|
|
4298
|
+
* @example
|
|
4299
|
+
* await client.updateWorkflowFolder("wpid_123")
|
|
4300
|
+
*/
|
|
4301
|
+
updateWorkflowFolder(workflowPermanentId, request = {}, requestOptions) {
|
|
4302
|
+
return core.HttpResponsePromise.fromPromise(this.__updateWorkflowFolder(workflowPermanentId, request, requestOptions));
|
|
4303
|
+
}
|
|
4304
|
+
__updateWorkflowFolder(workflowPermanentId_1) {
|
|
4305
|
+
return __awaiter(this, arguments, void 0, function* (workflowPermanentId, request = {}, requestOptions) {
|
|
4306
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
4307
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
4308
|
+
const _response = yield core.fetcher({
|
|
4309
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/agents/${core.url.encodePathParam(workflowPermanentId)}/folder`),
|
|
4310
|
+
method: "PUT",
|
|
4311
|
+
headers: _headers,
|
|
4312
|
+
contentType: "application/json",
|
|
4313
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
4314
|
+
requestType: "json",
|
|
4315
|
+
body: request,
|
|
4316
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
4317
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
4318
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
4319
|
+
});
|
|
4320
|
+
if (_response.ok) {
|
|
4321
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4322
|
+
}
|
|
4323
|
+
if (_response.error.reason === "status-code") {
|
|
4324
|
+
switch (_response.error.statusCode) {
|
|
4325
|
+
case 400:
|
|
4326
|
+
throw new Skyvern.BadRequestError(_response.error.body, _response.rawResponse);
|
|
4327
|
+
case 404:
|
|
4328
|
+
throw new Skyvern.NotFoundError(_response.error.body, _response.rawResponse);
|
|
4329
|
+
case 422:
|
|
4330
|
+
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
4331
|
+
default:
|
|
4332
|
+
throw new errors.SkyvernError({
|
|
4333
|
+
statusCode: _response.error.statusCode,
|
|
4334
|
+
body: _response.error.body,
|
|
4335
|
+
rawResponse: _response.rawResponse,
|
|
4336
|
+
});
|
|
4337
|
+
}
|
|
4338
|
+
}
|
|
4339
|
+
switch (_response.error.reason) {
|
|
4340
|
+
case "non-json":
|
|
4341
|
+
throw new errors.SkyvernError({
|
|
4342
|
+
statusCode: _response.error.statusCode,
|
|
4343
|
+
body: _response.error.rawBody,
|
|
4344
|
+
rawResponse: _response.rawResponse,
|
|
4345
|
+
});
|
|
4346
|
+
case "timeout":
|
|
4347
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling PUT /v1/agents/{workflow_permanent_id}/folder.");
|
|
4348
|
+
case "unknown":
|
|
4349
|
+
throw new errors.SkyvernError({
|
|
4350
|
+
message: _response.error.errorMessage,
|
|
4351
|
+
rawResponse: _response.rawResponse,
|
|
4352
|
+
});
|
|
4353
|
+
}
|
|
4354
|
+
});
|
|
4355
|
+
}
|
|
4356
|
+
/**
|
|
4357
|
+
* Get the current tag state for a workflow.
|
|
4358
|
+
*
|
|
4359
|
+
* @param {string} workflowPermanentId - Workflow permanent ID
|
|
4360
|
+
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4361
|
+
*
|
|
4362
|
+
* @throws {@link Skyvern.NotFoundError}
|
|
4363
|
+
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
4364
|
+
*
|
|
4365
|
+
* @example
|
|
4366
|
+
* await client.getWorkflowTags("wpid_123")
|
|
4367
|
+
*/
|
|
4368
|
+
getWorkflowTags(workflowPermanentId, requestOptions) {
|
|
4369
|
+
return core.HttpResponsePromise.fromPromise(this.__getWorkflowTags(workflowPermanentId, requestOptions));
|
|
4370
|
+
}
|
|
4371
|
+
__getWorkflowTags(workflowPermanentId, requestOptions) {
|
|
4372
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4373
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
4374
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
4375
|
+
const _response = yield core.fetcher({
|
|
4376
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/agents/${core.url.encodePathParam(workflowPermanentId)}/tags`),
|
|
4377
|
+
method: "GET",
|
|
4378
|
+
headers: _headers,
|
|
4379
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
4380
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
4381
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
4382
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
4383
|
+
});
|
|
4384
|
+
if (_response.ok) {
|
|
4385
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4386
|
+
}
|
|
4387
|
+
if (_response.error.reason === "status-code") {
|
|
4388
|
+
switch (_response.error.statusCode) {
|
|
4389
|
+
case 404:
|
|
4390
|
+
throw new Skyvern.NotFoundError(_response.error.body, _response.rawResponse);
|
|
4391
|
+
case 422:
|
|
4392
|
+
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
4393
|
+
default:
|
|
4394
|
+
throw new errors.SkyvernError({
|
|
4395
|
+
statusCode: _response.error.statusCode,
|
|
4396
|
+
body: _response.error.body,
|
|
4397
|
+
rawResponse: _response.rawResponse,
|
|
4398
|
+
});
|
|
4399
|
+
}
|
|
4400
|
+
}
|
|
4401
|
+
switch (_response.error.reason) {
|
|
4402
|
+
case "non-json":
|
|
4403
|
+
throw new errors.SkyvernError({
|
|
4404
|
+
statusCode: _response.error.statusCode,
|
|
4405
|
+
body: _response.error.rawBody,
|
|
4406
|
+
rawResponse: _response.rawResponse,
|
|
4407
|
+
});
|
|
4408
|
+
case "timeout":
|
|
4409
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/agents/{workflow_permanent_id}/tags.");
|
|
4410
|
+
case "unknown":
|
|
4411
|
+
throw new errors.SkyvernError({
|
|
4412
|
+
message: _response.error.errorMessage,
|
|
4413
|
+
rawResponse: _response.rawResponse,
|
|
4414
|
+
});
|
|
4415
|
+
}
|
|
4416
|
+
});
|
|
4417
|
+
}
|
|
4418
|
+
/**
|
|
4419
|
+
* Atomically apply tag changes to a workflow. Sets and deletes happen in one transaction; same-key collisions resolve set-wins.
|
|
4420
|
+
*
|
|
4421
|
+
* @param {string} workflowPermanentId - Workflow permanent ID
|
|
4422
|
+
* @param {Skyvern.TagApplyRequest} request
|
|
4423
|
+
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4424
|
+
*
|
|
4425
|
+
* @throws {@link Skyvern.NotFoundError}
|
|
4426
|
+
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
4427
|
+
*
|
|
4428
|
+
* @example
|
|
4429
|
+
* await client.applyWorkflowTags("wpid_123", {})
|
|
4430
|
+
*/
|
|
4431
|
+
applyWorkflowTags(workflowPermanentId, request, requestOptions) {
|
|
4432
|
+
return core.HttpResponsePromise.fromPromise(this.__applyWorkflowTags(workflowPermanentId, request, requestOptions));
|
|
4433
|
+
}
|
|
4434
|
+
__applyWorkflowTags(workflowPermanentId, request, requestOptions) {
|
|
4435
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4436
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
4437
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
4438
|
+
const _response = yield core.fetcher({
|
|
4439
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/agents/${core.url.encodePathParam(workflowPermanentId)}/tags`),
|
|
4440
|
+
method: "POST",
|
|
4441
|
+
headers: _headers,
|
|
4442
|
+
contentType: "application/json",
|
|
4443
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
4444
|
+
requestType: "json",
|
|
4445
|
+
body: request,
|
|
4446
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
4447
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
4448
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
4449
|
+
});
|
|
4450
|
+
if (_response.ok) {
|
|
4451
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4452
|
+
}
|
|
4453
|
+
if (_response.error.reason === "status-code") {
|
|
4454
|
+
switch (_response.error.statusCode) {
|
|
4455
|
+
case 404:
|
|
4456
|
+
throw new Skyvern.NotFoundError(_response.error.body, _response.rawResponse);
|
|
4457
|
+
case 422:
|
|
4458
|
+
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
4459
|
+
default:
|
|
4460
|
+
throw new errors.SkyvernError({
|
|
4461
|
+
statusCode: _response.error.statusCode,
|
|
4462
|
+
body: _response.error.body,
|
|
4463
|
+
rawResponse: _response.rawResponse,
|
|
4464
|
+
});
|
|
4465
|
+
}
|
|
4466
|
+
}
|
|
4467
|
+
switch (_response.error.reason) {
|
|
4468
|
+
case "non-json":
|
|
4469
|
+
throw new errors.SkyvernError({
|
|
4470
|
+
statusCode: _response.error.statusCode,
|
|
4471
|
+
body: _response.error.rawBody,
|
|
4472
|
+
rawResponse: _response.rawResponse,
|
|
4473
|
+
});
|
|
4474
|
+
case "timeout":
|
|
4475
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /v1/agents/{workflow_permanent_id}/tags.");
|
|
4476
|
+
case "unknown":
|
|
4477
|
+
throw new errors.SkyvernError({
|
|
4478
|
+
message: _response.error.errorMessage,
|
|
4479
|
+
rawResponse: _response.rawResponse,
|
|
4480
|
+
});
|
|
4481
|
+
}
|
|
4482
|
+
});
|
|
4483
|
+
}
|
|
4484
|
+
/**
|
|
4485
|
+
* Soft-delete a single tag from a workflow. Writes a DELETE event row.
|
|
4486
|
+
*
|
|
4487
|
+
* @param {string} workflowPermanentId - Workflow permanent ID
|
|
4488
|
+
* @param {string} key - Tag key to delete
|
|
4489
|
+
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4490
|
+
*
|
|
4491
|
+
* @throws {@link Skyvern.NotFoundError}
|
|
4492
|
+
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
4493
|
+
*
|
|
4494
|
+
* @example
|
|
4495
|
+
* await client.deleteWorkflowTag("wpid_123", "env")
|
|
4496
|
+
*/
|
|
4497
|
+
deleteWorkflowTag(workflowPermanentId, key, requestOptions) {
|
|
4498
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteWorkflowTag(workflowPermanentId, key, requestOptions));
|
|
4499
|
+
}
|
|
4500
|
+
__deleteWorkflowTag(workflowPermanentId, key, requestOptions) {
|
|
4501
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4502
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
4503
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
4504
|
+
const _response = yield core.fetcher({
|
|
4505
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/agents/${core.url.encodePathParam(workflowPermanentId)}/tags/${core.url.encodePathParam(key)}`),
|
|
4506
|
+
method: "DELETE",
|
|
4507
|
+
headers: _headers,
|
|
4508
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
4509
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
4510
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
4511
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
4512
|
+
});
|
|
4513
|
+
if (_response.ok) {
|
|
4514
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4515
|
+
}
|
|
4516
|
+
if (_response.error.reason === "status-code") {
|
|
4517
|
+
switch (_response.error.statusCode) {
|
|
4518
|
+
case 404:
|
|
4519
|
+
throw new Skyvern.NotFoundError(_response.error.body, _response.rawResponse);
|
|
4520
|
+
case 422:
|
|
4521
|
+
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
4522
|
+
default:
|
|
4523
|
+
throw new errors.SkyvernError({
|
|
4524
|
+
statusCode: _response.error.statusCode,
|
|
4525
|
+
body: _response.error.body,
|
|
4526
|
+
rawResponse: _response.rawResponse,
|
|
4527
|
+
});
|
|
4528
|
+
}
|
|
4529
|
+
}
|
|
4530
|
+
switch (_response.error.reason) {
|
|
4531
|
+
case "non-json":
|
|
4532
|
+
throw new errors.SkyvernError({
|
|
4533
|
+
statusCode: _response.error.statusCode,
|
|
4534
|
+
body: _response.error.rawBody,
|
|
4535
|
+
rawResponse: _response.rawResponse,
|
|
4536
|
+
});
|
|
4537
|
+
case "timeout":
|
|
4538
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling DELETE /v1/agents/{workflow_permanent_id}/tags/{key}.");
|
|
4539
|
+
case "unknown":
|
|
4540
|
+
throw new errors.SkyvernError({
|
|
4541
|
+
message: _response.error.errorMessage,
|
|
4542
|
+
rawResponse: _response.rawResponse,
|
|
4543
|
+
});
|
|
4544
|
+
}
|
|
4545
|
+
});
|
|
4546
|
+
}
|
|
4547
|
+
/**
|
|
4548
|
+
* Chronological tag-event log for a workflow (newest first). Includes SET and DELETE events.
|
|
4549
|
+
*
|
|
4550
|
+
* @param {string} workflowPermanentId - Workflow permanent ID
|
|
4551
|
+
* @param {Skyvern.GetWorkflowTagHistoryRequest} request
|
|
4552
|
+
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4553
|
+
*
|
|
4554
|
+
* @throws {@link Skyvern.NotFoundError}
|
|
4555
|
+
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
4556
|
+
*
|
|
4557
|
+
* @example
|
|
4558
|
+
* await client.getWorkflowTagHistory("wpid_123", {
|
|
4559
|
+
* limit: 1,
|
|
4560
|
+
* since: "2024-01-15T09:30:00Z",
|
|
4561
|
+
* key: "key"
|
|
4562
|
+
* })
|
|
4563
|
+
*/
|
|
4564
|
+
getWorkflowTagHistory(workflowPermanentId, request = {}, requestOptions) {
|
|
4565
|
+
return core.HttpResponsePromise.fromPromise(this.__getWorkflowTagHistory(workflowPermanentId, request, requestOptions));
|
|
4566
|
+
}
|
|
4567
|
+
__getWorkflowTagHistory(workflowPermanentId_1) {
|
|
4568
|
+
return __awaiter(this, arguments, void 0, function* (workflowPermanentId, request = {}, requestOptions) {
|
|
4569
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
4570
|
+
const { limit, since, key } = request;
|
|
4571
|
+
const _queryParams = {};
|
|
4572
|
+
if (limit != null) {
|
|
4573
|
+
_queryParams.limit = limit.toString();
|
|
4574
|
+
}
|
|
4575
|
+
if (since != null) {
|
|
4576
|
+
_queryParams.since = since;
|
|
4577
|
+
}
|
|
4578
|
+
if (key != null) {
|
|
4579
|
+
_queryParams.key = key;
|
|
4580
|
+
}
|
|
4581
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
4582
|
+
const _response = yield core.fetcher({
|
|
4583
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/agents/${core.url.encodePathParam(workflowPermanentId)}/tags/history`),
|
|
4584
|
+
method: "GET",
|
|
4585
|
+
headers: _headers,
|
|
4586
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
4587
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
4588
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
4589
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
4590
|
+
});
|
|
4591
|
+
if (_response.ok) {
|
|
4592
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4593
|
+
}
|
|
4594
|
+
if (_response.error.reason === "status-code") {
|
|
4595
|
+
switch (_response.error.statusCode) {
|
|
4596
|
+
case 404:
|
|
4597
|
+
throw new Skyvern.NotFoundError(_response.error.body, _response.rawResponse);
|
|
4598
|
+
case 422:
|
|
4599
|
+
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
4600
|
+
default:
|
|
4601
|
+
throw new errors.SkyvernError({
|
|
4602
|
+
statusCode: _response.error.statusCode,
|
|
4603
|
+
body: _response.error.body,
|
|
4604
|
+
rawResponse: _response.rawResponse,
|
|
4605
|
+
});
|
|
4606
|
+
}
|
|
4607
|
+
}
|
|
4608
|
+
switch (_response.error.reason) {
|
|
4609
|
+
case "non-json":
|
|
4610
|
+
throw new errors.SkyvernError({
|
|
4611
|
+
statusCode: _response.error.statusCode,
|
|
4612
|
+
body: _response.error.rawBody,
|
|
4613
|
+
rawResponse: _response.rawResponse,
|
|
4614
|
+
});
|
|
4615
|
+
case "timeout":
|
|
4616
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/agents/{workflow_permanent_id}/tags/history.");
|
|
4617
|
+
case "unknown":
|
|
4618
|
+
throw new errors.SkyvernError({
|
|
4619
|
+
message: _response.error.errorMessage,
|
|
4620
|
+
rawResponse: _response.rawResponse,
|
|
4621
|
+
});
|
|
4622
|
+
}
|
|
4623
|
+
});
|
|
4624
|
+
}
|
|
4625
|
+
/**
|
|
4626
|
+
* Retry a workflow run using the original run parameters.
|
|
4627
|
+
*
|
|
4628
|
+
* @param {string} workflowRunId - The id of the workflow run to retry.
|
|
4629
|
+
* @param {Skyvern.RetryWorkflowRunRequest} request
|
|
4630
|
+
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4631
|
+
*
|
|
4632
|
+
* @throws {@link Skyvern.BadRequestError}
|
|
4633
|
+
* @throws {@link Skyvern.NotFoundError}
|
|
4634
|
+
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
4635
|
+
*
|
|
4636
|
+
* @example
|
|
4637
|
+
* await client.retryWorkflowRun("wr_123", {
|
|
4638
|
+
* "x-max-steps-override": 1,
|
|
4639
|
+
* "x-user-agent": "x-user-agent"
|
|
4640
|
+
* })
|
|
4641
|
+
*/
|
|
4642
|
+
retryWorkflowRun(workflowRunId, request = {}, requestOptions) {
|
|
4643
|
+
return core.HttpResponsePromise.fromPromise(this.__retryWorkflowRun(workflowRunId, request, requestOptions));
|
|
4644
|
+
}
|
|
4645
|
+
__retryWorkflowRun(workflowRunId_1) {
|
|
4646
|
+
return __awaiter(this, arguments, void 0, function* (workflowRunId, request = {}, requestOptions) {
|
|
4647
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
4648
|
+
const { "x-max-steps-override": maxStepsOverride, "x-user-agent": userAgent } = request;
|
|
4649
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
4650
|
+
"x-max-steps-override": maxStepsOverride != null ? maxStepsOverride.toString() : undefined,
|
|
4651
|
+
"x-user-agent": userAgent != null ? userAgent : undefined,
|
|
4652
|
+
"x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey,
|
|
4653
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
4654
|
+
const _response = yield core.fetcher({
|
|
4655
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/agents/runs/${core.url.encodePathParam(workflowRunId)}/retry`),
|
|
4656
|
+
method: "POST",
|
|
4657
|
+
headers: _headers,
|
|
4658
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
4659
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
4660
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
4661
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
4662
|
+
});
|
|
4663
|
+
if (_response.ok) {
|
|
4664
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4665
|
+
}
|
|
4666
|
+
if (_response.error.reason === "status-code") {
|
|
4667
|
+
switch (_response.error.statusCode) {
|
|
4668
|
+
case 400:
|
|
4669
|
+
throw new Skyvern.BadRequestError(_response.error.body, _response.rawResponse);
|
|
4670
|
+
case 404:
|
|
4671
|
+
throw new Skyvern.NotFoundError(_response.error.body, _response.rawResponse);
|
|
4672
|
+
case 422:
|
|
4673
|
+
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
4674
|
+
default:
|
|
4675
|
+
throw new errors.SkyvernError({
|
|
4676
|
+
statusCode: _response.error.statusCode,
|
|
4677
|
+
body: _response.error.body,
|
|
4678
|
+
rawResponse: _response.rawResponse,
|
|
4679
|
+
});
|
|
4680
|
+
}
|
|
4681
|
+
}
|
|
4682
|
+
switch (_response.error.reason) {
|
|
4683
|
+
case "non-json":
|
|
4684
|
+
throw new errors.SkyvernError({
|
|
4685
|
+
statusCode: _response.error.statusCode,
|
|
4686
|
+
body: _response.error.rawBody,
|
|
4687
|
+
rawResponse: _response.rawResponse,
|
|
4688
|
+
});
|
|
4689
|
+
case "timeout":
|
|
4690
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /v1/agents/runs/{workflow_run_id}/retry.");
|
|
4691
|
+
case "unknown":
|
|
4692
|
+
throw new errors.SkyvernError({
|
|
4693
|
+
message: _response.error.errorMessage,
|
|
4694
|
+
rawResponse: _response.rawResponse,
|
|
4695
|
+
});
|
|
4696
|
+
}
|
|
4697
|
+
});
|
|
4698
|
+
}
|
|
4699
|
+
/**
|
|
4700
|
+
* List workflow runs across all workflows for the current organization.
|
|
4701
|
+
*
|
|
4702
|
+
* Results are paginated and can be filtered by **status**, **search_key**, and **error_code**. All filters are combined with **AND** logic — a run must match every supplied filter to be returned.
|
|
4703
|
+
*
|
|
4704
|
+
* ### search_key
|
|
4705
|
+
*
|
|
4706
|
+
* A case-insensitive substring search that matches against **any** of the following fields:
|
|
4707
|
+
*
|
|
4708
|
+
* | Searched field | Description |
|
|
4709
|
+
* |---|---|
|
|
4710
|
+
* | `workflow_run_id` | The unique run identifier (e.g. `wr_123…`) |
|
|
4711
|
+
* | Parameter **key** | The `key` of any workflow parameter definition associated with the run |
|
|
4712
|
+
* | Parameter **description** | The `description` of any workflow parameter definition |
|
|
4713
|
+
* | Run parameter **value** | The actual value supplied for any parameter when the run was created |
|
|
4714
|
+
* | `extra_http_headers` | Extra HTTP headers attached to the run (searched as raw JSON text) |
|
|
4715
|
+
*
|
|
4716
|
+
* Soft-deleted parameter definitions are excluded from key/description matching. A run is returned if **any** of the fields above contain the search term.
|
|
4717
|
+
*
|
|
4718
|
+
* ### error_code
|
|
4719
|
+
*
|
|
4720
|
+
* An **exact-match** filter against the `error_code` field inside each task's `errors` JSON array. A run matches if **any** of its tasks contains an error object with a matching `error_code` value. Error codes are user-defined strings set during workflow execution (e.g. `INVALID_CREDENTIALS`, `LOGIN_FAILED`, `CAPTCHA_DETECTED`).
|
|
4721
|
+
*
|
|
4722
|
+
* ### Combining filters
|
|
4723
|
+
*
|
|
4724
|
+
* All query parameters use AND logic:
|
|
4725
|
+
* - `?status=failed` — only failed runs
|
|
4726
|
+
* - `?status=failed&error_code=LOGIN_FAILED` — failed runs **and** have a LOGIN_FAILED error
|
|
4727
|
+
* - `?status=failed&error_code=LOGIN_FAILED&search_key=prod_credential` — all three conditions must match
|
|
4728
|
+
*
|
|
4729
|
+
* @param {Skyvern.GetWorkflowRunsRequest} request
|
|
4730
|
+
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4731
|
+
*
|
|
4732
|
+
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
4733
|
+
*
|
|
4734
|
+
* @example
|
|
4735
|
+
* await client.getWorkflowRuns({
|
|
4736
|
+
* page: 1,
|
|
4737
|
+
* page_size: 1,
|
|
4738
|
+
* search_key: "search_key",
|
|
4739
|
+
* error_code: "error_code"
|
|
4740
|
+
* })
|
|
4741
|
+
*/
|
|
4742
|
+
getWorkflowRuns(request = {}, requestOptions) {
|
|
4743
|
+
return core.HttpResponsePromise.fromPromise(this.__getWorkflowRuns(request, requestOptions));
|
|
4744
|
+
}
|
|
4745
|
+
__getWorkflowRuns() {
|
|
4746
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
4747
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
4748
|
+
const { page, page_size: pageSize, status, search_key: searchKey, error_code: errorCode } = request;
|
|
4749
|
+
const _queryParams = {};
|
|
4750
|
+
if (page != null) {
|
|
4751
|
+
_queryParams.page = page.toString();
|
|
4752
|
+
}
|
|
4753
|
+
if (pageSize != null) {
|
|
4754
|
+
_queryParams.page_size = pageSize.toString();
|
|
4755
|
+
}
|
|
4756
|
+
if (status != null) {
|
|
4757
|
+
if (Array.isArray(status)) {
|
|
4758
|
+
_queryParams.status = status.map((item) => item);
|
|
4759
|
+
}
|
|
4760
|
+
else {
|
|
4761
|
+
_queryParams.status = status;
|
|
4762
|
+
}
|
|
4763
|
+
}
|
|
4764
|
+
if (searchKey != null) {
|
|
4765
|
+
_queryParams.search_key = searchKey;
|
|
4766
|
+
}
|
|
4767
|
+
if (errorCode != null) {
|
|
4768
|
+
_queryParams.error_code = errorCode;
|
|
4769
|
+
}
|
|
4770
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
4771
|
+
const _response = yield core.fetcher({
|
|
4772
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "v1/agents/runs"),
|
|
4773
|
+
method: "GET",
|
|
4774
|
+
headers: _headers,
|
|
4775
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
4776
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
4777
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
4778
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
4779
|
+
});
|
|
4780
|
+
if (_response.ok) {
|
|
4781
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4782
|
+
}
|
|
4783
|
+
if (_response.error.reason === "status-code") {
|
|
4784
|
+
switch (_response.error.statusCode) {
|
|
4785
|
+
case 422:
|
|
4786
|
+
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
4787
|
+
default:
|
|
4788
|
+
throw new errors.SkyvernError({
|
|
4789
|
+
statusCode: _response.error.statusCode,
|
|
4790
|
+
body: _response.error.body,
|
|
4791
|
+
rawResponse: _response.rawResponse,
|
|
4792
|
+
});
|
|
4793
|
+
}
|
|
4794
|
+
}
|
|
4795
|
+
switch (_response.error.reason) {
|
|
4796
|
+
case "non-json":
|
|
4797
|
+
throw new errors.SkyvernError({
|
|
4798
|
+
statusCode: _response.error.statusCode,
|
|
4799
|
+
body: _response.error.rawBody,
|
|
4800
|
+
rawResponse: _response.rawResponse,
|
|
4801
|
+
});
|
|
4802
|
+
case "timeout":
|
|
4803
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/agents/runs.");
|
|
4804
|
+
case "unknown":
|
|
4805
|
+
throw new errors.SkyvernError({
|
|
4806
|
+
message: _response.error.errorMessage,
|
|
4807
|
+
rawResponse: _response.rawResponse,
|
|
4808
|
+
});
|
|
4809
|
+
}
|
|
4810
|
+
});
|
|
4811
|
+
}
|
|
4812
|
+
/**
|
|
4813
|
+
* List runs for a specific workflow.
|
|
4814
|
+
*
|
|
4815
|
+
* Supports filtering by **status**, **search_key**, and **error_code**. All filters are combined with **AND** logic.
|
|
4816
|
+
*
|
|
4817
|
+
* ### search_key
|
|
4818
|
+
*
|
|
4819
|
+
* Case-insensitive substring search across: workflow run ID, parameter key, parameter description, run parameter value, and extra HTTP headers. Soft-deleted parameter definitions are excluded.
|
|
4820
|
+
*
|
|
4821
|
+
* ### error_code
|
|
4822
|
+
*
|
|
4823
|
+
* Exact-match filter on the `error_code` field inside each task's `errors` JSON array. A run matches if any of its tasks contains an error with a matching `error_code`.
|
|
4824
|
+
*
|
|
4825
|
+
* @param {string} workflowId
|
|
4826
|
+
* @param {Skyvern.GetWorkflowRunsByIdRequest} request
|
|
4827
|
+
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4828
|
+
*
|
|
4829
|
+
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
4830
|
+
*
|
|
4831
|
+
* @example
|
|
4832
|
+
* await client.getWorkflowRunsById("workflow_id", {
|
|
4833
|
+
* page: 1,
|
|
4834
|
+
* page_size: 1,
|
|
4835
|
+
* search_key: "search_key",
|
|
4836
|
+
* error_code: "error_code",
|
|
4837
|
+
* created_at_start: "2024-01-15T09:30:00Z",
|
|
4838
|
+
* created_at_end: "2024-01-15T09:30:00Z"
|
|
4839
|
+
* })
|
|
4840
|
+
*/
|
|
4841
|
+
getWorkflowRunsById(workflowId, request = {}, requestOptions) {
|
|
4842
|
+
return core.HttpResponsePromise.fromPromise(this.__getWorkflowRunsById(workflowId, request, requestOptions));
|
|
4843
|
+
}
|
|
4844
|
+
__getWorkflowRunsById(workflowId_1) {
|
|
4845
|
+
return __awaiter(this, arguments, void 0, function* (workflowId, request = {}, requestOptions) {
|
|
4846
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
4847
|
+
const { page, page_size: pageSize, status, search_key: searchKey, error_code: errorCode, created_at_start: createdAtStart, created_at_end: createdAtEnd, } = request;
|
|
4848
|
+
const _queryParams = {};
|
|
4849
|
+
if (page != null) {
|
|
4850
|
+
_queryParams.page = page.toString();
|
|
4851
|
+
}
|
|
4852
|
+
if (pageSize != null) {
|
|
4853
|
+
_queryParams.page_size = pageSize.toString();
|
|
4854
|
+
}
|
|
4855
|
+
if (status != null) {
|
|
4856
|
+
if (Array.isArray(status)) {
|
|
4857
|
+
_queryParams.status = status.map((item) => item);
|
|
4858
|
+
}
|
|
4859
|
+
else {
|
|
4860
|
+
_queryParams.status = status;
|
|
4861
|
+
}
|
|
4862
|
+
}
|
|
4863
|
+
if (searchKey != null) {
|
|
4864
|
+
_queryParams.search_key = searchKey;
|
|
4865
|
+
}
|
|
4866
|
+
if (errorCode != null) {
|
|
4867
|
+
_queryParams.error_code = errorCode;
|
|
4868
|
+
}
|
|
4869
|
+
if (createdAtStart != null) {
|
|
4870
|
+
_queryParams.created_at_start = createdAtStart;
|
|
4871
|
+
}
|
|
4872
|
+
if (createdAtEnd != null) {
|
|
4873
|
+
_queryParams.created_at_end = createdAtEnd;
|
|
4874
|
+
}
|
|
4875
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
4876
|
+
const _response = yield core.fetcher({
|
|
4877
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/agents/${core.url.encodePathParam(workflowId)}/runs`),
|
|
4878
|
+
method: "GET",
|
|
4879
|
+
headers: _headers,
|
|
4880
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
4881
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
4882
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
4883
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
4884
|
+
});
|
|
4885
|
+
if (_response.ok) {
|
|
4886
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4887
|
+
}
|
|
4888
|
+
if (_response.error.reason === "status-code") {
|
|
4889
|
+
switch (_response.error.statusCode) {
|
|
4890
|
+
case 422:
|
|
4891
|
+
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
4892
|
+
default:
|
|
4893
|
+
throw new errors.SkyvernError({
|
|
4894
|
+
statusCode: _response.error.statusCode,
|
|
4895
|
+
body: _response.error.body,
|
|
4896
|
+
rawResponse: _response.rawResponse,
|
|
4897
|
+
});
|
|
4898
|
+
}
|
|
4899
|
+
}
|
|
4900
|
+
switch (_response.error.reason) {
|
|
4901
|
+
case "non-json":
|
|
4902
|
+
throw new errors.SkyvernError({
|
|
4903
|
+
statusCode: _response.error.statusCode,
|
|
4904
|
+
body: _response.error.rawBody,
|
|
4905
|
+
rawResponse: _response.rawResponse,
|
|
4906
|
+
});
|
|
4907
|
+
case "timeout":
|
|
4908
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/agents/{workflow_id}/runs.");
|
|
4909
|
+
case "unknown":
|
|
4910
|
+
throw new errors.SkyvernError({
|
|
4911
|
+
message: _response.error.errorMessage,
|
|
4912
|
+
rawResponse: _response.rawResponse,
|
|
4913
|
+
});
|
|
4914
|
+
}
|
|
4915
|
+
});
|
|
4916
|
+
}
|
|
4917
|
+
/**
|
|
4918
|
+
* @param {string} workflowPermanentId
|
|
4919
|
+
* @param {Skyvern.GetWorkflowRequest} request
|
|
4920
|
+
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4921
|
+
*
|
|
4922
|
+
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
4923
|
+
*
|
|
4924
|
+
* @example
|
|
4925
|
+
* await client.getWorkflow("workflow_permanent_id", {
|
|
4926
|
+
* version: 1,
|
|
4927
|
+
* template: true
|
|
4928
|
+
* })
|
|
4929
|
+
*/
|
|
4930
|
+
getWorkflow(workflowPermanentId, request = {}, requestOptions) {
|
|
4931
|
+
return core.HttpResponsePromise.fromPromise(this.__getWorkflow(workflowPermanentId, request, requestOptions));
|
|
4932
|
+
}
|
|
4933
|
+
__getWorkflow(workflowPermanentId_1) {
|
|
4934
|
+
return __awaiter(this, arguments, void 0, function* (workflowPermanentId, request = {}, requestOptions) {
|
|
4935
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
4936
|
+
const { version, template } = request;
|
|
4937
|
+
const _queryParams = {};
|
|
4938
|
+
if (version != null) {
|
|
4939
|
+
_queryParams.version = version.toString();
|
|
4940
|
+
}
|
|
4941
|
+
if (template != null) {
|
|
4942
|
+
_queryParams.template = template.toString();
|
|
4943
|
+
}
|
|
4944
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
4945
|
+
const _response = yield core.fetcher({
|
|
4946
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/agents/${core.url.encodePathParam(workflowPermanentId)}`),
|
|
4947
|
+
method: "GET",
|
|
4948
|
+
headers: _headers,
|
|
4949
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
4950
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
4951
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
4952
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
4953
|
+
});
|
|
4954
|
+
if (_response.ok) {
|
|
4955
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4956
|
+
}
|
|
4957
|
+
if (_response.error.reason === "status-code") {
|
|
4958
|
+
switch (_response.error.statusCode) {
|
|
4959
|
+
case 422:
|
|
4960
|
+
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
4961
|
+
default:
|
|
4962
|
+
throw new errors.SkyvernError({
|
|
4963
|
+
statusCode: _response.error.statusCode,
|
|
4964
|
+
body: _response.error.body,
|
|
4965
|
+
rawResponse: _response.rawResponse,
|
|
4966
|
+
});
|
|
4967
|
+
}
|
|
4968
|
+
}
|
|
4969
|
+
switch (_response.error.reason) {
|
|
4970
|
+
case "non-json":
|
|
4971
|
+
throw new errors.SkyvernError({
|
|
4972
|
+
statusCode: _response.error.statusCode,
|
|
4973
|
+
body: _response.error.rawBody,
|
|
4974
|
+
rawResponse: _response.rawResponse,
|
|
4975
|
+
});
|
|
4976
|
+
case "timeout":
|
|
4977
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/agents/{workflow_permanent_id}.");
|
|
4978
|
+
case "unknown":
|
|
4979
|
+
throw new errors.SkyvernError({
|
|
4980
|
+
message: _response.error.errorMessage,
|
|
4981
|
+
rawResponse: _response.rawResponse,
|
|
4982
|
+
});
|
|
4983
|
+
}
|
|
4984
|
+
});
|
|
4985
|
+
}
|
|
4986
|
+
/**
|
|
4987
|
+
* Get all versions of a workflow by its permanent ID.
|
|
4988
|
+
*
|
|
4989
|
+
* @param {string} workflowPermanentId
|
|
4990
|
+
* @param {Skyvern.GetWorkflowVersionsRequest} request
|
|
4991
|
+
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4992
|
+
*
|
|
4993
|
+
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
4994
|
+
*
|
|
4995
|
+
* @example
|
|
4996
|
+
* await client.getWorkflowVersions("workflow_permanent_id", {
|
|
4997
|
+
* template: true
|
|
4998
|
+
* })
|
|
4999
|
+
*/
|
|
5000
|
+
getWorkflowVersions(workflowPermanentId, request = {}, requestOptions) {
|
|
5001
|
+
return core.HttpResponsePromise.fromPromise(this.__getWorkflowVersions(workflowPermanentId, request, requestOptions));
|
|
5002
|
+
}
|
|
5003
|
+
__getWorkflowVersions(workflowPermanentId_1) {
|
|
5004
|
+
return __awaiter(this, arguments, void 0, function* (workflowPermanentId, request = {}, requestOptions) {
|
|
5005
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
5006
|
+
const { template } = request;
|
|
5007
|
+
const _queryParams = {};
|
|
5008
|
+
if (template != null) {
|
|
5009
|
+
_queryParams.template = template.toString();
|
|
5010
|
+
}
|
|
5011
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
5012
|
+
const _response = yield core.fetcher({
|
|
5013
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, `v1/agents/${core.url.encodePathParam(workflowPermanentId)}/versions`),
|
|
5014
|
+
method: "GET",
|
|
5015
|
+
headers: _headers,
|
|
5016
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
5017
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
5018
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
5019
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
5020
|
+
});
|
|
5021
|
+
if (_response.ok) {
|
|
5022
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
5023
|
+
}
|
|
5024
|
+
if (_response.error.reason === "status-code") {
|
|
5025
|
+
switch (_response.error.statusCode) {
|
|
5026
|
+
case 422:
|
|
5027
|
+
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
5028
|
+
default:
|
|
5029
|
+
throw new errors.SkyvernError({
|
|
5030
|
+
statusCode: _response.error.statusCode,
|
|
5031
|
+
body: _response.error.body,
|
|
5032
|
+
rawResponse: _response.rawResponse,
|
|
5033
|
+
});
|
|
5034
|
+
}
|
|
5035
|
+
}
|
|
5036
|
+
switch (_response.error.reason) {
|
|
5037
|
+
case "non-json":
|
|
5038
|
+
throw new errors.SkyvernError({
|
|
5039
|
+
statusCode: _response.error.statusCode,
|
|
5040
|
+
body: _response.error.rawBody,
|
|
5041
|
+
rawResponse: _response.rawResponse,
|
|
5042
|
+
});
|
|
5043
|
+
case "timeout":
|
|
5044
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/agents/{workflow_permanent_id}/versions.");
|
|
3249
5045
|
case "unknown":
|
|
3250
5046
|
throw new errors.SkyvernError({
|
|
3251
5047
|
message: _response.error.errorMessage,
|