@twin.org/engine-server-types 0.0.2-next.13 → 0.0.2-next.15
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 +29 -0
- package/dist/esm/index.mjs +29 -0
- package/dist/types/models/config/restRouteProcessorConfig.d.ts +4 -0
- package/dist/types/models/config/socketRouteProcessorConfig.d.ts +4 -0
- package/dist/types/models/types/restRouteProcessorType.d.ts +4 -0
- package/dist/types/models/types/socketRouteProcessorType.d.ts +4 -0
- package/docs/changelog.md +30 -0
- package/docs/reference/type-aliases/RestRouteProcessorConfig.md +1 -1
- package/docs/reference/type-aliases/SocketRouteProcessorConfig.md +1 -1
- package/docs/reference/variables/RestRouteProcessorType.md +6 -0
- package/docs/reference/variables/SocketRouteProcessorType.md +6 -0
- package/package.json +4 -3
package/dist/cjs/index.cjs
CHANGED
|
@@ -8,6 +8,7 @@ var apiRestClient = require('@twin.org/api-rest-client');
|
|
|
8
8
|
var apiService = require('@twin.org/api-service');
|
|
9
9
|
var apiModels = require('@twin.org/api-models');
|
|
10
10
|
var apiProcessors = require('@twin.org/api-processors');
|
|
11
|
+
var identityAuthentication = require('@twin.org/identity-authentication');
|
|
11
12
|
|
|
12
13
|
// Copyright 2024 IOTA Stiftung.
|
|
13
14
|
// SPDX-License-Identifier: Apache-2.0.
|
|
@@ -240,6 +241,10 @@ const RestRouteProcessorType = {
|
|
|
240
241
|
* Auth header.
|
|
241
242
|
*/
|
|
242
243
|
AuthHeader: "auth-header",
|
|
244
|
+
/**
|
|
245
|
+
* Auth verifiable credential.
|
|
246
|
+
*/
|
|
247
|
+
AuthVerifiableCredential: "auth-verifiable-credential",
|
|
243
248
|
/**
|
|
244
249
|
* Logging.
|
|
245
250
|
*/
|
|
@@ -285,6 +290,16 @@ async function initialiseRestRouteProcessorComponent(engineCore, context, instan
|
|
|
285
290
|
});
|
|
286
291
|
instanceType = core.StringHelper.kebabCase("AuthHeaderProcessor");
|
|
287
292
|
}
|
|
293
|
+
else if (type === RestRouteProcessorType.AuthVerifiableCredential) {
|
|
294
|
+
component = new identityAuthentication.VerifiableCredentialAuthenticationProcessor({
|
|
295
|
+
identityConnectorType: engineCore.getRegisteredInstanceType("identityConnector"),
|
|
296
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
297
|
+
config: {
|
|
298
|
+
...instanceConfig.options?.config
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
instanceType = core.StringHelper.kebabCase("VerifiableCredentialAuthenticationProcessor");
|
|
302
|
+
}
|
|
288
303
|
else if (type === RestRouteProcessorType.Logging) {
|
|
289
304
|
component = new apiProcessors.LoggingProcessor({
|
|
290
305
|
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
@@ -332,6 +347,10 @@ const SocketRouteProcessorType = {
|
|
|
332
347
|
* Auth header.
|
|
333
348
|
*/
|
|
334
349
|
AuthHeader: "auth-header",
|
|
350
|
+
/**
|
|
351
|
+
* Auth verifiable credential.
|
|
352
|
+
*/
|
|
353
|
+
AuthVerifiableCredential: "auth-verifiable-credential",
|
|
335
354
|
/**
|
|
336
355
|
* Logging.
|
|
337
356
|
*/
|
|
@@ -377,6 +396,16 @@ async function initialiseSocketRouteProcessorComponent(engineCore, context, inst
|
|
|
377
396
|
});
|
|
378
397
|
instanceType = core.StringHelper.kebabCase("AuthHeaderProcessor");
|
|
379
398
|
}
|
|
399
|
+
else if (type === SocketRouteProcessorType.AuthVerifiableCredential) {
|
|
400
|
+
component = new identityAuthentication.VerifiableCredentialAuthenticationProcessor({
|
|
401
|
+
identityConnectorType: engineCore.getRegisteredInstanceType("identityConnector"),
|
|
402
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
403
|
+
config: {
|
|
404
|
+
...instanceConfig.options?.config
|
|
405
|
+
}
|
|
406
|
+
});
|
|
407
|
+
instanceType = core.StringHelper.kebabCase("VerifiableCredentialAuthenticationProcessor");
|
|
408
|
+
}
|
|
380
409
|
else if (type === SocketRouteProcessorType.Logging) {
|
|
381
410
|
component = new apiProcessors.LoggingProcessor({
|
|
382
411
|
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
package/dist/esm/index.mjs
CHANGED
|
@@ -6,6 +6,7 @@ import { InformationClient } from '@twin.org/api-rest-client';
|
|
|
6
6
|
import { InformationService } from '@twin.org/api-service';
|
|
7
7
|
import { MimeTypeProcessorFactory, RestRouteProcessorFactory, SocketRouteProcessorFactory } from '@twin.org/api-models';
|
|
8
8
|
import { JwtMimeTypeProcessor, LoggingProcessor, NodeIdentityProcessor, StaticUserIdentityProcessor, RestRouteProcessor, SocketRouteProcessor } from '@twin.org/api-processors';
|
|
9
|
+
import { VerifiableCredentialAuthenticationProcessor } from '@twin.org/identity-authentication';
|
|
9
10
|
|
|
10
11
|
// Copyright 2024 IOTA Stiftung.
|
|
11
12
|
// SPDX-License-Identifier: Apache-2.0.
|
|
@@ -238,6 +239,10 @@ const RestRouteProcessorType = {
|
|
|
238
239
|
* Auth header.
|
|
239
240
|
*/
|
|
240
241
|
AuthHeader: "auth-header",
|
|
242
|
+
/**
|
|
243
|
+
* Auth verifiable credential.
|
|
244
|
+
*/
|
|
245
|
+
AuthVerifiableCredential: "auth-verifiable-credential",
|
|
241
246
|
/**
|
|
242
247
|
* Logging.
|
|
243
248
|
*/
|
|
@@ -283,6 +288,16 @@ async function initialiseRestRouteProcessorComponent(engineCore, context, instan
|
|
|
283
288
|
});
|
|
284
289
|
instanceType = StringHelper.kebabCase("AuthHeaderProcessor");
|
|
285
290
|
}
|
|
291
|
+
else if (type === RestRouteProcessorType.AuthVerifiableCredential) {
|
|
292
|
+
component = new VerifiableCredentialAuthenticationProcessor({
|
|
293
|
+
identityConnectorType: engineCore.getRegisteredInstanceType("identityConnector"),
|
|
294
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
295
|
+
config: {
|
|
296
|
+
...instanceConfig.options?.config
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
instanceType = StringHelper.kebabCase("VerifiableCredentialAuthenticationProcessor");
|
|
300
|
+
}
|
|
286
301
|
else if (type === RestRouteProcessorType.Logging) {
|
|
287
302
|
component = new LoggingProcessor({
|
|
288
303
|
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
@@ -330,6 +345,10 @@ const SocketRouteProcessorType = {
|
|
|
330
345
|
* Auth header.
|
|
331
346
|
*/
|
|
332
347
|
AuthHeader: "auth-header",
|
|
348
|
+
/**
|
|
349
|
+
* Auth verifiable credential.
|
|
350
|
+
*/
|
|
351
|
+
AuthVerifiableCredential: "auth-verifiable-credential",
|
|
333
352
|
/**
|
|
334
353
|
* Logging.
|
|
335
354
|
*/
|
|
@@ -375,6 +394,16 @@ async function initialiseSocketRouteProcessorComponent(engineCore, context, inst
|
|
|
375
394
|
});
|
|
376
395
|
instanceType = StringHelper.kebabCase("AuthHeaderProcessor");
|
|
377
396
|
}
|
|
397
|
+
else if (type === SocketRouteProcessorType.AuthVerifiableCredential) {
|
|
398
|
+
component = new VerifiableCredentialAuthenticationProcessor({
|
|
399
|
+
identityConnectorType: engineCore.getRegisteredInstanceType("identityConnector"),
|
|
400
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
401
|
+
config: {
|
|
402
|
+
...instanceConfig.options?.config
|
|
403
|
+
}
|
|
404
|
+
});
|
|
405
|
+
instanceType = StringHelper.kebabCase("VerifiableCredentialAuthenticationProcessor");
|
|
406
|
+
}
|
|
378
407
|
else if (type === SocketRouteProcessorType.Logging) {
|
|
379
408
|
component = new LoggingProcessor({
|
|
380
409
|
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { IAuthHeaderProcessorConstructorOptions } from "@twin.org/api-auth-entity-storage-service";
|
|
2
2
|
import type { ILoggingProcessorConstructorOptions, IRestRouteProcessorConstructorOptions, IStaticUserIdentityProcessorConstructorOptions } from "@twin.org/api-processors";
|
|
3
|
+
import type { IVerifiableCredentialAuthenticationProcessorConstructorOptions } from "@twin.org/identity-authentication";
|
|
3
4
|
import type { RestRouteProcessorType } from "../types/restRouteProcessorType";
|
|
4
5
|
/**
|
|
5
6
|
* REST route processor config types.
|
|
@@ -7,6 +8,9 @@ import type { RestRouteProcessorType } from "../types/restRouteProcessorType";
|
|
|
7
8
|
export type RestRouteProcessorConfig = {
|
|
8
9
|
type: typeof RestRouteProcessorType.AuthHeader;
|
|
9
10
|
options?: IAuthHeaderProcessorConstructorOptions;
|
|
11
|
+
} | {
|
|
12
|
+
type: typeof RestRouteProcessorType.AuthVerifiableCredential;
|
|
13
|
+
options?: IVerifiableCredentialAuthenticationProcessorConstructorOptions;
|
|
10
14
|
} | {
|
|
11
15
|
type: typeof RestRouteProcessorType.Logging;
|
|
12
16
|
options?: ILoggingProcessorConstructorOptions;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { IAuthHeaderProcessorConstructorOptions } from "@twin.org/api-auth-entity-storage-service";
|
|
2
2
|
import type { ILoggingProcessorConstructorOptions, ISocketRouteProcessorConstructorOptions, IStaticUserIdentityProcessorConstructorOptions } from "@twin.org/api-processors";
|
|
3
|
+
import type { IVerifiableCredentialAuthenticationProcessorConstructorOptions } from "@twin.org/identity-authentication";
|
|
3
4
|
import type { SocketRouteProcessorType } from "../types/socketRouteProcessorType";
|
|
4
5
|
/**
|
|
5
6
|
* Socket route processor config types.
|
|
@@ -7,6 +8,9 @@ import type { SocketRouteProcessorType } from "../types/socketRouteProcessorType
|
|
|
7
8
|
export type SocketRouteProcessorConfig = {
|
|
8
9
|
type: typeof SocketRouteProcessorType.AuthHeader;
|
|
9
10
|
options?: IAuthHeaderProcessorConstructorOptions;
|
|
11
|
+
} | {
|
|
12
|
+
type: typeof SocketRouteProcessorType.AuthVerifiableCredential;
|
|
13
|
+
options?: IVerifiableCredentialAuthenticationProcessorConstructorOptions;
|
|
10
14
|
} | {
|
|
11
15
|
type: typeof SocketRouteProcessorType.Logging;
|
|
12
16
|
options?: ILoggingProcessorConstructorOptions;
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @twin.org/engine-server-types - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.2-next.15](https://github.com/twinfoundation/engine/compare/engine-server-types-v0.0.2-next.14...engine-server-types-v0.0.2-next.15) (2025-09-24)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* update rights management and add authentication generators ([f728a1e](https://github.com/twinfoundation/engine/commit/f728a1efea15ada8d10cfbe17cafe7e2b252f527))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/engine-models bumped from 0.0.2-next.14 to 0.0.2-next.15
|
|
16
|
+
* @twin.org/engine-types bumped from 0.0.2-next.14 to 0.0.2-next.15
|
|
17
|
+
|
|
18
|
+
## [0.0.2-next.14](https://github.com/twinfoundation/engine/compare/engine-server-types-v0.0.2-next.13...engine-server-types-v0.0.2-next.14) (2025-09-19)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Features
|
|
22
|
+
|
|
23
|
+
* add latest rights management components ([2d305c8](https://github.com/twinfoundation/engine/commit/2d305c8c85c77bb4f5694c76422db4a11efc1a40))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Dependencies
|
|
27
|
+
|
|
28
|
+
* The following workspace dependencies were updated
|
|
29
|
+
* dependencies
|
|
30
|
+
* @twin.org/engine-models bumped from 0.0.2-next.13 to 0.0.2-next.14
|
|
31
|
+
* @twin.org/engine-types bumped from 0.0.2-next.13 to 0.0.2-next.14
|
|
32
|
+
|
|
3
33
|
## [0.0.2-next.13](https://github.com/twinfoundation/engine/compare/engine-server-types-v0.0.2-next.12...engine-server-types-v0.0.2-next.13) (2025-09-08)
|
|
4
34
|
|
|
5
35
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Type Alias: RestRouteProcessorConfig
|
|
2
2
|
|
|
3
|
-
> **RestRouteProcessorConfig** = \{ `type`: *typeof* [`AuthHeader`](../variables/RestRouteProcessorType.md#authheader); `options?`: `IAuthHeaderProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`Logging`](../variables/RestRouteProcessorType.md#logging); `options?`: `ILoggingProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`NodeIdentity`](../variables/RestRouteProcessorType.md#nodeidentity); `options?`: `never`; \} \| \{ `type`: *typeof* [`StaticUserIdentity`](../variables/RestRouteProcessorType.md#staticuseridentity); `options`: `IStaticUserIdentityProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`RestRoute`](../variables/RestRouteProcessorType.md#restroute); `options?`: `IRestRouteProcessorConstructorOptions`; \}
|
|
3
|
+
> **RestRouteProcessorConfig** = \{ `type`: *typeof* [`AuthHeader`](../variables/RestRouteProcessorType.md#authheader); `options?`: `IAuthHeaderProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`AuthVerifiableCredential`](../variables/RestRouteProcessorType.md#authverifiablecredential); `options?`: `IVerifiableCredentialAuthenticationProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`Logging`](../variables/RestRouteProcessorType.md#logging); `options?`: `ILoggingProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`NodeIdentity`](../variables/RestRouteProcessorType.md#nodeidentity); `options?`: `never`; \} \| \{ `type`: *typeof* [`StaticUserIdentity`](../variables/RestRouteProcessorType.md#staticuseridentity); `options`: `IStaticUserIdentityProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`RestRoute`](../variables/RestRouteProcessorType.md#restroute); `options?`: `IRestRouteProcessorConstructorOptions`; \}
|
|
4
4
|
|
|
5
5
|
REST route processor config types.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Type Alias: SocketRouteProcessorConfig
|
|
2
2
|
|
|
3
|
-
> **SocketRouteProcessorConfig** = \{ `type`: *typeof* [`AuthHeader`](../variables/SocketRouteProcessorType.md#authheader); `options?`: `IAuthHeaderProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`Logging`](../variables/SocketRouteProcessorType.md#logging); `options?`: `ILoggingProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`NodeIdentity`](../variables/SocketRouteProcessorType.md#nodeidentity); `options?`: `never`; \} \| \{ `type`: *typeof* [`StaticUserIdentity`](../variables/SocketRouteProcessorType.md#staticuseridentity); `options`: `IStaticUserIdentityProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`SocketRoute`](../variables/SocketRouteProcessorType.md#socketroute); `options?`: `ISocketRouteProcessorConstructorOptions`; \}
|
|
3
|
+
> **SocketRouteProcessorConfig** = \{ `type`: *typeof* [`AuthHeader`](../variables/SocketRouteProcessorType.md#authheader); `options?`: `IAuthHeaderProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`AuthVerifiableCredential`](../variables/SocketRouteProcessorType.md#authverifiablecredential); `options?`: `IVerifiableCredentialAuthenticationProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`Logging`](../variables/SocketRouteProcessorType.md#logging); `options?`: `ILoggingProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`NodeIdentity`](../variables/SocketRouteProcessorType.md#nodeidentity); `options?`: `never`; \} \| \{ `type`: *typeof* [`StaticUserIdentity`](../variables/SocketRouteProcessorType.md#staticuseridentity); `options`: `IStaticUserIdentityProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`SocketRoute`](../variables/SocketRouteProcessorType.md#socketroute); `options?`: `ISocketRouteProcessorConstructorOptions`; \}
|
|
4
4
|
|
|
5
5
|
Socket route processor config types.
|
|
@@ -12,6 +12,12 @@ REST route processor types.
|
|
|
12
12
|
|
|
13
13
|
Auth header.
|
|
14
14
|
|
|
15
|
+
### AuthVerifiableCredential
|
|
16
|
+
|
|
17
|
+
> `readonly` **AuthVerifiableCredential**: `"auth-verifiable-credential"` = `"auth-verifiable-credential"`
|
|
18
|
+
|
|
19
|
+
Auth verifiable credential.
|
|
20
|
+
|
|
15
21
|
### Logging
|
|
16
22
|
|
|
17
23
|
> `readonly` **Logging**: `"logging"` = `"logging"`
|
|
@@ -12,6 +12,12 @@ Socket route processor types.
|
|
|
12
12
|
|
|
13
13
|
Auth header.
|
|
14
14
|
|
|
15
|
+
### AuthVerifiableCredential
|
|
16
|
+
|
|
17
|
+
> `readonly` **AuthVerifiableCredential**: `"auth-verifiable-credential"` = `"auth-verifiable-credential"`
|
|
18
|
+
|
|
19
|
+
Auth verifiable credential.
|
|
20
|
+
|
|
15
21
|
### Logging
|
|
16
22
|
|
|
17
23
|
> `readonly` **Logging**: `"logging"` = `"logging"`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/engine-server-types",
|
|
3
|
-
"version": "0.0.2-next.
|
|
3
|
+
"version": "0.0.2-next.15",
|
|
4
4
|
"description": "Server types to use in an engine server.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -23,9 +23,10 @@
|
|
|
23
23
|
"@twin.org/api-server-fastify": "next",
|
|
24
24
|
"@twin.org/api-service": "next",
|
|
25
25
|
"@twin.org/core": "next",
|
|
26
|
-
"@twin.org/engine-models": "0.0.2-next.
|
|
27
|
-
"@twin.org/engine-types": "0.0.2-next.
|
|
26
|
+
"@twin.org/engine-models": "0.0.2-next.15",
|
|
27
|
+
"@twin.org/engine-types": "0.0.2-next.15",
|
|
28
28
|
"@twin.org/entity": "next",
|
|
29
|
+
"@twin.org/identity-authentication": "next",
|
|
29
30
|
"@twin.org/nameof": "next"
|
|
30
31
|
},
|
|
31
32
|
"main": "./dist/cjs/index.cjs",
|