/**
* create script
*
*/
export async function main(
workspace: string,
body: {
path: string;
parent_hash?: string;
summary: string;
description: string;
content: string;
schema?: { [k: string]: unknown };
is_template?: boolean;
lock?: string;
language:
| "python3"
| "deno"
| "go"
| "bash"
| "powershell"
| "postgresql"
| "mysql"
| "bigquery"
| "snowflake"
| "mssql"
| "graphql"
| "nativets"
| "bun";
kind?: "script" | "failure" | "trigger" | "command" | "approval";
tag?: string;
draft_only?: boolean;
envs?: string[];
concurrent_limit?: number;
concurrency_time_window_s?: number;
cache_ttl?: number;
dedicated_worker?: boolean;
ws_error_handler_muted?: boolean;
priority?: number;
restart_unless_cancelled?: boolean;
timeout?: number;
delete_after_use?: boolean;
deployment_message?: string;
concurrency_key?: string;
[k: string]: unknown;
}
) {
const url = new URL(`${BASE_URL}/api/w/${workspace}/scripts/create`);
const response = await fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer " + WM_TOKEN,
},
body: JSON.stringify(body),
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.text();
}
Submitted by hugo697 274 days ago
/**
* create script
*
*/
export async function main(
workspace: string,
body: {
path: string;
parent_hash?: string;
summary: string;
description: string;
content: string;
schema?: { [k: string]: unknown };
is_template?: boolean;
lock?: string[];
language:
| "python3"
| "deno"
| "go"
| "bash"
| "powershell"
| "postgresql"
| "mysql"
| "bigquery"
| "snowflake"
| "graphql"
| "nativets"
| "bun";
kind?: "script" | "failure" | "trigger" | "command" | "approval";
tag?: string;
draft_only?: boolean;
envs?: string[];
concurrent_limit?: number;
concurrency_time_window_s?: number;
cache_ttl?: number;
dedicated_worker?: boolean;
ws_error_handler_muted?: boolean;
priority?: number;
[k: string]: unknown;
}
) {
const url = new URL(`${BASE_URL}/api/w/${workspace}/scripts/create`);
const response = await fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer " + WM_TOKEN,
},
body: JSON.stringify(body),
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.text();
}
Submitted by hugo697 402 days ago
/**
* create script
*
*/
export async function main(
workspace: string,
body: {
path: string;
parent_hash?: string;
summary: string;
description: string;
content: string;
schema?: { [k: string]: unknown };
is_template?: boolean;
lock?: string[];
language:
| "python3"
| "deno"
| "go"
| "bash"
| "powershell"
| "postgresql"
| "mysql"
| "bigquery"
| "snowflake"
| "graphql"
| "nativets"
| "bun";
kind?: "script" | "failure" | "trigger" | "command" | "approval";
tag?: string;
draft_only?: boolean;
envs?: string[];
concurrent_limit?: number[];
concurrency_time_window_s?: number[];
cache_ttl?: number;
dedicated_worker?: boolean;
ws_error_handler_muted?: boolean;
priority?: number;
[k: string]: unknown;
}
) {
const url = new URL(`${BASE_URL}/api/w/${workspace}/scripts/create`);
const response = await fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer " + WM_TOKEN,
},
body: JSON.stringify(body),
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.text();
}
Submitted by hugo697 408 days ago
/**
* create script
*
*/
export async function main(
workspace: string,
body: {
path: string;
parent_hash?: string;
summary: string;
description: string;
content: string;
schema?: { [k: string]: unknown };
is_template?: boolean;
lock?: string[];
language:
| "python3"
| "deno"
| "go"
| "bash"
| "powershell"
| "postgresql"
| "mysql"
| "bigquery"
| "snowflake"
| "graphql"
| "nativets"
| "bun";
kind?: "script" | "failure" | "trigger" | "command" | "approval";
tag?: string;
draft_only?: boolean;
envs?: string[];
concurrent_limit?: number[];
concurrency_time_window_s?: number[];
cache_ttl?: number;
dedicated_worker?: boolean;
ws_error_handler_muted?: boolean;
[k: string]: unknown;
}
) {
const url = new URL(`${BASE_URL}/api/w/${workspace}/scripts/create`);
const response = await fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer " + WM_TOKEN,
},
body: JSON.stringify(body),
});
return await response.text();
}
Submitted by rubenfiszel 410 days ago
/**
* create script
*
*/
export async function main(
workspace: string,
body: {
path: string;
parent_hash?: string;
summary: string;
description: string;
content: string;
schema?: { [k: string]: unknown };
is_template?: boolean;
lock?: string[];
language:
| "python3"
| "deno"
| "go"
| "bash"
| "powershell"
| "postgresql"
| "mysql"
| "bigquery"
| "snowflake"
| "graphql"
| "nativets"
| "bun";
kind?: "script" | "failure" | "trigger" | "command" | "approval";
tag?: string;
draft_only?: boolean;
envs?: string[];
concurrent_limit?: number[];
concurrency_time_window_s?: number[];
cache_ttl?: number;
dedicated_worker?: boolean;
ws_error_handler_muted?: boolean;
[k: string]: unknown;
},
) {
const url = new URL(`${BASE_URL}/api/w/${workspace}/scripts/create`);
const response = await fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer " + WM_TOKEN,
},
body: JSON.stringify(body),
});
return await response.text();
}
Submitted by admin 410 days ago
/**
* create script
*
*/
export async function main(
workspace: string,
body: {
path: string;
parent_hash?: string;
summary: string;
description: string;
content: string;
schema?: { [k: string]: unknown };
is_template?: boolean;
lock?: string[];
language:
| "python3"
| "deno"
| "go"
| "bash"
| "powershell"
| "postgresql"
| "mysql"
| "bigquery"
| "snowflake"
| "graphql"
| "nativets"
| "bun";
kind?: "script" | "failure" | "trigger" | "command" | "approval";
tag?: string;
draft_only?: boolean;
envs?: string[];
concurrent_limit?: number[];
concurrency_time_window_s?: number[];
[k: string]: unknown;
},
) {
const url = new URL(`${BASE_URL}/api/w/${workspace}/scripts/create`);
const response = await fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer " + WM_TOKEN,
},
body: JSON.stringify(body),
});
return await response.text();
}
Submitted by admin 480 days ago