import { RedisClientType } from 'redis'; import { PublicStates, IProduct, IRequestExtension, EnvType, IFetchFilesPayload, IFileURLPayload, IFetchUsersPayload } from '../../types'; export interface IBootstrapActionParams { product_tag?: string; env_slug: string; access_tag: string; action_tag: string; } export interface IBootstrapActionResponse { product_id: string; workspace_id: string; private_key: string; action: any; app_env: any; product_env_mapping: any; retries: number; app_active: boolean; recipient_workspace_id: string; app_id?: string; } export interface IBootstrapNotificationParams { product_tag: string; env_slug: string; notification_tag: string; message_tag: string; } export interface IBootstrapNotificationResponse { product_id: string; workspace_id: string; private_key: string; env: any; notification: any; message: any; } export interface IBootstrapStorageParams { product_tag: string; env_slug: string; storage_tag: string; } export interface IBootstrapStorageResponse { product_id: string; workspace_id: string; private_key: string; env: any; storage: any; storage_env: any; } export interface IBootstrapSessionParams { product_tag: string; env_slug: string; session_tag: string; } export interface IBootstrapSessionResponse { product_id: string; workspace_id: string; private_key: string; env: any; session: any; } export interface IBootstrapDatabaseParams { product_tag: string; env_slug: string; database_tag: string; } export interface IBootstrapDatabaseResponse { product_id: string; workspace_id: string; private_key: string; env: any; database: any; database_env: any; } export interface IBootstrapBrokerParams { product_tag: string; env_slug: string; broker_tag: string; topic_tag?: string; } export interface IBootstrapBrokerResponse { product_id: string; workspace_id: string; private_key: string; env: any; broker: any; broker_env: any; topic?: any; } export interface IBootstrapGraphParams { product_tag: string; env_slug: string; graph_tag: string; } export interface IBootstrapGraphResponse { product_id: string; workspace_id: string; private_key: string; env: any; graph: any; graph_env: any; } export interface IBootstrapVectorParams { product_tag: string; env_slug: string; vector_tag: string; } export interface IBootstrapVectorResponse { product_id: string; workspace_id: string; private_key: string; env: any; vector: any; vector_env: any; } export type BootstrapResilienceComponentType = 'healthcheck' | 'quota' | 'fallback'; export interface IBootstrapResilienceParams { product_tag: string; env_slug: string; component_type: BootstrapResilienceComponentType; component_tag: string; } export interface IBootstrapResilienceResponse { product_id: string; workspace_id: string; private_key: string; env: any; component: any; component_env: any | null; } export interface IBootstrapIntelligenceParams { product_tag: string; env_slug: string; agent_tag: string; } export interface IBootstrapIntelligenceResponse { product_id: string; workspace_id: string; private_key: string; env: any; agent: any; agent_env: any | null; } export interface IBootstrapFeatureStep { step_tag: string; type: 'action' | 'notification' | 'storage' | 'database' | 'broker' | 'graph' | 'vector' | 'quota' | 'fallback'; access_tag?: string; action_tag?: string; notification_tag?: string; message_tag?: string; storage_tag?: string; database_tag?: string; broker_tag?: string; topic_tag?: string; graph_tag?: string; vector_tag?: string; component_tag?: string; } export interface IBootstrapFeatureParams { product_tag: string; env_slug: string; workspace_id: string; steps: IBootstrapFeatureStep[]; } export interface IGenerateExecutablePayloadParams { product_tag: string; env_slug: string; operation_family: string; method: string; targets?: Record; include_session?: boolean; include_cache?: boolean; schema_mode?: 'strict' | 'best_effort'; input_hint?: Record; } export interface IGenerateExecutablePayloadResponse { payload: Record; meta: Record; } export interface IProductsApiService { createProduct(payload: Partial, auth: IRequestExtension): Promise; updateProduct(product_id: string, payload: Record, auth: IRequestExtension): Promise; deleteProduct(product_id: string, auth: IRequestExtension): Promise; checkProductNameExists(name: string, auth: IRequestExtension): Promise; fetchProduct(product_id: string, auth: IRequestExtension): Promise; fetchProductByTag(product_tag: string, payload: IRequestExtension): Promise; fetchWorkspaceProducts(status: PublicStates, payload: IRequestExtension): Promise>; fetchProductStorageFiles(payload: IFetchFilesPayload, auth: IRequestExtension): Promise>; fetchProductSessionUsers(payload: IFetchUsersPayload, auth: IRequestExtension): Promise>; fetchProductSessionUser(ductape_user_id: string, auth: IRequestExtension): Promise; fetchProductComponents(product_id: string, component_type: string, auth: IRequestExtension): Promise; fetchProductComponentByTag(product_id: string, component_type: string, tag: string, auth: IRequestExtension): Promise; initProduct(id: string, auth?: IRequestExtension): Promise<{ _id: string; tag: string; private_key: string; }>; bootstrapAction(params: IBootstrapActionParams, auth: IRequestExtension): Promise; bootstrapNotification(params: IBootstrapNotificationParams, auth: IRequestExtension): Promise; bootstrapStorage(params: IBootstrapStorageParams, auth: IRequestExtension): Promise; bootstrapSession(params: IBootstrapSessionParams, auth: IRequestExtension): Promise; bootstrapDatabase(params: IBootstrapDatabaseParams, auth: IRequestExtension): Promise; bootstrapBroker(params: IBootstrapBrokerParams, auth: IRequestExtension): Promise; bootstrapGraph(params: IBootstrapGraphParams, auth: IRequestExtension): Promise; bootstrapVector(params: IBootstrapVectorParams, auth: IRequestExtension): Promise; bootstrapResilience(params: IBootstrapResilienceParams, auth: IRequestExtension): Promise; bootstrapIntelligence(params: IBootstrapIntelligenceParams, auth: IRequestExtension): Promise; bootstrapFeature(params: IBootstrapFeatureParams, auth: IRequestExtension): Promise>; generateExecutablePayload(params: IGenerateExecutablePayloadParams, auth: IRequestExtension): Promise; } export declare class ProductsApiService implements IProductsApiService { private environment; constructor(environment: EnvType, redis_client?: RedisClientType); createProduct(payload: Partial, auth: IRequestExtension): Promise; updateProduct(product_id: string, payload: Partial, auth: IRequestExtension): Promise; deleteProduct(product_id: string, auth: IRequestExtension): Promise; fetchProduct(product_id: string, auth: IRequestExtension): Promise; fetchProductByTag(product_tag: string, payload: IRequestExtension): Promise; fetchProductStorageFiles(payload: IFetchFilesPayload, auth: IRequestExtension): Promise>; fetchProductSessionUsers(payload: IFetchUsersPayload, auth: IRequestExtension): Promise>; fetchProductSessionUser(ductape_user_id: string, auth: IRequestExtension): Promise; checkProductNameExists(name: string, auth: IRequestExtension): Promise; fetchWorkspaceProducts(status: PublicStates, payload: IRequestExtension): Promise>; /** * Fetch all components of a specific type for a product/integration * @param product_id - The product/integration ID * @param component_type - The type of component (database, notification, job, etc.) * @returns Array of components */ fetchProductComponents(product_id: string, component_type: string, auth: IRequestExtension): Promise; /** * Fetch a specific component by tag from a product/integration * @param product_id - The product/integration ID * @param component_type - The type of component (database, notification, job, etc.) * @param tag - The component tag * @returns The component object */ fetchProductComponentByTag(product_id: string, component_type: string, tag: string, auth: IRequestExtension): Promise; /** * Initialize product - fetch minimal product data (optimized for speed) * Returns _id, tag, and private_key (products don't have versions) * @param id - Either the product tag or _id * @param auth - Authentication credentials including access_key for validation * @returns Object with _id, tag, and private_key */ initProduct(id: string, auth: IRequestExtension): Promise<{ _id: string; tag: string; private_key: string; }>; /** * Bootstrap action - single lightweight API call to fetch ALL data needed for processAction * Replaces 5+ separate API calls with a single database query using MongoDB $lookup * @param params - product_tag, env_slug, access_tag * @param auth - Authentication credentials * @returns All data needed: product, env, product_app, third_party_app */ bootstrapAction(params: IBootstrapActionParams, auth: IRequestExtension): Promise; /** * Bootstrap notification - single lightweight API call to fetch notification data * @param params - product_tag, env_slug, notification_tag, message_tag * @param auth - Authentication credentials * @returns Notification config and message template */ bootstrapNotification(params: IBootstrapNotificationParams, auth: IRequestExtension): Promise; /** * Bootstrap storage - single lightweight API call to fetch storage data * @param params - product_tag, env_slug, storage_tag * @param auth - Authentication credentials * @returns Storage config and env settings */ bootstrapStorage(params: IBootstrapStorageParams, auth: IRequestExtension): Promise; /** * Bootstrap session - single lightweight API call to fetch session runtime data */ bootstrapSession(params: IBootstrapSessionParams, auth: IRequestExtension): Promise; bootstrapDatabase(params: IBootstrapDatabaseParams, auth: IRequestExtension): Promise; bootstrapBroker(params: IBootstrapBrokerParams, auth: IRequestExtension): Promise; bootstrapGraph(params: IBootstrapGraphParams, auth: IRequestExtension): Promise; bootstrapVector(params: IBootstrapVectorParams, auth: IRequestExtension): Promise; bootstrapResilience(params: IBootstrapResilienceParams, auth: IRequestExtension): Promise; bootstrapIntelligence(params: IBootstrapIntelligenceParams, auth: IRequestExtension): Promise; /** * Bootstrap feature - fetch all action/notification/storage data for multiple steps in one API call */ bootstrapFeature(params: IBootstrapFeatureParams, auth: IRequestExtension): Promise>; generateExecutablePayload(params: IGenerateExecutablePayloadParams, auth: IRequestExtension): Promise; }