@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,918 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* QuintQuerySource - IQuerySource implementation for QuintStore
|
|
4
|
+
*
|
|
5
|
+
* This implements Comunica's IQuerySource interface to enable proper FILTER pushdown.
|
|
6
|
+
* Unlike RDF.Store.match() which only receives 4 terms, IQuerySource.queryBindings()
|
|
7
|
+
* receives the full SPARQL algebra including FILTER expressions.
|
|
8
|
+
*
|
|
9
|
+
* Design:
|
|
10
|
+
* - Delegates filter extraction to FilterPushdownExtractor
|
|
11
|
+
* - Delegates pattern building to PatternBuilder
|
|
12
|
+
* - Delegates in-memory evaluation to ExpressionEvaluator
|
|
13
|
+
* - Coordinates these components to execute queries efficiently
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.QuintQuerySource = void 0;
|
|
17
|
+
const asynciterator_1 = require("asynciterator");
|
|
18
|
+
const sparqlalgebrajs_1 = require("sparqlalgebrajs");
|
|
19
|
+
const rdf_data_factory_1 = require("rdf-data-factory");
|
|
20
|
+
const FilterPushdownExtractor_1 = require("./FilterPushdownExtractor");
|
|
21
|
+
const PatternBuilder_1 = require("./PatternBuilder");
|
|
22
|
+
const ExpressionEvaluator_1 = require("./ExpressionEvaluator");
|
|
23
|
+
const AlgebraUtils_1 = require("./AlgebraUtils");
|
|
24
|
+
const serialization_1 = require("../quint/serialization");
|
|
25
|
+
const dataFactory = new rdf_data_factory_1.DataFactory();
|
|
26
|
+
/**
|
|
27
|
+
* QuintQuerySource implements IQuerySource for QuintStore
|
|
28
|
+
*
|
|
29
|
+
* Key features:
|
|
30
|
+
* 1. Declares support for FILTER operations via getSelectorShape()
|
|
31
|
+
* 2. Receives full SPARQL algebra in queryBindings() including FILTERs
|
|
32
|
+
* 3. Extracts filter conditions and pushes them down to QuintStore
|
|
33
|
+
* 4. Applies security filters (ACL) unconditionally
|
|
34
|
+
* 5. Tree-based evaluation for remaining non-pushdownable expressions
|
|
35
|
+
*/
|
|
36
|
+
class QuintQuerySource {
|
|
37
|
+
constructor(store, options) {
|
|
38
|
+
this.store = store;
|
|
39
|
+
this.referenceValue = store; // Reference for source identification
|
|
40
|
+
this.debug = options.debug ?? false;
|
|
41
|
+
this.bindingsFactory = options.bindingsFactory;
|
|
42
|
+
this.getSecurityFilters = options.getSecurityFilters;
|
|
43
|
+
this.getOptimizeParams = options.getOptimizeParams;
|
|
44
|
+
this.getFilterExpression = options.getFilterExpression;
|
|
45
|
+
// Initialize delegate components
|
|
46
|
+
this.filterExtractor = new FilterPushdownExtractor_1.FilterPushdownExtractor();
|
|
47
|
+
this.patternBuilder = new PatternBuilder_1.PatternBuilder(this.getSecurityFilters);
|
|
48
|
+
this.expressionEvaluator = new ExpressionEvaluator_1.ExpressionEvaluator(store, this.patternBuilder, this.extractPatternAndFilter.bind(this));
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Declare the operations this source supports
|
|
52
|
+
*
|
|
53
|
+
* We support:
|
|
54
|
+
* - Basic quad patterns (for simple queries)
|
|
55
|
+
* - FILTER operations (for filter pushdown)
|
|
56
|
+
* - BGP operations (for multi-pattern queries)
|
|
57
|
+
* - joinBindings: allows Comunica to push JOIN operations down to us
|
|
58
|
+
*
|
|
59
|
+
* The joinBindings support enables ActorRdfJoinMultiBindSource to push
|
|
60
|
+
* multiple patterns to us efficiently, using SQL JOINs instead of
|
|
61
|
+
* Comunica's nested loop approach.
|
|
62
|
+
*/
|
|
63
|
+
async getSelectorShape(_context) {
|
|
64
|
+
// Check if store supports compound queries
|
|
65
|
+
const supportsCompound = !!this.store.getCompound;
|
|
66
|
+
return {
|
|
67
|
+
type: 'disjunction',
|
|
68
|
+
children: [
|
|
69
|
+
// Support basic patterns with joinBindings
|
|
70
|
+
{
|
|
71
|
+
type: 'operation',
|
|
72
|
+
operation: {
|
|
73
|
+
operationType: 'pattern',
|
|
74
|
+
pattern: {
|
|
75
|
+
type: 'pattern',
|
|
76
|
+
subject: dataFactory.variable('s'),
|
|
77
|
+
predicate: dataFactory.variable('p'),
|
|
78
|
+
object: dataFactory.variable('o'),
|
|
79
|
+
graph: dataFactory.variable('g'),
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
variablesOptional: [
|
|
83
|
+
dataFactory.variable('s'),
|
|
84
|
+
dataFactory.variable('p'),
|
|
85
|
+
dataFactory.variable('o'),
|
|
86
|
+
dataFactory.variable('g'),
|
|
87
|
+
],
|
|
88
|
+
// Allow Comunica to push join bindings to us
|
|
89
|
+
...(supportsCompound ? { joinBindings: true } : {}),
|
|
90
|
+
},
|
|
91
|
+
// Support BGP operations (multi-pattern queries)
|
|
92
|
+
{
|
|
93
|
+
type: 'operation',
|
|
94
|
+
operation: {
|
|
95
|
+
operationType: 'type',
|
|
96
|
+
type: sparqlalgebrajs_1.Algebra.types.BGP,
|
|
97
|
+
},
|
|
98
|
+
...(supportsCompound ? { joinBindings: true } : {}),
|
|
99
|
+
},
|
|
100
|
+
// Support FILTER operations
|
|
101
|
+
{
|
|
102
|
+
type: 'operation',
|
|
103
|
+
operation: {
|
|
104
|
+
operationType: 'type',
|
|
105
|
+
type: sparqlalgebrajs_1.Algebra.types.FILTER,
|
|
106
|
+
},
|
|
107
|
+
...(supportsCompound ? { joinBindings: true } : {}),
|
|
108
|
+
},
|
|
109
|
+
// Support JOIN operations (for receiving compound queries from Comunica)
|
|
110
|
+
{
|
|
111
|
+
type: 'operation',
|
|
112
|
+
operation: {
|
|
113
|
+
operationType: 'type',
|
|
114
|
+
type: sparqlalgebrajs_1.Algebra.types.JOIN,
|
|
115
|
+
},
|
|
116
|
+
...(supportsCompound ? { joinBindings: true } : {}),
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Query bindings - main entry point for SPARQL queries
|
|
123
|
+
*
|
|
124
|
+
* When Comunica's ActorRdfJoinMultiBindSource selects us for a join operation,
|
|
125
|
+
* it passes options.joinBindings containing bindings from the first pattern.
|
|
126
|
+
* We need to use these bindings to filter our query results efficiently.
|
|
127
|
+
*/
|
|
128
|
+
queryBindings(operation, _context, options) {
|
|
129
|
+
if (this.debug) {
|
|
130
|
+
console.log(`[QuintQuerySource] queryBindings() called with operation type: ${operation.type}`);
|
|
131
|
+
console.log(`[QuintQuerySource] Has joinBindings: ${!!options?.joinBindings}`);
|
|
132
|
+
console.log(`[QuintQuerySource] Has filterBindings: ${!!options?.filterBindings}`);
|
|
133
|
+
// Log operation structure
|
|
134
|
+
if (operation.type === 'join' && operation.input) {
|
|
135
|
+
console.log(`[QuintQuerySource] JOIN inputs: ${operation.input?.length || 0}`);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
// Wrap async execution in an iterator using wrap()
|
|
139
|
+
const variables = this.getVariablesFromOperation(operation);
|
|
140
|
+
const resultIterator = (0, asynciterator_1.wrap)(this.executeQuery(operation, options).then(results => results));
|
|
141
|
+
// Add metadata for Comunica
|
|
142
|
+
// Variables must be in format { variable: Variable, canBeUndef: boolean }
|
|
143
|
+
const variablesMetadata = variables.map(v => ({ variable: v, canBeUndef: false }));
|
|
144
|
+
resultIterator.setProperty('metadata', {
|
|
145
|
+
state: { invalidate: () => { }, invalid: false, addInvalidateListener: () => { } },
|
|
146
|
+
cardinality: { type: 'estimate', value: Number.POSITIVE_INFINITY },
|
|
147
|
+
variables: variablesMetadata,
|
|
148
|
+
});
|
|
149
|
+
return resultIterator;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Execute query and return bindings
|
|
153
|
+
*
|
|
154
|
+
* If options.joinBindings is provided, we need to:
|
|
155
|
+
* 1. Collect bindings from the stream (these are from the first pattern in the JOIN)
|
|
156
|
+
* 2. Extract variable values that overlap with our patterns
|
|
157
|
+
* 3. Use those values as IN conditions in our query
|
|
158
|
+
* 4. JOIN the results with the incoming bindings
|
|
159
|
+
*/
|
|
160
|
+
async executeQuery(operation, options) {
|
|
161
|
+
// Handle joinBindings from Comunica (bind join)
|
|
162
|
+
if (options?.joinBindings && this.store.getCompound) {
|
|
163
|
+
return this.executeBindJoin(operation, options.joinBindings);
|
|
164
|
+
}
|
|
165
|
+
const { pattern, patterns, filter } = this.extractPatternAndFilter(operation);
|
|
166
|
+
// Check if we can use compound query (multiple patterns with same subject variable)
|
|
167
|
+
if (patterns && patterns.length > 1 && this.store.getCompound) {
|
|
168
|
+
const compoundResult = await this.tryCompoundQuery(patterns, filter, operation);
|
|
169
|
+
if (compoundResult) {
|
|
170
|
+
return compoundResult;
|
|
171
|
+
}
|
|
172
|
+
// Fall back to single pattern execution if compound query not applicable
|
|
173
|
+
}
|
|
174
|
+
const variables = (0, AlgebraUtils_1.extractVariables)(pattern);
|
|
175
|
+
// Try to get pre-extracted filter expressions for variables in this pattern
|
|
176
|
+
let combinedFilter = filter;
|
|
177
|
+
if (this.getFilterExpression && !filter) {
|
|
178
|
+
// Check if any variable in the pattern has a pre-extracted filter
|
|
179
|
+
for (const variable of variables) {
|
|
180
|
+
const preExtractedFilter = this.getFilterExpression(variable.value);
|
|
181
|
+
if (preExtractedFilter) {
|
|
182
|
+
if (this.debug) {
|
|
183
|
+
console.log(`[QuintQuerySource] Found pre-extracted filter for ?${variable.value}`);
|
|
184
|
+
}
|
|
185
|
+
if (combinedFilter) {
|
|
186
|
+
// Combine with AND
|
|
187
|
+
combinedFilter = {
|
|
188
|
+
type: 'expression',
|
|
189
|
+
expressionType: 'operator',
|
|
190
|
+
operator: '&&',
|
|
191
|
+
args: [combinedFilter, preExtractedFilter],
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
combinedFilter = preExtractedFilter;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
// Extract pushdownable filters
|
|
201
|
+
let pushdownFilters = {};
|
|
202
|
+
let remainder = combinedFilter;
|
|
203
|
+
let orBranches;
|
|
204
|
+
let orNonPushdownBranches;
|
|
205
|
+
if (combinedFilter) {
|
|
206
|
+
const result = this.filterExtractor.extractPushdownFilters(combinedFilter, pattern);
|
|
207
|
+
pushdownFilters = result.filters;
|
|
208
|
+
remainder = result.remainder;
|
|
209
|
+
orBranches = result.orBranches;
|
|
210
|
+
orNonPushdownBranches = result.orNonPushdownBranches;
|
|
211
|
+
}
|
|
212
|
+
if (this.debug) {
|
|
213
|
+
console.log(`[QuintQuerySource] Pushdown filters:`, JSON.stringify(pushdownFilters, null, 2));
|
|
214
|
+
console.log(`[QuintQuerySource] OR branches:`, orBranches?.length || 0);
|
|
215
|
+
console.log(`[QuintQuerySource] OR non-pushdown branches:`, orNonPushdownBranches?.length || 0);
|
|
216
|
+
console.log(`[QuintQuerySource] Has remainder:`, remainder !== null);
|
|
217
|
+
}
|
|
218
|
+
// Get query options
|
|
219
|
+
// NOTE: Comunica handles OFFSET, we only pass limit to QuintStore
|
|
220
|
+
// If there's an offset, we need to fetch limit + offset records
|
|
221
|
+
// and let Comunica skip the first `offset` records
|
|
222
|
+
const optimizeParams = this.getOptimizeParams();
|
|
223
|
+
const queryOptions = {};
|
|
224
|
+
if (optimizeParams?.limit) {
|
|
225
|
+
// Fetch enough records for Comunica to apply offset
|
|
226
|
+
queryOptions.limit = optimizeParams.limit + (optimizeParams.offset || 0);
|
|
227
|
+
}
|
|
228
|
+
// Don't pass offset to QuintStore - Comunica handles it
|
|
229
|
+
// 处理 ORDER BY 下推
|
|
230
|
+
if (optimizeParams?.order) {
|
|
231
|
+
// 直接使用已映射的 order
|
|
232
|
+
queryOptions.order = optimizeParams.order;
|
|
233
|
+
}
|
|
234
|
+
else if (optimizeParams?.orderVarName) {
|
|
235
|
+
// 通过 pattern 分析变量绑定位置
|
|
236
|
+
const orderField = this.findVariableBinding(optimizeParams.orderVarName, pattern);
|
|
237
|
+
if (orderField) {
|
|
238
|
+
queryOptions.order = [orderField];
|
|
239
|
+
if (this.debug) {
|
|
240
|
+
console.log(`[QuintQuerySource] ORDER BY ?${optimizeParams.orderVarName} -> ${orderField} (via pattern analysis)`);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
if (optimizeParams?.reverse)
|
|
245
|
+
queryOptions.reverse = optimizeParams.reverse;
|
|
246
|
+
let results;
|
|
247
|
+
// Handle OR branches (union semantics)
|
|
248
|
+
if (orBranches && orBranches.length > 0) {
|
|
249
|
+
results = await this.executeOrBranches(pattern, variables, orBranches, orNonPushdownBranches, queryOptions);
|
|
250
|
+
if (this.debug) {
|
|
251
|
+
console.log(`[QuintQuerySource] OR pushdown branches returned ${results.length} unique results`);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
else if (Object.keys(pushdownFilters).length > 0) {
|
|
255
|
+
// Build pattern with pushdown filters
|
|
256
|
+
const quintPattern = this.patternBuilder.buildQuintPattern(pattern, pushdownFilters);
|
|
257
|
+
const quads = await this.store.get(quintPattern, queryOptions);
|
|
258
|
+
results = this.quadsToBindings(quads, variables, pattern);
|
|
259
|
+
if (this.debug) {
|
|
260
|
+
console.log(`[QuintQuerySource] Pushdown query returned ${results.length} results`);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
else {
|
|
264
|
+
// No pushdown, get all matching quads
|
|
265
|
+
const quintPattern = this.patternBuilder.buildBasePattern(pattern);
|
|
266
|
+
const quads = await this.store.get(quintPattern, queryOptions);
|
|
267
|
+
results = this.quadsToBindings(quads, variables, pattern);
|
|
268
|
+
if (this.debug) {
|
|
269
|
+
console.log(`[QuintQuerySource] Base query returned ${results.length} results`);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
// NOTE: We don't apply in-memory filter for pre-extracted filters
|
|
273
|
+
// because Comunica will handle the final filtering after JOIN
|
|
274
|
+
// Only apply remainder if it's from the original operation's filter
|
|
275
|
+
if (remainder && filter) {
|
|
276
|
+
results = await this.expressionEvaluator.evaluateFilterTree(remainder, results, pattern);
|
|
277
|
+
if (this.debug) {
|
|
278
|
+
console.log(`[QuintQuerySource] After in-memory filter: ${results.length} results`);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
return results;
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Execute a bind join: use incoming bindings to filter our query
|
|
285
|
+
*
|
|
286
|
+
* This is called when Comunica's ActorRdfJoinMultiBindSource pushes bindings to us.
|
|
287
|
+
* We use SQL IN clause to efficiently query only the rows matching the incoming bindings.
|
|
288
|
+
*/
|
|
289
|
+
async executeBindJoin(operation, joinBindings) {
|
|
290
|
+
// Collect all incoming bindings
|
|
291
|
+
const incomingBindings = [];
|
|
292
|
+
for await (const binding of joinBindings.bindings) {
|
|
293
|
+
incomingBindings.push(binding);
|
|
294
|
+
}
|
|
295
|
+
if (this.debug) {
|
|
296
|
+
console.log(`[QuintQuerySource] executeBindJoin: received ${incomingBindings.length} bindings`);
|
|
297
|
+
}
|
|
298
|
+
if (incomingBindings.length === 0) {
|
|
299
|
+
return [];
|
|
300
|
+
}
|
|
301
|
+
// Extract patterns from the operation
|
|
302
|
+
const { pattern, patterns, filter } = this.extractPatternAndFilter(operation);
|
|
303
|
+
const allPatterns = patterns || [pattern];
|
|
304
|
+
// Find overlapping variables between incoming bindings and our patterns
|
|
305
|
+
// These are the JOIN keys
|
|
306
|
+
const incomingVars = new Set();
|
|
307
|
+
const firstBinding = incomingBindings[0];
|
|
308
|
+
for (const key of firstBinding.keys()) {
|
|
309
|
+
incomingVars.add(key.value);
|
|
310
|
+
}
|
|
311
|
+
// Find which pattern variables overlap with incoming bindings
|
|
312
|
+
// Typically this would be the subject variable
|
|
313
|
+
const patternVars = new Map();
|
|
314
|
+
for (let i = 0; i < allPatterns.length; i++) {
|
|
315
|
+
const p = allPatterns[i];
|
|
316
|
+
if (p.subject?.termType === 'Variable' && incomingVars.has(p.subject.value)) {
|
|
317
|
+
patternVars.set(p.subject.value, { patternIdx: i, field: 'subject' });
|
|
318
|
+
}
|
|
319
|
+
if (p.predicate?.termType === 'Variable' && incomingVars.has(p.predicate.value)) {
|
|
320
|
+
patternVars.set(p.predicate.value, { patternIdx: i, field: 'predicate' });
|
|
321
|
+
}
|
|
322
|
+
if (p.object?.termType === 'Variable' && incomingVars.has(p.object.value)) {
|
|
323
|
+
patternVars.set(p.object.value, { patternIdx: i, field: 'object' });
|
|
324
|
+
}
|
|
325
|
+
if (p.graph?.termType === 'Variable' && incomingVars.has(p.graph.value)) {
|
|
326
|
+
patternVars.set(p.graph.value, { patternIdx: i, field: 'graph' });
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
if (this.debug) {
|
|
330
|
+
console.log(`[QuintQuerySource] Overlapping variables:`, [...patternVars.keys()]);
|
|
331
|
+
}
|
|
332
|
+
if (patternVars.size === 0) {
|
|
333
|
+
// No overlapping variables - just execute normally and return cartesian product
|
|
334
|
+
// This shouldn't happen in typical use cases
|
|
335
|
+
const results = await this.executeQuery(operation);
|
|
336
|
+
return this.cartesianJoin(incomingBindings, results);
|
|
337
|
+
}
|
|
338
|
+
// Use the first overlapping variable as the join key
|
|
339
|
+
const [joinVarName, joinInfo] = [...patternVars.entries()][0];
|
|
340
|
+
// Collect unique values for the join variable from incoming bindings
|
|
341
|
+
const joinValues = new Set();
|
|
342
|
+
for (const binding of incomingBindings) {
|
|
343
|
+
const term = binding.get(dataFactory.variable(joinVarName));
|
|
344
|
+
if (term) {
|
|
345
|
+
joinValues.add(term.value);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
if (this.debug) {
|
|
349
|
+
console.log(`[QuintQuerySource] Join variable: ?${joinVarName}, ${joinValues.size} unique values`);
|
|
350
|
+
}
|
|
351
|
+
// Build compound query with IN filter on join variable
|
|
352
|
+
if (allPatterns.length > 1) {
|
|
353
|
+
// Multiple patterns - use compound query
|
|
354
|
+
return this.executeBindJoinCompound(allPatterns, filter, joinVarName, joinInfo.field, [...joinValues], incomingBindings);
|
|
355
|
+
}
|
|
356
|
+
else {
|
|
357
|
+
// Single pattern - use simple query with IN filter
|
|
358
|
+
return this.executeBindJoinSimple(pattern, filter, joinVarName, joinInfo.field, [...joinValues], incomingBindings);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* Execute bind join for a single pattern using IN filter
|
|
363
|
+
*/
|
|
364
|
+
async executeBindJoinSimple(pattern, filter, joinVarName, joinField, joinValues, incomingBindings) {
|
|
365
|
+
const variables = (0, AlgebraUtils_1.extractVariables)(pattern);
|
|
366
|
+
// Build pattern with IN filter for join values
|
|
367
|
+
let pushdownFilters = {};
|
|
368
|
+
if (filter) {
|
|
369
|
+
const result = this.filterExtractor.extractPushdownFilters(filter, pattern);
|
|
370
|
+
pushdownFilters = result.filters;
|
|
371
|
+
}
|
|
372
|
+
// Add IN filter for join values
|
|
373
|
+
pushdownFilters[joinField] = {
|
|
374
|
+
...pushdownFilters[joinField],
|
|
375
|
+
$in: joinValues,
|
|
376
|
+
};
|
|
377
|
+
const quintPattern = this.patternBuilder.buildQuintPattern(pattern, pushdownFilters);
|
|
378
|
+
const quads = await this.store.get(quintPattern);
|
|
379
|
+
const queryResults = this.quadsToBindings(quads, variables, pattern);
|
|
380
|
+
if (this.debug) {
|
|
381
|
+
console.log(`[QuintQuerySource] Bind join simple: ${queryResults.length} results from DB`);
|
|
382
|
+
}
|
|
383
|
+
// Join with incoming bindings
|
|
384
|
+
return this.hashJoin(incomingBindings, queryResults, joinVarName);
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Execute bind join for multiple patterns using compound query
|
|
388
|
+
*/
|
|
389
|
+
async executeBindJoinCompound(patterns, filter, joinVarName, joinField, joinValues, incomingBindings) {
|
|
390
|
+
// Build QuintPattern for each pattern
|
|
391
|
+
const quintPatterns = [];
|
|
392
|
+
const filtersByPattern = this.distributeFiltersToPatterns(filter, patterns);
|
|
393
|
+
for (let i = 0; i < patterns.length; i++) {
|
|
394
|
+
const pattern = patterns[i];
|
|
395
|
+
const patternFilters = filtersByPattern.get(i) || {};
|
|
396
|
+
// Add IN filter for join values on the first pattern
|
|
397
|
+
if (i === 0) {
|
|
398
|
+
patternFilters[joinField] = {
|
|
399
|
+
...patternFilters[joinField],
|
|
400
|
+
$in: joinValues,
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
const quintPattern = this.patternBuilder.buildQuintPattern(pattern, patternFilters);
|
|
404
|
+
quintPatterns.push(quintPattern);
|
|
405
|
+
}
|
|
406
|
+
// Build compound pattern
|
|
407
|
+
const compound = {
|
|
408
|
+
patterns: quintPatterns,
|
|
409
|
+
joinOn: joinField,
|
|
410
|
+
select: this.buildSelectForPatterns(patterns),
|
|
411
|
+
};
|
|
412
|
+
const results = await this.store.getCompound(compound);
|
|
413
|
+
const queryResults = this.compoundResultsToBindings(results, patterns);
|
|
414
|
+
if (this.debug) {
|
|
415
|
+
console.log(`[QuintQuerySource] Bind join compound: ${queryResults.length} results from DB`);
|
|
416
|
+
}
|
|
417
|
+
// Join with incoming bindings
|
|
418
|
+
return this.hashJoin(incomingBindings, queryResults, joinVarName);
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* Hash join two binding sets on a common variable
|
|
422
|
+
*/
|
|
423
|
+
hashJoin(left, right, joinVarName) {
|
|
424
|
+
// Build hash table on right side
|
|
425
|
+
const rightIndex = new Map();
|
|
426
|
+
const joinVar = dataFactory.variable(joinVarName);
|
|
427
|
+
for (const binding of right) {
|
|
428
|
+
const term = binding.get(joinVar);
|
|
429
|
+
if (term) {
|
|
430
|
+
const key = term.value;
|
|
431
|
+
if (!rightIndex.has(key)) {
|
|
432
|
+
rightIndex.set(key, []);
|
|
433
|
+
}
|
|
434
|
+
rightIndex.get(key).push(binding);
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
// Probe with left side
|
|
438
|
+
const results = [];
|
|
439
|
+
for (const leftBinding of left) {
|
|
440
|
+
const term = leftBinding.get(joinVar);
|
|
441
|
+
if (term) {
|
|
442
|
+
const key = term.value;
|
|
443
|
+
const matches = rightIndex.get(key);
|
|
444
|
+
if (matches) {
|
|
445
|
+
for (const rightBinding of matches) {
|
|
446
|
+
// Merge bindings
|
|
447
|
+
const merged = this.mergeBindings(leftBinding, rightBinding);
|
|
448
|
+
if (merged) {
|
|
449
|
+
results.push(merged);
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
return results;
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* Merge two bindings, returning null if they conflict
|
|
459
|
+
*/
|
|
460
|
+
mergeBindings(left, right) {
|
|
461
|
+
const entries = [];
|
|
462
|
+
// Add all from left
|
|
463
|
+
for (const key of left.keys()) {
|
|
464
|
+
const term = left.get(key);
|
|
465
|
+
if (term) {
|
|
466
|
+
entries.push([key, term]);
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
// Add from right, checking for conflicts
|
|
470
|
+
for (const key of right.keys()) {
|
|
471
|
+
const rightTerm = right.get(key);
|
|
472
|
+
const leftTerm = left.get(key);
|
|
473
|
+
if (rightTerm) {
|
|
474
|
+
if (leftTerm) {
|
|
475
|
+
// Both have this variable - must match
|
|
476
|
+
if (leftTerm.value !== rightTerm.value || leftTerm.termType !== rightTerm.termType) {
|
|
477
|
+
return null; // Conflict
|
|
478
|
+
}
|
|
479
|
+
// Same value, already in entries
|
|
480
|
+
}
|
|
481
|
+
else {
|
|
482
|
+
// Only right has it
|
|
483
|
+
entries.push([key, rightTerm]);
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
return this.bindingsFactory.bindings(entries);
|
|
488
|
+
}
|
|
489
|
+
/**
|
|
490
|
+
* Cartesian product of two binding sets
|
|
491
|
+
*/
|
|
492
|
+
cartesianJoin(left, right) {
|
|
493
|
+
const results = [];
|
|
494
|
+
for (const l of left) {
|
|
495
|
+
for (const r of right) {
|
|
496
|
+
const merged = this.mergeBindings(l, r);
|
|
497
|
+
if (merged) {
|
|
498
|
+
results.push(merged);
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
return results;
|
|
503
|
+
}
|
|
504
|
+
/**
|
|
505
|
+
* Execute OR branches with union semantics
|
|
506
|
+
*/
|
|
507
|
+
async executeOrBranches(pattern, variables, orBranches, orNonPushdownBranches, queryOptions) {
|
|
508
|
+
const seen = new Set();
|
|
509
|
+
const results = [];
|
|
510
|
+
// Execute each pushdownable branch
|
|
511
|
+
for (const branchFilters of orBranches) {
|
|
512
|
+
const quintPattern = this.patternBuilder.buildQuintPattern(pattern, branchFilters);
|
|
513
|
+
const quads = await this.store.get(quintPattern, queryOptions);
|
|
514
|
+
const bindings = this.quadsToBindings(quads, variables, pattern);
|
|
515
|
+
for (const binding of bindings) {
|
|
516
|
+
const key = this.expressionEvaluator.getBindingKey(binding);
|
|
517
|
+
if (!seen.has(key)) {
|
|
518
|
+
seen.add(key);
|
|
519
|
+
results.push(binding);
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
// Handle non-pushdownable OR branches
|
|
524
|
+
if (orNonPushdownBranches && orNonPushdownBranches.length > 0) {
|
|
525
|
+
// Get base results without filter for in-memory evaluation
|
|
526
|
+
const quintPattern = this.patternBuilder.buildBasePattern(pattern);
|
|
527
|
+
const quads = await this.store.get(quintPattern, queryOptions);
|
|
528
|
+
const candidates = this.quadsToBindings(quads, variables, pattern);
|
|
529
|
+
// Evaluate each non-pushdownable branch
|
|
530
|
+
for (const branchExpr of orNonPushdownBranches) {
|
|
531
|
+
const branchResults = await this.expressionEvaluator.evaluateFilterTree(branchExpr, candidates, pattern);
|
|
532
|
+
for (const binding of branchResults) {
|
|
533
|
+
const key = this.expressionEvaluator.getBindingKey(binding);
|
|
534
|
+
if (!seen.has(key)) {
|
|
535
|
+
seen.add(key);
|
|
536
|
+
results.push(binding);
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
return results;
|
|
542
|
+
}
|
|
543
|
+
/**
|
|
544
|
+
* Try to execute a compound query for multiple patterns joined by same subject
|
|
545
|
+
* Returns null if compound query is not applicable
|
|
546
|
+
*/
|
|
547
|
+
async tryCompoundQuery(patterns, filter, _operation) {
|
|
548
|
+
// Check if all patterns share the same subject variable
|
|
549
|
+
const subjectVars = patterns.map(p => p.subject?.termType === 'Variable' ? p.subject.value : null);
|
|
550
|
+
const uniqueSubjectVars = [...new Set(subjectVars.filter(v => v !== null))];
|
|
551
|
+
if (uniqueSubjectVars.length !== 1) {
|
|
552
|
+
// Not all patterns share the same subject variable
|
|
553
|
+
if (this.debug) {
|
|
554
|
+
console.log(`[QuintQuerySource] Cannot use compound query: different subject variables`, subjectVars);
|
|
555
|
+
}
|
|
556
|
+
return null;
|
|
557
|
+
}
|
|
558
|
+
const joinVar = uniqueSubjectVars[0];
|
|
559
|
+
if (this.debug) {
|
|
560
|
+
console.log(`[QuintQuerySource] Using compound query with ${patterns.length} patterns, joined on ?${joinVar}`);
|
|
561
|
+
}
|
|
562
|
+
// Build QuintPattern for each pattern, including filter conditions
|
|
563
|
+
const quintPatterns = [];
|
|
564
|
+
const filtersByPattern = this.distributeFiltersToPatterns(filter, patterns);
|
|
565
|
+
for (let i = 0; i < patterns.length; i++) {
|
|
566
|
+
const pattern = patterns[i];
|
|
567
|
+
const patternFilters = filtersByPattern.get(i) || {};
|
|
568
|
+
const quintPattern = this.patternBuilder.buildQuintPattern(pattern, patternFilters);
|
|
569
|
+
quintPatterns.push(quintPattern);
|
|
570
|
+
}
|
|
571
|
+
// Build compound pattern
|
|
572
|
+
const compound = {
|
|
573
|
+
patterns: quintPatterns,
|
|
574
|
+
joinOn: 'subject',
|
|
575
|
+
select: this.buildSelectForPatterns(patterns),
|
|
576
|
+
};
|
|
577
|
+
// Execute compound query
|
|
578
|
+
const optimizeParams = this.getOptimizeParams();
|
|
579
|
+
const queryOptions = {};
|
|
580
|
+
if (optimizeParams?.limit) {
|
|
581
|
+
queryOptions.limit = optimizeParams.limit + (optimizeParams.offset || 0);
|
|
582
|
+
}
|
|
583
|
+
const results = await this.store.getCompound(compound, queryOptions);
|
|
584
|
+
// Convert CompoundResult to Bindings
|
|
585
|
+
return this.compoundResultsToBindings(results, patterns);
|
|
586
|
+
}
|
|
587
|
+
/**
|
|
588
|
+
* Distribute filter conditions to their respective patterns
|
|
589
|
+
* Returns a map of pattern index -> PushdownFilters
|
|
590
|
+
*/
|
|
591
|
+
distributeFiltersToPatterns(filter, patterns) {
|
|
592
|
+
const result = new Map();
|
|
593
|
+
if (!filter)
|
|
594
|
+
return result;
|
|
595
|
+
// Build a map of variable name to pattern index
|
|
596
|
+
const varToPatternIdx = new Map();
|
|
597
|
+
for (let i = 0; i < patterns.length; i++) {
|
|
598
|
+
const p = patterns[i];
|
|
599
|
+
if (p.object?.termType === 'Variable') {
|
|
600
|
+
varToPatternIdx.set(p.object.value, i);
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
// Extract filters and distribute them
|
|
604
|
+
for (let i = 0; i < patterns.length; i++) {
|
|
605
|
+
const patternResult = this.filterExtractor.extractPushdownFilters(filter, patterns[i]);
|
|
606
|
+
if (Object.keys(patternResult.filters).length > 0) {
|
|
607
|
+
result.set(i, patternResult.filters);
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
return result;
|
|
611
|
+
}
|
|
612
|
+
/**
|
|
613
|
+
* Build SELECT clause config for patterns
|
|
614
|
+
*/
|
|
615
|
+
buildSelectForPatterns(patterns) {
|
|
616
|
+
const select = [];
|
|
617
|
+
for (let i = 0; i < patterns.length; i++) {
|
|
618
|
+
const p = patterns[i];
|
|
619
|
+
// Select object if it's a variable
|
|
620
|
+
if (p.object?.termType === 'Variable') {
|
|
621
|
+
select.push({
|
|
622
|
+
pattern: i,
|
|
623
|
+
field: 'object',
|
|
624
|
+
alias: `p${i}_${p.object.value}`,
|
|
625
|
+
});
|
|
626
|
+
}
|
|
627
|
+
// Select predicate if it's a variable
|
|
628
|
+
if (p.predicate?.termType === 'Variable') {
|
|
629
|
+
select.push({
|
|
630
|
+
pattern: i,
|
|
631
|
+
field: 'predicate',
|
|
632
|
+
alias: `p${i}_${p.predicate.value}`,
|
|
633
|
+
});
|
|
634
|
+
}
|
|
635
|
+
// Select graph if it's a variable
|
|
636
|
+
if (p.graph?.termType === 'Variable') {
|
|
637
|
+
select.push({
|
|
638
|
+
pattern: i,
|
|
639
|
+
field: 'graph',
|
|
640
|
+
alias: `p${i}_${p.graph.value}`,
|
|
641
|
+
});
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
return select;
|
|
645
|
+
}
|
|
646
|
+
/**
|
|
647
|
+
* Convert CompoundResult array to Bindings array
|
|
648
|
+
*/
|
|
649
|
+
compoundResultsToBindings(results, patterns) {
|
|
650
|
+
// Collect all variables from all patterns
|
|
651
|
+
const variables = [];
|
|
652
|
+
const varNames = new Set();
|
|
653
|
+
for (const p of patterns) {
|
|
654
|
+
if (p.subject?.termType === 'Variable' && !varNames.has(p.subject.value)) {
|
|
655
|
+
variables.push(p.subject);
|
|
656
|
+
varNames.add(p.subject.value);
|
|
657
|
+
}
|
|
658
|
+
if (p.predicate?.termType === 'Variable' && !varNames.has(p.predicate.value)) {
|
|
659
|
+
variables.push(p.predicate);
|
|
660
|
+
varNames.add(p.predicate.value);
|
|
661
|
+
}
|
|
662
|
+
if (p.object?.termType === 'Variable' && !varNames.has(p.object.value)) {
|
|
663
|
+
variables.push(p.object);
|
|
664
|
+
varNames.add(p.object.value);
|
|
665
|
+
}
|
|
666
|
+
if (p.graph?.termType === 'Variable' && !varNames.has(p.graph.value)) {
|
|
667
|
+
variables.push(p.graph);
|
|
668
|
+
varNames.add(p.graph.value);
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
return results.map(result => {
|
|
672
|
+
const entries = [];
|
|
673
|
+
for (const v of variables) {
|
|
674
|
+
const varName = v.value;
|
|
675
|
+
// Check if this is the join variable (subject)
|
|
676
|
+
if (patterns[0].subject?.termType === 'Variable' &&
|
|
677
|
+
patterns[0].subject.value === varName) {
|
|
678
|
+
// Use joinValue for subject
|
|
679
|
+
const term = dataFactory.namedNode(result.joinValue);
|
|
680
|
+
entries.push([v, term]);
|
|
681
|
+
continue;
|
|
682
|
+
}
|
|
683
|
+
// Look for the variable in bindings
|
|
684
|
+
for (let i = 0; i < patterns.length; i++) {
|
|
685
|
+
const p = patterns[i];
|
|
686
|
+
if (p.object?.termType === 'Variable' && p.object.value === varName) {
|
|
687
|
+
const alias = `p${i}_${varName}`;
|
|
688
|
+
const value = result.bindings[alias];
|
|
689
|
+
if (value !== undefined) {
|
|
690
|
+
// Deserialize the value
|
|
691
|
+
const term = this.deserializeValue(value);
|
|
692
|
+
entries.push([v, term]);
|
|
693
|
+
break;
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
if (p.predicate?.termType === 'Variable' && p.predicate.value === varName) {
|
|
697
|
+
const alias = `p${i}_${varName}`;
|
|
698
|
+
const value = result.bindings[alias];
|
|
699
|
+
if (value !== undefined) {
|
|
700
|
+
const term = dataFactory.namedNode(value);
|
|
701
|
+
entries.push([v, term]);
|
|
702
|
+
break;
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
if (p.graph?.termType === 'Variable' && p.graph.value === varName) {
|
|
706
|
+
const alias = `p${i}_${varName}`;
|
|
707
|
+
const value = result.bindings[alias];
|
|
708
|
+
if (value !== undefined) {
|
|
709
|
+
const term = dataFactory.namedNode(value);
|
|
710
|
+
entries.push([v, term]);
|
|
711
|
+
break;
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
return this.bindingsFactory.bindings(entries);
|
|
717
|
+
});
|
|
718
|
+
}
|
|
719
|
+
/**
|
|
720
|
+
* Deserialize a value from storage format to RDF Term
|
|
721
|
+
* Uses the same deserialization logic as QuintStore
|
|
722
|
+
*/
|
|
723
|
+
deserializeValue(value) {
|
|
724
|
+
return (0, serialization_1.deserializeObject)(value);
|
|
725
|
+
}
|
|
726
|
+
/**
|
|
727
|
+
* Convert quads to bindings based on pattern variables
|
|
728
|
+
*/
|
|
729
|
+
quadsToBindings(quads, variables, pattern) {
|
|
730
|
+
if (this.debug) {
|
|
731
|
+
console.log(`[QuintQuerySource] quadsToBindings: ${quads.length} quads, ${variables.length} variables`);
|
|
732
|
+
console.log(`[QuintQuerySource] Variables:`, variables.map(v => v.value));
|
|
733
|
+
console.log(`[QuintQuerySource] Pattern:`, {
|
|
734
|
+
subject: pattern.subject?.termType === 'Variable' ? `?${pattern.subject.value}` : pattern.subject?.value,
|
|
735
|
+
predicate: pattern.predicate?.termType === 'Variable' ? `?${pattern.predicate.value}` : pattern.predicate?.value,
|
|
736
|
+
object: pattern.object?.termType === 'Variable' ? `?${pattern.object.value}` : pattern.object?.value,
|
|
737
|
+
graph: pattern.graph?.termType === 'Variable' ? `?${pattern.graph.value}` : pattern.graph?.value || pattern.graph?.termType,
|
|
738
|
+
});
|
|
739
|
+
}
|
|
740
|
+
return quads.map(quad => {
|
|
741
|
+
const entries = [];
|
|
742
|
+
for (const v of variables) {
|
|
743
|
+
const term = this.getTermForVariable(v, quad, pattern);
|
|
744
|
+
if (term) {
|
|
745
|
+
entries.push([v, term]);
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
if (this.debug && entries.length !== variables.length) {
|
|
749
|
+
console.log(`[QuintQuerySource] Warning: only ${entries.length} of ${variables.length} variables bound`);
|
|
750
|
+
}
|
|
751
|
+
return this.bindingsFactory.bindings(entries);
|
|
752
|
+
});
|
|
753
|
+
}
|
|
754
|
+
/**
|
|
755
|
+
* Get the term from quad that matches the variable position in pattern
|
|
756
|
+
*/
|
|
757
|
+
getTermForVariable(variable, quad, pattern) {
|
|
758
|
+
const varName = variable.value;
|
|
759
|
+
// Check which position in the pattern this variable is in
|
|
760
|
+
if (pattern.subject?.termType === 'Variable' && pattern.subject.value === varName) {
|
|
761
|
+
return quad.subject;
|
|
762
|
+
}
|
|
763
|
+
if (pattern.predicate?.termType === 'Variable' && pattern.predicate.value === varName) {
|
|
764
|
+
return quad.predicate;
|
|
765
|
+
}
|
|
766
|
+
if (pattern.object?.termType === 'Variable' && pattern.object.value === varName) {
|
|
767
|
+
return quad.object;
|
|
768
|
+
}
|
|
769
|
+
if (pattern.graph?.termType === 'Variable' && pattern.graph.value === varName) {
|
|
770
|
+
return quad.graph;
|
|
771
|
+
}
|
|
772
|
+
return null;
|
|
773
|
+
}
|
|
774
|
+
/**
|
|
775
|
+
* Extract BGP pattern and filter from operation
|
|
776
|
+
* Returns either a single pattern or multiple patterns (from BGP or JOIN)
|
|
777
|
+
*/
|
|
778
|
+
extractPatternAndFilter(operation) {
|
|
779
|
+
let pattern = null;
|
|
780
|
+
let patterns;
|
|
781
|
+
let filter = null;
|
|
782
|
+
// Walk the algebra tree to find pattern(s) and filter
|
|
783
|
+
sparqlalgebrajs_1.Util.recurseOperation(operation, {
|
|
784
|
+
[sparqlalgebrajs_1.Algebra.types.JOIN]: (op) => {
|
|
785
|
+
// JOIN contains multiple patterns - extract them all
|
|
786
|
+
if (op.input && op.input.length > 0) {
|
|
787
|
+
const extractedPatterns = [];
|
|
788
|
+
for (const input of op.input) {
|
|
789
|
+
if (input.type === sparqlalgebrajs_1.Algebra.types.PATTERN) {
|
|
790
|
+
extractedPatterns.push(input);
|
|
791
|
+
}
|
|
792
|
+
else {
|
|
793
|
+
// Recurse into nested operation to find patterns
|
|
794
|
+
const nested = this.extractPatternAndFilter(input);
|
|
795
|
+
if (nested.patterns) {
|
|
796
|
+
extractedPatterns.push(...nested.patterns);
|
|
797
|
+
}
|
|
798
|
+
else if (nested.pattern) {
|
|
799
|
+
extractedPatterns.push(nested.pattern);
|
|
800
|
+
}
|
|
801
|
+
// Also collect filter from nested operations
|
|
802
|
+
if (nested.filter && !filter) {
|
|
803
|
+
filter = nested.filter;
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
if (extractedPatterns.length > 0) {
|
|
808
|
+
patterns = extractedPatterns;
|
|
809
|
+
if (!pattern) {
|
|
810
|
+
pattern = patterns[0];
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
return false; // Don't recurse further
|
|
815
|
+
},
|
|
816
|
+
[sparqlalgebrajs_1.Algebra.types.BGP]: (op) => {
|
|
817
|
+
// BGP contains multiple patterns - this is what we want for compound queries
|
|
818
|
+
if (op.patterns && op.patterns.length > 0) {
|
|
819
|
+
patterns = op.patterns;
|
|
820
|
+
if (!pattern) {
|
|
821
|
+
pattern = patterns[0];
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
return false; // Don't recurse into individual patterns
|
|
825
|
+
},
|
|
826
|
+
[sparqlalgebrajs_1.Algebra.types.PATTERN]: (op) => {
|
|
827
|
+
if (!pattern)
|
|
828
|
+
pattern = op;
|
|
829
|
+
return false;
|
|
830
|
+
},
|
|
831
|
+
[sparqlalgebrajs_1.Algebra.types.FILTER]: (op) => {
|
|
832
|
+
filter = op.expression;
|
|
833
|
+
return true; // Continue to find pattern inside filter
|
|
834
|
+
},
|
|
835
|
+
});
|
|
836
|
+
if (!pattern) {
|
|
837
|
+
// Create empty pattern if none found
|
|
838
|
+
pattern = {
|
|
839
|
+
type: 'pattern',
|
|
840
|
+
subject: dataFactory.variable('s'),
|
|
841
|
+
predicate: dataFactory.variable('p'),
|
|
842
|
+
object: dataFactory.variable('o'),
|
|
843
|
+
graph: dataFactory.defaultGraph(),
|
|
844
|
+
};
|
|
845
|
+
}
|
|
846
|
+
return { pattern, patterns, filter };
|
|
847
|
+
}
|
|
848
|
+
/**
|
|
849
|
+
* Get variables from operation
|
|
850
|
+
*/
|
|
851
|
+
getVariablesFromOperation(operation) {
|
|
852
|
+
const { pattern, patterns } = this.extractPatternAndFilter(operation);
|
|
853
|
+
if (patterns && patterns.length > 1) {
|
|
854
|
+
// Collect variables from all patterns
|
|
855
|
+
const allVars = [];
|
|
856
|
+
const seen = new Set();
|
|
857
|
+
for (const p of patterns) {
|
|
858
|
+
for (const v of (0, AlgebraUtils_1.extractVariables)(p)) {
|
|
859
|
+
if (!seen.has(v.value)) {
|
|
860
|
+
seen.add(v.value);
|
|
861
|
+
allVars.push(v);
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
return allVars;
|
|
866
|
+
}
|
|
867
|
+
return (0, AlgebraUtils_1.extractVariables)(pattern);
|
|
868
|
+
}
|
|
869
|
+
// ============================================================
|
|
870
|
+
// Required IQuerySource Methods
|
|
871
|
+
// ============================================================
|
|
872
|
+
queryQuads(operation, _context) {
|
|
873
|
+
const { pattern } = this.extractPatternAndFilter(operation);
|
|
874
|
+
const quintPattern = this.patternBuilder.buildBasePattern(pattern);
|
|
875
|
+
const resultIterator = (0, asynciterator_1.wrap)(this.store.get(quintPattern));
|
|
876
|
+
resultIterator.setProperty('metadata', {
|
|
877
|
+
state: { invalidate: () => { }, invalid: false, addInvalidateListener: () => { } },
|
|
878
|
+
cardinality: { type: 'estimate', value: Number.POSITIVE_INFINITY },
|
|
879
|
+
});
|
|
880
|
+
return resultIterator;
|
|
881
|
+
}
|
|
882
|
+
async queryBoolean(operation, _context) {
|
|
883
|
+
const { pattern } = this.extractPatternAndFilter(operation.input);
|
|
884
|
+
const quintPattern = this.patternBuilder.buildBasePattern(pattern);
|
|
885
|
+
const results = await this.store.get(quintPattern, { limit: 1 });
|
|
886
|
+
return results.length > 0;
|
|
887
|
+
}
|
|
888
|
+
queryVoid(_operation, _context) {
|
|
889
|
+
throw new Error('queryVoid is not implemented');
|
|
890
|
+
}
|
|
891
|
+
/**
|
|
892
|
+
* 在 pattern 中查找变量绑定到哪个位置
|
|
893
|
+
*
|
|
894
|
+
* 例如:{ ?s <http://schema.org/name> ?name }
|
|
895
|
+
* - ?s 绑定到 subject
|
|
896
|
+
* - ?name 绑定到 object
|
|
897
|
+
*/
|
|
898
|
+
findVariableBinding(varName, pattern) {
|
|
899
|
+
if (pattern.subject?.termType === 'Variable' && pattern.subject.value === varName) {
|
|
900
|
+
return 'subject';
|
|
901
|
+
}
|
|
902
|
+
if (pattern.predicate?.termType === 'Variable' && pattern.predicate.value === varName) {
|
|
903
|
+
return 'predicate';
|
|
904
|
+
}
|
|
905
|
+
if (pattern.object?.termType === 'Variable' && pattern.object.value === varName) {
|
|
906
|
+
return 'object';
|
|
907
|
+
}
|
|
908
|
+
if (pattern.graph?.termType === 'Variable' && pattern.graph.value === varName) {
|
|
909
|
+
return 'graph';
|
|
910
|
+
}
|
|
911
|
+
return null;
|
|
912
|
+
}
|
|
913
|
+
toString() {
|
|
914
|
+
return `QuintQuerySource(${this.store.constructor.name})`;
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
exports.QuintQuerySource = QuintQuerySource;
|
|
918
|
+
//# sourceMappingURL=QuintQuerySource.js.map
|