@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
package/lib/src/Ad4mClient.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ApolloClient } from '@apollo/client/core';
|
|
2
1
|
import { AgentClient } from './agent/AgentClient';
|
|
3
2
|
import { LanguageClient } from './language/LanguageClient';
|
|
4
3
|
import { NeighbourhoodClient } from './neighbourhood/NeighbourhoodClient';
|
|
@@ -7,7 +6,7 @@ import { RuntimeClient } from './runtime/RuntimeClient';
|
|
|
7
6
|
import { ExpressionClient } from './expression/ExpressionClient';
|
|
8
7
|
import { AIClient } from './ai/AIClient';
|
|
9
8
|
/**
|
|
10
|
-
* Client for the Ad4m interface wrapping
|
|
9
|
+
* Client for the Ad4m interface wrapping WebSocket RPC calls
|
|
11
10
|
* for convenient use in user facing code.
|
|
12
11
|
*
|
|
13
12
|
* Aggregates the six sub-clients:
|
|
@@ -17,7 +16,7 @@ import { AIClient } from './ai/AIClient';
|
|
|
17
16
|
*/
|
|
18
17
|
export declare class Ad4mClient {
|
|
19
18
|
#private;
|
|
20
|
-
constructor(
|
|
19
|
+
constructor(baseUrl: string, token?: string, subscribe?: boolean);
|
|
21
20
|
get agent(): AgentClient;
|
|
22
21
|
get expression(): ExpressionClient;
|
|
23
22
|
get languages(): LanguageClient;
|
|
@@ -25,4 +24,9 @@ export declare class Ad4mClient {
|
|
|
25
24
|
get perspective(): PerspectiveClient;
|
|
26
25
|
get runtime(): RuntimeClient;
|
|
27
26
|
get ai(): AIClient;
|
|
27
|
+
/** Start event subscriptions (agent-updated, agent-status-changed, apps-changed).
|
|
28
|
+
* Safe to call if subscriptions were deferred at construction (subscribe=false). */
|
|
29
|
+
startSubscriptions(): void;
|
|
30
|
+
/** Close all event connections */
|
|
31
|
+
close(): void;
|
|
28
32
|
}
|
package/lib/src/Ad4mClient.js
CHANGED
|
@@ -9,7 +9,7 @@ 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
|
|
12
|
+
var _Ad4mClient_baseUrl, _Ad4mClient_token, _Ad4mClient_apiClient, _Ad4mClient_agentClient, _Ad4mClient_expressionClient, _Ad4mClient_languageClient, _Ad4mClient_neighbourhoodClient, _Ad4mClient_perspectiveClient, _Ad4mClient_runtimeClient, _Ad4mClient_aiClient;
|
|
13
13
|
import { AgentClient } from './agent/AgentClient';
|
|
14
14
|
import { LanguageClient } from './language/LanguageClient';
|
|
15
15
|
import { NeighbourhoodClient } from './neighbourhood/NeighbourhoodClient';
|
|
@@ -17,8 +17,10 @@ import { PerspectiveClient } from './perspectives/PerspectiveClient';
|
|
|
17
17
|
import { RuntimeClient } from './runtime/RuntimeClient';
|
|
18
18
|
import { ExpressionClient } from './expression/ExpressionClient';
|
|
19
19
|
import { AIClient } from './ai/AIClient';
|
|
20
|
+
import { ApiClient } from './apiClient';
|
|
21
|
+
import { Ad4mModel } from './model/Ad4mModel';
|
|
20
22
|
/**
|
|
21
|
-
* Client for the Ad4m interface wrapping
|
|
23
|
+
* Client for the Ad4m interface wrapping WebSocket RPC calls
|
|
22
24
|
* for convenient use in user facing code.
|
|
23
25
|
*
|
|
24
26
|
* Aggregates the six sub-clients:
|
|
@@ -27,8 +29,10 @@ import { AIClient } from './ai/AIClient';
|
|
|
27
29
|
* for the respective functionality.
|
|
28
30
|
*/
|
|
29
31
|
export class Ad4mClient {
|
|
30
|
-
constructor(
|
|
31
|
-
|
|
32
|
+
constructor(baseUrl, token, subscribe = true) {
|
|
33
|
+
_Ad4mClient_baseUrl.set(this, void 0);
|
|
34
|
+
_Ad4mClient_token.set(this, void 0);
|
|
35
|
+
_Ad4mClient_apiClient.set(this, void 0);
|
|
32
36
|
_Ad4mClient_agentClient.set(this, void 0);
|
|
33
37
|
_Ad4mClient_expressionClient.set(this, void 0);
|
|
34
38
|
_Ad4mClient_languageClient.set(this, void 0);
|
|
@@ -36,17 +40,28 @@ export class Ad4mClient {
|
|
|
36
40
|
_Ad4mClient_perspectiveClient.set(this, void 0);
|
|
37
41
|
_Ad4mClient_runtimeClient.set(this, void 0);
|
|
38
42
|
_Ad4mClient_aiClient.set(this, void 0);
|
|
39
|
-
__classPrivateFieldSet(this,
|
|
40
|
-
__classPrivateFieldSet(this,
|
|
41
|
-
__classPrivateFieldSet(this,
|
|
42
|
-
__classPrivateFieldSet(this,
|
|
43
|
-
__classPrivateFieldSet(this,
|
|
44
|
-
__classPrivateFieldSet(this,
|
|
45
|
-
__classPrivateFieldSet(this,
|
|
43
|
+
__classPrivateFieldSet(this, _Ad4mClient_baseUrl, baseUrl, "f");
|
|
44
|
+
__classPrivateFieldSet(this, _Ad4mClient_token, token, "f");
|
|
45
|
+
__classPrivateFieldSet(this, _Ad4mClient_apiClient, new ApiClient(baseUrl, token), "f");
|
|
46
|
+
__classPrivateFieldSet(this, _Ad4mClient_agentClient, new AgentClient(baseUrl, token, subscribe, __classPrivateFieldGet(this, _Ad4mClient_apiClient, "f")), "f");
|
|
47
|
+
__classPrivateFieldSet(this, _Ad4mClient_expressionClient, new ExpressionClient(baseUrl, token, __classPrivateFieldGet(this, _Ad4mClient_apiClient, "f")), "f");
|
|
48
|
+
__classPrivateFieldSet(this, _Ad4mClient_languageClient, new LanguageClient(baseUrl, token, __classPrivateFieldGet(this, _Ad4mClient_apiClient, "f")), "f");
|
|
49
|
+
__classPrivateFieldSet(this, _Ad4mClient_neighbourhoodClient, new NeighbourhoodClient(baseUrl, token, __classPrivateFieldGet(this, _Ad4mClient_apiClient, "f")), "f");
|
|
50
|
+
__classPrivateFieldSet(this, _Ad4mClient_aiClient, new AIClient(baseUrl, token, subscribe, __classPrivateFieldGet(this, _Ad4mClient_apiClient, "f")), "f");
|
|
51
|
+
__classPrivateFieldSet(this, _Ad4mClient_perspectiveClient, new PerspectiveClient(baseUrl, token, subscribe, __classPrivateFieldGet(this, _Ad4mClient_apiClient, "f")), "f");
|
|
46
52
|
__classPrivateFieldGet(this, _Ad4mClient_perspectiveClient, "f").setExpressionClient(__classPrivateFieldGet(this, _Ad4mClient_expressionClient, "f"));
|
|
47
53
|
__classPrivateFieldGet(this, _Ad4mClient_perspectiveClient, "f").setNeighbourhoodClient(__classPrivateFieldGet(this, _Ad4mClient_neighbourhoodClient, "f"));
|
|
48
54
|
__classPrivateFieldGet(this, _Ad4mClient_perspectiveClient, "f").setAIClient(__classPrivateFieldGet(this, _Ad4mClient_aiClient, "f"));
|
|
49
|
-
__classPrivateFieldSet(this, _Ad4mClient_runtimeClient, new RuntimeClient(__classPrivateFieldGet(this,
|
|
55
|
+
__classPrivateFieldSet(this, _Ad4mClient_runtimeClient, new RuntimeClient(baseUrl, token, subscribe, __classPrivateFieldGet(this, _Ad4mClient_apiClient, "f")), "f");
|
|
56
|
+
// Register with AD4M DevTools if the bridge is installed (e.g. browser extension)
|
|
57
|
+
try {
|
|
58
|
+
const dt = globalThis.__AD4M_DEVTOOLS__;
|
|
59
|
+
if (dt) {
|
|
60
|
+
dt._client = this;
|
|
61
|
+
dt._Ad4mModel = Ad4mModel;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
catch { }
|
|
50
65
|
}
|
|
51
66
|
get agent() {
|
|
52
67
|
return __classPrivateFieldGet(this, _Ad4mClient_agentClient, "f");
|
|
@@ -69,5 +84,16 @@ export class Ad4mClient {
|
|
|
69
84
|
get ai() {
|
|
70
85
|
return __classPrivateFieldGet(this, _Ad4mClient_aiClient, "f");
|
|
71
86
|
}
|
|
87
|
+
/** Start event subscriptions (agent-updated, agent-status-changed, apps-changed).
|
|
88
|
+
* Safe to call if subscriptions were deferred at construction (subscribe=false). */
|
|
89
|
+
startSubscriptions() {
|
|
90
|
+
__classPrivateFieldGet(this, _Ad4mClient_agentClient, "f").subscribeAgentUpdated();
|
|
91
|
+
__classPrivateFieldGet(this, _Ad4mClient_agentClient, "f").subscribeAgentStatusChanged();
|
|
92
|
+
__classPrivateFieldGet(this, _Ad4mClient_agentClient, "f").subscribeAppsChanged();
|
|
93
|
+
}
|
|
94
|
+
/** Close all event connections */
|
|
95
|
+
close() {
|
|
96
|
+
__classPrivateFieldGet(this, _Ad4mClient_apiClient, "f").closeAll();
|
|
97
|
+
}
|
|
72
98
|
}
|
|
73
|
-
|
|
99
|
+
_Ad4mClient_baseUrl = new WeakMap(), _Ad4mClient_token = new WeakMap(), _Ad4mClient_apiClient = new WeakMap(), _Ad4mClient_agentClient = new WeakMap(), _Ad4mClient_expressionClient = new WeakMap(), _Ad4mClient_languageClient = new WeakMap(), _Ad4mClient_neighbourhoodClient = new WeakMap(), _Ad4mClient_perspectiveClient = new WeakMap(), _Ad4mClient_runtimeClient = new WeakMap(), _Ad4mClient_aiClient = new WeakMap();
|
package/lib/src/agent/Agent.js
CHANGED
|
@@ -1,13 +1,3 @@
|
|
|
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, InputType } from "type-graphql";
|
|
11
1
|
import { Perspective } from "../perspectives/Perspective";
|
|
12
2
|
import { ExpressionGeneric } from "../expression/Expression";
|
|
13
3
|
/** AD4M's representation of an Agent
|
|
@@ -26,7 +16,7 @@ import { ExpressionGeneric } from "../expression/Expression";
|
|
|
26
16
|
* DIDs are resolved to Expressions that are objects of this class.
|
|
27
17
|
* Thus, this is how agents see (other) agents.
|
|
28
18
|
*/
|
|
29
|
-
|
|
19
|
+
export class Agent {
|
|
30
20
|
constructor(did, perspective) {
|
|
31
21
|
this.did = did;
|
|
32
22
|
if (perspective) {
|
|
@@ -36,31 +26,10 @@ let Agent = class Agent {
|
|
|
36
26
|
this.perspective = new Perspective();
|
|
37
27
|
}
|
|
38
28
|
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
], Agent.prototype, "did", void 0);
|
|
44
|
-
__decorate([
|
|
45
|
-
Field((type) => Perspective, { nullable: true }),
|
|
46
|
-
__metadata("design:type", Perspective)
|
|
47
|
-
], Agent.prototype, "perspective", void 0);
|
|
48
|
-
__decorate([
|
|
49
|
-
Field({ nullable: true }),
|
|
50
|
-
__metadata("design:type", String)
|
|
51
|
-
], Agent.prototype, "directMessageLanguage", void 0);
|
|
52
|
-
Agent = __decorate([
|
|
53
|
-
ObjectType(),
|
|
54
|
-
__metadata("design:paramtypes", [String, Perspective])
|
|
55
|
-
], Agent);
|
|
56
|
-
export { Agent };
|
|
57
|
-
let AgentExpression = class AgentExpression extends ExpressionGeneric(Agent) {
|
|
58
|
-
};
|
|
59
|
-
AgentExpression = __decorate([
|
|
60
|
-
ObjectType()
|
|
61
|
-
], AgentExpression);
|
|
62
|
-
export { AgentExpression };
|
|
63
|
-
let EntanglementProof = class EntanglementProof {
|
|
29
|
+
}
|
|
30
|
+
export class AgentExpression extends ExpressionGeneric(Agent) {
|
|
31
|
+
}
|
|
32
|
+
export class EntanglementProof {
|
|
64
33
|
constructor(did, didSigningKeyId, deviceKeyType, deviceKey, deviceKeySignedByDid, didSignedByDeviceKey) {
|
|
65
34
|
this.did = did;
|
|
66
35
|
this.didSigningKeyId = didSigningKeyId;
|
|
@@ -69,37 +38,8 @@ let EntanglementProof = class EntanglementProof {
|
|
|
69
38
|
this.deviceKeySignedByDid = deviceKeySignedByDid;
|
|
70
39
|
this.didSignedByDeviceKey = didSignedByDeviceKey;
|
|
71
40
|
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
Field(),
|
|
75
|
-
__metadata("design:type", String)
|
|
76
|
-
], EntanglementProof.prototype, "did", void 0);
|
|
77
|
-
__decorate([
|
|
78
|
-
Field(),
|
|
79
|
-
__metadata("design:type", String)
|
|
80
|
-
], EntanglementProof.prototype, "didSigningKeyId", void 0);
|
|
81
|
-
__decorate([
|
|
82
|
-
Field(),
|
|
83
|
-
__metadata("design:type", String)
|
|
84
|
-
], EntanglementProof.prototype, "deviceKeyType", void 0);
|
|
85
|
-
__decorate([
|
|
86
|
-
Field(),
|
|
87
|
-
__metadata("design:type", String)
|
|
88
|
-
], EntanglementProof.prototype, "deviceKey", void 0);
|
|
89
|
-
__decorate([
|
|
90
|
-
Field(),
|
|
91
|
-
__metadata("design:type", String)
|
|
92
|
-
], EntanglementProof.prototype, "deviceKeySignedByDid", void 0);
|
|
93
|
-
__decorate([
|
|
94
|
-
Field({ nullable: true }),
|
|
95
|
-
__metadata("design:type", String)
|
|
96
|
-
], EntanglementProof.prototype, "didSignedByDeviceKey", void 0);
|
|
97
|
-
EntanglementProof = __decorate([
|
|
98
|
-
ObjectType(),
|
|
99
|
-
__metadata("design:paramtypes", [String, String, String, String, String, String])
|
|
100
|
-
], EntanglementProof);
|
|
101
|
-
export { EntanglementProof };
|
|
102
|
-
let EntanglementProofInput = class EntanglementProofInput {
|
|
41
|
+
}
|
|
42
|
+
export class EntanglementProofInput {
|
|
103
43
|
constructor(did, didSigningKeyId, deviceKeyType, deviceKey, deviceKeySignedByDid, didSignedByDeviceKey) {
|
|
104
44
|
this.did = did;
|
|
105
45
|
this.didSigningKeyId = didSigningKeyId;
|
|
@@ -108,94 +48,26 @@ let EntanglementProofInput = class EntanglementProofInput {
|
|
|
108
48
|
this.deviceKeySignedByDid = deviceKeySignedByDid;
|
|
109
49
|
this.didSignedByDeviceKey = didSignedByDeviceKey;
|
|
110
50
|
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
Field(),
|
|
114
|
-
__metadata("design:type", String)
|
|
115
|
-
], EntanglementProofInput.prototype, "did", void 0);
|
|
116
|
-
__decorate([
|
|
117
|
-
Field(),
|
|
118
|
-
__metadata("design:type", String)
|
|
119
|
-
], EntanglementProofInput.prototype, "didSigningKeyId", void 0);
|
|
120
|
-
__decorate([
|
|
121
|
-
Field(),
|
|
122
|
-
__metadata("design:type", String)
|
|
123
|
-
], EntanglementProofInput.prototype, "deviceKeyType", void 0);
|
|
124
|
-
__decorate([
|
|
125
|
-
Field(),
|
|
126
|
-
__metadata("design:type", String)
|
|
127
|
-
], EntanglementProofInput.prototype, "deviceKey", void 0);
|
|
128
|
-
__decorate([
|
|
129
|
-
Field(),
|
|
130
|
-
__metadata("design:type", String)
|
|
131
|
-
], EntanglementProofInput.prototype, "deviceKeySignedByDid", void 0);
|
|
132
|
-
__decorate([
|
|
133
|
-
Field(),
|
|
134
|
-
__metadata("design:type", String)
|
|
135
|
-
], EntanglementProofInput.prototype, "didSignedByDeviceKey", void 0);
|
|
136
|
-
EntanglementProofInput = __decorate([
|
|
137
|
-
InputType(),
|
|
138
|
-
__metadata("design:paramtypes", [String, String, String, String, String, String])
|
|
139
|
-
], EntanglementProofInput);
|
|
140
|
-
export { EntanglementProofInput };
|
|
141
|
-
let AgentSignature = class AgentSignature {
|
|
51
|
+
}
|
|
52
|
+
export class AgentSignature {
|
|
142
53
|
constructor(signature, publicKey) {
|
|
143
54
|
this.signature = signature;
|
|
144
55
|
this.publicKey = publicKey;
|
|
145
56
|
}
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
Field(),
|
|
149
|
-
__metadata("design:type", String)
|
|
150
|
-
], AgentSignature.prototype, "signature", void 0);
|
|
151
|
-
__decorate([
|
|
152
|
-
Field(),
|
|
153
|
-
__metadata("design:type", String)
|
|
154
|
-
], AgentSignature.prototype, "publicKey", void 0);
|
|
155
|
-
AgentSignature = __decorate([
|
|
156
|
-
ObjectType(),
|
|
157
|
-
__metadata("design:paramtypes", [String, String])
|
|
158
|
-
], AgentSignature);
|
|
159
|
-
export { AgentSignature };
|
|
160
|
-
let Resource = class Resource {
|
|
57
|
+
}
|
|
58
|
+
export class Resource {
|
|
161
59
|
constructor(domain, pointers) {
|
|
162
60
|
this.domain = domain;
|
|
163
61
|
this.pointers = pointers;
|
|
164
62
|
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
Field(),
|
|
168
|
-
__metadata("design:type", String)
|
|
169
|
-
], Resource.prototype, "domain", void 0);
|
|
170
|
-
__decorate([
|
|
171
|
-
Field((type) => [String]),
|
|
172
|
-
__metadata("design:type", Array)
|
|
173
|
-
], Resource.prototype, "pointers", void 0);
|
|
174
|
-
Resource = __decorate([
|
|
175
|
-
ObjectType(),
|
|
176
|
-
__metadata("design:paramtypes", [String, Array])
|
|
177
|
-
], Resource);
|
|
178
|
-
export { Resource };
|
|
179
|
-
let Capability = class Capability {
|
|
63
|
+
}
|
|
64
|
+
export class Capability {
|
|
180
65
|
constructor(withF, can) {
|
|
181
66
|
this.with = withF;
|
|
182
67
|
this.can = can;
|
|
183
68
|
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
Field((type) => Resource),
|
|
187
|
-
__metadata("design:type", Resource)
|
|
188
|
-
], Capability.prototype, "with", void 0);
|
|
189
|
-
__decorate([
|
|
190
|
-
Field((type) => [String]),
|
|
191
|
-
__metadata("design:type", Array)
|
|
192
|
-
], Capability.prototype, "can", void 0);
|
|
193
|
-
Capability = __decorate([
|
|
194
|
-
ObjectType(),
|
|
195
|
-
__metadata("design:paramtypes", [Resource, Array])
|
|
196
|
-
], Capability);
|
|
197
|
-
export { Capability };
|
|
198
|
-
let AuthInfo = class AuthInfo {
|
|
69
|
+
}
|
|
70
|
+
export class AuthInfo {
|
|
199
71
|
constructor(appName, appDesc, appUrl, capabilities, appIconPath) {
|
|
200
72
|
this.appName = appName;
|
|
201
73
|
this.appDesc = appDesc;
|
|
@@ -203,100 +75,28 @@ let AuthInfo = class AuthInfo {
|
|
|
203
75
|
this.appUrl = appUrl;
|
|
204
76
|
this.capabilities = capabilities;
|
|
205
77
|
}
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
Field(),
|
|
209
|
-
__metadata("design:type", String)
|
|
210
|
-
], AuthInfo.prototype, "appName", void 0);
|
|
211
|
-
__decorate([
|
|
212
|
-
Field(),
|
|
213
|
-
__metadata("design:type", String)
|
|
214
|
-
], AuthInfo.prototype, "appDesc", void 0);
|
|
215
|
-
__decorate([
|
|
216
|
-
Field(),
|
|
217
|
-
__metadata("design:type", String)
|
|
218
|
-
], AuthInfo.prototype, "appUrl", void 0);
|
|
219
|
-
__decorate([
|
|
220
|
-
Field({ nullable: true }),
|
|
221
|
-
__metadata("design:type", String)
|
|
222
|
-
], AuthInfo.prototype, "appIconPath", void 0);
|
|
223
|
-
__decorate([
|
|
224
|
-
Field((type) => [Capability]),
|
|
225
|
-
__metadata("design:type", Array)
|
|
226
|
-
], AuthInfo.prototype, "capabilities", void 0);
|
|
227
|
-
AuthInfo = __decorate([
|
|
228
|
-
ObjectType(),
|
|
229
|
-
__metadata("design:paramtypes", [String, String, String, Array, String])
|
|
230
|
-
], AuthInfo);
|
|
231
|
-
export { AuthInfo };
|
|
232
|
-
let Apps = class Apps {
|
|
78
|
+
}
|
|
79
|
+
export class Apps {
|
|
233
80
|
constructor(requestId, auth, token, revoked) {
|
|
234
81
|
this.requestId = requestId;
|
|
235
82
|
this.auth = auth;
|
|
236
83
|
this.token = token;
|
|
237
84
|
this.revoked = revoked;
|
|
238
85
|
}
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
Field(),
|
|
242
|
-
__metadata("design:type", String)
|
|
243
|
-
], Apps.prototype, "requestId", void 0);
|
|
244
|
-
__decorate([
|
|
245
|
-
Field(),
|
|
246
|
-
__metadata("design:type", String)
|
|
247
|
-
], Apps.prototype, "token", void 0);
|
|
248
|
-
__decorate([
|
|
249
|
-
Field({ nullable: true }),
|
|
250
|
-
__metadata("design:type", Boolean)
|
|
251
|
-
], Apps.prototype, "revoked", void 0);
|
|
252
|
-
__decorate([
|
|
253
|
-
Field(),
|
|
254
|
-
__metadata("design:type", AuthInfo)
|
|
255
|
-
], Apps.prototype, "auth", void 0);
|
|
256
|
-
Apps = __decorate([
|
|
257
|
-
ObjectType(),
|
|
258
|
-
__metadata("design:paramtypes", [String, AuthInfo, String, Boolean])
|
|
259
|
-
], Apps);
|
|
260
|
-
export { Apps };
|
|
261
|
-
let ResourceInput = class ResourceInput {
|
|
86
|
+
}
|
|
87
|
+
export class ResourceInput {
|
|
262
88
|
constructor(domain, pointers) {
|
|
263
89
|
this.domain = domain;
|
|
264
90
|
this.pointers = pointers;
|
|
265
91
|
}
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
Field(),
|
|
269
|
-
__metadata("design:type", String)
|
|
270
|
-
], ResourceInput.prototype, "domain", void 0);
|
|
271
|
-
__decorate([
|
|
272
|
-
Field((type) => [String]),
|
|
273
|
-
__metadata("design:type", Array)
|
|
274
|
-
], ResourceInput.prototype, "pointers", void 0);
|
|
275
|
-
ResourceInput = __decorate([
|
|
276
|
-
InputType(),
|
|
277
|
-
__metadata("design:paramtypes", [String, Array])
|
|
278
|
-
], ResourceInput);
|
|
279
|
-
export { ResourceInput };
|
|
280
|
-
let CapabilityInput = class CapabilityInput {
|
|
92
|
+
}
|
|
93
|
+
export class CapabilityInput {
|
|
281
94
|
constructor(withF, can) {
|
|
282
95
|
this.with = withF;
|
|
283
96
|
this.can = can;
|
|
284
97
|
}
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
Field((type) => ResourceInput),
|
|
288
|
-
__metadata("design:type", ResourceInput)
|
|
289
|
-
], CapabilityInput.prototype, "with", void 0);
|
|
290
|
-
__decorate([
|
|
291
|
-
Field((type) => [String]),
|
|
292
|
-
__metadata("design:type", Array)
|
|
293
|
-
], CapabilityInput.prototype, "can", void 0);
|
|
294
|
-
CapabilityInput = __decorate([
|
|
295
|
-
InputType(),
|
|
296
|
-
__metadata("design:paramtypes", [ResourceInput, Array])
|
|
297
|
-
], CapabilityInput);
|
|
298
|
-
export { CapabilityInput };
|
|
299
|
-
let AuthInfoInput = class AuthInfoInput {
|
|
98
|
+
}
|
|
99
|
+
export class AuthInfoInput {
|
|
300
100
|
constructor(appName, appDesc, appDomain, appUrl, appIconPath, capabilities) {
|
|
301
101
|
this.appName = appName;
|
|
302
102
|
this.appDesc = appDesc;
|
|
@@ -305,57 +105,11 @@ let AuthInfoInput = class AuthInfoInput {
|
|
|
305
105
|
this.capabilities = capabilities;
|
|
306
106
|
this.appIconPath = appIconPath;
|
|
307
107
|
}
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
Field(),
|
|
311
|
-
__metadata("design:type", String)
|
|
312
|
-
], AuthInfoInput.prototype, "appName", void 0);
|
|
313
|
-
__decorate([
|
|
314
|
-
Field(),
|
|
315
|
-
__metadata("design:type", String)
|
|
316
|
-
], AuthInfoInput.prototype, "appDesc", void 0);
|
|
317
|
-
__decorate([
|
|
318
|
-
Field(),
|
|
319
|
-
__metadata("design:type", String)
|
|
320
|
-
], AuthInfoInput.prototype, "appDomain", void 0);
|
|
321
|
-
__decorate([
|
|
322
|
-
Field({ nullable: true }),
|
|
323
|
-
__metadata("design:type", String)
|
|
324
|
-
], AuthInfoInput.prototype, "appUrl", void 0);
|
|
325
|
-
__decorate([
|
|
326
|
-
Field({ nullable: true }),
|
|
327
|
-
__metadata("design:type", String)
|
|
328
|
-
], AuthInfoInput.prototype, "appIconPath", void 0);
|
|
329
|
-
__decorate([
|
|
330
|
-
Field((type) => [CapabilityInput], { nullable: true }),
|
|
331
|
-
__metadata("design:type", Array)
|
|
332
|
-
], AuthInfoInput.prototype, "capabilities", void 0);
|
|
333
|
-
AuthInfoInput = __decorate([
|
|
334
|
-
InputType(),
|
|
335
|
-
__metadata("design:paramtypes", [String, String, String, String, String, Array])
|
|
336
|
-
], AuthInfoInput);
|
|
337
|
-
export { AuthInfoInput };
|
|
338
|
-
let UserCreationResult = class UserCreationResult {
|
|
108
|
+
}
|
|
109
|
+
export class UserCreationResult {
|
|
339
110
|
constructor(did, success, error) {
|
|
340
111
|
this.did = did;
|
|
341
112
|
this.success = success;
|
|
342
113
|
this.error = error;
|
|
343
114
|
}
|
|
344
|
-
}
|
|
345
|
-
__decorate([
|
|
346
|
-
Field(),
|
|
347
|
-
__metadata("design:type", String)
|
|
348
|
-
], UserCreationResult.prototype, "did", void 0);
|
|
349
|
-
__decorate([
|
|
350
|
-
Field(),
|
|
351
|
-
__metadata("design:type", Boolean)
|
|
352
|
-
], UserCreationResult.prototype, "success", void 0);
|
|
353
|
-
__decorate([
|
|
354
|
-
Field({ nullable: true }),
|
|
355
|
-
__metadata("design:type", String)
|
|
356
|
-
], UserCreationResult.prototype, "error", void 0);
|
|
357
|
-
UserCreationResult = __decorate([
|
|
358
|
-
ObjectType(),
|
|
359
|
-
__metadata("design:paramtypes", [String, Boolean, String])
|
|
360
|
-
], UserCreationResult);
|
|
361
|
-
export { UserCreationResult };
|
|
115
|
+
}
|
|
@@ -1,35 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ApiClient } from "../apiClient";
|
|
2
2
|
import { PerspectiveInput } from "../perspectives/Perspective";
|
|
3
3
|
import { Agent, Apps, AuthInfoInput, EntanglementProof, EntanglementProofInput, UserCreationResult } from "./Agent";
|
|
4
|
-
import { HostingUserInfo, PaymentRequestResult, ComputeLogEntry } from "../runtime/
|
|
4
|
+
import { HostingUserInfo, PaymentRequestResult, ComputeLogEntry } from "../runtime/RuntimeTypes";
|
|
5
5
|
import { AgentStatus } from "./AgentStatus";
|
|
6
6
|
import { LinkMutations } from "../links/Links";
|
|
7
|
-
import { VerificationRequestResult } from "../runtime/
|
|
7
|
+
import { VerificationRequestResult } from "../runtime/RuntimeTypes";
|
|
8
8
|
export interface InitializeArgs {
|
|
9
9
|
did: string;
|
|
10
10
|
didDocument: string;
|
|
11
11
|
keystore: string;
|
|
12
12
|
passphrase: string;
|
|
13
13
|
}
|
|
14
|
-
export type AgentUpdatedCallback = (agent: Agent) =>
|
|
15
|
-
export type AgentStatusChangedCallback = (agent: Agent) =>
|
|
16
|
-
export type AgentAppsUpdatedCallback = () =>
|
|
14
|
+
export type AgentUpdatedCallback = (agent: Agent) => void;
|
|
15
|
+
export type AgentStatusChangedCallback = (agent: Agent) => void;
|
|
16
|
+
export type AgentAppsUpdatedCallback = () => void;
|
|
17
17
|
export type HostingUserInfoChangedCallback = (info: HostingUserInfo) => void;
|
|
18
18
|
export type ComputeLogUpdatedCallback = (entry: ComputeLogEntry) => void;
|
|
19
|
-
/**
|
|
20
|
-
* Provides access to all functions regarding the local agent,
|
|
21
|
-
* such as generating, locking, unlocking, importing the DID keystore,
|
|
22
|
-
* as well as updating the publicly shared Agent expression.
|
|
23
|
-
*/
|
|
24
19
|
export declare class AgentClient {
|
|
25
20
|
#private;
|
|
26
|
-
constructor(
|
|
27
|
-
/**
|
|
28
|
-
* Returns the Agent expression of the local agent as it is shared
|
|
29
|
-
* publicly via the AgentLanguage.
|
|
30
|
-
*
|
|
31
|
-
* I.e. this is the users profile.
|
|
32
|
-
*/
|
|
21
|
+
constructor(baseUrl: string, token?: string, subscribe?: boolean, sharedApiClient?: ApiClient);
|
|
33
22
|
me(): Promise<Agent>;
|
|
34
23
|
status(): Promise<AgentStatus>;
|
|
35
24
|
generate(passphrase: string): Promise<AgentStatus>;
|
|
@@ -44,11 +33,11 @@ export declare class AgentClient {
|
|
|
44
33
|
deleteEntanglementProofs(proofs: EntanglementProofInput[]): Promise<EntanglementProof[]>;
|
|
45
34
|
getEntanglementProofs(): Promise<string[]>;
|
|
46
35
|
entanglementProofPreFlight(deviceKey: string, deviceKeyType: string): Promise<EntanglementProof>;
|
|
47
|
-
addUpdatedListener(listener:
|
|
48
|
-
addAppChangedListener(listener:
|
|
36
|
+
addUpdatedListener(listener: AgentUpdatedCallback): void;
|
|
37
|
+
addAppChangedListener(listener: AgentAppsUpdatedCallback): void;
|
|
49
38
|
subscribeAgentUpdated(): void;
|
|
50
39
|
subscribeAppsChanged(): void;
|
|
51
|
-
addAgentStatusChangedListener(listener:
|
|
40
|
+
addAgentStatusChangedListener(listener: AgentStatusChangedCallback): void;
|
|
52
41
|
subscribeAgentStatusChanged(): void;
|
|
53
42
|
addHostingUserInfoChangedListener(listener: HostingUserInfoChangedCallback): void;
|
|
54
43
|
subscribeHostingUserInfoChanged(): void;
|