@twin.org/engine-server-types 0.0.3-next.9 → 0.9.0

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 (81) hide show
  1. package/README.md +1 -1
  2. package/dist/es/components/authentication.js +24 -19
  3. package/dist/es/components/authentication.js.map +1 -1
  4. package/dist/es/components/authenticationAdmin.js +19 -15
  5. package/dist/es/components/authenticationAdmin.js.map +1 -1
  6. package/dist/es/components/authenticationAudit.js +35 -0
  7. package/dist/es/components/authenticationAudit.js.map +1 -0
  8. package/dist/es/components/authenticationRate.js +38 -0
  9. package/dist/es/components/authenticationRate.js.map +1 -0
  10. package/dist/es/components/information.js +12 -9
  11. package/dist/es/components/information.js.map +1 -1
  12. package/dist/es/components/mimeTypeProcessor.js +7 -7
  13. package/dist/es/components/mimeTypeProcessor.js.map +1 -1
  14. package/dist/es/components/restRouteProcessor.js +44 -47
  15. package/dist/es/components/restRouteProcessor.js.map +1 -1
  16. package/dist/es/components/socketRouteProcessor.js +43 -43
  17. package/dist/es/components/socketRouteProcessor.js.map +1 -1
  18. package/dist/es/index.js +6 -0
  19. package/dist/es/index.js.map +1 -1
  20. package/dist/es/models/IEngineServerConfig.js.map +1 -1
  21. package/dist/es/models/config/authenticationAuditComponentConfig.js +2 -0
  22. package/dist/es/models/config/authenticationAuditComponentConfig.js.map +1 -0
  23. package/dist/es/models/config/authenticationRateComponentConfig.js +2 -0
  24. package/dist/es/models/config/authenticationRateComponentConfig.js.map +1 -0
  25. package/dist/es/models/config/restRouteProcessorConfig.js.map +1 -1
  26. package/dist/es/models/config/socketRouteProcessorConfig.js.map +1 -1
  27. package/dist/es/models/types/authenticationAuditComponentType.js +13 -0
  28. package/dist/es/models/types/authenticationAuditComponentType.js.map +1 -0
  29. package/dist/es/models/types/authenticationRateComponentType.js +13 -0
  30. package/dist/es/models/types/authenticationRateComponentType.js.map +1 -0
  31. package/dist/es/models/types/restRouteProcessorType.js +4 -0
  32. package/dist/es/models/types/restRouteProcessorType.js.map +1 -1
  33. package/dist/es/models/types/socketRouteProcessorType.js +4 -0
  34. package/dist/es/models/types/socketRouteProcessorType.js.map +1 -1
  35. package/dist/types/components/authentication.d.ts +3 -7
  36. package/dist/types/components/authenticationAdmin.d.ts +3 -7
  37. package/dist/types/components/authenticationAudit.d.ts +12 -0
  38. package/dist/types/components/authenticationRate.d.ts +12 -0
  39. package/dist/types/components/information.d.ts +3 -7
  40. package/dist/types/components/mimeTypeProcessor.d.ts +2 -7
  41. package/dist/types/components/restRouteProcessor.d.ts +2 -7
  42. package/dist/types/components/socketRouteProcessor.d.ts +2 -7
  43. package/dist/types/index.d.ts +6 -0
  44. package/dist/types/models/IEngineServerConfig.d.ts +16 -6
  45. package/dist/types/models/config/authenticationAuditComponentConfig.d.ts +9 -0
  46. package/dist/types/models/config/authenticationRateComponentConfig.d.ts +9 -0
  47. package/dist/types/models/config/restRouteProcessorConfig.d.ts +4 -5
  48. package/dist/types/models/config/socketRouteProcessorConfig.d.ts +4 -5
  49. package/dist/types/models/types/authenticationAuditComponentType.d.ts +13 -0
  50. package/dist/types/models/types/authenticationRateComponentType.d.ts +13 -0
  51. package/dist/types/models/types/restRouteProcessorType.d.ts +4 -0
  52. package/dist/types/models/types/socketRouteProcessorType.d.ts +4 -0
  53. package/docs/changelog.md +1002 -125
  54. package/docs/examples.md +64 -1
  55. package/docs/reference/functions/initialiseAuthenticationAdminComponent.md +2 -2
  56. package/docs/reference/functions/initialiseAuthenticationAuditComponent.md +31 -0
  57. package/docs/reference/functions/initialiseAuthenticationComponent.md +2 -2
  58. package/docs/reference/functions/initialiseAuthenticationRateComponent.md +31 -0
  59. package/docs/reference/functions/initialiseInformationComponent.md +2 -2
  60. package/docs/reference/functions/initialiseMimeTypeProcessorComponent.md +2 -2
  61. package/docs/reference/functions/initialiseRestRouteProcessorComponent.md +2 -2
  62. package/docs/reference/functions/initialiseSocketRouteProcessorComponent.md +2 -2
  63. package/docs/reference/index.md +8 -0
  64. package/docs/reference/interfaces/IEngineServerConfig.md +503 -15
  65. package/docs/reference/type-aliases/AuthenticationAdminComponentConfig.md +3 -3
  66. package/docs/reference/type-aliases/AuthenticationAuditComponentConfig.md +17 -0
  67. package/docs/reference/type-aliases/AuthenticationAuditComponentType.md +5 -0
  68. package/docs/reference/type-aliases/AuthenticationRateComponentConfig.md +17 -0
  69. package/docs/reference/type-aliases/AuthenticationRateComponentType.md +5 -0
  70. package/docs/reference/type-aliases/MimeTypeProcessorConfig.md +3 -3
  71. package/docs/reference/type-aliases/RestRouteProcessorConfig.md +1 -1
  72. package/docs/reference/type-aliases/SocketRouteProcessorConfig.md +1 -1
  73. package/docs/reference/variables/AuthenticationAdminComponentType.md +1 -1
  74. package/docs/reference/variables/AuthenticationAuditComponentType.md +13 -0
  75. package/docs/reference/variables/AuthenticationComponentType.md +2 -2
  76. package/docs/reference/variables/AuthenticationRateComponentType.md +13 -0
  77. package/docs/reference/variables/InformationComponentType.md +2 -2
  78. package/docs/reference/variables/MimeTypeProcessorType.md +1 -1
  79. package/docs/reference/variables/RestRouteProcessorType.md +13 -7
  80. package/docs/reference/variables/SocketRouteProcessorType.md +13 -7
  81. package/package.json +19 -20
package/docs/examples.md CHANGED
@@ -1 +1,64 @@
1
- # @twin.org/engine-server-types - Examples
1
+ # Engine Server Types Examples
2
+
3
+ These examples demonstrate how to compose server configuration with shared type constants for REST and socket processing.
4
+
5
+ ## Component and Processor Types
6
+
7
+ ```typescript
8
+ import {
9
+ AuthenticationComponentType,
10
+ HostingComponentType,
11
+ InformationComponentType,
12
+ RestRouteProcessorType,
13
+ SocketRouteProcessorType
14
+ } from '@twin.org/engine-server-types';
15
+
16
+ const selectedTypes = {
17
+ authentication: AuthenticationComponentType.Service,
18
+ hosting: HostingComponentType.Service,
19
+ information: InformationComponentType.Service,
20
+ restProcessor: RestRouteProcessorType.RestRoute,
21
+ socketProcessor: SocketRouteProcessorType.SocketRoute
22
+ };
23
+
24
+ console.log(selectedTypes.authentication); // "service"
25
+ console.log(selectedTypes.restProcessor); // "rest-route"
26
+ ```
27
+
28
+ ## IEngineServerConfig
29
+
30
+ ```typescript
31
+ import type { IEngineServerConfig } from '@twin.org/engine-server-types';
32
+ import {
33
+ AuthenticationComponentType,
34
+ HostingComponentType,
35
+ InformationComponentType,
36
+ RestRouteProcessorType,
37
+ SocketRouteProcessorType
38
+ } from '@twin.org/engine-server-types';
39
+
40
+ const serverConfig: IEngineServerConfig = {
41
+ debug: true,
42
+ silent: false,
43
+ web: {
44
+ port: 3001,
45
+ host: '0.0.0.0'
46
+ },
47
+ types: {
48
+ hostingComponent: [{ type: HostingComponentType.Service }],
49
+ informationComponent: [{ type: InformationComponentType.Service, restPath: '/info' }],
50
+ authenticationComponent: [{ type: AuthenticationComponentType.Service }],
51
+ restRouteProcessor: [
52
+ { type: RestRouteProcessorType.Logging },
53
+ { type: RestRouteProcessorType.RestRoute }
54
+ ],
55
+ socketRouteProcessor: [
56
+ { type: SocketRouteProcessorType.Logging },
57
+ { type: SocketRouteProcessorType.SocketRoute }
58
+ ]
59
+ }
60
+ };
61
+
62
+ console.log(serverConfig.web?.port); // 3001
63
+ console.log(serverConfig.types.restRouteProcessor?.length ?? 0); // 2
64
+ ```
@@ -1,6 +1,6 @@
1
1
  # Function: initialiseAuthenticationAdminComponent()
2
2
 
3
- > **initialiseAuthenticationAdminComponent**(`engineCore`, `context`, `instanceConfig`): `Promise`\<\{ `instanceType?`: `string`; `factory?`: `Factory`\<`IComponent`\>; `component?`: `IComponent`; \}\>
3
+ > **initialiseAuthenticationAdminComponent**(`engineCore`, `context`, `instanceConfig`): `EngineTypeInitialiserReturn`\<[`AuthenticationAdminComponentConfig`](../type-aliases/AuthenticationAdminComponentConfig.md), `Factory`\<`IComponent`\>\>
4
4
 
5
5
  Initialise the authentication admin.
6
6
 
@@ -26,6 +26,6 @@ The instance config.
26
26
 
27
27
  ## Returns
28
28
 
29
- `Promise`\<\{ `instanceType?`: `string`; `factory?`: `Factory`\<`IComponent`\>; `component?`: `IComponent`; \}\>
29
+ `EngineTypeInitialiserReturn`\<[`AuthenticationAdminComponentConfig`](../type-aliases/AuthenticationAdminComponentConfig.md), `Factory`\<`IComponent`\>\>
30
30
 
31
31
  The instance created and the factory for it.
@@ -0,0 +1,31 @@
1
+ # Function: initialiseAuthenticationAuditComponent()
2
+
3
+ > **initialiseAuthenticationAuditComponent**(`engineCore`, `context`, `instanceConfig`): `EngineTypeInitialiserReturn`\<[`AuthenticationAuditComponentConfig`](../type-aliases/AuthenticationAuditComponentConfig.md), `Factory`\<`IComponent`\>\>
4
+
5
+ Initialise the authentication audit.
6
+
7
+ ## Parameters
8
+
9
+ ### engineCore
10
+
11
+ `IEngineCore`\<[`IEngineServerConfig`](../interfaces/IEngineServerConfig.md)\>
12
+
13
+ The engine core.
14
+
15
+ ### context
16
+
17
+ `IEngineCoreContext`\<[`IEngineServerConfig`](../interfaces/IEngineServerConfig.md)\>
18
+
19
+ The context for the engine.
20
+
21
+ ### instanceConfig
22
+
23
+ [`AuthenticationAuditComponentConfig`](../type-aliases/AuthenticationAuditComponentConfig.md)
24
+
25
+ The instance config.
26
+
27
+ ## Returns
28
+
29
+ `EngineTypeInitialiserReturn`\<[`AuthenticationAuditComponentConfig`](../type-aliases/AuthenticationAuditComponentConfig.md), `Factory`\<`IComponent`\>\>
30
+
31
+ The instance created and the factory for it.
@@ -1,6 +1,6 @@
1
1
  # Function: initialiseAuthenticationComponent()
2
2
 
3
- > **initialiseAuthenticationComponent**(`engineCore`, `context`, `instanceConfig`): `Promise`\<\{ `instanceType?`: `string`; `factory?`: `Factory`\<`IComponent`\>; `component?`: `IComponent`; \}\>
3
+ > **initialiseAuthenticationComponent**(`engineCore`, `context`, `instanceConfig`): `EngineTypeInitialiserReturn`\<[`AuthenticationComponentConfig`](../type-aliases/AuthenticationComponentConfig.md), `Factory`\<`IComponent`\>\>
4
4
 
5
5
  Initialise the authentication.
6
6
 
@@ -26,6 +26,6 @@ The instance config.
26
26
 
27
27
  ## Returns
28
28
 
29
- `Promise`\<\{ `instanceType?`: `string`; `factory?`: `Factory`\<`IComponent`\>; `component?`: `IComponent`; \}\>
29
+ `EngineTypeInitialiserReturn`\<[`AuthenticationComponentConfig`](../type-aliases/AuthenticationComponentConfig.md), `Factory`\<`IComponent`\>\>
30
30
 
31
31
  The instance created and the factory for it.
@@ -0,0 +1,31 @@
1
+ # Function: initialiseAuthenticationRateComponent()
2
+
3
+ > **initialiseAuthenticationRateComponent**(`engineCore`, `context`, `instanceConfig`): `EngineTypeInitialiserReturn`\<[`AuthenticationRateComponentConfig`](../type-aliases/AuthenticationRateComponentConfig.md), `Factory`\<`IComponent`\>\>
4
+
5
+ Initialise the authentication rate.
6
+
7
+ ## Parameters
8
+
9
+ ### engineCore
10
+
11
+ `IEngineCore`\<[`IEngineServerConfig`](../interfaces/IEngineServerConfig.md)\>
12
+
13
+ The engine core.
14
+
15
+ ### context
16
+
17
+ `IEngineCoreContext`\<[`IEngineServerConfig`](../interfaces/IEngineServerConfig.md)\>
18
+
19
+ The context for the engine.
20
+
21
+ ### instanceConfig
22
+
23
+ [`AuthenticationRateComponentConfig`](../type-aliases/AuthenticationRateComponentConfig.md)
24
+
25
+ The instance config.
26
+
27
+ ## Returns
28
+
29
+ `EngineTypeInitialiserReturn`\<[`AuthenticationRateComponentConfig`](../type-aliases/AuthenticationRateComponentConfig.md), `Factory`\<`IComponent`\>\>
30
+
31
+ The instance created and the factory for it.
@@ -1,6 +1,6 @@
1
1
  # Function: initialiseInformationComponent()
2
2
 
3
- > **initialiseInformationComponent**(`engineCore`, `context`, `instanceConfig`): `Promise`\<\{ `instanceType?`: `string`; `factory?`: `Factory`\<`IComponent`\>; `component?`: `IComponent`; \}\>
3
+ > **initialiseInformationComponent**(`engineCore`, `context`, `instanceConfig`): `EngineTypeInitialiserReturn`\<[`InformationComponentConfig`](../type-aliases/InformationComponentConfig.md), `Factory`\<`IComponent`\>\>
4
4
 
5
5
  Initialise the information component.
6
6
 
@@ -26,6 +26,6 @@ The instance config.
26
26
 
27
27
  ## Returns
28
28
 
29
- `Promise`\<\{ `instanceType?`: `string`; `factory?`: `Factory`\<`IComponent`\>; `component?`: `IComponent`; \}\>
29
+ `EngineTypeInitialiserReturn`\<[`InformationComponentConfig`](../type-aliases/InformationComponentConfig.md), `Factory`\<`IComponent`\>\>
30
30
 
31
31
  The instance created and the factory for it.
@@ -1,6 +1,6 @@
1
1
  # Function: initialiseMimeTypeProcessorComponent()
2
2
 
3
- > **initialiseMimeTypeProcessorComponent**(`engineCore`, `context`, `instanceConfig`): `Promise`\<\{ `instanceType?`: `string`; `factory?`: `Factory`\<`IMimeTypeProcessor`\>; `component?`: `IComponent`; \}\>
3
+ > **initialiseMimeTypeProcessorComponent**(`engineCore`, `context`, `instanceConfig`): `EngineTypeInitialiserReturn`\<[`MimeTypeProcessorConfig`](../type-aliases/MimeTypeProcessorConfig.md), `Factory`\<`IMimeTypeProcessor`\>\>
4
4
 
5
5
  Initialise the mime type processor.
6
6
 
@@ -26,6 +26,6 @@ The instance config.
26
26
 
27
27
  ## Returns
28
28
 
29
- `Promise`\<\{ `instanceType?`: `string`; `factory?`: `Factory`\<`IMimeTypeProcessor`\>; `component?`: `IComponent`; \}\>
29
+ `EngineTypeInitialiserReturn`\<[`MimeTypeProcessorConfig`](../type-aliases/MimeTypeProcessorConfig.md), `Factory`\<`IMimeTypeProcessor`\>\>
30
30
 
31
31
  The instance created and the factory for it.
@@ -1,6 +1,6 @@
1
1
  # Function: initialiseRestRouteProcessorComponent()
2
2
 
3
- > **initialiseRestRouteProcessorComponent**(`engineCore`, `context`, `instanceConfig`): `Promise`\<\{ `instanceType?`: `string`; `factory?`: `Factory`\<`IRestRouteProcessor`\>; `component?`: `IComponent`; \}\>
3
+ > **initialiseRestRouteProcessorComponent**(`engineCore`, `context`, `instanceConfig`): `EngineTypeInitialiserReturn`\<[`RestRouteProcessorConfig`](../type-aliases/RestRouteProcessorConfig.md), `Factory`\<`IRestRouteProcessor`\>\>
4
4
 
5
5
  Initialise the rest route processor.
6
6
 
@@ -26,6 +26,6 @@ The instance config.
26
26
 
27
27
  ## Returns
28
28
 
29
- `Promise`\<\{ `instanceType?`: `string`; `factory?`: `Factory`\<`IRestRouteProcessor`\>; `component?`: `IComponent`; \}\>
29
+ `EngineTypeInitialiserReturn`\<[`RestRouteProcessorConfig`](../type-aliases/RestRouteProcessorConfig.md), `Factory`\<`IRestRouteProcessor`\>\>
30
30
 
31
31
  The instance created and the factory for it.
@@ -1,6 +1,6 @@
1
1
  # Function: initialiseSocketRouteProcessorComponent()
2
2
 
3
- > **initialiseSocketRouteProcessorComponent**(`engineCore`, `context`, `instanceConfig`): `Promise`\<\{ `instanceType?`: `string`; `factory?`: `Factory`\<`ISocketRouteProcessor`\>; `component?`: `IComponent`; \}\>
3
+ > **initialiseSocketRouteProcessorComponent**(`engineCore`, `context`, `instanceConfig`): `EngineTypeInitialiserReturn`\<[`SocketRouteProcessorConfig`](../type-aliases/SocketRouteProcessorConfig.md), `Factory`\<`ISocketRouteProcessor`\>\>
4
4
 
5
5
  Initialise the socket route processor.
6
6
 
@@ -26,6 +26,6 @@ The instance config.
26
26
 
27
27
  ## Returns
28
28
 
29
- `Promise`\<\{ `instanceType?`: `string`; `factory?`: `Factory`\<`ISocketRouteProcessor`\>; `component?`: `IComponent`; \}\>
29
+ `EngineTypeInitialiserReturn`\<[`SocketRouteProcessorConfig`](../type-aliases/SocketRouteProcessorConfig.md), `Factory`\<`ISocketRouteProcessor`\>\>
30
30
 
31
31
  The instance created and the factory for it.
@@ -7,13 +7,17 @@
7
7
  ## Type Aliases
8
8
 
9
9
  - [AuthenticationAdminComponentConfig](type-aliases/AuthenticationAdminComponentConfig.md)
10
+ - [AuthenticationAuditComponentConfig](type-aliases/AuthenticationAuditComponentConfig.md)
10
11
  - [AuthenticationComponentConfig](type-aliases/AuthenticationComponentConfig.md)
12
+ - [AuthenticationRateComponentConfig](type-aliases/AuthenticationRateComponentConfig.md)
11
13
  - [InformationComponentConfig](type-aliases/InformationComponentConfig.md)
12
14
  - [MimeTypeProcessorConfig](type-aliases/MimeTypeProcessorConfig.md)
13
15
  - [RestRouteProcessorConfig](type-aliases/RestRouteProcessorConfig.md)
14
16
  - [SocketRouteProcessorConfig](type-aliases/SocketRouteProcessorConfig.md)
15
17
  - [AuthenticationAdminComponentType](type-aliases/AuthenticationAdminComponentType.md)
18
+ - [AuthenticationAuditComponentType](type-aliases/AuthenticationAuditComponentType.md)
16
19
  - [AuthenticationComponentType](type-aliases/AuthenticationComponentType.md)
20
+ - [AuthenticationRateComponentType](type-aliases/AuthenticationRateComponentType.md)
17
21
  - [InformationComponentType](type-aliases/InformationComponentType.md)
18
22
  - [MimeTypeProcessorType](type-aliases/MimeTypeProcessorType.md)
19
23
  - [RestRouteProcessorType](type-aliases/RestRouteProcessorType.md)
@@ -22,7 +26,9 @@
22
26
  ## Variables
23
27
 
24
28
  - [AuthenticationAdminComponentType](variables/AuthenticationAdminComponentType.md)
29
+ - [AuthenticationAuditComponentType](variables/AuthenticationAuditComponentType.md)
25
30
  - [AuthenticationComponentType](variables/AuthenticationComponentType.md)
31
+ - [AuthenticationRateComponentType](variables/AuthenticationRateComponentType.md)
26
32
  - [InformationComponentType](variables/InformationComponentType.md)
27
33
  - [MimeTypeProcessorType](variables/MimeTypeProcessorType.md)
28
34
  - [RestRouteProcessorType](variables/RestRouteProcessorType.md)
@@ -32,6 +38,8 @@
32
38
 
33
39
  - [initialiseAuthenticationComponent](functions/initialiseAuthenticationComponent.md)
34
40
  - [initialiseAuthenticationAdminComponent](functions/initialiseAuthenticationAdminComponent.md)
41
+ - [initialiseAuthenticationAuditComponent](functions/initialiseAuthenticationAuditComponent.md)
42
+ - [initialiseAuthenticationRateComponent](functions/initialiseAuthenticationRateComponent.md)
35
43
  - [initialiseInformationComponent](functions/initialiseInformationComponent.md)
36
44
  - [initialiseMimeTypeProcessorComponent](functions/initialiseMimeTypeProcessorComponent.md)
37
45
  - [initialiseRestRouteProcessorComponent](functions/initialiseRestRouteProcessorComponent.md)