UNPKG

claude-flow

Version:

Enterprise-grade AI agent orchestration with ruv-swarm integration (Alpha Release)

283 lines 10.3 kB
import { AccessTokenEntity, AccountEntity, AccountInfo, AppMetadataEntity, AuthorityMetadataEntity, CacheManager, CacheRecord, CommonAuthorizationUrlRequest, CredentialType, ICrypto, IdTokenEntity, IPerformanceClient, Logger, RefreshTokenEntity, ServerTelemetryEntity, StaticAuthorityOptions, StoreInCache, ThrottlingEntity, TokenKeys } from "@azure/msal-common/browser"; import { CacheOptions } from "../config/Configuration.js"; import { INTERACTION_TYPE } from "../utils/BrowserConstants.js"; import { MemoryStorage } from "./MemoryStorage.js"; import { IWindowStorage } from "./IWindowStorage.js"; import { PlatformAuthRequest } from "../broker/nativeBroker/PlatformAuthRequest.js"; import { AuthenticationResult } from "../response/AuthenticationResult.js"; import { SilentRequest } from "../request/SilentRequest.js"; import { SsoSilentRequest } from "../request/SsoSilentRequest.js"; import { RedirectRequest } from "../request/RedirectRequest.js"; import { PopupRequest } from "../request/PopupRequest.js"; import { CookieStorage } from "./CookieStorage.js"; import { EventHandler } from "../event/EventHandler.js"; /** * This class implements the cache storage interface for MSAL through browser local or session storage. * Cookies are only used if storeAuthStateInCookie is true, and are only used for * parameters such as state and nonce, generally. */ export declare class BrowserCacheManager extends CacheManager { protected cacheConfig: Required<CacheOptions>; protected browserStorage: IWindowStorage<string>; protected internalStorage: MemoryStorage<string>; protected temporaryCacheStorage: IWindowStorage<string>; protected cookieStorage: CookieStorage; protected logger: Logger; protected performanceClient: IPerformanceClient; private eventHandler; constructor(clientId: string, cacheConfig: Required<CacheOptions>, cryptoImpl: ICrypto, logger: Logger, performanceClient: IPerformanceClient, eventHandler: EventHandler, staticAuthorityOptions?: StaticAuthorityOptions); correlateEvents(correlationId: string): Promise<void>; /** * Tracks upgrades and downgrades for telemetry and debugging purposes */ private trackVersionChanges; /** * Parses passed value as JSON object, JSON.parse() will throw an error. * @param input */ protected validateAndParseJson(jsonValue: string): object | null; /** * Reads account from cache, deserializes it into an account entity and returns it. * If account is not found from the key, returns null and removes key from map. * @param accountKey * @returns */ constructor(accountKey: string): AccountEntity | null; /** * set account entity in the platform cache * @param account */ constructor(account: AccountEntity, correlationId: string): Promise<void>; /** * Returns the array of account keys currently cached * @returns */ constructor(): Array<string>; /** * Add a new account to the key map * @param key */ constructor(key: string): boolean; /** * Remove an account from the key map * @param key */ constructor(key: string): void; /** * Extends inherited removeAccount function to include removal of the account key from the map * @param key */ constructor(key: string): Promise<void>; /** * Removes credentials associated with the provided account * @param account */ constructor(account: AccountEntity): Promise<void>; /** * Removes given idToken from the cache and from the key map * @param key */ constructor(key: string): void; /** * Removes given accessToken from the cache and from the key map * @param key */ constructor(key: string): Promise<void>; /** * Removes given refreshToken from the cache and from the key map * @param key */ constructor(key: string): void; /** * Gets the keys for the cached tokens associated with this clientId * @returns */ constructor(): TokenKeys; /** * Adds the given key to the token key map * @param key * @param type */ constructor(key: string, type: CredentialType): void; /** * Removes the given key from the token key map * @param key * @param type */ constructor(key: string, type: CredentialType): void; /** * generates idToken entity from a string * @param idTokenKey */ constructor(idTokenKey: string): IdTokenEntity | null; /** * set IdToken credential to the platform cache * @param idToken */ constructor(idToken: IdTokenEntity, correlationId: string): Promise<void>; /** * generates accessToken entity from a string * @param key */ constructor(accessTokenKey: string): AccessTokenEntity | null; /** * set accessToken credential to the platform cache * @param accessToken */ constructor(accessToken: AccessTokenEntity, correlationId: string): Promise<void>; /** * generates refreshToken entity from a string * @param refreshTokenKey */ constructor(refreshTokenKey: string): RefreshTokenEntity | null; /** * set refreshToken credential to the platform cache * @param refreshToken */ constructor(refreshToken: RefreshTokenEntity, correlationId: string): Promise<void>; /** * fetch appMetadata entity from the platform cache * @param appMetadataKey */ constructor(appMetadataKey: string): AppMetadataEntity | null; /** * set appMetadata entity to the platform cache * @param appMetadata */ constructor(appMetadata: AppMetadataEntity): void; /** * fetch server telemetry entity from the platform cache * @param serverTelemetryKey */ constructor(serverTelemetryKey: string): ServerTelemetryEntity | null; /** * set server telemetry entity to the platform cache * @param serverTelemetryKey * @param serverTelemetry */ constructor(serverTelemetryKey: string, serverTelemetry: ServerTelemetryEntity): void; /** * */ constructor(key: string): AuthorityMetadataEntity | null; /** * */ constructor(): Array<string>; /** * Sets wrapper metadata in memory * @param wrapperSKU * @param wrapperVersion */ constructor(wrapperSKU: string, wrapperVersion: string): void; /** * Returns wrapper metadata from in-memory storage */ constructor(): [string, string]; /** * * @param entity */ constructor(key: string, entity: AuthorityMetadataEntity): void; /** * Gets the active account */ constructor(): AccountInfo | null; /** * Sets the active account's localAccountId in cache * @param account */ constructor(account: AccountInfo | null): void; /** * fetch throttling entity from the platform cache * @param throttlingCacheKey */ constructor(throttlingCacheKey: string): ThrottlingEntity | null; /** * set throttling entity to the platform cache * @param throttlingCacheKey * @param throttlingCache */ constructor(throttlingCacheKey: string, throttlingCache: ThrottlingEntity): void; /** * Gets cache item with given key. * Will retrieve from cookies if storeAuthStateInCookie is set to true. * @param key */ constructor(cacheKey: string, generateKey?: boolean): string | null; /** * Sets the cache item with the key and value given. * Stores in cookie if storeAuthStateInCookie is set to true. * This can cause cookie overflow if used incorrectly. * @param key * @param value */ constructor(cacheKey: string, value: string, generateKey?: boolean): void; /** * Removes the cache item with the given key. * @param key */ constructor(key: string): void; /** * Removes the temporary cache item with the given key. * Will also clear the cookie item if storeAuthStateInCookie is set to true. * @param key */ constructor(key: string): void; /** * Gets all keys in window. */ constructor(): string[]; /** * Clears all cache entries created by MSAL. */ constructor(): Promise<void>; /** * Clears all access tokes that have claims prior to saving the current one * @param performanceClient {IPerformanceClient} * @param correlationId {string} correlation id * @returns */ constructor(performanceClient: IPerformanceClient, correlationId: string): Promise<void>; /** * Prepend msal.<client-id> to each key; Skip for any JSON object as Key (defined schemas do not need the key appended: AccessToken Keys or the upcoming schema) * @param key * @param addInstanceId */ constructor(key: string): string; /** * Reset all temporary cache items * @param state */ constructor(): void; constructor(authCodeRequest: CommonAuthorizationUrlRequest, codeVerifier?: string): void; /** * Gets the token exchange parameters from the cache. Throws an error if nothing is found. */ constructor(): [CommonAuthorizationUrlRequest, string]; /** * Gets cached native request for redirect flows */ constructor(): PlatformAuthRequest | null; constructor(matchClientId?: boolean): boolean; constructor(): { clientId: string; type: INTERACTION_TYPE; } | null; constructor(inProgress: boolean, type?: INTERACTION_TYPE): void; /** * Builds credential entities from AuthenticationResult object and saves the resulting credentials to the cache * @param result * @param request */ constructor(result: AuthenticationResult, request: SilentRequest | SsoSilentRequest | RedirectRequest | PopupRequest): Promise<void>; /** * saves a cache record * @param cacheRecord {CacheRecord} * @param storeInCache {?StoreInCache} * @param correlationId {?string} correlation id */ constructor(cacheRecord: CacheRecord, correlationId: string, storeInCache?: StoreInCache): Promise<void>; } export declare const DEFAULT_BROWSER_CACHE_MANAGER: (clientId: string, logger: Logger, performanceClient: IPerformanceClient, eventHandler: EventHandler) => BrowserCacheManager; //# sourceMappingURL=BrowserCacheManager.d.ts.map