UNPKG

@fly/sprites

Version:

JavaScript/TypeScript SDK for Sprites - remote command execution

60 lines 1.8 kB
/** * Sprite class representing a sprite instance */ import { SpritesClient } from './client.js'; import { SpriteCommand } from './exec.js'; import type { SpawnOptions, ExecOptions, ExecResult, Session, SpriteConfig } from './types.js'; /** * Represents a sprite instance */ export declare class Sprite { readonly name: string; readonly client: SpritesClient; id?: string; organizationName?: string; status?: string; config?: SpriteConfig; environment?: Record<string, string>; createdAt?: Date; updatedAt?: Date; bucketName?: string; primaryRegion?: string; constructor(name: string, client: SpritesClient); /** * Spawn a command on the sprite (event-based API, most Node.js-like) */ spawn(command: string, args?: string[], options?: SpawnOptions): SpriteCommand; /** * Execute a command and return a promise with the output */ exec(command: string, options?: ExecOptions): Promise<ExecResult>; /** * Execute a file with arguments and return a promise with the output */ execFile(file: string, args?: string[], options?: ExecOptions): Promise<ExecResult>; /** * Create a detachable tmux session */ createSession(command: string, args?: string[], options?: SpawnOptions): SpriteCommand; /** * Attach to an existing session */ attachSession(sessionId: string, options?: SpawnOptions): SpriteCommand; /** * List active sessions */ listSessions(): Promise<Session[]>; /** * Delete this sprite */ delete(): Promise<void>; /** * Alias for delete() */ destroy(): Promise<void>; /** * Upgrade this sprite to the latest version */ upgrade(): Promise<void>; } //# sourceMappingURL=sprite.d.ts.map