IOperationalResource
Properties
aggregate
aggregate: (
filter,aggregations,groupBy?) =>Promise<object[]>
Plain data access — see IOperationalResource.get.
Parameters
| Parameter | Type |
|---|---|
filter | IAdminForthSingleFilter | IAdminForthAndOrFilter | (IAdminForthSingleFilter | IAdminForthAndOrFilter)[] |
aggregations | {[alias: string]: IAggregationRule; } |
groupBy? | IGroupByRule | IGroupByRule[] |
Returns
Promise<object[]>
asSystem
asSystem: (
options?) =>ISystemOperationalResource
Returns a resource API for writes no user asked for, which still have to run the resource lifecycle: validation, save hooks and the onDelete strategy. No permission checks, no column access rules, no row scope. Use it for system writes, e.g. an audit log entry.
Parameters
| Parameter | Type |
|---|---|
options? | OperationalResourceSystemOptions |
Returns
asUser
asUser: (
adminUser,options?) =>IScopedOperationalResource
Returns a resource API scoped to an authenticated admin user. Operations enforce the resource ACL and the column access rules, run lifecycle hooks, and validate records. Use it for everything a user asked for.
Parameters
| Parameter | Type |
|---|---|
adminUser | AdminUser |
options? | OperationalResourceContextOptions |
Returns
count
count: (
filter?) =>Promise<number>
Plain data access — see IOperationalResource.get.
Parameters
| Parameter | Type |
|---|---|
filter? | IAdminForthSingleFilter | IAdminForthAndOrFilter | (IAdminForthSingleFilter | IAdminForthAndOrFilter)[] |
Returns
Promise<number>
create
create: (
record) =>Promise<CreateResourceRecordResult&object>
Plain data access — see IOperationalResource.get.
Parameters
| Parameter | Type |
|---|---|
record | any |
Returns
Promise<CreateResourceRecordResult & object>
dataConnector
dataConnector:
IAdminForthDataSourceConnectorBase
delete
delete: (
primaryKey) =>Promise<boolean>
Plain data access — see IOperationalResource.get.
Parameters
| Parameter | Type |
|---|---|
primaryKey | any |
Returns
Promise<boolean>
get
get: (
filter) =>Promise<any>
Plain data access: no permission checks, no column access rules, no lifecycle hooks. Writes are still normalized. Use it for internal bookkeeping the user did not ask for; to run hooks without permission checks, use IOperationalResource.asSystem.
Parameters
| Parameter | Type |
|---|---|
filter | IAdminForthSingleFilter | IAdminForthAndOrFilter | (IAdminForthSingleFilter | IAdminForthAndOrFilter)[] |
Returns
Promise<any>
list
list: (
filter,limit?,offset?,sort?,columns?) =>Promise<any[]>
Plain data access — see IOperationalResource.get.
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>
Plain data access — see IOperationalResource.get.
Parameters
| Parameter | Type |
|---|---|
primaryKey | any |
record | any |
Returns
Promise<any>