@rapidrest/service-core 1.0.0-beta.1 → 1.0.0-beta.2
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/dist/lib/auth/AuthMiddleware.js +33 -3
- package/dist/lib/auth/AuthMiddleware.js.map +1 -1
- package/dist/lib/auth/BasicStrategy.js +46 -39
- package/dist/lib/auth/BasicStrategy.js.map +1 -1
- package/dist/lib/auth/JWTStrategy.js +69 -60
- package/dist/lib/auth/JWTStrategy.js.map +1 -1
- package/dist/lib/index.js +2 -1
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/routes/RouteUtils.js +8 -7
- package/dist/lib/routes/RouteUtils.js.map +1 -1
- package/dist/types/auth/AuthMiddleware.d.ts +12 -1
- package/dist/types/auth/AuthStrategy.d.ts +13 -1
- package/dist/types/auth/BasicStrategy.d.ts +7 -3
- package/dist/types/auth/JWTStrategy.d.ts +6 -3
- package/dist/types/index.d.ts +2 -1
- package/docs/reference/@rapidrest/namespaces/DatabaseDecorators/functions/MongoRepository.md +1 -1
- package/docs/reference/@rapidrest/namespaces/DatabaseDecorators/functions/RedisConnection.md +1 -1
- package/docs/reference/@rapidrest/namespaces/DatabaseDecorators/functions/Repository.md +1 -1
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Default.md +1 -1
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Description.md +1 -1
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Document.md +1 -1
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Example.md +1 -1
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Format.md +1 -1
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Returns.md +1 -1
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Summary.md +1 -1
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Tags.md +1 -1
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/TypeInfo.md +1 -1
- package/docs/reference/@rapidrest/namespaces/DocDecorators/interfaces/DocumentsData.md +7 -7
- package/docs/reference/@rapidrest/namespaces/EventDecorators/functions/EventListener.md +1 -1
- package/docs/reference/@rapidrest/namespaces/EventDecorators/functions/OnEvent.md +1 -1
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/Cache.md +1 -1
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/ChildEntity.md +1 -1
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/DataStore.md +1 -1
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/Identifier.md +1 -1
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/Protect.md +1 -1
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/Reference.md +1 -1
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/Shard.md +1 -1
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/TrackChanges.md +1 -1
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/interfaces/PendingTypeOrmColumn.md +5 -5
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/variables/pendingTypeOrmColumns.md +1 -1
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/Column.md +1 -1
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/Entity.md +1 -1
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/Index.md +3 -3
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/PrimaryColumn.md +1 -1
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/Unique.md +3 -3
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/getColumnMetadata.md +1 -1
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/getEntityName.md +1 -1
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/getIndexMetadata.md +1 -1
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/interfaces/ColumnInfo.md +4 -4
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/interfaces/ColumnOptions.md +5 -5
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/interfaces/IndexInfo.md +4 -4
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/interfaces/IndexOptions.md +5 -5
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/After.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Auth.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/AuthResult.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Before.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/ContentType.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Delete.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Get.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Head.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Header.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Method.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Model.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Options.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Param.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Patch.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Post.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Protect.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Put.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Query.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Request.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/RequiresRole.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Response.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Route.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Socket.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/User.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Validate.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/WebSocket.md +1 -1
- package/docs/reference/classes/ACLUtils.md +10 -10
- package/docs/reference/classes/AdminRoute.md +3 -3
- package/docs/reference/classes/AuthMiddleware.md +55 -13
- package/docs/reference/classes/BackgroundService.md +8 -8
- package/docs/reference/classes/BackgroundServiceManager.md +7 -7
- package/docs/reference/classes/BaseEntity.md +6 -6
- package/docs/reference/classes/BaseMongoEntity.md +7 -7
- package/docs/reference/classes/BasicStrategy.md +52 -10
- package/docs/reference/classes/BasicStrategyOptions.md +35 -11
- package/docs/reference/classes/BulkError.md +3 -3
- package/docs/reference/classes/ConnectionManager.md +4 -4
- package/docs/reference/classes/EventListenerManager.md +5 -5
- package/docs/reference/classes/HttpRouter.md +343 -0
- package/docs/reference/classes/JWTStrategy.md +37 -14
- package/docs/reference/classes/JWTStrategyOptions.md +10 -10
- package/docs/reference/classes/MetricsRoute.md +2 -2
- package/docs/reference/classes/ModelRoute.md +28 -28
- package/docs/reference/classes/ModelUtils.md +10 -10
- package/docs/reference/classes/MongoConnection.md +12 -12
- package/docs/reference/classes/MongoRepository.md +17 -17
- package/docs/reference/classes/MongoSchemaSync.md +3 -3
- package/docs/reference/classes/NetUtils.md +4 -4
- package/docs/reference/classes/NotificationUtils.md +3 -3
- package/docs/reference/classes/ObjectFactory.md +10 -10
- package/docs/reference/classes/OpenAPIRoute.md +5 -5
- package/docs/reference/classes/OpenApiSpec.md +45 -45
- package/docs/reference/classes/RecoverableBaseEntity.md +7 -7
- package/docs/reference/classes/RecoverableBaseMongoEntity.md +8 -8
- package/docs/reference/classes/RedisTransport.md +4 -4
- package/docs/reference/classes/RepoUtils.md +28 -28
- package/docs/reference/classes/RouteUtils.md +17 -17
- package/docs/reference/classes/Server.md +29 -29
- package/docs/reference/classes/SimpleEntity.md +3 -3
- package/docs/reference/classes/SimpleMongoEntity.md +4 -4
- package/docs/reference/classes/StatusExtraData.md +4 -4
- package/docs/reference/classes/StatusRoute.md +1 -1
- package/docs/reference/classes/UWSRequest.md +226 -0
- package/docs/reference/classes/UWSResponse.md +257 -0
- package/docs/reference/classes/UWSWebSocketShim.md +958 -0
- package/docs/reference/enumerations/ACLAction.md +7 -7
- package/docs/reference/enumerations/ApiErrorMessages.md +15 -15
- package/docs/reference/enumerations/ApiErrors.md +15 -15
- package/docs/reference/functions/createWebSocketStream.md +27 -0
- package/docs/reference/functions/isSqlDataSource.md +1 -1
- package/docs/reference/functions/readBody.md +29 -0
- package/docs/reference/functions/resolveCollectionName.md +1 -1
- package/docs/reference/functions/runChain.md +40 -0
- package/docs/reference/functions/snakeCase.md +1 -1
- package/docs/reference/globals.md +15 -0
- package/docs/reference/interfaces/ACLRecord.md +8 -8
- package/docs/reference/interfaces/AccessControlList.md +5 -5
- package/docs/reference/interfaces/AuthResult.md +5 -5
- package/docs/reference/interfaces/AuthStrategy.md +47 -9
- package/docs/reference/interfaces/CreateRequestOptions.md +11 -11
- package/docs/reference/interfaces/DeleteRequestOptions.md +13 -13
- package/docs/reference/interfaces/FindRequestOptions.md +12 -12
- package/docs/reference/interfaces/HttpRequest.md +147 -0
- package/docs/reference/interfaces/HttpResponse.md +164 -0
- package/docs/reference/interfaces/JWTAuthResult.md +9 -9
- package/docs/reference/interfaces/RepoCreateOptions.md +7 -7
- package/docs/reference/interfaces/RepoDeleteOptions.md +9 -9
- package/docs/reference/interfaces/RepoFindOptions.md +11 -11
- package/docs/reference/interfaces/RepoOperationOptions.md +6 -6
- package/docs/reference/interfaces/RepoUpdateOptions.md +8 -8
- package/docs/reference/interfaces/RequestOptions.md +10 -10
- package/docs/reference/interfaces/RequestWS.md +225 -0
- package/docs/reference/interfaces/TruncateRequestOptions.md +15 -15
- package/docs/reference/interfaces/UpdateRequestOptions.md +13 -13
- package/docs/reference/type-aliases/ErrorHandler.md +35 -0
- package/docs/reference/type-aliases/NextFunction.md +23 -0
- package/docs/reference/type-aliases/OneOrMany.md +1 -1
- package/docs/reference/type-aliases/OneOrNull.md +1 -1
- package/docs/reference/type-aliases/PartialBaseEntity.md +1 -1
- package/docs/reference/type-aliases/PartialSimpleEntity.md +1 -1
- package/docs/reference/type-aliases/RequestHandler.md +31 -0
- package/docs/reference/type-aliases/UpdateObject.md +1 -1
- package/docs/reference/type-aliases/WsUpgradeAuth.md +27 -0
- package/docs/reference/type-aliases/WsUpgradeAuthResult.md +47 -0
- package/package.json +2 -2
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Abstract Class: RecoverableBaseEntity
|
|
8
8
|
|
|
9
|
-
Defined in: [src/models/RecoverableBaseEntity.ts:15](https://github.com/rapidrest/service-core/blob/
|
|
9
|
+
Defined in: [src/models/RecoverableBaseEntity.ts:15](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/RecoverableBaseEntity.ts#L15)
|
|
10
10
|
|
|
11
11
|
The `RecoverableBaseEntity` provides an entity base class for those classes wishing to implement
|
|
12
12
|
soft delete capability. A soft delete means that a delete operation does not remove the entity
|
|
@@ -31,7 +31,7 @@ Jean-Philippe Steinmetz <rapidrests@gmail.com>
|
|
|
31
31
|
|
|
32
32
|
> **new RecoverableBaseEntity**(`other?`): `RecoverableBaseEntity`
|
|
33
33
|
|
|
34
|
-
Defined in: [src/models/RecoverableBaseEntity.ts:22](https://github.com/rapidrest/service-core/blob/
|
|
34
|
+
Defined in: [src/models/RecoverableBaseEntity.ts:22](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/RecoverableBaseEntity.ts#L22)
|
|
35
35
|
|
|
36
36
|
#### Parameters
|
|
37
37
|
|
|
@@ -53,7 +53,7 @@ Defined in: [src/models/RecoverableBaseEntity.ts:22](https://github.com/rapidres
|
|
|
53
53
|
|
|
54
54
|
> **dateCreated**: `Date`
|
|
55
55
|
|
|
56
|
-
Defined in: [src/models/BaseEntity.ts:35](https://github.com/rapidrest/service-core/blob/
|
|
56
|
+
Defined in: [src/models/BaseEntity.ts:35](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/BaseEntity.ts#L35)
|
|
57
57
|
|
|
58
58
|
The date and time that the entity was created.
|
|
59
59
|
|
|
@@ -67,7 +67,7 @@ The date and time that the entity was created.
|
|
|
67
67
|
|
|
68
68
|
> **dateModified**: `Date`
|
|
69
69
|
|
|
70
|
-
Defined in: [src/models/BaseEntity.ts:43](https://github.com/rapidrest/service-core/blob/
|
|
70
|
+
Defined in: [src/models/BaseEntity.ts:43](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/BaseEntity.ts#L43)
|
|
71
71
|
|
|
72
72
|
The date and time that the entity was last modified.
|
|
73
73
|
|
|
@@ -81,7 +81,7 @@ The date and time that the entity was last modified.
|
|
|
81
81
|
|
|
82
82
|
> **deleted**: `boolean` = `false`
|
|
83
83
|
|
|
84
|
-
Defined in: [src/models/RecoverableBaseEntity.ts:20](https://github.com/rapidrest/service-core/blob/
|
|
84
|
+
Defined in: [src/models/RecoverableBaseEntity.ts:20](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/RecoverableBaseEntity.ts#L20)
|
|
85
85
|
|
|
86
86
|
Indicates if the document has been soft deleted.
|
|
87
87
|
|
|
@@ -91,7 +91,7 @@ Indicates if the document has been soft deleted.
|
|
|
91
91
|
|
|
92
92
|
> **uid**: `string`
|
|
93
93
|
|
|
94
|
-
Defined in: [src/models/BaseEntity.ts:27](https://github.com/rapidrest/service-core/blob/
|
|
94
|
+
Defined in: [src/models/BaseEntity.ts:27](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/BaseEntity.ts#L27)
|
|
95
95
|
|
|
96
96
|
The universally unique identifier of the entity.
|
|
97
97
|
|
|
@@ -105,7 +105,7 @@ The universally unique identifier of the entity.
|
|
|
105
105
|
|
|
106
106
|
> **version**: `number` = `0`
|
|
107
107
|
|
|
108
|
-
Defined in: [src/models/BaseEntity.ts:50](https://github.com/rapidrest/service-core/blob/
|
|
108
|
+
Defined in: [src/models/BaseEntity.ts:50](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/BaseEntity.ts#L50)
|
|
109
109
|
|
|
110
110
|
The optimistic lock version.
|
|
111
111
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Abstract Class: RecoverableBaseMongoEntity
|
|
8
8
|
|
|
9
|
-
Defined in: [src/models/RecoverableBaseMongoEntity.ts:16](https://github.com/rapidrest/service-core/blob/
|
|
9
|
+
Defined in: [src/models/RecoverableBaseMongoEntity.ts:16](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/RecoverableBaseMongoEntity.ts#L16)
|
|
10
10
|
|
|
11
11
|
The `RecoverableBaseMongoEntity` provides an entity base class for those classes wishing to implement
|
|
12
12
|
soft delete capability. A soft delete means that a delete operation does not remove the entity
|
|
@@ -27,7 +27,7 @@ Jean-Philippe Steinmetz <rapidrests@gmail.com>
|
|
|
27
27
|
|
|
28
28
|
> **new RecoverableBaseMongoEntity**(`other?`): `RecoverableBaseMongoEntity`
|
|
29
29
|
|
|
30
|
-
Defined in: [src/models/RecoverableBaseMongoEntity.ts:23](https://github.com/rapidrest/service-core/blob/
|
|
30
|
+
Defined in: [src/models/RecoverableBaseMongoEntity.ts:23](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/RecoverableBaseMongoEntity.ts#L23)
|
|
31
31
|
|
|
32
32
|
#### Parameters
|
|
33
33
|
|
|
@@ -49,7 +49,7 @@ Defined in: [src/models/RecoverableBaseMongoEntity.ts:23](https://github.com/rap
|
|
|
49
49
|
|
|
50
50
|
> `optional` **\_id?**: `any`
|
|
51
51
|
|
|
52
|
-
Defined in: [src/models/RecoverableBaseMongoEntity.ts:21](https://github.com/rapidrest/service-core/blob/
|
|
52
|
+
Defined in: [src/models/RecoverableBaseMongoEntity.ts:21](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/RecoverableBaseMongoEntity.ts#L21)
|
|
53
53
|
|
|
54
54
|
The internal unique identifier used by MongoDB.
|
|
55
55
|
|
|
@@ -59,7 +59,7 @@ The internal unique identifier used by MongoDB.
|
|
|
59
59
|
|
|
60
60
|
> **dateCreated**: `Date`
|
|
61
61
|
|
|
62
|
-
Defined in: [src/models/BaseEntity.ts:35](https://github.com/rapidrest/service-core/blob/
|
|
62
|
+
Defined in: [src/models/BaseEntity.ts:35](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/BaseEntity.ts#L35)
|
|
63
63
|
|
|
64
64
|
The date and time that the entity was created.
|
|
65
65
|
|
|
@@ -73,7 +73,7 @@ The date and time that the entity was created.
|
|
|
73
73
|
|
|
74
74
|
> **dateModified**: `Date`
|
|
75
75
|
|
|
76
|
-
Defined in: [src/models/BaseEntity.ts:43](https://github.com/rapidrest/service-core/blob/
|
|
76
|
+
Defined in: [src/models/BaseEntity.ts:43](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/BaseEntity.ts#L43)
|
|
77
77
|
|
|
78
78
|
The date and time that the entity was last modified.
|
|
79
79
|
|
|
@@ -87,7 +87,7 @@ The date and time that the entity was last modified.
|
|
|
87
87
|
|
|
88
88
|
> **deleted**: `boolean` = `false`
|
|
89
89
|
|
|
90
|
-
Defined in: [src/models/RecoverableBaseEntity.ts:20](https://github.com/rapidrest/service-core/blob/
|
|
90
|
+
Defined in: [src/models/RecoverableBaseEntity.ts:20](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/RecoverableBaseEntity.ts#L20)
|
|
91
91
|
|
|
92
92
|
Indicates if the document has been soft deleted.
|
|
93
93
|
|
|
@@ -101,7 +101,7 @@ Indicates if the document has been soft deleted.
|
|
|
101
101
|
|
|
102
102
|
> **uid**: `string`
|
|
103
103
|
|
|
104
|
-
Defined in: [src/models/BaseEntity.ts:27](https://github.com/rapidrest/service-core/blob/
|
|
104
|
+
Defined in: [src/models/BaseEntity.ts:27](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/BaseEntity.ts#L27)
|
|
105
105
|
|
|
106
106
|
The universally unique identifier of the entity.
|
|
107
107
|
|
|
@@ -115,7 +115,7 @@ The universally unique identifier of the entity.
|
|
|
115
115
|
|
|
116
116
|
> **version**: `number` = `0`
|
|
117
117
|
|
|
118
|
-
Defined in: [src/models/BaseEntity.ts:50](https://github.com/rapidrest/service-core/blob/
|
|
118
|
+
Defined in: [src/models/BaseEntity.ts:50](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/BaseEntity.ts#L50)
|
|
119
119
|
|
|
120
120
|
The optimistic lock version.
|
|
121
121
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: RedisTransport
|
|
8
8
|
|
|
9
|
-
Defined in: [src/routes/AdminRoute.ts:17](https://github.com/rapidrest/service-core/blob/
|
|
9
|
+
Defined in: [src/routes/AdminRoute.ts:17](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/routes/AdminRoute.ts#L17)
|
|
10
10
|
|
|
11
11
|
Implements a Winston transport that pipes incoming log messages to a configured redis pubsub channel.
|
|
12
12
|
|
|
@@ -20,7 +20,7 @@ Implements a Winston transport that pipes incoming log messages to a configured
|
|
|
20
20
|
|
|
21
21
|
> **new RedisTransport**(`opts`): `RedisTransport`
|
|
22
22
|
|
|
23
|
-
Defined in: [src/routes/AdminRoute.ts:21](https://github.com/rapidrest/service-core/blob/
|
|
23
|
+
Defined in: [src/routes/AdminRoute.ts:21](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/routes/AdminRoute.ts#L21)
|
|
24
24
|
|
|
25
25
|
#### Parameters
|
|
26
26
|
|
|
@@ -595,7 +595,7 @@ Defined in: node\_modules/@types/node/stream.d.ts:1020
|
|
|
595
595
|
|
|
596
596
|
> **close**(): `void`
|
|
597
597
|
|
|
598
|
-
Defined in: [src/routes/AdminRoute.ts:27](https://github.com/rapidrest/service-core/blob/
|
|
598
|
+
Defined in: [src/routes/AdminRoute.ts:27](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/routes/AdminRoute.ts#L27)
|
|
599
599
|
|
|
600
600
|
#### Returns
|
|
601
601
|
|
|
@@ -1110,7 +1110,7 @@ Defined in: node\_modules/@types/node/stream.d.ts:1029
|
|
|
1110
1110
|
|
|
1111
1111
|
> **log**(`info`, `next`): `any`
|
|
1112
1112
|
|
|
1113
|
-
Defined in: [src/routes/AdminRoute.ts:31](https://github.com/rapidrest/service-core/blob/
|
|
1113
|
+
Defined in: [src/routes/AdminRoute.ts:31](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/routes/AdminRoute.ts#L31)
|
|
1114
1114
|
|
|
1115
1115
|
#### Parameters
|
|
1116
1116
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: RepoUtils\<T\>
|
|
8
8
|
|
|
9
|
-
Defined in: [src/models/RepoUtils.ts:89](https://github.com/rapidrest/service-core/blob/
|
|
9
|
+
Defined in: [src/models/RepoUtils.ts:89](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/RepoUtils.ts#L89)
|
|
10
10
|
|
|
11
11
|
## Author
|
|
12
12
|
|
|
@@ -24,7 +24,7 @@ Jean-Philippe Steinmetz
|
|
|
24
24
|
|
|
25
25
|
> **new RepoUtils**\<`T`\>(`modelClass`, `repo?`): `RepoUtils`\<`T`\>
|
|
26
26
|
|
|
27
|
-
Defined in: [src/models/RepoUtils.ts:123](https://github.com/rapidrest/service-core/blob/
|
|
27
|
+
Defined in: [src/models/RepoUtils.ts:123](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/RepoUtils.ts#L123)
|
|
28
28
|
|
|
29
29
|
#### Parameters
|
|
30
30
|
|
|
@@ -46,7 +46,7 @@ Defined in: [src/models/RepoUtils.ts:123](https://github.com/rapidrest/service-c
|
|
|
46
46
|
|
|
47
47
|
> `protected` `optional` **aclUtils?**: [`ACLUtils`](ACLUtils.md)
|
|
48
48
|
|
|
49
|
-
Defined in: [src/models/RepoUtils.ts:91](https://github.com/rapidrest/service-core/blob/
|
|
49
|
+
Defined in: [src/models/RepoUtils.ts:91](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/RepoUtils.ts#L91)
|
|
50
50
|
|
|
51
51
|
***
|
|
52
52
|
|
|
@@ -54,7 +54,7 @@ Defined in: [src/models/RepoUtils.ts:91](https://github.com/rapidrest/service-co
|
|
|
54
54
|
|
|
55
55
|
> `protected` `optional` **cacheClient?**: `Redis`
|
|
56
56
|
|
|
57
|
-
Defined in: [src/models/RepoUtils.ts:95](https://github.com/rapidrest/service-core/blob/
|
|
57
|
+
Defined in: [src/models/RepoUtils.ts:95](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/RepoUtils.ts#L95)
|
|
58
58
|
|
|
59
59
|
The redis client that will be used as a 2nd level cache for all cacheable models.
|
|
60
60
|
|
|
@@ -64,7 +64,7 @@ The redis client that will be used as a 2nd level cache for all cacheable models
|
|
|
64
64
|
|
|
65
65
|
> `protected` **config**: `any`
|
|
66
66
|
|
|
67
|
-
Defined in: [src/models/RepoUtils.ts:98](https://github.com/rapidrest/service-core/blob/
|
|
67
|
+
Defined in: [src/models/RepoUtils.ts:98](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/RepoUtils.ts#L98)
|
|
68
68
|
|
|
69
69
|
***
|
|
70
70
|
|
|
@@ -72,7 +72,7 @@ Defined in: [src/models/RepoUtils.ts:98](https://github.com/rapidrest/service-co
|
|
|
72
72
|
|
|
73
73
|
> `protected` `optional` **connectionManager?**: [`ConnectionManager`](ConnectionManager.md)
|
|
74
74
|
|
|
75
|
-
Defined in: [src/models/RepoUtils.ts:101](https://github.com/rapidrest/service-core/blob/
|
|
75
|
+
Defined in: [src/models/RepoUtils.ts:101](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/RepoUtils.ts#L101)
|
|
76
76
|
|
|
77
77
|
***
|
|
78
78
|
|
|
@@ -80,7 +80,7 @@ Defined in: [src/models/RepoUtils.ts:101](https://github.com/rapidrest/service-c
|
|
|
80
80
|
|
|
81
81
|
> **defaultACLUid**: `string` = `""`
|
|
82
82
|
|
|
83
|
-
Defined in: [src/models/RepoUtils.ts:104](https://github.com/rapidrest/service-core/blob/
|
|
83
|
+
Defined in: [src/models/RepoUtils.ts:104](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/RepoUtils.ts#L104)
|
|
84
84
|
|
|
85
85
|
The unique identifier of the default ACL for the model type.
|
|
86
86
|
|
|
@@ -90,7 +90,7 @@ The unique identifier of the default ACL for the model type.
|
|
|
90
90
|
|
|
91
91
|
> `protected` **logger**: `any`
|
|
92
92
|
|
|
93
|
-
Defined in: [src/models/RepoUtils.ts:107](https://github.com/rapidrest/service-core/blob/
|
|
93
|
+
Defined in: [src/models/RepoUtils.ts:107](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/RepoUtils.ts#L107)
|
|
94
94
|
|
|
95
95
|
***
|
|
96
96
|
|
|
@@ -98,7 +98,7 @@ Defined in: [src/models/RepoUtils.ts:107](https://github.com/rapidrest/service-c
|
|
|
98
98
|
|
|
99
99
|
> `protected` **modelClass**: `any`
|
|
100
100
|
|
|
101
|
-
Defined in: [src/models/RepoUtils.ts:109](https://github.com/rapidrest/service-core/blob/
|
|
101
|
+
Defined in: [src/models/RepoUtils.ts:109](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/RepoUtils.ts#L109)
|
|
102
102
|
|
|
103
103
|
***
|
|
104
104
|
|
|
@@ -106,7 +106,7 @@ Defined in: [src/models/RepoUtils.ts:109](https://github.com/rapidrest/service-c
|
|
|
106
106
|
|
|
107
107
|
> `protected` `optional` **notificationUtils?**: [`NotificationUtils`](NotificationUtils.md)
|
|
108
108
|
|
|
109
|
-
Defined in: [src/models/RepoUtils.ts:115](https://github.com/rapidrest/service-core/blob/
|
|
109
|
+
Defined in: [src/models/RepoUtils.ts:115](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/RepoUtils.ts#L115)
|
|
110
110
|
|
|
111
111
|
***
|
|
112
112
|
|
|
@@ -114,7 +114,7 @@ Defined in: [src/models/RepoUtils.ts:115](https://github.com/rapidrest/service-c
|
|
|
114
114
|
|
|
115
115
|
> `protected` `optional` **objectFactory?**: [`ObjectFactory`](ObjectFactory.md)
|
|
116
116
|
|
|
117
|
-
Defined in: [src/models/RepoUtils.ts:112](https://github.com/rapidrest/service-core/blob/
|
|
117
|
+
Defined in: [src/models/RepoUtils.ts:112](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/RepoUtils.ts#L112)
|
|
118
118
|
|
|
119
119
|
***
|
|
120
120
|
|
|
@@ -122,7 +122,7 @@ Defined in: [src/models/RepoUtils.ts:112](https://github.com/rapidrest/service-c
|
|
|
122
122
|
|
|
123
123
|
> `optional` **repo?**: `Repository`\<`T`\> \| [`MongoRepository`](MongoRepository.md)\<`T`\>
|
|
124
124
|
|
|
125
|
-
Defined in: [src/models/RepoUtils.ts:118](https://github.com/rapidrest/service-core/blob/
|
|
125
|
+
Defined in: [src/models/RepoUtils.ts:118](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/RepoUtils.ts#L118)
|
|
126
126
|
|
|
127
127
|
The model class associated with the controller to perform operations against.
|
|
128
128
|
|
|
@@ -132,7 +132,7 @@ The model class associated with the controller to perform operations against.
|
|
|
132
132
|
|
|
133
133
|
> `protected` **trustedRoles**: `string`[]
|
|
134
134
|
|
|
135
|
-
Defined in: [src/models/RepoUtils.ts:121](https://github.com/rapidrest/service-core/blob/
|
|
135
|
+
Defined in: [src/models/RepoUtils.ts:121](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/RepoUtils.ts#L121)
|
|
136
136
|
|
|
137
137
|
## Accessors
|
|
138
138
|
|
|
@@ -142,7 +142,7 @@ Defined in: [src/models/RepoUtils.ts:121](https://github.com/rapidrest/service-c
|
|
|
142
142
|
|
|
143
143
|
> **get** **baseCacheKey**(): `string`
|
|
144
144
|
|
|
145
|
-
Defined in: [src/models/RepoUtils.ts:195](https://github.com/rapidrest/service-core/blob/
|
|
145
|
+
Defined in: [src/models/RepoUtils.ts:195](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/RepoUtils.ts#L195)
|
|
146
146
|
|
|
147
147
|
The base key used to get or set data in the cache.
|
|
148
148
|
|
|
@@ -156,7 +156,7 @@ The base key used to get or set data in the cache.
|
|
|
156
156
|
|
|
157
157
|
> **count**(`query`, `options?`): `Promise`\<`number`\>
|
|
158
158
|
|
|
159
|
-
Defined in: [src/models/RepoUtils.ts:199](https://github.com/rapidrest/service-core/blob/
|
|
159
|
+
Defined in: [src/models/RepoUtils.ts:199](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/RepoUtils.ts#L199)
|
|
160
160
|
|
|
161
161
|
#### Parameters
|
|
162
162
|
|
|
@@ -178,7 +178,7 @@ Defined in: [src/models/RepoUtils.ts:199](https://github.com/rapidrest/service-c
|
|
|
178
178
|
|
|
179
179
|
> **create**(`obj`, `options?`): `Promise`\<`T`\>
|
|
180
180
|
|
|
181
|
-
Defined in: [src/models/RepoUtils.ts:231](https://github.com/rapidrest/service-core/blob/
|
|
181
|
+
Defined in: [src/models/RepoUtils.ts:231](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/RepoUtils.ts#L231)
|
|
182
182
|
|
|
183
183
|
Stores a new record of the provided object in the datastore. Performs pre-processing, permission checks against
|
|
184
184
|
the class ACL, cache seeding, telemetry recording and push notifications.
|
|
@@ -205,7 +205,7 @@ The object to store.
|
|
|
205
205
|
|
|
206
206
|
> **delete**(`uid`, `options`): `Promise`\<`void`\>
|
|
207
207
|
|
|
208
|
-
Defined in: [src/models/RepoUtils.ts:324](https://github.com/rapidrest/service-core/blob/
|
|
208
|
+
Defined in: [src/models/RepoUtils.ts:324](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/RepoUtils.ts#L324)
|
|
209
209
|
|
|
210
210
|
#### Parameters
|
|
211
211
|
|
|
@@ -227,7 +227,7 @@ Defined in: [src/models/RepoUtils.ts:324](https://github.com/rapidrest/service-c
|
|
|
227
227
|
|
|
228
228
|
> **find**(`query`, `options?`): `Promise`\<`T`[]\>
|
|
229
229
|
|
|
230
|
-
Defined in: [src/models/RepoUtils.ts:395](https://github.com/rapidrest/service-core/blob/
|
|
230
|
+
Defined in: [src/models/RepoUtils.ts:395](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/RepoUtils.ts#L395)
|
|
231
231
|
|
|
232
232
|
Retrieves an array of objects from the datastore matching the given search query. This function will first
|
|
233
233
|
attempt to look up the results in the cache. Also checks ACLs for READ permission.
|
|
@@ -256,7 +256,7 @@ The additional options to consider during the search.
|
|
|
256
256
|
|
|
257
257
|
> **findOne**(`id`, `options?`): `Promise`\<`T` \| `undefined`\>
|
|
258
258
|
|
|
259
|
-
Defined in: [src/models/RepoUtils.ts:474](https://github.com/rapidrest/service-core/blob/
|
|
259
|
+
Defined in: [src/models/RepoUtils.ts:474](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/RepoUtils.ts#L474)
|
|
260
260
|
|
|
261
261
|
Retrieves the object with the given id from either the cache or the database. If retrieving from the database
|
|
262
262
|
the cache is populated to speed up subsequent requests.
|
|
@@ -285,7 +285,7 @@ The additional options to consider during the search.
|
|
|
285
285
|
|
|
286
286
|
> **getClassType**(`obj`): `any`
|
|
287
287
|
|
|
288
|
-
Defined in: [src/models/RepoUtils.ts:560](https://github.com/rapidrest/service-core/blob/
|
|
288
|
+
Defined in: [src/models/RepoUtils.ts:560](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/RepoUtils.ts#L560)
|
|
289
289
|
|
|
290
290
|
Returns the class type (constructor) for the given object. This uses the `_fqn` or `_type` property of `obj` to
|
|
291
291
|
identify the class. If neither property is defined `modelClass` is assumed.
|
|
@@ -310,7 +310,7 @@ The class type (constructor) associated with the given object.
|
|
|
310
310
|
|
|
311
311
|
> **getDefaultACL**(): [`AccessControlList`](../interfaces/AccessControlList.md) \| `undefined`
|
|
312
312
|
|
|
313
|
-
Defined in: [src/models/RepoUtils.ts:529](https://github.com/rapidrest/service-core/blob/
|
|
313
|
+
Defined in: [src/models/RepoUtils.ts:529](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/RepoUtils.ts#L529)
|
|
314
314
|
|
|
315
315
|
Returns the default access control list governing the model type. Returning a value of `undefined` will grant
|
|
316
316
|
full acccess to any user (including unauthenticated anonymous users).
|
|
@@ -325,7 +325,7 @@ full acccess to any user (including unauthenticated anonymous users).
|
|
|
325
325
|
|
|
326
326
|
> **hashQuery**(`query`): `string`
|
|
327
327
|
|
|
328
|
-
Defined in: [src/models/RepoUtils.ts:548](https://github.com/rapidrest/service-core/blob/
|
|
328
|
+
Defined in: [src/models/RepoUtils.ts:548](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/RepoUtils.ts#L548)
|
|
329
329
|
|
|
330
330
|
Hashes the given query object to a unique string.
|
|
331
331
|
|
|
@@ -347,7 +347,7 @@ The query object to hash.
|
|
|
347
347
|
|
|
348
348
|
> `protected` **init**(): `Promise`\<`void`\>
|
|
349
349
|
|
|
350
|
-
Defined in: [src/models/RepoUtils.ts:129](https://github.com/rapidrest/service-core/blob/
|
|
350
|
+
Defined in: [src/models/RepoUtils.ts:129](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/RepoUtils.ts#L129)
|
|
351
351
|
|
|
352
352
|
#### Returns
|
|
353
353
|
|
|
@@ -359,7 +359,7 @@ Defined in: [src/models/RepoUtils.ts:129](https://github.com/rapidrest/service-c
|
|
|
359
359
|
|
|
360
360
|
> **instantiateObject**(`obj`, `clazz?`): `T`
|
|
361
361
|
|
|
362
|
-
Defined in: [src/models/RepoUtils.ts:577](https://github.com/rapidrest/service-core/blob/
|
|
362
|
+
Defined in: [src/models/RepoUtils.ts:577](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/RepoUtils.ts#L577)
|
|
363
363
|
|
|
364
364
|
Creates a new instance of obj scoped to the correct model class or sub-class.
|
|
365
365
|
|
|
@@ -383,7 +383,7 @@ Creates a new instance of obj scoped to the correct model class or sub-class.
|
|
|
383
383
|
|
|
384
384
|
> **searchIdQuery**(`id`, `version?`, `productUid?`): `any`
|
|
385
385
|
|
|
386
|
-
Defined in: [src/models/RepoUtils.ts:594](https://github.com/rapidrest/service-core/blob/
|
|
386
|
+
Defined in: [src/models/RepoUtils.ts:594](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/RepoUtils.ts#L594)
|
|
387
387
|
|
|
388
388
|
Search for existing object based on passed in id and version and product uid.
|
|
389
389
|
|
|
@@ -413,7 +413,7 @@ The result of this function is compatible with all `Repository.find()` functions
|
|
|
413
413
|
|
|
414
414
|
> **truncate**(`query`, `options`): `Promise`\<`void`\>
|
|
415
415
|
|
|
416
|
-
Defined in: [src/models/RepoUtils.ts:604](https://github.com/rapidrest/service-core/blob/
|
|
416
|
+
Defined in: [src/models/RepoUtils.ts:604](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/RepoUtils.ts#L604)
|
|
417
417
|
|
|
418
418
|
#### Parameters
|
|
419
419
|
|
|
@@ -435,7 +435,7 @@ Defined in: [src/models/RepoUtils.ts:604](https://github.com/rapidrest/service-c
|
|
|
435
435
|
|
|
436
436
|
> **update**(`obj`, `existing`, `options?`): `Promise`\<`T`\>
|
|
437
437
|
|
|
438
|
-
Defined in: [src/models/RepoUtils.ts:673](https://github.com/rapidrest/service-core/blob/
|
|
438
|
+
Defined in: [src/models/RepoUtils.ts:673](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/RepoUtils.ts#L673)
|
|
439
439
|
|
|
440
440
|
#### Parameters
|
|
441
441
|
|
|
@@ -461,7 +461,7 @@ Defined in: [src/models/RepoUtils.ts:673](https://github.com/rapidrest/service-c
|
|
|
461
461
|
|
|
462
462
|
> **validate**(`objs`, `options?`): `Promise`\<`void`\>
|
|
463
463
|
|
|
464
|
-
Defined in: [src/models/RepoUtils.ts:840](https://github.com/rapidrest/service-core/blob/
|
|
464
|
+
Defined in: [src/models/RepoUtils.ts:840](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/RepoUtils.ts#L840)
|
|
465
465
|
|
|
466
466
|
Performs validation on the object(s) provided. This function first calls `ObjectUtils.validate()` to check
|
|
467
467
|
any class level defined validation functions. Second, it scans for any properties with the `@Reference`
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: RouteUtils
|
|
8
8
|
|
|
9
|
-
Defined in: [src/routes/RouteUtils.ts:22](https://github.com/rapidrest/service-core/blob/
|
|
9
|
+
Defined in: [src/routes/RouteUtils.ts:22](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/routes/RouteUtils.ts#L22)
|
|
10
10
|
|
|
11
11
|
Provides a set of utilities for converting Route classes to HTTP middleware.
|
|
12
12
|
|
|
@@ -28,11 +28,11 @@ Jean-Philippe Steinmetz <rapidrests@gmail.com>
|
|
|
28
28
|
|
|
29
29
|
### checkRequiredPerms()
|
|
30
30
|
|
|
31
|
-
> **checkRequiredPerms**(`aclUid`): `RequestHandler`
|
|
31
|
+
> **checkRequiredPerms**(`aclUid`): [`RequestHandler`](../type-aliases/RequestHandler.md)
|
|
32
32
|
|
|
33
|
-
Defined in: [src/routes/RouteUtils.ts:39](https://github.com/rapidrest/service-core/blob/
|
|
33
|
+
Defined in: [src/routes/RouteUtils.ts:39](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/routes/RouteUtils.ts#L39)
|
|
34
34
|
|
|
35
|
-
Creates a middleware function that verifies the incoming request is from a valid user with at least
|
|
35
|
+
Creates a middleware function that verifies the incoming request is from a valid user with at least
|
|
36
36
|
one of the specified roles.
|
|
37
37
|
|
|
38
38
|
#### Parameters
|
|
@@ -43,17 +43,17 @@ one of the specified roles.
|
|
|
43
43
|
|
|
44
44
|
#### Returns
|
|
45
45
|
|
|
46
|
-
`RequestHandler`
|
|
46
|
+
[`RequestHandler`](../type-aliases/RequestHandler.md)
|
|
47
47
|
|
|
48
48
|
***
|
|
49
49
|
|
|
50
50
|
### checkRequiredRoles()
|
|
51
51
|
|
|
52
|
-
> **checkRequiredRoles**(`requiredRoles`): `RequestHandler`
|
|
52
|
+
> **checkRequiredRoles**(`requiredRoles`): [`RequestHandler`](../type-aliases/RequestHandler.md)
|
|
53
53
|
|
|
54
|
-
Defined in: [src/routes/RouteUtils.ts:62](https://github.com/rapidrest/service-core/blob/
|
|
54
|
+
Defined in: [src/routes/RouteUtils.ts:62](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/routes/RouteUtils.ts#L62)
|
|
55
55
|
|
|
56
|
-
Creates a middleware function that verifies the incoming request is from a valid user with at least
|
|
56
|
+
Creates a middleware function that verifies the incoming request is from a valid user with at least
|
|
57
57
|
one of the specified roles.
|
|
58
58
|
|
|
59
59
|
#### Parameters
|
|
@@ -66,15 +66,15 @@ The list of roles that the authenticated user must have.
|
|
|
66
66
|
|
|
67
67
|
#### Returns
|
|
68
68
|
|
|
69
|
-
`RequestHandler`
|
|
69
|
+
[`RequestHandler`](../type-aliases/RequestHandler.md)
|
|
70
70
|
|
|
71
71
|
***
|
|
72
72
|
|
|
73
73
|
### getFuncArray()
|
|
74
74
|
|
|
75
|
-
> **getFuncArray**(`route`, `funcs`, `send?`): `RequestHandler`[]
|
|
75
|
+
> **getFuncArray**(`route`, `funcs`, `send?`): [`RequestHandler`](../type-aliases/RequestHandler.md)[]
|
|
76
76
|
|
|
77
|
-
Defined in: [src/routes/RouteUtils.ts:87](https://github.com/rapidrest/service-core/blob/
|
|
77
|
+
Defined in: [src/routes/RouteUtils.ts:87](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/routes/RouteUtils.ts#L87)
|
|
78
78
|
|
|
79
79
|
Converts the given array of string or Function objects to functions bound to the given route object.
|
|
80
80
|
|
|
@@ -100,7 +100,7 @@ Set to true to have the last wrapped function send its payload to the client.
|
|
|
100
100
|
|
|
101
101
|
#### Returns
|
|
102
102
|
|
|
103
|
-
`RequestHandler`[]
|
|
103
|
+
[`RequestHandler`](../type-aliases/RequestHandler.md)[]
|
|
104
104
|
|
|
105
105
|
An array of Function objects mapping to the route object.
|
|
106
106
|
|
|
@@ -110,7 +110,7 @@ An array of Function objects mapping to the route object.
|
|
|
110
110
|
|
|
111
111
|
> **getRouteMethods**(`route`): `Map`\<`string`, `any`\>
|
|
112
112
|
|
|
113
|
-
Defined in: [src/routes/RouteUtils.ts:110](https://github.com/rapidrest/service-core/blob/
|
|
113
|
+
Defined in: [src/routes/RouteUtils.ts:110](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/routes/RouteUtils.ts#L110)
|
|
114
114
|
|
|
115
115
|
Searches an route object for any functions that implement a `@Method` decorator.
|
|
116
116
|
|
|
@@ -134,7 +134,7 @@ The list of `@Method` decorated functions that were found.
|
|
|
134
134
|
|
|
135
135
|
> **registerRoute**(`app`, `route`): `Promise`\<`void`\>
|
|
136
136
|
|
|
137
|
-
Defined in: [src/routes/RouteUtils.ts:139](https://github.com/rapidrest/service-core/blob/
|
|
137
|
+
Defined in: [src/routes/RouteUtils.ts:139](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/routes/RouteUtils.ts#L139)
|
|
138
138
|
|
|
139
139
|
Registers the provided route object containing a set of decorated endpoints to the server.
|
|
140
140
|
|
|
@@ -160,9 +160,9 @@ The route object to register.
|
|
|
160
160
|
|
|
161
161
|
### wrapMiddleware()
|
|
162
162
|
|
|
163
|
-
> **wrapMiddleware**(`obj`, `func`, `send?`): `RequestHandler`
|
|
163
|
+
> **wrapMiddleware**(`obj`, `func`, `send?`): [`RequestHandler`](../type-aliases/RequestHandler.md)
|
|
164
164
|
|
|
165
|
-
Defined in: [src/routes/RouteUtils.ts:
|
|
165
|
+
Defined in: [src/routes/RouteUtils.ts:315](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/routes/RouteUtils.ts#L315)
|
|
166
166
|
|
|
167
167
|
Wraps the provided function with HTTP handling based on the function's defined decorators.
|
|
168
168
|
|
|
@@ -188,4 +188,4 @@ Set to true to have `func`'s result sent to the client.
|
|
|
188
188
|
|
|
189
189
|
#### Returns
|
|
190
190
|
|
|
191
|
-
`RequestHandler`
|
|
191
|
+
[`RequestHandler`](../type-aliases/RequestHandler.md)
|