import type { JwtPayload } from "jsonwebtoken"; import type { IUserSharedData } from "."; export declare const AuthenticationType: { readonly default: 0; readonly uuid: 1; readonly google: 2; readonly integration: 3; }; export type AuthenticationType = typeof AuthenticationType[keyof typeof AuthenticationType]; export interface IAuthenticationRequestBody { type: AuthenticationType; } export interface IAuthenticationRequestBodyDefault extends IAuthenticationRequestBody { type: typeof AuthenticationType.default; login: string; pwd: string; } export interface IAuthenticationRequestBodyFromUuid extends IAuthenticationRequestBody { type: typeof AuthenticationType.uuid; uuid: string; } export interface IAuthenticationRequestBodyFromGoogleToken extends IAuthenticationRequestBody { type: typeof AuthenticationType.google; idToken: string; accessToken: string; } export interface IAuthenticationRequestBodyIntegration extends IAuthenticationRequestBody { type: typeof AuthenticationType.integration; client_id: string; secret: string; } export interface IAuthentication { uuid: string; token: string; } export declare const AuthenticationTokenDataProviders: { readonly default: "default"; readonly integration: "integration"; readonly google: "accounts.google.com"; }; export type AuthenticationTokenDataProviders = typeof AuthenticationTokenDataProviders[keyof typeof AuthenticationTokenDataProviders]; /** * IAuthenticationTokenDataDefault, IAuthenticationTokenDataIntegration or IAuthenticationTokenDataGoogle */ export interface IAuthenticationTokenData extends Omit { /** * AuthenticationTokenDataProviders: "default" | "integration" | "accounts.google.com" */ iss: AuthenticationTokenDataProviders; } export interface IAuthenticationTokenDataDefault extends IAuthenticationTokenData { authUuid: string; user: IUserSharedData; } export interface IAuthenticationTokenDataIntegration extends IAuthenticationTokenData { authUuid: string; clientUuid: string; } export interface IAuthenticationTokenDataGoogle extends IAuthenticationTokenData { azp: string; email: string; email_verified: string; at_hash: string; } export type AuthenticationTokenDataLocal = IAuthenticationTokenDataDefault | IAuthenticationTokenDataIntegration;