SDK: docs and improvements (#4310)
This commit is contained in:
committed by
GitHub
parent
0d6a070a80
commit
5d2bb07371
@@ -535,6 +535,7 @@ describe("SkyvernClient", () => {
|
||||
workflow_permanent_id: "workflow_permanent_id",
|
||||
version: 1,
|
||||
is_saved_task: true,
|
||||
is_template: true,
|
||||
description: "description",
|
||||
workflow_definition: {
|
||||
version: 1,
|
||||
@@ -591,6 +592,7 @@ describe("SkyvernClient", () => {
|
||||
page_size: 1,
|
||||
only_saved_tasks: true,
|
||||
only_workflows: true,
|
||||
only_templates: true,
|
||||
search_key: "search_key",
|
||||
title: "title",
|
||||
folder_id: "folder_id",
|
||||
@@ -604,6 +606,7 @@ describe("SkyvernClient", () => {
|
||||
workflow_permanent_id: "workflow_permanent_id",
|
||||
version: 1,
|
||||
is_saved_task: true,
|
||||
is_template: true,
|
||||
description: "description",
|
||||
workflow_definition: {
|
||||
version: 1,
|
||||
@@ -682,6 +685,7 @@ describe("SkyvernClient", () => {
|
||||
workflow_permanent_id: "workflow_permanent_id",
|
||||
version: 1,
|
||||
is_saved_task: true,
|
||||
is_template: true,
|
||||
description: "description",
|
||||
workflow_definition: {
|
||||
version: 1,
|
||||
@@ -750,6 +754,7 @@ describe("SkyvernClient", () => {
|
||||
workflow_permanent_id: "workflow_permanent_id",
|
||||
version: 1,
|
||||
is_saved_task: true,
|
||||
is_template: true,
|
||||
description: "description",
|
||||
workflow_definition: {
|
||||
version: 1,
|
||||
@@ -836,6 +841,7 @@ describe("SkyvernClient", () => {
|
||||
workflow_permanent_id: "workflow_permanent_id",
|
||||
version: 1,
|
||||
is_saved_task: true,
|
||||
is_template: true,
|
||||
description: "description",
|
||||
workflow_definition: {
|
||||
version: 1,
|
||||
@@ -901,6 +907,7 @@ describe("SkyvernClient", () => {
|
||||
workflow_permanent_id: "workflow_permanent_id",
|
||||
version: 1,
|
||||
is_saved_task: true,
|
||||
is_template: true,
|
||||
description: "description",
|
||||
workflow_definition: {
|
||||
version: 1,
|
||||
@@ -1025,6 +1032,7 @@ describe("SkyvernClient", () => {
|
||||
step_id: "step_id",
|
||||
workflow_run_id: "workflow_run_id",
|
||||
workflow_run_block_id: "workflow_run_block_id",
|
||||
run_id: "run_id",
|
||||
observer_cruise_id: "observer_cruise_id",
|
||||
observer_thought_id: "observer_thought_id",
|
||||
ai_suggestion_id: "ai_suggestion_id",
|
||||
@@ -1050,6 +1058,7 @@ describe("SkyvernClient", () => {
|
||||
step_id: "step_id",
|
||||
workflow_run_id: "workflow_run_id",
|
||||
workflow_run_block_id: "workflow_run_block_id",
|
||||
run_id: "run_id",
|
||||
observer_cruise_id: "observer_cruise_id",
|
||||
observer_thought_id: "observer_thought_id",
|
||||
ai_suggestion_id: "ai_suggestion_id",
|
||||
@@ -1109,6 +1118,7 @@ describe("SkyvernClient", () => {
|
||||
step_id: "step_id",
|
||||
workflow_run_id: "workflow_run_id",
|
||||
workflow_run_block_id: "workflow_run_block_id",
|
||||
run_id: "run_id",
|
||||
observer_cruise_id: "observer_cruise_id",
|
||||
observer_thought_id: "observer_thought_id",
|
||||
ai_suggestion_id: "ai_suggestion_id",
|
||||
@@ -1136,6 +1146,7 @@ describe("SkyvernClient", () => {
|
||||
step_id: "step_id",
|
||||
workflow_run_id: "workflow_run_id",
|
||||
workflow_run_block_id: "workflow_run_block_id",
|
||||
run_id: "run_id",
|
||||
observer_cruise_id: "observer_cruise_id",
|
||||
observer_thought_id: "observer_thought_id",
|
||||
ai_suggestion_id: "ai_suggestion_id",
|
||||
|
||||
48
skyvern-ts/client/tests/wire/workflows.test.ts
Normal file
48
skyvern-ts/client/tests/wire/workflows.test.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
// This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import * as Skyvern from "../../src/api/index";
|
||||
import { SkyvernClient } from "../../src/Client";
|
||||
import { mockServerPool } from "../mock-server/MockServerPool";
|
||||
|
||||
describe("Workflows", () => {
|
||||
test("setWorkflowTemplateStatus (1)", async () => {
|
||||
const server = mockServerPool.createServer();
|
||||
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
|
||||
|
||||
const rawResponseBody = { key: "value" };
|
||||
server
|
||||
.mockEndpoint()
|
||||
.put("/v1/workflows/workflow_permanent_id/template")
|
||||
.respondWith()
|
||||
.statusCode(200)
|
||||
.jsonBody(rawResponseBody)
|
||||
.build();
|
||||
|
||||
const response = await client.workflows.setWorkflowTemplateStatus("workflow_permanent_id", {
|
||||
is_template: true,
|
||||
});
|
||||
expect(response).toEqual({
|
||||
key: "value",
|
||||
});
|
||||
});
|
||||
|
||||
test("setWorkflowTemplateStatus (2)", async () => {
|
||||
const server = mockServerPool.createServer();
|
||||
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
|
||||
|
||||
const rawResponseBody = { key: "value" };
|
||||
server
|
||||
.mockEndpoint()
|
||||
.put("/v1/workflows/workflow_permanent_id/template")
|
||||
.respondWith()
|
||||
.statusCode(422)
|
||||
.jsonBody(rawResponseBody)
|
||||
.build();
|
||||
|
||||
await expect(async () => {
|
||||
return await client.workflows.setWorkflowTemplateStatus("workflow_permanent_id", {
|
||||
is_template: true,
|
||||
});
|
||||
}).rejects.toThrow(Skyvern.UnprocessableEntityError);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user