auth/cell_field_action_specs.ts

Cell-field RPC specs — declarative contract for the three named-relation verbs (set / delete / list).

(source_id, name) → target_id edges modeled after JSON object key/value pairs. One target per (source_id, name) pair: re-setting a name overwrites the prior target. cell_field_list is bidirectional: pass source_id for forward fields, target_id for reverse upfields (the latter has 2-layer authz — see handler).

view source

Declarations
#

14 declarations

all_cell_field_action_specs
#

auth/cell_field_action_specs.ts view source

readonly [{ method: string; kind: "request_response"; initiator: "frontend"; auth: { account: "required"; actor: "required"; }; side_effects: true; input: Schema<{ name: Branded<string, "CellFieldName">; source_id: Branded<...>; target_id: Branded<...>; acting?: Branded<...> | undefined; }, { ...; }, "object", { ...... import {all_cell_field_action_specs} from '@fuzdev/fuz_app/auth/cell_field_action_specs.js';

All cell_field action specs — composed into all_cell_action_specs.

cell_field_delete_action_spec
#

auth/cell_field_action_specs.ts view source

also exported from auth/cell_action_specs.ts

{ method: string; kind: "request_response"; initiator: "frontend"; auth: { account: "required"; actor: "required"; }; side_effects: true; input: Schema<{ name: Branded<string, "CellFieldName">; source_id: Branded<...>; acting?: Branded<...> | undefined; }, { ...; }, "object", { ...; }>; output: Schema<...>; async: t... import {cell_field_delete_action_spec} from '@fuzdev/fuz_app/auth/cell_field_action_specs.js';

cell_field_list_action_spec
#

auth/cell_field_action_specs.ts view source

also exported from auth/cell_action_specs.ts

{ method: string; kind: "request_response"; initiator: "frontend"; auth: { account: "optional"; actor: "optional"; }; side_effects: false; input: Schema<{ limit?: number | undefined; acting?: Branded<string, "Uuid"> | undefined; source_id?: Branded<...> | undefined; target_id?: Branded<...> | undefined; name_after?:... import {cell_field_list_action_spec} from '@fuzdev/fuz_app/auth/cell_field_action_specs.js';

CELL_FIELD_NAME_REGEX
#

auth/cell_field_action_specs.ts view source

RegExp import {CELL_FIELD_NAME_REGEX} from '@fuzdev/fuz_app/auth/cell_field_action_specs.js';

Field name grammar — fuz snake_case identifier convention. Anchored ^[a-z][a-z0-9_]{0,63}$: leading letter, alphanumeric + underscore trailing, 64-char cap. No reserved names yet.

cell_field_set_action_spec
#

auth/cell_field_action_specs.ts view source

also exported from auth/cell_action_specs.ts

{ method: string; kind: "request_response"; initiator: "frontend"; auth: { account: "required"; actor: "required"; }; side_effects: true; input: Schema<{ name: Branded<string, "CellFieldName">; source_id: Branded<...>; target_id: Branded<...>; acting?: Branded<...> | undefined; }, { ...; }, "object", { ...; }>; outp... import {cell_field_set_action_spec} from '@fuzdev/fuz_app/auth/cell_field_action_specs.js';

CellFieldDeleteInput
#

auth/cell_field_action_specs.ts view source

value + type

{ name: Branded<string, "CellFieldName">; source_id: Branded<string, "Uuid">; acting?: Branded<string, "Uuid"> | undefined; } import {CellFieldDeleteInput} from '@fuzdev/fuz_app/auth/cell_field_action_specs.js';

Input for cell_field_delete. Idempotent: a successful response is returned even when no row matched.

name

type Branded

source_id

type Branded

acting?

type Branded

CellFieldDeleteOutput
#

auth/cell_field_action_specs.ts view source

value + type

{ ok: true; deleted: boolean; } import {CellFieldDeleteOutput} from '@fuzdev/fuz_app/auth/cell_field_action_specs.js';

ok

type true

deleted

type boolean

CellFieldListInput
#

auth/cell_field_action_specs.ts view source

value + type

{ limit?: number | undefined; acting?: Branded<string, "Uuid"> | undefined; source_id?: Branded<string, "Uuid"> | undefined; target_id?: Branded<string, "Uuid"> | undefined; name_after?: Branded<...> | undefined; } import {CellFieldListInput} from '@fuzdev/fuz_app/auth/cell_field_action_specs.js';

Input for cell_field_list. Pass source_id for forward fields or target_id for reverse upfields — exactly one; both or neither is invalid_params with ERROR_CELL_FIELD_LIST_REQUIRES_SOURCE_OR_TARGET, from the handler (the schema leaves both optional). Reverse listing has 2-layer authz (target view-check gates the call; per-source view-check filters the rows).

Either direction returns a page of up to limit fields (default CELL_RELATION_LIST_LIMIT_DEFAULT) whose other end the caller can view — the view check runs before the limit. Forward listing pages on via name_after (return rows whose name > name_after lex); the reverse listing has no cursor, oldest field first.

limit?

type number

acting?

type Branded

source_id?

type Branded

target_id?

type Branded

name_after?

type Branded

CellFieldListOutput
#

auth/cell_field_action_specs.ts view source

value + type

{ fields: { created_at: string; name: Branded<string, "CellFieldName">; source_id: Branded<string, "Uuid">; target_id: Branded<string, "Uuid">; }[]; } import {CellFieldListOutput} from '@fuzdev/fuz_app/auth/cell_field_action_specs.js';

fields

type FieldJson[]

CellFieldName
#

auth/cell_field_action_specs.ts view source

value + type

Branded<string, "CellFieldName">

type Branded

import {CellFieldName} from '@fuzdev/fuz_app/auth/cell_field_action_specs.js';

external types

Infer<typeof CellFieldName>

CellFieldSetInput
#

auth/cell_field_action_specs.ts view source

value + type

{ name: Branded<string, "CellFieldName">; source_id: Branded<string, "Uuid">; target_id: Branded<string, "Uuid">; acting?: Branded<string, "Uuid"> | undefined; } import {CellFieldSetInput} from '@fuzdev/fuz_app/auth/cell_field_action_specs.js';

Input for cell_field_set. UPSERT on (source_id, name) — re-issuing the same input updates target_id and bumps created_at.

name

type Branded

source_id

type Branded

target_id

type Branded

acting?

type Branded

CellFieldSetOutput
#

auth/cell_field_action_specs.ts view source

value + type

{ field: { created_at: string; name: Branded<string, "CellFieldName">; source_id: Branded<string, "Uuid">; target_id: Branded<string, "Uuid">; }; } import {CellFieldSetOutput} from '@fuzdev/fuz_app/auth/cell_field_action_specs.js';

field

type FieldJson

ERROR_CELL_FIELD_LIST_REQUIRES_SOURCE_OR_TARGET
#

auth/cell_field_action_specs.ts view source

"cell_field_list_requires_source_or_target" import {ERROR_CELL_FIELD_LIST_REQUIRES_SOURCE_OR_TARGET} from '@fuzdev/fuz_app/auth/cell_field_action_specs.js';

Error reason — cell_field_list got neither or both of source_id and target_id.

FieldJson
#

auth/cell_field_action_specs.ts view source

value + type

{ created_at: string; name: Branded<string, "CellFieldName">; source_id: Branded<string, "Uuid">; target_id: Branded<string, "Uuid">; } import {FieldJson} from '@fuzdev/fuz_app/auth/cell_field_action_specs.js';

Wire-format for a cell_field row. ISO created_at, branded UUIDs.

created_at

type string

name

type Branded

source_id

type Branded

target_id

type Branded

Depends on
#

Imported by
#