@coasys/ad4m 0.13.0-test-2 → 0.13.0-test-4
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 +2805 -10556
- package/lib/index.js +2513 -10322
- package/lib/src/Ad4mClient.d.ts +7 -3
- package/lib/src/Ad4mClient.js +29 -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 -2
- package/lib/src/index.js +6 -2
- 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 +26 -214
- package/lib/src/language/Language.js +32 -72
- 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 +81 -38
- package/lib/src/model/Ad4mModel.js +651 -408
- package/lib/src/model/Ad4mModel.test.js +488 -750
- package/lib/src/model/ModelQueryBuilder.d.ts +28 -21
- package/lib/src/model/ModelQueryBuilder.js +160 -195
- package/lib/src/model/decorators.d.ts +22 -0
- package/lib/src/model/decorators.js +7 -0
- package/lib/src/model/hydration-batching.test.d.ts +7 -0
- package/lib/src/model/hydration-batching.test.js +456 -0
- package/lib/src/model/hydration.d.ts +8 -60
- package/lib/src/model/hydration.js +41 -541
- 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 +36 -22
- package/lib/src/model/query-sparql.js +188 -53
- package/lib/src/model/query-sparql.test.d.ts +1 -0
- package/lib/src/model/query-sparql.test.js +312 -0
- package/lib/src/model/query-utils.js +4 -0
- package/lib/src/model/shacl-gen.js +4 -0
- package/lib/src/model/subscription-delta.test.d.ts +24 -0
- package/lib/src/model/subscription-delta.test.js +180 -0
- package/lib/src/model/subscription-pool.js +48 -2
- package/lib/src/model/types.d.ts +58 -1
- 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 +12 -15
- package/lib/src/perspectives/PerspectiveClient.js +168 -400
- package/lib/src/perspectives/PerspectiveClient.test.d.ts +1 -0
- package/lib/src/perspectives/PerspectiveClient.test.js +224 -0
- package/lib/src/perspectives/PerspectiveDiff.js +4 -31
- package/lib/src/perspectives/PerspectiveHandle.js +3 -43
- package/lib/src/perspectives/PerspectiveProxy.d.ts +95 -71
- package/lib/src/perspectives/PerspectiveProxy.js +288 -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 +9 -24
- package/rollup.config.js +0 -7
- package/src/Ad4mClient.test.ts +1182 -1288
- package/src/Ad4mClient.ts +30 -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 -2
- package/src/jestSetup.ts +1 -1
- package/src/language/Icon.ts +0 -4
- package/src/language/Language.ts +50 -292
- 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 +827 -808
- package/src/model/Ad4mModel.ts +676 -457
- package/src/model/ModelQueryBuilder.ts +199 -217
- package/src/model/decorators.ts +29 -0
- package/src/model/hydration.ts +17 -572
- package/src/model/index.ts +0 -4
- package/src/model/query-sparql.test.ts +360 -0
- package/src/model/query-sparql.ts +203 -56
- package/src/model/query-utils.ts +4 -0
- package/src/model/shacl-gen.ts +5 -0
- package/src/model/types.ts +62 -1
- 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 +262 -0
- package/src/perspectives/PerspectiveClient.ts +227 -412
- 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 +325 -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/lib/src/model/query-surreal.d.ts +0 -44
- package/lib/src/model/query-surreal.js +0 -249
- package/lib/src/model/surreal-utils.d.ts +0 -42
- package/lib/src/model/surreal-utils.js +0 -128
- 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/LanguageContext.ts +0 -37
- 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/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-pool.ts +0 -163
- 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
- package/tsconfig-browser.json +0 -82
package/lib/src/model/types.d.ts
CHANGED
|
@@ -61,18 +61,75 @@ export type ParentScope = {
|
|
|
61
61
|
* ```
|
|
62
62
|
*/
|
|
63
63
|
export interface IncludeMap {
|
|
64
|
-
[relation: string]: boolean | RelationSubQuery;
|
|
64
|
+
[relation: string]: boolean | RelationSubQuery | IncludeProjection;
|
|
65
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* A lightweight projection that computes a scalar or list value from a relation
|
|
68
|
+
* without fully hydrating the linked instances.
|
|
69
|
+
*
|
|
70
|
+
* Keys in `IncludeMap` that begin with `$` are treated as projections.
|
|
71
|
+
* Results are attached directly to each queried instance under the same key.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```typescript
|
|
75
|
+
* // Attach a like-count to each post
|
|
76
|
+
* const posts = await Post.findAll(perspective, {
|
|
77
|
+
* include: {
|
|
78
|
+
* $likeCount: { from: 'likes', count: true },
|
|
79
|
+
* $myLike: { from: 'likes', limit: 1 },
|
|
80
|
+
* }
|
|
81
|
+
* });
|
|
82
|
+
* posts[0].$likeCount // number
|
|
83
|
+
* posts[0].$myLike // string ID or null
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
export interface IncludeProjection {
|
|
87
|
+
/** The relation name on the parent model to project over. */
|
|
88
|
+
from: string;
|
|
89
|
+
/** When true, attaches an integer count instead of a list. */
|
|
90
|
+
count?: true;
|
|
91
|
+
/**
|
|
92
|
+
* Serialised target class shape. Set automatically by `executeModelQuery`
|
|
93
|
+
* when a `where` clause is present and the target class is resolvable.
|
|
94
|
+
* @internal
|
|
95
|
+
*/
|
|
96
|
+
targetShape?: ModelMetadata;
|
|
97
|
+
/** Post-hydration where clause applied to the target instances. */
|
|
98
|
+
where?: Where;
|
|
99
|
+
/** Limit results (when 1, the attached value is unwrapped to a scalar). */
|
|
100
|
+
limit?: number;
|
|
101
|
+
/** Order results before applying limit. */
|
|
102
|
+
order?: Order;
|
|
103
|
+
}
|
|
104
|
+
/** Type guard for IncludeProjection objects. */
|
|
105
|
+
export declare function isIncludeProjection(val: unknown): val is IncludeProjection;
|
|
66
106
|
export type Query = {
|
|
67
107
|
/** Filter to instances that are the target of a link from a given parent. */
|
|
68
108
|
parent?: ParentScope;
|
|
69
109
|
properties?: string[];
|
|
70
110
|
include?: IncludeMap;
|
|
111
|
+
/**
|
|
112
|
+
* When true, eager-loads every declared forward relation on the model.
|
|
113
|
+
* Equivalent to listing all relation field names in `include: {}` explicitly.
|
|
114
|
+
* Useful for tree-walking and manifest-style inspections.
|
|
115
|
+
* Individual relations can still be overridden via `include` (explicit entries take precedence).
|
|
116
|
+
*/
|
|
117
|
+
includeAll?: boolean;
|
|
71
118
|
where?: Where;
|
|
72
119
|
order?: Order;
|
|
73
120
|
offset?: number;
|
|
74
121
|
limit?: number;
|
|
75
122
|
count?: boolean;
|
|
123
|
+
/**
|
|
124
|
+
* When true, SPARQL property getters (@Property with `getter`) ARE evaluated
|
|
125
|
+
* during collection hydration. By default, collection queries skip getter
|
|
126
|
+
* evaluation for performance — getters run only on single-instance get().
|
|
127
|
+
*
|
|
128
|
+
* Use this when you need getter-backed properties (e.g. `replyingTo`,
|
|
129
|
+
* `isPopular`) in a list query. For most list/feed UIs, leave this off
|
|
130
|
+
* and use `Ad4mModel.evaluateGetters()` on visible items only.
|
|
131
|
+
*/
|
|
132
|
+
deepQuery?: boolean;
|
|
76
133
|
};
|
|
77
134
|
/**
|
|
78
135
|
* Sub-query options for a specific relation inside an `IncludeMap`.
|
package/lib/src/model/types.js
CHANGED
|
@@ -5,4 +5,7 @@
|
|
|
5
5
|
* (`query-utils.ts`, `decorators.ts`, etc.) can import types without
|
|
6
6
|
* creating circular runtime dependencies on `Ad4mModel.ts`.
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
/** Type guard for IncludeProjection objects. */
|
|
9
|
+
export function isIncludeProjection(val) {
|
|
10
|
+
return typeof val === 'object' && val !== null && 'from' in val;
|
|
11
|
+
}
|
|
@@ -1,38 +1,10 @@
|
|
|
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
|
-
import { Field, ObjectType } from "type-graphql";
|
|
11
1
|
import { ExpressionGeneric } from "../expression/Expression";
|
|
12
|
-
|
|
13
|
-
let Neighbourhood = class Neighbourhood {
|
|
2
|
+
export class Neighbourhood {
|
|
14
3
|
constructor(linkLanguage, meta) {
|
|
15
4
|
this.linkLanguage = linkLanguage;
|
|
16
5
|
this.meta = meta;
|
|
17
6
|
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
__metadata("design:type", String)
|
|
22
|
-
], Neighbourhood.prototype, "linkLanguage", void 0);
|
|
23
|
-
__decorate([
|
|
24
|
-
Field(),
|
|
25
|
-
__metadata("design:type", Perspective)
|
|
26
|
-
], Neighbourhood.prototype, "meta", void 0);
|
|
27
|
-
Neighbourhood = __decorate([
|
|
28
|
-
ObjectType(),
|
|
29
|
-
__metadata("design:paramtypes", [String, Perspective])
|
|
30
|
-
], Neighbourhood);
|
|
31
|
-
export { Neighbourhood };
|
|
32
|
-
let NeighbourhoodExpression = class NeighbourhoodExpression extends ExpressionGeneric(Neighbourhood) {
|
|
33
|
-
};
|
|
34
|
-
NeighbourhoodExpression = __decorate([
|
|
35
|
-
ObjectType()
|
|
36
|
-
], NeighbourhoodExpression);
|
|
37
|
-
export { NeighbourhoodExpression };
|
|
7
|
+
}
|
|
8
|
+
export class NeighbourhoodExpression extends ExpressionGeneric(Neighbourhood) {
|
|
9
|
+
}
|
|
38
10
|
;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ApiClient } from "../apiClient";
|
|
2
2
|
import { Address } from "../Address";
|
|
3
3
|
import { DID } from "../DID";
|
|
4
4
|
import { OnlineAgent, TelepresenceSignalCallback } from "../language/Language";
|
|
@@ -6,7 +6,7 @@ import { Perspective, PerspectiveUnsignedInput } from "../perspectives/Perspecti
|
|
|
6
6
|
import { PerspectiveHandle } from "../perspectives/PerspectiveHandle";
|
|
7
7
|
export declare class NeighbourhoodClient {
|
|
8
8
|
#private;
|
|
9
|
-
constructor(
|
|
9
|
+
constructor(baseUrl: string, token?: string, sharedApiClient?: ApiClient);
|
|
10
10
|
publishFromPerspective(perspectiveUUID: string, linkLanguage: Address, meta: Perspective): Promise<string>;
|
|
11
11
|
joinFromUrl(url: string): Promise<PerspectiveHandle>;
|
|
12
12
|
otherAgents(perspectiveUUID: string): Promise<DID[]>;
|
|
@@ -18,7 +18,7 @@ export declare class NeighbourhoodClient {
|
|
|
18
18
|
sendSignalU(perspectiveUUID: string, remoteAgentDid: string, payload: PerspectiveUnsignedInput): Promise<boolean>;
|
|
19
19
|
sendBroadcast(perspectiveUUID: string, payload: Perspective, loopback?: boolean): Promise<boolean>;
|
|
20
20
|
sendBroadcastU(perspectiveUUID: string, payload: PerspectiveUnsignedInput, loopback?: boolean): Promise<boolean>;
|
|
21
|
-
dispatchSignal(perspectiveUUID: string, signal:
|
|
21
|
+
dispatchSignal(perspectiveUUID: string, signal: unknown): void;
|
|
22
22
|
subscribeToSignals(perspectiveUUID: string): Promise<void>;
|
|
23
23
|
addSignalHandler(perspectiveUUID: string, handler: TelepresenceSignalCallback): Promise<void>;
|
|
24
24
|
removeSignalHandler(perspectiveUUID: string, handler: TelepresenceSignalCallback): void;
|
|
@@ -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
|
;
|