import { $Fetch } from 'ofetch'; import { ContentRule, ContentRuleListResponse, RuleCreatePayload, RuleListQuery, RuleUpdatePayload, SignalFireContext, SignalFireResponse } from './rules.type'; export interface IRulesServiceOptions { /** The CMS `$Fetch` instance (one of `sdk.apis`). */ api: $Fetch; /** Lazy flag — when true, the service returns fake data. */ mock: () => boolean; } export interface IRulesService { list(query?: RuleListQuery): Promise; detail(uuid: string): Promise; create(payload: RuleCreatePayload): Promise; update(uuid: string, payload: RuleUpdatePayload): Promise; remove(uuid: string): Promise; /** * Manually fire a signal rule (`POST /api/v1/rules/signals/fire`). Runs * synchronously in the API pod — the canonical way to verify an action * handler works without scheduling cron (cron + action is currently broken * backend-side; see `risk-rules-api-guide.md` §8.F). * * Pass `options.timeoutMs` to override the SDK-wide 30s HTTP timeout * (the API pod runs the rule synchronously and a multi-step action chain * can exceed 30s on real traffic — the dashboard's "Fire now" dialog * raises the ceiling to 120s by default). */ signalFire(signalName: string, context: SignalFireContext, options?: { timeoutMs?: number; }): Promise; } /** * Content-rules service. CRUD over `/api/v1/rules`. Serves both FEAT-002 * (`conditionType: 'llm_agent'` skills) and FEAT-004 (expression/chain). * * Endpoint contract (`eaera_cms/core/rules/routes.py`): * GET /api/v1/rules → list (no pagination; `total === items.length`) * GET /api/v1/rules/{uuid} → single rule * POST /api/v1/rules → create (flat payload) * PUT /api/v1/rules/{uuid} → update * DELETE /api/v1/rules/{uuid} → remove * POST /api/v1/rules/signals/fire → fire a signal rule synchronously * * The route accepts the flat `RuleCreatePayload` (`TriggerCreateRequest`, * `extra: allow`) and the service reads flat top-level keys. See rules.type.ts. * * While `mock()` returns true, all methods resolve against the local fake * dataset and never touch `api`. */ export declare function createRulesService(opts: IRulesServiceOptions): IRulesService; //# sourceMappingURL=index.d.ts.map