IScopedOperationalResource
Resource API bound to an authenticated admin user by IOperationalResource.asUser. Every operation enforces the resource ACL and the column access rules, and runs the resource lifecycle hooks.
Error contract: a denied or failed operation is always visible. get, list, count,
aggregate and delete throw, since their return value carries no room for an error;
create and update resolve to { ok: false, error }. delete resolves to false when the
record simply did not exist.
Properties
aggregate
aggregate: (
filter,aggregations,groupBy?) =>Promise<object[]>
Parameters
| Parameter | Type |
|---|---|
filter | IAdminForthSingleFilter | IAdminForthAndOrFilter | (IAdminForthSingleFilter | IAdminForthAndOrFilter)[] |
aggregations | {[alias: string]: IAggregationRule; } |
groupBy? | IGroupByRule | IGroupByRule[] |
Returns
Promise<object[]>
count
count: (
filter?) =>Promise<number>
Parameters
| Parameter | Type |
|---|---|
filter? | IAdminForthSingleFilter | IAdminForthAndOrFilter | (IAdminForthSingleFilter | IAdminForthAndOrFilter)[] |
Returns
Promise<number>
create
create: (
record) =>Promise<CreateResourceRecordResult&object>
Parameters
| Parameter | Type |
|---|---|
record | any |
Returns
Promise<CreateResourceRecordResult & object>
dataConnector
dataConnector:
IAdminForthDataSourceConnectorBase
delete
delete: (
primaryKey) =>Promise<boolean>
Parameters
| Parameter | Type |
|---|---|
primaryKey | any |
Returns
Promise<boolean>
get
get: (
filter) =>Promise<any>
Parameters
| Parameter | Type |
|---|---|
filter | IAdminForthSingleFilter | IAdminForthAndOrFilter | (IAdminForthSingleFilter | IAdminForthAndOrFilter)[] |
Returns
Promise<any>
list
list: (
filter,limit?,offset?,sort?,columns?) =>Promise<any[]>
Parameters
| Parameter | Type |
|---|---|
filter | IAdminForthSingleFilter | IAdminForthAndOrFilter | (IAdminForthSingleFilter | IAdminForthAndOrFilter)[] |
limit? | number |
offset? | number |
sort? | IAdminForthSort | IAdminForthSort[] |
columns? | string[] |
Returns
Promise<any[]>
update
update: (
primaryKey,record) =>Promise<any>
Parameters
| Parameter | Type |
|---|---|
primaryKey | any |
record | any |
Returns
Promise<any>