import { CustomFetchHandler, CustomHandler, CustomSaveHandler, CustomSearchHandler, CustomStaticFetchHandler, CustomValidationHandler, ChangeSetHandlerDefinition, FunctionRoute, ResourceDefinition, RestMethod, SharedFunctionHandler } from '../types'; import { SharedResourcesProvider } from '../types/innerFunction'; export declare function createSaveHandler(customHandler: CustomSaveHandler): FunctionRoute; export declare function createFetchHandler(customHandler: CustomFetchHandler): FunctionRoute; export declare function createValidationHandler(customHandler: CustomValidationHandler): FunctionRoute; export declare function createStaticFetchHandler(customHandler: CustomStaticFetchHandler): FunctionRoute; /** * MEXWEX V2 resource fetch dispatcher. * * Registers POST /resource_fetch. One invocation carries N resource names; * the dispatcher fans them out internally with per-name try/catch so a single * bad handler can't sink the batch. Per-resource scope is read from the * declaration, not from the input — 'Static' resources have `contextObjectId` * stripped from the handler context. */ export declare function createResourceFetchHandler(resources: ResourceDefinition[]): FunctionRoute; /** * MEXWEX V2 shared-function resource fetch dispatcher (single-dispatch variant). * * Registers the same POST /resource_fetch route as createResourceFetchHandler, * with the same per-name try/catch, scope-strip, error codes, materializedAt * stamp and `{results:{[name]}}` shape. Two differences: * * - instead of a per-resource `def.fetch`, every name is served by ONE * `handler(name, scope, perNameInput)` that switches on the name; * - the provider holds no resource list, so each name's `scope` arrives on the * wire. The backend's `shared_function_resource` registry is the single copy * of the descriptors, written at install from the same build-time enumeration. * * Consequently there is no UNKNOWN_RESOURCE here — the registry rejects a name no * provider serves before it ever reaches a lambda. A name the registry routes but * this handler does not switch on surfaces as HANDLER_ERROR, from the handler's * own throw. */ export declare function createSingleDispatchResourceFetchHandler(handler: SharedFunctionHandler): FunctionRoute; /** * MEXWEX V2 shared-function resource enumeration. * * Registers POST /resource_descriptor. Resolves the provider's `resources` * declaration — running the author's thunk if it is one — against the utilities bag * built from the INVOKING caller's credentials, and returns the descriptors plus the * feature flags. Same producer (`deriveSharedFeatures`) as the build-time enumeration, * so `info.json.features` and this response are the same shape. * * This is the ONLY route that resolves the thunk. /resource_fetch deliberately does * not: a dynamic declaration may call a tenant API, and the token on a fetch belongs * to whichever field user triggered the cold start, so the catalog would depend on who * invoked first. The backend gates this route behind an admin-only resync, which is * what makes running the thunk here safe. * * A throwing thunk propagates: the caller learns the provider cannot state what it * serves, and the registry is left untouched. */ export declare function createResourceDescriptorHandler(resources?: SharedResourcesProvider, changeSetHandlers?: ChangeSetHandlerDefinition[]): FunctionRoute; /** * MEXWEX V2 changeset dispatcher — handle phase. * * Registers POST /changeset. One invocation carries a batch of changes sharing * one handler `name`. Matches the handler by name and dispatches by which * form of handler it declared: * - `handleChanges` — called ONCE with every change in the batch, so the * author can issue a single mutation and get one DB transaction. * - `handle` — called once per change, SEQUENTIALLY (not Promise.all), so * that e.g. two inserts into the same table never read the same * max(Seq) concurrently and collide. * Either way the result is a per-change `{ uid, handled, resolvedUid? }` * outcome so the backend knows which changes still need the default mutation. * Both paths run `assertOutcomeReportsUid` over the outcomes they produce. * * An empty / unmatched name makes every change fall through (handled: false) to * the backend's default mutation. A throwing handler is NOT isolated — it * propagates so the whole changeset CE is marked failed (no partial apply). */ export declare function createChangeSetHandler(handlers: ChangeSetHandlerDefinition[]): FunctionRoute; /** * MEXWEX V2 changeset dispatcher — handleAfter phase. * * Registers POST /changeset_after. Invoked by the backend after it resolved temp * uids and applied any default mutation. Runs the matched handler's optional * `handleAfter` once per change with the resolved uid. A no-op (200 empty body) * when the name is unmatched or the handler declares no `handleAfter`. */ export declare function createChangeSetAfterHandler(handlers: ChangeSetHandlerDefinition[]): FunctionRoute; export declare function createSearchHandler(customHandler: CustomSearchHandler): FunctionRoute; export declare function createCustomHandler(outerMethod: RestMethod, outerPath: string, customHandler: CustomHandler): FunctionRoute; //# sourceMappingURL=routes.d.ts.map