@yaakapp/api
Version:
Yaak is a desktop [API client](https://yaak.app/blog/yet-another-api-client) for interacting with REST, GraphQL, Server Sent Events (SSE), WebSocket, and gRPC APIs. It's built using Tauri, Rust, and ReactJS.
24 lines (23 loc) • 1.27 kB
TypeScript
import type { CallHttpAuthenticationActionArgs, CallHttpAuthenticationRequest, CallHttpAuthenticationResponse, FormInput, GetHttpAuthenticationSummaryResponse, HttpAuthenticationAction } from '../bindings/gen_events';
import type { MaybePromise } from '../helpers';
import type { Context } from './Context';
type AddDynamicMethod<T> = {
dynamic?: (ctx: Context, args: CallHttpAuthenticationActionArgs) => MaybePromise<Partial<T> | null | undefined>;
};
type AddDynamic<T> = T extends any ? T extends {
inputs?: FormInput[];
} ? Omit<T, 'inputs'> & {
inputs: Array<AddDynamic<FormInput>>;
dynamic?: (ctx: Context, args: CallHttpAuthenticationActionArgs) => MaybePromise<Partial<Omit<T, 'inputs'> & {
inputs: Array<AddDynamic<FormInput>>;
}> | null | undefined>;
} : T & AddDynamicMethod<T> : never;
export type DynamicAuthenticationArg = AddDynamic<FormInput>;
export type AuthenticationPlugin = GetHttpAuthenticationSummaryResponse & {
args: DynamicAuthenticationArg[];
onApply(ctx: Context, args: CallHttpAuthenticationRequest): MaybePromise<CallHttpAuthenticationResponse>;
actions?: (HttpAuthenticationAction & {
onSelect(ctx: Context, args: CallHttpAuthenticationActionArgs): Promise<void> | void;
})[];
};
export {};