@rapidrest/service-core 1.0.0-beta.1 → 1.0.0-beta.3
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/OpenApiSpec.js +1 -1
- package/dist/lib/OpenApiSpec.js.map +1 -1
- 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/models/ModelUtils.js +1 -1
- package/dist/lib/models/ModelUtils.js.map +1 -1
- package/dist/lib/routes/MetricsRoute.js +1 -1
- package/dist/lib/routes/MetricsRoute.js.map +1 -1
- package/dist/lib/routes/RouteUtils.js +9 -8
- 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 +4 -4
- package/docs/reference/classes/ModelRoute.md +28 -28
- package/docs/reference/classes/ModelUtils.md +50 -50
- 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 +4 -4
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: MongoRepository\<T\>
|
|
8
8
|
|
|
9
|
-
Defined in: [src/database/MongoRepository.ts:22](https://github.com/rapidrest/service-core/blob/
|
|
9
|
+
Defined in: [src/database/MongoRepository.ts:22](https://github.com/rapidrest/service-core/blob/ab54834688bebfbea1d8258c626822205861b919/src/database/MongoRepository.ts#L22)
|
|
10
10
|
|
|
11
11
|
Provides a lightweight repository for performing common operations against a single MongoDB collection using the
|
|
12
12
|
native `mongodb` driver. Instances of this class are obtained via `MongoConnection.getRepository`.
|
|
@@ -30,7 +30,7 @@ Jean-Philippe Steinmetz <rapidrests@gmail.com>
|
|
|
30
30
|
|
|
31
31
|
> **new MongoRepository**\<`T`\>(`db`, `collection`, `modelClass?`): `MongoRepository`\<`T`\>
|
|
32
32
|
|
|
33
|
-
Defined in: [src/database/MongoRepository.ts:30](https://github.com/rapidrest/service-core/blob/
|
|
33
|
+
Defined in: [src/database/MongoRepository.ts:30](https://github.com/rapidrest/service-core/blob/ab54834688bebfbea1d8258c626822205861b919/src/database/MongoRepository.ts#L30)
|
|
34
34
|
|
|
35
35
|
#### Parameters
|
|
36
36
|
|
|
@@ -56,7 +56,7 @@ Defined in: [src/database/MongoRepository.ts:30](https://github.com/rapidrest/se
|
|
|
56
56
|
|
|
57
57
|
> `readonly` **collection**: `Collection`\<`T`\>
|
|
58
58
|
|
|
59
|
-
Defined in: [src/database/MongoRepository.ts:26](https://github.com/rapidrest/service-core/blob/
|
|
59
|
+
Defined in: [src/database/MongoRepository.ts:26](https://github.com/rapidrest/service-core/blob/ab54834688bebfbea1d8258c626822205861b919/src/database/MongoRepository.ts#L26)
|
|
60
60
|
|
|
61
61
|
The underlying MongoDB collection that operations are performed against.
|
|
62
62
|
|
|
@@ -66,7 +66,7 @@ The underlying MongoDB collection that operations are performed against.
|
|
|
66
66
|
|
|
67
67
|
> `readonly` **db**: `Db`
|
|
68
68
|
|
|
69
|
-
Defined in: [src/database/MongoRepository.ts:24](https://github.com/rapidrest/service-core/blob/
|
|
69
|
+
Defined in: [src/database/MongoRepository.ts:24](https://github.com/rapidrest/service-core/blob/ab54834688bebfbea1d8258c626822205861b919/src/database/MongoRepository.ts#L24)
|
|
70
70
|
|
|
71
71
|
The database that the underlying collection belongs to.
|
|
72
72
|
|
|
@@ -76,7 +76,7 @@ The database that the underlying collection belongs to.
|
|
|
76
76
|
|
|
77
77
|
> `readonly` **modelClass**: `any`
|
|
78
78
|
|
|
79
|
-
Defined in: [src/database/MongoRepository.ts:28](https://github.com/rapidrest/service-core/blob/
|
|
79
|
+
Defined in: [src/database/MongoRepository.ts:28](https://github.com/rapidrest/service-core/blob/ab54834688bebfbea1d8258c626822205861b919/src/database/MongoRepository.ts#L28)
|
|
80
80
|
|
|
81
81
|
The model class associated with this repository.
|
|
82
82
|
|
|
@@ -88,7 +88,7 @@ The model class associated with this repository.
|
|
|
88
88
|
|
|
89
89
|
> **get** **collectionName**(): `string`
|
|
90
90
|
|
|
91
|
-
Defined in: [src/database/MongoRepository.ts:37](https://github.com/rapidrest/service-core/blob/
|
|
91
|
+
Defined in: [src/database/MongoRepository.ts:37](https://github.com/rapidrest/service-core/blob/ab54834688bebfbea1d8258c626822205861b919/src/database/MongoRepository.ts#L37)
|
|
92
92
|
|
|
93
93
|
The name of the underlying MongoDB collection.
|
|
94
94
|
|
|
@@ -102,7 +102,7 @@ The name of the underlying MongoDB collection.
|
|
|
102
102
|
|
|
103
103
|
> **aggregate**(`pipeline`): `AggregationCursor`\<`any`\>
|
|
104
104
|
|
|
105
|
-
Defined in: [src/database/MongoRepository.ts:46](https://github.com/rapidrest/service-core/blob/
|
|
105
|
+
Defined in: [src/database/MongoRepository.ts:46](https://github.com/rapidrest/service-core/blob/ab54834688bebfbea1d8258c626822205861b919/src/database/MongoRepository.ts#L46)
|
|
106
106
|
|
|
107
107
|
Executes the given aggregation pipeline against the collection and returns the resulting cursor.
|
|
108
108
|
|
|
@@ -124,7 +124,7 @@ The aggregation pipeline stages to execute.
|
|
|
124
124
|
|
|
125
125
|
> **clear**(): `Promise`\<`void`\>
|
|
126
126
|
|
|
127
|
-
Defined in: [src/database/MongoRepository.ts:54](https://github.com/rapidrest/service-core/blob/
|
|
127
|
+
Defined in: [src/database/MongoRepository.ts:54](https://github.com/rapidrest/service-core/blob/ab54834688bebfbea1d8258c626822205861b919/src/database/MongoRepository.ts#L54)
|
|
128
128
|
|
|
129
129
|
Drops the entire collection from the database, removing all documents and indexes. Does nothing if the
|
|
130
130
|
collection does not exist.
|
|
@@ -139,7 +139,7 @@ collection does not exist.
|
|
|
139
139
|
|
|
140
140
|
> **count**(`filter?`): `Promise`\<`number`\>
|
|
141
141
|
|
|
142
|
-
Defined in: [src/database/MongoRepository.ts:70](https://github.com/rapidrest/service-core/blob/
|
|
142
|
+
Defined in: [src/database/MongoRepository.ts:70](https://github.com/rapidrest/service-core/blob/ab54834688bebfbea1d8258c626822205861b919/src/database/MongoRepository.ts#L70)
|
|
143
143
|
|
|
144
144
|
Returns the number of documents matching the given filter.
|
|
145
145
|
|
|
@@ -161,7 +161,7 @@ The query filter to match documents against.
|
|
|
161
161
|
|
|
162
162
|
> **deleteMany**(`filter`): `Promise`\<`DeleteResult`\>
|
|
163
163
|
|
|
164
|
-
Defined in: [src/database/MongoRepository.ts:79](https://github.com/rapidrest/service-core/blob/
|
|
164
|
+
Defined in: [src/database/MongoRepository.ts:79](https://github.com/rapidrest/service-core/blob/ab54834688bebfbea1d8258c626822205861b919/src/database/MongoRepository.ts#L79)
|
|
165
165
|
|
|
166
166
|
Deletes all documents matching the given filter.
|
|
167
167
|
|
|
@@ -183,7 +183,7 @@ The query filter to match documents against.
|
|
|
183
183
|
|
|
184
184
|
> **deleteOne**(`filter`): `Promise`\<`DeleteResult`\>
|
|
185
185
|
|
|
186
|
-
Defined in: [src/database/MongoRepository.ts:88](https://github.com/rapidrest/service-core/blob/
|
|
186
|
+
Defined in: [src/database/MongoRepository.ts:88](https://github.com/rapidrest/service-core/blob/ab54834688bebfbea1d8258c626822205861b919/src/database/MongoRepository.ts#L88)
|
|
187
187
|
|
|
188
188
|
Deletes the first document matching the given filter.
|
|
189
189
|
|
|
@@ -205,7 +205,7 @@ The query filter to match documents against.
|
|
|
205
205
|
|
|
206
206
|
> **distinct**(`field`, `filter?`): `Promise`\<`any`[]\>
|
|
207
207
|
|
|
208
|
-
Defined in: [src/database/MongoRepository.ts:98](https://github.com/rapidrest/service-core/blob/
|
|
208
|
+
Defined in: [src/database/MongoRepository.ts:98](https://github.com/rapidrest/service-core/blob/ab54834688bebfbea1d8258c626822205861b919/src/database/MongoRepository.ts#L98)
|
|
209
209
|
|
|
210
210
|
Returns the list of distinct values of the given field for all documents matching the given filter.
|
|
211
211
|
|
|
@@ -233,7 +233,7 @@ The query filter to match documents against.
|
|
|
233
233
|
|
|
234
234
|
> **find**(`filter?`): `Promise`\<`any`[]\>
|
|
235
235
|
|
|
236
|
-
Defined in: [src/database/MongoRepository.ts:107](https://github.com/rapidrest/service-core/blob/
|
|
236
|
+
Defined in: [src/database/MongoRepository.ts:107](https://github.com/rapidrest/service-core/blob/ab54834688bebfbea1d8258c626822205861b919/src/database/MongoRepository.ts#L107)
|
|
237
237
|
|
|
238
238
|
Returns all documents matching the given filter.
|
|
239
239
|
|
|
@@ -255,7 +255,7 @@ The query filter to match documents against.
|
|
|
255
255
|
|
|
256
256
|
> **findOne**(`filter`): `Promise`\<`any`\>
|
|
257
257
|
|
|
258
|
-
Defined in: [src/database/MongoRepository.ts:116](https://github.com/rapidrest/service-core/blob/
|
|
258
|
+
Defined in: [src/database/MongoRepository.ts:116](https://github.com/rapidrest/service-core/blob/ab54834688bebfbea1d8258c626822205861b919/src/database/MongoRepository.ts#L116)
|
|
259
259
|
|
|
260
260
|
Returns the first document matching the given filter.
|
|
261
261
|
|
|
@@ -277,7 +277,7 @@ The query filter to match documents against.
|
|
|
277
277
|
|
|
278
278
|
> **save**(`doc`): `Promise`\<`any`\>
|
|
279
279
|
|
|
280
|
-
Defined in: [src/database/MongoRepository.ts:128](https://github.com/rapidrest/service-core/blob/
|
|
280
|
+
Defined in: [src/database/MongoRepository.ts:128](https://github.com/rapidrest/service-core/blob/ab54834688bebfbea1d8258c626822205861b919/src/database/MongoRepository.ts#L128)
|
|
281
281
|
|
|
282
282
|
Saves the given document to the collection. If the document has an existing `_id` the stored document is
|
|
283
283
|
replaced (inserting if missing), otherwise the document is inserted and its newly assigned `_id` is set on
|
|
@@ -303,7 +303,7 @@ The saved document.
|
|
|
303
303
|
|
|
304
304
|
> **updateMany**(`filter`, `update`): `Promise`\<`UpdateResult`\<`Document`\>\>
|
|
305
305
|
|
|
306
|
-
Defined in: [src/database/MongoRepository.ts:153](https://github.com/rapidrest/service-core/blob/
|
|
306
|
+
Defined in: [src/database/MongoRepository.ts:153](https://github.com/rapidrest/service-core/blob/ab54834688bebfbea1d8258c626822205861b919/src/database/MongoRepository.ts#L153)
|
|
307
307
|
|
|
308
308
|
Updates all documents matching the given filter with the provided update operations.
|
|
309
309
|
|
|
@@ -331,7 +331,7 @@ The update operations (e.g. `$set`) to apply.
|
|
|
331
331
|
|
|
332
332
|
> **updateOne**(`filter`, `update`): `Promise`\<`UpdateResult`\<`Document`\>\>
|
|
333
333
|
|
|
334
|
-
Defined in: [src/database/MongoRepository.ts:163](https://github.com/rapidrest/service-core/blob/
|
|
334
|
+
Defined in: [src/database/MongoRepository.ts:163](https://github.com/rapidrest/service-core/blob/ab54834688bebfbea1d8258c626822205861b919/src/database/MongoRepository.ts#L163)
|
|
335
335
|
|
|
336
336
|
Updates the first document matching the given filter with the provided update operations.
|
|
337
337
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: MongoSchemaSync
|
|
8
8
|
|
|
9
|
-
Defined in: [src/database/MongoSchemaSync.ts:33](https://github.com/rapidrest/service-core/blob/
|
|
9
|
+
Defined in: [src/database/MongoSchemaSync.ts:33](https://github.com/rapidrest/service-core/blob/ab54834688bebfbea1d8258c626822205861b919/src/database/MongoSchemaSync.ts#L33)
|
|
10
10
|
|
|
11
11
|
Performs structure synchronization of MongoDB collections based on the persistence metadata of model classes.
|
|
12
12
|
|
|
@@ -28,7 +28,7 @@ Jean-Philippe Steinmetz <rapidrests@gmail.com>
|
|
|
28
28
|
|
|
29
29
|
> **new MongoSchemaSync**(`db`, `logger?`): `MongoSchemaSync`
|
|
30
30
|
|
|
31
|
-
Defined in: [src/database/MongoSchemaSync.ts:37](https://github.com/rapidrest/service-core/blob/
|
|
31
|
+
Defined in: [src/database/MongoSchemaSync.ts:37](https://github.com/rapidrest/service-core/blob/ab54834688bebfbea1d8258c626822205861b919/src/database/MongoSchemaSync.ts#L37)
|
|
32
32
|
|
|
33
33
|
#### Parameters
|
|
34
34
|
|
|
@@ -50,7 +50,7 @@ Defined in: [src/database/MongoSchemaSync.ts:37](https://github.com/rapidrest/se
|
|
|
50
50
|
|
|
51
51
|
> **synchronize**(`entities`): `Promise`\<`void`\>
|
|
52
52
|
|
|
53
|
-
Defined in: [src/database/MongoSchemaSync.ts:47](https://github.com/rapidrest/service-core/blob/
|
|
53
|
+
Defined in: [src/database/MongoSchemaSync.ts:47](https://github.com/rapidrest/service-core/blob/ab54834688bebfbea1d8258c626822205861b919/src/database/MongoSchemaSync.ts#L47)
|
|
54
54
|
|
|
55
55
|
Synchronizes the structure of all collections associated with the given model classes.
|
|
56
56
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: NetUtils
|
|
8
8
|
|
|
9
|
-
Defined in: [src/NetUtils.ts:12](https://github.com/rapidrest/service-core/blob/
|
|
9
|
+
Defined in: [src/NetUtils.ts:12](https://github.com/rapidrest/service-core/blob/ab54834688bebfbea1d8258c626822205861b919/src/NetUtils.ts#L12)
|
|
10
10
|
|
|
11
11
|
Provides common utilities and functions for working with networking related problems.
|
|
12
12
|
|
|
@@ -30,7 +30,7 @@ Jean-Philippe Steinmetz <rapidrests@gmail.com>
|
|
|
30
30
|
|
|
31
31
|
> `static` **getIPAddress**(`urlOrRequest`, `trustedProxies?`): `string` \| `undefined`
|
|
32
32
|
|
|
33
|
-
Defined in: [src/NetUtils.ts:57](https://github.com/rapidrest/service-core/blob/
|
|
33
|
+
Defined in: [src/NetUtils.ts:57](https://github.com/rapidrest/service-core/blob/ab54834688bebfbea1d8258c626822205861b919/src/NetUtils.ts#L57)
|
|
34
34
|
|
|
35
35
|
Extracts the IP address from a given url or HTTP request.
|
|
36
36
|
|
|
@@ -43,7 +43,7 @@ preventing clients from spoofing their IP in audit logs.
|
|
|
43
43
|
|
|
44
44
|
##### urlOrRequest
|
|
45
45
|
|
|
46
|
-
`string` \| `HttpRequest`
|
|
46
|
+
`string` \| [`HttpRequest`](../interfaces/HttpRequest.md)
|
|
47
47
|
|
|
48
48
|
The url or HTTP request to extract the IP from.
|
|
49
49
|
|
|
@@ -65,7 +65,7 @@ A `string` containing the IP address if found, otherwise `undefined`.
|
|
|
65
65
|
|
|
66
66
|
> `static` **lookupIPAddress**(`url`, `family?`): `Promise`\<`string` \| `undefined`\>
|
|
67
67
|
|
|
68
|
-
Defined in: [src/NetUtils.ts:20](https://github.com/rapidrest/service-core/blob/
|
|
68
|
+
Defined in: [src/NetUtils.ts:20](https://github.com/rapidrest/service-core/blob/ab54834688bebfbea1d8258c626822205861b919/src/NetUtils.ts#L20)
|
|
69
69
|
|
|
70
70
|
Performs DNS lookup of the IP address from a given url.
|
|
71
71
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: NotificationUtils
|
|
8
8
|
|
|
9
|
-
Defined in: [src/NotificationUtils.ts:11](https://github.com/rapidrest/service-core/blob/
|
|
9
|
+
Defined in: [src/NotificationUtils.ts:11](https://github.com/rapidrest/service-core/blob/ab54834688bebfbea1d8258c626822205861b919/src/NotificationUtils.ts#L11)
|
|
10
10
|
|
|
11
11
|
Utility functions for sending push notifications to registered clients.
|
|
12
12
|
|
|
@@ -20,7 +20,7 @@ Jean-Philippe Steinmetz
|
|
|
20
20
|
|
|
21
21
|
> **new NotificationUtils**(`redis`): `NotificationUtils`
|
|
22
22
|
|
|
23
|
-
Defined in: [src/NotificationUtils.ts:20](https://github.com/rapidrest/service-core/blob/
|
|
23
|
+
Defined in: [src/NotificationUtils.ts:20](https://github.com/rapidrest/service-core/blob/ab54834688bebfbea1d8258c626822205861b919/src/NotificationUtils.ts#L20)
|
|
24
24
|
|
|
25
25
|
Initializes the utility using the given redis connection.
|
|
26
26
|
|
|
@@ -42,7 +42,7 @@ The redis connection to publish to.
|
|
|
42
42
|
|
|
43
43
|
> **sendMessage**(`uids`, `type`, `action`, `data`): `void`
|
|
44
44
|
|
|
45
|
-
Defined in: [src/NotificationUtils.ts:32](https://github.com/rapidrest/service-core/blob/
|
|
45
|
+
Defined in: [src/NotificationUtils.ts:32](https://github.com/rapidrest/service-core/blob/ab54834688bebfbea1d8258c626822205861b919/src/NotificationUtils.ts#L32)
|
|
46
46
|
|
|
47
47
|
Sends a given message to the room or user with the specified uid(s).
|
|
48
48
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: ObjectFactory
|
|
8
8
|
|
|
9
|
-
Defined in: [src/ObjectFactory.ts:21](https://github.com/rapidrest/service-core/blob/
|
|
9
|
+
Defined in: [src/ObjectFactory.ts:21](https://github.com/rapidrest/service-core/blob/ab54834688bebfbea1d8258c626822205861b919/src/ObjectFactory.ts#L21)
|
|
10
10
|
|
|
11
11
|
The `ObjectFactory` is a manager for creating objects based on registered
|
|
12
12
|
class types. This allows for the tracking of multiple instances of objects
|
|
@@ -26,7 +26,7 @@ Jean-Philippe Steinmetz
|
|
|
26
26
|
|
|
27
27
|
> **new ObjectFactory**(`config?`, `logger?`): `ObjectFactory`
|
|
28
28
|
|
|
29
|
-
Defined in: [src/ObjectFactory.ts:22](https://github.com/rapidrest/service-core/blob/
|
|
29
|
+
Defined in: [src/ObjectFactory.ts:22](https://github.com/rapidrest/service-core/blob/ab54834688bebfbea1d8258c626822205861b919/src/ObjectFactory.ts#L22)
|
|
30
30
|
|
|
31
31
|
#### Parameters
|
|
32
32
|
|
|
@@ -108,7 +108,7 @@ The application logging utility.
|
|
|
108
108
|
|
|
109
109
|
> **clear**(): `void`
|
|
110
110
|
|
|
111
|
-
Defined in: node\_modules/@rapidrest/core/dist/types/ObjectFactory.d.ts:
|
|
111
|
+
Defined in: node\_modules/@rapidrest/core/dist/types/ObjectFactory.d.ts:43
|
|
112
112
|
|
|
113
113
|
Deletes all instantiated objects.
|
|
114
114
|
|
|
@@ -126,7 +126,7 @@ Deletes all instantiated objects.
|
|
|
126
126
|
|
|
127
127
|
> **clearAll**(): `void`
|
|
128
128
|
|
|
129
|
-
Defined in: node\_modules/@rapidrest/core/dist/types/ObjectFactory.d.ts:
|
|
129
|
+
Defined in: node\_modules/@rapidrest/core/dist/types/ObjectFactory.d.ts:47
|
|
130
130
|
|
|
131
131
|
Deletes all instantiated objects and registered class types.
|
|
132
132
|
|
|
@@ -144,7 +144,7 @@ Deletes all instantiated objects and registered class types.
|
|
|
144
144
|
|
|
145
145
|
> **destroy**(`objs?`): `Promise`\<`void`\>
|
|
146
146
|
|
|
147
|
-
Defined in: node\_modules/@rapidrest/core/dist/types/ObjectFactory.d.ts:
|
|
147
|
+
Defined in: node\_modules/@rapidrest/core/dist/types/ObjectFactory.d.ts:39
|
|
148
148
|
|
|
149
149
|
Destroys the specified objects. If `undefined` is passed in, all objects managed by the factory are destroyed.
|
|
150
150
|
|
|
@@ -168,7 +168,7 @@ Destroys the specified objects. If `undefined` is passed in, all objects managed
|
|
|
168
168
|
|
|
169
169
|
> **getInitMethods**(`obj`): `Function`[]
|
|
170
170
|
|
|
171
|
-
Defined in: node\_modules/@rapidrest/core/dist/types/ObjectFactory.d.ts:
|
|
171
|
+
Defined in: node\_modules/@rapidrest/core/dist/types/ObjectFactory.d.ts:59
|
|
172
172
|
|
|
173
173
|
Searches an object for one or more functions that implement a `@Init` decorator.
|
|
174
174
|
|
|
@@ -196,7 +196,7 @@ The list of functions that implements the `@Init` decorator if found, otherwise
|
|
|
196
196
|
|
|
197
197
|
> **getInstance**\<`T`\>(`nameOrType`): `T` \| `undefined`
|
|
198
198
|
|
|
199
|
-
Defined in: node\_modules/@rapidrest/core/dist/types/ObjectFactory.d.ts:
|
|
199
|
+
Defined in: node\_modules/@rapidrest/core/dist/types/ObjectFactory.d.ts:67
|
|
200
200
|
|
|
201
201
|
Returns the object instance with the given unique name. Unique names take the form `<ClassName>:<InstanceName>`.
|
|
202
202
|
It is possible to only specifiy the `<ClassName>`, doing so will automatically look for the `<ClassName>:default`
|
|
@@ -232,7 +232,7 @@ The object instance associated with the given name if found, otherwise `undefine
|
|
|
232
232
|
|
|
233
233
|
> **initialize**\<`T`\>(`obj`): `Promise`\<`T`\>
|
|
234
234
|
|
|
235
|
-
Defined in: [src/ObjectFactory.ts:30](https://github.com/rapidrest/service-core/blob/
|
|
235
|
+
Defined in: [src/ObjectFactory.ts:30](https://github.com/rapidrest/service-core/blob/ab54834688bebfbea1d8258c626822205861b919/src/ObjectFactory.ts#L30)
|
|
236
236
|
|
|
237
237
|
Scans the given object for any properties with the
|
|
238
238
|
|
|
@@ -268,7 +268,7 @@ decorator and assigns the correct values.
|
|
|
268
268
|
|
|
269
269
|
> **newInstance**\<`T`\>(`type`, `options?`): `T` \| `Promise`\<`T`\>
|
|
270
270
|
|
|
271
|
-
Defined in: node\_modules/@rapidrest/core/dist/types/ObjectFactory.d.ts:
|
|
271
|
+
Defined in: node\_modules/@rapidrest/core/dist/types/ObjectFactory.d.ts:77
|
|
272
272
|
|
|
273
273
|
Creates a new instance of the class specified with the provided unique name or type and constructor arguments. If an existing
|
|
274
274
|
object has already been created with the given name, that instance is returned, otherwise a new instance is created
|
|
@@ -309,7 +309,7 @@ The options to use when instantiating the new class object.
|
|
|
309
309
|
|
|
310
310
|
> **register**(`clazz`, `fqn?`): `void`
|
|
311
311
|
|
|
312
|
-
Defined in: node\_modules/@rapidrest/core/dist/types/ObjectFactory.d.ts:
|
|
312
|
+
Defined in: node\_modules/@rapidrest/core/dist/types/ObjectFactory.d.ts:83
|
|
313
313
|
|
|
314
314
|
Registers the given class type for the provided fully qualified name.
|
|
315
315
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: OpenAPIRoute
|
|
8
8
|
|
|
9
|
-
Defined in: [src/routes/OpenAPIRoute.ts:44](https://github.com/rapidrest/service-core/blob/
|
|
9
|
+
Defined in: [src/routes/OpenAPIRoute.ts:44](https://github.com/rapidrest/service-core/blob/ab54834688bebfbea1d8258c626822205861b919/src/routes/OpenAPIRoute.ts#L44)
|
|
10
10
|
|
|
11
11
|
The `OpenAPIRoute` provides default routes to expose the service's OpenAPI specification.
|
|
12
12
|
|
|
@@ -34,7 +34,7 @@ Jean-Philippe Steinmetz
|
|
|
34
34
|
|
|
35
35
|
> **getAPIDocs**(): `string`
|
|
36
36
|
|
|
37
|
-
Defined in: [src/routes/OpenAPIRoute.ts:63](https://github.com/rapidrest/service-core/blob/
|
|
37
|
+
Defined in: [src/routes/OpenAPIRoute.ts:63](https://github.com/rapidrest/service-core/blob/ab54834688bebfbea1d8258c626822205861b919/src/routes/OpenAPIRoute.ts#L63)
|
|
38
38
|
|
|
39
39
|
#### Returns
|
|
40
40
|
|
|
@@ -46,7 +46,7 @@ Defined in: [src/routes/OpenAPIRoute.ts:63](https://github.com/rapidrest/service
|
|
|
46
46
|
|
|
47
47
|
> **getHTML**(): `string`
|
|
48
48
|
|
|
49
|
-
Defined in: [src/routes/OpenAPIRoute.ts:54](https://github.com/rapidrest/service-core/blob/
|
|
49
|
+
Defined in: [src/routes/OpenAPIRoute.ts:54](https://github.com/rapidrest/service-core/blob/ab54834688bebfbea1d8258c626822205861b919/src/routes/OpenAPIRoute.ts#L54)
|
|
50
50
|
|
|
51
51
|
#### Returns
|
|
52
52
|
|
|
@@ -58,7 +58,7 @@ Defined in: [src/routes/OpenAPIRoute.ts:54](https://github.com/rapidrest/service
|
|
|
58
58
|
|
|
59
59
|
> **getJSON**(): `any`
|
|
60
60
|
|
|
61
|
-
Defined in: [src/routes/OpenAPIRoute.ts:71](https://github.com/rapidrest/service-core/blob/
|
|
61
|
+
Defined in: [src/routes/OpenAPIRoute.ts:71](https://github.com/rapidrest/service-core/blob/ab54834688bebfbea1d8258c626822205861b919/src/routes/OpenAPIRoute.ts#L71)
|
|
62
62
|
|
|
63
63
|
#### Returns
|
|
64
64
|
|
|
@@ -70,7 +70,7 @@ Defined in: [src/routes/OpenAPIRoute.ts:71](https://github.com/rapidrest/service
|
|
|
70
70
|
|
|
71
71
|
> **getYAML**(): `string`
|
|
72
72
|
|
|
73
|
-
Defined in: [src/routes/OpenAPIRoute.ts:80](https://github.com/rapidrest/service-core/blob/
|
|
73
|
+
Defined in: [src/routes/OpenAPIRoute.ts:80](https://github.com/rapidrest/service-core/blob/ab54834688bebfbea1d8258c626822205861b919/src/routes/OpenAPIRoute.ts#L80)
|
|
74
74
|
|
|
75
75
|
#### Returns
|
|
76
76
|
|