@skyvern/client 1.0.13 → 1.0.15
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 +66 -0
- package/dist/cjs/Client.js +185 -2
- package/dist/cjs/api/client/requests/GetWorkflowRunsRequest.d.ts +22 -0
- package/dist/cjs/api/client/requests/GetWorkflowsRequest.d.ts +2 -2
- package/dist/cjs/api/client/requests/index.d.ts +1 -1
- package/dist/cjs/api/types/Action.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 +1 -0
- package/dist/cjs/api/types/FileType.js +1 -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 +66 -0
- package/dist/esm/Client.mjs +185 -2
- package/dist/esm/api/client/requests/GetWorkflowRunsRequest.d.mts +22 -0
- package/dist/esm/api/client/requests/GetWorkflowsRequest.d.mts +2 -2
- package/dist/esm/api/client/requests/index.d.mts +1 -1
- package/dist/esm/api/types/Action.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 +1 -0
- package/dist/esm/api/types/FileType.mjs +1 -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 → GetWorkflowRunsRequest.js} +0 -0
- /package/dist/esm/api/client/requests/{CreateCredentialRequest.mjs → GetWorkflowRunsRequest.mjs} +0 -0
package/dist/cjs/Client.d.ts
CHANGED
|
@@ -210,6 +210,51 @@ 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;
|
|
213
258
|
/**
|
|
214
259
|
* @param {string} workflowPermanentId
|
|
215
260
|
* @param {Skyvern.GetWorkflowRequest} request
|
|
@@ -424,6 +469,27 @@ export declare class SkyvernClient {
|
|
|
424
469
|
*/
|
|
425
470
|
createCredential(request: Skyvern.CreateCredentialRequest, requestOptions?: SkyvernClient.RequestOptions): core.HttpResponsePromise<Skyvern.CredentialResponse>;
|
|
426
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;
|
|
427
493
|
/**
|
|
428
494
|
* Deletes a specific credential by its ID
|
|
429
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.15",
|
|
60
|
+
"User-Agent": "@skyvern/client/1.0.15",
|
|
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,119 @@ 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
|
+
}
|
|
910
1023
|
/**
|
|
911
1024
|
* @param {string} workflowPermanentId
|
|
912
1025
|
* @param {Skyvern.GetWorkflowRequest} request
|
|
@@ -1827,6 +1940,76 @@ class SkyvernClient {
|
|
|
1827
1940
|
}
|
|
1828
1941
|
});
|
|
1829
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
|
+
}
|
|
1830
2013
|
/**
|
|
1831
2014
|
* Deletes a specific credential by its ID
|
|
1832
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";
|
|
@@ -12,6 +11,7 @@ export type { GetCredentialsRequest } from "./GetCredentialsRequest.js";
|
|
|
12
11
|
export type { GetRunArtifactsRequest } from "./GetRunArtifactsRequest.js";
|
|
13
12
|
export type { GetScriptsRequest } from "./GetScriptsRequest.js";
|
|
14
13
|
export type { GetWorkflowRequest } from "./GetWorkflowRequest.js";
|
|
14
|
+
export type { GetWorkflowRunsRequest } from "./GetWorkflowRunsRequest.js";
|
|
15
15
|
export type { GetWorkflowsRequest } from "./GetWorkflowsRequest.js";
|
|
16
16
|
export type { GetWorkflowVersionsRequest } from "./GetWorkflowVersionsRequest.js";
|
|
17
17
|
export type { ListBrowserProfilesRequest } from "./ListBrowserProfilesRequest.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
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const WorkflowRunStatus: {
|
|
2
|
+
readonly Created: "created";
|
|
3
|
+
readonly Queued: "queued";
|
|
4
|
+
readonly Running: "running";
|
|
5
|
+
readonly Failed: "failed";
|
|
6
|
+
readonly Terminated: "terminated";
|
|
7
|
+
readonly Canceled: "canceled";
|
|
8
|
+
readonly TimedOut: "timed_out";
|
|
9
|
+
readonly Completed: "completed";
|
|
10
|
+
readonly Paused: "paused";
|
|
11
|
+
};
|
|
12
|
+
export type WorkflowRunStatus = (typeof WorkflowRunStatus)[keyof typeof WorkflowRunStatus];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.WorkflowRunStatus = void 0;
|
|
5
|
+
exports.WorkflowRunStatus = {
|
|
6
|
+
Created: "created",
|
|
7
|
+
Queued: "queued",
|
|
8
|
+
Running: "running",
|
|
9
|
+
Failed: "failed",
|
|
10
|
+
Terminated: "terminated",
|
|
11
|
+
Canceled: "canceled",
|
|
12
|
+
TimedOut: "timed_out",
|
|
13
|
+
Completed: "completed",
|
|
14
|
+
Paused: "paused",
|
|
15
|
+
};
|
|
@@ -38,6 +38,7 @@ export * from "./ConditionalBlockYaml.js";
|
|
|
38
38
|
export * from "./ContextParameter.js";
|
|
39
39
|
export * from "./ContextParameterSource.js";
|
|
40
40
|
export * from "./ContextParameterYaml.js";
|
|
41
|
+
export * from "./CreateCredentialRequest.js";
|
|
41
42
|
export * from "./CreateScriptResponse.js";
|
|
42
43
|
export * from "./CredentialParameter.js";
|
|
43
44
|
export * from "./CredentialParameterYaml.js";
|
|
@@ -166,9 +167,11 @@ export * from "./WorkflowParameter.js";
|
|
|
166
167
|
export * from "./WorkflowParameterType.js";
|
|
167
168
|
export * from "./WorkflowParameterYaml.js";
|
|
168
169
|
export * from "./WorkflowRequest.js";
|
|
170
|
+
export * from "./WorkflowRun.js";
|
|
169
171
|
export * from "./WorkflowRunBlock.js";
|
|
170
172
|
export * from "./WorkflowRunRequest.js";
|
|
171
173
|
export * from "./WorkflowRunResponse.js";
|
|
174
|
+
export * from "./WorkflowRunStatus.js";
|
|
172
175
|
export * from "./WorkflowRunTimeline.js";
|
|
173
176
|
export * from "./WorkflowRunTimelineType.js";
|
|
174
177
|
export * from "./WorkflowStatus.js";
|
|
@@ -54,6 +54,7 @@ __exportStar(require("./ConditionalBlockYaml.js"), exports);
|
|
|
54
54
|
__exportStar(require("./ContextParameter.js"), exports);
|
|
55
55
|
__exportStar(require("./ContextParameterSource.js"), exports);
|
|
56
56
|
__exportStar(require("./ContextParameterYaml.js"), exports);
|
|
57
|
+
__exportStar(require("./CreateCredentialRequest.js"), exports);
|
|
57
58
|
__exportStar(require("./CreateScriptResponse.js"), exports);
|
|
58
59
|
__exportStar(require("./CredentialParameter.js"), exports);
|
|
59
60
|
__exportStar(require("./CredentialParameterYaml.js"), exports);
|
|
@@ -182,9 +183,11 @@ __exportStar(require("./WorkflowParameter.js"), exports);
|
|
|
182
183
|
__exportStar(require("./WorkflowParameterType.js"), exports);
|
|
183
184
|
__exportStar(require("./WorkflowParameterYaml.js"), exports);
|
|
184
185
|
__exportStar(require("./WorkflowRequest.js"), exports);
|
|
186
|
+
__exportStar(require("./WorkflowRun.js"), exports);
|
|
185
187
|
__exportStar(require("./WorkflowRunBlock.js"), exports);
|
|
186
188
|
__exportStar(require("./WorkflowRunRequest.js"), exports);
|
|
187
189
|
__exportStar(require("./WorkflowRunResponse.js"), exports);
|
|
190
|
+
__exportStar(require("./WorkflowRunStatus.js"), exports);
|
|
188
191
|
__exportStar(require("./WorkflowRunTimeline.js"), exports);
|
|
189
192
|
__exportStar(require("./WorkflowRunTimelineType.js"), exports);
|
|
190
193
|
__exportStar(require("./WorkflowStatus.js"), exports);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.0.
|
|
1
|
+
export declare const SDK_VERSION = "1.0.15";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/Client.d.mts
CHANGED
|
@@ -210,6 +210,51 @@ 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;
|
|
213
258
|
/**
|
|
214
259
|
* @param {string} workflowPermanentId
|
|
215
260
|
* @param {Skyvern.GetWorkflowRequest} request
|
|
@@ -424,6 +469,27 @@ export declare class SkyvernClient {
|
|
|
424
469
|
*/
|
|
425
470
|
createCredential(request: Skyvern.CreateCredentialRequest, requestOptions?: SkyvernClient.RequestOptions): core.HttpResponsePromise<Skyvern.CredentialResponse>;
|
|
426
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;
|
|
427
493
|
/**
|
|
428
494
|
* Deletes a specific credential by its ID
|
|
429
495
|
*
|
package/dist/esm/Client.mjs
CHANGED
|
@@ -20,8 +20,8 @@ export class SkyvernClient {
|
|
|
20
20
|
"x-api-key": _options === null || _options === void 0 ? void 0 : _options.apiKey,
|
|
21
21
|
"X-Fern-Language": "JavaScript",
|
|
22
22
|
"X-Fern-SDK-Name": "@skyvern/client",
|
|
23
|
-
"X-Fern-SDK-Version": "1.0.
|
|
24
|
-
"User-Agent": "@skyvern/client/1.0.
|
|
23
|
+
"X-Fern-SDK-Version": "1.0.15",
|
|
24
|
+
"User-Agent": "@skyvern/client/1.0.15",
|
|
25
25
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
26
26
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
27
27
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -871,6 +871,119 @@ export class SkyvernClient {
|
|
|
871
871
|
}
|
|
872
872
|
});
|
|
873
873
|
}
|
|
874
|
+
/**
|
|
875
|
+
* List workflow runs across all workflows for the current organization.
|
|
876
|
+
*
|
|
877
|
+
* 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.
|
|
878
|
+
*
|
|
879
|
+
* ### search_key
|
|
880
|
+
*
|
|
881
|
+
* A case-insensitive substring search that matches against **any** of the following fields:
|
|
882
|
+
*
|
|
883
|
+
* | Searched field | Description |
|
|
884
|
+
* |---|---|
|
|
885
|
+
* | `workflow_run_id` | The unique run identifier (e.g. `wr_123…`) |
|
|
886
|
+
* | Parameter **key** | The `key` of any workflow parameter definition associated with the run |
|
|
887
|
+
* | Parameter **description** | The `description` of any workflow parameter definition |
|
|
888
|
+
* | Run parameter **value** | The actual value supplied for any parameter when the run was created |
|
|
889
|
+
* | `extra_http_headers` | Extra HTTP headers attached to the run (searched as raw JSON text) |
|
|
890
|
+
*
|
|
891
|
+
* Soft-deleted parameter definitions are excluded from key/description matching. A run is returned if **any** of the fields above contain the search term.
|
|
892
|
+
*
|
|
893
|
+
* ### error_code
|
|
894
|
+
*
|
|
895
|
+
* 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`).
|
|
896
|
+
*
|
|
897
|
+
* ### Combining filters
|
|
898
|
+
*
|
|
899
|
+
* All query parameters use AND logic:
|
|
900
|
+
* - `?status=failed` — only failed runs
|
|
901
|
+
* - `?status=failed&error_code=LOGIN_FAILED` — failed runs **and** have a LOGIN_FAILED error
|
|
902
|
+
* - `?status=failed&error_code=LOGIN_FAILED&search_key=prod_credential` — all three conditions must match
|
|
903
|
+
*
|
|
904
|
+
* @param {Skyvern.GetWorkflowRunsRequest} request
|
|
905
|
+
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
906
|
+
*
|
|
907
|
+
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
908
|
+
*
|
|
909
|
+
* @example
|
|
910
|
+
* await client.getWorkflowRuns({
|
|
911
|
+
* page: 1,
|
|
912
|
+
* page_size: 1,
|
|
913
|
+
* search_key: "search_key",
|
|
914
|
+
* error_code: "error_code"
|
|
915
|
+
* })
|
|
916
|
+
*/
|
|
917
|
+
getWorkflowRuns(request = {}, requestOptions) {
|
|
918
|
+
return core.HttpResponsePromise.fromPromise(this.__getWorkflowRuns(request, requestOptions));
|
|
919
|
+
}
|
|
920
|
+
__getWorkflowRuns() {
|
|
921
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
922
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
923
|
+
const { page, page_size: pageSize, status, search_key: searchKey, error_code: errorCode } = request;
|
|
924
|
+
const _queryParams = {};
|
|
925
|
+
if (page != null) {
|
|
926
|
+
_queryParams.page = page.toString();
|
|
927
|
+
}
|
|
928
|
+
if (pageSize != null) {
|
|
929
|
+
_queryParams.page_size = pageSize.toString();
|
|
930
|
+
}
|
|
931
|
+
if (status != null) {
|
|
932
|
+
if (Array.isArray(status)) {
|
|
933
|
+
_queryParams.status = status.map((item) => item);
|
|
934
|
+
}
|
|
935
|
+
else {
|
|
936
|
+
_queryParams.status = status;
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
if (searchKey != null) {
|
|
940
|
+
_queryParams.search_key = searchKey;
|
|
941
|
+
}
|
|
942
|
+
if (errorCode != null) {
|
|
943
|
+
_queryParams.error_code = errorCode;
|
|
944
|
+
}
|
|
945
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, 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);
|
|
946
|
+
const _response = yield core.fetcher({
|
|
947
|
+
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"),
|
|
948
|
+
method: "GET",
|
|
949
|
+
headers: _headers,
|
|
950
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
951
|
+
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,
|
|
952
|
+
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,
|
|
953
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
954
|
+
});
|
|
955
|
+
if (_response.ok) {
|
|
956
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
957
|
+
}
|
|
958
|
+
if (_response.error.reason === "status-code") {
|
|
959
|
+
switch (_response.error.statusCode) {
|
|
960
|
+
case 422:
|
|
961
|
+
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
962
|
+
default:
|
|
963
|
+
throw new errors.SkyvernError({
|
|
964
|
+
statusCode: _response.error.statusCode,
|
|
965
|
+
body: _response.error.body,
|
|
966
|
+
rawResponse: _response.rawResponse,
|
|
967
|
+
});
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
switch (_response.error.reason) {
|
|
971
|
+
case "non-json":
|
|
972
|
+
throw new errors.SkyvernError({
|
|
973
|
+
statusCode: _response.error.statusCode,
|
|
974
|
+
body: _response.error.rawBody,
|
|
975
|
+
rawResponse: _response.rawResponse,
|
|
976
|
+
});
|
|
977
|
+
case "timeout":
|
|
978
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/workflows/runs.");
|
|
979
|
+
case "unknown":
|
|
980
|
+
throw new errors.SkyvernError({
|
|
981
|
+
message: _response.error.errorMessage,
|
|
982
|
+
rawResponse: _response.rawResponse,
|
|
983
|
+
});
|
|
984
|
+
}
|
|
985
|
+
});
|
|
986
|
+
}
|
|
874
987
|
/**
|
|
875
988
|
* @param {string} workflowPermanentId
|
|
876
989
|
* @param {Skyvern.GetWorkflowRequest} request
|
|
@@ -1791,6 +1904,76 @@ export class SkyvernClient {
|
|
|
1791
1904
|
}
|
|
1792
1905
|
});
|
|
1793
1906
|
}
|
|
1907
|
+
/**
|
|
1908
|
+
* Overwrites the stored credential data (e.g. username/password) while keeping the same credential_id.
|
|
1909
|
+
*
|
|
1910
|
+
* @param {string} credentialId - The unique identifier of the credential to update
|
|
1911
|
+
* @param {Skyvern.CreateCredentialRequest} request
|
|
1912
|
+
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1913
|
+
*
|
|
1914
|
+
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
1915
|
+
*
|
|
1916
|
+
* @example
|
|
1917
|
+
* await client.updateCredential("cred_1234567890", {
|
|
1918
|
+
* name: "My Credential",
|
|
1919
|
+
* credential_type: "password",
|
|
1920
|
+
* credential: {
|
|
1921
|
+
* password: "newpassword123",
|
|
1922
|
+
* username: "user@example.com"
|
|
1923
|
+
* }
|
|
1924
|
+
* })
|
|
1925
|
+
*/
|
|
1926
|
+
updateCredential(credentialId, request, requestOptions) {
|
|
1927
|
+
return core.HttpResponsePromise.fromPromise(this.__updateCredential(credentialId, request, requestOptions));
|
|
1928
|
+
}
|
|
1929
|
+
__updateCredential(credentialId, request, requestOptions) {
|
|
1930
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1931
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
1932
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, 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);
|
|
1933
|
+
const _response = yield core.fetcher({
|
|
1934
|
+
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`),
|
|
1935
|
+
method: "POST",
|
|
1936
|
+
headers: _headers,
|
|
1937
|
+
contentType: "application/json",
|
|
1938
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
1939
|
+
requestType: "json",
|
|
1940
|
+
body: request,
|
|
1941
|
+
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,
|
|
1942
|
+
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,
|
|
1943
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1944
|
+
});
|
|
1945
|
+
if (_response.ok) {
|
|
1946
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
1947
|
+
}
|
|
1948
|
+
if (_response.error.reason === "status-code") {
|
|
1949
|
+
switch (_response.error.statusCode) {
|
|
1950
|
+
case 422:
|
|
1951
|
+
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
1952
|
+
default:
|
|
1953
|
+
throw new errors.SkyvernError({
|
|
1954
|
+
statusCode: _response.error.statusCode,
|
|
1955
|
+
body: _response.error.body,
|
|
1956
|
+
rawResponse: _response.rawResponse,
|
|
1957
|
+
});
|
|
1958
|
+
}
|
|
1959
|
+
}
|
|
1960
|
+
switch (_response.error.reason) {
|
|
1961
|
+
case "non-json":
|
|
1962
|
+
throw new errors.SkyvernError({
|
|
1963
|
+
statusCode: _response.error.statusCode,
|
|
1964
|
+
body: _response.error.rawBody,
|
|
1965
|
+
rawResponse: _response.rawResponse,
|
|
1966
|
+
});
|
|
1967
|
+
case "timeout":
|
|
1968
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /v1/credentials/{credential_id}/update.");
|
|
1969
|
+
case "unknown":
|
|
1970
|
+
throw new errors.SkyvernError({
|
|
1971
|
+
message: _response.error.errorMessage,
|
|
1972
|
+
rawResponse: _response.rawResponse,
|
|
1973
|
+
});
|
|
1974
|
+
}
|
|
1975
|
+
});
|
|
1976
|
+
}
|
|
1794
1977
|
/**
|
|
1795
1978
|
* Deletes a specific credential by its ID
|
|
1796
1979
|
*
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type * as Skyvern from "../../index.mjs";
|
|
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.mjs";
|
|
|
3
3
|
export type { CheckoutSubscriptionRequest } from "./CheckoutSubscriptionRequest.mjs";
|
|
4
4
|
export type { CreateBrowserProfileRequest } from "./CreateBrowserProfileRequest.mjs";
|
|
5
5
|
export type { CreateBrowserSessionRequest } from "./CreateBrowserSessionRequest.mjs";
|
|
6
|
-
export type { CreateCredentialRequest } from "./CreateCredentialRequest.mjs";
|
|
7
6
|
export type { CreateScriptRequest } from "./CreateScriptRequest.mjs";
|
|
8
7
|
export type { CreateWorkflowRequest } from "./CreateWorkflowRequest.mjs";
|
|
9
8
|
export type { DeployScriptRequest } from "./DeployScriptRequest.mjs";
|
|
@@ -12,6 +11,7 @@ export type { GetCredentialsRequest } from "./GetCredentialsRequest.mjs";
|
|
|
12
11
|
export type { GetRunArtifactsRequest } from "./GetRunArtifactsRequest.mjs";
|
|
13
12
|
export type { GetScriptsRequest } from "./GetScriptsRequest.mjs";
|
|
14
13
|
export type { GetWorkflowRequest } from "./GetWorkflowRequest.mjs";
|
|
14
|
+
export type { GetWorkflowRunsRequest } from "./GetWorkflowRunsRequest.mjs";
|
|
15
15
|
export type { GetWorkflowsRequest } from "./GetWorkflowsRequest.mjs";
|
|
16
16
|
export type { GetWorkflowVersionsRequest } from "./GetWorkflowVersionsRequest.mjs";
|
|
17
17
|
export type { ListBrowserProfilesRequest } from "./ListBrowserProfilesRequest.mjs";
|
|
@@ -1,15 +1,6 @@
|
|
|
1
|
-
import type * as Skyvern from "
|
|
1
|
+
import type * as Skyvern from "../index.mjs";
|
|
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.mjs";
|
|
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
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const WorkflowRunStatus: {
|
|
2
|
+
readonly Created: "created";
|
|
3
|
+
readonly Queued: "queued";
|
|
4
|
+
readonly Running: "running";
|
|
5
|
+
readonly Failed: "failed";
|
|
6
|
+
readonly Terminated: "terminated";
|
|
7
|
+
readonly Canceled: "canceled";
|
|
8
|
+
readonly TimedOut: "timed_out";
|
|
9
|
+
readonly Completed: "completed";
|
|
10
|
+
readonly Paused: "paused";
|
|
11
|
+
};
|
|
12
|
+
export type WorkflowRunStatus = (typeof WorkflowRunStatus)[keyof typeof WorkflowRunStatus];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
export const WorkflowRunStatus = {
|
|
3
|
+
Created: "created",
|
|
4
|
+
Queued: "queued",
|
|
5
|
+
Running: "running",
|
|
6
|
+
Failed: "failed",
|
|
7
|
+
Terminated: "terminated",
|
|
8
|
+
Canceled: "canceled",
|
|
9
|
+
TimedOut: "timed_out",
|
|
10
|
+
Completed: "completed",
|
|
11
|
+
Paused: "paused",
|
|
12
|
+
};
|
|
@@ -38,6 +38,7 @@ export * from "./ConditionalBlockYaml.mjs";
|
|
|
38
38
|
export * from "./ContextParameter.mjs";
|
|
39
39
|
export * from "./ContextParameterSource.mjs";
|
|
40
40
|
export * from "./ContextParameterYaml.mjs";
|
|
41
|
+
export * from "./CreateCredentialRequest.mjs";
|
|
41
42
|
export * from "./CreateScriptResponse.mjs";
|
|
42
43
|
export * from "./CredentialParameter.mjs";
|
|
43
44
|
export * from "./CredentialParameterYaml.mjs";
|
|
@@ -166,9 +167,11 @@ export * from "./WorkflowParameter.mjs";
|
|
|
166
167
|
export * from "./WorkflowParameterType.mjs";
|
|
167
168
|
export * from "./WorkflowParameterYaml.mjs";
|
|
168
169
|
export * from "./WorkflowRequest.mjs";
|
|
170
|
+
export * from "./WorkflowRun.mjs";
|
|
169
171
|
export * from "./WorkflowRunBlock.mjs";
|
|
170
172
|
export * from "./WorkflowRunRequest.mjs";
|
|
171
173
|
export * from "./WorkflowRunResponse.mjs";
|
|
174
|
+
export * from "./WorkflowRunStatus.mjs";
|
|
172
175
|
export * from "./WorkflowRunTimeline.mjs";
|
|
173
176
|
export * from "./WorkflowRunTimelineType.mjs";
|
|
174
177
|
export * from "./WorkflowStatus.mjs";
|
|
@@ -38,6 +38,7 @@ export * from "./ConditionalBlockYaml.mjs";
|
|
|
38
38
|
export * from "./ContextParameter.mjs";
|
|
39
39
|
export * from "./ContextParameterSource.mjs";
|
|
40
40
|
export * from "./ContextParameterYaml.mjs";
|
|
41
|
+
export * from "./CreateCredentialRequest.mjs";
|
|
41
42
|
export * from "./CreateScriptResponse.mjs";
|
|
42
43
|
export * from "./CredentialParameter.mjs";
|
|
43
44
|
export * from "./CredentialParameterYaml.mjs";
|
|
@@ -166,9 +167,11 @@ export * from "./WorkflowParameter.mjs";
|
|
|
166
167
|
export * from "./WorkflowParameterType.mjs";
|
|
167
168
|
export * from "./WorkflowParameterYaml.mjs";
|
|
168
169
|
export * from "./WorkflowRequest.mjs";
|
|
170
|
+
export * from "./WorkflowRun.mjs";
|
|
169
171
|
export * from "./WorkflowRunBlock.mjs";
|
|
170
172
|
export * from "./WorkflowRunRequest.mjs";
|
|
171
173
|
export * from "./WorkflowRunResponse.mjs";
|
|
174
|
+
export * from "./WorkflowRunStatus.mjs";
|
|
172
175
|
export * from "./WorkflowRunTimeline.mjs";
|
|
173
176
|
export * from "./WorkflowRunTimelineType.mjs";
|
|
174
177
|
export * from "./WorkflowStatus.mjs";
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.0.
|
|
1
|
+
export declare const SDK_VERSION = "1.0.15";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "1.0.
|
|
1
|
+
export const SDK_VERSION = "1.0.15";
|
package/package.json
CHANGED
/package/dist/cjs/api/client/requests/{CreateCredentialRequest.js → GetWorkflowRunsRequest.js}
RENAMED
|
File without changes
|
/package/dist/esm/api/client/requests/{CreateCredentialRequest.mjs → GetWorkflowRunsRequest.mjs}
RENAMED
|
File without changes
|