@twin.org/engine-server-types 0.0.2-next.9 → 0.0.3-next.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.
Files changed (75) hide show
  1. package/dist/es/components/authentication.js +40 -0
  2. package/dist/es/components/authentication.js.map +1 -0
  3. package/dist/es/components/authenticationAdmin.js +33 -0
  4. package/dist/es/components/authenticationAdmin.js.map +1 -0
  5. package/dist/es/components/information.js +29 -0
  6. package/dist/es/components/information.js.map +1 -0
  7. package/dist/es/components/mimeTypeProcessor.js +26 -0
  8. package/dist/es/components/mimeTypeProcessor.js.map +1 -0
  9. package/dist/es/components/restRouteProcessor.js +76 -0
  10. package/dist/es/components/restRouteProcessor.js.map +1 -0
  11. package/dist/es/components/socketRouteProcessor.js +73 -0
  12. package/dist/es/components/socketRouteProcessor.js.map +1 -0
  13. package/dist/es/index.js +22 -0
  14. package/dist/es/index.js.map +1 -0
  15. package/dist/es/models/IEngineServerConfig.js +2 -0
  16. package/dist/es/models/IEngineServerConfig.js.map +1 -0
  17. package/dist/es/models/config/authenticationAdminComponentConfig.js +2 -0
  18. package/dist/es/models/config/authenticationAdminComponentConfig.js.map +1 -0
  19. package/dist/es/models/config/authenticationComponentConfig.js +2 -0
  20. package/dist/es/models/config/authenticationComponentConfig.js.map +1 -0
  21. package/dist/es/models/config/informationComponentConfig.js +2 -0
  22. package/dist/es/models/config/informationComponentConfig.js.map +1 -0
  23. package/dist/es/models/config/mimeTypeProcessorConfig.js +2 -0
  24. package/dist/es/models/config/mimeTypeProcessorConfig.js.map +1 -0
  25. package/dist/es/models/config/restRouteProcessorConfig.js +2 -0
  26. package/dist/es/models/config/restRouteProcessorConfig.js.map +1 -0
  27. package/dist/es/models/config/socketRouteProcessorConfig.js +2 -0
  28. package/dist/es/models/config/socketRouteProcessorConfig.js.map +1 -0
  29. package/dist/es/models/types/authenticationAdminComponentType.js +13 -0
  30. package/dist/es/models/types/authenticationAdminComponentType.js.map +1 -0
  31. package/dist/es/models/types/authenticationComponentType.js +17 -0
  32. package/dist/es/models/types/authenticationComponentType.js.map +1 -0
  33. package/dist/es/models/types/informationComponentType.js +17 -0
  34. package/dist/es/models/types/informationComponentType.js.map +1 -0
  35. package/dist/es/models/types/mimeTypeProcessorType.js +13 -0
  36. package/dist/es/models/types/mimeTypeProcessorType.js.map +1 -0
  37. package/dist/es/models/types/restRouteProcessorType.js +37 -0
  38. package/dist/es/models/types/restRouteProcessorType.js.map +1 -0
  39. package/dist/es/models/types/socketRouteProcessorType.js +37 -0
  40. package/dist/es/models/types/socketRouteProcessorType.js.map +1 -0
  41. package/dist/types/components/authentication.d.ts +9 -6
  42. package/dist/types/components/authenticationAdmin.d.ts +9 -6
  43. package/dist/types/components/information.d.ts +9 -6
  44. package/dist/types/components/mimeTypeProcessor.d.ts +10 -6
  45. package/dist/types/components/restRouteProcessor.d.ts +11 -7
  46. package/dist/types/components/socketRouteProcessor.d.ts +10 -6
  47. package/dist/types/index.d.ts +19 -19
  48. package/dist/types/models/IEngineServerConfig.d.ts +6 -6
  49. package/dist/types/models/config/authenticationAdminComponentConfig.d.ts +1 -1
  50. package/dist/types/models/config/authenticationComponentConfig.d.ts +1 -1
  51. package/dist/types/models/config/informationComponentConfig.d.ts +1 -1
  52. package/dist/types/models/config/mimeTypeProcessorConfig.d.ts +1 -1
  53. package/dist/types/models/config/restRouteProcessorConfig.d.ts +14 -6
  54. package/dist/types/models/config/socketRouteProcessorConfig.d.ts +14 -6
  55. package/dist/types/models/types/restRouteProcessorType.d.ts +12 -4
  56. package/dist/types/models/types/socketRouteProcessorType.d.ts +12 -4
  57. package/docs/changelog.md +307 -0
  58. package/docs/reference/functions/initialiseAuthenticationAdminComponent.md +3 -13
  59. package/docs/reference/functions/initialiseAuthenticationComponent.md +3 -13
  60. package/docs/reference/functions/initialiseInformationComponent.md +3 -13
  61. package/docs/reference/functions/initialiseMimeTypeProcessorComponent.md +3 -13
  62. package/docs/reference/functions/initialiseRestRouteProcessorComponent.md +3 -13
  63. package/docs/reference/functions/initialiseSocketRouteProcessorComponent.md +3 -13
  64. package/docs/reference/interfaces/IEngineServerConfig.md +1 -1
  65. package/docs/reference/type-aliases/RestRouteProcessorConfig.md +1 -1
  66. package/docs/reference/type-aliases/SocketRouteProcessorConfig.md +1 -1
  67. package/docs/reference/variables/AuthenticationAdminComponentType.md +1 -1
  68. package/docs/reference/variables/AuthenticationComponentType.md +1 -1
  69. package/docs/reference/variables/InformationComponentType.md +1 -1
  70. package/docs/reference/variables/MimeTypeProcessorType.md +1 -1
  71. package/docs/reference/variables/RestRouteProcessorType.md +19 -7
  72. package/docs/reference/variables/SocketRouteProcessorType.md +19 -7
  73. package/package.json +23 -10
  74. package/dist/cjs/index.cjs +0 -427
  75. package/dist/esm/index.mjs +0 -414
@@ -0,0 +1,40 @@
1
+ import { EntityStorageAuthenticationRestClient } from "@twin.org/api-auth-entity-storage-rest-client";
2
+ import { EntityStorageAuthenticationService, initSchema as initSchemaAuthEntityStorage } from "@twin.org/api-auth-entity-storage-service";
3
+ import { ContextIdHelper, ContextIdKeys } from "@twin.org/context";
4
+ import { ComponentFactory } from "@twin.org/core";
5
+ import { initialiseEntityStorageConnector } from "@twin.org/engine-types";
6
+ import { AuthenticationComponentType } from "../models/types/authenticationComponentType.js";
7
+ /**
8
+ * Initialise the authentication.
9
+ * @param engineCore The engine core.
10
+ * @param context The context for the engine.
11
+ * @param instanceConfig The instance config.
12
+ * @returns The instance created and the factory for it.
13
+ */
14
+ export async function initialiseAuthenticationComponent(engineCore, context, instanceConfig) {
15
+ let component;
16
+ let instanceType;
17
+ if (instanceConfig.type === AuthenticationComponentType.EntityStorage) {
18
+ initSchemaAuthEntityStorage();
19
+ initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.userEntityStorageType, "AuthenticationUser", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [
20
+ ContextIdKeys.Node,
21
+ ContextIdKeys.Tenant
22
+ ]));
23
+ component = new EntityStorageAuthenticationService({
24
+ vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
25
+ authenticationAdminServiceType: engineCore.getRegisteredInstanceType("authenticationAdminComponent"),
26
+ ...instanceConfig.options
27
+ });
28
+ instanceType = "entity-storage-authentication-service";
29
+ }
30
+ else if (instanceConfig.type === AuthenticationComponentType.RestClient) {
31
+ component = new EntityStorageAuthenticationRestClient(instanceConfig.options);
32
+ instanceType = "entity-storage-authentication-rest-client";
33
+ }
34
+ return {
35
+ component,
36
+ instanceType,
37
+ factory: ComponentFactory
38
+ };
39
+ }
40
+ //# sourceMappingURL=authentication.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authentication.js","sourceRoot":"","sources":["../../../src/components/authentication.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,qCAAqC,EAAE,MAAM,+CAA+C,CAAC;AACtG,OAAO,EACN,kCAAkC,EAClC,UAAU,IAAI,2BAA2B,EAEzC,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AAEnE,OAAO,EAAE,gCAAgC,EAAE,MAAM,wBAAwB,CAAC;AAI1E,OAAO,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAE7F;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,iCAAiC,CACtD,UAA4C,EAC5C,OAAgD,EAChD,cAA6C;IAE7C,IAAI,SAA+C,CAAC;IACpD,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,2BAA2B,CAAC,aAAa,EAAE,CAAC;QACvE,2BAA2B,EAAE,CAAC;QAC9B,gCAAgC,CAC/B,UAAU,EACV,OAAO,EACP,cAAc,CAAC,OAAO,EAAE,qBAAqB,wBAE7C,eAAe,CAAC,qBAAqB,CAAC,UAAU,CAAC,gBAAgB,EAAE,EAAE;YACpE,aAAa,CAAC,IAAI;YAClB,aAAa,CAAC,MAAM;SACpB,CAAC,CACF,CAAC;QAEF,SAAS,GAAG,IAAI,kCAAkC,CAAC;YAClD,kBAAkB,EAAE,UAAU,CAAC,yBAAyB,CAAC,gBAAgB,CAAC;YAC1E,8BAA8B,EAAE,UAAU,CAAC,yBAAyB,CACnE,8BAA8B,CAC9B;YACD,GAAG,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,0CAAsD,CAAC;IACpE,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,2BAA2B,CAAC,UAAU,EAAE,CAAC;QAC3E,SAAS,GAAG,IAAI,qCAAqC,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QAC9E,YAAY,8CAAyD,CAAC;IACvE,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IAuthenticationComponent } from \"@twin.org/api-auth-entity-storage-models\";\nimport { EntityStorageAuthenticationRestClient } from \"@twin.org/api-auth-entity-storage-rest-client\";\nimport {\n\tEntityStorageAuthenticationService,\n\tinitSchema as initSchemaAuthEntityStorage,\n\ttype AuthenticationUser\n} from \"@twin.org/api-auth-entity-storage-service\";\nimport { ContextIdHelper, ContextIdKeys } from \"@twin.org/context\";\nimport { ComponentFactory, type IComponent } from \"@twin.org/core\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport { initialiseEntityStorageConnector } from \"@twin.org/engine-types\";\nimport { nameof, nameofKebabCase } from \"@twin.org/nameof\";\nimport type { AuthenticationComponentConfig } from \"../models/config/authenticationComponentConfig.js\";\nimport type { IEngineServerConfig } from \"../models/IEngineServerConfig.js\";\nimport { AuthenticationComponentType } from \"../models/types/authenticationComponentType.js\";\n\n/**\n * Initialise the authentication.\n * @param engineCore The engine core.\n * @param context The context for the engine.\n * @param instanceConfig The instance config.\n * @returns The instance created and the factory for it.\n */\nexport async function initialiseAuthenticationComponent(\n\tengineCore: IEngineCore<IEngineServerConfig>,\n\tcontext: IEngineCoreContext<IEngineServerConfig>,\n\tinstanceConfig: AuthenticationComponentConfig\n): Promise<{ instanceType?: string; factory?: typeof ComponentFactory; component?: IComponent }> {\n\tlet component: IAuthenticationComponent | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === AuthenticationComponentType.EntityStorage) {\n\t\tinitSchemaAuthEntityStorage();\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.userEntityStorageType,\n\t\t\tnameof<AuthenticationUser>(),\n\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [\n\t\t\t\tContextIdKeys.Node,\n\t\t\t\tContextIdKeys.Tenant\n\t\t\t])\n\t\t);\n\n\t\tcomponent = new EntityStorageAuthenticationService({\n\t\t\tvaultConnectorType: engineCore.getRegisteredInstanceType(\"vaultConnector\"),\n\t\t\tauthenticationAdminServiceType: engineCore.getRegisteredInstanceType(\n\t\t\t\t\"authenticationAdminComponent\"\n\t\t\t),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = nameofKebabCase(EntityStorageAuthenticationService);\n\t} else if (instanceConfig.type === AuthenticationComponentType.RestClient) {\n\t\tcomponent = new EntityStorageAuthenticationRestClient(instanceConfig.options);\n\t\tinstanceType = nameofKebabCase(EntityStorageAuthenticationRestClient);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
@@ -0,0 +1,33 @@
1
+ import { EntityStorageAuthenticationAdminService, initSchema as initSchemaAuthEntityStorage } from "@twin.org/api-auth-entity-storage-service";
2
+ import { ContextIdHelper, ContextIdKeys } from "@twin.org/context";
3
+ import { ComponentFactory } from "@twin.org/core";
4
+ import { initialiseEntityStorageConnector } from "@twin.org/engine-types";
5
+ import { AuthenticationAdminComponentType } from "../models/types/authenticationAdminComponentType.js";
6
+ /**
7
+ * Initialise the authentication admin.
8
+ * @param engineCore The engine core.
9
+ * @param context The context for the engine.
10
+ * @param instanceConfig The instance config.
11
+ * @returns The instance created and the factory for it.
12
+ */
13
+ export async function initialiseAuthenticationAdminComponent(engineCore, context, instanceConfig) {
14
+ let component;
15
+ let instanceType;
16
+ if (instanceConfig.type === AuthenticationAdminComponentType.EntityStorage) {
17
+ initSchemaAuthEntityStorage();
18
+ initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.userEntityStorageType, "AuthenticationUser", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [
19
+ ContextIdKeys.Node,
20
+ ContextIdKeys.Tenant
21
+ ]));
22
+ component = new EntityStorageAuthenticationAdminService({
23
+ ...instanceConfig.options
24
+ });
25
+ instanceType = "entity-storage-authentication-admin-service";
26
+ }
27
+ return {
28
+ component,
29
+ instanceType,
30
+ factory: ComponentFactory
31
+ };
32
+ }
33
+ //# sourceMappingURL=authenticationAdmin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authenticationAdmin.js","sourceRoot":"","sources":["../../../src/components/authenticationAdmin.ts"],"names":[],"mappings":"AAGA,OAAO,EACN,uCAAuC,EACvC,UAAU,IAAI,2BAA2B,EAEzC,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AAEnE,OAAO,EAAE,gCAAgC,EAAE,MAAM,wBAAwB,CAAC;AAI1E,OAAO,EAAE,gCAAgC,EAAE,MAAM,qDAAqD,CAAC;AAEvG;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,sCAAsC,CAC3D,UAA4C,EAC5C,OAAgD,EAChD,cAAkD;IAElD,IAAI,SAAoD,CAAC;IACzD,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,gCAAgC,CAAC,aAAa,EAAE,CAAC;QAC5E,2BAA2B,EAAE,CAAC;QAC9B,gCAAgC,CAC/B,UAAU,EACV,OAAO,EACP,cAAc,CAAC,OAAO,EAAE,qBAAqB,wBAE7C,eAAe,CAAC,qBAAqB,CAAC,UAAU,CAAC,gBAAgB,EAAE,EAAE;YACpE,aAAa,CAAC,IAAI;YAClB,aAAa,CAAC,MAAM;SACpB,CAAC,CACF,CAAC;QAEF,SAAS,GAAG,IAAI,uCAAuC,CAAC;YACvD,GAAG,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,gDAA2D,CAAC;IACzE,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IAuthenticationAdminComponent } from \"@twin.org/api-auth-entity-storage-models\";\nimport {\n\tEntityStorageAuthenticationAdminService,\n\tinitSchema as initSchemaAuthEntityStorage,\n\ttype AuthenticationUser\n} from \"@twin.org/api-auth-entity-storage-service\";\nimport { ContextIdHelper, ContextIdKeys } from \"@twin.org/context\";\nimport { ComponentFactory, type IComponent } from \"@twin.org/core\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport { initialiseEntityStorageConnector } from \"@twin.org/engine-types\";\nimport { nameof, nameofKebabCase } from \"@twin.org/nameof\";\nimport type { AuthenticationAdminComponentConfig } from \"../models/config/authenticationAdminComponentConfig.js\";\nimport type { IEngineServerConfig } from \"../models/IEngineServerConfig.js\";\nimport { AuthenticationAdminComponentType } from \"../models/types/authenticationAdminComponentType.js\";\n\n/**\n * Initialise the authentication admin.\n * @param engineCore The engine core.\n * @param context The context for the engine.\n * @param instanceConfig The instance config.\n * @returns The instance created and the factory for it.\n */\nexport async function initialiseAuthenticationAdminComponent(\n\tengineCore: IEngineCore<IEngineServerConfig>,\n\tcontext: IEngineCoreContext<IEngineServerConfig>,\n\tinstanceConfig: AuthenticationAdminComponentConfig\n): Promise<{ instanceType?: string; factory?: typeof ComponentFactory; component?: IComponent }> {\n\tlet component: IAuthenticationAdminComponent | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === AuthenticationAdminComponentType.EntityStorage) {\n\t\tinitSchemaAuthEntityStorage();\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.userEntityStorageType,\n\t\t\tnameof<AuthenticationUser>(),\n\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [\n\t\t\t\tContextIdKeys.Node,\n\t\t\t\tContextIdKeys.Tenant\n\t\t\t])\n\t\t);\n\n\t\tcomponent = new EntityStorageAuthenticationAdminService({\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = nameofKebabCase(EntityStorageAuthenticationAdminService);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
@@ -0,0 +1,29 @@
1
+ import { InformationRestClient } from "@twin.org/api-rest-client";
2
+ import { InformationService } from "@twin.org/api-service";
3
+ import { ComponentFactory } from "@twin.org/core";
4
+ import { InformationComponentType } from "../models/types/informationComponentType.js";
5
+ /**
6
+ * Initialise the information component.
7
+ * @param engineCore The engine core.
8
+ * @param context The context for the engine.
9
+ * @param instanceConfig The instance config.
10
+ * @returns The instance created and the factory for it.
11
+ */
12
+ export async function initialiseInformationComponent(engineCore, context, instanceConfig) {
13
+ let component;
14
+ let instanceType;
15
+ if (instanceConfig.type === InformationComponentType.Service) {
16
+ component = new InformationService(instanceConfig.options);
17
+ instanceType = "information-service";
18
+ }
19
+ else if (instanceConfig.type === InformationComponentType.RestClient) {
20
+ component = new InformationRestClient(instanceConfig.options);
21
+ instanceType = "information-rest-client";
22
+ }
23
+ return {
24
+ component,
25
+ instanceType,
26
+ factory: ComponentFactory
27
+ };
28
+ }
29
+ //# sourceMappingURL=information.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"information.js","sourceRoot":"","sources":["../../../src/components/information.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AAKnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AAEvF;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,8BAA8B,CACnD,UAA4C,EAC5C,OAAgD,EAChD,cAA0C;IAE1C,IAAI,SAA4C,CAAC;IACjD,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,wBAAwB,CAAC,OAAO,EAAE,CAAC;QAC9D,SAAS,GAAG,IAAI,kBAAkB,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QAC3D,YAAY,wBAAsC,CAAC;IACpD,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,wBAAwB,CAAC,UAAU,EAAE,CAAC;QACxE,SAAS,GAAG,IAAI,qBAAqB,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QAC9D,YAAY,4BAAyC,CAAC;IACvD,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IInformationComponent } from \"@twin.org/api-models\";\nimport { InformationRestClient } from \"@twin.org/api-rest-client\";\nimport { InformationService } from \"@twin.org/api-service\";\nimport { ComponentFactory, type IComponent } from \"@twin.org/core\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport { nameofKebabCase } from \"@twin.org/nameof\";\nimport type { InformationComponentConfig } from \"../models/config/informationComponentConfig.js\";\nimport type { IEngineServerConfig } from \"../models/IEngineServerConfig.js\";\nimport { InformationComponentType } from \"../models/types/informationComponentType.js\";\n\n/**\n * Initialise the information component.\n * @param engineCore The engine core.\n * @param context The context for the engine.\n * @param instanceConfig The instance config.\n * @returns The instance created and the factory for it.\n */\nexport async function initialiseInformationComponent(\n\tengineCore: IEngineCore<IEngineServerConfig>,\n\tcontext: IEngineCoreContext<IEngineServerConfig>,\n\tinstanceConfig: InformationComponentConfig\n): Promise<{ instanceType?: string; factory?: typeof ComponentFactory; component?: IComponent }> {\n\tlet component: IInformationComponent | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === InformationComponentType.Service) {\n\t\tcomponent = new InformationService(instanceConfig.options);\n\t\tinstanceType = nameofKebabCase(InformationService);\n\t} else if (instanceConfig.type === InformationComponentType.RestClient) {\n\t\tcomponent = new InformationRestClient(instanceConfig.options);\n\t\tinstanceType = nameofKebabCase(InformationRestClient);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
@@ -0,0 +1,26 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ import { MimeTypeProcessorFactory } from "@twin.org/api-models";
4
+ import { JwtMimeTypeProcessor } from "@twin.org/api-processors";
5
+ import { MimeTypeProcessorType } from "../models/types/mimeTypeProcessorType.js";
6
+ /**
7
+ * Initialise the mime type processor.
8
+ * @param engineCore The engine core.
9
+ * @param context The context for the engine.
10
+ * @param instanceConfig The instance config.
11
+ * @returns The instance created and the factory for it.
12
+ */
13
+ export async function initialiseMimeTypeProcessorComponent(engineCore, context, instanceConfig) {
14
+ let component;
15
+ let instanceType;
16
+ if (instanceConfig.type === MimeTypeProcessorType.Jwt) {
17
+ component = new JwtMimeTypeProcessor();
18
+ instanceType = "jwt-mime-type-processor";
19
+ }
20
+ return {
21
+ component,
22
+ instanceType,
23
+ factory: MimeTypeProcessorFactory
24
+ };
25
+ }
26
+ //# sourceMappingURL=mimeTypeProcessor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mimeTypeProcessor.js","sourceRoot":"","sources":["../../../src/components/mimeTypeProcessor.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,wBAAwB,EAA2B,MAAM,sBAAsB,CAAC;AACzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAMhE,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AAEjF;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,oCAAoC,CACzD,UAA4C,EAC5C,OAAgD,EAChD,cAAuC;IAMvC,IAAI,SAAyC,CAAC;IAC9C,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,qBAAqB,CAAC,GAAG,EAAE,CAAC;QACvD,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;QACvC,YAAY,4BAAwC,CAAC;IACtD,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,wBAAwB;KACjC,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { MimeTypeProcessorFactory, type IMimeTypeProcessor } from \"@twin.org/api-models\";\nimport { JwtMimeTypeProcessor } from \"@twin.org/api-processors\";\nimport type { IComponent } from \"@twin.org/core\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport { nameofKebabCase } from \"@twin.org/nameof\";\nimport type { MimeTypeProcessorConfig } from \"../models/config/mimeTypeProcessorConfig.js\";\nimport type { IEngineServerConfig } from \"../models/IEngineServerConfig.js\";\nimport { MimeTypeProcessorType } from \"../models/types/mimeTypeProcessorType.js\";\n\n/**\n * Initialise the mime type processor.\n * @param engineCore The engine core.\n * @param context The context for the engine.\n * @param instanceConfig The instance config.\n * @returns The instance created and the factory for it.\n */\nexport async function initialiseMimeTypeProcessorComponent(\n\tengineCore: IEngineCore<IEngineServerConfig>,\n\tcontext: IEngineCoreContext<IEngineServerConfig>,\n\tinstanceConfig: MimeTypeProcessorConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof MimeTypeProcessorFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IMimeTypeProcessor | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === MimeTypeProcessorType.Jwt) {\n\t\tcomponent = new JwtMimeTypeProcessor();\n\t\tinstanceType = nameofKebabCase(JwtMimeTypeProcessor);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: MimeTypeProcessorFactory\n\t};\n}\n"]}
@@ -0,0 +1,76 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ import { AuthHeaderProcessor } from "@twin.org/api-auth-entity-storage-service";
4
+ import { RestRouteProcessorFactory } from "@twin.org/api-models";
5
+ import { LoggingProcessor, ContextIdProcessor, RestRouteProcessor, StaticContextIdProcessor } from "@twin.org/api-processors";
6
+ import { initSchema as initSchemaTenantProcessor, TenantProcessor } from "@twin.org/api-tenant-processor";
7
+ import { ContextIdHelper, ContextIdKeys } from "@twin.org/context";
8
+ import { initialiseEntityStorageConnector } from "@twin.org/engine-types";
9
+ import { VerifiableCredentialAuthenticationProcessor } from "@twin.org/identity-authentication";
10
+ import { RestRouteProcessorType } from "../models/types/restRouteProcessorType.js";
11
+ /**
12
+ * Initialise the rest route processor.
13
+ * @param engineCore The engine core.
14
+ * @param context The context for the engine.
15
+ * @param instanceConfig The instance config.
16
+ * @returns The instance created and the factory for it.
17
+ */
18
+ export async function initialiseRestRouteProcessorComponent(engineCore, context, instanceConfig) {
19
+ let component;
20
+ let instanceType;
21
+ if (instanceConfig.type === RestRouteProcessorType.AuthHeader) {
22
+ component = new AuthHeaderProcessor({
23
+ vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
24
+ config: {
25
+ ...instanceConfig.options?.config
26
+ }
27
+ });
28
+ instanceType = "auth-header-processor";
29
+ }
30
+ else if (instanceConfig.type === RestRouteProcessorType.AuthVerifiableCredential) {
31
+ component = new VerifiableCredentialAuthenticationProcessor({
32
+ identityConnectorType: engineCore.getRegisteredInstanceType("identityConnector"),
33
+ loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
34
+ config: {
35
+ ...instanceConfig.options?.config
36
+ }
37
+ });
38
+ instanceType = "verifiable-credential-authentication-processor";
39
+ }
40
+ else if (instanceConfig.type === RestRouteProcessorType.Logging) {
41
+ component = new LoggingProcessor({
42
+ loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
43
+ config: {
44
+ ...instanceConfig.options?.config
45
+ }
46
+ });
47
+ instanceType = "logging-processor";
48
+ }
49
+ else if (instanceConfig.type === RestRouteProcessorType.ContextId) {
50
+ component = new ContextIdProcessor(instanceConfig.options);
51
+ instanceType = "context-id-processor";
52
+ }
53
+ else if (instanceConfig.type === RestRouteProcessorType.StaticContextId) {
54
+ component = new StaticContextIdProcessor(instanceConfig.options);
55
+ instanceType = "static-context-id-processor";
56
+ }
57
+ else if (instanceConfig.type === RestRouteProcessorType.RestRoute) {
58
+ component = new RestRouteProcessor(instanceConfig.options);
59
+ instanceType = "rest-route-processor";
60
+ }
61
+ else if (instanceConfig.type === RestRouteProcessorType.Tenant) {
62
+ initSchemaTenantProcessor();
63
+ initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.tenantEntityStorageType, "Tenant", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [
64
+ ContextIdKeys.Node,
65
+ ContextIdKeys.Tenant
66
+ ]));
67
+ component = new TenantProcessor(instanceConfig.options);
68
+ instanceType = "tenant-processor";
69
+ }
70
+ return {
71
+ component,
72
+ instanceType,
73
+ factory: RestRouteProcessorFactory
74
+ };
75
+ }
76
+ //# sourceMappingURL=restRouteProcessor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"restRouteProcessor.js","sourceRoot":"","sources":["../../../src/components/restRouteProcessor.ts"],"names":[],"mappings":"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","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { AuthHeaderProcessor } from \"@twin.org/api-auth-entity-storage-service\";\nimport { RestRouteProcessorFactory, type IBaseRouteProcessor } from \"@twin.org/api-models\";\nimport {\n\tLoggingProcessor,\n\tContextIdProcessor,\n\tRestRouteProcessor,\n\tStaticContextIdProcessor\n} from \"@twin.org/api-processors\";\nimport {\n\tinitSchema as initSchemaTenantProcessor,\n\ttype Tenant,\n\tTenantProcessor\n} from \"@twin.org/api-tenant-processor\";\nimport { ContextIdHelper, ContextIdKeys } from \"@twin.org/context\";\nimport type { IComponent } from \"@twin.org/core\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport { initialiseEntityStorageConnector } from \"@twin.org/engine-types\";\nimport { VerifiableCredentialAuthenticationProcessor } from \"@twin.org/identity-authentication\";\nimport { nameof, nameofKebabCase } from \"@twin.org/nameof\";\nimport type { RestRouteProcessorConfig } from \"../models/config/restRouteProcessorConfig.js\";\nimport type { IEngineServerConfig } from \"../models/IEngineServerConfig.js\";\nimport { RestRouteProcessorType } from \"../models/types/restRouteProcessorType.js\";\n\n/**\n * Initialise the rest route processor.\n * @param engineCore The engine core.\n * @param context The context for the engine.\n * @param instanceConfig The instance config.\n * @returns The instance created and the factory for it.\n */\nexport async function initialiseRestRouteProcessorComponent(\n\tengineCore: IEngineCore<IEngineServerConfig>,\n\tcontext: IEngineCoreContext<IEngineServerConfig>,\n\tinstanceConfig: RestRouteProcessorConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof RestRouteProcessorFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IBaseRouteProcessor | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === RestRouteProcessorType.AuthHeader) {\n\t\tcomponent = new AuthHeaderProcessor({\n\t\t\tvaultConnectorType: engineCore.getRegisteredInstanceType(\"vaultConnector\"),\n\t\t\tconfig: {\n\t\t\t\t...instanceConfig.options?.config\n\t\t\t}\n\t\t});\n\t\tinstanceType = nameofKebabCase(AuthHeaderProcessor);\n\t} else if (instanceConfig.type === RestRouteProcessorType.AuthVerifiableCredential) {\n\t\tcomponent = new VerifiableCredentialAuthenticationProcessor({\n\t\t\tidentityConnectorType: engineCore.getRegisteredInstanceType(\"identityConnector\"),\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\tconfig: {\n\t\t\t\t...instanceConfig.options?.config\n\t\t\t}\n\t\t});\n\t\tinstanceType = nameofKebabCase(VerifiableCredentialAuthenticationProcessor);\n\t} else if (instanceConfig.type === RestRouteProcessorType.Logging) {\n\t\tcomponent = new LoggingProcessor({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\tconfig: {\n\t\t\t\t...instanceConfig.options?.config\n\t\t\t}\n\t\t});\n\t\tinstanceType = nameofKebabCase(LoggingProcessor);\n\t} else if (instanceConfig.type === RestRouteProcessorType.ContextId) {\n\t\tcomponent = new ContextIdProcessor(instanceConfig.options);\n\t\tinstanceType = nameofKebabCase(ContextIdProcessor);\n\t} else if (instanceConfig.type === RestRouteProcessorType.StaticContextId) {\n\t\tcomponent = new StaticContextIdProcessor(instanceConfig.options);\n\t\tinstanceType = nameofKebabCase(StaticContextIdProcessor);\n\t} else if (instanceConfig.type === RestRouteProcessorType.RestRoute) {\n\t\tcomponent = new RestRouteProcessor(instanceConfig.options);\n\t\tinstanceType = nameofKebabCase(RestRouteProcessor);\n\t} else if (instanceConfig.type === RestRouteProcessorType.Tenant) {\n\t\tinitSchemaTenantProcessor();\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.tenantEntityStorageType,\n\t\t\tnameof<Tenant>(),\n\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [\n\t\t\t\tContextIdKeys.Node,\n\t\t\t\tContextIdKeys.Tenant\n\t\t\t])\n\t\t);\n\n\t\tcomponent = new TenantProcessor(instanceConfig.options);\n\t\tinstanceType = nameofKebabCase(TenantProcessor);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: RestRouteProcessorFactory\n\t};\n}\n"]}
@@ -0,0 +1,73 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ import { AuthHeaderProcessor } from "@twin.org/api-auth-entity-storage-service";
4
+ import { SocketRouteProcessorFactory } from "@twin.org/api-models";
5
+ import { LoggingProcessor, ContextIdProcessor, SocketRouteProcessor, StaticContextIdProcessor } from "@twin.org/api-processors";
6
+ import { initSchema as initSchemaTenantProcessor, TenantProcessor } from "@twin.org/api-tenant-processor";
7
+ import { ContextIdHelper, ContextIdKeys } from "@twin.org/context";
8
+ import { initialiseEntityStorageConnector } from "@twin.org/engine-types";
9
+ import { VerifiableCredentialAuthenticationProcessor } from "@twin.org/identity-authentication";
10
+ import { SocketRouteProcessorType } from "../models/types/socketRouteProcessorType.js";
11
+ /**
12
+ * Initialise the socket route processor.
13
+ * @param engineCore The engine core.
14
+ * @param context The context for the engine.
15
+ * @param instanceConfig The instance config.
16
+ * @returns The instance created and the factory for it.
17
+ */
18
+ export async function initialiseSocketRouteProcessorComponent(engineCore, context, instanceConfig) {
19
+ let component;
20
+ let instanceType;
21
+ if (instanceConfig.type === SocketRouteProcessorType.AuthHeader) {
22
+ component = new AuthHeaderProcessor({
23
+ vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
24
+ config: {
25
+ ...instanceConfig.options?.config
26
+ }
27
+ });
28
+ instanceType = "auth-header-processor";
29
+ }
30
+ else if (instanceConfig.type === SocketRouteProcessorType.AuthVerifiableCredential) {
31
+ component = new VerifiableCredentialAuthenticationProcessor({
32
+ identityConnectorType: engineCore.getRegisteredInstanceType("identityConnector"),
33
+ loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
34
+ config: {
35
+ ...instanceConfig.options?.config
36
+ }
37
+ });
38
+ instanceType = "verifiable-credential-authentication-processor";
39
+ }
40
+ else if (instanceConfig.type === SocketRouteProcessorType.Logging) {
41
+ component = new LoggingProcessor({
42
+ loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
43
+ config: {
44
+ ...instanceConfig.options?.config
45
+ }
46
+ });
47
+ instanceType = "logging-processor";
48
+ }
49
+ else if (instanceConfig.type === SocketRouteProcessorType.ContextId) {
50
+ component = new ContextIdProcessor(instanceConfig.options);
51
+ instanceType = "context-id-processor";
52
+ }
53
+ else if (instanceConfig.type === SocketRouteProcessorType.StaticContextId) {
54
+ component = new StaticContextIdProcessor(instanceConfig.options);
55
+ instanceType = "static-context-id-processor";
56
+ }
57
+ else if (instanceConfig.type === SocketRouteProcessorType.SocketRoute) {
58
+ component = new SocketRouteProcessor(instanceConfig.options);
59
+ instanceType = "socket-route-processor";
60
+ }
61
+ else if (instanceConfig.type === SocketRouteProcessorType.Tenant) {
62
+ initSchemaTenantProcessor();
63
+ initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.tenantEntityStorageType, "Tenant", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [ContextIdKeys.Node]));
64
+ component = new TenantProcessor(instanceConfig.options);
65
+ instanceType = "tenant-processor";
66
+ }
67
+ return {
68
+ component,
69
+ instanceType,
70
+ factory: SocketRouteProcessorFactory
71
+ };
72
+ }
73
+ //# sourceMappingURL=socketRouteProcessor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"socketRouteProcessor.js","sourceRoot":"","sources":["../../../src/components/socketRouteProcessor.ts"],"names":[],"mappings":"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","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { AuthHeaderProcessor } from \"@twin.org/api-auth-entity-storage-service\";\nimport { SocketRouteProcessorFactory, type IBaseRouteProcessor } from \"@twin.org/api-models\";\nimport {\n\tLoggingProcessor,\n\tContextIdProcessor,\n\tSocketRouteProcessor,\n\tStaticContextIdProcessor\n} from \"@twin.org/api-processors\";\nimport {\n\tinitSchema as initSchemaTenantProcessor,\n\ttype Tenant,\n\tTenantProcessor\n} from \"@twin.org/api-tenant-processor\";\nimport { ContextIdHelper, ContextIdKeys } from \"@twin.org/context\";\nimport type { IComponent } from \"@twin.org/core\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport { initialiseEntityStorageConnector } from \"@twin.org/engine-types\";\nimport { VerifiableCredentialAuthenticationProcessor } from \"@twin.org/identity-authentication\";\nimport { nameof, nameofKebabCase } from \"@twin.org/nameof\";\nimport type { SocketRouteProcessorConfig } from \"../models/config/socketRouteProcessorConfig.js\";\nimport type { IEngineServerConfig } from \"../models/IEngineServerConfig.js\";\nimport { SocketRouteProcessorType } from \"../models/types/socketRouteProcessorType.js\";\n\n/**\n * Initialise the socket route processor.\n * @param engineCore The engine core.\n * @param context The context for the engine.\n * @param instanceConfig The instance config.\n * @returns The instance created and the factory for it.\n */\nexport async function initialiseSocketRouteProcessorComponent(\n\tengineCore: IEngineCore<IEngineServerConfig>,\n\tcontext: IEngineCoreContext<IEngineServerConfig>,\n\tinstanceConfig: SocketRouteProcessorConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof SocketRouteProcessorFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IBaseRouteProcessor | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === SocketRouteProcessorType.AuthHeader) {\n\t\tcomponent = new AuthHeaderProcessor({\n\t\t\tvaultConnectorType: engineCore.getRegisteredInstanceType(\"vaultConnector\"),\n\t\t\tconfig: {\n\t\t\t\t...instanceConfig.options?.config\n\t\t\t}\n\t\t});\n\t\tinstanceType = nameofKebabCase(AuthHeaderProcessor);\n\t} else if (instanceConfig.type === SocketRouteProcessorType.AuthVerifiableCredential) {\n\t\tcomponent = new VerifiableCredentialAuthenticationProcessor({\n\t\t\tidentityConnectorType: engineCore.getRegisteredInstanceType(\"identityConnector\"),\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\tconfig: {\n\t\t\t\t...instanceConfig.options?.config\n\t\t\t}\n\t\t});\n\t\tinstanceType = nameofKebabCase(VerifiableCredentialAuthenticationProcessor);\n\t} else if (instanceConfig.type === SocketRouteProcessorType.Logging) {\n\t\tcomponent = new LoggingProcessor({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\tconfig: {\n\t\t\t\t...instanceConfig.options?.config\n\t\t\t}\n\t\t});\n\t\tinstanceType = nameofKebabCase(LoggingProcessor);\n\t} else if (instanceConfig.type === SocketRouteProcessorType.ContextId) {\n\t\tcomponent = new ContextIdProcessor(instanceConfig.options);\n\t\tinstanceType = nameofKebabCase(ContextIdProcessor);\n\t} else if (instanceConfig.type === SocketRouteProcessorType.StaticContextId) {\n\t\tcomponent = new StaticContextIdProcessor(instanceConfig.options);\n\t\tinstanceType = nameofKebabCase(StaticContextIdProcessor);\n\t} else if (instanceConfig.type === SocketRouteProcessorType.SocketRoute) {\n\t\tcomponent = new SocketRouteProcessor(instanceConfig.options);\n\t\tinstanceType = nameofKebabCase(SocketRouteProcessor);\n\t} else if (instanceConfig.type === SocketRouteProcessorType.Tenant) {\n\t\tinitSchemaTenantProcessor();\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.tenantEntityStorageType,\n\t\t\tnameof<Tenant>(),\n\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [ContextIdKeys.Node])\n\t\t);\n\n\t\tcomponent = new TenantProcessor(instanceConfig.options);\n\t\tinstanceType = nameofKebabCase(TenantProcessor);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: SocketRouteProcessorFactory\n\t};\n}\n"]}
@@ -0,0 +1,22 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ export * from "./components/authentication.js";
4
+ export * from "./components/authenticationAdmin.js";
5
+ export * from "./components/information.js";
6
+ export * from "./components/mimeTypeProcessor.js";
7
+ export * from "./components/restRouteProcessor.js";
8
+ export * from "./components/socketRouteProcessor.js";
9
+ export * from "./models/config/authenticationAdminComponentConfig.js";
10
+ export * from "./models/config/authenticationComponentConfig.js";
11
+ export * from "./models/config/informationComponentConfig.js";
12
+ export * from "./models/config/mimeTypeProcessorConfig.js";
13
+ export * from "./models/config/restRouteProcessorConfig.js";
14
+ export * from "./models/config/socketRouteProcessorConfig.js";
15
+ export * from "./models/IEngineServerConfig.js";
16
+ export * from "./models/types/authenticationAdminComponentType.js";
17
+ export * from "./models/types/authenticationComponentType.js";
18
+ export * from "./models/types/informationComponentType.js";
19
+ export * from "./models/types/mimeTypeProcessorType.js";
20
+ export * from "./models/types/restRouteProcessorType.js";
21
+ export * from "./models/types/socketRouteProcessorType.js";
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qCAAqC,CAAC;AACpD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,sCAAsC,CAAC;AACrD,cAAc,uDAAuD,CAAC;AACtE,cAAc,kDAAkD,CAAC;AACjE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,iCAAiC,CAAC;AAChD,cAAc,oDAAoD,CAAC;AACnE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,yCAAyC,CAAC;AACxD,cAAc,0CAA0C,CAAC;AACzD,cAAc,4CAA4C,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./components/authentication.js\";\nexport * from \"./components/authenticationAdmin.js\";\nexport * from \"./components/information.js\";\nexport * from \"./components/mimeTypeProcessor.js\";\nexport * from \"./components/restRouteProcessor.js\";\nexport * from \"./components/socketRouteProcessor.js\";\nexport * from \"./models/config/authenticationAdminComponentConfig.js\";\nexport * from \"./models/config/authenticationComponentConfig.js\";\nexport * from \"./models/config/informationComponentConfig.js\";\nexport * from \"./models/config/mimeTypeProcessorConfig.js\";\nexport * from \"./models/config/restRouteProcessorConfig.js\";\nexport * from \"./models/config/socketRouteProcessorConfig.js\";\nexport * from \"./models/IEngineServerConfig.js\";\nexport * from \"./models/types/authenticationAdminComponentType.js\";\nexport * from \"./models/types/authenticationComponentType.js\";\nexport * from \"./models/types/informationComponentType.js\";\nexport * from \"./models/types/mimeTypeProcessorType.js\";\nexport * from \"./models/types/restRouteProcessorType.js\";\nexport * from \"./models/types/socketRouteProcessorType.js\";\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IEngineServerConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IEngineServerConfig.js","sourceRoot":"","sources":["../../../src/models/IEngineServerConfig.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IWebServerOptions } from \"@twin.org/api-models\";\nimport type { IEngineCoreTypeConfig } from \"@twin.org/engine-models\";\nimport type { IEngineConfig } from \"@twin.org/engine-types\";\nimport type { AuthenticationAdminComponentConfig } from \"./config/authenticationAdminComponentConfig.js\";\nimport type { AuthenticationComponentConfig } from \"./config/authenticationComponentConfig.js\";\nimport type { InformationComponentConfig } from \"./config/informationComponentConfig.js\";\nimport type { MimeTypeProcessorConfig } from \"./config/mimeTypeProcessorConfig.js\";\nimport type { RestRouteProcessorConfig } from \"./config/restRouteProcessorConfig.js\";\nimport type { SocketRouteProcessorConfig } from \"./config/socketRouteProcessorConfig.js\";\n\n/**\n * Extended engine server config with known types.\n */\nexport interface IEngineServerConfig extends IEngineConfig {\n\t/**\n\t * Configuration for the web server.\n\t */\n\tweb?: IWebServerOptions;\n\n\t/**\n\t * The types to initialise in the engine.\n\t */\n\ttypes: IEngineConfig[\"types\"] & {\n\t\t[type: string]: IEngineCoreTypeConfig[] | undefined;\n\n\t\t/**\n\t\t * Information component options which can be overridden by individual components by specifying types other than default..\n\t\t */\n\t\tinformationComponent?: IEngineCoreTypeConfig<InformationComponentConfig>[];\n\n\t\t/**\n\t\t * REST route processors options which can be overridden by individual components by specifying types other than default..\n\t\t */\n\t\trestRouteProcessor?: IEngineCoreTypeConfig<RestRouteProcessorConfig>[];\n\n\t\t/**\n\t\t * Socket route processors options which can be overridden by individual components by specifying types other than default..\n\t\t */\n\t\tsocketRouteProcessor?: IEngineCoreTypeConfig<SocketRouteProcessorConfig>[];\n\n\t\t/**\n\t\t * Mime type processors options which can be overridden by individual components by specifying types other than default..\n\t\t */\n\t\tmimeTypeProcessor?: IEngineCoreTypeConfig<MimeTypeProcessorConfig>[];\n\n\t\t/**\n\t\t * Authentication component options which can be overridden by individual components by specifying types other than default..\n\t\t */\n\t\tauthenticationComponent?: IEngineCoreTypeConfig<AuthenticationComponentConfig>[];\n\n\t\t/**\n\t\t * Authentication admin component options which can be overridden by individual components by specifying types other than default..\n\t\t */\n\t\tauthenticationAdminComponent?: IEngineCoreTypeConfig<AuthenticationAdminComponentConfig>[];\n\t};\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=authenticationAdminComponentConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authenticationAdminComponentConfig.js","sourceRoot":"","sources":["../../../../src/models/config/authenticationAdminComponentConfig.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IEntityStorageAuthenticationAdminServiceConstructorOptions } from \"@twin.org/api-auth-entity-storage-service\";\nimport type { AuthenticationAdminComponentType } from \"../types/authenticationAdminComponentType.js\";\n\n/**\n * Authentication admin component config types.\n */\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport type AuthenticationAdminComponentConfig = {\n\ttype: typeof AuthenticationAdminComponentType.EntityStorage;\n\toptions?: IEntityStorageAuthenticationAdminServiceConstructorOptions;\n};\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=authenticationComponentConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authenticationComponentConfig.js","sourceRoot":"","sources":["../../../../src/models/config/authenticationComponentConfig.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IEntityStorageAuthenticationServiceConstructorOptions } from \"@twin.org/api-auth-entity-storage-service\";\nimport type { IBaseRestClientConfig } from \"@twin.org/api-models\";\nimport type { AuthenticationComponentType } from \"../types/authenticationComponentType.js\";\n\n/**\n * Authentication component config types.\n */\nexport type AuthenticationComponentConfig =\n\t| {\n\t\t\ttype: typeof AuthenticationComponentType.EntityStorage;\n\t\t\toptions?: IEntityStorageAuthenticationServiceConstructorOptions;\n\t }\n\t| {\n\t\t\ttype: typeof AuthenticationComponentType.RestClient;\n\t\t\toptions: IBaseRestClientConfig;\n\t };\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=informationComponentConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"informationComponentConfig.js","sourceRoot":"","sources":["../../../../src/models/config/informationComponentConfig.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IBaseRestClientConfig } from \"@twin.org/api-models\";\nimport type { IInformationServiceConstructorOptions } from \"@twin.org/api-service\";\nimport type { InformationComponentType } from \"../types/informationComponentType.js\";\n\n/**\n * Information component config types.\n */\nexport type InformationComponentConfig =\n\t| {\n\t\t\ttype: typeof InformationComponentType.Service;\n\t\t\toptions: IInformationServiceConstructorOptions;\n\t }\n\t| {\n\t\t\ttype: typeof InformationComponentType.RestClient;\n\t\t\toptions: IBaseRestClientConfig;\n\t };\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=mimeTypeProcessorConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mimeTypeProcessorConfig.js","sourceRoot":"","sources":["../../../../src/models/config/mimeTypeProcessorConfig.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { MimeTypeProcessorType } from \"../types/mimeTypeProcessorType.js\";\n\n/**\n * Mime type processor config types.\n */\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport type MimeTypeProcessorConfig = {\n\ttype: typeof MimeTypeProcessorType.Jwt;\n\toptions?: never;\n};\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=restRouteProcessorConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"restRouteProcessorConfig.js","sourceRoot":"","sources":["../../../../src/models/config/restRouteProcessorConfig.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IAuthHeaderProcessorConstructorOptions } from \"@twin.org/api-auth-entity-storage-service\";\nimport type {\n\tIContextIdProcessorConstructorOptions,\n\tILoggingProcessorConstructorOptions,\n\tIRestRouteProcessorConstructorOptions,\n\tIStaticContextIdProcessorConstructorOptions\n} from \"@twin.org/api-processors\";\nimport type { ITenantProcessorConstructorOptions } from \"@twin.org/api-tenant-processor\";\nimport type { IVerifiableCredentialAuthenticationProcessorConstructorOptions } from \"@twin.org/identity-authentication\";\nimport type { RestRouteProcessorType } from \"../types/restRouteProcessorType.js\";\n\n/**\n * REST route processor config types.\n */\nexport type RestRouteProcessorConfig =\n\t| {\n\t\t\ttype: typeof RestRouteProcessorType.AuthHeader;\n\t\t\toptions?: IAuthHeaderProcessorConstructorOptions;\n\t }\n\t| {\n\t\t\ttype: typeof RestRouteProcessorType.AuthVerifiableCredential;\n\t\t\toptions?: IVerifiableCredentialAuthenticationProcessorConstructorOptions;\n\t }\n\t| {\n\t\t\ttype: typeof RestRouteProcessorType.Logging;\n\t\t\toptions?: ILoggingProcessorConstructorOptions;\n\t }\n\t| {\n\t\t\ttype: typeof RestRouteProcessorType.ContextId;\n\t\t\toptions: IContextIdProcessorConstructorOptions;\n\t }\n\t| {\n\t\t\ttype: typeof RestRouteProcessorType.StaticContextId;\n\t\t\toptions: IStaticContextIdProcessorConstructorOptions;\n\t }\n\t| {\n\t\t\ttype: typeof RestRouteProcessorType.Tenant;\n\t\t\toptions?: ITenantProcessorConstructorOptions;\n\t }\n\t| {\n\t\t\ttype: typeof RestRouteProcessorType.RestRoute;\n\t\t\toptions?: IRestRouteProcessorConstructorOptions;\n\t };\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=socketRouteProcessorConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"socketRouteProcessorConfig.js","sourceRoot":"","sources":["../../../../src/models/config/socketRouteProcessorConfig.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IAuthHeaderProcessorConstructorOptions } from \"@twin.org/api-auth-entity-storage-service\";\nimport type {\n\tIContextIdProcessorConstructorOptions,\n\tILoggingProcessorConstructorOptions,\n\tISocketRouteProcessorConstructorOptions,\n\tIStaticContextIdProcessorConstructorOptions\n} from \"@twin.org/api-processors\";\nimport type { ITenantProcessorConstructorOptions } from \"@twin.org/api-tenant-processor\";\nimport type { IVerifiableCredentialAuthenticationProcessorConstructorOptions } from \"@twin.org/identity-authentication\";\nimport type { SocketRouteProcessorType } from \"../types/socketRouteProcessorType.js\";\n\n/**\n * Socket route processor config types.\n */\nexport type SocketRouteProcessorConfig =\n\t| {\n\t\t\ttype: typeof SocketRouteProcessorType.AuthHeader;\n\t\t\toptions?: IAuthHeaderProcessorConstructorOptions;\n\t }\n\t| {\n\t\t\ttype: typeof SocketRouteProcessorType.AuthVerifiableCredential;\n\t\t\toptions?: IVerifiableCredentialAuthenticationProcessorConstructorOptions;\n\t }\n\t| {\n\t\t\ttype: typeof SocketRouteProcessorType.Logging;\n\t\t\toptions?: ILoggingProcessorConstructorOptions;\n\t }\n\t| {\n\t\t\ttype: typeof SocketRouteProcessorType.ContextId;\n\t\t\toptions: IContextIdProcessorConstructorOptions;\n\t }\n\t| {\n\t\t\ttype: typeof SocketRouteProcessorType.StaticContextId;\n\t\t\toptions: IStaticContextIdProcessorConstructorOptions;\n\t }\n\t| {\n\t\t\ttype: typeof SocketRouteProcessorType.Tenant;\n\t\t\toptions?: ITenantProcessorConstructorOptions;\n\t }\n\t| {\n\t\t\ttype: typeof SocketRouteProcessorType.SocketRoute;\n\t\t\toptions?: ISocketRouteProcessorConstructorOptions;\n\t };\n"]}
@@ -0,0 +1,13 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ /**
4
+ * Authentication admin component types.
5
+ */
6
+ // eslint-disable-next-line @typescript-eslint/naming-convention
7
+ export const AuthenticationAdminComponentType = {
8
+ /**
9
+ * Entity storage.
10
+ */
11
+ EntityStorage: "entity-storage"
12
+ };
13
+ //# sourceMappingURL=authenticationAdminComponentType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authenticationAdminComponentType.js","sourceRoot":"","sources":["../../../../src/models/types/authenticationAdminComponentType.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,gCAAgC,GAAG;IAC/C;;OAEG;IACH,aAAa,EAAE,gBAAgB;CACtB,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Authentication admin component types.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const AuthenticationAdminComponentType = {\n\t/**\n\t * Entity storage.\n\t */\n\tEntityStorage: \"entity-storage\"\n} as const;\n\n/**\n * Authentication admin component types.\n */\nexport type AuthenticationAdminComponentType =\n\t(typeof AuthenticationAdminComponentType)[keyof typeof AuthenticationAdminComponentType];\n"]}
@@ -0,0 +1,17 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ /**
4
+ * Authentication component types.
5
+ */
6
+ // eslint-disable-next-line @typescript-eslint/naming-convention
7
+ export const AuthenticationComponentType = {
8
+ /**
9
+ * Entity storage.
10
+ */
11
+ EntityStorage: "entity-storage",
12
+ /**
13
+ * REST client.
14
+ */
15
+ RestClient: "rest-client"
16
+ };
17
+ //# sourceMappingURL=authenticationComponentType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authenticationComponentType.js","sourceRoot":"","sources":["../../../../src/models/types/authenticationComponentType.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,2BAA2B,GAAG;IAC1C;;OAEG;IACH,aAAa,EAAE,gBAAgB;IAE/B;;OAEG;IACH,UAAU,EAAE,aAAa;CAChB,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Authentication component types.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const AuthenticationComponentType = {\n\t/**\n\t * Entity storage.\n\t */\n\tEntityStorage: \"entity-storage\",\n\n\t/**\n\t * REST client.\n\t */\n\tRestClient: \"rest-client\"\n} as const;\n\n/**\n * Authentication component types.\n */\nexport type AuthenticationComponentType =\n\t(typeof AuthenticationComponentType)[keyof typeof AuthenticationComponentType];\n"]}
@@ -0,0 +1,17 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ /**
4
+ * Information component types.
5
+ */
6
+ // eslint-disable-next-line @typescript-eslint/naming-convention
7
+ export const InformationComponentType = {
8
+ /**
9
+ * Service.
10
+ */
11
+ Service: "service",
12
+ /**
13
+ * REST client.
14
+ */
15
+ RestClient: "rest-client"
16
+ };
17
+ //# sourceMappingURL=informationComponentType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"informationComponentType.js","sourceRoot":"","sources":["../../../../src/models/types/informationComponentType.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACvC;;OAEG;IACH,OAAO,EAAE,SAAS;IAElB;;OAEG;IACH,UAAU,EAAE,aAAa;CAChB,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Information component types.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const InformationComponentType = {\n\t/**\n\t * Service.\n\t */\n\tService: \"service\",\n\n\t/**\n\t * REST client.\n\t */\n\tRestClient: \"rest-client\"\n} as const;\n\n/**\n * Information component types.\n */\nexport type InformationComponentType =\n\t(typeof InformationComponentType)[keyof typeof InformationComponentType];\n"]}
@@ -0,0 +1,13 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ /**
4
+ * Mime type route processor types.
5
+ */
6
+ // eslint-disable-next-line @typescript-eslint/naming-convention
7
+ export const MimeTypeProcessorType = {
8
+ /**
9
+ * Jwt.
10
+ */
11
+ Jwt: "jwt"
12
+ };
13
+ //# sourceMappingURL=mimeTypeProcessorType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mimeTypeProcessorType.js","sourceRoot":"","sources":["../../../../src/models/types/mimeTypeProcessorType.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACpC;;OAEG;IACH,GAAG,EAAE,KAAK;CACD,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Mime type route processor types.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const MimeTypeProcessorType = {\n\t/**\n\t * Jwt.\n\t */\n\tJwt: \"jwt\"\n} as const;\n\n/**\n * Mime type processor types.\n */\nexport type MimeTypeProcessorType =\n\t(typeof MimeTypeProcessorType)[keyof typeof MimeTypeProcessorType];\n"]}
@@ -0,0 +1,37 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ /**
4
+ * REST route processor types.
5
+ */
6
+ // eslint-disable-next-line @typescript-eslint/naming-convention
7
+ export const RestRouteProcessorType = {
8
+ /**
9
+ * Auth header.
10
+ */
11
+ AuthHeader: "auth-header",
12
+ /**
13
+ * Auth verifiable credential.
14
+ */
15
+ AuthVerifiableCredential: "auth-verifiable-credential",
16
+ /**
17
+ * Logging.
18
+ */
19
+ Logging: "logging",
20
+ /**
21
+ * Context ID.
22
+ */
23
+ ContextId: "context-id",
24
+ /**
25
+ * Static Context ID.
26
+ */
27
+ StaticContextId: "static-context-id",
28
+ /**
29
+ * Tenant.
30
+ */
31
+ Tenant: "tenant",
32
+ /**
33
+ * REST Route.
34
+ */
35
+ RestRoute: "rest-route"
36
+ };
37
+ //# sourceMappingURL=restRouteProcessorType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"restRouteProcessorType.js","sourceRoot":"","sources":["../../../../src/models/types/restRouteProcessorType.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACrC;;OAEG;IACH,UAAU,EAAE,aAAa;IAEzB;;OAEG;IACH,wBAAwB,EAAE,4BAA4B;IAEtD;;OAEG;IACH,OAAO,EAAE,SAAS;IAElB;;OAEG;IACH,SAAS,EAAE,YAAY;IAEvB;;OAEG;IACH,eAAe,EAAE,mBAAmB;IAEpC;;OAEG;IACH,MAAM,EAAE,QAAQ;IAEhB;;OAEG;IACH,SAAS,EAAE,YAAY;CACd,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * REST route processor types.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const RestRouteProcessorType = {\n\t/**\n\t * Auth header.\n\t */\n\tAuthHeader: \"auth-header\",\n\n\t/**\n\t * Auth verifiable credential.\n\t */\n\tAuthVerifiableCredential: \"auth-verifiable-credential\",\n\n\t/**\n\t * Logging.\n\t */\n\tLogging: \"logging\",\n\n\t/**\n\t * Context ID.\n\t */\n\tContextId: \"context-id\",\n\n\t/**\n\t * Static Context ID.\n\t */\n\tStaticContextId: \"static-context-id\",\n\n\t/**\n\t * Tenant.\n\t */\n\tTenant: \"tenant\",\n\n\t/**\n\t * REST Route.\n\t */\n\tRestRoute: \"rest-route\"\n} as const;\n\n/**\n * REST route processor types.\n */\nexport type RestRouteProcessorType =\n\t(typeof RestRouteProcessorType)[keyof typeof RestRouteProcessorType];\n"]}