diff --git a/.gitignore b/.gitignore
index ccddd9f..1f138a9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,26 +1,6 @@
-/models
-/models/errors
-/types
-/node_modules
-/lib
-/sdk
-/funcs
-/react-query
-/mcp-server
-/hooks
-/index.*
-/core.*
-/bin
-/cjs
-/esm
-/dist
-/.tsbuildinfo
-/.eslintcache
-/.tshy
-/.tshy-*
-/__tests__
-.DS_Store
-**/.speakeasy/temp/
-**/.speakeasy/logs/
-.DS_Store
-/.speakeasy/reports
+node_modules/
+dist/
+*.tsbuildinfo
+.env
+.env.*
+
diff --git a/README.md b/README.md
index 5d8dd7f..9d6d307 100644
--- a/README.md
+++ b/README.md
@@ -1,19 +1,7 @@
-# scalar-typescript-sdk
+# Scalar API
-Developer-friendly, idiomatic Typescript SDK for the *scalar-typescript-sdk* API.
-
-
-
-
-
-## Summary
-
-Scalar API: API for managing Scalar platform resources.
+Generated TypeScript SDK for Scalar API.
+API for managing Scalar platform resources.
## TypeScript SDK
@@ -81,505 +69,164 @@ const authedScalar = new Scalar({
### Read more
- [@scalar/sdk on npm](https://www.npmjs.com/package/@scalar/sdk)
-
-
-
-## Table of Contents
-
-* [@scalar/sdk](#scalarsdk)
- * [TypeScript SDK](#typescript-sdk)
- * [SDK Installation](#sdk-installation)
- * [Requirements](#requirements)
- * [SDK Example Usage](#sdk-example-usage)
- * [Authentication](#authentication)
- * [Available Resources and Operations](#available-resources-and-operations)
- * [Standalone functions](#standalone-functions)
- * [Retries](#retries)
- * [Error Handling](#error-handling)
- * [Server Selection](#server-selection)
- * [Custom HTTP Client](#custom-http-client)
- * [Debugging](#debugging)
-* [Development](#development)
- * [Maturity](#maturity)
- * [Contributions](#contributions)
-
-
-
-
-## SDK Installation
-
-The SDK can be installed with either [npm](https://www.npmjs.com/), [pnpm](https://pnpm.io/), [bun](https://bun.sh/) or [yarn](https://classic.yarnpkg.com/en/) package managers.
-
-### NPM
-
-```bash
-npm add @scalar/sdk
-```
-
-### PNPM
-
-```bash
-pnpm add @scalar/sdk
-```
-
-### Bun
-
-```bash
-bun add @scalar/sdk
-```
-
-### Yarn
-
-```bash
-yarn add @scalar/sdk zod
-
-# Note that Yarn does not install peer dependencies automatically. You will need
-# to install zod as shown above.
-```
-> [!NOTE]
-> This package is published with CommonJS and ES Modules (ESM) support.
-
-
-
-## Requirements
-
-For supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md).
-
-
-
-## SDK Example Usage
-
-### Example
-
-```typescript
-import { Scalar } from "@scalar/sdk";
+
-const scalar = new Scalar({
- bearerAuth: "",
-});
+## Contents
-async function run() {
- const result = await scalar.registry.listAllApiDocuments();
+- [Installation](#installation)
+- [Usage](#usage)
+- [API Reference](./api.md)
+- [Authentication](#authentication)
+- [Errors](#errors)
+- [Client Options](#client-options)
+- [Request Options](#request-options)
+- [Retries and Timeouts](#retries-and-timeouts)
+- [Helpers](#helpers)
+- [Logging](#logging)
+- [Requirements](#requirements)
- console.log(result);
-}
+
-run();
+## Installation
+```sh
+npm install @scalar/sdk
```
-
-
-## Authentication
-
-### Per-Client Security Schemes
-
-This SDK supports the following security scheme globally:
+
-| Name | Type | Scheme |
-| ------------ | ---- | ----------- |
-| `bearerAuth` | http | HTTP Bearer |
+## Usage
-To authenticate with the API the `bearerAuth` parameter must be set when initializing the SDK client instance. For example:
-```typescript
-import { Scalar } from "@scalar/sdk";
+```ts
+import ScalarAPI from "@scalar/sdk";
-const scalar = new Scalar({
- bearerAuth: "",
+const client = new ScalarAPI({
+ bearerAuth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var
+ environment: "production",
});
-async function run() {
- const result = await scalar.registry.listAllApiDocuments();
-
- console.log(result);
-}
-
-run();
-
+const listAllAPIDocuments = await client.registry.listAllAPIDocuments();
+console.log(listAllAPIDocuments);
```
-
-
-
-## Available Resources and Operations
-
-
-Available methods
-### [authentication](docs/sdks/authentication/README.md)
+The examples in the following sections assume a `client` configured as shown above.
-* [exchangePersonalToken](docs/sdks/authentication/README.md#exchangepersonaltoken) - Exchange token
-* [getCurrentUser](docs/sdks/authentication/README.md#getcurrentuser) - Get current user
+See the [API reference](./api.md) for every available operation.
-### [loginPortals](docs/sdks/loginportals/README.md)
-
-* [getLoginPortal](docs/sdks/loginportals/README.md#getloginportal) - Get a login portal
-* [updateLoginPortal](docs/sdks/loginportals/README.md#updateloginportal) - Update portal metadata
-* [deleteLoginPortal](docs/sdks/loginportals/README.md#deleteloginportal) - Delete a login portal
-* [createLoginPortal](docs/sdks/loginportals/README.md#createloginportal) - Create a portal
-* [listLoginPortals](docs/sdks/loginportals/README.md#listloginportals) - List all portals
-
-### [namespaces](docs/sdks/namespaces/README.md)
-
-* [listNamespaces](docs/sdks/namespaces/README.md#listnamespaces) - List namespaces
-
-### [registry](docs/sdks/registry/README.md)
-
-* [listAllApiDocuments](docs/sdks/registry/README.md#listallapidocuments) - List all API Documents
-* [listApiDocuments](docs/sdks/registry/README.md#listapidocuments) - List API Documents in a namespace
-* [createApiDocument](docs/sdks/registry/README.md#createapidocument) - Create API Document
-* [updateApiDocument](docs/sdks/registry/README.md#updateapidocument) - Update API Document metadata
-* [deleteApiDocument](docs/sdks/registry/README.md#deleteapidocument) - Delete API Document
-* [getApiDocumentVersion](docs/sdks/registry/README.md#getapidocumentversion) - Get API Document
-* [updateApiDocumentVersion](docs/sdks/registry/README.md#updateapidocumentversion) - Update API Document version
-* [deleteApiDocumentVersion](docs/sdks/registry/README.md#deleteapidocumentversion) - Delete API Document version
-* [getApiDocumentVersionMetadata](docs/sdks/registry/README.md#getapidocumentversionmetadata) - Get API Document version metadata
-* [createApiDocumentVersion](docs/sdks/registry/README.md#createapidocumentversion) - Create API Document version
-* [addApiDocumentAccessGroup](docs/sdks/registry/README.md#addapidocumentaccessgroup) - Add access group
-* [removeApiDocumentAccessGroup](docs/sdks/registry/README.md#removeapidocumentaccessgroup) - Remove access group
-
-### [rules](docs/sdks/rules/README.md)
-
-* [listRulesets](docs/sdks/rules/README.md#listrulesets) - List all rules
-* [createRuleset](docs/sdks/rules/README.md#createruleset) - Create a rule
-* [updateRuleset](docs/sdks/rules/README.md#updateruleset) - Update rule metadata
-* [deleteRuleset](docs/sdks/rules/README.md#deleteruleset) - Delete a rule
-* [getRulesetDocument](docs/sdks/rules/README.md#getrulesetdocument) - Get a rule
-* [addRulesetAccessGroup](docs/sdks/rules/README.md#addrulesetaccessgroup) - Add rule access group
-* [removeRulesetAccessGroup](docs/sdks/rules/README.md#removerulesetaccessgroup) - Remove rule access group
-
-
-### [scalarDocs](docs/sdks/scalardocs/README.md)
-
-* [listGuides](docs/sdks/scalardocs/README.md#listguides) - List all projects
-* [createGuide](docs/sdks/scalardocs/README.md#createguide) - Create a project
-* [publishGuide](docs/sdks/scalardocs/README.md#publishguide) - Publish a project
-
-### [schemas](docs/sdks/schemas/README.md)
-
-* [listSchemas](docs/sdks/schemas/README.md#listschemas) - List all shared components
-* [createSchema](docs/sdks/schemas/README.md#createschema) - Create a shared component
-* [updateSchema](docs/sdks/schemas/README.md#updateschema) - Update shared component metadata
-* [deleteSchema](docs/sdks/schemas/README.md#deleteschema) - Delete a shared component
-* [getSchemaVersion](docs/sdks/schemas/README.md#getschemaversion) - Get a shared component document
-* [deleteSchemaVersion](docs/sdks/schemas/README.md#deleteschemaversion) - Delete a shared component version
-* [createSchemaVersion](docs/sdks/schemas/README.md#createschemaversion) - Create a shared component version
-* [addSchemaAccessGroup](docs/sdks/schemas/README.md#addschemaaccessgroup) - Add shared component access group
-* [removeSchemaAccessGroup](docs/sdks/schemas/README.md#removeschemaaccessgroup) - Remove shared component access group
-
-### [teams](docs/sdks/teams/README.md)
-
-* [listTeams](docs/sdks/teams/README.md#listteams) - List teams
-
-### [themes](docs/sdks/themes/README.md)
-
-* [listThemes](docs/sdks/themes/README.md#listthemes) - List all themes
-* [createTheme](docs/sdks/themes/README.md#createtheme) - Create a theme
-* [updateTheme](docs/sdks/themes/README.md#updatetheme) - Update theme metadata
-* [replaceThemeDocument](docs/sdks/themes/README.md#replacethemedocument) - Update theme document
-* [deleteTheme](docs/sdks/themes/README.md#deletetheme) - Delete a theme
-* [getTheme](docs/sdks/themes/README.md#gettheme) - Get a theme
-
-
-
-
-
-## Standalone functions
-
-All the methods listed above are available as standalone functions. These
-functions are ideal for use in applications running in the browser, serverless
-runtimes or other environments where application bundle size is a primary
-concern. When using a bundler to build your application, all unused
-functionality will be either excluded from the final bundle or tree-shaken away.
-
-To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
-
-
-
-Available standalone functions
-
-- [`authenticationExchangePersonalToken`](docs/sdks/authentication/README.md#exchangepersonaltoken) - Exchange token
-- [`authenticationGetCurrentUser`](docs/sdks/authentication/README.md#getcurrentuser) - Get current user
-- [`loginPortalsCreateLoginPortal`](docs/sdks/loginportals/README.md#createloginportal) - Create a portal
-- [`loginPortalsDeleteLoginPortal`](docs/sdks/loginportals/README.md#deleteloginportal) - Delete a login portal
-- [`loginPortalsGetLoginPortal`](docs/sdks/loginportals/README.md#getloginportal) - Get a login portal
-- [`loginPortalsListLoginPortals`](docs/sdks/loginportals/README.md#listloginportals) - List all portals
-- [`loginPortalsUpdateLoginPortal`](docs/sdks/loginportals/README.md#updateloginportal) - Update portal metadata
-- [`namespacesListNamespaces`](docs/sdks/namespaces/README.md#listnamespaces) - List namespaces
-- [`registryAddApiDocumentAccessGroup`](docs/sdks/registry/README.md#addapidocumentaccessgroup) - Add access group
-- [`registryCreateApiDocument`](docs/sdks/registry/README.md#createapidocument) - Create API Document
-- [`registryCreateApiDocumentVersion`](docs/sdks/registry/README.md#createapidocumentversion) - Create API Document version
-- [`registryDeleteApiDocument`](docs/sdks/registry/README.md#deleteapidocument) - Delete API Document
-- [`registryDeleteApiDocumentVersion`](docs/sdks/registry/README.md#deleteapidocumentversion) - Delete API Document version
-- [`registryGetApiDocumentVersion`](docs/sdks/registry/README.md#getapidocumentversion) - Get API Document
-- [`registryGetApiDocumentVersionMetadata`](docs/sdks/registry/README.md#getapidocumentversionmetadata) - Get API Document version metadata
-- [`registryListAllApiDocuments`](docs/sdks/registry/README.md#listallapidocuments) - List all API Documents
-- [`registryListApiDocuments`](docs/sdks/registry/README.md#listapidocuments) - List API Documents in a namespace
-- [`registryRemoveApiDocumentAccessGroup`](docs/sdks/registry/README.md#removeapidocumentaccessgroup) - Remove access group
-- [`registryUpdateApiDocument`](docs/sdks/registry/README.md#updateapidocument) - Update API Document metadata
-- [`registryUpdateApiDocumentVersion`](docs/sdks/registry/README.md#updateapidocumentversion) - Update API Document version
-- [`rulesAddRulesetAccessGroup`](docs/sdks/rules/README.md#addrulesetaccessgroup) - Add rule access group
-- [`rulesCreateRuleset`](docs/sdks/rules/README.md#createruleset) - Create a rule
-- [`rulesDeleteRuleset`](docs/sdks/rules/README.md#deleteruleset) - Delete a rule
-- [`rulesGetRulesetDocument`](docs/sdks/rules/README.md#getrulesetdocument) - Get a rule
-- [`rulesListRulesets`](docs/sdks/rules/README.md#listrulesets) - List all rules
-- [`rulesRemoveRulesetAccessGroup`](docs/sdks/rules/README.md#removerulesetaccessgroup) - Remove rule access group
-- [`rulesUpdateRuleset`](docs/sdks/rules/README.md#updateruleset) - Update rule metadata
-- [`scalarDocsCreateGuide`](docs/sdks/scalardocs/README.md#createguide) - Create a project
-- [`scalarDocsListGuides`](docs/sdks/scalardocs/README.md#listguides) - List all projects
-- [`scalarDocsPublishGuide`](docs/sdks/scalardocs/README.md#publishguide) - Publish a project
-- [`schemasAddSchemaAccessGroup`](docs/sdks/schemas/README.md#addschemaaccessgroup) - Add shared component access group
-- [`schemasCreateSchema`](docs/sdks/schemas/README.md#createschema) - Create a shared component
-- [`schemasCreateSchemaVersion`](docs/sdks/schemas/README.md#createschemaversion) - Create a shared component version
-- [`schemasDeleteSchema`](docs/sdks/schemas/README.md#deleteschema) - Delete a shared component
-- [`schemasDeleteSchemaVersion`](docs/sdks/schemas/README.md#deleteschemaversion) - Delete a shared component version
-- [`schemasGetSchemaVersion`](docs/sdks/schemas/README.md#getschemaversion) - Get a shared component document
-- [`schemasListSchemas`](docs/sdks/schemas/README.md#listschemas) - List all shared components
-- [`schemasRemoveSchemaAccessGroup`](docs/sdks/schemas/README.md#removeschemaaccessgroup) - Remove shared component access group
-- [`schemasUpdateSchema`](docs/sdks/schemas/README.md#updateschema) - Update shared component metadata
-- [`teamsListTeams`](docs/sdks/teams/README.md#listteams) - List teams
-- [`themesCreateTheme`](docs/sdks/themes/README.md#createtheme) - Create a theme
-- [`themesDeleteTheme`](docs/sdks/themes/README.md#deletetheme) - Delete a theme
-- [`themesGetTheme`](docs/sdks/themes/README.md#gettheme) - Get a theme
-- [`themesListThemes`](docs/sdks/themes/README.md#listthemes) - List all themes
-- [`themesReplaceThemeDocument`](docs/sdks/themes/README.md#replacethemedocument) - Update theme document
-- [`themesUpdateTheme`](docs/sdks/themes/README.md#updatetheme) - Update theme metadata
-
-
-
-
-
-## Retries
-
-Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.
-
-To change the default retry strategy for a single API call, simply provide a retryConfig object to the call:
-```typescript
-import { Scalar } from "@scalar/sdk";
-
-const scalar = new Scalar({
- bearerAuth: "",
-});
-
-async function run() {
- const result = await scalar.registry.listAllApiDocuments({
- retries: {
- strategy: "backoff",
- backoff: {
- initialInterval: 1,
- maxInterval: 50,
- exponent: 1.1,
- maxElapsedTime: 100,
- },
- retryConnectionErrors: false,
- },
- });
-
- console.log(result);
-}
-
-run();
+
-```
+## Authentication
-If you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:
-```typescript
-import { Scalar } from "@scalar/sdk";
-
-const scalar = new Scalar({
- retryConfig: {
- strategy: "backoff",
- backoff: {
- initialInterval: 1,
- maxInterval: 50,
- exponent: 1.1,
- maxElapsedTime: 100,
- },
- retryConnectionErrors: false,
- },
- bearerAuth: "",
-});
+Pass credentials to the generated client constructor. Environment variables are read automatically when supported by the target runtime.
-async function run() {
- const result = await scalar.registry.listAllApiDocuments();
+| Option | Type | Default | Description |
+| --- | --- | --- | --- |
+| `bearerAuth` | `string \| provider` | - | Credential for the BearerAuth scheme. Defaults to BEARER_AUTH. |
- console.log(result);
-}
+Declared schemes:
-run();
+- `BearerAuth` bearer token
-```
-
-
-
-## Error Handling
-
-[`ScalarError`](./src/models/errors/scalarerror.ts) is the base class for all HTTP error responses. It has the following properties:
+
-| Property | Type | Description |
-| ------------------------- | ---------- | --------------------------------------------------------------------------------------- |
-| `error.message` | `string` | Error message |
-| `error.httpMeta.response` | `Response` | HTTP response. Access to headers and more. |
-| `error.httpMeta.request` | `Request` | HTTP request. Access to headers and more. |
-| `error.data$` | | Optional. Some errors may contain structured data. [See Error Classes](#error-classes). |
+## Errors
-### Example
-```typescript
-import { Scalar } from "@scalar/sdk";
-import * as errors from "@scalar/sdk/models/errors";
+Non-success responses throw generated API errors. Error objects expose status, headers, response body, and request metadata where the target runtime supports it.
-const scalar = new Scalar({
- bearerAuth: "",
-});
+```ts
+import { APIError } from "@scalar/sdk";
-async function run() {
- try {
- const result = await scalar.registry.listAllApiDocuments();
-
- console.log(result);
- } catch (error) {
- // The base class for HTTP error responses
- if (error instanceof errors.ScalarError) {
- console.log(error.message);
- console.log(error.httpMeta.response.status);
- console.log(error.httpMeta.response.headers);
- console.log(error.httpMeta.request);
-
- // Depending on the method different errors may be thrown
- if (error instanceof errors.FourHundred) {
- console.log(error.data$.message); // string
- console.log(error.data$.code); // string
- }
- }
+try {
+ const listAllAPIDocuments = await client.registry.listAllAPIDocuments();
+} catch (err) {
+ if (err instanceof APIError) {
+ console.log(err.status, err.name, err.headers);
}
+ throw err;
}
-
-run();
-
```
-### Error Classes
-**Primary errors:**
-* [`ScalarError`](./src/models/errors/scalarerror.ts): The base class for HTTP error responses.
- * [`FourHundred`](docs/models/errors/fourhundred.md): Bad request. Status code `400`.
- * [`FourHundredAndOne`](docs/models/errors/fourhundredandone.md): No auth. Status code `401`.
- * [`FourHundredAndThree`](docs/models/errors/fourhundredandthree.md): Forbidden. Status code `403`.
- * [`FourHundredAndFour`](docs/models/errors/fourhundredandfour.md): Not found. Status code `404`.
- * [`FourHundredAndTwentyTwo`](docs/models/errors/fourhundredandtwentytwo.md): Invalid payload. Status code `422`.
- * [`FiveHundred`](docs/models/errors/fivehundred.md): Uncaught error. Status code `500`.
-
-Less common errors (6)
+Documented error statuses: `400`, `401`, `403`, `404`, `422`, `500`.
-**Network errors:**
-* [`ConnectionError`](./src/models/errors/httpclienterrors.ts): HTTP client was unable to make a request to a server.
-* [`RequestTimeoutError`](./src/models/errors/httpclienterrors.ts): HTTP request timed out due to an AbortSignal signal.
-* [`RequestAbortedError`](./src/models/errors/httpclienterrors.ts): HTTP request was aborted by the client.
-* [`InvalidRequestError`](./src/models/errors/httpclienterrors.ts): Any input used to create a request is invalid.
-* [`UnexpectedClientError`](./src/models/errors/httpclienterrors.ts): Unrecognised or unexpected error.
-
-
-**Inherit from [`ScalarError`](./src/models/errors/scalarerror.ts)**:
-* [`ResponseValidationError`](./src/models/errors/responsevalidationerror.ts): Type mismatch between the data returned from the server and the structure expected by the SDK. See `error.rawValue` for the raw value and `error.pretty()` for a nicely formatted multi-line string.
+## Client Options
-
-
+Configure the generated client by setting any of these options when you create it.
-
-## Server Selection
-
-### Override Server URL Per-Client
-
-The default server can be overridden globally by passing a URL to the `serverURL: string` optional parameter when initializing the SDK client instance. For example:
-```typescript
-import { Scalar } from "@scalar/sdk";
+```ts
+import ScalarAPI from "@scalar/sdk";
-const scalar = new Scalar({
- serverURL: "https://access.scalar.com",
- bearerAuth: "",
+const client = new ScalarAPI({
+ timeout: 60000,
+ maxRetries: 2,
+ logLevel: "debug",
});
-
-async function run() {
- const result = await scalar.registry.listAllApiDocuments();
-
- console.log(result);
-}
-
-run();
-
```
-
-
-## Custom HTTP Client
+| Option | Type | Default | Description |
+| --- | --- | --- | --- |
+| `bearerAuth` | `string \| AuthTokenProvider` | `process.env["BEARER_AUTH"]` | Credential for the BearerAuth scheme. |
+| `environment` | `Environment` | - | Select one of the configured API environments. |
+| `baseURL` | `string \| null` | `process.env["SCALAR_BASE_URL"]` | Override the default API base URL. Pass `null` when selecting a configured environment. |
+| `timeout` | `number` | `60000` | Maximum time in milliseconds to wait for a response before aborting a request. |
+| `maxRetries` | `number` | `2` | Number of retries for temporary failures. |
+| `defaultHeaders` | `HeadersInit` | - | Headers sent with every request. |
+| `defaultQuery` | `Record` | - | Query parameters sent with every request. |
+| `fetchOptions` | `RequestInit` | - | Additional fetch options sent with every request. |
+| `fetch` | `Fetch` | - | Custom fetch implementation. |
+| `logLevel` | `"off" \| "error" \| "warn" \| "info" \| "debug" \| null` | `process.env["SCALAR_LOG"]` | Controls request and retry debug logging. |
+| `logger` | `Logger \| null` | `console` | Custom logger implementation. |
-The TypeScript SDK makes API calls using an `HTTPClient` that wraps the native
-[Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API). This
-client is a thin wrapper around `fetch` and provides the ability to attach hooks
-around the request lifecycle that can be used to modify the request or handle
-errors and response.
+
-The `HTTPClient` constructor takes an optional `fetcher` argument that can be
-used to integrate a third-party HTTP client or when writing tests to mock out
-the HTTP client and feed in fixtures.
+## Request Options
-The following example shows how to use the `"beforeRequest"` hook to to add a
-custom header and a timeout to requests and how to use the `"requestError"` hook
-to log errors:
+| Option | Type | Default | Description |
+| --- | --- | --- | --- |
+| `headers` | `HeadersInit` | - | Per-request headers. |
+| `query` | `Record` | - | Per-request query parameters. |
+| `body` | `unknown` | - | Override the generated request body. |
+| `timeout` | `number` | - | Per-request timeout in milliseconds. |
+| `maxRetries` | `number` | - | Per-request retry count. |
+| `signal` | `AbortSignal` | - | Abort an in-flight request. |
+| `fetchOptions` | `RequestInit` | - | Per-request fetch options. |
+| `idempotencyKey` | `string` | - | Idempotency key for retry-safe operations. |
-```typescript
-import { Scalar } from "@scalar/sdk";
-import { HTTPClient } from "@scalar/sdk/lib/http";
+
-const httpClient = new HTTPClient({
- // fetcher takes a function that has the same signature as native `fetch`.
- fetcher: (request) => {
- return fetch(request);
- }
-});
+## Retries and Timeouts
-httpClient.addHook("beforeRequest", (request) => {
- const nextRequest = new Request(request, {
- signal: request.signal || AbortSignal.timeout(5000)
- });
+Generated clients support request timeouts and retry temporary failures such as network errors, 408, 409, 429, and 5xx responses. Retry delays honor `Retry-After` headers when present. Tune the retry and timeout client options shown above, or override them per request.
- nextRequest.headers.set("x-custom-header", "custom value");
+
- return nextRequest;
-});
+## Helpers
-httpClient.addHook("requestError", (error, request) => {
- console.group("Request Error");
- console.log("Reason:", `${error}`);
- console.log("Endpoint:", `${request.method} ${request.url}`);
- console.groupEnd();
-});
+- Use `.withResponse()` on any request to inspect both parsed data and the raw `Response` object.
+- Every operation returns an `APIPromise`, so you can `await` it directly or chain `.withResponse()`.
-const sdk = new Scalar({ httpClient });
-```
-
+
-
-## Debugging
+## Logging
-You can setup your SDK to emit debug logs for SDK requests and responses.
+- Set `logLevel: "debug"` to log request URLs, options, response status, response headers, and retry attempts.
+- Pass a custom `logger` to route logs into your own observability pipeline.
+- Set `logLevel: null` to disable environment-driven logging.
-You can pass a logger that matches `console`'s interface as an SDK option.
+
-> [!WARNING]
-> Beware that debug logging will reveal secrets, like API tokens in headers, in log messages printed to a console or files. It's recommended to use this feature only during local development and not in production.
+## Requirements
-```typescript
-import { Scalar } from "@scalar/sdk";
+- Node.js 20+, a modern browser, or any runtime with `fetch` support
+
+Powered by Scalar.
-const sdk = new Scalar({ debugLogger: console });
-```
-
## Contributions
-While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation.
-We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release.
+This SDK is generated programmatically. Manual edits to generated files will be
+overwritten on the next build.
-### SDK Created by [Scalar](https://www.scalar.com/?utm_source=scalar-typescript-sdk&utm_campaign=typescript)
\ No newline at end of file
+### SDK created by [Scalar](https://www.scalar.com/?utm_source=scalar-typescript-sdk&utm_campaign=sdk)
diff --git a/api.md b/api.md
new file mode 100644
index 0000000..9c2b0e4
--- /dev/null
+++ b/api.md
@@ -0,0 +1,765 @@
+# Scalar TypeScript API
+
+Complete reference of every operation, grouped by resource. See [the README](./README.md) for usage and configuration.
+
+## Contents
+
+- [`Registry`](#registry)
+ - [List all API Documents](#list-all-api-documents)
+ - [List API Documents in a namespace](#list-api-documents-in-a-namespace)
+ - [Create API Document](#create-api-document)
+ - [Update API Document metadata](#update-api-document-metadata)
+ - [Delete API Document](#delete-api-document)
+ - [Get API Document](#get-api-document)
+ - [Update API Document version](#update-api-document-version)
+ - [Delete API Document version](#delete-api-document-version)
+ - [Get API Document version metadata](#get-api-document-version-metadata)
+ - [Create API Document version](#create-api-document-version)
+ - [Add access group](#add-access-group)
+ - [Remove access group](#remove-access-group)
+- [`Schemas`](#schemas)
+ - [List all shared components](#list-all-shared-components)
+ - [Create a shared component](#create-a-shared-component)
+ - [Update shared component metadata](#update-shared-component-metadata)
+ - [Delete a shared component](#delete-a-shared-component)
+ - [`Schemas Version`](#schemas-version)
+ - [Get a shared component document](#get-a-shared-component-document)
+ - [Delete a shared component version](#delete-a-shared-component-version)
+ - [Create a shared component version](#create-a-shared-component-version)
+ - [`Schemas AccessGroup`](#schemas-accessgroup)
+ - [Add shared component access group](#add-shared-component-access-group)
+ - [Remove shared component access group](#remove-shared-component-access-group)
+- [`LoginPortals`](#loginportals)
+ - [Get a login portal](#get-a-login-portal)
+ - [Update portal metadata](#update-portal-metadata)
+ - [Delete a login portal](#delete-a-login-portal)
+ - [Create a portal](#create-a-portal)
+ - [List all portals](#list-all-portals)
+- [`Rules`](#rules)
+ - [List all rules](#list-all-rules)
+ - [Create a rule](#create-a-rule)
+ - [Update rule metadata](#update-rule-metadata)
+ - [Delete a rule](#delete-a-rule)
+ - [Get a rule](#get-a-rule)
+ - [Add rule access group](#add-rule-access-group)
+ - [Remove rule access group](#remove-rule-access-group)
+- [`Themes`](#themes)
+ - [List all themes](#list-all-themes)
+ - [Create a theme](#create-a-theme)
+ - [Update theme metadata](#update-theme-metadata)
+ - [Update theme document](#update-theme-document)
+ - [Delete a theme](#delete-a-theme)
+ - [Get a theme](#get-a-theme)
+- [`Teams`](#teams)
+ - [List teams](#list-teams)
+- [`ScalarDocs`](#scalardocs)
+ - [List all projects](#list-all-projects)
+ - [Create a project](#create-a-project)
+ - [Publish a project](#publish-a-project)
+- [`Namespaces`](#namespaces)
+ - [List namespaces](#list-namespaces)
+- [`Authentication`](#authentication)
+ - [Exchange token](#exchange-token)
+ - [Get current user](#get-current-user)
+
+## Setup
+
+```ts
+import ScalarAPI from "@scalar/sdk";
+
+const client = new ScalarAPI({
+ bearerAuth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var
+ environment: "production",
+});
+```
+
+## `Registry`
+
+### List all API Documents
+
+List all API documents across every namespace the caller can access.
+
+| Direction | Type |
+| --- | --- |
+| Response | [`RegistryListAllAPIDocumentsResponse`](./src/resources/registry.ts) |
+
+```ts
+const listAllAPIDocuments = await client.registry.listAllAPIDocuments();
+```
+
+### List API Documents in a namespace
+
+List API documents in a namespace.
+
+| Direction | Type |
+| --- | --- |
+| Response | [`RegistryListAPIDocumentsResponse`](./src/resources/registry.ts) |
+
+```ts
+const listAPIDocuments = await client.registry.listAPIDocuments("namespace");
+```
+
+### Create API Document
+
+Create an API document.
+
+| Direction | Type |
+| --- | --- |
+| Request | [`RegistryCreateAPIDocumentParams`](./src/resources/registry.ts) |
+| Response | [`RegistryCreateAPIDocumentResponse`](./src/resources/registry.ts) |
+
+```ts
+const createAPIDocument = await client.registry.createAPIDocument("namespace", {
+ title: "",
+ version: "",
+ slug: "",
+ document: "",
+});
+```
+
+### Update API Document metadata
+
+Update metadata for an API document.
+
+| Direction | Type |
+| --- | --- |
+| Request | [`RegistryUpdateAPIDocumentParams`](./src/resources/registry.ts) |
+
+```ts
+await client.registry.updateAPIDocument("slug", {
+ namespace: "namespace",
+});
+```
+
+### Delete API Document
+
+Delete an API document and all versions.
+
+| Direction | Type |
+| --- | --- |
+| Request | [`RegistryDeleteAPIDocumentParams`](./src/resources/registry.ts) |
+
+```ts
+await client.registry.deleteAPIDocument("slug", {
+ namespace: "namespace",
+});
+```
+
+### Get API Document
+
+Get a specific API document version.
+
+| Direction | Type |
+| --- | --- |
+| Request | [`RegistryRetrieveAPIDocumentVersionParams`](./src/resources/registry.ts) |
+
+```ts
+const string_ = await client.registry.retrieveAPIDocumentVersion("semver", {
+ namespace: "namespace",
+ slug: "slug",
+});
+```
+
+### Update API Document version
+
+Update the registry file content for an API document version.
+
+| Direction | Type |
+| --- | --- |
+| Request | [`RegistryUpdateAPIDocumentVersionParams`](./src/resources/registry.ts) |
+| Response | [`RegistryUpdateAPIDocumentVersionResponse`](./src/resources/registry.ts) |
+
+```ts
+const updateAPIDocumentVersion = await client.registry.updateAPIDocumentVersion("semver", {
+ namespace: "namespace",
+ slug: "slug",
+ document: "",
+});
+```
+
+### Delete API Document version
+
+Delete a specific API document version.
+
+| Direction | Type |
+| --- | --- |
+| Request | [`RegistryDeleteAPIDocumentVersionParams`](./src/resources/registry.ts) |
+
+```ts
+await client.registry.deleteAPIDocumentVersion("semver", {
+ namespace: "namespace",
+ slug: "slug",
+});
+```
+
+### Get API Document version metadata
+
+Get metadata (uid, content shas, version sha, tags) for a specific API document version.
+
+| Direction | Type |
+| --- | --- |
+| Request | [`RegistryListAPIDocumentVersionMetadataParams`](./src/resources/registry.ts) |
+| Response | [`ManagedDocVersion`](./src/resources/registry.ts) |
+
+```ts
+const managedDocVersion = await client.registry.listAPIDocumentVersionMetadata("semver", {
+ namespace: "namespace",
+ slug: "slug",
+});
+```
+
+### Create API Document version
+
+Create a new API document version.
+
+| Direction | Type |
+| --- | --- |
+| Request | [`RegistryCreateAPIDocumentVersionParams`](./src/resources/registry.ts) |
+| Response | [`ManagedDocVersion`](./src/resources/registry.ts) |
+
+```ts
+const managedDocVersion = await client.registry.createAPIDocumentVersion("slug", {
+ namespace: "namespace",
+ version: "",
+ document: "",
+});
+```
+
+### Add access group
+
+Add an access group to an API document.
+
+| Direction | Type |
+| --- | --- |
+| Request | [`RegistryCreateAPIDocumentAccessGroupParams`](./src/resources/registry.ts) |
+
+```ts
+await client.registry.createAPIDocumentAccessGroup("slug", {
+ namespace: "namespace",
+ accessGroupSlug: "",
+});
+```
+
+### Remove access group
+
+Remove an access group from an API document.
+
+| Direction | Type |
+| --- | --- |
+| Request | [`RegistryDeleteAPIDocumentAccessGroupParams`](./src/resources/registry.ts) |
+
+```ts
+await client.registry.deleteAPIDocumentAccessGroup("slug", {
+ namespace: "namespace",
+ accessGroupSlug: "",
+});
+```
+
+## `Schemas`
+
+### List all shared components
+
+List schemas in a namespace.
+
+| Direction | Type |
+| --- | --- |
+| Response | [`SchemaListResponse`](./src/resources/schemas/schemas.ts) |
+
+```ts
+const list = await client.schemas.list("namespace");
+```
+
+### Create a shared component
+
+Create a schema in a namespace.
+
+| Direction | Type |
+| --- | --- |
+| Request | [`SchemaCreateParams`](./src/resources/schemas/schemas.ts) |
+| Response | [`UID`](./src/resources/schemas/schemas.ts) |
+
+```ts
+const uID = await client.schemas.create("namespace", {
+ title: "",
+ version: "",
+ slug: "",
+ document: "",
+});
+```
+
+### Update shared component metadata
+
+Update schema metadata.
+
+| Direction | Type |
+| --- | --- |
+| Request | [`SchemaUpdateParams`](./src/resources/schemas/schemas.ts) |
+
+```ts
+await client.schemas.update("slug", {
+ namespace: "namespace",
+});
+```
+
+### Delete a shared component
+
+Delete a schema and all related versions.
+
+| Direction | Type |
+| --- | --- |
+| Request | [`SchemaDeleteParams`](./src/resources/schemas/schemas.ts) |
+
+```ts
+await client.schemas.delete("slug", {
+ namespace: "namespace",
+});
+```
+
+### `Schemas Version`
+
+#### Get a shared component document
+
+Get a specific schema version document.
+
+| Direction | Type |
+| --- | --- |
+| Request | [`VersionRetrieveSchemaParams`](./src/resources/schemas/version.ts) |
+
+```ts
+const string_ = await client.schemas.version.retrieveSchema("semver", {
+ namespace: "namespace",
+ slug: "slug",
+});
+```
+
+#### Delete a shared component version
+
+Delete a schema version.
+
+| Direction | Type |
+| --- | --- |
+| Request | [`VersionDeleteSchemaParams`](./src/resources/schemas/version.ts) |
+
+```ts
+await client.schemas.version.deleteSchema("semver", {
+ namespace: "namespace",
+ slug: "slug",
+});
+```
+
+#### Create a shared component version
+
+Create a schema version.
+
+| Direction | Type |
+| --- | --- |
+| Request | [`VersionCreateSchemaParams`](./src/resources/schemas/version.ts) |
+| Response | [`UID`](./src/resources/schemas/version.ts) |
+
+```ts
+const uID = await client.schemas.version.createSchema("slug", {
+ namespace: "namespace",
+ version: "",
+ document: "",
+});
+```
+
+### `Schemas AccessGroup`
+
+#### Add shared component access group
+
+Add an access group to a schema.
+
+| Direction | Type |
+| --- | --- |
+| Request | [`AccessGroupCreateSchemaParams`](./src/resources/schemas/access-group.ts) |
+
+```ts
+await client.schemas.accessGroup.createSchema("slug", {
+ namespace: "namespace",
+ accessGroupSlug: "",
+});
+```
+
+#### Remove shared component access group
+
+Remove an access group from a schema.
+
+| Direction | Type |
+| --- | --- |
+| Request | [`AccessGroupDeleteSchemaParams`](./src/resources/schemas/access-group.ts) |
+
+```ts
+await client.schemas.accessGroup.deleteSchema("slug", {
+ namespace: "namespace",
+ accessGroupSlug: "",
+});
+```
+
+## `LoginPortals`
+
+### Get a login portal
+
+Get a login portal by slug.
+
+| Direction | Type |
+| --- | --- |
+| Response | [`LoginPortalRetrieveResponse`](./src/resources/login-portals.ts) |
+
+```ts
+const retrieve = await client.loginPortals.retrieve("slug");
+```
+
+### Update portal metadata
+
+Update metadata for a login portal.
+
+| Direction | Type |
+| --- | --- |
+| Request | [`LoginPortalUpdateParams`](./src/resources/login-portals.ts) |
+
+```ts
+await client.loginPortals.update("slug", {});
+```
+
+### Delete a login portal
+
+Delete a login portal.
+
+```ts
+await client.loginPortals.delete("slug");
+```
+
+### Create a portal
+
+Create a login portal for the current team.
+
+| Direction | Type |
+| --- | --- |
+| Request | [`LoginPortalCreateParams`](./src/resources/login-portals.ts) |
+| Response | [`UID`](./src/resources/login-portals.ts) |
+
+```ts
+const uID = await client.loginPortals.create({
+ title: "",
+ slug: "",
+ email: {
+ logo: "",
+ logoSize: "100",
+ buttonText: "Login",
+ message: "Click to access private documentation hosted by scalar.com",
+ title: "Private Docs",
+ mainColor: "#2a2f45",
+ mainBackground: "#f6f6f6",
+ cardColor: "2a2f45",
+ cardBackground: "#fff",
+ buttonColor: "#fff",
+ buttonBackground: "#0f0f0f",
+ },
+ page: {
+ title: "Scalar Private Docs",
+ description: "Login to access your documentation",
+ head: "",
+ script: "",
+ theme: "",
+ companyName: "",
+ logo: "",
+ logoUrl: "",
+ favicon: "",
+ termsLink: "",
+ privacyLink: "",
+ formTitle: "Scalar Private Docs",
+ formDescription: "Login to access your documentation",
+ formImage: "",
+ },
+});
+```
+
+### List all portals
+
+List all login portals for the current team.
+
+| Direction | Type |
+| --- | --- |
+| Response | [`LoginPortalListResponse`](./src/resources/login-portals.ts) |
+
+```ts
+const list = await client.loginPortals.list();
+```
+
+## `Rules`
+
+### List all rules
+
+List all rulesets in a namespace.
+
+| Direction | Type |
+| --- | --- |
+| Response | [`RuleListRulesetsResponse`](./src/resources/rules.ts) |
+
+```ts
+const listRulesets = await client.rules.listRulesets("namespace");
+```
+
+### Create a rule
+
+Create a rule in a namespace.
+
+| Direction | Type |
+| --- | --- |
+| Request | [`RuleCreateRulesetParams`](./src/resources/rules.ts) |
+| Response | [`UID`](./src/resources/rules.ts) |
+
+```ts
+const uID = await client.rules.createRuleset("namespace", {
+ title: "",
+ slug: "",
+ document: "",
+});
+```
+
+### Update rule metadata
+
+Update rule metadata by slug.
+
+| Direction | Type |
+| --- | --- |
+| Request | [`RuleUpdateRulesetParams`](./src/resources/rules.ts) |
+
+```ts
+await client.rules.updateRuleset("slug", {
+ namespace: "namespace",
+});
+```
+
+### Delete a rule
+
+Delete a rule by slug.
+
+| Direction | Type |
+| --- | --- |
+| Request | [`RuleDeleteRulesetParams`](./src/resources/rules.ts) |
+
+```ts
+await client.rules.deleteRuleset("slug", {
+ namespace: "namespace",
+});
+```
+
+### Get a rule
+
+Get a rule document by slug.
+
+| Direction | Type |
+| --- | --- |
+| Request | [`RuleRetrieveRulesetDocumentParams`](./src/resources/rules.ts) |
+
+```ts
+const string_ = await client.rules.retrieveRulesetDocument("slug", {
+ namespace: "namespace",
+});
+```
+
+### Add rule access group
+
+Grant an access group to a rule.
+
+| Direction | Type |
+| --- | --- |
+| Request | [`RuleCreateRulesetAccessGroupParams`](./src/resources/rules.ts) |
+
+```ts
+await client.rules.createRulesetAccessGroup("slug", {
+ namespace: "namespace",
+ accessGroupSlug: "",
+});
+```
+
+### Remove rule access group
+
+Remove an access group from a rule.
+
+| Direction | Type |
+| --- | --- |
+| Request | [`RuleDeleteRulesetAccessGroupParams`](./src/resources/rules.ts) |
+
+```ts
+await client.rules.deleteRulesetAccessGroup("slug", {
+ namespace: "namespace",
+ accessGroupSlug: "",
+});
+```
+
+## `Themes`
+
+### List all themes
+
+List all team themes.
+
+| Direction | Type |
+| --- | --- |
+| Response | [`ThemeListResponse`](./src/resources/themes.ts) |
+
+```ts
+const list = await client.themes.list();
+```
+
+### Create a theme
+
+Create a team theme.
+
+| Direction | Type |
+| --- | --- |
+| Request | [`ThemeCreateParams`](./src/resources/themes.ts) |
+| Response | [`UID`](./src/resources/themes.ts) |
+
+```ts
+const uID = await client.themes.create({
+ name: "",
+ slug: "",
+ document: "",
+});
+```
+
+### Update theme metadata
+
+Update theme metadata.
+
+| Direction | Type |
+| --- | --- |
+| Request | [`ThemeUpdateParams`](./src/resources/themes.ts) |
+
+```ts
+await client.themes.update("slug", {});
+```
+
+### Update theme document
+
+Replace the theme document.
+
+| Direction | Type |
+| --- | --- |
+| Request | [`ThemeReplaceDocumentParams`](./src/resources/themes.ts) |
+
+```ts
+await client.themes.replaceDocument("slug", {
+ document: "",
+});
+```
+
+### Delete a theme
+
+Delete a theme by slug.
+
+```ts
+await client.themes.delete("slug");
+```
+
+### Get a theme
+
+Get the theme document by slug.
+
+```ts
+const string_ = await client.themes.retrieve("slug");
+```
+
+## `Teams`
+
+### List teams
+
+List all available teams
+
+| Direction | Type |
+| --- | --- |
+| Response | [`TeamListResponse`](./src/resources/teams.ts) |
+
+```ts
+const list = await client.teams.list();
+```
+
+## `ScalarDocs`
+
+### List all projects
+
+List all guide projects.
+
+| Direction | Type |
+| --- | --- |
+| Response | [`ScalarDocListGuidesResponse`](./src/resources/scalar-docs.ts) |
+
+```ts
+const listGuides = await client.scalarDocs.listGuides();
+```
+
+### Create a project
+
+Create a guide project.
+
+| Direction | Type |
+| --- | --- |
+| Request | [`ScalarDocCreateGuideParams`](./src/resources/scalar-docs.ts) |
+| Response | [`ScalarDocCreateGuideResponse`](./src/resources/scalar-docs.ts) |
+
+```ts
+const createGuide = await client.scalarDocs.createGuide({
+ name: "",
+ isPrivate: false,
+ allowedUsers: [],
+ allowedDomains: [],
+});
+```
+
+### Publish a project
+
+Start a new publish process.
+
+| Direction | Type |
+| --- | --- |
+| Response | [`ScalarDocPublishGuideResponse`](./src/resources/scalar-docs.ts) |
+
+```ts
+const publishGuide = await client.scalarDocs.publishGuide("slug");
+```
+
+## `Namespaces`
+
+### List namespaces
+
+Get all namespaces for the current team
+
+| Direction | Type |
+| --- | --- |
+| Response | [`NamespaceListResponse`](./src/resources/namespaces.ts) |
+
+```ts
+const list = await client.namespaces.list();
+```
+
+## `Authentication`
+
+### Exchange token
+
+Exchange an API key for an access token.
+
+| Direction | Type |
+| --- | --- |
+| Request | [`AuthenticationExchangePersonalTokenParams`](./src/resources/authentication.ts) |
+| Response | [`AuthenticationExchangePersonalTokenResponse`](./src/resources/authentication.ts) |
+
+```ts
+const exchangePersonalToken = await client.authentication.exchangePersonalToken({
+ personalToken: "",
+});
+```
+
+### Get current user
+
+Get the authenticated user, including their available teams and theme.
+
+| Direction | Type |
+| --- | --- |
+| Response | [`User`](./src/resources/authentication.ts) |
+
+```ts
+const user = await client.authentication.listCurrentUser();
+```
diff --git a/openapi.augmented.json b/openapi.augmented.json
new file mode 100644
index 0000000..20a85dc
--- /dev/null
+++ b/openapi.augmented.json
@@ -0,0 +1,7611 @@
+{
+ "openapi": "3.1.1",
+ "info": {
+ "title": "Scalar API",
+ "description": "API for managing Scalar platform resources.\n\n## TypeScript SDK\n\nFor TypeScript, we provide a SDK that makes using our API even easier.\n\n### Install\n\n```bash\nnpm add @scalar/sdk\n```\n\n### Get a Scalar API key\n\nCreate an API key in your Scalar account:\n\n- Dashboard: https://dashboard.scalar.com/account\n- Store it in `.env`, for example:\n\n```bash\nSCALAR_API_KEY=your_personal_token\n```\n\n### Exchange your API key for an access token\n\nThe personal token is not an access token. Exchange it first with `postv1AuthExchange`.\n\nIf you use the personal token directly for authenticated API calls, the API returns `401 Invalid authentication token`.\n\n```ts\nimport { Scalar } from '@scalar/sdk'\n\nconst scalar = new Scalar()\n\nconst exchange = await scalar.auth.postv1AuthExchange({\n personalToken: process.env.SCALAR_API_KEY!,\n})\n\nconst accessToken = exchange.accessToken\n```\n\n### Use the access token\n\nConstruct a second client with bearer auth. Use this authenticated client for API calls.\n\n```ts\nimport { Scalar } from '@scalar/sdk'\n\nconst scalar = new Scalar()\n\nconst exchange = await scalar.auth.postv1AuthExchange({\n personalToken: process.env.SCALAR_API_KEY!,\n})\n\nconst authedScalar = new Scalar({\n bearerAuth: exchange.accessToken,\n})\n```\n\n### Notes\n\n- The exchange request itself can be made from a client constructed with no arguments (`new Scalar()`).\n- The exchanged access token is valid for 12 hours.\n- Timestamps are Unix seconds.\n\n### Read more\n\n- [@scalar/sdk on npm](https://www.npmjs.com/package/@scalar/sdk)",
+ "version": "0.1.5",
+ "contact": {
+ "name": "Marc from Scalar",
+ "url": "https://scalar.com",
+ "email": "support@scalar.com"
+ },
+ "x-scalar-sdk-installation": [
+ {
+ "lang": "TypeScript",
+ "description": "```sh\nnpm install @scalar/sdk\n```"
+ },
+ {
+ "lang": "Python",
+ "description": "```sh\npip install scalarApi\n```"
+ },
+ {
+ "lang": "Go",
+ "description": "```sh\ngo get scalar-api\n```"
+ }
+ ]
+ },
+ "servers": [
+ {
+ "url": "https://access.scalar.com"
+ }
+ ],
+ "tags": [
+ {
+ "name": "Registry",
+ "description": "Registry"
+ },
+ {
+ "name": "Schemas",
+ "description": "Schemas"
+ },
+ {
+ "name": "Login Portals",
+ "description": "Login Portals"
+ },
+ {
+ "name": "Rules",
+ "description": "Rules"
+ },
+ {
+ "name": "Themes",
+ "description": "Themes"
+ },
+ {
+ "name": "Teams",
+ "description": "Teams"
+ },
+ {
+ "name": "Scalar Docs",
+ "description": "Scalar Docs"
+ },
+ {
+ "name": "Namespaces",
+ "description": "Namespaces"
+ },
+ {
+ "name": "Authentication",
+ "description": "Authentication"
+ }
+ ],
+ "components": {
+ "securitySchemes": {
+ "BearerAuth": {
+ "type": "http",
+ "scheme": "bearer",
+ "bearerFormat": "JWT"
+ }
+ },
+ "schemas": {
+ "400": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ },
+ "code": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message",
+ "code"
+ ]
+ },
+ "401": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ },
+ "code": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message",
+ "code"
+ ]
+ },
+ "403": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ },
+ "code": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message",
+ "code"
+ ]
+ },
+ "404": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ },
+ "code": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message",
+ "code"
+ ]
+ },
+ "422": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ },
+ "code": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message",
+ "code"
+ ]
+ },
+ "500": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ },
+ "code": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "message",
+ "code"
+ ]
+ },
+ "api-document": {
+ "type": "object",
+ "properties": {
+ "uid": {
+ "default": "nanoid()",
+ "$ref": "#/components/schemas/nanoid"
+ },
+ "version": {
+ "$ref": "#/components/schemas/version"
+ },
+ "title": {
+ "default": "",
+ "type": "string",
+ "maxLength": 100
+ },
+ "slug": {
+ "default": "randomManagedDocSlug()",
+ "$ref": "#/components/schemas/slug"
+ },
+ "description": {
+ "default": "",
+ "type": "string"
+ },
+ "namespace": {
+ "$ref": "#/components/schemas/namespace"
+ },
+ "isPrivate": {
+ "default": false,
+ "type": "boolean"
+ },
+ "tags": {
+ "default": []
+ },
+ "versions": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/managed-doc-version"
+ }
+ }
+ },
+ "required": [
+ "uid",
+ "version",
+ "title",
+ "slug",
+ "description",
+ "namespace",
+ "isPrivate",
+ "tags",
+ "versions"
+ ],
+ "additionalProperties": false
+ },
+ "nanoid": {
+ "type": "string",
+ "minLength": 5
+ },
+ "version": {
+ "type": "string",
+ "minLength": 1
+ },
+ "slug": {
+ "type": "string",
+ "minLength": 3,
+ "maxLength": 60,
+ "pattern": "^[a-z](?:[a-z0-9-]*[a-z0-9])?$"
+ },
+ "namespace": {
+ "type": "string",
+ "minLength": 3,
+ "maxLength": 50,
+ "pattern": "^[a-zA-Z0-9-_]+$"
+ },
+ "managed-doc-version": {
+ "type": "object",
+ "properties": {
+ "uid": {
+ "$ref": "#/components/schemas/nanoid"
+ },
+ "createdAt": {
+ "type": "number"
+ },
+ "version": {
+ "$ref": "#/components/schemas/version"
+ },
+ "upgraded": {
+ "default": false,
+ "type": "boolean"
+ },
+ "embedStatus": {
+ "default": null,
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "complete",
+ "failed"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "tags": {
+ "default": [],
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "tools": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "path": {
+ "type": "string"
+ },
+ "method": {
+ "$ref": "#/components/schemas/method"
+ },
+ "enabledTools": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "execute-request",
+ "get-mini-openapi-spec"
+ ]
+ }
+ }
+ },
+ "required": [
+ "path",
+ "method",
+ "enabledTools"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "yamlSha": {
+ "type": "string"
+ },
+ "jsonSha": {
+ "type": "string"
+ },
+ "versionSha": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "uid",
+ "createdAt",
+ "version",
+ "upgraded",
+ "embedStatus",
+ "tags"
+ ],
+ "additionalProperties": false
+ },
+ "method": {
+ "type": "string",
+ "enum": [
+ "delete",
+ "get",
+ "head",
+ "options",
+ "patch",
+ "post",
+ "put",
+ "trace"
+ ]
+ },
+ "access-group": {
+ "type": "object",
+ "properties": {
+ "accessGroupSlug": {
+ "$ref": "#/components/schemas/slug"
+ }
+ },
+ "required": [
+ "accessGroupSlug"
+ ],
+ "additionalProperties": false
+ },
+ "schema": {
+ "type": "object",
+ "properties": {
+ "uid": {
+ "default": "nanoid()",
+ "$ref": "#/components/schemas/nanoid"
+ },
+ "title": {
+ "default": "",
+ "type": "string",
+ "maxLength": 100
+ },
+ "description": {
+ "default": "",
+ "type": "string"
+ },
+ "slug": {
+ "default": "randomManagedDocSlug()",
+ "$ref": "#/components/schemas/slug"
+ },
+ "namespace": {
+ "$ref": "#/components/schemas/namespace"
+ },
+ "isPrivate": {
+ "default": false,
+ "type": "boolean"
+ },
+ "versions": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/managed-schema-version"
+ }
+ }
+ },
+ "required": [
+ "uid",
+ "title",
+ "description",
+ "slug",
+ "namespace",
+ "isPrivate",
+ "versions"
+ ],
+ "additionalProperties": false
+ },
+ "managed-schema-version": {
+ "type": "object",
+ "properties": {
+ "uid": {
+ "default": "nanoid()",
+ "$ref": "#/components/schemas/nanoid"
+ },
+ "createdAt": {
+ "default": "unixTimestamp()",
+ "$ref": "#/components/schemas/timestamp"
+ },
+ "updatedAt": {
+ "default": "unixTimestamp()",
+ "$ref": "#/components/schemas/timestamp"
+ },
+ "version": {
+ "default": "0.0.1",
+ "$ref": "#/components/schemas/version"
+ }
+ },
+ "required": [
+ "uid",
+ "createdAt",
+ "updatedAt",
+ "version"
+ ],
+ "additionalProperties": false
+ },
+ "timestamp": {
+ "type": "integer",
+ "minimum": 0,
+ "maximum": 9007199254740991
+ },
+ "uid": {
+ "type": "object",
+ "properties": {
+ "uid": {
+ "$ref": "#/components/schemas/nanoid"
+ }
+ },
+ "required": [
+ "uid"
+ ],
+ "additionalProperties": false
+ },
+ "login-portal-email": {
+ "type": "object",
+ "properties": {
+ "logo": {
+ "default": "",
+ "type": "string"
+ },
+ "logoSize": {
+ "default": "100",
+ "type": "string"
+ },
+ "buttonText": {
+ "default": "Login",
+ "type": "string",
+ "maxLength": 50
+ },
+ "message": {
+ "default": "Click to access private documentation hosted by scalar.com",
+ "type": "string",
+ "maxLength": 1000
+ },
+ "title": {
+ "default": "Private Docs",
+ "type": "string",
+ "maxLength": 100
+ },
+ "mainColor": {
+ "default": "#2a2f45",
+ "type": "string",
+ "maxLength": 100
+ },
+ "mainBackground": {
+ "default": "#f6f6f6",
+ "type": "string",
+ "maxLength": 100
+ },
+ "cardColor": {
+ "default": "2a2f45",
+ "type": "string",
+ "maxLength": 100
+ },
+ "cardBackground": {
+ "default": "#fff",
+ "type": "string",
+ "maxLength": 100
+ },
+ "buttonColor": {
+ "default": "#fff",
+ "type": "string",
+ "maxLength": 100
+ },
+ "buttonBackground": {
+ "default": "#0f0f0f",
+ "type": "string",
+ "maxLength": 100
+ }
+ },
+ "required": [
+ "logo",
+ "logoSize",
+ "buttonText",
+ "message",
+ "title",
+ "mainColor",
+ "mainBackground",
+ "cardColor",
+ "cardBackground",
+ "buttonColor",
+ "buttonBackground"
+ ],
+ "additionalProperties": false
+ },
+ "login-portal-page": {
+ "type": "object",
+ "properties": {
+ "title": {
+ "default": "Scalar Private Docs",
+ "type": "string",
+ "maxLength": 100
+ },
+ "description": {
+ "default": "Login to access your documentation",
+ "type": "string",
+ "maxLength": 500
+ },
+ "head": {
+ "default": "",
+ "type": "string"
+ },
+ "script": {
+ "default": "",
+ "type": "string"
+ },
+ "theme": {
+ "default": "",
+ "type": "string"
+ },
+ "companyName": {
+ "default": "",
+ "type": "string",
+ "maxLength": 100
+ },
+ "logo": {
+ "default": "",
+ "type": "string"
+ },
+ "logoURL": {
+ "default": "",
+ "type": "string"
+ },
+ "favicon": {
+ "default": "",
+ "type": "string"
+ },
+ "termsLink": {
+ "default": "",
+ "type": "string"
+ },
+ "privacyLink": {
+ "default": "",
+ "type": "string"
+ },
+ "formTitle": {
+ "default": "Scalar Private Docs",
+ "type": "string",
+ "maxLength": 100
+ },
+ "formDescription": {
+ "default": "Login to access your documentation",
+ "type": "string",
+ "maxLength": 500
+ },
+ "formImage": {
+ "default": "",
+ "type": "string"
+ }
+ },
+ "required": [
+ "title",
+ "description",
+ "head",
+ "script",
+ "theme",
+ "companyName",
+ "logo",
+ "logoURL",
+ "favicon",
+ "termsLink",
+ "privacyLink",
+ "formTitle",
+ "formDescription",
+ "formImage"
+ ],
+ "additionalProperties": false
+ },
+ "login-portal": {
+ "type": "object",
+ "properties": {
+ "uid": {
+ "$ref": "#/components/schemas/nanoid"
+ },
+ "title": {
+ "type": "string",
+ "maxLength": 200
+ },
+ "slug": {
+ "$ref": "#/components/schemas/slug"
+ }
+ },
+ "required": [
+ "uid",
+ "title",
+ "slug"
+ ],
+ "additionalProperties": false
+ },
+ "rule": {
+ "type": "object",
+ "properties": {
+ "uid": {
+ "default": "nanoid()",
+ "$ref": "#/components/schemas/nanoid"
+ },
+ "title": {
+ "default": "",
+ "type": "string",
+ "maxLength": 100
+ },
+ "description": {
+ "default": "",
+ "type": "string"
+ },
+ "slug": {
+ "default": "randomManagedDocSlug()",
+ "$ref": "#/components/schemas/slug"
+ },
+ "namespace": {
+ "$ref": "#/components/schemas/namespace"
+ },
+ "isPrivate": {
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "uid",
+ "title",
+ "description",
+ "slug",
+ "namespace",
+ "isPrivate"
+ ],
+ "additionalProperties": false
+ },
+ "theme": {
+ "type": "object",
+ "properties": {
+ "uid": {
+ "$ref": "#/components/schemas/nanoid"
+ },
+ "name": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "slug": {
+ "$ref": "#/components/schemas/slug"
+ }
+ },
+ "required": [
+ "uid",
+ "name",
+ "description",
+ "slug"
+ ],
+ "additionalProperties": false
+ },
+ "team": {
+ "type": "object",
+ "properties": {
+ "uid": {
+ "$ref": "#/components/schemas/nanoid"
+ },
+ "name": {
+ "$ref": "#/components/schemas/team-name"
+ },
+ "imageUri": {
+ "$ref": "#/components/schemas/team-image"
+ },
+ "slug": {
+ "$ref": "#/components/schemas/slug"
+ },
+ "theme": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "uid",
+ "name",
+ "slug",
+ "theme"
+ ],
+ "additionalProperties": false
+ },
+ "team-name": {
+ "type": "string"
+ },
+ "team-image": {
+ "type": "string"
+ },
+ "github-project": {
+ "type": "object",
+ "properties": {
+ "uid": {
+ "default": "nanoid()",
+ "$ref": "#/components/schemas/nanoid"
+ },
+ "createdAt": {
+ "default": "unixTimestamp()",
+ "$ref": "#/components/schemas/timestamp"
+ },
+ "updatedAt": {
+ "default": "unixTimestamp()",
+ "$ref": "#/components/schemas/timestamp"
+ },
+ "name": {
+ "type": "string"
+ },
+ "activeDeployment": {
+ "default": null,
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/active-deployment"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "lastPublished": {
+ "default": null,
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/timestamp"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "lastPublishedUid": {
+ "default": null,
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "loginPortalUid": {
+ "default": "",
+ "type": "string"
+ },
+ "activeThemeId": {
+ "default": "",
+ "type": "string"
+ },
+ "typesenseId": {
+ "type": "number"
+ },
+ "isPrivate": {
+ "default": false,
+ "type": "boolean"
+ },
+ "agentEnabled": {
+ "default": false,
+ "type": "boolean"
+ },
+ "accessGroups": {
+ "default": []
+ },
+ "slug": {
+ "$ref": "#/components/schemas/slug"
+ },
+ "publishStatus": {
+ "default": "",
+ "type": "string"
+ },
+ "publishMessage": {
+ "default": "",
+ "type": "string"
+ },
+ "repository": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/github-project-repository"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "required": [
+ "uid",
+ "createdAt",
+ "updatedAt",
+ "name",
+ "activeDeployment",
+ "lastPublished",
+ "lastPublishedUid",
+ "loginPortalUid",
+ "activeThemeId",
+ "isPrivate",
+ "agentEnabled",
+ "accessGroups",
+ "slug",
+ "publishStatus",
+ "publishMessage"
+ ],
+ "additionalProperties": false
+ },
+ "active-deployment": {
+ "type": "object",
+ "properties": {
+ "uid": {
+ "type": "string"
+ },
+ "domain": {
+ "type": "string"
+ },
+ "publishedAt": {
+ "$ref": "#/components/schemas/timestamp"
+ }
+ },
+ "required": [
+ "uid",
+ "domain",
+ "publishedAt"
+ ],
+ "additionalProperties": false
+ },
+ "github-project-repository": {
+ "type": "object",
+ "properties": {
+ "linkedBy": {
+ "type": "string"
+ },
+ "id": {
+ "type": "number"
+ },
+ "name": {
+ "type": "string",
+ "minLength": 2
+ },
+ "configPath": {
+ "default": "",
+ "type": "string"
+ },
+ "branch": {
+ "default": "",
+ "type": "string"
+ },
+ "publishOnMerge": {
+ "default": false,
+ "type": "boolean"
+ },
+ "publishPreviews": {
+ "default": false,
+ "type": "boolean"
+ },
+ "prComments": {
+ "default": false,
+ "type": "boolean"
+ },
+ "expired": {
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "linkedBy",
+ "id",
+ "name",
+ "configPath",
+ "branch",
+ "publishOnMerge",
+ "publishPreviews",
+ "prComments",
+ "expired"
+ ],
+ "additionalProperties": false
+ },
+ "email": {
+ "type": "string",
+ "format": "email",
+ "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
+ },
+ "team-summary": {
+ "type": "object",
+ "properties": {
+ "uid": {
+ "$ref": "#/components/schemas/nanoid"
+ },
+ "name": {
+ "$ref": "#/components/schemas/team-name"
+ },
+ "imageUri": {
+ "$ref": "#/components/schemas/team-image"
+ }
+ },
+ "required": [
+ "uid",
+ "name"
+ ],
+ "additionalProperties": false
+ },
+ "user": {
+ "type": "object",
+ "properties": {
+ "uid": {
+ "default": "nanoid()",
+ "$ref": "#/components/schemas/nanoid"
+ },
+ "createdAt": {
+ "default": "unixTimestamp()",
+ "$ref": "#/components/schemas/timestamp"
+ },
+ "updatedAt": {
+ "default": "unixTimestamp()",
+ "$ref": "#/components/schemas/timestamp"
+ },
+ "email": {
+ "$ref": "#/components/schemas/email"
+ },
+ "theme": {
+ "type": "string"
+ },
+ "activeTeamId": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "hasGithub": {
+ "default": false,
+ "type": "boolean"
+ },
+ "teams": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/team-summary"
+ }
+ }
+ },
+ "required": [
+ "uid",
+ "createdAt",
+ "updatedAt",
+ "email",
+ "activeTeamId",
+ "hasGithub",
+ "teams"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "security": [
+ {
+ "BearerAuth": []
+ }
+ ],
+ "paths": {
+ "/v1/apis": {
+ "get": {
+ "tags": [
+ "Registry"
+ ],
+ "description": "List all API documents across every namespace the caller can access.",
+ "summary": "List all API Documents",
+ "operationId": "listAllApiDocuments",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/api-document"
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst listAllAPIDocuments = await client.registry.listAllAPIDocuments();\nconsole.log(listAllAPIDocuments);"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi registry list-all-api-documents --bearer-auth \"$BEARER_AUTH\""
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nregistry = client.registry.list_all_api_documents()\nprint(registry)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tregistry, err := client.Registry.ListAllAPIDocuments(context.Background())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(registry)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.registry.RegistryListAllApiDocumentsParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval registry = client.registry().listAllApiDocuments(RegistryListAllApiDocumentsParams.none())\nprintln(registry)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.registry.list_all_api_documents\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.registry.RegistryListAllApiDocumentsParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nvar registry = client.registry().listAllApiDocuments();\nSystem.out.println(registry);"
+ }
+ ]
+ }
+ },
+ "/v1/apis/{namespace}": {
+ "get": {
+ "tags": [
+ "Registry"
+ ],
+ "description": "List API documents in a namespace.",
+ "summary": "List API Documents in a namespace",
+ "operationId": "listApiDocuments",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/api-document"
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "parameters": [
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "namespace",
+ "required": true
+ }
+ ],
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst listAPIDocuments = await client.registry.listAPIDocuments(\"namespace\");\nconsole.log(listAPIDocuments);"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi registry list-api-documents 'namespace' --bearer-auth \"$BEARER_AUTH\""
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nregistry = client.registry.list_api_documents(\n namespace=\"namespace\",\n)\nprint(registry)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tregistry, err := client.Registry.ListAPIDocuments(context.Background(), \"namespace\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(registry)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.registry.RegistryListApiDocumentsParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = RegistryListApiDocumentsParams.builder()\n .namespace(\"namespace\")\n .build()\nval registry = client.registry().listApiDocuments(params)\nprintln(registry)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.registry.list_api_documents(\"smoke-test\")\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.registry.RegistryListApiDocumentsParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nRegistryListApiDocumentsParams params = RegistryListApiDocumentsParams.builder()\n .namespace(\"namespace\")\n .build();\nvar registry = client.registry().listApiDocuments(params);\nSystem.out.println(registry);"
+ }
+ ]
+ },
+ "post": {
+ "tags": [
+ "Registry"
+ ],
+ "description": "Create an API document.",
+ "summary": "Create API Document",
+ "operationId": "createApiDocument",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "uid": {
+ "type": "string"
+ },
+ "versionUid": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ },
+ "jsonSha": {
+ "type": "string"
+ },
+ "yamlSha": {
+ "type": "string"
+ },
+ "versionSha": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "uid",
+ "versionUid",
+ "title",
+ "jsonSha",
+ "yamlSha",
+ "versionSha"
+ ],
+ "additionalProperties": false
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "title": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "version": {
+ "$ref": "#/components/schemas/version"
+ },
+ "slug": {
+ "type": "string"
+ },
+ "ruleset": {
+ "type": "string"
+ },
+ "isPrivate": {
+ "type": "boolean"
+ },
+ "document": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "title",
+ "version",
+ "slug",
+ "document"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": true
+ },
+ "parameters": [
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "namespace",
+ "required": true
+ }
+ ],
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst createAPIDocument = await client.registry.createAPIDocument(\"namespace\", {\n title: \"\",\n version: \"\",\n slug: \"\",\n document: \"\",\n});\nconsole.log(createAPIDocument);"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi registry create-api-document 'namespace' --bearer-auth \"$BEARER_AUTH\" --title 'title' --version-command 'version' --slug 'slug' --document 'document'"
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nregistry = client.registry.create_api_document(\n namespace=\"namespace\",\n title=\"\",\n version=\"\",\n slug=\"\",\n document=\"\",\n idempotency_key=\"\",\n)\nprint(registry)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tregistry, err := client.Registry.NewAPIDocument(context.Background(), \"namespace\", sdk.RegistryNewAPIDocumentParams{\n\t\tDocument: \"\",\n\t\tSlug: \"\",\n\t\tTitle: \"\",\n\t\tVersion: \"\",\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(registry)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.registry.RegistryCreateApiDocumentParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = RegistryCreateApiDocumentParams.builder()\n .namespace(\"namespace\")\n .title(\"title\")\n .version(\"version\")\n .slug(\"slug\")\n .document(\"document\")\n .build()\nval registry = client.registry().createApiDocument(params)\nprintln(registry)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.registry.create_api_document(\"smoke-test\", { title: \"title\", description: \"description\", version: \"version\", slug: \"slug\", ruleset: \"ruleset\", is_private: \"is_private\", document: \"document\" })\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.registry.RegistryCreateApiDocumentParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nRegistryCreateApiDocumentParams params = RegistryCreateApiDocumentParams.builder()\n .namespace(\"namespace\")\n .title(\"title\")\n .version(\"version\")\n .slug(\"slug\")\n .document(\"document\")\n .build();\nvar registry = client.registry().createApiDocument(params);\nSystem.out.println(registry);"
+ }
+ ]
+ }
+ },
+ "/v1/apis/{namespace}/{slug}": {
+ "patch": {
+ "tags": [
+ "Registry"
+ ],
+ "description": "Update metadata for an API document.",
+ "summary": "Update API Document metadata",
+ "operationId": "updateApiDocument",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "null"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "title": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "isPrivate": {
+ "type": "boolean"
+ },
+ "ruleset": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": true
+ },
+ "parameters": [
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "namespace",
+ "required": true
+ },
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "slug",
+ "required": true
+ }
+ ],
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nawait client.registry.updateAPIDocument(\"slug\", {\n namespace: \"namespace\",\n});"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi registry update-api-document 'slug' --bearer-auth \"$BEARER_AUTH\" --namespace 'namespace'"
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nregistry = client.registry.update_api_document(\n namespace=\"namespace\",\n slug=\"slug\",\n idempotency_key=\"\",\n)\nprint(registry)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tregistry, err := client.Registry.UpdateAPIDocument(context.Background(), \"namespace\", \"slug\", sdk.RegistryUpdateAPIDocumentParams{})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(registry)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.registry.RegistryUpdateApiDocumentParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = RegistryUpdateApiDocumentParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .build()\nval registry = client.registry().updateApiDocument(params)\nprintln(registry)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.registry.update_api_document(\"smoke-test\", { namespace: \"namespace\", title: \"title\", description: \"description\", is_private: \"is_private\", ruleset: \"ruleset\" })\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.registry.RegistryUpdateApiDocumentParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nRegistryUpdateApiDocumentParams params = RegistryUpdateApiDocumentParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .build();\nvar registry = client.registry().updateApiDocument(params);\nSystem.out.println(registry);"
+ }
+ ]
+ },
+ "delete": {
+ "tags": [
+ "Registry"
+ ],
+ "description": "Delete an API document and all versions.",
+ "summary": "Delete API Document",
+ "operationId": "deleteApiDocument",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "null"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "parameters": [
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "namespace",
+ "required": true
+ },
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "slug",
+ "required": true
+ }
+ ],
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nawait client.registry.deleteAPIDocument(\"slug\", {\n namespace: \"namespace\",\n});"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi registry delete-api-document 'slug' --bearer-auth \"$BEARER_AUTH\" --namespace 'namespace'"
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nregistry = client.registry.delete_api_document(\n namespace=\"namespace\",\n slug=\"slug\",\n idempotency_key=\"\",\n)\nprint(registry)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tregistry, err := client.Registry.DeleteAPIDocument(context.Background(), \"namespace\", \"slug\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(registry)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.registry.RegistryDeleteApiDocumentParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = RegistryDeleteApiDocumentParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .build()\nval registry = client.registry().deleteApiDocument(params)\nprintln(registry)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.registry.delete_api_document(\"smoke-test\", { namespace: \"namespace\" })\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.registry.RegistryDeleteApiDocumentParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nRegistryDeleteApiDocumentParams params = RegistryDeleteApiDocumentParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .build();\nvar registry = client.registry().deleteApiDocument(params);\nSystem.out.println(registry);"
+ }
+ ]
+ }
+ },
+ "/v1/apis/{namespace}/{slug}/version/{semver}": {
+ "get": {
+ "tags": [
+ "Registry"
+ ],
+ "description": "Get a specific API document version.",
+ "summary": "Get API Document",
+ "operationId": "getApiDocumentVersion",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "text/plain": {
+ "schema": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "parameters": [
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "namespace",
+ "required": true
+ },
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "slug",
+ "required": true
+ },
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "semver",
+ "required": true
+ }
+ ],
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst string_ = await client.registry.retrieveAPIDocumentVersion(\"semver\", {\n namespace: \"namespace\",\n slug: \"slug\",\n});\nconsole.log(string_);"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi registry retrieve-api-document-version 'semver' --bearer-auth \"$BEARER_AUTH\" --namespace 'namespace' --slug 'slug'"
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nregistry = client.registry.retrieve_api_document_version(\n namespace=\"namespace\",\n slug=\"slug\",\n semver=\"semver\",\n)\nprint(registry)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tregistry, err := client.Registry.GetAPIDocumentVersion(context.Background(), \"namespace\", \"slug\", \"semver\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(registry)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.registry.RegistryRetrieveApiDocumentVersionParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = RegistryRetrieveApiDocumentVersionParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .semver(\"semver\")\n .build()\nval registry = client.registry().retrieveApiDocumentVersion(params)\nprintln(registry)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.registry.retrieve_api_document_version(\"smoke-test\", { namespace: \"namespace\", slug: \"slug\" })\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.registry.RegistryRetrieveApiDocumentVersionParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nRegistryRetrieveApiDocumentVersionParams params = RegistryRetrieveApiDocumentVersionParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .semver(\"semver\")\n .build();\nvar registry = client.registry().retrieveApiDocumentVersion(params);\nSystem.out.println(registry);"
+ }
+ ]
+ },
+ "patch": {
+ "tags": [
+ "Registry"
+ ],
+ "description": "Update the registry file content for an API document version.",
+ "summary": "Update API Document version",
+ "operationId": "updateApiDocumentVersion",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "jsonSha": {
+ "type": "string"
+ },
+ "yamlSha": {
+ "type": "string"
+ },
+ "versionSha": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "jsonSha",
+ "yamlSha",
+ "versionSha"
+ ],
+ "additionalProperties": false
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "document": {
+ "type": "string"
+ },
+ "lastKnownVersionSha": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "document"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": true
+ },
+ "parameters": [
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "namespace",
+ "required": true
+ },
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "slug",
+ "required": true
+ },
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "semver",
+ "required": true
+ }
+ ],
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst updateAPIDocumentVersion = await client.registry.updateAPIDocumentVersion(\"semver\", {\n namespace: \"namespace\",\n slug: \"slug\",\n document: \"\",\n});\nconsole.log(updateAPIDocumentVersion);"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi registry update-api-document-version 'semver' --bearer-auth \"$BEARER_AUTH\" --namespace 'namespace' --slug 'slug' --document 'document'"
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nregistry = client.registry.update_api_document_version(\n namespace=\"namespace\",\n slug=\"slug\",\n semver=\"semver\",\n document=\"\",\n idempotency_key=\"\",\n)\nprint(registry)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tregistry, err := client.Registry.UpdateAPIDocumentVersion(context.Background(), \"namespace\", \"slug\", \"semver\", sdk.RegistryUpdateAPIDocumentVersionParams{\n\t\tDocument: \"\",\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(registry)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.registry.RegistryUpdateApiDocumentVersionParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = RegistryUpdateApiDocumentVersionParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .semver(\"semver\")\n .document(\"document\")\n .build()\nval registry = client.registry().updateApiDocumentVersion(params)\nprintln(registry)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.registry.update_api_document_version(\"smoke-test\", { namespace: \"namespace\", slug: \"slug\", document: \"document\", last_known_version_sha: \"last_known_version_sha\" })\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.registry.RegistryUpdateApiDocumentVersionParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nRegistryUpdateApiDocumentVersionParams params = RegistryUpdateApiDocumentVersionParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .semver(\"semver\")\n .document(\"document\")\n .build();\nvar registry = client.registry().updateApiDocumentVersion(params);\nSystem.out.println(registry);"
+ }
+ ]
+ },
+ "delete": {
+ "tags": [
+ "Registry"
+ ],
+ "description": "Delete a specific API document version.",
+ "summary": "Delete API Document version",
+ "operationId": "deleteApiDocumentVersion",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "null"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "parameters": [
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "namespace",
+ "required": true
+ },
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "slug",
+ "required": true
+ },
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "semver",
+ "required": true
+ }
+ ],
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nawait client.registry.deleteAPIDocumentVersion(\"semver\", {\n namespace: \"namespace\",\n slug: \"slug\",\n});"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi registry delete-api-document-version 'semver' --bearer-auth \"$BEARER_AUTH\" --namespace 'namespace' --slug 'slug'"
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nregistry = client.registry.delete_api_document_version(\n namespace=\"namespace\",\n slug=\"slug\",\n semver=\"semver\",\n idempotency_key=\"\",\n)\nprint(registry)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tregistry, err := client.Registry.DeleteAPIDocumentVersion(context.Background(), \"namespace\", \"slug\", \"semver\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(registry)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.registry.RegistryDeleteApiDocumentVersionParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = RegistryDeleteApiDocumentVersionParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .semver(\"semver\")\n .build()\nval registry = client.registry().deleteApiDocumentVersion(params)\nprintln(registry)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.registry.delete_api_document_version(\"smoke-test\", { namespace: \"namespace\", slug: \"slug\" })\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.registry.RegistryDeleteApiDocumentVersionParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nRegistryDeleteApiDocumentVersionParams params = RegistryDeleteApiDocumentVersionParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .semver(\"semver\")\n .build();\nvar registry = client.registry().deleteApiDocumentVersion(params);\nSystem.out.println(registry);"
+ }
+ ]
+ }
+ },
+ "/v1/apis/{namespace}/{slug}/version/{semver}/metadata": {
+ "get": {
+ "tags": [
+ "Registry"
+ ],
+ "description": "Get metadata (uid, content shas, version sha, tags) for a specific API document version.",
+ "summary": "Get API Document version metadata",
+ "operationId": "getApiDocumentVersionMetadata",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/managed-doc-version"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "parameters": [
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "namespace",
+ "required": true
+ },
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "slug",
+ "required": true
+ },
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "semver",
+ "required": true
+ }
+ ],
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst managedDocVersion = await client.registry.listAPIDocumentVersionMetadata(\"semver\", {\n namespace: \"namespace\",\n slug: \"slug\",\n});\nconsole.log(managedDocVersion);"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi registry list-api-document-version-metadata 'semver' --bearer-auth \"$BEARER_AUTH\" --namespace 'namespace' --slug 'slug'"
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nregistry = client.registry.list_api_document_version_metadata(\n namespace=\"namespace\",\n slug=\"slug\",\n semver=\"semver\",\n)\nprint(registry)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tregistry, err := client.Registry.ListAPIDocumentVersionMetadata(context.Background(), \"namespace\", \"slug\", \"semver\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(registry)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.registry.RegistryListApiDocumentVersionMetadataParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = RegistryListApiDocumentVersionMetadataParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .semver(\"semver\")\n .build()\nval registry = client.registry().listApiDocumentVersionMetadata(params)\nprintln(registry)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.registry.list_api_document_version_metadata(\"smoke-test\", { namespace: \"namespace\", slug: \"slug\" })\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.registry.RegistryListApiDocumentVersionMetadataParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nRegistryListApiDocumentVersionMetadataParams params = RegistryListApiDocumentVersionMetadataParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .semver(\"semver\")\n .build();\nvar registry = client.registry().listApiDocumentVersionMetadata(params);\nSystem.out.println(registry);"
+ }
+ ]
+ }
+ },
+ "/v1/apis/{namespace}/{slug}/version": {
+ "post": {
+ "tags": [
+ "Registry"
+ ],
+ "description": "Create a new API document version.",
+ "summary": "Create API Document version",
+ "operationId": "createApiDocumentVersion",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/managed-doc-version"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "version": {
+ "$ref": "#/components/schemas/version"
+ },
+ "document": {
+ "type": "string"
+ },
+ "force": {
+ "type": "boolean"
+ },
+ "lastKnownVersionSha": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "version",
+ "document"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": true
+ },
+ "parameters": [
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "namespace",
+ "required": true
+ },
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "slug",
+ "required": true
+ }
+ ],
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst managedDocVersion = await client.registry.createAPIDocumentVersion(\"slug\", {\n namespace: \"namespace\",\n version: \"\",\n document: \"\",\n});\nconsole.log(managedDocVersion);"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi registry create-api-document-version 'slug' --bearer-auth \"$BEARER_AUTH\" --namespace 'namespace' --version-command 'version' --document 'document'"
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nregistry = client.registry.create_api_document_version(\n namespace=\"namespace\",\n slug=\"slug\",\n version=\"\",\n document=\"\",\n idempotency_key=\"\",\n)\nprint(registry)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tregistry, err := client.Registry.NewAPIDocumentVersion(context.Background(), \"namespace\", \"slug\", sdk.RegistryNewAPIDocumentVersionParams{\n\t\tDocument: \"\",\n\t\tVersion: \"\",\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(registry)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.registry.RegistryCreateApiDocumentVersionParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = RegistryCreateApiDocumentVersionParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .version(\"version\")\n .document(\"document\")\n .build()\nval registry = client.registry().createApiDocumentVersion(params)\nprintln(registry)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.registry.create_api_document_version(\"smoke-test\", { namespace: \"namespace\", version: \"version\", document: \"document\", force: \"force\", last_known_version_sha: \"last_known_version_sha\" })\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.registry.RegistryCreateApiDocumentVersionParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nRegistryCreateApiDocumentVersionParams params = RegistryCreateApiDocumentVersionParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .version(\"version\")\n .document(\"document\")\n .build();\nvar registry = client.registry().createApiDocumentVersion(params);\nSystem.out.println(registry);"
+ }
+ ]
+ }
+ },
+ "/v1/apis/{namespace}/{slug}/access-group": {
+ "post": {
+ "tags": [
+ "Registry"
+ ],
+ "description": "Add an access group to an API document.",
+ "summary": "Add access group",
+ "operationId": "addApiDocumentAccessGroup",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "null"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/access-group"
+ }
+ }
+ },
+ "required": true
+ },
+ "parameters": [
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "namespace",
+ "required": true
+ },
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "slug",
+ "required": true
+ }
+ ],
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nawait client.registry.createAPIDocumentAccessGroup(\"slug\", {\n namespace: \"namespace\",\n accessGroupSlug: \"\",\n});"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi registry create-api-document-access-group 'slug' --bearer-auth \"$BEARER_AUTH\" --namespace 'namespace' --access-group-slug 'accessGroupSlug'"
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nregistry = client.registry.create_api_document_access_group(\n namespace=\"namespace\",\n slug=\"slug\",\n access_group_slug=\"\",\n idempotency_key=\"\",\n)\nprint(registry)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tregistry, err := client.Registry.NewAPIDocumentAccessGroup(context.Background(), \"namespace\", \"slug\", sdk.RegistryNewAPIDocumentAccessGroupParams{\n\t\tAccessGroup: sdk.AccessGroup{\n\t\tAccessGroupSlug: \"\",\n\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(registry)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.registry.RegistryCreateApiDocumentAccessGroupParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = RegistryCreateApiDocumentAccessGroupParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .accessGroupSlug(\"accessGroupSlug\")\n .build()\nval registry = client.registry().createApiDocumentAccessGroup(params)\nprintln(registry)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.registry.create_api_document_access_group(\"smoke-test\", { namespace: \"namespace\", access_group_slug: \"access_group_slug\" })\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.registry.RegistryCreateApiDocumentAccessGroupParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nRegistryCreateApiDocumentAccessGroupParams params = RegistryCreateApiDocumentAccessGroupParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .accessGroupSlug(\"accessGroupSlug\")\n .build();\nvar registry = client.registry().createApiDocumentAccessGroup(params);\nSystem.out.println(registry);"
+ }
+ ]
+ },
+ "delete": {
+ "tags": [
+ "Registry"
+ ],
+ "description": "Remove an access group from an API document.",
+ "summary": "Remove access group",
+ "operationId": "removeApiDocumentAccessGroup",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "null"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/access-group"
+ }
+ }
+ },
+ "required": true
+ },
+ "parameters": [
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "namespace",
+ "required": true
+ },
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "slug",
+ "required": true
+ }
+ ],
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nawait client.registry.deleteAPIDocumentAccessGroup(\"slug\", {\n namespace: \"namespace\",\n accessGroupSlug: \"\",\n});"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi registry delete-api-document-access-group 'slug' --bearer-auth \"$BEARER_AUTH\" --namespace 'namespace' --access-group-slug 'accessGroupSlug'"
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nregistry = client.registry.delete_api_document_access_group(\n namespace=\"namespace\",\n slug=\"slug\",\n access_group_slug=\"\",\n idempotency_key=\"\",\n)\nprint(registry)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tregistry, err := client.Registry.DeleteAPIDocumentAccessGroup(context.Background(), \"namespace\", \"slug\", sdk.RegistryDeleteAPIDocumentAccessGroupParams{\n\t\tAccessGroup: sdk.AccessGroup{\n\t\tAccessGroupSlug: \"\",\n\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(registry)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.registry.RegistryDeleteApiDocumentAccessGroupParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = RegistryDeleteApiDocumentAccessGroupParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .accessGroupSlug(\"accessGroupSlug\")\n .build()\nval registry = client.registry().deleteApiDocumentAccessGroup(params)\nprintln(registry)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.registry.delete_api_document_access_group(\"smoke-test\", { namespace: \"namespace\", access_group_slug: \"access_group_slug\" })\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.registry.RegistryDeleteApiDocumentAccessGroupParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nRegistryDeleteApiDocumentAccessGroupParams params = RegistryDeleteApiDocumentAccessGroupParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .accessGroupSlug(\"accessGroupSlug\")\n .build();\nvar registry = client.registry().deleteApiDocumentAccessGroup(params);\nSystem.out.println(registry);"
+ }
+ ]
+ }
+ },
+ "/v1/schemas/{namespace}": {
+ "get": {
+ "tags": [
+ "Schemas"
+ ],
+ "description": "List schemas in a namespace.",
+ "summary": "List all shared components",
+ "operationId": "listSchemas",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/schema"
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "parameters": [
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "namespace",
+ "required": true
+ }
+ ],
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst list = await client.schemas.list(\"namespace\");\nconsole.log(list);"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi schemas list 'namespace' --bearer-auth \"$BEARER_AUTH\""
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nschema = client.schemas.list(\n namespace=\"namespace\",\n)\nprint(schema)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tschema, err := client.Schemas.List(context.Background(), \"namespace\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(schema)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.schemas.SchemaListParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = SchemaListParams.builder()\n .namespace(\"namespace\")\n .build()\nval schema = client.schemas().list(params)\nprintln(schema)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.schemas.list(\"smoke-test\")\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.schemas.SchemaListParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nSchemaListParams params = SchemaListParams.builder()\n .namespace(\"namespace\")\n .build();\nvar schema = client.schemas().list(params);\nSystem.out.println(schema);"
+ }
+ ]
+ },
+ "post": {
+ "tags": [
+ "Schemas"
+ ],
+ "description": "Create a schema in a namespace.",
+ "summary": "Create a shared component",
+ "operationId": "createSchema",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/uid"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "title": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "version": {
+ "$ref": "#/components/schemas/version"
+ },
+ "slug": {
+ "type": "string"
+ },
+ "isPrivate": {
+ "type": "boolean"
+ },
+ "document": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "title",
+ "version",
+ "slug",
+ "document"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": true
+ },
+ "parameters": [
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "namespace",
+ "required": true
+ }
+ ],
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst uID = await client.schemas.create(\"namespace\", {\n title: \"\",\n version: \"\",\n slug: \"\",\n document: \"\",\n});\nconsole.log(uID);"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi schemas create 'namespace' --bearer-auth \"$BEARER_AUTH\" --title 'title' --version-command 'version' --slug 'slug' --document 'document'"
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nschema = client.schemas.create(\n namespace=\"namespace\",\n title=\"\",\n version=\"\",\n slug=\"\",\n document=\"\",\n idempotency_key=\"\",\n)\nprint(schema)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tschema, err := client.Schemas.New(context.Background(), \"namespace\", sdk.SchemaNewParams{\n\t\tDocument: \"\",\n\t\tSlug: \"\",\n\t\tTitle: \"\",\n\t\tVersion: \"\",\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(schema)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.schemas.SchemaCreateParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = SchemaCreateParams.builder()\n .namespace(\"namespace\")\n .title(\"title\")\n .version(\"version\")\n .slug(\"slug\")\n .document(\"document\")\n .build()\nval schema = client.schemas().create(params)\nprintln(schema)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.schemas.create(\"smoke-test\", { title: \"title\", description: \"description\", version: \"version\", slug: \"slug\", is_private: \"is_private\", document: \"document\" })\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.schemas.SchemaCreateParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nSchemaCreateParams params = SchemaCreateParams.builder()\n .namespace(\"namespace\")\n .title(\"title\")\n .version(\"version\")\n .slug(\"slug\")\n .document(\"document\")\n .build();\nvar schema = client.schemas().create(params);\nSystem.out.println(schema);"
+ }
+ ]
+ }
+ },
+ "/v1/schemas/{namespace}/{slug}": {
+ "patch": {
+ "tags": [
+ "Schemas"
+ ],
+ "description": "Update schema metadata.",
+ "summary": "Update shared component metadata",
+ "operationId": "updateSchema",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "null"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "title": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "isPrivate": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": true
+ },
+ "parameters": [
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "namespace",
+ "required": true
+ },
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "slug",
+ "required": true
+ }
+ ],
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nawait client.schemas.update(\"slug\", {\n namespace: \"namespace\",\n});"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi schemas update 'slug' --bearer-auth \"$BEARER_AUTH\" --namespace 'namespace'"
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nschema = client.schemas.update(\n namespace=\"namespace\",\n slug=\"slug\",\n idempotency_key=\"\",\n)\nprint(schema)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tschema, err := client.Schemas.Update(context.Background(), \"namespace\", \"slug\", sdk.SchemaUpdateParams{})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(schema)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.schemas.SchemaUpdateParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = SchemaUpdateParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .build()\nval schema = client.schemas().update(params)\nprintln(schema)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.schemas.update(\"smoke-test\", { namespace: \"namespace\", title: \"title\", description: \"description\", is_private: \"is_private\" })\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.schemas.SchemaUpdateParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nSchemaUpdateParams params = SchemaUpdateParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .build();\nvar schema = client.schemas().update(params);\nSystem.out.println(schema);"
+ }
+ ]
+ },
+ "delete": {
+ "tags": [
+ "Schemas"
+ ],
+ "description": "Delete a schema and all related versions.",
+ "summary": "Delete a shared component",
+ "operationId": "deleteSchema",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "null"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "parameters": [
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "namespace",
+ "required": true
+ },
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "slug",
+ "required": true
+ }
+ ],
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nawait client.schemas.delete(\"slug\", {\n namespace: \"namespace\",\n});"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi schemas delete 'slug' --bearer-auth \"$BEARER_AUTH\" --namespace 'namespace'"
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nschema = client.schemas.delete(\n namespace=\"namespace\",\n slug=\"slug\",\n idempotency_key=\"\",\n)\nprint(schema)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tschema, err := client.Schemas.Delete(context.Background(), \"namespace\", \"slug\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(schema)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.schemas.SchemaDeleteParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = SchemaDeleteParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .build()\nval schema = client.schemas().delete(params)\nprintln(schema)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.schemas.delete(\"smoke-test\", { namespace: \"namespace\" })\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.schemas.SchemaDeleteParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nSchemaDeleteParams params = SchemaDeleteParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .build();\nvar schema = client.schemas().delete(params);\nSystem.out.println(schema);"
+ }
+ ]
+ }
+ },
+ "/v1/schemas/{namespace}/{slug}/version/{semver}": {
+ "get": {
+ "tags": [
+ "Schemas"
+ ],
+ "description": "Get a specific schema version document.",
+ "summary": "Get a shared component document",
+ "operationId": "getSchemaVersion",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "text/plain": {
+ "schema": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "parameters": [
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "namespace",
+ "required": true
+ },
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "slug",
+ "required": true
+ },
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "semver",
+ "required": true
+ }
+ ],
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst string_ = await client.schemas.version.retrieveSchema(\"semver\", {\n namespace: \"namespace\",\n slug: \"slug\",\n});\nconsole.log(string_);"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi schemas:version-command retrieve-schema 'semver' --bearer-auth \"$BEARER_AUTH\" --namespace 'namespace' --slug 'slug'"
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nversion = client.schemas.version.retrieve_schema(\n namespace=\"namespace\",\n slug=\"slug\",\n semver=\"semver\",\n)\nprint(version)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tversion, err := client.Schemas.Version.GetSchema(context.Background(), \"namespace\", \"slug\", \"semver\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(version)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.schemas.version.VersionRetrieveSchemaParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = VersionRetrieveSchemaParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .semver(\"semver\")\n .build()\nval version = client.schemas().version().retrieveSchema(params)\nprintln(version)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.schemas.version.retrieve_schema(\"smoke-test\", { namespace: \"namespace\", slug: \"slug\" })\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.schemas.version.VersionRetrieveSchemaParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nVersionRetrieveSchemaParams params = VersionRetrieveSchemaParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .semver(\"semver\")\n .build();\nvar version = client.schemas().version().retrieveSchema(params);\nSystem.out.println(version);"
+ }
+ ]
+ },
+ "delete": {
+ "tags": [
+ "Schemas"
+ ],
+ "description": "Delete a schema version.",
+ "summary": "Delete a shared component version",
+ "operationId": "deleteSchemaVersion",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "null"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "parameters": [
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "namespace",
+ "required": true
+ },
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "slug",
+ "required": true
+ },
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "semver",
+ "required": true
+ }
+ ],
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nawait client.schemas.version.deleteSchema(\"semver\", {\n namespace: \"namespace\",\n slug: \"slug\",\n});"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi schemas:version-command delete-schema 'semver' --bearer-auth \"$BEARER_AUTH\" --namespace 'namespace' --slug 'slug'"
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nversion = client.schemas.version.delete_schema(\n namespace=\"namespace\",\n slug=\"slug\",\n semver=\"semver\",\n idempotency_key=\"\",\n)\nprint(version)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tversion, err := client.Schemas.Version.DeleteSchema(context.Background(), \"namespace\", \"slug\", \"semver\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(version)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.schemas.version.VersionDeleteSchemaParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = VersionDeleteSchemaParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .semver(\"semver\")\n .build()\nval version = client.schemas().version().deleteSchema(params)\nprintln(version)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.schemas.version.delete_schema(\"smoke-test\", { namespace: \"namespace\", slug: \"slug\" })\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.schemas.version.VersionDeleteSchemaParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nVersionDeleteSchemaParams params = VersionDeleteSchemaParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .semver(\"semver\")\n .build();\nvar version = client.schemas().version().deleteSchema(params);\nSystem.out.println(version);"
+ }
+ ]
+ }
+ },
+ "/v1/schemas/{namespace}/{slug}/version": {
+ "post": {
+ "tags": [
+ "Schemas"
+ ],
+ "description": "Create a schema version.",
+ "summary": "Create a shared component version",
+ "operationId": "createSchemaVersion",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/uid"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "version": {
+ "$ref": "#/components/schemas/version"
+ },
+ "document": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "version",
+ "document"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": true
+ },
+ "parameters": [
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "namespace",
+ "required": true
+ },
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "slug",
+ "required": true
+ }
+ ],
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst uID = await client.schemas.version.createSchema(\"slug\", {\n namespace: \"namespace\",\n version: \"\",\n document: \"\",\n});\nconsole.log(uID);"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi schemas:version-command create-schema 'slug' --bearer-auth \"$BEARER_AUTH\" --namespace 'namespace' --version-command 'version' --document 'document'"
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nversion = client.schemas.version.create_schema(\n namespace=\"namespace\",\n slug=\"slug\",\n version=\"\",\n document=\"\",\n idempotency_key=\"\",\n)\nprint(version)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tversion, err := client.Schemas.Version.NewSchema(context.Background(), \"namespace\", \"slug\", sdk.SchemaVersionNewSchemaParams{\n\t\tDocument: \"\",\n\t\tVersion: \"\",\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(version)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.schemas.version.VersionCreateSchemaParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = VersionCreateSchemaParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .version(\"version\")\n .document(\"document\")\n .build()\nval version = client.schemas().version().createSchema(params)\nprintln(version)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.schemas.version.create_schema(\"smoke-test\", { namespace: \"namespace\", version: \"version\", document: \"document\" })\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.schemas.version.VersionCreateSchemaParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nVersionCreateSchemaParams params = VersionCreateSchemaParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .version(\"version\")\n .document(\"document\")\n .build();\nvar version = client.schemas().version().createSchema(params);\nSystem.out.println(version);"
+ }
+ ]
+ }
+ },
+ "/v1/schemas/{namespace}/{slug}/access-group": {
+ "post": {
+ "tags": [
+ "Schemas"
+ ],
+ "description": "Add an access group to a schema.",
+ "summary": "Add shared component access group",
+ "operationId": "addSchemaAccessGroup",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "null"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/access-group"
+ }
+ }
+ },
+ "required": true
+ },
+ "parameters": [
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "namespace",
+ "required": true
+ },
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "slug",
+ "required": true
+ }
+ ],
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nawait client.schemas.accessGroup.createSchema(\"slug\", {\n namespace: \"namespace\",\n accessGroupSlug: \"\",\n});"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi schemas:access-group create-schema 'slug' --bearer-auth \"$BEARER_AUTH\" --namespace 'namespace' --access-group-slug 'accessGroupSlug'"
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\naccess_group = client.schemas.access_group.create_schema(\n namespace=\"namespace\",\n slug=\"slug\",\n access_group_slug=\"\",\n idempotency_key=\"\",\n)\nprint(access_group)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\taccessGroup, err := client.Schemas.AccessGroup.NewSchema(context.Background(), \"namespace\", \"slug\", sdk.SchemaAccessGroupNewSchemaParams{\n\t\tAccessGroup: sdk.AccessGroup{\n\t\tAccessGroupSlug: \"\",\n\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(accessGroup)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.schemas.accessgroup.AccessGroupCreateSchemaParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = AccessGroupCreateSchemaParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .accessGroupSlug(\"accessGroupSlug\")\n .build()\nval accessGroup = client.schemas().accessGroup().createSchema(params)\nprintln(accessGroup)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.schemas.accessGroup.create_schema(\"smoke-test\", { namespace: \"namespace\", access_group_slug: \"access_group_slug\" })\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.schemas.accessgroup.AccessGroupCreateSchemaParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nAccessGroupCreateSchemaParams params = AccessGroupCreateSchemaParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .accessGroupSlug(\"accessGroupSlug\")\n .build();\nvar accessGroup = client.schemas().accessGroup().createSchema(params);\nSystem.out.println(accessGroup);"
+ }
+ ]
+ },
+ "delete": {
+ "tags": [
+ "Schemas"
+ ],
+ "description": "Remove an access group from a schema.",
+ "summary": "Remove shared component access group",
+ "operationId": "removeSchemaAccessGroup",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "null"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/access-group"
+ }
+ }
+ },
+ "required": true
+ },
+ "parameters": [
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "namespace",
+ "required": true
+ },
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "slug",
+ "required": true
+ }
+ ],
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nawait client.schemas.accessGroup.deleteSchema(\"slug\", {\n namespace: \"namespace\",\n accessGroupSlug: \"\",\n});"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi schemas:access-group delete-schema 'slug' --bearer-auth \"$BEARER_AUTH\" --namespace 'namespace' --access-group-slug 'accessGroupSlug'"
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\naccess_group = client.schemas.access_group.delete_schema(\n namespace=\"namespace\",\n slug=\"slug\",\n access_group_slug=\"\",\n idempotency_key=\"\",\n)\nprint(access_group)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\taccessGroup, err := client.Schemas.AccessGroup.DeleteSchema(context.Background(), \"namespace\", \"slug\", sdk.SchemaAccessGroupDeleteSchemaParams{\n\t\tAccessGroup: sdk.AccessGroup{\n\t\tAccessGroupSlug: \"\",\n\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(accessGroup)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.schemas.accessgroup.AccessGroupDeleteSchemaParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = AccessGroupDeleteSchemaParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .accessGroupSlug(\"accessGroupSlug\")\n .build()\nval accessGroup = client.schemas().accessGroup().deleteSchema(params)\nprintln(accessGroup)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.schemas.accessGroup.delete_schema(\"smoke-test\", { namespace: \"namespace\", access_group_slug: \"access_group_slug\" })\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.schemas.accessgroup.AccessGroupDeleteSchemaParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nAccessGroupDeleteSchemaParams params = AccessGroupDeleteSchemaParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .accessGroupSlug(\"accessGroupSlug\")\n .build();\nvar accessGroup = client.schemas().accessGroup().deleteSchema(params);\nSystem.out.println(accessGroup);"
+ }
+ ]
+ }
+ },
+ "/v1/login-portals/{slug}": {
+ "get": {
+ "tags": [
+ "Login Portals"
+ ],
+ "description": "Get a login portal by slug.",
+ "summary": "Get a login portal",
+ "operationId": "getLoginPortal",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "uid": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ },
+ "slug": {
+ "type": "string"
+ },
+ "email": {
+ "$ref": "#/components/schemas/login-portal-email"
+ },
+ "page": {
+ "$ref": "#/components/schemas/login-portal-page"
+ }
+ },
+ "required": [
+ "uid",
+ "title",
+ "slug",
+ "email",
+ "page"
+ ],
+ "additionalProperties": false
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "parameters": [
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "slug",
+ "required": true
+ }
+ ],
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst retrieve = await client.loginPortals.retrieve(\"slug\");\nconsole.log(retrieve);"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi login-portals retrieve 'slug' --bearer-auth \"$BEARER_AUTH\""
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nlogin_portal = client.login_portals.retrieve(\n slug=\"slug\",\n)\nprint(login_portal)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tloginPortal, err := client.LoginPortals.Get(context.Background(), \"slug\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(loginPortal)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.loginportals.LoginPortalRetrieveParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = LoginPortalRetrieveParams.builder()\n .slug(\"slug\")\n .build()\nval loginPortal = client.loginPortals().retrieve(params)\nprintln(loginPortal)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.loginPortals.retrieve(\"smoke-test\")\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.loginportals.LoginPortalRetrieveParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nLoginPortalRetrieveParams params = LoginPortalRetrieveParams.builder()\n .slug(\"slug\")\n .build();\nvar loginPortal = client.loginPortals().retrieve(params);\nSystem.out.println(loginPortal);"
+ }
+ ]
+ },
+ "patch": {
+ "tags": [
+ "Login Portals"
+ ],
+ "description": "Update metadata for a login portal.",
+ "summary": "Update portal metadata",
+ "operationId": "updateLoginPortal",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "null"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "title": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": true
+ },
+ "parameters": [
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "slug",
+ "required": true
+ }
+ ],
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nawait client.loginPortals.update(\"slug\", {});"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi login-portals update 'slug' --bearer-auth \"$BEARER_AUTH\""
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nlogin_portal = client.login_portals.update(\n slug=\"slug\",\n idempotency_key=\"\",\n)\nprint(login_portal)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tloginPortal, err := client.LoginPortals.Update(context.Background(), \"slug\", sdk.LoginPortalUpdateParams{})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(loginPortal)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.loginportals.LoginPortalUpdateParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = LoginPortalUpdateParams.builder()\n .slug(\"slug\")\n .build()\nval loginPortal = client.loginPortals().update(params)\nprintln(loginPortal)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.loginPortals.update(\"smoke-test\", { title: \"title\" })\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.loginportals.LoginPortalUpdateParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nLoginPortalUpdateParams params = LoginPortalUpdateParams.builder()\n .slug(\"slug\")\n .build();\nvar loginPortal = client.loginPortals().update(params);\nSystem.out.println(loginPortal);"
+ }
+ ]
+ },
+ "delete": {
+ "tags": [
+ "Login Portals"
+ ],
+ "description": "Delete a login portal.",
+ "summary": "Delete a login portal",
+ "operationId": "deleteLoginPortal",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "null"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "parameters": [
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "slug",
+ "required": true
+ }
+ ],
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nawait client.loginPortals.delete(\"slug\");"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi login-portals delete 'slug' --bearer-auth \"$BEARER_AUTH\""
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nlogin_portal = client.login_portals.delete(\n slug=\"slug\",\n idempotency_key=\"\",\n)\nprint(login_portal)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tloginPortal, err := client.LoginPortals.Delete(context.Background(), \"slug\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(loginPortal)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.loginportals.LoginPortalDeleteParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = LoginPortalDeleteParams.builder()\n .slug(\"slug\")\n .build()\nval loginPortal = client.loginPortals().delete(params)\nprintln(loginPortal)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.loginPortals.delete(\"smoke-test\")\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.loginportals.LoginPortalDeleteParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nLoginPortalDeleteParams params = LoginPortalDeleteParams.builder()\n .slug(\"slug\")\n .build();\nvar loginPortal = client.loginPortals().delete(params);\nSystem.out.println(loginPortal);"
+ }
+ ]
+ }
+ },
+ "/v1/login-portals": {
+ "post": {
+ "tags": [
+ "Login Portals"
+ ],
+ "description": "Create a login portal for the current team.",
+ "summary": "Create a portal",
+ "operationId": "createLoginPortal",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/uid"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "title": {
+ "type": "string"
+ },
+ "slug": {
+ "type": "string"
+ },
+ "email": {
+ "$ref": "#/components/schemas/login-portal-email"
+ },
+ "page": {
+ "$ref": "#/components/schemas/login-portal-page"
+ }
+ },
+ "required": [
+ "title",
+ "slug",
+ "email",
+ "page"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": true
+ },
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst uID = await client.loginPortals.create({\n title: \"\",\n slug: \"\",\n email: {\n logo: \"\",\n logoSize: \"100\",\n buttonText: \"Login\",\n message: \"Click to access private documentation hosted by scalar.com\",\n title: \"Private Docs\",\n mainColor: \"#2a2f45\",\n mainBackground: \"#f6f6f6\",\n cardColor: \"2a2f45\",\n cardBackground: \"#fff\",\n buttonColor: \"#fff\",\n buttonBackground: \"#0f0f0f\",\n },\n page: {\n title: \"Scalar Private Docs\",\n description: \"Login to access your documentation\",\n head: \"\",\n script: \"\",\n theme: \"\",\n companyName: \"\",\n logo: \"\",\n logoUrl: \"\",\n favicon: \"\",\n termsLink: \"\",\n privacyLink: \"\",\n formTitle: \"Scalar Private Docs\",\n formDescription: \"Login to access your documentation\",\n formImage: \"\",\n },\n});\nconsole.log(uID);"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi login-portals create --bearer-auth \"$BEARER_AUTH\" --title 'title' --slug 'slug' --email '{\"logo\":\"\",\"logoSize\":\"100\",\"buttonText\":\"Login\",\"message\":\"Click to access private documentation hosted by scalar.com\",\"title\":\"Private Docs\",\"mainColor\":\"#2a2f45\",\"mainBackground\":\"#f6f6f6\",\"cardColor\":\"2a2f45\",\"cardBackground\":\"#fff\",\"buttonColor\":\"#fff\",\"buttonBackground\":\"#0f0f0f\"}' --page '{\"title\":\"Scalar Private Docs\",\"description\":\"Login to access your documentation\",\"head\":\"\",\"script\":\"\",\"theme\":\"\",\"companyName\":\"\",\"logo\":\"\",\"logoURL\":\"\",\"favicon\":\"\",\"termsLink\":\"\",\"privacyLink\":\"\",\"formTitle\":\"Scalar Private Docs\",\"formDescription\":\"Login to access your documentation\",\"formImage\":\"\"}'"
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nlogin_portal = client.login_portals.create(\n title=\"\",\n slug=\"\",\n email={\"logo\": \"\", \"logo_size\": \"100\", \"button_text\": \"Login\", \"message\": \"Click to access private documentation hosted by scalar.com\", \"title\": \"Private Docs\", \"main_color\": \"#2a2f45\", \"main_background\": \"#f6f6f6\", \"card_color\": \"2a2f45\", \"card_background\": \"#fff\", \"button_color\": \"#fff\", \"button_background\": \"#0f0f0f\"},\n page={\"title\": \"Scalar Private Docs\", \"description\": \"Login to access your documentation\", \"head\": \"\", \"script\": \"\", \"theme\": \"\", \"company_name\": \"\", \"logo\": \"\", \"logo_url\": \"\", \"favicon\": \"\", \"terms_link\": \"\", \"privacy_link\": \"\", \"form_title\": \"Scalar Private Docs\", \"form_description\": \"Login to access your documentation\", \"form_image\": \"\"},\n idempotency_key=\"\",\n)\nprint(login_portal)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tloginPortal, err := client.LoginPortals.New(context.Background(), sdk.LoginPortalNewParams{\n\t\tEmail: sdk.LoginPortalEmail{\n\t\t\tLogo: \"\",\n\t\t\tLogoSize: \"100\",\n\t\t\tButtonText: \"Login\",\n\t\t\tMessage: \"Click to access private documentation hosted by scalar.com\",\n\t\t\tTitle: \"Private Docs\",\n\t\t\tMainColor: \"#2a2f45\",\n\t\t\tMainBackground: \"#f6f6f6\",\n\t\t\tCardColor: \"2a2f45\",\n\t\t\tCardBackground: \"#fff\",\n\t\t\tButtonColor: \"#fff\",\n\t\t\tButtonBackground: \"#0f0f0f\",\n\t\t},\n\t\tPage: sdk.LoginPortalPage{\n\t\t\tTitle: \"Scalar Private Docs\",\n\t\t\tDescription: \"Login to access your documentation\",\n\t\t\tHead: \"\",\n\t\t\tScript: \"\",\n\t\t\tTheme: \"\",\n\t\t\tCompanyName: \"\",\n\t\t\tLogo: \"\",\n\t\t\tLogoURL: \"\",\n\t\t\tFavicon: \"\",\n\t\t\tTermsLink: \"\",\n\t\t\tPrivacyLink: \"\",\n\t\t\tFormTitle: \"Scalar Private Docs\",\n\t\t\tFormDescription: \"Login to access your documentation\",\n\t\t\tFormImage: \"\",\n\t\t},\n\t\tSlug: \"\",\n\t\tTitle: \"\",\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(loginPortal)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.loginportals.LoginPortalCreateParams\nimport com.scalar.api.models.loginportals.LoginPortalEmail\nimport com.scalar.api.models.loginportals.LoginPortalPage\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = LoginPortalCreateParams.builder()\n .title(\"title\")\n .slug(\"slug\")\n .email(LoginPortalEmail.builder()\n .logo(\"\")\n .logoSize(\"100\")\n .buttonText(\"Login\")\n .message(\"Click to access private documentation hosted by scalar.com\")\n .title(\"Private Docs\")\n .mainColor(\"#2a2f45\")\n .mainBackground(\"#f6f6f6\")\n .cardColor(\"2a2f45\")\n .cardBackground(\"#fff\")\n .buttonColor(\"#fff\")\n .buttonBackground(\"#0f0f0f\")\n .build())\n .page(LoginPortalPage.builder()\n .title(\"Scalar Private Docs\")\n .description(\"Login to access your documentation\")\n .head(\"\")\n .script(\"\")\n .theme(\"\")\n .companyName(\"\")\n .logo(\"\")\n .logoUrl(\"\")\n .favicon(\"\")\n .termsLink(\"\")\n .privacyLink(\"\")\n .formTitle(\"Scalar Private Docs\")\n .formDescription(\"Login to access your documentation\")\n .formImage(\"\")\n .build())\n .build()\nval loginPortal = client.loginPortals().create(params)\nprintln(loginPortal)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.loginPortals.create({ title: \"title\", slug: \"slug\", email: \"email\", page: \"page\" })\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.loginportals.LoginPortalCreateParams;\nimport com.scalar.api.models.loginportals.LoginPortalEmail;\nimport com.scalar.api.models.loginportals.LoginPortalPage;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nLoginPortalCreateParams params = LoginPortalCreateParams.builder()\n .title(\"title\")\n .slug(\"slug\")\n .email(LoginPortalEmail.builder()\n .logo(\"\")\n .logoSize(\"100\")\n .buttonText(\"Login\")\n .message(\"Click to access private documentation hosted by scalar.com\")\n .title(\"Private Docs\")\n .mainColor(\"#2a2f45\")\n .mainBackground(\"#f6f6f6\")\n .cardColor(\"2a2f45\")\n .cardBackground(\"#fff\")\n .buttonColor(\"#fff\")\n .buttonBackground(\"#0f0f0f\")\n .build())\n .page(LoginPortalPage.builder()\n .title(\"Scalar Private Docs\")\n .description(\"Login to access your documentation\")\n .head(\"\")\n .script(\"\")\n .theme(\"\")\n .companyName(\"\")\n .logo(\"\")\n .logoUrl(\"\")\n .favicon(\"\")\n .termsLink(\"\")\n .privacyLink(\"\")\n .formTitle(\"Scalar Private Docs\")\n .formDescription(\"Login to access your documentation\")\n .formImage(\"\")\n .build())\n .build();\nvar loginPortal = client.loginPortals().create(params);\nSystem.out.println(loginPortal);"
+ }
+ ]
+ },
+ "get": {
+ "tags": [
+ "Login Portals"
+ ],
+ "description": "List all login portals for the current team.",
+ "summary": "List all portals",
+ "operationId": "listLoginPortals",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/login-portal"
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst list = await client.loginPortals.list();\nconsole.log(list);"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi login-portals list --bearer-auth \"$BEARER_AUTH\""
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nlogin_portal = client.login_portals.list()\nprint(login_portal)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tloginPortal, err := client.LoginPortals.List(context.Background())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(loginPortal)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.loginportals.LoginPortalListParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval loginPortal = client.loginPortals().list(LoginPortalListParams.none())\nprintln(loginPortal)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.loginPortals.list\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.loginportals.LoginPortalListParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nvar loginPortal = client.loginPortals().list();\nSystem.out.println(loginPortal);"
+ }
+ ]
+ }
+ },
+ "/v1/rulesets/{namespace}": {
+ "get": {
+ "tags": [
+ "Rules"
+ ],
+ "description": "List all rulesets in a namespace.",
+ "summary": "List all rules",
+ "operationId": "listRulesets",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/rule"
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "parameters": [
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "namespace",
+ "required": true
+ }
+ ],
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst listRulesets = await client.rules.listRulesets(\"namespace\");\nconsole.log(listRulesets);"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi rules list-rulesets 'namespace' --bearer-auth \"$BEARER_AUTH\""
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nrule = client.rules.list_rulesets(\n namespace=\"namespace\",\n)\nprint(rule)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\trule, err := client.Rules.ListRulesets(context.Background(), \"namespace\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(rule)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.rules.RuleListRulesetsParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = RuleListRulesetsParams.builder()\n .namespace(\"namespace\")\n .build()\nval rule = client.rules().listRulesets(params)\nprintln(rule)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.rules.list_rulesets(\"smoke-test\")\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.rules.RuleListRulesetsParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nRuleListRulesetsParams params = RuleListRulesetsParams.builder()\n .namespace(\"namespace\")\n .build();\nvar rule = client.rules().listRulesets(params);\nSystem.out.println(rule);"
+ }
+ ]
+ },
+ "post": {
+ "tags": [
+ "Rules"
+ ],
+ "description": "Create a rule in a namespace.",
+ "summary": "Create a rule",
+ "operationId": "createRuleset",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/uid"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "title": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "slug": {
+ "type": "string"
+ },
+ "isPrivate": {
+ "type": "boolean"
+ },
+ "document": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "title",
+ "slug",
+ "document"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": true
+ },
+ "parameters": [
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "namespace",
+ "required": true
+ }
+ ],
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst uID = await client.rules.createRuleset(\"namespace\", {\n title: \"\",\n slug: \"\",\n document: \"\",\n});\nconsole.log(uID);"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi rules create-ruleset 'namespace' --bearer-auth \"$BEARER_AUTH\" --title 'title' --slug 'slug' --document 'document'"
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nrule = client.rules.create_ruleset(\n namespace=\"namespace\",\n title=\"\",\n slug=\"\",\n document=\"\",\n idempotency_key=\"\",\n)\nprint(rule)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\trule, err := client.Rules.NewRuleset(context.Background(), \"namespace\", sdk.RuleNewRulesetParams{\n\t\tDocument: \"\",\n\t\tSlug: \"\",\n\t\tTitle: \"\",\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(rule)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.rules.RuleCreateRulesetParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = RuleCreateRulesetParams.builder()\n .namespace(\"namespace\")\n .title(\"title\")\n .slug(\"slug\")\n .document(\"document\")\n .build()\nval rule = client.rules().createRuleset(params)\nprintln(rule)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.rules.create_ruleset(\"smoke-test\", { title: \"title\", description: \"description\", slug: \"slug\", is_private: \"is_private\", document: \"document\" })\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.rules.RuleCreateRulesetParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nRuleCreateRulesetParams params = RuleCreateRulesetParams.builder()\n .namespace(\"namespace\")\n .title(\"title\")\n .slug(\"slug\")\n .document(\"document\")\n .build();\nvar rule = client.rules().createRuleset(params);\nSystem.out.println(rule);"
+ }
+ ]
+ }
+ },
+ "/v1/rulesets/{namespace}/{slug}": {
+ "patch": {
+ "tags": [
+ "Rules"
+ ],
+ "description": "Update rule metadata by slug.",
+ "summary": "Update rule metadata",
+ "operationId": "updateRuleset",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "null"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "namespace": {
+ "type": "string"
+ },
+ "slug": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "isPrivate": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": true
+ },
+ "parameters": [
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "namespace",
+ "required": true
+ },
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "slug",
+ "required": true
+ }
+ ],
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nawait client.rules.updateRuleset(\"slug\", {\n namespace: \"namespace\",\n});"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi rules update-ruleset 'slug' --bearer-auth \"$BEARER_AUTH\" --namespace 'namespace'"
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nrule = client.rules.update_ruleset(\n namespace=\"namespace\",\n slug=\"slug\",\n idempotency_key=\"\",\n)\nprint(rule)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\trule, err := client.Rules.UpdateRuleset(context.Background(), \"namespace\", \"slug\", sdk.RuleUpdateRulesetParams{})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(rule)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.rules.RuleUpdateRulesetParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = RuleUpdateRulesetParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .build()\nval rule = client.rules().updateRuleset(params)\nprintln(rule)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.rules.update_ruleset(\"smoke-test\", { namespace: \"namespace\", namespace_2: \"namespace_2\", slug_2: \"slug_2\", title: \"title\", description: \"description\", is_private: \"is_private\" })\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.rules.RuleUpdateRulesetParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nRuleUpdateRulesetParams params = RuleUpdateRulesetParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .build();\nvar rule = client.rules().updateRuleset(params);\nSystem.out.println(rule);"
+ }
+ ]
+ },
+ "delete": {
+ "tags": [
+ "Rules"
+ ],
+ "description": "Delete a rule by slug.",
+ "summary": "Delete a rule",
+ "operationId": "deleteRuleset",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "null"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "parameters": [
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "namespace",
+ "required": true
+ },
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "slug",
+ "required": true
+ }
+ ],
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nawait client.rules.deleteRuleset(\"slug\", {\n namespace: \"namespace\",\n});"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi rules delete-ruleset 'slug' --bearer-auth \"$BEARER_AUTH\" --namespace 'namespace'"
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nrule = client.rules.delete_ruleset(\n namespace=\"namespace\",\n slug=\"slug\",\n idempotency_key=\"\",\n)\nprint(rule)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\trule, err := client.Rules.DeleteRuleset(context.Background(), \"namespace\", \"slug\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(rule)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.rules.RuleDeleteRulesetParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = RuleDeleteRulesetParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .build()\nval rule = client.rules().deleteRuleset(params)\nprintln(rule)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.rules.delete_ruleset(\"smoke-test\", { namespace: \"namespace\" })\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.rules.RuleDeleteRulesetParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nRuleDeleteRulesetParams params = RuleDeleteRulesetParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .build();\nvar rule = client.rules().deleteRuleset(params);\nSystem.out.println(rule);"
+ }
+ ]
+ },
+ "get": {
+ "tags": [
+ "Rules"
+ ],
+ "description": "Get a rule document by slug.",
+ "summary": "Get a rule",
+ "operationId": "getRulesetDocument",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "text/plain": {
+ "schema": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "parameters": [
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "namespace",
+ "required": true
+ },
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "slug",
+ "required": true
+ }
+ ],
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst string_ = await client.rules.retrieveRulesetDocument(\"slug\", {\n namespace: \"namespace\",\n});\nconsole.log(string_);"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi rules retrieve-ruleset-document 'slug' --bearer-auth \"$BEARER_AUTH\" --namespace 'namespace'"
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nrule = client.rules.retrieve_ruleset_document(\n namespace=\"namespace\",\n slug=\"slug\",\n)\nprint(rule)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\trule, err := client.Rules.GetRulesetDocument(context.Background(), \"namespace\", \"slug\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(rule)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.rules.RuleRetrieveRulesetDocumentParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = RuleRetrieveRulesetDocumentParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .build()\nval rule = client.rules().retrieveRulesetDocument(params)\nprintln(rule)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.rules.retrieve_ruleset_document(\"smoke-test\", { namespace: \"namespace\" })\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.rules.RuleRetrieveRulesetDocumentParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nRuleRetrieveRulesetDocumentParams params = RuleRetrieveRulesetDocumentParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .build();\nvar rule = client.rules().retrieveRulesetDocument(params);\nSystem.out.println(rule);"
+ }
+ ]
+ }
+ },
+ "/v1/rulesets/{namespace}/{slug}/access-group": {
+ "post": {
+ "tags": [
+ "Rules"
+ ],
+ "description": "Grant an access group to a rule.",
+ "summary": "Add rule access group",
+ "operationId": "addRulesetAccessGroup",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "null"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/access-group"
+ }
+ }
+ },
+ "required": true
+ },
+ "parameters": [
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "namespace",
+ "required": true
+ },
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "slug",
+ "required": true
+ }
+ ],
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nawait client.rules.createRulesetAccessGroup(\"slug\", {\n namespace: \"namespace\",\n accessGroupSlug: \"\",\n});"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi rules create-ruleset-access-group 'slug' --bearer-auth \"$BEARER_AUTH\" --namespace 'namespace' --access-group-slug 'accessGroupSlug'"
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nrule = client.rules.create_ruleset_access_group(\n namespace=\"namespace\",\n slug=\"slug\",\n access_group_slug=\"\",\n idempotency_key=\"\",\n)\nprint(rule)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\trule, err := client.Rules.NewRulesetAccessGroup(context.Background(), \"namespace\", \"slug\", sdk.RuleNewRulesetAccessGroupParams{\n\t\tAccessGroup: sdk.AccessGroup{\n\t\tAccessGroupSlug: \"\",\n\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(rule)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.rules.RuleCreateRulesetAccessGroupParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = RuleCreateRulesetAccessGroupParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .accessGroupSlug(\"accessGroupSlug\")\n .build()\nval rule = client.rules().createRulesetAccessGroup(params)\nprintln(rule)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.rules.create_ruleset_access_group(\"smoke-test\", { namespace: \"namespace\", access_group_slug: \"access_group_slug\" })\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.rules.RuleCreateRulesetAccessGroupParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nRuleCreateRulesetAccessGroupParams params = RuleCreateRulesetAccessGroupParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .accessGroupSlug(\"accessGroupSlug\")\n .build();\nvar rule = client.rules().createRulesetAccessGroup(params);\nSystem.out.println(rule);"
+ }
+ ]
+ },
+ "delete": {
+ "tags": [
+ "Rules"
+ ],
+ "description": "Remove an access group from a rule.",
+ "summary": "Remove rule access group",
+ "operationId": "removeRulesetAccessGroup",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "null"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/access-group"
+ }
+ }
+ },
+ "required": true
+ },
+ "parameters": [
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "namespace",
+ "required": true
+ },
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "slug",
+ "required": true
+ }
+ ],
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nawait client.rules.deleteRulesetAccessGroup(\"slug\", {\n namespace: \"namespace\",\n accessGroupSlug: \"\",\n});"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi rules delete-ruleset-access-group 'slug' --bearer-auth \"$BEARER_AUTH\" --namespace 'namespace' --access-group-slug 'accessGroupSlug'"
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nrule = client.rules.delete_ruleset_access_group(\n namespace=\"namespace\",\n slug=\"slug\",\n access_group_slug=\"\",\n idempotency_key=\"\",\n)\nprint(rule)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\trule, err := client.Rules.DeleteRulesetAccessGroup(context.Background(), \"namespace\", \"slug\", sdk.RuleDeleteRulesetAccessGroupParams{\n\t\tAccessGroup: sdk.AccessGroup{\n\t\tAccessGroupSlug: \"\",\n\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(rule)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.rules.RuleDeleteRulesetAccessGroupParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = RuleDeleteRulesetAccessGroupParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .accessGroupSlug(\"accessGroupSlug\")\n .build()\nval rule = client.rules().deleteRulesetAccessGroup(params)\nprintln(rule)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.rules.delete_ruleset_access_group(\"smoke-test\", { namespace: \"namespace\", access_group_slug: \"access_group_slug\" })\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.rules.RuleDeleteRulesetAccessGroupParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nRuleDeleteRulesetAccessGroupParams params = RuleDeleteRulesetAccessGroupParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .accessGroupSlug(\"accessGroupSlug\")\n .build();\nvar rule = client.rules().deleteRulesetAccessGroup(params);\nSystem.out.println(rule);"
+ }
+ ]
+ }
+ },
+ "/v1/themes": {
+ "get": {
+ "tags": [
+ "Themes"
+ ],
+ "description": "List all team themes.",
+ "summary": "List all themes",
+ "operationId": "listThemes",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/theme"
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst list = await client.themes.list();\nconsole.log(list);"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi themes list --bearer-auth \"$BEARER_AUTH\""
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\ntheme = client.themes.list()\nprint(theme)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\ttheme, err := client.Themes.List(context.Background())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(theme)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.themes.ThemeListParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval theme = client.themes().list(ThemeListParams.none())\nprintln(theme)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.themes.list\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.themes.ThemeListParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nvar theme = client.themes().list();\nSystem.out.println(theme);"
+ }
+ ]
+ },
+ "post": {
+ "tags": [
+ "Themes"
+ ],
+ "description": "Create a team theme.",
+ "summary": "Create a theme",
+ "operationId": "createTheme",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/uid"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "slug": {
+ "type": "string"
+ },
+ "document": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "name",
+ "slug",
+ "document"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": true
+ },
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst uID = await client.themes.create({\n name: \"\",\n slug: \"\",\n document: \"\",\n});\nconsole.log(uID);"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi themes create --bearer-auth \"$BEARER_AUTH\" --name 'name' --slug 'slug' --document 'document'"
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\ntheme = client.themes.create(\n name=\"\",\n slug=\"\",\n document=\"\",\n idempotency_key=\"\",\n)\nprint(theme)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\ttheme, err := client.Themes.New(context.Background(), sdk.ThemeNewParams{\n\t\tDocument: \"\",\n\t\tName: \"\",\n\t\tSlug: \"\",\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(theme)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.themes.ThemeCreateParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = ThemeCreateParams.builder()\n .name(\"name\")\n .slug(\"slug\")\n .document(\"document\")\n .build()\nval theme = client.themes().create(params)\nprintln(theme)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.themes.create({ name: \"name\", description: \"description\", slug: \"slug\", document: \"document\" })\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.themes.ThemeCreateParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nThemeCreateParams params = ThemeCreateParams.builder()\n .name(\"name\")\n .slug(\"slug\")\n .document(\"document\")\n .build();\nvar theme = client.themes().create(params);\nSystem.out.println(theme);"
+ }
+ ]
+ }
+ },
+ "/v1/themes/{slug}": {
+ "patch": {
+ "tags": [
+ "Themes"
+ ],
+ "description": "Update theme metadata.",
+ "summary": "Update theme metadata",
+ "operationId": "updateTheme",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "null"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": true
+ },
+ "parameters": [
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "slug",
+ "required": true
+ }
+ ],
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nawait client.themes.update(\"slug\", {});"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi themes update 'slug' --bearer-auth \"$BEARER_AUTH\""
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\ntheme = client.themes.update(\n slug=\"slug\",\n idempotency_key=\"\",\n)\nprint(theme)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\ttheme, err := client.Themes.Update(context.Background(), \"slug\", sdk.ThemeUpdateParams{})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(theme)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.themes.ThemeUpdateParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = ThemeUpdateParams.builder()\n .slug(\"slug\")\n .build()\nval theme = client.themes().update(params)\nprintln(theme)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.themes.update(\"smoke-test\", { name: \"name\", description: \"description\" })\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.themes.ThemeUpdateParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nThemeUpdateParams params = ThemeUpdateParams.builder()\n .slug(\"slug\")\n .build();\nvar theme = client.themes().update(params);\nSystem.out.println(theme);"
+ }
+ ]
+ },
+ "put": {
+ "tags": [
+ "Themes"
+ ],
+ "description": "Replace the theme document.",
+ "summary": "Update theme document",
+ "operationId": "replaceThemeDocument",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "null"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "document": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "document"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": true
+ },
+ "parameters": [
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "slug",
+ "required": true
+ }
+ ],
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nawait client.themes.replaceDocument(\"slug\", {\n document: \"\",\n});"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi themes replace-document 'slug' --bearer-auth \"$BEARER_AUTH\" --document 'document'"
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\ntheme = client.themes.replace_document(\n slug=\"slug\",\n document=\"\",\n idempotency_key=\"\",\n)\nprint(theme)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\ttheme, err := client.Themes.ReplaceDocument(context.Background(), \"slug\", sdk.ThemeReplaceDocumentParams{\n\t\tDocument: \"\",\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(theme)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.themes.ThemeReplaceDocumentParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = ThemeReplaceDocumentParams.builder()\n .slug(\"slug\")\n .document(\"document\")\n .build()\nval theme = client.themes().replaceDocument(params)\nprintln(theme)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.themes.replace_document(\"smoke-test\", { document: \"document\" })\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.themes.ThemeReplaceDocumentParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nThemeReplaceDocumentParams params = ThemeReplaceDocumentParams.builder()\n .slug(\"slug\")\n .document(\"document\")\n .build();\nvar theme = client.themes().replaceDocument(params);\nSystem.out.println(theme);"
+ }
+ ]
+ },
+ "delete": {
+ "tags": [
+ "Themes"
+ ],
+ "description": "Delete a theme by slug.",
+ "summary": "Delete a theme",
+ "operationId": "deleteTheme",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "null"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "parameters": [
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "slug",
+ "required": true
+ }
+ ],
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nawait client.themes.delete(\"slug\");"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi themes delete 'slug' --bearer-auth \"$BEARER_AUTH\""
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\ntheme = client.themes.delete(\n slug=\"slug\",\n idempotency_key=\"\",\n)\nprint(theme)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\ttheme, err := client.Themes.Delete(context.Background(), \"slug\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(theme)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.themes.ThemeDeleteParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = ThemeDeleteParams.builder()\n .slug(\"slug\")\n .build()\nval theme = client.themes().delete(params)\nprintln(theme)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.themes.delete(\"smoke-test\")\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.themes.ThemeDeleteParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nThemeDeleteParams params = ThemeDeleteParams.builder()\n .slug(\"slug\")\n .build();\nvar theme = client.themes().delete(params);\nSystem.out.println(theme);"
+ }
+ ]
+ },
+ "get": {
+ "tags": [
+ "Themes"
+ ],
+ "description": "Get the theme document by slug.",
+ "summary": "Get a theme",
+ "operationId": "getTheme",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "text/plain": {
+ "schema": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "parameters": [
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "slug",
+ "required": true
+ }
+ ],
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst string_ = await client.themes.retrieve(\"slug\");\nconsole.log(string_);"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi themes retrieve 'slug' --bearer-auth \"$BEARER_AUTH\""
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\ntheme = client.themes.retrieve(\n slug=\"slug\",\n)\nprint(theme)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\ttheme, err := client.Themes.Get(context.Background(), \"slug\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(theme)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.themes.ThemeRetrieveParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = ThemeRetrieveParams.builder()\n .slug(\"slug\")\n .build()\nval theme = client.themes().retrieve(params)\nprintln(theme)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.themes.retrieve(\"smoke-test\")\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.themes.ThemeRetrieveParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nThemeRetrieveParams params = ThemeRetrieveParams.builder()\n .slug(\"slug\")\n .build();\nvar theme = client.themes().retrieve(params);\nSystem.out.println(theme);"
+ }
+ ]
+ }
+ },
+ "/v1/teams": {
+ "get": {
+ "tags": [
+ "Teams"
+ ],
+ "description": "List all available teams",
+ "summary": "List teams",
+ "operationId": "listTeams",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/team"
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst list = await client.teams.list();\nconsole.log(list);"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi teams list --bearer-auth \"$BEARER_AUTH\""
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nteam = client.teams.list()\nprint(team)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tteam, err := client.Teams.List(context.Background())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(team)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.teams.TeamListParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval team = client.teams().list(TeamListParams.none())\nprintln(team)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.teams.list\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.teams.TeamListParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nvar team = client.teams().list();\nSystem.out.println(team);"
+ }
+ ]
+ }
+ },
+ "/v1/guides": {
+ "get": {
+ "tags": [
+ "Scalar Docs"
+ ],
+ "description": "List all guide projects.",
+ "summary": "List all projects",
+ "operationId": "listGuides",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/github-project"
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst listGuides = await client.scalarDocs.listGuides();\nconsole.log(listGuides);"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi scalar-docs list-guides --bearer-auth \"$BEARER_AUTH\""
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nscalar_doc = client.scalar_docs.list_guides()\nprint(scalar_doc)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tscalarDoc, err := client.ScalarDocs.ListGuides(context.Background())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(scalarDoc)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.scalardocs.ScalarDocListGuidesParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval scalarDoc = client.scalarDocs().listGuides(ScalarDocListGuidesParams.none())\nprintln(scalarDoc)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.scalarDocs.list_guides\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.scalardocs.ScalarDocListGuidesParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nvar scalarDoc = client.scalarDocs().listGuides();\nSystem.out.println(scalarDoc);"
+ }
+ ]
+ },
+ "post": {
+ "tags": [
+ "Scalar Docs"
+ ],
+ "description": "Create a guide project.",
+ "summary": "Create a project",
+ "operationId": "createGuide",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "uid": {
+ "type": "string"
+ },
+ "slug": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "uid",
+ "slug"
+ ],
+ "additionalProperties": false
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "slug": {
+ "$ref": "#/components/schemas/slug"
+ },
+ "isPrivate": {
+ "default": false,
+ "type": "boolean"
+ },
+ "allowedUsers": {
+ "default": [],
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "allowedDomains": {
+ "default": [],
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ },
+ "required": [
+ "name",
+ "isPrivate",
+ "allowedUsers",
+ "allowedDomains"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": true
+ },
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst createGuide = await client.scalarDocs.createGuide({\n name: \"\",\n isPrivate: false,\n allowedUsers: [],\n allowedDomains: [],\n});\nconsole.log(createGuide);"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi scalar-docs create-guide --bearer-auth \"$BEARER_AUTH\" --name 'name' --is-private"
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nscalar_doc = client.scalar_docs.create_guide(\n name=\"\",\n is_private=False,\n allowed_users=[],\n allowed_domains=[],\n idempotency_key=\"\",\n)\nprint(scalar_doc)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tscalarDoc, err := client.ScalarDocs.NewGuide(context.Background(), sdk.ScalarDocNewGuideParams{\n\t\tAllowedDomains: []string{\"\"},\n\t\tAllowedUsers: []string{\"\"},\n\t\tIsPrivate: false,\n\t\tName: \"\",\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(scalarDoc)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.scalardocs.ScalarDocCreateGuideParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = ScalarDocCreateGuideParams.builder()\n .name(\"name\")\n .isPrivate(false)\n .allowedUsers(listOf(\"allowedUser\"))\n .allowedDomains(listOf(\"allowedDomain\"))\n .build()\nval scalarDoc = client.scalarDocs().createGuide(params)\nprintln(scalarDoc)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.scalarDocs.create_guide({ name: \"name\", slug: \"slug\", is_private: \"is_private\", allowed_users: \"allowed_users\", allowed_domains: \"allowed_domains\" })\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.scalardocs.ScalarDocCreateGuideParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nScalarDocCreateGuideParams params = ScalarDocCreateGuideParams.builder()\n .name(\"name\")\n .isPrivate(false)\n .allowedUsers(java.util.List.of(\"allowedUser\"))\n .allowedDomains(java.util.List.of(\"allowedDomain\"))\n .build();\nvar scalarDoc = client.scalarDocs().createGuide(params);\nSystem.out.println(scalarDoc);"
+ }
+ ]
+ }
+ },
+ "/v1/guides/{slug}/publish": {
+ "post": {
+ "tags": [
+ "Scalar Docs"
+ ],
+ "description": "Start a new publish process.",
+ "summary": "Publish a project",
+ "operationId": "publishGuide",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "publishUid": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "publishUid"
+ ],
+ "additionalProperties": false
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "parameters": [
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "path",
+ "name": "slug",
+ "required": true
+ }
+ ],
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst publishGuide = await client.scalarDocs.publishGuide(\"slug\");\nconsole.log(publishGuide);"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi scalar-docs publish-guide 'slug' --bearer-auth \"$BEARER_AUTH\""
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nscalar_doc = client.scalar_docs.publish_guide(\n slug=\"slug\",\n idempotency_key=\"\",\n)\nprint(scalar_doc)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tscalarDoc, err := client.ScalarDocs.PublishGuide(context.Background(), \"slug\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(scalarDoc)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.scalardocs.ScalarDocPublishGuideParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = ScalarDocPublishGuideParams.builder()\n .slug(\"slug\")\n .build()\nval scalarDoc = client.scalarDocs().publishGuide(params)\nprintln(scalarDoc)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.scalarDocs.publish_guide(\"smoke-test\")\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.scalardocs.ScalarDocPublishGuideParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nScalarDocPublishGuideParams params = ScalarDocPublishGuideParams.builder()\n .slug(\"slug\")\n .build();\nvar scalarDoc = client.scalarDocs().publishGuide(params);\nSystem.out.println(scalarDoc);"
+ }
+ ]
+ }
+ },
+ "/v1/namespaces": {
+ "get": {
+ "tags": [
+ "Namespaces"
+ ],
+ "description": "Get all namespaces for the current team",
+ "summary": "List namespaces",
+ "operationId": "listNamespaces",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst list = await client.namespaces.list();\nconsole.log(list);"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi namespaces list --bearer-auth \"$BEARER_AUTH\""
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nnamespace = client.namespaces.list()\nprint(namespace)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tnamespace, err := client.Namespaces.List(context.Background())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(namespace)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.namespaces.NamespaceListParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval namespace = client.namespaces().list(NamespaceListParams.none())\nprintln(namespace)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.namespace(\"namespace\").list\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.namespaces.NamespaceListParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nvar namespace = client.namespaces().list();\nSystem.out.println(namespace);"
+ }
+ ]
+ }
+ },
+ "/v1/auth/exchange": {
+ "post": {
+ "tags": [
+ "Authentication"
+ ],
+ "description": "Exchange an API key for an access token.",
+ "summary": "Exchange token",
+ "operationId": "exchangePersonalToken",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "accessToken": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "accessToken"
+ ],
+ "additionalProperties": false
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "security": [],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "personalToken": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "personalToken"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": true
+ },
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst exchangePersonalToken = await client.authentication.exchangePersonalToken({\n personalToken: \"\",\n});\nconsole.log(exchangePersonalToken);"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi authentication exchange-personal-token --bearer-auth \"$BEARER_AUTH\" --personal-token 'personalToken'"
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nauthentication = client.authentication.exchange_personal_token(\n personal_token=\"\",\n idempotency_key=\"\",\n)\nprint(authentication)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tauthentication, err := client.Authentication.ExchangePersonalToken(context.Background(), sdk.AuthenticationExchangePersonalTokenParams{\n\t\tPersonalToken: \"\",\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(authentication)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.authentication.AuthenticationExchangePersonalTokenParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = AuthenticationExchangePersonalTokenParams.builder()\n .personalToken(\"personalToken\")\n .build()\nval authentication = client.authentication().exchangePersonalToken(params)\nprintln(authentication)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.authentication.exchange_personal_token({ personal_token: \"personal_token\" })\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.authentication.AuthenticationExchangePersonalTokenParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nAuthenticationExchangePersonalTokenParams params = AuthenticationExchangePersonalTokenParams.builder()\n .personalToken(\"personalToken\")\n .build();\nvar authentication = client.authentication().exchangePersonalToken(params);\nSystem.out.println(authentication);"
+ }
+ ]
+ }
+ },
+ "/v1/auth/me": {
+ "get": {
+ "tags": [
+ "Authentication"
+ ],
+ "description": "Get the authenticated user, including their available teams and theme.",
+ "summary": "Get current user",
+ "operationId": "getCurrentUser",
+ "responses": {
+ "200": {
+ "description": "Default Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/user"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/400"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "No auth",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/401"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/403"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/404"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Invalid payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/422"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Uncaught error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/500"
+ }
+ }
+ }
+ }
+ },
+ "x-codeSamples": [
+ {
+ "label": "TypeScript",
+ "lang": "TypeScript",
+ "source": "import ScalarAPI from \"@scalar/sdk\";\n\nconst client = new ScalarAPI({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst user = await client.authentication.listCurrentUser();\nconsole.log(user);"
+ },
+ {
+ "label": "Shell",
+ "lang": "Shell",
+ "source": "scalarapi authentication list-current-user --bearer-auth \"$BEARER_AUTH\""
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "import os\n\nfrom scalar_api import ScalarApi\n\nclient = ScalarApi(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nauthentication = client.authentication.list_current_user()\nprint(authentication)"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tauthentication, err := client.Authentication.ListCurrentUser(context.Background())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(authentication)\n}"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "import com.scalar.api.client.ScalarApiClient\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient\nimport com.scalar.api.models.authentication.AuthenticationListCurrentUserParams\n\nval client: ScalarApiClient = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval authentication = client.authentication().listCurrentUser(AuthenticationListCurrentUserParams.none())\nprintln(authentication)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.authentication.list_current_user\nputs response.inspect"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "import com.scalar.api.client.ScalarApiClient;\nimport com.scalar.api.client.okhttp.ScalarApiOkHttpClient;\nimport com.scalar.api.models.authentication.AuthenticationListCurrentUserParams;\n\nScalarApiClient client = ScalarApiOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nvar authentication = client.authentication().listCurrentUser();\nSystem.out.println(authentication);"
+ }
+ ]
+ }
+ }
+ }
+}
diff --git a/package.json b/package.json
index ca6eb3e..415eed2 100644
--- a/package.json
+++ b/package.json
@@ -1,42 +1,54 @@
{
"name": "@scalar/sdk",
- "version": "0.1.5",
- "author": "Scalar",
+ "version": "0.1.8",
+ "description": "API for managing Scalar platform resources.",
"type": "module",
- "tshy": {
- "sourceDialects": [
- "@scalar/sdk/source"
- ],
- "exports": {
- ".": "./src/index.ts",
- "./package.json": "./package.json",
- "./types": "./src/types/index.ts",
- "./models/errors": "./src/models/errors/index.ts",
- "./models/components": "./src/models/components/index.ts",
- "./models/operations": "./src/models/operations/index.ts",
- "./*.js": "./src/*.ts",
- "./*": "./src/*.ts"
- }
- },
"sideEffects": false,
+ "main": "./dist/cjs/index.js",
+ "module": "./dist/esm/index.js",
+ "types": "./dist/esm/index.d.ts",
+ "exports": {
+ ".": {
+ "types": "./dist/esm/index.d.ts",
+ "import": "./dist/esm/index.js",
+ "require": "./dist/cjs/index.js",
+ "default": "./dist/esm/index.js"
+ },
+ "./resources/*": {
+ "types": "./dist/esm/resources/*.d.ts",
+ "import": "./dist/esm/resources/*.js",
+ "require": "./dist/cjs/resources/*.js",
+ "default": "./dist/esm/resources/*.js"
+ },
+ "./*.mjs": {
+ "types": "./dist/esm/*.d.ts",
+ "import": "./dist/esm/*.js",
+ "default": "./dist/esm/*.js"
+ },
+ "./*.js": {
+ "types": "./dist/esm/*.d.ts",
+ "require": "./dist/cjs/*.js",
+ "default": "./dist/cjs/*.js"
+ },
+ "./*": {
+ "types": "./dist/esm/*.d.ts",
+ "import": "./dist/esm/*.js",
+ "require": "./dist/cjs/*.js",
+ "default": "./dist/esm/*.js"
+ },
+ "./package.json": "./package.json"
+ },
+ "files": [
+ "dist",
+ "api.md"
+ ],
"scripts": {
- "lint": "eslint --cache --max-warnings=0 src",
- "build": "tshy",
+ "build": "tsc -p tsconfig.json && tsc -p tsconfig.cjs.json && node scripts/finalize-build.mjs",
+ "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.cjs.json --noEmit",
"prepublishOnly": "npm run build"
},
- "peerDependencies": {
- "zod": ">= 3"
- },
+ "dependencies": {},
"devDependencies": {
- "@eslint/js": "^9.19.0",
- "eslint": "^9.19.0",
- "globals": "^15.14.0",
- "tshy": "^2.0.0",
- "typescript": "^5.4.5",
- "typescript-eslint": "^8.22.0",
- "zod": "^3.25.17"
- },
- "dependencies": {
-
+ "typescript": "^6.0.0"
}
}
diff --git a/scalar-sdk.manifest.json b/scalar-sdk.manifest.json
new file mode 100644
index 0000000..de9a124
--- /dev/null
+++ b/scalar-sdk.manifest.json
@@ -0,0 +1,9519 @@
+{
+ "name": "ScalarApi",
+ "slug": "scalarApi",
+ "version": "0.1.7",
+ "servers": [
+ "https://access.scalar.com"
+ ],
+ "environments": {
+ "production": "https://access.scalar.com",
+ "local": "http://127.0.0.1:4010"
+ },
+ "environmentOrder": [
+ "production",
+ "local"
+ ],
+ "auth": [
+ "bearer"
+ ],
+ "authDetails": [
+ {
+ "kind": "bearer",
+ "id": "BearerAuth",
+ "bearerFormat": "JWT"
+ }
+ ],
+ "clientHeaderParams": [],
+ "schemas": [
+ {
+ "name": "_400",
+ "source": "_400",
+ "publicAliases": [],
+ "deprecated": false,
+ "type": {
+ "kind": "object",
+ "properties": [
+ {
+ "name": "message",
+ "publicName": "message",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ },
+ {
+ "name": "code",
+ "publicName": "code",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ }
+ ],
+ "additionalProperties": false
+ }
+ },
+ {
+ "name": "_401",
+ "source": "_401",
+ "publicAliases": [],
+ "deprecated": false,
+ "type": {
+ "kind": "object",
+ "properties": [
+ {
+ "name": "message",
+ "publicName": "message",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ },
+ {
+ "name": "code",
+ "publicName": "code",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ }
+ ],
+ "additionalProperties": false
+ }
+ },
+ {
+ "name": "_403",
+ "source": "_403",
+ "publicAliases": [],
+ "deprecated": false,
+ "type": {
+ "kind": "object",
+ "properties": [
+ {
+ "name": "message",
+ "publicName": "message",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ },
+ {
+ "name": "code",
+ "publicName": "code",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ }
+ ],
+ "additionalProperties": false
+ }
+ },
+ {
+ "name": "_404",
+ "source": "_404",
+ "publicAliases": [],
+ "deprecated": false,
+ "type": {
+ "kind": "object",
+ "properties": [
+ {
+ "name": "message",
+ "publicName": "message",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ },
+ {
+ "name": "code",
+ "publicName": "code",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ }
+ ],
+ "additionalProperties": false
+ }
+ },
+ {
+ "name": "_422",
+ "source": "_422",
+ "publicAliases": [],
+ "deprecated": false,
+ "type": {
+ "kind": "object",
+ "properties": [
+ {
+ "name": "message",
+ "publicName": "message",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ },
+ {
+ "name": "code",
+ "publicName": "code",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ }
+ ],
+ "additionalProperties": false
+ }
+ },
+ {
+ "name": "_500",
+ "source": "_500",
+ "publicAliases": [],
+ "deprecated": false,
+ "type": {
+ "kind": "object",
+ "properties": [
+ {
+ "name": "message",
+ "publicName": "message",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ },
+ {
+ "name": "code",
+ "publicName": "code",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ }
+ ],
+ "additionalProperties": false
+ }
+ },
+ {
+ "name": "ApiDocument",
+ "source": "ApiDocument",
+ "publicAliases": [],
+ "deprecated": false,
+ "type": {
+ "kind": "object",
+ "properties": [
+ {
+ "name": "uid",
+ "publicName": "uid",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "ref",
+ "name": "Nanoid"
+ }
+ },
+ {
+ "name": "version",
+ "publicName": "version",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "ref",
+ "name": "Version"
+ }
+ },
+ {
+ "name": "title",
+ "publicName": "title",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string",
+ "validation": {
+ "maxLength": 100
+ }
+ }
+ },
+ {
+ "name": "slug",
+ "publicName": "slug",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "ref",
+ "name": "Slug"
+ }
+ },
+ {
+ "name": "description",
+ "publicName": "description",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ },
+ {
+ "name": "namespace",
+ "publicName": "namespace",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "ref",
+ "name": "Namespace"
+ }
+ },
+ {
+ "name": "isPrivate",
+ "publicName": "isPrivate",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "boolean"
+ }
+ },
+ {
+ "name": "tags",
+ "publicName": "tags",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ },
+ {
+ "name": "versions",
+ "publicName": "versions",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "array",
+ "items": {
+ "kind": "ref",
+ "name": "ManagedDocVersion"
+ }
+ }
+ }
+ ],
+ "additionalProperties": false
+ }
+ },
+ {
+ "name": "Nanoid",
+ "source": "Nanoid",
+ "publicAliases": [],
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string",
+ "validation": {
+ "minLength": 5
+ }
+ }
+ },
+ {
+ "name": "Version",
+ "source": "Version",
+ "publicAliases": [],
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string",
+ "validation": {
+ "minLength": 1
+ }
+ }
+ },
+ {
+ "name": "Slug",
+ "source": "Slug",
+ "publicAliases": [],
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string",
+ "validation": {
+ "pattern": "^[a-z](?:[a-z0-9-]*[a-z0-9])?$",
+ "minLength": 3,
+ "maxLength": 60
+ }
+ }
+ },
+ {
+ "name": "Namespace",
+ "source": "Namespace",
+ "publicAliases": [],
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string",
+ "validation": {
+ "pattern": "^[a-zA-Z0-9-_]+$",
+ "minLength": 3,
+ "maxLength": 50
+ }
+ }
+ },
+ {
+ "name": "ManagedDocVersion",
+ "source": "ManagedDocVersion",
+ "publicAliases": [],
+ "deprecated": false,
+ "type": {
+ "kind": "object",
+ "properties": [
+ {
+ "name": "uid",
+ "publicName": "uid",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "ref",
+ "name": "Nanoid"
+ }
+ },
+ {
+ "name": "createdAt",
+ "publicName": "createdAt",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "number"
+ }
+ },
+ {
+ "name": "version",
+ "publicName": "version",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "ref",
+ "name": "Version"
+ }
+ },
+ {
+ "name": "upgraded",
+ "publicName": "upgraded",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "boolean"
+ }
+ },
+ {
+ "name": "embedStatus",
+ "publicName": "embedStatus",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "union",
+ "variants": [
+ {
+ "kind": "enum",
+ "values": [
+ "complete",
+ "failed"
+ ],
+ "names": [
+ "Complete",
+ "Failed"
+ ],
+ "deprecations": [
+ false,
+ false
+ ]
+ },
+ {
+ "kind": "null"
+ }
+ ]
+ }
+ },
+ {
+ "name": "tags",
+ "publicName": "tags",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "array",
+ "items": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ }
+ },
+ {
+ "name": "tools",
+ "publicName": "tools",
+ "required": false,
+ "deprecated": false,
+ "type": {
+ "kind": "array",
+ "items": {
+ "kind": "object",
+ "properties": [
+ {
+ "name": "path",
+ "publicName": "path",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ },
+ {
+ "name": "method",
+ "publicName": "method",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "ref",
+ "name": "Method"
+ }
+ },
+ {
+ "name": "enabledTools",
+ "publicName": "enabledTools",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "array",
+ "items": {
+ "kind": "enum",
+ "values": [
+ "execute-request",
+ "get-mini-openapi-spec"
+ ],
+ "names": [
+ "ExecuteRequest",
+ "GetMiniOpenapiSpec"
+ ],
+ "deprecations": [
+ false,
+ false
+ ]
+ }
+ }
+ }
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ {
+ "name": "yamlSha",
+ "publicName": "yamlSha",
+ "required": false,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ },
+ {
+ "name": "jsonSha",
+ "publicName": "jsonSha",
+ "required": false,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ },
+ {
+ "name": "versionSha",
+ "publicName": "versionSha",
+ "required": false,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ }
+ ],
+ "additionalProperties": false
+ }
+ },
+ {
+ "name": "Method",
+ "source": "Method",
+ "publicAliases": [],
+ "deprecated": false,
+ "type": {
+ "kind": "enum",
+ "values": [
+ "delete",
+ "get",
+ "head",
+ "options",
+ "patch",
+ "post",
+ "put",
+ "trace"
+ ],
+ "names": [
+ "Delete",
+ "Get",
+ "Head",
+ "Options",
+ "Patch",
+ "Post",
+ "Put",
+ "Trace"
+ ],
+ "deprecations": [
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false
+ ]
+ }
+ },
+ {
+ "name": "AccessGroup",
+ "source": "AccessGroup",
+ "publicAliases": [],
+ "deprecated": false,
+ "type": {
+ "kind": "object",
+ "properties": [
+ {
+ "name": "accessGroupSlug",
+ "publicName": "accessGroupSlug",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "ref",
+ "name": "Slug"
+ }
+ }
+ ],
+ "additionalProperties": false
+ }
+ },
+ {
+ "name": "Schema",
+ "source": "Schema",
+ "publicAliases": [],
+ "deprecated": false,
+ "type": {
+ "kind": "object",
+ "properties": [
+ {
+ "name": "uid",
+ "publicName": "uid",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "ref",
+ "name": "Nanoid"
+ }
+ },
+ {
+ "name": "title",
+ "publicName": "title",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string",
+ "validation": {
+ "maxLength": 100
+ }
+ }
+ },
+ {
+ "name": "description",
+ "publicName": "description",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ },
+ {
+ "name": "slug",
+ "publicName": "slug",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "ref",
+ "name": "Slug"
+ }
+ },
+ {
+ "name": "namespace",
+ "publicName": "namespace",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "ref",
+ "name": "Namespace"
+ }
+ },
+ {
+ "name": "isPrivate",
+ "publicName": "isPrivate",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "boolean"
+ }
+ },
+ {
+ "name": "versions",
+ "publicName": "versions",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "array",
+ "items": {
+ "kind": "ref",
+ "name": "ManagedSchemaVersion"
+ }
+ }
+ }
+ ],
+ "additionalProperties": false
+ }
+ },
+ {
+ "name": "ManagedSchemaVersion",
+ "source": "ManagedSchemaVersion",
+ "publicAliases": [],
+ "deprecated": false,
+ "type": {
+ "kind": "object",
+ "properties": [
+ {
+ "name": "uid",
+ "publicName": "uid",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "ref",
+ "name": "Nanoid"
+ }
+ },
+ {
+ "name": "createdAt",
+ "publicName": "createdAt",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "ref",
+ "name": "Timestamp"
+ }
+ },
+ {
+ "name": "updatedAt",
+ "publicName": "updatedAt",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "ref",
+ "name": "Timestamp"
+ }
+ },
+ {
+ "name": "version",
+ "publicName": "version",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "ref",
+ "name": "Version"
+ }
+ }
+ ],
+ "additionalProperties": false
+ }
+ },
+ {
+ "name": "Timestamp",
+ "source": "Timestamp",
+ "publicAliases": [],
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "integer",
+ "validation": {}
+ }
+ },
+ {
+ "name": "Uid",
+ "source": "Uid",
+ "publicAliases": [],
+ "deprecated": false,
+ "type": {
+ "kind": "object",
+ "properties": [
+ {
+ "name": "uid",
+ "publicName": "uid",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "ref",
+ "name": "Nanoid"
+ }
+ }
+ ],
+ "additionalProperties": false
+ }
+ },
+ {
+ "name": "LoginPortalEmail",
+ "source": "LoginPortalEmail",
+ "publicAliases": [],
+ "deprecated": false,
+ "type": {
+ "kind": "object",
+ "properties": [
+ {
+ "name": "logo",
+ "publicName": "logo",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ },
+ {
+ "name": "logoSize",
+ "publicName": "logoSize",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ },
+ {
+ "name": "buttonText",
+ "publicName": "buttonText",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string",
+ "validation": {
+ "maxLength": 50
+ }
+ }
+ },
+ {
+ "name": "message",
+ "publicName": "message",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string",
+ "validation": {
+ "maxLength": 1000
+ }
+ }
+ },
+ {
+ "name": "title",
+ "publicName": "title",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string",
+ "validation": {
+ "maxLength": 100
+ }
+ }
+ },
+ {
+ "name": "mainColor",
+ "publicName": "mainColor",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string",
+ "validation": {
+ "maxLength": 100
+ }
+ }
+ },
+ {
+ "name": "mainBackground",
+ "publicName": "mainBackground",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string",
+ "validation": {
+ "maxLength": 100
+ }
+ }
+ },
+ {
+ "name": "cardColor",
+ "publicName": "cardColor",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string",
+ "validation": {
+ "maxLength": 100
+ }
+ }
+ },
+ {
+ "name": "cardBackground",
+ "publicName": "cardBackground",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string",
+ "validation": {
+ "maxLength": 100
+ }
+ }
+ },
+ {
+ "name": "buttonColor",
+ "publicName": "buttonColor",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string",
+ "validation": {
+ "maxLength": 100
+ }
+ }
+ },
+ {
+ "name": "buttonBackground",
+ "publicName": "buttonBackground",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string",
+ "validation": {
+ "maxLength": 100
+ }
+ }
+ }
+ ],
+ "additionalProperties": false
+ }
+ },
+ {
+ "name": "LoginPortalPage",
+ "source": "LoginPortalPage",
+ "publicAliases": [],
+ "deprecated": false,
+ "type": {
+ "kind": "object",
+ "properties": [
+ {
+ "name": "title",
+ "publicName": "title",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string",
+ "validation": {
+ "maxLength": 100
+ }
+ }
+ },
+ {
+ "name": "description",
+ "publicName": "description",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string",
+ "validation": {
+ "maxLength": 500
+ }
+ }
+ },
+ {
+ "name": "head",
+ "publicName": "head",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ },
+ {
+ "name": "script",
+ "publicName": "script",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ },
+ {
+ "name": "theme",
+ "publicName": "theme",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ },
+ {
+ "name": "companyName",
+ "publicName": "companyName",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string",
+ "validation": {
+ "maxLength": 100
+ }
+ }
+ },
+ {
+ "name": "logo",
+ "publicName": "logo",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ },
+ {
+ "name": "logoURL",
+ "publicName": "logoURL",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ },
+ {
+ "name": "favicon",
+ "publicName": "favicon",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ },
+ {
+ "name": "termsLink",
+ "publicName": "termsLink",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ },
+ {
+ "name": "privacyLink",
+ "publicName": "privacyLink",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ },
+ {
+ "name": "formTitle",
+ "publicName": "formTitle",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string",
+ "validation": {
+ "maxLength": 100
+ }
+ }
+ },
+ {
+ "name": "formDescription",
+ "publicName": "formDescription",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string",
+ "validation": {
+ "maxLength": 500
+ }
+ }
+ },
+ {
+ "name": "formImage",
+ "publicName": "formImage",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ }
+ ],
+ "additionalProperties": false
+ }
+ },
+ {
+ "name": "LoginPortal",
+ "source": "LoginPortal",
+ "publicAliases": [],
+ "deprecated": false,
+ "type": {
+ "kind": "object",
+ "properties": [
+ {
+ "name": "uid",
+ "publicName": "uid",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "ref",
+ "name": "Nanoid"
+ }
+ },
+ {
+ "name": "title",
+ "publicName": "title",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string",
+ "validation": {
+ "maxLength": 200
+ }
+ }
+ },
+ {
+ "name": "slug",
+ "publicName": "slug",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "ref",
+ "name": "Slug"
+ }
+ }
+ ],
+ "additionalProperties": false
+ }
+ },
+ {
+ "name": "Rule",
+ "source": "Rule",
+ "publicAliases": [],
+ "deprecated": false,
+ "type": {
+ "kind": "object",
+ "properties": [
+ {
+ "name": "uid",
+ "publicName": "uid",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "ref",
+ "name": "Nanoid"
+ }
+ },
+ {
+ "name": "title",
+ "publicName": "title",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string",
+ "validation": {
+ "maxLength": 100
+ }
+ }
+ },
+ {
+ "name": "description",
+ "publicName": "description",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ },
+ {
+ "name": "slug",
+ "publicName": "slug",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "ref",
+ "name": "Slug"
+ }
+ },
+ {
+ "name": "namespace",
+ "publicName": "namespace",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "ref",
+ "name": "Namespace"
+ }
+ },
+ {
+ "name": "isPrivate",
+ "publicName": "isPrivate",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "boolean"
+ }
+ }
+ ],
+ "additionalProperties": false
+ }
+ },
+ {
+ "name": "Theme",
+ "source": "Theme",
+ "publicAliases": [],
+ "deprecated": false,
+ "type": {
+ "kind": "object",
+ "properties": [
+ {
+ "name": "uid",
+ "publicName": "uid",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "ref",
+ "name": "Nanoid"
+ }
+ },
+ {
+ "name": "name",
+ "publicName": "name",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ },
+ {
+ "name": "description",
+ "publicName": "description",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ },
+ {
+ "name": "slug",
+ "publicName": "slug",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "ref",
+ "name": "Slug"
+ }
+ }
+ ],
+ "additionalProperties": false
+ }
+ },
+ {
+ "name": "Team",
+ "source": "Team",
+ "publicAliases": [],
+ "deprecated": false,
+ "type": {
+ "kind": "object",
+ "properties": [
+ {
+ "name": "uid",
+ "publicName": "uid",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "ref",
+ "name": "Nanoid"
+ }
+ },
+ {
+ "name": "name",
+ "publicName": "name",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "ref",
+ "name": "TeamName"
+ }
+ },
+ {
+ "name": "imageUri",
+ "publicName": "imageUri",
+ "required": false,
+ "deprecated": false,
+ "type": {
+ "kind": "ref",
+ "name": "TeamImage"
+ }
+ },
+ {
+ "name": "slug",
+ "publicName": "slug",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "ref",
+ "name": "Slug"
+ }
+ },
+ {
+ "name": "theme",
+ "publicName": "theme",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ }
+ ],
+ "additionalProperties": false
+ }
+ },
+ {
+ "name": "TeamName",
+ "source": "TeamName",
+ "publicAliases": [],
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ },
+ {
+ "name": "TeamImage",
+ "source": "TeamImage",
+ "publicAliases": [],
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ },
+ {
+ "name": "GithubProject",
+ "source": "GithubProject",
+ "publicAliases": [],
+ "deprecated": false,
+ "type": {
+ "kind": "object",
+ "properties": [
+ {
+ "name": "uid",
+ "publicName": "uid",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "ref",
+ "name": "Nanoid"
+ }
+ },
+ {
+ "name": "createdAt",
+ "publicName": "createdAt",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "ref",
+ "name": "Timestamp"
+ }
+ },
+ {
+ "name": "updatedAt",
+ "publicName": "updatedAt",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "ref",
+ "name": "Timestamp"
+ }
+ },
+ {
+ "name": "name",
+ "publicName": "name",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ },
+ {
+ "name": "activeDeployment",
+ "publicName": "activeDeployment",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "union",
+ "variants": [
+ {
+ "kind": "ref",
+ "name": "ActiveDeployment"
+ },
+ {
+ "kind": "null"
+ }
+ ]
+ }
+ },
+ {
+ "name": "lastPublished",
+ "publicName": "lastPublished",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "union",
+ "variants": [
+ {
+ "kind": "ref",
+ "name": "Timestamp"
+ },
+ {
+ "kind": "null"
+ }
+ ]
+ }
+ },
+ {
+ "name": "lastPublishedUid",
+ "publicName": "lastPublishedUid",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "union",
+ "variants": [
+ {
+ "kind": "primitive",
+ "type": "string"
+ },
+ {
+ "kind": "null"
+ }
+ ]
+ }
+ },
+ {
+ "name": "loginPortalUid",
+ "publicName": "loginPortalUid",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ },
+ {
+ "name": "activeThemeId",
+ "publicName": "activeThemeId",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ },
+ {
+ "name": "typesenseId",
+ "publicName": "typesenseId",
+ "required": false,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "number"
+ }
+ },
+ {
+ "name": "isPrivate",
+ "publicName": "isPrivate",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "boolean"
+ }
+ },
+ {
+ "name": "agentEnabled",
+ "publicName": "agentEnabled",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "boolean"
+ }
+ },
+ {
+ "name": "accessGroups",
+ "publicName": "accessGroups",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ },
+ {
+ "name": "slug",
+ "publicName": "slug",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "ref",
+ "name": "Slug"
+ }
+ },
+ {
+ "name": "publishStatus",
+ "publicName": "publishStatus",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ },
+ {
+ "name": "publishMessage",
+ "publicName": "publishMessage",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ },
+ {
+ "name": "repository",
+ "publicName": "repository",
+ "required": false,
+ "deprecated": false,
+ "type": {
+ "kind": "union",
+ "variants": [
+ {
+ "kind": "ref",
+ "name": "GithubProjectRepository"
+ },
+ {
+ "kind": "null"
+ }
+ ]
+ }
+ }
+ ],
+ "additionalProperties": false
+ }
+ },
+ {
+ "name": "ActiveDeployment",
+ "source": "ActiveDeployment",
+ "publicAliases": [],
+ "deprecated": false,
+ "type": {
+ "kind": "object",
+ "properties": [
+ {
+ "name": "uid",
+ "publicName": "uid",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ },
+ {
+ "name": "domain",
+ "publicName": "domain",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ },
+ {
+ "name": "publishedAt",
+ "publicName": "publishedAt",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "ref",
+ "name": "Timestamp"
+ }
+ }
+ ],
+ "additionalProperties": false
+ }
+ },
+ {
+ "name": "GithubProjectRepository",
+ "source": "GithubProjectRepository",
+ "publicAliases": [],
+ "deprecated": false,
+ "type": {
+ "kind": "object",
+ "properties": [
+ {
+ "name": "linkedBy",
+ "publicName": "linkedBy",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ },
+ {
+ "name": "id",
+ "publicName": "id",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "number"
+ }
+ },
+ {
+ "name": "name",
+ "publicName": "name",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string",
+ "validation": {
+ "minLength": 2
+ }
+ }
+ },
+ {
+ "name": "configPath",
+ "publicName": "configPath",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ },
+ {
+ "name": "branch",
+ "publicName": "branch",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ },
+ {
+ "name": "publishOnMerge",
+ "publicName": "publishOnMerge",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "boolean"
+ }
+ },
+ {
+ "name": "publishPreviews",
+ "publicName": "publishPreviews",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "boolean"
+ }
+ },
+ {
+ "name": "prComments",
+ "publicName": "prComments",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "boolean"
+ }
+ },
+ {
+ "name": "expired",
+ "publicName": "expired",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "boolean"
+ }
+ }
+ ],
+ "additionalProperties": false
+ }
+ },
+ {
+ "name": "Email",
+ "source": "Email",
+ "publicAliases": [],
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string",
+ "format": "email",
+ "validation": {
+ "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
+ }
+ }
+ },
+ {
+ "name": "TeamSummary",
+ "source": "TeamSummary",
+ "publicAliases": [],
+ "deprecated": false,
+ "type": {
+ "kind": "object",
+ "properties": [
+ {
+ "name": "uid",
+ "publicName": "uid",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "ref",
+ "name": "Nanoid"
+ }
+ },
+ {
+ "name": "name",
+ "publicName": "name",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "ref",
+ "name": "TeamName"
+ }
+ },
+ {
+ "name": "imageUri",
+ "publicName": "imageUri",
+ "required": false,
+ "deprecated": false,
+ "type": {
+ "kind": "ref",
+ "name": "TeamImage"
+ }
+ }
+ ],
+ "additionalProperties": false
+ }
+ },
+ {
+ "name": "User",
+ "source": "User",
+ "publicAliases": [],
+ "deprecated": false,
+ "type": {
+ "kind": "object",
+ "properties": [
+ {
+ "name": "uid",
+ "publicName": "uid",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "ref",
+ "name": "Nanoid"
+ }
+ },
+ {
+ "name": "createdAt",
+ "publicName": "createdAt",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "ref",
+ "name": "Timestamp"
+ }
+ },
+ {
+ "name": "updatedAt",
+ "publicName": "updatedAt",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "ref",
+ "name": "Timestamp"
+ }
+ },
+ {
+ "name": "email",
+ "publicName": "email",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "ref",
+ "name": "Email"
+ }
+ },
+ {
+ "name": "theme",
+ "publicName": "theme",
+ "required": false,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "string"
+ }
+ },
+ {
+ "name": "activeTeamId",
+ "publicName": "activeTeamId",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "union",
+ "variants": [
+ {
+ "kind": "primitive",
+ "type": "string"
+ },
+ {
+ "kind": "null"
+ }
+ ]
+ }
+ },
+ {
+ "name": "hasGithub",
+ "publicName": "hasGithub",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "primitive",
+ "type": "boolean"
+ }
+ },
+ {
+ "name": "teams",
+ "publicName": "teams",
+ "required": true,
+ "deprecated": false,
+ "type": {
+ "kind": "array",
+ "items": {
+ "kind": "ref",
+ "name": "TeamSummary"
+ }
+ }
+ }
+ ],
+ "additionalProperties": false
+ }
+ }
+ ],
+ "resources": [
+ "registry",
+ "schemas",
+ "schemas.version",
+ "schemas.accessGroup",
+ "loginPortals",
+ "rules",
+ "themes",
+ "teams",
+ "scalarDocs",
+ "namespaces",
+ "authentication"
+ ],
+ "publicResources": [
+ "registry",
+ "schemas",
+ "schemas.version",
+ "schemas.accessGroup",
+ "loginPortals",
+ "rules",
+ "themes",
+ "teams",
+ "scalarDocs",
+ "namespaces",
+ "authentication"
+ ],
+ "operations": [
+ {
+ "resource": "registry",
+ "publicResource": "registry",
+ "operation": "listAllApiDocuments",
+ "publicOperation": "listAllApiDocuments",
+ "deprecated": false,
+ "method": "GET",
+ "path": "/v1/apis",
+ "pathParams": [],
+ "publicPathParams": [],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [],
+ "publicBodyParams": [],
+ "pathParamDetails": [],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "response": {
+ "status": "200",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ]
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "registry",
+ "publicResource": "registry",
+ "operation": "listApiDocuments",
+ "publicOperation": "listApiDocuments",
+ "deprecated": false,
+ "method": "GET",
+ "path": "/v1/apis/{namespace}",
+ "pathParams": [
+ "namespace"
+ ],
+ "publicPathParams": [
+ "namespace"
+ ],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [],
+ "publicBodyParams": [],
+ "pathParamDetails": [
+ {
+ "name": "namespace",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ }
+ ],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "paramsModel": {
+ "publicName": "RegistryListApiDocumentsParams"
+ },
+ "response": {
+ "status": "200",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ]
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "registry",
+ "publicResource": "registry",
+ "operation": "createApiDocument",
+ "publicOperation": "createApiDocument",
+ "deprecated": false,
+ "method": "POST",
+ "path": "/v1/apis/{namespace}",
+ "pathParams": [
+ "namespace"
+ ],
+ "publicPathParams": [
+ "namespace"
+ ],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [
+ "title",
+ "description",
+ "version",
+ "slug",
+ "ruleset",
+ "isPrivate",
+ "document"
+ ],
+ "publicBodyParams": [
+ "title",
+ "description",
+ "version",
+ "slug",
+ "ruleset",
+ "isPrivate",
+ "document"
+ ],
+ "pathParamDetails": [
+ {
+ "name": "namespace",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ }
+ ],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "paramsModel": {
+ "publicName": "RegistryCreateApiDocumentParams"
+ },
+ "requestBody": {
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "required": true,
+ "publicName": "body",
+ "publicIdentifier": "body"
+ },
+ "response": {
+ "status": "200",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ]
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "registry",
+ "publicResource": "registry",
+ "operation": "updateApiDocument",
+ "publicOperation": "updateApiDocument",
+ "deprecated": false,
+ "method": "PATCH",
+ "path": "/v1/apis/{namespace}/{slug}",
+ "pathParams": [
+ "namespace",
+ "slug"
+ ],
+ "publicPathParams": [
+ "namespace",
+ "slug"
+ ],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [
+ "title",
+ "description",
+ "isPrivate",
+ "ruleset"
+ ],
+ "publicBodyParams": [
+ "title",
+ "description",
+ "isPrivate",
+ "ruleset"
+ ],
+ "pathParamDetails": [
+ {
+ "name": "namespace",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ },
+ {
+ "name": "slug",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ }
+ ],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "paramsModel": {
+ "publicName": "RegistryUpdateApiDocumentParams"
+ },
+ "requestBody": {
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "required": true,
+ "publicName": "body",
+ "publicIdentifier": "body"
+ },
+ "response": {
+ "status": "200",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ]
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "registry",
+ "publicResource": "registry",
+ "operation": "deleteApiDocument",
+ "publicOperation": "deleteApiDocument",
+ "deprecated": false,
+ "method": "DELETE",
+ "path": "/v1/apis/{namespace}/{slug}",
+ "pathParams": [
+ "namespace",
+ "slug"
+ ],
+ "publicPathParams": [
+ "namespace",
+ "slug"
+ ],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [],
+ "publicBodyParams": [],
+ "pathParamDetails": [
+ {
+ "name": "namespace",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ },
+ {
+ "name": "slug",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ }
+ ],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "paramsModel": {
+ "publicName": "RegistryDeleteApiDocumentParams"
+ },
+ "response": {
+ "status": "200",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ]
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "registry",
+ "publicResource": "registry",
+ "operation": "retrieveApiDocumentVersion",
+ "publicOperation": "retrieveApiDocumentVersion",
+ "deprecated": false,
+ "method": "GET",
+ "path": "/v1/apis/{namespace}/{slug}/version/{semver}",
+ "pathParams": [
+ "namespace",
+ "slug",
+ "semver"
+ ],
+ "publicPathParams": [
+ "namespace",
+ "slug",
+ "semver"
+ ],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [],
+ "publicBodyParams": [],
+ "pathParamDetails": [
+ {
+ "name": "namespace",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ },
+ {
+ "name": "slug",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ },
+ {
+ "name": "semver",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ }
+ ],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "paramsModel": {
+ "publicName": "RegistryRetrieveApiDocumentVersionParams"
+ },
+ "response": {
+ "status": "200",
+ "contentType": "text/plain",
+ "encoding": "text",
+ "contents": [
+ {
+ "contentType": "text/plain",
+ "encoding": "text"
+ }
+ ]
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "registry",
+ "publicResource": "registry",
+ "operation": "updateApiDocumentVersion",
+ "publicOperation": "updateApiDocumentVersion",
+ "deprecated": false,
+ "method": "PATCH",
+ "path": "/v1/apis/{namespace}/{slug}/version/{semver}",
+ "pathParams": [
+ "namespace",
+ "slug",
+ "semver"
+ ],
+ "publicPathParams": [
+ "namespace",
+ "slug",
+ "semver"
+ ],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [
+ "document",
+ "lastKnownVersionSha"
+ ],
+ "publicBodyParams": [
+ "document",
+ "lastKnownVersionSha"
+ ],
+ "pathParamDetails": [
+ {
+ "name": "namespace",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ },
+ {
+ "name": "slug",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ },
+ {
+ "name": "semver",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ }
+ ],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "paramsModel": {
+ "publicName": "RegistryUpdateApiDocumentVersionParams"
+ },
+ "requestBody": {
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "required": true,
+ "publicName": "body",
+ "publicIdentifier": "body"
+ },
+ "response": {
+ "status": "200",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ]
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "registry",
+ "publicResource": "registry",
+ "operation": "deleteApiDocumentVersion",
+ "publicOperation": "deleteApiDocumentVersion",
+ "deprecated": false,
+ "method": "DELETE",
+ "path": "/v1/apis/{namespace}/{slug}/version/{semver}",
+ "pathParams": [
+ "namespace",
+ "slug",
+ "semver"
+ ],
+ "publicPathParams": [
+ "namespace",
+ "slug",
+ "semver"
+ ],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [],
+ "publicBodyParams": [],
+ "pathParamDetails": [
+ {
+ "name": "namespace",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ },
+ {
+ "name": "slug",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ },
+ {
+ "name": "semver",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ }
+ ],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "paramsModel": {
+ "publicName": "RegistryDeleteApiDocumentVersionParams"
+ },
+ "response": {
+ "status": "200",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ]
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "registry",
+ "publicResource": "registry",
+ "operation": "listApiDocumentVersionMetadata",
+ "publicOperation": "listApiDocumentVersionMetadata",
+ "deprecated": false,
+ "method": "GET",
+ "path": "/v1/apis/{namespace}/{slug}/version/{semver}/metadata",
+ "pathParams": [
+ "namespace",
+ "slug",
+ "semver"
+ ],
+ "publicPathParams": [
+ "namespace",
+ "slug",
+ "semver"
+ ],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [],
+ "publicBodyParams": [],
+ "pathParamDetails": [
+ {
+ "name": "namespace",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ },
+ {
+ "name": "slug",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ },
+ {
+ "name": "semver",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ }
+ ],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "paramsModel": {
+ "publicName": "RegistryListApiDocumentVersionMetadataParams"
+ },
+ "response": {
+ "status": "200",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ]
+ },
+ "responseModel": {
+ "name": "ManagedDocVersion",
+ "publicAliases": []
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "registry",
+ "publicResource": "registry",
+ "operation": "createApiDocumentVersion",
+ "publicOperation": "createApiDocumentVersion",
+ "deprecated": false,
+ "method": "POST",
+ "path": "/v1/apis/{namespace}/{slug}/version",
+ "pathParams": [
+ "namespace",
+ "slug"
+ ],
+ "publicPathParams": [
+ "namespace",
+ "slug"
+ ],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [
+ "version",
+ "document",
+ "force",
+ "lastKnownVersionSha"
+ ],
+ "publicBodyParams": [
+ "version",
+ "document",
+ "force",
+ "lastKnownVersionSha"
+ ],
+ "pathParamDetails": [
+ {
+ "name": "namespace",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ },
+ {
+ "name": "slug",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ }
+ ],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "paramsModel": {
+ "publicName": "RegistryCreateApiDocumentVersionParams"
+ },
+ "requestBody": {
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "required": true,
+ "publicName": "body",
+ "publicIdentifier": "body"
+ },
+ "response": {
+ "status": "200",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ]
+ },
+ "responseModel": {
+ "name": "ManagedDocVersion",
+ "publicAliases": []
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "registry",
+ "publicResource": "registry",
+ "operation": "createApiDocumentAccessGroup",
+ "publicOperation": "createApiDocumentAccessGroup",
+ "deprecated": false,
+ "method": "POST",
+ "path": "/v1/apis/{namespace}/{slug}/access-group",
+ "pathParams": [
+ "namespace",
+ "slug"
+ ],
+ "publicPathParams": [
+ "namespace",
+ "slug"
+ ],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [
+ "accessGroupSlug"
+ ],
+ "publicBodyParams": [
+ "accessGroupSlug"
+ ],
+ "pathParamDetails": [
+ {
+ "name": "namespace",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ },
+ {
+ "name": "slug",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ }
+ ],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "paramsModel": {
+ "publicName": "RegistryCreateApiDocumentAccessGroupParams"
+ },
+ "requestBody": {
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "required": true,
+ "publicName": "body",
+ "publicIdentifier": "body"
+ },
+ "response": {
+ "status": "200",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ]
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "registry",
+ "publicResource": "registry",
+ "operation": "deleteApiDocumentAccessGroup",
+ "publicOperation": "deleteApiDocumentAccessGroup",
+ "deprecated": false,
+ "method": "DELETE",
+ "path": "/v1/apis/{namespace}/{slug}/access-group",
+ "pathParams": [
+ "namespace",
+ "slug"
+ ],
+ "publicPathParams": [
+ "namespace",
+ "slug"
+ ],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [
+ "accessGroupSlug"
+ ],
+ "publicBodyParams": [
+ "accessGroupSlug"
+ ],
+ "pathParamDetails": [
+ {
+ "name": "namespace",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ },
+ {
+ "name": "slug",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ }
+ ],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "paramsModel": {
+ "publicName": "RegistryDeleteApiDocumentAccessGroupParams"
+ },
+ "requestBody": {
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "required": true,
+ "publicName": "body",
+ "publicIdentifier": "body"
+ },
+ "response": {
+ "status": "200",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ]
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "schemas",
+ "publicResource": "schemas",
+ "operation": "list",
+ "publicOperation": "list",
+ "deprecated": false,
+ "method": "GET",
+ "path": "/v1/schemas/{namespace}",
+ "pathParams": [
+ "namespace"
+ ],
+ "publicPathParams": [
+ "namespace"
+ ],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [],
+ "publicBodyParams": [],
+ "pathParamDetails": [
+ {
+ "name": "namespace",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ }
+ ],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "paramsModel": {
+ "publicName": "SchemaListParams"
+ },
+ "response": {
+ "status": "200",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ]
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "schemas",
+ "publicResource": "schemas",
+ "operation": "create",
+ "publicOperation": "create",
+ "deprecated": false,
+ "method": "POST",
+ "path": "/v1/schemas/{namespace}",
+ "pathParams": [
+ "namespace"
+ ],
+ "publicPathParams": [
+ "namespace"
+ ],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [
+ "title",
+ "description",
+ "version",
+ "slug",
+ "isPrivate",
+ "document"
+ ],
+ "publicBodyParams": [
+ "title",
+ "description",
+ "version",
+ "slug",
+ "isPrivate",
+ "document"
+ ],
+ "pathParamDetails": [
+ {
+ "name": "namespace",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ }
+ ],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "paramsModel": {
+ "publicName": "SchemaCreateParams"
+ },
+ "requestBody": {
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "required": true,
+ "publicName": "body",
+ "publicIdentifier": "body"
+ },
+ "response": {
+ "status": "200",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ]
+ },
+ "responseModel": {
+ "name": "Uid",
+ "publicAliases": []
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "schemas",
+ "publicResource": "schemas",
+ "operation": "update",
+ "publicOperation": "update",
+ "deprecated": false,
+ "method": "PATCH",
+ "path": "/v1/schemas/{namespace}/{slug}",
+ "pathParams": [
+ "namespace",
+ "slug"
+ ],
+ "publicPathParams": [
+ "namespace",
+ "slug"
+ ],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [
+ "title",
+ "description",
+ "isPrivate"
+ ],
+ "publicBodyParams": [
+ "title",
+ "description",
+ "isPrivate"
+ ],
+ "pathParamDetails": [
+ {
+ "name": "namespace",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ },
+ {
+ "name": "slug",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ }
+ ],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "paramsModel": {
+ "publicName": "SchemaUpdateParams"
+ },
+ "requestBody": {
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "required": true,
+ "publicName": "body",
+ "publicIdentifier": "body"
+ },
+ "response": {
+ "status": "200",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ]
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "schemas",
+ "publicResource": "schemas",
+ "operation": "delete",
+ "publicOperation": "delete",
+ "deprecated": false,
+ "method": "DELETE",
+ "path": "/v1/schemas/{namespace}/{slug}",
+ "pathParams": [
+ "namespace",
+ "slug"
+ ],
+ "publicPathParams": [
+ "namespace",
+ "slug"
+ ],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [],
+ "publicBodyParams": [],
+ "pathParamDetails": [
+ {
+ "name": "namespace",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ },
+ {
+ "name": "slug",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ }
+ ],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "paramsModel": {
+ "publicName": "SchemaDeleteParams"
+ },
+ "response": {
+ "status": "200",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ]
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "schemas.version",
+ "publicResource": "schemas.version",
+ "operation": "retrieveSchema",
+ "publicOperation": "retrieveSchema",
+ "deprecated": false,
+ "method": "GET",
+ "path": "/v1/schemas/{namespace}/{slug}/version/{semver}",
+ "pathParams": [
+ "namespace",
+ "slug",
+ "semver"
+ ],
+ "publicPathParams": [
+ "namespace",
+ "slug",
+ "semver"
+ ],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [],
+ "publicBodyParams": [],
+ "pathParamDetails": [
+ {
+ "name": "namespace",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ },
+ {
+ "name": "slug",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ },
+ {
+ "name": "semver",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ }
+ ],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "paramsModel": {
+ "publicName": "VersionRetrieveSchemaParams"
+ },
+ "response": {
+ "status": "200",
+ "contentType": "text/plain",
+ "encoding": "text",
+ "contents": [
+ {
+ "contentType": "text/plain",
+ "encoding": "text"
+ }
+ ]
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "schemas.version",
+ "publicResource": "schemas.version",
+ "operation": "deleteSchema",
+ "publicOperation": "deleteSchema",
+ "deprecated": false,
+ "method": "DELETE",
+ "path": "/v1/schemas/{namespace}/{slug}/version/{semver}",
+ "pathParams": [
+ "namespace",
+ "slug",
+ "semver"
+ ],
+ "publicPathParams": [
+ "namespace",
+ "slug",
+ "semver"
+ ],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [],
+ "publicBodyParams": [],
+ "pathParamDetails": [
+ {
+ "name": "namespace",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ },
+ {
+ "name": "slug",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ },
+ {
+ "name": "semver",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ }
+ ],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "paramsModel": {
+ "publicName": "VersionDeleteSchemaParams"
+ },
+ "response": {
+ "status": "200",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ]
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "schemas.version",
+ "publicResource": "schemas.version",
+ "operation": "createSchema",
+ "publicOperation": "createSchema",
+ "deprecated": false,
+ "method": "POST",
+ "path": "/v1/schemas/{namespace}/{slug}/version",
+ "pathParams": [
+ "namespace",
+ "slug"
+ ],
+ "publicPathParams": [
+ "namespace",
+ "slug"
+ ],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [
+ "version",
+ "document"
+ ],
+ "publicBodyParams": [
+ "version",
+ "document"
+ ],
+ "pathParamDetails": [
+ {
+ "name": "namespace",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ },
+ {
+ "name": "slug",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ }
+ ],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "paramsModel": {
+ "publicName": "VersionCreateSchemaParams"
+ },
+ "requestBody": {
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "required": true,
+ "publicName": "body",
+ "publicIdentifier": "body"
+ },
+ "response": {
+ "status": "200",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ]
+ },
+ "responseModel": {
+ "name": "Uid",
+ "publicAliases": []
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "schemas.accessGroup",
+ "publicResource": "schemas.accessGroup",
+ "operation": "createSchema",
+ "publicOperation": "createSchema",
+ "deprecated": false,
+ "method": "POST",
+ "path": "/v1/schemas/{namespace}/{slug}/access-group",
+ "pathParams": [
+ "namespace",
+ "slug"
+ ],
+ "publicPathParams": [
+ "namespace",
+ "slug"
+ ],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [
+ "accessGroupSlug"
+ ],
+ "publicBodyParams": [
+ "accessGroupSlug"
+ ],
+ "pathParamDetails": [
+ {
+ "name": "namespace",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ },
+ {
+ "name": "slug",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ }
+ ],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "paramsModel": {
+ "publicName": "AccessGroupCreateSchemaParams"
+ },
+ "requestBody": {
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "required": true,
+ "publicName": "body",
+ "publicIdentifier": "body"
+ },
+ "response": {
+ "status": "200",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ]
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "schemas.accessGroup",
+ "publicResource": "schemas.accessGroup",
+ "operation": "deleteSchema",
+ "publicOperation": "deleteSchema",
+ "deprecated": false,
+ "method": "DELETE",
+ "path": "/v1/schemas/{namespace}/{slug}/access-group",
+ "pathParams": [
+ "namespace",
+ "slug"
+ ],
+ "publicPathParams": [
+ "namespace",
+ "slug"
+ ],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [
+ "accessGroupSlug"
+ ],
+ "publicBodyParams": [
+ "accessGroupSlug"
+ ],
+ "pathParamDetails": [
+ {
+ "name": "namespace",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ },
+ {
+ "name": "slug",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ }
+ ],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "paramsModel": {
+ "publicName": "AccessGroupDeleteSchemaParams"
+ },
+ "requestBody": {
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "required": true,
+ "publicName": "body",
+ "publicIdentifier": "body"
+ },
+ "response": {
+ "status": "200",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ]
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "loginPortals",
+ "publicResource": "loginPortals",
+ "operation": "retrieve",
+ "publicOperation": "retrieve",
+ "deprecated": false,
+ "method": "GET",
+ "path": "/v1/login-portals/{slug}",
+ "pathParams": [
+ "slug"
+ ],
+ "publicPathParams": [
+ "slug"
+ ],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [],
+ "publicBodyParams": [],
+ "pathParamDetails": [
+ {
+ "name": "slug",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ }
+ ],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "paramsModel": {
+ "publicName": "LoginPortalRetrieveParams"
+ },
+ "response": {
+ "status": "200",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ]
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "loginPortals",
+ "publicResource": "loginPortals",
+ "operation": "update",
+ "publicOperation": "update",
+ "deprecated": false,
+ "method": "PATCH",
+ "path": "/v1/login-portals/{slug}",
+ "pathParams": [
+ "slug"
+ ],
+ "publicPathParams": [
+ "slug"
+ ],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [
+ "title"
+ ],
+ "publicBodyParams": [
+ "title"
+ ],
+ "pathParamDetails": [
+ {
+ "name": "slug",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ }
+ ],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "paramsModel": {
+ "publicName": "LoginPortalUpdateParams"
+ },
+ "requestBody": {
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "required": true,
+ "publicName": "body",
+ "publicIdentifier": "body"
+ },
+ "response": {
+ "status": "200",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ]
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "loginPortals",
+ "publicResource": "loginPortals",
+ "operation": "delete",
+ "publicOperation": "delete",
+ "deprecated": false,
+ "method": "DELETE",
+ "path": "/v1/login-portals/{slug}",
+ "pathParams": [
+ "slug"
+ ],
+ "publicPathParams": [
+ "slug"
+ ],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [],
+ "publicBodyParams": [],
+ "pathParamDetails": [
+ {
+ "name": "slug",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ }
+ ],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "paramsModel": {
+ "publicName": "LoginPortalDeleteParams"
+ },
+ "response": {
+ "status": "200",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ]
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "loginPortals",
+ "publicResource": "loginPortals",
+ "operation": "create",
+ "publicOperation": "create",
+ "deprecated": false,
+ "method": "POST",
+ "path": "/v1/login-portals",
+ "pathParams": [],
+ "publicPathParams": [],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [
+ "title",
+ "slug",
+ "email",
+ "page"
+ ],
+ "publicBodyParams": [
+ "title",
+ "slug",
+ "email",
+ "page"
+ ],
+ "pathParamDetails": [],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "paramsModel": {
+ "publicName": "LoginPortalCreateParams"
+ },
+ "requestBody": {
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "required": true,
+ "publicName": "body",
+ "publicIdentifier": "body"
+ },
+ "response": {
+ "status": "200",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ]
+ },
+ "responseModel": {
+ "name": "Uid",
+ "publicAliases": []
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "loginPortals",
+ "publicResource": "loginPortals",
+ "operation": "list",
+ "publicOperation": "list",
+ "deprecated": false,
+ "method": "GET",
+ "path": "/v1/login-portals",
+ "pathParams": [],
+ "publicPathParams": [],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [],
+ "publicBodyParams": [],
+ "pathParamDetails": [],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "response": {
+ "status": "200",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ]
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "rules",
+ "publicResource": "rules",
+ "operation": "listRulesets",
+ "publicOperation": "listRulesets",
+ "deprecated": false,
+ "method": "GET",
+ "path": "/v1/rulesets/{namespace}",
+ "pathParams": [
+ "namespace"
+ ],
+ "publicPathParams": [
+ "namespace"
+ ],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [],
+ "publicBodyParams": [],
+ "pathParamDetails": [
+ {
+ "name": "namespace",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ }
+ ],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "paramsModel": {
+ "publicName": "RuleListRulesetsParams"
+ },
+ "response": {
+ "status": "200",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ]
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "rules",
+ "publicResource": "rules",
+ "operation": "createRuleset",
+ "publicOperation": "createRuleset",
+ "deprecated": false,
+ "method": "POST",
+ "path": "/v1/rulesets/{namespace}",
+ "pathParams": [
+ "namespace"
+ ],
+ "publicPathParams": [
+ "namespace"
+ ],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [
+ "title",
+ "description",
+ "slug",
+ "isPrivate",
+ "document"
+ ],
+ "publicBodyParams": [
+ "title",
+ "description",
+ "slug",
+ "isPrivate",
+ "document"
+ ],
+ "pathParamDetails": [
+ {
+ "name": "namespace",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ }
+ ],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "paramsModel": {
+ "publicName": "RuleCreateRulesetParams"
+ },
+ "requestBody": {
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "required": true,
+ "publicName": "body",
+ "publicIdentifier": "body"
+ },
+ "response": {
+ "status": "200",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ]
+ },
+ "responseModel": {
+ "name": "Uid",
+ "publicAliases": []
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "rules",
+ "publicResource": "rules",
+ "operation": "updateRuleset",
+ "publicOperation": "updateRuleset",
+ "deprecated": false,
+ "method": "PATCH",
+ "path": "/v1/rulesets/{namespace}/{slug}",
+ "pathParams": [
+ "namespace",
+ "slug"
+ ],
+ "publicPathParams": [
+ "namespace",
+ "slug"
+ ],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [
+ "namespace",
+ "slug",
+ "title",
+ "description",
+ "isPrivate"
+ ],
+ "publicBodyParams": [
+ "namespace",
+ "slug",
+ "title",
+ "description",
+ "isPrivate"
+ ],
+ "pathParamDetails": [
+ {
+ "name": "namespace",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ },
+ {
+ "name": "slug",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ }
+ ],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "paramsModel": {
+ "publicName": "RuleUpdateRulesetParams"
+ },
+ "requestBody": {
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "required": true,
+ "publicName": "body",
+ "publicIdentifier": "body"
+ },
+ "response": {
+ "status": "200",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ]
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "rules",
+ "publicResource": "rules",
+ "operation": "deleteRuleset",
+ "publicOperation": "deleteRuleset",
+ "deprecated": false,
+ "method": "DELETE",
+ "path": "/v1/rulesets/{namespace}/{slug}",
+ "pathParams": [
+ "namespace",
+ "slug"
+ ],
+ "publicPathParams": [
+ "namespace",
+ "slug"
+ ],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [],
+ "publicBodyParams": [],
+ "pathParamDetails": [
+ {
+ "name": "namespace",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ },
+ {
+ "name": "slug",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ }
+ ],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "paramsModel": {
+ "publicName": "RuleDeleteRulesetParams"
+ },
+ "response": {
+ "status": "200",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ]
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "rules",
+ "publicResource": "rules",
+ "operation": "retrieveRulesetDocument",
+ "publicOperation": "retrieveRulesetDocument",
+ "deprecated": false,
+ "method": "GET",
+ "path": "/v1/rulesets/{namespace}/{slug}",
+ "pathParams": [
+ "namespace",
+ "slug"
+ ],
+ "publicPathParams": [
+ "namespace",
+ "slug"
+ ],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [],
+ "publicBodyParams": [],
+ "pathParamDetails": [
+ {
+ "name": "namespace",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ },
+ {
+ "name": "slug",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ }
+ ],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "paramsModel": {
+ "publicName": "RuleRetrieveRulesetDocumentParams"
+ },
+ "response": {
+ "status": "200",
+ "contentType": "text/plain",
+ "encoding": "text",
+ "contents": [
+ {
+ "contentType": "text/plain",
+ "encoding": "text"
+ }
+ ]
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "rules",
+ "publicResource": "rules",
+ "operation": "createRulesetAccessGroup",
+ "publicOperation": "createRulesetAccessGroup",
+ "deprecated": false,
+ "method": "POST",
+ "path": "/v1/rulesets/{namespace}/{slug}/access-group",
+ "pathParams": [
+ "namespace",
+ "slug"
+ ],
+ "publicPathParams": [
+ "namespace",
+ "slug"
+ ],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [
+ "accessGroupSlug"
+ ],
+ "publicBodyParams": [
+ "accessGroupSlug"
+ ],
+ "pathParamDetails": [
+ {
+ "name": "namespace",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ },
+ {
+ "name": "slug",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ }
+ ],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "paramsModel": {
+ "publicName": "RuleCreateRulesetAccessGroupParams"
+ },
+ "requestBody": {
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "required": true,
+ "publicName": "body",
+ "publicIdentifier": "body"
+ },
+ "response": {
+ "status": "200",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ]
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "rules",
+ "publicResource": "rules",
+ "operation": "deleteRulesetAccessGroup",
+ "publicOperation": "deleteRulesetAccessGroup",
+ "deprecated": false,
+ "method": "DELETE",
+ "path": "/v1/rulesets/{namespace}/{slug}/access-group",
+ "pathParams": [
+ "namespace",
+ "slug"
+ ],
+ "publicPathParams": [
+ "namespace",
+ "slug"
+ ],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [
+ "accessGroupSlug"
+ ],
+ "publicBodyParams": [
+ "accessGroupSlug"
+ ],
+ "pathParamDetails": [
+ {
+ "name": "namespace",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ },
+ {
+ "name": "slug",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ }
+ ],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "paramsModel": {
+ "publicName": "RuleDeleteRulesetAccessGroupParams"
+ },
+ "requestBody": {
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "required": true,
+ "publicName": "body",
+ "publicIdentifier": "body"
+ },
+ "response": {
+ "status": "200",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ]
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "themes",
+ "publicResource": "themes",
+ "operation": "list",
+ "publicOperation": "list",
+ "deprecated": false,
+ "method": "GET",
+ "path": "/v1/themes",
+ "pathParams": [],
+ "publicPathParams": [],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [],
+ "publicBodyParams": [],
+ "pathParamDetails": [],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "response": {
+ "status": "200",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ]
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "themes",
+ "publicResource": "themes",
+ "operation": "create",
+ "publicOperation": "create",
+ "deprecated": false,
+ "method": "POST",
+ "path": "/v1/themes",
+ "pathParams": [],
+ "publicPathParams": [],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [
+ "name",
+ "description",
+ "slug",
+ "document"
+ ],
+ "publicBodyParams": [
+ "name",
+ "description",
+ "slug",
+ "document"
+ ],
+ "pathParamDetails": [],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "paramsModel": {
+ "publicName": "ThemeCreateParams"
+ },
+ "requestBody": {
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "required": true,
+ "publicName": "body",
+ "publicIdentifier": "body"
+ },
+ "response": {
+ "status": "200",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ]
+ },
+ "responseModel": {
+ "name": "Uid",
+ "publicAliases": []
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "themes",
+ "publicResource": "themes",
+ "operation": "update",
+ "publicOperation": "update",
+ "deprecated": false,
+ "method": "PATCH",
+ "path": "/v1/themes/{slug}",
+ "pathParams": [
+ "slug"
+ ],
+ "publicPathParams": [
+ "slug"
+ ],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [
+ "name",
+ "description"
+ ],
+ "publicBodyParams": [
+ "name",
+ "description"
+ ],
+ "pathParamDetails": [
+ {
+ "name": "slug",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ }
+ ],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "paramsModel": {
+ "publicName": "ThemeUpdateParams"
+ },
+ "requestBody": {
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "required": true,
+ "publicName": "body",
+ "publicIdentifier": "body"
+ },
+ "response": {
+ "status": "200",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ]
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "themes",
+ "publicResource": "themes",
+ "operation": "replaceDocument",
+ "publicOperation": "replaceDocument",
+ "deprecated": false,
+ "method": "PUT",
+ "path": "/v1/themes/{slug}",
+ "pathParams": [
+ "slug"
+ ],
+ "publicPathParams": [
+ "slug"
+ ],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [
+ "document"
+ ],
+ "publicBodyParams": [
+ "document"
+ ],
+ "pathParamDetails": [
+ {
+ "name": "slug",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ }
+ ],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "paramsModel": {
+ "publicName": "ThemeReplaceDocumentParams"
+ },
+ "requestBody": {
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "required": true,
+ "publicName": "body",
+ "publicIdentifier": "body"
+ },
+ "response": {
+ "status": "200",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ]
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "themes",
+ "publicResource": "themes",
+ "operation": "delete",
+ "publicOperation": "delete",
+ "deprecated": false,
+ "method": "DELETE",
+ "path": "/v1/themes/{slug}",
+ "pathParams": [
+ "slug"
+ ],
+ "publicPathParams": [
+ "slug"
+ ],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [],
+ "publicBodyParams": [],
+ "pathParamDetails": [
+ {
+ "name": "slug",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ }
+ ],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "paramsModel": {
+ "publicName": "ThemeDeleteParams"
+ },
+ "response": {
+ "status": "200",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ]
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "themes",
+ "publicResource": "themes",
+ "operation": "retrieve",
+ "publicOperation": "retrieve",
+ "deprecated": false,
+ "method": "GET",
+ "path": "/v1/themes/{slug}",
+ "pathParams": [
+ "slug"
+ ],
+ "publicPathParams": [
+ "slug"
+ ],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [],
+ "publicBodyParams": [],
+ "pathParamDetails": [
+ {
+ "name": "slug",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ }
+ ],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "paramsModel": {
+ "publicName": "ThemeRetrieveParams"
+ },
+ "response": {
+ "status": "200",
+ "contentType": "text/plain",
+ "encoding": "text",
+ "contents": [
+ {
+ "contentType": "text/plain",
+ "encoding": "text"
+ }
+ ]
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "teams",
+ "publicResource": "teams",
+ "operation": "list",
+ "publicOperation": "list",
+ "deprecated": false,
+ "method": "GET",
+ "path": "/v1/teams",
+ "pathParams": [],
+ "publicPathParams": [],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [],
+ "publicBodyParams": [],
+ "pathParamDetails": [],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "response": {
+ "status": "200",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ]
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "scalarDocs",
+ "publicResource": "scalarDocs",
+ "operation": "listGuides",
+ "publicOperation": "listGuides",
+ "deprecated": false,
+ "method": "GET",
+ "path": "/v1/guides",
+ "pathParams": [],
+ "publicPathParams": [],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [],
+ "publicBodyParams": [],
+ "pathParamDetails": [],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "response": {
+ "status": "200",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ]
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "scalarDocs",
+ "publicResource": "scalarDocs",
+ "operation": "createGuide",
+ "publicOperation": "createGuide",
+ "deprecated": false,
+ "method": "POST",
+ "path": "/v1/guides",
+ "pathParams": [],
+ "publicPathParams": [],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [
+ "name",
+ "slug",
+ "isPrivate",
+ "allowedUsers",
+ "allowedDomains"
+ ],
+ "publicBodyParams": [
+ "name",
+ "slug",
+ "isPrivate",
+ "allowedUsers",
+ "allowedDomains"
+ ],
+ "pathParamDetails": [],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "paramsModel": {
+ "publicName": "ScalarDocCreateGuideParams"
+ },
+ "requestBody": {
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "required": true,
+ "publicName": "body",
+ "publicIdentifier": "body"
+ },
+ "response": {
+ "status": "200",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ]
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "scalarDocs",
+ "publicResource": "scalarDocs",
+ "operation": "publishGuide",
+ "publicOperation": "publishGuide",
+ "deprecated": false,
+ "method": "POST",
+ "path": "/v1/guides/{slug}/publish",
+ "pathParams": [
+ "slug"
+ ],
+ "publicPathParams": [
+ "slug"
+ ],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [],
+ "publicBodyParams": [],
+ "pathParamDetails": [
+ {
+ "name": "slug",
+ "required": true,
+ "style": "simple",
+ "explode": false
+ }
+ ],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "paramsModel": {
+ "publicName": "ScalarDocPublishGuideParams"
+ },
+ "response": {
+ "status": "200",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ]
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "namespaces",
+ "publicResource": "namespaces",
+ "operation": "list",
+ "publicOperation": "list",
+ "deprecated": false,
+ "method": "GET",
+ "path": "/v1/namespaces",
+ "pathParams": [],
+ "publicPathParams": [],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [],
+ "publicBodyParams": [],
+ "pathParamDetails": [],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "response": {
+ "status": "200",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ]
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "authentication",
+ "publicResource": "authentication",
+ "operation": "exchangePersonalToken",
+ "publicOperation": "exchangePersonalToken",
+ "deprecated": false,
+ "method": "POST",
+ "path": "/v1/auth/exchange",
+ "pathParams": [],
+ "publicPathParams": [],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [
+ "personalToken"
+ ],
+ "publicBodyParams": [
+ "personalToken"
+ ],
+ "pathParamDetails": [],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "paramsModel": {
+ "publicName": "AuthenticationExchangePersonalTokenParams"
+ },
+ "requestBody": {
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "required": true,
+ "publicName": "body",
+ "publicIdentifier": "body"
+ },
+ "response": {
+ "status": "200",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ]
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ },
+ {
+ "resource": "authentication",
+ "publicResource": "authentication",
+ "operation": "listCurrentUser",
+ "publicOperation": "listCurrentUser",
+ "deprecated": false,
+ "method": "GET",
+ "path": "/v1/auth/me",
+ "pathParams": [],
+ "publicPathParams": [],
+ "queryParams": [],
+ "publicQueryParams": [],
+ "headerParams": [],
+ "publicHeaderParams": [],
+ "bodyParams": [],
+ "publicBodyParams": [],
+ "pathParamDetails": [],
+ "queryParamDetails": [],
+ "headerParamDetails": [],
+ "cookieParams": [],
+ "publicCookieParams": [],
+ "cookieParamDetails": [],
+ "response": {
+ "status": "200",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ]
+ },
+ "responseModel": {
+ "name": "User",
+ "publicAliases": []
+ },
+ "result": {
+ "successStatus": "200",
+ "errorStatuses": [
+ "400",
+ "401",
+ "403",
+ "404",
+ "422",
+ "500"
+ ]
+ },
+ "errorResponses": [
+ {
+ "status": "400",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_400",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "401",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_401",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "403",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_403",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "404",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_404",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "422",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_422",
+ "publicAliases": []
+ }
+ },
+ {
+ "status": "500",
+ "contentType": "application/json",
+ "encoding": "json",
+ "contents": [
+ {
+ "contentType": "application/json",
+ "encoding": "json"
+ }
+ ],
+ "model": {
+ "name": "_500",
+ "publicAliases": []
+ }
+ }
+ ],
+ "responseLinks": [],
+ "transport": "http"
+ }
+ ],
+ "webhooks": []
+}
diff --git a/scripts/finalize-build.mjs b/scripts/finalize-build.mjs
new file mode 100644
index 0000000..11472f1
--- /dev/null
+++ b/scripts/finalize-build.mjs
@@ -0,0 +1,49 @@
+import { readdir, readFile, writeFile } from 'node:fs/promises'
+import { dirname, extname, resolve } from 'node:path'
+import { fileURLToPath } from 'node:url'
+
+const root = resolve(dirname(fileURLToPath(import.meta.url)), '..')
+const RELATIVE_SPECIFIER_RE = /(from\s+["']|import\(\s*["'])(\.{1,2}\/[^"']+)(["'])/g
+
+await Promise.all([
+ rewriteRelativeSpecifiers(resolve(root, 'dist/esm')),
+ markCommonJsOutput(resolve(root, 'dist/cjs')),
+])
+
+async function rewriteRelativeSpecifiers(dir) {
+ let entries
+ try {
+ entries = await readdir(dir, { withFileTypes: true })
+ } catch (error) {
+ if (error && error.code === 'ENOENT') return
+ throw error
+ }
+
+ await Promise.all(
+ entries.map(async (entry) => {
+ const path = resolve(dir, entry.name)
+ if (entry.isDirectory()) {
+ await rewriteRelativeSpecifiers(path)
+ return
+ }
+ if (!path.endsWith('.js') && !path.endsWith('.d.ts')) return
+ const source = await readFile(path, 'utf8')
+ await writeFile(path, source.replace(RELATIVE_SPECIFIER_RE, addJsExtension), 'utf8')
+ }),
+ )
+}
+
+async function markCommonJsOutput(dir) {
+ try {
+ await readdir(dir)
+ await writeFile(resolve(dir, 'package.json'), '{\n "type": "commonjs"\n}\n', 'utf8')
+ } catch (error) {
+ if (error && error.code === 'ENOENT') return
+ throw error
+ }
+}
+
+function addJsExtension(match, prefix, specifier, suffix) {
+ if (extname(specifier)) return match
+ return `${prefix}${specifier}.js${suffix}`
+}
diff --git a/src/api-promise.ts b/src/api-promise.ts
new file mode 100644
index 0000000..4194b0c
--- /dev/null
+++ b/src/api-promise.ts
@@ -0,0 +1,81 @@
+// File generated from our OpenAPI spec by Scalar. See README.md for details.
+
+import type { ScalarAPI } from './client';
+import type { FinalRequestOptions } from './internal/request-options';
+
+export type APIResponseProps = {
+ readonly response: Response;
+ readonly options: FinalRequestOptions;
+ readonly controller: AbortController;
+ readonly requestLogID?: string | undefined;
+ readonly retryOfRequestLogID?: string | undefined;
+ readonly startTime?: number | undefined;
+};
+
+export type ParseResponse = (client: ScalarAPI, props: APIResponseProps) => T | Promise;
+
+export const defaultParseResponse = async (_client: unknown, props: APIResponseProps): Promise => {
+ const { response } = props;
+ if (response.status === 204) return null as T;
+ if (props.options.__binaryResponse) return response as T;
+ const contentType = response.headers.get('content-type');
+ const mediaType = contentType?.split(';')[0]?.trim();
+ const isJson = mediaType?.includes('application/json') || mediaType?.endsWith('+json');
+ if (isJson && response.headers.get('content-length') === '0') return undefined as T;
+ if (isJson) return (await response.json()) as T;
+ return (await response.text()) as unknown as T;
+};
+
+/** A Promise subclass providing SDK response helpers. */
+export class APIPromise extends Promise {
+ private parsedPromise: Promise | undefined;
+
+ constructor(
+ private readonly client: ScalarAPI,
+ private readonly responsePromise: Promise,
+ private readonly parseResponse: ParseResponse = defaultParseResponse,
+ ) {
+ super((resolve) => {
+ resolve(undefined as T);
+ });
+ }
+
+ _thenUnwrap(transform: (data: T, props: APIResponseProps) => U): APIPromise {
+ return new APIPromise(this.client, this.responsePromise, async (client, props) =>
+ transform(await this.parseResponse(client, props), props),
+ );
+ }
+
+ asResponse(): Promise {
+ return this.responsePromise.then((props) => props.response);
+ }
+
+ async withResponse(): Promise<{ data: T; response: Response }> {
+ const [data, response] = await Promise.all([this.parse(), this.asResponse()]);
+ return { data, response };
+ }
+
+ private parse(): Promise {
+ if (!this.parsedPromise) {
+ this.parsedPromise = this.responsePromise.then((props) => this.parseResponse(this.client, props));
+ }
+ return this.parsedPromise;
+ }
+
+ override then(
+ onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null,
+ onrejected?: ((reason: unknown) => TResult2 | PromiseLike) | undefined | null,
+ ): Promise {
+ return this.parse().then(onfulfilled, onrejected);
+ }
+
+ override catch(
+ onrejected?: ((reason: unknown) => TResult | PromiseLike) | undefined | null,
+ ): Promise {
+ return this.parse().catch(onrejected);
+ }
+
+ override finally(onfinally?: (() => void) | undefined | null): Promise {
+ return this.parse().finally(onfinally);
+ }
+}
diff --git a/src/client.ts b/src/client.ts
new file mode 100644
index 0000000..138c171
--- /dev/null
+++ b/src/client.ts
@@ -0,0 +1,941 @@
+// File generated from our OpenAPI spec by Scalar. See README.md for details.
+
+import { APIPromise, type APIResponseProps } from './api-promise';
+import * as Errors from './error';
+import { uuid4 } from './internal/utils/uuid';
+import { validatePositiveInteger, isAbsoluteURL, safeJSON, isEmptyObj } from './internal/utils/values';
+import { sleep } from './internal/utils/sleep';
+import { castToError, isAbortError } from './internal/errors';
+import { getPlatformHeaders } from './internal/detect-platform';
+import * as Shims from './internal/shims';
+import * as Opts from './internal/request-options';
+import { readEnv } from './internal/utils/env';
+import { formatRequestDetails, loggerFor, parseLogLevel, type LogLevel, type Logger } from './internal/utils/log';
+export type { Logger, LogLevel } from './internal/utils/log';
+import type { RequestInit, RequestInfo, BodyInit, Fetch } from './internal/builtin-types';
+import { buildHeaders, type HeadersLike } from './internal/headers';
+import type { FinalRequestOptions, RequestOptions } from './internal/request-options';
+import type { HTTPMethod, FinalizedRequestInit, MergedRequestInit, PromiseOrValue } from './internal/types';
+import { stringify as stringifyQuery } from './internal/qs/stringify';
+import type { StringifyOptions } from './internal/qs/types';
+import { toFile } from './core/uploads';
+import { VERSION } from './version';
+import { Registry, type Version, type AccessGroup, type RegistryListAllAPIDocumentsResponse, type RegistryListAPIDocumentsResponse, type RegistryCreateAPIDocumentResponse, type RegistryUpdateAPIDocumentVersionResponse, type ManagedDocVersion, type RegistryCreateAPIDocumentParams, type RegistryUpdateAPIDocumentParams, type RegistryDeleteAPIDocumentParams, type RegistryRetrieveAPIDocumentVersionParams, type RegistryUpdateAPIDocumentVersionParams, type RegistryDeleteAPIDocumentVersionParams, type RegistryListAPIDocumentVersionMetadataParams, type RegistryCreateAPIDocumentVersionParams, type RegistryCreateAPIDocumentAccessGroupParams, type RegistryDeleteAPIDocumentAccessGroupParams } from "./resources/registry";
+import { Schemas, type SchemaListResponse, type UID, type SchemaCreateParams, type SchemaUpdateParams, type SchemaDeleteParams } from "./resources/schemas/schemas";
+import { LoginPortals, type LoginPortalEmail, type LoginPortalPage, type LoginPortalRetrieveResponse, type LoginPortalListResponse, type LoginPortalUpdateParams, type LoginPortalCreateParams } from "./resources/login-portals";
+import { Rules, type RuleListRulesetsResponse, type RuleCreateRulesetParams, type RuleUpdateRulesetParams, type RuleDeleteRulesetParams, type RuleRetrieveRulesetDocumentParams, type RuleCreateRulesetAccessGroupParams, type RuleDeleteRulesetAccessGroupParams } from "./resources/rules";
+import { Themes, type ThemeListResponse, type ThemeCreateParams, type ThemeUpdateParams, type ThemeReplaceDocumentParams } from "./resources/themes";
+import { Teams, type TeamListResponse } from "./resources/teams";
+import { ScalarDocs, type Slug, type ScalarDocListGuidesResponse, type ScalarDocCreateGuideResponse, type ScalarDocPublishGuideResponse, type ScalarDocCreateGuideParams } from "./resources/scalar-docs";
+import { Namespaces, type NamespaceListResponse } from "./resources/namespaces";
+import { Authentication, type AuthenticationExchangePersonalTokenResponse, type User, type AuthenticationExchangePersonalTokenParams } from "./resources/authentication";
+
+export type AuthTokenProvider = () => string | Promise;
+
+const queryArrayFormat: NonNullable = "indices";
+const queryAllowDots = false;
+
+const environments = {
+ production: "https://access.scalar.com",
+ local: "http://127.0.0.1:4010",
+};
+type Environment = keyof typeof environments;
+
+export interface ClientOptions {
+ /**
+ * The token used for authentication.
+ */
+ bearerAuth?: string | AuthTokenProvider | undefined;
+
+ /**
+ * Specifies the environment to use for the API.
+ *
+ * Each environment maps to a different base URL:
+ * - `production` corresponds to `https://access.scalar.com`
+ * - `local` corresponds to `http://127.0.0.1:4010`
+ */
+ environment?: Environment | undefined;
+
+ /**
+ * Override the default base URL for the API, e.g., "https://api.example.com/v2/"
+ *
+ * Defaults to process.env["SCALAR_BASE_URL"].
+ */
+ baseURL?: string | null | undefined;
+
+ /**
+ * The maximum amount of time (in milliseconds) that the client should wait for a response
+ * from the server before timing out a single request.
+ *
+ * Note that request timeouts are retried by default, so in a worst-case scenario you may wait
+ * much longer than this timeout before the promise succeeds or fails.
+ *
+ * @unit milliseconds
+ */
+ timeout?: number | undefined;
+
+ /**
+ * Additional `RequestInit` options to be passed to `fetch` calls.
+ * Properties will be overridden by per-request `fetchOptions`.
+ */
+ fetchOptions?: MergedRequestInit | undefined;
+
+ /**
+ * Specify a custom `fetch` function implementation.
+ *
+ * If not provided, we expect that `fetch` is defined globally.
+ */
+ fetch?: Fetch | undefined;
+
+ /**
+ * The maximum number of times that the client will retry a request in case of a
+ * temporary failure, like a network error or a 5XX error from the server.
+ *
+ * @default 2
+ */
+ maxRetries?: number | undefined;
+
+ /**
+ * Default headers to include with every request to the API.
+ *
+ * These can be removed in individual requests by explicitly setting the
+ * header to `null` in request options.
+ */
+ defaultHeaders?: HeadersLike | undefined;
+
+ /**
+ * Default query parameters to include with every request to the API.
+ *
+ * These can be removed in individual requests by explicitly setting the
+ * param to `undefined` in request options.
+ */
+ defaultQuery?: Record | undefined;
+
+ /**
+ * Set the log level.
+ *
+ * Defaults to process.env["SCALAR_LOG"] or 'warn' if it isn't set.
+ */
+ logLevel?: LogLevel | undefined;
+
+ /**
+ * Set the logger.
+ *
+ * Defaults to globalThis.console.
+ */
+ logger?: Logger | undefined;
+}
+
+export type ScalarAPIOptions = ClientOptions;
+
+/**
+ * API Client for interfacing with the ScalarApi API.
+ */
+export class ScalarAPI {
+ bearerAuth: string | AuthTokenProvider | undefined;
+
+ baseURL: string;
+ maxRetries: number;
+ timeout: number;
+ logger: Logger;
+ logLevel: LogLevel | undefined;
+ fetchOptions: MergedRequestInit | undefined;
+ private fetch: Fetch;
+ #encoder: Opts.RequestEncoder;
+ protected idempotencyHeader?: string;
+ private _baseURLOverridden: boolean;
+ private _defaultBaseURL: string;
+ private _options: ClientOptions;
+
+ /**
+ * API Client for interfacing with the ScalarApi API.
+ *
+ * @param {string | AuthTokenProvider | undefined} [opts.bearerAuth=process.env["BEARER_AUTH"] ?? undefined]
+ * @param {Environment} [opts.environment=production] - Specifies the environment URL to use for the API.
+ * @param {string} [opts.baseURL=process.env["SCALAR_BASE_URL"] ?? https://access.scalar.com] - Override the default base URL for the API.
+ * @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
+ * @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls.
+ * @param {Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
+ * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
+ * @param {HeadersLike} opts.defaultHeaders - Default headers to include with every request to the API.
+ * @param {Record} opts.defaultQuery - Default query parameters to include with every request to the API.
+ */
+ constructor({
+ baseURL = readEnv("SCALAR_BASE_URL"),
+ bearerAuth = readEnv("BEARER_AUTH"),
+ ...opts
+ }: ClientOptions = {}) {
+ const options: ClientOptions = {
+ bearerAuth,
+ ...opts,
+ baseURL: baseURL || null,
+ };
+ const environment = options.environment ?? "production";
+ const baseURLOverridden = baseURL !== null && baseURL !== undefined && baseURL !== "";
+ if (baseURLOverridden && options.environment) throw new Errors.ScalarAPIError("Ambiguous URL; The `baseURL` option (or SCALAR_BASE_URL env var) and the `environment` option are given. If you want to use the environment you must pass baseURL: null");
+ const defaultBaseURL = environments[environment];
+ this.baseURL = options.baseURL || defaultBaseURL;
+ this.timeout = options.timeout ?? ScalarAPI.DEFAULT_TIMEOUT /* 1 minute */;
+ this.logger = options.logger ?? console;
+ const defaultLogLevel = 'warn';
+ // Set default logLevel early so that we can log a warning in parseLogLevel.
+ this.logLevel = defaultLogLevel;
+ this.logLevel =
+ parseLogLevel(options.logLevel, 'ClientOptions.logLevel', this) ??
+ parseLogLevel(readEnv("SCALAR_LOG"), "process.env[\"SCALAR_LOG\"]", this) ??
+ defaultLogLevel;
+ this.fetchOptions = options.fetchOptions;
+ this.maxRetries = options.maxRetries ?? 2;
+ this.fetch = options.fetch ?? Shims.getDefaultFetch();
+ this.#encoder = Opts.FallbackEncoder;
+
+ const customHeadersEnv = readEnv("SCALAR_CUSTOM_HEADERS");
+ if (customHeadersEnv) {
+ const parsed: Record = {};
+ for (const line of customHeadersEnv.split('\n')) {
+ const colon = line.indexOf(':');
+ if (colon >= 0) {
+ parsed[line.substring(0, colon).trim()] = line.substring(colon + 1).trim();
+ }
+ }
+ options.defaultHeaders = { ...parsed, ...options.defaultHeaders };
+ }
+
+ this._options = { ...options, baseURL: baseURLOverridden ? this.baseURL : undefined, environment };
+ this._baseURLOverridden = baseURLOverridden;
+ this._defaultBaseURL = defaultBaseURL;
+
+ this.bearerAuth = bearerAuth;
+ }
+
+ withOptions(options: Partial): this {
+ const client = new (this.constructor as new (props: ClientOptions) => this)({
+ ...this._options,
+ ...(this.#baseURLOverridden() ? { baseURL: this.baseURL } : {}),
+ maxRetries: this.maxRetries,
+ timeout: this.timeout,
+ logger: this.logger,
+ logLevel: this.logLevel,
+ fetch: this.fetch,
+ fetchOptions: this.fetchOptions,
+ bearerAuth: this.bearerAuth,
+ ...options,
+ });
+ return client;
+ }
+
+ #baseURLOverridden(): boolean {
+ // A named environment selects a default URL; only explicit overrides should bypass per-request defaults.
+ return this._baseURLOverridden || this.baseURL !== this._defaultBaseURL;
+ }
+
+ protected defaultQuery(): Record | undefined {
+ return this._options.defaultQuery;
+ }
+
+ protected stringifyQuery(query: object | Record): string {
+ return stringifyQuery(query, { arrayFormat: queryArrayFormat, allowDots: queryAllowDots });
+ }
+
+ private getUserAgent(): string {
+ return `${this.constructor.name}/JS ${VERSION}`;
+ }
+
+ protected defaultIdempotencyKey(): string {
+ return `scalar-node-retry-${uuid4()}`;
+ }
+
+ protected makeStatusError(
+ status: number,
+ error: object | undefined,
+ message: string | undefined,
+ headers: Headers,
+ ): Errors.APIError {
+ return Errors.APIError.generate(status, error, message, headers);
+ }
+
+ buildURL(
+ path: string,
+ query: Record | null | undefined,
+ defaultBaseURL?: string | undefined,
+ ): string {
+ const baseURL = (!this.#baseURLOverridden() && defaultBaseURL) || this.baseURL;
+ // Guarantee exactly one "/" between baseURL and path so that bases without a trailing slash
+ // and paths without a leading slash do not fuse into a malformed URL (e.g. ".../v1" + "widgets").
+ const url =
+ isAbsoluteURL(path) ?
+ new URL(path)
+ : new URL((baseURL.endsWith('/') ? baseURL : baseURL + '/') + (path.startsWith('/') ? path.slice(1) : path));
+
+ const defaultQuery = this.defaultQuery();
+ const pathQuery = Object.fromEntries(url.searchParams);
+ if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) {
+ query = { ...pathQuery, ...defaultQuery, ...query };
+ }
+
+ if (typeof query === "object" && query && !Array.isArray(query)) {
+ url.search = this.stringifyQuery(query);
+ }
+
+ return url.toString();
+ }
+
+ /**
+ * Used as a callback for mutating the given `FinalRequestOptions` object.
+ */
+ protected async prepareOptions(options: FinalRequestOptions): Promise {}
+
+ /**
+ * Used as a callback for mutating the given `RequestInit` object.
+ *
+ * This is useful for cases where you want to add certain headers based off of
+ * the request properties, e.g. `method` or `url`.
+ */
+ protected async prepareRequest(
+ request: RequestInit,
+ { url, options }: { url: string; options: FinalRequestOptions },
+ ): Promise {}
+
+ get(path: string, opts?: PromiseOrValue): APIPromise {
+ return this.methodRequest('get', path, opts);
+ }
+
+ post(path: string, opts?: PromiseOrValue): APIPromise {
+ return this.methodRequest('post', path, opts);
+ }
+
+ patch(path: string, opts?: PromiseOrValue): APIPromise {
+ return this.methodRequest('patch', path, opts);
+ }
+
+ put(path: string, opts?: PromiseOrValue): APIPromise {
+ return this.methodRequest('put', path, opts);
+ }
+
+ delete(path: string, opts?: PromiseOrValue): APIPromise {
+ return this.methodRequest('delete', path, opts);
+ }
+
+ private methodRequest(
+ method: HTTPMethod,
+ path: string,
+ opts?: PromiseOrValue,
+ ): APIPromise {
+ return this.request(
+ Promise.resolve(opts).then((opts) => {
+ return { method, path, ...opts } as FinalRequestOptions;
+ }),
+ );
+ }
+
+ request(
+ options: PromiseOrValue,
+ remainingRetries: number | null = null,
+ ): APIPromise {
+ return new APIPromise(this, this.makeRequest(options, remainingRetries, undefined));
+ }
+
+ private async makeRequest(
+ optionsInput: PromiseOrValue,
+ retriesRemaining: number | null,
+ retryOfRequestLogID: string | undefined,
+ ): Promise {
+ const options = await optionsInput;
+ const maxRetries = options.maxRetries ?? this.maxRetries;
+ if (retriesRemaining == null) {
+ retriesRemaining = maxRetries;
+ }
+
+ await this.prepareOptions(options);
+
+ const { req, url, timeout } = await this.buildRequest(options, {
+ retryCount: maxRetries - retriesRemaining,
+ });
+
+ await this.prepareRequest(req, { url, options });
+
+ /** Not an API request ID, just for correlating local log entries. */
+ const requestLogID = 'log_' + ((Math.random() * (1 << 24)) | 0).toString(16).padStart(6, '0');
+ const retryLogStr = retryOfRequestLogID === undefined ? '' : `, retryOf: ${retryOfRequestLogID}`;
+ const startTime = Date.now();
+
+ loggerFor(this).debug(
+ `[${requestLogID}] sending request`,
+ formatRequestDetails({
+ retryOfRequestLogID,
+ method: options.method,
+ url,
+ options,
+ headers: req.headers,
+ }),
+ );
+
+ if (options.signal?.aborted) {
+ throw new Errors.APIUserAbortError();
+ }
+
+ const controller = new AbortController();
+ const response = await this.fetchWithTimeout(url, req, timeout, controller).catch(castToError);
+ const headersTime = Date.now();
+
+ if (response instanceof globalThis.Error) {
+ const retryMessage = `retrying, ${retriesRemaining} attempts remaining`;
+ if (options.signal?.aborted) {
+ throw new Errors.APIUserAbortError();
+ }
+ // detect native connection timeout errors
+ // deno throws "TypeError: error sending request for url (https://example/): client error (Connect): tcp connect error: Operation timed out (os error 60): Operation timed out (os error 60)"
+ // undici throws "TypeError: fetch failed" with cause "ConnectTimeoutError: Connect Timeout Error (attempted address: example:443, timeout: 1ms)"
+ // others do not provide enough information to distinguish timeouts from other connection errors
+ const isTimeout =
+ isAbortError(response) ||
+ /timed? ?out/i.test(String(response) + ('cause' in response ? String(response.cause) : ''));
+ if (retriesRemaining) {
+ loggerFor(this).info(
+ `[${requestLogID}] connection ${isTimeout ? 'timed out' : 'failed'} - ${retryMessage}`,
+ );
+ loggerFor(this).debug(
+ `[${requestLogID}] connection ${isTimeout ? 'timed out' : 'failed'} (${retryMessage})`,
+ formatRequestDetails({
+ retryOfRequestLogID,
+ url,
+ durationMs: headersTime - startTime,
+ message: response.message,
+ }),
+ );
+ return this.retryRequest(options, retriesRemaining, retryOfRequestLogID ?? requestLogID);
+ }
+ loggerFor(this).info(
+ `[${requestLogID}] connection ${isTimeout ? 'timed out' : 'failed'} - error; no more retries left`,
+ );
+ loggerFor(this).debug(
+ `[${requestLogID}] connection ${isTimeout ? 'timed out' : 'failed'} (error; no more retries left)`,
+ formatRequestDetails({
+ retryOfRequestLogID,
+ url,
+ durationMs: headersTime - startTime,
+ message: response.message,
+ }),
+ );
+ if (isTimeout) {
+ throw new Errors.APIConnectionTimeoutError();
+ }
+ throw new Errors.APIConnectionError({ cause: response });
+ }
+
+ const responseInfo = `[${requestLogID}${retryLogStr}] ${req.method} ${url} ${
+ response.ok ? 'succeeded' : 'failed'
+ } with status ${response.status} in ${headersTime - startTime}ms`;
+
+ if (!response.ok) {
+ const shouldRetry = await this.shouldRetry(response);
+ if (retriesRemaining && shouldRetry) {
+ const retryMessage = `retrying, ${retriesRemaining} attempts remaining`;
+
+ // We don't need the body of this response.
+ await Shims.CancelReadableStream(response.body);
+ loggerFor(this).info(`${responseInfo} - ${retryMessage}`);
+ loggerFor(this).debug(
+ `[${requestLogID}] response error (${retryMessage})`,
+ formatRequestDetails({
+ retryOfRequestLogID,
+ url: response.url,
+ status: response.status,
+ headers: response.headers,
+ durationMs: headersTime - startTime,
+ }),
+ );
+ return this.retryRequest(
+ options,
+ retriesRemaining,
+ retryOfRequestLogID ?? requestLogID,
+ response.headers,
+ );
+ }
+
+ const retryMessage = shouldRetry ? `error; no more retries left` : `error; not retryable`;
+
+ loggerFor(this).info(`${responseInfo} - ${retryMessage}`);
+
+ const errText = await response.text().catch((err: any) => castToError(err).message);
+ const errJSON = safeJSON(errText) as any;
+ const errMessage = errJSON ? undefined : errText;
+
+ loggerFor(this).debug(
+ `[${requestLogID}] response error (${retryMessage})`,
+ formatRequestDetails({
+ retryOfRequestLogID,
+ url: response.url,
+ status: response.status,
+ headers: response.headers,
+ message: errMessage,
+ durationMs: Date.now() - startTime,
+ }),
+ );
+
+ const err = this.makeStatusError(response.status, errJSON, errMessage, response.headers);
+ throw err;
+ }
+
+ loggerFor(this).info(responseInfo);
+ loggerFor(this).debug(
+ `[${requestLogID}] response start`,
+ formatRequestDetails({
+ retryOfRequestLogID,
+ url: response.url,
+ status: response.status,
+ headers: response.headers,
+ durationMs: headersTime - startTime,
+ }),
+ );
+
+ return { response, options, controller, requestLogID, retryOfRequestLogID, startTime };
+ }
+
+ async fetchWithTimeout(url: RequestInfo, init: RequestInit | undefined, ms: number, controller: AbortController): Promise {
+ const { signal, method, ...options } = init || {};
+ const abort = this._makeAbort(controller);
+ if (signal) signal.addEventListener('abort', abort, { once: true });
+
+ const timeout = setTimeout(abort, ms);
+
+ const isReadableBody =
+ ((globalThis as any).ReadableStream && options.body instanceof (globalThis as any).ReadableStream) ||
+ (typeof options.body === 'object' && options.body !== null && Symbol.asyncIterator in options.body);
+
+ const fetchOptions: RequestInit = {
+ signal: controller.signal as any,
+ ...(isReadableBody ? { duplex: 'half' } : {}),
+ method: 'GET',
+ ...options,
+ };
+ if (method) {
+ // Custom methods like 'patch' need to be uppercased
+ // See https://github.com/nodejs/undici/issues/2294
+ fetchOptions.method = method.toUpperCase();
+ }
+
+ try {
+ // use undefined this binding; fetch errors if bound to something else in browser/cloudflare
+ return await this.fetch.call(undefined, url, fetchOptions);
+ } finally {
+ clearTimeout(timeout);
+ }
+ }
+
+ private async shouldRetry(response: Response): Promise {
+ // Note this is not a standard header.
+ const shouldRetryHeader = response.headers.get('x-should-retry');
+
+ // If the server explicitly says whether or not to retry, obey.
+ if (shouldRetryHeader === 'true') return true;
+ if (shouldRetryHeader === 'false') return false;
+
+ // Retry on request timeouts.
+ if (response.status === 408) return true;
+
+ // Retry on lock timeouts.
+ if (response.status === 409) return true;
+
+ // Retry on rate limits.
+ if (response.status === 429) return true;
+
+ // Retry internal errors.
+ if (response.status >= 500) return true;
+
+ return false;
+ }
+
+ private async retryRequest(
+ options: FinalRequestOptions,
+ retriesRemaining: number,
+ requestLogID: string,
+ responseHeaders?: Headers | undefined,
+ ): Promise {
+ let timeoutMillis: number | undefined;
+
+ // Note the `retry-after-ms` header may not be standard, but is a good idea and we'd like proactive support for it.
+ const retryAfterMillisHeader = responseHeaders?.get('retry-after-ms');
+ if (retryAfterMillisHeader) {
+ const timeoutMs = parseFloat(retryAfterMillisHeader);
+ if (!Number.isNaN(timeoutMs)) {
+ timeoutMillis = timeoutMs;
+ }
+ }
+
+ // About the Retry-After header: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After
+ const retryAfterHeader = responseHeaders?.get('retry-after');
+ if (retryAfterHeader && !timeoutMillis) {
+ const timeoutSeconds = parseFloat(retryAfterHeader);
+ if (!Number.isNaN(timeoutSeconds)) {
+ timeoutMillis = timeoutSeconds * 1000;
+ } else {
+ timeoutMillis = Date.parse(retryAfterHeader) - Date.now();
+ }
+ }
+
+ // If the API asks us to wait a certain amount of time, just do what it says,
+ // but cap server-provided delays at 60s so an oversized or malformed Retry-After
+ // (e.g. `retry-after-ms: 999999999`, a past HTTP-date, or a value that Date.parse
+ // failed on) cannot block retries for an unbounded amount of time. Otherwise fall
+ // back to the default exponential-backoff calculation.
+ const maxRetryAfterMillis = 60 * 1000;
+ if (
+ timeoutMillis === undefined ||
+ !Number.isFinite(timeoutMillis) ||
+ timeoutMillis <= 0 ||
+ timeoutMillis > maxRetryAfterMillis
+ ) {
+ const maxRetries = options.maxRetries ?? this.maxRetries;
+ timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries);
+ }
+ await sleep(timeoutMillis);
+
+ return this.makeRequest(options, retriesRemaining - 1, requestLogID);
+ }
+
+ private calculateDefaultRetryTimeoutMillis(retriesRemaining: number, maxRetries: number): number {
+ const initialRetryDelay = 0.5;
+ const maxRetryDelay = 8.0;
+
+ const numRetries = maxRetries - retriesRemaining;
+
+ // Apply exponential backoff, but not more than the max.
+ const sleepSeconds = Math.min(initialRetryDelay * Math.pow(2, numRetries), maxRetryDelay);
+
+ // Apply some jitter, take up to at most 25 percent of the retry time.
+ const jitter = 1 - Math.random() * 0.25;
+
+ return sleepSeconds * jitter * 1000;
+ }
+
+ async buildRequest(
+ inputOptions: FinalRequestOptions,
+ { retryCount = 0 }: { retryCount?: number } = {},
+ ): Promise<{ req: FinalizedRequestInit; url: string; timeout: number }> {
+ const options = { ...inputOptions };
+ const { method, path, query, defaultBaseURL } = options;
+
+ const url = this.buildURL(path!, query as Record, defaultBaseURL);
+ if ('timeout' in options) validatePositiveInteger('timeout', options.timeout);
+ options.timeout = options.timeout ?? this.timeout;
+ const { bodyHeaders, body } = this.buildBody({ options });
+ const reqHeaders = await this.buildHeaders({ options, method, bodyHeaders, retryCount, url });
+
+ const req: FinalizedRequestInit = {
+ method,
+ headers: reqHeaders,
+ ...(options.signal && { signal: options.signal }),
+ ...((globalThis as any).ReadableStream &&
+ body instanceof (globalThis as any).ReadableStream && { duplex: 'half' }),
+ // `buildBody` already collapses no-body into `undefined`; here we only need to drop that
+ // sentinel. A truthiness spread would also strip an intentional empty-string body.
+ ...(body !== undefined && { body }),
+ ...((this.fetchOptions as any) ?? {}),
+ ...((options.fetchOptions as any) ?? {}),
+ };
+ return { req, url, timeout: options.timeout };
+ }
+
+ private async buildHeaders({
+ options,
+ method,
+ bodyHeaders,
+ retryCount,
+ url,
+ }: {
+ options: FinalRequestOptions;
+ method: HTTPMethod;
+ bodyHeaders: HeadersLike;
+ retryCount: number;
+ url: string;
+ }): Promise {
+ let idempotencyHeaders: HeadersLike = {};
+ if (this.idempotencyHeader && method !== 'get') {
+ if (!options.idempotencyKey) options.idempotencyKey = this.defaultIdempotencyKey();
+ idempotencyHeaders[this.idempotencyHeader] = options.idempotencyKey;
+ }
+
+ const headers = buildHeaders([
+ idempotencyHeaders,
+ {
+ Accept: 'application/json',
+ 'User-Agent': this.getUserAgent(),
+ 'X-Scalar-Retry-Count': String(retryCount),
+ ...(options.timeout ? { 'X-Scalar-Timeout': String(Math.trunc(options.timeout / 1000)) } : {}),
+ ...getPlatformHeaders(),
+ },
+ await this.authHeaders(options),
+ this._options.defaultHeaders,
+ bodyHeaders,
+ options.headers,
+ ]);
+ appendAuthCookies(headers.values, await this.authCookiesAsync());
+
+ this.validateAuth(url, headers.values, options);
+
+ return headers.values;
+ }
+
+ private _makeAbort(controller: AbortController) {
+ // note: we can't just inline this method inside `fetchWithTimeout()` because then the closure
+ // would capture all request options, and cause a memory leak.
+ return () => controller.abort();
+ }
+
+ private buildBody({ options: { body, headers: rawHeaders } }: { options: FinalRequestOptions }): {
+ bodyHeaders: HeadersLike;
+ body: BodyInit | undefined;
+ } {
+ // Skip only `null`/`undefined` so an intentional empty-string (or 0/false) payload still
+ // reaches the encoder. A plain `!body` check would silently drop those falsy-but-valid bodies,
+ // and `null` must be excluded here too because the iterator check below uses `in`, which
+ // throws on null.
+ if (body == null) {
+ return { bodyHeaders: undefined, body: undefined };
+ }
+ const headers = buildHeaders([rawHeaders]);
+ if (
+ // Pass raw type verbatim
+ ArrayBuffer.isView(body) ||
+ body instanceof ArrayBuffer ||
+ body instanceof DataView ||
+ // Always pass strings through verbatim. The previous guard required a caller-set
+ // `content-type` and otherwise fell through to `FallbackEncoder`, which JSON.stringifies
+ // the value and labels it `application/json` — silently quoting plain-text payloads and
+ // mislabeling them as JSON. fetch defaults a string body to `text/plain;charset=UTF-8`
+ // when no `content-type` is set, which is a safer default than misclaiming JSON.
+ typeof body === 'string' ||
+ // `Blob` is superset of `File`
+ ((globalThis as any).Blob && body instanceof (globalThis as any).Blob) ||
+ // `FormData` -> `multipart/form-data`
+ body instanceof FormData ||
+ // `URLSearchParams` -> `application/x-www-form-urlencoded`
+ body instanceof URLSearchParams ||
+ // Send chunked stream (each chunk has own `length`)
+ ((globalThis as any).ReadableStream && body instanceof (globalThis as any).ReadableStream)
+ ) {
+ return { bodyHeaders: undefined, body: body as BodyInit };
+ } else if (
+ typeof body === 'object' &&
+ (Symbol.asyncIterator in body ||
+ (Symbol.iterator in body && 'next' in body && typeof body.next === 'function'))
+ ) {
+ return { bodyHeaders: undefined, body: Shims.ReadableStreamFrom(body as AsyncIterable) };
+ } else if (
+ typeof body === 'object' &&
+ headers.values.get('content-type') === 'application/x-www-form-urlencoded'
+ ) {
+ return {
+ bodyHeaders: { 'content-type': 'application/x-www-form-urlencoded' },
+ body: this.stringifyQuery(body),
+ };
+ } else {
+ return this.#encoder({ body, headers });
+ }
+ }
+
+ private validateAuth(url: string, headers: Headers, options: FinalRequestOptions): void {
+ if (headers.has("Authorization")) return;
+ if (headerExplicitlyOmitted(options.headers, "Authorization")) return;
+ throw new Errors.AuthenticationError(401, {}, "Could not resolve authentication method. Expected Authorization to be set.", headers);
+ }
+
+ authHeadersSync(): Record {
+ const headers: Record = {};
+ const bearerAuth = this.resolveAuthOptionSync("bearerAuth", this.bearerAuth);
+ if (bearerAuth) headers['Authorization'] = `Bearer ${bearerAuth}`;
+ return headers;
+ }
+
+ webSocketAuthHeaders(): Record {
+ const bearerAuth = this.resolveAuthOptionSync("bearerAuth", this.bearerAuth);
+ if (bearerAuth) return { Authorization: `Bearer ${bearerAuth}` };
+ return {};
+ }
+
+ protected async authHeaders(options: FinalRequestOptions): Promise {
+ return buildHeaders([await this.authHeadersAsync()]);
+ }
+
+ private async authQueryAsync(): Promise> {
+ const query: Record = {};
+ return query;
+ }
+
+ private async authCookiesAsync(): Promise> {
+ const cookies: Record = {};
+ return cookies;
+ }
+
+ private async authHeadersAsync(): Promise> {
+ const headers: Record = {};
+ const bearerAuth = await this.resolveAuthOption("bearerAuth", this.bearerAuth);
+ if (bearerAuth) headers['Authorization'] = `Bearer ${bearerAuth}`;
+ return headers;
+ }
+
+ private async resolveAuthOption(optionName: string, value: string | AuthTokenProvider | null | undefined): Promise {
+ if (value == null) return undefined;
+ const token = typeof value === "function" ? await value() : value;
+ if (!token) throw new Errors.ScalarAPIError(`Expected '${optionName}' to resolve to a non-empty string.`);
+ return token;
+ }
+
+ private resolveAuthOptionSync(optionName: string, value: string | AuthTokenProvider | null | undefined): string | undefined {
+ if (value == null) return undefined;
+ const token = typeof value === "function" ? value() : value;
+ if (typeof token !== "string" || !token) throw new Errors.ScalarAPIError(`Expected '${optionName}' to resolve to a non-empty string.`);
+ return token;
+ }
+
+ static ScalarAPI = this;
+ static DEFAULT_TIMEOUT = 60000; // 1 minute
+
+ static ScalarAPIError = Errors.ScalarAPIError;
+ static APIError = Errors.APIError;
+ static APIConnectionError = Errors.APIConnectionError;
+ static APIConnectionTimeoutError = Errors.APIConnectionTimeoutError;
+ static APIUserAbortError = Errors.APIUserAbortError;
+ static NotFoundError = Errors.NotFoundError;
+ static ConflictError = Errors.ConflictError;
+ static RateLimitError = Errors.RateLimitError;
+ static BadRequestError = Errors.BadRequestError;
+ static AuthenticationError = Errors.AuthenticationError;
+ static InternalServerError = Errors.InternalServerError;
+ static PermissionDeniedError = Errors.PermissionDeniedError;
+ static UnprocessableEntityError = Errors.UnprocessableEntityError;
+
+ static toFile = toFile;
+
+ registry: Registry = new Registry(this);
+ schemas: Schemas = new Schemas(this);
+ loginPortals: LoginPortals = new LoginPortals(this);
+ rules: Rules = new Rules(this);
+ themes: Themes = new Themes(this);
+ teams: Teams = new Teams(this);
+ scalarDocs: ScalarDocs = new ScalarDocs(this);
+ namespaces: Namespaces = new Namespaces(this);
+ authentication: Authentication = new Authentication(this);
+}
+
+ScalarAPI.Registry = Registry;
+ScalarAPI.Schemas = Schemas;
+ScalarAPI.LoginPortals = LoginPortals;
+ScalarAPI.Rules = Rules;
+ScalarAPI.Themes = Themes;
+ScalarAPI.Teams = Teams;
+ScalarAPI.ScalarDocs = ScalarDocs;
+ScalarAPI.Namespaces = Namespaces;
+ScalarAPI.Authentication = Authentication;
+
+export declare namespace ScalarAPI {
+ export type RequestOptions = Opts.RequestOptions;
+ export {
+ Registry as Registry,
+ type Version as Version,
+ type AccessGroup as AccessGroup,
+ type RegistryListAllAPIDocumentsResponse as RegistryListAllAPIDocumentsResponse,
+ type RegistryListAPIDocumentsResponse as RegistryListAPIDocumentsResponse,
+ type RegistryCreateAPIDocumentResponse as RegistryCreateAPIDocumentResponse,
+ type RegistryUpdateAPIDocumentVersionResponse as RegistryUpdateAPIDocumentVersionResponse,
+ type ManagedDocVersion as ManagedDocVersion,
+ type RegistryCreateAPIDocumentParams as RegistryCreateAPIDocumentParams,
+ type RegistryUpdateAPIDocumentParams as RegistryUpdateAPIDocumentParams,
+ type RegistryDeleteAPIDocumentParams as RegistryDeleteAPIDocumentParams,
+ type RegistryRetrieveAPIDocumentVersionParams as RegistryRetrieveAPIDocumentVersionParams,
+ type RegistryUpdateAPIDocumentVersionParams as RegistryUpdateAPIDocumentVersionParams,
+ type RegistryDeleteAPIDocumentVersionParams as RegistryDeleteAPIDocumentVersionParams,
+ type RegistryListAPIDocumentVersionMetadataParams as RegistryListAPIDocumentVersionMetadataParams,
+ type RegistryCreateAPIDocumentVersionParams as RegistryCreateAPIDocumentVersionParams,
+ type RegistryCreateAPIDocumentAccessGroupParams as RegistryCreateAPIDocumentAccessGroupParams,
+ type RegistryDeleteAPIDocumentAccessGroupParams as RegistryDeleteAPIDocumentAccessGroupParams,
+ };
+
+ export {
+ Schemas as Schemas,
+ type SchemaListResponse as SchemaListResponse,
+ type UID as UID,
+ type SchemaCreateParams as SchemaCreateParams,
+ type SchemaUpdateParams as SchemaUpdateParams,
+ type SchemaDeleteParams as SchemaDeleteParams,
+ };
+
+ export {
+ LoginPortals as LoginPortals,
+ type LoginPortalEmail as LoginPortalEmail,
+ type LoginPortalPage as LoginPortalPage,
+ type LoginPortalRetrieveResponse as LoginPortalRetrieveResponse,
+ type LoginPortalListResponse as LoginPortalListResponse,
+ type LoginPortalUpdateParams as LoginPortalUpdateParams,
+ type LoginPortalCreateParams as LoginPortalCreateParams,
+ };
+
+ export {
+ Rules as Rules,
+ type RuleListRulesetsResponse as RuleListRulesetsResponse,
+ type RuleCreateRulesetParams as RuleCreateRulesetParams,
+ type RuleUpdateRulesetParams as RuleUpdateRulesetParams,
+ type RuleDeleteRulesetParams as RuleDeleteRulesetParams,
+ type RuleRetrieveRulesetDocumentParams as RuleRetrieveRulesetDocumentParams,
+ type RuleCreateRulesetAccessGroupParams as RuleCreateRulesetAccessGroupParams,
+ type RuleDeleteRulesetAccessGroupParams as RuleDeleteRulesetAccessGroupParams,
+ };
+
+ export {
+ Themes as Themes,
+ type ThemeListResponse as ThemeListResponse,
+ type ThemeCreateParams as ThemeCreateParams,
+ type ThemeUpdateParams as ThemeUpdateParams,
+ type ThemeReplaceDocumentParams as ThemeReplaceDocumentParams,
+ };
+
+ export {
+ Teams as Teams,
+ type TeamListResponse as TeamListResponse,
+ };
+
+ export {
+ ScalarDocs as ScalarDocs,
+ type Slug as Slug,
+ type ScalarDocListGuidesResponse as ScalarDocListGuidesResponse,
+ type ScalarDocCreateGuideResponse as ScalarDocCreateGuideResponse,
+ type ScalarDocPublishGuideResponse as ScalarDocPublishGuideResponse,
+ type ScalarDocCreateGuideParams as ScalarDocCreateGuideParams,
+ };
+
+ export {
+ Namespaces as Namespaces,
+ type NamespaceListResponse as NamespaceListResponse,
+ };
+
+ export {
+ Authentication as Authentication,
+ type AuthenticationExchangePersonalTokenResponse as AuthenticationExchangePersonalTokenResponse,
+ type User as User,
+ type AuthenticationExchangePersonalTokenParams as AuthenticationExchangePersonalTokenParams,
+ };
+}
+
+
+const headerExplicitlyOmitted = (source: HeadersLike | undefined, name: string): boolean => {
+ if (!source || Array.isArray(source) || source instanceof Headers) return false;
+ const target = name.toLowerCase();
+ return Object.entries(source).some(([key, value]) => key.toLowerCase() === target && value === null);
+};
+
+const appendAuthCookies = (headers: Headers, cookies: Record): void => {
+ for (const [name, value] of Object.entries(cookies)) {
+ if (cookieHeaderHas(headers.get("Cookie"), name)) continue;
+ const cookie = encodeURIComponent(name) + "=" + encodeURIComponent(value);
+ const existing = headers.get("Cookie");
+ headers.set("Cookie", existing ? existing + "; " + cookie : cookie);
+ }
+};
+
+const cookieHeaderHas = (value: string | null, name: string): boolean => {
+ if (!value) return false;
+ const target = encodeURIComponent(name) + "=";
+ return value.split(";").some((cookie) => cookie.trim().startsWith(target));
+};
+
diff --git a/src/core.ts b/src/core.ts
deleted file mode 100644
index c60d397..0000000
--- a/src/core.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ClientSDK } from "./lib/sdks.js";
-
-/**
- * A minimal client to use when calling standalone SDK functions. Typically, an
- * instance of this class would be instantiated once at the start of an
- * application and passed around through some dependency injection mechanism to
- * parts of an application that need to make SDK calls.
- */
-export class ScalarCore extends ClientSDK {}
diff --git a/src/core/error.ts b/src/core/error.ts
new file mode 100644
index 0000000..1051616
--- /dev/null
+++ b/src/core/error.ts
@@ -0,0 +1,130 @@
+// File generated from our OpenAPI spec by Scalar. See README.md for details.
+
+import { castToError } from '../internal/errors';
+
+export class ScalarAPIError extends Error {}
+
+export class APIError<
+ TStatus extends number | undefined = number | undefined,
+ THeaders extends Headers | undefined = Headers | undefined,
+ TError extends Object | undefined = Object | undefined,
+> extends ScalarAPIError {
+ /** HTTP status for the response that caused the error */
+ readonly status: TStatus;
+ /** HTTP headers for the response that caused the error */
+ readonly headers: THeaders;
+ /** JSON body of the response that caused the error */
+ readonly error: TError;
+
+ constructor(status: TStatus, error: TError, message: string | undefined, headers: THeaders) {
+ super(`${APIError.makeMessage(status, error, message)}`);
+ this.status = status;
+ this.headers = headers;
+ this.error = error;
+ }
+
+ private static makeMessage(status: number | undefined, error: any, message: string | undefined) {
+ const msg =
+ error?.message ?
+ typeof error.message === 'string' ?
+ error.message
+ : JSON.stringify(error.message)
+ : error ? JSON.stringify(error)
+ : message;
+
+ if (status && msg) {
+ return `${status} ${msg}`;
+ }
+ if (status) {
+ return `${status} status code (no body)`;
+ }
+ if (msg) {
+ return msg;
+ }
+ return '(no status code or body)';
+ }
+
+ static generate(
+ status: number | undefined,
+ errorResponse: Object | undefined,
+ message: string | undefined,
+ headers: Headers | undefined,
+ ): APIError {
+ if (!status || !headers) {
+ return new APIConnectionError({ message, cause: castToError(errorResponse) });
+ }
+
+ const error = errorResponse as Record;
+
+ if (status === 400) {
+ return new BadRequestError(status, error, message, headers);
+ }
+
+ if (status === 401) {
+ return new AuthenticationError(status, error, message, headers);
+ }
+
+ if (status === 403) {
+ return new PermissionDeniedError(status, error, message, headers);
+ }
+
+ if (status === 404) {
+ return new NotFoundError(status, error, message, headers);
+ }
+
+ if (status === 409) {
+ return new ConflictError(status, error, message, headers);
+ }
+
+ if (status === 422) {
+ return new UnprocessableEntityError(status, error, message, headers);
+ }
+
+ if (status === 429) {
+ return new RateLimitError(status, error, message, headers);
+ }
+
+ if (status >= 500) {
+ return new InternalServerError(status, error, message, headers);
+ }
+
+ return new APIError(status, error, message, headers);
+ }
+}
+
+export class APIUserAbortError extends APIError {
+ constructor({ message }: { message?: string } = {}) {
+ super(undefined, undefined, message || 'Request was aborted.', undefined);
+ }
+}
+
+export class APIConnectionError extends APIError {
+ constructor({ message, cause }: { message?: string | undefined; cause?: Error | undefined }) {
+ super(undefined, undefined, message || 'Connection error.', undefined);
+ // in some environments the 'cause' property is already declared
+ // @ts-ignore
+ if (cause) this.cause = cause;
+ }
+}
+
+export class APIConnectionTimeoutError extends APIConnectionError {
+ constructor({ message }: { message?: string } = {}) {
+ super({ message: message ?? 'Request timed out.' });
+ }
+}
+
+export class BadRequestError extends APIError<400, Headers> {}
+
+export class AuthenticationError extends APIError<401, Headers> {}
+
+export class PermissionDeniedError extends APIError<403, Headers> {}
+
+export class NotFoundError extends APIError<404, Headers> {}
+
+export class ConflictError extends APIError<409, Headers> {}
+
+export class UnprocessableEntityError extends APIError<422, Headers> {}
+
+export class RateLimitError extends APIError<429, Headers> {}
+
+export class InternalServerError extends APIError {}
diff --git a/src/core/uploads.ts b/src/core/uploads.ts
new file mode 100644
index 0000000..536cfe6
--- /dev/null
+++ b/src/core/uploads.ts
@@ -0,0 +1,4 @@
+// File generated from our OpenAPI spec by Scalar. See README.md for details.
+
+export { type Uploadable } from '../internal/uploads';
+export { toFile, type ToFileInput } from '../internal/to-file';
diff --git a/src/error.ts b/src/error.ts
new file mode 100644
index 0000000..834f539
--- /dev/null
+++ b/src/error.ts
@@ -0,0 +1,4 @@
+// File generated from our OpenAPI spec by Scalar. See README.md for details.
+
+/** @deprecated Import from ./core/error instead */
+export * from './core/error';
diff --git a/src/funcs/authenticationExchangePersonalToken.ts b/src/funcs/authenticationExchangePersonalToken.ts
deleted file mode 100644
index ffeae34..0000000
--- a/src/funcs/authenticationExchangePersonalToken.ts
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import { encodeJSON } from "../lib/encodings.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 { 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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * Exchange token
- *
- * @remarks
- * Exchange an API key for an access token.
- */
-export function authenticationExchangePersonalToken(
- client: ScalarCore,
- request: operations.ExchangePersonalTokenRequestBody,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.ExchangePersonalTokenResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- request,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- request: operations.ExchangePersonalTokenRequestBody,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.ExchangePersonalTokenResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const parsed = safeParse(
- request,
- (value) =>
- operations.ExchangePersonalTokenRequestBody$outboundSchema.parse(value),
- "Input validation failed",
- );
- if (!parsed.ok) {
- return [parsed, { status: "invalid" }];
- }
- const payload = parsed.value;
- const body = encodeJSON("body", payload, { explode: true });
-
- const path = pathToFunc("/v1/auth/exchange")();
-
- const headers = new Headers(compactMap({
- "Content-Type": "application/json",
- Accept: "application/json",
- }));
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "exchangePersonalToken",
- oAuth2Scopes: [],
-
- resolvedSecurity: null,
-
- securitySource: null,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- const requestRes = client._createRequest(context, {
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.ExchangePersonalTokenResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.json(200, operations.ExchangePersonalTokenResponse$inboundSchema, {
- key: "object",
- }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/authenticationGetCurrentUser.ts b/src/funcs/authenticationGetCurrentUser.ts
deleted file mode 100644
index f5b773e..0000000
--- a/src/funcs/authenticationGetCurrentUser.ts
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import * as M from "../lib/matchers.js";
-import { compactMap } from "../lib/primitives.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * Get current user
- *
- * @remarks
- * Get the authenticated user, including their available teams and theme.
- */
-export function authenticationGetCurrentUser(
- client: ScalarCore,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.GetCurrentUserResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.GetCurrentUserResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const path = pathToFunc("/v1/auth/me")();
-
- const headers = new Headers(compactMap({
- Accept: "application/json",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "getCurrentUser",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- const requestRes = client._createRequest(context, {
- security: requestSecurity,
- method: "GET",
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.GetCurrentUserResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.json(200, operations.GetCurrentUserResponse$inboundSchema, {
- key: "user",
- }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/loginPortalsCreateLoginPortal.ts b/src/funcs/loginPortalsCreateLoginPortal.ts
deleted file mode 100644
index ea3c504..0000000
--- a/src/funcs/loginPortalsCreateLoginPortal.ts
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import { encodeJSON } from "../lib/encodings.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * Create a portal
- *
- * @remarks
- * Create a login portal for the current team.
- */
-export function loginPortalsCreateLoginPortal(
- client: ScalarCore,
- request: operations.CreateLoginPortalRequestBody,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.CreateLoginPortalResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- request,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- request: operations.CreateLoginPortalRequestBody,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.CreateLoginPortalResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const parsed = safeParse(
- request,
- (value) =>
- operations.CreateLoginPortalRequestBody$outboundSchema.parse(value),
- "Input validation failed",
- );
- if (!parsed.ok) {
- return [parsed, { status: "invalid" }];
- }
- const payload = parsed.value;
- const body = encodeJSON("body", payload, { explode: true });
-
- const path = pathToFunc("/v1/login-portals")();
-
- const headers = new Headers(compactMap({
- "Content-Type": "application/json",
- Accept: "application/json",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "createLoginPortal",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.CreateLoginPortalResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.json(200, operations.CreateLoginPortalResponse$inboundSchema, {
- key: "uid",
- }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/loginPortalsDeleteLoginPortal.ts b/src/funcs/loginPortalsDeleteLoginPortal.ts
deleted file mode 100644
index f7e4afb..0000000
--- a/src/funcs/loginPortalsDeleteLoginPortal.ts
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import { encodeSimple } from "../lib/encodings.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * Delete a login portal
- *
- * @remarks
- * Delete a login portal.
- */
-export function loginPortalsDeleteLoginPortal(
- client: ScalarCore,
- request: operations.DeleteLoginPortalRequest,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.DeleteLoginPortalResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- request,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- request: operations.DeleteLoginPortalRequest,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.DeleteLoginPortalResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const parsed = safeParse(
- request,
- (value) => operations.DeleteLoginPortalRequest$outboundSchema.parse(value),
- "Input validation failed",
- );
- if (!parsed.ok) {
- return [parsed, { status: "invalid" }];
- }
- const payload = parsed.value;
- const body = null;
-
- const pathParams = {
- slug: encodeSimple("slug", payload.slug, {
- explode: false,
- charEncoding: "percent",
- }),
- };
-
- const path = pathToFunc("/v1/login-portals/{slug}")(pathParams);
-
- const headers = new Headers(compactMap({
- Accept: "application/json",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "deleteLoginPortal",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- const requestRes = client._createRequest(context, {
- security: requestSecurity,
- method: "DELETE",
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.DeleteLoginPortalResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.json(200, operations.DeleteLoginPortalResponse$inboundSchema, {
- key: "any",
- }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/loginPortalsGetLoginPortal.ts b/src/funcs/loginPortalsGetLoginPortal.ts
deleted file mode 100644
index 40329cc..0000000
--- a/src/funcs/loginPortalsGetLoginPortal.ts
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import { encodeSimple } from "../lib/encodings.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * Get a login portal
- *
- * @remarks
- * Get a login portal by slug.
- */
-export function loginPortalsGetLoginPortal(
- client: ScalarCore,
- request: operations.GetLoginPortalRequest,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.GetLoginPortalResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- request,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- request: operations.GetLoginPortalRequest,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.GetLoginPortalResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const parsed = safeParse(
- request,
- (value) => operations.GetLoginPortalRequest$outboundSchema.parse(value),
- "Input validation failed",
- );
- if (!parsed.ok) {
- return [parsed, { status: "invalid" }];
- }
- const payload = parsed.value;
- const body = null;
-
- const pathParams = {
- slug: encodeSimple("slug", payload.slug, {
- explode: false,
- charEncoding: "percent",
- }),
- };
-
- const path = pathToFunc("/v1/login-portals/{slug}")(pathParams);
-
- const headers = new Headers(compactMap({
- Accept: "application/json",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "getLoginPortal",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.GetLoginPortalResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.json(200, operations.GetLoginPortalResponse$inboundSchema, {
- key: "object",
- }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/loginPortalsListLoginPortals.ts b/src/funcs/loginPortalsListLoginPortals.ts
deleted file mode 100644
index e04eab1..0000000
--- a/src/funcs/loginPortalsListLoginPortals.ts
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import * as M from "../lib/matchers.js";
-import { compactMap } from "../lib/primitives.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * List all portals
- *
- * @remarks
- * List all login portals for the current team.
- */
-export function loginPortalsListLoginPortals(
- client: ScalarCore,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.ListLoginPortalsResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.ListLoginPortalsResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const path = pathToFunc("/v1/login-portals")();
-
- const headers = new Headers(compactMap({
- Accept: "application/json",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "listLoginPortals",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- const requestRes = client._createRequest(context, {
- security: requestSecurity,
- method: "GET",
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.ListLoginPortalsResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.json(200, operations.ListLoginPortalsResponse$inboundSchema, {
- key: "login-portals",
- }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/loginPortalsUpdateLoginPortal.ts b/src/funcs/loginPortalsUpdateLoginPortal.ts
deleted file mode 100644
index 45036ac..0000000
--- a/src/funcs/loginPortalsUpdateLoginPortal.ts
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import { encodeJSON, encodeSimple } from "../lib/encodings.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * Update portal metadata
- *
- * @remarks
- * Update metadata for a login portal.
- */
-export function loginPortalsUpdateLoginPortal(
- client: ScalarCore,
- request: operations.UpdateLoginPortalRequest,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.UpdateLoginPortalResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- request,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- request: operations.UpdateLoginPortalRequest,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.UpdateLoginPortalResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const parsed = safeParse(
- request,
- (value) => operations.UpdateLoginPortalRequest$outboundSchema.parse(value),
- "Input validation failed",
- );
- if (!parsed.ok) {
- return [parsed, { status: "invalid" }];
- }
- const payload = parsed.value;
- const body = encodeJSON("body", payload.RequestBody, { explode: true });
-
- const pathParams = {
- slug: encodeSimple("slug", payload.slug, {
- explode: false,
- charEncoding: "percent",
- }),
- };
-
- const path = pathToFunc("/v1/login-portals/{slug}")(pathParams);
-
- const headers = new Headers(compactMap({
- "Content-Type": "application/json",
- Accept: "application/json",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "updateLoginPortal",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.UpdateLoginPortalResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.json(200, operations.UpdateLoginPortalResponse$inboundSchema, {
- key: "any",
- }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/namespacesListNamespaces.ts b/src/funcs/namespacesListNamespaces.ts
deleted file mode 100644
index 8fd757a..0000000
--- a/src/funcs/namespacesListNamespaces.ts
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import * as M from "../lib/matchers.js";
-import { compactMap } from "../lib/primitives.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * List namespaces
- *
- * @remarks
- * Get all namespaces for the current team
- */
-export function namespacesListNamespaces(
- client: ScalarCore,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.ListNamespacesResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.ListNamespacesResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const path = pathToFunc("/v1/namespaces")();
-
- const headers = new Headers(compactMap({
- Accept: "application/json",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "listNamespaces",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- const requestRes = client._createRequest(context, {
- security: requestSecurity,
- method: "GET",
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.ListNamespacesResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.json(200, operations.ListNamespacesResponse$inboundSchema, {
- key: "strings",
- }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/registryAddApiDocumentAccessGroup.ts b/src/funcs/registryAddApiDocumentAccessGroup.ts
deleted file mode 100644
index d19fa33..0000000
--- a/src/funcs/registryAddApiDocumentAccessGroup.ts
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import { encodeJSON, encodeSimple } from "../lib/encodings.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * Add access group
- *
- * @remarks
- * Add an access group to an API document.
- */
-export function registryAddApiDocumentAccessGroup(
- client: ScalarCore,
- request: operations.AddApiDocumentAccessGroupRequest,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.AddApiDocumentAccessGroupResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- request,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- request: operations.AddApiDocumentAccessGroupRequest,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.AddApiDocumentAccessGroupResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const parsed = safeParse(
- request,
- (value) =>
- operations.AddApiDocumentAccessGroupRequest$outboundSchema.parse(value),
- "Input validation failed",
- );
- if (!parsed.ok) {
- return [parsed, { status: "invalid" }];
- }
- const payload = parsed.value;
- const body = encodeJSON("body", payload["access-group"], { explode: true });
-
- const pathParams = {
- namespace: encodeSimple("namespace", payload.namespace, {
- explode: false,
- charEncoding: "percent",
- }),
- slug: encodeSimple("slug", payload.slug, {
- explode: false,
- charEncoding: "percent",
- }),
- };
-
- const path = pathToFunc("/v1/apis/{namespace}/{slug}/access-group")(
- pathParams,
- );
-
- const headers = new Headers(compactMap({
- "Content-Type": "application/json",
- Accept: "application/json",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "addApiDocumentAccessGroup",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.AddApiDocumentAccessGroupResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.json(200, operations.AddApiDocumentAccessGroupResponse$inboundSchema, {
- key: "any",
- }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/registryCreateApiDocument.ts b/src/funcs/registryCreateApiDocument.ts
deleted file mode 100644
index 6b918bf..0000000
--- a/src/funcs/registryCreateApiDocument.ts
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import { encodeJSON, encodeSimple } from "../lib/encodings.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * Create API Document
- *
- * @remarks
- * Create an API document.
- */
-export function registryCreateApiDocument(
- client: ScalarCore,
- request: operations.CreateApiDocumentRequest,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.CreateApiDocumentResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- request,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- request: operations.CreateApiDocumentRequest,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.CreateApiDocumentResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const parsed = safeParse(
- request,
- (value) => operations.CreateApiDocumentRequest$outboundSchema.parse(value),
- "Input validation failed",
- );
- if (!parsed.ok) {
- return [parsed, { status: "invalid" }];
- }
- const payload = parsed.value;
- const body = encodeJSON("body", payload.RequestBody, { explode: true });
-
- const pathParams = {
- namespace: encodeSimple("namespace", payload.namespace, {
- explode: false,
- charEncoding: "percent",
- }),
- };
-
- const path = pathToFunc("/v1/apis/{namespace}")(pathParams);
-
- const headers = new Headers(compactMap({
- "Content-Type": "application/json",
- Accept: "application/json",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "createApiDocument",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.CreateApiDocumentResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.json(200, operations.CreateApiDocumentResponse$inboundSchema, {
- key: "object",
- }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/registryCreateApiDocumentVersion.ts b/src/funcs/registryCreateApiDocumentVersion.ts
deleted file mode 100644
index 4c76409..0000000
--- a/src/funcs/registryCreateApiDocumentVersion.ts
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import { encodeJSON, encodeSimple } from "../lib/encodings.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * Create API Document version
- *
- * @remarks
- * Create a new API document version.
- */
-export function registryCreateApiDocumentVersion(
- client: ScalarCore,
- request: operations.CreateApiDocumentVersionRequest,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.CreateApiDocumentVersionResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- request,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- request: operations.CreateApiDocumentVersionRequest,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.CreateApiDocumentVersionResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const parsed = safeParse(
- request,
- (value) =>
- operations.CreateApiDocumentVersionRequest$outboundSchema.parse(value),
- "Input validation failed",
- );
- if (!parsed.ok) {
- return [parsed, { status: "invalid" }];
- }
- const payload = parsed.value;
- const body = encodeJSON("body", payload.RequestBody, { explode: true });
-
- const pathParams = {
- namespace: encodeSimple("namespace", payload.namespace, {
- explode: false,
- charEncoding: "percent",
- }),
- slug: encodeSimple("slug", payload.slug, {
- explode: false,
- charEncoding: "percent",
- }),
- };
-
- const path = pathToFunc("/v1/apis/{namespace}/{slug}/version")(pathParams);
-
- const headers = new Headers(compactMap({
- "Content-Type": "application/json",
- Accept: "application/json",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "createApiDocumentVersion",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.CreateApiDocumentVersionResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.json(200, operations.CreateApiDocumentVersionResponse$inboundSchema, {
- key: "managed-doc-version",
- }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/registryDeleteApiDocument.ts b/src/funcs/registryDeleteApiDocument.ts
deleted file mode 100644
index 474fba6..0000000
--- a/src/funcs/registryDeleteApiDocument.ts
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import { encodeSimple } from "../lib/encodings.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * Delete API Document
- *
- * @remarks
- * Delete an API document and all versions.
- */
-export function registryDeleteApiDocument(
- client: ScalarCore,
- request: operations.DeleteApiDocumentRequest,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.DeleteApiDocumentResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- request,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- request: operations.DeleteApiDocumentRequest,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.DeleteApiDocumentResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const parsed = safeParse(
- request,
- (value) => operations.DeleteApiDocumentRequest$outboundSchema.parse(value),
- "Input validation failed",
- );
- if (!parsed.ok) {
- return [parsed, { status: "invalid" }];
- }
- const payload = parsed.value;
- const body = null;
-
- const pathParams = {
- namespace: encodeSimple("namespace", payload.namespace, {
- explode: false,
- charEncoding: "percent",
- }),
- slug: encodeSimple("slug", payload.slug, {
- explode: false,
- charEncoding: "percent",
- }),
- };
-
- const path = pathToFunc("/v1/apis/{namespace}/{slug}")(pathParams);
-
- const headers = new Headers(compactMap({
- Accept: "application/json",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "deleteApiDocument",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- const requestRes = client._createRequest(context, {
- security: requestSecurity,
- method: "DELETE",
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.DeleteApiDocumentResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.json(200, operations.DeleteApiDocumentResponse$inboundSchema, {
- key: "any",
- }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/registryDeleteApiDocumentVersion.ts b/src/funcs/registryDeleteApiDocumentVersion.ts
deleted file mode 100644
index 42c1eae..0000000
--- a/src/funcs/registryDeleteApiDocumentVersion.ts
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import { encodeSimple } from "../lib/encodings.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * Delete API Document version
- *
- * @remarks
- * Delete a specific API document version.
- */
-export function registryDeleteApiDocumentVersion(
- client: ScalarCore,
- request: operations.DeleteApiDocumentVersionRequest,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.DeleteApiDocumentVersionResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- request,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- request: operations.DeleteApiDocumentVersionRequest,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.DeleteApiDocumentVersionResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const parsed = safeParse(
- request,
- (value) =>
- operations.DeleteApiDocumentVersionRequest$outboundSchema.parse(value),
- "Input validation failed",
- );
- if (!parsed.ok) {
- return [parsed, { status: "invalid" }];
- }
- const payload = parsed.value;
- const body = null;
-
- const pathParams = {
- namespace: encodeSimple("namespace", payload.namespace, {
- explode: false,
- charEncoding: "percent",
- }),
- semver: encodeSimple("semver", payload.semver, {
- explode: false,
- charEncoding: "percent",
- }),
- slug: encodeSimple("slug", payload.slug, {
- explode: false,
- charEncoding: "percent",
- }),
- };
-
- const path = pathToFunc("/v1/apis/{namespace}/{slug}/version/{semver}")(
- pathParams,
- );
-
- const headers = new Headers(compactMap({
- Accept: "application/json",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "deleteApiDocumentVersion",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- const requestRes = client._createRequest(context, {
- security: requestSecurity,
- method: "DELETE",
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.DeleteApiDocumentVersionResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.json(200, operations.DeleteApiDocumentVersionResponse$inboundSchema, {
- key: "any",
- }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/registryGetApiDocumentVersion.ts b/src/funcs/registryGetApiDocumentVersion.ts
deleted file mode 100644
index c121cb7..0000000
--- a/src/funcs/registryGetApiDocumentVersion.ts
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import { encodeSimple } from "../lib/encodings.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * Get API Document
- *
- * @remarks
- * Get a specific API document version.
- */
-export function registryGetApiDocumentVersion(
- client: ScalarCore,
- request: operations.GetApiDocumentVersionRequest,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.GetApiDocumentVersionResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- request,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- request: operations.GetApiDocumentVersionRequest,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.GetApiDocumentVersionResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const parsed = safeParse(
- request,
- (value) =>
- operations.GetApiDocumentVersionRequest$outboundSchema.parse(value),
- "Input validation failed",
- );
- if (!parsed.ok) {
- return [parsed, { status: "invalid" }];
- }
- const payload = parsed.value;
- const body = null;
-
- const pathParams = {
- namespace: encodeSimple("namespace", payload.namespace, {
- explode: false,
- charEncoding: "percent",
- }),
- semver: encodeSimple("semver", payload.semver, {
- explode: false,
- charEncoding: "percent",
- }),
- slug: encodeSimple("slug", payload.slug, {
- explode: false,
- charEncoding: "percent",
- }),
- };
-
- const path = pathToFunc("/v1/apis/{namespace}/{slug}/version/{semver}")(
- pathParams,
- );
-
- const headers = new Headers(compactMap({
- Accept: "text/plain",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "getApiDocumentVersion",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.GetApiDocumentVersionResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.text(200, operations.GetApiDocumentVersionResponse$inboundSchema, {
- key: "res",
- }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/registryGetApiDocumentVersionMetadata.ts b/src/funcs/registryGetApiDocumentVersionMetadata.ts
deleted file mode 100644
index 863f3b9..0000000
--- a/src/funcs/registryGetApiDocumentVersionMetadata.ts
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import { encodeSimple } from "../lib/encodings.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * Get API Document version metadata
- *
- * @remarks
- * Get metadata (uid, content shas, version sha, tags) for a specific API document version.
- */
-export function registryGetApiDocumentVersionMetadata(
- client: ScalarCore,
- request: operations.GetApiDocumentVersionMetadataRequest,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.GetApiDocumentVersionMetadataResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- request,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- request: operations.GetApiDocumentVersionMetadataRequest,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.GetApiDocumentVersionMetadataResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const parsed = safeParse(
- request,
- (value) =>
- operations.GetApiDocumentVersionMetadataRequest$outboundSchema.parse(
- value,
- ),
- "Input validation failed",
- );
- if (!parsed.ok) {
- return [parsed, { status: "invalid" }];
- }
- const payload = parsed.value;
- const body = null;
-
- const pathParams = {
- namespace: encodeSimple("namespace", payload.namespace, {
- explode: false,
- charEncoding: "percent",
- }),
- semver: encodeSimple("semver", payload.semver, {
- explode: false,
- charEncoding: "percent",
- }),
- slug: encodeSimple("slug", payload.slug, {
- explode: false,
- charEncoding: "percent",
- }),
- };
-
- const path = pathToFunc(
- "/v1/apis/{namespace}/{slug}/version/{semver}/metadata",
- )(pathParams);
-
- const headers = new Headers(compactMap({
- Accept: "application/json",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "getApiDocumentVersionMetadata",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.GetApiDocumentVersionMetadataResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.json(
- 200,
- operations.GetApiDocumentVersionMetadataResponse$inboundSchema,
- { key: "managed-doc-version" },
- ),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/registryListAllApiDocuments.ts b/src/funcs/registryListAllApiDocuments.ts
deleted file mode 100644
index dad95f5..0000000
--- a/src/funcs/registryListAllApiDocuments.ts
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import * as M from "../lib/matchers.js";
-import { compactMap } from "../lib/primitives.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * List all API Documents
- *
- * @remarks
- * List all API documents across every namespace the caller can access.
- */
-export function registryListAllApiDocuments(
- client: ScalarCore,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.ListAllApiDocumentsResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.ListAllApiDocumentsResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const path = pathToFunc("/v1/apis")();
-
- const headers = new Headers(compactMap({
- Accept: "application/json",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "listAllApiDocuments",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- const requestRes = client._createRequest(context, {
- security: requestSecurity,
- method: "GET",
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.ListAllApiDocumentsResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.json(200, operations.ListAllApiDocumentsResponse$inboundSchema, {
- key: "api-documents",
- }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/registryListApiDocuments.ts b/src/funcs/registryListApiDocuments.ts
deleted file mode 100644
index 8613a1b..0000000
--- a/src/funcs/registryListApiDocuments.ts
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import { encodeSimple } from "../lib/encodings.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * List API Documents in a namespace
- *
- * @remarks
- * List API documents in a namespace.
- */
-export function registryListApiDocuments(
- client: ScalarCore,
- request: operations.ListApiDocumentsRequest,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.ListApiDocumentsResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- request,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- request: operations.ListApiDocumentsRequest,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.ListApiDocumentsResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const parsed = safeParse(
- request,
- (value) => operations.ListApiDocumentsRequest$outboundSchema.parse(value),
- "Input validation failed",
- );
- if (!parsed.ok) {
- return [parsed, { status: "invalid" }];
- }
- const payload = parsed.value;
- const body = null;
-
- const pathParams = {
- namespace: encodeSimple("namespace", payload.namespace, {
- explode: false,
- charEncoding: "percent",
- }),
- };
-
- const path = pathToFunc("/v1/apis/{namespace}")(pathParams);
-
- const headers = new Headers(compactMap({
- Accept: "application/json",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "listApiDocuments",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.ListApiDocumentsResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.json(200, operations.ListApiDocumentsResponse$inboundSchema, {
- key: "api-documents",
- }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/registryRemoveApiDocumentAccessGroup.ts b/src/funcs/registryRemoveApiDocumentAccessGroup.ts
deleted file mode 100644
index 4cb06d5..0000000
--- a/src/funcs/registryRemoveApiDocumentAccessGroup.ts
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import { encodeJSON, encodeSimple } from "../lib/encodings.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * Remove access group
- *
- * @remarks
- * Remove an access group from an API document.
- */
-export function registryRemoveApiDocumentAccessGroup(
- client: ScalarCore,
- request: operations.RemoveApiDocumentAccessGroupRequest,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.RemoveApiDocumentAccessGroupResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- request,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- request: operations.RemoveApiDocumentAccessGroupRequest,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.RemoveApiDocumentAccessGroupResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const parsed = safeParse(
- request,
- (value) =>
- operations.RemoveApiDocumentAccessGroupRequest$outboundSchema.parse(
- value,
- ),
- "Input validation failed",
- );
- if (!parsed.ok) {
- return [parsed, { status: "invalid" }];
- }
- const payload = parsed.value;
- const body = encodeJSON("body", payload["access-group"], { explode: true });
-
- const pathParams = {
- namespace: encodeSimple("namespace", payload.namespace, {
- explode: false,
- charEncoding: "percent",
- }),
- slug: encodeSimple("slug", payload.slug, {
- explode: false,
- charEncoding: "percent",
- }),
- };
-
- const path = pathToFunc("/v1/apis/{namespace}/{slug}/access-group")(
- pathParams,
- );
-
- const headers = new Headers(compactMap({
- "Content-Type": "application/json",
- Accept: "application/json",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "removeApiDocumentAccessGroup",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- const requestRes = client._createRequest(context, {
- security: requestSecurity,
- method: "DELETE",
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.RemoveApiDocumentAccessGroupResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.json(200, operations.RemoveApiDocumentAccessGroupResponse$inboundSchema, {
- key: "any",
- }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/registryUpdateApiDocument.ts b/src/funcs/registryUpdateApiDocument.ts
deleted file mode 100644
index 1b591c8..0000000
--- a/src/funcs/registryUpdateApiDocument.ts
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import { encodeJSON, encodeSimple } from "../lib/encodings.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * Update API Document metadata
- *
- * @remarks
- * Update metadata for an API document.
- */
-export function registryUpdateApiDocument(
- client: ScalarCore,
- request: operations.UpdateApiDocumentRequest,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.UpdateApiDocumentResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- request,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- request: operations.UpdateApiDocumentRequest,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.UpdateApiDocumentResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const parsed = safeParse(
- request,
- (value) => operations.UpdateApiDocumentRequest$outboundSchema.parse(value),
- "Input validation failed",
- );
- if (!parsed.ok) {
- return [parsed, { status: "invalid" }];
- }
- const payload = parsed.value;
- const body = encodeJSON("body", payload.RequestBody, { explode: true });
-
- const pathParams = {
- namespace: encodeSimple("namespace", payload.namespace, {
- explode: false,
- charEncoding: "percent",
- }),
- slug: encodeSimple("slug", payload.slug, {
- explode: false,
- charEncoding: "percent",
- }),
- };
-
- const path = pathToFunc("/v1/apis/{namespace}/{slug}")(pathParams);
-
- const headers = new Headers(compactMap({
- "Content-Type": "application/json",
- Accept: "application/json",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "updateApiDocument",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.UpdateApiDocumentResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.json(200, operations.UpdateApiDocumentResponse$inboundSchema, {
- key: "any",
- }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/registryUpdateApiDocumentVersion.ts b/src/funcs/registryUpdateApiDocumentVersion.ts
deleted file mode 100644
index 58e1c76..0000000
--- a/src/funcs/registryUpdateApiDocumentVersion.ts
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import { encodeJSON, encodeSimple } from "../lib/encodings.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * Update API Document version
- *
- * @remarks
- * Update the registry file content for an API document version.
- */
-export function registryUpdateApiDocumentVersion(
- client: ScalarCore,
- request: operations.UpdateApiDocumentVersionRequest,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.UpdateApiDocumentVersionResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- request,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- request: operations.UpdateApiDocumentVersionRequest,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.UpdateApiDocumentVersionResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const parsed = safeParse(
- request,
- (value) =>
- operations.UpdateApiDocumentVersionRequest$outboundSchema.parse(value),
- "Input validation failed",
- );
- if (!parsed.ok) {
- return [parsed, { status: "invalid" }];
- }
- const payload = parsed.value;
- const body = encodeJSON("body", payload.RequestBody, { explode: true });
-
- const pathParams = {
- namespace: encodeSimple("namespace", payload.namespace, {
- explode: false,
- charEncoding: "percent",
- }),
- semver: encodeSimple("semver", payload.semver, {
- explode: false,
- charEncoding: "percent",
- }),
- slug: encodeSimple("slug", payload.slug, {
- explode: false,
- charEncoding: "percent",
- }),
- };
-
- const path = pathToFunc("/v1/apis/{namespace}/{slug}/version/{semver}")(
- pathParams,
- );
-
- const headers = new Headers(compactMap({
- "Content-Type": "application/json",
- Accept: "application/json",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "updateApiDocumentVersion",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.UpdateApiDocumentVersionResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.json(200, operations.UpdateApiDocumentVersionResponse$inboundSchema, {
- key: "object",
- }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/rulesAddRulesetAccessGroup.ts b/src/funcs/rulesAddRulesetAccessGroup.ts
deleted file mode 100644
index a4c0388..0000000
--- a/src/funcs/rulesAddRulesetAccessGroup.ts
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import { encodeJSON, encodeSimple } from "../lib/encodings.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * Add rule access group
- *
- * @remarks
- * Grant an access group to a rule.
- */
-export function rulesAddRulesetAccessGroup(
- client: ScalarCore,
- request: operations.AddRulesetAccessGroupRequest,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.AddRulesetAccessGroupResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- request,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- request: operations.AddRulesetAccessGroupRequest,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.AddRulesetAccessGroupResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const parsed = safeParse(
- request,
- (value) =>
- operations.AddRulesetAccessGroupRequest$outboundSchema.parse(value),
- "Input validation failed",
- );
- if (!parsed.ok) {
- return [parsed, { status: "invalid" }];
- }
- const payload = parsed.value;
- const body = encodeJSON("body", payload["access-group"], { explode: true });
-
- const pathParams = {
- namespace: encodeSimple("namespace", payload.namespace, {
- explode: false,
- charEncoding: "percent",
- }),
- slug: encodeSimple("slug", payload.slug, {
- explode: false,
- charEncoding: "percent",
- }),
- };
-
- const path = pathToFunc("/v1/rulesets/{namespace}/{slug}/access-group")(
- pathParams,
- );
-
- const headers = new Headers(compactMap({
- "Content-Type": "application/json",
- Accept: "application/json",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "addRulesetAccessGroup",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.AddRulesetAccessGroupResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.json(200, operations.AddRulesetAccessGroupResponse$inboundSchema, {
- key: "any",
- }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/rulesCreateRuleset.ts b/src/funcs/rulesCreateRuleset.ts
deleted file mode 100644
index e066497..0000000
--- a/src/funcs/rulesCreateRuleset.ts
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import { encodeJSON, encodeSimple } from "../lib/encodings.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * Create a rule
- *
- * @remarks
- * Create a rule in a namespace.
- */
-export function rulesCreateRuleset(
- client: ScalarCore,
- request: operations.CreateRulesetRequest,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.CreateRulesetResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- request,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- request: operations.CreateRulesetRequest,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.CreateRulesetResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const parsed = safeParse(
- request,
- (value) => operations.CreateRulesetRequest$outboundSchema.parse(value),
- "Input validation failed",
- );
- if (!parsed.ok) {
- return [parsed, { status: "invalid" }];
- }
- const payload = parsed.value;
- const body = encodeJSON("body", payload.RequestBody, { explode: true });
-
- const pathParams = {
- namespace: encodeSimple("namespace", payload.namespace, {
- explode: false,
- charEncoding: "percent",
- }),
- };
-
- const path = pathToFunc("/v1/rulesets/{namespace}")(pathParams);
-
- const headers = new Headers(compactMap({
- "Content-Type": "application/json",
- Accept: "application/json",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "createRuleset",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.CreateRulesetResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.json(200, operations.CreateRulesetResponse$inboundSchema, { key: "uid" }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/rulesDeleteRuleset.ts b/src/funcs/rulesDeleteRuleset.ts
deleted file mode 100644
index e551a27..0000000
--- a/src/funcs/rulesDeleteRuleset.ts
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import { encodeSimple } from "../lib/encodings.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * Delete a rule
- *
- * @remarks
- * Delete a rule by slug.
- */
-export function rulesDeleteRuleset(
- client: ScalarCore,
- request: operations.DeleteRulesetRequest,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.DeleteRulesetResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- request,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- request: operations.DeleteRulesetRequest,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.DeleteRulesetResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const parsed = safeParse(
- request,
- (value) => operations.DeleteRulesetRequest$outboundSchema.parse(value),
- "Input validation failed",
- );
- if (!parsed.ok) {
- return [parsed, { status: "invalid" }];
- }
- const payload = parsed.value;
- const body = null;
-
- const pathParams = {
- namespace: encodeSimple("namespace", payload.namespace, {
- explode: false,
- charEncoding: "percent",
- }),
- slug: encodeSimple("slug", payload.slug, {
- explode: false,
- charEncoding: "percent",
- }),
- };
-
- const path = pathToFunc("/v1/rulesets/{namespace}/{slug}")(pathParams);
-
- const headers = new Headers(compactMap({
- Accept: "application/json",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "deleteRuleset",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- const requestRes = client._createRequest(context, {
- security: requestSecurity,
- method: "DELETE",
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.DeleteRulesetResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.json(200, operations.DeleteRulesetResponse$inboundSchema, { key: "any" }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/rulesGetRulesetDocument.ts b/src/funcs/rulesGetRulesetDocument.ts
deleted file mode 100644
index e470234..0000000
--- a/src/funcs/rulesGetRulesetDocument.ts
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import { encodeSimple } from "../lib/encodings.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * Get a rule
- *
- * @remarks
- * Get a rule document by slug.
- */
-export function rulesGetRulesetDocument(
- client: ScalarCore,
- request: operations.GetRulesetDocumentRequest,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.GetRulesetDocumentResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- request,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- request: operations.GetRulesetDocumentRequest,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.GetRulesetDocumentResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const parsed = safeParse(
- request,
- (value) => operations.GetRulesetDocumentRequest$outboundSchema.parse(value),
- "Input validation failed",
- );
- if (!parsed.ok) {
- return [parsed, { status: "invalid" }];
- }
- const payload = parsed.value;
- const body = null;
-
- const pathParams = {
- namespace: encodeSimple("namespace", payload.namespace, {
- explode: false,
- charEncoding: "percent",
- }),
- slug: encodeSimple("slug", payload.slug, {
- explode: false,
- charEncoding: "percent",
- }),
- };
-
- const path = pathToFunc("/v1/rulesets/{namespace}/{slug}")(pathParams);
-
- const headers = new Headers(compactMap({
- Accept: "text/plain",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "getRulesetDocument",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.GetRulesetDocumentResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.text(200, operations.GetRulesetDocumentResponse$inboundSchema, {
- key: "res",
- }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/rulesListRulesets.ts b/src/funcs/rulesListRulesets.ts
deleted file mode 100644
index 5564b45..0000000
--- a/src/funcs/rulesListRulesets.ts
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import { encodeSimple } from "../lib/encodings.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * List all rules
- *
- * @remarks
- * List all rulesets in a namespace.
- */
-export function rulesListRulesets(
- client: ScalarCore,
- request: operations.ListRulesetsRequest,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.ListRulesetsResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- request,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- request: operations.ListRulesetsRequest,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.ListRulesetsResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const parsed = safeParse(
- request,
- (value) => operations.ListRulesetsRequest$outboundSchema.parse(value),
- "Input validation failed",
- );
- if (!parsed.ok) {
- return [parsed, { status: "invalid" }];
- }
- const payload = parsed.value;
- const body = null;
-
- const pathParams = {
- namespace: encodeSimple("namespace", payload.namespace, {
- explode: false,
- charEncoding: "percent",
- }),
- };
-
- const path = pathToFunc("/v1/rulesets/{namespace}")(pathParams);
-
- const headers = new Headers(compactMap({
- Accept: "application/json",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "listRulesets",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.ListRulesetsResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.json(200, operations.ListRulesetsResponse$inboundSchema, {
- key: "rules",
- }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/rulesRemoveRulesetAccessGroup.ts b/src/funcs/rulesRemoveRulesetAccessGroup.ts
deleted file mode 100644
index cc14ddb..0000000
--- a/src/funcs/rulesRemoveRulesetAccessGroup.ts
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import { encodeJSON, encodeSimple } from "../lib/encodings.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * Remove rule access group
- *
- * @remarks
- * Remove an access group from a rule.
- */
-export function rulesRemoveRulesetAccessGroup(
- client: ScalarCore,
- request: operations.RemoveRulesetAccessGroupRequest,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.RemoveRulesetAccessGroupResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- request,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- request: operations.RemoveRulesetAccessGroupRequest,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.RemoveRulesetAccessGroupResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const parsed = safeParse(
- request,
- (value) =>
- operations.RemoveRulesetAccessGroupRequest$outboundSchema.parse(value),
- "Input validation failed",
- );
- if (!parsed.ok) {
- return [parsed, { status: "invalid" }];
- }
- const payload = parsed.value;
- const body = encodeJSON("body", payload["access-group"], { explode: true });
-
- const pathParams = {
- namespace: encodeSimple("namespace", payload.namespace, {
- explode: false,
- charEncoding: "percent",
- }),
- slug: encodeSimple("slug", payload.slug, {
- explode: false,
- charEncoding: "percent",
- }),
- };
-
- const path = pathToFunc("/v1/rulesets/{namespace}/{slug}/access-group")(
- pathParams,
- );
-
- const headers = new Headers(compactMap({
- "Content-Type": "application/json",
- Accept: "application/json",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "removeRulesetAccessGroup",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- const requestRes = client._createRequest(context, {
- security: requestSecurity,
- method: "DELETE",
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.RemoveRulesetAccessGroupResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.json(200, operations.RemoveRulesetAccessGroupResponse$inboundSchema, {
- key: "any",
- }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/rulesUpdateRuleset.ts b/src/funcs/rulesUpdateRuleset.ts
deleted file mode 100644
index 381cad9..0000000
--- a/src/funcs/rulesUpdateRuleset.ts
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import { encodeJSON, encodeSimple } from "../lib/encodings.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * Update rule metadata
- *
- * @remarks
- * Update rule metadata by slug.
- */
-export function rulesUpdateRuleset(
- client: ScalarCore,
- request: operations.UpdateRulesetRequest,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.UpdateRulesetResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- request,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- request: operations.UpdateRulesetRequest,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.UpdateRulesetResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const parsed = safeParse(
- request,
- (value) => operations.UpdateRulesetRequest$outboundSchema.parse(value),
- "Input validation failed",
- );
- if (!parsed.ok) {
- return [parsed, { status: "invalid" }];
- }
- const payload = parsed.value;
- const body = encodeJSON("body", payload.RequestBody, { explode: true });
-
- const pathParams = {
- namespace: encodeSimple("namespace", payload.namespace, {
- explode: false,
- charEncoding: "percent",
- }),
- slug: encodeSimple("slug", payload.slug, {
- explode: false,
- charEncoding: "percent",
- }),
- };
-
- const path = pathToFunc("/v1/rulesets/{namespace}/{slug}")(pathParams);
-
- const headers = new Headers(compactMap({
- "Content-Type": "application/json",
- Accept: "application/json",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "updateRuleset",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.UpdateRulesetResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.json(200, operations.UpdateRulesetResponse$inboundSchema, { key: "any" }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/scalarDocsCreateGuide.ts b/src/funcs/scalarDocsCreateGuide.ts
deleted file mode 100644
index b0cd796..0000000
--- a/src/funcs/scalarDocsCreateGuide.ts
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import { encodeJSON } from "../lib/encodings.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * Create a project
- *
- * @remarks
- * Create a guide project.
- */
-export function scalarDocsCreateGuide(
- client: ScalarCore,
- request: operations.CreateGuideRequestBody,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.CreateGuideResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- request,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- request: operations.CreateGuideRequestBody,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.CreateGuideResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const parsed = safeParse(
- request,
- (value) => operations.CreateGuideRequestBody$outboundSchema.parse(value),
- "Input validation failed",
- );
- if (!parsed.ok) {
- return [parsed, { status: "invalid" }];
- }
- const payload = parsed.value;
- const body = encodeJSON("body", payload, { explode: true });
-
- const path = pathToFunc("/v1/guides")();
-
- const headers = new Headers(compactMap({
- "Content-Type": "application/json",
- Accept: "application/json",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "createGuide",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.CreateGuideResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.json(200, operations.CreateGuideResponse$inboundSchema, {
- key: "object",
- }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/scalarDocsListGuides.ts b/src/funcs/scalarDocsListGuides.ts
deleted file mode 100644
index b1170e4..0000000
--- a/src/funcs/scalarDocsListGuides.ts
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import * as M from "../lib/matchers.js";
-import { compactMap } from "../lib/primitives.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * List all projects
- *
- * @remarks
- * List all guide projects.
- */
-export function scalarDocsListGuides(
- client: ScalarCore,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.ListGuidesResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.ListGuidesResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const path = pathToFunc("/v1/guides")();
-
- const headers = new Headers(compactMap({
- Accept: "application/json",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "listGuides",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- const requestRes = client._createRequest(context, {
- security: requestSecurity,
- method: "GET",
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.ListGuidesResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.json(200, operations.ListGuidesResponse$inboundSchema, {
- key: "github-projects",
- }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/scalarDocsPublishGuide.ts b/src/funcs/scalarDocsPublishGuide.ts
deleted file mode 100644
index bfa9c0f..0000000
--- a/src/funcs/scalarDocsPublishGuide.ts
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import { encodeSimple } from "../lib/encodings.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * Publish a project
- *
- * @remarks
- * Start a new publish process.
- */
-export function scalarDocsPublishGuide(
- client: ScalarCore,
- request: operations.PublishGuideRequest,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.PublishGuideResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- request,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- request: operations.PublishGuideRequest,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.PublishGuideResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const parsed = safeParse(
- request,
- (value) => operations.PublishGuideRequest$outboundSchema.parse(value),
- "Input validation failed",
- );
- if (!parsed.ok) {
- return [parsed, { status: "invalid" }];
- }
- const payload = parsed.value;
- const body = null;
-
- const pathParams = {
- slug: encodeSimple("slug", payload.slug, {
- explode: false,
- charEncoding: "percent",
- }),
- };
-
- const path = pathToFunc("/v1/guides/{slug}/publish")(pathParams);
-
- const headers = new Headers(compactMap({
- Accept: "application/json",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "publishGuide",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.PublishGuideResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.json(200, operations.PublishGuideResponse$inboundSchema, {
- key: "object",
- }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/schemasAddSchemaAccessGroup.ts b/src/funcs/schemasAddSchemaAccessGroup.ts
deleted file mode 100644
index a1a2bda..0000000
--- a/src/funcs/schemasAddSchemaAccessGroup.ts
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import { encodeJSON, encodeSimple } from "../lib/encodings.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * Add shared component access group
- *
- * @remarks
- * Add an access group to a schema.
- */
-export function schemasAddSchemaAccessGroup(
- client: ScalarCore,
- request: operations.AddSchemaAccessGroupRequest,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.AddSchemaAccessGroupResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- request,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- request: operations.AddSchemaAccessGroupRequest,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.AddSchemaAccessGroupResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const parsed = safeParse(
- request,
- (value) =>
- operations.AddSchemaAccessGroupRequest$outboundSchema.parse(value),
- "Input validation failed",
- );
- if (!parsed.ok) {
- return [parsed, { status: "invalid" }];
- }
- const payload = parsed.value;
- const body = encodeJSON("body", payload["access-group"], { explode: true });
-
- const pathParams = {
- namespace: encodeSimple("namespace", payload.namespace, {
- explode: false,
- charEncoding: "percent",
- }),
- slug: encodeSimple("slug", payload.slug, {
- explode: false,
- charEncoding: "percent",
- }),
- };
-
- const path = pathToFunc("/v1/schemas/{namespace}/{slug}/access-group")(
- pathParams,
- );
-
- const headers = new Headers(compactMap({
- "Content-Type": "application/json",
- Accept: "application/json",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "addSchemaAccessGroup",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.AddSchemaAccessGroupResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.json(200, operations.AddSchemaAccessGroupResponse$inboundSchema, {
- key: "any",
- }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/schemasCreateSchema.ts b/src/funcs/schemasCreateSchema.ts
deleted file mode 100644
index 65e9f09..0000000
--- a/src/funcs/schemasCreateSchema.ts
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import { encodeJSON, encodeSimple } from "../lib/encodings.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * Create a shared component
- *
- * @remarks
- * Create a schema in a namespace.
- */
-export function schemasCreateSchema(
- client: ScalarCore,
- request: operations.CreateSchemaRequest,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.CreateSchemaResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- request,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- request: operations.CreateSchemaRequest,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.CreateSchemaResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const parsed = safeParse(
- request,
- (value) => operations.CreateSchemaRequest$outboundSchema.parse(value),
- "Input validation failed",
- );
- if (!parsed.ok) {
- return [parsed, { status: "invalid" }];
- }
- const payload = parsed.value;
- const body = encodeJSON("body", payload.RequestBody, { explode: true });
-
- const pathParams = {
- namespace: encodeSimple("namespace", payload.namespace, {
- explode: false,
- charEncoding: "percent",
- }),
- };
-
- const path = pathToFunc("/v1/schemas/{namespace}")(pathParams);
-
- const headers = new Headers(compactMap({
- "Content-Type": "application/json",
- Accept: "application/json",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "createSchema",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.CreateSchemaResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.json(200, operations.CreateSchemaResponse$inboundSchema, { key: "uid" }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/schemasCreateSchemaVersion.ts b/src/funcs/schemasCreateSchemaVersion.ts
deleted file mode 100644
index ed74613..0000000
--- a/src/funcs/schemasCreateSchemaVersion.ts
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import { encodeJSON, encodeSimple } from "../lib/encodings.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * Create a shared component version
- *
- * @remarks
- * Create a schema version.
- */
-export function schemasCreateSchemaVersion(
- client: ScalarCore,
- request: operations.CreateSchemaVersionRequest,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.CreateSchemaVersionResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- request,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- request: operations.CreateSchemaVersionRequest,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.CreateSchemaVersionResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const parsed = safeParse(
- request,
- (value) =>
- operations.CreateSchemaVersionRequest$outboundSchema.parse(value),
- "Input validation failed",
- );
- if (!parsed.ok) {
- return [parsed, { status: "invalid" }];
- }
- const payload = parsed.value;
- const body = encodeJSON("body", payload.RequestBody, { explode: true });
-
- const pathParams = {
- namespace: encodeSimple("namespace", payload.namespace, {
- explode: false,
- charEncoding: "percent",
- }),
- slug: encodeSimple("slug", payload.slug, {
- explode: false,
- charEncoding: "percent",
- }),
- };
-
- const path = pathToFunc("/v1/schemas/{namespace}/{slug}/version")(pathParams);
-
- const headers = new Headers(compactMap({
- "Content-Type": "application/json",
- Accept: "application/json",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "createSchemaVersion",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.CreateSchemaVersionResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.json(200, operations.CreateSchemaVersionResponse$inboundSchema, {
- key: "uid",
- }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/schemasDeleteSchema.ts b/src/funcs/schemasDeleteSchema.ts
deleted file mode 100644
index 724c24e..0000000
--- a/src/funcs/schemasDeleteSchema.ts
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import { encodeSimple } from "../lib/encodings.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * Delete a shared component
- *
- * @remarks
- * Delete a schema and all related versions.
- */
-export function schemasDeleteSchema(
- client: ScalarCore,
- request: operations.DeleteSchemaRequest,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.DeleteSchemaResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- request,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- request: operations.DeleteSchemaRequest,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.DeleteSchemaResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const parsed = safeParse(
- request,
- (value) => operations.DeleteSchemaRequest$outboundSchema.parse(value),
- "Input validation failed",
- );
- if (!parsed.ok) {
- return [parsed, { status: "invalid" }];
- }
- const payload = parsed.value;
- const body = null;
-
- const pathParams = {
- namespace: encodeSimple("namespace", payload.namespace, {
- explode: false,
- charEncoding: "percent",
- }),
- slug: encodeSimple("slug", payload.slug, {
- explode: false,
- charEncoding: "percent",
- }),
- };
-
- const path = pathToFunc("/v1/schemas/{namespace}/{slug}")(pathParams);
-
- const headers = new Headers(compactMap({
- Accept: "application/json",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "deleteSchema",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- const requestRes = client._createRequest(context, {
- security: requestSecurity,
- method: "DELETE",
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.DeleteSchemaResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.json(200, operations.DeleteSchemaResponse$inboundSchema, { key: "any" }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/schemasDeleteSchemaVersion.ts b/src/funcs/schemasDeleteSchemaVersion.ts
deleted file mode 100644
index 5f2fc71..0000000
--- a/src/funcs/schemasDeleteSchemaVersion.ts
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import { encodeSimple } from "../lib/encodings.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * Delete a shared component version
- *
- * @remarks
- * Delete a schema version.
- */
-export function schemasDeleteSchemaVersion(
- client: ScalarCore,
- request: operations.DeleteSchemaVersionRequest,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.DeleteSchemaVersionResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- request,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- request: operations.DeleteSchemaVersionRequest,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.DeleteSchemaVersionResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const parsed = safeParse(
- request,
- (value) =>
- operations.DeleteSchemaVersionRequest$outboundSchema.parse(value),
- "Input validation failed",
- );
- if (!parsed.ok) {
- return [parsed, { status: "invalid" }];
- }
- const payload = parsed.value;
- const body = null;
-
- const pathParams = {
- namespace: encodeSimple("namespace", payload.namespace, {
- explode: false,
- charEncoding: "percent",
- }),
- semver: encodeSimple("semver", payload.semver, {
- explode: false,
- charEncoding: "percent",
- }),
- slug: encodeSimple("slug", payload.slug, {
- explode: false,
- charEncoding: "percent",
- }),
- };
-
- const path = pathToFunc("/v1/schemas/{namespace}/{slug}/version/{semver}")(
- pathParams,
- );
-
- const headers = new Headers(compactMap({
- Accept: "application/json",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "deleteSchemaVersion",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- const requestRes = client._createRequest(context, {
- security: requestSecurity,
- method: "DELETE",
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.DeleteSchemaVersionResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.json(200, operations.DeleteSchemaVersionResponse$inboundSchema, {
- key: "any",
- }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/schemasGetSchemaVersion.ts b/src/funcs/schemasGetSchemaVersion.ts
deleted file mode 100644
index 439a823..0000000
--- a/src/funcs/schemasGetSchemaVersion.ts
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import { encodeSimple } from "../lib/encodings.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * Get a shared component document
- *
- * @remarks
- * Get a specific schema version document.
- */
-export function schemasGetSchemaVersion(
- client: ScalarCore,
- request: operations.GetSchemaVersionRequest,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.GetSchemaVersionResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- request,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- request: operations.GetSchemaVersionRequest,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.GetSchemaVersionResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const parsed = safeParse(
- request,
- (value) => operations.GetSchemaVersionRequest$outboundSchema.parse(value),
- "Input validation failed",
- );
- if (!parsed.ok) {
- return [parsed, { status: "invalid" }];
- }
- const payload = parsed.value;
- const body = null;
-
- const pathParams = {
- namespace: encodeSimple("namespace", payload.namespace, {
- explode: false,
- charEncoding: "percent",
- }),
- semver: encodeSimple("semver", payload.semver, {
- explode: false,
- charEncoding: "percent",
- }),
- slug: encodeSimple("slug", payload.slug, {
- explode: false,
- charEncoding: "percent",
- }),
- };
-
- const path = pathToFunc("/v1/schemas/{namespace}/{slug}/version/{semver}")(
- pathParams,
- );
-
- const headers = new Headers(compactMap({
- Accept: "text/plain",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "getSchemaVersion",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.GetSchemaVersionResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.text(200, operations.GetSchemaVersionResponse$inboundSchema, {
- key: "res",
- }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/schemasListSchemas.ts b/src/funcs/schemasListSchemas.ts
deleted file mode 100644
index 0d5e898..0000000
--- a/src/funcs/schemasListSchemas.ts
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import { encodeSimple } from "../lib/encodings.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * List all shared components
- *
- * @remarks
- * List schemas in a namespace.
- */
-export function schemasListSchemas(
- client: ScalarCore,
- request: operations.ListSchemasRequest,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.ListSchemasResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- request,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- request: operations.ListSchemasRequest,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.ListSchemasResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const parsed = safeParse(
- request,
- (value) => operations.ListSchemasRequest$outboundSchema.parse(value),
- "Input validation failed",
- );
- if (!parsed.ok) {
- return [parsed, { status: "invalid" }];
- }
- const payload = parsed.value;
- const body = null;
-
- const pathParams = {
- namespace: encodeSimple("namespace", payload.namespace, {
- explode: false,
- charEncoding: "percent",
- }),
- };
-
- const path = pathToFunc("/v1/schemas/{namespace}")(pathParams);
-
- const headers = new Headers(compactMap({
- Accept: "application/json",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "listSchemas",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.ListSchemasResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.json(200, operations.ListSchemasResponse$inboundSchema, {
- key: "schemata",
- }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/schemasRemoveSchemaAccessGroup.ts b/src/funcs/schemasRemoveSchemaAccessGroup.ts
deleted file mode 100644
index ad92b07..0000000
--- a/src/funcs/schemasRemoveSchemaAccessGroup.ts
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import { encodeJSON, encodeSimple } from "../lib/encodings.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * Remove shared component access group
- *
- * @remarks
- * Remove an access group from a schema.
- */
-export function schemasRemoveSchemaAccessGroup(
- client: ScalarCore,
- request: operations.RemoveSchemaAccessGroupRequest,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.RemoveSchemaAccessGroupResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- request,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- request: operations.RemoveSchemaAccessGroupRequest,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.RemoveSchemaAccessGroupResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const parsed = safeParse(
- request,
- (value) =>
- operations.RemoveSchemaAccessGroupRequest$outboundSchema.parse(value),
- "Input validation failed",
- );
- if (!parsed.ok) {
- return [parsed, { status: "invalid" }];
- }
- const payload = parsed.value;
- const body = encodeJSON("body", payload["access-group"], { explode: true });
-
- const pathParams = {
- namespace: encodeSimple("namespace", payload.namespace, {
- explode: false,
- charEncoding: "percent",
- }),
- slug: encodeSimple("slug", payload.slug, {
- explode: false,
- charEncoding: "percent",
- }),
- };
-
- const path = pathToFunc("/v1/schemas/{namespace}/{slug}/access-group")(
- pathParams,
- );
-
- const headers = new Headers(compactMap({
- "Content-Type": "application/json",
- Accept: "application/json",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "removeSchemaAccessGroup",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- const requestRes = client._createRequest(context, {
- security: requestSecurity,
- method: "DELETE",
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.RemoveSchemaAccessGroupResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.json(200, operations.RemoveSchemaAccessGroupResponse$inboundSchema, {
- key: "any",
- }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/schemasUpdateSchema.ts b/src/funcs/schemasUpdateSchema.ts
deleted file mode 100644
index 8311959..0000000
--- a/src/funcs/schemasUpdateSchema.ts
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import { encodeJSON, encodeSimple } from "../lib/encodings.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * Update shared component metadata
- *
- * @remarks
- * Update schema metadata.
- */
-export function schemasUpdateSchema(
- client: ScalarCore,
- request: operations.UpdateSchemaRequest,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.UpdateSchemaResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- request,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- request: operations.UpdateSchemaRequest,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.UpdateSchemaResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const parsed = safeParse(
- request,
- (value) => operations.UpdateSchemaRequest$outboundSchema.parse(value),
- "Input validation failed",
- );
- if (!parsed.ok) {
- return [parsed, { status: "invalid" }];
- }
- const payload = parsed.value;
- const body = encodeJSON("body", payload.RequestBody, { explode: true });
-
- const pathParams = {
- namespace: encodeSimple("namespace", payload.namespace, {
- explode: false,
- charEncoding: "percent",
- }),
- slug: encodeSimple("slug", payload.slug, {
- explode: false,
- charEncoding: "percent",
- }),
- };
-
- const path = pathToFunc("/v1/schemas/{namespace}/{slug}")(pathParams);
-
- const headers = new Headers(compactMap({
- "Content-Type": "application/json",
- Accept: "application/json",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "updateSchema",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.UpdateSchemaResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.json(200, operations.UpdateSchemaResponse$inboundSchema, { key: "any" }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/teamsListTeams.ts b/src/funcs/teamsListTeams.ts
deleted file mode 100644
index 564bf6d..0000000
--- a/src/funcs/teamsListTeams.ts
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import * as M from "../lib/matchers.js";
-import { compactMap } from "../lib/primitives.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * List teams
- *
- * @remarks
- * List all available teams
- */
-export function teamsListTeams(
- client: ScalarCore,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.ListTeamsResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.ListTeamsResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const path = pathToFunc("/v1/teams")();
-
- const headers = new Headers(compactMap({
- Accept: "application/json",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "listTeams",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- const requestRes = client._createRequest(context, {
- security: requestSecurity,
- method: "GET",
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.ListTeamsResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.json(200, operations.ListTeamsResponse$inboundSchema, { key: "teams" }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/themesCreateTheme.ts b/src/funcs/themesCreateTheme.ts
deleted file mode 100644
index 06a2be4..0000000
--- a/src/funcs/themesCreateTheme.ts
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import { encodeJSON } from "../lib/encodings.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * Create a theme
- *
- * @remarks
- * Create a team theme.
- */
-export function themesCreateTheme(
- client: ScalarCore,
- request: operations.CreateThemeRequestBody,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.CreateThemeResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- request,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- request: operations.CreateThemeRequestBody,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.CreateThemeResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const parsed = safeParse(
- request,
- (value) => operations.CreateThemeRequestBody$outboundSchema.parse(value),
- "Input validation failed",
- );
- if (!parsed.ok) {
- return [parsed, { status: "invalid" }];
- }
- const payload = parsed.value;
- const body = encodeJSON("body", payload, { explode: true });
-
- const path = pathToFunc("/v1/themes")();
-
- const headers = new Headers(compactMap({
- "Content-Type": "application/json",
- Accept: "application/json",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "createTheme",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.CreateThemeResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.json(200, operations.CreateThemeResponse$inboundSchema, { key: "uid" }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/themesDeleteTheme.ts b/src/funcs/themesDeleteTheme.ts
deleted file mode 100644
index 4339ff3..0000000
--- a/src/funcs/themesDeleteTheme.ts
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import { encodeSimple } from "../lib/encodings.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * Delete a theme
- *
- * @remarks
- * Delete a theme by slug.
- */
-export function themesDeleteTheme(
- client: ScalarCore,
- request: operations.DeleteThemeRequest,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.DeleteThemeResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- request,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- request: operations.DeleteThemeRequest,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.DeleteThemeResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const parsed = safeParse(
- request,
- (value) => operations.DeleteThemeRequest$outboundSchema.parse(value),
- "Input validation failed",
- );
- if (!parsed.ok) {
- return [parsed, { status: "invalid" }];
- }
- const payload = parsed.value;
- const body = null;
-
- const pathParams = {
- slug: encodeSimple("slug", payload.slug, {
- explode: false,
- charEncoding: "percent",
- }),
- };
-
- const path = pathToFunc("/v1/themes/{slug}")(pathParams);
-
- const headers = new Headers(compactMap({
- Accept: "application/json",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "deleteTheme",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- const requestRes = client._createRequest(context, {
- security: requestSecurity,
- method: "DELETE",
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.DeleteThemeResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.json(200, operations.DeleteThemeResponse$inboundSchema, { key: "any" }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/themesGetTheme.ts b/src/funcs/themesGetTheme.ts
deleted file mode 100644
index 53ae358..0000000
--- a/src/funcs/themesGetTheme.ts
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import { encodeSimple } from "../lib/encodings.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * Get a theme
- *
- * @remarks
- * Get the theme document by slug.
- */
-export function themesGetTheme(
- client: ScalarCore,
- request: operations.GetThemeRequest,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.GetThemeResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- request,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- request: operations.GetThemeRequest,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.GetThemeResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const parsed = safeParse(
- request,
- (value) => operations.GetThemeRequest$outboundSchema.parse(value),
- "Input validation failed",
- );
- if (!parsed.ok) {
- return [parsed, { status: "invalid" }];
- }
- const payload = parsed.value;
- const body = null;
-
- const pathParams = {
- slug: encodeSimple("slug", payload.slug, {
- explode: false,
- charEncoding: "percent",
- }),
- };
-
- const path = pathToFunc("/v1/themes/{slug}")(pathParams);
-
- const headers = new Headers(compactMap({
- Accept: "text/plain",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "getTheme",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.GetThemeResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.text(200, operations.GetThemeResponse$inboundSchema, { key: "res" }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/themesListThemes.ts b/src/funcs/themesListThemes.ts
deleted file mode 100644
index befc9ca..0000000
--- a/src/funcs/themesListThemes.ts
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import * as M from "../lib/matchers.js";
-import { compactMap } from "../lib/primitives.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * List all themes
- *
- * @remarks
- * List all team themes.
- */
-export function themesListThemes(
- client: ScalarCore,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.ListThemesResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.ListThemesResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const path = pathToFunc("/v1/themes")();
-
- const headers = new Headers(compactMap({
- Accept: "application/json",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "listThemes",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- const requestRes = client._createRequest(context, {
- security: requestSecurity,
- method: "GET",
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.ListThemesResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.json(200, operations.ListThemesResponse$inboundSchema, { key: "themes" }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/themesReplaceThemeDocument.ts b/src/funcs/themesReplaceThemeDocument.ts
deleted file mode 100644
index b1f30d0..0000000
--- a/src/funcs/themesReplaceThemeDocument.ts
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import { encodeJSON, encodeSimple } from "../lib/encodings.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * Update theme document
- *
- * @remarks
- * Replace the theme document.
- */
-export function themesReplaceThemeDocument(
- client: ScalarCore,
- request: operations.ReplaceThemeDocumentRequest,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.ReplaceThemeDocumentResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- request,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- request: operations.ReplaceThemeDocumentRequest,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.ReplaceThemeDocumentResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const parsed = safeParse(
- request,
- (value) =>
- operations.ReplaceThemeDocumentRequest$outboundSchema.parse(value),
- "Input validation failed",
- );
- if (!parsed.ok) {
- return [parsed, { status: "invalid" }];
- }
- const payload = parsed.value;
- const body = encodeJSON("body", payload.RequestBody, { explode: true });
-
- const pathParams = {
- slug: encodeSimple("slug", payload.slug, {
- explode: false,
- charEncoding: "percent",
- }),
- };
-
- const path = pathToFunc("/v1/themes/{slug}")(pathParams);
-
- const headers = new Headers(compactMap({
- "Content-Type": "application/json",
- Accept: "application/json",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "replaceThemeDocument",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- const requestRes = client._createRequest(context, {
- security: requestSecurity,
- method: "PUT",
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.ReplaceThemeDocumentResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.json(200, operations.ReplaceThemeDocumentResponse$inboundSchema, {
- key: "any",
- }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/themesUpdateTheme.ts b/src/funcs/themesUpdateTheme.ts
deleted file mode 100644
index d3d5244..0000000
--- a/src/funcs/themesUpdateTheme.ts
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { ScalarCore } from "../core.js";
-import { encodeJSON, encodeSimple } from "../lib/encodings.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ScalarError } from "../models/errors/scalarerror.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";
-
-/**
- * Update theme metadata
- *
- * @remarks
- * Update theme metadata.
- */
-export function themesUpdateTheme(
- client: ScalarCore,
- request: operations.UpdateThemeRequest,
- options?: RequestOptions,
-): APIPromise<
- Result<
- operations.UpdateThemeResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >
-> {
- return new APIPromise($do(
- client,
- request,
- options,
- ));
-}
-
-async function $do(
- client: ScalarCore,
- request: operations.UpdateThemeRequest,
- options?: RequestOptions,
-): Promise<
- [
- Result<
- operations.UpdateThemeResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >,
- APICall,
- ]
-> {
- const parsed = safeParse(
- request,
- (value) => operations.UpdateThemeRequest$outboundSchema.parse(value),
- "Input validation failed",
- );
- if (!parsed.ok) {
- return [parsed, { status: "invalid" }];
- }
- const payload = parsed.value;
- const body = encodeJSON("body", payload.RequestBody, { explode: true });
-
- const pathParams = {
- slug: encodeSimple("slug", payload.slug, {
- explode: false,
- charEncoding: "percent",
- }),
- };
-
- const path = pathToFunc("/v1/themes/{slug}")(pathParams);
-
- const headers = new Headers(compactMap({
- "Content-Type": "application/json",
- Accept: "application/json",
- }));
-
- const secConfig = await extractSecurity(client._options.bearerAuth);
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
- const requestSecurity = resolveGlobalSecurity(securityInput);
-
- const context = {
- options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? "",
- operationID: "updateTheme",
- oAuth2Scopes: [],
-
- resolvedSecurity: requestSecurity,
-
- securitySource: client._options.bearerAuth,
- retryConfig: options?.retries
- || client._options.retryConfig
- || { strategy: "none" },
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
- };
-
- 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,
- errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "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<
- operations.UpdateThemeResponse,
- | errors.FourHundred
- | errors.FourHundredAndOne
- | errors.FourHundredAndThree
- | errors.FourHundredAndFour
- | errors.FourHundredAndTwentyTwo
- | errors.FiveHundred
- | ScalarError
- | ResponseValidationError
- | ConnectionError
- | RequestAbortedError
- | RequestTimeoutError
- | InvalidRequestError
- | UnexpectedClientError
- | SDKValidationError
- >(
- M.json(200, operations.UpdateThemeResponse$inboundSchema, { key: "any" }),
- M.jsonErr(400, errors.FourHundred$inboundSchema),
- M.jsonErr(401, errors.FourHundredAndOne$inboundSchema),
- M.jsonErr(403, errors.FourHundredAndThree$inboundSchema),
- M.jsonErr(404, errors.FourHundredAndFour$inboundSchema),
- M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema),
- M.jsonErr(500, errors.FiveHundred$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/hooks/hooks.ts b/src/hooks/hooks.ts
deleted file mode 100644
index 7ed9e04..0000000
--- a/src/hooks/hooks.ts
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { SDKOptions } from "../lib/config.js";
-import { RequestInput } from "../lib/http.js";
-import {
- AfterErrorContext,
- AfterErrorHook,
- AfterSuccessContext,
- AfterSuccessHook,
- BeforeCreateRequestContext,
- BeforeCreateRequestHook,
- BeforeRequestContext,
- BeforeRequestHook,
- Hook,
- Hooks,
- SDKInitHook,
-} from "./types.js";
-
-import { initHooks } from "./registration.js";
-
-export class SDKHooks implements Hooks {
- sdkInitHooks: SDKInitHook[] = [];
- beforeCreateRequestHooks: BeforeCreateRequestHook[] = [];
- beforeRequestHooks: BeforeRequestHook[] = [];
- afterSuccessHooks: AfterSuccessHook[] = [];
- afterErrorHooks: AfterErrorHook[] = [];
-
- constructor() {
- const presetHooks: Array = [];
-
- for (const hook of presetHooks) {
- if ("sdkInit" in hook) {
- this.registerSDKInitHook(hook);
- }
- if ("beforeCreateRequest" in hook) {
- this.registerBeforeCreateRequestHook(hook);
- }
- if ("beforeRequest" in hook) {
- this.registerBeforeRequestHook(hook);
- }
- if ("afterSuccess" in hook) {
- this.registerAfterSuccessHook(hook);
- }
- if ("afterError" in hook) {
- this.registerAfterErrorHook(hook);
- }
- }
- initHooks(this);
- }
-
- registerSDKInitHook(hook: SDKInitHook) {
- this.sdkInitHooks.push(hook);
- }
-
- registerBeforeCreateRequestHook(hook: BeforeCreateRequestHook) {
- this.beforeCreateRequestHooks.push(hook);
- }
-
- registerBeforeRequestHook(hook: BeforeRequestHook) {
- this.beforeRequestHooks.push(hook);
- }
-
- registerAfterSuccessHook(hook: AfterSuccessHook) {
- this.afterSuccessHooks.push(hook);
- }
-
- registerAfterErrorHook(hook: AfterErrorHook) {
- this.afterErrorHooks.push(hook);
- }
-
- sdkInit(opts: SDKOptions): SDKOptions {
- return this.sdkInitHooks.reduce((opts, hook) => hook.sdkInit(opts), opts);
- }
-
- beforeCreateRequest(
- hookCtx: BeforeCreateRequestContext,
- input: RequestInput,
- ): RequestInput {
- let inp = input;
-
- for (const hook of this.beforeCreateRequestHooks) {
- inp = hook.beforeCreateRequest(hookCtx, inp);
- }
-
- return inp;
- }
-
- async beforeRequest(
- hookCtx: BeforeRequestContext,
- request: Request,
- ): Promise {
- let req = request;
-
- for (const hook of this.beforeRequestHooks) {
- req = await hook.beforeRequest(hookCtx, req);
- }
-
- return req;
- }
-
- async afterSuccess(
- hookCtx: AfterSuccessContext,
- response: Response,
- ): Promise {
- let res = response;
-
- for (const hook of this.afterSuccessHooks) {
- res = await hook.afterSuccess(hookCtx, res);
- }
-
- return res;
- }
-
- async afterError(
- hookCtx: AfterErrorContext,
- response: Response | null,
- error: unknown,
- ): Promise<{ response: Response | null; error: unknown }> {
- let res = response;
- let err = error;
-
- for (const hook of this.afterErrorHooks) {
- const result = await hook.afterError(hookCtx, res, err);
- res = result.response;
- err = result.error;
- }
-
- return { response: res, error: err };
- }
-}
diff --git a/src/hooks/index.ts b/src/hooks/index.ts
deleted file mode 100644
index f60ec7a..0000000
--- a/src/hooks/index.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-export * from "./hooks.js";
-export * from "./types.js";
diff --git a/src/hooks/registration.ts b/src/hooks/registration.ts
deleted file mode 100644
index 7064973..0000000
--- a/src/hooks/registration.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { Hooks } from "./types.js";
-
-/*
- * This file is only ever generated once on the first generation and then is free to be modified.
- * Any hooks you wish to add should be registered in the initHooks function. Feel free to define them
- * in this file or in separate files in the hooks folder.
- */
-
-// @ts-expect-error remove this line when you add your first hook and hooks is used
-export function initHooks(hooks: Hooks) {
- // Add hooks by calling hooks.register{ClientInit/BeforeCreateRequest/BeforeRequest/AfterSuccess/AfterError}Hook
- // with an instance of a hook that implements that specific Hook interface
- // Hooks are registered per SDK instance, and are valid for the lifetime of the SDK instance
-}
diff --git a/src/hooks/types.ts b/src/hooks/types.ts
deleted file mode 100644
index 9c36bf0..0000000
--- a/src/hooks/types.ts
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { SDKOptions } from "../lib/config.js";
-import { RequestInput } from "../lib/http.js";
-import { RetryConfig } from "../lib/retries.js";
-import { SecurityState } from "../lib/security.js";
-
-export type HookContext = {
- baseURL: string | URL;
- operationID: string;
- oAuth2Scopes: string[] | null;
- securitySource?: any | (() => Promise);
- retryConfig: RetryConfig;
- resolvedSecurity: SecurityState | null;
- options: SDKOptions;
-};
-
-export type Awaitable = T | Promise;
-
-export type BeforeCreateRequestContext = HookContext & {};
-export type BeforeRequestContext = HookContext & {};
-export type AfterSuccessContext = HookContext & {};
-export type AfterErrorContext = HookContext & {};
-
-/**
- * SDKInitHook is called when the SDK is initializing. The
- * hook can return a new baseURL and HTTP client to be used by the SDK.
- */
-export interface SDKInitHook {
- sdkInit: (opts: SDKOptions) => SDKOptions;
-}
-
-export interface BeforeCreateRequestHook {
- /**
- * A hook that is called before the SDK creates a `Request` object. The hook
- * can modify how a request is constructed since certain modifications, like
- * changing the request URL, cannot be done on a request object directly.
- */
- beforeCreateRequest: (
- hookCtx: BeforeCreateRequestContext,
- input: RequestInput,
- ) => RequestInput;
-}
-
-export interface BeforeRequestHook {
- /**
- * A hook that is called before the SDK sends a request. The hook can
- * introduce instrumentation code such as logging, tracing and metrics or
- * replace the request before it is sent or throw an error to stop the
- * request from being sent.
- */
- beforeRequest: (
- hookCtx: BeforeRequestContext,
- request: Request,
- ) => Awaitable;
-}
-
-export interface AfterSuccessHook {
- /**
- * A hook that is called after the SDK receives a response. The hook can
- * introduce instrumentation code such as logging, tracing and metrics or
- * modify the response before it is handled or throw an error to stop the
- * response from being handled.
- */
- afterSuccess: (
- hookCtx: AfterSuccessContext,
- response: Response,
- ) => Awaitable;
-}
-
-export interface AfterErrorHook {
- /**
- * A hook that is called after the SDK encounters an error, or a
- * non-successful response. The hook can introduce instrumentation code such
- * as logging, tracing and metrics or modify the response or error values.
- */
- afterError: (
- hookCtx: AfterErrorContext,
- response: Response | null,
- error: unknown,
- ) => Awaitable<{
- response: Response | null;
- error: unknown;
- }>;
-}
-
-export interface Hooks {
- /** Registers a hook to be used by the SDK for initialization event. */
- registerSDKInitHook(hook: SDKInitHook): void;
- /** Registers a hook to be used by the SDK for to modify `Request` construction. */
- registerBeforeCreateRequestHook(hook: BeforeCreateRequestHook): void;
- /** Registers a hook to be used by the SDK for the before request event. */
- registerBeforeRequestHook(hook: BeforeRequestHook): void;
- /** Registers a hook to be used by the SDK for the after success event. */
- registerAfterSuccessHook(hook: AfterSuccessHook): void;
- /** Registers a hook to be used by the SDK for the after error event. */
- registerAfterErrorHook(hook: AfterErrorHook): void;
-}
-
-export type Hook =
- | SDKInitHook
- | BeforeCreateRequestHook
- | BeforeRequestHook
- | AfterSuccessHook
- | AfterErrorHook;
diff --git a/src/index.ts b/src/index.ts
index dbcba16..9eb60a9 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -1,9 +1,22 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
+// File generated from our OpenAPI spec by Scalar. See README.md for details.
-export * from "./lib/config.js";
-export * as files from "./lib/files.js";
-export { HTTPClient } from "./lib/http.js";
-export type { Fetcher, HTTPClientOptions } from "./lib/http.js";
-export * from "./sdk/sdk.js";
+export { ScalarAPI as default } from './client.js';
+
+export { type Uploadable, toFile } from './core/uploads';
+export { APIPromise } from './api-promise';
+export { ScalarAPI, type ClientOptions, type ScalarAPIOptions, type Logger, type LogLevel } from './client.js';
+export {
+ ScalarAPIError,
+ APIError,
+ APIConnectionError,
+ APIConnectionTimeoutError,
+ APIUserAbortError,
+ NotFoundError,
+ ConflictError,
+ RateLimitError,
+ BadRequestError,
+ AuthenticationError,
+ InternalServerError,
+ PermissionDeniedError,
+ UnprocessableEntityError,
+} from './error';
diff --git a/src/internal/README.md b/src/internal/README.md
new file mode 100644
index 0000000..3ef5a25
--- /dev/null
+++ b/src/internal/README.md
@@ -0,0 +1,3 @@
+# `internal`
+
+The modules in this directory are not importable outside this package and will change between releases.
diff --git a/src/internal/builtin-types.ts b/src/internal/builtin-types.ts
new file mode 100644
index 0000000..40d03c4
--- /dev/null
+++ b/src/internal/builtin-types.ts
@@ -0,0 +1,93 @@
+// File generated from our OpenAPI spec by Scalar. See README.md for details.
+
+export type Fetch = (input: string | URL | Request, init?: RequestInit) => Promise;
+
+/**
+ * An alias to the builtin `RequestInit` type so we can
+ * easily alias it in import statements if there are name clashes.
+ *
+ * https://developer.mozilla.org/docs/Web/API/RequestInit
+ */
+type _RequestInit = RequestInit;
+
+/**
+ * An alias to the builtin `Response` type so we can
+ * easily alias it in import statements if there are name clashes.
+ *
+ * https://developer.mozilla.org/docs/Web/API/Response
+ */
+type _Response = Response;
+
+/**
+ * The type for the first argument to `fetch`.
+ *
+ * https://developer.mozilla.org/docs/Web/API/Window/fetch#resource
+ */
+type _RequestInfo = Request | URL | string;
+
+/**
+ * The type for constructing `RequestInit` Headers.
+ *
+ * https://developer.mozilla.org/docs/Web/API/RequestInit#setting_headers
+ */
+type _HeadersInit = RequestInit['headers'];
+
+/**
+ * The type for constructing `RequestInit` body.
+ *
+ * https://developer.mozilla.org/docs/Web/API/RequestInit#body
+ */
+type _BodyInit = RequestInit['body'];
+
+/**
+ * An alias to the builtin `Array` type so we can
+ * easily alias it in import statements if there are name clashes.
+ */
+type _Array = Array;
+
+/**
+ * An alias to the builtin `Record` type so we can
+ * easily alias it in import statements if there are name clashes.
+ */
+type _Record = Record;
+
+export type {
+ _Array as Array,
+ _BodyInit as BodyInit,
+ _HeadersInit as HeadersInit,
+ _Record as Record,
+ _RequestInfo as RequestInfo,
+ _RequestInit as RequestInit,
+ _Response as Response,
+};
+
+/**
+ * A copy of the builtin `EndingType` type as it isn't fully supported in certain
+ * environments and attempting to reference the global version will error.
+ *
+ * https://github.com/microsoft/TypeScript/blob/49ad1a3917a0ea57f5ff248159256e12bb1cb705/src/lib/dom.generated.d.ts#L27941
+ */
+type EndingType = 'native' | 'transparent';
+
+/**
+ * A copy of the builtin `BlobPropertyBag` type as it isn't fully supported in certain
+ * environments and attempting to reference the global version will error.
+ *
+ * https://github.com/microsoft/TypeScript/blob/49ad1a3917a0ea57f5ff248159256e12bb1cb705/src/lib/dom.generated.d.ts#L154
+ * https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob#options
+ */
+export interface BlobPropertyBag {
+ endings?: EndingType;
+ type?: string;
+}
+
+/**
+ * A copy of the builtin `FilePropertyBag` type as it isn't fully supported in certain
+ * environments and attempting to reference the global version will error.
+ *
+ * https://github.com/microsoft/TypeScript/blob/49ad1a3917a0ea57f5ff248159256e12bb1cb705/src/lib/dom.generated.d.ts#L503
+ * https://developer.mozilla.org/en-US/docs/Web/API/File/File#options
+ */
+export interface FilePropertyBag extends BlobPropertyBag {
+ lastModified?: number;
+}
diff --git a/src/internal/detect-platform.ts b/src/internal/detect-platform.ts
new file mode 100644
index 0000000..7fc9267
--- /dev/null
+++ b/src/internal/detect-platform.ts
@@ -0,0 +1,196 @@
+// File generated from our OpenAPI spec by Scalar. See README.md for details.
+
+import { VERSION } from '../version';
+
+export const isRunningInBrowser = () => {
+ return (
+ // @ts-ignore
+ typeof window !== 'undefined' &&
+ // @ts-ignore
+ typeof window.document !== 'undefined' &&
+ // @ts-ignore
+ typeof navigator !== 'undefined'
+ );
+};
+
+type DetectedPlatform = 'deno' | 'node' | 'edge' | 'unknown';
+
+/**
+ * Note this does not detect 'browser'; for that, use getBrowserInfo().
+ */
+function getDetectedPlatform(): DetectedPlatform {
+ if (typeof Deno !== 'undefined' && Deno.build != null) {
+ return 'deno';
+ }
+ if (typeof EdgeRuntime !== 'undefined') {
+ return 'edge';
+ }
+ if (
+ Object.prototype.toString.call(
+ typeof (globalThis as any).process !== 'undefined' ? (globalThis as any).process : 0,
+ ) === '[object process]'
+ ) {
+ return 'node';
+ }
+ return 'unknown';
+}
+
+declare const Deno: any;
+declare const EdgeRuntime: any;
+type Arch = 'x32' | 'x64' | 'arm' | 'arm64' | `other:${string}` | 'unknown';
+type PlatformName =
+ | 'MacOS'
+ | 'Linux'
+ | 'Windows'
+ | 'FreeBSD'
+ | 'OpenBSD'
+ | 'iOS'
+ | 'Android'
+ | `Other:${string}`
+ | 'Unknown';
+type Browser = 'ie' | 'edge' | 'chrome' | 'firefox' | 'safari';
+type PlatformProperties = {
+ 'X-Scalar-Lang': 'js';
+ 'X-Scalar-Package-Version': string;
+ 'X-Scalar-OS': PlatformName;
+ 'X-Scalar-Arch': Arch;
+ 'X-Scalar-Runtime': 'node' | 'deno' | 'edge' | `browser:${Browser}` | 'unknown';
+ 'X-Scalar-Runtime-Version': string;
+};
+const getPlatformProperties = (): PlatformProperties => {
+ const detectedPlatform = getDetectedPlatform();
+ if (detectedPlatform === 'deno') {
+ return {
+ 'X-Scalar-Lang': 'js',
+ 'X-Scalar-Package-Version': VERSION,
+ 'X-Scalar-OS': normalizePlatform(Deno.build.os),
+ 'X-Scalar-Arch': normalizeArch(Deno.build.arch),
+ 'X-Scalar-Runtime': 'deno',
+ 'X-Scalar-Runtime-Version':
+ typeof Deno.version === 'string' ? Deno.version : Deno.version?.deno ?? 'unknown',
+ };
+ }
+ if (typeof EdgeRuntime !== 'undefined') {
+ return {
+ 'X-Scalar-Lang': 'js',
+ 'X-Scalar-Package-Version': VERSION,
+ 'X-Scalar-OS': 'Unknown',
+ 'X-Scalar-Arch': `other:${EdgeRuntime}`,
+ 'X-Scalar-Runtime': 'edge',
+ 'X-Scalar-Runtime-Version': (globalThis as any).process.version,
+ };
+ }
+ // Check if Node.js
+ if (detectedPlatform === 'node') {
+ return {
+ 'X-Scalar-Lang': 'js',
+ 'X-Scalar-Package-Version': VERSION,
+ 'X-Scalar-OS': normalizePlatform((globalThis as any).process.platform ?? 'unknown'),
+ 'X-Scalar-Arch': normalizeArch((globalThis as any).process.arch ?? 'unknown'),
+ 'X-Scalar-Runtime': 'node',
+ 'X-Scalar-Runtime-Version': (globalThis as any).process.version ?? 'unknown',
+ };
+ }
+
+ const browserInfo = getBrowserInfo();
+ if (browserInfo) {
+ return {
+ 'X-Scalar-Lang': 'js',
+ 'X-Scalar-Package-Version': VERSION,
+ 'X-Scalar-OS': 'Unknown',
+ 'X-Scalar-Arch': 'unknown',
+ 'X-Scalar-Runtime': `browser:${browserInfo.browser}`,
+ 'X-Scalar-Runtime-Version': browserInfo.version,
+ };
+ }
+
+ // TODO add support for Cloudflare workers, etc.
+ return {
+ 'X-Scalar-Lang': 'js',
+ 'X-Scalar-Package-Version': VERSION,
+ 'X-Scalar-OS': 'Unknown',
+ 'X-Scalar-Arch': 'unknown',
+ 'X-Scalar-Runtime': 'unknown',
+ 'X-Scalar-Runtime-Version': 'unknown',
+ };
+};
+
+type BrowserInfo = {
+ browser: Browser;
+ version: string;
+};
+
+declare const navigator: { userAgent: string } | undefined;
+
+// Note: modified from https://github.com/JS-DevTools/host-environment/blob/b1ab79ecde37db5d6e163c050e54fe7d287d7c92/src/isomorphic.browser.ts
+function getBrowserInfo(): BrowserInfo | null {
+ if (typeof navigator === 'undefined' || !navigator) {
+ return null;
+ }
+
+ // NOTE: The order matters here!
+ const browserPatterns = [
+ { key: 'edge' as const, pattern: /Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ },
+ { key: 'ie' as const, pattern: /MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ },
+ { key: 'ie' as const, pattern: /Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/ },
+ { key: 'chrome' as const, pattern: /Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ },
+ { key: 'firefox' as const, pattern: /Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ },
+ { key: 'safari' as const, pattern: /(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/ },
+ ];
+
+ // Find the FIRST matching browser
+ for (const { key, pattern } of browserPatterns) {
+ const match = pattern.exec(navigator.userAgent);
+ if (match) {
+ const major = match[1] || 0;
+ const minor = match[2] || 0;
+ const patch = match[3] || 0;
+
+ return { browser: key, version: `${major}.${minor}.${patch}` };
+ }
+ }
+
+ return null;
+}
+
+const normalizeArch = (arch: string): Arch => {
+ // Node docs:
+ // - https://nodejs.org/api/process.html#processarch
+ // Deno docs:
+ // - https://doc.deno.land/deno/stable/~/Deno.build
+ if (arch === 'x32') return 'x32';
+ if (arch === 'x86_64' || arch === 'x64') return 'x64';
+ if (arch === 'arm') return 'arm';
+ if (arch === 'aarch64' || arch === 'arm64') return 'arm64';
+ if (arch) return `other:${arch}`;
+ return 'unknown';
+};
+
+const normalizePlatform = (platform: string): PlatformName => {
+ // Node platforms:
+ // - https://nodejs.org/api/process.html#processplatform
+ // Deno platforms:
+ // - https://doc.deno.land/deno/stable/~/Deno.build
+ // - https://github.com/denoland/deno/issues/14799
+
+ platform = platform.toLowerCase();
+
+ // NOTE: this iOS check is untested and may not work
+ // Node does not work natively on IOS, there is a fork at
+ // https://github.com/nodejs-mobile/nodejs-mobile
+ // however it is unknown at the time of writing how to detect if it is running
+ if (platform.includes('ios')) return 'iOS';
+ if (platform === 'android') return 'Android';
+ if (platform === 'darwin') return 'MacOS';
+ if (platform === 'win32') return 'Windows';
+ if (platform === 'freebsd') return 'FreeBSD';
+ if (platform === 'openbsd') return 'OpenBSD';
+ if (platform === 'linux') return 'Linux';
+ if (platform) return `Other:${platform}`;
+ return 'Unknown';
+};
+
+let _platformHeaders: PlatformProperties;
+export const getPlatformHeaders = () => {
+ return (_platformHeaders ??= getPlatformProperties());
+};
diff --git a/src/internal/errors.ts b/src/internal/errors.ts
new file mode 100644
index 0000000..fed0efd
--- /dev/null
+++ b/src/internal/errors.ts
@@ -0,0 +1,33 @@
+// File generated from our OpenAPI spec by Scalar. See README.md for details.
+
+export function isAbortError(err: unknown) {
+ return (
+ typeof err === 'object' &&
+ err !== null &&
+ // Spec-compliant fetch implementations
+ (('name' in err && (err as any).name === 'AbortError') ||
+ // Expo fetch
+ ('message' in err && String((err as any).message).includes('FetchRequestCanceledException')))
+ );
+}
+
+export const castToError = (err: any): Error => {
+ if (err instanceof Error) return err;
+ if (typeof err === 'object' && err !== null) {
+ try {
+ if (Object.prototype.toString.call(err) === '[object Error]') {
+ // @ts-ignore - not all envs have native support for cause yet
+ const error = new Error(err.message, err.cause ? { cause: err.cause } : {});
+ if (err.stack) error.stack = err.stack;
+ // @ts-ignore - not all envs have native support for cause yet
+ if (err.cause && !error.cause) error.cause = err.cause;
+ if (err.name) error.name = err.name;
+ return error;
+ }
+ } catch {}
+ try {
+ return new Error(JSON.stringify(err));
+ } catch {}
+ }
+ return new Error(err);
+};
diff --git a/src/internal/headers.ts b/src/internal/headers.ts
new file mode 100644
index 0000000..411434e
--- /dev/null
+++ b/src/internal/headers.ts
@@ -0,0 +1,97 @@
+// File generated from our OpenAPI spec by Scalar. See README.md for details.
+
+import { isReadonlyArray } from './utils/values';
+
+type HeaderValue = string | undefined | null;
+export type HeadersLike =
+ | Headers
+ | readonly HeaderValue[][]
+ | Record
+ | undefined
+ | null
+ | NullableHeaders;
+
+const brand_privateNullableHeaders = /* @__PURE__ */ Symbol('brand.privateNullableHeaders');
+
+/**
+ * @internal
+ * Users can pass explicit nulls to unset default headers. When we parse them
+ * into a standard headers type we need to preserve that information.
+ */
+export type NullableHeaders = {
+ /** Brand check, prevent users from creating a NullableHeaders. */
+ [brand_privateNullableHeaders]: true;
+ /** Parsed headers. */
+ values: Headers;
+ /** Set of lowercase header names explicitly set to null. */
+ nulls: Set;
+};
+
+function* iterateHeaders(headers: HeadersLike): IterableIterator {
+ if (!headers) return;
+
+ if (brand_privateNullableHeaders in headers) {
+ const { values, nulls } = headers;
+ yield* values.entries();
+ for (const name of nulls) {
+ yield [name, null];
+ }
+ return;
+ }
+
+ let shouldClear = false;
+ let iter: Iterable;
+ if (headers instanceof Headers) {
+ iter = headers.entries();
+ } else if (isReadonlyArray(headers)) {
+ iter = headers;
+ } else {
+ shouldClear = true;
+ iter = Object.entries(headers ?? {});
+ }
+ for (let row of iter) {
+ const name = row[0];
+ if (typeof name !== 'string') throw new TypeError('expected header name to be a string');
+ const values = isReadonlyArray(row[1]) ? row[1] : [row[1]];
+ let didClear = false;
+ for (const value of values) {
+ if (value === undefined) continue;
+
+ // Objects keys always overwrite older headers, they never append.
+ // Yield a null to clear the header before adding the new values.
+ if (shouldClear && !didClear) {
+ didClear = true;
+ yield [name, null];
+ }
+ yield [name, value];
+ }
+ }
+}
+
+export const buildHeaders = (newHeaders: HeadersLike[]): NullableHeaders => {
+ const targetHeaders = new Headers();
+ const nullHeaders = new Set();
+ for (const headers of newHeaders) {
+ const seenHeaders = new Set();
+ for (const [name, value] of iterateHeaders(headers)) {
+ const lowerName = name.toLowerCase();
+ if (!seenHeaders.has(lowerName)) {
+ targetHeaders.delete(name);
+ seenHeaders.add(lowerName);
+ }
+ if (value === null) {
+ targetHeaders.delete(name);
+ nullHeaders.add(lowerName);
+ } else {
+ targetHeaders.append(name, value);
+ nullHeaders.delete(lowerName);
+ }
+ }
+ }
+ return { [brand_privateNullableHeaders]: true, values: targetHeaders, nulls: nullHeaders };
+};
+
+export const isEmptyHeaders = (headers: HeadersLike) => {
+ for (const _ of iterateHeaders(headers)) return false;
+ return true;
+};
diff --git a/src/internal/qs/LICENSE.md b/src/internal/qs/LICENSE.md
new file mode 100644
index 0000000..3fda157
--- /dev/null
+++ b/src/internal/qs/LICENSE.md
@@ -0,0 +1,13 @@
+BSD 3-Clause License
+
+Copyright (c) 2014, Nathan LaFreniere and other [contributors](https://github.com/puruvj/neoqs/graphs/contributors) All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/src/internal/qs/README.md b/src/internal/qs/README.md
new file mode 100644
index 0000000..67ae04e
--- /dev/null
+++ b/src/internal/qs/README.md
@@ -0,0 +1,3 @@
+# qs
+
+This is a vendored version of [neoqs](https://github.com/PuruVJ/neoqs) which is a TypeScript rewrite of [qs](https://github.com/ljharb/qs), a query string library.
diff --git a/src/internal/qs/formats.ts b/src/internal/qs/formats.ts
new file mode 100644
index 0000000..e76a742
--- /dev/null
+++ b/src/internal/qs/formats.ts
@@ -0,0 +1,10 @@
+import type { Format } from './types';
+
+export const default_format: Format = 'RFC3986';
+export const default_formatter = (v: PropertyKey) => String(v);
+export const formatters: Record string> = {
+ RFC1738: (v: PropertyKey) => String(v).replace(/%20/g, '+'),
+ RFC3986: default_formatter,
+};
+export const RFC1738 = 'RFC1738';
+export const RFC3986 = 'RFC3986';
diff --git a/src/internal/qs/index.ts b/src/internal/qs/index.ts
new file mode 100644
index 0000000..c3a3620
--- /dev/null
+++ b/src/internal/qs/index.ts
@@ -0,0 +1,13 @@
+import { default_format, formatters, RFC1738, RFC3986 } from './formats';
+
+const formats = {
+ formatters,
+ RFC1738,
+ RFC3986,
+ default: default_format,
+};
+
+export { stringify } from './stringify';
+export { formats };
+
+export type { DefaultDecoder, DefaultEncoder, Format, ParseOptions, StringifyOptions } from './types';
diff --git a/src/internal/qs/stringify.ts b/src/internal/qs/stringify.ts
new file mode 100644
index 0000000..7e71387
--- /dev/null
+++ b/src/internal/qs/stringify.ts
@@ -0,0 +1,385 @@
+import { encode, is_buffer, maybe_map, has } from './utils';
+import { default_format, default_formatter, formatters } from './formats';
+import type { NonNullableProperties, StringifyOptions } from './types';
+import { isArray } from '../utils/values';
+
+const array_prefix_generators = {
+ brackets(prefix: PropertyKey) {
+ return String(prefix) + '[]';
+ },
+ comma: 'comma',
+ indices(prefix: PropertyKey, key: string) {
+ return String(prefix) + '[' + key + ']';
+ },
+ repeat(prefix: PropertyKey) {
+ return String(prefix);
+ },
+};
+
+const push_to_array = function (arr: any[], value_or_array: any) {
+ Array.prototype.push.apply(arr, isArray(value_or_array) ? value_or_array : [value_or_array]);
+};
+
+let toISOString;
+
+const defaults = {
+ addQueryPrefix: false,
+ allowDots: false,
+ allowEmptyArrays: false,
+ arrayFormat: 'indices',
+ charset: 'utf-8',
+ charsetSentinel: false,
+ delimiter: '&',
+ encode: true,
+ encodeDotInKeys: false,
+ encoder: encode,
+ encodeValuesOnly: false,
+ format: default_format,
+ formatter: default_formatter,
+ /** @deprecated */
+ indices: false,
+ serializeDate(date) {
+ return (toISOString ??= Function.prototype.call.bind(Date.prototype.toISOString))(date);
+ },
+ skipNulls: false,
+ strictNullHandling: false,
+} as NonNullableProperties;
+
+function is_non_nullish_primitive(v: unknown): v is string | number | boolean | symbol | bigint {
+ return (
+ typeof v === 'string' ||
+ typeof v === 'number' ||
+ typeof v === 'boolean' ||
+ typeof v === 'symbol' ||
+ typeof v === 'bigint'
+ );
+}
+
+const sentinel = {};
+
+function inner_stringify(
+ object: any,
+ prefix: PropertyKey,
+ generateArrayPrefix: StringifyOptions['arrayFormat'] | ((prefix: string, key: string) => string),
+ commaRoundTrip: boolean,
+ allowEmptyArrays: boolean,
+ strictNullHandling: boolean,
+ skipNulls: boolean,
+ encodeDotInKeys: boolean,
+ encoder: StringifyOptions['encoder'],
+ filter: StringifyOptions['filter'],
+ sort: StringifyOptions['sort'],
+ allowDots: StringifyOptions['allowDots'],
+ serializeDate: StringifyOptions['serializeDate'],
+ format: StringifyOptions['format'],
+ formatter: StringifyOptions['formatter'],
+ encodeValuesOnly: boolean,
+ charset: StringifyOptions['charset'],
+ sideChannel: WeakMap,
+) {
+ let obj = object;
+
+ let tmp_sc = sideChannel;
+ let step = 0;
+ let find_flag = false;
+ while ((tmp_sc = tmp_sc.get(sentinel)) !== void undefined && !find_flag) {
+ // Where object last appeared in the ref tree
+ const pos = tmp_sc.get(object);
+ step += 1;
+ if (typeof pos !== 'undefined') {
+ if (pos === step) {
+ throw new RangeError('Cyclic object value');
+ } else {
+ find_flag = true; // Break while
+ }
+ }
+ if (typeof tmp_sc.get(sentinel) === 'undefined') {
+ step = 0;
+ }
+ }
+
+ if (typeof filter === 'function') {
+ obj = filter(prefix, obj);
+ } else if (obj instanceof Date) {
+ obj = serializeDate?.(obj);
+ } else if (generateArrayPrefix === 'comma' && isArray(obj)) {
+ obj = maybe_map(obj, function (value) {
+ if (value instanceof Date) {
+ return serializeDate?.(value);
+ }
+ return value;
+ });
+ }
+
+ if (obj === null) {
+ if (strictNullHandling) {
+ return encoder && !encodeValuesOnly ?
+ // @ts-expect-error
+ encoder(prefix, defaults.encoder, charset, 'key', format)
+ : prefix;
+ }
+
+ obj = '';
+ }
+
+ if (is_non_nullish_primitive(obj) || is_buffer(obj)) {
+ if (encoder) {
+ const key_value =
+ encodeValuesOnly ? prefix
+ // @ts-expect-error
+ : encoder(prefix, defaults.encoder, charset, 'key', format);
+ return [
+ formatter?.(key_value) +
+ '=' +
+ // @ts-expect-error
+ formatter?.(encoder(obj, defaults.encoder, charset, 'value', format)),
+ ];
+ }
+ return [formatter?.(prefix) + '=' + formatter?.(String(obj))];
+ }
+
+ const values: string[] = [];
+
+ if (typeof obj === 'undefined') {
+ return values;
+ }
+
+ let obj_keys;
+ if (generateArrayPrefix === 'comma' && isArray(obj)) {
+ // we need to join elements in
+ if (encodeValuesOnly && encoder) {
+ // @ts-expect-error values only
+ obj = maybe_map(obj, encoder);
+ }
+ obj_keys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
+ } else if (isArray(filter)) {
+ obj_keys = filter;
+ } else {
+ const keys = Object.keys(obj);
+ obj_keys = sort ? keys.sort(sort) : keys;
+ }
+
+ const encoded_prefix = encodeDotInKeys ? String(prefix).replace(/\./g, '%2E') : String(prefix);
+
+ const adjusted_prefix =
+ commaRoundTrip && isArray(obj) && obj.length === 1 ? encoded_prefix + '[]' : encoded_prefix;
+
+ if (allowEmptyArrays && isArray(obj) && obj.length === 0) {
+ return adjusted_prefix + '[]';
+ }
+
+ for (let j = 0; j < obj_keys.length; ++j) {
+ const key = obj_keys[j];
+ const value =
+ // @ts-ignore
+ typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key as any];
+
+ if (skipNulls && value === null) {
+ continue;
+ }
+
+ // @ts-ignore
+ const encoded_key = allowDots && encodeDotInKeys ? (key as any).replace(/\./g, '%2E') : key;
+ const key_prefix =
+ isArray(obj) ?
+ typeof generateArrayPrefix === 'function' ?
+ generateArrayPrefix(adjusted_prefix, encoded_key)
+ : adjusted_prefix
+ : adjusted_prefix + (allowDots ? '.' + encoded_key : '[' + encoded_key + ']');
+
+ sideChannel.set(object, step);
+ const valueSideChannel = new WeakMap();
+ valueSideChannel.set(sentinel, sideChannel);
+ push_to_array(
+ values,
+ inner_stringify(
+ value,
+ key_prefix,
+ generateArrayPrefix,
+ commaRoundTrip,
+ allowEmptyArrays,
+ strictNullHandling,
+ skipNulls,
+ encodeDotInKeys,
+ // @ts-ignore
+ generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder,
+ filter,
+ sort,
+ allowDots,
+ serializeDate,
+ format,
+ formatter,
+ encodeValuesOnly,
+ charset,
+ valueSideChannel,
+ ),
+ );
+ }
+
+ return values;
+}
+
+function normalize_stringify_options(
+ opts: StringifyOptions = defaults,
+): NonNullableProperties> & { indices?: boolean } {
+ if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {
+ throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');
+ }
+
+ if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') {
+ throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided');
+ }
+
+ if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
+ throw new TypeError('Encoder has to be a function.');
+ }
+
+ const charset = opts.charset || defaults.charset;
+ if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
+ throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
+ }
+
+ let format = default_format;
+ if (typeof opts.format !== 'undefined') {
+ if (!has(formatters, opts.format)) {
+ throw new TypeError('Unknown format option provided.');
+ }
+ format = opts.format;
+ }
+ const formatter = formatters[format];
+
+ let filter = defaults.filter;
+ if (typeof opts.filter === 'function' || isArray(opts.filter)) {
+ filter = opts.filter;
+ }
+
+ let arrayFormat: StringifyOptions['arrayFormat'];
+ if (opts.arrayFormat && opts.arrayFormat in array_prefix_generators) {
+ arrayFormat = opts.arrayFormat;
+ } else if ('indices' in opts) {
+ arrayFormat = opts.indices ? 'indices' : 'repeat';
+ } else {
+ arrayFormat = defaults.arrayFormat;
+ }
+
+ if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
+ throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
+ }
+
+ const allowDots =
+ typeof opts.allowDots === 'undefined' ?
+ !!opts.encodeDotInKeys === true ?
+ true
+ : defaults.allowDots
+ : !!opts.allowDots;
+
+ return {
+ addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,
+ // @ts-ignore
+ allowDots: allowDots,
+ allowEmptyArrays:
+ typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
+ arrayFormat: arrayFormat,
+ charset: charset,
+ charsetSentinel:
+ typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
+ commaRoundTrip: !!opts.commaRoundTrip,
+ delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,
+ encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,
+ encodeDotInKeys:
+ typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults.encodeDotInKeys,
+ encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,
+ encodeValuesOnly:
+ typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,
+ filter: filter,
+ format: format,
+ formatter: formatter,
+ serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate,
+ skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls,
+ // @ts-ignore
+ sort: typeof opts.sort === 'function' ? opts.sort : null,
+ strictNullHandling:
+ typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling,
+ };
+}
+
+export function stringify(object: any, opts: StringifyOptions = {}) {
+ let obj = object;
+ const options = normalize_stringify_options(opts);
+
+ let obj_keys: PropertyKey[] | undefined;
+ let filter;
+
+ if (typeof options.filter === 'function') {
+ filter = options.filter;
+ obj = filter('', obj);
+ } else if (isArray(options.filter)) {
+ filter = options.filter;
+ obj_keys = filter;
+ }
+
+ const keys: string[] = [];
+
+ if (typeof obj !== 'object' || obj === null) {
+ return '';
+ }
+
+ const generateArrayPrefix = array_prefix_generators[options.arrayFormat];
+ const commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip;
+
+ if (!obj_keys) {
+ obj_keys = Object.keys(obj);
+ }
+
+ if (options.sort) {
+ obj_keys.sort(options.sort);
+ }
+
+ const sideChannel = new WeakMap();
+ for (let i = 0; i < obj_keys.length; ++i) {
+ const key = obj_keys[i]!;
+
+ if (options.skipNulls && obj[key] === null) {
+ continue;
+ }
+ push_to_array(
+ keys,
+ inner_stringify(
+ obj[key],
+ key,
+ // @ts-expect-error
+ generateArrayPrefix,
+ commaRoundTrip,
+ options.allowEmptyArrays,
+ options.strictNullHandling,
+ options.skipNulls,
+ options.encodeDotInKeys,
+ options.encode ? options.encoder : null,
+ options.filter,
+ options.sort,
+ options.allowDots,
+ options.serializeDate,
+ options.format,
+ options.formatter,
+ options.encodeValuesOnly,
+ options.charset,
+ sideChannel,
+ ),
+ );
+ }
+
+ const joined = keys.join(options.delimiter);
+ let prefix = options.addQueryPrefix === true ? '?' : '';
+
+ if (options.charsetSentinel) {
+ if (options.charset === 'iso-8859-1') {
+ // encodeURIComponent('✓'), the "numeric entity" representation of a checkmark
+ prefix += 'utf8=%26%2310003%3B&';
+ } else {
+ // encodeURIComponent('✓')
+ prefix += 'utf8=%E2%9C%93&';
+ }
+ }
+
+ return joined.length > 0 ? prefix + joined : '';
+}
diff --git a/src/internal/qs/types.ts b/src/internal/qs/types.ts
new file mode 100644
index 0000000..7c28dbb
--- /dev/null
+++ b/src/internal/qs/types.ts
@@ -0,0 +1,71 @@
+export type Format = 'RFC1738' | 'RFC3986';
+
+export type DefaultEncoder = (str: any, defaultEncoder?: any, charset?: string) => string;
+export type DefaultDecoder = (str: string, decoder?: any, charset?: string) => string;
+
+export type BooleanOptional = boolean | undefined;
+
+export type StringifyBaseOptions = {
+ delimiter?: string;
+ allowDots?: boolean;
+ encodeDotInKeys?: boolean;
+ strictNullHandling?: boolean;
+ skipNulls?: boolean;
+ encode?: boolean;
+ encoder?: (
+ str: any,
+ defaultEncoder: DefaultEncoder,
+ charset: string,
+ type: 'key' | 'value',
+ format?: Format,
+ ) => string;
+ filter?: Array | ((prefix: PropertyKey, value: any) => any);
+ arrayFormat?: 'indices' | 'brackets' | 'repeat' | 'comma';
+ indices?: boolean;
+ sort?: ((a: PropertyKey, b: PropertyKey) => number) | null;
+ serializeDate?: (d: Date) => string;
+ format?: 'RFC1738' | 'RFC3986';
+ formatter?: (str: PropertyKey) => string;
+ encodeValuesOnly?: boolean;
+ addQueryPrefix?: boolean;
+ charset?: 'utf-8' | 'iso-8859-1';
+ charsetSentinel?: boolean;
+ allowEmptyArrays?: boolean;
+ commaRoundTrip?: boolean;
+};
+
+export type StringifyOptions = StringifyBaseOptions;
+
+export type ParseBaseOptions = {
+ comma?: boolean;
+ delimiter?: string | RegExp;
+ depth?: number | false;
+ decoder?: (str: string, defaultDecoder: DefaultDecoder, charset: string, type: 'key' | 'value') => any;
+ arrayLimit?: number;
+ parseArrays?: boolean;
+ plainObjects?: boolean;
+ allowPrototypes?: boolean;
+ allowSparse?: boolean;
+ parameterLimit?: number;
+ strictDepth?: boolean;
+ strictNullHandling?: boolean;
+ ignoreQueryPrefix?: boolean;
+ charset?: 'utf-8' | 'iso-8859-1';
+ charsetSentinel?: boolean;
+ interpretNumericEntities?: boolean;
+ allowEmptyArrays?: boolean;
+ duplicates?: 'combine' | 'first' | 'last';
+ allowDots?: boolean;
+ decodeDotInKeys?: boolean;
+};
+
+export type ParseOptions = ParseBaseOptions;
+
+export type ParsedQs = {
+ [key: string]: undefined | string | string[] | ParsedQs | ParsedQs[];
+};
+
+// Type to remove null or undefined union from each property
+export type NonNullableProperties = {
+ [K in keyof T]-?: Exclude;
+};
diff --git a/src/internal/qs/utils.ts b/src/internal/qs/utils.ts
new file mode 100644
index 0000000..4cd5657
--- /dev/null
+++ b/src/internal/qs/utils.ts
@@ -0,0 +1,265 @@
+import { RFC1738 } from './formats';
+import type { DefaultEncoder, Format } from './types';
+import { isArray } from '../utils/values';
+
+export let has = (obj: object, key: PropertyKey): boolean => (
+ (has = (Object as any).hasOwn ?? Function.prototype.call.bind(Object.prototype.hasOwnProperty)),
+ has(obj, key)
+);
+
+const hex_table = /* @__PURE__ */ (() => {
+ const array = [];
+ for (let i = 0; i < 256; ++i) {
+ array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
+ }
+
+ return array;
+})();
+
+function compact_queue>(queue: Array<{ obj: T; prop: string }>) {
+ while (queue.length > 1) {
+ const item = queue.pop();
+ if (!item) continue;
+
+ const obj = item.obj[item.prop];
+
+ if (isArray(obj)) {
+ const compacted: unknown[] = [];
+
+ for (let j = 0; j < obj.length; ++j) {
+ if (typeof obj[j] !== 'undefined') {
+ compacted.push(obj[j]);
+ }
+ }
+
+ // @ts-ignore
+ item.obj[item.prop] = compacted;
+ }
+ }
+}
+
+function array_to_object(source: any[], options: { plainObjects: boolean }) {
+ const obj = options && options.plainObjects ? Object.create(null) : {};
+ for (let i = 0; i < source.length; ++i) {
+ if (typeof source[i] !== 'undefined') {
+ obj[i] = source[i];
+ }
+ }
+
+ return obj;
+}
+
+export function merge(
+ target: any,
+ source: any,
+ options: { plainObjects?: boolean; allowPrototypes?: boolean } = {},
+) {
+ if (!source) {
+ return target;
+ }
+
+ if (typeof source !== 'object') {
+ if (isArray(target)) {
+ target.push(source);
+ } else if (target && typeof target === 'object') {
+ if ((options && (options.plainObjects || options.allowPrototypes)) || !has(Object.prototype, source)) {
+ target[source] = true;
+ }
+ } else {
+ return [target, source];
+ }
+
+ return target;
+ }
+
+ if (!target || typeof target !== 'object') {
+ return [target].concat(source);
+ }
+
+ let mergeTarget = target;
+ if (isArray(target) && !isArray(source)) {
+ // @ts-ignore
+ mergeTarget = array_to_object(target, options);
+ }
+
+ if (isArray(target) && isArray(source)) {
+ source.forEach(function (item, i) {
+ if (has(target, i)) {
+ const targetItem = target[i];
+ if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {
+ target[i] = merge(targetItem, item, options);
+ } else {
+ target.push(item);
+ }
+ } else {
+ target[i] = item;
+ }
+ });
+ return target;
+ }
+
+ return Object.keys(source).reduce(function (acc, key) {
+ const value = source[key];
+
+ if (has(acc, key)) {
+ acc[key] = merge(acc[key], value, options);
+ } else {
+ acc[key] = value;
+ }
+ return acc;
+ }, mergeTarget);
+}
+
+export function assign_single_source(target: any, source: any) {
+ return Object.keys(source).reduce(function (acc, key) {
+ acc[key] = source[key];
+ return acc;
+ }, target);
+}
+
+export function decode(str: string, _: any, charset: string) {
+ const strWithoutPlus = str.replace(/\+/g, ' ');
+ if (charset === 'iso-8859-1') {
+ // unescape never throws, no try...catch needed:
+ return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
+ }
+ // utf-8
+ try {
+ return decodeURIComponent(strWithoutPlus);
+ } catch (e) {
+ return strWithoutPlus;
+ }
+}
+
+const limit = 1024;
+
+export const encode: (
+ str: any,
+ defaultEncoder: DefaultEncoder,
+ charset: string,
+ type: 'key' | 'value',
+ format: Format,
+) => string = (str, _defaultEncoder, charset, _kind, format: Format) => {
+ // This code was originally written by Brian White for the io.js core querystring library.
+ // It has been adapted here for stricter adherence to RFC 3986
+ if (str.length === 0) {
+ return str;
+ }
+
+ let string = str;
+ if (typeof str === 'symbol') {
+ string = Symbol.prototype.toString.call(str);
+ } else if (typeof str !== 'string') {
+ string = String(str);
+ }
+
+ if (charset === 'iso-8859-1') {
+ return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {
+ return '%26%23' + parseInt($0.slice(2), 16) + '%3B';
+ });
+ }
+
+ let out = '';
+ for (let j = 0; j < string.length; j += limit) {
+ const segment = string.length >= limit ? string.slice(j, j + limit) : string;
+ const arr = [];
+
+ for (let i = 0; i < segment.length; ++i) {
+ let c = segment.charCodeAt(i);
+ if (
+ c === 0x2d || // -
+ c === 0x2e || // .
+ c === 0x5f || // _
+ c === 0x7e || // ~
+ (c >= 0x30 && c <= 0x39) || // 0-9
+ (c >= 0x41 && c <= 0x5a) || // a-z
+ (c >= 0x61 && c <= 0x7a) || // A-Z
+ (format === RFC1738 && (c === 0x28 || c === 0x29)) // ( )
+ ) {
+ arr[arr.length] = segment.charAt(i);
+ continue;
+ }
+
+ if (c < 0x80) {
+ arr[arr.length] = hex_table[c];
+ continue;
+ }
+
+ if (c < 0x800) {
+ arr[arr.length] = hex_table[0xc0 | (c >> 6)]! + hex_table[0x80 | (c & 0x3f)];
+ continue;
+ }
+
+ if (c < 0xd800 || c >= 0xe000) {
+ arr[arr.length] =
+ hex_table[0xe0 | (c >> 12)]! + hex_table[0x80 | ((c >> 6) & 0x3f)] + hex_table[0x80 | (c & 0x3f)];
+ continue;
+ }
+
+ i += 1;
+ c = 0x10000 + (((c & 0x3ff) << 10) | (segment.charCodeAt(i) & 0x3ff));
+
+ arr[arr.length] =
+ hex_table[0xf0 | (c >> 18)]! +
+ hex_table[0x80 | ((c >> 12) & 0x3f)] +
+ hex_table[0x80 | ((c >> 6) & 0x3f)] +
+ hex_table[0x80 | (c & 0x3f)];
+ }
+
+ out += arr.join('');
+ }
+
+ return out;
+};
+
+export function compact(value: any) {
+ const queue = [{ obj: { o: value }, prop: 'o' }];
+ const refs = [];
+
+ for (let i = 0; i < queue.length; ++i) {
+ const item = queue[i];
+ // @ts-ignore
+ const obj = item.obj[item.prop];
+
+ const keys = Object.keys(obj);
+ for (let j = 0; j < keys.length; ++j) {
+ const key = keys[j]!;
+ const val = obj[key];
+ if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
+ queue.push({ obj: obj, prop: key });
+ refs.push(val);
+ }
+ }
+ }
+
+ compact_queue(queue);
+
+ return value;
+}
+
+export function is_regexp(obj: any) {
+ return Object.prototype.toString.call(obj) === '[object RegExp]';
+}
+
+export function is_buffer(obj: any) {
+ if (!obj || typeof obj !== 'object') {
+ return false;
+ }
+
+ return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
+}
+
+export function combine(a: any, b: any) {
+ return [].concat(a, b);
+}
+
+export function maybe_map(val: T[], fn: (v: T) => T) {
+ if (isArray(val)) {
+ const mapped = [];
+ for (let i = 0; i < val.length; i += 1) {
+ mapped.push(fn(val[i]!));
+ }
+ return mapped;
+ }
+ return fn(val);
+}
diff --git a/src/internal/request-options.ts b/src/internal/request-options.ts
new file mode 100644
index 0000000..4dc4258
--- /dev/null
+++ b/src/internal/request-options.ts
@@ -0,0 +1,39 @@
+// File generated from our OpenAPI spec by Scalar. See README.md for details.
+
+import type { BodyInit } from './builtin-types';
+import type { HTTPMethod, MergedRequestInit } from './types';
+import type { HeadersLike, NullableHeaders } from './headers';
+
+export type RequestOptions = {
+ method?: HTTPMethod | undefined;
+ path?: string | undefined;
+ headers?: HeadersLike | undefined;
+ query?: object | undefined | null;
+ body?: unknown;
+ timeout?: number | undefined;
+ maxRetries?: number | undefined;
+ stream?: boolean | undefined;
+ signal?: AbortSignal | undefined | null;
+ fetchOptions?: MergedRequestInit | undefined;
+ idempotencyKey?: string | undefined;
+ defaultBaseURL?: string | undefined;
+ __binaryResponse?: boolean | undefined;
+};
+
+export type FinalRequestOptions = RequestOptions & {
+ method: HTTPMethod;
+ path: string;
+};
+
+export type EncodedContent = { bodyHeaders: HeadersLike; body: BodyInit };
+export type RequestEncoder = (request: { headers: NullableHeaders; body: unknown }) => EncodedContent;
+
+/** Fallback JSON encoder used when a request body is not already a fetch body type. */
+export const FallbackEncoder: RequestEncoder = ({ body }) => {
+ return {
+ bodyHeaders: {
+ 'content-type': 'application/json',
+ },
+ body: JSON.stringify(body),
+ };
+};
diff --git a/src/internal/shim-types.ts b/src/internal/shim-types.ts
new file mode 100644
index 0000000..6d992a5
--- /dev/null
+++ b/src/internal/shim-types.ts
@@ -0,0 +1,26 @@
+// File generated from our OpenAPI spec by Scalar. See README.md for details.
+
+/**
+ * Shims for types that we can't always rely on being available globally.
+ *
+ * Note: these only exist at the type-level, there is no corresponding runtime
+ * version for any of these symbols.
+ */
+
+type NeverToAny = T extends never ? any : T;
+
+/** @ts-ignore */
+type _DOMReadableStream = globalThis.ReadableStream;
+
+/** @ts-ignore */
+type _NodeReadableStream = import('stream/web').ReadableStream;
+
+type _ConditionalNodeReadableStream =
+ typeof globalThis extends { ReadableStream: any } ? never : _NodeReadableStream;
+
+type _ReadableStream = NeverToAny<
+ | ([0] extends [1 & _DOMReadableStream] ? never : _DOMReadableStream)
+ | ([0] extends [1 & _ConditionalNodeReadableStream] ? never : _ConditionalNodeReadableStream)
+>;
+
+export type { _ReadableStream as ReadableStream };
diff --git a/src/internal/shims.ts b/src/internal/shims.ts
new file mode 100644
index 0000000..90addd4
--- /dev/null
+++ b/src/internal/shims.ts
@@ -0,0 +1,107 @@
+// File generated from our OpenAPI spec by Scalar. See README.md for details.
+
+/**
+ * This module provides internal shims and utility functions for environments where certain Node.js or global types may not be available.
+ *
+ * These are used to ensure we can provide a consistent behaviour between different JavaScript environments and good error
+ * messages in cases where an environment isn't fully supported.
+ */
+
+import type { Fetch } from './builtin-types';
+import type { ReadableStream } from './shim-types';
+
+export function getDefaultFetch(): Fetch {
+ if (typeof fetch !== 'undefined') {
+ return fetch as any;
+ }
+
+ throw new Error(
+ '`fetch` is not defined as a global; Either pass `fetch` to the client, `new ScalarAPI({ fetch })` or polyfill the global, `globalThis.fetch = fetch`',
+ );
+}
+
+type ReadableStreamArgs = ConstructorParameters;
+
+export function makeReadableStream(...args: ReadableStreamArgs): ReadableStream {
+ const ReadableStream = (globalThis as any).ReadableStream;
+ if (typeof ReadableStream === 'undefined') {
+ // Note: All of the platforms / runtimes we officially support already define
+ // `ReadableStream` as a global, so this should only ever be hit on unsupported runtimes.
+ throw new Error(
+ '`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`',
+ );
+ }
+
+ return new ReadableStream(...args);
+}
+
+export function ReadableStreamFrom(iterable: Iterable | AsyncIterable): ReadableStream {
+ let iter: AsyncIterator | Iterator =
+ Symbol.asyncIterator in iterable ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator]();
+
+ return makeReadableStream({
+ start() {},
+ async pull(controller: any) {
+ const { done, value } = await iter.next();
+ if (done) {
+ controller.close();
+ } else {
+ controller.enqueue(value);
+ }
+ },
+ async cancel() {
+ await iter.return?.();
+ },
+ });
+}
+
+/**
+ * Most browsers don't yet have async iterable support for ReadableStream,
+ * and Node has a very different way of reading bytes from its "ReadableStream".
+ *
+ * This polyfill was pulled from https://github.com/MattiasBuelens/web-streams-polyfill/pull/122#issuecomment-1627354490
+ */
+export function ReadableStreamToAsyncIterable(stream: any): AsyncIterableIterator {
+ if (stream[Symbol.asyncIterator]) return stream;
+
+ const reader = stream.getReader();
+ return {
+ async next() {
+ try {
+ const result = await reader.read();
+ if (result?.done) reader.releaseLock(); // release lock when stream becomes closed
+ return result;
+ } catch (e) {
+ reader.releaseLock(); // release lock when stream becomes errored
+ throw e;
+ }
+ },
+ async return() {
+ const cancelPromise = reader.cancel();
+ reader.releaseLock();
+ await cancelPromise;
+ return { done: true, value: undefined };
+ },
+ [Symbol.asyncIterator]() {
+ return this;
+ },
+ };
+}
+
+/**
+ * Cancels a ReadableStream we don't need to consume.
+ * See https://undici.nodejs.org/#/?id=garbage-collection
+ */
+export async function CancelReadableStream(stream: any): Promise {
+ if (stream === null || typeof stream !== 'object') return;
+
+ if (stream[Symbol.asyncIterator]) {
+ await stream[Symbol.asyncIterator]().return?.();
+ return;
+ }
+
+ const reader = stream.getReader();
+ const cancelPromise = reader.cancel();
+ reader.releaseLock();
+ await cancelPromise;
+}
diff --git a/src/internal/to-file.ts b/src/internal/to-file.ts
new file mode 100644
index 0000000..30eada3
--- /dev/null
+++ b/src/internal/to-file.ts
@@ -0,0 +1,154 @@
+import { BlobPart, getName, makeFile, isAsyncIterable } from './uploads';
+import type { FilePropertyBag } from './builtin-types';
+import { checkFileSupport } from './uploads';
+
+type BlobLikePart = string | ArrayBuffer | ArrayBufferView | BlobLike | DataView;
+
+/**
+ * Intended to match DOM Blob, node-fetch Blob, node:buffer Blob, etc.
+ * Don't add arrayBuffer here, node-fetch doesn't have it
+ */
+interface BlobLike {
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/size) */
+ readonly size: number;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/type) */
+ readonly type: string;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) */
+ text(): Promise;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) */
+ slice(start?: number, end?: number): BlobLike;
+}
+
+/**
+ * This check adds the arrayBuffer() method type because it is available and used at runtime
+ */
+const isBlobLike = (value: any): value is BlobLike & { arrayBuffer(): Promise } =>
+ value != null &&
+ typeof value === 'object' &&
+ typeof value.size === 'number' &&
+ typeof value.type === 'string' &&
+ typeof value.text === 'function' &&
+ typeof value.slice === 'function' &&
+ typeof value.arrayBuffer === 'function';
+
+/**
+ * Intended to match DOM File, node:buffer File, undici File, etc.
+ */
+interface FileLike extends BlobLike {
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified) */
+ readonly lastModified: number;
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name) */
+ readonly name?: string | undefined;
+}
+
+/**
+ * This check adds the arrayBuffer() method type because it is available and used at runtime
+ */
+const isFileLike = (value: any): value is FileLike & { arrayBuffer(): Promise } =>
+ value != null &&
+ typeof value === 'object' &&
+ typeof value.name === 'string' &&
+ typeof value.lastModified === 'number' &&
+ isBlobLike(value);
+
+/**
+ * Intended to match DOM Response, node-fetch Response, undici Response, etc.
+ */
+export interface ResponseLike {
+ url: string;
+ blob(): Promise;
+}
+
+const isResponseLike = (value: any): value is ResponseLike =>
+ value != null &&
+ typeof value === 'object' &&
+ typeof value.url === 'string' &&
+ typeof value.blob === 'function';
+
+export type ToFileInput =
+ | FileLike
+ | ResponseLike
+ | Exclude
+ | AsyncIterable;
+
+/**
+ * Helper for creating a {@link File} to pass to an SDK upload method from a variety of different data formats
+ * @param value the raw content of the file. Can be an {@link Uploadable}, BlobLikePart, or AsyncIterable of BlobLikeParts
+ * @param {string=} name the name of the file. If omitted, toFile will try to determine a file name from bits if possible
+ * @param {Object=} options additional properties
+ * @param {string=} options.type the MIME type of the content
+ * @param {number=} options.lastModified the last modified timestamp
+ * @returns a {@link File} with the given properties
+ */
+export async function toFile(
+ value: ToFileInput | PromiseLike,
+ name?: string | null | undefined,
+ options?: FilePropertyBag | undefined,
+): Promise {
+ checkFileSupport();
+
+ // If it's a promise, resolve it.
+ value = await value;
+
+ // If we've been given a `File` we don't need to do anything
+ if (isFileLike(value)) {
+ if (value instanceof File) {
+ return value;
+ }
+ return makeFile([await value.arrayBuffer()], value.name);
+ }
+
+ if (isResponseLike(value)) {
+ const blob = await value.blob();
+ name ||= new URL(value.url).pathname.split(/[\\/]/).pop();
+
+ return makeFile(await getBytes(blob), name, options);
+ }
+
+ const parts = await getBytes(value);
+
+ name ||= getName(value);
+
+ if (!options?.type) {
+ const type = parts.find((part) => typeof part === 'object' && 'type' in part && part.type);
+ if (typeof type === 'string') {
+ options = { ...options, type };
+ }
+ }
+
+ return makeFile(parts, name, options);
+}
+
+async function getBytes(value: BlobLikePart | AsyncIterable): Promise> {
+ let parts: Array = [];
+ if (
+ typeof value === 'string' ||
+ ArrayBuffer.isView(value) || // includes Uint8Array, Buffer, etc.
+ value instanceof ArrayBuffer
+ ) {
+ parts.push(value);
+ } else if (isBlobLike(value)) {
+ parts.push(value instanceof Blob ? value : await value.arrayBuffer());
+ } else if (
+ isAsyncIterable(value) // includes Readable, ReadableStream, etc.
+ ) {
+ for await (const chunk of value) {
+ parts.push(...(await getBytes(chunk as BlobLikePart))); // TODO, consider validating?
+ }
+ } else {
+ const constructor = value?.constructor?.name;
+ throw new Error(
+ `Unexpected data type: ${typeof value}${
+ constructor ? `; constructor: ${constructor}` : ''
+ }${propsForError(value)}`,
+ );
+ }
+
+ return parts;
+}
+
+function propsForError(value: unknown): string {
+ if (typeof value !== 'object' || value === null) return '';
+ const props = Object.getOwnPropertyNames(value);
+ return `; props: [${props.map((p) => `"${p}"`).join(', ')}]`;
+}
diff --git a/src/internal/types.ts b/src/internal/types.ts
new file mode 100644
index 0000000..93a4f5a
--- /dev/null
+++ b/src/internal/types.ts
@@ -0,0 +1,93 @@
+// File generated from our OpenAPI spec by Scalar. See README.md for details.
+
+export type PromiseOrValue = T | Promise;
+export type HTTPMethod = 'get' | 'post' | 'put' | 'patch' | 'delete';
+
+export type KeysEnum = { [P in keyof Required]: true };
+
+export type FinalizedRequestInit = RequestInit & { headers: Headers };
+
+type NotAny = [0] extends [1 & T] ? never : T;
+
+/**
+ * Some environments overload the global fetch function, and Parameters only gets the last signature.
+ */
+type OverloadedParameters =
+ T extends (
+ {
+ (...args: infer A): unknown;
+ (...args: infer B): unknown;
+ (...args: infer C): unknown;
+ (...args: infer D): unknown;
+ }
+ ) ?
+ A | B | C | D
+ : T extends (
+ {
+ (...args: infer A): unknown;
+ (...args: infer B): unknown;
+ (...args: infer C): unknown;
+ }
+ ) ?
+ A | B | C
+ : T extends (
+ {
+ (...args: infer A): unknown;
+ (...args: infer B): unknown;
+ }
+ ) ?
+ A | B
+ : T extends (...args: infer A) => unknown ? A
+ : never;
+
+/**
+ * These imports attempt to get types from a parent package's dependencies.
+ * Unresolved bare specifiers can trigger [automatic type acquisition][1] in some projects, which
+ * would cause typescript to show types not present at runtime. To avoid this, we import
+ * directly from parent node_modules folders.
+ *
+ * We need to check multiple levels because we don't know what directory structure we'll be in.
+ * For example, pnpm generates directories like this:
+ * ```
+ * node_modules
+ * ├── .pnpm
+ * │ └── pkg@1.0.0
+ * │ └── node_modules
+ * │ └── pkg
+ * │ └── internal
+ * │ └── types.d.ts
+ * ├── pkg -> .pnpm/pkg@1.0.0/node_modules/pkg
+ * └── undici
+ * ```
+ *
+ * [1]: https://www.typescriptlang.org/tsconfig/#typeAcquisition
+ */
+/** @ts-ignore For users with \@types/node */ /* prettier-ignore */
+type UndiciTypesRequestInit = NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny;
+/** @ts-ignore For users with undici */ /* prettier-ignore */
+type UndiciRequestInit = NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny;
+/** @ts-ignore For users with \@types/bun */ /* prettier-ignore */
+type BunRequestInit = globalThis.FetchRequestInit;
+/** @ts-ignore For users with node-fetch@2 */ /* prettier-ignore */
+type NodeFetch2RequestInit = NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny;
+/** @ts-ignore For users with node-fetch@3, doesn't need file extension because types are at ./@types/index.d.ts */ /* prettier-ignore */
+type NodeFetch3RequestInit = NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny;
+/** @ts-ignore For users who use Deno */ /* prettier-ignore */
+type FetchRequestInit = NonNullable[1]>;
+
+type RequestInits =
+ | NotAny
+ | NotAny
+ | NotAny
+ | NotAny
+ | NotAny
+ | NotAny
+ | NotAny;
+
+/**
+ * This type contains `RequestInit` options that may be available on the current runtime,
+ * including per-platform extensions like `dispatcher`, `agent`, `client`, etc.
+ */
+export type MergedRequestInit = RequestInits &
+ /** We don't include these in the types as they'll be overridden for every request. */
+ Partial>;
diff --git a/src/internal/uploads.ts b/src/internal/uploads.ts
new file mode 100644
index 0000000..b1ab230
--- /dev/null
+++ b/src/internal/uploads.ts
@@ -0,0 +1,197 @@
+import { type RequestOptions } from './request-options';
+import type { FilePropertyBag, Fetch } from './builtin-types';
+import type { ScalarAPI } from '../client';
+import { ReadableStreamFrom } from './shims';
+
+export type BlobPart = string | ArrayBuffer | ArrayBufferView | Blob | DataView;
+type FsReadStream = AsyncIterable & { path: string | { toString(): string } };
+
+// https://github.com/oven-sh/bun/issues/5980
+interface BunFile extends Blob {
+ readonly name?: string | undefined;
+}
+
+export const checkFileSupport = () => {
+ if (typeof File === 'undefined') {
+ const { process } = globalThis as any;
+ const isOldNode =
+ typeof process?.versions?.node === 'string' && parseInt(process.versions.node.split('.')) < 20;
+ throw new Error(
+ '`File` is not defined as a global, which is required for file uploads.' +
+ (isOldNode ?
+ " Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`."
+ : ''),
+ );
+ }
+};
+
+/**
+ * Typically, this is a native "File" class.
+ *
+ * We provide the {@link toFile} utility to convert a variety of objects
+ * into the File class.
+ *
+ * For convenience, you can also pass a fetch Response, or in Node,
+ * the result of fs.createReadStream().
+ */
+export type Uploadable = Blob | File | Response | FsReadStream | BunFile;
+
+/**
+ * Construct a `File` instance. This is used to ensure a helpful error is thrown
+ * for environments that don't define a global `File` yet.
+ */
+export function makeFile(
+ fileBits: BlobPart[],
+ fileName: string | undefined,
+ options?: FilePropertyBag,
+): File {
+ checkFileSupport();
+ return new File(fileBits as any, fileName ?? 'unknown_file', options);
+}
+
+export function getName(value: any): string | undefined {
+ return (
+ (
+ (typeof value === 'object' &&
+ value !== null &&
+ (('name' in value && value.name && String(value.name)) ||
+ ('url' in value && value.url && String(value.url)) ||
+ ('filename' in value && value.filename && String(value.filename)) ||
+ ('path' in value && value.path && String(value.path)))) ||
+ ''
+ )
+ .split(/[\\/]/)
+ .pop() || undefined
+ );
+}
+
+export const isAsyncIterable = (value: any): value is AsyncIterable =>
+ value != null && typeof value === 'object' && typeof value[Symbol.asyncIterator] === 'function';
+
+/**
+ * Returns a multipart/form-data request if any part of the given request body contains a File / Blob value.
+ * Otherwise returns the request as is.
+ */
+export const maybeMultipartFormRequestOptions = async (
+ opts: RequestOptions,
+ fetch: ScalarAPI | Fetch,
+): Promise => {
+ if (!hasUploadableValue(opts.body)) return opts;
+
+ return { ...opts, body: await createForm(opts.body, fetch) };
+};
+
+type MultipartFormRequestOptions = Omit & { body: unknown };
+
+export const multipartFormRequestOptions = async (
+ opts: MultipartFormRequestOptions,
+ fetch: ScalarAPI | Fetch,
+): Promise => {
+ return { ...opts, body: await createForm(opts.body, fetch) };
+};
+
+const supportsFormDataMap = /* @__PURE__ */ new WeakMap>();
+
+/**
+ * node-fetch doesn't support the global FormData object in recent node versions. Instead of sending
+ * properly-encoded form data, it just stringifies the object, resulting in a request body of "[object FormData]".
+ * This function detects if the fetch function provided supports the global FormData object to avoid
+ * confusing error messages later on.
+ */
+function supportsFormData(fetchObject: ScalarAPI | Fetch): Promise {
+ const fetch: Fetch = typeof fetchObject === 'function' ? fetchObject : (fetchObject as any).fetch;
+ const cached = supportsFormDataMap.get(fetch);
+ if (cached) return cached;
+ const promise = (async () => {
+ try {
+ const FetchResponse = (
+ 'Response' in fetch ?
+ fetch.Response
+ : (await fetch('data:,')).constructor) as typeof Response;
+ const data = new FormData();
+ if (data.toString() === (await new FetchResponse(data).text())) {
+ return false;
+ }
+ return true;
+ } catch {
+ // avoid false negatives
+ return true;
+ }
+ })();
+ supportsFormDataMap.set(fetch, promise);
+ return promise;
+}
+
+export const createForm = async >(
+ body: T | undefined,
+ fetch: ScalarAPI | Fetch,
+): Promise => {
+ if (!(await supportsFormData(fetch))) {
+ throw new TypeError(
+ 'The provided fetch function does not support file uploads with the current global FormData class.',
+ );
+ }
+ const form = new FormData();
+ if (isUploadable(body)) {
+ // Multipart schemas can describe the whole request body as a single binary part.
+ await addFormValue(form, 'body', body);
+ return form;
+ }
+ await Promise.all(Object.entries(body || {}).map(([key, value]) => addFormValue(form, key, value)));
+ return form;
+};
+
+// We check for Blob not File because Bun.File doesn't inherit from File,
+// but they both inherit from Blob and have a `name` property at runtime.
+const isBlob = (value: unknown): value is Blob => value instanceof Blob;
+
+const isUploadable = (value: unknown) =>
+ typeof value === 'object' &&
+ value !== null &&
+ (value instanceof Response || isAsyncIterable(value) || isBlob(value));
+
+const hasUploadableValue = (value: unknown): boolean => {
+ if (isUploadable(value)) return true;
+ if (Array.isArray(value)) return value.some(hasUploadableValue);
+ if (value && typeof value === 'object') {
+ for (const k in value) {
+ if (hasUploadableValue((value as any)[k])) return true;
+ }
+ }
+ return false;
+};
+
+const addFormValue = async (form: FormData, key: string, value: unknown): Promise => {
+ if (value === undefined) return;
+ if (value == null) {
+ throw new TypeError(
+ `Received null for "${key}"; to pass null in FormData, you must use the string 'null'`,
+ );
+ }
+
+ // TODO: make nested formats configurable
+ if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
+ form.append(key, String(value));
+ } else if (value instanceof Response) {
+ form.append(key, makeFile([await value.blob()], getName(value)));
+ } else if (isAsyncIterable(value)) {
+ form.append(key, makeFile([await new Response(ReadableStreamFrom(value)).blob()], getName(value)));
+ } else if (isBlob(value)) {
+ const name = getName(value);
+ if (name === undefined) {
+ form.append(key, value);
+ } else {
+ form.append(key, value, name);
+ }
+ } else if (Array.isArray(value)) {
+ await Promise.all(value.map((entry) => addFormValue(form, key + '[]', entry)));
+ } else if (typeof value === 'object') {
+ await Promise.all(
+ Object.entries(value).map(([name, prop]) => addFormValue(form, `${key}[${name}]`, prop)),
+ );
+ } else {
+ throw new TypeError(
+ `Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${value} instead`,
+ );
+ }
+};
diff --git a/src/internal/utils/env.ts b/src/internal/utils/env.ts
new file mode 100644
index 0000000..6212168
--- /dev/null
+++ b/src/internal/utils/env.ts
@@ -0,0 +1,18 @@
+// File generated from our OpenAPI spec by Scalar. See README.md for details.
+
+/**
+ * Read an environment variable.
+ *
+ * Trims beginning and trailing whitespace.
+ *
+ * Will return undefined if the environment variable doesn't exist or cannot be accessed.
+ */
+export const readEnv = (env: string): string | undefined => {
+ if (typeof (globalThis as any).process !== 'undefined') {
+ return (globalThis as any).process.env?.[env]?.trim() || undefined;
+ }
+ if (typeof (globalThis as any).Deno !== 'undefined') {
+ return (globalThis as any).Deno.env?.get?.(env)?.trim() || undefined;
+ }
+ return undefined;
+};
diff --git a/src/internal/utils/log.ts b/src/internal/utils/log.ts
new file mode 100644
index 0000000..66df389
--- /dev/null
+++ b/src/internal/utils/log.ts
@@ -0,0 +1,128 @@
+// File generated from our OpenAPI spec by Scalar. See README.md for details.
+
+import { hasOwn } from './values';
+import { type ScalarAPI } from '../../client';
+import { RequestOptions } from '../request-options';
+
+type LogFn = (message: string, ...rest: unknown[]) => void;
+export type Logger = {
+ error: LogFn;
+ warn: LogFn;
+ info: LogFn;
+ debug: LogFn;
+};
+export type LogLevel = 'off' | 'error' | 'warn' | 'info' | 'debug';
+
+const levelNumbers = {
+ off: 0,
+ error: 200,
+ warn: 300,
+ info: 400,
+ debug: 500,
+};
+
+export const parseLogLevel = (
+ maybeLevel: string | undefined,
+ sourceName: string,
+ client: ScalarAPI,
+): LogLevel | undefined => {
+ if (!maybeLevel) {
+ return undefined;
+ }
+ if (hasOwn(levelNumbers, maybeLevel)) {
+ return maybeLevel;
+ }
+ loggerFor(client).warn(
+ `${sourceName} was set to ${JSON.stringify(maybeLevel)}, expected one of ${JSON.stringify(
+ Object.keys(levelNumbers),
+ )}`,
+ );
+ return undefined;
+};
+
+function noop() {}
+
+function makeLogFn(fnLevel: keyof Logger, logger: Logger | undefined, logLevel: LogLevel) {
+ if (!logger || levelNumbers[fnLevel] > levelNumbers[logLevel]) {
+ return noop;
+ } else {
+ // Don't wrap logger functions, we want the stacktrace intact!
+ return logger[fnLevel].bind(logger);
+ }
+}
+
+const noopLogger = {
+ error: noop,
+ warn: noop,
+ info: noop,
+ debug: noop,
+};
+
+let cachedLoggers = /* @__PURE__ */ new WeakMap();
+
+export function loggerFor(client: ScalarAPI): Logger {
+ const logger = client.logger;
+ const logLevel = client.logLevel ?? 'off';
+ if (!logger) {
+ return noopLogger;
+ }
+
+ const cachedLogger = cachedLoggers.get(logger);
+ if (cachedLogger && cachedLogger[0] === logLevel) {
+ return cachedLogger[1];
+ }
+
+ const levelLogger = {
+ error: makeLogFn('error', logger, logLevel),
+ warn: makeLogFn('warn', logger, logLevel),
+ info: makeLogFn('info', logger, logLevel),
+ debug: makeLogFn('debug', logger, logLevel),
+ };
+
+ cachedLoggers.set(logger, [logLevel, levelLogger]);
+
+ return levelLogger;
+}
+
+export const formatRequestDetails = (details: {
+ options?: RequestOptions | undefined;
+ headers?: Headers | Record | undefined;
+ retryOfRequestLogID?: string | undefined;
+ retryOf?: string | undefined;
+ url?: string | undefined;
+ status?: number | undefined;
+ method?: string | undefined;
+ durationMs?: number | undefined;
+ message?: unknown;
+ body?: unknown;
+}) => {
+ if (details.options) {
+ details.options = { ...details.options };
+ delete details.options['headers']; // redundant + leaks internals
+ }
+ if (details.headers) {
+ details.headers = Object.fromEntries(
+ (details.headers instanceof Headers ? [...details.headers] : Object.entries(details.headers)).map(
+ ([name, value]) => [
+ name,
+ (
+ name.toLowerCase() === 'authorization' ||
+ name.toLowerCase() === 'api-key' ||
+ name.toLowerCase() === 'x-api-key' ||
+ name.toLowerCase() === 'cookie' ||
+ name.toLowerCase() === 'set-cookie'
+ ) ?
+ '***'
+ : value,
+ ],
+ ),
+ );
+ }
+ if ('retryOfRequestLogID' in details) {
+ if (details.retryOfRequestLogID) {
+ details.retryOf = details.retryOfRequestLogID;
+ }
+ delete details.retryOfRequestLogID;
+ }
+ return details;
+};
diff --git a/src/internal/utils/path.ts b/src/internal/utils/path.ts
new file mode 100644
index 0000000..4a3103d
--- /dev/null
+++ b/src/internal/utils/path.ts
@@ -0,0 +1,88 @@
+import { ScalarAPIError } from '../../core/error';
+
+/**
+ * Percent-encode everything that isn't safe to have in a path without encoding safe chars.
+ *
+ * Taken from https://datatracker.ietf.org/doc/html/rfc3986#section-3.3:
+ * > unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
+ * > sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "="
+ * > pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
+ */
+export function encodeURIPath(str: string) {
+ return str.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);
+}
+
+const EMPTY = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null));
+
+export const createPathTagFunction = (pathEncoder = encodeURIPath) =>
+ function path(statics: readonly string[], ...params: readonly unknown[]): string {
+ // If there are no params, no processing is needed.
+ if (statics.length === 1) return statics[0]!;
+
+ let postPath = false;
+ const invalidSegments = [];
+ const path = statics.reduce((previousValue, currentValue, index) => {
+ if (/[?#]/.test(currentValue)) {
+ postPath = true;
+ }
+ const value = params[index];
+ let encoded = (postPath ? encodeURIComponent : pathEncoder)('' + value);
+ if (
+ index !== params.length &&
+ (value == null ||
+ (typeof value === 'object' &&
+ // handle values from other realms
+ value.toString ===
+ Object.getPrototypeOf(Object.getPrototypeOf((value as any).hasOwnProperty ?? EMPTY) ?? EMPTY)
+ ?.toString))
+ ) {
+ encoded = value + '';
+ invalidSegments.push({
+ start: previousValue.length + currentValue.length,
+ length: encoded.length,
+ error: `Value of type ${Object.prototype.toString
+ .call(value)
+ .slice(8, -1)} is not a valid path parameter`,
+ });
+ }
+ return previousValue + currentValue + (index === params.length ? '' : encoded);
+ }, '');
+
+ const pathOnly = path.split(/[?#]/, 1)[0]!;
+ const invalidSegmentPattern = /(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;
+ let match;
+
+ // Find all invalid segments
+ while ((match = invalidSegmentPattern.exec(pathOnly)) !== null) {
+ invalidSegments.push({
+ start: match.index,
+ length: match[0].length,
+ error: `Value "${match[0]}" can\'t be safely passed as a path parameter`,
+ });
+ }
+
+ invalidSegments.sort((a, b) => a.start - b.start);
+
+ if (invalidSegments.length > 0) {
+ let lastEnd = 0;
+ const underline = invalidSegments.reduce((acc, segment) => {
+ const spaces = ' '.repeat(segment.start - lastEnd);
+ const arrows = '^'.repeat(segment.length);
+ lastEnd = segment.start + segment.length;
+ return acc + spaces + arrows;
+ }, '');
+
+ throw new ScalarAPIError(
+ `Path parameters result in path with invalid segments:\n${invalidSegments
+ .map((e) => e.error)
+ .join('\n')}\n${path}\n${underline}`,
+ );
+ }
+
+ return path;
+ };
+
+/**
+ * URI-encodes path params and ensures no unsafe /./ or /../ path segments are introduced.
+ */
+export const path = /* @__PURE__ */ createPathTagFunction(encodeURIPath);
diff --git a/src/internal/utils/sleep.ts b/src/internal/utils/sleep.ts
new file mode 100644
index 0000000..f8d0a12
--- /dev/null
+++ b/src/internal/utils/sleep.ts
@@ -0,0 +1,3 @@
+// File generated from our OpenAPI spec by Scalar. See README.md for details.
+
+export const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
diff --git a/src/internal/utils/uuid.ts b/src/internal/utils/uuid.ts
new file mode 100644
index 0000000..94878fa
--- /dev/null
+++ b/src/internal/utils/uuid.ts
@@ -0,0 +1,17 @@
+// File generated from our OpenAPI spec by Scalar. See README.md for details.
+
+/**
+ * https://stackoverflow.com/a/2117523
+ */
+export let uuid4 = function () {
+ const { crypto } = globalThis as any;
+ if (crypto?.randomUUID) {
+ uuid4 = crypto.randomUUID.bind(crypto);
+ return crypto.randomUUID();
+ }
+ const u8 = new Uint8Array(1);
+ const randomByte = crypto ? () => crypto.getRandomValues(u8)[0]! : () => (Math.random() * 0xff) & 0xff;
+ return '10000000-1000-4000-8000-100000000000'.replace(/[018]/g, (c) =>
+ (+c ^ (randomByte() & (15 >> (+c / 4)))).toString(16),
+ );
+};
diff --git a/src/internal/utils/values.ts b/src/internal/utils/values.ts
new file mode 100644
index 0000000..26a5efd
--- /dev/null
+++ b/src/internal/utils/values.ts
@@ -0,0 +1,105 @@
+// File generated from our OpenAPI spec by Scalar. See README.md for details.
+
+import { ScalarAPIError } from '../../core/error';
+
+// https://url.spec.whatwg.org/#url-scheme-string
+const startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i;
+
+export const isAbsoluteURL = (url: string): boolean => {
+ return startsWithSchemeRegexp.test(url);
+};
+
+export let isArray = (val: unknown): val is unknown[] => ((isArray = Array.isArray), isArray(val));
+export let isReadonlyArray = isArray as (val: unknown) => val is readonly unknown[];
+
+/** Returns an object if the given value isn't an object, otherwise returns as-is */
+export function maybeObj(x: unknown): object {
+ if (typeof x !== 'object') {
+ return {};
+ }
+
+ return x ?? {};
+}
+
+// https://stackoverflow.com/a/34491287
+export function isEmptyObj(obj: Object | null | undefined): boolean {
+ if (!obj) return true;
+ for (const _k in obj) return false;
+ return true;
+}
+
+// https://eslint.org/docs/latest/rules/no-prototype-builtins
+export function hasOwn(obj: T, key: PropertyKey): key is keyof T {
+ return Object.prototype.hasOwnProperty.call(obj, key);
+}
+
+export function isObj(obj: unknown): obj is Record {
+ return obj != null && typeof obj === 'object' && !Array.isArray(obj);
+}
+
+export const ensurePresent = (value: T | null | undefined): T => {
+ if (value == null) {
+ throw new ScalarAPIError(`Expected a value to be given but received ${value} instead.`);
+ }
+
+ return value;
+};
+
+export const validatePositiveInteger = (name: string, n: unknown): number => {
+ if (typeof n !== 'number' || !Number.isInteger(n)) {
+ throw new ScalarAPIError(`${name} must be an integer`);
+ }
+ if (n < 0) {
+ throw new ScalarAPIError(`${name} must be a positive integer`);
+ }
+ return n;
+};
+
+export const coerceInteger = (value: unknown): number => {
+ if (typeof value === 'number') return Math.round(value);
+ if (typeof value === 'string') return parseInt(value, 10);
+
+ throw new ScalarAPIError(`Could not coerce ${value} (type: ${typeof value}) into a number`);
+};
+
+export const coerceFloat = (value: unknown): number => {
+ if (typeof value === 'number') return value;
+ if (typeof value === 'string') return parseFloat(value);
+
+ throw new ScalarAPIError(`Could not coerce ${value} (type: ${typeof value}) into a number`);
+};
+
+export const coerceBoolean = (value: unknown): boolean => {
+ if (typeof value === 'boolean') return value;
+ if (typeof value === 'string') return value === 'true';
+ return Boolean(value);
+};
+
+export const maybeCoerceInteger = (value: unknown): number | undefined => {
+ if (value == null) {
+ return undefined;
+ }
+ return coerceInteger(value);
+};
+
+export const maybeCoerceFloat = (value: unknown): number | undefined => {
+ if (value == null) {
+ return undefined;
+ }
+ return coerceFloat(value);
+};
+
+export const maybeCoerceBoolean = (value: unknown): boolean | undefined => {
+ if (value == null) {
+ return undefined;
+ }
+ return coerceBoolean(value);
+};
+
+export const safeJSON = (text: string) => {
+ try {
+ return JSON.parse(text);
+ } catch (err) {
+ return undefined;
+ }
+};
diff --git a/src/lib/base64.ts b/src/lib/base64.ts
deleted file mode 100644
index c2d5b38..0000000
--- a/src/lib/base64.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import * as z from "zod";
-
-export function bytesToBase64(u8arr: Uint8Array): string {
- return btoa(String.fromCodePoint(...u8arr));
-}
-
-export function bytesFromBase64(encoded: string): Uint8Array {
- return Uint8Array.from(atob(encoded), (c) => c.charCodeAt(0));
-}
-
-export function stringToBytes(str: string): Uint8Array {
- return new TextEncoder().encode(str);
-}
-
-export function stringFromBytes(u8arr: Uint8Array): string {
- return new TextDecoder().decode(u8arr);
-}
-
-export function stringToBase64(str: string): string {
- return bytesToBase64(stringToBytes(str));
-}
-
-export function stringFromBase64(b64str: string): string {
- return stringFromBytes(bytesFromBase64(b64str));
-}
-
-export const zodOutbound = z
- .instanceof(Uint8Array)
- .or(z.string().transform(stringToBytes));
-
-export const zodInbound = z
- .instanceof(Uint8Array)
- .or(z.string().transform(bytesFromBase64));
diff --git a/src/lib/config.ts b/src/lib/config.ts
deleted file mode 100644
index e499ab1..0000000
--- a/src/lib/config.ts
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { HTTPClient } from "./http.js";
-import { Logger } from "./logger.js";
-import { RetryConfig } from "./retries.js";
-import { Params, pathToFunc } from "./url.js";
-
-/**
- * Contains the list of servers available to the SDK
- */
-export const ServerList = [
- "https://access.scalar.com",
-] as const;
-
-export type SDKOptions = {
- bearerAuth?: string | (() => Promise) | undefined;
-
- httpClient?: HTTPClient;
- /**
- * Allows overriding the default server used by the SDK
- */
- serverIdx?: number | undefined;
- /**
- * Allows overriding the default server URL used by the SDK
- */
- serverURL?: string | undefined;
- /**
- * Allows overriding the default user agent used by the SDK
- */
- userAgent?: string | undefined;
- /**
- * Allows overriding the default retry config used by the SDK
- */
- retryConfig?: RetryConfig;
- timeoutMs?: number;
- debugLogger?: Logger;
-};
-
-export function serverURLFromOptions(options: SDKOptions): URL | null {
- let serverURL = options.serverURL;
-
- const params: Params = {};
-
- if (!serverURL) {
- const serverIdx = options.serverIdx ?? 0;
- if (serverIdx < 0 || serverIdx >= ServerList.length) {
- throw new Error(`Invalid server index ${serverIdx}`);
- }
- serverURL = ServerList[serverIdx] || "";
- }
-
- const u = pathToFunc(serverURL)(params);
- return new URL(u);
-}
-
-export const SDK_METADATA = {
- language: "typescript",
- openapiDocVersion: "0.1.5",
- sdkVersion: "0.1.5",
- genVersion: "2.634.2",
- userAgent: "speakeasy-sdk/typescript 0.1.5 2.634.2 0.1.5 @scalar/sdk",
-} as const;
diff --git a/src/lib/dlv.ts b/src/lib/dlv.ts
deleted file mode 100644
index e81091f..0000000
--- a/src/lib/dlv.ts
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-/*
-MIT License
-
-Copyright (c) 2024 Jason Miller (http://jasonformat.com)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
-FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*/
-
-/**
- * @param obj The object to walk
- * @param key The key path to walk the object with
- * @param def A default value to return if the result is undefined
- *
- * @example
- * dlv(obj, "a.b.c.d")
- * @example
- * dlv(object, ["a", "b", "c", "d"])
- * @example
- * dlv(object, "foo.bar.baz", "Hello, default value!")
- */
-export function dlv(
- obj: any,
- key: string | string[],
- def?: T,
- p?: number,
- undef?: never,
-): T | undefined {
- key = Array.isArray(key) ? key : key.split(".");
- for (p = 0; p < key.length; p++) {
- const k = key[p];
- obj = k != null && obj ? obj[k] : undef;
- }
- return obj === undef ? def : obj;
-}
diff --git a/src/lib/encodings.ts b/src/lib/encodings.ts
deleted file mode 100644
index 25c9dcb..0000000
--- a/src/lib/encodings.ts
+++ /dev/null
@@ -1,483 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { bytesToBase64 } from "./base64.js";
-import { isPlainObject } from "./is-plain-object.js";
-
-export class EncodingError extends Error {
- constructor(message: string) {
- super(message);
- this.name = "EncodingError";
- }
-}
-
-export function encodeMatrix(
- key: string,
- value: unknown,
- options?: { explode?: boolean; charEncoding?: "percent" | "none" },
-): string | undefined {
- let out = "";
- const pairs: [string, unknown][] = options?.explode
- ? explode(key, value)
- : [[key, value]];
-
- if (pairs.every(([_, v]) => v == null)) {
- return;
- }
-
- const encodeString = (v: string) => {
- return options?.charEncoding === "percent" ? encodeURIComponent(v) : v;
- };
- const encodeValue = (v: unknown) => encodeString(serializeValue(v));
-
- pairs.forEach(([pk, pv]) => {
- let tmp = "";
- let encValue: string | null | undefined = null;
-
- if (pv == null) {
- return;
- } else if (Array.isArray(pv)) {
- encValue = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join(",");
- } else if (isPlainObject(pv)) {
- const mapped = mapDefinedEntries(Object.entries(pv), ([k, v]) => {
- return `,${encodeString(k)},${encodeValue(v)}`;
- });
- encValue = mapped?.join("").slice(1);
- } else {
- encValue = `${encodeValue(pv)}`;
- }
-
- if (encValue == null) {
- return;
- }
-
- const keyPrefix = encodeString(pk);
- tmp = `${keyPrefix}=${encValue}`;
- // trim trailing '=' if value was empty
- if (tmp === `${keyPrefix}=`) {
- tmp = tmp.slice(0, -1);
- }
-
- // If we end up with the nothing then skip forward
- if (!tmp) {
- return;
- }
-
- out += `;${tmp}`;
- });
-
- return out;
-}
-
-export function encodeLabel(
- key: string,
- value: unknown,
- options?: { explode?: boolean; charEncoding?: "percent" | "none" },
-): string | undefined {
- let out = "";
- const pairs: [string, unknown][] = options?.explode
- ? explode(key, value)
- : [[key, value]];
-
- if (pairs.every(([_, v]) => v == null)) {
- return;
- }
-
- const encodeString = (v: string) => {
- return options?.charEncoding === "percent" ? encodeURIComponent(v) : v;
- };
- const encodeValue = (v: unknown) => encodeString(serializeValue(v));
-
- pairs.forEach(([pk, pv]) => {
- let encValue: string | null | undefined = "";
-
- if (pv == null) {
- return;
- } else if (Array.isArray(pv)) {
- encValue = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join(".");
- } else if (isPlainObject(pv)) {
- const mapped = mapDefinedEntries(Object.entries(pv), ([k, v]) => {
- return `.${encodeString(k)}.${encodeValue(v)}`;
- });
- encValue = mapped?.join("").slice(1);
- } else {
- const k =
- options?.explode && isPlainObject(value) ? `${encodeString(pk)}=` : "";
- encValue = `${k}${encodeValue(pv)}`;
- }
-
- out += encValue == null ? "" : `.${encValue}`;
- });
-
- return out;
-}
-
-type FormEncoder = (
- key: string,
- value: unknown,
- options?: { explode?: boolean; charEncoding?: "percent" | "none" },
-) => string | undefined;
-
-function formEncoder(sep: string): FormEncoder {
- return (
- key: string,
- value: unknown,
- options?: { explode?: boolean; charEncoding?: "percent" | "none" },
- ) => {
- let out = "";
- const pairs: [string, unknown][] = options?.explode
- ? explode(key, value)
- : [[key, value]];
-
- if (pairs.every(([_, v]) => v == null)) {
- return;
- }
-
- const encodeString = (v: string) => {
- return options?.charEncoding === "percent" ? encodeURIComponent(v) : v;
- };
-
- const encodeValue = (v: unknown) => encodeString(serializeValue(v));
-
- const encodedSep = encodeString(sep);
-
- pairs.forEach(([pk, pv]) => {
- let tmp = "";
- let encValue: string | null | undefined = null;
-
- if (pv == null) {
- return;
- } else if (Array.isArray(pv)) {
- encValue = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join(encodedSep);
- } else if (isPlainObject(pv)) {
- encValue = mapDefinedEntries(Object.entries(pv), ([k, v]) => {
- return `${encodeString(k)}${encodedSep}${encodeValue(v)}`;
- })?.join(encodedSep);
- } else {
- encValue = `${encodeValue(pv)}`;
- }
-
- if (encValue == null) {
- return;
- }
-
- tmp = `${encodeString(pk)}=${encValue}`;
-
- // If we end up with the nothing then skip forward
- if (!tmp || tmp === "=") {
- return;
- }
-
- out += `&${tmp}`;
- });
-
- return out.slice(1);
- };
-}
-
-export const encodeForm = formEncoder(",");
-export const encodeSpaceDelimited = formEncoder(" ");
-export const encodePipeDelimited = formEncoder("|");
-
-export function encodeBodyForm(
- key: string,
- value: unknown,
- options?: { explode?: boolean; charEncoding?: "percent" | "none" },
-): string {
- let out = "";
- const pairs: [string, unknown][] = options?.explode
- ? explode(key, value)
- : [[key, value]];
-
- const encodeString = (v: string) => {
- return options?.charEncoding === "percent" ? encodeURIComponent(v) : v;
- };
-
- const encodeValue = (v: unknown) => encodeString(serializeValue(v));
-
- pairs.forEach(([pk, pv]) => {
- let tmp = "";
- let encValue = "";
-
- if (pv == null) {
- return;
- } else if (Array.isArray(pv)) {
- encValue = JSON.stringify(pv, jsonReplacer);
- } else if (isPlainObject(pv)) {
- encValue = JSON.stringify(pv, jsonReplacer);
- } else {
- encValue = `${encodeValue(pv)}`;
- }
-
- tmp = `${encodeString(pk)}=${encValue}`;
-
- // If we end up with the nothing then skip forward
- if (!tmp || tmp === "=") {
- return;
- }
-
- out += `&${tmp}`;
- });
-
- return out.slice(1);
-}
-
-export function encodeDeepObject(
- key: string,
- value: unknown,
- options?: { charEncoding?: "percent" | "none" },
-): string | undefined {
- if (value == null) {
- return;
- }
-
- if (!isPlainObject(value)) {
- throw new EncodingError(
- `Value of parameter '${key}' which uses deepObject encoding must be an object or null`,
- );
- }
-
- return encodeDeepObjectObject(key, value, options);
-}
-
-export function encodeDeepObjectObject(
- key: string,
- value: unknown,
- options?: { charEncoding?: "percent" | "none" },
-): string | undefined {
- if (value == null) {
- return;
- }
-
- let out = "";
-
- const encodeString = (v: string) => {
- return options?.charEncoding === "percent" ? encodeURIComponent(v) : v;
- };
-
- if (!isPlainObject(value)) {
- throw new EncodingError(`Expected parameter '${key}' to be an object.`);
- }
-
- Object.entries(value).forEach(([ck, cv]) => {
- if (cv == null) {
- return;
- }
-
- const pk = `${key}[${ck}]`;
-
- if (isPlainObject(cv)) {
- const objOut = encodeDeepObjectObject(pk, cv, options);
-
- out += objOut == null ? "" : `&${objOut}`;
-
- return;
- }
-
- const pairs: unknown[] = Array.isArray(cv) ? cv : [cv];
- const encoded = mapDefined(pairs, (v) => {
- return `${encodeString(pk)}=${encodeString(serializeValue(v))}`;
- })?.join("&");
-
- out += encoded == null ? "" : `&${encoded}`;
- });
-
- return out.slice(1);
-}
-
-export function encodeJSON(
- key: string,
- value: unknown,
- options?: { explode?: boolean; charEncoding?: "percent" | "none" },
-): string | undefined {
- if (typeof value === "undefined") {
- return;
- }
-
- const encodeString = (v: string) => {
- return options?.charEncoding === "percent" ? encodeURIComponent(v) : v;
- };
-
- const encVal = encodeString(JSON.stringify(value, jsonReplacer));
-
- return options?.explode ? encVal : `${encodeString(key)}=${encVal}`;
-}
-
-export const encodeSimple = (
- key: string,
- value: unknown,
- options?: { explode?: boolean; charEncoding?: "percent" | "none" },
-): string | undefined => {
- let out = "";
- const pairs: [string, unknown][] = options?.explode
- ? explode(key, value)
- : [[key, value]];
-
- if (pairs.every(([_, v]) => v == null)) {
- return;
- }
-
- const encodeString = (v: string) => {
- return options?.charEncoding === "percent" ? encodeURIComponent(v) : v;
- };
- const encodeValue = (v: unknown) => encodeString(serializeValue(v));
-
- pairs.forEach(([pk, pv]) => {
- let tmp: string | null | undefined = "";
-
- if (pv == null) {
- return;
- } else if (Array.isArray(pv)) {
- tmp = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join(",");
- } else if (isPlainObject(pv)) {
- const mapped = mapDefinedEntries(Object.entries(pv), ([k, v]) => {
- return `,${encodeString(k)},${encodeValue(v)}`;
- });
- tmp = mapped?.join("").slice(1);
- } else {
- const k = options?.explode && isPlainObject(value) ? `${pk}=` : "";
- tmp = `${k}${encodeValue(pv)}`;
- }
-
- out += tmp ? `,${tmp}` : "";
- });
-
- return out.slice(1);
-};
-
-function explode(key: string, value: unknown): [string, unknown][] {
- if (Array.isArray(value)) {
- return value.map((v) => [key, v]);
- } else if (isPlainObject(value)) {
- const o = value ?? {};
- return Object.entries(o).map(([k, v]) => [k, v]);
- } else {
- return [[key, value]];
- }
-}
-
-function serializeValue(value: unknown): string {
- if (value == null) {
- return "";
- } else if (value instanceof Date) {
- return value.toISOString();
- } else if (value instanceof Uint8Array) {
- return bytesToBase64(value);
- } else if (typeof value === "object") {
- return JSON.stringify(value, jsonReplacer);
- }
-
- return `${value}`;
-}
-
-function jsonReplacer(_: string, value: unknown): unknown {
- if (value instanceof Uint8Array) {
- return bytesToBase64(value);
- } else {
- return value;
- }
-}
-
-function mapDefined(inp: T[], mapper: (v: T) => R): R[] | null {
- const res = inp.reduce((acc, v) => {
- if (v == null) {
- return acc;
- }
-
- const m = mapper(v);
- if (m == null) {
- return acc;
- }
-
- acc.push(m);
-
- return acc;
- }, []);
-
- return res.length ? res : null;
-}
-
-function mapDefinedEntries(
- inp: Iterable<[K, V]>,
- mapper: (v: [K, V]) => R,
-): R[] | null {
- const acc: R[] = [];
- for (const [k, v] of inp) {
- if (v == null) {
- continue;
- }
-
- const m = mapper([k, v]);
- if (m == null) {
- continue;
- }
-
- acc.push(m);
- }
-
- return acc.length ? acc : null;
-}
-
-export function queryJoin(...args: (string | undefined)[]): string {
- return args.filter(Boolean).join("&");
-}
-
-type QueryEncoderOptions = {
- explode?: boolean;
- charEncoding?: "percent" | "none";
-};
-
-type QueryEncoder = (
- key: string,
- value: unknown,
- options?: QueryEncoderOptions,
-) => string | undefined;
-
-type BulkQueryEncoder = (
- values: Record,
- options?: QueryEncoderOptions,
-) => string;
-
-export function queryEncoder(f: QueryEncoder): BulkQueryEncoder {
- const bulkEncode = function (
- values: Record,
- options?: QueryEncoderOptions,
- ): string {
- const opts: QueryEncoderOptions = {
- ...options,
- explode: options?.explode ?? true,
- charEncoding: options?.charEncoding ?? "percent",
- };
-
- const encoded = Object.entries(values).map(([key, value]) => {
- return f(key, value, opts);
- });
- return queryJoin(...encoded);
- };
-
- return bulkEncode;
-}
-
-export const encodeJSONQuery = queryEncoder(encodeJSON);
-export const encodeFormQuery = queryEncoder(encodeForm);
-export const encodeSpaceDelimitedQuery = queryEncoder(encodeSpaceDelimited);
-export const encodePipeDelimitedQuery = queryEncoder(encodePipeDelimited);
-export const encodeDeepObjectQuery = queryEncoder(encodeDeepObject);
-
-export function appendForm(
- fd: FormData,
- key: string,
- value: unknown,
- fileName?: string,
-): void {
- if (value == null) {
- return;
- } else if (value instanceof Blob && fileName) {
- fd.append(key, value, fileName);
- } else if (value instanceof Blob) {
- fd.append(key, value);
- } else {
- fd.append(key, String(value));
- }
-}
diff --git a/src/lib/files.ts b/src/lib/files.ts
deleted file mode 100644
index 0344cd0..0000000
--- a/src/lib/files.ts
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-/**
- * Consumes a stream and returns a concatenated array buffer. Useful in
- * situations where we need to read the whole file because it forms part of a
- * larger payload containing other fields, and we can't modify the underlying
- * request structure.
- */
-export async function readableStreamToArrayBuffer(
- readable: ReadableStream,
-): Promise {
- const reader = readable.getReader();
- const chunks: Uint8Array[] = [];
-
- let totalLength = 0;
- let done = false;
-
- while (!done) {
- const { value, done: doneReading } = await reader.read();
-
- if (doneReading) {
- done = true;
- } else {
- chunks.push(value);
- totalLength += value.length;
- }
- }
-
- const concatenatedChunks = new Uint8Array(totalLength);
- let offset = 0;
-
- for (const chunk of chunks) {
- concatenatedChunks.set(chunk, offset);
- offset += chunk.length;
- }
-
- return concatenatedChunks.buffer as ArrayBuffer;
-}
-
-/**
- * Determines the MIME content type based on a file's extension.
- * Returns null if the extension is not recognized.
- */
-export function getContentTypeFromFileName(fileName: string): string | null {
- if (!fileName) return null;
-
- const ext = fileName.toLowerCase().split(".").pop();
- if (!ext) return null;
-
- const mimeTypes: Record = {
- json: "application/json",
- xml: "application/xml",
- html: "text/html",
- htm: "text/html",
- txt: "text/plain",
- csv: "text/csv",
- pdf: "application/pdf",
- png: "image/png",
- jpg: "image/jpeg",
- jpeg: "image/jpeg",
- gif: "image/gif",
- svg: "image/svg+xml",
- js: "application/javascript",
- css: "text/css",
- zip: "application/zip",
- tar: "application/x-tar",
- gz: "application/gzip",
- mp4: "video/mp4",
- mp3: "audio/mpeg",
- wav: "audio/wav",
- webp: "image/webp",
- ico: "image/x-icon",
- woff: "font/woff",
- woff2: "font/woff2",
- ttf: "font/ttf",
- otf: "font/otf",
- };
-
- return mimeTypes[ext] || null;
-}
diff --git a/src/lib/http.ts b/src/lib/http.ts
deleted file mode 100644
index 13cf1fd..0000000
--- a/src/lib/http.ts
+++ /dev/null
@@ -1,323 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-export type Fetcher = (
- input: RequestInfo | URL,
- init?: RequestInit,
-) => Promise;
-
-export type Awaitable = T | Promise;
-
-const DEFAULT_FETCHER: Fetcher = (input, init) => {
- // If input is a Request and init is undefined, Bun will discard the method,
- // headers, body and other options that were set on the request object.
- // Node.js and browers would ignore an undefined init value. This check is
- // therefore needed for interop with Bun.
- if (init == null) {
- return fetch(input);
- } else {
- return fetch(input, init);
- }
-};
-
-export type RequestInput = {
- /**
- * The URL the request will use.
- */
- url: URL;
- /**
- * Options used to create a [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request).
- */
- options?: RequestInit | undefined;
-};
-
-export interface HTTPClientOptions {
- fetcher?: Fetcher;
-}
-
-export type BeforeRequestHook = (req: Request) => Awaitable;
-export type RequestErrorHook = (err: unknown, req: Request) => Awaitable;
-export type ResponseHook = (res: Response, req: Request) => Awaitable;
-
-export class HTTPClient {
- private fetcher: Fetcher;
- private requestHooks: BeforeRequestHook[] = [];
- private requestErrorHooks: RequestErrorHook[] = [];
- private responseHooks: ResponseHook[] = [];
-
- constructor(private options: HTTPClientOptions = {}) {
- this.fetcher = options.fetcher || DEFAULT_FETCHER;
- }
-
- async request(request: Request): Promise {
- let req = request;
- for (const hook of this.requestHooks) {
- const nextRequest = await hook(req);
- if (nextRequest) {
- req = nextRequest;
- }
- }
-
- try {
- const res = await this.fetcher(req);
-
- for (const hook of this.responseHooks) {
- await hook(res, req);
- }
-
- return res;
- } catch (err) {
- for (const hook of this.requestErrorHooks) {
- await hook(err, req);
- }
-
- throw err;
- }
- }
-
- /**
- * Registers a hook that is called before a request is made. The hook function
- * can mutate the request or return a new request. This may be useful to add
- * additional information to request such as request IDs and tracing headers.
- */
- addHook(hook: "beforeRequest", fn: BeforeRequestHook): this;
- /**
- * Registers a hook that is called when a request cannot be made due to a
- * network error.
- */
- addHook(hook: "requestError", fn: RequestErrorHook): this;
- /**
- * Registers a hook that is called when a response has been received from the
- * server.
- */
- addHook(hook: "response", fn: ResponseHook): this;
- addHook(
- ...args:
- | [hook: "beforeRequest", fn: BeforeRequestHook]
- | [hook: "requestError", fn: RequestErrorHook]
- | [hook: "response", fn: ResponseHook]
- ) {
- if (args[0] === "beforeRequest") {
- this.requestHooks.push(args[1]);
- } else if (args[0] === "requestError") {
- this.requestErrorHooks.push(args[1]);
- } else if (args[0] === "response") {
- this.responseHooks.push(args[1]);
- } else {
- throw new Error(`Invalid hook type: ${args[0]}`);
- }
- return this;
- }
-
- /** Removes a hook that was previously registered with `addHook`. */
- removeHook(hook: "beforeRequest", fn: BeforeRequestHook): this;
- /** Removes a hook that was previously registered with `addHook`. */
- removeHook(hook: "requestError", fn: RequestErrorHook): this;
- /** Removes a hook that was previously registered with `addHook`. */
- removeHook(hook: "response", fn: ResponseHook): this;
- removeHook(
- ...args:
- | [hook: "beforeRequest", fn: BeforeRequestHook]
- | [hook: "requestError", fn: RequestErrorHook]
- | [hook: "response", fn: ResponseHook]
- ): this {
- let target: unknown[];
- if (args[0] === "beforeRequest") {
- target = this.requestHooks;
- } else if (args[0] === "requestError") {
- target = this.requestErrorHooks;
- } else if (args[0] === "response") {
- target = this.responseHooks;
- } else {
- throw new Error(`Invalid hook type: ${args[0]}`);
- }
-
- const index = target.findIndex((v) => v === args[1]);
- if (index >= 0) {
- target.splice(index, 1);
- }
-
- return this;
- }
-
- clone(): HTTPClient {
- const child = new HTTPClient(this.options);
- child.requestHooks = this.requestHooks.slice();
- child.requestErrorHooks = this.requestErrorHooks.slice();
- child.responseHooks = this.responseHooks.slice();
-
- return child;
- }
-}
-
-export type StatusCodePredicate = number | string | (number | string)[];
-
-// A semicolon surrounded by optional whitespace characters is used to separate
-// segments in a media type string.
-const mediaParamSeparator = /\s*;\s*/g;
-
-export function matchContentType(response: Response, pattern: string): boolean {
- // `*` is a special case which means anything is acceptable.
- if (pattern === "*") {
- return true;
- }
-
- let contentType =
- response.headers.get("content-type")?.trim() || "application/octet-stream";
- contentType = contentType.toLowerCase();
-
- const wantParts = pattern.toLowerCase().trim().split(mediaParamSeparator);
- const [wantType = "", ...wantParams] = wantParts;
-
- if (wantType.split("/").length !== 2) {
- return false;
- }
-
- const gotParts = contentType.split(mediaParamSeparator);
- const [gotType = "", ...gotParams] = gotParts;
-
- const [type = "", subtype = ""] = gotType.split("/");
- if (!type || !subtype) {
- return false;
- }
-
- if (
- wantType !== "*/*" &&
- gotType !== wantType &&
- `${type}/*` !== wantType &&
- `*/${subtype}` !== wantType
- ) {
- return false;
- }
-
- if (gotParams.length < wantParams.length) {
- return false;
- }
-
- const params = new Set(gotParams);
- for (const wantParam of wantParams) {
- if (!params.has(wantParam)) {
- return false;
- }
- }
-
- return true;
-}
-
-const codeRangeRE = new RegExp("^[0-9]xx$", "i");
-
-export function matchStatusCode(
- response: Response,
- codes: StatusCodePredicate,
-): boolean {
- const actual = `${response.status}`;
- const expectedCodes = Array.isArray(codes) ? codes : [codes];
- if (!expectedCodes.length) {
- return false;
- }
-
- return expectedCodes.some((ec) => {
- const code = `${ec}`;
-
- if (code === "default") {
- return true;
- }
-
- if (!codeRangeRE.test(`${code}`)) {
- return code === actual;
- }
-
- const expectFamily = code.charAt(0);
- if (!expectFamily) {
- throw new Error("Invalid status code range");
- }
-
- const actualFamily = actual.charAt(0);
- if (!actualFamily) {
- throw new Error(`Invalid response status code: ${actual}`);
- }
-
- return actualFamily === expectFamily;
- });
-}
-
-export function matchResponse(
- response: Response,
- code: StatusCodePredicate,
- contentTypePattern: string,
-): boolean {
- return (
- matchStatusCode(response, code) &&
- matchContentType(response, contentTypePattern)
- );
-}
-
-/**
- * Uses various heurisitics to determine if an error is a connection error.
- */
-export function isConnectionError(err: unknown): boolean {
- if (typeof err !== "object" || err == null) {
- return false;
- }
-
- // Covers fetch in Deno as well
- const isBrowserErr =
- err instanceof TypeError &&
- err.message.toLowerCase().startsWith("failed to fetch");
-
- const isNodeErr =
- err instanceof TypeError &&
- err.message.toLowerCase().startsWith("fetch failed");
-
- const isBunErr = "name" in err && err.name === "ConnectionError";
-
- const isGenericErr =
- "code" in err &&
- typeof err.code === "string" &&
- err.code.toLowerCase() === "econnreset";
-
- return isBrowserErr || isNodeErr || isGenericErr || isBunErr;
-}
-
-/**
- * Uses various heurisitics to determine if an error is a timeout error.
- */
-export function isTimeoutError(err: unknown): boolean {
- if (typeof err !== "object" || err == null) {
- return false;
- }
-
- // Fetch in browser, Node.js, Bun, Deno
- const isNative = "name" in err && err.name === "TimeoutError";
- const isLegacyNative = "code" in err && err.code === 23;
-
- // Node.js HTTP client and Axios
- const isGenericErr =
- "code" in err &&
- typeof err.code === "string" &&
- err.code.toLowerCase() === "econnaborted";
-
- return isNative || isLegacyNative || isGenericErr;
-}
-
-/**
- * Uses various heurisitics to determine if an error is a abort error.
- */
-export function isAbortError(err: unknown): boolean {
- if (typeof err !== "object" || err == null) {
- return false;
- }
-
- // Fetch in browser, Node.js, Bun, Deno
- const isNative = "name" in err && err.name === "AbortError";
- const isLegacyNative = "code" in err && err.code === 20;
-
- // Node.js HTTP client and Axios
- const isGenericErr =
- "code" in err &&
- typeof err.code === "string" &&
- err.code.toLowerCase() === "econnaborted";
-
- return isNative || isLegacyNative || isGenericErr;
-}
diff --git a/src/lib/is-plain-object.ts b/src/lib/is-plain-object.ts
deleted file mode 100644
index 61070d3..0000000
--- a/src/lib/is-plain-object.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-/*
-MIT License
-
-Copyright (c) Sindre Sorhus (https://sindresorhus.com)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
-FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*/
-
-// Taken from https://github.com/sindresorhus/is-plain-obj/blob/97f38e8836f86a642cce98fc6ab3058bc36df181/index.js
-
-export function isPlainObject(value: unknown): value is object {
- if (typeof value !== "object" || value === null) {
- return false;
- }
-
- const prototype = Object.getPrototypeOf(value);
- return (
- (prototype === null ||
- prototype === Object.prototype ||
- Object.getPrototypeOf(prototype) === null) &&
- !(Symbol.toStringTag in value) &&
- !(Symbol.iterator in value)
- );
-}
diff --git a/src/lib/logger.ts b/src/lib/logger.ts
deleted file mode 100644
index d181f29..0000000
--- a/src/lib/logger.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-export interface Logger {
- group(label?: string): void;
- groupEnd(): void;
- log(message: any, ...args: any[]): void;
-}
diff --git a/src/lib/matchers.ts b/src/lib/matchers.ts
deleted file mode 100644
index f7392e5..0000000
--- a/src/lib/matchers.ts
+++ /dev/null
@@ -1,342 +0,0 @@
-/*
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
- */
-
-import { APIError } from "../models/errors/apierror.js";
-import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
-import { ERR, OK, Result } from "../types/fp.js";
-import { matchResponse, matchStatusCode, StatusCodePredicate } from "./http.js";
-import { isPlainObject } from "./is-plain-object.js";
-
-export type Encoding =
- | "jsonl"
- | "json"
- | "text"
- | "bytes"
- | "stream"
- | "sse"
- | "nil"
- | "fail";
-
-const DEFAULT_CONTENT_TYPES: Record = {
- jsonl: "application/jsonl",
- json: "application/json",
- text: "text/plain",
- bytes: "application/octet-stream",
- stream: "application/octet-stream",
- sse: "text/event-stream",
- nil: "*",
- fail: "*",
-};
-
-type Schema = { parse(raw: unknown): T };
-
-type MatchOptions = {
- ctype?: string;
- hdrs?: boolean;
- key?: string;
- sseSentinel?: string;
-};
-
-export type ValueMatcher = MatchOptions & {
- enc: Encoding;
- codes: StatusCodePredicate;
- schema: Schema;
-};
-
-export type ErrorMatcher = MatchOptions & {
- enc: Encoding;
- codes: StatusCodePredicate;
- schema: Schema;
- err: true;
-};
-
-export type FailMatcher = {
- enc: "fail";
- codes: StatusCodePredicate;
-};
-
-export type Matcher = ValueMatcher | ErrorMatcher | FailMatcher;
-
-export function jsonErr(
- codes: StatusCodePredicate,
- schema: Schema,
- options?: MatchOptions,
-): ErrorMatcher {
- return { ...options, err: true, enc: "json", codes, schema };
-}
-export function json(
- codes: StatusCodePredicate,
- schema: Schema,
- options?: MatchOptions,
-): ValueMatcher