export interface ContextData { eventId: string; eventType: string; } export interface ExecutionContext extends ContextData { startTime: string; } /** * SandboxContext manages the execution context for sandboxed code execution * using AsyncLocalStorage to maintain correlation between event and site information */ export declare class SandboxContext { private asyncLocalStorage; constructor(); /** * Creates a new execution context with event and site information * @param {Object} contextData - The context data containing event and site information * @param {string} contextData.eventId - The unique identifier for the event * @param {string} contextData.eventType - The type of the event (e.g., 'customer_created') * @param {string} contextData.site - The site/tenant identifier in Chargebee * @param {Function} callback - The function to execute within this context * @returns {Promise} The result of the callback execution */ run(contextData: ContextData, callback: () => Promise): Promise; /** * Gets the current execution context * @returns {Object|null} The current context or null if not in an execution context */ getCurrentContext(): ExecutionContext | undefined; /** * Checks if there is an active execution context * @returns {boolean} True if there is an active context, false otherwise */ hasContext(): boolean; } export declare const sandboxContext: SandboxContext; export default sandboxContext;