@coasys/ad4m 0.12.0-rc1-dev.5 → 0.12.0
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/lib/index.cjs +4968 -4805
- package/lib/index.js +4936 -4801
- package/lib/src/agent/AgentClient.d.ts +4 -0
- package/lib/src/agent/AgentClient.js +34 -0
- package/lib/src/index.d.ts +2 -3
- package/lib/src/index.js +2 -3
- package/lib/src/model/Ad4mModel.d.ts +8 -812
- package/lib/src/model/Ad4mModel.js +78 -2390
- package/lib/src/model/ModelQueryBuilder.d.ts +370 -0
- package/lib/src/model/ModelQueryBuilder.js +556 -0
- package/lib/src/model/decorators.d.ts +2 -20
- package/lib/src/model/decorators.js +5 -410
- package/lib/src/model/hydration.d.ts +102 -0
- package/lib/src/model/hydration.js +709 -0
- package/lib/src/model/index.d.ts +20 -0
- package/lib/src/model/index.js +20 -0
- package/lib/src/model/{schema/fromJSONSchema.d.ts → json-schema.d.ts} +45 -12
- package/lib/src/model/json-schema.js +326 -0
- package/lib/src/model/prolog-facts.d.ts +37 -0
- package/lib/src/model/{prolog/generatePrologFacts.js → prolog-facts.js} +47 -52
- package/lib/src/model/query-common.d.ts +14 -0
- package/lib/src/model/query-common.js +36 -0
- package/lib/src/model/query-prolog.d.ts +15 -0
- package/lib/src/model/query-prolog.js +140 -0
- package/lib/src/model/query-surreal.d.ts +44 -0
- package/lib/src/model/query-surreal.js +249 -0
- package/lib/src/model/sdna.d.ts +14 -0
- package/lib/src/model/sdna.js +141 -0
- package/lib/src/model/shacl-gen.d.ts +31 -0
- package/lib/src/model/shacl-gen.js +246 -0
- package/lib/src/model/surreal-utils.d.ts +1 -1
- package/lib/src/model/types.d.ts +75 -96
- package/lib/src/model/types.js +4 -4
- package/lib/src/model/util.d.ts +4 -5
- package/lib/src/model/util.js +12 -32
- package/lib/src/perspectives/PerspectiveClient.d.ts +1 -1
- package/lib/src/perspectives/PerspectiveProxy.d.ts +1 -1
- package/lib/src/perspectives/WakerSubscriptionManager.d.ts +79 -0
- package/lib/src/perspectives/WakerSubscriptionManager.js +196 -0
- package/lib/src/runtime/RuntimeResolver.d.ts +14 -0
- package/lib/src/runtime/RuntimeResolver.js +73 -0
- package/lib/src/schema.gql +14 -0
- package/lib/src/typeDefs.js +14 -0
- package/package.json +13 -8
- package/src/agent/AgentClient.ts +45 -0
- package/src/index.ts +2 -3
- package/src/model/Ad4mModel.ts +1084 -3818
- package/src/model/ModelQueryBuilder.ts +617 -0
- package/src/model/Subject.ts +1 -1
- package/src/model/decorators.ts +17 -475
- package/src/model/hydration.ts +796 -0
- package/src/model/index.ts +21 -0
- package/src/model/json-schema.ts +424 -0
- package/src/model/prolog-facts.ts +145 -0
- package/src/model/query-common.ts +48 -0
- package/src/model/query-prolog.ts +148 -0
- package/src/model/query-surreal.ts +280 -0
- package/src/model/relation-filtering.test.ts +0 -1
- package/src/model/sdna.ts +170 -0
- package/src/model/shacl-gen.ts +292 -0
- package/src/model/surreal-utils.ts +1 -1
- package/src/model/types.ts +182 -0
- package/src/model/util.ts +13 -36
- package/src/perspectives/PerspectiveClient.ts +1 -1
- package/src/perspectives/PerspectiveProxy.ts +1 -1
- package/src/perspectives/WakerSubscriptionManager.ts +292 -0
- package/src/runtime/RuntimeResolver.ts +53 -0
- package/lib/src/Ad4mClient.test.d.ts +0 -1
- package/lib/src/Ad4mClient.test.js +0 -1204
- package/lib/src/Literal.test.d.ts +0 -1
- package/lib/src/Literal.test.js +0 -41
- package/lib/src/model/mutation.d.ts +0 -81
- package/lib/src/model/mutation.js +0 -317
- package/lib/src/model/parentUtils.d.ts +0 -32
- package/lib/src/model/parentUtils.js +0 -64
- package/lib/src/model/prolog/generatePrologFacts.d.ts +0 -36
- package/lib/src/model/prolog/index.d.ts +0 -1
- package/lib/src/model/prolog/index.js +0 -1
- package/lib/src/model/query/ModelQueryBuilder.d.ts +0 -82
- package/lib/src/model/query/ModelQueryBuilder.js +0 -115
- package/lib/src/model/query/QueryBuilder.d.ts +0 -101
- package/lib/src/model/query/QueryBuilder.js +0 -193
- package/lib/src/model/query/SurrealQueryBuilder.d.ts +0 -48
- package/lib/src/model/query/SurrealQueryBuilder.js +0 -371
- package/lib/src/model/query/fetchInstance.d.ts +0 -24
- package/lib/src/model/query/fetchInstance.js +0 -144
- package/lib/src/model/query/hydration.d.ts +0 -54
- package/lib/src/model/query/hydration.js +0 -214
- package/lib/src/model/query/operations.d.ts +0 -59
- package/lib/src/model/query/operations.js +0 -384
- package/lib/src/model/query/snapshot.d.ts +0 -59
- package/lib/src/model/query/snapshot.js +0 -106
- package/lib/src/model/query/surrealCompiler.d.ts +0 -42
- package/lib/src/model/query/surrealCompiler.js +0 -304
- package/lib/src/model/schema/fromJSONSchema.js +0 -264
- package/lib/src/model/schema/metadata.d.ts +0 -15
- package/lib/src/model/schema/metadata.js +0 -112
- package/lib/src/model/subscription.d.ts +0 -47
- package/lib/src/model/subscription.js +0 -231
- package/lib/src/model/transaction.d.ts +0 -27
- package/lib/src/model/transaction.js +0 -32
- package/lib/src/shims/reflect-metadata.d.ts +0 -0
- package/lib/src/shims/type-graphql.d.ts +0 -32
- package/lib/src/src/Ad4mClient.d.ts +0 -28
- package/lib/src/src/Address.d.ts +0 -1
- package/lib/src/src/DID.d.ts +0 -1
- package/lib/src/src/Exception.d.ts +0 -7
- package/lib/src/src/Literal.d.ts +0 -7
- package/lib/src/src/PubSub.d.ts +0 -17
- package/lib/src/src/SmartLiteral.d.ts +0 -12
- package/lib/src/src/agent/Agent.d.ts +0 -110
- package/lib/src/src/agent/AgentClient.d.ts +0 -62
- package/lib/src/src/agent/AgentResolver.d.ts +0 -30
- package/lib/src/src/agent/AgentStatus.d.ts +0 -8
- package/lib/src/src/ai/AIClient.d.ts +0 -32
- package/lib/src/src/ai/AIResolver.d.ts +0 -75
- package/lib/src/src/ai/Tasks.d.ts +0 -37
- package/lib/src/src/buildSchema.d.ts +0 -1
- package/lib/src/src/expression/Expression.d.ts +0 -28
- package/lib/src/src/expression/ExpressionClient.d.ts +0 -13
- package/lib/src/src/expression/ExpressionRef.d.ts +0 -9
- package/lib/src/src/expression/ExpressionResolver.d.ts +0 -10
- package/lib/src/src/index.d.ts +0 -35
- package/lib/src/src/jestSetup.d.ts +0 -1
- package/lib/src/src/language/Icon.d.ts +0 -4
- package/lib/src/src/language/Language.d.ts +0 -206
- package/lib/src/src/language/LanguageClient.d.ts +0 -17
- package/lib/src/src/language/LanguageContext.d.ts +0 -37
- package/lib/src/src/language/LanguageHandle.d.ts +0 -9
- package/lib/src/src/language/LanguageMeta.d.ts +0 -35
- package/lib/src/src/language/LanguageRef.d.ts +0 -6
- package/lib/src/src/language/LanguageResolver.d.ts +0 -19
- package/lib/src/src/links/Links.d.ts +0 -39
- package/lib/src/src/links/Links.test.d.ts +0 -1
- package/lib/src/src/model/Ad4mModel.d.ts +0 -1438
- package/lib/src/src/model/Ad4mModel.test.d.ts +0 -1
- package/lib/src/src/model/Subject.d.ts +0 -25
- package/lib/src/src/model/decorators.d.ts +0 -545
- package/lib/src/src/model/util.d.ts +0 -12
- package/lib/src/src/neighbourhood/Neighbourhood.d.ts +0 -10
- package/lib/src/src/neighbourhood/NeighbourhoodClient.d.ts +0 -25
- package/lib/src/src/neighbourhood/NeighbourhoodProxy.d.ts +0 -19
- package/lib/src/src/neighbourhood/NeighbourhoodProxy.test.d.ts +0 -1
- package/lib/src/src/neighbourhood/NeighbourhoodResolver.d.ts +0 -24
- package/lib/src/src/perspectives/LinkQuery.d.ts +0 -11
- package/lib/src/src/perspectives/Perspective.d.ts +0 -38
- package/lib/src/src/perspectives/Perspective.test.d.ts +0 -1
- package/lib/src/src/perspectives/PerspectiveClient.d.ts +0 -97
- package/lib/src/src/perspectives/PerspectiveDiff.d.ts +0 -9
- package/lib/src/src/perspectives/PerspectiveHandle.d.ts +0 -18
- package/lib/src/src/perspectives/PerspectiveProxy.d.ts +0 -865
- package/lib/src/src/perspectives/PerspectiveResolver.d.ts +0 -57
- package/lib/src/src/runtime/RuntimeClient.d.ts +0 -56
- package/lib/src/src/runtime/RuntimeResolver.d.ts +0 -132
- package/lib/src/src/shacl/SHACLFlow.d.ts +0 -171
- package/lib/src/src/shacl/SHACLFlow.test.d.ts +0 -1
- package/lib/src/src/shacl/SHACLShape.d.ts +0 -117
- package/lib/src/src/shacl/SHACLShape.test.d.ts +0 -1
- package/lib/src/src/typeDefs.d.ts +0 -1
- package/lib/src/src/unwrapApolloResult.d.ts +0 -2
- package/lib/src/src/utils.d.ts +0 -25
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ApolloClient } from "@apollo/client/core";
|
|
2
2
|
import { PerspectiveInput } from "../perspectives/Perspective";
|
|
3
3
|
import { Agent, Apps, AuthInfoInput, EntanglementProof, EntanglementProofInput, UserCreationResult } from "./Agent";
|
|
4
|
+
import { HostingUserInfo, PaymentRequestResult } from "../runtime/RuntimeResolver";
|
|
4
5
|
import { AgentStatus } from "./AgentStatus";
|
|
5
6
|
import { LinkMutations } from "../links/Links";
|
|
6
7
|
import { VerificationRequestResult } from "../runtime/RuntimeResolver";
|
|
@@ -59,4 +60,7 @@ export declare class AgentClient {
|
|
|
59
60
|
loginUser(email: string, password: string): Promise<string>;
|
|
60
61
|
requestLoginVerification(email: string, appInfo?: AuthInfoInput): Promise<VerificationRequestResult>;
|
|
61
62
|
verifyEmailCode(email: string, code: string, verificationType: string): Promise<string>;
|
|
63
|
+
hostingUserInfo(): Promise<HostingUserInfo>;
|
|
64
|
+
setHotWalletAddress(address: string): Promise<boolean>;
|
|
65
|
+
requestPayment(amountHOT: string): Promise<PaymentRequestResult>;
|
|
62
66
|
}
|
|
@@ -473,5 +473,39 @@ export class AgentClient {
|
|
|
473
473
|
}));
|
|
474
474
|
return runtimeVerifyEmailCode;
|
|
475
475
|
}
|
|
476
|
+
// Hosting methods
|
|
477
|
+
async hostingUserInfo() {
|
|
478
|
+
const { runtimeHostingUserInfo } = unwrapApolloResult(await __classPrivateFieldGet(this, _AgentClient_apolloClient, "f").query({
|
|
479
|
+
query: gql `query runtimeHostingUserInfo {
|
|
480
|
+
runtimeHostingUserInfo {
|
|
481
|
+
email
|
|
482
|
+
remainingCredits
|
|
483
|
+
hotWalletAddress
|
|
484
|
+
}
|
|
485
|
+
}`,
|
|
486
|
+
}));
|
|
487
|
+
return runtimeHostingUserInfo;
|
|
488
|
+
}
|
|
489
|
+
async setHotWalletAddress(address) {
|
|
490
|
+
const { runtimeSetHotWalletAddress } = unwrapApolloResult(await __classPrivateFieldGet(this, _AgentClient_apolloClient, "f").mutate({
|
|
491
|
+
mutation: gql `mutation runtimeSetHotWalletAddress($address: String!) {
|
|
492
|
+
runtimeSetHotWalletAddress(address: $address)
|
|
493
|
+
}`,
|
|
494
|
+
variables: { address },
|
|
495
|
+
}));
|
|
496
|
+
return runtimeSetHotWalletAddress;
|
|
497
|
+
}
|
|
498
|
+
async requestPayment(amountHOT) {
|
|
499
|
+
const { runtimeRequestPayment } = unwrapApolloResult(await __classPrivateFieldGet(this, _AgentClient_apolloClient, "f").mutate({
|
|
500
|
+
mutation: gql `mutation runtimeRequestPayment($amountHOT: String!) {
|
|
501
|
+
runtimeRequestPayment(amountHOT: $amountHOT) {
|
|
502
|
+
success
|
|
503
|
+
message
|
|
504
|
+
}
|
|
505
|
+
}`,
|
|
506
|
+
variables: { amountHOT },
|
|
507
|
+
}));
|
|
508
|
+
return runtimeRequestPayment;
|
|
509
|
+
}
|
|
476
510
|
}
|
|
477
511
|
_AgentClient_apolloClient = new WeakMap(), _AgentClient_appsChangedCallback = new WeakMap(), _AgentClient_updatedCallbacks = new WeakMap(), _AgentClient_agentStatusChangedCallbacks = new WeakMap();
|
package/lib/src/index.d.ts
CHANGED
|
@@ -16,11 +16,11 @@ export * from "./Literal";
|
|
|
16
16
|
export * from "./perspectives/Perspective";
|
|
17
17
|
export * from "./perspectives/PerspectiveHandle";
|
|
18
18
|
export * from "./perspectives/PerspectiveProxy";
|
|
19
|
+
export * from "./perspectives/WakerSubscriptionManager";
|
|
19
20
|
export * from "./perspectives/PerspectiveDiff";
|
|
20
21
|
export * from "./perspectives/LinkQuery";
|
|
21
22
|
export * from "./SmartLiteral";
|
|
22
|
-
export * from "./model
|
|
23
|
-
export * from "./model/Subject";
|
|
23
|
+
export * from "./model";
|
|
24
24
|
export * from "./neighbourhood/Neighbourhood";
|
|
25
25
|
export * from "./neighbourhood/NeighbourhoodProxy";
|
|
26
26
|
export * from "./typeDefs";
|
|
@@ -30,6 +30,5 @@ export * from "./agent/AgentClient";
|
|
|
30
30
|
export * from "./ai/AIClient";
|
|
31
31
|
export * from "./ai/Tasks";
|
|
32
32
|
export * from "./runtime/RuntimeResolver";
|
|
33
|
-
export * from './model/Ad4mModel';
|
|
34
33
|
export * from './shacl/SHACLShape';
|
|
35
34
|
export { SHACLFlow, FlowState, FlowTransition, LinkPattern, FlowableCondition } from './shacl/SHACLFlow';
|
package/lib/src/index.js
CHANGED
|
@@ -16,11 +16,11 @@ export * from "./Literal";
|
|
|
16
16
|
export * from "./perspectives/Perspective";
|
|
17
17
|
export * from "./perspectives/PerspectiveHandle";
|
|
18
18
|
export * from "./perspectives/PerspectiveProxy";
|
|
19
|
+
export * from "./perspectives/WakerSubscriptionManager";
|
|
19
20
|
export * from "./perspectives/PerspectiveDiff";
|
|
20
21
|
export * from "./perspectives/LinkQuery";
|
|
21
22
|
export * from "./SmartLiteral";
|
|
22
|
-
export * from "./model
|
|
23
|
-
export * from "./model/Subject";
|
|
23
|
+
export * from "./model";
|
|
24
24
|
export * from "./neighbourhood/Neighbourhood";
|
|
25
25
|
export * from "./neighbourhood/NeighbourhoodProxy";
|
|
26
26
|
export * from "./typeDefs";
|
|
@@ -30,6 +30,5 @@ export * from "./agent/AgentClient";
|
|
|
30
30
|
export * from "./ai/AIClient";
|
|
31
31
|
export * from "./ai/Tasks";
|
|
32
32
|
export * from "./runtime/RuntimeResolver";
|
|
33
|
-
export * from './model/Ad4mModel';
|
|
34
33
|
export * from './shacl/SHACLShape';
|
|
35
34
|
export { SHACLFlow } from './shacl/SHACLFlow';
|