@coasys/ad4m 0.12.0 → 0.13.0-test-1
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 +328 -6
- package/lib/index.js +328 -6
- package/lib/src/agent/AgentClient.d.ts +3 -0
- package/lib/src/agent/AgentClient.js +28 -2
- package/lib/src/runtime/RuntimeClient.d.ts +28 -0
- package/lib/src/runtime/RuntimeClient.js +143 -0
- package/lib/src/runtime/RuntimeResolver.d.ts +17 -1
- package/lib/src/runtime/RuntimeResolver.js +141 -4
- package/lib/src/schema.gql +16 -0
- package/lib/src/typeDefs.js +16 -0
- package/package.json +1 -1
- package/src/agent/AgentClient.ts +30 -0
- package/src/runtime/RuntimeClient.ts +159 -0
- package/src/runtime/RuntimeResolver.ts +92 -3
package/lib/index.js
CHANGED
|
@@ -9372,7 +9372,7 @@ var __classPrivateFieldGet$7 = (undefined && undefined.__classPrivateFieldGet) |
|
|
|
9372
9372
|
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");
|
|
9373
9373
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
9374
9374
|
};
|
|
9375
|
-
var _AgentClient_apolloClient, _AgentClient_appsChangedCallback, _AgentClient_updatedCallbacks, _AgentClient_agentStatusChangedCallbacks;
|
|
9375
|
+
var _AgentClient_apolloClient, _AgentClient_appsChangedCallback, _AgentClient_updatedCallbacks, _AgentClient_agentStatusChangedCallbacks, _AgentClient_hostingUserInfoChangedCallbacks;
|
|
9376
9376
|
const AGENT_SUBITEMS = `
|
|
9377
9377
|
did
|
|
9378
9378
|
directMessageLanguage
|
|
@@ -9435,10 +9435,12 @@ class AgentClient {
|
|
|
9435
9435
|
_AgentClient_appsChangedCallback.set(this, void 0);
|
|
9436
9436
|
_AgentClient_updatedCallbacks.set(this, void 0);
|
|
9437
9437
|
_AgentClient_agentStatusChangedCallbacks.set(this, void 0);
|
|
9438
|
+
_AgentClient_hostingUserInfoChangedCallbacks.set(this, void 0);
|
|
9438
9439
|
__classPrivateFieldSet$7(this, _AgentClient_apolloClient, client, "f");
|
|
9439
9440
|
__classPrivateFieldSet$7(this, _AgentClient_updatedCallbacks, [], "f");
|
|
9440
9441
|
__classPrivateFieldSet$7(this, _AgentClient_agentStatusChangedCallbacks, [], "f");
|
|
9441
9442
|
__classPrivateFieldSet$7(this, _AgentClient_appsChangedCallback, [], "f");
|
|
9443
|
+
__classPrivateFieldSet$7(this, _AgentClient_hostingUserInfoChangedCallbacks, [], "f");
|
|
9442
9444
|
if (subscribe) {
|
|
9443
9445
|
this.subscribeAgentUpdated();
|
|
9444
9446
|
this.subscribeAgentStatusChanged();
|
|
@@ -9699,6 +9701,29 @@ class AgentClient {
|
|
|
9699
9701
|
error: (e) => console.error(e),
|
|
9700
9702
|
});
|
|
9701
9703
|
}
|
|
9704
|
+
addHostingUserInfoChangedListener(listener) {
|
|
9705
|
+
__classPrivateFieldGet$7(this, _AgentClient_hostingUserInfoChangedCallbacks, "f").push(listener);
|
|
9706
|
+
}
|
|
9707
|
+
subscribeHostingUserInfoChanged() {
|
|
9708
|
+
__classPrivateFieldGet$7(this, _AgentClient_apolloClient, "f")
|
|
9709
|
+
.subscribe({
|
|
9710
|
+
query: gql `subscription {
|
|
9711
|
+
runtimeHostingUserInfoChanged {
|
|
9712
|
+
email
|
|
9713
|
+
remainingCredits
|
|
9714
|
+
hotWalletAddress
|
|
9715
|
+
freeAccess
|
|
9716
|
+
}
|
|
9717
|
+
}`,
|
|
9718
|
+
})
|
|
9719
|
+
.subscribe({
|
|
9720
|
+
next: (result) => {
|
|
9721
|
+
const info = result.data.runtimeHostingUserInfoChanged;
|
|
9722
|
+
__classPrivateFieldGet$7(this, _AgentClient_hostingUserInfoChangedCallbacks, "f").forEach((cb) => cb(info));
|
|
9723
|
+
},
|
|
9724
|
+
error: (e) => console.error(e),
|
|
9725
|
+
});
|
|
9726
|
+
}
|
|
9702
9727
|
async requestCapability(authInfo) {
|
|
9703
9728
|
const { agentRequestCapability } = unwrapApolloResult(await __classPrivateFieldGet$7(this, _AgentClient_apolloClient, "f").mutate({
|
|
9704
9729
|
mutation: gql `
|
|
@@ -9839,6 +9864,7 @@ class AgentClient {
|
|
|
9839
9864
|
email
|
|
9840
9865
|
remainingCredits
|
|
9841
9866
|
hotWalletAddress
|
|
9867
|
+
freeAccess
|
|
9842
9868
|
}
|
|
9843
9869
|
}`,
|
|
9844
9870
|
}));
|
|
@@ -9866,7 +9892,7 @@ class AgentClient {
|
|
|
9866
9892
|
return runtimeRequestPayment;
|
|
9867
9893
|
}
|
|
9868
9894
|
}
|
|
9869
|
-
_AgentClient_apolloClient = new WeakMap(), _AgentClient_appsChangedCallback = new WeakMap(), _AgentClient_updatedCallbacks = new WeakMap(), _AgentClient_agentStatusChangedCallbacks = new WeakMap();
|
|
9895
|
+
_AgentClient_apolloClient = new WeakMap(), _AgentClient_appsChangedCallback = new WeakMap(), _AgentClient_updatedCallbacks = new WeakMap(), _AgentClient_agentStatusChangedCallbacks = new WeakMap(), _AgentClient_hostingUserInfoChangedCallbacks = new WeakMap();
|
|
9870
9896
|
|
|
9871
9897
|
var __classPrivateFieldSet$6 = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
9872
9898
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
@@ -10355,6 +10381,14 @@ class RuntimeClient {
|
|
|
10355
10381
|
}));
|
|
10356
10382
|
return runtimeInfo;
|
|
10357
10383
|
}
|
|
10384
|
+
async tlsDomain() {
|
|
10385
|
+
const { runtimeTlsDomain } = unwrapApolloResult(await __classPrivateFieldGet$4(this, _RuntimeClient_apolloClient, "f").query({
|
|
10386
|
+
query: gql `query runtimeTlsDomain {
|
|
10387
|
+
runtimeTlsDomain
|
|
10388
|
+
}`,
|
|
10389
|
+
}));
|
|
10390
|
+
return runtimeTlsDomain;
|
|
10391
|
+
}
|
|
10358
10392
|
async quit() {
|
|
10359
10393
|
const result = unwrapApolloResult(await __classPrivateFieldGet$4(this, _RuntimeClient_apolloClient, "f").mutate({
|
|
10360
10394
|
mutation: gql `mutation runtimeQuit { runtimeQuit }`
|
|
@@ -10649,6 +10683,23 @@ class RuntimeClient {
|
|
|
10649
10683
|
}));
|
|
10650
10684
|
return runtimeSetMultiUserEnabled;
|
|
10651
10685
|
}
|
|
10686
|
+
async freeHostingEnabled() {
|
|
10687
|
+
const { runtimeFreeHostingEnabled } = unwrapApolloResult(await __classPrivateFieldGet$4(this, _RuntimeClient_apolloClient, "f").query({
|
|
10688
|
+
query: gql `query runtimeFreeHostingEnabled {
|
|
10689
|
+
runtimeFreeHostingEnabled
|
|
10690
|
+
}`
|
|
10691
|
+
}));
|
|
10692
|
+
return runtimeFreeHostingEnabled;
|
|
10693
|
+
}
|
|
10694
|
+
async setFreeHostingEnabled(enabled) {
|
|
10695
|
+
const { runtimeSetFreeHostingEnabled } = unwrapApolloResult(await __classPrivateFieldGet$4(this, _RuntimeClient_apolloClient, "f").mutate({
|
|
10696
|
+
mutation: gql `mutation runtimeSetFreeHostingEnabled($enabled: Boolean!) {
|
|
10697
|
+
runtimeSetFreeHostingEnabled(enabled: $enabled)
|
|
10698
|
+
}`,
|
|
10699
|
+
variables: { enabled }
|
|
10700
|
+
}));
|
|
10701
|
+
return runtimeSetFreeHostingEnabled;
|
|
10702
|
+
}
|
|
10652
10703
|
async listUsers() {
|
|
10653
10704
|
const { runtimeListUsers } = unwrapApolloResult(await __classPrivateFieldGet$4(this, _RuntimeClient_apolloClient, "f").query({
|
|
10654
10705
|
query: gql `query runtimeListUsers {
|
|
@@ -10657,11 +10708,23 @@ class RuntimeClient {
|
|
|
10657
10708
|
did
|
|
10658
10709
|
lastSeen
|
|
10659
10710
|
perspectiveCount
|
|
10711
|
+
remainingCredits
|
|
10712
|
+
freeAccess
|
|
10713
|
+
hotWalletAddress
|
|
10660
10714
|
}
|
|
10661
10715
|
}`
|
|
10662
10716
|
}));
|
|
10663
10717
|
return runtimeListUsers;
|
|
10664
10718
|
}
|
|
10719
|
+
async userWalletAddress(email) {
|
|
10720
|
+
const { runtimeUserWalletAddress } = unwrapApolloResult(await __classPrivateFieldGet$4(this, _RuntimeClient_apolloClient, "f").query({
|
|
10721
|
+
query: gql `query runtimeUserWalletAddress($email: String!) {
|
|
10722
|
+
runtimeUserWalletAddress(email: $email)
|
|
10723
|
+
}`,
|
|
10724
|
+
variables: { email }
|
|
10725
|
+
}));
|
|
10726
|
+
return runtimeUserWalletAddress;
|
|
10727
|
+
}
|
|
10665
10728
|
async emailTestModeEnable() {
|
|
10666
10729
|
const { runtimeEmailTestModeEnable } = unwrapApolloResult(await __classPrivateFieldGet$4(this, _RuntimeClient_apolloClient, "f").mutate({
|
|
10667
10730
|
mutation: gql `mutation runtimeEmailTestModeEnable {
|
|
@@ -10704,6 +10767,112 @@ class RuntimeClient {
|
|
|
10704
10767
|
}));
|
|
10705
10768
|
return runtimeEmailTestSetExpiry;
|
|
10706
10769
|
}
|
|
10770
|
+
// ---- Unyt / mHOT methods ----
|
|
10771
|
+
async unytAgentKey() {
|
|
10772
|
+
const { runtimeUnytAgentKey } = unwrapApolloResult(await __classPrivateFieldGet$4(this, _RuntimeClient_apolloClient, "f").query({
|
|
10773
|
+
query: gql `query runtimeUnytAgentKey { runtimeUnytAgentKey }`,
|
|
10774
|
+
fetchPolicy: "network-only",
|
|
10775
|
+
}));
|
|
10776
|
+
return runtimeUnytAgentKey;
|
|
10777
|
+
}
|
|
10778
|
+
async unytHotAgentPubkey() {
|
|
10779
|
+
const { runtimeHotAgentPubkey } = unwrapApolloResult(await __classPrivateFieldGet$4(this, _RuntimeClient_apolloClient, "f").query({
|
|
10780
|
+
query: gql `query runtimeHotAgentPubkey { runtimeHotAgentPubkey }`,
|
|
10781
|
+
fetchPolicy: "network-only",
|
|
10782
|
+
}));
|
|
10783
|
+
return runtimeHotAgentPubkey;
|
|
10784
|
+
}
|
|
10785
|
+
async unytWalletBalance() {
|
|
10786
|
+
const { runtimeHotWalletBalance } = unwrapApolloResult(await __classPrivateFieldGet$4(this, _RuntimeClient_apolloClient, "f").query({
|
|
10787
|
+
query: gql `query runtimeHotWalletBalance { runtimeHotWalletBalance }`,
|
|
10788
|
+
fetchPolicy: "network-only",
|
|
10789
|
+
}));
|
|
10790
|
+
return runtimeHotWalletBalance;
|
|
10791
|
+
}
|
|
10792
|
+
async unytWalletHistory(page, perPage) {
|
|
10793
|
+
const { runtimeHotWalletHistory } = unwrapApolloResult(await __classPrivateFieldGet$4(this, _RuntimeClient_apolloClient, "f").query({
|
|
10794
|
+
query: gql `query runtimeHotWalletHistory($page: Int, $perPage: Int) {
|
|
10795
|
+
runtimeHotWalletHistory(page: $page, perPage: $perPage)
|
|
10796
|
+
}`,
|
|
10797
|
+
variables: { page, perPage },
|
|
10798
|
+
fetchPolicy: "network-only",
|
|
10799
|
+
}));
|
|
10800
|
+
return runtimeHotWalletHistory;
|
|
10801
|
+
}
|
|
10802
|
+
async unytVersionInfo() {
|
|
10803
|
+
const { runtimeUnytVersionInfo } = unwrapApolloResult(await __classPrivateFieldGet$4(this, _RuntimeClient_apolloClient, "f").query({
|
|
10804
|
+
query: gql `query runtimeUnytVersionInfo { runtimeUnytVersionInfo }`,
|
|
10805
|
+
fetchPolicy: "network-only",
|
|
10806
|
+
}));
|
|
10807
|
+
return runtimeUnytVersionInfo;
|
|
10808
|
+
}
|
|
10809
|
+
async unytSetMembraneProof(proof) {
|
|
10810
|
+
const { runtimeSetUnytMembraneProof } = unwrapApolloResult(await __classPrivateFieldGet$4(this, _RuntimeClient_apolloClient, "f").mutate({
|
|
10811
|
+
mutation: gql `mutation runtimeSetUnytMembraneProof($proof: String!) {
|
|
10812
|
+
runtimeSetUnytMembraneProof(proof: $proof) { success message }
|
|
10813
|
+
}`,
|
|
10814
|
+
variables: { proof },
|
|
10815
|
+
}));
|
|
10816
|
+
return runtimeSetUnytMembraneProof;
|
|
10817
|
+
}
|
|
10818
|
+
async unytReinstallDna() {
|
|
10819
|
+
const { runtimeReinstallUnytDna } = unwrapApolloResult(await __classPrivateFieldGet$4(this, _RuntimeClient_apolloClient, "f").mutate({
|
|
10820
|
+
mutation: gql `mutation runtimeReinstallUnytDna {
|
|
10821
|
+
runtimeReinstallUnytDna { success message }
|
|
10822
|
+
}`,
|
|
10823
|
+
}));
|
|
10824
|
+
return runtimeReinstallUnytDna;
|
|
10825
|
+
}
|
|
10826
|
+
async unytSendHot(recipient, amount) {
|
|
10827
|
+
const { runtimeSendHot } = unwrapApolloResult(await __classPrivateFieldGet$4(this, _RuntimeClient_apolloClient, "f").mutate({
|
|
10828
|
+
mutation: gql `mutation runtimeSendHot($recipient: String!, $amount: String!) {
|
|
10829
|
+
runtimeSendHot(recipient: $recipient, amount: $amount) { success message }
|
|
10830
|
+
}`,
|
|
10831
|
+
variables: { recipient, amount },
|
|
10832
|
+
}));
|
|
10833
|
+
return runtimeSendHot;
|
|
10834
|
+
}
|
|
10835
|
+
async setUserCredits(email, amount) {
|
|
10836
|
+
const { runtimeSetUserCredits } = unwrapApolloResult(await __classPrivateFieldGet$4(this, _RuntimeClient_apolloClient, "f").mutate({
|
|
10837
|
+
mutation: gql `mutation runtimeSetUserCredits($email: String!, $amount: Float!) {
|
|
10838
|
+
runtimeSetUserCredits(email: $email, amount: $amount)
|
|
10839
|
+
}`,
|
|
10840
|
+
variables: { email, amount },
|
|
10841
|
+
}));
|
|
10842
|
+
return runtimeSetUserCredits;
|
|
10843
|
+
}
|
|
10844
|
+
async setUserFreeAccess(email, enabled) {
|
|
10845
|
+
const { runtimeSetUserFreeAccess } = unwrapApolloResult(await __classPrivateFieldGet$4(this, _RuntimeClient_apolloClient, "f").mutate({
|
|
10846
|
+
mutation: gql `mutation runtimeSetUserFreeAccess($email: String!, $enabled: Boolean!) {
|
|
10847
|
+
runtimeSetUserFreeAccess(email: $email, enabled: $enabled)
|
|
10848
|
+
}`,
|
|
10849
|
+
variables: { email, enabled },
|
|
10850
|
+
}));
|
|
10851
|
+
return runtimeSetUserFreeAccess;
|
|
10852
|
+
}
|
|
10853
|
+
async setHostRates(ratesJson) {
|
|
10854
|
+
const { runtimeSetHostRates } = unwrapApolloResult(await __classPrivateFieldGet$4(this, _RuntimeClient_apolloClient, "f").mutate({
|
|
10855
|
+
mutation: gql `mutation runtimeSetHostRates($ratesJson: String!) {
|
|
10856
|
+
runtimeSetHostRates(ratesJson: $ratesJson)
|
|
10857
|
+
}`,
|
|
10858
|
+
variables: { ratesJson },
|
|
10859
|
+
}));
|
|
10860
|
+
return runtimeSetHostRates;
|
|
10861
|
+
}
|
|
10862
|
+
async getHostRates() {
|
|
10863
|
+
const { runtimeHostRates } = unwrapApolloResult(await __classPrivateFieldGet$4(this, _RuntimeClient_apolloClient, "f").query({
|
|
10864
|
+
query: gql `query runtimeHostRates {
|
|
10865
|
+
runtimeHostRates
|
|
10866
|
+
}`,
|
|
10867
|
+
fetchPolicy: 'network-only',
|
|
10868
|
+
}));
|
|
10869
|
+
try {
|
|
10870
|
+
return JSON.parse(runtimeHostRates);
|
|
10871
|
+
}
|
|
10872
|
+
catch {
|
|
10873
|
+
return [];
|
|
10874
|
+
}
|
|
10875
|
+
}
|
|
10707
10876
|
addNotificationTriggeredCallback(cb) {
|
|
10708
10877
|
__classPrivateFieldGet$4(this, _RuntimeClient_notificationTriggeredCallbacks, "f").push(cb);
|
|
10709
10878
|
}
|
|
@@ -23138,6 +23307,7 @@ type ExpressionRendered {
|
|
|
23138
23307
|
|
|
23139
23308
|
type HostingUserInfo {
|
|
23140
23309
|
email: String!
|
|
23310
|
+
freeAccess: Boolean!
|
|
23141
23311
|
hotWalletAddress: String
|
|
23142
23312
|
remainingCredits: String!
|
|
23143
23313
|
}
|
|
@@ -23372,6 +23542,7 @@ type Mutation {
|
|
|
23372
23542
|
runtimeLoginUser(email: String!, password: String!): String!
|
|
23373
23543
|
runtimeOpenLink(url: String!): Boolean!
|
|
23374
23544
|
runtimeQuit: Boolean!
|
|
23545
|
+
runtimeReinstallUnytDna: PaymentRequestResult!
|
|
23375
23546
|
runtimeRemoveFriends(dids: [String!]!): [String!]!
|
|
23376
23547
|
runtimeRemoveKnownLinkLanguageTemplates(addresses: [String!]!): [String!]!
|
|
23377
23548
|
runtimeRemoveNotification(id: String!): Boolean!
|
|
@@ -23379,9 +23550,14 @@ type Mutation {
|
|
|
23379
23550
|
runtimeRequestLoginVerification(appInfo: AuthInfoInput, email: String!): VerificationRequestResult!
|
|
23380
23551
|
runtimeRequestPayment(amountHOT: String!): PaymentRequestResult!
|
|
23381
23552
|
runtimeRestartHolochain: Boolean!
|
|
23553
|
+
runtimeSendHot(amount: String!, recipient: String!): PaymentRequestResult!
|
|
23554
|
+
runtimeSetFreeHostingEnabled(enabled: Boolean!): Boolean!
|
|
23382
23555
|
runtimeSetHotWalletAddress(address: String!): Boolean!
|
|
23383
23556
|
runtimeSetMultiUserEnabled(enabled: Boolean!): Boolean!
|
|
23384
23557
|
runtimeSetStatus(status: PerspectiveInput!): Boolean!
|
|
23558
|
+
runtimeSetUnytMembraneProof(proof: String!): PaymentRequestResult!
|
|
23559
|
+
runtimeSetUserCredits(amount: Float!, email: String!): Boolean!
|
|
23560
|
+
runtimeSetUserFreeAccess(email: String!, enabled: Boolean!): Boolean!
|
|
23385
23561
|
runtimeTestEmail(to: String!): Boolean!
|
|
23386
23562
|
runtimeUpdateNotification(id: String!, notification: NotificationInput!): Boolean!
|
|
23387
23563
|
runtimeVerifyEmailCode(code: String!, email: String!, verificationType: String!): String!
|
|
@@ -23490,11 +23666,15 @@ type Query {
|
|
|
23490
23666
|
perspectiveQuerySurrealDB(query: String!, uuid: String!): String!
|
|
23491
23667
|
perspectiveSnapshot(uuid: String!): Perspective
|
|
23492
23668
|
perspectives: [PerspectiveHandle!]!
|
|
23669
|
+
runtimeFreeHostingEnabled: Boolean!
|
|
23493
23670
|
runtimeFriendStatus(did: String!): PerspectiveExpression
|
|
23494
23671
|
runtimeFriends: [String!]!
|
|
23495
23672
|
runtimeGetNetworkMetrics: String!
|
|
23496
23673
|
runtimeHcAgentInfos: String!
|
|
23497
23674
|
runtimeHostingUserInfo: HostingUserInfo!
|
|
23675
|
+
runtimeHotAgentPubkey: String!
|
|
23676
|
+
runtimeHotWalletBalance: String!
|
|
23677
|
+
runtimeHotWalletHistory(page: Float, perPage: Float): String!
|
|
23498
23678
|
runtimeInfo: RuntimeInfo!
|
|
23499
23679
|
runtimeKnownLinkLanguageTemplates: [String!]!
|
|
23500
23680
|
runtimeListUsers: [UserStatistics!]!
|
|
@@ -23502,6 +23682,8 @@ type Query {
|
|
|
23502
23682
|
runtimeMessageOutbox(filter: String): [SentMessage!]!
|
|
23503
23683
|
runtimeMultiUserEnabled: Boolean!
|
|
23504
23684
|
runtimeNotifications: [Notification!]!
|
|
23685
|
+
runtimeUnytAgentKey: String!
|
|
23686
|
+
runtimeUnytVersionInfo: String!
|
|
23505
23687
|
runtimeVerifyStringSignedByDid(data: String!, did: String!, didSigningKeyId: String!, signedData: String!): Boolean!
|
|
23506
23688
|
}
|
|
23507
23689
|
|
|
@@ -23577,8 +23759,11 @@ type UserCreationResult {
|
|
|
23577
23759
|
type UserStatistics {
|
|
23578
23760
|
did: String!
|
|
23579
23761
|
email: String!
|
|
23762
|
+
freeAccess: Boolean!
|
|
23763
|
+
hotWalletAddress: String
|
|
23580
23764
|
lastSeen: String
|
|
23581
23765
|
perspectiveCount: Int!
|
|
23766
|
+
remainingCredits: String!
|
|
23582
23767
|
}
|
|
23583
23768
|
|
|
23584
23769
|
type VerificationRequestResult {
|
|
@@ -23873,6 +24058,18 @@ __decorate([
|
|
|
23873
24058
|
Field(),
|
|
23874
24059
|
__metadata("design:type", Number)
|
|
23875
24060
|
], UserStatistics.prototype, "perspectiveCount", void 0);
|
|
24061
|
+
__decorate([
|
|
24062
|
+
Field(),
|
|
24063
|
+
__metadata("design:type", String)
|
|
24064
|
+
], UserStatistics.prototype, "remainingCredits", void 0);
|
|
24065
|
+
__decorate([
|
|
24066
|
+
Field(),
|
|
24067
|
+
__metadata("design:type", Boolean)
|
|
24068
|
+
], UserStatistics.prototype, "freeAccess", void 0);
|
|
24069
|
+
__decorate([
|
|
24070
|
+
Field(),
|
|
24071
|
+
__metadata("design:type", String)
|
|
24072
|
+
], UserStatistics.prototype, "hotWalletAddress", void 0);
|
|
23876
24073
|
UserStatistics = __decorate([
|
|
23877
24074
|
ObjectType()
|
|
23878
24075
|
], UserStatistics);
|
|
@@ -23898,10 +24095,11 @@ VerificationRequestResult = __decorate([
|
|
|
23898
24095
|
ObjectType()
|
|
23899
24096
|
], VerificationRequestResult);
|
|
23900
24097
|
let HostingUserInfo = class HostingUserInfo {
|
|
23901
|
-
constructor(email, remainingCredits, hotWalletAddress) {
|
|
24098
|
+
constructor(email, remainingCredits, hotWalletAddress, freeAccess = false) {
|
|
23902
24099
|
this.email = email;
|
|
23903
24100
|
this.remainingCredits = remainingCredits;
|
|
23904
24101
|
this.hotWalletAddress = hotWalletAddress;
|
|
24102
|
+
this.freeAccess = freeAccess;
|
|
23905
24103
|
}
|
|
23906
24104
|
};
|
|
23907
24105
|
__decorate([
|
|
@@ -23916,9 +24114,13 @@ __decorate([
|
|
|
23916
24114
|
Field(),
|
|
23917
24115
|
__metadata("design:type", String)
|
|
23918
24116
|
], HostingUserInfo.prototype, "hotWalletAddress", void 0);
|
|
24117
|
+
__decorate([
|
|
24118
|
+
Field(),
|
|
24119
|
+
__metadata("design:type", Boolean)
|
|
24120
|
+
], HostingUserInfo.prototype, "freeAccess", void 0);
|
|
23919
24121
|
HostingUserInfo = __decorate([
|
|
23920
24122
|
ObjectType(),
|
|
23921
|
-
__metadata("design:paramtypes", [String, String, String])
|
|
24123
|
+
__metadata("design:paramtypes", [String, String, String, Boolean])
|
|
23922
24124
|
], HostingUserInfo);
|
|
23923
24125
|
let PaymentRequestResult = class PaymentRequestResult {
|
|
23924
24126
|
constructor(success, message) {
|
|
@@ -24093,12 +24295,20 @@ let RuntimeResolver = class RuntimeResolver {
|
|
|
24093
24295
|
runtimeSetMultiUserEnabled(enabled) {
|
|
24094
24296
|
return enabled;
|
|
24095
24297
|
}
|
|
24298
|
+
runtimeFreeHostingEnabled() {
|
|
24299
|
+
return true;
|
|
24300
|
+
}
|
|
24301
|
+
runtimeSetFreeHostingEnabled(enabled) {
|
|
24302
|
+
return enabled;
|
|
24303
|
+
}
|
|
24096
24304
|
runtimeListUsers() {
|
|
24097
24305
|
return [{
|
|
24098
24306
|
email: "test@example.com",
|
|
24099
24307
|
did: "did:key:test123",
|
|
24100
24308
|
lastSeen: new Date().toISOString(),
|
|
24101
|
-
perspectiveCount: 5
|
|
24309
|
+
perspectiveCount: 5,
|
|
24310
|
+
remainingCredits: "0",
|
|
24311
|
+
freeAccess: false
|
|
24102
24312
|
}];
|
|
24103
24313
|
}
|
|
24104
24314
|
runtimeRequestLoginVerification(email, appInfo) {
|
|
@@ -24148,7 +24358,7 @@ let RuntimeResolver = class RuntimeResolver {
|
|
|
24148
24358
|
}
|
|
24149
24359
|
// Hosting mutations & queries
|
|
24150
24360
|
runtimeHostingUserInfo() {
|
|
24151
|
-
return new HostingUserInfo("test@example.com", "100000000", null);
|
|
24361
|
+
return new HostingUserInfo("test@example.com", "100000000", null, false);
|
|
24152
24362
|
}
|
|
24153
24363
|
runtimeSetHotWalletAddress(address) {
|
|
24154
24364
|
return true;
|
|
@@ -24156,6 +24366,36 @@ let RuntimeResolver = class RuntimeResolver {
|
|
|
24156
24366
|
runtimeRequestPayment(amountHOT) {
|
|
24157
24367
|
return new PaymentRequestResult(true, "Mock payment of " + amountHOT + " base units credited");
|
|
24158
24368
|
}
|
|
24369
|
+
runtimeSetUserCredits(email, amount) {
|
|
24370
|
+
return true;
|
|
24371
|
+
}
|
|
24372
|
+
runtimeSetUserFreeAccess(email, enabled) {
|
|
24373
|
+
return true;
|
|
24374
|
+
}
|
|
24375
|
+
runtimeReinstallUnytDna() {
|
|
24376
|
+
return new PaymentRequestResult(true, "");
|
|
24377
|
+
}
|
|
24378
|
+
runtimeSendHot(recipient, amount) {
|
|
24379
|
+
return new PaymentRequestResult(true, "");
|
|
24380
|
+
}
|
|
24381
|
+
runtimeSetUnytMembraneProof(proof) {
|
|
24382
|
+
return new PaymentRequestResult(true, "");
|
|
24383
|
+
}
|
|
24384
|
+
runtimeHotWalletBalance() {
|
|
24385
|
+
return "";
|
|
24386
|
+
}
|
|
24387
|
+
runtimeHotWalletHistory(page, perPage) {
|
|
24388
|
+
return "";
|
|
24389
|
+
}
|
|
24390
|
+
runtimeHotAgentPubkey() {
|
|
24391
|
+
return "";
|
|
24392
|
+
}
|
|
24393
|
+
runtimeUnytAgentKey() {
|
|
24394
|
+
return "";
|
|
24395
|
+
}
|
|
24396
|
+
runtimeUnytVersionInfo() {
|
|
24397
|
+
return "";
|
|
24398
|
+
}
|
|
24159
24399
|
};
|
|
24160
24400
|
__decorate([
|
|
24161
24401
|
Mutation(),
|
|
@@ -24402,6 +24642,19 @@ __decorate([
|
|
|
24402
24642
|
__metadata("design:paramtypes", [Boolean]),
|
|
24403
24643
|
__metadata("design:returntype", Boolean)
|
|
24404
24644
|
], RuntimeResolver.prototype, "runtimeSetMultiUserEnabled", null);
|
|
24645
|
+
__decorate([
|
|
24646
|
+
Query(),
|
|
24647
|
+
__metadata("design:type", Function),
|
|
24648
|
+
__metadata("design:paramtypes", []),
|
|
24649
|
+
__metadata("design:returntype", Boolean)
|
|
24650
|
+
], RuntimeResolver.prototype, "runtimeFreeHostingEnabled", null);
|
|
24651
|
+
__decorate([
|
|
24652
|
+
Mutation(),
|
|
24653
|
+
__param(0, Arg()),
|
|
24654
|
+
__metadata("design:type", Function),
|
|
24655
|
+
__metadata("design:paramtypes", [Boolean]),
|
|
24656
|
+
__metadata("design:returntype", Boolean)
|
|
24657
|
+
], RuntimeResolver.prototype, "runtimeSetFreeHostingEnabled", null);
|
|
24405
24658
|
__decorate([
|
|
24406
24659
|
Query(),
|
|
24407
24660
|
__metadata("design:type", Function),
|
|
@@ -24503,6 +24756,75 @@ __decorate([
|
|
|
24503
24756
|
__metadata("design:paramtypes", [String]),
|
|
24504
24757
|
__metadata("design:returntype", PaymentRequestResult)
|
|
24505
24758
|
], RuntimeResolver.prototype, "runtimeRequestPayment", null);
|
|
24759
|
+
__decorate([
|
|
24760
|
+
Mutation(),
|
|
24761
|
+
__param(0, Arg()),
|
|
24762
|
+
__param(1, Arg()),
|
|
24763
|
+
__metadata("design:type", Function),
|
|
24764
|
+
__metadata("design:paramtypes", [String, Number]),
|
|
24765
|
+
__metadata("design:returntype", Boolean)
|
|
24766
|
+
], RuntimeResolver.prototype, "runtimeSetUserCredits", null);
|
|
24767
|
+
__decorate([
|
|
24768
|
+
Mutation(),
|
|
24769
|
+
__param(0, Arg()),
|
|
24770
|
+
__param(1, Arg()),
|
|
24771
|
+
__metadata("design:type", Function),
|
|
24772
|
+
__metadata("design:paramtypes", [String, Boolean]),
|
|
24773
|
+
__metadata("design:returntype", Boolean)
|
|
24774
|
+
], RuntimeResolver.prototype, "runtimeSetUserFreeAccess", null);
|
|
24775
|
+
__decorate([
|
|
24776
|
+
Mutation(),
|
|
24777
|
+
__metadata("design:type", Function),
|
|
24778
|
+
__metadata("design:paramtypes", []),
|
|
24779
|
+
__metadata("design:returntype", PaymentRequestResult)
|
|
24780
|
+
], RuntimeResolver.prototype, "runtimeReinstallUnytDna", null);
|
|
24781
|
+
__decorate([
|
|
24782
|
+
Mutation(),
|
|
24783
|
+
__param(0, Arg()),
|
|
24784
|
+
__param(1, Arg()),
|
|
24785
|
+
__metadata("design:type", Function),
|
|
24786
|
+
__metadata("design:paramtypes", [String, String]),
|
|
24787
|
+
__metadata("design:returntype", PaymentRequestResult)
|
|
24788
|
+
], RuntimeResolver.prototype, "runtimeSendHot", null);
|
|
24789
|
+
__decorate([
|
|
24790
|
+
Mutation(),
|
|
24791
|
+
__param(0, Arg()),
|
|
24792
|
+
__metadata("design:type", Function),
|
|
24793
|
+
__metadata("design:paramtypes", [String]),
|
|
24794
|
+
__metadata("design:returntype", PaymentRequestResult)
|
|
24795
|
+
], RuntimeResolver.prototype, "runtimeSetUnytMembraneProof", null);
|
|
24796
|
+
__decorate([
|
|
24797
|
+
Query(),
|
|
24798
|
+
__metadata("design:type", Function),
|
|
24799
|
+
__metadata("design:paramtypes", []),
|
|
24800
|
+
__metadata("design:returntype", String)
|
|
24801
|
+
], RuntimeResolver.prototype, "runtimeHotWalletBalance", null);
|
|
24802
|
+
__decorate([
|
|
24803
|
+
Query(),
|
|
24804
|
+
__param(0, Arg()),
|
|
24805
|
+
__param(1, Arg()),
|
|
24806
|
+
__metadata("design:type", Function),
|
|
24807
|
+
__metadata("design:paramtypes", [Number, Number]),
|
|
24808
|
+
__metadata("design:returntype", String)
|
|
24809
|
+
], RuntimeResolver.prototype, "runtimeHotWalletHistory", null);
|
|
24810
|
+
__decorate([
|
|
24811
|
+
Query(),
|
|
24812
|
+
__metadata("design:type", Function),
|
|
24813
|
+
__metadata("design:paramtypes", []),
|
|
24814
|
+
__metadata("design:returntype", String)
|
|
24815
|
+
], RuntimeResolver.prototype, "runtimeHotAgentPubkey", null);
|
|
24816
|
+
__decorate([
|
|
24817
|
+
Query(),
|
|
24818
|
+
__metadata("design:type", Function),
|
|
24819
|
+
__metadata("design:paramtypes", []),
|
|
24820
|
+
__metadata("design:returntype", String)
|
|
24821
|
+
], RuntimeResolver.prototype, "runtimeUnytAgentKey", null);
|
|
24822
|
+
__decorate([
|
|
24823
|
+
Query(),
|
|
24824
|
+
__metadata("design:type", Function),
|
|
24825
|
+
__metadata("design:paramtypes", []),
|
|
24826
|
+
__metadata("design:returntype", String)
|
|
24827
|
+
], RuntimeResolver.prototype, "runtimeUnytVersionInfo", null);
|
|
24506
24828
|
RuntimeResolver = __decorate([
|
|
24507
24829
|
Resolver()
|
|
24508
24830
|
], RuntimeResolver);
|
|
@@ -14,6 +14,7 @@ export interface InitializeArgs {
|
|
|
14
14
|
export type AgentUpdatedCallback = (agent: Agent) => null;
|
|
15
15
|
export type AgentStatusChangedCallback = (agent: Agent) => null;
|
|
16
16
|
export type AgentAppsUpdatedCallback = () => null;
|
|
17
|
+
export type HostingUserInfoChangedCallback = (info: HostingUserInfo) => void;
|
|
17
18
|
/**
|
|
18
19
|
* Provides access to all functions regarding the local agent,
|
|
19
20
|
* such as generating, locking, unlocking, importing the DID keystore,
|
|
@@ -48,6 +49,8 @@ export declare class AgentClient {
|
|
|
48
49
|
subscribeAppsChanged(): void;
|
|
49
50
|
addAgentStatusChangedListener(listener: any): void;
|
|
50
51
|
subscribeAgentStatusChanged(): void;
|
|
52
|
+
addHostingUserInfoChangedListener(listener: HostingUserInfoChangedCallback): void;
|
|
53
|
+
subscribeHostingUserInfoChanged(): void;
|
|
51
54
|
requestCapability(authInfo: AuthInfoInput): Promise<string>;
|
|
52
55
|
permitCapability(auth: string): Promise<string>;
|
|
53
56
|
generateJwt(requestId: string, rand: string): Promise<string>;
|
|
@@ -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 _AgentClient_apolloClient, _AgentClient_appsChangedCallback, _AgentClient_updatedCallbacks, _AgentClient_agentStatusChangedCallbacks;
|
|
12
|
+
var _AgentClient_apolloClient, _AgentClient_appsChangedCallback, _AgentClient_updatedCallbacks, _AgentClient_agentStatusChangedCallbacks, _AgentClient_hostingUserInfoChangedCallbacks;
|
|
13
13
|
import { gql } from "@apollo/client/core";
|
|
14
14
|
import unwrapApolloResult from "../unwrapApolloResult";
|
|
15
15
|
import { Agent, } from "./Agent";
|
|
@@ -77,10 +77,12 @@ export class AgentClient {
|
|
|
77
77
|
_AgentClient_appsChangedCallback.set(this, void 0);
|
|
78
78
|
_AgentClient_updatedCallbacks.set(this, void 0);
|
|
79
79
|
_AgentClient_agentStatusChangedCallbacks.set(this, void 0);
|
|
80
|
+
_AgentClient_hostingUserInfoChangedCallbacks.set(this, void 0);
|
|
80
81
|
__classPrivateFieldSet(this, _AgentClient_apolloClient, client, "f");
|
|
81
82
|
__classPrivateFieldSet(this, _AgentClient_updatedCallbacks, [], "f");
|
|
82
83
|
__classPrivateFieldSet(this, _AgentClient_agentStatusChangedCallbacks, [], "f");
|
|
83
84
|
__classPrivateFieldSet(this, _AgentClient_appsChangedCallback, [], "f");
|
|
85
|
+
__classPrivateFieldSet(this, _AgentClient_hostingUserInfoChangedCallbacks, [], "f");
|
|
84
86
|
if (subscribe) {
|
|
85
87
|
this.subscribeAgentUpdated();
|
|
86
88
|
this.subscribeAgentStatusChanged();
|
|
@@ -341,6 +343,29 @@ export class AgentClient {
|
|
|
341
343
|
error: (e) => console.error(e),
|
|
342
344
|
});
|
|
343
345
|
}
|
|
346
|
+
addHostingUserInfoChangedListener(listener) {
|
|
347
|
+
__classPrivateFieldGet(this, _AgentClient_hostingUserInfoChangedCallbacks, "f").push(listener);
|
|
348
|
+
}
|
|
349
|
+
subscribeHostingUserInfoChanged() {
|
|
350
|
+
__classPrivateFieldGet(this, _AgentClient_apolloClient, "f")
|
|
351
|
+
.subscribe({
|
|
352
|
+
query: gql `subscription {
|
|
353
|
+
runtimeHostingUserInfoChanged {
|
|
354
|
+
email
|
|
355
|
+
remainingCredits
|
|
356
|
+
hotWalletAddress
|
|
357
|
+
freeAccess
|
|
358
|
+
}
|
|
359
|
+
}`,
|
|
360
|
+
})
|
|
361
|
+
.subscribe({
|
|
362
|
+
next: (result) => {
|
|
363
|
+
const info = result.data.runtimeHostingUserInfoChanged;
|
|
364
|
+
__classPrivateFieldGet(this, _AgentClient_hostingUserInfoChangedCallbacks, "f").forEach((cb) => cb(info));
|
|
365
|
+
},
|
|
366
|
+
error: (e) => console.error(e),
|
|
367
|
+
});
|
|
368
|
+
}
|
|
344
369
|
async requestCapability(authInfo) {
|
|
345
370
|
const { agentRequestCapability } = unwrapApolloResult(await __classPrivateFieldGet(this, _AgentClient_apolloClient, "f").mutate({
|
|
346
371
|
mutation: gql `
|
|
@@ -481,6 +506,7 @@ export class AgentClient {
|
|
|
481
506
|
email
|
|
482
507
|
remainingCredits
|
|
483
508
|
hotWalletAddress
|
|
509
|
+
freeAccess
|
|
484
510
|
}
|
|
485
511
|
}`,
|
|
486
512
|
}));
|
|
@@ -508,4 +534,4 @@ export class AgentClient {
|
|
|
508
534
|
return runtimeRequestPayment;
|
|
509
535
|
}
|
|
510
536
|
}
|
|
511
|
-
_AgentClient_apolloClient = new WeakMap(), _AgentClient_appsChangedCallback = new WeakMap(), _AgentClient_updatedCallbacks = new WeakMap(), _AgentClient_agentStatusChangedCallbacks = new WeakMap();
|
|
537
|
+
_AgentClient_apolloClient = new WeakMap(), _AgentClient_appsChangedCallback = new WeakMap(), _AgentClient_updatedCallbacks = new WeakMap(), _AgentClient_agentStatusChangedCallbacks = new WeakMap(), _AgentClient_hostingUserInfoChangedCallbacks = new WeakMap();
|
|
@@ -9,6 +9,7 @@ export declare class RuntimeClient {
|
|
|
9
9
|
#private;
|
|
10
10
|
constructor(client: ApolloClient<any>, subscribe?: boolean);
|
|
11
11
|
info(): Promise<RuntimeInfo>;
|
|
12
|
+
tlsDomain(): Promise<string | null>;
|
|
12
13
|
quit(): Promise<Boolean>;
|
|
13
14
|
openLink(url: string): Promise<Boolean>;
|
|
14
15
|
addTrustedAgents(agents: string[]): Promise<string[]>;
|
|
@@ -41,12 +42,39 @@ export declare class RuntimeClient {
|
|
|
41
42
|
importPerspective(filePath: string): Promise<boolean>;
|
|
42
43
|
multiUserEnabled(): Promise<boolean>;
|
|
43
44
|
setMultiUserEnabled(enabled: boolean): Promise<boolean>;
|
|
45
|
+
freeHostingEnabled(): Promise<boolean>;
|
|
46
|
+
setFreeHostingEnabled(enabled: boolean): Promise<boolean>;
|
|
44
47
|
listUsers(): Promise<UserStatistics[]>;
|
|
48
|
+
userWalletAddress(email: string): Promise<string | null>;
|
|
45
49
|
emailTestModeEnable(): Promise<boolean>;
|
|
46
50
|
emailTestModeDisable(): Promise<boolean>;
|
|
47
51
|
emailTestGetCode(email: string): Promise<string | null>;
|
|
48
52
|
emailTestClearCodes(): Promise<boolean>;
|
|
49
53
|
emailTestSetExpiry(email: string, verificationType: string, expiresAt: number): Promise<boolean>;
|
|
54
|
+
unytAgentKey(): Promise<string>;
|
|
55
|
+
unytHotAgentPubkey(): Promise<string>;
|
|
56
|
+
unytWalletBalance(): Promise<string>;
|
|
57
|
+
unytWalletHistory(page?: number, perPage?: number): Promise<string>;
|
|
58
|
+
unytVersionInfo(): Promise<string>;
|
|
59
|
+
unytSetMembraneProof(proof: string): Promise<{
|
|
60
|
+
success: boolean;
|
|
61
|
+
message: string;
|
|
62
|
+
}>;
|
|
63
|
+
unytReinstallDna(): Promise<{
|
|
64
|
+
success: boolean;
|
|
65
|
+
message: string;
|
|
66
|
+
}>;
|
|
67
|
+
unytSendHot(recipient: string, amount: string): Promise<{
|
|
68
|
+
success: boolean;
|
|
69
|
+
message: string;
|
|
70
|
+
}>;
|
|
71
|
+
setUserCredits(email: string, amount: number): Promise<boolean>;
|
|
72
|
+
setUserFreeAccess(email: string, enabled: boolean): Promise<boolean>;
|
|
73
|
+
setHostRates(ratesJson: string): Promise<boolean>;
|
|
74
|
+
getHostRates(): Promise<{
|
|
75
|
+
description: string;
|
|
76
|
+
priceInHOT: number;
|
|
77
|
+
}[]>;
|
|
50
78
|
addNotificationTriggeredCallback(cb: NotificationTriggeredCallback): void;
|
|
51
79
|
subscribeNotificationTriggered(): void;
|
|
52
80
|
addMessageCallback(cb: MessageCallback): void;
|