@skyvern/client 1.0.11 → 1.0.13
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 +31 -0
- package/dist/cjs/Client.js +138 -2
- package/dist/cjs/api/client/requests/GetWorkflowRequest.d.ts +11 -0
- package/dist/cjs/api/client/requests/GetWorkflowRequest.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/index.d.ts +2 -0
- package/dist/cjs/api/types/BillingStateResponse.d.ts +1 -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/TaskRunRequest.d.ts +2 -0
- package/dist/cjs/api/types/ThoughtScenario.d.ts +7 -0
- package/dist/cjs/api/types/ThoughtScenario.js +7 -0
- package/dist/cjs/api/types/ThoughtType.d.ts +7 -0
- package/dist/cjs/api/types/ThoughtType.js +7 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.d.mts +31 -0
- package/dist/esm/Client.mjs +138 -2
- package/dist/esm/api/client/requests/GetWorkflowRequest.d.mts +11 -0
- package/dist/esm/api/client/requests/GetWorkflowRequest.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/index.d.mts +2 -0
- package/dist/esm/api/types/BillingStateResponse.d.mts +1 -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/TaskRunRequest.d.mts +2 -0
- package/dist/esm/api/types/ThoughtScenario.d.mts +7 -0
- package/dist/esm/api/types/ThoughtScenario.mjs +7 -0
- package/dist/esm/api/types/ThoughtType.d.mts +7 -0
- package/dist/esm/api/types/ThoughtType.mjs +7 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
package/dist/cjs/Client.d.ts
CHANGED
|
@@ -210,6 +210,37 @@ export declare class SkyvernClient {
|
|
|
210
210
|
*/
|
|
211
211
|
getRunTimeline(runId: string, requestOptions?: SkyvernClient.RequestOptions): core.HttpResponsePromise<Skyvern.WorkflowRunTimeline[]>;
|
|
212
212
|
private __getRunTimeline;
|
|
213
|
+
/**
|
|
214
|
+
* @param {string} workflowPermanentId
|
|
215
|
+
* @param {Skyvern.GetWorkflowRequest} request
|
|
216
|
+
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
217
|
+
*
|
|
218
|
+
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
219
|
+
*
|
|
220
|
+
* @example
|
|
221
|
+
* await client.getWorkflow("workflow_permanent_id", {
|
|
222
|
+
* version: 1,
|
|
223
|
+
* template: true
|
|
224
|
+
* })
|
|
225
|
+
*/
|
|
226
|
+
getWorkflow(workflowPermanentId: string, request?: Skyvern.GetWorkflowRequest, requestOptions?: SkyvernClient.RequestOptions): core.HttpResponsePromise<Skyvern.Workflow>;
|
|
227
|
+
private __getWorkflow;
|
|
228
|
+
/**
|
|
229
|
+
* Get all versions of a workflow by its permanent ID.
|
|
230
|
+
*
|
|
231
|
+
* @param {string} workflowPermanentId
|
|
232
|
+
* @param {Skyvern.GetWorkflowVersionsRequest} request
|
|
233
|
+
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
234
|
+
*
|
|
235
|
+
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
236
|
+
*
|
|
237
|
+
* @example
|
|
238
|
+
* await client.getWorkflowVersions("workflow_permanent_id", {
|
|
239
|
+
* template: true
|
|
240
|
+
* })
|
|
241
|
+
*/
|
|
242
|
+
getWorkflowVersions(workflowPermanentId: string, request?: Skyvern.GetWorkflowVersionsRequest, requestOptions?: SkyvernClient.RequestOptions): core.HttpResponsePromise<Skyvern.Workflow[]>;
|
|
243
|
+
private __getWorkflowVersions;
|
|
213
244
|
/**
|
|
214
245
|
* @param {Skyvern.BodyUploadFileV1UploadFilePost} request
|
|
215
246
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
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.13",
|
|
60
|
+
"User-Agent": "@skyvern/client/1.0.13",
|
|
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,142 @@ class SkyvernClient {
|
|
|
907
907
|
}
|
|
908
908
|
});
|
|
909
909
|
}
|
|
910
|
+
/**
|
|
911
|
+
* @param {string} workflowPermanentId
|
|
912
|
+
* @param {Skyvern.GetWorkflowRequest} request
|
|
913
|
+
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
914
|
+
*
|
|
915
|
+
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
916
|
+
*
|
|
917
|
+
* @example
|
|
918
|
+
* await client.getWorkflow("workflow_permanent_id", {
|
|
919
|
+
* version: 1,
|
|
920
|
+
* template: true
|
|
921
|
+
* })
|
|
922
|
+
*/
|
|
923
|
+
getWorkflow(workflowPermanentId, request = {}, requestOptions) {
|
|
924
|
+
return core.HttpResponsePromise.fromPromise(this.__getWorkflow(workflowPermanentId, request, requestOptions));
|
|
925
|
+
}
|
|
926
|
+
__getWorkflow(workflowPermanentId_1) {
|
|
927
|
+
return __awaiter(this, arguments, void 0, function* (workflowPermanentId, request = {}, requestOptions) {
|
|
928
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
929
|
+
const { version, template } = request;
|
|
930
|
+
const _queryParams = {};
|
|
931
|
+
if (version != null) {
|
|
932
|
+
_queryParams.version = version.toString();
|
|
933
|
+
}
|
|
934
|
+
if (template != null) {
|
|
935
|
+
_queryParams.template = template.toString();
|
|
936
|
+
}
|
|
937
|
+
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);
|
|
938
|
+
const _response = yield core.fetcher({
|
|
939
|
+
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)}`),
|
|
940
|
+
method: "GET",
|
|
941
|
+
headers: _headers,
|
|
942
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
943
|
+
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,
|
|
944
|
+
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,
|
|
945
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
946
|
+
});
|
|
947
|
+
if (_response.ok) {
|
|
948
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
949
|
+
}
|
|
950
|
+
if (_response.error.reason === "status-code") {
|
|
951
|
+
switch (_response.error.statusCode) {
|
|
952
|
+
case 422:
|
|
953
|
+
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
954
|
+
default:
|
|
955
|
+
throw new errors.SkyvernError({
|
|
956
|
+
statusCode: _response.error.statusCode,
|
|
957
|
+
body: _response.error.body,
|
|
958
|
+
rawResponse: _response.rawResponse,
|
|
959
|
+
});
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
switch (_response.error.reason) {
|
|
963
|
+
case "non-json":
|
|
964
|
+
throw new errors.SkyvernError({
|
|
965
|
+
statusCode: _response.error.statusCode,
|
|
966
|
+
body: _response.error.rawBody,
|
|
967
|
+
rawResponse: _response.rawResponse,
|
|
968
|
+
});
|
|
969
|
+
case "timeout":
|
|
970
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/workflows/{workflow_permanent_id}.");
|
|
971
|
+
case "unknown":
|
|
972
|
+
throw new errors.SkyvernError({
|
|
973
|
+
message: _response.error.errorMessage,
|
|
974
|
+
rawResponse: _response.rawResponse,
|
|
975
|
+
});
|
|
976
|
+
}
|
|
977
|
+
});
|
|
978
|
+
}
|
|
979
|
+
/**
|
|
980
|
+
* Get all versions of a workflow by its permanent ID.
|
|
981
|
+
*
|
|
982
|
+
* @param {string} workflowPermanentId
|
|
983
|
+
* @param {Skyvern.GetWorkflowVersionsRequest} request
|
|
984
|
+
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
985
|
+
*
|
|
986
|
+
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
987
|
+
*
|
|
988
|
+
* @example
|
|
989
|
+
* await client.getWorkflowVersions("workflow_permanent_id", {
|
|
990
|
+
* template: true
|
|
991
|
+
* })
|
|
992
|
+
*/
|
|
993
|
+
getWorkflowVersions(workflowPermanentId, request = {}, requestOptions) {
|
|
994
|
+
return core.HttpResponsePromise.fromPromise(this.__getWorkflowVersions(workflowPermanentId, request, requestOptions));
|
|
995
|
+
}
|
|
996
|
+
__getWorkflowVersions(workflowPermanentId_1) {
|
|
997
|
+
return __awaiter(this, arguments, void 0, function* (workflowPermanentId, request = {}, requestOptions) {
|
|
998
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
999
|
+
const { template } = request;
|
|
1000
|
+
const _queryParams = {};
|
|
1001
|
+
if (template != null) {
|
|
1002
|
+
_queryParams.template = template.toString();
|
|
1003
|
+
}
|
|
1004
|
+
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);
|
|
1005
|
+
const _response = yield core.fetcher({
|
|
1006
|
+
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`),
|
|
1007
|
+
method: "GET",
|
|
1008
|
+
headers: _headers,
|
|
1009
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
1010
|
+
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,
|
|
1011
|
+
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,
|
|
1012
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1013
|
+
});
|
|
1014
|
+
if (_response.ok) {
|
|
1015
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
1016
|
+
}
|
|
1017
|
+
if (_response.error.reason === "status-code") {
|
|
1018
|
+
switch (_response.error.statusCode) {
|
|
1019
|
+
case 422:
|
|
1020
|
+
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
1021
|
+
default:
|
|
1022
|
+
throw new errors.SkyvernError({
|
|
1023
|
+
statusCode: _response.error.statusCode,
|
|
1024
|
+
body: _response.error.body,
|
|
1025
|
+
rawResponse: _response.rawResponse,
|
|
1026
|
+
});
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
switch (_response.error.reason) {
|
|
1030
|
+
case "non-json":
|
|
1031
|
+
throw new errors.SkyvernError({
|
|
1032
|
+
statusCode: _response.error.statusCode,
|
|
1033
|
+
body: _response.error.rawBody,
|
|
1034
|
+
rawResponse: _response.rawResponse,
|
|
1035
|
+
});
|
|
1036
|
+
case "timeout":
|
|
1037
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/workflows/{workflow_permanent_id}/versions.");
|
|
1038
|
+
case "unknown":
|
|
1039
|
+
throw new errors.SkyvernError({
|
|
1040
|
+
message: _response.error.errorMessage,
|
|
1041
|
+
rawResponse: _response.rawResponse,
|
|
1042
|
+
});
|
|
1043
|
+
}
|
|
1044
|
+
});
|
|
1045
|
+
}
|
|
910
1046
|
/**
|
|
911
1047
|
* @param {Skyvern.BodyUploadFileV1UploadFilePost} request
|
|
912
1048
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -11,7 +11,9 @@ export type { DownloadFilesRequest } from "./DownloadFilesRequest.js";
|
|
|
11
11
|
export type { GetCredentialsRequest } from "./GetCredentialsRequest.js";
|
|
12
12
|
export type { GetRunArtifactsRequest } from "./GetRunArtifactsRequest.js";
|
|
13
13
|
export type { GetScriptsRequest } from "./GetScriptsRequest.js";
|
|
14
|
+
export type { GetWorkflowRequest } from "./GetWorkflowRequest.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";
|
|
@@ -83,6 +83,8 @@ export interface TaskRunRequest {
|
|
|
83
83
|
max_screenshot_scrolls?: number;
|
|
84
84
|
/** The CDP address for the task. */
|
|
85
85
|
browser_address?: string;
|
|
86
|
+
/** Whether to run the task with agent or code. */
|
|
87
|
+
run_with?: string;
|
|
86
88
|
}
|
|
87
89
|
export declare namespace TaskRunRequest {
|
|
88
90
|
/**
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scenario in which a thought was generated.
|
|
3
|
+
*
|
|
4
|
+
* Note: Stored as VARCHAR in the database (not a PostgreSQL ENUM), so new values
|
|
5
|
+
* can be added without database migrations. See observer_thoughts.observer_thought_scenario column.
|
|
6
|
+
*/
|
|
1
7
|
export declare const ThoughtScenario: {
|
|
2
8
|
readonly GeneratePlan: "generate_plan";
|
|
3
9
|
readonly UserGoalCheck: "user_goal_check";
|
|
@@ -7,5 +13,6 @@ export declare const ThoughtScenario: {
|
|
|
7
13
|
readonly ExtractLoopValues: "extract_loop_values";
|
|
8
14
|
readonly GenerateTaskInLoop: "generate_task_in_loop";
|
|
9
15
|
readonly GenerateGeneralTask: "generate_general_task";
|
|
16
|
+
readonly Termination: "termination";
|
|
10
17
|
};
|
|
11
18
|
export type ThoughtScenario = (typeof ThoughtScenario)[keyof typeof ThoughtScenario];
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
// This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.ThoughtScenario = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* Scenario in which a thought was generated.
|
|
7
|
+
*
|
|
8
|
+
* Note: Stored as VARCHAR in the database (not a PostgreSQL ENUM), so new values
|
|
9
|
+
* can be added without database migrations. See observer_thoughts.observer_thought_scenario column.
|
|
10
|
+
*/
|
|
5
11
|
exports.ThoughtScenario = {
|
|
6
12
|
GeneratePlan: "generate_plan",
|
|
7
13
|
UserGoalCheck: "user_goal_check",
|
|
@@ -11,4 +17,5 @@ exports.ThoughtScenario = {
|
|
|
11
17
|
ExtractLoopValues: "extract_loop_values",
|
|
12
18
|
GenerateTaskInLoop: "generate_task_in_loop",
|
|
13
19
|
GenerateGeneralTask: "generate_general_task",
|
|
20
|
+
Termination: "termination",
|
|
14
21
|
};
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type of thought recorded during task execution.
|
|
3
|
+
*
|
|
4
|
+
* Note: Stored as VARCHAR in the database (not a PostgreSQL ENUM), so new values
|
|
5
|
+
* can be added without database migrations. See observer_thoughts.observer_thought_type column.
|
|
6
|
+
*/
|
|
1
7
|
export declare const ThoughtType: {
|
|
2
8
|
readonly Plan: "plan";
|
|
3
9
|
readonly Metadata: "metadata";
|
|
4
10
|
readonly UserGoalCheck: "user_goal_check";
|
|
5
11
|
readonly InternalPlan: "internal_plan";
|
|
6
12
|
readonly FailureDescribe: "failure_describe";
|
|
13
|
+
readonly Termination: "termination";
|
|
7
14
|
};
|
|
8
15
|
export type ThoughtType = (typeof ThoughtType)[keyof typeof ThoughtType];
|
|
@@ -2,10 +2,17 @@
|
|
|
2
2
|
// This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.ThoughtType = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* Type of thought recorded during task execution.
|
|
7
|
+
*
|
|
8
|
+
* Note: Stored as VARCHAR in the database (not a PostgreSQL ENUM), so new values
|
|
9
|
+
* can be added without database migrations. See observer_thoughts.observer_thought_type column.
|
|
10
|
+
*/
|
|
5
11
|
exports.ThoughtType = {
|
|
6
12
|
Plan: "plan",
|
|
7
13
|
Metadata: "metadata",
|
|
8
14
|
UserGoalCheck: "user_goal_check",
|
|
9
15
|
InternalPlan: "internal_plan",
|
|
10
16
|
FailureDescribe: "failure_describe",
|
|
17
|
+
Termination: "termination",
|
|
11
18
|
};
|
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.13";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/Client.d.mts
CHANGED
|
@@ -210,6 +210,37 @@ export declare class SkyvernClient {
|
|
|
210
210
|
*/
|
|
211
211
|
getRunTimeline(runId: string, requestOptions?: SkyvernClient.RequestOptions): core.HttpResponsePromise<Skyvern.WorkflowRunTimeline[]>;
|
|
212
212
|
private __getRunTimeline;
|
|
213
|
+
/**
|
|
214
|
+
* @param {string} workflowPermanentId
|
|
215
|
+
* @param {Skyvern.GetWorkflowRequest} request
|
|
216
|
+
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
217
|
+
*
|
|
218
|
+
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
219
|
+
*
|
|
220
|
+
* @example
|
|
221
|
+
* await client.getWorkflow("workflow_permanent_id", {
|
|
222
|
+
* version: 1,
|
|
223
|
+
* template: true
|
|
224
|
+
* })
|
|
225
|
+
*/
|
|
226
|
+
getWorkflow(workflowPermanentId: string, request?: Skyvern.GetWorkflowRequest, requestOptions?: SkyvernClient.RequestOptions): core.HttpResponsePromise<Skyvern.Workflow>;
|
|
227
|
+
private __getWorkflow;
|
|
228
|
+
/**
|
|
229
|
+
* Get all versions of a workflow by its permanent ID.
|
|
230
|
+
*
|
|
231
|
+
* @param {string} workflowPermanentId
|
|
232
|
+
* @param {Skyvern.GetWorkflowVersionsRequest} request
|
|
233
|
+
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
234
|
+
*
|
|
235
|
+
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
236
|
+
*
|
|
237
|
+
* @example
|
|
238
|
+
* await client.getWorkflowVersions("workflow_permanent_id", {
|
|
239
|
+
* template: true
|
|
240
|
+
* })
|
|
241
|
+
*/
|
|
242
|
+
getWorkflowVersions(workflowPermanentId: string, request?: Skyvern.GetWorkflowVersionsRequest, requestOptions?: SkyvernClient.RequestOptions): core.HttpResponsePromise<Skyvern.Workflow[]>;
|
|
243
|
+
private __getWorkflowVersions;
|
|
213
244
|
/**
|
|
214
245
|
* @param {Skyvern.BodyUploadFileV1UploadFilePost} request
|
|
215
246
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
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.13",
|
|
24
|
+
"User-Agent": "@skyvern/client/1.0.13",
|
|
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,142 @@ export class SkyvernClient {
|
|
|
871
871
|
}
|
|
872
872
|
});
|
|
873
873
|
}
|
|
874
|
+
/**
|
|
875
|
+
* @param {string} workflowPermanentId
|
|
876
|
+
* @param {Skyvern.GetWorkflowRequest} request
|
|
877
|
+
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
878
|
+
*
|
|
879
|
+
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
880
|
+
*
|
|
881
|
+
* @example
|
|
882
|
+
* await client.getWorkflow("workflow_permanent_id", {
|
|
883
|
+
* version: 1,
|
|
884
|
+
* template: true
|
|
885
|
+
* })
|
|
886
|
+
*/
|
|
887
|
+
getWorkflow(workflowPermanentId, request = {}, requestOptions) {
|
|
888
|
+
return core.HttpResponsePromise.fromPromise(this.__getWorkflow(workflowPermanentId, request, requestOptions));
|
|
889
|
+
}
|
|
890
|
+
__getWorkflow(workflowPermanentId_1) {
|
|
891
|
+
return __awaiter(this, arguments, void 0, function* (workflowPermanentId, request = {}, requestOptions) {
|
|
892
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
893
|
+
const { version, template } = request;
|
|
894
|
+
const _queryParams = {};
|
|
895
|
+
if (version != null) {
|
|
896
|
+
_queryParams.version = version.toString();
|
|
897
|
+
}
|
|
898
|
+
if (template != null) {
|
|
899
|
+
_queryParams.template = template.toString();
|
|
900
|
+
}
|
|
901
|
+
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);
|
|
902
|
+
const _response = yield core.fetcher({
|
|
903
|
+
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)}`),
|
|
904
|
+
method: "GET",
|
|
905
|
+
headers: _headers,
|
|
906
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
907
|
+
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,
|
|
908
|
+
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,
|
|
909
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
910
|
+
});
|
|
911
|
+
if (_response.ok) {
|
|
912
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
913
|
+
}
|
|
914
|
+
if (_response.error.reason === "status-code") {
|
|
915
|
+
switch (_response.error.statusCode) {
|
|
916
|
+
case 422:
|
|
917
|
+
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
918
|
+
default:
|
|
919
|
+
throw new errors.SkyvernError({
|
|
920
|
+
statusCode: _response.error.statusCode,
|
|
921
|
+
body: _response.error.body,
|
|
922
|
+
rawResponse: _response.rawResponse,
|
|
923
|
+
});
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
switch (_response.error.reason) {
|
|
927
|
+
case "non-json":
|
|
928
|
+
throw new errors.SkyvernError({
|
|
929
|
+
statusCode: _response.error.statusCode,
|
|
930
|
+
body: _response.error.rawBody,
|
|
931
|
+
rawResponse: _response.rawResponse,
|
|
932
|
+
});
|
|
933
|
+
case "timeout":
|
|
934
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/workflows/{workflow_permanent_id}.");
|
|
935
|
+
case "unknown":
|
|
936
|
+
throw new errors.SkyvernError({
|
|
937
|
+
message: _response.error.errorMessage,
|
|
938
|
+
rawResponse: _response.rawResponse,
|
|
939
|
+
});
|
|
940
|
+
}
|
|
941
|
+
});
|
|
942
|
+
}
|
|
943
|
+
/**
|
|
944
|
+
* Get all versions of a workflow by its permanent ID.
|
|
945
|
+
*
|
|
946
|
+
* @param {string} workflowPermanentId
|
|
947
|
+
* @param {Skyvern.GetWorkflowVersionsRequest} request
|
|
948
|
+
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
949
|
+
*
|
|
950
|
+
* @throws {@link Skyvern.UnprocessableEntityError}
|
|
951
|
+
*
|
|
952
|
+
* @example
|
|
953
|
+
* await client.getWorkflowVersions("workflow_permanent_id", {
|
|
954
|
+
* template: true
|
|
955
|
+
* })
|
|
956
|
+
*/
|
|
957
|
+
getWorkflowVersions(workflowPermanentId, request = {}, requestOptions) {
|
|
958
|
+
return core.HttpResponsePromise.fromPromise(this.__getWorkflowVersions(workflowPermanentId, request, requestOptions));
|
|
959
|
+
}
|
|
960
|
+
__getWorkflowVersions(workflowPermanentId_1) {
|
|
961
|
+
return __awaiter(this, arguments, void 0, function* (workflowPermanentId, request = {}, requestOptions) {
|
|
962
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
963
|
+
const { template } = request;
|
|
964
|
+
const _queryParams = {};
|
|
965
|
+
if (template != null) {
|
|
966
|
+
_queryParams.template = template.toString();
|
|
967
|
+
}
|
|
968
|
+
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);
|
|
969
|
+
const _response = yield core.fetcher({
|
|
970
|
+
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`),
|
|
971
|
+
method: "GET",
|
|
972
|
+
headers: _headers,
|
|
973
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
974
|
+
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,
|
|
975
|
+
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,
|
|
976
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
977
|
+
});
|
|
978
|
+
if (_response.ok) {
|
|
979
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
980
|
+
}
|
|
981
|
+
if (_response.error.reason === "status-code") {
|
|
982
|
+
switch (_response.error.statusCode) {
|
|
983
|
+
case 422:
|
|
984
|
+
throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
985
|
+
default:
|
|
986
|
+
throw new errors.SkyvernError({
|
|
987
|
+
statusCode: _response.error.statusCode,
|
|
988
|
+
body: _response.error.body,
|
|
989
|
+
rawResponse: _response.rawResponse,
|
|
990
|
+
});
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
switch (_response.error.reason) {
|
|
994
|
+
case "non-json":
|
|
995
|
+
throw new errors.SkyvernError({
|
|
996
|
+
statusCode: _response.error.statusCode,
|
|
997
|
+
body: _response.error.rawBody,
|
|
998
|
+
rawResponse: _response.rawResponse,
|
|
999
|
+
});
|
|
1000
|
+
case "timeout":
|
|
1001
|
+
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/workflows/{workflow_permanent_id}/versions.");
|
|
1002
|
+
case "unknown":
|
|
1003
|
+
throw new errors.SkyvernError({
|
|
1004
|
+
message: _response.error.errorMessage,
|
|
1005
|
+
rawResponse: _response.rawResponse,
|
|
1006
|
+
});
|
|
1007
|
+
}
|
|
1008
|
+
});
|
|
1009
|
+
}
|
|
874
1010
|
/**
|
|
875
1011
|
* @param {Skyvern.BodyUploadFileV1UploadFilePost} request
|
|
876
1012
|
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -11,7 +11,9 @@ export type { DownloadFilesRequest } from "./DownloadFilesRequest.mjs";
|
|
|
11
11
|
export type { GetCredentialsRequest } from "./GetCredentialsRequest.mjs";
|
|
12
12
|
export type { GetRunArtifactsRequest } from "./GetRunArtifactsRequest.mjs";
|
|
13
13
|
export type { GetScriptsRequest } from "./GetScriptsRequest.mjs";
|
|
14
|
+
export type { GetWorkflowRequest } from "./GetWorkflowRequest.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";
|
|
@@ -83,6 +83,8 @@ export interface TaskRunRequest {
|
|
|
83
83
|
max_screenshot_scrolls?: number;
|
|
84
84
|
/** The CDP address for the task. */
|
|
85
85
|
browser_address?: string;
|
|
86
|
+
/** Whether to run the task with agent or code. */
|
|
87
|
+
run_with?: string;
|
|
86
88
|
}
|
|
87
89
|
export declare namespace TaskRunRequest {
|
|
88
90
|
/**
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scenario in which a thought was generated.
|
|
3
|
+
*
|
|
4
|
+
* Note: Stored as VARCHAR in the database (not a PostgreSQL ENUM), so new values
|
|
5
|
+
* can be added without database migrations. See observer_thoughts.observer_thought_scenario column.
|
|
6
|
+
*/
|
|
1
7
|
export declare const ThoughtScenario: {
|
|
2
8
|
readonly GeneratePlan: "generate_plan";
|
|
3
9
|
readonly UserGoalCheck: "user_goal_check";
|
|
@@ -7,5 +13,6 @@ export declare const ThoughtScenario: {
|
|
|
7
13
|
readonly ExtractLoopValues: "extract_loop_values";
|
|
8
14
|
readonly GenerateTaskInLoop: "generate_task_in_loop";
|
|
9
15
|
readonly GenerateGeneralTask: "generate_general_task";
|
|
16
|
+
readonly Termination: "termination";
|
|
10
17
|
};
|
|
11
18
|
export type ThoughtScenario = (typeof ThoughtScenario)[keyof typeof ThoughtScenario];
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
/**
|
|
3
|
+
* Scenario in which a thought was generated.
|
|
4
|
+
*
|
|
5
|
+
* Note: Stored as VARCHAR in the database (not a PostgreSQL ENUM), so new values
|
|
6
|
+
* can be added without database migrations. See observer_thoughts.observer_thought_scenario column.
|
|
7
|
+
*/
|
|
2
8
|
export const ThoughtScenario = {
|
|
3
9
|
GeneratePlan: "generate_plan",
|
|
4
10
|
UserGoalCheck: "user_goal_check",
|
|
@@ -8,4 +14,5 @@ export const ThoughtScenario = {
|
|
|
8
14
|
ExtractLoopValues: "extract_loop_values",
|
|
9
15
|
GenerateTaskInLoop: "generate_task_in_loop",
|
|
10
16
|
GenerateGeneralTask: "generate_general_task",
|
|
17
|
+
Termination: "termination",
|
|
11
18
|
};
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type of thought recorded during task execution.
|
|
3
|
+
*
|
|
4
|
+
* Note: Stored as VARCHAR in the database (not a PostgreSQL ENUM), so new values
|
|
5
|
+
* can be added without database migrations. See observer_thoughts.observer_thought_type column.
|
|
6
|
+
*/
|
|
1
7
|
export declare const ThoughtType: {
|
|
2
8
|
readonly Plan: "plan";
|
|
3
9
|
readonly Metadata: "metadata";
|
|
4
10
|
readonly UserGoalCheck: "user_goal_check";
|
|
5
11
|
readonly InternalPlan: "internal_plan";
|
|
6
12
|
readonly FailureDescribe: "failure_describe";
|
|
13
|
+
readonly Termination: "termination";
|
|
7
14
|
};
|
|
8
15
|
export type ThoughtType = (typeof ThoughtType)[keyof typeof ThoughtType];
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
/**
|
|
3
|
+
* Type of thought recorded during task execution.
|
|
4
|
+
*
|
|
5
|
+
* Note: Stored as VARCHAR in the database (not a PostgreSQL ENUM), so new values
|
|
6
|
+
* can be added without database migrations. See observer_thoughts.observer_thought_type column.
|
|
7
|
+
*/
|
|
2
8
|
export const ThoughtType = {
|
|
3
9
|
Plan: "plan",
|
|
4
10
|
Metadata: "metadata",
|
|
5
11
|
UserGoalCheck: "user_goal_check",
|
|
6
12
|
InternalPlan: "internal_plan",
|
|
7
13
|
FailureDescribe: "failure_describe",
|
|
14
|
+
Termination: "termination",
|
|
8
15
|
};
|
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.13";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "1.0.
|
|
1
|
+
export const SDK_VERSION = "1.0.13";
|