@scalar/api-client
Version:
the open source API testing client
900 lines • 51.9 kB
TypeScript
import type { StoreContext } from '../store/store-context';
import { type Collection, type SecurityScheme, type SecuritySchemePayload } from '@scalar/oas-utils/entities/spec';
/** Create storage entities for security schemes */
export declare function createStoreSecuritySchemes(useLocalStorage: boolean): {
securitySchemes: Record<string, {
type: "apiKey";
name: string;
in: "cookie" | "query" | "header";
uid: string & import("zod").$brand<"securityScheme">;
nameKey: string;
value: string;
description?: string | undefined;
} | {
type: "http";
scheme: "basic" | "bearer";
bearerFormat: string;
uid: string & import("zod").$brand<"securityScheme">;
nameKey: string;
username: string;
password: string;
token: string;
description?: string | undefined;
} | {
type: "openIdConnect";
openIdConnectUrl: string;
uid: string & import("zod").$brand<"securityScheme">;
nameKey: string;
description?: string | undefined;
} | {
type: "oauth2";
flows: {
implicit?: {
refreshUrl: string;
scopes: Record<string, string>;
selectedScopes: string[];
"x-scalar-client-id": string;
token: string;
type: "implicit";
authorizationUrl: string;
"x-scalar-redirect-uri": string;
"x-scalar-security-query"?: Record<string, string> | undefined;
"x-scalar-security-body"?: Record<string, string> | undefined;
"x-tokenName"?: string | undefined;
} | undefined;
password?: {
refreshUrl: string;
scopes: Record<string, string>;
selectedScopes: string[];
"x-scalar-client-id": string;
token: string;
type: "password";
tokenUrl: string;
clientSecret: string;
username: string;
password: string;
"x-scalar-security-query"?: Record<string, string> | undefined;
"x-scalar-security-body"?: Record<string, string> | undefined;
"x-tokenName"?: string | undefined;
"x-scalar-credentials-location"?: "header" | "body" | undefined;
} | undefined;
clientCredentials?: {
refreshUrl: string;
scopes: Record<string, string>;
selectedScopes: string[];
"x-scalar-client-id": string;
token: string;
type: "clientCredentials";
tokenUrl: string;
clientSecret: string;
"x-scalar-security-query"?: Record<string, string> | undefined;
"x-scalar-security-body"?: Record<string, string> | undefined;
"x-tokenName"?: string | undefined;
"x-scalar-credentials-location"?: "header" | "body" | undefined;
} | undefined;
authorizationCode?: {
refreshUrl: string;
scopes: Record<string, string>;
selectedScopes: string[];
"x-scalar-client-id": string;
token: string;
type: "authorizationCode";
authorizationUrl: string;
"x-usePkce": "SHA-256" | "plain" | "no";
"x-scalar-redirect-uri": string;
tokenUrl: string;
clientSecret: string;
"x-scalar-security-query"?: Record<string, string> | undefined;
"x-scalar-security-body"?: Record<string, string> | undefined;
"x-tokenName"?: string | undefined;
"x-scalar-credentials-location"?: "header" | "body" | undefined;
} | undefined;
};
uid: string & import("zod").$brand<"securityScheme">;
nameKey: string;
description?: string | undefined;
'x-default-scopes'?: string[] | undefined;
}>;
securitySchemeMutators: {
add: (item: {
type: "apiKey";
name: string;
in: "cookie" | "query" | "header";
uid: string & import("zod").$brand<"securityScheme">;
nameKey: string;
value: string;
description?: string | undefined;
} | {
type: "http";
scheme: "basic" | "bearer";
bearerFormat: string;
uid: string & import("zod").$brand<"securityScheme">;
nameKey: string;
username: string;
password: string;
token: string;
description?: string | undefined;
} | {
type: "openIdConnect";
openIdConnectUrl: string;
uid: string & import("zod").$brand<"securityScheme">;
nameKey: string;
description?: string | undefined;
} | {
type: "oauth2";
flows: {
implicit?: {
refreshUrl: string;
scopes: Record<string, string>;
selectedScopes: string[];
"x-scalar-client-id": string;
token: string;
type: "implicit";
authorizationUrl: string;
"x-scalar-redirect-uri": string;
"x-scalar-security-query"?: Record<string, string> | undefined;
"x-scalar-security-body"?: Record<string, string> | undefined;
"x-tokenName"?: string | undefined;
} | undefined;
password?: {
refreshUrl: string;
scopes: Record<string, string>;
selectedScopes: string[];
"x-scalar-client-id": string;
token: string;
type: "password";
tokenUrl: string;
clientSecret: string;
username: string;
password: string;
"x-scalar-security-query"?: Record<string, string> | undefined;
"x-scalar-security-body"?: Record<string, string> | undefined;
"x-tokenName"?: string | undefined;
"x-scalar-credentials-location"?: "header" | "body" | undefined;
} | undefined;
clientCredentials?: {
refreshUrl: string;
scopes: Record<string, string>;
selectedScopes: string[];
"x-scalar-client-id": string;
token: string;
type: "clientCredentials";
tokenUrl: string;
clientSecret: string;
"x-scalar-security-query"?: Record<string, string> | undefined;
"x-scalar-security-body"?: Record<string, string> | undefined;
"x-tokenName"?: string | undefined;
"x-scalar-credentials-location"?: "header" | "body" | undefined;
} | undefined;
authorizationCode?: {
refreshUrl: string;
scopes: Record<string, string>;
selectedScopes: string[];
"x-scalar-client-id": string;
token: string;
type: "authorizationCode";
authorizationUrl: string;
"x-usePkce": "SHA-256" | "plain" | "no";
"x-scalar-redirect-uri": string;
tokenUrl: string;
clientSecret: string;
"x-scalar-security-query"?: Record<string, string> | undefined;
"x-scalar-security-body"?: Record<string, string> | undefined;
"x-tokenName"?: string | undefined;
"x-scalar-credentials-location"?: "header" | "body" | undefined;
} | undefined;
};
uid: string & import("zod").$brand<"securityScheme">;
nameKey: string;
description?: string | undefined;
'x-default-scopes'?: string[] | undefined;
}) => void;
delete: (uid: (string & import("zod").$brand<"securityScheme">) | null | undefined) => void;
set: (item: {
type: "apiKey";
name: string;
in: "cookie" | "query" | "header";
uid: string & import("zod").$brand<"securityScheme">;
nameKey: string;
value: string;
description?: string | undefined;
} | {
type: "http";
scheme: "basic" | "bearer";
bearerFormat: string;
uid: string & import("zod").$brand<"securityScheme">;
nameKey: string;
username: string;
password: string;
token: string;
description?: string | undefined;
} | {
type: "openIdConnect";
openIdConnectUrl: string;
uid: string & import("zod").$brand<"securityScheme">;
nameKey: string;
description?: string | undefined;
} | {
type: "oauth2";
flows: {
implicit?: {
refreshUrl: string;
scopes: Record<string, string>;
selectedScopes: string[];
"x-scalar-client-id": string;
token: string;
type: "implicit";
authorizationUrl: string;
"x-scalar-redirect-uri": string;
"x-scalar-security-query"?: Record<string, string> | undefined;
"x-scalar-security-body"?: Record<string, string> | undefined;
"x-tokenName"?: string | undefined;
} | undefined;
password?: {
refreshUrl: string;
scopes: Record<string, string>;
selectedScopes: string[];
"x-scalar-client-id": string;
token: string;
type: "password";
tokenUrl: string;
clientSecret: string;
username: string;
password: string;
"x-scalar-security-query"?: Record<string, string> | undefined;
"x-scalar-security-body"?: Record<string, string> | undefined;
"x-tokenName"?: string | undefined;
"x-scalar-credentials-location"?: "header" | "body" | undefined;
} | undefined;
clientCredentials?: {
refreshUrl: string;
scopes: Record<string, string>;
selectedScopes: string[];
"x-scalar-client-id": string;
token: string;
type: "clientCredentials";
tokenUrl: string;
clientSecret: string;
"x-scalar-security-query"?: Record<string, string> | undefined;
"x-scalar-security-body"?: Record<string, string> | undefined;
"x-tokenName"?: string | undefined;
"x-scalar-credentials-location"?: "header" | "body" | undefined;
} | undefined;
authorizationCode?: {
refreshUrl: string;
scopes: Record<string, string>;
selectedScopes: string[];
"x-scalar-client-id": string;
token: string;
type: "authorizationCode";
authorizationUrl: string;
"x-usePkce": "SHA-256" | "plain" | "no";
"x-scalar-redirect-uri": string;
tokenUrl: string;
clientSecret: string;
"x-scalar-security-query"?: Record<string, string> | undefined;
"x-scalar-security-body"?: Record<string, string> | undefined;
"x-tokenName"?: string | undefined;
"x-scalar-credentials-location"?: "header" | "body" | undefined;
} | undefined;
};
uid: string & import("zod").$brand<"securityScheme">;
nameKey: string;
description?: string | undefined;
'x-default-scopes'?: string[] | undefined;
}) => void;
edit: <P extends "in" | "value" | "description" | "type" | "uid" | "name" | "nameKey" | "scheme" | "bearerFormat" | "username" | "password" | "token" | "openIdConnectUrl" | "x-default-scopes" | "flows" | `x-default-scopes.${number}` | "flows.password" | "flows.implicit" | "flows.clientCredentials" | "flows.authorizationCode" | "flows.password.type" | "flows.password.username" | "flows.password.password" | "flows.password.token" | "flows.password.refreshUrl" | "flows.password.scopes" | "flows.password.selectedScopes" | "flows.password.x-scalar-client-id" | "flows.password.x-scalar-security-query" | "flows.password.x-scalar-security-body" | "flows.password.x-tokenName" | "flows.password.tokenUrl" | "flows.password.clientSecret" | "flows.password.x-scalar-credentials-location" | `flows.password.scopes.${string}` | `flows.password.selectedScopes.${number}` | `flows.password.x-scalar-security-query.${string}` | `flows.password.x-scalar-security-body.${string}` | "flows.implicit.type" | "flows.implicit.token" | "flows.implicit.refreshUrl" | "flows.implicit.scopes" | "flows.implicit.selectedScopes" | "flows.implicit.x-scalar-client-id" | "flows.implicit.x-scalar-security-query" | "flows.implicit.x-scalar-security-body" | "flows.implicit.x-tokenName" | "flows.implicit.authorizationUrl" | "flows.implicit.x-scalar-redirect-uri" | `flows.implicit.scopes.${string}` | `flows.implicit.selectedScopes.${number}` | `flows.implicit.x-scalar-security-query.${string}` | `flows.implicit.x-scalar-security-body.${string}` | "flows.clientCredentials.type" | "flows.clientCredentials.token" | "flows.clientCredentials.refreshUrl" | "flows.clientCredentials.scopes" | "flows.clientCredentials.selectedScopes" | "flows.clientCredentials.x-scalar-client-id" | "flows.clientCredentials.x-scalar-security-query" | "flows.clientCredentials.x-scalar-security-body" | "flows.clientCredentials.x-tokenName" | "flows.clientCredentials.tokenUrl" | "flows.clientCredentials.clientSecret" | "flows.clientCredentials.x-scalar-credentials-location" | `flows.clientCredentials.scopes.${string}` | `flows.clientCredentials.selectedScopes.${number}` | `flows.clientCredentials.x-scalar-security-query.${string}` | `flows.clientCredentials.x-scalar-security-body.${string}` | "flows.authorizationCode.type" | "flows.authorizationCode.token" | "flows.authorizationCode.refreshUrl" | "flows.authorizationCode.scopes" | "flows.authorizationCode.selectedScopes" | "flows.authorizationCode.x-scalar-client-id" | "flows.authorizationCode.x-scalar-security-query" | "flows.authorizationCode.x-scalar-security-body" | "flows.authorizationCode.x-tokenName" | "flows.authorizationCode.authorizationUrl" | "flows.authorizationCode.x-scalar-redirect-uri" | "flows.authorizationCode.tokenUrl" | "flows.authorizationCode.clientSecret" | "flows.authorizationCode.x-scalar-credentials-location" | "flows.authorizationCode.x-usePkce" | `flows.authorizationCode.scopes.${string}` | `flows.authorizationCode.selectedScopes.${number}` | `flows.authorizationCode.x-scalar-security-query.${string}` | `flows.authorizationCode.x-scalar-security-body.${string}`>(uid: (string & import("zod").$brand<"securityScheme">) | null | undefined, path: P, value: (P extends "in" | "value" | "description" | "type" | "uid" | "name" | "nameKey" ? {
type: "apiKey";
name: string;
in: "cookie" | "query" | "header";
uid: string & import("zod").$brand<"securityScheme">;
nameKey: string;
value: string;
description?: string | undefined;
}[P] : P extends `${infer K}.${infer R}` ? K extends "in" | "value" | "description" | "type" | "uid" | "name" | "nameKey" ? R extends import("@scalar/object-utils/nested").Path<{
type: "apiKey";
name: string;
in: "cookie" | "query" | "header";
uid: string & import("zod").$brand<"securityScheme">;
nameKey: string;
value: string;
description?: string | undefined;
}[K]> ? import("@scalar/object-utils/nested").PathValue<{
type: "apiKey";
name: string;
in: "cookie" | "query" | "header";
uid: string & import("zod").$brand<"securityScheme">;
nameKey: string;
value: string;
description?: string | undefined;
}[K], R> : never : K extends `${number}` ? never : never : P extends `${number}` ? never : never) | (P extends "description" | "type" | "uid" | "nameKey" | "scheme" | "bearerFormat" | "username" | "password" | "token" ? {
type: "http";
scheme: "basic" | "bearer";
bearerFormat: string;
uid: string & import("zod").$brand<"securityScheme">;
nameKey: string;
username: string;
password: string;
token: string;
description?: string | undefined;
}[P] : P extends `${infer K}.${infer R}` ? K extends "description" | "type" | "uid" | "nameKey" | "scheme" | "bearerFormat" | "username" | "password" | "token" ? R extends import("@scalar/object-utils/nested").Path<{
type: "http";
scheme: "basic" | "bearer";
bearerFormat: string;
uid: string & import("zod").$brand<"securityScheme">;
nameKey: string;
username: string;
password: string;
token: string;
description?: string | undefined;
}[K]> ? import("@scalar/object-utils/nested").PathValue<{
type: "http";
scheme: "basic" | "bearer";
bearerFormat: string;
uid: string & import("zod").$brand<"securityScheme">;
nameKey: string;
username: string;
password: string;
token: string;
description?: string | undefined;
}[K], R> : never : K extends `${number}` ? never : never : P extends `${number}` ? never : never) | (P extends "description" | "type" | "uid" | "nameKey" | "openIdConnectUrl" ? {
type: "openIdConnect";
openIdConnectUrl: string;
uid: string & import("zod").$brand<"securityScheme">;
nameKey: string;
description?: string | undefined;
}[P] : P extends `${infer K}.${infer R}` ? K extends "description" | "type" | "uid" | "nameKey" | "openIdConnectUrl" ? R extends import("@scalar/object-utils/nested").Path<{
type: "openIdConnect";
openIdConnectUrl: string;
uid: string & import("zod").$brand<"securityScheme">;
nameKey: string;
description?: string | undefined;
}[K]> ? import("@scalar/object-utils/nested").PathValue<{
type: "openIdConnect";
openIdConnectUrl: string;
uid: string & import("zod").$brand<"securityScheme">;
nameKey: string;
description?: string | undefined;
}[K], R> : never : K extends `${number}` ? never : never : P extends `${number}` ? never : never) | (P extends "description" | "type" | "uid" | "nameKey" | "x-default-scopes" | "flows" ? {
type: "oauth2";
flows: {
implicit?: {
refreshUrl: string;
scopes: Record<string, string>;
selectedScopes: string[];
"x-scalar-client-id": string;
token: string;
type: "implicit";
authorizationUrl: string;
"x-scalar-redirect-uri": string;
"x-scalar-security-query"?: Record<string, string> | undefined;
"x-scalar-security-body"?: Record<string, string> | undefined;
"x-tokenName"?: string | undefined;
} | undefined;
password?: {
refreshUrl: string;
scopes: Record<string, string>;
selectedScopes: string[];
"x-scalar-client-id": string;
token: string;
type: "password";
tokenUrl: string;
clientSecret: string;
username: string;
password: string;
"x-scalar-security-query"?: Record<string, string> | undefined;
"x-scalar-security-body"?: Record<string, string> | undefined;
"x-tokenName"?: string | undefined;
"x-scalar-credentials-location"?: "header" | "body" | undefined;
} | undefined;
clientCredentials?: {
refreshUrl: string;
scopes: Record<string, string>;
selectedScopes: string[];
"x-scalar-client-id": string;
token: string;
type: "clientCredentials";
tokenUrl: string;
clientSecret: string;
"x-scalar-security-query"?: Record<string, string> | undefined;
"x-scalar-security-body"?: Record<string, string> | undefined;
"x-tokenName"?: string | undefined;
"x-scalar-credentials-location"?: "header" | "body" | undefined;
} | undefined;
authorizationCode?: {
refreshUrl: string;
scopes: Record<string, string>;
selectedScopes: string[];
"x-scalar-client-id": string;
token: string;
type: "authorizationCode";
authorizationUrl: string;
"x-usePkce": "SHA-256" | "plain" | "no";
"x-scalar-redirect-uri": string;
tokenUrl: string;
clientSecret: string;
"x-scalar-security-query"?: Record<string, string> | undefined;
"x-scalar-security-body"?: Record<string, string> | undefined;
"x-tokenName"?: string | undefined;
"x-scalar-credentials-location"?: "header" | "body" | undefined;
} | undefined;
};
uid: string & import("zod").$brand<"securityScheme">;
nameKey: string;
description?: string | undefined;
'x-default-scopes'?: string[] | undefined;
}[P] : P extends `${infer K}.${infer R}` ? K extends "description" | "type" | "uid" | "nameKey" | "x-default-scopes" | "flows" ? R extends import("@scalar/object-utils/nested").Path<{
type: "oauth2";
flows: {
implicit?: {
refreshUrl: string;
scopes: Record<string, string>;
selectedScopes: string[];
"x-scalar-client-id": string;
token: string;
type: "implicit";
authorizationUrl: string;
"x-scalar-redirect-uri": string;
"x-scalar-security-query"?: Record<string, string> | undefined;
"x-scalar-security-body"?: Record<string, string> | undefined;
"x-tokenName"?: string | undefined;
} | undefined;
password?: {
refreshUrl: string;
scopes: Record<string, string>;
selectedScopes: string[];
"x-scalar-client-id": string;
token: string;
type: "password";
tokenUrl: string;
clientSecret: string;
username: string;
password: string;
"x-scalar-security-query"?: Record<string, string> | undefined;
"x-scalar-security-body"?: Record<string, string> | undefined;
"x-tokenName"?: string | undefined;
"x-scalar-credentials-location"?: "header" | "body" | undefined;
} | undefined;
clientCredentials?: {
refreshUrl: string;
scopes: Record<string, string>;
selectedScopes: string[];
"x-scalar-client-id": string;
token: string;
type: "clientCredentials";
tokenUrl: string;
clientSecret: string;
"x-scalar-security-query"?: Record<string, string> | undefined;
"x-scalar-security-body"?: Record<string, string> | undefined;
"x-tokenName"?: string | undefined;
"x-scalar-credentials-location"?: "header" | "body" | undefined;
} | undefined;
authorizationCode?: {
refreshUrl: string;
scopes: Record<string, string>;
selectedScopes: string[];
"x-scalar-client-id": string;
token: string;
type: "authorizationCode";
authorizationUrl: string;
"x-usePkce": "SHA-256" | "plain" | "no";
"x-scalar-redirect-uri": string;
tokenUrl: string;
clientSecret: string;
"x-scalar-security-query"?: Record<string, string> | undefined;
"x-scalar-security-body"?: Record<string, string> | undefined;
"x-tokenName"?: string | undefined;
"x-scalar-credentials-location"?: "header" | "body" | undefined;
} | undefined;
};
uid: string & import("zod").$brand<"securityScheme">;
nameKey: string;
description?: string | undefined;
'x-default-scopes'?: string[] | undefined;
}[K]> ? import("@scalar/object-utils/nested").PathValue<{
type: "oauth2";
flows: {
implicit?: {
refreshUrl: string;
scopes: Record<string, string>;
selectedScopes: string[];
"x-scalar-client-id": string;
token: string;
type: "implicit";
authorizationUrl: string;
"x-scalar-redirect-uri": string;
"x-scalar-security-query"?: Record<string, string> | undefined;
"x-scalar-security-body"?: Record<string, string> | undefined;
"x-tokenName"?: string | undefined;
} | undefined;
password?: {
refreshUrl: string;
scopes: Record<string, string>;
selectedScopes: string[];
"x-scalar-client-id": string;
token: string;
type: "password";
tokenUrl: string;
clientSecret: string;
username: string;
password: string;
"x-scalar-security-query"?: Record<string, string> | undefined;
"x-scalar-security-body"?: Record<string, string> | undefined;
"x-tokenName"?: string | undefined;
"x-scalar-credentials-location"?: "header" | "body" | undefined;
} | undefined;
clientCredentials?: {
refreshUrl: string;
scopes: Record<string, string>;
selectedScopes: string[];
"x-scalar-client-id": string;
token: string;
type: "clientCredentials";
tokenUrl: string;
clientSecret: string;
"x-scalar-security-query"?: Record<string, string> | undefined;
"x-scalar-security-body"?: Record<string, string> | undefined;
"x-tokenName"?: string | undefined;
"x-scalar-credentials-location"?: "header" | "body" | undefined;
} | undefined;
authorizationCode?: {
refreshUrl: string;
scopes: Record<string, string>;
selectedScopes: string[];
"x-scalar-client-id": string;
token: string;
type: "authorizationCode";
authorizationUrl: string;
"x-usePkce": "SHA-256" | "plain" | "no";
"x-scalar-redirect-uri": string;
tokenUrl: string;
clientSecret: string;
"x-scalar-security-query"?: Record<string, string> | undefined;
"x-scalar-security-body"?: Record<string, string> | undefined;
"x-tokenName"?: string | undefined;
"x-scalar-credentials-location"?: "header" | "body" | undefined;
} | undefined;
};
uid: string & import("zod").$brand<"securityScheme">;
nameKey: string;
description?: string | undefined;
'x-default-scopes'?: string[] | undefined;
}[K], R> : never : K extends `${number}` ? never : never : P extends `${number}` ? never : never)) => void;
untrackedEdit: <P extends "in" | "value" | "description" | "type" | "uid" | "name" | "nameKey" | "scheme" | "bearerFormat" | "username" | "password" | "token" | "openIdConnectUrl" | "x-default-scopes" | "flows" | `x-default-scopes.${number}` | "flows.password" | "flows.implicit" | "flows.clientCredentials" | "flows.authorizationCode" | "flows.password.type" | "flows.password.username" | "flows.password.password" | "flows.password.token" | "flows.password.refreshUrl" | "flows.password.scopes" | "flows.password.selectedScopes" | "flows.password.x-scalar-client-id" | "flows.password.x-scalar-security-query" | "flows.password.x-scalar-security-body" | "flows.password.x-tokenName" | "flows.password.tokenUrl" | "flows.password.clientSecret" | "flows.password.x-scalar-credentials-location" | `flows.password.scopes.${string}` | `flows.password.selectedScopes.${number}` | `flows.password.x-scalar-security-query.${string}` | `flows.password.x-scalar-security-body.${string}` | "flows.implicit.type" | "flows.implicit.token" | "flows.implicit.refreshUrl" | "flows.implicit.scopes" | "flows.implicit.selectedScopes" | "flows.implicit.x-scalar-client-id" | "flows.implicit.x-scalar-security-query" | "flows.implicit.x-scalar-security-body" | "flows.implicit.x-tokenName" | "flows.implicit.authorizationUrl" | "flows.implicit.x-scalar-redirect-uri" | `flows.implicit.scopes.${string}` | `flows.implicit.selectedScopes.${number}` | `flows.implicit.x-scalar-security-query.${string}` | `flows.implicit.x-scalar-security-body.${string}` | "flows.clientCredentials.type" | "flows.clientCredentials.token" | "flows.clientCredentials.refreshUrl" | "flows.clientCredentials.scopes" | "flows.clientCredentials.selectedScopes" | "flows.clientCredentials.x-scalar-client-id" | "flows.clientCredentials.x-scalar-security-query" | "flows.clientCredentials.x-scalar-security-body" | "flows.clientCredentials.x-tokenName" | "flows.clientCredentials.tokenUrl" | "flows.clientCredentials.clientSecret" | "flows.clientCredentials.x-scalar-credentials-location" | `flows.clientCredentials.scopes.${string}` | `flows.clientCredentials.selectedScopes.${number}` | `flows.clientCredentials.x-scalar-security-query.${string}` | `flows.clientCredentials.x-scalar-security-body.${string}` | "flows.authorizationCode.type" | "flows.authorizationCode.token" | "flows.authorizationCode.refreshUrl" | "flows.authorizationCode.scopes" | "flows.authorizationCode.selectedScopes" | "flows.authorizationCode.x-scalar-client-id" | "flows.authorizationCode.x-scalar-security-query" | "flows.authorizationCode.x-scalar-security-body" | "flows.authorizationCode.x-tokenName" | "flows.authorizationCode.authorizationUrl" | "flows.authorizationCode.x-scalar-redirect-uri" | "flows.authorizationCode.tokenUrl" | "flows.authorizationCode.clientSecret" | "flows.authorizationCode.x-scalar-credentials-location" | "flows.authorizationCode.x-usePkce" | `flows.authorizationCode.scopes.${string}` | `flows.authorizationCode.selectedScopes.${number}` | `flows.authorizationCode.x-scalar-security-query.${string}` | `flows.authorizationCode.x-scalar-security-body.${string}`>(uid: string & import("zod").$brand<"securityScheme">, path: P, value: (P extends "in" | "value" | "description" | "type" | "uid" | "name" | "nameKey" ? {
type: "apiKey";
name: string;
in: "cookie" | "query" | "header";
uid: string & import("zod").$brand<"securityScheme">;
nameKey: string;
value: string;
description?: string | undefined;
}[P] : P extends `${infer K}.${infer R}` ? K extends "in" | "value" | "description" | "type" | "uid" | "name" | "nameKey" ? R extends import("@scalar/object-utils/nested").Path<{
type: "apiKey";
name: string;
in: "cookie" | "query" | "header";
uid: string & import("zod").$brand<"securityScheme">;
nameKey: string;
value: string;
description?: string | undefined;
}[K]> ? import("@scalar/object-utils/nested").PathValue<{
type: "apiKey";
name: string;
in: "cookie" | "query" | "header";
uid: string & import("zod").$brand<"securityScheme">;
nameKey: string;
value: string;
description?: string | undefined;
}[K], R> : never : K extends `${number}` ? never : never : P extends `${number}` ? never : never) | (P extends "description" | "type" | "uid" | "nameKey" | "scheme" | "bearerFormat" | "username" | "password" | "token" ? {
type: "http";
scheme: "basic" | "bearer";
bearerFormat: string;
uid: string & import("zod").$brand<"securityScheme">;
nameKey: string;
username: string;
password: string;
token: string;
description?: string | undefined;
}[P] : P extends `${infer K}.${infer R}` ? K extends "description" | "type" | "uid" | "nameKey" | "scheme" | "bearerFormat" | "username" | "password" | "token" ? R extends import("@scalar/object-utils/nested").Path<{
type: "http";
scheme: "basic" | "bearer";
bearerFormat: string;
uid: string & import("zod").$brand<"securityScheme">;
nameKey: string;
username: string;
password: string;
token: string;
description?: string | undefined;
}[K]> ? import("@scalar/object-utils/nested").PathValue<{
type: "http";
scheme: "basic" | "bearer";
bearerFormat: string;
uid: string & import("zod").$brand<"securityScheme">;
nameKey: string;
username: string;
password: string;
token: string;
description?: string | undefined;
}[K], R> : never : K extends `${number}` ? never : never : P extends `${number}` ? never : never) | (P extends "description" | "type" | "uid" | "nameKey" | "openIdConnectUrl" ? {
type: "openIdConnect";
openIdConnectUrl: string;
uid: string & import("zod").$brand<"securityScheme">;
nameKey: string;
description?: string | undefined;
}[P] : P extends `${infer K}.${infer R}` ? K extends "description" | "type" | "uid" | "nameKey" | "openIdConnectUrl" ? R extends import("@scalar/object-utils/nested").Path<{
type: "openIdConnect";
openIdConnectUrl: string;
uid: string & import("zod").$brand<"securityScheme">;
nameKey: string;
description?: string | undefined;
}[K]> ? import("@scalar/object-utils/nested").PathValue<{
type: "openIdConnect";
openIdConnectUrl: string;
uid: string & import("zod").$brand<"securityScheme">;
nameKey: string;
description?: string | undefined;
}[K], R> : never : K extends `${number}` ? never : never : P extends `${number}` ? never : never) | (P extends "description" | "type" | "uid" | "nameKey" | "x-default-scopes" | "flows" ? {
type: "oauth2";
flows: {
implicit?: {
refreshUrl: string;
scopes: Record<string, string>;
selectedScopes: string[];
"x-scalar-client-id": string;
token: string;
type: "implicit";
authorizationUrl: string;
"x-scalar-redirect-uri": string;
"x-scalar-security-query"?: Record<string, string> | undefined;
"x-scalar-security-body"?: Record<string, string> | undefined;
"x-tokenName"?: string | undefined;
} | undefined;
password?: {
refreshUrl: string;
scopes: Record<string, string>;
selectedScopes: string[];
"x-scalar-client-id": string;
token: string;
type: "password";
tokenUrl: string;
clientSecret: string;
username: string;
password: string;
"x-scalar-security-query"?: Record<string, string> | undefined;
"x-scalar-security-body"?: Record<string, string> | undefined;
"x-tokenName"?: string | undefined;
"x-scalar-credentials-location"?: "header" | "body" | undefined;
} | undefined;
clientCredentials?: {
refreshUrl: string;
scopes: Record<string, string>;
selectedScopes: string[];
"x-scalar-client-id": string;
token: string;
type: "clientCredentials";
tokenUrl: string;
clientSecret: string;
"x-scalar-security-query"?: Record<string, string> | undefined;
"x-scalar-security-body"?: Record<string, string> | undefined;
"x-tokenName"?: string | undefined;
"x-scalar-credentials-location"?: "header" | "body" | undefined;
} | undefined;
authorizationCode?: {
refreshUrl: string;
scopes: Record<string, string>;
selectedScopes: string[];
"x-scalar-client-id": string;
token: string;
type: "authorizationCode";
authorizationUrl: string;
"x-usePkce": "SHA-256" | "plain" | "no";
"x-scalar-redirect-uri": string;
tokenUrl: string;
clientSecret: string;
"x-scalar-security-query"?: Record<string, string> | undefined;
"x-scalar-security-body"?: Record<string, string> | undefined;
"x-tokenName"?: string | undefined;
"x-scalar-credentials-location"?: "header" | "body" | undefined;
} | undefined;
};
uid: string & import("zod").$brand<"securityScheme">;
nameKey: string;
description?: string | undefined;
'x-default-scopes'?: string[] | undefined;
}[P] : P extends `${infer K}.${infer R}` ? K extends "description" | "type" | "uid" | "nameKey" | "x-default-scopes" | "flows" ? R extends import("@scalar/object-utils/nested").Path<{
type: "oauth2";
flows: {
implicit?: {
refreshUrl: string;
scopes: Record<string, string>;
selectedScopes: string[];
"x-scalar-client-id": string;
token: string;
type: "implicit";
authorizationUrl: string;
"x-scalar-redirect-uri": string;
"x-scalar-security-query"?: Record<string, string> | undefined;
"x-scalar-security-body"?: Record<string, string> | undefined;
"x-tokenName"?: string | undefined;
} | undefined;
password?: {
refreshUrl: string;
scopes: Record<string, string>;
selectedScopes: string[];
"x-scalar-client-id": string;
token: string;
type: "password";
tokenUrl: string;
clientSecret: string;
username: string;
password: string;
"x-scalar-security-query"?: Record<string, string> | undefined;
"x-scalar-security-body"?: Record<string, string> | undefined;
"x-tokenName"?: string | undefined;
"x-scalar-credentials-location"?: "header" | "body" | undefined;
} | undefined;
clientCredentials?: {
refreshUrl: string;
scopes: Record<string, string>;
selectedScopes: string[];
"x-scalar-client-id": string;
token: string;
type: "clientCredentials";
tokenUrl: string;
clientSecret: string;
"x-scalar-security-query"?: Record<string, string> | undefined;
"x-scalar-security-body"?: Record<string, string> | undefined;
"x-tokenName"?: string | undefined;
"x-scalar-credentials-location"?: "header" | "body" | undefined;
} | undefined;
authorizationCode?: {
refreshUrl: string;
scopes: Record<string, string>;
selectedScopes: string[];
"x-scalar-client-id": string;
token: string;
type: "authorizationCode";
authorizationUrl: string;
"x-usePkce": "SHA-256" | "plain" | "no";
"x-scalar-redirect-uri": string;
tokenUrl: string;
clientSecret: string;
"x-scalar-security-query"?: Record<string, string> | undefined;
"x-scalar-security-body"?: Record<string, string> | undefined;
"x-tokenName"?: string | undefined;
"x-scalar-credentials-location"?: "header" | "body" | undefined;
} | undefined;
};
uid: string & import("zod").$brand<"securityScheme">;
nameKey: string;
description?: string | undefined;
'x-default-scopes'?: string[] | undefined;
}[K]> ? import("@scalar/object-utils/nested").PathValue<{
type: "oauth2";
flows: {
implicit?: {
refreshUrl: string;
scopes: Record<string, string>;
selectedScopes: string[];
"x-scalar-client-id": string;
token: string;
type: "implicit";
authorizationUrl: string;
"x-scalar-redirect-uri": string;
"x-scalar-security-query"?: Record<string, string> | undefined;
"x-scalar-security-body"?: Record<string, string> | undefined;
"x-tokenName"?: string | undefined;
} | undefined;
password?: {
refreshUrl: string;
scopes: Record<string, string>;
selectedScopes: string[];
"x-scalar-client-id": string;
token: string;
type: "password";
tokenUrl: string;
clientSecret: string;
username: string;
password: string;
"x-scalar-security-query"?: Record<string, string> | undefined;
"x-scalar-security-body"?: Record<string, string> | undefined;
"x-tokenName"?: string | undefined;
"x-scalar-credentials-location"?: "header" | "body" | undefined;
} | undefined;
clientCredentials?: {
refreshUrl: string;
scopes: Record<string, string>;
selectedScopes: string[];
"x-scalar-client-id": string;
token: string;
type: "clientCredentials";
tokenUrl: string;
clientSecret: string;
"x-scalar-security-query"?: Record<string, string> | undefined;
"x-scalar-security-body"?: Record<string, string> | undefined;
"x-tokenName"?: string | undefined;
"x-scalar-credentials-location"?: "header" | "body" | undefined;
} | undefined;
authorizationCode?: {
refreshUrl: string;
scopes: Record<string, string>;
selectedScopes: string[];
"x-scalar-client-id": string;
token: string;
type: "authorizationCode";
authorizationUrl: string;
"x-usePkce": "SHA-256" | "plain" | "no";
"x-scalar-redirect-uri": string;
tokenUrl: string;
clientSecret: string;
"x-scalar-security-query"?: Record<string, string> | undefined;
"x-scalar-security-body"?: Record<string, string> | undefined;
"x-tokenName"?: string | undefined;
"x-scalar-credentials-location"?: "header" | "body" | undefined;
} | undefined;
};
uid: string & import("zod").$brand<"securityScheme">;
nameKey: string;
description?: string | undefined;
'x-default-scopes'?: string[] | undefined;
}[K], R> : never : K extends `${number}` ? never : never : P extends `${number}` ? never : never)) => void;
undo: (uid: string & import("zod").$brand<"securityScheme">) => void;
redo: (uid: string & import("zod").$brand<"securityScheme">) => void;
reset: () => void;
};
};
/** Extended mutators and data for security schemas */
export declare function extendedSecurityDataFactory({ securitySchemeMutators, collectionMutators, collections, requests, requestMutators, }: StoreContext): {
addSecurityScheme: (payload: SecuritySchemePayload, collectionUid: Collection["uid"]) => {
type: "apiKey";
name: string;
in: "cookie" | "query" | "header";
uid: string & import("zod").$brand<"securityScheme">;
nameKey: string;
value: string;
description?: string | undefined;
} | {
type: "http";
scheme: "basic" | "bearer";
bearerFormat: string;
uid: string & import("zod").$brand<"securityScheme">;
nameKey: string;
username: string;
password: string;
token: string;
description?: string | undefined;
} | {
type: "openIdConnect";
openIdConnectUrl: string;
uid: string & import("zod").$brand<"securityScheme">;
nameKey: string;
description?: string | undefined;
} | {
type: "oauth2";
flows: {
implicit?: {
refreshUrl: string;
scopes: Record<string, string>;
selectedScopes: string[];
"x-scalar-client-id": string;
token: string;
type: "implicit";
authorizationUrl: string;
"x-scalar-redirect-uri": string;
"x-scalar-security-query"?: Record<string, string> | undefined;
"x-scalar-security-body"?: Record<string, string> | undefined;
"x-tokenName"?: string | undefined;
} | undefined;
password?: {
refreshUrl: string;
scopes: Record<string, string>;
selectedScopes: string[];
"x-scalar-client-id": string;
token: string;
type: "password";
tokenUrl: string;
clientSecret: string;
username: string;
password: string;
"x-scalar-security-query"?: Record<string, string> | undefined;
"x-scalar-security-body"?: Record<string, string> | undefined;
"x-tokenName"?: string | unde