Abstract Class: BaseUserRoute<T>
Defined in: src/routes/BaseUserRoute.ts:41
Extends
ModelRoute<T>
Extended by
Type Parameters
T
T extends User
Constructors
Constructor
new BaseUserRoute<
T>():BaseUserRoute<T>
Returns
BaseUserRoute<T>
Inherited from
ModelRoute<T>.constructor
Properties
_objectFactory?
protectedoptional_objectFactory?:ObjectFactory
Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:101
Inherited from
ModelRoute._objectFactory
aclUtils?
protectedoptionalaclUtils?:ACLUtils
Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:102
Inherited from
ModelRoute.aclUtils
authConfig?
protectedoptionalauthConfig?:any
Defined in: src/routes/BaseUserRoute.ts:46
config?
protectedoptionalconfig?:any
Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:104
The global application configuration.
Inherited from
ModelRoute.config
defaultACLUid
protecteddefaultACLUid:string
Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:106
The unique identifier of the default ACL for the model type.
Inherited from
ModelRoute.defaultACLUid
defaultScopes
protecteddefaultScopes:string[] =[]
Defined in: src/routes/BaseUserRoute.ts:43
logger
protectedlogger:any
Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:107
Inherited from
ModelRoute.logger
notificationUtils?
protectedoptionalnotificationUtils?:NotificationUtils
Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:108
Inherited from
ModelRoute.notificationUtils
repoUtils?
protectedoptionalrepoUtils?:RepoUtils<T>
Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:112
The repository utility class to use for common operations.
Inherited from
ModelRoute.repoUtils
repoUtilsClass
abstractprotectedreadonlyrepoUtilsClass:any
Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:110
The class of the RepoUtils to use when instantiating the utility.
Inherited from
ModelRoute.repoUtilsClass
tokenUtils?
protectedoptionaltokenUtils?:TokenUtils
Defined in: src/routes/BaseUserRoute.ts:49
trackChanges
protectedtrackChanges:number
Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:117
The number of previous document versions to store in the database. A negative value indicates storing all
versions, a value of 0 stores no versions.
Inherited from
ModelRoute.trackChanges
trustedRoles
protectedtrustedRoles:string[]
Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:118
Inherited from
ModelRoute.trustedRoles
Accessors
modelClass
Get Signature
get modelClass():
any
Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:122
The class type of the model this route is associated with.
Returns
any
Inherited from
ModelRoute.modelClass
Methods
count()
count(
params,query,res,user?):Promise<any>
Defined in: src/routes/BaseUserRoute.ts:59
Parameters
params
any
query
any
res
HttpResponse
user?
JWTUser
Returns
Promise<any>
create()
create(
obj,req,res,user?):Promise<AuthResult>
Defined in: src/routes/BaseUserRoute.ts:89
Parameters
obj
T
req
HttpRequest
res
HttpResponse
user?
JWTUser
Returns
Promise<AuthResult>
delete()
delete(
id,version,purge,req,user?):Promise<void>
Defined in: src/routes/BaseUserRoute.ts:149
Parameters
id
string
version
string | undefined
purge
string | undefined
req
HttpRequest
user?
JWTUser
Returns
Promise<void>
doBulkCreate()
protecteddoBulkCreate(objs,options):Promise<T[]>
Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:151
Attempts to store a collection of objects provided in options.req.body into the datasource. Upon success, sets the newly persisted
object(s) to the result property of the options.res argument, otherwise sends a 400 BAD REQUEST response to the
client.
Parameters
objs
Partial<T>[]
The object(s) to store in the database.
options
CreateRequestOptions
The options to process the request using.
Returns
Promise<T[]>
Inherited from
ModelRoute.doBulkCreate
doBulkUpdate()
protecteddoBulkUpdate(objs,options):Promise<T[]>
Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:203
Attempts to modify a collection of existing data model objects.
Parameters
objs
UpdateObject<T>[]
The object(s) to bulk update in the database.
options
UpdateRequestOptions<T>
The options to process the request using.
Returns
Promise<T[]>
Inherited from
ModelRoute.doBulkUpdate
doCount()
protecteddoCount(options):Promise<HttpResponse>
Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:133
Attempts to retrieve the number of data model objects matching the given set of criteria as specified in the
request query. Any results that have been found are set to the content-length header of the res argument.
Parameters
options
FindRequestOptions
The options to process the request using.
Returns
Promise<HttpResponse>
Inherited from
ModelRoute.doCount
doCreate()
protecteddoCreate(obj,options):Promise<T|T[]>
Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:160
Attempts to store one or more objects provided in options.req.body into the datasource. Upon success, sets the newly persisted
object(s) to the result property of the options.res argument, otherwise sends a 400 BAD REQUEST response to the
client.
Parameters
obj
Partial<T> | Partial<T>[]
The object(s) to store in the database.
options
CreateRequestOptions
The options to process the request using.
Returns
Promise<T | T[]>
Inherited from
ModelRoute.doCreate
doCreateObject()
protecteddoCreateObject(obj,options):Promise<T>
Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:142
Attempts to store an object provided in options.req.body into the datasource. Upon success, sets the newly persisted
object(s) to the result property of the options.res argument, otherwise sends a 400 BAD REQUEST response to the
client.
Parameters
obj
Partial<T>
The object to store in the database.
options
CreateRequestOptions
The options to process the request using.
Returns
Promise<T>
Inherited from
ModelRoute.doCreateObject
doDelete()
protecteddoDelete(id,options):Promise<void>
Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:168
Attempts to delete an existing data model object with a given unique identifier encoded by the URI parameter
id.
Parameters
id
string
The unique identifier of the object to delete.
options
DeleteRequestOptions
The options to process the request using.
Returns
Promise<void>
Inherited from
ModelRoute.doDelete
doExists()
protecteddoExists(id,options):Promise<any>
Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:175
Attempts to determine if an existing object with the given unique identifier exists.
Parameters
id
string
The unique identifier of the object to verify exists.
options
FindRequestOptions
The options to process the request using.
Returns
Promise<any>
Inherited from
ModelRoute.doExists
doFind()
protecteddoFind(options):Promise<T[]>
Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:183
Attempts to retrieve all data model objects matching the given set of criteria as specified in the request
query. Any results that have been found are set to the result property of the res argument. result is
never null.
Parameters
options
FindRequestOptions
The options to process the request using.
Returns
Promise<T[]>
Inherited from
ModelRoute.doFind
doFindById()
protecteddoFindById(id,options):Promise<T|null>
Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:189
Attempts to retrieve a single data model object as identified by the id parameter in the URI.
Parameters
id
string
options
FindRequestOptions
The options to process the request using.
Returns
Promise<T | null>
Inherited from
ModelRoute.doFindById
doTruncate()
protecteddoTruncate(options):Promise<void>
Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:196
Attempts to remove all entries of the data model type from the datasource matching the given parameters and query.
Parameters
options
TruncateRequestOptions
The options to process the request using.
Returns
Promise<void>
Inherited from
ModelRoute.doTruncate
doUpdate()
protecteddoUpdate(id,obj,options):Promise<T>
Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:210
Attempts to modify an existing data model object as identified by the id parameter in the URI.
Parameters
id
string
obj
UpdateObject<T>
The object to update in the database
options
UpdateRequestOptions<T>
The options to process the request using.
Returns
Promise<T>
Inherited from
ModelRoute.doUpdate
doUpdateProperty()
protecteddoUpdateProperty(id,propertyName,value,options):Promise<T>
Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:221
Attempts to modify a single property of an existing data model object as identified by the id parameter in the URI.
Note that this effectively bypasses optimistic locking and can cause unexpected data overwrites. Use with care.
Parameters
id
string
The unique identifier of the object to update.
propertyName
string
The name of the property to update.
value
any
The value of the property to set.
options
UpdateRequestOptions<T>
The options to process the request using.
Returns
Promise<T>
Inherited from
ModelRoute.doUpdateProperty
exists()
exists(
id,query,res,user?):Promise<any>
Defined in: src/routes/BaseUserRoute.ts:167
Parameters
id
string
query
any
res
HttpResponse
user?
JWTUser
Returns
Promise<any>
find()
find(
params,query,user?):Promise<T[]>
Defined in: src/routes/BaseUserRoute.ts:181
Parameters
params
any
query
any
user?
JWTUser
Returns
Promise<T[]>
findById()
findById(
id,query,user?):Promise<T|null>
Defined in: src/routes/BaseUserRoute.ts:190
Parameters
id
string
query
any
user?
JWTUser
Returns
Promise<T | null>
truncate()
truncate(
params,query,user?):Promise<void>
Defined in: src/routes/BaseUserRoute.ts:200
Parameters
params
any
query
any
user?
JWTUser
Returns
Promise<void>
update()
update(
id,obj,req,user?):Promise<T>
Defined in: src/routes/BaseUserRoute.ts:244
Parameters
id
string
obj
UpdateObject<T>
req
HttpRequest
user?
JWTUser
Returns
Promise<T>
validate()
validate(
objs,options?):Promise<void>
Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:225
Calls repoUtils.validate() to validate the object(s) provided.
Parameters
objs
Partial<T> | Partial<T>[]
options?
CreateRequestOptions | UpdateRequestOptions<T>
Returns
Promise<void>
Inherited from
ModelRoute.validate
validateCreate()
protectedvalidateCreate(obj,user?):Promise<void>
Defined in: src/routes/BaseUserRoute.ts:68
Parameters
obj
Partial<T>
user?
JWTUser
Returns
Promise<void>
validateUpdate()
protectedvalidateUpdate(id,obj,user?):Promise<void>
Defined in: src/routes/BaseUserRoute.ts:204
Parameters
id
string
obj
UpdateObject<T>
user?
JWTUser
Returns
Promise<void>