auth/all_cell_actions.ts

view source

Declarations
#

3 declarations

AllCellActionDeps
#

auth/all_cell_actions.ts view source

AllCellActionDeps

type ActionFactoryDeps & { validate_data?: ((kind: string | null, data: Readonly<{ label?: string | undefined; summary?: string | undefined; } & Record<string, unknown>>) => void) | undefined; authorize_create?: CellCreateAuthorize | undefined; } & { authorize_grant_create?: CellGrantCreateAuthorize | undefined; authorize_grant_revoke?: CellGrantRevokeAuthorize | undefined; }

import type {AllCellActionDeps} from '@fuzdev/fuz_app/auth/all_cell_actions.js';

Dependencies for create_all_cell_actions — the CRUD factory's CellActionDeps plus the grant factory's optional authorize_grant_create and authorize_grant_revoke.

log

Structured logger instance.

type Logger

audit

Bound audit emitter for audit writes.

type AuditEmitter

validate_data?

type (kind: string | null, data: Readonly<{ label?: string | undefined; summary?: string | undefined; } & Record<string, unknown>>): void

kind

type string | null

data

type Readonly<CellData>
returns void

authorize_create?

type CellCreateAuthorize

authorize_grant_create?

type (auth: RequestActorContext, input: CellGrantCreateAuthorizeInput, ctx: ActionContext): boolean | Promise<...>

auth

input

ctx

returns boolean | Promise<boolean>

authorize_grant_revoke?

type (auth: RequestActorContext, input: CellGrantRevokeAuthorizeInput, ctx: ActionContext): boolean | Promise<...>

auth

input

ctx

returns boolean | Promise<boolean>

AllCellActionsOptions
#

create_all_cell_actions
#

auth/all_cell_actions.ts view source

(deps: AllCellActionDeps, options: AllCellActionsOptions): RpcAction[] import {create_all_cell_actions} from '@fuzdev/fuz_app/auth/all_cell_actions.js';

Build the full cell RPC action set — CRUD (create_cell_actions, which also carries cell_clone) + grant ACL + field + item relations + per-cell audit — as a single handler-bound bundle.

The handler-side twin of the all_cell_action_specs spec bundle and the sibling of create_standard_rpc_actions. Assembling the five cell factories here means an HTTP-RPC mount and a WS mount (or two different backends) can't silently diverge on which cell verbs they expose — the spine_method_coverage reconciliation gate enforces that the spine's live mount matches its coverage manifest, and this aggregator is the single list every mount draws from.

Distinct from create_cell_actions (the CRUD-only factory this bundles) — reach for this whenever a backend mounts the complete cell layer.

deps

AllCellActionDeps (log, audit, the optional validate_data, authorize_create, authorize_grant_create, and authorize_grant_revoke)

options

the role registry for grant validation

returns

RpcAction[]

every cell RpcAction, in mount order

Depends on
#

Imported by
#