@skyvern/client 1.0.12 → 1.0.14
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/dist/cjs/Client.d.ts +97 -0
- package/dist/cjs/Client.js +321 -2
- package/dist/cjs/api/client/requests/GetWorkflowRequest.d.ts +11 -0
- package/dist/cjs/api/client/requests/GetWorkflowRunsRequest.d.ts +22 -0
- package/dist/cjs/api/client/requests/GetWorkflowRunsRequest.js +3 -0
- package/dist/cjs/api/client/requests/GetWorkflowVersionsRequest.d.ts +9 -0
- package/dist/cjs/api/client/requests/GetWorkflowVersionsRequest.js +3 -0
- package/dist/cjs/api/client/requests/GetWorkflowsRequest.d.ts +2 -2
- package/dist/cjs/api/client/requests/index.d.ts +3 -1
- package/dist/cjs/api/types/Action.d.ts +1 -0
- package/dist/cjs/api/types/BillingStateResponse.d.ts +1 -0
- package/dist/cjs/api/{client/requests → types}/CreateCredentialRequest.d.ts +2 -11
- package/dist/cjs/api/types/CreateCredentialRequest.js +3 -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/ValidationError.d.ts +2 -0
- package/dist/cjs/api/types/WorkflowRun.d.ts +37 -0
- package/dist/cjs/api/types/WorkflowRun.js +3 -0
- package/dist/cjs/api/types/WorkflowRunStatus.d.ts +12 -0
- package/dist/cjs/api/types/WorkflowRunStatus.js +15 -0
- package/dist/cjs/api/types/index.d.ts +3 -0
- package/dist/cjs/api/types/index.js +3 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.d.mts +97 -0
- package/dist/esm/Client.mjs +321 -2
- package/dist/esm/api/client/requests/GetWorkflowRequest.d.mts +11 -0
- package/dist/esm/api/client/requests/GetWorkflowRunsRequest.d.mts +22 -0
- package/dist/esm/api/client/requests/GetWorkflowRunsRequest.mjs +2 -0
- package/dist/esm/api/client/requests/GetWorkflowVersionsRequest.d.mts +9 -0
- package/dist/esm/api/client/requests/GetWorkflowVersionsRequest.mjs +2 -0
- package/dist/esm/api/client/requests/GetWorkflowsRequest.d.mts +2 -2
- package/dist/esm/api/client/requests/index.d.mts +3 -1
- package/dist/esm/api/types/Action.d.mts +1 -0
- package/dist/esm/api/types/BillingStateResponse.d.mts +1 -0
- package/dist/esm/api/{client/requests → types}/CreateCredentialRequest.d.mts +2 -11
- package/dist/esm/api/types/CreateCredentialRequest.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/ValidationError.d.mts +2 -0
- package/dist/esm/api/types/WorkflowRun.d.mts +37 -0
- package/dist/esm/api/types/WorkflowRun.mjs +2 -0
- package/dist/esm/api/types/WorkflowRunStatus.d.mts +12 -0
- package/dist/esm/api/types/WorkflowRunStatus.mjs +12 -0
- package/dist/esm/api/types/index.d.mts +3 -0
- package/dist/esm/api/types/index.mjs +3 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- /package/dist/cjs/api/client/requests/{CreateCredentialRequest.js → GetWorkflowRequest.js} +0 -0
- /package/dist/esm/api/client/requests/{CreateCredentialRequest.mjs → GetWorkflowRequest.mjs} +0 -0
package/dist/cjs/Client.d.ts
CHANGED
|
@@ -210,6 +210,82 @@ export declare class SkyvernClient {
|
|
|
210
210
|
*/
|
|
211
211
|
getRunTimeline(runId: string, requestOptions?: SkyvernClient.RequestOptions): core.HttpResponsePromise<Skyvern.WorkflowRunTimeline[]>;
|
|
212
212
|
private __getRunTimeline;
|
|
213
|
+
/**
|
|
214
|
+
* List workflow runs across all workflows for the current organization.
|
|
215
|
+
*
|
|
216
|
+
* 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.
|
|
217
|
+
*
|
|
218
|
+
* ### search_key
|
|
219
|
+
*
|
|
220
|
+
* A case-insensitive substring search that matches against **any** of the following fields:
|
|
221
|
+
*
|
|
222
|
+
* | Searched field | Description |
|
|
223
|
+
* |---|---|
|
|
224
|
+
* | `workflow_run_id` | The unique run identifier (e.g. `wr_123…`) |
|
|
225
|
+
* | Parameter **key** | The `key` of any workflow parameter definition associated with the run |
|
|
226
|
+
* | Parameter **description** | The `description` of any workflow parameter definition |
|
|
227
|
+
* | Run parameter **value** | The actual value supplied for any parameter when the run was created |
|
|
228
|
+
* | `extra_http_headers` | Extra HTTP headers attached to the run (searched as raw JSON text) |
|
|
229
|
+
*
|
|
230
|
+
* Soft-deleted parameter definitions are excluded from key/description matching. A run is returned if **any** of the fields above contain the search term.
|
|
231
|
+
*
|
|
232
|
+
* ### error_code
|
|
233
|
+
*
|
|
234
|
+
* 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`).
|
|
235
|
+
*
|
|
236
|
+
* ### Combining filters
|
|
237
|
+
*
|
|
238
|
+
* All query parameters use AND logic:
|
|
239
|
+
* - `?status=failed` — only failed runs
|
|
240
|
+
* - `?status=failed&error_code=LOGIN_FAILED` — failed runs **and** have a LOGIN_FAILED error
|
|
241
|
+
* - `?status=failed&error_code=LOGIN_FAILED&search_key=prod_credential` — all three conditions must match
|
|
242
|
+
*
|
|
243
|
+
* @param {Skyvern.GetWorkflowRunsRequest} request
|
|
244
|
+
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
245
|
+
*
|
|
246
|
+
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
247
|
+
*
|
|
248
|
+
* @example
|
|
249
|
+
* await client.getWorkflowRuns({
|
|
250
|
+
* page: 1,
|
|
251
|
+
* page_size: 1,
|
|
252
|
+
* search_key: "search_key",
|
|
253
|
+
* error_code: "error_code"
|
|
254
|
+
* })
|
|
255
|
+
*/
|
|
256
|
+
getWorkflowRuns(request?: Skyvern.GetWorkflowRunsRequest, requestOptions?: SkyvernClient.RequestOptions): core.HttpResponsePromise<Skyvern.WorkflowRun[]>;
|
|
257
|
+
private __getWorkflowRuns;
|
|
258
|
+
/**
|
|
259
|
+
* @param {string} workflowPermanentId
|
|
260
|
+
* @param {Skyvern.GetWorkflowRequest} request
|
|
261
|
+
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
262
|
+
*
|
|
263
|
+
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
264
|
+
*
|
|
265
|
+
* @example
|
|
266
|
+
* await client.getWorkflow("workflow_permanent_id", {
|
|
267
|
+
* version: 1,
|
|
268
|
+
* template: true
|
|
269
|
+
* })
|
|
270
|
+
*/
|
|
271
|
+
getWorkflow(workflowPermanentId: string, request?: Skyvern.GetWorkflowRequest, requestOptions?: SkyvernClient.RequestOptions): core.HttpResponsePromise<Skyvern.Workflow>;
|
|
272
|
+
private __getWorkflow;
|
|
273
|
+
/**
|
|
274
|
+
* Get all versions of a workflow by its permanent ID.
|
|
275
|
+
*
|
|
276
|
+
* @param {string} workflowPermanentId
|
|
277
|
+
* @param {Skyvern.GetWorkflowVersionsRequest} request
|
|
278
|
+
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
279
|
+
*
|
|
280
|
+
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
281
|
+
*
|
|
282
|
+
* @example
|
|
283
|
+
* await client.getWorkflowVersions("workflow_permanent_id", {
|
|
284
|
+
* template: true
|
|
285
|
+
* })
|
|
286
|
+
*/
|
|
287
|
+
getWorkflowVersions(workflowPermanentId: string, request?: Skyvern.GetWorkflowVersionsRequest, requestOptions?: SkyvernClient.RequestOptions): core.HttpResponsePromise<Skyvern.Workflow[]>;
|
|
288
|
+
private __getWorkflowVersions;
|
|
213
289
|
/**
|
|
214
290
|
* @param {Skyvern.BodyUploadFileV1UploadFilePost} request
|
|
215
291
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -393,6 +469,27 @@ export declare class SkyvernClient {
|
|
|
393
469
|
*/
|
|
394
470
|
createCredential(request: Skyvern.CreateCredentialRequest, requestOptions?: SkyvernClient.RequestOptions): core.HttpResponsePromise<Skyvern.CredentialResponse>;
|
|
395
471
|
private __createCredential;
|
|
472
|
+
/**
|
|
473
|
+
* Overwrites the stored credential data (e.g. username/password) while keeping the same credential_id.
|
|
474
|
+
*
|
|
475
|
+
* @param {string} credentialId - The unique identifier of the credential to update
|
|
476
|
+
* @param {Skyvern.CreateCredentialRequest} request
|
|
477
|
+
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
478
|
+
*
|
|
479
|
+
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
480
|
+
*
|
|
481
|
+
* @example
|
|
482
|
+
* await client.updateCredential("cred_1234567890", {
|
|
483
|
+
* name: "My Credential",
|
|
484
|
+
* credential_type: "password",
|
|
485
|
+
* credential: {
|
|
486
|
+
* password: "newpassword123",
|
|
487
|
+
* username: "user@example.com"
|
|
488
|
+
* }
|
|
489
|
+
* })
|
|
490
|
+
*/
|
|
491
|
+
updateCredential(credentialId: string, request: Skyvern.CreateCredentialRequest, requestOptions?: SkyvernClient.RequestOptions): core.HttpResponsePromise<Skyvern.CredentialResponse>;
|
|
492
|
+
private __updateCredential;
|
|
396
493
|
/**
|
|
397
494
|
* Deletes a specific credential by its ID
|
|
398
495
|
*
|
package/dist/cjs/Client.js
CHANGED
|
@@ -56,8 +56,8 @@ class SkyvernClient {
|
|
|
56
56
|
"x-api-key": _options === null || _options === void 0 ? void 0 : _options.apiKey,
|
|
57
57
|
"X-Fern-Language": "JavaScript",
|
|
58
58
|
"X-Fern-SDK-Name": "@skyvern/client",
|
|
59
|
-
"X-Fern-SDK-Version": "1.0.
|
|
60
|
-
"User-Agent": "@skyvern/client/1.0.
|
|
59
|
+
"X-Fern-SDK-Version": "1.0.14",
|
|
60
|
+
"User-Agent": "@skyvern/client/1.0.14",
|
|
61
61
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
62
62
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
63
63
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -907,6 +907,255 @@ class SkyvernClient {
|
|
|
907
907
|
}
|
|
908
908
|
});
|
|
909
909
|
}
|
|
910
|
+
/**
|
|
911
|
+
* List workflow runs across all workflows for the current organization.
|
|
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
|
|
939
|
+
*
|
|
940
|
+
* @param {Skyvern.GetWorkflowRunsRequest} request
|
|
941
|
+
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
942
|
+
*
|
|
943
|
+
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
944
|
+
*
|
|
945
|
+
* @example
|
|
946
|
+
* await client.getWorkflowRuns({
|
|
947
|
+
* page: 1,
|
|
948
|
+
* page_size: 1,
|
|
949
|
+
* search_key: "search_key",
|
|
950
|
+
* error_code: "error_code"
|
|
951
|
+
* })
|
|
952
|
+
*/
|
|
953
|
+
getWorkflowRuns(request = {}, requestOptions) {
|
|
954
|
+
return core.HttpResponsePromise.fromPromise(this.__getWorkflowRuns(request, requestOptions));
|
|
955
|
+
}
|
|
956
|
+
__getWorkflowRuns() {
|
|
957
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
958
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
959
|
+
const { page, page_size: pageSize, status, search_key: searchKey, error_code: errorCode } = request;
|
|
960
|
+
const _queryParams = {};
|
|
961
|
+
if (page != null) {
|
|
962
|
+
_queryParams.page = page.toString();
|
|
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;
|
|
980
|
+
}
|
|
981
|
+
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
|
+
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, "v1/workflows/runs"),
|
|
984
|
+
method: "GET",
|
|
985
|
+
headers: _headers,
|
|
986
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
987
|
+
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,
|
|
988
|
+
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,
|
|
989
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
990
|
+
});
|
|
991
|
+
if (_response.ok) {
|
|
992
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
993
|
+
}
|
|
994
|
+
if (_response.error.reason === "status-code") {
|
|
995
|
+
switch (_response.error.statusCode) {
|
|
996
|
+
case 422:
|
|
997
|
+
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
998
|
+
default:
|
|
999
|
+
throw new errors.SkyvernError({
|
|
1000
|
+
statusCode: _response.error.statusCode,
|
|
1001
|
+
body: _response.error.body,
|
|
1002
|
+
rawResponse: _response.rawResponse,
|
|
1003
|
+
});
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
switch (_response.error.reason) {
|
|
1007
|
+
case "non-json":
|
|
1008
|
+
throw new errors.SkyvernError({
|
|
1009
|
+
statusCode: _response.error.statusCode,
|
|
1010
|
+
body: _response.error.rawBody,
|
|
1011
|
+
rawResponse: _response.rawResponse,
|
|
1012
|
+
});
|
|
1013
|
+
case "timeout":
|
|
1014
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/workflows/runs.");
|
|
1015
|
+
case "unknown":
|
|
1016
|
+
throw new errors.SkyvernError({
|
|
1017
|
+
message: _response.error.errorMessage,
|
|
1018
|
+
rawResponse: _response.rawResponse,
|
|
1019
|
+
});
|
|
1020
|
+
}
|
|
1021
|
+
});
|
|
1022
|
+
}
|
|
1023
|
+
/**
|
|
1024
|
+
* @param {string} workflowPermanentId
|
|
1025
|
+
* @param {Skyvern.GetWorkflowRequest} request
|
|
1026
|
+
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1027
|
+
*
|
|
1028
|
+
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
1029
|
+
*
|
|
1030
|
+
* @example
|
|
1031
|
+
* await client.getWorkflow("workflow_permanent_id", {
|
|
1032
|
+
* version: 1,
|
|
1033
|
+
* template: true
|
|
1034
|
+
* })
|
|
1035
|
+
*/
|
|
1036
|
+
getWorkflow(workflowPermanentId, request = {}, requestOptions) {
|
|
1037
|
+
return core.HttpResponsePromise.fromPromise(this.__getWorkflow(workflowPermanentId, request, requestOptions));
|
|
1038
|
+
}
|
|
1039
|
+
__getWorkflow(workflowPermanentId_1) {
|
|
1040
|
+
return __awaiter(this, arguments, void 0, function* (workflowPermanentId, request = {}, requestOptions) {
|
|
1041
|
+
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
|
+
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
|
+
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/workflows/${core.url.encodePathParam(workflowPermanentId)}`),
|
|
1053
|
+
method: "GET",
|
|
1054
|
+
headers: _headers,
|
|
1055
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
1056
|
+
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
|
+
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
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1059
|
+
});
|
|
1060
|
+
if (_response.ok) {
|
|
1061
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
1062
|
+
}
|
|
1063
|
+
if (_response.error.reason === "status-code") {
|
|
1064
|
+
switch (_response.error.statusCode) {
|
|
1065
|
+
case 422:
|
|
1066
|
+
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
1067
|
+
default:
|
|
1068
|
+
throw new errors.SkyvernError({
|
|
1069
|
+
statusCode: _response.error.statusCode,
|
|
1070
|
+
body: _response.error.body,
|
|
1071
|
+
rawResponse: _response.rawResponse,
|
|
1072
|
+
});
|
|
1073
|
+
}
|
|
1074
|
+
}
|
|
1075
|
+
switch (_response.error.reason) {
|
|
1076
|
+
case "non-json":
|
|
1077
|
+
throw new errors.SkyvernError({
|
|
1078
|
+
statusCode: _response.error.statusCode,
|
|
1079
|
+
body: _response.error.rawBody,
|
|
1080
|
+
rawResponse: _response.rawResponse,
|
|
1081
|
+
});
|
|
1082
|
+
case "timeout":
|
|
1083
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/workflows/{workflow_permanent_id}.");
|
|
1084
|
+
case "unknown":
|
|
1085
|
+
throw new errors.SkyvernError({
|
|
1086
|
+
message: _response.error.errorMessage,
|
|
1087
|
+
rawResponse: _response.rawResponse,
|
|
1088
|
+
});
|
|
1089
|
+
}
|
|
1090
|
+
});
|
|
1091
|
+
}
|
|
1092
|
+
/**
|
|
1093
|
+
* Get all versions of a workflow by its permanent ID.
|
|
1094
|
+
*
|
|
1095
|
+
* @param {string} workflowPermanentId
|
|
1096
|
+
* @param {Skyvern.GetWorkflowVersionsRequest} request
|
|
1097
|
+
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1098
|
+
*
|
|
1099
|
+
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
1100
|
+
*
|
|
1101
|
+
* @example
|
|
1102
|
+
* await client.getWorkflowVersions("workflow_permanent_id", {
|
|
1103
|
+
* template: true
|
|
1104
|
+
* })
|
|
1105
|
+
*/
|
|
1106
|
+
getWorkflowVersions(workflowPermanentId, request = {}, requestOptions) {
|
|
1107
|
+
return core.HttpResponsePromise.fromPromise(this.__getWorkflowVersions(workflowPermanentId, request, requestOptions));
|
|
1108
|
+
}
|
|
1109
|
+
__getWorkflowVersions(workflowPermanentId_1) {
|
|
1110
|
+
return __awaiter(this, arguments, void 0, function* (workflowPermanentId, request = {}, requestOptions) {
|
|
1111
|
+
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
|
+
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
|
+
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/workflows/${core.url.encodePathParam(workflowPermanentId)}/versions`),
|
|
1120
|
+
method: "GET",
|
|
1121
|
+
headers: _headers,
|
|
1122
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
1123
|
+
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
|
+
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
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1126
|
+
});
|
|
1127
|
+
if (_response.ok) {
|
|
1128
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
1129
|
+
}
|
|
1130
|
+
if (_response.error.reason === "status-code") {
|
|
1131
|
+
switch (_response.error.statusCode) {
|
|
1132
|
+
case 422:
|
|
1133
|
+
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
1134
|
+
default:
|
|
1135
|
+
throw new errors.SkyvernError({
|
|
1136
|
+
statusCode: _response.error.statusCode,
|
|
1137
|
+
body: _response.error.body,
|
|
1138
|
+
rawResponse: _response.rawResponse,
|
|
1139
|
+
});
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
switch (_response.error.reason) {
|
|
1143
|
+
case "non-json":
|
|
1144
|
+
throw new errors.SkyvernError({
|
|
1145
|
+
statusCode: _response.error.statusCode,
|
|
1146
|
+
body: _response.error.rawBody,
|
|
1147
|
+
rawResponse: _response.rawResponse,
|
|
1148
|
+
});
|
|
1149
|
+
case "timeout":
|
|
1150
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/workflows/{workflow_permanent_id}/versions.");
|
|
1151
|
+
case "unknown":
|
|
1152
|
+
throw new errors.SkyvernError({
|
|
1153
|
+
message: _response.error.errorMessage,
|
|
1154
|
+
rawResponse: _response.rawResponse,
|
|
1155
|
+
});
|
|
1156
|
+
}
|
|
1157
|
+
});
|
|
1158
|
+
}
|
|
910
1159
|
/**
|
|
911
1160
|
* @param {Skyvern.BodyUploadFileV1UploadFilePost} request
|
|
912
1161
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -1691,6 +1940,76 @@ class SkyvernClient {
|
|
|
1691
1940
|
}
|
|
1692
1941
|
});
|
|
1693
1942
|
}
|
|
1943
|
+
/**
|
|
1944
|
+
* Overwrites the stored credential data (e.g. username/password) while keeping the same credential_id.
|
|
1945
|
+
*
|
|
1946
|
+
* @param {string} credentialId - The unique identifier of the credential to update
|
|
1947
|
+
* @param {Skyvern.CreateCredentialRequest} request
|
|
1948
|
+
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1949
|
+
*
|
|
1950
|
+
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
1951
|
+
*
|
|
1952
|
+
* @example
|
|
1953
|
+
* await client.updateCredential("cred_1234567890", {
|
|
1954
|
+
* name: "My Credential",
|
|
1955
|
+
* credential_type: "password",
|
|
1956
|
+
* credential: {
|
|
1957
|
+
* password: "newpassword123",
|
|
1958
|
+
* username: "user@example.com"
|
|
1959
|
+
* }
|
|
1960
|
+
* })
|
|
1961
|
+
*/
|
|
1962
|
+
updateCredential(credentialId, request, requestOptions) {
|
|
1963
|
+
return core.HttpResponsePromise.fromPromise(this.__updateCredential(credentialId, request, requestOptions));
|
|
1964
|
+
}
|
|
1965
|
+
__updateCredential(credentialId, request, requestOptions) {
|
|
1966
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1967
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
1968
|
+
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);
|
|
1969
|
+
const _response = yield core.fetcher({
|
|
1970
|
+
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`),
|
|
1971
|
+
method: "POST",
|
|
1972
|
+
headers: _headers,
|
|
1973
|
+
contentType: "application/json",
|
|
1974
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
1975
|
+
requestType: "json",
|
|
1976
|
+
body: request,
|
|
1977
|
+
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,
|
|
1978
|
+
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,
|
|
1979
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1980
|
+
});
|
|
1981
|
+
if (_response.ok) {
|
|
1982
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
1983
|
+
}
|
|
1984
|
+
if (_response.error.reason === "status-code") {
|
|
1985
|
+
switch (_response.error.statusCode) {
|
|
1986
|
+
case 422:
|
|
1987
|
+
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
1988
|
+
default:
|
|
1989
|
+
throw new errors.SkyvernError({
|
|
1990
|
+
statusCode: _response.error.statusCode,
|
|
1991
|
+
body: _response.error.body,
|
|
1992
|
+
rawResponse: _response.rawResponse,
|
|
1993
|
+
});
|
|
1994
|
+
}
|
|
1995
|
+
}
|
|
1996
|
+
switch (_response.error.reason) {
|
|
1997
|
+
case "non-json":
|
|
1998
|
+
throw new errors.SkyvernError({
|
|
1999
|
+
statusCode: _response.error.statusCode,
|
|
2000
|
+
body: _response.error.rawBody,
|
|
2001
|
+
rawResponse: _response.rawResponse,
|
|
2002
|
+
});
|
|
2003
|
+
case "timeout":
|
|
2004
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /v1/credentials/{credential_id}/update.");
|
|
2005
|
+
case "unknown":
|
|
2006
|
+
throw new errors.SkyvernError({
|
|
2007
|
+
message: _response.error.errorMessage,
|
|
2008
|
+
rawResponse: _response.rawResponse,
|
|
2009
|
+
});
|
|
2010
|
+
}
|
|
2011
|
+
});
|
|
2012
|
+
}
|
|
1694
2013
|
/**
|
|
1695
2014
|
* Deletes a specific credential by its ID
|
|
1696
2015
|
*
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type * as Skyvern from "../../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {
|
|
5
|
+
* page: 1,
|
|
6
|
+
* page_size: 1,
|
|
7
|
+
* search_key: "search_key",
|
|
8
|
+
* error_code: "error_code"
|
|
9
|
+
* }
|
|
10
|
+
*/
|
|
11
|
+
export interface GetWorkflowRunsRequest {
|
|
12
|
+
/** Page number for pagination. */
|
|
13
|
+
page?: number;
|
|
14
|
+
/** Number of runs to return per page. */
|
|
15
|
+
page_size?: number;
|
|
16
|
+
/** Filter by one or more run statuses. */
|
|
17
|
+
status?: Skyvern.WorkflowRunStatus | Skyvern.WorkflowRunStatus[];
|
|
18
|
+
/** Case-insensitive substring search across: workflow run ID, parameter key, parameter description, run parameter value, and extra HTTP headers. A run is returned if any of these fields match. Soft-deleted parameter definitions are excluded from key/description matching. */
|
|
19
|
+
search_key?: string;
|
|
20
|
+
/** 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. Error codes are user-defined strings set during workflow execution. */
|
|
21
|
+
error_code?: string;
|
|
22
|
+
}
|
|
@@ -19,9 +19,9 @@ export interface GetWorkflowsRequest {
|
|
|
19
19
|
only_saved_tasks?: boolean;
|
|
20
20
|
only_workflows?: boolean;
|
|
21
21
|
only_templates?: boolean;
|
|
22
|
-
/**
|
|
22
|
+
/** Case-insensitive substring search across: workflow title, folder name, and parameter metadata (key, description, default_value). A workflow is returned if any of these fields match. Soft-deleted parameter definitions are excluded. Takes precedence over the deprecated `title` parameter. */
|
|
23
23
|
search_key?: string;
|
|
24
|
-
/** Deprecated: use search_key instead. */
|
|
24
|
+
/** Deprecated: use search_key instead. Falls back to title-only search if search_key is not provided. */
|
|
25
25
|
title?: string;
|
|
26
26
|
/** Filter workflows by folder ID */
|
|
27
27
|
folder_id?: string;
|
|
@@ -3,7 +3,6 @@ export type { ChangeTierRequest } from "./ChangeTierRequest.js";
|
|
|
3
3
|
export type { CheckoutSubscriptionRequest } from "./CheckoutSubscriptionRequest.js";
|
|
4
4
|
export type { CreateBrowserProfileRequest } from "./CreateBrowserProfileRequest.js";
|
|
5
5
|
export type { CreateBrowserSessionRequest } from "./CreateBrowserSessionRequest.js";
|
|
6
|
-
export type { CreateCredentialRequest } from "./CreateCredentialRequest.js";
|
|
7
6
|
export type { CreateScriptRequest } from "./CreateScriptRequest.js";
|
|
8
7
|
export type { CreateWorkflowRequest } from "./CreateWorkflowRequest.js";
|
|
9
8
|
export type { DeployScriptRequest } from "./DeployScriptRequest.js";
|
|
@@ -11,7 +10,10 @@ export type { DownloadFilesRequest } from "./DownloadFilesRequest.js";
|
|
|
11
10
|
export type { GetCredentialsRequest } from "./GetCredentialsRequest.js";
|
|
12
11
|
export type { GetRunArtifactsRequest } from "./GetRunArtifactsRequest.js";
|
|
13
12
|
export type { GetScriptsRequest } from "./GetScriptsRequest.js";
|
|
13
|
+
export type { GetWorkflowRequest } from "./GetWorkflowRequest.js";
|
|
14
|
+
export type { GetWorkflowRunsRequest } from "./GetWorkflowRunsRequest.js";
|
|
14
15
|
export type { GetWorkflowsRequest } from "./GetWorkflowsRequest.js";
|
|
16
|
+
export type { GetWorkflowVersionsRequest } from "./GetWorkflowVersionsRequest.js";
|
|
15
17
|
export type { ListBrowserProfilesRequest } from "./ListBrowserProfilesRequest.js";
|
|
16
18
|
export type { LoginRequest } from "./LoginRequest.js";
|
|
17
19
|
export type { RunSdkActionRequest } from "./RunSdkActionRequest.js";
|
|
@@ -1,15 +1,6 @@
|
|
|
1
|
-
import type * as Skyvern from "
|
|
1
|
+
import type * as Skyvern from "../index.js";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* {
|
|
5
|
-
* name: "My Credential",
|
|
6
|
-
* credential_type: "password",
|
|
7
|
-
* credential: {
|
|
8
|
-
* password: "securepassword123",
|
|
9
|
-
* username: "user@example.com",
|
|
10
|
-
* totp: "JBSWY3DPEHPK3PXP"
|
|
11
|
-
* }
|
|
12
|
-
* }
|
|
3
|
+
* Request model for creating a new credential.
|
|
13
4
|
*/
|
|
14
5
|
export interface CreateCredentialRequest {
|
|
15
6
|
/** Name of the credential */
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type * as Skyvern from "../index.js";
|
|
2
|
+
export interface WorkflowRun {
|
|
3
|
+
workflow_run_id: string;
|
|
4
|
+
workflow_id: string;
|
|
5
|
+
workflow_permanent_id: string;
|
|
6
|
+
organization_id: string;
|
|
7
|
+
browser_session_id?: string;
|
|
8
|
+
browser_profile_id?: string;
|
|
9
|
+
debug_session_id?: string;
|
|
10
|
+
status: Skyvern.WorkflowRunStatus;
|
|
11
|
+
extra_http_headers?: Record<string, string | undefined>;
|
|
12
|
+
proxy_location?: WorkflowRun.ProxyLocation;
|
|
13
|
+
webhook_callback_url?: string;
|
|
14
|
+
webhook_failure_reason?: string;
|
|
15
|
+
totp_verification_url?: string;
|
|
16
|
+
totp_identifier?: string;
|
|
17
|
+
failure_reason?: string;
|
|
18
|
+
parent_workflow_run_id?: string;
|
|
19
|
+
workflow_title?: string;
|
|
20
|
+
max_screenshot_scrolls?: number;
|
|
21
|
+
browser_address?: string;
|
|
22
|
+
run_with?: string;
|
|
23
|
+
script_run?: Skyvern.ScriptRunResponse;
|
|
24
|
+
job_id?: string;
|
|
25
|
+
depends_on_workflow_run_id?: string;
|
|
26
|
+
sequential_key?: string;
|
|
27
|
+
ai_fallback?: boolean;
|
|
28
|
+
code_gen?: boolean;
|
|
29
|
+
queued_at?: string;
|
|
30
|
+
started_at?: string;
|
|
31
|
+
finished_at?: string;
|
|
32
|
+
created_at: string;
|
|
33
|
+
modified_at: string;
|
|
34
|
+
}
|
|
35
|
+
export declare namespace WorkflowRun {
|
|
36
|
+
type ProxyLocation = Skyvern.ProxyLocation | Skyvern.GeoTarget | Record<string, unknown>;
|
|
37
|
+
}
|