@3sixty/engine-server-types 0.20.0-next.0 → 0.20.0-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.
- package/dist/es/components/authentication.js.map +1 -1
- package/dist/es/components/authenticationAdmin.js.map +1 -1
- package/dist/es/components/authenticationAudit.js +1 -1
- package/dist/es/components/authenticationAudit.js.map +1 -1
- package/dist/es/components/authenticationRate.js +1 -1
- package/dist/es/components/authenticationRate.js.map +1 -1
- package/dist/es/components/information.js.map +1 -1
- package/dist/es/components/mimeTypeProcessor.js.map +1 -1
- package/dist/es/components/restRouteProcessor.js +13 -1
- package/dist/es/components/restRouteProcessor.js.map +1 -1
- package/dist/es/components/socketRouteProcessor.js +13 -1
- package/dist/es/components/socketRouteProcessor.js.map +1 -1
- package/dist/es/index.js +2 -0
- package/dist/es/index.js.map +1 -1
- package/dist/es/models/IEngineServerConfig.js.map +1 -1
- package/dist/es/models/config/authenticationAdminComponentConfig.js.map +1 -1
- package/dist/es/models/config/authenticationAuditComponentConfig.js.map +1 -1
- package/dist/es/models/config/authenticationComponentConfig.js.map +1 -1
- package/dist/es/models/config/authenticationRateComponentConfig.js.map +1 -1
- package/dist/es/models/config/informationComponentConfig.js.map +1 -1
- package/dist/es/models/config/mimeTypeProcessorConfig.js.map +1 -1
- package/dist/es/models/config/restRouteProcessorConfig.js.map +1 -1
- package/dist/es/models/config/socketRouteProcessorConfig.js.map +1 -1
- package/dist/es/models/types/authenticationAdminComponentType.js.map +1 -1
- package/dist/es/models/types/authenticationAuditComponentType.js.map +1 -1
- package/dist/es/models/types/authenticationComponentType.js.map +1 -1
- package/dist/es/models/types/authenticationRateComponentType.js.map +1 -1
- package/dist/es/models/types/informationComponentType.js.map +1 -1
- package/dist/es/models/types/mimeTypeProcessorType.js.map +1 -1
- package/dist/es/models/types/restRouteProcessorType.js +5 -1
- package/dist/es/models/types/restRouteProcessorType.js.map +1 -1
- package/dist/es/models/types/socketRouteProcessorType.js +5 -1
- package/dist/es/models/types/socketRouteProcessorType.js.map +1 -1
- package/dist/es/models/types/webServerType.js +21 -0
- package/dist/es/models/types/webServerType.js.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/models/IEngineServerConfig.d.ts +6 -0
- package/dist/types/models/config/authenticationAuditComponentConfig.d.ts +1 -1
- package/dist/types/models/config/authenticationRateComponentConfig.d.ts +1 -1
- package/dist/types/models/config/restRouteProcessorConfig.d.ts +6 -1
- package/dist/types/models/config/socketRouteProcessorConfig.d.ts +6 -1
- package/dist/types/models/types/restRouteProcessorType.d.ts +4 -0
- package/dist/types/models/types/socketRouteProcessorType.d.ts +4 -0
- package/dist/types/models/types/webServerType.d.ts +21 -0
- package/docs/changelog.md +32 -0
- package/docs/reference/index.md +2 -0
- package/docs/reference/interfaces/IEngineServerConfig.md +26 -2
- package/docs/reference/type-aliases/RestRouteProcessorConfig.md +1 -1
- package/docs/reference/type-aliases/SocketRouteProcessorConfig.md +1 -1
- package/docs/reference/type-aliases/WebServerType.md +5 -0
- package/docs/reference/variables/RestRouteProcessorType.md +6 -0
- package/docs/reference/variables/SocketRouteProcessorType.md +6 -0
- package/docs/reference/variables/WebServerType.md +25 -0
- package/package.json +5 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authentication.js","
|
|
1
|
+
{"version":3,"file":"authentication.js","sources":["../../../src/components/authentication.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,qCAAqC,EAAE,MAAM,6CAA6C,CAAC;AACpG,OAAO,EACN,kCAAkC,EAClC,UAAU,IAAI,2BAA2B,EAEzC,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAmB,MAAM,cAAc,CAAC;AAMjE,OAAO,EAAE,gBAAgB,EAAE,gCAAgC,EAAE,MAAM,sBAAsB,CAAC;AAI1F,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O;QACN,eAAe,EAAE,eAAsE;QACvF,gBAAgB;QAChB,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { EntityStorageAuthenticationRestClient } from \"@3sixty/api-auth-entity-storage-rest-client\";\nimport {\n\tEntityStorageAuthenticationService,\n\tinitSchema as initSchemaAuthEntityStorage,\n\ttype AuthenticationUser\n} from \"@3sixty/api-auth-entity-storage-service\";\nimport { ContextIdHelper, ContextIdKeys } from \"@3sixty/context\";\nimport { ComponentFactory, type IComponent } from \"@3sixty/core\";\nimport type {\n\tEngineTypeInitialiserReturn,\n\tIEngineCore,\n\tIEngineCoreContext\n} from \"@3sixty/engine-models\";\nimport { EngineTypeHelper, initialiseEntityStorageConnector } from \"@3sixty/engine-types\";\n\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 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 function initialiseAuthenticationComponent(\n\tengineCore: IEngineCore<IEngineServerConfig>,\n\tcontext: IEngineCoreContext<IEngineServerConfig>,\n\tinstanceConfig: AuthenticationComponentConfig\n): EngineTypeInitialiserReturn<AuthenticationComponentConfig, typeof ComponentFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === AuthenticationComponentType.EntityStorage) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) => {\n\t\t\tinitSchemaAuthEntityStorage();\n\t\t\tinitialiseEntityStorageConnector(\n\t\t\t\tengineCore,\n\t\t\t\tcontext,\n\t\t\t\tcreateConfig.options?.userEntityStorageType,\n\t\t\t\t\"AuthenticationUser\",\n\t\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [\n\t\t\t\t\tContextIdKeys.Node,\n\t\t\t\t\tContextIdKeys.Tenant\n\t\t\t\t])\n\t\t\t);\n\t\t\treturn new EntityStorageAuthenticationService(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\tvaultConnectorType: engineCore.getRegisteredInstanceType(\"vaultConnector\"),\n\t\t\t\t\t\ttenantAdminComponentType:\n\t\t\t\t\t\t\tengineCore.getRegisteredInstanceTypeOptional(\"tenantAdminComponent\"),\n\t\t\t\t\t\tauthenticationAuditServiceType: engineCore.getRegisteredInstanceTypeOptional(\n\t\t\t\t\t\t\t\"authenticationAuditComponent\"\n\t\t\t\t\t\t),\n\t\t\t\t\t\tauthenticationRateServiceType: engineCore.getRegisteredInstanceType(\n\t\t\t\t\t\t\t\"authenticationRateComponent\"\n\t\t\t\t\t\t)\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\t};\n\t\tinstanceTypeName = \"entity-storage-authentication-service\";\n\t} else if (instanceConfig.type === AuthenticationComponentType.RestClient) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew EntityStorageAuthenticationRestClient(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(createConfig.options)\n\t\t\t);\n\t\tinstanceTypeName = \"entity-storage-authentication-rest-client\";\n\t}\n\n\treturn {\n\t\tcreateComponent: createComponent as (createConfig: typeof instanceConfig) => IComponent,\n\t\tinstanceTypeName,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authenticationAdmin.js","
|
|
1
|
+
{"version":3,"file":"authenticationAdmin.js","sources":["../../../src/components/authenticationAdmin.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EACN,uCAAuC,EACvC,UAAU,IAAI,2BAA2B,EAEzC,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAMhD,OAAO,EAAE,gBAAgB,EAAE,gCAAgC,EAAE,MAAM,sBAAsB,CAAC;AAI1F,OAAO,EAAE,gCAAgC,EAAE,MAAM,qDAAqD,CAAC;AAEvG;;;;;;GAMG;AACH,MAAM,UAAU,sCAAsC,CACrD,UAA4C,EAC5C,OAAgD,EAChD,cAAkD;IAElD,IAAI,eAAe,CAAC;IACpB,IAAI,gBAAgB,CAAC;IAErB,IAAI,cAAc,CAAC,IAAI,KAAK,gCAAgC,CAAC,aAAa,EAAE,CAAC;QAC5E,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE;YACzD,2BAA2B,EAAE,CAAC;YAC9B,gCAAgC,CAC/B,UAAU,EACV,OAAO,EACP,YAAY,CAAC,OAAO,EAAE,qBAAqB,EAC3C,oBAAoB,EACpB,eAAe,CAAC,qBAAqB,CAAC,UAAU,CAAC,gBAAgB,EAAE,EAAE;gBACpE,aAAa,CAAC,IAAI;gBAClB,aAAa,CAAC,MAAM;aACpB,CAAC,CACF,CAAC;YACF,OAAO,IAAI,uCAAuC,CACjD,gBAAgB,CAAC,WAAW,CAC3B;gBACC,8BAA8B,EAAE,UAAU,CAAC,iCAAiC,CAC3E,8BAA8B,CAC9B;aACD,EACD,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QACH,CAAC,CAAC;QACF,gBAAgB,GAAG,6CAA6C,CAAC;IAClE,CAAC;IAED,OAAO;QACN,eAAe;QACf,gBAAgB;QAChB,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport {\n\tEntityStorageAuthenticationAdminService,\n\tinitSchema as initSchemaAuthEntityStorage,\n\ttype AuthenticationUser\n} from \"@3sixty/api-auth-entity-storage-service\";\nimport { ContextIdHelper, ContextIdKeys } from \"@3sixty/context\";\nimport { ComponentFactory } from \"@3sixty/core\";\nimport type {\n\tEngineTypeInitialiserReturn,\n\tIEngineCore,\n\tIEngineCoreContext\n} from \"@3sixty/engine-models\";\nimport { EngineTypeHelper, initialiseEntityStorageConnector } from \"@3sixty/engine-types\";\n\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 function initialiseAuthenticationAdminComponent(\n\tengineCore: IEngineCore<IEngineServerConfig>,\n\tcontext: IEngineCoreContext<IEngineServerConfig>,\n\tinstanceConfig: AuthenticationAdminComponentConfig\n): EngineTypeInitialiserReturn<AuthenticationAdminComponentConfig, typeof ComponentFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === AuthenticationAdminComponentType.EntityStorage) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) => {\n\t\t\tinitSchemaAuthEntityStorage();\n\t\t\tinitialiseEntityStorageConnector(\n\t\t\t\tengineCore,\n\t\t\t\tcontext,\n\t\t\t\tcreateConfig.options?.userEntityStorageType,\n\t\t\t\t\"AuthenticationUser\",\n\t\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [\n\t\t\t\t\tContextIdKeys.Node,\n\t\t\t\t\tContextIdKeys.Tenant\n\t\t\t\t])\n\t\t\t);\n\t\t\treturn new EntityStorageAuthenticationAdminService(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\tauthenticationAuditServiceType: engineCore.getRegisteredInstanceTypeOptional(\n\t\t\t\t\t\t\t\"authenticationAuditComponent\"\n\t\t\t\t\t\t)\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\t};\n\t\tinstanceTypeName = \"entity-storage-authentication-admin-service\";\n\t}\n\n\treturn {\n\t\tcreateComponent,\n\t\tinstanceTypeName,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Copyright 2026 IOTA Stiftung.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
-
import { EntityStorageAuthenticationAuditService, initSchema as initSchemaAuthEntityStorage } from "@3sixty/api-auth-
|
|
3
|
+
import { EntityStorageAuthenticationAuditService, initSchema as initSchemaAuthEntityStorage } from "@3sixty/api-auth-service";
|
|
4
4
|
import { ContextIdHelper, ContextIdKeys } from "@3sixty/context";
|
|
5
5
|
import { ComponentFactory } from "@3sixty/core";
|
|
6
6
|
import { EngineTypeHelper, initialiseEntityStorageConnector } from "@3sixty/engine-types";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authenticationAudit.js","
|
|
1
|
+
{"version":3,"file":"authenticationAudit.js","sources":["../../../src/components/authenticationAudit.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EACN,uCAAuC,EACvC,UAAU,IAAI,2BAA2B,EAEzC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAMhD,OAAO,EAAE,gBAAgB,EAAE,gCAAgC,EAAE,MAAM,sBAAsB,CAAC;AAI1F,OAAO,EAAE,gCAAgC,EAAE,MAAM,qDAAqD,CAAC;AAEvG;;;;;;GAMG;AACH,MAAM,UAAU,sCAAsC,CACrD,UAA4C,EAC5C,OAAgD,EAChD,cAAkD;IAElD,IAAI,eAAe,CAAC;IACpB,IAAI,gBAAgB,CAAC;IAErB,IAAI,cAAc,CAAC,IAAI,KAAK,gCAAgC,CAAC,aAAa,EAAE,CAAC;QAC5E,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE;YACzD,2BAA2B,EAAE,CAAC;YAC9B,gCAAgC,CAC/B,UAAU,EACV,OAAO,EACP,YAAY,CAAC,OAAO,EAAE,mCAAmC,EACzD,0BAA0B,EAC1B,eAAe,CAAC,qBAAqB,CAAC,UAAU,CAAC,gBAAgB,EAAE,EAAE;gBACpE,aAAa,CAAC,IAAI;gBAClB,aAAa,CAAC,MAAM;aACpB,CAAC,CACF,CAAC;YACF,OAAO,IAAI,uCAAuC,CACjD,gBAAgB,CAAC,WAAW,CAAqC,YAAY,CAAC,OAAO,CAAC,CACtF,CAAC;QACH,CAAC,CAAC;QACF,gBAAgB,GAAG,6CAA6C,CAAC;IAClE,CAAC;IAED,OAAO;QACN,eAAe;QACf,gBAAgB;QAChB,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport {\n\tEntityStorageAuthenticationAuditService,\n\tinitSchema as initSchemaAuthEntityStorage,\n\ttype AuthenticationAuditEntry\n} from \"@3sixty/api-auth-service\";\nimport { ContextIdHelper, ContextIdKeys } from \"@3sixty/context\";\nimport { ComponentFactory } from \"@3sixty/core\";\nimport type {\n\tEngineTypeInitialiserReturn,\n\tIEngineCore,\n\tIEngineCoreContext\n} from \"@3sixty/engine-models\";\nimport { EngineTypeHelper, initialiseEntityStorageConnector } from \"@3sixty/engine-types\";\n\nimport type { AuthenticationAuditComponentConfig } from \"../models/config/authenticationAuditComponentConfig.js\";\nimport type { IEngineServerConfig } from \"../models/IEngineServerConfig.js\";\nimport { AuthenticationAuditComponentType } from \"../models/types/authenticationAuditComponentType.js\";\n\n/**\n * Initialise the authentication audit.\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 function initialiseAuthenticationAuditComponent(\n\tengineCore: IEngineCore<IEngineServerConfig>,\n\tcontext: IEngineCoreContext<IEngineServerConfig>,\n\tinstanceConfig: AuthenticationAuditComponentConfig\n): EngineTypeInitialiserReturn<AuthenticationAuditComponentConfig, typeof ComponentFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === AuthenticationAuditComponentType.EntityStorage) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) => {\n\t\t\tinitSchemaAuthEntityStorage();\n\t\t\tinitialiseEntityStorageConnector(\n\t\t\t\tengineCore,\n\t\t\t\tcontext,\n\t\t\t\tcreateConfig.options?.authenticationAuditEntryStorageType,\n\t\t\t\t\"AuthenticationAuditEntry\",\n\t\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [\n\t\t\t\t\tContextIdKeys.Node,\n\t\t\t\t\tContextIdKeys.Tenant\n\t\t\t\t])\n\t\t\t);\n\t\t\treturn new EntityStorageAuthenticationAuditService(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(createConfig.options)\n\t\t\t);\n\t\t};\n\t\tinstanceTypeName = \"entity-storage-authentication-audit-service\";\n\t}\n\n\treturn {\n\t\tcreateComponent,\n\t\tinstanceTypeName,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Copyright 2026 IOTA Stiftung.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
-
import { EntityStorageAuthenticationRateService, initSchema as initSchemaAuthEntityStorage } from "@3sixty/api-auth-
|
|
3
|
+
import { EntityStorageAuthenticationRateService, initSchema as initSchemaAuthEntityStorage } from "@3sixty/api-auth-service";
|
|
4
4
|
import { ContextIdHelper, ContextIdKeys } from "@3sixty/context";
|
|
5
5
|
import { ComponentFactory } from "@3sixty/core";
|
|
6
6
|
import { EngineTypeHelper, initialiseEntityStorageConnector } from "@3sixty/engine-types";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authenticationRate.js","
|
|
1
|
+
{"version":3,"file":"authenticationRate.js","sources":["../../../src/components/authenticationRate.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EACN,sCAAsC,EACtC,UAAU,IAAI,2BAA2B,EAEzC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAMhD,OAAO,EAAE,gBAAgB,EAAE,gCAAgC,EAAE,MAAM,sBAAsB,CAAC;AAI1F,OAAO,EAAE,+BAA+B,EAAE,MAAM,oDAAoD,CAAC;AAErG;;;;;;GAMG;AACH,MAAM,UAAU,qCAAqC,CACpD,UAA4C,EAC5C,OAAgD,EAChD,cAAiD;IAEjD,IAAI,eAAe,CAAC;IACpB,IAAI,gBAAgB,CAAC;IAErB,IAAI,cAAc,CAAC,IAAI,KAAK,+BAA+B,CAAC,aAAa,EAAE,CAAC;QAC3E,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE;YACzD,2BAA2B,EAAE,CAAC;YAC9B,gCAAgC,CAC/B,UAAU,EACV,OAAO,EACP,YAAY,CAAC,OAAO,EAAE,kCAAkC,EACxD,yBAAyB,EACzB,eAAe,CAAC,qBAAqB,CAAC,UAAU,CAAC,gBAAgB,EAAE,EAAE;gBACpE,aAAa,CAAC,IAAI;gBAClB,aAAa,CAAC,MAAM;aACpB,CAAC,CACF,CAAC;YACF,OAAO,IAAI,sCAAsC,CAChD,gBAAgB,CAAC,WAAW,CAC3B;gBACC,0BAA0B,EACzB,UAAU,CAAC,yBAAyB,CAAC,wBAAwB,CAAC;gBAC/D,qBAAqB,EAAE,UAAU,CAAC,yBAAyB,CAAC,mBAAmB,CAAC;aAChF,EACD,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QACH,CAAC,CAAC;QACF,gBAAgB,GAAG,4CAA4C,CAAC;IACjE,CAAC;IAED,OAAO;QACN,eAAe;QACf,gBAAgB;QAChB,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport {\n\tEntityStorageAuthenticationRateService,\n\tinitSchema as initSchemaAuthEntityStorage,\n\ttype AuthenticationRateEntry\n} from \"@3sixty/api-auth-service\";\nimport { ContextIdHelper, ContextIdKeys } from \"@3sixty/context\";\nimport { ComponentFactory } from \"@3sixty/core\";\nimport type {\n\tEngineTypeInitialiserReturn,\n\tIEngineCore,\n\tIEngineCoreContext\n} from \"@3sixty/engine-models\";\nimport { EngineTypeHelper, initialiseEntityStorageConnector } from \"@3sixty/engine-types\";\n\nimport type { AuthenticationRateComponentConfig } from \"../models/config/authenticationRateComponentConfig.js\";\nimport type { IEngineServerConfig } from \"../models/IEngineServerConfig.js\";\nimport { AuthenticationRateComponentType } from \"../models/types/authenticationRateComponentType.js\";\n\n/**\n * Initialise the authentication rate.\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 function initialiseAuthenticationRateComponent(\n\tengineCore: IEngineCore<IEngineServerConfig>,\n\tcontext: IEngineCoreContext<IEngineServerConfig>,\n\tinstanceConfig: AuthenticationRateComponentConfig\n): EngineTypeInitialiserReturn<AuthenticationRateComponentConfig, typeof ComponentFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === AuthenticationRateComponentType.EntityStorage) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) => {\n\t\t\tinitSchemaAuthEntityStorage();\n\t\t\tinitialiseEntityStorageConnector(\n\t\t\t\tengineCore,\n\t\t\t\tcontext,\n\t\t\t\tcreateConfig.options?.authenticationRateEntryStorageType,\n\t\t\t\t\"AuthenticationRateEntry\",\n\t\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [\n\t\t\t\t\tContextIdKeys.Node,\n\t\t\t\t\tContextIdKeys.Tenant\n\t\t\t\t])\n\t\t\t);\n\t\t\treturn new EntityStorageAuthenticationRateService(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\ttaskSchedulerComponentType:\n\t\t\t\t\t\t\tengineCore.getRegisteredInstanceType(\"taskSchedulerComponent\"),\n\t\t\t\t\t\tplatformComponentType: engineCore.getRegisteredInstanceType(\"platformComponent\")\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\t};\n\t\tinstanceTypeName = \"entity-storage-authentication-rate-service\";\n\t}\n\n\treturn {\n\t\tcreateComponent,\n\t\tinstanceTypeName,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"information.js","
|
|
1
|
+
{"version":3,"file":"information.js","sources":["../../../src/components/information.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAmB,MAAM,cAAc,CAAC;AAMjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAIxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AAEvF;;;;;;GAMG;AACH,MAAM,UAAU,8BAA8B,CAC7C,UAA4C,EAC5C,OAAgD,EAChD,cAA0C;IAE1C,IAAI,eAAe,CAAC;IACpB,IAAI,gBAAgB,CAAC;IAErB,IAAI,cAAc,CAAC,IAAI,KAAK,wBAAwB,CAAC,OAAO,EAAE,CAAC;QAC9D,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,kBAAkB,CACrB,gBAAgB,CAAC,WAAW,CAAqC,YAAY,CAAC,OAAO,CAAC,CACtF,CAAC;QACH,gBAAgB,GAAG,qBAAqB,CAAC;IAC1C,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,wBAAwB,CAAC,UAAU,EAAE,CAAC;QACxE,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,qBAAqB,CACxB,gBAAgB,CAAC,WAAW,CAAqC,YAAY,CAAC,OAAO,CAAC,CACtF,CAAC;QACH,gBAAgB,GAAG,yBAAyB,CAAC;IAC9C,CAAC;IAED,OAAO;QACN,eAAe,EAAE,eAAsE;QACvF,gBAAgB;QAChB,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { InformationRestClient } from \"@3sixty/api-rest-client\";\nimport { InformationService } from \"@3sixty/api-service\";\nimport { ComponentFactory, type IComponent } from \"@3sixty/core\";\nimport type {\n\tEngineTypeInitialiserReturn,\n\tIEngineCore,\n\tIEngineCoreContext\n} from \"@3sixty/engine-models\";\nimport { EngineTypeHelper } from \"@3sixty/engine-types\";\n\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 function initialiseInformationComponent(\n\tengineCore: IEngineCore<IEngineServerConfig>,\n\tcontext: IEngineCoreContext<IEngineServerConfig>,\n\tinstanceConfig: InformationComponentConfig\n): EngineTypeInitialiserReturn<InformationComponentConfig, typeof ComponentFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === InformationComponentType.Service) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew InformationService(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(createConfig.options)\n\t\t\t);\n\t\tinstanceTypeName = \"information-service\";\n\t} else if (instanceConfig.type === InformationComponentType.RestClient) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew InformationRestClient(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(createConfig.options)\n\t\t\t);\n\t\tinstanceTypeName = \"information-rest-client\";\n\t}\n\n\treturn {\n\t\tcreateComponent: createComponent as (createConfig: typeof instanceConfig) => IComponent,\n\t\tinstanceTypeName,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mimeTypeProcessor.js","
|
|
1
|
+
{"version":3,"file":"mimeTypeProcessor.js","sources":["../../../src/components/mimeTypeProcessor.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAS9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AAEjF;;;;;;GAMG;AACH,MAAM,UAAU,oCAAoC,CACnD,UAA4C,EAC5C,OAAgD,EAChD,cAAuC;IAEvC,IAAI,eAAe,CAAC;IACpB,IAAI,gBAAgB,CAAC;IAErB,IAAI,cAAc,CAAC,IAAI,KAAK,qBAAqB,CAAC,GAAG,EAAE,CAAC;QACvD,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CAAC,IAAI,oBAAoB,EAAE,CAAC;QACtF,gBAAgB,GAAG,yBAAyB,CAAC;IAC9C,CAAC;IAED,OAAO;QACN,eAAe;QACf,gBAAgB;QAChB,OAAO,EAAE,wBAAwB;KACjC,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { MimeTypeProcessorFactory } from \"@3sixty/api-models\";\nimport { JwtMimeTypeProcessor } from \"@3sixty/api-processors\";\nimport type {\n\tEngineTypeInitialiserReturn,\n\tIEngineCore,\n\tIEngineCoreContext\n} from \"@3sixty/engine-models\";\n\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 function initialiseMimeTypeProcessorComponent(\n\tengineCore: IEngineCore<IEngineServerConfig>,\n\tcontext: IEngineCoreContext<IEngineServerConfig>,\n\tinstanceConfig: MimeTypeProcessorConfig\n): EngineTypeInitialiserReturn<MimeTypeProcessorConfig, typeof MimeTypeProcessorFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === MimeTypeProcessorType.Jwt) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) => new JwtMimeTypeProcessor();\n\t\tinstanceTypeName = \"jwt-mime-type-processor\";\n\t}\n\n\treturn {\n\t\tcreateComponent,\n\t\tinstanceTypeName,\n\t\tfactory: MimeTypeProcessorFactory\n\t};\n}\n"]}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
// Copyright 2024 IOTA Stiftung.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0.
|
|
3
3
|
import { AuthHeaderProcessor, initSchema as initSchemaAuthEntityStorage } from "@3sixty/api-auth-entity-storage-service";
|
|
4
|
+
import { TenantOverrideProcessor } from "@3sixty/api-auth-service";
|
|
4
5
|
import { RestRouteProcessorFactory } from "@3sixty/api-models";
|
|
5
6
|
import { ContextIdProcessor, LoggingProcessor, RestRouteProcessor, StaticContextIdProcessor } from "@3sixty/api-processors";
|
|
6
|
-
import { TenantProcessor, SingleTenantProcessor
|
|
7
|
+
import { TenantProcessor, SingleTenantProcessor } from "@3sixty/api-tenant-processor";
|
|
8
|
+
import { AuthorizationRouteProcessor } from "@3sixty/authorization-service";
|
|
7
9
|
import { ContextIdHelper, ContextIdKeys } from "@3sixty/context";
|
|
8
10
|
import { EngineTypeHelper, initialiseEntityStorageConnector } from "@3sixty/engine-types";
|
|
9
11
|
import { MetricsRouteProcessor } from "@3sixty/telemetry-processors";
|
|
@@ -79,6 +81,7 @@ export function initialiseRestRouteProcessorComponent(engineCore, context, insta
|
|
|
79
81
|
else if (instanceConfig.type === RestRouteProcessorType.TenantOverride) {
|
|
80
82
|
createComponent = (createConfig) => new TenantOverrideProcessor(EngineTypeHelper.mergeConfig({
|
|
81
83
|
tenantAdminComponentType: engineCore.getRegisteredInstanceType("tenantAdminComponent"),
|
|
84
|
+
authorizationComponentType: engineCore.getRegisteredInstanceType("authorizationComponent"),
|
|
82
85
|
config: {
|
|
83
86
|
includeErrorStack: context.config.debug
|
|
84
87
|
}
|
|
@@ -99,6 +102,15 @@ export function initialiseRestRouteProcessorComponent(engineCore, context, insta
|
|
|
99
102
|
}, createConfig.options));
|
|
100
103
|
instanceTypeName = "tracing-route-processor";
|
|
101
104
|
}
|
|
105
|
+
else if (instanceConfig.type === RestRouteProcessorType.Authorization) {
|
|
106
|
+
createComponent = (createConfig) => new AuthorizationRouteProcessor(EngineTypeHelper.mergeConfig({
|
|
107
|
+
authorizationComponentType: engineCore.getRegisteredInstanceType("authorizationComponent"),
|
|
108
|
+
config: {
|
|
109
|
+
includeErrorStack: context.config.debug
|
|
110
|
+
}
|
|
111
|
+
}, createConfig.options));
|
|
112
|
+
instanceTypeName = "authorization-route-processor";
|
|
113
|
+
}
|
|
102
114
|
return {
|
|
103
115
|
createComponent: createComponent,
|
|
104
116
|
instanceTypeName,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"restRouteProcessor.js","sourceRoot":"","sources":["../../../src/components/restRouteProcessor.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EACN,mBAAmB,EACnB,UAAU,IAAI,2BAA2B,EAEzC,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EACN,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,wBAAwB,EACxB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,eAAe,EACf,qBAAqB,EACrB,uBAAuB,EACvB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAOjE,OAAO,EAAE,gBAAgB,EAAE,gCAAgC,EAAE,MAAM,sBAAsB,CAAC;AAE1F,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAGnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AAEnF;;;;;;GAMG;AACH,MAAM,UAAU,qCAAqC,CACpD,UAA4C,EAC5C,OAAgD,EAChD,cAAwC;IAExC,IAAI,eAAe,CAAC;IACpB,IAAI,gBAAgB,CAAC;IAErB,IAAI,cAAc,CAAC,IAAI,KAAK,sBAAsB,CAAC,UAAU,EAAE,CAAC;QAC/D,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE;YACzD,2BAA2B,EAAE,CAAC;YAC9B,gCAAgC,CAC/B,UAAU,EACV,OAAO,EACP,YAAY,CAAC,OAAO,EAAE,qBAAqB,wBAE3C,eAAe,CAAC,qBAAqB,CAAC,UAAU,CAAC,gBAAgB,EAAE,EAAE;gBACpE,aAAa,CAAC,IAAI;gBAClB,aAAa,CAAC,MAAM;aACpB,CAAC,CACF,CAAC;YAEF,OAAO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AAC,MAAM,CAAC,KAAK;aACvC;SACD,EACD,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QACH,gBAAgB,8BAA2C,CAAC;IAC7D,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,sBAAsB,CAAC,OAAO,EAAE,CAAC;QACnE,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,qBAAqB,CACxB,gBAAgB,CAAC,WAAW,CAC3B;YACC,sBAAsB,EAAE,UAAU,CAAC,yBAAyB,CAC3D,WAAW,0BAEX;YACD,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CACzD,SAAS,0BAET;SACD,EACD,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QACH,gBAAgB,4BAAyC,CAAC;IAC3D,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,sBAAsB,CAAC,OAAO,EAAE,CAAC;QACnE,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,qBAAqB,CACxB,gBAAgB,CAAC,WAAW,CAC3B;YACC,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CACzD,SAAS,0BAET;YACD,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CACzD,SAAS,0BAET;SACD,EACD,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QACH,gBAAgB,4BAAyC,CAAC;IAC3D,CAAC;IAED,OAAO;QACN,eAAe,EAAE,eAAsE;QACvF,gBAAgB;QAChB,OAAO,EAAE,yBAAyB;KAClC,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport {\n\tAuthHeaderProcessor,\n\tinitSchema as initSchemaAuthEntityStorage,\n\ttype AuthenticationUser\n} from \"@3sixty/api-auth-entity-storage-service\";\nimport { RestRouteProcessorFactory } from \"@3sixty/api-models\";\nimport {\n\tContextIdProcessor,\n\tLoggingProcessor,\n\tRestRouteProcessor,\n\tStaticContextIdProcessor\n} from \"@3sixty/api-processors\";\nimport {\n\tTenantProcessor,\n\tSingleTenantProcessor,\n\tTenantOverrideProcessor\n} from \"@3sixty/api-tenant-processor\";\nimport { ContextIdHelper, ContextIdKeys } from \"@3sixty/context\";\nimport type { IComponent } from \"@3sixty/core\";\nimport type {\n\tEngineTypeInitialiserReturn,\n\tIEngineCore,\n\tIEngineCoreContext\n} from \"@3sixty/engine-models\";\nimport { EngineTypeHelper, initialiseEntityStorageConnector } from \"@3sixty/engine-types\";\nimport { nameof, nameofKebabCase } from \"@3sixty/nameof\";\nimport { MetricsRouteProcessor } from \"@3sixty/telemetry-processors\";\nimport { TracingRouteProcessor } from \"@3sixty/tracing-processors\";\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 function initialiseRestRouteProcessorComponent(\n\tengineCore: IEngineCore<IEngineServerConfig>,\n\tcontext: IEngineCoreContext<IEngineServerConfig>,\n\tinstanceConfig: RestRouteProcessorConfig\n): EngineTypeInitialiserReturn<RestRouteProcessorConfig, typeof RestRouteProcessorFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === RestRouteProcessorType.AuthHeader) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) => {\n\t\t\tinitSchemaAuthEntityStorage();\n\t\t\tinitialiseEntityStorageConnector(\n\t\t\t\tengineCore,\n\t\t\t\tcontext,\n\t\t\t\tcreateConfig.options?.userEntityStorageType,\n\t\t\t\tnameof<AuthenticationUser>(),\n\t\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [\n\t\t\t\t\tContextIdKeys.Node,\n\t\t\t\t\tContextIdKeys.Tenant\n\t\t\t\t])\n\t\t\t);\n\n\t\t\treturn new AuthHeaderProcessor(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\tvaultConnectorType: engineCore.getRegisteredInstanceType(\"vaultConnector\"),\n\t\t\t\t\t\ttenantAdminComponentType:\n\t\t\t\t\t\t\tengineCore.getRegisteredInstanceTypeOptional(\"tenantAdminComponent\")\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tconfig: {\n\t\t\t\t\t\t\tincludeErrorStack: context.config.debug\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\t};\n\t\tinstanceTypeName = nameofKebabCase(AuthHeaderProcessor);\n\t} else if (instanceConfig.type === RestRouteProcessorType.Logging) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew LoggingProcessor(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\tloggingComponentType: engineCore.getRegisteredSilencedType(\n\t\t\t\t\t\t\t\"logging\",\n\t\t\t\t\t\t\tnameof(LoggingProcessor)\n\t\t\t\t\t\t)\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(LoggingProcessor);\n\t} else if (instanceConfig.type === RestRouteProcessorType.ContextId) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew ContextIdProcessor(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(createConfig.options)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(ContextIdProcessor);\n\t} else if (instanceConfig.type === RestRouteProcessorType.StaticContextId) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew StaticContextIdProcessor(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(createConfig.options)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(StaticContextIdProcessor);\n\t} else if (instanceConfig.type === RestRouteProcessorType.RestRoute) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew RestRouteProcessor(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\tconfig: {\n\t\t\t\t\t\t\tincludeErrorStack: context.config.debug\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(RestRouteProcessor);\n\t} else if (instanceConfig.type === RestRouteProcessorType.Tenant) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew TenantProcessor(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\ttenantAdminComponentType: engineCore.getRegisteredInstanceType(\"tenantAdminComponent\"),\n\t\t\t\t\t\tconfig: {\n\t\t\t\t\t\t\tincludeErrorStack: context.config.debug\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(TenantProcessor);\n\t} else if (instanceConfig.type === RestRouteProcessorType.SingleTenant) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew SingleTenantProcessor(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\tconfig: {\n\t\t\t\t\t\t\tincludeErrorStack: context.config.debug\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(SingleTenantProcessor);\n\t} else if (instanceConfig.type === RestRouteProcessorType.TenantOverride) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew TenantOverrideProcessor(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\ttenantAdminComponentType: engineCore.getRegisteredInstanceType(\"tenantAdminComponent\"),\n\t\t\t\t\t\tconfig: {\n\t\t\t\t\t\t\tincludeErrorStack: context.config.debug\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(TenantOverrideProcessor);\n\t} else if (instanceConfig.type === RestRouteProcessorType.Metrics) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew MetricsRouteProcessor(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\ttelemetryComponentType: engineCore.getRegisteredSilencedType(\n\t\t\t\t\t\t\t\"telemetry\",\n\t\t\t\t\t\t\tnameof(MetricsRouteProcessor)\n\t\t\t\t\t\t),\n\t\t\t\t\t\tloggingComponentType: engineCore.getRegisteredSilencedType(\n\t\t\t\t\t\t\t\"logging\",\n\t\t\t\t\t\t\tnameof(MetricsRouteProcessor)\n\t\t\t\t\t\t)\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(MetricsRouteProcessor);\n\t} else if (instanceConfig.type === RestRouteProcessorType.Tracing) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew TracingRouteProcessor(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\ttracingComponentType: engineCore.getRegisteredSilencedType(\n\t\t\t\t\t\t\t\"tracing\",\n\t\t\t\t\t\t\tnameof(TracingRouteProcessor)\n\t\t\t\t\t\t),\n\t\t\t\t\t\tloggingComponentType: engineCore.getRegisteredSilencedType(\n\t\t\t\t\t\t\t\"logging\",\n\t\t\t\t\t\t\tnameof(TracingRouteProcessor)\n\t\t\t\t\t\t)\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(TracingRouteProcessor);\n\t}\n\n\treturn {\n\t\tcreateComponent: createComponent as (createConfig: typeof instanceConfig) => IComponent,\n\t\tinstanceTypeName,\n\t\tfactory: RestRouteProcessorFactory\n\t};\n}\n"]}
|
|
1
|
+
{"version":3,"file":"restRouteProcessor.js","sources":["../../../src/components/restRouteProcessor.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EACN,mBAAmB,EACnB,UAAU,IAAI,2BAA2B,EAEzC,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EACN,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,wBAAwB,EACxB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACtF,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAOjE,OAAO,EAAE,gBAAgB,EAAE,gCAAgC,EAAE,MAAM,sBAAsB,CAAC;AAE1F,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAGnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AAE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e,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,qBAAqB,CACxB,gBAAgB,CAAC,WAAW,CAC3B;YACC,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CACzD,SAAS,EACT,uBAAuB,CACvB;YACD,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CACzD,SAAS,EACT,uBAAuB,CACvB;SACD,EACD,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QACH,gBAAgB,GAAG,yBAAyB,CAAC;IAC9C,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,sBAAsB,CAAC,aAAa,EAAE,CAAC;QACzE,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,2BAA2B,CAC9B,gBAAgB,CAAC,WAAW,CAC3B;YACC,0BAA0B,EACzB,UAAU,CAAC,yBAAyB,CAAC,wBAAwB,CAAC;YAC/D,MAAM,EAAE;gBACP,iBAAiB,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK;aACvC;SACD,EACD,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QACH,gBAAgB,GAAG,+BAA+B,CAAC;IACpD,CAAC;IAED,OAAO;QACN,eAAe,EAAE,eAAsE;QACvF,gBAAgB;QAChB,OAAO,EAAE,yBAAyB;KAClC,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport {\n\tAuthHeaderProcessor,\n\tinitSchema as initSchemaAuthEntityStorage,\n\ttype AuthenticationUser\n} from \"@3sixty/api-auth-entity-storage-service\";\nimport { TenantOverrideProcessor } from \"@3sixty/api-auth-service\";\nimport { RestRouteProcessorFactory } from \"@3sixty/api-models\";\nimport {\n\tContextIdProcessor,\n\tLoggingProcessor,\n\tRestRouteProcessor,\n\tStaticContextIdProcessor\n} from \"@3sixty/api-processors\";\nimport { TenantProcessor, SingleTenantProcessor } from \"@3sixty/api-tenant-processor\";\nimport { AuthorizationRouteProcessor } from \"@3sixty/authorization-service\";\nimport { ContextIdHelper, ContextIdKeys } from \"@3sixty/context\";\nimport type { IComponent } from \"@3sixty/core\";\nimport type {\n\tEngineTypeInitialiserReturn,\n\tIEngineCore,\n\tIEngineCoreContext\n} from \"@3sixty/engine-models\";\nimport { EngineTypeHelper, initialiseEntityStorageConnector } from \"@3sixty/engine-types\";\n\nimport { MetricsRouteProcessor } from \"@3sixty/telemetry-processors\";\nimport { TracingRouteProcessor } from \"@3sixty/tracing-processors\";\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 function initialiseRestRouteProcessorComponent(\n\tengineCore: IEngineCore<IEngineServerConfig>,\n\tcontext: IEngineCoreContext<IEngineServerConfig>,\n\tinstanceConfig: RestRouteProcessorConfig\n): EngineTypeInitialiserReturn<RestRouteProcessorConfig, typeof RestRouteProcessorFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === RestRouteProcessorType.AuthHeader) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) => {\n\t\t\tinitSchemaAuthEntityStorage();\n\t\t\tinitialiseEntityStorageConnector(\n\t\t\t\tengineCore,\n\t\t\t\tcontext,\n\t\t\t\tcreateConfig.options?.userEntityStorageType,\n\t\t\t\t\"AuthenticationUser\",\n\t\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [\n\t\t\t\t\tContextIdKeys.Node,\n\t\t\t\t\tContextIdKeys.Tenant\n\t\t\t\t])\n\t\t\t);\n\n\t\t\treturn new AuthHeaderProcessor(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\tvaultConnectorType: engineCore.getRegisteredInstanceType(\"vaultConnector\"),\n\t\t\t\t\t\ttenantAdminComponentType:\n\t\t\t\t\t\t\tengineCore.getRegisteredInstanceTypeOptional(\"tenantAdminComponent\")\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tconfig: {\n\t\t\t\t\t\t\tincludeErrorStack: context.config.debug\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\t};\n\t\tinstanceTypeName = \"auth-header-processor\";\n\t} else if (instanceConfig.type === RestRouteProcessorType.Logging) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew LoggingProcessor(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\tloggingComponentType: engineCore.getRegisteredSilencedType(\n\t\t\t\t\t\t\t\"logging\",\n\t\t\t\t\t\t\t\"LoggingProcessor\"\n\t\t\t\t\t\t)\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = \"logging-processor\";\n\t} else if (instanceConfig.type === RestRouteProcessorType.ContextId) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew ContextIdProcessor(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(createConfig.options)\n\t\t\t);\n\t\tinstanceTypeName = \"context-id-processor\";\n\t} else if (instanceConfig.type === RestRouteProcessorType.StaticContextId) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew StaticContextIdProcessor(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(createConfig.options)\n\t\t\t);\n\t\tinstanceTypeName = \"static-context-id-processor\";\n\t} else if (instanceConfig.type === RestRouteProcessorType.RestRoute) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew RestRouteProcessor(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\tconfig: {\n\t\t\t\t\t\t\tincludeErrorStack: context.config.debug\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = \"rest-route-processor\";\n\t} else if (instanceConfig.type === RestRouteProcessorType.Tenant) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew TenantProcessor(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\ttenantAdminComponentType: engineCore.getRegisteredInstanceType(\"tenantAdminComponent\"),\n\t\t\t\t\t\tconfig: {\n\t\t\t\t\t\t\tincludeErrorStack: context.config.debug\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = \"tenant-processor\";\n\t} else if (instanceConfig.type === RestRouteProcessorType.SingleTenant) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew SingleTenantProcessor(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\tconfig: {\n\t\t\t\t\t\t\tincludeErrorStack: context.config.debug\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = \"single-tenant-processor\";\n\t} else if (instanceConfig.type === RestRouteProcessorType.TenantOverride) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew TenantOverrideProcessor(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\ttenantAdminComponentType: engineCore.getRegisteredInstanceType(\"tenantAdminComponent\"),\n\t\t\t\t\t\tauthorizationComponentType:\n\t\t\t\t\t\t\tengineCore.getRegisteredInstanceType(\"authorizationComponent\"),\n\t\t\t\t\t\tconfig: {\n\t\t\t\t\t\t\tincludeErrorStack: context.config.debug\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = \"tenant-override-processor\";\n\t} else if (instanceConfig.type === RestRouteProcessorType.Metrics) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew MetricsRouteProcessor(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\ttelemetryComponentType: engineCore.getRegisteredSilencedType(\n\t\t\t\t\t\t\t\"telemetry\",\n\t\t\t\t\t\t\t\"MetricsRouteProcessor\"\n\t\t\t\t\t\t),\n\t\t\t\t\t\tloggingComponentType: engineCore.getRegisteredSilencedType(\n\t\t\t\t\t\t\t\"logging\",\n\t\t\t\t\t\t\t\"MetricsRouteProcessor\"\n\t\t\t\t\t\t)\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = \"metrics-route-processor\";\n\t} else if (instanceConfig.type === RestRouteProcessorType.Tracing) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew TracingRouteProcessor(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\ttracingComponentType: engineCore.getRegisteredSilencedType(\n\t\t\t\t\t\t\t\"tracing\",\n\t\t\t\t\t\t\t\"TracingRouteProcessor\"\n\t\t\t\t\t\t),\n\t\t\t\t\t\tloggingComponentType: engineCore.getRegisteredSilencedType(\n\t\t\t\t\t\t\t\"logging\",\n\t\t\t\t\t\t\t\"TracingRouteProcessor\"\n\t\t\t\t\t\t)\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = \"tracing-route-processor\";\n\t} else if (instanceConfig.type === RestRouteProcessorType.Authorization) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew AuthorizationRouteProcessor(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\tauthorizationComponentType:\n\t\t\t\t\t\t\tengineCore.getRegisteredInstanceType(\"authorizationComponent\"),\n\t\t\t\t\t\tconfig: {\n\t\t\t\t\t\t\tincludeErrorStack: context.config.debug\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = \"authorization-route-processor\";\n\t}\n\n\treturn {\n\t\tcreateComponent: createComponent as (createConfig: typeof instanceConfig) => IComponent,\n\t\tinstanceTypeName,\n\t\tfactory: RestRouteProcessorFactory\n\t};\n}\n"]}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
// Copyright 2024 IOTA Stiftung.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0.
|
|
3
3
|
import { AuthHeaderProcessor, initSchema as initSchemaAuthEntityStorage } from "@3sixty/api-auth-entity-storage-service";
|
|
4
|
+
import { TenantOverrideProcessor } from "@3sixty/api-auth-service";
|
|
4
5
|
import { SocketRouteProcessorFactory } from "@3sixty/api-models";
|
|
5
6
|
import { ContextIdProcessor, LoggingProcessor, SocketRouteProcessor, StaticContextIdProcessor } from "@3sixty/api-processors";
|
|
6
|
-
import { SingleTenantProcessor,
|
|
7
|
+
import { SingleTenantProcessor, TenantProcessor } from "@3sixty/api-tenant-processor";
|
|
8
|
+
import { AuthorizationRouteProcessor } from "@3sixty/authorization-service";
|
|
7
9
|
import { ContextIdHelper, ContextIdKeys } from "@3sixty/context";
|
|
8
10
|
import { EngineTypeHelper, initialiseEntityStorageConnector } from "@3sixty/engine-types";
|
|
9
11
|
import { SocketRouteProcessorType } from "../models/types/socketRouteProcessorType.js";
|
|
@@ -77,12 +79,22 @@ export function initialiseSocketRouteProcessorComponent(engineCore, context, ins
|
|
|
77
79
|
else if (instanceConfig.type === SocketRouteProcessorType.TenantOverride) {
|
|
78
80
|
createComponent = (createConfig) => new TenantOverrideProcessor(EngineTypeHelper.mergeConfig({
|
|
79
81
|
tenantAdminComponentType: engineCore.getRegisteredInstanceType("tenantAdminComponent"),
|
|
82
|
+
authorizationComponentType: engineCore.getRegisteredInstanceType("authorizationComponent"),
|
|
80
83
|
config: {
|
|
81
84
|
includeErrorStack: context.config.debug
|
|
82
85
|
}
|
|
83
86
|
}, createConfig.options));
|
|
84
87
|
instanceTypeName = "tenant-override-processor";
|
|
85
88
|
}
|
|
89
|
+
else if (instanceConfig.type === SocketRouteProcessorType.Authorization) {
|
|
90
|
+
createComponent = (createConfig) => new AuthorizationRouteProcessor(EngineTypeHelper.mergeConfig({
|
|
91
|
+
authorizationComponentType: engineCore.getRegisteredInstanceType("authorizationComponent"),
|
|
92
|
+
config: {
|
|
93
|
+
includeErrorStack: context.config.debug
|
|
94
|
+
}
|
|
95
|
+
}, createConfig.options));
|
|
96
|
+
instanceTypeName = "authorization-route-processor";
|
|
97
|
+
}
|
|
86
98
|
return {
|
|
87
99
|
createComponent: createComponent,
|
|
88
100
|
instanceTypeName,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"socketRouteProcessor.js","sourceRoot":"","sources":["../../../src/components/socketRouteProcessor.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EACN,mBAAmB,EACnB,UAAU,IAAI,2BAA2B,EAEzC,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EACN,kB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AAgB,CAAC,WAAW,CAC3B;YACC,wBAAwB,EAAE,UAAU,CAAC,yBAAyB,CAAC,sBAAsB,CAAC;YACtF,MAAM,EAAE;gBACP,iBAAiB,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK;aACvC;SACD,EACD,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QACH,gBAAgB,qBAAmC,CAAC;IACrD,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,wBAAwB,CAAC,YAAY,EAAE,CAAC;QAC1E,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,qBAAqB,CACxB,gBAAgB,CAAC,WAAW,CAC3B;YACC,MAAM,EAAE;gBACP,iBAAiB,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK;aACvC;SACD,EACD,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QACH,gBAAgB,4BAAyC,CAAC;IAC3D,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,wBAAwB,CAAC,cAAc,EAAE,CAAC;QAC5E,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,uBAAuB,CAC1B,gBAAgB,CAAC,WAAW,CAC3B;YACC,wBAAwB,EAAE,UAAU,CAAC,yBAAyB,CAAC,sBAAsB,CAAC;YACtF,MAAM,EAAE;gBACP,iBAAiB,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK;aACvC;SACD,EACD,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QACH,gBAAgB,8BAA2C,CAAC;IAC7D,CAAC;IAED,OAAO;QACN,eAAe,EAAE,eAAsE;QACvF,gBAAgB;QAChB,OAAO,EAAE,2BAA2B;KACpC,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport {\n\tAuthHeaderProcessor,\n\tinitSchema as initSchemaAuthEntityStorage,\n\ttype AuthenticationUser\n} from \"@3sixty/api-auth-entity-storage-service\";\nimport { SocketRouteProcessorFactory } from \"@3sixty/api-models\";\nimport {\n\tContextIdProcessor,\n\tLoggingProcessor,\n\tSocketRouteProcessor,\n\tStaticContextIdProcessor\n} from \"@3sixty/api-processors\";\nimport {\n\tSingleTenantProcessor,\n\tTenantOverrideProcessor,\n\tTenantProcessor\n} from \"@3sixty/api-tenant-processor\";\nimport { ContextIdHelper, ContextIdKeys } from \"@3sixty/context\";\nimport type { IComponent } from \"@3sixty/core\";\nimport type {\n\tEngineTypeInitialiserReturn,\n\tIEngineCore,\n\tIEngineCoreContext\n} from \"@3sixty/engine-models\";\nimport { EngineTypeHelper, initialiseEntityStorageConnector } from \"@3sixty/engine-types\";\nimport { nameof, nameofKebabCase } from \"@3sixty/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 function initialiseSocketRouteProcessorComponent(\n\tengineCore: IEngineCore<IEngineServerConfig>,\n\tcontext: IEngineCoreContext<IEngineServerConfig>,\n\tinstanceConfig: SocketRouteProcessorConfig\n): EngineTypeInitialiserReturn<SocketRouteProcessorConfig, typeof SocketRouteProcessorFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === SocketRouteProcessorType.AuthHeader) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) => {\n\t\t\tinitSchemaAuthEntityStorage();\n\t\t\tinitialiseEntityStorageConnector(\n\t\t\t\tengineCore,\n\t\t\t\tcontext,\n\t\t\t\tcreateConfig.options?.userEntityStorageType,\n\t\t\t\tnameof<AuthenticationUser>(),\n\t\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [\n\t\t\t\t\tContextIdKeys.Node,\n\t\t\t\t\tContextIdKeys.Tenant\n\t\t\t\t])\n\t\t\t);\n\n\t\t\treturn new AuthHeaderProcessor(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\tvaultConnectorType: engineCore.getRegisteredInstanceType(\"vaultConnector\"),\n\t\t\t\t\t\ttenantAdminComponentType:\n\t\t\t\t\t\t\tengineCore.getRegisteredInstanceTypeOptional(\"tenantAdminComponent\")\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tconfig: {\n\t\t\t\t\t\t\tincludeErrorStack: context.config.debug\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\t};\n\t\tinstanceTypeName = nameofKebabCase(AuthHeaderProcessor);\n\t} else if (instanceConfig.type === SocketRouteProcessorType.Logging) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew LoggingProcessor(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\tloggingComponentType: engineCore.getRegisteredSilencedType(\n\t\t\t\t\t\t\t\"logging\",\n\t\t\t\t\t\t\tnameof(LoggingProcessor)\n\t\t\t\t\t\t)\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(LoggingProcessor);\n\t} else if (instanceConfig.type === SocketRouteProcessorType.ContextId) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew ContextIdProcessor(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(createConfig.options)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(ContextIdProcessor);\n\t} else if (instanceConfig.type === SocketRouteProcessorType.StaticContextId) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew StaticContextIdProcessor(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(createConfig.options)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(StaticContextIdProcessor);\n\t} else if (instanceConfig.type === SocketRouteProcessorType.SocketRoute) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew SocketRouteProcessor(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\tconfig: {\n\t\t\t\t\t\t\tincludeErrorStack: context.config.debug\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(SocketRouteProcessor);\n\t} else if (instanceConfig.type === SocketRouteProcessorType.Tenant) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew TenantProcessor(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\ttenantAdminComponentType: engineCore.getRegisteredInstanceType(\"tenantAdminComponent\"),\n\t\t\t\t\t\tconfig: {\n\t\t\t\t\t\t\tincludeErrorStack: context.config.debug\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(TenantProcessor);\n\t} else if (instanceConfig.type === SocketRouteProcessorType.SingleTenant) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew SingleTenantProcessor(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\tconfig: {\n\t\t\t\t\t\t\tincludeErrorStack: context.config.debug\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(SingleTenantProcessor);\n\t} else if (instanceConfig.type === SocketRouteProcessorType.TenantOverride) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew TenantOverrideProcessor(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\ttenantAdminComponentType: engineCore.getRegisteredInstanceType(\"tenantAdminComponent\"),\n\t\t\t\t\t\tconfig: {\n\t\t\t\t\t\t\tincludeErrorStack: context.config.debug\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(TenantOverrideProcessor);\n\t}\n\n\treturn {\n\t\tcreateComponent: createComponent as (createConfig: typeof instanceConfig) => IComponent,\n\t\tinstanceTypeName,\n\t\tfactory: SocketRouteProcessorFactory\n\t};\n}\n"]}
|
|
1
|
+
{"version":3,"file":"socketRouteProcessor.js","sources":["../../../src/components/socketRouteProcessor.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EACN,mBAAmB,EACnB,UAAU,IAAI,2BAA2B,EAEzC,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EACN,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,wBAAwB,EACxB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACtF,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAOjE,OAAO,EAAE,gBAAgB,EAAE,gC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,CAAC;IAED,OAAO;QACN,eAAe,EAAE,eAAsE;QACvF,gBAAgB;QAChB,OAAO,EAAE,2BAA2B;KACpC,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport {\n\tAuthHeaderProcessor,\n\tinitSchema as initSchemaAuthEntityStorage,\n\ttype AuthenticationUser\n} from \"@3sixty/api-auth-entity-storage-service\";\nimport { TenantOverrideProcessor } from \"@3sixty/api-auth-service\";\nimport { SocketRouteProcessorFactory } from \"@3sixty/api-models\";\nimport {\n\tContextIdProcessor,\n\tLoggingProcessor,\n\tSocketRouteProcessor,\n\tStaticContextIdProcessor\n} from \"@3sixty/api-processors\";\nimport { SingleTenantProcessor, TenantProcessor } from \"@3sixty/api-tenant-processor\";\nimport { AuthorizationRouteProcessor } from \"@3sixty/authorization-service\";\nimport { ContextIdHelper, ContextIdKeys } from \"@3sixty/context\";\nimport type { IComponent } from \"@3sixty/core\";\nimport type {\n\tEngineTypeInitialiserReturn,\n\tIEngineCore,\n\tIEngineCoreContext\n} from \"@3sixty/engine-models\";\nimport { EngineTypeHelper, initialiseEntityStorageConnector } from \"@3sixty/engine-types\";\n\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 function initialiseSocketRouteProcessorComponent(\n\tengineCore: IEngineCore<IEngineServerConfig>,\n\tcontext: IEngineCoreContext<IEngineServerConfig>,\n\tinstanceConfig: SocketRouteProcessorConfig\n): EngineTypeInitialiserReturn<SocketRouteProcessorConfig, typeof SocketRouteProcessorFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === SocketRouteProcessorType.AuthHeader) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) => {\n\t\t\tinitSchemaAuthEntityStorage();\n\t\t\tinitialiseEntityStorageConnector(\n\t\t\t\tengineCore,\n\t\t\t\tcontext,\n\t\t\t\tcreateConfig.options?.userEntityStorageType,\n\t\t\t\t\"AuthenticationUser\",\n\t\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [\n\t\t\t\t\tContextIdKeys.Node,\n\t\t\t\t\tContextIdKeys.Tenant\n\t\t\t\t])\n\t\t\t);\n\n\t\t\treturn new AuthHeaderProcessor(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\tvaultConnectorType: engineCore.getRegisteredInstanceType(\"vaultConnector\"),\n\t\t\t\t\t\ttenantAdminComponentType:\n\t\t\t\t\t\t\tengineCore.getRegisteredInstanceTypeOptional(\"tenantAdminComponent\")\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tconfig: {\n\t\t\t\t\t\t\tincludeErrorStack: context.config.debug\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\t};\n\t\tinstanceTypeName = \"auth-header-processor\";\n\t} else if (instanceConfig.type === SocketRouteProcessorType.Logging) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew LoggingProcessor(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\tloggingComponentType: engineCore.getRegisteredSilencedType(\n\t\t\t\t\t\t\t\"logging\",\n\t\t\t\t\t\t\t\"LoggingProcessor\"\n\t\t\t\t\t\t)\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = \"logging-processor\";\n\t} else if (instanceConfig.type === SocketRouteProcessorType.ContextId) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew ContextIdProcessor(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(createConfig.options)\n\t\t\t);\n\t\tinstanceTypeName = \"context-id-processor\";\n\t} else if (instanceConfig.type === SocketRouteProcessorType.StaticContextId) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew StaticContextIdProcessor(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(createConfig.options)\n\t\t\t);\n\t\tinstanceTypeName = \"static-context-id-processor\";\n\t} else if (instanceConfig.type === SocketRouteProcessorType.SocketRoute) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew SocketRouteProcessor(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\tconfig: {\n\t\t\t\t\t\t\tincludeErrorStack: context.config.debug\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = \"socket-route-processor\";\n\t} else if (instanceConfig.type === SocketRouteProcessorType.Tenant) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew TenantProcessor(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\ttenantAdminComponentType: engineCore.getRegisteredInstanceType(\"tenantAdminComponent\"),\n\t\t\t\t\t\tconfig: {\n\t\t\t\t\t\t\tincludeErrorStack: context.config.debug\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = \"tenant-processor\";\n\t} else if (instanceConfig.type === SocketRouteProcessorType.SingleTenant) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew SingleTenantProcessor(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\tconfig: {\n\t\t\t\t\t\t\tincludeErrorStack: context.config.debug\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = \"single-tenant-processor\";\n\t} else if (instanceConfig.type === SocketRouteProcessorType.TenantOverride) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew TenantOverrideProcessor(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\ttenantAdminComponentType: engineCore.getRegisteredInstanceType(\"tenantAdminComponent\"),\n\t\t\t\t\t\tauthorizationComponentType:\n\t\t\t\t\t\t\tengineCore.getRegisteredInstanceType(\"authorizationComponent\"),\n\t\t\t\t\t\tconfig: {\n\t\t\t\t\t\t\tincludeErrorStack: context.config.debug\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = \"tenant-override-processor\";\n\t} else if (instanceConfig.type === SocketRouteProcessorType.Authorization) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew AuthorizationRouteProcessor(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\tauthorizationComponentType:\n\t\t\t\t\t\t\tengineCore.getRegisteredInstanceType(\"authorizationComponent\"),\n\t\t\t\t\t\tconfig: {\n\t\t\t\t\t\t\tincludeErrorStack: context.config.debug\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = \"authorization-route-processor\";\n\t}\n\n\treturn {\n\t\tcreateComponent: createComponent as (createConfig: typeof instanceConfig) => IComponent,\n\t\tinstanceTypeName,\n\t\tfactory: SocketRouteProcessorFactory\n\t};\n}\n"]}
|
package/dist/es/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Copyright 2024 IOTA Stiftung.
|
|
2
|
+
// Copyright 2026 3Sixty Trade Ltd.
|
|
2
3
|
// SPDX-License-Identifier: Apache-2.0.
|
|
3
4
|
export * from "./components/authentication.js";
|
|
4
5
|
export * from "./components/authenticationAdmin.js";
|
|
@@ -25,4 +26,5 @@ export * from "./models/types/informationComponentType.js";
|
|
|
25
26
|
export * from "./models/types/mimeTypeProcessorType.js";
|
|
26
27
|
export * from "./models/types/restRouteProcessorType.js";
|
|
27
28
|
export * from "./models/types/socketRouteProcessorType.js";
|
|
29
|
+
export * from "./models/types/webServerType.js";
|
|
28
30
|
//# sourceMappingURL=index.js.map
|
package/dist/es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,mCAAmC;AACnC,uCAAuC;AACvC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qCAAqC,CAAC;AACpD,cAAc,qCAAqC,CAAC;AACpD,cAAc,oCAAoC,CAAC;AACnD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,sCAAsC,CAAC;AACrD,cAAc,uDAAuD,CAAC;AACtE,cAAc,uDAAuD,CAAC;AACtE,cAAc,kDAAkD,CAAC;AACjE,cAAc,sDAAsD,CAAC;AACrE,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,oDAAoD,CAAC;AACnE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,mDAAmD,CAAC;AAClE,cAAc,4CAA4C,CAAC;AAC3D,cAAc,yCAAyC,CAAC;AACxD,cAAc,0CAA0C,CAAC;AACzD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,iCAAiC,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// Copyright 2026 3Sixty Trade Ltd.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./components/authentication.js\";\nexport * from \"./components/authenticationAdmin.js\";\nexport * from \"./components/authenticationAudit.js\";\nexport * from \"./components/authenticationRate.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/authenticationAuditComponentConfig.js\";\nexport * from \"./models/config/authenticationComponentConfig.js\";\nexport * from \"./models/config/authenticationRateComponentConfig.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/authenticationAuditComponentType.js\";\nexport * from \"./models/types/authenticationComponentType.js\";\nexport * from \"./models/types/authenticationRateComponentType.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\";\nexport * from \"./models/types/webServerType.js\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IEngineServerConfig.js","
|
|
1
|
+
{"version":3,"file":"IEngineServerConfig.js","sources":["../../../src/models/IEngineServerConfig.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// Copyright 2026 3Sixty Trade Ltd.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IWebServerOptions } from \"@3sixty/api-models\";\nimport type { IEngineCoreTypeConfig } from \"@3sixty/engine-models\";\nimport type { IEngineConfig } from \"@3sixty/engine-types\";\nimport type { AuthenticationAdminComponentConfig } from \"./config/authenticationAdminComponentConfig.js\";\nimport type { AuthenticationAuditComponentConfig } from \"./config/authenticationAuditComponentConfig.js\";\nimport type { AuthenticationComponentConfig } from \"./config/authenticationComponentConfig.js\";\nimport type { AuthenticationRateComponentConfig } from \"./config/authenticationRateComponentConfig.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\";\nimport type { WebServerType } from \"./types/webServerType.js\";\n\n/**\n * Extended engine server config with known types.\n */\nexport interface IEngineServerConfig extends IEngineConfig {\n\t/**\n\t * The type of web server to use.\n\t * @default fastify\n\t */\n\twebServerType?: WebServerType;\n\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 audit component options which can be overridden by individual components by specifying types other than default.\n\t\t */\n\t\tauthenticationAuditComponent?: IEngineCoreTypeConfig<AuthenticationAuditComponentConfig>[];\n\n\t\t/**\n\t\t * Authentication rate component options which can be overridden by individual components by specifying types other than default.\n\t\t */\n\t\tauthenticationRateComponent?: IEngineCoreTypeConfig<AuthenticationRateComponentConfig>[];\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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authenticationAdminComponentConfig.js","
|
|
1
|
+
{"version":3,"file":"authenticationAdminComponentConfig.js","sources":["../../../../src/models/config/authenticationAdminComponentConfig.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IEntityStorageAuthenticationAdminServiceConstructorOptions } from \"@3sixty/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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authenticationAuditComponentConfig.js","
|
|
1
|
+
{"version":3,"file":"authenticationAuditComponentConfig.js","sources":["../../../../src/models/config/authenticationAuditComponentConfig.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IEntityStorageAuthenticationAuditServiceConstructorOptions } from \"@3sixty/api-auth-service\";\nimport type { AuthenticationAuditComponentType } from \"../types/authenticationAuditComponentType.js\";\n\n/**\n * Authentication audit component config types.\n */\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport type AuthenticationAuditComponentConfig = {\n\ttype: typeof AuthenticationAuditComponentType.EntityStorage;\n\toptions?: IEntityStorageAuthenticationAuditServiceConstructorOptions;\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authenticationComponentConfig.js","
|
|
1
|
+
{"version":3,"file":"authenticationComponentConfig.js","sources":["../../../../src/models/config/authenticationComponentConfig.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IEntityStorageAuthenticationServiceConstructorOptions } from \"@3sixty/api-auth-entity-storage-service\";\nimport type { IBaseRestClientConfig } from \"@3sixty/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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authenticationRateComponentConfig.js","
|
|
1
|
+
{"version":3,"file":"authenticationRateComponentConfig.js","sources":["../../../../src/models/config/authenticationRateComponentConfig.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IEntityStorageAuthenticationRateServiceConstructorOptions } from \"@3sixty/api-auth-service\";\nimport type { AuthenticationRateComponentType } from \"../types/authenticationRateComponentType.js\";\n\n/**\n * Authentication rate component config types.\n */\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport type AuthenticationRateComponentConfig = {\n\ttype: typeof AuthenticationRateComponentType.EntityStorage;\n\toptions?: IEntityStorageAuthenticationRateServiceConstructorOptions;\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"informationComponentConfig.js","
|
|
1
|
+
{"version":3,"file":"informationComponentConfig.js","sources":["../../../../src/models/config/informationComponentConfig.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IBaseRestClientConfig } from \"@3sixty/api-models\";\nimport type { IInformationServiceConstructorOptions } from \"@3sixty/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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mimeTypeProcessorConfig.js","
|
|
1
|
+
{"version":3,"file":"mimeTypeProcessorConfig.js","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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"restRouteProcessorConfig.js","
|
|
1
|
+
{"version":3,"file":"restRouteProcessorConfig.js","sources":["../../../../src/models/config/restRouteProcessorConfig.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IAuthHeaderProcessorConstructorOptions } from \"@3sixty/api-auth-entity-storage-service\";\nimport type { ITenantOverrideProcessorConstructorOptions } from \"@3sixty/api-auth-service\";\nimport type {\n\tIContextIdProcessorConstructorOptions,\n\tILoggingProcessorConstructorOptions,\n\tIRestRouteProcessorConstructorOptions,\n\tIStaticContextIdProcessorConstructorOptions\n} from \"@3sixty/api-processors\";\nimport type {\n\tISingleTenantProcessorConstructorOptions,\n\tITenantProcessorConstructorOptions\n} from \"@3sixty/api-tenant-processor\";\nimport type { IAuthorizationRouteProcessorConstructorOptions } from \"@3sixty/authorization-service\";\nimport type { IMetricsRouteProcessorConstructorOptions } from \"@3sixty/telemetry-processors\";\nimport type { ITracingRouteProcessorConstructorOptions } from \"@3sixty/tracing-processors\";\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.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.SingleTenant;\n\t\t\toptions?: ISingleTenantProcessorConstructorOptions;\n\t }\n\t| {\n\t\t\ttype: typeof RestRouteProcessorType.TenantOverride;\n\t\t\toptions?: ITenantOverrideProcessorConstructorOptions;\n\t }\n\t| {\n\t\t\ttype: typeof RestRouteProcessorType.Metrics;\n\t\t\toptions?: IMetricsRouteProcessorConstructorOptions;\n\t }\n\t| {\n\t\t\ttype: typeof RestRouteProcessorType.RestRoute;\n\t\t\toptions?: IRestRouteProcessorConstructorOptions;\n\t }\n\t| {\n\t\t\ttype: typeof RestRouteProcessorType.Tracing;\n\t\t\toptions?: ITracingRouteProcessorConstructorOptions;\n\t }\n\t| {\n\t\t\ttype: typeof RestRouteProcessorType.Authorization;\n\t\t\toptions?: IAuthorizationRouteProcessorConstructorOptions;\n\t };\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"socketRouteProcessorConfig.js","
|
|
1
|
+
{"version":3,"file":"socketRouteProcessorConfig.js","sources":["../../../../src/models/config/socketRouteProcessorConfig.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IAuthHeaderProcessorConstructorOptions } from \"@3sixty/api-auth-entity-storage-service\";\nimport type { ITenantOverrideProcessorConstructorOptions } from \"@3sixty/api-auth-service\";\nimport type {\n\tIContextIdProcessorConstructorOptions,\n\tILoggingProcessorConstructorOptions,\n\tISocketRouteProcessorConstructorOptions,\n\tIStaticContextIdProcessorConstructorOptions\n} from \"@3sixty/api-processors\";\nimport type {\n\tISingleTenantProcessorConstructorOptions,\n\tITenantProcessorConstructorOptions\n} from \"@3sixty/api-tenant-processor\";\nimport type { IAuthorizationRouteProcessorConstructorOptions } from \"@3sixty/authorization-service\";\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.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.SingleTenant;\n\t\t\toptions?: ISingleTenantProcessorConstructorOptions;\n\t }\n\t| {\n\t\t\ttype: typeof SocketRouteProcessorType.TenantOverride;\n\t\t\toptions?: ITenantOverrideProcessorConstructorOptions;\n\t }\n\t| {\n\t\t\ttype: typeof SocketRouteProcessorType.SocketRoute;\n\t\t\toptions?: ISocketRouteProcessorConstructorOptions;\n\t }\n\t| {\n\t\t\ttype: typeof SocketRouteProcessorType.Authorization;\n\t\t\toptions?: IAuthorizationRouteProcessorConstructorOptions;\n\t };\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authenticationAdminComponentType.js","
|
|
1
|
+
{"version":3,"file":"authenticationAdminComponentType.js","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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authenticationAuditComponentType.js","
|
|
1
|
+
{"version":3,"file":"authenticationAuditComponentType.js","sources":["../../../../src/models/types/authenticationAuditComponentType.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 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Authentication audit component types.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const AuthenticationAuditComponentType = {\n\t/**\n\t * Entity storage.\n\t */\n\tEntityStorage: \"entity-storage\"\n} as const;\n\n/**\n * Authentication audit component types.\n */\nexport type AuthenticationAuditComponentType =\n\t(typeof AuthenticationAuditComponentType)[keyof typeof AuthenticationAuditComponentType];\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authenticationComponentType.js","
|
|
1
|
+
{"version":3,"file":"authenticationComponentType.js","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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authenticationRateComponentType.js","
|
|
1
|
+
{"version":3,"file":"authenticationRateComponentType.js","sources":["../../../../src/models/types/authenticationRateComponentType.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,+BAA+B,GAAG;IAC9C;;OAEG;IACH,aAAa,EAAE,gBAAgB;CACtB,CAAC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Authentication rate component types.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const AuthenticationRateComponentType = {\n\t/**\n\t * Entity storage.\n\t */\n\tEntityStorage: \"entity-storage\"\n} as const;\n\n/**\n * Authentication rate component types.\n */\nexport type AuthenticationRateComponentType =\n\t(typeof AuthenticationRateComponentType)[keyof typeof AuthenticationRateComponentType];\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"informationComponentType.js","
|
|
1
|
+
{"version":3,"file":"informationComponentType.js","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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mimeTypeProcessorType.js","
|
|
1
|
+
{"version":3,"file":"mimeTypeProcessorType.js","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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"restRouteProcessorType.js","
|
|
1
|
+
{"version":3,"file":"restRouteProcessorType.js","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,OAAO,EAAE,SAAS;IAElB;;OAEG;IACH,SAAS,EAAE,YAAY;IAEvB;;OAEG;IACH,eAAe,EAAE,mBAAmB;IAEpC;;OAEG;IACH,MAAM,EAAE,QAAQ;IAEhB;;OAEG;IACH,YAAY,EAAE,eAAe;IAE7B;;OAEG;IACH,cAAc,EAAE,iBAAiB;IAEjC;;OAEG;IACH,SAAS,EAAE,YAAY;IAEvB;;OAEG;IACH,OAAO,EAAE,SAAS;IAElB;;OAEG;IACH,OAAO,EAAE,SAAS;IAElB;;OAEG;IACH,aAAa,EAAE,eAAe;CACrB,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 * 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 * Single Tenant.\n\t */\n\tSingleTenant: \"single-tenant\",\n\n\t/**\n\t * Tenant override.\n\t */\n\tTenantOverride: \"tenant-override\",\n\n\t/**\n\t * REST Route.\n\t */\n\tRestRoute: \"rest-route\",\n\n\t/**\n\t * Metrics.\n\t */\n\tMetrics: \"metrics\",\n\n\t/**\n\t * Tracing.\n\t */\n\tTracing: \"tracing\",\n\n\t/**\n\t * Authorization.\n\t */\n\tAuthorization: \"authorization\"\n} as const;\n\n/**\n * REST route processor types.\n */\nexport type RestRouteProcessorType =\n\t(typeof RestRouteProcessorType)[keyof typeof RestRouteProcessorType];\n"]}
|
|
@@ -36,6 +36,10 @@ export const SocketRouteProcessorType = {
|
|
|
36
36
|
/**
|
|
37
37
|
* Socket Route.
|
|
38
38
|
*/
|
|
39
|
-
SocketRoute: "socket-route"
|
|
39
|
+
SocketRoute: "socket-route",
|
|
40
|
+
/**
|
|
41
|
+
* Authorization.
|
|
42
|
+
*/
|
|
43
|
+
Authorization: "authorization"
|
|
40
44
|
};
|
|
41
45
|
//# sourceMappingURL=socketRouteProcessorType.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"socketRouteProcessorType.js","
|
|
1
|
+
{"version":3,"file":"socketRouteProcessorType.js","sources":["../../../../src/models/types/socketRouteProcessorType.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACvC;;OAEG;IACH,UAAU,EAAE,aAAa;IAEzB;;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,YAAY,EAAE,eAAe;IAE7B;;OAEG;IACH,cAAc,EAAE,iBAAiB;IAEjC;;OAEG;IACH,WAAW,EAAE,cAAc;IAE3B;;OAEG;IACH,aAAa,EAAE,eAAe;CACrB,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Socket route processor types.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const SocketRouteProcessorType = {\n\t/**\n\t * Auth header.\n\t */\n\tAuthHeader: \"auth-header\",\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 * Single Tenant.\n\t */\n\tSingleTenant: \"single-tenant\",\n\n\t/**\n\t * Tenant override.\n\t */\n\tTenantOverride: \"tenant-override\",\n\n\t/**\n\t * Socket Route.\n\t */\n\tSocketRoute: \"socket-route\",\n\n\t/**\n\t * Authorization.\n\t */\n\tAuthorization: \"authorization\"\n} as const;\n\n/**\n * Socket route processor types.\n */\nexport type SocketRouteProcessorType =\n\t(typeof SocketRouteProcessorType)[keyof typeof SocketRouteProcessorType];\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Copyright 2026 3Sixty Trade Ltd.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
/**
|
|
4
|
+
* Web server types.
|
|
5
|
+
*/
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
7
|
+
export const WebServerType = {
|
|
8
|
+
/**
|
|
9
|
+
* Fastify.
|
|
10
|
+
*/
|
|
11
|
+
Fastify: "fastify",
|
|
12
|
+
/**
|
|
13
|
+
* Hono.
|
|
14
|
+
*/
|
|
15
|
+
Hono: "hono",
|
|
16
|
+
/**
|
|
17
|
+
* Native Node.js.
|
|
18
|
+
*/
|
|
19
|
+
Native: "native"
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=webServerType.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webServerType.js","sources":["../../../../src/models/types/webServerType.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,aAAa,GAAG;IAC5B;;OAEG;IACH,OAAO,EAAE,SAAS;IAElB;;OAEG;IACH,IAAI,EAAE,MAAM;IAEZ;;OAEG;IACH,MAAM,EAAE,QAAQ;CACP,CAAC","sourcesContent":["// Copyright 2026 3Sixty Trade Ltd.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Web server types.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const WebServerType = {\n\t/**\n\t * Fastify.\n\t */\n\tFastify: \"fastify\",\n\n\t/**\n\t * Hono.\n\t */\n\tHono: \"hono\",\n\n\t/**\n\t * Native Node.js.\n\t */\n\tNative: \"native\"\n} as const;\n\n/**\n * Web server types.\n */\nexport type WebServerType = (typeof WebServerType)[keyof typeof WebServerType];\n"]}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -23,3 +23,4 @@ export * from "./models/types/informationComponentType.js";
|
|
|
23
23
|
export * from "./models/types/mimeTypeProcessorType.js";
|
|
24
24
|
export * from "./models/types/restRouteProcessorType.js";
|
|
25
25
|
export * from "./models/types/socketRouteProcessorType.js";
|
|
26
|
+
export * from "./models/types/webServerType.js";
|
|
@@ -9,10 +9,16 @@ import type { InformationComponentConfig } from "./config/informationComponentCo
|
|
|
9
9
|
import type { MimeTypeProcessorConfig } from "./config/mimeTypeProcessorConfig.js";
|
|
10
10
|
import type { RestRouteProcessorConfig } from "./config/restRouteProcessorConfig.js";
|
|
11
11
|
import type { SocketRouteProcessorConfig } from "./config/socketRouteProcessorConfig.js";
|
|
12
|
+
import type { WebServerType } from "./types/webServerType.js";
|
|
12
13
|
/**
|
|
13
14
|
* Extended engine server config with known types.
|
|
14
15
|
*/
|
|
15
16
|
export interface IEngineServerConfig extends IEngineConfig {
|
|
17
|
+
/**
|
|
18
|
+
* The type of web server to use.
|
|
19
|
+
* @default fastify
|
|
20
|
+
*/
|
|
21
|
+
webServerType?: WebServerType;
|
|
16
22
|
/**
|
|
17
23
|
* Configuration for the web server.
|
|
18
24
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IEntityStorageAuthenticationAuditServiceConstructorOptions } from "@3sixty/api-auth-
|
|
1
|
+
import type { IEntityStorageAuthenticationAuditServiceConstructorOptions } from "@3sixty/api-auth-service";
|
|
2
2
|
import type { AuthenticationAuditComponentType } from "../types/authenticationAuditComponentType.js";
|
|
3
3
|
/**
|
|
4
4
|
* Authentication audit component config types.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IEntityStorageAuthenticationRateServiceConstructorOptions } from "@3sixty/api-auth-
|
|
1
|
+
import type { IEntityStorageAuthenticationRateServiceConstructorOptions } from "@3sixty/api-auth-service";
|
|
2
2
|
import type { AuthenticationRateComponentType } from "../types/authenticationRateComponentType.js";
|
|
3
3
|
/**
|
|
4
4
|
* Authentication rate component config types.
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { IAuthHeaderProcessorConstructorOptions } from "@3sixty/api-auth-entity-storage-service";
|
|
2
|
+
import type { ITenantOverrideProcessorConstructorOptions } from "@3sixty/api-auth-service";
|
|
2
3
|
import type { IContextIdProcessorConstructorOptions, ILoggingProcessorConstructorOptions, IRestRouteProcessorConstructorOptions, IStaticContextIdProcessorConstructorOptions } from "@3sixty/api-processors";
|
|
3
|
-
import type { ISingleTenantProcessorConstructorOptions,
|
|
4
|
+
import type { ISingleTenantProcessorConstructorOptions, ITenantProcessorConstructorOptions } from "@3sixty/api-tenant-processor";
|
|
5
|
+
import type { IAuthorizationRouteProcessorConstructorOptions } from "@3sixty/authorization-service";
|
|
4
6
|
import type { IMetricsRouteProcessorConstructorOptions } from "@3sixty/telemetry-processors";
|
|
5
7
|
import type { ITracingRouteProcessorConstructorOptions } from "@3sixty/tracing-processors";
|
|
6
8
|
import type { RestRouteProcessorType } from "../types/restRouteProcessorType.js";
|
|
@@ -37,4 +39,7 @@ export type RestRouteProcessorConfig = {
|
|
|
37
39
|
} | {
|
|
38
40
|
type: typeof RestRouteProcessorType.Tracing;
|
|
39
41
|
options?: ITracingRouteProcessorConstructorOptions;
|
|
42
|
+
} | {
|
|
43
|
+
type: typeof RestRouteProcessorType.Authorization;
|
|
44
|
+
options?: IAuthorizationRouteProcessorConstructorOptions;
|
|
40
45
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { IAuthHeaderProcessorConstructorOptions } from "@3sixty/api-auth-entity-storage-service";
|
|
2
|
+
import type { ITenantOverrideProcessorConstructorOptions } from "@3sixty/api-auth-service";
|
|
2
3
|
import type { IContextIdProcessorConstructorOptions, ILoggingProcessorConstructorOptions, ISocketRouteProcessorConstructorOptions, IStaticContextIdProcessorConstructorOptions } from "@3sixty/api-processors";
|
|
3
|
-
import type { ISingleTenantProcessorConstructorOptions,
|
|
4
|
+
import type { ISingleTenantProcessorConstructorOptions, ITenantProcessorConstructorOptions } from "@3sixty/api-tenant-processor";
|
|
5
|
+
import type { IAuthorizationRouteProcessorConstructorOptions } from "@3sixty/authorization-service";
|
|
4
6
|
import type { SocketRouteProcessorType } from "../types/socketRouteProcessorType.js";
|
|
5
7
|
/**
|
|
6
8
|
* Socket route processor config types.
|
|
@@ -29,4 +31,7 @@ export type SocketRouteProcessorConfig = {
|
|
|
29
31
|
} | {
|
|
30
32
|
type: typeof SocketRouteProcessorType.SocketRoute;
|
|
31
33
|
options?: ISocketRouteProcessorConstructorOptions;
|
|
34
|
+
} | {
|
|
35
|
+
type: typeof SocketRouteProcessorType.Authorization;
|
|
36
|
+
options?: IAuthorizationRouteProcessorConstructorOptions;
|
|
32
37
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Web server types.
|
|
3
|
+
*/
|
|
4
|
+
export declare const WebServerType: {
|
|
5
|
+
/**
|
|
6
|
+
* Fastify.
|
|
7
|
+
*/
|
|
8
|
+
readonly Fastify: "fastify";
|
|
9
|
+
/**
|
|
10
|
+
* Hono.
|
|
11
|
+
*/
|
|
12
|
+
readonly Hono: "hono";
|
|
13
|
+
/**
|
|
14
|
+
* Native Node.js.
|
|
15
|
+
*/
|
|
16
|
+
readonly Native: "native";
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Web server types.
|
|
20
|
+
*/
|
|
21
|
+
export type WebServerType = (typeof WebServerType)[keyof typeof WebServerType];
|
package/docs/changelog.md
CHANGED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.20.0-next.2](https://github.com/3sixtyglobal/engine/compare/engine-server-types-v0.20.0-next.1...engine-server-types-v0.20.0-next.2) (2026-10-23)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add authorization ([#23](https://github.com/3sixtyglobal/engine/issues/23)) ([9815628](https://github.com/3sixtyglobal/engine/commit/9815628a7ef6cd79d1b7789c465447c7b29d90a8))
|
|
9
|
+
* updated ts compile ([2bfa964](https://github.com/3sixtyglobal/engine/commit/2bfa9642a97b35ee609c5e19d8bfe0571a1a6319))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Dependencies
|
|
13
|
+
|
|
14
|
+
* The following workspace dependencies were updated
|
|
15
|
+
* dependencies
|
|
16
|
+
* @3sixty/engine-models bumped from 0.20.0-next.1 to 0.20.0-next.2
|
|
17
|
+
* @3sixty/engine-types bumped from 0.20.0-next.1 to 0.20.0-next.2
|
|
18
|
+
|
|
19
|
+
## [0.20.0-next.1](https://github.com/3sixtyglobal/engine/compare/engine-server-types-v0.20.0-next.0...engine-server-types-v0.20.0-next.1) (2026-10-21)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* publish packages under the [@3sixty](https://github.com/3sixty) namespace ([d94be8e](https://github.com/3sixtyglobal/engine/commit/d94be8e189d9f53e383bba47599623ef961eca44))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Dependencies
|
|
28
|
+
|
|
29
|
+
* The following workspace dependencies were updated
|
|
30
|
+
* dependencies
|
|
31
|
+
* @3sixty/engine-models bumped from 0.20.0-next.0 to 0.20.0-next.1
|
|
32
|
+
* @3sixty/engine-types bumped from 0.20.0-next.0 to 0.20.0-next.1
|
package/docs/reference/index.md
CHANGED
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
- [MimeTypeProcessorType](type-aliases/MimeTypeProcessorType.md)
|
|
23
23
|
- [RestRouteProcessorType](type-aliases/RestRouteProcessorType.md)
|
|
24
24
|
- [SocketRouteProcessorType](type-aliases/SocketRouteProcessorType.md)
|
|
25
|
+
- [WebServerType](type-aliases/WebServerType.md)
|
|
25
26
|
|
|
26
27
|
## Variables
|
|
27
28
|
|
|
@@ -33,6 +34,7 @@
|
|
|
33
34
|
- [MimeTypeProcessorType](variables/MimeTypeProcessorType.md)
|
|
34
35
|
- [RestRouteProcessorType](variables/RestRouteProcessorType.md)
|
|
35
36
|
- [SocketRouteProcessorType](variables/SocketRouteProcessorType.md)
|
|
37
|
+
- [WebServerType](variables/WebServerType.md)
|
|
36
38
|
|
|
37
39
|
## Functions
|
|
38
40
|
|
|
@@ -120,6 +120,20 @@ The facades to activate, keyed by the type name of the factory they apply to.
|
|
|
120
120
|
|
|
121
121
|
***
|
|
122
122
|
|
|
123
|
+
### webServerType? {#webservertype}
|
|
124
|
+
|
|
125
|
+
> `optional` **webServerType?**: [`WebServerType`](../type-aliases/WebServerType.md)
|
|
126
|
+
|
|
127
|
+
The type of web server to use.
|
|
128
|
+
|
|
129
|
+
#### Default
|
|
130
|
+
|
|
131
|
+
```ts
|
|
132
|
+
fastify
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
***
|
|
136
|
+
|
|
123
137
|
### web? {#web}
|
|
124
138
|
|
|
125
139
|
> `optional` **web?**: `IWebServerOptions`
|
|
@@ -214,6 +228,18 @@ Metrics producer component options. Creates the `MetricsProducerService` that or
|
|
|
214
228
|
|
|
215
229
|
Metrics collector options. Each entry registers a collector in `MetricsCollectorFactory`.
|
|
216
230
|
|
|
231
|
+
##### authorizationConnector?
|
|
232
|
+
|
|
233
|
+
> `optional` **authorizationConnector?**: `IEngineCoreTypeConfig`\<`AuthorizationConnectorConfig`\>[]
|
|
234
|
+
|
|
235
|
+
Authorization connector options which can be overridden by individual components by specifying types other than default.
|
|
236
|
+
|
|
237
|
+
##### authorizationComponent?
|
|
238
|
+
|
|
239
|
+
> `optional` **authorizationComponent?**: `IEngineCoreTypeConfig`\<`AuthorizationComponentConfig`\>[]
|
|
240
|
+
|
|
241
|
+
Authorization component options which can be overridden by individual components by specifying types other than default.
|
|
242
|
+
|
|
217
243
|
##### messagingEmailConnector?
|
|
218
244
|
|
|
219
245
|
> `optional` **messagingEmailConnector?**: `IEngineCoreTypeConfig`\<`MessagingEmailConnectorConfig`\>[]
|
|
@@ -604,8 +630,6 @@ Tenant admin component options which can be overridden by individual components
|
|
|
604
630
|
|
|
605
631
|
Context Id Handler component options which can be overridden by individual components by specifying types other than default.
|
|
606
632
|
|
|
607
|
-
#### Type Declaration
|
|
608
|
-
|
|
609
633
|
##### informationComponent?
|
|
610
634
|
|
|
611
635
|
> `optional` **informationComponent?**: `IEngineCoreTypeConfig`\<[`InformationComponentConfig`](../type-aliases/InformationComponentConfig.md)\>[]
|
|
@@ -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* [`ContextId`](../variables/RestRouteProcessorType.md#contextid); `options`: `IContextIdProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`StaticContextId`](../variables/RestRouteProcessorType.md#staticcontextid); `options`: `IStaticContextIdProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`Tenant`](../variables/RestRouteProcessorType.md#tenant); `options?`: `ITenantProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`SingleTenant`](../variables/RestRouteProcessorType.md#singletenant); `options?`: `ISingleTenantProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`TenantOverride`](../variables/RestRouteProcessorType.md#tenantoverride); `options?`: `ITenantOverrideProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`Metrics`](../variables/RestRouteProcessorType.md#metrics); `options?`: `IMetricsRouteProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`RestRoute`](../variables/RestRouteProcessorType.md#restroute); `options?`: `IRestRouteProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`Tracing`](../variables/RestRouteProcessorType.md#tracing); `options?`: `ITracingRouteProcessorConstructorOptions`; \}
|
|
3
|
+
> **RestRouteProcessorConfig** = \{ `type`: *typeof* [`AuthHeader`](../variables/RestRouteProcessorType.md#authheader); `options?`: `IAuthHeaderProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`Logging`](../variables/RestRouteProcessorType.md#logging); `options?`: `ILoggingProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`ContextId`](../variables/RestRouteProcessorType.md#contextid); `options`: `IContextIdProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`StaticContextId`](../variables/RestRouteProcessorType.md#staticcontextid); `options`: `IStaticContextIdProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`Tenant`](../variables/RestRouteProcessorType.md#tenant); `options?`: `ITenantProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`SingleTenant`](../variables/RestRouteProcessorType.md#singletenant); `options?`: `ISingleTenantProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`TenantOverride`](../variables/RestRouteProcessorType.md#tenantoverride); `options?`: `ITenantOverrideProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`Metrics`](../variables/RestRouteProcessorType.md#metrics); `options?`: `IMetricsRouteProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`RestRoute`](../variables/RestRouteProcessorType.md#restroute); `options?`: `IRestRouteProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`Tracing`](../variables/RestRouteProcessorType.md#tracing); `options?`: `ITracingRouteProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`Authorization`](../variables/RestRouteProcessorType.md#authorization); `options?`: `IAuthorizationRouteProcessorConstructorOptions`; \}
|
|
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* [`ContextId`](../variables/SocketRouteProcessorType.md#contextid); `options`: `IContextIdProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`StaticContextId`](../variables/SocketRouteProcessorType.md#staticcontextid); `options`: `IStaticContextIdProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`Tenant`](../variables/SocketRouteProcessorType.md#tenant); `options?`: `ITenantProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`SingleTenant`](../variables/SocketRouteProcessorType.md#singletenant); `options?`: `ISingleTenantProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`TenantOverride`](../variables/SocketRouteProcessorType.md#tenantoverride); `options?`: `ITenantOverrideProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`SocketRoute`](../variables/SocketRouteProcessorType.md#socketroute); `options?`: `ISocketRouteProcessorConstructorOptions`; \}
|
|
3
|
+
> **SocketRouteProcessorConfig** = \{ `type`: *typeof* [`AuthHeader`](../variables/SocketRouteProcessorType.md#authheader); `options?`: `IAuthHeaderProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`Logging`](../variables/SocketRouteProcessorType.md#logging); `options?`: `ILoggingProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`ContextId`](../variables/SocketRouteProcessorType.md#contextid); `options`: `IContextIdProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`StaticContextId`](../variables/SocketRouteProcessorType.md#staticcontextid); `options`: `IStaticContextIdProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`Tenant`](../variables/SocketRouteProcessorType.md#tenant); `options?`: `ITenantProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`SingleTenant`](../variables/SocketRouteProcessorType.md#singletenant); `options?`: `ISingleTenantProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`TenantOverride`](../variables/SocketRouteProcessorType.md#tenantoverride); `options?`: `ITenantOverrideProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`SocketRoute`](../variables/SocketRouteProcessorType.md#socketroute); `options?`: `ISocketRouteProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`Authorization`](../variables/SocketRouteProcessorType.md#authorization); `options?`: `IAuthorizationRouteProcessorConstructorOptions`; \}
|
|
4
4
|
|
|
5
5
|
Socket route processor config types.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Variable: WebServerType
|
|
2
|
+
|
|
3
|
+
> `const` **WebServerType**: `object`
|
|
4
|
+
|
|
5
|
+
Web server types.
|
|
6
|
+
|
|
7
|
+
## Type Declaration
|
|
8
|
+
|
|
9
|
+
### Fastify {#fastify}
|
|
10
|
+
|
|
11
|
+
> `readonly` **Fastify**: `"fastify"` = `"fastify"`
|
|
12
|
+
|
|
13
|
+
Fastify.
|
|
14
|
+
|
|
15
|
+
### Hono {#hono}
|
|
16
|
+
|
|
17
|
+
> `readonly` **Hono**: `"hono"` = `"hono"`
|
|
18
|
+
|
|
19
|
+
Hono.
|
|
20
|
+
|
|
21
|
+
### Native {#native}
|
|
22
|
+
|
|
23
|
+
> `readonly` **Native**: `"native"` = `"native"`
|
|
24
|
+
|
|
25
|
+
Native Node.js.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@3sixty/engine-server-types",
|
|
3
|
-
"version": "0.20.0-next.
|
|
3
|
+
"version": "0.20.0-next.2",
|
|
4
4
|
"description": "Server-focused component types and configuration models for API routing and hosting.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -16,18 +16,17 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@3sixty/api-auth-entity-storage-rest-client": "next",
|
|
18
18
|
"@3sixty/api-auth-entity-storage-service": "next",
|
|
19
|
-
"@3sixty/api-
|
|
19
|
+
"@3sixty/api-auth-service": "next",
|
|
20
20
|
"@3sixty/api-models": "next",
|
|
21
21
|
"@3sixty/api-processors": "next",
|
|
22
22
|
"@3sixty/api-rest-client": "next",
|
|
23
|
-
"@3sixty/api-server-fastify": "next",
|
|
24
23
|
"@3sixty/api-service": "next",
|
|
25
24
|
"@3sixty/api-tenant-processor": "next",
|
|
25
|
+
"@3sixty/authorization-service": "next",
|
|
26
26
|
"@3sixty/context": "next",
|
|
27
27
|
"@3sixty/core": "next",
|
|
28
|
-
"@3sixty/engine-models": "0.20.0-next.
|
|
29
|
-
"@3sixty/engine-types": "0.20.0-next.
|
|
30
|
-
"@3sixty/entity": "next",
|
|
28
|
+
"@3sixty/engine-models": "0.20.0-next.2",
|
|
29
|
+
"@3sixty/engine-types": "0.20.0-next.2",
|
|
31
30
|
"@3sixty/nameof": "next",
|
|
32
31
|
"@3sixty/telemetry-processors": "next",
|
|
33
32
|
"@3sixty/tracing-processors": "next"
|