diff --git a/.github/media/icon-text-black.svg b/.github/media/icon-text-black.svg
deleted file mode 100644
index cafb82777f..0000000000
--- a/.github/media/icon-text-black.svg
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/.github/media/icon-text-white.svg b/.github/media/icon-text-white.svg
deleted file mode 100644
index 3494cd1957..0000000000
--- a/.github/media/icon-text-white.svg
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/.github/media/logo/icon-text-black.svg b/.github/media/logo/icon-text-black.svg
new file mode 100644
index 0000000000..14f0fe0526
--- /dev/null
+++ b/.github/media/logo/icon-text-black.svg
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/.github/media/logo/icon-text-white.svg b/.github/media/logo/icon-text-white.svg
new file mode 100644
index 0000000000..1807618212
--- /dev/null
+++ b/.github/media/logo/icon-text-white.svg
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/.github/media/platforms/actor-core.svg b/.github/media/platforms/actor-core.svg
new file mode 100644
index 0000000000..93045c9d5c
--- /dev/null
+++ b/.github/media/platforms/actor-core.svg
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.github/media/platforms/aws-lambda.svg b/.github/media/platforms/aws-lambda.svg
new file mode 100644
index 0000000000..8cd574732c
--- /dev/null
+++ b/.github/media/platforms/aws-lambda.svg
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.github/media/platforms/bun.svg b/.github/media/platforms/bun.svg
new file mode 100644
index 0000000000..edd9f242bd
--- /dev/null
+++ b/.github/media/platforms/bun.svg
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.github/media/platforms/cloudflare-workers.svg b/.github/media/platforms/cloudflare-workers.svg
new file mode 100644
index 0000000000..739274a993
--- /dev/null
+++ b/.github/media/platforms/cloudflare-workers.svg
@@ -0,0 +1,7 @@
+
+
\ No newline at end of file
diff --git a/.github/media/platforms/file-system.svg b/.github/media/platforms/file-system.svg
new file mode 100644
index 0000000000..ce0539fc82
--- /dev/null
+++ b/.github/media/platforms/file-system.svg
@@ -0,0 +1 @@
+
diff --git a/.github/media/platforms/memory.svg b/.github/media/platforms/memory.svg
new file mode 100644
index 0000000000..484a48220a
--- /dev/null
+++ b/.github/media/platforms/memory.svg
@@ -0,0 +1 @@
+
diff --git a/.github/media/platforms/nodejs.svg b/.github/media/platforms/nodejs.svg
new file mode 100644
index 0000000000..5f3bd11110
--- /dev/null
+++ b/.github/media/platforms/nodejs.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/.github/media/platforms/postgres.svg b/.github/media/platforms/postgres.svg
new file mode 100644
index 0000000000..8666f75c1d
--- /dev/null
+++ b/.github/media/platforms/postgres.svg
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.github/media/platforms/redis.svg b/.github/media/platforms/redis.svg
new file mode 100644
index 0000000000..ad593a83e1
--- /dev/null
+++ b/.github/media/platforms/redis.svg
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
+
+
+]>
+
+
+
+
+
+
+
+
+
+
diff --git a/.github/media/platforms/rivet-bg.svg b/.github/media/platforms/rivet-bg.svg
new file mode 100644
index 0000000000..701f8f6a67
--- /dev/null
+++ b/.github/media/platforms/rivet-bg.svg
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/.github/media/platforms/rivet-white.svg b/.github/media/platforms/rivet-white.svg
new file mode 100644
index 0000000000..81337354dd
--- /dev/null
+++ b/.github/media/platforms/rivet-white.svg
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.github/media/platforms/socketio.svg b/.github/media/platforms/socketio.svg
new file mode 100644
index 0000000000..2818efeb0d
--- /dev/null
+++ b/.github/media/platforms/socketio.svg
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/.github/media/platforms/supabase.svg b/.github/media/platforms/supabase.svg
new file mode 100644
index 0000000000..ad802ac16a
--- /dev/null
+++ b/.github/media/platforms/supabase.svg
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.github/media/platforms/vercel.svg b/.github/media/platforms/vercel.svg
new file mode 100644
index 0000000000..4e3b0e9335
--- /dev/null
+++ b/.github/media/platforms/vercel.svg
@@ -0,0 +1,3 @@
+
+
+
diff --git a/.github/media/quotes/posts/1902835527977439591.jpg b/.github/media/quotes/posts/1902835527977439591.jpg
new file mode 100644
index 0000000000..e4403665a7
Binary files /dev/null and b/.github/media/quotes/posts/1902835527977439591.jpg differ
diff --git a/.github/media/quotes/posts/1909278348812952007.png b/.github/media/quotes/posts/1909278348812952007.png
new file mode 100644
index 0000000000..f799ec7428
Binary files /dev/null and b/.github/media/quotes/posts/1909278348812952007.png differ
diff --git a/.github/media/quotes/users/Chinoman10_.jpg b/.github/media/quotes/users/Chinoman10_.jpg
new file mode 100644
index 0000000000..f37c750a2a
Binary files /dev/null and b/.github/media/quotes/users/Chinoman10_.jpg differ
diff --git a/.github/media/quotes/users/Social_Quotient.jpg b/.github/media/quotes/users/Social_Quotient.jpg
new file mode 100644
index 0000000000..ea6fcddbda
Binary files /dev/null and b/.github/media/quotes/users/Social_Quotient.jpg differ
diff --git a/.github/media/quotes/users/alistaiir.jpg b/.github/media/quotes/users/alistaiir.jpg
new file mode 100644
index 0000000000..67f2eaedc5
Binary files /dev/null and b/.github/media/quotes/users/alistaiir.jpg differ
diff --git a/.github/media/quotes/users/devgerred.jpg b/.github/media/quotes/users/devgerred.jpg
new file mode 100644
index 0000000000..4a5a86e492
Binary files /dev/null and b/.github/media/quotes/users/devgerred.jpg differ
diff --git a/.github/media/quotes/users/j0g1t.jpg b/.github/media/quotes/users/j0g1t.jpg
new file mode 100644
index 0000000000..fb881848e0
Binary files /dev/null and b/.github/media/quotes/users/j0g1t.jpg differ
diff --git a/.github/media/quotes/users/localfirstnews.jpg b/.github/media/quotes/users/localfirstnews.jpg
new file mode 100644
index 0000000000..55bb2081be
Binary files /dev/null and b/.github/media/quotes/users/localfirstnews.jpg differ
diff --git a/.github/media/quotes/users/samgoodwin89.jpg b/.github/media/quotes/users/samgoodwin89.jpg
new file mode 100644
index 0000000000..7d3dbf7a13
Binary files /dev/null and b/.github/media/quotes/users/samgoodwin89.jpg differ
diff --git a/.github/media/quotes/users/samk0_com.jpg b/.github/media/quotes/users/samk0_com.jpg
new file mode 100644
index 0000000000..4ae81a0bb0
Binary files /dev/null and b/.github/media/quotes/users/samk0_com.jpg differ
diff --git a/.github/media/quotes/users/uripont_.jpg b/.github/media/quotes/users/uripont_.jpg
new file mode 100644
index 0000000000..8cd28fc032
Binary files /dev/null and b/.github/media/quotes/users/uripont_.jpg differ
diff --git a/.github/media/rivetkit-logo/dark.svg b/.github/media/rivetkit-logo/dark.svg
new file mode 100644
index 0000000000..b4acf43f14
--- /dev/null
+++ b/.github/media/rivetkit-logo/dark.svg
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/.github/media/rivetkit-logo/light.svg b/.github/media/rivetkit-logo/light.svg
new file mode 100644
index 0000000000..0972b49a57
--- /dev/null
+++ b/.github/media/rivetkit-logo/light.svg
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/.github/media/screenshots/studio/simple.png b/.github/media/screenshots/studio/simple.png
new file mode 100644
index 0000000000..1b9fa422cf
Binary files /dev/null and b/.github/media/screenshots/studio/simple.png differ
diff --git a/.github/media/studio-video-demo5.png b/.github/media/studio-video-demo5.png
new file mode 100644
index 0000000000..56ad44d930
Binary files /dev/null and b/.github/media/studio-video-demo5.png differ
diff --git a/.github/workflows/pkg-pr-new.yaml b/.github/workflows/pkg-pr-new.yaml
index b2d18c2caf..bd99ad0f11 100644
--- a/.github/workflows/pkg-pr-new.yaml
+++ b/.github/workflows/pkg-pr-new.yaml
@@ -1,20 +1,13 @@
on:
pull_request:
- push:
- branches:
- - main
jobs:
publish:
- runs-on: ubuntu-22.04
+ runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- with:
- lfs: true
- run: corepack enable
- uses: actions/setup-node@v4
- with:
- cache: "pnpm"
- run: pnpm install
- - run: pnpm build -F @rivetkit/engine-runner-protocol -F @rivetkit/engine-runner
- - run: pnpm dlx pkg-pr-new publish 'sdks/typescript/runner/' 'sdks/typescript/runner-protocol/'
+ - run: pnpm build
+ - run: pnpm dlx pkg-pr-new publish 'engine/sdks/typescript/runner/' 'engine/sdks/typescript/runner-protocol/' 'rivetkit-typescript/packages/*' --packageManager pnpm --template './examples/*'
diff --git a/README.md b/README.md
new file mode 100644
index 0000000000..ffe3c7b2ff
--- /dev/null
+++ b/README.md
@@ -0,0 +1,192 @@
+
+
+
+
+
+
+
+
+
+
Build and scale stateful workloads
+
+ Rivet is an open-source library for long-lived processes.
+ Like Lambda — but with realtime, persistence, and hibernation.
+ Easily self-hostable and works with your infrastructure .
+
+
+ Quickstart •
+ Documentation •
+ Changelog •
+ Discord •
+ X
+
+
+
+## Projects
+
+Projects that live in this repository:
+
+- **RivetKit**: Library for building with Rivet
+ - **[TypeScript](/rivetkit-typescript)**: Client & server
+ - **[Rust](/rivetkit-typescript)**, Client only, experimental
+ - **[Python](/rivetkit-typescript)**: Client only, experimental
+ - **[OpenAPI](/rivetkit-openapi)**: OpenAPI spec for RivetKit
+- **[Rivet Engine](/engine)**: High-performance, Rust-based engine that powers Rivet at scale
+ - **[Pegboard](packages/services/pegboard/)**: Actor orchestrator & networking
+ - **[Gasoline](/engine/packages/gasoline)**: Durable execution engine that powers Rivet
+ - **[Guard](/engine/packages/guard)**: Proxy for routing traffic to Rivet Actors
+ - **[Epoxy](/engine/packages/epoxy)**: Multi-region KV store based on Epaxos
+- **[Rivet Dashboard](/frontend/apps/studio)**: Like Chrome Inspector, but for Rivet
+- **[Rivet Documentation](/website/src/content/docs)**: Documentation at [rivet.dev/docs](https://www.rivet.dev)
+- **[Rivet Website](/website)**: Source code for [rivet.dev](https://www.rivet.dev)
+
+## Features
+
+Rivet provides everything you need to build fast, scalable, and real-time applications without the complexity.
+
+- **Long-Lived, Stateful Compute**: Persistent memory between requests
+- **No Database Round Trips**: State stored locally for speed
+- **Realtime, Made Simple**: WebSocket/SSE updates built-in
+- **Sleep When Idle**: Hibernation with zero cold starts
+- **Insane Scale**: Auto-scale from zero to millions
+- **Resilient by Design**: Built-in failover and recovery
+- **Edge State Storage**: Geographically distributed state
+- **Web Standards**: WebSockets, SSE, HTTP compatible
+- **No Vendor Lock-In**: Open-source, self-hostable
+
+## Examples
+
+- [AI Agent](/examples/ai-agent)
+- [Realtime Docs](/examples/crdt)
+- [Workflows](/examples/workflows)
+- [Local-First Sync](/examples/sync)
+- [Per-User Database](/examples/database)
+- [Background Jobs](/examples/background-jobs)
+- [Rate Limiting](/examples/rate)
+- [Multiplayer Game](/examples/game)
+- [Bots](/examples/bots)
+
+## Getting Started
+
+### Building with Rivet
+
+Get started with Rivet by following a quickstart guide:
+
+- **[Node.js & Bun Quickstart](https://www.rivet.dev/docs/actors/quickstart/backend)** - Set up Rivet with Node.js, Bun, and web frameworks
+- **[React Quickstart](https://www.rivet.dev/docs/actors/quickstart/react)** - Set up Rivet with React
+- **[Next.js Quickstart](https://www.rivet.dev/docs/actors/quickstart/next-js)** - Set up Rivet with Next.js
+- **[Cloudflare Workers Quickstart](https://www.rivet.dev/docs/actors/quickstart/cloudflare-workers)** - Set up Rivet with Cloudflare Workers
+
+### Rivet Cloud
+
+The fastest way to deploy Rivet is to use [**Rivet Cloud**](https://dashboard.rivet.dev) with [**your cloud of choice**](https://www.rivet.dev/docs/#deploy-options). Rivet Cloud provides multiple edge regions & cloud providers for you.
+
+### Self-Hosting
+
+**You do not need Rivet Engine to get started with Rivet.**
+
+View more options & deployment guides in the [**self-hosting documentation**](https://www.rivet.dev/docs/self-hosting/).
+
+```bash
+# Docker
+docker run -p 6420:6420 rivetkit/engine
+
+# macOS (Apple Silicon)
+curl -o rivet-engine "https://releases.rivet.gg/engine/latest/rivet-engine-aarch64-apple-darwin" && chmod +x rivet-engine && ./rivet-engine start
+
+# macOS (Intel)
+curl -o rivet-engine "https://releases.rivet.gg/engine/latest/rivet-engine-x86_64-apple-darwin" && chmod +x rivet-engine && ./rivet-engine start
+
+# Linux (x86)
+curl -o rivet-engine "https://releases.rivet.gg/engine/latest/rivet-engine-x86_64-unknown-linux-musl" && chmod +x rivet-engine && ./rivet-engine start
+
+# Windows (x86_64)
+```powershell
+curl.exe -o rivet-engine.exe "https://releases.rivet.gg/engine/latest/rivet-engine-x86_64-pc-windows-gnu.exe"
+.\rivet-engine.exe start
+```
+
+## Runs Anywhere
+
+Deploy Rivet Actors anywhere - from serverless platforms to your own infrastructure with Rivet's flexible runtime options. Don't see what you need? [Add your own](https://www.rivet.dev/docs/cloud).
+
+### Storage
+- [Rivet Cloud](https://www.rivet.dev/docs/cloud) *(1-Click Deploy)*
+- [Postgres](https://www.rivet.dev/docs/actors/)
+- [File System](https://www.rivet.dev/docs/actors/quickstart/backend)
+- [Memory](https://www.rivet.dev/docs/actors/quickstart/backend)
+
+### Compute
+- [Node.js](https://www.rivet.dev/docs/actors/quickstart/backend)
+- [Bun](https://www.rivet.dev/docs/actors/quickstart/backend)
+- [Deno](https://github.com/rivet-dev/rivetkit/tree/9a3d850aee45167eadf249fdbae60129bf37e818/examples/deno)
+- [Vercel](https://www.rivet.dev/docs/deploy/vercel) *(1-Click Deploy)*
+- [Railway](https://railway.com/deploy/rivet) *(1-Click Deploy)*
+- [Durable Objects](https://www.rivet.dev/docs/actors/quickstart/backend)
+- [Kubernetes](https://www.rivet.dev/docs/deploy/kubernetes)
+- [AWS ECS](https://www.rivet.dev/docs/deploy/aws-ecs)
+- [Google Cloud Run](https://www.rivet.dev/docs/deploy/gcp-cloud-run)
+- [Hetzner](https://www.rivet.dev/docs/deploy/hetzner)
+- [VM & Bare Metal](https://www.rivet.dev/docs/deploy/vm-and-bare-metal)
+- [AWS Lambda](https://www.rivet.dev/docs/deploy/aws-lambda) *(On The Roadmap)*
+- [Supabase](https://www.rivet.dev/docs/deploy/supabase) *(On The Roadmap)*
+- [Freestyle](https://www.rivet.dev/docs/deploy/freestyle) *(On The Roadmap)*
+
+## Works With Your Tools
+
+Seamlessly integrate Rivet with your favorite frameworks, languages, and tools. Don't see what you need? [Request an integration](https://github.com/rivet-dev/rivetkit/issues/new).
+
+### Frontend & Clients
+- [JavaScript](https://www.rivet.dev/docs/clients/javascript)
+- [TypeScript](https://www.rivet.dev/docs/clients/javascript)
+- [React](https://www.rivet.dev/docs/clients/react)
+- [Rust](https://www.rivet.dev/docs/clients/rust)
+- [Next.js](https://www.rivet.dev/docs/clients/next-js)
+- [Svelte](https://github.com/rivet-dev/rivetkit/pull/1172)
+- [Vue](https://github.com/rivet-dev/rivetkit/issues/903) *(Help Wanted)*
+
+### Backend
+- [Hono](https://www.rivet.dev/docs/integrations/hono)
+- [Express](https://www.rivet.dev/docs/integrations/express)
+- [Elysia](https://www.rivet.dev/docs/integrations/elysia)
+- [tRPC](https://www.rivet.dev/docs/integrations/trpc)
+
+### Auth
+- [Better Auth](https://www.rivet.dev/docs/integrations/better-auth)
+
+### Testing
+- [Vitest](https://www.rivet.dev/docs/integrations/vitest)
+
+### AI
+- [AI SDK](https://github.com/rivet-dev/rivetkit/tree/9a3d850aee45167eadf249fdbae60129bf37e818/examples/ai-agent) *(On The Roadmap)*
+
+### Sync
+- [LiveStore](https://github.com/rivet-dev/rivetkit/issues/908) *(On The Roadmap)*
+- [ZeroSync](https://github.com/rivet-dev/rivetkit/issues/909) *(Help Wanted)*
+- [TinyBase](https://github.com/rivet-dev/rivetkit/issues/910) *(Help Wanted)*
+- [Yjs](https://github.com/rivet-dev/rivetkit/tree/9a3d850aee45167eadf249fdbae60129bf37e818/examples/crdt) *(Help Wanted)*
+
+## Built-In Observability at Scale
+
+Debug and monitor your Rivet applications with powerful built-in tools:
+
+- **Live State Inspection**: View and edit your actor state in real-time
+- **Event Monitoring**: Track all events and messages in your system
+- **REPL**: Debug your actors interactively
+- **Connection Inspection**: Monitor active connections and their state
+
+## Community & Support
+
+Join thousands of developers building with Rivet Actors today:
+
+- [Discord](https://rivet.dev/discord) - Chat with the community
+- [X/Twitter](https://x.com/rivet_dev) - Follow for updates
+- [Bluesky](https://bsky.app/profile/www.rivet.dev) - Follow for updates
+- [GitHub Discussions](https://github.com/www.rivet.dev/rivet/discussions) - Ask questions and share ideas
+- [GitHub Issues](https://github.com/www.rivet.dev/rivet/issues) - Report bugs and request features
+- [Talk to an engineer](https://www.rivet.dev/talk-to-an-engineer) - Discuss your technical needs, current stack, and how Rivet can help with your infrastructure challenges
+
+## License
+
+[Apache 2.0](LICENSE)
+
diff --git a/biome.json b/biome.json
index f5477ba2ae..223d2e68d9 100644
--- a/biome.json
+++ b/biome.json
@@ -1,32 +1,43 @@
{
- "$schema": "https://biomejs.dev/schemas/2.1.1/schema.json",
- "files": {
- "includes": ["**/*.json", "**/*.ts", "**/*.tsx", "**/*.js", "!examples/snippets/**"],
- "ignoreUnknown": true
- },
- "vcs": {
- "enabled": true,
- "clientKind": "git",
- "useIgnoreFile": true,
- "defaultBranch": "main"
- },
- "formatter": {
- "enabled": true,
- "useEditorconfig": true
- },
- "linter": {
- "enabled": true,
- "rules": {
- "recommended": true,
- "style": {
- "noUselessElse": "off"
- },
- "correctness": {
- "noUnusedImports": "warn"
- },
- "suspicious": {
- "noExplicitAny": "off"
- }
- }
- }
+ "$schema": "https://biomejs.dev/schemas/2.1.1/schema.json",
+ "files": {
+ "includes": [
+ "**/*.json",
+ "**/*.ts",
+ "**/*.js",
+ "!examples/snippets",
+ "!rivetkit-openapi/openapi.json",
+ "!packages/engine/artifacts",
+ "!website",
+ "!scripts",
+ "!frontend",
+ "!engine/sdks"
+ ],
+ "ignoreUnknown": true
+ },
+ "vcs": {
+ "enabled": true,
+ "clientKind": "git",
+ "useIgnoreFile": true,
+ "defaultBranch": "main"
+ },
+ "formatter": {
+ "enabled": true,
+ "useEditorconfig": true
+ },
+ "linter": {
+ "enabled": true,
+ "rules": {
+ "recommended": true,
+ "style": {
+ "noUselessElse": "off"
+ },
+ "correctness": {
+ "noUnusedImports": "warn"
+ },
+ "suspicious": {
+ "noExplicitAny": "off"
+ }
+ }
+ }
}
diff --git a/engine/README.md b/engine/README.md
deleted file mode 100644
index 403e0779ba..0000000000
--- a/engine/README.md
+++ /dev/null
@@ -1,121 +0,0 @@
-
-
-
-
-## Projects
-
-Public-facing projects:
-
-- **Rivet Engine** (you are here): Engine that powers RivetKit at scale
-- **[RivetKit](https://github.com/rivet-dev/rivetkit)**: Lightweight TypeScript library for building Rivet Actors — works with Redis or Rivet Engine
-- **[Rivet Inspector](/frontend/apps/studio)**: Like Postman, but for Rivet Actors
-- **[Rivet Hub](/frontend/apps/hub)**: UI for Rivet Engine
-- **[Rivet Documentation](/site/src/content/docs)**
-
-Projects powering Rivet Engine:
-
-- **[Pegboard](packages/services/pegboard/)**: Actor orchestrator
-- **[Guard](packages/core/guard/)**: Proxy for routing traffic to Rivet Actors
-- **[Gasoline](packages/common/gasoline/)**: Core durable execution engine that powers Rivet
-
-## Get Started
-
-Get started with Rivet by following a quickstart guide:
-
-- [Node.js & Bun](https://www.rivet.gg/docs/actors/quickstart/backend/)
-- [React](https://www.rivet.gg/docs/actors/quickstart/react/)
-
-
-## Features
-
-Rivet Actors, a primitive of RivetKit, provide everything you need to build fast, scalable, and real-time applications without the complexity. Rivet Engine is the core of self-hosting and is used for orchestrating actors at scale.
-
-- **Long-Lived, Stateful Compute**: Like AWS Lambda but with memory and no timeouts
-- **Blazing-Fast Reads & Writes**: State stored on same machine as compute
-- **Realtime, Made Simple**: Built-in WebSockets and SSE support
-- **Store Data Near Your Users**: Deploy to the edge for low-latency access
-- **Infinitely Scalable**: Auto-scale from zero to millions without configuration
-- **Fault Tolerant**: Automatic error handling and recovery built-in
-
-## BYO DB (Bring Your Own Database)
-The Rivet Engine supports:
-
-- **PostgreSQL**: For production deployments
-- **FoundationDB**: For enterprise-scale distributed systems
-- **Filesystem**: For single-node deployments
-
-## Examples
-
-- AI Agent — [GitHub](https://github.com/rivet-dev/rivetkit/tree/main/examples/ai-agent) · [StackBlitz](https://stackblitz.com/github/rivet-dev/rivetkit/tree/main/examples/ai-agent)
-- Realtime Docs — [GitHub](https://github.com/rivet-dev/rivetkit/tree/main/examples/crdt) · [StackBlitz](https://stackblitz.com/github/rivet-dev/rivetkit/tree/main/examples/crdt)
-- Workflows — [GitHub](https://github.com/rivet-dev/rivetkit/tree/main/examples/workflows) · [StackBlitz](https://stackblitz.com/github/rivet-dev/rivetkit/tree/main/examples/workflows)
-- Local-First Sync — [GitHub](https://github.com/rivet-dev/rivetkit/tree/main/examples/sync) · [StackBlitz](https://stackblitz.com/github/rivet-dev/rivetkit/tree/main/examples/sync)
-- Per-User Database — [GitHub](https://github.com/rivet-dev/rivetkit/tree/main/examples/database) · [StackBlitz](https://stackblitz.com/github/rivet-dev/rivetkit/tree/main/examples/database)
-- Background Jobs — [GitHub](https://github.com/rivet-dev/rivetkit/tree/main/examples/background-jobs) · [StackBlitz](https://stackblitz.com/github/rivet-dev/rivetkit/tree/main/examples/background-jobs)
-- Rate Limiting — [GitHub](https://github.com/rivet-dev/rivetkit/tree/main/examples/rate) · [StackBlitz](https://stackblitz.com/github/rivet-dev/rivetkit/tree/main/examples/rate)
-- Multiplayer Game — [GitHub](https://github.com/rivet-dev/rivetkit/tree/main/examples/game) · [StackBlitz](https://stackblitz.com/github/rivet-dev/rivetkit/tree/main/examples/game)
-- Bots — [GitHub](https://github.com/rivet-dev/rivetkit/tree/main/examples/bots) · [StackBlitz](https://stackblitz.com/github/rivet-dev/rivetkit/tree/main/examples/bots)
-
-## Running Rivet
-
-The ability to self-host Rivet Engine is currently currently a work in progress.
-
-Please see the self-hosting guide for [RivetKit](https://www.rivet.gg/docs/general/self-hosting/).
-
-For enterprise use cases, [get in touch](https://rivet.gg/sales) about using Rivet Cloud or self-hosting.
-
-## Community & Support
-
-Join thousands of developers building with Rivet Actors today:
-
-- [Discord](https://rivet.dev/discord) - Chat with the community
-- [X/Twitter](https://x.com/rivet_dev) - Follow for updates
-- [Bluesky](https://bsky.app/profile/rivet.gg) - Follow for updates
-- [GitHub Discussions](https://github.com/rivet-dev/rivetkit/discussions) - Ask questions and share ideas
-- [GitHub Issues](https://github.com/rivet-dev/rivetkit/issues) - Report bugs and request features
-- [Talk to an engineer](https://rivet.dev/talk-to-an-engineer) - Discuss your technical needs, current stack, and how Rivet can help with your infrastructure challenges
-
-## Technologies
-
-- **Rust**
-- **FoundationDB**: State
-- **NATS**: Pub/sub
-- **Valkey**: Caching
-- **ClickHouse**: Monitoring
-
-## License
-
-[Apache 2.0](LICENSE)
-
diff --git a/engine/artifacts/errors/actor.destroyed_during_creation.json b/engine/artifacts/errors/actor.destroyed_during_creation.json
index 98698dc1dd..c0f3e4b5e6 100644
--- a/engine/artifacts/errors/actor.destroyed_during_creation.json
+++ b/engine/artifacts/errors/actor.destroyed_during_creation.json
@@ -1,5 +1,5 @@
{
- "code": "destroyed_during_creation",
- "group": "actor",
- "message": "Actor was destroyed during creation."
-}
\ No newline at end of file
+ "code": "destroyed_during_creation",
+ "group": "actor",
+ "message": "Actor was destroyed during creation."
+}
diff --git a/engine/artifacts/errors/actor.destroyed_while_waiting_for_ready.json b/engine/artifacts/errors/actor.destroyed_while_waiting_for_ready.json
index 4b02eb7563..63f2819139 100644
--- a/engine/artifacts/errors/actor.destroyed_while_waiting_for_ready.json
+++ b/engine/artifacts/errors/actor.destroyed_while_waiting_for_ready.json
@@ -1,5 +1,5 @@
{
- "code": "destroyed_while_waiting_for_ready",
- "group": "actor",
- "message": "Actor was destroyed while waiting for ready state."
-}
\ No newline at end of file
+ "code": "destroyed_while_waiting_for_ready",
+ "group": "actor",
+ "message": "Actor was destroyed while waiting for ready state."
+}
diff --git a/engine/artifacts/errors/actor.duplicate_key.json b/engine/artifacts/errors/actor.duplicate_key.json
index 9d7ce9712a..9281991ff7 100644
--- a/engine/artifacts/errors/actor.duplicate_key.json
+++ b/engine/artifacts/errors/actor.duplicate_key.json
@@ -1,5 +1,5 @@
{
- "code": "duplicate_key",
- "group": "actor",
- "message": "Actor key already in use."
-}
\ No newline at end of file
+ "code": "duplicate_key",
+ "group": "actor",
+ "message": "Actor key already in use."
+}
diff --git a/engine/artifacts/errors/actor.empty_key.json b/engine/artifacts/errors/actor.empty_key.json
index 6edb3e6cf5..693e98ed84 100644
--- a/engine/artifacts/errors/actor.empty_key.json
+++ b/engine/artifacts/errors/actor.empty_key.json
@@ -1,5 +1,5 @@
{
- "code": "empty_key",
- "group": "actor",
- "message": "Key label cannot be empty."
-}
\ No newline at end of file
+ "code": "empty_key",
+ "group": "actor",
+ "message": "Key label cannot be empty."
+}
diff --git a/engine/artifacts/errors/actor.input_too_large.json b/engine/artifacts/errors/actor.input_too_large.json
index 1876b42f6b..928db1010a 100644
--- a/engine/artifacts/errors/actor.input_too_large.json
+++ b/engine/artifacts/errors/actor.input_too_large.json
@@ -1,5 +1,5 @@
{
- "code": "input_too_large",
- "group": "actor",
- "message": "Actor input too large."
-}
\ No newline at end of file
+ "code": "input_too_large",
+ "group": "actor",
+ "message": "Actor input too large."
+}
diff --git a/engine/artifacts/errors/actor.key_reserved_in_different_datacenter.json b/engine/artifacts/errors/actor.key_reserved_in_different_datacenter.json
index bfe0d04ae7..bb318ae000 100644
--- a/engine/artifacts/errors/actor.key_reserved_in_different_datacenter.json
+++ b/engine/artifacts/errors/actor.key_reserved_in_different_datacenter.json
@@ -1,5 +1,5 @@
{
- "code": "key_reserved_in_different_datacenter",
- "group": "actor",
- "message": "Actor key is already reserved in a different datacenter. Either remove the datacenter constraint to automatically create this actor in the correct datacenter or provide the datacenter that matches."
-}
\ No newline at end of file
+ "code": "key_reserved_in_different_datacenter",
+ "group": "actor",
+ "message": "Actor key is already reserved in a different datacenter. Either remove the datacenter constraint to automatically create this actor in the correct datacenter or provide the datacenter that matches."
+}
diff --git a/engine/artifacts/errors/actor.key_too_large.json b/engine/artifacts/errors/actor.key_too_large.json
index 509a50a4c5..02054c9408 100644
--- a/engine/artifacts/errors/actor.key_too_large.json
+++ b/engine/artifacts/errors/actor.key_too_large.json
@@ -1,5 +1,5 @@
{
- "code": "key_too_large",
- "group": "actor",
- "message": "Key label too large."
-}
\ No newline at end of file
+ "code": "key_too_large",
+ "group": "actor",
+ "message": "Key label too large."
+}
diff --git a/engine/artifacts/errors/actor.namespace_not_found.json b/engine/artifacts/errors/actor.namespace_not_found.json
index 59ee6fe624..6f27e1edda 100644
--- a/engine/artifacts/errors/actor.namespace_not_found.json
+++ b/engine/artifacts/errors/actor.namespace_not_found.json
@@ -1,5 +1,5 @@
{
- "code": "namespace_not_found",
- "group": "actor",
- "message": "The namespace does not exist."
-}
\ No newline at end of file
+ "code": "namespace_not_found",
+ "group": "actor",
+ "message": "The namespace does not exist."
+}
diff --git a/engine/artifacts/errors/actor.no_runners_available.json b/engine/artifacts/errors/actor.no_runners_available.json
index b187a48345..02e729ba6b 100644
--- a/engine/artifacts/errors/actor.no_runners_available.json
+++ b/engine/artifacts/errors/actor.no_runners_available.json
@@ -1,5 +1,5 @@
{
- "code": "no_runners_available",
- "group": "actor",
- "message": "No runners are available in any datacenter. Validate the runner is listed in the Connect tab and that the runner's name matches the requested runner name."
-}
\ No newline at end of file
+ "code": "no_runners_available",
+ "group": "actor",
+ "message": "No runners are available in any datacenter. Validate the runner is listed in the Connect tab and that the runner's name matches the requested runner name."
+}
diff --git a/engine/artifacts/errors/actor.not_found.json b/engine/artifacts/errors/actor.not_found.json
index 55638bf7ce..c9836975b2 100644
--- a/engine/artifacts/errors/actor.not_found.json
+++ b/engine/artifacts/errors/actor.not_found.json
@@ -1,5 +1,5 @@
{
- "code": "not_found",
- "group": "actor",
- "message": "The actor does not exist."
-}
\ No newline at end of file
+ "code": "not_found",
+ "group": "actor",
+ "message": "The actor does not exist."
+}
diff --git a/engine/artifacts/errors/api.bad_request.json b/engine/artifacts/errors/api.bad_request.json
index 54871df310..28ceda7835 100644
--- a/engine/artifacts/errors/api.bad_request.json
+++ b/engine/artifacts/errors/api.bad_request.json
@@ -1,5 +1,5 @@
{
- "code": "bad_request",
- "group": "api",
- "message": "Request is invalid"
-}
\ No newline at end of file
+ "code": "bad_request",
+ "group": "api",
+ "message": "Request is invalid"
+}
diff --git a/engine/artifacts/errors/api.forbidden.json b/engine/artifacts/errors/api.forbidden.json
index d86125b508..7ff4c816cd 100644
--- a/engine/artifacts/errors/api.forbidden.json
+++ b/engine/artifacts/errors/api.forbidden.json
@@ -1,5 +1,5 @@
{
- "code": "forbidden",
- "group": "api",
- "message": "Access denied"
-}
\ No newline at end of file
+ "code": "forbidden",
+ "group": "api",
+ "message": "Access denied"
+}
diff --git a/engine/artifacts/errors/api.internal_error.json b/engine/artifacts/errors/api.internal_error.json
index 2bb3d5c81f..4bb66ca0a2 100644
--- a/engine/artifacts/errors/api.internal_error.json
+++ b/engine/artifacts/errors/api.internal_error.json
@@ -1,5 +1,5 @@
{
- "code": "internal_error",
- "group": "api",
- "message": "An internal server error occurred"
-}
\ No newline at end of file
+ "code": "internal_error",
+ "group": "api",
+ "message": "An internal server error occurred"
+}
diff --git a/engine/artifacts/errors/api.not_found.json b/engine/artifacts/errors/api.not_found.json
index 97d7cace0e..1f9536b99a 100644
--- a/engine/artifacts/errors/api.not_found.json
+++ b/engine/artifacts/errors/api.not_found.json
@@ -1,5 +1,5 @@
{
- "code": "not_found",
- "group": "api",
- "message": "The requested resource was not found"
-}
\ No newline at end of file
+ "code": "not_found",
+ "group": "api",
+ "message": "The requested resource was not found"
+}
diff --git a/engine/artifacts/errors/api.rate_limited.json b/engine/artifacts/errors/api.rate_limited.json
index 4f42c1974d..ddbe2878e0 100644
--- a/engine/artifacts/errors/api.rate_limited.json
+++ b/engine/artifacts/errors/api.rate_limited.json
@@ -1,5 +1,5 @@
{
- "code": "rate_limited",
- "group": "api",
- "message": "\n\tRate limit exceeded.\n\t\n\tThe API rate limit has been exceeded for this endpoint.\n\tPlease wait before making additional requests.\n\t"
-}
\ No newline at end of file
+ "code": "rate_limited",
+ "group": "api",
+ "message": "\n\tRate limit exceeded.\n\t\n\tThe API rate limit has been exceeded for this endpoint.\n\tPlease wait before making additional requests.\n\t"
+}
diff --git a/engine/artifacts/errors/api.unauthorized.json b/engine/artifacts/errors/api.unauthorized.json
index d7e369b02d..2f2762cb90 100644
--- a/engine/artifacts/errors/api.unauthorized.json
+++ b/engine/artifacts/errors/api.unauthorized.json
@@ -1,5 +1,5 @@
{
- "code": "unauthorized",
- "group": "api",
- "message": "Authentication required"
-}
\ No newline at end of file
+ "code": "unauthorized",
+ "group": "api",
+ "message": "Authentication required"
+}
diff --git a/engine/artifacts/errors/datacenter.not_found.json b/engine/artifacts/errors/datacenter.not_found.json
index 560840477a..086ea33eda 100644
--- a/engine/artifacts/errors/datacenter.not_found.json
+++ b/engine/artifacts/errors/datacenter.not_found.json
@@ -1,5 +1,5 @@
{
- "code": "not_found",
- "group": "datacenter",
- "message": "The provided datacenter does not exist."
-}
\ No newline at end of file
+ "code": "not_found",
+ "group": "datacenter",
+ "message": "The provided datacenter does not exist."
+}
diff --git a/engine/artifacts/errors/guard.actor_destroyed.json b/engine/artifacts/errors/guard.actor_destroyed.json
index d940d8cd6d..f91e2924a3 100644
--- a/engine/artifacts/errors/guard.actor_destroyed.json
+++ b/engine/artifacts/errors/guard.actor_destroyed.json
@@ -1,5 +1,5 @@
{
- "code": "actor_destroyed",
- "group": "guard",
- "message": "Actor destroyed."
-}
\ No newline at end of file
+ "code": "actor_destroyed",
+ "group": "guard",
+ "message": "Actor destroyed."
+}
diff --git a/engine/artifacts/errors/guard.actor_not_found.json b/engine/artifacts/errors/guard.actor_not_found.json
index 987d6e6727..191e35ec23 100644
--- a/engine/artifacts/errors/guard.actor_not_found.json
+++ b/engine/artifacts/errors/guard.actor_not_found.json
@@ -1,5 +1,5 @@
{
- "code": "actor_not_found",
- "group": "guard",
- "message": "Actor not found."
-}
\ No newline at end of file
+ "code": "actor_not_found",
+ "group": "guard",
+ "message": "Actor not found."
+}
diff --git a/engine/artifacts/errors/guard.actor_ready_timeout.json b/engine/artifacts/errors/guard.actor_ready_timeout.json
index 7d681c122f..4389c39fb1 100644
--- a/engine/artifacts/errors/guard.actor_ready_timeout.json
+++ b/engine/artifacts/errors/guard.actor_ready_timeout.json
@@ -1,5 +1,5 @@
{
- "code": "actor_ready_timeout",
- "group": "guard",
- "message": "Timed out waiting for actor to become ready. Ensure that the runner name selector is accurate and there are runners available in the namespace you created this actor."
-}
\ No newline at end of file
+ "code": "actor_ready_timeout",
+ "group": "guard",
+ "message": "Timed out waiting for actor to become ready. Ensure that the runner name selector is accurate and there are runners available in the namespace you created this actor."
+}
diff --git a/engine/artifacts/errors/guard.connection_error.json b/engine/artifacts/errors/guard.connection_error.json
index 45ce611a72..e2ff2008b3 100644
--- a/engine/artifacts/errors/guard.connection_error.json
+++ b/engine/artifacts/errors/guard.connection_error.json
@@ -1,5 +1,5 @@
{
- "code": "connection_error",
- "group": "guard",
- "message": "Connection error: {error_message}."
-}
\ No newline at end of file
+ "code": "connection_error",
+ "group": "guard",
+ "message": "Connection error: {error_message}."
+}
diff --git a/engine/artifacts/errors/guard.http_request_build_failed.json b/engine/artifacts/errors/guard.http_request_build_failed.json
index ed047583fe..d7540a4e4f 100644
--- a/engine/artifacts/errors/guard.http_request_build_failed.json
+++ b/engine/artifacts/errors/guard.http_request_build_failed.json
@@ -1,5 +1,5 @@
{
- "code": "http_request_build_failed",
- "group": "guard",
- "message": "Failed to build HTTP request."
-}
\ No newline at end of file
+ "code": "http_request_build_failed",
+ "group": "guard",
+ "message": "Failed to build HTTP request."
+}
diff --git a/engine/artifacts/errors/guard.missing_header.json b/engine/artifacts/errors/guard.missing_header.json
index 48205a3508..c401e6c942 100644
--- a/engine/artifacts/errors/guard.missing_header.json
+++ b/engine/artifacts/errors/guard.missing_header.json
@@ -1,5 +1,5 @@
{
- "code": "missing_header",
- "group": "guard",
- "message": "Missing header required for routing."
-}
\ No newline at end of file
+ "code": "missing_header",
+ "group": "guard",
+ "message": "Missing header required for routing."
+}
diff --git a/engine/artifacts/errors/guard.must_use_regional_host.json b/engine/artifacts/errors/guard.must_use_regional_host.json
index 79c579751a..001dccb298 100644
--- a/engine/artifacts/errors/guard.must_use_regional_host.json
+++ b/engine/artifacts/errors/guard.must_use_regional_host.json
@@ -1,5 +1,5 @@
{
- "code": "must_use_regional_host",
- "group": "guard",
- "message": "Request must use a regional URL for this datacenter."
-}
\ No newline at end of file
+ "code": "must_use_regional_host",
+ "group": "guard",
+ "message": "Request must use a regional URL for this datacenter."
+}
diff --git a/engine/artifacts/errors/guard.no_route.json b/engine/artifacts/errors/guard.no_route.json
index 49cc2e080f..2d9fb594e7 100644
--- a/engine/artifacts/errors/guard.no_route.json
+++ b/engine/artifacts/errors/guard.no_route.json
@@ -1,5 +1,5 @@
{
- "code": "no_route",
- "group": "guard",
- "message": "No route found."
-}
\ No newline at end of file
+ "code": "no_route",
+ "group": "guard",
+ "message": "No route found."
+}
diff --git a/engine/artifacts/errors/guard.no_route_targets.json b/engine/artifacts/errors/guard.no_route_targets.json
index acc4e3c344..9d7f452940 100644
--- a/engine/artifacts/errors/guard.no_route_targets.json
+++ b/engine/artifacts/errors/guard.no_route_targets.json
@@ -1,5 +1,5 @@
{
- "code": "no_route_targets",
- "group": "guard",
- "message": "No targets found."
-}
\ No newline at end of file
+ "code": "no_route_targets",
+ "group": "guard",
+ "message": "No targets found."
+}
diff --git a/engine/artifacts/errors/guard.rate_limit.json b/engine/artifacts/errors/guard.rate_limit.json
index 6318454ba8..98242ee900 100644
--- a/engine/artifacts/errors/guard.rate_limit.json
+++ b/engine/artifacts/errors/guard.rate_limit.json
@@ -1,5 +1,5 @@
{
- "code": "rate_limit",
- "group": "guard",
- "message": "Too many requests. Try again later."
-}
\ No newline at end of file
+ "code": "rate_limit",
+ "group": "guard",
+ "message": "Too many requests. Try again later."
+}
diff --git a/engine/artifacts/errors/guard.request_build_error.json b/engine/artifacts/errors/guard.request_build_error.json
index bc5ad0d3ad..3f739ec260 100644
--- a/engine/artifacts/errors/guard.request_build_error.json
+++ b/engine/artifacts/errors/guard.request_build_error.json
@@ -1,5 +1,5 @@
{
- "code": "request_build_error",
- "group": "guard",
- "message": "Request build error."
-}
\ No newline at end of file
+ "code": "request_build_error",
+ "group": "guard",
+ "message": "Request build error."
+}
diff --git a/engine/artifacts/errors/guard.request_timeout.json b/engine/artifacts/errors/guard.request_timeout.json
index 3e73593c5c..49a12b6ac3 100644
--- a/engine/artifacts/errors/guard.request_timeout.json
+++ b/engine/artifacts/errors/guard.request_timeout.json
@@ -1,5 +1,5 @@
{
- "code": "request_timeout",
- "group": "guard",
- "message": "Request timed out."
-}
\ No newline at end of file
+ "code": "request_timeout",
+ "group": "guard",
+ "message": "Request timed out."
+}
diff --git a/engine/artifacts/errors/guard.retry_attempts_exceeded.json b/engine/artifacts/errors/guard.retry_attempts_exceeded.json
index 725e2adfb9..0f3187d493 100644
--- a/engine/artifacts/errors/guard.retry_attempts_exceeded.json
+++ b/engine/artifacts/errors/guard.retry_attempts_exceeded.json
@@ -1,5 +1,5 @@
{
- "code": "retry_attempts_exceeded",
- "group": "guard",
- "message": "Retry attempts exceeded."
-}
\ No newline at end of file
+ "code": "retry_attempts_exceeded",
+ "group": "guard",
+ "message": "Retry attempts exceeded."
+}
diff --git a/engine/artifacts/errors/guard.service_unavailable.json b/engine/artifacts/errors/guard.service_unavailable.json
index a81e6312c6..c8c51d4346 100644
--- a/engine/artifacts/errors/guard.service_unavailable.json
+++ b/engine/artifacts/errors/guard.service_unavailable.json
@@ -1,5 +1,5 @@
{
- "code": "service_unavailable",
- "group": "guard",
- "message": "Service unavailable."
-}
\ No newline at end of file
+ "code": "service_unavailable",
+ "group": "guard",
+ "message": "Service unavailable."
+}
diff --git a/engine/artifacts/errors/guard.target_changed.json b/engine/artifacts/errors/guard.target_changed.json
index e3751cbd53..10f75679db 100644
--- a/engine/artifacts/errors/guard.target_changed.json
+++ b/engine/artifacts/errors/guard.target_changed.json
@@ -1,5 +1,5 @@
{
- "code": "target_changed",
- "group": "guard",
- "message": "WebSocket target changed, retry not possible."
-}
\ No newline at end of file
+ "code": "target_changed",
+ "group": "guard",
+ "message": "WebSocket target changed, retry not possible."
+}
diff --git a/engine/artifacts/errors/guard.upstream_error.json b/engine/artifacts/errors/guard.upstream_error.json
index bf80881d44..188c387c27 100644
--- a/engine/artifacts/errors/guard.upstream_error.json
+++ b/engine/artifacts/errors/guard.upstream_error.json
@@ -1,5 +1,5 @@
{
- "code": "upstream_error",
- "group": "guard",
- "message": "Upstream error."
-}
\ No newline at end of file
+ "code": "upstream_error",
+ "group": "guard",
+ "message": "Upstream error."
+}
diff --git a/engine/artifacts/errors/guard.uri_parse_error.json b/engine/artifacts/errors/guard.uri_parse_error.json
index f5cfe97509..7ff35bb1c8 100644
--- a/engine/artifacts/errors/guard.uri_parse_error.json
+++ b/engine/artifacts/errors/guard.uri_parse_error.json
@@ -1,5 +1,5 @@
{
- "code": "uri_parse_error",
- "group": "guard",
- "message": "URI parse error."
-}
\ No newline at end of file
+ "code": "uri_parse_error",
+ "group": "guard",
+ "message": "URI parse error."
+}
diff --git a/engine/artifacts/errors/guard.websocket_service_unavailable.json b/engine/artifacts/errors/guard.websocket_service_unavailable.json
index 7ab876c2a7..745bf6e51f 100644
--- a/engine/artifacts/errors/guard.websocket_service_unavailable.json
+++ b/engine/artifacts/errors/guard.websocket_service_unavailable.json
@@ -1,5 +1,5 @@
{
- "code": "websocket_service_unavailable",
- "group": "guard",
- "message": "WebSocket service unavailable."
-}
\ No newline at end of file
+ "code": "websocket_service_unavailable",
+ "group": "guard",
+ "message": "WebSocket service unavailable."
+}
diff --git a/engine/artifacts/errors/guard.wrong_addr_protocol.json b/engine/artifacts/errors/guard.wrong_addr_protocol.json
index c82f8d886c..e29177a17c 100644
--- a/engine/artifacts/errors/guard.wrong_addr_protocol.json
+++ b/engine/artifacts/errors/guard.wrong_addr_protocol.json
@@ -1,5 +1,5 @@
{
- "code": "wrong_addr_protocol",
- "group": "guard",
- "message": "Attempted to access a address using the wrong protocol."
-}
\ No newline at end of file
+ "code": "wrong_addr_protocol",
+ "group": "guard",
+ "message": "Attempted to access a address using the wrong protocol."
+}
diff --git a/engine/artifacts/errors/kv.leader_forwarding_failed.json b/engine/artifacts/errors/kv.leader_forwarding_failed.json
index 1c72e2127f..7accf07cc9 100644
--- a/engine/artifacts/errors/kv.leader_forwarding_failed.json
+++ b/engine/artifacts/errors/kv.leader_forwarding_failed.json
@@ -1,5 +1,5 @@
{
- "code": "leader_forwarding_failed",
- "group": "kv",
- "message": "Failed to forward request to leader."
-}
\ No newline at end of file
+ "code": "leader_forwarding_failed",
+ "group": "kv",
+ "message": "Failed to forward request to leader."
+}
diff --git a/engine/artifacts/errors/kv.no_leader_elected.json b/engine/artifacts/errors/kv.no_leader_elected.json
index ed4e5ad8b8..eb92dbfcdf 100644
--- a/engine/artifacts/errors/kv.no_leader_elected.json
+++ b/engine/artifacts/errors/kv.no_leader_elected.json
@@ -1,5 +1,5 @@
{
- "code": "no_leader_elected",
- "group": "kv",
- "message": "No leader has been elected yet."
-}
\ No newline at end of file
+ "code": "no_leader_elected",
+ "group": "kv",
+ "message": "No leader has been elected yet."
+}
diff --git a/engine/artifacts/errors/kv.not_leader.json b/engine/artifacts/errors/kv.not_leader.json
index ea061498b4..5b2911bb3f 100644
--- a/engine/artifacts/errors/kv.not_leader.json
+++ b/engine/artifacts/errors/kv.not_leader.json
@@ -1,5 +1,5 @@
{
- "code": "not_leader",
- "group": "kv",
- "message": "Current node is not the leader."
-}
\ No newline at end of file
+ "code": "not_leader",
+ "group": "kv",
+ "message": "Current node is not the leader."
+}
diff --git a/engine/artifacts/errors/kv.response_channel_closed.json b/engine/artifacts/errors/kv.response_channel_closed.json
index 85184515f2..ba363a1de5 100644
--- a/engine/artifacts/errors/kv.response_channel_closed.json
+++ b/engine/artifacts/errors/kv.response_channel_closed.json
@@ -1,5 +1,5 @@
{
- "code": "response_channel_closed",
- "group": "kv",
- "message": "Failed to receive KV response, channel closed."
-}
\ No newline at end of file
+ "code": "response_channel_closed",
+ "group": "kv",
+ "message": "Failed to receive KV response, channel closed."
+}
diff --git a/engine/artifacts/errors/namespace.failed_to_create.json b/engine/artifacts/errors/namespace.failed_to_create.json
index 2df70290a9..4c645b0057 100644
--- a/engine/artifacts/errors/namespace.failed_to_create.json
+++ b/engine/artifacts/errors/namespace.failed_to_create.json
@@ -1,5 +1,5 @@
{
- "code": "failed_to_create",
- "group": "namespace",
- "message": "Failed to create namespace."
-}
\ No newline at end of file
+ "code": "failed_to_create",
+ "group": "namespace",
+ "message": "Failed to create namespace."
+}
diff --git a/engine/artifacts/errors/namespace.invalid_name.json b/engine/artifacts/errors/namespace.invalid_name.json
index 537dba4c8f..c797516a42 100644
--- a/engine/artifacts/errors/namespace.invalid_name.json
+++ b/engine/artifacts/errors/namespace.invalid_name.json
@@ -1,5 +1,5 @@
{
- "code": "invalid_name",
- "group": "namespace",
- "message": "\n\tInvalid namespace name.\n\t\n\tNamespace names must be valid DNS subdomains.\n\t"
-}
\ No newline at end of file
+ "code": "invalid_name",
+ "group": "namespace",
+ "message": "\n\tInvalid namespace name.\n\t\n\tNamespace names must be valid DNS subdomains.\n\t"
+}
diff --git a/engine/artifacts/errors/namespace.invalid_update.json b/engine/artifacts/errors/namespace.invalid_update.json
index 2dda6ea2dc..c947a135b4 100644
--- a/engine/artifacts/errors/namespace.invalid_update.json
+++ b/engine/artifacts/errors/namespace.invalid_update.json
@@ -1,5 +1,5 @@
{
- "code": "invalid_update",
- "group": "namespace",
- "message": "Failed to update namespace."
-}
\ No newline at end of file
+ "code": "invalid_update",
+ "group": "namespace",
+ "message": "Failed to update namespace."
+}
diff --git a/engine/artifacts/errors/namespace.name_not_unique.json b/engine/artifacts/errors/namespace.name_not_unique.json
index 86fc0538d4..b44b1e46af 100644
--- a/engine/artifacts/errors/namespace.name_not_unique.json
+++ b/engine/artifacts/errors/namespace.name_not_unique.json
@@ -1,5 +1,5 @@
{
- "code": "name_not_unique",
- "group": "namespace",
- "message": "Namespace name must be unique."
-}
\ No newline at end of file
+ "code": "name_not_unique",
+ "group": "namespace",
+ "message": "Namespace name must be unique."
+}
diff --git a/engine/artifacts/errors/namespace.not_found.json b/engine/artifacts/errors/namespace.not_found.json
index ebd169835a..91bf856620 100644
--- a/engine/artifacts/errors/namespace.not_found.json
+++ b/engine/artifacts/errors/namespace.not_found.json
@@ -1,5 +1,5 @@
{
- "code": "not_found",
- "group": "namespace",
- "message": "The namespace does not exist."
-}
\ No newline at end of file
+ "code": "not_found",
+ "group": "namespace",
+ "message": "The namespace does not exist."
+}
diff --git a/engine/artifacts/errors/namespace.not_leader.json b/engine/artifacts/errors/namespace.not_leader.json
index 99e8a23b9e..72e9931ee3 100644
--- a/engine/artifacts/errors/namespace.not_leader.json
+++ b/engine/artifacts/errors/namespace.not_leader.json
@@ -1,5 +1,5 @@
{
- "code": "not_leader",
- "group": "namespace",
- "message": "Attempting to run operation in non-leader datacenter."
-}
\ No newline at end of file
+ "code": "not_leader",
+ "group": "namespace",
+ "message": "Attempting to run operation in non-leader datacenter."
+}
diff --git a/engine/artifacts/errors/runner.not_found.json b/engine/artifacts/errors/runner.not_found.json
index 68d5c5d0a6..86d77e6608 100644
--- a/engine/artifacts/errors/runner.not_found.json
+++ b/engine/artifacts/errors/runner.not_found.json
@@ -1,5 +1,5 @@
{
- "code": "not_found",
- "group": "runner",
- "message": "The runner does not exist."
-}
\ No newline at end of file
+ "code": "not_found",
+ "group": "runner",
+ "message": "The runner does not exist."
+}
diff --git a/engine/artifacts/errors/runner_config.invalid.json b/engine/artifacts/errors/runner_config.invalid.json
index 314730a13e..4893338834 100644
--- a/engine/artifacts/errors/runner_config.invalid.json
+++ b/engine/artifacts/errors/runner_config.invalid.json
@@ -1,5 +1,5 @@
{
- "code": "invalid",
- "group": "runner_config",
- "message": "Invalid runner config."
-}
\ No newline at end of file
+ "code": "invalid",
+ "group": "runner_config",
+ "message": "Invalid runner config."
+}
diff --git a/engine/artifacts/errors/runner_config.not_found.json b/engine/artifacts/errors/runner_config.not_found.json
index a78fba06a6..18fbb24872 100644
--- a/engine/artifacts/errors/runner_config.not_found.json
+++ b/engine/artifacts/errors/runner_config.not_found.json
@@ -1,5 +1,5 @@
{
- "code": "not_found",
- "group": "runner_config",
- "message": "No config for this runner exists."
-}
\ No newline at end of file
+ "code": "not_found",
+ "group": "runner_config",
+ "message": "No config for this runner exists."
+}
diff --git a/engine/artifacts/errors/test.input_too_large.json b/engine/artifacts/errors/test.input_too_large.json
index 63f47fcc3a..c173e92ea4 100644
--- a/engine/artifacts/errors/test.input_too_large.json
+++ b/engine/artifacts/errors/test.input_too_large.json
@@ -1,5 +1,5 @@
{
- "code": "input_too_large",
- "group": "test",
- "message": "Input too large."
-}
\ No newline at end of file
+ "code": "input_too_large",
+ "group": "test",
+ "message": "Input too large."
+}
diff --git a/engine/artifacts/errors/test.key_too_large.json b/engine/artifacts/errors/test.key_too_large.json
index d36bf40a1b..26428df670 100644
--- a/engine/artifacts/errors/test.key_too_large.json
+++ b/engine/artifacts/errors/test.key_too_large.json
@@ -1,5 +1,5 @@
{
- "code": "key_too_large",
- "group": "test",
- "message": "Key too large."
-}
\ No newline at end of file
+ "code": "key_too_large",
+ "group": "test",
+ "message": "Key too large."
+}
diff --git a/engine/artifacts/errors/test.meta_error.json b/engine/artifacts/errors/test.meta_error.json
index 5fa944bfae..575f38a76f 100644
--- a/engine/artifacts/errors/test.meta_error.json
+++ b/engine/artifacts/errors/test.meta_error.json
@@ -1,5 +1,5 @@
{
- "code": "meta_error",
- "group": "test",
- "message": "Default message"
-}
\ No newline at end of file
+ "code": "meta_error",
+ "group": "test",
+ "message": "Default message"
+}
diff --git a/engine/artifacts/errors/test.not_found.json b/engine/artifacts/errors/test.not_found.json
index b24f1a7a1d..02c454c27d 100644
--- a/engine/artifacts/errors/test.not_found.json
+++ b/engine/artifacts/errors/test.not_found.json
@@ -1,5 +1,5 @@
{
- "code": "not_found",
- "group": "test",
- "message": "The resource does not exist."
-}
\ No newline at end of file
+ "code": "not_found",
+ "group": "test",
+ "message": "The resource does not exist."
+}
diff --git a/engine/artifacts/errors/test.simple_error.json b/engine/artifacts/errors/test.simple_error.json
index f7c8e635e2..80a6afaed7 100644
--- a/engine/artifacts/errors/test.simple_error.json
+++ b/engine/artifacts/errors/test.simple_error.json
@@ -1,5 +1,5 @@
{
- "code": "simple_error",
- "group": "test",
- "message": "This is a simple test error"
-}
\ No newline at end of file
+ "code": "simple_error",
+ "group": "test",
+ "message": "This is a simple test error"
+}
diff --git a/engine/artifacts/errors/test.test_error.json b/engine/artifacts/errors/test.test_error.json
index 32ae63e73c..33c40e6980 100644
--- a/engine/artifacts/errors/test.test_error.json
+++ b/engine/artifacts/errors/test.test_error.json
@@ -1,5 +1,5 @@
{
- "code": "test_error",
- "group": "test",
- "message": "Test error"
-}
\ No newline at end of file
+ "code": "test_error",
+ "group": "test",
+ "message": "Test error"
+}
diff --git a/engine/artifacts/errors/ups.publish_failed.json b/engine/artifacts/errors/ups.publish_failed.json
index b4c1ac0b42..5aeafab617 100644
--- a/engine/artifacts/errors/ups.publish_failed.json
+++ b/engine/artifacts/errors/ups.publish_failed.json
@@ -1,5 +1,5 @@
{
- "code": "publish_failed",
- "group": "ups",
- "message": "Failed to publish message after retries"
-}
\ No newline at end of file
+ "code": "publish_failed",
+ "group": "ups",
+ "message": "Failed to publish message after retries"
+}
diff --git a/engine/artifacts/errors/ups.request_timeout.json b/engine/artifacts/errors/ups.request_timeout.json
index 76846534f7..7f0c1552e8 100644
--- a/engine/artifacts/errors/ups.request_timeout.json
+++ b/engine/artifacts/errors/ups.request_timeout.json
@@ -1,5 +1,5 @@
{
- "code": "request_timeout",
- "group": "ups",
- "message": "Request timeout."
-}
\ No newline at end of file
+ "code": "request_timeout",
+ "group": "ups",
+ "message": "Request timeout."
+}
diff --git a/engine/artifacts/errors/validation.invalid_input.json b/engine/artifacts/errors/validation.invalid_input.json
index 7102c35a1e..2f44803fad 100644
--- a/engine/artifacts/errors/validation.invalid_input.json
+++ b/engine/artifacts/errors/validation.invalid_input.json
@@ -1,5 +1,5 @@
{
- "code": "invalid_input",
- "group": "validation",
- "message": "Invalid input provided"
-}
\ No newline at end of file
+ "code": "invalid_input",
+ "group": "validation",
+ "message": "Invalid input provided"
+}
diff --git a/engine/artifacts/errors/validation.no_keys.json b/engine/artifacts/errors/validation.no_keys.json
index 79d2845c3f..aae3f977c8 100644
--- a/engine/artifacts/errors/validation.no_keys.json
+++ b/engine/artifacts/errors/validation.no_keys.json
@@ -1,5 +1,5 @@
{
- "code": "no_keys",
- "group": "validation",
- "message": "No keys provided. At least one key is required."
-}
\ No newline at end of file
+ "code": "no_keys",
+ "group": "validation",
+ "message": "No keys provided. At least one key is required."
+}
diff --git a/engine/artifacts/errors/validation.race_condition.json b/engine/artifacts/errors/validation.race_condition.json
index 0f57614b5c..58fef5b459 100644
--- a/engine/artifacts/errors/validation.race_condition.json
+++ b/engine/artifacts/errors/validation.race_condition.json
@@ -1,5 +1,5 @@
{
- "code": "race_condition",
- "group": "validation",
- "message": "Race condition detected"
-}
\ No newline at end of file
+ "code": "race_condition",
+ "group": "validation",
+ "message": "Race condition detected"
+}
diff --git a/engine/artifacts/errors/validation.too_many_actor_ids.json b/engine/artifacts/errors/validation.too_many_actor_ids.json
index 9805dc9c1b..329c2d949c 100644
--- a/engine/artifacts/errors/validation.too_many_actor_ids.json
+++ b/engine/artifacts/errors/validation.too_many_actor_ids.json
@@ -1,5 +1,5 @@
{
- "code": "too_many_actor_ids",
- "group": "validation",
- "message": "Too many actor IDs provided"
-}
\ No newline at end of file
+ "code": "too_many_actor_ids",
+ "group": "validation",
+ "message": "Too many actor IDs provided"
+}
diff --git a/engine/artifacts/errors/ws.connection_closed.json b/engine/artifacts/errors/ws.connection_closed.json
index b51c15f5ba..50fa9ce0b3 100644
--- a/engine/artifacts/errors/ws.connection_closed.json
+++ b/engine/artifacts/errors/ws.connection_closed.json
@@ -1,5 +1,5 @@
{
- "code": "connection_closed",
- "group": "ws",
- "message": "Normal connection close."
-}
\ No newline at end of file
+ "code": "connection_closed",
+ "group": "ws",
+ "message": "Normal connection close."
+}
diff --git a/engine/artifacts/errors/ws.eviction.json b/engine/artifacts/errors/ws.eviction.json
index 3ad0b70ac8..457fc2899b 100644
--- a/engine/artifacts/errors/ws.eviction.json
+++ b/engine/artifacts/errors/ws.eviction.json
@@ -1,5 +1,5 @@
{
- "code": "eviction",
- "group": "ws",
- "message": "The websocket has been evicted and should not attempt to reconnect."
-}
\ No newline at end of file
+ "code": "eviction",
+ "group": "ws",
+ "message": "The websocket has been evicted and should not attempt to reconnect."
+}
diff --git a/engine/artifacts/errors/ws.invalid_initial_packet.json b/engine/artifacts/errors/ws.invalid_initial_packet.json
index 8a6b6bb952..b23a964905 100644
--- a/engine/artifacts/errors/ws.invalid_initial_packet.json
+++ b/engine/artifacts/errors/ws.invalid_initial_packet.json
@@ -1,5 +1,5 @@
{
- "code": "invalid_initial_packet",
- "group": "ws",
- "message": "The websocket could not process the initial packet."
-}
\ No newline at end of file
+ "code": "invalid_initial_packet",
+ "group": "ws",
+ "message": "The websocket could not process the initial packet."
+}
diff --git a/engine/artifacts/errors/ws.invalid_packet.json b/engine/artifacts/errors/ws.invalid_packet.json
index e9b72a94a3..f28078dbd7 100644
--- a/engine/artifacts/errors/ws.invalid_packet.json
+++ b/engine/artifacts/errors/ws.invalid_packet.json
@@ -1,5 +1,5 @@
{
- "code": "invalid_packet",
- "group": "ws",
- "message": "The websocket could not process the given packet."
-}
\ No newline at end of file
+ "code": "invalid_packet",
+ "group": "ws",
+ "message": "The websocket could not process the given packet."
+}
diff --git a/engine/artifacts/errors/ws.invalid_url.json b/engine/artifacts/errors/ws.invalid_url.json
index df138842f6..c92d11a27e 100644
--- a/engine/artifacts/errors/ws.invalid_url.json
+++ b/engine/artifacts/errors/ws.invalid_url.json
@@ -1,5 +1,5 @@
{
- "code": "invalid_url",
- "group": "ws",
- "message": "The connection URL is invalid."
-}
\ No newline at end of file
+ "code": "invalid_url",
+ "group": "ws",
+ "message": "The connection URL is invalid."
+}
diff --git a/engine/artifacts/errors/ws.timed_out_waiting_for_init.json b/engine/artifacts/errors/ws.timed_out_waiting_for_init.json
index 113408e725..db19007829 100644
--- a/engine/artifacts/errors/ws.timed_out_waiting_for_init.json
+++ b/engine/artifacts/errors/ws.timed_out_waiting_for_init.json
@@ -1,5 +1,5 @@
{
- "code": "timed_out_waiting_for_init",
- "group": "ws",
- "message": "Timed out waiting for the init packet to be sent."
-}
\ No newline at end of file
+ "code": "timed_out_waiting_for_init",
+ "group": "ws",
+ "message": "Timed out waiting for the init packet to be sent."
+}
diff --git a/engine/artifacts/openapi.json b/engine/artifacts/openapi.json
index d73b549032..e76e41fab6 100644
--- a/engine/artifacts/openapi.json
+++ b/engine/artifacts/openapi.json
@@ -1,1760 +1,1564 @@
{
- "openapi": "3.1.0",
- "info": {
- "title": "rivet-api-public",
- "description": "",
- "contact": {
- "name": "Rivet Gaming, LLC",
- "email": "developer@rivet.gg"
- },
- "license": {
- "name": "Apache-2.0",
- "identifier": "Apache-2.0"
- },
- "version": "25.8.1"
- },
- "paths": {
- "/actors": {
- "get": {
- "tags": [
- "actors::list"
- ],
- "summary": " ## Datacenter Round Trips",
- "description": " **If key is some & `include_destroyed` is false**\n\n 2 round trips:\n - namespace::ops::resolve_for_name_global\n - GET /actors (multiple DCs based on actor IDs)\n\n\tThis path is optimized because we can read the actor IDs fro the key directly from Epoxy with\n\tstale consistency to determine which datacenter the actor lives in. Under most circumstances,\n\tthis means we don't need to fan out to all datacenters (like normal list does).\n\n\tThe reason `include_destroyed` has to be false is Epoxy only stores currently active actors. If\n\t`include_destroyed` is true, we show all previous iterations of actors with the same key.\n\n **Otherwise**\n\n 2 round trips:\n - namespace::ops::resolve_for_name_global\n - GET /actors (fanout)\n\n ## Optimized Alternative Routes",
- "operationId": "actors_list",
- "parameters": [
- {
- "name": "namespace",
- "in": "query",
- "required": true,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "name",
- "in": "query",
- "required": false,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "key",
- "in": "query",
- "required": false,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "actor_ids",
- "in": "query",
- "required": false,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "include_destroyed",
- "in": "query",
- "required": false,
- "schema": {
- "type": "boolean"
- }
- },
- {
- "name": "limit",
- "in": "query",
- "required": false,
- "schema": {
- "type": "integer",
- "minimum": 0
- }
- },
- {
- "name": "cursor",
- "in": "query",
- "required": false,
- "schema": {
- "type": "string"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ActorsListResponse"
- }
- }
- }
- }
- }
- },
- "put": {
- "tags": [
- "actors::get_or_create"
- ],
- "summary": "## Datacenter Round Trips",
- "description": "**If actor exists**\n\n2 round trips:\n- namespace::ops::resolve_for_name_global\n- GET /actors/{}\n\n**If actor does not exist and is created in the current datacenter:**\n\n2 round trips:\n- namespace::ops::resolve_for_name_global\n- [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation)\n\n**If actor does not exist and is created in a different datacenter:**\n\n3 round trips:\n- namespace::ops::resolve_for_name_global\n- POST /actors to remote datacenter\n- [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation)\n\nactor::get will always be in the same datacenter.\n\n## Optimized Alternative Routes",
- "operationId": "actors_get_or_create",
- "parameters": [
- {
- "name": "namespace",
- "in": "query",
- "required": true,
- "schema": {
- "type": "string"
- }
- }
- ],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ActorsGetOrCreateRequest"
- }
- }
- },
- "required": true
- },
- "responses": {
- "200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ActorsGetOrCreateResponse"
- }
- }
- }
- }
- }
- },
- "post": {
- "tags": [
- "actors::create"
- ],
- "summary": "## Datacenter Round Trips",
- "description": "**If actor is created in the current datacenter:**\n\n2 round trips:\n- namespace::ops::resolve_for_name_global\n- [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation)\n\n**If actor is created in a different datacenter:**\n\n3 round trips:\n- namespace::ops::resolve_for_name_global\n- POST /actors to remote datacenter\n- [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation)\n\nactor::get will always be in the same datacenter.",
- "operationId": "actors_create",
- "parameters": [
- {
- "name": "namespace",
- "in": "query",
- "required": true,
- "schema": {
- "type": "string"
- }
- }
- ],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ActorsCreateRequest"
- }
- }
- },
- "required": true
- },
- "responses": {
- "200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ActorsCreateResponse"
- }
- }
- }
- }
- }
- }
- },
- "/actors/names": {
- "get": {
- "tags": [
- "actors::list_names"
- ],
- "summary": "## Datacenter Round Trips",
- "description": "2 round trips:\n- GET /actors/names (fanout)\n- [api-peer] namespace::ops::resolve_for_name_global",
- "operationId": "actors_list_names",
- "parameters": [
- {
- "name": "namespace",
- "in": "query",
- "required": true,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "limit",
- "in": "query",
- "required": false,
- "schema": {
- "type": "integer",
- "minimum": 0
- }
- },
- {
- "name": "cursor",
- "in": "query",
- "required": false,
- "schema": {
- "type": "string"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ActorsListNamesResponse"
- }
- }
- }
- }
- },
- "security": [
- {
- "bearer_auth": []
- }
- ]
- }
- },
- "/actors/{actor_id}": {
- "delete": {
- "tags": [
- "actors::delete"
- ],
- "summary": "## Datacenter Round Trips",
- "description": "2 round trip:\n- DELETE /actors/{}\n- [api-peer] namespace::ops::resolve_for_name_global",
- "operationId": "actors_delete",
- "parameters": [
- {
- "name": "actor_id",
- "in": "path",
- "required": true,
- "schema": {
- "$ref": "#/components/schemas/RivetId"
- }
- },
- {
- "name": "namespace",
- "in": "query",
- "required": false,
- "schema": {
- "type": "string"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ActorsDeleteResponse"
- }
- }
- }
- }
- },
- "security": [
- {
- "bearer_auth": []
- }
- ]
- }
- },
- "/datacenters": {
- "get": {
- "tags": [
- "datacenters"
- ],
- "operationId": "datacenters_list",
- "responses": {
- "200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/DatacentersListResponse"
- }
- }
- }
- }
- },
- "security": [
- {
- "bearer_auth": []
- }
- ]
- }
- },
- "/health/fanout": {
- "get": {
- "tags": [
- "health"
- ],
- "operationId": "health_fanout",
- "responses": {
- "200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HealthFanoutResponse"
- }
- }
- }
- }
- },
- "security": [
- {
- "bearer_auth": []
- }
- ]
- }
- },
- "/namespaces": {
- "get": {
- "tags": [
- "namespaces"
- ],
- "operationId": "namespaces_list",
- "parameters": [
- {
- "name": "limit",
- "in": "query",
- "required": false,
- "schema": {
- "type": "integer",
- "minimum": 0
- }
- },
- {
- "name": "cursor",
- "in": "query",
- "required": false,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "name",
- "in": "query",
- "required": false,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "namespace_ids",
- "in": "query",
- "required": false,
- "schema": {
- "type": "string"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/NamespaceListResponse"
- }
- }
- }
- }
- },
- "security": [
- {
- "bearer_auth": []
- }
- ]
- },
- "post": {
- "tags": [
- "namespaces"
- ],
- "operationId": "namespaces_create",
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/NamespacesCreateRequest"
- }
- }
- },
- "required": true
- },
- "responses": {
- "200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/NamespacesCreateResponse"
- }
- }
- }
- }
- },
- "security": [
- {
- "bearer_auth": []
- }
- ]
- }
- },
- "/runner-configs": {
- "get": {
- "tags": [
- "runner_configs::list"
- ],
- "operationId": "runner_configs_list",
- "parameters": [
- {
- "name": "namespace",
- "in": "query",
- "required": true,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "limit",
- "in": "query",
- "required": false,
- "schema": {
- "type": "integer",
- "minimum": 0
- }
- },
- {
- "name": "cursor",
- "in": "query",
- "required": false,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "variant",
- "in": "query",
- "required": false,
- "schema": {
- "$ref": "#/components/schemas/RunnerConfigVariant"
- }
- },
- {
- "name": "runner_names",
- "in": "query",
- "required": false,
- "schema": {
- "type": "string"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/RunnerConfigsListResponse"
- }
- }
- }
- }
- },
- "security": [
- {
- "bearer_auth": []
- }
- ]
- }
- },
- "/runner-configs/serverless-health-check": {
- "post": {
- "tags": [
- "runner_configs::serverless_health_check"
- ],
- "operationId": "runner_configs_serverless_health_check",
- "parameters": [
- {
- "name": "namespace",
- "in": "query",
- "required": true,
- "schema": {
- "type": "string"
- }
- }
- ],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/RunnerConfigsServerlessHealthCheckRequest"
- }
- }
- },
- "required": true
- },
- "responses": {
- "200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/RunnerConfigsServerlessHealthCheckResponse"
- }
- }
- }
- }
- },
- "security": [
- {
- "bearer_auth": []
- }
- ]
- }
- },
- "/runner-configs/{runner_name}": {
- "put": {
- "tags": [
- "runner_configs::upsert"
- ],
- "operationId": "runner_configs_upsert",
- "parameters": [
- {
- "name": "runner_name",
- "in": "path",
- "required": true,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "namespace",
- "in": "query",
- "required": true,
- "schema": {
- "type": "string"
- }
- }
- ],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/RunnerConfigsUpsertRequestBody"
- }
- }
- },
- "required": true
- },
- "responses": {
- "200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/RunnerConfigsUpsertResponse"
- }
- }
- }
- }
- },
- "security": [
- {
- "bearer_auth": []
- }
- ]
- },
- "delete": {
- "tags": [
- "runner_configs::delete"
- ],
- "operationId": "runner_configs_delete",
- "parameters": [
- {
- "name": "runner_name",
- "in": "path",
- "required": true,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "namespace",
- "in": "query",
- "required": true,
- "schema": {
- "type": "string"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/RunnerConfigsDeleteResponse"
- }
- }
- }
- }
- },
- "security": [
- {
- "bearer_auth": []
- }
- ]
- }
- },
- "/runner-configs/{runner_name}/refresh-metadata": {
- "post": {
- "tags": [
- "runner_configs::refresh_metadata"
- ],
- "operationId": "runner_configs_refresh_metadata",
- "parameters": [
- {
- "name": "runner_name",
- "in": "path",
- "required": true,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "namespace",
- "in": "query",
- "required": true,
- "schema": {
- "type": "string"
- }
- }
- ],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/RunnerConfigsRefreshMetadataRequestBody"
- }
- }
- },
- "required": true
- },
- "responses": {
- "200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/RunnerConfigsRefreshMetadataResponse"
- }
- }
- }
- }
- },
- "security": [
- {
- "bearer_auth": []
- }
- ]
- }
- },
- "/runners": {
- "get": {
- "tags": [
- "runners"
- ],
- "operationId": "runners_list",
- "parameters": [
- {
- "name": "namespace",
- "in": "query",
- "required": true,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "name",
- "in": "query",
- "required": false,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "runner_ids",
- "in": "query",
- "required": false,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "include_stopped",
- "in": "query",
- "required": false,
- "schema": {
- "type": "boolean"
- }
- },
- {
- "name": "limit",
- "in": "query",
- "required": false,
- "schema": {
- "type": "integer",
- "minimum": 0
- }
- },
- {
- "name": "cursor",
- "in": "query",
- "required": false,
- "schema": {
- "type": "string"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/RunnersListResponse"
- }
- }
- }
- }
- },
- "security": [
- {
- "bearer_auth": []
- }
- ]
- }
- },
- "/runners/names": {
- "get": {
- "tags": [
- "runners"
- ],
- "summary": "## Datacenter Round Trips",
- "description": "2 round trips:\n- GET /runners/names (fanout)\n- [api-peer] namespace::ops::resolve_for_name_global",
- "operationId": "runners_list_names",
- "parameters": [
- {
- "name": "namespace",
- "in": "query",
- "required": true,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "limit",
- "in": "query",
- "required": false,
- "schema": {
- "type": "integer",
- "minimum": 0
- }
- },
- {
- "name": "cursor",
- "in": "query",
- "required": false,
- "schema": {
- "type": "string"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/RunnersListNamesResponse"
- }
- }
- }
- }
- },
- "security": [
- {
- "bearer_auth": []
- }
- ]
- }
- }
- },
- "components": {
- "schemas": {
- "Actor": {
- "type": "object",
- "required": [
- "actor_id",
- "name",
- "namespace_id",
- "datacenter",
- "runner_name_selector",
- "crash_policy",
- "create_ts"
- ],
- "properties": {
- "actor_id": {
- "$ref": "#/components/schemas/RivetId"
- },
- "connectable_ts": {
- "type": [
- "integer",
- "null"
- ],
- "format": "int64"
- },
- "crash_policy": {
- "$ref": "#/components/schemas/CrashPolicy"
- },
- "create_ts": {
- "type": "integer",
- "format": "int64"
- },
- "datacenter": {
- "type": "string"
- },
- "destroy_ts": {
- "type": [
- "integer",
- "null"
- ],
- "format": "int64"
- },
- "key": {
- "type": [
- "string",
- "null"
- ]
- },
- "name": {
- "type": "string"
- },
- "namespace_id": {
- "$ref": "#/components/schemas/RivetId"
- },
- "pending_allocation_ts": {
- "type": [
- "integer",
- "null"
- ],
- "format": "int64"
- },
- "runner_name_selector": {
- "type": "string"
- },
- "sleep_ts": {
- "type": [
- "integer",
- "null"
- ],
- "format": "int64"
- },
- "start_ts": {
- "type": [
- "integer",
- "null"
- ],
- "format": "int64"
- }
- }
- },
- "ActorName": {
- "type": "object",
- "required": [
- "metadata"
- ],
- "properties": {
- "metadata": {
- "type": "object",
- "additionalProperties": {},
- "propertyNames": {
- "type": "string"
- }
- }
- }
- },
- "ActorsCreateRequest": {
- "type": "object",
- "required": [
- "name",
- "runner_name_selector",
- "crash_policy"
- ],
- "properties": {
- "crash_policy": {
- "$ref": "#/components/schemas/CrashPolicy"
- },
- "datacenter": {
- "type": [
- "string",
- "null"
- ]
- },
- "input": {
- "type": [
- "string",
- "null"
- ]
- },
- "key": {
- "type": [
- "string",
- "null"
- ]
- },
- "name": {
- "type": "string"
- },
- "runner_name_selector": {
- "type": "string"
- }
- },
- "additionalProperties": false
- },
- "ActorsCreateResponse": {
- "type": "object",
- "required": [
- "actor"
- ],
- "properties": {
- "actor": {
- "$ref": "#/components/schemas/Actor"
- }
- },
- "additionalProperties": false
- },
- "ActorsDeleteResponse": {
- "type": "object"
- },
- "ActorsGetOrCreateRequest": {
- "type": "object",
- "required": [
- "name",
- "key",
- "runner_name_selector",
- "crash_policy"
- ],
- "properties": {
- "crash_policy": {
- "$ref": "#/components/schemas/CrashPolicy"
- },
- "datacenter": {
- "type": [
- "string",
- "null"
- ]
- },
- "input": {
- "type": [
- "string",
- "null"
- ]
- },
- "key": {
- "type": "string"
- },
- "name": {
- "type": "string"
- },
- "runner_name_selector": {
- "type": "string"
- }
- },
- "additionalProperties": false
- },
- "ActorsGetOrCreateResponse": {
- "type": "object",
- "required": [
- "actor",
- "created"
- ],
- "properties": {
- "actor": {
- "$ref": "#/components/schemas/Actor"
- },
- "created": {
- "type": "boolean"
- }
- }
- },
- "ActorsListNamesResponse": {
- "type": "object",
- "required": [
- "names",
- "pagination"
- ],
- "properties": {
- "names": {
- "type": "object",
- "additionalProperties": {
- "$ref": "#/components/schemas/ActorName"
- },
- "propertyNames": {
- "type": "string"
- }
- },
- "pagination": {
- "$ref": "#/components/schemas/Pagination"
- }
- },
- "additionalProperties": false
- },
- "ActorsListResponse": {
- "type": "object",
- "required": [
- "actors",
- "pagination"
- ],
- "properties": {
- "actors": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Actor"
- }
- },
- "pagination": {
- "$ref": "#/components/schemas/Pagination"
- }
- },
- "additionalProperties": false
- },
- "CrashPolicy": {
- "type": "string",
- "enum": [
- "restart",
- "sleep",
- "destroy"
- ]
- },
- "Datacenter": {
- "type": "object",
- "required": [
- "label",
- "name",
- "url"
- ],
- "properties": {
- "label": {
- "type": "integer",
- "format": "int32",
- "minimum": 0
- },
- "name": {
- "type": "string"
- },
- "url": {
- "type": "string"
- }
- },
- "additionalProperties": false
- },
- "DatacenterHealth": {
- "type": "object",
- "required": [
- "datacenter_label",
- "datacenter_name",
- "status"
- ],
- "properties": {
- "datacenter_label": {
- "type": "integer",
- "format": "int32",
- "minimum": 0
- },
- "datacenter_name": {
- "type": "string"
- },
- "error": {
- "type": [
- "string",
- "null"
- ]
- },
- "response": {
- "oneOf": [
- {
- "type": "null"
- },
- {
- "$ref": "#/components/schemas/HealthResponse"
- }
- ]
- },
- "rtt_ms": {
- "type": [
- "number",
- "null"
- ],
- "format": "double"
- },
- "status": {
- "$ref": "#/components/schemas/HealthStatus"
- }
- }
- },
- "DatacentersListResponse": {
- "type": "object",
- "required": [
- "datacenters",
- "pagination"
- ],
- "properties": {
- "datacenters": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Datacenter"
- }
- },
- "pagination": {
- "$ref": "#/components/schemas/Pagination"
- }
- },
- "additionalProperties": false
- },
- "HealthFanoutResponse": {
- "type": "object",
- "required": [
- "datacenters"
- ],
- "properties": {
- "datacenters": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/DatacenterHealth"
- }
- }
- }
- },
- "HealthResponse": {
- "type": "object",
- "required": [
- "runtime",
- "status",
- "version"
- ],
- "properties": {
- "runtime": {
- "type": "string"
- },
- "status": {
- "type": "string"
- },
- "version": {
- "type": "string"
- }
- }
- },
- "HealthStatus": {
- "type": "string",
- "enum": [
- "ok",
- "error"
- ]
- },
- "Namespace": {
- "type": "object",
- "required": [
- "namespace_id",
- "name",
- "display_name",
- "create_ts"
- ],
- "properties": {
- "create_ts": {
- "type": "integer",
- "format": "int64"
- },
- "display_name": {
- "type": "string"
- },
- "name": {
- "type": "string"
- },
- "namespace_id": {
- "$ref": "#/components/schemas/RivetId"
- }
- }
- },
- "NamespaceListResponse": {
- "type": "object",
- "required": [
- "namespaces",
- "pagination"
- ],
- "properties": {
- "namespaces": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Namespace"
- }
- },
- "pagination": {
- "$ref": "#/components/schemas/Pagination"
- }
- },
- "additionalProperties": false
- },
- "NamespacesCreateRequest": {
- "type": "object",
- "required": [
- "name",
- "display_name"
- ],
- "properties": {
- "display_name": {
- "type": "string"
- },
- "name": {
- "type": "string"
- }
- },
- "additionalProperties": false
- },
- "NamespacesCreateResponse": {
- "type": "object",
- "required": [
- "namespace"
- ],
- "properties": {
- "namespace": {
- "$ref": "#/components/schemas/Namespace"
- }
- },
- "additionalProperties": false
- },
- "Pagination": {
- "type": "object",
- "properties": {
- "cursor": {
- "type": [
- "string",
- "null"
- ]
- }
- },
- "additionalProperties": false
- },
- "RivetId": {
- "type": "string"
- },
- "Runner": {
- "type": "object",
- "required": [
- "runner_id",
- "namespace_id",
- "datacenter",
- "name",
- "key",
- "version",
- "total_slots",
- "remaining_slots",
- "create_ts",
- "last_ping_ts",
- "last_rtt"
- ],
- "properties": {
- "create_ts": {
- "type": "integer",
- "format": "int64"
- },
- "datacenter": {
- "type": "string"
- },
- "drain_ts": {
- "type": [
- "integer",
- "null"
- ],
- "format": "int64"
- },
- "key": {
- "type": "string"
- },
- "last_connected_ts": {
- "type": [
- "integer",
- "null"
- ],
- "format": "int64"
- },
- "last_ping_ts": {
- "type": "integer",
- "format": "int64"
- },
- "last_rtt": {
- "type": "integer",
- "format": "int32",
- "minimum": 0
- },
- "metadata": {
- "type": [
- "object",
- "null"
- ],
- "additionalProperties": {},
- "propertyNames": {
- "type": "string"
- }
- },
- "name": {
- "type": "string"
- },
- "namespace_id": {
- "$ref": "#/components/schemas/RivetId"
- },
- "remaining_slots": {
- "type": "integer",
- "format": "int32",
- "minimum": 0
- },
- "runner_id": {
- "$ref": "#/components/schemas/RivetId"
- },
- "stop_ts": {
- "type": [
- "integer",
- "null"
- ],
- "format": "int64"
- },
- "total_slots": {
- "type": "integer",
- "format": "int32",
- "minimum": 0
- },
- "version": {
- "type": "integer",
- "format": "int32",
- "minimum": 0
- }
- },
- "additionalProperties": false
- },
- "RunnerConfig": {
- "allOf": [
- {
- "$ref": "#/components/schemas/RunnerConfigKind"
- },
- {
- "type": "object",
- "properties": {
- "metadata": {}
- }
- }
- ]
- },
- "RunnerConfigKind": {
- "oneOf": [
- {
- "type": "object",
- "required": [
- "normal"
- ],
- "properties": {
- "normal": {
- "type": "object"
- }
- }
- },
- {
- "type": "object",
- "required": [
- "serverless"
- ],
- "properties": {
- "serverless": {
- "type": "object",
- "required": [
- "url",
- "request_lifespan",
- "slots_per_runner",
- "max_runners"
- ],
- "properties": {
- "headers": {
- "type": [
- "object",
- "null"
- ],
- "additionalProperties": {
- "type": "string"
- },
- "propertyNames": {
- "type": "string"
- }
- },
- "max_runners": {
- "type": "integer",
- "format": "int32",
- "minimum": 0
- },
- "min_runners": {
- "type": [
- "integer",
- "null"
- ],
- "format": "int32",
- "minimum": 0
- },
- "request_lifespan": {
- "type": "integer",
- "format": "int32",
- "description": "Seconds.",
- "minimum": 0
- },
- "runners_margin": {
- "type": [
- "integer",
- "null"
- ],
- "format": "int32",
- "minimum": 0
- },
- "slots_per_runner": {
- "type": "integer",
- "format": "int32",
- "minimum": 0
- },
- "url": {
- "type": "string"
- }
- }
- }
- }
- }
- ]
- },
- "RunnerConfigVariant": {
- "type": "string",
- "enum": [
- "serverless",
- "normal"
- ]
- },
- "RunnerConfigsDeleteResponse": {
- "type": "object"
- },
- "RunnerConfigsListResponse": {
- "type": "object",
- "required": [
- "runner_configs",
- "pagination"
- ],
- "properties": {
- "pagination": {
- "$ref": "#/components/schemas/Pagination"
- },
- "runner_configs": {
- "type": "object",
- "additionalProperties": {
- "$ref": "#/components/schemas/RunnerConfigsListResponseRunnerConfigsValue"
- },
- "propertyNames": {
- "type": "string"
- }
- }
- },
- "additionalProperties": false
- },
- "RunnerConfigsListResponseRunnerConfigsValue": {
- "type": "object",
- "required": [
- "datacenters"
- ],
- "properties": {
- "datacenters": {
- "type": "object",
- "additionalProperties": {
- "$ref": "#/components/schemas/RunnerConfig"
- },
- "propertyNames": {
- "type": "string"
- }
- }
- }
- },
- "RunnerConfigsRefreshMetadataRequestBody": {
- "type": "object",
- "additionalProperties": false
- },
- "RunnerConfigsRefreshMetadataResponse": {
- "type": "object",
- "additionalProperties": false
- },
- "RunnerConfigsServerlessHealthCheckRequest": {
- "type": "object",
- "required": [
- "url"
- ],
- "properties": {
- "headers": {
- "type": "object",
- "additionalProperties": {
- "type": "string"
- },
- "propertyNames": {
- "type": "string"
- }
- },
- "url": {
- "type": "string"
- }
- },
- "additionalProperties": false
- },
- "RunnerConfigsServerlessHealthCheckResponse": {
- "oneOf": [
- {
- "type": "object",
- "required": [
- "success"
- ],
- "properties": {
- "success": {
- "type": "object",
- "required": [
- "version"
- ],
- "properties": {
- "version": {
- "type": "string"
- }
- }
- }
- }
- },
- {
- "type": "object",
- "required": [
- "failure"
- ],
- "properties": {
- "failure": {
- "type": "object",
- "required": [
- "error"
- ],
- "properties": {
- "error": {
- "$ref": "#/components/schemas/RunnerConfigsServerlessMetadataError"
- }
- }
- }
- }
- }
- ]
- },
- "RunnerConfigsServerlessMetadataError": {
- "oneOf": [
- {
- "type": "object",
- "required": [
- "invalid_request"
- ],
- "properties": {
- "invalid_request": {
- "type": "object"
- }
- }
- },
- {
- "type": "object",
- "required": [
- "request_failed"
- ],
- "properties": {
- "request_failed": {
- "type": "object"
- }
- }
- },
- {
- "type": "object",
- "required": [
- "request_timed_out"
- ],
- "properties": {
- "request_timed_out": {
- "type": "object"
- }
- }
- },
- {
- "type": "object",
- "required": [
- "non_success_status"
- ],
- "properties": {
- "non_success_status": {
- "type": "object",
- "required": [
- "status_code",
- "body"
- ],
- "properties": {
- "body": {
- "type": "string"
- },
- "status_code": {
- "type": "integer",
- "format": "int32",
- "minimum": 0
- }
- }
- }
- }
- },
- {
- "type": "object",
- "required": [
- "invalid_response_json"
- ],
- "properties": {
- "invalid_response_json": {
- "type": "object",
- "required": [
- "body"
- ],
- "properties": {
- "body": {
- "type": "string"
- }
- }
- }
- }
- },
- {
- "type": "object",
- "required": [
- "invalid_response_schema"
- ],
- "properties": {
- "invalid_response_schema": {
- "type": "object",
- "required": [
- "runtime",
- "version"
- ],
- "properties": {
- "runtime": {
- "type": "string"
- },
- "version": {
- "type": "string"
- }
- }
- }
- }
- }
- ]
- },
- "RunnerConfigsUpsertRequestBody": {
- "type": "object",
- "required": [
- "datacenters"
- ],
- "properties": {
- "datacenters": {
- "type": "object",
- "additionalProperties": {
- "$ref": "#/components/schemas/RunnerConfig"
- },
- "propertyNames": {
- "type": "string"
- }
- }
- },
- "additionalProperties": false
- },
- "RunnerConfigsUpsertResponse": {
- "type": "object",
- "required": [
- "endpoint_config_changed"
- ],
- "properties": {
- "endpoint_config_changed": {
- "type": "boolean"
- }
- }
- },
- "RunnersListNamesResponse": {
- "type": "object",
- "required": [
- "names",
- "pagination"
- ],
- "properties": {
- "names": {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "pagination": {
- "$ref": "#/components/schemas/Pagination"
- }
- },
- "additionalProperties": false
- },
- "RunnersListResponse": {
- "type": "object",
- "required": [
- "runners",
- "pagination"
- ],
- "properties": {
- "pagination": {
- "$ref": "#/components/schemas/Pagination"
- },
- "runners": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Runner"
- }
- }
- },
- "additionalProperties": false
- }
- },
- "securitySchemes": {
- "bearer_auth": {
- "type": "http",
- "scheme": "bearer"
- }
- }
- },
- "security": [
- {
- "bearer_auth": []
- }
- ]
-}
\ No newline at end of file
+ "openapi": "3.1.0",
+ "info": {
+ "title": "rivet-api-public",
+ "description": "",
+ "contact": {
+ "name": "Rivet Gaming, LLC",
+ "email": "developer@rivet.gg"
+ },
+ "license": {
+ "name": "Apache-2.0",
+ "identifier": "Apache-2.0"
+ },
+ "version": "25.8.1"
+ },
+ "paths": {
+ "/actors": {
+ "get": {
+ "tags": ["actors::list"],
+ "summary": " ## Datacenter Round Trips",
+ "description": " **If key is some & `include_destroyed` is false**\n\n 2 round trips:\n - namespace::ops::resolve_for_name_global\n - GET /actors (multiple DCs based on actor IDs)\n\n\tThis path is optimized because we can read the actor IDs fro the key directly from Epoxy with\n\tstale consistency to determine which datacenter the actor lives in. Under most circumstances,\n\tthis means we don't need to fan out to all datacenters (like normal list does).\n\n\tThe reason `include_destroyed` has to be false is Epoxy only stores currently active actors. If\n\t`include_destroyed` is true, we show all previous iterations of actors with the same key.\n\n **Otherwise**\n\n 2 round trips:\n - namespace::ops::resolve_for_name_global\n - GET /actors (fanout)\n\n ## Optimized Alternative Routes",
+ "operationId": "actors_list",
+ "parameters": [
+ {
+ "name": "namespace",
+ "in": "query",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "name",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "key",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "actor_ids",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "include_destroyed",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "type": "boolean"
+ }
+ },
+ {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "type": "integer",
+ "minimum": 0
+ }
+ },
+ {
+ "name": "cursor",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ActorsListResponse"
+ }
+ }
+ }
+ }
+ }
+ },
+ "put": {
+ "tags": ["actors::get_or_create"],
+ "summary": "## Datacenter Round Trips",
+ "description": "**If actor exists**\n\n2 round trips:\n- namespace::ops::resolve_for_name_global\n- GET /actors/{}\n\n**If actor does not exist and is created in the current datacenter:**\n\n2 round trips:\n- namespace::ops::resolve_for_name_global\n- [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation)\n\n**If actor does not exist and is created in a different datacenter:**\n\n3 round trips:\n- namespace::ops::resolve_for_name_global\n- POST /actors to remote datacenter\n- [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation)\n\nactor::get will always be in the same datacenter.\n\n## Optimized Alternative Routes",
+ "operationId": "actors_get_or_create",
+ "parameters": [
+ {
+ "name": "namespace",
+ "in": "query",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ActorsGetOrCreateRequest"
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ActorsGetOrCreateResponse"
+ }
+ }
+ }
+ }
+ }
+ },
+ "post": {
+ "tags": ["actors::create"],
+ "summary": "## Datacenter Round Trips",
+ "description": "**If actor is created in the current datacenter:**\n\n2 round trips:\n- namespace::ops::resolve_for_name_global\n- [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation)\n\n**If actor is created in a different datacenter:**\n\n3 round trips:\n- namespace::ops::resolve_for_name_global\n- POST /actors to remote datacenter\n- [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation)\n\nactor::get will always be in the same datacenter.",
+ "operationId": "actors_create",
+ "parameters": [
+ {
+ "name": "namespace",
+ "in": "query",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ActorsCreateRequest"
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ActorsCreateResponse"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/actors/names": {
+ "get": {
+ "tags": ["actors::list_names"],
+ "summary": "## Datacenter Round Trips",
+ "description": "2 round trips:\n- GET /actors/names (fanout)\n- [api-peer] namespace::ops::resolve_for_name_global",
+ "operationId": "actors_list_names",
+ "parameters": [
+ {
+ "name": "namespace",
+ "in": "query",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "type": "integer",
+ "minimum": 0
+ }
+ },
+ {
+ "name": "cursor",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ActorsListNamesResponse"
+ }
+ }
+ }
+ }
+ },
+ "security": [
+ {
+ "bearer_auth": []
+ }
+ ]
+ }
+ },
+ "/actors/{actor_id}": {
+ "delete": {
+ "tags": ["actors::delete"],
+ "summary": "## Datacenter Round Trips",
+ "description": "2 round trip:\n- DELETE /actors/{}\n- [api-peer] namespace::ops::resolve_for_name_global",
+ "operationId": "actors_delete",
+ "parameters": [
+ {
+ "name": "actor_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "$ref": "#/components/schemas/RivetId"
+ }
+ },
+ {
+ "name": "namespace",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ActorsDeleteResponse"
+ }
+ }
+ }
+ }
+ },
+ "security": [
+ {
+ "bearer_auth": []
+ }
+ ]
+ }
+ },
+ "/datacenters": {
+ "get": {
+ "tags": ["datacenters"],
+ "operationId": "datacenters_list",
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/DatacentersListResponse"
+ }
+ }
+ }
+ }
+ },
+ "security": [
+ {
+ "bearer_auth": []
+ }
+ ]
+ }
+ },
+ "/health/fanout": {
+ "get": {
+ "tags": ["health"],
+ "operationId": "health_fanout",
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HealthFanoutResponse"
+ }
+ }
+ }
+ }
+ },
+ "security": [
+ {
+ "bearer_auth": []
+ }
+ ]
+ }
+ },
+ "/namespaces": {
+ "get": {
+ "tags": ["namespaces"],
+ "operationId": "namespaces_list",
+ "parameters": [
+ {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "type": "integer",
+ "minimum": 0
+ }
+ },
+ {
+ "name": "cursor",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "name",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "namespace_ids",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/NamespaceListResponse"
+ }
+ }
+ }
+ }
+ },
+ "security": [
+ {
+ "bearer_auth": []
+ }
+ ]
+ },
+ "post": {
+ "tags": ["namespaces"],
+ "operationId": "namespaces_create",
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/NamespacesCreateRequest"
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/NamespacesCreateResponse"
+ }
+ }
+ }
+ }
+ },
+ "security": [
+ {
+ "bearer_auth": []
+ }
+ ]
+ }
+ },
+ "/runner-configs": {
+ "get": {
+ "tags": ["runner_configs::list"],
+ "operationId": "runner_configs_list",
+ "parameters": [
+ {
+ "name": "namespace",
+ "in": "query",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "type": "integer",
+ "minimum": 0
+ }
+ },
+ {
+ "name": "cursor",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "variant",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "$ref": "#/components/schemas/RunnerConfigVariant"
+ }
+ },
+ {
+ "name": "runner_names",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/RunnerConfigsListResponse"
+ }
+ }
+ }
+ }
+ },
+ "security": [
+ {
+ "bearer_auth": []
+ }
+ ]
+ }
+ },
+ "/runner-configs/serverless-health-check": {
+ "post": {
+ "tags": ["runner_configs::serverless_health_check"],
+ "operationId": "runner_configs_serverless_health_check",
+ "parameters": [
+ {
+ "name": "namespace",
+ "in": "query",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/RunnerConfigsServerlessHealthCheckRequest"
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/RunnerConfigsServerlessHealthCheckResponse"
+ }
+ }
+ }
+ }
+ },
+ "security": [
+ {
+ "bearer_auth": []
+ }
+ ]
+ }
+ },
+ "/runner-configs/{runner_name}": {
+ "put": {
+ "tags": ["runner_configs::upsert"],
+ "operationId": "runner_configs_upsert",
+ "parameters": [
+ {
+ "name": "runner_name",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "namespace",
+ "in": "query",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/RunnerConfigsUpsertRequestBody"
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/RunnerConfigsUpsertResponse"
+ }
+ }
+ }
+ }
+ },
+ "security": [
+ {
+ "bearer_auth": []
+ }
+ ]
+ },
+ "delete": {
+ "tags": ["runner_configs::delete"],
+ "operationId": "runner_configs_delete",
+ "parameters": [
+ {
+ "name": "runner_name",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "namespace",
+ "in": "query",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/RunnerConfigsDeleteResponse"
+ }
+ }
+ }
+ }
+ },
+ "security": [
+ {
+ "bearer_auth": []
+ }
+ ]
+ }
+ },
+ "/runner-configs/{runner_name}/refresh-metadata": {
+ "post": {
+ "tags": ["runner_configs::refresh_metadata"],
+ "operationId": "runner_configs_refresh_metadata",
+ "parameters": [
+ {
+ "name": "runner_name",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "namespace",
+ "in": "query",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/RunnerConfigsRefreshMetadataRequestBody"
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/RunnerConfigsRefreshMetadataResponse"
+ }
+ }
+ }
+ }
+ },
+ "security": [
+ {
+ "bearer_auth": []
+ }
+ ]
+ }
+ },
+ "/runners": {
+ "get": {
+ "tags": ["runners"],
+ "operationId": "runners_list",
+ "parameters": [
+ {
+ "name": "namespace",
+ "in": "query",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "name",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "runner_ids",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "include_stopped",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "type": "boolean"
+ }
+ },
+ {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "type": "integer",
+ "minimum": 0
+ }
+ },
+ {
+ "name": "cursor",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/RunnersListResponse"
+ }
+ }
+ }
+ }
+ },
+ "security": [
+ {
+ "bearer_auth": []
+ }
+ ]
+ }
+ },
+ "/runners/names": {
+ "get": {
+ "tags": ["runners"],
+ "summary": "## Datacenter Round Trips",
+ "description": "2 round trips:\n- GET /runners/names (fanout)\n- [api-peer] namespace::ops::resolve_for_name_global",
+ "operationId": "runners_list_names",
+ "parameters": [
+ {
+ "name": "namespace",
+ "in": "query",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "type": "integer",
+ "minimum": 0
+ }
+ },
+ {
+ "name": "cursor",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/RunnersListNamesResponse"
+ }
+ }
+ }
+ }
+ },
+ "security": [
+ {
+ "bearer_auth": []
+ }
+ ]
+ }
+ }
+ },
+ "components": {
+ "schemas": {
+ "Actor": {
+ "type": "object",
+ "required": [
+ "actor_id",
+ "name",
+ "namespace_id",
+ "datacenter",
+ "runner_name_selector",
+ "crash_policy",
+ "create_ts"
+ ],
+ "properties": {
+ "actor_id": {
+ "$ref": "#/components/schemas/RivetId"
+ },
+ "connectable_ts": {
+ "type": ["integer", "null"],
+ "format": "int64"
+ },
+ "crash_policy": {
+ "$ref": "#/components/schemas/CrashPolicy"
+ },
+ "create_ts": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "datacenter": {
+ "type": "string"
+ },
+ "destroy_ts": {
+ "type": ["integer", "null"],
+ "format": "int64"
+ },
+ "key": {
+ "type": ["string", "null"]
+ },
+ "name": {
+ "type": "string"
+ },
+ "namespace_id": {
+ "$ref": "#/components/schemas/RivetId"
+ },
+ "pending_allocation_ts": {
+ "type": ["integer", "null"],
+ "format": "int64"
+ },
+ "runner_name_selector": {
+ "type": "string"
+ },
+ "sleep_ts": {
+ "type": ["integer", "null"],
+ "format": "int64"
+ },
+ "start_ts": {
+ "type": ["integer", "null"],
+ "format": "int64"
+ }
+ }
+ },
+ "ActorName": {
+ "type": "object",
+ "required": ["metadata"],
+ "properties": {
+ "metadata": {
+ "type": "object",
+ "additionalProperties": {},
+ "propertyNames": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "ActorsCreateRequest": {
+ "type": "object",
+ "required": ["name", "runner_name_selector", "crash_policy"],
+ "properties": {
+ "crash_policy": {
+ "$ref": "#/components/schemas/CrashPolicy"
+ },
+ "datacenter": {
+ "type": ["string", "null"]
+ },
+ "input": {
+ "type": ["string", "null"]
+ },
+ "key": {
+ "type": ["string", "null"]
+ },
+ "name": {
+ "type": "string"
+ },
+ "runner_name_selector": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "ActorsCreateResponse": {
+ "type": "object",
+ "required": ["actor"],
+ "properties": {
+ "actor": {
+ "$ref": "#/components/schemas/Actor"
+ }
+ },
+ "additionalProperties": false
+ },
+ "ActorsDeleteResponse": {
+ "type": "object"
+ },
+ "ActorsGetOrCreateRequest": {
+ "type": "object",
+ "required": [
+ "name",
+ "key",
+ "runner_name_selector",
+ "crash_policy"
+ ],
+ "properties": {
+ "crash_policy": {
+ "$ref": "#/components/schemas/CrashPolicy"
+ },
+ "datacenter": {
+ "type": ["string", "null"]
+ },
+ "input": {
+ "type": ["string", "null"]
+ },
+ "key": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "runner_name_selector": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "ActorsGetOrCreateResponse": {
+ "type": "object",
+ "required": ["actor", "created"],
+ "properties": {
+ "actor": {
+ "$ref": "#/components/schemas/Actor"
+ },
+ "created": {
+ "type": "boolean"
+ }
+ }
+ },
+ "ActorsListNamesResponse": {
+ "type": "object",
+ "required": ["names", "pagination"],
+ "properties": {
+ "names": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/components/schemas/ActorName"
+ },
+ "propertyNames": {
+ "type": "string"
+ }
+ },
+ "pagination": {
+ "$ref": "#/components/schemas/Pagination"
+ }
+ },
+ "additionalProperties": false
+ },
+ "ActorsListResponse": {
+ "type": "object",
+ "required": ["actors", "pagination"],
+ "properties": {
+ "actors": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Actor"
+ }
+ },
+ "pagination": {
+ "$ref": "#/components/schemas/Pagination"
+ }
+ },
+ "additionalProperties": false
+ },
+ "CrashPolicy": {
+ "type": "string",
+ "enum": ["restart", "sleep", "destroy"]
+ },
+ "Datacenter": {
+ "type": "object",
+ "required": ["label", "name", "url"],
+ "properties": {
+ "label": {
+ "type": "integer",
+ "format": "int32",
+ "minimum": 0
+ },
+ "name": {
+ "type": "string"
+ },
+ "url": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "DatacenterHealth": {
+ "type": "object",
+ "required": ["datacenter_label", "datacenter_name", "status"],
+ "properties": {
+ "datacenter_label": {
+ "type": "integer",
+ "format": "int32",
+ "minimum": 0
+ },
+ "datacenter_name": {
+ "type": "string"
+ },
+ "error": {
+ "type": ["string", "null"]
+ },
+ "response": {
+ "oneOf": [
+ {
+ "type": "null"
+ },
+ {
+ "$ref": "#/components/schemas/HealthResponse"
+ }
+ ]
+ },
+ "rtt_ms": {
+ "type": ["number", "null"],
+ "format": "double"
+ },
+ "status": {
+ "$ref": "#/components/schemas/HealthStatus"
+ }
+ }
+ },
+ "DatacentersListResponse": {
+ "type": "object",
+ "required": ["datacenters", "pagination"],
+ "properties": {
+ "datacenters": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Datacenter"
+ }
+ },
+ "pagination": {
+ "$ref": "#/components/schemas/Pagination"
+ }
+ },
+ "additionalProperties": false
+ },
+ "HealthFanoutResponse": {
+ "type": "object",
+ "required": ["datacenters"],
+ "properties": {
+ "datacenters": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/DatacenterHealth"
+ }
+ }
+ }
+ },
+ "HealthResponse": {
+ "type": "object",
+ "required": ["runtime", "status", "version"],
+ "properties": {
+ "runtime": {
+ "type": "string"
+ },
+ "status": {
+ "type": "string"
+ },
+ "version": {
+ "type": "string"
+ }
+ }
+ },
+ "HealthStatus": {
+ "type": "string",
+ "enum": ["ok", "error"]
+ },
+ "Namespace": {
+ "type": "object",
+ "required": [
+ "namespace_id",
+ "name",
+ "display_name",
+ "create_ts"
+ ],
+ "properties": {
+ "create_ts": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "display_name": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "namespace_id": {
+ "$ref": "#/components/schemas/RivetId"
+ }
+ }
+ },
+ "NamespaceListResponse": {
+ "type": "object",
+ "required": ["namespaces", "pagination"],
+ "properties": {
+ "namespaces": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Namespace"
+ }
+ },
+ "pagination": {
+ "$ref": "#/components/schemas/Pagination"
+ }
+ },
+ "additionalProperties": false
+ },
+ "NamespacesCreateRequest": {
+ "type": "object",
+ "required": ["name", "display_name"],
+ "properties": {
+ "display_name": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "NamespacesCreateResponse": {
+ "type": "object",
+ "required": ["namespace"],
+ "properties": {
+ "namespace": {
+ "$ref": "#/components/schemas/Namespace"
+ }
+ },
+ "additionalProperties": false
+ },
+ "Pagination": {
+ "type": "object",
+ "properties": {
+ "cursor": {
+ "type": ["string", "null"]
+ }
+ },
+ "additionalProperties": false
+ },
+ "RivetId": {
+ "type": "string"
+ },
+ "Runner": {
+ "type": "object",
+ "required": [
+ "runner_id",
+ "namespace_id",
+ "datacenter",
+ "name",
+ "key",
+ "version",
+ "total_slots",
+ "remaining_slots",
+ "create_ts",
+ "last_ping_ts",
+ "last_rtt"
+ ],
+ "properties": {
+ "create_ts": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "datacenter": {
+ "type": "string"
+ },
+ "drain_ts": {
+ "type": ["integer", "null"],
+ "format": "int64"
+ },
+ "key": {
+ "type": "string"
+ },
+ "last_connected_ts": {
+ "type": ["integer", "null"],
+ "format": "int64"
+ },
+ "last_ping_ts": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "last_rtt": {
+ "type": "integer",
+ "format": "int32",
+ "minimum": 0
+ },
+ "metadata": {
+ "type": ["object", "null"],
+ "additionalProperties": {},
+ "propertyNames": {
+ "type": "string"
+ }
+ },
+ "name": {
+ "type": "string"
+ },
+ "namespace_id": {
+ "$ref": "#/components/schemas/RivetId"
+ },
+ "remaining_slots": {
+ "type": "integer",
+ "format": "int32",
+ "minimum": 0
+ },
+ "runner_id": {
+ "$ref": "#/components/schemas/RivetId"
+ },
+ "stop_ts": {
+ "type": ["integer", "null"],
+ "format": "int64"
+ },
+ "total_slots": {
+ "type": "integer",
+ "format": "int32",
+ "minimum": 0
+ },
+ "version": {
+ "type": "integer",
+ "format": "int32",
+ "minimum": 0
+ }
+ },
+ "additionalProperties": false
+ },
+ "RunnerConfig": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/RunnerConfigKind"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "metadata": {}
+ }
+ }
+ ]
+ },
+ "RunnerConfigKind": {
+ "oneOf": [
+ {
+ "type": "object",
+ "required": ["normal"],
+ "properties": {
+ "normal": {
+ "type": "object"
+ }
+ }
+ },
+ {
+ "type": "object",
+ "required": ["serverless"],
+ "properties": {
+ "serverless": {
+ "type": "object",
+ "required": [
+ "url",
+ "request_lifespan",
+ "slots_per_runner",
+ "max_runners"
+ ],
+ "properties": {
+ "headers": {
+ "type": ["object", "null"],
+ "additionalProperties": {
+ "type": "string"
+ },
+ "propertyNames": {
+ "type": "string"
+ }
+ },
+ "max_runners": {
+ "type": "integer",
+ "format": "int32",
+ "minimum": 0
+ },
+ "min_runners": {
+ "type": ["integer", "null"],
+ "format": "int32",
+ "minimum": 0
+ },
+ "request_lifespan": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Seconds.",
+ "minimum": 0
+ },
+ "runners_margin": {
+ "type": ["integer", "null"],
+ "format": "int32",
+ "minimum": 0
+ },
+ "slots_per_runner": {
+ "type": "integer",
+ "format": "int32",
+ "minimum": 0
+ },
+ "url": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ ]
+ },
+ "RunnerConfigVariant": {
+ "type": "string",
+ "enum": ["serverless", "normal"]
+ },
+ "RunnerConfigsDeleteResponse": {
+ "type": "object"
+ },
+ "RunnerConfigsListResponse": {
+ "type": "object",
+ "required": ["runner_configs", "pagination"],
+ "properties": {
+ "pagination": {
+ "$ref": "#/components/schemas/Pagination"
+ },
+ "runner_configs": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/components/schemas/RunnerConfigsListResponseRunnerConfigsValue"
+ },
+ "propertyNames": {
+ "type": "string"
+ }
+ }
+ },
+ "additionalProperties": false
+ },
+ "RunnerConfigsListResponseRunnerConfigsValue": {
+ "type": "object",
+ "required": ["datacenters"],
+ "properties": {
+ "datacenters": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/components/schemas/RunnerConfig"
+ },
+ "propertyNames": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "RunnerConfigsRefreshMetadataRequestBody": {
+ "type": "object",
+ "additionalProperties": false
+ },
+ "RunnerConfigsRefreshMetadataResponse": {
+ "type": "object",
+ "additionalProperties": false
+ },
+ "RunnerConfigsServerlessHealthCheckRequest": {
+ "type": "object",
+ "required": ["url"],
+ "properties": {
+ "headers": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ },
+ "propertyNames": {
+ "type": "string"
+ }
+ },
+ "url": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "RunnerConfigsServerlessHealthCheckResponse": {
+ "oneOf": [
+ {
+ "type": "object",
+ "required": ["success"],
+ "properties": {
+ "success": {
+ "type": "object",
+ "required": ["version"],
+ "properties": {
+ "version": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ {
+ "type": "object",
+ "required": ["failure"],
+ "properties": {
+ "failure": {
+ "type": "object",
+ "required": ["error"],
+ "properties": {
+ "error": {
+ "$ref": "#/components/schemas/RunnerConfigsServerlessMetadataError"
+ }
+ }
+ }
+ }
+ }
+ ]
+ },
+ "RunnerConfigsServerlessMetadataError": {
+ "oneOf": [
+ {
+ "type": "object",
+ "required": ["invalid_request"],
+ "properties": {
+ "invalid_request": {
+ "type": "object"
+ }
+ }
+ },
+ {
+ "type": "object",
+ "required": ["request_failed"],
+ "properties": {
+ "request_failed": {
+ "type": "object"
+ }
+ }
+ },
+ {
+ "type": "object",
+ "required": ["request_timed_out"],
+ "properties": {
+ "request_timed_out": {
+ "type": "object"
+ }
+ }
+ },
+ {
+ "type": "object",
+ "required": ["non_success_status"],
+ "properties": {
+ "non_success_status": {
+ "type": "object",
+ "required": ["status_code", "body"],
+ "properties": {
+ "body": {
+ "type": "string"
+ },
+ "status_code": {
+ "type": "integer",
+ "format": "int32",
+ "minimum": 0
+ }
+ }
+ }
+ }
+ },
+ {
+ "type": "object",
+ "required": ["invalid_response_json"],
+ "properties": {
+ "invalid_response_json": {
+ "type": "object",
+ "required": ["body"],
+ "properties": {
+ "body": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ {
+ "type": "object",
+ "required": ["invalid_response_schema"],
+ "properties": {
+ "invalid_response_schema": {
+ "type": "object",
+ "required": ["runtime", "version"],
+ "properties": {
+ "runtime": {
+ "type": "string"
+ },
+ "version": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ ]
+ },
+ "RunnerConfigsUpsertRequestBody": {
+ "type": "object",
+ "required": ["datacenters"],
+ "properties": {
+ "datacenters": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/components/schemas/RunnerConfig"
+ },
+ "propertyNames": {
+ "type": "string"
+ }
+ }
+ },
+ "additionalProperties": false
+ },
+ "RunnerConfigsUpsertResponse": {
+ "type": "object",
+ "required": ["endpoint_config_changed"],
+ "properties": {
+ "endpoint_config_changed": {
+ "type": "boolean"
+ }
+ }
+ },
+ "RunnersListNamesResponse": {
+ "type": "object",
+ "required": ["names", "pagination"],
+ "properties": {
+ "names": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "pagination": {
+ "$ref": "#/components/schemas/Pagination"
+ }
+ },
+ "additionalProperties": false
+ },
+ "RunnersListResponse": {
+ "type": "object",
+ "required": ["runners", "pagination"],
+ "properties": {
+ "pagination": {
+ "$ref": "#/components/schemas/Pagination"
+ },
+ "runners": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Runner"
+ }
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "securitySchemes": {
+ "bearer_auth": {
+ "type": "http",
+ "scheme": "bearer"
+ }
+ }
+ },
+ "security": [
+ {
+ "bearer_auth": []
+ }
+ ]
+}
diff --git a/engine/docker/dev-host/grafana/dashboards/guard.json b/engine/docker/dev-host/grafana/dashboards/guard.json
index b4d37655bc..722321a813 100644
--- a/engine/docker/dev-host/grafana/dashboards/guard.json
+++ b/engine/docker/dev-host/grafana/dashboards/guard.json
@@ -92,9 +92,7 @@
"id": 10,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
@@ -198,9 +196,7 @@
"id": 11,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
@@ -304,9 +300,7 @@
"id": 12,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
@@ -410,9 +404,7 @@
"id": 2,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
@@ -517,9 +509,7 @@
"id": 5,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
@@ -727,9 +717,7 @@
"id": 7,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
@@ -834,9 +822,7 @@
"id": 8,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
diff --git a/engine/docker/dev-host/grafana/dashboards/tokio.json b/engine/docker/dev-host/grafana/dashboards/tokio.json
index 45bd84de2a..e50028f6ff 100644
--- a/engine/docker/dev-host/grafana/dashboards/tokio.json
+++ b/engine/docker/dev-host/grafana/dashboards/tokio.json
@@ -93,9 +93,7 @@
"id": 24,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": false,
@@ -200,9 +198,7 @@
"id": 27,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": false,
@@ -418,9 +414,7 @@
"id": 26,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": false,
@@ -636,9 +630,7 @@
"id": 25,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": false,
@@ -743,9 +735,7 @@
"id": 28,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": false,
@@ -850,9 +840,7 @@
"id": 29,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": false,
@@ -968,12 +956,8 @@
},
{
"current": {
- "text": [
- "All"
- ],
- "value": [
- "$__all"
- ]
+ "text": ["All"],
+ "value": ["$__all"]
},
"datasource": {
"type": "grafana-clickhouse-datasource",
diff --git a/engine/docker/dev-multidc-multinode/core/grafana/dashboards/guard.json b/engine/docker/dev-multidc-multinode/core/grafana/dashboards/guard.json
index b4d37655bc..722321a813 100644
--- a/engine/docker/dev-multidc-multinode/core/grafana/dashboards/guard.json
+++ b/engine/docker/dev-multidc-multinode/core/grafana/dashboards/guard.json
@@ -92,9 +92,7 @@
"id": 10,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
@@ -198,9 +196,7 @@
"id": 11,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
@@ -304,9 +300,7 @@
"id": 12,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
@@ -410,9 +404,7 @@
"id": 2,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
@@ -517,9 +509,7 @@
"id": 5,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
@@ -727,9 +717,7 @@
"id": 7,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
@@ -834,9 +822,7 @@
"id": 8,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
diff --git a/engine/docker/dev-multidc-multinode/core/grafana/dashboards/tokio.json b/engine/docker/dev-multidc-multinode/core/grafana/dashboards/tokio.json
index 45bd84de2a..e50028f6ff 100644
--- a/engine/docker/dev-multidc-multinode/core/grafana/dashboards/tokio.json
+++ b/engine/docker/dev-multidc-multinode/core/grafana/dashboards/tokio.json
@@ -93,9 +93,7 @@
"id": 24,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": false,
@@ -200,9 +198,7 @@
"id": 27,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": false,
@@ -418,9 +414,7 @@
"id": 26,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": false,
@@ -636,9 +630,7 @@
"id": 25,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": false,
@@ -743,9 +735,7 @@
"id": 28,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": false,
@@ -850,9 +840,7 @@
"id": 29,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": false,
@@ -968,12 +956,8 @@
},
{
"current": {
- "text": [
- "All"
- ],
- "value": [
- "$__all"
- ]
+ "text": ["All"],
+ "value": ["$__all"]
},
"datasource": {
"type": "grafana-clickhouse-datasource",
diff --git a/engine/docker/dev-multidc/core/grafana/dashboards/guard.json b/engine/docker/dev-multidc/core/grafana/dashboards/guard.json
index b4d37655bc..722321a813 100644
--- a/engine/docker/dev-multidc/core/grafana/dashboards/guard.json
+++ b/engine/docker/dev-multidc/core/grafana/dashboards/guard.json
@@ -92,9 +92,7 @@
"id": 10,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
@@ -198,9 +196,7 @@
"id": 11,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
@@ -304,9 +300,7 @@
"id": 12,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
@@ -410,9 +404,7 @@
"id": 2,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
@@ -517,9 +509,7 @@
"id": 5,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
@@ -727,9 +717,7 @@
"id": 7,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
@@ -834,9 +822,7 @@
"id": 8,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
diff --git a/engine/docker/dev-multidc/core/grafana/dashboards/tokio.json b/engine/docker/dev-multidc/core/grafana/dashboards/tokio.json
index 45bd84de2a..e50028f6ff 100644
--- a/engine/docker/dev-multidc/core/grafana/dashboards/tokio.json
+++ b/engine/docker/dev-multidc/core/grafana/dashboards/tokio.json
@@ -93,9 +93,7 @@
"id": 24,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": false,
@@ -200,9 +198,7 @@
"id": 27,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": false,
@@ -418,9 +414,7 @@
"id": 26,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": false,
@@ -636,9 +630,7 @@
"id": 25,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": false,
@@ -743,9 +735,7 @@
"id": 28,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": false,
@@ -850,9 +840,7 @@
"id": 29,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": false,
@@ -968,12 +956,8 @@
},
{
"current": {
- "text": [
- "All"
- ],
- "value": [
- "$__all"
- ]
+ "text": ["All"],
+ "value": ["$__all"]
},
"datasource": {
"type": "grafana-clickhouse-datasource",
diff --git a/engine/docker/dev-multinode/grafana/dashboards/guard.json b/engine/docker/dev-multinode/grafana/dashboards/guard.json
index b4d37655bc..722321a813 100644
--- a/engine/docker/dev-multinode/grafana/dashboards/guard.json
+++ b/engine/docker/dev-multinode/grafana/dashboards/guard.json
@@ -92,9 +92,7 @@
"id": 10,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
@@ -198,9 +196,7 @@
"id": 11,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
@@ -304,9 +300,7 @@
"id": 12,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
@@ -410,9 +404,7 @@
"id": 2,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
@@ -517,9 +509,7 @@
"id": 5,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
@@ -727,9 +717,7 @@
"id": 7,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
@@ -834,9 +822,7 @@
"id": 8,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
diff --git a/engine/docker/dev-multinode/grafana/dashboards/tokio.json b/engine/docker/dev-multinode/grafana/dashboards/tokio.json
index 45bd84de2a..e50028f6ff 100644
--- a/engine/docker/dev-multinode/grafana/dashboards/tokio.json
+++ b/engine/docker/dev-multinode/grafana/dashboards/tokio.json
@@ -93,9 +93,7 @@
"id": 24,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": false,
@@ -200,9 +198,7 @@
"id": 27,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": false,
@@ -418,9 +414,7 @@
"id": 26,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": false,
@@ -636,9 +630,7 @@
"id": 25,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": false,
@@ -743,9 +735,7 @@
"id": 28,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": false,
@@ -850,9 +840,7 @@
"id": 29,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": false,
@@ -968,12 +956,8 @@
},
{
"current": {
- "text": [
- "All"
- ],
- "value": [
- "$__all"
- ]
+ "text": ["All"],
+ "value": ["$__all"]
},
"datasource": {
"type": "grafana-clickhouse-datasource",
diff --git a/engine/docker/dev/grafana/dashboards/guard.json b/engine/docker/dev/grafana/dashboards/guard.json
index b4d37655bc..722321a813 100644
--- a/engine/docker/dev/grafana/dashboards/guard.json
+++ b/engine/docker/dev/grafana/dashboards/guard.json
@@ -92,9 +92,7 @@
"id": 10,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
@@ -198,9 +196,7 @@
"id": 11,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
@@ -304,9 +300,7 @@
"id": 12,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
@@ -410,9 +404,7 @@
"id": 2,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
@@ -517,9 +509,7 @@
"id": 5,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
@@ -727,9 +717,7 @@
"id": 7,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
@@ -834,9 +822,7 @@
"id": 8,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
diff --git a/engine/docker/dev/grafana/dashboards/tokio.json b/engine/docker/dev/grafana/dashboards/tokio.json
index 45bd84de2a..e50028f6ff 100644
--- a/engine/docker/dev/grafana/dashboards/tokio.json
+++ b/engine/docker/dev/grafana/dashboards/tokio.json
@@ -93,9 +93,7 @@
"id": 24,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": false,
@@ -200,9 +198,7 @@
"id": 27,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": false,
@@ -418,9 +414,7 @@
"id": 26,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": false,
@@ -636,9 +630,7 @@
"id": 25,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": false,
@@ -743,9 +735,7 @@
"id": 28,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": false,
@@ -850,9 +840,7 @@
"id": 29,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": false,
@@ -968,12 +956,8 @@
},
{
"current": {
- "text": [
- "All"
- ],
- "value": [
- "$__all"
- ]
+ "text": ["All"],
+ "value": ["$__all"]
},
"datasource": {
"type": "grafana-clickhouse-datasource",
diff --git a/engine/docker/template/grafana-dashboards/guard.json b/engine/docker/template/grafana-dashboards/guard.json
index b4d37655bc..722321a813 100644
--- a/engine/docker/template/grafana-dashboards/guard.json
+++ b/engine/docker/template/grafana-dashboards/guard.json
@@ -92,9 +92,7 @@
"id": 10,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
@@ -198,9 +196,7 @@
"id": 11,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
@@ -304,9 +300,7 @@
"id": 12,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
@@ -410,9 +404,7 @@
"id": 2,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
@@ -517,9 +509,7 @@
"id": 5,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
@@ -727,9 +717,7 @@
"id": 7,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
@@ -834,9 +822,7 @@
"id": 8,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
diff --git a/engine/docker/template/grafana-dashboards/tokio.json b/engine/docker/template/grafana-dashboards/tokio.json
index 45bd84de2a..e50028f6ff 100644
--- a/engine/docker/template/grafana-dashboards/tokio.json
+++ b/engine/docker/template/grafana-dashboards/tokio.json
@@ -93,9 +93,7 @@
"id": 24,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": false,
@@ -200,9 +198,7 @@
"id": 27,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": false,
@@ -418,9 +414,7 @@
"id": 26,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": false,
@@ -636,9 +630,7 @@
"id": 25,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": false,
@@ -743,9 +735,7 @@
"id": 28,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": false,
@@ -850,9 +840,7 @@
"id": 29,
"options": {
"legend": {
- "calcs": [
- "lastNotNull"
- ],
+ "calcs": ["lastNotNull"],
"displayMode": "table",
"placement": "bottom",
"showLegend": false,
@@ -968,12 +956,8 @@
},
{
"current": {
- "text": [
- "All"
- ],
- "value": [
- "$__all"
- ]
+ "text": ["All"],
+ "value": ["$__all"]
},
"datasource": {
"type": "grafana-clickhouse-datasource",
diff --git a/engine/docker/template/src/context.ts b/engine/docker/template/src/context.ts
index af44bc591e..bd3a47bcd5 100644
--- a/engine/docker/template/src/context.ts
+++ b/engine/docker/template/src/context.ts
@@ -16,7 +16,9 @@ export class TemplateContext {
}
getDatacenter(dcId: string) {
- const datacenter = this.config.datacenters.find((dc) => dc.name === dcId);
+ const datacenter = this.config.datacenters.find(
+ (dc) => dc.name === dcId,
+ );
if (!datacenter)
throw new Error(`Datacenter ${dcId} not found in configuration`);
return datacenter;
@@ -76,7 +78,11 @@ export class TemplateContext {
content: string,
nodeIndex?: number,
) {
- const basePath = this.getDatacenterServicePath(service, dcId, nodeIndex);
+ const basePath = this.getDatacenterServicePath(
+ service,
+ dcId,
+ nodeIndex,
+ );
const filePath = `${basePath}/${fileName}`;
this.writeFile(filePath, content);
}
@@ -87,7 +93,11 @@ export class TemplateContext {
fileName: string,
nodeIndex?: number,
) {
- const basePath = this.getDatacenterServicePath(service, dcId, nodeIndex);
+ const basePath = this.getDatacenterServicePath(
+ service,
+ dcId,
+ nodeIndex,
+ );
const filePath = `${basePath}/${fileName}`;
const fullPath = path.join(this.outputDir, filePath);
diff --git a/engine/docker/template/src/docker-compose.ts b/engine/docker/template/src/docker-compose.ts
index 2e9e3d839e..e866e9133d 100644
--- a/engine/docker/template/src/docker-compose.ts
+++ b/engine/docker/template/src/docker-compose.ts
@@ -1,364 +1,370 @@
-import { CORE_NETWORK_NAME, TemplateContext } from "./context";
import * as yaml from "js-yaml";
+import { CORE_NETWORK_NAME, type TemplateContext } from "./context";
export function generateDockerCompose(context: TemplateContext) {
- const config = context.config;
+ const config = context.config;
- // Services configuration
- const services: Record = {};
- const networks: Record = {};
- const volumes: Record = {};
+ // Services configuration
+ const services: Record = {};
+ const networks: Record = {};
+ const volumes: Record = {};
- const allDcEnginePeerNetworkNames = config.datacenters.map(
- (datacenter) =>
- `${context.getDatacenterNetworkName(datacenter.name)}-engine-peer`,
- );
- const allDcToCoreNetworkNames = config.datacenters.map(
- (datacenter) =>
- `${context.getDatacenterNetworkName(datacenter.name)}-to-core`,
- );
+ const allDcEnginePeerNetworkNames = config.datacenters.map(
+ (datacenter) =>
+ `${context.getDatacenterNetworkName(datacenter.name)}-engine-peer`,
+ );
+ const allDcToCoreNetworkNames = config.datacenters.map(
+ (datacenter) =>
+ `${context.getDatacenterNetworkName(datacenter.name)}-to-core`,
+ );
- // Core services
- networks[CORE_NETWORK_NAME] = {
- driver: "bridge",
- };
+ // Core services
+ networks[CORE_NETWORK_NAME] = {
+ driver: "bridge",
+ };
- // ClickHouse
- services["clickhouse"] = {
- restart: "unless-stopped",
- image: "clickhouse/clickhouse-server:25.1.5",
- volumes: [
- "clickhouse-data:/var/lib/clickhouse",
- `./${context.getCoreServicePath("clickhouse")}/config.xml:/etc/clickhouse-server/config.d/config.xml`,
- `./${context.getCoreServicePath("clickhouse")}/users.xml:/etc/clickhouse-server/users.d/users.xml`,
- `./${context.getCoreServicePath("clickhouse")}/client-config.xml:/etc/clickhouse-client/config.xml`,
- `./${context.getCoreServicePath("clickhouse")}/init:/docker-entrypoint-initdb.d`,
- ],
- environment: [
- //Run migrations on startup
- "CLICKHOUSE_ALWAYS_RUN_INITDB_SCRIPTS=true",
- "CLICKHOUSE_USER=default",
- "CLICKHOUSE_PASSWORD=default",
- "CLICKHOUSE_HTTP_PORT=9300",
- "CLICKHOUSE_TCP_PORT=9301",
- ],
- networks: [...allDcToCoreNetworkNames, CORE_NETWORK_NAME],
- healthcheck: {
- test: [
- "CMD",
- "clickhouse-client",
- "--host",
- "127.0.0.1",
- "--port",
- "9301",
- "--user",
- "system",
- "--password",
- "default",
- "--query",
- "SELECT 1",
- ],
- interval: "2s",
- timeout: "10s",
- retries: 10,
- },
- };
- volumes["clickhouse-data"] = null;
+ // ClickHouse
+ services["clickhouse"] = {
+ restart: "unless-stopped",
+ image: "clickhouse/clickhouse-server:25.1.5",
+ volumes: [
+ "clickhouse-data:/var/lib/clickhouse",
+ `./${context.getCoreServicePath("clickhouse")}/config.xml:/etc/clickhouse-server/config.d/config.xml`,
+ `./${context.getCoreServicePath("clickhouse")}/users.xml:/etc/clickhouse-server/users.d/users.xml`,
+ `./${context.getCoreServicePath("clickhouse")}/client-config.xml:/etc/clickhouse-client/config.xml`,
+ `./${context.getCoreServicePath("clickhouse")}/init:/docker-entrypoint-initdb.d`,
+ ],
+ environment: [
+ //Run migrations on startup
+ "CLICKHOUSE_ALWAYS_RUN_INITDB_SCRIPTS=true",
+ "CLICKHOUSE_USER=default",
+ "CLICKHOUSE_PASSWORD=default",
+ "CLICKHOUSE_HTTP_PORT=9300",
+ "CLICKHOUSE_TCP_PORT=9301",
+ ],
+ networks: [...allDcToCoreNetworkNames, CORE_NETWORK_NAME],
+ healthcheck: {
+ test: [
+ "CMD",
+ "clickhouse-client",
+ "--host",
+ "127.0.0.1",
+ "--port",
+ "9301",
+ "--user",
+ "system",
+ "--password",
+ "default",
+ "--query",
+ "SELECT 1",
+ ],
+ interval: "2s",
+ timeout: "10s",
+ retries: 10,
+ },
+ };
+ volumes["clickhouse-data"] = null;
- // Grafana
- services["grafana"] = {
- image: "grafana/grafana:11.5.2",
- volumes: [
- "grafana-data:/var/lib/grafana",
- `./${context.getCoreServicePath("grafana")}/grafana.ini:/etc/grafana/grafana.ini`,
- `./${context.getCoreServicePath("grafana")}/provisioning:/etc/grafana/provisioning`,
- `./${context.getCoreServicePath("grafana")}/dashboards:/var/lib/grafana/dashboards`,
- ],
- environment: ["GF_INSTALL_PLUGINS=grafana-clickhouse-datasource"],
- ports: ["3100:3000"],
- networks: [CORE_NETWORK_NAME],
- depends_on: {
- clickhouse: { condition: "service_healthy" },
- },
- };
- volumes["grafana-data"] = null;
+ // Grafana
+ services["grafana"] = {
+ image: "grafana/grafana:11.5.2",
+ volumes: [
+ "grafana-data:/var/lib/grafana",
+ `./${context.getCoreServicePath("grafana")}/grafana.ini:/etc/grafana/grafana.ini`,
+ `./${context.getCoreServicePath("grafana")}/provisioning:/etc/grafana/provisioning`,
+ `./${context.getCoreServicePath("grafana")}/dashboards:/var/lib/grafana/dashboards`,
+ ],
+ environment: ["GF_INSTALL_PLUGINS=grafana-clickhouse-datasource"],
+ ports: ["3100:3000"],
+ networks: [CORE_NETWORK_NAME],
+ depends_on: {
+ clickhouse: { condition: "service_healthy" },
+ },
+ };
+ volumes["grafana-data"] = null;
- // Generate services for each datacenter
- config.datacenters.forEach((datacenter, idx) => {
- const isPrimary = idx === 0;
+ // Generate services for each datacenter
+ config.datacenters.forEach((datacenter, idx) => {
+ const isPrimary = idx === 0;
- const dcNetworkName = context.getDatacenterNetworkName(datacenter.name);
- const dcEnginePeerNetworkName = `${dcNetworkName}-engine-peer`;
- const dcToCoreNetworkName = `${dcNetworkName}-to-core`;
+ const dcNetworkName = context.getDatacenterNetworkName(datacenter.name);
+ const dcEnginePeerNetworkName = `${dcNetworkName}-engine-peer`;
+ const dcToCoreNetworkName = `${dcNetworkName}-to-core`;
- //const natsServiceName = context.getServiceName("nats", datacenter.name);
- const vectorServerServiceName = context.getServiceName(
- "vector-server",
- datacenter.name,
- );
- const vectorClientServiceName = context.getServiceName(
- "vector-client",
- datacenter.name,
- );
- const otelCollectorServerServiceName = context.getServiceName(
- "otel-collector-server",
- datacenter.name,
- );
- const otelCollectorClientServiceName = context.getServiceName(
- "otel-collector-client",
- datacenter.name,
- );
- const postgresServiceName = context.getServiceName(
- "postgres",
- datacenter.name,
- );
- const shellServiceName = context.getServiceName(
- "rivet-shell",
- datacenter.name,
- );
+ //const natsServiceName = context.getServiceName("nats", datacenter.name);
+ const vectorServerServiceName = context.getServiceName(
+ "vector-server",
+ datacenter.name,
+ );
+ const vectorClientServiceName = context.getServiceName(
+ "vector-client",
+ datacenter.name,
+ );
+ const otelCollectorServerServiceName = context.getServiceName(
+ "otel-collector-server",
+ datacenter.name,
+ );
+ const otelCollectorClientServiceName = context.getServiceName(
+ "otel-collector-client",
+ datacenter.name,
+ );
+ const postgresServiceName = context.getServiceName(
+ "postgres",
+ datacenter.name,
+ );
+ const shellServiceName = context.getServiceName(
+ "rivet-shell",
+ datacenter.name,
+ );
- networks[dcNetworkName] = {
- driver: "bridge",
- };
+ networks[dcNetworkName] = {
+ driver: "bridge",
+ };
- networks[dcEnginePeerNetworkName] = {
- driver: "bridge",
- };
+ networks[dcEnginePeerNetworkName] = {
+ driver: "bridge",
+ };
- networks[dcToCoreNetworkName] = {
- driver: "bridge",
- };
+ networks[dcToCoreNetworkName] = {
+ driver: "bridge",
+ };
- //services[natsServiceName] = {
- // restart: "unless-stopped",
- // image: "nats:2.10.22-scratch",
- // networks: [dcNetworkName],
- // ports: isPrimary ? [`4222:4222`] : undefined,
- // healthcheck: {
- // test: ["CMD", "nats-server", "--health"],
- // interval: "2s",
- // timeout: "10s",
- // retries: 10,
- // },
- //};
+ //services[natsServiceName] = {
+ // restart: "unless-stopped",
+ // image: "nats:2.10.22-scratch",
+ // networks: [dcNetworkName],
+ // ports: isPrimary ? [`4222:4222`] : undefined,
+ // healthcheck: {
+ // test: ["CMD", "nats-server", "--health"],
+ // interval: "2s",
+ // timeout: "10s",
+ // retries: 10,
+ // },
+ //};
- const postgresVolumeName = context.getVolumeName(
- "postgres",
- datacenter.name,
- );
- services[postgresServiceName] = {
- restart: "unless-stopped",
- image: "postgres:17-alpine",
- environment: [
- "POSTGRES_USER=postgres",
- "POSTGRES_PASSWORD=postgres",
- "POSTGRES_DB=postgres",
- ],
- volumes: [
- `./${context.getDatacenterServicePath("postgres", datacenter.name)}/init-db.sh:/docker-entrypoint-initdb.d/init-db.sh`,
- `${postgresVolumeName}:/var/lib/postgresql/data`,
- ],
- ports: isPrimary ? [`5432:5432`] : undefined,
- healthcheck: {
- test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"],
- interval: "2s",
- timeout: "10s",
- retries: 10,
- },
- networks: [dcNetworkName],
- };
- volumes[postgresVolumeName] = null;
+ const postgresVolumeName = context.getVolumeName(
+ "postgres",
+ datacenter.name,
+ );
+ services[postgresServiceName] = {
+ restart: "unless-stopped",
+ image: "postgres:17-alpine",
+ environment: [
+ "POSTGRES_USER=postgres",
+ "POSTGRES_PASSWORD=postgres",
+ "POSTGRES_DB=postgres",
+ ],
+ volumes: [
+ `./${context.getDatacenterServicePath("postgres", datacenter.name)}/init-db.sh:/docker-entrypoint-initdb.d/init-db.sh`,
+ `${postgresVolumeName}:/var/lib/postgresql/data`,
+ ],
+ ports: isPrimary ? [`5432:5432`] : undefined,
+ healthcheck: {
+ test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"],
+ interval: "2s",
+ timeout: "10s",
+ retries: 10,
+ },
+ networks: [dcNetworkName],
+ };
+ volumes[postgresVolumeName] = null;
- services[shellServiceName] = {
- build: {
- context: "../..",
- dockerfile: "docker/universal/Dockerfile",
- target: "engine-full",
- args: {
- BUILD_FRONTEND: "true"
- }
- },
- platform: "linux/amd64",
- restart: "unless-stopped",
- command: "sleep infinity",
- stop_grace_period: "0s",
- depends_on: {
- //[natsServiceName]: { condition: "service_healthy" },
- [postgresServiceName]: { condition: "service_healthy" },
- },
- volumes: [
- `./${context.getDatacenterServicePath("rivet-engine", datacenter.name, 0)}/config.jsonc:/etc/rivet/config.jsonc:ro`,
- ],
- networks: [
- dcNetworkName,
- dcToCoreNetworkName,
- ...allDcEnginePeerNetworkNames,
- ],
- };
+ services[shellServiceName] = {
+ build: {
+ context: "../..",
+ dockerfile: "docker/universal/Dockerfile",
+ target: "engine-full",
+ args: {
+ BUILD_FRONTEND: "true",
+ },
+ },
+ platform: "linux/amd64",
+ restart: "unless-stopped",
+ command: "sleep infinity",
+ stop_grace_period: "0s",
+ depends_on: {
+ //[natsServiceName]: { condition: "service_healthy" },
+ [postgresServiceName]: { condition: "service_healthy" },
+ },
+ volumes: [
+ `./${context.getDatacenterServicePath("rivet-engine", datacenter.name, 0)}/config.jsonc:/etc/rivet/config.jsonc:ro`,
+ ],
+ networks: [
+ dcNetworkName,
+ dcToCoreNetworkName,
+ ...allDcEnginePeerNetworkNames,
+ ],
+ };
- services[vectorServerServiceName] = {
- restart: "unless-stopped",
- image: "timberio/vector:0.48.0-distroless-static",
- command: "-C /etc/vector",
- volumes: [
- `vector-server-data-${datacenter.name}:/var/lib/vector`,
- `./${context.getDatacenterServicePath("vector-server", datacenter.name)}:/etc/vector`,
- ],
- networks: [dcNetworkName, dcToCoreNetworkName],
- depends_on: {
- clickhouse: { condition: "service_healthy" },
- },
- };
- volumes[`vector-server-data-${datacenter.name}`] = null;
+ services[vectorServerServiceName] = {
+ restart: "unless-stopped",
+ image: "timberio/vector:0.48.0-distroless-static",
+ command: "-C /etc/vector",
+ volumes: [
+ `vector-server-data-${datacenter.name}:/var/lib/vector`,
+ `./${context.getDatacenterServicePath("vector-server", datacenter.name)}:/etc/vector`,
+ ],
+ networks: [dcNetworkName, dcToCoreNetworkName],
+ depends_on: {
+ clickhouse: { condition: "service_healthy" },
+ },
+ };
+ volumes[`vector-server-data-${datacenter.name}`] = null;
- services[vectorClientServiceName] = {
- restart: "unless-stopped",
- image: "timberio/vector:0.48.0-distroless-static",
- command: "-C /etc/vector",
- volumes: [
- `vector-client-data-${datacenter.name}:/var/lib/vector`,
- `./${context.getDatacenterServicePath("vector-client", datacenter.name)}:/etc/vector`,
- ],
- networks: [dcNetworkName],
- depends_on: {
- [vectorServerServiceName]: { condition: "service_started" },
- },
- };
- volumes[`vector-client-data-${datacenter.name}`] = null;
+ services[vectorClientServiceName] = {
+ restart: "unless-stopped",
+ image: "timberio/vector:0.48.0-distroless-static",
+ command: "-C /etc/vector",
+ volumes: [
+ `vector-client-data-${datacenter.name}:/var/lib/vector`,
+ `./${context.getDatacenterServicePath("vector-client", datacenter.name)}:/etc/vector`,
+ ],
+ networks: [dcNetworkName],
+ depends_on: {
+ [vectorServerServiceName]: { condition: "service_started" },
+ },
+ };
+ volumes[`vector-client-data-${datacenter.name}`] = null;
- services[otelCollectorServerServiceName] = {
- image: "otel/opentelemetry-collector-contrib:latest",
- restart: "unless-stopped",
- command: "--config=/etc/otel/config.yaml",
- volumes: [
- `./${context.getDatacenterServicePath("otel-collector-server", datacenter.name)}/config.yaml:/etc/otel/config.yaml:ro`,
- ],
- environment: ["CLICKHOUSE_PASSWORD=default"],
- depends_on: {
- clickhouse: { condition: "service_healthy" },
- },
- networks: [dcNetworkName, dcToCoreNetworkName],
- };
+ services[otelCollectorServerServiceName] = {
+ image: "otel/opentelemetry-collector-contrib:latest",
+ restart: "unless-stopped",
+ command: "--config=/etc/otel/config.yaml",
+ volumes: [
+ `./${context.getDatacenterServicePath("otel-collector-server", datacenter.name)}/config.yaml:/etc/otel/config.yaml:ro`,
+ ],
+ environment: ["CLICKHOUSE_PASSWORD=default"],
+ depends_on: {
+ clickhouse: { condition: "service_healthy" },
+ },
+ networks: [dcNetworkName, dcToCoreNetworkName],
+ };
- services[otelCollectorClientServiceName] = {
- image: "otel/opentelemetry-collector-contrib:latest",
- restart: "unless-stopped",
- command: "--config=/etc/otel/config.yaml",
- volumes: [
- `./${context.getDatacenterServicePath("otel-collector-client", datacenter.name)}/config.yaml:/etc/otel/config.yaml:ro`,
- ],
- depends_on: {
- [otelCollectorServerServiceName]: { condition: "service_started" },
- },
- networks: [dcNetworkName],
- };
+ services[otelCollectorClientServiceName] = {
+ image: "otel/opentelemetry-collector-contrib:latest",
+ restart: "unless-stopped",
+ command: "--config=/etc/otel/config.yaml",
+ volumes: [
+ `./${context.getDatacenterServicePath("otel-collector-client", datacenter.name)}/config.yaml:/etc/otel/config.yaml:ro`,
+ ],
+ depends_on: {
+ [otelCollectorServerServiceName]: {
+ condition: "service_started",
+ },
+ },
+ networks: [dcNetworkName],
+ };
- for (let i = 0; i < datacenter.engines; i++) {
- const serviceName = context.getServiceName(
- "rivet-engine",
- datacenter.name,
- i,
- );
+ for (let i = 0; i < datacenter.engines; i++) {
+ const serviceName = context.getServiceName(
+ "rivet-engine",
+ datacenter.name,
+ i,
+ );
- services[serviceName] = {
- build: {
- context: "../..",
- dockerfile: "docker/universal/Dockerfile",
- target: "engine-full",
- args: {
- BUILD_FRONTEND: "true"
- }
- },
- platform: "linux/amd64",
- restart: "unless-stopped",
- environment: [
- "RUST_LOG_ANSI_COLOR=1",
- "RIVET_OTEL_ENABLED=1",
- "RIVET_OTEL_SAMPLER_RATIO=1",
- `RIVET_OTEL_GRPC_ENDPOINT=http://${context.getServiceHost("otel-collector-client", datacenter.name)}:4317`,
- // "RUST_LOG=debug,hyper=info",
- ],
- stop_grace_period: "0s",
- depends_on: {
- //[natsServiceName]: { condition: "service_healthy" },
- [vectorClientServiceName]: {
- condition: "service_started",
- },
- [otelCollectorClientServiceName]: {
- condition: "service_started",
- },
- [postgresServiceName]: { condition: "service_healthy" },
- },
- volumes: [
- `./${context.getDatacenterServicePath("rivet-engine", datacenter.name, i)}/config.jsonc:/etc/rivet/config.jsonc:ro`,
- ],
- networks: [
- dcNetworkName,
- dcToCoreNetworkName,
- ...allDcEnginePeerNetworkNames,
- ],
- ports: isPrimary && i === 0 ? [`6420:6420`] : undefined,
- healthcheck: {
- test: ["CMD", "curl", "-f", "http://127.0.0.1:6420/health"],
- interval: "2s",
- timeout: "10s",
- retries: 10,
- start_period: "30s",
- },
- };
- }
+ services[serviceName] = {
+ build: {
+ context: "../..",
+ dockerfile: "docker/universal/Dockerfile",
+ target: "engine-full",
+ args: {
+ BUILD_FRONTEND: "true",
+ },
+ },
+ platform: "linux/amd64",
+ restart: "unless-stopped",
+ environment: [
+ "RUST_LOG_ANSI_COLOR=1",
+ "RIVET_OTEL_ENABLED=1",
+ "RIVET_OTEL_SAMPLER_RATIO=1",
+ `RIVET_OTEL_GRPC_ENDPOINT=http://${context.getServiceHost("otel-collector-client", datacenter.name)}:4317`,
+ // "RUST_LOG=debug,hyper=info",
+ ],
+ stop_grace_period: "0s",
+ depends_on: {
+ //[natsServiceName]: { condition: "service_healthy" },
+ [vectorClientServiceName]: {
+ condition: "service_started",
+ },
+ [otelCollectorClientServiceName]: {
+ condition: "service_started",
+ },
+ [postgresServiceName]: { condition: "service_healthy" },
+ },
+ volumes: [
+ `./${context.getDatacenterServicePath("rivet-engine", datacenter.name, i)}/config.jsonc:/etc/rivet/config.jsonc:ro`,
+ ],
+ networks: [
+ dcNetworkName,
+ dcToCoreNetworkName,
+ ...allDcEnginePeerNetworkNames,
+ ],
+ ports: isPrimary && i === 0 ? [`6420:6420`] : undefined,
+ healthcheck: {
+ test: ["CMD", "curl", "-f", "http://127.0.0.1:6420/health"],
+ interval: "2s",
+ timeout: "10s",
+ retries: 10,
+ start_period: "30s",
+ },
+ };
+ }
- for (let i = 0; i < datacenter.runners; i++) {
- const serviceName = context.getServiceName("runner", datacenter.name, i);
- const engineServiceName = context.getServiceName(
- "rivet-engine",
- datacenter.name,
- 0,
- );
+ for (let i = 0; i < datacenter.runners; i++) {
+ const serviceName = context.getServiceName(
+ "runner",
+ datacenter.name,
+ i,
+ );
+ const engineServiceName = context.getServiceName(
+ "rivet-engine",
+ datacenter.name,
+ 0,
+ );
- services[serviceName] = {
- build: {
- context: "../..",
- dockerfile: "sdks/typescript/test-runner/Dockerfile",
- },
- platform: "linux/amd64",
- restart: "unless-stopped",
- environment: [
- `RIVET_ENDPOINT=http://${context.getServiceHost("rivet-engine", datacenter.name, 0)}:6420`,
- `RIVET_RUNNER_TOTAL_SLOTS=1000000`,
- ],
- stop_grace_period: "4s",
- ports: isPrimary && i === 0 ? [`5050:5050`] : undefined,
- depends_on: {
- [engineServiceName]: {
- condition: "service_healthy",
- },
- },
- networks: [dcNetworkName],
- };
- }
- });
+ services[serviceName] = {
+ build: {
+ context: "../..",
+ dockerfile: "sdks/typescript/test-runner/Dockerfile",
+ },
+ platform: "linux/amd64",
+ restart: "unless-stopped",
+ environment: [
+ `RIVET_ENDPOINT=http://${context.getServiceHost("rivet-engine", datacenter.name, 0)}:6420`,
+ `RIVET_RUNNER_TOTAL_SLOTS=1000000`,
+ ],
+ stop_grace_period: "4s",
+ ports: isPrimary && i === 0 ? [`5050:5050`] : undefined,
+ depends_on: {
+ [engineServiceName]: {
+ condition: "service_healthy",
+ },
+ },
+ networks: [dcNetworkName],
+ };
+ }
+ });
- const dockerComposeConfig = {
- services,
- networks,
- volumes,
- };
+ const dockerComposeConfig = {
+ services,
+ networks,
+ volumes,
+ };
- // If host networking is requested, set network_mode for all services
- if (context.config.networkMode === "host") {
- for (const svc of Object.values(dockerComposeConfig.services)) {
- // @ts-ignore - mutate dynamic service objects
- svc.network_mode = "host";
- // Remove networks field as it's incompatible with host networking
- // @ts-ignore
- if (svc.networks) delete svc.networks;
- // Remove ports since published ports are ignored with host networking
- // and produce warnings in Docker Compose output.
- // @ts-ignore
- if (svc.ports) delete svc.ports;
- }
- }
+ // If host networking is requested, set network_mode for all services
+ if (context.config.networkMode === "host") {
+ for (const svc of Object.values(dockerComposeConfig.services)) {
+ // @ts-expect-error - mutate dynamic service objects
+ svc.network_mode = "host";
+ // Remove networks field as it's incompatible with host networking
+ // @ts-expect-error
+ if (svc.networks) delete svc.networks;
+ // Remove ports since published ports are ignored with host networking
+ // and produce warnings in Docker Compose output.
+ // @ts-expect-error
+ if (svc.ports) delete svc.ports;
+ }
+ }
- context.writeFile("docker-compose.yml", yaml.dump(dockerComposeConfig));
+ context.writeFile("docker-compose.yml", yaml.dump(dockerComposeConfig));
}
diff --git a/engine/docker/template/src/git.ts b/engine/docker/template/src/git.ts
index 23adde95ea..1409d944b7 100644
--- a/engine/docker/template/src/git.ts
+++ b/engine/docker/template/src/git.ts
@@ -1,4 +1,4 @@
-import { TemplateContext } from "./context";
+import type { TemplateContext } from "./context";
export function generateGitAttributes(context: TemplateContext) {
const gitAttributesContent = `. linguist-generated=true
@@ -6,4 +6,3 @@ export function generateGitAttributes(context: TemplateContext) {
context.writeFile(".gitattributes", gitAttributesContent);
}
-
diff --git a/engine/docker/template/src/main.ts b/engine/docker/template/src/main.ts
index 8500662415..2c7dcef0eb 100644
--- a/engine/docker/template/src/main.ts
+++ b/engine/docker/template/src/main.ts
@@ -2,21 +2,20 @@
import * as fs from "fs";
import * as path from "path";
-
+import { TEMPLATES, type TemplateConfig } from "./config";
+import { TemplateContext } from "./context";
+import { generateDockerCompose } from "./docker-compose";
+import { generateGitAttributes } from "./git";
+import { generateReadme } from "./readme";
import { generateCoreClickhouse } from "./services/core/clickhouse";
-import { generateDatacenterVectorServer } from "./services/edge/vector-server";
-import { generateDatacenterOtelCollectorServer } from "./services/edge/otel-collector-server";
import { generateCoreGrafana } from "./services/core/grafana";
-import { generateDatacenterVectorClient } from "./services/edge/vector-client";
import { generateDatacenterOtelCollectorClient } from "./services/edge/otel-collector-client";
+import { generateDatacenterOtelCollectorServer } from "./services/edge/otel-collector-server";
import { generateDatacenterPostgres } from "./services/edge/postgres";
import { generateDatacenterRivetEngine } from "./services/edge/rivet-engine";
import { generateRunner } from "./services/edge/runner";
-import { generateDockerCompose } from "./docker-compose";
-import { generateReadme } from "./readme";
-import { generateGitAttributes } from "./git";
-import { TEMPLATES, type TemplateConfig } from "./config";
-import { TemplateContext } from "./context";
+import { generateDatacenterVectorClient } from "./services/edge/vector-client";
+import { generateDatacenterVectorServer } from "./services/edge/vector-server";
function generateTemplate(templateName: string, config: TemplateConfig) {
const outputDir = path.join(__dirname, "../../", templateName);
diff --git a/engine/docker/template/src/readme.ts b/engine/docker/template/src/readme.ts
index 7184b33499..802ba05c65 100644
--- a/engine/docker/template/src/readme.ts
+++ b/engine/docker/template/src/readme.ts
@@ -1,20 +1,20 @@
-import { TemplateContext } from "./context";
+import type { TemplateContext } from "./context";
export function generateReadme(context: TemplateContext, templateName: string) {
- const config = context.config;
+ const config = context.config;
- const ports = {
- rivetEngineGuard: 6420,
- runner: 5050,
- //nats: 4222,
- postgres: 5432,
- clickhouseHttp: 9300,
- clickhouseNative: 9301,
- otelGrpc: 4317,
- otelHttp: 4318,
- };
+ const ports = {
+ rivetEngineGuard: 6420,
+ runner: 5050,
+ //nats: 4222,
+ postgres: 5432,
+ clickhouseHttp: 9300,
+ clickhouseNative: 9301,
+ otelGrpc: 4317,
+ otelHttp: 4318,
+ };
- const readmeContent = `# ${templateName} - Auto-generated Docker Compose Template
+ const readmeContent = `# ${templateName} - Auto-generated Docker Compose Template
> ! **Auto-generated**: This directory and its contents are automatically generated by \`docker/template/\`. Do not edit these files directly as your changes will be overwritten.
@@ -83,16 +83,16 @@ This template generates the following files and directories:
- \`otel-collector-server/\` - OpenTelemetry Collector server configuration
- \`datacenters/\` - Datacenter-specific configurations:
${config.datacenters
- .map(
- (dc) => ` - \`${dc.id}/\` - Configuration for datacenter ${dc.id}:
+ .map(
+ (dc) => ` - \`${dc.id}/\` - Configuration for datacenter ${dc.id}:
- \`postgres/\` - PostgreSQL setup scripts
- \`rivet-engine/\` - Rivet Engine configuration
- \`vector-client/\` - Vector client configuration
- \`otel-collector-client/\` - OpenTelemetry Collector client configuration`,
- )
- .join("\n")}
+ )
+ .join("\n")}
- \`README.md\` - This file
`;
- context.writeFile("README.md", readmeContent);
+ context.writeFile("README.md", readmeContent);
}
diff --git a/engine/docker/template/src/services/core/clickhouse.ts b/engine/docker/template/src/services/core/clickhouse.ts
index f4da3c3b0d..2043933f72 100644
--- a/engine/docker/template/src/services/core/clickhouse.ts
+++ b/engine/docker/template/src/services/core/clickhouse.ts
@@ -1,4 +1,4 @@
-import { TemplateContext } from "../../context";
+import type { TemplateContext } from "../../context";
export function generateCoreClickhouse(context: TemplateContext) {
// ClickHouse configuration
@@ -210,6 +210,14 @@ SETTINGS index_granularity = 8192, ttl_only_drop_parts = 1;
context.writeCoreServiceFile("clickhouse", "config.xml", configXml);
context.writeCoreServiceFile("clickhouse", "users.xml", usersXml);
- context.writeCoreServiceFile("clickhouse", "client-config.xml", clientConfigXml);
- context.writeCoreServiceFile("clickhouse", "init/01-create-otel-table.sql", initSql);
-}
\ No newline at end of file
+ context.writeCoreServiceFile(
+ "clickhouse",
+ "client-config.xml",
+ clientConfigXml,
+ );
+ context.writeCoreServiceFile(
+ "clickhouse",
+ "init/01-create-otel-table.sql",
+ initSql,
+ );
+}
diff --git a/engine/docker/template/src/services/core/grafana.ts b/engine/docker/template/src/services/core/grafana.ts
index 607cb7bff3..76a7d2f021 100644
--- a/engine/docker/template/src/services/core/grafana.ts
+++ b/engine/docker/template/src/services/core/grafana.ts
@@ -1,10 +1,11 @@
-import { TemplateContext } from "../../context";
import * as fs from "fs";
-import * as path from "path";
import * as yaml from "js-yaml";
+import * as path from "path";
+import type { TemplateContext } from "../../context";
export function generateCoreGrafana(context: TemplateContext) {
- const clickhouseHost = context.config.networkMode === "host" ? "127.0.0.1" : "clickhouse";
+ const clickhouseHost =
+ context.config.networkMode === "host" ? "127.0.0.1" : "clickhouse";
// Grafana configuration
const grafanaIni = `[server]
http_port = 3000
@@ -32,7 +33,7 @@ default_home_dashboard_path = /var/lib/grafana/dashboards/api.json
type: "grafana-clickhouse-datasource",
access: "proxy",
secureJsonData: {
- password: "default"
+ password: "default",
},
jsonData: {
version: "2.0.0",
@@ -50,17 +51,17 @@ default_home_dashboard_path = /var/lib/grafana/dashboards/api.json
defaultTable: "otel_logs",
timeColumn: "TimestampTime",
messageColumn: "Body",
- levelColumn: "SeverityText"
+ levelColumn: "SeverityText",
},
traces: {
otelEnabled: true,
otelVersion: "1.2.9",
defaultDatabase: "otel",
- defaultTable: "otel_traces"
- }
- }
- }
- ]
+ defaultTable: "otel_traces",
+ },
+ },
+ },
+ ],
};
// Dashboard provisioning configuration
@@ -75,25 +76,40 @@ default_home_dashboard_path = /var/lib/grafana/dashboards/api.json
disableDeletion: false,
updateIntervalSeconds: 10,
options: {
- path: "/var/lib/grafana/dashboards"
- }
- }
- ]
+ path: "/var/lib/grafana/dashboards",
+ },
+ },
+ ],
};
// Write configuration files
context.writeCoreServiceFile("grafana", "grafana.ini", grafanaIni);
- context.writeCoreServiceFile("grafana", "provisioning/datasources/datasources.yaml", yaml.dump(datasourcesConfig));
- context.writeCoreServiceFile("grafana", "provisioning/dashboards/dashboards.yaml", yaml.dump(dashboardsConfig));
+ context.writeCoreServiceFile(
+ "grafana",
+ "provisioning/datasources/datasources.yaml",
+ yaml.dump(datasourcesConfig),
+ );
+ context.writeCoreServiceFile(
+ "grafana",
+ "provisioning/dashboards/dashboards.yaml",
+ yaml.dump(dashboardsConfig),
+ );
// Copy all dashboard files from the template directory
const dashboardsDir = path.join(__dirname, "../../../grafana-dashboards");
const dashboardFiles = fs.readdirSync(dashboardsDir);
- dashboardFiles.forEach(file => {
- if (file.endsWith('.json')) {
- const dashboardContent = fs.readFileSync(path.join(dashboardsDir, file), "utf-8");
- context.writeCoreServiceFile("grafana", `dashboards/${file}`, dashboardContent);
+ dashboardFiles.forEach((file) => {
+ if (file.endsWith(".json")) {
+ const dashboardContent = fs.readFileSync(
+ path.join(dashboardsDir, file),
+ "utf-8",
+ );
+ context.writeCoreServiceFile(
+ "grafana",
+ `dashboards/${file}`,
+ dashboardContent,
+ );
}
});
}
diff --git a/engine/docker/template/src/services/edge/otel-collector-client.ts b/engine/docker/template/src/services/edge/otel-collector-client.ts
index eadcca3e6b..236bef90fd 100644
--- a/engine/docker/template/src/services/edge/otel-collector-client.ts
+++ b/engine/docker/template/src/services/edge/otel-collector-client.ts
@@ -1,5 +1,5 @@
-import { TemplateContext } from "../../context";
import * as yaml from "js-yaml";
+import type { TemplateContext } from "../../context";
export function generateDatacenterOtelCollectorClient(
context: TemplateContext,
diff --git a/engine/docker/template/src/services/edge/otel-collector-server.ts b/engine/docker/template/src/services/edge/otel-collector-server.ts
index 9ff9e0b6b5..83d2afc1b6 100644
--- a/engine/docker/template/src/services/edge/otel-collector-server.ts
+++ b/engine/docker/template/src/services/edge/otel-collector-server.ts
@@ -1,23 +1,27 @@
-import { TemplateContext } from "../../context";
import * as yaml from "js-yaml";
+import type { TemplateContext } from "../../context";
-export function generateDatacenterOtelCollectorServer(context: TemplateContext, dcId: string) {
- const clickhouseHost = context.config.networkMode === "host" ? "127.0.0.1" : "clickhouse";
+export function generateDatacenterOtelCollectorServer(
+ context: TemplateContext,
+ dcId: string,
+) {
+ const clickhouseHost =
+ context.config.networkMode === "host" ? "127.0.0.1" : "clickhouse";
const otelConfig = {
receivers: {
otlp: {
protocols: {
grpc: {
- endpoint: "0.0.0.0:4317"
+ endpoint: "0.0.0.0:4317",
},
- }
+ },
},
},
processors: {
batch: {
timeout: "5s",
- send_batch_size: 10000
- }
+ send_batch_size: 10000,
+ },
},
exporters: {
clickhouse: {
@@ -34,51 +38,56 @@ export function generateDatacenterOtelCollectorServer(context: TemplateContext,
timeout: "5s",
metrics_tables: {
gauge: {
- name: "otel_metrics_gauge"
+ name: "otel_metrics_gauge",
},
sum: {
- name: "otel_metrics_sum"
+ name: "otel_metrics_sum",
},
summary: {
- name: "otel_metrics_summary"
+ name: "otel_metrics_summary",
},
histogram: {
- name: "otel_metrics_histogram"
+ name: "otel_metrics_histogram",
},
exponential_histogram: {
- name: "otel_metrics_exp_histogram"
- }
+ name: "otel_metrics_exp_histogram",
+ },
},
retry_on_failure: {
enabled: true,
initial_interval: "5s",
max_interval: "30s",
- max_elapsed_time: "300s"
- }
- }
+ max_elapsed_time: "300s",
+ },
+ },
},
service: {
pipelines: {
logs: {
receivers: ["otlp"],
processors: ["batch"],
- exporters: ["clickhouse"]
+ exporters: ["clickhouse"],
},
traces: {
receivers: ["otlp"],
processors: ["batch"],
- exporters: ["clickhouse"]
+ exporters: ["clickhouse"],
},
metrics: {
receivers: ["otlp"],
processors: ["batch"],
- exporters: ["clickhouse"]
- }
- }
- }
+ exporters: ["clickhouse"],
+ },
+ },
+ },
};
const yamlContent = yaml.dump(otelConfig);
- context.writeDatacenterServiceFile("otel-collector-server", dcId, "config.yaml", yamlContent);
+ context.writeDatacenterServiceFile(
+ "otel-collector-server",
+ dcId,
+ "config.yaml",
+ yamlContent,
+ );
}
diff --git a/engine/docker/template/src/services/edge/postgres.ts b/engine/docker/template/src/services/edge/postgres.ts
index 69cf16993a..1969a360c5 100644
--- a/engine/docker/template/src/services/edge/postgres.ts
+++ b/engine/docker/template/src/services/edge/postgres.ts
@@ -1,4 +1,4 @@
-import { TemplateContext } from "../../context";
+import type { TemplateContext } from "../../context";
export function generateDatacenterPostgres(
context: TemplateContext,
@@ -20,4 +20,4 @@ EOSQL
initScript,
);
context.makeDatabaseFileExec("postgres", dcId, "init-db.sh");
-}
\ No newline at end of file
+}
diff --git a/engine/docker/template/src/services/edge/rivet-engine.ts b/engine/docker/template/src/services/edge/rivet-engine.ts
index 83eee98f8c..b2c712fba9 100644
--- a/engine/docker/template/src/services/edge/rivet-engine.ts
+++ b/engine/docker/template/src/services/edge/rivet-engine.ts
@@ -1,5 +1,5 @@
-import { TemplateContext } from "../../context";
-import { Datacenter } from "../../config";
+import type { Datacenter } from "../../config";
+import type { TemplateContext } from "../../context";
const API_PEER_PORT = 6421;
const GUARD_PORT = 6420;
@@ -12,12 +12,12 @@ export function generateDatacenterRivetEngine(
context.config.networkMode === "host" ? "127.0.0.1" : "clickhouse";
const datacenters = [];
- for (let dc of context.config.datacenters) {
- let serviceHost = context.getServiceHost("rivet-engine", dc.name, 0);
+ for (const dc of context.config.datacenters) {
+ const serviceHost = context.getServiceHost("rivet-engine", dc.name, 0);
datacenters.push({
name: dc.name,
datacenter_label: dc.id,
- is_leader: dc.id == 1,
+ is_leader: dc.id === 1,
peer_url: `http://${serviceHost}:${API_PEER_PORT}`,
public_url: `http://${serviceHost}:${GUARD_PORT}`,
});
@@ -25,7 +25,7 @@ export function generateDatacenterRivetEngine(
// Generate a separate config file for each engine node
for (let i = 0; i < datacenter.engines; i++) {
- let serviceHost = context.getServiceHost(
+ const serviceHost = context.getServiceHost(
"rivet-engine",
datacenter.name,
0,
diff --git a/engine/docker/template/src/services/edge/runner.ts b/engine/docker/template/src/services/edge/runner.ts
index 091399e707..31ec3b1521 100644
--- a/engine/docker/template/src/services/edge/runner.ts
+++ b/engine/docker/template/src/services/edge/runner.ts
@@ -1,7 +1,7 @@
-import { TemplateContext } from '../../context';
+import type { TemplateContext } from "../../context";
export function generateRunner(context: TemplateContext) {
- // The runner files are shared and located at sdks/typescript/test-runner/
- // We just need to reference them in the docker-compose
- // No specific files need to be generated here for now
+ // The runner files are shared and located at sdks/typescript/test-runner/
+ // We just need to reference them in the docker-compose
+ // No specific files need to be generated here for now
}
diff --git a/engine/docker/template/src/services/edge/vector-client.ts b/engine/docker/template/src/services/edge/vector-client.ts
index 60a88cff4b..4d2553846e 100644
--- a/engine/docker/template/src/services/edge/vector-client.ts
+++ b/engine/docker/template/src/services/edge/vector-client.ts
@@ -1,42 +1,43 @@
-import { TemplateContext } from "../../context";
import * as yaml from "js-yaml";
+import type { TemplateContext } from "../../context";
-export function generateDatacenterVectorClient(context: TemplateContext, dcId: string) {
+export function generateDatacenterVectorClient(
+ context: TemplateContext,
+ dcId: string,
+) {
const vectorConfig = {
api: {
enabled: true,
- address: "0.0.0.0:8686"
+ address: "0.0.0.0:8686",
},
sources: {
http_events: {
type: "http_server",
address: "0.0.0.0:5022",
- encoding: "ndjson"
+ encoding: "ndjson",
},
},
transforms: {},
- sinks: {
- vector_server: {
- type: "vector",
- inputs: [
- "http_events"
- ],
- address: `${context.getServiceHost("vector-server", dcId)}:6000`,
- version: "2",
+ sinks: {
+ vector_server: {
+ type: "vector",
+ inputs: ["http_events"],
+ address: `${context.getServiceHost("vector-server", dcId)}:6000`,
+ version: "2",
buffer: {
type: "disk",
max_size: 2147483648,
- when_full: "block"
- }
+ when_full: "block",
+ },
},
console_debug: {
type: "console",
inputs: ["http_events"],
encoding: {
- codec: "json"
+ codec: "json",
},
- }
- }
+ },
+ },
};
const yamlContent = `# Vector Client Configuration for Datacenter: ${dcId}
@@ -45,5 +46,10 @@ export function generateDatacenterVectorClient(context: TemplateContext, dcId: s
${yaml.dump(vectorConfig)} `;
- context.writeDatacenterServiceFile("vector-client", dcId, "vector.yaml", yamlContent);
+ context.writeDatacenterServiceFile(
+ "vector-client",
+ dcId,
+ "vector.yaml",
+ yamlContent,
+ );
}
diff --git a/engine/docker/template/src/services/edge/vector-server.ts b/engine/docker/template/src/services/edge/vector-server.ts
index 4c33e3d8c8..697f0de2d1 100644
--- a/engine/docker/template/src/services/edge/vector-server.ts
+++ b/engine/docker/template/src/services/edge/vector-server.ts
@@ -1,55 +1,55 @@
-import { TemplateContext } from "../../context";
import * as yaml from "js-yaml";
+import type { TemplateContext } from "../../context";
-export function generateDatacenterVectorServer(context: TemplateContext, dcId: string) {
- const clickhouseHost = context.config.networkMode === "host" ? "127.0.0.1" : "clickhouse";
+export function generateDatacenterVectorServer(
+ context: TemplateContext,
+ dcId: string,
+) {
+ const clickhouseHost =
+ context.config.networkMode === "host" ? "127.0.0.1" : "clickhouse";
const vectorConfig = {
api: {
enabled: true,
- address: "0.0.0.0:8686"
+ address: "0.0.0.0:8686",
},
sources: {
vector: {
type: "vector",
address: "0.0.0.0:6000",
- version: "2"
+ version: "2",
},
tcp_json: {
type: "socket",
mode: "tcp",
address: "0.0.0.0:6100",
decoding: {
- codec: "json"
- }
+ codec: "json",
+ },
},
http_json: {
type: "http_server",
address: "0.0.0.0:6200",
- encoding: "json"
+ encoding: "json",
},
vector_metrics: {
- type: "internal_metrics"
+ type: "internal_metrics",
},
vector_logs: {
- type: "internal_logs"
- }
+ type: "internal_logs",
+ },
},
transforms: {
clickhouse_dynamic_events_filter: {
type: "filter",
- inputs: [
- "vector"
- ],
+ inputs: ["vector"],
condition: {
type: "vrl",
- source: `.source == "clickhouse"`
- }
+ source: `.source == "clickhouse"`,
+ },
},
clickhouse_dynamic_events_transform: {
type: "remap",
- inputs: [
- "clickhouse_dynamic_events_filter"
- ],
+ inputs: ["clickhouse_dynamic_events_filter"],
source: `# Extract and store metadata
__database = .database
__table = .table
@@ -65,8 +65,8 @@ __columns = .columns
# Merge in the column data that should be inserted
. = merge!(., __columns)
-`
- }
+`,
+ },
},
sinks: {
clickhouse_dynamic_events: {
@@ -79,21 +79,21 @@ __columns = .columns
auth: {
strategy: "basic",
user: "system",
- password: "default"
+ password: "default",
},
batch: {
max_events: 1000,
- timeout_secs: 10
- }
+ timeout_secs: 10,
+ },
},
console_vector_logs: {
type: "console",
inputs: ["vector_logs"],
encoding: {
- codec: "json"
- }
- }
- }
+ codec: "json",
+ },
+ },
+ },
};
const yamlContent = `# Vector Server (Aggregator) Configuration
@@ -102,5 +102,10 @@ __columns = .columns
${yaml.dump(vectorConfig)}`;
- context.writeDatacenterServiceFile("vector-server", dcId, "vector.yaml", yamlContent);
+ context.writeDatacenterServiceFile(
+ "vector-server",
+ dcId,
+ "vector.yaml",
+ yamlContent,
+ );
}
diff --git a/engine/docker/template/tsconfig.json b/engine/docker/template/tsconfig.json
index a1e561e417..a660c3cf56 100644
--- a/engine/docker/template/tsconfig.json
+++ b/engine/docker/template/tsconfig.json
@@ -1,18 +1,18 @@
{
- "compilerOptions": {
- "target": "ES2022",
- "lib": ["ES2022"],
- "module": "CommonJS",
- "moduleResolution": "node",
- "outDir": "./dist",
- "rootDir": "./src",
- "strict": true,
- "esModuleInterop": true,
- "skipLibCheck": true,
- "forceConsistentCasingInFileNames": true,
- "resolveJsonModule": true,
- "types": ["node"]
- },
- "include": ["src/**/*"],
- "exclude": ["node_modules", "dist"]
+ "compilerOptions": {
+ "target": "ES2022",
+ "lib": ["ES2022"],
+ "module": "CommonJS",
+ "moduleResolution": "node",
+ "outDir": "./dist",
+ "rootDir": "./src",
+ "strict": true,
+ "esModuleInterop": true,
+ "skipLibCheck": true,
+ "forceConsistentCasingInFileNames": true,
+ "resolveJsonModule": true,
+ "types": ["node"]
+ },
+ "include": ["src/**/*"],
+ "exclude": ["node_modules", "dist"]
}
diff --git a/engine/package.json b/engine/package.json
new file mode 100644
index 0000000000..e7fd9ca8ee
--- /dev/null
+++ b/engine/package.json
@@ -0,0 +1,28 @@
+{
+ "name": "@rivetkit/engine",
+ "private": true,
+ "packageManager": "pnpm@10.13.1",
+ "scripts": {
+ "start": "npx turbo watch build",
+ "build": "npx turbo build",
+ "test": "npx turbo test",
+ "test:watch": "npx turbo watch test",
+ "check-types": "npx turbo check-types",
+ "fmt": "pnpm biome check --write --diagnostic-level=error ."
+ },
+ "devDependencies": {
+ "@bare-ts/tools": "0.15.0",
+ "@biomejs/biome": "^2.2.3",
+ "lefthook": "^1.12.4",
+ "tsup": "^8.5.0",
+ "turbo": "^2.5.6",
+ "typescript": "^5.9.2"
+ },
+ "dependencies": {
+ "@sentry/vite-plugin": "^2.23.1"
+ },
+ "resolutions": {
+ "rivetkit": "workspace:*",
+ "@clerk/shared": "3.27.1"
+ }
+}
diff --git a/engine/pnpm-workspace.yaml b/engine/pnpm-workspace.yaml
new file mode 100644
index 0000000000..8bf813d2da
--- /dev/null
+++ b/engine/pnpm-workspace.yaml
@@ -0,0 +1,21 @@
+packages:
+ - docker/template
+ - sdks/typescript/api-full
+ - sdks/typescript/runner
+ - sdks/typescript/runner-protocol
+ - sdks/typescript/test-runner
+ - tests/load
+
+ignoredBuiltDependencies:
+ - '@clerk/shared'
+ - '@parcel/watcher'
+ - '@sentry/cli'
+ - browser-tabs-lock
+ - cbor-extract
+ - core-js
+ - lefthook
+ - sharp
+
+onlyBuiltDependencies:
+ - '@rivet-gg/icons'
+ - esbuild
diff --git a/engine/sdks/api/fern/fern.config.json b/engine/sdks/api/fern/fern.config.json
index dc90704dc8..1d28d0d375 100644
--- a/engine/sdks/api/fern/fern.config.json
+++ b/engine/sdks/api/fern/fern.config.json
@@ -1,4 +1,4 @@
{
- "organization": "rivet",
- "version": "0.44.11"
-}
\ No newline at end of file
+ "organization": "rivet",
+ "version": "0.44.11"
+}
diff --git a/engine/sdks/typescript/api-full/build.js b/engine/sdks/typescript/api-full/build.js
index 112854c6b8..008ce81dfc 100644
--- a/engine/sdks/typescript/api-full/build.js
+++ b/engine/sdks/typescript/api-full/build.js
@@ -3,60 +3,67 @@ const { build } = require("esbuild");
void main();
async function main() {
- await bundle({
- platform: "node",
- target: "node14",
- format: "cjs",
- outdir: "node",
- });
- await bundle({
- platform: "browser",
- format: "esm",
- outdir: "browser/esm",
- });
- await bundle({
- platform: "browser",
- format: "cjs",
- outdir: "browser/cjs",
- });
+ await bundle({
+ platform: "node",
+ target: "node14",
+ format: "cjs",
+ outdir: "node",
+ });
+ await bundle({
+ platform: "browser",
+ format: "esm",
+ outdir: "browser/esm",
+ });
+ await bundle({
+ platform: "browser",
+ format: "cjs",
+ outdir: "browser/cjs",
+ });
}
async function bundle({ platform, target, format, outdir }) {
- await runEsbuild({
- platform,
- target,
- format,
- entryPoint: "./src/index.ts",
- outfile: `./dist/${outdir}/index.js`,
- });
- await runEsbuild({
- platform,
- target,
- format,
- entryPoint: "./src/core/index.ts",
- outfile: `./dist/${outdir}/core.js`,
- });
- await runEsbuild({
- platform,
- target,
- format,
- entryPoint: "./src/serialization/index.ts",
- outfile: `./dist/${outdir}/serialization.js`,
- });
+ await runEsbuild({
+ platform,
+ target,
+ format,
+ entryPoint: "./src/index.ts",
+ outfile: `./dist/${outdir}/index.js`,
+ });
+ await runEsbuild({
+ platform,
+ target,
+ format,
+ entryPoint: "./src/core/index.ts",
+ outfile: `./dist/${outdir}/core.js`,
+ });
+ await runEsbuild({
+ platform,
+ target,
+ format,
+ entryPoint: "./src/serialization/index.ts",
+ outfile: `./dist/${outdir}/serialization.js`,
+ });
}
async function runEsbuild({ platform, target, format, entryPoint, outfile }) {
- await build({
- platform,
- target,
- format,
- entryPoints: [entryPoint],
- outfile,
- bundle: true,
- alias: {
- // matches up with tsconfig paths
- "@rivetkit/engine-api": "./src",
- },
- external: ['node-fetch', 'js-base64', 'qs', 'url-join', 'form-data', 'readable-stream'],
- }).catch(() => process.exit(1));
+ await build({
+ platform,
+ target,
+ format,
+ entryPoints: [entryPoint],
+ outfile,
+ bundle: true,
+ alias: {
+ // matches up with tsconfig paths
+ "@rivetkit/engine-api": "./src",
+ },
+ external: [
+ "node-fetch",
+ "js-base64",
+ "qs",
+ "url-join",
+ "form-data",
+ "readable-stream",
+ ],
+ }).catch(() => process.exit(1));
}
diff --git a/engine/sdks/typescript/api-full/package.json b/engine/sdks/typescript/api-full/package.json
index ce617aab80..c4e6df5bb1 100644
--- a/engine/sdks/typescript/api-full/package.json
+++ b/engine/sdks/typescript/api-full/package.json
@@ -1,59 +1,59 @@
{
- "name": "@rivetkit/engine-api-full",
- "version": "25.8.1",
- "repository": "https://github.com/rivet-gg/rivet/tree/main/sdks/typescript",
- "files": [
- "dist",
- "types",
- "core.d.ts",
- "serialization.d.ts"
- ],
- "exports": {
- ".": {
- "node": "./dist/node/index.js",
- "import": "./dist/browser/esm/index.js",
- "require": "./dist/browser/cjs/index.js",
- "default": "./dist/browser/cjs/index.js",
- "types": "./types/index.d.ts"
- },
- "./core": {
- "node": "./dist/node/core.js",
- "import": "./dist/browser/esm/core.js",
- "require": "./dist/browser/cjs/core.js",
- "default": "./dist/browser/cjs/core.js",
- "types": "./types/core/index.d.ts"
- },
- "./serialization": {
- "node": "./dist/node/serialization.js",
- "import": "./dist/browser/esm/serialization.js",
- "require": "./dist/browser/cjs/serialization.js",
- "default": "./dist/browser/cjs/serialization.js",
- "types": "./types/serialization/index.d.ts"
- }
- },
- "types": "./types/index.d.ts",
- "scripts": {
- "compile": "tsc",
- "bundle": "node build.js",
- "build": "pnpm compile && pnpm bundle",
- "prepack": "pnpm run build"
- },
- "dependencies": {
- "form-data": "^4.0.4",
- "js-base64": "^3.7.8",
- "node-fetch": "^2.7.0",
- "qs": "^6.14.0",
- "readable-stream": "^4.7.0",
- "url-join": "^5.0.0"
- },
- "devDependencies": {
- "@types/node": "17.0.33",
- "@types/node-fetch": "2.6.11",
- "@types/qs": "6.9.8",
- "@types/readable-stream": "^4.0.21",
- "@types/url-join": "4.0.1",
- "esbuild": "^0.19.12",
- "prettier": "2.7.1",
- "typescript": "5.8.2"
- }
+ "name": "@rivetkit/engine-api-full",
+ "version": "25.8.1",
+ "repository": "https://github.com/rivet-gg/rivet/tree/main/sdks/typescript",
+ "files": [
+ "dist",
+ "types",
+ "core.d.ts",
+ "serialization.d.ts"
+ ],
+ "exports": {
+ ".": {
+ "node": "./dist/node/index.js",
+ "import": "./dist/browser/esm/index.js",
+ "require": "./dist/browser/cjs/index.js",
+ "default": "./dist/browser/cjs/index.js",
+ "types": "./types/index.d.ts"
+ },
+ "./core": {
+ "node": "./dist/node/core.js",
+ "import": "./dist/browser/esm/core.js",
+ "require": "./dist/browser/cjs/core.js",
+ "default": "./dist/browser/cjs/core.js",
+ "types": "./types/core/index.d.ts"
+ },
+ "./serialization": {
+ "node": "./dist/node/serialization.js",
+ "import": "./dist/browser/esm/serialization.js",
+ "require": "./dist/browser/cjs/serialization.js",
+ "default": "./dist/browser/cjs/serialization.js",
+ "types": "./types/serialization/index.d.ts"
+ }
+ },
+ "types": "./types/index.d.ts",
+ "scripts": {
+ "compile": "tsc",
+ "bundle": "node build.js",
+ "build": "pnpm compile && pnpm bundle",
+ "prepack": "pnpm run build"
+ },
+ "dependencies": {
+ "form-data": "^4.0.4",
+ "js-base64": "^3.7.8",
+ "node-fetch": "^2.7.0",
+ "qs": "^6.14.0",
+ "readable-stream": "^4.7.0",
+ "url-join": "^5.0.0"
+ },
+ "devDependencies": {
+ "@types/node": "17.0.33",
+ "@types/node-fetch": "2.6.11",
+ "@types/qs": "6.9.8",
+ "@types/readable-stream": "^4.0.21",
+ "@types/url-join": "4.0.1",
+ "esbuild": "^0.19.12",
+ "prettier": "2.7.1",
+ "typescript": "5.8.2"
+ }
}
diff --git a/engine/sdks/typescript/api-full/src/Client.ts b/engine/sdks/typescript/api-full/src/Client.ts
index 5fc7f4c191..f52f2ffe16 100644
--- a/engine/sdks/typescript/api-full/src/Client.ts
+++ b/engine/sdks/typescript/api-full/src/Client.ts
@@ -2,916 +2,1039 @@
* This file was auto-generated by Fern from our API Definition.
*/
-import * as core from "./core";
-import * as Rivet from "./api/index";
import urlJoin from "url-join";
-import * as serializers from "./serialization/index";
-import * as errors from "./errors/index";
+import type * as Rivet from "./api/index";
import { Datacenters } from "./api/resources/datacenters/client/Client";
import { Health } from "./api/resources/health/client/Client";
import { Namespaces } from "./api/resources/namespaces/client/Client";
import { Runners } from "./api/resources/runners/client/Client";
+import * as core from "./core";
+import * as errors from "./errors/index";
+import * as serializers from "./serialization/index";
export declare namespace RivetClient {
- export interface Options {
- environment: core.Supplier;
- /** Specify a custom URL to connect the client to. */
- baseUrl?: core.Supplier;
- token: core.Supplier;
- fetcher?: core.FetchFunction;
- }
-
- export interface RequestOptions {
- /** The maximum time to wait for a response in seconds. */
- timeoutInSeconds?: number;
- /** The number of times to retry the request. Defaults to 2. */
- maxRetries?: number;
- /** A hook to abort the request. */
- abortSignal?: AbortSignal;
- /** Additional headers to include in the request. */
- headers?: Record;
- }
+ export interface Options {
+ environment: core.Supplier;
+ /** Specify a custom URL to connect the client to. */
+ baseUrl?: core.Supplier;
+ token: core.Supplier;
+ fetcher?: core.FetchFunction;
+ }
+
+ export interface RequestOptions {
+ /** The maximum time to wait for a response in seconds. */
+ timeoutInSeconds?: number;
+ /** The number of times to retry the request. Defaults to 2. */
+ maxRetries?: number;
+ /** A hook to abort the request. */
+ abortSignal?: AbortSignal;
+ /** Additional headers to include in the request. */
+ headers?: Record;
+ }
}
export class RivetClient {
- protected _datacenters: Datacenters | undefined;
- protected _health: Health | undefined;
- protected _namespaces: Namespaces | undefined;
- protected _runners: Runners | undefined;
-
- constructor(protected readonly _options: RivetClient.Options) {}
-
- public get datacenters(): Datacenters {
- return (this._datacenters ??= new Datacenters(this._options));
- }
-
- public get health(): Health {
- return (this._health ??= new Health(this._options));
- }
-
- public get namespaces(): Namespaces {
- return (this._namespaces ??= new Namespaces(this._options));
- }
-
- public get runners(): Runners {
- return (this._runners ??= new Runners(this._options));
- }
-
- /**
- * **If key is some & `include_destroyed` is false**
- *
- * 2 round trips:
- *
- * - namespace::ops::resolve_for_name_global
- * - GET /actors (multiple DCs based on actor IDs)
- *
- * This path is optimized because we can read the actor IDs fro the key directly from Epoxy with
- * stale consistency to determine which datacenter the actor lives in. Under most circumstances,
- * this means we don't need to fan out to all datacenters (like normal list does).
- *
- * The reason `include_destroyed` has to be false is Epoxy only stores currently active actors. If
- * `include_destroyed` is true, we show all previous iterations of actors with the same key.
- *
- * **Otherwise**
- *
- * 2 round trips:
- *
- * - namespace::ops::resolve_for_name_global
- * - GET /actors (fanout)
- *
- * ## Optimized Alternative Routes
- *
- * @param {Rivet.ActorsListRequest} request
- * @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
- *
- * @example
- * await client.actorsList({
- * namespace: "namespace"
- * })
- */
- public async actorsList(
- request: Rivet.ActorsListRequest,
- requestOptions?: RivetClient.RequestOptions,
- ): Promise {
- const { namespace, name, key, actorIds, includeDestroyed, limit, cursor } = request;
- const _queryParams: Record = {};
- _queryParams["namespace"] = namespace;
- if (name != null) {
- _queryParams["name"] = name;
- }
-
- if (key != null) {
- _queryParams["key"] = key;
- }
-
- if (actorIds != null) {
- _queryParams["actor_ids"] = actorIds;
- }
-
- if (includeDestroyed != null) {
- _queryParams["include_destroyed"] = includeDestroyed.toString();
- }
-
- if (limit != null) {
- _queryParams["limit"] = limit.toString();
- }
-
- if (cursor != null) {
- _queryParams["cursor"] = cursor;
- }
-
- const _response = await (this._options.fetcher ?? core.fetcher)({
- url: urlJoin(
- (await core.Supplier.get(this._options.baseUrl)) ??
- (await core.Supplier.get(this._options.environment)),
- "actors",
- ),
- method: "GET",
- headers: {
- Authorization: await this._getAuthorizationHeader(),
- "X-Fern-Language": "JavaScript",
- "X-Fern-Runtime": core.RUNTIME.type,
- "X-Fern-Runtime-Version": core.RUNTIME.version,
- ...requestOptions?.headers,
- },
- contentType: "application/json",
- queryParameters: _queryParams,
- requestType: "json",
- timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 180000,
- maxRetries: requestOptions?.maxRetries,
- abortSignal: requestOptions?.abortSignal,
- });
- if (_response.ok) {
- return serializers.ActorsListResponse.parseOrThrow(_response.body, {
- unrecognizedObjectKeys: "passthrough",
- allowUnrecognizedUnionMembers: true,
- allowUnrecognizedEnumValues: true,
- skipValidation: true,
- breadcrumbsPrefix: ["response"],
- });
- }
-
- if (_response.error.reason === "status-code") {
- throw new errors.RivetError({
- statusCode: _response.error.statusCode,
- body: _response.error.body,
- });
- }
-
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.RivetError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- });
- case "timeout":
- throw new errors.RivetTimeoutError("Timeout exceeded when calling GET /actors.");
- case "unknown":
- throw new errors.RivetError({
- message: _response.error.errorMessage,
- });
- }
- }
-
- /**
- * **If actor is created in the current datacenter:**
- *
- * 2 round trips:
- *
- * - namespace::ops::resolve_for_name_global
- * - [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation)
- *
- * **If actor is created in a different datacenter:**
- *
- * 3 round trips:
- *
- * - namespace::ops::resolve_for_name_global
- * - POST /actors to remote datacenter
- * - [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation)
- *
- * actor::get will always be in the same datacenter.
- *
- * @param {Rivet.ActorsCreateRequest} request
- * @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
- *
- * @example
- * await client.actorsCreate({
- * namespace: "namespace",
- * crashPolicy: "restart",
- * name: "name",
- * runnerNameSelector: "runner_name_selector"
- * })
- */
- public async actorsCreate(
- request: Rivet.ActorsCreateRequest,
- requestOptions?: RivetClient.RequestOptions,
- ): Promise {
- const { namespace, ..._body } = request;
- const _queryParams: Record = {};
- _queryParams["namespace"] = namespace;
- const _response = await (this._options.fetcher ?? core.fetcher)({
- url: urlJoin(
- (await core.Supplier.get(this._options.baseUrl)) ??
- (await core.Supplier.get(this._options.environment)),
- "actors",
- ),
- method: "POST",
- headers: {
- Authorization: await this._getAuthorizationHeader(),
- "X-Fern-Language": "JavaScript",
- "X-Fern-Runtime": core.RUNTIME.type,
- "X-Fern-Runtime-Version": core.RUNTIME.version,
- ...requestOptions?.headers,
- },
- contentType: "application/json",
- queryParameters: _queryParams,
- requestType: "json",
- body: serializers.ActorsCreateRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
- timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 180000,
- maxRetries: requestOptions?.maxRetries,
- abortSignal: requestOptions?.abortSignal,
- });
- if (_response.ok) {
- return serializers.ActorsCreateResponse.parseOrThrow(_response.body, {
- unrecognizedObjectKeys: "passthrough",
- allowUnrecognizedUnionMembers: true,
- allowUnrecognizedEnumValues: true,
- skipValidation: true,
- breadcrumbsPrefix: ["response"],
- });
- }
-
- if (_response.error.reason === "status-code") {
- throw new errors.RivetError({
- statusCode: _response.error.statusCode,
- body: _response.error.body,
- });
- }
-
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.RivetError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- });
- case "timeout":
- throw new errors.RivetTimeoutError("Timeout exceeded when calling POST /actors.");
- case "unknown":
- throw new errors.RivetError({
- message: _response.error.errorMessage,
- });
- }
- }
-
- /**
- * **If actor exists**
- *
- * 2 round trips:
- *
- * - namespace::ops::resolve_for_name_global
- * - GET /actors/{}
- *
- * **If actor does not exist and is created in the current datacenter:**
- *
- * 2 round trips:
- *
- * - namespace::ops::resolve_for_name_global
- * - [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation)
- *
- * **If actor does not exist and is created in a different datacenter:**
- *
- * 3 round trips:
- *
- * - namespace::ops::resolve_for_name_global
- * - POST /actors to remote datacenter
- * - [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation)
- *
- * actor::get will always be in the same datacenter.
- *
- * ## Optimized Alternative Routes
- *
- * @param {Rivet.ActorsGetOrCreateRequest} request
- * @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
- *
- * @example
- * await client.actorsGetOrCreate({
- * namespace: "namespace",
- * crashPolicy: "restart",
- * key: "key",
- * name: "name",
- * runnerNameSelector: "runner_name_selector"
- * })
- */
- public async actorsGetOrCreate(
- request: Rivet.ActorsGetOrCreateRequest,
- requestOptions?: RivetClient.RequestOptions,
- ): Promise {
- const { namespace, ..._body } = request;
- const _queryParams: Record = {};
- _queryParams["namespace"] = namespace;
- const _response = await (this._options.fetcher ?? core.fetcher)({
- url: urlJoin(
- (await core.Supplier.get(this._options.baseUrl)) ??
- (await core.Supplier.get(this._options.environment)),
- "actors",
- ),
- method: "PUT",
- headers: {
- Authorization: await this._getAuthorizationHeader(),
- "X-Fern-Language": "JavaScript",
- "X-Fern-Runtime": core.RUNTIME.type,
- "X-Fern-Runtime-Version": core.RUNTIME.version,
- ...requestOptions?.headers,
- },
- contentType: "application/json",
- queryParameters: _queryParams,
- requestType: "json",
- body: serializers.ActorsGetOrCreateRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
- timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 180000,
- maxRetries: requestOptions?.maxRetries,
- abortSignal: requestOptions?.abortSignal,
- });
- if (_response.ok) {
- return serializers.ActorsGetOrCreateResponse.parseOrThrow(_response.body, {
- unrecognizedObjectKeys: "passthrough",
- allowUnrecognizedUnionMembers: true,
- allowUnrecognizedEnumValues: true,
- skipValidation: true,
- breadcrumbsPrefix: ["response"],
- });
- }
-
- if (_response.error.reason === "status-code") {
- throw new errors.RivetError({
- statusCode: _response.error.statusCode,
- body: _response.error.body,
- });
- }
-
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.RivetError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- });
- case "timeout":
- throw new errors.RivetTimeoutError("Timeout exceeded when calling PUT /actors.");
- case "unknown":
- throw new errors.RivetError({
- message: _response.error.errorMessage,
- });
- }
- }
-
- /**
- * 2 round trips:
- *
- * - GET /actors/names (fanout)
- * - [api-peer] namespace::ops::resolve_for_name_global
- *
- * @param {Rivet.ActorsListNamesRequest} request
- * @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
- *
- * @example
- * await client.actorsListNames({
- * namespace: "namespace"
- * })
- */
- public async actorsListNames(
- request: Rivet.ActorsListNamesRequest,
- requestOptions?: RivetClient.RequestOptions,
- ): Promise {
- const { namespace, limit, cursor } = request;
- const _queryParams: Record = {};
- _queryParams["namespace"] = namespace;
- if (limit != null) {
- _queryParams["limit"] = limit.toString();
- }
-
- if (cursor != null) {
- _queryParams["cursor"] = cursor;
- }
-
- const _response = await (this._options.fetcher ?? core.fetcher)({
- url: urlJoin(
- (await core.Supplier.get(this._options.baseUrl)) ??
- (await core.Supplier.get(this._options.environment)),
- "actors/names",
- ),
- method: "GET",
- headers: {
- Authorization: await this._getAuthorizationHeader(),
- "X-Fern-Language": "JavaScript",
- "X-Fern-Runtime": core.RUNTIME.type,
- "X-Fern-Runtime-Version": core.RUNTIME.version,
- ...requestOptions?.headers,
- },
- contentType: "application/json",
- queryParameters: _queryParams,
- requestType: "json",
- timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 180000,
- maxRetries: requestOptions?.maxRetries,
- abortSignal: requestOptions?.abortSignal,
- });
- if (_response.ok) {
- return serializers.ActorsListNamesResponse.parseOrThrow(_response.body, {
- unrecognizedObjectKeys: "passthrough",
- allowUnrecognizedUnionMembers: true,
- allowUnrecognizedEnumValues: true,
- skipValidation: true,
- breadcrumbsPrefix: ["response"],
- });
- }
-
- if (_response.error.reason === "status-code") {
- throw new errors.RivetError({
- statusCode: _response.error.statusCode,
- body: _response.error.body,
- });
- }
-
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.RivetError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- });
- case "timeout":
- throw new errors.RivetTimeoutError("Timeout exceeded when calling GET /actors/names.");
- case "unknown":
- throw new errors.RivetError({
- message: _response.error.errorMessage,
- });
- }
- }
-
- /**
- * 2 round trip:
- *
- * - DELETE /actors/{}
- * - [api-peer] namespace::ops::resolve_for_name_global
- *
- * @param {Rivet.RivetId} actorId
- * @param {Rivet.ActorsDeleteRequest} request
- * @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
- *
- * @example
- * await client.actorsDelete("actor_id")
- */
- public async actorsDelete(
- actorId: Rivet.RivetId,
- request: Rivet.ActorsDeleteRequest = {},
- requestOptions?: RivetClient.RequestOptions,
- ): Promise {
- const { namespace } = request;
- const _queryParams: Record = {};
- if (namespace != null) {
- _queryParams["namespace"] = namespace;
- }
-
- const _response = await (this._options.fetcher ?? core.fetcher)({
- url: urlJoin(
- (await core.Supplier.get(this._options.baseUrl)) ??
- (await core.Supplier.get(this._options.environment)),
- `actors/${encodeURIComponent(serializers.RivetId.jsonOrThrow(actorId))}`,
- ),
- method: "DELETE",
- headers: {
- Authorization: await this._getAuthorizationHeader(),
- "X-Fern-Language": "JavaScript",
- "X-Fern-Runtime": core.RUNTIME.type,
- "X-Fern-Runtime-Version": core.RUNTIME.version,
- ...requestOptions?.headers,
- },
- contentType: "application/json",
- queryParameters: _queryParams,
- requestType: "json",
- timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 180000,
- maxRetries: requestOptions?.maxRetries,
- abortSignal: requestOptions?.abortSignal,
- });
- if (_response.ok) {
- return serializers.ActorsDeleteResponse.parseOrThrow(_response.body, {
- unrecognizedObjectKeys: "passthrough",
- allowUnrecognizedUnionMembers: true,
- allowUnrecognizedEnumValues: true,
- skipValidation: true,
- breadcrumbsPrefix: ["response"],
- });
- }
-
- if (_response.error.reason === "status-code") {
- throw new errors.RivetError({
- statusCode: _response.error.statusCode,
- body: _response.error.body,
- });
- }
-
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.RivetError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- });
- case "timeout":
- throw new errors.RivetTimeoutError("Timeout exceeded when calling DELETE /actors/{actor_id}.");
- case "unknown":
- throw new errors.RivetError({
- message: _response.error.errorMessage,
- });
- }
- }
-
- /**
- * @param {Rivet.RunnerConfigsListRequest} request
- * @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
- *
- * @example
- * await client.runnerConfigsList({
- * namespace: "namespace"
- * })
- */
- public async runnerConfigsList(
- request: Rivet.RunnerConfigsListRequest,
- requestOptions?: RivetClient.RequestOptions,
- ): Promise {
- const { namespace, limit, cursor, variant, runnerNames } = request;
- const _queryParams: Record = {};
- _queryParams["namespace"] = namespace;
- if (limit != null) {
- _queryParams["limit"] = limit.toString();
- }
-
- if (cursor != null) {
- _queryParams["cursor"] = cursor;
- }
-
- if (variant != null) {
- _queryParams["variant"] = serializers.RunnerConfigVariant.jsonOrThrow(variant, {
- unrecognizedObjectKeys: "strip",
- });
- }
-
- if (runnerNames != null) {
- _queryParams["runner_names"] = runnerNames;
- }
-
- const _response = await (this._options.fetcher ?? core.fetcher)({
- url: urlJoin(
- (await core.Supplier.get(this._options.baseUrl)) ??
- (await core.Supplier.get(this._options.environment)),
- "runner-configs",
- ),
- method: "GET",
- headers: {
- Authorization: await this._getAuthorizationHeader(),
- "X-Fern-Language": "JavaScript",
- "X-Fern-Runtime": core.RUNTIME.type,
- "X-Fern-Runtime-Version": core.RUNTIME.version,
- ...requestOptions?.headers,
- },
- contentType: "application/json",
- queryParameters: _queryParams,
- requestType: "json",
- timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 180000,
- maxRetries: requestOptions?.maxRetries,
- abortSignal: requestOptions?.abortSignal,
- });
- if (_response.ok) {
- return serializers.RunnerConfigsListResponse.parseOrThrow(_response.body, {
- unrecognizedObjectKeys: "passthrough",
- allowUnrecognizedUnionMembers: true,
- allowUnrecognizedEnumValues: true,
- skipValidation: true,
- breadcrumbsPrefix: ["response"],
- });
- }
-
- if (_response.error.reason === "status-code") {
- throw new errors.RivetError({
- statusCode: _response.error.statusCode,
- body: _response.error.body,
- });
- }
-
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.RivetError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- });
- case "timeout":
- throw new errors.RivetTimeoutError("Timeout exceeded when calling GET /runner-configs.");
- case "unknown":
- throw new errors.RivetError({
- message: _response.error.errorMessage,
- });
- }
- }
-
- /**
- * @param {Rivet.RunnerConfigsServerlessHealthCheckRequest} request
- * @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
- *
- * @example
- * await client.runnerConfigsServerlessHealthCheck({
- * namespace: "namespace",
- * url: "url"
- * })
- */
- public async runnerConfigsServerlessHealthCheck(
- request: Rivet.RunnerConfigsServerlessHealthCheckRequest,
- requestOptions?: RivetClient.RequestOptions,
- ): Promise {
- const { namespace, ..._body } = request;
- const _queryParams: Record = {};
- _queryParams["namespace"] = namespace;
- const _response = await (this._options.fetcher ?? core.fetcher)({
- url: urlJoin(
- (await core.Supplier.get(this._options.baseUrl)) ??
- (await core.Supplier.get(this._options.environment)),
- "runner-configs/serverless-health-check",
- ),
- method: "POST",
- headers: {
- Authorization: await this._getAuthorizationHeader(),
- "X-Fern-Language": "JavaScript",
- "X-Fern-Runtime": core.RUNTIME.type,
- "X-Fern-Runtime-Version": core.RUNTIME.version,
- ...requestOptions?.headers,
- },
- contentType: "application/json",
- queryParameters: _queryParams,
- requestType: "json",
- body: serializers.RunnerConfigsServerlessHealthCheckRequest.jsonOrThrow(_body, {
- unrecognizedObjectKeys: "strip",
- }),
- timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 180000,
- maxRetries: requestOptions?.maxRetries,
- abortSignal: requestOptions?.abortSignal,
- });
- if (_response.ok) {
- return serializers.RunnerConfigsServerlessHealthCheckResponse.parseOrThrow(_response.body, {
- unrecognizedObjectKeys: "passthrough",
- allowUnrecognizedUnionMembers: true,
- allowUnrecognizedEnumValues: true,
- skipValidation: true,
- breadcrumbsPrefix: ["response"],
- });
- }
-
- if (_response.error.reason === "status-code") {
- throw new errors.RivetError({
- statusCode: _response.error.statusCode,
- body: _response.error.body,
- });
- }
-
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.RivetError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- });
- case "timeout":
- throw new errors.RivetTimeoutError(
- "Timeout exceeded when calling POST /runner-configs/serverless-health-check.",
- );
- case "unknown":
- throw new errors.RivetError({
- message: _response.error.errorMessage,
- });
- }
- }
-
- /**
- * @param {string} runnerName
- * @param {Rivet.RunnerConfigsUpsertRequestBody} request
- * @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
- *
- * @example
- * await client.runnerConfigsUpsert("runner_name", {
- * namespace: "namespace",
- * datacenters: {
- * "key": {}
- * }
- * })
- */
- public async runnerConfigsUpsert(
- runnerName: string,
- request: Rivet.RunnerConfigsUpsertRequestBody,
- requestOptions?: RivetClient.RequestOptions,
- ): Promise {
- const { namespace, ..._body } = request;
- const _queryParams: Record = {};
- _queryParams["namespace"] = namespace;
- const _response = await (this._options.fetcher ?? core.fetcher)({
- url: urlJoin(
- (await core.Supplier.get(this._options.baseUrl)) ??
- (await core.Supplier.get(this._options.environment)),
- `runner-configs/${encodeURIComponent(runnerName)}`,
- ),
- method: "PUT",
- headers: {
- Authorization: await this._getAuthorizationHeader(),
- "X-Fern-Language": "JavaScript",
- "X-Fern-Runtime": core.RUNTIME.type,
- "X-Fern-Runtime-Version": core.RUNTIME.version,
- ...requestOptions?.headers,
- },
- contentType: "application/json",
- queryParameters: _queryParams,
- requestType: "json",
- body: serializers.RunnerConfigsUpsertRequestBody.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
- timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 180000,
- maxRetries: requestOptions?.maxRetries,
- abortSignal: requestOptions?.abortSignal,
- });
- if (_response.ok) {
- return serializers.RunnerConfigsUpsertResponse.parseOrThrow(_response.body, {
- unrecognizedObjectKeys: "passthrough",
- allowUnrecognizedUnionMembers: true,
- allowUnrecognizedEnumValues: true,
- skipValidation: true,
- breadcrumbsPrefix: ["response"],
- });
- }
-
- if (_response.error.reason === "status-code") {
- throw new errors.RivetError({
- statusCode: _response.error.statusCode,
- body: _response.error.body,
- });
- }
-
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.RivetError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- });
- case "timeout":
- throw new errors.RivetTimeoutError("Timeout exceeded when calling PUT /runner-configs/{runner_name}.");
- case "unknown":
- throw new errors.RivetError({
- message: _response.error.errorMessage,
- });
- }
- }
-
- /**
- * @param {string} runnerName
- * @param {Rivet.RunnerConfigsDeleteRequest} request
- * @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
- *
- * @example
- * await client.runnerConfigsDelete("runner_name", {
- * namespace: "namespace"
- * })
- */
- public async runnerConfigsDelete(
- runnerName: string,
- request: Rivet.RunnerConfigsDeleteRequest,
- requestOptions?: RivetClient.RequestOptions,
- ): Promise {
- const { namespace } = request;
- const _queryParams: Record = {};
- _queryParams["namespace"] = namespace;
- const _response = await (this._options.fetcher ?? core.fetcher)({
- url: urlJoin(
- (await core.Supplier.get(this._options.baseUrl)) ??
- (await core.Supplier.get(this._options.environment)),
- `runner-configs/${encodeURIComponent(runnerName)}`,
- ),
- method: "DELETE",
- headers: {
- Authorization: await this._getAuthorizationHeader(),
- "X-Fern-Language": "JavaScript",
- "X-Fern-Runtime": core.RUNTIME.type,
- "X-Fern-Runtime-Version": core.RUNTIME.version,
- ...requestOptions?.headers,
- },
- contentType: "application/json",
- queryParameters: _queryParams,
- requestType: "json",
- timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 180000,
- maxRetries: requestOptions?.maxRetries,
- abortSignal: requestOptions?.abortSignal,
- });
- if (_response.ok) {
- return serializers.RunnerConfigsDeleteResponse.parseOrThrow(_response.body, {
- unrecognizedObjectKeys: "passthrough",
- allowUnrecognizedUnionMembers: true,
- allowUnrecognizedEnumValues: true,
- skipValidation: true,
- breadcrumbsPrefix: ["response"],
- });
- }
-
- if (_response.error.reason === "status-code") {
- throw new errors.RivetError({
- statusCode: _response.error.statusCode,
- body: _response.error.body,
- });
- }
-
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.RivetError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- });
- case "timeout":
- throw new errors.RivetTimeoutError(
- "Timeout exceeded when calling DELETE /runner-configs/{runner_name}.",
- );
- case "unknown":
- throw new errors.RivetError({
- message: _response.error.errorMessage,
- });
- }
- }
-
- /**
- * @param {string} runnerName
- * @param {Rivet.RunnerConfigsRefreshMetadataRequest} request
- * @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
- *
- * @example
- * await client.runnerConfigsRefreshMetadata("runner_name", {
- * namespace: "namespace",
- * body: {
- * "key": "value"
- * }
- * })
- */
- public async runnerConfigsRefreshMetadata(
- runnerName: string,
- request: Rivet.RunnerConfigsRefreshMetadataRequest,
- requestOptions?: RivetClient.RequestOptions,
- ): Promise {
- const { namespace, body: _body } = request;
- const _queryParams: Record = {};
- _queryParams["namespace"] = namespace;
- const _response = await (this._options.fetcher ?? core.fetcher)({
- url: urlJoin(
- (await core.Supplier.get(this._options.baseUrl)) ??
- (await core.Supplier.get(this._options.environment)),
- `runner-configs/${encodeURIComponent(runnerName)}/refresh-metadata`,
- ),
- method: "POST",
- headers: {
- Authorization: await this._getAuthorizationHeader(),
- "X-Fern-Language": "JavaScript",
- "X-Fern-Runtime": core.RUNTIME.type,
- "X-Fern-Runtime-Version": core.RUNTIME.version,
- ...requestOptions?.headers,
- },
- contentType: "application/json",
- queryParameters: _queryParams,
- requestType: "json",
- body: serializers.RunnerConfigsRefreshMetadataRequestBody.jsonOrThrow(_body, {
- unrecognizedObjectKeys: "strip",
- }),
- timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 180000,
- maxRetries: requestOptions?.maxRetries,
- abortSignal: requestOptions?.abortSignal,
- });
- if (_response.ok) {
- return serializers.RunnerConfigsRefreshMetadataResponse.parseOrThrow(_response.body, {
- unrecognizedObjectKeys: "passthrough",
- allowUnrecognizedUnionMembers: true,
- allowUnrecognizedEnumValues: true,
- skipValidation: true,
- breadcrumbsPrefix: ["response"],
- });
- }
-
- if (_response.error.reason === "status-code") {
- throw new errors.RivetError({
- statusCode: _response.error.statusCode,
- body: _response.error.body,
- });
- }
-
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.RivetError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- });
- case "timeout":
- throw new errors.RivetTimeoutError(
- "Timeout exceeded when calling POST /runner-configs/{runner_name}/refresh-metadata.",
- );
- case "unknown":
- throw new errors.RivetError({
- message: _response.error.errorMessage,
- });
- }
- }
-
- protected async _getAuthorizationHeader(): Promise {
- return `Bearer ${await core.Supplier.get(this._options.token)}`;
- }
+ protected _datacenters: Datacenters | undefined;
+ protected _health: Health | undefined;
+ protected _namespaces: Namespaces | undefined;
+ protected _runners: Runners | undefined;
+
+ constructor(protected readonly _options: RivetClient.Options) {}
+
+ public get datacenters(): Datacenters {
+ return (this._datacenters ??= new Datacenters(this._options));
+ }
+
+ public get health(): Health {
+ return (this._health ??= new Health(this._options));
+ }
+
+ public get namespaces(): Namespaces {
+ return (this._namespaces ??= new Namespaces(this._options));
+ }
+
+ public get runners(): Runners {
+ return (this._runners ??= new Runners(this._options));
+ }
+
+ /**
+ * **If key is some & `include_destroyed` is false**
+ *
+ * 2 round trips:
+ *
+ * - namespace::ops::resolve_for_name_global
+ * - GET /actors (multiple DCs based on actor IDs)
+ *
+ * This path is optimized because we can read the actor IDs fro the key directly from Epoxy with
+ * stale consistency to determine which datacenter the actor lives in. Under most circumstances,
+ * this means we don't need to fan out to all datacenters (like normal list does).
+ *
+ * The reason `include_destroyed` has to be false is Epoxy only stores currently active actors. If
+ * `include_destroyed` is true, we show all previous iterations of actors with the same key.
+ *
+ * **Otherwise**
+ *
+ * 2 round trips:
+ *
+ * - namespace::ops::resolve_for_name_global
+ * - GET /actors (fanout)
+ *
+ * ## Optimized Alternative Routes
+ *
+ * @param {Rivet.ActorsListRequest} request
+ * @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
+ *
+ * @example
+ * await client.actorsList({
+ * namespace: "namespace"
+ * })
+ */
+ public async actorsList(
+ request: Rivet.ActorsListRequest,
+ requestOptions?: RivetClient.RequestOptions,
+ ): Promise {
+ const {
+ namespace,
+ name,
+ key,
+ actorIds,
+ includeDestroyed,
+ limit,
+ cursor,
+ } = request;
+ const _queryParams: Record<
+ string,
+ string | string[] | object | object[] | null
+ > = {};
+ _queryParams["namespace"] = namespace;
+ if (name != null) {
+ _queryParams["name"] = name;
+ }
+
+ if (key != null) {
+ _queryParams["key"] = key;
+ }
+
+ if (actorIds != null) {
+ _queryParams["actor_ids"] = actorIds;
+ }
+
+ if (includeDestroyed != null) {
+ _queryParams["include_destroyed"] = includeDestroyed.toString();
+ }
+
+ if (limit != null) {
+ _queryParams["limit"] = limit.toString();
+ }
+
+ if (cursor != null) {
+ _queryParams["cursor"] = cursor;
+ }
+
+ const _response = await (this._options.fetcher ?? core.fetcher)({
+ url: urlJoin(
+ (await core.Supplier.get(this._options.baseUrl)) ??
+ (await core.Supplier.get(this._options.environment)),
+ "actors",
+ ),
+ method: "GET",
+ headers: {
+ Authorization: await this._getAuthorizationHeader(),
+ "X-Fern-Language": "JavaScript",
+ "X-Fern-Runtime": core.RUNTIME.type,
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
+ ...requestOptions?.headers,
+ },
+ contentType: "application/json",
+ queryParameters: _queryParams,
+ requestType: "json",
+ timeoutMs:
+ requestOptions?.timeoutInSeconds != null
+ ? requestOptions.timeoutInSeconds * 1000
+ : 180000,
+ maxRetries: requestOptions?.maxRetries,
+ abortSignal: requestOptions?.abortSignal,
+ });
+ if (_response.ok) {
+ return serializers.ActorsListResponse.parseOrThrow(_response.body, {
+ unrecognizedObjectKeys: "passthrough",
+ allowUnrecognizedUnionMembers: true,
+ allowUnrecognizedEnumValues: true,
+ skipValidation: true,
+ breadcrumbsPrefix: ["response"],
+ });
+ }
+
+ if (_response.error.reason === "status-code") {
+ throw new errors.RivetError({
+ statusCode: _response.error.statusCode,
+ body: _response.error.body,
+ });
+ }
+
+ switch (_response.error.reason) {
+ case "non-json":
+ throw new errors.RivetError({
+ statusCode: _response.error.statusCode,
+ body: _response.error.rawBody,
+ });
+ case "timeout":
+ throw new errors.RivetTimeoutError(
+ "Timeout exceeded when calling GET /actors.",
+ );
+ case "unknown":
+ throw new errors.RivetError({
+ message: _response.error.errorMessage,
+ });
+ }
+ }
+
+ /**
+ * **If actor is created in the current datacenter:**
+ *
+ * 2 round trips:
+ *
+ * - namespace::ops::resolve_for_name_global
+ * - [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation)
+ *
+ * **If actor is created in a different datacenter:**
+ *
+ * 3 round trips:
+ *
+ * - namespace::ops::resolve_for_name_global
+ * - POST /actors to remote datacenter
+ * - [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation)
+ *
+ * actor::get will always be in the same datacenter.
+ *
+ * @param {Rivet.ActorsCreateRequest} request
+ * @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
+ *
+ * @example
+ * await client.actorsCreate({
+ * namespace: "namespace",
+ * crashPolicy: "restart",
+ * name: "name",
+ * runnerNameSelector: "runner_name_selector"
+ * })
+ */
+ public async actorsCreate(
+ request: Rivet.ActorsCreateRequest,
+ requestOptions?: RivetClient.RequestOptions,
+ ): Promise {
+ const { namespace, ..._body } = request;
+ const _queryParams: Record<
+ string,
+ string | string[] | object | object[] | null
+ > = {};
+ _queryParams["namespace"] = namespace;
+ const _response = await (this._options.fetcher ?? core.fetcher)({
+ url: urlJoin(
+ (await core.Supplier.get(this._options.baseUrl)) ??
+ (await core.Supplier.get(this._options.environment)),
+ "actors",
+ ),
+ method: "POST",
+ headers: {
+ Authorization: await this._getAuthorizationHeader(),
+ "X-Fern-Language": "JavaScript",
+ "X-Fern-Runtime": core.RUNTIME.type,
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
+ ...requestOptions?.headers,
+ },
+ contentType: "application/json",
+ queryParameters: _queryParams,
+ requestType: "json",
+ body: serializers.ActorsCreateRequest.jsonOrThrow(_body, {
+ unrecognizedObjectKeys: "strip",
+ }),
+ timeoutMs:
+ requestOptions?.timeoutInSeconds != null
+ ? requestOptions.timeoutInSeconds * 1000
+ : 180000,
+ maxRetries: requestOptions?.maxRetries,
+ abortSignal: requestOptions?.abortSignal,
+ });
+ if (_response.ok) {
+ return serializers.ActorsCreateResponse.parseOrThrow(
+ _response.body,
+ {
+ unrecognizedObjectKeys: "passthrough",
+ allowUnrecognizedUnionMembers: true,
+ allowUnrecognizedEnumValues: true,
+ skipValidation: true,
+ breadcrumbsPrefix: ["response"],
+ },
+ );
+ }
+
+ if (_response.error.reason === "status-code") {
+ throw new errors.RivetError({
+ statusCode: _response.error.statusCode,
+ body: _response.error.body,
+ });
+ }
+
+ switch (_response.error.reason) {
+ case "non-json":
+ throw new errors.RivetError({
+ statusCode: _response.error.statusCode,
+ body: _response.error.rawBody,
+ });
+ case "timeout":
+ throw new errors.RivetTimeoutError(
+ "Timeout exceeded when calling POST /actors.",
+ );
+ case "unknown":
+ throw new errors.RivetError({
+ message: _response.error.errorMessage,
+ });
+ }
+ }
+
+ /**
+ * **If actor exists**
+ *
+ * 2 round trips:
+ *
+ * - namespace::ops::resolve_for_name_global
+ * - GET /actors/{}
+ *
+ * **If actor does not exist and is created in the current datacenter:**
+ *
+ * 2 round trips:
+ *
+ * - namespace::ops::resolve_for_name_global
+ * - [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation)
+ *
+ * **If actor does not exist and is created in a different datacenter:**
+ *
+ * 3 round trips:
+ *
+ * - namespace::ops::resolve_for_name_global
+ * - POST /actors to remote datacenter
+ * - [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation)
+ *
+ * actor::get will always be in the same datacenter.
+ *
+ * ## Optimized Alternative Routes
+ *
+ * @param {Rivet.ActorsGetOrCreateRequest} request
+ * @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
+ *
+ * @example
+ * await client.actorsGetOrCreate({
+ * namespace: "namespace",
+ * crashPolicy: "restart",
+ * key: "key",
+ * name: "name",
+ * runnerNameSelector: "runner_name_selector"
+ * })
+ */
+ public async actorsGetOrCreate(
+ request: Rivet.ActorsGetOrCreateRequest,
+ requestOptions?: RivetClient.RequestOptions,
+ ): Promise {
+ const { namespace, ..._body } = request;
+ const _queryParams: Record<
+ string,
+ string | string[] | object | object[] | null
+ > = {};
+ _queryParams["namespace"] = namespace;
+ const _response = await (this._options.fetcher ?? core.fetcher)({
+ url: urlJoin(
+ (await core.Supplier.get(this._options.baseUrl)) ??
+ (await core.Supplier.get(this._options.environment)),
+ "actors",
+ ),
+ method: "PUT",
+ headers: {
+ Authorization: await this._getAuthorizationHeader(),
+ "X-Fern-Language": "JavaScript",
+ "X-Fern-Runtime": core.RUNTIME.type,
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
+ ...requestOptions?.headers,
+ },
+ contentType: "application/json",
+ queryParameters: _queryParams,
+ requestType: "json",
+ body: serializers.ActorsGetOrCreateRequest.jsonOrThrow(_body, {
+ unrecognizedObjectKeys: "strip",
+ }),
+ timeoutMs:
+ requestOptions?.timeoutInSeconds != null
+ ? requestOptions.timeoutInSeconds * 1000
+ : 180000,
+ maxRetries: requestOptions?.maxRetries,
+ abortSignal: requestOptions?.abortSignal,
+ });
+ if (_response.ok) {
+ return serializers.ActorsGetOrCreateResponse.parseOrThrow(
+ _response.body,
+ {
+ unrecognizedObjectKeys: "passthrough",
+ allowUnrecognizedUnionMembers: true,
+ allowUnrecognizedEnumValues: true,
+ skipValidation: true,
+ breadcrumbsPrefix: ["response"],
+ },
+ );
+ }
+
+ if (_response.error.reason === "status-code") {
+ throw new errors.RivetError({
+ statusCode: _response.error.statusCode,
+ body: _response.error.body,
+ });
+ }
+
+ switch (_response.error.reason) {
+ case "non-json":
+ throw new errors.RivetError({
+ statusCode: _response.error.statusCode,
+ body: _response.error.rawBody,
+ });
+ case "timeout":
+ throw new errors.RivetTimeoutError(
+ "Timeout exceeded when calling PUT /actors.",
+ );
+ case "unknown":
+ throw new errors.RivetError({
+ message: _response.error.errorMessage,
+ });
+ }
+ }
+
+ /**
+ * 2 round trips:
+ *
+ * - GET /actors/names (fanout)
+ * - [api-peer] namespace::ops::resolve_for_name_global
+ *
+ * @param {Rivet.ActorsListNamesRequest} request
+ * @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
+ *
+ * @example
+ * await client.actorsListNames({
+ * namespace: "namespace"
+ * })
+ */
+ public async actorsListNames(
+ request: Rivet.ActorsListNamesRequest,
+ requestOptions?: RivetClient.RequestOptions,
+ ): Promise {
+ const { namespace, limit, cursor } = request;
+ const _queryParams: Record<
+ string,
+ string | string[] | object | object[] | null
+ > = {};
+ _queryParams["namespace"] = namespace;
+ if (limit != null) {
+ _queryParams["limit"] = limit.toString();
+ }
+
+ if (cursor != null) {
+ _queryParams["cursor"] = cursor;
+ }
+
+ const _response = await (this._options.fetcher ?? core.fetcher)({
+ url: urlJoin(
+ (await core.Supplier.get(this._options.baseUrl)) ??
+ (await core.Supplier.get(this._options.environment)),
+ "actors/names",
+ ),
+ method: "GET",
+ headers: {
+ Authorization: await this._getAuthorizationHeader(),
+ "X-Fern-Language": "JavaScript",
+ "X-Fern-Runtime": core.RUNTIME.type,
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
+ ...requestOptions?.headers,
+ },
+ contentType: "application/json",
+ queryParameters: _queryParams,
+ requestType: "json",
+ timeoutMs:
+ requestOptions?.timeoutInSeconds != null
+ ? requestOptions.timeoutInSeconds * 1000
+ : 180000,
+ maxRetries: requestOptions?.maxRetries,
+ abortSignal: requestOptions?.abortSignal,
+ });
+ if (_response.ok) {
+ return serializers.ActorsListNamesResponse.parseOrThrow(
+ _response.body,
+ {
+ unrecognizedObjectKeys: "passthrough",
+ allowUnrecognizedUnionMembers: true,
+ allowUnrecognizedEnumValues: true,
+ skipValidation: true,
+ breadcrumbsPrefix: ["response"],
+ },
+ );
+ }
+
+ if (_response.error.reason === "status-code") {
+ throw new errors.RivetError({
+ statusCode: _response.error.statusCode,
+ body: _response.error.body,
+ });
+ }
+
+ switch (_response.error.reason) {
+ case "non-json":
+ throw new errors.RivetError({
+ statusCode: _response.error.statusCode,
+ body: _response.error.rawBody,
+ });
+ case "timeout":
+ throw new errors.RivetTimeoutError(
+ "Timeout exceeded when calling GET /actors/names.",
+ );
+ case "unknown":
+ throw new errors.RivetError({
+ message: _response.error.errorMessage,
+ });
+ }
+ }
+
+ /**
+ * 2 round trip:
+ *
+ * - DELETE /actors/{}
+ * - [api-peer] namespace::ops::resolve_for_name_global
+ *
+ * @param {Rivet.RivetId} actorId
+ * @param {Rivet.ActorsDeleteRequest} request
+ * @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
+ *
+ * @example
+ * await client.actorsDelete("actor_id")
+ */
+ public async actorsDelete(
+ actorId: Rivet.RivetId,
+ request: Rivet.ActorsDeleteRequest = {},
+ requestOptions?: RivetClient.RequestOptions,
+ ): Promise {
+ const { namespace } = request;
+ const _queryParams: Record<
+ string,
+ string | string[] | object | object[] | null
+ > = {};
+ if (namespace != null) {
+ _queryParams["namespace"] = namespace;
+ }
+
+ const _response = await (this._options.fetcher ?? core.fetcher)({
+ url: urlJoin(
+ (await core.Supplier.get(this._options.baseUrl)) ??
+ (await core.Supplier.get(this._options.environment)),
+ `actors/${encodeURIComponent(serializers.RivetId.jsonOrThrow(actorId))}`,
+ ),
+ method: "DELETE",
+ headers: {
+ Authorization: await this._getAuthorizationHeader(),
+ "X-Fern-Language": "JavaScript",
+ "X-Fern-Runtime": core.RUNTIME.type,
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
+ ...requestOptions?.headers,
+ },
+ contentType: "application/json",
+ queryParameters: _queryParams,
+ requestType: "json",
+ timeoutMs:
+ requestOptions?.timeoutInSeconds != null
+ ? requestOptions.timeoutInSeconds * 1000
+ : 180000,
+ maxRetries: requestOptions?.maxRetries,
+ abortSignal: requestOptions?.abortSignal,
+ });
+ if (_response.ok) {
+ return serializers.ActorsDeleteResponse.parseOrThrow(
+ _response.body,
+ {
+ unrecognizedObjectKeys: "passthrough",
+ allowUnrecognizedUnionMembers: true,
+ allowUnrecognizedEnumValues: true,
+ skipValidation: true,
+ breadcrumbsPrefix: ["response"],
+ },
+ );
+ }
+
+ if (_response.error.reason === "status-code") {
+ throw new errors.RivetError({
+ statusCode: _response.error.statusCode,
+ body: _response.error.body,
+ });
+ }
+
+ switch (_response.error.reason) {
+ case "non-json":
+ throw new errors.RivetError({
+ statusCode: _response.error.statusCode,
+ body: _response.error.rawBody,
+ });
+ case "timeout":
+ throw new errors.RivetTimeoutError(
+ "Timeout exceeded when calling DELETE /actors/{actor_id}.",
+ );
+ case "unknown":
+ throw new errors.RivetError({
+ message: _response.error.errorMessage,
+ });
+ }
+ }
+
+ /**
+ * @param {Rivet.RunnerConfigsListRequest} request
+ * @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
+ *
+ * @example
+ * await client.runnerConfigsList({
+ * namespace: "namespace"
+ * })
+ */
+ public async runnerConfigsList(
+ request: Rivet.RunnerConfigsListRequest,
+ requestOptions?: RivetClient.RequestOptions,
+ ): Promise {
+ const { namespace, limit, cursor, variant, runnerNames } = request;
+ const _queryParams: Record<
+ string,
+ string | string[] | object | object[] | null
+ > = {};
+ _queryParams["namespace"] = namespace;
+ if (limit != null) {
+ _queryParams["limit"] = limit.toString();
+ }
+
+ if (cursor != null) {
+ _queryParams["cursor"] = cursor;
+ }
+
+ if (variant != null) {
+ _queryParams["variant"] =
+ serializers.RunnerConfigVariant.jsonOrThrow(variant, {
+ unrecognizedObjectKeys: "strip",
+ });
+ }
+
+ if (runnerNames != null) {
+ _queryParams["runner_names"] = runnerNames;
+ }
+
+ const _response = await (this._options.fetcher ?? core.fetcher)({
+ url: urlJoin(
+ (await core.Supplier.get(this._options.baseUrl)) ??
+ (await core.Supplier.get(this._options.environment)),
+ "runner-configs",
+ ),
+ method: "GET",
+ headers: {
+ Authorization: await this._getAuthorizationHeader(),
+ "X-Fern-Language": "JavaScript",
+ "X-Fern-Runtime": core.RUNTIME.type,
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
+ ...requestOptions?.headers,
+ },
+ contentType: "application/json",
+ queryParameters: _queryParams,
+ requestType: "json",
+ timeoutMs:
+ requestOptions?.timeoutInSeconds != null
+ ? requestOptions.timeoutInSeconds * 1000
+ : 180000,
+ maxRetries: requestOptions?.maxRetries,
+ abortSignal: requestOptions?.abortSignal,
+ });
+ if (_response.ok) {
+ return serializers.RunnerConfigsListResponse.parseOrThrow(
+ _response.body,
+ {
+ unrecognizedObjectKeys: "passthrough",
+ allowUnrecognizedUnionMembers: true,
+ allowUnrecognizedEnumValues: true,
+ skipValidation: true,
+ breadcrumbsPrefix: ["response"],
+ },
+ );
+ }
+
+ if (_response.error.reason === "status-code") {
+ throw new errors.RivetError({
+ statusCode: _response.error.statusCode,
+ body: _response.error.body,
+ });
+ }
+
+ switch (_response.error.reason) {
+ case "non-json":
+ throw new errors.RivetError({
+ statusCode: _response.error.statusCode,
+ body: _response.error.rawBody,
+ });
+ case "timeout":
+ throw new errors.RivetTimeoutError(
+ "Timeout exceeded when calling GET /runner-configs.",
+ );
+ case "unknown":
+ throw new errors.RivetError({
+ message: _response.error.errorMessage,
+ });
+ }
+ }
+
+ /**
+ * @param {Rivet.RunnerConfigsServerlessHealthCheckRequest} request
+ * @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
+ *
+ * @example
+ * await client.runnerConfigsServerlessHealthCheck({
+ * namespace: "namespace",
+ * url: "url"
+ * })
+ */
+ public async runnerConfigsServerlessHealthCheck(
+ request: Rivet.RunnerConfigsServerlessHealthCheckRequest,
+ requestOptions?: RivetClient.RequestOptions,
+ ): Promise {
+ const { namespace, ..._body } = request;
+ const _queryParams: Record<
+ string,
+ string | string[] | object | object[] | null
+ > = {};
+ _queryParams["namespace"] = namespace;
+ const _response = await (this._options.fetcher ?? core.fetcher)({
+ url: urlJoin(
+ (await core.Supplier.get(this._options.baseUrl)) ??
+ (await core.Supplier.get(this._options.environment)),
+ "runner-configs/serverless-health-check",
+ ),
+ method: "POST",
+ headers: {
+ Authorization: await this._getAuthorizationHeader(),
+ "X-Fern-Language": "JavaScript",
+ "X-Fern-Runtime": core.RUNTIME.type,
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
+ ...requestOptions?.headers,
+ },
+ contentType: "application/json",
+ queryParameters: _queryParams,
+ requestType: "json",
+ body: serializers.RunnerConfigsServerlessHealthCheckRequest.jsonOrThrow(
+ _body,
+ {
+ unrecognizedObjectKeys: "strip",
+ },
+ ),
+ timeoutMs:
+ requestOptions?.timeoutInSeconds != null
+ ? requestOptions.timeoutInSeconds * 1000
+ : 180000,
+ maxRetries: requestOptions?.maxRetries,
+ abortSignal: requestOptions?.abortSignal,
+ });
+ if (_response.ok) {
+ return serializers.RunnerConfigsServerlessHealthCheckResponse.parseOrThrow(
+ _response.body,
+ {
+ unrecognizedObjectKeys: "passthrough",
+ allowUnrecognizedUnionMembers: true,
+ allowUnrecognizedEnumValues: true,
+ skipValidation: true,
+ breadcrumbsPrefix: ["response"],
+ },
+ );
+ }
+
+ if (_response.error.reason === "status-code") {
+ throw new errors.RivetError({
+ statusCode: _response.error.statusCode,
+ body: _response.error.body,
+ });
+ }
+
+ switch (_response.error.reason) {
+ case "non-json":
+ throw new errors.RivetError({
+ statusCode: _response.error.statusCode,
+ body: _response.error.rawBody,
+ });
+ case "timeout":
+ throw new errors.RivetTimeoutError(
+ "Timeout exceeded when calling POST /runner-configs/serverless-health-check.",
+ );
+ case "unknown":
+ throw new errors.RivetError({
+ message: _response.error.errorMessage,
+ });
+ }
+ }
+
+ /**
+ * @param {string} runnerName
+ * @param {Rivet.RunnerConfigsUpsertRequestBody} request
+ * @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
+ *
+ * @example
+ * await client.runnerConfigsUpsert("runner_name", {
+ * namespace: "namespace",
+ * datacenters: {
+ * "key": {}
+ * }
+ * })
+ */
+ public async runnerConfigsUpsert(
+ runnerName: string,
+ request: Rivet.RunnerConfigsUpsertRequestBody,
+ requestOptions?: RivetClient.RequestOptions,
+ ): Promise {
+ const { namespace, ..._body } = request;
+ const _queryParams: Record<
+ string,
+ string | string[] | object | object[] | null
+ > = {};
+ _queryParams["namespace"] = namespace;
+ const _response = await (this._options.fetcher ?? core.fetcher)({
+ url: urlJoin(
+ (await core.Supplier.get(this._options.baseUrl)) ??
+ (await core.Supplier.get(this._options.environment)),
+ `runner-configs/${encodeURIComponent(runnerName)}`,
+ ),
+ method: "PUT",
+ headers: {
+ Authorization: await this._getAuthorizationHeader(),
+ "X-Fern-Language": "JavaScript",
+ "X-Fern-Runtime": core.RUNTIME.type,
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
+ ...requestOptions?.headers,
+ },
+ contentType: "application/json",
+ queryParameters: _queryParams,
+ requestType: "json",
+ body: serializers.RunnerConfigsUpsertRequestBody.jsonOrThrow(
+ _body,
+ { unrecognizedObjectKeys: "strip" },
+ ),
+ timeoutMs:
+ requestOptions?.timeoutInSeconds != null
+ ? requestOptions.timeoutInSeconds * 1000
+ : 180000,
+ maxRetries: requestOptions?.maxRetries,
+ abortSignal: requestOptions?.abortSignal,
+ });
+ if (_response.ok) {
+ return serializers.RunnerConfigsUpsertResponse.parseOrThrow(
+ _response.body,
+ {
+ unrecognizedObjectKeys: "passthrough",
+ allowUnrecognizedUnionMembers: true,
+ allowUnrecognizedEnumValues: true,
+ skipValidation: true,
+ breadcrumbsPrefix: ["response"],
+ },
+ );
+ }
+
+ if (_response.error.reason === "status-code") {
+ throw new errors.RivetError({
+ statusCode: _response.error.statusCode,
+ body: _response.error.body,
+ });
+ }
+
+ switch (_response.error.reason) {
+ case "non-json":
+ throw new errors.RivetError({
+ statusCode: _response.error.statusCode,
+ body: _response.error.rawBody,
+ });
+ case "timeout":
+ throw new errors.RivetTimeoutError(
+ "Timeout exceeded when calling PUT /runner-configs/{runner_name}.",
+ );
+ case "unknown":
+ throw new errors.RivetError({
+ message: _response.error.errorMessage,
+ });
+ }
+ }
+
+ /**
+ * @param {string} runnerName
+ * @param {Rivet.RunnerConfigsDeleteRequest} request
+ * @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
+ *
+ * @example
+ * await client.runnerConfigsDelete("runner_name", {
+ * namespace: "namespace"
+ * })
+ */
+ public async runnerConfigsDelete(
+ runnerName: string,
+ request: Rivet.RunnerConfigsDeleteRequest,
+ requestOptions?: RivetClient.RequestOptions,
+ ): Promise {
+ const { namespace } = request;
+ const _queryParams: Record<
+ string,
+ string | string[] | object | object[] | null
+ > = {};
+ _queryParams["namespace"] = namespace;
+ const _response = await (this._options.fetcher ?? core.fetcher)({
+ url: urlJoin(
+ (await core.Supplier.get(this._options.baseUrl)) ??
+ (await core.Supplier.get(this._options.environment)),
+ `runner-configs/${encodeURIComponent(runnerName)}`,
+ ),
+ method: "DELETE",
+ headers: {
+ Authorization: await this._getAuthorizationHeader(),
+ "X-Fern-Language": "JavaScript",
+ "X-Fern-Runtime": core.RUNTIME.type,
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
+ ...requestOptions?.headers,
+ },
+ contentType: "application/json",
+ queryParameters: _queryParams,
+ requestType: "json",
+ timeoutMs:
+ requestOptions?.timeoutInSeconds != null
+ ? requestOptions.timeoutInSeconds * 1000
+ : 180000,
+ maxRetries: requestOptions?.maxRetries,
+ abortSignal: requestOptions?.abortSignal,
+ });
+ if (_response.ok) {
+ return serializers.RunnerConfigsDeleteResponse.parseOrThrow(
+ _response.body,
+ {
+ unrecognizedObjectKeys: "passthrough",
+ allowUnrecognizedUnionMembers: true,
+ allowUnrecognizedEnumValues: true,
+ skipValidation: true,
+ breadcrumbsPrefix: ["response"],
+ },
+ );
+ }
+
+ if (_response.error.reason === "status-code") {
+ throw new errors.RivetError({
+ statusCode: _response.error.statusCode,
+ body: _response.error.body,
+ });
+ }
+
+ switch (_response.error.reason) {
+ case "non-json":
+ throw new errors.RivetError({
+ statusCode: _response.error.statusCode,
+ body: _response.error.rawBody,
+ });
+ case "timeout":
+ throw new errors.RivetTimeoutError(
+ "Timeout exceeded when calling DELETE /runner-configs/{runner_name}.",
+ );
+ case "unknown":
+ throw new errors.RivetError({
+ message: _response.error.errorMessage,
+ });
+ }
+ }
+
+ /**
+ * @param {string} runnerName
+ * @param {Rivet.RunnerConfigsRefreshMetadataRequest} request
+ * @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
+ *
+ * @example
+ * await client.runnerConfigsRefreshMetadata("runner_name", {
+ * namespace: "namespace",
+ * body: {
+ * "key": "value"
+ * }
+ * })
+ */
+ public async runnerConfigsRefreshMetadata(
+ runnerName: string,
+ request: Rivet.RunnerConfigsRefreshMetadataRequest,
+ requestOptions?: RivetClient.RequestOptions,
+ ): Promise {
+ const { namespace, body: _body } = request;
+ const _queryParams: Record<
+ string,
+ string | string[] | object | object[] | null
+ > = {};
+ _queryParams["namespace"] = namespace;
+ const _response = await (this._options.fetcher ?? core.fetcher)({
+ url: urlJoin(
+ (await core.Supplier.get(this._options.baseUrl)) ??
+ (await core.Supplier.get(this._options.environment)),
+ `runner-configs/${encodeURIComponent(runnerName)}/refresh-metadata`,
+ ),
+ method: "POST",
+ headers: {
+ Authorization: await this._getAuthorizationHeader(),
+ "X-Fern-Language": "JavaScript",
+ "X-Fern-Runtime": core.RUNTIME.type,
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
+ ...requestOptions?.headers,
+ },
+ contentType: "application/json",
+ queryParameters: _queryParams,
+ requestType: "json",
+ body: serializers.RunnerConfigsRefreshMetadataRequestBody.jsonOrThrow(
+ _body,
+ {
+ unrecognizedObjectKeys: "strip",
+ },
+ ),
+ timeoutMs:
+ requestOptions?.timeoutInSeconds != null
+ ? requestOptions.timeoutInSeconds * 1000
+ : 180000,
+ maxRetries: requestOptions?.maxRetries,
+ abortSignal: requestOptions?.abortSignal,
+ });
+ if (_response.ok) {
+ return serializers.RunnerConfigsRefreshMetadataResponse.parseOrThrow(
+ _response.body,
+ {
+ unrecognizedObjectKeys: "passthrough",
+ allowUnrecognizedUnionMembers: true,
+ allowUnrecognizedEnumValues: true,
+ skipValidation: true,
+ breadcrumbsPrefix: ["response"],
+ },
+ );
+ }
+
+ if (_response.error.reason === "status-code") {
+ throw new errors.RivetError({
+ statusCode: _response.error.statusCode,
+ body: _response.error.body,
+ });
+ }
+
+ switch (_response.error.reason) {
+ case "non-json":
+ throw new errors.RivetError({
+ statusCode: _response.error.statusCode,
+ body: _response.error.rawBody,
+ });
+ case "timeout":
+ throw new errors.RivetTimeoutError(
+ "Timeout exceeded when calling POST /runner-configs/{runner_name}/refresh-metadata.",
+ );
+ case "unknown":
+ throw new errors.RivetError({
+ message: _response.error.errorMessage,
+ });
+ }
+ }
+
+ protected async _getAuthorizationHeader(): Promise {
+ return `Bearer ${await core.Supplier.get(this._options.token)}`;
+ }
}
diff --git a/engine/sdks/typescript/api-full/src/api/client/requests/ActorsCreateRequest.ts b/engine/sdks/typescript/api-full/src/api/client/requests/ActorsCreateRequest.ts
index a8e560330e..b0fd5b073d 100644
--- a/engine/sdks/typescript/api-full/src/api/client/requests/ActorsCreateRequest.ts
+++ b/engine/sdks/typescript/api-full/src/api/client/requests/ActorsCreateRequest.ts
@@ -2,7 +2,7 @@
* This file was auto-generated by Fern from our API Definition.
*/
-import * as Rivet from "../../index";
+import type * as Rivet from "../../index";
/**
* @example
@@ -14,11 +14,11 @@ import * as Rivet from "../../index";
* }
*/
export interface ActorsCreateRequest {
- namespace: string;
- crashPolicy: Rivet.CrashPolicy;
- datacenter?: string;
- input?: string;
- key?: string;
- name: string;
- runnerNameSelector: string;
+ namespace: string;
+ crashPolicy: Rivet.CrashPolicy;
+ datacenter?: string;
+ input?: string;
+ key?: string;
+ name: string;
+ runnerNameSelector: string;
}
diff --git a/engine/sdks/typescript/api-full/src/api/client/requests/ActorsDeleteRequest.ts b/engine/sdks/typescript/api-full/src/api/client/requests/ActorsDeleteRequest.ts
index 59a270bbec..3bfe0acb52 100644
--- a/engine/sdks/typescript/api-full/src/api/client/requests/ActorsDeleteRequest.ts
+++ b/engine/sdks/typescript/api-full/src/api/client/requests/ActorsDeleteRequest.ts
@@ -7,5 +7,5 @@
* {}
*/
export interface ActorsDeleteRequest {
- namespace?: string;
+ namespace?: string;
}
diff --git a/engine/sdks/typescript/api-full/src/api/client/requests/ActorsGetOrCreateRequest.ts b/engine/sdks/typescript/api-full/src/api/client/requests/ActorsGetOrCreateRequest.ts
index f7b3046244..35274b1d4b 100644
--- a/engine/sdks/typescript/api-full/src/api/client/requests/ActorsGetOrCreateRequest.ts
+++ b/engine/sdks/typescript/api-full/src/api/client/requests/ActorsGetOrCreateRequest.ts
@@ -2,7 +2,7 @@
* This file was auto-generated by Fern from our API Definition.
*/
-import * as Rivet from "../../index";
+import type * as Rivet from "../../index";
/**
* @example
@@ -15,11 +15,11 @@ import * as Rivet from "../../index";
* }
*/
export interface ActorsGetOrCreateRequest {
- namespace: string;
- crashPolicy: Rivet.CrashPolicy;
- datacenter?: string;
- input?: string;
- key: string;
- name: string;
- runnerNameSelector: string;
+ namespace: string;
+ crashPolicy: Rivet.CrashPolicy;
+ datacenter?: string;
+ input?: string;
+ key: string;
+ name: string;
+ runnerNameSelector: string;
}
diff --git a/engine/sdks/typescript/api-full/src/api/client/requests/ActorsListNamesRequest.ts b/engine/sdks/typescript/api-full/src/api/client/requests/ActorsListNamesRequest.ts
index 7adf3e3cb2..1eaeb27aff 100644
--- a/engine/sdks/typescript/api-full/src/api/client/requests/ActorsListNamesRequest.ts
+++ b/engine/sdks/typescript/api-full/src/api/client/requests/ActorsListNamesRequest.ts
@@ -9,7 +9,7 @@
* }
*/
export interface ActorsListNamesRequest {
- namespace: string;
- limit?: number;
- cursor?: string;
+ namespace: string;
+ limit?: number;
+ cursor?: string;
}
diff --git a/engine/sdks/typescript/api-full/src/api/client/requests/ActorsListRequest.ts b/engine/sdks/typescript/api-full/src/api/client/requests/ActorsListRequest.ts
index bbf6145de7..ad98f2e15e 100644
--- a/engine/sdks/typescript/api-full/src/api/client/requests/ActorsListRequest.ts
+++ b/engine/sdks/typescript/api-full/src/api/client/requests/ActorsListRequest.ts
@@ -9,11 +9,11 @@
* }
*/
export interface ActorsListRequest {
- namespace: string;
- name?: string;
- key?: string;
- actorIds?: string;
- includeDestroyed?: boolean;
- limit?: number;
- cursor?: string;
+ namespace: string;
+ name?: string;
+ key?: string;
+ actorIds?: string;
+ includeDestroyed?: boolean;
+ limit?: number;
+ cursor?: string;
}
diff --git a/engine/sdks/typescript/api-full/src/api/client/requests/RunnerConfigsDeleteRequest.ts b/engine/sdks/typescript/api-full/src/api/client/requests/RunnerConfigsDeleteRequest.ts
index 39c78ac5cf..6364686eac 100644
--- a/engine/sdks/typescript/api-full/src/api/client/requests/RunnerConfigsDeleteRequest.ts
+++ b/engine/sdks/typescript/api-full/src/api/client/requests/RunnerConfigsDeleteRequest.ts
@@ -9,5 +9,5 @@
* }
*/
export interface RunnerConfigsDeleteRequest {
- namespace: string;
+ namespace: string;
}
diff --git a/engine/sdks/typescript/api-full/src/api/client/requests/RunnerConfigsListRequest.ts b/engine/sdks/typescript/api-full/src/api/client/requests/RunnerConfigsListRequest.ts
index cb1e154eb8..a0a6a71600 100644
--- a/engine/sdks/typescript/api-full/src/api/client/requests/RunnerConfigsListRequest.ts
+++ b/engine/sdks/typescript/api-full/src/api/client/requests/RunnerConfigsListRequest.ts
@@ -2,7 +2,7 @@
* This file was auto-generated by Fern from our API Definition.
*/
-import * as Rivet from "../../index";
+import type * as Rivet from "../../index";
/**
* @example
@@ -11,9 +11,9 @@ import * as Rivet from "../../index";
* }
*/
export interface RunnerConfigsListRequest {
- namespace: string;
- limit?: number;
- cursor?: string;
- variant?: Rivet.RunnerConfigVariant;
- runnerNames?: string;
+ namespace: string;
+ limit?: number;
+ cursor?: string;
+ variant?: Rivet.RunnerConfigVariant;
+ runnerNames?: string;
}
diff --git a/engine/sdks/typescript/api-full/src/api/client/requests/RunnerConfigsRefreshMetadataRequest.ts b/engine/sdks/typescript/api-full/src/api/client/requests/RunnerConfigsRefreshMetadataRequest.ts
index 00f361a2c7..1ac2744fe1 100644
--- a/engine/sdks/typescript/api-full/src/api/client/requests/RunnerConfigsRefreshMetadataRequest.ts
+++ b/engine/sdks/typescript/api-full/src/api/client/requests/RunnerConfigsRefreshMetadataRequest.ts
@@ -2,7 +2,7 @@
* This file was auto-generated by Fern from our API Definition.
*/
-import * as Rivet from "../../index";
+import type * as Rivet from "../../index";
/**
* @example
@@ -14,6 +14,6 @@ import * as Rivet from "../../index";
* }
*/
export interface RunnerConfigsRefreshMetadataRequest {
- namespace: string;
- body: Rivet.RunnerConfigsRefreshMetadataRequestBody;
+ namespace: string;
+ body: Rivet.RunnerConfigsRefreshMetadataRequestBody;
}
diff --git a/engine/sdks/typescript/api-full/src/api/client/requests/RunnerConfigsServerlessHealthCheckRequest.ts b/engine/sdks/typescript/api-full/src/api/client/requests/RunnerConfigsServerlessHealthCheckRequest.ts
index 22120389d9..4c2a3aed9d 100644
--- a/engine/sdks/typescript/api-full/src/api/client/requests/RunnerConfigsServerlessHealthCheckRequest.ts
+++ b/engine/sdks/typescript/api-full/src/api/client/requests/RunnerConfigsServerlessHealthCheckRequest.ts
@@ -10,7 +10,7 @@
* }
*/
export interface RunnerConfigsServerlessHealthCheckRequest {
- namespace: string;
- headers?: Record;
- url: string;
+ namespace: string;
+ headers?: Record;
+ url: string;
}
diff --git a/engine/sdks/typescript/api-full/src/api/client/requests/RunnerConfigsUpsertRequestBody.ts b/engine/sdks/typescript/api-full/src/api/client/requests/RunnerConfigsUpsertRequestBody.ts
index 94bdc54ad8..606c7d9829 100644
--- a/engine/sdks/typescript/api-full/src/api/client/requests/RunnerConfigsUpsertRequestBody.ts
+++ b/engine/sdks/typescript/api-full/src/api/client/requests/RunnerConfigsUpsertRequestBody.ts
@@ -2,7 +2,7 @@
* This file was auto-generated by Fern from our API Definition.
*/
-import * as Rivet from "../../index";
+import type * as Rivet from "../../index";
/**
* @example
@@ -14,6 +14,6 @@ import * as Rivet from "../../index";
* }
*/
export interface RunnerConfigsUpsertRequestBody {
- namespace: string;
- datacenters: Record;
+ namespace: string;
+ datacenters: Record;
}
diff --git a/engine/sdks/typescript/api-full/src/api/client/requests/index.ts b/engine/sdks/typescript/api-full/src/api/client/requests/index.ts
index 0b285a8bb9..ba72e5d74e 100644
--- a/engine/sdks/typescript/api-full/src/api/client/requests/index.ts
+++ b/engine/sdks/typescript/api-full/src/api/client/requests/index.ts
@@ -1,10 +1,10 @@
-export { type ActorsListRequest } from "./ActorsListRequest";
-export { type ActorsCreateRequest } from "./ActorsCreateRequest";
-export { type ActorsGetOrCreateRequest } from "./ActorsGetOrCreateRequest";
-export { type ActorsListNamesRequest } from "./ActorsListNamesRequest";
-export { type ActorsDeleteRequest } from "./ActorsDeleteRequest";
-export { type RunnerConfigsListRequest } from "./RunnerConfigsListRequest";
-export { type RunnerConfigsServerlessHealthCheckRequest } from "./RunnerConfigsServerlessHealthCheckRequest";
-export { type RunnerConfigsUpsertRequestBody } from "./RunnerConfigsUpsertRequestBody";
-export { type RunnerConfigsDeleteRequest } from "./RunnerConfigsDeleteRequest";
-export { type RunnerConfigsRefreshMetadataRequest } from "./RunnerConfigsRefreshMetadataRequest";
+export type { ActorsCreateRequest } from "./ActorsCreateRequest";
+export type { ActorsDeleteRequest } from "./ActorsDeleteRequest";
+export type { ActorsGetOrCreateRequest } from "./ActorsGetOrCreateRequest";
+export type { ActorsListNamesRequest } from "./ActorsListNamesRequest";
+export type { ActorsListRequest } from "./ActorsListRequest";
+export type { RunnerConfigsDeleteRequest } from "./RunnerConfigsDeleteRequest";
+export type { RunnerConfigsListRequest } from "./RunnerConfigsListRequest";
+export type { RunnerConfigsRefreshMetadataRequest } from "./RunnerConfigsRefreshMetadataRequest";
+export type { RunnerConfigsServerlessHealthCheckRequest } from "./RunnerConfigsServerlessHealthCheckRequest";
+export type { RunnerConfigsUpsertRequestBody } from "./RunnerConfigsUpsertRequestBody";
diff --git a/engine/sdks/typescript/api-full/src/api/index.ts b/engine/sdks/typescript/api-full/src/api/index.ts
index a931b36375..fb00ab43d9 100644
--- a/engine/sdks/typescript/api-full/src/api/index.ts
+++ b/engine/sdks/typescript/api-full/src/api/index.ts
@@ -1,3 +1,3 @@
-export * from "./types";
-export * from "./resources";
export * from "./client";
+export * from "./resources";
+export * from "./types";
diff --git a/engine/sdks/typescript/api-full/src/api/resources/datacenters/client/Client.ts b/engine/sdks/typescript/api-full/src/api/resources/datacenters/client/Client.ts
index bced27b262..e4047cd034 100644
--- a/engine/sdks/typescript/api-full/src/api/resources/datacenters/client/Client.ts
+++ b/engine/sdks/typescript/api-full/src/api/resources/datacenters/client/Client.ts
@@ -2,96 +2,106 @@
* This file was auto-generated by Fern from our API Definition.
*/
-import * as core from "../../../../core";
-import * as Rivet from "../../../index";
import urlJoin from "url-join";
-import * as serializers from "../../../../serialization/index";
+import * as core from "../../../../core";
import * as errors from "../../../../errors/index";
+import * as serializers from "../../../../serialization/index";
+import type * as Rivet from "../../../index";
export declare namespace Datacenters {
- export interface Options {
- environment: core.Supplier;
- /** Specify a custom URL to connect the client to. */
- baseUrl?: core.Supplier;
- token: core.Supplier;
- fetcher?: core.FetchFunction;
- }
+ export interface Options {
+ environment: core.Supplier;
+ /** Specify a custom URL to connect the client to. */
+ baseUrl?: core.Supplier;
+ token: core.Supplier;
+ fetcher?: core.FetchFunction;
+ }
- export interface RequestOptions {
- /** The maximum time to wait for a response in seconds. */
- timeoutInSeconds?: number;
- /** The number of times to retry the request. Defaults to 2. */
- maxRetries?: number;
- /** A hook to abort the request. */
- abortSignal?: AbortSignal;
- /** Additional headers to include in the request. */
- headers?: Record;
- }
+ export interface RequestOptions {
+ /** The maximum time to wait for a response in seconds. */
+ timeoutInSeconds?: number;
+ /** The number of times to retry the request. Defaults to 2. */
+ maxRetries?: number;
+ /** A hook to abort the request. */
+ abortSignal?: AbortSignal;
+ /** Additional headers to include in the request. */
+ headers?: Record;
+ }
}
export class Datacenters {
- constructor(protected readonly _options: Datacenters.Options) {}
+ constructor(protected readonly _options: Datacenters.Options) {}
- /**
- * @param {Datacenters.RequestOptions} requestOptions - Request-specific configuration.
- *
- * @example
- * await client.datacenters.list()
- */
- public async list(requestOptions?: Datacenters.RequestOptions): Promise {
- const _response = await (this._options.fetcher ?? core.fetcher)({
- url: urlJoin(
- (await core.Supplier.get(this._options.baseUrl)) ??
- (await core.Supplier.get(this._options.environment)),
- "datacenters",
- ),
- method: "GET",
- headers: {
- Authorization: await this._getAuthorizationHeader(),
- "X-Fern-Language": "JavaScript",
- "X-Fern-Runtime": core.RUNTIME.type,
- "X-Fern-Runtime-Version": core.RUNTIME.version,
- ...requestOptions?.headers,
- },
- contentType: "application/json",
- requestType: "json",
- timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 180000,
- maxRetries: requestOptions?.maxRetries,
- abortSignal: requestOptions?.abortSignal,
- });
- if (_response.ok) {
- return serializers.DatacentersListResponse.parseOrThrow(_response.body, {
- unrecognizedObjectKeys: "passthrough",
- allowUnrecognizedUnionMembers: true,
- allowUnrecognizedEnumValues: true,
- skipValidation: true,
- breadcrumbsPrefix: ["response"],
- });
- }
+ /**
+ * @param {Datacenters.RequestOptions} requestOptions - Request-specific configuration.
+ *
+ * @example
+ * await client.datacenters.list()
+ */
+ public async list(
+ requestOptions?: Datacenters.RequestOptions,
+ ): Promise {
+ const _response = await (this._options.fetcher ?? core.fetcher)({
+ url: urlJoin(
+ (await core.Supplier.get(this._options.baseUrl)) ??
+ (await core.Supplier.get(this._options.environment)),
+ "datacenters",
+ ),
+ method: "GET",
+ headers: {
+ Authorization: await this._getAuthorizationHeader(),
+ "X-Fern-Language": "JavaScript",
+ "X-Fern-Runtime": core.RUNTIME.type,
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
+ ...requestOptions?.headers,
+ },
+ contentType: "application/json",
+ requestType: "json",
+ timeoutMs:
+ requestOptions?.timeoutInSeconds != null
+ ? requestOptions.timeoutInSeconds * 1000
+ : 180000,
+ maxRetries: requestOptions?.maxRetries,
+ abortSignal: requestOptions?.abortSignal,
+ });
+ if (_response.ok) {
+ return serializers.DatacentersListResponse.parseOrThrow(
+ _response.body,
+ {
+ unrecognizedObjectKeys: "passthrough",
+ allowUnrecognizedUnionMembers: true,
+ allowUnrecognizedEnumValues: true,
+ skipValidation: true,
+ breadcrumbsPrefix: ["response"],
+ },
+ );
+ }
- if (_response.error.reason === "status-code") {
- throw new errors.RivetError({
- statusCode: _response.error.statusCode,
- body: _response.error.body,
- });
- }
+ if (_response.error.reason === "status-code") {
+ throw new errors.RivetError({
+ statusCode: _response.error.statusCode,
+ body: _response.error.body,
+ });
+ }
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.RivetError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- });
- case "timeout":
- throw new errors.RivetTimeoutError("Timeout exceeded when calling GET /datacenters.");
- case "unknown":
- throw new errors.RivetError({
- message: _response.error.errorMessage,
- });
- }
- }
+ switch (_response.error.reason) {
+ case "non-json":
+ throw new errors.RivetError({
+ statusCode: _response.error.statusCode,
+ body: _response.error.rawBody,
+ });
+ case "timeout":
+ throw new errors.RivetTimeoutError(
+ "Timeout exceeded when calling GET /datacenters.",
+ );
+ case "unknown":
+ throw new errors.RivetError({
+ message: _response.error.errorMessage,
+ });
+ }
+ }
- protected async _getAuthorizationHeader(): Promise {
- return `Bearer ${await core.Supplier.get(this._options.token)}`;
- }
+ protected async _getAuthorizationHeader(): Promise {
+ return `Bearer ${await core.Supplier.get(this._options.token)}`;
+ }
}
diff --git a/engine/sdks/typescript/api-full/src/api/resources/health/client/Client.ts b/engine/sdks/typescript/api-full/src/api/resources/health/client/Client.ts
index 5e8c9429a1..2089655c85 100644
--- a/engine/sdks/typescript/api-full/src/api/resources/health/client/Client.ts
+++ b/engine/sdks/typescript/api-full/src/api/resources/health/client/Client.ts
@@ -2,96 +2,106 @@
* This file was auto-generated by Fern from our API Definition.
*/
-import * as core from "../../../../core";
-import * as Rivet from "../../../index";
import urlJoin from "url-join";
-import * as serializers from "../../../../serialization/index";
+import * as core from "../../../../core";
import * as errors from "../../../../errors/index";
+import * as serializers from "../../../../serialization/index";
+import type * as Rivet from "../../../index";
export declare namespace Health {
- export interface Options {
- environment: core.Supplier;
- /** Specify a custom URL to connect the client to. */
- baseUrl?: core.Supplier;
- token: core.Supplier;
- fetcher?: core.FetchFunction;
- }
+ export interface Options {
+ environment: core.Supplier;
+ /** Specify a custom URL to connect the client to. */
+ baseUrl?: core.Supplier;
+ token: core.Supplier;
+ fetcher?: core.FetchFunction;
+ }
- export interface RequestOptions {
- /** The maximum time to wait for a response in seconds. */
- timeoutInSeconds?: number;
- /** The number of times to retry the request. Defaults to 2. */
- maxRetries?: number;
- /** A hook to abort the request. */
- abortSignal?: AbortSignal;
- /** Additional headers to include in the request. */
- headers?: Record;
- }
+ export interface RequestOptions {
+ /** The maximum time to wait for a response in seconds. */
+ timeoutInSeconds?: number;
+ /** The number of times to retry the request. Defaults to 2. */
+ maxRetries?: number;
+ /** A hook to abort the request. */
+ abortSignal?: AbortSignal;
+ /** Additional headers to include in the request. */
+ headers?: Record;
+ }
}
export class Health {
- constructor(protected readonly _options: Health.Options) {}
+ constructor(protected readonly _options: Health.Options) {}
- /**
- * @param {Health.RequestOptions} requestOptions - Request-specific configuration.
- *
- * @example
- * await client.health.fanout()
- */
- public async fanout(requestOptions?: Health.RequestOptions): Promise {
- const _response = await (this._options.fetcher ?? core.fetcher)({
- url: urlJoin(
- (await core.Supplier.get(this._options.baseUrl)) ??
- (await core.Supplier.get(this._options.environment)),
- "health/fanout",
- ),
- method: "GET",
- headers: {
- Authorization: await this._getAuthorizationHeader(),
- "X-Fern-Language": "JavaScript",
- "X-Fern-Runtime": core.RUNTIME.type,
- "X-Fern-Runtime-Version": core.RUNTIME.version,
- ...requestOptions?.headers,
- },
- contentType: "application/json",
- requestType: "json",
- timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 180000,
- maxRetries: requestOptions?.maxRetries,
- abortSignal: requestOptions?.abortSignal,
- });
- if (_response.ok) {
- return serializers.HealthFanoutResponse.parseOrThrow(_response.body, {
- unrecognizedObjectKeys: "passthrough",
- allowUnrecognizedUnionMembers: true,
- allowUnrecognizedEnumValues: true,
- skipValidation: true,
- breadcrumbsPrefix: ["response"],
- });
- }
+ /**
+ * @param {Health.RequestOptions} requestOptions - Request-specific configuration.
+ *
+ * @example
+ * await client.health.fanout()
+ */
+ public async fanout(
+ requestOptions?: Health.RequestOptions,
+ ): Promise {
+ const _response = await (this._options.fetcher ?? core.fetcher)({
+ url: urlJoin(
+ (await core.Supplier.get(this._options.baseUrl)) ??
+ (await core.Supplier.get(this._options.environment)),
+ "health/fanout",
+ ),
+ method: "GET",
+ headers: {
+ Authorization: await this._getAuthorizationHeader(),
+ "X-Fern-Language": "JavaScript",
+ "X-Fern-Runtime": core.RUNTIME.type,
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
+ ...requestOptions?.headers,
+ },
+ contentType: "application/json",
+ requestType: "json",
+ timeoutMs:
+ requestOptions?.timeoutInSeconds != null
+ ? requestOptions.timeoutInSeconds * 1000
+ : 180000,
+ maxRetries: requestOptions?.maxRetries,
+ abortSignal: requestOptions?.abortSignal,
+ });
+ if (_response.ok) {
+ return serializers.HealthFanoutResponse.parseOrThrow(
+ _response.body,
+ {
+ unrecognizedObjectKeys: "passthrough",
+ allowUnrecognizedUnionMembers: true,
+ allowUnrecognizedEnumValues: true,
+ skipValidation: true,
+ breadcrumbsPrefix: ["response"],
+ },
+ );
+ }
- if (_response.error.reason === "status-code") {
- throw new errors.RivetError({
- statusCode: _response.error.statusCode,
- body: _response.error.body,
- });
- }
+ if (_response.error.reason === "status-code") {
+ throw new errors.RivetError({
+ statusCode: _response.error.statusCode,
+ body: _response.error.body,
+ });
+ }
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.RivetError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- });
- case "timeout":
- throw new errors.RivetTimeoutError("Timeout exceeded when calling GET /health/fanout.");
- case "unknown":
- throw new errors.RivetError({
- message: _response.error.errorMessage,
- });
- }
- }
+ switch (_response.error.reason) {
+ case "non-json":
+ throw new errors.RivetError({
+ statusCode: _response.error.statusCode,
+ body: _response.error.rawBody,
+ });
+ case "timeout":
+ throw new errors.RivetTimeoutError(
+ "Timeout exceeded when calling GET /health/fanout.",
+ );
+ case "unknown":
+ throw new errors.RivetError({
+ message: _response.error.errorMessage,
+ });
+ }
+ }
- protected async _getAuthorizationHeader(): Promise {
- return `Bearer ${await core.Supplier.get(this._options.token)}`;
- }
+ protected async _getAuthorizationHeader(): Promise {
+ return `Bearer ${await core.Supplier.get(this._options.token)}`;
+ }
}
diff --git a/engine/sdks/typescript/api-full/src/api/resources/index.ts b/engine/sdks/typescript/api-full/src/api/resources/index.ts
index a4b84038b3..c05612fe67 100644
--- a/engine/sdks/typescript/api-full/src/api/resources/index.ts
+++ b/engine/sdks/typescript/api-full/src/api/resources/index.ts
@@ -1,6 +1,6 @@
export * as datacenters from "./datacenters";
export * as health from "./health";
export * as namespaces from "./namespaces";
-export * as runners from "./runners";
export * from "./namespaces/client/requests";
+export * as runners from "./runners";
export * from "./runners/client/requests";
diff --git a/engine/sdks/typescript/api-full/src/api/resources/namespaces/client/Client.ts b/engine/sdks/typescript/api-full/src/api/resources/namespaces/client/Client.ts
index 99f5e558bc..5c92597919 100644
--- a/engine/sdks/typescript/api-full/src/api/resources/namespaces/client/Client.ts
+++ b/engine/sdks/typescript/api-full/src/api/resources/namespaces/client/Client.ts
@@ -2,186 +2,207 @@
* This file was auto-generated by Fern from our API Definition.
*/
-import * as core from "../../../../core";
-import * as Rivet from "../../../index";
import urlJoin from "url-join";
-import * as serializers from "../../../../serialization/index";
+import * as core from "../../../../core";
import * as errors from "../../../../errors/index";
+import * as serializers from "../../../../serialization/index";
+import type * as Rivet from "../../../index";
export declare namespace Namespaces {
- export interface Options {
- environment: core.Supplier;
- /** Specify a custom URL to connect the client to. */
- baseUrl?: core.Supplier;
- token: core.Supplier;
- fetcher?: core.FetchFunction;
- }
+ export interface Options {
+ environment: core.Supplier;
+ /** Specify a custom URL to connect the client to. */
+ baseUrl?: core.Supplier;
+ token: core.Supplier;
+ fetcher?: core.FetchFunction;
+ }
- export interface RequestOptions {
- /** The maximum time to wait for a response in seconds. */
- timeoutInSeconds?: number;
- /** The number of times to retry the request. Defaults to 2. */
- maxRetries?: number;
- /** A hook to abort the request. */
- abortSignal?: AbortSignal;
- /** Additional headers to include in the request. */
- headers?: Record;
- }
+ export interface RequestOptions {
+ /** The maximum time to wait for a response in seconds. */
+ timeoutInSeconds?: number;
+ /** The number of times to retry the request. Defaults to 2. */
+ maxRetries?: number;
+ /** A hook to abort the request. */
+ abortSignal?: AbortSignal;
+ /** Additional headers to include in the request. */
+ headers?: Record;
+ }
}
export class Namespaces {
- constructor(protected readonly _options: Namespaces.Options) {}
+ constructor(protected readonly _options: Namespaces.Options) {}
- /**
- * @param {Rivet.NamespacesListRequest} request
- * @param {Namespaces.RequestOptions} requestOptions - Request-specific configuration.
- *
- * @example
- * await client.namespaces.list()
- */
- public async list(
- request: Rivet.NamespacesListRequest = {},
- requestOptions?: Namespaces.RequestOptions,
- ): Promise {
- const { limit, cursor, name, namespaceIds } = request;
- const _queryParams: Record = {};
- if (limit != null) {
- _queryParams["limit"] = limit.toString();
- }
+ /**
+ * @param {Rivet.NamespacesListRequest} request
+ * @param {Namespaces.RequestOptions} requestOptions - Request-specific configuration.
+ *
+ * @example
+ * await client.namespaces.list()
+ */
+ public async list(
+ request: Rivet.NamespacesListRequest = {},
+ requestOptions?: Namespaces.RequestOptions,
+ ): Promise {
+ const { limit, cursor, name, namespaceIds } = request;
+ const _queryParams: Record<
+ string,
+ string | string[] | object | object[] | null
+ > = {};
+ if (limit != null) {
+ _queryParams["limit"] = limit.toString();
+ }
- if (cursor != null) {
- _queryParams["cursor"] = cursor;
- }
+ if (cursor != null) {
+ _queryParams["cursor"] = cursor;
+ }
- if (name != null) {
- _queryParams["name"] = name;
- }
+ if (name != null) {
+ _queryParams["name"] = name;
+ }
- if (namespaceIds != null) {
- _queryParams["namespace_ids"] = namespaceIds;
- }
+ if (namespaceIds != null) {
+ _queryParams["namespace_ids"] = namespaceIds;
+ }
- const _response = await (this._options.fetcher ?? core.fetcher)({
- url: urlJoin(
- (await core.Supplier.get(this._options.baseUrl)) ??
- (await core.Supplier.get(this._options.environment)),
- "namespaces",
- ),
- method: "GET",
- headers: {
- Authorization: await this._getAuthorizationHeader(),
- "X-Fern-Language": "JavaScript",
- "X-Fern-Runtime": core.RUNTIME.type,
- "X-Fern-Runtime-Version": core.RUNTIME.version,
- ...requestOptions?.headers,
- },
- contentType: "application/json",
- queryParameters: _queryParams,
- requestType: "json",
- timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 180000,
- maxRetries: requestOptions?.maxRetries,
- abortSignal: requestOptions?.abortSignal,
- });
- if (_response.ok) {
- return serializers.NamespaceListResponse.parseOrThrow(_response.body, {
- unrecognizedObjectKeys: "passthrough",
- allowUnrecognizedUnionMembers: true,
- allowUnrecognizedEnumValues: true,
- skipValidation: true,
- breadcrumbsPrefix: ["response"],
- });
- }
+ const _response = await (this._options.fetcher ?? core.fetcher)({
+ url: urlJoin(
+ (await core.Supplier.get(this._options.baseUrl)) ??
+ (await core.Supplier.get(this._options.environment)),
+ "namespaces",
+ ),
+ method: "GET",
+ headers: {
+ Authorization: await this._getAuthorizationHeader(),
+ "X-Fern-Language": "JavaScript",
+ "X-Fern-Runtime": core.RUNTIME.type,
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
+ ...requestOptions?.headers,
+ },
+ contentType: "application/json",
+ queryParameters: _queryParams,
+ requestType: "json",
+ timeoutMs:
+ requestOptions?.timeoutInSeconds != null
+ ? requestOptions.timeoutInSeconds * 1000
+ : 180000,
+ maxRetries: requestOptions?.maxRetries,
+ abortSignal: requestOptions?.abortSignal,
+ });
+ if (_response.ok) {
+ return serializers.NamespaceListResponse.parseOrThrow(
+ _response.body,
+ {
+ unrecognizedObjectKeys: "passthrough",
+ allowUnrecognizedUnionMembers: true,
+ allowUnrecognizedEnumValues: true,
+ skipValidation: true,
+ breadcrumbsPrefix: ["response"],
+ },
+ );
+ }
- if (_response.error.reason === "status-code") {
- throw new errors.RivetError({
- statusCode: _response.error.statusCode,
- body: _response.error.body,
- });
- }
+ if (_response.error.reason === "status-code") {
+ throw new errors.RivetError({
+ statusCode: _response.error.statusCode,
+ body: _response.error.body,
+ });
+ }
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.RivetError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- });
- case "timeout":
- throw new errors.RivetTimeoutError("Timeout exceeded when calling GET /namespaces.");
- case "unknown":
- throw new errors.RivetError({
- message: _response.error.errorMessage,
- });
- }
- }
+ switch (_response.error.reason) {
+ case "non-json":
+ throw new errors.RivetError({
+ statusCode: _response.error.statusCode,
+ body: _response.error.rawBody,
+ });
+ case "timeout":
+ throw new errors.RivetTimeoutError(
+ "Timeout exceeded when calling GET /namespaces.",
+ );
+ case "unknown":
+ throw new errors.RivetError({
+ message: _response.error.errorMessage,
+ });
+ }
+ }
- /**
- * @param {Rivet.NamespacesCreateRequest} request
- * @param {Namespaces.RequestOptions} requestOptions - Request-specific configuration.
- *
- * @example
- * await client.namespaces.create({
- * displayName: "display_name",
- * name: "name"
- * })
- */
- public async create(
- request: Rivet.NamespacesCreateRequest,
- requestOptions?: Namespaces.RequestOptions,
- ): Promise {
- const _response = await (this._options.fetcher ?? core.fetcher)({
- url: urlJoin(
- (await core.Supplier.get(this._options.baseUrl)) ??
- (await core.Supplier.get(this._options.environment)),
- "namespaces",
- ),
- method: "POST",
- headers: {
- Authorization: await this._getAuthorizationHeader(),
- "X-Fern-Language": "JavaScript",
- "X-Fern-Runtime": core.RUNTIME.type,
- "X-Fern-Runtime-Version": core.RUNTIME.version,
- ...requestOptions?.headers,
- },
- contentType: "application/json",
- requestType: "json",
- body: serializers.NamespacesCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
- timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 180000,
- maxRetries: requestOptions?.maxRetries,
- abortSignal: requestOptions?.abortSignal,
- });
- if (_response.ok) {
- return serializers.NamespacesCreateResponse.parseOrThrow(_response.body, {
- unrecognizedObjectKeys: "passthrough",
- allowUnrecognizedUnionMembers: true,
- allowUnrecognizedEnumValues: true,
- skipValidation: true,
- breadcrumbsPrefix: ["response"],
- });
- }
+ /**
+ * @param {Rivet.NamespacesCreateRequest} request
+ * @param {Namespaces.RequestOptions} requestOptions - Request-specific configuration.
+ *
+ * @example
+ * await client.namespaces.create({
+ * displayName: "display_name",
+ * name: "name"
+ * })
+ */
+ public async create(
+ request: Rivet.NamespacesCreateRequest,
+ requestOptions?: Namespaces.RequestOptions,
+ ): Promise {
+ const _response = await (this._options.fetcher ?? core.fetcher)({
+ url: urlJoin(
+ (await core.Supplier.get(this._options.baseUrl)) ??
+ (await core.Supplier.get(this._options.environment)),
+ "namespaces",
+ ),
+ method: "POST",
+ headers: {
+ Authorization: await this._getAuthorizationHeader(),
+ "X-Fern-Language": "JavaScript",
+ "X-Fern-Runtime": core.RUNTIME.type,
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
+ ...requestOptions?.headers,
+ },
+ contentType: "application/json",
+ requestType: "json",
+ body: serializers.NamespacesCreateRequest.jsonOrThrow(request, {
+ unrecognizedObjectKeys: "strip",
+ }),
+ timeoutMs:
+ requestOptions?.timeoutInSeconds != null
+ ? requestOptions.timeoutInSeconds * 1000
+ : 180000,
+ maxRetries: requestOptions?.maxRetries,
+ abortSignal: requestOptions?.abortSignal,
+ });
+ if (_response.ok) {
+ return serializers.NamespacesCreateResponse.parseOrThrow(
+ _response.body,
+ {
+ unrecognizedObjectKeys: "passthrough",
+ allowUnrecognizedUnionMembers: true,
+ allowUnrecognizedEnumValues: true,
+ skipValidation: true,
+ breadcrumbsPrefix: ["response"],
+ },
+ );
+ }
- if (_response.error.reason === "status-code") {
- throw new errors.RivetError({
- statusCode: _response.error.statusCode,
- body: _response.error.body,
- });
- }
+ if (_response.error.reason === "status-code") {
+ throw new errors.RivetError({
+ statusCode: _response.error.statusCode,
+ body: _response.error.body,
+ });
+ }
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.RivetError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- });
- case "timeout":
- throw new errors.RivetTimeoutError("Timeout exceeded when calling POST /namespaces.");
- case "unknown":
- throw new errors.RivetError({
- message: _response.error.errorMessage,
- });
- }
- }
+ switch (_response.error.reason) {
+ case "non-json":
+ throw new errors.RivetError({
+ statusCode: _response.error.statusCode,
+ body: _response.error.rawBody,
+ });
+ case "timeout":
+ throw new errors.RivetTimeoutError(
+ "Timeout exceeded when calling POST /namespaces.",
+ );
+ case "unknown":
+ throw new errors.RivetError({
+ message: _response.error.errorMessage,
+ });
+ }
+ }
- protected async _getAuthorizationHeader(): Promise {
- return `Bearer ${await core.Supplier.get(this._options.token)}`;
- }
+ protected async _getAuthorizationHeader(): Promise {
+ return `Bearer ${await core.Supplier.get(this._options.token)}`;
+ }
}
diff --git a/engine/sdks/typescript/api-full/src/api/resources/namespaces/client/requests/NamespacesCreateRequest.ts b/engine/sdks/typescript/api-full/src/api/resources/namespaces/client/requests/NamespacesCreateRequest.ts
index 3d818a10f6..321f6e8fc9 100644
--- a/engine/sdks/typescript/api-full/src/api/resources/namespaces/client/requests/NamespacesCreateRequest.ts
+++ b/engine/sdks/typescript/api-full/src/api/resources/namespaces/client/requests/NamespacesCreateRequest.ts
@@ -10,6 +10,6 @@
* }
*/
export interface NamespacesCreateRequest {
- displayName: string;
- name: string;
+ displayName: string;
+ name: string;
}
diff --git a/engine/sdks/typescript/api-full/src/api/resources/namespaces/client/requests/NamespacesListRequest.ts b/engine/sdks/typescript/api-full/src/api/resources/namespaces/client/requests/NamespacesListRequest.ts
index c05f5d60a9..1aea7859a1 100644
--- a/engine/sdks/typescript/api-full/src/api/resources/namespaces/client/requests/NamespacesListRequest.ts
+++ b/engine/sdks/typescript/api-full/src/api/resources/namespaces/client/requests/NamespacesListRequest.ts
@@ -7,8 +7,8 @@
* {}
*/
export interface NamespacesListRequest {
- limit?: number;
- cursor?: string;
- name?: string;
- namespaceIds?: string;
+ limit?: number;
+ cursor?: string;
+ name?: string;
+ namespaceIds?: string;
}
diff --git a/engine/sdks/typescript/api-full/src/api/resources/namespaces/client/requests/index.ts b/engine/sdks/typescript/api-full/src/api/resources/namespaces/client/requests/index.ts
index b208f6192c..185f68756f 100644
--- a/engine/sdks/typescript/api-full/src/api/resources/namespaces/client/requests/index.ts
+++ b/engine/sdks/typescript/api-full/src/api/resources/namespaces/client/requests/index.ts
@@ -1,2 +1,2 @@
-export { type NamespacesListRequest } from "./NamespacesListRequest";
-export { type NamespacesCreateRequest } from "./NamespacesCreateRequest";
+export type { NamespacesCreateRequest } from "./NamespacesCreateRequest";
+export type { NamespacesListRequest } from "./NamespacesListRequest";
diff --git a/engine/sdks/typescript/api-full/src/api/resources/runners/client/Client.ts b/engine/sdks/typescript/api-full/src/api/resources/runners/client/Client.ts
index 770de7d8b0..efeb351b29 100644
--- a/engine/sdks/typescript/api-full/src/api/resources/runners/client/Client.ts
+++ b/engine/sdks/typescript/api-full/src/api/resources/runners/client/Client.ts
@@ -2,208 +2,231 @@
* This file was auto-generated by Fern from our API Definition.
*/
-import * as core from "../../../../core";
-import * as Rivet from "../../../index";
import urlJoin from "url-join";
-import * as serializers from "../../../../serialization/index";
+import * as core from "../../../../core";
import * as errors from "../../../../errors/index";
+import * as serializers from "../../../../serialization/index";
+import type * as Rivet from "../../../index";
export declare namespace Runners {
- export interface Options {
- environment: core.Supplier;
- /** Specify a custom URL to connect the client to. */
- baseUrl?: core.Supplier;
- token: core.Supplier;
- fetcher?: core.FetchFunction;
- }
-
- export interface RequestOptions {
- /** The maximum time to wait for a response in seconds. */
- timeoutInSeconds?: number;
- /** The number of times to retry the request. Defaults to 2. */
- maxRetries?: number;
- /** A hook to abort the request. */
- abortSignal?: AbortSignal;
- /** Additional headers to include in the request. */
- headers?: Record;
- }
+ export interface Options {
+ environment: core.Supplier;
+ /** Specify a custom URL to connect the client to. */
+ baseUrl?: core.Supplier;
+ token: core.Supplier;
+ fetcher?: core.FetchFunction;
+ }
+
+ export interface RequestOptions {
+ /** The maximum time to wait for a response in seconds. */
+ timeoutInSeconds?: number;
+ /** The number of times to retry the request. Defaults to 2. */
+ maxRetries?: number;
+ /** A hook to abort the request. */
+ abortSignal?: AbortSignal;
+ /** Additional headers to include in the request. */
+ headers?: Record;
+ }
}
export class Runners {
- constructor(protected readonly _options: Runners.Options) {}
-
- /**
- * @param {Rivet.RunnersListRequest} request
- * @param {Runners.RequestOptions} requestOptions - Request-specific configuration.
- *
- * @example
- * await client.runners.list({
- * namespace: "namespace"
- * })
- */
- public async list(
- request: Rivet.RunnersListRequest,
- requestOptions?: Runners.RequestOptions,
- ): Promise {
- const { namespace, name, runnerIds, includeStopped, limit, cursor } = request;
- const _queryParams: Record = {};
- _queryParams["namespace"] = namespace;
- if (name != null) {
- _queryParams["name"] = name;
- }
-
- if (runnerIds != null) {
- _queryParams["runner_ids"] = runnerIds;
- }
-
- if (includeStopped != null) {
- _queryParams["include_stopped"] = includeStopped.toString();
- }
-
- if (limit != null) {
- _queryParams["limit"] = limit.toString();
- }
-
- if (cursor != null) {
- _queryParams["cursor"] = cursor;
- }
-
- const _response = await (this._options.fetcher ?? core.fetcher)({
- url: urlJoin(
- (await core.Supplier.get(this._options.baseUrl)) ??
- (await core.Supplier.get(this._options.environment)),
- "runners",
- ),
- method: "GET",
- headers: {
- Authorization: await this._getAuthorizationHeader(),
- "X-Fern-Language": "JavaScript",
- "X-Fern-Runtime": core.RUNTIME.type,
- "X-Fern-Runtime-Version": core.RUNTIME.version,
- ...requestOptions?.headers,
- },
- contentType: "application/json",
- queryParameters: _queryParams,
- requestType: "json",
- timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 180000,
- maxRetries: requestOptions?.maxRetries,
- abortSignal: requestOptions?.abortSignal,
- });
- if (_response.ok) {
- return serializers.RunnersListResponse.parseOrThrow(_response.body, {
- unrecognizedObjectKeys: "passthrough",
- allowUnrecognizedUnionMembers: true,
- allowUnrecognizedEnumValues: true,
- skipValidation: true,
- breadcrumbsPrefix: ["response"],
- });
- }
-
- if (_response.error.reason === "status-code") {
- throw new errors.RivetError({
- statusCode: _response.error.statusCode,
- body: _response.error.body,
- });
- }
-
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.RivetError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- });
- case "timeout":
- throw new errors.RivetTimeoutError("Timeout exceeded when calling GET /runners.");
- case "unknown":
- throw new errors.RivetError({
- message: _response.error.errorMessage,
- });
- }
- }
-
- /**
- * 2 round trips:
- *
- * - GET /runners/names (fanout)
- * - [api-peer] namespace::ops::resolve_for_name_global
- *
- * @param {Rivet.RunnersListNamesRequest} request
- * @param {Runners.RequestOptions} requestOptions - Request-specific configuration.
- *
- * @example
- * await client.runners.listNames({
- * namespace: "namespace"
- * })
- */
- public async listNames(
- request: Rivet.RunnersListNamesRequest,
- requestOptions?: Runners.RequestOptions,
- ): Promise {
- const { namespace, limit, cursor } = request;
- const _queryParams: Record = {};
- _queryParams["namespace"] = namespace;
- if (limit != null) {
- _queryParams["limit"] = limit.toString();
- }
-
- if (cursor != null) {
- _queryParams["cursor"] = cursor;
- }
-
- const _response = await (this._options.fetcher ?? core.fetcher)({
- url: urlJoin(
- (await core.Supplier.get(this._options.baseUrl)) ??
- (await core.Supplier.get(this._options.environment)),
- "runners/names",
- ),
- method: "GET",
- headers: {
- Authorization: await this._getAuthorizationHeader(),
- "X-Fern-Language": "JavaScript",
- "X-Fern-Runtime": core.RUNTIME.type,
- "X-Fern-Runtime-Version": core.RUNTIME.version,
- ...requestOptions?.headers,
- },
- contentType: "application/json",
- queryParameters: _queryParams,
- requestType: "json",
- timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 180000,
- maxRetries: requestOptions?.maxRetries,
- abortSignal: requestOptions?.abortSignal,
- });
- if (_response.ok) {
- return serializers.RunnersListNamesResponse.parseOrThrow(_response.body, {
- unrecognizedObjectKeys: "passthrough",
- allowUnrecognizedUnionMembers: true,
- allowUnrecognizedEnumValues: true,
- skipValidation: true,
- breadcrumbsPrefix: ["response"],
- });
- }
-
- if (_response.error.reason === "status-code") {
- throw new errors.RivetError({
- statusCode: _response.error.statusCode,
- body: _response.error.body,
- });
- }
-
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.RivetError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- });
- case "timeout":
- throw new errors.RivetTimeoutError("Timeout exceeded when calling GET /runners/names.");
- case "unknown":
- throw new errors.RivetError({
- message: _response.error.errorMessage,
- });
- }
- }
-
- protected async _getAuthorizationHeader(): Promise {
- return `Bearer ${await core.Supplier.get(this._options.token)}`;
- }
+ constructor(protected readonly _options: Runners.Options) {}
+
+ /**
+ * @param {Rivet.RunnersListRequest} request
+ * @param {Runners.RequestOptions} requestOptions - Request-specific configuration.
+ *
+ * @example
+ * await client.runners.list({
+ * namespace: "namespace"
+ * })
+ */
+ public async list(
+ request: Rivet.RunnersListRequest,
+ requestOptions?: Runners.RequestOptions,
+ ): Promise {
+ const { namespace, name, runnerIds, includeStopped, limit, cursor } =
+ request;
+ const _queryParams: Record<
+ string,
+ string | string[] | object | object[] | null
+ > = {};
+ _queryParams["namespace"] = namespace;
+ if (name != null) {
+ _queryParams["name"] = name;
+ }
+
+ if (runnerIds != null) {
+ _queryParams["runner_ids"] = runnerIds;
+ }
+
+ if (includeStopped != null) {
+ _queryParams["include_stopped"] = includeStopped.toString();
+ }
+
+ if (limit != null) {
+ _queryParams["limit"] = limit.toString();
+ }
+
+ if (cursor != null) {
+ _queryParams["cursor"] = cursor;
+ }
+
+ const _response = await (this._options.fetcher ?? core.fetcher)({
+ url: urlJoin(
+ (await core.Supplier.get(this._options.baseUrl)) ??
+ (await core.Supplier.get(this._options.environment)),
+ "runners",
+ ),
+ method: "GET",
+ headers: {
+ Authorization: await this._getAuthorizationHeader(),
+ "X-Fern-Language": "JavaScript",
+ "X-Fern-Runtime": core.RUNTIME.type,
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
+ ...requestOptions?.headers,
+ },
+ contentType: "application/json",
+ queryParameters: _queryParams,
+ requestType: "json",
+ timeoutMs:
+ requestOptions?.timeoutInSeconds != null
+ ? requestOptions.timeoutInSeconds * 1000
+ : 180000,
+ maxRetries: requestOptions?.maxRetries,
+ abortSignal: requestOptions?.abortSignal,
+ });
+ if (_response.ok) {
+ return serializers.RunnersListResponse.parseOrThrow(
+ _response.body,
+ {
+ unrecognizedObjectKeys: "passthrough",
+ allowUnrecognizedUnionMembers: true,
+ allowUnrecognizedEnumValues: true,
+ skipValidation: true,
+ breadcrumbsPrefix: ["response"],
+ },
+ );
+ }
+
+ if (_response.error.reason === "status-code") {
+ throw new errors.RivetError({
+ statusCode: _response.error.statusCode,
+ body: _response.error.body,
+ });
+ }
+
+ switch (_response.error.reason) {
+ case "non-json":
+ throw new errors.RivetError({
+ statusCode: _response.error.statusCode,
+ body: _response.error.rawBody,
+ });
+ case "timeout":
+ throw new errors.RivetTimeoutError(
+ "Timeout exceeded when calling GET /runners.",
+ );
+ case "unknown":
+ throw new errors.RivetError({
+ message: _response.error.errorMessage,
+ });
+ }
+ }
+
+ /**
+ * 2 round trips:
+ *
+ * - GET /runners/names (fanout)
+ * - [api-peer] namespace::ops::resolve_for_name_global
+ *
+ * @param {Rivet.RunnersListNamesRequest} request
+ * @param {Runners.RequestOptions} requestOptions - Request-specific configuration.
+ *
+ * @example
+ * await client.runners.listNames({
+ * namespace: "namespace"
+ * })
+ */
+ public async listNames(
+ request: Rivet.RunnersListNamesRequest,
+ requestOptions?: Runners.RequestOptions,
+ ): Promise {
+ const { namespace, limit, cursor } = request;
+ const _queryParams: Record<
+ string,
+ string | string[] | object | object[] | null
+ > = {};
+ _queryParams["namespace"] = namespace;
+ if (limit != null) {
+ _queryParams["limit"] = limit.toString();
+ }
+
+ if (cursor != null) {
+ _queryParams["cursor"] = cursor;
+ }
+
+ const _response = await (this._options.fetcher ?? core.fetcher)({
+ url: urlJoin(
+ (await core.Supplier.get(this._options.baseUrl)) ??
+ (await core.Supplier.get(this._options.environment)),
+ "runners/names",
+ ),
+ method: "GET",
+ headers: {
+ Authorization: await this._getAuthorizationHeader(),
+ "X-Fern-Language": "JavaScript",
+ "X-Fern-Runtime": core.RUNTIME.type,
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
+ ...requestOptions?.headers,
+ },
+ contentType: "application/json",
+ queryParameters: _queryParams,
+ requestType: "json",
+ timeoutMs:
+ requestOptions?.timeoutInSeconds != null
+ ? requestOptions.timeoutInSeconds * 1000
+ : 180000,
+ maxRetries: requestOptions?.maxRetries,
+ abortSignal: requestOptions?.abortSignal,
+ });
+ if (_response.ok) {
+ return serializers.RunnersListNamesResponse.parseOrThrow(
+ _response.body,
+ {
+ unrecognizedObjectKeys: "passthrough",
+ allowUnrecognizedUnionMembers: true,
+ allowUnrecognizedEnumValues: true,
+ skipValidation: true,
+ breadcrumbsPrefix: ["response"],
+ },
+ );
+ }
+
+ if (_response.error.reason === "status-code") {
+ throw new errors.RivetError({
+ statusCode: _response.error.statusCode,
+ body: _response.error.body,
+ });
+ }
+
+ switch (_response.error.reason) {
+ case "non-json":
+ throw new errors.RivetError({
+ statusCode: _response.error.statusCode,
+ body: _response.error.rawBody,
+ });
+ case "timeout":
+ throw new errors.RivetTimeoutError(
+ "Timeout exceeded when calling GET /runners/names.",
+ );
+ case "unknown":
+ throw new errors.RivetError({
+ message: _response.error.errorMessage,
+ });
+ }
+ }
+
+ protected async _getAuthorizationHeader(): Promise {
+ return `Bearer ${await core.Supplier.get(this._options.token)}`;
+ }
}
diff --git a/engine/sdks/typescript/api-full/src/api/resources/runners/client/requests/RunnersListNamesRequest.ts b/engine/sdks/typescript/api-full/src/api/resources/runners/client/requests/RunnersListNamesRequest.ts
index 143884382a..74e2e841ce 100644
--- a/engine/sdks/typescript/api-full/src/api/resources/runners/client/requests/RunnersListNamesRequest.ts
+++ b/engine/sdks/typescript/api-full/src/api/resources/runners/client/requests/RunnersListNamesRequest.ts
@@ -9,7 +9,7 @@
* }
*/
export interface RunnersListNamesRequest {
- namespace: string;
- limit?: number;
- cursor?: string;
+ namespace: string;
+ limit?: number;
+ cursor?: string;
}
diff --git a/engine/sdks/typescript/api-full/src/api/resources/runners/client/requests/RunnersListRequest.ts b/engine/sdks/typescript/api-full/src/api/resources/runners/client/requests/RunnersListRequest.ts
index c8acfe7fe0..6ae004363a 100644
--- a/engine/sdks/typescript/api-full/src/api/resources/runners/client/requests/RunnersListRequest.ts
+++ b/engine/sdks/typescript/api-full/src/api/resources/runners/client/requests/RunnersListRequest.ts
@@ -9,10 +9,10 @@
* }
*/
export interface RunnersListRequest {
- namespace: string;
- name?: string;
- runnerIds?: string;
- includeStopped?: boolean;
- limit?: number;
- cursor?: string;
+ namespace: string;
+ name?: string;
+ runnerIds?: string;
+ includeStopped?: boolean;
+ limit?: number;
+ cursor?: string;
}
diff --git a/engine/sdks/typescript/api-full/src/api/resources/runners/client/requests/index.ts b/engine/sdks/typescript/api-full/src/api/resources/runners/client/requests/index.ts
index f0ed35df2c..362b43470a 100644
--- a/engine/sdks/typescript/api-full/src/api/resources/runners/client/requests/index.ts
+++ b/engine/sdks/typescript/api-full/src/api/resources/runners/client/requests/index.ts
@@ -1,2 +1,2 @@
-export { type RunnersListRequest } from "./RunnersListRequest";
-export { type RunnersListNamesRequest } from "./RunnersListNamesRequest";
+export type { RunnersListNamesRequest } from "./RunnersListNamesRequest";
+export type { RunnersListRequest } from "./RunnersListRequest";
diff --git a/engine/sdks/typescript/api-full/src/api/types/Actor.ts b/engine/sdks/typescript/api-full/src/api/types/Actor.ts
index aa5767136b..a63cef34b6 100644
--- a/engine/sdks/typescript/api-full/src/api/types/Actor.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/Actor.ts
@@ -2,20 +2,20 @@
* This file was auto-generated by Fern from our API Definition.
*/
-import * as Rivet from "../index";
+import type * as Rivet from "../index";
export interface Actor {
- actorId: Rivet.RivetId;
- connectableTs?: number;
- crashPolicy: Rivet.CrashPolicy;
- createTs: number;
- datacenter: string;
- destroyTs?: number;
- key?: string;
- name: string;
- namespaceId: Rivet.RivetId;
- pendingAllocationTs?: number;
- runnerNameSelector: string;
- sleepTs?: number;
- startTs?: number;
+ actorId: Rivet.RivetId;
+ connectableTs?: number;
+ crashPolicy: Rivet.CrashPolicy;
+ createTs: number;
+ datacenter: string;
+ destroyTs?: number;
+ key?: string;
+ name: string;
+ namespaceId: Rivet.RivetId;
+ pendingAllocationTs?: number;
+ runnerNameSelector: string;
+ sleepTs?: number;
+ startTs?: number;
}
diff --git a/engine/sdks/typescript/api-full/src/api/types/ActorName.ts b/engine/sdks/typescript/api-full/src/api/types/ActorName.ts
index 1b4c4108f2..dd2a5a9e17 100644
--- a/engine/sdks/typescript/api-full/src/api/types/ActorName.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/ActorName.ts
@@ -3,5 +3,5 @@
*/
export interface ActorName {
- metadata: Record;
+ metadata: Record;
}
diff --git a/engine/sdks/typescript/api-full/src/api/types/ActorsCreateResponse.ts b/engine/sdks/typescript/api-full/src/api/types/ActorsCreateResponse.ts
index 34b40b8d50..5602642bb8 100644
--- a/engine/sdks/typescript/api-full/src/api/types/ActorsCreateResponse.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/ActorsCreateResponse.ts
@@ -2,8 +2,8 @@
* This file was auto-generated by Fern from our API Definition.
*/
-import * as Rivet from "../index";
+import type * as Rivet from "../index";
export interface ActorsCreateResponse {
- actor: Rivet.Actor;
+ actor: Rivet.Actor;
}
diff --git a/engine/sdks/typescript/api-full/src/api/types/ActorsGetOrCreateResponse.ts b/engine/sdks/typescript/api-full/src/api/types/ActorsGetOrCreateResponse.ts
index 2bb0ed4c35..a5264b7a9e 100644
--- a/engine/sdks/typescript/api-full/src/api/types/ActorsGetOrCreateResponse.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/ActorsGetOrCreateResponse.ts
@@ -2,9 +2,9 @@
* This file was auto-generated by Fern from our API Definition.
*/
-import * as Rivet from "../index";
+import type * as Rivet from "../index";
export interface ActorsGetOrCreateResponse {
- actor: Rivet.Actor;
- created: boolean;
+ actor: Rivet.Actor;
+ created: boolean;
}
diff --git a/engine/sdks/typescript/api-full/src/api/types/ActorsListNamesResponse.ts b/engine/sdks/typescript/api-full/src/api/types/ActorsListNamesResponse.ts
index d3b5a8e9e9..41442a5ae3 100644
--- a/engine/sdks/typescript/api-full/src/api/types/ActorsListNamesResponse.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/ActorsListNamesResponse.ts
@@ -2,9 +2,9 @@
* This file was auto-generated by Fern from our API Definition.
*/
-import * as Rivet from "../index";
+import type * as Rivet from "../index";
export interface ActorsListNamesResponse {
- names: Record;
- pagination: Rivet.Pagination;
+ names: Record;
+ pagination: Rivet.Pagination;
}
diff --git a/engine/sdks/typescript/api-full/src/api/types/ActorsListResponse.ts b/engine/sdks/typescript/api-full/src/api/types/ActorsListResponse.ts
index 8e1810722c..e5b7b7c659 100644
--- a/engine/sdks/typescript/api-full/src/api/types/ActorsListResponse.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/ActorsListResponse.ts
@@ -2,9 +2,9 @@
* This file was auto-generated by Fern from our API Definition.
*/
-import * as Rivet from "../index";
+import type * as Rivet from "../index";
export interface ActorsListResponse {
- actors: Rivet.Actor[];
- pagination: Rivet.Pagination;
+ actors: Rivet.Actor[];
+ pagination: Rivet.Pagination;
}
diff --git a/engine/sdks/typescript/api-full/src/api/types/CrashPolicy.ts b/engine/sdks/typescript/api-full/src/api/types/CrashPolicy.ts
index d1cb7c898b..c8f20d2ff6 100644
--- a/engine/sdks/typescript/api-full/src/api/types/CrashPolicy.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/CrashPolicy.ts
@@ -4,7 +4,7 @@
export type CrashPolicy = "restart" | "sleep" | "destroy";
export const CrashPolicy = {
- Restart: "restart",
- Sleep: "sleep",
- Destroy: "destroy",
+ Restart: "restart",
+ Sleep: "sleep",
+ Destroy: "destroy",
} as const;
diff --git a/engine/sdks/typescript/api-full/src/api/types/Datacenter.ts b/engine/sdks/typescript/api-full/src/api/types/Datacenter.ts
index ecab146bfb..5d68b24409 100644
--- a/engine/sdks/typescript/api-full/src/api/types/Datacenter.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/Datacenter.ts
@@ -3,7 +3,7 @@
*/
export interface Datacenter {
- label: number;
- name: string;
- url: string;
+ label: number;
+ name: string;
+ url: string;
}
diff --git a/engine/sdks/typescript/api-full/src/api/types/DatacenterHealth.ts b/engine/sdks/typescript/api-full/src/api/types/DatacenterHealth.ts
index 278cfdc4ce..e75831c0e5 100644
--- a/engine/sdks/typescript/api-full/src/api/types/DatacenterHealth.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/DatacenterHealth.ts
@@ -2,13 +2,13 @@
* This file was auto-generated by Fern from our API Definition.
*/
-import * as Rivet from "../index";
+import type * as Rivet from "../index";
export interface DatacenterHealth {
- datacenterLabel: number;
- datacenterName: string;
- error?: string;
- response?: Rivet.HealthResponse;
- rttMs?: number;
- status: Rivet.HealthStatus;
+ datacenterLabel: number;
+ datacenterName: string;
+ error?: string;
+ response?: Rivet.HealthResponse;
+ rttMs?: number;
+ status: Rivet.HealthStatus;
}
diff --git a/engine/sdks/typescript/api-full/src/api/types/DatacentersListResponse.ts b/engine/sdks/typescript/api-full/src/api/types/DatacentersListResponse.ts
index 4cfc93f524..f4c314780d 100644
--- a/engine/sdks/typescript/api-full/src/api/types/DatacentersListResponse.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/DatacentersListResponse.ts
@@ -2,9 +2,9 @@
* This file was auto-generated by Fern from our API Definition.
*/
-import * as Rivet from "../index";
+import type * as Rivet from "../index";
export interface DatacentersListResponse {
- datacenters: Rivet.Datacenter[];
- pagination: Rivet.Pagination;
+ datacenters: Rivet.Datacenter[];
+ pagination: Rivet.Pagination;
}
diff --git a/engine/sdks/typescript/api-full/src/api/types/HealthFanoutResponse.ts b/engine/sdks/typescript/api-full/src/api/types/HealthFanoutResponse.ts
index 57c320d1bd..246f993e4b 100644
--- a/engine/sdks/typescript/api-full/src/api/types/HealthFanoutResponse.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/HealthFanoutResponse.ts
@@ -2,8 +2,8 @@
* This file was auto-generated by Fern from our API Definition.
*/
-import * as Rivet from "../index";
+import type * as Rivet from "../index";
export interface HealthFanoutResponse {
- datacenters: Rivet.DatacenterHealth[];
+ datacenters: Rivet.DatacenterHealth[];
}
diff --git a/engine/sdks/typescript/api-full/src/api/types/HealthResponse.ts b/engine/sdks/typescript/api-full/src/api/types/HealthResponse.ts
index e4dd9fea16..329e69c8b6 100644
--- a/engine/sdks/typescript/api-full/src/api/types/HealthResponse.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/HealthResponse.ts
@@ -3,7 +3,7 @@
*/
export interface HealthResponse {
- runtime: string;
- status: string;
- version: string;
+ runtime: string;
+ status: string;
+ version: string;
}
diff --git a/engine/sdks/typescript/api-full/src/api/types/HealthStatus.ts b/engine/sdks/typescript/api-full/src/api/types/HealthStatus.ts
index ebdc7640eb..e8b0d5a2cf 100644
--- a/engine/sdks/typescript/api-full/src/api/types/HealthStatus.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/HealthStatus.ts
@@ -4,6 +4,6 @@
export type HealthStatus = "ok" | "error";
export const HealthStatus = {
- Ok: "ok",
- Error: "error",
+ Ok: "ok",
+ Error: "error",
} as const;
diff --git a/engine/sdks/typescript/api-full/src/api/types/Namespace.ts b/engine/sdks/typescript/api-full/src/api/types/Namespace.ts
index 25ae252fdb..5fac545387 100644
--- a/engine/sdks/typescript/api-full/src/api/types/Namespace.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/Namespace.ts
@@ -2,11 +2,11 @@
* This file was auto-generated by Fern from our API Definition.
*/
-import * as Rivet from "../index";
+import type * as Rivet from "../index";
export interface Namespace {
- createTs: number;
- displayName: string;
- name: string;
- namespaceId: Rivet.RivetId;
+ createTs: number;
+ displayName: string;
+ name: string;
+ namespaceId: Rivet.RivetId;
}
diff --git a/engine/sdks/typescript/api-full/src/api/types/NamespaceListResponse.ts b/engine/sdks/typescript/api-full/src/api/types/NamespaceListResponse.ts
index 13231f665d..49dff82617 100644
--- a/engine/sdks/typescript/api-full/src/api/types/NamespaceListResponse.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/NamespaceListResponse.ts
@@ -2,9 +2,9 @@
* This file was auto-generated by Fern from our API Definition.
*/
-import * as Rivet from "../index";
+import type * as Rivet from "../index";
export interface NamespaceListResponse {
- namespaces: Rivet.Namespace[];
- pagination: Rivet.Pagination;
+ namespaces: Rivet.Namespace[];
+ pagination: Rivet.Pagination;
}
diff --git a/engine/sdks/typescript/api-full/src/api/types/NamespacesCreateResponse.ts b/engine/sdks/typescript/api-full/src/api/types/NamespacesCreateResponse.ts
index dcc839b2d5..5509c447a8 100644
--- a/engine/sdks/typescript/api-full/src/api/types/NamespacesCreateResponse.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/NamespacesCreateResponse.ts
@@ -2,8 +2,8 @@
* This file was auto-generated by Fern from our API Definition.
*/
-import * as Rivet from "../index";
+import type * as Rivet from "../index";
export interface NamespacesCreateResponse {
- namespace: Rivet.Namespace;
+ namespace: Rivet.Namespace;
}
diff --git a/engine/sdks/typescript/api-full/src/api/types/Pagination.ts b/engine/sdks/typescript/api-full/src/api/types/Pagination.ts
index e522fae428..02484f2178 100644
--- a/engine/sdks/typescript/api-full/src/api/types/Pagination.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/Pagination.ts
@@ -3,5 +3,5 @@
*/
export interface Pagination {
- cursor?: string;
+ cursor?: string;
}
diff --git a/engine/sdks/typescript/api-full/src/api/types/Runner.ts b/engine/sdks/typescript/api-full/src/api/types/Runner.ts
index b2e3cd5229..b3fd9aebff 100644
--- a/engine/sdks/typescript/api-full/src/api/types/Runner.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/Runner.ts
@@ -2,22 +2,22 @@
* This file was auto-generated by Fern from our API Definition.
*/
-import * as Rivet from "../index";
+import type * as Rivet from "../index";
export interface Runner {
- createTs: number;
- datacenter: string;
- drainTs?: number;
- key: string;
- lastConnectedTs?: number;
- lastPingTs: number;
- lastRtt: number;
- metadata?: Record;
- name: string;
- namespaceId: Rivet.RivetId;
- remainingSlots: number;
- runnerId: Rivet.RivetId;
- stopTs?: number;
- totalSlots: number;
- version: number;
+ createTs: number;
+ datacenter: string;
+ drainTs?: number;
+ key: string;
+ lastConnectedTs?: number;
+ lastPingTs: number;
+ lastRtt: number;
+ metadata?: Record;
+ name: string;
+ namespaceId: Rivet.RivetId;
+ remainingSlots: number;
+ runnerId: Rivet.RivetId;
+ stopTs?: number;
+ totalSlots: number;
+ version: number;
}
diff --git a/engine/sdks/typescript/api-full/src/api/types/RunnerConfig.ts b/engine/sdks/typescript/api-full/src/api/types/RunnerConfig.ts
index 8e02acf7cd..94f984171a 100644
--- a/engine/sdks/typescript/api-full/src/api/types/RunnerConfig.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/RunnerConfig.ts
@@ -2,10 +2,10 @@
* This file was auto-generated by Fern from our API Definition.
*/
-import * as Rivet from "../index";
+import type * as Rivet from "../index";
export interface RunnerConfig {
- normal?: Record;
- serverless?: Rivet.RunnerConfigServerless;
- metadata?: unknown;
+ normal?: Record;
+ serverless?: Rivet.RunnerConfigServerless;
+ metadata?: unknown;
}
diff --git a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigKind.ts b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigKind.ts
index edecc81241..5dc94cb3d3 100644
--- a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigKind.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigKind.ts
@@ -2,6 +2,8 @@
* This file was auto-generated by Fern from our API Definition.
*/
-import * as Rivet from "../index";
+import type * as Rivet from "../index";
-export type RunnerConfigKind = Rivet.RunnerConfigKindNormal | Rivet.RunnerConfigKindServerless;
+export type RunnerConfigKind =
+ | Rivet.RunnerConfigKindNormal
+ | Rivet.RunnerConfigKindServerless;
diff --git a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigKindNormal.ts b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigKindNormal.ts
index dde09f8e16..937ceb8f4b 100644
--- a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigKindNormal.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigKindNormal.ts
@@ -3,5 +3,5 @@
*/
export interface RunnerConfigKindNormal {
- normal: Record;
+ normal: Record;
}
diff --git a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigKindServerless.ts b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigKindServerless.ts
index 52684854af..ab07ab1152 100644
--- a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigKindServerless.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigKindServerless.ts
@@ -2,8 +2,8 @@
* This file was auto-generated by Fern from our API Definition.
*/
-import * as Rivet from "../index";
+import type * as Rivet from "../index";
export interface RunnerConfigKindServerless {
- serverless: Rivet.RunnerConfigKindServerlessServerless;
+ serverless: Rivet.RunnerConfigKindServerlessServerless;
}
diff --git a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigKindServerlessServerless.ts b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigKindServerlessServerless.ts
index 3a9808145b..455408e845 100644
--- a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigKindServerlessServerless.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigKindServerlessServerless.ts
@@ -3,12 +3,12 @@
*/
export interface RunnerConfigKindServerlessServerless {
- headers?: Record;
- maxRunners: number;
- minRunners?: number;
- /** Seconds. */
- requestLifespan: number;
- runnersMargin?: number;
- slotsPerRunner: number;
- url: string;
+ headers?: Record;
+ maxRunners: number;
+ minRunners?: number;
+ /** Seconds. */
+ requestLifespan: number;
+ runnersMargin?: number;
+ slotsPerRunner: number;
+ url: string;
}
diff --git a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigServerless.ts b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigServerless.ts
index e75fde98a2..f78c257880 100644
--- a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigServerless.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigServerless.ts
@@ -3,12 +3,12 @@
*/
export interface RunnerConfigServerless {
- headers?: Record;
- maxRunners: number;
- minRunners?: number;
- /** Seconds. */
- requestLifespan: number;
- runnersMargin?: number;
- slotsPerRunner: number;
- url: string;
+ headers?: Record;
+ maxRunners: number;
+ minRunners?: number;
+ /** Seconds. */
+ requestLifespan: number;
+ runnersMargin?: number;
+ slotsPerRunner: number;
+ url: string;
}
diff --git a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigVariant.ts b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigVariant.ts
index 6f76cf48d4..f60826e003 100644
--- a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigVariant.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigVariant.ts
@@ -4,6 +4,6 @@
export type RunnerConfigVariant = "serverless" | "normal";
export const RunnerConfigVariant = {
- Serverless: "serverless",
- Normal: "normal",
+ Serverless: "serverless",
+ Normal: "normal",
} as const;
diff --git a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsListResponse.ts b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsListResponse.ts
index ede4eb276a..7bb2471ed1 100644
--- a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsListResponse.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsListResponse.ts
@@ -2,9 +2,12 @@
* This file was auto-generated by Fern from our API Definition.
*/
-import * as Rivet from "../index";
+import type * as Rivet from "../index";
export interface RunnerConfigsListResponse {
- pagination: Rivet.Pagination;
- runnerConfigs: Record;
+ pagination: Rivet.Pagination;
+ runnerConfigs: Record<
+ string,
+ Rivet.RunnerConfigsListResponseRunnerConfigsValue
+ >;
}
diff --git a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsListResponseRunnerConfigsValue.ts b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsListResponseRunnerConfigsValue.ts
index fe5e93b6c8..334b45a567 100644
--- a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsListResponseRunnerConfigsValue.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsListResponseRunnerConfigsValue.ts
@@ -2,8 +2,8 @@
* This file was auto-generated by Fern from our API Definition.
*/
-import * as Rivet from "../index";
+import type * as Rivet from "../index";
export interface RunnerConfigsListResponseRunnerConfigsValue {
- datacenters: Record;
+ datacenters: Record;
}
diff --git a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessHealthCheckResponse.ts b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessHealthCheckResponse.ts
index 513161f5ae..5eb21af232 100644
--- a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessHealthCheckResponse.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessHealthCheckResponse.ts
@@ -2,8 +2,8 @@
* This file was auto-generated by Fern from our API Definition.
*/
-import * as Rivet from "../index";
+import type * as Rivet from "../index";
export type RunnerConfigsServerlessHealthCheckResponse =
- | Rivet.RunnerConfigsServerlessHealthCheckResponseSuccess
- | Rivet.RunnerConfigsServerlessHealthCheckResponseFailure;
+ | Rivet.RunnerConfigsServerlessHealthCheckResponseSuccess
+ | Rivet.RunnerConfigsServerlessHealthCheckResponseFailure;
diff --git a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessHealthCheckResponseFailure.ts b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessHealthCheckResponseFailure.ts
index 7095a1f5ae..c1e696ab52 100644
--- a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessHealthCheckResponseFailure.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessHealthCheckResponseFailure.ts
@@ -2,8 +2,8 @@
* This file was auto-generated by Fern from our API Definition.
*/
-import * as Rivet from "../index";
+import type * as Rivet from "../index";
export interface RunnerConfigsServerlessHealthCheckResponseFailure {
- failure: Rivet.RunnerConfigsServerlessHealthCheckResponseFailureFailure;
+ failure: Rivet.RunnerConfigsServerlessHealthCheckResponseFailureFailure;
}
diff --git a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessHealthCheckResponseFailureFailure.ts b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessHealthCheckResponseFailureFailure.ts
index dcb79a864f..e90f53e642 100644
--- a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessHealthCheckResponseFailureFailure.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessHealthCheckResponseFailureFailure.ts
@@ -2,8 +2,8 @@
* This file was auto-generated by Fern from our API Definition.
*/
-import * as Rivet from "../index";
+import type * as Rivet from "../index";
export interface RunnerConfigsServerlessHealthCheckResponseFailureFailure {
- error: Rivet.RunnerConfigsServerlessMetadataError;
+ error: Rivet.RunnerConfigsServerlessMetadataError;
}
diff --git a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessHealthCheckResponseSuccess.ts b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessHealthCheckResponseSuccess.ts
index 50a46485e9..3a58b2d192 100644
--- a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessHealthCheckResponseSuccess.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessHealthCheckResponseSuccess.ts
@@ -2,8 +2,8 @@
* This file was auto-generated by Fern from our API Definition.
*/
-import * as Rivet from "../index";
+import type * as Rivet from "../index";
export interface RunnerConfigsServerlessHealthCheckResponseSuccess {
- success: Rivet.RunnerConfigsServerlessHealthCheckResponseSuccessSuccess;
+ success: Rivet.RunnerConfigsServerlessHealthCheckResponseSuccessSuccess;
}
diff --git a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessHealthCheckResponseSuccessSuccess.ts b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessHealthCheckResponseSuccessSuccess.ts
index 933e8c7ccc..a10c666677 100644
--- a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessHealthCheckResponseSuccessSuccess.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessHealthCheckResponseSuccessSuccess.ts
@@ -3,5 +3,5 @@
*/
export interface RunnerConfigsServerlessHealthCheckResponseSuccessSuccess {
- version: string;
+ version: string;
}
diff --git a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessMetadataError.ts b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessMetadataError.ts
index 0b82020d82..41cbe889e8 100644
--- a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessMetadataError.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessMetadataError.ts
@@ -2,12 +2,12 @@
* This file was auto-generated by Fern from our API Definition.
*/
-import * as Rivet from "../index";
+import type * as Rivet from "../index";
export type RunnerConfigsServerlessMetadataError =
- | Rivet.RunnerConfigsServerlessMetadataErrorInvalidRequest
- | Rivet.RunnerConfigsServerlessMetadataErrorRequestFailed
- | Rivet.RunnerConfigsServerlessMetadataErrorRequestTimedOut
- | Rivet.RunnerConfigsServerlessMetadataErrorNonSuccessStatus
- | Rivet.RunnerConfigsServerlessMetadataErrorInvalidResponseJson
- | Rivet.RunnerConfigsServerlessMetadataErrorInvalidResponseSchema;
+ | Rivet.RunnerConfigsServerlessMetadataErrorInvalidRequest
+ | Rivet.RunnerConfigsServerlessMetadataErrorRequestFailed
+ | Rivet.RunnerConfigsServerlessMetadataErrorRequestTimedOut
+ | Rivet.RunnerConfigsServerlessMetadataErrorNonSuccessStatus
+ | Rivet.RunnerConfigsServerlessMetadataErrorInvalidResponseJson
+ | Rivet.RunnerConfigsServerlessMetadataErrorInvalidResponseSchema;
diff --git a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessMetadataErrorInvalidRequest.ts b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessMetadataErrorInvalidRequest.ts
index 8845cf2c26..f3519ef57e 100644
--- a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessMetadataErrorInvalidRequest.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessMetadataErrorInvalidRequest.ts
@@ -3,5 +3,5 @@
*/
export interface RunnerConfigsServerlessMetadataErrorInvalidRequest {
- invalidRequest: Record;
+ invalidRequest: Record;
}
diff --git a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessMetadataErrorInvalidResponseJson.ts b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessMetadataErrorInvalidResponseJson.ts
index 8d1d0ebe3d..aa1b3759e1 100644
--- a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessMetadataErrorInvalidResponseJson.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessMetadataErrorInvalidResponseJson.ts
@@ -2,8 +2,8 @@
* This file was auto-generated by Fern from our API Definition.
*/
-import * as Rivet from "../index";
+import type * as Rivet from "../index";
export interface RunnerConfigsServerlessMetadataErrorInvalidResponseJson {
- invalidResponseJson: Rivet.RunnerConfigsServerlessMetadataErrorInvalidResponseJsonInvalidResponseJson;
+ invalidResponseJson: Rivet.RunnerConfigsServerlessMetadataErrorInvalidResponseJsonInvalidResponseJson;
}
diff --git a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessMetadataErrorInvalidResponseJsonInvalidResponseJson.ts b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessMetadataErrorInvalidResponseJsonInvalidResponseJson.ts
index 569d39ec8b..193b2129c5 100644
--- a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessMetadataErrorInvalidResponseJsonInvalidResponseJson.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessMetadataErrorInvalidResponseJsonInvalidResponseJson.ts
@@ -3,5 +3,5 @@
*/
export interface RunnerConfigsServerlessMetadataErrorInvalidResponseJsonInvalidResponseJson {
- body: string;
+ body: string;
}
diff --git a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessMetadataErrorInvalidResponseSchema.ts b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessMetadataErrorInvalidResponseSchema.ts
index 26505b7fde..58bc4c1093 100644
--- a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessMetadataErrorInvalidResponseSchema.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessMetadataErrorInvalidResponseSchema.ts
@@ -2,8 +2,8 @@
* This file was auto-generated by Fern from our API Definition.
*/
-import * as Rivet from "../index";
+import type * as Rivet from "../index";
export interface RunnerConfigsServerlessMetadataErrorInvalidResponseSchema {
- invalidResponseSchema: Rivet.RunnerConfigsServerlessMetadataErrorInvalidResponseSchemaInvalidResponseSchema;
+ invalidResponseSchema: Rivet.RunnerConfigsServerlessMetadataErrorInvalidResponseSchemaInvalidResponseSchema;
}
diff --git a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessMetadataErrorInvalidResponseSchemaInvalidResponseSchema.ts b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessMetadataErrorInvalidResponseSchemaInvalidResponseSchema.ts
index c5bf7a60e9..b59ceb5f32 100644
--- a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessMetadataErrorInvalidResponseSchemaInvalidResponseSchema.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessMetadataErrorInvalidResponseSchemaInvalidResponseSchema.ts
@@ -3,6 +3,6 @@
*/
export interface RunnerConfigsServerlessMetadataErrorInvalidResponseSchemaInvalidResponseSchema {
- runtime: string;
- version: string;
+ runtime: string;
+ version: string;
}
diff --git a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessMetadataErrorNonSuccessStatus.ts b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessMetadataErrorNonSuccessStatus.ts
index fceb216fc9..9dcff448c7 100644
--- a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessMetadataErrorNonSuccessStatus.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessMetadataErrorNonSuccessStatus.ts
@@ -2,8 +2,8 @@
* This file was auto-generated by Fern from our API Definition.
*/
-import * as Rivet from "../index";
+import type * as Rivet from "../index";
export interface RunnerConfigsServerlessMetadataErrorNonSuccessStatus {
- nonSuccessStatus: Rivet.RunnerConfigsServerlessMetadataErrorNonSuccessStatusNonSuccessStatus;
+ nonSuccessStatus: Rivet.RunnerConfigsServerlessMetadataErrorNonSuccessStatusNonSuccessStatus;
}
diff --git a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessMetadataErrorNonSuccessStatusNonSuccessStatus.ts b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessMetadataErrorNonSuccessStatusNonSuccessStatus.ts
index 8d2e3fdffe..cd533f3bdb 100644
--- a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessMetadataErrorNonSuccessStatusNonSuccessStatus.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessMetadataErrorNonSuccessStatusNonSuccessStatus.ts
@@ -3,6 +3,6 @@
*/
export interface RunnerConfigsServerlessMetadataErrorNonSuccessStatusNonSuccessStatus {
- body: string;
- statusCode: number;
+ body: string;
+ statusCode: number;
}
diff --git a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessMetadataErrorRequestFailed.ts b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessMetadataErrorRequestFailed.ts
index 39cb079087..8b7d65f3bb 100644
--- a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessMetadataErrorRequestFailed.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessMetadataErrorRequestFailed.ts
@@ -3,5 +3,5 @@
*/
export interface RunnerConfigsServerlessMetadataErrorRequestFailed {
- requestFailed: Record;
+ requestFailed: Record;
}
diff --git a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessMetadataErrorRequestTimedOut.ts b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessMetadataErrorRequestTimedOut.ts
index 76abd10557..b0fe5a6fb4 100644
--- a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessMetadataErrorRequestTimedOut.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsServerlessMetadataErrorRequestTimedOut.ts
@@ -3,5 +3,5 @@
*/
export interface RunnerConfigsServerlessMetadataErrorRequestTimedOut {
- requestTimedOut: Record;
+ requestTimedOut: Record;
}
diff --git a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsUpsertResponse.ts b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsUpsertResponse.ts
index 5fbbcfbee0..f97bc1fff7 100644
--- a/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsUpsertResponse.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/RunnerConfigsUpsertResponse.ts
@@ -3,5 +3,5 @@
*/
export interface RunnerConfigsUpsertResponse {
- endpointConfigChanged: boolean;
+ endpointConfigChanged: boolean;
}
diff --git a/engine/sdks/typescript/api-full/src/api/types/RunnersListNamesResponse.ts b/engine/sdks/typescript/api-full/src/api/types/RunnersListNamesResponse.ts
index 2f7efdfe40..db0cf30739 100644
--- a/engine/sdks/typescript/api-full/src/api/types/RunnersListNamesResponse.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/RunnersListNamesResponse.ts
@@ -2,9 +2,9 @@
* This file was auto-generated by Fern from our API Definition.
*/
-import * as Rivet from "../index";
+import type * as Rivet from "../index";
export interface RunnersListNamesResponse {
- names: string[];
- pagination: Rivet.Pagination;
+ names: string[];
+ pagination: Rivet.Pagination;
}
diff --git a/engine/sdks/typescript/api-full/src/api/types/RunnersListResponse.ts b/engine/sdks/typescript/api-full/src/api/types/RunnersListResponse.ts
index 39a091dcfe..936cc5e506 100644
--- a/engine/sdks/typescript/api-full/src/api/types/RunnersListResponse.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/RunnersListResponse.ts
@@ -2,9 +2,9 @@
* This file was auto-generated by Fern from our API Definition.
*/
-import * as Rivet from "../index";
+import type * as Rivet from "../index";
export interface RunnersListResponse {
- pagination: Rivet.Pagination;
- runners: Rivet.Runner[];
+ pagination: Rivet.Pagination;
+ runners: Rivet.Runner[];
}
diff --git a/engine/sdks/typescript/api-full/src/api/types/index.ts b/engine/sdks/typescript/api-full/src/api/types/index.ts
index a665560e68..add9ad5efe 100644
--- a/engine/sdks/typescript/api-full/src/api/types/index.ts
+++ b/engine/sdks/typescript/api-full/src/api/types/index.ts
@@ -18,33 +18,33 @@ export * from "./NamespacesCreateResponse";
export * from "./Pagination";
export * from "./RivetId";
export * from "./Runner";
-export * from "./RunnerConfigServerless";
export * from "./RunnerConfig";
+export * from "./RunnerConfigKind";
export * from "./RunnerConfigKindNormal";
-export * from "./RunnerConfigKindServerlessServerless";
export * from "./RunnerConfigKindServerless";
-export * from "./RunnerConfigKind";
-export * from "./RunnerConfigVariant";
+export * from "./RunnerConfigKindServerlessServerless";
+export * from "./RunnerConfigServerless";
export * from "./RunnerConfigsDeleteResponse";
export * from "./RunnerConfigsListResponse";
export * from "./RunnerConfigsListResponseRunnerConfigsValue";
export * from "./RunnerConfigsRefreshMetadataRequestBody";
export * from "./RunnerConfigsRefreshMetadataResponse";
-export * from "./RunnerConfigsServerlessHealthCheckResponseSuccessSuccess";
-export * from "./RunnerConfigsServerlessHealthCheckResponseSuccess";
-export * from "./RunnerConfigsServerlessHealthCheckResponseFailureFailure";
-export * from "./RunnerConfigsServerlessHealthCheckResponseFailure";
export * from "./RunnerConfigsServerlessHealthCheckResponse";
+export * from "./RunnerConfigsServerlessHealthCheckResponseFailure";
+export * from "./RunnerConfigsServerlessHealthCheckResponseFailureFailure";
+export * from "./RunnerConfigsServerlessHealthCheckResponseSuccess";
+export * from "./RunnerConfigsServerlessHealthCheckResponseSuccessSuccess";
+export * from "./RunnerConfigsServerlessMetadataError";
export * from "./RunnerConfigsServerlessMetadataErrorInvalidRequest";
-export * from "./RunnerConfigsServerlessMetadataErrorRequestFailed";
-export * from "./RunnerConfigsServerlessMetadataErrorRequestTimedOut";
-export * from "./RunnerConfigsServerlessMetadataErrorNonSuccessStatusNonSuccessStatus";
-export * from "./RunnerConfigsServerlessMetadataErrorNonSuccessStatus";
-export * from "./RunnerConfigsServerlessMetadataErrorInvalidResponseJsonInvalidResponseJson";
export * from "./RunnerConfigsServerlessMetadataErrorInvalidResponseJson";
-export * from "./RunnerConfigsServerlessMetadataErrorInvalidResponseSchemaInvalidResponseSchema";
+export * from "./RunnerConfigsServerlessMetadataErrorInvalidResponseJsonInvalidResponseJson";
export * from "./RunnerConfigsServerlessMetadataErrorInvalidResponseSchema";
-export * from "./RunnerConfigsServerlessMetadataError";
+export * from "./RunnerConfigsServerlessMetadataErrorInvalidResponseSchemaInvalidResponseSchema";
+export * from "./RunnerConfigsServerlessMetadataErrorNonSuccessStatus";
+export * from "./RunnerConfigsServerlessMetadataErrorNonSuccessStatusNonSuccessStatus";
+export * from "./RunnerConfigsServerlessMetadataErrorRequestFailed";
+export * from "./RunnerConfigsServerlessMetadataErrorRequestTimedOut";
export * from "./RunnerConfigsUpsertResponse";
+export * from "./RunnerConfigVariant";
export * from "./RunnersListNamesResponse";
export * from "./RunnersListResponse";
diff --git a/engine/sdks/typescript/api-full/src/core/auth/BasicAuth.ts b/engine/sdks/typescript/api-full/src/core/auth/BasicAuth.ts
index 146df2150a..3b683ee73b 100644
--- a/engine/sdks/typescript/api-full/src/core/auth/BasicAuth.ts
+++ b/engine/sdks/typescript/api-full/src/core/auth/BasicAuth.ts
@@ -1,31 +1,35 @@
import { Base64 } from "js-base64";
export interface BasicAuth {
- username: string;
- password: string;
+ username: string;
+ password: string;
}
const BASIC_AUTH_HEADER_PREFIX = /^Basic /i;
export const BasicAuth = {
- toAuthorizationHeader: (basicAuth: BasicAuth | undefined): string | undefined => {
- if (basicAuth == null) {
- return undefined;
- }
- const token = Base64.encode(`${basicAuth.username}:${basicAuth.password}`);
- return `Basic ${token}`;
- },
- fromAuthorizationHeader: (header: string): BasicAuth => {
- const credentials = header.replace(BASIC_AUTH_HEADER_PREFIX, "");
- const decoded = Base64.decode(credentials);
- const [username, password] = decoded.split(":", 2);
+ toAuthorizationHeader: (
+ basicAuth: BasicAuth | undefined,
+ ): string | undefined => {
+ if (basicAuth == null) {
+ return undefined;
+ }
+ const token = Base64.encode(
+ `${basicAuth.username}:${basicAuth.password}`,
+ );
+ return `Basic ${token}`;
+ },
+ fromAuthorizationHeader: (header: string): BasicAuth => {
+ const credentials = header.replace(BASIC_AUTH_HEADER_PREFIX, "");
+ const decoded = Base64.decode(credentials);
+ const [username, password] = decoded.split(":", 2);
- if (username == null || password == null) {
- throw new Error("Invalid basic auth");
- }
- return {
- username,
- password,
- };
- },
+ if (username == null || password == null) {
+ throw new Error("Invalid basic auth");
+ }
+ return {
+ username,
+ password,
+ };
+ },
};
diff --git a/engine/sdks/typescript/api-full/src/core/auth/BearerToken.ts b/engine/sdks/typescript/api-full/src/core/auth/BearerToken.ts
index fe987fc9c4..f5f265bcab 100644
--- a/engine/sdks/typescript/api-full/src/core/auth/BearerToken.ts
+++ b/engine/sdks/typescript/api-full/src/core/auth/BearerToken.ts
@@ -3,13 +3,17 @@ export type BearerToken = string;
const BEARER_AUTH_HEADER_PREFIX = /^Bearer /i;
export const BearerToken = {
- toAuthorizationHeader: (token: BearerToken | undefined): string | undefined => {
- if (token == null) {
- return undefined;
- }
- return `Bearer ${token}`;
- },
- fromAuthorizationHeader: (header: string): BearerToken => {
- return header.replace(BEARER_AUTH_HEADER_PREFIX, "").trim() as BearerToken;
- },
+ toAuthorizationHeader: (
+ token: BearerToken | undefined,
+ ): string | undefined => {
+ if (token == null) {
+ return undefined;
+ }
+ return `Bearer ${token}`;
+ },
+ fromAuthorizationHeader: (header: string): BearerToken => {
+ return header
+ .replace(BEARER_AUTH_HEADER_PREFIX, "")
+ .trim() as BearerToken;
+ },
};
diff --git a/engine/sdks/typescript/api-full/src/core/fetcher/APIResponse.ts b/engine/sdks/typescript/api-full/src/core/fetcher/APIResponse.ts
index 3664d09e16..bf5b2f2997 100644
--- a/engine/sdks/typescript/api-full/src/core/fetcher/APIResponse.ts
+++ b/engine/sdks/typescript/api-full/src/core/fetcher/APIResponse.ts
@@ -1,12 +1,14 @@
-export type APIResponse = SuccessfulResponse | FailedResponse;
+export type APIResponse =
+ | SuccessfulResponse
+ | FailedResponse;
export interface SuccessfulResponse {
- ok: true;
- body: T;
- headers?: Record;
+ ok: true;
+ body: T;
+ headers?: Record;
}
export interface FailedResponse {
- ok: false;
- error: T;
+ ok: false;
+ error: T;
}
diff --git a/engine/sdks/typescript/api-full/src/core/fetcher/Fetcher.ts b/engine/sdks/typescript/api-full/src/core/fetcher/Fetcher.ts
index f3ee18ee80..547db947f0 100644
--- a/engine/sdks/typescript/api-full/src/core/fetcher/Fetcher.ts
+++ b/engine/sdks/typescript/api-full/src/core/fetcher/Fetcher.ts
@@ -1,5 +1,5 @@
import { toJson } from "../json";
-import { APIResponse } from "./APIResponse";
+import type { APIResponse } from "./APIResponse";
import { createRequestUrl } from "./createRequestUrl";
import { getFetchFn } from "./getFetchFn";
import { getRequestBody } from "./getRequestBody";
@@ -7,138 +7,155 @@ import { getResponseBody } from "./getResponseBody";
import { makeRequest } from "./makeRequest";
import { requestWithRetries } from "./requestWithRetries";
-export type FetchFunction = (args: Fetcher.Args) => Promise>;
+export type FetchFunction = (
+ args: Fetcher.Args,
+) => Promise>;
export declare namespace Fetcher {
- export interface Args {
- url: string;
- method: string;
- contentType?: string;
- headers?: Record;
- queryParameters?: Record;
- body?: unknown;
- timeoutMs?: number;
- maxRetries?: number;
- withCredentials?: boolean;
- abortSignal?: AbortSignal;
- requestType?: "json" | "file" | "bytes";
- responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer";
- duplex?: "half";
- }
+ export interface Args {
+ url: string;
+ method: string;
+ contentType?: string;
+ headers?: Record;
+ queryParameters?: Record<
+ string,
+ string | string[] | object | object[] | null
+ >;
+ body?: unknown;
+ timeoutMs?: number;
+ maxRetries?: number;
+ withCredentials?: boolean;
+ abortSignal?: AbortSignal;
+ requestType?: "json" | "file" | "bytes";
+ responseType?:
+ | "json"
+ | "blob"
+ | "sse"
+ | "streaming"
+ | "text"
+ | "arrayBuffer";
+ duplex?: "half";
+ }
- export type Error = FailedStatusCodeError | NonJsonError | TimeoutError | UnknownError;
+ export type Error =
+ | FailedStatusCodeError
+ | NonJsonError
+ | TimeoutError
+ | UnknownError;
- export interface FailedStatusCodeError {
- reason: "status-code";
- statusCode: number;
- body: unknown;
- }
+ export interface FailedStatusCodeError {
+ reason: "status-code";
+ statusCode: number;
+ body: unknown;
+ }
- export interface NonJsonError {
- reason: "non-json";
- statusCode: number;
- rawBody: string;
- }
+ export interface NonJsonError {
+ reason: "non-json";
+ statusCode: number;
+ rawBody: string;
+ }
- export interface TimeoutError {
- reason: "timeout";
- }
+ export interface TimeoutError {
+ reason: "timeout";
+ }
- export interface UnknownError {
- reason: "unknown";
- errorMessage: string;
- }
+ export interface UnknownError {
+ reason: "unknown";
+ errorMessage: string;
+ }
}
-export async function fetcherImpl(args: Fetcher.Args): Promise> {
- const headers: Record = {};
- if (args.body !== undefined && args.contentType != null) {
- headers["Content-Type"] = args.contentType;
- }
+export async function fetcherImpl(
+ args: Fetcher.Args,
+): Promise> {
+ const headers: Record = {};
+ if (args.body !== undefined && args.contentType != null) {
+ headers["Content-Type"] = args.contentType;
+ }
- if (args.headers != null) {
- for (const [key, value] of Object.entries(args.headers)) {
- if (value != null) {
- headers[key] = value;
- }
- }
- }
+ if (args.headers != null) {
+ for (const [key, value] of Object.entries(args.headers)) {
+ if (value != null) {
+ headers[key] = value;
+ }
+ }
+ }
- const url = createRequestUrl(args.url, args.queryParameters);
- const requestBody: BodyInit | undefined = await getRequestBody({
- body: args.body,
- type: args.requestType === "json" ? "json" : "other",
- });
- const fetchFn = await getFetchFn();
+ const url = createRequestUrl(args.url, args.queryParameters);
+ const requestBody: BodyInit | undefined = await getRequestBody({
+ body: args.body,
+ type: args.requestType === "json" ? "json" : "other",
+ });
+ const fetchFn = await getFetchFn();
- try {
- const response = await requestWithRetries(
- async () =>
- makeRequest(
- fetchFn,
- url,
- args.method,
- headers,
- requestBody,
- args.timeoutMs,
- args.abortSignal,
- args.withCredentials,
- args.duplex,
- ),
- args.maxRetries,
- );
- const responseBody = await getResponseBody(response, args.responseType);
+ try {
+ const response = await requestWithRetries(
+ async () =>
+ makeRequest(
+ fetchFn,
+ url,
+ args.method,
+ headers,
+ requestBody,
+ args.timeoutMs,
+ args.abortSignal,
+ args.withCredentials,
+ args.duplex,
+ ),
+ args.maxRetries,
+ );
+ const responseBody = await getResponseBody(response, args.responseType);
- if (response.status >= 200 && response.status < 400) {
- return {
- ok: true,
- body: responseBody as R,
- headers: response.headers,
- };
- } else {
- return {
- ok: false,
- error: {
- reason: "status-code",
- statusCode: response.status,
- body: responseBody,
- },
- };
- }
- } catch (error) {
- if (args.abortSignal != null && args.abortSignal.aborted) {
- return {
- ok: false,
- error: {
- reason: "unknown",
- errorMessage: "The user aborted a request",
- },
- };
- } else if (error instanceof Error && error.name === "AbortError") {
- return {
- ok: false,
- error: {
- reason: "timeout",
- },
- };
- } else if (error instanceof Error) {
- return {
- ok: false,
- error: {
- reason: "unknown",
- errorMessage: error.message,
- },
- };
- }
+ if (response.status >= 200 && response.status < 400) {
+ return {
+ ok: true,
+ body: responseBody as R,
+ headers: response.headers,
+ };
+ } else {
+ return {
+ ok: false,
+ error: {
+ reason: "status-code",
+ statusCode: response.status,
+ body: responseBody,
+ },
+ };
+ }
+ } catch (error) {
+ if (args.abortSignal != null && args.abortSignal.aborted) {
+ return {
+ ok: false,
+ error: {
+ reason: "unknown",
+ errorMessage: "The user aborted a request",
+ },
+ };
+ } else if (error instanceof Error && error.name === "AbortError") {
+ return {
+ ok: false,
+ error: {
+ reason: "timeout",
+ },
+ };
+ } else if (error instanceof Error) {
+ return {
+ ok: false,
+ error: {
+ reason: "unknown",
+ errorMessage: error.message,
+ },
+ };
+ }
- return {
- ok: false,
- error: {
- reason: "unknown",
- errorMessage: toJson(error),
- },
- };
- }
+ return {
+ ok: false,
+ error: {
+ reason: "unknown",
+ errorMessage: toJson(error),
+ },
+ };
+ }
}
export const fetcher: FetchFunction = fetcherImpl;
diff --git a/engine/sdks/typescript/api-full/src/core/fetcher/Supplier.ts b/engine/sdks/typescript/api-full/src/core/fetcher/Supplier.ts
index 867c931c02..95a163dff1 100644
--- a/engine/sdks/typescript/api-full/src/core/fetcher/Supplier.ts
+++ b/engine/sdks/typescript/api-full/src/core/fetcher/Supplier.ts
@@ -1,11 +1,11 @@
export type Supplier = T | Promise | (() => T | Promise);
export const Supplier = {
- get: async (supplier: Supplier): Promise => {
- if (typeof supplier === "function") {
- return (supplier as () => T)();
- } else {
- return supplier;
- }
- },
+ get: async (supplier: Supplier): Promise => {
+ if (typeof supplier === "function") {
+ return (supplier as () => T)();
+ } else {
+ return supplier;
+ }
+ },
};
diff --git a/engine/sdks/typescript/api-full/src/core/fetcher/createRequestUrl.ts b/engine/sdks/typescript/api-full/src/core/fetcher/createRequestUrl.ts
index f1157ce72c..276478c8cf 100644
--- a/engine/sdks/typescript/api-full/src/core/fetcher/createRequestUrl.ts
+++ b/engine/sdks/typescript/api-full/src/core/fetcher/createRequestUrl.ts
@@ -1,10 +1,13 @@
import qs from "qs";
export function createRequestUrl(
- baseUrl: string,
- queryParameters?: Record,
+ baseUrl: string,
+ queryParameters?: Record<
+ string,
+ string | string[] | object | object[] | null
+ >,
): string {
- return Object.keys(queryParameters ?? {}).length > 0
- ? `${baseUrl}?${qs.stringify(queryParameters, { arrayFormat: "repeat" })}`
- : baseUrl;
+ return Object.keys(queryParameters ?? {}).length > 0
+ ? `${baseUrl}?${qs.stringify(queryParameters, { arrayFormat: "repeat" })}`
+ : baseUrl;
}
diff --git a/engine/sdks/typescript/api-full/src/core/fetcher/getFetchFn.ts b/engine/sdks/typescript/api-full/src/core/fetcher/getFetchFn.ts
index 9fd9bfc42b..e386a24b98 100644
--- a/engine/sdks/typescript/api-full/src/core/fetcher/getFetchFn.ts
+++ b/engine/sdks/typescript/api-full/src/core/fetcher/getFetchFn.ts
@@ -4,22 +4,26 @@ import { RUNTIME } from "../runtime";
* Returns a fetch function based on the runtime
*/
export async function getFetchFn(): Promise {
- // In Node.js 18+ environments, use native fetch
- if (RUNTIME.type === "node" && RUNTIME.parsedVersion != null && RUNTIME.parsedVersion >= 18) {
- return fetch;
- }
+ // In Node.js 18+ environments, use native fetch
+ if (
+ RUNTIME.type === "node" &&
+ RUNTIME.parsedVersion != null &&
+ RUNTIME.parsedVersion >= 18
+ ) {
+ return fetch;
+ }
- // In Node.js 18 or lower environments, the SDK always uses`node-fetch`.
- if (RUNTIME.type === "node") {
- return (await import("node-fetch")).default as any;
- }
+ // In Node.js 18 or lower environments, the SDK always uses`node-fetch`.
+ if (RUNTIME.type === "node") {
+ return (await import("node-fetch")).default as any;
+ }
- // Otherwise the SDK uses global fetch if available,
- // and falls back to node-fetch.
- if (typeof fetch == "function") {
- return fetch;
- }
+ // Otherwise the SDK uses global fetch if available,
+ // and falls back to node-fetch.
+ if (typeof fetch == "function") {
+ return fetch;
+ }
- // Defaults to node `node-fetch` if global fetch isn't available
- return (await import("node-fetch")).default as any;
+ // Defaults to node `node-fetch` if global fetch isn't available
+ return (await import("node-fetch")).default as any;
}
diff --git a/engine/sdks/typescript/api-full/src/core/fetcher/getHeader.ts b/engine/sdks/typescript/api-full/src/core/fetcher/getHeader.ts
index 50f922b0e8..2685975e88 100644
--- a/engine/sdks/typescript/api-full/src/core/fetcher/getHeader.ts
+++ b/engine/sdks/typescript/api-full/src/core/fetcher/getHeader.ts
@@ -1,8 +1,11 @@
-export function getHeader(headers: Record, header: string): string | undefined {
- for (const [headerKey, headerValue] of Object.entries(headers)) {
- if (headerKey.toLowerCase() === header.toLowerCase()) {
- return headerValue;
- }
- }
- return undefined;
+export function getHeader(
+ headers: Record,
+ header: string,
+): string | undefined {
+ for (const [headerKey, headerValue] of Object.entries(headers)) {
+ if (headerKey.toLowerCase() === header.toLowerCase()) {
+ return headerValue;
+ }
+ }
+ return undefined;
}
diff --git a/engine/sdks/typescript/api-full/src/core/fetcher/getRequestBody.ts b/engine/sdks/typescript/api-full/src/core/fetcher/getRequestBody.ts
index fce5589c5e..294ff53dbe 100644
--- a/engine/sdks/typescript/api-full/src/core/fetcher/getRequestBody.ts
+++ b/engine/sdks/typescript/api-full/src/core/fetcher/getRequestBody.ts
@@ -1,16 +1,19 @@
import { toJson } from "../json";
export declare namespace GetRequestBody {
- interface Args {
- body: unknown;
- type: "json" | "file" | "bytes" | "other";
- }
+ interface Args {
+ body: unknown;
+ type: "json" | "file" | "bytes" | "other";
+ }
}
-export async function getRequestBody({ body, type }: GetRequestBody.Args): Promise {
- if (type.includes("json")) {
- return toJson(body);
- } else {
- return body as BodyInit;
- }
+export async function getRequestBody({
+ body,
+ type,
+}: GetRequestBody.Args): Promise {
+ if (type.includes("json")) {
+ return toJson(body);
+ } else {
+ return body as BodyInit;
+ }
}
diff --git a/engine/sdks/typescript/api-full/src/core/fetcher/getResponseBody.ts b/engine/sdks/typescript/api-full/src/core/fetcher/getResponseBody.ts
index d046e6ea27..7c60fc2bd4 100644
--- a/engine/sdks/typescript/api-full/src/core/fetcher/getResponseBody.ts
+++ b/engine/sdks/typescript/api-full/src/core/fetcher/getResponseBody.ts
@@ -1,34 +1,37 @@
import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper";
-export async function getResponseBody(response: Response, responseType?: string): Promise {
- if (response.body != null && responseType === "blob") {
- return await response.blob();
- } else if (response.body != null && responseType === "arrayBuffer") {
- return await response.arrayBuffer();
- } else if (response.body != null && responseType === "sse") {
- return response.body;
- } else if (response.body != null && responseType === "streaming") {
- return chooseStreamWrapper(response.body);
- } else if (response.body != null && responseType === "text") {
- return await response.text();
- } else {
- const text = await response.text();
- if (text.length > 0) {
- try {
- let responseBody = JSON.parse(text);
- return responseBody;
- } catch (err) {
- return {
- ok: false,
- error: {
- reason: "non-json",
- statusCode: response.status,
- rawBody: text,
- },
- };
- }
- } else {
- return undefined;
- }
- }
+export async function getResponseBody(
+ response: Response,
+ responseType?: string,
+): Promise {
+ if (response.body != null && responseType === "blob") {
+ return await response.blob();
+ } else if (response.body != null && responseType === "arrayBuffer") {
+ return await response.arrayBuffer();
+ } else if (response.body != null && responseType === "sse") {
+ return response.body;
+ } else if (response.body != null && responseType === "streaming") {
+ return chooseStreamWrapper(response.body);
+ } else if (response.body != null && responseType === "text") {
+ return await response.text();
+ } else {
+ const text = await response.text();
+ if (text.length > 0) {
+ try {
+ const responseBody = JSON.parse(text);
+ return responseBody;
+ } catch (err) {
+ return {
+ ok: false,
+ error: {
+ reason: "non-json",
+ statusCode: response.status,
+ rawBody: text,
+ },
+ };
+ }
+ } else {
+ return undefined;
+ }
+ }
}
diff --git a/engine/sdks/typescript/api-full/src/core/fetcher/index.ts b/engine/sdks/typescript/api-full/src/core/fetcher/index.ts
index 2d658ca48f..ae82e88fe1 100644
--- a/engine/sdks/typescript/api-full/src/core/fetcher/index.ts
+++ b/engine/sdks/typescript/api-full/src/core/fetcher/index.ts
@@ -1,5 +1,5 @@
export type { APIResponse } from "./APIResponse";
-export { fetcher } from "./Fetcher";
export type { Fetcher, FetchFunction } from "./Fetcher";
+export { fetcher } from "./Fetcher";
export { getHeader } from "./getHeader";
export { Supplier } from "./Supplier";
diff --git a/engine/sdks/typescript/api-full/src/core/fetcher/makeRequest.ts b/engine/sdks/typescript/api-full/src/core/fetcher/makeRequest.ts
index 1af42bb9f7..6388a66a0b 100644
--- a/engine/sdks/typescript/api-full/src/core/fetcher/makeRequest.ts
+++ b/engine/sdks/typescript/api-full/src/core/fetcher/makeRequest.ts
@@ -1,44 +1,44 @@
import { anySignal, getTimeoutSignal } from "./signals";
export const makeRequest = async (
- fetchFn: (url: string, init: RequestInit) => Promise,
- url: string,
- method: string,
- headers: Record,
- requestBody: BodyInit | undefined,
- timeoutMs?: number,
- abortSignal?: AbortSignal,
- withCredentials?: boolean,
- duplex?: "half",
+ fetchFn: (url: string, init: RequestInit) => Promise,
+ url: string,
+ method: string,
+ headers: Record,
+ requestBody: BodyInit | undefined,
+ timeoutMs?: number,
+ abortSignal?: AbortSignal,
+ withCredentials?: boolean,
+ duplex?: "half",
): Promise => {
- const signals: AbortSignal[] = [];
+ const signals: AbortSignal[] = [];
- // Add timeout signal
- let timeoutAbortId: NodeJS.Timeout | undefined = undefined;
- if (timeoutMs != null) {
- const { signal, abortId } = getTimeoutSignal(timeoutMs);
- timeoutAbortId = abortId;
- signals.push(signal);
- }
+ // Add timeout signal
+ let timeoutAbortId: NodeJS.Timeout | undefined;
+ if (timeoutMs != null) {
+ const { signal, abortId } = getTimeoutSignal(timeoutMs);
+ timeoutAbortId = abortId;
+ signals.push(signal);
+ }
- // Add arbitrary signal
- if (abortSignal != null) {
- signals.push(abortSignal);
- }
- let newSignals = anySignal(signals);
- const response = await fetchFn(url, {
- method: method,
- headers,
- body: requestBody,
- signal: newSignals,
- credentials: withCredentials ? "include" : undefined,
- // @ts-ignore
- duplex,
- });
+ // Add arbitrary signal
+ if (abortSignal != null) {
+ signals.push(abortSignal);
+ }
+ const newSignals = anySignal(signals);
+ const response = await fetchFn(url, {
+ method: method,
+ headers,
+ body: requestBody,
+ signal: newSignals,
+ credentials: withCredentials ? "include" : undefined,
+ // @ts-expect-error
+ duplex,
+ });
- if (timeoutAbortId != null) {
- clearTimeout(timeoutAbortId);
- }
+ if (timeoutAbortId != null) {
+ clearTimeout(timeoutAbortId);
+ }
- return response;
+ return response;
};
diff --git a/engine/sdks/typescript/api-full/src/core/fetcher/requestWithRetries.ts b/engine/sdks/typescript/api-full/src/core/fetcher/requestWithRetries.ts
index add3cce02f..bfe9f616ac 100644
--- a/engine/sdks/typescript/api-full/src/core/fetcher/requestWithRetries.ts
+++ b/engine/sdks/typescript/api-full/src/core/fetcher/requestWithRetries.ts
@@ -4,30 +4,35 @@ const DEFAULT_MAX_RETRIES = 2;
const JITTER_FACTOR = 0.2; // 20% random jitter
function addJitter(delay: number): number {
- // Generate a random value between -JITTER_FACTOR and +JITTER_FACTOR
- const jitterMultiplier = 1 + (Math.random() * 2 - 1) * JITTER_FACTOR;
- return delay * jitterMultiplier;
+ // Generate a random value between -JITTER_FACTOR and +JITTER_FACTOR
+ const jitterMultiplier = 1 + (Math.random() * 2 - 1) * JITTER_FACTOR;
+ return delay * jitterMultiplier;
}
export async function requestWithRetries(
- requestFn: () => Promise,
- maxRetries: number = DEFAULT_MAX_RETRIES,
+ requestFn: () => Promise,
+ maxRetries: number = DEFAULT_MAX_RETRIES,
): Promise {
- let response: Response = await requestFn();
+ let response: Response = await requestFn();
- for (let i = 0; i < maxRetries; ++i) {
- if ([408, 429].includes(response.status) || response.status >= 500) {
- // Calculate base delay using exponential backoff (in milliseconds)
- const baseDelay = Math.min(INITIAL_RETRY_DELAY * Math.pow(2, i), MAX_RETRY_DELAY);
+ for (let i = 0; i < maxRetries; ++i) {
+ if ([408, 429].includes(response.status) || response.status >= 500) {
+ // Calculate base delay using exponential backoff (in milliseconds)
+ const baseDelay = Math.min(
+ INITIAL_RETRY_DELAY * 2 ** i,
+ MAX_RETRY_DELAY,
+ );
- // Add jitter to the delay
- const delayWithJitter = addJitter(baseDelay);
+ // Add jitter to the delay
+ const delayWithJitter = addJitter(baseDelay);
- await new Promise((resolve) => setTimeout(resolve, delayWithJitter));
- response = await requestFn();
- } else {
- break;
- }
- }
- return response!;
+ await new Promise((resolve) =>
+ setTimeout(resolve, delayWithJitter),
+ );
+ response = await requestFn();
+ } else {
+ break;
+ }
+ }
+ return response!;
}
diff --git a/engine/sdks/typescript/api-full/src/core/fetcher/signals.ts b/engine/sdks/typescript/api-full/src/core/fetcher/signals.ts
index a8d32a2e85..3ac808676b 100644
--- a/engine/sdks/typescript/api-full/src/core/fetcher/signals.ts
+++ b/engine/sdks/typescript/api-full/src/core/fetcher/signals.ts
@@ -1,9 +1,12 @@
const TIMEOUT = "timeout";
-export function getTimeoutSignal(timeoutMs: number): { signal: AbortSignal; abortId: NodeJS.Timeout } {
- const controller = new AbortController();
- const abortId = setTimeout(() => controller.abort(TIMEOUT), timeoutMs);
- return { signal: controller.signal, abortId };
+export function getTimeoutSignal(timeoutMs: number): {
+ signal: AbortSignal;
+ abortId: NodeJS.Timeout;
+} {
+ const controller = new AbortController();
+ const abortId = setTimeout(() => controller.abort(TIMEOUT), timeoutMs);
+ return { signal: controller.signal, abortId };
}
/**
@@ -12,27 +15,35 @@ export function getTimeoutSignal(timeoutMs: number): { signal: AbortSignal; abor
*
* Requires at least node.js 18.
*/
-export function anySignal(...args: AbortSignal[] | [AbortSignal[]]): AbortSignal {
- // Allowing signals to be passed either as array
- // of signals or as multiple arguments.
- const signals = (args.length === 1 && Array.isArray(args[0]) ? args[0] : args) as AbortSignal[];
+export function anySignal(
+ ...args: AbortSignal[] | [AbortSignal[]]
+): AbortSignal {
+ // Allowing signals to be passed either as array
+ // of signals or as multiple arguments.
+ const signals = (
+ args.length === 1 && Array.isArray(args[0]) ? args[0] : args
+ ) as AbortSignal[];
- const controller = new AbortController();
+ const controller = new AbortController();
- for (const signal of signals) {
- if (signal.aborted) {
- // Exiting early if one of the signals
- // is already aborted.
- controller.abort((signal as any)?.reason);
- break;
- }
+ for (const signal of signals) {
+ if (signal.aborted) {
+ // Exiting early if one of the signals
+ // is already aborted.
+ controller.abort((signal as any)?.reason);
+ break;
+ }
- // Listening for signals and removing the listeners
- // when at least one symbol is aborted.
- signal.addEventListener("abort", () => controller.abort((signal as any)?.reason), {
- signal: controller.signal,
- });
- }
+ // Listening for signals and removing the listeners
+ // when at least one symbol is aborted.
+ signal.addEventListener(
+ "abort",
+ () => controller.abort((signal as any)?.reason),
+ {
+ signal: controller.signal,
+ },
+ );
+ }
- return controller.signal;
+ return controller.signal;
}
diff --git a/engine/sdks/typescript/api-full/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/engine/sdks/typescript/api-full/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts
index 6f1a82e96a..d455b81559 100644
--- a/engine/sdks/typescript/api-full/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts
+++ b/engine/sdks/typescript/api-full/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts
@@ -1,257 +1,282 @@
import type { Writable } from "readable-stream";
-import { EventCallback, StreamWrapper } from "./chooseStreamWrapper";
+import type { EventCallback, StreamWrapper } from "./chooseStreamWrapper";
-export class Node18UniversalStreamWrapper
- implements
- StreamWrapper | Writable | WritableStream, ReadFormat>
+export class Node18UniversalStreamWrapper<
+ ReadFormat extends Uint8Array | Uint16Array | Uint32Array,
+> implements
+ StreamWrapper<
+ | Node18UniversalStreamWrapper
+ | Writable
+ | WritableStream,
+ ReadFormat
+ >
{
- private readableStream: ReadableStream;
- private reader: ReadableStreamDefaultReader;
- private events: Record;
- private paused: boolean;
- private resumeCallback: ((value?: unknown) => void) | null;
- private encoding: string | null;
+ private readableStream: ReadableStream;
+ private reader: ReadableStreamDefaultReader;
+ private events: Record;
+ private paused: boolean;
+ private resumeCallback: ((value?: unknown) => void) | null;
+ private encoding: string | null;
- constructor(readableStream: ReadableStream) {
- this.readableStream = readableStream;
- this.reader = this.readableStream.getReader();
- this.events = {
- data: [],
- end: [],
- error: [],
- readable: [],
- close: [],
- pause: [],
- resume: [],
- };
- this.paused = false;
- this.resumeCallback = null;
- this.encoding = null;
- }
+ constructor(readableStream: ReadableStream) {
+ this.readableStream = readableStream;
+ this.reader = this.readableStream.getReader();
+ this.events = {
+ data: [],
+ end: [],
+ error: [],
+ readable: [],
+ close: [],
+ pause: [],
+ resume: [],
+ };
+ this.paused = false;
+ this.resumeCallback = null;
+ this.encoding = null;
+ }
- public on(event: string, callback: EventCallback): void {
- this.events[event]?.push(callback);
- }
+ public on(event: string, callback: EventCallback): void {
+ this.events[event]?.push(callback);
+ }
- public off(event: string, callback: EventCallback): void {
- this.events[event] = this.events[event]?.filter((cb) => cb !== callback);
- }
+ public off(event: string, callback: EventCallback): void {
+ this.events[event] = this.events[event]?.filter(
+ (cb) => cb !== callback,
+ );
+ }
- public pipe(
- dest: Node18UniversalStreamWrapper | Writable | WritableStream,
- ): Node18UniversalStreamWrapper | Writable | WritableStream {
- this.on("data", async (chunk) => {
- if (dest instanceof Node18UniversalStreamWrapper) {
- dest._write(chunk);
- } else if (dest instanceof WritableStream) {
- const writer = dest.getWriter();
- writer.write(chunk).then(() => writer.releaseLock());
- } else {
- dest.write(chunk);
- }
- });
+ public pipe(
+ dest:
+ | Node18UniversalStreamWrapper
+ | Writable
+ | WritableStream,
+ ):
+ | Node18UniversalStreamWrapper
+ | Writable
+ | WritableStream {
+ this.on("data", async (chunk) => {
+ if (dest instanceof Node18UniversalStreamWrapper) {
+ dest._write(chunk);
+ } else if (dest instanceof WritableStream) {
+ const writer = dest.getWriter();
+ writer.write(chunk).then(() => writer.releaseLock());
+ } else {
+ dest.write(chunk);
+ }
+ });
- this.on("end", async () => {
- if (dest instanceof Node18UniversalStreamWrapper) {
- dest._end();
- } else if (dest instanceof WritableStream) {
- const writer = dest.getWriter();
- writer.close();
- } else {
- dest.end();
- }
- });
+ this.on("end", async () => {
+ if (dest instanceof Node18UniversalStreamWrapper) {
+ dest._end();
+ } else if (dest instanceof WritableStream) {
+ const writer = dest.getWriter();
+ writer.close();
+ } else {
+ dest.end();
+ }
+ });
- this.on("error", async (error) => {
- if (dest instanceof Node18UniversalStreamWrapper) {
- dest._error(error);
- } else if (dest instanceof WritableStream) {
- const writer = dest.getWriter();
- writer.abort(error);
- } else {
- dest.destroy(error);
- }
- });
+ this.on("error", async (error) => {
+ if (dest instanceof Node18UniversalStreamWrapper) {
+ dest._error(error);
+ } else if (dest instanceof WritableStream) {
+ const writer = dest.getWriter();
+ writer.abort(error);
+ } else {
+ dest.destroy(error);
+ }
+ });
- this._startReading();
+ this._startReading();
- return dest;
- }
+ return dest;
+ }
- public pipeTo(
- dest: Node18UniversalStreamWrapper | Writable | WritableStream,
- ): Node18UniversalStreamWrapper | Writable | WritableStream {
- return this.pipe(dest);
- }
+ public pipeTo(
+ dest:
+ | Node18UniversalStreamWrapper
+ | Writable
+ | WritableStream,
+ ):
+ | Node18UniversalStreamWrapper
+ | Writable
+ | WritableStream {
+ return this.pipe(dest);
+ }
- public unpipe(dest: Node18UniversalStreamWrapper | Writable | WritableStream): void {
- this.off("data", async (chunk) => {
- if (dest instanceof Node18UniversalStreamWrapper) {
- dest._write(chunk);
- } else if (dest instanceof WritableStream) {
- const writer = dest.getWriter();
- writer.write(chunk).then(() => writer.releaseLock());
- } else {
- dest.write(chunk);
- }
- });
+ public unpipe(
+ dest:
+ | Node18UniversalStreamWrapper
+ | Writable
+ | WritableStream,
+ ): void {
+ this.off("data", async (chunk) => {
+ if (dest instanceof Node18UniversalStreamWrapper) {
+ dest._write(chunk);
+ } else if (dest instanceof WritableStream) {
+ const writer = dest.getWriter();
+ writer.write(chunk).then(() => writer.releaseLock());
+ } else {
+ dest.write(chunk);
+ }
+ });
- this.off("end", async () => {
- if (dest instanceof Node18UniversalStreamWrapper) {
- dest._end();
- } else if (dest instanceof WritableStream) {
- const writer = dest.getWriter();
- writer.close();
- } else {
- dest.end();
- }
- });
+ this.off("end", async () => {
+ if (dest instanceof Node18UniversalStreamWrapper) {
+ dest._end();
+ } else if (dest instanceof WritableStream) {
+ const writer = dest.getWriter();
+ writer.close();
+ } else {
+ dest.end();
+ }
+ });
- this.off("error", async (error) => {
- if (dest instanceof Node18UniversalStreamWrapper) {
- dest._error(error);
- } else if (dest instanceof WritableStream) {
- const writer = dest.getWriter();
- writer.abort(error);
- } else {
- dest.destroy(error);
- }
- });
- }
+ this.off("error", async (error) => {
+ if (dest instanceof Node18UniversalStreamWrapper) {
+ dest._error(error);
+ } else if (dest instanceof WritableStream) {
+ const writer = dest.getWriter();
+ writer.abort(error);
+ } else {
+ dest.destroy(error);
+ }
+ });
+ }
- public destroy(error?: Error): void {
- this.reader
- .cancel(error)
- .then(() => {
- this._emit("close");
- })
- .catch((err) => {
- this._emit("error", err);
- });
- }
+ public destroy(error?: Error): void {
+ this.reader
+ .cancel(error)
+ .then(() => {
+ this._emit("close");
+ })
+ .catch((err) => {
+ this._emit("error", err);
+ });
+ }
- public pause(): void {
- this.paused = true;
- this._emit("pause");
- }
+ public pause(): void {
+ this.paused = true;
+ this._emit("pause");
+ }
- public resume(): void {
- if (this.paused) {
- this.paused = false;
- this._emit("resume");
- if (this.resumeCallback) {
- this.resumeCallback();
- this.resumeCallback = null;
- }
- }
- }
+ public resume(): void {
+ if (this.paused) {
+ this.paused = false;
+ this._emit("resume");
+ if (this.resumeCallback) {
+ this.resumeCallback();
+ this.resumeCallback = null;
+ }
+ }
+ }
- public get isPaused(): boolean {
- return this.paused;
- }
+ public get isPaused(): boolean {
+ return this.paused;
+ }
- public async read(): Promise {
- if (this.paused) {
- await new Promise((resolve) => {
- this.resumeCallback = resolve;
- });
- }
- const { done, value } = await this.reader.read();
+ public async read(): Promise {
+ if (this.paused) {
+ await new Promise((resolve) => {
+ this.resumeCallback = resolve;
+ });
+ }
+ const { done, value } = await this.reader.read();
- if (done) {
- return undefined;
- }
- return value;
- }
+ if (done) {
+ return undefined;
+ }
+ return value;
+ }
- public setEncoding(encoding: string): void {
- this.encoding = encoding;
- }
+ public setEncoding(encoding: string): void {
+ this.encoding = encoding;
+ }
- public async text(): Promise {
- const chunks: ReadFormat[] = [];
+ public async text(): Promise {
+ const chunks: ReadFormat[] = [];
- while (true) {
- const { done, value } = await this.reader.read();
- if (done) {
- break;
- }
- if (value) {
- chunks.push(value);
- }
- }
+ while (true) {
+ const { done, value } = await this.reader.read();
+ if (done) {
+ break;
+ }
+ if (value) {
+ chunks.push(value);
+ }
+ }
- const decoder = new TextDecoder(this.encoding || "utf-8");
- return decoder.decode(await new Blob(chunks).arrayBuffer());
- }
+ const decoder = new TextDecoder(this.encoding || "utf-8");
+ return decoder.decode(await new Blob(chunks).arrayBuffer());
+ }
- public async json(): Promise {
- const text = await this.text();
- return JSON.parse(text);
- }
+ public async json(): Promise {
+ const text = await this.text();
+ return JSON.parse(text);
+ }
- private _write(chunk: ReadFormat): void {
- this._emit("data", chunk);
- }
+ private _write(chunk: ReadFormat): void {
+ this._emit("data", chunk);
+ }
- private _end(): void {
- this._emit("end");
- }
+ private _end(): void {
+ this._emit("end");
+ }
- private _error(error: any): void {
- this._emit("error", error);
- }
+ private _error(error: any): void {
+ this._emit("error", error);
+ }
- private _emit(event: string, data?: any): void {
- if (this.events[event]) {
- for (const callback of this.events[event] || []) {
- callback(data);
- }
- }
- }
+ private _emit(event: string, data?: any): void {
+ if (this.events[event]) {
+ for (const callback of this.events[event] || []) {
+ callback(data);
+ }
+ }
+ }
- private async _startReading(): Promise {
- try {
- this._emit("readable");
- while (true) {
- if (this.paused) {
- await new Promise((resolve) => {
- this.resumeCallback = resolve;
- });
- }
- const { done, value } = await this.reader.read();
- if (done) {
- this._emit("end");
- this._emit("close");
- break;
- }
- if (value) {
- this._emit("data", value);
- }
- }
- } catch (error) {
- this._emit("error", error);
- }
- }
+ private async _startReading(): Promise {
+ try {
+ this._emit("readable");
+ while (true) {
+ if (this.paused) {
+ await new Promise((resolve) => {
+ this.resumeCallback = resolve;
+ });
+ }
+ const { done, value } = await this.reader.read();
+ if (done) {
+ this._emit("end");
+ this._emit("close");
+ break;
+ }
+ if (value) {
+ this._emit("data", value);
+ }
+ }
+ } catch (error) {
+ this._emit("error", error);
+ }
+ }
- [Symbol.asyncIterator](): AsyncIterableIterator {
- return {
- next: async () => {
- if (this.paused) {
- await new Promise((resolve) => {
- this.resumeCallback = resolve;
- });
- }
- const { done, value } = await this.reader.read();
- if (done) {
- return { done: true, value: undefined };
- }
- return { done: false, value };
- },
- [Symbol.asyncIterator]() {
- return this;
- },
- };
- }
+ [Symbol.asyncIterator](): AsyncIterableIterator {
+ return {
+ next: async () => {
+ if (this.paused) {
+ await new Promise((resolve) => {
+ this.resumeCallback = resolve;
+ });
+ }
+ const { done, value } = await this.reader.read();
+ if (done) {
+ return { done: true, value: undefined };
+ }
+ return { done: false, value };
+ },
+ [Symbol.asyncIterator]() {
+ return this;
+ },
+ };
+ }
}
diff --git a/engine/sdks/typescript/api-full/src/core/fetcher/stream-wrappers/NodePre18StreamWrapper.ts b/engine/sdks/typescript/api-full/src/core/fetcher/stream-wrappers/NodePre18StreamWrapper.ts
index 23c01a1a7a..c069216c11 100644
--- a/engine/sdks/typescript/api-full/src/core/fetcher/stream-wrappers/NodePre18StreamWrapper.ts
+++ b/engine/sdks/typescript/api-full/src/core/fetcher/stream-wrappers/NodePre18StreamWrapper.ts
@@ -1,107 +1,109 @@
import type { Readable, Writable } from "readable-stream";
-import { EventCallback, StreamWrapper } from "./chooseStreamWrapper";
+import type { EventCallback, StreamWrapper } from "./chooseStreamWrapper";
export class NodePre18StreamWrapper implements StreamWrapper {
- private readableStream: Readable;
- private encoding: string | undefined;
-
- constructor(readableStream: Readable) {
- this.readableStream = readableStream;
- }
-
- public on(event: string, callback: EventCallback): void {
- this.readableStream.on(event, callback);
- }
-
- public off(event: string, callback: EventCallback): void {
- this.readableStream.off(event, callback);
- }
-
- public pipe(dest: Writable): Writable {
- this.readableStream.pipe(dest);
- return dest;
- }
-
- public pipeTo(dest: Writable): Writable {
- return this.pipe(dest);
- }
-
- public unpipe(dest?: Writable): void {
- if (dest) {
- this.readableStream.unpipe(dest);
- } else {
- this.readableStream.unpipe();
- }
- }
-
- public destroy(error?: Error): void {
- this.readableStream.destroy(error);
- }
-
- public pause(): void {
- this.readableStream.pause();
- }
-
- public resume(): void {
- this.readableStream.resume();
- }
-
- public get isPaused(): boolean {
- return this.readableStream.isPaused();
- }
-
- public async read(): Promise {
- return new Promise((resolve, reject) => {
- const chunk = this.readableStream.read();
- if (chunk) {
- resolve(chunk);
- } else {
- this.readableStream.once("readable", () => {
- const chunk = this.readableStream.read();
- resolve(chunk);
- });
- this.readableStream.once("error", reject);
- }
- });
- }
-
- public setEncoding(encoding?: string): void {
- this.readableStream.setEncoding(encoding as BufferEncoding);
- this.encoding = encoding;
- }
-
- public async text(): Promise {
- const chunks: Uint8Array[] = [];
- const encoder = new TextEncoder();
- this.readableStream.setEncoding((this.encoding || "utf-8") as BufferEncoding);
-
- for await (const chunk of this.readableStream) {
- chunks.push(encoder.encode(chunk));
- }
-
- const decoder = new TextDecoder(this.encoding || "utf-8");
- return decoder.decode(Buffer.concat(chunks));
- }
-
- public async json(): Promise {
- const text = await this.text();
- return JSON.parse(text);
- }
-
- public [Symbol.asyncIterator](): AsyncIterableIterator {
- const readableStream = this.readableStream;
- const iterator = readableStream[Symbol.asyncIterator]();
-
- // Create and return an async iterator that yields buffers
- return {
- async next(): Promise> {
- const { value, done } = await iterator.next();
- return { value: value as Buffer, done };
- },
- [Symbol.asyncIterator]() {
- return this;
- },
- };
- }
+ private readableStream: Readable;
+ private encoding: string | undefined;
+
+ constructor(readableStream: Readable) {
+ this.readableStream = readableStream;
+ }
+
+ public on(event: string, callback: EventCallback): void {
+ this.readableStream.on(event, callback);
+ }
+
+ public off(event: string, callback: EventCallback): void {
+ this.readableStream.off(event, callback);
+ }
+
+ public pipe(dest: Writable): Writable {
+ this.readableStream.pipe(dest);
+ return dest;
+ }
+
+ public pipeTo(dest: Writable): Writable {
+ return this.pipe(dest);
+ }
+
+ public unpipe(dest?: Writable): void {
+ if (dest) {
+ this.readableStream.unpipe(dest);
+ } else {
+ this.readableStream.unpipe();
+ }
+ }
+
+ public destroy(error?: Error): void {
+ this.readableStream.destroy(error);
+ }
+
+ public pause(): void {
+ this.readableStream.pause();
+ }
+
+ public resume(): void {
+ this.readableStream.resume();
+ }
+
+ public get isPaused(): boolean {
+ return this.readableStream.isPaused();
+ }
+
+ public async read(): Promise {
+ return new Promise((resolve, reject) => {
+ const chunk = this.readableStream.read();
+ if (chunk) {
+ resolve(chunk);
+ } else {
+ this.readableStream.once("readable", () => {
+ const chunk = this.readableStream.read();
+ resolve(chunk);
+ });
+ this.readableStream.once("error", reject);
+ }
+ });
+ }
+
+ public setEncoding(encoding?: string): void {
+ this.readableStream.setEncoding(encoding as BufferEncoding);
+ this.encoding = encoding;
+ }
+
+ public async text(): Promise {
+ const chunks: Uint8Array[] = [];
+ const encoder = new TextEncoder();
+ this.readableStream.setEncoding(
+ (this.encoding || "utf-8") as BufferEncoding,
+ );
+
+ for await (const chunk of this.readableStream) {
+ chunks.push(encoder.encode(chunk));
+ }
+
+ const decoder = new TextDecoder(this.encoding || "utf-8");
+ return decoder.decode(Buffer.concat(chunks));
+ }
+
+ public async json(): Promise {
+ const text = await this.text();
+ return JSON.parse(text);
+ }
+
+ public [Symbol.asyncIterator](): AsyncIterableIterator {
+ const readableStream = this.readableStream;
+ const iterator = readableStream[Symbol.asyncIterator]();
+
+ // Create and return an async iterator that yields buffers
+ return {
+ async next(): Promise> {
+ const { value, done } = await iterator.next();
+ return { value: value as Buffer, done };
+ },
+ [Symbol.asyncIterator]() {
+ return this;
+ },
+ };
+ }
}
diff --git a/engine/sdks/typescript/api-full/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/engine/sdks/typescript/api-full/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts
index 091e2a7f39..e23ee0819d 100644
--- a/engine/sdks/typescript/api-full/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts
+++ b/engine/sdks/typescript/api-full/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts
@@ -1,243 +1,252 @@
-import { StreamWrapper } from "./chooseStreamWrapper";
+import type { StreamWrapper } from "./chooseStreamWrapper";
type EventCallback = (data?: any) => void;
-export class UndiciStreamWrapper
- implements StreamWrapper | WritableStream, ReadFormat>
+export class UndiciStreamWrapper<
+ ReadFormat extends Uint8Array | Uint16Array | Uint32Array,
+> implements
+ StreamWrapper<
+ UndiciStreamWrapper | WritableStream,
+ ReadFormat
+ >
{
- private readableStream: ReadableStream;
- private reader: ReadableStreamDefaultReader;
- private events: Record;
- private paused: boolean;
- private resumeCallback: ((value?: unknown) => void) | null;
- private encoding: string | null;
-
- constructor(readableStream: ReadableStream) {
- this.readableStream = readableStream;
- this.reader = this.readableStream.getReader();
- this.events = {
- data: [],
- end: [],
- error: [],
- readable: [],
- close: [],
- pause: [],
- resume: [],
- };
- this.paused = false;
- this.resumeCallback = null;
- this.encoding = null;
- }
-
- public on(event: string, callback: EventCallback): void {
- this.events[event]?.push(callback);
- }
-
- public off(event: string, callback: EventCallback): void {
- this.events[event] = this.events[event]?.filter((cb) => cb !== callback);
- }
-
- public pipe(
- dest: UndiciStreamWrapper | WritableStream,
- ): UndiciStreamWrapper | WritableStream {
- this.on("data", (chunk) => {
- if (dest instanceof UndiciStreamWrapper) {
- dest._write(chunk);
- } else {
- const writer = dest.getWriter();
- writer.write(chunk).then(() => writer.releaseLock());
- }
- });
-
- this.on("end", () => {
- if (dest instanceof UndiciStreamWrapper) {
- dest._end();
- } else {
- const writer = dest.getWriter();
- writer.close();
- }
- });
-
- this.on("error", (error) => {
- if (dest instanceof UndiciStreamWrapper) {
- dest._error(error);
- } else {
- const writer = dest.getWriter();
- writer.abort(error);
- }
- });
-
- this._startReading();
-
- return dest;
- }
-
- public pipeTo(
- dest: UndiciStreamWrapper | WritableStream,
- ): UndiciStreamWrapper | WritableStream {
- return this.pipe(dest);
- }
-
- public unpipe(dest: UndiciStreamWrapper | WritableStream): void {
- this.off("data", (chunk) => {
- if (dest instanceof UndiciStreamWrapper) {
- dest._write(chunk);
- } else {
- const writer = dest.getWriter();
- writer.write(chunk).then(() => writer.releaseLock());
- }
- });
-
- this.off("end", () => {
- if (dest instanceof UndiciStreamWrapper) {
- dest._end();
- } else {
- const writer = dest.getWriter();
- writer.close();
- }
- });
-
- this.off("error", (error) => {
- if (dest instanceof UndiciStreamWrapper) {
- dest._error(error);
- } else {
- const writer = dest.getWriter();
- writer.abort(error);
- }
- });
- }
-
- public destroy(error?: Error): void {
- this.reader
- .cancel(error)
- .then(() => {
- this._emit("close");
- })
- .catch((err) => {
- this._emit("error", err);
- });
- }
-
- public pause(): void {
- this.paused = true;
- this._emit("pause");
- }
-
- public resume(): void {
- if (this.paused) {
- this.paused = false;
- this._emit("resume");
- if (this.resumeCallback) {
- this.resumeCallback();
- this.resumeCallback = null;
- }
- }
- }
-
- public get isPaused(): boolean {
- return this.paused;
- }
-
- public async read(): Promise {
- if (this.paused) {
- await new Promise((resolve) => {
- this.resumeCallback = resolve;
- });
- }
- const { done, value } = await this.reader.read();
- if (done) {
- return undefined;
- }
- return value;
- }
-
- public setEncoding(encoding: string): void {
- this.encoding = encoding;
- }
-
- public async text(): Promise