@coasys/ad4m 0.13.0-test-flows-1 → 0.13.1-staging.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/lib/index.cjs +9613 -7069
- package/lib/index.js +7367 -4840
- package/lib/src/Ad4mClient.d.ts +12 -4
- package/lib/src/Ad4mClient.js +15 -11
- package/lib/src/Literal.js +3 -3
- package/lib/src/agent/Agent.d.ts +4 -1
- package/lib/src/agent/Agent.js +6 -0
- package/lib/src/agent/AgentClient.d.ts +9 -23
- package/lib/src/agent/AgentClient.js +68 -148
- package/lib/src/ai/AIClient.d.ts +10 -6
- package/lib/src/ai/AIClient.js +29 -27
- package/lib/src/apiClient.d.ts +54 -42
- package/lib/src/apiClient.js +279 -252
- package/lib/src/expression/Expression.d.ts +13 -4
- package/lib/src/expression/Expression.js +0 -1
- package/lib/src/expression/ExpressionClient.js +1 -1
- package/lib/src/generated/api/AIPromptExamples.d.ts +4 -0
- package/lib/src/generated/api/AIPromptExamples.js +2 -0
- package/lib/src/generated/api/AIPromptExamplesInput.d.ts +4 -0
- package/lib/src/generated/api/AIPromptExamplesInput.js +2 -0
- package/lib/src/generated/api/AITask.d.ts +11 -0
- package/lib/src/generated/api/AITaskInput.d.ts +8 -0
- package/lib/src/generated/api/AddAgentInfosRequest.d.ts +3 -0
- package/lib/src/generated/api/AddAgentInfosRequest.js +2 -0
- package/lib/src/generated/api/AddLinkExpressionRequest.d.ts +2 -2
- package/lib/src/generated/api/AddLinkRequest.d.ts +2 -2
- package/lib/src/generated/api/AddLinksBulkRequest.d.ts +2 -2
- package/lib/src/generated/api/AddSdnaRequest.d.ts +2 -2
- package/lib/src/generated/api/Agent.d.ts +6 -0
- package/lib/src/generated/api/AgentAddEntanglementProofsParams.d.ts +9 -0
- package/lib/src/generated/api/AgentByDidParams.d.ts +3 -0
- package/lib/src/generated/api/AgentByDidParams.js +2 -0
- package/lib/src/generated/api/AgentRemoveAppParams.d.ts +3 -0
- package/lib/src/generated/api/AgentRemoveAppParams.js +2 -0
- package/lib/src/generated/api/AgentRevokeTokenParams.d.ts +3 -0
- package/lib/src/generated/api/AgentRevokeTokenParams.js +2 -0
- package/lib/src/generated/api/AgentSignature.d.ts +4 -0
- package/lib/src/generated/api/AgentSignature.js +2 -0
- package/lib/src/generated/api/AgentStatus.d.ts +8 -0
- package/lib/src/generated/api/AgentStatusChangedEvent.d.ts +7 -0
- package/lib/src/generated/api/AgentUpdatedEvent.d.ts +7 -0
- package/lib/src/generated/api/AgentsByDidsRequest.d.ts +3 -0
- package/lib/src/generated/api/AgentsByDidsRequest.js +2 -0
- package/lib/src/generated/api/AiAddModelParams.d.ts +4 -0
- package/lib/src/generated/api/AiAddTaskParams.d.ts +4 -0
- package/lib/src/generated/api/AiDiscoverModelsParams.d.ts +8 -0
- package/lib/src/generated/api/AiDiscoverModelsParams.js +2 -0
- package/lib/src/generated/api/AiGetDefaultModelParams.d.ts +4 -0
- package/lib/src/generated/api/AiIdParams.d.ts +3 -0
- package/lib/src/generated/api/AiIdParams.js +2 -0
- package/lib/src/generated/api/AiModelLoadingStatusParams.d.ts +7 -0
- package/lib/src/generated/api/AiModelLoadingStatusParams.js +2 -0
- package/lib/src/generated/api/AiSetDefaultModelParams.d.ts +5 -0
- package/lib/src/generated/api/AiSetDefaultModelParams.js +1 -0
- package/lib/src/generated/api/AiTranscriptionCloseParams.d.ts +3 -0
- package/lib/src/generated/api/AiTranscriptionCloseParams.js +2 -0
- package/lib/src/generated/api/AiTranscriptionOpenParams.d.ts +5 -0
- package/lib/src/generated/api/AiTranscriptionOpenParams.js +1 -0
- package/lib/src/generated/api/AiUpdateModelParams.d.ts +5 -0
- package/lib/src/generated/api/AiUpdateModelParams.js +1 -0
- package/lib/src/generated/api/AiUpdateTaskParams.d.ts +4 -0
- package/lib/src/generated/api/AiUpdateTaskParams.js +1 -0
- package/lib/src/generated/api/Apps.d.ts +7 -0
- package/lib/src/generated/api/Apps.js +1 -0
- package/lib/src/generated/api/AuthInfo.d.ts +10 -0
- package/lib/src/generated/api/AuthInfo.js +1 -0
- package/lib/src/generated/api/AuthInfoInput.d.ts +4 -4
- package/lib/src/generated/api/AutoProcessorEvent.d.ts +89 -0
- package/lib/src/generated/api/AutoProcessorEvent.js +1 -0
- package/lib/src/generated/api/AutoProcessorNeighbourhoodState.d.ts +32 -0
- package/lib/src/generated/api/AutoProcessorNeighbourhoodState.js +1 -0
- package/lib/src/generated/api/AutoProcessorStep.d.ts +7 -0
- package/lib/src/generated/api/AutoProcessorStep.js +2 -0
- package/lib/src/generated/api/BroadcastRequest.d.ts +5 -0
- package/lib/src/generated/api/BroadcastRequest.js +2 -0
- package/lib/src/generated/api/CallSessionInfo.d.ts +23 -0
- package/lib/src/generated/api/CallSessionInfo.js +2 -0
- package/lib/src/generated/api/Capability.d.ts +5 -0
- package/lib/src/generated/api/Capability.js +1 -0
- package/lib/src/generated/api/CreateSubjectRequest.d.ts +2 -2
- package/lib/src/generated/api/CreateUserRequest.d.ts +4 -0
- package/lib/src/generated/api/CreateUserRequest.js +2 -0
- package/lib/src/generated/api/DateTime.d.ts +1 -0
- package/lib/src/generated/api/DateTime.js +2 -0
- package/lib/src/generated/api/DecoratedExpressionProof.d.ts +6 -0
- package/lib/src/generated/api/DecoratedExpressionProof.js +2 -0
- package/lib/src/generated/api/DecoratedLinkExpression.d.ts +10 -0
- package/lib/src/generated/api/DecoratedLinkExpression.js +1 -0
- package/lib/src/generated/api/DecoratedNeighbourhoodExpression.d.ts +8 -0
- package/lib/src/generated/api/DecoratedNeighbourhoodExpression.js +1 -0
- package/lib/src/generated/api/DecoratedPerspective.d.ts +4 -0
- package/lib/src/generated/api/DecoratedPerspective.js +1 -0
- package/lib/src/generated/api/DiscardBatchRequest.d.ts +3 -0
- package/lib/src/generated/api/DiscardBatchRequest.js +2 -0
- package/lib/src/generated/api/DisposeQueryRequest.d.ts +3 -0
- package/lib/src/generated/api/DisposeQueryRequest.js +2 -0
- package/lib/src/generated/api/EntanglementProof.d.ts +8 -0
- package/lib/src/generated/api/EntanglementProof.js +2 -0
- package/lib/src/generated/api/EntanglementProofInput.d.ts +1 -1
- package/lib/src/generated/api/EntanglementProofPreflightRequest.d.ts +4 -0
- package/lib/src/generated/api/EntanglementProofPreflightRequest.js +2 -0
- package/lib/src/generated/api/EntanglementProofsWrapper.d.ts +7 -0
- package/lib/src/generated/api/EntanglementProofsWrapper.js +1 -0
- package/lib/src/generated/api/Events.d.ts +56 -0
- package/lib/src/generated/api/Events.js +18 -0
- package/lib/src/generated/api/ExceptionInfo.d.ts +7 -0
- package/lib/src/generated/api/ExceptionInfo.js +1 -0
- package/lib/src/generated/api/ExceptionOccurredEvent.d.ts +7 -0
- package/lib/src/generated/api/ExceptionOccurredEvent.js +1 -0
- package/lib/src/generated/api/ExceptionType.d.ts +1 -0
- package/lib/src/generated/api/ExceptionType.js +2 -0
- package/lib/src/generated/api/ExecuteCommandsRequest.d.ts +4 -2
- package/lib/src/generated/api/ExportRequest.d.ts +1 -1
- package/lib/src/generated/api/ExpressionInteractRequest.d.ts +5 -0
- package/lib/src/generated/api/ExpressionInteractRequest.js +1 -0
- package/lib/src/generated/api/ExpressionProofInput.d.ts +4 -4
- package/lib/src/generated/api/ExpressionRendered.d.ts +11 -0
- package/lib/src/generated/api/ExpressionRendered.js +1 -0
- package/lib/src/generated/api/ExpressionUrlRequest.d.ts +3 -0
- package/lib/src/generated/api/ExpressionUrlRequest.js +2 -0
- package/lib/src/generated/api/FireOutcome.d.ts +14 -0
- package/lib/src/generated/api/FireOutcome.js +2 -0
- package/lib/src/generated/api/FlowStateChangedEvent.d.ts +38 -0
- package/lib/src/generated/api/FlowStateChangedEvent.js +2 -0
- package/lib/src/generated/api/FlowStateEntry.d.ts +18 -0
- package/lib/src/generated/api/FlowStateEntry.js +2 -0
- package/lib/src/generated/api/FriendSendMessageRequest.d.ts +1 -1
- package/lib/src/generated/api/HostRate.d.ts +7 -0
- package/lib/src/generated/api/HostRate.js +2 -0
- package/lib/src/generated/api/HostingInfoResult.d.ts +13 -0
- package/lib/src/generated/api/HostingInfoResult.js +1 -0
- package/lib/src/generated/api/HostingInfoUser.d.ts +9 -0
- package/lib/src/generated/api/HostingInfoUser.js +2 -0
- package/lib/src/generated/api/HostingRequestPaymentResult.d.ts +4 -0
- package/lib/src/generated/api/HostingRequestPaymentResult.js +2 -0
- package/lib/src/generated/api/HostingUserInfo.d.ts +6 -0
- package/lib/src/generated/api/HostingUserInfo.js +2 -0
- package/lib/src/generated/api/HostingVersionInfo.d.ts +7 -0
- package/lib/src/generated/api/HostingVersionInfo.js +2 -0
- package/lib/src/generated/api/HostingWalletResult.d.ts +8 -0
- package/lib/src/generated/api/HostingWalletResult.js +1 -0
- package/lib/src/generated/api/IceServer.d.ts +18 -0
- package/lib/src/generated/api/IceServer.js +2 -0
- package/lib/src/generated/api/Icon.d.ts +3 -0
- package/lib/src/generated/api/Icon.js +2 -0
- package/lib/src/generated/api/ImportResult.d.ts +15 -0
- package/lib/src/generated/api/ImportResult.js +1 -0
- package/lib/src/generated/api/ImportStats.d.ts +7 -0
- package/lib/src/generated/api/ImportStats.js +2 -0
- package/lib/src/generated/api/InteractionCall.d.ts +4 -0
- package/lib/src/generated/api/InteractionCall.js +2 -0
- package/lib/src/generated/api/InteractionCallWrapper.d.ts +6 -0
- package/lib/src/generated/api/InteractionCallWrapper.js +2 -0
- package/lib/src/generated/api/InteractionMeta.d.ts +6 -0
- package/lib/src/generated/api/InteractionMeta.js +1 -0
- package/lib/src/generated/api/InteractionParameter.d.ts +4 -0
- package/lib/src/generated/api/InteractionParameter.js +2 -0
- package/lib/src/generated/api/LanguageAddressParams.d.ts +3 -0
- package/lib/src/generated/api/LanguageAddressParams.js +2 -0
- package/lib/src/generated/api/LanguageHandle.d.ts +9 -0
- package/lib/src/generated/api/LanguageHandle.js +1 -0
- package/lib/src/generated/api/LanguageListParams.d.ts +3 -0
- package/lib/src/generated/api/LanguageListParams.js +2 -0
- package/lib/src/generated/api/LanguageMeta.d.ts +11 -0
- package/lib/src/generated/api/LanguageMeta.js +2 -0
- package/lib/src/generated/api/LanguageMetaInput.d.ts +2 -2
- package/lib/src/generated/api/LanguageRef.d.ts +4 -0
- package/lib/src/generated/api/LanguageRef.js +2 -0
- package/lib/src/generated/api/LanguageSettingsWrapper.d.ts +6 -0
- package/lib/src/generated/api/LanguageSettingsWrapper.js +2 -0
- package/lib/src/generated/api/LanguageWriteSettingsParams.d.ts +4 -0
- package/lib/src/generated/api/LanguageWriteSettingsParams.js +2 -0
- package/lib/src/generated/api/LinkExpressionInput.d.ts +1 -1
- package/lib/src/generated/api/LinkInput.d.ts +1 -1
- package/lib/src/generated/api/LinkMutationRequest.d.ts +12 -0
- package/lib/src/generated/api/LinkMutationRequest.js +1 -0
- package/lib/src/generated/api/LinkMutationsRequest.d.ts +5 -0
- package/lib/src/generated/api/LinkMutationsRequest.js +1 -0
- package/lib/src/generated/api/LinkStatus.d.ts +1 -1
- package/lib/src/generated/api/LinkUpdateInput.d.ts +5 -0
- package/lib/src/generated/api/LinkUpdateInput.js +1 -0
- package/lib/src/generated/api/LocalModel.d.ts +7 -0
- package/lib/src/generated/api/LocalModel.js +1 -0
- package/lib/src/generated/api/LocalModelInput.d.ts +7 -0
- package/lib/src/generated/api/LocalModelInput.js +1 -0
- package/lib/src/generated/api/MessageReceivedEvent.d.ts +7 -0
- package/lib/src/generated/api/MessageReceivedEvent.js +1 -0
- package/lib/src/generated/api/Model.d.ts +10 -0
- package/lib/src/generated/api/Model.js +1 -0
- package/lib/src/generated/api/ModelApi.d.ts +17 -0
- package/lib/src/generated/api/ModelApi.js +1 -0
- package/lib/src/generated/api/ModelApiInput.d.ts +11 -0
- package/lib/src/generated/api/ModelApiInput.js +2 -0
- package/lib/src/generated/api/ModelApiType.d.ts +1 -0
- package/lib/src/generated/api/ModelApiType.js +2 -0
- package/lib/src/generated/api/ModelInput.d.ts +9 -0
- package/lib/src/generated/api/ModelInput.js +1 -0
- package/lib/src/generated/api/ModelType.d.ts +1 -1
- package/lib/src/generated/api/Neighbourhood.d.ts +5 -0
- package/lib/src/generated/api/Neighbourhood.js +1 -0
- package/lib/src/generated/api/NeighbourhoodBroadcastParams.d.ts +7 -0
- package/lib/src/generated/api/NeighbourhoodBroadcastParams.js +1 -0
- package/lib/src/generated/api/NeighbourhoodOnlineStatusParams.d.ts +6 -0
- package/lib/src/generated/api/NeighbourhoodOnlineStatusParams.js +1 -0
- package/lib/src/generated/api/NeighbourhoodPerspectivePayload.d.ts +7 -0
- package/lib/src/generated/api/NeighbourhoodPerspectivePayload.js +1 -0
- package/lib/src/generated/api/NeighbourhoodPhase.d.ts +6 -0
- package/lib/src/generated/api/NeighbourhoodPhase.js +2 -0
- package/lib/src/generated/api/NeighbourhoodSignalFilter.d.ts +8 -0
- package/lib/src/generated/api/NeighbourhoodSignalFilter.js +1 -0
- package/lib/src/generated/api/NeighbourhoodSignalParams.d.ts +7 -0
- package/lib/src/generated/api/NeighbourhoodSignalParams.js +1 -0
- package/lib/src/generated/api/NeighbourhoodSignedPerspective.d.ts +8 -0
- package/lib/src/generated/api/NeighbourhoodSignedPerspective.js +1 -0
- package/lib/src/generated/api/NeighbourhoodUuidParams.d.ts +3 -0
- package/lib/src/generated/api/NeighbourhoodUuidParams.js +2 -0
- package/lib/src/generated/api/Notification.d.ts +16 -0
- package/lib/src/generated/api/Notification.js +2 -0
- package/lib/src/generated/api/NotificationGrantRequest.d.ts +6 -0
- package/lib/src/generated/api/NotificationGrantRequest.js +2 -0
- package/lib/src/generated/api/NotificationInput.d.ts +1 -1
- package/lib/src/generated/api/NotificationTriggeredEvent.d.ts +9 -0
- package/lib/src/generated/api/NotificationTriggeredEvent.js +1 -0
- package/lib/src/generated/api/OnlineAgent.d.ts +9 -0
- package/lib/src/generated/api/OnlineAgent.js +1 -0
- package/lib/src/generated/api/OutputRef.d.ts +12 -0
- package/lib/src/generated/api/OutputRef.js +2 -0
- package/lib/src/generated/api/OverlayView.d.ts +24 -0
- package/lib/src/generated/api/OverlayView.js +1 -0
- package/lib/src/generated/api/Perspective.d.ts +4 -0
- package/lib/src/generated/api/Perspective.js +1 -0
- package/lib/src/generated/api/PerspectiveAddAutoProcessorParams.d.ts +26 -0
- package/lib/src/generated/api/PerspectiveAddAutoProcessorParams.js +2 -0
- package/lib/src/generated/api/PerspectiveAddLinkExpressionParams.d.ts +7 -0
- package/lib/src/generated/api/PerspectiveAddLinkExpressionParams.js +1 -0
- package/lib/src/generated/api/PerspectiveAddLinkParams.d.ts +7 -0
- package/lib/src/generated/api/PerspectiveAddLinkParams.js +1 -0
- package/lib/src/generated/api/PerspectiveAddLinksParams.d.ts +7 -0
- package/lib/src/generated/api/PerspectiveAddLinksParams.js +1 -0
- package/lib/src/generated/api/PerspectiveAddSdnaParams.d.ts +14 -0
- package/lib/src/generated/api/PerspectiveAddSdnaParams.js +1 -0
- package/lib/src/generated/api/PerspectiveAddSdnaResult.d.ts +4 -0
- package/lib/src/generated/api/PerspectiveAddSdnaResult.js +2 -0
- package/lib/src/generated/api/PerspectiveCommitBatchParams.d.ts +4 -0
- package/lib/src/generated/api/PerspectiveCommitBatchParams.js +2 -0
- package/lib/src/generated/api/PerspectiveCreateSubjectParams.d.ts +7 -0
- package/lib/src/generated/api/PerspectiveCreateSubjectParams.js +2 -0
- package/lib/src/generated/api/PerspectiveDiscardBatchParams.d.ts +4 -0
- package/lib/src/generated/api/PerspectiveDiscardBatchParams.js +2 -0
- package/lib/src/generated/api/PerspectiveEvaluateGettersParams.d.ts +9 -0
- package/lib/src/generated/api/PerspectiveEvaluateGettersParams.js +2 -0
- package/lib/src/generated/api/PerspectiveExecuteCommandsParams.d.ts +7 -0
- package/lib/src/generated/api/PerspectiveExecuteCommandsParams.js +2 -0
- package/lib/src/generated/api/PerspectiveExpression.d.ts +8 -0
- package/lib/src/generated/api/PerspectiveExpression.js +1 -0
- package/lib/src/generated/api/PerspectiveFlowFiredParams.d.ts +8 -0
- package/lib/src/generated/api/PerspectiveFlowFiredParams.js +2 -0
- package/lib/src/generated/api/PerspectiveFlowProposalParams.d.ts +4 -0
- package/lib/src/generated/api/PerspectiveFlowProposalParams.js +2 -0
- package/lib/src/generated/api/PerspectiveFlowReceiptVerdict.d.ts +12 -0
- package/lib/src/generated/api/PerspectiveFlowReceiptVerdict.js +1 -0
- package/lib/src/generated/api/PerspectiveFlowStatesParams.d.ts +11 -0
- package/lib/src/generated/api/PerspectiveFlowStatesParams.js +2 -0
- package/lib/src/generated/api/PerspectiveFlowValidOutputsParams.d.ts +8 -0
- package/lib/src/generated/api/PerspectiveFlowValidOutputsParams.js +2 -0
- package/lib/src/generated/api/PerspectiveGetAllShaclParams.d.ts +7 -0
- package/lib/src/generated/api/PerspectiveGetAllShaclParams.js +2 -0
- package/lib/src/generated/api/PerspectiveGetSubjectDataParams.d.ts +5 -0
- package/lib/src/generated/api/PerspectiveGetSubjectDataParams.js +2 -0
- package/lib/src/generated/api/PerspectiveHandle.d.ts +10 -0
- package/lib/src/generated/api/PerspectiveHandle.js +1 -0
- package/lib/src/generated/api/PerspectiveLinkDiff.d.ts +9 -0
- package/lib/src/generated/api/PerspectiveLinkDiff.js +1 -0
- package/lib/src/generated/api/PerspectiveLinkMutationsParams.d.ts +6 -0
- package/lib/src/generated/api/PerspectiveLinkMutationsParams.js +1 -0
- package/lib/src/generated/api/PerspectiveLinkUpdatedWithOwner.d.ts +7 -0
- package/lib/src/generated/api/PerspectiveLinkUpdatedWithOwner.js +1 -0
- package/lib/src/generated/api/PerspectiveLinkWithOwner.d.ts +6 -0
- package/lib/src/generated/api/PerspectiveLinkWithOwner.js +1 -0
- package/lib/src/generated/api/PerspectiveMintFlowReceiptParams.d.ts +4 -0
- package/lib/src/generated/api/PerspectiveMintFlowReceiptParams.js +2 -0
- package/lib/src/generated/api/PerspectiveMintFlowReceiptResult.d.ts +9 -0
- package/lib/src/generated/api/PerspectiveMintFlowReceiptResult.js +1 -0
- package/lib/src/generated/api/PerspectiveModelQueryParams.d.ts +13 -0
- package/lib/src/generated/api/PerspectiveModelQueryParams.js +2 -0
- package/lib/src/generated/api/PerspectiveNamedShacl.d.ts +6 -0
- package/lib/src/generated/api/PerspectiveNamedShacl.js +1 -0
- package/lib/src/generated/api/PerspectiveProposeFlowTransitionParams.d.ts +8 -0
- package/lib/src/generated/api/PerspectiveProposeFlowTransitionParams.js +1 -0
- package/lib/src/generated/api/PerspectiveQueryLinksParams.d.ts +15 -0
- package/lib/src/generated/api/PerspectiveQueryLinksParams.js +2 -0
- package/lib/src/generated/api/PerspectiveQueryParams.d.ts +4 -0
- package/lib/src/generated/api/PerspectiveQueryParams.js +2 -0
- package/lib/src/generated/api/PerspectiveReceiptOutcome.d.ts +1 -0
- package/lib/src/generated/api/PerspectiveReceiptOutcome.js +2 -0
- package/lib/src/generated/api/PerspectiveRejectFlowProposalResult.d.ts +3 -0
- package/lib/src/generated/api/PerspectiveRejectFlowProposalResult.js +2 -0
- package/lib/src/generated/api/PerspectiveRemoveAutoProcessorParams.d.ts +4 -0
- package/lib/src/generated/api/PerspectiveRemoveAutoProcessorParams.js +2 -0
- package/lib/src/generated/api/PerspectiveRemoveLinkParams.d.ts +6 -0
- package/lib/src/generated/api/PerspectiveRemoveLinkParams.js +1 -0
- package/lib/src/generated/api/PerspectiveRemoveLinksParams.d.ts +6 -0
- package/lib/src/generated/api/PerspectiveRemoveLinksParams.js +1 -0
- package/lib/src/generated/api/PerspectiveRemoveSubjectParams.d.ts +6 -0
- package/lib/src/generated/api/PerspectiveRemoveSubjectParams.js +2 -0
- package/lib/src/generated/api/PerspectiveRemovedWithOwner.d.ts +5 -0
- package/lib/src/generated/api/PerspectiveRemovedWithOwner.js +2 -0
- package/lib/src/generated/api/PerspectiveResolveInterpretationParams.d.ts +8 -0
- package/lib/src/generated/api/PerspectiveResolveInterpretationParams.js +2 -0
- package/lib/src/generated/api/PerspectiveResynced.d.ts +8 -0
- package/lib/src/generated/api/PerspectiveResynced.js +2 -0
- package/lib/src/generated/api/PerspectiveShacl.d.ts +5 -0
- package/lib/src/generated/api/PerspectiveShacl.js +1 -0
- package/lib/src/generated/api/PerspectiveShaclNameParams.d.ts +4 -0
- package/lib/src/generated/api/PerspectiveShaclNameParams.js +2 -0
- package/lib/src/generated/api/PerspectiveSparqlParams.d.ts +8 -0
- package/lib/src/generated/api/PerspectiveSparqlParams.js +2 -0
- package/lib/src/generated/api/PerspectiveState.d.ts +1 -0
- package/lib/src/generated/api/PerspectiveState.js +2 -0
- package/lib/src/generated/api/PerspectiveStateFilter.d.ts +7 -0
- package/lib/src/generated/api/PerspectiveStateFilter.js +1 -0
- package/lib/src/generated/api/PerspectiveSubjectClassesOfParams.d.ts +4 -0
- package/lib/src/generated/api/PerspectiveSubjectClassesOfParams.js +2 -0
- package/lib/src/generated/api/PerspectiveSubscribed.d.ts +10 -0
- package/lib/src/generated/api/PerspectiveSubscribed.js +2 -0
- package/lib/src/generated/api/PerspectiveSubscriptionParams.d.ts +4 -0
- package/lib/src/generated/api/PerspectiveSubscriptionParams.js +2 -0
- package/lib/src/generated/api/PerspectiveUnsignedInput.d.ts +4 -0
- package/lib/src/generated/api/PerspectiveUnsignedInput.js +1 -0
- package/lib/src/generated/api/PerspectiveUpdateLinkParams.d.ts +8 -0
- package/lib/src/generated/api/PerspectiveUpdateLinkParams.js +1 -0
- package/lib/src/generated/api/PerspectiveUpdateParams.d.ts +4 -0
- package/lib/src/generated/api/PerspectiveUpdateParams.js +2 -0
- package/lib/src/generated/api/PerspectiveUpdateSubjectParams.d.ts +10 -0
- package/lib/src/generated/api/PerspectiveUpdateSubjectParams.js +2 -0
- package/lib/src/generated/api/PerspectiveUuidParams.d.ts +3 -0
- package/lib/src/generated/api/PerspectiveUuidParams.js +2 -0
- package/lib/src/generated/api/PerspectiveVerifyFlowReceiptParams.d.ts +9 -0
- package/lib/src/generated/api/PerspectiveVerifyFlowReceiptParams.js +1 -0
- package/lib/src/generated/api/PerspectiveWithOwner.d.ts +6 -0
- package/lib/src/generated/api/PerspectiveWithOwner.js +1 -0
- package/lib/src/generated/api/ProposeOutcome.d.ts +45 -0
- package/lib/src/generated/api/ProposeOutcome.js +1 -0
- package/lib/src/generated/api/PublicPerspectiveInput.d.ts +4 -0
- package/lib/src/generated/api/PublicPerspectiveInput.js +1 -0
- package/lib/src/generated/api/PublishNeighbourhoodRequest.d.ts +2 -2
- package/lib/src/generated/api/QuerySubscriptionUpdate.d.ts +19 -0
- package/lib/src/generated/api/QuerySubscriptionUpdate.js +2 -0
- package/lib/src/generated/api/QuerySubscriptionUpdateEvent.d.ts +7 -0
- package/lib/src/generated/api/QuerySubscriptionUpdateEvent.js +1 -0
- package/lib/src/generated/api/QueryUpdatesLagged.d.ts +7 -0
- package/lib/src/generated/api/QueryUpdatesLagged.js +2 -0
- package/lib/src/generated/api/RemoveLinkRequest.d.ts +1 -1
- package/lib/src/generated/api/RemoveLinksBulkRequest.d.ts +1 -1
- package/lib/src/generated/api/RemoveSubjectRequest.d.ts +9 -0
- package/lib/src/generated/api/RemoveSubjectRequest.js +2 -0
- package/lib/src/generated/api/RequestCapabilityRequest.d.ts +4 -0
- package/lib/src/generated/api/RequestCapabilityRequest.js +1 -0
- package/lib/src/generated/api/RequestPaymentRequest.d.ts +3 -0
- package/lib/src/generated/api/RequestPaymentRequest.js +2 -0
- package/lib/src/generated/api/Resource.d.ts +4 -0
- package/lib/src/generated/api/Resource.js +2 -0
- package/lib/src/generated/api/ResyncSubscriptionRequest.d.ts +3 -0
- package/lib/src/generated/api/ResyncSubscriptionRequest.js +2 -0
- package/lib/src/generated/api/RpcMethods.d.ts +961 -0
- package/lib/src/generated/api/RpcMethods.js +98 -0
- package/lib/src/generated/api/RunInterpretationRequest.d.ts +27 -1
- package/lib/src/generated/api/RunInterpretationWithHarnessRequest.d.ts +52 -0
- package/lib/src/generated/api/RunInterpretationWithHarnessRequest.js +1 -0
- package/lib/src/generated/api/RuntimeComputeLogParams.d.ts +14 -0
- package/lib/src/generated/api/RuntimeComputeLogParams.js +2 -0
- package/lib/src/generated/api/RuntimeFriendStatusParams.d.ts +3 -0
- package/lib/src/generated/api/RuntimeFriendStatusParams.js +2 -0
- package/lib/src/generated/api/RuntimeGrantNotificationParams.d.ts +4 -0
- package/lib/src/generated/api/RuntimeGrantNotificationParams.js +2 -0
- package/lib/src/generated/api/RuntimeImportPerspectiveResult.d.ts +4 -0
- package/lib/src/generated/api/RuntimeImportPerspectiveResult.js +2 -0
- package/lib/src/generated/api/RuntimeImportResult.d.ts +6 -0
- package/lib/src/generated/api/RuntimeImportResult.js +1 -0
- package/lib/src/generated/api/RuntimeInfo.d.ts +5 -0
- package/lib/src/generated/api/RuntimeInfo.js +2 -0
- package/lib/src/generated/api/RuntimeNotificationIdParams.d.ts +3 -0
- package/lib/src/generated/api/RuntimeNotificationIdParams.js +2 -0
- package/lib/src/generated/api/RuntimeSendFriendMessageParams.d.ts +8 -0
- package/lib/src/generated/api/RuntimeSendFriendMessageParams.js +1 -0
- package/lib/src/generated/api/RuntimeSetFreeHostingEnabledParams.d.ts +3 -0
- package/lib/src/generated/api/RuntimeSetFreeHostingEnabledParams.js +2 -0
- package/lib/src/generated/api/RuntimeUnytSendHotParams.d.ts +4 -0
- package/lib/src/generated/api/RuntimeUnytSendHotParams.js +2 -0
- package/lib/src/generated/api/RuntimeUnytWalletHistoryParams.d.ts +4 -0
- package/lib/src/generated/api/RuntimeUnytWalletHistoryParams.js +2 -0
- package/lib/src/generated/api/RuntimeUpdateNotificationParams.d.ts +11 -0
- package/lib/src/generated/api/RuntimeUpdateNotificationParams.js +2 -0
- package/lib/src/generated/api/SentMessage.d.ts +5 -0
- package/lib/src/generated/api/SentMessage.js +1 -0
- package/lib/src/generated/api/SetHostRatesRequest.d.ts +4 -0
- package/lib/src/generated/api/SetHostRatesRequest.js +1 -0
- package/lib/src/generated/api/SetHotWalletAddressRequest.d.ts +3 -0
- package/lib/src/generated/api/SetHotWalletAddressRequest.js +2 -0
- package/lib/src/generated/api/SetOnlineStatusRequest.d.ts +4 -0
- package/lib/src/generated/api/SetOnlineStatusRequest.js +2 -0
- package/lib/src/generated/api/SetUnytMembraneProofRequest.d.ts +6 -0
- package/lib/src/generated/api/SetUnytMembraneProofRequest.js +2 -0
- package/lib/src/generated/api/SetUserFreeAccessRequest.d.ts +4 -0
- package/lib/src/generated/api/SetUserFreeAccessRequest.js +2 -0
- package/lib/src/generated/api/SfuAddIceCandidateParams.d.ts +8 -0
- package/lib/src/generated/api/SfuAddIceCandidateParams.js +2 -0
- package/lib/src/generated/api/SfuAnswerServerOfferParams.d.ts +8 -0
- package/lib/src/generated/api/SfuAnswerServerOfferParams.js +2 -0
- package/lib/src/generated/api/SfuCallJoinParams.d.ts +14 -0
- package/lib/src/generated/api/SfuCallJoinParams.js +2 -0
- package/lib/src/generated/api/SfuCallRenegotiationOffer.d.ts +30 -0
- package/lib/src/generated/api/SfuCallRenegotiationOffer.js +1 -0
- package/lib/src/generated/api/SfuCascadePipe.d.ts +4 -0
- package/lib/src/generated/api/SfuCascadePipe.js +2 -0
- package/lib/src/generated/api/SfuCascadeStatus.d.ts +8 -0
- package/lib/src/generated/api/SfuCascadeStatus.js +1 -0
- package/lib/src/generated/api/SfuConfig.d.ts +52 -0
- package/lib/src/generated/api/SfuConfig.js +1 -0
- package/lib/src/generated/api/SfuDataMessage.d.ts +24 -0
- package/lib/src/generated/api/SfuDataMessage.js +2 -0
- package/lib/src/generated/api/SfuEnsureMembershipParams.d.ts +4 -0
- package/lib/src/generated/api/SfuEnsureMembershipParams.js +2 -0
- package/lib/src/generated/api/SfuMigrateEvent.d.ts +21 -0
- package/lib/src/generated/api/SfuMigrateEvent.js +2 -0
- package/lib/src/generated/api/SfuNeighbourhoodParams.d.ts +3 -0
- package/lib/src/generated/api/SfuNeighbourhoodParams.js +2 -0
- package/lib/src/generated/api/SfuParticipantQualityPreference.d.ts +7 -0
- package/lib/src/generated/api/SfuParticipantQualityPreference.js +2 -0
- package/lib/src/generated/api/SfuPerspectiveParams.d.ts +6 -0
- package/lib/src/generated/api/SfuPerspectiveParams.js +2 -0
- package/lib/src/generated/api/SfuQualityPreferenceParams.d.ts +8 -0
- package/lib/src/generated/api/SfuQualityPreferenceParams.js +2 -0
- package/lib/src/generated/api/SfuRoomInfo.d.ts +11 -0
- package/lib/src/generated/api/SfuRoomInfo.js +1 -0
- package/lib/src/generated/api/SfuRoomParams.d.ts +4 -0
- package/lib/src/generated/api/SfuRoomParams.js +2 -0
- package/lib/src/generated/api/SfuRoomParticipantInfo.d.ts +11 -0
- package/lib/src/generated/api/SfuRoomParticipantInfo.js +2 -0
- package/lib/src/generated/api/SfuRoomRoster.d.ts +13 -0
- package/lib/src/generated/api/SfuRoomRoster.js +2 -0
- package/lib/src/generated/api/SfuSendDataParams.d.ts +10 -0
- package/lib/src/generated/api/SfuSendDataParams.js +2 -0
- package/lib/src/generated/api/SfuSetConfigParams.d.ts +5 -0
- package/lib/src/generated/api/SfuSetConfigParams.js +1 -0
- package/lib/src/generated/api/SfuStatus.d.ts +24 -0
- package/lib/src/generated/api/SfuStatus.js +2 -0
- package/lib/src/generated/api/ShaclLinkTriple.d.ts +10 -0
- package/lib/src/generated/api/ShaclLinkTriple.js +2 -0
- package/lib/src/generated/api/SignalRequest.d.ts +5 -0
- package/lib/src/generated/api/SignalRequest.js +2 -0
- package/lib/src/generated/api/SubscribeQueryRequest.d.ts +3 -0
- package/lib/src/generated/api/SubscribeQueryRequest.js +2 -0
- package/lib/src/generated/api/TokenizerSource.d.ts +5 -0
- package/lib/src/generated/api/TokenizerSource.js +2 -0
- package/lib/src/generated/api/TokenizerSourceInput.d.ts +5 -0
- package/lib/src/generated/api/TokenizerSourceInput.js +2 -0
- package/lib/src/generated/api/TrackMapEntry.d.ts +17 -0
- package/lib/src/generated/api/TrackMapEntry.js +2 -0
- package/lib/src/generated/api/TranscriptionTextFilter.d.ts +5 -0
- package/lib/src/generated/api/TranscriptionTextFilter.js +2 -0
- package/lib/src/generated/api/TriggeredNotification.d.ts +6 -0
- package/lib/src/generated/api/TriggeredNotification.js +1 -0
- package/lib/src/generated/api/TrustedAgentsWrapper.d.ts +6 -0
- package/lib/src/generated/api/TrustedAgentsWrapper.js +2 -0
- package/lib/src/generated/api/UnlockAgentRequest.d.ts +1 -1
- package/lib/src/generated/api/UnytVersionInfo.d.ts +19 -0
- package/lib/src/generated/api/UnytVersionInfo.js +2 -0
- package/lib/src/generated/api/UpdateLinkRequest.d.ts +1 -1
- package/lib/src/generated/api/UpdateProfileRequest.d.ts +5 -0
- package/lib/src/generated/api/UpdateProfileRequest.js +1 -0
- package/lib/src/generated/api/UpdateSubjectRequest.d.ts +12 -0
- package/lib/src/generated/api/UpdateSubjectRequest.js +2 -0
- package/lib/src/generated/api/UserCreationResult.d.ts +5 -0
- package/lib/src/generated/api/UserCreationResult.js +2 -0
- package/lib/src/generated/api/UserStatistics.d.ts +2 -1
- package/lib/src/generated/api/UserStatistics.js +0 -1
- package/lib/src/generated/api/UsersAppInfo.d.ts +6 -0
- package/lib/src/generated/api/UsersAppInfo.js +2 -0
- package/lib/src/generated/api/UsersEmailParams.d.ts +3 -0
- package/lib/src/generated/api/UsersEmailParams.js +2 -0
- package/lib/src/generated/api/UsersEmailTestAction.d.ts +1 -0
- package/lib/src/generated/api/UsersEmailTestAction.js +2 -0
- package/lib/src/generated/api/UsersEmailTestParams.d.ts +14 -0
- package/lib/src/generated/api/UsersEmailTestParams.js +1 -0
- package/lib/src/generated/api/UsersEmailTestResult.d.ts +5 -0
- package/lib/src/generated/api/UsersEmailTestResult.js +2 -0
- package/lib/src/generated/api/UsersLoginParams.d.ts +8 -0
- package/lib/src/generated/api/UsersLoginParams.js +2 -0
- package/lib/src/generated/api/UsersRequestVerificationParams.d.ts +5 -0
- package/lib/src/generated/api/UsersRequestVerificationParams.js +1 -0
- package/lib/src/generated/api/UsersSetCreditsParams.d.ts +4 -0
- package/lib/src/generated/api/UsersSetCreditsParams.js +2 -0
- package/lib/src/generated/api/UsersVerifyEmailParams.d.ts +12 -0
- package/lib/src/generated/api/UsersVerifyEmailParams.js +2 -0
- package/lib/src/generated/api/ValidOutput.d.ts +29 -0
- package/lib/src/generated/api/ValidOutput.js +1 -0
- package/lib/src/generated/api/VoiceActivityParamsInput.d.ts +7 -0
- package/lib/src/generated/api/VoiceActivityParamsInput.js +2 -0
- package/lib/src/generated/api/index.d.ts +11 -0
- package/lib/src/generated/api/index.js +5 -3
- package/lib/src/generated/api/serde_json/JsonValue.d.ts +3 -0
- package/lib/src/generated/api/serde_json/JsonValue.js +2 -0
- package/lib/src/index.d.ts +9 -3
- package/lib/src/index.js +5 -3
- package/lib/src/language/LanguageClient.d.ts +3 -3
- package/lib/src/language/LanguageClient.js +6 -6
- package/lib/src/language/LanguageMeta.d.ts +1 -1
- package/lib/src/links/Links.d.ts +16 -5
- package/lib/src/links/Links.js +34 -0
- package/lib/src/model/Ad4mModel.d.ts +84 -0
- package/lib/src/model/Ad4mModel.js +365 -72
- package/lib/src/model/ModelQueryBuilder.d.ts +15 -13
- package/lib/src/model/ModelQueryBuilder.js +78 -221
- package/lib/src/model/decorators.d.ts +52 -2
- package/lib/src/model/decorators.js +83 -8
- package/lib/src/model/query-sparql.js +2 -3
- package/lib/src/model/shacl-gen.d.ts +3 -1
- package/lib/src/model/shacl-gen.js +40 -10
- package/lib/src/model/types.d.ts +19 -0
- package/lib/src/neighbourhood/MeshManager.d.ts +384 -0
- package/lib/src/neighbourhood/MeshManager.js +1144 -0
- package/lib/src/neighbourhood/Neighbourhood.d.ts +1 -1
- package/lib/src/neighbourhood/NeighbourhoodClient.d.ts +96 -5
- package/lib/src/neighbourhood/NeighbourhoodClient.js +211 -15
- package/lib/src/neighbourhood/NeighbourhoodProxy.d.ts +55 -1
- package/lib/src/neighbourhood/NeighbourhoodProxy.js +170 -3
- package/lib/src/neighbourhood/Session.d.ts +105 -0
- package/lib/src/neighbourhood/Session.js +412 -0
- package/lib/src/neighbourhood/SfuManager.d.ts +174 -0
- package/lib/src/neighbourhood/SfuManager.js +619 -0
- package/lib/src/neighbourhood/SfuTypes.d.ts +35 -0
- package/lib/src/neighbourhood/SfuTypes.js +8 -0
- package/lib/src/notifyListeners.d.ts +2 -0
- package/lib/src/notifyListeners.js +12 -0
- package/lib/src/perspectives/AutoProcessor.d.ts +12 -80
- package/lib/src/perspectives/FlowInstance.d.ts +73 -26
- package/lib/src/perspectives/FlowInstance.js +96 -31
- package/lib/src/perspectives/FlowModels.d.ts +30 -9
- package/lib/src/perspectives/FlowModels.js +43 -14
- package/lib/src/perspectives/InterpretationModels.d.ts +2 -0
- package/lib/src/perspectives/InterpretationModels.js +6 -0
- package/lib/src/perspectives/LiveQuery.d.ts +49 -0
- package/lib/src/perspectives/LiveQuery.js +169 -0
- package/lib/src/perspectives/Perspective.d.ts +8 -1
- package/lib/src/perspectives/Perspective.js +11 -0
- package/lib/src/perspectives/PerspectiveClient.d.ts +38 -65
- package/lib/src/perspectives/PerspectiveClient.js +87 -257
- package/lib/src/perspectives/PerspectiveDiff.d.ts +1 -1
- package/lib/src/perspectives/PerspectiveHandle.d.ts +15 -8
- package/lib/src/perspectives/PerspectiveHandle.js +25 -9
- package/lib/src/perspectives/PerspectiveProxy.d.ts +102 -228
- package/lib/src/perspectives/PerspectiveProxy.js +247 -673
- package/lib/src/perspectives/TextContent.d.ts +31 -0
- package/lib/src/perspectives/TextContent.js +52 -0
- package/lib/src/perspectives/WakerSubscriptionManager.d.ts +23 -0
- package/lib/src/perspectives/WakerSubscriptionManager.js +58 -21
- package/lib/src/runtime/RuntimeClient.d.ts +15 -27
- package/lib/src/runtime/RuntimeClient.js +57 -113
- package/lib/src/runtime/RuntimeTypes.d.ts +2 -2
- package/lib/src/runtime/RuntimeTypes.js +2 -2
- package/lib/src/shacl/SHACLFlow.d.ts +34 -6
- package/lib/src/shacl/SHACLFlow.js +62 -15
- package/lib/src/shacl/SHACLShape.d.ts +12 -0
- package/lib/src/shacl/SHACLShape.js +206 -321
- package/package.json +15 -16
- package/pnpm-workspace.yaml +4 -1
- package/src/Ad4mClient.test.ts +481 -144
- package/src/Ad4mClient.ts +16 -12
- package/src/Literal.test.ts +32 -0
- package/src/Literal.ts +3 -3
- package/src/agent/Agent.ts +8 -0
- package/src/agent/AgentClient.ts +87 -195
- package/src/agent/mutatePublicPerspective.test.ts +110 -0
- package/src/ai/AIClient.ts +40 -43
- package/src/ai/transcription-stream.test.ts +54 -0
- package/src/apiClient.test.ts +613 -185
- package/src/apiClient.ts +282 -288
- package/src/cache/cache.test.ts +7 -8
- package/src/expression/Expression.ts +12 -3
- package/src/expression/ExpressionClient.ts +6 -7
- package/src/generated/api/AIPromptExamples.ts +3 -0
- package/src/generated/api/AIPromptExamplesInput.ts +3 -0
- package/src/generated/api/AITask.ts +4 -0
- package/src/generated/api/AITaskInput.ts +4 -0
- package/src/generated/api/AddAgentInfosRequest.ts +3 -0
- package/src/generated/api/AddLinkExpressionRequest.ts +1 -1
- package/src/generated/api/AddLinkRequest.ts +1 -1
- package/src/generated/api/AddLinksBulkRequest.ts +1 -1
- package/src/generated/api/AddSdnaRequest.ts +1 -1
- package/src/generated/api/Agent.ts +4 -0
- package/src/generated/api/AgentAddEntanglementProofsParams.ts +8 -0
- package/src/generated/api/AgentByDidParams.ts +3 -0
- package/src/generated/api/AgentRemoveAppParams.ts +3 -0
- package/src/generated/api/AgentRevokeTokenParams.ts +3 -0
- package/src/generated/api/AgentSignature.ts +3 -0
- package/src/generated/api/AgentStatus.ts +4 -0
- package/src/generated/api/AgentStatusChangedEvent.ts +7 -0
- package/src/generated/api/AgentUpdatedEvent.ts +7 -0
- package/src/generated/api/AgentsByDidsRequest.ts +3 -0
- package/src/generated/api/AiAddModelParams.ts +4 -0
- package/src/generated/api/AiAddTaskParams.ts +4 -0
- package/src/generated/api/AiDiscoverModelsParams.ts +7 -0
- package/src/generated/api/AiGetDefaultModelParams.ts +4 -0
- package/src/generated/api/AiIdParams.ts +3 -0
- package/src/generated/api/AiModelLoadingStatusParams.ts +6 -0
- package/src/generated/api/AiSetDefaultModelParams.ts +4 -0
- package/src/generated/api/AiTranscriptionCloseParams.ts +3 -0
- package/src/generated/api/AiTranscriptionOpenParams.ts +4 -0
- package/src/generated/api/AiUpdateModelParams.ts +4 -0
- package/src/generated/api/AiUpdateTaskParams.ts +4 -0
- package/src/generated/api/Apps.ts +4 -0
- package/src/generated/api/AuthInfo.ts +4 -0
- package/src/generated/api/AuthInfoInput.ts +1 -1
- package/src/generated/api/AutoProcessorEvent.ts +90 -0
- package/src/generated/api/AutoProcessorNeighbourhoodState.ts +33 -0
- package/src/generated/api/AutoProcessorStep.ts +9 -0
- package/src/generated/api/BroadcastRequest.ts +3 -0
- package/src/generated/api/CallSessionInfo.ts +20 -0
- package/src/generated/api/Capability.ts +4 -0
- package/src/generated/api/CreateSubjectRequest.ts +1 -1
- package/src/generated/api/CreateUserRequest.ts +3 -0
- package/src/generated/api/DateTime.ts +3 -0
- package/src/generated/api/DecoratedExpressionProof.ts +3 -0
- package/src/generated/api/DecoratedLinkExpression.ts +6 -0
- package/src/generated/api/DecoratedNeighbourhoodExpression.ts +5 -0
- package/src/generated/api/DecoratedPerspective.ts +4 -0
- package/src/generated/api/DiscardBatchRequest.ts +3 -0
- package/src/generated/api/DisposeQueryRequest.ts +3 -0
- package/src/generated/api/EntanglementProof.ts +3 -0
- package/src/generated/api/EntanglementProofInput.ts +1 -1
- package/src/generated/api/EntanglementProofPreflightRequest.ts +3 -0
- package/src/generated/api/EntanglementProofsWrapper.ts +7 -0
- package/src/generated/api/Events.ts +77 -0
- package/src/generated/api/ExceptionInfo.ts +4 -0
- package/src/generated/api/ExceptionOccurredEvent.ts +7 -0
- package/src/generated/api/ExceptionType.ts +3 -0
- package/src/generated/api/ExecuteCommandsRequest.ts +1 -1
- package/src/generated/api/ExportRequest.ts +1 -1
- package/src/generated/api/ExpressionInteractRequest.ts +4 -0
- package/src/generated/api/ExpressionProofInput.ts +1 -1
- package/src/generated/api/ExpressionRendered.ts +6 -0
- package/src/generated/api/ExpressionUrlRequest.ts +3 -0
- package/src/generated/api/FireOutcome.ts +11 -0
- package/src/generated/api/FlowStateChangedEvent.ts +36 -0
- package/src/generated/api/FlowStateEntry.ts +18 -0
- package/src/generated/api/FriendSendMessageRequest.ts +1 -1
- package/src/generated/api/HostRate.ts +6 -0
- package/src/generated/api/HostingInfoResult.ts +13 -0
- package/src/generated/api/HostingInfoUser.ts +7 -0
- package/src/generated/api/HostingRequestPaymentResult.ts +3 -0
- package/src/generated/api/HostingUserInfo.ts +3 -0
- package/src/generated/api/HostingVersionInfo.ts +7 -0
- package/src/generated/api/HostingWalletResult.ts +8 -0
- package/src/generated/api/IceServer.ts +19 -0
- package/src/generated/api/Icon.ts +3 -0
- package/src/generated/api/ImportResult.ts +4 -0
- package/src/generated/api/ImportStats.ts +3 -0
- package/src/generated/api/InteractionCall.ts +3 -0
- package/src/generated/api/InteractionCallWrapper.ts +6 -0
- package/src/generated/api/InteractionMeta.ts +4 -0
- package/src/generated/api/InteractionParameter.ts +3 -0
- package/src/generated/api/LanguageAddressParams.ts +3 -0
- package/src/generated/api/LanguageHandle.ts +4 -0
- package/src/generated/api/LanguageListParams.ts +3 -0
- package/src/generated/api/LanguageMeta.ts +3 -0
- package/src/generated/api/LanguageMetaInput.ts +1 -1
- package/src/generated/api/LanguageRef.ts +3 -0
- package/src/generated/api/LanguageSettingsWrapper.ts +6 -0
- package/src/generated/api/LanguageWriteSettingsParams.ts +3 -0
- package/src/generated/api/LinkExpressionInput.ts +1 -1
- package/src/generated/api/LinkInput.ts +1 -1
- package/src/generated/api/LinkMutationRequest.ts +8 -0
- package/src/generated/api/LinkMutationsRequest.ts +4 -0
- package/src/generated/api/LinkStatus.ts +1 -1
- package/src/generated/api/LinkUpdateInput.ts +4 -0
- package/src/generated/api/LocalModel.ts +4 -0
- package/src/generated/api/LocalModelInput.ts +4 -0
- package/src/generated/api/MessageReceivedEvent.ts +7 -0
- package/src/generated/api/Model.ts +6 -0
- package/src/generated/api/ModelApi.ts +14 -0
- package/src/generated/api/ModelApiInput.ts +8 -0
- package/src/generated/api/ModelApiType.ts +3 -0
- package/src/generated/api/ModelInput.ts +6 -0
- package/src/generated/api/ModelType.ts +1 -1
- package/src/generated/api/Neighbourhood.ts +4 -0
- package/src/generated/api/NeighbourhoodBroadcastParams.ts +4 -0
- package/src/generated/api/NeighbourhoodOnlineStatusParams.ts +4 -0
- package/src/generated/api/NeighbourhoodPerspectivePayload.ts +9 -0
- package/src/generated/api/NeighbourhoodPhase.ts +8 -0
- package/src/generated/api/NeighbourhoodSignalFilter.ts +5 -0
- package/src/generated/api/NeighbourhoodSignalParams.ts +4 -0
- package/src/generated/api/NeighbourhoodSignedPerspective.ts +8 -0
- package/src/generated/api/NeighbourhoodUuidParams.ts +3 -0
- package/src/generated/api/Notification.ts +7 -0
- package/src/generated/api/NotificationGrantRequest.ts +6 -0
- package/src/generated/api/NotificationInput.ts +1 -1
- package/src/generated/api/NotificationTriggeredEvent.ts +8 -0
- package/src/generated/api/OnlineAgent.ts +9 -0
- package/src/generated/api/OutputRef.ts +11 -0
- package/src/generated/api/OverlayView.ts +25 -0
- package/src/generated/api/Perspective.ts +4 -0
- package/src/generated/api/PerspectiveAddAutoProcessorParams.ts +11 -0
- package/src/generated/api/PerspectiveAddLinkExpressionParams.ts +4 -0
- package/src/generated/api/PerspectiveAddLinkParams.ts +4 -0
- package/src/generated/api/PerspectiveAddLinksParams.ts +4 -0
- package/src/generated/api/PerspectiveAddSdnaParams.ts +7 -0
- package/src/generated/api/PerspectiveAddSdnaResult.ts +6 -0
- package/src/generated/api/PerspectiveCommitBatchParams.ts +3 -0
- package/src/generated/api/PerspectiveCreateSubjectParams.ts +3 -0
- package/src/generated/api/PerspectiveDiscardBatchParams.ts +3 -0
- package/src/generated/api/PerspectiveEvaluateGettersParams.ts +6 -0
- package/src/generated/api/PerspectiveExecuteCommandsParams.ts +3 -0
- package/src/generated/api/PerspectiveExpression.ts +5 -0
- package/src/generated/api/PerspectiveFlowFiredParams.ts +7 -0
- package/src/generated/api/PerspectiveFlowProposalParams.ts +3 -0
- package/src/generated/api/PerspectiveFlowReceiptVerdict.ts +8 -0
- package/src/generated/api/PerspectiveFlowStatesParams.ts +11 -0
- package/src/generated/api/PerspectiveFlowValidOutputsParams.ts +7 -0
- package/src/generated/api/PerspectiveGetAllShaclParams.ts +6 -0
- package/src/generated/api/PerspectiveGetSubjectDataParams.ts +3 -0
- package/src/generated/api/PerspectiveHandle.ts +5 -0
- package/src/generated/api/PerspectiveLinkDiff.ts +7 -0
- package/src/generated/api/PerspectiveLinkMutationsParams.ts +4 -0
- package/src/generated/api/PerspectiveLinkUpdatedWithOwner.ts +4 -0
- package/src/generated/api/PerspectiveLinkWithOwner.ts +4 -0
- package/src/generated/api/PerspectiveMintFlowReceiptParams.ts +3 -0
- package/src/generated/api/PerspectiveMintFlowReceiptResult.ts +9 -0
- package/src/generated/api/PerspectiveModelQueryParams.ts +10 -0
- package/src/generated/api/PerspectiveNamedShacl.ts +4 -0
- package/src/generated/api/PerspectiveProposeFlowTransitionParams.ts +4 -0
- package/src/generated/api/PerspectiveQueryLinksParams.ts +11 -0
- package/src/generated/api/PerspectiveQueryParams.ts +3 -0
- package/src/generated/api/PerspectiveReceiptOutcome.ts +3 -0
- package/src/generated/api/PerspectiveRejectFlowProposalResult.ts +3 -0
- package/src/generated/api/PerspectiveRemoveAutoProcessorParams.ts +3 -0
- package/src/generated/api/PerspectiveRemoveLinkParams.ts +4 -0
- package/src/generated/api/PerspectiveRemoveLinksParams.ts +4 -0
- package/src/generated/api/PerspectiveRemoveSubjectParams.ts +3 -0
- package/src/generated/api/PerspectiveRemovedWithOwner.ts +3 -0
- package/src/generated/api/PerspectiveResolveInterpretationParams.ts +6 -0
- package/src/generated/api/PerspectiveResynced.ts +7 -0
- package/src/generated/api/PerspectiveShacl.ts +4 -0
- package/src/generated/api/PerspectiveShaclNameParams.ts +3 -0
- package/src/generated/api/PerspectiveSparqlParams.ts +7 -0
- package/src/generated/api/PerspectiveState.ts +3 -0
- package/src/generated/api/PerspectiveStateFilter.ts +5 -0
- package/src/generated/api/PerspectiveSubjectClassesOfParams.ts +3 -0
- package/src/generated/api/PerspectiveSubscribed.ts +8 -0
- package/src/generated/api/PerspectiveSubscriptionParams.ts +3 -0
- package/src/generated/api/PerspectiveUnsignedInput.ts +4 -0
- package/src/generated/api/PerspectiveUpdateLinkParams.ts +5 -0
- package/src/generated/api/PerspectiveUpdateParams.ts +3 -0
- package/src/generated/api/PerspectiveUpdateSubjectParams.ts +7 -0
- package/src/generated/api/PerspectiveUuidParams.ts +3 -0
- package/src/generated/api/PerspectiveVerifyFlowReceiptParams.ts +9 -0
- package/src/generated/api/PerspectiveWithOwner.ts +4 -0
- package/src/generated/api/ProposeOutcome.ts +46 -0
- package/src/generated/api/PublicPerspectiveInput.ts +4 -0
- package/src/generated/api/PublishNeighbourhoodRequest.ts +2 -2
- package/src/generated/api/QuerySubscriptionUpdate.ts +10 -0
- package/src/generated/api/QuerySubscriptionUpdateEvent.ts +9 -0
- package/src/generated/api/QueryUpdatesLagged.ts +7 -0
- package/src/generated/api/RemoveLinkRequest.ts +1 -1
- package/src/generated/api/RemoveLinksBulkRequest.ts +1 -1
- package/src/generated/api/RemoveSubjectRequest.ts +7 -0
- package/src/generated/api/RequestCapabilityRequest.ts +4 -0
- package/src/generated/api/RequestPaymentRequest.ts +3 -0
- package/src/generated/api/Resource.ts +3 -0
- package/src/generated/api/ResyncSubscriptionRequest.ts +3 -0
- package/src/generated/api/RpcMethods.ts +479 -0
- package/src/generated/api/RunInterpretationRequest.ts +28 -2
- package/src/generated/api/RunInterpretationWithHarnessRequest.ts +51 -0
- package/src/generated/api/RuntimeComputeLogParams.ts +15 -0
- package/src/generated/api/RuntimeFriendStatusParams.ts +3 -0
- package/src/generated/api/RuntimeGrantNotificationParams.ts +3 -0
- package/src/generated/api/RuntimeImportPerspectiveResult.ts +3 -0
- package/src/generated/api/RuntimeImportResult.ts +8 -0
- package/src/generated/api/RuntimeInfo.ts +3 -0
- package/src/generated/api/RuntimeNotificationIdParams.ts +3 -0
- package/src/generated/api/RuntimeSendFriendMessageParams.ts +8 -0
- package/src/generated/api/RuntimeSetFreeHostingEnabledParams.ts +3 -0
- package/src/generated/api/RuntimeUnytSendHotParams.ts +3 -0
- package/src/generated/api/RuntimeUnytWalletHistoryParams.ts +3 -0
- package/src/generated/api/RuntimeUpdateNotificationParams.ts +3 -0
- package/src/generated/api/SentMessage.ts +4 -0
- package/src/generated/api/SetHostRatesRequest.ts +4 -0
- package/src/generated/api/SetHotWalletAddressRequest.ts +3 -0
- package/src/generated/api/SetOnlineStatusRequest.ts +3 -0
- package/src/generated/api/SetUnytMembraneProofRequest.ts +7 -0
- package/src/generated/api/SetUserFreeAccessRequest.ts +3 -0
- package/src/generated/api/SfuAddIceCandidateParams.ts +7 -0
- package/src/generated/api/SfuAnswerServerOfferParams.ts +7 -0
- package/src/generated/api/SfuCallJoinParams.ts +13 -0
- package/src/generated/api/SfuCallRenegotiationOffer.ts +29 -0
- package/src/generated/api/SfuCascadePipe.ts +3 -0
- package/src/generated/api/SfuCascadeStatus.ts +7 -0
- package/src/generated/api/SfuConfig.ts +53 -0
- package/src/generated/api/SfuDataMessage.ts +23 -0
- package/src/generated/api/SfuEnsureMembershipParams.ts +3 -0
- package/src/generated/api/SfuMigrateEvent.ts +20 -0
- package/src/generated/api/SfuNeighbourhoodParams.ts +3 -0
- package/src/generated/api/SfuParticipantQualityPreference.ts +6 -0
- package/src/generated/api/SfuPerspectiveParams.ts +6 -0
- package/src/generated/api/SfuQualityPreferenceParams.ts +7 -0
- package/src/generated/api/SfuRoomInfo.ts +7 -0
- package/src/generated/api/SfuRoomParams.ts +3 -0
- package/src/generated/api/SfuRoomParticipantInfo.ts +8 -0
- package/src/generated/api/SfuRoomRoster.ts +12 -0
- package/src/generated/api/SfuSendDataParams.ts +7 -0
- package/src/generated/api/SfuSetConfigParams.ts +4 -0
- package/src/generated/api/SfuStatus.ts +24 -0
- package/src/generated/api/ShaclLinkTriple.ts +8 -0
- package/src/generated/api/SignalRequest.ts +3 -0
- package/src/generated/api/SubscribeQueryRequest.ts +3 -0
- package/src/generated/api/TokenizerSource.ts +3 -0
- package/src/generated/api/TokenizerSourceInput.ts +3 -0
- package/src/generated/api/TrackMapEntry.ts +18 -0
- package/src/generated/api/TranscriptionTextFilter.ts +3 -0
- package/src/generated/api/TriggeredNotification.ts +4 -0
- package/src/generated/api/TrustedAgentsWrapper.ts +6 -0
- package/src/generated/api/UnlockAgentRequest.ts +1 -1
- package/src/generated/api/UnytVersionInfo.ts +20 -0
- package/src/generated/api/UpdateLinkRequest.ts +1 -1
- package/src/generated/api/UpdateProfileRequest.ts +4 -0
- package/src/generated/api/UpdateSubjectRequest.ts +10 -0
- package/src/generated/api/UserCreationResult.ts +3 -0
- package/src/generated/api/UserStatistics.ts +2 -1
- package/src/generated/api/UsersAppInfo.ts +6 -0
- package/src/generated/api/UsersEmailParams.ts +3 -0
- package/src/generated/api/UsersEmailTestAction.ts +3 -0
- package/src/generated/api/UsersEmailTestParams.ts +12 -0
- package/src/generated/api/UsersEmailTestResult.ts +7 -0
- package/src/generated/api/UsersLoginParams.ts +7 -0
- package/src/generated/api/UsersRequestVerificationParams.ts +4 -0
- package/src/generated/api/UsersSetCreditsParams.ts +3 -0
- package/src/generated/api/UsersVerifyEmailParams.ts +11 -0
- package/src/generated/api/ValidOutput.ts +30 -0
- package/src/generated/api/VoiceActivityParamsInput.ts +3 -0
- package/src/generated/api/index.ts +14 -2
- package/src/generated/api/serde_json/JsonValue.ts +3 -0
- package/src/index.ts +9 -3
- package/src/language/LanguageClient.ts +12 -13
- package/src/links/Links.ts +49 -3
- package/src/model/Ad4mModel.test.ts +480 -173
- package/src/model/Ad4mModel.ts +407 -77
- package/src/model/ModelQueryBuilder.ts +95 -255
- package/src/model/abstract-classes.test.ts +225 -0
- package/src/model/decorators.ts +145 -9
- package/src/model/query-sparql.ts +2 -3
- package/src/model/relation-filtering.test.ts +191 -0
- package/src/model/shacl-gen.ts +32 -9
- package/src/model/shacl-roundtrip.test.ts +52 -0
- package/src/model/types.ts +19 -0
- package/src/neighbourhood/MeshManager.test.ts +2640 -0
- package/src/neighbourhood/MeshManager.ts +1350 -0
- package/src/neighbourhood/NeighbourhoodClient.test.ts +60 -0
- package/src/neighbourhood/NeighbourhoodClient.ts +298 -27
- package/src/neighbourhood/NeighbourhoodProxy.test.ts +37 -9
- package/src/neighbourhood/NeighbourhoodProxy.ts +247 -1
- package/src/neighbourhood/Session.test.ts +800 -0
- package/src/neighbourhood/Session.ts +525 -0
- package/src/neighbourhood/SfuManager.test.ts +677 -0
- package/src/neighbourhood/SfuManager.ts +803 -0
- package/src/neighbourhood/SfuTypes.ts +40 -0
- package/src/notifyListeners.test.ts +19 -0
- package/src/notifyListeners.ts +10 -0
- package/src/perspectives/AutoProcessor.ts +13 -82
- package/src/perspectives/FlowInstance.ts +136 -32
- package/src/perspectives/FlowModels.ts +46 -11
- package/src/perspectives/InterpretationModels.ts +4 -0
- package/src/perspectives/LiveQuery.test.ts +197 -0
- package/src/perspectives/LiveQuery.ts +189 -0
- package/src/perspectives/Perspective.ts +18 -2
- package/src/perspectives/PerspectiveClient.test.ts +122 -45
- package/src/perspectives/PerspectiveClient.ts +146 -343
- package/src/perspectives/PerspectiveHandle.ts +32 -9
- package/src/perspectives/PerspectiveProxy.test.ts +216 -528
- package/src/perspectives/PerspectiveProxy.ts +259 -736
- package/src/perspectives/TextContent.test.ts +123 -0
- package/src/perspectives/TextContent.ts +36 -0
- package/src/perspectives/WakerSubscriptionManager.test.ts +136 -1
- package/src/perspectives/WakerSubscriptionManager.ts +69 -22
- package/src/perspectives/link-updated-type.test.ts +55 -0
- package/src/perspectives/listener-leaks.test.ts +204 -0
- package/src/perspectives/shacl-rpc.test.ts +22 -27
- package/src/runtime/RuntimeClient.ts +75 -157
- package/src/runtime/RuntimeTypes.ts +3 -3
- package/src/shacl/SHACLFlow.test.ts +49 -1
- package/src/shacl/SHACLFlow.ts +73 -15
- package/src/shacl/SHACLShape.test.ts +161 -16
- package/src/shacl/SHACLShape.ts +210 -439
- package/lib/shims/reflect-metadata.d.ts +0 -0
- package/lib/shims/reflect-metadata.js +0 -0
- package/lib/shims/type-graphql.d.ts +0 -32
- package/lib/shims/type-graphql.js +0 -70
- package/lib/src/PubSub.d.ts +0 -17
- package/lib/src/PubSub.js +0 -17
- package/lib/src/agent/AgentResolver.d.ts +0 -30
- package/lib/src/agent/AgentResolver.js +0 -325
- package/lib/src/ai/AIResolver.d.ts +0 -75
- package/lib/src/ai/AIResolver.js +0 -455
- package/lib/src/buildSchema.d.ts +0 -1
- package/lib/src/buildSchema.js +0 -38
- package/lib/src/expression/ExpressionResolver.d.ts +0 -10
- package/lib/src/expression/ExpressionResolver.js +0 -106
- package/lib/src/language/LanguageContext.d.ts +0 -37
- package/lib/src/language/LanguageContext.js +0 -2
- package/lib/src/language/LanguageResolver.d.ts +0 -19
- package/lib/src/language/LanguageResolver.js +0 -143
- package/lib/src/links/Links.test.js +0 -33
- package/lib/src/model/Ad4mModel.test.js +0 -2055
- package/lib/src/model/Subject.d.ts +0 -25
- package/lib/src/model/Subject.js +0 -164
- package/lib/src/model/hydration-batch.d.ts +0 -34
- package/lib/src/model/hydration-batch.js +0 -147
- package/lib/src/model/hydration-batching.test.d.ts +0 -7
- package/lib/src/model/hydration-batching.test.js +0 -456
- package/lib/src/model/model-manifest.d.ts +0 -41
- package/lib/src/model/model-manifest.js +0 -11
- package/lib/src/model/prolog-facts.d.ts +0 -37
- package/lib/src/model/prolog-facts.js +0 -134
- package/lib/src/model/query-cache.test.js +0 -43
- package/lib/src/model/query-prolog.d.ts +0 -15
- package/lib/src/model/query-prolog.js +0 -140
- package/lib/src/model/query-sparql-batch.d.ts +0 -17
- package/lib/src/model/query-sparql-batch.js +0 -260
- package/lib/src/model/query-sparql.test.js +0 -312
- package/lib/src/model/relation-filtering.test.js +0 -838
- package/lib/src/model/subscription-delta.test.d.ts +0 -24
- package/lib/src/model/subscription-delta.test.js +0 -180
- package/lib/src/model/subscription-pool.d.ts +0 -39
- package/lib/src/model/subscription-pool.js +0 -165
- package/lib/src/neighbourhood/NeighbourhoodProxy.test.js +0 -73
- package/lib/src/neighbourhood/NeighbourhoodResolver.d.ts +0 -24
- package/lib/src/neighbourhood/NeighbourhoodResolver.js +0 -182
- package/lib/src/perspectives/Perspective.test.js +0 -20
- package/lib/src/perspectives/PerspectiveClient.test.js +0 -224
- package/lib/src/perspectives/PerspectiveResolver.d.ts +0 -56
- package/lib/src/perspectives/PerspectiveResolver.js +0 -519
- package/lib/src/runtime/RuntimeResolver.d.ts +0 -173
- package/lib/src/runtime/RuntimeResolver.js +0 -1122
- package/lib/src/schema.gql +0 -631
- package/lib/src/shacl/SHACLFlow.test.js +0 -205
- package/lib/src/shacl/SHACLShape.test.js +0 -418
- package/lib/src/unwrapApolloResult.d.ts +0 -2
- package/lib/src/unwrapApolloResult.js +0 -14
- /package/lib/src/{links/Links.test.d.ts → generated/api/AITask.js} +0 -0
- /package/lib/src/{model/Ad4mModel.test.d.ts → generated/api/AITaskInput.js} +0 -0
- /package/lib/src/{model/query-cache.test.d.ts → generated/api/Agent.js} +0 -0
- /package/lib/src/{model/query-sparql.test.d.ts → generated/api/AgentAddEntanglementProofsParams.js} +0 -0
- /package/lib/src/{model/relation-filtering.test.d.ts → generated/api/AgentStatus.js} +0 -0
- /package/lib/src/{neighbourhood/NeighbourhoodProxy.test.d.ts → generated/api/AgentStatusChangedEvent.js} +0 -0
- /package/lib/src/{perspectives/Perspective.test.d.ts → generated/api/AgentUpdatedEvent.js} +0 -0
- /package/lib/src/{perspectives/PerspectiveClient.test.d.ts → generated/api/AiAddModelParams.js} +0 -0
- /package/lib/src/{shacl/SHACLFlow.test.d.ts → generated/api/AiAddTaskParams.js} +0 -0
- /package/lib/src/{shacl/SHACLShape.test.d.ts → generated/api/AiGetDefaultModelParams.js} +0 -0
package/src/model/Ad4mModel.ts
CHANGED
|
@@ -140,6 +140,105 @@ function applyPolymorphicIncludeDefaults(includes: IncludeMap, ctor: Function):
|
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
+
/**
|
|
144
|
+
* Split an include map into its relations and its `$`-prefixed projections.
|
|
145
|
+
*
|
|
146
|
+
* The two travel in different fields: a relation is hydrated, a projection is
|
|
147
|
+
* computed over one. Both halves are new objects, so the caller's query is left
|
|
148
|
+
* as it was written and can be sent again.
|
|
149
|
+
*/
|
|
150
|
+
function splitIncludeProjections(include: IncludeMap): {
|
|
151
|
+
includes: IncludeMap;
|
|
152
|
+
projections: Record<string, IncludeProjection>;
|
|
153
|
+
} {
|
|
154
|
+
const includes: IncludeMap = {};
|
|
155
|
+
const projections: Record<string, IncludeProjection> = {};
|
|
156
|
+
for (const [key, val] of Object.entries(include)) {
|
|
157
|
+
if (key.startsWith('$')) {
|
|
158
|
+
projections[key] = { ...(val as IncludeProjection) };
|
|
159
|
+
} else {
|
|
160
|
+
includes[key] = val;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
return { includes, projections };
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Tag each projection with its target class name, so the executor can resolve
|
|
168
|
+
* the target shape through its in-memory cache when applying a projection's
|
|
169
|
+
* where-clause. `ctor` is the class the projections are read against; without
|
|
170
|
+
* one (the members of a polymorphic relation) nothing is tagged, and the
|
|
171
|
+
* executor resolves each projection against each member's own class.
|
|
172
|
+
*/
|
|
173
|
+
function tagProjectionTargets(projections: Record<string, IncludeProjection>, ctor: Function | undefined): void {
|
|
174
|
+
if (!ctor) return;
|
|
175
|
+
const allRelMeta = getRelationsMetadata(ctor);
|
|
176
|
+
for (const proj of Object.values(projections)) {
|
|
177
|
+
const relMeta = allRelMeta[proj.from];
|
|
178
|
+
if (!proj.targetClassName && relMeta?.target) {
|
|
179
|
+
try {
|
|
180
|
+
const TargetClass = relMeta.target();
|
|
181
|
+
const targetMeta = (TargetClass as any).getModelMetadata?.();
|
|
182
|
+
if (targetMeta?.className) {
|
|
183
|
+
proj.targetClassName = targetMeta.className;
|
|
184
|
+
}
|
|
185
|
+
} catch (e) { console.debug(`prepareModelQueryParams: target class unavailable for projection:`, e); }
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Move the `$`-prefixed keys of every nested include into that sub-query's own
|
|
192
|
+
* `projections`, at every depth.
|
|
193
|
+
*
|
|
194
|
+
* The executor reads a sub-query exactly as it reads a top-level query, so a
|
|
195
|
+
* projection on related records belongs in the sub-query's `projections` field,
|
|
196
|
+
* as it does at the top. Left inside `include` it named a relation that does not
|
|
197
|
+
* exist and was skipped: the query succeeded and the field was simply absent, so
|
|
198
|
+
* `include: { posts: { include: { $likeCount: … } } }` came back without counts
|
|
199
|
+
* and said nothing.
|
|
200
|
+
*
|
|
201
|
+
* Copies every sub-query it changes rather than editing it, so a query object
|
|
202
|
+
* the caller keeps (a subscription re-preparing its query, say) still says what
|
|
203
|
+
* it said.
|
|
204
|
+
*/
|
|
205
|
+
function liftNestedProjections(includes: IncludeMap, ctor: Function | undefined): IncludeMap {
|
|
206
|
+
const relMeta = ctor ? getRelationsMetadata(ctor) : {};
|
|
207
|
+
const out: IncludeMap = {};
|
|
208
|
+
for (const [relName, val] of Object.entries(includes)) {
|
|
209
|
+
if (typeof val !== 'object' || val === null || relName.startsWith('$')) {
|
|
210
|
+
out[relName] = val;
|
|
211
|
+
continue;
|
|
212
|
+
}
|
|
213
|
+
const subQuery: any = { ...val };
|
|
214
|
+
// The class the nested keys are read against. A polymorphic relation's
|
|
215
|
+
// members are of several classes, so there is none to name: its nested
|
|
216
|
+
// projections go untagged and the executor resolves them per member class.
|
|
217
|
+
let TargetClass: Function | undefined;
|
|
218
|
+
if (!subQuery.polymorphic) {
|
|
219
|
+
try {
|
|
220
|
+
TargetClass = relMeta[relName]?.target?.();
|
|
221
|
+
} catch (e) {
|
|
222
|
+
console.debug(`prepareModelQueryParams: target class unavailable for include '${relName}':`, e);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
if (subQuery.include && typeof subQuery.include === 'object') {
|
|
226
|
+
const { includes: nestedIncludes, projections } = splitIncludeProjections(subQuery.include);
|
|
227
|
+
if (Object.keys(nestedIncludes).length > 0) {
|
|
228
|
+
subQuery.include = liftNestedProjections(nestedIncludes, TargetClass);
|
|
229
|
+
} else {
|
|
230
|
+
delete subQuery.include;
|
|
231
|
+
}
|
|
232
|
+
if (Object.keys(projections).length > 0) {
|
|
233
|
+
tagProjectionTargets(projections, TargetClass);
|
|
234
|
+
subQuery.projections = { ...(subQuery.projections ?? {}), ...projections };
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
out[relName] = subQuery;
|
|
238
|
+
}
|
|
239
|
+
return out;
|
|
240
|
+
}
|
|
241
|
+
|
|
143
242
|
function jsonToModelInstance<T extends Ad4mModel>(
|
|
144
243
|
ModelClass: typeof Ad4mModel & (new (...args: any[]) => T),
|
|
145
244
|
perspective: PerspectiveProxy,
|
|
@@ -538,6 +637,7 @@ export class Ad4mModel {
|
|
|
538
637
|
predicate: options.predicate || "",
|
|
539
638
|
...(options.local !== undefined && { local: options.local }),
|
|
540
639
|
...(options.getter !== undefined && { getter: options.getter }),
|
|
640
|
+
...(options.readOnly && { readOnly: true }),
|
|
541
641
|
direction: (options.kind === 'belongsToMany' || options.kind === 'belongsToOne') ? 'reverse' : 'forward',
|
|
542
642
|
...(options.kind !== undefined && { kind: options.kind }),
|
|
543
643
|
...(options.maxCount !== undefined && { maxCount: options.maxCount }),
|
|
@@ -974,12 +1074,23 @@ export class Ad4mModel {
|
|
|
974
1074
|
* Shape resolution happens server-side from the perspective's SHACL triples.
|
|
975
1075
|
* @internal
|
|
976
1076
|
*/
|
|
1077
|
+
/**
|
|
1078
|
+
* The name the executor knows this class by: its class name, or a
|
|
1079
|
+
* built-in abstract class's URI (`ad4m://TextContent`, #1446). The URI is
|
|
1080
|
+
* the class's own static only: a subclass is a class of its own.
|
|
1081
|
+
* @internal
|
|
1082
|
+
*/
|
|
1083
|
+
static queriedAs(): string {
|
|
1084
|
+
const builtinUri = Object.prototype.hasOwnProperty.call(this, 'builtinUri') ? (this as any).builtinUri : undefined;
|
|
1085
|
+
return builtinUri || this.getModelMetadata().className;
|
|
1086
|
+
}
|
|
1087
|
+
|
|
977
1088
|
static prepareModelQueryParams(
|
|
978
1089
|
query: Query = {},
|
|
979
1090
|
classNameOverride?: string | null,
|
|
980
1091
|
): { className: string; queryJson: string; metadata: ModelMetadata } {
|
|
981
1092
|
const metadata = this.getModelMetadata();
|
|
982
|
-
const className = classNameOverride ||
|
|
1093
|
+
const className = classNameOverride || this.queriedAs();
|
|
983
1094
|
|
|
984
1095
|
// Expand includeAll: true to a full IncludeMap covering every forward relation.
|
|
985
1096
|
if (query.includeAll) {
|
|
@@ -1021,17 +1132,9 @@ export class Ad4mModel {
|
|
|
1021
1132
|
}
|
|
1022
1133
|
if (query.properties) queryInput.properties = query.properties;
|
|
1023
1134
|
if (query.include) {
|
|
1024
|
-
//
|
|
1025
|
-
//
|
|
1026
|
-
const
|
|
1027
|
-
const projections: Record<string, IncludeProjection> = {};
|
|
1028
|
-
for (const [key, val] of Object.entries(query.include)) {
|
|
1029
|
-
if (key.startsWith('$')) {
|
|
1030
|
-
projections[key] = val as IncludeProjection;
|
|
1031
|
-
} else {
|
|
1032
|
-
normalIncludes[key] = val;
|
|
1033
|
-
}
|
|
1034
|
-
}
|
|
1135
|
+
// $-prefixed keys → queryInput.projections; all other keys (boolean |
|
|
1136
|
+
// RelationSubQuery) → queryInput.include.
|
|
1137
|
+
const { includes: normalIncludes, projections } = splitIncludeProjections(query.include);
|
|
1035
1138
|
// A relation declared `polymorphic` reads that way by default, so the
|
|
1036
1139
|
// caller writes `include: { children: true }` and still gets each child
|
|
1037
1140
|
// hydrated as the class it actually is. Declaring it on the model rather
|
|
@@ -1041,25 +1144,10 @@ export class Ad4mModel {
|
|
|
1041
1144
|
// every depth, since a nested include is a fact about the data too.
|
|
1042
1145
|
if (Object.keys(normalIncludes).length > 0) {
|
|
1043
1146
|
applyPolymorphicIncludeDefaults(normalIncludes, this as any);
|
|
1044
|
-
queryInput.include = normalIncludes;
|
|
1147
|
+
queryInput.include = liftNestedProjections(normalIncludes, this as any);
|
|
1045
1148
|
}
|
|
1046
1149
|
if (Object.keys(projections).length > 0) {
|
|
1047
|
-
|
|
1048
|
-
// resolve the target shape through its in-memory cache when applying
|
|
1049
|
-
// projection where-clause filters.
|
|
1050
|
-
const allRelMeta = getRelationsMetadata(this as any);
|
|
1051
|
-
for (const [, proj] of Object.entries(projections)) {
|
|
1052
|
-
const relMeta = allRelMeta[proj.from];
|
|
1053
|
-
if (!proj.targetClassName && relMeta?.target) {
|
|
1054
|
-
try {
|
|
1055
|
-
const TargetClass = relMeta.target();
|
|
1056
|
-
const targetMeta = (TargetClass as any).getModelMetadata?.();
|
|
1057
|
-
if (targetMeta?.className) {
|
|
1058
|
-
proj.targetClassName = targetMeta.className;
|
|
1059
|
-
}
|
|
1060
|
-
} catch (e) { console.debug(`prepareModelQueryParams: target class unavailable for projection:`, e); }
|
|
1061
|
-
}
|
|
1062
|
-
}
|
|
1150
|
+
tagProjectionTargets(projections, this as any);
|
|
1063
1151
|
queryInput.projections = projections;
|
|
1064
1152
|
}
|
|
1065
1153
|
}
|
|
@@ -1105,6 +1193,185 @@ export class Ad4mModel {
|
|
|
1105
1193
|
}
|
|
1106
1194
|
|
|
1107
1195
|
|
|
1196
|
+
// ── One query over several classes (#1238) ────────────────────────────────
|
|
1197
|
+
|
|
1198
|
+
/**
|
|
1199
|
+
* Build the wire parameters for one query over several classes.
|
|
1200
|
+
*
|
|
1201
|
+
* Each class normalises the query as it would for itself — its polymorphic
|
|
1202
|
+
* include defaults, its `$` projections, its parent predicate — and the
|
|
1203
|
+
* results are merged: includes and projections by key (the first class that
|
|
1204
|
+
* declares a key decides its form; a projection two classes tag with
|
|
1205
|
+
* different target classes is refused), the parent scope only when every
|
|
1206
|
+
* class that can resolve it resolves it to the same predicate.
|
|
1207
|
+
* @internal
|
|
1208
|
+
*/
|
|
1209
|
+
static prepareUnionQueryParams(
|
|
1210
|
+
classes: (typeof Ad4mModel)[],
|
|
1211
|
+
query: Query = {},
|
|
1212
|
+
): { classNames: string[]; queryJson: string } {
|
|
1213
|
+
if (!classes.length) throw new Error('A query over several classes needs at least one class');
|
|
1214
|
+
const { parent, preferClasses, ...rest } = query;
|
|
1215
|
+
const inputs = classes.map((c) => JSON.parse(c.prepareModelQueryParams(rest).queryJson));
|
|
1216
|
+
// A projection is tagged with its relation's target class, at every depth,
|
|
1217
|
+
// and the executor hydrates a list projection (and resolves its `where`)
|
|
1218
|
+
// as that class. Two classes that tag the same key differently cannot share
|
|
1219
|
+
// one form of it, so the key is refused rather than read as the first's.
|
|
1220
|
+
const tags = new Map<string, string>();
|
|
1221
|
+
const collectTags = (node: any, path: string) => {
|
|
1222
|
+
if (!node || typeof node !== 'object') return;
|
|
1223
|
+
for (const [k, v] of Object.entries(node)) {
|
|
1224
|
+
if (k === 'targetClassName' && typeof v === 'string') {
|
|
1225
|
+
const seen = tags.get(path);
|
|
1226
|
+
if (seen !== undefined && seen !== v) {
|
|
1227
|
+
throw new Error(
|
|
1228
|
+
`projection '${path}': the classes resolve it to different target classes ` +
|
|
1229
|
+
`(${seen}, ${v}); query those classes separately`,
|
|
1230
|
+
);
|
|
1231
|
+
}
|
|
1232
|
+
tags.set(path, v);
|
|
1233
|
+
} else {
|
|
1234
|
+
collectTags(v, path ? `${path}.${k}` : k);
|
|
1235
|
+
}
|
|
1236
|
+
}
|
|
1237
|
+
};
|
|
1238
|
+
for (const input of inputs) {
|
|
1239
|
+
collectTags(input.include, 'include');
|
|
1240
|
+
collectTags(input.projections, 'projections');
|
|
1241
|
+
}
|
|
1242
|
+
const merged: any = { ...inputs[0] };
|
|
1243
|
+
if (preferClasses) merged.preferClasses = preferClasses;
|
|
1244
|
+
for (const key of ['include', 'projections'] as const) {
|
|
1245
|
+
const combined = Object.assign({}, ...inputs.map((i) => i[key] ?? {}).reverse());
|
|
1246
|
+
if (Object.keys(combined).length) merged[key] = combined;
|
|
1247
|
+
else delete merged[key];
|
|
1248
|
+
}
|
|
1249
|
+
if (parent) {
|
|
1250
|
+
// A model-form scope names its predicate through the relation that
|
|
1251
|
+
// targets the queried class, so each class may resolve it differently
|
|
1252
|
+
// or not at all. One query has one scope.
|
|
1253
|
+
const scopes: string[] = [];
|
|
1254
|
+
let firstError: unknown;
|
|
1255
|
+
for (const c of classes) {
|
|
1256
|
+
try {
|
|
1257
|
+
scopes.push(JSON.stringify(JSON.parse(c.prepareModelQueryParams({ parent }).queryJson).parent));
|
|
1258
|
+
} catch (e) {
|
|
1259
|
+
firstError ??= e;
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
if (!scopes.length) throw firstError;
|
|
1263
|
+
if (new Set(scopes).size > 1) {
|
|
1264
|
+
throw new Error(
|
|
1265
|
+
'parent(): the classes resolve the parent scope to different predicates; ' +
|
|
1266
|
+
'pass the predicate itself (or a `field`) so they share one scope',
|
|
1267
|
+
);
|
|
1268
|
+
}
|
|
1269
|
+
merged.parent = JSON.parse(scopes[0]);
|
|
1270
|
+
}
|
|
1271
|
+
return {
|
|
1272
|
+
classNames: classes.map((c) => c.queriedAs()),
|
|
1273
|
+
queryJson: JSON.stringify(merged),
|
|
1274
|
+
};
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
/**
|
|
1278
|
+
* Build each row of a union result as the class the executor hydrated it as
|
|
1279
|
+
* (`__subjectClass`). A row of a class not in `classes` stays plain JSON.
|
|
1280
|
+
* @internal
|
|
1281
|
+
*/
|
|
1282
|
+
static parseUnionResult(
|
|
1283
|
+
classes: (typeof Ad4mModel)[],
|
|
1284
|
+
perspective: PerspectiveProxy,
|
|
1285
|
+
raw: any,
|
|
1286
|
+
include?: IncludeMap,
|
|
1287
|
+
properties?: string[],
|
|
1288
|
+
): Ad4mModel[] {
|
|
1289
|
+
const data = typeof raw === 'string' ? JSON.parse(raw) : raw;
|
|
1290
|
+
const arr = data.instances || data;
|
|
1291
|
+
if (!Array.isArray(arr)) return [];
|
|
1292
|
+
const byName = new Map(classes.map((c) => [c.getModelMetadata().className, c]));
|
|
1293
|
+
return arr.map((json: any) => {
|
|
1294
|
+
const cls = byName.get(json?.[SUBJECT_CLASS_KEY]);
|
|
1295
|
+
return cls ? jsonToModelInstance(cls as any, perspective, json, include, properties) : json;
|
|
1296
|
+
});
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
/** @internal */
|
|
1300
|
+
static async executeUnionQuery(
|
|
1301
|
+
perspective: PerspectiveProxy,
|
|
1302
|
+
classes: (typeof Ad4mModel)[],
|
|
1303
|
+
query: Query = {},
|
|
1304
|
+
options?: CallOptions,
|
|
1305
|
+
): Promise<ResultsWithTotalCount<Ad4mModel>> {
|
|
1306
|
+
const { classNames, queryJson } = Ad4mModel.prepareUnionQueryParams(classes, query);
|
|
1307
|
+
const result = await perspective.modelQuery(classNames, queryJson, options);
|
|
1308
|
+
const results = Ad4mModel.parseUnionResult(classes, perspective, result, query.include, query.properties);
|
|
1309
|
+
const snapshotRelations = query.include
|
|
1310
|
+
? Object.fromEntries(Object.entries(query.include).filter(([k]) => !k.startsWith('$')))
|
|
1311
|
+
: undefined;
|
|
1312
|
+
for (const inst of results) {
|
|
1313
|
+
(inst as any).takeSnapshot?.(
|
|
1314
|
+
snapshotRelations && Object.keys(snapshotRelations).length > 0 ? snapshotRelations : undefined,
|
|
1315
|
+
);
|
|
1316
|
+
}
|
|
1317
|
+
return { results, totalCount: result.totalCount };
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1320
|
+
/**
|
|
1321
|
+
* One query over several model classes (#1238).
|
|
1322
|
+
*
|
|
1323
|
+
* `where`, `order`, `limit` and `offset` apply once, over the union. Each
|
|
1324
|
+
* result is an instance of the class the executor hydrated it as: the first
|
|
1325
|
+
* `preferClasses` entry it conforms to, otherwise the most specific of
|
|
1326
|
+
* `classes` it conforms to. A record that is several of them is returned
|
|
1327
|
+
* once; `__subjectClasses` on it names every class it conforms to.
|
|
1328
|
+
*
|
|
1329
|
+
* - `where` on a property a class does not declare excludes that class's rows.
|
|
1330
|
+
* - `order` on such a property sorts those rows last, in both directions,
|
|
1331
|
+
* then by id.
|
|
1332
|
+
*
|
|
1333
|
+
* @example
|
|
1334
|
+
* ```typescript
|
|
1335
|
+
* const items = await Ad4mModel.findAllOf(perspective, [Placement, EdgeRoute], {
|
|
1336
|
+
* parent: { id: canvas.id, predicate: "canvas://item" },
|
|
1337
|
+
* order: { zIndex: "ASC" },
|
|
1338
|
+
* limit: 50,
|
|
1339
|
+
* });
|
|
1340
|
+
* for (const item of items) {
|
|
1341
|
+
* if (item instanceof Placement) { ... }
|
|
1342
|
+
* }
|
|
1343
|
+
* ```
|
|
1344
|
+
*/
|
|
1345
|
+
static async findAllOf<C extends (typeof Ad4mModel)[]>(
|
|
1346
|
+
perspective: PerspectiveProxy,
|
|
1347
|
+
classes: [...C],
|
|
1348
|
+
query?: Query,
|
|
1349
|
+
options?: CallOptions,
|
|
1350
|
+
): Promise<InstanceType<C[number]>[]> {
|
|
1351
|
+
const { results } = await Ad4mModel.executeUnionQuery(perspective, classes, query ?? {}, options);
|
|
1352
|
+
return results as InstanceType<C[number]>[];
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
/**
|
|
1356
|
+
* A {@link ModelQueryBuilder} over several model classes: the builder form of
|
|
1357
|
+
* {@link findAllOf}. `subscribe()` registers one subscription, which re-runs
|
|
1358
|
+
* when any of the classes changes.
|
|
1359
|
+
*
|
|
1360
|
+
* @example
|
|
1361
|
+
* ```typescript
|
|
1362
|
+
* const builder = Ad4mModel.queryOf(perspective, [Placement, EdgeRoute])
|
|
1363
|
+
* .parent(canvas.id, "canvas://item");
|
|
1364
|
+
* await builder.subscribe((items) => render(items));
|
|
1365
|
+
* ```
|
|
1366
|
+
*/
|
|
1367
|
+
static queryOf<C extends (typeof Ad4mModel)[]>(
|
|
1368
|
+
perspective: PerspectiveProxy,
|
|
1369
|
+
classes: [...C],
|
|
1370
|
+
query?: Query,
|
|
1371
|
+
): ModelQueryBuilder<InstanceType<C[number]>> {
|
|
1372
|
+
return new ModelQueryBuilder<InstanceType<C[number]>>(perspective, Ad4mModel, query, classes);
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1108
1375
|
// instancesFromQueryResult — removed (superseded by Rust executeModelQuery pipeline)
|
|
1109
1376
|
|
|
1110
1377
|
/**
|
|
@@ -1352,12 +1619,32 @@ export class Ad4mModel {
|
|
|
1352
1619
|
return String(value);
|
|
1353
1620
|
}
|
|
1354
1621
|
|
|
1622
|
+
/** A relation write on a row read through an abstract class (#1435). The
|
|
1623
|
+
* relation's predicate is the abstract class's, which no record's class
|
|
1624
|
+
* reads: the executor runs the adder, remover or setter of each of the
|
|
1625
|
+
* record's classes for the relation answering to `key`. */
|
|
1626
|
+
private async relationThroughAbstract(
|
|
1627
|
+
abstractName: string,
|
|
1628
|
+
key: string,
|
|
1629
|
+
action: 'adder' | 'remover' | 'setter',
|
|
1630
|
+
value: any,
|
|
1631
|
+
batchId?: string
|
|
1632
|
+
) {
|
|
1633
|
+
const ids = (Array.isArray(value) ? value : [value]).map((v) => this.resolveRelationId(v));
|
|
1634
|
+
await this._perspective.updateSubject(abstractName, this._baseExpression, { [key]: { action, value: ids } }, batchId);
|
|
1635
|
+
}
|
|
1636
|
+
|
|
1355
1637
|
private async setRelationValues(key: string, value: any, batchId?: string) {
|
|
1356
1638
|
const metadata = this.getRelationOptions(key);
|
|
1357
1639
|
if (!metadata) {
|
|
1358
1640
|
console.warn(`Relation "${key}" has no metadata, skipping`);
|
|
1359
1641
|
return;
|
|
1360
1642
|
}
|
|
1643
|
+
const abstractName = this.abstractName();
|
|
1644
|
+
if (abstractName) {
|
|
1645
|
+
if (value != null) await this.relationThroughAbstract(abstractName, key, 'setter', value, batchId);
|
|
1646
|
+
return;
|
|
1647
|
+
}
|
|
1361
1648
|
|
|
1362
1649
|
// Generate actions from metadata (replaces Prolog query)
|
|
1363
1650
|
const actions = this.generateRelationAction(key, 'setter');
|
|
@@ -1382,6 +1669,11 @@ export class Ad4mModel {
|
|
|
1382
1669
|
console.warn(`Relation "${key}" has no metadata, skipping`);
|
|
1383
1670
|
return;
|
|
1384
1671
|
}
|
|
1672
|
+
const abstractName = this.abstractName();
|
|
1673
|
+
if (abstractName) {
|
|
1674
|
+
if (value != null) await this.relationThroughAbstract(abstractName, key, 'adder', value, batchId);
|
|
1675
|
+
return;
|
|
1676
|
+
}
|
|
1385
1677
|
|
|
1386
1678
|
// Generate actions from metadata (replaces Prolog query)
|
|
1387
1679
|
const actions = this.generateRelationAction(key, 'adder');
|
|
@@ -1405,6 +1697,11 @@ export class Ad4mModel {
|
|
|
1405
1697
|
console.warn(`Relation "${key}" has no metadata, skipping`);
|
|
1406
1698
|
return;
|
|
1407
1699
|
}
|
|
1700
|
+
const abstractName = this.abstractName();
|
|
1701
|
+
if (abstractName) {
|
|
1702
|
+
if (value != null) await this.relationThroughAbstract(abstractName, key, 'remover', value, batchId);
|
|
1703
|
+
return;
|
|
1704
|
+
}
|
|
1408
1705
|
|
|
1409
1706
|
// Generate actions from metadata (replaces Prolog query)
|
|
1410
1707
|
const actions = this.generateRelationAction(key, 'remover');
|
|
@@ -1451,7 +1748,12 @@ export class Ad4mModel {
|
|
|
1451
1748
|
async save(batchId?: string) {
|
|
1452
1749
|
// Existing instance → update path (has been fetched / hydrated before)
|
|
1453
1750
|
if (this._snapshot) {
|
|
1454
|
-
|
|
1751
|
+
const abstractName = this.abstractName();
|
|
1752
|
+
if (abstractName) {
|
|
1753
|
+
await this.perspective.updateSubject(abstractName, this._baseExpression, this.changedValuesForDispatch(), batchId);
|
|
1754
|
+
} else {
|
|
1755
|
+
await this.innerUpdate(true, batchId);
|
|
1756
|
+
}
|
|
1455
1757
|
if (batchId) {
|
|
1456
1758
|
// Batch hasn't been committed yet — getData() would fetch stale data
|
|
1457
1759
|
// and overwrite in-memory values. Just refresh the snapshot so further
|
|
@@ -1463,68 +1765,61 @@ export class Ad4mModel {
|
|
|
1463
1765
|
return;
|
|
1464
1766
|
}
|
|
1465
1767
|
|
|
1466
|
-
// New instance → create path
|
|
1768
|
+
// New instance → create path. The executor refuses an abstract class
|
|
1769
|
+
// too; refusing here keeps the error ahead of the batch.
|
|
1770
|
+
const abstractName = this.abstractName();
|
|
1771
|
+
if (abstractName) {
|
|
1772
|
+
throw new Error(
|
|
1773
|
+
`'${abstractName}' is an abstract class and cannot be created. Create an instance of ` +
|
|
1774
|
+
`a class that has its properties; querying '${abstractName}' reads it.`
|
|
1775
|
+
);
|
|
1776
|
+
}
|
|
1467
1777
|
let batchCreatedHere = false;
|
|
1468
1778
|
if(!batchId) {
|
|
1469
1779
|
batchId = await this.perspective.createBatch()
|
|
1470
1780
|
batchCreatedHere = true;
|
|
1471
1781
|
}
|
|
1472
|
-
|
|
1473
1782
|
|
|
1474
|
-
// Check if the model has any constructor actions (required properties,
|
|
1475
|
-
// flags, or properties with initial values). Models whose properties are
|
|
1476
|
-
// all optional, have no @Flag, and have no initial values produce an empty
|
|
1477
|
-
// SHACL constructor, so calling createSubject would fail on the Rust side
|
|
1478
|
-
// ("No SHACL constructor found"). In that case we skip createSubject
|
|
1479
|
-
// entirely and let innerUpdate write the links directly.
|
|
1480
1783
|
const metadata = (this.constructor as typeof Ad4mModel).getModelMetadata();
|
|
1481
|
-
const hasConstructor = Object.values(metadata.properties).some(
|
|
1482
|
-
(p) => p.required || p.flag || p.initial !== undefined
|
|
1483
|
-
);
|
|
1484
1784
|
|
|
1485
1785
|
// Track properties resolved through expression_create — a signed literal
|
|
1486
1786
|
// envelope or a custom (non-"literal") resolveLanguage. These may fail
|
|
1487
1787
|
// inside a batch context, so defer them to setProperty after createSubject.
|
|
1488
1788
|
const deferredExpressionProps: string[] = [];
|
|
1489
1789
|
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
deferredExpressionProps.push(key);
|
|
1508
|
-
continue;
|
|
1509
|
-
}
|
|
1510
|
-
initialValues[key] = value;
|
|
1790
|
+
const initialValues = {};
|
|
1791
|
+
for (const [key, value] of Object.entries(this)) {
|
|
1792
|
+
if (value !== undefined && value !== null && !(Array.isArray(value) && value.length > 0) && !value?.action) {
|
|
1793
|
+
const propMeta = metadata.properties[key];
|
|
1794
|
+
// Only offer keys with a declared, settable model property. This
|
|
1795
|
+
// excludes ORM bookkeeping fields (_baseExpression, _perspective —
|
|
1796
|
+
// enumerable instance fields, not model properties), relations
|
|
1797
|
+
// (@HasOne also registers a property, but innerUpdate writes it as a
|
|
1798
|
+
// relation), and read-only properties/flags (readOnly: true). None of
|
|
1799
|
+
// these have an `ad4m://setter` on the Rust side, which otherwise logs
|
|
1800
|
+
// a "declares no setter" warning per key on every save().
|
|
1801
|
+
if (!propMeta || propMeta.readOnly || metadata.relations[key]) {
|
|
1802
|
+
continue;
|
|
1803
|
+
}
|
|
1804
|
+
if (effectiveLiteralStorage(propMeta).kind !== "deterministic") {
|
|
1805
|
+
deferredExpressionProps.push(key);
|
|
1806
|
+
continue;
|
|
1511
1807
|
}
|
|
1808
|
+
initialValues[key] = value;
|
|
1512
1809
|
}
|
|
1810
|
+
}
|
|
1513
1811
|
|
|
1514
|
-
|
|
1812
|
+
const className = await this.perspective.stringOrTemplateObjectToSubjectClassName(this);
|
|
1515
1813
|
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
}
|
|
1814
|
+
await this.perspective.createSubject(
|
|
1815
|
+
className,
|
|
1816
|
+
this._baseExpression,
|
|
1817
|
+
initialValues,
|
|
1818
|
+
batchId
|
|
1819
|
+
);
|
|
1523
1820
|
|
|
1524
|
-
//
|
|
1525
|
-
|
|
1526
|
-
// property writing so that scalar values are persisted as links.
|
|
1527
|
-
await this.innerUpdate(!hasConstructor, batchId)
|
|
1821
|
+
// Relations via innerUpdate; createSubject wrote the scalar properties.
|
|
1822
|
+
await this.innerUpdate(false, batchId)
|
|
1528
1823
|
|
|
1529
1824
|
for (const key of deferredExpressionProps) {
|
|
1530
1825
|
const value = (this as any)[key];
|
|
@@ -1547,6 +1842,38 @@ export class Ad4mModel {
|
|
|
1547
1842
|
}
|
|
1548
1843
|
}
|
|
1549
1844
|
|
|
1845
|
+
/** The name the executor knows the class by when it is abstract (#1435):
|
|
1846
|
+
* a built-in's URI (#1446). Through an abstract class, the executor
|
|
1847
|
+
* writes to the record's own classes. */
|
|
1848
|
+
private abstractName(): string | undefined {
|
|
1849
|
+
const ctor = this.constructor as typeof Ad4mModel & { isAbstract?: boolean };
|
|
1850
|
+
return ctor.isAbstract ? ctor.queriedAs() : undefined;
|
|
1851
|
+
}
|
|
1852
|
+
|
|
1853
|
+
private changedValues(): Record<string, any> {
|
|
1854
|
+
return Object.fromEntries(this.changedFields().map((key) => [key, (this as any)[key]]));
|
|
1855
|
+
}
|
|
1856
|
+
|
|
1857
|
+
/** `changedValues()` with each relation's members as IDs, as the relation
|
|
1858
|
+
* helpers send them: a member may be a model instance. An action envelope
|
|
1859
|
+
* (`{ action: "adder", value }`) keeps its action, as `innerUpdate()` runs
|
|
1860
|
+
* it; an action it does not know is a setter there, so it is one here. */
|
|
1861
|
+
private changedValuesForDispatch(): Record<string, any> {
|
|
1862
|
+
const relations = (this.constructor as typeof Ad4mModel).getModelMetadata().relations;
|
|
1863
|
+
const ids = (value: any) =>
|
|
1864
|
+
Array.isArray(value) ? value.map((v) => this.resolveRelationId(v)) : this.resolveRelationId(value);
|
|
1865
|
+
return Object.fromEntries(
|
|
1866
|
+
Object.entries(this.changedValues()).map(([key, value]) => {
|
|
1867
|
+
if (!relations[key] || value == null) return [key, value];
|
|
1868
|
+
if (value.action) {
|
|
1869
|
+
const action = ["adder", "remover", "setter"].includes(value.action) ? value.action : "setter";
|
|
1870
|
+
return [key, { action, value: ids(value.value) }];
|
|
1871
|
+
}
|
|
1872
|
+
return [key, ids(value)];
|
|
1873
|
+
})
|
|
1874
|
+
);
|
|
1875
|
+
}
|
|
1876
|
+
|
|
1550
1877
|
private cleanCopy() {
|
|
1551
1878
|
const ctor = this.constructor as typeof Ad4mModel;
|
|
1552
1879
|
const metadata = ctor.getModelMetadata();
|
|
@@ -1589,13 +1916,14 @@ export class Ad4mModel {
|
|
|
1589
1916
|
// Skip unchanged fields when a snapshot is available
|
|
1590
1917
|
if (dirty && !dirty.has(key)) continue;
|
|
1591
1918
|
|
|
1592
|
-
// Skip read-only
|
|
1919
|
+
// Skip read-only relations — explicit getters never write links, and
|
|
1920
|
+
// neither does a relation declared `readOnly`.
|
|
1593
1921
|
// For target+filter relations, skip only when another relation on this
|
|
1594
1922
|
// model claims the same predicate (i.e., this is a filtered *view* of a
|
|
1595
1923
|
// base relation and writing would collide).
|
|
1596
1924
|
const relMeta = metadata.relations[key];
|
|
1597
1925
|
if (relMeta) {
|
|
1598
|
-
if (relMeta.getter) continue;
|
|
1926
|
+
if (relMeta.getter || relMeta.readOnly) continue;
|
|
1599
1927
|
if (relMeta.target && relMeta.filter !== false) {
|
|
1600
1928
|
// Check for predicate collision with a sibling relation
|
|
1601
1929
|
const hasCollision = Object.entries(metadata.relations).some(
|
|
@@ -1806,7 +2134,9 @@ export class Ad4mModel {
|
|
|
1806
2134
|
*/
|
|
1807
2135
|
async delete(batchId?: string) {
|
|
1808
2136
|
const metadata = (this.constructor as typeof Ad4mModel).getModelMetadata();
|
|
1809
|
-
|
|
2137
|
+
// Through an abstract class (#1435), `removeSubject` runs the destructors
|
|
2138
|
+
// of the record's own classes.
|
|
2139
|
+
const hasDestructor = !!this.abstractName() || Object.values(metadata.properties).some(
|
|
1810
2140
|
(p) => p.required || p.flag || p.initial !== undefined
|
|
1811
2141
|
);
|
|
1812
2142
|
|