Sandbox
Source: src/client/sandbox.ts
Signature
Section titled “Signature”Sandbox(client: Leap0Client, data: SandboxData)Overview
Section titled “Overview”Bound sandbox handle with convenience methods and resource-scoped helpers.
Throws
Section titled “Throws”Leap0Error: If API requests or response validation fail.
Methods
Section titled “Methods”refresh
Section titled “refresh”async refresh(): Promise<this>Fetches the latest sandbox state from the API.
Returns
Section titled “Returns”- The refreshed sandbox handle.
Throws
Section titled “Throws”Leap0Error: If fetching the sandbox fails.
async pause(options?: { timeout?: number }): Promise<this>Pauses the sandbox and updates local state.
Parameters
Section titled “Parameters”options: Optional request settings.
Returns
Section titled “Returns”- The paused sandbox handle.
Throws
Section titled “Throws”Leap0Error: If pausing the sandbox fails.
delete
Section titled “delete”async delete(options?: { timeout?: number }): Promise<void>Deletes the sandbox.
Parameters
Section titled “Parameters”options: Optional request settings.
Throws
Section titled “Throws”Leap0Error: If deleting the sandbox fails.
invokeUrl
Section titled “invokeUrl”invokeUrl(path = "/", port?: number): stringReturns the public invoke URL for the sandbox.
Parameters
Section titled “Parameters”path: Route path to append.port: Optional forwarded port.
Returns
Section titled “Returns”- The public HTTPS URL.
websocketUrl
Section titled “websocketUrl”websocketUrl(path = "/", port?: number): stringReturns the public websocket URL for the sandbox.
Parameters
Section titled “Parameters”path: Route path to append.port: Optional forwarded port.
Returns
Section titled “Returns”- The public websocket URL.