@twin.org/api-processors 0.0.1-next.17 → 0.0.1-next.19
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/cjs/index.cjs +24 -0
- package/dist/esm/index.mjs +24 -0
- package/dist/types/data/restRouteProcessor.d.ts +4 -0
- package/dist/types/data/socketRouteProcessor.d.ts +4 -0
- package/dist/types/identity/nodeIdentityProcessor.d.ts +4 -0
- package/dist/types/identity/staticUserIdentityProcessor.d.ts +4 -0
- package/dist/types/logging/loggingProcessor.d.ts +4 -0
- package/dist/types/mimeType/jwtMimeTypeProcessor.d.ts +4 -0
- package/docs/changelog.md +1 -1
- package/docs/reference/classes/JwtMimeTypeProcessor.md +8 -0
- package/docs/reference/classes/LoggingProcessor.md +8 -0
- package/docs/reference/classes/NodeIdentityProcessor.md +8 -0
- package/docs/reference/classes/RestRouteProcessor.md +8 -0
- package/docs/reference/classes/SocketRouteProcessor.md +8 -0
- package/docs/reference/classes/StaticUserIdentityProcessor.md +8 -0
- package/package.json +2 -2
package/dist/cjs/index.cjs
CHANGED
|
@@ -11,6 +11,10 @@ var loggingModels = require('@twin.org/logging-models');
|
|
|
11
11
|
* Process the REST request and hands it on to the route handler.
|
|
12
12
|
*/
|
|
13
13
|
class RestRouteProcessor {
|
|
14
|
+
/**
|
|
15
|
+
* The namespace supported by the processor.
|
|
16
|
+
*/
|
|
17
|
+
static NAMESPACE = "rest-route";
|
|
14
18
|
/**
|
|
15
19
|
* Runtime name for the class.
|
|
16
20
|
*/
|
|
@@ -118,6 +122,10 @@ class RestRouteProcessor {
|
|
|
118
122
|
* Process the socket request and hands it on to the route handler.
|
|
119
123
|
*/
|
|
120
124
|
class SocketRouteProcessor {
|
|
125
|
+
/**
|
|
126
|
+
* The namespace supported by the processor.
|
|
127
|
+
*/
|
|
128
|
+
static NAMESPACE = "socket-route";
|
|
121
129
|
/**
|
|
122
130
|
* Runtime name for the class.
|
|
123
131
|
*/
|
|
@@ -190,6 +198,10 @@ class SocketRouteProcessor {
|
|
|
190
198
|
* Adds a node identity to the request identity.
|
|
191
199
|
*/
|
|
192
200
|
class NodeIdentityProcessor {
|
|
201
|
+
/**
|
|
202
|
+
* The namespace supported by the processor.
|
|
203
|
+
*/
|
|
204
|
+
static NAMESPACE = "node-identity";
|
|
193
205
|
/**
|
|
194
206
|
* Runtime name for the class.
|
|
195
207
|
*/
|
|
@@ -226,6 +238,10 @@ class NodeIdentityProcessor {
|
|
|
226
238
|
* Adds a static user identity to the request context.
|
|
227
239
|
*/
|
|
228
240
|
class StaticUserIdentityProcessor {
|
|
241
|
+
/**
|
|
242
|
+
* The namespace supported by the processor.
|
|
243
|
+
*/
|
|
244
|
+
static NAMESPACE = "static-user-identity";
|
|
229
245
|
/**
|
|
230
246
|
* Runtime name for the class.
|
|
231
247
|
*/
|
|
@@ -266,6 +282,10 @@ class StaticUserIdentityProcessor {
|
|
|
266
282
|
* Process the REST request and log its information.
|
|
267
283
|
*/
|
|
268
284
|
class LoggingProcessor {
|
|
285
|
+
/**
|
|
286
|
+
* The namespace supported by the processor.
|
|
287
|
+
*/
|
|
288
|
+
static NAMESPACE = "logging";
|
|
269
289
|
/**
|
|
270
290
|
* Runtime name for the class.
|
|
271
291
|
*/
|
|
@@ -410,6 +430,10 @@ class LoggingProcessor {
|
|
|
410
430
|
* Process the REST request and log its information.
|
|
411
431
|
*/
|
|
412
432
|
class JwtMimeTypeProcessor {
|
|
433
|
+
/**
|
|
434
|
+
* The namespace supported by the processor.
|
|
435
|
+
*/
|
|
436
|
+
static NAMESPACE = "jwt";
|
|
413
437
|
/**
|
|
414
438
|
* Get the MIME types that this handler can handle.
|
|
415
439
|
* @returns The MIME types that this handler can handle.
|
package/dist/esm/index.mjs
CHANGED
|
@@ -9,6 +9,10 @@ import { LoggingConnectorFactory } from '@twin.org/logging-models';
|
|
|
9
9
|
* Process the REST request and hands it on to the route handler.
|
|
10
10
|
*/
|
|
11
11
|
class RestRouteProcessor {
|
|
12
|
+
/**
|
|
13
|
+
* The namespace supported by the processor.
|
|
14
|
+
*/
|
|
15
|
+
static NAMESPACE = "rest-route";
|
|
12
16
|
/**
|
|
13
17
|
* Runtime name for the class.
|
|
14
18
|
*/
|
|
@@ -116,6 +120,10 @@ class RestRouteProcessor {
|
|
|
116
120
|
* Process the socket request and hands it on to the route handler.
|
|
117
121
|
*/
|
|
118
122
|
class SocketRouteProcessor {
|
|
123
|
+
/**
|
|
124
|
+
* The namespace supported by the processor.
|
|
125
|
+
*/
|
|
126
|
+
static NAMESPACE = "socket-route";
|
|
119
127
|
/**
|
|
120
128
|
* Runtime name for the class.
|
|
121
129
|
*/
|
|
@@ -188,6 +196,10 @@ class SocketRouteProcessor {
|
|
|
188
196
|
* Adds a node identity to the request identity.
|
|
189
197
|
*/
|
|
190
198
|
class NodeIdentityProcessor {
|
|
199
|
+
/**
|
|
200
|
+
* The namespace supported by the processor.
|
|
201
|
+
*/
|
|
202
|
+
static NAMESPACE = "node-identity";
|
|
191
203
|
/**
|
|
192
204
|
* Runtime name for the class.
|
|
193
205
|
*/
|
|
@@ -224,6 +236,10 @@ class NodeIdentityProcessor {
|
|
|
224
236
|
* Adds a static user identity to the request context.
|
|
225
237
|
*/
|
|
226
238
|
class StaticUserIdentityProcessor {
|
|
239
|
+
/**
|
|
240
|
+
* The namespace supported by the processor.
|
|
241
|
+
*/
|
|
242
|
+
static NAMESPACE = "static-user-identity";
|
|
227
243
|
/**
|
|
228
244
|
* Runtime name for the class.
|
|
229
245
|
*/
|
|
@@ -264,6 +280,10 @@ class StaticUserIdentityProcessor {
|
|
|
264
280
|
* Process the REST request and log its information.
|
|
265
281
|
*/
|
|
266
282
|
class LoggingProcessor {
|
|
283
|
+
/**
|
|
284
|
+
* The namespace supported by the processor.
|
|
285
|
+
*/
|
|
286
|
+
static NAMESPACE = "logging";
|
|
267
287
|
/**
|
|
268
288
|
* Runtime name for the class.
|
|
269
289
|
*/
|
|
@@ -408,6 +428,10 @@ class LoggingProcessor {
|
|
|
408
428
|
* Process the REST request and log its information.
|
|
409
429
|
*/
|
|
410
430
|
class JwtMimeTypeProcessor {
|
|
431
|
+
/**
|
|
432
|
+
* The namespace supported by the processor.
|
|
433
|
+
*/
|
|
434
|
+
static NAMESPACE = "jwt";
|
|
411
435
|
/**
|
|
412
436
|
* Get the MIME types that this handler can handle.
|
|
413
437
|
* @returns The MIME types that this handler can handle.
|
|
@@ -4,6 +4,10 @@ import type { IRouteProcessorConfig } from "../models/IRouteProcessorConfig";
|
|
|
4
4
|
* Process the REST request and hands it on to the route handler.
|
|
5
5
|
*/
|
|
6
6
|
export declare class RestRouteProcessor implements IRestRouteProcessor {
|
|
7
|
+
/**
|
|
8
|
+
* The namespace supported by the processor.
|
|
9
|
+
*/
|
|
10
|
+
static readonly NAMESPACE: string;
|
|
7
11
|
/**
|
|
8
12
|
* Runtime name for the class.
|
|
9
13
|
*/
|
|
@@ -4,6 +4,10 @@ import type { IRouteProcessorConfig } from "../models/IRouteProcessorConfig";
|
|
|
4
4
|
* Process the socket request and hands it on to the route handler.
|
|
5
5
|
*/
|
|
6
6
|
export declare class SocketRouteProcessor implements ISocketRouteProcessor {
|
|
7
|
+
/**
|
|
8
|
+
* The namespace supported by the processor.
|
|
9
|
+
*/
|
|
10
|
+
static readonly NAMESPACE: string;
|
|
7
11
|
/**
|
|
8
12
|
* Runtime name for the class.
|
|
9
13
|
*/
|
|
@@ -3,6 +3,10 @@ import type { IBaseRoute, IBaseRouteProcessor, IHttpRequestIdentity, IHttpRespon
|
|
|
3
3
|
* Adds a node identity to the request identity.
|
|
4
4
|
*/
|
|
5
5
|
export declare class NodeIdentityProcessor implements IBaseRouteProcessor {
|
|
6
|
+
/**
|
|
7
|
+
* The namespace supported by the processor.
|
|
8
|
+
*/
|
|
9
|
+
static readonly NAMESPACE: string;
|
|
6
10
|
/**
|
|
7
11
|
* Runtime name for the class.
|
|
8
12
|
*/
|
|
@@ -4,6 +4,10 @@ import type { IStaticUserIdentityProcessorConfig } from "../models/IStaticUserId
|
|
|
4
4
|
* Adds a static user identity to the request context.
|
|
5
5
|
*/
|
|
6
6
|
export declare class StaticUserIdentityProcessor implements IBaseRouteProcessor {
|
|
7
|
+
/**
|
|
8
|
+
* The namespace supported by the processor.
|
|
9
|
+
*/
|
|
10
|
+
static readonly NAMESPACE: string;
|
|
7
11
|
/**
|
|
8
12
|
* Runtime name for the class.
|
|
9
13
|
*/
|
|
@@ -4,6 +4,10 @@ import type { ILoggingProcessorConfig } from "../models/ILoggingProcessorConfig"
|
|
|
4
4
|
* Process the REST request and log its information.
|
|
5
5
|
*/
|
|
6
6
|
export declare class LoggingProcessor implements IBaseRouteProcessor {
|
|
7
|
+
/**
|
|
8
|
+
* The namespace supported by the processor.
|
|
9
|
+
*/
|
|
10
|
+
static readonly NAMESPACE: string;
|
|
7
11
|
/**
|
|
8
12
|
* Runtime name for the class.
|
|
9
13
|
*/
|
|
@@ -3,6 +3,10 @@ import type { IMimeTypeProcessor } from "@twin.org/api-models";
|
|
|
3
3
|
* Process the REST request and log its information.
|
|
4
4
|
*/
|
|
5
5
|
export declare class JwtMimeTypeProcessor implements IMimeTypeProcessor {
|
|
6
|
+
/**
|
|
7
|
+
* The namespace supported by the processor.
|
|
8
|
+
*/
|
|
9
|
+
static readonly NAMESPACE: string;
|
|
6
10
|
/**
|
|
7
11
|
* Get the MIME types that this handler can handle.
|
|
8
12
|
* @returns The MIME types that this handler can handle.
|
package/docs/changelog.md
CHANGED
|
@@ -16,6 +16,14 @@ Process the REST request and log its information.
|
|
|
16
16
|
|
|
17
17
|
[`JwtMimeTypeProcessor`](JwtMimeTypeProcessor.md)
|
|
18
18
|
|
|
19
|
+
## Properties
|
|
20
|
+
|
|
21
|
+
### NAMESPACE
|
|
22
|
+
|
|
23
|
+
> `readonly` `static` **NAMESPACE**: `string` = `"jwt"`
|
|
24
|
+
|
|
25
|
+
The namespace supported by the processor.
|
|
26
|
+
|
|
19
27
|
## Methods
|
|
20
28
|
|
|
21
29
|
### getTypes()
|
|
@@ -36,6 +36,14 @@ Promise that resolves when the processor is initialized.
|
|
|
36
36
|
|
|
37
37
|
## Properties
|
|
38
38
|
|
|
39
|
+
### NAMESPACE
|
|
40
|
+
|
|
41
|
+
> `readonly` `static` **NAMESPACE**: `string` = `"logging"`
|
|
42
|
+
|
|
43
|
+
The namespace supported by the processor.
|
|
44
|
+
|
|
45
|
+
***
|
|
46
|
+
|
|
39
47
|
### CLASS\_NAME
|
|
40
48
|
|
|
41
49
|
> `readonly` **CLASS\_NAME**: `string`
|
|
@@ -18,6 +18,14 @@ Adds a node identity to the request identity.
|
|
|
18
18
|
|
|
19
19
|
## Properties
|
|
20
20
|
|
|
21
|
+
### NAMESPACE
|
|
22
|
+
|
|
23
|
+
> `readonly` `static` **NAMESPACE**: `string` = `"node-identity"`
|
|
24
|
+
|
|
25
|
+
The namespace supported by the processor.
|
|
26
|
+
|
|
27
|
+
***
|
|
28
|
+
|
|
21
29
|
### CLASS\_NAME
|
|
22
30
|
|
|
23
31
|
> `readonly` **CLASS\_NAME**: `string`
|
|
@@ -32,6 +32,14 @@ Promise that resolves when the processor is initialized.
|
|
|
32
32
|
|
|
33
33
|
## Properties
|
|
34
34
|
|
|
35
|
+
### NAMESPACE
|
|
36
|
+
|
|
37
|
+
> `readonly` `static` **NAMESPACE**: `string` = `"rest-route"`
|
|
38
|
+
|
|
39
|
+
The namespace supported by the processor.
|
|
40
|
+
|
|
41
|
+
***
|
|
42
|
+
|
|
35
43
|
### CLASS\_NAME
|
|
36
44
|
|
|
37
45
|
> `readonly` **CLASS\_NAME**: `string`
|
|
@@ -32,6 +32,14 @@ Promise that resolves when the processor is initialized.
|
|
|
32
32
|
|
|
33
33
|
## Properties
|
|
34
34
|
|
|
35
|
+
### NAMESPACE
|
|
36
|
+
|
|
37
|
+
> `readonly` `static` **NAMESPACE**: `string` = `"socket-route"`
|
|
38
|
+
|
|
39
|
+
The namespace supported by the processor.
|
|
40
|
+
|
|
41
|
+
***
|
|
42
|
+
|
|
35
43
|
### CLASS\_NAME
|
|
36
44
|
|
|
37
45
|
> `readonly` **CLASS\_NAME**: `string`
|
|
@@ -32,6 +32,14 @@ Promise that resolves when the processor is initialized.
|
|
|
32
32
|
|
|
33
33
|
## Properties
|
|
34
34
|
|
|
35
|
+
### NAMESPACE
|
|
36
|
+
|
|
37
|
+
> `readonly` `static` **NAMESPACE**: `string` = `"static-user-identity"`
|
|
38
|
+
|
|
39
|
+
The namespace supported by the processor.
|
|
40
|
+
|
|
41
|
+
***
|
|
42
|
+
|
|
35
43
|
### CLASS\_NAME
|
|
36
44
|
|
|
37
45
|
> `readonly` **CLASS\_NAME**: `string`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/api-processors",
|
|
3
|
-
"version": "0.0.1-next.
|
|
3
|
+
"version": "0.0.1-next.19",
|
|
4
4
|
"description": "Route processors for use with API servers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"node": ">=20.0.0"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@twin.org/api-models": "0.0.1-next.
|
|
17
|
+
"@twin.org/api-models": "0.0.1-next.19",
|
|
18
18
|
"@twin.org/core": "next",
|
|
19
19
|
"@twin.org/entity": "next",
|
|
20
20
|
"@twin.org/entity-storage-models": "next",
|