Publish npm package using Trusted Publisher (#3953)
This commit is contained in:
committed by
GitHub
parent
af88a7912b
commit
e3cd3eeae0
@@ -1,6 +1,7 @@
|
||||
// This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import * as Skyvern from "./api/index.js";
|
||||
import { BrowserProfiles } from "./api/resources/browserProfiles/client/Client.js";
|
||||
import { Scripts } from "./api/resources/scripts/client/Client.js";
|
||||
import { Workflows } from "./api/resources/workflows/client/Client.js";
|
||||
import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.js";
|
||||
@@ -18,6 +19,7 @@ export declare namespace SkyvernClient {
|
||||
export class SkyvernClient {
|
||||
protected readonly _options: SkyvernClient.Options;
|
||||
protected _workflows: Workflows | undefined;
|
||||
protected _browserProfiles: BrowserProfiles | undefined;
|
||||
protected _scripts: Scripts | undefined;
|
||||
|
||||
constructor(_options: SkyvernClient.Options = {}) {
|
||||
@@ -42,6 +44,10 @@ export class SkyvernClient {
|
||||
return (this._workflows ??= new Workflows(this._options));
|
||||
}
|
||||
|
||||
public get browserProfiles(): BrowserProfiles {
|
||||
return (this._browserProfiles ??= new BrowserProfiles(this._options));
|
||||
}
|
||||
|
||||
public get scripts(): Scripts {
|
||||
return (this._scripts ??= new Scripts(this._options));
|
||||
}
|
||||
@@ -530,25 +536,34 @@ export class SkyvernClient {
|
||||
/**
|
||||
* Create a new workflow
|
||||
*
|
||||
* @param {Skyvern.WorkflowRequest} request
|
||||
* @param {Skyvern.CreateWorkflowRequest} request
|
||||
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
|
||||
*
|
||||
* @throws {@link Skyvern.UnprocessableEntityError}
|
||||
*
|
||||
* @example
|
||||
* await client.createWorkflow({})
|
||||
* await client.createWorkflow({
|
||||
* folder_id: "folder_id",
|
||||
* body: {}
|
||||
* })
|
||||
*/
|
||||
public createWorkflow(
|
||||
request: Skyvern.WorkflowRequest,
|
||||
request: Skyvern.CreateWorkflowRequest,
|
||||
requestOptions?: SkyvernClient.RequestOptions,
|
||||
): core.HttpResponsePromise<Skyvern.Workflow> {
|
||||
return core.HttpResponsePromise.fromPromise(this.__createWorkflow(request, requestOptions));
|
||||
}
|
||||
|
||||
private async __createWorkflow(
|
||||
request: Skyvern.WorkflowRequest,
|
||||
request: Skyvern.CreateWorkflowRequest,
|
||||
requestOptions?: SkyvernClient.RequestOptions,
|
||||
): Promise<core.WithRawResponse<Skyvern.Workflow>> {
|
||||
const { folder_id: folderId, body: _body } = request;
|
||||
const _queryParams: Record<string, string | string[] | object | object[] | null> = {};
|
||||
if (folderId != null) {
|
||||
_queryParams.folder_id = folderId;
|
||||
}
|
||||
|
||||
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
|
||||
this._options?.headers,
|
||||
mergeOnlyDefinedHeaders({ "x-api-key": requestOptions?.apiKey ?? this._options?.apiKey }),
|
||||
@@ -564,9 +579,9 @@ export class SkyvernClient {
|
||||
method: "POST",
|
||||
headers: _headers,
|
||||
contentType: "application/json",
|
||||
queryParameters: requestOptions?.queryParams,
|
||||
queryParameters: { ..._queryParams, ...requestOptions?.queryParams },
|
||||
requestType: "json",
|
||||
body: request,
|
||||
body: _body,
|
||||
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
||||
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
||||
abortSignal: requestOptions?.abortSignal,
|
||||
|
||||
Reference in New Issue
Block a user