@authup/client-web-kit
Version:
This package contains vue components.
172 lines • 6.01 kB
TypeScript
import { PermissionEvaluator } from '@authup/access';
import type { OAuth2TokenGrantResponse } from '@authup/specs';
import type { Realm, User } from '@authup/core-kit';
import type { StoreCreateContext, StoreLoginContext } from './types';
type InputFn = (...args: any[]) => Promise<any>;
type OutputFn<F extends InputFn> = (...args: Parameters<F>) => Promise<Awaited<ReturnType<F>>>;
type RealmMinimal = Pick<Realm, 'id' | 'name'>;
export declare function createStore(context: StoreCreateContext): {
cookiesRead: import("vue").Ref<boolean, boolean>;
setCookiesRead: (value: boolean) => void;
permissionEvaluator: PermissionEvaluator;
login: (ctx: StoreLoginContext) => Promise<void>;
logout: () => Promise<void>;
loggedIn: import("vue").ComputedRef<boolean>;
resolve: OutputFn<() => Promise<void>>;
exchangeAuthorizationCode: (code: string) => Promise<void>;
applyTokenGrantResponse: (response: OAuth2TokenGrantResponse) => void;
accessToken: import("vue").Ref<string, string>;
setAccessToken: (input: string | null) => void;
accessTokenExpireDate: import("vue").Ref<Date, Date>;
setAccessTokenExpireDate: (input: Date | number | string | null) => void;
refreshToken: import("vue").Ref<string, string>;
setRefreshToken: (input: string | null) => void;
realm: import("vue").Ref<{
name: string;
id: string;
}, RealmMinimal | {
name: string;
id: string;
}>;
realmId: import("vue").ComputedRef<string>;
realmIsRoot: import("vue").ComputedRef<boolean>;
realmName: import("vue").ComputedRef<string>;
setRealm: (input: RealmMinimal | null) => void;
realmManagement: import("vue").Ref<{
name: string;
id: string;
}, RealmMinimal | {
name: string;
id: string;
}>;
realmManagementId: import("vue").ComputedRef<string>;
realmManagementName: import("vue").ComputedRef<string>;
setRealmManagement: (input: RealmMinimal | null) => void;
user: import("vue").Ref<{
[x: string]: any;
id: string;
name: string;
name_locked: boolean;
first_name: string | null;
last_name: string | null;
display_name: string | null;
email: string;
password: string | null;
avatar: string | null;
cover: string | null;
reset_hash: string | null;
reset_at: string | null;
reset_expires: string | null;
status: string | null;
status_message: string | null;
active: boolean;
activate_hash: string | null;
created_at: Date;
updated_at: Date;
client_id: import("@authup/core-kit").Client["id"] | null;
client: {
id: string;
active: boolean;
built_in: boolean;
is_confidential: boolean;
name: string;
display_name: string | null;
description: string | null;
secret: string | null;
secret_hashed: boolean;
secret_encrypted: boolean;
redirect_uri: string | null;
grant_types: string | null;
scope: string | null;
base_url: string | null;
root_url: string | null;
created_at: string;
updated_at: string;
realm_id: Realm["id"];
realm: {
id: string;
name: string;
display_name: string | null;
description: string | null;
built_in: boolean;
created_at: string;
updated_at: string;
};
};
realm_id: Realm["id"];
realm: {
id: string;
name: string;
display_name: string | null;
description: string | null;
built_in: boolean;
created_at: string;
updated_at: string;
};
}, User | {
[x: string]: any;
id: string;
name: string;
name_locked: boolean;
first_name: string | null;
last_name: string | null;
display_name: string | null;
email: string;
password: string | null;
avatar: string | null;
cover: string | null;
reset_hash: string | null;
reset_at: string | null;
reset_expires: string | null;
status: string | null;
status_message: string | null;
active: boolean;
activate_hash: string | null;
created_at: Date;
updated_at: Date;
client_id: import("@authup/core-kit").Client["id"] | null;
client: {
id: string;
active: boolean;
built_in: boolean;
is_confidential: boolean;
name: string;
display_name: string | null;
description: string | null;
secret: string | null;
secret_hashed: boolean;
secret_encrypted: boolean;
redirect_uri: string | null;
grant_types: string | null;
scope: string | null;
base_url: string | null;
root_url: string | null;
created_at: string;
updated_at: string;
realm_id: Realm["id"];
realm: {
id: string;
name: string;
display_name: string | null;
description: string | null;
built_in: boolean;
created_at: string;
updated_at: string;
};
};
realm_id: Realm["id"];
realm: {
id: string;
name: string;
display_name: string | null;
description: string | null;
built_in: boolean;
created_at: string;
updated_at: string;
};
}>;
userId: import("vue").ComputedRef<string>;
setUser: (input: User | null) => void;
};
export {};
//# sourceMappingURL=create.d.ts.map