mirror of
https://github.com/Skyvern-AI/skyvern.git
synced 2026-07-09 16:09:13 +00:00
Bump version to 1.0.29 (#5347)
Some checks failed
Run tests and pre-commit / Run tests and pre-commit hooks (push) Waiting to run
Run tests and pre-commit / Frontend Lint and Build (push) Waiting to run
Publish Fern Docs / run (push) Waiting to run
Auto Create GitHub Release on Version Change / check-version-change (push) Has been cancelled
Build Skyvern SDK and publish to PyPI / check-version-change (push) Has been cancelled
Build Skyvern TS SDK and publish to npm / check-version-change (push) Has been cancelled
Auto Create GitHub Release on Version Change / create-release (push) Has been cancelled
Build Skyvern SDK and publish to PyPI / run-ci (push) Has been cancelled
Build Skyvern SDK and publish to PyPI / build-sdk (push) Has been cancelled
Build Skyvern TS SDK and publish to npm / build-and-publish-sdk (push) Has been cancelled
Some checks failed
Run tests and pre-commit / Run tests and pre-commit hooks (push) Waiting to run
Run tests and pre-commit / Frontend Lint and Build (push) Waiting to run
Publish Fern Docs / run (push) Waiting to run
Auto Create GitHub Release on Version Change / check-version-change (push) Has been cancelled
Build Skyvern SDK and publish to PyPI / check-version-change (push) Has been cancelled
Build Skyvern TS SDK and publish to npm / check-version-change (push) Has been cancelled
Auto Create GitHub Release on Version Change / create-release (push) Has been cancelled
Build Skyvern SDK and publish to PyPI / run-ci (push) Has been cancelled
Build Skyvern SDK and publish to PyPI / build-sdk (push) Has been cancelled
Build Skyvern TS SDK and publish to npm / build-and-publish-sdk (push) Has been cancelled
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
18811a7175
commit
df94c4799a
79 changed files with 4166 additions and 8945 deletions
|
|
@ -56,7 +56,7 @@ following namespace:
|
|||
```typescript
|
||||
import { Skyvern } from "@skyvern/client";
|
||||
|
||||
const request: Skyvern.ListOrganizationSchedulesApiV1SchedulesGetRequest = {
|
||||
const request: Skyvern.RunTaskRequest = {
|
||||
...
|
||||
};
|
||||
```
|
||||
|
|
|
|||
1163
skyvern-ts/client/package-lock.json
generated
1163
skyvern-ts/client/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@skyvern/client",
|
||||
"version": "1.0.28",
|
||||
"version": "1.0.29",
|
||||
"private": false,
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
|
|||
16
skyvern-ts/client/pnpm-lock.yaml
generated
16
skyvern-ts/client/pnpm-lock.yaml
generated
|
|
@ -7,7 +7,7 @@ importers:
|
|||
dependencies:
|
||||
playwright:
|
||||
specifier: ^1.48.0
|
||||
version: 1.58.2
|
||||
version: 1.59.1
|
||||
devDependencies:
|
||||
'@biomejs/biome':
|
||||
specifier: 2.2.5
|
||||
|
|
@ -656,12 +656,12 @@ packages:
|
|||
picomatch@4.0.3:
|
||||
resolution: {integrity: sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==}
|
||||
engines: {node: '>=12'}
|
||||
playwright-core@1.58.2:
|
||||
resolution: {integrity: sha512-yZkEtftgwS8CsfYo7nm0KE8jsvm6i/PTgVtB8DL726wNf6H2IMsDuxCpJj59KDaxCtSnrWan2AeDqM7JBaultg==}
|
||||
playwright-core@1.59.1:
|
||||
resolution: {integrity: sha512-HBV/RJg81z5BiiZ9yPzIiClYV/QMsDCKUyogwH9p3MCP6IYjUFu/MActgYAvK0oWyV9NlwM3GLBjADyWgydVyg==}
|
||||
engines: {node: '>=18'}
|
||||
hasBin: true
|
||||
playwright@1.58.2:
|
||||
resolution: {integrity: sha512-vA30H8Nvkq/cPBnNw4Q8TWz1EJyqgpuinBcHET0YVJVFldr8JDNiU9LaWAE1KqSkRYazuaBhTpB5ZzShOezQ6A==}
|
||||
playwright@1.59.1:
|
||||
resolution: {integrity: sha512-C8oWjPR3F81yljW9o5OxcWzfh6avkVwDD2VYdwIGqTkl+OGFISgypqzfu7dOe4QNLL2aqcWBmI3PMtLIK233lw==}
|
||||
engines: {node: '>=18'}
|
||||
hasBin: true
|
||||
postcss@8.5.6:
|
||||
|
|
@ -1401,10 +1401,10 @@ snapshots:
|
|||
picocolors@1.1.1: {}
|
||||
picomatch@2.3.1: {}
|
||||
picomatch@4.0.3: {}
|
||||
playwright-core@1.58.2: {}
|
||||
playwright@1.58.2:
|
||||
playwright-core@1.59.1: {}
|
||||
playwright@1.59.1:
|
||||
dependencies:
|
||||
playwright-core: 1.58.2
|
||||
playwright-core: 1.59.1
|
||||
optionalDependencies:
|
||||
fsevents: 2.3.2
|
||||
postcss@8.5.6:
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# Reference
|
||||
<details><summary><code>client.<a href="/src/Client.ts">changeTierApiV1BillingChangeTierPost</a>({ ...params }) -> Skyvern.ChangeTierResponse</code></summary>
|
||||
<details><summary><code>client.<a href="/src/Client.ts">runSdkAction</a>({ ...params }) -> Skyvern.RunSdkActionResponse</code></summary>
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
|
|
@ -11,10 +11,7 @@
|
|||
<dl>
|
||||
<dd>
|
||||
|
||||
Redirect to Stripe Portal for tier changes.
|
||||
Portal handles proration based on configured settings:
|
||||
- Upgrades: Immediate proration charge
|
||||
- Downgrades: Apply at end of billing period
|
||||
Execute a single SDK action with the specified parameters
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
|
|
@ -29,8 +26,11 @@ Portal handles proration based on configured settings:
|
|||
<dd>
|
||||
|
||||
```typescript
|
||||
await client.changeTierApiV1BillingChangeTierPost({
|
||||
tier: "free"
|
||||
await client.runSdkAction({
|
||||
url: "url",
|
||||
action: {
|
||||
type: "ai_act"
|
||||
}
|
||||
});
|
||||
|
||||
```
|
||||
|
|
@ -47,7 +47,7 @@ await client.changeTierApiV1BillingChangeTierPost({
|
|||
<dl>
|
||||
<dd>
|
||||
|
||||
**request:** `Skyvern.ChangeTierRequest`
|
||||
**request:** `Skyvern.RunSdkActionRequest`
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
|
@ -192,466 +192,6 @@ await client.scripts.runScript("s_abc123");
|
|||
</dl>
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
</details>
|
||||
|
||||
## Agent
|
||||
<details><summary><code>client.agent.<a href="/src/api/resources/agent/client/Client.ts">listOrganizationSchedules</a>({ ...params }) -> Skyvern.OrganizationScheduleListResponse</code></summary>
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
#### 🔌 Usage
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
```typescript
|
||||
await client.agent.listOrganizationSchedules({
|
||||
page: 1,
|
||||
page_size: 1,
|
||||
status: "active",
|
||||
search: "search"
|
||||
});
|
||||
|
||||
```
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
#### ⚙️ Parameters
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
**request:** `Skyvern.ListOrganizationSchedulesApiV1SchedulesGetRequest`
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
**requestOptions:** `Agent.RequestOptions`
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
</details>
|
||||
|
||||
<details><summary><code>client.agent.<a href="/src/api/resources/agent/client/Client.ts">listWorkflowSchedules</a>(workflowPermanentId) -> Skyvern.WorkflowScheduleListResponse</code></summary>
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
#### 🔌 Usage
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
```typescript
|
||||
await client.agent.listWorkflowSchedules("workflow_permanent_id");
|
||||
|
||||
```
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
#### ⚙️ Parameters
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
**workflowPermanentId:** `string`
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
**requestOptions:** `Agent.RequestOptions`
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
</details>
|
||||
|
||||
<details><summary><code>client.agent.<a href="/src/api/resources/agent/client/Client.ts">createWorkflowSchedule</a>(workflowPermanentId, { ...params }) -> Skyvern.WorkflowScheduleResponse</code></summary>
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
#### 🔌 Usage
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
```typescript
|
||||
await client.agent.createWorkflowSchedule("workflow_permanent_id", {
|
||||
cron_expression: "cron_expression",
|
||||
timezone: "timezone"
|
||||
});
|
||||
|
||||
```
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
#### ⚙️ Parameters
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
**workflowPermanentId:** `string`
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
**request:** `Skyvern.WorkflowScheduleUpsertRequest`
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
**requestOptions:** `Agent.RequestOptions`
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
</details>
|
||||
|
||||
<details><summary><code>client.agent.<a href="/src/api/resources/agent/client/Client.ts">getWorkflowSchedule</a>(workflowPermanentId, workflowScheduleId) -> Skyvern.WorkflowScheduleResponse</code></summary>
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
#### 🔌 Usage
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
```typescript
|
||||
await client.agent.getWorkflowSchedule("workflow_permanent_id", "workflow_schedule_id");
|
||||
|
||||
```
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
#### ⚙️ Parameters
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
**workflowPermanentId:** `string`
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
**workflowScheduleId:** `string`
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
**requestOptions:** `Agent.RequestOptions`
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
</details>
|
||||
|
||||
<details><summary><code>client.agent.<a href="/src/api/resources/agent/client/Client.ts">updateWorkflowSchedule</a>(workflowPermanentId, workflowScheduleId, { ...params }) -> Skyvern.WorkflowScheduleResponse</code></summary>
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
#### 🔌 Usage
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
```typescript
|
||||
await client.agent.updateWorkflowSchedule("workflow_permanent_id", "workflow_schedule_id", {
|
||||
cron_expression: "cron_expression",
|
||||
timezone: "timezone"
|
||||
});
|
||||
|
||||
```
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
#### ⚙️ Parameters
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
**workflowPermanentId:** `string`
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
**workflowScheduleId:** `string`
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
**request:** `Skyvern.WorkflowScheduleUpsertRequest`
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
**requestOptions:** `Agent.RequestOptions`
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
</details>
|
||||
|
||||
<details><summary><code>client.agent.<a href="/src/api/resources/agent/client/Client.ts">deleteWorkflowScheduleRoute</a>(workflowPermanentId, workflowScheduleId) -> Record<string, boolean></code></summary>
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
#### 🔌 Usage
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
```typescript
|
||||
await client.agent.deleteWorkflowScheduleRoute("workflow_permanent_id", "workflow_schedule_id");
|
||||
|
||||
```
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
#### ⚙️ Parameters
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
**workflowPermanentId:** `string`
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
**workflowScheduleId:** `string`
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
**requestOptions:** `Agent.RequestOptions`
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
</details>
|
||||
|
||||
<details><summary><code>client.agent.<a href="/src/api/resources/agent/client/Client.ts">enableWorkflowSchedule</a>(workflowPermanentId, workflowScheduleId) -> Skyvern.WorkflowScheduleResponse</code></summary>
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
#### 🔌 Usage
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
```typescript
|
||||
await client.agent.enableWorkflowSchedule("workflow_permanent_id", "workflow_schedule_id");
|
||||
|
||||
```
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
#### ⚙️ Parameters
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
**workflowPermanentId:** `string`
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
**workflowScheduleId:** `string`
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
**requestOptions:** `Agent.RequestOptions`
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
</details>
|
||||
|
||||
<details><summary><code>client.agent.<a href="/src/api/resources/agent/client/Client.ts">disableWorkflowSchedule</a>(workflowPermanentId, workflowScheduleId) -> Skyvern.WorkflowScheduleResponse</code></summary>
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
#### 🔌 Usage
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
```typescript
|
||||
await client.agent.disableWorkflowSchedule("workflow_permanent_id", "workflow_schedule_id");
|
||||
|
||||
```
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
#### ⚙️ Parameters
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
**workflowPermanentId:** `string`
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
**workflowScheduleId:** `string`
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
|
||||
**requestOptions:** `Agent.RequestOptions`
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
</details>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
// This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import * as Skyvern from "./api/index.js";
|
||||
import { Agent } from "./api/resources/agent/client/Client.js";
|
||||
import { Artifacts } from "./api/resources/artifacts/client/Client.js";
|
||||
import { Scripts } from "./api/resources/scripts/client/Client.js";
|
||||
import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.js";
|
||||
|
|
@ -20,7 +19,6 @@ export class SkyvernClient {
|
|||
protected readonly _options: SkyvernClient.Options;
|
||||
protected _artifacts: Artifacts | undefined;
|
||||
protected _scripts: Scripts | undefined;
|
||||
protected _agent: Agent | undefined;
|
||||
|
||||
constructor(_options: SkyvernClient.Options = {}) {
|
||||
this._options = {
|
||||
|
|
@ -30,8 +28,8 @@ export class SkyvernClient {
|
|||
"x-api-key": _options?.apiKey,
|
||||
"X-Fern-Language": "JavaScript",
|
||||
"X-Fern-SDK-Name": "@skyvern/client",
|
||||
"X-Fern-SDK-Version": "1.0.28",
|
||||
"User-Agent": "@skyvern/client/1.0.28",
|
||||
"X-Fern-SDK-Version": "1.0.29",
|
||||
"User-Agent": "@skyvern/client/1.0.29",
|
||||
"X-Fern-Runtime": core.RUNTIME.type,
|
||||
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
||||
},
|
||||
|
|
@ -48,10 +46,6 @@ export class SkyvernClient {
|
|||
return (this._scripts ??= new Scripts(this._options));
|
||||
}
|
||||
|
||||
public get agent(): Agent {
|
||||
return (this._agent ??= new Agent(this._options));
|
||||
}
|
||||
|
||||
/**
|
||||
* Run a task
|
||||
*
|
||||
|
|
@ -1302,84 +1296,6 @@ export class SkyvernClient {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an artifact
|
||||
*
|
||||
* @param {string} artifactId
|
||||
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
||||
*
|
||||
* @throws {@link Skyvern.NotFoundError}
|
||||
* @throws {@link Skyvern.UnprocessableEntityError}
|
||||
*
|
||||
* @example
|
||||
* await client.getArtifact("artifact_id")
|
||||
*/
|
||||
public getArtifact(
|
||||
artifactId: string,
|
||||
requestOptions?: SkyvernClient.RequestOptions,
|
||||
): core.HttpResponsePromise<Skyvern.Artifact> {
|
||||
return core.HttpResponsePromise.fromPromise(this.__getArtifact(artifactId, requestOptions));
|
||||
}
|
||||
|
||||
private async __getArtifact(
|
||||
artifactId: string,
|
||||
requestOptions?: SkyvernClient.RequestOptions,
|
||||
): Promise<core.WithRawResponse<Skyvern.Artifact>> {
|
||||
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
|
||||
this._options?.headers,
|
||||
mergeOnlyDefinedHeaders({ "x-api-key": requestOptions?.apiKey ?? this._options?.apiKey }),
|
||||
requestOptions?.headers,
|
||||
);
|
||||
const _response = await core.fetcher({
|
||||
url: core.url.join(
|
||||
(await core.Supplier.get(this._options.baseUrl)) ??
|
||||
(await core.Supplier.get(this._options.environment)) ??
|
||||
environments.SkyvernEnvironment.Cloud,
|
||||
`v1/artifacts/${core.url.encodePathParam(artifactId)}`,
|
||||
),
|
||||
method: "GET",
|
||||
headers: _headers,
|
||||
queryParameters: requestOptions?.queryParams,
|
||||
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
||||
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
||||
abortSignal: requestOptions?.abortSignal,
|
||||
});
|
||||
if (_response.ok) {
|
||||
return { data: _response.body as Skyvern.Artifact, rawResponse: _response.rawResponse };
|
||||
}
|
||||
|
||||
if (_response.error.reason === "status-code") {
|
||||
switch (_response.error.statusCode) {
|
||||
case 404:
|
||||
throw new Skyvern.NotFoundError(_response.error.body as unknown, _response.rawResponse);
|
||||
case 422:
|
||||
throw new Skyvern.UnprocessableEntityError(_response.error.body as unknown, _response.rawResponse);
|
||||
default:
|
||||
throw new errors.SkyvernError({
|
||||
statusCode: _response.error.statusCode,
|
||||
body: _response.error.body,
|
||||
rawResponse: _response.rawResponse,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
switch (_response.error.reason) {
|
||||
case "non-json":
|
||||
throw new errors.SkyvernError({
|
||||
statusCode: _response.error.statusCode,
|
||||
body: _response.error.rawBody,
|
||||
rawResponse: _response.rawResponse,
|
||||
});
|
||||
case "timeout":
|
||||
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/artifacts/{artifact_id}.");
|
||||
case "unknown":
|
||||
throw new errors.SkyvernError({
|
||||
message: _response.error.errorMessage,
|
||||
rawResponse: _response.rawResponse,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get artifacts for a run
|
||||
*
|
||||
|
|
@ -1632,6 +1548,105 @@ export class SkyvernClient {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Skyvern.GetRunsV2Request} request
|
||||
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
||||
*
|
||||
* @throws {@link Skyvern.UnprocessableEntityError}
|
||||
*
|
||||
* @example
|
||||
* await client.getRunsV2({
|
||||
* page: 1,
|
||||
* page_size: 1,
|
||||
* search_key: "search_key"
|
||||
* })
|
||||
*/
|
||||
public getRunsV2(
|
||||
request: Skyvern.GetRunsV2Request = {},
|
||||
requestOptions?: SkyvernClient.RequestOptions,
|
||||
): core.HttpResponsePromise<Skyvern.TaskRunListItem[]> {
|
||||
return core.HttpResponsePromise.fromPromise(this.__getRunsV2(request, requestOptions));
|
||||
}
|
||||
|
||||
private async __getRunsV2(
|
||||
request: Skyvern.GetRunsV2Request = {},
|
||||
requestOptions?: SkyvernClient.RequestOptions,
|
||||
): Promise<core.WithRawResponse<Skyvern.TaskRunListItem[]>> {
|
||||
const { page, page_size: pageSize, status, search_key: searchKey } = request;
|
||||
const _queryParams: Record<string, string | string[] | object | object[] | null> = {};
|
||||
if (page != null) {
|
||||
_queryParams.page = page.toString();
|
||||
}
|
||||
|
||||
if (pageSize != null) {
|
||||
_queryParams.page_size = pageSize.toString();
|
||||
}
|
||||
|
||||
if (status != null) {
|
||||
if (Array.isArray(status)) {
|
||||
_queryParams.status = status.map((item) => item);
|
||||
} else {
|
||||
_queryParams.status = status;
|
||||
}
|
||||
}
|
||||
|
||||
if (searchKey != null) {
|
||||
_queryParams.search_key = searchKey;
|
||||
}
|
||||
|
||||
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
|
||||
this._options?.headers,
|
||||
mergeOnlyDefinedHeaders({ "x-api-key": requestOptions?.apiKey ?? this._options?.apiKey }),
|
||||
requestOptions?.headers,
|
||||
);
|
||||
const _response = await core.fetcher({
|
||||
url: core.url.join(
|
||||
(await core.Supplier.get(this._options.baseUrl)) ??
|
||||
(await core.Supplier.get(this._options.environment)) ??
|
||||
environments.SkyvernEnvironment.Cloud,
|
||||
"v1/runs",
|
||||
),
|
||||
method: "GET",
|
||||
headers: _headers,
|
||||
queryParameters: { ..._queryParams, ...requestOptions?.queryParams },
|
||||
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
||||
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
||||
abortSignal: requestOptions?.abortSignal,
|
||||
});
|
||||
if (_response.ok) {
|
||||
return { data: _response.body as Skyvern.TaskRunListItem[], rawResponse: _response.rawResponse };
|
||||
}
|
||||
|
||||
if (_response.error.reason === "status-code") {
|
||||
switch (_response.error.statusCode) {
|
||||
case 422:
|
||||
throw new Skyvern.UnprocessableEntityError(_response.error.body as unknown, _response.rawResponse);
|
||||
default:
|
||||
throw new errors.SkyvernError({
|
||||
statusCode: _response.error.statusCode,
|
||||
body: _response.error.body,
|
||||
rawResponse: _response.rawResponse,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
switch (_response.error.reason) {
|
||||
case "non-json":
|
||||
throw new errors.SkyvernError({
|
||||
statusCode: _response.error.statusCode,
|
||||
body: _response.error.rawBody,
|
||||
rawResponse: _response.rawResponse,
|
||||
});
|
||||
case "timeout":
|
||||
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /v1/runs.");
|
||||
case "unknown":
|
||||
throw new errors.SkyvernError({
|
||||
message: _response.error.errorMessage,
|
||||
rawResponse: _response.rawResponse,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* List workflow runs across all workflows for the current organization.
|
||||
*
|
||||
|
|
@ -2774,7 +2789,8 @@ export class SkyvernClient {
|
|||
* @example
|
||||
* await client.getCredentials({
|
||||
* page: 1,
|
||||
* page_size: 10
|
||||
* page_size: 10,
|
||||
* vault_type: "bitwarden"
|
||||
* })
|
||||
*/
|
||||
public getCredentials(
|
||||
|
|
@ -2788,7 +2804,7 @@ export class SkyvernClient {
|
|||
request: Skyvern.GetCredentialsRequest = {},
|
||||
requestOptions?: SkyvernClient.RequestOptions,
|
||||
): Promise<core.WithRawResponse<Skyvern.CredentialResponse[]>> {
|
||||
const { page, page_size: pageSize } = request;
|
||||
const { page, page_size: pageSize, vault_type: vaultType } = request;
|
||||
const _queryParams: Record<string, string | string[] | object | object[] | null> = {};
|
||||
if (page != null) {
|
||||
_queryParams.page = page.toString();
|
||||
|
|
@ -2798,6 +2814,10 @@ export class SkyvernClient {
|
|||
_queryParams.page_size = pageSize.toString();
|
||||
}
|
||||
|
||||
if (vaultType != null) {
|
||||
_queryParams.vault_type = vaultType;
|
||||
}
|
||||
|
||||
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
|
||||
this._options?.headers,
|
||||
mergeOnlyDefinedHeaders({ "x-api-key": requestOptions?.apiKey ?? this._options?.apiKey }),
|
||||
|
|
@ -3753,329 +3773,4 @@ export class SkyvernClient {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Stripe Checkout Session for subscribing to a tier.
|
||||
*
|
||||
* Frontend should redirect the user to the returned URL.
|
||||
* After successful checkout, Stripe will send a webhook that we handle
|
||||
* to store the subscription and initialize billing state.
|
||||
*
|
||||
* Returns 400 if org already has an active subscription (use portal instead).
|
||||
*
|
||||
* @param {Skyvern.CheckoutSubscriptionRequest} request
|
||||
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
||||
*
|
||||
* @throws {@link Skyvern.UnprocessableEntityError}
|
||||
*
|
||||
* @example
|
||||
* await client.createCheckoutSessionApiV1BillingCheckoutPost({
|
||||
* tier: "free"
|
||||
* })
|
||||
*/
|
||||
public createCheckoutSessionApiV1BillingCheckoutPost(
|
||||
request: Skyvern.CheckoutSubscriptionRequest,
|
||||
requestOptions?: SkyvernClient.RequestOptions,
|
||||
): core.HttpResponsePromise<Skyvern.CheckoutSessionResponse> {
|
||||
return core.HttpResponsePromise.fromPromise(
|
||||
this.__createCheckoutSessionApiV1BillingCheckoutPost(request, requestOptions),
|
||||
);
|
||||
}
|
||||
|
||||
private async __createCheckoutSessionApiV1BillingCheckoutPost(
|
||||
request: Skyvern.CheckoutSubscriptionRequest,
|
||||
requestOptions?: SkyvernClient.RequestOptions,
|
||||
): Promise<core.WithRawResponse<Skyvern.CheckoutSessionResponse>> {
|
||||
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
|
||||
this._options?.headers,
|
||||
mergeOnlyDefinedHeaders({ "x-api-key": requestOptions?.apiKey ?? this._options?.apiKey }),
|
||||
requestOptions?.headers,
|
||||
);
|
||||
const _response = await core.fetcher({
|
||||
url: core.url.join(
|
||||
(await core.Supplier.get(this._options.baseUrl)) ??
|
||||
(await core.Supplier.get(this._options.environment)) ??
|
||||
environments.SkyvernEnvironment.Cloud,
|
||||
"api/v1/billing/checkout",
|
||||
),
|
||||
method: "POST",
|
||||
headers: _headers,
|
||||
contentType: "application/json",
|
||||
queryParameters: requestOptions?.queryParams,
|
||||
requestType: "json",
|
||||
body: request,
|
||||
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
||||
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
||||
abortSignal: requestOptions?.abortSignal,
|
||||
});
|
||||
if (_response.ok) {
|
||||
return { data: _response.body as Skyvern.CheckoutSessionResponse, rawResponse: _response.rawResponse };
|
||||
}
|
||||
|
||||
if (_response.error.reason === "status-code") {
|
||||
switch (_response.error.statusCode) {
|
||||
case 422:
|
||||
throw new Skyvern.UnprocessableEntityError(_response.error.body as unknown, _response.rawResponse);
|
||||
default:
|
||||
throw new errors.SkyvernError({
|
||||
statusCode: _response.error.statusCode,
|
||||
body: _response.error.body,
|
||||
rawResponse: _response.rawResponse,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
switch (_response.error.reason) {
|
||||
case "non-json":
|
||||
throw new errors.SkyvernError({
|
||||
statusCode: _response.error.statusCode,
|
||||
body: _response.error.rawBody,
|
||||
rawResponse: _response.rawResponse,
|
||||
});
|
||||
case "timeout":
|
||||
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /api/v1/billing/checkout.");
|
||||
case "unknown":
|
||||
throw new errors.SkyvernError({
|
||||
message: _response.error.errorMessage,
|
||||
rawResponse: _response.rawResponse,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Stripe Customer Portal session for managing subscription.
|
||||
*
|
||||
* Frontend should redirect the user to the returned URL.
|
||||
* The portal allows users to:
|
||||
* - Update payment methods
|
||||
* - Upgrade/downgrade plans
|
||||
* - Cancel subscription
|
||||
* - View invoices
|
||||
*
|
||||
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
||||
*
|
||||
* @throws {@link Skyvern.UnprocessableEntityError}
|
||||
*
|
||||
* @example
|
||||
* await client.createPortalSessionApiV1BillingPortalPost()
|
||||
*/
|
||||
public createPortalSessionApiV1BillingPortalPost(
|
||||
requestOptions?: SkyvernClient.RequestOptions,
|
||||
): core.HttpResponsePromise<Skyvern.PortalSessionResponse> {
|
||||
return core.HttpResponsePromise.fromPromise(this.__createPortalSessionApiV1BillingPortalPost(requestOptions));
|
||||
}
|
||||
|
||||
private async __createPortalSessionApiV1BillingPortalPost(
|
||||
requestOptions?: SkyvernClient.RequestOptions,
|
||||
): Promise<core.WithRawResponse<Skyvern.PortalSessionResponse>> {
|
||||
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
|
||||
this._options?.headers,
|
||||
mergeOnlyDefinedHeaders({ "x-api-key": requestOptions?.apiKey ?? this._options?.apiKey }),
|
||||
requestOptions?.headers,
|
||||
);
|
||||
const _response = await core.fetcher({
|
||||
url: core.url.join(
|
||||
(await core.Supplier.get(this._options.baseUrl)) ??
|
||||
(await core.Supplier.get(this._options.environment)) ??
|
||||
environments.SkyvernEnvironment.Cloud,
|
||||
"api/v1/billing/portal",
|
||||
),
|
||||
method: "POST",
|
||||
headers: _headers,
|
||||
queryParameters: requestOptions?.queryParams,
|
||||
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
||||
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
||||
abortSignal: requestOptions?.abortSignal,
|
||||
});
|
||||
if (_response.ok) {
|
||||
return { data: _response.body as Skyvern.PortalSessionResponse, rawResponse: _response.rawResponse };
|
||||
}
|
||||
|
||||
if (_response.error.reason === "status-code") {
|
||||
switch (_response.error.statusCode) {
|
||||
case 422:
|
||||
throw new Skyvern.UnprocessableEntityError(_response.error.body as unknown, _response.rawResponse);
|
||||
default:
|
||||
throw new errors.SkyvernError({
|
||||
statusCode: _response.error.statusCode,
|
||||
body: _response.error.body,
|
||||
rawResponse: _response.rawResponse,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
switch (_response.error.reason) {
|
||||
case "non-json":
|
||||
throw new errors.SkyvernError({
|
||||
statusCode: _response.error.statusCode,
|
||||
body: _response.error.rawBody,
|
||||
rawResponse: _response.rawResponse,
|
||||
});
|
||||
case "timeout":
|
||||
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /api/v1/billing/portal.");
|
||||
case "unknown":
|
||||
throw new errors.SkyvernError({
|
||||
message: _response.error.errorMessage,
|
||||
rawResponse: _response.rawResponse,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
||||
*
|
||||
* @throws {@link Skyvern.UnprocessableEntityError}
|
||||
*
|
||||
* @example
|
||||
* await client.getOrganizationBillingApiV1BillingStateGet()
|
||||
*/
|
||||
public getOrganizationBillingApiV1BillingStateGet(
|
||||
requestOptions?: SkyvernClient.RequestOptions,
|
||||
): core.HttpResponsePromise<Skyvern.BillingStateResponse | undefined> {
|
||||
return core.HttpResponsePromise.fromPromise(this.__getOrganizationBillingApiV1BillingStateGet(requestOptions));
|
||||
}
|
||||
|
||||
private async __getOrganizationBillingApiV1BillingStateGet(
|
||||
requestOptions?: SkyvernClient.RequestOptions,
|
||||
): Promise<core.WithRawResponse<Skyvern.BillingStateResponse | undefined>> {
|
||||
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
|
||||
this._options?.headers,
|
||||
mergeOnlyDefinedHeaders({ "x-api-key": requestOptions?.apiKey ?? this._options?.apiKey }),
|
||||
requestOptions?.headers,
|
||||
);
|
||||
const _response = await core.fetcher({
|
||||
url: core.url.join(
|
||||
(await core.Supplier.get(this._options.baseUrl)) ??
|
||||
(await core.Supplier.get(this._options.environment)) ??
|
||||
environments.SkyvernEnvironment.Cloud,
|
||||
"api/v1/billing/state",
|
||||
),
|
||||
method: "GET",
|
||||
headers: _headers,
|
||||
queryParameters: requestOptions?.queryParams,
|
||||
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
||||
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
||||
abortSignal: requestOptions?.abortSignal,
|
||||
});
|
||||
if (_response.ok) {
|
||||
return {
|
||||
data: _response.body as Skyvern.BillingStateResponse | undefined,
|
||||
rawResponse: _response.rawResponse,
|
||||
};
|
||||
}
|
||||
|
||||
if (_response.error.reason === "status-code") {
|
||||
switch (_response.error.statusCode) {
|
||||
case 422:
|
||||
throw new Skyvern.UnprocessableEntityError(_response.error.body as unknown, _response.rawResponse);
|
||||
default:
|
||||
throw new errors.SkyvernError({
|
||||
statusCode: _response.error.statusCode,
|
||||
body: _response.error.body,
|
||||
rawResponse: _response.rawResponse,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
switch (_response.error.reason) {
|
||||
case "non-json":
|
||||
throw new errors.SkyvernError({
|
||||
statusCode: _response.error.statusCode,
|
||||
body: _response.error.rawBody,
|
||||
rawResponse: _response.rawResponse,
|
||||
});
|
||||
case "timeout":
|
||||
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /api/v1/billing/state.");
|
||||
case "unknown":
|
||||
throw new errors.SkyvernError({
|
||||
message: _response.error.errorMessage,
|
||||
rawResponse: _response.rawResponse,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Redirect to Stripe Portal for tier changes.
|
||||
* Portal handles proration based on configured settings:
|
||||
* - Upgrades: Immediate proration charge
|
||||
* - Downgrades: Apply at end of billing period
|
||||
*
|
||||
* @param {Skyvern.ChangeTierRequest} request
|
||||
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
||||
*
|
||||
* @throws {@link Skyvern.UnprocessableEntityError}
|
||||
*
|
||||
* @example
|
||||
* await client.changeTierApiV1BillingChangeTierPost({
|
||||
* tier: "free"
|
||||
* })
|
||||
*/
|
||||
public changeTierApiV1BillingChangeTierPost(
|
||||
request: Skyvern.ChangeTierRequest,
|
||||
requestOptions?: SkyvernClient.RequestOptions,
|
||||
): core.HttpResponsePromise<Skyvern.ChangeTierResponse> {
|
||||
return core.HttpResponsePromise.fromPromise(
|
||||
this.__changeTierApiV1BillingChangeTierPost(request, requestOptions),
|
||||
);
|
||||
}
|
||||
|
||||
private async __changeTierApiV1BillingChangeTierPost(
|
||||
request: Skyvern.ChangeTierRequest,
|
||||
requestOptions?: SkyvernClient.RequestOptions,
|
||||
): Promise<core.WithRawResponse<Skyvern.ChangeTierResponse>> {
|
||||
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
|
||||
this._options?.headers,
|
||||
mergeOnlyDefinedHeaders({ "x-api-key": requestOptions?.apiKey ?? this._options?.apiKey }),
|
||||
requestOptions?.headers,
|
||||
);
|
||||
const _response = await core.fetcher({
|
||||
url: core.url.join(
|
||||
(await core.Supplier.get(this._options.baseUrl)) ??
|
||||
(await core.Supplier.get(this._options.environment)) ??
|
||||
environments.SkyvernEnvironment.Cloud,
|
||||
"api/v1/billing/change-tier",
|
||||
),
|
||||
method: "POST",
|
||||
headers: _headers,
|
||||
contentType: "application/json",
|
||||
queryParameters: requestOptions?.queryParams,
|
||||
requestType: "json",
|
||||
body: request,
|
||||
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
||||
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
||||
abortSignal: requestOptions?.abortSignal,
|
||||
});
|
||||
if (_response.ok) {
|
||||
return { data: _response.body as Skyvern.ChangeTierResponse, rawResponse: _response.rawResponse };
|
||||
}
|
||||
|
||||
if (_response.error.reason === "status-code") {
|
||||
switch (_response.error.statusCode) {
|
||||
case 422:
|
||||
throw new Skyvern.UnprocessableEntityError(_response.error.body as unknown, _response.rawResponse);
|
||||
default:
|
||||
throw new errors.SkyvernError({
|
||||
statusCode: _response.error.statusCode,
|
||||
body: _response.error.body,
|
||||
rawResponse: _response.rawResponse,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
switch (_response.error.reason) {
|
||||
case "non-json":
|
||||
throw new errors.SkyvernError({
|
||||
statusCode: _response.error.statusCode,
|
||||
body: _response.error.rawBody,
|
||||
rawResponse: _response.rawResponse,
|
||||
});
|
||||
case "timeout":
|
||||
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /api/v1/billing/change-tier.");
|
||||
case "unknown":
|
||||
throw new errors.SkyvernError({
|
||||
message: _response.error.errorMessage,
|
||||
rawResponse: _response.rawResponse,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +0,0 @@
|
|||
// This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import type * as Skyvern from "../../index.js";
|
||||
|
||||
/**
|
||||
* @example
|
||||
* {
|
||||
* tier: "free"
|
||||
* }
|
||||
*/
|
||||
export interface ChangeTierRequest {
|
||||
tier: Skyvern.PlanTier;
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
// This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import type * as Skyvern from "../../index.js";
|
||||
|
||||
/**
|
||||
* @example
|
||||
* {
|
||||
* tier: "free"
|
||||
* }
|
||||
*/
|
||||
export interface CheckoutSubscriptionRequest {
|
||||
tier: Skyvern.PlanTier;
|
||||
}
|
||||
|
|
@ -1,10 +1,13 @@
|
|||
// This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import type * as Skyvern from "../../index.js";
|
||||
|
||||
/**
|
||||
* @example
|
||||
* {
|
||||
* page: 1,
|
||||
* page_size: 10
|
||||
* page_size: 10,
|
||||
* vault_type: "bitwarden"
|
||||
* }
|
||||
*/
|
||||
export interface GetCredentialsRequest {
|
||||
|
|
@ -12,4 +15,6 @@ export interface GetCredentialsRequest {
|
|||
page?: number;
|
||||
/** Number of items per page */
|
||||
page_size?: number;
|
||||
/** Filter credentials by vault type (e.g. 'custom', 'bitwarden', 'azure_vault') */
|
||||
vault_type?: Skyvern.CredentialVaultType;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
// This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import type * as Skyvern from "../../index.js";
|
||||
|
||||
/**
|
||||
* @example
|
||||
* {
|
||||
* page: 1,
|
||||
* page_size: 1,
|
||||
* search_key: "search_key"
|
||||
* }
|
||||
*/
|
||||
export interface GetRunsV2Request {
|
||||
page?: number;
|
||||
page_size?: number;
|
||||
status?: Skyvern.RunStatus | Skyvern.RunStatus[];
|
||||
/** Case-insensitive substring search (min 3 chars for trigram index). */
|
||||
search_key?: string;
|
||||
}
|
||||
|
|
@ -1,6 +1,4 @@
|
|||
export type { BodyUploadFileV1UploadFilePost } from "./BodyUploadFileV1UploadFilePost.js";
|
||||
export type { ChangeTierRequest } from "./ChangeTierRequest.js";
|
||||
export type { CheckoutSubscriptionRequest } from "./CheckoutSubscriptionRequest.js";
|
||||
export type { CreateBrowserProfileRequest } from "./CreateBrowserProfileRequest.js";
|
||||
export type { CreateBrowserSessionRequest } from "./CreateBrowserSessionRequest.js";
|
||||
export type { CreateScriptRequest } from "./CreateScriptRequest.js";
|
||||
|
|
@ -13,6 +11,7 @@ export type { FolderUpdate } from "./FolderUpdate.js";
|
|||
export type { GetCredentialsRequest } from "./GetCredentialsRequest.js";
|
||||
export type { GetFoldersRequest } from "./GetFoldersRequest.js";
|
||||
export type { GetRunArtifactsRequest } from "./GetRunArtifactsRequest.js";
|
||||
export type { GetRunsV2Request } from "./GetRunsV2Request.js";
|
||||
export type { GetScriptsRequest } from "./GetScriptsRequest.js";
|
||||
export type { GetWorkflowRequest } from "./GetWorkflowRequest.js";
|
||||
export type { GetWorkflowRunsRequest } from "./GetWorkflowRunsRequest.js";
|
||||
|
|
|
|||
|
|
@ -1,691 +0,0 @@
|
|||
// This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
|
||||
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js";
|
||||
import * as core from "../../../../core/index.js";
|
||||
import * as environments from "../../../../environments.js";
|
||||
import * as errors from "../../../../errors/index.js";
|
||||
import * as Skyvern from "../../../index.js";
|
||||
|
||||
export declare namespace Agent {
|
||||
export interface Options extends BaseClientOptions {}
|
||||
|
||||
export interface RequestOptions extends BaseRequestOptions {}
|
||||
}
|
||||
|
||||
export class Agent {
|
||||
protected readonly _options: Agent.Options;
|
||||
|
||||
constructor(_options: Agent.Options = {}) {
|
||||
this._options = _options;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Skyvern.ListOrganizationSchedulesApiV1SchedulesGetRequest} request
|
||||
* @param {Agent.RequestOptions} requestOptions - Request-specific configuration.
|
||||
*
|
||||
* @throws {@link Skyvern.UnprocessableEntityError}
|
||||
*
|
||||
* @example
|
||||
* await client.agent.listOrganizationSchedules({
|
||||
* page: 1,
|
||||
* page_size: 1,
|
||||
* status: "active",
|
||||
* search: "search"
|
||||
* })
|
||||
*/
|
||||
public listOrganizationSchedules(
|
||||
request: Skyvern.ListOrganizationSchedulesApiV1SchedulesGetRequest = {},
|
||||
requestOptions?: Agent.RequestOptions,
|
||||
): core.HttpResponsePromise<Skyvern.OrganizationScheduleListResponse> {
|
||||
return core.HttpResponsePromise.fromPromise(this.__listOrganizationSchedules(request, requestOptions));
|
||||
}
|
||||
|
||||
private async __listOrganizationSchedules(
|
||||
request: Skyvern.ListOrganizationSchedulesApiV1SchedulesGetRequest = {},
|
||||
requestOptions?: Agent.RequestOptions,
|
||||
): Promise<core.WithRawResponse<Skyvern.OrganizationScheduleListResponse>> {
|
||||
const { page, page_size: pageSize, status, search } = request;
|
||||
const _queryParams: Record<string, string | string[] | object | object[] | null> = {};
|
||||
if (page != null) {
|
||||
_queryParams.page = page.toString();
|
||||
}
|
||||
|
||||
if (pageSize != null) {
|
||||
_queryParams.page_size = pageSize.toString();
|
||||
}
|
||||
|
||||
if (status != null) {
|
||||
_queryParams.status = status;
|
||||
}
|
||||
|
||||
if (search != null) {
|
||||
_queryParams.search = search;
|
||||
}
|
||||
|
||||
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
|
||||
this._options?.headers,
|
||||
mergeOnlyDefinedHeaders({ "x-api-key": requestOptions?.apiKey ?? this._options?.apiKey }),
|
||||
requestOptions?.headers,
|
||||
);
|
||||
const _response = await core.fetcher({
|
||||
url: core.url.join(
|
||||
(await core.Supplier.get(this._options.baseUrl)) ??
|
||||
(await core.Supplier.get(this._options.environment)) ??
|
||||
environments.SkyvernEnvironment.Cloud,
|
||||
"api/v1/schedules",
|
||||
),
|
||||
method: "GET",
|
||||
headers: _headers,
|
||||
queryParameters: { ..._queryParams, ...requestOptions?.queryParams },
|
||||
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
||||
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
||||
abortSignal: requestOptions?.abortSignal,
|
||||
});
|
||||
if (_response.ok) {
|
||||
return {
|
||||
data: _response.body as Skyvern.OrganizationScheduleListResponse,
|
||||
rawResponse: _response.rawResponse,
|
||||
};
|
||||
}
|
||||
|
||||
if (_response.error.reason === "status-code") {
|
||||
switch (_response.error.statusCode) {
|
||||
case 422:
|
||||
throw new Skyvern.UnprocessableEntityError(_response.error.body as unknown, _response.rawResponse);
|
||||
default:
|
||||
throw new errors.SkyvernError({
|
||||
statusCode: _response.error.statusCode,
|
||||
body: _response.error.body,
|
||||
rawResponse: _response.rawResponse,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
switch (_response.error.reason) {
|
||||
case "non-json":
|
||||
throw new errors.SkyvernError({
|
||||
statusCode: _response.error.statusCode,
|
||||
body: _response.error.rawBody,
|
||||
rawResponse: _response.rawResponse,
|
||||
});
|
||||
case "timeout":
|
||||
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /api/v1/schedules.");
|
||||
case "unknown":
|
||||
throw new errors.SkyvernError({
|
||||
message: _response.error.errorMessage,
|
||||
rawResponse: _response.rawResponse,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} workflowPermanentId
|
||||
* @param {Agent.RequestOptions} requestOptions - Request-specific configuration.
|
||||
*
|
||||
* @throws {@link Skyvern.UnprocessableEntityError}
|
||||
*
|
||||
* @example
|
||||
* await client.agent.listWorkflowSchedules("workflow_permanent_id")
|
||||
*/
|
||||
public listWorkflowSchedules(
|
||||
workflowPermanentId: string,
|
||||
requestOptions?: Agent.RequestOptions,
|
||||
): core.HttpResponsePromise<Skyvern.WorkflowScheduleListResponse> {
|
||||
return core.HttpResponsePromise.fromPromise(this.__listWorkflowSchedules(workflowPermanentId, requestOptions));
|
||||
}
|
||||
|
||||
private async __listWorkflowSchedules(
|
||||
workflowPermanentId: string,
|
||||
requestOptions?: Agent.RequestOptions,
|
||||
): Promise<core.WithRawResponse<Skyvern.WorkflowScheduleListResponse>> {
|
||||
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
|
||||
this._options?.headers,
|
||||
mergeOnlyDefinedHeaders({ "x-api-key": requestOptions?.apiKey ?? this._options?.apiKey }),
|
||||
requestOptions?.headers,
|
||||
);
|
||||
const _response = await core.fetcher({
|
||||
url: core.url.join(
|
||||
(await core.Supplier.get(this._options.baseUrl)) ??
|
||||
(await core.Supplier.get(this._options.environment)) ??
|
||||
environments.SkyvernEnvironment.Cloud,
|
||||
`api/v1/workflows/${core.url.encodePathParam(workflowPermanentId)}/schedules`,
|
||||
),
|
||||
method: "GET",
|
||||
headers: _headers,
|
||||
queryParameters: requestOptions?.queryParams,
|
||||
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
||||
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
||||
abortSignal: requestOptions?.abortSignal,
|
||||
});
|
||||
if (_response.ok) {
|
||||
return { data: _response.body as Skyvern.WorkflowScheduleListResponse, rawResponse: _response.rawResponse };
|
||||
}
|
||||
|
||||
if (_response.error.reason === "status-code") {
|
||||
switch (_response.error.statusCode) {
|
||||
case 422:
|
||||
throw new Skyvern.UnprocessableEntityError(_response.error.body as unknown, _response.rawResponse);
|
||||
default:
|
||||
throw new errors.SkyvernError({
|
||||
statusCode: _response.error.statusCode,
|
||||
body: _response.error.body,
|
||||
rawResponse: _response.rawResponse,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
switch (_response.error.reason) {
|
||||
case "non-json":
|
||||
throw new errors.SkyvernError({
|
||||
statusCode: _response.error.statusCode,
|
||||
body: _response.error.rawBody,
|
||||
rawResponse: _response.rawResponse,
|
||||
});
|
||||
case "timeout":
|
||||
throw new errors.SkyvernTimeoutError(
|
||||
"Timeout exceeded when calling GET /api/v1/workflows/{workflow_permanent_id}/schedules.",
|
||||
);
|
||||
case "unknown":
|
||||
throw new errors.SkyvernError({
|
||||
message: _response.error.errorMessage,
|
||||
rawResponse: _response.rawResponse,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} workflowPermanentId
|
||||
* @param {Skyvern.WorkflowScheduleUpsertRequest} request
|
||||
* @param {Agent.RequestOptions} requestOptions - Request-specific configuration.
|
||||
*
|
||||
* @throws {@link Skyvern.UnprocessableEntityError}
|
||||
*
|
||||
* @example
|
||||
* await client.agent.createWorkflowSchedule("workflow_permanent_id", {
|
||||
* cron_expression: "cron_expression",
|
||||
* timezone: "timezone"
|
||||
* })
|
||||
*/
|
||||
public createWorkflowSchedule(
|
||||
workflowPermanentId: string,
|
||||
request: Skyvern.WorkflowScheduleUpsertRequest,
|
||||
requestOptions?: Agent.RequestOptions,
|
||||
): core.HttpResponsePromise<Skyvern.WorkflowScheduleResponse> {
|
||||
return core.HttpResponsePromise.fromPromise(
|
||||
this.__createWorkflowSchedule(workflowPermanentId, request, requestOptions),
|
||||
);
|
||||
}
|
||||
|
||||
private async __createWorkflowSchedule(
|
||||
workflowPermanentId: string,
|
||||
request: Skyvern.WorkflowScheduleUpsertRequest,
|
||||
requestOptions?: Agent.RequestOptions,
|
||||
): Promise<core.WithRawResponse<Skyvern.WorkflowScheduleResponse>> {
|
||||
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
|
||||
this._options?.headers,
|
||||
mergeOnlyDefinedHeaders({ "x-api-key": requestOptions?.apiKey ?? this._options?.apiKey }),
|
||||
requestOptions?.headers,
|
||||
);
|
||||
const _response = await core.fetcher({
|
||||
url: core.url.join(
|
||||
(await core.Supplier.get(this._options.baseUrl)) ??
|
||||
(await core.Supplier.get(this._options.environment)) ??
|
||||
environments.SkyvernEnvironment.Cloud,
|
||||
`api/v1/workflows/${core.url.encodePathParam(workflowPermanentId)}/schedules`,
|
||||
),
|
||||
method: "POST",
|
||||
headers: _headers,
|
||||
contentType: "application/json",
|
||||
queryParameters: requestOptions?.queryParams,
|
||||
requestType: "json",
|
||||
body: request,
|
||||
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
||||
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
||||
abortSignal: requestOptions?.abortSignal,
|
||||
});
|
||||
if (_response.ok) {
|
||||
return { data: _response.body as Skyvern.WorkflowScheduleResponse, rawResponse: _response.rawResponse };
|
||||
}
|
||||
|
||||
if (_response.error.reason === "status-code") {
|
||||
switch (_response.error.statusCode) {
|
||||
case 422:
|
||||
throw new Skyvern.UnprocessableEntityError(_response.error.body as unknown, _response.rawResponse);
|
||||
default:
|
||||
throw new errors.SkyvernError({
|
||||
statusCode: _response.error.statusCode,
|
||||
body: _response.error.body,
|
||||
rawResponse: _response.rawResponse,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
switch (_response.error.reason) {
|
||||
case "non-json":
|
||||
throw new errors.SkyvernError({
|
||||
statusCode: _response.error.statusCode,
|
||||
body: _response.error.rawBody,
|
||||
rawResponse: _response.rawResponse,
|
||||
});
|
||||
case "timeout":
|
||||
throw new errors.SkyvernTimeoutError(
|
||||
"Timeout exceeded when calling POST /api/v1/workflows/{workflow_permanent_id}/schedules.",
|
||||
);
|
||||
case "unknown":
|
||||
throw new errors.SkyvernError({
|
||||
message: _response.error.errorMessage,
|
||||
rawResponse: _response.rawResponse,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} workflowPermanentId
|
||||
* @param {string} workflowScheduleId
|
||||
* @param {Agent.RequestOptions} requestOptions - Request-specific configuration.
|
||||
*
|
||||
* @throws {@link Skyvern.UnprocessableEntityError}
|
||||
*
|
||||
* @example
|
||||
* await client.agent.getWorkflowSchedule("workflow_permanent_id", "workflow_schedule_id")
|
||||
*/
|
||||
public getWorkflowSchedule(
|
||||
workflowPermanentId: string,
|
||||
workflowScheduleId: string,
|
||||
requestOptions?: Agent.RequestOptions,
|
||||
): core.HttpResponsePromise<Skyvern.WorkflowScheduleResponse> {
|
||||
return core.HttpResponsePromise.fromPromise(
|
||||
this.__getWorkflowSchedule(workflowPermanentId, workflowScheduleId, requestOptions),
|
||||
);
|
||||
}
|
||||
|
||||
private async __getWorkflowSchedule(
|
||||
workflowPermanentId: string,
|
||||
workflowScheduleId: string,
|
||||
requestOptions?: Agent.RequestOptions,
|
||||
): Promise<core.WithRawResponse<Skyvern.WorkflowScheduleResponse>> {
|
||||
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
|
||||
this._options?.headers,
|
||||
mergeOnlyDefinedHeaders({ "x-api-key": requestOptions?.apiKey ?? this._options?.apiKey }),
|
||||
requestOptions?.headers,
|
||||
);
|
||||
const _response = await core.fetcher({
|
||||
url: core.url.join(
|
||||
(await core.Supplier.get(this._options.baseUrl)) ??
|
||||
(await core.Supplier.get(this._options.environment)) ??
|
||||
environments.SkyvernEnvironment.Cloud,
|
||||
`api/v1/workflows/${core.url.encodePathParam(workflowPermanentId)}/schedules/${core.url.encodePathParam(workflowScheduleId)}`,
|
||||
),
|
||||
method: "GET",
|
||||
headers: _headers,
|
||||
queryParameters: requestOptions?.queryParams,
|
||||
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
||||
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
||||
abortSignal: requestOptions?.abortSignal,
|
||||
});
|
||||
if (_response.ok) {
|
||||
return { data: _response.body as Skyvern.WorkflowScheduleResponse, rawResponse: _response.rawResponse };
|
||||
}
|
||||
|
||||
if (_response.error.reason === "status-code") {
|
||||
switch (_response.error.statusCode) {
|
||||
case 422:
|
||||
throw new Skyvern.UnprocessableEntityError(_response.error.body as unknown, _response.rawResponse);
|
||||
default:
|
||||
throw new errors.SkyvernError({
|
||||
statusCode: _response.error.statusCode,
|
||||
body: _response.error.body,
|
||||
rawResponse: _response.rawResponse,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
switch (_response.error.reason) {
|
||||
case "non-json":
|
||||
throw new errors.SkyvernError({
|
||||
statusCode: _response.error.statusCode,
|
||||
body: _response.error.rawBody,
|
||||
rawResponse: _response.rawResponse,
|
||||
});
|
||||
case "timeout":
|
||||
throw new errors.SkyvernTimeoutError(
|
||||
"Timeout exceeded when calling GET /api/v1/workflows/{workflow_permanent_id}/schedules/{workflow_schedule_id}.",
|
||||
);
|
||||
case "unknown":
|
||||
throw new errors.SkyvernError({
|
||||
message: _response.error.errorMessage,
|
||||
rawResponse: _response.rawResponse,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} workflowPermanentId
|
||||
* @param {string} workflowScheduleId
|
||||
* @param {Skyvern.WorkflowScheduleUpsertRequest} request
|
||||
* @param {Agent.RequestOptions} requestOptions - Request-specific configuration.
|
||||
*
|
||||
* @throws {@link Skyvern.UnprocessableEntityError}
|
||||
*
|
||||
* @example
|
||||
* await client.agent.updateWorkflowSchedule("workflow_permanent_id", "workflow_schedule_id", {
|
||||
* cron_expression: "cron_expression",
|
||||
* timezone: "timezone"
|
||||
* })
|
||||
*/
|
||||
public updateWorkflowSchedule(
|
||||
workflowPermanentId: string,
|
||||
workflowScheduleId: string,
|
||||
request: Skyvern.WorkflowScheduleUpsertRequest,
|
||||
requestOptions?: Agent.RequestOptions,
|
||||
): core.HttpResponsePromise<Skyvern.WorkflowScheduleResponse> {
|
||||
return core.HttpResponsePromise.fromPromise(
|
||||
this.__updateWorkflowSchedule(workflowPermanentId, workflowScheduleId, request, requestOptions),
|
||||
);
|
||||
}
|
||||
|
||||
private async __updateWorkflowSchedule(
|
||||
workflowPermanentId: string,
|
||||
workflowScheduleId: string,
|
||||
request: Skyvern.WorkflowScheduleUpsertRequest,
|
||||
requestOptions?: Agent.RequestOptions,
|
||||
): Promise<core.WithRawResponse<Skyvern.WorkflowScheduleResponse>> {
|
||||
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
|
||||
this._options?.headers,
|
||||
mergeOnlyDefinedHeaders({ "x-api-key": requestOptions?.apiKey ?? this._options?.apiKey }),
|
||||
requestOptions?.headers,
|
||||
);
|
||||
const _response = await core.fetcher({
|
||||
url: core.url.join(
|
||||
(await core.Supplier.get(this._options.baseUrl)) ??
|
||||
(await core.Supplier.get(this._options.environment)) ??
|
||||
environments.SkyvernEnvironment.Cloud,
|
||||
`api/v1/workflows/${core.url.encodePathParam(workflowPermanentId)}/schedules/${core.url.encodePathParam(workflowScheduleId)}`,
|
||||
),
|
||||
method: "PUT",
|
||||
headers: _headers,
|
||||
contentType: "application/json",
|
||||
queryParameters: requestOptions?.queryParams,
|
||||
requestType: "json",
|
||||
body: request,
|
||||
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
||||
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
||||
abortSignal: requestOptions?.abortSignal,
|
||||
});
|
||||
if (_response.ok) {
|
||||
return { data: _response.body as Skyvern.WorkflowScheduleResponse, rawResponse: _response.rawResponse };
|
||||
}
|
||||
|
||||
if (_response.error.reason === "status-code") {
|
||||
switch (_response.error.statusCode) {
|
||||
case 422:
|
||||
throw new Skyvern.UnprocessableEntityError(_response.error.body as unknown, _response.rawResponse);
|
||||
default:
|
||||
throw new errors.SkyvernError({
|
||||
statusCode: _response.error.statusCode,
|
||||
body: _response.error.body,
|
||||
rawResponse: _response.rawResponse,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
switch (_response.error.reason) {
|
||||
case "non-json":
|
||||
throw new errors.SkyvernError({
|
||||
statusCode: _response.error.statusCode,
|
||||
body: _response.error.rawBody,
|
||||
rawResponse: _response.rawResponse,
|
||||
});
|
||||
case "timeout":
|
||||
throw new errors.SkyvernTimeoutError(
|
||||
"Timeout exceeded when calling PUT /api/v1/workflows/{workflow_permanent_id}/schedules/{workflow_schedule_id}.",
|
||||
);
|
||||
case "unknown":
|
||||
throw new errors.SkyvernError({
|
||||
message: _response.error.errorMessage,
|
||||
rawResponse: _response.rawResponse,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} workflowPermanentId
|
||||
* @param {string} workflowScheduleId
|
||||
* @param {Agent.RequestOptions} requestOptions - Request-specific configuration.
|
||||
*
|
||||
* @throws {@link Skyvern.UnprocessableEntityError}
|
||||
*
|
||||
* @example
|
||||
* await client.agent.deleteWorkflowScheduleRoute("workflow_permanent_id", "workflow_schedule_id")
|
||||
*/
|
||||
public deleteWorkflowScheduleRoute(
|
||||
workflowPermanentId: string,
|
||||
workflowScheduleId: string,
|
||||
requestOptions?: Agent.RequestOptions,
|
||||
): core.HttpResponsePromise<Record<string, boolean>> {
|
||||
return core.HttpResponsePromise.fromPromise(
|
||||
this.__deleteWorkflowScheduleRoute(workflowPermanentId, workflowScheduleId, requestOptions),
|
||||
);
|
||||
}
|
||||
|
||||
private async __deleteWorkflowScheduleRoute(
|
||||
workflowPermanentId: string,
|
||||
workflowScheduleId: string,
|
||||
requestOptions?: Agent.RequestOptions,
|
||||
): Promise<core.WithRawResponse<Record<string, boolean>>> {
|
||||
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
|
||||
this._options?.headers,
|
||||
mergeOnlyDefinedHeaders({ "x-api-key": requestOptions?.apiKey ?? this._options?.apiKey }),
|
||||
requestOptions?.headers,
|
||||
);
|
||||
const _response = await core.fetcher({
|
||||
url: core.url.join(
|
||||
(await core.Supplier.get(this._options.baseUrl)) ??
|
||||
(await core.Supplier.get(this._options.environment)) ??
|
||||
environments.SkyvernEnvironment.Cloud,
|
||||
`api/v1/workflows/${core.url.encodePathParam(workflowPermanentId)}/schedules/${core.url.encodePathParam(workflowScheduleId)}`,
|
||||
),
|
||||
method: "DELETE",
|
||||
headers: _headers,
|
||||
queryParameters: requestOptions?.queryParams,
|
||||
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
||||
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
||||
abortSignal: requestOptions?.abortSignal,
|
||||
});
|
||||
if (_response.ok) {
|
||||
return { data: _response.body as Record<string, boolean>, rawResponse: _response.rawResponse };
|
||||
}
|
||||
|
||||
if (_response.error.reason === "status-code") {
|
||||
switch (_response.error.statusCode) {
|
||||
case 422:
|
||||
throw new Skyvern.UnprocessableEntityError(_response.error.body as unknown, _response.rawResponse);
|
||||
default:
|
||||
throw new errors.SkyvernError({
|
||||
statusCode: _response.error.statusCode,
|
||||
body: _response.error.body,
|
||||
rawResponse: _response.rawResponse,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
switch (_response.error.reason) {
|
||||
case "non-json":
|
||||
throw new errors.SkyvernError({
|
||||
statusCode: _response.error.statusCode,
|
||||
body: _response.error.rawBody,
|
||||
rawResponse: _response.rawResponse,
|
||||
});
|
||||
case "timeout":
|
||||
throw new errors.SkyvernTimeoutError(
|
||||
"Timeout exceeded when calling DELETE /api/v1/workflows/{workflow_permanent_id}/schedules/{workflow_schedule_id}.",
|
||||
);
|
||||
case "unknown":
|
||||
throw new errors.SkyvernError({
|
||||
message: _response.error.errorMessage,
|
||||
rawResponse: _response.rawResponse,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} workflowPermanentId
|
||||
* @param {string} workflowScheduleId
|
||||
* @param {Agent.RequestOptions} requestOptions - Request-specific configuration.
|
||||
*
|
||||
* @throws {@link Skyvern.UnprocessableEntityError}
|
||||
*
|
||||
* @example
|
||||
* await client.agent.enableWorkflowSchedule("workflow_permanent_id", "workflow_schedule_id")
|
||||
*/
|
||||
public enableWorkflowSchedule(
|
||||
workflowPermanentId: string,
|
||||
workflowScheduleId: string,
|
||||
requestOptions?: Agent.RequestOptions,
|
||||
): core.HttpResponsePromise<Skyvern.WorkflowScheduleResponse> {
|
||||
return core.HttpResponsePromise.fromPromise(
|
||||
this.__enableWorkflowSchedule(workflowPermanentId, workflowScheduleId, requestOptions),
|
||||
);
|
||||
}
|
||||
|
||||
private async __enableWorkflowSchedule(
|
||||
workflowPermanentId: string,
|
||||
workflowScheduleId: string,
|
||||
requestOptions?: Agent.RequestOptions,
|
||||
): Promise<core.WithRawResponse<Skyvern.WorkflowScheduleResponse>> {
|
||||
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
|
||||
this._options?.headers,
|
||||
mergeOnlyDefinedHeaders({ "x-api-key": requestOptions?.apiKey ?? this._options?.apiKey }),
|
||||
requestOptions?.headers,
|
||||
);
|
||||
const _response = await core.fetcher({
|
||||
url: core.url.join(
|
||||
(await core.Supplier.get(this._options.baseUrl)) ??
|
||||
(await core.Supplier.get(this._options.environment)) ??
|
||||
environments.SkyvernEnvironment.Cloud,
|
||||
`api/v1/workflows/${core.url.encodePathParam(workflowPermanentId)}/schedules/${core.url.encodePathParam(workflowScheduleId)}/enable`,
|
||||
),
|
||||
method: "POST",
|
||||
headers: _headers,
|
||||
queryParameters: requestOptions?.queryParams,
|
||||
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
||||
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
||||
abortSignal: requestOptions?.abortSignal,
|
||||
});
|
||||
if (_response.ok) {
|
||||
return { data: _response.body as Skyvern.WorkflowScheduleResponse, rawResponse: _response.rawResponse };
|
||||
}
|
||||
|
||||
if (_response.error.reason === "status-code") {
|
||||
switch (_response.error.statusCode) {
|
||||
case 422:
|
||||
throw new Skyvern.UnprocessableEntityError(_response.error.body as unknown, _response.rawResponse);
|
||||
default:
|
||||
throw new errors.SkyvernError({
|
||||
statusCode: _response.error.statusCode,
|
||||
body: _response.error.body,
|
||||
rawResponse: _response.rawResponse,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
switch (_response.error.reason) {
|
||||
case "non-json":
|
||||
throw new errors.SkyvernError({
|
||||
statusCode: _response.error.statusCode,
|
||||
body: _response.error.rawBody,
|
||||
rawResponse: _response.rawResponse,
|
||||
});
|
||||
case "timeout":
|
||||
throw new errors.SkyvernTimeoutError(
|
||||
"Timeout exceeded when calling POST /api/v1/workflows/{workflow_permanent_id}/schedules/{workflow_schedule_id}/enable.",
|
||||
);
|
||||
case "unknown":
|
||||
throw new errors.SkyvernError({
|
||||
message: _response.error.errorMessage,
|
||||
rawResponse: _response.rawResponse,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} workflowPermanentId
|
||||
* @param {string} workflowScheduleId
|
||||
* @param {Agent.RequestOptions} requestOptions - Request-specific configuration.
|
||||
*
|
||||
* @throws {@link Skyvern.UnprocessableEntityError}
|
||||
*
|
||||
* @example
|
||||
* await client.agent.disableWorkflowSchedule("workflow_permanent_id", "workflow_schedule_id")
|
||||
*/
|
||||
public disableWorkflowSchedule(
|
||||
workflowPermanentId: string,
|
||||
workflowScheduleId: string,
|
||||
requestOptions?: Agent.RequestOptions,
|
||||
): core.HttpResponsePromise<Skyvern.WorkflowScheduleResponse> {
|
||||
return core.HttpResponsePromise.fromPromise(
|
||||
this.__disableWorkflowSchedule(workflowPermanentId, workflowScheduleId, requestOptions),
|
||||
);
|
||||
}
|
||||
|
||||
private async __disableWorkflowSchedule(
|
||||
workflowPermanentId: string,
|
||||
workflowScheduleId: string,
|
||||
requestOptions?: Agent.RequestOptions,
|
||||
): Promise<core.WithRawResponse<Skyvern.WorkflowScheduleResponse>> {
|
||||
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
|
||||
this._options?.headers,
|
||||
mergeOnlyDefinedHeaders({ "x-api-key": requestOptions?.apiKey ?? this._options?.apiKey }),
|
||||
requestOptions?.headers,
|
||||
);
|
||||
const _response = await core.fetcher({
|
||||
url: core.url.join(
|
||||
(await core.Supplier.get(this._options.baseUrl)) ??
|
||||
(await core.Supplier.get(this._options.environment)) ??
|
||||
environments.SkyvernEnvironment.Cloud,
|
||||
`api/v1/workflows/${core.url.encodePathParam(workflowPermanentId)}/schedules/${core.url.encodePathParam(workflowScheduleId)}/disable`,
|
||||
),
|
||||
method: "POST",
|
||||
headers: _headers,
|
||||
queryParameters: requestOptions?.queryParams,
|
||||
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
||||
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
||||
abortSignal: requestOptions?.abortSignal,
|
||||
});
|
||||
if (_response.ok) {
|
||||
return { data: _response.body as Skyvern.WorkflowScheduleResponse, rawResponse: _response.rawResponse };
|
||||
}
|
||||
|
||||
if (_response.error.reason === "status-code") {
|
||||
switch (_response.error.statusCode) {
|
||||
case 422:
|
||||
throw new Skyvern.UnprocessableEntityError(_response.error.body as unknown, _response.rawResponse);
|
||||
default:
|
||||
throw new errors.SkyvernError({
|
||||
statusCode: _response.error.statusCode,
|
||||
body: _response.error.body,
|
||||
rawResponse: _response.rawResponse,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
switch (_response.error.reason) {
|
||||
case "non-json":
|
||||
throw new errors.SkyvernError({
|
||||
statusCode: _response.error.statusCode,
|
||||
body: _response.error.rawBody,
|
||||
rawResponse: _response.rawResponse,
|
||||
});
|
||||
case "timeout":
|
||||
throw new errors.SkyvernTimeoutError(
|
||||
"Timeout exceeded when calling POST /api/v1/workflows/{workflow_permanent_id}/schedules/{workflow_schedule_id}/disable.",
|
||||
);
|
||||
case "unknown":
|
||||
throw new errors.SkyvernError({
|
||||
message: _response.error.errorMessage,
|
||||
rawResponse: _response.rawResponse,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
export * from "./requests/index.js";
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
// This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import type * as Skyvern from "../../../../index.js";
|
||||
|
||||
/**
|
||||
* @example
|
||||
* {
|
||||
* page: 1,
|
||||
* page_size: 1,
|
||||
* status: "active",
|
||||
* search: "search"
|
||||
* }
|
||||
*/
|
||||
export interface ListOrganizationSchedulesApiV1SchedulesGetRequest {
|
||||
page?: number;
|
||||
page_size?: number;
|
||||
/** Filter by status: 'active' or 'paused' */
|
||||
status?: Skyvern.ListOrganizationSchedulesApiV1SchedulesGetRequestStatus;
|
||||
/** Search by workflow title or schedule name */
|
||||
search?: string;
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
export type { ListOrganizationSchedulesApiV1SchedulesGetRequest } from "./ListOrganizationSchedulesApiV1SchedulesGetRequest.js";
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
export * from "./client/index.js";
|
||||
export * from "./types/index.js";
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
// This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
export const ListOrganizationSchedulesApiV1SchedulesGetRequestStatus = {
|
||||
Active: "active",
|
||||
Paused: "paused",
|
||||
} as const;
|
||||
export type ListOrganizationSchedulesApiV1SchedulesGetRequestStatus =
|
||||
(typeof ListOrganizationSchedulesApiV1SchedulesGetRequestStatus)[keyof typeof ListOrganizationSchedulesApiV1SchedulesGetRequestStatus];
|
||||
|
|
@ -1 +0,0 @@
|
|||
export * from "./ListOrganizationSchedulesApiV1SchedulesGetRequestStatus.js";
|
||||
|
|
@ -1,5 +1,2 @@
|
|||
export * from "./agent/client/requests/index.js";
|
||||
export * as agent from "./agent/index.js";
|
||||
export * from "./agent/types/index.js";
|
||||
export * as artifacts from "./artifacts/index.js";
|
||||
export * as scripts from "./scripts/index.js";
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
// This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import type * as Skyvern from "../index.js";
|
||||
|
||||
export interface BillingStateResponse {
|
||||
billing_id: string;
|
||||
organization_id: string;
|
||||
plan_tier: Skyvern.PlanTier;
|
||||
current_period_start?: string;
|
||||
current_period_end?: string;
|
||||
included_credits_this_period: number;
|
||||
credits_consumed_this_period: number;
|
||||
cached_credits_consumed_this_period: number;
|
||||
overage_enabled: boolean;
|
||||
browser_uptime_seconds_consumed: number;
|
||||
topup_credits_total: number;
|
||||
topup_credits_used: number;
|
||||
topup_credits_remaining: number;
|
||||
credits_remaining: number;
|
||||
cancel_at_period_end?: boolean;
|
||||
created_at: string;
|
||||
modified_at: string;
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
// This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
export interface ChangeTierResponse {
|
||||
status: string;
|
||||
tier: string;
|
||||
redirect_url?: string;
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
// This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
export interface CheckoutSessionResponse {
|
||||
id: string;
|
||||
url: string;
|
||||
}
|
||||
|
|
@ -12,6 +12,8 @@ export interface CreateCredentialRequest {
|
|||
credential_type: Skyvern.SkyvernForgeSdkSchemasCredentialsCredentialType;
|
||||
/** The credential data to store */
|
||||
credential: CreateCredentialRequest.Credential;
|
||||
/** Which vault to store this credential in. If omitted, uses the instance default. Use this to mix Skyvern-hosted and custom credentials within the same organization. */
|
||||
vault_type?: Skyvern.CredentialVaultType;
|
||||
}
|
||||
|
||||
export namespace CreateCredentialRequest {
|
||||
|
|
|
|||
|
|
@ -14,12 +14,16 @@ export interface CredentialResponse {
|
|||
credential_type: Skyvern.CredentialTypeOutput;
|
||||
/** Name of the credential */
|
||||
name: string;
|
||||
/** Which vault stores this credential (e.g., 'bitwarden', 'azure_vault', 'custom') */
|
||||
vault_type?: Skyvern.CredentialVaultType;
|
||||
/** Browser profile ID linked to this credential */
|
||||
browser_profile_id?: string;
|
||||
/** Login page URL used during the credential test */
|
||||
tested_url?: string;
|
||||
/** User-provided context describing the login sequence (e.g., 'click SSO button first') */
|
||||
user_context?: string;
|
||||
/** Whether the user intends to save a browser session, regardless of test outcome */
|
||||
save_browser_session_intent?: boolean;
|
||||
}
|
||||
|
||||
export namespace CredentialResponse {
|
||||
|
|
|
|||
8
skyvern-ts/client/src/api/types/CredentialVaultType.ts
Normal file
8
skyvern-ts/client/src/api/types/CredentialVaultType.ts
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
// This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
export const CredentialVaultType = {
|
||||
Bitwarden: "bitwarden",
|
||||
AzureVault: "azure_vault",
|
||||
Custom: "custom",
|
||||
} as const;
|
||||
export type CredentialVaultType = (typeof CredentialVaultType)[keyof typeof CredentialVaultType];
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
// This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
export interface OrganizationScheduleItem {
|
||||
workflow_schedule_id: string;
|
||||
organization_id: string;
|
||||
workflow_permanent_id: string;
|
||||
workflow_title: string;
|
||||
cron_expression: string;
|
||||
timezone: string;
|
||||
enabled: boolean;
|
||||
parameters?: Record<string, unknown>;
|
||||
name?: string;
|
||||
description?: string;
|
||||
next_run?: string;
|
||||
created_at: string;
|
||||
modified_at: string;
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
// This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import type * as Skyvern from "../index.js";
|
||||
|
||||
export interface OrganizationScheduleListResponse {
|
||||
schedules: Skyvern.OrganizationScheduleItem[];
|
||||
total_count: number;
|
||||
page: number;
|
||||
page_size: number;
|
||||
}
|
||||
|
|
@ -5,7 +5,7 @@ import type * as Skyvern from "../index.js";
|
|||
/**
|
||||
* Response model for password credentials — non-sensitive fields only.
|
||||
*
|
||||
* SECURITY: Must NEVER include password, TOTP secret, or TOTP identifier.
|
||||
* SECURITY: Must NEVER include password or TOTP secret.
|
||||
*/
|
||||
export interface PasswordCredentialResponse {
|
||||
/** The username associated with the credential */
|
||||
|
|
|
|||
|
|
@ -1,10 +0,0 @@
|
|||
// This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
/** Self-serve subscription tiers. Enterprise customers use manual billing (bypass). */
|
||||
export const PlanTier = {
|
||||
Free: "free",
|
||||
Hobby: "hobby",
|
||||
Pro: "pro",
|
||||
Enterprise: "enterprise",
|
||||
} as const;
|
||||
export type PlanTier = (typeof PlanTier)[keyof typeof PlanTier];
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
// This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
export interface PortalSessionResponse {
|
||||
url: string;
|
||||
}
|
||||
17
skyvern-ts/client/src/api/types/TaskRunListItem.ts
Normal file
17
skyvern-ts/client/src/api/types/TaskRunListItem.ts
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
/**
|
||||
* Lightweight run-history item backed by the task_runs table.
|
||||
*/
|
||||
export interface TaskRunListItem {
|
||||
task_run_id: string;
|
||||
run_id: string;
|
||||
task_run_type: string;
|
||||
status: string;
|
||||
title?: string;
|
||||
started_at?: string;
|
||||
finished_at?: string;
|
||||
created_at: string;
|
||||
workflow_permanent_id?: string;
|
||||
script_run?: boolean;
|
||||
}
|
||||
|
|
@ -93,7 +93,7 @@ export interface TaskRunRequest {
|
|||
max_screenshot_scrolls?: number;
|
||||
/** The CDP address for the task. */
|
||||
browser_address?: string;
|
||||
/** Whether to run the task with agent or code. */
|
||||
/** Whether to run the task with agent or code. Null means use the default. */
|
||||
run_with?: string;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ export interface Workflow {
|
|||
ai_fallback?: boolean;
|
||||
cache_key?: string;
|
||||
adaptive_caching?: boolean;
|
||||
code_version?: number;
|
||||
generate_script_on_terminal?: boolean;
|
||||
run_sequentially?: boolean;
|
||||
sequential_key?: string;
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ export interface WorkflowCreateYamlRequest {
|
|||
ai_fallback?: boolean;
|
||||
cache_key?: string;
|
||||
adaptive_caching?: boolean;
|
||||
code_version?: number;
|
||||
generate_script_on_terminal?: boolean;
|
||||
run_sequentially?: boolean;
|
||||
sequential_key?: string;
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ export interface WorkflowRun {
|
|||
totp_verification_url?: string;
|
||||
totp_identifier?: string;
|
||||
failure_reason?: string;
|
||||
failure_category?: Record<string, unknown>[];
|
||||
parent_workflow_run_id?: string;
|
||||
workflow_title?: string;
|
||||
max_screenshot_scrolls?: number;
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ export interface WorkflowRunRequest {
|
|||
browser_address?: string;
|
||||
/** Whether to fallback to AI if the workflow run fails. */
|
||||
ai_fallback?: boolean;
|
||||
/** Whether to run the workflow with agent, code, or code_v2 (adaptive caching). */
|
||||
/** Whether to run the workflow with agent or code. Null inherits from the workflow setting. */
|
||||
run_with?: string;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ export interface WorkflowRunResponse {
|
|||
errors?: Record<string, unknown>[];
|
||||
/** Total number of steps executed in this run */
|
||||
step_count?: number;
|
||||
/** Whether the workflow run was executed with agent, code, or code_v2 (adaptive caching) */
|
||||
/** Whether the workflow run was executed with agent or code */
|
||||
run_with?: string;
|
||||
/** Whether to fallback to AI if code run fails. */
|
||||
ai_fallback?: boolean;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,17 @@
|
|||
// This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
/**
|
||||
* How a workflow run was initiated.
|
||||
*
|
||||
* - manual: User clicked "Run" in the UI
|
||||
* - api: Direct API call to the run endpoint
|
||||
* - scheduled: Triggered by a cron schedule
|
||||
* - webhook: Triggered by an external system via the webhook endpoint
|
||||
*/
|
||||
export const WorkflowRunTriggerType = {
|
||||
Manual: "manual",
|
||||
Api: "api",
|
||||
Scheduled: "scheduled",
|
||||
Webhook: "webhook",
|
||||
} as const;
|
||||
export type WorkflowRunTriggerType = (typeof WorkflowRunTriggerType)[keyof typeof WorkflowRunTriggerType];
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
// This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
export interface WorkflowSchedule {
|
||||
workflow_schedule_id: string;
|
||||
organization_id: string;
|
||||
workflow_permanent_id: string;
|
||||
cron_expression: string;
|
||||
timezone: string;
|
||||
enabled: boolean;
|
||||
parameters?: Record<string, unknown>;
|
||||
temporal_schedule_id?: string;
|
||||
name?: string;
|
||||
description?: string;
|
||||
created_at: string;
|
||||
modified_at: string;
|
||||
deleted_at?: string;
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
// This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import type * as Skyvern from "../index.js";
|
||||
|
||||
export interface WorkflowScheduleListResponse {
|
||||
schedules: Skyvern.WorkflowSchedule[];
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
// This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import type * as Skyvern from "../index.js";
|
||||
|
||||
export interface WorkflowScheduleResponse {
|
||||
schedule: Skyvern.WorkflowSchedule;
|
||||
next_runs?: string[];
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
// This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
export interface WorkflowScheduleUpsertRequest {
|
||||
cron_expression: string;
|
||||
timezone: string;
|
||||
enabled?: boolean;
|
||||
parameters?: Record<string, unknown>;
|
||||
name?: string;
|
||||
description?: string;
|
||||
}
|
||||
|
|
@ -12,7 +12,6 @@ export * from "./AwsSecretParameterYaml.js";
|
|||
export * from "./AzureSecretParameter.js";
|
||||
export * from "./AzureVaultCredentialParameter.js";
|
||||
export * from "./AzureVaultCredentialParameterYaml.js";
|
||||
export * from "./BillingStateResponse.js";
|
||||
export * from "./BitwardenCreditCardDataParameter.js";
|
||||
export * from "./BitwardenCreditCardDataParameterYaml.js";
|
||||
export * from "./BitwardenLoginCredentialParameter.js";
|
||||
|
|
@ -26,8 +25,6 @@ export * from "./BranchConditionYaml.js";
|
|||
export * from "./BranchCriteriaYaml.js";
|
||||
export * from "./BrowserProfile.js";
|
||||
export * from "./BrowserSessionResponse.js";
|
||||
export * from "./ChangeTierResponse.js";
|
||||
export * from "./CheckoutSessionResponse.js";
|
||||
export * from "./ClickAction.js";
|
||||
export * from "./ClickContext.js";
|
||||
export * from "./CodeBlock.js";
|
||||
|
|
@ -44,6 +41,7 @@ export * from "./CredentialParameter.js";
|
|||
export * from "./CredentialParameterYaml.js";
|
||||
export * from "./CredentialResponse.js";
|
||||
export * from "./CredentialTypeOutput.js";
|
||||
export * from "./CredentialVaultType.js";
|
||||
export * from "./CreditCardCredentialResponse.js";
|
||||
export * from "./DownloadToS3Block.js";
|
||||
export * from "./DownloadToS3BlockYaml.js";
|
||||
|
|
@ -93,8 +91,6 @@ export * from "./NonEmptyCreditCardCredential.js";
|
|||
export * from "./NonEmptyPasswordCredential.js";
|
||||
export * from "./OnePasswordCredentialParameter.js";
|
||||
export * from "./OnePasswordCredentialParameterYaml.js";
|
||||
export * from "./OrganizationScheduleItem.js";
|
||||
export * from "./OrganizationScheduleListResponse.js";
|
||||
export * from "./OtpType.js";
|
||||
export * from "./OutputParameter.js";
|
||||
export * from "./OutputParameterYaml.js";
|
||||
|
|
@ -103,8 +99,6 @@ export * from "./PdfFormat.js";
|
|||
export * from "./PdfParserBlock.js";
|
||||
export * from "./PdfParserBlockYaml.js";
|
||||
export * from "./PersistentBrowserType.js";
|
||||
export * from "./PlanTier.js";
|
||||
export * from "./PortalSessionResponse.js";
|
||||
export * from "./PrintPageBlock.js";
|
||||
export * from "./PrintPageBlockParametersItem.js";
|
||||
export * from "./PrintPageBlockYaml.js";
|
||||
|
|
@ -130,6 +124,7 @@ export * from "./SkyvernSchemasRunBlocksCredentialType.js";
|
|||
export * from "./TaskBlock.js";
|
||||
export * from "./TaskBlockParametersItem.js";
|
||||
export * from "./TaskBlockYaml.js";
|
||||
export * from "./TaskRunListItem.js";
|
||||
export * from "./TaskRunRequest.js";
|
||||
export * from "./TaskRunResponse.js";
|
||||
export * from "./TaskV2Block.js";
|
||||
|
|
@ -178,10 +173,6 @@ export * from "./WorkflowRunStatus.js";
|
|||
export * from "./WorkflowRunTimeline.js";
|
||||
export * from "./WorkflowRunTimelineType.js";
|
||||
export * from "./WorkflowRunTriggerType.js";
|
||||
export * from "./WorkflowSchedule.js";
|
||||
export * from "./WorkflowScheduleListResponse.js";
|
||||
export * from "./WorkflowScheduleResponse.js";
|
||||
export * from "./WorkflowScheduleUpsertRequest.js";
|
||||
export * from "./WorkflowStatus.js";
|
||||
export * from "./WorkflowTriggerBlock.js";
|
||||
export * from "./WorkflowTriggerBlockParametersItem.js";
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
export const SDK_VERSION = "1.0.28";
|
||||
export const SDK_VERSION = "1.0.29";
|
||||
|
|
|
|||
|
|
@ -1,563 +0,0 @@
|
|||
// 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("Agent", () => {
|
||||
test("listOrganizationSchedules (1)", async () => {
|
||||
const server = mockServerPool.createServer();
|
||||
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
|
||||
|
||||
const rawResponseBody = {
|
||||
schedules: [
|
||||
{
|
||||
workflow_schedule_id: "workflow_schedule_id",
|
||||
organization_id: "organization_id",
|
||||
workflow_permanent_id: "workflow_permanent_id",
|
||||
workflow_title: "workflow_title",
|
||||
cron_expression: "cron_expression",
|
||||
timezone: "timezone",
|
||||
enabled: true,
|
||||
parameters: { key: "value" },
|
||||
name: "name",
|
||||
description: "description",
|
||||
next_run: "2024-01-15T09:30:00Z",
|
||||
created_at: "2024-01-15T09:30:00Z",
|
||||
modified_at: "2024-01-15T09:30:00Z",
|
||||
},
|
||||
],
|
||||
total_count: 1,
|
||||
page: 1,
|
||||
page_size: 1,
|
||||
};
|
||||
server.mockEndpoint().get("/api/v1/schedules").respondWith().statusCode(200).jsonBody(rawResponseBody).build();
|
||||
|
||||
const response = await client.agent.listOrganizationSchedules({
|
||||
page: 1,
|
||||
page_size: 1,
|
||||
status: "active",
|
||||
search: "search",
|
||||
});
|
||||
expect(response).toEqual({
|
||||
schedules: [
|
||||
{
|
||||
workflow_schedule_id: "workflow_schedule_id",
|
||||
organization_id: "organization_id",
|
||||
workflow_permanent_id: "workflow_permanent_id",
|
||||
workflow_title: "workflow_title",
|
||||
cron_expression: "cron_expression",
|
||||
timezone: "timezone",
|
||||
enabled: true,
|
||||
parameters: {
|
||||
key: "value",
|
||||
},
|
||||
name: "name",
|
||||
description: "description",
|
||||
next_run: "2024-01-15T09:30:00Z",
|
||||
created_at: "2024-01-15T09:30:00Z",
|
||||
modified_at: "2024-01-15T09:30:00Z",
|
||||
},
|
||||
],
|
||||
total_count: 1,
|
||||
page: 1,
|
||||
page_size: 1,
|
||||
});
|
||||
});
|
||||
|
||||
test("listOrganizationSchedules (2)", async () => {
|
||||
const server = mockServerPool.createServer();
|
||||
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
|
||||
|
||||
const rawResponseBody = { key: "value" };
|
||||
server.mockEndpoint().get("/api/v1/schedules").respondWith().statusCode(422).jsonBody(rawResponseBody).build();
|
||||
|
||||
await expect(async () => {
|
||||
return await client.agent.listOrganizationSchedules();
|
||||
}).rejects.toThrow(Skyvern.UnprocessableEntityError);
|
||||
});
|
||||
|
||||
test("listWorkflowSchedules (1)", async () => {
|
||||
const server = mockServerPool.createServer();
|
||||
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
|
||||
|
||||
const rawResponseBody = {
|
||||
schedules: [
|
||||
{
|
||||
workflow_schedule_id: "workflow_schedule_id",
|
||||
organization_id: "organization_id",
|
||||
workflow_permanent_id: "workflow_permanent_id",
|
||||
cron_expression: "cron_expression",
|
||||
timezone: "timezone",
|
||||
enabled: true,
|
||||
parameters: { key: "value" },
|
||||
temporal_schedule_id: "temporal_schedule_id",
|
||||
name: "name",
|
||||
description: "description",
|
||||
created_at: "2024-01-15T09:30:00Z",
|
||||
modified_at: "2024-01-15T09:30:00Z",
|
||||
deleted_at: "2024-01-15T09:30:00Z",
|
||||
},
|
||||
],
|
||||
};
|
||||
server
|
||||
.mockEndpoint()
|
||||
.get("/api/v1/workflows/workflow_permanent_id/schedules")
|
||||
.respondWith()
|
||||
.statusCode(200)
|
||||
.jsonBody(rawResponseBody)
|
||||
.build();
|
||||
|
||||
const response = await client.agent.listWorkflowSchedules("workflow_permanent_id");
|
||||
expect(response).toEqual({
|
||||
schedules: [
|
||||
{
|
||||
workflow_schedule_id: "workflow_schedule_id",
|
||||
organization_id: "organization_id",
|
||||
workflow_permanent_id: "workflow_permanent_id",
|
||||
cron_expression: "cron_expression",
|
||||
timezone: "timezone",
|
||||
enabled: true,
|
||||
parameters: {
|
||||
key: "value",
|
||||
},
|
||||
temporal_schedule_id: "temporal_schedule_id",
|
||||
name: "name",
|
||||
description: "description",
|
||||
created_at: "2024-01-15T09:30:00Z",
|
||||
modified_at: "2024-01-15T09:30:00Z",
|
||||
deleted_at: "2024-01-15T09:30:00Z",
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
test("listWorkflowSchedules (2)", async () => {
|
||||
const server = mockServerPool.createServer();
|
||||
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
|
||||
|
||||
const rawResponseBody = { key: "value" };
|
||||
server
|
||||
.mockEndpoint()
|
||||
.get("/api/v1/workflows/workflow_permanent_id/schedules")
|
||||
.respondWith()
|
||||
.statusCode(422)
|
||||
.jsonBody(rawResponseBody)
|
||||
.build();
|
||||
|
||||
await expect(async () => {
|
||||
return await client.agent.listWorkflowSchedules("workflow_permanent_id");
|
||||
}).rejects.toThrow(Skyvern.UnprocessableEntityError);
|
||||
});
|
||||
|
||||
test("createWorkflowSchedule (1)", async () => {
|
||||
const server = mockServerPool.createServer();
|
||||
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
|
||||
const rawRequestBody = { cron_expression: "cron_expression", timezone: "timezone" };
|
||||
const rawResponseBody = {
|
||||
schedule: {
|
||||
workflow_schedule_id: "workflow_schedule_id",
|
||||
organization_id: "organization_id",
|
||||
workflow_permanent_id: "workflow_permanent_id",
|
||||
cron_expression: "cron_expression",
|
||||
timezone: "timezone",
|
||||
enabled: true,
|
||||
parameters: { key: "value" },
|
||||
temporal_schedule_id: "temporal_schedule_id",
|
||||
name: "name",
|
||||
description: "description",
|
||||
created_at: "2024-01-15T09:30:00Z",
|
||||
modified_at: "2024-01-15T09:30:00Z",
|
||||
deleted_at: "2024-01-15T09:30:00Z",
|
||||
},
|
||||
next_runs: ["2024-01-15T09:30:00Z"],
|
||||
};
|
||||
server
|
||||
.mockEndpoint()
|
||||
.post("/api/v1/workflows/workflow_permanent_id/schedules")
|
||||
.jsonBody(rawRequestBody)
|
||||
.respondWith()
|
||||
.statusCode(200)
|
||||
.jsonBody(rawResponseBody)
|
||||
.build();
|
||||
|
||||
const response = await client.agent.createWorkflowSchedule("workflow_permanent_id", {
|
||||
cron_expression: "cron_expression",
|
||||
timezone: "timezone",
|
||||
});
|
||||
expect(response).toEqual({
|
||||
schedule: {
|
||||
workflow_schedule_id: "workflow_schedule_id",
|
||||
organization_id: "organization_id",
|
||||
workflow_permanent_id: "workflow_permanent_id",
|
||||
cron_expression: "cron_expression",
|
||||
timezone: "timezone",
|
||||
enabled: true,
|
||||
parameters: {
|
||||
key: "value",
|
||||
},
|
||||
temporal_schedule_id: "temporal_schedule_id",
|
||||
name: "name",
|
||||
description: "description",
|
||||
created_at: "2024-01-15T09:30:00Z",
|
||||
modified_at: "2024-01-15T09:30:00Z",
|
||||
deleted_at: "2024-01-15T09:30:00Z",
|
||||
},
|
||||
next_runs: ["2024-01-15T09:30:00Z"],
|
||||
});
|
||||
});
|
||||
|
||||
test("createWorkflowSchedule (2)", async () => {
|
||||
const server = mockServerPool.createServer();
|
||||
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
|
||||
const rawRequestBody = { cron_expression: "cron_expression", timezone: "timezone" };
|
||||
const rawResponseBody = { key: "value" };
|
||||
server
|
||||
.mockEndpoint()
|
||||
.post("/api/v1/workflows/workflow_permanent_id/schedules")
|
||||
.jsonBody(rawRequestBody)
|
||||
.respondWith()
|
||||
.statusCode(422)
|
||||
.jsonBody(rawResponseBody)
|
||||
.build();
|
||||
|
||||
await expect(async () => {
|
||||
return await client.agent.createWorkflowSchedule("workflow_permanent_id", {
|
||||
cron_expression: "cron_expression",
|
||||
timezone: "timezone",
|
||||
});
|
||||
}).rejects.toThrow(Skyvern.UnprocessableEntityError);
|
||||
});
|
||||
|
||||
test("getWorkflowSchedule (1)", async () => {
|
||||
const server = mockServerPool.createServer();
|
||||
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
|
||||
|
||||
const rawResponseBody = {
|
||||
schedule: {
|
||||
workflow_schedule_id: "workflow_schedule_id",
|
||||
organization_id: "organization_id",
|
||||
workflow_permanent_id: "workflow_permanent_id",
|
||||
cron_expression: "cron_expression",
|
||||
timezone: "timezone",
|
||||
enabled: true,
|
||||
parameters: { key: "value" },
|
||||
temporal_schedule_id: "temporal_schedule_id",
|
||||
name: "name",
|
||||
description: "description",
|
||||
created_at: "2024-01-15T09:30:00Z",
|
||||
modified_at: "2024-01-15T09:30:00Z",
|
||||
deleted_at: "2024-01-15T09:30:00Z",
|
||||
},
|
||||
next_runs: ["2024-01-15T09:30:00Z"],
|
||||
};
|
||||
server
|
||||
.mockEndpoint()
|
||||
.get("/api/v1/workflows/workflow_permanent_id/schedules/workflow_schedule_id")
|
||||
.respondWith()
|
||||
.statusCode(200)
|
||||
.jsonBody(rawResponseBody)
|
||||
.build();
|
||||
|
||||
const response = await client.agent.getWorkflowSchedule("workflow_permanent_id", "workflow_schedule_id");
|
||||
expect(response).toEqual({
|
||||
schedule: {
|
||||
workflow_schedule_id: "workflow_schedule_id",
|
||||
organization_id: "organization_id",
|
||||
workflow_permanent_id: "workflow_permanent_id",
|
||||
cron_expression: "cron_expression",
|
||||
timezone: "timezone",
|
||||
enabled: true,
|
||||
parameters: {
|
||||
key: "value",
|
||||
},
|
||||
temporal_schedule_id: "temporal_schedule_id",
|
||||
name: "name",
|
||||
description: "description",
|
||||
created_at: "2024-01-15T09:30:00Z",
|
||||
modified_at: "2024-01-15T09:30:00Z",
|
||||
deleted_at: "2024-01-15T09:30:00Z",
|
||||
},
|
||||
next_runs: ["2024-01-15T09:30:00Z"],
|
||||
});
|
||||
});
|
||||
|
||||
test("getWorkflowSchedule (2)", async () => {
|
||||
const server = mockServerPool.createServer();
|
||||
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
|
||||
|
||||
const rawResponseBody = { key: "value" };
|
||||
server
|
||||
.mockEndpoint()
|
||||
.get("/api/v1/workflows/workflow_permanent_id/schedules/workflow_schedule_id")
|
||||
.respondWith()
|
||||
.statusCode(422)
|
||||
.jsonBody(rawResponseBody)
|
||||
.build();
|
||||
|
||||
await expect(async () => {
|
||||
return await client.agent.getWorkflowSchedule("workflow_permanent_id", "workflow_schedule_id");
|
||||
}).rejects.toThrow(Skyvern.UnprocessableEntityError);
|
||||
});
|
||||
|
||||
test("updateWorkflowSchedule (1)", async () => {
|
||||
const server = mockServerPool.createServer();
|
||||
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
|
||||
const rawRequestBody = { cron_expression: "cron_expression", timezone: "timezone" };
|
||||
const rawResponseBody = {
|
||||
schedule: {
|
||||
workflow_schedule_id: "workflow_schedule_id",
|
||||
organization_id: "organization_id",
|
||||
workflow_permanent_id: "workflow_permanent_id",
|
||||
cron_expression: "cron_expression",
|
||||
timezone: "timezone",
|
||||
enabled: true,
|
||||
parameters: { key: "value" },
|
||||
temporal_schedule_id: "temporal_schedule_id",
|
||||
name: "name",
|
||||
description: "description",
|
||||
created_at: "2024-01-15T09:30:00Z",
|
||||
modified_at: "2024-01-15T09:30:00Z",
|
||||
deleted_at: "2024-01-15T09:30:00Z",
|
||||
},
|
||||
next_runs: ["2024-01-15T09:30:00Z"],
|
||||
};
|
||||
server
|
||||
.mockEndpoint()
|
||||
.put("/api/v1/workflows/workflow_permanent_id/schedules/workflow_schedule_id")
|
||||
.jsonBody(rawRequestBody)
|
||||
.respondWith()
|
||||
.statusCode(200)
|
||||
.jsonBody(rawResponseBody)
|
||||
.build();
|
||||
|
||||
const response = await client.agent.updateWorkflowSchedule("workflow_permanent_id", "workflow_schedule_id", {
|
||||
cron_expression: "cron_expression",
|
||||
timezone: "timezone",
|
||||
});
|
||||
expect(response).toEqual({
|
||||
schedule: {
|
||||
workflow_schedule_id: "workflow_schedule_id",
|
||||
organization_id: "organization_id",
|
||||
workflow_permanent_id: "workflow_permanent_id",
|
||||
cron_expression: "cron_expression",
|
||||
timezone: "timezone",
|
||||
enabled: true,
|
||||
parameters: {
|
||||
key: "value",
|
||||
},
|
||||
temporal_schedule_id: "temporal_schedule_id",
|
||||
name: "name",
|
||||
description: "description",
|
||||
created_at: "2024-01-15T09:30:00Z",
|
||||
modified_at: "2024-01-15T09:30:00Z",
|
||||
deleted_at: "2024-01-15T09:30:00Z",
|
||||
},
|
||||
next_runs: ["2024-01-15T09:30:00Z"],
|
||||
});
|
||||
});
|
||||
|
||||
test("updateWorkflowSchedule (2)", async () => {
|
||||
const server = mockServerPool.createServer();
|
||||
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
|
||||
const rawRequestBody = { cron_expression: "cron_expression", timezone: "timezone" };
|
||||
const rawResponseBody = { key: "value" };
|
||||
server
|
||||
.mockEndpoint()
|
||||
.put("/api/v1/workflows/workflow_permanent_id/schedules/workflow_schedule_id")
|
||||
.jsonBody(rawRequestBody)
|
||||
.respondWith()
|
||||
.statusCode(422)
|
||||
.jsonBody(rawResponseBody)
|
||||
.build();
|
||||
|
||||
await expect(async () => {
|
||||
return await client.agent.updateWorkflowSchedule("workflow_permanent_id", "workflow_schedule_id", {
|
||||
cron_expression: "cron_expression",
|
||||
timezone: "timezone",
|
||||
});
|
||||
}).rejects.toThrow(Skyvern.UnprocessableEntityError);
|
||||
});
|
||||
|
||||
test("deleteWorkflowScheduleRoute (1)", async () => {
|
||||
const server = mockServerPool.createServer();
|
||||
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
|
||||
|
||||
const rawResponseBody = { key: true };
|
||||
server
|
||||
.mockEndpoint()
|
||||
.delete("/api/v1/workflows/workflow_permanent_id/schedules/workflow_schedule_id")
|
||||
.respondWith()
|
||||
.statusCode(200)
|
||||
.jsonBody(rawResponseBody)
|
||||
.build();
|
||||
|
||||
const response = await client.agent.deleteWorkflowScheduleRoute(
|
||||
"workflow_permanent_id",
|
||||
"workflow_schedule_id",
|
||||
);
|
||||
expect(response).toEqual({
|
||||
key: true,
|
||||
});
|
||||
});
|
||||
|
||||
test("deleteWorkflowScheduleRoute (2)", async () => {
|
||||
const server = mockServerPool.createServer();
|
||||
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
|
||||
|
||||
const rawResponseBody = { key: "value" };
|
||||
server
|
||||
.mockEndpoint()
|
||||
.delete("/api/v1/workflows/workflow_permanent_id/schedules/workflow_schedule_id")
|
||||
.respondWith()
|
||||
.statusCode(422)
|
||||
.jsonBody(rawResponseBody)
|
||||
.build();
|
||||
|
||||
await expect(async () => {
|
||||
return await client.agent.deleteWorkflowScheduleRoute("workflow_permanent_id", "workflow_schedule_id");
|
||||
}).rejects.toThrow(Skyvern.UnprocessableEntityError);
|
||||
});
|
||||
|
||||
test("enableWorkflowSchedule (1)", async () => {
|
||||
const server = mockServerPool.createServer();
|
||||
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
|
||||
|
||||
const rawResponseBody = {
|
||||
schedule: {
|
||||
workflow_schedule_id: "workflow_schedule_id",
|
||||
organization_id: "organization_id",
|
||||
workflow_permanent_id: "workflow_permanent_id",
|
||||
cron_expression: "cron_expression",
|
||||
timezone: "timezone",
|
||||
enabled: true,
|
||||
parameters: { key: "value" },
|
||||
temporal_schedule_id: "temporal_schedule_id",
|
||||
name: "name",
|
||||
description: "description",
|
||||
created_at: "2024-01-15T09:30:00Z",
|
||||
modified_at: "2024-01-15T09:30:00Z",
|
||||
deleted_at: "2024-01-15T09:30:00Z",
|
||||
},
|
||||
next_runs: ["2024-01-15T09:30:00Z"],
|
||||
};
|
||||
server
|
||||
.mockEndpoint()
|
||||
.post("/api/v1/workflows/workflow_permanent_id/schedules/workflow_schedule_id/enable")
|
||||
.respondWith()
|
||||
.statusCode(200)
|
||||
.jsonBody(rawResponseBody)
|
||||
.build();
|
||||
|
||||
const response = await client.agent.enableWorkflowSchedule("workflow_permanent_id", "workflow_schedule_id");
|
||||
expect(response).toEqual({
|
||||
schedule: {
|
||||
workflow_schedule_id: "workflow_schedule_id",
|
||||
organization_id: "organization_id",
|
||||
workflow_permanent_id: "workflow_permanent_id",
|
||||
cron_expression: "cron_expression",
|
||||
timezone: "timezone",
|
||||
enabled: true,
|
||||
parameters: {
|
||||
key: "value",
|
||||
},
|
||||
temporal_schedule_id: "temporal_schedule_id",
|
||||
name: "name",
|
||||
description: "description",
|
||||
created_at: "2024-01-15T09:30:00Z",
|
||||
modified_at: "2024-01-15T09:30:00Z",
|
||||
deleted_at: "2024-01-15T09:30:00Z",
|
||||
},
|
||||
next_runs: ["2024-01-15T09:30:00Z"],
|
||||
});
|
||||
});
|
||||
|
||||
test("enableWorkflowSchedule (2)", async () => {
|
||||
const server = mockServerPool.createServer();
|
||||
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
|
||||
|
||||
const rawResponseBody = { key: "value" };
|
||||
server
|
||||
.mockEndpoint()
|
||||
.post("/api/v1/workflows/workflow_permanent_id/schedules/workflow_schedule_id/enable")
|
||||
.respondWith()
|
||||
.statusCode(422)
|
||||
.jsonBody(rawResponseBody)
|
||||
.build();
|
||||
|
||||
await expect(async () => {
|
||||
return await client.agent.enableWorkflowSchedule("workflow_permanent_id", "workflow_schedule_id");
|
||||
}).rejects.toThrow(Skyvern.UnprocessableEntityError);
|
||||
});
|
||||
|
||||
test("disableWorkflowSchedule (1)", async () => {
|
||||
const server = mockServerPool.createServer();
|
||||
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
|
||||
|
||||
const rawResponseBody = {
|
||||
schedule: {
|
||||
workflow_schedule_id: "workflow_schedule_id",
|
||||
organization_id: "organization_id",
|
||||
workflow_permanent_id: "workflow_permanent_id",
|
||||
cron_expression: "cron_expression",
|
||||
timezone: "timezone",
|
||||
enabled: true,
|
||||
parameters: { key: "value" },
|
||||
temporal_schedule_id: "temporal_schedule_id",
|
||||
name: "name",
|
||||
description: "description",
|
||||
created_at: "2024-01-15T09:30:00Z",
|
||||
modified_at: "2024-01-15T09:30:00Z",
|
||||
deleted_at: "2024-01-15T09:30:00Z",
|
||||
},
|
||||
next_runs: ["2024-01-15T09:30:00Z"],
|
||||
};
|
||||
server
|
||||
.mockEndpoint()
|
||||
.post("/api/v1/workflows/workflow_permanent_id/schedules/workflow_schedule_id/disable")
|
||||
.respondWith()
|
||||
.statusCode(200)
|
||||
.jsonBody(rawResponseBody)
|
||||
.build();
|
||||
|
||||
const response = await client.agent.disableWorkflowSchedule("workflow_permanent_id", "workflow_schedule_id");
|
||||
expect(response).toEqual({
|
||||
schedule: {
|
||||
workflow_schedule_id: "workflow_schedule_id",
|
||||
organization_id: "organization_id",
|
||||
workflow_permanent_id: "workflow_permanent_id",
|
||||
cron_expression: "cron_expression",
|
||||
timezone: "timezone",
|
||||
enabled: true,
|
||||
parameters: {
|
||||
key: "value",
|
||||
},
|
||||
temporal_schedule_id: "temporal_schedule_id",
|
||||
name: "name",
|
||||
description: "description",
|
||||
created_at: "2024-01-15T09:30:00Z",
|
||||
modified_at: "2024-01-15T09:30:00Z",
|
||||
deleted_at: "2024-01-15T09:30:00Z",
|
||||
},
|
||||
next_runs: ["2024-01-15T09:30:00Z"],
|
||||
});
|
||||
});
|
||||
|
||||
test("disableWorkflowSchedule (2)", async () => {
|
||||
const server = mockServerPool.createServer();
|
||||
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
|
||||
|
||||
const rawResponseBody = { key: "value" };
|
||||
server
|
||||
.mockEndpoint()
|
||||
.post("/api/v1/workflows/workflow_permanent_id/schedules/workflow_schedule_id/disable")
|
||||
.respondWith()
|
||||
.statusCode(422)
|
||||
.jsonBody(rawResponseBody)
|
||||
.build();
|
||||
|
||||
await expect(async () => {
|
||||
return await client.agent.disableWorkflowSchedule("workflow_permanent_id", "workflow_schedule_id");
|
||||
}).rejects.toThrow(Skyvern.UnprocessableEntityError);
|
||||
});
|
||||
});
|
||||
|
|
@ -208,7 +208,7 @@ describe("SkyvernClient", () => {
|
|||
script_run: { ai_fallback_triggered: true },
|
||||
errors: [{ key: "value" }],
|
||||
step_count: 1,
|
||||
run_with: "run_with",
|
||||
run_with: "agent",
|
||||
ai_fallback: true,
|
||||
run_request: {
|
||||
workflow_id: "wpid_123",
|
||||
|
|
@ -281,7 +281,7 @@ describe("SkyvernClient", () => {
|
|||
},
|
||||
],
|
||||
step_count: 1,
|
||||
run_with: "run_with",
|
||||
run_with: "agent",
|
||||
ai_fallback: true,
|
||||
run_request: {
|
||||
workflow_id: "wpid_123",
|
||||
|
|
@ -588,6 +588,7 @@ describe("SkyvernClient", () => {
|
|||
ai_fallback: true,
|
||||
cache_key: "cache_key",
|
||||
adaptive_caching: true,
|
||||
code_version: 1,
|
||||
generate_script_on_terminal: true,
|
||||
run_sequentially: true,
|
||||
sequential_key: "sequential_key",
|
||||
|
|
@ -666,6 +667,7 @@ describe("SkyvernClient", () => {
|
|||
ai_fallback: true,
|
||||
cache_key: "cache_key",
|
||||
adaptive_caching: true,
|
||||
code_version: 1,
|
||||
generate_script_on_terminal: true,
|
||||
run_sequentially: true,
|
||||
sequential_key: "sequential_key",
|
||||
|
|
@ -744,6 +746,7 @@ describe("SkyvernClient", () => {
|
|||
ai_fallback: true,
|
||||
cache_key: "cache_key",
|
||||
adaptive_caching: true,
|
||||
code_version: 1,
|
||||
generate_script_on_terminal: true,
|
||||
run_sequentially: true,
|
||||
sequential_key: "sequential_key",
|
||||
|
|
@ -820,6 +823,7 @@ describe("SkyvernClient", () => {
|
|||
ai_fallback: true,
|
||||
cache_key: "cache_key",
|
||||
adaptive_caching: true,
|
||||
code_version: 1,
|
||||
generate_script_on_terminal: true,
|
||||
run_sequentially: true,
|
||||
sequential_key: "sequential_key",
|
||||
|
|
@ -906,6 +910,7 @@ describe("SkyvernClient", () => {
|
|||
ai_fallback: true,
|
||||
cache_key: "cache_key",
|
||||
adaptive_caching: true,
|
||||
code_version: 1,
|
||||
generate_script_on_terminal: true,
|
||||
run_sequentially: true,
|
||||
sequential_key: "sequential_key",
|
||||
|
|
@ -979,6 +984,7 @@ describe("SkyvernClient", () => {
|
|||
ai_fallback: true,
|
||||
cache_key: "cache_key",
|
||||
adaptive_caching: true,
|
||||
code_version: 1,
|
||||
generate_script_on_terminal: true,
|
||||
run_sequentially: true,
|
||||
sequential_key: "sequential_key",
|
||||
|
|
@ -1423,6 +1429,7 @@ describe("SkyvernClient", () => {
|
|||
ai_fallback: true,
|
||||
cache_key: "cache_key",
|
||||
adaptive_caching: true,
|
||||
code_version: 1,
|
||||
generate_script_on_terminal: true,
|
||||
run_sequentially: true,
|
||||
sequential_key: "sequential_key",
|
||||
|
|
@ -1496,6 +1503,7 @@ describe("SkyvernClient", () => {
|
|||
ai_fallback: true,
|
||||
cache_key: "cache_key",
|
||||
adaptive_caching: true,
|
||||
code_version: 1,
|
||||
generate_script_on_terminal: true,
|
||||
run_sequentially: true,
|
||||
sequential_key: "sequential_key",
|
||||
|
|
@ -1564,93 +1572,6 @@ describe("SkyvernClient", () => {
|
|||
}).rejects.toThrow(Skyvern.UnprocessableEntityError);
|
||||
});
|
||||
|
||||
test("get_artifact (1)", async () => {
|
||||
const server = mockServerPool.createServer();
|
||||
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
|
||||
|
||||
const rawResponseBody = {
|
||||
created_at: "2023-01-01T00:00:00Z",
|
||||
modified_at: "2023-01-01T00:00:00Z",
|
||||
artifact_id: "artifact_id",
|
||||
artifact_type: "recording",
|
||||
uri: "uri",
|
||||
bundle_key: "bundle_key",
|
||||
task_id: "task_id",
|
||||
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",
|
||||
signed_url: "signed_url",
|
||||
organization_id: "organization_id",
|
||||
};
|
||||
server
|
||||
.mockEndpoint()
|
||||
.get("/v1/artifacts/artifact_id")
|
||||
.respondWith()
|
||||
.statusCode(200)
|
||||
.jsonBody(rawResponseBody)
|
||||
.build();
|
||||
|
||||
const response = await client.getArtifact("artifact_id");
|
||||
expect(response).toEqual({
|
||||
created_at: "2023-01-01T00:00:00Z",
|
||||
modified_at: "2023-01-01T00:00:00Z",
|
||||
artifact_id: "artifact_id",
|
||||
artifact_type: "recording",
|
||||
uri: "uri",
|
||||
bundle_key: "bundle_key",
|
||||
task_id: "task_id",
|
||||
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",
|
||||
signed_url: "signed_url",
|
||||
organization_id: "organization_id",
|
||||
});
|
||||
});
|
||||
|
||||
test("get_artifact (2)", async () => {
|
||||
const server = mockServerPool.createServer();
|
||||
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
|
||||
|
||||
const rawResponseBody = { key: "value" };
|
||||
server
|
||||
.mockEndpoint()
|
||||
.get("/v1/artifacts/artifact_id")
|
||||
.respondWith()
|
||||
.statusCode(404)
|
||||
.jsonBody(rawResponseBody)
|
||||
.build();
|
||||
|
||||
await expect(async () => {
|
||||
return await client.getArtifact("artifact_id");
|
||||
}).rejects.toThrow(Skyvern.NotFoundError);
|
||||
});
|
||||
|
||||
test("get_artifact (3)", async () => {
|
||||
const server = mockServerPool.createServer();
|
||||
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
|
||||
|
||||
const rawResponseBody = { key: "value" };
|
||||
server
|
||||
.mockEndpoint()
|
||||
.get("/v1/artifacts/artifact_id")
|
||||
.respondWith()
|
||||
.statusCode(422)
|
||||
.jsonBody(rawResponseBody)
|
||||
.build();
|
||||
|
||||
await expect(async () => {
|
||||
return await client.getArtifact("artifact_id");
|
||||
}).rejects.toThrow(Skyvern.UnprocessableEntityError);
|
||||
});
|
||||
|
||||
test("get_run_artifacts (1)", async () => {
|
||||
const server = mockServerPool.createServer();
|
||||
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
|
||||
|
|
@ -1988,6 +1909,59 @@ describe("SkyvernClient", () => {
|
|||
}).rejects.toThrow(Skyvern.UnprocessableEntityError);
|
||||
});
|
||||
|
||||
test("get_runs_v2 (1)", async () => {
|
||||
const server = mockServerPool.createServer();
|
||||
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
|
||||
|
||||
const rawResponseBody = [
|
||||
{
|
||||
task_run_id: "task_run_id",
|
||||
run_id: "run_id",
|
||||
task_run_type: "task_run_type",
|
||||
status: "status",
|
||||
title: "title",
|
||||
started_at: "2024-01-15T09:30:00Z",
|
||||
finished_at: "2024-01-15T09:30:00Z",
|
||||
created_at: "2024-01-15T09:30:00Z",
|
||||
workflow_permanent_id: "workflow_permanent_id",
|
||||
script_run: true,
|
||||
},
|
||||
];
|
||||
server.mockEndpoint().get("/v1/runs").respondWith().statusCode(200).jsonBody(rawResponseBody).build();
|
||||
|
||||
const response = await client.getRunsV2({
|
||||
page: 1,
|
||||
page_size: 1,
|
||||
search_key: "search_key",
|
||||
});
|
||||
expect(response).toEqual([
|
||||
{
|
||||
task_run_id: "task_run_id",
|
||||
run_id: "run_id",
|
||||
task_run_type: "task_run_type",
|
||||
status: "status",
|
||||
title: "title",
|
||||
started_at: "2024-01-15T09:30:00Z",
|
||||
finished_at: "2024-01-15T09:30:00Z",
|
||||
created_at: "2024-01-15T09:30:00Z",
|
||||
workflow_permanent_id: "workflow_permanent_id",
|
||||
script_run: true,
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
test("get_runs_v2 (2)", async () => {
|
||||
const server = mockServerPool.createServer();
|
||||
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
|
||||
|
||||
const rawResponseBody = { key: "value" };
|
||||
server.mockEndpoint().get("/v1/runs").respondWith().statusCode(422).jsonBody(rawResponseBody).build();
|
||||
|
||||
await expect(async () => {
|
||||
return await client.getRunsV2();
|
||||
}).rejects.toThrow(Skyvern.UnprocessableEntityError);
|
||||
});
|
||||
|
||||
test("get_workflow_runs (1)", async () => {
|
||||
const server = mockServerPool.createServer();
|
||||
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
|
||||
|
|
@ -2009,6 +1983,7 @@ describe("SkyvernClient", () => {
|
|||
totp_verification_url: "totp_verification_url",
|
||||
totp_identifier: "totp_identifier",
|
||||
failure_reason: "failure_reason",
|
||||
failure_category: [{ key: "value" }],
|
||||
parent_workflow_run_id: "parent_workflow_run_id",
|
||||
workflow_title: "workflow_title",
|
||||
max_screenshot_scrolls: 1,
|
||||
|
|
@ -2056,6 +2031,11 @@ describe("SkyvernClient", () => {
|
|||
totp_verification_url: "totp_verification_url",
|
||||
totp_identifier: "totp_identifier",
|
||||
failure_reason: "failure_reason",
|
||||
failure_category: [
|
||||
{
|
||||
key: "value",
|
||||
},
|
||||
],
|
||||
parent_workflow_run_id: "parent_workflow_run_id",
|
||||
workflow_title: "workflow_title",
|
||||
max_screenshot_scrolls: 1,
|
||||
|
|
@ -2146,6 +2126,7 @@ describe("SkyvernClient", () => {
|
|||
ai_fallback: true,
|
||||
cache_key: "cache_key",
|
||||
adaptive_caching: true,
|
||||
code_version: 1,
|
||||
generate_script_on_terminal: true,
|
||||
run_sequentially: true,
|
||||
sequential_key: "sequential_key",
|
||||
|
|
@ -2221,6 +2202,7 @@ describe("SkyvernClient", () => {
|
|||
ai_fallback: true,
|
||||
cache_key: "cache_key",
|
||||
adaptive_caching: true,
|
||||
code_version: 1,
|
||||
generate_script_on_terminal: true,
|
||||
run_sequentially: true,
|
||||
sequential_key: "sequential_key",
|
||||
|
|
@ -2305,6 +2287,7 @@ describe("SkyvernClient", () => {
|
|||
ai_fallback: true,
|
||||
cache_key: "cache_key",
|
||||
adaptive_caching: true,
|
||||
code_version: 1,
|
||||
generate_script_on_terminal: true,
|
||||
run_sequentially: true,
|
||||
sequential_key: "sequential_key",
|
||||
|
|
@ -2381,6 +2364,7 @@ describe("SkyvernClient", () => {
|
|||
ai_fallback: true,
|
||||
cache_key: "cache_key",
|
||||
adaptive_caching: true,
|
||||
code_version: 1,
|
||||
generate_script_on_terminal: true,
|
||||
run_sequentially: true,
|
||||
sequential_key: "sequential_key",
|
||||
|
|
@ -3200,9 +3184,11 @@ describe("SkyvernClient", () => {
|
|||
},
|
||||
credential_type: "password",
|
||||
name: "Amazon Login",
|
||||
vault_type: "bitwarden",
|
||||
browser_profile_id: "browser_profile_id",
|
||||
tested_url: "tested_url",
|
||||
user_context: "user_context",
|
||||
save_browser_session_intent: true,
|
||||
},
|
||||
];
|
||||
server.mockEndpoint().get("/v1/credentials").respondWith().statusCode(200).jsonBody(rawResponseBody).build();
|
||||
|
|
@ -3210,6 +3196,7 @@ describe("SkyvernClient", () => {
|
|||
const response = await client.getCredentials({
|
||||
page: 1,
|
||||
page_size: 10,
|
||||
vault_type: "bitwarden",
|
||||
});
|
||||
expect(response).toEqual([
|
||||
{
|
||||
|
|
@ -3221,9 +3208,11 @@ describe("SkyvernClient", () => {
|
|||
},
|
||||
credential_type: "password",
|
||||
name: "Amazon Login",
|
||||
vault_type: "bitwarden",
|
||||
browser_profile_id: "browser_profile_id",
|
||||
tested_url: "tested_url",
|
||||
user_context: "user_context",
|
||||
save_browser_session_intent: true,
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
|
@ -3257,9 +3246,11 @@ describe("SkyvernClient", () => {
|
|||
},
|
||||
credential_type: "password",
|
||||
name: "Amazon Login",
|
||||
vault_type: "bitwarden",
|
||||
browser_profile_id: "browser_profile_id",
|
||||
tested_url: "tested_url",
|
||||
user_context: "user_context",
|
||||
save_browser_session_intent: true,
|
||||
};
|
||||
server
|
||||
.mockEndpoint()
|
||||
|
|
@ -3287,9 +3278,11 @@ describe("SkyvernClient", () => {
|
|||
},
|
||||
credential_type: "password",
|
||||
name: "Amazon Login",
|
||||
vault_type: "bitwarden",
|
||||
browser_profile_id: "browser_profile_id",
|
||||
tested_url: "tested_url",
|
||||
user_context: "user_context",
|
||||
save_browser_session_intent: true,
|
||||
});
|
||||
});
|
||||
|
||||
|
|
@ -3340,9 +3333,11 @@ describe("SkyvernClient", () => {
|
|||
},
|
||||
credential_type: "password",
|
||||
name: "Amazon Login",
|
||||
vault_type: "bitwarden",
|
||||
browser_profile_id: "browser_profile_id",
|
||||
tested_url: "tested_url",
|
||||
user_context: "user_context",
|
||||
save_browser_session_intent: true,
|
||||
};
|
||||
server
|
||||
.mockEndpoint()
|
||||
|
|
@ -3370,9 +3365,11 @@ describe("SkyvernClient", () => {
|
|||
},
|
||||
credential_type: "password",
|
||||
name: "Amazon Login",
|
||||
vault_type: "bitwarden",
|
||||
browser_profile_id: "browser_profile_id",
|
||||
tested_url: "tested_url",
|
||||
user_context: "user_context",
|
||||
save_browser_session_intent: true,
|
||||
});
|
||||
});
|
||||
|
||||
|
|
@ -3447,9 +3444,11 @@ describe("SkyvernClient", () => {
|
|||
},
|
||||
credential_type: "password",
|
||||
name: "Amazon Login",
|
||||
vault_type: "bitwarden",
|
||||
browser_profile_id: "browser_profile_id",
|
||||
tested_url: "tested_url",
|
||||
user_context: "user_context",
|
||||
save_browser_session_intent: true,
|
||||
};
|
||||
server
|
||||
.mockEndpoint()
|
||||
|
|
@ -3469,9 +3468,11 @@ describe("SkyvernClient", () => {
|
|||
},
|
||||
credential_type: "password",
|
||||
name: "Amazon Login",
|
||||
vault_type: "bitwarden",
|
||||
browser_profile_id: "browser_profile_id",
|
||||
tested_url: "tested_url",
|
||||
user_context: "user_context",
|
||||
save_browser_session_intent: true,
|
||||
});
|
||||
});
|
||||
|
||||
|
|
@ -3519,7 +3520,7 @@ describe("SkyvernClient", () => {
|
|||
script_run: { ai_fallback_triggered: true },
|
||||
errors: [{ key: "value" }],
|
||||
step_count: 1,
|
||||
run_with: "run_with",
|
||||
run_with: "agent",
|
||||
ai_fallback: true,
|
||||
run_request: {
|
||||
workflow_id: "wpid_123",
|
||||
|
|
@ -3585,7 +3586,7 @@ describe("SkyvernClient", () => {
|
|||
},
|
||||
],
|
||||
step_count: 1,
|
||||
run_with: "run_with",
|
||||
run_with: "agent",
|
||||
ai_fallback: true,
|
||||
run_request: {
|
||||
workflow_id: "wpid_123",
|
||||
|
|
@ -3657,7 +3658,7 @@ describe("SkyvernClient", () => {
|
|||
script_run: { ai_fallback_triggered: true },
|
||||
errors: [{ key: "value" }],
|
||||
step_count: 1,
|
||||
run_with: "run_with",
|
||||
run_with: "agent",
|
||||
ai_fallback: true,
|
||||
run_request: {
|
||||
workflow_id: "wpid_123",
|
||||
|
|
@ -3723,7 +3724,7 @@ describe("SkyvernClient", () => {
|
|||
},
|
||||
],
|
||||
step_count: 1,
|
||||
run_with: "run_with",
|
||||
run_with: "agent",
|
||||
ai_fallback: true,
|
||||
run_request: {
|
||||
workflow_id: "wpid_123",
|
||||
|
|
@ -4082,201 +4083,4 @@ describe("SkyvernClient", () => {
|
|||
});
|
||||
}).rejects.toThrow(Skyvern.UnprocessableEntityError);
|
||||
});
|
||||
|
||||
test("create_checkout_session_api_v1_billing_checkout_post (1)", async () => {
|
||||
const server = mockServerPool.createServer();
|
||||
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
|
||||
const rawRequestBody = { tier: "free" };
|
||||
const rawResponseBody = { id: "id", url: "url" };
|
||||
server
|
||||
.mockEndpoint()
|
||||
.post("/api/v1/billing/checkout")
|
||||
.jsonBody(rawRequestBody)
|
||||
.respondWith()
|
||||
.statusCode(200)
|
||||
.jsonBody(rawResponseBody)
|
||||
.build();
|
||||
|
||||
const response = await client.createCheckoutSessionApiV1BillingCheckoutPost({
|
||||
tier: "free",
|
||||
});
|
||||
expect(response).toEqual({
|
||||
id: "id",
|
||||
url: "url",
|
||||
});
|
||||
});
|
||||
|
||||
test("create_checkout_session_api_v1_billing_checkout_post (2)", async () => {
|
||||
const server = mockServerPool.createServer();
|
||||
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
|
||||
const rawRequestBody = { tier: "free" };
|
||||
const rawResponseBody = { key: "value" };
|
||||
server
|
||||
.mockEndpoint()
|
||||
.post("/api/v1/billing/checkout")
|
||||
.jsonBody(rawRequestBody)
|
||||
.respondWith()
|
||||
.statusCode(422)
|
||||
.jsonBody(rawResponseBody)
|
||||
.build();
|
||||
|
||||
await expect(async () => {
|
||||
return await client.createCheckoutSessionApiV1BillingCheckoutPost({
|
||||
tier: "free",
|
||||
});
|
||||
}).rejects.toThrow(Skyvern.UnprocessableEntityError);
|
||||
});
|
||||
|
||||
test("create_portal_session_api_v1_billing_portal_post (1)", async () => {
|
||||
const server = mockServerPool.createServer();
|
||||
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
|
||||
|
||||
const rawResponseBody = { url: "url" };
|
||||
server
|
||||
.mockEndpoint()
|
||||
.post("/api/v1/billing/portal")
|
||||
.respondWith()
|
||||
.statusCode(200)
|
||||
.jsonBody(rawResponseBody)
|
||||
.build();
|
||||
|
||||
const response = await client.createPortalSessionApiV1BillingPortalPost();
|
||||
expect(response).toEqual({
|
||||
url: "url",
|
||||
});
|
||||
});
|
||||
|
||||
test("create_portal_session_api_v1_billing_portal_post (2)", async () => {
|
||||
const server = mockServerPool.createServer();
|
||||
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
|
||||
|
||||
const rawResponseBody = { key: "value" };
|
||||
server
|
||||
.mockEndpoint()
|
||||
.post("/api/v1/billing/portal")
|
||||
.respondWith()
|
||||
.statusCode(422)
|
||||
.jsonBody(rawResponseBody)
|
||||
.build();
|
||||
|
||||
await expect(async () => {
|
||||
return await client.createPortalSessionApiV1BillingPortalPost();
|
||||
}).rejects.toThrow(Skyvern.UnprocessableEntityError);
|
||||
});
|
||||
|
||||
test("get_organization_billing_api_v1_billing_state_get (1)", async () => {
|
||||
const server = mockServerPool.createServer();
|
||||
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
|
||||
|
||||
const rawResponseBody = {
|
||||
billing_id: "billing_id",
|
||||
organization_id: "organization_id",
|
||||
plan_tier: "free",
|
||||
current_period_start: "2024-01-15T09:30:00Z",
|
||||
current_period_end: "2024-01-15T09:30:00Z",
|
||||
included_credits_this_period: 1,
|
||||
credits_consumed_this_period: 1,
|
||||
cached_credits_consumed_this_period: 1,
|
||||
overage_enabled: true,
|
||||
browser_uptime_seconds_consumed: 1,
|
||||
topup_credits_total: 1,
|
||||
topup_credits_used: 1,
|
||||
topup_credits_remaining: 1,
|
||||
credits_remaining: 1,
|
||||
cancel_at_period_end: true,
|
||||
created_at: "2024-01-15T09:30:00Z",
|
||||
modified_at: "2024-01-15T09:30:00Z",
|
||||
};
|
||||
server
|
||||
.mockEndpoint()
|
||||
.get("/api/v1/billing/state")
|
||||
.respondWith()
|
||||
.statusCode(200)
|
||||
.jsonBody(rawResponseBody)
|
||||
.build();
|
||||
|
||||
const response = await client.getOrganizationBillingApiV1BillingStateGet();
|
||||
expect(response).toEqual({
|
||||
billing_id: "billing_id",
|
||||
organization_id: "organization_id",
|
||||
plan_tier: "free",
|
||||
current_period_start: "2024-01-15T09:30:00Z",
|
||||
current_period_end: "2024-01-15T09:30:00Z",
|
||||
included_credits_this_period: 1,
|
||||
credits_consumed_this_period: 1,
|
||||
cached_credits_consumed_this_period: 1,
|
||||
overage_enabled: true,
|
||||
browser_uptime_seconds_consumed: 1,
|
||||
topup_credits_total: 1,
|
||||
topup_credits_used: 1,
|
||||
topup_credits_remaining: 1,
|
||||
credits_remaining: 1,
|
||||
cancel_at_period_end: true,
|
||||
created_at: "2024-01-15T09:30:00Z",
|
||||
modified_at: "2024-01-15T09:30:00Z",
|
||||
});
|
||||
});
|
||||
|
||||
test("get_organization_billing_api_v1_billing_state_get (2)", async () => {
|
||||
const server = mockServerPool.createServer();
|
||||
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
|
||||
|
||||
const rawResponseBody = { key: "value" };
|
||||
server
|
||||
.mockEndpoint()
|
||||
.get("/api/v1/billing/state")
|
||||
.respondWith()
|
||||
.statusCode(422)
|
||||
.jsonBody(rawResponseBody)
|
||||
.build();
|
||||
|
||||
await expect(async () => {
|
||||
return await client.getOrganizationBillingApiV1BillingStateGet();
|
||||
}).rejects.toThrow(Skyvern.UnprocessableEntityError);
|
||||
});
|
||||
|
||||
test("change_tier_api_v1_billing_change_tier_post (1)", async () => {
|
||||
const server = mockServerPool.createServer();
|
||||
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
|
||||
const rawRequestBody = { tier: "free" };
|
||||
const rawResponseBody = { status: "status", tier: "tier", redirect_url: "redirect_url" };
|
||||
server
|
||||
.mockEndpoint()
|
||||
.post("/api/v1/billing/change-tier")
|
||||
.jsonBody(rawRequestBody)
|
||||
.respondWith()
|
||||
.statusCode(200)
|
||||
.jsonBody(rawResponseBody)
|
||||
.build();
|
||||
|
||||
const response = await client.changeTierApiV1BillingChangeTierPost({
|
||||
tier: "free",
|
||||
});
|
||||
expect(response).toEqual({
|
||||
status: "status",
|
||||
tier: "tier",
|
||||
redirect_url: "redirect_url",
|
||||
});
|
||||
});
|
||||
|
||||
test("change_tier_api_v1_billing_change_tier_post (2)", async () => {
|
||||
const server = mockServerPool.createServer();
|
||||
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
|
||||
const rawRequestBody = { tier: "free" };
|
||||
const rawResponseBody = { key: "value" };
|
||||
server
|
||||
.mockEndpoint()
|
||||
.post("/api/v1/billing/change-tier")
|
||||
.jsonBody(rawRequestBody)
|
||||
.respondWith()
|
||||
.statusCode(422)
|
||||
.jsonBody(rawResponseBody)
|
||||
.build();
|
||||
|
||||
await expect(async () => {
|
||||
return await client.changeTierApiV1BillingChangeTierPost({
|
||||
tier: "free",
|
||||
});
|
||||
}).rejects.toThrow(Skyvern.UnprocessableEntityError);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue