From 3e89aa47cea8419afe5ec2204f63b352fabeb94e Mon Sep 17 00:00:00 2001 From: dtoxvanilla1991 Date: Tue, 28 Apr 2026 00:40:37 +0100 Subject: [PATCH 1/4] feat(deps): migrate @hey-api/openapi-ts from 0.71.1 to 0.96.1 Complete architectural migration from the legacy fetch client to the new bundled @hey-api/client-fetch client in openapi-ts v0.96. ## Config changes (openapi-ts.config.ts) - Replace legacy/fetch plugin with @hey-api/client-fetch - Replace format: 'prettier' with postProcess: ['prettier'] - Replace asClass/classNameBuilder with operations.strategy: 'byTags' - Replace exportFromIndex with includeInEntry: true - Replace responseStyle: 'data' option (removed from SDK plugin) ## Generated files (lib/api/) - Deleted: core/ApiError.ts, ApiRequestOptions.ts, ApiResult.ts, CancelablePromise.ts, OpenAPI.ts, request.ts (old fetch core) - Added: client.gen.ts, client/ directory (new client singleton) - Added: core/auth.gen.ts, bodySerializer.gen.ts, params.gen.ts, pathSerializer.gen.ts, queryKeySerializer.gen.ts, serverSentEvents.gen.ts, types.gen.ts, utils.gen.ts - Regenerated: index.ts, sdk.gen.ts, types.gen.ts, schemas.gen.ts ## Method signature changes (sdk.gen.ts) - Old: static method(data: XxxData): CancelablePromise - New: static method(options: Options) - Data types now use path/query/body sub-objects instead of flat args e.g. { appId } -> { path: { app_id } } ## Hand-maintained file updates - lib/api/callbacks-compat.ts: Removed CancelablePromise dependency; deprecated method aliases now use new Options signatures - lib/api/callbacks-compat.d.ts: Updated to new type signatures - lib/config.ts: Replace OpenAPI singleton with client.setConfig() using new baseUrl and auth callback pattern - lib/utilities/getToken.ts: Replace OpenAPI.BASE with kindeConfig.kindeDomain - lib/main.ts: Explicitly export all SDK classes from sdk.gen (avoiding index.ts naming conflicts); export schemas directly from schemas.gen ## Test updates - lib/main.test.ts: Remove ApiError, CancelablePromise, CancelError, OpenAPI from expected exports (no longer generated) - tests/regressions.test.ts: Update all method call args to new path/query/body format; update type check tests Closes #121 --- lib/api/callbacks-compat.d.ts | 63 +- lib/api/callbacks-compat.ts | 126 +- lib/api/client.gen.ts | 27 + lib/api/client/client.gen.ts | 324 + lib/api/client/index.ts | 25 + lib/api/client/types.gen.ts | 243 + lib/api/client/utils.gen.ts | 337 + lib/api/core/ApiError.ts | 25 - lib/api/core/ApiRequestOptions.ts | 21 - lib/api/core/ApiResult.ts | 7 - lib/api/core/CancelablePromise.ts | 126 - lib/api/core/OpenAPI.ts | 56 - lib/api/core/auth.gen.ts | 42 + lib/api/core/bodySerializer.gen.ts | 96 + lib/api/core/params.gen.ts | 181 + lib/api/core/pathSerializer.gen.ts | 181 + lib/api/core/queryKeySerializer.gen.ts | 136 + lib/api/core/request.ts | 400 - lib/api/core/serverSentEvents.gen.ts | 265 + lib/api/core/types.gen.ts | 118 + lib/api/core/utils.gen.ts | 143 + lib/api/index.ts | 1046 ++- lib/api/sdk.gen.ts | 6090 ++++++------ lib/api/types.gen.ts | 11406 ++++++++++++++++------- lib/config.ts | 10 +- lib/main.test.ts | 4 - lib/main.ts | 33 +- lib/utilities/getToken.ts | 3 +- openapi-ts.config.ts | 17 +- package.json | 2 +- pnpm-lock.yaml | 539 +- tests/regressions.test.ts | 98 +- 32 files changed, 14386 insertions(+), 7804 deletions(-) create mode 100644 lib/api/client.gen.ts create mode 100644 lib/api/client/client.gen.ts create mode 100644 lib/api/client/index.ts create mode 100644 lib/api/client/types.gen.ts create mode 100644 lib/api/client/utils.gen.ts delete mode 100644 lib/api/core/ApiError.ts delete mode 100644 lib/api/core/ApiRequestOptions.ts delete mode 100644 lib/api/core/ApiResult.ts delete mode 100644 lib/api/core/CancelablePromise.ts delete mode 100644 lib/api/core/OpenAPI.ts create mode 100644 lib/api/core/auth.gen.ts create mode 100644 lib/api/core/bodySerializer.gen.ts create mode 100644 lib/api/core/params.gen.ts create mode 100644 lib/api/core/pathSerializer.gen.ts create mode 100644 lib/api/core/queryKeySerializer.gen.ts delete mode 100644 lib/api/core/request.ts create mode 100644 lib/api/core/serverSentEvents.gen.ts create mode 100644 lib/api/core/types.gen.ts create mode 100644 lib/api/core/utils.gen.ts diff --git a/lib/api/callbacks-compat.d.ts b/lib/api/callbacks-compat.d.ts index 5ea866c..69f2b0a 100644 --- a/lib/api/callbacks-compat.d.ts +++ b/lib/api/callbacks-compat.d.ts @@ -1,24 +1,16 @@ // TypeScript declaration file for Callbacks deprecated methods // This file provides type information for the deprecated methods added at runtime -import type { CancelablePromise } from "./core/CancelablePromise"; +import type { Options } from "./client"; import type { GetCallbackUrlsData, - GetCallbackUrlsResponse, AddRedirectCallbackUrlsData, - AddRedirectCallbackUrlsResponse, ReplaceRedirectCallbackUrlsData, - ReplaceRedirectCallbackUrlsResponse, DeleteCallbackUrlsData, - DeleteCallbackUrlsResponse, GetLogoutUrlsData, - GetLogoutUrlsResponse, AddLogoutRedirectUrlsData, - AddLogoutRedirectUrlsResponse, ReplaceLogoutRedirectUrlsData, - ReplaceLogoutRedirectUrlsResponse, DeleteLogoutUrlsData, - DeleteLogoutUrlsResponse, } from "./types.gen"; // Import the Callbacks class type to extend it @@ -26,63 +18,66 @@ import type { Callbacks as CallbacksClass } from "./sdk.gen"; declare module "./sdk.gen" { // Extend the Callbacks class constructor with deprecated static methods - // Using type augmentation for static methods interface CallbacksStatic { /** * @deprecated Use `getCallbackUrls` instead. This method will be removed in a future version. */ - getCallbackUrLs( - data: GetCallbackUrlsData, - ): CancelablePromise; + getCallbackUrLs( + options: Options, + ): ReturnType>; /** * @deprecated Use `addRedirectCallbackUrls` instead. This method will be removed in a future version. */ - addRedirectCallbackUrLs( - data: AddRedirectCallbackUrlsData, - ): CancelablePromise; + addRedirectCallbackUrLs( + options: Options, + ): ReturnType>; /** * @deprecated Use `replaceRedirectCallbackUrls` instead. This method will be removed in a future version. */ - replaceRedirectCallbackUrLs( - data: ReplaceRedirectCallbackUrlsData, - ): CancelablePromise; + replaceRedirectCallbackUrLs( + options: Options, + ): ReturnType< + typeof CallbacksClass.replaceRedirectCallbackUrls + >; /** * @deprecated Use `deleteCallbackUrls` instead. This method will be removed in a future version. */ - deleteCallbackUrLs( - data: DeleteCallbackUrlsData, - ): CancelablePromise; + deleteCallbackUrLs( + options: Options, + ): ReturnType>; /** * @deprecated Use `getLogoutUrls` instead. This method will be removed in a future version. */ - getLogoutUrLs( - data: GetLogoutUrlsData, - ): CancelablePromise; + getLogoutUrLs( + options: Options, + ): ReturnType>; /** * @deprecated Use `addLogoutRedirectUrls` instead. This method will be removed in a future version. */ - addLogoutRedirectUrLs( - data: AddLogoutRedirectUrlsData, - ): CancelablePromise; + addLogoutRedirectUrLs( + options: Options, + ): ReturnType>; /** * @deprecated Use `replaceLogoutRedirectUrls` instead. This method will be removed in a future version. */ - replaceLogoutRedirectUrLs( - data: ReplaceLogoutRedirectUrlsData, - ): CancelablePromise; + replaceLogoutRedirectUrLs( + options: Options, + ): ReturnType< + typeof CallbacksClass.replaceLogoutRedirectUrls + >; /** * @deprecated Use `deleteLogoutUrls` instead. This method will be removed in a future version. */ - deleteLogoutUrLs( - data: DeleteLogoutUrlsData, - ): CancelablePromise; + deleteLogoutUrLs( + options: Options, + ): ReturnType>; } // Merge the static methods with the class constructor diff --git a/lib/api/callbacks-compat.ts b/lib/api/callbacks-compat.ts index 4cf7ca9..74bc50c 100644 --- a/lib/api/callbacks-compat.ts +++ b/lib/api/callbacks-compat.ts @@ -3,24 +3,16 @@ // This file should NOT be auto-generated and will persist across regenerations import { Callbacks as CallbacksOriginal } from "./sdk.gen"; -import type { CancelablePromise } from "./core/CancelablePromise"; +import type { Options } from "./client"; import type { GetCallbackUrlsData, - GetCallbackUrlsResponse, AddRedirectCallbackUrlsData, - AddRedirectCallbackUrlsResponse, ReplaceRedirectCallbackUrlsData, - ReplaceRedirectCallbackUrlsResponse, DeleteCallbackUrlsData, - DeleteCallbackUrlsResponse, GetLogoutUrlsData, - GetLogoutUrlsResponse, AddLogoutRedirectUrlsData, - AddLogoutRedirectUrlsResponse, ReplaceLogoutRedirectUrlsData, - ReplaceLogoutRedirectUrlsResponse, DeleteLogoutUrlsData, - DeleteLogoutUrlsResponse, } from "./types.gen"; // Type definition for deprecated methods @@ -28,58 +20,62 @@ interface DeprecatedCallbacksMethods { /** * @deprecated Use `getCallbackUrls` instead. This method will be removed in a future version. */ - getCallbackUrLs( - data: GetCallbackUrlsData, - ): CancelablePromise; + getCallbackUrLs( + options: Options, + ): ReturnType>; /** * @deprecated Use `addRedirectCallbackUrls` instead. This method will be removed in a future version. */ - addRedirectCallbackUrLs( - data: AddRedirectCallbackUrlsData, - ): CancelablePromise; + addRedirectCallbackUrLs( + options: Options, + ): ReturnType>; /** * @deprecated Use `replaceRedirectCallbackUrls` instead. This method will be removed in a future version. */ - replaceRedirectCallbackUrLs( - data: ReplaceRedirectCallbackUrlsData, - ): CancelablePromise; + replaceRedirectCallbackUrLs( + options: Options, + ): ReturnType< + typeof CallbacksOriginal.replaceRedirectCallbackUrls + >; /** * @deprecated Use `deleteCallbackUrls` instead. This method will be removed in a future version. */ - deleteCallbackUrLs( - data: DeleteCallbackUrlsData, - ): CancelablePromise; + deleteCallbackUrLs( + options: Options, + ): ReturnType>; /** * @deprecated Use `getLogoutUrls` instead. This method will be removed in a future version. */ - getLogoutUrLs( - data: GetLogoutUrlsData, - ): CancelablePromise; + getLogoutUrLs( + options: Options, + ): ReturnType>; /** * @deprecated Use `addLogoutRedirectUrls` instead. This method will be removed in a future version. */ - addLogoutRedirectUrLs( - data: AddLogoutRedirectUrlsData, - ): CancelablePromise; + addLogoutRedirectUrLs( + options: Options, + ): ReturnType>; /** * @deprecated Use `replaceLogoutRedirectUrls` instead. This method will be removed in a future version. */ - replaceLogoutRedirectUrLs( - data: ReplaceLogoutRedirectUrlsData, - ): CancelablePromise; + replaceLogoutRedirectUrLs( + options: Options, + ): ReturnType< + typeof CallbacksOriginal.replaceLogoutRedirectUrls + >; /** * @deprecated Use `deleteLogoutUrls` instead. This method will be removed in a future version. */ - deleteLogoutUrLs( - data: DeleteLogoutUrlsData, - ): CancelablePromise; + deleteLogoutUrLs( + options: Options, + ): ReturnType>; } // Add deprecated method aliases to the Callbacks class @@ -88,73 +84,73 @@ Object.assign(CallbacksOriginal, { /** * @deprecated Use `getCallbackUrls` instead. This method will be removed in a future version. */ - getCallbackUrLs( - data: GetCallbackUrlsData, - ): CancelablePromise { - return CallbacksOriginal.getCallbackUrls(data); + getCallbackUrLs( + options: Options, + ) { + return CallbacksOriginal.getCallbackUrls(options); }, /** * @deprecated Use `addRedirectCallbackUrls` instead. This method will be removed in a future version. */ - addRedirectCallbackUrLs( - data: AddRedirectCallbackUrlsData, - ): CancelablePromise { - return CallbacksOriginal.addRedirectCallbackUrls(data); + addRedirectCallbackUrLs( + options: Options, + ) { + return CallbacksOriginal.addRedirectCallbackUrls(options); }, /** * @deprecated Use `replaceRedirectCallbackUrls` instead. This method will be removed in a future version. */ - replaceRedirectCallbackUrLs( - data: ReplaceRedirectCallbackUrlsData, - ): CancelablePromise { - return CallbacksOriginal.replaceRedirectCallbackUrls(data); + replaceRedirectCallbackUrLs( + options: Options, + ) { + return CallbacksOriginal.replaceRedirectCallbackUrls(options); }, /** * @deprecated Use `deleteCallbackUrls` instead. This method will be removed in a future version. */ - deleteCallbackUrLs( - data: DeleteCallbackUrlsData, - ): CancelablePromise { - return CallbacksOriginal.deleteCallbackUrls(data); + deleteCallbackUrLs( + options: Options, + ) { + return CallbacksOriginal.deleteCallbackUrls(options); }, /** * @deprecated Use `getLogoutUrls` instead. This method will be removed in a future version. */ - getLogoutUrLs( - data: GetLogoutUrlsData, - ): CancelablePromise { - return CallbacksOriginal.getLogoutUrls(data); + getLogoutUrLs( + options: Options, + ) { + return CallbacksOriginal.getLogoutUrls(options); }, /** * @deprecated Use `addLogoutRedirectUrls` instead. This method will be removed in a future version. */ - addLogoutRedirectUrLs( - data: AddLogoutRedirectUrlsData, - ): CancelablePromise { - return CallbacksOriginal.addLogoutRedirectUrls(data); + addLogoutRedirectUrLs( + options: Options, + ) { + return CallbacksOriginal.addLogoutRedirectUrls(options); }, /** * @deprecated Use `replaceLogoutRedirectUrls` instead. This method will be removed in a future version. */ - replaceLogoutRedirectUrLs( - data: ReplaceLogoutRedirectUrlsData, - ): CancelablePromise { - return CallbacksOriginal.replaceLogoutRedirectUrls(data); + replaceLogoutRedirectUrLs( + options: Options, + ) { + return CallbacksOriginal.replaceLogoutRedirectUrls(options); }, /** * @deprecated Use `deleteLogoutUrls` instead. This method will be removed in a future version. */ - deleteLogoutUrLs( - data: DeleteLogoutUrlsData, - ): CancelablePromise { - return CallbacksOriginal.deleteLogoutUrls(data); + deleteLogoutUrLs( + options: Options, + ) { + return CallbacksOriginal.deleteLogoutUrls(options); }, }); diff --git a/lib/api/client.gen.ts b/lib/api/client.gen.ts new file mode 100644 index 0000000..9c88abf --- /dev/null +++ b/lib/api/client.gen.ts @@ -0,0 +1,27 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { + type ClientOptions, + type Config, + createClient, + createConfig, +} from "./client"; +import type { ClientOptions as ClientOptions2 } from "./types.gen"; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = ( + override?: Config, +) => Config & T>; + +export const client = createClient( + createConfig({ + baseUrl: "https://your_kinde_subdomain.kinde.com", + }), +); diff --git a/lib/api/client/client.gen.ts b/lib/api/client/client.gen.ts new file mode 100644 index 0000000..303fab6 --- /dev/null +++ b/lib/api/client/client.gen.ts @@ -0,0 +1,324 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { createSseClient } from "../core/serverSentEvents.gen"; +import type { HttpMethod } from "../core/types.gen"; +import { getValidRequestBody } from "../core/utils.gen"; +import type { + Client, + Config, + RequestOptions, + ResolvedRequestOptions, +} from "./types.gen"; +import { + buildUrl, + createConfig, + createInterceptors, + getParseAs, + mergeConfigs, + mergeHeaders, + setAuthParams, +} from "./utils.gen"; + +type ReqInit = Omit & { + body?: any; + headers: ReturnType; +}; + +export const createClient = (config: Config = {}): Client => { + let _config = mergeConfigs(createConfig(), config); + + const getConfig = (): Config => ({ ..._config }); + + const setConfig = (config: Config): Config => { + _config = mergeConfigs(_config, config); + return getConfig(); + }; + + const interceptors = createInterceptors< + Request, + Response, + unknown, + ResolvedRequestOptions + >(); + + const beforeRequest = async < + TData = unknown, + TResponseStyle extends "data" | "fields" = "fields", + ThrowOnError extends boolean = boolean, + Url extends string = string, + >( + options: RequestOptions, + ) => { + const opts = { + ..._config, + ...options, + fetch: options.fetch ?? _config.fetch ?? globalThis.fetch, + headers: mergeHeaders(_config.headers, options.headers), + serializedBody: undefined as string | undefined, + }; + + if (opts.security) { + await setAuthParams({ + ...opts, + security: opts.security, + }); + } + + if (opts.requestValidator) { + await opts.requestValidator(opts); + } + + if (opts.body !== undefined && opts.bodySerializer) { + opts.serializedBody = opts.bodySerializer(opts.body) as + | string + | undefined; + } + + // remove Content-Type header if body is empty to avoid sending invalid requests + if (opts.body === undefined || opts.serializedBody === "") { + opts.headers.delete("Content-Type"); + } + + const resolvedOpts = opts as typeof opts & + ResolvedRequestOptions; + const url = buildUrl(resolvedOpts); + + return { opts: resolvedOpts, url }; + }; + + const request: Client["request"] = async (options) => { + const { opts, url } = await beforeRequest(options); + const requestInit: ReqInit = { + redirect: "follow", + ...opts, + body: getValidRequestBody(opts), + }; + + let request = new Request(url, requestInit); + + for (const fn of interceptors.request.fns) { + if (fn) { + request = await fn(request, opts); + } + } + + // fetch must be assigned here, otherwise it would throw the error: + // TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation + const _fetch = opts.fetch!; + let response: Response; + + try { + response = await _fetch(request); + } catch (error) { + // Handle fetch exceptions (AbortError, network errors, etc.) + let finalError = error; + + for (const fn of interceptors.error.fns) { + if (fn) { + finalError = (await fn( + error, + undefined as any, + request, + opts, + )) as unknown; + } + } + + finalError = finalError || ({} as unknown); + + if (opts.throwOnError) { + throw finalError; + } + + // Return error response + return opts.responseStyle === "data" + ? undefined + : { + error: finalError, + request, + response: undefined as any, + }; + } + + for (const fn of interceptors.response.fns) { + if (fn) { + response = await fn(response, request, opts); + } + } + + const result = { + request, + response, + }; + + if (response.ok) { + const parseAs = + (opts.parseAs === "auto" + ? getParseAs(response.headers.get("Content-Type")) + : opts.parseAs) ?? "json"; + + if ( + response.status === 204 || + response.headers.get("Content-Length") === "0" + ) { + let emptyData: any; + switch (parseAs) { + case "arrayBuffer": + case "blob": + case "text": + emptyData = await response[parseAs](); + break; + case "formData": + emptyData = new FormData(); + break; + case "stream": + emptyData = response.body; + break; + case "json": + default: + emptyData = {}; + break; + } + return opts.responseStyle === "data" + ? emptyData + : { + data: emptyData, + ...result, + }; + } + + let data: any; + switch (parseAs) { + case "arrayBuffer": + case "blob": + case "formData": + case "text": + data = await response[parseAs](); + break; + case "json": { + // Some servers return 200 with no Content-Length and empty body. + // response.json() would throw; read as text and parse if non-empty. + const text = await response.text(); + data = text ? JSON.parse(text) : {}; + break; + } + case "stream": + return opts.responseStyle === "data" + ? response.body + : { + data: response.body, + ...result, + }; + } + + if (parseAs === "json") { + if (opts.responseValidator) { + await opts.responseValidator(data); + } + + if (opts.responseTransformer) { + data = await opts.responseTransformer(data); + } + } + + return opts.responseStyle === "data" + ? data + : { + data, + ...result, + }; + } + + const textError = await response.text(); + let jsonError: unknown; + + try { + jsonError = JSON.parse(textError); + } catch { + // noop + } + + const error = jsonError ?? textError; + let finalError = error; + + for (const fn of interceptors.error.fns) { + if (fn) { + finalError = (await fn(error, response, request, opts)) as string; + } + } + + finalError = finalError || ({} as string); + + if (opts.throwOnError) { + throw finalError; + } + + // TODO: we probably want to return error and improve types + return opts.responseStyle === "data" + ? undefined + : { + error: finalError, + ...result, + }; + }; + + const makeMethodFn = + (method: Uppercase) => (options: RequestOptions) => + request({ ...options, method }); + + const makeSseFn = + (method: Uppercase) => async (options: RequestOptions) => { + const { opts, url } = await beforeRequest(options); + return createSseClient({ + ...opts, + body: opts.body as BodyInit | null | undefined, + headers: opts.headers as unknown as Record, + method, + onRequest: async (url, init) => { + let request = new Request(url, init); + for (const fn of interceptors.request.fns) { + if (fn) { + request = await fn(request, opts); + } + } + return request; + }, + serializedBody: getValidRequestBody(opts) as + | BodyInit + | null + | undefined, + url, + }); + }; + + const _buildUrl: Client["buildUrl"] = (options) => + buildUrl({ ..._config, ...options }); + + return { + buildUrl: _buildUrl, + connect: makeMethodFn("CONNECT"), + delete: makeMethodFn("DELETE"), + get: makeMethodFn("GET"), + getConfig, + head: makeMethodFn("HEAD"), + interceptors, + options: makeMethodFn("OPTIONS"), + patch: makeMethodFn("PATCH"), + post: makeMethodFn("POST"), + put: makeMethodFn("PUT"), + request, + setConfig, + sse: { + connect: makeSseFn("CONNECT"), + delete: makeSseFn("DELETE"), + get: makeSseFn("GET"), + head: makeSseFn("HEAD"), + options: makeSseFn("OPTIONS"), + patch: makeSseFn("PATCH"), + post: makeSseFn("POST"), + put: makeSseFn("PUT"), + trace: makeSseFn("TRACE"), + }, + trace: makeMethodFn("TRACE"), + } as Client; +}; diff --git a/lib/api/client/index.ts b/lib/api/client/index.ts new file mode 100644 index 0000000..4602312 --- /dev/null +++ b/lib/api/client/index.ts @@ -0,0 +1,25 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type { Auth } from "../core/auth.gen"; +export type { QuerySerializerOptions } from "../core/bodySerializer.gen"; +export { + formDataBodySerializer, + jsonBodySerializer, + urlSearchParamsBodySerializer, +} from "../core/bodySerializer.gen"; +export { buildClientParams } from "../core/params.gen"; +export { serializeQueryKeyValue } from "../core/queryKeySerializer.gen"; +export { createClient } from "./client.gen"; +export type { + Client, + ClientOptions, + Config, + CreateClientConfig, + Options, + RequestOptions, + RequestResult, + ResolvedRequestOptions, + ResponseStyle, + TDataShape, +} from "./types.gen"; +export { createConfig, mergeHeaders } from "./utils.gen"; diff --git a/lib/api/client/types.gen.ts b/lib/api/client/types.gen.ts new file mode 100644 index 0000000..181205b --- /dev/null +++ b/lib/api/client/types.gen.ts @@ -0,0 +1,243 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Auth } from "../core/auth.gen"; +import type { + ServerSentEventsOptions, + ServerSentEventsResult, +} from "../core/serverSentEvents.gen"; +import type { + Client as CoreClient, + Config as CoreConfig, +} from "../core/types.gen"; +import type { Middleware } from "./utils.gen"; + +export type ResponseStyle = "data" | "fields"; + +export interface Config + extends Omit, + CoreConfig { + /** + * Base URL for all requests made by this client. + */ + baseUrl?: T["baseUrl"]; + /** + * Fetch API implementation. You can use this option to provide a custom + * fetch instance. + * + * @default globalThis.fetch + */ + fetch?: typeof fetch; + /** + * Please don't use the Fetch client for Next.js applications. The `next` + * options won't have any effect. + * + * Install {@link https://www.npmjs.com/package/@hey-api/client-next `@hey-api/client-next`} instead. + */ + next?: never; + /** + * Return the response data parsed in a specified format. By default, `auto` + * will infer the appropriate method from the `Content-Type` response header. + * You can override this behavior with any of the {@link Body} methods. + * Select `stream` if you don't want to parse response data at all. + * + * @default 'auto' + */ + parseAs?: + | "arrayBuffer" + | "auto" + | "blob" + | "formData" + | "json" + | "stream" + | "text"; + /** + * Should we return only data or multiple fields (data, error, response, etc.)? + * + * @default 'fields' + */ + responseStyle?: ResponseStyle; + /** + * Throw an error instead of returning it in the response? + * + * @default false + */ + throwOnError?: T["throwOnError"]; +} + +export interface RequestOptions< + TData = unknown, + TResponseStyle extends ResponseStyle = "fields", + ThrowOnError extends boolean = boolean, + Url extends string = string, +> extends Config<{ + responseStyle: TResponseStyle; + throwOnError: ThrowOnError; + }>, + Pick< + ServerSentEventsOptions, + | "onRequest" + | "onSseError" + | "onSseEvent" + | "sseDefaultRetryDelay" + | "sseMaxRetryAttempts" + | "sseMaxRetryDelay" + > { + /** + * Any body that you want to add to your request. + * + * {@link https://developer.mozilla.org/docs/Web/API/fetch#body} + */ + body?: unknown; + path?: Record; + query?: Record; + /** + * Security mechanism(s) to use for the request. + */ + security?: ReadonlyArray; + url: Url; +} + +export interface ResolvedRequestOptions< + TResponseStyle extends ResponseStyle = "fields", + ThrowOnError extends boolean = boolean, + Url extends string = string, +> extends RequestOptions { + headers: Headers; + serializedBody?: string; +} + +export type RequestResult< + TData = unknown, + TError = unknown, + ThrowOnError extends boolean = boolean, + TResponseStyle extends ResponseStyle = "fields", +> = ThrowOnError extends true + ? Promise< + TResponseStyle extends "data" + ? TData extends Record + ? TData[keyof TData] + : TData + : { + data: TData extends Record + ? TData[keyof TData] + : TData; + request: Request; + response: Response; + } + > + : Promise< + TResponseStyle extends "data" + ? + | (TData extends Record + ? TData[keyof TData] + : TData) + | undefined + : ( + | { + data: TData extends Record + ? TData[keyof TData] + : TData; + error: undefined; + } + | { + data: undefined; + error: TError extends Record + ? TError[keyof TError] + : TError; + } + ) & { + request: Request; + response: Response; + } + >; + +export interface ClientOptions { + baseUrl?: string; + responseStyle?: ResponseStyle; + throwOnError?: boolean; +} + +type MethodFn = < + TData = unknown, + TError = unknown, + ThrowOnError extends boolean = false, + TResponseStyle extends ResponseStyle = "fields", +>( + options: Omit, "method">, +) => RequestResult; + +type SseFn = < + TData = unknown, + TError = unknown, + ThrowOnError extends boolean = false, + TResponseStyle extends ResponseStyle = "fields", +>( + options: Omit, "method">, +) => Promise>; + +type RequestFn = < + TData = unknown, + TError = unknown, + ThrowOnError extends boolean = false, + TResponseStyle extends ResponseStyle = "fields", +>( + options: Omit, "method"> & + Pick< + Required>, + "method" + >, +) => RequestResult; + +type BuildUrlFn = < + TData extends { + body?: unknown; + path?: Record; + query?: Record; + url: string; + }, +>( + options: TData & Options, +) => string; + +export type Client = CoreClient< + RequestFn, + Config, + MethodFn, + BuildUrlFn, + SseFn +> & { + interceptors: Middleware; +}; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = ( + override?: Config, +) => Config & T>; + +export interface TDataShape { + body?: unknown; + headers?: unknown; + path?: unknown; + query?: unknown; + url: string; +} + +type OmitKeys = Pick>; + +export type Options< + TData extends TDataShape = TDataShape, + ThrowOnError extends boolean = boolean, + TResponse = unknown, + TResponseStyle extends ResponseStyle = "fields", +> = OmitKeys< + RequestOptions, + "body" | "path" | "query" | "url" +> & + ([TData] extends [never] ? unknown : Omit); diff --git a/lib/api/client/utils.gen.ts b/lib/api/client/utils.gen.ts new file mode 100644 index 0000000..8df9544 --- /dev/null +++ b/lib/api/client/utils.gen.ts @@ -0,0 +1,337 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { getAuthToken } from "../core/auth.gen"; +import type { QuerySerializerOptions } from "../core/bodySerializer.gen"; +import { jsonBodySerializer } from "../core/bodySerializer.gen"; +import { + serializeArrayParam, + serializeObjectParam, + serializePrimitiveParam, +} from "../core/pathSerializer.gen"; +import { getUrl } from "../core/utils.gen"; +import type { + Client, + ClientOptions, + Config, + RequestOptions, +} from "./types.gen"; + +export const createQuerySerializer = ({ + parameters = {}, + ...args +}: QuerySerializerOptions = {}) => { + const querySerializer = (queryParams: T) => { + const search: string[] = []; + if (queryParams && typeof queryParams === "object") { + for (const name in queryParams) { + const value = queryParams[name]; + + if (value === undefined || value === null) { + continue; + } + + const options = parameters[name] || args; + + if (Array.isArray(value)) { + const serializedArray = serializeArrayParam({ + allowReserved: options.allowReserved, + explode: true, + name, + style: "form", + value, + ...options.array, + }); + if (serializedArray) search.push(serializedArray); + } else if (typeof value === "object") { + const serializedObject = serializeObjectParam({ + allowReserved: options.allowReserved, + explode: true, + name, + style: "deepObject", + value: value as Record, + ...options.object, + }); + if (serializedObject) search.push(serializedObject); + } else { + const serializedPrimitive = serializePrimitiveParam({ + allowReserved: options.allowReserved, + name, + value: value as string, + }); + if (serializedPrimitive) search.push(serializedPrimitive); + } + } + } + return search.join("&"); + }; + return querySerializer; +}; + +/** + * Infers parseAs value from provided Content-Type header. + */ +export const getParseAs = ( + contentType: string | null, +): Exclude => { + if (!contentType) { + // If no Content-Type header is provided, the best we can do is return the raw response body, + // which is effectively the same as the 'stream' option. + return "stream"; + } + + const cleanContent = contentType.split(";")[0]?.trim(); + + if (!cleanContent) { + return; + } + + if ( + cleanContent.startsWith("application/json") || + cleanContent.endsWith("+json") + ) { + return "json"; + } + + if (cleanContent === "multipart/form-data") { + return "formData"; + } + + if ( + ["application/", "audio/", "image/", "video/"].some((type) => + cleanContent.startsWith(type), + ) + ) { + return "blob"; + } + + if (cleanContent.startsWith("text/")) { + return "text"; + } + + return; +}; + +const checkForExistence = ( + options: Pick & { + headers: Headers; + }, + name?: string, +): boolean => { + if (!name) { + return false; + } + if ( + options.headers.has(name) || + options.query?.[name] || + options.headers.get("Cookie")?.includes(`${name}=`) + ) { + return true; + } + return false; +}; + +export const setAuthParams = async ({ + security, + ...options +}: Pick, "security"> & + Pick & { + headers: Headers; + }) => { + for (const auth of security) { + if (checkForExistence(options, auth.name)) { + continue; + } + + const token = await getAuthToken(auth, options.auth); + + if (!token) { + continue; + } + + const name = auth.name ?? "Authorization"; + + switch (auth.in) { + case "query": + if (!options.query) { + options.query = {}; + } + options.query[name] = token; + break; + case "cookie": + options.headers.append("Cookie", `${name}=${token}`); + break; + case "header": + default: + options.headers.set(name, token); + break; + } + } +}; + +export const buildUrl: Client["buildUrl"] = (options) => + getUrl({ + baseUrl: options.baseUrl as string, + path: options.path, + query: options.query, + querySerializer: + typeof options.querySerializer === "function" + ? options.querySerializer + : createQuerySerializer(options.querySerializer), + url: options.url, + }); + +export const mergeConfigs = (a: Config, b: Config): Config => { + const config = { ...a, ...b }; + if (config.baseUrl?.endsWith("/")) { + config.baseUrl = config.baseUrl.substring(0, config.baseUrl.length - 1); + } + config.headers = mergeHeaders(a.headers, b.headers); + return config; +}; + +const headersEntries = (headers: Headers): Array<[string, string]> => { + const entries: Array<[string, string]> = []; + headers.forEach((value, key) => { + entries.push([key, value]); + }); + return entries; +}; + +export const mergeHeaders = ( + ...headers: Array["headers"] | undefined> +): Headers => { + const mergedHeaders = new Headers(); + for (const header of headers) { + if (!header) { + continue; + } + + const iterator = + header instanceof Headers + ? headersEntries(header) + : Object.entries(header); + + for (const [key, value] of iterator) { + if (value === null) { + mergedHeaders.delete(key); + } else if (Array.isArray(value)) { + for (const v of value) { + mergedHeaders.append(key, v as string); + } + } else if (value !== undefined) { + // assume object headers are meant to be JSON stringified, i.e., their + // content value in OpenAPI specification is 'application/json' + mergedHeaders.set( + key, + typeof value === "object" ? JSON.stringify(value) : (value as string), + ); + } + } + } + return mergedHeaders; +}; + +type ErrInterceptor = ( + error: Err, + response: Res, + request: Req, + options: Options, +) => Err | Promise; + +type ReqInterceptor = ( + request: Req, + options: Options, +) => Req | Promise; + +type ResInterceptor = ( + response: Res, + request: Req, + options: Options, +) => Res | Promise; + +class Interceptors { + fns: Array = []; + + clear(): void { + this.fns = []; + } + + eject(id: number | Interceptor): void { + const index = this.getInterceptorIndex(id); + if (this.fns[index]) { + this.fns[index] = null; + } + } + + exists(id: number | Interceptor): boolean { + const index = this.getInterceptorIndex(id); + return Boolean(this.fns[index]); + } + + getInterceptorIndex(id: number | Interceptor): number { + if (typeof id === "number") { + return this.fns[id] ? id : -1; + } + return this.fns.indexOf(id); + } + + update( + id: number | Interceptor, + fn: Interceptor, + ): number | Interceptor | false { + const index = this.getInterceptorIndex(id); + if (this.fns[index]) { + this.fns[index] = fn; + return id; + } + return false; + } + + use(fn: Interceptor): number { + this.fns.push(fn); + return this.fns.length - 1; + } +} + +export interface Middleware { + error: Interceptors>; + request: Interceptors>; + response: Interceptors>; +} + +export const createInterceptors = (): Middleware< + Req, + Res, + Err, + Options +> => ({ + error: new Interceptors>(), + request: new Interceptors>(), + response: new Interceptors>(), +}); + +const defaultQuerySerializer = createQuerySerializer({ + allowReserved: false, + array: { + explode: true, + style: "form", + }, + object: { + explode: true, + style: "deepObject", + }, +}); + +const defaultHeaders = { + "Content-Type": "application/json", +}; + +export const createConfig = ( + override: Config & T> = {}, +): Config & T> => ({ + ...jsonBodySerializer, + headers: defaultHeaders, + parseAs: "auto", + querySerializer: defaultQuerySerializer, + ...override, +}); diff --git a/lib/api/core/ApiError.ts b/lib/api/core/ApiError.ts deleted file mode 100644 index 1d07bb3..0000000 --- a/lib/api/core/ApiError.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type { ApiRequestOptions } from "./ApiRequestOptions"; -import type { ApiResult } from "./ApiResult"; - -export class ApiError extends Error { - public readonly url: string; - public readonly status: number; - public readonly statusText: string; - public readonly body: unknown; - public readonly request: ApiRequestOptions; - - constructor( - request: ApiRequestOptions, - response: ApiResult, - message: string, - ) { - super(message); - - this.name = "ApiError"; - this.url = response.url; - this.status = response.status; - this.statusText = response.statusText; - this.body = response.body; - this.request = request; - } -} diff --git a/lib/api/core/ApiRequestOptions.ts b/lib/api/core/ApiRequestOptions.ts deleted file mode 100644 index 45e204f..0000000 --- a/lib/api/core/ApiRequestOptions.ts +++ /dev/null @@ -1,21 +0,0 @@ -export type ApiRequestOptions = { - readonly body?: any; - readonly cookies?: Record; - readonly errors?: Record; - readonly formData?: Record | any[] | Blob | File; - readonly headers?: Record; - readonly mediaType?: string; - readonly method: - | "DELETE" - | "GET" - | "HEAD" - | "OPTIONS" - | "PATCH" - | "POST" - | "PUT"; - readonly path?: Record; - readonly query?: Record; - readonly responseHeader?: string; - readonly responseTransformer?: (data: unknown) => Promise; - readonly url: string; -}; diff --git a/lib/api/core/ApiResult.ts b/lib/api/core/ApiResult.ts deleted file mode 100644 index 05040ba..0000000 --- a/lib/api/core/ApiResult.ts +++ /dev/null @@ -1,7 +0,0 @@ -export type ApiResult = { - readonly body: TData; - readonly ok: boolean; - readonly status: number; - readonly statusText: string; - readonly url: string; -}; diff --git a/lib/api/core/CancelablePromise.ts b/lib/api/core/CancelablePromise.ts deleted file mode 100644 index 0640e98..0000000 --- a/lib/api/core/CancelablePromise.ts +++ /dev/null @@ -1,126 +0,0 @@ -export class CancelError extends Error { - constructor(message: string) { - super(message); - this.name = "CancelError"; - } - - public get isCancelled(): boolean { - return true; - } -} - -export interface OnCancel { - readonly isResolved: boolean; - readonly isRejected: boolean; - readonly isCancelled: boolean; - - (cancelHandler: () => void): void; -} - -export class CancelablePromise implements Promise { - private _isResolved: boolean; - private _isRejected: boolean; - private _isCancelled: boolean; - readonly cancelHandlers: (() => void)[]; - readonly promise: Promise; - private _resolve?: (value: T | PromiseLike) => void; - private _reject?: (reason?: unknown) => void; - - constructor( - executor: ( - resolve: (value: T | PromiseLike) => void, - reject: (reason?: unknown) => void, - onCancel: OnCancel, - ) => void, - ) { - this._isResolved = false; - this._isRejected = false; - this._isCancelled = false; - this.cancelHandlers = []; - this.promise = new Promise((resolve, reject) => { - this._resolve = resolve; - this._reject = reject; - - const onResolve = (value: T | PromiseLike): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isResolved = true; - if (this._resolve) this._resolve(value); - }; - - const onReject = (reason?: unknown): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isRejected = true; - if (this._reject) this._reject(reason); - }; - - const onCancel = (cancelHandler: () => void): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this.cancelHandlers.push(cancelHandler); - }; - - Object.defineProperty(onCancel, "isResolved", { - get: (): boolean => this._isResolved, - }); - - Object.defineProperty(onCancel, "isRejected", { - get: (): boolean => this._isRejected, - }); - - Object.defineProperty(onCancel, "isCancelled", { - get: (): boolean => this._isCancelled, - }); - - return executor(onResolve, onReject, onCancel as OnCancel); - }); - } - - get [Symbol.toStringTag]() { - return "Cancellable Promise"; - } - - public then( - onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, - onRejected?: ((reason: unknown) => TResult2 | PromiseLike) | null, - ): Promise { - return this.promise.then(onFulfilled, onRejected); - } - - public catch( - onRejected?: ((reason: unknown) => TResult | PromiseLike) | null, - ): Promise { - return this.promise.catch(onRejected); - } - - public finally(onFinally?: (() => void) | null): Promise { - return this.promise.finally(onFinally); - } - - public cancel(): void { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isCancelled = true; - if (this.cancelHandlers.length) { - try { - for (const cancelHandler of this.cancelHandlers) { - cancelHandler(); - } - } catch (error) { - console.warn("Cancellation threw an error", error); - return; - } - } - this.cancelHandlers.length = 0; - if (this._reject) this._reject(new CancelError("Request aborted")); - } - - public get isCancelled(): boolean { - return this._isCancelled; - } -} diff --git a/lib/api/core/OpenAPI.ts b/lib/api/core/OpenAPI.ts deleted file mode 100644 index 0defc0c..0000000 --- a/lib/api/core/OpenAPI.ts +++ /dev/null @@ -1,56 +0,0 @@ -import type { ApiRequestOptions } from "./ApiRequestOptions"; - -type Headers = Record; -type Middleware = (value: T) => T | Promise; -type Resolver = (options: ApiRequestOptions) => Promise; - -export class Interceptors { - _fns: Middleware[]; - - constructor() { - this._fns = []; - } - - eject(fn: Middleware): void { - const index = this._fns.indexOf(fn); - if (index !== -1) { - this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; - } - } - - use(fn: Middleware): void { - this._fns = [...this._fns, fn]; - } -} - -export type OpenAPIConfig = { - BASE: string; - CREDENTIALS: "include" | "omit" | "same-origin"; - ENCODE_PATH?: ((path: string) => string) | undefined; - HEADERS?: Headers | Resolver | undefined; - PASSWORD?: string | Resolver | undefined; - TOKEN?: string | Resolver | undefined; - USERNAME?: string | Resolver | undefined; - VERSION: string; - WITH_CREDENTIALS: boolean; - interceptors: { - request: Interceptors; - response: Interceptors; - }; -}; - -export const OpenAPI: OpenAPIConfig = { - BASE: "https://your_kinde_subdomain.kinde.com", - CREDENTIALS: "include", - ENCODE_PATH: undefined, - HEADERS: undefined, - PASSWORD: undefined, - TOKEN: undefined, - USERNAME: undefined, - VERSION: "1", - WITH_CREDENTIALS: false, - interceptors: { - request: new Interceptors(), - response: new Interceptors(), - }, -}; diff --git a/lib/api/core/auth.gen.ts b/lib/api/core/auth.gen.ts new file mode 100644 index 0000000..3d74115 --- /dev/null +++ b/lib/api/core/auth.gen.ts @@ -0,0 +1,42 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type AuthToken = string | undefined; + +export interface Auth { + /** + * Which part of the request do we use to send the auth? + * + * @default 'header' + */ + in?: "header" | "query" | "cookie"; + /** + * Header or query parameter name. + * + * @default 'Authorization' + */ + name?: string; + scheme?: "basic" | "bearer"; + type: "apiKey" | "http"; +} + +export const getAuthToken = async ( + auth: Auth, + callback: ((auth: Auth) => Promise | AuthToken) | AuthToken, +): Promise => { + const token = + typeof callback === "function" ? await callback(auth) : callback; + + if (!token) { + return; + } + + if (auth.scheme === "bearer") { + return `Bearer ${token}`; + } + + if (auth.scheme === "basic") { + return `Basic ${btoa(token)}`; + } + + return token; +}; diff --git a/lib/api/core/bodySerializer.gen.ts b/lib/api/core/bodySerializer.gen.ts new file mode 100644 index 0000000..6aadfde --- /dev/null +++ b/lib/api/core/bodySerializer.gen.ts @@ -0,0 +1,96 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { + ArrayStyle, + ObjectStyle, + SerializerOptions, +} from "./pathSerializer.gen"; + +export type QuerySerializer = (query: Record) => string; + +export type BodySerializer = (body: unknown) => unknown; + +type QuerySerializerOptionsObject = { + allowReserved?: boolean; + array?: Partial>; + object?: Partial>; +}; + +export type QuerySerializerOptions = QuerySerializerOptionsObject & { + /** + * Per-parameter serialization overrides. When provided, these settings + * override the global array/object settings for specific parameter names. + */ + parameters?: Record; +}; + +const serializeFormDataPair = ( + data: FormData, + key: string, + value: unknown, +): void => { + if (typeof value === "string" || value instanceof Blob) { + data.append(key, value); + } else if (value instanceof Date) { + data.append(key, value.toISOString()); + } else { + data.append(key, JSON.stringify(value)); + } +}; + +const serializeUrlSearchParamsPair = ( + data: URLSearchParams, + key: string, + value: unknown, +): void => { + if (typeof value === "string") { + data.append(key, value); + } else { + data.append(key, JSON.stringify(value)); + } +}; + +export const formDataBodySerializer = { + bodySerializer: (body: unknown): FormData => { + const data = new FormData(); + + Object.entries(body as Record).forEach(([key, value]) => { + if (value === undefined || value === null) { + return; + } + if (Array.isArray(value)) { + value.forEach((v) => serializeFormDataPair(data, key, v)); + } else { + serializeFormDataPair(data, key, value); + } + }); + + return data; + }, +}; + +export const jsonBodySerializer = { + bodySerializer: (body: unknown): string => + JSON.stringify(body, (_key, value) => + typeof value === "bigint" ? value.toString() : value, + ), +}; + +export const urlSearchParamsBodySerializer = { + bodySerializer: (body: unknown): string => { + const data = new URLSearchParams(); + + Object.entries(body as Record).forEach(([key, value]) => { + if (value === undefined || value === null) { + return; + } + if (Array.isArray(value)) { + value.forEach((v) => serializeUrlSearchParamsPair(data, key, v)); + } else { + serializeUrlSearchParamsPair(data, key, value); + } + }); + + return data.toString(); + }, +}; diff --git a/lib/api/core/params.gen.ts b/lib/api/core/params.gen.ts new file mode 100644 index 0000000..28764e7 --- /dev/null +++ b/lib/api/core/params.gen.ts @@ -0,0 +1,181 @@ +// This file is auto-generated by @hey-api/openapi-ts + +type Slot = "body" | "headers" | "path" | "query"; + +export type Field = + | { + in: Exclude; + /** + * Field name. This is the name we want the user to see and use. + */ + key: string; + /** + * Field mapped name. This is the name we want to use in the request. + * If omitted, we use the same value as `key`. + */ + map?: string; + } + | { + in: Extract; + /** + * Key isn't required for bodies. + */ + key?: string; + map?: string; + } + | { + /** + * Field name. This is the name we want the user to see and use. + */ + key: string; + /** + * Field mapped name. This is the name we want to use in the request. + * If `in` is omitted, `map` aliases `key` to the transport layer. + */ + map: Slot; + }; + +export interface Fields { + allowExtra?: Partial>; + args?: ReadonlyArray; +} + +export type FieldsConfig = ReadonlyArray; + +const extraPrefixesMap: Record = { + $body_: "body", + $headers_: "headers", + $path_: "path", + $query_: "query", +}; +const extraPrefixes = Object.entries(extraPrefixesMap); + +type KeyMap = Map< + string, + | { + in: Slot; + map?: string; + } + | { + in?: never; + map: Slot; + } +>; + +const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => { + if (!map) { + map = new Map(); + } + + for (const config of fields) { + if ("in" in config) { + if (config.key) { + map.set(config.key, { + in: config.in, + map: config.map, + }); + } + } else if ("key" in config) { + map.set(config.key, { + map: config.map, + }); + } else if (config.args) { + buildKeyMap(config.args, map); + } + } + + return map; +}; + +interface Params { + body: unknown; + headers: Record; + path: Record; + query: Record; +} + +const stripEmptySlots = (params: Params) => { + for (const [slot, value] of Object.entries(params)) { + if ( + value && + typeof value === "object" && + !Array.isArray(value) && + !Object.keys(value).length + ) { + delete params[slot as Slot]; + } + } +}; + +export const buildClientParams = ( + args: ReadonlyArray, + fields: FieldsConfig, +) => { + const params: Params = { + body: {}, + headers: {}, + path: {}, + query: {}, + }; + + const map = buildKeyMap(fields); + + let config: FieldsConfig[number] | undefined; + + for (const [index, arg] of args.entries()) { + if (fields[index]) { + config = fields[index]; + } + + if (!config) { + continue; + } + + if ("in" in config) { + if (config.key) { + const field = map.get(config.key)!; + const name = field.map || config.key; + if (field.in) { + (params[field.in] as Record)[name] = arg; + } + } else { + params.body = arg; + } + } else { + for (const [key, value] of Object.entries(arg ?? {})) { + const field = map.get(key); + + if (field) { + if (field.in) { + const name = field.map || key; + (params[field.in] as Record)[name] = value; + } else { + params[field.map] = value; + } + } else { + const extra = extraPrefixes.find(([prefix]) => + key.startsWith(prefix), + ); + + if (extra) { + const [prefix, slot] = extra; + (params[slot] as Record)[ + key.slice(prefix.length) + ] = value; + } else if ("allowExtra" in config && config.allowExtra) { + for (const [slot, allowed] of Object.entries(config.allowExtra)) { + if (allowed) { + (params[slot as Slot] as Record)[key] = value; + break; + } + } + } + } + } + } + } + + stripEmptySlots(params); + + return params; +}; diff --git a/lib/api/core/pathSerializer.gen.ts b/lib/api/core/pathSerializer.gen.ts new file mode 100644 index 0000000..034aa68 --- /dev/null +++ b/lib/api/core/pathSerializer.gen.ts @@ -0,0 +1,181 @@ +// This file is auto-generated by @hey-api/openapi-ts + +interface SerializeOptions + extends SerializePrimitiveOptions, + SerializerOptions {} + +interface SerializePrimitiveOptions { + allowReserved?: boolean; + name: string; +} + +export interface SerializerOptions { + /** + * @default true + */ + explode: boolean; + style: T; +} + +export type ArrayStyle = "form" | "spaceDelimited" | "pipeDelimited"; +export type ArraySeparatorStyle = ArrayStyle | MatrixStyle; +type MatrixStyle = "label" | "matrix" | "simple"; +export type ObjectStyle = "form" | "deepObject"; +type ObjectSeparatorStyle = ObjectStyle | MatrixStyle; + +interface SerializePrimitiveParam extends SerializePrimitiveOptions { + value: string; +} + +export const separatorArrayExplode = (style: ArraySeparatorStyle) => { + switch (style) { + case "label": + return "."; + case "matrix": + return ";"; + case "simple": + return ","; + default: + return "&"; + } +}; + +export const separatorArrayNoExplode = (style: ArraySeparatorStyle) => { + switch (style) { + case "form": + return ","; + case "pipeDelimited": + return "|"; + case "spaceDelimited": + return "%20"; + default: + return ","; + } +}; + +export const separatorObjectExplode = (style: ObjectSeparatorStyle) => { + switch (style) { + case "label": + return "."; + case "matrix": + return ";"; + case "simple": + return ","; + default: + return "&"; + } +}; + +export const serializeArrayParam = ({ + allowReserved, + explode, + name, + style, + value, +}: SerializeOptions & { + value: unknown[]; +}) => { + if (!explode) { + const joinedValues = ( + allowReserved ? value : value.map((v) => encodeURIComponent(v as string)) + ).join(separatorArrayNoExplode(style)); + switch (style) { + case "label": + return `.${joinedValues}`; + case "matrix": + return `;${name}=${joinedValues}`; + case "simple": + return joinedValues; + default: + return `${name}=${joinedValues}`; + } + } + + const separator = separatorArrayExplode(style); + const joinedValues = value + .map((v) => { + if (style === "label" || style === "simple") { + return allowReserved ? v : encodeURIComponent(v as string); + } + + return serializePrimitiveParam({ + allowReserved, + name, + value: v as string, + }); + }) + .join(separator); + return style === "label" || style === "matrix" + ? separator + joinedValues + : joinedValues; +}; + +export const serializePrimitiveParam = ({ + allowReserved, + name, + value, +}: SerializePrimitiveParam) => { + if (value === undefined || value === null) { + return ""; + } + + if (typeof value === "object") { + throw new Error( + "Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.", + ); + } + + return `${name}=${allowReserved ? value : encodeURIComponent(value)}`; +}; + +export const serializeObjectParam = ({ + allowReserved, + explode, + name, + style, + value, + valueOnly, +}: SerializeOptions & { + value: Record | Date; + valueOnly?: boolean; +}) => { + if (value instanceof Date) { + return valueOnly ? value.toISOString() : `${name}=${value.toISOString()}`; + } + + if (style !== "deepObject" && !explode) { + let values: string[] = []; + Object.entries(value).forEach(([key, v]) => { + values = [ + ...values, + key, + allowReserved ? (v as string) : encodeURIComponent(v as string), + ]; + }); + const joinedValues = values.join(","); + switch (style) { + case "form": + return `${name}=${joinedValues}`; + case "label": + return `.${joinedValues}`; + case "matrix": + return `;${name}=${joinedValues}`; + default: + return joinedValues; + } + } + + const separator = separatorObjectExplode(style); + const joinedValues = Object.entries(value) + .map(([key, v]) => + serializePrimitiveParam({ + allowReserved, + name: style === "deepObject" ? `${name}[${key}]` : key, + value: v as string, + }), + ) + .join(separator); + return style === "label" || style === "matrix" + ? separator + joinedValues + : joinedValues; +}; diff --git a/lib/api/core/queryKeySerializer.gen.ts b/lib/api/core/queryKeySerializer.gen.ts new file mode 100644 index 0000000..0713164 --- /dev/null +++ b/lib/api/core/queryKeySerializer.gen.ts @@ -0,0 +1,136 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * JSON-friendly union that mirrors what Pinia Colada can hash. + */ +export type JsonValue = + | null + | string + | number + | boolean + | JsonValue[] + | { [key: string]: JsonValue }; + +/** + * Replacer that converts non-JSON values (bigint, Date, etc.) to safe substitutes. + */ +export const queryKeyJsonReplacer = (_key: string, value: unknown) => { + if ( + value === undefined || + typeof value === "function" || + typeof value === "symbol" + ) { + return undefined; + } + if (typeof value === "bigint") { + return value.toString(); + } + if (value instanceof Date) { + return value.toISOString(); + } + return value; +}; + +/** + * Safely stringifies a value and parses it back into a JsonValue. + */ +export const stringifyToJsonValue = (input: unknown): JsonValue | undefined => { + try { + const json = JSON.stringify(input, queryKeyJsonReplacer); + if (json === undefined) { + return undefined; + } + return JSON.parse(json) as JsonValue; + } catch { + return undefined; + } +}; + +/** + * Detects plain objects (including objects with a null prototype). + */ +const isPlainObject = (value: unknown): value is Record => { + if (value === null || typeof value !== "object") { + return false; + } + const prototype = Object.getPrototypeOf(value as object); + return prototype === Object.prototype || prototype === null; +}; + +/** + * Turns URLSearchParams into a sorted JSON object for deterministic keys. + */ +const serializeSearchParams = (params: URLSearchParams): JsonValue => { + const entries = Array.from(params.entries()).sort(([a], [b]) => + a.localeCompare(b), + ); + const result: Record = {}; + + for (const [key, value] of entries) { + const existing = result[key]; + if (existing === undefined) { + result[key] = value; + continue; + } + + if (Array.isArray(existing)) { + (existing as string[]).push(value); + } else { + result[key] = [existing, value]; + } + } + + return result; +}; + +/** + * Normalizes any accepted value into a JSON-friendly shape for query keys. + */ +export const serializeQueryKeyValue = ( + value: unknown, +): JsonValue | undefined => { + if (value === null) { + return null; + } + + if ( + typeof value === "string" || + typeof value === "number" || + typeof value === "boolean" + ) { + return value; + } + + if ( + value === undefined || + typeof value === "function" || + typeof value === "symbol" + ) { + return undefined; + } + + if (typeof value === "bigint") { + return value.toString(); + } + + if (value instanceof Date) { + return value.toISOString(); + } + + if (Array.isArray(value)) { + return stringifyToJsonValue(value); + } + + if ( + typeof URLSearchParams !== "undefined" && + value instanceof URLSearchParams + ) { + return serializeSearchParams(value); + } + + if (isPlainObject(value)) { + return stringifyToJsonValue(value); + } + + return undefined; +}; diff --git a/lib/api/core/request.ts b/lib/api/core/request.ts deleted file mode 100644 index 870c3c1..0000000 --- a/lib/api/core/request.ts +++ /dev/null @@ -1,400 +0,0 @@ -import { ApiError } from "./ApiError"; -import type { ApiRequestOptions } from "./ApiRequestOptions"; -import type { ApiResult } from "./ApiResult"; -import { CancelablePromise } from "./CancelablePromise"; -import type { OnCancel } from "./CancelablePromise"; -import type { OpenAPIConfig } from "./OpenAPI"; - -export const isString = (value: unknown): value is string => { - return typeof value === "string"; -}; - -export const isStringWithValue = (value: unknown): value is string => { - return isString(value) && value !== ""; -}; - -export const isBlob = (value: any): value is Blob => { - return value instanceof Blob; -}; - -export const isFormData = (value: unknown): value is FormData => { - return value instanceof FormData; -}; - -export const base64 = (str: string): string => { - try { - return btoa(str); - } catch (err) { - // @ts-ignore - return Buffer.from(str).toString("base64"); - } -}; - -export const getQueryString = (params: Record): string => { - const qs: string[] = []; - - const append = (key: string, value: unknown) => { - qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); - }; - - const encodePair = (key: string, value: unknown) => { - if (value === undefined || value === null) { - return; - } - - if (value instanceof Date) { - append(key, value.toISOString()); - } else if (Array.isArray(value)) { - value.forEach((v) => encodePair(key, v)); - } else if (typeof value === "object") { - Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); - } else { - append(key, value); - } - }; - - Object.entries(params).forEach(([key, value]) => encodePair(key, value)); - - return qs.length ? `?${qs.join("&")}` : ""; -}; - -const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { - const encoder = config.ENCODE_PATH || encodeURI; - - const path = options.url - .replace("{api-version}", config.VERSION) - .replace(/{(.*?)}/g, (substring: string, group: string) => { - if (options.path?.hasOwnProperty(group)) { - return encoder(String(options.path[group])); - } - return substring; - }); - - const url = config.BASE + path; - return options.query ? url + getQueryString(options.query) : url; -}; - -export const getFormData = ( - options: ApiRequestOptions, -): FormData | undefined => { - if (options.formData) { - const formData = new FormData(); - - const process = (key: string, value: unknown) => { - if (isString(value) || isBlob(value)) { - formData.append(key, value); - } else { - formData.append(key, JSON.stringify(value)); - } - }; - - Object.entries(options.formData) - .filter(([, value]) => value !== undefined && value !== null) - .forEach(([key, value]) => { - if (Array.isArray(value)) { - value.forEach((v) => process(key, v)); - } else { - process(key, value); - } - }); - - return formData; - } - return undefined; -}; - -type Resolver = (options: ApiRequestOptions) => Promise; - -export const resolve = async ( - options: ApiRequestOptions, - resolver?: T | Resolver, -): Promise => { - if (typeof resolver === "function") { - return (resolver as Resolver)(options); - } - return resolver; -}; - -export const getHeaders = async ( - config: OpenAPIConfig, - options: ApiRequestOptions, -): Promise => { - const [token, username, password, additionalHeaders] = await Promise.all([ - // @ts-ignore - resolve(options, config.TOKEN), - // @ts-ignore - resolve(options, config.USERNAME), - // @ts-ignore - resolve(options, config.PASSWORD), - // @ts-ignore - resolve(options, config.HEADERS), - ]); - - const headers = Object.entries({ - Accept: "application/json", - ...additionalHeaders, - ...options.headers, - }) - .filter(([, value]) => value !== undefined && value !== null) - .reduce( - (headers, [key, value]) => ({ - ...headers, - [key]: String(value), - }), - {} as Record, - ); - - if (isStringWithValue(token)) { - headers["Authorization"] = `Bearer ${token}`; - } - - if (isStringWithValue(username) && isStringWithValue(password)) { - const credentials = base64(`${username}:${password}`); - headers["Authorization"] = `Basic ${credentials}`; - } - - if (options.body !== undefined) { - if (options.mediaType) { - headers["Content-Type"] = options.mediaType; - } else if (isBlob(options.body)) { - headers["Content-Type"] = options.body.type || "application/octet-stream"; - } else if (isString(options.body)) { - headers["Content-Type"] = "text/plain"; - } else if (!isFormData(options.body)) { - headers["Content-Type"] = "application/json"; - } - } - - return new Headers(headers); -}; - -export const getRequestBody = (options: ApiRequestOptions): unknown => { - if (options.body !== undefined) { - if ( - options.mediaType?.includes("application/json") || - options.mediaType?.includes("+json") - ) { - return JSON.stringify(options.body); - } else if ( - isString(options.body) || - isBlob(options.body) || - isFormData(options.body) - ) { - return options.body; - } else { - return JSON.stringify(options.body); - } - } - return undefined; -}; - -export const sendRequest = async ( - config: OpenAPIConfig, - options: ApiRequestOptions, - url: string, - body: any, - formData: FormData | undefined, - headers: Headers, - onCancel: OnCancel, -): Promise => { - const controller = new AbortController(); - - let request: RequestInit = { - headers, - body: body ?? formData, - method: options.method, - signal: controller.signal, - }; - - if (config.WITH_CREDENTIALS) { - request.credentials = config.CREDENTIALS; - } - - for (const fn of config.interceptors.request._fns) { - request = await fn(request); - } - - onCancel(() => controller.abort()); - - return await fetch(url, request); -}; - -export const getResponseHeader = ( - response: Response, - responseHeader?: string, -): string | undefined => { - if (responseHeader) { - const content = response.headers.get(responseHeader); - if (isString(content)) { - return content; - } - } - return undefined; -}; - -export const getResponseBody = async (response: Response): Promise => { - if (response.status !== 204) { - try { - const contentType = response.headers.get("Content-Type"); - if (contentType) { - const binaryTypes = [ - "application/octet-stream", - "application/pdf", - "application/zip", - "audio/", - "image/", - "video/", - ]; - if ( - contentType.includes("application/json") || - contentType.includes("+json") - ) { - return await response.json(); - } else if (binaryTypes.some((type) => contentType.includes(type))) { - return await response.blob(); - } else if (contentType.includes("multipart/form-data")) { - return await response.formData(); - } else if (contentType.includes("text/")) { - return await response.text(); - } - } - } catch (error) { - console.error(error); - } - } - return undefined; -}; - -export const catchErrorCodes = ( - options: ApiRequestOptions, - result: ApiResult, -): void => { - const errors: Record = { - 400: "Bad Request", - 401: "Unauthorized", - 402: "Payment Required", - 403: "Forbidden", - 404: "Not Found", - 405: "Method Not Allowed", - 406: "Not Acceptable", - 407: "Proxy Authentication Required", - 408: "Request Timeout", - 409: "Conflict", - 410: "Gone", - 411: "Length Required", - 412: "Precondition Failed", - 413: "Payload Too Large", - 414: "URI Too Long", - 415: "Unsupported Media Type", - 416: "Range Not Satisfiable", - 417: "Expectation Failed", - 418: "Im a teapot", - 421: "Misdirected Request", - 422: "Unprocessable Content", - 423: "Locked", - 424: "Failed Dependency", - 425: "Too Early", - 426: "Upgrade Required", - 428: "Precondition Required", - 429: "Too Many Requests", - 431: "Request Header Fields Too Large", - 451: "Unavailable For Legal Reasons", - 500: "Internal Server Error", - 501: "Not Implemented", - 502: "Bad Gateway", - 503: "Service Unavailable", - 504: "Gateway Timeout", - 505: "HTTP Version Not Supported", - 506: "Variant Also Negotiates", - 507: "Insufficient Storage", - 508: "Loop Detected", - 510: "Not Extended", - 511: "Network Authentication Required", - ...options.errors, - }; - - const error = errors[result.status]; - if (error) { - throw new ApiError(options, result, error); - } - - if (!result.ok) { - const errorStatus = result.status ?? "unknown"; - const errorStatusText = result.statusText ?? "unknown"; - const errorBody = (() => { - try { - return JSON.stringify(result.body, null, 2); - } catch (e) { - return undefined; - } - })(); - - throw new ApiError( - options, - result, - `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}`, - ); - } -}; - -/** - * Request method - * @param config The OpenAPI configuration object - * @param options The request options from the service - * @returns CancelablePromise - * @throws ApiError - */ -export const request = ( - config: OpenAPIConfig, - options: ApiRequestOptions, -): CancelablePromise => { - return new CancelablePromise(async (resolve, reject, onCancel) => { - try { - const url = getUrl(config, options); - const formData = getFormData(options); - const body = getRequestBody(options); - const headers = await getHeaders(config, options); - - if (!onCancel.isCancelled) { - let response = await sendRequest( - config, - options, - url, - body, - formData, - headers, - onCancel, - ); - - for (const fn of config.interceptors.response._fns) { - response = await fn(response); - } - - const responseBody = await getResponseBody(response); - const responseHeader = getResponseHeader( - response, - options.responseHeader, - ); - - let transformedBody = responseBody; - if (options.responseTransformer && response.ok) { - transformedBody = await options.responseTransformer(responseBody); - } - - const result: ApiResult = { - url, - ok: response.ok, - status: response.status, - statusText: response.statusText, - body: responseHeader ?? transformedBody, - }; - - catchErrorCodes(options, result); - - resolve(result.body); - } - } catch (error) { - reject(error); - } - }); -}; diff --git a/lib/api/core/serverSentEvents.gen.ts b/lib/api/core/serverSentEvents.gen.ts new file mode 100644 index 0000000..acbc7cf --- /dev/null +++ b/lib/api/core/serverSentEvents.gen.ts @@ -0,0 +1,265 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Config } from "./types.gen"; + +export type ServerSentEventsOptions = Omit< + RequestInit, + "method" +> & + Pick & { + /** + * Fetch API implementation. You can use this option to provide a custom + * fetch instance. + * + * @default globalThis.fetch + */ + fetch?: typeof fetch; + /** + * Implementing clients can call request interceptors inside this hook. + */ + onRequest?: (url: string, init: RequestInit) => Promise; + /** + * Callback invoked when a network or parsing error occurs during streaming. + * + * This option applies only if the endpoint returns a stream of events. + * + * @param error The error that occurred. + */ + onSseError?: (error: unknown) => void; + /** + * Callback invoked when an event is streamed from the server. + * + * This option applies only if the endpoint returns a stream of events. + * + * @param event Event streamed from the server. + * @returns Nothing (void). + */ + onSseEvent?: (event: StreamEvent) => void; + serializedBody?: RequestInit["body"]; + /** + * Default retry delay in milliseconds. + * + * This option applies only if the endpoint returns a stream of events. + * + * @default 3000 + */ + sseDefaultRetryDelay?: number; + /** + * Maximum number of retry attempts before giving up. + */ + sseMaxRetryAttempts?: number; + /** + * Maximum retry delay in milliseconds. + * + * Applies only when exponential backoff is used. + * + * This option applies only if the endpoint returns a stream of events. + * + * @default 30000 + */ + sseMaxRetryDelay?: number; + /** + * Optional sleep function for retry backoff. + * + * Defaults to using `setTimeout`. + */ + sseSleepFn?: (ms: number) => Promise; + url: string; + }; + +export interface StreamEvent { + data: TData; + event?: string; + id?: string; + retry?: number; +} + +export type ServerSentEventsResult< + TData = unknown, + TReturn = void, + TNext = unknown, +> = { + stream: AsyncGenerator< + TData extends Record ? TData[keyof TData] : TData, + TReturn, + TNext + >; +}; + +export function createSseClient({ + onRequest, + onSseError, + onSseEvent, + responseTransformer, + responseValidator, + sseDefaultRetryDelay, + sseMaxRetryAttempts, + sseMaxRetryDelay, + sseSleepFn, + url, + ...options +}: ServerSentEventsOptions): ServerSentEventsResult { + let lastEventId: string | undefined; + + const sleep = + sseSleepFn ?? + ((ms: number) => new Promise((resolve) => setTimeout(resolve, ms))); + + const createStream = async function* () { + let retryDelay: number = sseDefaultRetryDelay ?? 3000; + let attempt = 0; + const signal = options.signal ?? new AbortController().signal; + + while (true) { + if (signal.aborted) break; + + attempt++; + + const headers = + options.headers instanceof Headers + ? options.headers + : new Headers(options.headers as Record | undefined); + + if (lastEventId !== undefined) { + headers.set("Last-Event-ID", lastEventId); + } + + try { + const requestInit: RequestInit = { + redirect: "follow", + ...options, + body: options.serializedBody, + headers, + signal, + }; + let request = new Request(url, requestInit); + if (onRequest) { + request = await onRequest(url, requestInit); + } + // fetch must be assigned here, otherwise it would throw the error: + // TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation + const _fetch = options.fetch ?? globalThis.fetch; + const response = await _fetch(request); + + if (!response.ok) + throw new Error( + `SSE failed: ${response.status} ${response.statusText}`, + ); + + if (!response.body) throw new Error("No body in SSE response"); + + const reader = response.body + .pipeThrough(new TextDecoderStream()) + .getReader(); + + let buffer = ""; + + const abortHandler = () => { + try { + reader.cancel(); + } catch { + // noop + } + }; + + signal.addEventListener("abort", abortHandler); + + try { + while (true) { + const { done, value } = await reader.read(); + if (done) break; + buffer += value; + buffer = buffer.replace(/\r\n?/g, "\n"); // normalize line endings + + const chunks = buffer.split("\n\n"); + buffer = chunks.pop() ?? ""; + + for (const chunk of chunks) { + const lines = chunk.split("\n"); + const dataLines: Array = []; + let eventName: string | undefined; + + for (const line of lines) { + if (line.startsWith("data:")) { + dataLines.push(line.replace(/^data:\s*/, "")); + } else if (line.startsWith("event:")) { + eventName = line.replace(/^event:\s*/, ""); + } else if (line.startsWith("id:")) { + lastEventId = line.replace(/^id:\s*/, ""); + } else if (line.startsWith("retry:")) { + const parsed = Number.parseInt( + line.replace(/^retry:\s*/, ""), + 10, + ); + if (!Number.isNaN(parsed)) { + retryDelay = parsed; + } + } + } + + let data: unknown; + let parsedJson = false; + + if (dataLines.length) { + const rawData = dataLines.join("\n"); + try { + data = JSON.parse(rawData); + parsedJson = true; + } catch { + data = rawData; + } + } + + if (parsedJson) { + if (responseValidator) { + await responseValidator(data); + } + + if (responseTransformer) { + data = await responseTransformer(data); + } + } + + onSseEvent?.({ + data, + event: eventName, + id: lastEventId, + retry: retryDelay, + }); + + if (dataLines.length) { + yield data as any; + } + } + } + } finally { + signal.removeEventListener("abort", abortHandler); + reader.releaseLock(); + } + + break; // exit loop on normal completion + } catch (error) { + // connection failed or aborted; retry after delay + onSseError?.(error); + + if ( + sseMaxRetryAttempts !== undefined && + attempt >= sseMaxRetryAttempts + ) { + break; // stop after firing error + } + + // exponential backoff: double retry each attempt, cap at 30s + const backoff = Math.min( + retryDelay * 2 ** (attempt - 1), + sseMaxRetryDelay ?? 30000, + ); + await sleep(backoff); + } + } + }; + + const stream = createStream(); + + return { stream }; +} diff --git a/lib/api/core/types.gen.ts b/lib/api/core/types.gen.ts new file mode 100644 index 0000000..2b11454 --- /dev/null +++ b/lib/api/core/types.gen.ts @@ -0,0 +1,118 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Auth, AuthToken } from "./auth.gen"; +import type { + BodySerializer, + QuerySerializer, + QuerySerializerOptions, +} from "./bodySerializer.gen"; + +export type HttpMethod = + | "connect" + | "delete" + | "get" + | "head" + | "options" + | "patch" + | "post" + | "put" + | "trace"; + +export type Client< + RequestFn = never, + Config = unknown, + MethodFn = never, + BuildUrlFn = never, + SseFn = never, +> = { + /** + * Returns the final request URL. + */ + buildUrl: BuildUrlFn; + getConfig: () => Config; + request: RequestFn; + setConfig: (config: Config) => Config; +} & { + [K in HttpMethod]: MethodFn; +} & ([SseFn] extends [never] + ? { sse?: never } + : { sse: { [K in HttpMethod]: SseFn } }); + +export interface Config { + /** + * Auth token or a function returning auth token. The resolved value will be + * added to the request payload as defined by its `security` array. + */ + auth?: ((auth: Auth) => Promise | AuthToken) | AuthToken; + /** + * A function for serializing request body parameter. By default, + * {@link JSON.stringify()} will be used. + */ + bodySerializer?: BodySerializer | null; + /** + * An object containing any HTTP headers that you want to pre-populate your + * `Headers` object with. + * + * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more} + */ + headers?: + | RequestInit["headers"] + | Record< + string, + | string + | number + | boolean + | (string | number | boolean)[] + | null + | undefined + | unknown + >; + /** + * The request method. + * + * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more} + */ + method?: Uppercase; + /** + * A function for serializing request query parameters. By default, arrays + * will be exploded in form style, objects will be exploded in deepObject + * style, and reserved characters are percent-encoded. + * + * This method will have no effect if the native `paramsSerializer()` Axios + * API function is used. + * + * {@link https://swagger.io/docs/specification/serialization/#query View examples} + */ + querySerializer?: QuerySerializer | QuerySerializerOptions; + /** + * A function validating request data. This is useful if you want to ensure + * the request conforms to the desired shape, so it can be safely sent to + * the server. + */ + requestValidator?: (data: unknown) => Promise; + /** + * A function transforming response data before it's returned. This is useful + * for post-processing data, e.g., converting ISO strings into Date objects. + */ + responseTransformer?: (data: unknown) => Promise; + /** + * A function validating response data. This is useful if you want to ensure + * the response conforms to the desired shape, so it can be safely passed to + * the transformers and returned to the user. + */ + responseValidator?: (data: unknown) => Promise; +} + +type IsExactlyNeverOrNeverUndefined = [T] extends [never] + ? true + : [T] extends [never | undefined] + ? [undefined] extends [T] + ? false + : true + : false; + +export type OmitNever> = { + [K in keyof T as IsExactlyNeverOrNeverUndefined extends true + ? never + : K]: T[K]; +}; diff --git a/lib/api/core/utils.gen.ts b/lib/api/core/utils.gen.ts new file mode 100644 index 0000000..fcabdf7 --- /dev/null +++ b/lib/api/core/utils.gen.ts @@ -0,0 +1,143 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { BodySerializer, QuerySerializer } from "./bodySerializer.gen"; +import { + type ArraySeparatorStyle, + serializeArrayParam, + serializeObjectParam, + serializePrimitiveParam, +} from "./pathSerializer.gen"; + +export interface PathSerializer { + path: Record; + url: string; +} + +export const PATH_PARAM_RE = /\{[^{}]+\}/g; + +export const defaultPathSerializer = ({ path, url: _url }: PathSerializer) => { + let url = _url; + const matches = _url.match(PATH_PARAM_RE); + if (matches) { + for (const match of matches) { + let explode = false; + let name = match.substring(1, match.length - 1); + let style: ArraySeparatorStyle = "simple"; + + if (name.endsWith("*")) { + explode = true; + name = name.substring(0, name.length - 1); + } + + if (name.startsWith(".")) { + name = name.substring(1); + style = "label"; + } else if (name.startsWith(";")) { + name = name.substring(1); + style = "matrix"; + } + + const value = path[name]; + + if (value === undefined || value === null) { + continue; + } + + if (Array.isArray(value)) { + url = url.replace( + match, + serializeArrayParam({ explode, name, style, value }), + ); + continue; + } + + if (typeof value === "object") { + url = url.replace( + match, + serializeObjectParam({ + explode, + name, + style, + value: value as Record, + valueOnly: true, + }), + ); + continue; + } + + if (style === "matrix") { + url = url.replace( + match, + `;${serializePrimitiveParam({ + name, + value: value as string, + })}`, + ); + continue; + } + + const replaceValue = encodeURIComponent( + style === "label" ? `.${value as string}` : (value as string), + ); + url = url.replace(match, replaceValue); + } + } + return url; +}; + +export const getUrl = ({ + baseUrl, + path, + query, + querySerializer, + url: _url, +}: { + baseUrl?: string; + path?: Record; + query?: Record; + querySerializer: QuerySerializer; + url: string; +}) => { + const pathUrl = _url.startsWith("/") ? _url : `/${_url}`; + let url = (baseUrl ?? "") + pathUrl; + if (path) { + url = defaultPathSerializer({ path, url }); + } + let search = query ? querySerializer(query) : ""; + if (search.startsWith("?")) { + search = search.substring(1); + } + if (search) { + url += `?${search}`; + } + return url; +}; + +export function getValidRequestBody(options: { + body?: unknown; + bodySerializer?: BodySerializer | null; + serializedBody?: unknown; +}) { + const hasBody = options.body !== undefined; + const isSerializedBody = hasBody && options.bodySerializer; + + if (isSerializedBody) { + if ("serializedBody" in options) { + const hasSerializedBody = + options.serializedBody !== undefined && options.serializedBody !== ""; + + return hasSerializedBody ? options.serializedBody : null; + } + + // not all clients implement a serializedBody property (i.e., client-axios) + return options.body !== "" ? options.body : null; + } + + // plain/text body + if (hasBody) { + return options.body; + } + + // no body was provided + return undefined; +} diff --git a/lib/api/index.ts b/lib/api/index.ts index c665de0..cd88183 100644 --- a/lib/api/index.ts +++ b/lib/api/index.ts @@ -1,7 +1,1041 @@ // This file is auto-generated by @hey-api/openapi-ts -export { ApiError } from "./core/ApiError"; -export { CancelablePromise, CancelError } from "./core/CancelablePromise"; -export { OpenAPI, type OpenAPIConfig } from "./core/OpenAPI"; -export * from "./schemas.gen"; -export * from "./sdk.gen"; -export * from "./types.gen"; + +export { + $add_organization_users_response, + $add_role_scope_response, + $api_result, + $applications, + $authorize_app_api_response, + $category, + $connected_apps_access_token, + $connected_apps_auth_url, + $connection, + $create_api_key_response, + $create_api_scopes_response, + $create_apis_response, + $create_application_response, + $create_category_response, + $create_connection_response, + $create_environment_variable_response, + $create_identity_response, + $create_meter_usage_record_response, + $create_organization_response, + $create_property_response, + $create_roles_response, + $create_subscriber_success_response, + $create_user_response, + $create_webhook_response, + $delete_api_response, + $delete_environment_variable_response, + $delete_role_scope_response, + $delete_webhook_response, + $environment_variable, + $error, + $error_response, + $event_type, + $get_api_key_response, + $get_api_keys_response, + $get_api_response, + $get_api_scope_response, + $get_api_scopes_response, + $get_apis_response, + $get_application_response, + $get_applications_response, + $get_billing_agreements_response, + $get_billing_entitlements_response, + $get_business_response, + $get_categories_response, + $get_connections_response, + $get_environment_feature_flags_response, + $get_environment_response, + $get_environment_variable_response, + $get_environment_variables_response, + $get_event_response, + $get_event_types_response, + $get_identities_response, + $get_industries_response, + $get_organization_feature_flags_response, + $get_organization_response, + $get_organization_users_response, + $get_organizations_response, + $get_organizations_user_permissions_response, + $get_organizations_user_roles_response, + $get_permissions_response, + $get_properties_response, + $get_property_values_response, + $get_redirect_callback_urls_response, + $get_role_response, + $get_roles_response, + $get_subscriber_response, + $get_subscribers_response, + $get_timezones_response, + $get_user_mfa_response, + $get_user_sessions_response, + $get_webhooks_response, + $identity, + $logout_redirect_urls, + $not_found_response, + $organization_item_schema, + $organization_user, + $organization_user_permission, + $organization_user_role, + $organization_user_role_permissions, + $organization_users, + $permissions, + $property, + $property_value, + $read_env_logo_response, + $read_logo_response, + $redirect_callback_urls, + $role, + $role_permissions_response, + $role_scopes_response, + $roles, + $rotate_api_key_response, + $scopes, + $search_users_response, + $subscriber, + $subscribers_subscriber, + $success_response, + $update_environment_variable_response, + $update_organization_users_response, + $update_role_permissions_response, + $update_user_response, + $update_webhook_response, + $user, + $user_identity, + $users, + $users_response, + $verify_api_key_response, + $webhook, +} from "./schemas.gen"; +export { + ApiKeys, + Apis, + Applications as Applications2, + BillingAgreements, + BillingEntitlements, + BillingMeterUsage, + Business, + Callbacks, + ConnectedApps, + Connections, + Environments, + EnvironmentVariables, + FeatureFlags, + Identities, + Industries, + Mfa, + type Options, + Organizations, + Permissions as Permissions2, + Properties, + PropertyCategories, + Roles as Roles2, + Search, + Subscribers, + Timezones, + Users as Users2, + Webhooks, +} from "./sdk.gen"; +export type { + AddApiApplicationScopeData, + AddApiApplicationScopeError, + AddApiApplicationScopeErrors, + AddApiApplicationScopeResponses, + AddApiScopeData, + AddApiScopeError, + AddApiScopeErrors, + AddApiScopeResponse, + AddApiScopeResponses, + AddApisData, + AddApisError, + AddApisErrors, + AddApisResponse, + AddApisResponses, + AddLogoData, + AddLogoError, + AddLogoErrors, + AddLogoResponse, + AddLogoResponses, + AddLogoutRedirectUrlsData, + AddLogoutRedirectUrlsError, + AddLogoutRedirectUrlsErrors, + AddLogoutRedirectUrlsResponse, + AddLogoutRedirectUrlsResponses, + AddOrganizationLogoData, + AddOrganizationLogoError, + AddOrganizationLogoErrors, + AddOrganizationLogoResponse, + AddOrganizationLogoResponses, + AddOrganizationUserApiScopeData, + AddOrganizationUserApiScopeError, + AddOrganizationUserApiScopeErrors, + AddOrganizationUserApiScopeResponses, + AddOrganizationUsersData, + AddOrganizationUsersError, + AddOrganizationUsersErrors, + AddOrganizationUsersResponse, + AddOrganizationUsersResponse2, + AddOrganizationUsersResponses, + AddRedirectCallbackUrlsData, + AddRedirectCallbackUrlsError, + AddRedirectCallbackUrlsErrors, + AddRedirectCallbackUrlsResponse, + AddRedirectCallbackUrlsResponses, + AddRoleScopeData, + AddRoleScopeError, + AddRoleScopeErrors, + AddRoleScopeResponse, + AddRoleScopeResponse2, + AddRoleScopeResponses, + ApiId, + ApiResult, + ApplicationId, + Applications, + AuthorizeAppApiResponse, + Category, + ClientOptions, + ConnectedAppsAccessToken, + ConnectedAppsAuthUrl, + Connection, + CreateApiKeyData, + CreateApiKeyError, + CreateApiKeyErrors, + CreateApiKeyResponse, + CreateApiKeyResponse2, + CreateApiKeyResponses, + CreateApiScopesResponse, + CreateApisResponse, + CreateApplicationData, + CreateApplicationError, + CreateApplicationErrors, + CreateApplicationResponse, + CreateApplicationResponse2, + CreateApplicationResponses, + CreateBillingAgreementData, + CreateBillingAgreementError, + CreateBillingAgreementErrors, + CreateBillingAgreementResponse, + CreateBillingAgreementResponses, + CreateCategoryData, + CreateCategoryError, + CreateCategoryErrors, + CreateCategoryResponse, + CreateCategoryResponse2, + CreateCategoryResponses, + CreateConnectionData, + CreateConnectionError, + CreateConnectionErrors, + CreateConnectionResponse, + CreateConnectionResponse2, + CreateConnectionResponses, + CreateEnvironmentVariableData, + CreateEnvironmentVariableError, + CreateEnvironmentVariableErrors, + CreateEnvironmentVariableResponse, + CreateEnvironmentVariableResponse2, + CreateEnvironmentVariableResponses, + CreateFeatureFlagData, + CreateFeatureFlagError, + CreateFeatureFlagErrors, + CreateFeatureFlagResponse, + CreateFeatureFlagResponses, + CreateIdentityResponse, + CreateMeterUsageRecordData, + CreateMeterUsageRecordError, + CreateMeterUsageRecordErrors, + CreateMeterUsageRecordResponse, + CreateMeterUsageRecordResponse2, + CreateMeterUsageRecordResponses, + CreateOrganizationData, + CreateOrganizationError, + CreateOrganizationErrors, + CreateOrganizationResponse, + CreateOrganizationResponse2, + CreateOrganizationResponses, + CreateOrganizationUserPermissionData, + CreateOrganizationUserPermissionErrors, + CreateOrganizationUserPermissionResponse, + CreateOrganizationUserPermissionResponses, + CreateOrganizationUserRoleData, + CreateOrganizationUserRoleErrors, + CreateOrganizationUserRoleResponse, + CreateOrganizationUserRoleResponses, + CreatePermissionData, + CreatePermissionError, + CreatePermissionErrors, + CreatePermissionResponse, + CreatePermissionResponses, + CreatePropertyData, + CreatePropertyError, + CreatePropertyErrors, + CreatePropertyResponse, + CreatePropertyResponse2, + CreatePropertyResponses, + CreateRoleData, + CreateRoleError, + CreateRoleErrors, + CreateRoleResponse, + CreateRoleResponses, + CreateRolesResponse, + CreateSubscriberData, + CreateSubscriberError, + CreateSubscriberErrors, + CreateSubscriberResponse, + CreateSubscriberResponses, + CreateSubscriberSuccessResponse, + CreateUserData, + CreateUserError, + CreateUserErrors, + CreateUserIdentityData, + CreateUserIdentityError, + CreateUserIdentityErrors, + CreateUserIdentityResponse, + CreateUserIdentityResponses, + CreateUserResponse, + CreateUserResponse2, + CreateUserResponses, + CreateWebHookData, + CreateWebHookError, + CreateWebHookErrors, + CreateWebhookResponse, + CreateWebHookResponse, + CreateWebHookResponses, + DeleteApiApplicationScopeData, + DeleteApiApplicationScopeError, + DeleteApiApplicationScopeErrors, + DeleteApiApplicationScopeResponses, + DeleteApiData, + DeleteApiError, + DeleteApiErrors, + DeleteApiKeyData, + DeleteApiKeyError, + DeleteApiKeyErrors, + DeleteApiKeyResponse, + DeleteApiKeyResponses, + DeleteApiResponse, + DeleteApiResponse2, + DeleteApiResponses, + DeleteApiScopeData, + DeleteApiScopeError, + DeleteApiScopeErrors, + DeleteApiScopeResponses, + DeleteApplicationData, + DeleteApplicationError, + DeleteApplicationErrors, + DeleteApplicationResponse, + DeleteApplicationResponses, + DeleteCallbackUrlsData, + DeleteCallbackUrlsError, + DeleteCallbackUrlsErrors, + DeleteCallbackUrlsResponse, + DeleteCallbackUrlsResponses, + DeleteConnectionData, + DeleteConnectionError, + DeleteConnectionErrors, + DeleteConnectionResponse, + DeleteConnectionResponses, + DeleteEnvironementFeatureFlagOverrideData, + DeleteEnvironementFeatureFlagOverrideError, + DeleteEnvironementFeatureFlagOverrideErrors, + DeleteEnvironementFeatureFlagOverrideResponse, + DeleteEnvironementFeatureFlagOverrideResponses, + DeleteEnvironementFeatureFlagOverridesData, + DeleteEnvironementFeatureFlagOverridesError, + DeleteEnvironementFeatureFlagOverridesErrors, + DeleteEnvironementFeatureFlagOverridesResponse, + DeleteEnvironementFeatureFlagOverridesResponses, + DeleteEnvironmentVariableData, + DeleteEnvironmentVariableError, + DeleteEnvironmentVariableErrors, + DeleteEnvironmentVariableResponse, + DeleteEnvironmentVariableResponse2, + DeleteEnvironmentVariableResponses, + DeleteFeatureFlagData, + DeleteFeatureFlagError, + DeleteFeatureFlagErrors, + DeleteFeatureFlagResponse, + DeleteFeatureFlagResponses, + DeleteIdentityData, + DeleteIdentityError, + DeleteIdentityErrors, + DeleteIdentityResponse, + DeleteIdentityResponses, + DeleteLogoData, + DeleteLogoError, + DeleteLogoErrors, + DeleteLogoResponse, + DeleteLogoResponses, + DeleteLogoutUrlsData, + DeleteLogoutUrlsError, + DeleteLogoutUrlsErrors, + DeleteLogoutUrlsResponse, + DeleteLogoutUrlsResponses, + DeleteOrganizationData, + DeleteOrganizationError, + DeleteOrganizationErrors, + DeleteOrganizationFeatureFlagOverrideData, + DeleteOrganizationFeatureFlagOverrideError, + DeleteOrganizationFeatureFlagOverrideErrors, + DeleteOrganizationFeatureFlagOverrideResponse, + DeleteOrganizationFeatureFlagOverrideResponses, + DeleteOrganizationFeatureFlagOverridesData, + DeleteOrganizationFeatureFlagOverridesError, + DeleteOrganizationFeatureFlagOverridesErrors, + DeleteOrganizationFeatureFlagOverridesResponse, + DeleteOrganizationFeatureFlagOverridesResponses, + DeleteOrganizationHandleData, + DeleteOrganizationHandleError, + DeleteOrganizationHandleErrors, + DeleteOrganizationHandleResponse, + DeleteOrganizationHandleResponses, + DeleteOrganizationLogoData, + DeleteOrganizationLogoError, + DeleteOrganizationLogoErrors, + DeleteOrganizationLogoResponse, + DeleteOrganizationLogoResponses, + DeleteOrganizationResponse, + DeleteOrganizationResponses, + DeleteOrganizationUserApiScopeData, + DeleteOrganizationUserApiScopeError, + DeleteOrganizationUserApiScopeErrors, + DeleteOrganizationUserApiScopeResponses, + DeleteOrganizationUserPermissionData, + DeleteOrganizationUserPermissionError, + DeleteOrganizationUserPermissionErrors, + DeleteOrganizationUserPermissionResponse, + DeleteOrganizationUserPermissionResponses, + DeleteOrganizationUserRoleData, + DeleteOrganizationUserRoleError, + DeleteOrganizationUserRoleErrors, + DeleteOrganizationUserRoleResponse, + DeleteOrganizationUserRoleResponses, + DeletePermissionData, + DeletePermissionError, + DeletePermissionErrors, + DeletePermissionResponse, + DeletePermissionResponses, + DeletePropertyData, + DeletePropertyError, + DeletePropertyErrors, + DeletePropertyResponse, + DeletePropertyResponses, + DeleteRoleData, + DeleteRoleError, + DeleteRoleErrors, + DeleteRoleResponse, + DeleteRoleResponses, + DeleteRoleScopeData, + DeleteRoleScopeError, + DeleteRoleScopeErrors, + DeleteRoleScopeResponse, + DeleteRoleScopeResponse2, + DeleteRoleScopeResponses, + DeleteUserData, + DeleteUserError, + DeleteUserErrors, + DeleteUserResponse, + DeleteUserResponses, + DeleteUserSessionsData, + DeleteUserSessionsError, + DeleteUserSessionsErrors, + DeleteUserSessionsResponse, + DeleteUserSessionsResponses, + DeleteWebHookData, + DeleteWebHookError, + DeleteWebHookErrors, + DeleteWebhookResponse, + DeleteWebHookResponse, + DeleteWebHookResponses, + EnableConnectionData, + EnableConnectionError, + EnableConnectionErrors, + EnableConnectionResponses, + EnableOrgConnectionData, + EnableOrgConnectionError, + EnableOrgConnectionErrors, + EnableOrgConnectionResponses, + EnvironmentVariable, + Error, + ErrorResponse, + EventType, + GetApiData, + GetApiError, + GetApiErrors, + GetApiKeyData, + GetApiKeyError, + GetApiKeyErrors, + GetApiKeyResponse, + GetApiKeyResponse2, + GetApiKeyResponses, + GetApiKeysData, + GetApiKeysError, + GetApiKeysErrors, + GetApiKeysResponse, + GetApiKeysResponse2, + GetApiKeysResponses, + GetApiResponse, + GetApiResponse2, + GetApiResponses, + GetApiScopeData, + GetApiScopeError, + GetApiScopeErrors, + GetApiScopeResponse, + GetApiScopeResponse2, + GetApiScopeResponses, + GetApiScopesData, + GetApiScopesError, + GetApiScopesErrors, + GetApiScopesResponse, + GetApiScopesResponse2, + GetApiScopesResponses, + GetApisData, + GetApisError, + GetApisErrors, + GetApisResponse, + GetApisResponse2, + GetApisResponses, + GetApplicationConnectionsData, + GetApplicationConnectionsError, + GetApplicationConnectionsErrors, + GetApplicationConnectionsResponse, + GetApplicationConnectionsResponses, + GetApplicationData, + GetApplicationError, + GetApplicationErrors, + GetApplicationPropertyValuesData, + GetApplicationPropertyValuesError, + GetApplicationPropertyValuesErrors, + GetApplicationPropertyValuesResponse, + GetApplicationPropertyValuesResponses, + GetApplicationResponse, + GetApplicationResponse2, + GetApplicationResponses, + GetApplicationsData, + GetApplicationsError, + GetApplicationsErrors, + GetApplicationsResponse, + GetApplicationsResponse2, + GetApplicationsResponses, + GetBillingAgreementsData, + GetBillingAgreementsError, + GetBillingAgreementsErrors, + GetBillingAgreementsResponse, + GetBillingAgreementsResponse2, + GetBillingAgreementsResponses, + GetBillingEntitlementsData, + GetBillingEntitlementsError, + GetBillingEntitlementsErrors, + GetBillingEntitlementsResponse, + GetBillingEntitlementsResponse2, + GetBillingEntitlementsResponses, + GetBusinessData, + GetBusinessError, + GetBusinessErrors, + GetBusinessResponse, + GetBusinessResponse2, + GetBusinessResponses, + GetCallbackUrlsData, + GetCallbackUrlsError, + GetCallbackUrlsErrors, + GetCallbackUrlsResponse, + GetCallbackUrlsResponses, + GetCategoriesData, + GetCategoriesError, + GetCategoriesErrors, + GetCategoriesResponse, + GetCategoriesResponse2, + GetCategoriesResponses, + GetConnectedAppAuthUrlData, + GetConnectedAppAuthUrlError, + GetConnectedAppAuthUrlErrors, + GetConnectedAppAuthUrlResponse, + GetConnectedAppAuthUrlResponses, + GetConnectedAppTokenData, + GetConnectedAppTokenError, + GetConnectedAppTokenErrors, + GetConnectedAppTokenResponse, + GetConnectedAppTokenResponses, + GetConnectionData, + GetConnectionError, + GetConnectionErrors, + GetConnectionResponse, + GetConnectionResponses, + GetConnectionsData, + GetConnectionsError, + GetConnectionsErrors, + GetConnectionsResponse, + GetConnectionsResponse2, + GetConnectionsResponses, + GetEnvironementFeatureFlagsData, + GetEnvironementFeatureFlagsError, + GetEnvironementFeatureFlagsErrors, + GetEnvironementFeatureFlagsResponse, + GetEnvironementFeatureFlagsResponses, + GetEnvironmentData, + GetEnvironmentError, + GetEnvironmentErrors, + GetEnvironmentFeatureFlagsResponse, + GetEnvironmentResponse, + GetEnvironmentResponse2, + GetEnvironmentResponses, + GetEnvironmentVariableData, + GetEnvironmentVariableError, + GetEnvironmentVariableErrors, + GetEnvironmentVariableResponse, + GetEnvironmentVariableResponse2, + GetEnvironmentVariableResponses, + GetEnvironmentVariablesData, + GetEnvironmentVariablesError, + GetEnvironmentVariablesErrors, + GetEnvironmentVariablesResponse, + GetEnvironmentVariablesResponse2, + GetEnvironmentVariablesResponses, + GetEventData, + GetEventError, + GetEventErrors, + GetEventResponse, + GetEventResponse2, + GetEventResponses, + GetEventTypesData, + GetEventTypesError, + GetEventTypesErrors, + GetEventTypesResponse, + GetEventTypesResponse2, + GetEventTypesResponses, + GetIdentitiesResponse, + GetIdentityData, + GetIdentityError, + GetIdentityErrors, + GetIdentityResponse, + GetIdentityResponses, + GetIndustriesData, + GetIndustriesError, + GetIndustriesErrors, + GetIndustriesResponse, + GetIndustriesResponse2, + GetIndustriesResponses, + GetLogoutUrlsData, + GetLogoutUrlsError, + GetLogoutUrlsErrors, + GetLogoutUrlsResponse, + GetLogoutUrlsResponses, + GetOrganizationConnectionsData, + GetOrganizationConnectionsError, + GetOrganizationConnectionsErrors, + GetOrganizationConnectionsResponse, + GetOrganizationConnectionsResponses, + GetOrganizationData, + GetOrganizationError, + GetOrganizationErrors, + GetOrganizationFeatureFlagsData, + GetOrganizationFeatureFlagsError, + GetOrganizationFeatureFlagsErrors, + GetOrganizationFeatureFlagsResponse, + GetOrganizationFeatureFlagsResponse2, + GetOrganizationFeatureFlagsResponses, + GetOrganizationPropertyValuesData, + GetOrganizationPropertyValuesError, + GetOrganizationPropertyValuesErrors, + GetOrganizationPropertyValuesResponse, + GetOrganizationPropertyValuesResponses, + GetOrganizationResponse, + GetOrganizationResponse2, + GetOrganizationResponses, + GetOrganizationsData, + GetOrganizationsError, + GetOrganizationsErrors, + GetOrganizationsResponse, + GetOrganizationsResponse2, + GetOrganizationsResponses, + GetOrganizationsUserPermissionsResponse, + GetOrganizationsUserRolesResponse, + GetOrganizationUserPermissionsData, + GetOrganizationUserPermissionsErrors, + GetOrganizationUserPermissionsResponse, + GetOrganizationUserPermissionsResponses, + GetOrganizationUserRolesData, + GetOrganizationUserRolesErrors, + GetOrganizationUserRolesResponse, + GetOrganizationUserRolesResponses, + GetOrganizationUsersData, + GetOrganizationUsersError, + GetOrganizationUsersErrors, + GetOrganizationUsersResponse, + GetOrganizationUsersResponse2, + GetOrganizationUsersResponses, + GetOrgUserMfaData, + GetOrgUserMfaError, + GetOrgUserMfaErrors, + GetOrgUserMfaResponse, + GetOrgUserMfaResponses, + GetPermissionsData, + GetPermissionsError, + GetPermissionsErrors, + GetPermissionsResponse, + GetPermissionsResponse2, + GetPermissionsResponses, + GetPropertiesData, + GetPropertiesError, + GetPropertiesErrors, + GetPropertiesResponse, + GetPropertiesResponse2, + GetPropertiesResponses, + GetPropertyValuesResponse, + GetRedirectCallbackUrlsResponse, + GetRoleData, + GetRoleError, + GetRoleErrors, + GetRolePermissionsData, + GetRolePermissionsError, + GetRolePermissionsErrors, + GetRolePermissionsResponse, + GetRolePermissionsResponses, + GetRoleResponse, + GetRoleResponse2, + GetRoleResponses, + GetRoleScopesData, + GetRoleScopesError, + GetRoleScopesErrors, + GetRoleScopesResponse, + GetRoleScopesResponses, + GetRolesData, + GetRolesError, + GetRolesErrors, + GetRolesResponse, + GetRolesResponse2, + GetRolesResponses, + GetSubscriberData, + GetSubscriberError, + GetSubscriberErrors, + GetSubscriberResponse, + GetSubscriberResponse2, + GetSubscriberResponses, + GetSubscribersData, + GetSubscribersError, + GetSubscribersErrors, + GetSubscribersResponse, + GetSubscribersResponse2, + GetSubscribersResponses, + GetTimezonesData, + GetTimezonesError, + GetTimezonesErrors, + GetTimezonesResponse, + GetTimezonesResponse2, + GetTimezonesResponses, + GetUserDataData, + GetUserDataError, + GetUserDataErrors, + GetUserDataResponse, + GetUserDataResponses, + GetUserIdentitiesData, + GetUserIdentitiesError, + GetUserIdentitiesErrors, + GetUserIdentitiesResponse, + GetUserIdentitiesResponses, + GetUserMfaResponse, + GetUserPropertyValuesData, + GetUserPropertyValuesError, + GetUserPropertyValuesErrors, + GetUserPropertyValuesResponse, + GetUserPropertyValuesResponses, + GetUsersData, + GetUsersError, + GetUsersErrors, + GetUserSessionsData, + GetUserSessionsError, + GetUserSessionsErrors, + GetUserSessionsResponse, + GetUserSessionsResponse2, + GetUserSessionsResponses, + GetUsersMfaData, + GetUsersMfaError, + GetUsersMfaErrors, + GetUsersMfaResponse, + GetUsersMfaResponses, + GetUsersResponse, + GetUsersResponses, + GetWebHooksData, + GetWebHooksError, + GetWebHooksErrors, + GetWebhooksResponse, + GetWebHooksResponse, + GetWebHooksResponses, + Identity, + LogoutRedirectUrls, + NotFoundResponse, + OrganizationItemSchema, + OrganizationUser, + OrganizationUserPermission, + OrganizationUserRole, + OrganizationUserRolePermissions, + OrganizationUsers, + Permissions, + Property, + PropertyKey, + PropertyValue, + ReadEnvLogoResponse, + ReadLogoData, + ReadLogoError, + ReadLogoErrors, + ReadLogoResponse, + ReadLogoResponse2, + ReadLogoResponses, + ReadOrganizationLogoData, + ReadOrganizationLogoError, + ReadOrganizationLogoErrors, + ReadOrganizationLogoResponse, + ReadOrganizationLogoResponses, + RedirectCallbackUrls, + RefreshUserClaimsData, + RefreshUserClaimsError, + RefreshUserClaimsErrors, + RefreshUserClaimsResponse, + RefreshUserClaimsResponses, + RemoveConnectionData, + RemoveConnectionError, + RemoveConnectionErrors, + RemoveConnectionResponse, + RemoveConnectionResponses, + RemoveOrganizationUserData, + RemoveOrganizationUserError, + RemoveOrganizationUserErrors, + RemoveOrganizationUserResponse, + RemoveOrganizationUserResponses, + RemoveOrgConnectionData, + RemoveOrgConnectionError, + RemoveOrgConnectionErrors, + RemoveOrgConnectionResponse, + RemoveOrgConnectionResponses, + RemoveRolePermissionData, + RemoveRolePermissionError, + RemoveRolePermissionErrors, + RemoveRolePermissionResponse, + RemoveRolePermissionResponses, + ReplaceConnectionData, + ReplaceConnectionError, + ReplaceConnectionErrors, + ReplaceConnectionResponse, + ReplaceConnectionResponses, + ReplaceLogoutRedirectUrlsData, + ReplaceLogoutRedirectUrlsError, + ReplaceLogoutRedirectUrlsErrors, + ReplaceLogoutRedirectUrlsResponse, + ReplaceLogoutRedirectUrlsResponses, + ReplaceMfaData, + ReplaceMfaError, + ReplaceMfaErrors, + ReplaceMfaResponse, + ReplaceMfaResponses, + ReplaceOrganizationMfaData, + ReplaceOrganizationMfaError, + ReplaceOrganizationMfaErrors, + ReplaceOrganizationMfaResponse, + ReplaceOrganizationMfaResponses, + ReplaceRedirectCallbackUrlsData, + ReplaceRedirectCallbackUrlsError, + ReplaceRedirectCallbackUrlsErrors, + ReplaceRedirectCallbackUrlsResponse, + ReplaceRedirectCallbackUrlsResponses, + ResetOrgUserMfaAllData, + ResetOrgUserMfaAllError, + ResetOrgUserMfaAllErrors, + ResetOrgUserMfaAllResponse, + ResetOrgUserMfaAllResponses, + ResetOrgUserMfaData, + ResetOrgUserMfaError, + ResetOrgUserMfaErrors, + ResetOrgUserMfaResponse, + ResetOrgUserMfaResponses, + ResetUsersMfaAllData, + ResetUsersMfaAllError, + ResetUsersMfaAllErrors, + ResetUsersMfaAllResponse, + ResetUsersMfaAllResponses, + ResetUsersMfaData, + ResetUsersMfaError, + ResetUsersMfaErrors, + ResetUsersMfaResponse, + ResetUsersMfaResponses, + RevokeConnectedAppTokenData, + RevokeConnectedAppTokenError, + RevokeConnectedAppTokenErrors, + RevokeConnectedAppTokenResponse, + RevokeConnectedAppTokenResponses, + Role, + RolePermissionsResponse, + Roles, + RoleScopesResponse, + RotateApiKeyData, + RotateApiKeyError, + RotateApiKeyErrors, + RotateApiKeyResponse, + RotateApiKeyResponse2, + RotateApiKeyResponses, + Scopes, + SearchUsersData, + SearchUsersError, + SearchUsersErrors, + SearchUsersResponse, + SearchUsersResponse2, + SearchUsersResponses, + SetUserPasswordData, + SetUserPasswordError, + SetUserPasswordErrors, + SetUserPasswordResponse, + SetUserPasswordResponses, + Subscriber, + SubscribersSubscriber, + SuccessResponse, + UpdateApiApplicationsData, + UpdateApiApplicationsError, + UpdateApiApplicationsErrors, + UpdateApiApplicationsResponse, + UpdateApiApplicationsResponses, + UpdateApiScopeData, + UpdateApiScopeError, + UpdateApiScopeErrors, + UpdateApiScopeResponses, + UpdateApplicationData, + UpdateApplicationError, + UpdateApplicationErrors, + UpdateApplicationResponses, + UpdateApplicationsPropertyData, + UpdateApplicationsPropertyError, + UpdateApplicationsPropertyErrors, + UpdateApplicationsPropertyResponse, + UpdateApplicationsPropertyResponses, + UpdateApplicationTokensData, + UpdateApplicationTokensError, + UpdateApplicationTokensErrors, + UpdateApplicationTokensResponse, + UpdateApplicationTokensResponses, + UpdateBusinessData, + UpdateBusinessError, + UpdateBusinessErrors, + UpdateBusinessResponse, + UpdateBusinessResponses, + UpdateCategoryData, + UpdateCategoryError, + UpdateCategoryErrors, + UpdateCategoryResponse, + UpdateCategoryResponses, + UpdateConnectionData, + UpdateConnectionError, + UpdateConnectionErrors, + UpdateConnectionResponse, + UpdateConnectionResponses, + UpdateEnvironementFeatureFlagOverrideData, + UpdateEnvironementFeatureFlagOverrideError, + UpdateEnvironementFeatureFlagOverrideErrors, + UpdateEnvironementFeatureFlagOverrideResponse, + UpdateEnvironementFeatureFlagOverrideResponses, + UpdateEnvironmentVariableData, + UpdateEnvironmentVariableError, + UpdateEnvironmentVariableErrors, + UpdateEnvironmentVariableResponse, + UpdateEnvironmentVariableResponse2, + UpdateEnvironmentVariableResponses, + UpdateFeatureFlagData, + UpdateFeatureFlagError, + UpdateFeatureFlagErrors, + UpdateFeatureFlagResponse, + UpdateFeatureFlagResponses, + UpdateIdentityData, + UpdateIdentityError, + UpdateIdentityErrors, + UpdateIdentityResponse, + UpdateIdentityResponses, + UpdateOrganizationData, + UpdateOrganizationError, + UpdateOrganizationErrors, + UpdateOrganizationFeatureFlagOverrideData, + UpdateOrganizationFeatureFlagOverrideError, + UpdateOrganizationFeatureFlagOverrideErrors, + UpdateOrganizationFeatureFlagOverrideResponse, + UpdateOrganizationFeatureFlagOverrideResponses, + UpdateOrganizationPropertiesData, + UpdateOrganizationPropertiesError, + UpdateOrganizationPropertiesErrors, + UpdateOrganizationPropertiesResponse, + UpdateOrganizationPropertiesResponses, + UpdateOrganizationPropertyData, + UpdateOrganizationPropertyError, + UpdateOrganizationPropertyErrors, + UpdateOrganizationPropertyResponse, + UpdateOrganizationPropertyResponses, + UpdateOrganizationResponse, + UpdateOrganizationResponses, + UpdateOrganizationSessionsData, + UpdateOrganizationSessionsError, + UpdateOrganizationSessionsErrors, + UpdateOrganizationSessionsResponse, + UpdateOrganizationSessionsResponses, + UpdateOrganizationUsersData, + UpdateOrganizationUsersError, + UpdateOrganizationUsersErrors, + UpdateOrganizationUsersResponse, + UpdateOrganizationUsersResponse2, + UpdateOrganizationUsersResponses, + UpdatePermissionsData, + UpdatePermissionsError, + UpdatePermissionsErrors, + UpdatePermissionsResponse, + UpdatePermissionsResponses, + UpdatePropertyData, + UpdatePropertyError, + UpdatePropertyErrors, + UpdatePropertyResponse, + UpdatePropertyResponses, + UpdateRolePermissionsData, + UpdateRolePermissionsError, + UpdateRolePermissionsErrors, + UpdateRolePermissionsResponse, + UpdateRolePermissionsResponse2, + UpdateRolePermissionsResponses, + UpdateRolesData, + UpdateRolesError, + UpdateRolesErrors, + UpdateRolesResponse, + UpdateRolesResponses, + UpdateUserData, + UpdateUserError, + UpdateUserErrors, + UpdateUserFeatureFlagOverrideData, + UpdateUserFeatureFlagOverrideError, + UpdateUserFeatureFlagOverrideErrors, + UpdateUserFeatureFlagOverrideResponse, + UpdateUserFeatureFlagOverrideResponses, + UpdateUserPropertiesData, + UpdateUserPropertiesError, + UpdateUserPropertiesErrors, + UpdateUserPropertiesResponse, + UpdateUserPropertiesResponses, + UpdateUserPropertyData, + UpdateUserPropertyError, + UpdateUserPropertyErrors, + UpdateUserPropertyResponse, + UpdateUserPropertyResponses, + UpdateUserResponse, + UpdateUserResponse2, + UpdateUserResponses, + UpdateWebHookData, + UpdateWebHookError, + UpdateWebHookErrors, + UpdateWebhookResponse, + UpdateWebHookResponse, + UpdateWebHookResponses, + User, + UserIdentity, + Users, + UsersResponse, + VariableId, + VerifyApiKeyData, + VerifyApiKeyError, + VerifyApiKeyErrors, + VerifyApiKeyResponse, + VerifyApiKeyResponse2, + VerifyApiKeyResponses, + Webhook, +} from "./types.gen"; diff --git a/lib/api/sdk.gen.ts b/lib/api/sdk.gen.ts index e5e4d40..4085521 100644 --- a/lib/api/sdk.gen.ts +++ b/lib/api/sdk.gen.ts @@ -1,505 +1,658 @@ // This file is auto-generated by @hey-api/openapi-ts -import type { CancelablePromise } from "./core/CancelablePromise"; -import { OpenAPI } from "./core/OpenAPI"; -import { request as __request } from "./core/request"; +import { + type Client, + formDataBodySerializer, + type Options as Options2, + type TDataShape, +} from "./client"; +import { client } from "./client.gen"; import type { - GetApiKeysData, - GetApiKeysResponse, - CreateApiKeyData, - CreateApiKeyResponse, - GetApiKeyData, - GetApiKeyResponse, - DeleteApiKeyData, - DeleteApiKeyResponse, - RotateApiKeyData, - RotateApiKeyResponse, - VerifyApiKeyData, - VerifyApiKeyResponse, - GetApisData, - GetApisResponse, + AddApiApplicationScopeData, + AddApiApplicationScopeErrors, + AddApiApplicationScopeResponses, + AddApiScopeData, + AddApiScopeErrors, + AddApiScopeResponses, AddApisData, - AddApisResponse, - GetApiData, - GetApiResponse, + AddApisErrors, + AddApisResponses, + AddLogoData, + AddLogoErrors, + AddLogoResponses, + AddLogoutRedirectUrlsData, + AddLogoutRedirectUrlsErrors, + AddLogoutRedirectUrlsResponses, + AddOrganizationLogoData, + AddOrganizationLogoErrors, + AddOrganizationLogoResponses, + AddOrganizationUserApiScopeData, + AddOrganizationUserApiScopeErrors, + AddOrganizationUserApiScopeResponses, + AddOrganizationUsersData, + AddOrganizationUsersErrors, + AddOrganizationUsersResponses, + AddRedirectCallbackUrlsData, + AddRedirectCallbackUrlsErrors, + AddRedirectCallbackUrlsResponses, + AddRoleScopeData, + AddRoleScopeErrors, + AddRoleScopeResponses, + CreateApiKeyData, + CreateApiKeyErrors, + CreateApiKeyResponses, + CreateApplicationData, + CreateApplicationErrors, + CreateApplicationResponses, + CreateBillingAgreementData, + CreateBillingAgreementErrors, + CreateBillingAgreementResponses, + CreateCategoryData, + CreateCategoryErrors, + CreateCategoryResponses, + CreateConnectionData, + CreateConnectionErrors, + CreateConnectionResponses, + CreateEnvironmentVariableData, + CreateEnvironmentVariableErrors, + CreateEnvironmentVariableResponses, + CreateFeatureFlagData, + CreateFeatureFlagErrors, + CreateFeatureFlagResponses, + CreateMeterUsageRecordData, + CreateMeterUsageRecordErrors, + CreateMeterUsageRecordResponses, + CreateOrganizationData, + CreateOrganizationErrors, + CreateOrganizationResponses, + CreateOrganizationUserPermissionData, + CreateOrganizationUserPermissionErrors, + CreateOrganizationUserPermissionResponses, + CreateOrganizationUserRoleData, + CreateOrganizationUserRoleErrors, + CreateOrganizationUserRoleResponses, + CreatePermissionData, + CreatePermissionErrors, + CreatePermissionResponses, + CreatePropertyData, + CreatePropertyErrors, + CreatePropertyResponses, + CreateRoleData, + CreateRoleErrors, + CreateRoleResponses, + CreateSubscriberData, + CreateSubscriberErrors, + CreateSubscriberResponses, + CreateUserData, + CreateUserErrors, + CreateUserIdentityData, + CreateUserIdentityErrors, + CreateUserIdentityResponses, + CreateUserResponses, + CreateWebHookData, + CreateWebHookErrors, + CreateWebHookResponses, + DeleteApiApplicationScopeData, + DeleteApiApplicationScopeErrors, + DeleteApiApplicationScopeResponses, DeleteApiData, - DeleteApiResponse, - GetApiScopesData, - GetApiScopesResponse, - AddApiScopeData, - AddApiScopeResponse, - GetApiScopeData, - GetApiScopeResponse, - UpdateApiScopeData, - UpdateApiScopeResponse, + DeleteApiErrors, + DeleteApiKeyData, + DeleteApiKeyErrors, + DeleteApiKeyResponses, + DeleteApiResponses, DeleteApiScopeData, - DeleteApiScopeResponse, - UpdateApiApplicationsData, - UpdateApiApplicationsResponse, - AddApiApplicationScopeData, - AddApiApplicationScopeResponse, - DeleteApiApplicationScopeData, - DeleteApiApplicationScopeResponse, - GetApplicationsData, - GetApplicationsResponse, - CreateApplicationData, - CreateApplicationResponse, - GetApplicationData, - GetApplicationResponse, - UpdateApplicationData, - UpdateApplicationResponse, + DeleteApiScopeErrors, + DeleteApiScopeResponses, DeleteApplicationData, - DeleteApplicationResponse, - GetApplicationConnectionsData, - GetApplicationConnectionsResponse, + DeleteApplicationErrors, + DeleteApplicationResponses, + DeleteCallbackUrlsData, + DeleteCallbackUrlsErrors, + DeleteCallbackUrlsResponses, + DeleteConnectionData, + DeleteConnectionErrors, + DeleteConnectionResponses, + DeleteEnvironementFeatureFlagOverrideData, + DeleteEnvironementFeatureFlagOverrideErrors, + DeleteEnvironementFeatureFlagOverrideResponses, + DeleteEnvironementFeatureFlagOverridesData, + DeleteEnvironementFeatureFlagOverridesErrors, + DeleteEnvironementFeatureFlagOverridesResponses, + DeleteEnvironmentVariableData, + DeleteEnvironmentVariableErrors, + DeleteEnvironmentVariableResponses, + DeleteFeatureFlagData, + DeleteFeatureFlagErrors, + DeleteFeatureFlagResponses, + DeleteIdentityData, + DeleteIdentityErrors, + DeleteIdentityResponses, + DeleteLogoData, + DeleteLogoErrors, + DeleteLogoResponses, + DeleteLogoutUrlsData, + DeleteLogoutUrlsErrors, + DeleteLogoutUrlsResponses, + DeleteOrganizationData, + DeleteOrganizationErrors, + DeleteOrganizationFeatureFlagOverrideData, + DeleteOrganizationFeatureFlagOverrideErrors, + DeleteOrganizationFeatureFlagOverrideResponses, + DeleteOrganizationFeatureFlagOverridesData, + DeleteOrganizationFeatureFlagOverridesErrors, + DeleteOrganizationFeatureFlagOverridesResponses, + DeleteOrganizationHandleData, + DeleteOrganizationHandleErrors, + DeleteOrganizationHandleResponses, + DeleteOrganizationLogoData, + DeleteOrganizationLogoErrors, + DeleteOrganizationLogoResponses, + DeleteOrganizationResponses, + DeleteOrganizationUserApiScopeData, + DeleteOrganizationUserApiScopeErrors, + DeleteOrganizationUserApiScopeResponses, + DeleteOrganizationUserPermissionData, + DeleteOrganizationUserPermissionErrors, + DeleteOrganizationUserPermissionResponses, + DeleteOrganizationUserRoleData, + DeleteOrganizationUserRoleErrors, + DeleteOrganizationUserRoleResponses, + DeletePermissionData, + DeletePermissionErrors, + DeletePermissionResponses, + DeletePropertyData, + DeletePropertyErrors, + DeletePropertyResponses, + DeleteRoleData, + DeleteRoleErrors, + DeleteRoleResponses, + DeleteRoleScopeData, + DeleteRoleScopeErrors, + DeleteRoleScopeResponses, + DeleteUserData, + DeleteUserErrors, + DeleteUserResponses, + DeleteUserSessionsData, + DeleteUserSessionsErrors, + DeleteUserSessionsResponses, + DeleteWebHookData, + DeleteWebHookErrors, + DeleteWebHookResponses, EnableConnectionData, - EnableConnectionResponse, - RemoveConnectionData, - RemoveConnectionResponse, + EnableConnectionErrors, + EnableConnectionResponses, + EnableOrgConnectionData, + EnableOrgConnectionErrors, + EnableOrgConnectionResponses, + GetApiData, + GetApiErrors, + GetApiKeyData, + GetApiKeyErrors, + GetApiKeyResponses, + GetApiKeysData, + GetApiKeysErrors, + GetApiKeysResponses, + GetApiResponses, + GetApiScopeData, + GetApiScopeErrors, + GetApiScopeResponses, + GetApiScopesData, + GetApiScopesErrors, + GetApiScopesResponses, + GetApisData, + GetApisErrors, + GetApisResponses, + GetApplicationConnectionsData, + GetApplicationConnectionsErrors, + GetApplicationConnectionsResponses, + GetApplicationData, + GetApplicationErrors, GetApplicationPropertyValuesData, - GetApplicationPropertyValuesResponse, - UpdateApplicationsPropertyData, - UpdateApplicationsPropertyResponse, - UpdateApplicationTokensData, - UpdateApplicationTokensResponse, + GetApplicationPropertyValuesErrors, + GetApplicationPropertyValuesResponses, + GetApplicationResponses, + GetApplicationsData, + GetApplicationsErrors, + GetApplicationsResponses, GetBillingAgreementsData, - GetBillingAgreementsResponse, - CreateBillingAgreementData, - CreateBillingAgreementResponse, + GetBillingAgreementsErrors, + GetBillingAgreementsResponses, GetBillingEntitlementsData, - GetBillingEntitlementsResponse, - CreateMeterUsageRecordData, - CreateMeterUsageRecordResponse, - GetBusinessResponse, - UpdateBusinessData, - UpdateBusinessResponse, + GetBillingEntitlementsErrors, + GetBillingEntitlementsResponses, + GetBusinessData, + GetBusinessErrors, + GetBusinessResponses, GetCallbackUrlsData, - GetCallbackUrlsResponse, - AddRedirectCallbackUrlsData, - AddRedirectCallbackUrlsResponse, - ReplaceRedirectCallbackUrlsData, - ReplaceRedirectCallbackUrlsResponse, - DeleteCallbackUrlsData, - DeleteCallbackUrlsResponse, - GetLogoutUrlsData, - GetLogoutUrlsResponse, - AddLogoutRedirectUrlsData, - AddLogoutRedirectUrlsResponse, - ReplaceLogoutRedirectUrlsData, - ReplaceLogoutRedirectUrlsResponse, - DeleteLogoutUrlsData, - DeleteLogoutUrlsResponse, + GetCallbackUrlsErrors, + GetCallbackUrlsResponses, + GetCategoriesData, + GetCategoriesErrors, + GetCategoriesResponses, GetConnectedAppAuthUrlData, - GetConnectedAppAuthUrlResponse, + GetConnectedAppAuthUrlErrors, + GetConnectedAppAuthUrlResponses, GetConnectedAppTokenData, - GetConnectedAppTokenResponse, - RevokeConnectedAppTokenData, - RevokeConnectedAppTokenResponse, - GetConnectionsData, - GetConnectionsResponse, - CreateConnectionData, - CreateConnectionResponse, + GetConnectedAppTokenErrors, + GetConnectedAppTokenResponses, GetConnectionData, - GetConnectionResponse, - UpdateConnectionData, - UpdateConnectionResponse, - ReplaceConnectionData, - ReplaceConnectionResponse, - DeleteConnectionData, - DeleteConnectionResponse, - GetEnvironmentResponse, - DeleteEnvironementFeatureFlagOverridesResponse, - GetEnvironementFeatureFlagsResponse, - DeleteEnvironementFeatureFlagOverrideData, - DeleteEnvironementFeatureFlagOverrideResponse, - UpdateEnvironementFeatureFlagOverrideData, - UpdateEnvironementFeatureFlagOverrideResponse, - ReadLogoResponse, - AddLogoData, - AddLogoResponse, - DeleteLogoData, - DeleteLogoResponse, - GetEnvironmentVariablesResponse, - CreateEnvironmentVariableData, - CreateEnvironmentVariableResponse, + GetConnectionErrors, + GetConnectionResponses, + GetConnectionsData, + GetConnectionsErrors, + GetConnectionsResponses, + GetEnvironementFeatureFlagsData, + GetEnvironementFeatureFlagsErrors, + GetEnvironementFeatureFlagsResponses, + GetEnvironmentData, + GetEnvironmentErrors, + GetEnvironmentResponses, GetEnvironmentVariableData, - GetEnvironmentVariableResponse, - UpdateEnvironmentVariableData, - UpdateEnvironmentVariableResponse, - DeleteEnvironmentVariableData, - DeleteEnvironmentVariableResponse, - CreateFeatureFlagData, - CreateFeatureFlagResponse, - DeleteFeatureFlagData, - DeleteFeatureFlagResponse, - UpdateFeatureFlagData, - UpdateFeatureFlagResponse, + GetEnvironmentVariableErrors, + GetEnvironmentVariableResponses, + GetEnvironmentVariablesData, + GetEnvironmentVariablesErrors, + GetEnvironmentVariablesResponses, + GetEventData, + GetEventErrors, + GetEventResponses, + GetEventTypesData, + GetEventTypesErrors, + GetEventTypesResponses, GetIdentityData, - GetIdentityResponse, - UpdateIdentityData, - UpdateIdentityResponse, - DeleteIdentityData, - DeleteIdentityResponse, - GetIndustriesResponse, - ReplaceMfaData, - ReplaceMfaResponse, + GetIdentityErrors, + GetIdentityResponses, + GetIndustriesData, + GetIndustriesErrors, + GetIndustriesResponses, + GetLogoutUrlsData, + GetLogoutUrlsErrors, + GetLogoutUrlsResponses, + GetOrganizationConnectionsData, + GetOrganizationConnectionsErrors, + GetOrganizationConnectionsResponses, GetOrganizationData, - GetOrganizationResponse, - CreateOrganizationData, - CreateOrganizationResponse, + GetOrganizationErrors, + GetOrganizationFeatureFlagsData, + GetOrganizationFeatureFlagsErrors, + GetOrganizationFeatureFlagsResponses, + GetOrganizationPropertyValuesData, + GetOrganizationPropertyValuesErrors, + GetOrganizationPropertyValuesResponses, + GetOrganizationResponses, GetOrganizationsData, - GetOrganizationsResponse, - UpdateOrganizationData, - UpdateOrganizationResponse, - DeleteOrganizationData, - DeleteOrganizationResponse, - GetOrganizationUsersData, - GetOrganizationUsersResponse, - AddOrganizationUsersData, - AddOrganizationUsersResponse, - UpdateOrganizationUsersData, - UpdateOrganizationUsersResponse, - GetOrganizationUserRolesData, - GetOrganizationUserRolesResponse, - CreateOrganizationUserRoleData, - CreateOrganizationUserRoleResponse, - DeleteOrganizationUserRoleData, - DeleteOrganizationUserRoleResponse, + GetOrganizationsErrors, + GetOrganizationsResponses, GetOrganizationUserPermissionsData, - GetOrganizationUserPermissionsResponse, - CreateOrganizationUserPermissionData, - CreateOrganizationUserPermissionResponse, - DeleteOrganizationUserPermissionData, - DeleteOrganizationUserPermissionResponse, - RemoveOrganizationUserData, - RemoveOrganizationUserResponse, - AddOrganizationUserApiScopeData, - AddOrganizationUserApiScopeResponse, - DeleteOrganizationUserApiScopeData, - DeleteOrganizationUserApiScopeResponse, + GetOrganizationUserPermissionsErrors, + GetOrganizationUserPermissionsResponses, + GetOrganizationUserRolesData, + GetOrganizationUserRolesErrors, + GetOrganizationUserRolesResponses, + GetOrganizationUsersData, + GetOrganizationUsersErrors, + GetOrganizationUsersResponses, GetOrgUserMfaData, - GetOrgUserMfaResponse, - ResetOrgUserMfaAllData, - ResetOrgUserMfaAllResponse, - ResetOrgUserMfaData, - ResetOrgUserMfaResponse, - GetOrganizationFeatureFlagsData, - GetOrganizationFeatureFlagsResponse, - DeleteOrganizationFeatureFlagOverridesData, - DeleteOrganizationFeatureFlagOverridesResponse, - DeleteOrganizationFeatureFlagOverrideData, - DeleteOrganizationFeatureFlagOverrideResponse, - UpdateOrganizationFeatureFlagOverrideData, - UpdateOrganizationFeatureFlagOverrideResponse, - UpdateOrganizationPropertyData, - UpdateOrganizationPropertyResponse, - GetOrganizationPropertyValuesData, - GetOrganizationPropertyValuesResponse, - UpdateOrganizationPropertiesData, - UpdateOrganizationPropertiesResponse, - ReplaceOrganizationMfaData, - ReplaceOrganizationMfaResponse, - DeleteOrganizationHandleData, - DeleteOrganizationHandleResponse, - ReadOrganizationLogoData, - ReadOrganizationLogoResponse, - AddOrganizationLogoData, - AddOrganizationLogoResponse, - DeleteOrganizationLogoData, - DeleteOrganizationLogoResponse, - GetOrganizationConnectionsData, - GetOrganizationConnectionsResponse, - EnableOrgConnectionData, - EnableOrgConnectionResponse, - RemoveOrgConnectionData, - RemoveOrgConnectionResponse, - UpdateOrganizationSessionsData, - UpdateOrganizationSessionsResponse, + GetOrgUserMfaErrors, + GetOrgUserMfaResponses, GetPermissionsData, - GetPermissionsResponse, - CreatePermissionData, - CreatePermissionResponse, - UpdatePermissionsData, - UpdatePermissionsResponse, - DeletePermissionData, - DeletePermissionResponse, + GetPermissionsErrors, + GetPermissionsResponses, GetPropertiesData, - GetPropertiesResponse, - CreatePropertyData, - CreatePropertyResponse, - UpdatePropertyData, - UpdatePropertyResponse, - DeletePropertyData, - DeletePropertyResponse, - GetCategoriesData, - GetCategoriesResponse, - CreateCategoryData, - CreateCategoryResponse, - UpdateCategoryData, - UpdateCategoryResponse, - GetRolesData, - GetRolesResponse, - CreateRoleData, - CreateRoleResponse, + GetPropertiesErrors, + GetPropertiesResponses, GetRoleData, - GetRoleResponse, - UpdateRolesData, - UpdateRolesResponse, - DeleteRoleData, - DeleteRoleResponse, - GetRoleScopesData, - GetRoleScopesResponse, - AddRoleScopeData, - AddRoleScopeResponse, - DeleteRoleScopeData, - DeleteRoleScopeResponse, + GetRoleErrors, GetRolePermissionsData, - GetRolePermissionsResponse, - UpdateRolePermissionsData, - UpdateRolePermissionsResponse, - RemoveRolePermissionData, - RemoveRolePermissionResponse, - SearchUsersData, - SearchUsersResponse, - GetSubscribersData, - GetSubscribersResponse, - CreateSubscriberData, - CreateSubscriberResponse, + GetRolePermissionsErrors, + GetRolePermissionsResponses, + GetRoleResponses, + GetRoleScopesData, + GetRoleScopesErrors, + GetRoleScopesResponses, + GetRolesData, + GetRolesErrors, + GetRolesResponses, GetSubscriberData, - GetSubscriberResponse, - GetTimezonesResponse, - GetUsersData, - GetUsersResponse, - RefreshUserClaimsData, - RefreshUserClaimsResponse, + GetSubscriberErrors, + GetSubscriberResponses, + GetSubscribersData, + GetSubscribersErrors, + GetSubscribersResponses, + GetTimezonesData, + GetTimezonesErrors, + GetTimezonesResponses, GetUserDataData, - GetUserDataResponse, - CreateUserData, - CreateUserResponse, - UpdateUserData, - UpdateUserResponse, - DeleteUserData, - DeleteUserResponse, - UpdateUserFeatureFlagOverrideData, - UpdateUserFeatureFlagOverrideResponse, - UpdateUserPropertyData, - UpdateUserPropertyResponse, - GetUserPropertyValuesData, - GetUserPropertyValuesResponse, - UpdateUserPropertiesData, - UpdateUserPropertiesResponse, - SetUserPasswordData, - SetUserPasswordResponse, + GetUserDataErrors, + GetUserDataResponses, GetUserIdentitiesData, - GetUserIdentitiesResponse, - CreateUserIdentityData, - CreateUserIdentityResponse, + GetUserIdentitiesErrors, + GetUserIdentitiesResponses, + GetUserPropertyValuesData, + GetUserPropertyValuesErrors, + GetUserPropertyValuesResponses, + GetUsersData, + GetUsersErrors, GetUserSessionsData, - GetUserSessionsResponse, - DeleteUserSessionsData, - DeleteUserSessionsResponse, + GetUserSessionsErrors, + GetUserSessionsResponses, GetUsersMfaData, - GetUsersMfaResponse, + GetUsersMfaErrors, + GetUsersMfaResponses, + GetUsersResponses, + GetWebHooksData, + GetWebHooksErrors, + GetWebHooksResponses, + ReadLogoData, + ReadLogoErrors, + ReadLogoResponses, + ReadOrganizationLogoData, + ReadOrganizationLogoErrors, + ReadOrganizationLogoResponses, + RefreshUserClaimsData, + RefreshUserClaimsErrors, + RefreshUserClaimsResponses, + RemoveConnectionData, + RemoveConnectionErrors, + RemoveConnectionResponses, + RemoveOrganizationUserData, + RemoveOrganizationUserErrors, + RemoveOrganizationUserResponses, + RemoveOrgConnectionData, + RemoveOrgConnectionErrors, + RemoveOrgConnectionResponses, + RemoveRolePermissionData, + RemoveRolePermissionErrors, + RemoveRolePermissionResponses, + ReplaceConnectionData, + ReplaceConnectionErrors, + ReplaceConnectionResponses, + ReplaceLogoutRedirectUrlsData, + ReplaceLogoutRedirectUrlsErrors, + ReplaceLogoutRedirectUrlsResponses, + ReplaceMfaData, + ReplaceMfaErrors, + ReplaceMfaResponses, + ReplaceOrganizationMfaData, + ReplaceOrganizationMfaErrors, + ReplaceOrganizationMfaResponses, + ReplaceRedirectCallbackUrlsData, + ReplaceRedirectCallbackUrlsErrors, + ReplaceRedirectCallbackUrlsResponses, + ResetOrgUserMfaAllData, + ResetOrgUserMfaAllErrors, + ResetOrgUserMfaAllResponses, + ResetOrgUserMfaData, + ResetOrgUserMfaErrors, + ResetOrgUserMfaResponses, ResetUsersMfaAllData, - ResetUsersMfaAllResponse, + ResetUsersMfaAllErrors, + ResetUsersMfaAllResponses, ResetUsersMfaData, - ResetUsersMfaResponse, - GetEventData, - GetEventResponse, - GetEventTypesResponse, - DeleteWebHookData, - DeleteWebHookResponse, + ResetUsersMfaErrors, + ResetUsersMfaResponses, + RevokeConnectedAppTokenData, + RevokeConnectedAppTokenErrors, + RevokeConnectedAppTokenResponses, + RotateApiKeyData, + RotateApiKeyErrors, + RotateApiKeyResponses, + SearchUsersData, + SearchUsersErrors, + SearchUsersResponses, + SetUserPasswordData, + SetUserPasswordErrors, + SetUserPasswordResponses, + UpdateApiApplicationsData, + UpdateApiApplicationsErrors, + UpdateApiApplicationsResponses, + UpdateApiScopeData, + UpdateApiScopeErrors, + UpdateApiScopeResponses, + UpdateApplicationData, + UpdateApplicationErrors, + UpdateApplicationResponses, + UpdateApplicationsPropertyData, + UpdateApplicationsPropertyErrors, + UpdateApplicationsPropertyResponses, + UpdateApplicationTokensData, + UpdateApplicationTokensErrors, + UpdateApplicationTokensResponses, + UpdateBusinessData, + UpdateBusinessErrors, + UpdateBusinessResponses, + UpdateCategoryData, + UpdateCategoryErrors, + UpdateCategoryResponses, + UpdateConnectionData, + UpdateConnectionErrors, + UpdateConnectionResponses, + UpdateEnvironementFeatureFlagOverrideData, + UpdateEnvironementFeatureFlagOverrideErrors, + UpdateEnvironementFeatureFlagOverrideResponses, + UpdateEnvironmentVariableData, + UpdateEnvironmentVariableErrors, + UpdateEnvironmentVariableResponses, + UpdateFeatureFlagData, + UpdateFeatureFlagErrors, + UpdateFeatureFlagResponses, + UpdateIdentityData, + UpdateIdentityErrors, + UpdateIdentityResponses, + UpdateOrganizationData, + UpdateOrganizationErrors, + UpdateOrganizationFeatureFlagOverrideData, + UpdateOrganizationFeatureFlagOverrideErrors, + UpdateOrganizationFeatureFlagOverrideResponses, + UpdateOrganizationPropertiesData, + UpdateOrganizationPropertiesErrors, + UpdateOrganizationPropertiesResponses, + UpdateOrganizationPropertyData, + UpdateOrganizationPropertyErrors, + UpdateOrganizationPropertyResponses, + UpdateOrganizationResponses, + UpdateOrganizationSessionsData, + UpdateOrganizationSessionsErrors, + UpdateOrganizationSessionsResponses, + UpdateOrganizationUsersData, + UpdateOrganizationUsersErrors, + UpdateOrganizationUsersResponses, + UpdatePermissionsData, + UpdatePermissionsErrors, + UpdatePermissionsResponses, + UpdatePropertyData, + UpdatePropertyErrors, + UpdatePropertyResponses, + UpdateRolePermissionsData, + UpdateRolePermissionsErrors, + UpdateRolePermissionsResponses, + UpdateRolesData, + UpdateRolesErrors, + UpdateRolesResponses, + UpdateUserData, + UpdateUserErrors, + UpdateUserFeatureFlagOverrideData, + UpdateUserFeatureFlagOverrideErrors, + UpdateUserFeatureFlagOverrideResponses, + UpdateUserPropertiesData, + UpdateUserPropertiesErrors, + UpdateUserPropertiesResponses, + UpdateUserPropertyData, + UpdateUserPropertyErrors, + UpdateUserPropertyResponses, + UpdateUserResponses, UpdateWebHookData, - UpdateWebHookResponse, - GetWebHooksResponse, - CreateWebHookData, - CreateWebHookResponse, + UpdateWebHookErrors, + UpdateWebHookResponses, + VerifyApiKeyData, + VerifyApiKeyErrors, + VerifyApiKeyResponses, } from "./types.gen"; +export type Options< + TData extends TDataShape = TDataShape, + ThrowOnError extends boolean = boolean, + TResponse = unknown, +> = Options2 & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + export class ApiKeys { /** * Get API keys + * * Returns a list of API keys. * *
* read:api_keys *
* - * @param data The data for the request. - * @param data.pageSize Number of results per page. Defaults to 50 if parameter not sent. - * @param data.startingAfter The ID of the API key to start after. - * @param data.keyType Filter by API key type (organization or user). - * @param data.status Filter by API key status (active, inactive, revoked). - * @param data.userId Filter by user ID to get API keys associated with a specific user. - * @param data.orgCode Filter by organization code to get API keys associated with a specific organization. - * @returns get_api_keys_response API keys successfully retrieved. - * @throws ApiError - */ - public static getApiKeys( - data: GetApiKeysData = {}, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + */ + public static getApiKeys( + options?: Options, + ) { + return (options?.client ?? client).get< + GetApiKeysResponses, + GetApiKeysErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/api_keys", - query: { - page_size: data.pageSize, - starting_after: data.startingAfter, - key_type: data.keyType, - status: data.status, - user_id: data.userId, - org_code: data.orgCode, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** * Create API key + * * Create a new API key. * *
* create:api_keys *
* - * @param data The data for the request. - * @param data.requestBody API key details. - * @returns create_api_key_response API key successfully created. - * @throws ApiError */ - public static createApiKey( - data: CreateApiKeyData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "POST", + public static createApiKey( + options: Options, + ) { + return (options.client ?? client).post< + CreateApiKeyResponses, + CreateApiKeyErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/api_keys", - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } /** - * Get API key - * Retrieve API key details by ID. + * Delete API key + * + * Delete an API key. * *
- * read:api_keys + * delete:api_keys *
* - * @param data The data for the request. - * @param data.keyId The ID of the API key. - * @returns get_api_key_response API key successfully retrieved. - * @throws ApiError */ - public static getApiKey( - data: GetApiKeyData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static deleteApiKey( + options: Options, + ) { + return (options.client ?? client).delete< + DeleteApiKeyResponses, + DeleteApiKeyErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/api_keys/{key_id}", - path: { - key_id: data.keyId, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 404: "The specified resource was not found", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** - * Delete API key - * Delete an API key. + * Get API key + * + * Retrieve API key details by ID. * *
- * delete:api_keys + * read:api_keys *
* - * @param data The data for the request. - * @param data.keyId The ID of the API key. - * @returns success_response API key successfully deleted. - * @throws ApiError */ - public static deleteApiKey( - data: DeleteApiKeyData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "DELETE", + public static getApiKey( + options: Options, + ) { + return (options.client ?? client).get< + GetApiKeyResponses, + GetApiKeyErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/api_keys/{key_id}", - path: { - key_id: data.keyId, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 404: "The specified resource was not found", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** * Rotate API key + * * Rotate an API key to generate a new key while maintaining the same permissions and associations. * *
* update:api_keys *
* - * @param data The data for the request. - * @param data.keyId The ID of the API key to rotate. - * @returns rotate_api_key_response API key successfully rotated. - * @throws ApiError */ - public static rotateApiKey( - data: RotateApiKeyData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "PUT", + public static rotateApiKey( + options: Options, + ) { + return (options.client ?? client).put< + RotateApiKeyResponses, + RotateApiKeyErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/api_keys/{key_id}", - path: { - key_id: data.keyId, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 404: "The specified resource was not found", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** * Verify API key + * * Verify an API key (public endpoint, no authentication required). * - * @param data The data for the request. - * @param data.requestBody API key verification details. - * @returns verify_api_key_response API key verification result. - * @throws ApiError */ - public static verifyApiKey( - data: VerifyApiKeyData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "POST", + public static verifyApiKey( + options: Options, + ) { + return (options.client ?? client).post< + VerifyApiKeyResponses, + VerifyApiKeyErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/api_keys/verify", - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 401: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } @@ -508,379 +661,305 @@ export class ApiKeys { export class Apis { /** * Get APIs + * * Returns a list of your APIs. The APIs are returned sorted by name. * *
* read:apis *
* - * @param data The data for the request. - * @param data.expand Additional data to include in the response. Allowed value: "scopes". - * @returns get_apis_response A list of APIs. - * @throws ApiError */ - public static getApis( - data: GetApisData = {}, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static getApis( + options?: Options, + ) { + return (options?.client ?? client).get< + GetApisResponses, + GetApisErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/apis", - query: { - expand: data.expand, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** * Create API + * * Register a new API. For more information read [Register and manage APIs](https://docs.kinde.com/developer-tools/your-apis/register-manage-apis/). * *
* create:apis *
* - * @param data The data for the request. - * @param data.requestBody - * @returns create_apis_response APIs successfully updated - * @throws ApiError */ - public static addApis(data: AddApisData): CancelablePromise { - return __request(OpenAPI, { - method: "POST", + public static addApis( + options: Options, + ) { + return (options.client ?? client).post< + AddApisResponses, + AddApisErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/apis", - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } /** - * Get API - * Retrieve API details by ID. + * Delete API + * + * Delete an API you previously created. * *
- * read:apis + * delete:apis *
* - * @param data The data for the request. - * @param data.apiId The API's ID. - * @returns get_api_response API successfully retrieved. - * @throws ApiError */ - public static getApi(data: GetApiData): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static deleteApi( + options: Options, + ) { + return (options.client ?? client).delete< + DeleteApiResponses, + DeleteApiErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/apis/{api_id}", - path: { - api_id: data.apiId, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** - * Delete API - * Delete an API you previously created. + * Get API + * + * Retrieve API details by ID. * *
- * delete:apis + * read:apis *
* - * @param data The data for the request. - * @param data.apiId The API's ID. - * @returns delete_api_response API successfully deleted. - * @throws ApiError */ - public static deleteApi( - data: DeleteApiData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "DELETE", + public static getApi( + options: Options, + ) { + return (options.client ?? client).get< + GetApiResponses, + GetApiErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/apis/{api_id}", - path: { - api_id: data.apiId, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** * Get API scopes + * * Retrieve API scopes by API ID. * *
* read:api_scopes *
* - * @param data The data for the request. - * @param data.apiId API ID - * @returns get_api_scopes_response API scopes successfully retrieved. - * @throws ApiError */ - public static getApiScopes( - data: GetApiScopesData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static getApiScopes( + options: Options, + ) { + return (options.client ?? client).get< + GetApiScopesResponses, + GetApiScopesErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/apis/{api_id}/scopes", - path: { - api_id: data.apiId, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** * Create API scope + * * Create a new API scope. * *
* create:api_scopes *
* - * @param data The data for the request. - * @param data.apiId API ID - * @param data.requestBody - * @returns create_api_scopes_response API scopes successfully created - * @throws ApiError */ - public static addApiScope( - data: AddApiScopeData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "POST", + public static addApiScope( + options: Options, + ) { + return (options.client ?? client).post< + AddApiScopeResponses, + AddApiScopeErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/apis/{api_id}/scopes", - path: { - api_id: data.apiId, - }, - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } /** - * Get API scope - * Retrieve API scope by API ID. + * Delete API scope + * + * Delete an API scope you previously created. * *
- * read:api_scopes + * delete:apis_scopes *
* - * @param data The data for the request. - * @param data.apiId API ID - * @param data.scopeId Scope ID - * @returns get_api_scope_response API scope successfully retrieved. - * @throws ApiError */ - public static getApiScope( - data: GetApiScopeData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static deleteApiScope( + options: Options, + ) { + return (options.client ?? client).delete< + DeleteApiScopeResponses, + DeleteApiScopeErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/apis/{api_id}/scopes/{scope_id}", - path: { - api_id: data.apiId, - scope_id: data.scopeId, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** - * Update API scope - * Update an API scope. + * Get API scope + * + * Retrieve API scope by API ID. * *
- * update:api_scopes + * read:api_scopes *
* - * @param data The data for the request. - * @param data.apiId API ID - * @param data.scopeId Scope ID - * @param data.requestBody - * @returns unknown API scope successfully updated - * @throws ApiError */ - public static updateApiScope( - data: UpdateApiScopeData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "PATCH", + public static getApiScope( + options: Options, + ) { + return (options.client ?? client).get< + GetApiScopeResponses, + GetApiScopeErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/apis/{api_id}/scopes/{scope_id}", - path: { - api_id: data.apiId, - scope_id: data.scopeId, - }, - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** - * Delete API scope - * Delete an API scope you previously created. + * Update API scope + * + * Update an API scope. * *
- * delete:apis_scopes + * update:api_scopes *
* - * @param data The data for the request. - * @param data.apiId API ID - * @param data.scopeId Scope ID - * @returns unknown API scope successfully deleted. - * @throws ApiError */ - public static deleteApiScope( - data: DeleteApiScopeData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "DELETE", + public static updateApiScope( + options: Options, + ) { + return (options.client ?? client).patch< + UpdateApiScopeResponses, + UpdateApiScopeErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/apis/{api_id}/scopes/{scope_id}", - path: { - api_id: data.apiId, - scope_id: data.scopeId, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } /** * Authorize API applications + * * Authorize applications to be allowed to request access tokens for an API * *
* update:apis *
* - * @param data The data for the request. - * @param data.requestBody The applications you want to authorize. - * @param data.apiId The API's ID. - * @returns authorize_app_api_response Authorized applications updated. - * @throws ApiError */ - public static updateApiApplications( - data: UpdateApiApplicationsData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "PATCH", + public static updateApiApplications( + options: Options, + ) { + return (options.client ?? client).patch< + UpdateApiApplicationsResponses, + UpdateApiApplicationsErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/apis/{api_id}/applications", - path: { - api_id: data.apiId, - }, - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } /** - * Add scope to API application - * Add a scope to an API application. + * Delete API application scope + * + * Delete an API application scope you previously created. * *
- * create:api_application_scopes + * delete:apis_application_scopes *
* - * @param data The data for the request. - * @param data.apiId API ID - * @param data.applicationId Application ID - * @param data.scopeId Scope ID - * @returns unknown API scope successfully added to API application - * @throws ApiError */ - public static addApiApplicationScope( - data: AddApiApplicationScopeData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "POST", + public static deleteApiApplicationScope( + options: Options, + ) { + return (options.client ?? client).delete< + DeleteApiApplicationScopeResponses, + DeleteApiApplicationScopeErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/apis/{api_id}/applications/{application_id}/scopes/{scope_id}", - path: { - api_id: data.apiId, - application_id: data.applicationId, - scope_id: data.scopeId, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** - * Delete API application scope - * Delete an API application scope you previously created. + * Add scope to API application + * + * Add a scope to an API application. * *
- * delete:apis_application_scopes + * create:api_application_scopes *
* - * @param data The data for the request. - * @param data.apiId API ID - * @param data.applicationId Application ID - * @param data.scopeId Scope ID - * @returns unknown API scope successfully deleted. - * @throws ApiError */ - public static deleteApiApplicationScope( - data: DeleteApiApplicationScopeData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "DELETE", + public static addApiApplicationScope( + options: Options, + ) { + return (options.client ?? client).post< + AddApiApplicationScopeResponses, + AddApiApplicationScopeErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/apis/{api_id}/applications/{application_id}/scopes/{scope_id}", - path: { - api_id: data.apiId, - application_id: data.applicationId, - scope_id: data.scopeId, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } } @@ -888,458 +967,359 @@ export class Apis { export class Applications { /** * Get applications + * * Get a list of applications / clients. * *
* read:applications *
* - * @param data The data for the request. - * @param data.sort Field and order to sort the result by. - * @param data.pageSize Number of results per page. Defaults to 10 if parameter not sent. - * @param data.nextToken A string to get the next page of results if there are more results. - * @returns get_applications_response A successful response with a list of applications or an empty list. - * @throws ApiError */ - public static getApplications( - data: GetApplicationsData = {}, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static getApplications( + options?: Options, + ) { + return (options?.client ?? client).get< + GetApplicationsResponses, + GetApplicationsErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/applications", - query: { - sort: data.sort, - page_size: data.pageSize, - next_token: data.nextToken, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** * Create application + * * Create a new client. * *
* create:applications *
* - * @param data The data for the request. - * @param data.requestBody - * @returns create_application_response Application successfully created. - * @throws ApiError */ - public static createApplication( - data: CreateApplicationData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "POST", + public static createApplication( + options: Options, + ) { + return (options.client ?? client).post< + CreateApplicationResponses, + CreateApplicationErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/applications", - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } /** - * Get application - * Gets an application given the application's ID. + * Delete application + * + * Delete a client / application. * *
- * read:applications + * delete:applications *
* - * @param data The data for the request. - * @param data.applicationId The identifier for the application. - * @returns get_application_response Application successfully retrieved. - * @throws ApiError */ - public static getApplication( - data: GetApplicationData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static deleteApplication( + options: Options, + ) { + return (options.client ?? client).delete< + DeleteApplicationResponses, + DeleteApplicationErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/applications/{application_id}", - path: { - application_id: data.applicationId, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** - * Update Application - * Updates a client's settings. For more information, read [Applications in Kinde](https://docs.kinde.com/build/applications/about-applications) + * Get application + * + * Gets an application given the application's ID. * *
- * update:applications + * read:applications *
* - * @param data The data for the request. - * @param data.applicationId The identifier for the application. - * @param data.requestBody Application details. - * @returns unknown Application successfully updated. - * @throws ApiError */ - public static updateApplication( - data: UpdateApplicationData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "PATCH", + public static getApplication( + options: Options, + ) { + return (options.client ?? client).get< + GetApplicationResponses, + GetApplicationErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/applications/{application_id}", - path: { - application_id: data.applicationId, - }, - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** - * Delete application - * Delete a client / application. + * Update Application + * + * Updates a client's settings. For more information, read [Applications in Kinde](https://docs.kinde.com/build/applications/about-applications) * *
- * delete:applications + * update:applications *
* - * @param data The data for the request. - * @param data.applicationId The identifier for the application. - * @returns success_response Application successfully deleted. - * @throws ApiError */ - public static deleteApplication( - data: DeleteApplicationData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "DELETE", + public static updateApplication( + options: Options, + ) { + return (options.client ?? client).patch< + UpdateApplicationResponses, + UpdateApplicationErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/applications/{application_id}", - path: { - application_id: data.applicationId, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } /** * Get connections + * * Gets all connections for an application. * *
* read:application_connections *
* - * @param data The data for the request. - * @param data.applicationId The identifier/client ID for the application. - * @returns get_connections_response Application connections successfully retrieved. - * @throws ApiError */ - public static getApplicationConnections( - data: GetApplicationConnectionsData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static getApplicationConnections( + options: Options, + ) { + return (options.client ?? client).get< + GetApplicationConnectionsResponses, + GetApplicationConnectionsErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/applications/{application_id}/connections", - path: { - application_id: data.applicationId, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** - * Enable connection - * Enable an auth connection for an application. + * Remove connection + * + * Turn off an auth connection for an application * *
- * create:application_connections + * delete:application_connections *
* - * @param data The data for the request. - * @param data.applicationId The identifier/client ID for the application. - * @param data.connectionId The identifier for the connection. - * @returns unknown Connection successfully enabled. - * @throws ApiError */ - public static enableConnection( - data: EnableConnectionData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "POST", + public static removeConnection( + options: Options, + ) { + return (options.client ?? client).delete< + RemoveConnectionResponses, + RemoveConnectionErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/applications/{application_id}/connections/{connection_id}", - path: { - application_id: data.applicationId, - connection_id: data.connectionId, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** - * Remove connection - * Turn off an auth connection for an application + * Enable connection + * + * Enable an auth connection for an application. * *
- * delete:application_connections + * create:application_connections *
* - * @param data The data for the request. - * @param data.applicationId The identifier/client ID for the application. - * @param data.connectionId The identifier for the connection. - * @returns success_response Connection successfully removed. - * @throws ApiError */ - public static removeConnection( - data: RemoveConnectionData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "DELETE", + public static enableConnection( + options: Options, + ) { + return (options.client ?? client).post< + EnableConnectionResponses, + EnableConnectionErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/applications/{application_id}/connections/{connection_id}", - path: { - application_id: data.applicationId, - connection_id: data.connectionId, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** * Get property values + * * Gets properties for an application by client ID. * *
* read:application_properties *
* - * @param data The data for the request. - * @param data.applicationId The application's ID / client ID. - * @returns get_property_values_response Properties successfully retrieved. - * @throws ApiError */ - public static getApplicationPropertyValues( - data: GetApplicationPropertyValuesData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static getApplicationPropertyValues< + ThrowOnError extends boolean = false, + >(options: Options) { + return (options.client ?? client).get< + GetApplicationPropertyValuesResponses, + GetApplicationPropertyValuesErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/applications/{application_id}/properties", - path: { - application_id: data.applicationId, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** * Update property + * * Update application property value. * *
* update:application_properties *
* - * @param data The data for the request. - * @param data.requestBody - * @param data.applicationId The application's ID / client ID. - * @param data.propertyKey The property's key. - * @returns success_response Property successfully updated - * @throws ApiError */ - public static updateApplicationsProperty( - data: UpdateApplicationsPropertyData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "PUT", + public static updateApplicationsProperty< + ThrowOnError extends boolean = false, + >(options: Options) { + return (options.client ?? client).put< + UpdateApplicationsPropertyResponses, + UpdateApplicationsPropertyErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/applications/{application_id}/properties/{property_key}", - path: { - application_id: data.applicationId, - property_key: data.propertyKey, - }, - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } /** * Update application tokens + * * Configure tokens for an application. *
* update:application_tokens *
* - * @param data The data for the request. - * @param data.applicationId The identifier/client ID for the application. - * @param data.requestBody Application tokens. - * @returns success_response Application tokens successfully updated. - * @throws ApiError */ - public static updateApplicationTokens( - data: UpdateApplicationTokensData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "PATCH", + public static updateApplicationTokens( + options: Options, + ) { + return (options.client ?? client).patch< + UpdateApplicationTokensResponses, + UpdateApplicationTokensErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/applications/{application_id}/tokens", - path: { - application_id: data.applicationId, - }, - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } } -export class BillingAgreements { +export class BillingEntitlements { /** - * Get billing agreements - * Returns all the agreements a billing customer currently has access to + * Get billing entitlements + * + * Returns all the entitlements a billing customer currently has access to * *
- * read:billing_agreements + * read:billing_entitlements *
* - * @param data The data for the request. - * @param data.customerId The ID of the billing customer to retrieve agreements for - * @param data.pageSize Number of results per page. Defaults to 10 if parameter not sent. - * @param data.startingAfter The ID of the billing agreement to start after. - * @param data.endingBefore The ID of the billing agreement to end before. - * @param data.featureCode The feature code to filter by agreements only containing that feature - * @returns get_billing_agreements_response Billing agreements successfully retrieved. - * @throws ApiError - */ - public static getBillingAgreements( - data: GetBillingAgreementsData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", - url: "/api/v1/billing/agreements", - query: { - page_size: data.pageSize, - starting_after: data.startingAfter, - ending_before: data.endingBefore, - customer_id: data.customerId, - feature_code: data.featureCode, - }, - errors: { - 400: "Invalid request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", - }, + */ + public static getBillingEntitlements( + options: Options, + ) { + return (options.client ?? client).get< + GetBillingEntitlementsResponses, + GetBillingEntitlementsErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], + url: "/api/v1/billing/entitlements", + ...options, }); } +} +export class BillingAgreements { /** - * Create billing agreement - * Creates a new billing agreement based on the plan code passed, and cancels the customer's existing agreements + * Get billing agreements + * + * Returns all the agreements a billing customer currently has access to * *
- * create:billing_agreements + * read:billing_agreements *
* - * @param data The data for the request. - * @param data.requestBody New agreement request values - * @returns success_response Billing agreement successfully changed - * @throws ApiError */ - public static createBillingAgreement( - data: CreateBillingAgreementData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "POST", + public static getBillingAgreements( + options: Options, + ) { + return (options.client ?? client).get< + GetBillingAgreementsResponses, + GetBillingAgreementsErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/billing/agreements", - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } -} -export class BillingEntitlements { /** - * Get billing entitlements - * Returns all the entitlements a billing customer currently has access to + * Create billing agreement + * + * Creates a new billing agreement based on the plan code passed, and cancels the customer's existing agreements * *
- * read:billing_entitlements + * create:billing_agreements *
* - * @param data The data for the request. - * @param data.customerId The ID of the billing customer to retrieve entitlements for - * @param data.pageSize Number of results per page. Defaults to 10 if parameter not sent. - * @param data.startingAfter The ID of the billing entitlement to start after. - * @param data.endingBefore The ID of the billing entitlement to end before. - * @param data.maxValue When the maximum limit of an entitlement is null, this value is returned as the maximum limit - * @param data.expand Additional plan data to include in the response. Allowed value: "plans". - * @returns get_billing_entitlements_response Billing entitlements successfully retrieved. - * @throws ApiError - */ - public static getBillingEntitlements( - data: GetBillingEntitlementsData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", - url: "/api/v1/billing/entitlements", - query: { - page_size: data.pageSize, - starting_after: data.startingAfter, - ending_before: data.endingBefore, - customer_id: data.customerId, - max_value: data.maxValue, - expand: data.expand, - }, - errors: { - 400: "Invalid request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", + */ + public static createBillingAgreement( + options: Options, + ) { + return (options.client ?? client).post< + CreateBillingAgreementResponses, + CreateBillingAgreementErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], + url: "/api/v1/billing/agreements", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } @@ -1348,29 +1328,28 @@ export class BillingEntitlements { export class BillingMeterUsage { /** * Create meter usage record + * * Create a new meter usage record * *
* create:meter_usage *
* - * @param data The data for the request. - * @param data.requestBody Meter usage record - * @returns create_meter_usage_record_response Meter usage record successfully created. - * @throws ApiError */ - public static createMeterUsageRecord( - data: CreateMeterUsageRecordData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "POST", + public static createMeterUsageRecord( + options: Options, + ) { + return (options.client ?? client).post< + CreateMeterUsageRecordResponses, + CreateMeterUsageRecordErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/billing/meter_usage", - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } @@ -1379,314 +1358,314 @@ export class BillingMeterUsage { export class Business { /** * Get business + * * Get your business details. * *
* read:businesses *
* - * @returns get_business_response Your business details. - * @throws ApiError */ - public static getBusiness(): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static getBusiness( + options?: Options, + ) { + return (options?.client ?? client).get< + GetBusinessResponses, + GetBusinessErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/business", - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** * Update business + * * Update your business details. * *
* update:businesses *
* - * @param data The data for the request. - * @param data.requestBody The business details to update. - * @returns success_response Business successfully updated. - * @throws ApiError */ - public static updateBusiness( - data: UpdateBusinessData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "PATCH", + public static updateBusiness( + options: Options, + ) { + return (options.client ?? client).patch< + UpdateBusinessResponses, + UpdateBusinessErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/business", - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } } +export class Industries { + /** + * Get industries + * + * Get a list of industries and associated industry keys. + * + *
+ * read:industries + *
+ * + */ + public static getIndustries( + options?: Options, + ) { + return (options?.client ?? client).get< + GetIndustriesResponses, + GetIndustriesErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], + url: "/api/v1/industries", + ...options, + }); + } +} + +export class Timezones { + /** + * Get timezones + * + * Get a list of timezones and associated timezone keys. + * + *
+ * read:timezones + *
+ * + */ + public static getTimezones( + options?: Options, + ) { + return (options?.client ?? client).get< + GetTimezonesResponses, + GetTimezonesErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], + url: "/api/v1/timezones", + ...options, + }); + } +} + export class Callbacks { + /** + * Delete Callback URLs + * + * Delete callback URLs. + * + *
+ * delete:applications_redirect_uris + *
+ * + */ + public static deleteCallbackUrls( + options: Options, + ) { + return (options.client ?? client).delete< + DeleteCallbackUrlsResponses, + DeleteCallbackUrlsErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], + url: "/api/v1/applications/{app_id}/auth_redirect_urls", + ...options, + }); + } + /** * List Callback URLs + * * Returns an application's redirect callback URLs. * *
* read:applications_redirect_uris *
* - * @param data The data for the request. - * @param data.appId The identifier for the application. - * @returns redirect_callback_urls Callback URLs successfully retrieved. - * @throws ApiError */ - public static getCallbackUrls( - data: GetCallbackUrlsData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static getCallbackUrls( + options: Options, + ) { + return (options.client ?? client).get< + GetCallbackUrlsResponses, + GetCallbackUrlsErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/applications/{app_id}/auth_redirect_urls", - path: { - app_id: data.appId, - }, - errors: { - 400: "Invalid request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", - }, + ...options, }); } /** * Add Redirect Callback URLs + * * Add additional redirect callback URLs. * *
* create:applications_redirect_uris *
* - * @param data The data for the request. - * @param data.appId The identifier for the application. - * @param data.requestBody Callback details. - * @returns success_response Callbacks successfully updated - * @throws ApiError */ - public static addRedirectCallbackUrls( - data: AddRedirectCallbackUrlsData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "POST", + public static addRedirectCallbackUrls( + options: Options, + ) { + return (options.client ?? client).post< + AddRedirectCallbackUrlsResponses, + AddRedirectCallbackUrlsErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/applications/{app_id}/auth_redirect_urls", - path: { - app_id: data.appId, - }, - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } /** * Replace Redirect Callback URLs + * * Replace all redirect callback URLs. * *
* update:applications_redirect_uris *
* - * @param data The data for the request. - * @param data.appId The identifier for the application. - * @param data.requestBody Callback details. - * @returns success_response Callbacks successfully updated - * @throws ApiError */ - public static replaceRedirectCallbackUrls( - data: ReplaceRedirectCallbackUrlsData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "PUT", + public static replaceRedirectCallbackUrls< + ThrowOnError extends boolean = false, + >(options: Options) { + return (options.client ?? client).put< + ReplaceRedirectCallbackUrlsResponses, + ReplaceRedirectCallbackUrlsErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/applications/{app_id}/auth_redirect_urls", - path: { - app_id: data.appId, - }, - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } /** - * Delete Callback URLs - * Delete callback URLs. + * Delete Logout URLs + * + * Delete logout URLs. * *
- * delete:applications_redirect_uris + * delete:application_logout_uris *
* - * @param data The data for the request. - * @param data.appId The identifier for the application. - * @param data.urls Urls to delete, comma separated and url encoded. - * @returns success_response Callback URLs successfully deleted. - * @throws ApiError */ - public static deleteCallbackUrls( - data: DeleteCallbackUrlsData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "DELETE", - url: "/api/v1/applications/{app_id}/auth_redirect_urls", - path: { - app_id: data.appId, - }, - query: { - urls: data.urls, - }, - errors: { - 400: "Invalid request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", - }, + public static deleteLogoutUrls( + options: Options, + ) { + return (options.client ?? client).delete< + DeleteLogoutUrlsResponses, + DeleteLogoutUrlsErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], + url: "/api/v1/applications/{app_id}/auth_logout_urls", + ...options, }); } /** * List logout URLs + * * Returns an application's logout redirect URLs. * *
* read:application_logout_uris *
* - * @param data The data for the request. - * @param data.appId The identifier for the application. - * @returns logout_redirect_urls Logout URLs successfully retrieved. - * @throws ApiError */ - public static getLogoutUrls( - data: GetLogoutUrlsData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static getLogoutUrls( + options: Options, + ) { + return (options.client ?? client).get< + GetLogoutUrlsResponses, + GetLogoutUrlsErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/applications/{app_id}/auth_logout_urls", - path: { - app_id: data.appId, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** * Add logout redirect URLs + * * Add additional logout redirect URLs. * *
* create:application_logout_uris *
* - * @param data The data for the request. - * @param data.appId The identifier for the application. - * @param data.requestBody Callback details. - * @returns success_response Logout URLs successfully updated. - * @throws ApiError */ - public static addLogoutRedirectUrls( - data: AddLogoutRedirectUrlsData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "POST", + public static addLogoutRedirectUrls( + options: Options, + ) { + return (options.client ?? client).post< + AddLogoutRedirectUrlsResponses, + AddLogoutRedirectUrlsErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/applications/{app_id}/auth_logout_urls", - path: { - app_id: data.appId, - }, - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } /** * Replace logout redirect URls + * * Replace all logout redirect URLs. * *
* update:application_logout_uris *
* - * @param data The data for the request. - * @param data.appId The identifier for the application. - * @param data.requestBody Callback details. - * @returns success_response Logout URLs successfully updated. - * @throws ApiError - */ - public static replaceLogoutRedirectUrls( - data: ReplaceLogoutRedirectUrlsData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "PUT", - url: "/api/v1/applications/{app_id}/auth_logout_urls", - path: { - app_id: data.appId, - }, - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, - }); - } - - /** - * Delete Logout URLs - * Delete logout URLs. - * - *
- * delete:application_logout_uris - *
- * - * @param data The data for the request. - * @param data.appId The identifier for the application. - * @param data.urls Urls to delete, comma separated and url encoded. - * @returns success_response Logout URLs successfully deleted. - * @throws ApiError */ - public static deleteLogoutUrls( - data: DeleteLogoutUrlsData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "DELETE", + public static replaceLogoutRedirectUrls( + options: Options, + ) { + return (options.client ?? client).put< + ReplaceLogoutRedirectUrlsResponses, + ReplaceLogoutRedirectUrlsErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/applications/{app_id}/auth_logout_urls", - path: { - app_id: data.appId, - }, - query: { - urls: data.urls, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } @@ -1695,99 +1674,73 @@ export class Callbacks { export class ConnectedApps { /** * Get Connected App URL + * * Get a URL that authenticates and authorizes a user to a third-party connected app. * *
* read:connected_apps *
* - * @param data The data for the request. - * @param data.keyCodeRef The unique key code reference of the connected app to authenticate against. - * @param data.userId The id of the user that needs to authenticate to the third-party connected app. - * @param data.orgCode The code of the Kinde organization that needs to authenticate to the third-party connected app. - * @param data.overrideCallbackUrl A URL that overrides the default callback URL setup in your connected app configuration - * @returns connected_apps_auth_url A URL that can be used to authenticate and a session id to identify this authentication session. - * @throws ApiError */ - public static getConnectedAppAuthUrl( - data: GetConnectedAppAuthUrlData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static getConnectedAppAuthUrl( + options: Options, + ) { + return (options.client ?? client).get< + GetConnectedAppAuthUrlResponses, + GetConnectedAppAuthUrlErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/connected_apps/auth_url", - query: { - key_code_ref: data.keyCodeRef, - user_id: data.userId, - org_code: data.orgCode, - override_callback_url: data.overrideCallbackUrl, - }, - errors: { - 400: "Error retrieving connected app auth url.", - 403: "Invalid credentials.", - 404: "Error retrieving connected app auth url.", - 429: "Request was throttled.", - }, + ...options, }); } /** * Get Connected App Token + * * Get an access token that can be used to call the third-party provider linked to the connected app. * *
* read:connected_apps *
* - * @param data The data for the request. - * @param data.sessionId The unique sesssion id representing the login session of a user. - * @returns connected_apps_access_token An access token that can be used to query a third-party provider, as well as the token's expiry time. - * @throws ApiError */ - public static getConnectedAppToken( - data: GetConnectedAppTokenData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static getConnectedAppToken( + options: Options, + ) { + return (options.client ?? client).get< + GetConnectedAppTokenResponses, + GetConnectedAppTokenErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/connected_apps/token", - query: { - session_id: data.sessionId, - }, - errors: { - 400: "The session id provided points to an invalid session.", - 403: "Invalid credentials.", - 429: "Request was throttled.", - }, + ...options, }); } /** * Revoke Connected App Token + * * Revoke the tokens linked to the connected app session. * *
* create:connected_apps *
* - * @param data The data for the request. - * @param data.sessionId The unique sesssion id representing the login session of a user. - * @returns success_response An access token that can be used to query a third-party provider, as well as the token's expiry time. - * @throws ApiError */ - public static revokeConnectedAppToken( - data: RevokeConnectedAppTokenData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "POST", + public static revokeConnectedAppToken( + options: Options, + ) { + return (options.client ?? client).post< + RevokeConnectedAppTokenResponses, + RevokeConnectedAppTokenErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/connected_apps/revoke", - query: { - session_id: data.sessionId, - }, - errors: { - 400: "Bad request.", - 403: "Invalid credentials.", - 405: "Invalid HTTP method used.", - 429: "Request was throttled.", - }, + ...options, }); } } @@ -1795,194 +1748,156 @@ export class ConnectedApps { export class Connections { /** * Get connections + * * Returns a list of authentication connections. Optionally you can filter this by a home realm domain. * *
* read:connections *
* - * @param data The data for the request. - * @param data.pageSize Number of results per page. Defaults to 10 if parameter not sent. - * @param data.homeRealmDomain Filter the results by the home realm domain. - * @param data.startingAfter The ID of the connection to start after. - * @param data.endingBefore The ID of the connection to end before. - * @returns get_connections_response Connections successfully retrieved. - * @throws ApiError */ - public static getConnections( - data: GetConnectionsData = {}, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static getConnections( + options?: Options, + ) { + return (options?.client ?? client).get< + GetConnectionsResponses, + GetConnectionsErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/connections", - query: { - page_size: data.pageSize, - home_realm_domain: data.homeRealmDomain, - starting_after: data.startingAfter, - ending_before: data.endingBefore, - }, - errors: { - 400: "Invalid request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", - }, + ...options, }); } /** * Create Connection + * * Create Connection. * *
* create:connections *
* - * @param data The data for the request. - * @param data.requestBody Connection details. - * @returns create_connection_response Connection successfully created. - * @throws ApiError */ - public static createConnection( - data: CreateConnectionData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "POST", + public static createConnection( + options: Options, + ) { + return (options.client ?? client).post< + CreateConnectionResponses, + CreateConnectionErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/connections", - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } /** - * Get Connection - * Get Connection. + * Delete Connection + * + * Delete connection. * *
- * read:connections + * delete:connections *
* - * @param data The data for the request. - * @param data.connectionId The unique identifier for the connection. - * @returns connection Connection successfully retrieved. - * @throws ApiError */ - public static getConnection( - data: GetConnectionData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static deleteConnection( + options: Options, + ) { + return (options.client ?? client).delete< + DeleteConnectionResponses, + DeleteConnectionErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/connections/{connection_id}", - path: { - connection_id: data.connectionId, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** - * Update Connection - * Update Connection. + * Get Connection + * + * Get Connection. * *
- * update:connections + * read:connections *
* - * @param data The data for the request. - * @param data.connectionId The unique identifier for the connection. - * @param data.requestBody The fields of the connection to update. - * @returns success_response Connection successfully updated. - * @throws ApiError */ - public static updateConnection( - data: UpdateConnectionData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "PATCH", + public static getConnection( + options: Options, + ) { + return (options.client ?? client).get< + GetConnectionResponses, + GetConnectionErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/connections/{connection_id}", - path: { - connection_id: data.connectionId, - }, - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 404: "The specified resource was not found", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** - * Replace Connection - * Replace Connection Config. + * Update Connection + * + * Update Connection. * *
* update:connections *
* - * @param data The data for the request. - * @param data.connectionId The unique identifier for the connection. - * @param data.requestBody The complete connection configuration to replace the existing one. - * @returns success_response Connection successfully updated - * @throws ApiError */ - public static replaceConnection( - data: ReplaceConnectionData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "PUT", + public static updateConnection( + options: Options, + ) { + return (options.client ?? client).patch< + UpdateConnectionResponses, + UpdateConnectionErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/connections/{connection_id}", - path: { - connection_id: data.connectionId, - }, - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 404: "The specified resource was not found", - 429: "Too many requests. Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } /** - * Delete Connection - * Delete connection. + * Replace Connection + * + * Replace Connection Config. * *
- * delete:connections + * update:connections *
* - * @param data The data for the request. - * @param data.connectionId The identifier for the connection. - * @returns success_response Connection successfully deleted. - * @throws ApiError */ - public static deleteConnection( - data: DeleteConnectionData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "DELETE", + public static replaceConnection( + options: Options, + ) { + return (options.client ?? client).put< + ReplaceConnectionResponses, + ReplaceConnectionErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/connections/{connection_id}", - path: { - connection_id: data.connectionId, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 404: "The specified resource was not found", - 429: "Too many requests. Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } @@ -1991,217 +1906,203 @@ export class Connections { export class Environments { /** * Get environment + * * Gets the current environment. * *
* read:environments *
* - * @returns get_environment_response Environment successfully retrieved. - * @throws ApiError */ - public static getEnvironment(): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static getEnvironment( + options?: Options, + ) { + return (options?.client ?? client).get< + GetEnvironmentResponses, + GetEnvironmentErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/environment", - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** * Delete Environment Feature Flag Overrides + * * Delete all environment feature flag overrides. * *
* delete:environment_feature_flags *
* - * @returns success_response Feature flag overrides deleted successfully. - * @throws ApiError */ - public static deleteEnvironementFeatureFlagOverrides(): CancelablePromise { - return __request(OpenAPI, { - method: "DELETE", + public static deleteEnvironementFeatureFlagOverrides< + ThrowOnError extends boolean = false, + >( + options?: Options, + ) { + return (options?.client ?? client).delete< + DeleteEnvironementFeatureFlagOverridesResponses, + DeleteEnvironementFeatureFlagOverridesErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/environment/feature_flags", - errors: { - 400: "Invalid request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", - }, + ...options, }); } /** * List Environment Feature Flags + * * Get environment feature flags. * *
* read:environment_feature_flags *
* - * @returns get_environment_feature_flags_response Feature flags retrieved successfully. - * @throws ApiError */ - public static getEnvironementFeatureFlags(): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static getEnvironementFeatureFlags< + ThrowOnError extends boolean = false, + >(options?: Options) { + return (options?.client ?? client).get< + GetEnvironementFeatureFlagsResponses, + GetEnvironementFeatureFlagsErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/environment/feature_flags", - errors: { - 400: "Invalid request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", - }, + ...options, }); } /** * Delete Environment Feature Flag Override + * * Delete environment feature flag override. * *
* delete:environment_feature_flags *
* - * @param data The data for the request. - * @param data.featureFlagKey The identifier for the feature flag. - * @returns success_response Feature flag deleted successfully. - * @throws ApiError */ - public static deleteEnvironementFeatureFlagOverride( - data: DeleteEnvironementFeatureFlagOverrideData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "DELETE", + public static deleteEnvironementFeatureFlagOverride< + ThrowOnError extends boolean = false, + >(options: Options) { + return (options.client ?? client).delete< + DeleteEnvironementFeatureFlagOverrideResponses, + DeleteEnvironementFeatureFlagOverrideErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/environment/feature_flags/{feature_flag_key}", - path: { - feature_flag_key: data.featureFlagKey, - }, - errors: { - 400: "Invalid request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", - }, + ...options, }); } /** * Update Environment Feature Flag Override + * * Update environment feature flag override. * *
* update:environment_feature_flags *
* - * @param data The data for the request. - * @param data.featureFlagKey The identifier for the feature flag. - * @param data.requestBody Flag details. - * @returns success_response Feature flag override successful - * @throws ApiError */ - public static updateEnvironementFeatureFlagOverride( - data: UpdateEnvironementFeatureFlagOverrideData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "PATCH", + public static updateEnvironementFeatureFlagOverride< + ThrowOnError extends boolean = false, + >(options: Options) { + return (options.client ?? client).patch< + UpdateEnvironementFeatureFlagOverrideResponses, + UpdateEnvironementFeatureFlagOverrideErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/environment/feature_flags/{feature_flag_key}", - path: { - feature_flag_key: data.featureFlagKey, - }, - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } /** * Read logo details + * * Read environment logo details * *
* read:environments *
* - * @returns read_env_logo_response Success - * @throws ApiError */ - public static readLogo(): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static readLogo( + options?: Options, + ) { + return (options?.client ?? client).get< + ReadLogoResponses, + ReadLogoErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/environment/logos", - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** - * Add logo - * Add environment logo + * Delete logo + * + * Delete environment logo * *
* update:environments *
* - * @param data The data for the request. - * @param data.type The type of logo to add. - * @param data.formData Logo details. - * @returns success_response Logo successfully updated - * @throws ApiError */ - public static addLogo(data: AddLogoData): CancelablePromise { - return __request(OpenAPI, { - method: "PUT", + public static deleteLogo( + options: Options, + ) { + return (options.client ?? client).delete< + DeleteLogoResponses, + DeleteLogoErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/environment/logos/{type}", - path: { - type: data.type, - }, - formData: data.formData, - mediaType: "multipart/form-data", - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** - * Delete logo - * Delete environment logo + * Add logo + * + * Add environment logo * *
* update:environments *
* - * @param data The data for the request. - * @param data.type The type of logo to delete. - * @returns success_response Logo successfully deleted - * @returns void No logo found to delete - * @throws ApiError */ - public static deleteLogo( - data: DeleteLogoData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "DELETE", + public static addLogo( + options: Options, + ) { + return (options.client ?? client).put< + AddLogoResponses, + AddLogoErrors, + ThrowOnError + >({ + ...formDataBodySerializer, + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/environment/logos/{type}", - path: { - type: data.type, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", + ...options, + headers: { + "Content-Type": null, + ...options.headers, }, }); } @@ -2210,145 +2111,128 @@ export class Environments { export class EnvironmentVariables { /** * Get environment variables + * * Get environment variables. This feature is in beta and admin UI is not yet available. * *
* read:environment_variables *
* - * @returns get_environment_variables_response A successful response with a list of environment variables or an empty list. - * @throws ApiError */ - public static getEnvironmentVariables(): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static getEnvironmentVariables( + options?: Options, + ) { + return (options?.client ?? client).get< + GetEnvironmentVariablesResponses, + GetEnvironmentVariablesErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/environment_variables", - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** * Create environment variable + * * Create a new environment variable. This feature is in beta and admin UI is not yet available. * *
* create:environment_variables *
* - * @param data The data for the request. - * @param data.requestBody The environment variable details. - * @returns create_environment_variable_response Environment variable successfully created. - * @throws ApiError */ - public static createEnvironmentVariable( - data: CreateEnvironmentVariableData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "POST", + public static createEnvironmentVariable( + options: Options, + ) { + return (options.client ?? client).post< + CreateEnvironmentVariableResponses, + CreateEnvironmentVariableErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/environment_variables", - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } /** - * Get environment variable - * Retrieve environment variable details by ID. This feature is in beta and admin UI is not yet available. + * Delete environment variable + * + * Delete an environment variable you previously created. This feature is in beta and admin UI is not yet available. * *
- * read:environment_variables + * delete:environment_variables *
* - * @param data The data for the request. - * @param data.variableId The environment variable's ID. - * @returns get_environment_variable_response Environment variable successfully retrieved. - * @throws ApiError */ - public static getEnvironmentVariable( - data: GetEnvironmentVariableData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static deleteEnvironmentVariable( + options: Options, + ) { + return (options.client ?? client).delete< + DeleteEnvironmentVariableResponses, + DeleteEnvironmentVariableErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/environment_variables/{variable_id}", - path: { - variable_id: data.variableId, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** - * Update environment variable - * Update an environment variable you previously created. This feature is in beta and admin UI is not yet available. + * Get environment variable + * + * Retrieve environment variable details by ID. This feature is in beta and admin UI is not yet available. * *
- * update:environment_variables + * read:environment_variables *
* - * @param data The data for the request. - * @param data.requestBody The new details for the environment variable - * @param data.variableId The environment variable's ID. - * @returns update_environment_variable_response Environment variable successfully updated. - * @throws ApiError */ - public static updateEnvironmentVariable( - data: UpdateEnvironmentVariableData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "PATCH", + public static getEnvironmentVariable( + options: Options, + ) { + return (options.client ?? client).get< + GetEnvironmentVariableResponses, + GetEnvironmentVariableErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/environment_variables/{variable_id}", - path: { - variable_id: data.variableId, - }, - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** - * Delete environment variable - * Delete an environment variable you previously created. This feature is in beta and admin UI is not yet available. + * Update environment variable + * + * Update an environment variable you previously created. This feature is in beta and admin UI is not yet available. * *
- * delete:environment_variables + * update:environment_variables *
* - * @param data The data for the request. - * @param data.variableId The environment variable's ID. - * @returns delete_environment_variable_response Environment variable successfully deleted. - * @throws ApiError */ - public static deleteEnvironmentVariable( - data: DeleteEnvironmentVariableData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "DELETE", + public static updateEnvironmentVariable( + options: Options, + ) { + return (options.client ?? client).patch< + UpdateEnvironmentVariableResponses, + UpdateEnvironmentVariableErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/environment_variables/{variable_id}", - path: { - variable_id: data.variableId, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } @@ -2357,221 +2241,154 @@ export class EnvironmentVariables { export class FeatureFlags { /** * Create Feature Flag + * * Create feature flag. * *
* create:feature_flags *
* - * @param data The data for the request. - * @param data.requestBody Flag details. - * @returns success_response Feature flag successfully created - * @throws ApiError */ - public static createFeatureFlag( - data: CreateFeatureFlagData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "POST", + public static createFeatureFlag( + options: Options, + ) { + return (options.client ?? client).post< + CreateFeatureFlagResponses, + CreateFeatureFlagErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/feature_flags", - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } /** * Delete Feature Flag + * * Delete feature flag * *
* delete:feature_flags *
* - * @param data The data for the request. - * @param data.featureFlagKey The identifier for the feature flag. - * @returns success_response Feature flag successfully updated. - * @throws ApiError */ - public static deleteFeatureFlag( - data: DeleteFeatureFlagData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "DELETE", + public static deleteFeatureFlag( + options: Options, + ) { + return (options.client ?? client).delete< + DeleteFeatureFlagResponses, + DeleteFeatureFlagErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/feature_flags/{feature_flag_key}", - path: { - feature_flag_key: data.featureFlagKey, - }, - errors: { - 400: "Invalid request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", - }, + ...options, }); } /** * Replace Feature Flag + * * Update feature flag. * *
* update:feature_flags *
* - * @param data The data for the request. - * @param data.featureFlagKey The key identifier for the feature flag. - * @param data.name The name of the flag. - * @param data.description Description of the flag purpose. - * @param data.type The variable type - * @param data.allowOverrideLevel Allow the flag to be overridden at a different level. - * @param data.defaultValue Default value for the flag used by environments and organizations. - * @returns success_response Feature flag successfully updated. - * @throws ApiError - */ - public static updateFeatureFlag( - data: UpdateFeatureFlagData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "PUT", + */ + public static updateFeatureFlag( + options: Options, + ) { + return (options.client ?? client).put< + UpdateFeatureFlagResponses, + UpdateFeatureFlagErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/feature_flags/{feature_flag_key}", - path: { - feature_flag_key: data.featureFlagKey, - }, - query: { - name: data.name, - description: data.description, - type: data.type, - allow_override_level: data.allowOverrideLevel, - default_value: data.defaultValue, - }, - errors: { - 400: "Invalid request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", - }, + ...options, }); } } export class Identities { /** - * Get identity - * Returns an identity by ID - * - *
- * read:identities - *
+ * Delete identity * - * @param data The data for the request. - * @param data.identityId The unique identifier for the identity. - * @returns identity Identity successfully retrieved. - * @throws ApiError - */ - public static getIdentity( - data: GetIdentityData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", - url: "/api/v1/identities/{identity_id}", - path: { - identity_id: data.identityId, - }, - errors: { - 400: "Invalid request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", - }, - }); - } - - /** - * Update identity - * Update identity by ID. + * Delete identity by ID. * *
- * update:identities + * delete:identities *
* - * @param data The data for the request. - * @param data.identityId The unique identifier for the identity. - * @param data.requestBody The fields of the identity to update. - * @returns success_response Identity successfully updated. - * @throws ApiError */ - public static updateIdentity( - data: UpdateIdentityData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "PATCH", + public static deleteIdentity( + options: Options, + ) { + return (options.client ?? client).delete< + DeleteIdentityResponses, + DeleteIdentityErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/identities/{identity_id}", - path: { - identity_id: data.identityId, - }, - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", - }, + ...options, }); } /** - * Delete identity - * Delete identity by ID. + * Get identity + * + * Returns an identity by ID * *
- * delete:identities + * read:identities *
* - * @param data The data for the request. - * @param data.identityId The unique identifier for the identity. - * @returns success_response Identity successfully deleted. - * @throws ApiError */ - public static deleteIdentity( - data: DeleteIdentityData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "DELETE", + public static getIdentity( + options: Options, + ) { + return (options.client ?? client).get< + GetIdentityResponses, + GetIdentityErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/identities/{identity_id}", - path: { - identity_id: data.identityId, - }, - errors: { - 400: "Invalid request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", - }, + ...options, }); } -} -export class Industries { /** - * Get industries - * Get a list of industries and associated industry keys. + * Update identity + * + * Update identity by ID. * *
- * read:industries + * update:identities *
* - * @returns get_industries_response A list of industries. - * @throws ApiError */ - public static getIndustries(): CancelablePromise { - return __request(OpenAPI, { - method: "GET", - url: "/api/v1/industries", - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", + public static updateIdentity( + options: Options, + ) { + return (options.client ?? client).patch< + UpdateIdentityResponses, + UpdateIdentityErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], + url: "/api/v1/identities/{identity_id}", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } @@ -2580,29 +2397,28 @@ export class Industries { export class Mfa { /** * Replace MFA Configuration + * * Replace MFA Configuration. * *
* update:mfa *
* - * @param data The data for the request. - * @param data.requestBody MFA details. - * @returns success_response MFA Configuration updated successfully. - * @throws ApiError */ - public static replaceMfa( - data: ReplaceMfaData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "PUT", + public static replaceMfa( + options: Options, + ) { + return (options.client ?? client).put< + ReplaceMfaResponses, + ReplaceMfaErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/mfa", - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } @@ -2611,1193 +2427,907 @@ export class Mfa { export class Organizations { /** * Get organization + * * Retrieve organization details by code. * *
* read:organizations *
* - * @param data The data for the request. - * @param data.code The organization's code. - * @param data.expand Additional data to include in the response. Allowed value: "billing". - * @returns get_organization_response Organization successfully retrieved. - * @throws ApiError */ - public static getOrganization( - data: GetOrganizationData = {}, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static getOrganization( + options?: Options, + ) { + return (options?.client ?? client).get< + GetOrganizationResponses, + GetOrganizationErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/organization", - query: { - code: data.code, - expand: data.expand, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** * Create organization + * * Create a new organization. To learn more read about [multi tenancy using organizations](https://docs.kinde.com/build/organizations/multi-tenancy-using-organizations/) * *
* create:organizations *
* - * @param data The data for the request. - * @param data.requestBody Organization details. - * @returns create_organization_response Organization successfully created. - * @throws ApiError */ - public static createOrganization( - data: CreateOrganizationData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "POST", + public static createOrganization( + options: Options, + ) { + return (options.client ?? client).post< + CreateOrganizationResponses, + CreateOrganizationErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/organization", - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } /** * Get organizations + * * Get a list of organizations. * *
* read:organizations *
* - * @param data The data for the request. - * @param data.sort Field and order to sort the result by. - * @param data.pageSize Number of results per page. Defaults to 10 if parameter not sent. - * @param data.nextToken A string to get the next page of results if there are more results. - * @returns get_organizations_response Organizations successfully retreived. - * @throws ApiError */ - public static getOrganizations( - data: GetOrganizationsData = {}, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static getOrganizations( + options?: Options, + ) { + return (options?.client ?? client).get< + GetOrganizationsResponses, + GetOrganizationsErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/organizations", - query: { - sort: data.sort, - page_size: data.pageSize, - next_token: data.nextToken, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** - * Update Organization - * Update an organization. + * Delete Organization + * + * Delete an organization. * *
- * update:organizations + * delete:organizations *
* - * @param data The data for the request. - * @param data.orgCode The identifier for the organization. - * @param data.expand Additional data to include in the response. Allowed value: "billing". - * @param data.requestBody Organization details. - * @returns success_response Organization successfully updated. - * @throws ApiError */ - public static updateOrganization( - data: UpdateOrganizationData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "PATCH", + public static deleteOrganization( + options: Options, + ) { + return (options.client ?? client).delete< + DeleteOrganizationResponses, + DeleteOrganizationErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/organization/{org_code}", - path: { - org_code: data.orgCode, - }, - query: { - expand: data.expand, - }, - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** - * Delete Organization - * Delete an organization. + * Update Organization + * + * Update an organization. * *
- * delete:organizations + * update:organizations *
* - * @param data The data for the request. - * @param data.orgCode The identifier for the organization. - * @returns success_response Organization successfully deleted. - * @throws ApiError */ - public static deleteOrganization( - data: DeleteOrganizationData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "DELETE", + public static updateOrganization( + options: Options, + ) { + return (options.client ?? client).patch< + UpdateOrganizationResponses, + UpdateOrganizationErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/organization/{org_code}", - path: { - org_code: data.orgCode, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 404: "The specified resource was not found", - 429: "Too many requests. Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } /** * Get organization users + * * Get user details for all members of an organization. * *
* read:organization_users *
* - * @param data The data for the request. - * @param data.orgCode The organization's code. - * @param data.sort Field and order to sort the result by. - * @param data.pageSize Number of results per page. Defaults to 10 if parameter not sent. - * @param data.nextToken A string to get the next page of results if there are more results. - * @param data.permissions Filter by user permissions comma separated (where all match) - * @param data.roles Filter by user roles comma separated (where all match) - * @returns get_organization_users_response A successful response with a list of organization users or an empty list. - * @throws ApiError - */ - public static getOrganizationUsers( - data: GetOrganizationUsersData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + */ + public static getOrganizationUsers( + options: Options, + ) { + return (options.client ?? client).get< + GetOrganizationUsersResponses, + GetOrganizationUsersErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/organizations/{org_code}/users", - path: { - org_code: data.orgCode, - }, - query: { - sort: data.sort, - page_size: data.pageSize, - next_token: data.nextToken, - permissions: data.permissions, - roles: data.roles, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** - * Add Organization Users - * Add existing users to an organization. + * Update Organization Users + * + * Update users that belong to an organization. * *
- * create:organization_users + * update:organization_users *
* - * @param data The data for the request. - * @param data.orgCode The organization's code. - * @param data.requestBody - * @returns add_organization_users_response Add organization users request successfully processed. - * @throws ApiError */ - public static addOrganizationUsers( - data: AddOrganizationUsersData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "POST", + public static updateOrganizationUsers( + options: Options, + ) { + return (options.client ?? client).patch< + UpdateOrganizationUsersResponses, + UpdateOrganizationUsersErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/organizations/{org_code}/users", - path: { - org_code: data.orgCode, - }, - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } /** - * Update Organization Users - * Update users that belong to an organization. + * Add Organization Users + * + * Add existing users to an organization. * *
- * update:organization_users + * create:organization_users *
* - * @param data The data for the request. - * @param data.orgCode The organization's code. - * @param data.requestBody - * @returns update_organization_users_response Users successfully removed. - * @throws ApiError */ - public static updateOrganizationUsers( - data: UpdateOrganizationUsersData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "PATCH", + public static addOrganizationUsers( + options: Options, + ) { + return (options.client ?? client).post< + AddOrganizationUsersResponses, + AddOrganizationUsersErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/organizations/{org_code}/users", - path: { - org_code: data.orgCode, - }, - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } /** * List Organization User Roles + * * Get roles for an organization user. * *
* read:organization_user_roles *
* - * @param data The data for the request. - * @param data.orgCode The organization's code. - * @param data.userId The user's id. - * @returns get_organizations_user_roles_response A successful response with a list of user roles. - * @throws ApiError */ - public static getOrganizationUserRoles( - data: GetOrganizationUserRolesData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static getOrganizationUserRoles( + options: Options, + ) { + return (options.client ?? client).get< + GetOrganizationUserRolesResponses, + GetOrganizationUserRolesErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/organizations/{org_code}/users/{user_id}/roles", - path: { - org_code: data.orgCode, - user_id: data.userId, - }, - errors: { - 403: "Invalid credentials.", - 429: "Request was throttled.", - }, + ...options, }); } /** * Add Organization User Role + * * Add role to an organization user. * *
* create:organization_user_roles *
* - * @param data The data for the request. - * @param data.orgCode The organization's code. - * @param data.userId The user's id. - * @param data.requestBody Role details. - * @returns success_response Role successfully added. - * @throws ApiError */ - public static createOrganizationUserRole( - data: CreateOrganizationUserRoleData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "POST", + public static createOrganizationUserRole< + ThrowOnError extends boolean = false, + >(options: Options) { + return (options.client ?? client).post< + CreateOrganizationUserRoleResponses, + CreateOrganizationUserRoleErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/organizations/{org_code}/users/{user_id}/roles", - path: { - org_code: data.orgCode, - user_id: data.userId, - }, - body: data.requestBody, - mediaType: "application/json", - errors: { - 403: "Invalid credentials.", - 429: "Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } /** * Delete Organization User Role + * * Delete role for an organization user. * *
* delete:organization_user_roles *
* - * @param data The data for the request. - * @param data.orgCode The organization's code. - * @param data.userId The user's id. - * @param data.roleId The role id. - * @returns success_response User successfully removed. - * @throws ApiError */ - public static deleteOrganizationUserRole( - data: DeleteOrganizationUserRoleData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "DELETE", + public static deleteOrganizationUserRole< + ThrowOnError extends boolean = false, + >(options: Options) { + return (options.client ?? client).delete< + DeleteOrganizationUserRoleResponses, + DeleteOrganizationUserRoleErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/organizations/{org_code}/users/{user_id}/roles/{role_id}", - path: { - org_code: data.orgCode, - user_id: data.userId, - role_id: data.roleId, - }, - errors: { - 400: "Error creating user.", - 403: "Invalid credentials.", - 429: "Request was throttled.", - }, + ...options, }); } /** * List Organization User Permissions + * * Get permissions for an organization user. * *
* read:organization_user_permissions *
* - * @param data The data for the request. - * @param data.orgCode The organization's code. - * @param data.userId The user's id. - * @param data.expand Additional data to include in the response. Allowed value: "roles". - * @returns get_organizations_user_permissions_response A successful response with a list of user permissions. - * @throws ApiError */ - public static getOrganizationUserPermissions( - data: GetOrganizationUserPermissionsData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static getOrganizationUserPermissions< + ThrowOnError extends boolean = false, + >(options: Options) { + return (options.client ?? client).get< + GetOrganizationUserPermissionsResponses, + GetOrganizationUserPermissionsErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/organizations/{org_code}/users/{user_id}/permissions", - path: { - org_code: data.orgCode, - user_id: data.userId, - }, - query: { - expand: data.expand, - }, - errors: { - 403: "Invalid credentials.", - 429: "Request was throttled.", - }, + ...options, }); } /** * Add Organization User Permission + * * Add permission to an organization user. * *
* create:organization_user_permissions *
* - * @param data The data for the request. - * @param data.orgCode The organization's code. - * @param data.userId The user's id. - * @param data.requestBody Permission details. - * @returns success_response User permission successfully updated. - * @throws ApiError */ - public static createOrganizationUserPermission( - data: CreateOrganizationUserPermissionData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "POST", + public static createOrganizationUserPermission< + ThrowOnError extends boolean = false, + >(options: Options) { + return (options.client ?? client).post< + CreateOrganizationUserPermissionResponses, + CreateOrganizationUserPermissionErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/organizations/{org_code}/users/{user_id}/permissions", - path: { - org_code: data.orgCode, - user_id: data.userId, - }, - body: data.requestBody, - mediaType: "application/json", - errors: { - 403: "Invalid credentials.", - 429: "Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } /** * Delete Organization User Permission + * * Delete permission for an organization user. * *
* delete:organization_user_permissions *
* - * @param data The data for the request. - * @param data.orgCode The organization's code. - * @param data.userId The user's id. - * @param data.permissionId The permission id. - * @returns success_response User successfully removed. - * @throws ApiError */ - public static deleteOrganizationUserPermission( - data: DeleteOrganizationUserPermissionData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "DELETE", + public static deleteOrganizationUserPermission< + ThrowOnError extends boolean = false, + >(options: Options) { + return (options.client ?? client).delete< + DeleteOrganizationUserPermissionResponses, + DeleteOrganizationUserPermissionErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/organizations/{org_code}/users/{user_id}/permissions/{permission_id}", - path: { - org_code: data.orgCode, - user_id: data.userId, - permission_id: data.permissionId, - }, - errors: { - 400: "Error creating user.", - 403: "Invalid credentials.", - 429: "Request was throttled.", - }, + ...options, }); } /** * Remove Organization User + * * Remove user from an organization. * *
* delete:organization_users *
* - * @param data The data for the request. - * @param data.orgCode The organization's code. - * @param data.userId The user's id. - * @returns success_response User successfully removed from organization - * @throws ApiError */ - public static removeOrganizationUser( - data: RemoveOrganizationUserData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "DELETE", + public static removeOrganizationUser( + options: Options, + ) { + return (options.client ?? client).delete< + RemoveOrganizationUserResponses, + RemoveOrganizationUserErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/organizations/{org_code}/users/{user_id}", - path: { - org_code: data.orgCode, - user_id: data.userId, - }, - errors: { - 400: "Error removing user", - 403: "Invalid credentials.", - 429: "Request was throttled.", - }, + ...options, }); } /** - * Add scope to organization user api - * Add a scope to an organization user api. + * Delete scope from organization user API + * + * Delete a scope from an organization user api you previously created. * *
- * create:organization_user_api_scopes + * delete:organization_user_api_scopes *
* - * @param data The data for the request. - * @param data.orgCode The identifier for the organization. - * @param data.userId User ID - * @param data.apiId API ID - * @param data.scopeId Scope ID - * @returns unknown API scope successfully added to organization user api - * @throws ApiError */ - public static addOrganizationUserApiScope( - data: AddOrganizationUserApiScopeData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "POST", + public static deleteOrganizationUserApiScope< + ThrowOnError extends boolean = false, + >(options: Options) { + return (options.client ?? client).delete< + DeleteOrganizationUserApiScopeResponses, + DeleteOrganizationUserApiScopeErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/organizations/{org_code}/users/{user_id}/apis/{api_id}/scopes/{scope_id}", - path: { - org_code: data.orgCode, - user_id: data.userId, - api_id: data.apiId, - scope_id: data.scopeId, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** - * Delete scope from organization user API - * Delete a scope from an organization user api you previously created. + * Add scope to organization user api + * + * Add a scope to an organization user api. * *
- * delete:organization_user_api_scopes + * create:organization_user_api_scopes *
* - * @param data The data for the request. - * @param data.orgCode The identifier for the organization. - * @param data.userId User ID - * @param data.apiId API ID - * @param data.scopeId Scope ID - * @returns unknown Organization user API scope successfully deleted. - * @throws ApiError */ - public static deleteOrganizationUserApiScope( - data: DeleteOrganizationUserApiScopeData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "DELETE", + public static addOrganizationUserApiScope< + ThrowOnError extends boolean = false, + >(options: Options) { + return (options.client ?? client).post< + AddOrganizationUserApiScopeResponses, + AddOrganizationUserApiScopeErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/organizations/{org_code}/users/{user_id}/apis/{api_id}/scopes/{scope_id}", - path: { - org_code: data.orgCode, - user_id: data.userId, - api_id: data.apiId, - scope_id: data.scopeId, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** - * Get an organization user's MFA configuration - * Get an organization user’s MFA configuration. + * Reset all organization MFA for a user + * + * Reset all organization MFA factors for a user. * *
- * read:organization_user_mfa + * delete:organization_user_mfa *
* - * @param data The data for the request. - * @param data.orgCode The identifier for the organization. - * @param data.userId The identifier for the user - * @returns get_user_mfa_response Successfully retrieve user's MFA configuration. - * @throws ApiError */ - public static getOrgUserMfa( - data: GetOrgUserMfaData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static resetOrgUserMfaAll( + options: Options, + ) { + return (options.client ?? client).delete< + ResetOrgUserMfaAllResponses, + ResetOrgUserMfaAllErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/organizations/{org_code}/users/{user_id}/mfa", - path: { - org_code: data.orgCode, - user_id: data.userId, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 404: "The specified resource was not found", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** - * Reset all organization MFA for a user - * Reset all organization MFA factors for a user. + * Get an organization user's MFA configuration + * + * Get an organization user’s MFA configuration. * *
- * delete:organization_user_mfa + * read:organization_user_mfa *
* - * @param data The data for the request. - * @param data.orgCode The identifier for the organization. - * @param data.userId The identifier for the user - * @returns success_response User's MFA successfully reset. - * @throws ApiError */ - public static resetOrgUserMfaAll( - data: ResetOrgUserMfaAllData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "DELETE", + public static getOrgUserMfa( + options: Options, + ) { + return (options.client ?? client).get< + GetOrgUserMfaResponses, + GetOrgUserMfaErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/organizations/{org_code}/users/{user_id}/mfa", - path: { - org_code: data.orgCode, - user_id: data.userId, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 404: "The specified resource was not found", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** * Reset specific organization MFA for a user + * * Reset a specific organization MFA factor for a user. * *
* delete:organization_user_mfa *
* - * @param data The data for the request. - * @param data.orgCode The identifier for the organization. - * @param data.userId The identifier for the user - * @param data.factorId The identifier for the MFA factor - * @returns success_response User's MFA successfully reset. - * @throws ApiError */ - public static resetOrgUserMfa( - data: ResetOrgUserMfaData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "DELETE", + public static resetOrgUserMfa( + options: Options, + ) { + return (options.client ?? client).delete< + ResetOrgUserMfaResponses, + ResetOrgUserMfaErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/organizations/{org_code}/users/{user_id}/mfa/{factor_id}", - path: { - org_code: data.orgCode, - user_id: data.userId, - factor_id: data.factorId, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 404: "The specified resource was not found", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** - * List Organization Feature Flags - * Get all organization feature flags. + * Delete Organization Feature Flag Overrides + * + * Delete all organization feature flag overrides. * *
- * read:organization_feature_flags + * delete:organization_feature_flags *
* - * @param data The data for the request. - * @param data.orgCode The identifier for the organization. - * @returns get_organization_feature_flags_response Feature flag overrides successfully returned. - * @throws ApiError */ - public static getOrganizationFeatureFlags( - data: GetOrganizationFeatureFlagsData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static deleteOrganizationFeatureFlagOverrides< + ThrowOnError extends boolean = false, + >( + options: Options, + ) { + return (options.client ?? client).delete< + DeleteOrganizationFeatureFlagOverridesResponses, + DeleteOrganizationFeatureFlagOverridesErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/organizations/{org_code}/feature_flags", - path: { - org_code: data.orgCode, - }, - errors: { - 400: "Invalid request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", - }, + ...options, }); } /** - * Delete Organization Feature Flag Overrides - * Delete all organization feature flag overrides. + * List Organization Feature Flags + * + * Get all organization feature flags. * *
- * delete:organization_feature_flags + * read:organization_feature_flags *
* - * @param data The data for the request. - * @param data.orgCode The identifier for the organization. - * @returns success_response Feature flag overrides successfully deleted. - * @throws ApiError */ - public static deleteOrganizationFeatureFlagOverrides( - data: DeleteOrganizationFeatureFlagOverridesData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "DELETE", + public static getOrganizationFeatureFlags< + ThrowOnError extends boolean = false, + >(options: Options) { + return (options.client ?? client).get< + GetOrganizationFeatureFlagsResponses, + GetOrganizationFeatureFlagsErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/organizations/{org_code}/feature_flags", - path: { - org_code: data.orgCode, - }, - errors: { - 400: "Invalid request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", - }, + ...options, }); } /** * Delete Organization Feature Flag Override + * * Delete organization feature flag override. * *
* delete:organization_feature_flags *
* - * @param data The data for the request. - * @param data.orgCode The identifier for the organization. - * @param data.featureFlagKey The identifier for the feature flag. - * @returns success_response Feature flag override successfully deleted. - * @throws ApiError */ - public static deleteOrganizationFeatureFlagOverride( - data: DeleteOrganizationFeatureFlagOverrideData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "DELETE", + public static deleteOrganizationFeatureFlagOverride< + ThrowOnError extends boolean = false, + >(options: Options) { + return (options.client ?? client).delete< + DeleteOrganizationFeatureFlagOverrideResponses, + DeleteOrganizationFeatureFlagOverrideErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/organizations/{org_code}/feature_flags/{feature_flag_key}", - path: { - org_code: data.orgCode, - feature_flag_key: data.featureFlagKey, - }, - errors: { - 400: "Invalid request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", - }, + ...options, }); } /** * Update Organization Feature Flag Override + * * Update organization feature flag override. * *
* update:organization_feature_flags *
* - * @param data The data for the request. - * @param data.orgCode The identifier for the organization - * @param data.featureFlagKey The identifier for the feature flag - * @param data.value Override value - * @returns success_response Feature flag override successfully updated. - * @throws ApiError */ - public static updateOrganizationFeatureFlagOverride( - data: UpdateOrganizationFeatureFlagOverrideData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "PATCH", + public static updateOrganizationFeatureFlagOverride< + ThrowOnError extends boolean = false, + >(options: Options) { + return (options.client ?? client).patch< + UpdateOrganizationFeatureFlagOverrideResponses, + UpdateOrganizationFeatureFlagOverrideErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/organizations/{org_code}/feature_flags/{feature_flag_key}", - path: { - org_code: data.orgCode, - feature_flag_key: data.featureFlagKey, - }, - query: { - value: data.value, - }, - errors: { - 400: "Invalid request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", - }, + ...options, }); } /** * Update Organization Property value + * * Update organization property value. * *
* update:organization_properties *
* - * @param data The data for the request. - * @param data.orgCode The identifier for the organization - * @param data.propertyKey The identifier for the property - * @param data.value The new property value - * @returns success_response Property successfully updated. - * @throws ApiError */ - public static updateOrganizationProperty( - data: UpdateOrganizationPropertyData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "PUT", + public static updateOrganizationProperty< + ThrowOnError extends boolean = false, + >(options: Options) { + return (options.client ?? client).put< + UpdateOrganizationPropertyResponses, + UpdateOrganizationPropertyErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/organizations/{org_code}/properties/{property_key}", - path: { - org_code: data.orgCode, - property_key: data.propertyKey, - }, - query: { - value: data.value, - }, - errors: { - 400: "Invalid request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", - }, + ...options, }); } /** * Get Organization Property Values + * * Gets properties for an organization by org code. * *
* read:organization_properties *
* - * @param data The data for the request. - * @param data.orgCode The organization's code. - * @returns get_property_values_response Properties successfully retrieved. - * @throws ApiError */ - public static getOrganizationPropertyValues( - data: GetOrganizationPropertyValuesData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static getOrganizationPropertyValues< + ThrowOnError extends boolean = false, + >(options: Options) { + return (options.client ?? client).get< + GetOrganizationPropertyValuesResponses, + GetOrganizationPropertyValuesErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/organizations/{org_code}/properties", - path: { - org_code: data.orgCode, - }, - errors: { - 400: "Bad request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", - }, + ...options, }); } /** * Update Organization Property values + * * Update organization property values. * *
* update:organization_properties *
* - * @param data The data for the request. - * @param data.orgCode The identifier for the organization - * @param data.requestBody Properties to update. - * @returns success_response Properties successfully updated. - * @throws ApiError */ - public static updateOrganizationProperties( - data: UpdateOrganizationPropertiesData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "PATCH", + public static updateOrganizationProperties< + ThrowOnError extends boolean = false, + >(options: Options) { + return (options.client ?? client).patch< + UpdateOrganizationPropertiesResponses, + UpdateOrganizationPropertiesErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/organizations/{org_code}/properties", - path: { - org_code: data.orgCode, - }, - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } /** * Replace Organization MFA Configuration + * * Replace Organization MFA Configuration. * *
* update:organization_mfa *
* - * @param data The data for the request. - * @param data.orgCode The identifier for the organization - * @param data.requestBody MFA details. - * @returns success_response MFA Configuration updated successfully. - * @throws ApiError */ - public static replaceOrganizationMfa( - data: ReplaceOrganizationMfaData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "PUT", + public static replaceOrganizationMfa( + options: Options, + ) { + return (options.client ?? client).put< + ReplaceOrganizationMfaResponses, + ReplaceOrganizationMfaErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/organizations/{org_code}/mfa", - path: { - org_code: data.orgCode, - }, - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } /** * Delete organization handle + * * Delete organization handle * *
* delete:organization_handles *
* - * @param data The data for the request. - * @param data.orgCode The organization's code. - * @returns success_response Handle successfully deleted. - * @throws ApiError */ - public static deleteOrganizationHandle( - data: DeleteOrganizationHandleData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "DELETE", + public static deleteOrganizationHandle( + options: Options, + ) { + return (options.client ?? client).delete< + DeleteOrganizationHandleResponses, + DeleteOrganizationHandleErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/organization/{org_code}/handle", - path: { - org_code: data.orgCode, - }, - errors: { - 400: "Bad request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", - }, + ...options, }); } /** * Read organization logo details + * * Read organization logo details * *
* read:organizations *
* - * @param data The data for the request. - * @param data.orgCode The organization's code. - * @returns read_logo_response Successfully retrieved organization logo details - * @throws ApiError */ - public static readOrganizationLogo( - data: ReadOrganizationLogoData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static readOrganizationLogo( + options: Options, + ) { + return (options.client ?? client).get< + ReadOrganizationLogoResponses, + ReadOrganizationLogoErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/organizations/{org_code}/logos", - path: { - org_code: data.orgCode, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** - * Add organization logo - * Add organization logo + * Delete organization logo + * + * Delete organization logo * *
* update:organizations *
* - * @param data The data for the request. - * @param data.orgCode The organization's code. - * @param data.type The type of logo to add. - * @param data.formData Organization logo details. - * @returns success_response Organization logo successfully updated - * @throws ApiError */ - public static addOrganizationLogo( - data: AddOrganizationLogoData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "POST", + public static deleteOrganizationLogo( + options: Options, + ) { + return (options.client ?? client).delete< + DeleteOrganizationLogoResponses, + DeleteOrganizationLogoErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/organizations/{org_code}/logos/{type}", - path: { - org_code: data.orgCode, - type: data.type, - }, - formData: data.formData, - mediaType: "multipart/form-data", - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** - * Delete organization logo - * Delete organization logo + * Add organization logo + * + * Add organization logo * *
* update:organizations *
* - * @param data The data for the request. - * @param data.orgCode The organization's code. - * @param data.type The type of logo to delete. - * @returns success_response Organization logo successfully deleted - * @returns void No logo found to delete - * @throws ApiError */ - public static deleteOrganizationLogo( - data: DeleteOrganizationLogoData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "DELETE", + public static addOrganizationLogo( + options: Options, + ) { + return (options.client ?? client).post< + AddOrganizationLogoResponses, + AddOrganizationLogoErrors, + ThrowOnError + >({ + ...formDataBodySerializer, + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/organizations/{org_code}/logos/{type}", - path: { - org_code: data.orgCode, - type: data.type, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", + ...options, + headers: { + "Content-Type": null, + ...options.headers, }, }); } /** * Get connections + * * Gets all connections for an organization. * *
* read:organization_connections *
* - * @param data The data for the request. - * @param data.organizationCode The organization code. - * @returns get_connections_response Organization connections successfully retrieved. - * @throws ApiError */ - public static getOrganizationConnections( - data: GetOrganizationConnectionsData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static getOrganizationConnections< + ThrowOnError extends boolean = false, + >(options: Options) { + return (options.client ?? client).get< + GetOrganizationConnectionsResponses, + GetOrganizationConnectionsErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/organizations/{organization_code}/connections", - path: { - organization_code: data.organizationCode, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** - * Enable connection - * Enable an auth connection for an organization. + * Remove connection + * + * Turn off an auth connection for an organization * *
- * create:organization_connections + * delete:organization_connections *
* - * @param data The data for the request. - * @param data.organizationCode The unique code for the organization. - * @param data.connectionId The identifier for the connection. - * @returns unknown Connection successfully enabled. - * @throws ApiError */ - public static enableOrgConnection( - data: EnableOrgConnectionData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "POST", + public static removeOrgConnection( + options: Options, + ) { + return (options.client ?? client).delete< + RemoveOrgConnectionResponses, + RemoveOrgConnectionErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/organizations/{organization_code}/connections/{connection_id}", - path: { - organization_code: data.organizationCode, - connection_id: data.connectionId, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** - * Remove connection - * Turn off an auth connection for an organization + * Enable connection + * + * Enable an auth connection for an organization. * *
- * delete:organization_connections + * create:organization_connections *
* - * @param data The data for the request. - * @param data.organizationCode The unique code for the organization. - * @param data.connectionId The identifier for the connection. - * @returns success_response Connection successfully removed. - * @throws ApiError */ - public static removeOrgConnection( - data: RemoveOrgConnectionData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "DELETE", + public static enableOrgConnection( + options: Options, + ) { + return (options.client ?? client).post< + EnableOrgConnectionResponses, + EnableOrgConnectionErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/organizations/{organization_code}/connections/{connection_id}", - path: { - organization_code: data.organizationCode, - connection_id: data.connectionId, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** * Update organization session configuration + * * Update the organization's session configuration. * *
* update:organizations *
* - * @param data The data for the request. - * @param data.orgCode The organization's code. - * @param data.requestBody Organization session configuration. - * @returns success_response Organization sessions successfully updated - * @throws ApiError */ - public static updateOrganizationSessions( - data: UpdateOrganizationSessionsData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "PATCH", + public static updateOrganizationSessions< + ThrowOnError extends boolean = false, + >(options: Options) { + return (options.client ?? client).patch< + UpdateOrganizationSessionsResponses, + UpdateOrganizationSessionsErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/organizations/{org_code}/sessions", - path: { - org_code: data.orgCode, - }, - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } @@ -3806,125 +3336,104 @@ export class Organizations { export class Permissions { /** * List Permissions + * * The returned list can be sorted by permission name or permission ID in ascending or descending order. The number of records to return at a time can also be controlled using the `page_size` query string parameter. * *
* read:permissions *
* - * @param data The data for the request. - * @param data.sort Field and order to sort the result by. - * @param data.pageSize Number of results per page. Defaults to 10 if parameter not sent. - * @param data.nextToken A string to get the next page of results if there are more results. - * @returns get_permissions_response Permissions successfully retrieved. - * @throws ApiError */ - public static getPermissions( - data: GetPermissionsData = {}, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static getPermissions( + options?: Options, + ) { + return (options?.client ?? client).get< + GetPermissionsResponses, + GetPermissionsErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/permissions", - query: { - sort: data.sort, - page_size: data.pageSize, - next_token: data.nextToken, - }, - errors: { - 403: "Invalid credentials.", - 429: "Request was throttled.", - }, + ...options, }); } /** * Create Permission + * * Create a new permission. * *
* create:permissions *
* - * @param data The data for the request. - * @param data.requestBody Permission details. - * @returns success_response Permission successfully created - * @throws ApiError */ - public static createPermission( - data: CreatePermissionData = {}, - ): CancelablePromise { - return __request(OpenAPI, { - method: "POST", + public static createPermission( + options?: Options, + ) { + return (options?.client ?? client).post< + CreatePermissionResponses, + CreatePermissionErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/permissions", - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options?.headers, }, }); } /** - * Update Permission - * Update permission + * Delete Permission + * + * Delete permission * *
- * update:permissions + * delete:permissions *
* - * @param data The data for the request. - * @param data.permissionId The identifier for the permission. - * @param data.requestBody Permission details. - * @returns success_response Permission successfully updated - * @throws ApiError */ - public static updatePermissions( - data: UpdatePermissionsData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "PATCH", + public static deletePermission( + options: Options, + ) { + return (options.client ?? client).delete< + DeletePermissionResponses, + DeletePermissionErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/permissions/{permission_id}", - path: { - permission_id: data.permissionId, - }, - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", - }, + ...options, }); } /** - * Delete Permission - * Delete permission + * Update Permission + * + * Update permission * *
- * delete:permissions + * update:permissions *
* - * @param data The data for the request. - * @param data.permissionId The identifier for the permission. - * @returns success_response permission successfully updated. - * @throws ApiError */ - public static deletePermission( - data: DeletePermissionData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "DELETE", + public static updatePermissions( + options: Options, + ) { + return (options.client ?? client).patch< + UpdatePermissionsResponses, + UpdatePermissionsErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/permissions/{permission_id}", - path: { - permission_id: data.permissionId, - }, - errors: { - 400: "Invalid request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } @@ -3933,128 +3442,104 @@ export class Permissions { export class Properties { /** * List properties + * * Returns a list of properties * *
* read:properties *
* - * @param data The data for the request. - * @param data.pageSize Number of results per page. Defaults to 10 if parameter not sent. - * @param data.startingAfter The ID of the property to start after. - * @param data.endingBefore The ID of the property to end before. - * @param data.context Filter results by user, organization or application context - * @returns get_properties_response Properties successfully retrieved. - * @throws ApiError */ - public static getProperties( - data: GetPropertiesData = {}, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static getProperties( + options?: Options, + ) { + return (options?.client ?? client).get< + GetPropertiesResponses, + GetPropertiesErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/properties", - query: { - page_size: data.pageSize, - starting_after: data.startingAfter, - ending_before: data.endingBefore, - context: data.context, - }, - errors: { - 400: "Invalid request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", - }, + ...options, }); } /** * Create Property + * * Create property. * *
* create:properties *
* - * @param data The data for the request. - * @param data.requestBody Property details. - * @returns create_property_response Property successfully created - * @throws ApiError */ - public static createProperty( - data: CreatePropertyData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "POST", + public static createProperty( + options: Options, + ) { + return (options.client ?? client).post< + CreatePropertyResponses, + CreatePropertyErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/properties", - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } /** - * Update Property - * Update property. + * Delete Property + * + * Delete property. * *
- * update:properties + * delete:properties *
* - * @param data The data for the request. - * @param data.propertyId The unique identifier for the property. - * @param data.requestBody The fields of the property to update. - * @returns success_response Property successfully updated. - * @throws ApiError */ - public static updateProperty( - data: UpdatePropertyData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "PUT", + public static deleteProperty( + options: Options, + ) { + return (options.client ?? client).delete< + DeletePropertyResponses, + DeletePropertyErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/properties/{property_id}", - path: { - property_id: data.propertyId, - }, - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", - }, + ...options, }); } /** - * Delete Property - * Delete property. + * Update Property + * + * Update property. * *
- * delete:properties + * update:properties *
* - * @param data The data for the request. - * @param data.propertyId The unique identifier for the property. - * @returns success_response Property successfully deleted. - * @throws ApiError */ - public static deleteProperty( - data: DeletePropertyData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "DELETE", + public static updateProperty( + options: Options, + ) { + return (options.client ?? client).put< + UpdatePropertyResponses, + UpdatePropertyErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/properties/{property_id}", - path: { - property_id: data.propertyId, - }, - errors: { - 400: "Invalid request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } @@ -4063,98 +3548,80 @@ export class Properties { export class PropertyCategories { /** * List categories + * * Returns a list of categories. * *
* read:property_categories *
* - * @param data The data for the request. - * @param data.pageSize Number of results per page. Defaults to 10 if parameter not sent. - * @param data.startingAfter The ID of the category to start after. - * @param data.endingBefore The ID of the category to end before. - * @param data.context Filter the results by User or Organization context - * @returns get_categories_response Categories successfully retrieved. - * @throws ApiError */ - public static getCategories( - data: GetCategoriesData = {}, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static getCategories( + options?: Options, + ) { + return (options?.client ?? client).get< + GetCategoriesResponses, + GetCategoriesErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/property_categories", - query: { - page_size: data.pageSize, - starting_after: data.startingAfter, - ending_before: data.endingBefore, - context: data.context, - }, - errors: { - 400: "Invalid request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", - }, + ...options, }); } /** * Create Category + * * Create category. * *
* create:property_categories *
* - * @param data The data for the request. - * @param data.requestBody Category details. - * @returns create_category_response Category successfully created - * @throws ApiError */ - public static createCategory( - data: CreateCategoryData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "POST", + public static createCategory( + options: Options, + ) { + return (options.client ?? client).post< + CreateCategoryResponses, + CreateCategoryErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/property_categories", - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } /** * Update Category + * * Update category. * *
* update:property_categories *
* - * @param data The data for the request. - * @param data.categoryId The unique identifier for the category. - * @param data.requestBody The fields of the category to update. - * @returns success_response category successfully updated. - * @throws ApiError */ - public static updateCategory( - data: UpdateCategoryData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "PUT", + public static updateCategory( + options: Options, + ) { + return (options.client ?? client).put< + UpdateCategoryResponses, + UpdateCategoryErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/property_categories/{category_id}", - path: { - category_id: data.categoryId, - }, - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } @@ -4163,352 +3630,281 @@ export class PropertyCategories { export class Roles { /** * List roles + * * The returned list can be sorted by role name or role ID in ascending or descending order. The number of records to return at a time can also be controlled using the `page_size` query string parameter. * *
* read:roles *
* - * @param data The data for the request. - * @param data.sort Field and order to sort the result by. - * @param data.pageSize Number of results per page. Defaults to 10 if parameter not sent. - * @param data.nextToken A string to get the next page of results if there are more results. - * @returns get_roles_response Roles successfully retrieved. - * @throws ApiError */ - public static getRoles( - data: GetRolesData = {}, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static getRoles( + options?: Options, + ) { + return (options?.client ?? client).get< + GetRolesResponses, + GetRolesErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/roles", - query: { - sort: data.sort, - page_size: data.pageSize, - next_token: data.nextToken, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** * Create role + * * Create role. * *
* create:roles *
* - * @param data The data for the request. - * @param data.requestBody Role details. - * @returns create_roles_response Role successfully created - * @throws ApiError */ - public static createRole( - data: CreateRoleData = {}, - ): CancelablePromise { - return __request(OpenAPI, { - method: "POST", + public static createRole( + options?: Options, + ) { + return (options?.client ?? client).post< + CreateRoleResponses, + CreateRoleErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/roles", - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options?.headers, }, }); } /** - * Get role - * Get a role + * Delete role + * + * Delete role * *
- * read:roles + * delete:roles *
* - * @param data The data for the request. - * @param data.roleId The identifier for the role. - * @returns get_role_response Role successfully retrieved. - * @throws ApiError */ - public static getRole(data: GetRoleData): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static deleteRole( + options: Options, + ) { + return (options.client ?? client).delete< + DeleteRoleResponses, + DeleteRoleErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/roles/{role_id}", - path: { - role_id: data.roleId, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** - * Update role - * Update a role + * Get role + * + * Get a role * *
- * update:roles + * read:roles *
* - * @param data The data for the request. - * @param data.roleId The identifier for the role. - * @param data.requestBody Role details. - * @returns success_response Role successfully updated - * @throws ApiError */ - public static updateRoles( - data: UpdateRolesData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "PATCH", + public static getRole( + options: Options, + ) { + return (options.client ?? client).get< + GetRoleResponses, + GetRoleErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/roles/{role_id}", - path: { - role_id: data.roleId, - }, - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** - * Delete role - * Delete role + * Update role + * + * Update a role * *
- * delete:roles + * update:roles *
* - * @param data The data for the request. - * @param data.roleId The identifier for the role. - * @returns success_response Role successfully deleted. - * @throws ApiError */ - public static deleteRole( - data: DeleteRoleData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "DELETE", + public static updateRoles( + options: Options, + ) { + return (options.client ?? client).patch< + UpdateRolesResponses, + UpdateRolesErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/roles/{role_id}", - path: { - role_id: data.roleId, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } /** * Get role scopes + * * Get scopes for a role. * *
* read:role_scopes *
* - * @param data The data for the request. - * @param data.roleId The role id. - * @returns role_scopes_response A list of scopes for a role - * @throws ApiError */ - public static getRoleScopes( - data: GetRoleScopesData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static getRoleScopes( + options: Options, + ) { + return (options.client ?? client).get< + GetRoleScopesResponses, + GetRoleScopesErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/roles/{role_id}/scopes", - path: { - role_id: data.roleId, - }, - errors: { - 400: "Error removing user", - 403: "Invalid credentials.", - 429: "Request was throttled.", - }, + ...options, }); } /** * Add role scope + * * Add scope to role. * *
* create:role_scopes *
* - * @param data The data for the request. - * @param data.roleId The role id. - * @param data.requestBody Add scope to role. - * @returns add_role_scope_response Role scope successfully added. - * @throws ApiError */ - public static addRoleScope( - data: AddRoleScopeData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "POST", + public static addRoleScope( + options: Options, + ) { + return (options.client ?? client).post< + AddRoleScopeResponses, + AddRoleScopeErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/roles/{role_id}/scopes", - path: { - role_id: data.roleId, - }, - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } /** * Delete role scope + * * Delete scope from role. * *
* delete:role_scopes *
* - * @param data The data for the request. - * @param data.roleId The role id. - * @param data.scopeId The scope id. - * @returns delete_role_scope_response Role scope successfully deleted. - * @throws ApiError */ - public static deleteRoleScope( - data: DeleteRoleScopeData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "DELETE", + public static deleteRoleScope( + options: Options, + ) { + return (options.client ?? client).delete< + DeleteRoleScopeResponses, + DeleteRoleScopeErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/roles/{role_id}/scopes/{scope_id}", - path: { - role_id: data.roleId, - scope_id: data.scopeId, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** * Get role permissions + * * Get permissions for a role. * *
* read:role_permissions *
* - * @param data The data for the request. - * @param data.roleId The role's public id. - * @param data.sort Field and order to sort the result by. - * @param data.pageSize Number of results per page. Defaults to 10 if parameter not sent. - * @param data.nextToken A string to get the next page of results if there are more results. - * @returns role_permissions_response A list of permissions for a role - * @throws ApiError */ - public static getRolePermissions( - data: GetRolePermissionsData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static getRolePermissions( + options: Options, + ) { + return (options.client ?? client).get< + GetRolePermissionsResponses, + GetRolePermissionsErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/roles/{role_id}/permissions", - path: { - role_id: data.roleId, - }, - query: { - sort: data.sort, - page_size: data.pageSize, - next_token: data.nextToken, - }, - errors: { - 400: "Error removing user", - 403: "Invalid credentials.", - 429: "Request was throttled.", - }, + ...options, }); } /** * Update role permissions + * * Update role permissions. * *
* update:role_permissions *
* - * @param data The data for the request. - * @param data.roleId The identifier for the role. - * @param data.requestBody - * @returns update_role_permissions_response Permissions successfully updated. - * @throws ApiError */ - public static updateRolePermissions( - data: UpdateRolePermissionsData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "PATCH", + public static updateRolePermissions( + options: Options, + ) { + return (options.client ?? client).patch< + UpdateRolePermissionsResponses, + UpdateRolePermissionsErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/roles/{role_id}/permissions", - path: { - role_id: data.roleId, - }, - body: data.requestBody, - mediaType: "application/json", - errors: { - 403: "Invalid credentials.", - 429: "Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } /** * Remove role permission + * * Remove a permission from a role. * *
* delete:role_permissions *
* - * @param data The data for the request. - * @param data.roleId The role's public id. - * @param data.permissionId The permission's public id. - * @returns success_response Permission successfully removed from role - * @throws ApiError */ - public static removeRolePermission( - data: RemoveRolePermissionData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "DELETE", + public static removeRolePermission( + options: Options, + ) { + return (options.client ?? client).delete< + RemoveRolePermissionResponses, + RemoveRolePermissionErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/roles/{role_id}/permissions/{permission_id}", - path: { - role_id: data.roleId, - permission_id: data.permissionId, - }, - errors: { - 400: "Error removing user", - 403: "Invalid credentials.", - 429: "Request was throttled.", - }, + ...options, }); } } @@ -4516,6 +3912,7 @@ export class Roles { export class Search { /** * Search users + * * Search for users based on the provided query string. Set query to '*' to filter by other parameters only. * The number of records to return at a time can be controlled using the `page_size` query string parameter. * @@ -4523,37 +3920,18 @@ export class Search { * read:users * * - * @param data The data for the request. - * @param data.pageSize Number of results per page. Defaults to 10 if parameter not sent. - * @param data.query Search the users by email or name. Use '*' to search all. - * @param data.apiScopes Search the users by api scopes. - * @param data.properties - * @param data.startingAfter The ID of the user to start after. - * @param data.endingBefore The ID of the user to end before. - * @param data.expand Additional data to include in the response. One or more of (comma-separated): "organizations", "identities", "properties". - * @returns search_users_response Users successfully retrieved. - * @throws ApiError - */ - public static searchUsers( - data: SearchUsersData = {}, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + */ + public static searchUsers( + options?: Options, + ) { + return (options?.client ?? client).get< + SearchUsersResponses, + SearchUsersErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/search/users", - query: { - page_size: data.pageSize, - query: data.query, - api_scopes: data.apiScopes, - properties: data.properties, - starting_after: data.startingAfter, - ending_before: data.endingBefore, - expand: data.expand, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } } @@ -4561,6 +3939,7 @@ export class Search { export class Subscribers { /** * List Subscribers + * * The returned list can be sorted by full name or email address * in ascending or descending order. The number of records to return at a time can also be controlled using the `page_size` query * string parameter. @@ -4569,117 +3948,66 @@ export class Subscribers { * read:subscribers * * - * @param data The data for the request. - * @param data.sort Field and order to sort the result by. - * @param data.pageSize Number of results per page. Defaults to 10 if parameter not sent. - * @param data.nextToken A string to get the next page of results if there are more results. - * @returns get_subscribers_response Subscriber successfully retrieved. - * @throws ApiError */ - public static getSubscribers( - data: GetSubscribersData = {}, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static getSubscribers( + options?: Options, + ) { + return (options?.client ?? client).get< + GetSubscribersResponses, + GetSubscribersErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/subscribers", - query: { - sort: data.sort, - page_size: data.pageSize, - next_token: data.nextToken, - }, - errors: { - 403: "Bad request.", - 429: "Request was throttled.", - }, + ...options, }); } /** * Create Subscriber + * * Create subscriber. * *
* create:subscribers *
* - * @param data The data for the request. - * @param data.firstName Subscriber's first name. - * @param data.lastName Subscriber's last name. - * @param data.email The email address of the subscriber. - * @returns create_subscriber_success_response Subscriber successfully created - * @throws ApiError */ - public static createSubscriber( - data: CreateSubscriberData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "POST", + public static createSubscriber( + options: Options, + ) { + return (options.client ?? client).post< + CreateSubscriberResponses, + CreateSubscriberErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/subscribers", - query: { - first_name: data.firstName, - last_name: data.lastName, - email: data.email, - }, - errors: { - 400: "Invalid request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", - }, + ...options, }); } /** * Get Subscriber + * * Retrieve a subscriber record. * *
* read:subscribers *
* - * @param data The data for the request. - * @param data.subscriberId The subscriber's id. - * @returns get_subscriber_response Subscriber successfully retrieved. - * @throws ApiError */ - public static getSubscriber( - data: GetSubscriberData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static getSubscriber( + options: Options, + ) { + return (options.client ?? client).get< + GetSubscriberResponses, + GetSubscriberErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/subscribers/{subscriber_id}", - path: { - subscriber_id: data.subscriberId, - }, - errors: { - 400: "Bad request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", - }, - }); - } -} - -export class Timezones { - /** - * Get timezones - * Get a list of timezones and associated timezone keys. - * - *
- * read:timezones - *
- * - * @returns get_timezones_response A list of timezones. - * @throws ApiError - */ - public static getTimezones(): CancelablePromise { - return __request(OpenAPI, { - method: "GET", - url: "/api/v1/timezones", - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } } @@ -4687,598 +4015,454 @@ export class Timezones { export class Users { /** * Get users + * * The returned list can be sorted by full name or email address in ascending or descending order. The number of records to return at a time can also be controlled using the `page_size` query string parameter. * *
* read:users *
* - * @param data The data for the request. - * @param data.pageSize Number of results per page. Defaults to 10 if parameter not sent. - * @param data.userId Filter the results by User ID. The query string should be comma separated and url encoded. - * @param data.nextToken A string to get the next page of results if there are more results. - * @param data.email Filter the results by email address. The query string should be comma separated and url encoded. - * @param data.username Filter the results by username. The query string should be comma separated and url encoded. - * @param data.phone Filter the results by phone. The query string should be comma separated and url encoded. - * @param data.expand Additional data to include in the response. One or more of (comma-separated): "organizations", "identities", "billing". - * @param data.hasOrganization Filter the results by if the user has at least one organization assigned. - * @param data.activeSince Filter the results to only include users who have been active since this date. Date should be in ISO 8601 format. - * @returns users_response Users successfully retrieved. - * @throws ApiError - */ - public static getUsers( - data: GetUsersData = {}, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + */ + public static getUsers( + options?: Options, + ) { + return (options?.client ?? client).get< + GetUsersResponses, + GetUsersErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/users", - query: { - page_size: data.pageSize, - user_id: data.userId, - next_token: data.nextToken, - email: data.email, - username: data.username, - phone: data.phone, - expand: data.expand, - has_organization: data.hasOrganization, - active_since: data.activeSince, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** * Refresh User Claims and Invalidate Cache + * * Refreshes the user's claims and invalidates the current cache. * *
* update:user_refresh_claims *
* - * @param data The data for the request. - * @param data.userId The id of the user whose claims needs to be updated. - * @returns success_response Claims successfully refreshed. - * @throws ApiError */ - public static refreshUserClaims( - data: RefreshUserClaimsData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "POST", + public static refreshUserClaims( + options: Options, + ) { + return (options.client ?? client).post< + RefreshUserClaimsResponses, + RefreshUserClaimsErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/users/{user_id}/refresh_claims", - path: { - user_id: data.userId, - }, - errors: { - 400: "Bad request.", - 403: "Bad request.", - 429: "Request was throttled.", - }, + ...options, }); } /** - * Get user - * Retrieve a user record. + * Delete user + * + * Delete a user record. * *
- * read:users + * delete:users *
* - * @param data The data for the request. - * @param data.id The user's id. - * @param data.expand Additional data to include in the response. One or more of (comma-separated): "organizations", "identities", "billing". - * @returns user User successfully retrieved. - * @throws ApiError */ - public static getUserData( - data: GetUserDataData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static deleteUser( + options: Options, + ) { + return (options.client ?? client).delete< + DeleteUserResponses, + DeleteUserErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/user", - query: { - id: data.id, - expand: data.expand, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** - * Create user - * Creates a user record and optionally zero or more identities for the user. An example identity could be the email - * address of the user. + * Get user + * + * Retrieve a user record. * *
- * create:users + * read:users *
* - * @param data The data for the request. - * @param data.requestBody The details of the user to create. - * @returns create_user_response User successfully created. - * @throws ApiError */ - public static createUser( - data: CreateUserData = {}, - ): CancelablePromise { - return __request(OpenAPI, { - method: "POST", + public static getUserData( + options: Options, + ) { + return (options.client ?? client).get< + GetUserDataResponses, + GetUserDataErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/user", - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** * Update user + * * Update a user record. * *
* update:users *
* - * @param data The data for the request. - * @param data.id The user's id. - * @param data.requestBody The user to update. - * @returns update_user_response User successfully updated. - * @throws ApiError */ - public static updateUser( - data: UpdateUserData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "PATCH", + public static updateUser( + options: Options, + ) { + return (options.client ?? client).patch< + UpdateUserResponses, + UpdateUserErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/user", - query: { - id: data.id, - }, - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } /** - * Delete user - * Delete a user record. + * Create user + * + * Creates a user record and optionally zero or more identities for the user. An example identity could be the email + * address of the user. * *
- * delete:users + * create:users *
* - * @param data The data for the request. - * @param data.id The user's id. - * @param data.isDeleteProfile Delete all data and remove the user's profile from all of Kinde, including the subscriber list - * @returns success_response User successfully deleted. - * @throws ApiError */ - public static deleteUser( - data: DeleteUserData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "DELETE", + public static createUser( + options?: Options, + ) { + return (options?.client ?? client).post< + CreateUserResponses, + CreateUserErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/user", - query: { - id: data.id, - is_delete_profile: data.isDeleteProfile, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 429: "Too many requests. Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options?.headers, }, }); } /** * Update User Feature Flag Override + * * Update user feature flag override. * *
* update:user_feature_flags *
* - * @param data The data for the request. - * @param data.userId The identifier for the user - * @param data.featureFlagKey The identifier for the feature flag - * @param data.value Override value - * @returns success_response Feature flag override successfully updated. - * @throws ApiError */ - public static updateUserFeatureFlagOverride( - data: UpdateUserFeatureFlagOverrideData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "PATCH", + public static updateUserFeatureFlagOverride< + ThrowOnError extends boolean = false, + >(options: Options) { + return (options.client ?? client).patch< + UpdateUserFeatureFlagOverrideResponses, + UpdateUserFeatureFlagOverrideErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/users/{user_id}/feature_flags/{feature_flag_key}", - path: { - user_id: data.userId, - feature_flag_key: data.featureFlagKey, - }, - query: { - value: data.value, - }, - errors: { - 400: "Invalid request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", - }, + ...options, }); } /** * Update Property value + * * Update property value. * *
* update:user_properties *
* - * @param data The data for the request. - * @param data.userId The identifier for the user - * @param data.propertyKey The identifier for the property - * @param data.value The new property value - * @returns success_response Property successfully updated. - * @throws ApiError */ - public static updateUserProperty( - data: UpdateUserPropertyData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "PUT", + public static updateUserProperty( + options: Options, + ) { + return (options.client ?? client).put< + UpdateUserPropertyResponses, + UpdateUserPropertyErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/users/{user_id}/properties/{property_key}", - path: { - user_id: data.userId, - property_key: data.propertyKey, - }, - query: { - value: data.value, - }, - errors: { - 400: "Invalid request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", - }, + ...options, }); } /** * Get property values + * * Gets properties for an user by ID. * *
* read:user_properties *
* - * @param data The data for the request. - * @param data.userId The user's ID. - * @returns get_property_values_response Properties successfully retrieved. - * @throws ApiError */ - public static getUserPropertyValues( - data: GetUserPropertyValuesData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static getUserPropertyValues( + options: Options, + ) { + return (options.client ?? client).get< + GetUserPropertyValuesResponses, + GetUserPropertyValuesErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/users/{user_id}/properties", - path: { - user_id: data.userId, - }, - errors: { - 400: "Bad request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", - }, + ...options, }); } /** * Update Property values + * * Update property values. * *
* update:user_properties *
* - * @param data The data for the request. - * @param data.userId The identifier for the user - * @param data.requestBody Properties to update. - * @returns success_response Properties successfully updated. - * @throws ApiError */ - public static updateUserProperties( - data: UpdateUserPropertiesData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "PATCH", + public static updateUserProperties( + options: Options, + ) { + return (options.client ?? client).patch< + UpdateUserPropertiesResponses, + UpdateUserPropertiesErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/users/{user_id}/properties", - path: { - user_id: data.userId, - }, - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } /** * Set User password + * * Set user password. * *
* update:user_passwords *
* - * @param data The data for the request. - * @param data.userId The identifier for the user - * @param data.requestBody Password details. - * @returns success_response User successfully created. - * @throws ApiError */ - public static setUserPassword( - data: SetUserPasswordData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "PUT", + public static setUserPassword( + options: Options, + ) { + return (options.client ?? client).put< + SetUserPasswordResponses, + SetUserPasswordErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/users/{user_id}/password", - path: { - user_id: data.userId, - }, - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Error creating user.", - 403: "Invalid credentials.", - 429: "Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } /** * Get identities + * * Gets a list of identities for an user by ID. * *
* read:user_identities *
* - * @param data The data for the request. - * @param data.userId The user's ID. - * @param data.startingAfter The ID of the identity to start after. - * @param data.endingBefore The ID of the identity to end before. - * @returns get_identities_response Identities successfully retrieved. - * @throws ApiError */ - public static getUserIdentities( - data: GetUserIdentitiesData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static getUserIdentities( + options: Options, + ) { + return (options.client ?? client).get< + GetUserIdentitiesResponses, + GetUserIdentitiesErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/users/{user_id}/identities", - path: { - user_id: data.userId, - }, - query: { - starting_after: data.startingAfter, - ending_before: data.endingBefore, - }, - errors: { - 400: "Bad request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", - }, + ...options, }); } /** * Create identity + * * Creates an identity for a user. * *
* create:user_identities *
* - * @param data The data for the request. - * @param data.userId The user's ID. - * @param data.requestBody The identity details. - * @returns create_identity_response Identity successfully created. - * @throws ApiError */ - public static createUserIdentity( - data: CreateUserIdentityData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "POST", + public static createUserIdentity( + options: Options, + ) { + return (options.client ?? client).post< + CreateUserIdentityResponses, + CreateUserIdentityErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/users/{user_id}/identities", - path: { - user_id: data.userId, - }, - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Error creating identity.", - 403: "Invalid credentials.", - 429: "Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } /** - * Get user sessions - * Retrieve the list of active sessions for a specific user. + * Delete user sessions + * + * Invalidate user sessions. * *
- * read:user_sessions + * delete:user_sessions *
* - * @param data The data for the request. - * @param data.userId The identifier for the user - * @returns get_user_sessions_response Successfully retrieved user sessions. - * @throws ApiError */ - public static getUserSessions( - data: GetUserSessionsData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static deleteUserSessions( + options: Options, + ) { + return (options.client ?? client).delete< + DeleteUserSessionsResponses, + DeleteUserSessionsErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/users/{user_id}/sessions", - path: { - user_id: data.userId, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 404: "The specified resource was not found", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** - * Delete user sessions - * Invalidate user sessions. + * Get user sessions + * + * Retrieve the list of active sessions for a specific user. * *
- * delete:user_sessions + * read:user_sessions *
* - * @param data The data for the request. - * @param data.userId The identifier for the user - * @returns success_response User sessions successfully invalidated. - * @throws ApiError */ - public static deleteUserSessions( - data: DeleteUserSessionsData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "DELETE", + public static getUserSessions( + options: Options, + ) { + return (options.client ?? client).get< + GetUserSessionsResponses, + GetUserSessionsErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/users/{user_id}/sessions", - path: { - user_id: data.userId, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 404: "The specified resource was not found", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** - * Get user's MFA configuration - * Get a user’s MFA configuration. + * Reset all environment MFA for a user + * + * Reset all environment MFA factors for a user. * *
- * read:user_mfa + * delete:user_mfa *
* - * @param data The data for the request. - * @param data.userId The identifier for the user - * @returns get_user_mfa_response Successfully retrieve user's MFA configuration. - * @throws ApiError */ - public static getUsersMfa( - data: GetUsersMfaData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static resetUsersMfaAll( + options: Options, + ) { + return (options.client ?? client).delete< + ResetUsersMfaAllResponses, + ResetUsersMfaAllErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/users/{user_id}/mfa", - path: { - user_id: data.userId, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 404: "The specified resource was not found", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** - * Reset all environment MFA for a user - * Reset all environment MFA factors for a user. + * Get user's MFA configuration + * + * Get a user’s MFA configuration. * *
- * delete:user_mfa + * read:user_mfa *
* - * @param data The data for the request. - * @param data.userId The identifier for the user - * @returns success_response User's MFA successfully reset. - * @throws ApiError */ - public static resetUsersMfaAll( - data: ResetUsersMfaAllData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "DELETE", + public static getUsersMfa( + options: Options, + ) { + return (options.client ?? client).get< + GetUsersMfaResponses, + GetUsersMfaErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/users/{user_id}/mfa", - path: { - user_id: data.userId, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 404: "The specified resource was not found", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } /** * Reset specific environment MFA for a user + * * Reset a specific environment MFA factor for a user. * *
* delete:user_mfa *
* - * @param data The data for the request. - * @param data.userId The identifier for the user - * @param data.factorId The identifier for the MFA factor - * @returns success_response User's MFA successfully reset. - * @throws ApiError */ - public static resetUsersMfa( - data: ResetUsersMfaData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "DELETE", + public static resetUsersMfa( + options: Options, + ) { + return (options.client ?? client).delete< + ResetUsersMfaResponses, + ResetUsersMfaErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/users/{user_id}/mfa/{factor_id}", - path: { - user_id: data.userId, - factor_id: data.factorId, - }, - errors: { - 400: "Invalid request.", - 403: "Unauthorized - invalid credentials.", - 404: "The specified resource was not found", - 429: "Too many requests. Request was throttled.", - }, + ...options, }); } } @@ -5286,168 +4470,152 @@ export class Users { export class Webhooks { /** * Get Event + * * Returns an event * *
* read:events *
* - * @param data The data for the request. - * @param data.eventId The event id. - * @returns get_event_response Event successfully retrieved. - * @throws ApiError */ - public static getEvent( - data: GetEventData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static getEvent( + options: Options, + ) { + return (options.client ?? client).get< + GetEventResponses, + GetEventErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/events/{event_id}", - path: { - event_id: data.eventId, - }, - errors: { - 400: "Invalid request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", - }, + ...options, }); } /** * List Event Types + * * Returns a list event type definitions * *
* read:event_types *
* - * @returns get_event_types_response Event types successfully retrieved. - * @throws ApiError */ - public static getEventTypes(): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static getEventTypes( + options?: Options, + ) { + return (options?.client ?? client).get< + GetEventTypesResponses, + GetEventTypesErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/event_types", - errors: { - 400: "Invalid request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", - }, + ...options, }); } /** * Delete Webhook + * * Delete webhook * *
* delete:webhooks *
* - * @param data The data for the request. - * @param data.webhookId The webhook id. - * @returns delete_webhook_response Webhook successfully deleted. - * @throws ApiError */ - public static deleteWebHook( - data: DeleteWebHookData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "DELETE", + public static deleteWebHook( + options: Options, + ) { + return (options.client ?? client).delete< + DeleteWebHookResponses, + DeleteWebHookErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/webhooks/{webhook_id}", - path: { - webhook_id: data.webhookId, - }, - errors: { - 400: "Invalid request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", - }, + ...options, }); } /** * Update a Webhook + * * Update a webhook * *
* update:webhooks *
* - * @param data The data for the request. - * @param data.webhookId The webhook id. - * @param data.requestBody Update webhook request specification. - * @returns update_webhook_response Webhook successfully updated. - * @throws ApiError */ - public static updateWebHook( - data: UpdateWebHookData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "PATCH", + public static updateWebHook( + options: Options, + ) { + return (options.client ?? client).patch< + UpdateWebHookResponses, + UpdateWebHookErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/webhooks/{webhook_id}", - path: { - webhook_id: data.webhookId, - }, - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } /** * List Webhooks + * * List webhooks * *
* read:webhooks *
* - * @returns get_webhooks_response Webhook list successfully returned. - * @throws ApiError */ - public static getWebHooks(): CancelablePromise { - return __request(OpenAPI, { - method: "GET", + public static getWebHooks( + options?: Options, + ) { + return (options?.client ?? client).get< + GetWebHooksResponses, + GetWebHooksErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/webhooks", - errors: { - 400: "Invalid request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", - }, + ...options, }); } /** * Create a Webhook + * * Create a webhook * *
* create:webhooks *
* - * @param data The data for the request. - * @param data.requestBody Webhook request specification. - * @returns create_webhook_response Webhook successfully created. - * @throws ApiError */ - public static createWebHook( - data: CreateWebHookData, - ): CancelablePromise { - return __request(OpenAPI, { - method: "POST", + public static createWebHook( + options: Options, + ) { + return (options.client ?? client).post< + CreateWebHookResponses, + CreateWebHookErrors, + ThrowOnError + >({ + security: [{ scheme: "bearer", type: "http" }], url: "/api/v1/webhooks", - body: data.requestBody, - mediaType: "application/json", - errors: { - 400: "Invalid request.", - 403: "Invalid credentials.", - 429: "Request was throttled.", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, }, }); } diff --git a/lib/api/types.gen.ts b/lib/api/types.gen.ts index 4845f0b..80d2e86 100644 --- a/lib/api/types.gen.ts +++ b/lib/api/types.gen.ts @@ -1,76 +1,37 @@ // This file is auto-generated by @hey-api/openapi-ts -export type add_organization_users_response = { - /** - * Response code. - */ - code?: string; - /** - * Response message. - */ +export type ClientOptions = { + baseUrl: "https://{subdomain}.kinde.com" | (string & {}); +}; + +export type SuccessResponse = { message?: string; - users_added?: Array; + code?: string; }; -export type add_role_scope_response = { +export type Error = { /** - * Response code. + * Error code. */ code?: string; /** - * Response message. - */ - message?: string; -}; - -export type api_result = { - /** - * The result of the api operation. + * Error message. */ - result?: string; -}; - -export type applications = { - id?: string; - name?: string; - type?: string; -}; - -export type authorize_app_api_response = { message?: string; - code?: string; - applications_disconnected?: Array; - applications_connected?: Array; }; -export type category = { - id?: string; - name?: string; -}; - -export type connected_apps_access_token = { - /** - * The access token to access a third-party provider. - */ - access_token?: string; - /** - * The date and time that the access token expires. - */ - access_token_expiry?: string; +export type ErrorResponse = { + errors?: Array; }; -export type connected_apps_auth_url = { - /** - * A URL that is used to authenticate an end-user against a connected app. - */ - url?: string; - /** - * A unique identifier for the login session. - */ - session_id?: string; +export type NotFoundResponse = { + errors?: { + code?: string; + message?: string; + }; }; -export type connection = { +export type GetApisResponse = { /** * Response code. */ @@ -79,36 +40,35 @@ export type connection = { * Response message. */ message?: string; - connection?: { - id?: string; - name?: string; - display_name?: string; - strategy?: string; - }; -}; - -export type create_api_key_response = { - /** - * A Kinde generated message. - */ - message?: string; /** - * A Kinde generated status code. + * Pagination token. */ - code?: string; - api_key?: { + next_token?: string; + apis?: Array<{ /** - * The unique ID for the API key. + * The unique ID for the API. */ id?: string; /** - * The API key value (only shown once on creation). + * The API's name. */ - key?: string; - }; + name?: string; + /** + * A unique identifier for the API - commonly the URL. This value will be used as the `audience` parameter in authorization claims. + */ + audience?: string; + /** + * Whether or not it is the Kinde management API. + */ + is_management_api?: boolean; + scopes?: Array<{ + id?: string; + key?: string; + }>; + }>; }; -export type create_api_scopes_response = { +export type CreateApisResponse = { /** * A Kinde generated message. */ @@ -117,15 +77,15 @@ export type create_api_scopes_response = { * A Kinde generated status code. */ code?: string; - scope?: { + api?: { /** - * The unique ID for the API scope. + * The unique ID for the API. */ id?: string; }; }; -export type create_apis_response = { +export type CreateApiScopesResponse = { /** * A Kinde generated message. */ @@ -134,15 +94,15 @@ export type create_apis_response = { * A Kinde generated status code. */ code?: string; - api?: { + scope?: { /** - * The unique ID for the API. + * The unique ID for the API scope. */ id?: string; }; }; -export type create_application_response = { +export type GetEnvironmentVariablesResponse = { /** * Response code. */ @@ -151,45 +111,26 @@ export type create_application_response = { * Response message. */ message?: string; - application?: { - /** - * The application's identifier. - */ - id?: string; - /** - * The application's client ID. - */ - client_id?: string; - /** - * The application's client secret. - */ - client_secret?: string; - }; + /** + * Whether more records exist. + */ + has_more?: boolean; + environment_variables?: Array; }; -export type create_category_response = { - message?: string; +export type GetEnvironmentVariableResponse = { + /** + * Response code. + */ code?: string; - category?: { - /** - * The category's ID. - */ - id?: string; - }; -}; - -export type create_connection_response = { + /** + * Response message. + */ message?: string; - code?: string; - connection?: { - /** - * The connection's ID. - */ - id?: string; - }; + environment_variable?: EnvironmentVariable; }; -export type create_environment_variable_response = { +export type CreateEnvironmentVariableResponse = { /** * A Kinde generated message. */ @@ -206,61 +147,86 @@ export type create_environment_variable_response = { }; }; -export type create_identity_response = { +export type UpdateEnvironmentVariableResponse = { + /** + * A Kinde generated message. + */ message?: string; + /** + * A Kinde generated status code. + */ code?: string; - identity?: { - /** - * The identity's ID. - */ - id?: string; - }; }; -export type create_meter_usage_record_response = { +export type DeleteEnvironmentVariableResponse = { /** - * Response message. + * A Kinde generated message. */ message?: string; /** - * Response code. + * A Kinde generated status code. */ code?: string; }; -export type create_organization_response = { - /** - * Response message. - */ - message?: string; +export type GetBusinessResponse = { /** * Response code. */ code?: string; - organization?: { + /** + * Response message. + */ + message?: string; + business?: { /** - * The organization's unique code. + * The unique ID for the business. */ code?: string; /** - * The billing customer id if the organization was created with the is_create_billing_customer as true + * Your business's name. */ - billing_customer_id?: string; - }; -}; - -export type create_property_response = { - message?: string; - code?: string; - property?: { + name?: string; /** - * The property's ID. + * Phone number associated with business. */ - id?: string; + phone?: string | null; + /** + * Email address associated with business. + */ + email?: string | null; + /** + * The industry your business is in. + */ + industry?: string | null; + /** + * The timezone your business is in. + */ + timezone?: string | null; + /** + * Your Privacy policy URL. + */ + privacy_url?: string | null; + /** + * Your Terms and Conditions URL. + */ + terms_url?: string | null; + /** + * Whether your business uses clickwrap agreements. + */ + has_clickwrap?: boolean; + /** + * Whether your business shows Kinde branding. + */ + has_kinde_branding?: boolean; + /** + * Date of business creation in ISO 8601 format. + */ + created_on?: string; }; }; -export type create_roles_response = { +export type GetIndustriesResponse = { /** * Response code. */ @@ -269,36 +235,40 @@ export type create_roles_response = { * Response message. */ message?: string; - role?: { + industries?: Array<{ /** - * The role's ID. + * The unique key for the industry. */ - id?: string; - }; -}; - -export type create_subscriber_success_response = { - subscriber?: { + key?: string; /** - * A unique identifier for the subscriber. + * The display name for the industry. */ - subscriber_id?: string; - }; + name?: string; + }>; }; -export type create_user_response = { +export type GetTimezonesResponse = { /** - * Unique ID of the user in Kinde. + * Response code. */ - id?: string; + code?: string; /** - * True if the user was successfully created. + * Response message. */ - created?: boolean; - identities?: Array; + message?: string; + timezones?: Array<{ + /** + * The unique key for the timezone. + */ + key?: string; + /** + * The display name for the timezone. + */ + name?: string; + }>; }; -export type create_webhook_response = { +export type GetApiResponse = { /** * Response code. */ @@ -307,249 +277,10 @@ export type create_webhook_response = { * Response message. */ message?: string; - webhook?: { - id?: string; - endpoint?: string; - }; -}; - -export type delete_api_response = { - message?: string; - code?: string; -}; - -export type delete_environment_variable_response = { - /** - * A Kinde generated message. - */ - message?: string; - /** - * A Kinde generated status code. - */ - code?: string; -}; - -export type delete_role_scope_response = { - /** - * Response code. - */ - code?: string; - /** - * Response message. - */ - message?: string; -}; - -export type delete_webhook_response = { - /** - * Response code. - */ - code?: string; - /** - * Response message. - */ - message?: string; -}; - -export type environment_variable = { - /** - * The unique ID for the environment variable. - */ - id?: string; - /** - * The name of the environment variable. - */ - key?: string; - /** - * The value of the environment variable. - */ - value?: string | null; - /** - * Whether the environment variable is sensitive. - */ - is_secret?: boolean; - /** - * The date the environment variable was created. - */ - created_on?: string; -}; - -export type error = { - /** - * Error code. - */ - code?: string; - /** - * Error message. - */ - message?: string; -}; - -export type error_response = { - errors?: Array; -}; - -export type event_type = { - id?: string; - code?: string; - name?: string; - origin?: string; - schema?: { - [key: string]: unknown; - }; -}; - -export type get_api_key_response = { - /** - * Response code. - */ - code?: string; - /** - * Response message. - */ - message?: string; - api_key?: { - /** - * The unique ID for the API key. - */ - id?: string; - /** - * The API key's name. - */ - name?: string; - /** - * The type of API key. - */ - type?: string; - /** - * The status of the API key. - */ - status?: string; - /** - * The first 6 characters of the API key for identification. - */ - key_prefix?: string; - /** - * The last 4 characters of the API key for identification. - */ - key_suffix?: string | null; - /** - * When the API key was created. - */ - created_on?: string; - /** - * When the API key was last verified. - */ - last_verified_on?: string | null; - /** - * The IP address from which the API key was last verified. - */ - last_verified_ip?: string | null; - /** - * The name of the user who created the API key. - */ - created_by?: string | null; - /** - * Array of API IDs associated with this key. - */ - api_ids?: Array; - /** - * Array of scopes associated with this key. - */ - scopes?: Array; - /** - * Number of times this API key has been verified. - */ - verification_count?: number | null; - /** - * The organization code associated with this key. - */ - organization_id?: string | null; - /** - * The user ID associated with this key. - */ - user_id?: string | null; - }; -}; - -export type get_api_keys_response = { - /** - * Response code. - */ - code?: string; - /** - * Response message. - */ - message?: string; - /** - * Whether more records exist. - */ - has_more?: boolean; - api_keys?: Array<{ - /** - * The unique ID for the API key. - */ - id?: string; - /** - * The API key's name. - */ - name?: string; - /** - * The type of API key. - */ - type?: string; - /** - * The status of the API key. - */ - status?: string; - /** - * The first 6 characters of the API key for identification. - */ - key_prefix?: string; - /** - * The last 4 characters of the API key for identification. - */ - key_suffix?: string | null; - /** - * When the API key was created. - */ - created_on?: string; - /** - * When the API key was last verified. - */ - last_verified_on?: string | null; - /** - * The IP address from which the API key was last verified. - */ - last_verified_ip?: string | null; - /** - * The name of the user who created the API key. - */ - created_by?: string | null; - /** - * Array of API IDs associated with this key. - */ - api_ids?: Array; - /** - * Array of scopes associated with this key. - */ - scopes?: Array; - }>; -}; - -export type get_api_response = { - /** - * Response code. - */ - code?: string; - /** - * Response message. - */ - message?: string; - api?: { - /** - * Unique ID of the API. - */ + api?: { + /** + * Unique ID of the API. + */ id?: string; /** * The API's name. @@ -598,7 +329,7 @@ export type get_api_response = { }; }; -export type get_api_scope_response = { +export type GetApiScopesResponse = { /** * Response code. */ @@ -607,7 +338,7 @@ export type get_api_scope_response = { * Response message. */ message?: string; - scope?: { + scopes?: Array<{ /** * Unique ID of the API scope. */ @@ -620,10 +351,10 @@ export type get_api_scope_response = { * Explanation of the scope purpose. */ description?: string; - }; + }>; }; -export type get_api_scopes_response = { +export type GetApiScopeResponse = { /** * Response code. */ @@ -632,7 +363,7 @@ export type get_api_scopes_response = { * Response message. */ message?: string; - scopes?: Array<{ + scope?: { /** * Unique ID of the API scope. */ @@ -645,47 +376,127 @@ export type get_api_scopes_response = { * Explanation of the scope purpose. */ description?: string; - }>; + }; }; -export type get_apis_response = { - /** - * Response code. - */ +export type AuthorizeAppApiResponse = { + message?: string; + code?: string; + applications_disconnected?: Array; + applications_connected?: Array; +}; + +export type DeleteApiResponse = { + message?: string; code?: string; +}; + +export type User = { /** - * Response message. + * Unique ID of the user in Kinde. */ - message?: string; + id?: string; /** - * Pagination token. + * External ID for user. */ - next_token?: string; - apis?: Array<{ - /** - * The unique ID for the API. - */ - id?: string; - /** - * The API's name. - */ - name?: string; - /** - * A unique identifier for the API - commonly the URL. This value will be used as the `audience` parameter in authorization claims. - */ - audience?: string; - /** - * Whether or not it is the Kinde management API. - */ - is_management_api?: boolean; - scopes?: Array<{ - id?: string; - key?: string; - }>; + provided_id?: string; + /** + * Default email address of the user in Kinde. + */ + preferred_email?: string; + /** + * User's primary phone number. + */ + phone?: string; + /** + * Primary username of the user in Kinde. + */ + username?: string; + /** + * User's last name. + */ + last_name?: string; + /** + * User's first name. + */ + first_name?: string; + /** + * Whether the user is currently suspended or not. + */ + is_suspended?: boolean; + /** + * User's profile picture URL. + */ + picture?: string; + /** + * Total number of user sign ins. + */ + total_sign_ins?: number | null; + /** + * Number of consecutive failed user sign ins. + */ + failed_sign_ins?: number | null; + /** + * Last sign in date in ISO 8601 format. + */ + last_signed_in?: string | null; + /** + * Date of user creation in ISO 8601 format. + */ + created_on?: string | null; + /** + * Array of organizations a user belongs to. + */ + organizations?: Array; + /** + * Array of identities belonging to the user. + */ + identities?: Array<{ + type?: string; + identity?: string; }>; + billing?: { + customer_id?: string; + }; +}; + +export type UpdateUserResponse = { + /** + * Unique ID of the user in Kinde. + */ + id?: string; + /** + * User's first name. + */ + given_name?: string; + /** + * User's last name. + */ + family_name?: string; + /** + * User's preferred email. + */ + email?: string; + /** + * Whether the user is currently suspended or not. + */ + is_suspended?: boolean; + /** + * Whether a password reset has been requested. + */ + is_password_reset_requested?: boolean; + /** + * User's profile picture URL. + */ + picture?: string | null; }; -export type get_application_response = { +/** + * Array of users. + */ +export type Users = Array; + +export type UsersResponse = { /** * Response code. */ @@ -694,113 +505,97 @@ export type get_application_response = { * Response message. */ message?: string; - application?: { + users?: Array<{ /** - * The application's identifier. + * Unique ID of the user in Kinde. */ id?: string; /** - * The application's name. + * External ID for user. */ - name?: string; + provided_id?: string; /** - * The application's type. + * Default email address of the user in Kinde. */ - type?: "m2m" | "reg" | "spa"; + email?: string; /** - * The application's client ID. + * User's primary phone number. */ - client_id?: string; + phone?: string; /** - * The application's client secret. + * Primary username of the user in Kinde. */ - client_secret?: string; + username?: string; /** - * The default login route for resolving session issues. + * User's last name. */ - login_uri?: string; + last_name?: string; /** - * The homepage link to your application. + * User's first name. */ - homepage_uri?: string; + first_name?: string; /** - * Whether the application has a cancel button to allow users to exit the auth flow [Beta]. + * Whether the user is currently suspended or not. */ - has_cancel_button?: boolean; - }; -}; - -/** - * The application's type. - */ -export type type = "m2m" | "reg" | "spa"; - -export type get_applications_response = { - /** - * Response code. - */ - code?: string; - /** - * Response message. - */ - message?: string; - applications?: Array; - /** - * Pagination token. - */ - next_token?: string; -}; - -export type get_billing_agreements_response = { - /** - * Response code. - */ - code?: string; - /** - * Response message. - */ - message?: string; - /** - * Whether more records exist. - */ - has_more?: boolean; - /** - * A list of billing agreements - */ - agreements?: Array<{ + is_suspended?: boolean; /** - * The friendly id of an agreement + * User's profile picture URL. */ - id?: string; + picture?: string; /** - * The plan code the billing customer is subscribed to + * Total number of user sign ins. */ - plan_code?: string; + total_sign_ins?: number | null; /** - * The date the agreement expired (and was no longer active) + * Number of consecutive failed user sign ins. */ - expires_on?: string; + failed_sign_ins?: number | null; /** - * The friendly id of the billing group this agreement's plan is part of + * Last sign in date in ISO 8601 format. */ - billing_group_id?: string; + last_signed_in?: string | null; /** - * A list of billing entitlements that is part of this agreement + * Date of user creation in ISO 8601 format. */ - entitlements?: Array<{ + created_on?: string | null; + /** + * Array of organization sign-in information for the user. + */ + last_organization_sign_ins?: Array<{ /** - * The feature code of the feature corresponding to this entitlement + * The organization code. */ - feature_code?: string; + org_code?: string; /** - * The friendly id of an entitlement + * The date and time the user last signed in to this organization in ISO 8601 format. */ - entitlement_id?: string; + last_signed_in?: string; + }> | null; + /** + * Array of organizations a user belongs to. + */ + organizations?: Array; + /** + * Array of identities belonging to the user. + */ + identities?: Array<{ + type?: string; + identity?: string; }>; + billing?: { + /** + * The billing customer id. + */ + customer_id?: string; + }; }>; + /** + * Pagination token. + */ + next_token?: string; }; -export type get_billing_entitlements_response = { +export type SearchUsersResponse = { /** * Response code. */ @@ -809,60 +604,155 @@ export type get_billing_entitlements_response = { * Response message. */ message?: string; - /** - * Whether more records exist. - */ - has_more?: boolean; - /** - * A list of entitlements - */ - entitlements?: Array<{ + results?: Array<{ /** - * The friendly id of an entitlement + * Unique ID of the user in Kinde. */ id?: string; /** - * The price charged if this is an entitlement for a fixed charged + * External ID for user. */ - fixed_charge?: number; + provided_id?: string | null; /** - * The name of the price associated with the entitlement + * Default email address of the user in Kinde. */ - price_name?: string; + email?: string | null; /** - * The price charged for this entitlement in cents + * Primary username of the user in Kinde. */ - unit_amount?: number; + username?: string | null; /** - * The feature code of the feature corresponding to this entitlement + * User's last name. */ - feature_code?: string; + last_name?: string; /** - * The feature name of the feature corresponding to this entitlement + * User's first name. */ - feature_name?: string; + first_name?: string; /** - * The maximum number of units of the feature the customer is entitled to + * Whether the user is currently suspended or not. */ - entitlement_limit_max?: number; + is_suspended?: boolean; /** - * The minimum number of units of the feature the customer is entitled to + * User's profile picture URL. */ - entitlement_limit_min?: number; + picture?: string | null; + /** + * Total number of user sign ins. + */ + total_sign_ins?: number | null; + /** + * Number of consecutive failed user sign ins. + */ + failed_sign_ins?: number | null; + /** + * Last sign in date in ISO 8601 format. + */ + last_signed_in?: string | null; + /** + * Date of user creation in ISO 8601 format. + */ + created_on?: string | null; + /** + * Array of organizations a user belongs to. + */ + organizations?: Array; + /** + * Array of identities belonging to the user. + */ + identities?: Array<{ + type?: string; + identity?: string; + }>; + /** + * The user properties. + */ + properties?: { + [key: string]: string; + }; + /** + * Array of api scopes belonging to the user. + */ + api_scopes?: Array<{ + org_code?: string; + scope?: string; + api_id?: string; + }>; }>; +}; + +export type CreateUserResponse = { /** - * A list of plans. + * Unique ID of the user in Kinde. */ - plans?: Array<{ + id?: string; + /** + * True if the user was successfully created. + */ + created?: boolean; + identities?: Array; +}; + +export type CreateOrganizationResponse = { + /** + * Response message. + */ + message?: string; + /** + * Response code. + */ + code?: string; + organization?: { /** - * The plan code the billing customer is subscribed to + * The organization's unique code. */ code?: string; - subscribed_on?: string; - }>; + /** + * The billing customer id if the organization was created with the is_create_billing_customer as true + */ + billing_customer_id?: string; + }; +}; + +export type UserIdentity = { + /** + * The type of identity object created. + */ + type?: string; + /** + * The result of the user creation operation. + */ + result?: { + /** + * True if the user identity was successfully created. + */ + created?: boolean; + }; +}; + +export type CreatePropertyResponse = { + message?: string; + code?: string; + property?: { + /** + * The property's ID. + */ + id?: string; + }; +}; + +export type CreateIdentityResponse = { + message?: string; + code?: string; + identity?: { + /** + * The identity's ID. + */ + id?: string; + }; }; -export type get_business_response = { +export type GetIdentitiesResponse = { /** * Response code. */ @@ -871,55 +761,105 @@ export type get_business_response = { * Response message. */ message?: string; - business?: { + identities?: Array; + /** + * Whether more records exist. + */ + has_more?: boolean; +}; + +export type GetUserSessionsResponse = { + code?: string; + message?: string; + has_more?: boolean; + sessions?: Array<{ /** - * The unique ID for the business. + * The unique identifier of the user associated with the session. */ - code?: string; + user_id?: string; /** - * Your business's name. + * The organization code associated with the session, if applicable. */ - name?: string; + org_code?: string | null; /** - * Phone number associated with business. + * The client ID used to initiate the session. */ - phone?: string | null; + client_id?: string; /** - * Email address associated with business. + * The timestamp indicating when the session will expire. */ - email?: string | null; + expires_on?: string; /** - * The industry your business is in. + * The unique identifier of the session. */ - industry?: string | null; + session_id?: string; /** - * The timezone your business is in. + * The timestamp when the session was initiated. */ - timezone?: string | null; + started_on?: string; /** - * Your Privacy policy URL. + * The timestamp of the last update to the session. */ - privacy_url?: string | null; + updated_on?: string; /** - * Your Terms and Conditions URL. + * The identifier of the connection through which the session was established. */ - terms_url?: string | null; + connection_id?: string; /** - * Whether your business uses clickwrap agreements. + * The last known IP address of the user during this session. */ - has_clickwrap?: boolean; + last_ip_address?: string; /** - * Whether your business shows Kinde branding. + * The last known user agent (browser or app) used during this session. */ - has_kinde_branding?: boolean; + last_user_agent?: string; /** - * Date of business creation in ISO 8601 format. + * The IP address from which the session was initially started. + */ + initial_ip_address?: string; + /** + * The user agent (browser or app) used when the session was first created. + */ + initial_user_agent?: string; + }>; +}; + +export type GetUserMfaResponse = { + message?: string; + code?: string; + mfa?: { + /** + * The MFA's identifier. + */ + id?: string; + /** + * The type of MFA (e.g. email, SMS, authenticator app). + */ + type?: string; + /** + * The timestamp when the MFA was created. */ created_on?: string; + /** + * The identifier used for MFA (e.g. email address, phone number). + */ + name?: string; + /** + * Whether the MFA is verified or not. + */ + is_verified?: boolean; + /** + * The number of times MFA has been used. + */ + usage_count?: number; + /** + * The timestamp when the MFA was last used. + */ + last_used_on?: string; }; }; -export type get_categories_response = { +export type GetPropertiesResponse = { /** * Response code. */ @@ -928,14 +868,14 @@ export type get_categories_response = { * Response message. */ message?: string; - categories?: Array; + properties?: Array; /** * Whether more records exist. */ has_more?: boolean; }; -export type get_connections_response = { +export type GetPropertyValuesResponse = { /** * Response code. */ @@ -944,14 +884,25 @@ export type get_connections_response = { * Response message. */ message?: string; - connections?: Array; + properties?: Array; /** - * Whether more records exist. + * Pagination token. */ - has_more?: boolean; + next_token?: string; +}; + +export type CreateCategoryResponse = { + message?: string; + code?: string; + category?: { + /** + * The category's ID. + */ + id?: string; + }; }; -export type get_environment_feature_flags_response = { +export type GetCategoriesResponse = { /** * Response code. */ @@ -960,22 +911,14 @@ export type get_environment_feature_flags_response = { * Response message. */ message?: string; + categories?: Array; /** - * The environment's feature flag settings. - */ - feature_flags?: { - [key: string]: { - type?: "str" | "int" | "bool"; - value?: string; - }; - }; - /** - * Pagination token. + * Whether more records exist. */ - next_token?: string; + has_more?: boolean; }; -export type get_environment_response = { +export type GetEventResponse = { /** * Response code. */ @@ -984,17 +927,177 @@ export type get_environment_response = { * Response message. */ message?: string; - environment?: { - /** - * The unique identifier for the environment. - */ - code?: string; + event?: { + type?: string; + source?: string; + event_id?: string; /** - * The environment's name. + * Timestamp in ISO 8601 format. */ - name?: string; + timestamp?: number; /** - * Your HotJar site ID. + * Event specific data object. + */ + data?: { + [key: string]: unknown; + }; + }; +}; + +export type GetEventTypesResponse = { + /** + * Response code. + */ + code?: string; + /** + * Response message. + */ + message?: string; + event_types?: Array; +}; + +export type GetWebhooksResponse = { + /** + * Response code. + */ + code?: string; + /** + * Response message. + */ + message?: string; + webhooks?: Array; +}; + +export type Webhook = { + id?: string; + name?: string; + endpoint?: string; + description?: string; + event_types?: Array; + /** + * Created on date in ISO 8601 format. + */ + created_on?: string; +}; + +export type CreateWebhookResponse = { + /** + * Response code. + */ + code?: string; + /** + * Response message. + */ + message?: string; + webhook?: { + id?: string; + endpoint?: string; + }; +}; + +export type UpdateWebhookResponse = { + message?: string; + code?: string; + webhook?: { + id?: string; + }; +}; + +export type CreateConnectionResponse = { + message?: string; + code?: string; + connection?: { + /** + * The connection's ID. + */ + id?: string; + }; +}; + +export type GetConnectionsResponse = { + /** + * Response code. + */ + code?: string; + /** + * Response message. + */ + message?: string; + connections?: Array; + /** + * Whether more records exist. + */ + has_more?: boolean; +}; + +export type DeleteWebhookResponse = { + /** + * Response code. + */ + code?: string; + /** + * Response message. + */ + message?: string; +}; + +export type EventType = { + id?: string; + code?: string; + name?: string; + origin?: string; + schema?: { + [key: string]: unknown; + }; +}; + +export type OrganizationItemSchema = { + /** + * The unique identifier for the organization. + */ + code?: string; + /** + * The organization's name. + */ + name?: string; + /** + * A unique handle for the organization - can be used for dynamic callback urls. + */ + handle?: string | null; + /** + * Whether the organization is the default organization. + */ + is_default?: boolean; + /** + * The organization's external identifier - commonly used when migrating from or mapping to other systems. + */ + external_id?: string | null; + /** + * If users become members of this organization when the org code is supplied during authentication. + */ + is_auto_membership_enabled?: boolean; +}; + +export type GetEnvironmentResponse = { + /** + * Response code. + */ + code?: string; + /** + * Response message. + */ + message?: string; + environment?: { + /** + * The unique identifier for the environment. + */ + code?: string; + /** + * The environment's name. + */ + name?: string; + /** + * Your HotJar site ID. */ hotjar_site_id?: string | null; /** @@ -1100,182 +1203,49 @@ export type get_environment_response = { }; }; -/** - * Whether the environment is forced into light mode, dark mode or user preference - */ -export type theme_code = "light" | "dark" | "user_preference"; - -/** - * The color scheme for the environment used for meta tags based on the theme code - */ -export type color_scheme = "light" | "dark" | "light dark"; - -export type get_environment_variable_response = { - /** - * Response code. - */ - code?: string; - /** - * Response message. - */ - message?: string; - environment_variable?: environment_variable; -}; - -export type get_environment_variables_response = { - /** - * Response code. - */ - code?: string; - /** - * Response message. - */ - message?: string; - /** - * Whether more records exist. - */ - has_more?: boolean; - environment_variables?: Array; -}; - -export type get_event_response = { +export type GetOrganizationResponse = { /** - * Response code. + * The unique identifier for the organization. */ code?: string; /** - * Response message. - */ - message?: string; - event?: { - type?: string; - source?: string; - event_id?: string; - /** - * Timestamp in ISO 8601 format. - */ - timestamp?: number; - /** - * Event specific data object. - */ - data?: { - [key: string]: unknown; - }; - }; -}; - -export type get_event_types_response = { - /** - * Response code. + * The organization's name. */ - code?: string; + name?: string; /** - * Response message. + * A unique handle for the organization - can be used for dynamic callback urls. */ - message?: string; - event_types?: Array; -}; - -export type get_identities_response = { + handle?: string | null; /** - * Response code. + * Whether the organization is the default organization. */ - code?: string; + is_default?: boolean; /** - * Response message. + * The organization's external identifier - commonly used when migrating from or mapping to other systems. */ - message?: string; - identities?: Array; + external_id?: string | null; /** - * Whether more records exist. + * If users become members of this organization when the org code is supplied during authentication. */ - has_more?: boolean; -}; - -export type get_industries_response = { + is_auto_membership_enabled?: boolean; /** - * Response code. + * The organization's logo URL. */ - code?: string; + logo?: string | null; /** - * Response message. + * The organization's logo URL to be used for dark themes. */ - message?: string; - industries?: Array<{ - /** - * The unique key for the industry. - */ - key?: string; - /** - * The display name for the industry. - */ - name?: string; - }>; -}; - -export type get_organization_feature_flags_response = { + logo_dark?: string | null; /** - * Response code. + * The organization's SVG favicon URL. Optimal format for most browsers */ - code?: string; + favicon_svg?: string | null; /** - * Response message. + * The favicon URL to be used as a fallback in browsers that don't support SVG, add a PNG */ - message?: string; + favicon_fallback?: string | null; /** - * The environment's feature flag settings. - */ - feature_flags?: { - [key: string]: { - type?: "str" | "int" | "bool"; - value?: string; - }; - }; -}; - -export type get_organization_response = { - /** - * The unique identifier for the organization. - */ - code?: string; - /** - * The organization's name. - */ - name?: string; - /** - * A unique handle for the organization - can be used for dynamic callback urls. - */ - handle?: string | null; - /** - * Whether the organization is the default organization. - */ - is_default?: boolean; - /** - * The organization's external identifier - commonly used when migrating from or mapping to other systems. - */ - external_id?: string | null; - /** - * If users become members of this organization when the org code is supplied during authentication. - */ - is_auto_membership_enabled?: boolean; - /** - * The organization's logo URL. - */ - logo?: string | null; - /** - * The organization's logo URL to be used for dark themes. - */ - logo_dark?: string | null; - /** - * The organization's SVG favicon URL. Optimal format for most browsers - */ - favicon_svg?: string | null; - /** - * The favicon URL to be used as a fallback in browsers that don't support SVG, add a PNG - */ - favicon_fallback?: string | null; - /** - * Domains allowed for self-sign up to this environment. Empty array means no restrictions. + * Domains allowed for self-sign up to this environment. Empty array means no restrictions. */ allowed_domains?: Array; link_color?: { @@ -1344,6 +1314,7 @@ export type get_organization_response = { created_on?: string; /** * Deprecated - Use 'is_auto_membership_enabled' instead + * * @deprecated */ is_allow_registrations?: boolean | null; @@ -1384,39 +1355,55 @@ export type get_organization_response = { }; }; -export type get_organization_users_response = { +export type OrganizationUser = { /** - * Response code. + * The unique ID for the user. */ - code?: string; + id?: string | null; /** - * Response message. + * The user's email address. */ - message?: string; - organization_users?: Array; + email?: string | null; /** - * Pagination token. + * The user's full name. */ - next_token?: string; -}; - -export type get_organizations_response = { + full_name?: string; /** - * Response code. + * The user's last name. */ - code?: string; + last_name?: string | null; /** - * Response message. + * The user's first name. */ - message?: string; - organizations?: Array; + first_name?: string | null; /** - * Pagination token. + * The user's profile picture URL. */ - next_token?: string; + picture?: string | null; + /** + * The date the user joined the organization. + */ + joined_on?: string; + /** + * The date the user last accessed the organization. + */ + last_accessed_on?: string | null; + /** + * Whether the user is currently suspended or not. + */ + is_suspended?: boolean; + /** + * The roles the user has in the organization. + */ + roles?: Array; +}; + +export type Category = { + id?: string; + name?: string; }; -export type get_organizations_user_permissions_response = { +export type Connection = { /** * Response code. */ @@ -1425,42 +1412,140 @@ export type get_organizations_user_permissions_response = { * Response message. */ message?: string; - permissions?: Array; + connection?: { + id?: string; + name?: string; + display_name?: string; + strategy?: string; + }; }; -export type get_organizations_user_roles_response = { +export type EnvironmentVariable = { /** - * Response code. + * The unique ID for the environment variable. */ - code?: string; + id?: string; /** - * Response message. + * The name of the environment variable. */ - message?: string; - roles?: Array; + key?: string; /** - * Pagination token. + * The value of the environment variable. */ - next_token?: string; + value?: string | null; + /** + * Whether the environment variable is sensitive. + */ + is_secret?: boolean; + /** + * The date the environment variable was created. + */ + created_on?: string; }; -export type get_permissions_response = { +export type Identity = { /** - * Response code. + * The unique ID for the identity */ - code?: string; + id?: string; /** - * Response message. + * The type of identity */ - message?: string; - permissions?: Array; + type?: string; /** - * Pagination token. + * Whether the identity is confirmed */ - next_token?: string; + is_confirmed?: boolean; + /** + * Date of user creation in ISO 8601 format + */ + created_on?: string; + /** + * Date of last login in ISO 8601 format + */ + last_login_on?: string; + total_logins?: number; + /** + * The value of the identity + */ + name?: string; + /** + * The associated email of the identity + */ + email?: string; + /** + * Whether the identity is the primary identity for the user + */ + is_primary?: boolean | null; +}; + +export type Property = { + id?: string; + key?: string; + name?: string; + is_private?: boolean; + description?: string; + is_kinde_property?: boolean; +}; + +export type PropertyValue = { + id?: string; + name?: string; + description?: string | null; + key?: string; + value?: string | null; +}; + +export type Role = { + id?: string; + key?: string; + name?: string; + description?: string; +}; + +export type SubscribersSubscriber = { + id?: string; + email?: string; + full_name?: string; + first_name?: string; + last_name?: string; +}; + +export type Subscriber = { + id?: string; + preferred_email?: string; + first_name?: string; + last_name?: string; +}; + +export type OrganizationUserRole = { + id?: string; + key?: string; + name?: string; +}; + +export type OrganizationUserRolePermissions = { + id?: string; + role?: string; + permissions?: { + key?: string; + }; +}; + +export type OrganizationUserPermission = { + id?: string; + key?: string; + name?: string; + description?: string; + roles?: Array<{ + id?: string; + key?: string; + }>; }; -export type get_properties_response = { +export type OrganizationUsers = Array; + +export type GetSubscriberResponse = { /** * Response code. */ @@ -1469,14 +1554,10 @@ export type get_properties_response = { * Response message. */ message?: string; - properties?: Array; - /** - * Whether more records exist. - */ - has_more?: boolean; + subscribers?: Array; }; -export type get_property_values_response = { +export type GetSubscribersResponse = { /** * Response code. */ @@ -1485,21 +1566,30 @@ export type get_property_values_response = { * Response message. */ message?: string; - properties?: Array; + subscribers?: Array; /** * Pagination token. */ next_token?: string; }; -export type get_redirect_callback_urls_response = { +export type GetRolesResponse = { /** - * An application's redirect callback URLs. + * Response code. + */ + code?: string; + /** + * Response message. + */ + message?: string; + roles?: Array; + /** + * Pagination token. */ - redirect_urls?: Array; + next_token?: string; }; -export type get_role_response = { +export type GetRoleResponse = { /** * Response code. */ @@ -1532,7 +1622,7 @@ export type get_role_response = { }; }; -export type get_roles_response = { +export type CreateRolesResponse = { /** * Response code. */ @@ -1541,14 +1631,26 @@ export type get_roles_response = { * Response message. */ message?: string; - roles?: Array; + role?: { + /** + * The role's ID. + */ + id?: string; + }; +}; + +export type AddRoleScopeResponse = { /** - * Pagination token. + * Response code. */ - next_token?: string; + code?: string; + /** + * Response message. + */ + message?: string; }; -export type get_subscriber_response = { +export type DeleteRoleScopeResponse = { /** * Response code. */ @@ -1557,10 +1659,9 @@ export type get_subscriber_response = { * Response message. */ message?: string; - subscribers?: Array; }; -export type get_subscribers_response = { +export type GetOrganizationsResponse = { /** * Response code. */ @@ -1569,14 +1670,14 @@ export type get_subscribers_response = { * Response message. */ message?: string; - subscribers?: Array; + organizations?: Array; /** * Pagination token. */ next_token?: string; }; -export type get_timezones_response = { +export type GetOrganizationUsersResponse = { /** * Response code. */ @@ -1585,110 +1686,227 @@ export type get_timezones_response = { * Response message. */ message?: string; - timezones?: Array<{ - /** - * The unique key for the timezone. - */ - key?: string; - /** - * The display name for the timezone. - */ - name?: string; - }>; + organization_users?: Array; + /** + * Pagination token. + */ + next_token?: string; }; -export type get_user_mfa_response = { +export type GetOrganizationsUserRolesResponse = { + /** + * Response code. + */ + code?: string; + /** + * Response message. + */ message?: string; + roles?: Array; + /** + * Pagination token. + */ + next_token?: string; +}; + +export type GetOrganizationsUserPermissionsResponse = { + /** + * Response code. + */ code?: string; - mfa?: { - /** - * The MFA's identifier. - */ - id?: string; - /** - * The type of MFA (e.g. email, SMS, authenticator app). - */ - type?: string; - /** - * The timestamp when the MFA was created. - */ - created_on?: string; - /** - * The identifier used for MFA (e.g. email address, phone number). - */ - name?: string; - /** - * Whether the MFA is verified or not. - */ - is_verified?: boolean; - /** - * The number of times MFA has been used. - */ - usage_count?: number; - /** - * The timestamp when the MFA was last used. - */ - last_used_on?: string; + /** + * Response message. + */ + message?: string; + permissions?: Array; +}; + +export type GetOrganizationFeatureFlagsResponse = { + /** + * Response code. + */ + code?: string; + /** + * Response message. + */ + message?: string; + /** + * The environment's feature flag settings. + */ + feature_flags?: { + [key: string]: { + type?: "str" | "int" | "bool"; + value?: string; + }; }; }; -export type get_user_sessions_response = { +export type GetEnvironmentFeatureFlagsResponse = { + /** + * Response code. + */ code?: string; + /** + * Response message. + */ message?: string; - has_more?: boolean; - sessions?: Array<{ + /** + * The environment's feature flag settings. + */ + feature_flags?: { + [key: string]: { + type?: "str" | "int" | "bool"; + value?: string; + }; + }; + /** + * Pagination token. + */ + next_token?: string; +}; + +export type AddOrganizationUsersResponse = { + /** + * Response code. + */ + code?: string; + /** + * Response message. + */ + message?: string; + users_added?: Array; +}; + +export type UpdateRolePermissionsResponse = { + code?: string; + message?: string; + permissions_added?: Array; + permissions_removed?: Array; +}; + +export type UpdateOrganizationUsersResponse = { + message?: string; + code?: string; + users_added?: Array; + users_updated?: Array; + users_removed?: Array; +}; + +export type ConnectedAppsAuthUrl = { + /** + * A URL that is used to authenticate an end-user against a connected app. + */ + url?: string; + /** + * A unique identifier for the login session. + */ + session_id?: string; +}; + +export type CreateSubscriberSuccessResponse = { + subscriber?: { /** - * The unique identifier of the user associated with the session. + * A unique identifier for the subscriber. */ - user_id?: string; + subscriber_id?: string; + }; +}; + +export type ConnectedAppsAccessToken = { + /** + * The access token to access a third-party provider. + */ + access_token?: string; + /** + * The date and time that the access token expires. + */ + access_token_expiry?: string; +}; + +export type ApiResult = { + /** + * The result of the api operation. + */ + result?: string; +}; + +export type CreateApplicationResponse = { + /** + * Response code. + */ + code?: string; + /** + * Response message. + */ + message?: string; + application?: { /** - * The organization code associated with the session, if applicable. + * The application's identifier. */ - org_code?: string | null; + id?: string; /** - * The client ID used to initiate the session. + * The application's client ID. */ client_id?: string; /** - * The timestamp indicating when the session will expire. + * The application's client secret. */ - expires_on?: string; + client_secret?: string; + }; +}; + +export type GetApplicationResponse = { + /** + * Response code. + */ + code?: string; + /** + * Response message. + */ + message?: string; + application?: { /** - * The unique identifier of the session. + * The application's identifier. */ - session_id?: string; + id?: string; /** - * The timestamp when the session was initiated. + * The application's name. */ - started_on?: string; + name?: string; /** - * The timestamp of the last update to the session. + * The application's type. */ - updated_on?: string; + type?: "m2m" | "reg" | "spa"; /** - * The identifier of the connection through which the session was established. + * The application's client ID. */ - connection_id?: string; + client_id?: string; /** - * The last known IP address of the user during this session. + * The application's client secret. */ - last_ip_address?: string; + client_secret?: string; /** - * The last known user agent (browser or app) used during this session. + * The default login route for resolving session issues. */ - last_user_agent?: string; + login_uri?: string; /** - * The IP address from which the session was initially started. + * The homepage link to your application. */ - initial_ip_address?: string; + homepage_uri?: string; /** - * The user agent (browser or app) used when the session was first created. + * Whether the application has a cancel button to allow users to exit the auth flow [Beta]. */ - initial_user_agent?: string; - }>; + has_cancel_button?: boolean; + }; +}; + +export type Applications = { + id?: string; + name?: string; + type?: string; }; -export type get_webhooks_response = { +export type GetApplicationsResponse = { /** * Response code. */ @@ -1697,46 +1915,28 @@ export type get_webhooks_response = { * Response message. */ message?: string; - webhooks?: Array; -}; - -export type identity = { - /** - * The unique ID for the identity - */ - id?: string; + applications?: Array; /** - * The type of identity - */ - type?: string; - /** - * Whether the identity is confirmed - */ - is_confirmed?: boolean; - /** - * Date of user creation in ISO 8601 format - */ - created_on?: string; - /** - * Date of last login in ISO 8601 format - */ - last_login_on?: string; - total_logins?: number; - /** - * The value of the identity + * Pagination token. */ - name?: string; + next_token?: string; +}; + +export type RedirectCallbackUrls = { /** - * The associated email of the identity + * An application's redirect URLs. */ - email?: string; + redirect_urls?: Array; +}; + +export type GetRedirectCallbackUrlsResponse = { /** - * Whether the identity is the primary identity for the user + * An application's redirect callback URLs. */ - is_primary?: boolean | null; + redirect_urls?: Array; }; -export type logout_redirect_urls = { +export type LogoutRedirectUrls = { /** * An application's logout URLs. */ @@ -1751,167 +1951,112 @@ export type logout_redirect_urls = { message?: string; }; -export type not_found_response = { - errors?: { - code?: string; - message?: string; - }; -}; - -export type organization_item_schema = { +export type GetPermissionsResponse = { /** - * The unique identifier for the organization. + * Response code. */ code?: string; /** - * The organization's name. + * Response message. */ - name?: string; + message?: string; + permissions?: Array; /** - * A unique handle for the organization - can be used for dynamic callback urls. + * Pagination token. */ - handle?: string | null; + next_token?: string; +}; + +export type Permissions = { /** - * Whether the organization is the default organization. + * The permission's ID. */ - is_default?: boolean; + id?: string; /** - * The organization's external identifier - commonly used when migrating from or mapping to other systems. + * The permission identifier to use in code. */ - external_id?: string | null; + key?: string; /** - * If users become members of this organization when the org code is supplied during authentication. + * The permission's name. */ - is_auto_membership_enabled?: boolean; -}; - -export type organization_user = { + name?: string; /** - * The unique ID for the user. + * The permission's description. */ - id?: string | null; + description?: string; +}; + +export type Scopes = { /** - * The user's email address. + * Scope ID. */ - email?: string | null; + id?: string; /** - * The user's full name. + * Scope key. */ - full_name?: string; + key?: string; /** - * The user's last name. + * Description of scope. */ - last_name?: string | null; + description?: string; /** - * The user's first name. + * API ID. */ - first_name?: string | null; + api_id?: string; +}; + +export type Roles = { /** - * The user's profile picture URL. + * The role's ID. */ - picture?: string | null; + id?: string; /** - * The date the user joined the organization. + * The role identifier to use in code. */ - joined_on?: string; + key?: string; /** - * The date the user last accessed the organization. + * The role's name. */ - last_accessed_on?: string | null; + name?: string; /** - * Whether the user is currently suspended or not. + * The role's description. */ - is_suspended?: boolean; + description?: string | null; /** - * The roles the user has in the organization. + * Whether the role is the default role. */ - roles?: Array; -}; - -export type organization_user_permission = { - id?: string; - key?: string; - name?: string; - description?: string; - roles?: Array<{ - id?: string; - key?: string; - }>; -}; - -export type organization_user_role = { - id?: string; - key?: string; - name?: string; -}; - -export type organization_user_role_permissions = { - id?: string; - role?: string; - permissions?: { - key?: string; - }; + is_default_role?: boolean; }; -export type organization_users = Array; - -/** - * The API's ID. - */ -export type Parameterapi_id = string; - -/** - * The application's ID / client ID. - */ -export type Parameterapplication_id = string; - -/** - * The property's key. - */ -export type Parameterproperty_key = string; - -/** - * The environment variable's ID. - */ -export type Parametervariable_id = string; - -export type permissions = { - /** - * The permission's ID. - */ - id?: string; +export type RolePermissionsResponse = { /** - * The permission identifier to use in code. + * Response code. */ - key?: string; + code?: string; /** - * The permission's name. + * Response message. */ - name?: string; + message?: string; + permissions?: Array; /** - * The permission's description. + * Pagination token. */ - description?: string; -}; - -export type property = { - id?: string; - key?: string; - name?: string; - is_private?: boolean; - description?: string; - is_kinde_property?: boolean; + next_token?: string; }; -export type property_value = { - id?: string; - name?: string; - description?: string | null; - key?: string; - value?: string | null; +export type RoleScopesResponse = { + /** + * Response code. + */ + code?: string; + /** + * Response message. + */ + message?: string; + scopes?: Array; }; -export type read_env_logo_response = { +export type ReadLogoResponse = { /** * Response code. */ @@ -1928,6 +2073,10 @@ export type read_env_logo_response = { * The name of the logo file. */ file_name?: string; + /** + * The relative path to the logo file. + */ + path?: string; }>; /** * Response message. @@ -1935,7 +2084,7 @@ export type read_env_logo_response = { message?: string; }; -export type read_logo_response = { +export type ReadEnvLogoResponse = { /** * Response code. */ @@ -1952,10 +2101,6 @@ export type read_logo_response = { * The name of the logo file. */ file_name?: string; - /** - * The relative path to the logo file. - */ - path?: string; }>; /** * Response message. @@ -1963,37 +2108,7 @@ export type read_logo_response = { message?: string; }; -export type redirect_callback_urls = { - /** - * An application's redirect URLs. - */ - redirect_urls?: Array; -}; - -export type role = { - id?: string; - key?: string; - name?: string; - description?: string; -}; - -export type role_permissions_response = { - /** - * Response code. - */ - code?: string; - /** - * Response message. - */ - message?: string; - permissions?: Array; - /** - * Pagination token. - */ - next_token?: string; -}; - -export type role_scopes_response = { +export type GetBillingEntitlementsResponse = { /** * Response code. */ @@ -2002,33 +2117,60 @@ export type role_scopes_response = { * Response message. */ message?: string; - scopes?: Array; -}; - -export type roles = { - /** - * The role's ID. - */ - id?: string; /** - * The role identifier to use in code. - */ - key?: string; - /** - * The role's name. + * Whether more records exist. */ - name?: string; + has_more?: boolean; /** - * The role's description. + * A list of entitlements */ - description?: string | null; + entitlements?: Array<{ + /** + * The friendly id of an entitlement + */ + id?: string; + /** + * The price charged if this is an entitlement for a fixed charged + */ + fixed_charge?: number; + /** + * The name of the price associated with the entitlement + */ + price_name?: string; + /** + * The price charged for this entitlement in cents + */ + unit_amount?: number; + /** + * The feature code of the feature corresponding to this entitlement + */ + feature_code?: string; + /** + * The feature name of the feature corresponding to this entitlement + */ + feature_name?: string; + /** + * The maximum number of units of the feature the customer is entitled to + */ + entitlement_limit_max?: number; + /** + * The minimum number of units of the feature the customer is entitled to + */ + entitlement_limit_min?: number; + }>; /** - * Whether the role is the default role. + * A list of plans. */ - is_default_role?: boolean; + plans?: Array<{ + /** + * The plan code the billing customer is subscribed to + */ + code?: string; + subscribed_on?: string; + }>; }; -export type rotate_api_key_response = { +export type GetBillingAgreementsResponse = { /** * Response code. */ @@ -2037,38 +2179,58 @@ export type rotate_api_key_response = { * Response message. */ message?: string; - api_key?: { + /** + * Whether more records exist. + */ + has_more?: boolean; + /** + * A list of billing agreements + */ + agreements?: Array<{ /** - * The unique ID for the API key. + * The friendly id of an agreement */ id?: string; /** - * The new API key value (only shown once). + * The plan code the billing customer is subscribed to */ - key?: string; - }; + plan_code?: string; + /** + * The date the agreement expired (and was no longer active) + */ + expires_on?: string; + /** + * The friendly id of the billing group this agreement's plan is part of + */ + billing_group_id?: string; + /** + * A list of billing entitlements that is part of this agreement + */ + entitlements?: Array<{ + /** + * The feature code of the feature corresponding to this entitlement + */ + feature_code?: string; + /** + * The friendly id of an entitlement + */ + entitlement_id?: string; + }>; + }>; }; -export type scopes = { - /** - * Scope ID. - */ - id?: string; - /** - * Scope key. - */ - key?: string; +export type CreateMeterUsageRecordResponse = { /** - * Description of scope. + * Response message. */ - description?: string; + message?: string; /** - * API ID. + * Response code. */ - api_id?: string; + code?: string; }; -export type search_users_response = { +export type GetApiKeysResponse = { /** * Response code. */ @@ -2077,446 +2239,304 @@ export type search_users_response = { * Response message. */ message?: string; - results?: Array<{ + /** + * Whether more records exist. + */ + has_more?: boolean; + api_keys?: Array<{ /** - * Unique ID of the user in Kinde. + * The unique ID for the API key. */ id?: string; /** - * External ID for user. - */ - provided_id?: string | null; - /** - * Default email address of the user in Kinde. - */ - email?: string | null; - /** - * Primary username of the user in Kinde. - */ - username?: string | null; - /** - * User's last name. - */ - last_name?: string; - /** - * User's first name. + * The API key's name. */ - first_name?: string; + name?: string; /** - * Whether the user is currently suspended or not. + * The type of API key. */ - is_suspended?: boolean; + type?: string; /** - * User's profile picture URL. + * The status of the API key. */ - picture?: string | null; + status?: string; /** - * Total number of user sign ins. + * The first 6 characters of the API key for identification. */ - total_sign_ins?: number | null; + key_prefix?: string; /** - * Number of consecutive failed user sign ins. + * The last 4 characters of the API key for identification. */ - failed_sign_ins?: number | null; + key_suffix?: string | null; /** - * Last sign in date in ISO 8601 format. + * When the API key was created. */ - last_signed_in?: string | null; + created_on?: string; /** - * Date of user creation in ISO 8601 format. + * When the API key was last verified. */ - created_on?: string | null; + last_verified_on?: string | null; /** - * Array of organizations a user belongs to. + * The IP address from which the API key was last verified. */ - organizations?: Array; + last_verified_ip?: string | null; /** - * Array of identities belonging to the user. + * The name of the user who created the API key. */ - identities?: Array<{ - type?: string; - identity?: string; - }>; + created_by?: string | null; /** - * The user properties. + * Array of API IDs associated with this key. */ - properties?: { - [key: string]: string; - }; + api_ids?: Array; /** - * Array of api scopes belonging to the user. + * Array of scopes associated with this key. */ - api_scopes?: Array<{ - org_code?: string; - scope?: string; - api_id?: string; - }>; + scopes?: Array; }>; }; -export type subscriber = { - id?: string; - preferred_email?: string; - first_name?: string; - last_name?: string; -}; - -export type subscribers_subscriber = { - id?: string; - email?: string; - full_name?: string; - first_name?: string; - last_name?: string; -}; - -export type success_response = { - message?: string; - code?: string; -}; - -export type update_environment_variable_response = { +export type RotateApiKeyResponse = { /** - * A Kinde generated message. + * Response code. */ - message?: string; + code?: string; /** - * A Kinde generated status code. + * Response message. */ - code?: string; -}; - -export type update_organization_users_response = { - message?: string; - code?: string; - users_added?: Array; - users_updated?: Array; - users_removed?: Array; -}; - -export type update_role_permissions_response = { - code?: string; message?: string; - permissions_added?: Array; - permissions_removed?: Array; + api_key?: { + /** + * The unique ID for the API key. + */ + id?: string; + /** + * The new API key value (only shown once). + */ + key?: string; + }; }; -export type update_user_response = { - /** - * Unique ID of the user in Kinde. - */ - id?: string; - /** - * User's first name. - */ - given_name?: string; +export type CreateApiKeyResponse = { /** - * User's last name. - */ - family_name?: string; - /** - * User's preferred email. - */ - email?: string; - /** - * Whether the user is currently suspended or not. - */ - is_suspended?: boolean; - /** - * Whether a password reset has been requested. + * A Kinde generated message. */ - is_password_reset_requested?: boolean; + message?: string; /** - * User's profile picture URL. + * A Kinde generated status code. */ - picture?: string | null; -}; - -export type update_webhook_response = { - message?: string; code?: string; - webhook?: { + api_key?: { + /** + * The unique ID for the API key. + */ id?: string; + /** + * The API key value (only shown once on creation). + */ + key?: string; }; }; -export type user = { +export type VerifyApiKeyResponse = { /** - * Unique ID of the user in Kinde. + * Response code. */ - id?: string; + code?: string; /** - * External ID for user. + * Response message. */ - provided_id?: string; + message?: string; /** - * Default email address of the user in Kinde. + * Whether the API key is valid. */ - preferred_email?: string; + is_valid?: boolean; /** - * User's primary phone number. + * The unique ID for the API key. */ - phone?: string; + key_id?: string; /** - * Primary username of the user in Kinde. + * The status of the API key. */ - username?: string; + status?: string; /** - * User's last name. + * Array of scopes associated with this key. */ - last_name?: string; + scopes?: Array; /** - * User's first name. + * The organization code associated with this key. */ - first_name?: string; + org_code?: string | null; /** - * Whether the user is currently suspended or not. + * The user ID associated with this key. */ - is_suspended?: boolean; + user_id?: string | null; /** - * User's profile picture URL. + * When the API key was last verified. */ - picture?: string; + last_verified_on?: string | null; /** - * Total number of user sign ins. + * Number of times this API key has been verified. */ - total_sign_ins?: number | null; + verification_count?: number; +}; + +export type GetApiKeyResponse = { /** - * Number of consecutive failed user sign ins. + * Response code. */ - failed_sign_ins?: number | null; + code?: string; /** - * Last sign in date in ISO 8601 format. + * Response message. */ - last_signed_in?: string | null; - /** - * Date of user creation in ISO 8601 format. - */ - created_on?: string | null; - /** - * Array of organizations a user belongs to. - */ - organizations?: Array; - /** - * Array of identities belonging to the user. - */ - identities?: Array<{ + message?: string; + api_key?: { + /** + * The unique ID for the API key. + */ + id?: string; + /** + * The API key's name. + */ + name?: string; + /** + * The type of API key. + */ type?: string; - identity?: string; - }>; - billing?: { - customer_id?: string; - }; -}; - -export type user_identity = { - /** - * The type of identity object created. - */ - type?: string; - /** - * The result of the user creation operation. - */ - result?: { /** - * True if the user identity was successfully created. + * The status of the API key. */ - created?: boolean; - }; -}; - -/** - * Array of users. - */ -export type users = Array; - -export type users_response = { - /** - * Response code. - */ - code?: string; - /** - * Response message. - */ - message?: string; - users?: Array<{ + status?: string; /** - * Unique ID of the user in Kinde. + * The first 6 characters of the API key for identification. */ - id?: string; + key_prefix?: string; /** - * External ID for user. + * The last 4 characters of the API key for identification. */ - provided_id?: string; + key_suffix?: string | null; /** - * Default email address of the user in Kinde. + * When the API key was created. */ - email?: string; + created_on?: string; /** - * User's primary phone number. + * When the API key was last verified. */ - phone?: string; + last_verified_on?: string | null; /** - * Primary username of the user in Kinde. + * The IP address from which the API key was last verified. */ - username?: string; + last_verified_ip?: string | null; /** - * User's last name. + * The name of the user who created the API key. */ - last_name?: string; + created_by?: string | null; /** - * User's first name. + * Array of API IDs associated with this key. */ - first_name?: string; + api_ids?: Array; /** - * Whether the user is currently suspended or not. + * Array of scopes associated with this key. */ - is_suspended?: boolean; + scopes?: Array; /** - * User's profile picture URL. + * Number of times this API key has been verified. */ - picture?: string; + verification_count?: number | null; /** - * Total number of user sign ins. + * The organization code associated with this key. */ - total_sign_ins?: number | null; + organization_id?: string | null; /** - * Number of consecutive failed user sign ins. + * The user ID associated with this key. */ - failed_sign_ins?: number | null; + user_id?: string | null; + }; +}; + +/** + * The API's ID. + */ +export type ApiId = string; + +/** + * The application's ID / client ID. + */ +export type ApplicationId = string; + +/** + * The property's key. + */ +export type PropertyKey = string; + +/** + * The environment variable's ID. + */ +export type VariableId = string; + +export type GetApiKeysData = { + body?: never; + path?: never; + query?: { /** - * Last sign in date in ISO 8601 format. + * Number of results per page. Defaults to 50 if parameter not sent. */ - last_signed_in?: string | null; + page_size?: number | null; /** - * Date of user creation in ISO 8601 format. + * The ID of the API key to start after. */ - created_on?: string | null; + starting_after?: string | null; /** - * Array of organization sign-in information for the user. + * Filter by API key type (organization or user). */ - last_organization_sign_ins?: Array<{ - /** - * The organization code. - */ - org_code?: string; - /** - * The date and time the user last signed in to this organization in ISO 8601 format. - */ - last_signed_in?: string; - }> | null; + key_type?: "organization" | "user"; /** - * Array of organizations a user belongs to. + * Filter by API key status (active, inactive, revoked). */ - organizations?: Array; + status?: "active" | "inactive" | "revoked"; /** - * Array of identities belonging to the user. + * Filter by user ID to get API keys associated with a specific user. */ - identities?: Array<{ - type?: string; - identity?: string; - }>; - billing?: { - /** - * The billing customer id. - */ - customer_id?: string; - }; - }>; - /** - * Pagination token. - */ - next_token?: string; + user_id?: string | null; + /** + * Filter by organization code to get API keys associated with a specific organization. + */ + org_code?: string | null; + }; + url: "/api/v1/api_keys"; }; -export type verify_api_key_response = { - /** - * Response code. - */ - code?: string; - /** - * Response message. - */ - message?: string; - /** - * Whether the API key is valid. - */ - is_valid?: boolean; - /** - * The unique ID for the API key. - */ - key_id?: string; - /** - * The status of the API key. - */ - status?: string; - /** - * Array of scopes associated with this key. - */ - scopes?: Array; - /** - * The organization code associated with this key. - */ - org_code?: string | null; +export type GetApiKeysErrors = { /** - * The user ID associated with this key. + * Invalid request. */ - user_id?: string | null; + 400: ErrorResponse; /** - * When the API key was last verified. + * Unauthorized - invalid credentials. */ - last_verified_on?: string | null; + 403: ErrorResponse; /** - * Number of times this API key has been verified. + * Too many requests. Request was throttled. */ - verification_count?: number; + 429: ErrorResponse; }; -export type webhook = { - id?: string; - name?: string; - endpoint?: string; - description?: string; - event_types?: Array; - /** - * Created on date in ISO 8601 format. - */ - created_on?: string; -}; +export type GetApiKeysError = GetApiKeysErrors[keyof GetApiKeysErrors]; -export type GetApiKeysData = { - /** - * Filter by API key type (organization or user). - */ - keyType?: ("organization" | "user") | null; - /** - * Filter by organization code to get API keys associated with a specific organization. - */ - orgCode?: string | null; - /** - * Number of results per page. Defaults to 50 if parameter not sent. - */ - pageSize?: number | null; - /** - * The ID of the API key to start after. - */ - startingAfter?: string | null; - /** - * Filter by API key status (active, inactive, revoked). - */ - status?: ("active" | "inactive" | "revoked") | null; +export type GetApiKeysResponses = { /** - * Filter by user ID to get API keys associated with a specific user. + * API keys successfully retrieved. */ - userId?: string | null; + 200: GetApiKeysResponse; }; -export type GetApiKeysResponse = get_api_keys_response; +export type GetApiKeysResponse2 = + GetApiKeysResponses[keyof GetApiKeysResponses]; export type CreateApiKeyData = { /** * API key details. */ - requestBody: { + body: { /** * The name of the API key. */ @@ -2542,989 +2562,2736 @@ export type CreateApiKeyData = { */ org_code?: string | null; }; + path?: never; + query?: never; + url: "/api/v1/api_keys"; }; -export type CreateApiKeyResponse = create_api_key_response; - -export type GetApiKeyData = { +export type CreateApiKeyErrors = { /** - * The ID of the API key. + * Invalid request. */ - keyId: string; -}; - -export type GetApiKeyResponse = get_api_key_response; - -export type DeleteApiKeyData = { + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; /** - * The ID of the API key. + * Too many requests. Request was throttled. */ - keyId: string; + 429: ErrorResponse; }; -export type DeleteApiKeyResponse = success_response; +export type CreateApiKeyError = CreateApiKeyErrors[keyof CreateApiKeyErrors]; -export type RotateApiKeyData = { +export type CreateApiKeyResponses = { /** - * The ID of the API key to rotate. + * API key successfully created. */ - keyId: string; + 201: CreateApiKeyResponse; }; -export type RotateApiKeyResponse = rotate_api_key_response; +export type CreateApiKeyResponse2 = + CreateApiKeyResponses[keyof CreateApiKeyResponses]; -export type VerifyApiKeyData = { - /** - * API key verification details. - */ - requestBody: { +export type DeleteApiKeyData = { + body?: never; + path: { /** - * The API key to verify. + * The ID of the API key. */ - api_key: string; + key_id: string; }; + query?: never; + url: "/api/v1/api_keys/{key_id}"; +}; + +export type DeleteApiKeyErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * The specified resource was not found + */ + 404: NotFoundResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; }; -export type VerifyApiKeyResponse = verify_api_key_response; +export type DeleteApiKeyError = DeleteApiKeyErrors[keyof DeleteApiKeyErrors]; -export type GetApisData = { +export type DeleteApiKeyResponses = { /** - * Additional data to include in the response. Allowed value: "scopes". + * API key successfully deleted. */ - expand?: "scopes" | null; + 200: SuccessResponse; }; -export type GetApisResponse = get_apis_response; +export type DeleteApiKeyResponse = + DeleteApiKeyResponses[keyof DeleteApiKeyResponses]; -export type AddApisData = { - requestBody: { - /** - * The name of the API. (1-64 characters). - */ - name: string; +export type GetApiKeyData = { + body?: never; + path: { /** - * A unique identifier for the API - commonly the URL. This value will be used as the `audience` parameter in authorization claims. (1-64 characters) + * The ID of the API key. */ - audience: string; + key_id: string; }; + query?: never; + url: "/api/v1/api_keys/{key_id}"; }; -export type AddApisResponse = create_apis_response; - -export type GetApiData = { +export type GetApiKeyErrors = { /** - * The API's ID. + * Invalid request. */ - apiId: string; -}; - -export type GetApiResponse = get_api_response; - -export type DeleteApiData = { + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; /** - * The API's ID. + * The specified resource was not found */ - apiId: string; + 404: NotFoundResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; }; -export type DeleteApiResponse = delete_api_response; +export type GetApiKeyError = GetApiKeyErrors[keyof GetApiKeyErrors]; -export type GetApiScopesData = { +export type GetApiKeyResponses = { /** - * API ID + * API key successfully retrieved. */ - apiId: string; + 200: GetApiKeyResponse; }; -export type GetApiScopesResponse = get_api_scopes_response; +export type GetApiKeyResponse2 = GetApiKeyResponses[keyof GetApiKeyResponses]; -export type AddApiScopeData = { - /** - * API ID - */ - apiId: string; - requestBody: { - /** - * The key reference for the scope (1-64 characters, no white space). - */ - key: string; +export type RotateApiKeyData = { + body?: never; + path: { /** - * Description of the api scope purpose. + * The ID of the API key to rotate. */ - description?: string; + key_id: string; }; + query?: never; + url: "/api/v1/api_keys/{key_id}"; }; -export type AddApiScopeResponse = create_api_scopes_response; - -export type GetApiScopeData = { +export type RotateApiKeyErrors = { /** - * API ID + * Invalid request. */ - apiId: string; + 400: ErrorResponse; /** - * Scope ID + * Unauthorized - invalid credentials. */ - scopeId: string; -}; - -export type GetApiScopeResponse = get_api_scope_response; - -export type UpdateApiScopeData = { + 403: ErrorResponse; /** - * API ID + * The specified resource was not found */ - apiId: string; - requestBody: { - /** - * Description of the api scope purpose. - */ - description?: string; - }; + 404: NotFoundResponse; /** - * Scope ID + * Too many requests. Request was throttled. */ - scopeId: string; + 429: ErrorResponse; }; -export type UpdateApiScopeResponse = unknown; +export type RotateApiKeyError = RotateApiKeyErrors[keyof RotateApiKeyErrors]; -export type DeleteApiScopeData = { - /** - * API ID - */ - apiId: string; +export type RotateApiKeyResponses = { /** - * Scope ID + * API key successfully rotated. */ - scopeId: string; + 201: RotateApiKeyResponse; }; -export type DeleteApiScopeResponse = unknown; +export type RotateApiKeyResponse2 = + RotateApiKeyResponses[keyof RotateApiKeyResponses]; -export type UpdateApiApplicationsData = { - /** - * The API's ID. - */ - apiId: string; +export type VerifyApiKeyData = { /** - * The applications you want to authorize. + * API key verification details. */ - requestBody: { - applications: Array<{ - /** - * The application's Client ID. - */ - id: string; - /** - * Optional operation, set to 'delete' to revoke authorization for the application. If not set, the application will be authorized. - */ - operation?: string; - }>; + body: { + /** + * The API key to verify. + */ + api_key: string; }; + path?: never; + query?: never; + url: "/api/v1/api_keys/verify"; }; -export type UpdateApiApplicationsResponse = authorize_app_api_response; - -export type AddApiApplicationScopeData = { +export type VerifyApiKeyErrors = { /** - * API ID + * Invalid request. */ - apiId: string; + 400: ErrorResponse; /** - * Application ID + * Unauthorized - invalid credentials. */ - applicationId: string; + 401: ErrorResponse; /** - * Scope ID + * Too many requests. Request was throttled. */ - scopeId: string; + 429: ErrorResponse; }; -export type AddApiApplicationScopeResponse = unknown; +export type VerifyApiKeyError = VerifyApiKeyErrors[keyof VerifyApiKeyErrors]; -export type DeleteApiApplicationScopeData = { - /** - * API ID - */ - apiId: string; +export type VerifyApiKeyResponses = { /** - * Application ID + * API key verification result. */ - applicationId: string; - /** - * Scope ID - */ - scopeId: string; + 200: VerifyApiKeyResponse; }; -export type DeleteApiApplicationScopeResponse = unknown; +export type VerifyApiKeyResponse2 = + VerifyApiKeyResponses[keyof VerifyApiKeyResponses]; -export type GetApplicationsData = { +export type GetApisData = { + body?: never; + path?: never; + query?: { + /** + * Additional data to include in the response. Allowed value: "scopes". + */ + expand?: "scopes"; + }; + url: "/api/v1/apis"; +}; + +export type GetApisErrors = { /** - * A string to get the next page of results if there are more results. + * Invalid request. */ - nextToken?: string | null; + 400: ErrorResponse; /** - * Number of results per page. Defaults to 10 if parameter not sent. + * Unauthorized - invalid credentials. */ - pageSize?: number | null; + 403: ErrorResponse; /** - * Field and order to sort the result by. + * Too many requests. Request was throttled. */ - sort?: ("name_asc" | "name_desc") | null; + 429: ErrorResponse; }; -export type GetApplicationsResponse = get_applications_response; +export type GetApisError = GetApisErrors[keyof GetApisErrors]; -export type CreateApplicationData = { - requestBody: { +export type GetApisResponses = { + /** + * A list of APIs. + */ + 200: GetApisResponse; +}; + +export type GetApisResponse2 = GetApisResponses[keyof GetApisResponses]; + +export type AddApisData = { + body: { /** - * The application's name. + * The name of the API. (1-64 characters). */ name: string; /** - * The application's type. Use `reg` for regular server rendered applications, `spa` for single-page applications, `m2m` for machine-to-machine applications, and `device` for devices and IoT. - */ - type: "reg" | "spa" | "m2m" | "device"; - /** - * Scope an M2M application to an org (Plus plan required). + * A unique identifier for the API - commonly the URL. This value will be used as the `audience` parameter in authorization claims. (1-64 characters) */ - org_code?: string | null; + audience: string; }; + path?: never; + query?: never; + url: "/api/v1/apis"; }; -export type CreateApplicationResponse = create_application_response; - -export type GetApplicationData = { +export type AddApisErrors = { /** - * The identifier for the application. + * Invalid request. */ - applicationId: string; -}; - -export type GetApplicationResponse = get_application_response; - -export type UpdateApplicationData = { + 400: ErrorResponse; /** - * The identifier for the application. + * Unauthorized - invalid credentials. */ - applicationId: string; + 403: ErrorResponse; /** - * Application details. + * Too many requests. Request was throttled. */ - requestBody?: { - /** - * The application's name. - */ - name?: string; - /** - * The application's language key. - */ - language_key?: string; - /** - * The application's logout uris. - */ - logout_uris?: Array; - /** - * The application's redirect uris. - */ - redirect_uris?: Array; - /** - * The default login route for resolving session issues. - */ - login_uri?: string; - /** - * The homepage link to your application. - */ - homepage_uri?: string; - }; + 429: ErrorResponse; }; -export type UpdateApplicationResponse = unknown; +export type AddApisError = AddApisErrors[keyof AddApisErrors]; -export type DeleteApplicationData = { +export type AddApisResponses = { /** - * The identifier for the application. + * APIs successfully updated */ - applicationId: string; + 200: CreateApisResponse; }; -export type DeleteApplicationResponse = success_response; +export type AddApisResponse = AddApisResponses[keyof AddApisResponses]; -export type GetApplicationConnectionsData = { +export type DeleteApiData = { + body?: never; + path: { + /** + * The API's ID. + */ + api_id: string; + }; + query?: never; + url: "/api/v1/apis/{api_id}"; +}; + +export type DeleteApiErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; /** - * The identifier/client ID for the application. + * Too many requests. Request was throttled. */ - applicationId: string; + 429: ErrorResponse; }; -export type GetApplicationConnectionsResponse = get_connections_response; +export type DeleteApiError = DeleteApiErrors[keyof DeleteApiErrors]; -export type EnableConnectionData = { +export type DeleteApiResponses = { /** - * The identifier/client ID for the application. + * API successfully deleted. */ - applicationId: string; - /** - * The identifier for the connection. - */ - connectionId: string; + 200: DeleteApiResponse; }; -export type EnableConnectionResponse = unknown; +export type DeleteApiResponse2 = DeleteApiResponses[keyof DeleteApiResponses]; -export type RemoveConnectionData = { +export type GetApiData = { + body?: never; + path: { + /** + * The API's ID. + */ + api_id: string; + }; + query?: never; + url: "/api/v1/apis/{api_id}"; +}; + +export type GetApiErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; /** - * The identifier/client ID for the application. + * Unauthorized - invalid credentials. */ - applicationId: string; + 403: ErrorResponse; /** - * The identifier for the connection. + * Too many requests. Request was throttled. */ - connectionId: string; + 429: ErrorResponse; }; -export type RemoveConnectionResponse = success_response; +export type GetApiError = GetApiErrors[keyof GetApiErrors]; -export type GetApplicationPropertyValuesData = { +export type GetApiResponses = { /** - * The application's ID / client ID. + * API successfully retrieved. */ - applicationId: string; + 200: GetApiResponse; }; -export type GetApplicationPropertyValuesResponse = get_property_values_response; +export type GetApiResponse2 = GetApiResponses[keyof GetApiResponses]; -export type UpdateApplicationsPropertyData = { - /** - * The application's ID / client ID. - */ - applicationId: string; - /** - * The property's key. - */ - propertyKey: string; - requestBody: { +export type GetApiScopesData = { + body?: never; + path: { /** - * The new value for the property + * API ID */ - value: string | boolean; + api_id: string; }; + query?: never; + url: "/api/v1/apis/{api_id}/scopes"; }; -export type UpdateApplicationsPropertyResponse = success_response; - -export type UpdateApplicationTokensData = { +export type GetApiScopesErrors = { /** - * The identifier/client ID for the application. + * Invalid request. */ - applicationId: string; + 400: ErrorResponse; /** - * Application tokens. + * Unauthorized - invalid credentials. */ - requestBody: { - /** - * The lifetime of an access token in seconds. - */ - access_token_lifetime?: number; - /** - * The lifetime of a refresh token in seconds. - */ - refresh_token_lifetime?: number; + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type GetApiScopesError = GetApiScopesErrors[keyof GetApiScopesErrors]; + +export type GetApiScopesResponses = { + /** + * API scopes successfully retrieved. + */ + 200: GetApiScopesResponse; +}; + +export type GetApiScopesResponse2 = + GetApiScopesResponses[keyof GetApiScopesResponses]; + +export type AddApiScopeData = { + body: { /** - * The lifetime of an ID token in seconds. + * The key reference for the scope (1-64 characters, no white space). */ - id_token_lifetime?: number; + key: string; /** - * The lifetime of an authenticated session in seconds. + * Description of the api scope purpose. */ - authenticated_session_lifetime?: number; + description?: string; + }; + path: { /** - * Enable or disable Hasura mapping. + * API ID */ - is_hasura_mapping_enabled?: boolean; + api_id: string; }; + query?: never; + url: "/api/v1/apis/{api_id}/scopes"; }; -export type UpdateApplicationTokensResponse = success_response; - -export type GetBillingAgreementsData = { - /** - * The ID of the billing customer to retrieve agreements for - */ - customerId: string; +export type AddApiScopeErrors = { /** - * The ID of the billing agreement to end before. + * Invalid request. */ - endingBefore?: string | null; + 400: ErrorResponse; /** - * The feature code to filter by agreements only containing that feature + * Unauthorized - invalid credentials. */ - featureCode?: string | null; + 403: ErrorResponse; /** - * Number of results per page. Defaults to 10 if parameter not sent. + * Too many requests. Request was throttled. */ - pageSize?: number | null; - /** - * The ID of the billing agreement to start after. - */ - startingAfter?: string | null; + 429: ErrorResponse; }; -export type GetBillingAgreementsResponse = get_billing_agreements_response; +export type AddApiScopeError = AddApiScopeErrors[keyof AddApiScopeErrors]; -export type CreateBillingAgreementData = { +export type AddApiScopeResponses = { /** - * New agreement request values + * API scopes successfully created */ - requestBody: { - /** - * The ID of the billing customer to create a new agreement for - */ - customer_id: string; - /** - * The code of the billing plan the new agreement will be based on - */ - plan_code: string; + 200: CreateApiScopesResponse; +}; + +export type AddApiScopeResponse = + AddApiScopeResponses[keyof AddApiScopeResponses]; + +export type DeleteApiScopeData = { + body?: never; + path: { /** - * Generate a final invoice for any un-invoiced metered usage. + * API ID */ - is_invoice_now?: boolean; + api_id: string; /** - * Generate a proration invoice item that credits remaining unused features. + * Scope ID */ - is_prorate?: boolean; + scope_id: string; }; + query?: never; + url: "/api/v1/apis/{api_id}/scopes/{scope_id}"; }; -export type CreateBillingAgreementResponse = success_response; - -export type GetBillingEntitlementsData = { +export type DeleteApiScopeErrors = { /** - * The ID of the billing customer to retrieve entitlements for + * Invalid request. */ - customerId: string; + 400: ErrorResponse; /** - * The ID of the billing entitlement to end before. + * Unauthorized - invalid credentials. */ - endingBefore?: string | null; + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type DeleteApiScopeError = + DeleteApiScopeErrors[keyof DeleteApiScopeErrors]; + +export type DeleteApiScopeResponses = { /** - * Additional plan data to include in the response. Allowed value: "plans". + * API scope successfully deleted. */ - expand?: "plans" | null; + 200: unknown; +}; + +export type GetApiScopeData = { + body?: never; + path: { + /** + * API ID + */ + api_id: string; + /** + * Scope ID + */ + scope_id: string; + }; + query?: never; + url: "/api/v1/apis/{api_id}/scopes/{scope_id}"; +}; + +export type GetApiScopeErrors = { /** - * When the maximum limit of an entitlement is null, this value is returned as the maximum limit + * Invalid request. */ - maxValue?: string | null; + 400: ErrorResponse; /** - * Number of results per page. Defaults to 10 if parameter not sent. + * Unauthorized - invalid credentials. */ - pageSize?: number | null; + 403: ErrorResponse; /** - * The ID of the billing entitlement to start after. + * Too many requests. Request was throttled. */ - startingAfter?: string | null; + 429: ErrorResponse; }; -export type GetBillingEntitlementsResponse = get_billing_entitlements_response; +export type GetApiScopeError = GetApiScopeErrors[keyof GetApiScopeErrors]; -export type CreateMeterUsageRecordData = { +export type GetApiScopeResponses = { /** - * Meter usage record + * API scope successfully retrieved. */ - requestBody: { - /** - * The billing agreement against which to record usage - */ - customer_agreement_id: string; - /** - * The code of the feature within the agreement against which to record usage - */ - billing_feature_code: string; + 200: GetApiScopeResponse; +}; + +export type GetApiScopeResponse2 = + GetApiScopeResponses[keyof GetApiScopeResponses]; + +export type UpdateApiScopeData = { + body: { /** - * The value of usage to record + * Description of the api scope purpose. */ - meter_value: string; + description?: string; + }; + path: { /** - * The date and time the usage needs to be recorded for (defaults to current date/time) + * API ID */ - meter_usage_timestamp?: string; + api_id: string; /** - * Absolutes overrides the current usage + * Scope ID */ - meter_type_code?: "absolute" | "delta"; + scope_id: string; }; + query?: never; + url: "/api/v1/apis/{api_id}/scopes/{scope_id}"; }; -export type CreateMeterUsageRecordResponse = create_meter_usage_record_response; - -export type GetBusinessResponse = get_business_response; - -export type UpdateBusinessData = { +export type UpdateApiScopeErrors = { /** - * The business details to update. + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type UpdateApiScopeError = + UpdateApiScopeErrors[keyof UpdateApiScopeErrors]; + +export type UpdateApiScopeResponses = { + /** + * API scope successfully updated + */ + 200: unknown; +}; + +export type UpdateApiApplicationsData = { + /** + * The applications you want to authorize. */ - requestBody: { + body: { + applications: Array<{ + /** + * The application's Client ID. + */ + id: string; + /** + * Optional operation, set to 'delete' to revoke authorization for the application. If not set, the application will be authorized. + */ + operation?: string; + }>; + }; + path: { /** - * The name of the business. + * The API's ID. */ - business_name?: string | null; + api_id: string; + }; + query?: never; + url: "/api/v1/apis/{api_id}/applications"; +}; + +export type UpdateApiApplicationsErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type UpdateApiApplicationsError = + UpdateApiApplicationsErrors[keyof UpdateApiApplicationsErrors]; + +export type UpdateApiApplicationsResponses = { + /** + * Authorized applications updated. + */ + 200: AuthorizeAppApiResponse; +}; + +export type UpdateApiApplicationsResponse = + UpdateApiApplicationsResponses[keyof UpdateApiApplicationsResponses]; + +export type DeleteApiApplicationScopeData = { + body?: never; + path: { /** - * The email address of the business. + * API ID */ - email?: string | null; + api_id: string; /** - * The key of the industry of your business. Can be retrieved from the /industries endpoint. + * Application ID */ - industry_key?: string | null; + application_id: string; /** - * Whether the business is using clickwrap agreements. + * Scope ID */ - is_click_wrap?: boolean | null; + scope_id: string; + }; + query?: never; + url: "/api/v1/apis/{api_id}/applications/{application_id}/scopes/{scope_id}"; +}; + +export type DeleteApiApplicationScopeErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type DeleteApiApplicationScopeError = + DeleteApiApplicationScopeErrors[keyof DeleteApiApplicationScopeErrors]; + +export type DeleteApiApplicationScopeResponses = { + /** + * API scope successfully deleted. + */ + 200: unknown; +}; + +export type AddApiApplicationScopeData = { + body?: never; + path: { /** - * Whether the business is showing Kinde branding. Requires a paid plan. + * API ID */ - is_show_kinde_branding?: boolean | null; + api_id: string; /** - * The Kinde perk code for the business. + * Application ID */ - kinde_perk_code?: string | null; + application_id: string; /** - * The phone number of the business. + * Scope ID */ - phone?: string | null; + scope_id: string; + }; + query?: never; + url: "/api/v1/apis/{api_id}/applications/{application_id}/scopes/{scope_id}"; +}; + +export type AddApiApplicationScopeErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type AddApiApplicationScopeError = + AddApiApplicationScopeErrors[keyof AddApiApplicationScopeErrors]; + +export type AddApiApplicationScopeResponses = { + /** + * API scope successfully added to API application + */ + 200: unknown; +}; + +export type GetApplicationsData = { + body?: never; + path?: never; + query?: { /** - * The URL to the business's privacy policy. + * Field and order to sort the result by. */ - privacy_url?: string | null; + sort?: "name_asc" | "name_desc"; /** - * The URL to the business's terms of service. + * Number of results per page. Defaults to 10 if parameter not sent. */ - terms_url?: string | null; + page_size?: number | null; /** - * The key of the timezone of your business. Can be retrieved from the /timezones endpoint. + * A string to get the next page of results if there are more results. */ - timezone_key?: string | null; + next_token?: string | null; }; + url: "/api/v1/applications"; +}; + +export type GetApplicationsErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; }; -export type UpdateBusinessResponse = success_response; +export type GetApplicationsError = + GetApplicationsErrors[keyof GetApplicationsErrors]; -export type GetCallbackUrlsData = { +export type GetApplicationsResponses = { /** - * The identifier for the application. + * A successful response with a list of applications or an empty list. */ - appId: string; + 200: GetApplicationsResponse; }; -export type GetCallbackUrlsResponse = redirect_callback_urls; +export type GetApplicationsResponse2 = + GetApplicationsResponses[keyof GetApplicationsResponses]; -export type AddRedirectCallbackUrlsData = { +export type CreateApplicationData = { + body: { + /** + * The application's name. + */ + name: string; + /** + * The application's type. Use `reg` for regular server rendered applications, `spa` for single-page applications, `m2m` for machine-to-machine applications, and `device` for devices and IoT. + */ + type: "reg" | "spa" | "m2m" | "device"; + /** + * Scope an M2M application to an org (Plus plan required). + */ + org_code?: string | null; + }; + path?: never; + query?: never; + url: "/api/v1/applications"; +}; + +export type CreateApplicationErrors = { /** - * The identifier for the application. + * Invalid request. */ - appId: string; + 400: ErrorResponse; /** - * Callback details. + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type CreateApplicationError = + CreateApplicationErrors[keyof CreateApplicationErrors]; + +export type CreateApplicationResponses = { + /** + * Application successfully created. */ - requestBody: { + 201: CreateApplicationResponse; +}; + +export type CreateApplicationResponse2 = + CreateApplicationResponses[keyof CreateApplicationResponses]; + +export type DeleteApplicationData = { + body?: never; + path: { /** - * Array of callback urls. + * The identifier for the application. */ - urls?: Array; + application_id: string; }; + query?: never; + url: "/api/v1/applications/{application_id}"; }; -export type AddRedirectCallbackUrlsResponse = success_response; - -export type ReplaceRedirectCallbackUrlsData = { +export type DeleteApplicationErrors = { /** - * The identifier for the application. + * Invalid request. */ - appId: string; + 400: ErrorResponse; /** - * Callback details. + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type DeleteApplicationError = + DeleteApplicationErrors[keyof DeleteApplicationErrors]; + +export type DeleteApplicationResponses = { + /** + * Application successfully deleted. */ - requestBody: { + 200: SuccessResponse; +}; + +export type DeleteApplicationResponse = + DeleteApplicationResponses[keyof DeleteApplicationResponses]; + +export type GetApplicationData = { + body?: never; + path: { /** - * Array of callback urls. + * The identifier for the application. */ - urls?: Array; + application_id: string; }; + query?: never; + url: "/api/v1/applications/{application_id}"; }; -export type ReplaceRedirectCallbackUrlsResponse = success_response; - -export type DeleteCallbackUrlsData = { +export type GetApplicationErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; /** - * The identifier for the application. + * Unauthorized - invalid credentials. */ - appId: string; + 403: ErrorResponse; /** - * Urls to delete, comma separated and url encoded. + * Too many requests. Request was throttled. */ - urls: string; + 429: ErrorResponse; }; -export type DeleteCallbackUrlsResponse = success_response; +export type GetApplicationError = + GetApplicationErrors[keyof GetApplicationErrors]; -export type GetLogoutUrlsData = { +export type GetApplicationResponses = { /** - * The identifier for the application. + * Application successfully retrieved. */ - appId: string; + 200: GetApplicationResponse; }; -export type GetLogoutUrlsResponse = logout_redirect_urls; +export type GetApplicationResponse2 = + GetApplicationResponses[keyof GetApplicationResponses]; -export type AddLogoutRedirectUrlsData = { - /** - * The identifier for the application. - */ - appId: string; +export type UpdateApplicationData = { /** - * Callback details. + * Application details. */ - requestBody: { + body?: { /** - * Array of logout urls. + * The application's name. */ - urls?: Array; + name?: string; + /** + * The application's language key. + */ + language_key?: string; + /** + * The application's logout uris. + */ + logout_uris?: Array; + /** + * The application's redirect uris. + */ + redirect_uris?: Array; + /** + * The default login route for resolving session issues. + */ + login_uri?: string; + /** + * The homepage link to your application. + */ + homepage_uri?: string; }; + path: { + /** + * The identifier for the application. + */ + application_id: string; + }; + query?: never; + url: "/api/v1/applications/{application_id}"; }; -export type AddLogoutRedirectUrlsResponse = success_response; - -export type ReplaceLogoutRedirectUrlsData = { +export type UpdateApplicationErrors = { /** - * The identifier for the application. + * Invalid request. */ - appId: string; + 400: ErrorResponse; /** - * Callback details. + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type UpdateApplicationError = + UpdateApplicationErrors[keyof UpdateApplicationErrors]; + +export type UpdateApplicationResponses = { + /** + * Application successfully updated. */ - requestBody: { + 200: unknown; +}; + +export type GetApplicationConnectionsData = { + body?: never; + path: { /** - * Array of logout urls. + * The identifier/client ID for the application. */ - urls?: Array; + application_id: string; }; + query?: never; + url: "/api/v1/applications/{application_id}/connections"; }; -export type ReplaceLogoutRedirectUrlsResponse = success_response; - -export type DeleteLogoutUrlsData = { +export type GetApplicationConnectionsErrors = { /** - * The identifier for the application. + * Invalid request. */ - appId: string; + 400: ErrorResponse; /** - * Urls to delete, comma separated and url encoded. + * Unauthorized - invalid credentials. */ - urls: string; + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; }; -export type DeleteLogoutUrlsResponse = success_response; +export type GetApplicationConnectionsError = + GetApplicationConnectionsErrors[keyof GetApplicationConnectionsErrors]; -export type GetConnectedAppAuthUrlData = { +export type GetApplicationConnectionsResponses = { /** - * The unique key code reference of the connected app to authenticate against. + * Application connections successfully retrieved. */ - keyCodeRef: string; + 200: GetConnectionsResponse; +}; + +export type GetApplicationConnectionsResponse = + GetApplicationConnectionsResponses[keyof GetApplicationConnectionsResponses]; + +export type RemoveConnectionData = { + body?: never; + path: { + /** + * The identifier/client ID for the application. + */ + application_id: string; + /** + * The identifier for the connection. + */ + connection_id: string; + }; + query?: never; + url: "/api/v1/applications/{application_id}/connections/{connection_id}"; +}; + +export type RemoveConnectionErrors = { /** - * The code of the Kinde organization that needs to authenticate to the third-party connected app. + * Invalid request. */ - orgCode?: string; + 400: ErrorResponse; /** - * A URL that overrides the default callback URL setup in your connected app configuration + * Unauthorized - invalid credentials. */ - overrideCallbackUrl?: string; + 403: ErrorResponse; /** - * The id of the user that needs to authenticate to the third-party connected app. + * Too many requests. Request was throttled. */ - userId?: string; + 429: ErrorResponse; }; -export type GetConnectedAppAuthUrlResponse = connected_apps_auth_url; +export type RemoveConnectionError = + RemoveConnectionErrors[keyof RemoveConnectionErrors]; -export type GetConnectedAppTokenData = { +export type RemoveConnectionResponses = { /** - * The unique sesssion id representing the login session of a user. + * Connection successfully removed. */ - sessionId: string; + 200: SuccessResponse; }; -export type GetConnectedAppTokenResponse = connected_apps_access_token; +export type RemoveConnectionResponse = + RemoveConnectionResponses[keyof RemoveConnectionResponses]; -export type RevokeConnectedAppTokenData = { +export type EnableConnectionData = { + body?: never; + path: { + /** + * The identifier/client ID for the application. + */ + application_id: string; + /** + * The identifier for the connection. + */ + connection_id: string; + }; + query?: never; + url: "/api/v1/applications/{application_id}/connections/{connection_id}"; +}; + +export type EnableConnectionErrors = { /** - * The unique sesssion id representing the login session of a user. + * Invalid request. */ - sessionId: string; + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; }; -export type RevokeConnectedAppTokenResponse = success_response; +export type EnableConnectionError = + EnableConnectionErrors[keyof EnableConnectionErrors]; -export type GetConnectionsData = { +export type EnableConnectionResponses = { /** - * The ID of the connection to end before. + * Connection successfully enabled. */ - endingBefore?: string | null; + 200: unknown; +}; + +export type GetApplicationPropertyValuesData = { + body?: never; + path: { + /** + * The application's ID / client ID. + */ + application_id: string; + }; + query?: never; + url: "/api/v1/applications/{application_id}/properties"; +}; + +export type GetApplicationPropertyValuesErrors = { /** - * Filter the results by the home realm domain. + * Invalid request. */ - homeRealmDomain?: string | null; + 400: ErrorResponse; /** - * Number of results per page. Defaults to 10 if parameter not sent. + * Unauthorized - invalid credentials. */ - pageSize?: number | null; + 403: ErrorResponse; /** - * The ID of the connection to start after. + * Too many requests. Request was throttled. */ - startingAfter?: string | null; + 429: ErrorResponse; }; -export type GetConnectionsResponse = get_connections_response; +export type GetApplicationPropertyValuesError = + GetApplicationPropertyValuesErrors[keyof GetApplicationPropertyValuesErrors]; -export type CreateConnectionData = { +export type GetApplicationPropertyValuesResponses = { /** - * Connection details. + * Properties successfully retrieved. */ - requestBody: { - /** - * The internal name of the connection. - */ - name?: string; - /** - * The public facing name of the connection. - */ - display_name?: string; + 200: GetPropertyValuesResponse; +}; + +export type GetApplicationPropertyValuesResponse = + GetApplicationPropertyValuesResponses[keyof GetApplicationPropertyValuesResponses]; + +export type UpdateApplicationsPropertyData = { + body: { /** - * The identity provider identifier for the connection. + * The new value for the property */ - strategy?: - | "oauth2:apple" - | "oauth2:azure_ad" - | "oauth2:bitbucket" - | "oauth2:discord" - | "oauth2:facebook" - | "oauth2:github" - | "oauth2:gitlab" - | "oauth2:google" - | "oauth2:linkedin" - | "oauth2:microsoft" - | "oauth2:patreon" - | "oauth2:slack" - | "oauth2:stripe" - | "oauth2:twitch" - | "oauth2:twitter" - | "oauth2:xero" - | "saml:custom" - | "saml:cloudflare" - | "saml:okta" - | "saml:microsoft" - | "saml:google" - | "wsfed:azure_ad"; + value: string | boolean; + }; + path: { /** - * Client IDs of applications in which this connection is to be enabled. + * The application's ID / client ID. */ - enabled_applications?: Array; + application_id: string; /** - * Enterprise connections only - the code for organization that manages this connection. + * The property's key. */ - organization_code?: string | null; - options?: - | { - /** - * OAuth client ID. - */ - client_id?: string; - /** - * OAuth client secret. - */ - client_secret?: string; - /** - * Use custom domain callback URL. - */ - is_use_custom_domain?: boolean; - /** - * Trust this connection for account merging. - */ - is_trusted?: boolean; - } - | { - /** - * Client ID. - */ - client_id?: string; - /** - * Client secret. - */ - client_secret?: string; - /** - * List of domains to limit authentication. - */ - home_realm_domains?: Array; - /** - * Domain for Entra ID. - */ - entra_id_domain?: string; - /** - * Use https://login.windows.net/common instead of a default endpoint. - */ - is_use_common_endpoint?: boolean; - /** - * Sync user profile data with IDP. - */ - is_sync_user_profile_on_login?: boolean; - /** - * Include user group info from MS Entra ID. - */ - is_retrieve_provider_user_groups?: boolean; - /** - * Include additional user profile information. - */ - is_extended_attributes_required?: boolean; - /** - * Users automatically join organization when using this connection. - */ - is_auto_join_organization_enabled?: boolean; - /** - * Create a user record in Kinde if the user signing in does not exist. - */ - is_create_missing_user?: boolean; - /** - * Force showing the SSO button for this connection. - */ - is_force_show_sso_button?: boolean; - /** - * Additional upstream parameters to pass to the identity provider. - */ - upstream_params?: { - [key: string]: unknown; - }; - /** - * Use custom domain callback URL. - */ - is_use_custom_domain?: boolean; - /** - * Trust this connection for account merging. - */ - is_trusted?: boolean; - } - | { - /** - * List of domains to restrict authentication. - */ - home_realm_domains?: Array; - /** - * SAML Entity ID. - */ - saml_entity_id?: string; - /** - * URL for the IdP metadata. - */ - saml_idp_metadata_url?: string; - /** - * Override the default SSO endpoint with a URL your IdP recognizes. - */ - saml_sign_in_url?: string; - /** - * Attribute key for the user's email. - */ - saml_email_key_attr?: string; - /** - * Attribute key for the user's first name. - */ - saml_first_name_key_attr?: string; - /** - * Attribute key for the user's last name. - */ - saml_last_name_key_attr?: string; - /** - * Create user if they don't exist. - */ - is_create_missing_user?: boolean; - /** - * Force showing the SSO button for this connection. - */ - is_force_show_sso_button?: boolean; - /** - * Additional upstream parameters to pass to the identity provider. - */ - upstream_params?: { - [key: string]: unknown; - }; - /** - * Certificate for signing SAML requests. - */ - saml_signing_certificate?: string; - /** - * Private key associated with the signing certificate. - */ - saml_signing_private_key?: string; - /** - * Users automatically join organization when using this connection. - */ - is_auto_join_organization_enabled?: boolean; - /** - * Use custom domain callback URL. - */ - is_use_custom_domain?: boolean; - /** - * Trust this connection for account merging. - */ - is_trusted?: boolean; - }; + property_key: string; }; + query?: never; + url: "/api/v1/applications/{application_id}/properties/{property_key}"; +}; + +export type UpdateApplicationsPropertyErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; }; -export type CreateConnectionResponse = create_connection_response; +export type UpdateApplicationsPropertyError = + UpdateApplicationsPropertyErrors[keyof UpdateApplicationsPropertyErrors]; -export type GetConnectionData = { +export type UpdateApplicationsPropertyResponses = { /** - * The unique identifier for the connection. + * Property successfully updated */ - connectionId: string; + 200: SuccessResponse; }; -export type GetConnectionResponse = connection; +export type UpdateApplicationsPropertyResponse = + UpdateApplicationsPropertyResponses[keyof UpdateApplicationsPropertyResponses]; -export type UpdateConnectionData = { +export type UpdateApplicationTokensData = { /** - * The unique identifier for the connection. + * Application tokens. */ - connectionId: string; + body: { + /** + * The lifetime of an access token in seconds. + */ + access_token_lifetime?: number; + /** + * The lifetime of a refresh token in seconds. + */ + refresh_token_lifetime?: number; + /** + * The lifetime of an ID token in seconds. + */ + id_token_lifetime?: number; + /** + * The lifetime of an authenticated session in seconds. + */ + authenticated_session_lifetime?: number; + /** + * Enable or disable Hasura mapping. + */ + is_hasura_mapping_enabled?: boolean; + }; + path: { + /** + * The identifier/client ID for the application. + */ + application_id: string; + }; + query?: never; + url: "/api/v1/applications/{application_id}/tokens"; +}; + +export type UpdateApplicationTokensErrors = { /** - * The fields of the connection to update. + * Invalid request. */ - requestBody: { + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type UpdateApplicationTokensError = + UpdateApplicationTokensErrors[keyof UpdateApplicationTokensErrors]; + +export type UpdateApplicationTokensResponses = { + /** + * Application tokens successfully updated. + */ + 200: SuccessResponse; +}; + +export type UpdateApplicationTokensResponse = + UpdateApplicationTokensResponses[keyof UpdateApplicationTokensResponses]; + +export type GetBillingEntitlementsData = { + body?: never; + path?: never; + query: { /** - * The internal name of the connection. + * Number of results per page. Defaults to 10 if parameter not sent. */ - name?: string; + page_size?: number | null; /** - * The public facing name of the connection. + * The ID of the billing entitlement to start after. */ - display_name?: string; + starting_after?: string | null; /** - * Client IDs of applications in which this connection is to be enabled. + * The ID of the billing entitlement to end before. */ - enabled_applications?: Array; - options?: - | { - /** - * OAuth client ID. - */ - client_id?: string; - /** - * OAuth client secret. - */ - client_secret?: string; - /** - * Use custom domain callback URL. - */ + ending_before?: string | null; + /** + * The ID of the billing customer to retrieve entitlements for + */ + customer_id: string; + /** + * When the maximum limit of an entitlement is null, this value is returned as the maximum limit + */ + max_value?: string | null; + /** + * Additional plan data to include in the response. Allowed value: "plans". + */ + expand?: "plans"; + }; + url: "/api/v1/billing/entitlements"; +}; + +export type GetBillingEntitlementsErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Invalid credentials. + */ + 403: ErrorResponse; + /** + * Request was throttled. + */ + 429: unknown; +}; + +export type GetBillingEntitlementsError = + GetBillingEntitlementsErrors[keyof GetBillingEntitlementsErrors]; + +export type GetBillingEntitlementsResponses = { + /** + * Billing entitlements successfully retrieved. + */ + 200: GetBillingEntitlementsResponse; +}; + +export type GetBillingEntitlementsResponse2 = + GetBillingEntitlementsResponses[keyof GetBillingEntitlementsResponses]; + +export type GetBillingAgreementsData = { + body?: never; + path?: never; + query: { + /** + * Number of results per page. Defaults to 10 if parameter not sent. + */ + page_size?: number | null; + /** + * The ID of the billing agreement to start after. + */ + starting_after?: string | null; + /** + * The ID of the billing agreement to end before. + */ + ending_before?: string | null; + /** + * The ID of the billing customer to retrieve agreements for + */ + customer_id: string; + /** + * The feature code to filter by agreements only containing that feature + */ + feature_code?: string | null; + }; + url: "/api/v1/billing/agreements"; +}; + +export type GetBillingAgreementsErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Invalid credentials. + */ + 403: ErrorResponse; + /** + * Request was throttled. + */ + 429: unknown; +}; + +export type GetBillingAgreementsError = + GetBillingAgreementsErrors[keyof GetBillingAgreementsErrors]; + +export type GetBillingAgreementsResponses = { + /** + * Billing agreements successfully retrieved. + */ + 200: GetBillingAgreementsResponse; +}; + +export type GetBillingAgreementsResponse2 = + GetBillingAgreementsResponses[keyof GetBillingAgreementsResponses]; + +export type CreateBillingAgreementData = { + /** + * New agreement request values + */ + body: { + /** + * The ID of the billing customer to create a new agreement for + */ + customer_id: string; + /** + * The code of the billing plan the new agreement will be based on + */ + plan_code: string; + /** + * Generate a final invoice for any un-invoiced metered usage. + */ + is_invoice_now?: boolean; + /** + * Generate a proration invoice item that credits remaining unused features. + */ + is_prorate?: boolean; + }; + path?: never; + query?: never; + url: "/api/v1/billing/agreements"; +}; + +export type CreateBillingAgreementErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type CreateBillingAgreementError = + CreateBillingAgreementErrors[keyof CreateBillingAgreementErrors]; + +export type CreateBillingAgreementResponses = { + /** + * Billing agreement successfully changed + */ + 200: SuccessResponse; +}; + +export type CreateBillingAgreementResponse = + CreateBillingAgreementResponses[keyof CreateBillingAgreementResponses]; + +export type CreateMeterUsageRecordData = { + /** + * Meter usage record + */ + body: { + /** + * The billing agreement against which to record usage + */ + customer_agreement_id: string; + /** + * The code of the feature within the agreement against which to record usage + */ + billing_feature_code: string; + /** + * The value of usage to record + */ + meter_value: string; + /** + * The date and time the usage needs to be recorded for (defaults to current date/time) + */ + meter_usage_timestamp?: string; + /** + * Absolutes overrides the current usage + */ + meter_type_code?: "absolute" | "delta"; + }; + path?: never; + query?: never; + url: "/api/v1/billing/meter_usage"; +}; + +export type CreateMeterUsageRecordErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type CreateMeterUsageRecordError = + CreateMeterUsageRecordErrors[keyof CreateMeterUsageRecordErrors]; + +export type CreateMeterUsageRecordResponses = { + /** + * Meter usage record successfully created. + */ + 200: CreateMeterUsageRecordResponse; +}; + +export type CreateMeterUsageRecordResponse2 = + CreateMeterUsageRecordResponses[keyof CreateMeterUsageRecordResponses]; + +export type GetBusinessData = { + body?: never; + path?: never; + query?: never; + url: "/api/v1/business"; +}; + +export type GetBusinessErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type GetBusinessError = GetBusinessErrors[keyof GetBusinessErrors]; + +export type GetBusinessResponses = { + /** + * Your business details. + */ + 200: GetBusinessResponse; +}; + +export type GetBusinessResponse2 = + GetBusinessResponses[keyof GetBusinessResponses]; + +export type UpdateBusinessData = { + /** + * The business details to update. + */ + body: { + /** + * The name of the business. + */ + business_name?: string | null; + /** + * The email address of the business. + */ + email?: string | null; + /** + * The key of the industry of your business. Can be retrieved from the /industries endpoint. + */ + industry_key?: string | null; + /** + * Whether the business is using clickwrap agreements. + */ + is_click_wrap?: boolean | null; + /** + * Whether the business is showing Kinde branding. Requires a paid plan. + */ + is_show_kinde_branding?: boolean | null; + /** + * The Kinde perk code for the business. + */ + kinde_perk_code?: string | null; + /** + * The phone number of the business. + */ + phone?: string | null; + /** + * The URL to the business's privacy policy. + */ + privacy_url?: string | null; + /** + * The URL to the business's terms of service. + */ + terms_url?: string | null; + /** + * The key of the timezone of your business. Can be retrieved from the /timezones endpoint. + */ + timezone_key?: string | null; + }; + path?: never; + query?: never; + url: "/api/v1/business"; +}; + +export type UpdateBusinessErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type UpdateBusinessError = + UpdateBusinessErrors[keyof UpdateBusinessErrors]; + +export type UpdateBusinessResponses = { + /** + * Business successfully updated. + */ + 200: SuccessResponse; +}; + +export type UpdateBusinessResponse = + UpdateBusinessResponses[keyof UpdateBusinessResponses]; + +export type GetIndustriesData = { + body?: never; + path?: never; + query?: never; + url: "/api/v1/industries"; +}; + +export type GetIndustriesErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type GetIndustriesError = GetIndustriesErrors[keyof GetIndustriesErrors]; + +export type GetIndustriesResponses = { + /** + * A list of industries. + */ + 200: GetIndustriesResponse; +}; + +export type GetIndustriesResponse2 = + GetIndustriesResponses[keyof GetIndustriesResponses]; + +export type GetTimezonesData = { + body?: never; + path?: never; + query?: never; + url: "/api/v1/timezones"; +}; + +export type GetTimezonesErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type GetTimezonesError = GetTimezonesErrors[keyof GetTimezonesErrors]; + +export type GetTimezonesResponses = { + /** + * A list of timezones. + */ + 200: GetTimezonesResponse; +}; + +export type GetTimezonesResponse2 = + GetTimezonesResponses[keyof GetTimezonesResponses]; + +export type DeleteCallbackUrlsData = { + body?: never; + path: { + /** + * The identifier for the application. + */ + app_id: string; + }; + query: { + /** + * Urls to delete, comma separated and url encoded. + */ + urls: string; + }; + url: "/api/v1/applications/{app_id}/auth_redirect_urls"; +}; + +export type DeleteCallbackUrlsErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Invalid credentials. + */ + 403: ErrorResponse; + /** + * Request was throttled. + */ + 429: unknown; +}; + +export type DeleteCallbackUrlsError = + DeleteCallbackUrlsErrors[keyof DeleteCallbackUrlsErrors]; + +export type DeleteCallbackUrlsResponses = { + /** + * Callback URLs successfully deleted. + */ + 200: SuccessResponse; +}; + +export type DeleteCallbackUrlsResponse = + DeleteCallbackUrlsResponses[keyof DeleteCallbackUrlsResponses]; + +export type GetCallbackUrlsData = { + body?: never; + path: { + /** + * The identifier for the application. + */ + app_id: string; + }; + query?: never; + url: "/api/v1/applications/{app_id}/auth_redirect_urls"; +}; + +export type GetCallbackUrlsErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; +}; + +export type GetCallbackUrlsError = + GetCallbackUrlsErrors[keyof GetCallbackUrlsErrors]; + +export type GetCallbackUrlsResponses = { + /** + * Callback URLs successfully retrieved. + */ + 200: RedirectCallbackUrls; +}; + +export type GetCallbackUrlsResponse = + GetCallbackUrlsResponses[keyof GetCallbackUrlsResponses]; + +export type AddRedirectCallbackUrlsData = { + /** + * Callback details. + */ + body: { + /** + * Array of callback urls. + */ + urls?: Array; + }; + path: { + /** + * The identifier for the application. + */ + app_id: string; + }; + query?: never; + url: "/api/v1/applications/{app_id}/auth_redirect_urls"; +}; + +export type AddRedirectCallbackUrlsErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Invalid credentials. + */ + 403: ErrorResponse; + /** + * Request was throttled. + */ + 429: unknown; +}; + +export type AddRedirectCallbackUrlsError = + AddRedirectCallbackUrlsErrors[keyof AddRedirectCallbackUrlsErrors]; + +export type AddRedirectCallbackUrlsResponses = { + /** + * Callbacks successfully updated + */ + 200: SuccessResponse; +}; + +export type AddRedirectCallbackUrlsResponse = + AddRedirectCallbackUrlsResponses[keyof AddRedirectCallbackUrlsResponses]; + +export type ReplaceRedirectCallbackUrlsData = { + /** + * Callback details. + */ + body: { + /** + * Array of callback urls. + */ + urls?: Array; + }; + path: { + /** + * The identifier for the application. + */ + app_id: string; + }; + query?: never; + url: "/api/v1/applications/{app_id}/auth_redirect_urls"; +}; + +export type ReplaceRedirectCallbackUrlsErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; +}; + +export type ReplaceRedirectCallbackUrlsError = + ReplaceRedirectCallbackUrlsErrors[keyof ReplaceRedirectCallbackUrlsErrors]; + +export type ReplaceRedirectCallbackUrlsResponses = { + /** + * Callbacks successfully updated + */ + 200: SuccessResponse; +}; + +export type ReplaceRedirectCallbackUrlsResponse = + ReplaceRedirectCallbackUrlsResponses[keyof ReplaceRedirectCallbackUrlsResponses]; + +export type DeleteLogoutUrlsData = { + body?: never; + path: { + /** + * The identifier for the application. + */ + app_id: string; + }; + query: { + /** + * Urls to delete, comma separated and url encoded. + */ + urls: string; + }; + url: "/api/v1/applications/{app_id}/auth_logout_urls"; +}; + +export type DeleteLogoutUrlsErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type DeleteLogoutUrlsError = + DeleteLogoutUrlsErrors[keyof DeleteLogoutUrlsErrors]; + +export type DeleteLogoutUrlsResponses = { + /** + * Logout URLs successfully deleted. + */ + 200: SuccessResponse; +}; + +export type DeleteLogoutUrlsResponse = + DeleteLogoutUrlsResponses[keyof DeleteLogoutUrlsResponses]; + +export type GetLogoutUrlsData = { + body?: never; + path: { + /** + * The identifier for the application. + */ + app_id: string; + }; + query?: never; + url: "/api/v1/applications/{app_id}/auth_logout_urls"; +}; + +export type GetLogoutUrlsErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type GetLogoutUrlsError = GetLogoutUrlsErrors[keyof GetLogoutUrlsErrors]; + +export type GetLogoutUrlsResponses = { + /** + * Logout URLs successfully retrieved. + */ + 200: LogoutRedirectUrls; +}; + +export type GetLogoutUrlsResponse = + GetLogoutUrlsResponses[keyof GetLogoutUrlsResponses]; + +export type AddLogoutRedirectUrlsData = { + /** + * Callback details. + */ + body: { + /** + * Array of logout urls. + */ + urls?: Array; + }; + path: { + /** + * The identifier for the application. + */ + app_id: string; + }; + query?: never; + url: "/api/v1/applications/{app_id}/auth_logout_urls"; +}; + +export type AddLogoutRedirectUrlsErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type AddLogoutRedirectUrlsError = + AddLogoutRedirectUrlsErrors[keyof AddLogoutRedirectUrlsErrors]; + +export type AddLogoutRedirectUrlsResponses = { + /** + * Logout URLs successfully updated. + */ + 200: SuccessResponse; +}; + +export type AddLogoutRedirectUrlsResponse = + AddLogoutRedirectUrlsResponses[keyof AddLogoutRedirectUrlsResponses]; + +export type ReplaceLogoutRedirectUrlsData = { + /** + * Callback details. + */ + body: { + /** + * Array of logout urls. + */ + urls?: Array; + }; + path: { + /** + * The identifier for the application. + */ + app_id: string; + }; + query?: never; + url: "/api/v1/applications/{app_id}/auth_logout_urls"; +}; + +export type ReplaceLogoutRedirectUrlsErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type ReplaceLogoutRedirectUrlsError = + ReplaceLogoutRedirectUrlsErrors[keyof ReplaceLogoutRedirectUrlsErrors]; + +export type ReplaceLogoutRedirectUrlsResponses = { + /** + * Logout URLs successfully updated. + */ + 200: SuccessResponse; +}; + +export type ReplaceLogoutRedirectUrlsResponse = + ReplaceLogoutRedirectUrlsResponses[keyof ReplaceLogoutRedirectUrlsResponses]; + +export type GetConnectedAppAuthUrlData = { + body?: never; + path?: never; + query: { + /** + * The unique key code reference of the connected app to authenticate against. + */ + key_code_ref: string; + /** + * The id of the user that needs to authenticate to the third-party connected app. + */ + user_id?: string; + /** + * The code of the Kinde organization that needs to authenticate to the third-party connected app. + */ + org_code?: string; + /** + * A URL that overrides the default callback URL setup in your connected app configuration + */ + override_callback_url?: string; + }; + url: "/api/v1/connected_apps/auth_url"; +}; + +export type GetConnectedAppAuthUrlErrors = { + /** + * Error retrieving connected app auth url. + */ + 400: ErrorResponse; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Error retrieving connected app auth url. + */ + 404: ErrorResponse; + /** + * Request was throttled. + */ + 429: unknown; +}; + +export type GetConnectedAppAuthUrlError = + GetConnectedAppAuthUrlErrors[keyof GetConnectedAppAuthUrlErrors]; + +export type GetConnectedAppAuthUrlResponses = { + /** + * A URL that can be used to authenticate and a session id to identify this authentication session. + */ + 200: ConnectedAppsAuthUrl; +}; + +export type GetConnectedAppAuthUrlResponse = + GetConnectedAppAuthUrlResponses[keyof GetConnectedAppAuthUrlResponses]; + +export type GetConnectedAppTokenData = { + body?: never; + path?: never; + query: { + /** + * The unique sesssion id representing the login session of a user. + */ + session_id: string; + }; + url: "/api/v1/connected_apps/token"; +}; + +export type GetConnectedAppTokenErrors = { + /** + * The session id provided points to an invalid session. + */ + 400: ErrorResponse; + /** + * Invalid credentials. + */ + 403: ErrorResponse; + /** + * Request was throttled. + */ + 429: unknown; +}; + +export type GetConnectedAppTokenError = + GetConnectedAppTokenErrors[keyof GetConnectedAppTokenErrors]; + +export type GetConnectedAppTokenResponses = { + /** + * An access token that can be used to query a third-party provider, as well as the token's expiry time. + */ + 200: ConnectedAppsAccessToken; +}; + +export type GetConnectedAppTokenResponse = + GetConnectedAppTokenResponses[keyof GetConnectedAppTokenResponses]; + +export type RevokeConnectedAppTokenData = { + body?: never; + path?: never; + query: { + /** + * The unique sesssion id representing the login session of a user. + */ + session_id: string; + }; + url: "/api/v1/connected_apps/revoke"; +}; + +export type RevokeConnectedAppTokenErrors = { + /** + * Bad request. + */ + 400: ErrorResponse; + /** + * Invalid credentials. + */ + 403: ErrorResponse; + /** + * Invalid HTTP method used. + */ + 405: unknown; + /** + * Request was throttled. + */ + 429: unknown; +}; + +export type RevokeConnectedAppTokenError = + RevokeConnectedAppTokenErrors[keyof RevokeConnectedAppTokenErrors]; + +export type RevokeConnectedAppTokenResponses = { + /** + * An access token that can be used to query a third-party provider, as well as the token's expiry time. + */ + 200: SuccessResponse; +}; + +export type RevokeConnectedAppTokenResponse = + RevokeConnectedAppTokenResponses[keyof RevokeConnectedAppTokenResponses]; + +export type GetConnectionsData = { + body?: never; + path?: never; + query?: { + /** + * Number of results per page. Defaults to 10 if parameter not sent. + */ + page_size?: number | null; + /** + * Filter the results by the home realm domain. + */ + home_realm_domain?: string | null; + /** + * The ID of the connection to start after. + */ + starting_after?: string | null; + /** + * The ID of the connection to end before. + */ + ending_before?: string | null; + }; + url: "/api/v1/connections"; +}; + +export type GetConnectionsErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Invalid credentials. + */ + 403: ErrorResponse; + /** + * Request was throttled. + */ + 429: unknown; +}; + +export type GetConnectionsError = + GetConnectionsErrors[keyof GetConnectionsErrors]; + +export type GetConnectionsResponses = { + /** + * Connections successfully retrieved. + */ + 200: GetConnectionsResponse; +}; + +export type GetConnectionsResponse2 = + GetConnectionsResponses[keyof GetConnectionsResponses]; + +export type CreateConnectionData = { + /** + * Connection details. + */ + body: { + /** + * The internal name of the connection. + */ + name?: string; + /** + * The public facing name of the connection. + */ + display_name?: string; + /** + * The identity provider identifier for the connection. + */ + strategy?: + | "oauth2:apple" + | "oauth2:azure_ad" + | "oauth2:bitbucket" + | "oauth2:discord" + | "oauth2:facebook" + | "oauth2:github" + | "oauth2:gitlab" + | "oauth2:google" + | "oauth2:linkedin" + | "oauth2:microsoft" + | "oauth2:patreon" + | "oauth2:slack" + | "oauth2:stripe" + | "oauth2:twitch" + | "oauth2:twitter" + | "oauth2:xero" + | "saml:custom" + | "saml:cloudflare" + | "saml:okta" + | "saml:microsoft" + | "saml:google" + | "wsfed:azure_ad"; + /** + * Client IDs of applications in which this connection is to be enabled. + */ + enabled_applications?: Array; + /** + * Enterprise connections only - the code for organization that manages this connection. + */ + organization_code?: string | null; + options?: + | { + /** + * OAuth client ID. + */ + client_id?: string; + /** + * OAuth client secret. + */ + client_secret?: string; + /** + * Use custom domain callback URL. + */ + is_use_custom_domain?: boolean; + /** + * Trust this connection for account merging. + */ + is_trusted?: boolean; + } + | { + /** + * Client ID. + */ + client_id?: string; + /** + * Client secret. + */ + client_secret?: string; + /** + * List of domains to limit authentication. + */ + home_realm_domains?: Array; + /** + * Domain for Entra ID. + */ + entra_id_domain?: string; + /** + * Use https://login.windows.net/common instead of a default endpoint. + */ + is_use_common_endpoint?: boolean; + /** + * Sync user profile data with IDP. + */ + is_sync_user_profile_on_login?: boolean; + /** + * Include user group info from MS Entra ID. + */ + is_retrieve_provider_user_groups?: boolean; + /** + * Include additional user profile information. + */ + is_extended_attributes_required?: boolean; + /** + * Users automatically join organization when using this connection. + */ + is_auto_join_organization_enabled?: boolean; + /** + * Create a user record in Kinde if the user signing in does not exist. + */ + is_create_missing_user?: boolean; + /** + * Force showing the SSO button for this connection. + */ + is_force_show_sso_button?: boolean; + /** + * Additional upstream parameters to pass to the identity provider. + */ + upstream_params?: { + [key: string]: unknown; + }; + /** + * Use custom domain callback URL. + */ + is_use_custom_domain?: boolean; + /** + * Trust this connection for account merging. + */ + is_trusted?: boolean; + } + | { + /** + * List of domains to restrict authentication. + */ + home_realm_domains?: Array; + /** + * SAML Entity ID. + */ + saml_entity_id?: string; + /** + * URL for the IdP metadata. + */ + saml_idp_metadata_url?: string; + /** + * Override the default SSO endpoint with a URL your IdP recognizes. + */ + saml_sign_in_url?: string; + /** + * Attribute key for the user's email. + */ + saml_email_key_attr?: string; + /** + * Attribute key for the user's first name. + */ + saml_first_name_key_attr?: string; + /** + * Attribute key for the user's last name. + */ + saml_last_name_key_attr?: string; + /** + * Create user if they don't exist. + */ + is_create_missing_user?: boolean; + /** + * Force showing the SSO button for this connection. + */ + is_force_show_sso_button?: boolean; + /** + * Additional upstream parameters to pass to the identity provider. + */ + upstream_params?: { + [key: string]: unknown; + }; + /** + * Certificate for signing SAML requests. + */ + saml_signing_certificate?: string; + /** + * Private key associated with the signing certificate. + */ + saml_signing_private_key?: string; + /** + * Users automatically join organization when using this connection. + */ + is_auto_join_organization_enabled?: boolean; + /** + * Use custom domain callback URL. + */ + is_use_custom_domain?: boolean; + /** + * Trust this connection for account merging. + */ + is_trusted?: boolean; + }; + }; + path?: never; + query?: never; + url: "/api/v1/connections"; +}; + +export type CreateConnectionErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type CreateConnectionError = + CreateConnectionErrors[keyof CreateConnectionErrors]; + +export type CreateConnectionResponses = { + /** + * Connection successfully created. + */ + 201: CreateConnectionResponse; +}; + +export type CreateConnectionResponse2 = + CreateConnectionResponses[keyof CreateConnectionResponses]; + +export type DeleteConnectionData = { + body?: never; + path: { + /** + * The identifier for the connection. + */ + connection_id: string; + }; + query?: never; + url: "/api/v1/connections/{connection_id}"; +}; + +export type DeleteConnectionErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * The specified resource was not found + */ + 404: NotFoundResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type DeleteConnectionError = + DeleteConnectionErrors[keyof DeleteConnectionErrors]; + +export type DeleteConnectionResponses = { + /** + * Connection successfully deleted. + */ + 200: SuccessResponse; +}; + +export type DeleteConnectionResponse = + DeleteConnectionResponses[keyof DeleteConnectionResponses]; + +export type GetConnectionData = { + body?: never; + path: { + /** + * The unique identifier for the connection. + */ + connection_id: string; + }; + query?: never; + url: "/api/v1/connections/{connection_id}"; +}; + +export type GetConnectionErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type GetConnectionError = GetConnectionErrors[keyof GetConnectionErrors]; + +export type GetConnectionResponses = { + /** + * Connection successfully retrieved. + */ + 200: Connection; +}; + +export type GetConnectionResponse = + GetConnectionResponses[keyof GetConnectionResponses]; + +export type UpdateConnectionData = { + /** + * The fields of the connection to update. + */ + body: { + /** + * The internal name of the connection. + */ + name?: string; + /** + * The public facing name of the connection. + */ + display_name?: string; + /** + * Client IDs of applications in which this connection is to be enabled. + */ + enabled_applications?: Array; + options?: + | { + /** + * OAuth client ID. + */ + client_id?: string; + /** + * OAuth client secret. + */ + client_secret?: string; + /** + * Use custom domain callback URL. + */ + is_use_custom_domain?: boolean; + /** + * Trust this connection for account merging. + */ + is_trusted?: boolean; + } + | { + /** + * Client ID. + */ + client_id?: string; + /** + * Client secret. + */ + client_secret?: string; + /** + * List of domains to limit authentication. + */ + home_realm_domains?: Array; + /** + * Domain for Entra ID. + */ + entra_id_domain?: string; + /** + * Use https://login.windows.net/common instead of a default endpoint. + */ + is_use_common_endpoint?: boolean; + /** + * Sync user profile data with IDP. + */ + is_sync_user_profile_on_login?: boolean; + /** + * Include user group info from MS Entra ID. + */ + is_retrieve_provider_user_groups?: boolean; + /** + * Include additional user profile information. + */ + is_extended_attributes_required?: boolean; + /** + * Create users if they don't exist in the system. + */ + is_create_missing_user?: boolean; + /** + * Force showing the SSO button for this connection. + */ + is_force_show_sso_button?: boolean; + /** + * Additional upstream parameters to pass to the identity provider. + */ + upstream_params?: { + [key: string]: unknown; + }; + /** + * Use custom domain callback URL. + */ + is_use_custom_domain?: boolean; + /** + * Trust this connection for account merging. + */ + is_trusted?: boolean; + } + | { + /** + * List of domains to restrict authentication. + */ + home_realm_domains?: Array; + /** + * SAML Entity ID. + */ + saml_entity_id?: string; + /** + * URL for the IdP metadata. + */ + saml_idp_metadata_url?: string; + /** + * Attribute key for the user's email. + */ + saml_email_key_attr?: string; + /** + * Attribute key for the user's first name. + */ + saml_first_name_key_attr?: string; + /** + * Attribute key for the user's last name. + */ + saml_last_name_key_attr?: string; + /** + * Create user if they don't exist. + */ + is_create_missing_user?: boolean; + /** + * Force showing the SSO button for this connection. + */ + is_force_show_sso_button?: boolean; + /** + * Additional upstream parameters to pass to the identity provider. + */ + upstream_params?: { + [key: string]: unknown; + }; + /** + * Certificate for signing SAML requests. + */ + saml_signing_certificate?: string; + /** + * Private key associated with the signing certificate. + */ + saml_signing_private_key?: string; + /** + * Use custom domain callback URL. + */ + is_use_custom_domain?: boolean; + /** + * Trust this connection for account merging. + */ + is_trusted?: boolean; + }; + }; + path: { + /** + * The unique identifier for the connection. + */ + connection_id: string; + }; + query?: never; + url: "/api/v1/connections/{connection_id}"; +}; + +export type UpdateConnectionErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * The specified resource was not found + */ + 404: NotFoundResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type UpdateConnectionError = + UpdateConnectionErrors[keyof UpdateConnectionErrors]; + +export type UpdateConnectionResponses = { + /** + * Connection successfully updated. + */ + 200: SuccessResponse; +}; + +export type UpdateConnectionResponse = + UpdateConnectionResponses[keyof UpdateConnectionResponses]; + +export type ReplaceConnectionData = { + /** + * The complete connection configuration to replace the existing one. + */ + body: { + /** + * The internal name of the connection. + */ + name?: string; + /** + * The public-facing name of the connection. + */ + display_name?: string; + /** + * Client IDs of applications in which this connection is to be enabled. + */ + enabled_applications?: Array; + options?: + | { + /** + * OAuth client ID. + */ + client_id?: string; + /** + * OAuth client secret. + */ + client_secret?: string; + /** + * Use custom domain callback URL. + */ is_use_custom_domain?: boolean; /** * Trust this connection for account merging. @@ -3565,7 +5332,7 @@ export type UpdateConnectionData = { */ is_extended_attributes_required?: boolean; /** - * Create users if they don't exist in the system. + * Create a user record in Kinde if the user signing in does not exist. */ is_create_missing_user?: boolean; /** @@ -3644,1792 +5411,4322 @@ export type UpdateConnectionData = { is_trusted?: boolean; }; }; + path: { + /** + * The unique identifier for the connection. + */ + connection_id: string; + }; + query?: never; + url: "/api/v1/connections/{connection_id}"; +}; + +export type ReplaceConnectionErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * The specified resource was not found + */ + 404: NotFoundResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type ReplaceConnectionError = + ReplaceConnectionErrors[keyof ReplaceConnectionErrors]; + +export type ReplaceConnectionResponses = { + /** + * Connection successfully updated + */ + 200: SuccessResponse; +}; + +export type ReplaceConnectionResponse = + ReplaceConnectionResponses[keyof ReplaceConnectionResponses]; + +export type GetEnvironmentData = { + body?: never; + path?: never; + query?: never; + url: "/api/v1/environment"; +}; + +export type GetEnvironmentErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type GetEnvironmentError = + GetEnvironmentErrors[keyof GetEnvironmentErrors]; + +export type GetEnvironmentResponses = { + /** + * Environment successfully retrieved. + */ + 200: GetEnvironmentResponse; +}; + +export type GetEnvironmentResponse2 = + GetEnvironmentResponses[keyof GetEnvironmentResponses]; + +export type DeleteEnvironementFeatureFlagOverridesData = { + body?: never; + path?: never; + query?: never; + url: "/api/v1/environment/feature_flags"; +}; + +export type DeleteEnvironementFeatureFlagOverridesErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; +}; + +export type DeleteEnvironementFeatureFlagOverridesError = + DeleteEnvironementFeatureFlagOverridesErrors[keyof DeleteEnvironementFeatureFlagOverridesErrors]; + +export type DeleteEnvironementFeatureFlagOverridesResponses = { + /** + * Feature flag overrides deleted successfully. + */ + 200: SuccessResponse; +}; + +export type DeleteEnvironementFeatureFlagOverridesResponse = + DeleteEnvironementFeatureFlagOverridesResponses[keyof DeleteEnvironementFeatureFlagOverridesResponses]; + +export type GetEnvironementFeatureFlagsData = { + body?: never; + path?: never; + query?: never; + url: "/api/v1/environment/feature_flags"; +}; + +export type GetEnvironementFeatureFlagsErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; +}; + +export type GetEnvironementFeatureFlagsError = + GetEnvironementFeatureFlagsErrors[keyof GetEnvironementFeatureFlagsErrors]; + +export type GetEnvironementFeatureFlagsResponses = { + /** + * Feature flags retrieved successfully. + */ + 200: GetEnvironmentFeatureFlagsResponse; +}; + +export type GetEnvironementFeatureFlagsResponse = + GetEnvironementFeatureFlagsResponses[keyof GetEnvironementFeatureFlagsResponses]; + +export type DeleteEnvironementFeatureFlagOverrideData = { + body?: never; + path: { + /** + * The identifier for the feature flag. + */ + feature_flag_key: string; + }; + query?: never; + url: "/api/v1/environment/feature_flags/{feature_flag_key}"; +}; + +export type DeleteEnvironementFeatureFlagOverrideErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; +}; + +export type DeleteEnvironementFeatureFlagOverrideError = + DeleteEnvironementFeatureFlagOverrideErrors[keyof DeleteEnvironementFeatureFlagOverrideErrors]; + +export type DeleteEnvironementFeatureFlagOverrideResponses = { + /** + * Feature flag deleted successfully. + */ + 200: SuccessResponse; +}; + +export type DeleteEnvironementFeatureFlagOverrideResponse = + DeleteEnvironementFeatureFlagOverrideResponses[keyof DeleteEnvironementFeatureFlagOverrideResponses]; + +export type UpdateEnvironementFeatureFlagOverrideData = { + /** + * Flag details. + */ + body: { + /** + * The flag override value. + */ + value: string; + }; + path: { + /** + * The identifier for the feature flag. + */ + feature_flag_key: string; + }; + query?: never; + url: "/api/v1/environment/feature_flags/{feature_flag_key}"; +}; + +export type UpdateEnvironementFeatureFlagOverrideErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; +}; + +export type UpdateEnvironementFeatureFlagOverrideError = + UpdateEnvironementFeatureFlagOverrideErrors[keyof UpdateEnvironementFeatureFlagOverrideErrors]; + +export type UpdateEnvironementFeatureFlagOverrideResponses = { + /** + * Feature flag override successful + */ + 200: SuccessResponse; +}; + +export type UpdateEnvironementFeatureFlagOverrideResponse = + UpdateEnvironementFeatureFlagOverrideResponses[keyof UpdateEnvironementFeatureFlagOverrideResponses]; + +export type ReadLogoData = { + body?: never; + path?: never; + query?: never; + url: "/api/v1/environment/logos"; +}; + +export type ReadLogoErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type ReadLogoError = ReadLogoErrors[keyof ReadLogoErrors]; + +export type ReadLogoResponses = { + /** + * Success + */ + 200: ReadEnvLogoResponse; +}; + +export type ReadLogoResponse2 = ReadLogoResponses[keyof ReadLogoResponses]; + +export type DeleteLogoData = { + body?: never; + path: { + /** + * The type of logo to delete. + */ + type: "dark" | "light"; + }; + query?: never; + url: "/api/v1/environment/logos/{type}"; +}; + +export type DeleteLogoErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type DeleteLogoError = DeleteLogoErrors[keyof DeleteLogoErrors]; + +export type DeleteLogoResponses = { + /** + * Logo successfully deleted + */ + 200: SuccessResponse; + /** + * No logo found to delete + */ + 204: void; +}; + +export type DeleteLogoResponse = DeleteLogoResponses[keyof DeleteLogoResponses]; + +export type AddLogoData = { + /** + * Logo details. + */ + body: { + /** + * The logo file to upload. + */ + logo: Blob | File; + }; + path: { + /** + * The type of logo to add. + */ + type: "dark" | "light"; + }; + query?: never; + url: "/api/v1/environment/logos/{type}"; +}; + +export type AddLogoErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type AddLogoError = AddLogoErrors[keyof AddLogoErrors]; + +export type AddLogoResponses = { + /** + * Logo successfully updated + */ + 200: SuccessResponse; +}; + +export type AddLogoResponse = AddLogoResponses[keyof AddLogoResponses]; + +export type GetEnvironmentVariablesData = { + body?: never; + path?: never; + query?: never; + url: "/api/v1/environment_variables"; +}; + +export type GetEnvironmentVariablesErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type GetEnvironmentVariablesError = + GetEnvironmentVariablesErrors[keyof GetEnvironmentVariablesErrors]; + +export type GetEnvironmentVariablesResponses = { + /** + * A successful response with a list of environment variables or an empty list. + */ + 200: GetEnvironmentVariablesResponse; +}; + +export type GetEnvironmentVariablesResponse2 = + GetEnvironmentVariablesResponses[keyof GetEnvironmentVariablesResponses]; + +export type CreateEnvironmentVariableData = { + /** + * The environment variable details. + */ + body: { + /** + * The name of the environment variable (max 128 characters). + */ + key: string; + /** + * The value of the new environment variable (max 2048 characters). + */ + value: string; + /** + * Whether the environment variable is sensitive. Secrets are not-readable by you or your team after creation. + */ + is_secret?: boolean; + }; + path?: never; + query?: never; + url: "/api/v1/environment_variables"; +}; + +export type CreateEnvironmentVariableErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type CreateEnvironmentVariableError = + CreateEnvironmentVariableErrors[keyof CreateEnvironmentVariableErrors]; + +export type CreateEnvironmentVariableResponses = { + /** + * Environment variable successfully created. + */ + 201: CreateEnvironmentVariableResponse; +}; + +export type CreateEnvironmentVariableResponse2 = + CreateEnvironmentVariableResponses[keyof CreateEnvironmentVariableResponses]; + +export type DeleteEnvironmentVariableData = { + body?: never; + path: { + /** + * The environment variable's ID. + */ + variable_id: string; + }; + query?: never; + url: "/api/v1/environment_variables/{variable_id}"; +}; + +export type DeleteEnvironmentVariableErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type DeleteEnvironmentVariableError = + DeleteEnvironmentVariableErrors[keyof DeleteEnvironmentVariableErrors]; + +export type DeleteEnvironmentVariableResponses = { + /** + * Environment variable successfully deleted. + */ + 200: DeleteEnvironmentVariableResponse; +}; + +export type DeleteEnvironmentVariableResponse2 = + DeleteEnvironmentVariableResponses[keyof DeleteEnvironmentVariableResponses]; + +export type GetEnvironmentVariableData = { + body?: never; + path: { + /** + * The environment variable's ID. + */ + variable_id: string; + }; + query?: never; + url: "/api/v1/environment_variables/{variable_id}"; +}; + +export type GetEnvironmentVariableErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type GetEnvironmentVariableError = + GetEnvironmentVariableErrors[keyof GetEnvironmentVariableErrors]; + +export type GetEnvironmentVariableResponses = { + /** + * Environment variable successfully retrieved. + */ + 200: GetEnvironmentVariableResponse; +}; + +export type GetEnvironmentVariableResponse2 = + GetEnvironmentVariableResponses[keyof GetEnvironmentVariableResponses]; + +export type UpdateEnvironmentVariableData = { + /** + * The new details for the environment variable + */ + body: { + /** + * The key to update. + */ + key?: string; + /** + * The new value for the environment variable. + */ + value?: string; + /** + * Whether the environment variable is sensitive. Secret variables are not-readable by you or your team after creation. + */ + is_secret?: boolean; + }; + path: { + /** + * The environment variable's ID. + */ + variable_id: string; + }; + query?: never; + url: "/api/v1/environment_variables/{variable_id}"; +}; + +export type UpdateEnvironmentVariableErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type UpdateEnvironmentVariableError = + UpdateEnvironmentVariableErrors[keyof UpdateEnvironmentVariableErrors]; + +export type UpdateEnvironmentVariableResponses = { + /** + * Environment variable successfully updated. + */ + 200: UpdateEnvironmentVariableResponse; +}; + +export type UpdateEnvironmentVariableResponse2 = + UpdateEnvironmentVariableResponses[keyof UpdateEnvironmentVariableResponses]; + +export type CreateFeatureFlagData = { + /** + * Flag details. + */ + body: { + /** + * The name of the flag. + */ + name: string; + /** + * Description of the flag purpose. + */ + description?: string; + /** + * The flag identifier to use in code. + */ + key: string; + /** + * The variable type. + */ + type: "str" | "int" | "bool"; + /** + * Allow the flag to be overridden at a different level. + */ + allow_override_level?: "env" | "org" | "usr"; + /** + * Default value for the flag used by environments and organizations. + */ + default_value: string; + }; + path?: never; + query?: never; + url: "/api/v1/feature_flags"; +}; + +export type CreateFeatureFlagErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; +}; + +export type CreateFeatureFlagError = + CreateFeatureFlagErrors[keyof CreateFeatureFlagErrors]; + +export type CreateFeatureFlagResponses = { + /** + * Feature flag successfully created + */ + 201: SuccessResponse; +}; + +export type CreateFeatureFlagResponse = + CreateFeatureFlagResponses[keyof CreateFeatureFlagResponses]; + +export type DeleteFeatureFlagData = { + body?: never; + path: { + /** + * The identifier for the feature flag. + */ + feature_flag_key: string; + }; + query?: never; + url: "/api/v1/feature_flags/{feature_flag_key}"; +}; + +export type DeleteFeatureFlagErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; +}; + +export type DeleteFeatureFlagError = + DeleteFeatureFlagErrors[keyof DeleteFeatureFlagErrors]; + +export type DeleteFeatureFlagResponses = { + /** + * Feature flag successfully updated. + */ + 200: SuccessResponse; +}; + +export type DeleteFeatureFlagResponse = + DeleteFeatureFlagResponses[keyof DeleteFeatureFlagResponses]; + +export type UpdateFeatureFlagData = { + body?: never; + path: { + /** + * The key identifier for the feature flag. + */ + feature_flag_key: string; + }; + query: { + /** + * The name of the flag. + */ + name: string; + /** + * Description of the flag purpose. + */ + description: string; + /** + * The variable type + */ + type: "str" | "int" | "bool"; + /** + * Allow the flag to be overridden at a different level. + */ + allow_override_level: "env" | "org"; + /** + * Default value for the flag used by environments and organizations. + */ + default_value: string; + }; + url: "/api/v1/feature_flags/{feature_flag_key}"; +}; + +export type UpdateFeatureFlagErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; +}; + +export type UpdateFeatureFlagError = + UpdateFeatureFlagErrors[keyof UpdateFeatureFlagErrors]; + +export type UpdateFeatureFlagResponses = { + /** + * Feature flag successfully updated. + */ + 200: SuccessResponse; +}; + +export type UpdateFeatureFlagResponse = + UpdateFeatureFlagResponses[keyof UpdateFeatureFlagResponses]; + +export type DeleteIdentityData = { + body?: never; + path: { + /** + * The unique identifier for the identity. + */ + identity_id: string; + }; + query?: never; + url: "/api/v1/identities/{identity_id}"; +}; + +export type DeleteIdentityErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; +}; + +export type DeleteIdentityError = + DeleteIdentityErrors[keyof DeleteIdentityErrors]; + +export type DeleteIdentityResponses = { + /** + * Identity successfully deleted. + */ + 200: SuccessResponse; +}; + +export type DeleteIdentityResponse = + DeleteIdentityResponses[keyof DeleteIdentityResponses]; + +export type GetIdentityData = { + body?: never; + path: { + /** + * The unique identifier for the identity. + */ + identity_id: string; + }; + query?: never; + url: "/api/v1/identities/{identity_id}"; +}; + +export type GetIdentityErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Invalid credentials. + */ + 403: ErrorResponse; + /** + * Request was throttled. + */ + 429: unknown; +}; + +export type GetIdentityError = GetIdentityErrors[keyof GetIdentityErrors]; + +export type GetIdentityResponses = { + /** + * Identity successfully retrieved. + */ + 200: Identity; +}; + +export type GetIdentityResponse = + GetIdentityResponses[keyof GetIdentityResponses]; + +export type UpdateIdentityData = { + /** + * The fields of the identity to update. + */ + body: { + /** + * Whether the identity is the primary for it's type + */ + is_primary?: boolean; + }; + path: { + /** + * The unique identifier for the identity. + */ + identity_id: string; + }; + query?: never; + url: "/api/v1/identities/{identity_id}"; +}; + +export type UpdateIdentityErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; +}; + +export type UpdateIdentityError = + UpdateIdentityErrors[keyof UpdateIdentityErrors]; + +export type UpdateIdentityResponses = { + /** + * Identity successfully updated. + */ + 200: SuccessResponse; +}; + +export type UpdateIdentityResponse = + UpdateIdentityResponses[keyof UpdateIdentityResponses]; + +export type ReplaceMfaData = { + /** + * MFA details. + */ + body: { + /** + * Specifies whether MFA is required, optional, or not enforced. + */ + policy: "required" | "off" | "optional"; + /** + * The MFA methods to enable. + */ + enabled_factors: Array<"mfa:email" | "mfa:sms" | "mfa:authenticator_app">; + /** + * Determines whether recovery codes are shown to users during MFA setup for the environment. + */ + is_recovery_codes_enabled?: boolean; + }; + path?: never; + query?: never; + url: "/api/v1/mfa"; +}; + +export type ReplaceMfaErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type ReplaceMfaError = ReplaceMfaErrors[keyof ReplaceMfaErrors]; + +export type ReplaceMfaResponses = { + /** + * MFA Configuration updated successfully. + */ + 200: SuccessResponse; +}; + +export type ReplaceMfaResponse = ReplaceMfaResponses[keyof ReplaceMfaResponses]; + +export type GetOrganizationData = { + body?: never; + path?: never; + query?: { + /** + * The organization's code. + */ + code?: string; + /** + * Additional data to include in the response. Allowed value: "billing". + */ + expand?: string; + }; + url: "/api/v1/organization"; +}; + +export type GetOrganizationErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type GetOrganizationError = + GetOrganizationErrors[keyof GetOrganizationErrors]; + +export type GetOrganizationResponses = { + /** + * Organization successfully retrieved. + */ + 200: GetOrganizationResponse; +}; + +export type GetOrganizationResponse2 = + GetOrganizationResponses[keyof GetOrganizationResponses]; + +export type CreateOrganizationData = { + /** + * Organization details. + */ + body: { + /** + * The organization's name. + */ + name: string; + /** + * The organization's feature flag settings. + */ + feature_flags?: { + [key: string]: "str" | "int" | "bool"; + }; + /** + * The organization's external identifier - commonly used when migrating from or mapping to other systems. + */ + external_id?: string; + /** + * The organization's brand settings - background color. + */ + background_color?: string; + /** + * The organization's brand settings - button color. + */ + button_color?: string; + /** + * The organization's brand settings - button text color. + */ + button_text_color?: string; + /** + * The organization's brand settings - link color. + */ + link_color?: string; + /** + * The organization's brand settings - dark mode background color. + */ + background_color_dark?: string; + /** + * The organization's brand settings - dark mode button color. + */ + button_color_dark?: string; + /** + * The organization's brand settings - dark mode button text color. + */ + button_text_color_dark?: string; + /** + * The organization's brand settings - dark mode link color. + */ + link_color_dark?: string; + /** + * The organization's brand settings - theme/mode 'light' | 'dark' | 'user_preference'. + */ + theme_code?: string; + /** + * A unique handle for the organization - can be used for dynamic callback urls. + */ + handle?: string; + /** + * Deprecated - Use 'is_auto_membership_enabled' instead. + * + * @deprecated + */ + is_allow_registrations?: boolean; + /** + * If users become members of this organization when the org code is supplied during authentication. + */ + is_auto_membership_enabled?: boolean; + /** + * The name of the organization that will be used in emails + */ + sender_name?: string | null; + /** + * The email address that will be used in emails. Requires custom SMTP to be set up. + */ + sender_email?: string | null; + /** + * If a billing customer is also created for this organization + */ + is_create_billing_customer?: boolean; + /** + * The email address used for billing purposes for the organization + */ + billing_email?: string; + /** + * The billing plan to put the customer on. If not specified, the default plan is used + */ + billing_plan_code?: string; + }; + path?: never; + query?: never; + url: "/api/v1/organization"; +}; + +export type CreateOrganizationErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type CreateOrganizationError = + CreateOrganizationErrors[keyof CreateOrganizationErrors]; + +export type CreateOrganizationResponses = { + /** + * Organization successfully created. + */ + 200: CreateOrganizationResponse; +}; + +export type CreateOrganizationResponse2 = + CreateOrganizationResponses[keyof CreateOrganizationResponses]; + +export type GetOrganizationsData = { + body?: never; + path?: never; + query?: { + /** + * Field and order to sort the result by. + */ + sort?: "name_asc" | "name_desc" | "email_asc" | "email_desc"; + /** + * Number of results per page. Defaults to 10 if parameter not sent. + */ + page_size?: number | null; + /** + * A string to get the next page of results if there are more results. + */ + next_token?: string | null; + }; + url: "/api/v1/organizations"; +}; + +export type GetOrganizationsErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type GetOrganizationsError = + GetOrganizationsErrors[keyof GetOrganizationsErrors]; + +export type GetOrganizationsResponses = { + /** + * Organizations successfully retreived. + */ + 200: GetOrganizationsResponse; +}; + +export type GetOrganizationsResponse2 = + GetOrganizationsResponses[keyof GetOrganizationsResponses]; + +export type DeleteOrganizationData = { + body?: never; + path: { + /** + * The identifier for the organization. + */ + org_code: string; + }; + query?: never; + url: "/api/v1/organization/{org_code}"; +}; + +export type DeleteOrganizationErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * The specified resource was not found + */ + 404: NotFoundResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type DeleteOrganizationError = + DeleteOrganizationErrors[keyof DeleteOrganizationErrors]; + +export type DeleteOrganizationResponses = { + /** + * Organization successfully deleted. + */ + 200: SuccessResponse; +}; + +export type DeleteOrganizationResponse = + DeleteOrganizationResponses[keyof DeleteOrganizationResponses]; + +export type UpdateOrganizationData = { + /** + * Organization details. + */ + body?: { + /** + * The organization's name. + */ + name?: string; + /** + * The organization's ID. + */ + external_id?: string; + /** + * The organization's brand settings - background color. + */ + background_color?: string; + /** + * The organization's brand settings - button color. + */ + button_color?: string; + /** + * The organization's brand settings - button text color. + */ + button_text_color?: string; + /** + * The organization's brand settings - link color. + */ + link_color?: string; + /** + * The organization's brand settings - dark mode background color. + */ + background_color_dark?: string; + /** + * The organization's brand settings - dark mode button color. + */ + button_color_dark?: string; + /** + * The organization's brand settings - dark mode button text color. + */ + button_text_color_dark?: string; + /** + * The organization's brand settings - dark mode link color. + */ + link_color_dark?: string; + /** + * The organization's brand settings - theme/mode. + */ + theme_code?: "light" | "dark" | "user_preference"; + /** + * The organization's handle. + */ + handle?: string; + /** + * Deprecated - Use 'is_auto_membership_enabled' instead. + * + * @deprecated + */ + is_allow_registrations?: boolean; + /** + * If users become members of this organization when the org code is supplied during authentication. + */ + is_auto_membership_enabled?: boolean; + /** + * Users can sign up to this organization. + */ + is_auto_join_domain_list?: boolean; + /** + * Domains allowed for self-sign up to this environment. + */ + allowed_domains?: Array; + /** + * Activate advanced organization features. + */ + is_enable_advanced_orgs?: boolean; + /** + * Enforce MFA for all users in this organization. + */ + is_enforce_mfa?: boolean; + /** + * The name of the organization that will be used in emails + */ + sender_name?: string | null; + /** + * The email address that will be used in emails. Requires custom SMTP to be set up. + */ + sender_email?: string | null; + /** + * Whether to suspend or unsuspend the organization. Setting to true suspends the organization; setting to false unsuspends it. The default organization cannot be suspended. + */ + is_suspended?: boolean; + }; + path: { + /** + * The identifier for the organization. + */ + org_code: string; + }; + query?: { + /** + * Additional data to include in the response. Allowed value: "billing". + */ + expand?: "billing"; + }; + url: "/api/v1/organization/{org_code}"; +}; + +export type UpdateOrganizationErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type UpdateOrganizationError = + UpdateOrganizationErrors[keyof UpdateOrganizationErrors]; + +export type UpdateOrganizationResponses = { + /** + * Organization successfully updated. + */ + 200: SuccessResponse; +}; + +export type UpdateOrganizationResponse = + UpdateOrganizationResponses[keyof UpdateOrganizationResponses]; + +export type GetOrganizationUsersData = { + body?: never; + path: { + /** + * The organization's code. + */ + org_code: string; + }; + query?: { + /** + * Field and order to sort the result by. + */ + sort?: + | "name_asc" + | "name_desc" + | "email_asc" + | "email_desc" + | "id_asc" + | "id_desc"; + /** + * Number of results per page. Defaults to 10 if parameter not sent. + */ + page_size?: number | null; + /** + * A string to get the next page of results if there are more results. + */ + next_token?: string | null; + /** + * Filter by user permissions comma separated (where all match) + */ + permissions?: string; + /** + * Filter by user roles comma separated (where all match) + */ + roles?: string; + }; + url: "/api/v1/organizations/{org_code}/users"; +}; + +export type GetOrganizationUsersErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type GetOrganizationUsersError = + GetOrganizationUsersErrors[keyof GetOrganizationUsersErrors]; + +export type GetOrganizationUsersResponses = { + /** + * A successful response with a list of organization users or an empty list. + */ + 200: GetOrganizationUsersResponse; +}; + +export type GetOrganizationUsersResponse2 = + GetOrganizationUsersResponses[keyof GetOrganizationUsersResponses]; + +export type UpdateOrganizationUsersData = { + body?: { + /** + * Users to add, update or remove from the organization. + */ + users?: Array<{ + /** + * The users id. + */ + id?: string; + /** + * Optional operation, set to 'delete' to remove the user from the organization. + */ + operation?: string; + /** + * Role keys to assign to the user. + */ + roles?: Array; + /** + * Permission keys to assign to the user. + */ + permissions?: Array; + }>; + }; + path: { + /** + * The organization's code. + */ + org_code: string; + }; + query?: never; + url: "/api/v1/organizations/{org_code}/users"; +}; + +export type UpdateOrganizationUsersErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type UpdateOrganizationUsersError = + UpdateOrganizationUsersErrors[keyof UpdateOrganizationUsersErrors]; + +export type UpdateOrganizationUsersResponses = { + /** + * Users successfully removed. + */ + 200: UpdateOrganizationUsersResponse; +}; + +export type UpdateOrganizationUsersResponse2 = + UpdateOrganizationUsersResponses[keyof UpdateOrganizationUsersResponses]; + +export type AddOrganizationUsersData = { + body?: { + /** + * Users to be added to the organization. + */ + users?: Array<{ + /** + * The users id. + */ + id?: string; + /** + * Role keys to assign to the user. + */ + roles?: Array; + /** + * Permission keys to assign to the user. + */ + permissions?: Array; + }>; + }; + path: { + /** + * The organization's code. + */ + org_code: string; + }; + query?: never; + url: "/api/v1/organizations/{org_code}/users"; +}; + +export type AddOrganizationUsersErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type AddOrganizationUsersError = + AddOrganizationUsersErrors[keyof AddOrganizationUsersErrors]; + +export type AddOrganizationUsersResponses = { + /** + * Add organization users request successfully processed. + */ + 200: AddOrganizationUsersResponse; +}; + +export type AddOrganizationUsersResponse2 = + AddOrganizationUsersResponses[keyof AddOrganizationUsersResponses]; + +export type GetOrganizationUserRolesData = { + body?: never; + path: { + /** + * The organization's code. + */ + org_code: string; + /** + * The user's id. + */ + user_id: string; + }; + query?: never; + url: "/api/v1/organizations/{org_code}/users/{user_id}/roles"; +}; + +export type GetOrganizationUserRolesErrors = { + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; +}; + +export type GetOrganizationUserRolesResponses = { + /** + * A successful response with a list of user roles. + */ + 200: GetOrganizationsUserRolesResponse; +}; + +export type GetOrganizationUserRolesResponse = + GetOrganizationUserRolesResponses[keyof GetOrganizationUserRolesResponses]; + +export type CreateOrganizationUserRoleData = { + /** + * Role details. + */ + body: { + /** + * The role id. + */ + role_id?: string; + }; + path: { + /** + * The organization's code. + */ + org_code: string; + /** + * The user's id. + */ + user_id: string; + }; + query?: never; + url: "/api/v1/organizations/{org_code}/users/{user_id}/roles"; +}; + +export type CreateOrganizationUserRoleErrors = { + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; +}; + +export type CreateOrganizationUserRoleResponses = { + /** + * Role successfully added. + */ + 200: SuccessResponse; +}; + +export type CreateOrganizationUserRoleResponse = + CreateOrganizationUserRoleResponses[keyof CreateOrganizationUserRoleResponses]; + +export type DeleteOrganizationUserRoleData = { + body?: never; + path: { + /** + * The organization's code. + */ + org_code: string; + /** + * The user's id. + */ + user_id: string; + /** + * The role id. + */ + role_id: string; + }; + query?: never; + url: "/api/v1/organizations/{org_code}/users/{user_id}/roles/{role_id}"; +}; + +export type DeleteOrganizationUserRoleErrors = { + /** + * Error creating user. + */ + 400: ErrorResponse; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; +}; + +export type DeleteOrganizationUserRoleError = + DeleteOrganizationUserRoleErrors[keyof DeleteOrganizationUserRoleErrors]; + +export type DeleteOrganizationUserRoleResponses = { + /** + * User successfully removed. + */ + 200: SuccessResponse; +}; + +export type DeleteOrganizationUserRoleResponse = + DeleteOrganizationUserRoleResponses[keyof DeleteOrganizationUserRoleResponses]; + +export type GetOrganizationUserPermissionsData = { + body?: never; + path: { + /** + * The organization's code. + */ + org_code: string; + /** + * The user's id. + */ + user_id: string; + }; + query?: { + /** + * Additional data to include in the response. Allowed value: "roles". + */ + expand?: string | null; + }; + url: "/api/v1/organizations/{org_code}/users/{user_id}/permissions"; +}; + +export type GetOrganizationUserPermissionsErrors = { + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; +}; + +export type GetOrganizationUserPermissionsResponses = { + /** + * A successful response with a list of user permissions. + */ + 200: GetOrganizationsUserPermissionsResponse; +}; + +export type GetOrganizationUserPermissionsResponse = + GetOrganizationUserPermissionsResponses[keyof GetOrganizationUserPermissionsResponses]; + +export type CreateOrganizationUserPermissionData = { + /** + * Permission details. + */ + body: { + /** + * The permission id. + */ + permission_id?: string; + }; + path: { + /** + * The organization's code. + */ + org_code: string; + /** + * The user's id. + */ + user_id: string; + }; + query?: never; + url: "/api/v1/organizations/{org_code}/users/{user_id}/permissions"; +}; + +export type CreateOrganizationUserPermissionErrors = { + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; +}; + +export type CreateOrganizationUserPermissionResponses = { + /** + * User permission successfully updated. + */ + 200: SuccessResponse; }; -export type UpdateConnectionResponse = success_response; +export type CreateOrganizationUserPermissionResponse = + CreateOrganizationUserPermissionResponses[keyof CreateOrganizationUserPermissionResponses]; -export type ReplaceConnectionData = { +export type DeleteOrganizationUserPermissionData = { + body?: never; + path: { + /** + * The organization's code. + */ + org_code: string; + /** + * The user's id. + */ + user_id: string; + /** + * The permission id. + */ + permission_id: string; + }; + query?: never; + url: "/api/v1/organizations/{org_code}/users/{user_id}/permissions/{permission_id}"; +}; + +export type DeleteOrganizationUserPermissionErrors = { /** - * The unique identifier for the connection. + * Error creating user. */ - connectionId: string; + 400: ErrorResponse; /** - * The complete connection configuration to replace the existing one. + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; +}; + +export type DeleteOrganizationUserPermissionError = + DeleteOrganizationUserPermissionErrors[keyof DeleteOrganizationUserPermissionErrors]; + +export type DeleteOrganizationUserPermissionResponses = { + /** + * User successfully removed. */ - requestBody: { + 200: SuccessResponse; +}; + +export type DeleteOrganizationUserPermissionResponse = + DeleteOrganizationUserPermissionResponses[keyof DeleteOrganizationUserPermissionResponses]; + +export type RemoveOrganizationUserData = { + body?: never; + path: { /** - * The internal name of the connection. + * The organization's code. */ - name?: string; + org_code: string; /** - * The public-facing name of the connection. + * The user's id. */ - display_name?: string; + user_id: string; + }; + query?: never; + url: "/api/v1/organizations/{org_code}/users/{user_id}"; +}; + +export type RemoveOrganizationUserErrors = { + /** + * Error removing user + */ + 400: ErrorResponse; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; +}; + +export type RemoveOrganizationUserError = + RemoveOrganizationUserErrors[keyof RemoveOrganizationUserErrors]; + +export type RemoveOrganizationUserResponses = { + /** + * User successfully removed from organization + */ + 200: SuccessResponse; +}; + +export type RemoveOrganizationUserResponse = + RemoveOrganizationUserResponses[keyof RemoveOrganizationUserResponses]; + +export type DeleteOrganizationUserApiScopeData = { + body?: never; + path: { /** - * Client IDs of applications in which this connection is to be enabled. + * The identifier for the organization. */ - enabled_applications?: Array; - options?: - | { - /** - * OAuth client ID. - */ - client_id?: string; - /** - * OAuth client secret. - */ - client_secret?: string; - /** - * Use custom domain callback URL. - */ - is_use_custom_domain?: boolean; - /** - * Trust this connection for account merging. - */ - is_trusted?: boolean; - } - | { - /** - * Client ID. - */ - client_id?: string; - /** - * Client secret. - */ - client_secret?: string; - /** - * List of domains to limit authentication. - */ - home_realm_domains?: Array; - /** - * Domain for Entra ID. - */ - entra_id_domain?: string; - /** - * Use https://login.windows.net/common instead of a default endpoint. - */ - is_use_common_endpoint?: boolean; - /** - * Sync user profile data with IDP. - */ - is_sync_user_profile_on_login?: boolean; - /** - * Include user group info from MS Entra ID. - */ - is_retrieve_provider_user_groups?: boolean; - /** - * Include additional user profile information. - */ - is_extended_attributes_required?: boolean; - /** - * Create a user record in Kinde if the user signing in does not exist. - */ - is_create_missing_user?: boolean; - /** - * Force showing the SSO button for this connection. - */ - is_force_show_sso_button?: boolean; - /** - * Additional upstream parameters to pass to the identity provider. - */ - upstream_params?: { - [key: string]: unknown; - }; - /** - * Use custom domain callback URL. - */ - is_use_custom_domain?: boolean; - /** - * Trust this connection for account merging. - */ - is_trusted?: boolean; - } - | { - /** - * List of domains to restrict authentication. - */ - home_realm_domains?: Array; - /** - * SAML Entity ID. - */ - saml_entity_id?: string; - /** - * URL for the IdP metadata. - */ - saml_idp_metadata_url?: string; - /** - * Attribute key for the user's email. - */ - saml_email_key_attr?: string; - /** - * Attribute key for the user's first name. - */ - saml_first_name_key_attr?: string; - /** - * Attribute key for the user's last name. - */ - saml_last_name_key_attr?: string; - /** - * Create user if they don't exist. - */ - is_create_missing_user?: boolean; - /** - * Force showing the SSO button for this connection. - */ - is_force_show_sso_button?: boolean; - /** - * Additional upstream parameters to pass to the identity provider. - */ - upstream_params?: { - [key: string]: unknown; - }; - /** - * Certificate for signing SAML requests. - */ - saml_signing_certificate?: string; - /** - * Private key associated with the signing certificate. - */ - saml_signing_private_key?: string; - /** - * Use custom domain callback URL. - */ - is_use_custom_domain?: boolean; - /** - * Trust this connection for account merging. - */ - is_trusted?: boolean; - }; + org_code: string; + /** + * User ID + */ + user_id: string; + /** + * API ID + */ + api_id: string; + /** + * Scope ID + */ + scope_id: string; + }; + query?: never; + url: "/api/v1/organizations/{org_code}/users/{user_id}/apis/{api_id}/scopes/{scope_id}"; +}; + +export type DeleteOrganizationUserApiScopeErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type DeleteOrganizationUserApiScopeError = + DeleteOrganizationUserApiScopeErrors[keyof DeleteOrganizationUserApiScopeErrors]; + +export type DeleteOrganizationUserApiScopeResponses = { + /** + * Organization user API scope successfully deleted. + */ + 200: unknown; +}; + +export type AddOrganizationUserApiScopeData = { + body?: never; + path: { + /** + * The identifier for the organization. + */ + org_code: string; + /** + * User ID + */ + user_id: string; + /** + * API ID + */ + api_id: string; + /** + * Scope ID + */ + scope_id: string; + }; + query?: never; + url: "/api/v1/organizations/{org_code}/users/{user_id}/apis/{api_id}/scopes/{scope_id}"; +}; + +export type AddOrganizationUserApiScopeErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type AddOrganizationUserApiScopeError = + AddOrganizationUserApiScopeErrors[keyof AddOrganizationUserApiScopeErrors]; + +export type AddOrganizationUserApiScopeResponses = { + /** + * API scope successfully added to organization user api + */ + 200: unknown; +}; + +export type ResetOrgUserMfaAllData = { + body?: never; + path: { + /** + * The identifier for the organization. + */ + org_code: string; + /** + * The identifier for the user + */ + user_id: string; }; + query?: never; + url: "/api/v1/organizations/{org_code}/users/{user_id}/mfa"; +}; + +export type ResetOrgUserMfaAllErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * The specified resource was not found + */ + 404: NotFoundResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; }; -export type ReplaceConnectionResponse = success_response; +export type ResetOrgUserMfaAllError = + ResetOrgUserMfaAllErrors[keyof ResetOrgUserMfaAllErrors]; -export type DeleteConnectionData = { +export type ResetOrgUserMfaAllResponses = { /** - * The identifier for the connection. + * User's MFA successfully reset. */ - connectionId: string; + 200: SuccessResponse; }; -export type DeleteConnectionResponse = success_response; +export type ResetOrgUserMfaAllResponse = + ResetOrgUserMfaAllResponses[keyof ResetOrgUserMfaAllResponses]; -export type GetEnvironmentResponse = get_environment_response; +export type GetOrgUserMfaData = { + body?: never; + path: { + /** + * The identifier for the organization. + */ + org_code: string; + /** + * The identifier for the user + */ + user_id: string; + }; + query?: never; + url: "/api/v1/organizations/{org_code}/users/{user_id}/mfa"; +}; -export type DeleteEnvironementFeatureFlagOverridesResponse = success_response; +export type GetOrgUserMfaErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * The specified resource was not found + */ + 404: NotFoundResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; -export type GetEnvironementFeatureFlagsResponse = - get_environment_feature_flags_response; +export type GetOrgUserMfaError = GetOrgUserMfaErrors[keyof GetOrgUserMfaErrors]; -export type DeleteEnvironementFeatureFlagOverrideData = { +export type GetOrgUserMfaResponses = { /** - * The identifier for the feature flag. + * Successfully retrieve user's MFA configuration. */ - featureFlagKey: string; + 200: GetUserMfaResponse; }; -export type DeleteEnvironementFeatureFlagOverrideResponse = success_response; +export type GetOrgUserMfaResponse = + GetOrgUserMfaResponses[keyof GetOrgUserMfaResponses]; -export type UpdateEnvironementFeatureFlagOverrideData = { +export type ResetOrgUserMfaData = { + body?: never; + path: { + /** + * The identifier for the organization. + */ + org_code: string; + /** + * The identifier for the user + */ + user_id: string; + /** + * The identifier for the MFA factor + */ + factor_id: string; + }; + query?: never; + url: "/api/v1/organizations/{org_code}/users/{user_id}/mfa/{factor_id}"; +}; + +export type ResetOrgUserMfaErrors = { /** - * The identifier for the feature flag. + * Invalid request. */ - featureFlagKey: string; + 400: ErrorResponse; /** - * Flag details. + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * The specified resource was not found + */ + 404: NotFoundResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type ResetOrgUserMfaError = + ResetOrgUserMfaErrors[keyof ResetOrgUserMfaErrors]; + +export type ResetOrgUserMfaResponses = { + /** + * User's MFA successfully reset. */ - requestBody: { + 200: SuccessResponse; +}; + +export type ResetOrgUserMfaResponse = + ResetOrgUserMfaResponses[keyof ResetOrgUserMfaResponses]; + +export type DeleteOrganizationFeatureFlagOverridesData = { + body?: never; + path: { /** - * The flag override value. + * The identifier for the organization. */ - value: string; + org_code: string; }; + query?: never; + url: "/api/v1/organizations/{org_code}/feature_flags"; }; -export type UpdateEnvironementFeatureFlagOverrideResponse = success_response; +export type DeleteOrganizationFeatureFlagOverridesErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; +}; -export type ReadLogoResponse = read_env_logo_response; +export type DeleteOrganizationFeatureFlagOverridesError = + DeleteOrganizationFeatureFlagOverridesErrors[keyof DeleteOrganizationFeatureFlagOverridesErrors]; -export type AddLogoData = { +export type DeleteOrganizationFeatureFlagOverridesResponses = { /** - * Logo details. + * Feature flag overrides successfully deleted. */ - formData: { + 200: SuccessResponse; +}; + +export type DeleteOrganizationFeatureFlagOverridesResponse = + DeleteOrganizationFeatureFlagOverridesResponses[keyof DeleteOrganizationFeatureFlagOverridesResponses]; + +export type GetOrganizationFeatureFlagsData = { + body?: never; + path: { /** - * The logo file to upload. + * The identifier for the organization. */ - logo: Blob | File; + org_code: string; }; + query?: never; + url: "/api/v1/organizations/{org_code}/feature_flags"; +}; + +export type GetOrganizationFeatureFlagsErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Invalid credentials. + */ + 403: unknown; /** - * The type of logo to add. + * Request was throttled. */ - type: "dark" | "light"; + 429: unknown; }; -export type AddLogoResponse = success_response; +export type GetOrganizationFeatureFlagsError = + GetOrganizationFeatureFlagsErrors[keyof GetOrganizationFeatureFlagsErrors]; -export type DeleteLogoData = { +export type GetOrganizationFeatureFlagsResponses = { /** - * The type of logo to delete. + * Feature flag overrides successfully returned. */ - type: "dark" | "light"; + 200: GetOrganizationFeatureFlagsResponse; }; -export type DeleteLogoResponse = success_response | void; +export type GetOrganizationFeatureFlagsResponse2 = + GetOrganizationFeatureFlagsResponses[keyof GetOrganizationFeatureFlagsResponses]; -export type GetEnvironmentVariablesResponse = - get_environment_variables_response; +export type DeleteOrganizationFeatureFlagOverrideData = { + body?: never; + path: { + /** + * The identifier for the organization. + */ + org_code: string; + /** + * The identifier for the feature flag. + */ + feature_flag_key: string; + }; + query?: never; + url: "/api/v1/organizations/{org_code}/feature_flags/{feature_flag_key}"; +}; -export type CreateEnvironmentVariableData = { +export type DeleteOrganizationFeatureFlagOverrideErrors = { /** - * The environment variable details. + * Invalid request. + */ + 400: ErrorResponse; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; +}; + +export type DeleteOrganizationFeatureFlagOverrideError = + DeleteOrganizationFeatureFlagOverrideErrors[keyof DeleteOrganizationFeatureFlagOverrideErrors]; + +export type DeleteOrganizationFeatureFlagOverrideResponses = { + /** + * Feature flag override successfully deleted. */ - requestBody: { + 200: SuccessResponse; +}; + +export type DeleteOrganizationFeatureFlagOverrideResponse = + DeleteOrganizationFeatureFlagOverrideResponses[keyof DeleteOrganizationFeatureFlagOverrideResponses]; + +export type UpdateOrganizationFeatureFlagOverrideData = { + body?: never; + path: { /** - * The name of the environment variable (max 128 characters). + * The identifier for the organization */ - key: string; + org_code: string; /** - * The value of the new environment variable (max 2048 characters). + * The identifier for the feature flag */ - value: string; + feature_flag_key: string; + }; + query: { /** - * Whether the environment variable is sensitive. Secrets are not-readable by you or your team after creation. + * Override value */ - is_secret?: boolean; + value: string; }; + url: "/api/v1/organizations/{org_code}/feature_flags/{feature_flag_key}"; }; -export type CreateEnvironmentVariableResponse = - create_environment_variable_response; - -export type GetEnvironmentVariableData = { +export type UpdateOrganizationFeatureFlagOverrideErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; /** - * The environment variable's ID. + * Invalid credentials. */ - variableId: string; + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; -export type GetEnvironmentVariableResponse = get_environment_variable_response; +export type UpdateOrganizationFeatureFlagOverrideError = + UpdateOrganizationFeatureFlagOverrideErrors[keyof UpdateOrganizationFeatureFlagOverrideErrors]; -export type UpdateEnvironmentVariableData = { +export type UpdateOrganizationFeatureFlagOverrideResponses = { /** - * The new details for the environment variable + * Feature flag override successfully updated. */ - requestBody: { + 200: SuccessResponse; +}; + +export type UpdateOrganizationFeatureFlagOverrideResponse = + UpdateOrganizationFeatureFlagOverrideResponses[keyof UpdateOrganizationFeatureFlagOverrideResponses]; + +export type UpdateOrganizationPropertyData = { + body?: never; + path: { /** - * The key to update. + * The identifier for the organization */ - key?: string; + org_code: string; /** - * The new value for the environment variable. + * The identifier for the property */ - value?: string; + property_key: string; + }; + query: { /** - * Whether the environment variable is sensitive. Secret variables are not-readable by you or your team after creation. + * The new property value */ - is_secret?: boolean; + value: string; }; + url: "/api/v1/organizations/{org_code}/properties/{property_key}"; +}; + +export type UpdateOrganizationPropertyErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; /** - * The environment variable's ID. + * Invalid credentials. */ - variableId: string; + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; -export type UpdateEnvironmentVariableResponse = - update_environment_variable_response; +export type UpdateOrganizationPropertyError = + UpdateOrganizationPropertyErrors[keyof UpdateOrganizationPropertyErrors]; -export type DeleteEnvironmentVariableData = { +export type UpdateOrganizationPropertyResponses = { /** - * The environment variable's ID. + * Property successfully updated. */ - variableId: string; + 200: SuccessResponse; }; -export type DeleteEnvironmentVariableResponse = - delete_environment_variable_response; +export type UpdateOrganizationPropertyResponse = + UpdateOrganizationPropertyResponses[keyof UpdateOrganizationPropertyResponses]; -export type CreateFeatureFlagData = { +export type GetOrganizationPropertyValuesData = { + body?: never; + path: { + /** + * The organization's code. + */ + org_code: string; + }; + query?: never; + url: "/api/v1/organizations/{org_code}/properties"; +}; + +export type GetOrganizationPropertyValuesErrors = { /** - * Flag details. + * Bad request. + */ + 400: ErrorResponse; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; +}; + +export type GetOrganizationPropertyValuesError = + GetOrganizationPropertyValuesErrors[keyof GetOrganizationPropertyValuesErrors]; + +export type GetOrganizationPropertyValuesResponses = { + /** + * Properties successfully retrieved. */ - requestBody: { + 200: GetPropertyValuesResponse; +}; + +export type GetOrganizationPropertyValuesResponse = + GetOrganizationPropertyValuesResponses[keyof GetOrganizationPropertyValuesResponses]; + +export type UpdateOrganizationPropertiesData = { + /** + * Properties to update. + */ + body: { /** - * The name of the flag. + * Property keys and values */ - name: string; + properties: { + [key: string]: unknown; + }; + }; + path: { /** - * Description of the flag purpose. + * The identifier for the organization */ - description?: string; + org_code: string; + }; + query?: never; + url: "/api/v1/organizations/{org_code}/properties"; +}; + +export type UpdateOrganizationPropertiesErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; +}; + +export type UpdateOrganizationPropertiesError = + UpdateOrganizationPropertiesErrors[keyof UpdateOrganizationPropertiesErrors]; + +export type UpdateOrganizationPropertiesResponses = { + /** + * Properties successfully updated. + */ + 200: SuccessResponse; +}; + +export type UpdateOrganizationPropertiesResponse = + UpdateOrganizationPropertiesResponses[keyof UpdateOrganizationPropertiesResponses]; + +export type ReplaceOrganizationMfaData = { + /** + * MFA details. + */ + body: { /** - * The flag identifier to use in code. + * The MFA methods to enable. */ - key: string; + enabled_factors: Array<"mfa:email" | "mfa:sms" | "mfa:authenticator_app">; /** - * The variable type. + * Determines whether recovery codes are shown to users during MFA setup for this specific organization. This overrides the environment-level setting. */ - type: "str" | "int" | "bool"; + is_recovery_codes_enabled?: boolean; + }; + path: { /** - * Allow the flag to be overridden at a different level. + * The identifier for the organization */ - allow_override_level?: "env" | "org" | "usr"; + org_code: string; + }; + query?: never; + url: "/api/v1/organizations/{org_code}/mfa"; +}; + +export type ReplaceOrganizationMfaErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type ReplaceOrganizationMfaError = + ReplaceOrganizationMfaErrors[keyof ReplaceOrganizationMfaErrors]; + +export type ReplaceOrganizationMfaResponses = { + /** + * MFA Configuration updated successfully. + */ + 200: SuccessResponse; +}; + +export type ReplaceOrganizationMfaResponse = + ReplaceOrganizationMfaResponses[keyof ReplaceOrganizationMfaResponses]; + +export type DeleteOrganizationHandleData = { + body?: never; + path: { /** - * Default value for the flag used by environments and organizations. + * The organization's code. */ - default_value: string; + org_code: string; }; + query?: never; + url: "/api/v1/organization/{org_code}/handle"; +}; + +export type DeleteOrganizationHandleErrors = { + /** + * Bad request. + */ + 400: ErrorResponse; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; -export type CreateFeatureFlagResponse = success_response; +export type DeleteOrganizationHandleError = + DeleteOrganizationHandleErrors[keyof DeleteOrganizationHandleErrors]; -export type DeleteFeatureFlagData = { +export type DeleteOrganizationHandleResponses = { + /** + * Handle successfully deleted. + */ + 200: SuccessResponse; +}; + +export type DeleteOrganizationHandleResponse = + DeleteOrganizationHandleResponses[keyof DeleteOrganizationHandleResponses]; + +export type ReadOrganizationLogoData = { + body?: never; + path: { + /** + * The organization's code. + */ + org_code: string; + }; + query?: never; + url: "/api/v1/organizations/{org_code}/logos"; +}; + +export type ReadOrganizationLogoErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type ReadOrganizationLogoError = + ReadOrganizationLogoErrors[keyof ReadOrganizationLogoErrors]; + +export type ReadOrganizationLogoResponses = { + /** + * Successfully retrieved organization logo details + */ + 200: ReadLogoResponse; +}; + +export type ReadOrganizationLogoResponse = + ReadOrganizationLogoResponses[keyof ReadOrganizationLogoResponses]; + +export type DeleteOrganizationLogoData = { + body?: never; + path: { + /** + * The organization's code. + */ + org_code: string; + /** + * The type of logo to delete. + */ + type: "dark" | "light"; + }; + query?: never; + url: "/api/v1/organizations/{org_code}/logos/{type}"; +}; + +export type DeleteOrganizationLogoErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; /** - * The identifier for the feature flag. + * Too many requests. Request was throttled. */ - featureFlagKey: string; + 429: ErrorResponse; }; -export type DeleteFeatureFlagResponse = success_response; +export type DeleteOrganizationLogoError = + DeleteOrganizationLogoErrors[keyof DeleteOrganizationLogoErrors]; -export type UpdateFeatureFlagData = { +export type DeleteOrganizationLogoResponses = { /** - * Allow the flag to be overridden at a different level. + * Organization logo successfully deleted */ - allowOverrideLevel: "env" | "org"; + 200: SuccessResponse; /** - * Default value for the flag used by environments and organizations. + * No logo found to delete */ - defaultValue: string; + 204: void; +}; + +export type DeleteOrganizationLogoResponse = + DeleteOrganizationLogoResponses[keyof DeleteOrganizationLogoResponses]; + +export type AddOrganizationLogoData = { /** - * Description of the flag purpose. + * Organization logo details. */ - description: string; + body: { + /** + * The logo file to upload. + */ + logo: Blob | File; + }; + path: { + /** + * The organization's code. + */ + org_code: string; + /** + * The type of logo to add. + */ + type: "dark" | "light"; + }; + query?: never; + url: "/api/v1/organizations/{org_code}/logos/{type}"; +}; + +export type AddOrganizationLogoErrors = { /** - * The key identifier for the feature flag. + * Invalid request. */ - featureFlagKey: string; + 400: ErrorResponse; /** - * The name of the flag. + * Unauthorized - invalid credentials. */ - name: string; + 403: ErrorResponse; /** - * The variable type + * Too many requests. Request was throttled. */ - type: "str" | "int" | "bool"; + 429: ErrorResponse; }; -export type UpdateFeatureFlagResponse = success_response; +export type AddOrganizationLogoError = + AddOrganizationLogoErrors[keyof AddOrganizationLogoErrors]; -export type GetIdentityData = { +export type AddOrganizationLogoResponses = { /** - * The unique identifier for the identity. + * Organization logo successfully updated */ - identityId: string; + 200: SuccessResponse; }; -export type GetIdentityResponse = identity; +export type AddOrganizationLogoResponse = + AddOrganizationLogoResponses[keyof AddOrganizationLogoResponses]; -export type UpdateIdentityData = { - /** - * The unique identifier for the identity. - */ - identityId: string; - /** - * The fields of the identity to update. - */ - requestBody: { +export type GetOrganizationConnectionsData = { + body?: never; + path: { /** - * Whether the identity is the primary for it's type + * The organization code. */ - is_primary?: boolean; + organization_code: string; }; + query?: never; + url: "/api/v1/organizations/{organization_code}/connections"; }; -export type UpdateIdentityResponse = success_response; - -export type DeleteIdentityData = { +export type GetOrganizationConnectionsErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; /** - * The unique identifier for the identity. + * Too many requests. Request was throttled. */ - identityId: string; + 429: ErrorResponse; }; -export type DeleteIdentityResponse = success_response; - -export type GetIndustriesResponse = get_industries_response; +export type GetOrganizationConnectionsError = + GetOrganizationConnectionsErrors[keyof GetOrganizationConnectionsErrors]; -export type ReplaceMfaData = { +export type GetOrganizationConnectionsResponses = { /** - * MFA details. + * Organization connections successfully retrieved. */ - requestBody: { - /** - * Specifies whether MFA is required, optional, or not enforced. - */ - policy: "required" | "off" | "optional"; + 200: GetConnectionsResponse; +}; + +export type GetOrganizationConnectionsResponse = + GetOrganizationConnectionsResponses[keyof GetOrganizationConnectionsResponses]; + +export type RemoveOrgConnectionData = { + body?: never; + path: { /** - * The MFA methods to enable. + * The unique code for the organization. */ - enabled_factors: Array<"mfa:email" | "mfa:sms" | "mfa:authenticator_app">; + organization_code: string; /** - * Determines whether recovery codes are shown to users during MFA setup for the environment. + * The identifier for the connection. */ - is_recovery_codes_enabled?: boolean; + connection_id: string; }; + query?: never; + url: "/api/v1/organizations/{organization_code}/connections/{connection_id}"; }; -export type ReplaceMfaResponse = success_response; - -export type GetOrganizationData = { +export type RemoveOrgConnectionErrors = { /** - * The organization's code. + * Invalid request. */ - code?: string; + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; /** - * Additional data to include in the response. Allowed value: "billing". + * Too many requests. Request was throttled. */ - expand?: string; + 429: ErrorResponse; }; -export type GetOrganizationResponse = get_organization_response; +export type RemoveOrgConnectionError = + RemoveOrgConnectionErrors[keyof RemoveOrgConnectionErrors]; -export type CreateOrganizationData = { +export type RemoveOrgConnectionResponses = { /** - * Organization details. + * Connection successfully removed. */ - requestBody: { - /** - * The organization's name. - */ - name: string; - /** - * The organization's feature flag settings. - */ - feature_flags?: { - [key: string]: "str" | "int" | "bool"; - }; - /** - * The organization's external identifier - commonly used when migrating from or mapping to other systems. - */ - external_id?: string; - /** - * The organization's brand settings - background color. - */ - background_color?: string; - /** - * The organization's brand settings - button color. - */ - button_color?: string; - /** - * The organization's brand settings - button text color. - */ - button_text_color?: string; - /** - * The organization's brand settings - link color. - */ - link_color?: string; - /** - * The organization's brand settings - dark mode background color. - */ - background_color_dark?: string; - /** - * The organization's brand settings - dark mode button color. - */ - button_color_dark?: string; - /** - * The organization's brand settings - dark mode button text color. - */ - button_text_color_dark?: string; - /** - * The organization's brand settings - dark mode link color. - */ - link_color_dark?: string; - /** - * The organization's brand settings - theme/mode 'light' | 'dark' | 'user_preference'. - */ - theme_code?: string; - /** - * A unique handle for the organization - can be used for dynamic callback urls. - */ - handle?: string; - /** - * Deprecated - Use 'is_auto_membership_enabled' instead. - * @deprecated - */ - is_allow_registrations?: boolean; - /** - * If users become members of this organization when the org code is supplied during authentication. - */ - is_auto_membership_enabled?: boolean; - /** - * The name of the organization that will be used in emails - */ - sender_name?: string | null; - /** - * The email address that will be used in emails. Requires custom SMTP to be set up. - */ - sender_email?: string | null; - /** - * If a billing customer is also created for this organization - */ - is_create_billing_customer?: boolean; + 200: SuccessResponse; +}; + +export type RemoveOrgConnectionResponse = + RemoveOrgConnectionResponses[keyof RemoveOrgConnectionResponses]; + +export type EnableOrgConnectionData = { + body?: never; + path: { /** - * The email address used for billing purposes for the organization + * The unique code for the organization. */ - billing_email?: string; + organization_code: string; /** - * The billing plan to put the customer on. If not specified, the default plan is used + * The identifier for the connection. */ - billing_plan_code?: string; + connection_id: string; }; + query?: never; + url: "/api/v1/organizations/{organization_code}/connections/{connection_id}"; }; -export type CreateOrganizationResponse = create_organization_response; - -export type GetOrganizationsData = { +export type EnableOrgConnectionErrors = { /** - * A string to get the next page of results if there are more results. + * Invalid request. */ - nextToken?: string | null; + 400: ErrorResponse; /** - * Number of results per page. Defaults to 10 if parameter not sent. + * Unauthorized - invalid credentials. */ - pageSize?: number | null; + 403: ErrorResponse; /** - * Field and order to sort the result by. + * Too many requests. Request was throttled. */ - sort?: ("name_asc" | "name_desc" | "email_asc" | "email_desc") | null; + 429: ErrorResponse; }; -export type GetOrganizationsResponse = get_organizations_response; +export type EnableOrgConnectionError = + EnableOrgConnectionErrors[keyof EnableOrgConnectionErrors]; -export type UpdateOrganizationData = { - /** - * Additional data to include in the response. Allowed value: "billing". - */ - expand?: "billing" | null; +export type EnableOrgConnectionResponses = { /** - * The identifier for the organization. + * Connection successfully enabled. */ - orgCode: string; + 200: unknown; +}; + +export type UpdateOrganizationSessionsData = { /** - * Organization details. + * Organization session configuration. */ - requestBody?: { - /** - * The organization's name. - */ - name?: string; - /** - * The organization's ID. - */ - external_id?: string; - /** - * The organization's brand settings - background color. - */ - background_color?: string; - /** - * The organization's brand settings - button color. - */ - button_color?: string; - /** - * The organization's brand settings - button text color. - */ - button_text_color?: string; - /** - * The organization's brand settings - link color. - */ - link_color?: string; - /** - * The organization's brand settings - dark mode background color. - */ - background_color_dark?: string; - /** - * The organization's brand settings - dark mode button color. - */ - button_color_dark?: string; - /** - * The organization's brand settings - dark mode button text color. - */ - button_text_color_dark?: string; - /** - * The organization's brand settings - dark mode link color. - */ - link_color_dark?: string; + body: { /** - * The organization's brand settings - theme/mode. + * Whether to use the organization's SSO session policy override. */ - theme_code?: "light" | "dark" | "user_preference"; + is_use_org_sso_session_policy?: boolean; /** - * The organization's handle. + * Determines if the session should be persistent or not. */ - handle?: string; + sso_session_persistence_mode?: "persistent" | "non_persistent"; /** - * Deprecated - Use 'is_auto_membership_enabled' instead. - * @deprecated + * Whether to apply the organization's authenticated session lifetime override. */ - is_allow_registrations?: boolean; + is_use_org_authenticated_session_lifetime?: boolean; /** - * If users become members of this organization when the org code is supplied during authentication. + * Authenticated session lifetime in seconds. */ - is_auto_membership_enabled?: boolean; + authenticated_session_lifetime?: number; + }; + path: { /** - * Users can sign up to this organization. + * The organization's code. */ - is_auto_join_domain_list?: boolean; + org_code: string; + }; + query?: never; + url: "/api/v1/organizations/{org_code}/sessions"; +}; + +export type UpdateOrganizationSessionsErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type UpdateOrganizationSessionsError = + UpdateOrganizationSessionsErrors[keyof UpdateOrganizationSessionsErrors]; + +export type UpdateOrganizationSessionsResponses = { + /** + * Organization sessions successfully updated + */ + 200: SuccessResponse; +}; + +export type UpdateOrganizationSessionsResponse = + UpdateOrganizationSessionsResponses[keyof UpdateOrganizationSessionsResponses]; + +export type GetPermissionsData = { + body?: never; + path?: never; + query?: { /** - * Domains allowed for self-sign up to this environment. + * Field and order to sort the result by. */ - allowed_domains?: Array; + sort?: "name_asc" | "name_desc" | "id_asc" | "id_desc"; /** - * Activate advanced organization features. + * Number of results per page. Defaults to 10 if parameter not sent. */ - is_enable_advanced_orgs?: boolean; + page_size?: number | null; /** - * Enforce MFA for all users in this organization. + * A string to get the next page of results if there are more results. */ - is_enforce_mfa?: boolean; + next_token?: string | null; + }; + url: "/api/v1/permissions"; +}; + +export type GetPermissionsErrors = { + /** + * Invalid credentials. + */ + 403: ErrorResponse; + /** + * Request was throttled. + */ + 429: unknown; +}; + +export type GetPermissionsError = + GetPermissionsErrors[keyof GetPermissionsErrors]; + +export type GetPermissionsResponses = { + /** + * Permissions successfully retrieved. + */ + 200: GetPermissionsResponse; +}; + +export type GetPermissionsResponse2 = + GetPermissionsResponses[keyof GetPermissionsResponses]; + +export type CreatePermissionData = { + /** + * Permission details. + */ + body?: { /** - * The name of the organization that will be used in emails + * The permission's name. */ - sender_name?: string | null; + name?: string; /** - * The email address that will be used in emails. Requires custom SMTP to be set up. + * The permission's description. */ - sender_email?: string | null; + description?: string; /** - * Whether to suspend or unsuspend the organization. Setting to true suspends the organization; setting to false unsuspends it. The default organization cannot be suspended. + * The permission identifier to use in code. */ - is_suspended?: boolean; + key?: string; }; + path?: never; + query?: never; + url: "/api/v1/permissions"; }; -export type UpdateOrganizationResponse = success_response; - -export type DeleteOrganizationData = { +export type CreatePermissionErrors = { /** - * The identifier for the organization. + * Invalid request. */ - orgCode: string; -}; - -export type DeleteOrganizationResponse = success_response; - -export type GetOrganizationUsersData = { + 400: ErrorResponse; /** - * A string to get the next page of results if there are more results. + * Invalid credentials. */ - nextToken?: string | null; + 403: ErrorResponse; /** - * The organization's code. + * Request was throttled. */ - orgCode: string; + 429: unknown; +}; + +export type CreatePermissionError = + CreatePermissionErrors[keyof CreatePermissionErrors]; + +export type CreatePermissionResponses = { /** - * Number of results per page. Defaults to 10 if parameter not sent. + * Permission successfully created */ - pageSize?: number | null; + 201: SuccessResponse; +}; + +export type CreatePermissionResponse = + CreatePermissionResponses[keyof CreatePermissionResponses]; + +export type DeletePermissionData = { + body?: never; + path: { + /** + * The identifier for the permission. + */ + permission_id: string; + }; + query?: never; + url: "/api/v1/permissions/{permission_id}"; +}; + +export type DeletePermissionErrors = { /** - * Filter by user permissions comma separated (where all match) + * Invalid request. */ - permissions?: string; + 400: ErrorResponse; /** - * Filter by user roles comma separated (where all match) + * Invalid credentials. */ - roles?: string; + 403: unknown; /** - * Field and order to sort the result by. + * Request was throttled. */ - sort?: - | ( - | "name_asc" - | "name_desc" - | "email_asc" - | "email_desc" - | "id_asc" - | "id_desc" - ) - | null; + 429: unknown; }; -export type GetOrganizationUsersResponse = get_organization_users_response; +export type DeletePermissionError = + DeletePermissionErrors[keyof DeletePermissionErrors]; -export type AddOrganizationUsersData = { +export type DeletePermissionResponses = { /** - * The organization's code. + * permission successfully updated. */ - orgCode: string; - requestBody?: { - /** - * Users to be added to the organization. - */ - users?: Array<{ - /** - * The users id. - */ - id?: string; - /** - * Role keys to assign to the user. - */ - roles?: Array; - /** - * Permission keys to assign to the user. - */ - permissions?: Array; - }>; - }; + 200: SuccessResponse; }; -export type AddOrganizationUsersResponse = add_organization_users_response; +export type DeletePermissionResponse = + DeletePermissionResponses[keyof DeletePermissionResponses]; -export type UpdateOrganizationUsersData = { +export type UpdatePermissionsData = { /** - * The organization's code. + * Permission details. */ - orgCode: string; - requestBody?: { + body?: { /** - * Users to add, update or remove from the organization. + * The permission's name. */ - users?: Array<{ - /** - * The users id. - */ - id?: string; - /** - * Optional operation, set to 'delete' to remove the user from the organization. - */ - operation?: string; - /** - * Role keys to assign to the user. - */ - roles?: Array; - /** - * Permission keys to assign to the user. - */ - permissions?: Array; - }>; + name?: string; + /** + * The permission's description. + */ + description?: string; + /** + * The permission identifier to use in code. + */ + key?: string; }; + path: { + /** + * The identifier for the permission. + */ + permission_id: string; + }; + query?: never; + url: "/api/v1/permissions/{permission_id}"; }; -export type UpdateOrganizationUsersResponse = - update_organization_users_response; - -export type GetOrganizationUserRolesData = { +export type UpdatePermissionsErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; /** - * The organization's code. + * Invalid credentials. */ - orgCode: string; + 403: ErrorResponse; /** - * The user's id. + * Request was throttled. */ - userId: string; + 429: unknown; }; -export type GetOrganizationUserRolesResponse = - get_organizations_user_roles_response; +export type UpdatePermissionsError = + UpdatePermissionsErrors[keyof UpdatePermissionsErrors]; -export type CreateOrganizationUserRoleData = { - /** - * The organization's code. - */ - orgCode: string; +export type UpdatePermissionsResponses = { /** - * Role details. + * Permission successfully updated */ - requestBody: { + 200: SuccessResponse; +}; + +export type UpdatePermissionsResponse = + UpdatePermissionsResponses[keyof UpdatePermissionsResponses]; + +export type GetPropertiesData = { + body?: never; + path?: never; + query?: { /** - * The role id. + * Number of results per page. Defaults to 10 if parameter not sent. */ - role_id?: string; + page_size?: number | null; + /** + * The ID of the property to start after. + */ + starting_after?: string | null; + /** + * The ID of the property to end before. + */ + ending_before?: string | null; + /** + * Filter results by user, organization or application context + */ + context?: "usr" | "org" | "app"; }; - /** - * The user's id. - */ - userId: string; + url: "/api/v1/properties"; }; -export type CreateOrganizationUserRoleResponse = success_response; - -export type DeleteOrganizationUserRoleData = { +export type GetPropertiesErrors = { /** - * The organization's code. + * Invalid request. */ - orgCode: string; + 400: ErrorResponse; /** - * The role id. + * Invalid credentials. */ - roleId: string; + 403: ErrorResponse; /** - * The user's id. + * Request was throttled. */ - userId: string; + 429: unknown; }; -export type DeleteOrganizationUserRoleResponse = success_response; +export type GetPropertiesError = GetPropertiesErrors[keyof GetPropertiesErrors]; -export type GetOrganizationUserPermissionsData = { - /** - * Additional data to include in the response. Allowed value: "roles". - */ - expand?: string | null; - /** - * The organization's code. - */ - orgCode: string; +export type GetPropertiesResponses = { /** - * The user's id. + * Properties successfully retrieved. */ - userId: string; + 200: GetPropertiesResponse; }; -export type GetOrganizationUserPermissionsResponse = - get_organizations_user_permissions_response; +export type GetPropertiesResponse2 = + GetPropertiesResponses[keyof GetPropertiesResponses]; -export type CreateOrganizationUserPermissionData = { - /** - * The organization's code. - */ - orgCode: string; +export type CreatePropertyData = { /** - * Permission details. + * Property details. */ - requestBody: { + body: { /** - * The permission id. + * The name of the property. */ - permission_id?: string; + name: string; + /** + * Description of the property purpose. + */ + description?: string; + /** + * The property identifier to use in code. + */ + key: string; + /** + * The property type. + */ + type: "single_line_text" | "multi_line_text"; + /** + * The context that the property applies to. + */ + context: "org" | "usr" | "app"; + /** + * Whether the property can be included in id and access tokens. + */ + is_private: boolean; + /** + * Which category the property belongs to. + */ + category_id: string; }; - /** - * The user's id. - */ - userId: string; + path?: never; + query?: never; + url: "/api/v1/properties"; }; -export type CreateOrganizationUserPermissionResponse = success_response; - -export type DeleteOrganizationUserPermissionData = { +export type CreatePropertyErrors = { /** - * The organization's code. + * Invalid request. */ - orgCode: string; + 400: ErrorResponse; /** - * The permission id. + * Invalid credentials. */ - permissionId: string; + 403: unknown; /** - * The user's id. + * Request was throttled. */ - userId: string; + 429: unknown; }; -export type DeleteOrganizationUserPermissionResponse = success_response; +export type CreatePropertyError = + CreatePropertyErrors[keyof CreatePropertyErrors]; -export type RemoveOrganizationUserData = { - /** - * The organization's code. - */ - orgCode: string; +export type CreatePropertyResponses = { /** - * The user's id. + * Property successfully created */ - userId: string; + 201: CreatePropertyResponse; }; -export type RemoveOrganizationUserResponse = success_response; +export type CreatePropertyResponse2 = + CreatePropertyResponses[keyof CreatePropertyResponses]; -export type AddOrganizationUserApiScopeData = { +export type DeletePropertyData = { + body?: never; + path: { + /** + * The unique identifier for the property. + */ + property_id: string; + }; + query?: never; + url: "/api/v1/properties/{property_id}"; +}; + +export type DeletePropertyErrors = { /** - * API ID + * Invalid request. */ - apiId: string; + 400: ErrorResponse; /** - * The identifier for the organization. + * Invalid credentials. */ - orgCode: string; + 403: unknown; /** - * Scope ID + * Request was throttled. */ - scopeId: string; + 429: unknown; +}; + +export type DeletePropertyError = + DeletePropertyErrors[keyof DeletePropertyErrors]; + +export type DeletePropertyResponses = { /** - * User ID + * Property successfully deleted. */ - userId: string; + 200: SuccessResponse; }; -export type AddOrganizationUserApiScopeResponse = unknown; +export type DeletePropertyResponse = + DeletePropertyResponses[keyof DeletePropertyResponses]; -export type DeleteOrganizationUserApiScopeData = { +export type UpdatePropertyData = { /** - * API ID + * The fields of the property to update. */ - apiId: string; + body: { + /** + * The name of the property. + */ + name: string; + /** + * Description of the property purpose. + */ + description?: string; + /** + * Whether the property can be included in id and access tokens. + */ + is_private: boolean; + /** + * Which category the property belongs to. + */ + category_id: string; + }; + path: { + /** + * The unique identifier for the property. + */ + property_id: string; + }; + query?: never; + url: "/api/v1/properties/{property_id}"; +}; + +export type UpdatePropertyErrors = { /** - * The identifier for the organization. + * Invalid request. */ - orgCode: string; + 400: ErrorResponse; /** - * Scope ID + * Invalid credentials. */ - scopeId: string; + 403: unknown; /** - * User ID + * Request was throttled. */ - userId: string; + 429: unknown; }; -export type DeleteOrganizationUserApiScopeResponse = unknown; +export type UpdatePropertyError = + UpdatePropertyErrors[keyof UpdatePropertyErrors]; -export type GetOrgUserMfaData = { +export type UpdatePropertyResponses = { + /** + * Property successfully updated. + */ + 200: SuccessResponse; +}; + +export type UpdatePropertyResponse = + UpdatePropertyResponses[keyof UpdatePropertyResponses]; + +export type GetCategoriesData = { + body?: never; + path?: never; + query?: { + /** + * Number of results per page. Defaults to 10 if parameter not sent. + */ + page_size?: number | null; + /** + * The ID of the category to start after. + */ + starting_after?: string | null; + /** + * The ID of the category to end before. + */ + ending_before?: string | null; + /** + * Filter the results by User or Organization context + */ + context?: "usr" | "org"; + }; + url: "/api/v1/property_categories"; +}; + +export type GetCategoriesErrors = { /** - * The identifier for the organization. + * Invalid request. */ - orgCode: string; + 400: ErrorResponse; /** - * The identifier for the user + * Invalid credentials. */ - userId: string; + 403: ErrorResponse; + /** + * Request was throttled. + */ + 429: unknown; }; -export type GetOrgUserMfaResponse = get_user_mfa_response; +export type GetCategoriesError = GetCategoriesErrors[keyof GetCategoriesErrors]; -export type ResetOrgUserMfaAllData = { +export type GetCategoriesResponses = { /** - * The identifier for the organization. + * Categories successfully retrieved. */ - orgCode: string; + 200: GetCategoriesResponse; +}; + +export type GetCategoriesResponse2 = + GetCategoriesResponses[keyof GetCategoriesResponses]; + +export type CreateCategoryData = { /** - * The identifier for the user + * Category details. */ - userId: string; + body: { + /** + * The name of the category. + */ + name: string; + /** + * The context that the category applies to. + */ + context: "org" | "usr" | "app"; + }; + path?: never; + query?: never; + url: "/api/v1/property_categories"; }; -export type ResetOrgUserMfaAllResponse = success_response; - -export type ResetOrgUserMfaData = { +export type CreateCategoryErrors = { /** - * The identifier for the MFA factor + * Invalid request. */ - factorId: string; + 400: ErrorResponse; /** - * The identifier for the organization. + * Invalid credentials. */ - orgCode: string; + 403: unknown; /** - * The identifier for the user + * Request was throttled. */ - userId: string; + 429: unknown; }; -export type ResetOrgUserMfaResponse = success_response; +export type CreateCategoryError = + CreateCategoryErrors[keyof CreateCategoryErrors]; -export type GetOrganizationFeatureFlagsData = { +export type CreateCategoryResponses = { /** - * The identifier for the organization. + * Category successfully created */ - orgCode: string; + 201: CreateCategoryResponse; }; -export type GetOrganizationFeatureFlagsResponse = - get_organization_feature_flags_response; +export type CreateCategoryResponse2 = + CreateCategoryResponses[keyof CreateCategoryResponses]; -export type DeleteOrganizationFeatureFlagOverridesData = { +export type UpdateCategoryData = { /** - * The identifier for the organization. + * The fields of the category to update. */ - orgCode: string; + body: { + /** + * The name of the category. + */ + name?: string; + }; + path: { + /** + * The unique identifier for the category. + */ + category_id: string; + }; + query?: never; + url: "/api/v1/property_categories/{category_id}"; }; -export type DeleteOrganizationFeatureFlagOverridesResponse = success_response; - -export type DeleteOrganizationFeatureFlagOverrideData = { +export type UpdateCategoryErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; /** - * The identifier for the feature flag. + * Invalid credentials. */ - featureFlagKey: string; + 403: unknown; /** - * The identifier for the organization. + * Request was throttled. */ - orgCode: string; + 429: unknown; }; -export type DeleteOrganizationFeatureFlagOverrideResponse = success_response; +export type UpdateCategoryError = + UpdateCategoryErrors[keyof UpdateCategoryErrors]; -export type UpdateOrganizationFeatureFlagOverrideData = { - /** - * The identifier for the feature flag - */ - featureFlagKey: string; - /** - * The identifier for the organization - */ - orgCode: string; +export type UpdateCategoryResponses = { /** - * Override value + * category successfully updated. */ - value: string; + 200: SuccessResponse; +}; + +export type UpdateCategoryResponse = + UpdateCategoryResponses[keyof UpdateCategoryResponses]; + +export type GetRolesData = { + body?: never; + path?: never; + query?: { + /** + * Field and order to sort the result by. + */ + sort?: "name_asc" | "name_desc" | "id_asc" | "id_desc"; + /** + * Number of results per page. Defaults to 10 if parameter not sent. + */ + page_size?: number | null; + /** + * A string to get the next page of results if there are more results. + */ + next_token?: string | null; + }; + url: "/api/v1/roles"; }; -export type UpdateOrganizationFeatureFlagOverrideResponse = success_response; - -export type UpdateOrganizationPropertyData = { +export type GetRolesErrors = { /** - * The identifier for the organization + * Invalid request. */ - orgCode: string; + 400: ErrorResponse; /** - * The identifier for the property + * Unauthorized - invalid credentials. */ - propertyKey: string; + 403: ErrorResponse; /** - * The new property value + * Too many requests. Request was throttled. */ - value: string; + 429: ErrorResponse; }; -export type UpdateOrganizationPropertyResponse = success_response; +export type GetRolesError = GetRolesErrors[keyof GetRolesErrors]; -export type GetOrganizationPropertyValuesData = { +export type GetRolesResponses = { /** - * The organization's code. + * Roles successfully retrieved. */ - orgCode: string; + 200: GetRolesResponse; }; -export type GetOrganizationPropertyValuesResponse = - get_property_values_response; +export type GetRolesResponse2 = GetRolesResponses[keyof GetRolesResponses]; -export type UpdateOrganizationPropertiesData = { - /** - * The identifier for the organization - */ - orgCode: string; +export type CreateRoleData = { /** - * Properties to update. + * Role details. */ - requestBody: { + body?: { /** - * Property keys and values + * The role's name. */ - properties: { - [key: string]: unknown; - }; - }; -}; - -export type UpdateOrganizationPropertiesResponse = success_response; - -export type ReplaceOrganizationMfaData = { - /** - * The identifier for the organization - */ - orgCode: string; - /** - * MFA details. - */ - requestBody: { + name?: string; /** - * The MFA methods to enable. + * The role's description. */ - enabled_factors: Array<"mfa:email" | "mfa:sms" | "mfa:authenticator_app">; + description?: string; /** - * Determines whether recovery codes are shown to users during MFA setup for this specific organization. This overrides the environment-level setting. + * The role identifier to use in code. */ - is_recovery_codes_enabled?: boolean; + key?: string; + /** + * Set role as default for new users. + */ + is_default_role?: boolean; + /** + * The public ID of the permission required to assign this role to users. If null, no permission is required. + */ + assignment_permission_id?: string | null; }; + path?: never; + query?: never; + url: "/api/v1/roles"; }; -export type ReplaceOrganizationMfaResponse = success_response; - -export type DeleteOrganizationHandleData = { +export type CreateRoleErrors = { /** - * The organization's code. + * Invalid request. */ - orgCode: string; + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; }; -export type DeleteOrganizationHandleResponse = success_response; +export type CreateRoleError = CreateRoleErrors[keyof CreateRoleErrors]; -export type ReadOrganizationLogoData = { +export type CreateRoleResponses = { /** - * The organization's code. + * Role successfully created */ - orgCode: string; + 201: CreateRolesResponse; }; -export type ReadOrganizationLogoResponse = read_logo_response; +export type CreateRoleResponse = CreateRoleResponses[keyof CreateRoleResponses]; -export type AddOrganizationLogoData = { - /** - * Organization logo details. - */ - formData: { +export type DeleteRoleData = { + body?: never; + path: { /** - * The logo file to upload. + * The identifier for the role. */ - logo: Blob | File; + role_id: string; }; - /** - * The organization's code. - */ - orgCode: string; - /** - * The type of logo to add. - */ - type: "dark" | "light"; + query?: never; + url: "/api/v1/roles/{role_id}"; }; -export type AddOrganizationLogoResponse = success_response; - -export type DeleteOrganizationLogoData = { +export type DeleteRoleErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; /** - * The organization's code. + * Unauthorized - invalid credentials. */ - orgCode: string; + 403: ErrorResponse; /** - * The type of logo to delete. + * Too many requests. Request was throttled. */ - type: "dark" | "light"; + 429: ErrorResponse; }; -export type DeleteOrganizationLogoResponse = success_response | void; +export type DeleteRoleError = DeleteRoleErrors[keyof DeleteRoleErrors]; -export type GetOrganizationConnectionsData = { +export type DeleteRoleResponses = { /** - * The organization code. + * Role successfully deleted. */ - organizationCode: string; + 200: SuccessResponse; }; -export type GetOrganizationConnectionsResponse = get_connections_response; +export type DeleteRoleResponse = DeleteRoleResponses[keyof DeleteRoleResponses]; -export type EnableOrgConnectionData = { +export type GetRoleData = { + body?: never; + path: { + /** + * The identifier for the role. + */ + role_id: string; + }; + query?: never; + url: "/api/v1/roles/{role_id}"; +}; + +export type GetRoleErrors = { /** - * The identifier for the connection. + * Invalid request. */ - connectionId: string; + 400: ErrorResponse; /** - * The unique code for the organization. + * Unauthorized - invalid credentials. */ - organizationCode: string; + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; }; -export type EnableOrgConnectionResponse = unknown; +export type GetRoleError = GetRoleErrors[keyof GetRoleErrors]; -export type RemoveOrgConnectionData = { - /** - * The identifier for the connection. - */ - connectionId: string; +export type GetRoleResponses = { /** - * The unique code for the organization. + * Role successfully retrieved. */ - organizationCode: string; + 200: GetRoleResponse; }; -export type RemoveOrgConnectionResponse = success_response; +export type GetRoleResponse2 = GetRoleResponses[keyof GetRoleResponses]; -export type UpdateOrganizationSessionsData = { - /** - * The organization's code. - */ - orgCode: string; +export type UpdateRolesData = { /** - * Organization session configuration. + * Role details. */ - requestBody: { + body?: { /** - * Whether to use the organization's SSO session policy override. + * The role's name. */ - is_use_org_sso_session_policy?: boolean; + name: string; /** - * Determines if the session should be persistent or not. + * The role's description. */ - sso_session_persistence_mode?: "persistent" | "non_persistent"; + description?: string; /** - * Whether to apply the organization's authenticated session lifetime override. + * The role identifier to use in code. */ - is_use_org_authenticated_session_lifetime?: boolean; + key: string; /** - * Authenticated session lifetime in seconds. + * Set role as default for new users. */ - authenticated_session_lifetime?: number; + is_default_role?: boolean; + /** + * The public ID of the permission required to assign this role to users. If null, no change to the assignment permission is made. If set to 'NO_PERMISSION_REQUIRED', no permission is required. + */ + assignment_permission_id?: string | null; + }; + path: { + /** + * The identifier for the role. + */ + role_id: string; }; + query?: never; + url: "/api/v1/roles/{role_id}"; }; -export type UpdateOrganizationSessionsResponse = success_response; - -export type GetPermissionsData = { +export type UpdateRolesErrors = { /** - * A string to get the next page of results if there are more results. + * Invalid request. */ - nextToken?: string | null; + 400: ErrorResponse; /** - * Number of results per page. Defaults to 10 if parameter not sent. + * Unauthorized - invalid credentials. */ - pageSize?: number | null; + 403: ErrorResponse; /** - * Field and order to sort the result by. + * Too many requests. Request was throttled. */ - sort?: ("name_asc" | "name_desc" | "id_asc" | "id_desc") | null; + 429: ErrorResponse; }; -export type GetPermissionsResponse = get_permissions_response; +export type UpdateRolesError = UpdateRolesErrors[keyof UpdateRolesErrors]; -export type CreatePermissionData = { +export type UpdateRolesResponses = { /** - * Permission details. + * Role successfully updated */ - requestBody?: { - /** - * The permission's name. - */ - name?: string; - /** - * The permission's description. - */ - description?: string; + 201: SuccessResponse; +}; + +export type UpdateRolesResponse = + UpdateRolesResponses[keyof UpdateRolesResponses]; + +export type GetRoleScopesData = { + body?: never; + path: { /** - * The permission identifier to use in code. + * The role id. */ - key?: string; + role_id: string; }; + query?: never; + url: "/api/v1/roles/{role_id}/scopes"; }; -export type CreatePermissionResponse = success_response; - -export type UpdatePermissionsData = { +export type GetRoleScopesErrors = { /** - * The identifier for the permission. + * Error removing user */ - permissionId: string; + 400: ErrorResponse; /** - * Permission details. + * Invalid credentials. */ - requestBody?: { - /** - * The permission's name. - */ - name?: string; - /** - * The permission's description. - */ - description?: string; - /** - * The permission identifier to use in code. - */ - key?: string; - }; + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; -export type UpdatePermissionsResponse = success_response; +export type GetRoleScopesError = GetRoleScopesErrors[keyof GetRoleScopesErrors]; -export type DeletePermissionData = { +export type GetRoleScopesResponses = { /** - * The identifier for the permission. + * A list of scopes for a role */ - permissionId: string; + 200: RoleScopesResponse; }; -export type DeletePermissionResponse = success_response; +export type GetRoleScopesResponse = + GetRoleScopesResponses[keyof GetRoleScopesResponses]; -export type GetPropertiesData = { +export type AddRoleScopeData = { /** - * Filter results by user, organization or application context + * Add scope to role. */ - context?: ("usr" | "org" | "app") | null; + body: { + /** + * The scope identifier. + */ + scope_id: string; + }; + path: { + /** + * The role id. + */ + role_id: string; + }; + query?: never; + url: "/api/v1/roles/{role_id}/scopes"; +}; + +export type AddRoleScopeErrors = { /** - * The ID of the property to end before. + * Invalid request. */ - endingBefore?: string | null; + 400: ErrorResponse; /** - * Number of results per page. Defaults to 10 if parameter not sent. + * Unauthorized - invalid credentials. */ - pageSize?: number | null; + 403: ErrorResponse; /** - * The ID of the property to start after. + * Too many requests. Request was throttled. */ - startingAfter?: string | null; + 429: ErrorResponse; }; -export type GetPropertiesResponse = get_properties_response; +export type AddRoleScopeError = AddRoleScopeErrors[keyof AddRoleScopeErrors]; -export type CreatePropertyData = { +export type AddRoleScopeResponses = { /** - * Property details. + * Role scope successfully added. */ - requestBody: { - /** - * The name of the property. - */ - name: string; - /** - * Description of the property purpose. - */ - description?: string; - /** - * The property identifier to use in code. - */ - key: string; - /** - * The property type. - */ - type: "single_line_text" | "multi_line_text"; - /** - * The context that the property applies to. - */ - context: "org" | "usr" | "app"; + 201: AddRoleScopeResponse; +}; + +export type AddRoleScopeResponse2 = + AddRoleScopeResponses[keyof AddRoleScopeResponses]; + +export type DeleteRoleScopeData = { + body?: never; + path: { /** - * Whether the property can be included in id and access tokens. + * The role id. */ - is_private: boolean; + role_id: string; /** - * Which category the property belongs to. + * The scope id. */ - category_id: string; + scope_id: string; }; + query?: never; + url: "/api/v1/roles/{role_id}/scopes/{scope_id}"; }; -export type CreatePropertyResponse = create_property_response; - -export type UpdatePropertyData = { +export type DeleteRoleScopeErrors = { /** - * The unique identifier for the property. + * Invalid request. */ - propertyId: string; + 400: ErrorResponse; /** - * The fields of the property to update. + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type DeleteRoleScopeError = + DeleteRoleScopeErrors[keyof DeleteRoleScopeErrors]; + +export type DeleteRoleScopeResponses = { + /** + * Role scope successfully deleted. */ - requestBody: { + 200: DeleteRoleScopeResponse; +}; + +export type DeleteRoleScopeResponse2 = + DeleteRoleScopeResponses[keyof DeleteRoleScopeResponses]; + +export type GetRolePermissionsData = { + body?: never; + path: { /** - * The name of the property. + * The role's public id. */ - name: string; + role_id: string; + }; + query?: { /** - * Description of the property purpose. + * Field and order to sort the result by. */ - description?: string; + sort?: "name_asc" | "name_desc" | "id_asc" | "id_desc"; /** - * Whether the property can be included in id and access tokens. + * Number of results per page. Defaults to 10 if parameter not sent. */ - is_private: boolean; + page_size?: number | null; /** - * Which category the property belongs to. + * A string to get the next page of results if there are more results. */ - category_id: string; + next_token?: string | null; }; + url: "/api/v1/roles/{role_id}/permissions"; }; -export type UpdatePropertyResponse = success_response; - -export type DeletePropertyData = { - /** - * The unique identifier for the property. - */ - propertyId: string; -}; - -export type DeletePropertyResponse = success_response; - -export type GetCategoriesData = { - /** - * Filter the results by User or Organization context - */ - context?: ("usr" | "org") | null; +export type GetRolePermissionsErrors = { /** - * The ID of the category to end before. + * Error removing user */ - endingBefore?: string | null; + 400: ErrorResponse; /** - * Number of results per page. Defaults to 10 if parameter not sent. + * Invalid credentials. */ - pageSize?: number | null; + 403: unknown; /** - * The ID of the category to start after. + * Request was throttled. */ - startingAfter?: string | null; + 429: unknown; }; -export type GetCategoriesResponse = get_categories_response; +export type GetRolePermissionsError = + GetRolePermissionsErrors[keyof GetRolePermissionsErrors]; -export type CreateCategoryData = { +export type GetRolePermissionsResponses = { /** - * Category details. + * A list of permissions for a role */ - requestBody: { + 200: RolePermissionsResponse; +}; + +export type GetRolePermissionsResponse = + GetRolePermissionsResponses[keyof GetRolePermissionsResponses]; + +export type UpdateRolePermissionsData = { + body: { /** - * The name of the category. + * Permissions to add or remove from the role. */ - name: string; + permissions?: Array<{ + /** + * The permission id. + */ + id?: string; + /** + * Optional operation, set to 'delete' to remove the permission from the role. + */ + operation?: string; + }>; + }; + path: { /** - * The context that the category applies to. + * The identifier for the role. */ - context: "org" | "usr" | "app"; + role_id: string; }; + query?: never; + url: "/api/v1/roles/{role_id}/permissions"; }; -export type CreateCategoryResponse = create_category_response; - -export type UpdateCategoryData = { +export type UpdateRolePermissionsErrors = { + /** + * Invalid credentials. + */ + 403: ErrorResponse; /** - * The unique identifier for the category. + * Request was throttled. */ - categoryId: string; + 429: unknown; +}; + +export type UpdateRolePermissionsError = + UpdateRolePermissionsErrors[keyof UpdateRolePermissionsErrors]; + +export type UpdateRolePermissionsResponses = { /** - * The fields of the category to update. + * Permissions successfully updated. */ - requestBody: { + 200: UpdateRolePermissionsResponse; +}; + +export type UpdateRolePermissionsResponse2 = + UpdateRolePermissionsResponses[keyof UpdateRolePermissionsResponses]; + +export type RemoveRolePermissionData = { + body?: never; + path: { /** - * The name of the category. + * The role's public id. */ - name?: string; + role_id: string; + /** + * The permission's public id. + */ + permission_id: string; }; + query?: never; + url: "/api/v1/roles/{role_id}/permissions/{permission_id}"; }; -export type UpdateCategoryResponse = success_response; - -export type GetRolesData = { +export type RemoveRolePermissionErrors = { /** - * A string to get the next page of results if there are more results. + * Error removing user */ - nextToken?: string | null; + 400: ErrorResponse; /** - * Number of results per page. Defaults to 10 if parameter not sent. + * Invalid credentials. */ - pageSize?: number | null; + 403: unknown; /** - * Field and order to sort the result by. + * Request was throttled. */ - sort?: ("name_asc" | "name_desc" | "id_asc" | "id_desc") | null; + 429: unknown; }; -export type GetRolesResponse = get_roles_response; +export type RemoveRolePermissionError = + RemoveRolePermissionErrors[keyof RemoveRolePermissionErrors]; -export type CreateRoleData = { +export type RemoveRolePermissionResponses = { /** - * Role details. + * Permission successfully removed from role */ - requestBody?: { + 200: SuccessResponse; +}; + +export type RemoveRolePermissionResponse = + RemoveRolePermissionResponses[keyof RemoveRolePermissionResponses]; + +export type SearchUsersData = { + body?: never; + path?: never; + query?: { /** - * The role's name. + * Number of results per page. Defaults to 10 if parameter not sent. */ - name?: string; + page_size?: number | null; /** - * The role's description. + * Search the users by email or name. Use '*' to search all. */ - description?: string; + query?: string | null; /** - * The role identifier to use in code. + * Search the users by api scopes. */ - key?: string; + api_scopes?: string | null; + properties?: { + [key: string]: Array; + }; /** - * Set role as default for new users. + * The ID of the user to start after. */ - is_default_role?: boolean; + starting_after?: string | null; /** - * The public ID of the permission required to assign this role to users. If null, no permission is required. + * The ID of the user to end before. */ - assignment_permission_id?: string | null; + ending_before?: string | null; + /** + * Additional data to include in the response. One or more of (comma-separated): "organizations", "identities", "properties". + */ + expand?: string | null; }; + url: "/api/v1/search/users"; }; -export type CreateRoleResponse = create_roles_response; - -export type GetRoleData = { +export type SearchUsersErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; /** - * The identifier for the role. + * Too many requests. Request was throttled. */ - roleId: string; + 429: ErrorResponse; }; -export type GetRoleResponse = get_role_response; +export type SearchUsersError = SearchUsersErrors[keyof SearchUsersErrors]; -export type UpdateRolesData = { +export type SearchUsersResponses = { /** - * Role details. + * Users successfully retrieved. */ - requestBody?: { - /** - * The role's name. - */ - name: string; - /** - * The role's description. - */ - description?: string; + 200: SearchUsersResponse; +}; + +export type SearchUsersResponse2 = + SearchUsersResponses[keyof SearchUsersResponses]; + +export type GetSubscribersData = { + body?: never; + path?: never; + query?: { /** - * The role identifier to use in code. + * Field and order to sort the result by. */ - key: string; + sort?: "name_asc" | "name_desc" | "email_asc" | "email_desc"; /** - * Set role as default for new users. + * Number of results per page. Defaults to 10 if parameter not sent. */ - is_default_role?: boolean; + page_size?: number | null; /** - * The public ID of the permission required to assign this role to users. If null, no change to the assignment permission is made. If set to 'NO_PERMISSION_REQUIRED', no permission is required. + * A string to get the next page of results if there are more results. */ - assignment_permission_id?: string | null; + next_token?: string | null; }; - /** - * The identifier for the role. - */ - roleId: string; + url: "/api/v1/subscribers"; }; -export type UpdateRolesResponse = success_response; - -export type DeleteRoleData = { +export type GetSubscribersErrors = { + /** + * Bad request. + */ + 403: ErrorResponse; /** - * The identifier for the role. + * Request was throttled. */ - roleId: string; + 429: unknown; }; -export type DeleteRoleResponse = success_response; +export type GetSubscribersError = + GetSubscribersErrors[keyof GetSubscribersErrors]; -export type GetRoleScopesData = { +export type GetSubscribersResponses = { /** - * The role id. + * Subscriber successfully retrieved. */ - roleId: string; + 200: GetSubscribersResponse; }; -export type GetRoleScopesResponse = role_scopes_response; +export type GetSubscribersResponse2 = + GetSubscribersResponses[keyof GetSubscribersResponses]; -export type AddRoleScopeData = { - /** - * Add scope to role. - */ - requestBody: { +export type CreateSubscriberData = { + body?: never; + path?: never; + query: { /** - * The scope identifier. + * Subscriber's first name. */ - scope_id: string; + first_name: string; + /** + * Subscriber's last name. + */ + last_name: string | null; + /** + * The email address of the subscriber. + */ + email: string | null; }; + url: "/api/v1/subscribers"; +}; + +export type CreateSubscriberErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Invalid credentials. + */ + 403: ErrorResponse; /** - * The role id. + * Request was throttled. */ - roleId: string; + 429: unknown; }; -export type AddRoleScopeResponse = add_role_scope_response; +export type CreateSubscriberError = + CreateSubscriberErrors[keyof CreateSubscriberErrors]; -export type DeleteRoleScopeData = { - /** - * The role id. - */ - roleId: string; +export type CreateSubscriberResponses = { /** - * The scope id. + * Subscriber successfully created */ - scopeId: string; + 201: CreateSubscriberSuccessResponse; }; -export type DeleteRoleScopeResponse = delete_role_scope_response; +export type CreateSubscriberResponse = + CreateSubscriberResponses[keyof CreateSubscriberResponses]; -export type GetRolePermissionsData = { +export type GetSubscriberData = { + body?: never; + path: { + /** + * The subscriber's id. + */ + subscriber_id: string; + }; + query?: never; + url: "/api/v1/subscribers/{subscriber_id}"; +}; + +export type GetSubscriberErrors = { /** - * A string to get the next page of results if there are more results. + * Bad request. */ - nextToken?: string | null; + 400: ErrorResponse; /** - * Number of results per page. Defaults to 10 if parameter not sent. + * Invalid credentials. */ - pageSize?: number | null; + 403: ErrorResponse; /** - * The role's public id. + * Request was throttled. */ - roleId: string; + 429: unknown; +}; + +export type GetSubscriberError = GetSubscriberErrors[keyof GetSubscriberErrors]; + +export type GetSubscriberResponses = { /** - * Field and order to sort the result by. + * Subscriber successfully retrieved. */ - sort?: ("name_asc" | "name_desc" | "id_asc" | "id_desc") | null; + 200: GetSubscriberResponse; }; -export type GetRolePermissionsResponse = role_permissions_response; +export type GetSubscriberResponse2 = + GetSubscriberResponses[keyof GetSubscriberResponses]; -export type UpdateRolePermissionsData = { - requestBody: { +export type GetUsersData = { + body?: never; + path?: never; + query?: { /** - * Permissions to add or remove from the role. + * Number of results per page. Defaults to 10 if parameter not sent. */ - permissions?: Array<{ - /** - * The permission id. - */ - id?: string; - /** - * Optional operation, set to 'delete' to remove the permission from the role. - */ - operation?: string; - }>; + page_size?: number | null; + /** + * Filter the results by User ID. The query string should be comma separated and url encoded. + */ + user_id?: string | null; + /** + * A string to get the next page of results if there are more results. + */ + next_token?: string | null; + /** + * Filter the results by email address. The query string should be comma separated and url encoded. + */ + email?: string | null; + /** + * Filter the results by username. The query string should be comma separated and url encoded. + */ + username?: string | null; + /** + * Filter the results by phone. The query string should be comma separated and url encoded. + */ + phone?: string | null; + /** + * Additional data to include in the response. One or more of (comma-separated): "organizations", "identities", "billing". + */ + expand?: string | null; + /** + * Filter the results by if the user has at least one organization assigned. + */ + has_organization?: boolean | null; + /** + * Filter the results to only include users who have been active since this date. Date should be in ISO 8601 format. + */ + active_since?: string | null; }; - /** - * The identifier for the role. - */ - roleId: string; + url: "/api/v1/users"; }; -export type UpdateRolePermissionsResponse = update_role_permissions_response; - -export type RemoveRolePermissionData = { +export type GetUsersErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; /** - * The permission's public id. + * Unauthorized - invalid credentials. */ - permissionId: string; + 403: ErrorResponse; /** - * The role's public id. + * Too many requests. Request was throttled. */ - roleId: string; + 429: ErrorResponse; }; -export type RemoveRolePermissionResponse = success_response; +export type GetUsersError = GetUsersErrors[keyof GetUsersErrors]; -export type SearchUsersData = { - /** - * Search the users by api scopes. - */ - apiScopes?: string | null; +export type GetUsersResponses = { /** - * The ID of the user to end before. + * Users successfully retrieved. */ - endingBefore?: string | null; - /** - * Additional data to include in the response. One or more of (comma-separated): "organizations", "identities", "properties". - */ - expand?: string | null; + 200: UsersResponse; +}; + +export type GetUsersResponse = GetUsersResponses[keyof GetUsersResponses]; + +export type RefreshUserClaimsData = { + body?: never; + path: { + /** + * The id of the user whose claims needs to be updated. + */ + user_id: string; + }; + query?: never; + url: "/api/v1/users/{user_id}/refresh_claims"; +}; + +export type RefreshUserClaimsErrors = { /** - * Number of results per page. Defaults to 10 if parameter not sent. + * Bad request. */ - pageSize?: number | null; - properties?: { - [key: string]: Array; - }; + 400: ErrorResponse; /** - * Search the users by email or name. Use '*' to search all. + * Bad request. */ - query?: string | null; + 403: ErrorResponse; /** - * The ID of the user to start after. + * Request was throttled. */ - startingAfter?: string | null; + 429: unknown; }; -export type SearchUsersResponse = search_users_response; +export type RefreshUserClaimsError = + RefreshUserClaimsErrors[keyof RefreshUserClaimsErrors]; -export type GetSubscribersData = { - /** - * A string to get the next page of results if there are more results. - */ - nextToken?: string | null; - /** - * Number of results per page. Defaults to 10 if parameter not sent. - */ - pageSize?: number | null; +export type RefreshUserClaimsResponses = { /** - * Field and order to sort the result by. + * Claims successfully refreshed. */ - sort?: ("name_asc" | "name_desc" | "email_asc" | "email_desc") | null; + 200: SuccessResponse; }; -export type GetSubscribersResponse = get_subscribers_response; +export type RefreshUserClaimsResponse = + RefreshUserClaimsResponses[keyof RefreshUserClaimsResponses]; -export type CreateSubscriberData = { +export type DeleteUserData = { + body?: never; + path?: never; + query: { + /** + * The user's id. + */ + id: string; + /** + * Delete all data and remove the user's profile from all of Kinde, including the subscriber list + */ + is_delete_profile?: boolean; + }; + url: "/api/v1/user"; +}; + +export type DeleteUserErrors = { /** - * The email address of the subscriber. + * Invalid request. */ - email: string | null; + 400: ErrorResponse; /** - * Subscriber's first name. + * Unauthorized - invalid credentials. */ - firstName: string; + 403: ErrorResponse; /** - * Subscriber's last name. + * Too many requests. Request was throttled. */ - lastName: string | null; + 429: ErrorResponse; }; -export type CreateSubscriberResponse = create_subscriber_success_response; +export type DeleteUserError = DeleteUserErrors[keyof DeleteUserErrors]; -export type GetSubscriberData = { +export type DeleteUserResponses = { /** - * The subscriber's id. + * User successfully deleted. */ - subscriberId: string; + 200: SuccessResponse; }; -export type GetSubscriberResponse = get_subscriber_response; +export type DeleteUserResponse = DeleteUserResponses[keyof DeleteUserResponses]; -export type GetTimezonesResponse = get_timezones_response; +export type GetUserDataData = { + body?: never; + path?: never; + query: { + /** + * The user's id. + */ + id: string; + /** + * Additional data to include in the response. One or more of (comma-separated): "organizations", "identities", "billing". + */ + expand?: string | null; + }; + url: "/api/v1/user"; +}; -export type GetUsersData = { - /** - * Filter the results to only include users who have been active since this date. Date should be in ISO 8601 format. - */ - activeSince?: string | null; - /** - * Filter the results by email address. The query string should be comma separated and url encoded. - */ - email?: string | null; +export type GetUserDataErrors = { /** - * Additional data to include in the response. One or more of (comma-separated): "organizations", "identities", "billing". + * Invalid request. */ - expand?: string | null; + 400: ErrorResponse; /** - * Filter the results by if the user has at least one organization assigned. + * Unauthorized - invalid credentials. */ - hasOrganization?: boolean | null; + 403: ErrorResponse; /** - * A string to get the next page of results if there are more results. + * Too many requests. Request was throttled. */ - nextToken?: string | null; + 429: ErrorResponse; +}; + +export type GetUserDataError = GetUserDataErrors[keyof GetUserDataErrors]; + +export type GetUserDataResponses = { /** - * Number of results per page. Defaults to 10 if parameter not sent. + * User successfully retrieved. */ - pageSize?: number | null; + 200: User; +}; + +export type GetUserDataResponse = + GetUserDataResponses[keyof GetUserDataResponses]; + +export type UpdateUserData = { /** - * Filter the results by phone. The query string should be comma separated and url encoded. + * The user to update. */ - phone?: string | null; + body: { + /** + * User's first name. + */ + given_name?: string; + /** + * User's last name. + */ + family_name?: string; + /** + * The user's profile picture. + */ + picture?: string; + /** + * Whether the user is currently suspended or not. + */ + is_suspended?: boolean; + /** + * Prompt the user to change their password on next sign in. + */ + is_password_reset_requested?: boolean; + /** + * An external id to reference the user. + */ + provided_id?: string; + }; + path?: never; + query: { + /** + * The user's id. + */ + id: string; + }; + url: "/api/v1/user"; +}; + +export type UpdateUserErrors = { /** - * Filter the results by User ID. The query string should be comma separated and url encoded. + * Invalid request. */ - userId?: string | null; + 400: ErrorResponse; /** - * Filter the results by username. The query string should be comma separated and url encoded. + * Unauthorized - invalid credentials. */ - username?: string | null; -}; - -export type GetUsersResponse = users_response; - -export type RefreshUserClaimsData = { + 403: ErrorResponse; /** - * The id of the user whose claims needs to be updated. + * Too many requests. Request was throttled. */ - userId: string; + 429: ErrorResponse; }; -export type RefreshUserClaimsResponse = success_response; +export type UpdateUserError = UpdateUserErrors[keyof UpdateUserErrors]; -export type GetUserDataData = { - /** - * Additional data to include in the response. One or more of (comma-separated): "organizations", "identities", "billing". - */ - expand?: string | null; +export type UpdateUserResponses = { /** - * The user's id. + * User successfully updated. */ - id: string; + 200: UpdateUserResponse; }; -export type GetUserDataResponse = user; +export type UpdateUserResponse2 = + UpdateUserResponses[keyof UpdateUserResponses]; export type CreateUserData = { /** * The details of the user to create. */ - requestBody?: { + body?: { /** * Basic information required to create a user. */ @@ -5490,109 +9787,181 @@ export type CreateUserData = { }; }>; }; + path?: never; + query?: never; + url: "/api/v1/user"; }; -export type CreateUserResponse = create_user_response; - -export type UpdateUserData = { +export type CreateUserErrors = { /** - * The user's id. + * Invalid request. */ - id: string; + 400: ErrorResponse; /** - * The user to update. + * Unauthorized - invalid credentials. */ - requestBody: { + 403: ErrorResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type CreateUserError = CreateUserErrors[keyof CreateUserErrors]; + +export type CreateUserResponses = { + /** + * User successfully created. + */ + 200: CreateUserResponse; +}; + +export type CreateUserResponse2 = + CreateUserResponses[keyof CreateUserResponses]; + +export type UpdateUserFeatureFlagOverrideData = { + body?: never; + path: { /** - * User's first name. + * The identifier for the user */ - given_name?: string; + user_id: string; /** - * User's last name. + * The identifier for the feature flag */ - family_name?: string; + feature_flag_key: string; + }; + query: { /** - * The user's profile picture. + * Override value */ - picture?: string; + value: string; + }; + url: "/api/v1/users/{user_id}/feature_flags/{feature_flag_key}"; +}; + +export type UpdateUserFeatureFlagOverrideErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; +}; + +export type UpdateUserFeatureFlagOverrideError = + UpdateUserFeatureFlagOverrideErrors[keyof UpdateUserFeatureFlagOverrideErrors]; + +export type UpdateUserFeatureFlagOverrideResponses = { + /** + * Feature flag override successfully updated. + */ + 200: SuccessResponse; +}; + +export type UpdateUserFeatureFlagOverrideResponse = + UpdateUserFeatureFlagOverrideResponses[keyof UpdateUserFeatureFlagOverrideResponses]; + +export type UpdateUserPropertyData = { + body?: never; + path: { /** - * Whether the user is currently suspended or not. + * The identifier for the user */ - is_suspended?: boolean; + user_id: string; /** - * Prompt the user to change their password on next sign in. + * The identifier for the property */ - is_password_reset_requested?: boolean; + property_key: string; + }; + query: { /** - * An external id to reference the user. + * The new property value */ - provided_id?: string; + value: string; }; + url: "/api/v1/users/{user_id}/properties/{property_key}"; }; -export type UpdateUserResponse = update_user_response; - -export type DeleteUserData = { +export type UpdateUserPropertyErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; /** - * The user's id. + * Invalid credentials. */ - id: string; + 403: unknown; /** - * Delete all data and remove the user's profile from all of Kinde, including the subscriber list + * Request was throttled. */ - isDeleteProfile?: boolean; + 429: unknown; }; -export type DeleteUserResponse = success_response; +export type UpdateUserPropertyError = + UpdateUserPropertyErrors[keyof UpdateUserPropertyErrors]; -export type UpdateUserFeatureFlagOverrideData = { - /** - * The identifier for the feature flag - */ - featureFlagKey: string; +export type UpdateUserPropertyResponses = { /** - * The identifier for the user + * Property successfully updated. */ - userId: string; - /** - * Override value - */ - value: string; + 200: SuccessResponse; }; -export type UpdateUserFeatureFlagOverrideResponse = success_response; +export type UpdateUserPropertyResponse = + UpdateUserPropertyResponses[keyof UpdateUserPropertyResponses]; -export type UpdateUserPropertyData = { +export type GetUserPropertyValuesData = { + body?: never; + path: { + /** + * The user's ID. + */ + user_id: string; + }; + query?: never; + url: "/api/v1/users/{user_id}/properties"; +}; + +export type GetUserPropertyValuesErrors = { /** - * The identifier for the property + * Bad request. */ - propertyKey: string; + 400: ErrorResponse; /** - * The identifier for the user + * Invalid credentials. */ - userId: string; + 403: unknown; /** - * The new property value + * Request was throttled. */ - value: string; + 429: unknown; }; -export type UpdateUserPropertyResponse = success_response; +export type GetUserPropertyValuesError = + GetUserPropertyValuesErrors[keyof GetUserPropertyValuesErrors]; -export type GetUserPropertyValuesData = { +export type GetUserPropertyValuesResponses = { /** - * The user's ID. + * Properties successfully retrieved. */ - userId: string; + 200: GetPropertyValuesResponse; }; -export type GetUserPropertyValuesResponse = get_property_values_response; +export type GetUserPropertyValuesResponse = + GetUserPropertyValuesResponses[keyof GetUserPropertyValuesResponses]; export type UpdateUserPropertiesData = { /** * Properties to update. */ - requestBody: { + body: { /** * Property keys and values */ @@ -5600,19 +9969,49 @@ export type UpdateUserPropertiesData = { [key: string]: unknown; }; }; + path: { + /** + * The identifier for the user + */ + user_id: string; + }; + query?: never; + url: "/api/v1/users/{user_id}/properties"; +}; + +export type UpdateUserPropertiesErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; +}; + +export type UpdateUserPropertiesError = + UpdateUserPropertiesErrors[keyof UpdateUserPropertiesErrors]; + +export type UpdateUserPropertiesResponses = { /** - * The identifier for the user + * Properties successfully updated. */ - userId: string; + 200: SuccessResponse; }; -export type UpdateUserPropertiesResponse = success_response; +export type UpdateUserPropertiesResponse = + UpdateUserPropertiesResponses[keyof UpdateUserPropertiesResponses]; export type SetUserPasswordData = { /** * Password details. */ - requestBody: { + body: { /** * The hashed password. */ @@ -5634,36 +10033,98 @@ export type SetUserPasswordData = { */ is_temporary_password?: boolean; }; + path: { + /** + * The identifier for the user + */ + user_id: string; + }; + query?: never; + url: "/api/v1/users/{user_id}/password"; +}; + +export type SetUserPasswordErrors = { + /** + * Error creating user. + */ + 400: ErrorResponse; + /** + * Invalid credentials. + */ + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; +}; + +export type SetUserPasswordError = + SetUserPasswordErrors[keyof SetUserPasswordErrors]; + +export type SetUserPasswordResponses = { /** - * The identifier for the user + * User successfully created. */ - userId: string; + 200: SuccessResponse; }; -export type SetUserPasswordResponse = success_response; +export type SetUserPasswordResponse = + SetUserPasswordResponses[keyof SetUserPasswordResponses]; export type GetUserIdentitiesData = { + body?: never; + path: { + /** + * The user's ID. + */ + user_id: string; + }; + query?: { + /** + * The ID of the identity to start after. + */ + starting_after?: string | null; + /** + * The ID of the identity to end before. + */ + ending_before?: string | null; + }; + url: "/api/v1/users/{user_id}/identities"; +}; + +export type GetUserIdentitiesErrors = { /** - * The ID of the identity to end before. + * Bad request. */ - endingBefore?: string | null; + 400: ErrorResponse; /** - * The ID of the identity to start after. + * Invalid credentials. */ - startingAfter?: string | null; + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; +}; + +export type GetUserIdentitiesError = + GetUserIdentitiesErrors[keyof GetUserIdentitiesErrors]; + +export type GetUserIdentitiesResponses = { /** - * The user's ID. + * Identities successfully retrieved. */ - userId: string; + 200: GetIdentitiesResponse; }; -export type GetUserIdentitiesResponse = get_identities_response; +export type GetUserIdentitiesResponse = + GetUserIdentitiesResponses[keyof GetUserIdentitiesResponses]; export type CreateUserIdentityData = { /** * The identity details. */ - requestBody?: { + body?: { /** * The email address, social identity, or username of the user. */ @@ -5681,88 +10142,382 @@ export type CreateUserIdentityData = { */ connection_id?: string; }; + path: { + /** + * The user's ID. + */ + user_id: string; + }; + query?: never; + url: "/api/v1/users/{user_id}/identities"; +}; + +export type CreateUserIdentityErrors = { + /** + * Error creating identity. + */ + 400: ErrorResponse; /** - * The user's ID. + * Invalid credentials. */ - userId: string; + 403: unknown; + /** + * Request was throttled. + */ + 429: unknown; }; -export type CreateUserIdentityResponse = create_identity_response; +export type CreateUserIdentityError = + CreateUserIdentityErrors[keyof CreateUserIdentityErrors]; -export type GetUserSessionsData = { +export type CreateUserIdentityResponses = { /** - * The identifier for the user + * Identity successfully created. */ - userId: string; + 201: CreateIdentityResponse; }; -export type GetUserSessionsResponse = get_user_sessions_response; +export type CreateUserIdentityResponse = + CreateUserIdentityResponses[keyof CreateUserIdentityResponses]; export type DeleteUserSessionsData = { + body?: never; + path: { + /** + * The identifier for the user + */ + user_id: string; + }; + query?: never; + url: "/api/v1/users/{user_id}/sessions"; +}; + +export type DeleteUserSessionsErrors = { /** - * The identifier for the user + * Invalid request. */ - userId: string; + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * The specified resource was not found + */ + 404: NotFoundResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; }; -export type DeleteUserSessionsResponse = success_response; +export type DeleteUserSessionsError = + DeleteUserSessionsErrors[keyof DeleteUserSessionsErrors]; -export type GetUsersMfaData = { +export type DeleteUserSessionsResponses = { + /** + * User sessions successfully invalidated. + */ + 200: SuccessResponse; +}; + +export type DeleteUserSessionsResponse = + DeleteUserSessionsResponses[keyof DeleteUserSessionsResponses]; + +export type GetUserSessionsData = { + body?: never; + path: { + /** + * The identifier for the user + */ + user_id: string; + }; + query?: never; + url: "/api/v1/users/{user_id}/sessions"; +}; + +export type GetUserSessionsErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * The specified resource was not found + */ + 404: NotFoundResponse; /** - * The identifier for the user + * Too many requests. Request was throttled. */ - userId: string; + 429: ErrorResponse; }; -export type GetUsersMfaResponse = get_user_mfa_response; +export type GetUserSessionsError = + GetUserSessionsErrors[keyof GetUserSessionsErrors]; + +export type GetUserSessionsResponses = { + /** + * Successfully retrieved user sessions. + */ + 200: GetUserSessionsResponse; +}; + +export type GetUserSessionsResponse2 = + GetUserSessionsResponses[keyof GetUserSessionsResponses]; export type ResetUsersMfaAllData = { + body?: never; + path: { + /** + * The identifier for the user + */ + user_id: string; + }; + query?: never; + url: "/api/v1/users/{user_id}/mfa"; +}; + +export type ResetUsersMfaAllErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * The specified resource was not found + */ + 404: NotFoundResponse; /** - * The identifier for the user + * Too many requests. Request was throttled. */ - userId: string; + 429: ErrorResponse; }; -export type ResetUsersMfaAllResponse = success_response; +export type ResetUsersMfaAllError = + ResetUsersMfaAllErrors[keyof ResetUsersMfaAllErrors]; + +export type ResetUsersMfaAllResponses = { + /** + * User's MFA successfully reset. + */ + 200: SuccessResponse; +}; + +export type ResetUsersMfaAllResponse = + ResetUsersMfaAllResponses[keyof ResetUsersMfaAllResponses]; + +export type GetUsersMfaData = { + body?: never; + path: { + /** + * The identifier for the user + */ + user_id: string; + }; + query?: never; + url: "/api/v1/users/{user_id}/mfa"; +}; + +export type GetUsersMfaErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * The specified resource was not found + */ + 404: NotFoundResponse; + /** + * Too many requests. Request was throttled. + */ + 429: ErrorResponse; +}; + +export type GetUsersMfaError = GetUsersMfaErrors[keyof GetUsersMfaErrors]; + +export type GetUsersMfaResponses = { + /** + * Successfully retrieve user's MFA configuration. + */ + 200: GetUserMfaResponse; +}; + +export type GetUsersMfaResponse = + GetUsersMfaResponses[keyof GetUsersMfaResponses]; export type ResetUsersMfaData = { + body?: never; + path: { + /** + * The identifier for the user + */ + user_id: string; + /** + * The identifier for the MFA factor + */ + factor_id: string; + }; + query?: never; + url: "/api/v1/users/{user_id}/mfa/{factor_id}"; +}; + +export type ResetUsersMfaErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Unauthorized - invalid credentials. + */ + 403: ErrorResponse; + /** + * The specified resource was not found + */ + 404: NotFoundResponse; /** - * The identifier for the MFA factor + * Too many requests. Request was throttled. */ - factorId: string; + 429: ErrorResponse; +}; + +export type ResetUsersMfaError = ResetUsersMfaErrors[keyof ResetUsersMfaErrors]; + +export type ResetUsersMfaResponses = { /** - * The identifier for the user + * User's MFA successfully reset. */ - userId: string; + 200: SuccessResponse; }; -export type ResetUsersMfaResponse = success_response; +export type ResetUsersMfaResponse = + ResetUsersMfaResponses[keyof ResetUsersMfaResponses]; export type GetEventData = { + body?: never; + path: { + /** + * The event id. + */ + event_id: string; + }; + query?: never; + url: "/api/v1/events/{event_id}"; +}; + +export type GetEventErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Invalid credentials. + */ + 403: ErrorResponse; + /** + * Request was throttled. + */ + 429: unknown; +}; + +export type GetEventError = GetEventErrors[keyof GetEventErrors]; + +export type GetEventResponses = { + /** + * Event successfully retrieved. + */ + 200: GetEventResponse; +}; + +export type GetEventResponse2 = GetEventResponses[keyof GetEventResponses]; + +export type GetEventTypesData = { + body?: never; + path?: never; + query?: never; + url: "/api/v1/event_types"; +}; + +export type GetEventTypesErrors = { /** - * The event id. + * Invalid request. */ - eventId: string; + 400: ErrorResponse; + /** + * Invalid credentials. + */ + 403: ErrorResponse; + /** + * Request was throttled. + */ + 429: unknown; }; -export type GetEventResponse = get_event_response; +export type GetEventTypesError = GetEventTypesErrors[keyof GetEventTypesErrors]; + +export type GetEventTypesResponses = { + /** + * Event types successfully retrieved. + */ + 200: GetEventTypesResponse; +}; -export type GetEventTypesResponse = get_event_types_response; +export type GetEventTypesResponse2 = + GetEventTypesResponses[keyof GetEventTypesResponses]; export type DeleteWebHookData = { + body?: never; + path: { + /** + * The webhook id. + */ + webhook_id: string; + }; + query?: never; + url: "/api/v1/webhooks/{webhook_id}"; +}; + +export type DeleteWebHookErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Invalid credentials. + */ + 403: ErrorResponse; + /** + * Request was throttled. + */ + 429: unknown; +}; + +export type DeleteWebHookError = DeleteWebHookErrors[keyof DeleteWebHookErrors]; + +export type DeleteWebHookResponses = { /** - * The webhook id. + * Webhook successfully deleted. */ - webhookId: string; + 200: DeleteWebhookResponse; }; -export type DeleteWebHookResponse = delete_webhook_response; +export type DeleteWebHookResponse = + DeleteWebHookResponses[keyof DeleteWebHookResponses]; export type UpdateWebHookData = { /** * Update webhook request specification. */ - requestBody: { + body: { /** * Array of event type keys */ @@ -5776,21 +10531,82 @@ export type UpdateWebHookData = { */ description?: string | null; }; + path: { + /** + * The webhook id. + */ + webhook_id: string; + }; + query?: never; + url: "/api/v1/webhooks/{webhook_id}"; +}; + +export type UpdateWebHookErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Invalid credentials. + */ + 403: ErrorResponse; + /** + * Request was throttled. + */ + 429: unknown; +}; + +export type UpdateWebHookError = UpdateWebHookErrors[keyof UpdateWebHookErrors]; + +export type UpdateWebHookResponses = { + /** + * Webhook successfully updated. + */ + 200: UpdateWebhookResponse; +}; + +export type UpdateWebHookResponse = + UpdateWebHookResponses[keyof UpdateWebHookResponses]; + +export type GetWebHooksData = { + body?: never; + path?: never; + query?: never; + url: "/api/v1/webhooks"; +}; + +export type GetWebHooksErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Invalid credentials. + */ + 403: ErrorResponse; /** - * The webhook id. + * Request was throttled. */ - webhookId: string; + 429: unknown; }; -export type UpdateWebHookResponse = update_webhook_response; +export type GetWebHooksError = GetWebHooksErrors[keyof GetWebHooksErrors]; + +export type GetWebHooksResponses = { + /** + * Webhook list successfully returned. + */ + 200: GetWebhooksResponse; +}; -export type GetWebHooksResponse = get_webhooks_response; +export type GetWebHooksResponse = + GetWebHooksResponses[keyof GetWebHooksResponses]; export type CreateWebHookData = { /** * Webhook request specification. */ - requestBody: { + body: { /** * The webhook endpoint url */ @@ -5808,6 +10624,34 @@ export type CreateWebHookData = { */ description?: string | null; }; + path?: never; + query?: never; + url: "/api/v1/webhooks"; +}; + +export type CreateWebHookErrors = { + /** + * Invalid request. + */ + 400: ErrorResponse; + /** + * Invalid credentials. + */ + 403: ErrorResponse; + /** + * Request was throttled. + */ + 429: unknown; +}; + +export type CreateWebHookError = CreateWebHookErrors[keyof CreateWebHookErrors]; + +export type CreateWebHookResponses = { + /** + * Webhook successfully created. + */ + 200: CreateWebhookResponse; }; -export type CreateWebHookResponse = create_webhook_response; +export type CreateWebHookResponse = + CreateWebHookResponses[keyof CreateWebHookResponses]; diff --git a/lib/config.ts b/lib/config.ts index 529f40a..738f8bf 100644 --- a/lib/config.ts +++ b/lib/config.ts @@ -1,4 +1,4 @@ -import { OpenAPI } from "./api/index"; +import { client } from "./api/client.gen"; import { getToken } from "./utilities/getToken"; export interface TokenStore { @@ -62,11 +62,9 @@ export const init = ( config, ); - _merge(OpenAPI, { - BASE: kindeConfig.kindeDomain, - TOKEN: async () => { - return await getToken(); - }, + client.setConfig({ + baseUrl: kindeConfig.kindeDomain, + auth: async () => await getToken(), }); }; diff --git a/lib/main.test.ts b/lib/main.test.ts index d6407e9..a467d96 100644 --- a/lib/main.test.ts +++ b/lib/main.test.ts @@ -116,7 +116,6 @@ describe("main.ts exports", () => { "$verify_api_key_response", "$webhook", "ApIs", - "ApiError", "ApiKeys", "Apis", "Applications", @@ -125,8 +124,6 @@ describe("main.ts exports", () => { "BillingMeterUsage", "Business", "Callbacks", - "CancelError", - "CancelablePromise", "ConnectedApps", "Connections", "EnvironmentVariables", @@ -135,7 +132,6 @@ describe("main.ts exports", () => { "Identities", "Industries", "Mfa", - "OpenAPI", "Organizations", "Permissions", "Properties", diff --git a/lib/main.ts b/lib/main.ts index 1f1a528..cb972d9 100644 --- a/lib/main.ts +++ b/lib/main.ts @@ -1,4 +1,35 @@ -export * from "./api/index"; +// Schema exports (auto-generated) +export * from "./api/schemas.gen"; + +// SDK class exports (all except Callbacks, which is overridden by the compat layer below) +export { + ApiKeys, + Apis, + Applications, + BillingAgreements, + BillingEntitlements, + BillingMeterUsage, + Business, + ConnectedApps, + Connections, + EnvironmentVariables, + Environments, + FeatureFlags, + Identities, + Industries, + Mfa, + Organizations, + Permissions, + Properties, + PropertyCategories, + Roles, + Search, + Subscribers, + Timezones, + Users, + Webhooks, +} from "./api/sdk.gen"; + import { Apis } from "./api/sdk.gen"; // Import and re-export Callbacks with deprecated methods from compatibility layer export { Callbacks } from "./api/callbacks-compat"; diff --git a/lib/utilities/getToken.ts b/lib/utilities/getToken.ts index 2fa6d3e..8c37ec9 100644 --- a/lib/utilities/getToken.ts +++ b/lib/utilities/getToken.ts @@ -1,7 +1,6 @@ import * as constants from "../constants"; import { setToken } from "./setToken"; import { kindeConfig } from "../config"; -import { OpenAPI } from "../api"; import { LIB_VERSION } from "../version"; import { checkAudience } from "./token/checkAudience"; import { hasTokenExpired } from "./token/hasTokenExpired"; @@ -49,7 +48,7 @@ async function generateM2MToken() { scope: constants.DEFAULT_TOKEN_SCOPES, client_id: kindeConfig.clientId, client_secret: kindeConfig.clientSecret, - audience: OpenAPI.BASE + "/api", + audience: kindeConfig.kindeDomain + "/api", }); const headers = new Headers(); diff --git a/openapi-ts.config.ts b/openapi-ts.config.ts index eaaa23c..b87e68a 100644 --- a/openapi-ts.config.ts +++ b/openapi-ts.config.ts @@ -3,29 +3,26 @@ import { defineConfig } from "@hey-api/openapi-ts"; export default defineConfig({ input: "./spec/kinde-mgmt-api-specs.yaml", output: { - format: "prettier", path: "lib/api", + postProcess: ["prettier"], }, plugins: [ { - // TODO: uncomment after migrating to the new Fetch client - // baseUrl: "https://your_kinde_subdomain.kinde.com", - // exportFromIndex: true, - // name: "@hey-api/client-fetch", - name: "legacy/fetch", + baseUrl: "https://your_kinde_subdomain.kinde.com", + name: "@hey-api/client-fetch", }, { identifierCase: "preserve", name: "@hey-api/typescript", }, { - asClass: true, - classNameBuilder: "{{name}}", name: "@hey-api/sdk", - responseStyle: "data", + operations: { + strategy: "byTags", + }, }, { - exportFromIndex: true, + includeInEntry: true, name: "@hey-api/schemas", nameBuilder: "${{name}}", }, diff --git a/package.json b/package.json index fbfe12b..9695348 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ }, "devDependencies": { "@hey-api/client-fetch": "^0.12.0", - "@hey-api/openapi-ts": "^0.71.1", + "@hey-api/openapi-ts": "^0.96.0", "@types/node": "^24.0.0", "@vitest/coverage-v8": "^4.0.0", "prettier": "^3.2.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6293867..c2fd5b3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,16 +20,16 @@ importers: devDependencies: '@hey-api/client-fetch': specifier: ^0.12.0 - version: 0.12.0(@hey-api/openapi-ts@0.71.1(magicast@0.3.5)(typescript@5.8.3)) + version: 0.12.0(@hey-api/openapi-ts@0.96.1(magicast@0.5.2)(typescript@5.8.3)) '@hey-api/openapi-ts': - specifier: ^0.71.1 - version: 0.71.1(magicast@0.3.5)(typescript@5.8.3) + specifier: ^0.96.0 + version: 0.96.1(magicast@0.5.2)(typescript@5.8.3) '@types/node': specifier: ^24.0.0 version: 24.10.14 '@vitest/coverage-v8': specifier: ^4.0.0 - version: 4.0.18(vitest@4.0.18(@types/node@24.10.14)(jiti@2.6.1)) + version: 4.0.18(vitest@4.0.18(@types/node@24.10.14)(jiti@2.6.1)(yaml@2.8.3)) prettier: specifier: ^3.2.5 version: 3.5.3 @@ -38,16 +38,16 @@ importers: version: 5.8.3 vite: specifier: ^7.3.1 - version: 7.3.1(@types/node@24.10.14)(jiti@2.6.1) + version: 7.3.1(@types/node@24.10.14)(jiti@2.6.1)(yaml@2.8.3) vite-plugin-dts: specifier: ^4.5.4 - version: 4.5.4(@types/node@24.10.14)(rollup@4.57.1)(typescript@5.8.3)(vite@7.3.1(@types/node@24.10.14)(jiti@2.6.1)) + version: 4.5.4(@types/node@24.10.14)(rollup@4.57.1)(typescript@5.8.3)(vite@7.3.1(@types/node@24.10.14)(jiti@2.6.1)(yaml@2.8.3)) vitest: specifier: ^4.0.18 - version: 4.0.18(@types/node@24.10.14)(jiti@2.6.1) + version: 4.0.18(@types/node@24.10.14)(jiti@2.6.1)(yaml@2.8.3) vitest-fetch-mock: specifier: ^0.4.5 - version: 0.4.5(vitest@4.0.18(@types/node@24.10.14)(jiti@2.6.1)) + version: 0.4.5(vitest@4.0.18(@types/node@24.10.14)(jiti@2.6.1)(yaml@2.8.3)) packages: @@ -234,16 +234,30 @@ packages: peerDependencies: '@hey-api/openapi-ts': < 2 - '@hey-api/json-schema-ref-parser@1.0.6': - resolution: {integrity: sha512-yktiFZoWPtEW8QKS65eqKwA5MTKp88CyiL8q72WynrBs/73SAaxlSWlA2zW/DZlywZ5hX1OYzrCC0wFdvO9c2w==} - engines: {node: '>= 16'} + '@hey-api/codegen-core@0.8.0': + resolution: {integrity: sha512-OuF/jenX9wz7AWHRBfb37v+jLkrfCt0FJXQuALNH2UsW6+bdZBmoibHl0K778SiHwneotJbAaEvX2S05wEqUQw==} + engines: {node: '>=22.13.0'} - '@hey-api/openapi-ts@0.71.1': - resolution: {integrity: sha512-LZhHH1CngE2vRgMdZGRI4UrxJ/JHvcsAy4Qjsbiu9BGWyZIraIqWLMsQgqB3TU5yJTrblFo9DA7RI5LIUol0yg==} - engines: {node: ^18.18.0 || ^20.9.0 || >=22.10.0} + '@hey-api/json-schema-ref-parser@1.4.1': + resolution: {integrity: sha512-DoPJGxVApDlktP1yYLjmOrF0YBEqb32ieCbx1S1i09n8TyCgdoh4yQaQ3kp0sMTauH+bwNKPsFh7S8qiWCoKZA==} + engines: {node: '>=22.13.0'} + + '@hey-api/openapi-ts@0.96.1': + resolution: {integrity: sha512-EnH+6ncaVC1yNvYWcsO7MoeBSqCvYZaKvRDRqh+S7dsfb9lhe2mKUR2+7sDacGUBm7VDZZ7hg4q4egxlpZaf0g==} + engines: {node: '>=22.13.0'} hasBin: true peerDependencies: - typescript: ^5.5.3 + typescript: '>=5.5.3 || >=6.0.0 || 6.0.1-rc' + + '@hey-api/shared@0.4.1': + resolution: {integrity: sha512-EDAjvGpEamn2fOB7W87ZStyDSv5mEpnQCciVbiZ+Ll4EfawwIjHMMtDtRQOYol0YjTkAeEm274GFPAtg3xfPGA==} + engines: {node: '>=22.13.0'} + + '@hey-api/spec-types@0.2.0': + resolution: {integrity: sha512-ibQ8Is7evMavzr8GNyJCcTg975d8DpaMUyLmOrQ85UBdy1l6t1KuRAwgChAbesJsIlNV6gjmlXruWyegDX18Fg==} + + '@hey-api/types@0.1.4': + resolution: {integrity: sha512-thWfawrDIP7wSI9ioT13I5soaaqB5vAPIiZmgD8PbeEVKNrkonc0N/Sjj97ezl7oQgusZmaNphGdMKipPO6IBg==} '@isaacs/balanced-match@4.0.1': resolution: {integrity: sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==} @@ -579,9 +593,6 @@ packages: argparse@1.0.10: resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - assertion-error@2.0.1: resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} engines: {node: '>=12'} @@ -599,10 +610,14 @@ packages: brace-expansion@2.0.2: resolution: {integrity: sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==} - c12@2.0.1: - resolution: {integrity: sha512-Z4JgsKXHG37C6PYUtIxCfLJZvo6FyhHJoClwwb9ftUkLpPSkuYqn6Tr+vnaN8hymm0kIbcg6Ey3kv/Q71k5w/A==} + bundle-name@4.1.0: + resolution: {integrity: sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q==} + engines: {node: '>=18'} + + c12@3.3.4: + resolution: {integrity: sha512-cM0ApFQSBXuourJejzwv/AuPRvAxordTyParRVcHjjtXirtkzM0uK2L9TTn9s0cXZbG7E55jCivRQzoxYmRAlA==} peerDependencies: - magicast: ^0.3.5 + magicast: '*' peerDependenciesMeta: magicast: optional: true @@ -611,24 +626,17 @@ packages: resolution: {integrity: sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==} engines: {node: '>=18'} - chokidar@4.0.3: - resolution: {integrity: sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==} - engines: {node: '>= 14.16.0'} - - chownr@2.0.0: - resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} - engines: {node: '>=10'} - - citty@0.1.6: - resolution: {integrity: sha512-tskPPKEs8D2KPafUypv2gxwJP8h/OaJmC82QQGGDQcHvXX43xF2VDACcJVmZ0EuSxkpO9Kc4MlrA3q0+FG58AQ==} + chokidar@5.0.0: + resolution: {integrity: sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==} + engines: {node: '>= 20.19.0'} color-support@1.1.3: resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} hasBin: true - commander@13.0.0: - resolution: {integrity: sha512-oPYleIY8wmTVzkvQq10AEok6YcTC4sRUBl8F9gVuwchGVUCTbl/vhLTaQqutuuySYOsu8YTgV+OxKc/8Yvx+mQ==} - engines: {node: '>=18'} + commander@14.0.3: + resolution: {integrity: sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==} + engines: {node: '>=20'} compare-versions@6.1.1: resolution: {integrity: sha512-4hm4VPpIecmlg59CHXnRDnqGplJFrbLG4aFEl5vl6cK1u76ws3LLvX7ikFnTDl5vo39sjWD6AaDPYodJp/NNHg==} @@ -639,9 +647,9 @@ packages: confbox@0.2.4: resolution: {integrity: sha512-ysOGlgTFbN2/Y6Cg3Iye8YKulHw+R2fNXHrgSmXISQdMnomY6eNDprVdW9R5xBguEqI954+S6709UyiO7B+6OQ==} - consola@3.4.2: - resolution: {integrity: sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==} - engines: {node: ^14.18.0 || >=16.10.0} + cross-spawn@7.0.6: + resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} + engines: {node: '>= 8'} de-indent@1.0.2: resolution: {integrity: sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg==} @@ -655,8 +663,20 @@ packages: supports-color: optional: true - defu@6.1.4: - resolution: {integrity: sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==} + default-browser-id@5.0.1: + resolution: {integrity: sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q==} + engines: {node: '>=18'} + + default-browser@5.5.0: + resolution: {integrity: sha512-H9LMLr5zwIbSxrmvikGuI/5KGhZ8E2zH3stkMgM5LpOWDutGM2JZaj460Udnf1a+946zc7YBgrqEWwbk7zHvGw==} + engines: {node: '>=18'} + + define-lazy-prop@3.0.0: + resolution: {integrity: sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==} + engines: {node: '>=12'} + + defu@6.1.7: + resolution: {integrity: sha512-7z22QmUWiQ/2d0KkdYmANbRUVABpZ9SNYyH5vx6PZ+nE5bcC0l7uFvEfHlyld/HcGBFTL536ClDt3DEcSlEJAQ==} destr@2.0.5: resolution: {integrity: sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA==} @@ -665,10 +685,6 @@ packages: resolution: {integrity: sha512-qejHi7bcSD4hQAZE0tNAawRK1ZtafHDmMTMkrrIGgSLl7hTnQHmKCeB45xAcbfTqK2zowkM3j3bHt/4b/ARbYQ==} engines: {node: '>=0.3.1'} - dotenv@16.6.1: - resolution: {integrity: sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==} - engines: {node: '>=12'} - dotenv@17.3.1: resolution: {integrity: sha512-IO8C/dzEb6O3F9/twg6ZLXz164a2fhTnEWb95H23Dm4OuN+92NmEAlTrupP9VW6Jm3sO26tQlqyvyi4CsnY9GA==} engines: {node: '>=12'} @@ -714,10 +730,6 @@ packages: resolution: {integrity: sha512-VWSRii4t0AFm6ixFFmLLx1t7wS1gh+ckoa84aOeapGum0h+EZd1EhEumSB+ZdDLnEPuucsVB9oB7cxJHap6Afg==} engines: {node: '>=14.14'} - fs-minipass@2.1.0: - resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} - engines: {node: '>= 8'} - fsevents@2.3.3: resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} @@ -726,18 +738,16 @@ packages: function-bind@1.1.2: resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} - giget@1.2.5: - resolution: {integrity: sha512-r1ekGw/Bgpi3HLV3h1MRBIlSAdHoIMklpaQ3OQLFcRw9PwAj2rqigvIbg+dBUI51OxVI2jsEtDywDBjSiuf7Ug==} + get-tsconfig@4.14.0: + resolution: {integrity: sha512-yTb+8DXzDREzgvYmh6s9vHsSVCHeC0G3PI5bEXNBHtmshPnO+S5O7qgLEOn0I5QvMy6kpZN8K1NKGyilLb93wA==} + + giget@3.2.0: + resolution: {integrity: sha512-GvHTWcykIR/fP8cj8dMpuMMkvaeJfPvYnhq0oW+chSeIr+ldX21ifU2Ms6KBoyKZQZmVaUAAhQ2EZ68KJF8a7A==} hasBin: true graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - handlebars@4.7.8: - resolution: {integrity: sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==} - engines: {node: '>=0.4.7'} - hasBin: true - has-flag@4.0.0: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} @@ -761,6 +771,27 @@ packages: resolution: {integrity: sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==} engines: {node: '>= 0.4'} + is-docker@3.0.0: + resolution: {integrity: sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + hasBin: true + + is-in-ssh@1.0.0: + resolution: {integrity: sha512-jYa6Q9rH90kR1vKB6NM7qqd1mge3Fx4Dhw5TVlK1MUBqhEOuCagrEHMevNuCcbECmXZ0ThXkRm+Ymr51HwEPAw==} + engines: {node: '>=20'} + + is-inside-container@1.0.0: + resolution: {integrity: sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==} + engines: {node: '>=14.16'} + hasBin: true + + is-wsl@3.1.1: + resolution: {integrity: sha512-e6rvdUCiQCAuumZslxRJWR/Doq4VpPR82kqclvcS0efgt430SlGIk05vdCN58+VrzgtIcfNODjozVielycD4Sw==} + engines: {node: '>=16'} + + isexe@2.0.0: + resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + istanbul-lib-coverage@3.2.2: resolution: {integrity: sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==} engines: {node: '>=8'} @@ -783,10 +814,6 @@ packages: js-tokens@10.0.0: resolution: {integrity: sha512-lM/UBzQmfJRo9ABXbPWemivdCW8V2G8FHaHdypQaIy523snUjog0W71ayWXTjiR+ixeMyVHN2XcpnTd/liPg/Q==} - js-yaml@4.1.1: - resolution: {integrity: sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==} - hasBin: true - json-schema-traverse@1.0.0: resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} @@ -800,9 +827,6 @@ packages: resolution: {integrity: sha512-arhlxbFRmoQHl33a0Zkle/YWlmNwoyt6QNZEIJcqNbdrsix5Lvc4HyyI3EnwxTYlZYc32EbYrQ8SzEZ7dqgg9A==} engines: {node: '>=14'} - lodash@4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - lodash@4.17.23: resolution: {integrity: sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==} @@ -813,9 +837,6 @@ packages: magic-string@0.30.21: resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} - magicast@0.3.5: - resolution: {integrity: sha512-L0WhttDl+2BOsybvEOLK7fW3UA0OQ0IQ2d6Zl2x/a6vVRs3bAY0ECOSHHeL5jD+SbOpOCUEi0y1DgHEn9Qn1AQ==} - magicast@0.5.2: resolution: {integrity: sha512-E3ZJh4J3S9KfwdjZhe2afj6R9lGIN5Pher1pF39UGrXRqq/VDaGVIGN13BjHd2u8B61hArAGOnso7nBOouW3TQ==} @@ -831,26 +852,6 @@ packages: resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==} engines: {node: '>=16 || 14 >=14.17'} - minimist@1.2.8: - resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} - - minipass@3.3.6: - resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} - engines: {node: '>=8'} - - minipass@5.0.0: - resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} - engines: {node: '>=8'} - - minizlib@2.1.2: - resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} - engines: {node: '>= 8'} - - mkdirp@1.0.4: - resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} - engines: {node: '>=10'} - hasBin: true - mlly@1.7.4: resolution: {integrity: sha512-qmdSIPC4bDJXgZTCR7XosJiNKySV7O215tsPtDN9iEO/7q/76b/ijtgRu/+epFXSJhijtTCCGp3DWS549P3xKw==} @@ -868,37 +869,31 @@ packages: engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true - neo-async@2.6.2: - resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} - - node-fetch-native@1.6.7: - resolution: {integrity: sha512-g9yhqoedzIUm0nTnTqAQvueMPVOuIY16bqgAJJC8XOOubYFNwz6IER9qs0Gq2Xd0+CecCKFjtdDTMA4u4xG06Q==} - - nypm@0.5.4: - resolution: {integrity: sha512-X0SNNrZiGU8/e/zAB7sCTtdxWTMSIO73q+xuKgglm2Yvzwlo8UoC5FNySQFCvl84uPaeADkqHUZUkWy4aH4xOA==} - engines: {node: ^14.16.0 || >=16.10.0} - hasBin: true - obug@2.1.1: resolution: {integrity: sha512-uTqF9MuPraAQ+IsnPf366RG4cP9RtUi7MLO1N3KEc+wb0a6yKpeL0lmk2IB1jY5KHPAlTc6T/JRdC/YqxHNwkQ==} - ohash@1.1.6: - resolution: {integrity: sha512-TBu7PtV8YkAZn0tSxobKY2n2aAQva936lhRrj6957aDaCf9IEtqsKbgMzXE/F/sjqYOwmrukeORHNLe5glk7Cg==} + ohash@2.0.11: + resolution: {integrity: sha512-RdR9FQrFwNBNXAr4GixM8YaRZRJ5PUWbKYbE5eOsrwAjJW0q2REGcf79oYPsLyskQCZG1PLN+S/K1V00joZAoQ==} + + open@11.0.0: + resolution: {integrity: sha512-smsWv2LzFjP03xmvFoJ331ss6h+jixfA4UUV/Bsiyuu4YJPfN+FIQGOIiv4w9/+MoHkfkJ22UIaQWRVFRfH6Vw==} + engines: {node: '>=20'} path-browserify@1.0.1: resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==} + path-key@3.1.1: + resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} + engines: {node: '>=8'} + path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} - pathe@1.1.2: - resolution: {integrity: sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==} - pathe@2.0.3: resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} - perfect-debounce@1.0.0: - resolution: {integrity: sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==} + perfect-debounce@2.1.0: + resolution: {integrity: sha512-LjgdTytVFXeUgtHZr9WYViYSM/g8MkcTPYDlPa3cDqMirHjKiSZPYd6DoL7pK8AJQr+uWkQvCjHNdiMqsrJs+g==} picocolors@1.1.1: resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} @@ -917,6 +912,10 @@ packages: resolution: {integrity: sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==} engines: {node: ^10 || ^12 || >=14} + powershell-utils@0.1.0: + resolution: {integrity: sha512-dM0jVuXJPsDN6DvRpea484tCUaMiXWjuCn++HGTqUWzGDjv5tZkEZldAJ/UMlqRYGFrD/etByo4/xOuC/snX2A==} + engines: {node: '>=20'} + prettier@3.5.3: resolution: {integrity: sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw==} engines: {node: '>=14'} @@ -929,17 +928,20 @@ packages: quansync@0.2.11: resolution: {integrity: sha512-AifT7QEbW9Nri4tAwR5M/uzpBuqfZf+zwaEM/QkzEjj7NBuFD2rBuy0K3dE+8wltbezDV7JMA0WfnCPYRSYbXA==} - rc9@2.1.2: - resolution: {integrity: sha512-btXCnMmRIBINM2LDZoEmOogIZU7Qe7zn4BpomSKZ/ykbLObuBdvG+mFq11DL6fjH1DRwHhrlgtYWG96bJiC7Cg==} + rc9@3.0.1: + resolution: {integrity: sha512-gMDyleLWVE+i6Sgtc0QbbY6pEKqYs97NGi6isHQPqYlLemPoO8dxQ3uGi0f4NiP98c+jMW6cG1Kx9dDwfvqARQ==} - readdirp@4.1.2: - resolution: {integrity: sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==} - engines: {node: '>= 14.18.0'} + readdirp@5.0.0: + resolution: {integrity: sha512-9u/XQ1pvrQtYyMpZe7DXKv2p5CNvyVwzUB6uhLAnQwHMSgKMBR62lc7AHljaeteeHXn11XTAaLLUVZYVZyuRBQ==} + engines: {node: '>= 20.19.0'} require-from-string@2.0.2: resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} engines: {node: '>=0.10.0'} + resolve-pkg-maps@1.0.0: + resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} + resolve@1.22.11: resolution: {integrity: sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==} engines: {node: '>= 0.4'} @@ -950,6 +952,10 @@ packages: engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true + run-applescript@7.1.0: + resolution: {integrity: sha512-DPe5pVFaAsinSaV6QjQ6gdiedWDcRCbUuiQfQa2wmWV7+xC9bGulGI8+TdRmoFkAPaBXk8CrAbnlY2ISniJ47Q==} + engines: {node: '>=18'} + semver@7.5.4: resolution: {integrity: sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==} engines: {node: '>=10'} @@ -960,6 +966,19 @@ packages: engines: {node: '>=10'} hasBin: true + semver@7.7.4: + resolution: {integrity: sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==} + engines: {node: '>=10'} + hasBin: true + + shebang-command@2.0.0: + resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} + engines: {node: '>=8'} + + shebang-regex@3.0.0: + resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} + engines: {node: '>=8'} + siginfo@2.0.0: resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} @@ -1000,17 +1019,9 @@ packages: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} - tar@6.2.1: - resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} - engines: {node: '>=10'} - deprecated: Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me - tinybench@2.9.0: resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} - tinyexec@0.3.2: - resolution: {integrity: sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==} - tinyexec@1.0.2: resolution: {integrity: sha512-W/KYk+NFhkmsYpuHq5JykngiOCnxeVL8v8dFnqxSD8qEEdRfXk1SDM6JzNqcERbcGYj9tMrDQBYV9cjgnunFIg==} engines: {node: '>=18'} @@ -1039,11 +1050,6 @@ packages: ufo@1.6.3: resolution: {integrity: sha512-yDJTmhydvl5lJzBmy/hyOAA0d+aqCBuwl818haVdYCRrWV84o7YyeVm4QlVHStqNrrJSTb6jKuFAVqAFsr+K3Q==} - uglify-js@3.19.3: - resolution: {integrity: sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==} - engines: {node: '>=0.8.0'} - hasBin: true - undici-types@7.16.0: resolution: {integrity: sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==} @@ -1146,17 +1152,28 @@ packages: vscode-uri@3.1.0: resolution: {integrity: sha512-/BpdSx+yCQGnCvecbyXdxHDkuk55/G3xwnC0GqY4gmQ3j+A+g8kzzgB4Nk/SINjqn6+waqw3EgbVF2QKExkRxQ==} + which@2.0.2: + resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} + engines: {node: '>= 8'} + hasBin: true + why-is-node-running@2.3.0: resolution: {integrity: sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==} engines: {node: '>=8'} hasBin: true - wordwrap@1.0.0: - resolution: {integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==} + wsl-utils@0.3.1: + resolution: {integrity: sha512-g/eziiSUNBSsdDJtCLB8bdYEUMj4jR7AGeUo96p/3dTafgjHhpF4RiCFPiRILwjQoDXx5MqkBr4fwWtR3Ky4Wg==} + engines: {node: '>=20'} yallist@4.0.0: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} + yaml@2.8.3: + resolution: {integrity: sha512-AvbaCLOO2Otw/lW5bmh9d/WEdcDFdQp2Z2ZUH3pX9U2ihyUY0nvLv7J6TrWowklRGPYbB/IuIMfYgxaCPg5Bpg==} + engines: {node: '>= 14.6'} + hasBin: true + snapshots: '@babel/helper-string-parser@7.27.1': {} @@ -1252,29 +1269,59 @@ snapshots: '@esbuild/win32-x64@0.27.3': optional: true - '@hey-api/client-fetch@0.12.0(@hey-api/openapi-ts@0.71.1(magicast@0.3.5)(typescript@5.8.3))': + '@hey-api/client-fetch@0.12.0(@hey-api/openapi-ts@0.96.1(magicast@0.5.2)(typescript@5.8.3))': + dependencies: + '@hey-api/openapi-ts': 0.96.1(magicast@0.5.2)(typescript@5.8.3) + + '@hey-api/codegen-core@0.8.0(magicast@0.5.2)': dependencies: - '@hey-api/openapi-ts': 0.71.1(magicast@0.3.5)(typescript@5.8.3) + '@hey-api/types': 0.1.4 + ansi-colors: 4.1.3 + c12: 3.3.4(magicast@0.5.2) + color-support: 1.1.3 + transitivePeerDependencies: + - magicast - '@hey-api/json-schema-ref-parser@1.0.6': + '@hey-api/json-schema-ref-parser@1.4.1': dependencies: '@jsdevtools/ono': 7.1.3 '@types/json-schema': 7.0.15 - js-yaml: 4.1.1 - lodash: 4.17.21 + yaml: 2.8.3 - '@hey-api/openapi-ts@0.71.1(magicast@0.3.5)(typescript@5.8.3)': + '@hey-api/openapi-ts@0.96.1(magicast@0.5.2)(typescript@5.8.3)': dependencies: - '@hey-api/json-schema-ref-parser': 1.0.6 + '@hey-api/codegen-core': 0.8.0(magicast@0.5.2) + '@hey-api/json-schema-ref-parser': 1.4.1 + '@hey-api/shared': 0.4.1(magicast@0.5.2) + '@hey-api/spec-types': 0.2.0 + '@hey-api/types': 0.1.4 ansi-colors: 4.1.3 - c12: 2.0.1(magicast@0.3.5) color-support: 1.1.3 - commander: 13.0.0 - handlebars: 4.7.8 + commander: 14.0.3 + get-tsconfig: 4.14.0 typescript: 5.8.3 transitivePeerDependencies: - magicast + '@hey-api/shared@0.4.1(magicast@0.5.2)': + dependencies: + '@hey-api/codegen-core': 0.8.0(magicast@0.5.2) + '@hey-api/json-schema-ref-parser': 1.4.1 + '@hey-api/spec-types': 0.2.0 + '@hey-api/types': 0.1.4 + ansi-colors: 4.1.3 + cross-spawn: 7.0.6 + open: 11.0.0 + semver: 7.7.4 + transitivePeerDependencies: + - magicast + + '@hey-api/spec-types@0.2.0': + dependencies: + '@hey-api/types': 0.1.4 + + '@hey-api/types@0.1.4': {} + '@isaacs/balanced-match@4.0.1': {} '@isaacs/brace-expansion@5.0.1': @@ -1473,7 +1520,7 @@ snapshots: dependencies: undici-types: 7.16.0 - '@vitest/coverage-v8@4.0.18(vitest@4.0.18(@types/node@24.10.14)(jiti@2.6.1))': + '@vitest/coverage-v8@4.0.18(vitest@4.0.18(@types/node@24.10.14)(jiti@2.6.1)(yaml@2.8.3))': dependencies: '@bcoe/v8-coverage': 1.0.2 '@vitest/utils': 4.0.18 @@ -1485,7 +1532,7 @@ snapshots: obug: 2.1.1 std-env: 3.10.0 tinyrainbow: 3.0.3 - vitest: 4.0.18(@types/node@24.10.14)(jiti@2.6.1) + vitest: 4.0.18(@types/node@24.10.14)(jiti@2.6.1)(yaml@2.8.3) '@vitest/expect@4.0.18': dependencies: @@ -1496,13 +1543,13 @@ snapshots: chai: 6.2.2 tinyrainbow: 3.0.3 - '@vitest/mocker@4.0.18(vite@7.3.1(@types/node@24.10.14)(jiti@2.6.1))': + '@vitest/mocker@4.0.18(vite@7.3.1(@types/node@24.10.14)(jiti@2.6.1)(yaml@2.8.3))': dependencies: '@vitest/spy': 4.0.18 estree-walker: 3.0.3 magic-string: 0.30.21 optionalDependencies: - vite: 7.3.1(@types/node@24.10.14)(jiti@2.6.1) + vite: 7.3.1(@types/node@24.10.14)(jiti@2.6.1)(yaml@2.8.3) '@vitest/pretty-format@4.0.18': dependencies: @@ -1605,8 +1652,6 @@ snapshots: dependencies: sprintf-js: 1.0.3 - argparse@2.0.1: {} - assertion-error@2.0.1: {} ast-v8-to-istanbul@0.3.11: @@ -1623,38 +1668,36 @@ snapshots: dependencies: balanced-match: 1.0.2 - c12@2.0.1(magicast@0.3.5): + bundle-name@4.1.0: dependencies: - chokidar: 4.0.3 - confbox: 0.1.8 - defu: 6.1.4 - dotenv: 16.6.1 - giget: 1.2.5 + run-applescript: 7.1.0 + + c12@3.3.4(magicast@0.5.2): + dependencies: + chokidar: 5.0.0 + confbox: 0.2.4 + defu: 6.1.7 + dotenv: 17.3.1 + exsolve: 1.0.8 + giget: 3.2.0 jiti: 2.6.1 - mlly: 1.7.4 - ohash: 1.1.6 - pathe: 1.1.2 - perfect-debounce: 1.0.0 - pkg-types: 1.3.1 - rc9: 2.1.2 + ohash: 2.0.11 + pathe: 2.0.3 + perfect-debounce: 2.1.0 + pkg-types: 2.3.0 + rc9: 3.0.1 optionalDependencies: - magicast: 0.3.5 + magicast: 0.5.2 chai@6.2.2: {} - chokidar@4.0.3: + chokidar@5.0.0: dependencies: - readdirp: 4.1.2 - - chownr@2.0.0: {} - - citty@0.1.6: - dependencies: - consola: 3.4.2 + readdirp: 5.0.0 color-support@1.1.3: {} - commander@13.0.0: {} + commander@14.0.3: {} compare-versions@6.1.1: {} @@ -1662,7 +1705,11 @@ snapshots: confbox@0.2.4: {} - consola@3.4.2: {} + cross-spawn@7.0.6: + dependencies: + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 de-indent@1.0.2: {} @@ -1670,14 +1717,21 @@ snapshots: dependencies: ms: 2.1.3 - defu@6.1.4: {} + default-browser-id@5.0.1: {} + + default-browser@5.5.0: + dependencies: + bundle-name: 4.1.0 + default-browser-id: 5.0.1 + + define-lazy-prop@3.0.0: {} + + defu@6.1.7: {} destr@2.0.5: {} diff@8.0.3: {} - dotenv@16.6.1: {} - dotenv@17.3.1: {} entities@7.0.1: {} @@ -1735,35 +1789,18 @@ snapshots: jsonfile: 6.2.0 universalify: 2.0.1 - fs-minipass@2.1.0: - dependencies: - minipass: 3.3.6 - fsevents@2.3.3: optional: true function-bind@1.1.2: {} - giget@1.2.5: + get-tsconfig@4.14.0: dependencies: - citty: 0.1.6 - consola: 3.4.2 - defu: 6.1.4 - node-fetch-native: 1.6.7 - nypm: 0.5.4 - pathe: 2.0.3 - tar: 6.2.1 + resolve-pkg-maps: 1.0.0 - graceful-fs@4.2.11: {} + giget@3.2.0: {} - handlebars@4.7.8: - dependencies: - minimist: 1.2.8 - neo-async: 2.6.2 - source-map: 0.6.1 - wordwrap: 1.0.0 - optionalDependencies: - uglify-js: 3.19.3 + graceful-fs@4.2.11: {} has-flag@4.0.0: {} @@ -1781,6 +1818,20 @@ snapshots: dependencies: hasown: 2.0.2 + is-docker@3.0.0: {} + + is-in-ssh@1.0.0: {} + + is-inside-container@1.0.0: + dependencies: + is-docker: 3.0.0 + + is-wsl@3.1.1: + dependencies: + is-inside-container: 1.0.0 + + isexe@2.0.0: {} + istanbul-lib-coverage@3.2.2: {} istanbul-lib-report@3.0.1: @@ -1800,10 +1851,6 @@ snapshots: js-tokens@10.0.0: {} - js-yaml@4.1.1: - dependencies: - argparse: 2.0.1 - json-schema-traverse@1.0.0: {} jsonfile@6.2.0: @@ -1820,8 +1867,6 @@ snapshots: pkg-types: 2.3.0 quansync: 0.2.11 - lodash@4.17.21: {} - lodash@4.17.23: {} lru-cache@6.0.0: @@ -1832,13 +1877,6 @@ snapshots: dependencies: '@jridgewell/sourcemap-codec': 1.5.5 - magicast@0.3.5: - dependencies: - '@babel/parser': 7.29.0 - '@babel/types': 7.29.0 - source-map-js: 1.2.1 - optional: true - magicast@0.5.2: dependencies: '@babel/parser': 7.29.0 @@ -1857,21 +1895,6 @@ snapshots: dependencies: brace-expansion: 2.0.2 - minimist@1.2.8: {} - - minipass@3.3.6: - dependencies: - yallist: 4.0.0 - - minipass@5.0.0: {} - - minizlib@2.1.2: - dependencies: - minipass: 3.3.6 - yallist: 4.0.0 - - mkdirp@1.0.4: {} - mlly@1.7.4: dependencies: acorn: 8.14.1 @@ -1892,32 +1915,28 @@ snapshots: nanoid@3.3.11: {} - neo-async@2.6.2: {} + obug@2.1.1: {} - node-fetch-native@1.6.7: {} + ohash@2.0.11: {} - nypm@0.5.4: + open@11.0.0: dependencies: - citty: 0.1.6 - consola: 3.4.2 - pathe: 2.0.3 - pkg-types: 1.3.1 - tinyexec: 0.3.2 - ufo: 1.6.1 - - obug@2.1.1: {} - - ohash@1.1.6: {} + default-browser: 5.5.0 + define-lazy-prop: 3.0.0 + is-in-ssh: 1.0.0 + is-inside-container: 1.0.0 + powershell-utils: 0.1.0 + wsl-utils: 0.3.1 path-browserify@1.0.1: {} - path-parse@1.0.7: {} + path-key@3.1.1: {} - pathe@1.1.2: {} + path-parse@1.0.7: {} pathe@2.0.3: {} - perfect-debounce@1.0.0: {} + perfect-debounce@2.1.0: {} picocolors@1.1.1: {} @@ -1941,21 +1960,25 @@ snapshots: picocolors: 1.1.1 source-map-js: 1.2.1 + powershell-utils@0.1.0: {} + prettier@3.5.3: {} punycode@2.3.1: {} quansync@0.2.11: {} - rc9@2.1.2: + rc9@3.0.1: dependencies: - defu: 6.1.4 + defu: 6.1.7 destr: 2.0.5 - readdirp@4.1.2: {} + readdirp@5.0.0: {} require-from-string@2.0.2: {} + resolve-pkg-maps@1.0.0: {} + resolve@1.22.11: dependencies: is-core-module: 2.16.1 @@ -1993,12 +2016,22 @@ snapshots: '@rollup/rollup-win32-x64-msvc': 4.57.1 fsevents: 2.3.3 + run-applescript@7.1.0: {} + semver@7.5.4: dependencies: lru-cache: 6.0.0 semver@7.7.1: {} + semver@7.7.4: {} + + shebang-command@2.0.0: + dependencies: + shebang-regex: 3.0.0 + + shebang-regex@3.0.0: {} + siginfo@2.0.0: {} source-map-js@1.2.1: {} @@ -2025,19 +2058,8 @@ snapshots: supports-preserve-symlinks-flag@1.0.0: {} - tar@6.2.1: - dependencies: - chownr: 2.0.0 - fs-minipass: 2.1.0 - minipass: 5.0.0 - minizlib: 2.1.2 - mkdirp: 1.0.4 - yallist: 4.0.0 - tinybench@2.9.0: {} - tinyexec@0.3.2: {} - tinyexec@1.0.2: {} tinyglobby@0.2.15: @@ -2055,9 +2077,6 @@ snapshots: ufo@1.6.3: {} - uglify-js@3.19.3: - optional: true - undici-types@7.16.0: {} universalify@2.0.1: {} @@ -2066,7 +2085,7 @@ snapshots: dependencies: punycode: 2.3.1 - vite-plugin-dts@4.5.4(@types/node@24.10.14)(rollup@4.57.1)(typescript@5.8.3)(vite@7.3.1(@types/node@24.10.14)(jiti@2.6.1)): + vite-plugin-dts@4.5.4(@types/node@24.10.14)(rollup@4.57.1)(typescript@5.8.3)(vite@7.3.1(@types/node@24.10.14)(jiti@2.6.1)(yaml@2.8.3)): dependencies: '@microsoft/api-extractor': 7.56.3(@types/node@24.10.14) '@rollup/pluginutils': 5.3.0(rollup@4.57.1) @@ -2079,13 +2098,13 @@ snapshots: magic-string: 0.30.21 typescript: 5.8.3 optionalDependencies: - vite: 7.3.1(@types/node@24.10.14)(jiti@2.6.1) + vite: 7.3.1(@types/node@24.10.14)(jiti@2.6.1)(yaml@2.8.3) transitivePeerDependencies: - '@types/node' - rollup - supports-color - vite@7.3.1(@types/node@24.10.14)(jiti@2.6.1): + vite@7.3.1(@types/node@24.10.14)(jiti@2.6.1)(yaml@2.8.3): dependencies: esbuild: 0.27.3 fdir: 6.5.0(picomatch@4.0.3) @@ -2097,15 +2116,16 @@ snapshots: '@types/node': 24.10.14 fsevents: 2.3.3 jiti: 2.6.1 + yaml: 2.8.3 - vitest-fetch-mock@0.4.5(vitest@4.0.18(@types/node@24.10.14)(jiti@2.6.1)): + vitest-fetch-mock@0.4.5(vitest@4.0.18(@types/node@24.10.14)(jiti@2.6.1)(yaml@2.8.3)): dependencies: - vitest: 4.0.18(@types/node@24.10.14)(jiti@2.6.1) + vitest: 4.0.18(@types/node@24.10.14)(jiti@2.6.1)(yaml@2.8.3) - vitest@4.0.18(@types/node@24.10.14)(jiti@2.6.1): + vitest@4.0.18(@types/node@24.10.14)(jiti@2.6.1)(yaml@2.8.3): dependencies: '@vitest/expect': 4.0.18 - '@vitest/mocker': 4.0.18(vite@7.3.1(@types/node@24.10.14)(jiti@2.6.1)) + '@vitest/mocker': 4.0.18(vite@7.3.1(@types/node@24.10.14)(jiti@2.6.1)(yaml@2.8.3)) '@vitest/pretty-format': 4.0.18 '@vitest/runner': 4.0.18 '@vitest/snapshot': 4.0.18 @@ -2122,7 +2142,7 @@ snapshots: tinyexec: 1.0.2 tinyglobby: 0.2.15 tinyrainbow: 3.0.3 - vite: 7.3.1(@types/node@24.10.14)(jiti@2.6.1) + vite: 7.3.1(@types/node@24.10.14)(jiti@2.6.1)(yaml@2.8.3) why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 24.10.14 @@ -2141,11 +2161,20 @@ snapshots: vscode-uri@3.1.0: {} + which@2.0.2: + dependencies: + isexe: 2.0.0 + why-is-node-running@2.3.0: dependencies: siginfo: 2.0.0 stackback: 0.0.2 - wordwrap@1.0.0: {} + wsl-utils@0.3.1: + dependencies: + is-wsl: 3.1.1 + powershell-utils: 0.1.0 yallist@4.0.0: {} + + yaml@2.8.3: {} diff --git a/tests/regressions.test.ts b/tests/regressions.test.ts index 28ea583..b25d591 100644 --- a/tests/regressions.test.ts +++ b/tests/regressions.test.ts @@ -93,7 +93,7 @@ describe("Breaking Changes and Regressions", () => { }), ); - const data: GetCallbackUrlsData = { appId: "test-app-id" }; + const data: GetCallbackUrlsData = { path: { app_id: "test-app-id" } }; const result = await Callbacks.getCallbackUrls(data); expect(result).toBeDefined(); }); @@ -106,7 +106,7 @@ describe("Breaking Changes and Regressions", () => { }), ); - const data: GetCallbackUrlsData = { appId: "test-app-id" }; + const data: GetCallbackUrlsData = { path: { app_id: "test-app-id" } }; const result = await Callbacks.getCallbackUrLs(data); expect(result).toBeDefined(); }); @@ -133,8 +133,8 @@ describe("Breaking Changes and Regressions", () => { ); const result = await Callbacks.addRedirectCallbackUrls({ - appId: "test-app-id", - requestBody: { urls: ["https://example.com/callback"] }, + path: { app_id: "test-app-id" }, + body: { urls: ["https://example.com/callback"] }, }); expect(result).toBeDefined(); }); @@ -149,8 +149,8 @@ describe("Breaking Changes and Regressions", () => { ); const result = await Callbacks.addRedirectCallbackUrLs({ - appId: "test-app-id", - requestBody: { urls: ["https://example.com/callback"] }, + path: { app_id: "test-app-id" }, + body: { urls: ["https://example.com/callback"] }, }); expect(result).toBeDefined(); }); @@ -177,8 +177,8 @@ describe("Breaking Changes and Regressions", () => { ); const result = await Callbacks.replaceRedirectCallbackUrls({ - appId: "test-app-id", - requestBody: { urls: ["https://example.com/callback"] }, + path: { app_id: "test-app-id" }, + body: { urls: ["https://example.com/callback"] }, }); expect(result).toBeDefined(); }); @@ -193,8 +193,8 @@ describe("Breaking Changes and Regressions", () => { ); const result = await Callbacks.replaceRedirectCallbackUrLs({ - appId: "test-app-id", - requestBody: { urls: ["https://example.com/callback"] }, + path: { app_id: "test-app-id" }, + body: { urls: ["https://example.com/callback"] }, }); expect(result).toBeDefined(); }); @@ -221,8 +221,8 @@ describe("Breaking Changes and Regressions", () => { ); const result = await Callbacks.deleteCallbackUrls({ - appId: "test-app-id", - urls: "https://example.com/callback", + path: { app_id: "test-app-id" }, + query: { urls: "https://example.com/callback" }, }); expect(result).toBeDefined(); }); @@ -237,8 +237,8 @@ describe("Breaking Changes and Regressions", () => { ); const result = await Callbacks.deleteCallbackUrLs({ - appId: "test-app-id", - urls: "https://example.com/callback", + path: { app_id: "test-app-id" }, + query: { urls: "https://example.com/callback" }, }); expect(result).toBeDefined(); }); @@ -263,7 +263,7 @@ describe("Breaking Changes and Regressions", () => { }), ); - const data: GetLogoutUrlsData = { appId: "test-app-id" }; + const data: GetLogoutUrlsData = { path: { app_id: "test-app-id" } }; const result = await Callbacks.getLogoutUrls(data); expect(result).toBeDefined(); }); @@ -276,7 +276,7 @@ describe("Breaking Changes and Regressions", () => { }), ); - const data: GetLogoutUrlsData = { appId: "test-app-id" }; + const data: GetLogoutUrlsData = { path: { app_id: "test-app-id" } }; const result = await Callbacks.getLogoutUrLs(data); expect(result).toBeDefined(); }); @@ -303,8 +303,8 @@ describe("Breaking Changes and Regressions", () => { ); const result = await Callbacks.addLogoutRedirectUrls({ - appId: "test-app-id", - requestBody: { urls: ["https://example.com/logout"] }, + path: { app_id: "test-app-id" }, + body: { urls: ["https://example.com/logout"] }, }); expect(result).toBeDefined(); }); @@ -319,8 +319,8 @@ describe("Breaking Changes and Regressions", () => { ); const result = await Callbacks.addLogoutRedirectUrLs({ - appId: "test-app-id", - requestBody: { urls: ["https://example.com/logout"] }, + path: { app_id: "test-app-id" }, + body: { urls: ["https://example.com/logout"] }, }); expect(result).toBeDefined(); }); @@ -347,8 +347,8 @@ describe("Breaking Changes and Regressions", () => { ); const result = await Callbacks.replaceLogoutRedirectUrls({ - appId: "test-app-id", - requestBody: { urls: ["https://example.com/logout"] }, + path: { app_id: "test-app-id" }, + body: { urls: ["https://example.com/logout"] }, }); expect(result).toBeDefined(); }); @@ -363,8 +363,8 @@ describe("Breaking Changes and Regressions", () => { ); const result = await Callbacks.replaceLogoutRedirectUrLs({ - appId: "test-app-id", - requestBody: { urls: ["https://example.com/logout"] }, + path: { app_id: "test-app-id" }, + body: { urls: ["https://example.com/logout"] }, }); expect(result).toBeDefined(); }); @@ -391,8 +391,8 @@ describe("Breaking Changes and Regressions", () => { ); const result = await Callbacks.deleteLogoutUrls({ - appId: "test-app-id", - urls: "https://example.com/logout", + path: { app_id: "test-app-id" }, + query: { urls: "https://example.com/logout" }, }); expect(result).toBeDefined(); }); @@ -407,8 +407,8 @@ describe("Breaking Changes and Regressions", () => { ); const result = await Callbacks.deleteLogoutUrLs({ - appId: "test-app-id", - urls: "https://example.com/logout", + path: { app_id: "test-app-id" }, + query: { urls: "https://example.com/logout" }, }); expect(result).toBeDefined(); }); @@ -428,7 +428,7 @@ describe("Breaking Changes and Regressions", () => { }), ); - const result = await Users.getUsers({ phone: "+1234567890" }); + const result = await Users.getUsers({ query: { phone: "+1234567890" } }); expect(result).toBeDefined(); }); }); @@ -452,11 +452,16 @@ describe("Breaking Changes and Regressions", () => { }), ); - const result = await Users.getUsers({ expand: "billing" }); + const result = await Users.getUsers({ query: { expand: "billing" } }); expect(result).toBeDefined(); - if (result.users && result.users.length > 0) { - expect(result.users[0].billing).toBeDefined(); - expect(result.users[0].billing?.customer_id).toBe("cust-123"); + if ( + (result as { users?: { billing?: { customer_id?: string } }[] }).users + ) { + const users = (result as { users?: { billing?: { customer_id?: string } }[] }).users!; + if (users.length > 0) { + expect(users[0].billing).toBeDefined(); + expect(users[0].billing?.customer_id).toBe("cust-123"); + } } }); @@ -481,13 +486,18 @@ describe("Breaking Changes and Regressions", () => { ); const result = await Users.getUsers({ - expand: "organizations,identities,billing", + query: { expand: "organizations,identities,billing" }, }); expect(result).toBeDefined(); - if (result.users && result.users.length > 0) { - expect(result.users[0].billing).toBeDefined(); - expect(result.users[0].organizations).toBeDefined(); - expect(result.users[0].identities).toBeDefined(); + if ( + (result as { users?: { billing?: unknown; organizations?: unknown; identities?: unknown }[] }).users + ) { + const users = (result as { users?: { billing?: unknown; organizations?: unknown; identities?: unknown }[] }).users!; + if (users.length > 0) { + expect(users[0].billing).toBeDefined(); + expect(users[0].organizations).toBeDefined(); + expect(users[0].identities).toBeDefined(); + } } }); }); @@ -496,8 +506,8 @@ describe("Breaking Changes and Regressions", () => { describe("Type Name Changes", () => { it("should export new GetCallbackUrlsData type", () => { // This is a compile-time check, but we can verify it's importable - const data: GetCallbackUrlsData = { appId: "test" }; - expect(data.appId).toBe("test"); + const data: GetCallbackUrlsData = { path: { app_id: "test" } }; + expect(data.path.app_id).toBe("test"); }); it("should export new GetCallbackUrlsResponse type", async () => { @@ -508,15 +518,17 @@ describe("Breaking Changes and Regressions", () => { }), ); - const result = await Callbacks.getCallbackUrls({ appId: "test-app-id" }); + const result = await Callbacks.getCallbackUrls({ + path: { app_id: "test-app-id" }, + }); // Type should be GetCallbackUrlsResponse (redirect_callback_urls) // The method should work and return a result expect(result).toBeDefined(); }); it("should export new GetLogoutUrlsData type", () => { - const data: GetLogoutUrlsData = { appId: "test" }; - expect(data.appId).toBe("test"); + const data: GetLogoutUrlsData = { path: { app_id: "test" } }; + expect(data.path.app_id).toBe("test"); }); }); From aa6ea8300bca409c97171d484379a585fc4cb258 Mon Sep 17 00:00:00 2001 From: dtoxvanilla1991 Date: Tue, 28 Apr 2026 00:44:54 +0100 Subject: [PATCH 2/4] fix: preserve hand-maintained files during code generation Set output.clean: false in openapi-ts.config.ts so that spec:generate does not delete callbacks-compat.ts and callbacks-compat.d.ts on every run. --- openapi-ts.config.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/openapi-ts.config.ts b/openapi-ts.config.ts index b87e68a..aff14e4 100644 --- a/openapi-ts.config.ts +++ b/openapi-ts.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from "@hey-api/openapi-ts"; export default defineConfig({ input: "./spec/kinde-mgmt-api-specs.yaml", output: { + clean: false, path: "lib/api", postProcess: ["prettier"], }, From ff4a7a081be230cef1e14d19059f2df52be07630 Mon Sep 17 00:00:00 2001 From: dtoxvanilla1991 Date: Tue, 19 May 2026 23:44:22 +0100 Subject: [PATCH 3/4] fix: address review feedback from PR #143 - Use kindeConfig.audience as primary audience source in generateM2MToken, falling back to kindeDomain + "/api" (guards against external mutation drift) - Add export type * from ./api/types.gen to lib/main.ts to restore the full request/response type surface in the public API entry point - Set responseStyle: "data" and throwOnError: true in client.setConfig() to preserve backwards-compatible call semantics from the old OpenAPI client - Fix dead billing-expand test assertions: replace double inline casts with local type aliases so assertions actually execute under the new client shape - Format lib/api/client/types.gen.ts and lib/api/core/pathSerializer.gen.ts to unblock the Prettier CI gate - Bump CI node-version to 22.x and add engines.node >=22.13.0 to package.json to match @hey-api/openapi-ts@0.96.x runtime requirement --- .github/workflows/build-test-ci.yml | 2 +- lib/api/client/types.gen.ts | 7 +++--- lib/api/core/pathSerializer.gen.ts | 3 +-- lib/config.ts | 2 ++ lib/main.ts | 1 + lib/utilities/getToken.ts | 2 +- package.json | 3 +++ tests/regressions.test.ts | 36 ++++++++++++++--------------- 8 files changed, 31 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build-test-ci.yml b/.github/workflows/build-test-ci.yml index 5da6536..5fb9ed8 100644 --- a/.github/workflows/build-test-ci.yml +++ b/.github/workflows/build-test-ci.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [20.x] + node-version: [22.x] steps: - uses: actions/checkout@v6 - uses: pnpm/action-setup@v3 diff --git a/lib/api/client/types.gen.ts b/lib/api/client/types.gen.ts index 181205b..d84e919 100644 --- a/lib/api/client/types.gen.ts +++ b/lib/api/client/types.gen.ts @@ -14,8 +14,7 @@ import type { Middleware } from "./utils.gen"; export type ResponseStyle = "data" | "fields"; export interface Config - extends Omit, - CoreConfig { + extends Omit, CoreConfig { /** * Base URL for all requests made by this client. */ @@ -69,7 +68,9 @@ export interface RequestOptions< TResponseStyle extends ResponseStyle = "fields", ThrowOnError extends boolean = boolean, Url extends string = string, -> extends Config<{ +> + extends + Config<{ responseStyle: TResponseStyle; throwOnError: ThrowOnError; }>, diff --git a/lib/api/core/pathSerializer.gen.ts b/lib/api/core/pathSerializer.gen.ts index 034aa68..52457e0 100644 --- a/lib/api/core/pathSerializer.gen.ts +++ b/lib/api/core/pathSerializer.gen.ts @@ -1,8 +1,7 @@ // This file is auto-generated by @hey-api/openapi-ts interface SerializeOptions - extends SerializePrimitiveOptions, - SerializerOptions {} + extends SerializePrimitiveOptions, SerializerOptions {} interface SerializePrimitiveOptions { allowReserved?: boolean; diff --git a/lib/config.ts b/lib/config.ts index 738f8bf..7591546 100644 --- a/lib/config.ts +++ b/lib/config.ts @@ -65,6 +65,8 @@ export const init = ( client.setConfig({ baseUrl: kindeConfig.kindeDomain, auth: async () => await getToken(), + responseStyle: "data", + throwOnError: true, }); }; diff --git a/lib/main.ts b/lib/main.ts index cb972d9..ad85219 100644 --- a/lib/main.ts +++ b/lib/main.ts @@ -1,5 +1,6 @@ // Schema exports (auto-generated) export * from "./api/schemas.gen"; +export type * from "./api/types.gen"; // SDK class exports (all except Callbacks, which is overridden by the compat layer below) export { diff --git a/lib/utilities/getToken.ts b/lib/utilities/getToken.ts index 8c37ec9..da02a01 100644 --- a/lib/utilities/getToken.ts +++ b/lib/utilities/getToken.ts @@ -48,7 +48,7 @@ async function generateM2MToken() { scope: constants.DEFAULT_TOKEN_SCOPES, client_id: kindeConfig.clientId, client_secret: kindeConfig.clientSecret, - audience: kindeConfig.kindeDomain + "/api", + audience: kindeConfig.audience || kindeConfig.kindeDomain + "/api", }); const headers = new Headers(); diff --git a/package.json b/package.json index 9695348..dc00e2b 100644 --- a/package.json +++ b/package.json @@ -49,5 +49,8 @@ "publishConfig": { "access": "public" }, + "engines": { + "node": ">=22.13.0" + }, "packageManager": "pnpm@10.18.1+sha512.77a884a165cbba2d8d1c19e3b4880eee6d2fcabd0d879121e282196b80042351d5eb3ca0935fa599da1dc51265cc68816ad2bddd2a2de5ea9fdf92adbec7cd34" } diff --git a/tests/regressions.test.ts b/tests/regressions.test.ts index b25d591..8f8ab34 100644 --- a/tests/regressions.test.ts +++ b/tests/regressions.test.ts @@ -428,7 +428,9 @@ describe("Breaking Changes and Regressions", () => { }), ); - const result = await Users.getUsers({ query: { phone: "+1234567890" } }); + const result = await Users.getUsers({ + query: { phone: "+1234567890" }, + }); expect(result).toBeDefined(); }); }); @@ -454,14 +456,11 @@ describe("Breaking Changes and Regressions", () => { const result = await Users.getUsers({ query: { expand: "billing" } }); expect(result).toBeDefined(); - if ( - (result as { users?: { billing?: { customer_id?: string } }[] }).users - ) { - const users = (result as { users?: { billing?: { customer_id?: string } }[] }).users!; - if (users.length > 0) { - expect(users[0].billing).toBeDefined(); - expect(users[0].billing?.customer_id).toBe("cust-123"); - } + type BillingUser = { billing?: { customer_id?: string } }; + const users = (result as { users?: BillingUser[] }).users; + if (users?.length) { + expect(users[0].billing).toBeDefined(); + expect(users[0].billing?.customer_id).toBe("cust-123"); } }); @@ -489,15 +488,16 @@ describe("Breaking Changes and Regressions", () => { query: { expand: "organizations,identities,billing" }, }); expect(result).toBeDefined(); - if ( - (result as { users?: { billing?: unknown; organizations?: unknown; identities?: unknown }[] }).users - ) { - const users = (result as { users?: { billing?: unknown; organizations?: unknown; identities?: unknown }[] }).users!; - if (users.length > 0) { - expect(users[0].billing).toBeDefined(); - expect(users[0].organizations).toBeDefined(); - expect(users[0].identities).toBeDefined(); - } + type ExpandedUser = { + billing?: unknown; + organizations?: unknown; + identities?: unknown; + }; + const users = (result as { users?: ExpandedUser[] }).users; + if (users?.length) { + expect(users[0].billing).toBeDefined(); + expect(users[0].organizations).toBeDefined(); + expect(users[0].identities).toBeDefined(); } }); }); From 3e602a5a90397a19eefca079408834f96d006da4 Mon Sep 17 00:00:00 2001 From: dtoxvanilla1991 Date: Tue, 19 May 2026 23:54:59 +0100 Subject: [PATCH 4/4] fix: deterministic test assertions and add parseAs json to client config - Replace if (users?.length) guards with explicit expect(users).toBeDefined() and expect(users!.length).toBeGreaterThan(0) so billing assertion failures are deterministic rather than silently skipped - Add parseAs: 'json' to client.setConfig() so responses are always parsed as JSON; fixes test environment where vitest-fetch-mock does not set Content-Type header, causing parseAs: auto to fall back to stream mode --- lib/config.ts | 1 + tests/regressions.test.ts | 18 +++++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/config.ts b/lib/config.ts index 7591546..f199530 100644 --- a/lib/config.ts +++ b/lib/config.ts @@ -65,6 +65,7 @@ export const init = ( client.setConfig({ baseUrl: kindeConfig.kindeDomain, auth: async () => await getToken(), + parseAs: "json", responseStyle: "data", throwOnError: true, }); diff --git a/tests/regressions.test.ts b/tests/regressions.test.ts index 8f8ab34..cb1f6f5 100644 --- a/tests/regressions.test.ts +++ b/tests/regressions.test.ts @@ -458,10 +458,10 @@ describe("Breaking Changes and Regressions", () => { expect(result).toBeDefined(); type BillingUser = { billing?: { customer_id?: string } }; const users = (result as { users?: BillingUser[] }).users; - if (users?.length) { - expect(users[0].billing).toBeDefined(); - expect(users[0].billing?.customer_id).toBe("cust-123"); - } + expect(users).toBeDefined(); + expect(users!.length).toBeGreaterThan(0); + expect(users![0].billing).toBeDefined(); + expect(users![0].billing?.customer_id).toBe("cust-123"); }); it("should accept multiple expand options including billing", async () => { @@ -494,11 +494,11 @@ describe("Breaking Changes and Regressions", () => { identities?: unknown; }; const users = (result as { users?: ExpandedUser[] }).users; - if (users?.length) { - expect(users[0].billing).toBeDefined(); - expect(users[0].organizations).toBeDefined(); - expect(users[0].identities).toBeDefined(); - } + expect(users).toBeDefined(); + expect(users!.length).toBeGreaterThan(0); + expect(users![0].billing).toBeDefined(); + expect(users![0].organizations).toBeDefined(); + expect(users![0].identities).toBeDefined(); }); }); });