@rapidrest/service-core 1.0.0-beta.1
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 +23 -0
- package/README.md +16 -0
- package/dist/lib/ApiErrors.js +41 -0
- package/dist/lib/ApiErrors.js.map +1 -0
- package/dist/lib/BackgroundService.js +16 -0
- package/dist/lib/BackgroundService.js.map +1 -0
- package/dist/lib/BackgroundServiceManager.js +135 -0
- package/dist/lib/BackgroundServiceManager.js.map +1 -0
- package/dist/lib/BulkError.js +24 -0
- package/dist/lib/BulkError.js.map +1 -0
- package/dist/lib/EventListenerManager.js +161 -0
- package/dist/lib/EventListenerManager.js.map +1 -0
- package/dist/lib/NetUtils.js +103 -0
- package/dist/lib/NetUtils.js.map +1 -0
- package/dist/lib/NotificationUtils.js +34 -0
- package/dist/lib/NotificationUtils.js.map +1 -0
- package/dist/lib/ObjectFactory.js +90 -0
- package/dist/lib/ObjectFactory.js.map +1 -0
- package/dist/lib/OpenApiSpec.js +748 -0
- package/dist/lib/OpenApiSpec.js.map +1 -0
- package/dist/lib/Server.js +549 -0
- package/dist/lib/Server.js.map +1 -0
- package/dist/lib/Types.js +2 -0
- package/dist/lib/Types.js.map +1 -0
- package/dist/lib/auth/AuthMiddleware.js +229 -0
- package/dist/lib/auth/AuthMiddleware.js.map +1 -0
- package/dist/lib/auth/AuthStrategy.js +2 -0
- package/dist/lib/auth/AuthStrategy.js.map +1 -0
- package/dist/lib/auth/BasicStrategy.js +106 -0
- package/dist/lib/auth/BasicStrategy.js.map +1 -0
- package/dist/lib/auth/JWTStrategy.js +161 -0
- package/dist/lib/auth/JWTStrategy.js.map +1 -0
- package/dist/lib/auth/index.js +5 -0
- package/dist/lib/auth/index.js.map +1 -0
- package/dist/lib/database/ConnectionKinds.js +14 -0
- package/dist/lib/database/ConnectionKinds.js.map +1 -0
- package/dist/lib/database/ConnectionManager.js +161 -0
- package/dist/lib/database/ConnectionManager.js.map +1 -0
- package/dist/lib/database/MongoConnection.js +86 -0
- package/dist/lib/database/MongoConnection.js.map +1 -0
- package/dist/lib/database/MongoRepository.js +136 -0
- package/dist/lib/database/MongoRepository.js.map +1 -0
- package/dist/lib/database/MongoSchemaSync.js +136 -0
- package/dist/lib/database/MongoSchemaSync.js.map +1 -0
- package/dist/lib/database/NamingUtils.js +52 -0
- package/dist/lib/database/NamingUtils.js.map +1 -0
- package/dist/lib/database/TypeOrmSupport.js +146 -0
- package/dist/lib/database/TypeOrmSupport.js.map +1 -0
- package/dist/lib/database/index.js +7 -0
- package/dist/lib/database/index.js.map +1 -0
- package/dist/lib/decorators/DatabaseDecorators.js +52 -0
- package/dist/lib/decorators/DatabaseDecorators.js.map +1 -0
- package/dist/lib/decorators/DocDecorators.js +120 -0
- package/dist/lib/decorators/DocDecorators.js.map +1 -0
- package/dist/lib/decorators/EventDecorators.js +24 -0
- package/dist/lib/decorators/EventDecorators.js.map +1 -0
- package/dist/lib/decorators/ModelDecorators.js +173 -0
- package/dist/lib/decorators/ModelDecorators.js.map +1 -0
- package/dist/lib/decorators/PersistenceDecorators.js +177 -0
- package/dist/lib/decorators/PersistenceDecorators.js.map +1 -0
- package/dist/lib/decorators/RouteDecorators.js +324 -0
- package/dist/lib/decorators/RouteDecorators.js.map +1 -0
- package/dist/lib/decorators/index.js +7 -0
- package/dist/lib/decorators/index.js.map +1 -0
- package/dist/lib/http/Adapters.js +230 -0
- package/dist/lib/http/Adapters.js.map +1 -0
- package/dist/lib/http/Router.js +403 -0
- package/dist/lib/http/Router.js.map +1 -0
- package/dist/lib/http/WebSocket.js +82 -0
- package/dist/lib/http/WebSocket.js.map +1 -0
- package/dist/lib/http/index.js +4 -0
- package/dist/lib/http/index.js.map +1 -0
- package/dist/lib/http/types.js +5 -0
- package/dist/lib/http/types.js.map +1 -0
- package/dist/lib/index.js +18 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/models/BaseEntity.js +83 -0
- package/dist/lib/models/BaseEntity.js.map +1 -0
- package/dist/lib/models/BaseMongoEntity.js +40 -0
- package/dist/lib/models/BaseMongoEntity.js.map +1 -0
- package/dist/lib/models/ModelUtils.js +645 -0
- package/dist/lib/models/ModelUtils.js.map +1 -0
- package/dist/lib/models/RecoverableBaseEntity.js +39 -0
- package/dist/lib/models/RecoverableBaseEntity.js.map +1 -0
- package/dist/lib/models/RecoverableBaseMongoEntity.js +40 -0
- package/dist/lib/models/RecoverableBaseMongoEntity.js.map +1 -0
- package/dist/lib/models/RepoUtils.js +717 -0
- package/dist/lib/models/RepoUtils.js.map +1 -0
- package/dist/lib/models/SimpleEntity.js +42 -0
- package/dist/lib/models/SimpleEntity.js.map +1 -0
- package/dist/lib/models/SimpleMongoEntity.js +38 -0
- package/dist/lib/models/SimpleMongoEntity.js.map +1 -0
- package/dist/lib/models/StatusExtraData.js +15 -0
- package/dist/lib/models/StatusExtraData.js.map +1 -0
- package/dist/lib/models/index.js +10 -0
- package/dist/lib/models/index.js.map +1 -0
- package/dist/lib/routes/AdminRoute.js +268 -0
- package/dist/lib/routes/AdminRoute.js.map +1 -0
- package/dist/lib/routes/MetricsRoute.js +86 -0
- package/dist/lib/routes/MetricsRoute.js.map +1 -0
- package/dist/lib/routes/ModelRoute.js +481 -0
- package/dist/lib/routes/ModelRoute.js.map +1 -0
- package/dist/lib/routes/OpenAPIRoute.js +115 -0
- package/dist/lib/routes/OpenAPIRoute.js.map +1 -0
- package/dist/lib/routes/RouteUtils.js +445 -0
- package/dist/lib/routes/RouteUtils.js.map +1 -0
- package/dist/lib/routes/StatusRoute.js +55 -0
- package/dist/lib/routes/StatusRoute.js.map +1 -0
- package/dist/lib/routes/index.js +7 -0
- package/dist/lib/routes/index.js.map +1 -0
- package/dist/lib/security/ACLRouteMongo.js +194 -0
- package/dist/lib/security/ACLRouteMongo.js.map +1 -0
- package/dist/lib/security/ACLRouteSQL.js +193 -0
- package/dist/lib/security/ACLRouteSQL.js.map +1 -0
- package/dist/lib/security/ACLUtils.js +457 -0
- package/dist/lib/security/ACLUtils.js.map +1 -0
- package/dist/lib/security/AccessControlList.js +18 -0
- package/dist/lib/security/AccessControlList.js.map +1 -0
- package/dist/lib/security/AccessControlListMongo.js +155 -0
- package/dist/lib/security/AccessControlListMongo.js.map +1 -0
- package/dist/lib/security/AccessControlListSQL.js +149 -0
- package/dist/lib/security/AccessControlListSQL.js.map +1 -0
- package/dist/lib/security/index.js +3 -0
- package/dist/lib/security/index.js.map +1 -0
- package/dist/lib/test/index.js +3 -0
- package/dist/lib/test/index.js.map +1 -0
- package/dist/lib/test/request.js +99 -0
- package/dist/lib/test/request.js.map +1 -0
- package/dist/lib/test/requestws.js +173 -0
- package/dist/lib/test/requestws.js.map +1 -0
- package/dist/types/ApiErrors.d.ts +38 -0
- package/dist/types/BackgroundService.d.ts +30 -0
- package/dist/types/BackgroundServiceManager.d.ts +66 -0
- package/dist/types/BulkError.d.ts +11 -0
- package/dist/types/EventListenerManager.d.ts +36 -0
- package/dist/types/NetUtils.d.ts +29 -0
- package/dist/types/NotificationUtils.d.ts +25 -0
- package/dist/types/ObjectFactory.d.ts +17 -0
- package/dist/types/OpenApiSpec.d.ts +114 -0
- package/dist/types/Server.d.ts +180 -0
- package/dist/types/Types.d.ts +8 -0
- package/dist/types/auth/AuthMiddleware.d.ts +42 -0
- package/dist/types/auth/AuthStrategy.d.ts +32 -0
- package/dist/types/auth/BasicStrategy.d.ts +33 -0
- package/dist/types/auth/JWTStrategy.d.ts +61 -0
- package/dist/types/auth/index.d.ts +4 -0
- package/dist/types/database/ConnectionKinds.d.ts +7 -0
- package/dist/types/database/ConnectionManager.d.ts +35 -0
- package/dist/types/database/MongoConnection.d.ts +54 -0
- package/dist/types/database/MongoRepository.d.ts +92 -0
- package/dist/types/database/MongoSchemaSync.d.ts +41 -0
- package/dist/types/database/NamingUtils.d.ts +24 -0
- package/dist/types/database/TypeOrmSupport.d.ts +20 -0
- package/dist/types/database/index.d.ts +6 -0
- package/dist/types/decorators/DatabaseDecorators.d.ts +18 -0
- package/dist/types/decorators/DocDecorators.d.ts +69 -0
- package/dist/types/decorators/EventDecorators.d.ts +12 -0
- package/dist/types/decorators/ModelDecorators.d.ts +80 -0
- package/dist/types/decorators/PersistenceDecorators.d.ts +117 -0
- package/dist/types/decorators/RouteDecorators.d.ts +172 -0
- package/dist/types/decorators/index.d.ts +6 -0
- package/dist/types/http/Adapters.d.ts +68 -0
- package/dist/types/http/Router.d.ts +99 -0
- package/dist/types/http/WebSocket.d.ts +56 -0
- package/dist/types/http/index.d.ts +6 -0
- package/dist/types/http/types.d.ts +54 -0
- package/dist/types/index.d.ts +17 -0
- package/dist/types/models/BaseEntity.d.ts +29 -0
- package/dist/types/models/BaseMongoEntity.d.ts +13 -0
- package/dist/types/models/ModelUtils.d.ts +166 -0
- package/dist/types/models/RecoverableBaseEntity.d.ts +16 -0
- package/dist/types/models/RecoverableBaseMongoEntity.d.ts +16 -0
- package/dist/types/models/RepoUtils.d.ts +154 -0
- package/dist/types/models/SimpleEntity.d.ts +14 -0
- package/dist/types/models/SimpleMongoEntity.d.ts +15 -0
- package/dist/types/models/StatusExtraData.d.ts +6 -0
- package/dist/types/models/index.d.ts +9 -0
- package/dist/types/routes/AdminRoute.d.ts +47 -0
- package/dist/types/routes/MetricsRoute.d.ts +15 -0
- package/dist/types/routes/ModelRoute.d.ts +226 -0
- package/dist/types/routes/OpenAPIRoute.d.ts +17 -0
- package/dist/types/routes/RouteUtils.d.ts +55 -0
- package/dist/types/routes/StatusRoute.d.ts +11 -0
- package/dist/types/routes/index.d.ts +6 -0
- package/dist/types/security/ACLRouteMongo.d.ts +19 -0
- package/dist/types/security/ACLRouteSQL.d.ts +19 -0
- package/dist/types/security/ACLUtils.d.ts +94 -0
- package/dist/types/security/AccessControlList.d.ts +103 -0
- package/dist/types/security/AccessControlListMongo.d.ts +24 -0
- package/dist/types/security/AccessControlListSQL.d.ts +24 -0
- package/dist/types/security/index.d.ts +2 -0
- package/dist/types/test/index.d.ts +2 -0
- package/dist/types/test/request.d.ts +24 -0
- package/dist/types/test/requestws.d.ts +21 -0
- package/docs/Makefile +20 -0
- package/docs/conf.py +58 -0
- package/docs/index.rst +17 -0
- package/docs/make.bat +35 -0
- package/docs/reference/@rapidrest/namespaces/DatabaseDecorators/README.md +13 -0
- package/docs/reference/@rapidrest/namespaces/DatabaseDecorators/functions/MongoRepository.md +25 -0
- package/docs/reference/@rapidrest/namespaces/DatabaseDecorators/functions/RedisConnection.md +25 -0
- package/docs/reference/@rapidrest/namespaces/DatabaseDecorators/functions/Repository.md +25 -0
- package/docs/reference/@rapidrest/namespaces/DocDecorators/README.md +23 -0
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Default.md +25 -0
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Description.md +25 -0
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Document.md +25 -0
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Example.md +25 -0
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Format.md +25 -0
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Returns.md +28 -0
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Summary.md +25 -0
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Tags.md +25 -0
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/TypeInfo.md +28 -0
- package/docs/reference/@rapidrest/namespaces/DocDecorators/interfaces/DocumentsData.md +57 -0
- package/docs/reference/@rapidrest/namespaces/EventDecorators/README.md +12 -0
- package/docs/reference/@rapidrest/namespaces/EventDecorators/functions/EventListener.md +17 -0
- package/docs/reference/@rapidrest/namespaces/EventDecorators/functions/OnEvent.md +26 -0
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/README.md +26 -0
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/Cache.md +25 -0
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/ChildEntity.md +18 -0
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/DataStore.md +25 -0
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/Identifier.md +27 -0
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/Protect.md +35 -0
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/Reference.md +25 -0
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/Shard.md +27 -0
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/TrackChanges.md +26 -0
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/interfaces/PendingTypeOrmColumn.md +45 -0
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/variables/pendingTypeOrmColumns.md +14 -0
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/README.md +25 -0
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/Column.md +25 -0
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/Entity.md +26 -0
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/Index.md +119 -0
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/PrimaryColumn.md +25 -0
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/Unique.md +68 -0
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/getColumnMetadata.md +26 -0
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/getEntityName.md +26 -0
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/getIndexMetadata.md +27 -0
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/interfaces/ColumnInfo.md +41 -0
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/interfaces/ColumnOptions.md +51 -0
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/interfaces/IndexInfo.md +41 -0
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/interfaces/IndexOptions.md +51 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/README.md +36 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/After.md +26 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Auth.md +33 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/AuthResult.md +31 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Before.md +25 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/ContentType.md +25 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Delete.md +25 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Get.md +25 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Head.md +25 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Header.md +25 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Method.md +31 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Model.md +25 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Options.md +25 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Param.md +26 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Patch.md +25 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Post.md +25 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Protect.md +31 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Put.md +25 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Query.md +26 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Request.md +31 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/RequiresRole.md +26 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Response.md +31 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Route.md +25 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Socket.md +33 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/User.md +31 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Validate.md +25 -0
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/WebSocket.md +25 -0
- package/docs/reference/README.md +20 -0
- package/docs/reference/classes/ACLUtils.md +251 -0
- package/docs/reference/classes/AdminRoute.md +51 -0
- package/docs/reference/classes/AuthMiddleware.md +131 -0
- package/docs/reference/classes/BackgroundService.md +117 -0
- package/docs/reference/classes/BackgroundServiceManager.md +172 -0
- package/docs/reference/classes/BaseEntity.md +82 -0
- package/docs/reference/classes/BaseMongoEntity.md +107 -0
- package/docs/reference/classes/BasicStrategy.md +89 -0
- package/docs/reference/classes/BasicStrategyOptions.md +91 -0
- package/docs/reference/classes/BulkError.md +271 -0
- package/docs/reference/classes/ConnectionManager.md +75 -0
- package/docs/reference/classes/EventListenerManager.md +88 -0
- package/docs/reference/classes/JWTStrategy.md +77 -0
- package/docs/reference/classes/JWTStrategyOptions.md +97 -0
- package/docs/reference/classes/MetricsRoute.md +27 -0
- package/docs/reference/classes/ModelRoute.md +527 -0
- package/docs/reference/classes/ModelUtils.md +448 -0
- package/docs/reference/classes/MongoConnection.md +218 -0
- package/docs/reference/classes/MongoRepository.md +354 -0
- package/docs/reference/classes/MongoSchemaSync.md +67 -0
- package/docs/reference/classes/NetUtils.md +90 -0
- package/docs/reference/classes/NotificationUtils.md +77 -0
- package/docs/reference/classes/ObjectFactory.md +336 -0
- package/docs/reference/classes/OpenAPIRoute.md +77 -0
- package/docs/reference/classes/OpenApiSpec.md +892 -0
- package/docs/reference/classes/RecoverableBaseEntity.md +114 -0
- package/docs/reference/classes/RecoverableBaseMongoEntity.md +124 -0
- package/docs/reference/classes/RedisTransport.md +2202 -0
- package/docs/reference/classes/RepoUtils.md +486 -0
- package/docs/reference/classes/RouteUtils.md +191 -0
- package/docs/reference/classes/Server.md +408 -0
- package/docs/reference/classes/SimpleEntity.md +48 -0
- package/docs/reference/classes/SimpleMongoEntity.md +66 -0
- package/docs/reference/classes/StatusExtraData.md +57 -0
- package/docs/reference/classes/StatusRoute.md +26 -0
- package/docs/reference/enumerations/ACLAction.md +63 -0
- package/docs/reference/enumerations/ApiErrorMessages.md +123 -0
- package/docs/reference/enumerations/ApiErrors.md +123 -0
- package/docs/reference/functions/isSqlDataSource.md +26 -0
- package/docs/reference/functions/resolveCollectionName.md +33 -0
- package/docs/reference/functions/snakeCase.md +28 -0
- package/docs/reference/globals.md +91 -0
- package/docs/reference/interfaces/ACLRecord.md +96 -0
- package/docs/reference/interfaces/AccessControlList.md +76 -0
- package/docs/reference/interfaces/AuthResult.md +55 -0
- package/docs/reference/interfaces/AuthStrategy.md +57 -0
- package/docs/reference/interfaces/CreateRequestOptions.md +121 -0
- package/docs/reference/interfaces/DeleteRequestOptions.md +147 -0
- package/docs/reference/interfaces/FindRequestOptions.md +133 -0
- package/docs/reference/interfaces/JWTAuthResult.md +84 -0
- package/docs/reference/interfaces/RepoCreateOptions.md +95 -0
- package/docs/reference/interfaces/RepoDeleteOptions.md +115 -0
- package/docs/reference/interfaces/RepoFindOptions.md +135 -0
- package/docs/reference/interfaces/RepoOperationOptions.md +69 -0
- package/docs/reference/interfaces/RepoUpdateOptions.md +111 -0
- package/docs/reference/interfaces/RequestOptions.md +112 -0
- package/docs/reference/interfaces/TruncateRequestOptions.md +175 -0
- package/docs/reference/interfaces/UpdateRequestOptions.md +149 -0
- package/docs/reference/type-aliases/OneOrMany.md +19 -0
- package/docs/reference/type-aliases/OneOrNull.md +19 -0
- package/docs/reference/type-aliases/PartialBaseEntity.md +17 -0
- package/docs/reference/type-aliases/PartialSimpleEntity.md +17 -0
- package/docs/reference/type-aliases/UpdateObject.md +19 -0
- package/package.json +125 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
[**@rapidrest/service-core**](../../../../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@rapidrest/service-core](../../../../globals.md) / [RouteDecorators](../README.md) / Query
|
|
6
|
+
|
|
7
|
+
# Function: Query()
|
|
8
|
+
|
|
9
|
+
> **Query**(`name?`): (`target`, `propertyKey`, `index`) => `void`
|
|
10
|
+
|
|
11
|
+
Defined in: [src/decorators/RouteDecorators.ts:265](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/decorators/RouteDecorators.ts#L265)
|
|
12
|
+
|
|
13
|
+
Injects the value of the specified query parameter with the given name as the value of the decorated argument. If
|
|
14
|
+
no name is specified the entire request query will be injected.
|
|
15
|
+
|
|
16
|
+
## Parameters
|
|
17
|
+
|
|
18
|
+
### name?
|
|
19
|
+
|
|
20
|
+
`string` \| `undefined`
|
|
21
|
+
|
|
22
|
+
THe name of the query parameter whose value will be injected.
|
|
23
|
+
|
|
24
|
+
## Returns
|
|
25
|
+
|
|
26
|
+
(`target`, `propertyKey`, `index`) => `void`
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
[**@rapidrest/service-core**](../../../../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@rapidrest/service-core](../../../../globals.md) / [RouteDecorators](../README.md) / Request
|
|
6
|
+
|
|
7
|
+
# Function: Request()
|
|
8
|
+
|
|
9
|
+
> **Request**(`target`, `propertyKey`, `index`): `void`
|
|
10
|
+
|
|
11
|
+
Defined in: [src/decorators/RouteDecorators.ts:276](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/decorators/RouteDecorators.ts#L276)
|
|
12
|
+
|
|
13
|
+
Injects the Express request object as the value of the decorated argument.
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### target
|
|
18
|
+
|
|
19
|
+
`any`
|
|
20
|
+
|
|
21
|
+
### propertyKey
|
|
22
|
+
|
|
23
|
+
`string`
|
|
24
|
+
|
|
25
|
+
### index
|
|
26
|
+
|
|
27
|
+
`number`
|
|
28
|
+
|
|
29
|
+
## Returns
|
|
30
|
+
|
|
31
|
+
`void`
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
[**@rapidrest/service-core**](../../../../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@rapidrest/service-core](../../../../globals.md) / [RouteDecorators](../README.md) / RequiresRole
|
|
6
|
+
|
|
7
|
+
# Function: RequiresRole()
|
|
8
|
+
|
|
9
|
+
> **RequiresRole**(`roles`): (`target`, `propertyKey`, `descriptor`) => `void`
|
|
10
|
+
|
|
11
|
+
Defined in: [src/decorators/RouteDecorators.ts:297](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/decorators/RouteDecorators.ts#L297)
|
|
12
|
+
|
|
13
|
+
Indicates that the client must be an authenticated user with at least one of the specified role(s) to process the
|
|
14
|
+
request.
|
|
15
|
+
|
|
16
|
+
## Parameters
|
|
17
|
+
|
|
18
|
+
### roles
|
|
19
|
+
|
|
20
|
+
`string` \| `string`[]
|
|
21
|
+
|
|
22
|
+
The role(s) that an authenticated user must have to make the request.
|
|
23
|
+
|
|
24
|
+
## Returns
|
|
25
|
+
|
|
26
|
+
(`target`, `propertyKey`, `descriptor`) => `void`
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
[**@rapidrest/service-core**](../../../../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@rapidrest/service-core](../../../../globals.md) / [RouteDecorators](../README.md) / Response
|
|
6
|
+
|
|
7
|
+
# Function: Response()
|
|
8
|
+
|
|
9
|
+
> **Response**(`target`, `propertyKey`, `index`): `void`
|
|
10
|
+
|
|
11
|
+
Defined in: [src/decorators/RouteDecorators.ts:285](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/decorators/RouteDecorators.ts#L285)
|
|
12
|
+
|
|
13
|
+
Injects the Express response object as the value of the decorated argument.
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### target
|
|
18
|
+
|
|
19
|
+
`any`
|
|
20
|
+
|
|
21
|
+
### propertyKey
|
|
22
|
+
|
|
23
|
+
`string`
|
|
24
|
+
|
|
25
|
+
### index
|
|
26
|
+
|
|
27
|
+
`number`
|
|
28
|
+
|
|
29
|
+
## Returns
|
|
30
|
+
|
|
31
|
+
`void`
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
[**@rapidrest/service-core**](../../../../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@rapidrest/service-core](../../../../globals.md) / [RouteDecorators](../README.md) / Route
|
|
6
|
+
|
|
7
|
+
# Function: Route()
|
|
8
|
+
|
|
9
|
+
> **Route**(`paths`): (`target`) => `void`
|
|
10
|
+
|
|
11
|
+
Defined in: [src/decorators/RouteDecorators.ts:310](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/decorators/RouteDecorators.ts#L310)
|
|
12
|
+
|
|
13
|
+
Indicates that the decorated class contains Express route definitions.
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### paths
|
|
18
|
+
|
|
19
|
+
`string` \| `string`[]
|
|
20
|
+
|
|
21
|
+
The base path(s) that all route definitions will use.
|
|
22
|
+
|
|
23
|
+
## Returns
|
|
24
|
+
|
|
25
|
+
(`target`) => `void`
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
[**@rapidrest/service-core**](../../../../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@rapidrest/service-core](../../../../globals.md) / [RouteDecorators](../README.md) / Socket
|
|
6
|
+
|
|
7
|
+
# Function: Socket()
|
|
8
|
+
|
|
9
|
+
> **Socket**(`target`, `propertyKey`, `index`): `void`
|
|
10
|
+
|
|
11
|
+
Defined in: [src/decorators/RouteDecorators.ts:323](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/decorators/RouteDecorators.ts#L323)
|
|
12
|
+
|
|
13
|
+
Injects the underlying Socket object associated with the request as the value of the decorated argument.
|
|
14
|
+
When the handler function is for a WebSocket request, the returned socket will be the newly established
|
|
15
|
+
WebSocket connection.
|
|
16
|
+
|
|
17
|
+
## Parameters
|
|
18
|
+
|
|
19
|
+
### target
|
|
20
|
+
|
|
21
|
+
`any`
|
|
22
|
+
|
|
23
|
+
### propertyKey
|
|
24
|
+
|
|
25
|
+
`string`
|
|
26
|
+
|
|
27
|
+
### index
|
|
28
|
+
|
|
29
|
+
`number`
|
|
30
|
+
|
|
31
|
+
## Returns
|
|
32
|
+
|
|
33
|
+
`void`
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
[**@rapidrest/service-core**](../../../../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@rapidrest/service-core](../../../../globals.md) / [RouteDecorators](../README.md) / User
|
|
6
|
+
|
|
7
|
+
# Function: User()
|
|
8
|
+
|
|
9
|
+
> **User**(`target`, `propertyKey`, `index`): `void`
|
|
10
|
+
|
|
11
|
+
Defined in: [src/decorators/RouteDecorators.ts:332](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/decorators/RouteDecorators.ts#L332)
|
|
12
|
+
|
|
13
|
+
Injects the authenticated user object as the value of the decorated argument.
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### target
|
|
18
|
+
|
|
19
|
+
`any`
|
|
20
|
+
|
|
21
|
+
### propertyKey
|
|
22
|
+
|
|
23
|
+
`string`
|
|
24
|
+
|
|
25
|
+
### index
|
|
26
|
+
|
|
27
|
+
`number`
|
|
28
|
+
|
|
29
|
+
## Returns
|
|
30
|
+
|
|
31
|
+
`void`
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
[**@rapidrest/service-core**](../../../../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@rapidrest/service-core](../../../../globals.md) / [RouteDecorators](../README.md) / Validate
|
|
6
|
+
|
|
7
|
+
# Function: Validate()
|
|
8
|
+
|
|
9
|
+
> **Validate**(`func`): (`target`, `propertyKey`, `descriptor`) => `void`
|
|
10
|
+
|
|
11
|
+
Defined in: [src/decorators/RouteDecorators.ts:343](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/decorators/RouteDecorators.ts#L343)
|
|
12
|
+
|
|
13
|
+
Indicates a validation function to execute in order to verify an incoming requests payload.
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### func
|
|
18
|
+
|
|
19
|
+
`string` \| `Function`
|
|
20
|
+
|
|
21
|
+
The validation function to execute that will verify the request payload.
|
|
22
|
+
|
|
23
|
+
## Returns
|
|
24
|
+
|
|
25
|
+
(`target`, `propertyKey`, `descriptor`) => `void`
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
[**@rapidrest/service-core**](../../../../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@rapidrest/service-core](../../../../globals.md) / [RouteDecorators](../README.md) / WebSocket
|
|
6
|
+
|
|
7
|
+
# Function: WebSocket()
|
|
8
|
+
|
|
9
|
+
> **WebSocket**(`path?`): (`target`, `propertyKey`, `descriptor`) => `void`
|
|
10
|
+
|
|
11
|
+
Defined in: [src/decorators/RouteDecorators.ts:356](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/decorators/RouteDecorators.ts#L356)
|
|
12
|
+
|
|
13
|
+
Indicates that the decorated function handles incoming `WebSocket` upgrade requests at the given sub-path.
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### path?
|
|
18
|
+
|
|
19
|
+
`string`
|
|
20
|
+
|
|
21
|
+
The sub-path that the route will handle requests for.
|
|
22
|
+
|
|
23
|
+
## Returns
|
|
24
|
+
|
|
25
|
+
(`target`, `propertyKey`, `descriptor`) => `void`
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
**@rapidrest/service-core**
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
# RapidREST: service-core
|
|
6
|
+
|
|
7
|
+
[](https://gitlab.rapidrest.com/rapidrest/rapidrestjs/service-core/-/commits/master)
|
|
8
|
+
[](https://gitlab.rapidrest.com/rapidrest/rapidrestjs/service-core/-/commits/master)
|
|
9
|
+
|
|
10
|
+
Provides common functionality and utilities for RapidREST based REST API service projects.
|
|
11
|
+
|
|
12
|
+
## NPM
|
|
13
|
+
```
|
|
14
|
+
npm i @rapidrest/service-core
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Yarn
|
|
18
|
+
```
|
|
19
|
+
yarn add @rapidrest/service-core
|
|
20
|
+
```
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
[**@rapidrest/service-core**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@rapidrest/service-core](../globals.md) / ACLUtils
|
|
6
|
+
|
|
7
|
+
# Class: ACLUtils
|
|
8
|
+
|
|
9
|
+
Defined in: [src/security/ACLUtils.ts:22](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/security/ACLUtils.ts#L22)
|
|
10
|
+
|
|
11
|
+
Common utility functions for working with `AccessControlList` objects and validating user permissions.
|
|
12
|
+
|
|
13
|
+
## Constructors
|
|
14
|
+
|
|
15
|
+
### Constructor
|
|
16
|
+
|
|
17
|
+
> **new ACLUtils**(): `ACLUtils`
|
|
18
|
+
|
|
19
|
+
#### Returns
|
|
20
|
+
|
|
21
|
+
`ACLUtils`
|
|
22
|
+
|
|
23
|
+
## Methods
|
|
24
|
+
|
|
25
|
+
### checkRequestPerms()
|
|
26
|
+
|
|
27
|
+
> **checkRequestPerms**(`uid`, `user`, `req`): `Promise`\<`boolean`\>
|
|
28
|
+
|
|
29
|
+
Defined in: [src/security/ACLUtils.ts:73](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/security/ACLUtils.ts#L73)
|
|
30
|
+
|
|
31
|
+
Validates that the user has permission to perform the request operation against the URL path for the
|
|
32
|
+
provided request. If ACLUtils has not been initialized or the `acl` datastore has not been configured
|
|
33
|
+
then always returns `true`.
|
|
34
|
+
|
|
35
|
+
#### Parameters
|
|
36
|
+
|
|
37
|
+
##### uid
|
|
38
|
+
|
|
39
|
+
`string`
|
|
40
|
+
|
|
41
|
+
The uid of the access control list to verify against.
|
|
42
|
+
|
|
43
|
+
##### user
|
|
44
|
+
|
|
45
|
+
`JWTUser` \| `undefined`
|
|
46
|
+
|
|
47
|
+
The user to validate.
|
|
48
|
+
|
|
49
|
+
##### req
|
|
50
|
+
|
|
51
|
+
`HttpRequest`
|
|
52
|
+
|
|
53
|
+
The request whose URL path and method will be verified.
|
|
54
|
+
|
|
55
|
+
#### Returns
|
|
56
|
+
|
|
57
|
+
`Promise`\<`boolean`\>
|
|
58
|
+
|
|
59
|
+
***
|
|
60
|
+
|
|
61
|
+
### findACL()
|
|
62
|
+
|
|
63
|
+
> **findACL**(`entityId`, `parentUids?`): `Promise`\<[`AccessControlList`](../interfaces/AccessControlList.md) \| `null`\>
|
|
64
|
+
|
|
65
|
+
Defined in: [src/security/ACLUtils.ts:195](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/security/ACLUtils.ts#L195)
|
|
66
|
+
|
|
67
|
+
Retrieves the access control list with the associated identifier and populates the parent(s).
|
|
68
|
+
|
|
69
|
+
#### Parameters
|
|
70
|
+
|
|
71
|
+
##### entityId
|
|
72
|
+
|
|
73
|
+
`string`
|
|
74
|
+
|
|
75
|
+
The unique identifier of the ACL to retrieve.
|
|
76
|
+
|
|
77
|
+
##### parentUids?
|
|
78
|
+
|
|
79
|
+
`string`[] = `[]`
|
|
80
|
+
|
|
81
|
+
The list of already found parent UIDs. This is used to break circular dependencies.
|
|
82
|
+
|
|
83
|
+
#### Returns
|
|
84
|
+
|
|
85
|
+
`Promise`\<[`AccessControlList`](../interfaces/AccessControlList.md) \| `null`\>
|
|
86
|
+
|
|
87
|
+
***
|
|
88
|
+
|
|
89
|
+
### getRecord()
|
|
90
|
+
|
|
91
|
+
> **getRecord**(`acl`, `user`): [`ACLRecord`](../interfaces/ACLRecord.md) \| `null`
|
|
92
|
+
|
|
93
|
+
Defined in: [src/security/ACLUtils.ts:459](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/security/ACLUtils.ts#L459)
|
|
94
|
+
|
|
95
|
+
Retrieves the first available record in the provided ACL associated with the provided user.
|
|
96
|
+
|
|
97
|
+
#### Parameters
|
|
98
|
+
|
|
99
|
+
##### acl
|
|
100
|
+
|
|
101
|
+
[`AccessControlList`](../interfaces/AccessControlList.md)
|
|
102
|
+
|
|
103
|
+
The access control list that will be searched.
|
|
104
|
+
|
|
105
|
+
##### user
|
|
106
|
+
|
|
107
|
+
`JWTUser` \| `undefined`
|
|
108
|
+
|
|
109
|
+
The user to find a record for.
|
|
110
|
+
|
|
111
|
+
#### Returns
|
|
112
|
+
|
|
113
|
+
[`ACLRecord`](../interfaces/ACLRecord.md) \| `null`
|
|
114
|
+
|
|
115
|
+
The ACL record associated with the given user if found, otherwise `undefined`.
|
|
116
|
+
|
|
117
|
+
***
|
|
118
|
+
|
|
119
|
+
### hasPermission()
|
|
120
|
+
|
|
121
|
+
> **hasPermission**(`user`, `acl`, `action`): `Promise`\<`boolean`\>
|
|
122
|
+
|
|
123
|
+
Defined in: [src/security/ACLUtils.ts:127](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/security/ACLUtils.ts#L127)
|
|
124
|
+
|
|
125
|
+
Validates that the user has permission to perform the provided action using the given access control list.
|
|
126
|
+
|
|
127
|
+
#### Parameters
|
|
128
|
+
|
|
129
|
+
##### user
|
|
130
|
+
|
|
131
|
+
`JWTUser` \| `undefined`
|
|
132
|
+
|
|
133
|
+
The user to validate permissions of.
|
|
134
|
+
|
|
135
|
+
##### acl
|
|
136
|
+
|
|
137
|
+
`string` \| [`AccessControlList`](../interfaces/AccessControlList.md)
|
|
138
|
+
|
|
139
|
+
The ACL or uid of an ACL to validate permissions against.
|
|
140
|
+
|
|
141
|
+
##### action
|
|
142
|
+
|
|
143
|
+
[`ACLAction`](../enumerations/ACLAction.md)
|
|
144
|
+
|
|
145
|
+
The action that the user desires permission for.
|
|
146
|
+
|
|
147
|
+
#### Returns
|
|
148
|
+
|
|
149
|
+
`Promise`\<`boolean`\>
|
|
150
|
+
|
|
151
|
+
`true` if the user has at least one of the permissions granted for the given entity, otherwise `false`.
|
|
152
|
+
|
|
153
|
+
***
|
|
154
|
+
|
|
155
|
+
### populateParent()
|
|
156
|
+
|
|
157
|
+
> **populateParent**(`acl`, `parentUids?`): `Promise`\<`void`\>
|
|
158
|
+
|
|
159
|
+
Defined in: [src/security/ACLUtils.ts:479](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/security/ACLUtils.ts#L479)
|
|
160
|
+
|
|
161
|
+
Attempts to retrieve the parent access control list for the given ACL object.
|
|
162
|
+
|
|
163
|
+
#### Parameters
|
|
164
|
+
|
|
165
|
+
##### acl
|
|
166
|
+
|
|
167
|
+
[`AccessControlList`](../interfaces/AccessControlList.md)
|
|
168
|
+
|
|
169
|
+
The access control list whose parents will be populated.
|
|
170
|
+
|
|
171
|
+
##### parentUids?
|
|
172
|
+
|
|
173
|
+
`string`[] = `[]`
|
|
174
|
+
|
|
175
|
+
The list of already found parent UIDs. This is used to break circular dependencies.
|
|
176
|
+
|
|
177
|
+
#### Returns
|
|
178
|
+
|
|
179
|
+
`Promise`\<`void`\>
|
|
180
|
+
|
|
181
|
+
***
|
|
182
|
+
|
|
183
|
+
### removeACL()
|
|
184
|
+
|
|
185
|
+
> **removeACL**(`uid`): `Promise`\<`void`\>
|
|
186
|
+
|
|
187
|
+
Defined in: [src/security/ACLUtils.ts:247](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/security/ACLUtils.ts#L247)
|
|
188
|
+
|
|
189
|
+
Deletes the ACL with the given identifier from the database.
|
|
190
|
+
|
|
191
|
+
#### Parameters
|
|
192
|
+
|
|
193
|
+
##### uid
|
|
194
|
+
|
|
195
|
+
`string`
|
|
196
|
+
|
|
197
|
+
The unique identifier of the ACL to remove.
|
|
198
|
+
|
|
199
|
+
#### Returns
|
|
200
|
+
|
|
201
|
+
`Promise`\<`void`\>
|
|
202
|
+
|
|
203
|
+
***
|
|
204
|
+
|
|
205
|
+
### saveACL()
|
|
206
|
+
|
|
207
|
+
> **saveACL**(`acl`): `Promise`\<[`AccessControlList`](../interfaces/AccessControlList.md) \| `null`\>
|
|
208
|
+
|
|
209
|
+
Defined in: [src/security/ACLUtils.ts:333](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/security/ACLUtils.ts#L333)
|
|
210
|
+
|
|
211
|
+
Stores the given access control list into the ACL database.
|
|
212
|
+
|
|
213
|
+
#### Parameters
|
|
214
|
+
|
|
215
|
+
##### acl
|
|
216
|
+
|
|
217
|
+
[`AccessControlList`](../interfaces/AccessControlList.md)
|
|
218
|
+
|
|
219
|
+
The ACL to store.
|
|
220
|
+
|
|
221
|
+
#### Returns
|
|
222
|
+
|
|
223
|
+
`Promise`\<[`AccessControlList`](../interfaces/AccessControlList.md) \| `null`\>
|
|
224
|
+
|
|
225
|
+
Returns the ACL that was stored in the database.
|
|
226
|
+
|
|
227
|
+
***
|
|
228
|
+
|
|
229
|
+
### saveDefaultACL()
|
|
230
|
+
|
|
231
|
+
> **saveDefaultACL**(`acl`): `Promise`\<[`AccessControlList`](../interfaces/AccessControlList.md) \| `null`\>
|
|
232
|
+
|
|
233
|
+
Defined in: [src/security/ACLUtils.ts:399](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/security/ACLUtils.ts#L399)
|
|
234
|
+
|
|
235
|
+
Stores the given default access control list into the ACL database. A default ACL is a special type of ACL
|
|
236
|
+
that is primarily defined and maintained within the code but allows for user-specific overrides. To accomplish
|
|
237
|
+
this, the provided ACL is split in two. A new record is automatically created with the `uid` of the form
|
|
238
|
+
`default_<uid>` that stores the exact record as provided by code. Then a second ACL record is created
|
|
239
|
+
with the `uid` being that of what is passed as the argument. This second ACL is used to store user-defined
|
|
240
|
+
overrides. As the `default_<uid>` record is always overwritten with the lastest version of the code, any
|
|
241
|
+
user-defined changes made to it are lost on service restart.
|
|
242
|
+
|
|
243
|
+
#### Parameters
|
|
244
|
+
|
|
245
|
+
##### acl
|
|
246
|
+
|
|
247
|
+
[`AccessControlList`](../interfaces/AccessControlList.md)
|
|
248
|
+
|
|
249
|
+
#### Returns
|
|
250
|
+
|
|
251
|
+
`Promise`\<[`AccessControlList`](../interfaces/AccessControlList.md) \| `null`\>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
[**@rapidrest/service-core**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@rapidrest/service-core](../globals.md) / AdminRoute
|
|
6
|
+
|
|
7
|
+
# Class: AdminRoute
|
|
8
|
+
|
|
9
|
+
Defined in: [src/routes/AdminRoute.ts:50](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/routes/AdminRoute.ts#L50)
|
|
10
|
+
|
|
11
|
+
The `AdminRoute` provides a default `/admin` endpoint that gives trusted users the following abilities:
|
|
12
|
+
|
|
13
|
+
* Clear cache via `GET /admin/clear-cache`
|
|
14
|
+
* Live tail the service logs via `GET /admin/logs`
|
|
15
|
+
* Retrieve service dependencies via `GET /admin/dependencies`
|
|
16
|
+
* Retrieve service release notes via `GET /admin/release-notes`
|
|
17
|
+
* Restart the service via `GET /admin/restart`
|
|
18
|
+
|
|
19
|
+
## Author
|
|
20
|
+
|
|
21
|
+
Jean-Philippe Steinmetz
|
|
22
|
+
|
|
23
|
+
## Constructors
|
|
24
|
+
|
|
25
|
+
### Constructor
|
|
26
|
+
|
|
27
|
+
> **new AdminRoute**(`releaseNotes`): `AdminRoute`
|
|
28
|
+
|
|
29
|
+
Defined in: [src/routes/AdminRoute.ts:82](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/routes/AdminRoute.ts#L82)
|
|
30
|
+
|
|
31
|
+
Constructs a new `ReleaseNotesRoute` object with the specified defaults.
|
|
32
|
+
|
|
33
|
+
#### Parameters
|
|
34
|
+
|
|
35
|
+
##### releaseNotes
|
|
36
|
+
|
|
37
|
+
`string`
|
|
38
|
+
|
|
39
|
+
The ReleaseNotes specification object to serve.
|
|
40
|
+
|
|
41
|
+
#### Returns
|
|
42
|
+
|
|
43
|
+
`AdminRoute`
|
|
44
|
+
|
|
45
|
+
## Properties
|
|
46
|
+
|
|
47
|
+
### cacheClient?
|
|
48
|
+
|
|
49
|
+
> `protected` `optional` **cacheClient?**: `Redis`
|
|
50
|
+
|
|
51
|
+
Defined in: [src/routes/AdminRoute.ts:55](https://github.com/rapidrest/service-core/blob/c8974caa9b5d3eb225bcbcd93945f2e588fe2f0a/src/routes/AdminRoute.ts#L55)
|