🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

freestyle

Package Overview
Dependencies
Maintainers
2
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

freestyle - npm Package Compare versions

Comparing version
0.1.56
to
0.1.57
+245
-234
index.d.cts

@@ -26,48 +26,2 @@ export type FreestyleOptions =

export type VmCreateOptions = {
snapshotId?: string | null;
name?: string | null;
domains?: { domain: string; vmPort?: number | null }[] | null;
idleTimeoutSeconds?: number | null;
baseImage?: { dockerfileContent: string } | null;
rootfsSizeGb?: number | null;
memSizeGb?: number | null;
vcpuCount?: number | null;
waitForReadySignal?: boolean | null;
readySignalTimeoutSeconds?: number | null;
users?: {
name: string;
uid?: number | null;
gecos?: string | null;
groups?: string[];
home?: string | null;
shell?: string | null;
system?: boolean | null;
}[] | null;
groups?: {
name: string;
gid?: number | null;
system?: boolean | null;
}[] | null;
additionalFiles?: Record<string, {
content: string;
encoding?: string;
executable?: boolean;
}> | null;
git?: {
config?: {
user?: {
name?: string | null;
email?: string | null;
signingkey?: string | null;
} | null;
};
repos?: {
repo: string;
path: string;
rev?: string | null;
}[] | null;
} | null;
}
export class VpcWireGuardNamespace {

@@ -122,188 +76,2 @@ createEphemeral(options?: Record<string, never>): Promise<{

export class Deployment {
readonly deploymentId: string;
getDetails(): Promise<{
info: {
deploymentId: string;
accountId: string;
envVars: Record<string, string>;
timeout: number;
state: string;
deployedAt?: string;
domains: string[];
};
events: unknown[];
}>;
getLogs(options?: Record<string, unknown>): Promise<unknown>;
fetch(url: string, init?: RequestInit): Promise<Response>;
}
export class DeploymentsNamespace {
create(options: ({
repo: string;
branch?: string;
rootPath?: string;
} | {
code: string;
} | {
files: { path: string; content: string; encoding?: "utf-8" | "base64" }[];
} | {
tarUrl: string;
}) & {
name?: string;
build?: boolean | {
command: string;
outDir?: string | null;
envVars?: Record<string, string> | null;
};
waitForRollout?: boolean;
domains?: string[];
publicDir?: string;
staticDir?: string;
staticPathPrefix?: string;
prerenderDir?: string;
staticOnly?: boolean;
redirects?: { source: string; destination: string; statusCode?: number; permanent?: boolean }[];
rewrites?: { source: string; destination: string }[];
dynamic?: { source: string; methods?: string[] }[];
headers?: { source: string; headers: { key: string; value: string }[] }[];
cleanUrls?: boolean;
trailingSlash?: boolean;
experimental?: { nextjsOptimization?: boolean };
entrypointPath?: string;
networkPermissions?: { action: "allow" | "deny"; domain: string; behavior: "exact" | "regex" }[];
envVars?: Record<string, string>;
nodeModules?: Record<string, string>;
timeoutMs?: number;
egress?: {
allow?: {
domains?: Record<string, { transform?: { headers?: Record<string, string> }[] }[]>;
ips?: Record<string, { transform?: { headers?: Record<string, string> }[] }[]>;
};
deny?: {
ips?: Record<string, { transform?: { headers?: Record<string, string> }[] }[]>;
};
};
}): Promise<{ deploymentId: string; deployment: Deployment; domains: string[] }>;
list(options?: { limit?: number; cursor?: string; search?: string }): Promise<unknown>;
ref(options: { deploymentId: string }): Deployment;
}
export class RunsNamespace {
create<T = unknown>(options: {
code: string;
egress?: {
allow?: {
domains?: Record<string, { transform?: { headers?: Record<string, string> }[] }[]>;
ips?: Record<string, { transform?: { headers?: Record<string, string> }[] }[]>;
};
deny?: {
ips?: Record<string, { transform?: { headers?: Record<string, string> }[] }[]>;
};
};
[key: string]: unknown;
}): Promise<{ result: T }>;
getLogs(options: { runId: string;[key: string]: unknown }): Promise<unknown>;
list(options?: { limit?: number; cursor?: string }): Promise<{
runs: {
runId: string;
createdAt: string;
startedAt?: string;
status: "starting" | "running" | "complete";
}[];
nextCursor?: string;
totalCount?: number;
}>;
}
export class ServerlessNamespace {
readonly deployments: DeploymentsNamespace;
readonly runs: RunsNamespace;
}
export class CronJob {
readonly schedule: {
id: string;
accountId: string;
deploymentId?: string | null;
runConfig?: ({ code: string;[key: string]: unknown }) | null;
name?: string | null;
path?: string | null;
cron: string;
timezone: string;
retries: number;
payload: unknown;
active: boolean;
createdAt: string;
updatedAt: string;
};
update(params: {
deploymentId?: string;
run?: { code: string;[key: string]: unknown };
name?: string;
cron?: string;
timezone?: string;
retries?: number;
payload?: unknown;
path?: string;
active?: boolean;
}): Promise<void>;
enable(): Promise<void>;
disable(): Promise<void>;
executions(options?: { limit?: number; cursor?: string }): Promise<{
executions: {
id: string;
scheduleId: string;
deploymentId?: string | null;
runAt: string;
status: "queued" | "running" | "succeeded" | "failed" | "retry";
attempts: number;
maxAttempts: number;
lockedAt?: string | null;
lockOwner?: string | null;
lastError?: string | null;
instanceId?: string | null;
createdAt: string;
updatedAt: string;
}[];
nextCursor?: string;
totalCount?: number;
}>;
successRate(options: { start: string | Date; end: string | Date }): Promise<{
total: number;
succeeded: number;
failed: number;
successRate: number;
start: string;
end: string;
}>;
}
export class CronNamespace {
schedule(options: {
deploymentId?: string;
run?: { code: string;[key: string]: unknown };
name?: string;
cron: string;
timezone?: string;
retries?: number;
payload?: unknown;
path?: string;
}): Promise<{ job: CronJob }>;
list(options?: { deploymentId?: string }): Promise<{ jobs: CronJob[] }>;
}
class VmsNamespace {

@@ -313,3 +81,17 @@ /**

*/
create(options?: VmCreateOptions): Promise<{
create(options?: {
snapshotId?: string | null;
name?: string | null;
idleTimeoutSeconds?: number | null;
persistence: |
{ type: "persistent" } |
{ type: "sticky", priority: number } |
{ type: "ephemeral" },
nics: {
default?: boolean;
vpc: string;
mode: "routed";
ipv4: string | true;
}[]
}): Promise<{
vm: Vm;

@@ -529,2 +311,41 @@ vmId: string;

type GitTrigger = {
event: "push";
branches?: string[] | null;
globs?: string[] | null;
}
type GitTriggerAction = {
action: "webhook";
endpoint: string;
}
type GitRepositoryTrigger = {
repositoryId: string;
trigger: GitTrigger;
action: GitTriggerAction;
managed: boolean;
id: string;
createdAt: string;
}
class GitRepoTriggersNamespace {
list(): Promise<{ triggers: GitRepositoryTrigger[] }>;
create(options: {
trigger: GitTrigger;
action: GitTriggerAction;
}): Promise<{ triggerId: string }>;
delete(options: { triggerId: string }): Promise<unknown>;
}
class GitRepoGitHubSyncNamespace {
get(): Promise<{ githubRepoName: string } | null>;
enable(options: { githubRepoName: string }): Promise<void>;
disable(): Promise<void>;
}
class GitNamespace {

@@ -557,2 +378,6 @@ repos: GitReposNamespace;

triggers: GitRepoTriggersNamespace;
githubSync: GitRepoGitHubSyncNamespace;
branches: {

@@ -885,3 +710,3 @@ getDefaultBranch(): Promise<{ defaultBranch: string }>;

export class RunsNamespace {
create<T = unknown>(options: ServerlessRunConfig): Promise<{ result: T;[key: string]: unknown }>;
create<T = unknown>(options: ServerlessRunConfig): Promise<{ result: T }>;

@@ -993,2 +818,188 @@ getLogs(options: { runId: string;[key: string]: unknown }): Promise<unknown>;

list(options?: { deploymentId?: string }): Promise<{ jobs: CronJob[] }>;
}
export class Deployment {
readonly deploymentId: string;
getDetails(): Promise<{
info: {
deploymentId: string;
accountId: string;
envVars: Record<string, string>;
timeout: number;
state: string;
deployedAt?: string;
domains: string[];
};
events: unknown[];
}>;
getLogs(options?: Record<string, unknown>): Promise<unknown>;
fetch(url: string, init?: RequestInit): Promise<Response>;
}
export class DeploymentsNamespace {
create(options: ({
repo: string;
branch?: string;
rootPath?: string;
} | {
code: string;
} | {
files: { path: string; content: string; encoding?: "utf-8" | "base64" }[];
} | {
tarUrl: string;
}) & {
name?: string;
build?: boolean | {
command: string;
outDir?: string | null;
envVars?: Record<string, string> | null;
};
waitForRollout?: boolean;
domains?: string[];
publicDir?: string;
staticDir?: string;
staticPathPrefix?: string;
prerenderDir?: string;
staticOnly?: boolean;
redirects?: { source: string; destination: string; statusCode?: number; permanent?: boolean }[];
rewrites?: { source: string; destination: string }[];
dynamic?: { source: string; methods?: string[] }[];
headers?: { source: string; headers: { key: string; value: string }[] }[];
cleanUrls?: boolean;
trailingSlash?: boolean;
experimental?: { nextjsOptimization?: boolean };
entrypointPath?: string;
networkPermissions?: { action: "allow" | "deny"; domain: string; behavior: "exact" | "regex" }[];
envVars?: Record<string, string>;
nodeModules?: Record<string, string>;
timeoutMs?: number;
egress?: {
allow?: {
domains?: Record<string, { transform?: { headers?: Record<string, string> }[] }[]>;
ips?: Record<string, { transform?: { headers?: Record<string, string> }[] }[]>;
};
deny?: {
ips?: Record<string, { transform?: { headers?: Record<string, string> }[] }[]>;
};
};
}): Promise<{ deploymentId: string; deployment: Deployment; domains: string[] }>;
list(options?: { limit?: number; cursor?: string; search?: string }): Promise<unknown>;
ref(options: { deploymentId: string }): Deployment;
}
export class RunsNamespace {
create<T = unknown>(options: {
code: string;
egress?: {
allow?: {
domains?: Record<string, { transform?: { headers?: Record<string, string> }[] }[]>;
ips?: Record<string, { transform?: { headers?: Record<string, string> }[] }[]>;
};
deny?: {
ips?: Record<string, { transform?: { headers?: Record<string, string> }[] }[]>;
};
};
[key: string]: unknown;
}): Promise<{ result: T }>;
getLogs(options: { runId: string;[key: string]: unknown }): Promise<unknown>;
list(options?: { limit?: number; cursor?: string }): Promise<{
runs: {
runId: string;
createdAt: string;
startedAt?: string;
status: "starting" | "running" | "complete";
}[];
nextCursor?: string;
totalCount?: number;
}>;
}
export class ServerlessNamespace {
readonly deployments: DeploymentsNamespace;
readonly runs: RunsNamespace;
}
export class CronJob {
readonly schedule: {
id: string;
accountId: string;
deploymentId?: string | null;
runConfig?: ({ code: string;[key: string]: unknown }) | null;
name?: string | null;
path?: string | null;
cron: string;
timezone: string;
retries: number;
payload: unknown;
active: boolean;
createdAt: string;
updatedAt: string;
};
update(params: {
deploymentId?: string;
run?: { code: string;[key: string]: unknown };
name?: string;
cron?: string;
timezone?: string;
retries?: number;
payload?: unknown;
path?: string;
active?: boolean;
}): Promise<void>;
enable(): Promise<void>;
disable(): Promise<void>;
executions(options?: { limit?: number; cursor?: string }): Promise<{
executions: {
id: string;
scheduleId: string;
deploymentId?: string | null;
runAt: string;
status: "queued" | "running" | "succeeded" | "failed" | "retry";
attempts: number;
maxAttempts: number;
lockedAt?: string | null;
lockOwner?: string | null;
lastError?: string | null;
instanceId?: string | null;
createdAt: string;
updatedAt: string;
}[];
nextCursor?: string;
totalCount?: number;
}>;
successRate(options: { start: string | Date; end: string | Date }): Promise<{
total: number;
succeeded: number;
failed: number;
successRate: number;
start: string;
end: string;
}>;
}
export class CronNamespace {
schedule(options: {
deploymentId?: string;
run?: { code: string;[key: string]: unknown };
name?: string;
cron: string;
timezone?: string;
retries?: number;
payload?: unknown;
path?: string;
}): Promise<{ job: CronJob }>;
list(options?: { deploymentId?: string }): Promise<{ jobs: CronJob[] }>;
}
+245
-234

@@ -26,48 +26,2 @@ export type FreestyleOptions =

export type VmCreateOptions = {
snapshotId?: string | null;
name?: string | null;
domains?: { domain: string; vmPort?: number | null }[] | null;
idleTimeoutSeconds?: number | null;
baseImage?: { dockerfileContent: string } | null;
rootfsSizeGb?: number | null;
memSizeGb?: number | null;
vcpuCount?: number | null;
waitForReadySignal?: boolean | null;
readySignalTimeoutSeconds?: number | null;
users?: {
name: string;
uid?: number | null;
gecos?: string | null;
groups?: string[];
home?: string | null;
shell?: string | null;
system?: boolean | null;
}[] | null;
groups?: {
name: string;
gid?: number | null;
system?: boolean | null;
}[] | null;
additionalFiles?: Record<string, {
content: string;
encoding?: string;
executable?: boolean;
}> | null;
git?: {
config?: {
user?: {
name?: string | null;
email?: string | null;
signingkey?: string | null;
} | null;
};
repos?: {
repo: string;
path: string;
rev?: string | null;
}[] | null;
} | null;
}
export class VpcWireGuardNamespace {

@@ -122,188 +76,2 @@ createEphemeral(options?: Record<string, never>): Promise<{

export class Deployment {
readonly deploymentId: string;
getDetails(): Promise<{
info: {
deploymentId: string;
accountId: string;
envVars: Record<string, string>;
timeout: number;
state: string;
deployedAt?: string;
domains: string[];
};
events: unknown[];
}>;
getLogs(options?: Record<string, unknown>): Promise<unknown>;
fetch(url: string, init?: RequestInit): Promise<Response>;
}
export class DeploymentsNamespace {
create(options: ({
repo: string;
branch?: string;
rootPath?: string;
} | {
code: string;
} | {
files: { path: string; content: string; encoding?: "utf-8" | "base64" }[];
} | {
tarUrl: string;
}) & {
name?: string;
build?: boolean | {
command: string;
outDir?: string | null;
envVars?: Record<string, string> | null;
};
waitForRollout?: boolean;
domains?: string[];
publicDir?: string;
staticDir?: string;
staticPathPrefix?: string;
prerenderDir?: string;
staticOnly?: boolean;
redirects?: { source: string; destination: string; statusCode?: number; permanent?: boolean }[];
rewrites?: { source: string; destination: string }[];
dynamic?: { source: string; methods?: string[] }[];
headers?: { source: string; headers: { key: string; value: string }[] }[];
cleanUrls?: boolean;
trailingSlash?: boolean;
experimental?: { nextjsOptimization?: boolean };
entrypointPath?: string;
networkPermissions?: { action: "allow" | "deny"; domain: string; behavior: "exact" | "regex" }[];
envVars?: Record<string, string>;
nodeModules?: Record<string, string>;
timeoutMs?: number;
egress?: {
allow?: {
domains?: Record<string, { transform?: { headers?: Record<string, string> }[] }[]>;
ips?: Record<string, { transform?: { headers?: Record<string, string> }[] }[]>;
};
deny?: {
ips?: Record<string, { transform?: { headers?: Record<string, string> }[] }[]>;
};
};
}): Promise<{ deploymentId: string; deployment: Deployment; domains: string[] }>;
list(options?: { limit?: number; cursor?: string; search?: string }): Promise<unknown>;
ref(options: { deploymentId: string }): Deployment;
}
export class RunsNamespace {
create<T = unknown>(options: {
code: string;
egress?: {
allow?: {
domains?: Record<string, { transform?: { headers?: Record<string, string> }[] }[]>;
ips?: Record<string, { transform?: { headers?: Record<string, string> }[] }[]>;
};
deny?: {
ips?: Record<string, { transform?: { headers?: Record<string, string> }[] }[]>;
};
};
[key: string]: unknown;
}): Promise<{ result: T }>;
getLogs(options: { runId: string;[key: string]: unknown }): Promise<unknown>;
list(options?: { limit?: number; cursor?: string }): Promise<{
runs: {
runId: string;
createdAt: string;
startedAt?: string;
status: "starting" | "running" | "complete";
}[];
nextCursor?: string;
totalCount?: number;
}>;
}
export class ServerlessNamespace {
readonly deployments: DeploymentsNamespace;
readonly runs: RunsNamespace;
}
export class CronJob {
readonly schedule: {
id: string;
accountId: string;
deploymentId?: string | null;
runConfig?: ({ code: string;[key: string]: unknown }) | null;
name?: string | null;
path?: string | null;
cron: string;
timezone: string;
retries: number;
payload: unknown;
active: boolean;
createdAt: string;
updatedAt: string;
};
update(params: {
deploymentId?: string;
run?: { code: string;[key: string]: unknown };
name?: string;
cron?: string;
timezone?: string;
retries?: number;
payload?: unknown;
path?: string;
active?: boolean;
}): Promise<void>;
enable(): Promise<void>;
disable(): Promise<void>;
executions(options?: { limit?: number; cursor?: string }): Promise<{
executions: {
id: string;
scheduleId: string;
deploymentId?: string | null;
runAt: string;
status: "queued" | "running" | "succeeded" | "failed" | "retry";
attempts: number;
maxAttempts: number;
lockedAt?: string | null;
lockOwner?: string | null;
lastError?: string | null;
instanceId?: string | null;
createdAt: string;
updatedAt: string;
}[];
nextCursor?: string;
totalCount?: number;
}>;
successRate(options: { start: string | Date; end: string | Date }): Promise<{
total: number;
succeeded: number;
failed: number;
successRate: number;
start: string;
end: string;
}>;
}
export class CronNamespace {
schedule(options: {
deploymentId?: string;
run?: { code: string;[key: string]: unknown };
name?: string;
cron: string;
timezone?: string;
retries?: number;
payload?: unknown;
path?: string;
}): Promise<{ job: CronJob }>;
list(options?: { deploymentId?: string }): Promise<{ jobs: CronJob[] }>;
}
class VmsNamespace {

@@ -313,3 +81,17 @@ /**

*/
create(options?: VmCreateOptions): Promise<{
create(options?: {
snapshotId?: string | null;
name?: string | null;
idleTimeoutSeconds?: number | null;
persistence: |
{ type: "persistent" } |
{ type: "sticky", priority: number } |
{ type: "ephemeral" },
nics: {
default?: boolean;
vpc: string;
mode: "routed";
ipv4: string | true;
}[]
}): Promise<{
vm: Vm;

@@ -529,2 +311,41 @@ vmId: string;

type GitTrigger = {
event: "push";
branches?: string[] | null;
globs?: string[] | null;
}
type GitTriggerAction = {
action: "webhook";
endpoint: string;
}
type GitRepositoryTrigger = {
repositoryId: string;
trigger: GitTrigger;
action: GitTriggerAction;
managed: boolean;
id: string;
createdAt: string;
}
class GitRepoTriggersNamespace {
list(): Promise<{ triggers: GitRepositoryTrigger[] }>;
create(options: {
trigger: GitTrigger;
action: GitTriggerAction;
}): Promise<{ triggerId: string }>;
delete(options: { triggerId: string }): Promise<unknown>;
}
class GitRepoGitHubSyncNamespace {
get(): Promise<{ githubRepoName: string } | null>;
enable(options: { githubRepoName: string }): Promise<void>;
disable(): Promise<void>;
}
class GitNamespace {

@@ -557,2 +378,6 @@ repos: GitReposNamespace;

triggers: GitRepoTriggersNamespace;
githubSync: GitRepoGitHubSyncNamespace;
branches: {

@@ -885,3 +710,3 @@ getDefaultBranch(): Promise<{ defaultBranch: string }>;

export class RunsNamespace {
create<T = unknown>(options: ServerlessRunConfig): Promise<{ result: T;[key: string]: unknown }>;
create<T = unknown>(options: ServerlessRunConfig): Promise<{ result: T }>;

@@ -993,2 +818,188 @@ getLogs(options: { runId: string;[key: string]: unknown }): Promise<unknown>;

list(options?: { deploymentId?: string }): Promise<{ jobs: CronJob[] }>;
}
export class Deployment {
readonly deploymentId: string;
getDetails(): Promise<{
info: {
deploymentId: string;
accountId: string;
envVars: Record<string, string>;
timeout: number;
state: string;
deployedAt?: string;
domains: string[];
};
events: unknown[];
}>;
getLogs(options?: Record<string, unknown>): Promise<unknown>;
fetch(url: string, init?: RequestInit): Promise<Response>;
}
export class DeploymentsNamespace {
create(options: ({
repo: string;
branch?: string;
rootPath?: string;
} | {
code: string;
} | {
files: { path: string; content: string; encoding?: "utf-8" | "base64" }[];
} | {
tarUrl: string;
}) & {
name?: string;
build?: boolean | {
command: string;
outDir?: string | null;
envVars?: Record<string, string> | null;
};
waitForRollout?: boolean;
domains?: string[];
publicDir?: string;
staticDir?: string;
staticPathPrefix?: string;
prerenderDir?: string;
staticOnly?: boolean;
redirects?: { source: string; destination: string; statusCode?: number; permanent?: boolean }[];
rewrites?: { source: string; destination: string }[];
dynamic?: { source: string; methods?: string[] }[];
headers?: { source: string; headers: { key: string; value: string }[] }[];
cleanUrls?: boolean;
trailingSlash?: boolean;
experimental?: { nextjsOptimization?: boolean };
entrypointPath?: string;
networkPermissions?: { action: "allow" | "deny"; domain: string; behavior: "exact" | "regex" }[];
envVars?: Record<string, string>;
nodeModules?: Record<string, string>;
timeoutMs?: number;
egress?: {
allow?: {
domains?: Record<string, { transform?: { headers?: Record<string, string> }[] }[]>;
ips?: Record<string, { transform?: { headers?: Record<string, string> }[] }[]>;
};
deny?: {
ips?: Record<string, { transform?: { headers?: Record<string, string> }[] }[]>;
};
};
}): Promise<{ deploymentId: string; deployment: Deployment; domains: string[] }>;
list(options?: { limit?: number; cursor?: string; search?: string }): Promise<unknown>;
ref(options: { deploymentId: string }): Deployment;
}
export class RunsNamespace {
create<T = unknown>(options: {
code: string;
egress?: {
allow?: {
domains?: Record<string, { transform?: { headers?: Record<string, string> }[] }[]>;
ips?: Record<string, { transform?: { headers?: Record<string, string> }[] }[]>;
};
deny?: {
ips?: Record<string, { transform?: { headers?: Record<string, string> }[] }[]>;
};
};
[key: string]: unknown;
}): Promise<{ result: T }>;
getLogs(options: { runId: string;[key: string]: unknown }): Promise<unknown>;
list(options?: { limit?: number; cursor?: string }): Promise<{
runs: {
runId: string;
createdAt: string;
startedAt?: string;
status: "starting" | "running" | "complete";
}[];
nextCursor?: string;
totalCount?: number;
}>;
}
export class ServerlessNamespace {
readonly deployments: DeploymentsNamespace;
readonly runs: RunsNamespace;
}
export class CronJob {
readonly schedule: {
id: string;
accountId: string;
deploymentId?: string | null;
runConfig?: ({ code: string;[key: string]: unknown }) | null;
name?: string | null;
path?: string | null;
cron: string;
timezone: string;
retries: number;
payload: unknown;
active: boolean;
createdAt: string;
updatedAt: string;
};
update(params: {
deploymentId?: string;
run?: { code: string;[key: string]: unknown };
name?: string;
cron?: string;
timezone?: string;
retries?: number;
payload?: unknown;
path?: string;
active?: boolean;
}): Promise<void>;
enable(): Promise<void>;
disable(): Promise<void>;
executions(options?: { limit?: number; cursor?: string }): Promise<{
executions: {
id: string;
scheduleId: string;
deploymentId?: string | null;
runAt: string;
status: "queued" | "running" | "succeeded" | "failed" | "retry";
attempts: number;
maxAttempts: number;
lockedAt?: string | null;
lockOwner?: string | null;
lastError?: string | null;
instanceId?: string | null;
createdAt: string;
updatedAt: string;
}[];
nextCursor?: string;
totalCount?: number;
}>;
successRate(options: { start: string | Date; end: string | Date }): Promise<{
total: number;
succeeded: number;
failed: number;
successRate: number;
start: string;
end: string;
}>;
}
export class CronNamespace {
schedule(options: {
deploymentId?: string;
run?: { code: string;[key: string]: unknown };
name?: string;
cron: string;
timezone?: string;
retries?: number;
payload?: unknown;
path?: string;
}): Promise<{ job: CronJob }>;
list(options?: { deploymentId?: string }): Promise<{ jobs: CronJob[] }>;
}
+245
-234

@@ -26,48 +26,2 @@ export type FreestyleOptions =

export type VmCreateOptions = {
snapshotId?: string | null;
name?: string | null;
domains?: { domain: string; vmPort?: number | null }[] | null;
idleTimeoutSeconds?: number | null;
baseImage?: { dockerfileContent: string } | null;
rootfsSizeGb?: number | null;
memSizeGb?: number | null;
vcpuCount?: number | null;
waitForReadySignal?: boolean | null;
readySignalTimeoutSeconds?: number | null;
users?: {
name: string;
uid?: number | null;
gecos?: string | null;
groups?: string[];
home?: string | null;
shell?: string | null;
system?: boolean | null;
}[] | null;
groups?: {
name: string;
gid?: number | null;
system?: boolean | null;
}[] | null;
additionalFiles?: Record<string, {
content: string;
encoding?: string;
executable?: boolean;
}> | null;
git?: {
config?: {
user?: {
name?: string | null;
email?: string | null;
signingkey?: string | null;
} | null;
};
repos?: {
repo: string;
path: string;
rev?: string | null;
}[] | null;
} | null;
}
export class VpcWireGuardNamespace {

@@ -122,188 +76,2 @@ createEphemeral(options?: Record<string, never>): Promise<{

export class Deployment {
readonly deploymentId: string;
getDetails(): Promise<{
info: {
deploymentId: string;
accountId: string;
envVars: Record<string, string>;
timeout: number;
state: string;
deployedAt?: string;
domains: string[];
};
events: unknown[];
}>;
getLogs(options?: Record<string, unknown>): Promise<unknown>;
fetch(url: string, init?: RequestInit): Promise<Response>;
}
export class DeploymentsNamespace {
create(options: ({
repo: string;
branch?: string;
rootPath?: string;
} | {
code: string;
} | {
files: { path: string; content: string; encoding?: "utf-8" | "base64" }[];
} | {
tarUrl: string;
}) & {
name?: string;
build?: boolean | {
command: string;
outDir?: string | null;
envVars?: Record<string, string> | null;
};
waitForRollout?: boolean;
domains?: string[];
publicDir?: string;
staticDir?: string;
staticPathPrefix?: string;
prerenderDir?: string;
staticOnly?: boolean;
redirects?: { source: string; destination: string; statusCode?: number; permanent?: boolean }[];
rewrites?: { source: string; destination: string }[];
dynamic?: { source: string; methods?: string[] }[];
headers?: { source: string; headers: { key: string; value: string }[] }[];
cleanUrls?: boolean;
trailingSlash?: boolean;
experimental?: { nextjsOptimization?: boolean };
entrypointPath?: string;
networkPermissions?: { action: "allow" | "deny"; domain: string; behavior: "exact" | "regex" }[];
envVars?: Record<string, string>;
nodeModules?: Record<string, string>;
timeoutMs?: number;
egress?: {
allow?: {
domains?: Record<string, { transform?: { headers?: Record<string, string> }[] }[]>;
ips?: Record<string, { transform?: { headers?: Record<string, string> }[] }[]>;
};
deny?: {
ips?: Record<string, { transform?: { headers?: Record<string, string> }[] }[]>;
};
};
}): Promise<{ deploymentId: string; deployment: Deployment; domains: string[] }>;
list(options?: { limit?: number; cursor?: string; search?: string }): Promise<unknown>;
ref(options: { deploymentId: string }): Deployment;
}
export class RunsNamespace {
create<T = unknown>(options: {
code: string;
egress?: {
allow?: {
domains?: Record<string, { transform?: { headers?: Record<string, string> }[] }[]>;
ips?: Record<string, { transform?: { headers?: Record<string, string> }[] }[]>;
};
deny?: {
ips?: Record<string, { transform?: { headers?: Record<string, string> }[] }[]>;
};
};
[key: string]: unknown;
}): Promise<{ result: T }>;
getLogs(options: { runId: string;[key: string]: unknown }): Promise<unknown>;
list(options?: { limit?: number; cursor?: string }): Promise<{
runs: {
runId: string;
createdAt: string;
startedAt?: string;
status: "starting" | "running" | "complete";
}[];
nextCursor?: string;
totalCount?: number;
}>;
}
export class ServerlessNamespace {
readonly deployments: DeploymentsNamespace;
readonly runs: RunsNamespace;
}
export class CronJob {
readonly schedule: {
id: string;
accountId: string;
deploymentId?: string | null;
runConfig?: ({ code: string;[key: string]: unknown }) | null;
name?: string | null;
path?: string | null;
cron: string;
timezone: string;
retries: number;
payload: unknown;
active: boolean;
createdAt: string;
updatedAt: string;
};
update(params: {
deploymentId?: string;
run?: { code: string;[key: string]: unknown };
name?: string;
cron?: string;
timezone?: string;
retries?: number;
payload?: unknown;
path?: string;
active?: boolean;
}): Promise<void>;
enable(): Promise<void>;
disable(): Promise<void>;
executions(options?: { limit?: number; cursor?: string }): Promise<{
executions: {
id: string;
scheduleId: string;
deploymentId?: string | null;
runAt: string;
status: "queued" | "running" | "succeeded" | "failed" | "retry";
attempts: number;
maxAttempts: number;
lockedAt?: string | null;
lockOwner?: string | null;
lastError?: string | null;
instanceId?: string | null;
createdAt: string;
updatedAt: string;
}[];
nextCursor?: string;
totalCount?: number;
}>;
successRate(options: { start: string | Date; end: string | Date }): Promise<{
total: number;
succeeded: number;
failed: number;
successRate: number;
start: string;
end: string;
}>;
}
export class CronNamespace {
schedule(options: {
deploymentId?: string;
run?: { code: string;[key: string]: unknown };
name?: string;
cron: string;
timezone?: string;
retries?: number;
payload?: unknown;
path?: string;
}): Promise<{ job: CronJob }>;
list(options?: { deploymentId?: string }): Promise<{ jobs: CronJob[] }>;
}
class VmsNamespace {

@@ -313,3 +81,17 @@ /**

*/
create(options?: VmCreateOptions): Promise<{
create(options?: {
snapshotId?: string | null;
name?: string | null;
idleTimeoutSeconds?: number | null;
persistence: |
{ type: "persistent" } |
{ type: "sticky", priority: number } |
{ type: "ephemeral" },
nics: {
default?: boolean;
vpc: string;
mode: "routed";
ipv4: string | true;
}[]
}): Promise<{
vm: Vm;

@@ -529,2 +311,41 @@ vmId: string;

type GitTrigger = {
event: "push";
branches?: string[] | null;
globs?: string[] | null;
}
type GitTriggerAction = {
action: "webhook";
endpoint: string;
}
type GitRepositoryTrigger = {
repositoryId: string;
trigger: GitTrigger;
action: GitTriggerAction;
managed: boolean;
id: string;
createdAt: string;
}
class GitRepoTriggersNamespace {
list(): Promise<{ triggers: GitRepositoryTrigger[] }>;
create(options: {
trigger: GitTrigger;
action: GitTriggerAction;
}): Promise<{ triggerId: string }>;
delete(options: { triggerId: string }): Promise<unknown>;
}
class GitRepoGitHubSyncNamespace {
get(): Promise<{ githubRepoName: string } | null>;
enable(options: { githubRepoName: string }): Promise<void>;
disable(): Promise<void>;
}
class GitNamespace {

@@ -557,2 +378,6 @@ repos: GitReposNamespace;

triggers: GitRepoTriggersNamespace;
githubSync: GitRepoGitHubSyncNamespace;
branches: {

@@ -885,3 +710,3 @@ getDefaultBranch(): Promise<{ defaultBranch: string }>;

export class RunsNamespace {
create<T = unknown>(options: ServerlessRunConfig): Promise<{ result: T;[key: string]: unknown }>;
create<T = unknown>(options: ServerlessRunConfig): Promise<{ result: T }>;

@@ -993,2 +818,188 @@ getLogs(options: { runId: string;[key: string]: unknown }): Promise<unknown>;

list(options?: { deploymentId?: string }): Promise<{ jobs: CronJob[] }>;
}
export class Deployment {
readonly deploymentId: string;
getDetails(): Promise<{
info: {
deploymentId: string;
accountId: string;
envVars: Record<string, string>;
timeout: number;
state: string;
deployedAt?: string;
domains: string[];
};
events: unknown[];
}>;
getLogs(options?: Record<string, unknown>): Promise<unknown>;
fetch(url: string, init?: RequestInit): Promise<Response>;
}
export class DeploymentsNamespace {
create(options: ({
repo: string;
branch?: string;
rootPath?: string;
} | {
code: string;
} | {
files: { path: string; content: string; encoding?: "utf-8" | "base64" }[];
} | {
tarUrl: string;
}) & {
name?: string;
build?: boolean | {
command: string;
outDir?: string | null;
envVars?: Record<string, string> | null;
};
waitForRollout?: boolean;
domains?: string[];
publicDir?: string;
staticDir?: string;
staticPathPrefix?: string;
prerenderDir?: string;
staticOnly?: boolean;
redirects?: { source: string; destination: string; statusCode?: number; permanent?: boolean }[];
rewrites?: { source: string; destination: string }[];
dynamic?: { source: string; methods?: string[] }[];
headers?: { source: string; headers: { key: string; value: string }[] }[];
cleanUrls?: boolean;
trailingSlash?: boolean;
experimental?: { nextjsOptimization?: boolean };
entrypointPath?: string;
networkPermissions?: { action: "allow" | "deny"; domain: string; behavior: "exact" | "regex" }[];
envVars?: Record<string, string>;
nodeModules?: Record<string, string>;
timeoutMs?: number;
egress?: {
allow?: {
domains?: Record<string, { transform?: { headers?: Record<string, string> }[] }[]>;
ips?: Record<string, { transform?: { headers?: Record<string, string> }[] }[]>;
};
deny?: {
ips?: Record<string, { transform?: { headers?: Record<string, string> }[] }[]>;
};
};
}): Promise<{ deploymentId: string; deployment: Deployment; domains: string[] }>;
list(options?: { limit?: number; cursor?: string; search?: string }): Promise<unknown>;
ref(options: { deploymentId: string }): Deployment;
}
export class RunsNamespace {
create<T = unknown>(options: {
code: string;
egress?: {
allow?: {
domains?: Record<string, { transform?: { headers?: Record<string, string> }[] }[]>;
ips?: Record<string, { transform?: { headers?: Record<string, string> }[] }[]>;
};
deny?: {
ips?: Record<string, { transform?: { headers?: Record<string, string> }[] }[]>;
};
};
[key: string]: unknown;
}): Promise<{ result: T }>;
getLogs(options: { runId: string;[key: string]: unknown }): Promise<unknown>;
list(options?: { limit?: number; cursor?: string }): Promise<{
runs: {
runId: string;
createdAt: string;
startedAt?: string;
status: "starting" | "running" | "complete";
}[];
nextCursor?: string;
totalCount?: number;
}>;
}
export class ServerlessNamespace {
readonly deployments: DeploymentsNamespace;
readonly runs: RunsNamespace;
}
export class CronJob {
readonly schedule: {
id: string;
accountId: string;
deploymentId?: string | null;
runConfig?: ({ code: string;[key: string]: unknown }) | null;
name?: string | null;
path?: string | null;
cron: string;
timezone: string;
retries: number;
payload: unknown;
active: boolean;
createdAt: string;
updatedAt: string;
};
update(params: {
deploymentId?: string;
run?: { code: string;[key: string]: unknown };
name?: string;
cron?: string;
timezone?: string;
retries?: number;
payload?: unknown;
path?: string;
active?: boolean;
}): Promise<void>;
enable(): Promise<void>;
disable(): Promise<void>;
executions(options?: { limit?: number; cursor?: string }): Promise<{
executions: {
id: string;
scheduleId: string;
deploymentId?: string | null;
runAt: string;
status: "queued" | "running" | "succeeded" | "failed" | "retry";
attempts: number;
maxAttempts: number;
lockedAt?: string | null;
lockOwner?: string | null;
lastError?: string | null;
instanceId?: string | null;
createdAt: string;
updatedAt: string;
}[];
nextCursor?: string;
totalCount?: number;
}>;
successRate(options: { start: string | Date; end: string | Date }): Promise<{
total: number;
succeeded: number;
failed: number;
successRate: number;
start: string;
end: string;
}>;
}
export class CronNamespace {
schedule(options: {
deploymentId?: string;
run?: { code: string;[key: string]: unknown };
name?: string;
cron: string;
timezone?: string;
retries?: number;
payload?: unknown;
path?: string;
}): Promise<{ job: CronJob }>;
list(options?: { deploymentId?: string }): Promise<{ jobs: CronJob[] }>;
}
{
"name": "freestyle",
"version": "0.1.56",
"version": "0.1.57",
"type": "module",

@@ -5,0 +5,0 @@ "exports": {