@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.
Files changed (51) hide show
  1. package/dist/cjs/Client.d.ts +97 -0
  2. package/dist/cjs/Client.js +321 -2
  3. package/dist/cjs/api/client/requests/GetWorkflowRequest.d.ts +11 -0
  4. package/dist/cjs/api/client/requests/GetWorkflowRunsRequest.d.ts +22 -0
  5. package/dist/cjs/api/client/requests/GetWorkflowRunsRequest.js +3 -0
  6. package/dist/cjs/api/client/requests/GetWorkflowVersionsRequest.d.ts +9 -0
  7. package/dist/cjs/api/client/requests/GetWorkflowVersionsRequest.js +3 -0
  8. package/dist/cjs/api/client/requests/GetWorkflowsRequest.d.ts +2 -2
  9. package/dist/cjs/api/client/requests/index.d.ts +3 -1
  10. package/dist/cjs/api/types/Action.d.ts +1 -0
  11. package/dist/cjs/api/types/BillingStateResponse.d.ts +1 -0
  12. package/dist/cjs/api/{client/requests → types}/CreateCredentialRequest.d.ts +2 -11
  13. package/dist/cjs/api/types/CreateCredentialRequest.js +3 -0
  14. package/dist/cjs/api/types/FileType.d.ts +2 -0
  15. package/dist/cjs/api/types/FileType.js +2 -0
  16. package/dist/cjs/api/types/ValidationError.d.ts +2 -0
  17. package/dist/cjs/api/types/WorkflowRun.d.ts +37 -0
  18. package/dist/cjs/api/types/WorkflowRun.js +3 -0
  19. package/dist/cjs/api/types/WorkflowRunStatus.d.ts +12 -0
  20. package/dist/cjs/api/types/WorkflowRunStatus.js +15 -0
  21. package/dist/cjs/api/types/index.d.ts +3 -0
  22. package/dist/cjs/api/types/index.js +3 -0
  23. package/dist/cjs/version.d.ts +1 -1
  24. package/dist/cjs/version.js +1 -1
  25. package/dist/esm/Client.d.mts +97 -0
  26. package/dist/esm/Client.mjs +321 -2
  27. package/dist/esm/api/client/requests/GetWorkflowRequest.d.mts +11 -0
  28. package/dist/esm/api/client/requests/GetWorkflowRunsRequest.d.mts +22 -0
  29. package/dist/esm/api/client/requests/GetWorkflowRunsRequest.mjs +2 -0
  30. package/dist/esm/api/client/requests/GetWorkflowVersionsRequest.d.mts +9 -0
  31. package/dist/esm/api/client/requests/GetWorkflowVersionsRequest.mjs +2 -0
  32. package/dist/esm/api/client/requests/GetWorkflowsRequest.d.mts +2 -2
  33. package/dist/esm/api/client/requests/index.d.mts +3 -1
  34. package/dist/esm/api/types/Action.d.mts +1 -0
  35. package/dist/esm/api/types/BillingStateResponse.d.mts +1 -0
  36. package/dist/esm/api/{client/requests → types}/CreateCredentialRequest.d.mts +2 -11
  37. package/dist/esm/api/types/CreateCredentialRequest.mjs +2 -0
  38. package/dist/esm/api/types/FileType.d.mts +2 -0
  39. package/dist/esm/api/types/FileType.mjs +2 -0
  40. package/dist/esm/api/types/ValidationError.d.mts +2 -0
  41. package/dist/esm/api/types/WorkflowRun.d.mts +37 -0
  42. package/dist/esm/api/types/WorkflowRun.mjs +2 -0
  43. package/dist/esm/api/types/WorkflowRunStatus.d.mts +12 -0
  44. package/dist/esm/api/types/WorkflowRunStatus.mjs +12 -0
  45. package/dist/esm/api/types/index.d.mts +3 -0
  46. package/dist/esm/api/types/index.mjs +3 -0
  47. package/dist/esm/version.d.mts +1 -1
  48. package/dist/esm/version.mjs +1 -1
  49. package/package.json +1 -1
  50. /package/dist/cjs/api/client/requests/{CreateCredentialRequest.js → GetWorkflowRequest.js} +0 -0
  51. /package/dist/esm/api/client/requests/{CreateCredentialRequest.mjs → GetWorkflowRequest.mjs} +0 -0
@@ -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);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.0.12";
1
+ export declare const SDK_VERSION = "1.0.14";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "1.0.12";
4
+ exports.SDK_VERSION = "1.0.14";
@@ -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
  *
@@ -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.12",
24
- "User-Agent": "@skyvern/client/1.0.12",
23
+ "X-Fern-SDK-Version": "1.0.14",
24
+ "User-Agent": "@skyvern/client/1.0.14",
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,255 @@ 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
+ }
987
+ /**
988
+ * @param {string} workflowPermanentId
989
+ * @param {Skyvern.GetWorkflowRequest} request
990
+ * @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
991
+ *
992
+ * @throws {@link Skyvern.UnprocessableEntityError}
993
+ *
994
+ * @example
995
+ * await client.getWorkflow("workflow_permanent_id", {
996
+ * version: 1,
997
+ * template: true
998
+ * })
999
+ */
1000
+ getWorkflow(workflowPermanentId, request = {}, requestOptions) {
1001
+ return core.HttpResponsePromise.fromPromise(this.__getWorkflow(workflowPermanentId, request, requestOptions));
1002
+ }
1003
+ __getWorkflow(workflowPermanentId_1) {
1004
+ return __awaiter(this, arguments, void 0, function* (workflowPermanentId, request = {}, requestOptions) {
1005
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1006
+ const { version, template } = request;
1007
+ const _queryParams = {};
1008
+ if (version != null) {
1009
+ _queryParams.version = version.toString();
1010
+ }
1011
+ if (template != null) {
1012
+ _queryParams.template = template.toString();
1013
+ }
1014
+ 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);
1015
+ const _response = yield core.fetcher({
1016
+ 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)}`),
1017
+ method: "GET",
1018
+ headers: _headers,
1019
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
1020
+ 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,
1021
+ 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,
1022
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1023
+ });
1024
+ if (_response.ok) {
1025
+ return { data: _response.body, rawResponse: _response.rawResponse };
1026
+ }
1027
+ if (_response.error.reason === "status-code") {
1028
+ switch (_response.error.statusCode) {
1029
+ case 422:
1030
+ throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
1031
+ default:
1032
+ throw new errors.SkyvernError({
1033
+ statusCode: _response.error.statusCode,
1034
+ body: _response.error.body,
1035
+ rawResponse: _response.rawResponse,
1036
+ });
1037
+ }
1038
+ }
1039
+ switch (_response.error.reason) {
1040
+ case "non-json":
1041
+ throw new errors.SkyvernError({
1042
+ statusCode: _response.error.statusCode,
1043
+ body: _response.error.rawBody,
1044
+ rawResponse: _response.rawResponse,
1045
+ });
1046
+ case "timeout":
1047
+ throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/workflows/{workflow_permanent_id}.");
1048
+ case "unknown":
1049
+ throw new errors.SkyvernError({
1050
+ message: _response.error.errorMessage,
1051
+ rawResponse: _response.rawResponse,
1052
+ });
1053
+ }
1054
+ });
1055
+ }
1056
+ /**
1057
+ * Get all versions of a workflow by its permanent ID.
1058
+ *
1059
+ * @param {string} workflowPermanentId
1060
+ * @param {Skyvern.GetWorkflowVersionsRequest} request
1061
+ * @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
1062
+ *
1063
+ * @throws {@link Skyvern.UnprocessableEntityError}
1064
+ *
1065
+ * @example
1066
+ * await client.getWorkflowVersions("workflow_permanent_id", {
1067
+ * template: true
1068
+ * })
1069
+ */
1070
+ getWorkflowVersions(workflowPermanentId, request = {}, requestOptions) {
1071
+ return core.HttpResponsePromise.fromPromise(this.__getWorkflowVersions(workflowPermanentId, request, requestOptions));
1072
+ }
1073
+ __getWorkflowVersions(workflowPermanentId_1) {
1074
+ return __awaiter(this, arguments, void 0, function* (workflowPermanentId, request = {}, requestOptions) {
1075
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1076
+ const { template } = request;
1077
+ const _queryParams = {};
1078
+ if (template != null) {
1079
+ _queryParams.template = template.toString();
1080
+ }
1081
+ 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);
1082
+ const _response = yield core.fetcher({
1083
+ 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`),
1084
+ method: "GET",
1085
+ headers: _headers,
1086
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
1087
+ 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,
1088
+ 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,
1089
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1090
+ });
1091
+ if (_response.ok) {
1092
+ return { data: _response.body, rawResponse: _response.rawResponse };
1093
+ }
1094
+ if (_response.error.reason === "status-code") {
1095
+ switch (_response.error.statusCode) {
1096
+ case 422:
1097
+ throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
1098
+ default:
1099
+ throw new errors.SkyvernError({
1100
+ statusCode: _response.error.statusCode,
1101
+ body: _response.error.body,
1102
+ rawResponse: _response.rawResponse,
1103
+ });
1104
+ }
1105
+ }
1106
+ switch (_response.error.reason) {
1107
+ case "non-json":
1108
+ throw new errors.SkyvernError({
1109
+ statusCode: _response.error.statusCode,
1110
+ body: _response.error.rawBody,
1111
+ rawResponse: _response.rawResponse,
1112
+ });
1113
+ case "timeout":
1114
+ throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/workflows/{workflow_permanent_id}/versions.");
1115
+ case "unknown":
1116
+ throw new errors.SkyvernError({
1117
+ message: _response.error.errorMessage,
1118
+ rawResponse: _response.rawResponse,
1119
+ });
1120
+ }
1121
+ });
1122
+ }
874
1123
  /**
875
1124
  * @param {Skyvern.BodyUploadFileV1UploadFilePost} request
876
1125
  * @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -1655,6 +1904,76 @@ export class SkyvernClient {
1655
1904
  }
1656
1905
  });
1657
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
+ }
1658
1977
  /**
1659
1978
  * Deletes a specific credential by its ID
1660
1979
  *
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * version: 1,
5
+ * template: true
6
+ * }
7
+ */
8
+ export interface GetWorkflowRequest {
9
+ version?: number;
10
+ template?: boolean;
11
+ }
@@ -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
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * template: true
5
+ * }
6
+ */
7
+ export interface GetWorkflowVersionsRequest {
8
+ template?: boolean;
9
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -19,9 +19,9 @@ export interface GetWorkflowsRequest {
19
19
  only_saved_tasks?: boolean;
20
20
  only_workflows?: boolean;
21
21
  only_templates?: boolean;
22
- /** Unified search across workflow title, folder name, and parameter metadata (key, description, default_value). */
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";
@@ -11,7 +10,10 @@ export type { DownloadFilesRequest } from "./DownloadFilesRequest.mjs";
11
10
  export type { GetCredentialsRequest } from "./GetCredentialsRequest.mjs";
12
11
  export type { GetRunArtifactsRequest } from "./GetRunArtifactsRequest.mjs";
13
12
  export type { GetScriptsRequest } from "./GetScriptsRequest.mjs";
13
+ export type { GetWorkflowRequest } from "./GetWorkflowRequest.mjs";
14
+ export type { GetWorkflowRunsRequest } from "./GetWorkflowRunsRequest.mjs";
14
15
  export type { GetWorkflowsRequest } from "./GetWorkflowsRequest.mjs";
16
+ export type { GetWorkflowVersionsRequest } from "./GetWorkflowVersionsRequest.mjs";
15
17
  export type { ListBrowserProfilesRequest } from "./ListBrowserProfilesRequest.mjs";
16
18
  export type { LoginRequest } from "./LoginRequest.mjs";
17
19
  export type { RunSdkActionRequest } from "./RunSdkActionRequest.mjs";
@@ -37,6 +37,7 @@ export interface Action {
37
37
  click_context?: Skyvern.ClickContext;
38
38
  totp_timing_info?: Record<string, unknown>;
39
39
  has_mini_agent?: boolean;
40
+ skip_auto_complete_tab?: boolean;
40
41
  created_at?: string;
41
42
  modified_at?: string;
42
43
  created_by?: string;
@@ -14,6 +14,7 @@ export interface BillingStateResponse {
14
14
  topup_credits_used: number;
15
15
  topup_credits_remaining: number;
16
16
  credits_remaining: number;
17
+ cancel_at_period_end?: boolean;
17
18
  created_at: string;
18
19
  modified_at: string;
19
20
  }