diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 7744f93414..961fbcbfb1 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -24,57 +24,57 @@ env: RUSTFLAGS: "--cfg tokio_unstable" jobs: - # setup: - # name: "Setup" - # runs-on: ubuntu-24.04 - # permissions: - # # Allow pushing to GitHub - # contents: write - # # Allows JSR to authenticate with GitHub - # id-token: write - # steps: - # - name: Checkout rivet - # uses: actions/checkout@v4 - # with: - # lfs: 'true' - # path: './rivet' - - # - uses: actions/setup-node@v4 - # with: - # node-version: 20 - - # - run: corepack enable - - # - name: Setup - # env: - # # Required to authenticate with Git - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # working-directory: './rivet' - # run: | - # # Configure Git - # git config --global user.name "github-actions[bot]" - # git config --global user.email "github-actions[bot]@users.noreply.github.com" - - # # Install Deno - # curl -fsSL https://deno.land/x/install/install.sh | sh - # export PATH=$HOME/.deno/bin:$PATH - - # # Authenticate with NPM - # cat << EOF > ~/.npmrc - # //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }} - # EOF - - # pnpm install - - # if [ "${{ inputs.latest }}" = "true" ]; then - # ./scripts/release/main.ts --version "${{ github.event.inputs.version }}" --setupCi - # else - # ./scripts/release/main.ts --version "${{ github.event.inputs.version }}" --no-latest --setupCi - # fi + setup: + name: "Setup" + runs-on: ubuntu-24.04 + permissions: + # Allow pushing to GitHub + contents: write + # Allows JSR to authenticate with GitHub + id-token: write + steps: + - name: Checkout rivet + uses: actions/checkout@v4 + with: + lfs: 'true' + path: './rivet' + + - uses: actions/setup-node@v4 + with: + node-version: 20 + + - run: corepack enable + + - name: Setup + env: + # Required to authenticate with Git + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + working-directory: './rivet' + run: | + # Configure Git + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + + # Authenticate with NPM + cat << EOF > ~/.npmrc + //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }} + EOF + + # Install dependencies + pnpm install + + # Install tsx globally + npm install -g tsx + + if [ "${{ inputs.latest }}" = "true" ]; then + ./scripts/release/main.ts --version "${{ github.event.inputs.version }}" --setupCi + else + ./scripts/release/main.ts --version "${{ github.event.inputs.version }}" --no-latest --setupCi + fi binaries: name: "Build & Push Binaries" - # needs: [setup] + needs: [setup] strategy: matrix: include: @@ -124,8 +124,8 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_RELEASES_SECRET_ACCESS_KEY }} run: | # Install dependencies for AWS CLI - apt-get update - apt-get install -y unzip curl + sudo apt-get update + sudo apt-get install -y unzip curl # Install AWS CLI - use ARM version if running on ARM architecture if [ "${{ matrix.arch }}" = "aarch64" ]; then @@ -134,7 +134,7 @@ jobs: curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" fi unzip awscliv2.zip - ./aws/install --update + sudo ./aws/install --update COMMIT_SHA_SHORT="${GITHUB_SHA::7}" BINARY_PATH="dist/rivet-engine-${{ matrix.target }}${{ matrix.binary_ext }}" @@ -142,14 +142,14 @@ jobs: # Must specify --checksum-algorithm for compatibility with R2 aws s3 cp \ "${BINARY_PATH}" \ - "s3://rivet/${COMMIT_SHA_SHORT}/rivet-engine-${{ matrix.target }}${{ matrix.binary_ext }}" \ + "s3://engine/${COMMIT_SHA_SHORT}/rivet-engine-${{ matrix.target }}${{ matrix.binary_ext }}" \ --region auto \ - --endpoint-url https://2a94c6a0ced8d35ea63cddc86c2681e7.r2.cloudflarestorage.com/rivet-engine-releases \ + --endpoint-url https://2a94c6a0ced8d35ea63cddc86c2681e7.r2.cloudflarestorage.com/rivet-releases \ --checksum-algorithm CRC32 docker: name: "Build & Push Docker Images" - # needs: [setup] + needs: [setup] strategy: matrix: include: @@ -169,13 +169,8 @@ jobs: uses: douglascamata/setup-docker-macos-action@v1-alpha - uses: actions/checkout@v4 - - # Required for running in Docker - - name: Git LFS Pull - run: | - apt-get update - apt-get install git-lfs - git lfs pull + with: + lfs: true - name: Set outputs id: vars @@ -215,32 +210,40 @@ jobs: # secret-files: | # netrc=${{ runner.temp }}/netrc - # complete: - # name: "Complete" - # needs: [docker] - # runs-on: ubuntu-24.04 - # steps: - # - uses: actions/checkout@v4 - # with: - # lfs: 'true' - - # - uses: ./.github/actions/docker-setup - # with: - # docker_username: ${{ secrets.DOCKER_CI_USERNAME }} - # docker_password: ${{ secrets.DOCKER_CI_ACCESS_TOKEN }} - # github_token: ${{ secrets.GITHUB_TOKEN}} - - # - name: Complete - # env: - # R2_RELEASES_ACCESS_KEY_ID: ${{ secrets.R2_RELEASES_ACCESS_KEY_ID }} - # R2_RELEASES_SECRET_ACCESS_KEY: ${{ secrets.R2_RELEASES_SECRET_ACCESS_KEY }} - # run: | - # # Install Deno - # curl -fsSL https://deno.land/x/install/install.sh | sh - # export PATH=$HOME/.deno/bin:$PATH - - # if [ "${{ inputs.latest }}" = "true" ]; then - # ./scripts/release/main.ts --version "${{ github.event.inputs.version }}" --completeCi - # else - # ./scripts/release/main.ts --version "${{ github.event.inputs.version }}" --no-latest --completeCi - # fi + complete: + name: "Complete" + needs: [docker] + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + with: + lfs: 'true' + + - uses: actions/setup-node@v4 + with: + node-version: 20 + + - run: corepack enable + + - uses: ./.github/actions/docker-setup + with: + docker_username: ${{ secrets.DOCKER_CI_USERNAME }} + docker_password: ${{ secrets.DOCKER_CI_ACCESS_TOKEN }} + github_token: ${{ secrets.GITHUB_TOKEN}} + + - name: Complete + env: + R2_RELEASES_ACCESS_KEY_ID: ${{ secrets.R2_RELEASES_ACCESS_KEY_ID }} + R2_RELEASES_SECRET_ACCESS_KEY: ${{ secrets.R2_RELEASES_SECRET_ACCESS_KEY }} + run: | + # Install dependencies + pnpm install + + # Install tsx globally + npm install -g tsx + + if [ "${{ inputs.latest }}" = "true" ]; then + ./scripts/release/main.ts --version "${{ github.event.inputs.version }}" --completeCi + else + ./scripts/release/main.ts --version "${{ github.event.inputs.version }}" --no-latest --completeCi + fi \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 4831af4a5f..b6f660bc76 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4110,18 +4110,6 @@ dependencies = [ "utoipa", ] -[[package]] -name = "rivet-api-runtime" -version = "0.0.1" -dependencies = [ - "reqwest", - "serde", - "serde_json", - "serde_repr", - "serde_with", - "url", -] - [[package]] name = "rivet-api-types" version = "0.0.1" diff --git a/Cargo.toml b/Cargo.toml index 7c621d6431..911ec31c03 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [workspace] resolver = "2" -members = ["packages/common/api-builder","packages/common/api-client","packages/common/api-types","packages/common/api-util","packages/common/cache/build","packages/common/cache/result","packages/common/clickhouse-inserter","packages/common/clickhouse-user-query","packages/common/config","packages/common/env","packages/common/error/core","packages/common/error/macros","packages/common/gasoline/core","packages/common/gasoline/macros","packages/common/logs","packages/common/metrics","packages/common/pools","packages/common/runtime","packages/common/service-manager","packages/common/telemetry","packages/common/test-deps","packages/common/test-deps-docker","packages/common/types","packages/common/udb-util","packages/common/universaldb","packages/common/universalpubsub","packages/common/util/core","packages/common/util/id","packages/common/versioned-data-util","packages/core/actor-kv","packages/core/api-peer","packages/core/api-public","packages/core/bootstrap","packages/core/dump-openapi","packages/core/guard/core","packages/core/guard/server","packages/core/pegboard-gateway","packages/core/pegboard-runner-ws","packages/core/pegboard-tunnel","packages/core/workflow-worker","packages/infra/engine","packages/services/epoxy","packages/services/namespace","packages/services/pegboard","sdks/rust/api-full","sdks/rust/api-runtime","sdks/rust/bare_gen","sdks/rust/epoxy-protocol","sdks/rust/key-data","sdks/rust/runner-protocol","sdks/rust/tunnel-protocol"] +members = ["packages/common/api-builder","packages/common/api-client","packages/common/api-types","packages/common/api-util","packages/common/cache/build","packages/common/cache/result","packages/common/clickhouse-inserter","packages/common/clickhouse-user-query","packages/common/config","packages/common/env","packages/common/error/core","packages/common/error/macros","packages/common/gasoline/core","packages/common/gasoline/macros","packages/common/logs","packages/common/metrics","packages/common/pools","packages/common/runtime","packages/common/service-manager","packages/common/telemetry","packages/common/test-deps","packages/common/test-deps-docker","packages/common/types","packages/common/udb-util","packages/common/universaldb","packages/common/universalpubsub","packages/common/util/core","packages/common/util/id","packages/common/versioned-data-util","packages/core/actor-kv","packages/core/api-peer","packages/core/api-public","packages/core/bootstrap","packages/core/dump-openapi","packages/core/guard/core","packages/core/guard/server","packages/core/pegboard-gateway","packages/core/pegboard-runner-ws","packages/core/pegboard-tunnel","packages/core/workflow-worker","packages/infra/engine","packages/services/epoxy","packages/services/namespace","packages/services/pegboard","sdks/rust/api-full","sdks/rust/bare_gen","sdks/rust/epoxy-protocol","sdks/rust/key-data","sdks/rust/runner-protocol","sdks/rust/tunnel-protocol"] [workspace.package] version = "0.0.1" @@ -58,7 +58,6 @@ regex = "1.4" rstest = "0.26.1" rustls-pemfile = "2.2.0" rustyline = "15.0.0" -sentry = { version = "0.37.0", default-features = false, features = ["anyhow", "backtrace", "contexts", "debug-images", "panic", "reqwest", "rustls"] } serde_bare = "0.5.0" serde_yaml = "0.9.34" sha2 = "0.10" @@ -81,6 +80,11 @@ tracing-opentelemetry = "0.29" tracing-slog = "0.2" vergen = "9.0.4" +[workspace.dependencies.sentry] +version = "0.37.0" +default-features = false +features = ["anyhow","backtrace","contexts","debug-images","panic","reqwest","rustls"] + [workspace.dependencies.windows] version = "0.58" features = ["Win32","Win32_Storage","Win32_Storage_FileSystem","Win32_System","Win32_System_Console","Win32_Security"] @@ -379,9 +383,6 @@ path = "packages/services/pegboard" [workspace.dependencies.rivet-api-full] path = "sdks/rust/api-full" -[workspace.dependencies.rivet-api-runtime] -path = "sdks/rust/api-runtime" - [workspace.dependencies.bare_gen] path = "sdks/rust/bare_gen" diff --git a/docker/engine/linux-aarch64.Dockerfile b/docker/engine/linux-aarch64.Dockerfile index 67e58d45b9..b73dad2142 100644 --- a/docker/engine/linux-aarch64.Dockerfile +++ b/docker/engine/linux-aarch64.Dockerfile @@ -15,21 +15,21 @@ RUN apt-get update && apt-get install -y \ g++-multilib \ git-lfs && \ rm -rf /var/lib/apt/lists/* && \ - wget -q https://musl.cc/aarch64-linux-musl-cross.tgz && \ - tar -xzf aarch64-linux-musl-cross.tgz -C /opt/ && \ - rm aarch64-linux-musl-cross.tgz + wget -q https://github.com/cross-tools/musl-cross/releases/download/20250815/aarch64-unknown-linux-musl.tar.xz && \ + tar -xzf aarch64-unknown-linux-musl.tgz -C /opt/ && \ + rm aarch64-unknown-linux-musl.tgz # Install musl targets RUN rustup target add aarch64-unknown-linux-musl # Set environment variables -ENV PATH="/opt/aarch64-linux-musl-cross/bin:$PATH" \ +ENV PATH="/opt/aarch64-unknown-linux-musl/bin:$PATH" \ LIBCLANG_PATH=/usr/lib/llvm-14/lib \ CLANG_PATH=/usr/bin/clang-14 \ - CC_aarch64_unknown_linux_musl=aarch64-linux-musl-gcc \ - CXX_aarch64_unknown_linux_musl=aarch64-linux-musl-g++ \ - AR_aarch64_unknown_linux_musl=aarch64-linux-musl-ar \ - CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-musl-gcc \ + CC_aarch64_unknown_linux_musl=aarch64-unknown-linux-musl-gcc \ + CXX_aarch64_unknown_linux_musl=aarch64-unknown-linux-musl-g++ \ + AR_aarch64_unknown_linux_musl=aarch64-unknown-linux-musl-ar \ + CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-unknown-linux-musl-gcc \ CARGO_INCREMENTAL=0 \ RUSTFLAGS="--cfg tokio_unstable -C target-feature=+crt-static -C link-arg=-static-libgcc" \ CARGO_NET_GIT_FETCH_WITH_CLI=true diff --git a/docker/engine/linux-x86_64.Dockerfile b/docker/engine/linux-x86_64.Dockerfile index ec1389402f..206bdfbc71 100644 --- a/docker/engine/linux-x86_64.Dockerfile +++ b/docker/engine/linux-x86_64.Dockerfile @@ -16,21 +16,21 @@ RUN apt-get update && apt-get install -y \ g++-multilib \ git-lfs && \ rm -rf /var/lib/apt/lists/* && \ - wget -q https://musl.cc/x86_64-linux-musl-cross.tgz && \ - tar -xzf x86_64-linux-musl-cross.tgz -C /opt/ && \ - rm x86_64-linux-musl-cross.tgz + wget -q https://github.com/cross-tools/musl-cross/releases/latest/download/x86_64-unknown-linux-musl.tar.xz && \ + tar -xf x86_64-unknown-linux-musl.tar.xz -C /opt/ && \ + rm x86_64-unknown-linux-musl.tar.xz # Install musl targets RUN rustup target add x86_64-unknown-linux-musl # Set environment variables -ENV PATH="/opt/x86_64-linux-musl-cross/bin:$PATH" \ +ENV PATH="/opt/x86_64-unknown-linux-musl/bin:$PATH" \ LIBCLANG_PATH=/usr/lib/llvm-14/lib \ CLANG_PATH=/usr/bin/clang-14 \ - CC_x86_64_unknown_linux_musl=x86_64-linux-musl-gcc \ - CXX_x86_64_unknown_linux_musl=x86_64-linux-musl-g++ \ - AR_x86_64_unknown_linux_musl=x86_64-linux-musl-ar \ - CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER=x86_64-linux-musl-gcc \ + CC_x86_64_unknown_linux_musl=x86_64-unknown-linux-musl-gcc \ + CXX_x86_64_unknown_linux_musl=x86_64-unknown-linux-musl-g++ \ + AR_x86_64_unknown_linux_musl=x86_64-unknown-linux-musl-ar \ + CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER=x86_64-unknown-linux-musl-gcc \ CARGO_INCREMENTAL=0 \ RUSTFLAGS="--cfg tokio_unstable -C target-feature=+crt-static -C link-arg=-static-libgcc" \ CARGO_NET_GIT_FETCH_WITH_CLI=true diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ffec1ba4ab..62a80f8ad4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -603,6 +603,25 @@ importers: specifier: ^0.25.0 version: 0.25.8 + scripts/release: + dependencies: + execa: + specifier: ^8.0.1 + version: 8.0.1 + glob: + specifier: ^10.3.10 + version: 10.4.5 + devDependencies: + '@types/minimist': + specifier: ^1.2.5 + version: 1.2.5 + '@types/node': + specifier: ^24.3.0 + version: 24.3.0 + minimist: + specifier: ^1.2.8 + version: 1.2.8 + scripts/tests: devDependencies: '@types/node': @@ -658,52 +677,6 @@ importers: specifier: 5.8.2 version: 5.8.2 - sdks/typescript/api-runtime: - dependencies: - form-data: - specifier: ^4.0.0 - version: 4.0.4 - js-base64: - specifier: ^3.7.5 - version: 3.7.7 - node-fetch: - specifier: '2' - version: 2.7.0 - qs: - specifier: ^6.11.2 - version: 6.14.0 - readable-stream: - specifier: ^4.5.2 - version: 4.7.0 - url-join: - specifier: ^5.0.0 - version: 5.0.0 - devDependencies: - '@types/node': - specifier: 17.0.33 - version: 17.0.33 - '@types/node-fetch': - specifier: 2.6.11 - version: 2.6.11 - '@types/qs': - specifier: 6.9.8 - version: 6.9.8 - '@types/readable-stream': - specifier: ^4.0.18 - version: 4.0.21 - '@types/url-join': - specifier: 4.0.1 - version: 4.0.1 - esbuild: - specifier: ^0.19.11 - version: 0.19.12 - prettier: - specifier: 2.7.1 - version: 2.7.1 - typescript: - specifier: 5.8.2 - version: 5.8.2 - sdks/typescript/runner: dependencies: '@rivetkit/engine-runner-protocol': @@ -3512,6 +3485,9 @@ packages: resolution: {integrity: sha512-5eEkJZ/BLvTE3vXGKkWlyTSUVZuzj23Wj8PoyOq2lt5I3CYbiLBOPb3XmCW6QcuOibIUE6emHXHt9E/F/rCa6w==} deprecated: This is a stub types definition. mime provides its own type definitions, so you do not need this installed. + '@types/minimist@1.2.5': + resolution: {integrity: sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag==} + '@types/ms@2.1.0': resolution: {integrity: sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==} @@ -10099,6 +10075,8 @@ snapshots: dependencies: mime: 4.0.7 + '@types/minimist@1.2.5': {} + '@types/ms@2.1.0': {} '@types/mute-stream@0.0.4': diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 867ceb4f2b..02de42b369 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -2,8 +2,8 @@ packages: - docker/template - frontend - scripts/tests + - scripts/release - sdks/typescript/api-full - - sdks/typescript/api-runtime - sdks/typescript/runner - sdks/typescript/runner-protocol - sdks/typescript/test-runner diff --git a/scripts/release/artifacts.ts b/scripts/release/artifacts.ts index fe96071286..767dbebf1f 100644 --- a/scripts/release/artifacts.ts +++ b/scripts/release/artifacts.ts @@ -1,98 +1,93 @@ import type { ReleaseOpts } from "./main.ts"; -import { assertExists } from "@std/assert/exists"; -import $, { CommandBuilder } from "dax"; -import { assert } from "@std/assert/assert"; -import { resolve } from "@std/path"; +import { $ } from "execa"; +import * as path from "node:path"; +import * as fs from "node:fs/promises"; + +function assert(condition: any, message?: string): asserts condition { + if (!condition) { + throw new Error(message || "Assertion failed"); + } +} export async function updateArtifacts(opts: ReleaseOpts) { // Get credentials and set them in the environment - const awsAccessKeyId = - Deno.env.get("R2_RELEASES_ACCESS_KEY_ID") ?? - (await $`op read "op://Engineering/rivet-releases R2 Upload/username"`.text()); - const awsSecretAccessKey = - Deno.env.get("R2_RELEASES_SECRET_ACCESS_KEY") ?? - (await $`op read "op://Engineering/rivet-releases R2 Upload/password"`.text()); + let awsAccessKeyId = process.env.R2_RELEASES_ACCESS_KEY_ID; + if (!awsAccessKeyId) { + const result = await $`op read "op://Engineering/rivet-releases R2 Upload/username"`; + awsAccessKeyId = result.stdout.trim(); + } + let awsSecretAccessKey = process.env.R2_RELEASES_SECRET_ACCESS_KEY; + if (!awsSecretAccessKey) { + const result = await $`op read "op://Engineering/rivet-releases R2 Upload/password"`; + awsSecretAccessKey = result.stdout.trim(); + } const endpointUrl = "https://2a94c6a0ced8d35ea63cddc86c2681e7.r2.cloudflarestorage.com"; - // Create AWS CLI command builder with credentials - const awsCommand = new CommandBuilder().env({ + // Create AWS environment for commands + const awsEnv = { AWS_ACCESS_KEY_ID: awsAccessKeyId, AWS_SECRET_ACCESS_KEY: awsSecretAccessKey, AWS_DEFAULT_REGION: "auto", - }); + }; - // List all files under rivet/{commit}/ - const commitPrefix = `rivet/${opts.commit}/`; - $.logStep("Listing Original Files", commitPrefix); - const commitFiles = await awsCommand - .command( - `aws s3api list-objects --bucket rivet-releases --prefix ${commitPrefix} --endpoint-url ${endpointUrl}`, - ) - .json(); + // List all files under engine/{commit}/ + const commitPrefix = `engine/${opts.commit}/`; + console.log(`==> Listing Original Files: ${commitPrefix}`); + const listResult = await $({ env: awsEnv, shell: true })`aws s3api list-objects --bucket rivet-releases --prefix ${commitPrefix} --endpoint-url ${endpointUrl}`; + const commitFiles = JSON.parse(listResult.stdout); assert( Array.isArray(commitFiles?.Contents) && commitFiles.Contents.length > 0, - `No files found under rivet/${opts.commit}/`, + `No files found under engine/${opts.commit}/`, ); // Copy files to version directory - const versionTarget = `rivet/${opts.version}/`; - await copyFiles(awsCommand, commitPrefix, versionTarget, endpointUrl); - await generateInstallScripts(awsCommand, opts, opts.version, endpointUrl); + const versionTarget = `engine/${opts.version}/`; + await copyFiles(awsEnv, commitPrefix, versionTarget, endpointUrl); + await generateInstallScripts(awsEnv, opts, opts.version, endpointUrl); // If this is the latest version, copy to latest directory if (opts.latest) { - await copyFiles(awsCommand, commitPrefix, "rivet/latest/", endpointUrl); - await generateInstallScripts(awsCommand, opts, "latest", endpointUrl); + await copyFiles(awsEnv, commitPrefix, "engine/latest/", endpointUrl); + await generateInstallScripts(awsEnv, opts, "latest", endpointUrl); } } async function copyFiles( - awsCommand: CommandBuilder, + awsEnv: Record, sourcePrefix: string, targetPrefix: string, endpointUrl: string, ) { - $.logStep("Copying Files", targetPrefix); - await $.logGroup(async () => { - // Delete existing files in target directory using --recursive - $.logStep("Deleting existing files in", targetPrefix); - await awsCommand - .command(`aws s3 rm s3://rivet-releases/${targetPrefix} --recursive --endpoint-url ${endpointUrl}`) - .spawn(); + console.log(`==> Copying Files: ${targetPrefix}`); + // Delete existing files in target directory using --recursive + console.log(`Deleting existing files in ${targetPrefix}`); + await $({ env: awsEnv, shell: true })`aws s3 rm s3://rivet-releases/${targetPrefix} --recursive --endpoint-url ${endpointUrl}`; - // Copy new files using --recursive - $.logStep("Copying files from", sourcePrefix, "to", targetPrefix); - await awsCommand - .command( - `aws s3 cp s3://rivet-releases/${sourcePrefix} s3://rivet-releases/${targetPrefix} --recursive --copy-props none --endpoint-url ${endpointUrl}`, - ) - .spawn(); - }); + // Copy new files using --recursive + console.log(`Copying files from ${sourcePrefix} to ${targetPrefix}`); + await $({ env: awsEnv, shell: true })`aws s3 cp s3://rivet-releases/${sourcePrefix} s3://rivet-releases/${targetPrefix} --recursive --copy-props none --endpoint-url ${endpointUrl}`; } async function generateInstallScripts( - awsCommand: CommandBuilder, + awsEnv: Record, opts: ReleaseOpts, version: string, endpointUrl: string, ) { const installScriptPaths = [ - resolve(opts.root, "scripts/release/static/install.sh"), - resolve(opts.root, "scripts/release/static/install.ps1"), + path.resolve(opts.root, "scripts/release/static/install.sh"), + path.resolve(opts.root, "scripts/release/static/install.ps1"), ]; for (const scriptPath of installScriptPaths) { - let scriptContent = await Deno.readTextFile(scriptPath); + let scriptContent = await fs.readFile(scriptPath, 'utf-8'); scriptContent = scriptContent.replace(/__VERSION__/g, version); - const uploadKey = `rivet/${version}/${scriptPath.split("/").pop() ?? ""}`; + const uploadKey = `engine/${version}/${scriptPath.split("/").pop() ?? ""}`; // Upload the install script to S3 - $.logStep("Uploading Install Script", uploadKey); - await awsCommand - .command(`aws s3 cp - s3://rivet-releases/${uploadKey} --endpoint-url ${endpointUrl}`) - .stdinText(scriptContent) - .spawn(); + console.log(`==> Uploading Install Script: ${uploadKey}`); + await $({ env: awsEnv, input: scriptContent, shell: true })`aws s3 cp - s3://rivet-releases/${uploadKey} --endpoint-url ${endpointUrl}`; } } diff --git a/scripts/release/docker.ts b/scripts/release/docker.ts index 2bf257747c..67aa7e98a2 100644 --- a/scripts/release/docker.ts +++ b/scripts/release/docker.ts @@ -1,19 +1,17 @@ -import $ from "dax"; +import { $ } from "execa"; const REPOS = [ - { name: "rivetgg/rivet-server", prefix: "slim", main: true }, - { name: "rivetgg/rivet-server", prefix: "full" }, - { name: "rivetgg/rivet-client", prefix: "full", main: true }, - { name: "rivetgg/rivet-client", prefix: "container-runner" }, - //{ name: "rivetgg/rivet", prefix: "monolith", main: true }, + { name: "rivetgg/rivet-engine", prefix: "slim", main: true }, + { name: "rivetgg/rivet-engine", prefix: "full" }, ] export async function tagDocker(opts: { version: string; commit: string; latest: boolean }) { for (const { name, prefix, main } of REPOS) { // Check image exists - $.logStep("Pulling", `${name}:${prefix}-${opts.commit}`); - const imageExists = await $`docker pull --platform amd64 ${name}:${prefix}-${opts.commit}`.quiet().noThrow(); - if (imageExists.code !== 0) { + console.log(`==> Pulling: ${name}:${prefix}-${opts.commit}`); + try { + await $({ stdout: 'ignore', stderr: 'ignore' })`docker pull --platform amd64 ${name}:${prefix}-${opts.commit}`; + } catch (error) { throw new Error(`Image ${name}:${prefix}-${opts.commit} does not exist on Docker Hub.`); } @@ -34,7 +32,7 @@ export async function tagDocker(opts: { version: string; commit: string; latest: } async function tag(image: string, from: string, to: string) { - $.logStep("Tagging", `${image}:${from} -> ${image}:${to}`); + console.log(`==> Tagging: ${image}:${from} -> ${image}:${to}`); await $`docker tag ${image}:${from} ${image}:${to}`; await $`docker push ${image}:${to}`; } diff --git a/scripts/release/git.ts b/scripts/release/git.ts index 1168e9e62e..0e7f2c0a57 100644 --- a/scripts/release/git.ts +++ b/scripts/release/git.ts @@ -1,9 +1,10 @@ import type { ReleaseOpts } from "./main.ts"; -import $ from "dax"; +import { $ } from "execa"; export async function validateGit(_opts: ReleaseOpts) { // Validate there's no uncommitted changes - const status = await $`git status --porcelain`.text(); + const result = await $`git status --porcelain`; + const status = result.stdout; if (status.trim().length > 0) { throw new Error( "There are uncommitted changes. Please commit or stash them.", diff --git a/scripts/release/main.ts b/scripts/release/main.ts index 47ebb9ef16..ad0d5890b9 100755 --- a/scripts/release/main.ts +++ b/scripts/release/main.ts @@ -1,17 +1,37 @@ -#!/usr/bin/env -S deno run -A +#!/usr/bin/env tsx -import { resolve } from "jsr:@std/path"; -import { assert, assertEquals, assertExists } from "jsr:@std/assert"; +import * as path from "node:path"; +import * as fs from "node:fs"; +import * as url from "node:url"; +import minimist from "minimist"; +import { $ } from "execa"; import { publishSdk } from "./sdk.ts"; import { updateVersion } from "./update_version.ts"; import { configureReleasePlease } from "./release_please.ts"; import { validateGit } from "./git.ts"; -import { parseArgs } from "jsr:@std/cli"; -import $ from "dax"; import { tagDocker } from "./docker.ts"; import { updateArtifacts } from "./artifacts.ts"; -const ROOT_DIR = resolve(import.meta.dirname!, "..", ".."); +const __dirname = path.dirname(url.fileURLToPath(import.meta.url)); +const ROOT_DIR = path.resolve(__dirname, "..", ".."); + +function assert(condition: any, message?: string): asserts condition { + if (!condition) { + throw new Error(message || "Assertion failed"); + } +} + +function assertEquals(actual: T, expected: T, message?: string): void { + if (actual !== expected) { + throw new Error(message || `Expected ${expected}, got ${actual}`); + } +} + +function assertExists(value: T | null | undefined, message?: string): asserts value is T { + if (value === null || value === undefined) { + throw new Error(message || "Value does not exist"); + } +} export interface ReleaseOpts { root: string; @@ -26,7 +46,7 @@ async function main() { // - latest = tag version as the latest version // - noValidateGit = used for testing without using the main branch // - setup & complete = run all pre-build or post-build steps, used in CI for batch jbos - const args = parseArgs(Deno.args, { + const args = minimist(process.argv.slice(2), { boolean: [ // Config "latest", @@ -70,7 +90,8 @@ async function main() { commit = args.commit; } else { // Read commit - commit = await $`git rev-parse HEAD`.text(); + const result = await $`git rev-parse HEAD`; + commit = result.stdout.trim(); } const opts: ReleaseOpts = { @@ -92,76 +113,62 @@ async function main() { } if (args.updateVersion || args.setupLocal) { - $.logStep("Updating Version", ""); - await $.logGroup(async () => { - await updateVersion(opts); - }); + console.log("==> Updating Version"); + await updateVersion(opts); } if (args.generateFern || args.setupLocal) { - $.logStep("Generating Fern", ""); - await $.logGroup(async () => { - await $`./scripts/fern/gen.sh`; - }); + console.log("==> Generating Fern"); + await $`./scripts/fern/gen.sh`; } if (args.gitCommit || args.setupLocal) { assert(!args.noValidateGit, "cannot commit without git validation"); - $.logStep("Committing Changes", ""); - await $.logGroup(async () => { - await $`git add .`; - await $`git commit --allow-empty -m ${`chore(release): update version to ${opts.version}`}`; - }); + console.log("==> Committing Changes"); + await $`git add .`; + await $({ shell: true })`git commit --allow-empty -m "chore(release): update version to ${opts.version}"`; } if (args.configureReleasePlease || args.setupLocal) { assert(!args.noValidateGit, "cannot configure release please without git validation"); - $.logStep("Configuring Release Please", ""); - await $.logGroup(async () => { - await configureReleasePlease(opts); - }); + console.log("==> Configuring Release Please"); + await configureReleasePlease(opts); } if (args.gitPush || args.setupLocal) { assert(!args.noValidateGit, "cannot push without git validation"); - $.logStep("Pushing Commits", ""); - await $.logGroup(async () => { - const branch = (await $`git rev-parse --abbrev-ref HEAD`.stdout("piped")).stdout.trim(); - if (branch === "main") { - // Push on main - await $`git push`; - } else { - // Modify current branch - await $`gt submit --force --no-edit --publish`; - } - }); + console.log("==> Pushing Commits"); + const branchResult = await $`git rev-parse --abbrev-ref HEAD`; + const branch = branchResult.stdout.trim(); + if (branch === "main") { + // Push on main + await $`git push`; + } else { + // Modify current branch + await $`gt submit --force --no-edit --publish`; + } } if (args.publishSdk || args.setupCi) { - $.logStep("Publishing SDKs", ""); - await $.logGroup(async () => { - await publishSdk(opts); - }); + console.log("==> Publishing SDKs"); + await publishSdk(opts); } if (args.tagDocker || args.completeCi) { - $.logStep("Tagging Docker", ""); - await $.logGroup(async () => { - await tagDocker(opts); - }); + console.log("==> Tagging Docker"); + await tagDocker(opts); } if (args.updateArtifacts || args.completeCi) { - $.logStep("Updating Artifacts", ""); - await $.logGroup(async () => { - await updateArtifacts(opts); - }); + console.log("==> Updating Artifacts"); + await updateArtifacts(opts); } - $.logStep("Complete"); + console.log("==> Complete"); } -if (import.meta.main) { - main(); -} +main().catch((err) => { + console.error(err); + process.exit(1); +}); diff --git a/scripts/release/package.json b/scripts/release/package.json new file mode 100644 index 0000000000..039483a7f2 --- /dev/null +++ b/scripts/release/package.json @@ -0,0 +1,22 @@ +{ + "name": "release", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "check-types": "tsc --noEmit" + }, + "keywords": [], + "author": "", + "license": "ISC", + "packageManager": "pnpm@10.13.1", + "devDependencies": { + "@types/node": "^24.3.0", + "minimist": "^1.2.8", + "@types/minimist": "^1.2.5" + }, + "dependencies": { + "execa": "^8.0.1", + "glob": "^10.3.10" + } +} \ No newline at end of file diff --git a/scripts/release/release_please.ts b/scripts/release/release_please.ts index 822c3ee8ae..83d6bd027c 100644 --- a/scripts/release/release_please.ts +++ b/scripts/release/release_please.ts @@ -1,9 +1,9 @@ import type { ReleaseOpts } from "./main.ts"; -import $ from "dax"; +import { $ } from "execa"; export async function configureReleasePlease(opts: ReleaseOpts) { // Check if the Release-As commit already exists const commitMessage = `chore: release ${opts.version}`; - $.logStep("Updating Release Please", commitMessage); - await $`git commit --allow-empty -m ${commitMessage} -m ${`Release-As: ${opts.version}`}`; + console.log(`==> Updating Release Please: ${commitMessage}`); + await $({ shell: true })`git commit --allow-empty -m "${commitMessage}" -m "Release-As: ${opts.version}"`; } diff --git a/scripts/release/sdk.ts b/scripts/release/sdk.ts index 30690378c7..4192dcda18 100644 --- a/scripts/release/sdk.ts +++ b/scripts/release/sdk.ts @@ -1,23 +1,29 @@ import type { ReleaseOpts } from "./main.ts"; -import { assertStringIncludes } from "@std/assert"; -import $ from "dax"; -import { transformPackageJsonToDenoJson } from "../sdk_actor/transform_pkg_to_deno.ts"; +import { $ } from "execa"; +import { transformPackageJsonToDenoJson } from "./transform_pkg_to_deno.ts"; + +function assertStringIncludes(actual: string, expected: string, message?: string): void { + if (!actual.includes(expected)) { + throw new Error(message || `String does not include expected substring: ${expected}`); + } +} async function npmVersionExists( packageName: string, version: string, ): Promise { - $.logStep("Checking if NPM version exists", `${packageName}@${version}`); - const npmCheck = await $`npm view ${packageName}@${version} version`.quiet() - .noThrow(); - if (npmCheck.code === 0) { + console.log(`==> Checking if NPM version exists: ${packageName}@${version}`); + try { + await $({ stdout: 'ignore', stderr: 'pipe' })`npm view ${packageName}@${version} version`; return true; - } else { - assertStringIncludes( - npmCheck.stderr, - `No match found for version ${version}`, - "unexpected output", - ); + } catch (error: any) { + if (error.stderr) { + assertStringIncludes( + error.stderr, + `No match found for version ${version}`, + "unexpected output", + ); + } return false; } } @@ -26,28 +32,24 @@ async function jsrVersionExists( packageName: string, version: string, ): Promise { - $.logStep("Checking if JSR version exists", `${packageName}@${version}`); - const denoCheck = await $`deno info jsr:${packageName}@${version}`.quiet() - .noThrow(); - if (denoCheck.code === 0) { + console.log(`==> Checking if JSR version exists: ${packageName}@${version}`); + try { + await $({ stdout: 'ignore', stderr: 'pipe' })`deno info jsr:${packageName}@${version}`; return true; - } else { - assertStringIncludes( - denoCheck.stderr, - `Could not find version of '${packageName}' that matches specified version constraint '${version}'`, - "unexpected output", - ); + } catch (error: any) { + if (error.stderr) { + assertStringIncludes( + error.stderr, + `Could not find version of '${packageName}' that matches specified version constraint '${version}'`, + "unexpected output", + ); + } return false; } } export async function publishSdk(opts: ReleaseOpts) { const packages: { path: string, name: string, npm: boolean, jsr?: boolean, turbo?: boolean }[] = [ - { - path: `${opts.root}/sdks/typescript/api-runtime`, - name: "@rivet-gg/api", - npm: true, - }, { path: `${opts.root}/sdks/typescript/api-full`, name: "@rivet-gg/api-full", @@ -69,7 +71,7 @@ export async function publishSdk(opts: ReleaseOpts) { } if (versionExists) { - $.logLight( + console.log( `Version ${opts.version} of ${pkg.name} already exists. Skipping...`, ); continue; @@ -77,13 +79,13 @@ export async function publishSdk(opts: ReleaseOpts) { // Publish if (pkg.npm) { - $.logStep("Publishing to NPM", `${pkg.name}@${opts.version}`); - await $`pnpm install`.cwd(pkg.path); - await $`pnpm npm publish --access public --tolerate-republish`.cwd(pkg.path); + console.log(`==> Publishing to NPM: ${pkg.name}@${opts.version}`); + await $({ cwd: pkg.path })`pnpm install`; + await $({ cwd: pkg.path })`pnpm npm publish --access public --tolerate-republish`; } if (pkg.jsr) { - $.logStep("Publishing to JSR", `${pkg.name}@${opts.version}`); + console.log(`==> Publishing to JSR: ${pkg.name}@${opts.version}`); // TODO(https://github.com/denoland/deno/issues/27428): `--set-version` not working, so we have to manually update `jsr.jsonc` @@ -97,8 +99,7 @@ export async function publishSdk(opts: ReleaseOpts) { // --allow-slow-types = we use zod which doesn't support this // --allow-dirty = we change the version on the fly // --set-version = validate the correct version is used - await $`DENO_NO_PACKAGE_JSON=1 deno publish --allow-slow-types --allow-dirty` - .cwd(pkg.path); + await $({ cwd: pkg.path, env: { DENO_NO_PACKAGE_JSON: '1' } })`deno publish --allow-slow-types --allow-dirty`; } } } diff --git a/scripts/release/static/install.ps1 b/scripts/release/static/install.ps1 index cf51da8d60..da3fe05997 100644 --- a/scripts/release/static/install.ps1 +++ b/scripts/release/static/install.ps1 @@ -16,22 +16,22 @@ if (!(Test-Path $RivetInstall)) { New-Item $RivetInstall -ItemType Directory | Out-Null } -$RivetExe = "$RivetInstall\rivet.exe" +$RivetExe = "$RivetInstall\rivet-engine.exe" $Version = '__VERSION__' -$FileName = 'rivet-x86_64-pc-windows-gnu.exe' +$FileName = 'rivet-engine-x86_64-pc-windows-gnu.exe' Write-Host -Write-Host "> Installing Rivet CLI ${Version}" +Write-Host "> Installing Rivet Engine ${Version}" # Download CLI -$DownloadUrl = "https://releases.rivet.gg/rivet/${Version}/${FileName}" +$DownloadUrl = "https://releases.rivet.gg/engine/${Version}/${FileName}" Write-Host Write-Host "> Downloading ${DownloadUrl}" Invoke-WebRequest $DownloadUrl -OutFile $RivetExe -UseBasicParsing # Install CLI Write-Host -Write-Host "> Installing rivet" +Write-Host "> Installing rivet-engine" $User = [System.EnvironmentVariableTarget]::User $Path = [System.Environment]::GetEnvironmentVariable('Path', $User) if (!(";${Path};".ToLower() -like "*;${RivetInstall};*".ToLower())) { @@ -43,9 +43,9 @@ if (!(";${Path};".ToLower() -like "*;${RivetInstall};*".ToLower())) { Write-Host Write-Host "> Checking installation" -rivet.exe --version +rivet-engine.exe --version Write-Host -Write-Host "Rivet was installed successfully to ${RivetExe}." -Write-Host "Run 'rivet --help' to get started." +Write-Host "Rivet engine was installed successfully to ${RivetExe}." +Write-Host "Run 'rivet-engine --help' to get started." Write-Host diff --git a/scripts/release/static/install.sh b/scripts/release/static/install.sh index 6702aca074..7420f36af2 100644 --- a/scripts/release/static/install.sh +++ b/scripts/release/static/install.sh @@ -7,11 +7,11 @@ # shellcheck enable=require-variable-braces set -eu -rm -rf /tmp/rivet_cli_install -mkdir /tmp/rivet_cli_install -cd /tmp/rivet_cli_install +rm -rf /tmp/rivet_engine_install +mkdir /tmp/rivet_engine_install +cd /tmp/rivet_engine_install -RIVET_CLI_VERSION="${RIVET_CLI_VERSION:-__VERSION__}" +RIVET_ENGINE_VERSION="${RIVET_ENGINE_VERSION:-__VERSION__}" UNAME="$(uname -s)" ARCH="$(uname -m)" @@ -21,9 +21,9 @@ if [ "$(printf '%s' "$UNAME" | cut -c 1-6)" = "Darwin" ]; then echo "> Detected macOS" if [ "$ARCH" = "x86_64" ]; then - FILE_NAME="rivet-x86_64-apple-darwin" + FILE_NAME="rivet-engine-x86_64-apple-darwin" elif [ "$ARCH" = "arm64" ]; then - FILE_NAME="rivet-aarch64-apple-darwin" + FILE_NAME="rivet-engine-aarch64-apple-darwin" else echo "Unknown arch $ARCH" 1>&2 exit 1 @@ -32,7 +32,7 @@ elif [ "$(printf '%s' "$UNAME" | cut -c 1-5)" = "Linux" ]; then echo echo "> Detected Linux ($(getconf LONG_BIT) bit)" - FILE_NAME="rivet-x86_64-unknown-linux-musl" + FILE_NAME="rivet-engine-x86_64-unknown-linux-musl" else echo "Unable to determine platform" 1>&2 exit 1 @@ -44,7 +44,7 @@ if [ -z "$BIN_DIR" ]; then BIN_DIR="/usr/local/bin" fi set -u -INSTALL_PATH="$BIN_DIR/rivet" +INSTALL_PATH="$BIN_DIR/rivet-engine" if [ ! -d "$BIN_DIR" ]; then # Find the base parent directory. We're using mkdir -p, which recursively creates directories, so we can't rely on `dirname`. @@ -66,22 +66,22 @@ if [ ! -d "$BIN_DIR" ]; then fi -# Download CLI -URL="https://releases.rivet.gg/rivet/${RIVET_CLI_VERSION}/${FILE_NAME}" +# Download engine +URL="https://releases.rivet.gg/engine/${RIVET_ENGINE_VERSION}/${FILE_NAME}" echo echo "> Downloading $URL" -curl -fsSL "$URL" -o rivet-cli -chmod +x rivet-cli +curl -fsSL "$URL" -o rivet-engine +chmod +x rivet-engine # Move binary if [ ! -w "$BIN_DIR" ]; then echo - echo "> Installing rivet to $INSTALL_PATH (requires sudo)" - sudo mv ./rivet-cli "$INSTALL_PATH" + echo "> Installing rivet-engine to $INSTALL_PATH (requires sudo)" + sudo mv ./rivet-engine "$INSTALL_PATH" else echo - echo "> Installing rivet to $INSTALL_PATH" - mv ./rivet-cli "$INSTALL_PATH" + echo "> Installing rivet-engine to $INSTALL_PATH" + mv ./rivet-engine "$INSTALL_PATH" fi # Check if path may be incorrect @@ -96,8 +96,8 @@ esac echo echo "> Checking installation" -"$BIN_DIR/rivet" --version +"$BIN_DIR/rivet-engine" --version echo echo "Rivet was installed successfully." -echo "Run 'rivet --help' to get started." +echo "Run 'rivet-engine --help' to get started." diff --git a/scripts/sdk_actor/transform_pkg_to_deno.ts b/scripts/release/transform_pkg_to_deno.ts similarity index 74% rename from scripts/sdk_actor/transform_pkg_to_deno.ts rename to scripts/release/transform_pkg_to_deno.ts index c9707ac001..7de03a8644 100644 --- a/scripts/sdk_actor/transform_pkg_to_deno.ts +++ b/scripts/release/transform_pkg_to_deno.ts @@ -1,6 +1,7 @@ import type { PackageJson, TsConfigJson } from "type-fest"; -import { join, joinGlobs, dirname, basename } from "@std/path"; -import { expandGlob } from "@std/fs"; +import * as path from "node:path"; +import * as fs from "node:fs/promises"; +import { glob } from "glob"; type DenoFlavoredPackageJson = PackageJson & { deno?: { @@ -34,10 +35,10 @@ interface Config { * - Use `deno` field in exports to point to the correct path */ export async function transformPackageJsonToDenoJson( - config: Config = { internalPackagesLinkPath: "internal", cwd: Deno.cwd() }, + config: Config = { internalPackagesLinkPath: "internal", cwd: process.cwd() }, ) { const packageJson: DenoFlavoredPackageJson = JSON.parse( - await Deno.readTextFile(join(config.cwd,"package.json")), + await fs.readFile(path.join(config.cwd,"package.json"), 'utf-8'), ); const denoPkg = { @@ -52,12 +53,13 @@ export async function transformPackageJsonToDenoJson( publish: { ...(packageJson.deno?.publish ?? {}) }, }; - const dirStat = await Deno.stat(config.internalPackagesLinkPath).catch( - () => null, - ); - - if (dirStat?.isDirectory) { - await Deno.remove(config.internalPackagesLinkPath, { recursive: true }); + try { + const dirStat = await fs.stat(config.internalPackagesLinkPath); + if (dirStat.isDirectory()) { + await fs.rm(config.internalPackagesLinkPath, { recursive: true }); + } + } catch (error) { + // Directory doesn't exist, that's fine } const internalPackages = await getInternalPackages(config.cwd); @@ -98,26 +100,26 @@ export async function transformPackageJsonToDenoJson( ); } - const link = basename(dirname(internalPkg.path)); + const link = path.basename(path.dirname(internalPkg.path)); - await Deno.mkdir( - join(config.cwd, config.internalPackagesLinkPath), + await fs.mkdir( + path.join(config.cwd, config.internalPackagesLinkPath), { recursive: true }, ); - const internalPkgPath = join( + const internalPkgPath = path.join( internalPkg.path, "..", config.skipPathInInternalPackages || "", ); - const relativeAliasedPkgPath = join( + const relativeAliasedPkgPath = path.join( config.internalPackagesLinkPath, link, ); - const aliasedPkgPath = join(config.cwd, relativeAliasedPkgPath); + const aliasedPkgPath = path.join(config.cwd, relativeAliasedPkgPath); - await Deno.symlink(internalPkgPath, aliasedPkgPath); + await fs.symlink(internalPkgPath, aliasedPkgPath); // Add the symlinked package to the negation of exclude (exclude it from exclude) if ( @@ -147,7 +149,7 @@ export async function transformPackageJsonToDenoJson( ); } - const exported = join(internalPkg.packageJson.name, exportPath); + const exported = path.join(internalPkg.packageJson.name, exportPath); if (!paths?.deno) { throw new Error( @@ -161,7 +163,7 @@ export async function transformPackageJsonToDenoJson( ); } - const newPath = join( + const newPath = path.join( "./", "internal", link, @@ -179,44 +181,44 @@ export async function transformPackageJsonToDenoJson( } } - await Deno.writeTextFile(join(config.cwd, "deno.json"), JSON.stringify(denoPkg, null, "\t")); + await fs.writeFile(path.join(config.cwd, "deno.json"), JSON.stringify(denoPkg, null, "\t")); } -async function findRootWorkspace(dir = Deno.cwd()): Promise { +async function findRootWorkspace(dir = process.cwd()): Promise { try { const { workspaces } = JSON.parse( - await Deno.readTextFile(join(dir, "package.json")), + await fs.readFile(path.join(dir, "package.json"), 'utf-8'), ); if (workspaces) { - return join(dir, "package.json"); + return path.join(dir, "package.json"); } - return findRootWorkspace(join(dir, "..")); + return findRootWorkspace(path.join(dir, "..")); } catch { - return findRootWorkspace(join(dir, "..")); + return findRootWorkspace(path.join(dir, "..")); } } async function getInternalPackages(cwd: string): Promise { const workspaceRoot = await findRootWorkspace(cwd); - const { workspaces } = JSON.parse(await Deno.readTextFile(workspaceRoot)); - - const globPatterns = workspaces.map((pattern: string) => - joinGlobs([pattern, "package.json"]), - ); + const { workspaces } = JSON.parse(await fs.readFile(workspaceRoot, 'utf-8')); const internalPackages = new Map< string, { path: string; packageJson: DenoFlavoredPackageJson } >(); - for (const pattern of globPatterns) { - for await (const entry of expandGlob(pattern, { - root: join(workspaceRoot, ".."), - })) { - const packageJson = JSON.parse(await Deno.readTextFile(entry.path)); + for (const pattern of workspaces) { + const globPattern = path.join(pattern, "package.json"); + const matches = await glob(globPattern, { + cwd: path.join(workspaceRoot, ".."), + absolute: true, + }); + + for (const matchPath of matches) { + const packageJson = JSON.parse(await fs.readFile(matchPath, 'utf-8')); internalPackages.set(packageJson.name, { - path: entry.path, + path: matchPath, packageJson, }); } diff --git a/scripts/release/tsconfig.json b/scripts/release/tsconfig.json new file mode 100644 index 0000000000..505483b8f2 --- /dev/null +++ b/scripts/release/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "lib": ["es2022"], + "target": "ES2022", + "module": "ESNext", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "skipLibCheck": true, + "moduleResolution": "node", + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true + } +} \ No newline at end of file diff --git a/scripts/release/update_version.ts b/scripts/release/update_version.ts index c54b4ae5f0..ce96881b1b 100644 --- a/scripts/release/update_version.ts +++ b/scripts/release/update_version.ts @@ -1,7 +1,14 @@ import type { ReleaseOpts } from "./main.ts"; import { glob } from "glob"; -import $ from "dax"; -import { assert } from "@std/assert"; +import { $ } from "execa"; +import * as fs from "node:fs/promises"; +import * as path from "node:path"; + +function assert(condition: any, message?: string): asserts condition { + if (!condition) { + throw new Error(message || "Assertion failed"); + } +} export async function updateVersion(opts: ReleaseOpts) { // Define substitutions @@ -48,12 +55,12 @@ export async function updateVersion(opts: ReleaseOpts) { const paths = await glob(globPath, { cwd: opts.root }); assert(paths.length > 0, `no paths matched: ${globPath}`); for (const path of paths) { - const file = await Deno.readTextFile(path); + const file = await fs.readFile(path, 'utf-8'); assert(find.test(file), `file does not match ${find}: ${path}`); const newFile = file.replace(find, replace); - await Deno.writeTextFile(path, newFile); + await fs.writeFile(path, newFile); - await $`git add ${path}`.cwd(opts.root); + await $({ cwd: opts.root })`git add ${path}`; } } } diff --git a/scripts/sdk_actor/compile_bridge.ts b/scripts/sdk_actor/compile_bridge.ts deleted file mode 100755 index 9b0e38cd72..0000000000 --- a/scripts/sdk_actor/compile_bridge.ts +++ /dev/null @@ -1,94 +0,0 @@ -#!/usr/bin/env -S deno run -A - -import $ from "dax"; -import { copy, walk } from "@std/fs"; -import { resolve } from "@std/path"; - -const PROJECT_ROOT = resolve(import.meta.dirname!, "../.."); -const ACTOR_SDK_PATH = resolve(PROJECT_ROOT, "sdks/actor"); - -const ACTOR_BRIDGE_PATH = resolve(ACTOR_SDK_PATH, "bridge"); -const ACTOR_BRIDGE_TYPES_PATH = resolve(ACTOR_BRIDGE_PATH, "types"); - -const ISOLATE_RUNNER_JS_PATH = resolve( - import.meta.dirname!, - "../../packages/edge/infra/client/isolate-v8-runner/js/", -); - -const ACTOR_CORE_BRIDGE_TYPES_PATH = resolve( - ACTOR_SDK_PATH, - "core", - "src", - "bridge_types", -); - -// Clean folders -await Deno.remove(ACTOR_BRIDGE_TYPES_PATH, { recursive: true }).catch(() => {}); -await Deno.remove(ACTOR_CORE_BRIDGE_TYPES_PATH, { recursive: true }).catch( - () => {}, -); -await Deno.remove(ISOLATE_RUNNER_JS_PATH, { recursive: true }).catch(() => {}); - -// Compile JS bridge -await $`npx -p typescript@5.7.2 tsc -p tsconfig.bridge.json`.cwd( - ACTOR_BRIDGE_PATH, -); - -for await (const entry of walk(ISOLATE_RUNNER_JS_PATH, { - exts: [".js"], - includeDirs: false, -})) { - let content = await Deno.readTextFile(entry.path); - - // Add header to JS bridge - await Deno.writeTextFile( - entry.path, - "// DO NOT MODIFY\n//\n// Generated with scripts/sdk_actor/compile_bridge.ts\n\n" + - content, - ); -} - -// Compile TypeScript types -await $`npx -p typescript@5.7.2 tsc -p tsconfig.types.json`.cwd( - ACTOR_BRIDGE_PATH, -); - -// Copy internal types file, since TypeScript doesn't copy type declarations -await copy( - resolve(ACTOR_BRIDGE_PATH, "src", "bridge", "types"), - resolve(ACTOR_BRIDGE_TYPES_PATH, "types"), -); - -// Format types. Needs to run in ACTOR_SDK_PATH so it has access to the biome config. -await $`npx -p @biomejs/biome@1.9.4 biome check --write sdks/actor/bridge/types/`.cwd( - PROJECT_ROOT, -); - -for await (const entry of walk(ACTOR_BRIDGE_TYPES_PATH, { - exts: [".ts"], - includeDirs: false, -})) { - let content = await Deno.readTextFile(entry.path); - - // Remove `#private` since it causes errors when coercing types with generated .d.ts. - content = content.replace(/#private;/g, ""); - - // Replace imports from `*.js` to `./*.d.ts`. This is required for the types to - // be resolved. - content = content.replace(/["'](\.[^\.]*)\.js["']/g, '"$1.d.ts"'); - - // Replace imports from `ext:*` to `./*.d.ts`. This is required for this - // package to be usable on JSR. - content = content.replace( - /["']ext:rivet_[^\/]+\/([^\.]*)\.js["']/g, - '"./$1.d.ts"', - ); - - await Deno.writeTextFile( - entry.path, - "// DO NOT MODIFY\n//\n// Generated from sdks/actor/bridge/\n\n" + content, - ); -} - -// Copy types to core repo -await copy(ACTOR_BRIDGE_TYPES_PATH, ACTOR_CORE_BRIDGE_TYPES_PATH); diff --git a/sdks/api/fern/generators.yml b/sdks/api/fern/generators.yml index f16e563048..c794b61156 100644 --- a/sdks/api/fern/generators.yml +++ b/sdks/api/fern/generators.yml @@ -4,27 +4,6 @@ api: - openapi: ../../../out/openapi.json default-group: full groups: - runtime: - audiences: - - runtime - generators: - - name: fernapi/fern-typescript-node-sdk - version: 0.49.3 - ir-version: v53 - output: - location: local-file-system - path: ../../typescript/api-runtime/src - config: - outputSourceFiles: true - namespaceExport: Rivet - defaultTimeoutInSeconds: 180 - skipResponseValidation: true - allowCustomFetcher: true - - name: fernapi/fern-go-sdk - version: 0.9.3 - output: - location: local-file-system - path: ../../go/api-runtime full: generators: - name: fernapi/fern-typescript-node-sdk diff --git a/sdks/go/api-runtime/client/client.go b/sdks/go/api-runtime/client/client.go deleted file mode 100644 index 87cfd3ff32..0000000000 --- a/sdks/go/api-runtime/client/client.go +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -package client - -import ( - http "net/http" - core "sdk/core" -) - -type Client struct { - baseURL string - caller *core.Caller - header http.Header -} - -func NewClient(opts ...core.ClientOption) *Client { - options := core.NewClientOptions() - for _, opt := range opts { - opt(options) - } - return &Client{ - baseURL: options.BaseURL, - caller: core.NewCaller(options.HTTPClient), - header: options.ToHeader(), - } -} diff --git a/sdks/go/api-runtime/client/client_test.go b/sdks/go/api-runtime/client/client_test.go deleted file mode 100644 index a0fa36e4c7..0000000000 --- a/sdks/go/api-runtime/client/client_test.go +++ /dev/null @@ -1,43 +0,0 @@ -package client - -import ( - "net/http" - "testing" - "time" - - "github.com/stretchr/testify/assert" -) - -func TestNewClient(t *testing.T) { - t.Run("default", func(t *testing.T) { - c := NewClient() - assert.Empty(t, c.baseURL) - }) - - t.Run("base url", func(t *testing.T) { - c := NewClient( - WithBaseURL("test.co"), - ) - assert.Equal(t, "test.co", c.baseURL) - }) - - t.Run("http client", func(t *testing.T) { - httpClient := &http.Client{ - Timeout: 5 * time.Second, - } - c := NewClient( - WithHTTPClient(httpClient), - ) - assert.Empty(t, c.baseURL) - }) - - t.Run("http header", func(t *testing.T) { - header := make(http.Header) - header.Set("X-API-Tenancy", "test") - c := NewClient( - WithHTTPHeader(header), - ) - assert.Empty(t, c.baseURL) - assert.Equal(t, "test", c.header.Get("X-API-Tenancy")) - }) -} diff --git a/sdks/go/api-runtime/client/options.go b/sdks/go/api-runtime/client/options.go deleted file mode 100644 index 8c1debd9c4..0000000000 --- a/sdks/go/api-runtime/client/options.go +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -package client - -import ( - http "net/http" - core "sdk/core" -) - -// WithBaseURL sets the client's base URL, overriding the -// default environment, if any. -func WithBaseURL(baseURL string) core.ClientOption { - return func(opts *core.ClientOptions) { - opts.BaseURL = baseURL - } -} - -// WithHTTPClient uses the given HTTPClient to issue all HTTP requests. -func WithHTTPClient(httpClient core.HTTPClient) core.ClientOption { - return func(opts *core.ClientOptions) { - opts.HTTPClient = httpClient - } -} - -// WithHTTPHeader adds the given http.Header to all requests -// issued by the client. -func WithHTTPHeader(httpHeader http.Header) core.ClientOption { - return func(opts *core.ClientOptions) { - // Clone the headers so they can't be modified after the option call. - opts.HTTPHeader = httpHeader.Clone() - } -} diff --git a/sdks/go/api-runtime/core/client_option.go b/sdks/go/api-runtime/core/client_option.go deleted file mode 100644 index 493b208072..0000000000 --- a/sdks/go/api-runtime/core/client_option.go +++ /dev/null @@ -1,37 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -package core - -import ( - http "net/http" -) - -// ClientOption adapts the behavior of the generated client. -type ClientOption func(*ClientOptions) - -// ClientOptions defines all of the possible client options. -// This type is primarily used by the generated code and is -// not meant to be used directly; use ClientOption instead. -type ClientOptions struct { - BaseURL string - HTTPClient HTTPClient - HTTPHeader http.Header -} - -// NewClientOptions returns a new *ClientOptions value. -// This function is primarily used by the generated code and is -// not meant to be used directly; use ClientOption instead. -func NewClientOptions() *ClientOptions { - return &ClientOptions{ - HTTPClient: http.DefaultClient, - HTTPHeader: make(http.Header), - } -} - -// ToHeader maps the configured client options into a http.Header issued -// on every request. -func (c *ClientOptions) ToHeader() http.Header { return c.cloneHeader() } - -func (c *ClientOptions) cloneHeader() http.Header { - return c.HTTPHeader.Clone() -} diff --git a/sdks/go/api-runtime/core/core.go b/sdks/go/api-runtime/core/core.go deleted file mode 100644 index 10e757f2b3..0000000000 --- a/sdks/go/api-runtime/core/core.go +++ /dev/null @@ -1,220 +0,0 @@ -package core - -import ( - "bytes" - "context" - "encoding/json" - "errors" - "fmt" - "io" - "mime/multipart" - "net/http" -) - -const ( - // contentType specifies the JSON Content-Type header value. - contentType = "application/json" - contentTypeHeader = "Content-Type" -) - -// HTTPClient is an interface for a subset of the *http.Client. -type HTTPClient interface { - Do(*http.Request) (*http.Response, error) -} - -// WriteMultipartJSON writes the given value as a JSON part. -// This is used to serialize non-primitive multipart properties -// (i.e. lists, objects, etc). -func WriteMultipartJSON(writer *multipart.Writer, field string, value interface{}) error { - bytes, err := json.Marshal(value) - if err != nil { - return err - } - return writer.WriteField(field, string(bytes)) -} - -// APIError is a lightweight wrapper around the standard error -// interface that preserves the status code from the RPC, if any. -type APIError struct { - err error - - StatusCode int `json:"-"` -} - -// NewAPIError constructs a new API error. -func NewAPIError(statusCode int, err error) *APIError { - return &APIError{ - err: err, - StatusCode: statusCode, - } -} - -// Unwrap returns the underlying error. This also makes the error compatible -// with errors.As and errors.Is. -func (a *APIError) Unwrap() error { - if a == nil { - return nil - } - return a.err -} - -// Error returns the API error's message. -func (a *APIError) Error() string { - if a == nil || (a.err == nil && a.StatusCode == 0) { - return "" - } - if a.err == nil { - return fmt.Sprintf("%d", a.StatusCode) - } - if a.StatusCode == 0 { - return a.err.Error() - } - return fmt.Sprintf("%d: %s", a.StatusCode, a.err.Error()) -} - -// ErrorDecoder decodes *http.Response errors and returns a -// typed API error (e.g. *APIError). -type ErrorDecoder func(statusCode int, body io.Reader) error - -// Caller calls APIs and deserializes their response, if any. -type Caller struct { - client HTTPClient -} - -// NewCaller returns a new *Caller backed by the given HTTP client. -func NewCaller(client HTTPClient) *Caller { - return &Caller{ - client: client, - } -} - -// CallParams represents the parameters used to issue an API call. -type CallParams struct { - URL string - Method string - Headers http.Header - Request interface{} - Response interface{} - ResponseIsOptional bool - ErrorDecoder ErrorDecoder -} - -// Call issues an API call according to the given call parameters. -func (c *Caller) Call(ctx context.Context, params *CallParams) error { - req, err := newRequest(ctx, params.URL, params.Method, params.Headers, params.Request) - if err != nil { - return err - } - - // If the call has been cancelled, don't issue the request. - if err := ctx.Err(); err != nil { - return err - } - - resp, err := c.client.Do(req) - if err != nil { - return err - } - - // Close the response body after we're done. - defer resp.Body.Close() - - // Check if the call was cancelled before we return the error - // associated with the call and/or unmarshal the response data. - if err := ctx.Err(); err != nil { - return err - } - - if resp.StatusCode < 200 || resp.StatusCode >= 300 { - return decodeError(resp, params.ErrorDecoder) - } - - // Mutate the response parameter in-place. - if params.Response != nil { - if writer, ok := params.Response.(io.Writer); ok { - _, err = io.Copy(writer, resp.Body) - } else { - err = json.NewDecoder(resp.Body).Decode(params.Response) - } - if err != nil { - if err == io.EOF { - if params.ResponseIsOptional { - // The response is optional, so we should ignore the - // io.EOF error - return nil - } - return fmt.Errorf("expected a %T response, but the server responded with nothing", params.Response) - } - return err - } - } - - return nil -} - -// newRequest returns a new *http.Request with all of the fields -// required to issue the call. -func newRequest( - ctx context.Context, - url string, - method string, - endpointHeaders http.Header, - request interface{}, -) (*http.Request, error) { - requestBody, err := newRequestBody(request) - if err != nil { - return nil, err - } - req, err := http.NewRequestWithContext(ctx, method, url, requestBody) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - req.Header.Set(contentTypeHeader, contentType) - for name, values := range endpointHeaders { - req.Header[name] = values - } - return req, nil -} - -// newRequestBody returns a new io.Reader that represents the HTTP request body. -func newRequestBody(request interface{}) (io.Reader, error) { - var requestBody io.Reader - if request != nil { - if body, ok := request.(io.Reader); ok { - requestBody = body - } else { - requestBytes, err := json.Marshal(request) - if err != nil { - return nil, err - } - requestBody = bytes.NewReader(requestBytes) - } - } - return requestBody, nil -} - -// decodeError decodes the error from the given HTTP response. Note that -// it's the caller's responsibility to close the response body. -func decodeError(response *http.Response, errorDecoder ErrorDecoder) error { - if errorDecoder != nil { - // This endpoint has custom errors, so we'll - // attempt to unmarshal the error into a structured - // type based on the status code. - return errorDecoder(response.StatusCode, response.Body) - } - // This endpoint doesn't have any custom error - // types, so we just read the body as-is, and - // put it into a normal error. - bytes, err := io.ReadAll(response.Body) - if err != nil && err != io.EOF { - return err - } - if err == io.EOF { - // The error didn't have a response body, - // so all we can do is return an error - // with the status code. - return NewAPIError(response.StatusCode, nil) - } - return NewAPIError(response.StatusCode, errors.New(string(bytes))) -} diff --git a/sdks/go/api-runtime/core/core_test.go b/sdks/go/api-runtime/core/core_test.go deleted file mode 100644 index 70a59ed62e..0000000000 --- a/sdks/go/api-runtime/core/core_test.go +++ /dev/null @@ -1,219 +0,0 @@ -package core - -import ( - "bytes" - "context" - "encoding/json" - "errors" - "fmt" - "io" - "net/http" - "net/http/httptest" - "strconv" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -// TestCase represents a single test case. -type TestCase struct { - description string - - // Server-side assertions. - giveMethod string - giveResponseIsOptional bool - giveHeader http.Header - giveErrorDecoder ErrorDecoder - giveRequest *Request - - // Client-side assertions. - wantResponse *Response - wantError error -} - -// Request a simple request body. -type Request struct { - Id string `json:"id"` -} - -// Response a simple response body. -type Response struct { - Id string `json:"id"` -} - -// NotFoundError represents a 404. -type NotFoundError struct { - *APIError - - Message string `json:"message"` -} - -func TestCall(t *testing.T) { - tests := []*TestCase{ - { - description: "GET success", - giveMethod: http.MethodGet, - giveHeader: http.Header{ - "X-API-Status": []string{"success"}, - }, - giveRequest: &Request{ - Id: "123", - }, - wantResponse: &Response{ - Id: "123", - }, - }, - { - description: "GET not found", - giveMethod: http.MethodGet, - giveHeader: http.Header{ - "X-API-Status": []string{"fail"}, - }, - giveRequest: &Request{ - Id: strconv.Itoa(http.StatusNotFound), - }, - giveErrorDecoder: newTestErrorDecoder(t), - wantError: &NotFoundError{ - APIError: NewAPIError( - http.StatusNotFound, - errors.New(`{"message":"ID \"404\" not found"}`), - ), - }, - }, - { - description: "POST optional response", - giveMethod: http.MethodPost, - giveHeader: http.Header{ - "X-API-Status": []string{"success"}, - }, - giveRequest: &Request{ - Id: "123", - }, - giveResponseIsOptional: true, - }, - { - description: "POST API error", - giveMethod: http.MethodPost, - giveHeader: http.Header{ - "X-API-Status": []string{"fail"}, - }, - giveRequest: &Request{ - Id: strconv.Itoa(http.StatusInternalServerError), - }, - wantError: NewAPIError( - http.StatusInternalServerError, - errors.New("failed to process request"), - ), - }, - } - for _, test := range tests { - t.Run(test.description, func(t *testing.T) { - var ( - server = newTestServer(t, test) - client = server.Client() - ) - caller := NewCaller(client) - var response *Response - err := caller.Call( - context.Background(), - &CallParams{ - URL: server.URL, - Method: test.giveMethod, - Headers: test.giveHeader, - Request: test.giveRequest, - Response: &response, - ResponseIsOptional: test.giveResponseIsOptional, - ErrorDecoder: test.giveErrorDecoder, - }, - ) - if test.wantError != nil { - assert.EqualError(t, err, test.wantError.Error()) - return - } - require.NoError(t, err) - assert.Equal(t, test.wantResponse, response) - }) - } -} - -// newTestServer returns a new *httptest.Server configured with the -// given test parameters. -func newTestServer(t *testing.T, tc *TestCase) *httptest.Server { - return httptest.NewServer( - http.HandlerFunc( - func(w http.ResponseWriter, r *http.Request) { - assert.Equal(t, tc.giveMethod, r.Method) - assert.Equal(t, contentType, r.Header.Get(contentTypeHeader)) - for header, value := range tc.giveHeader { - assert.Equal(t, value, r.Header.Values(header)) - } - - bytes, err := io.ReadAll(r.Body) - require.NoError(t, err) - - request := new(Request) - require.NoError(t, json.Unmarshal(bytes, request)) - - switch request.Id { - case strconv.Itoa(http.StatusNotFound): - notFoundError := &NotFoundError{ - APIError: &APIError{ - StatusCode: http.StatusNotFound, - }, - Message: fmt.Sprintf("ID %q not found", request.Id), - } - bytes, err = json.Marshal(notFoundError) - require.NoError(t, err) - - w.WriteHeader(http.StatusNotFound) - _, err = w.Write(bytes) - require.NoError(t, err) - return - - case strconv.Itoa(http.StatusInternalServerError): - w.WriteHeader(http.StatusInternalServerError) - _, err = w.Write([]byte("failed to process request")) - require.NoError(t, err) - return - } - - if tc.giveResponseIsOptional { - w.WriteHeader(http.StatusOK) - return - } - - response := &Response{ - Id: request.Id, - } - bytes, err = json.Marshal(response) - require.NoError(t, err) - - _, err = w.Write(bytes) - require.NoError(t, err) - }, - ), - ) -} - -// newTestErrorDecoder returns an error decoder suitable for tests. -func newTestErrorDecoder(t *testing.T) func(int, io.Reader) error { - return func(statusCode int, body io.Reader) error { - raw, err := io.ReadAll(body) - require.NoError(t, err) - - var ( - apiError = NewAPIError(statusCode, errors.New(string(raw))) - decoder = json.NewDecoder(bytes.NewReader(raw)) - ) - switch statusCode { - case 404: - value := new(NotFoundError) - value.APIError = apiError - require.NoError(t, decoder.Decode(value)) - - return value - } - return apiError - } -} diff --git a/sdks/go/api-runtime/core/stringer.go b/sdks/go/api-runtime/core/stringer.go deleted file mode 100644 index 000cf44864..0000000000 --- a/sdks/go/api-runtime/core/stringer.go +++ /dev/null @@ -1,13 +0,0 @@ -package core - -import "encoding/json" - -// StringifyJSON returns a pretty JSON string representation of -// the given value. -func StringifyJSON(value interface{}) (string, error) { - bytes, err := json.MarshalIndent(value, "", " ") - if err != nil { - return "", err - } - return string(bytes), nil -} diff --git a/sdks/go/api-runtime/go.mod b/sdks/go/api-runtime/go.mod deleted file mode 100644 index 1b1ac6e124..0000000000 --- a/sdks/go/api-runtime/go.mod +++ /dev/null @@ -1,8 +0,0 @@ -module sdk - -go 1.13 - -require ( - github.com/stretchr/testify v1.7.0 - gopkg.in/yaml.v3 v3.0.1 // indirect -) diff --git a/sdks/go/api-runtime/go.sum b/sdks/go/api-runtime/go.sum deleted file mode 100644 index fc3dd9e67e..0000000000 --- a/sdks/go/api-runtime/go.sum +++ /dev/null @@ -1,12 +0,0 @@ -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdks/go/api-runtime/pointer.go b/sdks/go/api-runtime/pointer.go deleted file mode 100644 index 82fb917b1f..0000000000 --- a/sdks/go/api-runtime/pointer.go +++ /dev/null @@ -1,103 +0,0 @@ -package api - -import "time" - -// Bool returns a pointer to the given bool value. -func Bool(b bool) *bool { - return &b -} - -// Byte returns a pointer to the given byte value. -func Byte(b byte) *byte { - return &b -} - -// Complex64 returns a pointer to the given complex64 value. -func Complex64(c complex64) *complex64 { - return &c -} - -// Complex128 returns a pointer to the given complex128 value. -func Complex128(c complex128) *complex128 { - return &c -} - -// Float32 returns a pointer to the given float32 value. -func Float32(f float32) *float32 { - return &f -} - -// Float64 returns a pointer to the given float64 value. -func Float64(f float64) *float64 { - return &f -} - -// Int returns a pointer to the given int value. -func Int(i int) *int { - return &i -} - -// Int8 returns a pointer to the given int8 value. -func Int8(i int8) *int8 { - return &i -} - -// Int16 returns a pointer to the given int16 value. -func Int16(i int16) *int16 { - return &i -} - -// Int32 returns a pointer to the given int32 value. -func Int32(i int32) *int32 { - return &i -} - -// Int64 returns a pointer to the given int64 value. -func Int64(i int64) *int64 { - return &i -} - -// Rune returns a pointer to the given rune value. -func Rune(r rune) *rune { - return &r -} - -// String returns a pointer to the given string value. -func String(s string) *string { - return &s -} - -// Uint returns a pointer to the given uint value. -func Uint(u uint) *uint { - return &u -} - -// Uint8 returns a pointer to the given uint8 value. -func Uint8(u uint8) *uint8 { - return &u -} - -// Uint16 returns a pointer to the given uint16 value. -func Uint16(u uint16) *uint16 { - return &u -} - -// Uint32 returns a pointer to the given uint32 value. -func Uint32(u uint32) *uint32 { - return &u -} - -// Uint64 returns a pointer to the given uint64 value. -func Uint64(u uint64) *uint64 { - return &u -} - -// Uintptr returns a pointer to the given uintptr value. -func Uintptr(u uintptr) *uintptr { - return &u -} - -// Time returns a pointer to the given time.Time value. -func Time(t time.Time) *time.Time { - return &t -} diff --git a/sdks/rust/api-runtime/.gitignore b/sdks/rust/api-runtime/.gitignore deleted file mode 100644 index 6aa106405a..0000000000 --- a/sdks/rust/api-runtime/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/target/ -**/*.rs.bk -Cargo.lock diff --git a/sdks/rust/api-runtime/.openapi-generator-ignore b/sdks/rust/api-runtime/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a..0000000000 --- a/sdks/rust/api-runtime/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/sdks/rust/api-runtime/.openapi-generator/FILES b/sdks/rust/api-runtime/.openapi-generator/FILES deleted file mode 100644 index ceaa737a44..0000000000 --- a/sdks/rust/api-runtime/.openapi-generator/FILES +++ /dev/null @@ -1,28 +0,0 @@ -.gitignore -.openapi-generator-ignore -.travis.yml -Cargo.toml -README.md -docs/Actor.md -docs/ActorLifecycle.md -docs/ActorsApi.md -docs/ActorsCreateRequest.md -docs/ActorsCreateResponse.md -docs/Namespace.md -docs/NamespacesCreateRequest.md -docs/NamespacesCreateResponse.md -docs/NsApi.md -git_push.sh -src/apis/actors_api.rs -src/apis/configuration.rs -src/apis/mod.rs -src/apis/ns_api.rs -src/lib.rs -src/models/actor.rs -src/models/actor_lifecycle.rs -src/models/actors_create_request.rs -src/models/actors_create_response.rs -src/models/mod.rs -src/models/namespace.rs -src/models/namespaces_create_request.rs -src/models/namespaces_create_response.rs diff --git a/sdks/rust/api-runtime/.openapi-generator/VERSION b/sdks/rust/api-runtime/.openapi-generator/VERSION deleted file mode 100644 index e465da4315..0000000000 --- a/sdks/rust/api-runtime/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.14.0 diff --git a/sdks/rust/api-runtime/.travis.yml b/sdks/rust/api-runtime/.travis.yml deleted file mode 100644 index 22761ba7ee..0000000000 --- a/sdks/rust/api-runtime/.travis.yml +++ /dev/null @@ -1 +0,0 @@ -language: rust diff --git a/sdks/rust/api-runtime/Cargo.toml b/sdks/rust/api-runtime/Cargo.toml deleted file mode 100644 index b4a34bbd6d..0000000000 --- a/sdks/rust/api-runtime/Cargo.toml +++ /dev/null @@ -1,15 +0,0 @@ -[package] -name = "rivet-api-runtime" -version = "0.0.1" -authors = ["developer@rivet.gg"] -description = "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)" -license = "Apache-2.0" -edition = "2021" - -[dependencies] -serde = { version = "^1.0", features = ["derive"] } -serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] } -serde_json = "^1.0" -serde_repr = "^0.1" -url = "^2.5" -reqwest = { version = "^0.12", default-features = false, features = ["json", "multipart"] } diff --git a/sdks/rust/api-runtime/README.md b/sdks/rust/api-runtime/README.md deleted file mode 100644 index 0982416c38..0000000000 --- a/sdks/rust/api-runtime/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# Rust API client for rivet-api - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - -## Overview - -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. - -- API version: 0.0.1 -- Package version: 0.0.1 -- Generator version: 7.14.0 -- Build package: `org.openapitools.codegen.languages.RustClientCodegen` - -## Installation - -Put the package under your project folder in a directory named `rivet-api` and add the following to `Cargo.toml` under `[dependencies]`: - -``` -rivet-api = { path = "./rivet-api" } -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://localhost* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*ActorsApi* | [**create_actor**](docs/ActorsApi.md#create_actor) | **POST** /actors | -*NsApi* | [**create_namespace**](docs/NsApi.md#create_namespace) | **POST** /namespaces | - - -## Documentation For Models - - - [Actor](docs/Actor.md) - - [ActorLifecycle](docs/ActorLifecycle.md) - - [ActorsCreateRequest](docs/ActorsCreateRequest.md) - - [ActorsCreateResponse](docs/ActorsCreateResponse.md) - - [Namespace](docs/Namespace.md) - - [NamespacesCreateRequest](docs/NamespacesCreateRequest.md) - - [NamespacesCreateResponse](docs/NamespacesCreateResponse.md) - - -To get access to the crate's generated documentation, use: - -``` -cargo doc --open -``` - -## Author - -developer@rivet.gg - diff --git a/sdks/rust/api-runtime/docs/Actor.md b/sdks/rust/api-runtime/docs/Actor.md deleted file mode 100644 index ab4928112d..0000000000 --- a/sdks/rust/api-runtime/docs/Actor.md +++ /dev/null @@ -1,19 +0,0 @@ -# Actor - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**actor_id** | **String** | | -**connectable_ts** | Option<**i64**> | | [optional] -**create_ts** | **i64** | | -**destroy_ts** | Option<**i64**> | | [optional] -**lifecycle** | [**models::ActorLifecycle**](ActorLifecycle.md) | | -**namespace_id** | **String** | | -**runner_name_selector** | **String** | | -**start_ts** | Option<**i64**> | | [optional] -**tags** | **std::collections::HashMap** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/sdks/rust/api-runtime/docs/ActorLifecycle.md b/sdks/rust/api-runtime/docs/ActorLifecycle.md deleted file mode 100644 index ad3b3e4149..0000000000 --- a/sdks/rust/api-runtime/docs/ActorLifecycle.md +++ /dev/null @@ -1,12 +0,0 @@ -# ActorLifecycle - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**durable** | **bool** | | -**kill_timeout_ms** | **i64** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/sdks/rust/api-runtime/docs/ActorsApi.md b/sdks/rust/api-runtime/docs/ActorsApi.md deleted file mode 100644 index 6a71ebd2ce..0000000000 --- a/sdks/rust/api-runtime/docs/ActorsApi.md +++ /dev/null @@ -1,37 +0,0 @@ -# \ActorsApi - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**create_actor**](ActorsApi.md#create_actor) | **POST** /actors | - - - -## create_actor - -> models::ActorsCreateResponse create_actor(actors_create_request) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**actors_create_request** | [**ActorsCreateRequest**](ActorsCreateRequest.md) | | [required] | - -### Return type - -[**models::ActorsCreateResponse**](ActorsCreateResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/sdks/rust/api-runtime/docs/ActorsCreateRequest.md b/sdks/rust/api-runtime/docs/ActorsCreateRequest.md deleted file mode 100644 index b3df4123d9..0000000000 --- a/sdks/rust/api-runtime/docs/ActorsCreateRequest.md +++ /dev/null @@ -1,13 +0,0 @@ -# ActorsCreateRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**durable** | **bool** | | -**namespace** | **String** | | -**runner_name_selector** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/sdks/rust/api-runtime/docs/ActorsCreateResponse.md b/sdks/rust/api-runtime/docs/ActorsCreateResponse.md deleted file mode 100644 index 1c17b58c7f..0000000000 --- a/sdks/rust/api-runtime/docs/ActorsCreateResponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ActorsCreateResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**actor** | [**models::Actor**](Actor.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/sdks/rust/api-runtime/docs/Namespace.md b/sdks/rust/api-runtime/docs/Namespace.md deleted file mode 100644 index e478ef2dbf..0000000000 --- a/sdks/rust/api-runtime/docs/Namespace.md +++ /dev/null @@ -1,14 +0,0 @@ -# Namespace - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**create_ts** | **i64** | | -**display_name** | **String** | | -**name** | **String** | | -**namespace_id** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/sdks/rust/api-runtime/docs/NamespacesCreateRequest.md b/sdks/rust/api-runtime/docs/NamespacesCreateRequest.md deleted file mode 100644 index bb13cba003..0000000000 --- a/sdks/rust/api-runtime/docs/NamespacesCreateRequest.md +++ /dev/null @@ -1,12 +0,0 @@ -# NamespacesCreateRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**display_name** | **String** | | -**name** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/sdks/rust/api-runtime/docs/NamespacesCreateResponse.md b/sdks/rust/api-runtime/docs/NamespacesCreateResponse.md deleted file mode 100644 index fc5cd5b87d..0000000000 --- a/sdks/rust/api-runtime/docs/NamespacesCreateResponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# NamespacesCreateResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**namespace** | [**models::Namespace**](Namespace.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/sdks/rust/api-runtime/docs/NsApi.md b/sdks/rust/api-runtime/docs/NsApi.md deleted file mode 100644 index df2343e69a..0000000000 --- a/sdks/rust/api-runtime/docs/NsApi.md +++ /dev/null @@ -1,37 +0,0 @@ -# \NsApi - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**create_namespace**](NsApi.md#create_namespace) | **POST** /namespaces | - - - -## create_namespace - -> models::NamespacesCreateResponse create_namespace(namespaces_create_request) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**namespaces_create_request** | [**NamespacesCreateRequest**](NamespacesCreateRequest.md) | | [required] | - -### Return type - -[**models::NamespacesCreateResponse**](NamespacesCreateResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/sdks/rust/api-runtime/git_push.sh b/sdks/rust/api-runtime/git_push.sh deleted file mode 100644 index f53a75d4fa..0000000000 --- a/sdks/rust/api-runtime/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/sdks/rust/api-runtime/rust/.gitignore b/sdks/rust/api-runtime/rust/.gitignore deleted file mode 100644 index 6aa106405a..0000000000 --- a/sdks/rust/api-runtime/rust/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/target/ -**/*.rs.bk -Cargo.lock diff --git a/sdks/rust/api-runtime/rust/.openapi-generator-ignore b/sdks/rust/api-runtime/rust/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a..0000000000 --- a/sdks/rust/api-runtime/rust/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/sdks/rust/api-runtime/rust/.openapi-generator/FILES b/sdks/rust/api-runtime/rust/.openapi-generator/FILES deleted file mode 100644 index 3a261a6063..0000000000 --- a/sdks/rust/api-runtime/rust/.openapi-generator/FILES +++ /dev/null @@ -1,84 +0,0 @@ -.gitignore -.openapi-generator-ignore -.travis.yml -Cargo.toml -README.md -docs/Actor.md -docs/ActorName.md -docs/ActorsCreateApi.md -docs/ActorsCreateRequest.md -docs/ActorsCreateResponse.md -docs/ActorsDeleteApi.md -docs/ActorsGetApi.md -docs/ActorsGetByIdApi.md -docs/ActorsGetByIdResponse.md -docs/ActorsGetOrCreateApi.md -docs/ActorsGetOrCreateByIdApi.md -docs/ActorsGetOrCreateByIdRequest.md -docs/ActorsGetOrCreateByIdResponse.md -docs/ActorsGetOrCreateRequest.md -docs/ActorsGetOrCreateResponse.md -docs/ActorsGetResponse.md -docs/ActorsListApi.md -docs/ActorsListNamesApi.md -docs/ActorsListNamesResponse.md -docs/ActorsListResponse.md -docs/CrashPolicy.md -docs/Datacenter.md -docs/DatacentersApi.md -docs/DatacentersListResponse.md -docs/Namespace.md -docs/NamespacesApi.md -docs/NamespacesCreateRequest.md -docs/NamespacesCreateResponse.md -docs/NamespacesGetResponse.md -docs/NamespacesListResponse.md -docs/Pagination.md -docs/Runner.md -docs/RunnersApi.md -docs/RunnersGetResponse.md -docs/RunnersListNamesResponse.md -docs/RunnersListResponse.md -docs/StringHttpAddressHashableMapValue.md -git_push.sh -src/apis/actors_create_api.rs -src/apis/actors_delete_api.rs -src/apis/actors_get_api.rs -src/apis/actors_get_by_id_api.rs -src/apis/actors_get_or_create_api.rs -src/apis/actors_get_or_create_by_id_api.rs -src/apis/actors_list_api.rs -src/apis/actors_list_names_api.rs -src/apis/configuration.rs -src/apis/datacenters_api.rs -src/apis/mod.rs -src/apis/namespaces_api.rs -src/apis/runners_api.rs -src/lib.rs -src/models/actor.rs -src/models/actor_name.rs -src/models/actors_create_request.rs -src/models/actors_create_response.rs -src/models/actors_get_by_id_response.rs -src/models/actors_get_or_create_by_id_request.rs -src/models/actors_get_or_create_by_id_response.rs -src/models/actors_get_or_create_request.rs -src/models/actors_get_or_create_response.rs -src/models/actors_get_response.rs -src/models/actors_list_names_response.rs -src/models/actors_list_response.rs -src/models/crash_policy.rs -src/models/datacenter.rs -src/models/datacenters_list_response.rs -src/models/mod.rs -src/models/namespace.rs -src/models/namespaces_create_request.rs -src/models/namespaces_create_response.rs -src/models/namespaces_get_response.rs -src/models/namespaces_list_response.rs -src/models/pagination.rs -src/models/runner.rs -src/models/runners_get_response.rs -src/models/runners_list_names_response.rs -src/models/runners_list_response.rs -src/models/string_http_address_hashable_map_value.rs diff --git a/sdks/rust/api-runtime/rust/.openapi-generator/VERSION b/sdks/rust/api-runtime/rust/.openapi-generator/VERSION deleted file mode 100644 index e465da4315..0000000000 --- a/sdks/rust/api-runtime/rust/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.14.0 diff --git a/sdks/rust/api-runtime/rust/.travis.yml b/sdks/rust/api-runtime/rust/.travis.yml deleted file mode 100644 index 22761ba7ee..0000000000 --- a/sdks/rust/api-runtime/rust/.travis.yml +++ /dev/null @@ -1 +0,0 @@ -language: rust diff --git a/sdks/rust/api-runtime/rust/Cargo.toml b/sdks/rust/api-runtime/rust/Cargo.toml deleted file mode 100644 index b4a34bbd6d..0000000000 --- a/sdks/rust/api-runtime/rust/Cargo.toml +++ /dev/null @@ -1,15 +0,0 @@ -[package] -name = "rivet-api-runtime" -version = "0.0.1" -authors = ["developer@rivet.gg"] -description = "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)" -license = "Apache-2.0" -edition = "2021" - -[dependencies] -serde = { version = "^1.0", features = ["derive"] } -serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] } -serde_json = "^1.0" -serde_repr = "^0.1" -url = "^2.5" -reqwest = { version = "^0.12", default-features = false, features = ["json", "multipart"] } diff --git a/sdks/rust/api-runtime/rust/README.md b/sdks/rust/api-runtime/rust/README.md deleted file mode 100644 index fef348f177..0000000000 --- a/sdks/rust/api-runtime/rust/README.md +++ /dev/null @@ -1,85 +0,0 @@ -# Rust API client for rivet-api-runtime - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - -## Overview - -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. - -- API version: 0.0.1 -- Package version: 0.0.1 -- Generator version: 7.14.0 -- Build package: `org.openapitools.codegen.languages.RustClientCodegen` - -## Installation - -Put the package under your project folder in a directory named `rivet-api-runtime` and add the following to `Cargo.toml` under `[dependencies]`: - -``` -rivet-api-runtime = { path = "./rivet-api-runtime" } -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://localhost* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*ActorsCreateApi* | [**actors_create**](docs/ActorsCreateApi.md#actors_create) | **POST** /actors | ## Datacenter Round Trips -*ActorsDeleteApi* | [**actors_delete**](docs/ActorsDeleteApi.md#actors_delete) | **DELETE** /actors/{actor_id} | ## Datacenter Round Trips -*ActorsGetApi* | [**actors_get**](docs/ActorsGetApi.md#actors_get) | **GET** /actors/{actor_id} | ## Datacenter Round Trips -*ActorsGetByIdApi* | [**actors_get_by_id**](docs/ActorsGetByIdApi.md#actors_get_by_id) | **GET** /actors/by-id | ## Datacenter Round Trips -*ActorsGetOrCreateApi* | [**actors_get_or_create**](docs/ActorsGetOrCreateApi.md#actors_get_or_create) | **PUT** /actors | ## Datacenter Round Trips -*ActorsGetOrCreateByIdApi* | [**actors_get_or_create_by_id**](docs/ActorsGetOrCreateByIdApi.md#actors_get_or_create_by_id) | **PUT** /actors/by-id | ## Datacenter Round Trips -*ActorsListApi* | [**actors_list**](docs/ActorsListApi.md#actors_list) | **GET** /actors | ## Datacenter Round Trips -*ActorsListNamesApi* | [**actors_list_names**](docs/ActorsListNamesApi.md#actors_list_names) | **GET** /actors/names | ## Datacenter Round Trips -*DatacentersApi* | [**datacenters_list**](docs/DatacentersApi.md#datacenters_list) | **GET** /datacenters | -*NamespacesApi* | [**namespaces_create**](docs/NamespacesApi.md#namespaces_create) | **POST** /namespaces | -*NamespacesApi* | [**namespaces_get**](docs/NamespacesApi.md#namespaces_get) | **GET** /namespaces/{namespace_id} | -*NamespacesApi* | [**namespaces_list**](docs/NamespacesApi.md#namespaces_list) | **GET** /namespaces | -*RunnersApi* | [**runners_get**](docs/RunnersApi.md#runners_get) | **GET** /runners/{runner_id} | -*RunnersApi* | [**runners_list**](docs/RunnersApi.md#runners_list) | **GET** /runners | -*RunnersApi* | [**runners_list_names**](docs/RunnersApi.md#runners_list_names) | **GET** /runners/names | ## Datacenter Round Trips - - -## Documentation For Models - - - [Actor](docs/Actor.md) - - [ActorName](docs/ActorName.md) - - [ActorsCreateRequest](docs/ActorsCreateRequest.md) - - [ActorsCreateResponse](docs/ActorsCreateResponse.md) - - [ActorsGetByIdResponse](docs/ActorsGetByIdResponse.md) - - [ActorsGetOrCreateByIdRequest](docs/ActorsGetOrCreateByIdRequest.md) - - [ActorsGetOrCreateByIdResponse](docs/ActorsGetOrCreateByIdResponse.md) - - [ActorsGetOrCreateRequest](docs/ActorsGetOrCreateRequest.md) - - [ActorsGetOrCreateResponse](docs/ActorsGetOrCreateResponse.md) - - [ActorsGetResponse](docs/ActorsGetResponse.md) - - [ActorsListNamesResponse](docs/ActorsListNamesResponse.md) - - [ActorsListResponse](docs/ActorsListResponse.md) - - [CrashPolicy](docs/CrashPolicy.md) - - [Datacenter](docs/Datacenter.md) - - [DatacentersListResponse](docs/DatacentersListResponse.md) - - [Namespace](docs/Namespace.md) - - [NamespacesCreateRequest](docs/NamespacesCreateRequest.md) - - [NamespacesCreateResponse](docs/NamespacesCreateResponse.md) - - [NamespacesGetResponse](docs/NamespacesGetResponse.md) - - [NamespacesListResponse](docs/NamespacesListResponse.md) - - [Pagination](docs/Pagination.md) - - [Runner](docs/Runner.md) - - [RunnersGetResponse](docs/RunnersGetResponse.md) - - [RunnersListNamesResponse](docs/RunnersListNamesResponse.md) - - [RunnersListResponse](docs/RunnersListResponse.md) - - [StringHttpAddressHashableMapValue](docs/StringHttpAddressHashableMapValue.md) - - -To get access to the crate's generated documentation, use: - -``` -cargo doc --open -``` - -## Author - -developer@rivet.gg - diff --git a/sdks/rust/api-runtime/rust/docs/Actor.md b/sdks/rust/api-runtime/rust/docs/Actor.md deleted file mode 100644 index 5637a0c8c3..0000000000 --- a/sdks/rust/api-runtime/rust/docs/Actor.md +++ /dev/null @@ -1,23 +0,0 @@ -# Actor - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**actor_id** | **String** | | -**connectable_ts** | Option<**i64**> | | [optional] -**crash_policy** | [**models::CrashPolicy**](CrashPolicy.md) | | -**create_ts** | **i64** | | -**datacenter** | **String** | | -**destroy_ts** | Option<**i64**> | | [optional] -**key** | Option<**String**> | | [optional] -**name** | **String** | | -**namespace_id** | **String** | | -**pending_allocation_ts** | Option<**i64**> | | [optional] -**runner_name_selector** | **String** | | -**sleep_ts** | Option<**i64**> | | [optional] -**start_ts** | Option<**i64**> | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/sdks/rust/api-runtime/rust/docs/ActorName.md b/sdks/rust/api-runtime/rust/docs/ActorName.md deleted file mode 100644 index 918ef8b0b7..0000000000 --- a/sdks/rust/api-runtime/rust/docs/ActorName.md +++ /dev/null @@ -1,11 +0,0 @@ -# ActorName - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**metadata** | [**serde_json::Value**](.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/sdks/rust/api-runtime/rust/docs/ActorsCreateApi.md b/sdks/rust/api-runtime/rust/docs/ActorsCreateApi.md deleted file mode 100644 index 9199b1d6f8..0000000000 --- a/sdks/rust/api-runtime/rust/docs/ActorsCreateApi.md +++ /dev/null @@ -1,41 +0,0 @@ -# \ActorsCreateApi - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**actors_create**](ActorsCreateApi.md#actors_create) | **POST** /actors | ## Datacenter Round Trips - - - -## actors_create - -> models::ActorsCreateResponse actors_create(namespace, actors_create_request, datacenter) -## Datacenter Round Trips - -**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. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**namespace** | **String** | | [required] | -**actors_create_request** | [**ActorsCreateRequest**](ActorsCreateRequest.md) | | [required] | -**datacenter** | Option<**String**> | | | - -### Return type - -[**models::ActorsCreateResponse**](ActorsCreateResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/sdks/rust/api-runtime/rust/docs/ActorsCreateRequest.md b/sdks/rust/api-runtime/rust/docs/ActorsCreateRequest.md deleted file mode 100644 index 7527ebe37d..0000000000 --- a/sdks/rust/api-runtime/rust/docs/ActorsCreateRequest.md +++ /dev/null @@ -1,15 +0,0 @@ -# ActorsCreateRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**crash_policy** | [**models::CrashPolicy**](CrashPolicy.md) | | -**input** | Option<**String**> | | [optional] -**key** | Option<**String**> | | [optional] -**name** | **String** | | -**runner_name_selector** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/sdks/rust/api-runtime/rust/docs/ActorsCreateResponse.md b/sdks/rust/api-runtime/rust/docs/ActorsCreateResponse.md deleted file mode 100644 index 1c17b58c7f..0000000000 --- a/sdks/rust/api-runtime/rust/docs/ActorsCreateResponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ActorsCreateResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**actor** | [**models::Actor**](Actor.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/sdks/rust/api-runtime/rust/docs/ActorsDeleteApi.md b/sdks/rust/api-runtime/rust/docs/ActorsDeleteApi.md deleted file mode 100644 index 74c17b5cb1..0000000000 --- a/sdks/rust/api-runtime/rust/docs/ActorsDeleteApi.md +++ /dev/null @@ -1,40 +0,0 @@ -# \ActorsDeleteApi - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**actors_delete**](ActorsDeleteApi.md#actors_delete) | **DELETE** /actors/{actor_id} | ## Datacenter Round Trips - - - -## actors_delete - -> serde_json::Value actors_delete(actor_id, namespace) -## Datacenter Round Trips - -2 round trip: - DELETE /actors/{} - [api-peer] namespace::ops::resolve_for_name_global - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**actor_id** | **String** | | [required] | -**namespace** | Option<**String**> | | | - -### Return type - -[**serde_json::Value**](serde_json::Value.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/sdks/rust/api-runtime/rust/docs/ActorsGetApi.md b/sdks/rust/api-runtime/rust/docs/ActorsGetApi.md deleted file mode 100644 index 20fd34cd5f..0000000000 --- a/sdks/rust/api-runtime/rust/docs/ActorsGetApi.md +++ /dev/null @@ -1,40 +0,0 @@ -# \ActorsGetApi - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**actors_get**](ActorsGetApi.md#actors_get) | **GET** /actors/{actor_id} | ## Datacenter Round Trips - - - -## actors_get - -> models::ActorsGetResponse actors_get(actor_id, namespace) -## Datacenter Round Trips - -2 round trip: - GET /actors/{} - [api-peer] namespace::ops::resolve_for_name_global - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**actor_id** | **String** | | [required] | -**namespace** | Option<**String**> | | | - -### Return type - -[**models::ActorsGetResponse**](ActorsGetResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/sdks/rust/api-runtime/rust/docs/ActorsGetByIdApi.md b/sdks/rust/api-runtime/rust/docs/ActorsGetByIdApi.md deleted file mode 100644 index e634b25e66..0000000000 --- a/sdks/rust/api-runtime/rust/docs/ActorsGetByIdApi.md +++ /dev/null @@ -1,41 +0,0 @@ -# \ActorsGetByIdApi - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**actors_get_by_id**](ActorsGetByIdApi.md#actors_get_by_id) | **GET** /actors/by-id | ## Datacenter Round Trips - - - -## actors_get_by_id - -> models::ActorsGetByIdResponse actors_get_by_id(namespace, name, key) -## Datacenter Round Trips - -1 round trip: - namespace::ops::resolve_for_name_global This does not require another round trip since we use stale consistency for the get_id_for_key. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**namespace** | **String** | | [required] | -**name** | **String** | | [required] | -**key** | **String** | | [required] | - -### Return type - -[**models::ActorsGetByIdResponse**](ActorsGetByIdResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/sdks/rust/api-runtime/rust/docs/ActorsGetByIdResponse.md b/sdks/rust/api-runtime/rust/docs/ActorsGetByIdResponse.md deleted file mode 100644 index e76ebe4617..0000000000 --- a/sdks/rust/api-runtime/rust/docs/ActorsGetByIdResponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ActorsGetByIdResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**actor_id** | Option<**String**> | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/sdks/rust/api-runtime/rust/docs/ActorsGetOrCreateApi.md b/sdks/rust/api-runtime/rust/docs/ActorsGetOrCreateApi.md deleted file mode 100644 index bb4dfa0632..0000000000 --- a/sdks/rust/api-runtime/rust/docs/ActorsGetOrCreateApi.md +++ /dev/null @@ -1,41 +0,0 @@ -# \ActorsGetOrCreateApi - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**actors_get_or_create**](ActorsGetOrCreateApi.md#actors_get_or_create) | **PUT** /actors | ## Datacenter Round Trips - - - -## actors_get_or_create - -> models::ActorsGetOrCreateResponse actors_get_or_create(namespace, actors_get_or_create_request, datacenter) -## Datacenter Round Trips - -**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 For minimal round trips to get or create an actor, use `PUT /actors/by-id`. This doesn't require fetching the actor's state from the other datacenter. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**namespace** | **String** | | [required] | -**actors_get_or_create_request** | [**ActorsGetOrCreateRequest**](ActorsGetOrCreateRequest.md) | | [required] | -**datacenter** | Option<**String**> | | | - -### Return type - -[**models::ActorsGetOrCreateResponse**](ActorsGetOrCreateResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/sdks/rust/api-runtime/rust/docs/ActorsGetOrCreateByIdApi.md b/sdks/rust/api-runtime/rust/docs/ActorsGetOrCreateByIdApi.md deleted file mode 100644 index dc050b7149..0000000000 --- a/sdks/rust/api-runtime/rust/docs/ActorsGetOrCreateByIdApi.md +++ /dev/null @@ -1,41 +0,0 @@ -# \ActorsGetOrCreateByIdApi - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**actors_get_or_create_by_id**](ActorsGetOrCreateByIdApi.md#actors_get_or_create_by_id) | **PUT** /actors/by-id | ## Datacenter Round Trips - - - -## actors_get_or_create_by_id - -> models::ActorsGetOrCreateByIdResponse actors_get_or_create_by_id(namespace, actors_get_or_create_by_id_request, datacenter) -## Datacenter Round Trips - -**If actor exists** 1 round trip: - namespace::ops::resolve_for_name_global **If actor does not exist and is created in the current datacenter:** 2 round trips: - namespace::ops::resolve_for_name_global - [pegboard::workflows::actors::keys::allocate_key] Reserve Epoxy key **If actor does not exist and is created in a different datacenter:** 3 round trips: - namespace::ops::resolve_for_name_global - namespace::ops::get (to get namespace name for remote call) - POST /actors to remote datacenter - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**namespace** | **String** | | [required] | -**actors_get_or_create_by_id_request** | [**ActorsGetOrCreateByIdRequest**](ActorsGetOrCreateByIdRequest.md) | | [required] | -**datacenter** | Option<**String**> | | | - -### Return type - -[**models::ActorsGetOrCreateByIdResponse**](ActorsGetOrCreateByIdResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/sdks/rust/api-runtime/rust/docs/ActorsGetOrCreateByIdRequest.md b/sdks/rust/api-runtime/rust/docs/ActorsGetOrCreateByIdRequest.md deleted file mode 100644 index 9c0250de0b..0000000000 --- a/sdks/rust/api-runtime/rust/docs/ActorsGetOrCreateByIdRequest.md +++ /dev/null @@ -1,15 +0,0 @@ -# ActorsGetOrCreateByIdRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**crash_policy** | [**models::CrashPolicy**](CrashPolicy.md) | | -**input** | Option<**String**> | | [optional] -**key** | **String** | | -**name** | **String** | | -**runner_name_selector** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/sdks/rust/api-runtime/rust/docs/ActorsGetOrCreateByIdResponse.md b/sdks/rust/api-runtime/rust/docs/ActorsGetOrCreateByIdResponse.md deleted file mode 100644 index 3a35c2ccf2..0000000000 --- a/sdks/rust/api-runtime/rust/docs/ActorsGetOrCreateByIdResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# ActorsGetOrCreateByIdResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**actor_id** | **String** | | -**created** | **bool** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/sdks/rust/api-runtime/rust/docs/ActorsGetOrCreateRequest.md b/sdks/rust/api-runtime/rust/docs/ActorsGetOrCreateRequest.md deleted file mode 100644 index 0ab812ac51..0000000000 --- a/sdks/rust/api-runtime/rust/docs/ActorsGetOrCreateRequest.md +++ /dev/null @@ -1,15 +0,0 @@ -# ActorsGetOrCreateRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**crash_policy** | [**models::CrashPolicy**](CrashPolicy.md) | | -**input** | Option<**String**> | | [optional] -**key** | **String** | | -**name** | **String** | | -**runner_name_selector** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/sdks/rust/api-runtime/rust/docs/ActorsGetOrCreateResponse.md b/sdks/rust/api-runtime/rust/docs/ActorsGetOrCreateResponse.md deleted file mode 100644 index 19b83aa109..0000000000 --- a/sdks/rust/api-runtime/rust/docs/ActorsGetOrCreateResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# ActorsGetOrCreateResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**actor** | [**models::Actor**](Actor.md) | | -**created** | **bool** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/sdks/rust/api-runtime/rust/docs/ActorsGetResponse.md b/sdks/rust/api-runtime/rust/docs/ActorsGetResponse.md deleted file mode 100644 index 95f17b3c04..0000000000 --- a/sdks/rust/api-runtime/rust/docs/ActorsGetResponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ActorsGetResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**actor** | [**models::Actor**](Actor.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/sdks/rust/api-runtime/rust/docs/ActorsListApi.md b/sdks/rust/api-runtime/rust/docs/ActorsListApi.md deleted file mode 100644 index adb03a7770..0000000000 --- a/sdks/rust/api-runtime/rust/docs/ActorsListApi.md +++ /dev/null @@ -1,45 +0,0 @@ -# \ActorsListApi - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**actors_list**](ActorsListApi.md#actors_list) | **GET** /actors | ## Datacenter Round Trips - - - -## actors_list - -> models::ActorsListResponse actors_list(namespace, name, key, actor_ids, include_destroyed, limit, cursor) - ## Datacenter Round Trips - - **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 For minimal round trips to check if an actor exists for a key, use `GET /actors/by-id`. This does not require fetching the actor's state, so it returns immediately. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**namespace** | **String** | | [required] | -**name** | Option<**String**> | | | -**key** | Option<**String**> | | | -**actor_ids** | Option<**String**> | | | -**include_destroyed** | Option<**bool**> | | | -**limit** | Option<**i32**> | | | -**cursor** | Option<**String**> | | | - -### Return type - -[**models::ActorsListResponse**](ActorsListResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/sdks/rust/api-runtime/rust/docs/ActorsListNamesApi.md b/sdks/rust/api-runtime/rust/docs/ActorsListNamesApi.md deleted file mode 100644 index beeac0cc9a..0000000000 --- a/sdks/rust/api-runtime/rust/docs/ActorsListNamesApi.md +++ /dev/null @@ -1,41 +0,0 @@ -# \ActorsListNamesApi - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**actors_list_names**](ActorsListNamesApi.md#actors_list_names) | **GET** /actors/names | ## Datacenter Round Trips - - - -## actors_list_names - -> models::ActorsListNamesResponse actors_list_names(namespace, limit, cursor) -## Datacenter Round Trips - -2 round trips: - GET /actors/names (fanout) - [api-peer] namespace::ops::resolve_for_name_global - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**namespace** | **String** | | [required] | -**limit** | Option<**i32**> | | | -**cursor** | Option<**String**> | | | - -### Return type - -[**models::ActorsListNamesResponse**](ActorsListNamesResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/sdks/rust/api-runtime/rust/docs/ActorsListNamesResponse.md b/sdks/rust/api-runtime/rust/docs/ActorsListNamesResponse.md deleted file mode 100644 index bb880988dc..0000000000 --- a/sdks/rust/api-runtime/rust/docs/ActorsListNamesResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# ActorsListNamesResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**names** | [**std::collections::HashMap**](ActorName.md) | | -**pagination** | [**models::Pagination**](Pagination.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/sdks/rust/api-runtime/rust/docs/ActorsListResponse.md b/sdks/rust/api-runtime/rust/docs/ActorsListResponse.md deleted file mode 100644 index 6cab363e82..0000000000 --- a/sdks/rust/api-runtime/rust/docs/ActorsListResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# ActorsListResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**actors** | [**Vec**](Actor.md) | | -**pagination** | [**models::Pagination**](Pagination.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/sdks/rust/api-runtime/rust/docs/CrashPolicy.md b/sdks/rust/api-runtime/rust/docs/CrashPolicy.md deleted file mode 100644 index 275511a57d..0000000000 --- a/sdks/rust/api-runtime/rust/docs/CrashPolicy.md +++ /dev/null @@ -1,14 +0,0 @@ -# CrashPolicy - -## Enum Variants - -| Name | Value | -|---- | -----| -| Restart | restart | -| Sleep | sleep | -| Destroy | destroy | - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/sdks/rust/api-runtime/rust/docs/Datacenter.md b/sdks/rust/api-runtime/rust/docs/Datacenter.md deleted file mode 100644 index a143c1275d..0000000000 --- a/sdks/rust/api-runtime/rust/docs/Datacenter.md +++ /dev/null @@ -1,13 +0,0 @@ -# Datacenter - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**datacenter_label** | **i32** | | -**name** | **String** | | -**url** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/sdks/rust/api-runtime/rust/docs/DatacentersApi.md b/sdks/rust/api-runtime/rust/docs/DatacentersApi.md deleted file mode 100644 index 9538c60cca..0000000000 --- a/sdks/rust/api-runtime/rust/docs/DatacentersApi.md +++ /dev/null @@ -1,34 +0,0 @@ -# \DatacentersApi - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**datacenters_list**](DatacentersApi.md#datacenters_list) | **GET** /datacenters | - - - -## datacenters_list - -> models::DatacentersListResponse datacenters_list() - - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::DatacentersListResponse**](DatacentersListResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/sdks/rust/api-runtime/rust/docs/DatacentersListResponse.md b/sdks/rust/api-runtime/rust/docs/DatacentersListResponse.md deleted file mode 100644 index 55156f8a6f..0000000000 --- a/sdks/rust/api-runtime/rust/docs/DatacentersListResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# DatacentersListResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**datacenters** | [**Vec**](Datacenter.md) | | -**pagination** | [**models::Pagination**](Pagination.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/sdks/rust/api-runtime/rust/docs/Namespace.md b/sdks/rust/api-runtime/rust/docs/Namespace.md deleted file mode 100644 index e478ef2dbf..0000000000 --- a/sdks/rust/api-runtime/rust/docs/Namespace.md +++ /dev/null @@ -1,14 +0,0 @@ -# Namespace - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**create_ts** | **i64** | | -**display_name** | **String** | | -**name** | **String** | | -**namespace_id** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/sdks/rust/api-runtime/rust/docs/NamespacesApi.md b/sdks/rust/api-runtime/rust/docs/NamespacesApi.md deleted file mode 100644 index 1a3e23e4c5..0000000000 --- a/sdks/rust/api-runtime/rust/docs/NamespacesApi.md +++ /dev/null @@ -1,97 +0,0 @@ -# \NamespacesApi - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**namespaces_create**](NamespacesApi.md#namespaces_create) | **POST** /namespaces | -[**namespaces_get**](NamespacesApi.md#namespaces_get) | **GET** /namespaces/{namespace_id} | -[**namespaces_list**](NamespacesApi.md#namespaces_list) | **GET** /namespaces | - - - -## namespaces_create - -> models::NamespacesCreateResponse namespaces_create(namespaces_create_request) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**namespaces_create_request** | [**NamespacesCreateRequest**](NamespacesCreateRequest.md) | | [required] | - -### Return type - -[**models::NamespacesCreateResponse**](NamespacesCreateResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## namespaces_get - -> models::NamespacesGetResponse namespaces_get(namespace_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**namespace_id** | **String** | | [required] | - -### Return type - -[**models::NamespacesGetResponse**](NamespacesGetResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## namespaces_list - -> models::NamespacesListResponse namespaces_list(limit, cursor, name) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**limit** | Option<**i32**> | | | -**cursor** | Option<**String**> | | | -**name** | Option<**String**> | | | - -### Return type - -[**models::NamespacesListResponse**](NamespacesListResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/sdks/rust/api-runtime/rust/docs/NamespacesCreateRequest.md b/sdks/rust/api-runtime/rust/docs/NamespacesCreateRequest.md deleted file mode 100644 index bb13cba003..0000000000 --- a/sdks/rust/api-runtime/rust/docs/NamespacesCreateRequest.md +++ /dev/null @@ -1,12 +0,0 @@ -# NamespacesCreateRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**display_name** | **String** | | -**name** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/sdks/rust/api-runtime/rust/docs/NamespacesCreateResponse.md b/sdks/rust/api-runtime/rust/docs/NamespacesCreateResponse.md deleted file mode 100644 index fc5cd5b87d..0000000000 --- a/sdks/rust/api-runtime/rust/docs/NamespacesCreateResponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# NamespacesCreateResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**namespace** | [**models::Namespace**](Namespace.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/sdks/rust/api-runtime/rust/docs/NamespacesGetResponse.md b/sdks/rust/api-runtime/rust/docs/NamespacesGetResponse.md deleted file mode 100644 index 07940e3f1f..0000000000 --- a/sdks/rust/api-runtime/rust/docs/NamespacesGetResponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# NamespacesGetResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**namespace** | [**models::Namespace**](Namespace.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/sdks/rust/api-runtime/rust/docs/NamespacesListResponse.md b/sdks/rust/api-runtime/rust/docs/NamespacesListResponse.md deleted file mode 100644 index 30acea28a2..0000000000 --- a/sdks/rust/api-runtime/rust/docs/NamespacesListResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# NamespacesListResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**namespaces** | [**Vec**](Namespace.md) | | -**pagination** | [**models::Pagination**](Pagination.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/sdks/rust/api-runtime/rust/docs/Pagination.md b/sdks/rust/api-runtime/rust/docs/Pagination.md deleted file mode 100644 index e92a05a014..0000000000 --- a/sdks/rust/api-runtime/rust/docs/Pagination.md +++ /dev/null @@ -1,11 +0,0 @@ -# Pagination - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**cursor** | Option<**String**> | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/sdks/rust/api-runtime/rust/docs/Runner.md b/sdks/rust/api-runtime/rust/docs/Runner.md deleted file mode 100644 index c5725e6f23..0000000000 --- a/sdks/rust/api-runtime/rust/docs/Runner.md +++ /dev/null @@ -1,28 +0,0 @@ -# Runner - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**addresses_http** | [**std::collections::HashMap**](StringHttpAddressHashableMap_value.md) | | -**addresses_tcp** | [**std::collections::HashMap**](StringHttpAddressHashableMap_value.md) | | -**addresses_udp** | [**std::collections::HashMap**](StringHttpAddressHashableMap_value.md) | | -**create_ts** | **i64** | | -**datacenter** | **String** | | -**drain_ts** | Option<**i64**> | | [optional] -**key** | **String** | | -**last_connected_ts** | Option<**i64**> | | [optional] -**last_ping_ts** | **i64** | | -**last_rtt** | **i32** | | -**metadata** | Option<[**serde_json::Value**](serde_json::Value.md)> | | [optional] -**name** | **String** | | -**namespace_id** | **String** | | -**remaining_slots** | **i32** | | -**runner_id** | **String** | | -**stop_ts** | Option<**i64**> | | [optional] -**total_slots** | **i32** | | -**version** | **i32** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/sdks/rust/api-runtime/rust/docs/RunnersApi.md b/sdks/rust/api-runtime/rust/docs/RunnersApi.md deleted file mode 100644 index 324531fcde..0000000000 --- a/sdks/rust/api-runtime/rust/docs/RunnersApi.md +++ /dev/null @@ -1,104 +0,0 @@ -# \RunnersApi - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**runners_get**](RunnersApi.md#runners_get) | **GET** /runners/{runner_id} | -[**runners_list**](RunnersApi.md#runners_list) | **GET** /runners | -[**runners_list_names**](RunnersApi.md#runners_list_names) | **GET** /runners/names | ## Datacenter Round Trips - - - -## runners_get - -> models::RunnersGetResponse runners_get(runner_id, namespace) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**runner_id** | **String** | | [required] | -**namespace** | Option<**String**> | | | - -### Return type - -[**models::RunnersGetResponse**](RunnersGetResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## runners_list - -> models::RunnersListResponse runners_list(namespace, name, include_stopped, limit, cursor) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**namespace** | **String** | | [required] | -**name** | Option<**String**> | | | -**include_stopped** | Option<**bool**> | | | -**limit** | Option<**i32**> | | | -**cursor** | Option<**String**> | | | - -### Return type - -[**models::RunnersListResponse**](RunnersListResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## runners_list_names - -> models::RunnersListNamesResponse runners_list_names(namespace, limit, cursor) -## Datacenter Round Trips - -2 round trips: - GET /runners/names (fanout) - [api-peer] namespace::ops::resolve_for_name_global - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**namespace** | **String** | | [required] | -**limit** | Option<**i32**> | | | -**cursor** | Option<**String**> | | | - -### Return type - -[**models::RunnersListNamesResponse**](RunnersListNamesResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/sdks/rust/api-runtime/rust/docs/RunnersGetResponse.md b/sdks/rust/api-runtime/rust/docs/RunnersGetResponse.md deleted file mode 100644 index f266995a70..0000000000 --- a/sdks/rust/api-runtime/rust/docs/RunnersGetResponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# RunnersGetResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**runner** | [**models::Runner**](Runner.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/sdks/rust/api-runtime/rust/docs/RunnersListNamesResponse.md b/sdks/rust/api-runtime/rust/docs/RunnersListNamesResponse.md deleted file mode 100644 index 9d45429baa..0000000000 --- a/sdks/rust/api-runtime/rust/docs/RunnersListNamesResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# RunnersListNamesResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**names** | **Vec** | | -**pagination** | [**models::Pagination**](Pagination.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/sdks/rust/api-runtime/rust/docs/RunnersListResponse.md b/sdks/rust/api-runtime/rust/docs/RunnersListResponse.md deleted file mode 100644 index 670e8e93a0..0000000000 --- a/sdks/rust/api-runtime/rust/docs/RunnersListResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# RunnersListResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**pagination** | [**models::Pagination**](Pagination.md) | | -**runners** | [**Vec**](Runner.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/sdks/rust/api-runtime/rust/docs/StringHttpAddressHashableMapValue.md b/sdks/rust/api-runtime/rust/docs/StringHttpAddressHashableMapValue.md deleted file mode 100644 index 42f319c384..0000000000 --- a/sdks/rust/api-runtime/rust/docs/StringHttpAddressHashableMapValue.md +++ /dev/null @@ -1,12 +0,0 @@ -# StringHttpAddressHashableMapValue - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**hostname** | **String** | | -**port** | **i32** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/sdks/rust/api-runtime/rust/git_push.sh b/sdks/rust/api-runtime/rust/git_push.sh deleted file mode 100644 index f53a75d4fa..0000000000 --- a/sdks/rust/api-runtime/rust/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/sdks/rust/api-runtime/rust/src/apis/actors_create_api.rs b/sdks/rust/api-runtime/rust/src/apis/actors_create_api.rs deleted file mode 100644 index 8dea068a56..0000000000 --- a/sdks/rust/api-runtime/rust/src/apis/actors_create_api.rs +++ /dev/null @@ -1,69 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - - -use reqwest; -use serde::{Deserialize, Serialize, de::Error as _}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration, ContentType}; - - -/// struct for typed errors of method [`actors_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ActorsCreateError { - UnknownValue(serde_json::Value), -} - - -/// **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. -pub async fn actors_create(configuration: &configuration::Configuration, namespace: &str, actors_create_request: models::ActorsCreateRequest, datacenter: Option<&str>) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_namespace = namespace; - let p_actors_create_request = actors_create_request; - let p_datacenter = datacenter; - - let uri_str = format!("{}/actors", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); - - req_builder = req_builder.query(&[("namespace", &p_namespace.to_string())]); - if let Some(ref param_value) = p_datacenter { - req_builder = req_builder.query(&[("datacenter", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - req_builder = req_builder.json(&p_actors_create_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ActorsCreateResponse`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ActorsCreateResponse`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { status, content, entity })) - } -} - diff --git a/sdks/rust/api-runtime/rust/src/apis/actors_delete_api.rs b/sdks/rust/api-runtime/rust/src/apis/actors_delete_api.rs deleted file mode 100644 index a209209419..0000000000 --- a/sdks/rust/api-runtime/rust/src/apis/actors_delete_api.rs +++ /dev/null @@ -1,66 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - - -use reqwest; -use serde::{Deserialize, Serialize, de::Error as _}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration, ContentType}; - - -/// struct for typed errors of method [`actors_delete`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ActorsDeleteError { - UnknownValue(serde_json::Value), -} - - -/// 2 round trip: - DELETE /actors/{} - [api-peer] namespace::ops::resolve_for_name_global -pub async fn actors_delete(configuration: &configuration::Configuration, actor_id: &str, namespace: Option<&str>) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_actor_id = actor_id; - let p_namespace = namespace; - - let uri_str = format!("{}/actors/{actor_id}", configuration.base_path, actor_id=crate::apis::urlencode(p_actor_id)); - let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref param_value) = p_namespace { - req_builder = req_builder.query(&[("namespace", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { status, content, entity })) - } -} - diff --git a/sdks/rust/api-runtime/rust/src/apis/actors_get_api.rs b/sdks/rust/api-runtime/rust/src/apis/actors_get_api.rs deleted file mode 100644 index 4bf13ffd5c..0000000000 --- a/sdks/rust/api-runtime/rust/src/apis/actors_get_api.rs +++ /dev/null @@ -1,66 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - - -use reqwest; -use serde::{Deserialize, Serialize, de::Error as _}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration, ContentType}; - - -/// struct for typed errors of method [`actors_get`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ActorsGetError { - UnknownValue(serde_json::Value), -} - - -/// 2 round trip: - GET /actors/{} - [api-peer] namespace::ops::resolve_for_name_global -pub async fn actors_get(configuration: &configuration::Configuration, actor_id: &str, namespace: Option<&str>) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_actor_id = actor_id; - let p_namespace = namespace; - - let uri_str = format!("{}/actors/{actor_id}", configuration.base_path, actor_id=crate::apis::urlencode(p_actor_id)); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_namespace { - req_builder = req_builder.query(&[("namespace", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ActorsGetResponse`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ActorsGetResponse`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { status, content, entity })) - } -} - diff --git a/sdks/rust/api-runtime/rust/src/apis/actors_get_by_id_api.rs b/sdks/rust/api-runtime/rust/src/apis/actors_get_by_id_api.rs deleted file mode 100644 index fcc853cca5..0000000000 --- a/sdks/rust/api-runtime/rust/src/apis/actors_get_by_id_api.rs +++ /dev/null @@ -1,67 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - - -use reqwest; -use serde::{Deserialize, Serialize, de::Error as _}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration, ContentType}; - - -/// struct for typed errors of method [`actors_get_by_id`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ActorsGetByIdError { - UnknownValue(serde_json::Value), -} - - -/// 1 round trip: - namespace::ops::resolve_for_name_global This does not require another round trip since we use stale consistency for the get_id_for_key. -pub async fn actors_get_by_id(configuration: &configuration::Configuration, namespace: &str, name: &str, key: &str) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_namespace = namespace; - let p_name = name; - let p_key = key; - - let uri_str = format!("{}/actors/by-id", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - req_builder = req_builder.query(&[("namespace", &p_namespace.to_string())]); - req_builder = req_builder.query(&[("name", &p_name.to_string())]); - req_builder = req_builder.query(&[("key", &p_key.to_string())]); - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ActorsGetByIdResponse`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ActorsGetByIdResponse`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { status, content, entity })) - } -} - diff --git a/sdks/rust/api-runtime/rust/src/apis/actors_get_or_create_api.rs b/sdks/rust/api-runtime/rust/src/apis/actors_get_or_create_api.rs deleted file mode 100644 index e94ff25c9b..0000000000 --- a/sdks/rust/api-runtime/rust/src/apis/actors_get_or_create_api.rs +++ /dev/null @@ -1,69 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - - -use reqwest; -use serde::{Deserialize, Serialize, de::Error as _}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration, ContentType}; - - -/// struct for typed errors of method [`actors_get_or_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ActorsGetOrCreateError { - UnknownValue(serde_json::Value), -} - - -/// **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 For minimal round trips to get or create an actor, use `PUT /actors/by-id`. This doesn't require fetching the actor's state from the other datacenter. -pub async fn actors_get_or_create(configuration: &configuration::Configuration, namespace: &str, actors_get_or_create_request: models::ActorsGetOrCreateRequest, datacenter: Option<&str>) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_namespace = namespace; - let p_actors_get_or_create_request = actors_get_or_create_request; - let p_datacenter = datacenter; - - let uri_str = format!("{}/actors", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - req_builder = req_builder.query(&[("namespace", &p_namespace.to_string())]); - if let Some(ref param_value) = p_datacenter { - req_builder = req_builder.query(&[("datacenter", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - req_builder = req_builder.json(&p_actors_get_or_create_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ActorsGetOrCreateResponse`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ActorsGetOrCreateResponse`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { status, content, entity })) - } -} - diff --git a/sdks/rust/api-runtime/rust/src/apis/actors_get_or_create_by_id_api.rs b/sdks/rust/api-runtime/rust/src/apis/actors_get_or_create_by_id_api.rs deleted file mode 100644 index 714fe72f28..0000000000 --- a/sdks/rust/api-runtime/rust/src/apis/actors_get_or_create_by_id_api.rs +++ /dev/null @@ -1,69 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - - -use reqwest; -use serde::{Deserialize, Serialize, de::Error as _}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration, ContentType}; - - -/// struct for typed errors of method [`actors_get_or_create_by_id`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ActorsGetOrCreateByIdError { - UnknownValue(serde_json::Value), -} - - -/// **If actor exists** 1 round trip: - namespace::ops::resolve_for_name_global **If actor does not exist and is created in the current datacenter:** 2 round trips: - namespace::ops::resolve_for_name_global - [pegboard::workflows::actors::keys::allocate_key] Reserve Epoxy key **If actor does not exist and is created in a different datacenter:** 3 round trips: - namespace::ops::resolve_for_name_global - namespace::ops::get (to get namespace name for remote call) - POST /actors to remote datacenter -pub async fn actors_get_or_create_by_id(configuration: &configuration::Configuration, namespace: &str, actors_get_or_create_by_id_request: models::ActorsGetOrCreateByIdRequest, datacenter: Option<&str>) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_namespace = namespace; - let p_actors_get_or_create_by_id_request = actors_get_or_create_by_id_request; - let p_datacenter = datacenter; - - let uri_str = format!("{}/actors/by-id", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - req_builder = req_builder.query(&[("namespace", &p_namespace.to_string())]); - if let Some(ref param_value) = p_datacenter { - req_builder = req_builder.query(&[("datacenter", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - req_builder = req_builder.json(&p_actors_get_or_create_by_id_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ActorsGetOrCreateByIdResponse`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ActorsGetOrCreateByIdResponse`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { status, content, entity })) - } -} - diff --git a/sdks/rust/api-runtime/rust/src/apis/actors_list_api.rs b/sdks/rust/api-runtime/rust/src/apis/actors_list_api.rs deleted file mode 100644 index c35f5a41f7..0000000000 --- a/sdks/rust/api-runtime/rust/src/apis/actors_list_api.rs +++ /dev/null @@ -1,87 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - - -use reqwest; -use serde::{Deserialize, Serialize, de::Error as _}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration, ContentType}; - - -/// struct for typed errors of method [`actors_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ActorsListError { - UnknownValue(serde_json::Value), -} - - -/// **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 For minimal round trips to check if an actor exists for a key, use `GET /actors/by-id`. This does not require fetching the actor's state, so it returns immediately. -pub async fn actors_list(configuration: &configuration::Configuration, namespace: &str, name: Option<&str>, key: Option<&str>, actor_ids: Option<&str>, include_destroyed: Option, limit: Option, cursor: Option<&str>) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_namespace = namespace; - let p_name = name; - let p_key = key; - let p_actor_ids = actor_ids; - let p_include_destroyed = include_destroyed; - let p_limit = limit; - let p_cursor = cursor; - - let uri_str = format!("{}/actors", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - req_builder = req_builder.query(&[("namespace", &p_namespace.to_string())]); - if let Some(ref param_value) = p_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_key { - req_builder = req_builder.query(&[("key", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_actor_ids { - req_builder = req_builder.query(&[("actor_ids", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_include_destroyed { - req_builder = req_builder.query(&[("include_destroyed", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_cursor { - req_builder = req_builder.query(&[("cursor", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ActorsListResponse`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ActorsListResponse`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { status, content, entity })) - } -} - diff --git a/sdks/rust/api-runtime/rust/src/apis/actors_list_names_api.rs b/sdks/rust/api-runtime/rust/src/apis/actors_list_names_api.rs deleted file mode 100644 index 2a2bf16ce5..0000000000 --- a/sdks/rust/api-runtime/rust/src/apis/actors_list_names_api.rs +++ /dev/null @@ -1,71 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - - -use reqwest; -use serde::{Deserialize, Serialize, de::Error as _}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration, ContentType}; - - -/// struct for typed errors of method [`actors_list_names`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ActorsListNamesError { - UnknownValue(serde_json::Value), -} - - -/// 2 round trips: - GET /actors/names (fanout) - [api-peer] namespace::ops::resolve_for_name_global -pub async fn actors_list_names(configuration: &configuration::Configuration, namespace: &str, limit: Option, cursor: Option<&str>) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_namespace = namespace; - let p_limit = limit; - let p_cursor = cursor; - - let uri_str = format!("{}/actors/names", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - req_builder = req_builder.query(&[("namespace", &p_namespace.to_string())]); - if let Some(ref param_value) = p_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_cursor { - req_builder = req_builder.query(&[("cursor", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ActorsListNamesResponse`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ActorsListNamesResponse`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { status, content, entity })) - } -} - diff --git a/sdks/rust/api-runtime/rust/src/apis/configuration.rs b/sdks/rust/api-runtime/rust/src/apis/configuration.rs deleted file mode 100644 index 4fd002cb92..0000000000 --- a/sdks/rust/api-runtime/rust/src/apis/configuration.rs +++ /dev/null @@ -1,51 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - - - -#[derive(Debug, Clone)] -pub struct Configuration { - pub base_path: String, - pub user_agent: Option, - pub client: reqwest::Client, - pub basic_auth: Option, - pub oauth_access_token: Option, - pub bearer_access_token: Option, - pub api_key: Option, -} - -pub type BasicAuth = (String, Option); - -#[derive(Debug, Clone)] -pub struct ApiKey { - pub prefix: Option, - pub key: String, -} - - -impl Configuration { - pub fn new() -> Configuration { - Configuration::default() - } -} - -impl Default for Configuration { - fn default() -> Self { - Configuration { - base_path: "http://localhost".to_owned(), - user_agent: Some("OpenAPI-Generator/0.0.1/rust".to_owned()), - client: reqwest::Client::new(), - basic_auth: None, - oauth_access_token: None, - bearer_access_token: None, - api_key: None, - } - } -} diff --git a/sdks/rust/api-runtime/rust/src/apis/datacenters_api.rs b/sdks/rust/api-runtime/rust/src/apis/datacenters_api.rs deleted file mode 100644 index 3bd4536c16..0000000000 --- a/sdks/rust/api-runtime/rust/src/apis/datacenters_api.rs +++ /dev/null @@ -1,59 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - - -use reqwest; -use serde::{Deserialize, Serialize, de::Error as _}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration, ContentType}; - - -/// struct for typed errors of method [`datacenters_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum DatacentersListError { - UnknownValue(serde_json::Value), -} - - -pub async fn datacenters_list(configuration: &configuration::Configuration, ) -> Result> { - - let uri_str = format!("{}/datacenters", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DatacentersListResponse`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::DatacentersListResponse`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { status, content, entity })) - } -} - diff --git a/sdks/rust/api-runtime/rust/src/apis/mod.rs b/sdks/rust/api-runtime/rust/src/apis/mod.rs deleted file mode 100644 index 467e8078bc..0000000000 --- a/sdks/rust/api-runtime/rust/src/apis/mod.rs +++ /dev/null @@ -1,126 +0,0 @@ -use std::error; -use std::fmt; - -#[derive(Debug, Clone)] -pub struct ResponseContent { - pub status: reqwest::StatusCode, - pub content: String, - pub entity: Option, -} - -#[derive(Debug)] -pub enum Error { - Reqwest(reqwest::Error), - Serde(serde_json::Error), - Io(std::io::Error), - ResponseError(ResponseContent), -} - -impl fmt::Display for Error { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let (module, e) = match self { - Error::Reqwest(e) => ("reqwest", e.to_string()), - Error::Serde(e) => ("serde", e.to_string()), - Error::Io(e) => ("IO", e.to_string()), - Error::ResponseError(e) => ("response", format!("status code {}", e.status)), - }; - write!(f, "error in {}: {}", module, e) - } -} - -impl error::Error for Error { - fn source(&self) -> Option<&(dyn error::Error + 'static)> { - Some(match self { - Error::Reqwest(e) => e, - Error::Serde(e) => e, - Error::Io(e) => e, - Error::ResponseError(_) => return None, - }) - } -} - -impl From for Error { - fn from(e: reqwest::Error) -> Self { - Error::Reqwest(e) - } -} - -impl From for Error { - fn from(e: serde_json::Error) -> Self { - Error::Serde(e) - } -} - -impl From for Error { - fn from(e: std::io::Error) -> Self { - Error::Io(e) - } -} - -pub fn urlencode>(s: T) -> String { - ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() -} - -pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { - if let serde_json::Value::Object(object) = value { - let mut params = vec![]; - - for (key, value) in object { - match value { - serde_json::Value::Object(_) => params.append(&mut parse_deep_object( - &format!("{}[{}]", prefix, key), - value, - )), - serde_json::Value::Array(array) => { - for (i, value) in array.iter().enumerate() { - params.append(&mut parse_deep_object( - &format!("{}[{}][{}]", prefix, key, i), - value, - )); - } - }, - serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), - _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), - } - } - - return params; - } - - unimplemented!("Only objects are supported with style=deepObject") -} - -/// Internal use only -/// A content type supported by this client. -#[allow(dead_code)] -enum ContentType { - Json, - Text, - Unsupported(String) -} - -impl From<&str> for ContentType { - fn from(content_type: &str) -> Self { - if content_type.starts_with("application") && content_type.contains("json") { - return Self::Json; - } else if content_type.starts_with("text/plain") { - return Self::Text; - } else { - return Self::Unsupported(content_type.to_string()); - } - } -} - -pub mod actors_create_api; -pub mod actors_delete_api; -pub mod actors_get_api; -pub mod actors_get_by_id_api; -pub mod actors_get_or_create_api; -pub mod actors_get_or_create_by_id_api; -pub mod actors_list_api; -pub mod actors_list_names_api; -pub mod datacenters_api; -pub mod namespaces_api; -pub mod runners_api; - -pub mod configuration; diff --git a/sdks/rust/api-runtime/rust/src/apis/namespaces_api.rs b/sdks/rust/api-runtime/rust/src/apis/namespaces_api.rs deleted file mode 100644 index 0376c7f735..0000000000 --- a/sdks/rust/api-runtime/rust/src/apis/namespaces_api.rs +++ /dev/null @@ -1,159 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - - -use reqwest; -use serde::{Deserialize, Serialize, de::Error as _}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration, ContentType}; - - -/// struct for typed errors of method [`namespaces_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum NamespacesCreateError { - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`namespaces_get`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum NamespacesGetError { - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`namespaces_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum NamespacesListError { - UnknownValue(serde_json::Value), -} - - -pub async fn namespaces_create(configuration: &configuration::Configuration, namespaces_create_request: models::NamespacesCreateRequest) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_namespaces_create_request = namespaces_create_request; - - let uri_str = format!("{}/namespaces", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - req_builder = req_builder.json(&p_namespaces_create_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::NamespacesCreateResponse`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::NamespacesCreateResponse`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { status, content, entity })) - } -} - -pub async fn namespaces_get(configuration: &configuration::Configuration, namespace_id: &str) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_namespace_id = namespace_id; - - let uri_str = format!("{}/namespaces/{namespace_id}", configuration.base_path, namespace_id=crate::apis::urlencode(p_namespace_id)); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::NamespacesGetResponse`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::NamespacesGetResponse`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { status, content, entity })) - } -} - -pub async fn namespaces_list(configuration: &configuration::Configuration, limit: Option, cursor: Option<&str>, name: Option<&str>) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_limit = limit; - let p_cursor = cursor; - let p_name = name; - - let uri_str = format!("{}/namespaces", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_cursor { - req_builder = req_builder.query(&[("cursor", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::NamespacesListResponse`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::NamespacesListResponse`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { status, content, entity })) - } -} - diff --git a/sdks/rust/api-runtime/rust/src/apis/runners_api.rs b/sdks/rust/api-runtime/rust/src/apis/runners_api.rs deleted file mode 100644 index e9b3aa9de7..0000000000 --- a/sdks/rust/api-runtime/rust/src/apis/runners_api.rs +++ /dev/null @@ -1,178 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - - -use reqwest; -use serde::{Deserialize, Serialize, de::Error as _}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration, ContentType}; - - -/// struct for typed errors of method [`runners_get`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RunnersGetError { - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`runners_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RunnersListError { - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`runners_list_names`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RunnersListNamesError { - UnknownValue(serde_json::Value), -} - - -pub async fn runners_get(configuration: &configuration::Configuration, runner_id: &str, namespace: Option<&str>) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_runner_id = runner_id; - let p_namespace = namespace; - - let uri_str = format!("{}/runners/{runner_id}", configuration.base_path, runner_id=crate::apis::urlencode(p_runner_id)); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_namespace { - req_builder = req_builder.query(&[("namespace", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RunnersGetResponse`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RunnersGetResponse`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { status, content, entity })) - } -} - -pub async fn runners_list(configuration: &configuration::Configuration, namespace: &str, name: Option<&str>, include_stopped: Option, limit: Option, cursor: Option<&str>) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_namespace = namespace; - let p_name = name; - let p_include_stopped = include_stopped; - let p_limit = limit; - let p_cursor = cursor; - - let uri_str = format!("{}/runners", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - req_builder = req_builder.query(&[("namespace", &p_namespace.to_string())]); - if let Some(ref param_value) = p_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_include_stopped { - req_builder = req_builder.query(&[("include_stopped", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_cursor { - req_builder = req_builder.query(&[("cursor", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RunnersListResponse`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RunnersListResponse`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { status, content, entity })) - } -} - -/// 2 round trips: - GET /runners/names (fanout) - [api-peer] namespace::ops::resolve_for_name_global -pub async fn runners_list_names(configuration: &configuration::Configuration, namespace: &str, limit: Option, cursor: Option<&str>) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_namespace = namespace; - let p_limit = limit; - let p_cursor = cursor; - - let uri_str = format!("{}/runners/names", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - req_builder = req_builder.query(&[("namespace", &p_namespace.to_string())]); - if let Some(ref param_value) = p_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_cursor { - req_builder = req_builder.query(&[("cursor", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RunnersListNamesResponse`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RunnersListNamesResponse`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { status, content, entity })) - } -} - diff --git a/sdks/rust/api-runtime/rust/src/lib.rs b/sdks/rust/api-runtime/rust/src/lib.rs deleted file mode 100644 index e1520628d7..0000000000 --- a/sdks/rust/api-runtime/rust/src/lib.rs +++ /dev/null @@ -1,11 +0,0 @@ -#![allow(unused_imports)] -#![allow(clippy::too_many_arguments)] - -extern crate serde_repr; -extern crate serde; -extern crate serde_json; -extern crate url; -extern crate reqwest; - -pub mod apis; -pub mod models; diff --git a/sdks/rust/api-runtime/rust/src/models/actor.rs b/sdks/rust/api-runtime/rust/src/models/actor.rs deleted file mode 100644 index 6b3a089701..0000000000 --- a/sdks/rust/api-runtime/rust/src/models/actor.rs +++ /dev/null @@ -1,63 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Actor { - #[serde(rename = "actor_id")] - pub actor_id: String, - #[serde(rename = "connectable_ts", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub connectable_ts: Option>, - #[serde(rename = "crash_policy")] - pub crash_policy: models::CrashPolicy, - #[serde(rename = "create_ts")] - pub create_ts: i64, - #[serde(rename = "datacenter")] - pub datacenter: String, - #[serde(rename = "destroy_ts", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub destroy_ts: Option>, - #[serde(rename = "key", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub key: Option>, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "namespace_id")] - pub namespace_id: String, - #[serde(rename = "pending_allocation_ts", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub pending_allocation_ts: Option>, - #[serde(rename = "runner_name_selector")] - pub runner_name_selector: String, - #[serde(rename = "sleep_ts", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub sleep_ts: Option>, - #[serde(rename = "start_ts", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub start_ts: Option>, -} - -impl Actor { - pub fn new(actor_id: String, crash_policy: models::CrashPolicy, create_ts: i64, datacenter: String, name: String, namespace_id: String, runner_name_selector: String) -> Actor { - Actor { - actor_id, - connectable_ts: None, - crash_policy, - create_ts, - datacenter, - destroy_ts: None, - key: None, - name, - namespace_id, - pending_allocation_ts: None, - runner_name_selector, - sleep_ts: None, - start_ts: None, - } - } -} - diff --git a/sdks/rust/api-runtime/rust/src/models/actor_name.rs b/sdks/rust/api-runtime/rust/src/models/actor_name.rs deleted file mode 100644 index d8daee2070..0000000000 --- a/sdks/rust/api-runtime/rust/src/models/actor_name.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ActorName { - #[serde(rename = "metadata")] - pub metadata: serde_json::Value, -} - -impl ActorName { - pub fn new(metadata: serde_json::Value) -> ActorName { - ActorName { - metadata, - } - } -} - diff --git a/sdks/rust/api-runtime/rust/src/models/actors_create_request.rs b/sdks/rust/api-runtime/rust/src/models/actors_create_request.rs deleted file mode 100644 index e291ca74b7..0000000000 --- a/sdks/rust/api-runtime/rust/src/models/actors_create_request.rs +++ /dev/null @@ -1,39 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ActorsCreateRequest { - #[serde(rename = "crash_policy")] - pub crash_policy: models::CrashPolicy, - #[serde(rename = "input", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub input: Option>, - #[serde(rename = "key", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub key: Option>, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "runner_name_selector")] - pub runner_name_selector: String, -} - -impl ActorsCreateRequest { - pub fn new(crash_policy: models::CrashPolicy, name: String, runner_name_selector: String) -> ActorsCreateRequest { - ActorsCreateRequest { - crash_policy, - input: None, - key: None, - name, - runner_name_selector, - } - } -} - diff --git a/sdks/rust/api-runtime/rust/src/models/actors_create_response.rs b/sdks/rust/api-runtime/rust/src/models/actors_create_response.rs deleted file mode 100644 index c3359047ea..0000000000 --- a/sdks/rust/api-runtime/rust/src/models/actors_create_response.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ActorsCreateResponse { - #[serde(rename = "actor")] - pub actor: Box, -} - -impl ActorsCreateResponse { - pub fn new(actor: models::Actor) -> ActorsCreateResponse { - ActorsCreateResponse { - actor: Box::new(actor), - } - } -} - diff --git a/sdks/rust/api-runtime/rust/src/models/actors_get_by_id_response.rs b/sdks/rust/api-runtime/rust/src/models/actors_get_by_id_response.rs deleted file mode 100644 index 518f5f47d4..0000000000 --- a/sdks/rust/api-runtime/rust/src/models/actors_get_by_id_response.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ActorsGetByIdResponse { - #[serde(rename = "actor_id", skip_serializing_if = "Option::is_none")] - pub actor_id: Option, -} - -impl ActorsGetByIdResponse { - pub fn new() -> ActorsGetByIdResponse { - ActorsGetByIdResponse { - actor_id: None, - } - } -} - diff --git a/sdks/rust/api-runtime/rust/src/models/actors_get_or_create_by_id_request.rs b/sdks/rust/api-runtime/rust/src/models/actors_get_or_create_by_id_request.rs deleted file mode 100644 index 04bd5f537d..0000000000 --- a/sdks/rust/api-runtime/rust/src/models/actors_get_or_create_by_id_request.rs +++ /dev/null @@ -1,39 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ActorsGetOrCreateByIdRequest { - #[serde(rename = "crash_policy")] - pub crash_policy: models::CrashPolicy, - #[serde(rename = "input", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub input: Option>, - #[serde(rename = "key")] - pub key: String, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "runner_name_selector")] - pub runner_name_selector: String, -} - -impl ActorsGetOrCreateByIdRequest { - pub fn new(crash_policy: models::CrashPolicy, key: String, name: String, runner_name_selector: String) -> ActorsGetOrCreateByIdRequest { - ActorsGetOrCreateByIdRequest { - crash_policy, - input: None, - key, - name, - runner_name_selector, - } - } -} - diff --git a/sdks/rust/api-runtime/rust/src/models/actors_get_or_create_by_id_response.rs b/sdks/rust/api-runtime/rust/src/models/actors_get_or_create_by_id_response.rs deleted file mode 100644 index 7e2bbc2817..0000000000 --- a/sdks/rust/api-runtime/rust/src/models/actors_get_or_create_by_id_response.rs +++ /dev/null @@ -1,30 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ActorsGetOrCreateByIdResponse { - #[serde(rename = "actor_id")] - pub actor_id: String, - #[serde(rename = "created")] - pub created: bool, -} - -impl ActorsGetOrCreateByIdResponse { - pub fn new(actor_id: String, created: bool) -> ActorsGetOrCreateByIdResponse { - ActorsGetOrCreateByIdResponse { - actor_id, - created, - } - } -} - diff --git a/sdks/rust/api-runtime/rust/src/models/actors_get_or_create_request.rs b/sdks/rust/api-runtime/rust/src/models/actors_get_or_create_request.rs deleted file mode 100644 index f12a88e704..0000000000 --- a/sdks/rust/api-runtime/rust/src/models/actors_get_or_create_request.rs +++ /dev/null @@ -1,39 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ActorsGetOrCreateRequest { - #[serde(rename = "crash_policy")] - pub crash_policy: models::CrashPolicy, - #[serde(rename = "input", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub input: Option>, - #[serde(rename = "key")] - pub key: String, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "runner_name_selector")] - pub runner_name_selector: String, -} - -impl ActorsGetOrCreateRequest { - pub fn new(crash_policy: models::CrashPolicy, key: String, name: String, runner_name_selector: String) -> ActorsGetOrCreateRequest { - ActorsGetOrCreateRequest { - crash_policy, - input: None, - key, - name, - runner_name_selector, - } - } -} - diff --git a/sdks/rust/api-runtime/rust/src/models/actors_get_or_create_response.rs b/sdks/rust/api-runtime/rust/src/models/actors_get_or_create_response.rs deleted file mode 100644 index 5e72a0c06f..0000000000 --- a/sdks/rust/api-runtime/rust/src/models/actors_get_or_create_response.rs +++ /dev/null @@ -1,30 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ActorsGetOrCreateResponse { - #[serde(rename = "actor")] - pub actor: Box, - #[serde(rename = "created")] - pub created: bool, -} - -impl ActorsGetOrCreateResponse { - pub fn new(actor: models::Actor, created: bool) -> ActorsGetOrCreateResponse { - ActorsGetOrCreateResponse { - actor: Box::new(actor), - created, - } - } -} - diff --git a/sdks/rust/api-runtime/rust/src/models/actors_get_response.rs b/sdks/rust/api-runtime/rust/src/models/actors_get_response.rs deleted file mode 100644 index 853aa614dc..0000000000 --- a/sdks/rust/api-runtime/rust/src/models/actors_get_response.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ActorsGetResponse { - #[serde(rename = "actor")] - pub actor: Box, -} - -impl ActorsGetResponse { - pub fn new(actor: models::Actor) -> ActorsGetResponse { - ActorsGetResponse { - actor: Box::new(actor), - } - } -} - diff --git a/sdks/rust/api-runtime/rust/src/models/actors_list_names_response.rs b/sdks/rust/api-runtime/rust/src/models/actors_list_names_response.rs deleted file mode 100644 index 3dd3570897..0000000000 --- a/sdks/rust/api-runtime/rust/src/models/actors_list_names_response.rs +++ /dev/null @@ -1,30 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ActorsListNamesResponse { - #[serde(rename = "names")] - pub names: std::collections::HashMap, - #[serde(rename = "pagination")] - pub pagination: Box, -} - -impl ActorsListNamesResponse { - pub fn new(names: std::collections::HashMap, pagination: models::Pagination) -> ActorsListNamesResponse { - ActorsListNamesResponse { - names, - pagination: Box::new(pagination), - } - } -} - diff --git a/sdks/rust/api-runtime/rust/src/models/actors_list_response.rs b/sdks/rust/api-runtime/rust/src/models/actors_list_response.rs deleted file mode 100644 index dde96eb22e..0000000000 --- a/sdks/rust/api-runtime/rust/src/models/actors_list_response.rs +++ /dev/null @@ -1,30 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ActorsListResponse { - #[serde(rename = "actors")] - pub actors: Vec, - #[serde(rename = "pagination")] - pub pagination: Box, -} - -impl ActorsListResponse { - pub fn new(actors: Vec, pagination: models::Pagination) -> ActorsListResponse { - ActorsListResponse { - actors, - pagination: Box::new(pagination), - } - } -} - diff --git a/sdks/rust/api-runtime/rust/src/models/crash_policy.rs b/sdks/rust/api-runtime/rust/src/models/crash_policy.rs deleted file mode 100644 index b24aafea04..0000000000 --- a/sdks/rust/api-runtime/rust/src/models/crash_policy.rs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum CrashPolicy { - #[serde(rename = "restart")] - Restart, - #[serde(rename = "sleep")] - Sleep, - #[serde(rename = "destroy")] - Destroy, - -} - -impl std::fmt::Display for CrashPolicy { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Restart => write!(f, "restart"), - Self::Sleep => write!(f, "sleep"), - Self::Destroy => write!(f, "destroy"), - } - } -} - -impl Default for CrashPolicy { - fn default() -> CrashPolicy { - Self::Restart - } -} - diff --git a/sdks/rust/api-runtime/rust/src/models/datacenter.rs b/sdks/rust/api-runtime/rust/src/models/datacenter.rs deleted file mode 100644 index db3deafc15..0000000000 --- a/sdks/rust/api-runtime/rust/src/models/datacenter.rs +++ /dev/null @@ -1,33 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Datacenter { - #[serde(rename = "datacenter_label")] - pub datacenter_label: i32, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "url")] - pub url: String, -} - -impl Datacenter { - pub fn new(datacenter_label: i32, name: String, url: String) -> Datacenter { - Datacenter { - datacenter_label, - name, - url, - } - } -} - diff --git a/sdks/rust/api-runtime/rust/src/models/datacenters_list_response.rs b/sdks/rust/api-runtime/rust/src/models/datacenters_list_response.rs deleted file mode 100644 index b212077ef6..0000000000 --- a/sdks/rust/api-runtime/rust/src/models/datacenters_list_response.rs +++ /dev/null @@ -1,30 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct DatacentersListResponse { - #[serde(rename = "datacenters")] - pub datacenters: Vec, - #[serde(rename = "pagination")] - pub pagination: Box, -} - -impl DatacentersListResponse { - pub fn new(datacenters: Vec, pagination: models::Pagination) -> DatacentersListResponse { - DatacentersListResponse { - datacenters, - pagination: Box::new(pagination), - } - } -} - diff --git a/sdks/rust/api-runtime/rust/src/models/mod.rs b/sdks/rust/api-runtime/rust/src/models/mod.rs deleted file mode 100644 index fdf4c7a831..0000000000 --- a/sdks/rust/api-runtime/rust/src/models/mod.rs +++ /dev/null @@ -1,52 +0,0 @@ -pub mod actor; -pub use self::actor::Actor; -pub mod actor_name; -pub use self::actor_name::ActorName; -pub mod actors_create_request; -pub use self::actors_create_request::ActorsCreateRequest; -pub mod actors_create_response; -pub use self::actors_create_response::ActorsCreateResponse; -pub mod actors_get_by_id_response; -pub use self::actors_get_by_id_response::ActorsGetByIdResponse; -pub mod actors_get_or_create_by_id_request; -pub use self::actors_get_or_create_by_id_request::ActorsGetOrCreateByIdRequest; -pub mod actors_get_or_create_by_id_response; -pub use self::actors_get_or_create_by_id_response::ActorsGetOrCreateByIdResponse; -pub mod actors_get_or_create_request; -pub use self::actors_get_or_create_request::ActorsGetOrCreateRequest; -pub mod actors_get_or_create_response; -pub use self::actors_get_or_create_response::ActorsGetOrCreateResponse; -pub mod actors_get_response; -pub use self::actors_get_response::ActorsGetResponse; -pub mod actors_list_names_response; -pub use self::actors_list_names_response::ActorsListNamesResponse; -pub mod actors_list_response; -pub use self::actors_list_response::ActorsListResponse; -pub mod crash_policy; -pub use self::crash_policy::CrashPolicy; -pub mod datacenter; -pub use self::datacenter::Datacenter; -pub mod datacenters_list_response; -pub use self::datacenters_list_response::DatacentersListResponse; -pub mod namespace; -pub use self::namespace::Namespace; -pub mod namespaces_create_request; -pub use self::namespaces_create_request::NamespacesCreateRequest; -pub mod namespaces_create_response; -pub use self::namespaces_create_response::NamespacesCreateResponse; -pub mod namespaces_get_response; -pub use self::namespaces_get_response::NamespacesGetResponse; -pub mod namespaces_list_response; -pub use self::namespaces_list_response::NamespacesListResponse; -pub mod pagination; -pub use self::pagination::Pagination; -pub mod runner; -pub use self::runner::Runner; -pub mod runners_get_response; -pub use self::runners_get_response::RunnersGetResponse; -pub mod runners_list_names_response; -pub use self::runners_list_names_response::RunnersListNamesResponse; -pub mod runners_list_response; -pub use self::runners_list_response::RunnersListResponse; -pub mod string_http_address_hashable_map_value; -pub use self::string_http_address_hashable_map_value::StringHttpAddressHashableMapValue; diff --git a/sdks/rust/api-runtime/rust/src/models/namespace.rs b/sdks/rust/api-runtime/rust/src/models/namespace.rs deleted file mode 100644 index 4affbed2c1..0000000000 --- a/sdks/rust/api-runtime/rust/src/models/namespace.rs +++ /dev/null @@ -1,36 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Namespace { - #[serde(rename = "create_ts")] - pub create_ts: i64, - #[serde(rename = "display_name")] - pub display_name: String, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "namespace_id")] - pub namespace_id: String, -} - -impl Namespace { - pub fn new(create_ts: i64, display_name: String, name: String, namespace_id: String) -> Namespace { - Namespace { - create_ts, - display_name, - name, - namespace_id, - } - } -} - diff --git a/sdks/rust/api-runtime/rust/src/models/namespaces_create_request.rs b/sdks/rust/api-runtime/rust/src/models/namespaces_create_request.rs deleted file mode 100644 index 82242e656d..0000000000 --- a/sdks/rust/api-runtime/rust/src/models/namespaces_create_request.rs +++ /dev/null @@ -1,30 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct NamespacesCreateRequest { - #[serde(rename = "display_name")] - pub display_name: String, - #[serde(rename = "name")] - pub name: String, -} - -impl NamespacesCreateRequest { - pub fn new(display_name: String, name: String) -> NamespacesCreateRequest { - NamespacesCreateRequest { - display_name, - name, - } - } -} - diff --git a/sdks/rust/api-runtime/rust/src/models/namespaces_create_response.rs b/sdks/rust/api-runtime/rust/src/models/namespaces_create_response.rs deleted file mode 100644 index 33f6615326..0000000000 --- a/sdks/rust/api-runtime/rust/src/models/namespaces_create_response.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct NamespacesCreateResponse { - #[serde(rename = "namespace")] - pub namespace: Box, -} - -impl NamespacesCreateResponse { - pub fn new(namespace: models::Namespace) -> NamespacesCreateResponse { - NamespacesCreateResponse { - namespace: Box::new(namespace), - } - } -} - diff --git a/sdks/rust/api-runtime/rust/src/models/namespaces_get_response.rs b/sdks/rust/api-runtime/rust/src/models/namespaces_get_response.rs deleted file mode 100644 index 1cfba5c678..0000000000 --- a/sdks/rust/api-runtime/rust/src/models/namespaces_get_response.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct NamespacesGetResponse { - #[serde(rename = "namespace")] - pub namespace: Box, -} - -impl NamespacesGetResponse { - pub fn new(namespace: models::Namespace) -> NamespacesGetResponse { - NamespacesGetResponse { - namespace: Box::new(namespace), - } - } -} - diff --git a/sdks/rust/api-runtime/rust/src/models/namespaces_list_response.rs b/sdks/rust/api-runtime/rust/src/models/namespaces_list_response.rs deleted file mode 100644 index beb31b5049..0000000000 --- a/sdks/rust/api-runtime/rust/src/models/namespaces_list_response.rs +++ /dev/null @@ -1,30 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct NamespacesListResponse { - #[serde(rename = "namespaces")] - pub namespaces: Vec, - #[serde(rename = "pagination")] - pub pagination: Box, -} - -impl NamespacesListResponse { - pub fn new(namespaces: Vec, pagination: models::Pagination) -> NamespacesListResponse { - NamespacesListResponse { - namespaces, - pagination: Box::new(pagination), - } - } -} - diff --git a/sdks/rust/api-runtime/rust/src/models/pagination.rs b/sdks/rust/api-runtime/rust/src/models/pagination.rs deleted file mode 100644 index d2bc2dc8aa..0000000000 --- a/sdks/rust/api-runtime/rust/src/models/pagination.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Pagination { - #[serde(rename = "cursor", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub cursor: Option>, -} - -impl Pagination { - pub fn new() -> Pagination { - Pagination { - cursor: None, - } - } -} - diff --git a/sdks/rust/api-runtime/rust/src/models/runner.rs b/sdks/rust/api-runtime/rust/src/models/runner.rs deleted file mode 100644 index 1912363420..0000000000 --- a/sdks/rust/api-runtime/rust/src/models/runner.rs +++ /dev/null @@ -1,78 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Runner { - #[serde(rename = "addresses_http")] - pub addresses_http: std::collections::HashMap, - #[serde(rename = "addresses_tcp")] - pub addresses_tcp: std::collections::HashMap, - #[serde(rename = "addresses_udp")] - pub addresses_udp: std::collections::HashMap, - #[serde(rename = "create_ts")] - pub create_ts: i64, - #[serde(rename = "datacenter")] - pub datacenter: String, - #[serde(rename = "drain_ts", skip_serializing_if = "Option::is_none")] - pub drain_ts: Option, - #[serde(rename = "key")] - pub key: String, - #[serde(rename = "last_connected_ts", skip_serializing_if = "Option::is_none")] - pub last_connected_ts: Option, - #[serde(rename = "last_ping_ts")] - pub last_ping_ts: i64, - #[serde(rename = "last_rtt")] - pub last_rtt: i32, - #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] - pub metadata: Option, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "namespace_id")] - pub namespace_id: String, - #[serde(rename = "remaining_slots")] - pub remaining_slots: i32, - #[serde(rename = "runner_id")] - pub runner_id: String, - #[serde(rename = "stop_ts", skip_serializing_if = "Option::is_none")] - pub stop_ts: Option, - #[serde(rename = "total_slots")] - pub total_slots: i32, - #[serde(rename = "version")] - pub version: i32, -} - -impl Runner { - pub fn new(addresses_http: std::collections::HashMap, addresses_tcp: std::collections::HashMap, addresses_udp: std::collections::HashMap, create_ts: i64, datacenter: String, key: String, last_ping_ts: i64, last_rtt: i32, name: String, namespace_id: String, remaining_slots: i32, runner_id: String, total_slots: i32, version: i32) -> Runner { - Runner { - addresses_http, - addresses_tcp, - addresses_udp, - create_ts, - datacenter, - drain_ts: None, - key, - last_connected_ts: None, - last_ping_ts, - last_rtt, - metadata: None, - name, - namespace_id, - remaining_slots, - runner_id, - stop_ts: None, - total_slots, - version, - } - } -} - diff --git a/sdks/rust/api-runtime/rust/src/models/runners_get_response.rs b/sdks/rust/api-runtime/rust/src/models/runners_get_response.rs deleted file mode 100644 index 71c7480bae..0000000000 --- a/sdks/rust/api-runtime/rust/src/models/runners_get_response.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct RunnersGetResponse { - #[serde(rename = "runner")] - pub runner: models::Runner, -} - -impl RunnersGetResponse { - pub fn new(runner: models::Runner) -> RunnersGetResponse { - RunnersGetResponse { - runner, - } - } -} - diff --git a/sdks/rust/api-runtime/rust/src/models/runners_list_names_response.rs b/sdks/rust/api-runtime/rust/src/models/runners_list_names_response.rs deleted file mode 100644 index 0e214b23e6..0000000000 --- a/sdks/rust/api-runtime/rust/src/models/runners_list_names_response.rs +++ /dev/null @@ -1,30 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct RunnersListNamesResponse { - #[serde(rename = "names")] - pub names: Vec, - #[serde(rename = "pagination")] - pub pagination: Box, -} - -impl RunnersListNamesResponse { - pub fn new(names: Vec, pagination: models::Pagination) -> RunnersListNamesResponse { - RunnersListNamesResponse { - names, - pagination: Box::new(pagination), - } - } -} - diff --git a/sdks/rust/api-runtime/rust/src/models/runners_list_response.rs b/sdks/rust/api-runtime/rust/src/models/runners_list_response.rs deleted file mode 100644 index b350783619..0000000000 --- a/sdks/rust/api-runtime/rust/src/models/runners_list_response.rs +++ /dev/null @@ -1,30 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct RunnersListResponse { - #[serde(rename = "pagination")] - pub pagination: Box, - #[serde(rename = "runners")] - pub runners: Vec, -} - -impl RunnersListResponse { - pub fn new(pagination: models::Pagination, runners: Vec) -> RunnersListResponse { - RunnersListResponse { - pagination: Box::new(pagination), - runners, - } - } -} - diff --git a/sdks/rust/api-runtime/rust/src/models/string_http_address_hashable_map_value.rs b/sdks/rust/api-runtime/rust/src/models/string_http_address_hashable_map_value.rs deleted file mode 100644 index 79458c2b02..0000000000 --- a/sdks/rust/api-runtime/rust/src/models/string_http_address_hashable_map_value.rs +++ /dev/null @@ -1,30 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct StringHttpAddressHashableMapValue { - #[serde(rename = "hostname")] - pub hostname: String, - #[serde(rename = "port")] - pub port: i32, -} - -impl StringHttpAddressHashableMapValue { - pub fn new(hostname: String, port: i32) -> StringHttpAddressHashableMapValue { - StringHttpAddressHashableMapValue { - hostname, - port, - } - } -} - diff --git a/sdks/rust/api-runtime/src/apis/actors_api.rs b/sdks/rust/api-runtime/src/apis/actors_api.rs deleted file mode 100644 index b1906914f9..0000000000 --- a/sdks/rust/api-runtime/src/apis/actors_api.rs +++ /dev/null @@ -1,67 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - -use super::{configuration, ContentType, Error}; -use crate::{apis::ResponseContent, models}; -use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; - -/// struct for typed errors of method [`create_actor`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CreateActorError { - UnknownValue(serde_json::Value), -} - -pub async fn create_actor( - configuration: &configuration::Configuration, - actors_create_request: models::ActorsCreateRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_actors_create_request = actors_create_request; - - let uri_str = format!("{}/actors", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - req_builder = req_builder.json(&p_actors_create_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ActorsCreateResponse`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ActorsCreateResponse`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} diff --git a/sdks/rust/api-runtime/src/apis/configuration.rs b/sdks/rust/api-runtime/src/apis/configuration.rs deleted file mode 100644 index 9fed14e938..0000000000 --- a/sdks/rust/api-runtime/src/apis/configuration.rs +++ /dev/null @@ -1,48 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - -#[derive(Debug, Clone)] -pub struct Configuration { - pub base_path: String, - pub user_agent: Option, - pub client: reqwest::Client, - pub basic_auth: Option, - pub oauth_access_token: Option, - pub bearer_access_token: Option, - pub api_key: Option, -} - -pub type BasicAuth = (String, Option); - -#[derive(Debug, Clone)] -pub struct ApiKey { - pub prefix: Option, - pub key: String, -} - -impl Configuration { - pub fn new() -> Configuration { - Configuration::default() - } -} - -impl Default for Configuration { - fn default() -> Self { - Configuration { - base_path: "http://localhost".to_owned(), - user_agent: Some("OpenAPI-Generator/0.0.1/rust".to_owned()), - client: reqwest::Client::new(), - basic_auth: None, - oauth_access_token: None, - bearer_access_token: None, - api_key: None, - } - } -} diff --git a/sdks/rust/api-runtime/src/apis/mod.rs b/sdks/rust/api-runtime/src/apis/mod.rs deleted file mode 100644 index eeb544555b..0000000000 --- a/sdks/rust/api-runtime/src/apis/mod.rs +++ /dev/null @@ -1,119 +0,0 @@ -use std::error; -use std::fmt; - -#[derive(Debug, Clone)] -pub struct ResponseContent { - pub status: reqwest::StatusCode, - pub content: String, - pub entity: Option, -} - -#[derive(Debug)] -pub enum Error { - Reqwest(reqwest::Error), - Serde(serde_json::Error), - Io(std::io::Error), - ResponseError(ResponseContent), -} - -impl fmt::Display for Error { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let (module, e) = match self { - Error::Reqwest(e) => ("reqwest", e.to_string()), - Error::Serde(e) => ("serde", e.to_string()), - Error::Io(e) => ("IO", e.to_string()), - Error::ResponseError(e) => ("response", format!("status code {}", e.status)), - }; - write!(f, "error in {}: {}", module, e) - } -} - -impl error::Error for Error { - fn source(&self) -> Option<&(dyn error::Error + 'static)> { - Some(match self { - Error::Reqwest(e) => e, - Error::Serde(e) => e, - Error::Io(e) => e, - Error::ResponseError(_) => return None, - }) - } -} - -impl From for Error { - fn from(e: reqwest::Error) -> Self { - Error::Reqwest(e) - } -} - -impl From for Error { - fn from(e: serde_json::Error) -> Self { - Error::Serde(e) - } -} - -impl From for Error { - fn from(e: std::io::Error) -> Self { - Error::Io(e) - } -} - -pub fn urlencode>(s: T) -> String { - ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() -} - -pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { - if let serde_json::Value::Object(object) = value { - let mut params = vec![]; - - for (key, value) in object { - match value { - serde_json::Value::Object(_) => params.append(&mut parse_deep_object( - &format!("{}[{}]", prefix, key), - value, - )), - serde_json::Value::Array(array) => { - for (i, value) in array.iter().enumerate() { - params.append(&mut parse_deep_object( - &format!("{}[{}][{}]", prefix, key, i), - value, - )); - } - } - serde_json::Value::String(s) => { - params.push((format!("{}[{}]", prefix, key), s.clone())) - } - _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), - } - } - - return params; - } - - unimplemented!("Only objects are supported with style=deepObject") -} - -/// Internal use only -/// A content type supported by this client. -#[allow(dead_code)] -enum ContentType { - Json, - Text, - Unsupported(String), -} - -impl From<&str> for ContentType { - fn from(content_type: &str) -> Self { - if content_type.starts_with("application") && content_type.contains("json") { - return Self::Json; - } else if content_type.starts_with("text/plain") { - return Self::Text; - } else { - return Self::Unsupported(content_type.to_string()); - } - } -} - -pub mod actors_api; -pub mod ns_api; - -pub mod configuration; diff --git a/sdks/rust/api-runtime/src/apis/ns_api.rs b/sdks/rust/api-runtime/src/apis/ns_api.rs deleted file mode 100644 index 6232e204fe..0000000000 --- a/sdks/rust/api-runtime/src/apis/ns_api.rs +++ /dev/null @@ -1,67 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - -use super::{configuration, ContentType, Error}; -use crate::{apis::ResponseContent, models}; -use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; - -/// struct for typed errors of method [`create_namespace`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CreateNamespaceError { - UnknownValue(serde_json::Value), -} - -pub async fn create_namespace( - configuration: &configuration::Configuration, - namespaces_create_request: models::NamespacesCreateRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_namespaces_create_request = namespaces_create_request; - - let uri_str = format!("{}/namespaces", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - req_builder = req_builder.json(&p_namespaces_create_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::NamespacesCreateResponse`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::NamespacesCreateResponse`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} diff --git a/sdks/rust/api-runtime/src/lib.rs b/sdks/rust/api-runtime/src/lib.rs deleted file mode 100644 index 9556a0a134..0000000000 --- a/sdks/rust/api-runtime/src/lib.rs +++ /dev/null @@ -1,11 +0,0 @@ -#![allow(unused_imports)] -#![allow(clippy::too_many_arguments)] - -extern crate reqwest; -extern crate serde; -extern crate serde_json; -extern crate serde_repr; -extern crate url; - -pub mod apis; -pub mod models; diff --git a/sdks/rust/api-runtime/src/models/actor.rs b/sdks/rust/api-runtime/src/models/actor.rs deleted file mode 100644 index f616b00c74..0000000000 --- a/sdks/rust/api-runtime/src/models/actor.rs +++ /dev/null @@ -1,72 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Actor { - #[serde(rename = "actor_id")] - pub actor_id: String, - #[serde( - rename = "connectable_ts", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub connectable_ts: Option>, - #[serde(rename = "create_ts")] - pub create_ts: i64, - #[serde( - rename = "destroy_ts", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub destroy_ts: Option>, - #[serde(rename = "lifecycle")] - pub lifecycle: Box, - #[serde(rename = "namespace_id")] - pub namespace_id: String, - #[serde(rename = "runner_name_selector")] - pub runner_name_selector: String, - #[serde( - rename = "start_ts", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub start_ts: Option>, - #[serde(rename = "tags")] - pub tags: std::collections::HashMap, -} - -impl Actor { - pub fn new( - actor_id: String, - create_ts: i64, - lifecycle: models::ActorLifecycle, - namespace_id: String, - runner_name_selector: String, - tags: std::collections::HashMap, - ) -> Actor { - Actor { - actor_id, - connectable_ts: None, - create_ts, - destroy_ts: None, - lifecycle: Box::new(lifecycle), - namespace_id, - runner_name_selector, - start_ts: None, - tags, - } - } -} diff --git a/sdks/rust/api-runtime/src/models/actor_lifecycle.rs b/sdks/rust/api-runtime/src/models/actor_lifecycle.rs deleted file mode 100644 index aacc450a5d..0000000000 --- a/sdks/rust/api-runtime/src/models/actor_lifecycle.rs +++ /dev/null @@ -1,29 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ActorLifecycle { - #[serde(rename = "durable")] - pub durable: bool, - #[serde(rename = "kill_timeout_ms")] - pub kill_timeout_ms: i64, -} - -impl ActorLifecycle { - pub fn new(durable: bool, kill_timeout_ms: i64) -> ActorLifecycle { - ActorLifecycle { - durable, - kill_timeout_ms, - } - } -} diff --git a/sdks/rust/api-runtime/src/models/actors_create_request.rs b/sdks/rust/api-runtime/src/models/actors_create_request.rs deleted file mode 100644 index 72bcd0d279..0000000000 --- a/sdks/rust/api-runtime/src/models/actors_create_request.rs +++ /dev/null @@ -1,36 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ActorsCreateRequest { - #[serde(rename = "durable")] - pub durable: bool, - #[serde(rename = "namespace")] - pub namespace: String, - #[serde(rename = "runner_name_selector")] - pub runner_name_selector: String, -} - -impl ActorsCreateRequest { - pub fn new( - durable: bool, - namespace: String, - runner_name_selector: String, - ) -> ActorsCreateRequest { - ActorsCreateRequest { - durable, - namespace, - runner_name_selector, - } - } -} diff --git a/sdks/rust/api-runtime/src/models/actors_create_response.rs b/sdks/rust/api-runtime/src/models/actors_create_response.rs deleted file mode 100644 index 95de2218a9..0000000000 --- a/sdks/rust/api-runtime/src/models/actors_create_response.rs +++ /dev/null @@ -1,26 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ActorsCreateResponse { - #[serde(rename = "actor")] - pub actor: Box, -} - -impl ActorsCreateResponse { - pub fn new(actor: models::Actor) -> ActorsCreateResponse { - ActorsCreateResponse { - actor: Box::new(actor), - } - } -} diff --git a/sdks/rust/api-runtime/src/models/mod.rs b/sdks/rust/api-runtime/src/models/mod.rs deleted file mode 100644 index 6bf84ec3cb..0000000000 --- a/sdks/rust/api-runtime/src/models/mod.rs +++ /dev/null @@ -1,14 +0,0 @@ -pub mod actor; -pub use self::actor::Actor; -pub mod actor_lifecycle; -pub use self::actor_lifecycle::ActorLifecycle; -pub mod actors_create_request; -pub use self::actors_create_request::ActorsCreateRequest; -pub mod actors_create_response; -pub use self::actors_create_response::ActorsCreateResponse; -pub mod namespace; -pub use self::namespace::Namespace; -pub mod namespaces_create_request; -pub use self::namespaces_create_request::NamespacesCreateRequest; -pub mod namespaces_create_response; -pub use self::namespaces_create_response::NamespacesCreateResponse; diff --git a/sdks/rust/api-runtime/src/models/namespace.rs b/sdks/rust/api-runtime/src/models/namespace.rs deleted file mode 100644 index 540ac5a0f4..0000000000 --- a/sdks/rust/api-runtime/src/models/namespace.rs +++ /dev/null @@ -1,40 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Namespace { - #[serde(rename = "create_ts")] - pub create_ts: i64, - #[serde(rename = "display_name")] - pub display_name: String, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "namespace_id")] - pub namespace_id: String, -} - -impl Namespace { - pub fn new( - create_ts: i64, - display_name: String, - name: String, - namespace_id: String, - ) -> Namespace { - Namespace { - create_ts, - display_name, - name, - namespace_id, - } - } -} diff --git a/sdks/rust/api-runtime/src/models/namespaces_create_request.rs b/sdks/rust/api-runtime/src/models/namespaces_create_request.rs deleted file mode 100644 index d8a88bab18..0000000000 --- a/sdks/rust/api-runtime/src/models/namespaces_create_request.rs +++ /dev/null @@ -1,26 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct NamespacesCreateRequest { - #[serde(rename = "display_name")] - pub display_name: String, - #[serde(rename = "name")] - pub name: String, -} - -impl NamespacesCreateRequest { - pub fn new(display_name: String, name: String) -> NamespacesCreateRequest { - NamespacesCreateRequest { display_name, name } - } -} diff --git a/sdks/rust/api-runtime/src/models/namespaces_create_response.rs b/sdks/rust/api-runtime/src/models/namespaces_create_response.rs deleted file mode 100644 index e6d1272df2..0000000000 --- a/sdks/rust/api-runtime/src/models/namespaces_create_response.rs +++ /dev/null @@ -1,26 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct NamespacesCreateResponse { - #[serde(rename = "namespace")] - pub namespace: Box, -} - -impl NamespacesCreateResponse { - pub fn new(namespace: models::Namespace) -> NamespacesCreateResponse { - NamespacesCreateResponse { - namespace: Box::new(namespace), - } - } -} diff --git a/sdks/typescript/api-runtime/.gitignore b/sdks/typescript/api-runtime/.gitignore deleted file mode 100644 index 63ace0b965..0000000000 --- a/sdks/typescript/api-runtime/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -node_modules -.DS_Store -*.d.ts -/dist/ -/types/ - -# yarn berry -.pnp.* -.yarn/* -!.yarn/patches -!.yarn/plugins -!.yarn/releases -!.yarn/sdks -!.yarn/versions diff --git a/sdks/typescript/api-runtime/.prettierrc.yml b/sdks/typescript/api-runtime/.prettierrc.yml deleted file mode 100644 index 0c06786bf5..0000000000 --- a/sdks/typescript/api-runtime/.prettierrc.yml +++ /dev/null @@ -1,2 +0,0 @@ -tabWidth: 4 -printWidth: 120 diff --git a/sdks/typescript/api-runtime/build.js b/sdks/typescript/api-runtime/build.js deleted file mode 100644 index af4b8a5779..0000000000 --- a/sdks/typescript/api-runtime/build.js +++ /dev/null @@ -1,62 +0,0 @@ -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", - }); -} - -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`, - }); -} - -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'], - }).catch(() => process.exit(1)); -} diff --git a/sdks/typescript/api-runtime/package.json b/sdks/typescript/api-runtime/package.json deleted file mode 100644 index 33bafc8619..0000000000 --- a/sdks/typescript/api-runtime/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "name": "@rivetkit/engine-api-runtime", - "version": "25.5.3", - "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": { - "format": "prettier --write 'src/**/*.ts'", - "compile": "tsc", - "bundle": "node build.js", - "build": "pnpm compile && pnpm bundle", - "prepack": "pnpm run build" - }, - "dependencies": { - "form-data": "^4.0.0", - "js-base64": "^3.7.5", - "node-fetch": "2", - "qs": "^6.11.2", - "readable-stream": "^4.5.2", - "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.18", - "@types/url-join": "4.0.1", - "esbuild": "^0.19.11", - "prettier": "2.7.1", - "typescript": "5.8.2" - } -} diff --git a/sdks/typescript/api-runtime/src/core/json.ts b/sdks/typescript/api-runtime/src/core/json.ts deleted file mode 100644 index c052f3249f..0000000000 --- a/sdks/typescript/api-runtime/src/core/json.ts +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Serialize a value to JSON - * @param value A JavaScript value, usually an object or array, to be converted. - * @param replacer A function that transforms the results. - * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. - * @returns JSON string - */ -export const toJson = ( - value: unknown, - replacer?: (this: unknown, key: string, value: unknown) => unknown, - space?: string | number, -): string => { - return JSON.stringify(value, replacer, space); -}; - -/** - * Parse JSON string to object, array, or other type - * @param text A valid JSON string. - * @param reviver A function that transforms the results. This function is called for each member of the object. If a member contains nested objects, the nested objects are transformed before the parent object is. - * @returns Parsed object, array, or other type - */ -export function fromJson( - text: string, - reviver?: (this: unknown, key: string, value: unknown) => unknown, -): T { - return JSON.parse(text, reviver); -} diff --git a/sdks/typescript/api-runtime/src/errors/RivetError.ts b/sdks/typescript/api-runtime/src/errors/RivetError.ts deleted file mode 100644 index 62a1b7f8a6..0000000000 --- a/sdks/typescript/api-runtime/src/errors/RivetError.ts +++ /dev/null @@ -1,47 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import { toJson } from "../core/json"; - -export class RivetError extends Error { - readonly statusCode?: number; - readonly body?: unknown; - - constructor({ message, statusCode, body }: { message?: string; statusCode?: number; body?: unknown }) { - super(buildMessage({ message, statusCode, body })); - Object.setPrototypeOf(this, RivetError.prototype); - if (statusCode != null) { - this.statusCode = statusCode; - } - - if (body !== undefined) { - this.body = body; - } - } -} - -function buildMessage({ - message, - statusCode, - body, -}: { - message: string | undefined; - statusCode: number | undefined; - body: unknown | undefined; -}): string { - let lines: string[] = []; - if (message != null) { - lines.push(message); - } - - if (statusCode != null) { - lines.push(`Status code: ${statusCode.toString()}`); - } - - if (body != null) { - lines.push(`Body: ${toJson(body, undefined, 2)}`); - } - - return lines.join("\n"); -} diff --git a/sdks/typescript/api-runtime/src/errors/RivetTimeoutError.ts b/sdks/typescript/api-runtime/src/errors/RivetTimeoutError.ts deleted file mode 100644 index 745c300c05..0000000000 --- a/sdks/typescript/api-runtime/src/errors/RivetTimeoutError.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -export class RivetTimeoutError extends Error { - constructor(message: string) { - super(message); - Object.setPrototypeOf(this, RivetTimeoutError.prototype); - } -} diff --git a/sdks/typescript/api-runtime/src/errors/index.ts b/sdks/typescript/api-runtime/src/errors/index.ts deleted file mode 100644 index 486b4fe258..0000000000 --- a/sdks/typescript/api-runtime/src/errors/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { RivetError } from "./RivetError"; -export { RivetTimeoutError } from "./RivetTimeoutError"; diff --git a/sdks/typescript/api-runtime/src/index.ts b/sdks/typescript/api-runtime/src/index.ts deleted file mode 100644 index 4a82af0888..0000000000 --- a/sdks/typescript/api-runtime/src/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { RivetError, RivetTimeoutError } from "./errors"; diff --git a/sdks/typescript/api-runtime/tsconfig.json b/sdks/typescript/api-runtime/tsconfig.json deleted file mode 100644 index 631ecf4af0..0000000000 --- a/sdks/typescript/api-runtime/tsconfig.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "compilerOptions": { - "extendedDiagnostics": true, - "strict": true, - "target": "esnext", - "module": "esnext", - "moduleResolution": "node", - "esModuleInterop": true, - "skipLibCheck": true, - "declaration": true, - "emitDeclarationOnly": true, - "sourceMap": true, - "noUnusedParameters": true, - "outDir": "types", - "rootDir": "src", - "baseUrl": "src", - "paths": { - "@rivetkit/engine-api": [ - "." - ] - } - }, - "include": [ - "src" - ], - "exclude": [] -}