Release TS/Python SDK 2.22 (#3942)

This commit is contained in:
Stanislav Novosad
2025-11-07 12:30:43 -07:00
committed by GitHub
parent a9c3d692ff
commit 65a9259160
39 changed files with 1932 additions and 355 deletions

View File

@@ -568,6 +568,8 @@ describe("SkyvernClient", () => {
cache_key: "cache_key",
run_sequentially: true,
sequential_key: "sequential_key",
folder_id: "folder_id",
import_error: "import_error",
created_at: "2024-01-15T09:30:00Z",
modified_at: "2024-01-15T09:30:00Z",
deleted_at: "2024-01-15T09:30:00Z",
@@ -582,6 +584,7 @@ describe("SkyvernClient", () => {
only_workflows: true,
search_key: "search_key",
title: "title",
folder_id: "folder_id",
template: true,
});
expect(response).toEqual([
@@ -637,6 +640,8 @@ describe("SkyvernClient", () => {
cache_key: "cache_key",
run_sequentially: true,
sequential_key: "sequential_key",
folder_id: "folder_id",
import_error: "import_error",
created_at: "2024-01-15T09:30:00Z",
modified_at: "2024-01-15T09:30:00Z",
deleted_at: "2024-01-15T09:30:00Z",
@@ -708,6 +713,8 @@ describe("SkyvernClient", () => {
cache_key: "cache_key",
run_sequentially: true,
sequential_key: "sequential_key",
folder_id: "folder_id",
import_error: "import_error",
created_at: "2024-01-15T09:30:00Z",
modified_at: "2024-01-15T09:30:00Z",
deleted_at: "2024-01-15T09:30:00Z",
@@ -774,6 +781,8 @@ describe("SkyvernClient", () => {
cache_key: "cache_key",
run_sequentially: true,
sequential_key: "sequential_key",
folder_id: "folder_id",
import_error: "import_error",
created_at: "2024-01-15T09:30:00Z",
modified_at: "2024-01-15T09:30:00Z",
deleted_at: "2024-01-15T09:30:00Z",
@@ -851,6 +860,8 @@ describe("SkyvernClient", () => {
cache_key: "cache_key",
run_sequentially: true,
sequential_key: "sequential_key",
folder_id: "folder_id",
import_error: "import_error",
created_at: "2024-01-15T09:30:00Z",
modified_at: "2024-01-15T09:30:00Z",
deleted_at: "2024-01-15T09:30:00Z",
@@ -917,6 +928,8 @@ describe("SkyvernClient", () => {
cache_key: "cache_key",
run_sequentially: true,
sequential_key: "sequential_key",
folder_id: "folder_id",
import_error: "import_error",
created_at: "2024-01-15T09:30:00Z",
modified_at: "2024-01-15T09:30:00Z",
deleted_at: "2024-01-15T09:30:00Z",
@@ -2433,12 +2446,11 @@ describe("SkyvernClient", () => {
test("run_sdk_action (1)", async () => {
const server = mockServerPool.createServer();
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
const rawRequestBody = { url: "url", action: { type: "ai_click" } };
const rawResponseBody = { workflow_run_id: "workflow_run_id", result: "result" };
const rawRequestBody = { url: "url", action: { type: "ai_act" } };
const rawResponseBody = { workflow_run_id: "workflow_run_id", result: { key: "value" } };
server
.mockEndpoint()
.post("/v1/sdk/run_action")
.header("x-user-agent", "x-user-agent")
.jsonBody(rawRequestBody)
.respondWith()
.statusCode(200)
@@ -2446,94 +2458,23 @@ describe("SkyvernClient", () => {
.build();
const response = await client.runSdkAction({
"x-user-agent": "x-user-agent",
url: "url",
action: {
type: "ai_click",
type: "ai_act",
},
});
expect(response).toEqual({
workflow_run_id: "workflow_run_id",
result: "result",
result: {
key: "value",
},
});
});
test("run_sdk_action (2)", async () => {
const server = mockServerPool.createServer();
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
const rawRequestBody = { url: "url", action: { type: "ai_click" } };
const rawResponseBody = { key: "value" };
server
.mockEndpoint()
.post("/v1/sdk/run_action")
.jsonBody(rawRequestBody)
.respondWith()
.statusCode(400)
.jsonBody(rawResponseBody)
.build();
await expect(async () => {
return await client.runSdkAction({
url: "url",
action: {
type: "ai_click",
},
});
}).rejects.toThrow(Skyvern.BadRequestError);
});
test("run_sdk_action (3)", async () => {
const server = mockServerPool.createServer();
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
const rawRequestBody = { url: "url", action: { type: "ai_click" } };
const rawResponseBody = { key: "value" };
server
.mockEndpoint()
.post("/v1/sdk/run_action")
.jsonBody(rawRequestBody)
.respondWith()
.statusCode(403)
.jsonBody(rawResponseBody)
.build();
await expect(async () => {
return await client.runSdkAction({
url: "url",
action: {
type: "ai_click",
},
});
}).rejects.toThrow(Skyvern.ForbiddenError);
});
test("run_sdk_action (4)", async () => {
const server = mockServerPool.createServer();
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
const rawRequestBody = { url: "url", action: { type: "ai_click" } };
const rawResponseBody = { key: "value" };
server
.mockEndpoint()
.post("/v1/sdk/run_action")
.jsonBody(rawRequestBody)
.respondWith()
.statusCode(404)
.jsonBody(rawResponseBody)
.build();
await expect(async () => {
return await client.runSdkAction({
url: "url",
action: {
type: "ai_click",
},
});
}).rejects.toThrow(Skyvern.NotFoundError);
});
test("run_sdk_action (5)", async () => {
const server = mockServerPool.createServer();
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
const rawRequestBody = { url: "url", action: { type: "ai_click" } };
const rawRequestBody = { url: "url", action: { type: "ai_act" } };
const rawResponseBody = { key: "value" };
server
.mockEndpoint()
@@ -2548,7 +2489,7 @@ describe("SkyvernClient", () => {
return await client.runSdkAction({
url: "url",
action: {
type: "ai_click",
type: "ai_act",
},
});
}).rejects.toThrow(Skyvern.UnprocessableEntityError);