@twin.org/api-processors 0.0.2-next.8 → 0.0.3-next.1

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.
Files changed (73) hide show
  1. package/dist/es/data/restRouteProcessor.js +115 -0
  2. package/dist/es/data/restRouteProcessor.js.map +1 -0
  3. package/dist/es/data/socketRouteProcessor.js +126 -0
  4. package/dist/es/data/socketRouteProcessor.js.map +1 -0
  5. package/dist/es/identity/contextIdProcessor.js +68 -0
  6. package/dist/es/identity/contextIdProcessor.js.map +1 -0
  7. package/dist/es/identity/staticContextIdProcessor.js +59 -0
  8. package/dist/es/identity/staticContextIdProcessor.js.map +1 -0
  9. package/dist/es/index.js +19 -0
  10. package/dist/es/index.js.map +1 -0
  11. package/dist/es/logging/loggingProcessor.js +177 -0
  12. package/dist/es/logging/loggingProcessor.js.map +1 -0
  13. package/dist/es/mimeType/jsonLdMimeTypeProcessor.js +38 -0
  14. package/dist/es/mimeType/jsonLdMimeTypeProcessor.js.map +1 -0
  15. package/dist/es/mimeType/jwtMimeTypeProcessor.js +34 -0
  16. package/dist/es/mimeType/jwtMimeTypeProcessor.js.map +1 -0
  17. package/dist/es/models/IContextIdProcessorConfig.js +4 -0
  18. package/dist/es/models/IContextIdProcessorConfig.js.map +1 -0
  19. package/dist/es/models/IContextIdProcessorConstructorOptions.js +2 -0
  20. package/dist/es/models/IContextIdProcessorConstructorOptions.js.map +1 -0
  21. package/dist/es/models/ILoggingProcessorConfig.js +4 -0
  22. package/dist/es/models/ILoggingProcessorConfig.js.map +1 -0
  23. package/dist/es/models/ILoggingProcessorConstructorOptions.js +2 -0
  24. package/dist/es/models/ILoggingProcessorConstructorOptions.js.map +1 -0
  25. package/dist/es/models/IRestRouteProcessorConstructorOptions.js +2 -0
  26. package/dist/es/models/IRestRouteProcessorConstructorOptions.js.map +1 -0
  27. package/dist/es/models/IRouteProcessorConfig.js +4 -0
  28. package/dist/es/models/IRouteProcessorConfig.js.map +1 -0
  29. package/dist/es/models/ISocketRouteProcessorConstructorOptions.js +2 -0
  30. package/dist/es/models/ISocketRouteProcessorConstructorOptions.js.map +1 -0
  31. package/dist/es/models/IStaticContextIdProcessorConfig.js +4 -0
  32. package/dist/es/models/IStaticContextIdProcessorConfig.js.map +1 -0
  33. package/dist/es/models/IStaticContextIdProcessorConstructorOptions.js +2 -0
  34. package/dist/es/models/IStaticContextIdProcessorConstructorOptions.js.map +1 -0
  35. package/dist/types/data/restRouteProcessor.d.ts +9 -5
  36. package/dist/types/data/socketRouteProcessor.d.ts +10 -6
  37. package/dist/types/identity/contextIdProcessor.d.ts +39 -0
  38. package/dist/types/identity/staticContextIdProcessor.d.ts +33 -0
  39. package/dist/types/index.d.ts +16 -14
  40. package/dist/types/logging/loggingProcessor.d.ts +13 -7
  41. package/dist/types/mimeType/jsonLdMimeTypeProcessor.d.ts +6 -1
  42. package/dist/types/mimeType/jwtMimeTypeProcessor.d.ts +6 -1
  43. package/dist/types/models/IContextIdProcessorConfig.d.ts +13 -0
  44. package/dist/types/models/IContextIdProcessorConstructorOptions.d.ts +10 -0
  45. package/dist/types/models/ILoggingProcessorConstructorOptions.d.ts +1 -1
  46. package/dist/types/models/IRestRouteProcessorConstructorOptions.d.ts +1 -1
  47. package/dist/types/models/ISocketRouteProcessorConstructorOptions.d.ts +1 -1
  48. package/dist/types/models/IStaticContextIdProcessorConfig.d.ts +17 -0
  49. package/dist/types/models/IStaticContextIdProcessorConstructorOptions.d.ts +10 -0
  50. package/docs/changelog.md +96 -0
  51. package/docs/reference/classes/{NodeIdentityProcessor.md → ContextIdProcessor.md} +37 -19
  52. package/docs/reference/classes/JsonLdMimeTypeProcessor.md +17 -3
  53. package/docs/reference/classes/JwtMimeTypeProcessor.md +17 -3
  54. package/docs/reference/classes/LoggingProcessor.md +27 -13
  55. package/docs/reference/classes/RestRouteProcessor.md +19 -11
  56. package/docs/reference/classes/SocketRouteProcessor.md +22 -14
  57. package/docs/reference/classes/StaticContextIdProcessor.md +99 -0
  58. package/docs/reference/index.md +6 -4
  59. package/docs/reference/interfaces/IContextIdProcessorConfig.md +19 -0
  60. package/docs/reference/interfaces/IContextIdProcessorConstructorOptions.md +11 -0
  61. package/docs/reference/interfaces/IStaticContextIdProcessorConfig.md +27 -0
  62. package/docs/reference/interfaces/IStaticContextIdProcessorConstructorOptions.md +11 -0
  63. package/locales/en.json +0 -5
  64. package/package.json +20 -9
  65. package/dist/cjs/index.cjs +0 -527
  66. package/dist/esm/index.mjs +0 -519
  67. package/dist/types/identity/nodeIdentityProcessor.d.ts +0 -28
  68. package/dist/types/identity/staticUserIdentityProcessor.d.ts +0 -27
  69. package/dist/types/models/IStaticUserIdentityProcessorConfig.d.ts +0 -9
  70. package/dist/types/models/IStaticUserIdentityProcessorConstructorOptions.d.ts +0 -10
  71. package/docs/reference/classes/StaticUserIdentityProcessor.md +0 -85
  72. package/docs/reference/interfaces/IStaticUserIdentityProcessorConfig.md +0 -11
  73. package/docs/reference/interfaces/IStaticUserIdentityProcessorConstructorOptions.md +0 -11
package/docs/changelog.md CHANGED
@@ -1,5 +1,101 @@
1
1
  # @twin.org/api-processors - Changelog
2
2
 
3
+ ## [0.0.3-next.1](https://github.com/twinfoundation/api/compare/api-processors-v0.0.3-next.0...api-processors-v0.0.3-next.1) (2025-11-10)
4
+
5
+
6
+ ### Features
7
+
8
+ * add context id features ([#42](https://github.com/twinfoundation/api/issues/42)) ([0186055](https://github.com/twinfoundation/api/commit/0186055c48afde842a4254b4df9ac9249c40fe40))
9
+ * add json-ld mime type processor and auth admin component ([8861791](https://github.com/twinfoundation/api/commit/88617916e23bfbca023dbae1976fe421983a02ff))
10
+ * add logging component type to request contexts ([210de1b](https://github.com/twinfoundation/api/commit/210de1b9e1c91079b59a2b90ddd57569668d647d))
11
+ * add root, favicon routes ([71da1c3](https://github.com/twinfoundation/api/commit/71da1c3a93c349588aff7084d1d8d6a29a277da8))
12
+ * add socket id, connect and disconnect ([20b0d0e](https://github.com/twinfoundation/api/commit/20b0d0ec279cab46141fee09de2c4a7087cdce16))
13
+ * add validate-locales ([cdba610](https://github.com/twinfoundation/api/commit/cdba610a0acb5022d2e3ce729732e6646a297e5e))
14
+ * eslint migration to flat config ([0dd5820](https://github.com/twinfoundation/api/commit/0dd5820e3af97350fd08b8d226f4a6c1a9246805))
15
+ * logging naming consistency ([a4a6ef2](https://github.com/twinfoundation/api/commit/a4a6ef2de5049045589eb78b177ff62e744bde9d))
16
+ * remove unused namespace ([08478f2](https://github.com/twinfoundation/api/commit/08478f27efda9beb0271fdb22f6972e918361965))
17
+ * update dependencies ([1171dc4](https://github.com/twinfoundation/api/commit/1171dc416a9481737f6a640e3cf30145768f37e9))
18
+ * update framework core ([d8eebf2](https://github.com/twinfoundation/api/commit/d8eebf267fa2a0abaa84e58590496e9d20490cfa))
19
+ * update IComponent signatures ([915ce37](https://github.com/twinfoundation/api/commit/915ce37712326ab4aa6869c350eabaa4622e8430))
20
+ * use shared store mechanism ([#19](https://github.com/twinfoundation/api/issues/19)) ([32116df](https://github.com/twinfoundation/api/commit/32116df3b4380a30137f5056f242a5c99afa2df9))
21
+
22
+
23
+ ### Dependencies
24
+
25
+ * The following workspace dependencies were updated
26
+ * dependencies
27
+ * @twin.org/api-models bumped from 0.0.3-next.0 to 0.0.3-next.1
28
+
29
+ ## [0.0.2-next.13](https://github.com/twinfoundation/api/compare/api-processors-v0.0.2-next.12...api-processors-v0.0.2-next.13) (2025-10-09)
30
+
31
+
32
+ ### Miscellaneous Chores
33
+
34
+ * **api-processors:** Synchronize repo versions
35
+
36
+
37
+ ### Dependencies
38
+
39
+ * The following workspace dependencies were updated
40
+ * dependencies
41
+ * @twin.org/api-models bumped from 0.0.2-next.12 to 0.0.2-next.13
42
+
43
+ ## [0.0.2-next.12](https://github.com/twinfoundation/api/compare/api-processors-v0.0.2-next.11...api-processors-v0.0.2-next.12) (2025-10-09)
44
+
45
+
46
+ ### Features
47
+
48
+ * add validate-locales ([cdba610](https://github.com/twinfoundation/api/commit/cdba610a0acb5022d2e3ce729732e6646a297e5e))
49
+
50
+
51
+ ### Dependencies
52
+
53
+ * The following workspace dependencies were updated
54
+ * dependencies
55
+ * @twin.org/api-models bumped from 0.0.2-next.11 to 0.0.2-next.12
56
+
57
+ ## [0.0.2-next.11](https://github.com/twinfoundation/api/compare/api-processors-v0.0.2-next.10...api-processors-v0.0.2-next.11) (2025-09-29)
58
+
59
+
60
+ ### Features
61
+
62
+ * update IComponent signatures ([915ce37](https://github.com/twinfoundation/api/commit/915ce37712326ab4aa6869c350eabaa4622e8430))
63
+
64
+
65
+ ### Dependencies
66
+
67
+ * The following workspace dependencies were updated
68
+ * dependencies
69
+ * @twin.org/api-models bumped from 0.0.2-next.10 to 0.0.2-next.11
70
+
71
+ ## [0.0.2-next.10](https://github.com/twinfoundation/api/compare/api-processors-v0.0.2-next.9...api-processors-v0.0.2-next.10) (2025-09-23)
72
+
73
+
74
+ ### Miscellaneous Chores
75
+
76
+ * **api-processors:** Synchronize repo versions
77
+
78
+
79
+ ### Dependencies
80
+
81
+ * The following workspace dependencies were updated
82
+ * dependencies
83
+ * @twin.org/api-models bumped from 0.0.2-next.9 to 0.0.2-next.10
84
+
85
+ ## [0.0.2-next.9](https://github.com/twinfoundation/api/compare/api-processors-v0.0.2-next.8...api-processors-v0.0.2-next.9) (2025-08-29)
86
+
87
+
88
+ ### Features
89
+
90
+ * eslint migration to flat config ([0dd5820](https://github.com/twinfoundation/api/commit/0dd5820e3af97350fd08b8d226f4a6c1a9246805))
91
+
92
+
93
+ ### Dependencies
94
+
95
+ * The following workspace dependencies were updated
96
+ * dependencies
97
+ * @twin.org/api-models bumped from 0.0.2-next.8 to 0.0.2-next.9
98
+
3
99
  ## [0.0.2-next.8](https://github.com/twinfoundation/api/compare/api-processors-v0.0.2-next.7...api-processors-v0.0.2-next.8) (2025-08-21)
4
100
 
5
101
 
@@ -1,6 +1,6 @@
1
- # Class: NodeIdentityProcessor
1
+ # Class: ContextIdProcessor
2
2
 
3
- Adds a node identity to the request identity.
3
+ Adds an id to the request context ids.
4
4
 
5
5
  ## Implements
6
6
 
@@ -10,40 +10,58 @@ Adds a node identity to the request identity.
10
10
 
11
11
  ### Constructor
12
12
 
13
- > **new NodeIdentityProcessor**(): `NodeIdentityProcessor`
13
+ > **new ContextIdProcessor**(`options`): `ContextIdProcessor`
14
+
15
+ Create a new instance of ContextIdProcessor.
16
+
17
+ #### Parameters
18
+
19
+ ##### options
20
+
21
+ [`IContextIdProcessorConstructorOptions`](../interfaces/IContextIdProcessorConstructorOptions.md)
22
+
23
+ Options for the processor.
14
24
 
15
25
  #### Returns
16
26
 
17
- `NodeIdentityProcessor`
27
+ `ContextIdProcessor`
18
28
 
19
29
  ## Properties
20
30
 
21
31
  ### CLASS\_NAME
22
32
 
23
- > `readonly` **CLASS\_NAME**: `string`
33
+ > `readonly` `static` **CLASS\_NAME**: `string`
24
34
 
25
35
  Runtime name for the class.
26
36
 
37
+ ## Methods
38
+
39
+ ### className()
40
+
41
+ > **className**(): `string`
42
+
43
+ Returns the class name of the component.
44
+
45
+ #### Returns
46
+
47
+ `string`
48
+
49
+ The class name of the component.
50
+
27
51
  #### Implementation of
28
52
 
29
- `IBaseRouteProcessor.CLASS_NAME`
53
+ `IBaseRouteProcessor.className`
30
54
 
31
- ## Methods
55
+ ***
32
56
 
33
57
  ### start()
34
58
 
35
- > **start**(`nodeIdentity`, `nodeLoggingComponentType?`): `Promise`\<`void`\>
59
+ > **start**(`nodeLoggingComponentType?`): `Promise`\<`void`\>
36
60
 
37
61
  The service needs to be started when the application is initialized.
38
62
 
39
63
  #### Parameters
40
64
 
41
- ##### nodeIdentity
42
-
43
- `string`
44
-
45
- The identity of the node.
46
-
47
65
  ##### nodeLoggingComponentType?
48
66
 
49
67
  `string`
@@ -64,7 +82,7 @@ Nothing.
64
82
 
65
83
  ### pre()
66
84
 
67
- > **pre**(`request`, `response`, `route`, `requestIdentity`, `processorState`): `Promise`\<`void`\>
85
+ > **pre**(`request`, `response`, `route`, `contextIds`, `processorState`): `Promise`\<`void`\>
68
86
 
69
87
  Pre process the REST request for the specified route.
70
88
 
@@ -86,13 +104,13 @@ The outgoing response.
86
104
 
87
105
  The route to process.
88
106
 
89
- `undefined` | `IBaseRoute`
107
+ `IBaseRoute` | `undefined`
90
108
 
91
- ##### requestIdentity
109
+ ##### contextIds
92
110
 
93
- `IHttpRequestIdentity`
111
+ `IContextIds`
94
112
 
95
- The identity context for the request.
113
+ The context IDs of the request.
96
114
 
97
115
  ##### processorState
98
116
 
@@ -20,15 +20,29 @@ Process the JSON-LD mime type.
20
20
 
21
21
  ### CLASS\_NAME
22
22
 
23
- > `readonly` **CLASS\_NAME**: `string`
23
+ > `readonly` `static` **CLASS\_NAME**: `string`
24
24
 
25
25
  Runtime name for the class.
26
26
 
27
+ ## Methods
28
+
29
+ ### className()
30
+
31
+ > **className**(): `string`
32
+
33
+ Returns the class name of the component.
34
+
35
+ #### Returns
36
+
37
+ `string`
38
+
39
+ The class name of the component.
40
+
27
41
  #### Implementation of
28
42
 
29
- `IMimeTypeProcessor.CLASS_NAME`
43
+ `IMimeTypeProcessor.className`
30
44
 
31
- ## Methods
45
+ ***
32
46
 
33
47
  ### getTypes()
34
48
 
@@ -20,15 +20,29 @@ Process the JWT mime type.
20
20
 
21
21
  ### CLASS\_NAME
22
22
 
23
- > `readonly` **CLASS\_NAME**: `string`
23
+ > `readonly` `static` **CLASS\_NAME**: `string`
24
24
 
25
25
  Runtime name for the class.
26
26
 
27
+ ## Methods
28
+
29
+ ### className()
30
+
31
+ > **className**(): `string`
32
+
33
+ Returns the class name of the component.
34
+
35
+ #### Returns
36
+
37
+ `string`
38
+
39
+ The class name of the component.
40
+
27
41
  #### Implementation of
28
42
 
29
- `IMimeTypeProcessor.CLASS_NAME`
43
+ `IMimeTypeProcessor.className`
30
44
 
31
- ## Methods
45
+ ***
32
46
 
33
47
  ### getTypes()
34
48
 
@@ -30,19 +30,33 @@ Options for the processor.
30
30
 
31
31
  ### CLASS\_NAME
32
32
 
33
- > `readonly` **CLASS\_NAME**: `string`
33
+ > `readonly` `static` **CLASS\_NAME**: `string`
34
34
 
35
35
  Runtime name for the class.
36
36
 
37
+ ## Methods
38
+
39
+ ### className()
40
+
41
+ > **className**(): `string`
42
+
43
+ Returns the class name of the component.
44
+
45
+ #### Returns
46
+
47
+ `string`
48
+
49
+ The class name of the component.
50
+
37
51
  #### Implementation of
38
52
 
39
- `IBaseRouteProcessor.CLASS_NAME`
53
+ `IBaseRouteProcessor.className`
40
54
 
41
- ## Methods
55
+ ***
42
56
 
43
57
  ### pre()
44
58
 
45
- > **pre**(`request`, `response`, `route`, `requestIdentity`, `processorState`): `Promise`\<`void`\>
59
+ > **pre**(`request`, `response`, `route`, `contextIds`, `processorState`): `Promise`\<`void`\>
46
60
 
47
61
  Pre process the REST request for the specified route.
48
62
 
@@ -64,13 +78,13 @@ The outgoing response.
64
78
 
65
79
  The route to process.
66
80
 
67
- `undefined` | `IBaseRoute`
81
+ `IBaseRoute` | `undefined`
68
82
 
69
- ##### requestIdentity
83
+ ##### contextIds
70
84
 
71
- `IHttpRequestIdentity`
85
+ `IContextIds`
72
86
 
73
- The identity context for the request.
87
+ The context IDs of the request.
74
88
 
75
89
  ##### processorState
76
90
 
@@ -88,7 +102,7 @@ The state handed through the processors.
88
102
 
89
103
  ### post()
90
104
 
91
- > **post**(`request`, `response`, `route`, `requestIdentity`, `processorState`): `Promise`\<`void`\>
105
+ > **post**(`request`, `response`, `route`, `contextIds`, `processorState`): `Promise`\<`void`\>
92
106
 
93
107
  Post process the REST request for the specified route.
94
108
 
@@ -110,13 +124,13 @@ The outgoing response.
110
124
 
111
125
  The route to process.
112
126
 
113
- `undefined` | `IBaseRoute`
127
+ `IBaseRoute` | `undefined`
114
128
 
115
- ##### requestIdentity
129
+ ##### contextIds
116
130
 
117
- `IHttpRequestIdentity`
131
+ `IContextIds`
118
132
 
119
- The identity context for the request.
133
+ The context IDs of the request.
120
134
 
121
135
  ##### processorState
122
136
 
@@ -30,19 +30,33 @@ Options for the processor.
30
30
 
31
31
  ### CLASS\_NAME
32
32
 
33
- > `readonly` **CLASS\_NAME**: `string`
33
+ > `readonly` `static` **CLASS\_NAME**: `string`
34
34
 
35
35
  Runtime name for the class.
36
36
 
37
+ ## Methods
38
+
39
+ ### className()
40
+
41
+ > **className**(): `string`
42
+
43
+ Returns the class name of the component.
44
+
45
+ #### Returns
46
+
47
+ `string`
48
+
49
+ The class name of the component.
50
+
37
51
  #### Implementation of
38
52
 
39
- `IRestRouteProcessor.CLASS_NAME`
53
+ `IRestRouteProcessor.className`
40
54
 
41
- ## Methods
55
+ ***
42
56
 
43
57
  ### process()
44
58
 
45
- > **process**(`request`, `response`, `route`, `requestIdentity`, `processorState`, `loggingComponentType?`): `Promise`\<`void`\>
59
+ > **process**(`request`, `response`, `route`, `processorState`, `loggingComponentType?`): `Promise`\<`void`\>
46
60
 
47
61
  Process the REST request for the specified route.
48
62
 
@@ -64,13 +78,7 @@ The outgoing response.
64
78
 
65
79
  The route to process.
66
80
 
67
- `undefined` | `IRestRoute`\<`any`, `any`\>
68
-
69
- ##### requestIdentity
70
-
71
- `IHttpRequestIdentity`
72
-
73
- The identity context for the request.
81
+ `IRestRoute`\<`any`, `any`\> | `undefined`
74
82
 
75
83
  ##### processorState
76
84
 
@@ -30,15 +30,29 @@ Options for the processor.
30
30
 
31
31
  ### CLASS\_NAME
32
32
 
33
- > `readonly` **CLASS\_NAME**: `string`
33
+ > `readonly` `static` **CLASS\_NAME**: `string`
34
34
 
35
35
  Runtime name for the class.
36
36
 
37
+ ## Methods
38
+
39
+ ### className()
40
+
41
+ > **className**(): `string`
42
+
43
+ Returns the class name of the component.
44
+
45
+ #### Returns
46
+
47
+ `string`
48
+
49
+ The class name of the component.
50
+
37
51
  #### Implementation of
38
52
 
39
- `ISocketRouteProcessor.CLASS_NAME`
53
+ `ISocketRouteProcessor.className`
40
54
 
41
- ## Methods
55
+ ***
42
56
 
43
57
  ### connected()
44
58
 
@@ -58,7 +72,7 @@ The server request object containing the socket id and other parameters.
58
72
 
59
73
  The route being requested, if a matching one was found.
60
74
 
61
- `undefined` | `ISocketRoute`\<`any`, `any`\>
75
+ `ISocketRoute`\<`any`, `any`\> | `undefined`
62
76
 
63
77
  ##### loggingComponentType?
64
78
 
@@ -96,7 +110,7 @@ The server request object containing the socket id and other parameters.
96
110
 
97
111
  The route being requested, if a matching one was found.
98
112
 
99
- `undefined` | `ISocketRoute`\<`any`, `any`\>
113
+ `ISocketRoute`\<`any`, `any`\> | `undefined`
100
114
 
101
115
  ##### loggingComponentType?
102
116
 
@@ -118,9 +132,9 @@ Promise that resolves when the request is processed.
118
132
 
119
133
  ### process()
120
134
 
121
- > **process**(`request`, `response`, `route`, `requestIdentity`, `processorState`, `responseEmitter`, `loggingComponentType?`): `Promise`\<`void`\>
135
+ > **process**(`request`, `response`, `route`, `processorState`, `responseEmitter`, `loggingComponentType?`): `Promise`\<`void`\>
122
136
 
123
- Process the REST request for the specified route.
137
+ Process the socket request for the specified route.
124
138
 
125
139
  #### Parameters
126
140
 
@@ -140,13 +154,7 @@ The outgoing response.
140
154
 
141
155
  The route to process.
142
156
 
143
- `undefined` | `ISocketRoute`\<`any`, `any`\>
144
-
145
- ##### requestIdentity
146
-
147
- `IHttpRequestIdentity`
148
-
149
- The identity context for the request.
157
+ `ISocketRoute`\<`any`, `any`\> | `undefined`
150
158
 
151
159
  ##### processorState
152
160
 
@@ -0,0 +1,99 @@
1
+ # Class: StaticContextIdProcessor
2
+
3
+ Adds a static context id to the request context.
4
+
5
+ ## Implements
6
+
7
+ - `IBaseRouteProcessor`
8
+
9
+ ## Constructors
10
+
11
+ ### Constructor
12
+
13
+ > **new StaticContextIdProcessor**(`options`): `StaticContextIdProcessor`
14
+
15
+ Create a new instance of StaticContextIdProcessor.
16
+
17
+ #### Parameters
18
+
19
+ ##### options
20
+
21
+ [`IStaticContextIdProcessorConstructorOptions`](../interfaces/IStaticContextIdProcessorConstructorOptions.md)
22
+
23
+ Options for the processor.
24
+
25
+ #### Returns
26
+
27
+ `StaticContextIdProcessor`
28
+
29
+ ## Properties
30
+
31
+ ### CLASS\_NAME
32
+
33
+ > `readonly` `static` **CLASS\_NAME**: `string`
34
+
35
+ Runtime name for the class.
36
+
37
+ ## Methods
38
+
39
+ ### className()
40
+
41
+ > **className**(): `string`
42
+
43
+ Returns the class name of the component.
44
+
45
+ #### Returns
46
+
47
+ `string`
48
+
49
+ The class name of the component.
50
+
51
+ #### Implementation of
52
+
53
+ `IBaseRouteProcessor.className`
54
+
55
+ ***
56
+
57
+ ### pre()
58
+
59
+ > **pre**(`request`, `response`, `route`, `contextIds`, `processorState`): `Promise`\<`void`\>
60
+
61
+ Pre process the REST request for the specified route.
62
+
63
+ #### Parameters
64
+
65
+ ##### request
66
+
67
+ `IHttpServerRequest`
68
+
69
+ The incoming request.
70
+
71
+ ##### response
72
+
73
+ `IHttpResponse`
74
+
75
+ The outgoing response.
76
+
77
+ ##### route
78
+
79
+ The route to process.
80
+
81
+ `IBaseRoute` | `undefined`
82
+
83
+ ##### contextIds
84
+
85
+ `IContextIds`
86
+
87
+ The context IDs of the request.
88
+
89
+ ##### processorState
90
+
91
+ The state handed through the processors.
92
+
93
+ #### Returns
94
+
95
+ `Promise`\<`void`\>
96
+
97
+ #### Implementation of
98
+
99
+ `IBaseRouteProcessor.pre`
@@ -4,18 +4,20 @@
4
4
 
5
5
  - [RestRouteProcessor](classes/RestRouteProcessor.md)
6
6
  - [SocketRouteProcessor](classes/SocketRouteProcessor.md)
7
- - [NodeIdentityProcessor](classes/NodeIdentityProcessor.md)
8
- - [StaticUserIdentityProcessor](classes/StaticUserIdentityProcessor.md)
7
+ - [ContextIdProcessor](classes/ContextIdProcessor.md)
8
+ - [StaticContextIdProcessor](classes/StaticContextIdProcessor.md)
9
9
  - [LoggingProcessor](classes/LoggingProcessor.md)
10
10
  - [JsonLdMimeTypeProcessor](classes/JsonLdMimeTypeProcessor.md)
11
11
  - [JwtMimeTypeProcessor](classes/JwtMimeTypeProcessor.md)
12
12
 
13
13
  ## Interfaces
14
14
 
15
+ - [IContextIdProcessorConfig](interfaces/IContextIdProcessorConfig.md)
16
+ - [IContextIdProcessorConstructorOptions](interfaces/IContextIdProcessorConstructorOptions.md)
15
17
  - [ILoggingProcessorConfig](interfaces/ILoggingProcessorConfig.md)
16
18
  - [ILoggingProcessorConstructorOptions](interfaces/ILoggingProcessorConstructorOptions.md)
17
19
  - [IRestRouteProcessorConstructorOptions](interfaces/IRestRouteProcessorConstructorOptions.md)
18
20
  - [IRouteProcessorConfig](interfaces/IRouteProcessorConfig.md)
19
21
  - [ISocketRouteProcessorConstructorOptions](interfaces/ISocketRouteProcessorConstructorOptions.md)
20
- - [IStaticUserIdentityProcessorConfig](interfaces/IStaticUserIdentityProcessorConfig.md)
21
- - [IStaticUserIdentityProcessorConstructorOptions](interfaces/IStaticUserIdentityProcessorConstructorOptions.md)
22
+ - [IStaticContextIdProcessorConfig](interfaces/IStaticContextIdProcessorConfig.md)
23
+ - [IStaticContextIdProcessorConstructorOptions](interfaces/IStaticContextIdProcessorConstructorOptions.md)
@@ -0,0 +1,19 @@
1
+ # Interface: IContextIdProcessorConfig
2
+
3
+ Configuration for the context id processor.
4
+
5
+ ## Properties
6
+
7
+ ### key
8
+
9
+ > **key**: `string`
10
+
11
+ The fixed identity key for request context.
12
+
13
+ ***
14
+
15
+ ### authOnly?
16
+
17
+ > `optional` **authOnly**: `boolean`
18
+
19
+ Only add the identity if the request is authenticated.
@@ -0,0 +1,11 @@
1
+ # Interface: IContextIdProcessorConstructorOptions
2
+
3
+ Options for the ContextIdProcessor constructor.
4
+
5
+ ## Properties
6
+
7
+ ### config
8
+
9
+ > **config**: [`IContextIdProcessorConfig`](IContextIdProcessorConfig.md)
10
+
11
+ The configuration for the processor.
@@ -0,0 +1,27 @@
1
+ # Interface: IStaticContextIdProcessorConfig
2
+
3
+ Configuration for the static id processor.
4
+
5
+ ## Properties
6
+
7
+ ### key
8
+
9
+ > **key**: `string`
10
+
11
+ The fixed identity key for request context.
12
+
13
+ ***
14
+
15
+ ### value
16
+
17
+ > **value**: `string`
18
+
19
+ The fixed identity value for request context.
20
+
21
+ ***
22
+
23
+ ### authOnly?
24
+
25
+ > `optional` **authOnly**: `boolean`
26
+
27
+ Only add the identity if the request is authenticated.
@@ -0,0 +1,11 @@
1
+ # Interface: IStaticContextIdProcessorConstructorOptions
2
+
3
+ Options for the StaticContextIdProcessor constructor.
4
+
5
+ ## Properties
6
+
7
+ ### config
8
+
9
+ > **config**: [`IStaticContextIdProcessorConfig`](IStaticContextIdProcessorConfig.md)
10
+
11
+ The configuration for the processor.
package/locales/en.json CHANGED
@@ -6,11 +6,6 @@
6
6
  "socketRouteProcessor": {
7
7
  "routeNotFound": "The web server could not find the socket route \"{notFoundId}\""
8
8
  },
9
- "jwtIdentityProcessor": {
10
- "jwtMissing": "The JSON Web token could not be found in the authorization header or a cookie",
11
- "jwtSignatureInvalid": "The JSON Web token signature could not be validated",
12
- "jwtExpired": "The JSON Web token has expired"
13
- },
14
9
  "jsonLdMimeTypeProcessor": {
15
10
  "invalidJsonLd": "The JSON-LD content is invalid or missing '@context'."
16
11
  }