@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
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
[**@rapidrest/service-core**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@rapidrest/service-core](../globals.md) / RequestWS
|
|
6
|
+
|
|
7
|
+
# Interface: RequestWS
|
|
8
|
+
|
|
9
|
+
Defined in: [src/http/WebSocket.ts:14](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/http/WebSocket.ts#L14)
|
|
10
|
+
|
|
11
|
+
HTTP request type for handling WebSocket upgrade requests.
|
|
12
|
+
Extends `HttpRequest` with WebSocket-specific properties set by the router
|
|
13
|
+
after the uWS WebSocket connection is opened.
|
|
14
|
+
|
|
15
|
+
## Extends
|
|
16
|
+
|
|
17
|
+
- [`HttpRequest`](HttpRequest.md)
|
|
18
|
+
|
|
19
|
+
## Indexable
|
|
20
|
+
|
|
21
|
+
> \[`key`: `string`\]: `any`
|
|
22
|
+
|
|
23
|
+
Allow arbitrary per-request properties (e.g. req.websocket, req.wsHandled).
|
|
24
|
+
|
|
25
|
+
## Properties
|
|
26
|
+
|
|
27
|
+
### authPayload?
|
|
28
|
+
|
|
29
|
+
> `optional` **authPayload?**: `any`
|
|
30
|
+
|
|
31
|
+
Defined in: [src/http/types.ts:26](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/http/types.ts#L26)
|
|
32
|
+
|
|
33
|
+
Full decoded JWT payload, set by JWT auth middleware.
|
|
34
|
+
|
|
35
|
+
#### Inherited from
|
|
36
|
+
|
|
37
|
+
[`HttpRequest`](HttpRequest.md).[`authPayload`](HttpRequest.md#authpayload)
|
|
38
|
+
|
|
39
|
+
***
|
|
40
|
+
|
|
41
|
+
### authToken?
|
|
42
|
+
|
|
43
|
+
> `optional` **authToken?**: `string`
|
|
44
|
+
|
|
45
|
+
Defined in: [src/http/types.ts:28](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/http/types.ts#L28)
|
|
46
|
+
|
|
47
|
+
Raw JWT token string, set by JWT auth middleware.
|
|
48
|
+
|
|
49
|
+
#### Inherited from
|
|
50
|
+
|
|
51
|
+
[`HttpRequest`](HttpRequest.md).[`authToken`](HttpRequest.md#authtoken)
|
|
52
|
+
|
|
53
|
+
***
|
|
54
|
+
|
|
55
|
+
### body
|
|
56
|
+
|
|
57
|
+
> **body**: `any`
|
|
58
|
+
|
|
59
|
+
Defined in: [src/http/types.ts:17](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/http/types.ts#L17)
|
|
60
|
+
|
|
61
|
+
#### Inherited from
|
|
62
|
+
|
|
63
|
+
[`HttpRequest`](HttpRequest.md).[`body`](HttpRequest.md#body)
|
|
64
|
+
|
|
65
|
+
***
|
|
66
|
+
|
|
67
|
+
### cookies
|
|
68
|
+
|
|
69
|
+
> **cookies**: `Record`\<`string`, `string`\>
|
|
70
|
+
|
|
71
|
+
Defined in: [src/http/types.ts:19](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/http/types.ts#L19)
|
|
72
|
+
|
|
73
|
+
#### Inherited from
|
|
74
|
+
|
|
75
|
+
[`HttpRequest`](HttpRequest.md).[`cookies`](HttpRequest.md#cookies)
|
|
76
|
+
|
|
77
|
+
***
|
|
78
|
+
|
|
79
|
+
### headers
|
|
80
|
+
|
|
81
|
+
> **headers**: `Record`\<`string`, `string` \| `string`[] \| `undefined`\>
|
|
82
|
+
|
|
83
|
+
Defined in: [src/http/types.ts:14](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/http/types.ts#L14)
|
|
84
|
+
|
|
85
|
+
#### Inherited from
|
|
86
|
+
|
|
87
|
+
[`HttpRequest`](HttpRequest.md).[`headers`](HttpRequest.md#headers)
|
|
88
|
+
|
|
89
|
+
***
|
|
90
|
+
|
|
91
|
+
### method
|
|
92
|
+
|
|
93
|
+
> **method**: `string`
|
|
94
|
+
|
|
95
|
+
Defined in: [src/http/types.ts:11](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/http/types.ts#L11)
|
|
96
|
+
|
|
97
|
+
#### Inherited from
|
|
98
|
+
|
|
99
|
+
[`HttpRequest`](HttpRequest.md).[`method`](HttpRequest.md#method)
|
|
100
|
+
|
|
101
|
+
***
|
|
102
|
+
|
|
103
|
+
### params
|
|
104
|
+
|
|
105
|
+
> **params**: `Record`\<`string`, `string`\>
|
|
106
|
+
|
|
107
|
+
Defined in: [src/http/types.ts:15](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/http/types.ts#L15)
|
|
108
|
+
|
|
109
|
+
#### Inherited from
|
|
110
|
+
|
|
111
|
+
[`HttpRequest`](HttpRequest.md).[`params`](HttpRequest.md#params)
|
|
112
|
+
|
|
113
|
+
***
|
|
114
|
+
|
|
115
|
+
### path
|
|
116
|
+
|
|
117
|
+
> **path**: `string`
|
|
118
|
+
|
|
119
|
+
Defined in: [src/http/types.ts:12](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/http/types.ts#L12)
|
|
120
|
+
|
|
121
|
+
#### Inherited from
|
|
122
|
+
|
|
123
|
+
[`HttpRequest`](HttpRequest.md).[`path`](HttpRequest.md#path)
|
|
124
|
+
|
|
125
|
+
***
|
|
126
|
+
|
|
127
|
+
### query
|
|
128
|
+
|
|
129
|
+
> **query**: `Record`\<`string`, `string` \| `string`[]\>
|
|
130
|
+
|
|
131
|
+
Defined in: [src/http/types.ts:16](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/http/types.ts#L16)
|
|
132
|
+
|
|
133
|
+
#### Inherited from
|
|
134
|
+
|
|
135
|
+
[`HttpRequest`](HttpRequest.md).[`query`](HttpRequest.md#query)
|
|
136
|
+
|
|
137
|
+
***
|
|
138
|
+
|
|
139
|
+
### rawBody?
|
|
140
|
+
|
|
141
|
+
> `optional` **rawBody?**: `Buffer`\<`ArrayBufferLike`\>
|
|
142
|
+
|
|
143
|
+
Defined in: [src/http/types.ts:18](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/http/types.ts#L18)
|
|
144
|
+
|
|
145
|
+
#### Inherited from
|
|
146
|
+
|
|
147
|
+
[`HttpRequest`](HttpRequest.md).[`rawBody`](HttpRequest.md#rawbody)
|
|
148
|
+
|
|
149
|
+
***
|
|
150
|
+
|
|
151
|
+
### signedCookies
|
|
152
|
+
|
|
153
|
+
> **signedCookies**: `Record`\<`string`, `string`\>
|
|
154
|
+
|
|
155
|
+
Defined in: [src/http/types.ts:20](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/http/types.ts#L20)
|
|
156
|
+
|
|
157
|
+
#### Inherited from
|
|
158
|
+
|
|
159
|
+
[`HttpRequest`](HttpRequest.md).[`signedCookies`](HttpRequest.md#signedcookies)
|
|
160
|
+
|
|
161
|
+
***
|
|
162
|
+
|
|
163
|
+
### socket
|
|
164
|
+
|
|
165
|
+
> **socket**: `object`
|
|
166
|
+
|
|
167
|
+
Defined in: [src/http/types.ts:22](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/http/types.ts#L22)
|
|
168
|
+
|
|
169
|
+
Minimal socket interface; populated with remote address for IP extraction.
|
|
170
|
+
|
|
171
|
+
#### remoteAddress?
|
|
172
|
+
|
|
173
|
+
> `optional` **remoteAddress?**: `string`
|
|
174
|
+
|
|
175
|
+
#### Inherited from
|
|
176
|
+
|
|
177
|
+
[`HttpRequest`](HttpRequest.md).[`socket`](HttpRequest.md#socket)
|
|
178
|
+
|
|
179
|
+
***
|
|
180
|
+
|
|
181
|
+
### url
|
|
182
|
+
|
|
183
|
+
> **url**: `string`
|
|
184
|
+
|
|
185
|
+
Defined in: [src/http/types.ts:13](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/http/types.ts#L13)
|
|
186
|
+
|
|
187
|
+
#### Inherited from
|
|
188
|
+
|
|
189
|
+
[`HttpRequest`](HttpRequest.md).[`url`](HttpRequest.md#url)
|
|
190
|
+
|
|
191
|
+
***
|
|
192
|
+
|
|
193
|
+
### user?
|
|
194
|
+
|
|
195
|
+
> `optional` **user?**: `any`
|
|
196
|
+
|
|
197
|
+
Defined in: [src/http/types.ts:24](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/http/types.ts#L24)
|
|
198
|
+
|
|
199
|
+
Set by JWT auth middleware after successful token verification.
|
|
200
|
+
|
|
201
|
+
#### Inherited from
|
|
202
|
+
|
|
203
|
+
[`HttpRequest`](HttpRequest.md).[`user`](HttpRequest.md#user)
|
|
204
|
+
|
|
205
|
+
***
|
|
206
|
+
|
|
207
|
+
### websocket
|
|
208
|
+
|
|
209
|
+
> **websocket**: [`UWSWebSocketShim`](../classes/UWSWebSocketShim.md) \| `undefined`
|
|
210
|
+
|
|
211
|
+
Defined in: [src/http/WebSocket.ts:18](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/http/WebSocket.ts#L18)
|
|
212
|
+
|
|
213
|
+
The uWS WebSocket shim for this connection. Set on `open` after the upgrade.
|
|
214
|
+
|
|
215
|
+
***
|
|
216
|
+
|
|
217
|
+
### wsHandled
|
|
218
|
+
|
|
219
|
+
> **wsHandled**: `boolean`
|
|
220
|
+
|
|
221
|
+
Defined in: [src/http/WebSocket.ts:25](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/http/WebSocket.ts#L25)
|
|
222
|
+
|
|
223
|
+
Indicates that the WebSocket handler has processed this connection and the
|
|
224
|
+
connection should remain open. Set to `true` by `wrapMiddleware` when a
|
|
225
|
+
decorated handler returns successfully.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: TruncateRequestOptions
|
|
8
8
|
|
|
9
|
-
Defined in: [src/routes/ModelRoute.ts:72](https://github.com/rapidrest/service-core/blob/
|
|
9
|
+
Defined in: [src/routes/ModelRoute.ts:72](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/routes/ModelRoute.ts#L72)
|
|
10
10
|
|
|
11
11
|
The set of options required by truncate request handlers.
|
|
12
12
|
|
|
@@ -20,7 +20,7 @@ The set of options required by truncate request handlers.
|
|
|
20
20
|
|
|
21
21
|
> `optional` **ignoreACL?**: `boolean`
|
|
22
22
|
|
|
23
|
-
Defined in: [src/models/RepoUtils.ts:32](https://github.com/rapidrest/service-core/blob/
|
|
23
|
+
Defined in: [src/models/RepoUtils.ts:32](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/RepoUtils.ts#L32)
|
|
24
24
|
|
|
25
25
|
Set to `true` to ignore the ACL permissions check.
|
|
26
26
|
|
|
@@ -34,7 +34,7 @@ Set to `true` to ignore the ACL permissions check.
|
|
|
34
34
|
|
|
35
35
|
> **params**: `any`
|
|
36
36
|
|
|
37
|
-
Defined in: [src/routes/ModelRoute.ts:74](https://github.com/rapidrest/service-core/blob/
|
|
37
|
+
Defined in: [src/routes/ModelRoute.ts:74](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/routes/ModelRoute.ts#L74)
|
|
38
38
|
|
|
39
39
|
The list of URL parameters to use in the search.
|
|
40
40
|
|
|
@@ -44,7 +44,7 @@ The list of URL parameters to use in the search.
|
|
|
44
44
|
|
|
45
45
|
> `optional` **productUid?**: `string`
|
|
46
46
|
|
|
47
|
-
Defined in: [src/routes/ModelRoute.ts:48](https://github.com/rapidrest/service-core/blob/
|
|
47
|
+
Defined in: [src/routes/ModelRoute.ts:48](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/routes/ModelRoute.ts#L48)
|
|
48
48
|
|
|
49
49
|
The desired product uid of the resource to delete.
|
|
50
50
|
|
|
@@ -58,7 +58,7 @@ The desired product uid of the resource to delete.
|
|
|
58
58
|
|
|
59
59
|
> `optional` **purge?**: `boolean`
|
|
60
60
|
|
|
61
|
-
Defined in: [src/routes/ModelRoute.ts:50](https://github.com/rapidrest/service-core/blob/
|
|
61
|
+
Defined in: [src/routes/ModelRoute.ts:50](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/routes/ModelRoute.ts#L50)
|
|
62
62
|
|
|
63
63
|
Set to true to permanently remove the object from the database (if applicable).
|
|
64
64
|
|
|
@@ -72,7 +72,7 @@ Set to true to permanently remove the object from the database (if applicable).
|
|
|
72
72
|
|
|
73
73
|
> `optional` **pushChannels?**: `string`[]
|
|
74
74
|
|
|
75
|
-
Defined in: [src/routes/ModelRoute.ts:76](https://github.com/rapidrest/service-core/blob/
|
|
75
|
+
Defined in: [src/routes/ModelRoute.ts:76](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/routes/ModelRoute.ts#L76)
|
|
76
76
|
|
|
77
77
|
An additional list of channel names to send push notifications to.
|
|
78
78
|
|
|
@@ -86,7 +86,7 @@ An additional list of channel names to send push notifications to.
|
|
|
86
86
|
|
|
87
87
|
> **query**: `any`
|
|
88
88
|
|
|
89
|
-
Defined in: [src/routes/ModelRoute.ts:78](https://github.com/rapidrest/service-core/blob/
|
|
89
|
+
Defined in: [src/routes/ModelRoute.ts:78](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/routes/ModelRoute.ts#L78)
|
|
90
90
|
|
|
91
91
|
The list of query parameters to use in the search.
|
|
92
92
|
|
|
@@ -96,7 +96,7 @@ The list of query parameters to use in the search.
|
|
|
96
96
|
|
|
97
97
|
> `optional` **recordEvent?**: `boolean`
|
|
98
98
|
|
|
99
|
-
Defined in: [src/models/RepoUtils.ts:36](https://github.com/rapidrest/service-core/blob/
|
|
99
|
+
Defined in: [src/models/RepoUtils.ts:36](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/RepoUtils.ts#L36)
|
|
100
100
|
|
|
101
101
|
Indicates if a telemetry event should be broadcast for the request.
|
|
102
102
|
|
|
@@ -108,9 +108,9 @@ Indicates if a telemetry event should be broadcast for the request.
|
|
|
108
108
|
|
|
109
109
|
### req?
|
|
110
110
|
|
|
111
|
-
> `optional` **req?**: `HttpRequest`
|
|
111
|
+
> `optional` **req?**: [`HttpRequest`](HttpRequest.md)
|
|
112
112
|
|
|
113
|
-
Defined in: [src/routes/ModelRoute.ts:27](https://github.com/rapidrest/service-core/blob/
|
|
113
|
+
Defined in: [src/routes/ModelRoute.ts:27](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/routes/ModelRoute.ts#L27)
|
|
114
114
|
|
|
115
115
|
The originating client request.
|
|
116
116
|
|
|
@@ -122,9 +122,9 @@ The originating client request.
|
|
|
122
122
|
|
|
123
123
|
### res?
|
|
124
124
|
|
|
125
|
-
> `optional` **res?**: `HttpResponse`
|
|
125
|
+
> `optional` **res?**: [`HttpResponse`](HttpResponse.md)
|
|
126
126
|
|
|
127
|
-
Defined in: [src/routes/ModelRoute.ts:29](https://github.com/rapidrest/service-core/blob/
|
|
127
|
+
Defined in: [src/routes/ModelRoute.ts:29](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/routes/ModelRoute.ts#L29)
|
|
128
128
|
|
|
129
129
|
The outgoing client response.
|
|
130
130
|
|
|
@@ -138,7 +138,7 @@ The outgoing client response.
|
|
|
138
138
|
|
|
139
139
|
> `optional` **skipPush?**: `boolean`
|
|
140
140
|
|
|
141
|
-
Defined in: [src/routes/ModelRoute.ts:80](https://github.com/rapidrest/service-core/blob/
|
|
141
|
+
Defined in: [src/routes/ModelRoute.ts:80](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/routes/ModelRoute.ts#L80)
|
|
142
142
|
|
|
143
143
|
Set to `true` to not send a push notification.
|
|
144
144
|
|
|
@@ -152,7 +152,7 @@ Set to `true` to not send a push notification.
|
|
|
152
152
|
|
|
153
153
|
> `optional` **user?**: `JWTUser`
|
|
154
154
|
|
|
155
|
-
Defined in: [src/models/RepoUtils.ts:40](https://github.com/rapidrest/service-core/blob/
|
|
155
|
+
Defined in: [src/models/RepoUtils.ts:40](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/RepoUtils.ts#L40)
|
|
156
156
|
|
|
157
157
|
The authenticated user making the request.
|
|
158
158
|
|
|
@@ -166,7 +166,7 @@ The authenticated user making the request.
|
|
|
166
166
|
|
|
167
167
|
> `optional` **version?**: `string` \| `number`
|
|
168
168
|
|
|
169
|
-
Defined in: [src/routes/ModelRoute.ts:56](https://github.com/rapidrest/service-core/blob/
|
|
169
|
+
Defined in: [src/routes/ModelRoute.ts:56](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/routes/ModelRoute.ts#L56)
|
|
170
170
|
|
|
171
171
|
The desired version number of the resource to delete.
|
|
172
172
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: UpdateRequestOptions\<T\>
|
|
8
8
|
|
|
9
|
-
Defined in: [src/routes/ModelRoute.ts:89](https://github.com/rapidrest/service-core/blob/
|
|
9
|
+
Defined in: [src/routes/ModelRoute.ts:89](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/routes/ModelRoute.ts#L89)
|
|
10
10
|
|
|
11
11
|
The set of options required by update request handlers.
|
|
12
12
|
|
|
@@ -26,7 +26,7 @@ The set of options required by update request handlers.
|
|
|
26
26
|
|
|
27
27
|
> `optional` **existing?**: `T` \| `null`
|
|
28
28
|
|
|
29
|
-
Defined in: [src/routes/ModelRoute.ts:91](https://github.com/rapidrest/service-core/blob/
|
|
29
|
+
Defined in: [src/routes/ModelRoute.ts:91](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/routes/ModelRoute.ts#L91)
|
|
30
30
|
|
|
31
31
|
The existing object that has already been recently pulled from the datastore.
|
|
32
32
|
|
|
@@ -36,7 +36,7 @@ The existing object that has already been recently pulled from the datastore.
|
|
|
36
36
|
|
|
37
37
|
> `optional` **ignoreACL?**: `boolean`
|
|
38
38
|
|
|
39
|
-
Defined in: [src/models/RepoUtils.ts:32](https://github.com/rapidrest/service-core/blob/
|
|
39
|
+
Defined in: [src/models/RepoUtils.ts:32](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/RepoUtils.ts#L32)
|
|
40
40
|
|
|
41
41
|
Set to `true` to ignore the ACL permissions check.
|
|
42
42
|
|
|
@@ -50,7 +50,7 @@ Set to `true` to ignore the ACL permissions check.
|
|
|
50
50
|
|
|
51
51
|
> `optional` **productUid?**: `string`
|
|
52
52
|
|
|
53
|
-
Defined in: [src/routes/ModelRoute.ts:93](https://github.com/rapidrest/service-core/blob/
|
|
53
|
+
Defined in: [src/routes/ModelRoute.ts:93](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/routes/ModelRoute.ts#L93)
|
|
54
54
|
|
|
55
55
|
The desired product uid of the resource to update.
|
|
56
56
|
|
|
@@ -60,7 +60,7 @@ The desired product uid of the resource to update.
|
|
|
60
60
|
|
|
61
61
|
> `optional` **pushChannels?**: `string`[]
|
|
62
62
|
|
|
63
|
-
Defined in: [src/routes/ModelRoute.ts:95](https://github.com/rapidrest/service-core/blob/
|
|
63
|
+
Defined in: [src/routes/ModelRoute.ts:95](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/routes/ModelRoute.ts#L95)
|
|
64
64
|
|
|
65
65
|
An additional list of channel names to send push notifications to.
|
|
66
66
|
|
|
@@ -74,7 +74,7 @@ An additional list of channel names to send push notifications to.
|
|
|
74
74
|
|
|
75
75
|
> `optional` **recordEvent?**: `boolean`
|
|
76
76
|
|
|
77
|
-
Defined in: [src/models/RepoUtils.ts:36](https://github.com/rapidrest/service-core/blob/
|
|
77
|
+
Defined in: [src/models/RepoUtils.ts:36](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/RepoUtils.ts#L36)
|
|
78
78
|
|
|
79
79
|
Indicates if a telemetry event should be broadcast for the request.
|
|
80
80
|
|
|
@@ -86,9 +86,9 @@ Indicates if a telemetry event should be broadcast for the request.
|
|
|
86
86
|
|
|
87
87
|
### req?
|
|
88
88
|
|
|
89
|
-
> `optional` **req?**: `HttpRequest`
|
|
89
|
+
> `optional` **req?**: [`HttpRequest`](HttpRequest.md)
|
|
90
90
|
|
|
91
|
-
Defined in: [src/routes/ModelRoute.ts:27](https://github.com/rapidrest/service-core/blob/
|
|
91
|
+
Defined in: [src/routes/ModelRoute.ts:27](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/routes/ModelRoute.ts#L27)
|
|
92
92
|
|
|
93
93
|
The originating client request.
|
|
94
94
|
|
|
@@ -100,9 +100,9 @@ The originating client request.
|
|
|
100
100
|
|
|
101
101
|
### res?
|
|
102
102
|
|
|
103
|
-
> `optional` **res?**: `HttpResponse`
|
|
103
|
+
> `optional` **res?**: [`HttpResponse`](HttpResponse.md)
|
|
104
104
|
|
|
105
|
-
Defined in: [src/routes/ModelRoute.ts:29](https://github.com/rapidrest/service-core/blob/
|
|
105
|
+
Defined in: [src/routes/ModelRoute.ts:29](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/routes/ModelRoute.ts#L29)
|
|
106
106
|
|
|
107
107
|
The outgoing client response.
|
|
108
108
|
|
|
@@ -116,7 +116,7 @@ The outgoing client response.
|
|
|
116
116
|
|
|
117
117
|
> `optional` **skipPush?**: `boolean`
|
|
118
118
|
|
|
119
|
-
Defined in: [src/routes/ModelRoute.ts:97](https://github.com/rapidrest/service-core/blob/
|
|
119
|
+
Defined in: [src/routes/ModelRoute.ts:97](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/routes/ModelRoute.ts#L97)
|
|
120
120
|
|
|
121
121
|
Set to `true` to not send a push notification.
|
|
122
122
|
|
|
@@ -130,7 +130,7 @@ Set to `true` to not send a push notification.
|
|
|
130
130
|
|
|
131
131
|
> `optional` **user?**: `JWTUser`
|
|
132
132
|
|
|
133
|
-
Defined in: [src/models/RepoUtils.ts:40](https://github.com/rapidrest/service-core/blob/
|
|
133
|
+
Defined in: [src/models/RepoUtils.ts:40](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/RepoUtils.ts#L40)
|
|
134
134
|
|
|
135
135
|
The authenticated user making the request.
|
|
136
136
|
|
|
@@ -144,6 +144,6 @@ The authenticated user making the request.
|
|
|
144
144
|
|
|
145
145
|
> `optional` **version?**: `string` \| `number`
|
|
146
146
|
|
|
147
|
-
Defined in: [src/routes/ModelRoute.ts:99](https://github.com/rapidrest/service-core/blob/
|
|
147
|
+
Defined in: [src/routes/ModelRoute.ts:99](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/routes/ModelRoute.ts#L99)
|
|
148
148
|
|
|
149
149
|
The desired version number of the resource to update.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
[**@rapidrest/service-core**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@rapidrest/service-core](../globals.md) / ErrorHandler
|
|
6
|
+
|
|
7
|
+
# Type Alias: ErrorHandler
|
|
8
|
+
|
|
9
|
+
> **ErrorHandler** = (`err`, `req`, `res`, `next`) => `void` \| `Promise`\<`void`\>
|
|
10
|
+
|
|
11
|
+
Defined in: [src/http/types.ts:60](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/http/types.ts#L60)
|
|
12
|
+
|
|
13
|
+
Standard 4-param error-handling middleware function.
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### err
|
|
18
|
+
|
|
19
|
+
`any`
|
|
20
|
+
|
|
21
|
+
### req
|
|
22
|
+
|
|
23
|
+
[`HttpRequest`](../interfaces/HttpRequest.md)
|
|
24
|
+
|
|
25
|
+
### res
|
|
26
|
+
|
|
27
|
+
[`HttpResponse`](../interfaces/HttpResponse.md)
|
|
28
|
+
|
|
29
|
+
### next
|
|
30
|
+
|
|
31
|
+
[`NextFunction`](NextFunction.md)
|
|
32
|
+
|
|
33
|
+
## Returns
|
|
34
|
+
|
|
35
|
+
`void` \| `Promise`\<`void`\>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
[**@rapidrest/service-core**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@rapidrest/service-core](../globals.md) / NextFunction
|
|
6
|
+
|
|
7
|
+
# Type Alias: NextFunction
|
|
8
|
+
|
|
9
|
+
> **NextFunction** = (`err?`) => `void`
|
|
10
|
+
|
|
11
|
+
Defined in: [src/http/types.ts:54](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/http/types.ts#L54)
|
|
12
|
+
|
|
13
|
+
Standard Express-style next callback. Pass an error to trigger error handlers.
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### err?
|
|
18
|
+
|
|
19
|
+
`any`
|
|
20
|
+
|
|
21
|
+
## Returns
|
|
22
|
+
|
|
23
|
+
`void`
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **OneOrMany**\<`T`\> = `T` \| `T`[]
|
|
10
10
|
|
|
11
|
-
Defined in: [src/Types.ts:4](https://github.com/rapidrest/service-core/blob/
|
|
11
|
+
Defined in: [src/Types.ts:4](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/Types.ts#L4)
|
|
12
12
|
|
|
13
13
|
Provides an explicit type declaration for `T | T[]`.
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **OneOrNull**\<`T`\> = `T` \| `null`
|
|
10
10
|
|
|
11
|
-
Defined in: [src/Types.ts:9](https://github.com/rapidrest/service-core/blob/
|
|
11
|
+
Defined in: [src/Types.ts:9](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/Types.ts#L9)
|
|
12
12
|
|
|
13
13
|
Provides an explicit type declaration for `T | null`.
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **PartialBaseEntity**\<`T`\> = `Partial`\<`T`\> & `Pick`\<`T`, `"uid"`\> & `Pick`\<`T`, `"version"`\>
|
|
10
10
|
|
|
11
|
-
Defined in: [src/models/BaseEntity.ts:68](https://github.com/rapidrest/service-core/blob/
|
|
11
|
+
Defined in: [src/models/BaseEntity.ts:68](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/BaseEntity.ts#L68)
|
|
12
12
|
|
|
13
13
|
## Type Parameters
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **PartialSimpleEntity**\<`T`\> = `Partial`\<`T`\> & `Pick`\<`T`, `"uid"`\>
|
|
10
10
|
|
|
11
|
-
Defined in: [src/models/SimpleEntity.ts:33](https://github.com/rapidrest/service-core/blob/
|
|
11
|
+
Defined in: [src/models/SimpleEntity.ts:33](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/models/SimpleEntity.ts#L33)
|
|
12
12
|
|
|
13
13
|
## Type Parameters
|
|
14
14
|
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
[**@rapidrest/service-core**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@rapidrest/service-core](../globals.md) / RequestHandler
|
|
6
|
+
|
|
7
|
+
# Type Alias: RequestHandler
|
|
8
|
+
|
|
9
|
+
> **RequestHandler** = (`req`, `res`, `next`) => `void` \| `Promise`\<`void`\>
|
|
10
|
+
|
|
11
|
+
Defined in: [src/http/types.ts:57](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/http/types.ts#L57)
|
|
12
|
+
|
|
13
|
+
Standard 3-param middleware function.
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### req
|
|
18
|
+
|
|
19
|
+
[`HttpRequest`](../interfaces/HttpRequest.md)
|
|
20
|
+
|
|
21
|
+
### res
|
|
22
|
+
|
|
23
|
+
[`HttpResponse`](../interfaces/HttpResponse.md)
|
|
24
|
+
|
|
25
|
+
### next
|
|
26
|
+
|
|
27
|
+
[`NextFunction`](NextFunction.md)
|
|
28
|
+
|
|
29
|
+
## Returns
|
|
30
|
+
|
|
31
|
+
`void` \| `Promise`\<`void`\>
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **UpdateObject**\<`T`\> = `Partial`\<`T`\> & `Pick`\<`T`, `"uid"`\>
|
|
10
10
|
|
|
11
|
-
Defined in: [src/routes/ModelRoute.ts:84](https://github.com/rapidrest/service-core/blob/
|
|
11
|
+
Defined in: [src/routes/ModelRoute.ts:84](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/routes/ModelRoute.ts#L84)
|
|
12
12
|
|
|
13
13
|
A Partial type for a BaseEntity or SimpleEntity.
|
|
14
14
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
[**@rapidrest/service-core**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@rapidrest/service-core](../globals.md) / WsUpgradeAuth
|
|
6
|
+
|
|
7
|
+
# Type Alias: WsUpgradeAuth
|
|
8
|
+
|
|
9
|
+
> **WsUpgradeAuth** = (`req`) => [`WsUpgradeAuthResult`](WsUpgradeAuthResult.md)
|
|
10
|
+
|
|
11
|
+
Defined in: [src/http/Router.ts:142](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/http/Router.ts#L142)
|
|
12
|
+
|
|
13
|
+
Optional pre-upgrade auth function for WebSocket routes. Called synchronously inside the uWS
|
|
14
|
+
`upgrade` callback — before the WebSocket handshake completes. Returning `{ reject: true }`
|
|
15
|
+
sends an HTTP 401 and skips the upgrade entirely. Returning `{}` falls through to the
|
|
16
|
+
post-upgrade message-based LOGIN flow. Returning `{ user, ... }` pre-authenticates the
|
|
17
|
+
connection so clients that can send an Authorization header skip the LOGIN step.
|
|
18
|
+
|
|
19
|
+
## Parameters
|
|
20
|
+
|
|
21
|
+
### req
|
|
22
|
+
|
|
23
|
+
[`HttpRequest`](../interfaces/HttpRequest.md)
|
|
24
|
+
|
|
25
|
+
## Returns
|
|
26
|
+
|
|
27
|
+
[`WsUpgradeAuthResult`](WsUpgradeAuthResult.md)
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
[**@rapidrest/service-core**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@rapidrest/service-core](../globals.md) / WsUpgradeAuthResult
|
|
6
|
+
|
|
7
|
+
# Type Alias: WsUpgradeAuthResult
|
|
8
|
+
|
|
9
|
+
> **WsUpgradeAuthResult** = `object`
|
|
10
|
+
|
|
11
|
+
Defined in: [src/http/Router.ts:127](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/http/Router.ts#L127)
|
|
12
|
+
|
|
13
|
+
Result returned by a pre-upgrade WebSocket auth function.
|
|
14
|
+
|
|
15
|
+
## Properties
|
|
16
|
+
|
|
17
|
+
### authPayload?
|
|
18
|
+
|
|
19
|
+
> `optional` **authPayload?**: `any`
|
|
20
|
+
|
|
21
|
+
Defined in: [src/http/Router.ts:129](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/http/Router.ts#L129)
|
|
22
|
+
|
|
23
|
+
***
|
|
24
|
+
|
|
25
|
+
### authToken?
|
|
26
|
+
|
|
27
|
+
> `optional` **authToken?**: `string`
|
|
28
|
+
|
|
29
|
+
Defined in: [src/http/Router.ts:130](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/http/Router.ts#L130)
|
|
30
|
+
|
|
31
|
+
***
|
|
32
|
+
|
|
33
|
+
### reject?
|
|
34
|
+
|
|
35
|
+
> `optional` **reject?**: `boolean`
|
|
36
|
+
|
|
37
|
+
Defined in: [src/http/Router.ts:132](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/http/Router.ts#L132)
|
|
38
|
+
|
|
39
|
+
Set to `true` to reject the connection with HTTP 401 before the WebSocket handshake.
|
|
40
|
+
|
|
41
|
+
***
|
|
42
|
+
|
|
43
|
+
### user?
|
|
44
|
+
|
|
45
|
+
> `optional` **user?**: `any`
|
|
46
|
+
|
|
47
|
+
Defined in: [src/http/Router.ts:128](https://github.com/rapidrest/service-core/blob/5cd5bc79b3569101eabf54dec613fd4745a69b2b/src/http/Router.ts#L128)
|