From aa11cfad0674df92d08874b9682f7acf13e72692 Mon Sep 17 00:00:00 2001 From: christineschen Date: Wed, 29 Jul 2026 15:22:29 +0000 Subject: [PATCH 1/3] chore(gen): use BYOK/TTS/STT initialisms in generated symbol names --- .speakeasy/gen.lock | 55 ++++++++++++++++---------------- .speakeasy/gen.yaml | 9 +++++- .speakeasy/workflow.lock | 2 +- docs/sdks/byok/README.mdx | 2 +- docs/sdks/stt/README.mdx | 2 +- docs/sdks/tts/README.mdx | 2 +- jsr.json | 2 +- package.json | 12 +++---- src/lib/config.ts | 4 +-- src/models/generationresponse.ts | 4 +-- src/sdk/byok.ts | 2 +- src/sdk/sdk.ts | 24 +++++++------- src/sdk/stt.ts | 2 +- src/sdk/tts.ts | 2 +- 14 files changed, 65 insertions(+), 59 deletions(-) diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index bd5f7e14c..e36ec7419 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -5,15 +5,15 @@ management: docVersion: 1.0.0 speakeasyVersion: 1.787.0 generationVersion: 2.914.0 - releaseVersion: 1.1.19 - configChecksum: a1148118c2f52ebe1e39a122aca68e48 + releaseVersion: 1.1.20 + configChecksum: b9b354694fe463f9acd9ed184277777b repoURL: https://github.com/OpenRouterTeam/typescript-sdk.git installationURL: https://github.com/OpenRouterTeam/typescript-sdk published: true persistentEdits: - generation_id: 41eeba1f-4e7a-48ca-8f52-07f82bb57eb4 - pristine_commit_hash: 4b133746452c1ad97c5f53fcf10af2b0288651a4 - pristine_tree_hash: 8eaa22d5767d546eb709f43a37d70cfdf227fe4d + generation_id: b213c9e3-0908-4d55-98ea-029577cab00e + pristine_commit_hash: 8394af986da6a736cb4dccabe367ad86fe1f5c20 + pristine_tree_hash: c18f2408d565bd6b3768cb9018947fc3c097b33c features: typescript: acceptHeaders: 2.81.2 @@ -12441,8 +12441,8 @@ trackedFiles: deleted: true docs/sdks/byok/README.mdx: id: 17792f3b180d - last_write_checksum: sha1:d627d2e35a361ca3df9cbbfe41be9c8a681949f3 - pristine_git_object: 391abd249f245455828352da1ce5b1222e29160a + last_write_checksum: sha1:7f172d1ad1099c5b535b60c26b94195684222d71 + pristine_git_object: fb4ad61591cbaea81fa6bcbb50d639754e9b21b5 docs/sdks/chat/README.mdx: id: 1dd859c23fe1 last_write_checksum: sha1:b01aa24bc49b080a9d99ca0f7303d1afd546b6ac @@ -12562,8 +12562,8 @@ trackedFiles: deleted: true docs/sdks/stt/README.mdx: id: 190b0dc9a5d1 - last_write_checksum: sha1:175c0fe0502a5f089be63bf4e7ffcf8921e71e3f - pristine_git_object: 7e0f71c4be95caabd534fd9312927bae48a1f61c + last_write_checksum: sha1:19dbcc6d0c7f3ca5592b344d96fe4e4d97ed542d + pristine_git_object: bfbef06312f4d0909cf9d4c7021a494bbb123178 docs/sdks/tts/README.md: id: 0c425074d09f last_write_checksum: sha1:019ae6737c83daac03ebbe7d56c49b0d3ad11262 @@ -12571,8 +12571,8 @@ trackedFiles: deleted: true docs/sdks/tts/README.mdx: id: cd1132543884 - last_write_checksum: sha1:b72ac6d2d8126b98d911c9ffa74e3940ba2056d8 - pristine_git_object: e769301dccdefc0e9c2fb2fd75a535c8744fdc9e + last_write_checksum: sha1:abf8333950eec06ec15bba13aa907545bad22ed9 + pristine_git_object: 1f3460cf97703fd4da310b18f8dc295179ce1280 docs/sdks/videogeneration/README.md: id: b6dbf7b0729c last_write_checksum: sha1:71205a37afffed445af770082c3f50f6bcbfadfa @@ -12613,12 +12613,12 @@ trackedFiles: pristine_git_object: 410efafd6a7f50d91ccb87131fedbe0c3d47e15a jsr.json: id: 7f6ab7767282 - last_write_checksum: sha1:67693b88100e9fff83f4a3a78cd09d5bdd227e8f - pristine_git_object: 1f130aaf54370fa91cf90a64ded11c6959c11d73 + last_write_checksum: sha1:83dc29101abde8dbbff1d33b3ac734837084f96b + pristine_git_object: d5da6f00df4dedf773c125e17a43a298d2caa22f package.json: id: 7030d0b2f71b - last_write_checksum: sha1:1fb82d02e95d930d982569b9db49c2e9ec099e1c - pristine_git_object: 2f3e4c87d9d45f5611386fe347675e870b79b867 + last_write_checksum: sha1:17384c7e31fa4cf45a0628816ab84406538d655a + pristine_git_object: 1f7f0c021ad54644954f04a5c9ccff4798768939 src/core.ts: id: f431fdbcd144 last_write_checksum: sha1:5aa66b0b6a5964f3eea7f3098c2eb3c0ee9c0131 @@ -12997,8 +12997,8 @@ trackedFiles: pristine_git_object: a187e58707bdb726ca2aff74941efe7493422d4e src/lib/config.ts: id: 320761608fb3 - last_write_checksum: sha1:86d46e5a6de3344ea6805d3a5fc0111364ed2519 - pristine_git_object: 70bd611e790d372d9cce86ada661c98ae4eb40b5 + last_write_checksum: sha1:258b504fe394058fed3752145ff13cba660ff427 + pristine_git_object: 90d756eb8b34926a5f6a7ae9a6a24de59a18ebb9 src/lib/dlv.ts: id: b1988214835a last_write_checksum: sha1:eaac763b22717206a6199104e0403ed17a4e2711 @@ -14063,8 +14063,8 @@ trackedFiles: pristine_git_object: fb1950525224243627836ce1a03eae69c4503027 src/models/generationresponse.ts: id: f9109ae06502 - last_write_checksum: sha1:26557acaa2ea5e4d4c4540fe4e2a68421afa2440 - pristine_git_object: dcbc31fe9604d0d1308508fb64e3f32f1e489614 + last_write_checksum: sha1:0f7b1610b075403c6339e715678912ed9f293a21 + pristine_git_object: dee98b7209bfc2a74b12592a9340839a17dd4af1 src/models/getbyokkeyresponse.ts: id: c83ed9fbd575 last_write_checksum: sha1:8c270135769e92feab86d649563a5c6f63bdad7b @@ -15839,8 +15839,8 @@ trackedFiles: pristine_git_object: 0c5a5f3819ab52c8290dc81ed3bc94944b2cc26c src/sdk/byok.ts: id: 5c1e8a4724b5 - last_write_checksum: sha1:6743e7d84e50919784e98df8f72bc9e35f1d0384 - pristine_git_object: 62ad299445854d90dc51058e8e402f02748ba2cc + last_write_checksum: sha1:28b7b57f5cb6725c8977efe67e332bcbc66ab79d + pristine_git_object: 08df477eee705d425a5f152d2e85b3991523aa98 src/sdk/chat.ts: id: c56babc22a20 last_write_checksum: sha1:b826d379253d830664e86399eb83d857f7ac94bf @@ -15919,16 +15919,16 @@ trackedFiles: pristine_git_object: 7ba7ea89653bce0ac90b00c64d09e4ffb85b931e src/sdk/sdk.ts: id: 784571af2f69 - last_write_checksum: sha1:acdf27edb4cc9fbf1a4d67b412604d375137ec07 - pristine_git_object: 46837f1ccf7a3775ec6af65f6e5abd777c66d12f + last_write_checksum: sha1:691a93bfb5cca53ebc66609599e12d468cf5789e + pristine_git_object: cbf77f1b69ab89d9ad81b2198dadab88e7e8a70e src/sdk/stt.ts: id: fd9e88c22d1f - last_write_checksum: sha1:ffbdcd6d3d0302bd5082212740a792dadb57a453 - pristine_git_object: 88ee60a6fa3eda60ee2fc50e337e26ecf1477c02 + last_write_checksum: sha1:baa74a0310eb8b465dea302495e744e3f3ea1ca5 + pristine_git_object: 7efe904b807115d3c691636b37a98fdf3b079878 src/sdk/tts.ts: id: b3236e8fa217 - last_write_checksum: sha1:0f25963ae294d2beef73b189db10b09ca3ecf4c6 - pristine_git_object: 99ba633f15d7e579cf8509df9c5effdb444014d7 + last_write_checksum: sha1:ebe45b666f4809ceb2406e6fd6f307f9455076b3 + pristine_git_object: 4d885b023e6aac47f225d63bfe3161b919681f88 src/sdk/videogeneration.ts: id: db34eab5bd5b last_write_checksum: sha1:0e8a13f8ca379037c57417f0ebe9a9fe35dc3bea @@ -17615,4 +17615,3 @@ examples: "500": application/json: {"error": {"code": 500, "message": "Internal Server Error"}} examplesVersion: 1.0.2 -releaseNotes: "## Typescript SDK Changes:\n* `openrouter.files.list()`: \n * `request` **Changed**\n * `response` **Changed** (Breaking ⚠️)\n * `error` **Changed**\n* `openrouter.files.upload()`: \n * `request.provider` **Added**\n * `response` **Changed** (Breaking ⚠️)\n * `error` **Changed**\n* `openrouter.files.delete()`: \n * `request.provider` **Added**\n * `response` **Changed** (Breaking ⚠️)\n * `error` **Changed**\n* `openrouter.files.retrieve()`: \n * `request.provider` **Added**\n * `response` **Changed** (Breaking ⚠️)\n * `error` **Changed**\n* `openrouter.files.download()`: \n * `request.provider` **Added**\n * `error` **Changed**\n" diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 2cf286873..a2b545163 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -37,7 +37,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true typescript: - version: 1.1.19 + version: 1.1.20 acceptHeaderEnum: false additionalDependencies: dependencies: @@ -87,6 +87,13 @@ typescript: - pnpm - install constFieldsAlwaysOptional: false + customCasings: + byok: + initialism: true + stt: + initialism: true + tts: + initialism: true defaultErrorName: OpenRouterDefaultError enableCustomCodeRegions: true enableMCPServer: false diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 12d70ea8a..bd32ab58b 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -14,7 +14,7 @@ targets: sourceRevisionDigest: sha256:e9811da9cad82796dd569091a674e086c120d5e2a38d8027fb241bafef3c3d14 sourceBlobDigest: sha256:b407f7fadab579270ac7c454d469649e888368ab60ae7f208cb7607ac9c47fc1 codeSamplesNamespace: open-router-chat-completions-api-typescript-code-samples - codeSamplesRevisionDigest: sha256:0610708949d18dbb7426be83258f64eadc23b4d052753368d4ff270d825c231e + codeSamplesRevisionDigest: sha256:1dcc93c82cf91f8641a780caaafaeef48647dc45c6068fe465e9097344099366 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.787.0 diff --git a/docs/sdks/byok/README.mdx b/docs/sdks/byok/README.mdx index 391abd249..fb4ad6159 100644 --- a/docs/sdks/byok/README.mdx +++ b/docs/sdks/byok/README.mdx @@ -1,5 +1,5 @@ --- -title: "Byok" +title: "BYOK" description: "BYOK endpoints" --- diff --git a/docs/sdks/stt/README.mdx b/docs/sdks/stt/README.mdx index 7e0f71c4b..bfbef0631 100644 --- a/docs/sdks/stt/README.mdx +++ b/docs/sdks/stt/README.mdx @@ -1,5 +1,5 @@ --- -title: "Stt" +title: "STT" description: "Speech-to-text endpoints" --- diff --git a/docs/sdks/tts/README.mdx b/docs/sdks/tts/README.mdx index e769301dc..1f3460cf9 100644 --- a/docs/sdks/tts/README.mdx +++ b/docs/sdks/tts/README.mdx @@ -1,5 +1,5 @@ --- -title: "Tts" +title: "TTS" description: "Text-to-speech endpoints" --- diff --git a/jsr.json b/jsr.json index 1f130aaf5..d5da6f00d 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@openrouter/sdk", - "version": "1.1.19", + "version": "1.1.20", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package.json b/package.json index 3c63c45e6..8bfa9a407 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openrouter/sdk", - "version": "1.1.19", + "version": "1.1.20", "author": "OpenRouter", "description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 400+ language models through a unified API.", "keywords": [ @@ -21,8 +21,8 @@ "license": "Apache-2.0", "packageManager": "pnpm@10.22.0", "publishConfig": { - "access": "public", - "provenance": true + "provenance": true, + "access": "public" }, "type": "module", "main": "./esm/index.js", @@ -74,13 +74,13 @@ "build": "tsc", "prepublishOnly": "npm run build", "compile": "tsc", + "postinstall": "node scripts/check-types.js || true", "prepare": "npm run build", "test": "vitest --run --project unit", + "typecheck": "tsc --noEmit", + "test:e2e": "vitest --run --project e2e", "test:transit": "exit 0", "test:watch": "vitest --watch --project unit", - "postinstall": "node scripts/check-types.js || true", - "test:e2e": "vitest --run --project e2e", - "typecheck": "tsc --noEmit", "typecheck:transit": "exit 0" }, "peerDependencies": {}, diff --git a/src/lib/config.ts b/src/lib/config.ts index 70bd611e7..90d756eb8 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -75,7 +75,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "1.0.0", - sdkVersion: "1.1.19", + sdkVersion: "1.1.20", genVersion: "2.914.0", - userAgent: "speakeasy-sdk/typescript 1.1.19 2.914.0 1.0.0 @openrouter/sdk", + userAgent: "speakeasy-sdk/typescript 1.1.20 2.914.0 1.0.0 @openrouter/sdk", } as const; diff --git a/src/models/generationresponse.ts b/src/models/generationresponse.ts index dcbc31fe9..dee98b720 100644 --- a/src/models/generationresponse.ts +++ b/src/models/generationresponse.ts @@ -22,8 +22,8 @@ export const ApiType = { Completions: "completions", Embeddings: "embeddings", Rerank: "rerank", - Tts: "tts", - Stt: "stt", + TTS: "tts", + STT: "stt", Video: "video", Image: "image", } as const; diff --git a/src/sdk/byok.ts b/src/sdk/byok.ts index 62ad29944..08df477ee 100644 --- a/src/sdk/byok.ts +++ b/src/sdk/byok.ts @@ -14,7 +14,7 @@ import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; import { PageIterator, unwrapResultIterator } from "../types/operations.js"; -export class Byok extends ClientSDK { +export class BYOK extends ClientSDK { /** * List BYOK provider credentials * diff --git a/src/sdk/sdk.ts b/src/sdk/sdk.ts index 46837f1cc..cbf77f1b6 100644 --- a/src/sdk/sdk.ts +++ b/src/sdk/sdk.ts @@ -8,7 +8,7 @@ import { Analytics } from "./analytics.js"; import { APIKeys } from "./apikeys.js"; import { Benchmarks } from "./benchmarks.js"; import { Beta } from "./beta.js"; -import { Byok } from "./byok.js"; +import { BYOK } from "./byok.js"; import { Chat } from "./chat.js"; import { Classifications } from "./classifications.js"; import { Credits } from "./credits.js"; @@ -27,8 +27,8 @@ import { Presets } from "./presets.js"; import { Providers } from "./providers.js"; import { Rerank } from "./rerank.js"; import { Responses } from "./responses.js"; -import { Stt } from "./stt.js"; -import { Tts } from "./tts.js"; +import { STT } from "./stt.js"; +import { TTS } from "./tts.js"; import { VideoGeneration } from "./videogeneration.js"; import { Workspaces } from "./workspaces.js"; // #region imports @@ -55,14 +55,14 @@ export class OpenRouter extends ClientSDK { return (this._beta ??= new Beta(this._options)); } - private _tts?: Tts; - get tts(): Tts { - return (this._tts ??= new Tts(this._options)); + private _tts?: TTS; + get tts(): TTS { + return (this._tts ??= new TTS(this._options)); } - private _stt?: Stt; - get stt(): Stt { - return (this._stt ??= new Stt(this._options)); + private _stt?: STT; + get stt(): STT { + return (this._stt ??= new STT(this._options)); } private _oAuth?: OAuth; @@ -75,9 +75,9 @@ export class OpenRouter extends ClientSDK { return (this._benchmarks ??= new Benchmarks(this._options)); } - private _byok?: Byok; - get byok(): Byok { - return (this._byok ??= new Byok(this._options)); + private _byok?: BYOK; + get byok(): BYOK { + return (this._byok ??= new BYOK(this._options)); } private _chat?: Chat; diff --git a/src/sdk/stt.ts b/src/sdk/stt.ts index 88ee60a6f..7efe904b8 100644 --- a/src/sdk/stt.ts +++ b/src/sdk/stt.ts @@ -10,7 +10,7 @@ import * as models from "../models/index.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; -export class Stt extends ClientSDK { +export class STT extends ClientSDK { /** * Create transcription * diff --git a/src/sdk/tts.ts b/src/sdk/tts.ts index 99ba633f1..4d885b023 100644 --- a/src/sdk/tts.ts +++ b/src/sdk/tts.ts @@ -8,7 +8,7 @@ import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; -export class Tts extends ClientSDK { +export class TTS extends ClientSDK { /** * Create speech * From 1b7e7f18b94c404c2e0c5f659fb1d728f3518758 Mon Sep 17 00:00:00 2001 From: "christine.chen" Date: Wed, 29 Jul 2026 21:57:42 +0000 Subject: [PATCH 2/3] test(e2e): expect embeddings API to reject empty string input --- tests/e2e/embeddings.test.ts | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/tests/e2e/embeddings.test.ts b/tests/e2e/embeddings.test.ts index 7507c96f9..b4ec67943 100644 --- a/tests/e2e/embeddings.test.ts +++ b/tests/e2e/embeddings.test.ts @@ -1,4 +1,5 @@ import { beforeAll, describe, expect, it } from 'vitest'; +import { BadRequestResponseError } from '../../src/models/errors/badrequestresponseerror.js'; import { OpenRouter } from '../../src/sdk/sdk.js'; describe('Embeddings E2E Tests', () => { @@ -116,23 +117,15 @@ describe('Embeddings E2E Tests', () => { } }); - it('should handle empty string input gracefully', async () => { - const response = await client.embeddings.generate({ - requestBody: { - input: '', - model: 'openai/text-embedding-3-small', - }, - }); - - expect(response).toBeDefined(); - - expect(response.data).toBeDefined(); - expect(Array.isArray(response.data)).toBe(true); - - if (response.data.length > 0) { - const embedding = response.data[0]; - expect(embedding?.embedding).toBeDefined(); - } + it('should reject an empty string input', async () => { + await expect( + client.embeddings.generate({ + requestBody: { + input: '', + model: 'openai/text-embedding-3-small', + }, + }), + ).rejects.toThrow(BadRequestResponseError); }); it('should include model information in response', async () => { From 7065ff1d2dd7760103457458c5343a4c48d5cb72 Mon Sep 17 00:00:00 2001 From: "christine.chen" Date: Thu, 30 Jul 2026 19:27:56 +0000 Subject: [PATCH 3/3] chore(release): bump to 1.2.0 for the breaking initialism rename The generator would have published this as a patch (1.1.25) even though the ApiType enum keys rename is source-breaking; pinning the version in gen.yaml makes the minor bump explicit. Regeneration also picks up main's SCIM spec update. --- .speakeasy/gen.lock | 345 +++++++++- .speakeasy/gen.yaml | 2 +- .speakeasy/out.openapi.yaml | 593 ++++++++++++++++++ .speakeasy/workflow.lock | 10 +- docs/models/createscimgroupmappingrequest.mdx | 23 + .../createscimgroupmappingrequestrole.mdx | 19 + .../models/createscimgroupmappingresponse.mdx | 27 + .../models/deletescimgroupmappingresponse.mdx | 19 + docs/models/getscimgroupmappingresponse.mdx | 27 + docs/models/listscimgroupmappingsresponse.mdx | 31 + docs/models/listscimgroupsresponse.mdx | 30 + .../createscimgroupmappingglobals.mdx | 19 + .../createscimgroupmappingrequest.mdx | 26 + .../deletescimgroupmappingglobals.mdx | 19 + .../deletescimgroupmappingrequest.mdx | 24 + .../operations/getscimgroupmappingglobals.mdx | 19 + .../operations/getscimgroupmappingrequest.mdx | 22 + docs/models/operations/keepmembers.mdx | 21 + docs/models/operations/keepmembersenum.mdx | 19 + .../listscimgroupmappingsglobals.mdx | 19 + .../listscimgroupmappingsrequest.mdx | 21 + .../listscimgroupmappingsresponse.mdx | 32 + .../operations/listscimgroupsglobals.mdx | 19 + .../operations/listscimgroupsrequest.mdx | 21 + .../operations/listscimgroupsresponse.mdx | 31 + .../updatescimgroupmappingglobals.mdx | 19 + .../updatescimgroupmappingrequest.mdx | 26 + docs/models/scimgroup.mdx | 29 + docs/models/scimgroupmapping.mdx | 31 + docs/models/scimgroupmappingrole.mdx | 19 + docs/models/updatescimgroupmappingrequest.mdx | 19 + .../updatescimgroupmappingrequestrole.mdx | 19 + .../models/updatescimgroupmappingresponse.mdx | 27 + docs/sdks/scim/README.mdx | 523 +++++++++++++++ jsr.json | 2 +- package.json | 8 +- src/funcs/scimCreate.ts | 217 +++++++ src/funcs/scimDelete.ts | 221 +++++++ src/funcs/scimListGroups.ts | 283 +++++++++ src/funcs/scimListMappings.ts | 285 +++++++++ src/funcs/scimRead.ts | 212 +++++++ src/funcs/scimUpdate.ts | 219 +++++++ src/lib/config.ts | 4 +- src/models/createscimgroupmappingrequest.ts | 61 ++ src/models/createscimgroupmappingresponse.ts | 35 ++ src/models/deletescimgroupmappingresponse.ts | 31 + src/models/getscimgroupmappingresponse.ts | 35 ++ src/models/index.ts | 10 + src/models/listscimgroupmappingsresponse.ts | 42 ++ src/models/listscimgroupsresponse.ts | 39 ++ .../operations/createscimgroupmapping.ts | 88 +++ .../operations/deletescimgroupmapping.ts | 124 ++++ src/models/operations/getscimgroupmapping.ts | 83 +++ src/models/operations/index.ts | 6 + .../operations/listscimgroupmappings.ts | 124 ++++ src/models/operations/listscimgroups.ts | 122 ++++ .../operations/updatescimgroupmapping.ts | 91 +++ src/models/scimgroup.ts | 47 ++ src/models/scimgroupmapping.ts | 66 ++ src/models/updatescimgroupmappingrequest.ts | 49 ++ src/models/updatescimgroupmappingresponse.ts | 35 ++ src/sdk/scim.ts | 124 ++++ src/sdk/sdk.ts | 6 + 63 files changed, 4788 insertions(+), 31 deletions(-) create mode 100644 docs/models/createscimgroupmappingrequest.mdx create mode 100644 docs/models/createscimgroupmappingrequestrole.mdx create mode 100644 docs/models/createscimgroupmappingresponse.mdx create mode 100644 docs/models/deletescimgroupmappingresponse.mdx create mode 100644 docs/models/getscimgroupmappingresponse.mdx create mode 100644 docs/models/listscimgroupmappingsresponse.mdx create mode 100644 docs/models/listscimgroupsresponse.mdx create mode 100644 docs/models/operations/createscimgroupmappingglobals.mdx create mode 100644 docs/models/operations/createscimgroupmappingrequest.mdx create mode 100644 docs/models/operations/deletescimgroupmappingglobals.mdx create mode 100644 docs/models/operations/deletescimgroupmappingrequest.mdx create mode 100644 docs/models/operations/getscimgroupmappingglobals.mdx create mode 100644 docs/models/operations/getscimgroupmappingrequest.mdx create mode 100644 docs/models/operations/keepmembers.mdx create mode 100644 docs/models/operations/keepmembersenum.mdx create mode 100644 docs/models/operations/listscimgroupmappingsglobals.mdx create mode 100644 docs/models/operations/listscimgroupmappingsrequest.mdx create mode 100644 docs/models/operations/listscimgroupmappingsresponse.mdx create mode 100644 docs/models/operations/listscimgroupsglobals.mdx create mode 100644 docs/models/operations/listscimgroupsrequest.mdx create mode 100644 docs/models/operations/listscimgroupsresponse.mdx create mode 100644 docs/models/operations/updatescimgroupmappingglobals.mdx create mode 100644 docs/models/operations/updatescimgroupmappingrequest.mdx create mode 100644 docs/models/scimgroup.mdx create mode 100644 docs/models/scimgroupmapping.mdx create mode 100644 docs/models/scimgroupmappingrole.mdx create mode 100644 docs/models/updatescimgroupmappingrequest.mdx create mode 100644 docs/models/updatescimgroupmappingrequestrole.mdx create mode 100644 docs/models/updatescimgroupmappingresponse.mdx create mode 100644 docs/sdks/scim/README.mdx create mode 100644 src/funcs/scimCreate.ts create mode 100644 src/funcs/scimDelete.ts create mode 100644 src/funcs/scimListGroups.ts create mode 100644 src/funcs/scimListMappings.ts create mode 100644 src/funcs/scimRead.ts create mode 100644 src/funcs/scimUpdate.ts create mode 100644 src/models/createscimgroupmappingrequest.ts create mode 100644 src/models/createscimgroupmappingresponse.ts create mode 100644 src/models/deletescimgroupmappingresponse.ts create mode 100644 src/models/getscimgroupmappingresponse.ts create mode 100644 src/models/listscimgroupmappingsresponse.ts create mode 100644 src/models/listscimgroupsresponse.ts create mode 100644 src/models/operations/createscimgroupmapping.ts create mode 100644 src/models/operations/deletescimgroupmapping.ts create mode 100644 src/models/operations/getscimgroupmapping.ts create mode 100644 src/models/operations/listscimgroupmappings.ts create mode 100644 src/models/operations/listscimgroups.ts create mode 100644 src/models/operations/updatescimgroupmapping.ts create mode 100644 src/models/scimgroup.ts create mode 100644 src/models/scimgroupmapping.ts create mode 100644 src/models/updatescimgroupmappingrequest.ts create mode 100644 src/models/updatescimgroupmappingresponse.ts create mode 100644 src/sdk/scim.ts diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 64ca30756..d2267313f 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,19 @@ lockVersion: "" id: "" management: - docChecksum: 17f4783a608e0bc0eec9f1c80712d56e + docChecksum: 8da87513c2e89c9dc3302470b714edb8 docVersion: 1.0.0 speakeasyVersion: 1.787.0 generationVersion: 2.914.0 - releaseVersion: 1.1.25 - configChecksum: c9ee6a1969c948680bf948777c9d65c4 + releaseVersion: 1.2.0 + configChecksum: 191936e2b667634018a5b2be9cdb2fdb repoURL: https://github.com/OpenRouterTeam/typescript-sdk.git installationURL: https://github.com/OpenRouterTeam/typescript-sdk published: true persistentEdits: - generation_id: ba55bd00-b352-404f-874d-9122c5d3189f - pristine_commit_hash: d0fea4979328f046cd9210857ddf9ef7d6f365f0 - pristine_tree_hash: 3c51e7398e4af63bf97ffcd20f0ec164dfd412ca + generation_id: 4fa0475d-b0bc-497d-95a1-2d7d3e7e6561 + pristine_commit_hash: c7f480d7c840275e833a9f365ac52d2d69eae694 + pristine_tree_hash: 5243c3bfff3de4ba046bb481b9583f90605f2892 features: typescript: acceptHeaders: 2.81.2 @@ -3098,6 +3098,18 @@ trackedFiles: id: b01c4567352d last_write_checksum: sha1:e034a7fe57d74ec8b062b3c88ff3c55d26131b3c pristine_git_object: 5d5ab8aae8325edf75c452ec6c5016e200873ae5 + docs/models/createscimgroupmappingrequest.mdx: + id: 4c4b31da6b91 + last_write_checksum: sha1:25cd70f09c9b9aa484058de4c2e38553da738bf6 + pristine_git_object: 26aacb96b0e1ff4bdcba8aa3cef9ad5f38b70c16 + docs/models/createscimgroupmappingrequestrole.mdx: + id: ef813bda5dd3 + last_write_checksum: sha1:1ec2bfe027745db4a61712d4f6e1049086db14eb + pristine_git_object: 46066c88378f8e8322d564a14190db3e77a43049 + docs/models/createscimgroupmappingresponse.mdx: + id: ce774c659526 + last_write_checksum: sha1:84277df5147f215e3b07d6fc0d9a3bba149b3f7b + pristine_git_object: 5c0465f04d6181e6e847f3733af16120d0b35213 docs/models/createworkspacerequest.md: id: 8e9411a464de last_write_checksum: sha1:e90b29dbe637a8fb0d8be53f0593ffc9787cc1bf @@ -3331,6 +3343,10 @@ trackedFiles: id: 891768bbd4b4 last_write_checksum: sha1:8e6b8e817d83d7c7fc3b2cc2615a37d4bb51b27a pristine_git_object: 788f496e113fb4ddf285b6ff0adefcd077ab3db3 + docs/models/deletescimgroupmappingresponse.mdx: + id: 1c9494165922 + last_write_checksum: sha1:512df025934ca9641fbd1ba9c8523f291a89b660 + pristine_git_object: d5612ee0ec20162e05794e29944ff104668b842a docs/models/deleteworkspacebudgetresponse.md: id: 3f9e0c7bda7e last_write_checksum: sha1:4e5e504602df23c0d6321efc19451fdcaa9fb8a7 @@ -4280,6 +4296,10 @@ trackedFiles: id: 33b096d181e5 last_write_checksum: sha1:5fe3e25e65892e65f0c3a58302dd04b2acf8f61a pristine_git_object: 19a130f54b51d1af47496f41cff8ed55297e20a1 + docs/models/getscimgroupmappingresponse.mdx: + id: 30c8ab517163 + last_write_checksum: sha1:8aaf5ac8855621bc22c524a59711783540a6dddb + pristine_git_object: 391f00adb91606fe4805588a4a7f3a2f602aa24b docs/models/getworkspaceresponse.md: id: 4aacc04e7be8 last_write_checksum: sha1:17d9e2f8125c16b21acd71619125e1b2d26b5e37 @@ -5305,6 +5325,14 @@ trackedFiles: id: a2564e571fb7 last_write_checksum: sha1:b24dafe18d1417cb22f772c16f171603f4f976ee pristine_git_object: 5efa47c6a621f9525bdd337c552172856adb0180 + docs/models/listscimgroupmappingsresponse.mdx: + id: 3941744ebf1d + last_write_checksum: sha1:67580beb356734614cf456e824d733e9d24b6fed + pristine_git_object: ae2d4e29836dbfa8de0df131f34f7eac4fc6769e + docs/models/listscimgroupsresponse.mdx: + id: 00c0d0c56555 + last_write_checksum: sha1:0fe02b93272492468676e98db9b0d1acf4f91984 + pristine_git_object: fa43be61a6bb7d53939622b943e4ca100a9232a6 docs/models/listworkspacebudgetsresponse.md: id: 7b25fbff0283 last_write_checksum: sha1:ade25543d5e312c7160573411bbea9f06931fae3 @@ -7166,6 +7194,14 @@ trackedFiles: id: df8ecba0f994 last_write_checksum: sha1:8e866948fe61942635303f7a3a8bcdb71ecfa3e3 pristine_git_object: 380d6f8ed76b2b593b83f01f794ee28d8e72a54f + docs/models/operations/createscimgroupmappingglobals.mdx: + id: 6f74a7472e93 + last_write_checksum: sha1:f17d722615485bb1f6662affbb661249d549dfba + pristine_git_object: 8e4f19d439bcff266a3874b6d6bf58e921300b27 + docs/models/operations/createscimgroupmappingrequest.mdx: + id: a7e4ecedbca6 + last_write_checksum: sha1:1ce1687e1dad3b884a848292cedc84c1f7444bee + pristine_git_object: 6796ca9b7b0967a91bad67fc1fc54dc950fceb97 docs/models/operations/createttsglobals.md: id: d77253ce42ea last_write_checksum: sha1:9516108a1caa4256a40d277dd24f9d3be5f92a2d @@ -7300,6 +7336,14 @@ trackedFiles: id: dc9c62d598fd last_write_checksum: sha1:0a31703d26914486ab8c68c912c4df2b70edd434 pristine_git_object: 9dc8670434b0877e87cb674b206b48977cdb7376 + docs/models/operations/deletescimgroupmappingglobals.mdx: + id: 82cbe41fa51c + last_write_checksum: sha1:127a2cbf344df7bc8aaf2588d37033d152e06241 + pristine_git_object: 4eeafa3e56ae8633360e26778ef0ab5c5cf2f8e3 + docs/models/operations/deletescimgroupmappingrequest.mdx: + id: fd975a641213 + last_write_checksum: sha1:3809ddc6c1601eb8e71a10cfe0ff966d5da66a07 + pristine_git_object: cf6f3f55f2c89d0d4bbff4365d646d1be6fd593b docs/models/operations/deleteworkspacebudgetglobals.md: id: 7e9a1f4cb03d last_write_checksum: sha1:eba7bc81e36395f0353c074480ac92045dc08ef8 @@ -7802,6 +7846,14 @@ trackedFiles: id: 6dfdb3504444 last_write_checksum: sha1:b0c37c97d2e9e9e55233fa026f4ffe3031816518 pristine_git_object: a8d815b3da3d87b5c263febb15aa82218acc7c77 + docs/models/operations/getscimgroupmappingglobals.mdx: + id: 9655a41cda41 + last_write_checksum: sha1:449a58af7a686824d88eb09312d35ca0f21c6414 + pristine_git_object: 1f8c3b91c266d03027f37eaef1070fab395e4c75 + docs/models/operations/getscimgroupmappingrequest.mdx: + id: 22025542670f + last_write_checksum: sha1:c1f39828219ae0fae641393c78edc05fba449b0e + pristine_git_object: 3da57c2476aeb4a2c533281e2885d34b290dc4b9 docs/models/operations/gettaskclassificationsglobals.md: id: 39c95297a6c7 last_write_checksum: sha1:d3cdded90a20312c4cce31776ed51a44115868e5 @@ -7903,6 +7955,14 @@ trackedFiles: id: e1966b690efd last_write_checksum: sha1:75b21f671e2bdeb55b6badd248f27a3d9a3431d6 pristine_git_object: e7222d1f3e732241030df7ab5612b086ab2bda9a + docs/models/operations/keepmembers.mdx: + id: 591598fdced8 + last_write_checksum: sha1:19946e98301ceb2e71252f3ea74798df803c9548 + pristine_git_object: 9a752b176954557d3bc05d2eede4d540fe051bdd + docs/models/operations/keepmembersenum.mdx: + id: d4f3719b3875 + last_write_checksum: sha1:1ba4242e055b5fa7af51d718a194536772ab3b50 + pristine_git_object: 300c07bd427256da24360e0138b85c28b6197646 docs/models/operations/languagetype.mdx: id: 086bdbefa10c last_write_checksum: sha1:66c73ffc67d8de172550360167f4aae12bf86bc1 @@ -8293,6 +8353,30 @@ trackedFiles: id: 46ed19423815 last_write_checksum: sha1:ea0901c630e4f3ca2555750db84f8efd53e8fa0a pristine_git_object: e3820e26d58719986a38c5b715532bb4ecf2fa28 + docs/models/operations/listscimgroupmappingsglobals.mdx: + id: e5b17c0174b5 + last_write_checksum: sha1:a08b712211511678c59529bba9917b8405faba20 + pristine_git_object: 0acbeefa7c3dc275254578228aa3c3fe3ce123b9 + docs/models/operations/listscimgroupmappingsrequest.mdx: + id: a621e7d89e5f + last_write_checksum: sha1:8a42da82a37a6f668391cea29a020ca55dbeffe7 + pristine_git_object: 4ba06ce8aff60b93f2c462f04f35d46a0f2f1319 + docs/models/operations/listscimgroupmappingsresponse.mdx: + id: 85554d10e6b5 + last_write_checksum: sha1:e83a5dfb989599357e0bf8d6865c9b316fbfc883 + pristine_git_object: 3a13488f7f07039b5de83f2d1e3cdd990f3d9de3 + docs/models/operations/listscimgroupsglobals.mdx: + id: 77e7f12dd4b5 + last_write_checksum: sha1:28e92473f84e011e0877d3989f5c7c30138c6098 + pristine_git_object: b37da4046ae7d32bb95e894c0bd11b7abbdb094f + docs/models/operations/listscimgroupsrequest.mdx: + id: e55a38cd82ce + last_write_checksum: sha1:b086cec80f4f874e168fd903bd97656f926ced29 + pristine_git_object: 8830c941f36e5a61204c54983a426a666a7ca6da + docs/models/operations/listscimgroupsresponse.mdx: + id: 061ed874493a + last_write_checksum: sha1:3acd017ce8c3b84f544c45bac5fb0bd6ab8f8b69 + pristine_git_object: 7bd81456bb269a52856f6163cd336435b66b1150 docs/models/operations/listvideoscontentglobals.md: id: 48ca55aee689 last_write_checksum: sha1:0c8685efc8fb41450eba115c81ba7310a1579a0f @@ -8701,6 +8785,14 @@ trackedFiles: id: 33e401a234d7 last_write_checksum: sha1:35934e25f5a6b927654c2b85617532a429a7fac6 pristine_git_object: 72e84345c57f502d0b3833aa8978343f7a26720c + docs/models/operations/updatescimgroupmappingglobals.mdx: + id: 402cc107fd5a + last_write_checksum: sha1:ae4251ebbb9eb03ecfbe853871a7bec2e387e4c6 + pristine_git_object: 36279eadd579b3c5a3e8783b7dd48e0d4322d0c4 + docs/models/operations/updatescimgroupmappingrequest.mdx: + id: 43c83b37300b + last_write_checksum: sha1:5eb248d8aa60326b82caaa152c5bac16c4d5969b + pristine_git_object: 9e03f03f18d4be15c648ee0cab82c7bc91290794 docs/models/operations/updateworkspaceglobals.md: id: c1892ff792dc last_write_checksum: sha1:9f38c6549f864b8b76e1dcf6f06aad5523ba1189 @@ -10695,6 +10787,18 @@ trackedFiles: id: a90e6f37132b last_write_checksum: sha1:ad89739024fd833b1c6d18b296398a73729c0992 pristine_git_object: d648f9009fa3225de0185b0567b65c257243da3c + docs/models/scimgroup.mdx: + id: 05083a5c381f + last_write_checksum: sha1:115a38a1c0b56154f39b14b9f3506235404670a9 + pristine_git_object: d6b892786a036cea6fee2525c61804b4b49e7278 + docs/models/scimgroupmapping.mdx: + id: efb8f1e82466 + last_write_checksum: sha1:4ed9d5faebe2a98ac40f1f1f3c187fafeac41254 + pristine_git_object: 66d93ea6902352d877232678afe85044200358ef + docs/models/scimgroupmappingrole.mdx: + id: 277a61c893a8 + last_write_checksum: sha1:8d97b2a4f804b3e21ef7f9724dc9b802d32302b7 + pristine_git_object: b0e19d2967a61bc0ca4d798f80229165ef22364b docs/models/searchcontextsizeenum.md: id: 4de34693233a last_write_checksum: sha1:efc7659126209876e2b83b5fd67b1dc379796ad0 @@ -11940,6 +12044,18 @@ trackedFiles: id: 2fdc00eca436 last_write_checksum: sha1:de3bb9de167a85e7344a2cd2dce3d7f3ef5d530f pristine_git_object: 3a32896a6fd7f74268dbc0f24f2ea5a7a8a0795a + docs/models/updatescimgroupmappingrequest.mdx: + id: 59fbe6749cef + last_write_checksum: sha1:f0762a8b028d45a26bc98968ee25f5ab371066ec + pristine_git_object: 95e957e93866c062d792b576031fb6c1db5d31fd + docs/models/updatescimgroupmappingrequestrole.mdx: + id: f6be60da442d + last_write_checksum: sha1:5576e932df2222d57428dbb2309e75b0d17e885a + pristine_git_object: f90140cafe9e723e3d5d342531c648c72b746680 + docs/models/updatescimgroupmappingresponse.mdx: + id: 7d08e38ab31d + last_write_checksum: sha1:80fee10b625662fd02e3a5cfea836231e663df51 + pristine_git_object: c1bd39dfd3bf6b30bf63e49ff0f755ce1ad05bfa docs/models/updateworkspacerequest.md: id: 9e53386960ad last_write_checksum: sha1:476fb50446924122b7cb274a9a6788daf8e284a7 @@ -12559,6 +12675,10 @@ trackedFiles: id: abab319e080e last_write_checksum: sha1:12f67584e99c6f82a5e00544a70d5a280badddb2 pristine_git_object: a6ae7a34aecc0cf38695561110c2ff9189ec0958 + docs/sdks/scim/README.mdx: + id: fd6d8a91a053 + last_write_checksum: sha1:2d5224fd5ee60879f668898fa9eb26d1d8df8fab + pristine_git_object: d2e02007b5b7c2018f29f00194aafce4ef7d754d docs/sdks/stt/README.md: id: 0806154492f9 last_write_checksum: sha1:aa311f9602dfafdcb8dea4d91c4549876cecc37f @@ -12617,12 +12737,12 @@ trackedFiles: pristine_git_object: 410efafd6a7f50d91ccb87131fedbe0c3d47e15a jsr.json: id: 7f6ab7767282 - last_write_checksum: sha1:0ad667bac479b42d629002394ccad2f695ab669d - pristine_git_object: 041aba976075d2df7d80c908f6b9fe194686bff2 + last_write_checksum: sha1:a31b96cef20897b32ff22cd9af4500e4fa638ccf + pristine_git_object: 2488b59b1560a0bede282af8ebba0e39c8a3bc5d package.json: id: 7030d0b2f71b - last_write_checksum: sha1:901c2f786c5af4c2562f071df3590af7ca9f656a - pristine_git_object: 07ac944e0326ef9a373fb0544208562b848b5e6f + last_write_checksum: sha1:e666c99da34939248c73490c7f17f13756935576 + pristine_git_object: e57e680e3d666540dfa375fa02331a0a35fedf63 src/core.ts: id: f431fdbcd144 last_write_checksum: sha1:5aa66b0b6a5964f3eea7f3098c2eb3c0ee9c0131 @@ -12907,6 +13027,30 @@ trackedFiles: id: c8d9f439840d last_write_checksum: sha1:b3b6c4f84e95886cfc37e4551a14660043b68ba4 pristine_git_object: dd13b6189cf245e1f2f8513badbc77baec082ab3 + src/funcs/scimCreate.ts: + id: a8ea14125a34 + last_write_checksum: sha1:9ac1cb869be1f6f0a04bb12900c6e7beb11317b0 + pristine_git_object: dfca7e65ee994c95685a6029678185af7d0e6531 + src/funcs/scimDelete.ts: + id: 441ae3f88a98 + last_write_checksum: sha1:20d77e5c8e46e5b00341e630cb81f6d0ef991a8e + pristine_git_object: 375fd5d1fd18dd690ed3f59c2b8cf584d8a4c103 + src/funcs/scimListGroups.ts: + id: bf94e6973603 + last_write_checksum: sha1:73108f728f39f9e306d480564ab9308d8bd2138a + pristine_git_object: 454e25170fc8a956e2ca51e1e7ca594c83817a0b + src/funcs/scimListMappings.ts: + id: 5c9fe26dc2ff + last_write_checksum: sha1:94945e1e2e7d043d07effbf3ea2ab9107a9415a5 + pristine_git_object: bbf986bae87e6981f886984d17ac20719fbbc42a + src/funcs/scimRead.ts: + id: 71d46eb8edca + last_write_checksum: sha1:34ffb2e1c5833faf44182a4ea9e8984e37b871bf + pristine_git_object: ad2ce6085717eabb32a0d9dc0244cf75a0d29753 + src/funcs/scimUpdate.ts: + id: 165bac1c9819 + last_write_checksum: sha1:fef6f4965ccef63730ec9c6696cb92e3c4b834fa + pristine_git_object: ee28b4b8436be56ef32d76d072e1681631d3d238 src/funcs/sttCreateTranscription.ts: id: 90b735003ac7 last_write_checksum: sha1:14324939a10d6009cfc761ebc6cce6954b6f10c2 @@ -13001,8 +13145,8 @@ trackedFiles: pristine_git_object: a187e58707bdb726ca2aff74941efe7493422d4e src/lib/config.ts: id: 320761608fb3 - last_write_checksum: sha1:564e5d4896da650e9803efadf0b7c1147af1dc01 - pristine_git_object: e7405773d855d410b88b09104cc69e6e27ed3008 + last_write_checksum: sha1:2eb96a1ed1a922f989cde6ffaa352003d1c09dac + pristine_git_object: 53f6c14aec05bf36d1907b2b84ce52085219f85a src/lib/dlv.ts: id: b1988214835a last_write_checksum: sha1:eaac763b22717206a6199104e0403ed17a4e2711 @@ -13741,6 +13885,14 @@ trackedFiles: id: dc6bff35f5a1 last_write_checksum: sha1:9df16036cebe587e20d7b9078e85a51b008f1ed4 pristine_git_object: 1bd2a805f55379a24b45aa945dd7ca50a88796b1 + src/models/createscimgroupmappingrequest.ts: + id: b5fef01e7c38 + last_write_checksum: sha1:d2c75aaf339c26de3b954af571f390b567cf8848 + pristine_git_object: eb8a7e2059d10733939fbd55f7245021033c931b + src/models/createscimgroupmappingresponse.ts: + id: b3723e0973bc + last_write_checksum: sha1:866f5585a404f63d2ab8705793bd682f67e29da7 + pristine_git_object: a6e1bde4814431bc17d0260f23dd4b79bfea3a89 src/models/createworkspacerequest.ts: id: 729716a42b74 last_write_checksum: sha1:b9d04def65fb3e312cf6299b0a04a0aa16be79a6 @@ -13801,6 +13953,10 @@ trackedFiles: id: 86995b7dad27 last_write_checksum: sha1:48f68140327741024cf0185005993a461d0412a9 pristine_git_object: 5a9d9e01bb3bb945d68148ba59d07650d3a5c8b3 + src/models/deletescimgroupmappingresponse.ts: + id: 6773f6e7c59d + last_write_checksum: sha1:bdfe5036cfdf3657c6d73275c9f9a320172438fe + pristine_git_object: d4c542e500cb2b05dd7a3c95e91ddb1ca8f7173b src/models/deleteworkspacebudgetresponse.ts: id: abfb4f8daac9 last_write_checksum: sha1:2699f0feae1518c3b67106b6e4f12e7fb9343f82 @@ -14089,6 +14245,10 @@ trackedFiles: id: 28f0dd1227c4 last_write_checksum: sha1:7947b0f6dfe5169ca0ab3058f81896777679b011 pristine_git_object: 67443d565138a5d66c40ee51b279d85176d3f5df + src/models/getscimgroupmappingresponse.ts: + id: 96e1fbabfc37 + last_write_checksum: sha1:9943ba8d8e5900834f5e3a0c97b92f6540c6438d + pristine_git_object: 687d466bfddd70cc5bc6560555ca08586002ceda src/models/getworkspaceresponse.ts: id: 2315ba7fb584 last_write_checksum: sha1:33182d29372d6d785cff2d02e2120b9b1e0b739a @@ -14215,8 +14375,8 @@ trackedFiles: pristine_git_object: 8e109bedfdcf2c4808e49323dda861e3c6069d51 src/models/index.ts: id: f93644b0f37e - last_write_checksum: sha1:fd43ed7baf64a2788b240cab008e5b8df9616993 - pristine_git_object: 400cf6b9628d291f12c6a93090fc5a6db1941c24 + last_write_checksum: sha1:9cfed058a5ffd006c25302f5be32622353952035 + pristine_git_object: 64134bbfb03a166686ccd55b192643dea74c1121 src/models/inputaudio.ts: id: 9bdc14c7565f last_write_checksum: sha1:2f8dc4c1d6a9c2927d9eb186e0ecedf7b81838e6 @@ -14313,6 +14473,14 @@ trackedFiles: id: 071060ed138f last_write_checksum: sha1:548646b202bf9f3661023b53bd5028ad505f8e58 pristine_git_object: d026810ad0f86584200274e319f7c883b4200906 + src/models/listscimgroupmappingsresponse.ts: + id: c04288fe6dbf + last_write_checksum: sha1:259fdc2b380f62cd3708dbc7c9803ceed7ad477e + pristine_git_object: a503e87ce1082dbd6e58e10eef347ed439348fe8 + src/models/listscimgroupsresponse.ts: + id: d3fac2f94e20 + last_write_checksum: sha1:f138d6ec516edff561acf3ee2038febe0fe2bd90 + pristine_git_object: 5b63973a8724442c77527f11a557dfc84d5ea409 src/models/listworkspacebudgetsresponse.ts: id: 2573f31846b9 last_write_checksum: sha1:5a818c34a0c4878c3ee0864c0d20ed5680306ca8 @@ -14705,6 +14873,10 @@ trackedFiles: id: 7ad611b27e9d last_write_checksum: sha1:125b46a7a9f280d03bdc01c3a2e771342ef3ab47 pristine_git_object: 7ea8d6e578199e58c3229bcb2d0ebcc5419a06cb + src/models/operations/createscimgroupmapping.ts: + id: c5875c4ab24d + last_write_checksum: sha1:ae2c3b7c171b6b7efa074766653b1548bf9c69ab + pristine_git_object: 98b1062e237236013090bc0069786cc8ad13953a src/models/operations/createvideos.ts: id: 06dc92996e18 last_write_checksum: sha1:debbfb49bdfed99a57248da4ed95dc06be8c1e43 @@ -14733,6 +14905,10 @@ trackedFiles: id: a6ab575f608d last_write_checksum: sha1:0fedf5958fb382251ff4cf7bcdedac6f8b71ab9b pristine_git_object: 5cebb7f937c9cfb20b0d63b9f9422578dc272f02 + src/models/operations/deletescimgroupmapping.ts: + id: 28528c6c5f62 + last_write_checksum: sha1:ef705be3b0ace6ee33d2f9e48295c59c170212ee + pristine_git_object: 45d7fdf9e103ebc9c1f0e1f955fdfa1adb80f277 src/models/operations/deleteworkspace.ts: id: 38325c1278ba last_write_checksum: sha1:7cf7fe67ac233b746ab9d1cc45328da51f5d31a3 @@ -14813,6 +14989,10 @@ trackedFiles: id: b165b39aba3b last_write_checksum: sha1:32bf3b847bf3c69eda9be0575af092236369d58f pristine_git_object: ddec4fc4a47b70dd7c8b3741232ffe93014bc97c + src/models/operations/getscimgroupmapping.ts: + id: 770ff3da0b58 + last_write_checksum: sha1:7f59e0d0fa643c7e163477b08c30761261605e83 + pristine_git_object: 8208ddb9588e6c4e6a85afa8638f7aa39bc80442 src/models/operations/gettaskclassifications.ts: id: 8482753ddd33 last_write_checksum: sha1:eabf9f38dead635af268288733e71d20af1df218 @@ -14831,8 +15011,8 @@ trackedFiles: pristine_git_object: 6b14994d428c8fb6d58adc4f880ab796d6a2a2e5 src/models/operations/index.ts: id: 0d9ffaf774d2 - last_write_checksum: sha1:0637116c76e6ffebc7fe8ba73f32d9204eb47c08 - pristine_git_object: c758b817f851705f840e45883119cea9ff35ce88 + last_write_checksum: sha1:c4fc59a0ae2f58eb1fd092fa3e3362b98b7b936e + pristine_git_object: 8473f9082cb22b4161e5cb63bfca668ccc5228f1 src/models/operations/list.ts: id: ce11386ad30f last_write_checksum: sha1:c6f6be4f00954f38c1c900beff6956be260873e0 @@ -14917,6 +15097,14 @@ trackedFiles: id: 76a35169de06 last_write_checksum: sha1:503279e69e79eb16b187320616c248aa9973567e pristine_git_object: 055f5fcfc4ae0306608c66841752f96721b3a52c + src/models/operations/listscimgroupmappings.ts: + id: be5b19bb327f + last_write_checksum: sha1:d249d5c3d6842d2621cd9b58f4309e608df6c893 + pristine_git_object: 6add01a116616266282320dd471da716a35b4c2d + src/models/operations/listscimgroups.ts: + id: f6a6cc9a951f + last_write_checksum: sha1:a8ab23f18dbd47fe7b5b78813c4af121ff490c7f + pristine_git_object: f8cbd73cc7cf5da0bf331986fef6365e6958614b src/models/operations/listvideoscontent.ts: id: 6d6644a39a85 last_write_checksum: sha1:4778aa6aeeac6908c1b2abbc5f83eb11ff70e3ac @@ -14965,6 +15153,10 @@ trackedFiles: id: efb1e13263f5 last_write_checksum: sha1:f45abdbd2aaa233c10479dd83468fd91c9614665 pristine_git_object: 5ca7155df4018f85796f4fddf486f6f1784f6897 + src/models/operations/updatescimgroupmapping.ts: + id: 6b5a9008ec50 + last_write_checksum: sha1:d79c7f61099e5c7eb8106abb5ab24b0e1f9a7c75 + pristine_git_object: 01f1f1a6e40909812c77a29e96924ed3ae237088 src/models/operations/updateworkspace.ts: id: b10c83b1ce4f last_write_checksum: sha1:c1290ad4bde43bae7e400282e782e28af8254726 @@ -15405,6 +15597,14 @@ trackedFiles: id: 40bcbedca097 last_write_checksum: sha1:9f9bf04124b2f1022cde02da6fb3458b49e66cf4 pristine_git_object: 8596dcbaa7461760fa0e86132cdd735a8a360aff + src/models/scimgroup.ts: + id: 660f64066687 + last_write_checksum: sha1:931474f2a310bfd7064ac922edeabec04a1a1c59 + pristine_git_object: c14a5641344d475c96289ae2bac8c98205833bbb + src/models/scimgroupmapping.ts: + id: 851ea3a51b22 + last_write_checksum: sha1:234f4f55f87d641555edb833889283ff1d60beaf + pristine_git_object: 062b2385af8e875bd872a8dfe1377ce60e084a6b src/models/searchcontextsizeenum.ts: id: d76263d711fe last_write_checksum: sha1:84b915e8d44e263ab6436d727663d69caa799149 @@ -15689,6 +15889,14 @@ trackedFiles: id: 784690ec7bf0 last_write_checksum: sha1:9804041cdeea6f0f667d799a4903848bfd0abb1b pristine_git_object: 14c95b9e7b432df315e2c95891e83d10399b408d + src/models/updatescimgroupmappingrequest.ts: + id: ae49c0bf110c + last_write_checksum: sha1:4fb857d9e295a637c25a169c46018989f1696036 + pristine_git_object: 399ef05ee0e0dfa74a1eb1627c26953b2eaabf03 + src/models/updatescimgroupmappingresponse.ts: + id: 36503c874458 + last_write_checksum: sha1:1aa090143aae6da762586ac27aeb5259d1b582f2 + pristine_git_object: ee2b015d94e8ac2de50308dfd728c72a340300ad src/models/updateworkspacerequest.ts: id: 84dd4f01b245 last_write_checksum: sha1:f3584942d726978e67f245905830596275b11679 @@ -15925,10 +16133,14 @@ trackedFiles: id: fc4b535757c5 last_write_checksum: sha1:09d56ac9a25f505b60563b34c01831b6917782aa pristine_git_object: 7ba7ea89653bce0ac90b00c64d09e4ffb85b931e + src/sdk/scim.ts: + id: ecf200b1abaf + last_write_checksum: sha1:338cd30d33f8d0f3254f675121743e1f6ce519d9 + pristine_git_object: d207e07fa9c48cdeb6282df96d238a68c6c38f1f src/sdk/sdk.ts: id: 784571af2f69 - last_write_checksum: sha1:691a93bfb5cca53ebc66609599e12d468cf5789e - pristine_git_object: cbf77f1b69ab89d9ad81b2198dadab88e7e8a70e + last_write_checksum: sha1:09ce9b3d8941c3c63a31417caf2c1cb1cddf054f + pristine_git_object: c95283152c75b72b72141a25b27a0c6eb30b8e49 src/sdk/stt.ts: id: fd9e88c22d1f last_write_checksum: sha1:baa74a0310eb8b465dea302495e744e3f3ea1ca5 @@ -17622,4 +17834,101 @@ examples: application/json: {"error": {"code": 429, "message": "Rate limit exceeded"}} "500": application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + listScimGroupMappings: + speakeasy-default-list-scim-group-mappings: + parameters: + query: + offset: 0 + limit: 50 + responses: + "200": + application/json: {"data": [{"created_at": "2025-08-24T10:30:00.000Z", "id": "770e8400-e29b-41d4-a716-446655440000", "organization_id": "org_123456", "role": "member", "scim_group_id": "550e8400-e29b-41d4-a716-446655440000", "updated_at": "2025-08-24T10:30:00.000Z", "workspace_id": "660e8400-e29b-41d4-a716-446655440000"}], "total_count": 320360} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + createScimGroupMapping: + speakeasy-default-create-scim-group-mapping: + requestBody: + application/json: {"role": "admin", "scim_group_id": "ecdda85d-40dc-4ed7-9955-2bf12128e7da", "workspace_id": "d5a84a53-ce30-4057-ab5e-bd7b45553567"} + responses: + "201": + application/json: {"data": {"created_at": "2025-08-24T10:30:00.000Z", "id": "770e8400-e29b-41d4-a716-446655440000", "organization_id": "org_123456", "role": "member", "scim_group_id": "550e8400-e29b-41d4-a716-446655440000", "updated_at": "2025-08-24T10:30:00.000Z", "workspace_id": "660e8400-e29b-41d4-a716-446655440000"}} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "409": + application/json: {"error": {"code": 409, "message": "Resource conflict. Please try again later."}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + deleteScimGroupMapping: + speakeasy-default-delete-scim-group-mapping: + parameters: + path: + id: "ef7219ae-c495-43b3-b46b-52bf82772570" + query: + keep_members: false + responses: + "200": + application/json: {"deleted": true} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + getScimGroupMapping: + speakeasy-default-get-scim-group-mapping: + parameters: + path: + id: "aca4d64d-fff7-419d-a8ae-3ec5ab8a0c1e" + responses: + "200": + application/json: {"data": {"created_at": "2025-08-24T10:30:00.000Z", "id": "770e8400-e29b-41d4-a716-446655440000", "organization_id": "org_123456", "role": "member", "scim_group_id": "550e8400-e29b-41d4-a716-446655440000", "updated_at": "2025-08-24T10:30:00.000Z", "workspace_id": "660e8400-e29b-41d4-a716-446655440000"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + updateScimGroupMapping: + speakeasy-default-update-scim-group-mapping: + parameters: + path: + id: "361a9698-8c34-4cbb-b0be-f6fd47094a30" + requestBody: + application/json: {"role": "member"} + responses: + "200": + application/json: {"data": {"created_at": "2025-08-24T10:30:00.000Z", "id": "770e8400-e29b-41d4-a716-446655440000", "organization_id": "org_123456", "role": "member", "scim_group_id": "550e8400-e29b-41d4-a716-446655440000", "updated_at": "2025-08-24T10:30:00.000Z", "workspace_id": "660e8400-e29b-41d4-a716-446655440000"}} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + listScimGroups: + speakeasy-default-list-scim-groups: + parameters: + query: + offset: 0 + limit: 50 + responses: + "200": + application/json: {"data": [{"created_at": "2025-08-24T10:30:00.000Z", "display_name": "Engineering", "external_id": "group-external-id", "id": "550e8400-e29b-41d4-a716-446655440000", "organization_id": "org_123456", "updated_at": "2025-08-24T10:30:00.000Z"}], "total_count": 926673} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} examplesVersion: 1.0.2 diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index c6060d20b..61a6bb6a2 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -37,7 +37,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true typescript: - version: 1.1.25 + version: 1.2.0 acceptHeaderEnum: false additionalDependencies: dependencies: diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index a21ffbbf1..07680d5b2 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -7317,6 +7317,32 @@ components: required: - 'data' type: 'object' + CreateScimGroupMappingRequest: + properties: + role: + enum: + - 'admin' + - 'member' + type: 'string' + x-speakeasy-unknown-values: allow + scim_group_id: + format: 'uuid' + type: 'string' + workspace_id: + format: 'uuid' + type: 'string' + required: + - 'scim_group_id' + - 'workspace_id' + - 'role' + type: 'object' + CreateScimGroupMappingResponse: + properties: + data: + $ref: '#/components/schemas/ScimGroupMapping' + required: + - 'data' + type: 'object' CreateWorkspaceRequest: example: default_image_model: 'openai/dall-e-3' @@ -7742,6 +7768,14 @@ components: required: - 'deleted' type: 'object' + DeleteScimGroupMappingResponse: + properties: + deleted: + const: true + type: 'boolean' + required: + - 'deleted' + type: 'object' DeleteWorkspaceBudgetResponse: example: deleted: true @@ -9596,6 +9630,13 @@ components: required: - 'data' type: 'object' + GetScimGroupMappingResponse: + properties: + data: + $ref: '#/components/schemas/ScimGroupMapping' + required: + - 'data' + type: 'object' GetWorkspaceResponse: example: data: @@ -11699,6 +11740,30 @@ components: - 'data' - 'total_count' type: 'object' + ListScimGroupMappingsResponse: + properties: + data: + items: + $ref: '#/components/schemas/ScimGroupMapping' + type: 'array' + total_count: + type: 'integer' + required: + - 'data' + - 'total_count' + type: 'object' + ListScimGroupsResponse: + properties: + data: + items: + $ref: '#/components/schemas/ScimGroup' + type: 'array' + total_count: + type: 'integer' + required: + - 'data' + - 'total_count' + type: 'object' ListWorkspaceBudgetsResponse: example: data: @@ -21547,6 +21612,78 @@ components: description: 'How long (in seconds) the container stays warm after its last command before sleeping, freeing its capacity slot. Idle-based: each command renews the timer. Defaults to 900 (15 minutes); capped at 2592000 (30 days).' example: 900 type: 'integer' + ScimGroup: + example: + created_at: '2025-08-24T10:30:00.000Z' + display_name: 'Engineering' + external_id: 'group-external-id' + id: '550e8400-e29b-41d4-a716-446655440000' + organization_id: 'org_123456' + updated_at: '2025-08-24T10:30:00.000Z' + properties: + created_at: + type: 'string' + display_name: + type: 'string' + external_id: + type: + - 'string' + - 'null' + id: + format: 'uuid' + type: 'string' + organization_id: + type: 'string' + updated_at: + type: 'string' + required: + - 'id' + - 'organization_id' + - 'external_id' + - 'display_name' + - 'created_at' + - 'updated_at' + type: 'object' + ScimGroupMapping: + example: + created_at: '2025-08-24T10:30:00.000Z' + id: '770e8400-e29b-41d4-a716-446655440000' + organization_id: 'org_123456' + role: 'member' + scim_group_id: '550e8400-e29b-41d4-a716-446655440000' + updated_at: '2025-08-24T10:30:00.000Z' + workspace_id: '660e8400-e29b-41d4-a716-446655440000' + properties: + created_at: + type: 'string' + id: + format: 'uuid' + type: 'string' + organization_id: + type: 'string' + role: + enum: + - 'admin' + - 'member' + type: 'string' + x-speakeasy-unknown-values: allow + scim_group_id: + format: 'uuid' + type: 'string' + updated_at: + type: 'string' + workspace_id: + format: 'uuid' + type: 'string' + required: + - 'id' + - 'organization_id' + - 'scim_group_id' + - 'workspace_id' + - 'role' + - 'created_at' + - 'updated_at' + type: 'object' SearchContextSizeEnum: description: 'Size of the search context for web search tools' enum: @@ -23869,6 +24006,24 @@ components: required: - 'data' type: 'object' + UpdateScimGroupMappingRequest: + properties: + role: + enum: + - 'admin' + - 'member' + type: 'string' + x-speakeasy-unknown-values: allow + required: + - 'role' + type: 'object' + UpdateScimGroupMappingResponse: + properties: + data: + $ref: '#/components/schemas/ScimGroupMapping' + required: + - 'data' + type: 'object' UpdateWorkspaceRequest: example: name: 'Updated Workspace' @@ -35897,6 +36052,442 @@ paths: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" + /scim/group-mappings: + get: + description: 'List SCIM group-to-workspace mappings for the organization. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'listScimGroupMappings' + parameters: + - description: 'Number of records to skip for pagination' + in: 'query' + name: 'offset' + required: false + schema: + default: 0 + description: 'Number of records to skip for pagination' + example: 0 + minimum: 0 + type: + - 'integer' + - 'null' + - description: 'Maximum number of records to return (max 100)' + in: 'query' + name: 'limit' + required: false + schema: + default: 50 + description: 'Maximum number of records to return (max 100)' + example: 50 + maximum: 100 + minimum: 1 + type: 'integer' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ListScimGroupMappingsResponse' + description: 'List of SCIM group mappings' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'List SCIM group mappings' + tags: + - 'SCIM' + x-speakeasy-name-override: 'listMappings' + x-speakeasy-pagination: + inputs: + - in: 'parameters' + name: 'offset' + type: 'offset' + - in: 'parameters' + name: 'limit' + type: 'limit' + outputs: + results: '$.data' + type: 'offsetLimit' + post: + description: 'Create a SCIM group-to-workspace role mapping. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'createScimGroupMapping' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateScimGroupMappingRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/CreateScimGroupMappingResponse' + description: 'SCIM group mapping created' + '400': + content: + application/json: + example: + error: + code: 400 + message: 'Invalid request parameters' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' + '409': + content: + application/json: + example: + error: + code: 409 + message: 'Resource conflict. Please try again later.' + schema: + $ref: '#/components/schemas/ConflictResponse' + description: 'Conflict - Resource conflict or concurrent modification' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'Create a SCIM group mapping' + tags: + - 'SCIM' + x-speakeasy-name-override: 'create' + parameters: + - $ref: "#/components/parameters/AppIdentifier" + - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" + /scim/group-mappings/{id}: + delete: + description: 'Delete a SCIM group-to-workspace mapping. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'deleteScimGroupMapping' + parameters: + - in: 'path' + name: 'id' + required: true + schema: + format: 'uuid' + type: 'string' + - description: 'Required. Whether to keep workspace members after deleting the mapping. `false` **removes** the members this mapping granted access to; `true` deletes the mapping while leaving membership intact as manually-managed. There is deliberately no default — omitting it returns `400` so the destructive path cannot be reached by accident. Mirrors the dashboard, whose `DeleteMappingSchema.keepMembers` is likewise required.' + in: 'query' + name: 'keep_members' + required: true + schema: + anyOf: + - enum: + - 'true' + - 'false' + type: 'string' + x-speakeasy-unknown-values: allow + - type: 'boolean' + description: 'Required. Whether to keep workspace members after deleting the mapping. `false` **removes** the members this mapping granted access to; `true` deletes the mapping while leaving membership intact as manually-managed. There is deliberately no default — omitting it returns `400` so the destructive path cannot be reached by accident. Mirrors the dashboard, whose `DeleteMappingSchema.keepMembers` is likewise required.' + example: false + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteScimGroupMappingResponse' + description: 'SCIM group mapping deleted' + '400': + content: + application/json: + example: + error: + code: 400 + message: 'Invalid request parameters' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'Delete a SCIM group mapping' + tags: + - 'SCIM' + x-speakeasy-name-override: 'delete' + get: + description: 'Get a SCIM group-to-workspace mapping. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'getScimGroupMapping' + parameters: + - in: 'path' + name: 'id' + required: true + schema: + format: 'uuid' + type: 'string' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GetScimGroupMappingResponse' + description: 'SCIM group mapping' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'Get a SCIM group mapping' + tags: + - 'SCIM' + x-speakeasy-name-override: 'read' + patch: + description: 'Update a SCIM group mapping role. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'updateScimGroupMapping' + parameters: + - in: 'path' + name: 'id' + required: true + schema: + format: 'uuid' + type: 'string' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateScimGroupMappingRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateScimGroupMappingResponse' + description: 'SCIM group mapping updated' + '400': + content: + application/json: + example: + error: + code: 400 + message: 'Invalid request parameters' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'Update a SCIM group mapping' + tags: + - 'SCIM' + x-speakeasy-name-override: 'update' + parameters: + - $ref: "#/components/parameters/AppIdentifier" + - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" + /scim/groups: + get: + description: 'List SCIM groups for the organization. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'listScimGroups' + parameters: + - description: 'Number of records to skip for pagination' + in: 'query' + name: 'offset' + required: false + schema: + default: 0 + description: 'Number of records to skip for pagination' + example: 0 + minimum: 0 + type: + - 'integer' + - 'null' + - description: 'Maximum number of records to return (max 100)' + in: 'query' + name: 'limit' + required: false + schema: + default: 50 + description: 'Maximum number of records to return (max 100)' + example: 50 + maximum: 100 + minimum: 1 + type: 'integer' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ListScimGroupsResponse' + description: 'List of SCIM groups' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'List SCIM groups' + tags: + - 'SCIM' + x-speakeasy-name-override: 'listGroups' + x-speakeasy-pagination: + inputs: + - in: 'parameters' + name: 'offset' + type: 'offset' + - in: 'parameters' + name: 'limit' + type: 'limit' + outputs: + results: '$.data' + type: 'offsetLimit' + parameters: + - $ref: "#/components/parameters/AppIdentifier" + - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" /videos: post: description: 'Submits a video generation request and returns a polling URL to check status' @@ -37222,6 +37813,8 @@ tags: name: 'Rerank' - description: 'OpenAI-compatible Responses API endpoints' name: 'Responses' + - description: 'SCIM endpoints' + name: 'SCIM' - description: 'Speech-to-text endpoints' name: 'STT' x-displayName: 'Transcriptions' diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 1b24a42be..c5c4007d0 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.787.0 sources: OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:06c9e3f7a6bd9098438e131ca4e31d4803ed53802f9e3c145b6e90307e03ad1f - sourceBlobDigest: sha256:21ecf9dff3934781ad7e407359cfbcdbc111bbe5fc3e41dc4a219990cdfd15b6 + sourceRevisionDigest: sha256:77546963660af6a48091e5a32e518b0a9816a664029a47199977cfc5bb0c27c0 + sourceBlobDigest: sha256:b4ab3d3690f9be643565383712d494a5b50e8910546d840b3e1a597a6ddeb1fe tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: openrouter: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:06c9e3f7a6bd9098438e131ca4e31d4803ed53802f9e3c145b6e90307e03ad1f - sourceBlobDigest: sha256:21ecf9dff3934781ad7e407359cfbcdbc111bbe5fc3e41dc4a219990cdfd15b6 + sourceRevisionDigest: sha256:77546963660af6a48091e5a32e518b0a9816a664029a47199977cfc5bb0c27c0 + sourceBlobDigest: sha256:b4ab3d3690f9be643565383712d494a5b50e8910546d840b3e1a597a6ddeb1fe codeSamplesNamespace: open-router-chat-completions-api-typescript-code-samples - codeSamplesRevisionDigest: sha256:08dd739ec44c5a4888ce1bbe6cd091ac2299e940b4d02fdceb26878f4bfd9f44 + codeSamplesRevisionDigest: sha256:e0c32a4dba91a48287a8d46fef1564a1b3b5fc40f6a4cb0cf73ce32f60f12ee3 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.787.0 diff --git a/docs/models/createscimgroupmappingrequest.mdx b/docs/models/createscimgroupmappingrequest.mdx new file mode 100644 index 000000000..26aacb96b --- /dev/null +++ b/docs/models/createscimgroupmappingrequest.mdx @@ -0,0 +1,23 @@ +--- +title: "CreateScimGroupMappingRequest" +--- + +## Example Usage + +```typescript +import { CreateScimGroupMappingRequest } from "@openrouter/sdk/models"; + +let value: CreateScimGroupMappingRequest = { + role: "admin", + scimGroupId: "fba433f4-bd04-4342-84b4-391cb2de7f2d", + workspaceId: "9879e2ef-f044-418a-aecd-84b6faa74f71", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `role` | [models.CreateScimGroupMappingRequestRole](../models/createscimgroupmappingrequestrole.mdx) | :heavy_check_mark: | N/A | +| `scimGroupId` | *string* | :heavy_check_mark: | N/A | +| `workspaceId` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/createscimgroupmappingrequestrole.mdx b/docs/models/createscimgroupmappingrequestrole.mdx new file mode 100644 index 000000000..46066c883 --- /dev/null +++ b/docs/models/createscimgroupmappingrequestrole.mdx @@ -0,0 +1,19 @@ +--- +title: "CreateScimGroupMappingRequestRole" +--- + +## Example Usage + +```typescript +import { CreateScimGroupMappingRequestRole } from "@openrouter/sdk/models"; + +let value: CreateScimGroupMappingRequestRole = "admin"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"admin" | "member" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/createscimgroupmappingresponse.mdx b/docs/models/createscimgroupmappingresponse.mdx new file mode 100644 index 000000000..5c0465f04 --- /dev/null +++ b/docs/models/createscimgroupmappingresponse.mdx @@ -0,0 +1,27 @@ +--- +title: "CreateScimGroupMappingResponse" +--- + +## Example Usage + +```typescript +import { CreateScimGroupMappingResponse } from "@openrouter/sdk/models"; + +let value: CreateScimGroupMappingResponse = { + data: { + createdAt: "2025-08-24T10:30:00.000Z", + id: "770e8400-e29b-41d4-a716-446655440000", + organizationId: "org_123456", + role: "member", + scimGroupId: "550e8400-e29b-41d4-a716-446655440000", + updatedAt: "2025-08-24T10:30:00.000Z", + workspaceId: "660e8400-e29b-41d4-a716-446655440000", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data` | [models.ScimGroupMapping](../models/scimgroupmapping.mdx) | :heavy_check_mark: | N/A | \{
"created_at": "2025-08-24T10:30:00.000Z",
"id": "770e8400-e29b-41d4-a716-446655440000",
"organization_id": "org_123456",
"role": "member",
"scim_group_id": "550e8400-e29b-41d4-a716-446655440000",
"updated_at": "2025-08-24T10:30:00.000Z",
"workspace_id": "660e8400-e29b-41d4-a716-446655440000"
} | \ No newline at end of file diff --git a/docs/models/deletescimgroupmappingresponse.mdx b/docs/models/deletescimgroupmappingresponse.mdx new file mode 100644 index 000000000..d5612ee0e --- /dev/null +++ b/docs/models/deletescimgroupmappingresponse.mdx @@ -0,0 +1,19 @@ +--- +title: "DeleteScimGroupMappingResponse" +--- + +## Example Usage + +```typescript +import { DeleteScimGroupMappingResponse } from "@openrouter/sdk/models"; + +let value: DeleteScimGroupMappingResponse = { + deleted: true, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `deleted` | *true* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/getscimgroupmappingresponse.mdx b/docs/models/getscimgroupmappingresponse.mdx new file mode 100644 index 000000000..391f00adb --- /dev/null +++ b/docs/models/getscimgroupmappingresponse.mdx @@ -0,0 +1,27 @@ +--- +title: "GetScimGroupMappingResponse" +--- + +## Example Usage + +```typescript +import { GetScimGroupMappingResponse } from "@openrouter/sdk/models"; + +let value: GetScimGroupMappingResponse = { + data: { + createdAt: "2025-08-24T10:30:00.000Z", + id: "770e8400-e29b-41d4-a716-446655440000", + organizationId: "org_123456", + role: "member", + scimGroupId: "550e8400-e29b-41d4-a716-446655440000", + updatedAt: "2025-08-24T10:30:00.000Z", + workspaceId: "660e8400-e29b-41d4-a716-446655440000", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data` | [models.ScimGroupMapping](../models/scimgroupmapping.mdx) | :heavy_check_mark: | N/A | \{
"created_at": "2025-08-24T10:30:00.000Z",
"id": "770e8400-e29b-41d4-a716-446655440000",
"organization_id": "org_123456",
"role": "member",
"scim_group_id": "550e8400-e29b-41d4-a716-446655440000",
"updated_at": "2025-08-24T10:30:00.000Z",
"workspace_id": "660e8400-e29b-41d4-a716-446655440000"
} | \ No newline at end of file diff --git a/docs/models/listscimgroupmappingsresponse.mdx b/docs/models/listscimgroupmappingsresponse.mdx new file mode 100644 index 000000000..ae2d4e298 --- /dev/null +++ b/docs/models/listscimgroupmappingsresponse.mdx @@ -0,0 +1,31 @@ +--- +title: "ListScimGroupMappingsResponse" +--- + +## Example Usage + +```typescript +import { ListScimGroupMappingsResponse } from "@openrouter/sdk/models"; + +let value: ListScimGroupMappingsResponse = { + data: [ + { + createdAt: "2025-08-24T10:30:00.000Z", + id: "770e8400-e29b-41d4-a716-446655440000", + organizationId: "org_123456", + role: "member", + scimGroupId: "550e8400-e29b-41d4-a716-446655440000", + updatedAt: "2025-08-24T10:30:00.000Z", + workspaceId: "660e8400-e29b-41d4-a716-446655440000", + }, + ], + totalCount: 318254, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `data` | [models.ScimGroupMapping](../models/scimgroupmapping.mdx)[] | :heavy_check_mark: | N/A | +| `totalCount` | *number* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/listscimgroupsresponse.mdx b/docs/models/listscimgroupsresponse.mdx new file mode 100644 index 000000000..fa43be61a --- /dev/null +++ b/docs/models/listscimgroupsresponse.mdx @@ -0,0 +1,30 @@ +--- +title: "ListScimGroupsResponse" +--- + +## Example Usage + +```typescript +import { ListScimGroupsResponse } from "@openrouter/sdk/models"; + +let value: ListScimGroupsResponse = { + data: [ + { + createdAt: "2025-08-24T10:30:00.000Z", + displayName: "Engineering", + externalId: "group-external-id", + id: "550e8400-e29b-41d4-a716-446655440000", + organizationId: "org_123456", + updatedAt: "2025-08-24T10:30:00.000Z", + }, + ], + totalCount: 39923, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `data` | [models.ScimGroup](../models/scimgroup.mdx)[] | :heavy_check_mark: | N/A | +| `totalCount` | *number* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/createscimgroupmappingglobals.mdx b/docs/models/operations/createscimgroupmappingglobals.mdx new file mode 100644 index 000000000..8e4f19d43 --- /dev/null +++ b/docs/models/operations/createscimgroupmappingglobals.mdx @@ -0,0 +1,19 @@ +--- +title: "CreateScimGroupMappingGlobals" +--- + +## Example Usage + +```typescript +import { CreateScimGroupMappingGlobals } from "@openrouter/sdk/models/operations"; + +let value: CreateScimGroupMappingGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `httpReferer` | *string* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `appTitle` | *string* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `appCategories` | *string* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/models/operations/createscimgroupmappingrequest.mdx b/docs/models/operations/createscimgroupmappingrequest.mdx new file mode 100644 index 000000000..6796ca9b7 --- /dev/null +++ b/docs/models/operations/createscimgroupmappingrequest.mdx @@ -0,0 +1,26 @@ +--- +title: "CreateScimGroupMappingRequest" +--- + +## Example Usage + +```typescript +import { CreateScimGroupMappingRequest } from "@openrouter/sdk/models/operations"; + +let value: CreateScimGroupMappingRequest = { + createScimGroupMappingRequest: { + role: "admin", + scimGroupId: "fba433f4-bd04-4342-84b4-391cb2de7f2d", + workspaceId: "9879e2ef-f044-418a-aecd-84b6faa74f71", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `httpReferer` | *string* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `appTitle` | *string* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `appCategories` | *string* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| +| `createScimGroupMappingRequest` | [models.CreateScimGroupMappingRequest](../../models/createscimgroupmappingrequest.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/deletescimgroupmappingglobals.mdx b/docs/models/operations/deletescimgroupmappingglobals.mdx new file mode 100644 index 000000000..4eeafa3e5 --- /dev/null +++ b/docs/models/operations/deletescimgroupmappingglobals.mdx @@ -0,0 +1,19 @@ +--- +title: "DeleteScimGroupMappingGlobals" +--- + +## Example Usage + +```typescript +import { DeleteScimGroupMappingGlobals } from "@openrouter/sdk/models/operations"; + +let value: DeleteScimGroupMappingGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `httpReferer` | *string* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `appTitle` | *string* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `appCategories` | *string* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/models/operations/deletescimgroupmappingrequest.mdx b/docs/models/operations/deletescimgroupmappingrequest.mdx new file mode 100644 index 000000000..cf6f3f55f --- /dev/null +++ b/docs/models/operations/deletescimgroupmappingrequest.mdx @@ -0,0 +1,24 @@ +--- +title: "DeleteScimGroupMappingRequest" +--- + +## Example Usage + +```typescript +import { DeleteScimGroupMappingRequest } from "@openrouter/sdk/models/operations"; + +let value: DeleteScimGroupMappingRequest = { + id: "2210fac9-1a69-402d-867a-d6080dba1059", + keepMembers: false, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `httpReferer` | *string* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `appTitle` | *string* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `appCategories` | *string* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `id` | *string* | :heavy_check_mark: | N/A | | +| `keepMembers` | *operations.KeepMembers* | :heavy_check_mark: | Required. Whether to keep workspace members after deleting the mapping. `false` **removes** the members this mapping granted access to; `true` deletes the mapping while leaving membership intact as manually-managed. There is deliberately no default — omitting it returns `400` so the destructive path cannot be reached by accident. Mirrors the dashboard, whose `DeleteMappingSchema.keepMembers` is likewise required. | false | \ No newline at end of file diff --git a/docs/models/operations/getscimgroupmappingglobals.mdx b/docs/models/operations/getscimgroupmappingglobals.mdx new file mode 100644 index 000000000..1f8c3b91c --- /dev/null +++ b/docs/models/operations/getscimgroupmappingglobals.mdx @@ -0,0 +1,19 @@ +--- +title: "GetScimGroupMappingGlobals" +--- + +## Example Usage + +```typescript +import { GetScimGroupMappingGlobals } from "@openrouter/sdk/models/operations"; + +let value: GetScimGroupMappingGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `httpReferer` | *string* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `appTitle` | *string* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `appCategories` | *string* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/models/operations/getscimgroupmappingrequest.mdx b/docs/models/operations/getscimgroupmappingrequest.mdx new file mode 100644 index 000000000..3da57c247 --- /dev/null +++ b/docs/models/operations/getscimgroupmappingrequest.mdx @@ -0,0 +1,22 @@ +--- +title: "GetScimGroupMappingRequest" +--- + +## Example Usage + +```typescript +import { GetScimGroupMappingRequest } from "@openrouter/sdk/models/operations"; + +let value: GetScimGroupMappingRequest = { + id: "aa27a2b5-be56-4523-857e-78847ac4e510", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `httpReferer` | *string* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `appTitle` | *string* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `appCategories` | *string* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| +| `id` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/keepmembers.mdx b/docs/models/operations/keepmembers.mdx new file mode 100644 index 000000000..9a752b176 --- /dev/null +++ b/docs/models/operations/keepmembers.mdx @@ -0,0 +1,21 @@ +--- +title: "KeepMembers" +--- + +Required. Whether to keep workspace members after deleting the mapping. `false` **removes** the members this mapping granted access to; `true` deletes the mapping while leaving membership intact as manually-managed. There is deliberately no default — omitting it returns `400` so the destructive path cannot be reached by accident. Mirrors the dashboard, whose `DeleteMappingSchema.keepMembers` is likewise required. + + +## Supported Types + +### `operations.KeepMembersEnum` + +```typescript +const value: operations.KeepMembersEnum = "false"; +``` + +### `boolean` + +```typescript +const value: boolean = false; +``` + diff --git a/docs/models/operations/keepmembersenum.mdx b/docs/models/operations/keepmembersenum.mdx new file mode 100644 index 000000000..300c07bd4 --- /dev/null +++ b/docs/models/operations/keepmembersenum.mdx @@ -0,0 +1,19 @@ +--- +title: "KeepMembersEnum" +--- + +## Example Usage + +```typescript +import { KeepMembersEnum } from "@openrouter/sdk/models/operations"; + +let value: KeepMembersEnum = "true"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"true" | "false" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/operations/listscimgroupmappingsglobals.mdx b/docs/models/operations/listscimgroupmappingsglobals.mdx new file mode 100644 index 000000000..0acbeefa7 --- /dev/null +++ b/docs/models/operations/listscimgroupmappingsglobals.mdx @@ -0,0 +1,19 @@ +--- +title: "ListScimGroupMappingsGlobals" +--- + +## Example Usage + +```typescript +import { ListScimGroupMappingsGlobals } from "@openrouter/sdk/models/operations"; + +let value: ListScimGroupMappingsGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `httpReferer` | *string* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `appTitle` | *string* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `appCategories` | *string* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/models/operations/listscimgroupmappingsrequest.mdx b/docs/models/operations/listscimgroupmappingsrequest.mdx new file mode 100644 index 000000000..4ba06ce8a --- /dev/null +++ b/docs/models/operations/listscimgroupmappingsrequest.mdx @@ -0,0 +1,21 @@ +--- +title: "ListScimGroupMappingsRequest" +--- + +## Example Usage + +```typescript +import { ListScimGroupMappingsRequest } from "@openrouter/sdk/models/operations"; + +let value: ListScimGroupMappingsRequest = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `httpReferer` | *string* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `appTitle` | *string* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `appCategories` | *string* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `offset` | *number* | :heavy_minus_sign: | Number of records to skip for pagination | 0 | +| `limit` | *number* | :heavy_minus_sign: | Maximum number of records to return (max 100) | 50 | \ No newline at end of file diff --git a/docs/models/operations/listscimgroupmappingsresponse.mdx b/docs/models/operations/listscimgroupmappingsresponse.mdx new file mode 100644 index 000000000..3a13488f7 --- /dev/null +++ b/docs/models/operations/listscimgroupmappingsresponse.mdx @@ -0,0 +1,32 @@ +--- +title: "ListScimGroupMappingsResponse" +--- + +## Example Usage + +```typescript +import { ListScimGroupMappingsResponse } from "@openrouter/sdk/models/operations"; + +let value: ListScimGroupMappingsResponse = { + result: { + data: [ + { + createdAt: "2025-08-24T10:30:00.000Z", + id: "770e8400-e29b-41d4-a716-446655440000", + organizationId: "org_123456", + role: "member", + scimGroupId: "550e8400-e29b-41d4-a716-446655440000", + updatedAt: "2025-08-24T10:30:00.000Z", + workspaceId: "660e8400-e29b-41d4-a716-446655440000", + }, + ], + totalCount: 318254, + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `result` | [models.ListScimGroupMappingsResponse](../../models/listscimgroupmappingsresponse.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listscimgroupsglobals.mdx b/docs/models/operations/listscimgroupsglobals.mdx new file mode 100644 index 000000000..b37da4046 --- /dev/null +++ b/docs/models/operations/listscimgroupsglobals.mdx @@ -0,0 +1,19 @@ +--- +title: "ListScimGroupsGlobals" +--- + +## Example Usage + +```typescript +import { ListScimGroupsGlobals } from "@openrouter/sdk/models/operations"; + +let value: ListScimGroupsGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `httpReferer` | *string* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `appTitle` | *string* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `appCategories` | *string* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/models/operations/listscimgroupsrequest.mdx b/docs/models/operations/listscimgroupsrequest.mdx new file mode 100644 index 000000000..8830c941f --- /dev/null +++ b/docs/models/operations/listscimgroupsrequest.mdx @@ -0,0 +1,21 @@ +--- +title: "ListScimGroupsRequest" +--- + +## Example Usage + +```typescript +import { ListScimGroupsRequest } from "@openrouter/sdk/models/operations"; + +let value: ListScimGroupsRequest = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `httpReferer` | *string* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `appTitle` | *string* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `appCategories` | *string* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `offset` | *number* | :heavy_minus_sign: | Number of records to skip for pagination | 0 | +| `limit` | *number* | :heavy_minus_sign: | Maximum number of records to return (max 100) | 50 | \ No newline at end of file diff --git a/docs/models/operations/listscimgroupsresponse.mdx b/docs/models/operations/listscimgroupsresponse.mdx new file mode 100644 index 000000000..7bd81456b --- /dev/null +++ b/docs/models/operations/listscimgroupsresponse.mdx @@ -0,0 +1,31 @@ +--- +title: "ListScimGroupsResponse" +--- + +## Example Usage + +```typescript +import { ListScimGroupsResponse } from "@openrouter/sdk/models/operations"; + +let value: ListScimGroupsResponse = { + result: { + data: [ + { + createdAt: "2025-08-24T10:30:00.000Z", + displayName: "Engineering", + externalId: "group-external-id", + id: "550e8400-e29b-41d4-a716-446655440000", + organizationId: "org_123456", + updatedAt: "2025-08-24T10:30:00.000Z", + }, + ], + totalCount: 39923, + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `result` | [models.ListScimGroupsResponse](../../models/listscimgroupsresponse.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/updatescimgroupmappingglobals.mdx b/docs/models/operations/updatescimgroupmappingglobals.mdx new file mode 100644 index 000000000..36279eadd --- /dev/null +++ b/docs/models/operations/updatescimgroupmappingglobals.mdx @@ -0,0 +1,19 @@ +--- +title: "UpdateScimGroupMappingGlobals" +--- + +## Example Usage + +```typescript +import { UpdateScimGroupMappingGlobals } from "@openrouter/sdk/models/operations"; + +let value: UpdateScimGroupMappingGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `httpReferer` | *string* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `appTitle` | *string* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `appCategories` | *string* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/models/operations/updatescimgroupmappingrequest.mdx b/docs/models/operations/updatescimgroupmappingrequest.mdx new file mode 100644 index 000000000..9e03f03f1 --- /dev/null +++ b/docs/models/operations/updatescimgroupmappingrequest.mdx @@ -0,0 +1,26 @@ +--- +title: "UpdateScimGroupMappingRequest" +--- + +## Example Usage + +```typescript +import { UpdateScimGroupMappingRequest } from "@openrouter/sdk/models/operations"; + +let value: UpdateScimGroupMappingRequest = { + id: "b6bc13f9-8d4e-4861-8a73-2065e73954c7", + updateScimGroupMappingRequest: { + role: "admin", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `httpReferer` | *string* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `appTitle` | *string* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `appCategories` | *string* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| +| `id` | *string* | :heavy_check_mark: | N/A | +| `updateScimGroupMappingRequest` | [models.UpdateScimGroupMappingRequest](../../models/updatescimgroupmappingrequest.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/scimgroup.mdx b/docs/models/scimgroup.mdx new file mode 100644 index 000000000..d6b892786 --- /dev/null +++ b/docs/models/scimgroup.mdx @@ -0,0 +1,29 @@ +--- +title: "ScimGroup" +--- + +## Example Usage + +```typescript +import { ScimGroup } from "@openrouter/sdk/models"; + +let value: ScimGroup = { + createdAt: "2025-08-24T10:30:00.000Z", + displayName: "Engineering", + externalId: "group-external-id", + id: "550e8400-e29b-41d4-a716-446655440000", + organizationId: "org_123456", + updatedAt: "2025-08-24T10:30:00.000Z", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `createdAt` | *string* | :heavy_check_mark: | N/A | +| `displayName` | *string* | :heavy_check_mark: | N/A | +| `externalId` | *string* | :heavy_check_mark: | N/A | +| `id` | *string* | :heavy_check_mark: | N/A | +| `organizationId` | *string* | :heavy_check_mark: | N/A | +| `updatedAt` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/scimgroupmapping.mdx b/docs/models/scimgroupmapping.mdx new file mode 100644 index 000000000..66d93ea69 --- /dev/null +++ b/docs/models/scimgroupmapping.mdx @@ -0,0 +1,31 @@ +--- +title: "ScimGroupMapping" +--- + +## Example Usage + +```typescript +import { ScimGroupMapping } from "@openrouter/sdk/models"; + +let value: ScimGroupMapping = { + createdAt: "2025-08-24T10:30:00.000Z", + id: "770e8400-e29b-41d4-a716-446655440000", + organizationId: "org_123456", + role: "member", + scimGroupId: "550e8400-e29b-41d4-a716-446655440000", + updatedAt: "2025-08-24T10:30:00.000Z", + workspaceId: "660e8400-e29b-41d4-a716-446655440000", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `createdAt` | *string* | :heavy_check_mark: | N/A | +| `id` | *string* | :heavy_check_mark: | N/A | +| `organizationId` | *string* | :heavy_check_mark: | N/A | +| `role` | [models.ScimGroupMappingRole](../models/scimgroupmappingrole.mdx) | :heavy_check_mark: | N/A | +| `scimGroupId` | *string* | :heavy_check_mark: | N/A | +| `updatedAt` | *string* | :heavy_check_mark: | N/A | +| `workspaceId` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/scimgroupmappingrole.mdx b/docs/models/scimgroupmappingrole.mdx new file mode 100644 index 000000000..b0e19d296 --- /dev/null +++ b/docs/models/scimgroupmappingrole.mdx @@ -0,0 +1,19 @@ +--- +title: "ScimGroupMappingRole" +--- + +## Example Usage + +```typescript +import { ScimGroupMappingRole } from "@openrouter/sdk/models"; + +let value: ScimGroupMappingRole = "admin"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"admin" | "member" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/updatescimgroupmappingrequest.mdx b/docs/models/updatescimgroupmappingrequest.mdx new file mode 100644 index 000000000..95e957e93 --- /dev/null +++ b/docs/models/updatescimgroupmappingrequest.mdx @@ -0,0 +1,19 @@ +--- +title: "UpdateScimGroupMappingRequest" +--- + +## Example Usage + +```typescript +import { UpdateScimGroupMappingRequest } from "@openrouter/sdk/models"; + +let value: UpdateScimGroupMappingRequest = { + role: "member", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `role` | [models.UpdateScimGroupMappingRequestRole](../models/updatescimgroupmappingrequestrole.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/updatescimgroupmappingrequestrole.mdx b/docs/models/updatescimgroupmappingrequestrole.mdx new file mode 100644 index 000000000..f90140caf --- /dev/null +++ b/docs/models/updatescimgroupmappingrequestrole.mdx @@ -0,0 +1,19 @@ +--- +title: "UpdateScimGroupMappingRequestRole" +--- + +## Example Usage + +```typescript +import { UpdateScimGroupMappingRequestRole } from "@openrouter/sdk/models"; + +let value: UpdateScimGroupMappingRequestRole = "admin"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"admin" | "member" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/updatescimgroupmappingresponse.mdx b/docs/models/updatescimgroupmappingresponse.mdx new file mode 100644 index 000000000..c1bd39dfd --- /dev/null +++ b/docs/models/updatescimgroupmappingresponse.mdx @@ -0,0 +1,27 @@ +--- +title: "UpdateScimGroupMappingResponse" +--- + +## Example Usage + +```typescript +import { UpdateScimGroupMappingResponse } from "@openrouter/sdk/models"; + +let value: UpdateScimGroupMappingResponse = { + data: { + createdAt: "2025-08-24T10:30:00.000Z", + id: "770e8400-e29b-41d4-a716-446655440000", + organizationId: "org_123456", + role: "member", + scimGroupId: "550e8400-e29b-41d4-a716-446655440000", + updatedAt: "2025-08-24T10:30:00.000Z", + workspaceId: "660e8400-e29b-41d4-a716-446655440000", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data` | [models.ScimGroupMapping](../models/scimgroupmapping.mdx) | :heavy_check_mark: | N/A | \{
"created_at": "2025-08-24T10:30:00.000Z",
"id": "770e8400-e29b-41d4-a716-446655440000",
"organization_id": "org_123456",
"role": "member",
"scim_group_id": "550e8400-e29b-41d4-a716-446655440000",
"updated_at": "2025-08-24T10:30:00.000Z",
"workspace_id": "660e8400-e29b-41d4-a716-446655440000"
} | \ No newline at end of file diff --git a/docs/sdks/scim/README.mdx b/docs/sdks/scim/README.mdx new file mode 100644 index 000000000..d2e02007b --- /dev/null +++ b/docs/sdks/scim/README.mdx @@ -0,0 +1,523 @@ +--- +title: "Scim" +description: "SCIM endpoints" +--- + +## Overview + +SCIM endpoints + +### Available Operations + +* [listMappings](#listmappings) - List SCIM group mappings +* [create](#create) - Create a SCIM group mapping +* [delete](#delete) - Delete a SCIM group mapping +* [read](#read) - Get a SCIM group mapping +* [update](#update) - Update a SCIM group mapping +* [listGroups](#listgroups) - List SCIM groups + +## listMappings + +List SCIM group-to-workspace mappings for the organization. [Management key](/docs/guides/overview/auth/management-api-keys) required. + +### Example Usage + +```typescript +import { OpenRouter } from "@openrouter/sdk"; + +const openRouter = new OpenRouter({ + httpReferer: "", + appTitle: "", + appCategories: "", + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const result = await openRouter.scim.listMappings(); + + for await (const page of result) { + console.log(page); + } +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { OpenRouterCore } from "@openrouter/sdk/core.js"; +import { scimListMappings } from "@openrouter/sdk/funcs/scimListMappings.js"; + +// Use `OpenRouterCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const openRouter = new OpenRouterCore({ + httpReferer: "", + appTitle: "", + appCategories: "", + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const res = await scimListMappings(openRouter); + if (res.ok) { + const { value: result } = res; + for await (const page of result) { + console.log(page); + } + } else { + console.log("scimListMappings failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListScimGroupMappingsRequest](../../models/operations/listscimgroupmappingsrequest.mdx) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.ListScimGroupMappingsResponse](../../models/operations/listscimgroupmappingsresponse.mdx)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.NotFoundResponseError | 404 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## create + +Create a SCIM group-to-workspace role mapping. [Management key](/docs/guides/overview/auth/management-api-keys) required. + +### Example Usage + +```typescript +import { OpenRouter } from "@openrouter/sdk"; + +const openRouter = new OpenRouter({ + httpReferer: "", + appTitle: "", + appCategories: "", + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const result = await openRouter.scim.create({ + createScimGroupMappingRequest: { + role: "admin", + scimGroupId: "ecdda85d-40dc-4ed7-9955-2bf12128e7da", + workspaceId: "d5a84a53-ce30-4057-ab5e-bd7b45553567", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { OpenRouterCore } from "@openrouter/sdk/core.js"; +import { scimCreate } from "@openrouter/sdk/funcs/scimCreate.js"; + +// Use `OpenRouterCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const openRouter = new OpenRouterCore({ + httpReferer: "", + appTitle: "", + appCategories: "", + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const res = await scimCreate(openRouter, { + createScimGroupMappingRequest: { + role: "admin", + scimGroupId: "ecdda85d-40dc-4ed7-9955-2bf12128e7da", + workspaceId: "d5a84a53-ce30-4057-ab5e-bd7b45553567", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("scimCreate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateScimGroupMappingRequest](../../models/operations/createscimgroupmappingrequest.mdx) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[models.CreateScimGroupMappingResponse](../../models/createscimgroupmappingresponse.mdx)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.BadRequestResponseError | 400 | application/json | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.NotFoundResponseError | 404 | application/json | +| errors.ConflictResponseError | 409 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## delete + +Delete a SCIM group-to-workspace mapping. [Management key](/docs/guides/overview/auth/management-api-keys) required. + +### Example Usage + +```typescript +import { OpenRouter } from "@openrouter/sdk"; + +const openRouter = new OpenRouter({ + httpReferer: "", + appTitle: "", + appCategories: "", + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const result = await openRouter.scim.delete({ + id: "ef7219ae-c495-43b3-b46b-52bf82772570", + keepMembers: false, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { OpenRouterCore } from "@openrouter/sdk/core.js"; +import { scimDelete } from "@openrouter/sdk/funcs/scimDelete.js"; + +// Use `OpenRouterCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const openRouter = new OpenRouterCore({ + httpReferer: "", + appTitle: "", + appCategories: "", + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const res = await scimDelete(openRouter, { + id: "ef7219ae-c495-43b3-b46b-52bf82772570", + keepMembers: false, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("scimDelete failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.DeleteScimGroupMappingRequest](../../models/operations/deletescimgroupmappingrequest.mdx) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[models.DeleteScimGroupMappingResponse](../../models/deletescimgroupmappingresponse.mdx)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.BadRequestResponseError | 400 | application/json | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.NotFoundResponseError | 404 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## read + +Get a SCIM group-to-workspace mapping. [Management key](/docs/guides/overview/auth/management-api-keys) required. + +### Example Usage + +```typescript +import { OpenRouter } from "@openrouter/sdk"; + +const openRouter = new OpenRouter({ + httpReferer: "", + appTitle: "", + appCategories: "", + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const result = await openRouter.scim.read({ + id: "aca4d64d-fff7-419d-a8ae-3ec5ab8a0c1e", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { OpenRouterCore } from "@openrouter/sdk/core.js"; +import { scimRead } from "@openrouter/sdk/funcs/scimRead.js"; + +// Use `OpenRouterCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const openRouter = new OpenRouterCore({ + httpReferer: "", + appTitle: "", + appCategories: "", + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const res = await scimRead(openRouter, { + id: "aca4d64d-fff7-419d-a8ae-3ec5ab8a0c1e", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("scimRead failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetScimGroupMappingRequest](../../models/operations/getscimgroupmappingrequest.mdx) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[models.GetScimGroupMappingResponse](../../models/getscimgroupmappingresponse.mdx)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.NotFoundResponseError | 404 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## update + +Update a SCIM group mapping role. [Management key](/docs/guides/overview/auth/management-api-keys) required. + +### Example Usage + +```typescript +import { OpenRouter } from "@openrouter/sdk"; + +const openRouter = new OpenRouter({ + httpReferer: "", + appTitle: "", + appCategories: "", + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const result = await openRouter.scim.update({ + id: "361a9698-8c34-4cbb-b0be-f6fd47094a30", + updateScimGroupMappingRequest: { + role: "member", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { OpenRouterCore } from "@openrouter/sdk/core.js"; +import { scimUpdate } from "@openrouter/sdk/funcs/scimUpdate.js"; + +// Use `OpenRouterCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const openRouter = new OpenRouterCore({ + httpReferer: "", + appTitle: "", + appCategories: "", + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const res = await scimUpdate(openRouter, { + id: "361a9698-8c34-4cbb-b0be-f6fd47094a30", + updateScimGroupMappingRequest: { + role: "member", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("scimUpdate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.UpdateScimGroupMappingRequest](../../models/operations/updatescimgroupmappingrequest.mdx) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[models.UpdateScimGroupMappingResponse](../../models/updatescimgroupmappingresponse.mdx)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.BadRequestResponseError | 400 | application/json | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.NotFoundResponseError | 404 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## listGroups + +List SCIM groups for the organization. [Management key](/docs/guides/overview/auth/management-api-keys) required. + +### Example Usage + +```typescript +import { OpenRouter } from "@openrouter/sdk"; + +const openRouter = new OpenRouter({ + httpReferer: "", + appTitle: "", + appCategories: "", + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const result = await openRouter.scim.listGroups(); + + for await (const page of result) { + console.log(page); + } +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { OpenRouterCore } from "@openrouter/sdk/core.js"; +import { scimListGroups } from "@openrouter/sdk/funcs/scimListGroups.js"; + +// Use `OpenRouterCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const openRouter = new OpenRouterCore({ + httpReferer: "", + appTitle: "", + appCategories: "", + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const res = await scimListGroups(openRouter); + if (res.ok) { + const { value: result } = res; + for await (const page of result) { + console.log(page); + } + } else { + console.log("scimListGroups failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListScimGroupsRequest](../../models/operations/listscimgroupsrequest.mdx) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.ListScimGroupsResponse](../../models/operations/listscimgroupsresponse.mdx)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.NotFoundResponseError | 404 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/jsr.json b/jsr.json index 041aba976..2488b59b1 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@openrouter/sdk", - "version": "1.1.25", + "version": "1.2.0", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package.json b/package.json index 0ebb5392e..f5ff8c04f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openrouter/sdk", - "version": "1.1.25", + "version": "1.2.0", "author": "OpenRouter", "description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 400+ language models through a unified API.", "keywords": [ @@ -73,13 +73,13 @@ "lint": "eslint --cache --max-warnings=0 src", "build": "tsc", "prepublishOnly": "npm run build", + "test:watch": "vitest --watch --project unit", + "typecheck": "tsc --noEmit", "postinstall": "node scripts/check-types.js || true", "prepare": "npm run build", "test": "vitest --run --project unit", - "test:transit": "exit 0", "test:e2e": "vitest --run --project e2e", - "test:watch": "vitest --watch --project unit", - "typecheck": "tsc --noEmit", + "test:transit": "exit 0", "typecheck:transit": "exit 0", "compile": "tsc" }, diff --git a/src/funcs/scimCreate.ts b/src/funcs/scimCreate.ts new file mode 100644 index 000000000..dfca7e65e --- /dev/null +++ b/src/funcs/scimCreate.ts @@ -0,0 +1,217 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: a8ea14125a34 + */ + +import { OpenRouterCore } from "../core.js"; +import { encodeJSON, encodeSimple } from "../lib/encodings.js"; +import { matchStatusCode } from "../lib/http.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { OpenRouterError } from "../models/errors/openroutererror.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as models from "../models/index.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Create a SCIM group mapping + * + * @remarks + * Create a SCIM group-to-workspace role mapping. [Management key](/docs/guides/overview/auth/management-api-keys) required. + */ +export function scimCreate( + client: OpenRouterCore, + request: operations.CreateScimGroupMappingRequest, + options?: RequestOptions, +): APIPromise< + Result< + models.CreateScimGroupMappingResponse, + | errors.BadRequestResponseError + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.ConflictResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: OpenRouterCore, + request: operations.CreateScimGroupMappingRequest, + options?: RequestOptions, +): Promise< + [ + Result< + models.CreateScimGroupMappingResponse, + | errors.BadRequestResponseError + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.ConflictResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + operations.CreateScimGroupMappingRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = encodeJSON("body", payload.CreateScimGroupMappingRequest, { + explode: true, + }); + + const path = pathToFunc("/scim/group-mappings")(); + + const headers = new Headers(compactMap({ + "Content-Type": "application/json", + Accept: "application/json", + "HTTP-Referer": encodeSimple( + "HTTP-Referer", + payload["HTTP-Referer"] ?? client._options.httpReferer, + { explode: false, charEncoding: "none" }, + ), + "X-OpenRouter-Categories": encodeSimple( + "X-OpenRouter-Categories", + payload.appCategories ?? client._options.appCategories, + { explode: false, charEncoding: "none" }, + ), + "X-OpenRouter-Title": encodeSimple( + "X-OpenRouter-Title", + payload.appTitle ?? client._options.appTitle, + { explode: false, charEncoding: "none" }, + ), + })); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "createScimGroupMapping", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + } + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["5XX"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "POST", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + isErrorStatusCode: (statusCode: number) => + matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + models.CreateScimGroupMappingResponse, + | errors.BadRequestResponseError + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.ConflictResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(201, models.CreateScimGroupMappingResponse$inboundSchema), + M.jsonErr(400, errors.BadRequestResponseError$inboundSchema), + M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), + M.jsonErr(404, errors.NotFoundResponseError$inboundSchema), + M.jsonErr(409, errors.ConflictResponseError$inboundSchema), + M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/scimDelete.ts b/src/funcs/scimDelete.ts new file mode 100644 index 000000000..375fd5d1f --- /dev/null +++ b/src/funcs/scimDelete.ts @@ -0,0 +1,221 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 441ae3f88a98 + */ + +import { OpenRouterCore } from "../core.js"; +import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; +import { matchStatusCode } from "../lib/http.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { OpenRouterError } from "../models/errors/openroutererror.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as models from "../models/index.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Delete a SCIM group mapping + * + * @remarks + * Delete a SCIM group-to-workspace mapping. [Management key](/docs/guides/overview/auth/management-api-keys) required. + */ +export function scimDelete( + client: OpenRouterCore, + request: operations.DeleteScimGroupMappingRequest, + options?: RequestOptions, +): APIPromise< + Result< + models.DeleteScimGroupMappingResponse, + | errors.BadRequestResponseError + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: OpenRouterCore, + request: operations.DeleteScimGroupMappingRequest, + options?: RequestOptions, +): Promise< + [ + Result< + models.DeleteScimGroupMappingResponse, + | errors.BadRequestResponseError + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + operations.DeleteScimGroupMappingRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const pathParams = { + id: encodeSimple("id", payload.id, { + explode: false, + charEncoding: "percent", + }), + }; + const path = pathToFunc("/scim/group-mappings/{id}")(pathParams); + + const query = encodeFormQuery({ + "keep_members": payload.keep_members, + }); + + const headers = new Headers(compactMap({ + Accept: "application/json", + "HTTP-Referer": encodeSimple( + "HTTP-Referer", + payload["HTTP-Referer"] ?? client._options.httpReferer, + { explode: false, charEncoding: "none" }, + ), + "X-OpenRouter-Categories": encodeSimple( + "X-OpenRouter-Categories", + payload.appCategories ?? client._options.appCategories, + { explode: false, charEncoding: "none" }, + ), + "X-OpenRouter-Title": encodeSimple( + "X-OpenRouter-Title", + payload.appTitle ?? client._options.appTitle, + { explode: false, charEncoding: "none" }, + ), + })); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "deleteScimGroupMapping", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + } + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["5XX"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "DELETE", + baseURL: options?.serverURL, + path: path, + headers: headers, + query: query, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + isErrorStatusCode: (statusCode: number) => + matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + models.DeleteScimGroupMappingResponse, + | errors.BadRequestResponseError + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, models.DeleteScimGroupMappingResponse$inboundSchema), + M.jsonErr(400, errors.BadRequestResponseError$inboundSchema), + M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), + M.jsonErr(404, errors.NotFoundResponseError$inboundSchema), + M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/scimListGroups.ts b/src/funcs/scimListGroups.ts new file mode 100644 index 000000000..454e25170 --- /dev/null +++ b/src/funcs/scimListGroups.ts @@ -0,0 +1,283 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: bf94e6973603 + */ + +import { OpenRouterCore } from "../core.js"; +import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; +import { matchStatusCode } from "../lib/http.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { OpenRouterError } from "../models/errors/openroutererror.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; +import { + createPageIterator, + haltIterator, + PageIterator, + Paginator, +} from "../types/operations.js"; + +/** + * List SCIM groups + * + * @remarks + * List SCIM groups for the organization. [Management key](/docs/guides/overview/auth/management-api-keys) required. + */ +export function scimListGroups( + client: OpenRouterCore, + request?: operations.ListScimGroupsRequest | undefined, + options?: RequestOptions, +): APIPromise< + PageIterator< + Result< + operations.ListScimGroupsResponse, + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + { offset: number } + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: OpenRouterCore, + request?: operations.ListScimGroupsRequest | undefined, + options?: RequestOptions, +): Promise< + [ + PageIterator< + Result< + operations.ListScimGroupsResponse, + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + { offset: number } + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + operations.ListScimGroupsRequest$outboundSchema.optional().parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [haltIterator(parsed), { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const path = pathToFunc("/scim/groups")(); + + const query = encodeFormQuery({ + "limit": payload?.limit, + "offset": payload?.offset, + }); + + const headers = new Headers(compactMap({ + Accept: "application/json", + "HTTP-Referer": encodeSimple( + "HTTP-Referer", + payload?.["HTTP-Referer"] ?? client._options.httpReferer, + { explode: false, charEncoding: "none" }, + ), + "X-OpenRouter-Categories": encodeSimple( + "X-OpenRouter-Categories", + payload?.appCategories ?? client._options.appCategories, + { explode: false, charEncoding: "none" }, + ), + "X-OpenRouter-Title": encodeSimple( + "X-OpenRouter-Title", + payload?.appTitle ?? client._options.appTitle, + { explode: false, charEncoding: "none" }, + ), + })); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "listScimGroups", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + } + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["5XX"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + baseURL: options?.serverURL, + path: path, + headers: headers, + query: query, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [haltIterator(requestRes), { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + isErrorStatusCode: (statusCode: number) => + matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [haltIterator(doResult), { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result, raw] = await M.match< + operations.ListScimGroupsResponse, + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, operations.ListScimGroupsResponse$inboundSchema, { + key: "Result", + }), + M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), + M.jsonErr(404, errors.NotFoundResponseError$inboundSchema), + M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [haltIterator(result), { + status: "complete", + request: req, + response, + }]; + } + + const nextFunc = ( + responseData: unknown, + ): { + next: Paginator< + Result< + operations.ListScimGroupsResponse, + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > + >; + "~next"?: { offset: number }; + } => { + const offset = request?.offset ?? 0; + + if (!responseData) { + return { next: () => null }; + } + const results = (responseData as { data: unknown }).data; + if (!Array.isArray(results) || !results.length) { + return { next: () => null }; + } + const limit = request?.limit ?? 50; + if (results.length < limit) { + return { next: () => null }; + } + const nextOffset = offset + results.length; + + const nextVal = () => + scimListGroups( + client, + { + ...request!, + offset: nextOffset, + }, + options, + ); + + return { next: nextVal, "~next": { offset: nextOffset } }; + }; + + const page = { ...result, ...nextFunc(raw) }; + return [{ ...page, ...createPageIterator(page, (v) => !v.ok) }, { + status: "complete", + request: req, + response, + }]; +} diff --git a/src/funcs/scimListMappings.ts b/src/funcs/scimListMappings.ts new file mode 100644 index 000000000..bbf986bae --- /dev/null +++ b/src/funcs/scimListMappings.ts @@ -0,0 +1,285 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 5c9fe26dc2ff + */ + +import { OpenRouterCore } from "../core.js"; +import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; +import { matchStatusCode } from "../lib/http.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { OpenRouterError } from "../models/errors/openroutererror.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; +import { + createPageIterator, + haltIterator, + PageIterator, + Paginator, +} from "../types/operations.js"; + +/** + * List SCIM group mappings + * + * @remarks + * List SCIM group-to-workspace mappings for the organization. [Management key](/docs/guides/overview/auth/management-api-keys) required. + */ +export function scimListMappings( + client: OpenRouterCore, + request?: operations.ListScimGroupMappingsRequest | undefined, + options?: RequestOptions, +): APIPromise< + PageIterator< + Result< + operations.ListScimGroupMappingsResponse, + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + { offset: number } + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: OpenRouterCore, + request?: operations.ListScimGroupMappingsRequest | undefined, + options?: RequestOptions, +): Promise< + [ + PageIterator< + Result< + operations.ListScimGroupMappingsResponse, + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + { offset: number } + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + operations.ListScimGroupMappingsRequest$outboundSchema.optional().parse( + value, + ), + "Input validation failed", + ); + if (!parsed.ok) { + return [haltIterator(parsed), { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const path = pathToFunc("/scim/group-mappings")(); + + const query = encodeFormQuery({ + "limit": payload?.limit, + "offset": payload?.offset, + }); + + const headers = new Headers(compactMap({ + Accept: "application/json", + "HTTP-Referer": encodeSimple( + "HTTP-Referer", + payload?.["HTTP-Referer"] ?? client._options.httpReferer, + { explode: false, charEncoding: "none" }, + ), + "X-OpenRouter-Categories": encodeSimple( + "X-OpenRouter-Categories", + payload?.appCategories ?? client._options.appCategories, + { explode: false, charEncoding: "none" }, + ), + "X-OpenRouter-Title": encodeSimple( + "X-OpenRouter-Title", + payload?.appTitle ?? client._options.appTitle, + { explode: false, charEncoding: "none" }, + ), + })); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "listScimGroupMappings", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + } + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["5XX"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + baseURL: options?.serverURL, + path: path, + headers: headers, + query: query, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [haltIterator(requestRes), { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + isErrorStatusCode: (statusCode: number) => + matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [haltIterator(doResult), { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result, raw] = await M.match< + operations.ListScimGroupMappingsResponse, + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, operations.ListScimGroupMappingsResponse$inboundSchema, { + key: "Result", + }), + M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), + M.jsonErr(404, errors.NotFoundResponseError$inboundSchema), + M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [haltIterator(result), { + status: "complete", + request: req, + response, + }]; + } + + const nextFunc = ( + responseData: unknown, + ): { + next: Paginator< + Result< + operations.ListScimGroupMappingsResponse, + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > + >; + "~next"?: { offset: number }; + } => { + const offset = request?.offset ?? 0; + + if (!responseData) { + return { next: () => null }; + } + const results = (responseData as { data: unknown }).data; + if (!Array.isArray(results) || !results.length) { + return { next: () => null }; + } + const limit = request?.limit ?? 50; + if (results.length < limit) { + return { next: () => null }; + } + const nextOffset = offset + results.length; + + const nextVal = () => + scimListMappings( + client, + { + ...request!, + offset: nextOffset, + }, + options, + ); + + return { next: nextVal, "~next": { offset: nextOffset } }; + }; + + const page = { ...result, ...nextFunc(raw) }; + return [{ ...page, ...createPageIterator(page, (v) => !v.ok) }, { + status: "complete", + request: req, + response, + }]; +} diff --git a/src/funcs/scimRead.ts b/src/funcs/scimRead.ts new file mode 100644 index 000000000..ad2ce6085 --- /dev/null +++ b/src/funcs/scimRead.ts @@ -0,0 +1,212 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 71d46eb8edca + */ + +import { OpenRouterCore } from "../core.js"; +import { encodeSimple } from "../lib/encodings.js"; +import { matchStatusCode } from "../lib/http.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { OpenRouterError } from "../models/errors/openroutererror.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as models from "../models/index.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Get a SCIM group mapping + * + * @remarks + * Get a SCIM group-to-workspace mapping. [Management key](/docs/guides/overview/auth/management-api-keys) required. + */ +export function scimRead( + client: OpenRouterCore, + request: operations.GetScimGroupMappingRequest, + options?: RequestOptions, +): APIPromise< + Result< + models.GetScimGroupMappingResponse, + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: OpenRouterCore, + request: operations.GetScimGroupMappingRequest, + options?: RequestOptions, +): Promise< + [ + Result< + models.GetScimGroupMappingResponse, + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + operations.GetScimGroupMappingRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const pathParams = { + id: encodeSimple("id", payload.id, { + explode: false, + charEncoding: "percent", + }), + }; + const path = pathToFunc("/scim/group-mappings/{id}")(pathParams); + + const headers = new Headers(compactMap({ + Accept: "application/json", + "HTTP-Referer": encodeSimple( + "HTTP-Referer", + payload["HTTP-Referer"] ?? client._options.httpReferer, + { explode: false, charEncoding: "none" }, + ), + "X-OpenRouter-Categories": encodeSimple( + "X-OpenRouter-Categories", + payload.appCategories ?? client._options.appCategories, + { explode: false, charEncoding: "none" }, + ), + "X-OpenRouter-Title": encodeSimple( + "X-OpenRouter-Title", + payload.appTitle ?? client._options.appTitle, + { explode: false, charEncoding: "none" }, + ), + })); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "getScimGroupMapping", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + } + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["5XX"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + isErrorStatusCode: (statusCode: number) => + matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + models.GetScimGroupMappingResponse, + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, models.GetScimGroupMappingResponse$inboundSchema), + M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), + M.jsonErr(404, errors.NotFoundResponseError$inboundSchema), + M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/scimUpdate.ts b/src/funcs/scimUpdate.ts new file mode 100644 index 000000000..ee28b4b84 --- /dev/null +++ b/src/funcs/scimUpdate.ts @@ -0,0 +1,219 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 165bac1c9819 + */ + +import { OpenRouterCore } from "../core.js"; +import { encodeJSON, encodeSimple } from "../lib/encodings.js"; +import { matchStatusCode } from "../lib/http.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { OpenRouterError } from "../models/errors/openroutererror.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as models from "../models/index.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Update a SCIM group mapping + * + * @remarks + * Update a SCIM group mapping role. [Management key](/docs/guides/overview/auth/management-api-keys) required. + */ +export function scimUpdate( + client: OpenRouterCore, + request: operations.UpdateScimGroupMappingRequest, + options?: RequestOptions, +): APIPromise< + Result< + models.UpdateScimGroupMappingResponse, + | errors.BadRequestResponseError + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: OpenRouterCore, + request: operations.UpdateScimGroupMappingRequest, + options?: RequestOptions, +): Promise< + [ + Result< + models.UpdateScimGroupMappingResponse, + | errors.BadRequestResponseError + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + operations.UpdateScimGroupMappingRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = encodeJSON("body", payload.UpdateScimGroupMappingRequest, { + explode: true, + }); + + const pathParams = { + id: encodeSimple("id", payload.id, { + explode: false, + charEncoding: "percent", + }), + }; + const path = pathToFunc("/scim/group-mappings/{id}")(pathParams); + + const headers = new Headers(compactMap({ + "Content-Type": "application/json", + Accept: "application/json", + "HTTP-Referer": encodeSimple( + "HTTP-Referer", + payload["HTTP-Referer"] ?? client._options.httpReferer, + { explode: false, charEncoding: "none" }, + ), + "X-OpenRouter-Categories": encodeSimple( + "X-OpenRouter-Categories", + payload.appCategories ?? client._options.appCategories, + { explode: false, charEncoding: "none" }, + ), + "X-OpenRouter-Title": encodeSimple( + "X-OpenRouter-Title", + payload.appTitle ?? client._options.appTitle, + { explode: false, charEncoding: "none" }, + ), + })); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "updateScimGroupMapping", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + } + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["5XX"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "PATCH", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + isErrorStatusCode: (statusCode: number) => + matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + models.UpdateScimGroupMappingResponse, + | errors.BadRequestResponseError + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, models.UpdateScimGroupMappingResponse$inboundSchema), + M.jsonErr(400, errors.BadRequestResponseError$inboundSchema), + M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), + M.jsonErr(404, errors.NotFoundResponseError$inboundSchema), + M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/lib/config.ts b/src/lib/config.ts index e7405773d..53f6c14ae 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -75,7 +75,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "1.0.0", - sdkVersion: "1.1.25", + sdkVersion: "1.2.0", genVersion: "2.914.0", - userAgent: "speakeasy-sdk/typescript 1.1.25 2.914.0 1.0.0 @openrouter/sdk", + userAgent: "speakeasy-sdk/typescript 1.2.0 2.914.0 1.0.0 @openrouter/sdk", } as const; diff --git a/src/models/createscimgroupmappingrequest.ts b/src/models/createscimgroupmappingrequest.ts new file mode 100644 index 000000000..eb8a7e205 --- /dev/null +++ b/src/models/createscimgroupmappingrequest.ts @@ -0,0 +1,61 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: b5fef01e7c38 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import * as openEnums from "../types/enums.js"; +import { OpenEnum } from "../types/enums.js"; + +export const CreateScimGroupMappingRequestRole = { + Admin: "admin", + Member: "member", +} as const; +export type CreateScimGroupMappingRequestRole = OpenEnum< + typeof CreateScimGroupMappingRequestRole +>; + +export type CreateScimGroupMappingRequest = { + role: CreateScimGroupMappingRequestRole; + scimGroupId: string; + workspaceId: string; +}; + +/** @internal */ +export const CreateScimGroupMappingRequestRole$outboundSchema: z.ZodType< + string, + CreateScimGroupMappingRequestRole +> = openEnums.outboundSchema(CreateScimGroupMappingRequestRole); + +/** @internal */ +export type CreateScimGroupMappingRequest$Outbound = { + role: string; + scim_group_id: string; + workspace_id: string; +}; + +/** @internal */ +export const CreateScimGroupMappingRequest$outboundSchema: z.ZodType< + CreateScimGroupMappingRequest$Outbound, + CreateScimGroupMappingRequest +> = z.object({ + role: CreateScimGroupMappingRequestRole$outboundSchema, + scimGroupId: z.string(), + workspaceId: z.string(), +}).transform((v) => { + return remap$(v, { + scimGroupId: "scim_group_id", + workspaceId: "workspace_id", + }); +}); + +export function createScimGroupMappingRequestToJSON( + createScimGroupMappingRequest: CreateScimGroupMappingRequest, +): string { + return JSON.stringify( + CreateScimGroupMappingRequest$outboundSchema.parse( + createScimGroupMappingRequest, + ), + ); +} diff --git a/src/models/createscimgroupmappingresponse.ts b/src/models/createscimgroupmappingresponse.ts new file mode 100644 index 000000000..a6e1bde48 --- /dev/null +++ b/src/models/createscimgroupmappingresponse.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: b3723e0973bc + */ + +import * as z from "zod/v4"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; +import { + ScimGroupMapping, + ScimGroupMapping$inboundSchema, +} from "./scimgroupmapping.js"; + +export type CreateScimGroupMappingResponse = { + data: ScimGroupMapping; +}; + +/** @internal */ +export const CreateScimGroupMappingResponse$inboundSchema: z.ZodType< + CreateScimGroupMappingResponse, + unknown +> = z.object({ + data: ScimGroupMapping$inboundSchema, +}); + +export function createScimGroupMappingResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CreateScimGroupMappingResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CreateScimGroupMappingResponse' from JSON`, + ); +} diff --git a/src/models/deletescimgroupmappingresponse.ts b/src/models/deletescimgroupmappingresponse.ts new file mode 100644 index 000000000..d4c542e50 --- /dev/null +++ b/src/models/deletescimgroupmappingresponse.ts @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 6773f6e7c59d + */ + +import * as z from "zod/v4"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type DeleteScimGroupMappingResponse = { + deleted: true; +}; + +/** @internal */ +export const DeleteScimGroupMappingResponse$inboundSchema: z.ZodType< + DeleteScimGroupMappingResponse, + unknown +> = z.object({ + deleted: z.literal(true), +}); + +export function deleteScimGroupMappingResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => DeleteScimGroupMappingResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'DeleteScimGroupMappingResponse' from JSON`, + ); +} diff --git a/src/models/getscimgroupmappingresponse.ts b/src/models/getscimgroupmappingresponse.ts new file mode 100644 index 000000000..687d466bf --- /dev/null +++ b/src/models/getscimgroupmappingresponse.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 96e1fbabfc37 + */ + +import * as z from "zod/v4"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; +import { + ScimGroupMapping, + ScimGroupMapping$inboundSchema, +} from "./scimgroupmapping.js"; + +export type GetScimGroupMappingResponse = { + data: ScimGroupMapping; +}; + +/** @internal */ +export const GetScimGroupMappingResponse$inboundSchema: z.ZodType< + GetScimGroupMappingResponse, + unknown +> = z.object({ + data: ScimGroupMapping$inboundSchema, +}); + +export function getScimGroupMappingResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetScimGroupMappingResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetScimGroupMappingResponse' from JSON`, + ); +} diff --git a/src/models/index.ts b/src/models/index.ts index 400cf6b96..64134bbfb 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -172,6 +172,8 @@ export * from "./createguardrailresponse.js"; export * from "./createobservabilitydestinationrequest.js"; export * from "./createobservabilitydestinationresponse.js"; export * from "./createpresetfrominferenceresponse.js"; +export * from "./createscimgroupmappingrequest.js"; +export * from "./createscimgroupmappingresponse.js"; export * from "./createworkspacerequest.js"; export * from "./createworkspaceresponse.js"; export * from "./customtool.js"; @@ -187,6 +189,7 @@ export * from "./defaultparameters.js"; export * from "./deletebyokkeyresponse.js"; export * from "./deleteguardrailresponse.js"; export * from "./deleteobservabilitydestinationresponse.js"; +export * from "./deletescimgroupmappingresponse.js"; export * from "./deleteworkspacebudgetresponse.js"; export * from "./deleteworkspaceresponse.js"; export * from "./easyinputmessage.js"; @@ -238,6 +241,7 @@ export * from "./getguardrailresponse.js"; export * from "./getobservabilitydestinationresponse.js"; export * from "./getpresetresponse.js"; export * from "./getpresetversionresponse.js"; +export * from "./getscimgroupmappingresponse.js"; export * from "./getworkspaceresponse.js"; export * from "./guardrail.js"; export * from "./guardrailinterval.js"; @@ -293,6 +297,8 @@ export * from "./listmemberassignmentsresponse.js"; export * from "./listobservabilitydestinationsresponse.js"; export * from "./listpresetsresponse.js"; export * from "./listpresetversionsresponse.js"; +export * from "./listscimgroupmappingsresponse.js"; +export * from "./listscimgroupsresponse.js"; export * from "./listworkspacebudgetsresponse.js"; export * from "./listworkspacemembersresponse.js"; export * from "./listworkspacesresponse.js"; @@ -477,6 +483,8 @@ export * from "./responsesstreamingresponse.js"; export * from "./routerattempt.js"; export * from "./routerparams.js"; export * from "./routingstrategy.js"; +export * from "./scimgroup.js"; +export * from "./scimgroupmapping.js"; export * from "./searchcontextsizeenum.js"; export * from "./searchmodelsservertoolconfig.js"; export * from "./searchmodelsservertoolopenrouter.js"; @@ -548,6 +556,8 @@ export * from "./updateguardrailrequest.js"; export * from "./updateguardrailresponse.js"; export * from "./updateobservabilitydestinationrequest.js"; export * from "./updateobservabilitydestinationresponse.js"; +export * from "./updatescimgroupmappingrequest.js"; +export * from "./updatescimgroupmappingresponse.js"; export * from "./updateworkspacerequest.js"; export * from "./updateworkspaceresponse.js"; export * from "./upsertworkspacebudgetrequest.js"; diff --git a/src/models/listscimgroupmappingsresponse.ts b/src/models/listscimgroupmappingsresponse.ts new file mode 100644 index 000000000..a503e87ce --- /dev/null +++ b/src/models/listscimgroupmappingsresponse.ts @@ -0,0 +1,42 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: c04288fe6dbf + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; +import { + ScimGroupMapping, + ScimGroupMapping$inboundSchema, +} from "./scimgroupmapping.js"; + +export type ListScimGroupMappingsResponse = { + data: Array; + totalCount: number; +}; + +/** @internal */ +export const ListScimGroupMappingsResponse$inboundSchema: z.ZodType< + ListScimGroupMappingsResponse, + unknown +> = z.object({ + data: z.array(ScimGroupMapping$inboundSchema), + total_count: z.int(), +}).transform((v) => { + return remap$(v, { + "total_count": "totalCount", + }); +}); + +export function listScimGroupMappingsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ListScimGroupMappingsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ListScimGroupMappingsResponse' from JSON`, + ); +} diff --git a/src/models/listscimgroupsresponse.ts b/src/models/listscimgroupsresponse.ts new file mode 100644 index 000000000..5b63973a8 --- /dev/null +++ b/src/models/listscimgroupsresponse.ts @@ -0,0 +1,39 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: d3fac2f94e20 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; +import { ScimGroup, ScimGroup$inboundSchema } from "./scimgroup.js"; + +export type ListScimGroupsResponse = { + data: Array; + totalCount: number; +}; + +/** @internal */ +export const ListScimGroupsResponse$inboundSchema: z.ZodType< + ListScimGroupsResponse, + unknown +> = z.object({ + data: z.array(ScimGroup$inboundSchema), + total_count: z.int(), +}).transform((v) => { + return remap$(v, { + "total_count": "totalCount", + }); +}); + +export function listScimGroupsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ListScimGroupsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ListScimGroupsResponse' from JSON`, + ); +} diff --git a/src/models/operations/createscimgroupmapping.ts b/src/models/operations/createscimgroupmapping.ts new file mode 100644 index 000000000..98b1062e2 --- /dev/null +++ b/src/models/operations/createscimgroupmapping.ts @@ -0,0 +1,88 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: c5875c4ab24d + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../../lib/primitives.js"; +import * as models from "../index.js"; + +export type CreateScimGroupMappingGlobals = { + /** + * The app identifier should be your app's URL and is used as the primary identifier for rankings. + * + * @remarks + * This is used to track API usage per application. + */ + httpReferer?: string | undefined; + /** + * The app display name allows you to customize how your app appears in OpenRouter's dashboard. + * + * @remarks + */ + appTitle?: string | undefined; + /** + * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. + * + * @remarks + */ + appCategories?: string | undefined; +}; + +export type CreateScimGroupMappingRequest = { + /** + * The app identifier should be your app's URL and is used as the primary identifier for rankings. + * + * @remarks + * This is used to track API usage per application. + */ + httpReferer?: string | undefined; + /** + * The app display name allows you to customize how your app appears in OpenRouter's dashboard. + * + * @remarks + */ + appTitle?: string | undefined; + /** + * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. + * + * @remarks + */ + appCategories?: string | undefined; + createScimGroupMappingRequest: models.CreateScimGroupMappingRequest; +}; + +/** @internal */ +export type CreateScimGroupMappingRequest$Outbound = { + "HTTP-Referer"?: string | undefined; + appTitle?: string | undefined; + appCategories?: string | undefined; + CreateScimGroupMappingRequest: models.CreateScimGroupMappingRequest$Outbound; +}; + +/** @internal */ +export const CreateScimGroupMappingRequest$outboundSchema: z.ZodType< + CreateScimGroupMappingRequest$Outbound, + CreateScimGroupMappingRequest +> = z.object({ + httpReferer: z.string().optional(), + appTitle: z.string().optional(), + appCategories: z.string().optional(), + createScimGroupMappingRequest: + models.CreateScimGroupMappingRequest$outboundSchema, +}).transform((v) => { + return remap$(v, { + httpReferer: "HTTP-Referer", + createScimGroupMappingRequest: "CreateScimGroupMappingRequest", + }); +}); + +export function createScimGroupMappingRequestToJSON( + createScimGroupMappingRequest: CreateScimGroupMappingRequest, +): string { + return JSON.stringify( + CreateScimGroupMappingRequest$outboundSchema.parse( + createScimGroupMappingRequest, + ), + ); +} diff --git a/src/models/operations/deletescimgroupmapping.ts b/src/models/operations/deletescimgroupmapping.ts new file mode 100644 index 000000000..45d7fdf9e --- /dev/null +++ b/src/models/operations/deletescimgroupmapping.ts @@ -0,0 +1,124 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 28528c6c5f62 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../../lib/primitives.js"; +import * as openEnums from "../../types/enums.js"; +import { OpenEnum } from "../../types/enums.js"; + +export type DeleteScimGroupMappingGlobals = { + /** + * The app identifier should be your app's URL and is used as the primary identifier for rankings. + * + * @remarks + * This is used to track API usage per application. + */ + httpReferer?: string | undefined; + /** + * The app display name allows you to customize how your app appears in OpenRouter's dashboard. + * + * @remarks + */ + appTitle?: string | undefined; + /** + * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. + * + * @remarks + */ + appCategories?: string | undefined; +}; + +export const KeepMembersEnum = { + True: "true", + False: "false", +} as const; +export type KeepMembersEnum = OpenEnum; + +/** + * Required. Whether to keep workspace members after deleting the mapping. `false` **removes** the members this mapping granted access to; `true` deletes the mapping while leaving membership intact as manually-managed. There is deliberately no default — omitting it returns `400` so the destructive path cannot be reached by accident. Mirrors the dashboard, whose `DeleteMappingSchema.keepMembers` is likewise required. + */ +export type KeepMembers = KeepMembersEnum | boolean; + +export type DeleteScimGroupMappingRequest = { + /** + * The app identifier should be your app's URL and is used as the primary identifier for rankings. + * + * @remarks + * This is used to track API usage per application. + */ + httpReferer?: string | undefined; + /** + * The app display name allows you to customize how your app appears in OpenRouter's dashboard. + * + * @remarks + */ + appTitle?: string | undefined; + /** + * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. + * + * @remarks + */ + appCategories?: string | undefined; + id: string; + /** + * Required. Whether to keep workspace members after deleting the mapping. `false` **removes** the members this mapping granted access to; `true` deletes the mapping while leaving membership intact as manually-managed. There is deliberately no default — omitting it returns `400` so the destructive path cannot be reached by accident. Mirrors the dashboard, whose `DeleteMappingSchema.keepMembers` is likewise required. + */ + keepMembers: KeepMembersEnum | boolean; +}; + +/** @internal */ +export const KeepMembersEnum$outboundSchema: z.ZodType< + string, + KeepMembersEnum +> = openEnums.outboundSchema(KeepMembersEnum); + +/** @internal */ +export type KeepMembers$Outbound = string | boolean; + +/** @internal */ +export const KeepMembers$outboundSchema: z.ZodType< + KeepMembers$Outbound, + KeepMembers +> = z.union([KeepMembersEnum$outboundSchema, z.boolean()]); + +export function keepMembersToJSON(keepMembers: KeepMembers): string { + return JSON.stringify(KeepMembers$outboundSchema.parse(keepMembers)); +} + +/** @internal */ +export type DeleteScimGroupMappingRequest$Outbound = { + "HTTP-Referer"?: string | undefined; + appTitle?: string | undefined; + appCategories?: string | undefined; + id: string; + keep_members: string | boolean; +}; + +/** @internal */ +export const DeleteScimGroupMappingRequest$outboundSchema: z.ZodType< + DeleteScimGroupMappingRequest$Outbound, + DeleteScimGroupMappingRequest +> = z.object({ + httpReferer: z.string().optional(), + appTitle: z.string().optional(), + appCategories: z.string().optional(), + id: z.string(), + keepMembers: z.union([KeepMembersEnum$outboundSchema, z.boolean()]), +}).transform((v) => { + return remap$(v, { + httpReferer: "HTTP-Referer", + keepMembers: "keep_members", + }); +}); + +export function deleteScimGroupMappingRequestToJSON( + deleteScimGroupMappingRequest: DeleteScimGroupMappingRequest, +): string { + return JSON.stringify( + DeleteScimGroupMappingRequest$outboundSchema.parse( + deleteScimGroupMappingRequest, + ), + ); +} diff --git a/src/models/operations/getscimgroupmapping.ts b/src/models/operations/getscimgroupmapping.ts new file mode 100644 index 000000000..8208ddb95 --- /dev/null +++ b/src/models/operations/getscimgroupmapping.ts @@ -0,0 +1,83 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 770ff3da0b58 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../../lib/primitives.js"; + +export type GetScimGroupMappingGlobals = { + /** + * The app identifier should be your app's URL and is used as the primary identifier for rankings. + * + * @remarks + * This is used to track API usage per application. + */ + httpReferer?: string | undefined; + /** + * The app display name allows you to customize how your app appears in OpenRouter's dashboard. + * + * @remarks + */ + appTitle?: string | undefined; + /** + * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. + * + * @remarks + */ + appCategories?: string | undefined; +}; + +export type GetScimGroupMappingRequest = { + /** + * The app identifier should be your app's URL and is used as the primary identifier for rankings. + * + * @remarks + * This is used to track API usage per application. + */ + httpReferer?: string | undefined; + /** + * The app display name allows you to customize how your app appears in OpenRouter's dashboard. + * + * @remarks + */ + appTitle?: string | undefined; + /** + * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. + * + * @remarks + */ + appCategories?: string | undefined; + id: string; +}; + +/** @internal */ +export type GetScimGroupMappingRequest$Outbound = { + "HTTP-Referer"?: string | undefined; + appTitle?: string | undefined; + appCategories?: string | undefined; + id: string; +}; + +/** @internal */ +export const GetScimGroupMappingRequest$outboundSchema: z.ZodType< + GetScimGroupMappingRequest$Outbound, + GetScimGroupMappingRequest +> = z.object({ + httpReferer: z.string().optional(), + appTitle: z.string().optional(), + appCategories: z.string().optional(), + id: z.string(), +}).transform((v) => { + return remap$(v, { + httpReferer: "HTTP-Referer", + }); +}); + +export function getScimGroupMappingRequestToJSON( + getScimGroupMappingRequest: GetScimGroupMappingRequest, +): string { + return JSON.stringify( + GetScimGroupMappingRequest$outboundSchema.parse(getScimGroupMappingRequest), + ); +} diff --git a/src/models/operations/index.ts b/src/models/operations/index.ts index c758b817f..8473f9082 100644 --- a/src/models/operations/index.ts +++ b/src/models/operations/index.ts @@ -24,6 +24,7 @@ export * from "./createpresetsmessages.js"; export * from "./createpresetsresponses.js"; export * from "./creatererank.js"; export * from "./createresponses.js"; +export * from "./createscimgroupmapping.js"; export * from "./createvideos.js"; export * from "./createworkspace.js"; export * from "./deletebyokkey.js"; @@ -31,6 +32,7 @@ export * from "./deletefile.js"; export * from "./deleteguardrail.js"; export * from "./deletekeys.js"; export * from "./deleteobservabilitydestination.js"; +export * from "./deletescimgroupmapping.js"; export * from "./deleteworkspace.js"; export * from "./deleteworkspacebudget.js"; export * from "./downloadfilecontent.js"; @@ -51,6 +53,7 @@ export * from "./getobservabilitydestination.js"; export * from "./getpreset.js"; export * from "./getpresetversion.js"; export * from "./getrankingsdaily.js"; +export * from "./getscimgroupmapping.js"; export * from "./gettaskclassifications.js"; export * from "./getuseractivity.js"; export * from "./getvideos.js"; @@ -76,6 +79,8 @@ export * from "./listorganizationmembers.js"; export * from "./listpresets.js"; export * from "./listpresetversions.js"; export * from "./listproviders.js"; +export * from "./listscimgroupmappings.js"; +export * from "./listscimgroups.js"; export * from "./listvideoscontent.js"; export * from "./listvideosmodels.js"; export * from "./listworkspacebudgets.js"; @@ -88,6 +93,7 @@ export * from "./updatebyokkey.js"; export * from "./updateguardrail.js"; export * from "./updatekeys.js"; export * from "./updateobservabilitydestination.js"; +export * from "./updatescimgroupmapping.js"; export * from "./updateworkspace.js"; export * from "./uploadfile.js"; export * from "./upsertworkspacebudget.js"; diff --git a/src/models/operations/listscimgroupmappings.ts b/src/models/operations/listscimgroupmappings.ts new file mode 100644 index 000000000..6add01a11 --- /dev/null +++ b/src/models/operations/listscimgroupmappings.ts @@ -0,0 +1,124 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: be5b19bb327f + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import * as models from "../index.js"; + +export type ListScimGroupMappingsGlobals = { + /** + * The app identifier should be your app's URL and is used as the primary identifier for rankings. + * + * @remarks + * This is used to track API usage per application. + */ + httpReferer?: string | undefined; + /** + * The app display name allows you to customize how your app appears in OpenRouter's dashboard. + * + * @remarks + */ + appTitle?: string | undefined; + /** + * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. + * + * @remarks + */ + appCategories?: string | undefined; +}; + +export type ListScimGroupMappingsRequest = { + /** + * The app identifier should be your app's URL and is used as the primary identifier for rankings. + * + * @remarks + * This is used to track API usage per application. + */ + httpReferer?: string | undefined; + /** + * The app display name allows you to customize how your app appears in OpenRouter's dashboard. + * + * @remarks + */ + appTitle?: string | undefined; + /** + * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. + * + * @remarks + */ + appCategories?: string | undefined; + /** + * Number of records to skip for pagination + */ + offset?: number | null | undefined; + /** + * Maximum number of records to return (max 100) + */ + limit?: number | undefined; +}; + +export type ListScimGroupMappingsResponse = { + result: models.ListScimGroupMappingsResponse; +}; + +/** @internal */ +export type ListScimGroupMappingsRequest$Outbound = { + "HTTP-Referer"?: string | undefined; + appTitle?: string | undefined; + appCategories?: string | undefined; + offset: number | null; + limit: number; +}; + +/** @internal */ +export const ListScimGroupMappingsRequest$outboundSchema: z.ZodType< + ListScimGroupMappingsRequest$Outbound, + ListScimGroupMappingsRequest +> = z.object({ + httpReferer: z.string().optional(), + appTitle: z.string().optional(), + appCategories: z.string().optional(), + offset: z.nullable(z.int().default(0)), + limit: z.int().default(50), +}).transform((v) => { + return remap$(v, { + httpReferer: "HTTP-Referer", + }); +}); + +export function listScimGroupMappingsRequestToJSON( + listScimGroupMappingsRequest: ListScimGroupMappingsRequest, +): string { + return JSON.stringify( + ListScimGroupMappingsRequest$outboundSchema.parse( + listScimGroupMappingsRequest, + ), + ); +} + +/** @internal */ +export const ListScimGroupMappingsResponse$inboundSchema: z.ZodType< + ListScimGroupMappingsResponse, + unknown +> = z.object({ + Result: models.ListScimGroupMappingsResponse$inboundSchema, +}).transform((v) => { + return remap$(v, { + "Result": "result", + }); +}); + +export function listScimGroupMappingsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ListScimGroupMappingsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ListScimGroupMappingsResponse' from JSON`, + ); +} diff --git a/src/models/operations/listscimgroups.ts b/src/models/operations/listscimgroups.ts new file mode 100644 index 000000000..f8cbd73cc --- /dev/null +++ b/src/models/operations/listscimgroups.ts @@ -0,0 +1,122 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: f6a6cc9a951f + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import * as models from "../index.js"; + +export type ListScimGroupsGlobals = { + /** + * The app identifier should be your app's URL and is used as the primary identifier for rankings. + * + * @remarks + * This is used to track API usage per application. + */ + httpReferer?: string | undefined; + /** + * The app display name allows you to customize how your app appears in OpenRouter's dashboard. + * + * @remarks + */ + appTitle?: string | undefined; + /** + * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. + * + * @remarks + */ + appCategories?: string | undefined; +}; + +export type ListScimGroupsRequest = { + /** + * The app identifier should be your app's URL and is used as the primary identifier for rankings. + * + * @remarks + * This is used to track API usage per application. + */ + httpReferer?: string | undefined; + /** + * The app display name allows you to customize how your app appears in OpenRouter's dashboard. + * + * @remarks + */ + appTitle?: string | undefined; + /** + * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. + * + * @remarks + */ + appCategories?: string | undefined; + /** + * Number of records to skip for pagination + */ + offset?: number | null | undefined; + /** + * Maximum number of records to return (max 100) + */ + limit?: number | undefined; +}; + +export type ListScimGroupsResponse = { + result: models.ListScimGroupsResponse; +}; + +/** @internal */ +export type ListScimGroupsRequest$Outbound = { + "HTTP-Referer"?: string | undefined; + appTitle?: string | undefined; + appCategories?: string | undefined; + offset: number | null; + limit: number; +}; + +/** @internal */ +export const ListScimGroupsRequest$outboundSchema: z.ZodType< + ListScimGroupsRequest$Outbound, + ListScimGroupsRequest +> = z.object({ + httpReferer: z.string().optional(), + appTitle: z.string().optional(), + appCategories: z.string().optional(), + offset: z.nullable(z.int().default(0)), + limit: z.int().default(50), +}).transform((v) => { + return remap$(v, { + httpReferer: "HTTP-Referer", + }); +}); + +export function listScimGroupsRequestToJSON( + listScimGroupsRequest: ListScimGroupsRequest, +): string { + return JSON.stringify( + ListScimGroupsRequest$outboundSchema.parse(listScimGroupsRequest), + ); +} + +/** @internal */ +export const ListScimGroupsResponse$inboundSchema: z.ZodType< + ListScimGroupsResponse, + unknown +> = z.object({ + Result: models.ListScimGroupsResponse$inboundSchema, +}).transform((v) => { + return remap$(v, { + "Result": "result", + }); +}); + +export function listScimGroupsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ListScimGroupsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ListScimGroupsResponse' from JSON`, + ); +} diff --git a/src/models/operations/updatescimgroupmapping.ts b/src/models/operations/updatescimgroupmapping.ts new file mode 100644 index 000000000..01f1f1a6e --- /dev/null +++ b/src/models/operations/updatescimgroupmapping.ts @@ -0,0 +1,91 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 6b5a9008ec50 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../../lib/primitives.js"; +import * as models from "../index.js"; + +export type UpdateScimGroupMappingGlobals = { + /** + * The app identifier should be your app's URL and is used as the primary identifier for rankings. + * + * @remarks + * This is used to track API usage per application. + */ + httpReferer?: string | undefined; + /** + * The app display name allows you to customize how your app appears in OpenRouter's dashboard. + * + * @remarks + */ + appTitle?: string | undefined; + /** + * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. + * + * @remarks + */ + appCategories?: string | undefined; +}; + +export type UpdateScimGroupMappingRequest = { + /** + * The app identifier should be your app's URL and is used as the primary identifier for rankings. + * + * @remarks + * This is used to track API usage per application. + */ + httpReferer?: string | undefined; + /** + * The app display name allows you to customize how your app appears in OpenRouter's dashboard. + * + * @remarks + */ + appTitle?: string | undefined; + /** + * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. + * + * @remarks + */ + appCategories?: string | undefined; + id: string; + updateScimGroupMappingRequest: models.UpdateScimGroupMappingRequest; +}; + +/** @internal */ +export type UpdateScimGroupMappingRequest$Outbound = { + "HTTP-Referer"?: string | undefined; + appTitle?: string | undefined; + appCategories?: string | undefined; + id: string; + UpdateScimGroupMappingRequest: models.UpdateScimGroupMappingRequest$Outbound; +}; + +/** @internal */ +export const UpdateScimGroupMappingRequest$outboundSchema: z.ZodType< + UpdateScimGroupMappingRequest$Outbound, + UpdateScimGroupMappingRequest +> = z.object({ + httpReferer: z.string().optional(), + appTitle: z.string().optional(), + appCategories: z.string().optional(), + id: z.string(), + updateScimGroupMappingRequest: + models.UpdateScimGroupMappingRequest$outboundSchema, +}).transform((v) => { + return remap$(v, { + httpReferer: "HTTP-Referer", + updateScimGroupMappingRequest: "UpdateScimGroupMappingRequest", + }); +}); + +export function updateScimGroupMappingRequestToJSON( + updateScimGroupMappingRequest: UpdateScimGroupMappingRequest, +): string { + return JSON.stringify( + UpdateScimGroupMappingRequest$outboundSchema.parse( + updateScimGroupMappingRequest, + ), + ); +} diff --git a/src/models/scimgroup.ts b/src/models/scimgroup.ts new file mode 100644 index 000000000..c14a56413 --- /dev/null +++ b/src/models/scimgroup.ts @@ -0,0 +1,47 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 660f64066687 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type ScimGroup = { + createdAt: string; + displayName: string; + externalId: string | null; + id: string; + organizationId: string; + updatedAt: string; +}; + +/** @internal */ +export const ScimGroup$inboundSchema: z.ZodType = z.object({ + created_at: z.string(), + display_name: z.string(), + external_id: z.nullable(z.string()), + id: z.string(), + organization_id: z.string(), + updated_at: z.string(), +}).transform((v) => { + return remap$(v, { + "created_at": "createdAt", + "display_name": "displayName", + "external_id": "externalId", + "organization_id": "organizationId", + "updated_at": "updatedAt", + }); +}); + +export function scimGroupFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ScimGroup$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ScimGroup' from JSON`, + ); +} diff --git a/src/models/scimgroupmapping.ts b/src/models/scimgroupmapping.ts new file mode 100644 index 000000000..062b2385a --- /dev/null +++ b/src/models/scimgroupmapping.ts @@ -0,0 +1,66 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 851ea3a51b22 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import * as openEnums from "../types/enums.js"; +import { OpenEnum } from "../types/enums.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export const ScimGroupMappingRole = { + Admin: "admin", + Member: "member", +} as const; +export type ScimGroupMappingRole = OpenEnum; + +export type ScimGroupMapping = { + createdAt: string; + id: string; + organizationId: string; + role: ScimGroupMappingRole; + scimGroupId: string; + updatedAt: string; + workspaceId: string; +}; + +/** @internal */ +export const ScimGroupMappingRole$inboundSchema: z.ZodType< + ScimGroupMappingRole, + unknown +> = openEnums.inboundSchema(ScimGroupMappingRole); + +/** @internal */ +export const ScimGroupMapping$inboundSchema: z.ZodType< + ScimGroupMapping, + unknown +> = z.object({ + created_at: z.string(), + id: z.string(), + organization_id: z.string(), + role: ScimGroupMappingRole$inboundSchema, + scim_group_id: z.string(), + updated_at: z.string(), + workspace_id: z.string(), +}).transform((v) => { + return remap$(v, { + "created_at": "createdAt", + "organization_id": "organizationId", + "scim_group_id": "scimGroupId", + "updated_at": "updatedAt", + "workspace_id": "workspaceId", + }); +}); + +export function scimGroupMappingFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ScimGroupMapping$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ScimGroupMapping' from JSON`, + ); +} diff --git a/src/models/updatescimgroupmappingrequest.ts b/src/models/updatescimgroupmappingrequest.ts new file mode 100644 index 000000000..399ef05ee --- /dev/null +++ b/src/models/updatescimgroupmappingrequest.ts @@ -0,0 +1,49 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: ae49c0bf110c + */ + +import * as z from "zod/v4"; +import * as openEnums from "../types/enums.js"; +import { OpenEnum } from "../types/enums.js"; + +export const UpdateScimGroupMappingRequestRole = { + Admin: "admin", + Member: "member", +} as const; +export type UpdateScimGroupMappingRequestRole = OpenEnum< + typeof UpdateScimGroupMappingRequestRole +>; + +export type UpdateScimGroupMappingRequest = { + role: UpdateScimGroupMappingRequestRole; +}; + +/** @internal */ +export const UpdateScimGroupMappingRequestRole$outboundSchema: z.ZodType< + string, + UpdateScimGroupMappingRequestRole +> = openEnums.outboundSchema(UpdateScimGroupMappingRequestRole); + +/** @internal */ +export type UpdateScimGroupMappingRequest$Outbound = { + role: string; +}; + +/** @internal */ +export const UpdateScimGroupMappingRequest$outboundSchema: z.ZodType< + UpdateScimGroupMappingRequest$Outbound, + UpdateScimGroupMappingRequest +> = z.object({ + role: UpdateScimGroupMappingRequestRole$outboundSchema, +}); + +export function updateScimGroupMappingRequestToJSON( + updateScimGroupMappingRequest: UpdateScimGroupMappingRequest, +): string { + return JSON.stringify( + UpdateScimGroupMappingRequest$outboundSchema.parse( + updateScimGroupMappingRequest, + ), + ); +} diff --git a/src/models/updatescimgroupmappingresponse.ts b/src/models/updatescimgroupmappingresponse.ts new file mode 100644 index 000000000..ee2b015d9 --- /dev/null +++ b/src/models/updatescimgroupmappingresponse.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 36503c874458 + */ + +import * as z from "zod/v4"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; +import { + ScimGroupMapping, + ScimGroupMapping$inboundSchema, +} from "./scimgroupmapping.js"; + +export type UpdateScimGroupMappingResponse = { + data: ScimGroupMapping; +}; + +/** @internal */ +export const UpdateScimGroupMappingResponse$inboundSchema: z.ZodType< + UpdateScimGroupMappingResponse, + unknown +> = z.object({ + data: ScimGroupMapping$inboundSchema, +}); + +export function updateScimGroupMappingResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => UpdateScimGroupMappingResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'UpdateScimGroupMappingResponse' from JSON`, + ); +} diff --git a/src/sdk/scim.ts b/src/sdk/scim.ts new file mode 100644 index 000000000..d207e07fa --- /dev/null +++ b/src/sdk/scim.ts @@ -0,0 +1,124 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: ecf200b1abaf + */ + +import { scimCreate } from "../funcs/scimCreate.js"; +import { scimDelete } from "../funcs/scimDelete.js"; +import { scimListGroups } from "../funcs/scimListGroups.js"; +import { scimListMappings } from "../funcs/scimListMappings.js"; +import { scimRead } from "../funcs/scimRead.js"; +import { scimUpdate } from "../funcs/scimUpdate.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as models from "../models/index.js"; +import * as operations from "../models/operations/index.js"; +import { unwrapAsync } from "../types/fp.js"; +import { PageIterator, unwrapResultIterator } from "../types/operations.js"; + +export class Scim extends ClientSDK { + /** + * List SCIM group mappings + * + * @remarks + * List SCIM group-to-workspace mappings for the organization. [Management key](/docs/guides/overview/auth/management-api-keys) required. + */ + async listMappings( + request?: operations.ListScimGroupMappingsRequest | undefined, + options?: RequestOptions, + ): Promise< + PageIterator + > { + return unwrapResultIterator(scimListMappings( + this, + request, + options, + )); + } + + /** + * Create a SCIM group mapping + * + * @remarks + * Create a SCIM group-to-workspace role mapping. [Management key](/docs/guides/overview/auth/management-api-keys) required. + */ + async create( + request: operations.CreateScimGroupMappingRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(scimCreate( + this, + request, + options, + )); + } + + /** + * Delete a SCIM group mapping + * + * @remarks + * Delete a SCIM group-to-workspace mapping. [Management key](/docs/guides/overview/auth/management-api-keys) required. + */ + async delete( + request: operations.DeleteScimGroupMappingRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(scimDelete( + this, + request, + options, + )); + } + + /** + * Get a SCIM group mapping + * + * @remarks + * Get a SCIM group-to-workspace mapping. [Management key](/docs/guides/overview/auth/management-api-keys) required. + */ + async read( + request: operations.GetScimGroupMappingRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(scimRead( + this, + request, + options, + )); + } + + /** + * Update a SCIM group mapping + * + * @remarks + * Update a SCIM group mapping role. [Management key](/docs/guides/overview/auth/management-api-keys) required. + */ + async update( + request: operations.UpdateScimGroupMappingRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(scimUpdate( + this, + request, + options, + )); + } + + /** + * List SCIM groups + * + * @remarks + * List SCIM groups for the organization. [Management key](/docs/guides/overview/auth/management-api-keys) required. + */ + async listGroups( + request?: operations.ListScimGroupsRequest | undefined, + options?: RequestOptions, + ): Promise< + PageIterator + > { + return unwrapResultIterator(scimListGroups( + this, + request, + options, + )); + } +} diff --git a/src/sdk/sdk.ts b/src/sdk/sdk.ts index cbf77f1b6..c95283152 100644 --- a/src/sdk/sdk.ts +++ b/src/sdk/sdk.ts @@ -27,6 +27,7 @@ import { Presets } from "./presets.js"; import { Providers } from "./providers.js"; import { Rerank } from "./rerank.js"; import { Responses } from "./responses.js"; +import { Scim } from "./scim.js"; import { STT } from "./stt.js"; import { TTS } from "./tts.js"; import { VideoGeneration } from "./videogeneration.js"; @@ -170,6 +171,11 @@ export class OpenRouter extends ClientSDK { return (this._responses ??= new Responses(this._options)); } + private _scim?: Scim; + get scim(): Scim { + return (this._scim ??= new Scim(this._options)); + } + private _videoGeneration?: VideoGeneration; get videoGeneration(): VideoGeneration { return (this._videoGeneration ??= new VideoGeneration(this._options));