@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: BackgroundService
|
|
8
8
|
|
|
9
|
-
Defined in: [src/BackgroundService.ts:10](https://github.com/rapidrest/service-core/blob/
|
|
9
|
+
Defined in: [src/BackgroundService.ts:10](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/BackgroundService.ts#L10)
|
|
10
10
|
|
|
11
11
|
The `BackgroundService` is an abstract base class for defining scheduled background services. A background service
|
|
12
12
|
executes in the background once on startup or on a set schedule (like a cron job) and performs additional processing.
|
|
@@ -21,7 +21,7 @@ Jean-Philippe Steinmetz <rapidrests@gmail.com>
|
|
|
21
21
|
|
|
22
22
|
> **new BackgroundService**(`config`, `logger`): `BackgroundService`
|
|
23
23
|
|
|
24
|
-
Defined in: [src/BackgroundService.ts:16](https://github.com/rapidrest/service-core/blob/
|
|
24
|
+
Defined in: [src/BackgroundService.ts:16](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/BackgroundService.ts#L16)
|
|
25
25
|
|
|
26
26
|
#### Parameters
|
|
27
27
|
|
|
@@ -43,7 +43,7 @@ Defined in: [src/BackgroundService.ts:16](https://github.com/rapidrest/service-c
|
|
|
43
43
|
|
|
44
44
|
> `protected` **config**: `any`
|
|
45
45
|
|
|
46
|
-
Defined in: [src/BackgroundService.ts:12](https://github.com/rapidrest/service-core/blob/
|
|
46
|
+
Defined in: [src/BackgroundService.ts:12](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/BackgroundService.ts#L12)
|
|
47
47
|
|
|
48
48
|
The global application configuration that the service can reference.
|
|
49
49
|
|
|
@@ -53,7 +53,7 @@ The global application configuration that the service can reference.
|
|
|
53
53
|
|
|
54
54
|
> `protected` **logger**: `any`
|
|
55
55
|
|
|
56
|
-
Defined in: [src/BackgroundService.ts:14](https://github.com/rapidrest/service-core/blob/
|
|
56
|
+
Defined in: [src/BackgroundService.ts:14](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/BackgroundService.ts#L14)
|
|
57
57
|
|
|
58
58
|
The logging utility to use.
|
|
59
59
|
|
|
@@ -65,7 +65,7 @@ The logging utility to use.
|
|
|
65
65
|
|
|
66
66
|
> **get** `abstract` **schedule**(): `string` \| `undefined`
|
|
67
67
|
|
|
68
|
-
Defined in: [src/BackgroundService.ts:25](https://github.com/rapidrest/service-core/blob/
|
|
68
|
+
Defined in: [src/BackgroundService.ts:25](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/BackgroundService.ts#L25)
|
|
69
69
|
|
|
70
70
|
Returns the desired execution interval that this service should be scheduled with. If `undefined` is returned
|
|
71
71
|
the service is executed only once.
|
|
@@ -80,7 +80,7 @@ the service is executed only once.
|
|
|
80
80
|
|
|
81
81
|
> `abstract` **run**(): `void` \| `Promise`\<`void`\>
|
|
82
82
|
|
|
83
|
-
Defined in: [src/BackgroundService.ts:30](https://github.com/rapidrest/service-core/blob/
|
|
83
|
+
Defined in: [src/BackgroundService.ts:30](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/BackgroundService.ts#L30)
|
|
84
84
|
|
|
85
85
|
The processing function to execute at each scheduled interval.
|
|
86
86
|
|
|
@@ -94,7 +94,7 @@ The processing function to execute at each scheduled interval.
|
|
|
94
94
|
|
|
95
95
|
> `abstract` **start**(): `void` \| `Promise`\<`void`\>
|
|
96
96
|
|
|
97
|
-
Defined in: [src/BackgroundService.ts:35](https://github.com/rapidrest/service-core/blob/
|
|
97
|
+
Defined in: [src/BackgroundService.ts:35](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/BackgroundService.ts#L35)
|
|
98
98
|
|
|
99
99
|
Initializes the background service with any defaults.
|
|
100
100
|
|
|
@@ -108,7 +108,7 @@ Initializes the background service with any defaults.
|
|
|
108
108
|
|
|
109
109
|
> `abstract` **stop**(): `void` \| `Promise`\<`void`\>
|
|
110
110
|
|
|
111
|
-
Defined in: [src/BackgroundService.ts:40](https://github.com/rapidrest/service-core/blob/
|
|
111
|
+
Defined in: [src/BackgroundService.ts:40](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/BackgroundService.ts#L40)
|
|
112
112
|
|
|
113
113
|
Shuts down the background allowing the service to complete any outstanding tasks.
|
|
114
114
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: BackgroundServiceManager
|
|
8
8
|
|
|
9
|
-
Defined in: [src/BackgroundServiceManager.ts:35](https://github.com/rapidrest/service-core/blob/
|
|
9
|
+
Defined in: [src/BackgroundServiceManager.ts:35](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/BackgroundServiceManager.ts#L35)
|
|
10
10
|
|
|
11
11
|
The `BackgroundServiceManager` manages all configured background services in the application. It is responsible for
|
|
12
12
|
initializing the jobs, scheduling them and performing any related shutdown tasks. See the `BackgroundService`
|
|
@@ -43,7 +43,7 @@ Jean-Philippe Steinmetz <rapidrests@gmail.com>
|
|
|
43
43
|
|
|
44
44
|
> **new BackgroundServiceManager**(`objectFactory`, `classes`, `config`, `logger`): `BackgroundServiceManager`
|
|
45
45
|
|
|
46
|
-
Defined in: [src/BackgroundServiceManager.ts:43](https://github.com/rapidrest/service-core/blob/
|
|
46
|
+
Defined in: [src/BackgroundServiceManager.ts:43](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/BackgroundServiceManager.ts#L43)
|
|
47
47
|
|
|
48
48
|
#### Parameters
|
|
49
49
|
|
|
@@ -71,7 +71,7 @@ Defined in: [src/BackgroundServiceManager.ts:43](https://github.com/rapidrest/se
|
|
|
71
71
|
|
|
72
72
|
> **getService**(`name`): [`BackgroundService`](BackgroundService.md) \| `undefined`
|
|
73
73
|
|
|
74
|
-
Defined in: [src/BackgroundServiceManager.ts:55](https://github.com/rapidrest/service-core/blob/
|
|
74
|
+
Defined in: [src/BackgroundServiceManager.ts:55](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/BackgroundServiceManager.ts#L55)
|
|
75
75
|
|
|
76
76
|
Returns the service instance with the given name.
|
|
77
77
|
|
|
@@ -93,7 +93,7 @@ The name of the background service to retrieve.
|
|
|
93
93
|
|
|
94
94
|
> **start**(`serviceName`, `clazz?`, ...`args`): `Promise`\<`void`\>
|
|
95
95
|
|
|
96
|
-
Defined in: [src/BackgroundServiceManager.ts:81](https://github.com/rapidrest/service-core/blob/
|
|
96
|
+
Defined in: [src/BackgroundServiceManager.ts:81](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/BackgroundServiceManager.ts#L81)
|
|
97
97
|
|
|
98
98
|
Starts the background service with the given name.
|
|
99
99
|
|
|
@@ -127,7 +127,7 @@ The list of arguments to pass into the service constructor
|
|
|
127
127
|
|
|
128
128
|
> **startAll**(): `Promise`\<`void`\>
|
|
129
129
|
|
|
130
|
-
Defined in: [src/BackgroundServiceManager.ts:62](https://github.com/rapidrest/service-core/blob/
|
|
130
|
+
Defined in: [src/BackgroundServiceManager.ts:62](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/BackgroundServiceManager.ts#L62)
|
|
131
131
|
|
|
132
132
|
Starts all configured background services.
|
|
133
133
|
|
|
@@ -141,7 +141,7 @@ Starts all configured background services.
|
|
|
141
141
|
|
|
142
142
|
> **stop**(`serviceName`): `Promise`\<`void`\>
|
|
143
143
|
|
|
144
|
-
Defined in: [src/BackgroundServiceManager.ts:139](https://github.com/rapidrest/service-core/blob/
|
|
144
|
+
Defined in: [src/BackgroundServiceManager.ts:139](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/BackgroundServiceManager.ts#L139)
|
|
145
145
|
|
|
146
146
|
Stops the background service with the given name.
|
|
147
147
|
|
|
@@ -163,7 +163,7 @@ The name of the background service to stop.
|
|
|
163
163
|
|
|
164
164
|
> **stopAll**(): `Promise`\<`void`\>
|
|
165
165
|
|
|
166
|
-
Defined in: [src/BackgroundServiceManager.ts:124](https://github.com/rapidrest/service-core/blob/
|
|
166
|
+
Defined in: [src/BackgroundServiceManager.ts:124](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/BackgroundServiceManager.ts#L124)
|
|
167
167
|
|
|
168
168
|
Stops all currently active background services that are owned by the manager.
|
|
169
169
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Abstract Class: BaseEntity
|
|
8
8
|
|
|
9
|
-
Defined in: [src/models/BaseEntity.ts:18](https://github.com/rapidrest/service-core/blob/
|
|
9
|
+
Defined in: [src/models/BaseEntity.ts:18](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/BaseEntity.ts#L18)
|
|
10
10
|
|
|
11
11
|
Provides a common base class for all entity's that will be persisted to a datastore.
|
|
12
12
|
|
|
@@ -29,7 +29,7 @@ Jean-Philippe Steinmetz <rapidrests@gmail.com>
|
|
|
29
29
|
|
|
30
30
|
> **new BaseEntity**(`other?`): `BaseEntity`
|
|
31
31
|
|
|
32
|
-
Defined in: [src/models/BaseEntity.ts:52](https://github.com/rapidrest/service-core/blob/
|
|
32
|
+
Defined in: [src/models/BaseEntity.ts:52](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/BaseEntity.ts#L52)
|
|
33
33
|
|
|
34
34
|
#### Parameters
|
|
35
35
|
|
|
@@ -47,7 +47,7 @@ Defined in: [src/models/BaseEntity.ts:52](https://github.com/rapidrest/service-c
|
|
|
47
47
|
|
|
48
48
|
> **dateCreated**: `Date`
|
|
49
49
|
|
|
50
|
-
Defined in: [src/models/BaseEntity.ts:35](https://github.com/rapidrest/service-core/blob/
|
|
50
|
+
Defined in: [src/models/BaseEntity.ts:35](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/BaseEntity.ts#L35)
|
|
51
51
|
|
|
52
52
|
The date and time that the entity was created.
|
|
53
53
|
|
|
@@ -57,7 +57,7 @@ The date and time that the entity was created.
|
|
|
57
57
|
|
|
58
58
|
> **dateModified**: `Date`
|
|
59
59
|
|
|
60
|
-
Defined in: [src/models/BaseEntity.ts:43](https://github.com/rapidrest/service-core/blob/
|
|
60
|
+
Defined in: [src/models/BaseEntity.ts:43](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/BaseEntity.ts#L43)
|
|
61
61
|
|
|
62
62
|
The date and time that the entity was last modified.
|
|
63
63
|
|
|
@@ -67,7 +67,7 @@ The date and time that the entity was last modified.
|
|
|
67
67
|
|
|
68
68
|
> **uid**: `string`
|
|
69
69
|
|
|
70
|
-
Defined in: [src/models/BaseEntity.ts:27](https://github.com/rapidrest/service-core/blob/
|
|
70
|
+
Defined in: [src/models/BaseEntity.ts:27](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/BaseEntity.ts#L27)
|
|
71
71
|
|
|
72
72
|
The universally unique identifier of the entity.
|
|
73
73
|
|
|
@@ -77,6 +77,6 @@ The universally unique identifier of the entity.
|
|
|
77
77
|
|
|
78
78
|
> **version**: `number` = `0`
|
|
79
79
|
|
|
80
|
-
Defined in: [src/models/BaseEntity.ts:50](https://github.com/rapidrest/service-core/blob/
|
|
80
|
+
Defined in: [src/models/BaseEntity.ts:50](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/BaseEntity.ts#L50)
|
|
81
81
|
|
|
82
82
|
The optimistic lock version.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Abstract Class: BaseMongoEntity
|
|
8
8
|
|
|
9
|
-
Defined in: [src/models/BaseMongoEntity.ts:15](https://github.com/rapidrest/service-core/blob/
|
|
9
|
+
Defined in: [src/models/BaseMongoEntity.ts:15](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/BaseMongoEntity.ts#L15)
|
|
10
10
|
|
|
11
11
|
Provides a common base class for all entity's that will be persisted in a MongoDB database.
|
|
12
12
|
|
|
@@ -24,7 +24,7 @@ Jean-Philippe Steinmetz <rapidrests@gmail.com>
|
|
|
24
24
|
|
|
25
25
|
> **new BaseMongoEntity**(`other?`): `BaseMongoEntity`
|
|
26
26
|
|
|
27
|
-
Defined in: [src/models/BaseMongoEntity.ts:23](https://github.com/rapidrest/service-core/blob/
|
|
27
|
+
Defined in: [src/models/BaseMongoEntity.ts:23](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/BaseMongoEntity.ts#L23)
|
|
28
28
|
|
|
29
29
|
#### Parameters
|
|
30
30
|
|
|
@@ -46,7 +46,7 @@ Defined in: [src/models/BaseMongoEntity.ts:23](https://github.com/rapidrest/serv
|
|
|
46
46
|
|
|
47
47
|
> `optional` **\_id?**: `any`
|
|
48
48
|
|
|
49
|
-
Defined in: [src/models/BaseMongoEntity.ts:21](https://github.com/rapidrest/service-core/blob/
|
|
49
|
+
Defined in: [src/models/BaseMongoEntity.ts:21](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/BaseMongoEntity.ts#L21)
|
|
50
50
|
|
|
51
51
|
The internal unique identifier used by MongoDB.
|
|
52
52
|
|
|
@@ -56,7 +56,7 @@ The internal unique identifier used by MongoDB.
|
|
|
56
56
|
|
|
57
57
|
> **dateCreated**: `Date`
|
|
58
58
|
|
|
59
|
-
Defined in: [src/models/BaseEntity.ts:35](https://github.com/rapidrest/service-core/blob/
|
|
59
|
+
Defined in: [src/models/BaseEntity.ts:35](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/BaseEntity.ts#L35)
|
|
60
60
|
|
|
61
61
|
The date and time that the entity was created.
|
|
62
62
|
|
|
@@ -70,7 +70,7 @@ The date and time that the entity was created.
|
|
|
70
70
|
|
|
71
71
|
> **dateModified**: `Date`
|
|
72
72
|
|
|
73
|
-
Defined in: [src/models/BaseEntity.ts:43](https://github.com/rapidrest/service-core/blob/
|
|
73
|
+
Defined in: [src/models/BaseEntity.ts:43](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/BaseEntity.ts#L43)
|
|
74
74
|
|
|
75
75
|
The date and time that the entity was last modified.
|
|
76
76
|
|
|
@@ -84,7 +84,7 @@ The date and time that the entity was last modified.
|
|
|
84
84
|
|
|
85
85
|
> **uid**: `string`
|
|
86
86
|
|
|
87
|
-
Defined in: [src/models/BaseEntity.ts:27](https://github.com/rapidrest/service-core/blob/
|
|
87
|
+
Defined in: [src/models/BaseEntity.ts:27](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/BaseEntity.ts#L27)
|
|
88
88
|
|
|
89
89
|
The universally unique identifier of the entity.
|
|
90
90
|
|
|
@@ -98,7 +98,7 @@ The universally unique identifier of the entity.
|
|
|
98
98
|
|
|
99
99
|
> **version**: `number` = `0`
|
|
100
100
|
|
|
101
|
-
Defined in: [src/models/BaseEntity.ts:50](https://github.com/rapidrest/service-core/blob/
|
|
101
|
+
Defined in: [src/models/BaseEntity.ts:50](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/BaseEntity.ts#L50)
|
|
102
102
|
|
|
103
103
|
The optimistic lock version.
|
|
104
104
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: BasicStrategy
|
|
8
8
|
|
|
9
|
-
Defined in: [src/auth/BasicStrategy.ts:
|
|
9
|
+
Defined in: [src/auth/BasicStrategy.ts:39](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/auth/BasicStrategy.ts#L39)
|
|
10
10
|
|
|
11
11
|
## Author
|
|
12
12
|
|
|
@@ -22,7 +22,7 @@ Jean-Philippe Steinmetz <rapidrests@gmail.com>
|
|
|
22
22
|
|
|
23
23
|
> **new BasicStrategy**(`options?`): `BasicStrategy`
|
|
24
24
|
|
|
25
|
-
Defined in: [src/auth/BasicStrategy.ts:
|
|
25
|
+
Defined in: [src/auth/BasicStrategy.ts:43](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/auth/BasicStrategy.ts#L43)
|
|
26
26
|
|
|
27
27
|
#### Parameters
|
|
28
28
|
|
|
@@ -40,7 +40,7 @@ Defined in: [src/auth/BasicStrategy.ts:40](https://github.com/rapidrest/service-
|
|
|
40
40
|
|
|
41
41
|
> `readonly` **name**: `string` = `"basic"`
|
|
42
42
|
|
|
43
|
-
Defined in: [src/auth/BasicStrategy.ts:
|
|
43
|
+
Defined in: [src/auth/BasicStrategy.ts:40](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/auth/BasicStrategy.ts#L40)
|
|
44
44
|
|
|
45
45
|
The unique name of the strategy used to register with the `AuthMiddleware`.
|
|
46
46
|
|
|
@@ -52,25 +52,25 @@ The unique name of the strategy used to register with the `AuthMiddleware`.
|
|
|
52
52
|
|
|
53
53
|
### authenticate()
|
|
54
54
|
|
|
55
|
-
> **authenticate**(`req`, `res`, `required?`):
|
|
55
|
+
> **authenticate**(`req`, `res`, `required?`): `Promise`\<[`AuthResult`](../interfaces/AuthResult.md) \| `undefined`\>
|
|
56
56
|
|
|
57
|
-
Defined in: [src/auth/BasicStrategy.ts:
|
|
57
|
+
Defined in: [src/auth/BasicStrategy.ts:80](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/auth/BasicStrategy.ts#L80)
|
|
58
58
|
|
|
59
|
-
Attempts to perform authentication with the given request data. If authentication was successful, returns an
|
|
60
|
-
`AuthResult` containing the authentication details. If authentication fails and `required` is set to `true`
|
|
59
|
+
Attempts to perform authentication with the given request data. If authentication was successful, returns an
|
|
60
|
+
`AuthResult` containing the authentication details. If authentication fails and `required` is set to `true`
|
|
61
61
|
throws an error, otherwise returns `undefined`.
|
|
62
62
|
|
|
63
63
|
#### Parameters
|
|
64
64
|
|
|
65
65
|
##### req
|
|
66
66
|
|
|
67
|
-
`HttpRequest`
|
|
67
|
+
[`HttpRequest`](../interfaces/HttpRequest.md)
|
|
68
68
|
|
|
69
69
|
The request containing data to attempt authentication with.
|
|
70
70
|
|
|
71
71
|
##### res
|
|
72
72
|
|
|
73
|
-
`HttpResponse`
|
|
73
|
+
[`HttpResponse`](../interfaces/HttpResponse.md)
|
|
74
74
|
|
|
75
75
|
The response to use when writing back directly to the client.
|
|
76
76
|
|
|
@@ -82,8 +82,50 @@ Set to `true` to if authentication is required to pass, otherwise set to `false`
|
|
|
82
82
|
|
|
83
83
|
#### Returns
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
`Promise`\<[`AuthResult`](../interfaces/AuthResult.md) \| `undefined`\>
|
|
86
86
|
|
|
87
87
|
#### Implementation of
|
|
88
88
|
|
|
89
89
|
[`AuthStrategy`](../interfaces/AuthStrategy.md).[`authenticate`](../interfaces/AuthStrategy.md#authenticate)
|
|
90
|
+
|
|
91
|
+
***
|
|
92
|
+
|
|
93
|
+
### authenticateSync()
|
|
94
|
+
|
|
95
|
+
> **authenticateSync**(`req`, `res`, `required?`): [`AuthResult`](../interfaces/AuthResult.md) \| `undefined`
|
|
96
|
+
|
|
97
|
+
Defined in: [src/auth/BasicStrategy.ts:112](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/auth/BasicStrategy.ts#L112)
|
|
98
|
+
|
|
99
|
+
Attempts to perform authentication with the given request data. If authentication was successful, returns an
|
|
100
|
+
`AuthResult` containing the authentication details. If authentication fails and `required` is set to `true`
|
|
101
|
+
throws an error, otherwise returns `undefined`.
|
|
102
|
+
|
|
103
|
+
This is the synchronous version of `authenticate` that performs blocking based authentication.
|
|
104
|
+
|
|
105
|
+
#### Parameters
|
|
106
|
+
|
|
107
|
+
##### req
|
|
108
|
+
|
|
109
|
+
[`HttpRequest`](../interfaces/HttpRequest.md)
|
|
110
|
+
|
|
111
|
+
The request containing data to attempt authentication with.
|
|
112
|
+
|
|
113
|
+
##### res
|
|
114
|
+
|
|
115
|
+
[`HttpResponse`](../interfaces/HttpResponse.md)
|
|
116
|
+
|
|
117
|
+
The response to use when writing back directly to the client.
|
|
118
|
+
|
|
119
|
+
##### required?
|
|
120
|
+
|
|
121
|
+
`boolean`
|
|
122
|
+
|
|
123
|
+
Set to `true` to if authentication is required to pass, otherwise set to `false`.
|
|
124
|
+
|
|
125
|
+
#### Returns
|
|
126
|
+
|
|
127
|
+
[`AuthResult`](../interfaces/AuthResult.md) \| `undefined`
|
|
128
|
+
|
|
129
|
+
#### Implementation of
|
|
130
|
+
|
|
131
|
+
[`AuthStrategy`](../interfaces/AuthStrategy.md).[`authenticateSync`](../interfaces/AuthStrategy.md#authenticatesync)
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: BasicStrategyOptions
|
|
8
8
|
|
|
9
|
-
Defined in: [src/auth/BasicStrategy.ts:
|
|
9
|
+
Defined in: [src/auth/BasicStrategy.ts:13](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/auth/BasicStrategy.ts#L13)
|
|
10
10
|
|
|
11
11
|
Describes the configuration options that can be used to initialize BasicStrategy.
|
|
12
12
|
|
|
@@ -30,10 +30,10 @@ Jean-Philippe Steinmetz
|
|
|
30
30
|
|
|
31
31
|
> **allowQueryParam**: `boolean` = `false`
|
|
32
32
|
|
|
33
|
-
Defined in: [src/auth/BasicStrategy.ts:
|
|
33
|
+
Defined in: [src/auth/BasicStrategy.ts:25](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/auth/BasicStrategy.ts#L25)
|
|
34
34
|
|
|
35
|
-
Set to `true` to allow credentials to be supplied via the `queryKey` URL parameter.
|
|
36
|
-
Disabled by default — query parameters appear in server logs, browser history, and
|
|
35
|
+
Set to `true` to allow credentials to be supplied via the `queryKey` URL parameter.
|
|
36
|
+
Disabled by default — query parameters appear in server logs, browser history, and
|
|
37
37
|
Referer headers, which permanently exposes credentials outside the application.
|
|
38
38
|
|
|
39
39
|
***
|
|
@@ -42,7 +42,7 @@ Referer headers, which permanently exposes credentials outside the application.
|
|
|
42
42
|
|
|
43
43
|
> **headerKey**: `string` = `"authorization"`
|
|
44
44
|
|
|
45
|
-
Defined in: [src/auth/BasicStrategy.ts:
|
|
45
|
+
Defined in: [src/auth/BasicStrategy.ts:15](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/auth/BasicStrategy.ts#L15)
|
|
46
46
|
|
|
47
47
|
The name of the header to look for when performing header based authentication. Default value is `Authorization`.
|
|
48
48
|
|
|
@@ -52,7 +52,7 @@ The name of the header to look for when performing header based authentication.
|
|
|
52
52
|
|
|
53
53
|
> **headerScheme**: `string` = `"basic"`
|
|
54
54
|
|
|
55
|
-
Defined in: [src/auth/BasicStrategy.ts:
|
|
55
|
+
Defined in: [src/auth/BasicStrategy.ts:17](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/auth/BasicStrategy.ts#L17)
|
|
56
56
|
|
|
57
57
|
The authorization scheme type when using header based authentication. Default value is `jwt`.
|
|
58
58
|
|
|
@@ -62,7 +62,7 @@ The authorization scheme type when using header based authentication. Default va
|
|
|
62
62
|
|
|
63
63
|
> **queryKey**: `string` = `"auth_basic"`
|
|
64
64
|
|
|
65
|
-
Defined in: [src/auth/BasicStrategy.ts:
|
|
65
|
+
Defined in: [src/auth/BasicStrategy.ts:19](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/auth/BasicStrategy.ts#L19)
|
|
66
66
|
|
|
67
67
|
The name of the request query parameter to retrieve the token from when using query based authentication. Default value is `auth_basic`.
|
|
68
68
|
|
|
@@ -70,11 +70,11 @@ The name of the request query parameter to retrieve the token from when using qu
|
|
|
70
70
|
|
|
71
71
|
### verify()
|
|
72
72
|
|
|
73
|
-
> **verify**(`uid`, `secret`): `JWTUser` \| `Promise`\<`JWTUser`\> \| `undefined`
|
|
73
|
+
> **verify**(`uid`, `secret`): `JWTUser` \| `Promise`\<`JWTUser` \| `undefined`\> \| `undefined`
|
|
74
74
|
|
|
75
|
-
Defined in: [src/auth/BasicStrategy.ts:
|
|
75
|
+
Defined in: [src/auth/BasicStrategy.ts:27](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/auth/BasicStrategy.ts#L27)
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
Override this function to handle asynchronous (non-blocking) verification of the login info.
|
|
78
78
|
|
|
79
79
|
#### Parameters
|
|
80
80
|
|
|
@@ -88,4 +88,28 @@ You must override this function to perform verification of the login information
|
|
|
88
88
|
|
|
89
89
|
#### Returns
|
|
90
90
|
|
|
91
|
-
`JWTUser` \| `Promise`\<`JWTUser`\> \| `undefined`
|
|
91
|
+
`JWTUser` \| `Promise`\<`JWTUser` \| `undefined`\> \| `undefined`
|
|
92
|
+
|
|
93
|
+
***
|
|
94
|
+
|
|
95
|
+
### verifySync()
|
|
96
|
+
|
|
97
|
+
> **verifySync**(`uid`, `secret`): `JWTUser` \| `undefined`
|
|
98
|
+
|
|
99
|
+
Defined in: [src/auth/BasicStrategy.ts:31](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/auth/BasicStrategy.ts#L31)
|
|
100
|
+
|
|
101
|
+
Override this function to handle synchronous (blocking) verification of the login info.
|
|
102
|
+
|
|
103
|
+
#### Parameters
|
|
104
|
+
|
|
105
|
+
##### uid
|
|
106
|
+
|
|
107
|
+
`string`
|
|
108
|
+
|
|
109
|
+
##### secret
|
|
110
|
+
|
|
111
|
+
`string`
|
|
112
|
+
|
|
113
|
+
#### Returns
|
|
114
|
+
|
|
115
|
+
`JWTUser` \| `undefined`
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: BulkError
|
|
8
8
|
|
|
9
|
-
Defined in: [src/BulkError.ts:6](https://github.com/rapidrest/service-core/blob/
|
|
9
|
+
Defined in: [src/BulkError.ts:6](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/BulkError.ts#L6)
|
|
10
10
|
|
|
11
11
|
An error take that takes an array of other errors.
|
|
12
12
|
|
|
@@ -20,7 +20,7 @@ An error take that takes an array of other errors.
|
|
|
20
20
|
|
|
21
21
|
> **new BulkError**(`errs`, `code`, `defaultStatus`, `message?`): `BulkError`
|
|
22
22
|
|
|
23
|
-
Defined in: [src/BulkError.ts:12](https://github.com/rapidrest/service-core/blob/
|
|
23
|
+
Defined in: [src/BulkError.ts:12](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/BulkError.ts#L12)
|
|
24
24
|
|
|
25
25
|
#### Parameters
|
|
26
26
|
|
|
@@ -68,7 +68,7 @@ The unique code of the error.
|
|
|
68
68
|
|
|
69
69
|
> `readonly` **errors**: (`Error` \| `null`)[] = `[]`
|
|
70
70
|
|
|
71
|
-
Defined in: [src/BulkError.ts:10](https://github.com/rapidrest/service-core/blob/
|
|
71
|
+
Defined in: [src/BulkError.ts:10](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/BulkError.ts#L10)
|
|
72
72
|
|
|
73
73
|
The list of errors that have been thrown.
|
|
74
74
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: ConnectionManager
|
|
8
8
|
|
|
9
|
-
Defined in: [src/database/ConnectionManager.ts:17](https://github.com/rapidrest/service-core/blob/
|
|
9
|
+
Defined in: [src/database/ConnectionManager.ts:17](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/database/ConnectionManager.ts#L17)
|
|
10
10
|
|
|
11
11
|
Provides database connection management.
|
|
12
12
|
|
|
@@ -30,7 +30,7 @@ Jean-Philippe Steinmetz
|
|
|
30
30
|
|
|
31
31
|
> **connections**: `Map`\<`string`, `Redis` \| `DataSource` \| [`MongoConnection`](MongoConnection.md)\>
|
|
32
32
|
|
|
33
|
-
Defined in: [src/database/ConnectionManager.ts:18](https://github.com/rapidrest/service-core/blob/
|
|
33
|
+
Defined in: [src/database/ConnectionManager.ts:18](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/database/ConnectionManager.ts#L18)
|
|
34
34
|
|
|
35
35
|
## Methods
|
|
36
36
|
|
|
@@ -38,7 +38,7 @@ Defined in: [src/database/ConnectionManager.ts:18](https://github.com/rapidrest/
|
|
|
38
38
|
|
|
39
39
|
> **connect**(`datastores`, `models`): `Promise`\<`void`\>
|
|
40
40
|
|
|
41
|
-
Defined in: [src/database/ConnectionManager.ts:60](https://github.com/rapidrest/service-core/blob/
|
|
41
|
+
Defined in: [src/database/ConnectionManager.ts:60](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/database/ConnectionManager.ts#L60)
|
|
42
42
|
|
|
43
43
|
Attempts to initiate all database connections as defined in the config.
|
|
44
44
|
|
|
@@ -66,7 +66,7 @@ A map of model names and associated class definitions to establish database conn
|
|
|
66
66
|
|
|
67
67
|
> **disconnect**(): `Promise`\<`void`\>
|
|
68
68
|
|
|
69
|
-
Defined in: [src/database/ConnectionManager.ts:136](https://github.com/rapidrest/service-core/blob/
|
|
69
|
+
Defined in: [src/database/ConnectionManager.ts:136](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/database/ConnectionManager.ts#L136)
|
|
70
70
|
|
|
71
71
|
Attempts to disconnect all active database connections.
|
|
72
72
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: EventListenerManager
|
|
8
8
|
|
|
9
|
-
Defined in: [src/EventListenerManager.ts:18](https://github.com/rapidrest/service-core/blob/
|
|
9
|
+
Defined in: [src/EventListenerManager.ts:18](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/EventListenerManager.ts#L18)
|
|
10
10
|
|
|
11
11
|
The `EventListenerManager` is responsible for managing event handlers and processing of incoming
|
|
12
12
|
events from the configured redis pubsub channels. An event handler is any function that has been
|
|
@@ -25,7 +25,7 @@ Jean-Philippe Steinmetz <rapidrests@gmail.com>
|
|
|
25
25
|
|
|
26
26
|
> **new EventListenerManager**(`objectFactory`, `redis`): `EventListenerManager`
|
|
27
27
|
|
|
28
|
-
Defined in: [src/EventListenerManager.ts:27](https://github.com/rapidrest/service-core/blob/
|
|
28
|
+
Defined in: [src/EventListenerManager.ts:27](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/EventListenerManager.ts#L27)
|
|
29
29
|
|
|
30
30
|
#### Parameters
|
|
31
31
|
|
|
@@ -47,7 +47,7 @@ Defined in: [src/EventListenerManager.ts:27](https://github.com/rapidrest/servic
|
|
|
47
47
|
|
|
48
48
|
> **destroy**(): `Promise`\<`void`\>
|
|
49
49
|
|
|
50
|
-
Defined in: [src/EventListenerManager.ts:77](https://github.com/rapidrest/service-core/blob/
|
|
50
|
+
Defined in: [src/EventListenerManager.ts:77](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/EventListenerManager.ts#L77)
|
|
51
51
|
|
|
52
52
|
#### Returns
|
|
53
53
|
|
|
@@ -59,7 +59,7 @@ Defined in: [src/EventListenerManager.ts:77](https://github.com/rapidrest/servic
|
|
|
59
59
|
|
|
60
60
|
> **init**(): `Promise`\<`void`\>
|
|
61
61
|
|
|
62
|
-
Defined in: [src/EventListenerManager.ts:33](https://github.com/rapidrest/service-core/blob/
|
|
62
|
+
Defined in: [src/EventListenerManager.ts:33](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/EventListenerManager.ts#L33)
|
|
63
63
|
|
|
64
64
|
#### Returns
|
|
65
65
|
|
|
@@ -71,7 +71,7 @@ Defined in: [src/EventListenerManager.ts:33](https://github.com/rapidrest/servic
|
|
|
71
71
|
|
|
72
72
|
> **register**(`obj`): `void`
|
|
73
73
|
|
|
74
|
-
Defined in: [src/EventListenerManager.ts:128](https://github.com/rapidrest/service-core/blob/
|
|
74
|
+
Defined in: [src/EventListenerManager.ts:128](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/EventListenerManager.ts#L128)
|
|
75
75
|
|
|
76
76
|
Registers the given object to be notified of events that arrive.
|
|
77
77
|
|