UNPKG

@tableau/taco-toolkit

Version:
62 lines (61 loc) 2.53 kB
import { CallerType } from '../../../shared/enums/caller-type'; import { I18nConfig } from '../../types/i18n-config'; import { ConnectionManager } from './connection-manager'; import { getConnectorConfig } from './connector-config'; interface TacoInitializerConfig { appDir: string; handlersDir: string; callerType: CallerType; i18n: I18nConfig; } export declare class TacoInitializer { private readonly appDir; private readonly handlersDir; private readonly callerType; /** EPS app i18n settings */ private readonly i18nConfig; private readonly connectionManager; /** Set of distinct connector names that have been initialized */ private initializedSet; /** Distinct name by path. Used only on server because path cannot be reused. */ private initializedMap; /** map Distinct connector name to its dest app path to adapt to localization context from the monolith */ private connectorAppPathMap; private supportedLanguages; private supportedLocales; constructor(connectionManager: ConnectionManager, config: TacoInitializerConfig); private makeDistinctConnectorName; private getHashCode; getOrInitializeDistinctConnectorName({ connectionId, connectorClass, tacoPath, }: { connectionId: string; connectorClass: string; tacoPath: string; }): Promise<string>; getConnectorJsonPath(distinctConnectorName: string): string; getConnectorHandlersPath(distinctConnectorName: string): string; getConnectorConfig(distinctConnectorName: string): ReturnType<typeof getConnectorConfig>; /** * Ensure localized connectors are adapted for localization resources. * - no-opt for non-localized connectors * - process localized connectors for calls: * 1) /launch * 2) /web-authoring/app-url * @param distinctConnectorName * @param language * @param locale */ adaptLocalizedConnector(distinctConnectorName: string, { language, locale }: I18nConfig): string; /** * Ensure connector initialized. * @param connectionId * @param connectorClass * @param tacoPath * @returns distinct connector name, i.e., connectorClass-SHA */ ensureTacoInitialized(connectionId: string | null, connectorClass: string, tacoPath: string): Promise<string>; private extractLocales; private initialize; /** Checks if the server has deleted the files in the leaf directories used by the connector. */ private isDirectoryPurged; } export {};