Skip to content

AppBuilder

Defined in: builder/app.ts:130

This is the AppBuilder you will see when importing an app as a Dependency. It is the base of the broader “AppBuilder” below and this is a subset of the AppBuilder. It has all the interesting entities, but not operations like addDependency ans so forth.

TTypes extends AppBuilderTypes = AppBuilderTypes

readonly dependencies: Record<string, DependencyAppBuilder<any>>

Defined in: builder/app.ts:131


readonly events: Record<string, EventBuilder>

Defined in: builder/app.ts:117

DependencyAppBuilder.events


readonly hooks: AppHookDefinition

Defined in: builder/app.ts:132


readonly key: string

Defined in: builder/app.ts:118

DependencyAppBuilder.key


readonly mutations: Record<string, MutationBuilder>

Defined in: builder/app.ts:133


readonly prn: string

Defined in: builder/index.ts:32

BaseBuilder.prn


readonly queries: Record<string, QueryBuilder>

Defined in: builder/app.ts:134


readonly roles: Record<string, AppRoleBuilder>

Defined in: builder/app.ts:135

DependencyAppBuilder.roles


readonly searches: Record<string, SearchIndexBuilder>

Defined in: builder/app.ts:136

DependencyAppBuilder.searches


readonly templates: Record<string, TemplateBuilder>

Defined in: builder/app.ts:122

DependencyAppBuilder.templates


readonly unions: Record<string, UnionBuilder>

Defined in: builder/app.ts:123

DependencyAppBuilder.unions

addDependency<TKey>(key, spec): DependencyAppBuilder<any>

Defined in: builder/app.ts:148

Adds the app as a dependency of this app. When in runtime, the dependency will appear under the context (ctx) with the given key. If the same dependency is added in multiple places (apps), it is the same dependency. That is, there only ever one “employeeProfile” in a runtime definition and instance.

The key is “local” to this app. The dependent app sets it’s own canonical id/key.

TKey extends string

TKey

AppSpec | ((builder) => void)

DependencyAppBuilder<any>


addEvent(key): EventBuilder

Defined in: builder/app.ts:154

Adds an event that can be published against items of this template type. Events on the app level are always published against the workspace item.

string

EventBuilder


addMetric(key): MetricBuilder

Defined in: builder/app.ts:171

Adds a new metric to this app. A metric is a time-series based aggregation of the supplied events. In the runtime, metrics can be queried by an interval using the configured dimensions.

string

MetricBuilder

MetricBuilder


addMetricDimension(key, subject): MetricDimensionBuilder

Defined in: builder/app.ts:162

Adds a new dimension to this app. A dimension is an aspect by which metrics can be broken down, filtered, and further categorized. Concrete dimensions are an item (instance) in the app of the template type specified here.

string

(TemplateBuilder | UnionBuilder)[]

MetricDimensionBuilder


addMutation<TKey>(key, handler): MutationBuilder

Defined in: builder/app.ts:173

TKey extends string

TKey

MutationHandler<ExtractMutationInput<TKey, TTypes>, ExtractMutationOutput<TKey, TTypes>, TTypes["WriteAppInstance"], TTypes["WriteRuntimeInstance"]>

MutationBuilder

addMutation<TKey>(key, options, handler): MutationBuilder

Defined in: builder/app.ts:182

TKey extends string

TKey

MutationOptions

MutationHandler<ExtractMutationInput<TKey, TTypes>, ExtractMutationOutput<TKey, TTypes>, TTypes["WriteAppInstance"], TTypes["WriteRuntimeInstance"]>

MutationBuilder


addQuery<TKey>(key, handler): QueryBuilder

Defined in: builder/app.ts:193

TKey extends string

TKey

QueryHandler<ExtractQueryInput<TKey, TTypes>, ExtractQueryOutput<TKey, TTypes>, TTypes["ReadAppInstance"], TTypes["ReadRuntimeInstance"]>

QueryBuilder

addQuery<TKey>(key, options, handler): QueryBuilder

Defined in: builder/app.ts:202

TKey extends string

TKey

QueryOptions

QueryHandler<ExtractQueryInput<TKey, TTypes>, ExtractQueryOutput<TKey, TTypes>, TTypes["ReadAppInstance"], TTypes["ReadRuntimeInstance"]>

QueryBuilder


addRole(key, options): AppRoleBuilder

Defined in: builder/app.ts:221

Adds an application-level role that can be owned by a principal. App Roles are broad-based roles such as “Owner” for the whole application. For fine-grained permissions see:

string

AddRoleOptions

AppRoleBuilder

  • MutationHandler
  • QueryBuilder
  • TemplateBuilder

addSearch(key): SearchIndexBuilder

Defined in: builder/app.ts:226

Adds a search index to this Application.

string

SearchIndexBuilder


addTemplate<TKey>(key): ExtractTemplate<TKey, TTypes>

Defined in: builder/app.ts:228

TKey extends string

TKey

ExtractTemplate<TKey, TTypes>


addUnion(key, templates): UnionBuilder

Defined in: builder/app.ts:230

string

TemplateBuilder[]

UnionBuilder


configure(key): this

Defined in: builder/app.ts:232

string

this


getWorkspaceTemplate(): TemplateBuilder

Defined in: builder/app.ts:233

TemplateBuilder


onCreate(fn): this

Defined in: builder/app.ts:234

AppCreateHookFn

this


onSeed(fn): this

Defined in: builder/app.ts:235

AppSeedHookFn

this


setDescription(description): this

Defined in: builder/index.ts:33

string

this

BaseBuilder.setDescription


toDefinition(): AppDefinition

Defined in: builder/app.ts:236

AppDefinition