The list of your application's api keys.
Returns the assets directory for your application.
the assets directory for your application.
The context object for the current request. This object contains information about the current request, such as the current user, the IP address, the user agent used, the request headers, and more.
The list of your application's secrets as defined in the Squid Console.
Returns the Squid client instance for your application.
the Squid client instance for your application.
Experimental. Backend-only API for a scratch directory ("workspace") synced across pod replicas via the shared workspace server — not the tenant's shared storage. See WorkspaceClient.
Asserts that the current method call includes an API key in the context. Throws an error if called without an API key.
Asserts that the method is called within a valid request scope. Throws an error if no request context can be found.
Converts a file to a SquidFile object. This function is useful when you want to return a file using OpenAPI (tsoa decorators).
Constructs a response for an OpenAPI operation. This function is typically used within an OpenAPI handler.
Optionalbody: unknown
The payload of the response. If not provided, defaults to an empty string.
OptionalstatusCode: number
The HTTP status code for the response. Defaults to 200 if a body is present, otherwise 204.
Optionalheaders: Record<string, unknown>
An object containing response headers. Defaults to an empty object if not provided.
The openapi response.
A helper method to create a webhook response. This method should be used inside a webhook handler (function decorated with @webhook).
Optionalbody: unknown
The body of the response.
OptionalstatusCode: number
The status code of the response.
Optionalheaders: Record<string, unknown>
The headers of the response.
The webhook response.
Returns the API key used by the backend for your application.
Returns the auth object for the current request or undefined if unauthenticated or if using a user token.
The auth object for the current request or undefined if unauthenticated or if using a user token.
Returns the auth object for the current request or undefined if unauthenticated or if using an API key.
The auth object for the current request or undefined if unauthenticated or if using an API key.
Whether this service is holding in-memory state that would be lost if the worker running it were recycled. Override it to return true while such state exists — an idle worker is normally torn down after a few minutes, which is invisible for a stateless service and destructive for one keeping a live session, a warm cache or a child process alive between calls.
The runtime asks often and expects a cheap, synchronous answer. Returning true indefinitely pins the worker for as long as the pod lives, so it should track the state's own lifetime.
Returns true if the current request is authenticated (using a user token or an API key).
true if the current request is authenticated (using a user token or an API key).
Publishes an AI status update to a specific client. Can be used to notify the client about the status of an AI operation, such as a chat or an aiFunction.
Releases whatever hasLiveState was reporting. Called by the runtime when the worker is
being terminated. Override it together with hasLiveState whenever the state owns something the
worker's own shutdown does not reclaim — a child process outlives the thread that spawned it.
Throws an OpenAPI response. This function is useful when you want to interrupt normal execution and immediately return a response from an OpenAPI handler.
The response content including optional body, status code, and headers.
Throws a webhook response. This function is useful when you want to interrupt normal execution and immediately return a response from a webhook handler.
The response content including optional body, status code, and headers.
A base class for all the different types of Squid backend services. This class serves as a container for the various methods implemented in the backend in order to customize the Squid backend for an application.