@undefineds.co/xpod 0.4.10 → 0.4.12
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/config/components-ignore.json +5 -1
- package/config/notifications.json +68 -0
- package/config/xpod.base.json +9 -11
- package/dist/ai/service/AiCredentialSecret.d.ts +30 -0
- package/dist/ai/service/AiCredentialSecret.js +120 -0
- package/dist/ai/service/CredentialReaderImpl.d.ts +18 -0
- package/dist/ai/service/CredentialReaderImpl.js +81 -5
- package/dist/ai/service/CredentialReaderImpl.jsonld +42 -2
- package/dist/ai/service/EmbeddingModelPolicy.d.ts +79 -0
- package/dist/ai/service/EmbeddingModelPolicy.js +134 -0
- package/dist/ai/service/EmbeddingProviderError.js +6 -0
- package/dist/ai/service/EmbeddingServiceImpl.d.ts +13 -1
- package/dist/ai/service/EmbeddingServiceImpl.js +18 -5
- package/dist/ai/service/EmbeddingServiceImpl.jsonld +35 -0
- package/dist/ai/service/index.d.ts +2 -0
- package/dist/ai/service/index.js +2 -0
- package/dist/api/ai-gateway/connect/index.d.ts +20 -2
- package/dist/api/ai-gateway/connect/index.js +162 -16
- package/dist/api/ai-gateway/credentials/AiCredentialSecretDecoder.d.ts +12 -0
- package/dist/api/ai-gateway/credentials/AiCredentialSecretDecoder.js +30 -0
- package/dist/api/ai-gateway/errors.d.ts +1 -1
- package/dist/api/ai-gateway/models/GatewayEmbeddingModelCatalog.d.ts +11 -0
- package/dist/api/ai-gateway/models/GatewayEmbeddingModelCatalog.js +31 -0
- package/dist/api/ai-gateway/models/PodModelSelectionRepository.js +7 -3
- package/dist/api/ai-gateway/models/ProviderCustomModelsService.d.ts +18 -0
- package/dist/api/ai-gateway/models/ProviderCustomModelsService.js +23 -0
- package/dist/api/ai-gateway/models/ProviderModelDiscoveryAdapters.d.ts +3 -1
- package/dist/api/ai-gateway/models/ProviderModelDiscoveryAdapters.js +2 -45
- package/dist/api/ai-gateway/models/ProviderModelSelectionService.d.ts +10 -0
- package/dist/api/ai-gateway/models/ProviderModelSelectionService.js +57 -20
- package/dist/api/ai-gateway/models/ProviderModelType.d.ts +28 -0
- package/dist/api/ai-gateway/models/ProviderModelType.js +34 -0
- package/dist/api/ai-gateway/models/ProviderModelsAdapter.d.ts +10 -0
- package/dist/api/ai-gateway/models/ProviderModelsAdapter.js +3 -4
- package/dist/api/ai-gateway/models/index.d.ts +1 -0
- package/dist/api/ai-gateway/models/index.js +3 -1
- package/dist/api/ai-gateway/providers/CustomRuntimeAdapter.d.ts +7 -0
- package/dist/api/ai-gateway/providers/CustomRuntimeAdapter.js +9 -2
- package/dist/api/ai-gateway/providers/ModelsDevCatalog.d.ts +7 -1
- package/dist/api/ai-gateway/providers/ModelsDevCatalog.js +4 -10
- package/dist/api/ai-gateway/providers/ProviderRegistry.d.ts +107 -0
- package/dist/api/ai-gateway/providers/ProviderRegistry.js +244 -21
- package/dist/api/ai-gateway/providers/ProviderRuntimeRegistry.d.ts +5 -0
- package/dist/api/ai-gateway/providers/ProviderRuntimeRegistry.js +5 -1
- package/dist/api/ai-gateway/quota/SubscriptionQuotaAdapters.d.ts +12 -4
- package/dist/api/ai-gateway/quota/SubscriptionQuotaAdapters.js +11 -11
- package/dist/api/ai-gateway/routing/ModelRouter.d.ts +14 -0
- package/dist/api/ai-gateway/routing/ModelRouter.js +43 -4
- package/dist/api/ai-gateway/service-access/AiConnectionsServiceAccess.d.ts +9 -1
- package/dist/api/ai-gateway/service-access/AiConnectionsServiceAccess.js +3 -27
- package/dist/api/auth/ClientCredentialsAuthenticator.d.ts +0 -1
- package/dist/api/auth/ClientCredentialsAuthenticator.js +0 -3
- package/dist/api/auth/index.d.ts +1 -0
- package/dist/api/auth/index.js +1 -1
- package/dist/api/chatkit/pod-store.d.ts +31 -0
- package/dist/api/chatkit/pod-store.js +132 -8
- package/dist/api/container/common.js +24 -4
- package/dist/api/container/routes.js +17 -2
- package/dist/api/container/types.d.ts +3 -1
- package/dist/api/handlers/AdminHandler.d.ts +13 -0
- package/dist/api/handlers/AdminHandler.js +47 -18
- package/dist/api/handlers/AiConfigHandler.d.ts +6 -0
- package/dist/api/handlers/AiConfigHandler.js +28 -0
- package/dist/api/handlers/AiGatewayManagementHandler.js +36 -0
- package/dist/api/runs/RdfRunContextRetriever.d.ts +14 -0
- package/dist/api/runs/RdfRunContextRetriever.js +41 -5
- package/dist/api/runtime.js +2 -1
- package/dist/cli/commands/secret.d.ts +1 -0
- package/dist/cli/commands/secret.js +25 -7
- package/dist/components/components.jsonld +3 -1
- package/dist/components/context.jsonld +53 -1
- package/dist/http/SubgraphSparqlHttpHandler.d.ts +59 -2
- package/dist/http/SubgraphSparqlHttpHandler.js +145 -13
- package/dist/http/SubgraphSparqlHttpHandler.jsonld +37 -0
- package/dist/identity/drizzle/AccountRoleRepository.d.ts +30 -2
- package/dist/identity/drizzle/AccountRoleRepository.js +163 -15
- package/dist/identity/drizzle/EdgeNodeRepository.d.ts +0 -12
- package/dist/identity/drizzle/EdgeNodeRepository.js +5 -13
- package/dist/identity/drizzle/PodLookupRepository.d.ts +58 -4
- package/dist/identity/drizzle/PodLookupRepository.js +248 -105
- package/dist/identity/drizzle/db.d.ts +19 -0
- package/dist/identity/drizzle/db.js +39 -4
- package/dist/index.d.ts +2 -1
- package/dist/index.js +7 -3
- package/dist/logging/log-file.d.ts +17 -0
- package/dist/logging/log-file.js +69 -0
- package/dist/main.js +2 -1
- package/dist/notifications/NotificationChannelSweeper.d.ts +50 -0
- package/dist/notifications/NotificationChannelSweeper.js +131 -0
- package/dist/notifications/NotificationChannelSweeper.jsonld +136 -0
- package/dist/notifications/ReclaimingWebSocket2023Storer.d.ts +25 -0
- package/dist/notifications/ReclaimingWebSocket2023Storer.js +56 -0
- package/dist/notifications/ReclaimingWebSocket2023Storer.jsonld +77 -0
- package/dist/notifications/index.d.ts +2 -0
- package/dist/notifications/index.js +2 -0
- package/dist/runtime/Proxy.d.ts +37 -0
- package/dist/runtime/Proxy.js +88 -16
- package/dist/runtime/bootstrap.js +2 -1
- package/dist/runtime/upgrade/BunNativeUpgradeRelay.d.ts +116 -0
- package/dist/runtime/upgrade/BunNativeUpgradeRelay.js +423 -0
- package/dist/runtime/upgrade/UpgradeHandshake.d.ts +63 -0
- package/dist/runtime/upgrade/UpgradeHandshake.js +199 -0
- package/dist/runtime/upgrade/WebSocketFrames.d.ts +67 -0
- package/dist/runtime/upgrade/WebSocketFrames.js +224 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiApiKeyPool.js +8 -1
- package/node_modules/@undefineds.co/ai-connections/dist/AiAuthorizationActions.d.ts +11 -2
- package/node_modules/@undefineds.co/ai-connections/dist/AiAuthorizationActions.js +27 -10
- package/node_modules/@undefineds.co/ai-connections/dist/AiClientConfigurationSection.d.ts +7 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiClientConfigurationSection.js +13 -11
- package/node_modules/@undefineds.co/ai-connections/dist/AiConnectDialog.js +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsList.js +10 -6
- package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsMain.d.ts +15 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsMain.js +29 -3
- package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsMainHeader.js +18 -3
- package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsPanel.d.ts +16 -1
- package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsPanel.js +92 -20
- package/node_modules/@undefineds.co/ai-connections/dist/AiCopyButton.d.ts +35 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiCopyButton.js +45 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiCredentialPoolSection.js +71 -11
- package/node_modules/@undefineds.co/ai-connections/dist/AiCredentialRow.js +9 -7
- package/node_modules/@undefineds.co/ai-connections/dist/AiEndpointList.d.ts +23 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiEndpointList.js +24 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayKeysSection.d.ts +13 -4
- package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayKeysSection.js +35 -38
- package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayModelsSection.d.ts +21 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayModelsSection.js +51 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiInfoTooltip.d.ts +15 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiInfoTooltip.js +16 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiModelCatalog.d.ts +175 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiModelCatalog.js +133 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiOfferingDetails.js +2 -2
- package/node_modules/@undefineds.co/ai-connections/dist/AiProviderCard.js +13 -64
- package/node_modules/@undefineds.co/ai-connections/dist/AiProviderHeader.d.ts +21 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiProviderHeader.js +12 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiRowAction.d.ts +15 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiRowAction.js +12 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiSortableCredentialList.js +2 -1
- package/node_modules/@undefineds.co/ai-connections/dist/ai-connections-client.d.ts +7 -0
- package/node_modules/@undefineds.co/ai-connections/dist/ai-connections-client.js +6 -0
- package/node_modules/@undefineds.co/ai-connections/dist/authorization-methods.d.ts +36 -5
- package/node_modules/@undefineds.co/ai-connections/dist/authorization-methods.js +52 -9
- package/node_modules/@undefineds.co/ai-connections/dist/client/normalize.js +30 -3
- package/node_modules/@undefineds.co/ai-connections/dist/client/types.d.ts +21 -1
- package/node_modules/@undefineds.co/ai-connections/dist/client-config/base-adapter.d.ts +1 -3
- package/node_modules/@undefineds.co/ai-connections/dist/client-config/base-adapter.js +3 -7
- package/node_modules/@undefineds.co/ai-connections/dist/client-config/index.cjs +9 -7
- package/node_modules/@undefineds.co/ai-connections/dist/collection-runtime.d.ts +46 -0
- package/node_modules/@undefineds.co/ai-connections/dist/collection-runtime.js +231 -0
- package/node_modules/@undefineds.co/ai-connections/dist/collections.d.ts +119 -0
- package/node_modules/@undefineds.co/ai-connections/dist/collections.js +173 -0
- package/node_modules/@undefineds.co/ai-connections/dist/controller.d.ts +71 -5
- package/node_modules/@undefineds.co/ai-connections/dist/controller.js +285 -16
- package/node_modules/@undefineds.co/ai-connections/dist/credential-labels.d.ts +5 -0
- package/node_modules/@undefineds.co/ai-connections/dist/credential-labels.js +8 -3
- package/node_modules/@undefineds.co/ai-connections/dist/credential-storage.d.ts +59 -0
- package/node_modules/@undefineds.co/ai-connections/dist/credential-storage.js +131 -0
- package/node_modules/@undefineds.co/ai-connections/dist/endpoint-urls.d.ts +15 -0
- package/node_modules/@undefineds.co/ai-connections/dist/endpoint-urls.js +20 -0
- package/node_modules/@undefineds.co/ai-connections/dist/gateway-endpoints.d.ts +14 -0
- package/node_modules/@undefineds.co/ai-connections/dist/gateway-endpoints.js +20 -0
- package/node_modules/@undefineds.co/ai-connections/dist/index.d.ts +8 -0
- package/node_modules/@undefineds.co/ai-connections/dist/index.js +8 -0
- package/node_modules/@undefineds.co/ai-connections/dist/manifest.js +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/offering-endpoints.d.ts +14 -0
- package/node_modules/@undefineds.co/ai-connections/dist/offering-endpoints.js +17 -0
- package/node_modules/@undefineds.co/ai-connections/dist/provider-catalog.cjs +68 -1
- package/node_modules/@undefineds.co/ai-connections/dist/provider-catalog.d.ts +75 -1
- package/node_modules/@undefineds.co/ai-connections/dist/provider-catalog.js +119 -0
- package/node_modules/@undefineds.co/ai-connections/dist/provider-visuals.d.ts +5 -0
- package/node_modules/@undefineds.co/ai-connections/dist/provider-visuals.js +5 -0
- package/node_modules/@undefineds.co/ai-connections/dist/service-access.js +2 -27
- package/node_modules/@undefineds.co/ai-connections/package.json +1 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/manifest.d.ts +1 -1
- package/node_modules/@undefineds.co/extension-sdk/dist/manifest.js +2 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/web.d.ts +150 -0
- package/node_modules/@undefineds.co/extension-sdk/package.json +2 -1
- package/node_modules/@undefineds.co/models/README.md +1 -1
- package/node_modules/@undefineds.co/models/dist/ai-config/index.d.ts +3 -3
- package/node_modules/@undefineds.co/models/dist/ai-gateway.schema.d.ts +5 -0
- package/node_modules/@undefineds.co/models/dist/ai-gateway.schema.js +9 -0
- package/node_modules/@undefineds.co/models/dist/ai-runtime.repository.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/approval.repository.d.ts +2 -2
- package/node_modules/@undefineds.co/models/dist/audit.presentation.d.ts +2 -2
- package/node_modules/@undefineds.co/models/dist/capture.repository.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/chat-project.repository.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/chat.repository.d.ts +2 -2
- package/node_modules/@undefineds.co/models/dist/control-request.repository.d.ts +2 -2
- package/node_modules/@undefineds.co/models/dist/conversation-share.repository.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/credential.schema.d.ts +12 -0
- package/node_modules/@undefineds.co/models/dist/credential.schema.js +15 -1
- package/node_modules/@undefineds.co/models/dist/discovery/index.d.ts +2 -2
- package/node_modules/@undefineds.co/models/dist/discovery/providers.json +248 -7
- package/node_modules/@undefineds.co/models/dist/discovery/types.d.ts +31 -0
- package/node_modules/@undefineds.co/models/dist/extension/index.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/favorite/index.d.ts +2 -2
- package/node_modules/@undefineds.co/models/dist/fixtures/contracts-chat-contact.d.ts +5 -5
- package/node_modules/@undefineds.co/models/dist/import/index.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/index.d.ts +73 -73
- package/node_modules/@undefineds.co/models/dist/index.js +1 -1
- package/node_modules/@undefineds.co/models/dist/input-request.repository.d.ts +2 -2
- package/node_modules/@undefineds.co/models/dist/knowledge/index.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/message.repository.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/namespaces.js +5 -0
- package/node_modules/@undefineds.co/models/dist/pod-storage-descriptor.d.ts +4815 -26
- package/node_modules/@undefineds.co/models/dist/pod-storage-descriptor.js +482 -132
- package/node_modules/@undefineds.co/models/dist/schema.d.ts +4 -0
- package/node_modules/@undefineds.co/models/dist/session/index.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/settings/index.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/sidecar/persistence-mapping.d.ts +5 -5
- package/node_modules/@undefineds.co/models/dist/thread.repository.d.ts +2 -2
- package/node_modules/@undefineds.co/models/dist/types/message-block.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/vocab/_namespaces.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/vocab/index.d.ts +10 -10
- package/node_modules/@undefineds.co/models/dist/vocab/sidecar.vocab.d.ts +1 -0
- package/node_modules/@undefineds.co/models/dist/vocab/sidecar.vocab.js +1 -0
- package/node_modules/@undefineds.co/models/package.json +4 -2
- package/node_modules/@undefineds.co/pod-collections/README.md +71 -0
- package/node_modules/@undefineds.co/pod-collections/dist/diff.d.ts +85 -0
- package/node_modules/@undefineds.co/pod-collections/dist/diff.js +166 -0
- package/node_modules/@undefineds.co/pod-collections/dist/feed.d.ts +17 -0
- package/node_modules/@undefineds.co/pod-collections/dist/feed.js +27 -0
- package/node_modules/@undefineds.co/pod-collections/dist/index.cjs +1042 -0
- package/node_modules/@undefineds.co/pod-collections/dist/index.d.ts +37 -0
- package/node_modules/@undefineds.co/pod-collections/dist/index.js +89 -0
- package/node_modules/@undefineds.co/pod-collections/dist/layout.d.ts +75 -0
- package/node_modules/@undefineds.co/pod-collections/dist/layout.js +173 -0
- package/node_modules/@undefineds.co/pod-collections/dist/mapping.d.ts +78 -0
- package/node_modules/@undefineds.co/pod-collections/dist/mapping.js +287 -0
- package/node_modules/@undefineds.co/pod-collections/dist/mutations.d.ts +83 -0
- package/node_modules/@undefineds.co/pod-collections/dist/mutations.js +273 -0
- package/node_modules/@undefineds.co/pod-collections/dist/react.d.ts +21 -0
- package/node_modules/@undefineds.co/pod-collections/dist/react.js +22 -0
- package/node_modules/@undefineds.co/pod-collections/dist/read.d.ts +65 -0
- package/node_modules/@undefineds.co/pod-collections/dist/read.js +31 -0
- package/node_modules/@undefineds.co/pod-collections/dist/sync.d.ts +66 -0
- package/node_modules/@undefineds.co/pod-collections/dist/sync.js +260 -0
- package/node_modules/@undefineds.co/pod-collections/dist/types.d.ts +155 -0
- package/node_modules/@undefineds.co/pod-collections/dist/types.js +9 -0
- package/node_modules/@undefineds.co/pod-collections/package.json +42 -0
- package/node_modules/@undefineds.co/shared-ui/dist/index.d.ts +0 -1
- package/node_modules/@undefineds.co/shared-ui/dist/index.js +0 -1
- package/package.json +15 -7
- package/static/app/assets/main.css +1 -1
- package/static/app/assets/main.js +12 -13
- package/static/auth-callback/assets/AiConfigContext-DnQs1ZpW.js +1 -0
- package/static/auth-callback/assets/AiConfigPage-DOtvlxH0.js +1 -0
- package/static/auth-callback/assets/DocumentProcessingPanel-BS2voQgL.js +1 -0
- package/static/auth-callback/assets/IndexLifecyclePanel-Cvt0cJtN.js +1 -0
- package/static/auth-callback/assets/{IndexSubjectPanel-C4YG0whI.js → IndexSubjectPanel-Dhf01GqF.js} +1 -1
- package/static/auth-callback/assets/ModelAssignmentsPanel-BJutWaAF.js +1 -0
- package/static/auth-callback/assets/ModelsPage-BRS0sje3.js +11 -0
- package/static/auth-callback/assets/{NetworkPage-Cbdn_P1e.js → NetworkPage-B3qBfANA.js} +2 -2
- package/static/auth-callback/assets/{PaneListHeader-jy70Q00L.js → PaneListHeader-QQeJGTp4.js} +1 -1
- package/static/auth-callback/assets/SearchIndexingPanel-MyNUSEwT.js +1 -0
- package/static/auth-callback/assets/{StatusSubjectPanel-hfjoB5aS.js → StatusSubjectPanel-DQkEVsFs.js} +1 -1
- package/static/{settings/assets/StatusWorkspace-CKD_Rzdr.js → auth-callback/assets/StatusWorkspace-Dkv63Uwk.js} +1 -1
- package/static/auth-callback/assets/SystemSettingsPage-TIsUfX5d.js +1 -0
- package/static/auth-callback/assets/SystemSettingsSubjectPanel-BJWEt2-7.js +33 -0
- package/static/auth-callback/assets/XpodAiConnectionsPodStore-BJiXm-PF.js +3 -0
- package/static/auth-callback/assets/{activity-BcsZZxxw.js → activity-5hNeNKnL.js} +1 -1
- package/static/auth-callback/assets/admin-C6qCRFiY.js +1 -0
- package/static/auth-callback/assets/ai-connections-CryuHGKW.js +1 -0
- package/static/auth-callback/assets/{auth-callback-atKg_oig.js → auth-callback-CAFZ3R0B.js} +80 -84
- package/static/auth-callback/assets/auth-callback-rk080mvG.css +1 -0
- package/static/auth-callback/assets/{badge-BWbRHThQ.js → badge-CAIPI0CB.js} +1 -1
- package/static/auth-callback/assets/collection-runtime-D9s7h9YA.js +1 -0
- package/static/auth-callback/assets/dialog-BjA109aX.js +1 -0
- package/static/auth-callback/assets/{download-BmvG1Vya.js → download-B3Up5W2G.js} +1 -1
- package/static/auth-callback/assets/{external-link-DZ34d3g3.js → external-link-BTXgSPzB.js} +1 -1
- package/static/auth-callback/assets/index-BppXlxcp.js +41 -0
- package/static/auth-callback/assets/index-CirW4CJf.js +1 -0
- package/static/auth-callback/assets/index-DlLYWOhw.js +4 -0
- package/static/auth-callback/assets/{index-browser-B9Z7GU-T.js → index-browser-DtU38ni3.js} +1 -1
- package/static/auth-callback/assets/{key-round-tjP76Se-.js → key-round-CQCOrZ7x.js} +1 -1
- package/static/auth-callback/assets/layout-DB3pMyTl.js +1 -0
- package/static/auth-callback/assets/pod-collections-host-KnnGFZHL.js +8 -0
- package/static/auth-callback/assets/{rotate-ccw-C_L5ZLx1.js → rotate-ccw-C1zM2KtS.js} +1 -1
- package/static/auth-callback/assets/settings-projection-CUkyprDQ.js +1 -0
- package/static/auth-callback/assets/{skeleton-C7tGDQIs.js → skeleton-Cqp7_M9-.js} +1 -1
- package/static/auth-callback/assets/{waypoints-VMNQlWdU.js → waypoints-Bj6gAUSQ.js} +1 -1
- package/static/auth-callback/assets/{workspace-layout-SAp6BtYK.js → workspace-layout-DK8mDzrY.js} +1 -1
- package/static/auth-callback/auth-callback.html +2 -2
- package/static/dashboard/assets/AiConfigContext-BsE7MqX8.js +1 -0
- package/static/dashboard/assets/AiConfigPage-DvM-lRXa.js +1 -0
- package/static/dashboard/assets/DocumentProcessingPanel-BPfdlfuf.js +1 -0
- package/static/dashboard/assets/IndexLifecyclePanel--m0AGxvh.js +1 -0
- package/static/dashboard/assets/{IndexSubjectPanel-DQFPP6-p.js → IndexSubjectPanel-Bb7m1k3d.js} +1 -1
- package/static/dashboard/assets/ModelAssignmentsPanel-BLi_zbMa.js +1 -0
- package/static/dashboard/assets/ModelsPage-CxdpgnfR.js +11 -0
- package/static/dashboard/assets/{NetworkPage-CHQ3YxIB.js → NetworkPage-BAIPw-D_.js} +2 -2
- package/static/dashboard/assets/{PaneListHeader-DsXemAdR.js → PaneListHeader-BBCMei0r.js} +1 -1
- package/static/dashboard/assets/SearchIndexingPanel-Ck4Y-xjR.js +1 -0
- package/static/dashboard/assets/{StatusSubjectPanel-D3PGEYT4.js → StatusSubjectPanel-D1KWfAXE.js} +1 -1
- package/static/dashboard/assets/{StatusWorkspace-BcpePYUW.js → StatusWorkspace-JbA5gzXx.js} +1 -1
- package/static/dashboard/assets/SystemSettingsPage-BbwQWsSR.js +1 -0
- package/static/dashboard/assets/SystemSettingsSubjectPanel-N117nMt5.js +33 -0
- package/static/dashboard/assets/XpodAiConnectionsPodStore-CdDOb4SV.js +18 -0
- package/static/dashboard/assets/{activity-j5zrznu-.js → activity-DX1I96o_.js} +1 -1
- package/static/dashboard/assets/admin-C6qCRFiY.js +1 -0
- package/static/dashboard/assets/ai-connections-DwCRqOQa.js +1 -0
- package/static/dashboard/assets/{badge-CzeBdG7h.js → badge-k2vhtDqH.js} +1 -1
- package/static/dashboard/assets/collection-runtime-BFQ8teQJ.js +1 -0
- package/static/dashboard/assets/{dashboard-D-xANHk1.js → dashboard-DWZ-fmCT.js} +105 -109
- package/static/dashboard/assets/dashboard-rk080mvG.css +1 -0
- package/static/dashboard/assets/dialog-1CCw-iHT.js +1 -0
- package/static/dashboard/assets/{download-IcNdEZWi.js → download-C6-SNY1q.js} +1 -1
- package/static/dashboard/assets/{external-link-DxBxK8Vu.js → external-link-BgPcZ_j2.js} +1 -1
- package/static/dashboard/assets/index-6LcIUIYO.js +1 -0
- package/static/dashboard/assets/index-D7A8U6Pt.js +41 -0
- package/static/dashboard/assets/index-UD6QOE7H.js +4 -0
- package/static/dashboard/assets/{key-round-D1K7warM.js → key-round-BOd7Jo0Q.js} +1 -1
- package/static/dashboard/assets/layout-DB3pMyTl.js +1 -0
- package/static/dashboard/assets/pod-collections-host-KnnGFZHL.js +8 -0
- package/static/dashboard/assets/{rotate-ccw-CcN1N6p9.js → rotate-ccw-CCgJqsvx.js} +1 -1
- package/static/dashboard/assets/settings-projection-CUkyprDQ.js +1 -0
- package/static/dashboard/assets/{skeleton-CKnmJMUH.js → skeleton-Bc7abAn5.js} +1 -1
- package/static/dashboard/assets/{waypoints-DuZPO_wu.js → waypoints-s-opmJxx.js} +1 -1
- package/static/dashboard/assets/{workspace-layout-BUj3wZ_m.js → workspace-layout-DqIQeTBV.js} +1 -1
- package/static/dashboard/dashboard.html +2 -2
- package/static/settings/assets/AiConfigContext-BB9KZySa.js +1 -0
- package/static/settings/assets/AiConfigPage-DGSXUkLs.js +1 -0
- package/static/settings/assets/DocumentProcessingPanel-Da2Re6Rg.js +1 -0
- package/static/settings/assets/IndexLifecyclePanel-BSZuIzgr.js +1 -0
- package/static/settings/assets/{IndexSubjectPanel-73sM16Ma.js → IndexSubjectPanel-CFd0ay-r.js} +1 -1
- package/static/settings/assets/ModelAssignmentsPanel-CSAryvWJ.js +1 -0
- package/static/settings/assets/ModelsPage-BQwCwLHU.js +11 -0
- package/static/settings/assets/{NetworkPage-i6j-M2RY.js → NetworkPage-BKymvsQc.js} +2 -2
- package/static/settings/assets/{PaneListHeader-DpqC0jd5.js → PaneListHeader-Bjh3hRdQ.js} +1 -1
- package/static/settings/assets/SearchIndexingPanel-MjKL5QLU.js +1 -0
- package/static/settings/assets/{StatusSubjectPanel-Dv4q3PGh.js → StatusSubjectPanel-Bvl6K4mx.js} +1 -1
- package/static/settings/assets/StatusWorkspace-B0NzrP--.js +1 -0
- package/static/settings/assets/SystemSettingsPage-D2z6Z4FE.js +1 -0
- package/static/settings/assets/SystemSettingsSubjectPanel-4sxma4X4.js +33 -0
- package/static/settings/assets/XpodAiConnectionsPodStore-BkNQ8fZx.js +3 -0
- package/static/settings/assets/{activity-DaFkk8f3.js → activity-CgJJGpjx.js} +1 -1
- package/static/settings/assets/admin-C6qCRFiY.js +1 -0
- package/static/settings/assets/ai-connections-CryuHGKW.js +1 -0
- package/static/settings/assets/{badge-d5SHdc-x.js → badge-C4NypVyT.js} +1 -1
- package/static/settings/assets/collection-runtime-CTLCDxAi.js +1 -0
- package/static/settings/assets/dialog-Csq0vWUi.js +1 -0
- package/static/settings/assets/{download-CpkwomDr.js → download-DaLJJ-Wp.js} +1 -1
- package/static/settings/assets/{external-link-_4YT42Mf.js → external-link--w_iW5Au.js} +1 -1
- package/static/settings/assets/index-B0mQa59b.js +4 -0
- package/static/settings/assets/index-BukHiu4y.js +1 -0
- package/static/settings/assets/index-COmVnZi2.js +41 -0
- package/static/settings/assets/{index-browser-B06xjBdZ.js → index-browser-BGpvHwD0.js} +1 -1
- package/static/settings/assets/{key-round-Dlqmp1Kq.js → key-round-Bk4YRjBu.js} +1 -1
- package/static/settings/assets/layout-DB3pMyTl.js +1 -0
- package/static/settings/assets/pod-collections-host-KnnGFZHL.js +8 -0
- package/static/settings/assets/{rotate-ccw-TAY65xWT.js → rotate-ccw-TCabbqsr.js} +1 -1
- package/static/settings/assets/{settings-ExBXGgbj.js → settings-CJWpdbNC.js} +105 -109
- package/static/settings/assets/settings-projection-CUkyprDQ.js +1 -0
- package/static/settings/assets/settings-rk080mvG.css +1 -0
- package/static/settings/assets/{skeleton-DKIWjNr9.js → skeleton-JDHYVe7t.js} +1 -1
- package/static/settings/assets/{waypoints-9erLIxyR.js → waypoints-DDvEl-MU.js} +1 -1
- package/static/settings/assets/{workspace-layout-CYXfYIa3.js → workspace-layout-DV5QU30U.js} +1 -1
- package/static/settings/settings.html +2 -2
- package/node_modules/@undefineds.co/shared-ui/dist/oidc-consent.d.ts +0 -54
- package/node_modules/@undefineds.co/shared-ui/dist/oidc-consent.js +0 -21
- package/static/auth-callback/assets/AiConfigContext-C81deMM9.js +0 -1
- package/static/auth-callback/assets/AiConfigPage-evWI8T56.js +0 -1
- package/static/auth-callback/assets/DocumentProcessingPanel-B9GrDEMe.js +0 -1
- package/static/auth-callback/assets/IndexLifecyclePanel-qCo8ABQZ.js +0 -1
- package/static/auth-callback/assets/ModelAssignmentsPanel-DG7Lxh3t.js +0 -1
- package/static/auth-callback/assets/ModelsPage-CgEuqE6p.js +0 -10
- package/static/auth-callback/assets/SearchIndexingPanel-ByU3u7kp.js +0 -1
- package/static/auth-callback/assets/StatusWorkspace-BZd617sV.js +0 -1
- package/static/auth-callback/assets/SystemSettingsPage-BirzWAQM.js +0 -1
- package/static/auth-callback/assets/SystemSettingsSubjectPanel-CmsVWNCx.js +0 -31
- package/static/auth-callback/assets/admin-BU4m6Ko2.js +0 -1
- package/static/auth-callback/assets/ai-connections-CHNTKemd.js +0 -1
- package/static/auth-callback/assets/auth-callback-C_7MUXJb.css +0 -1
- package/static/auth-callback/assets/index-BpV1hsqs.js +0 -4
- package/static/auth-callback/assets/index-D9oE6FXK.js +0 -41
- package/static/dashboard/assets/AiConfigContext-De-OtAWo.js +0 -1
- package/static/dashboard/assets/AiConfigPage-macP4Mop.js +0 -1
- package/static/dashboard/assets/DocumentProcessingPanel-C5ObvCCl.js +0 -1
- package/static/dashboard/assets/IndexLifecyclePanel-xVNa2l40.js +0 -1
- package/static/dashboard/assets/ModelAssignmentsPanel-DMOATFpQ.js +0 -1
- package/static/dashboard/assets/ModelsPage-91UbnETA.js +0 -25
- package/static/dashboard/assets/SearchIndexingPanel-Dh70PNFZ.js +0 -1
- package/static/dashboard/assets/SystemSettingsPage-BiN5GcKx.js +0 -1
- package/static/dashboard/assets/SystemSettingsSubjectPanel-B9QrSiFp.js +0 -31
- package/static/dashboard/assets/admin-BU4m6Ko2.js +0 -1
- package/static/dashboard/assets/ai-connections-CHNTKemd.js +0 -1
- package/static/dashboard/assets/dashboard-C_7MUXJb.css +0 -1
- package/static/dashboard/assets/index-FWZ-s52O.js +0 -41
- package/static/dashboard/assets/index-ZiQZ96oC.js +0 -4
- package/static/settings/assets/AiConfigContext-C0cQMPfG.js +0 -1
- package/static/settings/assets/AiConfigPage-CPhB4iFb.js +0 -1
- package/static/settings/assets/DocumentProcessingPanel-sYI7OpuH.js +0 -1
- package/static/settings/assets/IndexLifecyclePanel-yj8iyiT8.js +0 -1
- package/static/settings/assets/ModelAssignmentsPanel-BFIgUX5v.js +0 -1
- package/static/settings/assets/ModelsPage-BdppXl7E.js +0 -10
- package/static/settings/assets/SearchIndexingPanel-BlPnrkT3.js +0 -1
- package/static/settings/assets/SystemSettingsPage-CiOm2NzV.js +0 -1
- package/static/settings/assets/SystemSettingsSubjectPanel-Cd-GECon.js +0 -31
- package/static/settings/assets/admin-BU4m6Ko2.js +0 -1
- package/static/settings/assets/ai-connections-CHNTKemd.js +0 -1
- package/static/settings/assets/index-BFi9yn7_.js +0 -41
- package/static/settings/assets/index-BGgEhIUy.js +0 -4
- package/static/settings/assets/settings-C_7MUXJb.css +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpHandler } from '@solid/community-server';
|
|
2
2
|
import type { HttpHandlerInput, HttpRequest, HttpResponse } from '@solid/community-server';
|
|
3
|
-
import type { CredentialsExtractor, PermissionReader, Authorizer } from '@solid/community-server';
|
|
3
|
+
import type { ActivityEmitter, CredentialsExtractor, PermissionReader, Authorizer } from '@solid/community-server';
|
|
4
4
|
import { SubgraphQueryEngine } from '../storage/sparql/SubgraphQueryEngine';
|
|
5
5
|
import { MixDataAccessor } from '../storage/accessors/MixDataAccessor';
|
|
6
6
|
interface SubgraphSparqlHttpHandlerOptions {
|
|
@@ -41,9 +41,10 @@ export declare class SubgraphSparqlHttpHandler extends HttpHandler {
|
|
|
41
41
|
private readonly usageRepo?;
|
|
42
42
|
private readonly defaultBandwidthLimit?;
|
|
43
43
|
private readonly updateAuthority?;
|
|
44
|
+
private readonly emitter?;
|
|
44
45
|
private readonly generator;
|
|
45
46
|
private static readonly XSD_STRING;
|
|
46
|
-
constructor(queryEngine: SubgraphQueryEngine, credentialsExtractor: CredentialsExtractor, permissionReader: PermissionReader, authorizer: Authorizer, options?: SubgraphSparqlHttpHandlerOptions, updateAuthority?: MixDataAccessor);
|
|
47
|
+
constructor(queryEngine: SubgraphQueryEngine, credentialsExtractor: CredentialsExtractor, permissionReader: PermissionReader, authorizer: Authorizer, options?: SubgraphSparqlHttpHandlerOptions, updateAuthority?: MixDataAccessor, emitter?: ActivityEmitter);
|
|
47
48
|
canHandle({ request }: HttpHandlerInput): Promise<void>;
|
|
48
49
|
handle({ request, response }: HttpHandlerInput): Promise<void>;
|
|
49
50
|
/**
|
|
@@ -60,6 +61,55 @@ export declare class SubgraphSparqlHttpHandler extends HttpHandler {
|
|
|
60
61
|
private executeAsk;
|
|
61
62
|
private executeConstruct;
|
|
62
63
|
private executeUpdate;
|
|
64
|
+
/**
|
|
65
|
+
* Turns the write targets of an update access plan into the activities that should be emitted.
|
|
66
|
+
*
|
|
67
|
+
* Only documents actually written by the update (the plan's `writeTargets`) are considered:
|
|
68
|
+
* one activity per document, never per quad and never for an untouched resource.
|
|
69
|
+
*/
|
|
70
|
+
private resolvePendingActivities;
|
|
71
|
+
/**
|
|
72
|
+
* Maps the SPARQL update operation applied to one document to the ActivityStream term the
|
|
73
|
+
* CSS notification generators understand (`MonitoringStore` only forwards `as:Add|Create|Delete|Remove|Update`).
|
|
74
|
+
*
|
|
75
|
+
* Mapping (the closest faithful term for each operation):
|
|
76
|
+
* - `CREATE [SILENT] GRAPH` -> `as:Create` when the document did not exist yet;
|
|
77
|
+
* a `CREATE` on an existing graph is a silent no-op -> nothing.
|
|
78
|
+
* - `INSERT DATA` / `INSERT … WHERE` / `LOAD` /
|
|
79
|
+
* `ADD` / `COPY` target -> `as:Create` when the document did not exist yet, else `as:Update`
|
|
80
|
+
* (same `exists ? Update : Create` rule CSS uses for PUT).
|
|
81
|
+
* - `DELETE DATA` / `DELETE WHERE` /
|
|
82
|
+
* `INSERT … DELETE … WHERE` -> `as:Update` (partial removal; the document itself survives).
|
|
83
|
+
* - `CLEAR GRAPH` / `DROP GRAPH` / `MOVE` source -> `as:Update`: every triple is gone, but
|
|
84
|
+
`MixDataAccessor.executeSparqlUpdate` rewrites the graph into an *empty* document instead of
|
|
85
|
+
removing the resource, so a re-read returns 200-empty rather than 404. That observable result
|
|
86
|
+
equals a `DELETE DATA` which removes every triple, which maps to `Update`. `as:Delete` is
|
|
87
|
+
therefore deliberately unused: it becomes correct only once an accessor actually removes the
|
|
88
|
+
document (a re-read would then be 404).
|
|
89
|
+
* - delete-only update on a missing document -> nothing (SPARQL no-op).
|
|
90
|
+
* - `as:Add` / `as:Remove` are deliberately not used: those describe container membership changes
|
|
91
|
+
* (`DataAccessorBasedStore.addContainerActivity`), and the sidecar writes document graphs only.
|
|
92
|
+
*/
|
|
93
|
+
private resolveActivity;
|
|
94
|
+
/**
|
|
95
|
+
* Checks whether the document already exists before the update is applied.
|
|
96
|
+
*
|
|
97
|
+
* Uses the same accessor that performs the write, so the answer describes the storage the
|
|
98
|
+
* activity is about. Returns `undefined` when the answer cannot be determined; callers then
|
|
99
|
+
* fall back to the conservative `Update`/`Delete` terms instead of `Create`.
|
|
100
|
+
*/
|
|
101
|
+
private documentExistedBefore;
|
|
102
|
+
/**
|
|
103
|
+
* Emits the resolved activities on the injected {@link ActivityEmitter}.
|
|
104
|
+
*
|
|
105
|
+
* Mirrors `MonitoringStore.emitChanged`
|
|
106
|
+
* (node_modules/@solid/community-server/dist/storage/MonitoringStore.js:36-45): for every changed resource
|
|
107
|
+
* one `changed` event plus the ActivityStream-typed event, with the same metadata shape
|
|
108
|
+
* `DataAccessorBasedStore.addActivityMetadata` produces (an `urn:npm:solid:community-server:activity:` quad).
|
|
109
|
+
* `ListeningActivityHandler` (dist/server/notifications/ListeningActivityHandler.js:25) subscribes to `changed`
|
|
110
|
+
* and derives the notification state by re-reading the store, so no ETag has to be carried here.
|
|
111
|
+
*/
|
|
112
|
+
private emitActivities;
|
|
63
113
|
private sendPayload;
|
|
64
114
|
private streamWithLimit;
|
|
65
115
|
private resolveUsageContext;
|
|
@@ -79,6 +129,13 @@ export declare class SubgraphSparqlHttpHandler extends HttpHandler {
|
|
|
79
129
|
private inspectPatterns;
|
|
80
130
|
private assertGraphInScope;
|
|
81
131
|
private assertGraphTermInScope;
|
|
132
|
+
/**
|
|
133
|
+
* Registers a graph as written by the update and records which kind of change applies to it.
|
|
134
|
+
*
|
|
135
|
+
* Several operations can target the same graph in one request; the flags are accumulated so the graph
|
|
136
|
+
* still yields at most one activity. This is also the only place write targets are created, which keeps
|
|
137
|
+
* notification coverage tied to the same plan that drives authorization.
|
|
138
|
+
*/
|
|
82
139
|
private addWriteTarget;
|
|
83
140
|
private readLoadDocument;
|
|
84
141
|
private rewriteLoadUpdate;
|
|
@@ -19,7 +19,7 @@ const ALLOWED_METHODS = ['GET', 'POST', 'OPTIONS'];
|
|
|
19
19
|
const MODEL_COLLECTION_SUFFIX = '/settings/providers/-/sparql';
|
|
20
20
|
const SETTINGS_COLLECTION_SUFFIX = '/settings/-/sparql';
|
|
21
21
|
class SubgraphSparqlHttpHandler extends community_server_1.HttpHandler {
|
|
22
|
-
constructor(queryEngine, credentialsExtractor, permissionReader, authorizer, options = {}, updateAuthority) {
|
|
22
|
+
constructor(queryEngine, credentialsExtractor, permissionReader, authorizer, options = {}, updateAuthority, emitter) {
|
|
23
23
|
super();
|
|
24
24
|
this.logger = (0, global_logger_factory_1.getLoggerFor)(this);
|
|
25
25
|
this.generator = new sparqljs_1.Generator();
|
|
@@ -30,6 +30,7 @@ class SubgraphSparqlHttpHandler extends community_server_1.HttpHandler {
|
|
|
30
30
|
this.sidecarPath = options.sidecarPath ?? '/-/sparql';
|
|
31
31
|
this.defaultBandwidthLimit = this.normalizeLimit(options.defaultAccountBandwidthLimitBps);
|
|
32
32
|
this.updateAuthority = updateAuthority;
|
|
33
|
+
this.emitter = emitter;
|
|
33
34
|
// Identity DB is used for pod lookup (to resolve accountId/podId from URL)
|
|
34
35
|
if (options.identityDbUrl) {
|
|
35
36
|
const db = (0, db_1.getIdentityDatabase)(options.identityDbUrl);
|
|
@@ -335,6 +336,13 @@ class SubgraphSparqlHttpHandler extends community_server_1.HttpHandler {
|
|
|
335
336
|
: this.rewriteDefaultGraphUpdates(parsed, queryRequest.baseUrl);
|
|
336
337
|
this.logger.verbose(`[SubgraphSPARQL] Rewritten Query: ${rewritten}`);
|
|
337
338
|
const skippedSilentAuthorityLoad = Boolean(this.updateAuthority && loadDocumentPlan?.silent && !nativeOptions?.loadDocument);
|
|
339
|
+
// A LOAD that resolved to an empty document rewrites to `INSERT DATA { GRAPH <g> { } }`,
|
|
340
|
+
// which cannot create or change anything, so it must not notify either.
|
|
341
|
+
const emptyAuthorityLoad = Boolean(this.updateAuthority && loadDocumentPlan && nativeOptions?.loadDocument?.body.trim().length === 0);
|
|
342
|
+
const emitActivities = Boolean(this.emitter) && !emptyAuthorityLoad;
|
|
343
|
+
// Existence has to be captured before the write because the activity term depends on it
|
|
344
|
+
// (`Create` for a document the update brings into existence, `Update` otherwise).
|
|
345
|
+
const pendingActivities = emitActivities ? await this.resolvePendingActivities(accessPlan) : [];
|
|
338
346
|
if (!skippedSilentAuthorityLoad) {
|
|
339
347
|
if (this.updateAuthority) {
|
|
340
348
|
await this.updateAuthority.executeSparqlUpdate(rewritten, queryRequest.baseUrl, readAccessScope);
|
|
@@ -342,12 +350,115 @@ class SubgraphSparqlHttpHandler extends community_server_1.HttpHandler {
|
|
|
342
350
|
else {
|
|
343
351
|
await this.engine.queryVoid(rewritten, queryRequest.baseUrl, readAccessScope, nativeOptions);
|
|
344
352
|
}
|
|
353
|
+
// Only a successful write notifies; a throwing write skips this line entirely.
|
|
354
|
+
this.emitActivities(pendingActivities);
|
|
345
355
|
}
|
|
346
356
|
await this.refreshUsage(queryRequest.baseUrl);
|
|
347
357
|
response.statusCode = 204;
|
|
348
358
|
response.setHeader('Cache-Control', 'no-store');
|
|
349
359
|
response.end();
|
|
350
360
|
}
|
|
361
|
+
/**
|
|
362
|
+
* Turns the write targets of an update access plan into the activities that should be emitted.
|
|
363
|
+
*
|
|
364
|
+
* Only documents actually written by the update (the plan's `writeTargets`) are considered:
|
|
365
|
+
* one activity per document, never per quad and never for an untouched resource.
|
|
366
|
+
*/
|
|
367
|
+
async resolvePendingActivities(plan) {
|
|
368
|
+
const pending = [];
|
|
369
|
+
for (const [graph, effect] of plan.targetEffects) {
|
|
370
|
+
const documentUrl = this.resourceUrlForGraphValue(graph);
|
|
371
|
+
const existedBefore = await this.documentExistedBefore(documentUrl);
|
|
372
|
+
const activity = this.resolveActivity(effect, existedBefore);
|
|
373
|
+
if (activity) {
|
|
374
|
+
pending.push({ identifier: { path: documentUrl }, activity });
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
return pending;
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* Maps the SPARQL update operation applied to one document to the ActivityStream term the
|
|
381
|
+
* CSS notification generators understand (`MonitoringStore` only forwards `as:Add|Create|Delete|Remove|Update`).
|
|
382
|
+
*
|
|
383
|
+
* Mapping (the closest faithful term for each operation):
|
|
384
|
+
* - `CREATE [SILENT] GRAPH` -> `as:Create` when the document did not exist yet;
|
|
385
|
+
* a `CREATE` on an existing graph is a silent no-op -> nothing.
|
|
386
|
+
* - `INSERT DATA` / `INSERT … WHERE` / `LOAD` /
|
|
387
|
+
* `ADD` / `COPY` target -> `as:Create` when the document did not exist yet, else `as:Update`
|
|
388
|
+
* (same `exists ? Update : Create` rule CSS uses for PUT).
|
|
389
|
+
* - `DELETE DATA` / `DELETE WHERE` /
|
|
390
|
+
* `INSERT … DELETE … WHERE` -> `as:Update` (partial removal; the document itself survives).
|
|
391
|
+
* - `CLEAR GRAPH` / `DROP GRAPH` / `MOVE` source -> `as:Update`: every triple is gone, but
|
|
392
|
+
`MixDataAccessor.executeSparqlUpdate` rewrites the graph into an *empty* document instead of
|
|
393
|
+
removing the resource, so a re-read returns 200-empty rather than 404. That observable result
|
|
394
|
+
equals a `DELETE DATA` which removes every triple, which maps to `Update`. `as:Delete` is
|
|
395
|
+
therefore deliberately unused: it becomes correct only once an accessor actually removes the
|
|
396
|
+
document (a re-read would then be 404).
|
|
397
|
+
* - delete-only update on a missing document -> nothing (SPARQL no-op).
|
|
398
|
+
* - `as:Add` / `as:Remove` are deliberately not used: those describe container membership changes
|
|
399
|
+
* (`DataAccessorBasedStore.addContainerActivity`), and the sidecar writes document graphs only.
|
|
400
|
+
*/
|
|
401
|
+
resolveActivity(effect, existedBefore) {
|
|
402
|
+
if (effect.createdGraph) {
|
|
403
|
+
return existedBefore === true ? undefined : community_server_2.AS.terms.Create;
|
|
404
|
+
}
|
|
405
|
+
if (!effect.addedData && existedBefore === false) {
|
|
406
|
+
// DELETE/CLEAR/DROP against a document that does not exist changes nothing.
|
|
407
|
+
return undefined;
|
|
408
|
+
}
|
|
409
|
+
if (!effect.addedData && effect.removedAllData) {
|
|
410
|
+
// CLEAR/DROP/MOVE-source: the document survives as an empty document, so this is an update.
|
|
411
|
+
return community_server_2.AS.terms.Update;
|
|
412
|
+
}
|
|
413
|
+
if (existedBefore === false) {
|
|
414
|
+
return community_server_2.AS.terms.Create;
|
|
415
|
+
}
|
|
416
|
+
return community_server_2.AS.terms.Update;
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* Checks whether the document already exists before the update is applied.
|
|
420
|
+
*
|
|
421
|
+
* Uses the same accessor that performs the write, so the answer describes the storage the
|
|
422
|
+
* activity is about. Returns `undefined` when the answer cannot be determined; callers then
|
|
423
|
+
* fall back to the conservative `Update`/`Delete` terms instead of `Create`.
|
|
424
|
+
*/
|
|
425
|
+
async documentExistedBefore(documentUrl) {
|
|
426
|
+
if (!this.updateAuthority) {
|
|
427
|
+
return undefined;
|
|
428
|
+
}
|
|
429
|
+
try {
|
|
430
|
+
await this.updateAuthority.getMetadata({ path: documentUrl });
|
|
431
|
+
return true;
|
|
432
|
+
}
|
|
433
|
+
catch (error) {
|
|
434
|
+
if (community_server_2.NotFoundHttpError.isInstance(error)) {
|
|
435
|
+
return false;
|
|
436
|
+
}
|
|
437
|
+
this.logger.debug(`Could not determine pre-update existence of ${documentUrl}: ${error instanceof Error ? error.message : String(error)}`);
|
|
438
|
+
return undefined;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* Emits the resolved activities on the injected {@link ActivityEmitter}.
|
|
443
|
+
*
|
|
444
|
+
* Mirrors `MonitoringStore.emitChanged`
|
|
445
|
+
* (node_modules/@solid/community-server/dist/storage/MonitoringStore.js:36-45): for every changed resource
|
|
446
|
+
* one `changed` event plus the ActivityStream-typed event, with the same metadata shape
|
|
447
|
+
* `DataAccessorBasedStore.addActivityMetadata` produces (an `urn:npm:solid:community-server:activity:` quad).
|
|
448
|
+
* `ListeningActivityHandler` (dist/server/notifications/ListeningActivityHandler.js:25) subscribes to `changed`
|
|
449
|
+
* and derives the notification state by re-reading the store, so no ETag has to be carried here.
|
|
450
|
+
*/
|
|
451
|
+
emitActivities(activities) {
|
|
452
|
+
if (!this.emitter || activities.length === 0) {
|
|
453
|
+
return;
|
|
454
|
+
}
|
|
455
|
+
for (const { identifier, activity } of activities) {
|
|
456
|
+
const metadata = new community_server_2.RepresentationMetadata(identifier, { [community_server_2.SOLID_AS.activity]: activity });
|
|
457
|
+
this.emitter.emit('changed', identifier, activity, metadata);
|
|
458
|
+
this.emitter.emit(activity.value, identifier, metadata);
|
|
459
|
+
this.logger.debug(`[SubgraphSPARQL] Emitted ${activity.value} activity for ${identifier.path}`);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
351
462
|
async sendPayload(response, payload, contentType, context, statusCode = 200) {
|
|
352
463
|
const buffer = typeof payload === 'string' ? Buffer.from(payload, 'utf8') : payload;
|
|
353
464
|
const limit = context ? await this.resolveBandwidthLimit(context) : undefined;
|
|
@@ -514,6 +625,7 @@ class SubgraphSparqlHttpHandler extends community_server_1.HttpHandler {
|
|
|
514
625
|
needsReadScope: false,
|
|
515
626
|
readTargets: new Set(),
|
|
516
627
|
writeTargets: new Map(),
|
|
628
|
+
targetEffects: new Map(),
|
|
517
629
|
loadDocuments: [],
|
|
518
630
|
clearGraphs: [],
|
|
519
631
|
graphCopies: [],
|
|
@@ -533,7 +645,7 @@ class SubgraphSparqlHttpHandler extends community_server_1.HttpHandler {
|
|
|
533
645
|
? this.assertGraphTermInScope(operation.destination, basePath)
|
|
534
646
|
: basePath;
|
|
535
647
|
plan.readTargets.add(sourceUri);
|
|
536
|
-
this.addWriteTarget(plan, targetGraph ?? basePath, [policy_engine_1.PERMISSIONS.Append]);
|
|
648
|
+
this.addWriteTarget(plan, targetGraph ?? basePath, [policy_engine_1.PERMISSIONS.Append], { addedData: true });
|
|
537
649
|
plan.loadDocuments.push({
|
|
538
650
|
sourceUri,
|
|
539
651
|
targetGraph: targetGraph ?? basePath,
|
|
@@ -548,7 +660,7 @@ class SubgraphSparqlHttpHandler extends community_server_1.HttpHandler {
|
|
|
548
660
|
plan.hasDelete = true;
|
|
549
661
|
plan.needsReadScope = true;
|
|
550
662
|
const graph = this.assertGraphInScope(operation.graph, basePath) ?? basePath;
|
|
551
|
-
this.addWriteTarget(plan, graph, [policy_engine_1.PERMISSIONS.Delete]);
|
|
663
|
+
this.addWriteTarget(plan, graph, [policy_engine_1.PERMISSIONS.Delete], { removedAllData: true });
|
|
552
664
|
plan.clearGraphs.push(graph);
|
|
553
665
|
continue;
|
|
554
666
|
}
|
|
@@ -561,17 +673,23 @@ class SubgraphSparqlHttpHandler extends community_server_1.HttpHandler {
|
|
|
561
673
|
plan.hasInsert = true;
|
|
562
674
|
plan.needsReadScope = true;
|
|
563
675
|
plan.readTargets.add(sourceGraph);
|
|
676
|
+
// A self copy/add/move is reduced by `rewriteGraphCopyUpdate` to `CREATE SILENT GRAPH <targetGraph>`,
|
|
677
|
+
// so such a target is only (possibly) created and never cleared or re-filled.
|
|
678
|
+
const selfCopy = sourceGraph === targetGraph;
|
|
679
|
+
const targetEffect = selfCopy
|
|
680
|
+
? { createdGraph: true }
|
|
681
|
+
: { removedAllData: true, addedData: true };
|
|
564
682
|
if (operation.type === 'add') {
|
|
565
|
-
this.addWriteTarget(plan, targetGraph, [policy_engine_1.PERMISSIONS.Append]);
|
|
683
|
+
this.addWriteTarget(plan, targetGraph, [policy_engine_1.PERMISSIONS.Append], selfCopy ? targetEffect : { addedData: true });
|
|
566
684
|
}
|
|
567
685
|
else if (operation.type === 'copy') {
|
|
568
686
|
plan.hasDelete = true;
|
|
569
|
-
this.addWriteTarget(plan, targetGraph, [policy_engine_1.PERMISSIONS.Delete, policy_engine_1.PERMISSIONS.Append]);
|
|
687
|
+
this.addWriteTarget(plan, targetGraph, [policy_engine_1.PERMISSIONS.Delete, policy_engine_1.PERMISSIONS.Append], targetEffect);
|
|
570
688
|
}
|
|
571
689
|
else {
|
|
572
690
|
plan.hasDelete = true;
|
|
573
|
-
this.addWriteTarget(plan, targetGraph, [policy_engine_1.PERMISSIONS.Delete, policy_engine_1.PERMISSIONS.Append]);
|
|
574
|
-
this.addWriteTarget(plan, sourceGraph, [policy_engine_1.PERMISSIONS.Delete]);
|
|
691
|
+
this.addWriteTarget(plan, targetGraph, [policy_engine_1.PERMISSIONS.Delete, policy_engine_1.PERMISSIONS.Append], targetEffect);
|
|
692
|
+
this.addWriteTarget(plan, sourceGraph, [policy_engine_1.PERMISSIONS.Delete], selfCopy ? {} : { removedAllData: true });
|
|
575
693
|
}
|
|
576
694
|
plan.graphCopies.push({ operation: operation.type, sourceGraph, targetGraph });
|
|
577
695
|
continue;
|
|
@@ -579,7 +697,7 @@ class SubgraphSparqlHttpHandler extends community_server_1.HttpHandler {
|
|
|
579
697
|
if (this.isCreateGraphOperation(operation)) {
|
|
580
698
|
plan.hasInsert = true;
|
|
581
699
|
const graph = this.assertGraphInScope(operation.graph, basePath) ?? basePath;
|
|
582
|
-
this.addWriteTarget(plan, graph, [policy_engine_1.PERMISSIONS.Append]);
|
|
700
|
+
this.addWriteTarget(plan, graph, [policy_engine_1.PERMISSIONS.Append], { createdGraph: true });
|
|
583
701
|
continue;
|
|
584
702
|
}
|
|
585
703
|
if (!this.isInsertDeleteOperation(operation)) {
|
|
@@ -600,7 +718,7 @@ class SubgraphSparqlHttpHandler extends community_server_1.HttpHandler {
|
|
|
600
718
|
this.assertGraphInScope(operation.graph, basePath);
|
|
601
719
|
}
|
|
602
720
|
if (operation.updateType === 'insert' || operation.updateType === 'insertdelete') {
|
|
603
|
-
this.inspectQuads(operation.insert ?? [], basePath, defaultGraph, plan, [policy_engine_1.PERMISSIONS.Append]);
|
|
721
|
+
this.inspectQuads(operation.insert ?? [], basePath, defaultGraph, plan, [policy_engine_1.PERMISSIONS.Append], { addedData: true });
|
|
604
722
|
}
|
|
605
723
|
if (operation.updateType === 'delete' || operation.updateType === 'insertdelete' || operation.updateType === 'deletewhere') {
|
|
606
724
|
this.inspectQuads(operation.delete ?? [], basePath, defaultGraph, plan, [policy_engine_1.PERMISSIONS.Delete]);
|
|
@@ -622,16 +740,16 @@ class SubgraphSparqlHttpHandler extends community_server_1.HttpHandler {
|
|
|
622
740
|
}
|
|
623
741
|
return plan;
|
|
624
742
|
}
|
|
625
|
-
inspectQuads(quads, basePath, defaultGraph, plan, modes) {
|
|
743
|
+
inspectQuads(quads, basePath, defaultGraph, plan, modes, effect = {}) {
|
|
626
744
|
for (const quad of quads) {
|
|
627
745
|
if (quad.type === 'graph') {
|
|
628
746
|
const graph = this.assertGraphTermInScope(quad.name, basePath);
|
|
629
747
|
if (graph) {
|
|
630
|
-
this.addWriteTarget(plan, graph, modes);
|
|
748
|
+
this.addWriteTarget(plan, graph, modes, effect);
|
|
631
749
|
}
|
|
632
750
|
}
|
|
633
751
|
else {
|
|
634
|
-
this.addWriteTarget(plan, defaultGraph, modes);
|
|
752
|
+
this.addWriteTarget(plan, defaultGraph, modes, effect);
|
|
635
753
|
}
|
|
636
754
|
}
|
|
637
755
|
}
|
|
@@ -681,12 +799,26 @@ class SubgraphSparqlHttpHandler extends community_server_1.HttpHandler {
|
|
|
681
799
|
}
|
|
682
800
|
throw new community_server_2.BadRequestHttpError('Unsupported graph target in SPARQL update.');
|
|
683
801
|
}
|
|
684
|
-
|
|
802
|
+
/**
|
|
803
|
+
* Registers a graph as written by the update and records which kind of change applies to it.
|
|
804
|
+
*
|
|
805
|
+
* Several operations can target the same graph in one request; the flags are accumulated so the graph
|
|
806
|
+
* still yields at most one activity. This is also the only place write targets are created, which keeps
|
|
807
|
+
* notification coverage tied to the same plan that drives authorization.
|
|
808
|
+
*/
|
|
809
|
+
addWriteTarget(plan, graph, modes, effect = {}) {
|
|
685
810
|
const existing = plan.writeTargets.get(graph) ?? new Set();
|
|
686
811
|
for (const mode of modes) {
|
|
687
812
|
existing.add(mode);
|
|
688
813
|
}
|
|
689
814
|
plan.writeTargets.set(graph, existing);
|
|
815
|
+
const merged = plan.targetEffects.get(graph) ?? { addedData: false, removedAllData: false, createdGraph: false };
|
|
816
|
+
for (const key of Object.keys(effect)) {
|
|
817
|
+
if (effect[key]) {
|
|
818
|
+
merged[key] = true;
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
plan.targetEffects.set(graph, merged);
|
|
690
822
|
}
|
|
691
823
|
async readLoadDocument(plan, basePath, accessScope) {
|
|
692
824
|
const quads = await this.engine.constructGraph(plan.sourceUri, basePath, accessScope);
|
|
@@ -25,6 +25,20 @@
|
|
|
25
25
|
]
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
|
+
{
|
|
29
|
+
"@id": "undefineds:dist/http/SubgraphSparqlHttpHandler.jsonld#SubgraphSparqlHttpHandler_emitter",
|
|
30
|
+
"range": {
|
|
31
|
+
"@type": "ParameterRangeUnion",
|
|
32
|
+
"parameterRangeElements": [
|
|
33
|
+
{
|
|
34
|
+
"@type": "ParameterRangeWildcard"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"@type": "ParameterRangeUndefined"
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
},
|
|
28
42
|
{
|
|
29
43
|
"@id": "undefineds:dist/http/SubgraphSparqlHttpHandler.jsonld#SubgraphSparqlHttpHandler_queryEngine",
|
|
30
44
|
"range": "undefineds:dist/storage/sparql/SubgraphQueryEngine.jsonld#SubgraphQueryEngine"
|
|
@@ -162,6 +176,10 @@
|
|
|
162
176
|
"@id": "undefineds:dist/http/SubgraphSparqlHttpHandler.jsonld#SubgraphSparqlHttpHandler__member_updateAuthority",
|
|
163
177
|
"memberFieldName": "updateAuthority"
|
|
164
178
|
},
|
|
179
|
+
{
|
|
180
|
+
"@id": "undefineds:dist/http/SubgraphSparqlHttpHandler.jsonld#SubgraphSparqlHttpHandler__member_emitter",
|
|
181
|
+
"memberFieldName": "emitter"
|
|
182
|
+
},
|
|
165
183
|
{
|
|
166
184
|
"@id": "undefineds:dist/http/SubgraphSparqlHttpHandler.jsonld#SubgraphSparqlHttpHandler__member_generator",
|
|
167
185
|
"memberFieldName": "generator"
|
|
@@ -214,6 +232,22 @@
|
|
|
214
232
|
"@id": "undefineds:dist/http/SubgraphSparqlHttpHandler.jsonld#SubgraphSparqlHttpHandler__member_executeUpdate",
|
|
215
233
|
"memberFieldName": "executeUpdate"
|
|
216
234
|
},
|
|
235
|
+
{
|
|
236
|
+
"@id": "undefineds:dist/http/SubgraphSparqlHttpHandler.jsonld#SubgraphSparqlHttpHandler__member_resolvePendingActivities",
|
|
237
|
+
"memberFieldName": "resolvePendingActivities"
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
"@id": "undefineds:dist/http/SubgraphSparqlHttpHandler.jsonld#SubgraphSparqlHttpHandler__member_resolveActivity",
|
|
241
|
+
"memberFieldName": "resolveActivity"
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"@id": "undefineds:dist/http/SubgraphSparqlHttpHandler.jsonld#SubgraphSparqlHttpHandler__member_documentExistedBefore",
|
|
245
|
+
"memberFieldName": "documentExistedBefore"
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
"@id": "undefineds:dist/http/SubgraphSparqlHttpHandler.jsonld#SubgraphSparqlHttpHandler__member_emitActivities",
|
|
249
|
+
"memberFieldName": "emitActivities"
|
|
250
|
+
},
|
|
217
251
|
{
|
|
218
252
|
"@id": "undefineds:dist/http/SubgraphSparqlHttpHandler.jsonld#SubgraphSparqlHttpHandler__member_sendPayload",
|
|
219
253
|
"memberFieldName": "sendPayload"
|
|
@@ -459,6 +493,9 @@
|
|
|
459
493
|
},
|
|
460
494
|
{
|
|
461
495
|
"@id": "undefineds:dist/http/SubgraphSparqlHttpHandler.jsonld#SubgraphSparqlHttpHandler_updateAuthority"
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
"@id": "undefineds:dist/http/SubgraphSparqlHttpHandler.jsonld#SubgraphSparqlHttpHandler_emitter"
|
|
462
499
|
}
|
|
463
500
|
]
|
|
464
501
|
}
|
|
@@ -4,16 +4,44 @@ export interface AccountRoleContext {
|
|
|
4
4
|
webId?: string;
|
|
5
5
|
roles: string[];
|
|
6
6
|
}
|
|
7
|
+
export interface AccountRoleRepositoryOptions {
|
|
8
|
+
/**
|
|
9
|
+
* CSS 文件存储时代的账户目录(`.internal/accounts/data`)。
|
|
10
|
+
* 仅在迁移期兜底读取;默认按进程 CWD 惰性解析,桌面/集群部署应显式注入。
|
|
11
|
+
*/
|
|
12
|
+
legacyAccountDataDir?: string;
|
|
13
|
+
}
|
|
7
14
|
export declare class AccountRoleRepository {
|
|
8
15
|
private readonly db;
|
|
9
16
|
private readonly logger;
|
|
10
|
-
|
|
17
|
+
private readonly legacyAccountDataDir?;
|
|
18
|
+
constructor(db: IdentityDatabase, options?: AccountRoleRepositoryOptions);
|
|
11
19
|
findByAccountId(accountId: string): Promise<AccountRoleContext | undefined>;
|
|
12
20
|
findByWebId(webId: string): Promise<AccountRoleContext | undefined>;
|
|
13
21
|
findByWebIdLoose(webId: string): Promise<AccountRoleContext | undefined>;
|
|
14
22
|
listAccounts(): Promise<AccountRoleContext[]>;
|
|
15
23
|
addRoles(accountId: string, roles: string[]): Promise<void>;
|
|
16
|
-
|
|
24
|
+
/**
|
|
25
|
+
* 按主键直查 identity_store 中的 account 行;表不存在时返回 undefined(由调用方走兜底)。
|
|
26
|
+
*/
|
|
27
|
+
private getIdentityStoreAccount;
|
|
28
|
+
/**
|
|
29
|
+
* 按 CSS 行契约(webIdLink.accountId、pod.accountId、owner.podId)下推查询账户的 WebID。
|
|
30
|
+
*/
|
|
31
|
+
private findWebIdsForAccount;
|
|
32
|
+
/**
|
|
33
|
+
* WebID → accountId 的下推解析:webIdLink 优先,其次 account 行内嵌 webId 字段,
|
|
34
|
+
* 最后 owner→pod 链路。全部 miss 返回 undefined(调用方再走全量兜底)。
|
|
35
|
+
*/
|
|
36
|
+
private findAccountIdByWebId;
|
|
37
|
+
/**
|
|
38
|
+
* owner→pod 链路里把 owner 行的 podId 与 pod 行的 id 对齐。
|
|
39
|
+
*/
|
|
40
|
+
private ownerPodJoin;
|
|
41
|
+
/**
|
|
42
|
+
* legacy 来源:internal_kv 与文件账户(迁移期兜底),不含 identity_store。
|
|
43
|
+
*/
|
|
44
|
+
private loadLegacyAccounts;
|
|
17
45
|
private loadAllAccounts;
|
|
18
46
|
private loadIdentityStoreAccounts;
|
|
19
47
|
private loadInternalKvAccounts;
|