import { guid, uuid } from '../../modules/utils'; import { EscalationClientService } from './client'; /** * Escalation queue — the canonical signal-pause surface for HotMesh workflows. * * `public.hmsh_escalations` is a global Postgres table written by both the * YAML DAG hook activity and `Durable.workflow.condition()`. Any consumer * can interact with the queue using just a Postgres connection — no Durable * dependency required. * * ## Quick Start * * ```typescript * import { Escalations } from '@hotmeshio/hotmesh'; * import { Client as Postgres } from 'pg'; * * const client = new Escalations.Client({ * connection: { * class: Postgres, * options: { connectionString: 'postgresql://usr:pwd@localhost:5432/db' }, * }, * }); * * // List all available approvals for the 'manager' role * const pending = await client.list({ role: 'manager', available: true }); * * // Claim one atomically * const result = await client.claimByMetadata({ * key: 'orderId', value: 'order-123', * assignee: 'alice@company.com', * roles: ['manager', 'senior-manager'], * }); * * // Resolve and resume the waiting workflow in one round-trip * if (result.ok) { * await client.resolve({ id: result.entry.id, resolverPayload: { approved: true } }); * } * ``` */ declare class EscalationsClass { /** @private */ constructor(); /** * Creates an escalation queue client. Pass a `connection` for standalone * use, or inject a `getHotMeshClient` function to share an existing * engine pool (e.g. from a `Durable.Client`). */ static Client: typeof EscalationClientService; /** * Generate a compact HotMesh identifier (not RFC 4122). * Use `Escalations.uuid()` for DB primary keys. */ static guid: typeof guid; /** * Generate a standard RFC 4122 v4 UUID — required for the `id` field * when calling `client.migrate()` or any direct UUID column insert. */ static uuid: typeof uuid; /** * Gracefully stop all escalation engine instances. * Call from your process signal handlers (`SIGTERM`, `SIGINT`). */ static shutdown(): Promise; } export { EscalationsClass as Escalations }; export { EscalationClientService }; export { ESCALATION_RESOLUTION_KEY } from './client'; export { foldBatchConfig } from './batch'; export { foldAccumulateConfig, assertAccumulateItemKey } from './accumulate'; export { foldEscalationConfig } from './fold'; export { ESCALATION_BATCH_PENDING_KEY, ESCALATION_BATCH_COUNT_KEY, ESCALATION_BATCH_KEYS_KEY, ESCALATION_BATCH_ITEMS_KEY, ESCALATION_BATCH_FILLED_AT_KEY, ESCALATION_BATCH_PARTIAL_ON_TIMEOUT_KEY, ESCALATION_BATCH_ITEM_KEY_MAX_LENGTH, ESCALATION_ACCUMULATE_COUNT_KEY, ESCALATION_ACCUMULATE_MAX_KEY, ESCALATION_ACCUMULATE_KEYS_KEY, ESCALATION_ACCUMULATE_ITEMS_KEY, ESCALATION_ACCUMULATE_CONFIG_KEY, ESCALATION_ACCUMULATED_KEY, ESCALATION_TRIGGER_KEY, } from '../../types/hmsh_escalations';