33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
import { BRC } from "../types/RuntimeCxt";
|
|
import { EntityDict } from "../oak-app-domain";
|
|
import { NativeEnv, WebEnv, WechatMpEnv } from "oak-domain/lib/types";
|
|
export declare function loginByOauth<ED extends EntityDict>(params: {
|
|
code: string;
|
|
state: string;
|
|
env: WebEnv | WechatMpEnv | NativeEnv;
|
|
}, context: BRC<ED>): Promise<string>;
|
|
export declare function getOAuthClientInfo<ED extends EntityDict>(params: {
|
|
client_id: string;
|
|
currentUserId?: string;
|
|
}, context: BRC<ED>): Promise<{
|
|
data: Partial<ED["oauthApplication"]["Schema"]>;
|
|
alreadyAuth: boolean;
|
|
}>;
|
|
export declare function createOAuthState<ED extends EntityDict>(params: {
|
|
providerId: string;
|
|
userId?: string;
|
|
type: 'login' | 'bind';
|
|
}, context: BRC<ED>): Promise<string>;
|
|
export declare function authorize<ED extends EntityDict>(params: {
|
|
response_type: string;
|
|
client_id: string;
|
|
redirect_uri: string;
|
|
scope?: string;
|
|
state?: string;
|
|
action: 'grant' | 'deny';
|
|
code_challenge?: string;
|
|
code_challenge_method?: 'plain' | 'S256';
|
|
}, context: BRC<ED>): Promise<{
|
|
redirectUri: string;
|
|
}>;
|