import { RedisClientType } from 'redis'; import { ImportDocsTypes, IApp, IAppAccess, IBuilderSession, IBuilderSessionCreatePayload, ICreateApp, ICreateAppBuilder, IFetchSessionPayload, PublicStates, IAccess, IRequestExtension, EnvType } from '../../types'; export interface IAppApiService { fetchAppBuilderSession(payload: IFetchSessionPayload): Promise; createAppBuilderSession(payload: IBuilderSessionCreatePayload): Promise; checkAppNameExists(name: string, payload: IRequestExtension): Promise; invalidateAppNameLookupCache(app_name: string, workspace_id: string): Promise; invalidateAppTagLookupCache(app_tag: string, workspace_id: string): Promise; fetchApp(app_id: string, auth: IRequestExtension): Promise; importApp(app_id: string, type: ImportDocsTypes, file: Buffer, version: string, update: boolean, auth: IRequestExtension, isAdminImport: boolean): Promise; createApp(payload: ICreateApp, auth: IRequestExtension): Promise; updateApp(app_id: string, payload: Record, auth: IRequestExtension): Promise; deleteApp(app_id: string, auth: IRequestExtension): Promise; fetchWorkspaceApps(status: PublicStates, payload: IRequestExtension): Promise>; fetchAccessByTag(access_tag: string, payload: IRequestExtension): Promise; fetchAppByTag(app_tag: string, payload: IRequestExtension): Promise; createAppAccess(app_id: string, integration_id: string, access_tag: string, payload: IRequestExtension): Promise; fetchAppComponents(app_id: string, component_type: string, auth: IRequestExtension, version?: string): Promise; fetchAppComponentByTag(app_id: string, component_type: string, tag: string, auth: IRequestExtension, version?: string): Promise; initApp(id: string, auth: IRequestExtension): Promise<{ _id: string; tag: string; private_key: string; versions: Array<{ tag: string; latest: boolean; active: boolean; }>; }>; } export declare class AppApiService implements IAppApiService { private environment; private redisClient; constructor(environment: EnvType, redis_client?: RedisClientType); fetchAppBuilderSession(payload: IFetchSessionPayload): Promise; updateAppBuilderSession(): Promise; importApp(app_id: string, type: ImportDocsTypes, file: Buffer, version: string, update: boolean, auth: IRequestExtension, isAdminImport: boolean): Promise; createAppBuilderSession(payload: IBuilderSessionCreatePayload): Promise; checkAppNameExists(app_name: string, auth: IRequestExtension): Promise; invalidateAppNameLookupCache(app_name: string, workspace_id: string): Promise; invalidateAppTagLookupCache(app_tag: string, workspace_id: string): Promise; fetchApp(app_id: string, auth: IRequestExtension): Promise; createApp(payload: ICreateAppBuilder, auth: IRequestExtension): Promise; updateApp(app_id: string, payload: Record, auth: IRequestExtension): Promise; deleteApp(app_id: string, auth: IRequestExtension): Promise; fetchWorkspaceApps(status: PublicStates, payload: IRequestExtension): Promise>; fetchAccessByTag(access_tag: string, payload: IRequestExtension): Promise; fetchAppByTag(app_tag: string, payload: IRequestExtension): Promise; createAppAccess(app_id: string, integration_id: string, access_tag: string, payload: IRequestExtension): Promise; /** * Fetch all components of a specific type for an app * @param app_id - The app ID * @param component_type - The type of component (action, auth, env, etc.) * @param version - Optional version tag. If not provided, fetches from latest version * @returns Array of components */ fetchAppComponents(app_id: string, component_type: string, auth: IRequestExtension, version?: string): Promise; /** * Fetch a specific component by tag * @param app_id - The app ID * @param component_type - The type of component (action, auth, env, etc.) * @param tag - The component tag * @param version - Optional version tag. If not provided, fetches from latest version * @returns The component object */ fetchAppComponentByTag(app_id: string, component_type: string, tag: string, auth: IRequestExtension, version?: string): Promise; /** * Initialize app - fetch minimal app data (optimized for speed) * Returns _id, tag, private_key, and versions array with minimal fields * @param id - Either the app tag or _id * @param auth - Optional authentication credentials * @returns Object with _id, tag, private_key, and versions array */ initApp(id: string, auth: IRequestExtension): Promise<{ _id: string; tag: string; private_key: string; versions: Array<{ tag: string; latest: boolean; active: boolean; }>; }>; }