@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
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { PerspectiveExpression } from "../perspectives/Perspective";
|
|
2
|
+
import { ExceptionType } from "../Exception";
|
|
3
|
+
|
|
4
|
+
export class SentMessage {
|
|
5
|
+
recipient: string;
|
|
6
|
+
message: PerspectiveExpression;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export class RuntimeInfo {
|
|
10
|
+
ad4mExecutorVersion: string;
|
|
11
|
+
isInitialized: Boolean;
|
|
12
|
+
isUnlocked: Boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export class ExceptionInfo {
|
|
16
|
+
title: string;
|
|
17
|
+
message: string;
|
|
18
|
+
type: ExceptionType;
|
|
19
|
+
addon?: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export class NotificationInput {
|
|
23
|
+
description: string;
|
|
24
|
+
appName: string;
|
|
25
|
+
appUrl: string;
|
|
26
|
+
appIconPath: string;
|
|
27
|
+
|
|
28
|
+
// This is a query which will be executed on every perspective change.
|
|
29
|
+
// All matched unbound variables will be part of the triggerMatch, i.e.
|
|
30
|
+
// the content that will be sent to the launcher via event push
|
|
31
|
+
// and to the webhook.
|
|
32
|
+
trigger: string;
|
|
33
|
+
|
|
34
|
+
// List Perspectives this Notification is active on.
|
|
35
|
+
perspectiveIds: string[];
|
|
36
|
+
|
|
37
|
+
// URL to which the notification matches will be sent via POST
|
|
38
|
+
webhookUrl: string;
|
|
39
|
+
|
|
40
|
+
// Authentication bearer token to be sent via POST to the webhookUrl.
|
|
41
|
+
webhookAuth: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export class Notification {
|
|
45
|
+
id: string;
|
|
46
|
+
granted: boolean;
|
|
47
|
+
description: string;
|
|
48
|
+
appName: string;
|
|
49
|
+
appUrl: string;
|
|
50
|
+
appIconPath: string;
|
|
51
|
+
trigger: string;
|
|
52
|
+
perspectiveIds: string[];
|
|
53
|
+
webhookUrl: string;
|
|
54
|
+
webhookAuth: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export class TriggeredNotification {
|
|
58
|
+
notification: Notification;
|
|
59
|
+
perspectiveId: string;
|
|
60
|
+
triggerMatch: string;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export class ImportStats {
|
|
64
|
+
total: number;
|
|
65
|
+
imported: number;
|
|
66
|
+
failed: number;
|
|
67
|
+
omitted: number;
|
|
68
|
+
errors: string[];
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export class ImportResult {
|
|
72
|
+
perspectives: ImportStats;
|
|
73
|
+
links: ImportStats;
|
|
74
|
+
expressions: ImportStats;
|
|
75
|
+
perspectiveDiffs: ImportStats;
|
|
76
|
+
notifications: ImportStats;
|
|
77
|
+
models: ImportStats;
|
|
78
|
+
defaultModels: ImportStats;
|
|
79
|
+
tasks: ImportStats;
|
|
80
|
+
friends: ImportStats;
|
|
81
|
+
trustedAgents: ImportStats;
|
|
82
|
+
knownLinkLanguages: ImportStats;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export class UserStatistics {
|
|
86
|
+
email: string;
|
|
87
|
+
did: string;
|
|
88
|
+
lastSeen?: string;
|
|
89
|
+
perspectiveCount: number;
|
|
90
|
+
remainingCredits: string;
|
|
91
|
+
freeAccess: boolean;
|
|
92
|
+
hotWalletAddress?: string;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export class VerificationRequestResult {
|
|
96
|
+
success: boolean;
|
|
97
|
+
message: string;
|
|
98
|
+
requiresPassword: boolean;
|
|
99
|
+
isExistingUser: boolean;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export class HostingUserInfo {
|
|
103
|
+
email: string;
|
|
104
|
+
remainingCredits: string;
|
|
105
|
+
hotWalletAddress?: string;
|
|
106
|
+
freeAccess: boolean;
|
|
107
|
+
|
|
108
|
+
constructor(email: string, remainingCredits: string, hotWalletAddress?: string, freeAccess: boolean = false) {
|
|
109
|
+
this.email = email;
|
|
110
|
+
this.remainingCredits = remainingCredits;
|
|
111
|
+
this.hotWalletAddress = hotWalletAddress;
|
|
112
|
+
this.freeAccess = freeAccess;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export class PaymentRequestResult {
|
|
117
|
+
success: boolean;
|
|
118
|
+
message: string;
|
|
119
|
+
|
|
120
|
+
constructor(success: boolean, message: string) {
|
|
121
|
+
this.success = success;
|
|
122
|
+
this.message = message;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export class ComputeLogEntry {
|
|
127
|
+
id: number;
|
|
128
|
+
userEmail: string;
|
|
129
|
+
timestamp: string;
|
|
130
|
+
operation: string;
|
|
131
|
+
summary?: string;
|
|
132
|
+
cost: number;
|
|
133
|
+
creditsAfter: number;
|
|
134
|
+
|
|
135
|
+
constructor(id: number, userEmail: string, timestamp: string, operation: string, cost: number, creditsAfter: number, summary?: string) {
|
|
136
|
+
this.id = id;
|
|
137
|
+
this.userEmail = userEmail;
|
|
138
|
+
this.timestamp = timestamp;
|
|
139
|
+
this.operation = operation;
|
|
140
|
+
this.cost = cost;
|
|
141
|
+
this.creditsAfter = creditsAfter;
|
|
142
|
+
this.summary = summary;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
@@ -397,4 +397,98 @@ describe('SHACLShape', () => {
|
|
|
397
397
|
expect(prop.remover).toEqual(original.properties[0].remover);
|
|
398
398
|
});
|
|
399
399
|
});
|
|
400
|
+
|
|
401
|
+
describe('sh:in round-trip', () => {
|
|
402
|
+
it('preserves sh:in enum values through toLinks() → fromLinks()', () => {
|
|
403
|
+
const original = new SHACLShape('test://Model');
|
|
404
|
+
original.addProperty({
|
|
405
|
+
name: 'status',
|
|
406
|
+
path: 'test://status',
|
|
407
|
+
datatype: 'xsd:string',
|
|
408
|
+
in: [
|
|
409
|
+
{ value: 'active', label: 'Active' },
|
|
410
|
+
{ value: 'inactive', label: 'Inactive' },
|
|
411
|
+
{ value: 'archived' },
|
|
412
|
+
],
|
|
413
|
+
});
|
|
414
|
+
|
|
415
|
+
const links = original.toLinks();
|
|
416
|
+
|
|
417
|
+
// Verify sh:in link was created
|
|
418
|
+
const inLink = links.find(l => l.predicate === 'sh://in');
|
|
419
|
+
expect(inLink).toBeDefined();
|
|
420
|
+
expect(inLink!.target).toContain('literal:string:');
|
|
421
|
+
|
|
422
|
+
// Reconstruct and verify
|
|
423
|
+
const reconstructed = SHACLShape.fromLinks(links, 'test://ModelShape');
|
|
424
|
+
expect(reconstructed.properties[0].in).toBeDefined();
|
|
425
|
+
expect(reconstructed.properties[0].in).toEqual([
|
|
426
|
+
{ value: 'active', label: 'Active' },
|
|
427
|
+
{ value: 'inactive', label: 'Inactive' },
|
|
428
|
+
{ value: 'archived' },
|
|
429
|
+
]);
|
|
430
|
+
});
|
|
431
|
+
|
|
432
|
+
it('handles sh:in with special characters in values', () => {
|
|
433
|
+
const original = new SHACLShape('test://Model');
|
|
434
|
+
original.addProperty({
|
|
435
|
+
name: 'category',
|
|
436
|
+
path: 'test://category',
|
|
437
|
+
in: [
|
|
438
|
+
{ value: 'food & drink', label: 'Food & Drink' },
|
|
439
|
+
{ value: 'arts/crafts' },
|
|
440
|
+
],
|
|
441
|
+
});
|
|
442
|
+
|
|
443
|
+
const links = original.toLinks();
|
|
444
|
+
const reconstructed = SHACLShape.fromLinks(links, 'test://ModelShape');
|
|
445
|
+
expect(reconstructed.properties[0].in).toEqual(original.properties[0].in);
|
|
446
|
+
});
|
|
447
|
+
|
|
448
|
+
it('handles sh:in with empty array (no link created)', () => {
|
|
449
|
+
const original = new SHACLShape('test://Model');
|
|
450
|
+
original.addProperty({
|
|
451
|
+
name: 'field',
|
|
452
|
+
path: 'test://field',
|
|
453
|
+
in: [],
|
|
454
|
+
});
|
|
455
|
+
|
|
456
|
+
const links = original.toLinks();
|
|
457
|
+
const inLink = links.find(l => l.predicate === 'sh://in');
|
|
458
|
+
expect(inLink).toBeUndefined();
|
|
459
|
+
});
|
|
460
|
+
|
|
461
|
+
it('handles sh:in with literal://string: prefix variant', () => {
|
|
462
|
+
// fromLinks should handle both `literal:string:` and `literal://string:` prefixes
|
|
463
|
+
const links = [
|
|
464
|
+
{ source: 'test://ModelShape', predicate: 'sh://targetClass', target: 'test://Model' },
|
|
465
|
+
{ source: 'test://ModelShape', predicate: 'sh://property', target: 'test://Model.status' },
|
|
466
|
+
{ source: 'test://Model.status', predicate: 'sh://path', target: 'test://status' },
|
|
467
|
+
{ source: 'test://Model.status', predicate: 'sh://in', target: 'literal://string:[{"value":"a"},{"value":"b"}]' },
|
|
468
|
+
];
|
|
469
|
+
|
|
470
|
+
const reconstructed = SHACLShape.fromLinks(links, 'test://ModelShape');
|
|
471
|
+
expect(reconstructed.properties[0].in).toEqual([
|
|
472
|
+
{ value: 'a' },
|
|
473
|
+
{ value: 'b' },
|
|
474
|
+
]);
|
|
475
|
+
});
|
|
476
|
+
|
|
477
|
+
it('preserves sh:in through toJSON() → fromJSON()', () => {
|
|
478
|
+
const original = new SHACLShape('test://Model');
|
|
479
|
+
original.addProperty({
|
|
480
|
+
name: 'priority',
|
|
481
|
+
path: 'test://priority',
|
|
482
|
+
in: [
|
|
483
|
+
{ value: 'high', label: 'High' },
|
|
484
|
+
{ value: 'medium', label: 'Medium' },
|
|
485
|
+
{ value: 'low', label: 'Low' },
|
|
486
|
+
],
|
|
487
|
+
});
|
|
488
|
+
|
|
489
|
+
const json = original.toJSON();
|
|
490
|
+
const reconstructed = SHACLShape.fromJSON(json);
|
|
491
|
+
expect(reconstructed.properties[0].in).toEqual(original.properties[0].in);
|
|
492
|
+
});
|
|
493
|
+
});
|
|
400
494
|
});
|
package/src/shacl/SHACLShape.ts
CHANGED
|
@@ -174,6 +174,11 @@ export interface SHACLPropertyShape {
|
|
|
174
174
|
* Set automatically when a relation has a `target` model. Enables typed construction
|
|
175
175
|
* on the Rust/MCP side by referencing the full target shape. */
|
|
176
176
|
class?: string;
|
|
177
|
+
|
|
178
|
+
/** sh:in — allowed values for this property (enum constraint).
|
|
179
|
+
* Each entry has a `value` (the RDF term) and an optional `label` (human-readable name).
|
|
180
|
+
* Standard SHACL `sh:in` only defines values; labels are an AD4M extension. */
|
|
181
|
+
in?: Array<{ value: string; label?: string }>;
|
|
177
182
|
}
|
|
178
183
|
|
|
179
184
|
/**
|
|
@@ -545,6 +550,14 @@ export class SHACLShape {
|
|
|
545
550
|
target: prop.class
|
|
546
551
|
});
|
|
547
552
|
}
|
|
553
|
+
|
|
554
|
+
if (prop.in && prop.in.length > 0) {
|
|
555
|
+
links.push({
|
|
556
|
+
source: propShapeId,
|
|
557
|
+
predicate: "sh://in",
|
|
558
|
+
target: `literal:string:${JSON.stringify(prop.in)}`
|
|
559
|
+
});
|
|
560
|
+
}
|
|
548
561
|
}
|
|
549
562
|
|
|
550
563
|
return links;
|
|
@@ -775,6 +788,18 @@ export class SHACLShape {
|
|
|
775
788
|
prop.class = classLink.target;
|
|
776
789
|
}
|
|
777
790
|
|
|
791
|
+
const inLink = links.find(l =>
|
|
792
|
+
l.source === propShapeId && l.predicate === "sh://in"
|
|
793
|
+
);
|
|
794
|
+
if (inLink) {
|
|
795
|
+
try {
|
|
796
|
+
const jsonStr = inLink.target.replace(/^literal:\/\/string:|^literal:string:/, '');
|
|
797
|
+
prop.in = JSON.parse(jsonStr);
|
|
798
|
+
} catch (e) {
|
|
799
|
+
// Ignore parse errors
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
|
|
778
803
|
shape.addProperty(prop);
|
|
779
804
|
}
|
|
780
805
|
|
|
@@ -812,6 +837,7 @@ export class SHACLShape {
|
|
|
812
837
|
getter: p.getter,
|
|
813
838
|
conformance_conditions: p.conformanceConditions,
|
|
814
839
|
class: p.class,
|
|
840
|
+
in: p.in,
|
|
815
841
|
})),
|
|
816
842
|
constructor_actions: this.constructor_actions,
|
|
817
843
|
destructor_actions: this.destructor_actions,
|
|
@@ -847,6 +873,7 @@ export class SHACLShape {
|
|
|
847
873
|
getter: p.getter,
|
|
848
874
|
conformanceConditions: p.conformance_conditions,
|
|
849
875
|
class: p.class,
|
|
876
|
+
in: p.in,
|
|
850
877
|
});
|
|
851
878
|
}
|
|
852
879
|
|
package/src/typeDefs.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
// This way lib/index.js can stay the compiled version of index.ts,
|
|
4
|
-
// where index.ts imports this file...
|
|
1
|
+
// Placeholder for type definition string.
|
|
2
|
+
// Previously generated by buildSchema; kept for backward compatibility.
|
|
5
3
|
|
|
6
|
-
export const typeDefsString = ""
|
|
4
|
+
export const typeDefsString = ""
|
package/tsconfig.json
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
-
"include": ["./src/**/*.ts", "./src/*.ts"
|
|
3
|
-
"exclude": ["./src/*.test.ts", "./src
|
|
2
|
+
"include": ["./src/**/*.ts", "./src/*.ts"],
|
|
3
|
+
"exclude": ["./src/*.test.ts", "./src/**/*.test.ts"],
|
|
4
4
|
"compilerOptions": {
|
|
5
5
|
/* Visit https://aka.ms/tsconfig.json to read more about this file */
|
|
6
|
-
// "paths": {
|
|
7
|
-
// "type-graphql": ["./shims/type-graphql.ts"],
|
|
8
|
-
// "reflect-metadata": ["./shims/reflect-metadata.ts"]
|
|
9
|
-
// },
|
|
10
6
|
/* Basic Options */
|
|
11
7
|
// "incremental": true, /* Enable incremental compilation */
|
|
12
8
|
"target": "es2020", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'es2015', or 'ESNEXT'. */
|
|
13
|
-
"lib": ["es2020", "esnext.asynciterable"],
|
|
9
|
+
"lib": ["es2020", "esnext.asynciterable", "dom"],
|
|
14
10
|
"module": "es2020", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
|
|
15
11
|
// "lib": [], /* Specify library files to be included in the compilation. */
|
|
16
12
|
// "allowJs": true, /* Allow javascript files to be compiled. */
|
|
File without changes
|
package/shims/type-graphql.ts
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
This "shim" can be used on the frontend to prevent from errors on undefined decorators,
|
|
3
|
-
when you are sharing same classes across backend and frontend.
|
|
4
|
-
|
|
5
|
-
To use this shim, simply set up your Webpack configuration
|
|
6
|
-
to use this file instead of a normal TypeGraphQL module.
|
|
7
|
-
|
|
8
|
-
```js
|
|
9
|
-
plugins: [
|
|
10
|
-
// ...here are any other existing plugins that you already have
|
|
11
|
-
new webpack.NormalModuleReplacementPlugin(/type-graphql$/, resource => {
|
|
12
|
-
resource.request = resource.request.replace(/type-graphql/, "type-graphql/dist/browser-shim");
|
|
13
|
-
}),
|
|
14
|
-
]
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
However, in some TypeScript projects like the ones using Angular,
|
|
18
|
-
which AoT compiler requires that a full `*.ts` file is provided
|
|
19
|
-
instead of just a `*.js` and `*.d.ts` files, to use this shim
|
|
20
|
-
we have to simply set up our TypeScript configuration in `tsconfig.json`
|
|
21
|
-
to use this file instead of a normal TypeGraphQL module:
|
|
22
|
-
|
|
23
|
-
```json
|
|
24
|
-
{
|
|
25
|
-
"compilerOptions": {
|
|
26
|
-
"baseUrl": ".",
|
|
27
|
-
"paths": {
|
|
28
|
-
"type-graphql": [
|
|
29
|
-
"./node_modules/type-graphql/dist/browser-shim.ts"
|
|
30
|
-
]
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
```
|
|
35
|
-
*/
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
import * as src from "../node_modules/type-graphql/dist/index.js";
|
|
39
|
-
|
|
40
|
-
export const dummyValue = "";
|
|
41
|
-
export function dummyFn() {
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
export function dummyDecorator() {
|
|
45
|
-
return dummyFn;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export const Arg: typeof src.Arg = dummyDecorator;
|
|
49
|
-
export const Args: typeof src.Args = dummyDecorator;
|
|
50
|
-
export const ArgsType: typeof src.ArgsType = dummyDecorator;
|
|
51
|
-
export const Authorized: typeof src.Authorized = dummyDecorator;
|
|
52
|
-
export const Ctx: typeof src.Ctx = dummyDecorator;
|
|
53
|
-
export const registerEnumType: typeof src.registerEnumType = dummyFn;
|
|
54
|
-
export const Field: typeof src.Field = dummyDecorator;
|
|
55
|
-
export const FieldResolver: typeof src.FieldResolver = dummyDecorator;
|
|
56
|
-
export const Info: typeof src.Info = dummyDecorator;
|
|
57
|
-
export const InputType: typeof src.InputType = dummyDecorator;
|
|
58
|
-
export const InterfaceType: typeof src.InterfaceType = dummyDecorator;
|
|
59
|
-
export const Mutation: typeof src.Mutation = dummyDecorator;
|
|
60
|
-
export const ObjectType: typeof src.ObjectType = dummyDecorator;
|
|
61
|
-
export const PubSub: typeof src.PubSub = dummyDecorator;
|
|
62
|
-
export const Query: typeof src.Query = dummyDecorator;
|
|
63
|
-
export const Resolver: typeof src.Resolver = dummyDecorator;
|
|
64
|
-
export const Root: typeof src.Root = dummyDecorator;
|
|
65
|
-
export const Subscription: typeof src.Subscription = dummyDecorator;
|
|
66
|
-
export const createUnionType: typeof src.createUnionType = dummyFn as any;
|
|
67
|
-
export const UseMiddleware: typeof src.UseMiddleware = dummyDecorator;
|
|
68
|
-
export const PubSubEngine: typeof src.PubSubEngine = dummyDecorator as any;
|
|
69
|
-
|
|
70
|
-
export class ClassType<t> {}
|
|
71
|
-
export const Int: typeof src.Int = dummyValue as any;
|
|
72
|
-
export const Float: typeof src.Float = dummyValue as any;
|
|
73
|
-
export const ID: typeof src.ID = dummyValue as any;
|
|
74
|
-
export const GraphQLISODateTime: typeof src.GraphQLISODateTime = dummyValue as any;
|
|
75
|
-
export const GraphQLTimestamp: typeof src.GraphQLTimestamp = dummyValue as any;
|
package/src/PubSub.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export const AGENT_UPDATED = 'agent-updated-topic'
|
|
2
|
-
export const AGENT_STATUS_CHANGED = 'agent-status-changed-topic'
|
|
3
|
-
export const RUNTIME_MESSAGED_RECEIVED_TOPIC = 'runtime-messaged-received-topic'
|
|
4
|
-
export const PERSPECTIVE_ADDED_TOPIC = 'perspective-added-topic'
|
|
5
|
-
export const PERSPECTIVE_UPDATED_TOPIC = 'perspective-updated-topic'
|
|
6
|
-
export const PERSPECTIVE_REMOVED_TOPIC = 'perspective-removed-topic'
|
|
7
|
-
export const LINK_ADDED_TOPIC = 'link-added-topic'
|
|
8
|
-
export const LINK_REMOVED_TOPIC = 'link-removed-topic'
|
|
9
|
-
export const LINK_UDATED_TOPIC = 'link-updated-topic'
|
|
10
|
-
export const SIGNAL = "signal"
|
|
11
|
-
export const EXCEPTION_OCCURRED_TOPIC = "exception-occurred-topic"
|
|
12
|
-
export const RUNTIME_NOTIFICATION_REQUESTED_TOPIC = "runtime-notification-requested-topic"
|
|
13
|
-
export const RUNTIME_NOTIFICATION_TRIGGERED_TOPIC = "runtime-notification-triggered-topic"
|
|
14
|
-
export const NEIGHBOURHOOD_SIGNAL_RECEIVED_TOPIC = "neighbourhood-signal-received-topic"
|
|
15
|
-
export const PERSPECTIVE_SYNC_STATE_CHANGE = "perspective-sync-state-change"
|
|
16
|
-
export const APPS_CHANGED = "apps-changed"
|
|
17
|
-
export const AI_TRANSCRIPTION_TEXT_TOPIC = "ai-transcription-text-topic"
|
|
@@ -1,263 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Arg,
|
|
3
|
-
Mutation,
|
|
4
|
-
Query,
|
|
5
|
-
Resolver,
|
|
6
|
-
Subscription,
|
|
7
|
-
PubSub,
|
|
8
|
-
} from "type-graphql";
|
|
9
|
-
import { Perspective, PerspectiveInput } from "../perspectives/Perspective";
|
|
10
|
-
import {
|
|
11
|
-
Agent,
|
|
12
|
-
AgentSignature,
|
|
13
|
-
Apps,
|
|
14
|
-
AuthInfoInput,
|
|
15
|
-
EntanglementProof,
|
|
16
|
-
EntanglementProofInput,
|
|
17
|
-
} from "./Agent";
|
|
18
|
-
import { AgentStatus } from "./AgentStatus";
|
|
19
|
-
import { AGENT_STATUS_CHANGED, AGENT_UPDATED, APPS_CHANGED } from "../PubSub";
|
|
20
|
-
|
|
21
|
-
export const TEST_AGENT_DID = "did:ad4m:test";
|
|
22
|
-
|
|
23
|
-
@Resolver()
|
|
24
|
-
export default class AgentResolver {
|
|
25
|
-
@Query((returns) => Agent)
|
|
26
|
-
agent(): Agent {
|
|
27
|
-
return new Agent(TEST_AGENT_DID);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
@Query((returns) => AgentStatus)
|
|
31
|
-
agentStatus(): AgentStatus {
|
|
32
|
-
return new AgentStatus({ did: TEST_AGENT_DID });
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
@Mutation((returns) => AgentStatus)
|
|
36
|
-
agentGenerate(
|
|
37
|
-
@Arg("passphrase") passphrase: string,
|
|
38
|
-
@PubSub() pubSub: any
|
|
39
|
-
): AgentStatus {
|
|
40
|
-
const status = new AgentStatus({
|
|
41
|
-
did: TEST_AGENT_DID,
|
|
42
|
-
didDocument: "did document",
|
|
43
|
-
isInitialized: true,
|
|
44
|
-
isUnlocked: true,
|
|
45
|
-
});
|
|
46
|
-
pubSub.publish(AGENT_STATUS_CHANGED, { status });
|
|
47
|
-
return status;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
@Mutation((returns) => AgentStatus)
|
|
51
|
-
agentImport(
|
|
52
|
-
@Arg("did") did: string,
|
|
53
|
-
@Arg("didDocument") didDocument: string,
|
|
54
|
-
@Arg("keystore") keystore: string,
|
|
55
|
-
@Arg("passphrase") passphrase: string
|
|
56
|
-
): AgentStatus {
|
|
57
|
-
return new AgentStatus({
|
|
58
|
-
did,
|
|
59
|
-
didDocument,
|
|
60
|
-
isInitialized: true,
|
|
61
|
-
isUnlocked: true,
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
@Mutation((returns) => AgentStatus)
|
|
66
|
-
agentLock(
|
|
67
|
-
@Arg("passphrase") passphrase: string,
|
|
68
|
-
@PubSub() pubSub: any
|
|
69
|
-
): AgentStatus {
|
|
70
|
-
const status = new AgentStatus({
|
|
71
|
-
isInitialized: true,
|
|
72
|
-
did: TEST_AGENT_DID,
|
|
73
|
-
});
|
|
74
|
-
pubSub.publish(AGENT_STATUS_CHANGED, { status });
|
|
75
|
-
return status;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
@Mutation((returns) => AgentStatus)
|
|
79
|
-
agentUnlock(
|
|
80
|
-
@Arg("passphrase") passphrase: string,
|
|
81
|
-
@Arg("holochain") holochain: boolean,
|
|
82
|
-
@PubSub() pubSub: any
|
|
83
|
-
): AgentStatus {
|
|
84
|
-
const status = new AgentStatus({
|
|
85
|
-
isInitialized: true,
|
|
86
|
-
isUnlocked: true,
|
|
87
|
-
did: TEST_AGENT_DID,
|
|
88
|
-
});
|
|
89
|
-
pubSub.publish(AGENT_STATUS_CHANGED, { status });
|
|
90
|
-
return status;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
@Query((returns) => Agent, { nullable: true })
|
|
94
|
-
agentByDID(@Arg("did") did: string): Agent {
|
|
95
|
-
return new Agent(did);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
@Mutation((returns) => Agent)
|
|
99
|
-
agentUpdatePublicPerspective(
|
|
100
|
-
@Arg("perspective") perspective: PerspectiveInput,
|
|
101
|
-
@PubSub() pubSub: any
|
|
102
|
-
): Agent {
|
|
103
|
-
const agent = new Agent(TEST_AGENT_DID, perspective as Perspective);
|
|
104
|
-
agent.directMessageLanguage = "lang://test";
|
|
105
|
-
pubSub.publish(AGENT_UPDATED, { agent });
|
|
106
|
-
return agent;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
@Mutation((returns) => Agent)
|
|
110
|
-
agentUpdateDirectMessageLanguage(
|
|
111
|
-
@Arg("directMessageLanguage") directMessageLanguage: string,
|
|
112
|
-
@PubSub() pubSub: any
|
|
113
|
-
): Agent {
|
|
114
|
-
const agent = new Agent(TEST_AGENT_DID, new Perspective());
|
|
115
|
-
agent.directMessageLanguage = directMessageLanguage;
|
|
116
|
-
pubSub.publish(AGENT_UPDATED, { agent });
|
|
117
|
-
return agent;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
@Subscription({ topics: AGENT_UPDATED, nullable: true })
|
|
121
|
-
agentUpdated(): Agent {
|
|
122
|
-
return new Agent(TEST_AGENT_DID);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
@Subscription({ topics: AGENT_STATUS_CHANGED, nullable: true })
|
|
126
|
-
agentStatusChanged(): AgentStatus {
|
|
127
|
-
return new AgentStatus({ isInitialized: true, did: TEST_AGENT_DID });
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
@Mutation((returns) => [EntanglementProof])
|
|
131
|
-
agentAddEntanglementProofs(
|
|
132
|
-
@Arg("proofs", (type) => [EntanglementProofInput])
|
|
133
|
-
proofs: EntanglementProofInput[]
|
|
134
|
-
): EntanglementProof[] {
|
|
135
|
-
return [
|
|
136
|
-
new EntanglementProof(
|
|
137
|
-
"did:key:hash",
|
|
138
|
-
"did-key-id",
|
|
139
|
-
"ethereum",
|
|
140
|
-
"ethAddr",
|
|
141
|
-
"sig",
|
|
142
|
-
"sig2"
|
|
143
|
-
),
|
|
144
|
-
];
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
@Mutation((returns) => [EntanglementProof])
|
|
148
|
-
agentDeleteEntanglementProofs(
|
|
149
|
-
@Arg("proofs", (type) => [EntanglementProofInput])
|
|
150
|
-
proofs: EntanglementProofInput[]
|
|
151
|
-
): EntanglementProof[] {
|
|
152
|
-
return [
|
|
153
|
-
new EntanglementProof(
|
|
154
|
-
"did:key:hash",
|
|
155
|
-
"did-key-id",
|
|
156
|
-
"ethereum",
|
|
157
|
-
"ethAddr",
|
|
158
|
-
"sig",
|
|
159
|
-
"sig2"
|
|
160
|
-
),
|
|
161
|
-
];
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
@Query((returns) => [EntanglementProof])
|
|
165
|
-
agentGetEntanglementProofs(): EntanglementProof[] {
|
|
166
|
-
return [
|
|
167
|
-
new EntanglementProof(
|
|
168
|
-
"did:key:hash",
|
|
169
|
-
"did-key-id",
|
|
170
|
-
"ethereum",
|
|
171
|
-
"ethAddr",
|
|
172
|
-
"sig",
|
|
173
|
-
"sig2"
|
|
174
|
-
),
|
|
175
|
-
];
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
@Mutation((returns) => EntanglementProof)
|
|
179
|
-
agentEntanglementProofPreFlight(
|
|
180
|
-
@Arg("deviceKey") deviceKey: string,
|
|
181
|
-
@Arg("deviceKeyType") deviceKeyType: string
|
|
182
|
-
): EntanglementProof {
|
|
183
|
-
return new EntanglementProof(
|
|
184
|
-
"did:key:hash",
|
|
185
|
-
"did-key-id",
|
|
186
|
-
deviceKeyType,
|
|
187
|
-
deviceKey,
|
|
188
|
-
"sig"
|
|
189
|
-
);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
@Mutation((returns) => String)
|
|
193
|
-
agentRequestCapability(@Arg("authInfo") authInfo: AuthInfoInput): String {
|
|
194
|
-
return "test-request-id";
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
@Mutation((returns) => String)
|
|
198
|
-
agentPermitCapability(@Arg("auth") auth: string): String {
|
|
199
|
-
return "123";
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
@Mutation((returns) => String)
|
|
203
|
-
agentGenerateJwt(
|
|
204
|
-
@Arg("requestId") requestId: string,
|
|
205
|
-
@Arg("rand") rand: string
|
|
206
|
-
): String {
|
|
207
|
-
return "test-jwt";
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
@Query((returns) => Boolean)
|
|
211
|
-
agentIsLocked(): Boolean {
|
|
212
|
-
return false;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
@Query((returns) => [Apps])
|
|
216
|
-
agentGetApps(): [] {
|
|
217
|
-
return [];
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
@Subscription((returns) => [Apps], { topics: APPS_CHANGED, nullable: true })
|
|
222
|
-
agentAppsChanged(): null {
|
|
223
|
-
return null;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
@Mutation((returns) => [Apps])
|
|
228
|
-
agentRemoveApp(@Arg("requestId") requestId: string, @PubSub() pubSub: any): [] {
|
|
229
|
-
pubSub.publish(APPS_CHANGED, { });
|
|
230
|
-
return [];
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
@Mutation((returns) => [Apps])
|
|
234
|
-
agentRevokeToken(@Arg("requestId") requestId: string): any[] {
|
|
235
|
-
return [
|
|
236
|
-
{
|
|
237
|
-
revoked: true,
|
|
238
|
-
requestId: "test-request-id",
|
|
239
|
-
auth: {
|
|
240
|
-
appName: "test-app",
|
|
241
|
-
appDesc: "-",
|
|
242
|
-
appUrl: "-",
|
|
243
|
-
appIconPath: "_",
|
|
244
|
-
capabilities: [
|
|
245
|
-
{
|
|
246
|
-
with: {
|
|
247
|
-
domain: "*",
|
|
248
|
-
pointers: ["*"],
|
|
249
|
-
},
|
|
250
|
-
can: ["*"],
|
|
251
|
-
},
|
|
252
|
-
],
|
|
253
|
-
},
|
|
254
|
-
token: "test-token",
|
|
255
|
-
},
|
|
256
|
-
];
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
@Mutation((returns) => AgentSignature)
|
|
260
|
-
agentSignMessage(@Arg("message") message: string): AgentSignature {
|
|
261
|
-
return new AgentSignature("test-message-signature", "test-public-key");
|
|
262
|
-
}
|
|
263
|
-
}
|