@undefineds.co/xpod 0.1.0-local.202602081751
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/LICENSE +22 -0
- package/README.md +146 -0
- package/components/components.jsonld +72 -0
- package/components/context.jsonld +1635 -0
- package/config/bun.json +90 -0
- package/config/cli.json +260 -0
- package/config/cloud.json +469 -0
- package/config/extensions.local.initializer.json +23 -0
- package/config/local.json +261 -0
- package/config/logging/configurable.json +18 -0
- package/config/main.json +200 -0
- package/config/main.vanilla.json +6 -0
- package/config/resolver.json +347 -0
- package/config/search.json +66 -0
- package/config/seed.dev.json +29 -0
- package/config/seeds/admin.example.json +11 -0
- package/config/seeds/test.json +11 -0
- package/config/terminal.json +22 -0
- package/config/vector.json +35 -0
- package/config/xpod.base.json +155 -0
- package/config/xpod.cluster.json +419 -0
- package/config/xpod.json +233 -0
- package/dist/agents/AgentExecutorFactory.d.ts +67 -0
- package/dist/agents/AgentExecutorFactory.js +193 -0
- package/dist/agents/AgentExecutorFactory.js.map +1 -0
- package/dist/agents/AgentManager.d.ts +114 -0
- package/dist/agents/AgentManager.js +289 -0
- package/dist/agents/AgentManager.js.map +1 -0
- package/dist/agents/BaseAgentExecutor.d.ts +67 -0
- package/dist/agents/BaseAgentExecutor.js +101 -0
- package/dist/agents/BaseAgentExecutor.js.map +1 -0
- package/dist/agents/ClaudeExecutor.d.ts +63 -0
- package/dist/agents/ClaudeExecutor.js +335 -0
- package/dist/agents/ClaudeExecutor.js.map +1 -0
- package/dist/agents/CodeBuddyExecutor.d.ts +54 -0
- package/dist/agents/CodeBuddyExecutor.js +273 -0
- package/dist/agents/CodeBuddyExecutor.js.map +1 -0
- package/dist/agents/IndexAgent.d.ts +70 -0
- package/dist/agents/IndexAgent.js +417 -0
- package/dist/agents/IndexAgent.js.map +1 -0
- package/dist/agents/index.d.ts +22 -0
- package/dist/agents/index.js +48 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/schema/agent-config.d.ts +58 -0
- package/dist/agents/schema/agent-config.js +74 -0
- package/dist/agents/schema/agent-config.js.map +1 -0
- package/dist/agents/schema/tables.d.ts +46 -0
- package/dist/agents/schema/tables.js +64 -0
- package/dist/agents/schema/tables.js.map +1 -0
- package/dist/agents/types.d.ts +266 -0
- package/dist/agents/types.js +9 -0
- package/dist/agents/types.js.map +1 -0
- package/dist/ai/index.d.ts +5 -0
- package/dist/ai/index.js +22 -0
- package/dist/ai/index.js.map +1 -0
- package/dist/ai/schema/config.d.ts +27 -0
- package/dist/ai/schema/config.js +36 -0
- package/dist/ai/schema/config.js.map +1 -0
- package/dist/ai/schema/index.d.ts +8 -0
- package/dist/ai/schema/index.js +27 -0
- package/dist/ai/schema/index.js.map +1 -0
- package/dist/ai/schema/model.d.ts +40 -0
- package/dist/ai/schema/model.js +60 -0
- package/dist/ai/schema/model.js.map +1 -0
- package/dist/ai/schema/provider.d.ts +21 -0
- package/dist/ai/schema/provider.js +30 -0
- package/dist/ai/schema/provider.js.map +1 -0
- package/dist/ai/schema/types.d.ts +52 -0
- package/dist/ai/schema/types.js +62 -0
- package/dist/ai/schema/types.js.map +1 -0
- package/dist/ai/schema/vector-store.d.ts +53 -0
- package/dist/ai/schema/vector-store.js +65 -0
- package/dist/ai/schema/vector-store.js.map +1 -0
- package/dist/ai/service/CredentialReader.d.ts +7 -0
- package/dist/ai/service/CredentialReader.js +10 -0
- package/dist/ai/service/CredentialReader.js.map +1 -0
- package/dist/ai/service/CredentialReaderImpl.d.ts +6 -0
- package/dist/ai/service/CredentialReaderImpl.js +55 -0
- package/dist/ai/service/CredentialReaderImpl.js.map +1 -0
- package/dist/ai/service/EmbeddingService.d.ts +8 -0
- package/dist/ai/service/EmbeddingService.js +10 -0
- package/dist/ai/service/EmbeddingService.js.map +1 -0
- package/dist/ai/service/EmbeddingServiceImpl.d.ts +11 -0
- package/dist/ai/service/EmbeddingServiceImpl.js +73 -0
- package/dist/ai/service/EmbeddingServiceImpl.js.map +1 -0
- package/dist/ai/service/ProviderRegistry.d.ts +26 -0
- package/dist/ai/service/ProviderRegistry.js +10 -0
- package/dist/ai/service/ProviderRegistry.js.map +1 -0
- package/dist/ai/service/ProviderRegistryImpl.d.ts +14 -0
- package/dist/ai/service/ProviderRegistryImpl.js +112 -0
- package/dist/ai/service/ProviderRegistryImpl.js.map +1 -0
- package/dist/ai/service/index.d.ts +10 -0
- package/dist/ai/service/index.js +29 -0
- package/dist/ai/service/index.js.map +1 -0
- package/dist/ai/service/types.d.ts +12 -0
- package/dist/ai/service/types.js +6 -0
- package/dist/ai/service/types.js.map +1 -0
- package/dist/api/ApiServer.d.ts +77 -0
- package/dist/api/ApiServer.js +191 -0
- package/dist/api/ApiServer.js.map +1 -0
- package/dist/api/auth/AuthContext.d.ts +41 -0
- package/dist/api/auth/AuthContext.js +44 -0
- package/dist/api/auth/AuthContext.js.map +1 -0
- package/dist/api/auth/Authenticator.d.ts +23 -0
- package/dist/api/auth/Authenticator.js +3 -0
- package/dist/api/auth/Authenticator.js.map +1 -0
- package/dist/api/auth/ClientCredentialsAuthenticator.d.ts +56 -0
- package/dist/api/auth/ClientCredentialsAuthenticator.js +191 -0
- package/dist/api/auth/ClientCredentialsAuthenticator.js.map +1 -0
- package/dist/api/auth/MultiAuthenticator.d.ts +15 -0
- package/dist/api/auth/MultiAuthenticator.js +36 -0
- package/dist/api/auth/MultiAuthenticator.js.map +1 -0
- package/dist/api/auth/NodeTokenAuthenticator.d.ts +21 -0
- package/dist/api/auth/NodeTokenAuthenticator.js +124 -0
- package/dist/api/auth/NodeTokenAuthenticator.js.map +1 -0
- package/dist/api/auth/SolidTokenAuthenticator.d.ts +27 -0
- package/dist/api/auth/SolidTokenAuthenticator.js +144 -0
- package/dist/api/auth/SolidTokenAuthenticator.js.map +1 -0
- package/dist/api/auth/index.d.ts +5 -0
- package/dist/api/auth/index.js +23 -0
- package/dist/api/auth/index.js.map +1 -0
- package/dist/api/chatkit/ai-provider.d.ts +44 -0
- package/dist/api/chatkit/ai-provider.js +157 -0
- package/dist/api/chatkit/ai-provider.js.map +1 -0
- package/dist/api/chatkit/index.d.ts +11 -0
- package/dist/api/chatkit/index.js +44 -0
- package/dist/api/chatkit/index.js.map +1 -0
- package/dist/api/chatkit/pod-store.d.ts +154 -0
- package/dist/api/chatkit/pod-store.js +794 -0
- package/dist/api/chatkit/pod-store.js.map +1 -0
- package/dist/api/chatkit/schema.d.ts +139 -0
- package/dist/api/chatkit/schema.js +168 -0
- package/dist/api/chatkit/schema.js.map +1 -0
- package/dist/api/chatkit/service.d.ts +143 -0
- package/dist/api/chatkit/service.js +442 -0
- package/dist/api/chatkit/service.js.map +1 -0
- package/dist/api/chatkit/store.d.ts +63 -0
- package/dist/api/chatkit/store.js +178 -0
- package/dist/api/chatkit/store.js.map +1 -0
- package/dist/api/chatkit/types.d.ts +461 -0
- package/dist/api/chatkit/types.js +50 -0
- package/dist/api/chatkit/types.js.map +1 -0
- package/dist/api/container/cloud.d.ts +12 -0
- package/dist/api/container/cloud.js +97 -0
- package/dist/api/container/cloud.js.map +1 -0
- package/dist/api/container/common.d.ts +11 -0
- package/dist/api/container/common.js +82 -0
- package/dist/api/container/common.js.map +1 -0
- package/dist/api/container/index.d.ts +16 -0
- package/dist/api/container/index.js +90 -0
- package/dist/api/container/index.js.map +1 -0
- package/dist/api/container/local.d.ts +13 -0
- package/dist/api/container/local.js +197 -0
- package/dist/api/container/local.js.map +1 -0
- package/dist/api/container/routes.d.ts +11 -0
- package/dist/api/container/routes.js +129 -0
- package/dist/api/container/routes.js.map +1 -0
- package/dist/api/container/types.d.ts +92 -0
- package/dist/api/container/types.js +8 -0
- package/dist/api/container/types.js.map +1 -0
- package/dist/api/handlers/AdminHandler.d.ts +6 -0
- package/dist/api/handlers/AdminHandler.js +330 -0
- package/dist/api/handlers/AdminHandler.js.map +1 -0
- package/dist/api/handlers/ApiKeyHandler.d.ts +15 -0
- package/dist/api/handlers/ApiKeyHandler.js +159 -0
- package/dist/api/handlers/ApiKeyHandler.js.map +1 -0
- package/dist/api/handlers/ChatHandler.d.ts +60 -0
- package/dist/api/handlers/ChatHandler.js +230 -0
- package/dist/api/handlers/ChatHandler.js.map +1 -0
- package/dist/api/handlers/ChatKitHandler.d.ts +18 -0
- package/dist/api/handlers/ChatKitHandler.js +151 -0
- package/dist/api/handlers/ChatKitHandler.js.map +1 -0
- package/dist/api/handlers/DashboardHandler.d.ts +14 -0
- package/dist/api/handlers/DashboardHandler.js +117 -0
- package/dist/api/handlers/DashboardHandler.js.map +1 -0
- package/dist/api/handlers/DdnsHandler.d.ts +19 -0
- package/dist/api/handlers/DdnsHandler.js +306 -0
- package/dist/api/handlers/DdnsHandler.js.map +1 -0
- package/dist/api/handlers/DevHandler.d.ts +18 -0
- package/dist/api/handlers/DevHandler.js +276 -0
- package/dist/api/handlers/DevHandler.js.map +1 -0
- package/dist/api/handlers/NodeHandler.d.ts +16 -0
- package/dist/api/handlers/NodeHandler.js +190 -0
- package/dist/api/handlers/NodeHandler.js.map +1 -0
- package/dist/api/handlers/PodManagementHandler.d.ts +39 -0
- package/dist/api/handlers/PodManagementHandler.js +294 -0
- package/dist/api/handlers/PodManagementHandler.js.map +1 -0
- package/dist/api/handlers/QuotaHandler.d.ts +21 -0
- package/dist/api/handlers/QuotaHandler.js +209 -0
- package/dist/api/handlers/QuotaHandler.js.map +1 -0
- package/dist/api/handlers/SignalHandler.d.ts +13 -0
- package/dist/api/handlers/SignalHandler.js +122 -0
- package/dist/api/handlers/SignalHandler.js.map +1 -0
- package/dist/api/handlers/SubdomainClientHandler.d.ts +24 -0
- package/dist/api/handlers/SubdomainClientHandler.js +169 -0
- package/dist/api/handlers/SubdomainClientHandler.js.map +1 -0
- package/dist/api/handlers/SubdomainHandler.d.ts +17 -0
- package/dist/api/handlers/SubdomainHandler.js +312 -0
- package/dist/api/handlers/SubdomainHandler.js.map +1 -0
- package/dist/api/handlers/VectorHandler.d.ts +15 -0
- package/dist/api/handlers/VectorHandler.js +293 -0
- package/dist/api/handlers/VectorHandler.js.map +1 -0
- package/dist/api/handlers/VectorStoreHandler.d.ts +20 -0
- package/dist/api/handlers/VectorStoreHandler.js +348 -0
- package/dist/api/handlers/VectorStoreHandler.js.map +1 -0
- package/dist/api/handlers/VectorStoreWebhookHandler.d.ts +74 -0
- package/dist/api/handlers/VectorStoreWebhookHandler.js +121 -0
- package/dist/api/handlers/VectorStoreWebhookHandler.js.map +1 -0
- package/dist/api/handlers/WebIdProfileHandler.d.ts +14 -0
- package/dist/api/handlers/WebIdProfileHandler.js +204 -0
- package/dist/api/handlers/WebIdProfileHandler.js.map +1 -0
- package/dist/api/handlers/index.d.ts +11 -0
- package/dist/api/handlers/index.js +28 -0
- package/dist/api/handlers/index.js.map +1 -0
- package/dist/api/index.d.ts +12 -0
- package/dist/api/index.js +29 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/main.d.ts +14 -0
- package/dist/api/main.js +106 -0
- package/dist/api/main.js.map +1 -0
- package/dist/api/middleware/AuthMiddleware.d.ts +35 -0
- package/dist/api/middleware/AuthMiddleware.js +51 -0
- package/dist/api/middleware/AuthMiddleware.js.map +1 -0
- package/dist/api/middleware/index.d.ts +1 -0
- package/dist/api/middleware/index.js +18 -0
- package/dist/api/middleware/index.js.map +1 -0
- package/dist/api/models/model-provider.schema.d.ts +12 -0
- package/dist/api/models/model-provider.schema.js +21 -0
- package/dist/api/models/model-provider.schema.js.map +1 -0
- package/dist/api/models/namespaces.d.ts +9 -0
- package/dist/api/models/namespaces.js +34 -0
- package/dist/api/models/namespaces.js.map +1 -0
- package/dist/api/service/InternalPodService.d.ts +19 -0
- package/dist/api/service/InternalPodService.js +82 -0
- package/dist/api/service/InternalPodService.js.map +1 -0
- package/dist/api/service/VectorService.d.ts +156 -0
- package/dist/api/service/VectorService.js +202 -0
- package/dist/api/service/VectorService.js.map +1 -0
- package/dist/api/service/VectorStoreService.d.ts +262 -0
- package/dist/api/service/VectorStoreService.js +985 -0
- package/dist/api/service/VectorStoreService.js.map +1 -0
- package/dist/api/service/VercelChatService.d.ts +28 -0
- package/dist/api/service/VercelChatService.js +289 -0
- package/dist/api/service/VercelChatService.js.map +1 -0
- package/dist/api/store/DrizzleClientCredentialsStore.d.ts +56 -0
- package/dist/api/store/DrizzleClientCredentialsStore.js +145 -0
- package/dist/api/store/DrizzleClientCredentialsStore.js.map +1 -0
- package/dist/api/store/index.d.ts +1 -0
- package/dist/api/store/index.js +18 -0
- package/dist/api/store/index.js.map +1 -0
- package/dist/components/components.jsonld +88 -0
- package/dist/components/context.jsonld +1962 -0
- package/dist/credential/index.d.ts +1 -0
- package/dist/credential/index.js +18 -0
- package/dist/credential/index.js.map +1 -0
- package/dist/credential/schema/index.d.ts +2 -0
- package/dist/credential/schema/index.js +19 -0
- package/dist/credential/schema/index.js.map +1 -0
- package/dist/credential/schema/tables.d.ts +31 -0
- package/dist/credential/schema/tables.js +42 -0
- package/dist/credential/schema/tables.js.map +1 -0
- package/dist/credential/schema/types.d.ts +20 -0
- package/dist/credential/schema/types.js +26 -0
- package/dist/credential/schema/types.js.map +1 -0
- package/dist/dns/DnsProvider.d.ts +46 -0
- package/dist/dns/DnsProvider.js +3 -0
- package/dist/dns/DnsProvider.js.map +1 -0
- package/dist/dns/DnsProvider.jsonld +161 -0
- package/dist/dns/cloudflare/CloudflareDnsProvider.d.ts +51 -0
- package/dist/dns/cloudflare/CloudflareDnsProvider.js +227 -0
- package/dist/dns/cloudflare/CloudflareDnsProvider.js.map +1 -0
- package/dist/dns/cloudflare/index.d.ts +1 -0
- package/dist/dns/cloudflare/index.js +18 -0
- package/dist/dns/cloudflare/index.js.map +1 -0
- package/dist/dns/tencent/TencentDnsProvider.d.ts +42 -0
- package/dist/dns/tencent/TencentDnsProvider.js +221 -0
- package/dist/dns/tencent/TencentDnsProvider.js.map +1 -0
- package/dist/dns/tencent/TencentDnsProvider.jsonld +239 -0
- package/dist/document/Chunker.d.ts +64 -0
- package/dist/document/Chunker.js +8 -0
- package/dist/document/Chunker.js.map +1 -0
- package/dist/document/DocumentParser.d.ts +58 -0
- package/dist/document/DocumentParser.js +8 -0
- package/dist/document/DocumentParser.js.map +1 -0
- package/dist/document/HeadingChunker.d.ts +34 -0
- package/dist/document/HeadingChunker.js +182 -0
- package/dist/document/HeadingChunker.js.map +1 -0
- package/dist/document/JinaDocumentParser.d.ts +40 -0
- package/dist/document/JinaDocumentParser.js +129 -0
- package/dist/document/JinaDocumentParser.js.map +1 -0
- package/dist/document/index.d.ts +7 -0
- package/dist/document/index.js +26 -0
- package/dist/document/index.js.map +1 -0
- package/dist/edge/DdnsManager.d.ts +53 -0
- package/dist/edge/DdnsManager.js +153 -0
- package/dist/edge/DdnsManager.js.map +1 -0
- package/dist/edge/Dns01CertificateProvisioner.d.ts +27 -0
- package/dist/edge/Dns01CertificateProvisioner.js +160 -0
- package/dist/edge/Dns01CertificateProvisioner.js.map +1 -0
- package/dist/edge/Dns01CertificateProvisioner.jsonld +148 -0
- package/dist/edge/EdgeNodeAgent.d.ts +56 -0
- package/dist/edge/EdgeNodeAgent.js +230 -0
- package/dist/edge/EdgeNodeAgent.js.map +1 -0
- package/dist/edge/EdgeNodeAgent.jsonld +89 -0
- package/dist/edge/EdgeNodeAgentInitializer.d.ts +25 -0
- package/dist/edge/EdgeNodeAgentInitializer.js +64 -0
- package/dist/edge/EdgeNodeAgentInitializer.js.map +1 -0
- package/dist/edge/EdgeNodeCapabilityDetector.d.ts +98 -0
- package/dist/edge/EdgeNodeCapabilityDetector.js +425 -0
- package/dist/edge/EdgeNodeCapabilityDetector.js.map +1 -0
- package/dist/edge/EdgeNodeCertificateProvisioner.d.ts +3 -0
- package/dist/edge/EdgeNodeCertificateProvisioner.js +3 -0
- package/dist/edge/EdgeNodeCertificateProvisioner.js.map +1 -0
- package/dist/edge/EdgeNodeCertificateProvisioner.jsonld +21 -0
- package/dist/edge/EdgeNodeDnsCoordinator.d.ts +38 -0
- package/dist/edge/EdgeNodeDnsCoordinator.js +201 -0
- package/dist/edge/EdgeNodeDnsCoordinator.js.map +1 -0
- package/dist/edge/EdgeNodeDnsCoordinator.jsonld +212 -0
- package/dist/edge/EdgeNodeHealthProbeService.d.ts +25 -0
- package/dist/edge/EdgeNodeHealthProbeService.js +208 -0
- package/dist/edge/EdgeNodeHealthProbeService.js.map +1 -0
- package/dist/edge/EdgeNodeHealthProbeService.jsonld +176 -0
- package/dist/edge/EdgeNodeModeDetector.d.ts +50 -0
- package/dist/edge/EdgeNodeModeDetector.js +194 -0
- package/dist/edge/EdgeNodeModeDetector.js.map +1 -0
- package/dist/edge/EdgeNodeModeDetector.jsonld +114 -0
- package/dist/edge/EdgeNodeTunnelManager.d.ts +23 -0
- package/dist/edge/EdgeNodeTunnelManager.js +99 -0
- package/dist/edge/EdgeNodeTunnelManager.js.map +1 -0
- package/dist/edge/EdgeNodeTunnelManager.jsonld +128 -0
- package/dist/edge/FrpTunnelManager.d.ts +30 -0
- package/dist/edge/FrpTunnelManager.js +151 -0
- package/dist/edge/FrpTunnelManager.js.map +1 -0
- package/dist/edge/FrpTunnelManager.jsonld +192 -0
- package/dist/edge/LocalNetworkManager.d.ts +41 -0
- package/dist/edge/LocalNetworkManager.js +115 -0
- package/dist/edge/LocalNetworkManager.js.map +1 -0
- package/dist/edge/acme/AcmeCertificateManager.d.ts +65 -0
- package/dist/edge/acme/AcmeCertificateManager.js +233 -0
- package/dist/edge/acme/AcmeCertificateManager.js.map +1 -0
- package/dist/edge/acme/AcmeCertificateManager.jsonld +373 -0
- package/dist/edge/acme/ClusterCertificateManager.d.ts +40 -0
- package/dist/edge/acme/ClusterCertificateManager.js +184 -0
- package/dist/edge/acme/ClusterCertificateManager.js.map +1 -0
- package/dist/edge/acme/DnsChallengeClient.d.ts +15 -0
- package/dist/edge/acme/DnsChallengeClient.js +40 -0
- package/dist/edge/acme/DnsChallengeClient.js.map +1 -0
- package/dist/edge/acme/utils.d.ts +4 -0
- package/dist/edge/acme/utils.js +17 -0
- package/dist/edge/acme/utils.js.map +1 -0
- package/dist/edge/frp/FrpRelay.d.ts +11 -0
- package/dist/edge/frp/FrpRelay.js +29 -0
- package/dist/edge/frp/FrpRelay.js.map +1 -0
- package/dist/edge/frp/FrpcProcessManager.d.ts +51 -0
- package/dist/edge/frp/FrpcProcessManager.js +174 -0
- package/dist/edge/frp/FrpcProcessManager.js.map +1 -0
- package/dist/edge/interfaces/EdgeNodeTunnelManager.d.ts +6 -0
- package/dist/edge/interfaces/EdgeNodeTunnelManager.js +3 -0
- package/dist/edge/interfaces/EdgeNodeTunnelManager.js.map +1 -0
- package/dist/edge/interfaces/EdgeNodeTunnelManager.jsonld +21 -0
- package/dist/embedding/CredentialReader.d.ts +7 -0
- package/dist/embedding/CredentialReader.js +10 -0
- package/dist/embedding/CredentialReader.js.map +1 -0
- package/dist/embedding/CredentialReader.jsonld +22 -0
- package/dist/embedding/CredentialReaderImpl.d.ts +6 -0
- package/dist/embedding/CredentialReaderImpl.js +55 -0
- package/dist/embedding/CredentialReaderImpl.js.map +1 -0
- package/dist/embedding/CredentialReaderImpl.jsonld +31 -0
- package/dist/embedding/EmbeddingService.d.ts +8 -0
- package/dist/embedding/EmbeddingService.js +10 -0
- package/dist/embedding/EmbeddingService.js.map +1 -0
- package/dist/embedding/EmbeddingService.jsonld +26 -0
- package/dist/embedding/EmbeddingServiceImpl.d.ts +11 -0
- package/dist/embedding/EmbeddingServiceImpl.js +73 -0
- package/dist/embedding/EmbeddingServiceImpl.js.map +1 -0
- package/dist/embedding/EmbeddingServiceImpl.jsonld +53 -0
- package/dist/embedding/ProviderRegistry.d.ts +26 -0
- package/dist/embedding/ProviderRegistry.js +10 -0
- package/dist/embedding/ProviderRegistry.js.map +1 -0
- package/dist/embedding/ProviderRegistry.jsonld +30 -0
- package/dist/embedding/ProviderRegistryImpl.d.ts +14 -0
- package/dist/embedding/ProviderRegistryImpl.js +112 -0
- package/dist/embedding/ProviderRegistryImpl.js.map +1 -0
- package/dist/embedding/ProviderRegistryImpl.jsonld +40 -0
- package/dist/embedding/index.d.ts +5 -0
- package/dist/embedding/index.js +22 -0
- package/dist/embedding/index.js.map +1 -0
- package/dist/embedding/schema/index.d.ts +1 -0
- package/dist/embedding/schema/index.js +18 -0
- package/dist/embedding/schema/index.js.map +1 -0
- package/dist/embedding/schema/tables.d.ts +70 -0
- package/dist/embedding/schema/tables.js +102 -0
- package/dist/embedding/schema/tables.js.map +1 -0
- package/dist/embedding/types.d.ts +12 -0
- package/dist/embedding/types.js +6 -0
- package/dist/embedding/types.js.map +1 -0
- package/dist/gateway/port-finder.d.ts +4 -0
- package/dist/gateway/port-finder.js +15 -0
- package/dist/gateway/port-finder.js.map +1 -0
- package/dist/gateway/proxy.d.ts +22 -0
- package/dist/gateway/proxy.js +149 -0
- package/dist/gateway/proxy.js.map +1 -0
- package/dist/gateway/supervisor.d.ts +2 -0
- package/dist/gateway/supervisor.js +7 -0
- package/dist/gateway/supervisor.js.map +1 -0
- package/dist/gateway/types.d.ts +1 -0
- package/dist/gateway/types.js +3 -0
- package/dist/gateway/types.js.map +1 -0
- package/dist/http/AppStaticAssetHandler.d.ts +8 -0
- package/dist/http/AppStaticAssetHandler.js +27 -0
- package/dist/http/AppStaticAssetHandler.js.map +1 -0
- package/dist/http/AppStaticAssetHandler.jsonld +26 -0
- package/dist/http/ClusterIngressRouter.d.ts +93 -0
- package/dist/http/ClusterIngressRouter.js +355 -0
- package/dist/http/ClusterIngressRouter.js.map +1 -0
- package/dist/http/ClusterIngressRouter.jsonld +227 -0
- package/dist/http/ClusterWebSocketConfigurator.d.ts +59 -0
- package/dist/http/ClusterWebSocketConfigurator.js +226 -0
- package/dist/http/ClusterWebSocketConfigurator.js.map +1 -0
- package/dist/http/ClusterWebSocketConfigurator.jsonld +145 -0
- package/dist/http/EdgeNodeDirectDebugHttpHandler.d.ts +25 -0
- package/dist/http/EdgeNodeDirectDebugHttpHandler.js +126 -0
- package/dist/http/EdgeNodeDirectDebugHttpHandler.js.map +1 -0
- package/dist/http/EdgeNodeDirectDebugHttpHandler.jsonld +151 -0
- package/dist/http/EdgeNodeProxyHttpHandler.d.ts +28 -0
- package/dist/http/EdgeNodeProxyHttpHandler.js +190 -0
- package/dist/http/EdgeNodeProxyHttpHandler.js.map +1 -0
- package/dist/http/EdgeNodeProxyHttpHandler.jsonld +162 -0
- package/dist/http/PodRoutingHttpHandler.d.ts +64 -0
- package/dist/http/PodRoutingHttpHandler.js +233 -0
- package/dist/http/PodRoutingHttpHandler.js.map +1 -0
- package/dist/http/PodRoutingHttpHandler.jsonld +171 -0
- package/dist/http/RequestIdHttpHandler.d.ts +15 -0
- package/dist/http/RequestIdHttpHandler.js +59 -0
- package/dist/http/RequestIdHttpHandler.js.map +1 -0
- package/dist/http/RouterHttpHandler.d.ts +21 -0
- package/dist/http/RouterHttpHandler.js +49 -0
- package/dist/http/RouterHttpHandler.js.map +1 -0
- package/dist/http/RouterHttpHandler.jsonld +80 -0
- package/dist/http/RouterHttpRoute.d.ts +6 -0
- package/dist/http/RouterHttpRoute.js +11 -0
- package/dist/http/RouterHttpRoute.js.map +1 -0
- package/dist/http/RouterHttpRoute.jsonld +48 -0
- package/dist/http/SignalInterceptHttpHandler.d.ts +24 -0
- package/dist/http/SignalInterceptHttpHandler.js +47 -0
- package/dist/http/SignalInterceptHttpHandler.js.map +1 -0
- package/dist/http/SignalInterceptHttpHandler.jsonld +103 -0
- package/dist/http/SubgraphSparqlHttpHandler.d.ts +70 -0
- package/dist/http/SubgraphSparqlHttpHandler.js +640 -0
- package/dist/http/SubgraphSparqlHttpHandler.js.map +1 -0
- package/dist/http/SubgraphSparqlHttpHandler.jsonld +363 -0
- package/dist/http/TracingHandler.d.ts +19 -0
- package/dist/http/TracingHandler.js +60 -0
- package/dist/http/TracingHandler.js.map +1 -0
- package/dist/http/TracingHandler.jsonld +37 -0
- package/dist/http/admin/EdgeNodeAdminHttpHandler.d.ts +45 -0
- package/dist/http/admin/EdgeNodeAdminHttpHandler.js +292 -0
- package/dist/http/admin/EdgeNodeAdminHttpHandler.js.map +1 -0
- package/dist/http/admin/EdgeNodeCertificateHttpHandler.d.ts +33 -0
- package/dist/http/admin/EdgeNodeCertificateHttpHandler.js +172 -0
- package/dist/http/admin/EdgeNodeCertificateHttpHandler.js.map +1 -0
- package/dist/http/admin/EdgeNodeCertificateHttpHandler.jsonld +182 -0
- package/dist/http/admin/EdgeNodeSignalHttpHandler.d.ts +71 -0
- package/dist/http/admin/EdgeNodeSignalHttpHandler.js +674 -0
- package/dist/http/admin/EdgeNodeSignalHttpHandler.js.map +1 -0
- package/dist/http/admin/EdgeNodeSignalHttpHandler.jsonld +406 -0
- package/dist/http/cluster/PodMigrationHttpHandler.d.ts +52 -0
- package/dist/http/cluster/PodMigrationHttpHandler.js +208 -0
- package/dist/http/cluster/PodMigrationHttpHandler.js.map +1 -0
- package/dist/http/cluster/PodMigrationHttpHandler.jsonld +169 -0
- package/dist/http/quota/QuotaAdminHttpHandler.d.ts +34 -0
- package/dist/http/quota/QuotaAdminHttpHandler.js +241 -0
- package/dist/http/quota/QuotaAdminHttpHandler.js.map +1 -0
- package/dist/http/quota/QuotaAdminHttpHandler.jsonld +171 -0
- package/dist/http/search/SearchHttpHandler.d.ts +59 -0
- package/dist/http/search/SearchHttpHandler.js +312 -0
- package/dist/http/search/SearchHttpHandler.js.map +1 -0
- package/dist/http/search/index.d.ts +1 -0
- package/dist/http/search/index.js +18 -0
- package/dist/http/search/index.js.map +1 -0
- package/dist/http/terminal/TerminalHttpHandler.d.ts +45 -0
- package/dist/http/terminal/TerminalHttpHandler.js +306 -0
- package/dist/http/terminal/TerminalHttpHandler.js.map +1 -0
- package/dist/http/terminal/TerminalHttpHandler.jsonld +232 -0
- package/dist/http/terminal/index.d.ts +1 -0
- package/dist/http/terminal/index.js +18 -0
- package/dist/http/terminal/index.js.map +1 -0
- package/dist/http/vector/VectorHttpHandler.d.ts +42 -0
- package/dist/http/vector/VectorHttpHandler.js +301 -0
- package/dist/http/vector/VectorHttpHandler.js.map +1 -0
- package/dist/http/vector/VectorHttpHandler.jsonld +157 -0
- package/dist/http/vector/index.d.ts +1 -0
- package/dist/http/vector/index.js +18 -0
- package/dist/http/vector/index.js.map +1 -0
- package/dist/ice/IceServerProvider.d.ts +85 -0
- package/dist/ice/IceServerProvider.js +122 -0
- package/dist/ice/IceServerProvider.js.map +1 -0
- package/dist/ice/index.d.ts +8 -0
- package/dist/ice/index.js +25 -0
- package/dist/ice/index.js.map +1 -0
- package/dist/identity/CenterNodeRegistrationService.d.ts +102 -0
- package/dist/identity/CenterNodeRegistrationService.js +266 -0
- package/dist/identity/CenterNodeRegistrationService.js.map +1 -0
- package/dist/identity/CenterNodeRegistrationService.jsonld +251 -0
- package/dist/identity/ReactAppViewHandler.d.ts +31 -0
- package/dist/identity/ReactAppViewHandler.js +79 -0
- package/dist/identity/ReactAppViewHandler.js.map +1 -0
- package/dist/identity/ReactAppViewHandler.jsonld +99 -0
- package/dist/identity/drizzle/AccountRepository.d.ts +31 -0
- package/dist/identity/drizzle/AccountRepository.js +130 -0
- package/dist/identity/drizzle/AccountRepository.js.map +1 -0
- package/dist/identity/drizzle/AccountRoleRepository.d.ts +23 -0
- package/dist/identity/drizzle/AccountRoleRepository.js +233 -0
- package/dist/identity/drizzle/AccountRoleRepository.js.map +1 -0
- package/dist/identity/drizzle/DdnsRepository.d.ts +87 -0
- package/dist/identity/drizzle/DdnsRepository.js +284 -0
- package/dist/identity/drizzle/DdnsRepository.js.map +1 -0
- package/dist/identity/drizzle/DrizzleIndexedStorage.d.ts +26 -0
- package/dist/identity/drizzle/DrizzleIndexedStorage.js +159 -0
- package/dist/identity/drizzle/DrizzleIndexedStorage.js.map +1 -0
- package/dist/identity/drizzle/DrizzleIndexedStorage.jsonld +130 -0
- package/dist/identity/drizzle/EdgeNodeRepository.d.ts +155 -0
- package/dist/identity/drizzle/EdgeNodeRepository.js +555 -0
- package/dist/identity/drizzle/EdgeNodeRepository.js.map +1 -0
- package/dist/identity/drizzle/PodLookupRepository.d.ts +59 -0
- package/dist/identity/drizzle/PodLookupRepository.js +153 -0
- package/dist/identity/drizzle/PodLookupRepository.js.map +1 -0
- package/dist/identity/drizzle/WebIdProfileRepository.d.ts +58 -0
- package/dist/identity/drizzle/WebIdProfileRepository.js +157 -0
- package/dist/identity/drizzle/WebIdProfileRepository.js.map +1 -0
- package/dist/identity/drizzle/db.d.ts +60 -0
- package/dist/identity/drizzle/db.js +269 -0
- package/dist/identity/drizzle/db.js.map +1 -0
- package/dist/identity/drizzle/schema.d.ts +1 -0
- package/dist/identity/drizzle/schema.js +20 -0
- package/dist/identity/drizzle/schema.js.map +1 -0
- package/dist/identity/drizzle/schema.pg.d.ts +20 -0
- package/dist/identity/drizzle/schema.pg.js +103 -0
- package/dist/identity/drizzle/schema.pg.js.map +1 -0
- package/dist/identity/drizzle/schema.sqlite.d.ts +872 -0
- package/dist/identity/drizzle/schema.sqlite.js +100 -0
- package/dist/identity/drizzle/schema.sqlite.js.map +1 -0
- package/dist/identity/oidc/AutoDetectIdentityProviderHandler.d.ts +43 -0
- package/dist/identity/oidc/AutoDetectIdentityProviderHandler.js +92 -0
- package/dist/identity/oidc/AutoDetectIdentityProviderHandler.js.map +1 -0
- package/dist/identity/oidc/AutoDetectIdentityProviderHandler.jsonld +122 -0
- package/dist/identity/oidc/AutoDetectOidcHandler.d.ts +55 -0
- package/dist/identity/oidc/AutoDetectOidcHandler.js +137 -0
- package/dist/identity/oidc/AutoDetectOidcHandler.js.map +1 -0
- package/dist/identity/oidc/AutoDetectOidcHandler.jsonld +138 -0
- package/dist/identity/oidc/DisabledIdentityProviderHandler.d.ts +51 -0
- package/dist/identity/oidc/DisabledIdentityProviderHandler.js +104 -0
- package/dist/identity/oidc/DisabledIdentityProviderHandler.js.map +1 -0
- package/dist/identity/oidc/DisabledIdentityProviderHandler.jsonld +111 -0
- package/dist/identity/oidc/DisabledOidcHandler.d.ts +55 -0
- package/dist/identity/oidc/DisabledOidcHandler.js +132 -0
- package/dist/identity/oidc/DisabledOidcHandler.js.map +1 -0
- package/dist/identity/oidc/DisabledOidcHandler.jsonld +157 -0
- package/dist/index.d.ts +80 -0
- package/dist/index.js +155 -0
- package/dist/index.js.map +1 -0
- package/dist/legacy/DrizzleClientCredentialsStore.d.ts +51 -0
- package/dist/legacy/DrizzleClientCredentialsStore.js +142 -0
- package/dist/legacy/DrizzleClientCredentialsStore.js.map +1 -0
- package/dist/legacy/DrizzleIndexedStorage.d.ts +26 -0
- package/dist/legacy/DrizzleIndexedStorage.js +159 -0
- package/dist/legacy/DrizzleIndexedStorage.js.map +1 -0
- package/dist/legacy/DrizzleQuotaService.d.ts +16 -0
- package/dist/legacy/DrizzleQuotaService.js +37 -0
- package/dist/legacy/DrizzleQuotaService.js.map +1 -0
- package/dist/libs/backends/index.d.ts +6 -0
- package/dist/libs/backends/index.js +31 -0
- package/dist/libs/backends/index.js.map +1 -0
- package/dist/libs/backends/sqlup.d.ts +44 -0
- package/dist/libs/backends/sqlup.js +437 -0
- package/dist/libs/backends/sqlup.js.map +1 -0
- package/dist/logging/ConfigurableLoggerFactory.d.ts +24 -0
- package/dist/logging/ConfigurableLoggerFactory.js +77 -0
- package/dist/logging/ConfigurableLoggerFactory.js.map +1 -0
- package/dist/logging/ConfigurableLoggerFactory.jsonld +169 -0
- package/dist/logging/LogContext.d.ts +5 -0
- package/dist/logging/LogContext.js +6 -0
- package/dist/logging/LogContext.js.map +1 -0
- package/dist/main.d.ts +2 -0
- package/dist/main.js +148 -0
- package/dist/main.js.map +1 -0
- package/dist/network/LocalNetworkDetector.d.ts +65 -0
- package/dist/network/LocalNetworkDetector.js +185 -0
- package/dist/network/LocalNetworkDetector.js.map +1 -0
- package/dist/network/index.d.ts +4 -0
- package/dist/network/index.js +21 -0
- package/dist/network/index.js.map +1 -0
- package/dist/pods/ReservedSuffixIdentifierGenerator.d.ts +13 -0
- package/dist/pods/ReservedSuffixIdentifierGenerator.js +26 -0
- package/dist/pods/ReservedSuffixIdentifierGenerator.js.map +1 -0
- package/dist/pods/ReservedSuffixIdentifierGenerator.jsonld +75 -0
- package/dist/quota/DefaultQuotaService.d.ts +16 -0
- package/dist/quota/DefaultQuotaService.js +37 -0
- package/dist/quota/DefaultQuotaService.js.map +1 -0
- package/dist/quota/DefaultQuotaService.jsonld +85 -0
- package/dist/quota/DrizzleQuotaService.d.ts +16 -0
- package/dist/quota/DrizzleQuotaService.js +37 -0
- package/dist/quota/DrizzleQuotaService.js.map +1 -0
- package/dist/quota/DrizzleQuotaService.jsonld +87 -0
- package/dist/quota/NoopQuotaService.d.ts +7 -0
- package/dist/quota/NoopQuotaService.js +15 -0
- package/dist/quota/NoopQuotaService.js.map +1 -0
- package/dist/quota/NoopQuotaService.jsonld +36 -0
- package/dist/quota/QuotaService.d.ts +6 -0
- package/dist/quota/QuotaService.js +3 -0
- package/dist/quota/QuotaService.js.map +1 -0
- package/dist/quota/QuotaService.jsonld +33 -0
- package/dist/sdk/SignalingClientAdapter.d.ts +38 -0
- package/dist/sdk/SignalingClientAdapter.js +99 -0
- package/dist/sdk/SignalingClientAdapter.js.map +1 -0
- package/dist/sdk/createFetch.d.ts +23 -0
- package/dist/sdk/createFetch.js +258 -0
- package/dist/sdk/createFetch.js.map +1 -0
- package/dist/sdk/index.d.ts +29 -0
- package/dist/sdk/index.js +34 -0
- package/dist/sdk/index.js.map +1 -0
- package/dist/sdk/xpodFetch.d.ts +112 -0
- package/dist/sdk/xpodFetch.js +251 -0
- package/dist/sdk/xpodFetch.js.map +1 -0
- package/dist/service/EdgeNodeCertificateService.d.ts +45 -0
- package/dist/service/EdgeNodeCertificateService.js +164 -0
- package/dist/service/EdgeNodeCertificateService.js.map +1 -0
- package/dist/service/EdgeNodeCertificateService.jsonld +216 -0
- package/dist/service/EdgeNodeHeartbeatService.d.ts +68 -0
- package/dist/service/EdgeNodeHeartbeatService.js +262 -0
- package/dist/service/EdgeNodeHeartbeatService.js.map +1 -0
- package/dist/service/PodMigrationService.d.ts +43 -0
- package/dist/service/PodMigrationService.js +72 -0
- package/dist/service/PodMigrationService.js.map +1 -0
- package/dist/service/PodMigrationService.jsonld +76 -0
- package/dist/signaling/SignalingClient.d.ts +142 -0
- package/dist/signaling/SignalingClient.js +305 -0
- package/dist/signaling/SignalingClient.js.map +1 -0
- package/dist/signaling/SignalingService.d.ts +104 -0
- package/dist/signaling/SignalingService.js +440 -0
- package/dist/signaling/SignalingService.js.map +1 -0
- package/dist/signaling/index.d.ts +11 -0
- package/dist/signaling/index.js +28 -0
- package/dist/signaling/index.js.map +1 -0
- package/dist/signaling/types.d.ts +237 -0
- package/dist/signaling/types.js +18 -0
- package/dist/signaling/types.js.map +1 -0
- package/dist/storage/DrizzleCompat.d.ts +15 -0
- package/dist/storage/DrizzleCompat.js +60 -0
- package/dist/storage/DrizzleCompat.js.map +1 -0
- package/dist/storage/LockingResourceStore.d.ts +8 -0
- package/dist/storage/LockingResourceStore.js +68 -0
- package/dist/storage/LockingResourceStore.js.map +1 -0
- package/dist/storage/MigratableDataAccessor.d.ts +63 -0
- package/dist/storage/MigratableDataAccessor.js +11 -0
- package/dist/storage/MigratableDataAccessor.js.map +1 -0
- package/dist/storage/MigratableDataAccessor.jsonld +60 -0
- package/dist/storage/ObservableResourceStore.d.ts +89 -0
- package/dist/storage/ObservableResourceStore.js +125 -0
- package/dist/storage/ObservableResourceStore.js.map +1 -0
- package/dist/storage/RepresentationPartialConvertingStore.d.ts +22 -0
- package/dist/storage/RepresentationPartialConvertingStore.js +94 -0
- package/dist/storage/RepresentationPartialConvertingStore.js.map +1 -0
- package/dist/storage/RepresentationPartialConvertingStore.jsonld +332 -0
- package/dist/storage/SparqlUpdateResourceStore.d.ts +30 -0
- package/dist/storage/SparqlUpdateResourceStore.js +292 -0
- package/dist/storage/SparqlUpdateResourceStore.js.map +1 -0
- package/dist/storage/SparqlUpdateResourceStore.jsonld +112 -0
- package/dist/storage/SqliteCompat.d.ts +60 -0
- package/dist/storage/SqliteCompat.js +158 -0
- package/dist/storage/SqliteCompat.js.map +1 -0
- package/dist/storage/accessors/MinioDataAccessor.d.ts +127 -0
- package/dist/storage/accessors/MinioDataAccessor.js +249 -0
- package/dist/storage/accessors/MinioDataAccessor.js.map +1 -0
- package/dist/storage/accessors/MinioDataAccessor.jsonld +138 -0
- package/dist/storage/accessors/MixDataAccessor.d.ts +43 -0
- package/dist/storage/accessors/MixDataAccessor.js +130 -0
- package/dist/storage/accessors/MixDataAccessor.js.map +1 -0
- package/dist/storage/accessors/MixDataAccessor.jsonld +101 -0
- package/dist/storage/accessors/QuadstoreSparqlDataAccessor.d.ts +146 -0
- package/dist/storage/accessors/QuadstoreSparqlDataAccessor.js +415 -0
- package/dist/storage/accessors/QuadstoreSparqlDataAccessor.js.map +1 -0
- package/dist/storage/accessors/QuadstoreSparqlDataAccessor.jsonld +180 -0
- package/dist/storage/accessors/QuintStoreSparqlDataAccessor.d.ts +95 -0
- package/dist/storage/accessors/QuintStoreSparqlDataAccessor.js +376 -0
- package/dist/storage/accessors/QuintStoreSparqlDataAccessor.js.map +1 -0
- package/dist/storage/accessors/QuintStoreSparqlDataAccessor.jsonld +168 -0
- package/dist/storage/accessors/TieredMinioDataAccessor.d.ts +150 -0
- package/dist/storage/accessors/TieredMinioDataAccessor.js +582 -0
- package/dist/storage/accessors/TieredMinioDataAccessor.js.map +1 -0
- package/dist/storage/accessors/TieredMinioDataAccessor.jsonld +333 -0
- package/dist/storage/database/PostgresPoolManager.d.ts +56 -0
- package/dist/storage/database/PostgresPoolManager.js +117 -0
- package/dist/storage/database/PostgresPoolManager.js.map +1 -0
- package/dist/storage/keyvalue/PostgresKeyValueStorage.d.ts +34 -0
- package/dist/storage/keyvalue/PostgresKeyValueStorage.js +146 -0
- package/dist/storage/keyvalue/PostgresKeyValueStorage.js.map +1 -0
- package/dist/storage/keyvalue/PostgresKeyValueStorage.jsonld +192 -0
- package/dist/storage/keyvalue/RedisKeyValueStorage.d.ts +30 -0
- package/dist/storage/keyvalue/RedisKeyValueStorage.js +133 -0
- package/dist/storage/keyvalue/RedisKeyValueStorage.js.map +1 -0
- package/dist/storage/keyvalue/RedisKeyValueStorage.jsonld +237 -0
- package/dist/storage/keyvalue/SqliteKeyValueStorage.d.ts +30 -0
- package/dist/storage/keyvalue/SqliteKeyValueStorage.js +164 -0
- package/dist/storage/keyvalue/SqliteKeyValueStorage.js.map +1 -0
- package/dist/storage/keyvalue/SqliteKeyValueStorage.jsonld +167 -0
- package/dist/storage/quint/BaseQuintStore.d.ts +80 -0
- package/dist/storage/quint/BaseQuintStore.js +535 -0
- package/dist/storage/quint/BaseQuintStore.js.map +1 -0
- package/dist/storage/quint/BaseQuintStore.jsonld +175 -0
- package/dist/storage/quint/PgQuintStore.d.ts +61 -0
- package/dist/storage/quint/PgQuintStore.drizzle.d.ts +45 -0
- package/dist/storage/quint/PgQuintStore.drizzle.js +327 -0
- package/dist/storage/quint/PgQuintStore.drizzle.js.map +1 -0
- package/dist/storage/quint/PgQuintStore.js +275 -0
- package/dist/storage/quint/PgQuintStore.js.map +1 -0
- package/dist/storage/quint/PgQuintStore.jsonld +258 -0
- package/dist/storage/quint/SqliteQuintStore.d.ts +55 -0
- package/dist/storage/quint/SqliteQuintStore.js +630 -0
- package/dist/storage/quint/SqliteQuintStore.js.map +1 -0
- package/dist/storage/quint/SqliteQuintStore.jsonld +157 -0
- package/dist/storage/quint/index.d.ts +11 -0
- package/dist/storage/quint/index.js +30 -0
- package/dist/storage/quint/index.js.map +1 -0
- package/dist/storage/quint/schema.d.ts +82 -0
- package/dist/storage/quint/schema.js +33 -0
- package/dist/storage/quint/schema.js.map +1 -0
- package/dist/storage/quint/serialization.d.ts +56 -0
- package/dist/storage/quint/serialization.js +198 -0
- package/dist/storage/quint/serialization.js.map +1 -0
- package/dist/storage/quint/types.d.ts +152 -0
- package/dist/storage/quint/types.js +27 -0
- package/dist/storage/quint/types.js.map +1 -0
- package/dist/storage/quint/types.jsonld +78 -0
- package/dist/storage/quota/PerAccountQuotaStrategy.d.ts +19 -0
- package/dist/storage/quota/PerAccountQuotaStrategy.js +63 -0
- package/dist/storage/quota/PerAccountQuotaStrategy.js.map +1 -0
- package/dist/storage/quota/PerAccountQuotaStrategy.jsonld +113 -0
- package/dist/storage/quota/UsageRepository.d.ts +46 -0
- package/dist/storage/quota/UsageRepository.js +278 -0
- package/dist/storage/quota/UsageRepository.js.map +1 -0
- package/dist/storage/quota/UsageTrackingStore.d.ts +37 -0
- package/dist/storage/quota/UsageTrackingStore.js +355 -0
- package/dist/storage/quota/UsageTrackingStore.js.map +1 -0
- package/dist/storage/quota/UsageTrackingStore.jsonld +193 -0
- package/dist/storage/sparql/AlgebraUtils.d.ts +48 -0
- package/dist/storage/sparql/AlgebraUtils.js +118 -0
- package/dist/storage/sparql/AlgebraUtils.js.map +1 -0
- package/dist/storage/sparql/ComunicaOptimizedEngine.d.ts +59 -0
- package/dist/storage/sparql/ComunicaOptimizedEngine.js +254 -0
- package/dist/storage/sparql/ComunicaOptimizedEngine.js.map +1 -0
- package/dist/storage/sparql/ComunicaQuintEngine.d.ts +134 -0
- package/dist/storage/sparql/ComunicaQuintEngine.js +727 -0
- package/dist/storage/sparql/ComunicaQuintEngine.js.map +1 -0
- package/dist/storage/sparql/ExpressionEvaluator.d.ts +54 -0
- package/dist/storage/sparql/ExpressionEvaluator.js +340 -0
- package/dist/storage/sparql/ExpressionEvaluator.js.map +1 -0
- package/dist/storage/sparql/FilterPushdownExtractor.d.ts +74 -0
- package/dist/storage/sparql/FilterPushdownExtractor.js +409 -0
- package/dist/storage/sparql/FilterPushdownExtractor.js.map +1 -0
- package/dist/storage/sparql/OptimizedQuadstoreEngine.d.ts +65 -0
- package/dist/storage/sparql/OptimizedQuadstoreEngine.js +327 -0
- package/dist/storage/sparql/OptimizedQuadstoreEngine.js.map +1 -0
- package/dist/storage/sparql/OptimizedQuadstoreSource.d.ts +46 -0
- package/dist/storage/sparql/OptimizedQuadstoreSource.js +118 -0
- package/dist/storage/sparql/OptimizedQuadstoreSource.js.map +1 -0
- package/dist/storage/sparql/PatternBuilder.d.ts +41 -0
- package/dist/storage/sparql/PatternBuilder.js +118 -0
- package/dist/storage/sparql/PatternBuilder.js.map +1 -0
- package/dist/storage/sparql/QueryOptimizer.d.ts +125 -0
- package/dist/storage/sparql/QueryOptimizer.js +363 -0
- package/dist/storage/sparql/QueryOptimizer.js.map +1 -0
- package/dist/storage/sparql/QuintEngine.d.ts +92 -0
- package/dist/storage/sparql/QuintEngine.js +150 -0
- package/dist/storage/sparql/QuintEngine.js.map +1 -0
- package/dist/storage/sparql/QuintQuerySource.d.ts +227 -0
- package/dist/storage/sparql/QuintQuerySource.js +918 -0
- package/dist/storage/sparql/QuintQuerySource.js.map +1 -0
- package/dist/storage/sparql/SimpleSparqlExecutor.d.ts +40 -0
- package/dist/storage/sparql/SimpleSparqlExecutor.js +131 -0
- package/dist/storage/sparql/SimpleSparqlExecutor.js.map +1 -0
- package/dist/storage/sparql/SubgraphQueryEngine.d.ts +74 -0
- package/dist/storage/sparql/SubgraphQueryEngine.js +248 -0
- package/dist/storage/sparql/SubgraphQueryEngine.js.map +1 -0
- package/dist/storage/sparql/SubgraphQueryEngine.jsonld +250 -0
- package/dist/storage/vector/PostgresVectorStore.d.ts +46 -0
- package/dist/storage/vector/PostgresVectorStore.js +291 -0
- package/dist/storage/vector/PostgresVectorStore.js.map +1 -0
- package/dist/storage/vector/PostgresVectorStore.jsonld +142 -0
- package/dist/storage/vector/SqliteVectorStore.d.ts +44 -0
- package/dist/storage/vector/SqliteVectorStore.js +282 -0
- package/dist/storage/vector/SqliteVectorStore.js.map +1 -0
- package/dist/storage/vector/SqliteVectorStore.jsonld +137 -0
- package/dist/storage/vector/VectorIndexingListener.d.ts +114 -0
- package/dist/storage/vector/VectorIndexingListener.js +351 -0
- package/dist/storage/vector/VectorIndexingListener.js.map +1 -0
- package/dist/storage/vector/VectorStore.d.ts +42 -0
- package/dist/storage/vector/VectorStore.js +50 -0
- package/dist/storage/vector/VectorStore.js.map +1 -0
- package/dist/storage/vector/VectorStore.jsonld +87 -0
- package/dist/storage/vector/VectorStoreInit.d.ts +28 -0
- package/dist/storage/vector/VectorStoreInit.js +104 -0
- package/dist/storage/vector/VectorStoreInit.js.map +1 -0
- package/dist/storage/vector/index.d.ts +5 -0
- package/dist/storage/vector/index.js +22 -0
- package/dist/storage/vector/index.js.map +1 -0
- package/dist/storage/vector/types.d.ts +39 -0
- package/dist/storage/vector/types.js +8 -0
- package/dist/storage/vector/types.js.map +1 -0
- package/dist/subdomain/SubdomainClient.d.ts +156 -0
- package/dist/subdomain/SubdomainClient.js +220 -0
- package/dist/subdomain/SubdomainClient.js.map +1 -0
- package/dist/subdomain/SubdomainService.d.ts +114 -0
- package/dist/subdomain/SubdomainService.js +212 -0
- package/dist/subdomain/SubdomainService.js.map +1 -0
- package/dist/subdomain/SubdomainService.jsonld +261 -0
- package/dist/subdomain/index.d.ts +2 -0
- package/dist/subdomain/index.js +9 -0
- package/dist/subdomain/index.js.map +1 -0
- package/dist/supervisor/Supervisor.d.ts +20 -0
- package/dist/supervisor/Supervisor.js +174 -0
- package/dist/supervisor/Supervisor.js.map +1 -0
- package/dist/supervisor/index.d.ts +2 -0
- package/dist/supervisor/index.js +6 -0
- package/dist/supervisor/index.js.map +1 -0
- package/dist/supervisor/types.d.ts +19 -0
- package/dist/supervisor/types.js +3 -0
- package/dist/supervisor/types.js.map +1 -0
- package/dist/task/DrizzleTaskQueue.d.ts +60 -0
- package/dist/task/DrizzleTaskQueue.js +171 -0
- package/dist/task/DrizzleTaskQueue.js.map +1 -0
- package/dist/task/TaskExecutor.d.ts +82 -0
- package/dist/task/TaskExecutor.js +198 -0
- package/dist/task/TaskExecutor.js.map +1 -0
- package/dist/task/index.d.ts +10 -0
- package/dist/task/index.js +20 -0
- package/dist/task/index.js.map +1 -0
- package/dist/task/schema.d.ts +53 -0
- package/dist/task/schema.js +71 -0
- package/dist/task/schema.js.map +1 -0
- package/dist/task/types.d.ts +186 -0
- package/dist/task/types.js +12 -0
- package/dist/task/types.js.map +1 -0
- package/dist/terminal/AclPermissionService.d.ts +28 -0
- package/dist/terminal/AclPermissionService.js +141 -0
- package/dist/terminal/AclPermissionService.js.map +1 -0
- package/dist/terminal/BubblewrapSandbox.d.ts +51 -0
- package/dist/terminal/BubblewrapSandbox.js +147 -0
- package/dist/terminal/BubblewrapSandbox.js.map +1 -0
- package/dist/terminal/TerminalSession.d.ts +33 -0
- package/dist/terminal/TerminalSession.js +164 -0
- package/dist/terminal/TerminalSession.js.map +1 -0
- package/dist/terminal/TerminalSessionManager.d.ts +69 -0
- package/dist/terminal/TerminalSessionManager.js +196 -0
- package/dist/terminal/TerminalSessionManager.js.map +1 -0
- package/dist/terminal/index.d.ts +5 -0
- package/dist/terminal/index.js +22 -0
- package/dist/terminal/index.js.map +1 -0
- package/dist/terminal/sandbox/BubblewrapSandbox.d.ts +8 -0
- package/dist/terminal/sandbox/BubblewrapSandbox.js +105 -0
- package/dist/terminal/sandbox/BubblewrapSandbox.js.map +1 -0
- package/dist/terminal/sandbox/MacOSSandbox.d.ts +19 -0
- package/dist/terminal/sandbox/MacOSSandbox.js +120 -0
- package/dist/terminal/sandbox/MacOSSandbox.js.map +1 -0
- package/dist/terminal/sandbox/index.d.ts +29 -0
- package/dist/terminal/sandbox/index.js +113 -0
- package/dist/terminal/sandbox/index.js.map +1 -0
- package/dist/terminal/sandbox/types.d.ts +38 -0
- package/dist/terminal/sandbox/types.js +3 -0
- package/dist/terminal/sandbox/types.js.map +1 -0
- package/dist/terminal/types.d.ts +80 -0
- package/dist/terminal/types.js +16 -0
- package/dist/terminal/types.js.map +1 -0
- package/dist/tunnel/CloudflareTunnelProvider.d.ts +120 -0
- package/dist/tunnel/CloudflareTunnelProvider.js +376 -0
- package/dist/tunnel/CloudflareTunnelProvider.js.map +1 -0
- package/dist/tunnel/CloudflareTunnelProvider.jsonld +204 -0
- package/dist/tunnel/LocalTunnelProvider.d.ts +85 -0
- package/dist/tunnel/LocalTunnelProvider.js +295 -0
- package/dist/tunnel/LocalTunnelProvider.js.map +1 -0
- package/dist/tunnel/LocalTunnelProvider.jsonld +142 -0
- package/dist/tunnel/SakuraFrpTunnelProvider.d.ts +59 -0
- package/dist/tunnel/SakuraFrpTunnelProvider.js +207 -0
- package/dist/tunnel/SakuraFrpTunnelProvider.js.map +1 -0
- package/dist/tunnel/TunnelProvider.d.ts +91 -0
- package/dist/tunnel/TunnelProvider.js +10 -0
- package/dist/tunnel/TunnelProvider.js.map +1 -0
- package/dist/tunnel/TunnelProvider.jsonld +144 -0
- package/dist/tunnel/index.d.ts +3 -0
- package/dist/tunnel/index.js +8 -0
- package/dist/tunnel/index.js.map +1 -0
- package/dist/util/LockContext.d.ts +3 -0
- package/dist/util/LockContext.js +6 -0
- package/dist/util/LockContext.js.map +1 -0
- package/dist/util/ResourceStoreFetch.d.ts +11 -0
- package/dist/util/ResourceStoreFetch.js +147 -0
- package/dist/util/ResourceStoreFetch.js.map +1 -0
- package/dist/util/database/DatabaseMaintenance.d.ts +23 -0
- package/dist/util/database/DatabaseMaintenance.js +82 -0
- package/dist/util/database/DatabaseMaintenance.js.map +1 -0
- package/dist/util/identifiers/ClusterIdentifierStrategy.d.ts +23 -0
- package/dist/util/identifiers/ClusterIdentifierStrategy.js +73 -0
- package/dist/util/identifiers/ClusterIdentifierStrategy.js.map +1 -0
- package/dist/util/identifiers/ClusterIdentifierStrategy.jsonld +90 -0
- package/dist/util/identifiers/MultiDomainIdentifierStrategy.d.ts +40 -0
- package/dist/util/identifiers/MultiDomainIdentifierStrategy.js +73 -0
- package/dist/util/identifiers/MultiDomainIdentifierStrategy.js.map +1 -0
- package/dist/util/identifiers/MultiDomainIdentifierStrategy.jsonld +90 -0
- package/dist/util/identifiers/PathBasedPodIdentifierStrategy.d.ts +78 -0
- package/dist/util/identifiers/PathBasedPodIdentifierStrategy.js +182 -0
- package/dist/util/identifiers/PathBasedPodIdentifierStrategy.js.map +1 -0
- package/dist/util/identifiers/PathBasedPodIdentifierStrategy.jsonld +88 -0
- package/dist/util/identifiers/SubdomainPodIdentifierStrategy.d.ts +68 -0
- package/dist/util/identifiers/SubdomainPodIdentifierStrategy.js +149 -0
- package/dist/util/identifiers/SubdomainPodIdentifierStrategy.js.map +1 -0
- package/dist/util/identifiers/SubdomainPodIdentifierStrategy.jsonld +84 -0
- package/dist/util/locking/DebugRedisLocker.d.ts +8 -0
- package/dist/util/locking/DebugRedisLocker.js +33 -0
- package/dist/util/locking/DebugRedisLocker.js.map +1 -0
- package/dist/util/logger.d.ts +13 -0
- package/dist/util/logger.js +36 -0
- package/dist/util/logger.js.map +1 -0
- package/dist/util/stream/BandwidthThrottleTransform.d.ts +8 -0
- package/dist/util/stream/BandwidthThrottleTransform.js +55 -0
- package/dist/util/stream/BandwidthThrottleTransform.js.map +1 -0
- package/dist/vocab/external.d.ts +216 -0
- package/dist/vocab/external.js +276 -0
- package/dist/vocab/external.js.map +1 -0
- package/dist/vocab/index.d.ts +26 -0
- package/dist/vocab/index.js +46 -0
- package/dist/vocab/index.js.map +1 -0
- package/dist/vocab/udfs.d.ts +184 -0
- package/dist/vocab/udfs.js +217 -0
- package/dist/vocab/udfs.js.map +1 -0
- package/dist/webrtc/WebRTCClient.d.ts +109 -0
- package/dist/webrtc/WebRTCClient.js +344 -0
- package/dist/webrtc/WebRTCClient.js.map +1 -0
- package/dist/webrtc/WebRTCPeerManager.d.ts +112 -0
- package/dist/webrtc/WebRTCPeerManager.js +289 -0
- package/dist/webrtc/WebRTCPeerManager.js.map +1 -0
- package/dist/webrtc/WeriftPeerConnectionFactory.d.ts +13 -0
- package/dist/webrtc/WeriftPeerConnectionFactory.js +255 -0
- package/dist/webrtc/WeriftPeerConnectionFactory.js.map +1 -0
- package/dist/webrtc/index.d.ts +13 -0
- package/dist/webrtc/index.js +30 -0
- package/dist/webrtc/index.js.map +1 -0
- package/dist/webrtc/types.d.ts +169 -0
- package/dist/webrtc/types.js +6 -0
- package/dist/webrtc/types.js.map +1 -0
- package/dist/xpod.single.cjs +826 -0
- package/dist/xpod.single.cjs.map +7 -0
- package/package.json +173 -0
- package/static/app/assets/index.css +1 -0
- package/static/app/assets/main.js +11 -0
- package/static/app/auth.html +21 -0
- package/static/app/index.html +14 -0
- package/static/app/vite.svg +1 -0
- package/static/dashboard/assets/dashboard-G96F8267.js +52 -0
- package/static/dashboard/assets/dashboard-PJyGDppf.css +1 -0
- package/static/dashboard/auth.html +21 -0
- package/static/dashboard/index.html +13 -0
- package/static/dashboard/vite.svg +1 -0
- package/static/landing/index.html +165 -0
- package/templates/identity/index.html.ejs +12 -0
- package/templates/identity/login.html.ejs +49 -0
- package/templates/identity/oidc/consent.html.ejs +103 -0
- package/templates/identity/password/forgot.html.ejs +49 -0
- package/templates/identity/password/login.html.ejs +58 -0
- package/templates/identity/password/register.html.ejs +65 -0
- package/templates/main.html.ejs +1 -0
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ClusterIngressRouter = void 0;
|
|
4
|
+
const global_logger_factory_1 = require("global-logger-factory");
|
|
5
|
+
const node_stream_1 = require("node:stream");
|
|
6
|
+
const community_server_1 = require("@solid/community-server");
|
|
7
|
+
const community_server_2 = require("@solid/community-server");
|
|
8
|
+
const db_1 = require("../identity/drizzle/db");
|
|
9
|
+
const EdgeNodeRepository_1 = require("../identity/drizzle/EdgeNodeRepository");
|
|
10
|
+
/**
|
|
11
|
+
* Cluster Ingress Router - 集群统一入口路由器
|
|
12
|
+
*
|
|
13
|
+
* 实现我们设计的混合路由策略:
|
|
14
|
+
* 1. 所有节点子域名DNS都指向集群入口
|
|
15
|
+
* 2. 认证请求路由到集群IDP
|
|
16
|
+
* 3. 数据请求根据节点模式智能路由(307重定向 vs 代理)
|
|
17
|
+
*
|
|
18
|
+
* Note: WebSocket 代理由 ClusterWebSocketConfigurator 处理
|
|
19
|
+
*/
|
|
20
|
+
class ClusterIngressRouter extends community_server_1.HttpHandler {
|
|
21
|
+
constructor(options) {
|
|
22
|
+
super();
|
|
23
|
+
this.logger = (0, global_logger_factory_1.getLoggerFor)(this);
|
|
24
|
+
// Authentication paths that should always route to cluster IDP
|
|
25
|
+
this.authPaths = [
|
|
26
|
+
'/idp/',
|
|
27
|
+
'/.well-known/openid-configuration',
|
|
28
|
+
'/.well-known/oauth-authorization-server',
|
|
29
|
+
'/login',
|
|
30
|
+
'/logout'
|
|
31
|
+
];
|
|
32
|
+
this.repository = options.repository ?? new EdgeNodeRepository_1.EdgeNodeRepository((0, db_1.getIdentityDatabase)(options.identityDbUrl));
|
|
33
|
+
this.enabled = this.normalizeBoolean(options.edgeNodesEnabled);
|
|
34
|
+
this.clusterIngressDomain = this.normalizeDomain(options.clusterIngressDomain);
|
|
35
|
+
this.skipAuthRedirect = options.skipAuthRedirect ?? false;
|
|
36
|
+
this.fetchImpl = options.fetchImpl ?? fetch;
|
|
37
|
+
}
|
|
38
|
+
async canHandle({ request }) {
|
|
39
|
+
this.logger.debug('ClusterIngressRouter.canHandle called');
|
|
40
|
+
if (!this.enabled) {
|
|
41
|
+
this.logger.debug('ClusterIngressRouter disabled');
|
|
42
|
+
throw new community_server_2.NotImplementedHttpError('Cluster ingress router disabled.');
|
|
43
|
+
}
|
|
44
|
+
const hostname = this.extractHostname(request);
|
|
45
|
+
if (!hostname) {
|
|
46
|
+
throw new community_server_2.NotImplementedHttpError('Missing Host header.');
|
|
47
|
+
}
|
|
48
|
+
// Only handle requests to node subdomains, not the cluster domain itself
|
|
49
|
+
if (hostname === this.clusterIngressDomain) {
|
|
50
|
+
throw new community_server_2.NotImplementedHttpError('Request to cluster domain, not a node subdomain.');
|
|
51
|
+
}
|
|
52
|
+
// Check if this is a valid node subdomain
|
|
53
|
+
const nodeId = this.extractNodeIdFromHostname(hostname);
|
|
54
|
+
if (!nodeId) {
|
|
55
|
+
throw new community_server_2.NotImplementedHttpError('Not a node subdomain pattern.');
|
|
56
|
+
}
|
|
57
|
+
// Verify the node exists
|
|
58
|
+
const nodeSecret = await this.repository.getNodeSecret(nodeId);
|
|
59
|
+
if (!nodeSecret) {
|
|
60
|
+
throw new community_server_2.NotImplementedHttpError(`Node ${nodeId} not registered.`);
|
|
61
|
+
}
|
|
62
|
+
const url = this.parseUrl(request);
|
|
63
|
+
if (this.isAuthenticationRequest(url.pathname)) {
|
|
64
|
+
this.rewriteRequestForClusterIdp(request, hostname);
|
|
65
|
+
throw new community_server_2.NotImplementedHttpError('Authentication routed to cluster IDP.');
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
async handle({ request, response }) {
|
|
69
|
+
const hostname = this.extractHostname(request);
|
|
70
|
+
const url = this.parseUrl(request);
|
|
71
|
+
const nodeId = this.extractNodeIdFromHostname(hostname);
|
|
72
|
+
// Check if this is an authentication request
|
|
73
|
+
if (this.isAuthenticationRequest(url.pathname)) {
|
|
74
|
+
await this.handleAuthenticationRequest(request, response, url);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
// Data request - route based on node access mode
|
|
78
|
+
await this.handleDataRequest(request, response, nodeId, url);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Handle authentication requests - always route to cluster IDP
|
|
82
|
+
*/
|
|
83
|
+
async handleAuthenticationRequest(request, response, url) {
|
|
84
|
+
if (this.skipAuthRedirect) {
|
|
85
|
+
throw new community_server_2.NotImplementedHttpError('Auth routing skipped for testing.');
|
|
86
|
+
}
|
|
87
|
+
// Redirect authentication requests to cluster IDP
|
|
88
|
+
const clusterAuthUrl = new URL(url.pathname + url.search + url.hash, `https://${this.clusterIngressDomain}`);
|
|
89
|
+
this.logger.debug(`Routing auth request to cluster IDP: ${clusterAuthUrl.toString()}`);
|
|
90
|
+
response.statusCode = 307;
|
|
91
|
+
response.setHeader('Location', clusterAuthUrl.toString());
|
|
92
|
+
response.setHeader('Cache-Control', 'no-cache');
|
|
93
|
+
response.setHeader('X-Xpod-Auth-Redirect', 'cluster-idp');
|
|
94
|
+
response.end();
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Handle data requests - route based on node access mode
|
|
98
|
+
*/
|
|
99
|
+
async handleDataRequest(request, response, nodeId, url) {
|
|
100
|
+
try {
|
|
101
|
+
const [nodeInfo, nodeMetadata] = await Promise.all([
|
|
102
|
+
this.repository.getNodeConnectivityInfo(nodeId),
|
|
103
|
+
this.repository.getNodeMetadata(nodeId),
|
|
104
|
+
]);
|
|
105
|
+
if (!nodeInfo) {
|
|
106
|
+
throw new community_server_2.InternalServerError(`Node ${nodeId} connectivity info not found.`);
|
|
107
|
+
}
|
|
108
|
+
const mode = this.normalizeMode(nodeInfo.accessMode);
|
|
109
|
+
if (mode === 'direct' && nodeInfo.publicIp) {
|
|
110
|
+
await this.handleDirectModeRedirect(response, nodeInfo, url);
|
|
111
|
+
}
|
|
112
|
+
else if (mode === 'proxy') {
|
|
113
|
+
await this.handleProxyModeRequest(request, response, nodeId, nodeInfo, nodeMetadata?.metadata || null, url);
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
throw new community_server_2.InternalServerError(`Node ${nodeId} has unsupported accessMode ${nodeInfo.accessMode ?? 'unknown'}.`);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
catch (error) {
|
|
120
|
+
if (error instanceof community_server_2.NotImplementedHttpError) {
|
|
121
|
+
throw error;
|
|
122
|
+
}
|
|
123
|
+
throw new community_server_2.InternalServerError('Failed to route data request.', { cause: error });
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Handle direct mode - redirect to node's public IP
|
|
128
|
+
*/
|
|
129
|
+
async handleDirectModeRedirect(response, nodeInfo, url) {
|
|
130
|
+
const port = nodeInfo.publicPort && nodeInfo.publicPort !== 443 ? `:${nodeInfo.publicPort}` : '';
|
|
131
|
+
const nodeDirectUrl = `https://${nodeInfo.publicIp}${port}${url.pathname}${url.search}${url.hash}`;
|
|
132
|
+
this.logger.debug(`Redirecting to edge node (direct mode): ${nodeDirectUrl}`);
|
|
133
|
+
response.statusCode = 307;
|
|
134
|
+
response.setHeader('Location', nodeDirectUrl);
|
|
135
|
+
response.setHeader('Cache-Control', 'no-cache');
|
|
136
|
+
response.setHeader('X-Xpod-Direct-Node', nodeInfo.nodeId);
|
|
137
|
+
response.setHeader('X-Xpod-Target-IP', nodeInfo.publicIp);
|
|
138
|
+
response.end();
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Handle proxy mode - proxy the request through tunnel
|
|
142
|
+
*/
|
|
143
|
+
async handleProxyModeRequest(request, response, nodeId, nodeInfo, metadata, url) {
|
|
144
|
+
// Get tunnel entrypoint from node metadata
|
|
145
|
+
const upstream = this.resolveUpstream(metadata);
|
|
146
|
+
if (!upstream) {
|
|
147
|
+
throw new community_server_2.InternalServerError(`Node ${nodeId} tunnel endpoint not ready.`);
|
|
148
|
+
}
|
|
149
|
+
const upstreamBase = new URL(upstream);
|
|
150
|
+
const target = new URL(url.pathname + url.search, upstreamBase);
|
|
151
|
+
target.hash = url.hash;
|
|
152
|
+
const body = await this.readRequestBody(request);
|
|
153
|
+
const headers = this.buildProxyHeaders(request, url, upstreamBase);
|
|
154
|
+
let upstreamResponse;
|
|
155
|
+
try {
|
|
156
|
+
upstreamResponse = await this.fetchImpl(target.toString(), {
|
|
157
|
+
method: (request.method ?? 'GET').toUpperCase(),
|
|
158
|
+
headers,
|
|
159
|
+
body: body?.length ? body : undefined,
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
catch (error) {
|
|
163
|
+
this.logger.error(`Proxy request to ${target.toString()} failed: ${String(error)}`);
|
|
164
|
+
throw new community_server_2.InternalServerError('Failed to proxy request to edge node.', { cause: error });
|
|
165
|
+
}
|
|
166
|
+
// Forward response
|
|
167
|
+
response.statusCode = upstreamResponse.status;
|
|
168
|
+
response.setHeader('X-Xpod-Proxy-Node', nodeId);
|
|
169
|
+
upstreamResponse.headers.forEach((value, key) => {
|
|
170
|
+
if (key.toLowerCase() === 'transfer-encoding' && value === 'chunked') {
|
|
171
|
+
return; // Let Node.js handle chunking
|
|
172
|
+
}
|
|
173
|
+
response.setHeader(key, value);
|
|
174
|
+
});
|
|
175
|
+
if (!upstreamResponse.body) {
|
|
176
|
+
response.end();
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
const readable = node_stream_1.Readable.from(upstreamResponse.body);
|
|
180
|
+
readable.on('error', (error) => {
|
|
181
|
+
this.logger.error(`Proxy stream error: ${String(error)}`);
|
|
182
|
+
response.destroy(error);
|
|
183
|
+
});
|
|
184
|
+
readable.pipe(response);
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Resolve upstream endpoint from node metadata
|
|
188
|
+
*/
|
|
189
|
+
resolveUpstream(metadata) {
|
|
190
|
+
const tunnel = metadata?.tunnel;
|
|
191
|
+
if (tunnel && typeof tunnel === 'object') {
|
|
192
|
+
const entrypoint = tunnel.entrypoint;
|
|
193
|
+
if (typeof entrypoint === 'string' && entrypoint.trim().length > 0) {
|
|
194
|
+
return entrypoint;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
// Fallback to publicAddress if available
|
|
198
|
+
if (typeof metadata?.publicAddress === 'string') {
|
|
199
|
+
return metadata.publicAddress;
|
|
200
|
+
}
|
|
201
|
+
return undefined;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Build headers for proxy request
|
|
205
|
+
*/
|
|
206
|
+
buildProxyHeaders(request, original, upstream) {
|
|
207
|
+
const headers = new Headers();
|
|
208
|
+
// Forward original headers except host
|
|
209
|
+
for (const [name, value] of Object.entries(request.headers)) {
|
|
210
|
+
if (value === undefined || name.toLowerCase() === 'host') {
|
|
211
|
+
continue;
|
|
212
|
+
}
|
|
213
|
+
if (Array.isArray(value)) {
|
|
214
|
+
headers.set(name, value.join(','));
|
|
215
|
+
}
|
|
216
|
+
else {
|
|
217
|
+
headers.set(name, value);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
// Set proper target host
|
|
221
|
+
headers.set('host', upstream.host);
|
|
222
|
+
// Add forwarded headers for transparency
|
|
223
|
+
headers.set('x-forwarded-host', original.host);
|
|
224
|
+
headers.set('x-forwarded-proto', original.protocol.replace(/:$/u, ''));
|
|
225
|
+
const port = original.port || (original.protocol === 'https:' ? '443' : '80');
|
|
226
|
+
headers.set('x-forwarded-port', port);
|
|
227
|
+
// Add client IP if available
|
|
228
|
+
const remoteAddress = request.socket?.remoteAddress;
|
|
229
|
+
if (remoteAddress) {
|
|
230
|
+
const existing = headers.get('x-forwarded-for');
|
|
231
|
+
headers.set('x-forwarded-for', existing ? `${existing}, ${remoteAddress}` : remoteAddress);
|
|
232
|
+
}
|
|
233
|
+
return headers;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Read request body for proxy forwarding
|
|
237
|
+
*/
|
|
238
|
+
readRequestBody(request) {
|
|
239
|
+
const method = (request.method ?? 'GET').toUpperCase();
|
|
240
|
+
if (['GET', 'HEAD'].includes(method)) {
|
|
241
|
+
return Promise.resolve(undefined);
|
|
242
|
+
}
|
|
243
|
+
return new Promise((resolve, reject) => {
|
|
244
|
+
const chunks = [];
|
|
245
|
+
request.on('data', (chunk) => chunks.push(chunk));
|
|
246
|
+
request.on('end', () => resolve(Buffer.concat(chunks)));
|
|
247
|
+
request.on('error', reject);
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Check if request path is for authentication
|
|
252
|
+
*/
|
|
253
|
+
isAuthenticationRequest(pathname) {
|
|
254
|
+
return this.authPaths.some(authPath => pathname.startsWith(authPath));
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Rewrite the incoming request so downstream handlers treat it as cluster IDP traffic.
|
|
258
|
+
*/
|
|
259
|
+
rewriteRequestForClusterIdp(request, originalHost) {
|
|
260
|
+
if (!request.headers['x-original-host']) {
|
|
261
|
+
request.headers['x-original-host'] = originalHost;
|
|
262
|
+
}
|
|
263
|
+
request.headers.host = this.clusterIngressDomain;
|
|
264
|
+
request.headers.Host = this.clusterIngressDomain;
|
|
265
|
+
if (!request.headers['x-forwarded-host']) {
|
|
266
|
+
request.headers['x-forwarded-host'] = originalHost;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Extract node ID from hostname
|
|
271
|
+
* e.g., "node1.cluster.example.com" -> "node1"
|
|
272
|
+
*/
|
|
273
|
+
extractNodeIdFromHostname(hostname) {
|
|
274
|
+
const clusterSuffix = `.${this.clusterIngressDomain}`;
|
|
275
|
+
if (!hostname.endsWith(clusterSuffix)) {
|
|
276
|
+
return undefined;
|
|
277
|
+
}
|
|
278
|
+
const nodeId = hostname.slice(0, -clusterSuffix.length);
|
|
279
|
+
// Validate node ID format (simple validation)
|
|
280
|
+
if (!nodeId || nodeId.includes('.') || nodeId.length === 0) {
|
|
281
|
+
return undefined;
|
|
282
|
+
}
|
|
283
|
+
return nodeId;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Extract hostname from request headers
|
|
287
|
+
* Check for original host header first (set by ClusterHttpServerFactory)
|
|
288
|
+
*/
|
|
289
|
+
extractHostname(request) {
|
|
290
|
+
// Check for original host header first (set by ClusterHttpServerFactory)
|
|
291
|
+
const originalHost = request.headers['x-original-host'];
|
|
292
|
+
if (originalHost && typeof originalHost === 'string') {
|
|
293
|
+
return originalHost.toLowerCase();
|
|
294
|
+
}
|
|
295
|
+
const hostHeader = request.headers.host || request.headers.Host;
|
|
296
|
+
if (Array.isArray(hostHeader)) {
|
|
297
|
+
return hostHeader[0]?.toLowerCase();
|
|
298
|
+
}
|
|
299
|
+
return typeof hostHeader === 'string' ? hostHeader.toLowerCase() : undefined;
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Parse request URL
|
|
303
|
+
*/
|
|
304
|
+
parseUrl(request) {
|
|
305
|
+
const hostHeader = request.headers.host ?? request.headers.Host ?? 'localhost';
|
|
306
|
+
const protoHeader = request.headers['x-forwarded-proto'] ?? request.headers['X-Forwarded-Proto'];
|
|
307
|
+
const protocol = Array.isArray(protoHeader) ? protoHeader[0] : protoHeader;
|
|
308
|
+
const scheme = typeof protocol === 'string' ? protocol.split(',')[0]?.trim() ?? 'https' : 'https';
|
|
309
|
+
const rawUrl = request.url ?? '/';
|
|
310
|
+
return new URL(rawUrl, `${scheme}://${hostHeader}`);
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Normalize domain input; accept bare host or full URL.
|
|
314
|
+
*/
|
|
315
|
+
normalizeDomain(domain) {
|
|
316
|
+
if (domain.includes('://')) {
|
|
317
|
+
try {
|
|
318
|
+
return new URL(domain).hostname.toLowerCase();
|
|
319
|
+
}
|
|
320
|
+
catch {
|
|
321
|
+
return domain.toLowerCase();
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
return domain.toLowerCase();
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Normalize boolean values from string/boolean
|
|
328
|
+
*/
|
|
329
|
+
normalizeBoolean(value) {
|
|
330
|
+
if (typeof value === 'boolean') {
|
|
331
|
+
return value;
|
|
332
|
+
}
|
|
333
|
+
if (typeof value === 'string') {
|
|
334
|
+
const normalized = value.trim().toLowerCase();
|
|
335
|
+
return normalized === 'true' || normalized === '1' || normalized === 'yes' || normalized === 'on';
|
|
336
|
+
}
|
|
337
|
+
return false;
|
|
338
|
+
}
|
|
339
|
+
normalizeMode(mode) {
|
|
340
|
+
if (!mode) {
|
|
341
|
+
return undefined;
|
|
342
|
+
}
|
|
343
|
+
const normalized = mode.trim().toLowerCase();
|
|
344
|
+
// Backward compatibility for 'redirect' -> 'direct'
|
|
345
|
+
if (normalized === 'redirect' || normalized === 'direct') {
|
|
346
|
+
return 'direct';
|
|
347
|
+
}
|
|
348
|
+
if (normalized === 'proxy') {
|
|
349
|
+
return 'proxy';
|
|
350
|
+
}
|
|
351
|
+
return undefined;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
exports.ClusterIngressRouter = ClusterIngressRouter;
|
|
355
|
+
//# sourceMappingURL=ClusterIngressRouter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClusterIngressRouter.js","sourceRoot":"","sources":["../../src/http/ClusterIngressRouter.ts"],"names":[],"mappings":";;;AACA,iEAAqD;AACrD,6CAAuC;AACvC,8DAAsD;AAEtD,8DAIiC;AACjC,+CAA6D;AAC7D,+EAA4E;AAW5E;;;;;;;;;GASG;AACH,MAAa,oBAAqB,SAAQ,8BAAW;IAiBnD,YAAmB,OAAoC;QACrD,KAAK,EAAE,CAAC;QAjBS,WAAM,GAAG,IAAA,oCAAY,EAAC,IAAI,CAAC,CAAC;QAO/C,+DAA+D;QAC9C,cAAS,GAAG;YAC3B,OAAO;YACP,mCAAmC;YACnC,yCAAyC;YACzC,QAAQ;YACR,SAAS;SACV,CAAC;QAIA,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,IAAI,uCAAkB,CAAC,IAAA,wBAAmB,EAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC;QAC3G,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;QAC/D,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;QAC/E,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,IAAI,KAAK,CAAC;QAC1D,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,KAAK,CAAC;IAC9C,CAAC;IAEe,KAAK,CAAC,SAAS,CAAC,EAAE,OAAO,EAAoB;QAC3D,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC;QAC3D,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YAClB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;YACnD,MAAM,IA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,CAAC;YAC/B,OAAO,KAAK,CAAC;QACf,CAAC;QACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;YAC9C,OAAO,UAAU,KAAK,MAAM,IAAI,UAAU,KAAK,GAAG,IAAI,UAAU,KAAK,KAAK,IAAI,UAAU,KAAK,IAAI,CAAC;QACpG,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAEO,aAAa,CAAC,IAAwB;QAC5C,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QAC7C,oDAAoD;QACpD,IAAI,UAAU,KAAK,UAAU,IAAI,UAAU,KAAK,QAAQ,EAAE,CAAC;YACzD,OAAO,QAAQ,CAAC;QAClB,CAAC;QACD,IAAI,UAAU,KAAK,OAAO,EAAE,CAAC;YAC3B,OAAO,OAAO,CAAC;QACjB,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AAtZD,oDAsZC","sourcesContent":["import type { IncomingMessage } from 'node:http';\nimport { getLoggerFor } from 'global-logger-factory';\nimport { Readable } from 'node:stream';\nimport { HttpHandler } from '@solid/community-server';\nimport type { HttpHandlerInput, HttpResponse } from '@solid/community-server';\nimport {\n NotImplementedHttpError,\n InternalServerError,\n \n} from '@solid/community-server';\nimport { getIdentityDatabase } from '../identity/drizzle/db';\nimport { EdgeNodeRepository } from '../identity/drizzle/EdgeNodeRepository';\n\ninterface ClusterIngressRouterOptions {\n identityDbUrl: string;\n edgeNodesEnabled?: string | boolean;\n repository?: EdgeNodeRepository;\n clusterIngressDomain: string; // cluster.example.com\n skipAuthRedirect?: boolean; // For testing\n fetchImpl?: any;\n}\n\n/**\n * Cluster Ingress Router - 集群统一入口路由器\n * \n * 实现我们设计的混合路由策略:\n * 1. 所有节点子域名DNS都指向集群入口\n * 2. 认证请求路由到集群IDP \n * 3. 数据请求根据节点模式智能路由(307重定向 vs 代理)\n * \n * Note: WebSocket 代理由 ClusterWebSocketConfigurator 处理\n */\nexport class ClusterIngressRouter extends HttpHandler {\n protected readonly logger = getLoggerFor(this);\n private readonly repository: EdgeNodeRepository;\n private readonly enabled: boolean;\n private readonly clusterIngressDomain: string;\n private readonly skipAuthRedirect: boolean;\n private readonly fetchImpl: any;\n\n // Authentication paths that should always route to cluster IDP\n private readonly authPaths = [\n '/idp/',\n '/.well-known/openid-configuration',\n '/.well-known/oauth-authorization-server', \n '/login',\n '/logout'\n ];\n\n public constructor(options: ClusterIngressRouterOptions) {\n super();\n this.repository = options.repository ?? new EdgeNodeRepository(getIdentityDatabase(options.identityDbUrl));\n this.enabled = this.normalizeBoolean(options.edgeNodesEnabled);\n this.clusterIngressDomain = this.normalizeDomain(options.clusterIngressDomain);\n this.skipAuthRedirect = options.skipAuthRedirect ?? false;\n this.fetchImpl = options.fetchImpl ?? fetch;\n }\n\n public override async canHandle({ request }: HttpHandlerInput): Promise<void> {\n this.logger.debug('ClusterIngressRouter.canHandle called');\n if (!this.enabled) {\n this.logger.debug('ClusterIngressRouter disabled');\n throw new NotImplementedHttpError('Cluster ingress router disabled.');\n }\n\n const hostname = this.extractHostname(request);\n if (!hostname) {\n throw new NotImplementedHttpError('Missing Host header.');\n }\n\n // Only handle requests to node subdomains, not the cluster domain itself\n if (hostname === this.clusterIngressDomain) {\n throw new NotImplementedHttpError('Request to cluster domain, not a node subdomain.');\n }\n\n // Check if this is a valid node subdomain\n const nodeId = this.extractNodeIdFromHostname(hostname);\n if (!nodeId) {\n throw new NotImplementedHttpError('Not a node subdomain pattern.');\n }\n\n // Verify the node exists\n const nodeSecret = await this.repository.getNodeSecret(nodeId);\n if (!nodeSecret) {\n throw new NotImplementedHttpError(`Node ${nodeId} not registered.`);\n }\n\n const url = this.parseUrl(request);\n if (this.isAuthenticationRequest(url.pathname)) {\n this.rewriteRequestForClusterIdp(request, hostname);\n throw new NotImplementedHttpError('Authentication routed to cluster IDP.');\n }\n }\n\n public override async handle({ request, response }: HttpHandlerInput): Promise<void> {\n const hostname = this.extractHostname(request)!;\n const url = this.parseUrl(request);\n const nodeId = this.extractNodeIdFromHostname(hostname)!;\n \n // Check if this is an authentication request\n if (this.isAuthenticationRequest(url.pathname)) {\n await this.handleAuthenticationRequest(request, response, url);\n return;\n }\n\n // Data request - route based on node access mode\n await this.handleDataRequest(request, response, nodeId, url);\n }\n\n /**\n * Handle authentication requests - always route to cluster IDP\n */\n private async handleAuthenticationRequest(\n request: IncomingMessage, \n response: HttpResponse, \n url: URL\n ): Promise<void> {\n if (this.skipAuthRedirect) {\n throw new NotImplementedHttpError('Auth routing skipped for testing.');\n }\n\n // Redirect authentication requests to cluster IDP\n const clusterAuthUrl = new URL(url.pathname + url.search + url.hash, `https://${this.clusterIngressDomain}`);\n \n this.logger.debug(`Routing auth request to cluster IDP: ${clusterAuthUrl.toString()}`);\n \n response.statusCode = 307;\n response.setHeader('Location', clusterAuthUrl.toString());\n response.setHeader('Cache-Control', 'no-cache');\n response.setHeader('X-Xpod-Auth-Redirect', 'cluster-idp');\n response.end();\n }\n\n /**\n * Handle data requests - route based on node access mode\n */\n private async handleDataRequest(\n request: IncomingMessage,\n response: HttpResponse, \n nodeId: string,\n url: URL\n ): Promise<void> {\n try {\n const [nodeInfo, nodeMetadata] = await Promise.all([\n this.repository.getNodeConnectivityInfo(nodeId),\n this.repository.getNodeMetadata(nodeId),\n ]);\n \n if (!nodeInfo) {\n throw new InternalServerError(`Node ${nodeId} connectivity info not found.`);\n }\n\n const mode = this.normalizeMode(nodeInfo.accessMode);\n if (mode === 'direct' && nodeInfo.publicIp) {\n await this.handleDirectModeRedirect(response, nodeInfo, url);\n } else if (mode === 'proxy') {\n await this.handleProxyModeRequest(request, response, nodeId, nodeInfo, nodeMetadata?.metadata || null, url);\n } else {\n throw new InternalServerError(`Node ${nodeId} has unsupported accessMode ${nodeInfo.accessMode ?? 'unknown'}.`);\n }\n } catch (error: unknown) {\n if (error instanceof NotImplementedHttpError) {\n throw error;\n }\n throw new InternalServerError('Failed to route data request.', { cause: error });\n }\n }\n\n /**\n * Handle direct mode - redirect to node's public IP\n */\n private async handleDirectModeRedirect(\n response: HttpResponse,\n nodeInfo: NonNullable<Awaited<ReturnType<EdgeNodeRepository['getNodeConnectivityInfo']>>>,\n url: URL\n ): Promise<void> {\n const port = nodeInfo.publicPort && nodeInfo.publicPort !== 443 ? `:${nodeInfo.publicPort}` : '';\n const nodeDirectUrl = `https://${nodeInfo.publicIp}${port}${url.pathname}${url.search}${url.hash}`;\n \n this.logger.debug(`Redirecting to edge node (direct mode): ${nodeDirectUrl}`);\n \n response.statusCode = 307;\n response.setHeader('Location', nodeDirectUrl);\n response.setHeader('Cache-Control', 'no-cache');\n response.setHeader('X-Xpod-Direct-Node', nodeInfo.nodeId);\n response.setHeader('X-Xpod-Target-IP', nodeInfo.publicIp!);\n response.end();\n }\n\n /**\n * Handle proxy mode - proxy the request through tunnel\n */\n private async handleProxyModeRequest(\n request: IncomingMessage,\n response: HttpResponse,\n nodeId: string,\n nodeInfo: NonNullable<Awaited<ReturnType<EdgeNodeRepository['getNodeConnectivityInfo']>>>,\n metadata: Record<string, unknown> | null,\n url: URL\n ): Promise<void> {\n // Get tunnel entrypoint from node metadata\n const upstream = this.resolveUpstream(metadata);\n if (!upstream) {\n throw new InternalServerError(`Node ${nodeId} tunnel endpoint not ready.`);\n }\n\n const upstreamBase = new URL(upstream);\n const target = new URL(url.pathname + url.search, upstreamBase);\n target.hash = url.hash;\n\n const body = await this.readRequestBody(request);\n const headers = this.buildProxyHeaders(request, url, upstreamBase);\n\n let upstreamResponse: Response;\n try {\n upstreamResponse = await this.fetchImpl(target.toString(), {\n method: (request.method ?? 'GET').toUpperCase(),\n headers,\n body: body?.length ? body : undefined,\n });\n } catch (error: unknown) {\n this.logger.error(`Proxy request to ${target.toString()} failed: ${String(error)}`);\n throw new InternalServerError('Failed to proxy request to edge node.', { cause: error });\n }\n\n // Forward response\n response.statusCode = upstreamResponse.status;\n response.setHeader('X-Xpod-Proxy-Node', nodeId);\n \n upstreamResponse.headers.forEach((value, key) => {\n if (key.toLowerCase() === 'transfer-encoding' && value === 'chunked') {\n return; // Let Node.js handle chunking\n }\n response.setHeader(key, value);\n });\n\n if (!upstreamResponse.body) {\n response.end();\n return;\n }\n\n const readable = Readable.from(upstreamResponse.body as any);\n readable.on('error', (error) => {\n this.logger.error(`Proxy stream error: ${String(error)}`);\n response.destroy(error);\n });\n readable.pipe(response);\n }\n\n /**\n * Resolve upstream endpoint from node metadata\n */\n private resolveUpstream(metadata?: Record<string, unknown> | null): string | undefined {\n const tunnel = metadata?.tunnel;\n if (tunnel && typeof tunnel === 'object') {\n const entrypoint = (tunnel as Record<string, unknown>).entrypoint;\n if (typeof entrypoint === 'string' && entrypoint.trim().length > 0) {\n return entrypoint;\n }\n }\n \n // Fallback to publicAddress if available\n if (typeof metadata?.publicAddress === 'string') {\n return metadata.publicAddress;\n }\n \n return undefined;\n }\n\n /**\n * Build headers for proxy request\n */\n private buildProxyHeaders(request: IncomingMessage, original: URL, upstream: URL): Headers {\n const headers = new Headers();\n \n // Forward original headers except host\n for (const [name, value] of Object.entries(request.headers)) {\n if (value === undefined || name.toLowerCase() === 'host') {\n continue;\n }\n if (Array.isArray(value)) {\n headers.set(name, value.join(','));\n } else {\n headers.set(name, value);\n }\n }\n \n // Set proper target host\n headers.set('host', upstream.host);\n \n // Add forwarded headers for transparency\n headers.set('x-forwarded-host', original.host);\n headers.set('x-forwarded-proto', original.protocol.replace(/:$/u, ''));\n \n const port = original.port || (original.protocol === 'https:' ? '443' : '80');\n headers.set('x-forwarded-port', port);\n \n // Add client IP if available\n const remoteAddress = (request.socket as any)?.remoteAddress;\n if (remoteAddress) {\n const existing = headers.get('x-forwarded-for');\n headers.set('x-forwarded-for', existing ? `${existing}, ${remoteAddress}` : remoteAddress);\n }\n \n return headers;\n }\n\n /**\n * Read request body for proxy forwarding\n */\n private readRequestBody(request: IncomingMessage): Promise<Buffer | undefined> {\n const method = (request.method ?? 'GET').toUpperCase();\n if (['GET', 'HEAD'].includes(method)) {\n return Promise.resolve(undefined);\n }\n \n return new Promise((resolve, reject) => {\n const chunks: Buffer[] = [];\n request.on('data', (chunk: Buffer) => chunks.push(chunk));\n request.on('end', () => resolve(Buffer.concat(chunks)));\n request.on('error', reject);\n });\n }\n\n /**\n * Check if request path is for authentication\n */\n private isAuthenticationRequest(pathname: string): boolean {\n return this.authPaths.some(authPath => pathname.startsWith(authPath));\n }\n\n /**\n * Rewrite the incoming request so downstream handlers treat it as cluster IDP traffic.\n */\n private rewriteRequestForClusterIdp(request: IncomingMessage, originalHost: string): void {\n if (!request.headers['x-original-host']) {\n request.headers['x-original-host'] = originalHost;\n }\n\n request.headers.host = this.clusterIngressDomain;\n request.headers.Host = this.clusterIngressDomain;\n\n if (!request.headers['x-forwarded-host']) {\n request.headers['x-forwarded-host'] = originalHost;\n }\n }\n\n /**\n * Extract node ID from hostname\n * e.g., \"node1.cluster.example.com\" -> \"node1\"\n */\n private extractNodeIdFromHostname(hostname: string): string | undefined {\n const clusterSuffix = `.${this.clusterIngressDomain}`;\n if (!hostname.endsWith(clusterSuffix)) {\n return undefined;\n }\n \n const nodeId = hostname.slice(0, -clusterSuffix.length);\n // Validate node ID format (simple validation)\n if (!nodeId || nodeId.includes('.') || nodeId.length === 0) {\n return undefined;\n }\n \n return nodeId;\n }\n\n /**\n * Extract hostname from request headers\n * Check for original host header first (set by ClusterHttpServerFactory)\n */\n private extractHostname(request: IncomingMessage): string | undefined {\n // Check for original host header first (set by ClusterHttpServerFactory)\n const originalHost = request.headers['x-original-host'];\n if (originalHost && typeof originalHost === 'string') {\n return originalHost.toLowerCase();\n }\n \n const hostHeader = request.headers.host || request.headers.Host;\n if (Array.isArray(hostHeader)) {\n return hostHeader[0]?.toLowerCase();\n }\n return typeof hostHeader === 'string' ? hostHeader.toLowerCase() : undefined;\n }\n\n /**\n * Parse request URL\n */\n private parseUrl(request: IncomingMessage): URL {\n const hostHeader = request.headers.host ?? request.headers.Host ?? 'localhost';\n const protoHeader = request.headers['x-forwarded-proto'] ?? request.headers['X-Forwarded-Proto'];\n const protocol = Array.isArray(protoHeader) ? protoHeader[0] : protoHeader;\n const scheme = typeof protocol === 'string' ? protocol.split(',')[0]?.trim() ?? 'https' : 'https';\n const rawUrl = request.url ?? '/';\n return new URL(rawUrl, `${scheme}://${hostHeader}`);\n }\n\n /**\n * Normalize domain input; accept bare host or full URL.\n */\n private normalizeDomain(domain: string): string {\n if (domain.includes('://')) {\n try {\n return new URL(domain).hostname.toLowerCase();\n } catch {\n return domain.toLowerCase();\n }\n }\n return domain.toLowerCase();\n }\n\n /**\n * Normalize boolean values from string/boolean\n */\n private normalizeBoolean(value?: string | boolean): boolean {\n if (typeof value === 'boolean') {\n return value;\n }\n if (typeof value === 'string') {\n const normalized = value.trim().toLowerCase();\n return normalized === 'true' || normalized === '1' || normalized === 'yes' || normalized === 'on';\n }\n return false;\n }\n\n private normalizeMode(mode: string | undefined): 'direct' | 'proxy' | undefined {\n if (!mode) {\n return undefined;\n }\n const normalized = mode.trim().toLowerCase();\n // Backward compatibility for 'redirect' -> 'direct'\n if (normalized === 'redirect' || normalized === 'direct') {\n return 'direct';\n }\n if (normalized === 'proxy') {\n return 'proxy';\n }\n return undefined;\n }\n}\n"]}
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
{
|
|
2
|
+
"@context": [
|
|
3
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@undefineds.co/xpod/^0.0.0/components/context.jsonld",
|
|
4
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^8.0.0/components/context.jsonld"
|
|
5
|
+
],
|
|
6
|
+
"@id": "npmd:@undefineds.co/xpod",
|
|
7
|
+
"components": [
|
|
8
|
+
{
|
|
9
|
+
"@id": "undefineds:dist/http/ClusterIngressRouter.jsonld#ClusterIngressRouter",
|
|
10
|
+
"@type": "Class",
|
|
11
|
+
"requireElement": "ClusterIngressRouter",
|
|
12
|
+
"extends": [
|
|
13
|
+
"css:dist/server/HttpHandler.jsonld#HttpHandler"
|
|
14
|
+
],
|
|
15
|
+
"comment": "Cluster Ingress Router - 集群统一入口路由器 实现我们设计的混合路由策略: 1. 所有节点子域名DNS都指向集群入口 2. 认证请求路由到集群IDP 3. 数据请求根据节点模式智能路由(307重定向 vs 代理) Note: WebSocket 代理由 ClusterWebSocketConfigurator 处理",
|
|
16
|
+
"parameters": [
|
|
17
|
+
{
|
|
18
|
+
"@id": "undefineds:dist/http/ClusterIngressRouter.jsonld#ClusterIngressRouter_options_identityDbUrl",
|
|
19
|
+
"range": "xsd:string"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"@id": "undefineds:dist/http/ClusterIngressRouter.jsonld#ClusterIngressRouter_options_edgeNodesEnabled",
|
|
23
|
+
"range": {
|
|
24
|
+
"@type": "ParameterRangeUnion",
|
|
25
|
+
"parameterRangeElements": [
|
|
26
|
+
"xsd:string",
|
|
27
|
+
"xsd:boolean",
|
|
28
|
+
{
|
|
29
|
+
"@type": "ParameterRangeUndefined"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"@id": "undefineds:dist/http/ClusterIngressRouter.jsonld#ClusterIngressRouter_options_repository",
|
|
36
|
+
"range": {
|
|
37
|
+
"@type": "ParameterRangeUnion",
|
|
38
|
+
"parameterRangeElements": [
|
|
39
|
+
"undefineds:dist/identity/drizzle/EdgeNodeRepository.jsonld#EdgeNodeRepository",
|
|
40
|
+
{
|
|
41
|
+
"@type": "ParameterRangeUndefined"
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"@id": "undefineds:dist/http/ClusterIngressRouter.jsonld#ClusterIngressRouter_options_clusterIngressDomain",
|
|
48
|
+
"range": "xsd:string"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"@id": "undefineds:dist/http/ClusterIngressRouter.jsonld#ClusterIngressRouter_options_skipAuthRedirect",
|
|
52
|
+
"range": {
|
|
53
|
+
"@type": "ParameterRangeUnion",
|
|
54
|
+
"parameterRangeElements": [
|
|
55
|
+
"xsd:boolean",
|
|
56
|
+
{
|
|
57
|
+
"@type": "ParameterRangeUndefined"
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"@id": "undefineds:dist/http/ClusterIngressRouter.jsonld#ClusterIngressRouter_options_fetchImpl",
|
|
64
|
+
"range": {
|
|
65
|
+
"@type": "ParameterRangeUnion",
|
|
66
|
+
"parameterRangeElements": [
|
|
67
|
+
{
|
|
68
|
+
"@type": "ParameterRangeWildcard"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"@type": "ParameterRangeUndefined"
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"memberFields": [
|
|
78
|
+
{
|
|
79
|
+
"@id": "undefineds:dist/http/ClusterIngressRouter.jsonld#ClusterIngressRouter__member_logger",
|
|
80
|
+
"memberFieldName": "logger",
|
|
81
|
+
"range": {
|
|
82
|
+
"@type": "ParameterRangeWildcard"
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"@id": "undefineds:dist/http/ClusterIngressRouter.jsonld#ClusterIngressRouter__member_repository",
|
|
87
|
+
"memberFieldName": "repository"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"@id": "undefineds:dist/http/ClusterIngressRouter.jsonld#ClusterIngressRouter__member_enabled",
|
|
91
|
+
"memberFieldName": "enabled"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"@id": "undefineds:dist/http/ClusterIngressRouter.jsonld#ClusterIngressRouter__member_clusterIngressDomain",
|
|
95
|
+
"memberFieldName": "clusterIngressDomain"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"@id": "undefineds:dist/http/ClusterIngressRouter.jsonld#ClusterIngressRouter__member_skipAuthRedirect",
|
|
99
|
+
"memberFieldName": "skipAuthRedirect"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"@id": "undefineds:dist/http/ClusterIngressRouter.jsonld#ClusterIngressRouter__member_fetchImpl",
|
|
103
|
+
"memberFieldName": "fetchImpl"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"@id": "undefineds:dist/http/ClusterIngressRouter.jsonld#ClusterIngressRouter__member_authPaths",
|
|
107
|
+
"memberFieldName": "authPaths"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"@id": "undefineds:dist/http/ClusterIngressRouter.jsonld#ClusterIngressRouter__member_constructor",
|
|
111
|
+
"memberFieldName": "constructor"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"@id": "undefineds:dist/http/ClusterIngressRouter.jsonld#ClusterIngressRouter__member_canHandle",
|
|
115
|
+
"memberFieldName": "canHandle"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"@id": "undefineds:dist/http/ClusterIngressRouter.jsonld#ClusterIngressRouter__member_handle",
|
|
119
|
+
"memberFieldName": "handle"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"@id": "undefineds:dist/http/ClusterIngressRouter.jsonld#ClusterIngressRouter__member_handleAuthenticationRequest",
|
|
123
|
+
"memberFieldName": "handleAuthenticationRequest"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"@id": "undefineds:dist/http/ClusterIngressRouter.jsonld#ClusterIngressRouter__member_handleDataRequest",
|
|
127
|
+
"memberFieldName": "handleDataRequest"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"@id": "undefineds:dist/http/ClusterIngressRouter.jsonld#ClusterIngressRouter__member_handleDirectModeRedirect",
|
|
131
|
+
"memberFieldName": "handleDirectModeRedirect"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"@id": "undefineds:dist/http/ClusterIngressRouter.jsonld#ClusterIngressRouter__member_handleProxyModeRequest",
|
|
135
|
+
"memberFieldName": "handleProxyModeRequest"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"@id": "undefineds:dist/http/ClusterIngressRouter.jsonld#ClusterIngressRouter__member_resolveUpstream",
|
|
139
|
+
"memberFieldName": "resolveUpstream"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"@id": "undefineds:dist/http/ClusterIngressRouter.jsonld#ClusterIngressRouter__member_buildProxyHeaders",
|
|
143
|
+
"memberFieldName": "buildProxyHeaders"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"@id": "undefineds:dist/http/ClusterIngressRouter.jsonld#ClusterIngressRouter__member_readRequestBody",
|
|
147
|
+
"memberFieldName": "readRequestBody"
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"@id": "undefineds:dist/http/ClusterIngressRouter.jsonld#ClusterIngressRouter__member_isAuthenticationRequest",
|
|
151
|
+
"memberFieldName": "isAuthenticationRequest"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"@id": "undefineds:dist/http/ClusterIngressRouter.jsonld#ClusterIngressRouter__member_rewriteRequestForClusterIdp",
|
|
155
|
+
"memberFieldName": "rewriteRequestForClusterIdp"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"@id": "undefineds:dist/http/ClusterIngressRouter.jsonld#ClusterIngressRouter__member_extractNodeIdFromHostname",
|
|
159
|
+
"memberFieldName": "extractNodeIdFromHostname"
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"@id": "undefineds:dist/http/ClusterIngressRouter.jsonld#ClusterIngressRouter__member_extractHostname",
|
|
163
|
+
"memberFieldName": "extractHostname"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"@id": "undefineds:dist/http/ClusterIngressRouter.jsonld#ClusterIngressRouter__member_parseUrl",
|
|
167
|
+
"memberFieldName": "parseUrl"
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"@id": "undefineds:dist/http/ClusterIngressRouter.jsonld#ClusterIngressRouter__member_normalizeDomain",
|
|
171
|
+
"memberFieldName": "normalizeDomain"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"@id": "undefineds:dist/http/ClusterIngressRouter.jsonld#ClusterIngressRouter__member_normalizeBoolean",
|
|
175
|
+
"memberFieldName": "normalizeBoolean"
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"@id": "undefineds:dist/http/ClusterIngressRouter.jsonld#ClusterIngressRouter__member_normalizeMode",
|
|
179
|
+
"memberFieldName": "normalizeMode"
|
|
180
|
+
}
|
|
181
|
+
],
|
|
182
|
+
"constructorArguments": [
|
|
183
|
+
{
|
|
184
|
+
"@id": "undefineds:dist/http/ClusterIngressRouter.jsonld#ClusterIngressRouter_options__constructorArgument",
|
|
185
|
+
"fields": [
|
|
186
|
+
{
|
|
187
|
+
"keyRaw": "identityDbUrl",
|
|
188
|
+
"value": {
|
|
189
|
+
"@id": "undefineds:dist/http/ClusterIngressRouter.jsonld#ClusterIngressRouter_options_identityDbUrl"
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"keyRaw": "edgeNodesEnabled",
|
|
194
|
+
"value": {
|
|
195
|
+
"@id": "undefineds:dist/http/ClusterIngressRouter.jsonld#ClusterIngressRouter_options_edgeNodesEnabled"
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"keyRaw": "repository",
|
|
200
|
+
"value": {
|
|
201
|
+
"@id": "undefineds:dist/http/ClusterIngressRouter.jsonld#ClusterIngressRouter_options_repository"
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"keyRaw": "clusterIngressDomain",
|
|
206
|
+
"value": {
|
|
207
|
+
"@id": "undefineds:dist/http/ClusterIngressRouter.jsonld#ClusterIngressRouter_options_clusterIngressDomain"
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"keyRaw": "skipAuthRedirect",
|
|
212
|
+
"value": {
|
|
213
|
+
"@id": "undefineds:dist/http/ClusterIngressRouter.jsonld#ClusterIngressRouter_options_skipAuthRedirect"
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
"keyRaw": "fetchImpl",
|
|
218
|
+
"value": {
|
|
219
|
+
"@id": "undefineds:dist/http/ClusterIngressRouter.jsonld#ClusterIngressRouter_options_fetchImpl"
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
]
|
|
223
|
+
}
|
|
224
|
+
]
|
|
225
|
+
}
|
|
226
|
+
]
|
|
227
|
+
}
|