Skip to main content

@idpass/data-collect-core / SubmitFormOptions

Interface: SubmitFormOptions

Defined in: services/EventApplierService.ts:58

Options controlling how an event is applied.

These carry the CALLER's authorization context into the apply path. They are NOT persisted on the event — they only gate the write.

Properties

authorizedMemberGuids?

optional authorizedMemberGuids?: string[]

Defined in: services/EventApplierService.ts:72

When provided, enables RESTRICTED mode for create-group/update-group member sub-writes (horizontal authorization guard on member GUIDs).

A member entry whose guid resolves to a PRE-EXISTING entity is only accepted when that guid is present in this set (the caller's own group, plus its current members). Member entries whose guid does not resolve to any existing entity are always allowed (creating a brand-new member).

Omit this option entirely for TRUSTED, UNBOUNDED callers (e.g. admin sync) — member writes are then unrestricted, preserving legacy sync behaviour.

Methods

isMemberGuidAuthorized()?

optional isMemberGuidAuthorized(guid): Promise<boolean>

Defined in: services/EventApplierService.ts:91

Async predicate variant of the member sub-write guard, for the /api/sync/push path.

A field worker's sync scope is NOT a finite list of GUIDs — it is a PREDICATE over the member entity (its area_id and/or type must fall inside the caller's effective scope). When provided, this callback is consulted for any member entry whose guid resolves to a PRE-EXISTING entity that is not already covered by authorizedMemberGuids (nor the group's own guid / current members). It must resolve true iff the member entity is inside the caller's scope. Member entries whose guid does not resolve to any existing entity are always allowed (brand-new member) and the callback is NOT consulted for them.

Supplying either this callback or authorizedMemberGuids enables RESTRICTED mode. Omit both for unbounded callers.

Parameters

guid

string

Returns

Promise<boolean>