@orbit/data
Classes​
Interfaces​
- AsyncQueryable
- AsyncUpdatable
- FullResponse
- NamedFullResponseMap
- Operation
- Options
- Pullable
- Pushable
- Query
- QueryExpression
- Queryable
- RequestOptions
- Resettable
- ResponseHints
- SourceSettings
- SyncQueryable
- SyncUpdatable
- Syncable
- Transform
- Updatable
Type aliases​
DefaultRequestOptions​
Ƭ DefaultRequestOptions<RO
>: RO
& { fullResponse?
: false
}
Type parameters​
Name | Type |
---|---|
RO | extends RequestOptions |
Defined in​
packages/@orbit/data/src/request.ts:8
FullRequestOptions​
Ƭ FullRequestOptions<RO
>: RO
& { fullResponse
: true
}
Type parameters​
Name | Type |
---|---|
RO | extends RequestOptions |
Defined in​
packages/@orbit/data/src/request.ts:12
NamedFullResponse​
Ƭ NamedFullResponse<Data
, Details
, O
>: [string
, FullResponse
<Data
, Details
, O
>]
Type parameters​
Name | Type |
---|---|
Data | Data |
Details | unknown |
O | extends 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​
Name | Type |
---|---|
QE | extends QueryExpression |
QB | QB |
Type declaration​
â–¸ (QueryBuilder
): QE
| QE
[] | QueryTerm
<QE
> | QueryTerm
<QE
>[]
Parameters​
Name | Type |
---|---|
QueryBuilder | QB |
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​
Name | Type |
---|---|
QE | extends QueryExpression |
QB | QB |
Defined in​
packages/@orbit/data/src/query.ts:23
SourceClass​
Ƭ SourceClass<QueryOptions
, TransformOptions
, QueryBuilder
, TransformBuilder
>: () => Source
<QueryOptions
, TransformOptions
, QueryBuilder
, TransformBuilder
>
Type parameters​
Name | Type |
---|---|
QueryOptions | extends RequestOptions = RequestOptions |
TransformOptions | extends RequestOptions = RequestOptions |
QueryBuilder | unknown |
TransformBuilder | unknown |
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​
Name | Type |
---|---|
O | extends Operation |
TB | TB |
Type declaration​
â–¸ (TransformBuilder
): O
| O
[] | OperationTerm
<O
> | OperationTerm
<O
>[]
Parameters​
Name | Type |
---|---|
TransformBuilder | TB |
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​
Name | Type |
---|---|
O | extends Operation |
TB | TB |
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​
Name | Type |
---|---|
QE | extends QueryExpression |
QB | unknown |
Parameters​
Name | Type |
---|---|
queryOrExpressions | QueryOrExpressions <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​
Name | Type |
---|---|
O | extends Operation |
TB | unknown |
Parameters​
Name | Type |
---|---|
transformOrOperations | TransformOrOperations <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​
Name | Type |
---|---|
source | Source <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​
Name | Type |
---|---|
source | Source <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​
Name | Type |
---|---|
QE | extends QueryExpression = QueryExpression |
QB | unknown |
Parameters​
Name | Type |
---|---|
query | QueryOrExpressions <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​
Name | Type |
---|---|
QE | extends QueryExpression = QueryExpression |
Parameters​
Name | Type |
---|---|
expression | QE | 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​
Name | Type |
---|---|
source | Source <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​
Name | Type |
---|---|
source | Source <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​
Name | Type |
---|---|
source | Source <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​
Name | Type |
---|---|
Data | unknown |
Details | unknown |
O | extends Operation = Operation |
Parameters​
Name | Type |
---|---|
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 ofpull
, this event includes the requestedQuery
as an argument.pull
- emitted after apull
has successfully been requested, this event's arguments include both the requestedQuery
and an array of the resultingTransform
instances.pullFail
- emitted when an error has occurred processing apull
, this event's arguments include both the requestedQuery
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​
Name | Type |
---|---|
Klass | unknown |
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 ofpush
, this event includes the requestedTransform
as an argument.push
- emitted after apush
has successfully been applied, this event's arguments include both the requestedTransform
and an array of the actual appliedTransform
instances.pushFail
- emitted when an error has occurred pushing a transform, this event's arguments include both the requestedTransform
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​
Name | Type |
---|---|
Klass | unknown |
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 ofquery
, this event includes the requestedQuery
as an argument.query
- emitted after aquery
has successfully returned, this event's arguments include both the requestedQuery
and the results.queryFail
- emitted when an error has occurred processing a query, this event's arguments include both the requestedQuery
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​
Name | Type |
---|---|
Klass | unknown |
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​
Name | Type |
---|---|
RO | extends RequestOptions |
Parameters​
Name | Type |
---|---|
options | undefined | 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​
Name | Type |
---|---|
Klass | unknown |
Returns​
void
Defined in​
packages/@orbit/data/src/source-interfaces/syncable.ts:48
toQueryExpression​
â–¸ toQueryExpression<QE
>(expression
): QE
Type parameters​
Name | Type |
---|---|
QE | extends QueryExpression = QueryExpression |
Parameters​
Name | Type |
---|---|
expression | QE | 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 ofupdate
, this event includes the requestedTransform
as an argument.update
- emitted after anupdate
has successfully been applied, this event includes the requestedTransform
as an argument.updateFail
- emitted when an error has occurred applying an update, this event's arguments include both the requestedTransform
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​
Name | Type |
---|---|
Klass | unknown |
Returns​
void