@rapidrest/service-core 1.0.0-rc.7 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +382 -23
- package/README.md +79 -5
- package/dist/lib/ApiErrors.js +10 -0
- package/dist/lib/ApiErrors.js.map +1 -1
- package/dist/lib/BackgroundService.js +1 -4
- package/dist/lib/BackgroundService.js.map +1 -1
- package/dist/lib/BackgroundServiceManager.js +47 -6
- package/dist/lib/BackgroundServiceManager.js.map +1 -1
- package/dist/lib/BulkError.js +4 -0
- package/dist/lib/BulkError.js.map +1 -1
- package/dist/lib/EventListenerManager.js +53 -18
- package/dist/lib/EventListenerManager.js.map +1 -1
- package/dist/lib/NetUtils.js +1 -0
- package/dist/lib/NetUtils.js.map +1 -1
- package/dist/lib/NotificationUtils.js +27 -8
- package/dist/lib/NotificationUtils.js.map +1 -1
- package/dist/lib/ObjectFactory.js +25 -44
- package/dist/lib/ObjectFactory.js.map +1 -1
- package/dist/lib/OpenApiSpec.js +31 -11
- package/dist/lib/OpenApiSpec.js.map +1 -1
- package/dist/lib/Server.js +74 -110
- package/dist/lib/Server.js.map +1 -1
- package/dist/lib/auth/AuthMiddleware.js +11 -16
- package/dist/lib/auth/AuthMiddleware.js.map +1 -1
- package/dist/lib/auth/JWTStrategy.js +68 -17
- package/dist/lib/auth/JWTStrategy.js.map +1 -1
- package/dist/lib/auth/index.js +0 -1
- package/dist/lib/auth/index.js.map +1 -1
- package/dist/lib/database/ConnectionKinds.js +15 -0
- package/dist/lib/database/ConnectionKinds.js.map +1 -1
- package/dist/lib/database/ConnectionManager.js +140 -61
- package/dist/lib/database/ConnectionManager.js.map +1 -1
- package/dist/lib/database/MongoConnection.js +13 -3
- package/dist/lib/database/MongoConnection.js.map +1 -1
- package/dist/lib/database/MongoRepository.js +61 -15
- package/dist/lib/database/MongoRepository.js.map +1 -1
- package/dist/lib/database/MongoSchemaSync.js +3 -3
- package/dist/lib/database/MongoSchemaSync.js.map +1 -1
- package/dist/lib/database/NamingUtils.js +3 -2
- package/dist/lib/database/NamingUtils.js.map +1 -1
- package/dist/lib/database/RedisCache.js +64 -0
- package/dist/lib/database/RedisCache.js.map +1 -0
- package/dist/lib/database/TypeOrmSupport.js +53 -13
- package/dist/lib/database/TypeOrmSupport.js.map +1 -1
- package/dist/lib/database/index.js +1 -0
- package/dist/lib/database/index.js.map +1 -1
- package/dist/lib/decorators/DatabaseDecorators.js +264 -20
- package/dist/lib/decorators/DatabaseDecorators.js.map +1 -1
- package/dist/lib/decorators/DocDecorators.js +30 -9
- package/dist/lib/decorators/DocDecorators.js.map +1 -1
- package/dist/lib/decorators/EventDecorators.js +1 -0
- package/dist/lib/decorators/EventDecorators.js.map +1 -1
- package/dist/lib/decorators/ModelDecorators.js +39 -23
- package/dist/lib/decorators/ModelDecorators.js.map +1 -1
- package/dist/lib/decorators/PersistenceDecorators.js +4 -3
- package/dist/lib/decorators/PersistenceDecorators.js.map +1 -1
- package/dist/lib/decorators/RouteDecorators.js +139 -36
- package/dist/lib/decorators/RouteDecorators.js.map +1 -1
- package/dist/lib/http/IWebSocketShim.js +2 -0
- package/dist/lib/http/IWebSocketShim.js.map +1 -0
- package/dist/lib/http/MiddlewareChain.js +167 -0
- package/dist/lib/http/MiddlewareChain.js.map +1 -0
- package/dist/lib/http/RuntimeDetect.js +9 -0
- package/dist/lib/http/RuntimeDetect.js.map +1 -0
- package/dist/lib/http/bun/BunAdapters.js +326 -0
- package/dist/lib/http/bun/BunAdapters.js.map +1 -0
- package/dist/lib/http/bun/BunRouter.js +391 -0
- package/dist/lib/http/bun/BunRouter.js.map +1 -0
- package/dist/lib/http/bun/BunWebSocket.js +49 -0
- package/dist/lib/http/bun/BunWebSocket.js.map +1 -0
- package/dist/lib/http/index.js +16 -3
- package/dist/lib/http/index.js.map +1 -1
- package/dist/lib/http/session/RedisSessionStore.js +30 -0
- package/dist/lib/http/session/RedisSessionStore.js.map +1 -0
- package/dist/lib/http/session/SessionManager.js +113 -0
- package/dist/lib/http/session/SessionManager.js.map +1 -0
- package/dist/lib/http/session/SessionStore.js +6 -0
- package/dist/lib/http/session/SessionStore.js.map +1 -0
- package/dist/lib/http/session/sessionMiddleware.js +42 -0
- package/dist/lib/http/session/sessionMiddleware.js.map +1 -0
- package/dist/lib/http/types.js +0 -3
- package/dist/lib/http/types.js.map +1 -1
- package/dist/lib/http/uWS/Adapters.js +421 -0
- package/dist/lib/http/uWS/Adapters.js.map +1 -0
- package/dist/lib/http/{Router.js → uWS/Router.js} +73 -173
- package/dist/lib/http/uWS/Router.js.map +1 -0
- package/dist/lib/http/{WebSocket.js → uWS/WebSocket.js} +4 -1
- package/dist/lib/http/uWS/WebSocket.js.map +1 -0
- package/dist/lib/models/BaseEntity.js +2 -1
- package/dist/lib/models/BaseEntity.js.map +1 -1
- package/dist/lib/models/BaseMongoEntity.js +2 -2
- package/dist/lib/models/BaseMongoEntity.js.map +1 -1
- package/dist/lib/models/ModelUtils.js +248 -101
- package/dist/lib/models/ModelUtils.js.map +1 -1
- package/dist/lib/models/RecoverableBaseEntity.js +6 -1
- package/dist/lib/models/RecoverableBaseEntity.js.map +1 -1
- package/dist/lib/models/RecoverableBaseMongoEntity.js +1 -0
- package/dist/lib/models/RecoverableBaseMongoEntity.js.map +1 -1
- package/dist/lib/models/RepoUtils.js +641 -203
- package/dist/lib/models/RepoUtils.js.map +1 -1
- package/dist/lib/models/SimpleEntity.js +1 -0
- package/dist/lib/models/SimpleEntity.js.map +1 -1
- package/dist/lib/models/SimpleMongoEntity.js +2 -1
- package/dist/lib/models/SimpleMongoEntity.js.map +1 -1
- package/dist/lib/models/StatusExtraData.js +4 -0
- package/dist/lib/models/StatusExtraData.js.map +1 -1
- package/dist/lib/routes/{AdminRoute.js → BaseAdminRoute.js} +98 -80
- package/dist/lib/routes/BaseAdminRoute.js.map +1 -0
- package/dist/lib/routes/{MetricsRoute.js → BaseMetricsRoute.js} +29 -15
- package/dist/lib/routes/BaseMetricsRoute.js.map +1 -0
- package/dist/lib/routes/{OpenAPIRoute.js → BaseOpenAPIRoute.js} +32 -32
- package/dist/lib/routes/BaseOpenAPIRoute.js.map +1 -0
- package/dist/lib/routes/BasePushRoute.js +305 -0
- package/dist/lib/routes/BasePushRoute.js.map +1 -0
- package/dist/lib/routes/BaseStaticRoute.js +153 -0
- package/dist/lib/routes/BaseStaticRoute.js.map +1 -0
- package/dist/lib/routes/BaseStatusRoute.js +80 -0
- package/dist/lib/routes/BaseStatusRoute.js.map +1 -0
- package/dist/lib/routes/CRUDRoute.js +284 -0
- package/dist/lib/routes/CRUDRoute.js.map +1 -0
- package/dist/lib/routes/ModelRoute.js +84 -57
- package/dist/lib/routes/ModelRoute.js.map +1 -1
- package/dist/lib/routes/RouteUtils.js +108 -20
- package/dist/lib/routes/RouteUtils.js.map +1 -1
- package/dist/lib/routes/index.js +7 -4
- package/dist/lib/routes/index.js.map +1 -1
- package/dist/lib/security/ACLUtils.js +297 -170
- package/dist/lib/security/ACLUtils.js.map +1 -1
- package/dist/lib/security/AccessControlList.js +18 -10
- package/dist/lib/security/AccessControlList.js.map +1 -1
- package/dist/lib/security/AccessControlListMongo.js +19 -68
- package/dist/lib/security/AccessControlListMongo.js.map +1 -1
- package/dist/lib/security/AccessControlListSQL.js +21 -70
- package/dist/lib/security/AccessControlListSQL.js.map +1 -1
- package/dist/lib/security/BaseACLRoute.js +239 -0
- package/dist/lib/security/BaseACLRoute.js.map +1 -0
- package/dist/lib/security/index.js +3 -0
- package/dist/lib/security/index.js.map +1 -1
- package/dist/lib/test/request.js +62 -5
- package/dist/lib/test/request.js.map +1 -1
- package/dist/lib/test/requestws.js +34 -10
- package/dist/lib/test/requestws.js.map +1 -1
- package/dist/types/ApiErrors.d.ts +8 -2
- package/dist/types/BackgroundService.d.ts +0 -5
- package/dist/types/BackgroundServiceManager.d.ts +2 -1
- package/dist/types/EventListenerManager.d.ts +7 -6
- package/dist/types/NotificationUtils.d.ts +5 -3
- package/dist/types/OpenApiSpec.d.ts +2 -2
- package/dist/types/Server.d.ts +28 -10
- package/dist/types/auth/AuthMiddleware.d.ts +3 -3
- package/dist/types/auth/AuthStrategy.d.ts +10 -7
- package/dist/types/auth/JWTStrategy.d.ts +6 -4
- package/dist/types/auth/index.d.ts +0 -1
- package/dist/types/database/ConnectionKinds.d.ts +7 -0
- package/dist/types/database/ConnectionManager.d.ts +29 -4
- package/dist/types/database/MongoConnection.d.ts +16 -4
- package/dist/types/database/MongoRepository.d.ts +32 -11
- package/dist/types/database/RedisCache.d.ts +23 -0
- package/dist/types/database/TypeOrmSupport.d.ts +4 -4
- package/dist/types/database/index.d.ts +1 -0
- package/dist/types/decorators/DatabaseDecorators.d.ts +139 -8
- package/dist/types/decorators/DocDecorators.d.ts +11 -2
- package/dist/types/decorators/ModelDecorators.d.ts +12 -5
- package/dist/types/decorators/PersistenceDecorators.d.ts +11 -4
- package/dist/types/decorators/RouteDecorators.d.ts +36 -6
- package/dist/types/http/IWebSocketShim.d.ts +11 -0
- package/dist/types/http/MiddlewareChain.d.ts +47 -0
- package/dist/types/http/RuntimeDetect.d.ts +2 -0
- package/dist/types/http/bun/BunAdapters.d.ts +139 -0
- package/dist/types/http/bun/BunRouter.d.ts +79 -0
- package/dist/types/http/bun/BunWebSocket.d.ts +35 -0
- package/dist/types/http/index.d.ts +16 -6
- package/dist/types/http/session/RedisSessionStore.d.ts +15 -0
- package/dist/types/http/session/SessionManager.d.ts +35 -0
- package/dist/types/http/session/SessionStore.d.ts +12 -0
- package/dist/types/http/session/sessionMiddleware.d.ts +10 -0
- package/dist/types/http/types.d.ts +42 -3
- package/dist/types/http/uWS/Adapters.d.ts +129 -0
- package/dist/types/http/{Router.d.ts → uWS/Router.d.ts} +14 -38
- package/dist/types/http/{WebSocket.d.ts → uWS/WebSocket.d.ts} +6 -5
- package/dist/types/models/BaseEntity.d.ts +1 -1
- package/dist/types/models/ModelUtils.d.ts +47 -14
- package/dist/types/models/RecoverableBaseEntity.d.ts +3 -1
- package/dist/types/models/RepoUtils.d.ts +84 -14
- package/dist/types/routes/BaseAdminRoute.d.ts +65 -0
- package/dist/types/routes/BaseMetricsRoute.d.ts +37 -0
- package/dist/types/routes/BaseOpenAPIRoute.d.ts +33 -0
- package/dist/types/routes/BasePushRoute.d.ts +53 -0
- package/dist/types/routes/BaseStaticRoute.d.ts +44 -0
- package/dist/types/routes/BaseStatusRoute.d.ts +37 -0
- package/dist/types/routes/CRUDRoute.d.ts +57 -0
- package/dist/types/routes/ModelRoute.d.ts +39 -36
- package/dist/types/routes/RouteUtils.d.ts +19 -0
- package/dist/types/routes/index.d.ts +7 -4
- package/dist/types/security/ACLUtils.d.ts +94 -18
- package/dist/types/security/AccessControlList.d.ts +37 -59
- package/dist/types/security/AccessControlListMongo.d.ts +3 -8
- package/dist/types/security/AccessControlListSQL.d.ts +3 -8
- package/dist/types/security/BaseACLRoute.d.ts +73 -0
- package/dist/types/security/index.d.ts +3 -0
- package/dist/types/test/request.d.ts +18 -1
- package/package.json +135 -129
- package/tsconfig.export.json +17 -0
- package/dist/lib/auth/BasicStrategy.js +0 -113
- package/dist/lib/auth/BasicStrategy.js.map +0 -1
- package/dist/lib/http/Adapters.js +0 -241
- package/dist/lib/http/Adapters.js.map +0 -1
- package/dist/lib/http/Router.js.map +0 -1
- package/dist/lib/http/WebSocket.js.map +0 -1
- package/dist/lib/routes/AdminRoute.js.map +0 -1
- package/dist/lib/routes/MetricsRoute.js.map +0 -1
- package/dist/lib/routes/OpenAPIRoute.js.map +0 -1
- package/dist/lib/routes/StatusRoute.js +0 -55
- package/dist/lib/routes/StatusRoute.js.map +0 -1
- package/dist/lib/security/ACLRouteMongo.js +0 -194
- package/dist/lib/security/ACLRouteMongo.js.map +0 -1
- package/dist/lib/security/ACLRouteSQL.js +0 -193
- package/dist/lib/security/ACLRouteSQL.js.map +0 -1
- package/dist/types/auth/BasicStrategy.d.ts +0 -37
- package/dist/types/http/Adapters.d.ts +0 -68
- package/dist/types/routes/AdminRoute.d.ts +0 -47
- package/dist/types/routes/MetricsRoute.d.ts +0 -15
- package/dist/types/routes/OpenAPIRoute.d.ts +0 -17
- package/dist/types/routes/StatusRoute.d.ts +0 -11
- package/dist/types/security/ACLRouteMongo.d.ts +0 -19
- package/dist/types/security/ACLRouteSQL.d.ts +0 -19
- package/docs/Makefile +0 -20
- package/docs/conf.py +0 -58
- package/docs/index.rst +0 -17
- package/docs/make.bat +0 -35
- package/docs/reference/@rapidrest/namespaces/DatabaseDecorators/README.md +0 -13
- package/docs/reference/@rapidrest/namespaces/DatabaseDecorators/functions/MongoRepository.md +0 -25
- package/docs/reference/@rapidrest/namespaces/DatabaseDecorators/functions/RedisConnection.md +0 -25
- package/docs/reference/@rapidrest/namespaces/DatabaseDecorators/functions/Repository.md +0 -25
- package/docs/reference/@rapidrest/namespaces/DocDecorators/README.md +0 -23
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Default.md +0 -25
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Description.md +0 -25
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Document.md +0 -25
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Example.md +0 -25
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Format.md +0 -25
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Returns.md +0 -28
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Summary.md +0 -25
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Tags.md +0 -25
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/TypeInfo.md +0 -28
- package/docs/reference/@rapidrest/namespaces/DocDecorators/interfaces/DocumentsData.md +0 -57
- package/docs/reference/@rapidrest/namespaces/EventDecorators/README.md +0 -12
- package/docs/reference/@rapidrest/namespaces/EventDecorators/functions/EventListener.md +0 -17
- package/docs/reference/@rapidrest/namespaces/EventDecorators/functions/OnEvent.md +0 -26
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/README.md +0 -26
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/Cache.md +0 -25
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/ChildEntity.md +0 -18
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/DataStore.md +0 -25
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/Identifier.md +0 -27
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/Protect.md +0 -35
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/Reference.md +0 -25
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/Shard.md +0 -27
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/TrackChanges.md +0 -26
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/interfaces/PendingTypeOrmColumn.md +0 -45
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/variables/pendingTypeOrmColumns.md +0 -14
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/README.md +0 -27
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/Column.md +0 -25
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/Entity.md +0 -25
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/Index.md +0 -119
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/PrimaryColumn.md +0 -25
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/Unique.md +0 -68
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/getColumnMetadata.md +0 -26
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/getEntityName.md +0 -26
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/getIndexMetadata.md +0 -27
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/interfaces/CollationOptions.md +0 -79
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/interfaces/ColumnInfo.md +0 -41
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/interfaces/ColumnOptions.md +0 -51
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/interfaces/EntityOptions.md +0 -32
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/interfaces/IndexInfo.md +0 -41
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/interfaces/IndexOptions.md +0 -61
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/README.md +0 -36
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/After.md +0 -26
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Auth.md +0 -33
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/AuthResult.md +0 -31
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Before.md +0 -25
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/ContentType.md +0 -25
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Delete.md +0 -25
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Get.md +0 -25
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Head.md +0 -25
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Header.md +0 -25
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Method.md +0 -31
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Model.md +0 -25
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Options.md +0 -25
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Param.md +0 -26
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Patch.md +0 -25
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Post.md +0 -25
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Protect.md +0 -31
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Put.md +0 -25
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Query.md +0 -26
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Request.md +0 -31
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/RequiresRole.md +0 -26
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Response.md +0 -31
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Route.md +0 -25
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Socket.md +0 -33
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/User.md +0 -31
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Validate.md +0 -25
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/WebSocket.md +0 -25
- package/docs/reference/README.md +0 -20
- package/docs/reference/classes/ACLUtils.md +0 -263
- package/docs/reference/classes/AdminRoute.md +0 -51
- package/docs/reference/classes/AuthMiddleware.md +0 -173
- package/docs/reference/classes/BackgroundService.md +0 -117
- package/docs/reference/classes/BackgroundServiceManager.md +0 -172
- package/docs/reference/classes/BaseEntity.md +0 -82
- package/docs/reference/classes/BaseMongoEntity.md +0 -107
- package/docs/reference/classes/BasicStrategy.md +0 -131
- package/docs/reference/classes/BasicStrategyOptions.md +0 -115
- package/docs/reference/classes/BulkError.md +0 -271
- package/docs/reference/classes/ConnectionManager.md +0 -75
- package/docs/reference/classes/EventListenerManager.md +0 -88
- package/docs/reference/classes/HttpRouter.md +0 -343
- package/docs/reference/classes/JWTStrategy.md +0 -100
- package/docs/reference/classes/JWTStrategyOptions.md +0 -97
- package/docs/reference/classes/MetricsRoute.md +0 -27
- package/docs/reference/classes/ModelRoute.md +0 -527
- package/docs/reference/classes/ModelUtils.md +0 -446
- package/docs/reference/classes/MongoConnection.md +0 -218
- package/docs/reference/classes/MongoRepository.md +0 -390
- package/docs/reference/classes/MongoSchemaSync.md +0 -97
- package/docs/reference/classes/NetUtils.md +0 -90
- package/docs/reference/classes/NotificationUtils.md +0 -77
- package/docs/reference/classes/ObjectFactory.md +0 -336
- package/docs/reference/classes/OpenAPIRoute.md +0 -77
- package/docs/reference/classes/OpenApiSpec.md +0 -892
- package/docs/reference/classes/RecoverableBaseEntity.md +0 -114
- package/docs/reference/classes/RecoverableBaseMongoEntity.md +0 -124
- package/docs/reference/classes/RedisTransport.md +0 -2202
- package/docs/reference/classes/RepoUtils.md +0 -482
- package/docs/reference/classes/RouteUtils.md +0 -191
- package/docs/reference/classes/Server.md +0 -408
- package/docs/reference/classes/SimpleEntity.md +0 -48
- package/docs/reference/classes/SimpleMongoEntity.md +0 -66
- package/docs/reference/classes/StatusExtraData.md +0 -57
- package/docs/reference/classes/StatusRoute.md +0 -26
- package/docs/reference/classes/UWSRequest.md +0 -226
- package/docs/reference/classes/UWSResponse.md +0 -257
- package/docs/reference/classes/UWSWebSocketShim.md +0 -958
- package/docs/reference/enumerations/ACLAction.md +0 -63
- package/docs/reference/enumerations/ApiErrorMessages.md +0 -123
- package/docs/reference/enumerations/ApiErrors.md +0 -123
- package/docs/reference/functions/createWebSocketStream.md +0 -27
- package/docs/reference/functions/isSqlDataSource.md +0 -26
- package/docs/reference/functions/readBody.md +0 -29
- package/docs/reference/functions/resolveCollectionName.md +0 -33
- package/docs/reference/functions/runChain.md +0 -40
- package/docs/reference/functions/snakeCase.md +0 -28
- package/docs/reference/globals.md +0 -106
- package/docs/reference/interfaces/ACLRecord.md +0 -96
- package/docs/reference/interfaces/AccessControlList.md +0 -76
- package/docs/reference/interfaces/AuthResult.md +0 -55
- package/docs/reference/interfaces/AuthStrategy.md +0 -95
- package/docs/reference/interfaces/CreateRequestOptions.md +0 -121
- package/docs/reference/interfaces/DeleteRequestOptions.md +0 -137
- package/docs/reference/interfaces/FindRequestOptions.md +0 -133
- package/docs/reference/interfaces/HttpRequest.md +0 -147
- package/docs/reference/interfaces/HttpResponse.md +0 -164
- package/docs/reference/interfaces/JWTAuthResult.md +0 -84
- package/docs/reference/interfaces/RepoCreateOptions.md +0 -95
- package/docs/reference/interfaces/RepoDeleteOptions.md +0 -105
- package/docs/reference/interfaces/RepoFindOptions.md +0 -125
- package/docs/reference/interfaces/RepoOperationOptions.md +0 -69
- package/docs/reference/interfaces/RepoUpdateOptions.md +0 -101
- package/docs/reference/interfaces/RequestOptions.md +0 -112
- package/docs/reference/interfaces/RequestWS.md +0 -225
- package/docs/reference/interfaces/TruncateRequestOptions.md +0 -161
- package/docs/reference/interfaces/UpdateRequestOptions.md +0 -139
- package/docs/reference/type-aliases/ErrorHandler.md +0 -35
- package/docs/reference/type-aliases/NextFunction.md +0 -23
- package/docs/reference/type-aliases/OneOrMany.md +0 -19
- package/docs/reference/type-aliases/OneOrNull.md +0 -19
- package/docs/reference/type-aliases/PartialBaseEntity.md +0 -17
- package/docs/reference/type-aliases/PartialSimpleEntity.md +0 -17
- package/docs/reference/type-aliases/RequestHandler.md +0 -31
- package/docs/reference/type-aliases/UpdateObject.md +0 -19
- package/docs/reference/type-aliases/WsUpgradeAuth.md +0 -27
- package/docs/reference/type-aliases/WsUpgradeAuthResult.md +0 -47
|
@@ -1,527 +0,0 @@
|
|
|
1
|
-
[**@rapidrest/service-core**](../README.md)
|
|
2
|
-
|
|
3
|
-
***
|
|
4
|
-
|
|
5
|
-
[@rapidrest/service-core](../globals.md) / ModelRoute
|
|
6
|
-
|
|
7
|
-
# Abstract Class: ModelRoute\<T\>
|
|
8
|
-
|
|
9
|
-
Defined in: [src/routes/ModelRoute.ts:113](https://github.com/rapidrest/service-core/blob/0879470e308cd5828ebcf6efdbdba1cd0178007b/src/routes/ModelRoute.ts#L113)
|
|
10
|
-
|
|
11
|
-
The `ModelRoute` is an abstract base class that provides a set of built-in route behavior functions for handling
|
|
12
|
-
requests for a given data model that is managed by a persistent datastore.
|
|
13
|
-
|
|
14
|
-
Provided behaviors:
|
|
15
|
-
* `count` - Counts the number of objects matching the provided set of criteria in the request's query parameters.
|
|
16
|
-
* `create` - Adds a new object to the datastore.
|
|
17
|
-
* `delete` - Removes an existing object from the datastore.
|
|
18
|
-
* `find` - Finds all objects matching the provided set of criteria in the request's query parameters.
|
|
19
|
-
* `findById` - Finds a single object with a specified unique identifier.
|
|
20
|
-
* `truncate` - Removes all objects from the datastore.
|
|
21
|
-
* `update` - Modifies an existing object in the datastore.
|
|
22
|
-
|
|
23
|
-
## Author
|
|
24
|
-
|
|
25
|
-
Jean-Philippe Steinmetz
|
|
26
|
-
|
|
27
|
-
## Type Parameters
|
|
28
|
-
|
|
29
|
-
### T
|
|
30
|
-
|
|
31
|
-
`T` *extends* [`BaseEntity`](BaseEntity.md) \| [`SimpleEntity`](SimpleEntity.md)
|
|
32
|
-
|
|
33
|
-
## Constructors
|
|
34
|
-
|
|
35
|
-
### Constructor
|
|
36
|
-
|
|
37
|
-
> **new ModelRoute**\<`T`\>(): `ModelRoute`\<`T`\>
|
|
38
|
-
|
|
39
|
-
#### Returns
|
|
40
|
-
|
|
41
|
-
`ModelRoute`\<`T`\>
|
|
42
|
-
|
|
43
|
-
## Properties
|
|
44
|
-
|
|
45
|
-
### aclUtils?
|
|
46
|
-
|
|
47
|
-
> `protected` `optional` **aclUtils?**: [`ACLUtils`](ACLUtils.md)
|
|
48
|
-
|
|
49
|
-
Defined in: [src/routes/ModelRoute.ts:115](https://github.com/rapidrest/service-core/blob/0879470e308cd5828ebcf6efdbdba1cd0178007b/src/routes/ModelRoute.ts#L115)
|
|
50
|
-
|
|
51
|
-
***
|
|
52
|
-
|
|
53
|
-
### cacheClient?
|
|
54
|
-
|
|
55
|
-
> `protected` `optional` **cacheClient?**: `Redis`
|
|
56
|
-
|
|
57
|
-
Defined in: [src/routes/ModelRoute.ts:119](https://github.com/rapidrest/service-core/blob/0879470e308cd5828ebcf6efdbdba1cd0178007b/src/routes/ModelRoute.ts#L119)
|
|
58
|
-
|
|
59
|
-
The redis client that will be used as a 2nd level cache for all cacheable models.
|
|
60
|
-
|
|
61
|
-
***
|
|
62
|
-
|
|
63
|
-
### config?
|
|
64
|
-
|
|
65
|
-
> `protected` `optional` **config?**: `any`
|
|
66
|
-
|
|
67
|
-
Defined in: [src/routes/ModelRoute.ts:123](https://github.com/rapidrest/service-core/blob/0879470e308cd5828ebcf6efdbdba1cd0178007b/src/routes/ModelRoute.ts#L123)
|
|
68
|
-
|
|
69
|
-
The global application configuration.
|
|
70
|
-
|
|
71
|
-
***
|
|
72
|
-
|
|
73
|
-
### defaultACLUid
|
|
74
|
-
|
|
75
|
-
> `protected` **defaultACLUid**: `string` = `""`
|
|
76
|
-
|
|
77
|
-
Defined in: [src/routes/ModelRoute.ts:126](https://github.com/rapidrest/service-core/blob/0879470e308cd5828ebcf6efdbdba1cd0178007b/src/routes/ModelRoute.ts#L126)
|
|
78
|
-
|
|
79
|
-
The unique identifier of the default ACL for the model type.
|
|
80
|
-
|
|
81
|
-
***
|
|
82
|
-
|
|
83
|
-
### logger
|
|
84
|
-
|
|
85
|
-
> `protected` **logger**: `any`
|
|
86
|
-
|
|
87
|
-
Defined in: [src/routes/ModelRoute.ts:129](https://github.com/rapidrest/service-core/blob/0879470e308cd5828ebcf6efdbdba1cd0178007b/src/routes/ModelRoute.ts#L129)
|
|
88
|
-
|
|
89
|
-
***
|
|
90
|
-
|
|
91
|
-
### notificationUtils?
|
|
92
|
-
|
|
93
|
-
> `protected` `optional` **notificationUtils?**: [`NotificationUtils`](NotificationUtils.md)
|
|
94
|
-
|
|
95
|
-
Defined in: [src/routes/ModelRoute.ts:132](https://github.com/rapidrest/service-core/blob/0879470e308cd5828ebcf6efdbdba1cd0178007b/src/routes/ModelRoute.ts#L132)
|
|
96
|
-
|
|
97
|
-
***
|
|
98
|
-
|
|
99
|
-
### objectFactory?
|
|
100
|
-
|
|
101
|
-
> `protected` `optional` **objectFactory?**: [`ObjectFactory`](ObjectFactory.md)
|
|
102
|
-
|
|
103
|
-
Defined in: [src/routes/ModelRoute.ts:135](https://github.com/rapidrest/service-core/blob/0879470e308cd5828ebcf6efdbdba1cd0178007b/src/routes/ModelRoute.ts#L135)
|
|
104
|
-
|
|
105
|
-
***
|
|
106
|
-
|
|
107
|
-
### repoUtils?
|
|
108
|
-
|
|
109
|
-
> `protected` `optional` **repoUtils?**: [`RepoUtils`](RepoUtils.md)\<`T`\>
|
|
110
|
-
|
|
111
|
-
Defined in: [src/routes/ModelRoute.ts:141](https://github.com/rapidrest/service-core/blob/0879470e308cd5828ebcf6efdbdba1cd0178007b/src/routes/ModelRoute.ts#L141)
|
|
112
|
-
|
|
113
|
-
The repository utility class to use for common operations.
|
|
114
|
-
|
|
115
|
-
***
|
|
116
|
-
|
|
117
|
-
### repoUtilsClass
|
|
118
|
-
|
|
119
|
-
> `abstract` `protected` `readonly` **repoUtilsClass**: `any`
|
|
120
|
-
|
|
121
|
-
Defined in: [src/routes/ModelRoute.ts:138](https://github.com/rapidrest/service-core/blob/0879470e308cd5828ebcf6efdbdba1cd0178007b/src/routes/ModelRoute.ts#L138)
|
|
122
|
-
|
|
123
|
-
The class of the RepoUtils to use when instantiating the utility.
|
|
124
|
-
|
|
125
|
-
***
|
|
126
|
-
|
|
127
|
-
### trackChanges
|
|
128
|
-
|
|
129
|
-
> `protected` **trackChanges**: `number` = `0`
|
|
130
|
-
|
|
131
|
-
Defined in: [src/routes/ModelRoute.ts:147](https://github.com/rapidrest/service-core/blob/0879470e308cd5828ebcf6efdbdba1cd0178007b/src/routes/ModelRoute.ts#L147)
|
|
132
|
-
|
|
133
|
-
The number of previous document versions to store in the database. A negative value indicates storing all
|
|
134
|
-
versions, a value of `0` stores no versions.
|
|
135
|
-
|
|
136
|
-
***
|
|
137
|
-
|
|
138
|
-
### trustedRoles
|
|
139
|
-
|
|
140
|
-
> `protected` **trustedRoles**: `string`[]
|
|
141
|
-
|
|
142
|
-
Defined in: [src/routes/ModelRoute.ts:150](https://github.com/rapidrest/service-core/blob/0879470e308cd5828ebcf6efdbdba1cd0178007b/src/routes/ModelRoute.ts#L150)
|
|
143
|
-
|
|
144
|
-
## Accessors
|
|
145
|
-
|
|
146
|
-
### modelClass
|
|
147
|
-
|
|
148
|
-
#### Get Signature
|
|
149
|
-
|
|
150
|
-
> **get** **modelClass**(): `any`
|
|
151
|
-
|
|
152
|
-
Defined in: [src/routes/ModelRoute.ts:155](https://github.com/rapidrest/service-core/blob/0879470e308cd5828ebcf6efdbdba1cd0178007b/src/routes/ModelRoute.ts#L155)
|
|
153
|
-
|
|
154
|
-
The class type of the model this route is associated with.
|
|
155
|
-
|
|
156
|
-
##### Returns
|
|
157
|
-
|
|
158
|
-
`any`
|
|
159
|
-
|
|
160
|
-
## Methods
|
|
161
|
-
|
|
162
|
-
### doBulkCreate()
|
|
163
|
-
|
|
164
|
-
> **doBulkCreate**(`objs`, `options`): `Promise`\<`T`[]\>
|
|
165
|
-
|
|
166
|
-
Defined in: [src/routes/ModelRoute.ts:253](https://github.com/rapidrest/service-core/blob/0879470e308cd5828ebcf6efdbdba1cd0178007b/src/routes/ModelRoute.ts#L253)
|
|
167
|
-
|
|
168
|
-
Attempts to store a collection of objects provided in `options.req.body` into the datastore. Upon success, sets the newly persisted
|
|
169
|
-
object(s) to the `result` property of the `options.res` argument, otherwise sends a `400 BAD REQUEST` response to the
|
|
170
|
-
client.
|
|
171
|
-
|
|
172
|
-
#### Parameters
|
|
173
|
-
|
|
174
|
-
##### objs
|
|
175
|
-
|
|
176
|
-
`Partial`\<`T`\>[]
|
|
177
|
-
|
|
178
|
-
The object(s) to store in the database.
|
|
179
|
-
|
|
180
|
-
##### options
|
|
181
|
-
|
|
182
|
-
[`CreateRequestOptions`](../interfaces/CreateRequestOptions.md)
|
|
183
|
-
|
|
184
|
-
The options to process the request using.
|
|
185
|
-
|
|
186
|
-
#### Returns
|
|
187
|
-
|
|
188
|
-
`Promise`\<`T`[]\>
|
|
189
|
-
|
|
190
|
-
***
|
|
191
|
-
|
|
192
|
-
### doBulkUpdate()
|
|
193
|
-
|
|
194
|
-
> **doBulkUpdate**(`objs`, `options`): `Promise`\<`T`[]\>
|
|
195
|
-
|
|
196
|
-
Defined in: [src/routes/ModelRoute.ts:511](https://github.com/rapidrest/service-core/blob/0879470e308cd5828ebcf6efdbdba1cd0178007b/src/routes/ModelRoute.ts#L511)
|
|
197
|
-
|
|
198
|
-
Attempts to modify a collection of existing data model objects.
|
|
199
|
-
|
|
200
|
-
#### Parameters
|
|
201
|
-
|
|
202
|
-
##### objs
|
|
203
|
-
|
|
204
|
-
[`UpdateObject`](../type-aliases/UpdateObject.md)\<`T`\>[]
|
|
205
|
-
|
|
206
|
-
The object(s) to bulk update in the database.
|
|
207
|
-
|
|
208
|
-
##### options
|
|
209
|
-
|
|
210
|
-
[`UpdateRequestOptions`](../interfaces/UpdateRequestOptions.md)\<`T`\>
|
|
211
|
-
|
|
212
|
-
The options to process the request using.
|
|
213
|
-
|
|
214
|
-
#### Returns
|
|
215
|
-
|
|
216
|
-
`Promise`\<`T`[]\>
|
|
217
|
-
|
|
218
|
-
***
|
|
219
|
-
|
|
220
|
-
### doCount()
|
|
221
|
-
|
|
222
|
-
> **doCount**(`options`): `Promise`\<[`HttpResponse`](../interfaces/HttpResponse.md)\>
|
|
223
|
-
|
|
224
|
-
Defined in: [src/routes/ModelRoute.ts:187](https://github.com/rapidrest/service-core/blob/0879470e308cd5828ebcf6efdbdba1cd0178007b/src/routes/ModelRoute.ts#L187)
|
|
225
|
-
|
|
226
|
-
Attempts to retrieve the number of data model objects matching the given set of criteria as specified in the
|
|
227
|
-
request `query`. Any results that have been found are set to the `content-length` header of the `res` argument.
|
|
228
|
-
|
|
229
|
-
#### Parameters
|
|
230
|
-
|
|
231
|
-
##### options
|
|
232
|
-
|
|
233
|
-
[`FindRequestOptions`](../interfaces/FindRequestOptions.md)
|
|
234
|
-
|
|
235
|
-
The options to process the request using.
|
|
236
|
-
|
|
237
|
-
#### Returns
|
|
238
|
-
|
|
239
|
-
`Promise`\<[`HttpResponse`](../interfaces/HttpResponse.md)\>
|
|
240
|
-
|
|
241
|
-
***
|
|
242
|
-
|
|
243
|
-
### doCreate()
|
|
244
|
-
|
|
245
|
-
> **doCreate**(`obj`, `options`): `Promise`\<`T` \| `T`[]\>
|
|
246
|
-
|
|
247
|
-
Defined in: [src/routes/ModelRoute.ts:283](https://github.com/rapidrest/service-core/blob/0879470e308cd5828ebcf6efdbdba1cd0178007b/src/routes/ModelRoute.ts#L283)
|
|
248
|
-
|
|
249
|
-
Attempts to store one or more objects provided in `options.req.body` into the datastore. Upon success, sets the newly persisted
|
|
250
|
-
object(s) to the `result` property of the `options.res` argument, otherwise sends a `400 BAD REQUEST` response to the
|
|
251
|
-
client.
|
|
252
|
-
|
|
253
|
-
#### Parameters
|
|
254
|
-
|
|
255
|
-
##### obj
|
|
256
|
-
|
|
257
|
-
`Partial`\<`T`\> \| `Partial`\<`T`\>[]
|
|
258
|
-
|
|
259
|
-
The object(s) to store in the database.
|
|
260
|
-
|
|
261
|
-
##### options
|
|
262
|
-
|
|
263
|
-
[`CreateRequestOptions`](../interfaces/CreateRequestOptions.md)
|
|
264
|
-
|
|
265
|
-
The options to process the request using.
|
|
266
|
-
|
|
267
|
-
#### Returns
|
|
268
|
-
|
|
269
|
-
`Promise`\<`T` \| `T`[]\>
|
|
270
|
-
|
|
271
|
-
***
|
|
272
|
-
|
|
273
|
-
### doCreateObject()
|
|
274
|
-
|
|
275
|
-
> **doCreateObject**(`obj`, `options`): `Promise`\<`T`\>
|
|
276
|
-
|
|
277
|
-
Defined in: [src/routes/ModelRoute.ts:223](https://github.com/rapidrest/service-core/blob/0879470e308cd5828ebcf6efdbdba1cd0178007b/src/routes/ModelRoute.ts#L223)
|
|
278
|
-
|
|
279
|
-
Attempts to store an object provided in `options.req.body` into the datastore. Upon success, sets the newly persisted
|
|
280
|
-
object(s) to the `result` property of the `options.res` argument, otherwise sends a `400 BAD REQUEST` response to the
|
|
281
|
-
client.
|
|
282
|
-
|
|
283
|
-
#### Parameters
|
|
284
|
-
|
|
285
|
-
##### obj
|
|
286
|
-
|
|
287
|
-
`Partial`\<`T`\>
|
|
288
|
-
|
|
289
|
-
The object to store in the database.
|
|
290
|
-
|
|
291
|
-
##### options
|
|
292
|
-
|
|
293
|
-
[`CreateRequestOptions`](../interfaces/CreateRequestOptions.md)
|
|
294
|
-
|
|
295
|
-
The options to process the request using.
|
|
296
|
-
|
|
297
|
-
#### Returns
|
|
298
|
-
|
|
299
|
-
`Promise`\<`T`\>
|
|
300
|
-
|
|
301
|
-
***
|
|
302
|
-
|
|
303
|
-
### doDelete()
|
|
304
|
-
|
|
305
|
-
> **doDelete**(`id`, `options`): `Promise`\<`void`\>
|
|
306
|
-
|
|
307
|
-
Defined in: [src/routes/ModelRoute.ts:311](https://github.com/rapidrest/service-core/blob/0879470e308cd5828ebcf6efdbdba1cd0178007b/src/routes/ModelRoute.ts#L311)
|
|
308
|
-
|
|
309
|
-
Attempts to delete an existing data model object with a given unique identifier encoded by the URI parameter
|
|
310
|
-
`id`.
|
|
311
|
-
|
|
312
|
-
#### Parameters
|
|
313
|
-
|
|
314
|
-
##### id
|
|
315
|
-
|
|
316
|
-
`string`
|
|
317
|
-
|
|
318
|
-
The unique identifier of the object to delete.
|
|
319
|
-
|
|
320
|
-
##### options
|
|
321
|
-
|
|
322
|
-
[`DeleteRequestOptions`](../interfaces/DeleteRequestOptions.md)
|
|
323
|
-
|
|
324
|
-
The options to process the request using.
|
|
325
|
-
|
|
326
|
-
#### Returns
|
|
327
|
-
|
|
328
|
-
`Promise`\<`void`\>
|
|
329
|
-
|
|
330
|
-
***
|
|
331
|
-
|
|
332
|
-
### doExists()
|
|
333
|
-
|
|
334
|
-
> **doExists**(`id`, `options`): `Promise`\<`any`\>
|
|
335
|
-
|
|
336
|
-
Defined in: [src/routes/ModelRoute.ts:356](https://github.com/rapidrest/service-core/blob/0879470e308cd5828ebcf6efdbdba1cd0178007b/src/routes/ModelRoute.ts#L356)
|
|
337
|
-
|
|
338
|
-
Attempts to determine if an existing object with the given unique identifier exists.
|
|
339
|
-
|
|
340
|
-
#### Parameters
|
|
341
|
-
|
|
342
|
-
##### id
|
|
343
|
-
|
|
344
|
-
`string`
|
|
345
|
-
|
|
346
|
-
The unique identifier of the object to verify exists.
|
|
347
|
-
|
|
348
|
-
##### options
|
|
349
|
-
|
|
350
|
-
[`FindRequestOptions`](../interfaces/FindRequestOptions.md)
|
|
351
|
-
|
|
352
|
-
The options to process the request using.
|
|
353
|
-
|
|
354
|
-
#### Returns
|
|
355
|
-
|
|
356
|
-
`Promise`\<`any`\>
|
|
357
|
-
|
|
358
|
-
***
|
|
359
|
-
|
|
360
|
-
### doFindAll()
|
|
361
|
-
|
|
362
|
-
> **doFindAll**(`options`): `Promise`\<`T`[]\>
|
|
363
|
-
|
|
364
|
-
Defined in: [src/routes/ModelRoute.ts:397](https://github.com/rapidrest/service-core/blob/0879470e308cd5828ebcf6efdbdba1cd0178007b/src/routes/ModelRoute.ts#L397)
|
|
365
|
-
|
|
366
|
-
Attempts to retrieve all data model objects matching the given set of criteria as specified in the request
|
|
367
|
-
`query`. Any results that have been found are set to the `result` property of the `res` argument. `result` is
|
|
368
|
-
never null.
|
|
369
|
-
|
|
370
|
-
#### Parameters
|
|
371
|
-
|
|
372
|
-
##### options
|
|
373
|
-
|
|
374
|
-
[`FindRequestOptions`](../interfaces/FindRequestOptions.md)
|
|
375
|
-
|
|
376
|
-
The options to process the request using.
|
|
377
|
-
|
|
378
|
-
#### Returns
|
|
379
|
-
|
|
380
|
-
`Promise`\<`T`[]\>
|
|
381
|
-
|
|
382
|
-
***
|
|
383
|
-
|
|
384
|
-
### doFindById()
|
|
385
|
-
|
|
386
|
-
> **doFindById**(`id`, `options`): `Promise`\<`T` \| `null`\>
|
|
387
|
-
|
|
388
|
-
Defined in: [src/routes/ModelRoute.ts:431](https://github.com/rapidrest/service-core/blob/0879470e308cd5828ebcf6efdbdba1cd0178007b/src/routes/ModelRoute.ts#L431)
|
|
389
|
-
|
|
390
|
-
Attempts to retrieve a single data model object as identified by the `id` parameter in the URI.
|
|
391
|
-
|
|
392
|
-
#### Parameters
|
|
393
|
-
|
|
394
|
-
##### id
|
|
395
|
-
|
|
396
|
-
`string`
|
|
397
|
-
|
|
398
|
-
##### options
|
|
399
|
-
|
|
400
|
-
[`FindRequestOptions`](../interfaces/FindRequestOptions.md)
|
|
401
|
-
|
|
402
|
-
The options to process the request using.
|
|
403
|
-
|
|
404
|
-
#### Returns
|
|
405
|
-
|
|
406
|
-
`Promise`\<`T` \| `null`\>
|
|
407
|
-
|
|
408
|
-
***
|
|
409
|
-
|
|
410
|
-
### doTruncate()
|
|
411
|
-
|
|
412
|
-
> **doTruncate**(`options`): `Promise`\<`void`\>
|
|
413
|
-
|
|
414
|
-
Defined in: [src/routes/ModelRoute.ts:472](https://github.com/rapidrest/service-core/blob/0879470e308cd5828ebcf6efdbdba1cd0178007b/src/routes/ModelRoute.ts#L472)
|
|
415
|
-
|
|
416
|
-
Attempts to remove all entries of the data model type from the datastore matching the given
|
|
417
|
-
parameters and query.
|
|
418
|
-
|
|
419
|
-
#### Parameters
|
|
420
|
-
|
|
421
|
-
##### options
|
|
422
|
-
|
|
423
|
-
[`TruncateRequestOptions`](../interfaces/TruncateRequestOptions.md)
|
|
424
|
-
|
|
425
|
-
The options to process the request using.
|
|
426
|
-
|
|
427
|
-
#### Returns
|
|
428
|
-
|
|
429
|
-
`Promise`\<`void`\>
|
|
430
|
-
|
|
431
|
-
***
|
|
432
|
-
|
|
433
|
-
### doUpdate()
|
|
434
|
-
|
|
435
|
-
> **doUpdate**(`id`, `obj`, `options`): `Promise`\<`T`\>
|
|
436
|
-
|
|
437
|
-
Defined in: [src/routes/ModelRoute.ts:539](https://github.com/rapidrest/service-core/blob/0879470e308cd5828ebcf6efdbdba1cd0178007b/src/routes/ModelRoute.ts#L539)
|
|
438
|
-
|
|
439
|
-
Attempts to modify an existing data model object as identified by the `id` parameter in the URI.
|
|
440
|
-
|
|
441
|
-
#### Parameters
|
|
442
|
-
|
|
443
|
-
##### id
|
|
444
|
-
|
|
445
|
-
`string`
|
|
446
|
-
|
|
447
|
-
##### obj
|
|
448
|
-
|
|
449
|
-
[`UpdateObject`](../type-aliases/UpdateObject.md)\<`T`\>
|
|
450
|
-
|
|
451
|
-
The object to update in the database
|
|
452
|
-
|
|
453
|
-
##### options
|
|
454
|
-
|
|
455
|
-
[`UpdateRequestOptions`](../interfaces/UpdateRequestOptions.md)\<`T`\>
|
|
456
|
-
|
|
457
|
-
The options to process the request using.
|
|
458
|
-
|
|
459
|
-
#### Returns
|
|
460
|
-
|
|
461
|
-
`Promise`\<`T`\>
|
|
462
|
-
|
|
463
|
-
***
|
|
464
|
-
|
|
465
|
-
### doUpdateProperty()
|
|
466
|
-
|
|
467
|
-
> **doUpdateProperty**(`id`, `propertyName`, `value`, `options`): `Promise`\<`T`\>
|
|
468
|
-
|
|
469
|
-
Defined in: [src/routes/ModelRoute.ts:589](https://github.com/rapidrest/service-core/blob/0879470e308cd5828ebcf6efdbdba1cd0178007b/src/routes/ModelRoute.ts#L589)
|
|
470
|
-
|
|
471
|
-
Attempts to modify a single property of an existing data model object as identified by the `id` parameter in the URI.
|
|
472
|
-
|
|
473
|
-
Note that this effectively bypasses optimistic locking and can cause unexpected data overwrites. Use with care.
|
|
474
|
-
|
|
475
|
-
#### Parameters
|
|
476
|
-
|
|
477
|
-
##### id
|
|
478
|
-
|
|
479
|
-
`string`
|
|
480
|
-
|
|
481
|
-
The unique identifier of the object to update.
|
|
482
|
-
|
|
483
|
-
##### propertyName
|
|
484
|
-
|
|
485
|
-
`string`
|
|
486
|
-
|
|
487
|
-
The name of the property to update.
|
|
488
|
-
|
|
489
|
-
##### value
|
|
490
|
-
|
|
491
|
-
`any`
|
|
492
|
-
|
|
493
|
-
The value of the property to set.
|
|
494
|
-
|
|
495
|
-
##### options
|
|
496
|
-
|
|
497
|
-
[`UpdateRequestOptions`](../interfaces/UpdateRequestOptions.md)\<`T`\>
|
|
498
|
-
|
|
499
|
-
The options to process the request using.
|
|
500
|
-
|
|
501
|
-
#### Returns
|
|
502
|
-
|
|
503
|
-
`Promise`\<`T`\>
|
|
504
|
-
|
|
505
|
-
***
|
|
506
|
-
|
|
507
|
-
### doValidate()
|
|
508
|
-
|
|
509
|
-
> **doValidate**(`objs`, `options?`): `Promise`\<`void`\>
|
|
510
|
-
|
|
511
|
-
Defined in: [src/routes/ModelRoute.ts:630](https://github.com/rapidrest/service-core/blob/0879470e308cd5828ebcf6efdbdba1cd0178007b/src/routes/ModelRoute.ts#L630)
|
|
512
|
-
|
|
513
|
-
Calls `repoUtils.validate()` to validate the object(s) provided.
|
|
514
|
-
|
|
515
|
-
#### Parameters
|
|
516
|
-
|
|
517
|
-
##### objs
|
|
518
|
-
|
|
519
|
-
`Partial`\<`T`\> \| `Partial`\<`T`\>[]
|
|
520
|
-
|
|
521
|
-
##### options?
|
|
522
|
-
|
|
523
|
-
[`CreateRequestOptions`](../interfaces/CreateRequestOptions.md) \| [`UpdateRequestOptions`](../interfaces/UpdateRequestOptions.md)\<`T`\>
|
|
524
|
-
|
|
525
|
-
#### Returns
|
|
526
|
-
|
|
527
|
-
`Promise`\<`void`\>
|