Skip to content

ReadAppInstance

Presents one App inside a read execution, with read-only access to its Templates, Roles, searches and Unions.

Members that write, such as Mutations and Event publishers, are only available on WriteAppInstance.

  • BaseAppInstance

readonly metrics: Record<string, MetricInstance>

Metrics declared by this App, keyed by Metric key.

BaseAppInstance.metrics


readonly prn: string

The PRN identifying this App, for example prn::identity.

BaseAppInstance.prn


readonly queries: Record<string, QueryHandlerInstance>

Query handlers declared by this App, keyed by Query key.

BaseAppInstance.queries


readonly roles: Record<string, ReadAppRoleInstance>

App Roles declared by this App, keyed by Role key.


readonly searches: Record<string, ReadSearchIndexInstance>

Search indexes declared by this App, keyed by search index key.


readonly templates: Record<string, ReadTemplate>

Templates declared by this App, keyed by Template key.


readonly unions: Record<string, ReadUnionInstance>

Unions declared by this App, keyed by Union key.


readonly workspaceId: string

The identifier of the Workspace.

BaseAppInstance.workspaceId

assertRole(role): true

Confirms that the active principal holds an App Role.

ReadAppRoleInstance

The Role to check, normally taken from roles.

true

true when the Role is held.

AssertRoleFailedError when the active principal does not hold the Role.

BaseAppInstance.assertRole


checkRole(role): boolean

Reports whether the active principal holds an App Role.

ReadAppRoleInstance

The Role to check, normally taken from roles.

boolean

BaseAppInstance.checkRole


report(request): Promise<Readonly<{ report: MetricReportEntry; }>>

Runs a report over this App’s Metrics.

MetricReportRequest

The Metrics, Dimensions, period and date range to report on.

Promise<Readonly<{ report: MetricReportEntry; }>>

Measure with metrics

BaseAppInstance.report