@coasys/ad4m 0.13.0-test-3 → 0.13.0-test-5
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 +2 -25
- package/jest-setup.ts +1 -1
- package/lib/index.cjs +6717 -15519
- package/lib/index.js +4811 -13662
- package/lib/src/Ad4mClient.d.ts +7 -3
- package/lib/src/Ad4mClient.js +39 -13
- package/lib/src/agent/Agent.js +26 -272
- package/lib/src/agent/AgentClient.d.ts +10 -21
- package/lib/src/agent/AgentClient.js +75 -427
- package/lib/src/agent/AgentStatus.js +2 -37
- package/lib/src/ai/AIClient.d.ts +12 -4
- package/lib/src/ai/AIClient.js +81 -285
- package/lib/src/ai/AITypes.d.ts +55 -0
- package/lib/src/ai/AITypes.js +18 -0
- package/lib/src/ai/Tasks.js +10 -133
- package/lib/src/apiClient.d.ts +52 -0
- package/lib/src/apiClient.js +231 -0
- package/lib/src/expression/Expression.d.ts +1 -1
- package/lib/src/expression/Expression.js +13 -122
- package/lib/src/expression/ExpressionClient.d.ts +3 -3
- package/lib/src/expression/ExpressionClient.js +13 -76
- package/lib/src/expression/ExpressionRef.js +2 -25
- package/lib/src/generated/api/AIModelLoadingStatus.d.ts +7 -0
- package/lib/src/generated/api/AIModelLoadingStatus.js +2 -0
- package/lib/src/generated/api/AddLinkExpressionRequest.d.ts +6 -0
- package/lib/src/generated/api/AddLinkExpressionRequest.js +1 -0
- package/lib/src/generated/api/AddLinkRequest.d.ts +6 -0
- package/lib/src/generated/api/AddLinkRequest.js +1 -0
- package/lib/src/generated/api/AddLinksBulkRequest.d.ts +6 -0
- package/lib/src/generated/api/AddLinksBulkRequest.js +1 -0
- package/lib/src/generated/api/AddSdnaRequest.d.ts +6 -0
- package/lib/src/generated/api/AddSdnaRequest.js +2 -0
- package/lib/src/generated/api/ApplyTemplateRequest.d.ts +4 -0
- package/lib/src/generated/api/ApplyTemplateRequest.js +2 -0
- package/lib/src/generated/api/AuthInfoInput.d.ts +10 -0
- package/lib/src/generated/api/AuthInfoInput.js +1 -0
- package/lib/src/generated/api/CapabilityInput.d.ts +5 -0
- package/lib/src/generated/api/CapabilityInput.js +1 -0
- package/lib/src/generated/api/CommitBatchRequest.d.ts +3 -0
- package/lib/src/generated/api/CommitBatchRequest.js +2 -0
- package/lib/src/generated/api/ComputeLogEntry.d.ts +9 -0
- package/lib/src/generated/api/ComputeLogEntry.js +2 -0
- package/lib/src/generated/api/CreateExpressionRequest.d.ts +4 -0
- package/lib/src/generated/api/CreateExpressionRequest.js +2 -0
- package/lib/src/generated/api/CreatePerspectiveRequest.d.ts +3 -0
- package/lib/src/generated/api/CreatePerspectiveRequest.js +2 -0
- package/lib/src/generated/api/CreateSubjectRequest.d.ts +6 -0
- package/lib/src/generated/api/CreateSubjectRequest.js +2 -0
- package/lib/src/generated/api/EmbedRequest.d.ts +4 -0
- package/lib/src/generated/api/EmbedRequest.js +2 -0
- package/lib/src/generated/api/EntanglementProofInput.d.ts +6 -0
- package/lib/src/generated/api/EntanglementProofInput.js +2 -0
- package/lib/src/generated/api/ExecuteCommandsRequest.d.ts +4 -0
- package/lib/src/generated/api/ExecuteCommandsRequest.js +2 -0
- package/lib/src/generated/api/ExportRequest.d.ts +5 -0
- package/lib/src/generated/api/ExportRequest.js +2 -0
- package/lib/src/generated/api/ExpressionManyRequest.d.ts +3 -0
- package/lib/src/generated/api/ExpressionManyRequest.js +2 -0
- package/lib/src/generated/api/ExpressionProof.d.ts +4 -0
- package/lib/src/generated/api/ExpressionProof.js +2 -0
- package/lib/src/generated/api/ExpressionProofInput.d.ts +6 -0
- package/lib/src/generated/api/ExpressionProofInput.js +2 -0
- package/lib/src/generated/api/FriendSendMessageRequest.d.ts +3 -0
- package/lib/src/generated/api/FriendSendMessageRequest.js +2 -0
- package/lib/src/generated/api/FriendsListRequest.d.ts +3 -0
- package/lib/src/generated/api/FriendsListRequest.js +2 -0
- package/lib/src/generated/api/GenerateAgentRequest.d.ts +3 -0
- package/lib/src/generated/api/GenerateAgentRequest.js +2 -0
- package/lib/src/generated/api/GenerateJwtRequest.d.ts +4 -0
- package/lib/src/generated/api/GenerateJwtRequest.js +2 -0
- package/lib/src/generated/api/GetSubjectDataRequest.d.ts +4 -0
- package/lib/src/generated/api/GetSubjectDataRequest.js +2 -0
- package/lib/src/generated/api/ImportAgentRequest.d.ts +6 -0
- package/lib/src/generated/api/ImportAgentRequest.js +2 -0
- package/lib/src/generated/api/ImportRequest.d.ts +4 -0
- package/lib/src/generated/api/ImportRequest.js +2 -0
- package/lib/src/generated/api/JoinNeighbourhoodRequest.d.ts +3 -0
- package/lib/src/generated/api/JoinNeighbourhoodRequest.js +2 -0
- package/lib/src/generated/api/LanguageMetaInput.d.ts +6 -0
- package/lib/src/generated/api/LanguageMetaInput.js +2 -0
- package/lib/src/generated/api/Link.d.ts +5 -0
- package/lib/src/generated/api/Link.js +2 -0
- package/lib/src/generated/api/LinkExpression.d.ts +10 -0
- package/lib/src/generated/api/LinkExpression.js +1 -0
- package/lib/src/generated/api/LinkExpressionInput.d.ts +10 -0
- package/lib/src/generated/api/LinkExpressionInput.js +1 -0
- package/lib/src/generated/api/LinkInput.d.ts +5 -0
- package/lib/src/generated/api/LinkInput.js +2 -0
- package/lib/src/generated/api/LinkLanguageTemplatesRequest.d.ts +3 -0
- package/lib/src/generated/api/LinkLanguageTemplatesRequest.js +2 -0
- package/lib/src/generated/api/LinkMutations.d.ts +6 -0
- package/lib/src/generated/api/LinkMutations.js +1 -0
- package/lib/src/generated/api/LinkStatus.d.ts +1 -0
- package/lib/src/generated/api/LinkStatus.js +2 -0
- package/lib/src/generated/api/LockAgentRequest.d.ts +3 -0
- package/lib/src/generated/api/LockAgentRequest.js +2 -0
- package/lib/src/generated/api/ModelType.d.ts +1 -0
- package/lib/src/generated/api/ModelType.js +2 -0
- package/lib/src/generated/api/NotificationInput.d.ts +10 -0
- package/lib/src/generated/api/NotificationInput.js +2 -0
- package/lib/src/generated/api/OpenLinkRequest.d.ts +3 -0
- package/lib/src/generated/api/OpenLinkRequest.js +2 -0
- package/lib/src/generated/api/PermitCapabilityRequest.d.ts +3 -0
- package/lib/src/generated/api/PermitCapabilityRequest.js +2 -0
- package/lib/src/generated/api/PerspectiveInput.d.ts +4 -0
- package/lib/src/generated/api/PerspectiveInput.js +1 -0
- package/lib/src/generated/api/PromptRequest.d.ts +4 -0
- package/lib/src/generated/api/PromptRequest.js +2 -0
- package/lib/src/generated/api/PublishLanguageRequest.d.ts +5 -0
- package/lib/src/generated/api/PublishLanguageRequest.js +1 -0
- package/lib/src/generated/api/PublishNeighbourhoodRequest.d.ts +6 -0
- package/lib/src/generated/api/PublishNeighbourhoodRequest.js +1 -0
- package/lib/src/generated/api/QueryRequest.d.ts +7 -0
- package/lib/src/generated/api/QueryRequest.js +2 -0
- package/lib/src/generated/api/RemoveLinkRequest.d.ts +5 -0
- package/lib/src/generated/api/RemoveLinkRequest.js +1 -0
- package/lib/src/generated/api/RemoveLinksBulkRequest.d.ts +5 -0
- package/lib/src/generated/api/RemoveLinksBulkRequest.js +1 -0
- package/lib/src/generated/api/ResourceInput.d.ts +4 -0
- package/lib/src/generated/api/ResourceInput.js +2 -0
- package/lib/src/generated/api/SetDefaultModelRequest.d.ts +4 -0
- package/lib/src/generated/api/SetDefaultModelRequest.js +1 -0
- package/lib/src/generated/api/SetFreeHostingEnabledRequest.d.ts +3 -0
- package/lib/src/generated/api/SetFreeHostingEnabledRequest.js +2 -0
- package/lib/src/generated/api/SetMultiUserRequest.d.ts +3 -0
- package/lib/src/generated/api/SetMultiUserRequest.js +2 -0
- package/lib/src/generated/api/SetStatusRequest.d.ts +3 -0
- package/lib/src/generated/api/SetStatusRequest.js +2 -0
- package/lib/src/generated/api/SignMessageRequest.d.ts +3 -0
- package/lib/src/generated/api/SignMessageRequest.js +2 -0
- package/lib/src/generated/api/TrustedAgentsRequest.d.ts +3 -0
- package/lib/src/generated/api/TrustedAgentsRequest.js +2 -0
- package/lib/src/generated/api/UnlockAgentRequest.d.ts +4 -0
- package/lib/src/generated/api/UnlockAgentRequest.js +2 -0
- package/lib/src/generated/api/UpdateLinkRequest.d.ts +7 -0
- package/lib/src/generated/api/UpdateLinkRequest.js +1 -0
- package/lib/src/generated/api/UpdatePerspectiveRequest.d.ts +3 -0
- package/lib/src/generated/api/UpdatePerspectiveRequest.js +2 -0
- package/lib/src/generated/api/UserStatistics.d.ts +9 -0
- package/lib/src/generated/api/UserStatistics.js +2 -0
- package/lib/src/generated/api/VerificationRequestResult.d.ts +6 -0
- package/lib/src/generated/api/VerificationRequestResult.js +2 -0
- package/lib/src/generated/api/VerifySignatureRequest.d.ts +5 -0
- package/lib/src/generated/api/VerifySignatureRequest.js +2 -0
- package/lib/src/generated/api/WriteSettingsRequest.d.ts +3 -0
- package/lib/src/generated/api/WriteSettingsRequest.js +2 -0
- package/lib/src/generated/api/index.d.ts +42 -0
- package/lib/src/generated/api/index.js +7 -0
- package/lib/src/index.d.ts +6 -1
- package/lib/src/index.js +6 -1
- package/lib/src/jestSetup.d.ts +0 -1
- package/lib/src/jestSetup.js +1 -1
- package/lib/src/language/Icon.js +2 -21
- package/lib/src/language/Language.d.ts +1 -1
- package/lib/src/language/Language.js +10 -76
- package/lib/src/language/LanguageClient.d.ts +2 -2
- package/lib/src/language/LanguageClient.js +15 -105
- package/lib/src/language/LanguageHandle.js +2 -41
- package/lib/src/language/LanguageMeta.js +4 -75
- package/lib/src/language/LanguageRef.js +2 -25
- package/lib/src/links/Links.js +14 -111
- package/lib/src/model/Ad4mModel.d.ts +76 -44
- package/lib/src/model/Ad4mModel.js +635 -479
- package/lib/src/model/Ad4mModel.test.js +371 -815
- package/lib/src/model/ModelQueryBuilder.d.ts +15 -27
- package/lib/src/model/ModelQueryBuilder.js +163 -224
- package/lib/src/model/decorators.d.ts +22 -0
- package/lib/src/model/decorators.js +7 -0
- package/lib/src/model/hydration.d.ts +3 -93
- package/lib/src/model/hydration.js +3 -970
- package/lib/src/model/index.d.ts +0 -4
- package/lib/src/model/index.js +0 -4
- package/lib/src/model/model-manifest.d.ts +41 -0
- package/lib/src/model/model-manifest.js +11 -0
- package/lib/src/model/query-sparql.d.ts +4 -67
- package/lib/src/model/query-sparql.js +26 -322
- package/lib/src/model/query-sparql.test.js +35 -218
- package/lib/src/model/query-utils.d.ts +1 -0
- package/lib/src/model/query-utils.js +46 -1
- package/lib/src/model/shacl-gen.js +4 -0
- package/lib/src/model/types.d.ts +51 -43
- package/lib/src/model/types.js +4 -1
- package/lib/src/neighbourhood/Neighbourhood.js +4 -32
- package/lib/src/neighbourhood/NeighbourhoodClient.d.ts +3 -3
- package/lib/src/neighbourhood/NeighbourhoodClient.js +40 -203
- package/lib/src/perspectives/LinkQuery.js +2 -42
- package/lib/src/perspectives/Perspective.d.ts +1 -1
- package/lib/src/perspectives/Perspective.js +10 -52
- package/lib/src/perspectives/PerspectiveClient.d.ts +13 -17
- package/lib/src/perspectives/PerspectiveClient.js +179 -429
- package/lib/src/perspectives/PerspectiveClient.test.js +55 -0
- package/lib/src/perspectives/PerspectiveDiff.js +4 -31
- package/lib/src/perspectives/PerspectiveHandle.js +3 -43
- package/lib/src/perspectives/PerspectiveProxy.d.ts +106 -71
- package/lib/src/perspectives/PerspectiveProxy.js +289 -310
- package/lib/src/runtime/RuntimeClient.d.ts +6 -6
- package/lib/src/runtime/RuntimeClient.js +93 -467
- package/lib/src/runtime/RuntimeTypes.d.ts +101 -0
- package/lib/src/runtime/RuntimeTypes.js +45 -0
- package/lib/src/shacl/SHACLShape.d.ts +7 -0
- package/lib/src/shacl/SHACLShape.js +19 -0
- package/lib/src/shacl/SHACLShape.test.js +82 -0
- package/lib/src/typeDefs.js +3 -628
- package/package.json +6 -18
- package/rollup.config.js +0 -7
- package/src/Ad4mClient.test.ts +1179 -1340
- package/src/Ad4mClient.ts +40 -15
- package/src/agent/Agent.ts +0 -99
- package/src/agent/AgentClient.ts +112 -526
- package/src/agent/AgentStatus.ts +0 -12
- package/src/ai/AIClient.ts +96 -296
- package/src/ai/AITypes.ts +66 -0
- package/src/ai/Tasks.ts +0 -52
- package/src/apiClient.ts +283 -0
- package/src/expression/Expression.ts +3 -43
- package/src/expression/ExpressionClient.ts +14 -77
- package/src/expression/ExpressionRef.ts +0 -6
- package/src/generated/api/AIModelLoadingStatus.ts +3 -0
- package/src/generated/api/AddLinkExpressionRequest.ts +4 -0
- package/src/generated/api/AddLinkRequest.ts +4 -0
- package/src/generated/api/AddLinksBulkRequest.ts +4 -0
- package/src/generated/api/AddSdnaRequest.ts +3 -0
- package/src/generated/api/ApplyTemplateRequest.ts +3 -0
- package/src/generated/api/AuthInfoInput.ts +4 -0
- package/src/generated/api/CapabilityInput.ts +4 -0
- package/src/generated/api/CommitBatchRequest.ts +3 -0
- package/src/generated/api/ComputeLogEntry.ts +3 -0
- package/src/generated/api/CreateExpressionRequest.ts +3 -0
- package/src/generated/api/CreatePerspectiveRequest.ts +3 -0
- package/src/generated/api/CreateSubjectRequest.ts +3 -0
- package/src/generated/api/EmbedRequest.ts +3 -0
- package/src/generated/api/EntanglementProofInput.ts +3 -0
- package/src/generated/api/ExecuteCommandsRequest.ts +3 -0
- package/src/generated/api/ExportRequest.ts +3 -0
- package/src/generated/api/ExpressionManyRequest.ts +3 -0
- package/src/generated/api/ExpressionProof.ts +3 -0
- package/src/generated/api/ExpressionProofInput.ts +3 -0
- package/src/generated/api/FriendSendMessageRequest.ts +3 -0
- package/src/generated/api/FriendsListRequest.ts +3 -0
- package/src/generated/api/GenerateAgentRequest.ts +3 -0
- package/src/generated/api/GenerateJwtRequest.ts +3 -0
- package/src/generated/api/GetSubjectDataRequest.ts +3 -0
- package/src/generated/api/ImportAgentRequest.ts +3 -0
- package/src/generated/api/ImportRequest.ts +3 -0
- package/src/generated/api/JoinNeighbourhoodRequest.ts +3 -0
- package/src/generated/api/LanguageMetaInput.ts +3 -0
- package/src/generated/api/Link.ts +3 -0
- package/src/generated/api/LinkExpression.ts +6 -0
- package/src/generated/api/LinkExpressionInput.ts +6 -0
- package/src/generated/api/LinkInput.ts +3 -0
- package/src/generated/api/LinkLanguageTemplatesRequest.ts +3 -0
- package/src/generated/api/LinkMutations.ts +5 -0
- package/src/generated/api/LinkStatus.ts +3 -0
- package/src/generated/api/LockAgentRequest.ts +3 -0
- package/src/generated/api/ModelType.ts +3 -0
- package/src/generated/api/NotificationInput.ts +3 -0
- package/src/generated/api/OpenLinkRequest.ts +3 -0
- package/src/generated/api/PermitCapabilityRequest.ts +3 -0
- package/src/generated/api/PerspectiveInput.ts +4 -0
- package/src/generated/api/PromptRequest.ts +3 -0
- package/src/generated/api/PublishLanguageRequest.ts +4 -0
- package/src/generated/api/PublishNeighbourhoodRequest.ts +4 -0
- package/src/generated/api/QueryRequest.ts +6 -0
- package/src/generated/api/RemoveLinkRequest.ts +4 -0
- package/src/generated/api/RemoveLinksBulkRequest.ts +4 -0
- package/src/generated/api/ResourceInput.ts +3 -0
- package/src/generated/api/SetDefaultModelRequest.ts +4 -0
- package/src/generated/api/SetFreeHostingEnabledRequest.ts +3 -0
- package/src/generated/api/SetMultiUserRequest.ts +3 -0
- package/src/generated/api/SetStatusRequest.ts +3 -0
- package/src/generated/api/SignMessageRequest.ts +3 -0
- package/src/generated/api/TrustedAgentsRequest.ts +3 -0
- package/src/generated/api/UnlockAgentRequest.ts +3 -0
- package/src/generated/api/UpdateLinkRequest.ts +5 -0
- package/src/generated/api/UpdatePerspectiveRequest.ts +3 -0
- package/src/generated/api/UserStatistics.ts +3 -0
- package/src/generated/api/VerificationRequestResult.ts +3 -0
- package/src/generated/api/VerifySignatureRequest.ts +3 -0
- package/src/generated/api/WriteSettingsRequest.ts +3 -0
- package/src/generated/api/index.ts +49 -0
- package/src/index.ts +6 -1
- package/src/jestSetup.ts +1 -1
- package/src/language/Icon.ts +0 -4
- package/src/language/Language.ts +2 -23
- package/src/language/LanguageClient.ts +21 -132
- package/src/language/LanguageHandle.ts +0 -14
- package/src/language/LanguageMeta.ts +0 -29
- package/src/language/LanguageRef.ts +0 -7
- package/src/links/Links.ts +0 -37
- package/src/model/Ad4mModel.test.ts +766 -1173
- package/src/model/Ad4mModel.ts +664 -529
- package/src/model/ModelQueryBuilder.ts +203 -251
- package/src/model/decorators.ts +29 -0
- package/src/model/hydration.ts +3 -1037
- package/src/model/index.ts +0 -4
- package/src/model/query-sparql.test.ts +34 -242
- package/src/model/query-sparql.ts +27 -337
- package/src/model/query-utils.ts +47 -2
- package/src/model/shacl-gen.ts +5 -0
- package/src/model/types.ts +55 -44
- package/src/neighbourhood/Neighbourhood.ts +0 -9
- package/src/neighbourhood/NeighbourhoodClient.ts +42 -207
- package/src/neighbourhood/NeighbourhoodProxy.test.ts +34 -36
- package/src/perspectives/LinkQuery.ts +0 -15
- package/src/perspectives/Perspective.ts +1 -12
- package/src/perspectives/PerspectiveClient.test.ts +206 -148
- package/src/perspectives/PerspectiveClient.ts +247 -442
- package/src/perspectives/PerspectiveDiff.ts +0 -8
- package/src/perspectives/PerspectiveHandle.ts +1 -12
- package/src/perspectives/PerspectiveProxy.test.ts +41 -0
- package/src/perspectives/PerspectiveProxy.ts +331 -348
- package/src/runtime/RuntimeClient.ts +112 -474
- package/src/runtime/RuntimeTypes.ts +144 -0
- package/src/shacl/SHACLShape.test.ts +94 -0
- package/src/shacl/SHACLShape.ts +27 -0
- package/src/typeDefs.ts +3 -5
- package/tsconfig.json +3 -7
- package/shims/reflect-metadata.ts +0 -0
- package/shims/type-graphql.ts +0 -75
- package/src/PubSub.ts +0 -17
- package/src/agent/AgentResolver.ts +0 -263
- package/src/ai/AIResolver.ts +0 -372
- package/src/buildSchema.ts +0 -43
- package/src/expression/ExpressionResolver.ts +0 -64
- package/src/language/LanguageResolver.ts +0 -98
- package/src/model/Subject.ts +0 -159
- package/src/model/hydration-batch.ts +0 -205
- package/src/model/hydration-batching.test.ts +0 -563
- package/src/model/prolog-facts.ts +0 -145
- package/src/model/query-prolog.ts +0 -148
- package/src/model/query-sparql-batch.ts +0 -301
- package/src/model/subscription-delta.test.ts +0 -207
- package/src/model/subscription-pool.ts +0 -211
- package/src/neighbourhood/NeighbourhoodResolver.ts +0 -100
- package/src/perspectives/PerspectiveResolver.ts +0 -364
- package/src/runtime/RuntimeResolver.ts +0 -749
- package/src/unwrapApolloResult.ts +0 -16
|
@@ -9,200 +9,57 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
9
9
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
10
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
11
|
};
|
|
12
|
-
var
|
|
13
|
-
import {
|
|
14
|
-
import unwrapApolloResult from "../unwrapApolloResult";
|
|
12
|
+
var _NeighbourhoodClient_apiClient, _NeighbourhoodClient_signalHandlers, _NeighbourhoodClient_signalUnsubscribers;
|
|
13
|
+
import { ApiClient } from "../apiClient";
|
|
15
14
|
export class NeighbourhoodClient {
|
|
16
|
-
constructor(
|
|
17
|
-
|
|
15
|
+
constructor(baseUrl, token, sharedApiClient) {
|
|
16
|
+
_NeighbourhoodClient_apiClient.set(this, void 0);
|
|
18
17
|
_NeighbourhoodClient_signalHandlers.set(this, new Map());
|
|
19
|
-
|
|
18
|
+
_NeighbourhoodClient_signalUnsubscribers.set(this, new Map());
|
|
19
|
+
__classPrivateFieldSet(this, _NeighbourhoodClient_apiClient, sharedApiClient || new ApiClient(baseUrl, token), "f");
|
|
20
20
|
}
|
|
21
21
|
async publishFromPerspective(perspectiveUUID, linkLanguage, meta) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
$meta: PerspectiveInput!,
|
|
26
|
-
$perspectiveUUID: String!
|
|
27
|
-
) {
|
|
28
|
-
neighbourhoodPublishFromPerspective(
|
|
29
|
-
linkLanguage: $linkLanguage,
|
|
30
|
-
meta: $meta,
|
|
31
|
-
perspectiveUUID: $perspectiveUUID
|
|
32
|
-
)
|
|
33
|
-
}`,
|
|
34
|
-
variables: { perspectiveUUID, linkLanguage, meta: meta }
|
|
35
|
-
}));
|
|
36
|
-
return neighbourhoodPublishFromPerspective;
|
|
22
|
+
return __classPrivateFieldGet(this, _NeighbourhoodClient_apiClient, "f").call('neighbourhood.publish', {
|
|
23
|
+
perspectiveUUID, linkLanguage, meta
|
|
24
|
+
});
|
|
37
25
|
}
|
|
38
26
|
async joinFromUrl(url) {
|
|
39
|
-
|
|
40
|
-
mutation: gql `mutation neighbourhoodJoinFromUrl($url: String!) {
|
|
41
|
-
neighbourhoodJoinFromUrl(url: $url) {
|
|
42
|
-
uuid
|
|
43
|
-
name
|
|
44
|
-
sharedUrl
|
|
45
|
-
state
|
|
46
|
-
neighbourhood {
|
|
47
|
-
data {
|
|
48
|
-
linkLanguage
|
|
49
|
-
meta {
|
|
50
|
-
links
|
|
51
|
-
{
|
|
52
|
-
author
|
|
53
|
-
timestamp
|
|
54
|
-
data { source, predicate, target }
|
|
55
|
-
proof { valid, invalid, signature, key }
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
author
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}`,
|
|
63
|
-
variables: { url }
|
|
64
|
-
}));
|
|
65
|
-
return neighbourhoodJoinFromUrl;
|
|
27
|
+
return __classPrivateFieldGet(this, _NeighbourhoodClient_apiClient, "f").call('neighbourhood.join', { url });
|
|
66
28
|
}
|
|
67
29
|
async otherAgents(perspectiveUUID) {
|
|
68
|
-
|
|
69
|
-
query: gql `query neighbourhoodOtherAgents($perspectiveUUID: String!) {
|
|
70
|
-
neighbourhoodOtherAgents(perspectiveUUID: $perspectiveUUID)
|
|
71
|
-
}`,
|
|
72
|
-
variables: { perspectiveUUID }
|
|
73
|
-
}));
|
|
74
|
-
return neighbourhoodOtherAgents;
|
|
30
|
+
return __classPrivateFieldGet(this, _NeighbourhoodClient_apiClient, "f").call('neighbourhood.otherAgents', { uuid: perspectiveUUID });
|
|
75
31
|
}
|
|
76
32
|
async hasTelepresenceAdapter(perspectiveUUID) {
|
|
77
|
-
|
|
78
|
-
query: gql `query neighbourhoodHasTelepresenceAdapter($perspectiveUUID: String!) {
|
|
79
|
-
neighbourhoodHasTelepresenceAdapter(perspectiveUUID: $perspectiveUUID)
|
|
80
|
-
}`,
|
|
81
|
-
variables: { perspectiveUUID }
|
|
82
|
-
}));
|
|
83
|
-
return neighbourhoodHasTelepresenceAdapter;
|
|
33
|
+
return __classPrivateFieldGet(this, _NeighbourhoodClient_apiClient, "f").call('neighbourhood.hasTelepresence', { uuid: perspectiveUUID });
|
|
84
34
|
}
|
|
85
35
|
async onlineAgents(perspectiveUUID) {
|
|
86
|
-
|
|
87
|
-
query: gql `query neighbourhoodOnlineAgents($perspectiveUUID: String!) {
|
|
88
|
-
neighbourhoodOnlineAgents(perspectiveUUID: $perspectiveUUID) {
|
|
89
|
-
did
|
|
90
|
-
status {
|
|
91
|
-
author
|
|
92
|
-
timestamp
|
|
93
|
-
data {
|
|
94
|
-
links {
|
|
95
|
-
author
|
|
96
|
-
timestamp
|
|
97
|
-
data { source, predicate, target }
|
|
98
|
-
proof { valid, invalid, signature, key }
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
proof { valid, invalid, signature, key }
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}`,
|
|
105
|
-
variables: { perspectiveUUID }
|
|
106
|
-
}));
|
|
107
|
-
return neighbourhoodOnlineAgents;
|
|
36
|
+
return __classPrivateFieldGet(this, _NeighbourhoodClient_apiClient, "f").call('neighbourhood.onlineAgents', { uuid: perspectiveUUID });
|
|
108
37
|
}
|
|
109
38
|
async setOnlineStatus(perspectiveUUID, status) {
|
|
110
|
-
|
|
111
|
-
mutation: gql `mutation neighbourhoodSetOnlineStatus(
|
|
112
|
-
$perspectiveUUID: String!,
|
|
113
|
-
$status: PerspectiveInput!
|
|
114
|
-
) {
|
|
115
|
-
neighbourhoodSetOnlineStatus(
|
|
116
|
-
perspectiveUUID: $perspectiveUUID,
|
|
117
|
-
status: $status
|
|
118
|
-
)
|
|
119
|
-
}`,
|
|
120
|
-
variables: { perspectiveUUID, status }
|
|
121
|
-
}));
|
|
122
|
-
return neighbourhoodSetOnlineStatus;
|
|
39
|
+
return __classPrivateFieldGet(this, _NeighbourhoodClient_apiClient, "f").call('neighbourhood.setOnlineStatus', { uuid: perspectiveUUID, status });
|
|
123
40
|
}
|
|
124
41
|
async setOnlineStatusU(perspectiveUUID, status) {
|
|
125
|
-
|
|
126
|
-
mutation: gql `mutation neighbourhoodSetOnlineStatusU(
|
|
127
|
-
$perspectiveUUID: String!,
|
|
128
|
-
$status: PerspectiveUnsignedInput!
|
|
129
|
-
) {
|
|
130
|
-
neighbourhoodSetOnlineStatusU(
|
|
131
|
-
perspectiveUUID: $perspectiveUUID,
|
|
132
|
-
status: $status
|
|
133
|
-
)
|
|
134
|
-
}`,
|
|
135
|
-
variables: { perspectiveUUID, status }
|
|
136
|
-
}));
|
|
137
|
-
return neighbourhoodSetOnlineStatusU;
|
|
42
|
+
return __classPrivateFieldGet(this, _NeighbourhoodClient_apiClient, "f").call('neighbourhood.setOnlineStatus', { uuid: perspectiveUUID, status, signed: false });
|
|
138
43
|
}
|
|
139
44
|
async sendSignal(perspectiveUUID, remoteAgentDid, payload) {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
$remoteAgentDid: String!,
|
|
144
|
-
$payload: PerspectiveInput!
|
|
145
|
-
) {
|
|
146
|
-
neighbourhoodSendSignal(
|
|
147
|
-
perspectiveUUID: $perspectiveUUID,
|
|
148
|
-
remoteAgentDid: $remoteAgentDid,
|
|
149
|
-
payload: $payload
|
|
150
|
-
)
|
|
151
|
-
}`,
|
|
152
|
-
variables: { perspectiveUUID, remoteAgentDid, payload }
|
|
153
|
-
}));
|
|
154
|
-
return neighbourhoodSendSignal;
|
|
45
|
+
return __classPrivateFieldGet(this, _NeighbourhoodClient_apiClient, "f").call('neighbourhood.sendSignal', {
|
|
46
|
+
uuid: perspectiveUUID, remoteAgentDid, payload
|
|
47
|
+
});
|
|
155
48
|
}
|
|
156
49
|
async sendSignalU(perspectiveUUID, remoteAgentDid, payload) {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
$remoteAgentDid: String!,
|
|
161
|
-
$payload: PerspectiveUnsignedInput!
|
|
162
|
-
) {
|
|
163
|
-
neighbourhoodSendSignalU(
|
|
164
|
-
perspectiveUUID: $perspectiveUUID,
|
|
165
|
-
remoteAgentDid: $remoteAgentDid,
|
|
166
|
-
payload: $payload
|
|
167
|
-
)
|
|
168
|
-
}`,
|
|
169
|
-
variables: { perspectiveUUID, remoteAgentDid, payload }
|
|
170
|
-
}));
|
|
171
|
-
return neighbourhoodSendSignalU;
|
|
50
|
+
return __classPrivateFieldGet(this, _NeighbourhoodClient_apiClient, "f").call('neighbourhood.sendSignal', {
|
|
51
|
+
uuid: perspectiveUUID, remoteAgentDid, payload, signed: false
|
|
52
|
+
});
|
|
172
53
|
}
|
|
173
54
|
async sendBroadcast(perspectiveUUID, payload, loopback = false) {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
$payload: PerspectiveInput!,
|
|
178
|
-
$loopback: Boolean
|
|
179
|
-
) {
|
|
180
|
-
neighbourhoodSendBroadcast(
|
|
181
|
-
perspectiveUUID: $perspectiveUUID,
|
|
182
|
-
payload: $payload,
|
|
183
|
-
loopback: $loopback
|
|
184
|
-
)
|
|
185
|
-
}`,
|
|
186
|
-
variables: { perspectiveUUID, payload, loopback }
|
|
187
|
-
}));
|
|
188
|
-
return neighbourhoodSendBroadcast;
|
|
55
|
+
return __classPrivateFieldGet(this, _NeighbourhoodClient_apiClient, "f").call('neighbourhood.sendBroadcast', {
|
|
56
|
+
uuid: perspectiveUUID, payload, loopback
|
|
57
|
+
});
|
|
189
58
|
}
|
|
190
59
|
async sendBroadcastU(perspectiveUUID, payload, loopback = false) {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
$payload: PerspectiveUnsignedInput!,
|
|
195
|
-
$loopback: Boolean
|
|
196
|
-
) {
|
|
197
|
-
neighbourhoodSendBroadcastU(
|
|
198
|
-
perspectiveUUID: $perspectiveUUID,
|
|
199
|
-
payload: $payload,
|
|
200
|
-
loopback: $loopback
|
|
201
|
-
)
|
|
202
|
-
}`,
|
|
203
|
-
variables: { perspectiveUUID, payload, loopback }
|
|
204
|
-
}));
|
|
205
|
-
return neighbourhoodSendBroadcastU;
|
|
60
|
+
return __classPrivateFieldGet(this, _NeighbourhoodClient_apiClient, "f").call('neighbourhood.sendBroadcast', {
|
|
61
|
+
uuid: perspectiveUUID, payload, loopback, signed: false
|
|
62
|
+
});
|
|
206
63
|
}
|
|
207
64
|
dispatchSignal(perspectiveUUID, signal) {
|
|
208
65
|
const handlers = __classPrivateFieldGet(this, _NeighbourhoodClient_signalHandlers, "f").get(perspectiveUUID);
|
|
@@ -218,46 +75,18 @@ export class NeighbourhoodClient {
|
|
|
218
75
|
}
|
|
219
76
|
}
|
|
220
77
|
async subscribeToSignals(perspectiveUUID) {
|
|
221
|
-
const
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
neighbourhoodSignal(perspectiveUUID: $perspectiveUUID) {
|
|
225
|
-
author
|
|
226
|
-
timestamp
|
|
227
|
-
data {
|
|
228
|
-
links
|
|
229
|
-
{
|
|
230
|
-
author
|
|
231
|
-
timestamp
|
|
232
|
-
data { source, predicate, target }
|
|
233
|
-
proof { valid, invalid, signature, key }
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
proof { valid, invalid, signature, key }
|
|
237
|
-
}
|
|
238
|
-
}`,
|
|
239
|
-
variables: { perspectiveUUID }
|
|
240
|
-
}).subscribe({
|
|
241
|
-
next: (result) => {
|
|
242
|
-
try {
|
|
243
|
-
const { neighbourhoodSignal } = unwrapApolloResult(result);
|
|
244
|
-
that.dispatchSignal(perspectiveUUID, neighbourhoodSignal);
|
|
245
|
-
}
|
|
246
|
-
catch (e) {
|
|
247
|
-
console.error("Error in signal subscription:", e);
|
|
248
|
-
}
|
|
249
|
-
},
|
|
250
|
-
error: (err) => {
|
|
251
|
-
console.error("Signal subscription error for perspective", perspectiveUUID, err);
|
|
78
|
+
const unsub = __classPrivateFieldGet(this, _NeighbourhoodClient_apiClient, "f").subscribe((data) => {
|
|
79
|
+
if (data.type === 'signal') {
|
|
80
|
+
this.dispatchSignal(perspectiveUUID, data.signal);
|
|
252
81
|
}
|
|
253
82
|
});
|
|
83
|
+
__classPrivateFieldGet(this, _NeighbourhoodClient_signalUnsubscribers, "f").set(perspectiveUUID, unsub);
|
|
254
84
|
}
|
|
255
85
|
async addSignalHandler(perspectiveUUID, handler) {
|
|
256
86
|
let handlersForPerspective = __classPrivateFieldGet(this, _NeighbourhoodClient_signalHandlers, "f").get(perspectiveUUID);
|
|
257
87
|
if (!handlersForPerspective) {
|
|
258
88
|
handlersForPerspective = [];
|
|
259
89
|
__classPrivateFieldGet(this, _NeighbourhoodClient_signalHandlers, "f").set(perspectiveUUID, handlersForPerspective);
|
|
260
|
-
// Push handler BEFORE subscribing so it's available when signals arrive
|
|
261
90
|
handlersForPerspective.push(handler);
|
|
262
91
|
await this.subscribeToSignals(perspectiveUUID);
|
|
263
92
|
}
|
|
@@ -272,7 +101,15 @@ export class NeighbourhoodClient {
|
|
|
272
101
|
if (index > -1) {
|
|
273
102
|
handlersForPerspective.splice(index, 1);
|
|
274
103
|
}
|
|
104
|
+
if (handlersForPerspective.length === 0) {
|
|
105
|
+
__classPrivateFieldGet(this, _NeighbourhoodClient_signalHandlers, "f").delete(perspectiveUUID);
|
|
106
|
+
const unsub = __classPrivateFieldGet(this, _NeighbourhoodClient_signalUnsubscribers, "f").get(perspectiveUUID);
|
|
107
|
+
if (unsub) {
|
|
108
|
+
unsub();
|
|
109
|
+
__classPrivateFieldGet(this, _NeighbourhoodClient_signalUnsubscribers, "f").delete(perspectiveUUID);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
275
112
|
}
|
|
276
113
|
}
|
|
277
114
|
}
|
|
278
|
-
|
|
115
|
+
_NeighbourhoodClient_apiClient = new WeakMap(), _NeighbourhoodClient_signalHandlers = new WeakMap(), _NeighbourhoodClient_signalUnsubscribers = new WeakMap();
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
-
};
|
|
10
|
-
import { Field, InputType, ObjectType } from "type-graphql";
|
|
11
|
-
let LinkQuery = class LinkQuery {
|
|
1
|
+
export class LinkQuery {
|
|
12
2
|
constructor(obj) {
|
|
13
3
|
if (obj) {
|
|
14
4
|
// @ts-ignore
|
|
@@ -47,34 +37,4 @@ let LinkQuery = class LinkQuery {
|
|
|
47
37
|
return false;
|
|
48
38
|
return true;
|
|
49
39
|
}
|
|
50
|
-
}
|
|
51
|
-
__decorate([
|
|
52
|
-
Field({ nullable: true }),
|
|
53
|
-
__metadata("design:type", String)
|
|
54
|
-
], LinkQuery.prototype, "source", void 0);
|
|
55
|
-
__decorate([
|
|
56
|
-
Field({ nullable: true }),
|
|
57
|
-
__metadata("design:type", String)
|
|
58
|
-
], LinkQuery.prototype, "target", void 0);
|
|
59
|
-
__decorate([
|
|
60
|
-
Field({ nullable: true }),
|
|
61
|
-
__metadata("design:type", String)
|
|
62
|
-
], LinkQuery.prototype, "predicate", void 0);
|
|
63
|
-
__decorate([
|
|
64
|
-
Field({ nullable: true }),
|
|
65
|
-
__metadata("design:type", Date)
|
|
66
|
-
], LinkQuery.prototype, "fromDate", void 0);
|
|
67
|
-
__decorate([
|
|
68
|
-
Field({ nullable: true }),
|
|
69
|
-
__metadata("design:type", Date)
|
|
70
|
-
], LinkQuery.prototype, "untilDate", void 0);
|
|
71
|
-
__decorate([
|
|
72
|
-
Field({ nullable: true }),
|
|
73
|
-
__metadata("design:type", Number)
|
|
74
|
-
], LinkQuery.prototype, "limit", void 0);
|
|
75
|
-
LinkQuery = __decorate([
|
|
76
|
-
ObjectType(),
|
|
77
|
-
InputType(),
|
|
78
|
-
__metadata("design:paramtypes", [Object])
|
|
79
|
-
], LinkQuery);
|
|
80
|
-
export { LinkQuery };
|
|
40
|
+
}
|
|
@@ -10,7 +10,7 @@ import { LinkQuery } from "./LinkQuery";
|
|
|
10
10
|
*
|
|
11
11
|
* The types PerspectiveProxy and PerspectiveHandle are used when dealing
|
|
12
12
|
* with an instantiated mutable perspective as is done through most of
|
|
13
|
-
* the
|
|
13
|
+
* the AD4M API.
|
|
14
14
|
*/
|
|
15
15
|
export declare class Perspective {
|
|
16
16
|
/** The content of the perspective, a list/graph of links */
|
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
-
};
|
|
10
|
-
var PerspectiveUnsignedInput_1;
|
|
11
|
-
import { Field, ObjectType, InputType } from "type-graphql";
|
|
12
1
|
import { ExpressionGeneric } from "../expression/Expression";
|
|
13
|
-
import { LinkExpression, LinkExpressionInput, LinkInput } from "../links/Links";
|
|
14
2
|
/** A Perspective represents subjective meaning, encoded through
|
|
15
3
|
* associations between expressions, a.k.a. Links, that is a graph
|
|
16
4
|
* over the objective Expressions of any subset of Languages.
|
|
@@ -21,9 +9,9 @@ import { LinkExpression, LinkExpressionInput, LinkInput } from "../links/Links";
|
|
|
21
9
|
*
|
|
22
10
|
* The types PerspectiveProxy and PerspectiveHandle are used when dealing
|
|
23
11
|
* with an instantiated mutable perspective as is done through most of
|
|
24
|
-
* the
|
|
12
|
+
* the AD4M API.
|
|
25
13
|
*/
|
|
26
|
-
|
|
14
|
+
export class Perspective {
|
|
27
15
|
constructor(links) {
|
|
28
16
|
if (links) {
|
|
29
17
|
this.links = links;
|
|
@@ -93,27 +81,10 @@ let Perspective = class Perspective {
|
|
|
93
81
|
else
|
|
94
82
|
return null;
|
|
95
83
|
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
], Perspective.prototype, "links", void 0);
|
|
101
|
-
Perspective = __decorate([
|
|
102
|
-
ObjectType(),
|
|
103
|
-
__metadata("design:paramtypes", [Array])
|
|
104
|
-
], Perspective);
|
|
105
|
-
export { Perspective };
|
|
106
|
-
let PerspectiveInput = class PerspectiveInput {
|
|
107
|
-
};
|
|
108
|
-
__decorate([
|
|
109
|
-
Field(type => [LinkExpressionInput]),
|
|
110
|
-
__metadata("design:type", Array)
|
|
111
|
-
], PerspectiveInput.prototype, "links", void 0);
|
|
112
|
-
PerspectiveInput = __decorate([
|
|
113
|
-
InputType()
|
|
114
|
-
], PerspectiveInput);
|
|
115
|
-
export { PerspectiveInput };
|
|
116
|
-
let PerspectiveUnsignedInput = PerspectiveUnsignedInput_1 = class PerspectiveUnsignedInput {
|
|
84
|
+
}
|
|
85
|
+
export class PerspectiveInput {
|
|
86
|
+
}
|
|
87
|
+
export class PerspectiveUnsignedInput {
|
|
117
88
|
constructor(links) {
|
|
118
89
|
if (links)
|
|
119
90
|
this.links = links;
|
|
@@ -121,24 +92,11 @@ let PerspectiveUnsignedInput = PerspectiveUnsignedInput_1 = class PerspectiveUns
|
|
|
121
92
|
this.links = [];
|
|
122
93
|
}
|
|
123
94
|
static fromLink(link) {
|
|
124
|
-
let obj = new
|
|
95
|
+
let obj = new PerspectiveUnsignedInput();
|
|
125
96
|
obj.links.push(link);
|
|
126
97
|
return obj;
|
|
127
98
|
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
__metadata("design:type", Array)
|
|
132
|
-
], PerspectiveUnsignedInput.prototype, "links", void 0);
|
|
133
|
-
PerspectiveUnsignedInput = PerspectiveUnsignedInput_1 = __decorate([
|
|
134
|
-
InputType(),
|
|
135
|
-
__metadata("design:paramtypes", [Array])
|
|
136
|
-
], PerspectiveUnsignedInput);
|
|
137
|
-
export { PerspectiveUnsignedInput };
|
|
138
|
-
let PerspectiveExpression = class PerspectiveExpression extends ExpressionGeneric(Perspective) {
|
|
139
|
-
};
|
|
140
|
-
PerspectiveExpression = __decorate([
|
|
141
|
-
ObjectType()
|
|
142
|
-
], PerspectiveExpression);
|
|
143
|
-
export { PerspectiveExpression };
|
|
99
|
+
}
|
|
100
|
+
export class PerspectiveExpression extends ExpressionGeneric(Perspective) {
|
|
101
|
+
}
|
|
144
102
|
;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ApiClient } from "../apiClient";
|
|
2
2
|
import { ExpressionRendered } from "../expression/Expression";
|
|
3
3
|
import { ExpressionClient } from "../expression/ExpressionClient";
|
|
4
4
|
import { Link, LinkExpressionInput, LinkExpression, LinkMutations, LinkExpressionMutations } from "../links/Links";
|
|
@@ -16,9 +16,7 @@ export type LinkCallback = (link: LinkExpression) => null;
|
|
|
16
16
|
export type SyncStateChangeCallback = (state: PerspectiveState) => null;
|
|
17
17
|
export declare class PerspectiveClient {
|
|
18
18
|
#private;
|
|
19
|
-
constructor(
|
|
20
|
-
/** Get or create a proxy for a UUID. If the proxy exists in cache, update its handle and return it. */
|
|
21
|
-
private getOrCreateProxy;
|
|
19
|
+
constructor(baseUrl: string, token?: string, subscribe?: boolean, sharedApiClient?: ApiClient);
|
|
22
20
|
setExpressionClient(client: ExpressionClient): void;
|
|
23
21
|
setNeighbourhoodClient(client: NeighbourhoodClient): void;
|
|
24
22
|
setAIClient(client: AIClient): void;
|
|
@@ -28,16 +26,24 @@ export declare class PerspectiveClient {
|
|
|
28
26
|
snapshotByUUID(uuid: string): Promise<Perspective | null>;
|
|
29
27
|
publishSnapshotByUUID(uuid: string): Promise<string | null>;
|
|
30
28
|
queryLinks(uuid: string, query: LinkQuery): Promise<LinkExpression[]>;
|
|
31
|
-
queryProlog(uuid: string, query: string): Promise<
|
|
32
|
-
querySparql(uuid: string, query: string): Promise<
|
|
29
|
+
queryProlog(uuid: string, query: string): Promise<unknown>;
|
|
30
|
+
querySparql(uuid: string, query: string): Promise<unknown>;
|
|
33
31
|
subscribeQuery(uuid: string, query: string): Promise<{
|
|
34
32
|
subscriptionId: string;
|
|
35
33
|
result: AllInstancesResult;
|
|
36
34
|
isInit?: boolean;
|
|
37
35
|
}>;
|
|
36
|
+
perspectiveKeepAliveQuery(uuid: string, subscriptionId: string): Promise<boolean>;
|
|
37
|
+
perspectiveDisposeQuerySubscription(uuid: string, subscriptionId: string): Promise<boolean>;
|
|
38
38
|
subscribeToQueryUpdates(subscriptionId: string, onData: (result: AllInstancesResult) => void): () => void;
|
|
39
39
|
keepAliveQuery(uuid: string, subscriptionId: string): Promise<boolean>;
|
|
40
40
|
disposeQuerySubscription(uuid: string, subscriptionId: string): Promise<boolean>;
|
|
41
|
+
modelQuery(uuid: string, className: string, queryJson: string, shapeJson?: string): Promise<any>;
|
|
42
|
+
evaluateGetters(uuid: string, className: string, instanceIds: string[], shapeJson: string, propertyNames?: string[]): Promise<Record<string, Record<string, any>>>;
|
|
43
|
+
modelSubscribe(uuid: string, className: string, queryJson: string, shapeJson?: string): Promise<{
|
|
44
|
+
subscriptionId: string;
|
|
45
|
+
result: any;
|
|
46
|
+
}>;
|
|
41
47
|
add(name: string): Promise<PerspectiveProxy>;
|
|
42
48
|
update(uuid: string, name: string): Promise<PerspectiveProxy>;
|
|
43
49
|
remove(uuid: string): Promise<{
|
|
@@ -50,22 +56,12 @@ export declare class PerspectiveClient {
|
|
|
50
56
|
addLinkExpression(uuid: string, link: LinkExpression, status?: LinkStatus, batchId?: string): Promise<LinkExpression>;
|
|
51
57
|
updateLink(uuid: string, oldLink: LinkExpressionInput, newLink: Link, batchId?: string): Promise<LinkExpression>;
|
|
52
58
|
removeLink(uuid: string, link: LinkExpressionInput, batchId?: string): Promise<boolean>;
|
|
53
|
-
/**
|
|
54
|
-
* Adds Social DNA code to a perspective.
|
|
55
|
-
*
|
|
56
|
-
* Preferred usage: pass shaclJson (from SHACLShape.toJSON()) as the primary schema definition.
|
|
57
|
-
* The sdnaCode parameter is kept for backward compatibility but SHACL is the source of truth
|
|
58
|
-
* for all SDNA operations. Prolog engines remain available for complex queries.
|
|
59
|
-
*
|
|
60
|
-
* @param sdnaCode - Legacy Prolog code (pass empty string when using shaclJson)
|
|
61
|
-
* @param shaclJson - SHACL JSON string from SHACLShape.toJSON() (recommended)
|
|
62
|
-
*/
|
|
63
59
|
addSdna(uuid: string, name: string, sdnaCode: string | undefined, sdnaType: "subject_class" | "flow" | "custom", shaclJson?: string): Promise<boolean>;
|
|
64
60
|
executeCommands(uuid: string, commands: string, expression: string, parameters: string, batchId?: string): Promise<boolean>;
|
|
65
61
|
createSubject(uuid: string, subjectClass: string, expressionAddress: string, initialValues?: string, batchId?: string): Promise<boolean>;
|
|
66
62
|
getSubjectData(uuid: string, subjectClass: string, expressionAddress: string): Promise<string>;
|
|
67
63
|
getExpression(expressionURI: string): Promise<ExpressionRendered>;
|
|
68
|
-
createExpression(content:
|
|
64
|
+
createExpression(content: unknown, languageAddress: string): Promise<string>;
|
|
69
65
|
addPerspectiveAddedListener(cb: PerspectiveHandleCallback): void;
|
|
70
66
|
subscribePerspectiveAdded(): void;
|
|
71
67
|
addPerspectiveUpdatedListener(cb: PerspectiveHandleCallback): void;
|