Skip to main content
Version: 0.17

@orbit/data

Classes​

Interfaces​

Type aliases​

DefaultRequestOptions​

Ƭ DefaultRequestOptions<RO>: RO & { fullResponse?: false }

Type parameters​

NameType
ROextends RequestOptions

Defined in​

packages/@orbit/data/src/request.ts:8


FullRequestOptions​

Ƭ FullRequestOptions<RO>: RO & { fullResponse: true }

Type parameters​

NameType
ROextends RequestOptions

Defined in​

packages/@orbit/data/src/request.ts:12


NamedFullResponse​

Ƭ NamedFullResponse<Data, Details, O>: [string, FullResponse<Data, Details, O>]

Type parameters​

NameType
DataData
Detailsunknown
Oextends Operation = Operation

Defined in​

packages/@orbit/data/src/response.ts:4


QueryBuilderFunc​

Ƭ QueryBuilderFunc<QE, QB>: (QueryBuilder: QB) => QE | QE[] | QueryTerm<QE> | QueryTerm<QE>[]

Type parameters​

NameType
QEextends QueryExpression
QBQB

Type declaration​

â–¸ (QueryBuilder): QE | QE[] | QueryTerm<QE> | QueryTerm<QE>[]

Parameters​
NameType
QueryBuilderQB
Returns​

QE | QE[] | QueryTerm<QE> | QueryTerm<QE>[]

Defined in​

packages/@orbit/data/src/query.ts:19


QueryOrExpressions​

Ƭ QueryOrExpressions<QE, QB>: Query<QE> | QE | QE[] | QueryTerm<QE> | QueryTerm<QE>[] | QueryBuilderFunc<QE, QB>

Type parameters​

NameType
QEextends QueryExpression
QBQB

Defined in​

packages/@orbit/data/src/query.ts:23


SourceClass​

Ƭ SourceClass<QueryOptions, TransformOptions, QueryBuilder, TransformBuilder>: () => Source<QueryOptions, TransformOptions, QueryBuilder, TransformBuilder>

Type parameters​

NameType
QueryOptionsextends RequestOptions = RequestOptions
TransformOptionsextends RequestOptions = RequestOptions
QueryBuilderunknown
TransformBuilderunknown

Type declaration​

• ()

Defined in​

packages/@orbit/data/src/source.ts:42


TransformBuilderFunc​

Ƭ TransformBuilderFunc<O, TB>: (TransformBuilder: TB) => O | O[] | OperationTerm<O> | OperationTerm<O>[]

Type parameters​

NameType
Oextends Operation
TBTB

Type declaration​

â–¸ (TransformBuilder): O | O[] | OperationTerm<O> | OperationTerm<O>[]

Parameters​
NameType
TransformBuilderTB
Returns​

O | O[] | OperationTerm<O> | OperationTerm<O>[]

Defined in​

packages/@orbit/data/src/transform.ts:7


TransformOrOperations​

Ƭ TransformOrOperations<O, TB>: Transform<O> | O | O[] | OperationTerm<O> | OperationTerm<O>[] | TransformBuilderFunc<O, TB>

Type parameters​

NameType
Oextends Operation
TBTB

Defined in​

packages/@orbit/data/src/transform.ts:11

Functions​

buildQuery​

â–¸ buildQuery<QE, QB>(queryOrExpressions, queryOptions?, queryId?, queryBuilder?): Query<QE>

A builder function for creating a Query from its constituent parts.

If a Query is passed in with an id and expression, and no replacement id or options are also passed in, then the Query will be returned unchanged.

For all other cases, a new Query object will be created and returned.

Queries will be assigned the specified queryId as id. If none is specified, a UUID will be generated.

Type parameters​

NameType
QEextends QueryExpression
QBunknown

Parameters​

NameType
queryOrExpressionsQueryOrExpressions<QE, QB>
queryOptions?RequestOptions
queryId?string
queryBuilder?QB

Returns​

Query<QE>

Defined in​

packages/@orbit/data/src/query.ts:43


buildTransform​

â–¸ buildTransform<O, TB>(transformOrOperations, transformOptions?, transformId?, transformBuilder?): Transform<O>

A builder function for creating a Transform from its constituent parts.

If a Transform is passed in with an id and operations, and no replacement id or options are also passed in, then the Transform will be returned unchanged.

For all other cases, a new Transform object will be created and returned.

Transforms will be assigned the specified transformId as id. If none is specified, a UUID will be generated.

Type parameters​

NameType
Oextends Operation
TBunknown

Parameters​

NameType
transformOrOperationsTransformOrOperations<O, TB>
transformOptions?RequestOptions
transformId?string
transformBuilder?TB

Returns​

Transform<O>

Defined in​

packages/@orbit/data/src/transform.ts:40


isPullable​

â–¸ isPullable(source): boolean

Has a source been decorated as @pullable?

Parameters​

NameType
sourceSource<RequestOptions, RequestOptions, unknown, unknown>

Returns​

boolean

Defined in​

packages/@orbit/data/src/source-interfaces/pullable.ts:26


isPushable​

â–¸ isPushable(source): boolean

Has a source been decorated as @pushable?

Parameters​

NameType
sourceSource<RequestOptions, RequestOptions, unknown, unknown>

Returns​

boolean

Defined in​

packages/@orbit/data/src/source-interfaces/pushable.ts:24


isQuery​

â–¸ isQuery<QE, QB>(query): query is Query<QE>

Type parameters​

NameType
QEextends QueryExpression = QueryExpression
QBunknown

Parameters​

NameType
queryQueryOrExpressions<QE, QB>

Returns​

query is Query<QE>

Defined in​

packages/@orbit/data/src/query.ts:112


isQueryTerm​

â–¸ isQueryTerm<QE>(expression): expression is QueryTerm<QE>

Type parameters​

NameType
QEextends QueryExpression = QueryExpression

Parameters​

NameType
expressionQE | QueryTerm<QE>

Returns​

expression is QueryTerm<QE>

Defined in​

packages/@orbit/data/src/query.ts:106


isQueryable​

â–¸ isQueryable(source): boolean

Has a source been decorated as @queryable?

Parameters​

NameType
sourceSource<RequestOptions, RequestOptions, unknown, unknown>

Returns​

boolean

Defined in​

packages/@orbit/data/src/source-interfaces/queryable.ts:22


isSyncable​

â–¸ isSyncable(source): boolean

Has a source been decorated as @syncable?

Parameters​

NameType
sourceSource<RequestOptions, RequestOptions, unknown, unknown>

Returns​

boolean

Defined in​

packages/@orbit/data/src/source-interfaces/syncable.ts:13


isUpdatable​

â–¸ isUpdatable(source): boolean

Has a source been decorated as @updatable?

Parameters​

NameType
sourceSource<RequestOptions, RequestOptions, unknown, unknown>

Returns​

boolean

Defined in​

packages/@orbit/data/src/source-interfaces/updatable.ts:21


mapNamedFullResponses​

â–¸ mapNamedFullResponses<Data, Details, O>(responses): NamedFullResponseMap<Data, Details, O>

Type parameters​

NameType
Dataunknown
Detailsunknown
Oextends Operation = Operation

Parameters​

NameType
responses(undefined | NamedFullResponse<Data, Details, O>)[]

Returns​

NamedFullResponseMap<Data, Details, O>

Defined in​

packages/@orbit/data/src/response.ts:55


pullable​

â–¸ pullable(Klass): void

Marks a source as "pullable" and adds an implementation of the Pullable interface.

The pull method is part of the "request flow" in Orbit. Requests trigger events before and after processing of each request. Observers can delay the resolution of a request by returning a promise in an event listener.

A pullable source emits the following events:

  • beforePull - emitted prior to the processing of pull, this event includes the requested Query as an argument.

  • pull - emitted after a pull has successfully been requested, this event's arguments include both the requested Query and an array of the resulting Transform instances.

  • pullFail - emitted when an error has occurred processing a pull, this event's arguments include both the requested Query and the error.

A pullable source must implement a private method _pull, which performs the processing required for pull and returns a promise that resolves to an array of Transform instances.

Parameters​

NameType
Klassunknown

Returns​

void

Defined in​

packages/@orbit/data/src/source-interfaces/pullable.ts:92


pushable​

â–¸ pushable(Klass): void

Marks a source as "pushable" and adds an implementation of the Pushable interface.

The push method is part of the "request flow" in Orbit. Requests trigger events before and after processing of each request. Observers can delay the resolution of a request by returning a promise in an event listener.

A pushable source emits the following events:

  • beforePush - emitted prior to the processing of push, this event includes the requested Transform as an argument.

  • push - emitted after a push has successfully been applied, this event's arguments include both the requested Transform and an array of the actual applied Transform instances.

  • pushFail - emitted when an error has occurred pushing a transform, this event's arguments include both the requested Transform and the error.

A pushable source must implement a private method _push, which performs the processing required for push and returns a promise that resolves to an array of Transform instances.

Parameters​

NameType
Klassunknown

Returns​

void

Defined in​

packages/@orbit/data/src/source-interfaces/pushable.ts:92


queryable​

â–¸ queryable(Klass): void

Marks a source as "queryable" and adds an implementation of the Queryable interface.

The query method is part of the "request flow" in Orbit. Requests trigger events before and after processing of each request. Observers can delay the resolution of a request by returning a promise in an event listener.

The Queryable interface introduces the following events:

  • beforeQuery - emitted prior to the processing of query, this event includes the requested Query as an argument.

  • query - emitted after a query has successfully returned, this event's arguments include both the requested Query and the results.

  • queryFail - emitted when an error has occurred processing a query, this event's arguments include both the requested Query and the error.

A queryable source must implement a private method _query, which performs the processing required for query and returns a promise that resolves to a set of results.

Parameters​

NameType
Klassunknown

Returns​

void

Defined in​

packages/@orbit/data/src/source-interfaces/queryable.ts:67


requestOptionsForSource​

â–¸ requestOptionsForSource<RO>(options, source?): RO | undefined

Merges general request options with those specific to a source. The more specific options override the general options. If an array of options is provided, they will be merged to a single set.

Type parameters​

NameType
ROextends RequestOptions

Parameters​

NameType
optionsundefined | RO | (undefined | RO)[]
source?string

Returns​

RO | undefined

Defined in​

packages/@orbit/data/src/request.ts:21


syncable​

â–¸ syncable(Klass): void

Marks a source as "syncable" and adds an implementation of the Syncable interface.

The sync method is part of the "sync flow" in Orbit. This flow is used to synchronize the contents of sources.

Other sources can participate in the resolution of a sync by observing the transform event, which is emitted whenever a new Transform is applied to a source.

Parameters​

NameType
Klassunknown

Returns​

void

Defined in​

packages/@orbit/data/src/source-interfaces/syncable.ts:48


toQueryExpression​

â–¸ toQueryExpression<QE>(expression): QE

Type parameters​

NameType
QEextends QueryExpression = QueryExpression

Parameters​

NameType
expressionQE | QueryTerm<QE>

Returns​

QE

Defined in​

packages/@orbit/data/src/query.ts:96


updatable​

â–¸ updatable(Klass): void

Marks a source as "updatable" and adds an implementation of the Updatable interface.

The update method is part of the "request flow" in Orbit. Requests trigger events before and after processing of each request. Observers can delay the resolution of a request by returning a promise in an event listener.

An updatable source emits the following events:

  • beforeUpdate - emitted prior to the processing of update, this event includes the requested Transform as an argument.

  • update - emitted after an update has successfully been applied, this event includes the requested Transform as an argument.

  • updateFail - emitted when an error has occurred applying an update, this event's arguments include both the requested Transform and the error.

An updatable source must implement a private method _update, which performs the processing required for update and returns a promise that resolves when complete.

Parameters​

NameType
Klassunknown

Returns​

void

Defined in​

packages/@orbit/data/src/source-interfaces/updatable.ts:65