@arc-publishing/sdk-identity
Version:
JS Identity SDK for working with Identity API
138 lines (137 loc) • 7.33 kB
TypeScript
/// <reference types="gapi" />
/// <reference types="gapi.auth2" />
/// <reference types="google.accounts" />
import { UserIdentity } from './userIdentity';
import login, { isLoggedIn } from './login';
import logout from './logout';
import requestMagicLink from './requestMagicLink';
import redeemMagicLink from './redeemMagicLink';
import { extendSession, heartbeat } from './extendSession';
import clearSession from './clearSession';
import options, { Options } from './options';
import requestOTALink from './requestOTALink';
import redeemOTALink from './redeemOTALink';
import { UserProfile } from './userProfile';
import { UserSegments } from './userSegments';
import getUserProfile from './getUserProfile';
import getUserSegments from './getUserSegments';
import updateUserProfile from './updateUserProfile';
import { uploadAvatar, deleteAvatar } from './avatar';
import signUp from './signUp';
import updatePassword from './updatePassword';
import requestResetPassword from './requestResetPassword';
import resetPassword from './resetPassword';
import requestVerifyEmail from './requestVerifyEmail';
import verifyEmail from './verifyEmail';
import { getConfig, ConfigOptions } from './getConfig';
import requestDeleteAccount, { approveDeleteAccount, declineDeleteAccount } from './requestDeleteAccount';
import { getUserSettings, UserSettings } from './getUserSettings';
import getThirdPartyTokens from './getThirdPartyTokens';
import listGdprReports from './listGdprReports';
import getGdprReport from './getGdprReport';
import initFacebookLogin from './initFacebookLogin';
import initGoogleLogin from './initGoogleLogin';
import signInWithOIDC from './signInWithOIDC';
import signInWithOIDCPKCE from './signInWithOIDCPKCE';
import unlinkOIDC from './unlinkOIDC';
import facebookSignOn from './facebookSignOn';
import signInWithGoogle from './signInWithGoogle';
import unlinkSocialIdentity from './unlinkSocialIdentity';
import { LegacyGoogleSettings } from './socialSignOnTypes';
import CookieStorage from '../utils/cookieStorage';
declare global {
interface Window {
FB: any;
gapi: typeof gapi;
}
}
export default abstract class Identity {
static _version: any;
private static _userIdentity;
private static _userProfile;
private static _userSegments;
private static _userSettings;
static _configOptions: ConfigOptions | null;
static _isSession: boolean;
private static _userIdentityStorage;
private static _ampReaderId;
static _profileStorageOpt: Options['profileStorageOpt'];
static _selectedStorage: CookieStorage | Storage | import("../utils/memoryStorage").default;
static apiOrigin: string;
static _baseDomain: string;
static _google: LegacyGoogleSettings | typeof google;
static _useCustomFBButton: boolean;
static _facebookClientId: string | undefined;
static _appleClientId: string | undefined;
static get userIdentity(): UserIdentity;
static set userIdentity(v: UserIdentity);
static get userProfile(): UserProfile | null;
static set userProfile(u: UserProfile | null);
static get userSegments(): UserSegments | null;
static set userSegments(us: UserSegments | null);
static get configOptions(): ConfigOptions;
static get userSettings(): UserSettings | null;
static set userSettings(u: UserSettings | null);
static set baseDomain(v: string);
static get ampReaderId(): string | null | undefined;
static set ampReaderId(u: string | null | undefined);
static get profileStorageOpt(): object | undefined;
static set profileStorageOpt(u: object | undefined);
static options: typeof options;
static login: typeof login;
static isLoggedIn: typeof isLoggedIn;
static extendSession: typeof extendSession;
static clearSession: typeof clearSession;
static heartbeat: typeof heartbeat;
static logout: typeof logout;
static getUserSettings: typeof getUserSettings;
static getUserProfile: typeof getUserProfile;
static getUserSegments: typeof getUserSegments;
static updateUserProfile: typeof updateUserProfile;
static uploadAvatar: typeof uploadAvatar;
static deleteAvatar: typeof deleteAvatar;
static signUp: typeof signUp;
static updatePassword: typeof updatePassword;
static requestResetPassword: typeof requestResetPassword;
static resetPassword: typeof resetPassword;
static requestDeleteAccount: typeof requestDeleteAccount;
static approveDeleteAccount: typeof approveDeleteAccount;
static declineDeleteAccount: typeof declineDeleteAccount;
static getConfig: typeof getConfig;
static initFacebookLogin: typeof initFacebookLogin;
static facebookSignOn: typeof facebookSignOn;
static initGoogleLogin: typeof initGoogleLogin;
static initGoogleAuthSDK: (clientId?: string) => Promise<void>;
static initGoogleAuth: (clientId?: string) => Promise<void>;
static initiateOIDC: (oidcClientId: string, scopes?: [string], redirect?: boolean, isApple?: boolean) => Promise<void | import("../serviceHelpers/APIErrorResponse").APIErrorResponse | import("./oidcClient").initiateOIDCResponse>;
static signInWithOIDC: typeof signInWithOIDC;
static signInWithOIDCPKCE: typeof signInWithOIDCPKCE;
static loginWithArcIdentityAsOIDCProvider: (params: Record<string, string>) => Promise<void | import("../serviceHelpers/APIErrorResponse").APIErrorResponse>;
static unlinkOIDC: typeof unlinkOIDC;
static googleSignOn: (googleUser?: import("./socialSignOnTypes").GoogleUser) => Promise<UserIdentity | import("../serviceHelpers/APIErrorResponse").APIErrorResponse | Error>;
static signInWithGoogle: typeof signInWithGoogle;
static initAppleSignOn: () => Promise<void | import("../serviceHelpers/APIErrorResponse").APIErrorResponse>;
static appleSignOn: (code: string) => Promise<UserIdentity | import("../serviceHelpers/APIErrorResponse").APIErrorResponse>;
static requestMagicLink: typeof requestMagicLink;
static redeemMagicLink: typeof redeemMagicLink;
static requestVerifyEmail: typeof requestVerifyEmail;
static verifyEmail: typeof verifyEmail;
static listGdprReports: typeof listGdprReports;
static getGdprReport: typeof getGdprReport;
static getThirdPartyTokens: typeof getThirdPartyTokens;
static unlinkSocialIdentity: typeof unlinkSocialIdentity;
static requestOTALink: typeof requestOTALink;
static redeemOTALink: typeof redeemOTALink;
static getSwgAccessToken: () => Promise<import("../serviceHelpers/APIErrorResponse").APIErrorResponse | import("./getSwgAccessToken").SwgAccessTokenResponse>;
static checkSwgLogin: (idToken?: string) => Promise<import("../serviceHelpers/APIErrorResponse").APIErrorResponse | Error | import("./checkSwgLogin").CheckSwgLoginResponse>;
static relinkGoogleAccount: (accessToken: string) => Promise<UserIdentity | import("../serviceHelpers/APIErrorResponse").APIErrorResponse | Error>;
static signOnSwgUser: ({ idToken, swgSubscriptionTokenResponse }: {
idToken?: string;
swgSubscriptionTokenResponse?: {
profileId: string;
accessToken: string;
refreshToken: string;
exists: boolean;
};
}) => Promise<UserIdentity | import("../serviceHelpers/APIErrorResponse").APIErrorResponse>;
}