import { ESPCDFAutomationsByIDMap, ESPSDKAdaptorAutomationsPaginationMap } from "../types/store/automation"; import { ESPCDFAutomation } from "../entities/ESPCDFAutomation"; import { ESPCDFPaginatedAPIResponse } from "../types"; export default class AutomationStore { #private; accessor ESPCDFAutomationsByIDMap: ESPCDFAutomationsByIDMap; accessor sdkAdaptorAutomationsPaginationMap: ESPSDKAdaptorAutomationsPaginationMap; constructor(); /** Releases this store's entity subscriptions. Called by `ESPCDF.dispose`. */ dispose(): void; get automationsList(): ESPCDFAutomation[]; setAutomationsList(automations: ESPCDFAutomation[]): void; /** * Gets the automation ID from either ESPCDFAutomation or */ private getAutomationId; /** * Prepares an automation for storage by making it observable and attaching to synchronizer */ private prepareAutomationForStore; addAutomation(automation: ESPCDFAutomation): ESPCDFAutomation; updateAutomation(id: string, update: Partial): void; removeAutomation(id: string): void; /** * Clears all automations from the store and removes all callbacks * This should be called on logout to clean up state */ clear(): void; /** * Processes a paginated automations response and updates the store * Similar to existing-app-cdf's processAutomationsRes method * @param response - The paginated response from getAutomations * @param sdkIdentifier - Optional SDK identifier for storing pagination context per SDK * @returns The processed response with automations */ processAutomationsRes(response: ESPCDFPaginatedAPIResponse, sdkIdentifier: string): ESPCDFPaginatedAPIResponse; /** * Fetches the next page of automations if available * Similar to existing-app-cdf's fetchNext method * @param sdkIdentifier - Optional SDK identifier to fetch next page for specific SDK * @returns The next page of automations */ fetchNext(sdkIdentifier: string): Promise>; /** * Gets pagination context for a specific SDK * @param sdkIdentifier - The SDK identifier * @returns The pagination context or undefined if not found */ getPaginationContext(sdkIdentifier: string): import("../types").ESPSDKAdaptorAutomationsPaginationData; /** * Checks if there are more automations to fetch for a specific SDK * @param sdkIdentifier - The SDK identifier * @returns True if there are more automations to fetch */ hasNext(sdkIdentifier: string): boolean; /** * Deletes an automation from both the backend (via SDK) and the local store * @param id The ID of the automation to delete * @returns Result of the operation */ deleteAutomation(id: string): Promise; /** * Get an automation by its ID * @param id The automation ID * @returns The automation entity or undefined if not found */ getAutomationById(id: string): ESPCDFAutomation | undefined; }