import { Role } from '../../entity-module/roles'; import { Awaitable } from '../../lib/awaitable'; export declare const SocialProvidersToken: unique symbol; export type ValidationResult> = { socialProfile: SocialProfile; providerTokenClaims: TProviderTokenClaims; }; export type MapSocialUserToOrganizationMember> = (result: ValidationResult) => Awaitable<{ organizationId: string; role: Role[]; } | null>; export type SocialProvider = Record> = { name: string; label: string; validate: (request: SocialValidation) => Promise>; createAuthorizationUrl?: () => Promise<{ authUrl: string; nonce: string; }>; init?: () => Promise; mapToMembership?: MapSocialUserToOrganizationMember; }; export declare class LabeledSocialProvider { name: string; label: string; } export declare class SocialProfileName { givenName?: string; familyName?: string; } export declare class SocialProfile { provider: string; providerUserId: string; accessToken?: string; name: SocialProfileName; email?: string; emailVerified?: boolean; } export type SocialValidation = SocialRequest & { idToken?: string; accessToken?: string; nonce?: string; }; export type SocialRequest = { provider: string; };