@coasys/ad4m 0.8.0-fix → 0.8.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/README.md +229 -229
- package/jest.config.js +5 -5
- package/jsdoc.json +27 -27
- package/lib/index.cjs +4522 -4571
- package/lib/index.js +4522 -4571
- package/lib/shims/type-graphql.d.ts +32 -32
- package/lib/shims/type-graphql.js +70 -70
- package/lib/src/Ad4mClient.d.ts +26 -26
- package/lib/src/Ad4mClient.js +66 -66
- package/lib/src/Address.d.ts +1 -1
- package/lib/src/Address.js +1 -1
- package/lib/src/DID.d.ts +1 -1
- package/lib/src/DID.js +1 -1
- package/lib/src/Exception.d.ts +6 -6
- package/lib/src/Exception.js +7 -7
- package/lib/src/Literal.d.ts +7 -7
- package/lib/src/Literal.js +76 -76
- package/lib/src/PubSub.d.ts +14 -14
- package/lib/src/PubSub.js +14 -14
- package/lib/src/SmartLiteral.d.ts +12 -12
- package/lib/src/SmartLiteral.js +74 -74
- package/lib/src/agent/Agent.d.ts +104 -104
- package/lib/src/agent/Agent.js +337 -337
- package/lib/src/agent/AgentClient.d.ts +57 -57
- package/lib/src/agent/AgentClient.js +431 -431
- package/lib/src/agent/AgentResolver.d.ts +30 -30
- package/lib/src/agent/AgentResolver.js +325 -325
- package/lib/src/agent/AgentStatus.d.ts +8 -8
- package/lib/src/agent/AgentStatus.js +61 -61
- package/lib/src/buildSchema.d.ts +1 -1
- package/lib/src/buildSchema.js +36 -36
- package/lib/src/expression/Expression.d.ts +28 -28
- package/lib/src/expression/Expression.js +143 -143
- package/lib/src/expression/ExpressionClient.d.ts +13 -13
- package/lib/src/expression/ExpressionClient.js +102 -102
- package/lib/src/expression/ExpressionRef.d.ts +9 -9
- package/lib/src/expression/ExpressionRef.js +67 -67
- package/lib/src/expression/ExpressionResolver.d.ts +10 -10
- package/lib/src/expression/ExpressionResolver.js +106 -106
- package/lib/src/index.d.ts +30 -30
- package/lib/src/index.js +30 -30
- package/lib/src/jestSetup.d.ts +1 -1
- package/lib/src/jestSetup.js +1 -1
- package/lib/src/language/Icon.d.ts +4 -4
- package/lib/src/language/Icon.js +24 -24
- package/lib/src/language/Language.d.ts +195 -195
- package/lib/src/language/Language.js +79 -79
- package/lib/src/language/LanguageClient.d.ts +17 -17
- package/lib/src/language/LanguageClient.js +137 -137
- package/lib/src/language/LanguageContext.d.ts +37 -37
- package/lib/src/language/LanguageContext.js +2 -2
- package/lib/src/language/LanguageHandle.d.ts +9 -9
- package/lib/src/language/LanguageHandle.js +41 -41
- package/lib/src/language/LanguageMeta.d.ts +35 -35
- package/lib/src/language/LanguageMeta.js +89 -89
- package/lib/src/language/LanguageRef.d.ts +6 -6
- package/lib/src/language/LanguageRef.js +30 -30
- package/lib/src/language/LanguageResolver.d.ts +19 -19
- package/lib/src/language/LanguageResolver.js +143 -143
- package/lib/src/links/Links.d.ts +39 -39
- package/lib/src/links/Links.js +148 -148
- package/lib/src/links/Links.test.d.ts +1 -1
- package/lib/src/links/Links.test.js +33 -33
- package/lib/src/neighbourhood/Neighbourhood.d.ts +10 -10
- package/lib/src/neighbourhood/Neighbourhood.js +38 -38
- package/lib/src/neighbourhood/NeighbourhoodClient.d.ts +25 -25
- package/lib/src/neighbourhood/NeighbourhoodClient.js +256 -256
- package/lib/src/neighbourhood/NeighbourhoodProxy.d.ts +19 -19
- package/lib/src/neighbourhood/NeighbourhoodProxy.js +54 -54
- package/lib/src/neighbourhood/NeighbourhoodResolver.d.ts +24 -24
- package/lib/src/neighbourhood/NeighbourhoodResolver.js +180 -180
- package/lib/src/perspectives/LinkQuery.d.ts +11 -11
- package/lib/src/perspectives/LinkQuery.js +80 -80
- package/lib/src/perspectives/Perspective.d.ts +38 -38
- package/lib/src/perspectives/Perspective.js +144 -144
- package/lib/src/perspectives/Perspective.test.d.ts +1 -1
- package/lib/src/perspectives/Perspective.test.js +20 -20
- package/lib/src/perspectives/PerspectiveClient.d.ts +55 -54
- package/lib/src/perspectives/PerspectiveClient.js +418 -410
- package/lib/src/perspectives/PerspectiveDiff.d.ts +9 -9
- package/lib/src/perspectives/PerspectiveDiff.js +33 -33
- package/lib/src/perspectives/PerspectiveHandle.d.ts +16 -16
- package/lib/src/perspectives/PerspectiveHandle.js +59 -59
- package/lib/src/perspectives/PerspectiveProxy.d.ts +178 -178
- package/lib/src/perspectives/PerspectiveProxy.js +501 -540
- package/lib/src/perspectives/PerspectiveResolver.d.ts +38 -37
- package/lib/src/perspectives/PerspectiveResolver.js +376 -362
- package/lib/src/runtime/RuntimeClient.d.ts +33 -33
- package/lib/src/runtime/RuntimeClient.js +263 -263
- package/lib/src/runtime/RuntimeResolver.d.ts +47 -47
- package/lib/src/runtime/RuntimeResolver.js +328 -328
- package/lib/src/schema.gql +1 -0
- package/lib/src/subject/SDNADecorators.d.ts +45 -45
- package/lib/src/subject/SDNADecorators.js +250 -250
- package/lib/src/subject/Subject.d.ts +7 -7
- package/lib/src/subject/Subject.js +160 -160
- package/lib/src/subject/SubjectEntity.d.ts +31 -31
- package/lib/src/subject/SubjectEntity.js +250 -250
- package/lib/src/subject/util.d.ts +12 -12
- package/lib/src/subject/util.js +73 -73
- package/lib/src/typeDefs.d.ts +1 -1
- package/lib/src/typeDefs.js +1 -0
- package/lib/src/unwrapApolloResult.d.ts +2 -2
- package/lib/src/unwrapApolloResult.js +14 -12
- package/lib/src/utils.d.ts +2 -2
- package/lib/src/utils.js +21 -21
- package/package.json +61 -61
- package/rollup.config.js +26 -26
- package/shims/type-graphql.ts +75 -75
- package/src/Ad4mClient.test.ts +1089 -1084
- package/src/Ad4mClient.ts +62 -62
- package/src/Address.ts +1 -1
- package/src/Exception.ts +6 -6
- package/src/Literal.test.ts +30 -30
- package/src/Literal.ts +80 -80
- package/src/PubSub.ts +13 -13
- package/src/SmartLiteral.ts +74 -74
- package/src/agent/Agent.ts +293 -293
- package/src/agent/AgentClient.ts +531 -531
- package/src/agent/AgentResolver.ts +263 -263
- package/src/agent/AgentStatus.ts +43 -43
- package/src/buildSchema.ts +41 -41
- package/src/expression/Expression.ts +99 -99
- package/src/expression/ExpressionClient.ts +98 -98
- package/src/expression/ExpressionRef.ts +62 -62
- package/src/expression/ExpressionResolver.ts +63 -63
- package/src/index.ts +30 -30
- package/src/language/Icon.ts +10 -10
- package/src/language/Language.ts +266 -266
- package/src/language/LanguageClient.ts +159 -159
- package/src/language/LanguageContext.ts +37 -37
- package/src/language/LanguageHandle.ts +23 -23
- package/src/language/LanguageMeta.ts +69 -69
- package/src/language/LanguageRef.ts +18 -18
- package/src/language/LanguageResolver.ts +98 -98
- package/src/links/Links.test.ts +39 -39
- package/src/links/Links.ts +107 -107
- package/src/neighbourhood/Neighbourhood.ts +22 -22
- package/src/neighbourhood/NeighbourhoodClient.ts +275 -275
- package/src/neighbourhood/NeighbourhoodProxy.ts +58 -58
- package/src/neighbourhood/NeighbourhoodResolver.ts +99 -99
- package/src/perspectives/LinkQuery.ts +65 -65
- package/src/perspectives/Perspective.test.ts +22 -22
- package/src/perspectives/Perspective.ts +118 -118
- package/src/perspectives/PerspectiveClient.ts +452 -443
- package/src/perspectives/PerspectiveDiff.ts +15 -15
- package/src/perspectives/PerspectiveHandle.ts +39 -39
- package/src/perspectives/PerspectiveProxy.ts +576 -610
- package/src/perspectives/PerspectiveResolver.ts +224 -219
- package/src/runtime/RuntimeClient.ts +282 -282
- package/src/runtime/RuntimeResolver.ts +192 -192
- package/src/subject/SDNADecorators.ts +333 -333
- package/src/subject/Subject.ts +152 -152
- package/src/subject/SubjectEntity.ts +291 -291
- package/src/subject/util.ts +84 -84
- package/src/typeDefs.ts +5 -5
- package/src/unwrapApolloResult.ts +15 -13
- package/src/utils.ts +25 -25
- package/tsconfig-browser.json +82 -82
- package/tsconfig.json +80 -80
- package/yarn-error.log +0 -22814
|
@@ -1,328 +1,328 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
-
};
|
|
10
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
-
};
|
|
13
|
-
import { Arg, Mutation, Resolver, Query, Subscription, ObjectType, Field } from "type-graphql";
|
|
14
|
-
import { Perspective, PerspectiveExpression, PerspectiveInput } from "../perspectives/Perspective";
|
|
15
|
-
import { ExpressionProof } from "../expression/Expression";
|
|
16
|
-
import { LinkExpression } from "../links/Links";
|
|
17
|
-
import { ExceptionType } from "../Exception";
|
|
18
|
-
import { RUNTIME_MESSAGED_RECEIVED_TOPIC, EXCEPTION_OCCURRED_TOPIC } from '../PubSub';
|
|
19
|
-
const testLink = new LinkExpression();
|
|
20
|
-
testLink.author = "did:ad4m:test";
|
|
21
|
-
testLink.timestamp = Date.now();
|
|
22
|
-
testLink.data = {
|
|
23
|
-
source: 'root',
|
|
24
|
-
target: 'neighbourhood://Qm12345'
|
|
25
|
-
};
|
|
26
|
-
testLink.proof = {
|
|
27
|
-
signature: '',
|
|
28
|
-
key: '',
|
|
29
|
-
valid: true
|
|
30
|
-
};
|
|
31
|
-
const testPerspectiveExpression = new PerspectiveExpression();
|
|
32
|
-
testPerspectiveExpression.author = 'did:ad4m:test';
|
|
33
|
-
testPerspectiveExpression.timestamp = Date.now().toString();
|
|
34
|
-
testPerspectiveExpression.proof = new ExpressionProof('', '');
|
|
35
|
-
testPerspectiveExpression.data = new Perspective([testLink]);
|
|
36
|
-
let SentMessage = class SentMessage {
|
|
37
|
-
};
|
|
38
|
-
__decorate([
|
|
39
|
-
Field(),
|
|
40
|
-
__metadata("design:type", String)
|
|
41
|
-
], SentMessage.prototype, "recipient", void 0);
|
|
42
|
-
__decorate([
|
|
43
|
-
Field(),
|
|
44
|
-
__metadata("design:type", PerspectiveExpression)
|
|
45
|
-
], SentMessage.prototype, "message", void 0);
|
|
46
|
-
SentMessage = __decorate([
|
|
47
|
-
ObjectType()
|
|
48
|
-
], SentMessage);
|
|
49
|
-
export { SentMessage };
|
|
50
|
-
let RuntimeInfo = class RuntimeInfo {
|
|
51
|
-
};
|
|
52
|
-
__decorate([
|
|
53
|
-
Field(),
|
|
54
|
-
__metadata("design:type", String)
|
|
55
|
-
], RuntimeInfo.prototype, "ad4mExecutorVersion", void 0);
|
|
56
|
-
__decorate([
|
|
57
|
-
Field(),
|
|
58
|
-
__metadata("design:type", Boolean)
|
|
59
|
-
], RuntimeInfo.prototype, "isInitialized", void 0);
|
|
60
|
-
__decorate([
|
|
61
|
-
Field(),
|
|
62
|
-
__metadata("design:type", Boolean)
|
|
63
|
-
], RuntimeInfo.prototype, "isUnlocked", void 0);
|
|
64
|
-
RuntimeInfo = __decorate([
|
|
65
|
-
ObjectType()
|
|
66
|
-
], RuntimeInfo);
|
|
67
|
-
export { RuntimeInfo };
|
|
68
|
-
let ExceptionInfo = class ExceptionInfo {
|
|
69
|
-
};
|
|
70
|
-
__decorate([
|
|
71
|
-
Field(),
|
|
72
|
-
__metadata("design:type", String)
|
|
73
|
-
], ExceptionInfo.prototype, "title", void 0);
|
|
74
|
-
__decorate([
|
|
75
|
-
Field(),
|
|
76
|
-
__metadata("design:type", String)
|
|
77
|
-
], ExceptionInfo.prototype, "message", void 0);
|
|
78
|
-
__decorate([
|
|
79
|
-
Field(),
|
|
80
|
-
__metadata("design:type", Number)
|
|
81
|
-
], ExceptionInfo.prototype, "type", void 0);
|
|
82
|
-
__decorate([
|
|
83
|
-
Field({ nullable: true }),
|
|
84
|
-
__metadata("design:type", String)
|
|
85
|
-
], ExceptionInfo.prototype, "addon", void 0);
|
|
86
|
-
ExceptionInfo = __decorate([
|
|
87
|
-
ObjectType()
|
|
88
|
-
], ExceptionInfo);
|
|
89
|
-
export { ExceptionInfo };
|
|
90
|
-
/**
|
|
91
|
-
* Resolver classes are used here to define the GraphQL schema
|
|
92
|
-
* (through the type-graphql annotations)
|
|
93
|
-
* and are spawned in the client tests in Ad4mClient.test.ts.
|
|
94
|
-
* For the latter, they return test fixtures.
|
|
95
|
-
*/
|
|
96
|
-
let RuntimeResolver = class RuntimeResolver {
|
|
97
|
-
runtimeQuit() {
|
|
98
|
-
return true;
|
|
99
|
-
}
|
|
100
|
-
runtimeOpenLink(url) {
|
|
101
|
-
return true;
|
|
102
|
-
}
|
|
103
|
-
runtimeInfo() {
|
|
104
|
-
return {
|
|
105
|
-
ad4mExecutorVersion: "x.x.x",
|
|
106
|
-
isInitialized: true,
|
|
107
|
-
isUnlocked: true
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
addTrustedAgents(agents) {
|
|
111
|
-
return agents;
|
|
112
|
-
}
|
|
113
|
-
deleteTrustedAgents(agents) {
|
|
114
|
-
return [];
|
|
115
|
-
}
|
|
116
|
-
getTrustedAgents() {
|
|
117
|
-
return ["agentPubKey"];
|
|
118
|
-
}
|
|
119
|
-
runtimeKnownLinkLanguageTemplates() {
|
|
120
|
-
return ["Qm12345abcdef"];
|
|
121
|
-
}
|
|
122
|
-
runtimeAddKnownLinkLanguageTemplates(addresses) {
|
|
123
|
-
return addresses;
|
|
124
|
-
}
|
|
125
|
-
runtimeRemoveKnownLinkLanguageTemplates(addresses) {
|
|
126
|
-
return [];
|
|
127
|
-
}
|
|
128
|
-
runtimeFriends() {
|
|
129
|
-
return ["did:test:friend"];
|
|
130
|
-
}
|
|
131
|
-
runtimeAddFriends(dids) {
|
|
132
|
-
return dids;
|
|
133
|
-
}
|
|
134
|
-
runtimeRemoveFriends(dids) {
|
|
135
|
-
return [];
|
|
136
|
-
}
|
|
137
|
-
runtimeHcAgentInfos() {
|
|
138
|
-
return JSON.stringify([{ "agent": { "type": "Buffer", "data": [9, 191, 231, 58, 255, 107, 202, 55, 206, 57, 9, 103, 17, 34, 206, 195, 207, 114, 5, 73, 77, 198, 56, 136, 17, 227, 242, 231, 194, 135, 128, 48, 170, 189, 119, 186] }, "signature": { "type": "Buffer", "data": [195, 143, 170, 36, 234, 123, 255, 85, 188, 138, 124, 2, 91, 18, 53, 231, 44, 41, 240, 8, 80, 131, 100, 150, 165, 125, 146, 90, 17, 200, 190, 129, 114, 211, 11, 146, 150, 128, 198, 199, 79, 118, 157, 101, 194, 68, 58, 245, 98, 182, 79, 139, 140, 41, 143, 129, 8, 136, 87, 77, 180, 231, 218, 11] }, "agent_info": { "type": "Buffer", "data": [134, 165, 115, 112, 97, 99, 101, 196, 36, 203, 165, 212, 173, 24, 215, 165, 196, 25, 145, 248, 113, 246, 139, 205, 182, 241, 138, 57, 0, 26, 8, 217, 179, 23, 126, 59, 136, 128, 213, 110, 225, 173, 72, 197, 95, 165, 97, 103, 101, 110, 116, 196, 36, 9, 191, 231, 58, 255, 107, 202, 55, 206, 57, 9, 103, 17, 34, 206, 195, 207, 114, 5, 73, 77, 198, 56, 136, 17, 227, 242, 231, 194, 135, 128, 48, 170, 189, 119, 186, 164, 117, 114, 108, 115, 145, 217, 99, 107, 105, 116, 115, 117, 110, 101, 45, 112, 114, 111, 120, 121, 58, 47, 47, 101, 83, 52, 86, 112, 54, 109, 118, 80, 48, 122, 116, 85, 101, 104, 114, 117, 113, 89, 52, 102, 66, 53, 101, 69, 98, 121, 48, 69, 66, 100, 89, 84, 50, 95, 67, 48, 69, 112, 77, 111, 76, 111, 47, 107, 105, 116, 115, 117, 110, 101, 45, 113, 117, 105, 99, 47, 104, 47, 49, 57, 50, 46, 49, 54, 56, 46, 49, 55, 56, 46, 54, 48, 47, 112, 47, 55, 55, 52, 52, 47, 45, 45, 172, 115, 105, 103, 110, 101, 100, 95, 97, 116, 95, 109, 115, 207, 0, 0, 1, 123, 233, 104, 189, 50, 176, 101, 120, 112, 105, 114, 101, 115, 95, 97, 102, 116, 101, 114, 95, 109, 115, 206, 0, 18, 79, 128, 169, 109, 101, 116, 97, 95, 105, 110, 102, 111, 196, 34, 129, 187, 100, 104, 116, 95, 115, 116, 111, 114, 97, 103, 101, 95, 97, 114, 99, 95, 104, 97, 108, 102, 95, 108, 101, 110, 103, 116, 104, 206, 128, 0, 0, 1] } }, { "agent": { "type": "Buffer", "data": [98, 187, 145, 48, 115, 209, 94, 143, 31, 153, 102, 69, 138, 29, 133, 213, 34, 52, 39, 164, 157, 139, 178, 111, 23, 33, 118, 250, 28, 155, 78, 246, 128, 49, 179, 38] }, "signature": { "type": "Buffer", "data": [233, 192, 38, 3, 59, 248, 124, 231, 57, 255, 40, 154, 50, 60, 119, 252, 68, 198, 154, 109, 175, 155, 106, 217, 211, 155, 109, 223, 249, 91, 221, 210, 17, 132, 72, 230, 11, 230, 247, 119, 72, 244, 145, 91, 75, 7, 67, 5, 130, 151, 44, 231, 52, 220, 28, 154, 212, 82, 58, 90, 203, 211, 236, 4] }, "agent_info": { "type": "Buffer", "data": [134, 165, 115, 112, 97, 99, 101, 196, 36, 203, 165, 212, 173, 24, 215, 165, 196, 25, 145, 248, 113, 246, 139, 205, 182, 241, 138, 57, 0, 26, 8, 217, 179, 23, 126, 59, 136, 128, 213, 110, 225, 173, 72, 197, 95, 165, 97, 103, 101, 110, 116, 196, 36, 98, 187, 145, 48, 115, 209, 94, 143, 31, 153, 102, 69, 138, 29, 133, 213, 34, 52, 39, 164, 157, 139, 178, 111, 23, 33, 118, 250, 28, 155, 78, 246, 128, 49, 179, 38, 164, 117, 114, 108, 115, 145, 217, 99, 107, 105, 116, 115, 117, 110, 101, 45, 112, 114, 111, 120, 121, 58, 47, 47, 55, 101, 77, 106, 48, 73, 83, 72, 56, 56, 81, 56, 45, 89, 51, 74, 89, 70, 53, 76, 72, 57, 83, 54, 68, 119, 71, 73, 49, 88, 45, 115, 87, 53, 68, 104, 66, 87, 121, 71, 119, 78, 115, 47, 107, 105, 116, 115, 117, 110, 101, 45, 113, 117, 105, 99, 47, 104, 47, 49, 57, 50, 46, 49, 54, 56, 46, 49, 55, 56, 46, 54, 48, 47, 112, 47, 55, 55, 52, 52, 47, 45, 45, 172, 115, 105, 103, 110, 101, 100, 95, 97, 116, 95, 109, 115, 207, 0, 0, 1, 123, 233, 103, 45, 197, 176, 101, 120, 112, 105, 114, 101, 115, 95, 97, 102, 116, 101, 114, 95, 109, 115, 206, 0, 18, 79, 128, 169, 109, 101, 116, 97, 95, 105, 110, 102, 111, 196, 34, 129, 187, 100, 104, 116, 95, 115, 116, 111, 114, 97, 103, 101, 95, 97, 114, 99, 95, 104, 97, 108, 102, 95, 108, 101, 110, 103, 116, 104, 206, 128, 0, 0, 1] } }, { "agent": { "type": "Buffer", "data": [181, 101, 115, 45, 214, 127, 198, 153, 159, 184, 30, 87, 67, 224, 208, 184, 203, 176, 130, 158, 236, 127, 153, 125, 243, 183, 188, 167, 154, 25, 118, 254, 101, 145, 210, 109] }, "signature": { "type": "Buffer", "data": [88, 189, 229, 122, 44, 171, 194, 156, 90, 79, 148, 49, 207, 224, 34, 199, 219, 88, 24, 243, 103, 127, 123, 41, 87, 171, 127, 92, 6, 216, 198, 171, 26, 226, 237, 217, 122, 78, 98, 146, 55, 255, 68, 240, 202, 83, 58, 140, 147, 185, 3, 66, 15, 216, 210, 22, 99, 197, 73, 234, 120, 17, 74, 1] }, "agent_info": { "type": "Buffer", "data": [134, 165, 115, 112, 97, 99, 101, 196, 36, 203, 165, 212, 173, 24, 215, 165, 196, 25, 145, 248, 113, 246, 139, 205, 182, 241, 138, 57, 0, 26, 8, 217, 179, 23, 126, 59, 136, 128, 213, 110, 225, 173, 72, 197, 95, 165, 97, 103, 101, 110, 116, 196, 36, 181, 101, 115, 45, 214, 127, 198, 153, 159, 184, 30, 87, 67, 224, 208, 184, 203, 176, 130, 158, 236, 127, 153, 125, 243, 183, 188, 167, 154, 25, 118, 254, 101, 145, 210, 109, 164, 117, 114, 108, 115, 145, 217, 99, 107, 105, 116, 115, 117, 110, 101, 45, 112, 114, 111, 120, 121, 58, 47, 47, 114, 70, 71, 83, 100, 113, 104, 101, 68, 107, 70, 70, 56, 69, 102, 109, 45, 69, 116, 55, 119, 81, 101, 120, 83, 88, 55, 65, 112, 69, 51, 89, 86, 99, 45, 120, 102, 52, 104, 106, 77, 115, 77, 47, 107, 105, 116, 115, 117, 110, 101, 45, 113, 117, 105, 99, 47, 104, 47, 49, 57, 50, 46, 49, 54, 56, 46, 49, 55, 56, 46, 54, 48, 47, 112, 47, 55, 55, 52, 52, 47, 45, 45, 172, 115, 105, 103, 110, 101, 100, 95, 97, 116, 95, 109, 115, 207, 0, 0, 1, 123, 233, 113, 23, 220, 176, 101, 120, 112, 105, 114, 101, 115, 95, 97, 102, 116, 101, 114, 95, 109, 115, 206, 0, 18, 79, 128, 169, 109, 101, 116, 97, 95, 105, 110, 102, 111, 196, 34, 129, 187, 100, 104, 116, 95, 115, 116, 111, 114, 97, 103, 101, 95, 97, 114, 99, 95, 104, 97, 108, 102, 95, 108, 101, 110, 103, 116, 104, 206, 128, 0, 0, 1] } }, { "agent": { "type": "Buffer", "data": [3, 171, 237, 107, 186, 245, 165, 47, 237, 235, 211, 49, 245, 62, 113, 53, 255, 252, 223, 226, 75, 118, 148, 187, 23, 53, 70, 174, 160, 184, 64, 63, 94, 210, 227, 56] }, "signature": { "type": "Buffer", "data": [129, 12, 55, 104, 239, 121, 138, 2, 86, 106, 136, 51, 219, 79, 170, 8, 195, 69, 81, 188, 225, 192, 247, 196, 54, 39, 164, 110, 75, 39, 240, 56, 245, 189, 154, 77, 72, 11, 97, 250, 202, 149, 242, 97, 128, 28, 47, 164, 236, 104, 136, 82, 212, 246, 44, 143, 132, 119, 255, 135, 112, 11, 20, 13] }, "agent_info": { "type": "Buffer", "data": [134, 165, 115, 112, 97, 99, 101, 196, 36, 203, 165, 212, 173, 24, 215, 165, 196, 25, 145, 248, 113, 246, 139, 205, 182, 241, 138, 57, 0, 26, 8, 217, 179, 23, 126, 59, 136, 128, 213, 110, 225, 173, 72, 197, 95, 165, 97, 103, 101, 110, 116, 196, 36, 3, 171, 237, 107, 186, 245, 165, 47, 237, 235, 211, 49, 245, 62, 113, 53, 255, 252, 223, 226, 75, 118, 148, 187, 23, 53, 70, 174, 160, 184, 64, 63, 94, 210, 227, 56, 164, 117, 114, 108, 115, 145, 217, 97, 107, 105, 116, 115, 117, 110, 101, 45, 112, 114, 111, 120, 121, 58, 47, 47, 104, 121, 112, 115, 86, 121, 103, 117, 80, 84, 115, 53, 118, 73, 80, 65, 102, 97, 112, 90, 88, 113, 117, 84, 115, 79, 80, 100, 67, 81, 79, 79, 117, 103, 57, 51, 82, 103, 106, 95, 114, 85, 73, 47, 107, 105, 116, 115, 117, 110, 101, 45, 113, 117, 105, 99, 47, 104, 47, 49, 54, 53, 46, 50, 50, 46, 51, 50, 46, 49, 49, 47, 112, 47, 53, 55, 55, 57, 47, 45, 45, 172, 115, 105, 103, 110, 101, 100, 95, 97, 116, 95, 109, 115, 207, 0, 0, 1, 123, 233, 113, 188, 123, 176, 101, 120, 112, 105, 114, 101, 115, 95, 97, 102, 116, 101, 114, 95, 109, 115, 206, 0, 18, 79, 128, 169, 109, 101, 116, 97, 95, 105, 110, 102, 111, 196, 34, 129, 187, 100, 104, 116, 95, 115, 116, 111, 114, 97, 103, 101, 95, 97, 114, 99, 95, 104, 97, 108, 102, 95, 108, 101, 110, 103, 116, 104, 206, 128, 0, 0, 1] } }]);
|
|
139
|
-
}
|
|
140
|
-
runtimeHcAddAgentInfos(agentInfos) {
|
|
141
|
-
return true;
|
|
142
|
-
}
|
|
143
|
-
runtimeVerifyStringSignedByDid(did, didSigningKeyId, data, signedData) {
|
|
144
|
-
return true;
|
|
145
|
-
}
|
|
146
|
-
runtimeSetStatus(status) {
|
|
147
|
-
return true;
|
|
148
|
-
}
|
|
149
|
-
runtimeFriendStatus(did) {
|
|
150
|
-
return testPerspectiveExpression;
|
|
151
|
-
}
|
|
152
|
-
runtimeFriendSendMessage(did, message) {
|
|
153
|
-
return true;
|
|
154
|
-
}
|
|
155
|
-
runtimeMessageInbox(filter) {
|
|
156
|
-
return [testPerspectiveExpression];
|
|
157
|
-
}
|
|
158
|
-
runtimeMessageOutbox(filter) {
|
|
159
|
-
return [{
|
|
160
|
-
recipient: "did:test:recipient",
|
|
161
|
-
message: testPerspectiveExpression
|
|
162
|
-
}];
|
|
163
|
-
}
|
|
164
|
-
runtimeMessageReceived() {
|
|
165
|
-
return testPerspectiveExpression;
|
|
166
|
-
}
|
|
167
|
-
exceptionOccurred() {
|
|
168
|
-
return {
|
|
169
|
-
title: "Test title",
|
|
170
|
-
message: "Test message",
|
|
171
|
-
type: ExceptionType.LanguageIsNotLoaded,
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
};
|
|
175
|
-
__decorate([
|
|
176
|
-
Mutation(returns => Boolean),
|
|
177
|
-
__metadata("design:type", Function),
|
|
178
|
-
__metadata("design:paramtypes", []),
|
|
179
|
-
__metadata("design:returntype", Boolean)
|
|
180
|
-
], RuntimeResolver.prototype, "runtimeQuit", null);
|
|
181
|
-
__decorate([
|
|
182
|
-
Mutation(returns => Boolean),
|
|
183
|
-
__param(0, Arg('url')),
|
|
184
|
-
__metadata("design:type", Function),
|
|
185
|
-
__metadata("design:paramtypes", [String]),
|
|
186
|
-
__metadata("design:returntype", Boolean)
|
|
187
|
-
], RuntimeResolver.prototype, "runtimeOpenLink", null);
|
|
188
|
-
__decorate([
|
|
189
|
-
Query(returns => RuntimeInfo),
|
|
190
|
-
__metadata("design:type", Function),
|
|
191
|
-
__metadata("design:paramtypes", []),
|
|
192
|
-
__metadata("design:returntype", RuntimeInfo)
|
|
193
|
-
], RuntimeResolver.prototype, "runtimeInfo", null);
|
|
194
|
-
__decorate([
|
|
195
|
-
Mutation(returns => [String]),
|
|
196
|
-
__param(0, Arg("agents", type => [String])),
|
|
197
|
-
__metadata("design:type", Function),
|
|
198
|
-
__metadata("design:paramtypes", [Array]),
|
|
199
|
-
__metadata("design:returntype", Array)
|
|
200
|
-
], RuntimeResolver.prototype, "addTrustedAgents", null);
|
|
201
|
-
__decorate([
|
|
202
|
-
Mutation(returns => [String]),
|
|
203
|
-
__param(0, Arg("agents", type => [String])),
|
|
204
|
-
__metadata("design:type", Function),
|
|
205
|
-
__metadata("design:paramtypes", [Array]),
|
|
206
|
-
__metadata("design:returntype", Array)
|
|
207
|
-
], RuntimeResolver.prototype, "deleteTrustedAgents", null);
|
|
208
|
-
__decorate([
|
|
209
|
-
Query(returns => [String]),
|
|
210
|
-
__metadata("design:type", Function),
|
|
211
|
-
__metadata("design:paramtypes", []),
|
|
212
|
-
__metadata("design:returntype", Array)
|
|
213
|
-
], RuntimeResolver.prototype, "getTrustedAgents", null);
|
|
214
|
-
__decorate([
|
|
215
|
-
Query(returns => [String]),
|
|
216
|
-
__metadata("design:type", Function),
|
|
217
|
-
__metadata("design:paramtypes", []),
|
|
218
|
-
__metadata("design:returntype", Array)
|
|
219
|
-
], RuntimeResolver.prototype, "runtimeKnownLinkLanguageTemplates", null);
|
|
220
|
-
__decorate([
|
|
221
|
-
Mutation(returns => [String]),
|
|
222
|
-
__param(0, Arg("addresses", type => [String])),
|
|
223
|
-
__metadata("design:type", Function),
|
|
224
|
-
__metadata("design:paramtypes", [Array]),
|
|
225
|
-
__metadata("design:returntype", Array)
|
|
226
|
-
], RuntimeResolver.prototype, "runtimeAddKnownLinkLanguageTemplates", null);
|
|
227
|
-
__decorate([
|
|
228
|
-
Mutation(returns => [String]),
|
|
229
|
-
__param(0, Arg("addresses", type => [String])),
|
|
230
|
-
__metadata("design:type", Function),
|
|
231
|
-
__metadata("design:paramtypes", [Array]),
|
|
232
|
-
__metadata("design:returntype", Array)
|
|
233
|
-
], RuntimeResolver.prototype, "runtimeRemoveKnownLinkLanguageTemplates", null);
|
|
234
|
-
__decorate([
|
|
235
|
-
Query(returns => [String]),
|
|
236
|
-
__metadata("design:type", Function),
|
|
237
|
-
__metadata("design:paramtypes", []),
|
|
238
|
-
__metadata("design:returntype", Array)
|
|
239
|
-
], RuntimeResolver.prototype, "runtimeFriends", null);
|
|
240
|
-
__decorate([
|
|
241
|
-
Mutation(returns => [String]),
|
|
242
|
-
__param(0, Arg("dids", type => [String])),
|
|
243
|
-
__metadata("design:type", Function),
|
|
244
|
-
__metadata("design:paramtypes", [Array]),
|
|
245
|
-
__metadata("design:returntype", Array)
|
|
246
|
-
], RuntimeResolver.prototype, "runtimeAddFriends", null);
|
|
247
|
-
__decorate([
|
|
248
|
-
Mutation(returns => [String]),
|
|
249
|
-
__param(0, Arg("dids", type => [String])),
|
|
250
|
-
__metadata("design:type", Function),
|
|
251
|
-
__metadata("design:paramtypes", [Array]),
|
|
252
|
-
__metadata("design:returntype", Array)
|
|
253
|
-
], RuntimeResolver.prototype, "runtimeRemoveFriends", null);
|
|
254
|
-
__decorate([
|
|
255
|
-
Query(),
|
|
256
|
-
__metadata("design:type", Function),
|
|
257
|
-
__metadata("design:paramtypes", []),
|
|
258
|
-
__metadata("design:returntype", String)
|
|
259
|
-
], RuntimeResolver.prototype, "runtimeHcAgentInfos", null);
|
|
260
|
-
__decorate([
|
|
261
|
-
Mutation(returns => Boolean),
|
|
262
|
-
__param(0, Arg("agentInfos", type => String)),
|
|
263
|
-
__metadata("design:type", Function),
|
|
264
|
-
__metadata("design:paramtypes", [Object]),
|
|
265
|
-
__metadata("design:returntype", Boolean)
|
|
266
|
-
], RuntimeResolver.prototype, "runtimeHcAddAgentInfos", null);
|
|
267
|
-
__decorate([
|
|
268
|
-
Query(returns => Boolean),
|
|
269
|
-
__param(0, Arg("did", type => String)),
|
|
270
|
-
__param(1, Arg("didSigningKeyId", type => String)),
|
|
271
|
-
__param(2, Arg("data", type => String)),
|
|
272
|
-
__param(3, Arg("signedData", type => String)),
|
|
273
|
-
__metadata("design:type", Function),
|
|
274
|
-
__metadata("design:paramtypes", [String, String, String, String]),
|
|
275
|
-
__metadata("design:returntype", void 0)
|
|
276
|
-
], RuntimeResolver.prototype, "runtimeVerifyStringSignedByDid", null);
|
|
277
|
-
__decorate([
|
|
278
|
-
Mutation(),
|
|
279
|
-
__param(0, Arg("status", type => PerspectiveInput)),
|
|
280
|
-
__metadata("design:type", Function),
|
|
281
|
-
__metadata("design:paramtypes", [Perspective]),
|
|
282
|
-
__metadata("design:returntype", Boolean)
|
|
283
|
-
], RuntimeResolver.prototype, "runtimeSetStatus", null);
|
|
284
|
-
__decorate([
|
|
285
|
-
Query({ nullable: true }),
|
|
286
|
-
__param(0, Arg("did", type => String)),
|
|
287
|
-
__metadata("design:type", Function),
|
|
288
|
-
__metadata("design:paramtypes", [String]),
|
|
289
|
-
__metadata("design:returntype", PerspectiveExpression)
|
|
290
|
-
], RuntimeResolver.prototype, "runtimeFriendStatus", null);
|
|
291
|
-
__decorate([
|
|
292
|
-
Mutation(),
|
|
293
|
-
__param(0, Arg("did", type => String)),
|
|
294
|
-
__param(1, Arg("message", type => PerspectiveInput)),
|
|
295
|
-
__metadata("design:type", Function),
|
|
296
|
-
__metadata("design:paramtypes", [String, PerspectiveInput]),
|
|
297
|
-
__metadata("design:returntype", Boolean)
|
|
298
|
-
], RuntimeResolver.prototype, "runtimeFriendSendMessage", null);
|
|
299
|
-
__decorate([
|
|
300
|
-
Query(returns => [PerspectiveExpression]),
|
|
301
|
-
__param(0, Arg("filter", type => String, { nullable: true })),
|
|
302
|
-
__metadata("design:type", Function),
|
|
303
|
-
__metadata("design:paramtypes", [String]),
|
|
304
|
-
__metadata("design:returntype", Array)
|
|
305
|
-
], RuntimeResolver.prototype, "runtimeMessageInbox", null);
|
|
306
|
-
__decorate([
|
|
307
|
-
Query(returns => [SentMessage]),
|
|
308
|
-
__param(0, Arg("filter", type => String, { nullable: true })),
|
|
309
|
-
__metadata("design:type", Function),
|
|
310
|
-
__metadata("design:paramtypes", [String]),
|
|
311
|
-
__metadata("design:returntype", Array)
|
|
312
|
-
], RuntimeResolver.prototype, "runtimeMessageOutbox", null);
|
|
313
|
-
__decorate([
|
|
314
|
-
Subscription({ topics: RUNTIME_MESSAGED_RECEIVED_TOPIC, nullable: true }),
|
|
315
|
-
__metadata("design:type", Function),
|
|
316
|
-
__metadata("design:paramtypes", []),
|
|
317
|
-
__metadata("design:returntype", PerspectiveExpression)
|
|
318
|
-
], RuntimeResolver.prototype, "runtimeMessageReceived", null);
|
|
319
|
-
__decorate([
|
|
320
|
-
Subscription({ topics: EXCEPTION_OCCURRED_TOPIC, nullable: true }),
|
|
321
|
-
__metadata("design:type", Function),
|
|
322
|
-
__metadata("design:paramtypes", []),
|
|
323
|
-
__metadata("design:returntype", ExceptionInfo)
|
|
324
|
-
], RuntimeResolver.prototype, "exceptionOccurred", null);
|
|
325
|
-
RuntimeResolver = __decorate([
|
|
326
|
-
Resolver()
|
|
327
|
-
], RuntimeResolver);
|
|
328
|
-
export default RuntimeResolver;
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
+
};
|
|
13
|
+
import { Arg, Mutation, Resolver, Query, Subscription, ObjectType, Field } from "type-graphql";
|
|
14
|
+
import { Perspective, PerspectiveExpression, PerspectiveInput } from "../perspectives/Perspective";
|
|
15
|
+
import { ExpressionProof } from "../expression/Expression";
|
|
16
|
+
import { LinkExpression } from "../links/Links";
|
|
17
|
+
import { ExceptionType } from "../Exception";
|
|
18
|
+
import { RUNTIME_MESSAGED_RECEIVED_TOPIC, EXCEPTION_OCCURRED_TOPIC } from '../PubSub';
|
|
19
|
+
const testLink = new LinkExpression();
|
|
20
|
+
testLink.author = "did:ad4m:test";
|
|
21
|
+
testLink.timestamp = Date.now();
|
|
22
|
+
testLink.data = {
|
|
23
|
+
source: 'root',
|
|
24
|
+
target: 'neighbourhood://Qm12345'
|
|
25
|
+
};
|
|
26
|
+
testLink.proof = {
|
|
27
|
+
signature: '',
|
|
28
|
+
key: '',
|
|
29
|
+
valid: true
|
|
30
|
+
};
|
|
31
|
+
const testPerspectiveExpression = new PerspectiveExpression();
|
|
32
|
+
testPerspectiveExpression.author = 'did:ad4m:test';
|
|
33
|
+
testPerspectiveExpression.timestamp = Date.now().toString();
|
|
34
|
+
testPerspectiveExpression.proof = new ExpressionProof('', '');
|
|
35
|
+
testPerspectiveExpression.data = new Perspective([testLink]);
|
|
36
|
+
let SentMessage = class SentMessage {
|
|
37
|
+
};
|
|
38
|
+
__decorate([
|
|
39
|
+
Field(),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], SentMessage.prototype, "recipient", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
Field(),
|
|
44
|
+
__metadata("design:type", PerspectiveExpression)
|
|
45
|
+
], SentMessage.prototype, "message", void 0);
|
|
46
|
+
SentMessage = __decorate([
|
|
47
|
+
ObjectType()
|
|
48
|
+
], SentMessage);
|
|
49
|
+
export { SentMessage };
|
|
50
|
+
let RuntimeInfo = class RuntimeInfo {
|
|
51
|
+
};
|
|
52
|
+
__decorate([
|
|
53
|
+
Field(),
|
|
54
|
+
__metadata("design:type", String)
|
|
55
|
+
], RuntimeInfo.prototype, "ad4mExecutorVersion", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
Field(),
|
|
58
|
+
__metadata("design:type", Boolean)
|
|
59
|
+
], RuntimeInfo.prototype, "isInitialized", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
Field(),
|
|
62
|
+
__metadata("design:type", Boolean)
|
|
63
|
+
], RuntimeInfo.prototype, "isUnlocked", void 0);
|
|
64
|
+
RuntimeInfo = __decorate([
|
|
65
|
+
ObjectType()
|
|
66
|
+
], RuntimeInfo);
|
|
67
|
+
export { RuntimeInfo };
|
|
68
|
+
let ExceptionInfo = class ExceptionInfo {
|
|
69
|
+
};
|
|
70
|
+
__decorate([
|
|
71
|
+
Field(),
|
|
72
|
+
__metadata("design:type", String)
|
|
73
|
+
], ExceptionInfo.prototype, "title", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
Field(),
|
|
76
|
+
__metadata("design:type", String)
|
|
77
|
+
], ExceptionInfo.prototype, "message", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
Field(),
|
|
80
|
+
__metadata("design:type", Number)
|
|
81
|
+
], ExceptionInfo.prototype, "type", void 0);
|
|
82
|
+
__decorate([
|
|
83
|
+
Field({ nullable: true }),
|
|
84
|
+
__metadata("design:type", String)
|
|
85
|
+
], ExceptionInfo.prototype, "addon", void 0);
|
|
86
|
+
ExceptionInfo = __decorate([
|
|
87
|
+
ObjectType()
|
|
88
|
+
], ExceptionInfo);
|
|
89
|
+
export { ExceptionInfo };
|
|
90
|
+
/**
|
|
91
|
+
* Resolver classes are used here to define the GraphQL schema
|
|
92
|
+
* (through the type-graphql annotations)
|
|
93
|
+
* and are spawned in the client tests in Ad4mClient.test.ts.
|
|
94
|
+
* For the latter, they return test fixtures.
|
|
95
|
+
*/
|
|
96
|
+
let RuntimeResolver = class RuntimeResolver {
|
|
97
|
+
runtimeQuit() {
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
runtimeOpenLink(url) {
|
|
101
|
+
return true;
|
|
102
|
+
}
|
|
103
|
+
runtimeInfo() {
|
|
104
|
+
return {
|
|
105
|
+
ad4mExecutorVersion: "x.x.x",
|
|
106
|
+
isInitialized: true,
|
|
107
|
+
isUnlocked: true
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
addTrustedAgents(agents) {
|
|
111
|
+
return agents;
|
|
112
|
+
}
|
|
113
|
+
deleteTrustedAgents(agents) {
|
|
114
|
+
return [];
|
|
115
|
+
}
|
|
116
|
+
getTrustedAgents() {
|
|
117
|
+
return ["agentPubKey"];
|
|
118
|
+
}
|
|
119
|
+
runtimeKnownLinkLanguageTemplates() {
|
|
120
|
+
return ["Qm12345abcdef"];
|
|
121
|
+
}
|
|
122
|
+
runtimeAddKnownLinkLanguageTemplates(addresses) {
|
|
123
|
+
return addresses;
|
|
124
|
+
}
|
|
125
|
+
runtimeRemoveKnownLinkLanguageTemplates(addresses) {
|
|
126
|
+
return [];
|
|
127
|
+
}
|
|
128
|
+
runtimeFriends() {
|
|
129
|
+
return ["did:test:friend"];
|
|
130
|
+
}
|
|
131
|
+
runtimeAddFriends(dids) {
|
|
132
|
+
return dids;
|
|
133
|
+
}
|
|
134
|
+
runtimeRemoveFriends(dids) {
|
|
135
|
+
return [];
|
|
136
|
+
}
|
|
137
|
+
runtimeHcAgentInfos() {
|
|
138
|
+
return JSON.stringify([{ "agent": { "type": "Buffer", "data": [9, 191, 231, 58, 255, 107, 202, 55, 206, 57, 9, 103, 17, 34, 206, 195, 207, 114, 5, 73, 77, 198, 56, 136, 17, 227, 242, 231, 194, 135, 128, 48, 170, 189, 119, 186] }, "signature": { "type": "Buffer", "data": [195, 143, 170, 36, 234, 123, 255, 85, 188, 138, 124, 2, 91, 18, 53, 231, 44, 41, 240, 8, 80, 131, 100, 150, 165, 125, 146, 90, 17, 200, 190, 129, 114, 211, 11, 146, 150, 128, 198, 199, 79, 118, 157, 101, 194, 68, 58, 245, 98, 182, 79, 139, 140, 41, 143, 129, 8, 136, 87, 77, 180, 231, 218, 11] }, "agent_info": { "type": "Buffer", "data": [134, 165, 115, 112, 97, 99, 101, 196, 36, 203, 165, 212, 173, 24, 215, 165, 196, 25, 145, 248, 113, 246, 139, 205, 182, 241, 138, 57, 0, 26, 8, 217, 179, 23, 126, 59, 136, 128, 213, 110, 225, 173, 72, 197, 95, 165, 97, 103, 101, 110, 116, 196, 36, 9, 191, 231, 58, 255, 107, 202, 55, 206, 57, 9, 103, 17, 34, 206, 195, 207, 114, 5, 73, 77, 198, 56, 136, 17, 227, 242, 231, 194, 135, 128, 48, 170, 189, 119, 186, 164, 117, 114, 108, 115, 145, 217, 99, 107, 105, 116, 115, 117, 110, 101, 45, 112, 114, 111, 120, 121, 58, 47, 47, 101, 83, 52, 86, 112, 54, 109, 118, 80, 48, 122, 116, 85, 101, 104, 114, 117, 113, 89, 52, 102, 66, 53, 101, 69, 98, 121, 48, 69, 66, 100, 89, 84, 50, 95, 67, 48, 69, 112, 77, 111, 76, 111, 47, 107, 105, 116, 115, 117, 110, 101, 45, 113, 117, 105, 99, 47, 104, 47, 49, 57, 50, 46, 49, 54, 56, 46, 49, 55, 56, 46, 54, 48, 47, 112, 47, 55, 55, 52, 52, 47, 45, 45, 172, 115, 105, 103, 110, 101, 100, 95, 97, 116, 95, 109, 115, 207, 0, 0, 1, 123, 233, 104, 189, 50, 176, 101, 120, 112, 105, 114, 101, 115, 95, 97, 102, 116, 101, 114, 95, 109, 115, 206, 0, 18, 79, 128, 169, 109, 101, 116, 97, 95, 105, 110, 102, 111, 196, 34, 129, 187, 100, 104, 116, 95, 115, 116, 111, 114, 97, 103, 101, 95, 97, 114, 99, 95, 104, 97, 108, 102, 95, 108, 101, 110, 103, 116, 104, 206, 128, 0, 0, 1] } }, { "agent": { "type": "Buffer", "data": [98, 187, 145, 48, 115, 209, 94, 143, 31, 153, 102, 69, 138, 29, 133, 213, 34, 52, 39, 164, 157, 139, 178, 111, 23, 33, 118, 250, 28, 155, 78, 246, 128, 49, 179, 38] }, "signature": { "type": "Buffer", "data": [233, 192, 38, 3, 59, 248, 124, 231, 57, 255, 40, 154, 50, 60, 119, 252, 68, 198, 154, 109, 175, 155, 106, 217, 211, 155, 109, 223, 249, 91, 221, 210, 17, 132, 72, 230, 11, 230, 247, 119, 72, 244, 145, 91, 75, 7, 67, 5, 130, 151, 44, 231, 52, 220, 28, 154, 212, 82, 58, 90, 203, 211, 236, 4] }, "agent_info": { "type": "Buffer", "data": [134, 165, 115, 112, 97, 99, 101, 196, 36, 203, 165, 212, 173, 24, 215, 165, 196, 25, 145, 248, 113, 246, 139, 205, 182, 241, 138, 57, 0, 26, 8, 217, 179, 23, 126, 59, 136, 128, 213, 110, 225, 173, 72, 197, 95, 165, 97, 103, 101, 110, 116, 196, 36, 98, 187, 145, 48, 115, 209, 94, 143, 31, 153, 102, 69, 138, 29, 133, 213, 34, 52, 39, 164, 157, 139, 178, 111, 23, 33, 118, 250, 28, 155, 78, 246, 128, 49, 179, 38, 164, 117, 114, 108, 115, 145, 217, 99, 107, 105, 116, 115, 117, 110, 101, 45, 112, 114, 111, 120, 121, 58, 47, 47, 55, 101, 77, 106, 48, 73, 83, 72, 56, 56, 81, 56, 45, 89, 51, 74, 89, 70, 53, 76, 72, 57, 83, 54, 68, 119, 71, 73, 49, 88, 45, 115, 87, 53, 68, 104, 66, 87, 121, 71, 119, 78, 115, 47, 107, 105, 116, 115, 117, 110, 101, 45, 113, 117, 105, 99, 47, 104, 47, 49, 57, 50, 46, 49, 54, 56, 46, 49, 55, 56, 46, 54, 48, 47, 112, 47, 55, 55, 52, 52, 47, 45, 45, 172, 115, 105, 103, 110, 101, 100, 95, 97, 116, 95, 109, 115, 207, 0, 0, 1, 123, 233, 103, 45, 197, 176, 101, 120, 112, 105, 114, 101, 115, 95, 97, 102, 116, 101, 114, 95, 109, 115, 206, 0, 18, 79, 128, 169, 109, 101, 116, 97, 95, 105, 110, 102, 111, 196, 34, 129, 187, 100, 104, 116, 95, 115, 116, 111, 114, 97, 103, 101, 95, 97, 114, 99, 95, 104, 97, 108, 102, 95, 108, 101, 110, 103, 116, 104, 206, 128, 0, 0, 1] } }, { "agent": { "type": "Buffer", "data": [181, 101, 115, 45, 214, 127, 198, 153, 159, 184, 30, 87, 67, 224, 208, 184, 203, 176, 130, 158, 236, 127, 153, 125, 243, 183, 188, 167, 154, 25, 118, 254, 101, 145, 210, 109] }, "signature": { "type": "Buffer", "data": [88, 189, 229, 122, 44, 171, 194, 156, 90, 79, 148, 49, 207, 224, 34, 199, 219, 88, 24, 243, 103, 127, 123, 41, 87, 171, 127, 92, 6, 216, 198, 171, 26, 226, 237, 217, 122, 78, 98, 146, 55, 255, 68, 240, 202, 83, 58, 140, 147, 185, 3, 66, 15, 216, 210, 22, 99, 197, 73, 234, 120, 17, 74, 1] }, "agent_info": { "type": "Buffer", "data": [134, 165, 115, 112, 97, 99, 101, 196, 36, 203, 165, 212, 173, 24, 215, 165, 196, 25, 145, 248, 113, 246, 139, 205, 182, 241, 138, 57, 0, 26, 8, 217, 179, 23, 126, 59, 136, 128, 213, 110, 225, 173, 72, 197, 95, 165, 97, 103, 101, 110, 116, 196, 36, 181, 101, 115, 45, 214, 127, 198, 153, 159, 184, 30, 87, 67, 224, 208, 184, 203, 176, 130, 158, 236, 127, 153, 125, 243, 183, 188, 167, 154, 25, 118, 254, 101, 145, 210, 109, 164, 117, 114, 108, 115, 145, 217, 99, 107, 105, 116, 115, 117, 110, 101, 45, 112, 114, 111, 120, 121, 58, 47, 47, 114, 70, 71, 83, 100, 113, 104, 101, 68, 107, 70, 70, 56, 69, 102, 109, 45, 69, 116, 55, 119, 81, 101, 120, 83, 88, 55, 65, 112, 69, 51, 89, 86, 99, 45, 120, 102, 52, 104, 106, 77, 115, 77, 47, 107, 105, 116, 115, 117, 110, 101, 45, 113, 117, 105, 99, 47, 104, 47, 49, 57, 50, 46, 49, 54, 56, 46, 49, 55, 56, 46, 54, 48, 47, 112, 47, 55, 55, 52, 52, 47, 45, 45, 172, 115, 105, 103, 110, 101, 100, 95, 97, 116, 95, 109, 115, 207, 0, 0, 1, 123, 233, 113, 23, 220, 176, 101, 120, 112, 105, 114, 101, 115, 95, 97, 102, 116, 101, 114, 95, 109, 115, 206, 0, 18, 79, 128, 169, 109, 101, 116, 97, 95, 105, 110, 102, 111, 196, 34, 129, 187, 100, 104, 116, 95, 115, 116, 111, 114, 97, 103, 101, 95, 97, 114, 99, 95, 104, 97, 108, 102, 95, 108, 101, 110, 103, 116, 104, 206, 128, 0, 0, 1] } }, { "agent": { "type": "Buffer", "data": [3, 171, 237, 107, 186, 245, 165, 47, 237, 235, 211, 49, 245, 62, 113, 53, 255, 252, 223, 226, 75, 118, 148, 187, 23, 53, 70, 174, 160, 184, 64, 63, 94, 210, 227, 56] }, "signature": { "type": "Buffer", "data": [129, 12, 55, 104, 239, 121, 138, 2, 86, 106, 136, 51, 219, 79, 170, 8, 195, 69, 81, 188, 225, 192, 247, 196, 54, 39, 164, 110, 75, 39, 240, 56, 245, 189, 154, 77, 72, 11, 97, 250, 202, 149, 242, 97, 128, 28, 47, 164, 236, 104, 136, 82, 212, 246, 44, 143, 132, 119, 255, 135, 112, 11, 20, 13] }, "agent_info": { "type": "Buffer", "data": [134, 165, 115, 112, 97, 99, 101, 196, 36, 203, 165, 212, 173, 24, 215, 165, 196, 25, 145, 248, 113, 246, 139, 205, 182, 241, 138, 57, 0, 26, 8, 217, 179, 23, 126, 59, 136, 128, 213, 110, 225, 173, 72, 197, 95, 165, 97, 103, 101, 110, 116, 196, 36, 3, 171, 237, 107, 186, 245, 165, 47, 237, 235, 211, 49, 245, 62, 113, 53, 255, 252, 223, 226, 75, 118, 148, 187, 23, 53, 70, 174, 160, 184, 64, 63, 94, 210, 227, 56, 164, 117, 114, 108, 115, 145, 217, 97, 107, 105, 116, 115, 117, 110, 101, 45, 112, 114, 111, 120, 121, 58, 47, 47, 104, 121, 112, 115, 86, 121, 103, 117, 80, 84, 115, 53, 118, 73, 80, 65, 102, 97, 112, 90, 88, 113, 117, 84, 115, 79, 80, 100, 67, 81, 79, 79, 117, 103, 57, 51, 82, 103, 106, 95, 114, 85, 73, 47, 107, 105, 116, 115, 117, 110, 101, 45, 113, 117, 105, 99, 47, 104, 47, 49, 54, 53, 46, 50, 50, 46, 51, 50, 46, 49, 49, 47, 112, 47, 53, 55, 55, 57, 47, 45, 45, 172, 115, 105, 103, 110, 101, 100, 95, 97, 116, 95, 109, 115, 207, 0, 0, 1, 123, 233, 113, 188, 123, 176, 101, 120, 112, 105, 114, 101, 115, 95, 97, 102, 116, 101, 114, 95, 109, 115, 206, 0, 18, 79, 128, 169, 109, 101, 116, 97, 95, 105, 110, 102, 111, 196, 34, 129, 187, 100, 104, 116, 95, 115, 116, 111, 114, 97, 103, 101, 95, 97, 114, 99, 95, 104, 97, 108, 102, 95, 108, 101, 110, 103, 116, 104, 206, 128, 0, 0, 1] } }]);
|
|
139
|
+
}
|
|
140
|
+
runtimeHcAddAgentInfos(agentInfos) {
|
|
141
|
+
return true;
|
|
142
|
+
}
|
|
143
|
+
runtimeVerifyStringSignedByDid(did, didSigningKeyId, data, signedData) {
|
|
144
|
+
return true;
|
|
145
|
+
}
|
|
146
|
+
runtimeSetStatus(status) {
|
|
147
|
+
return true;
|
|
148
|
+
}
|
|
149
|
+
runtimeFriendStatus(did) {
|
|
150
|
+
return testPerspectiveExpression;
|
|
151
|
+
}
|
|
152
|
+
runtimeFriendSendMessage(did, message) {
|
|
153
|
+
return true;
|
|
154
|
+
}
|
|
155
|
+
runtimeMessageInbox(filter) {
|
|
156
|
+
return [testPerspectiveExpression];
|
|
157
|
+
}
|
|
158
|
+
runtimeMessageOutbox(filter) {
|
|
159
|
+
return [{
|
|
160
|
+
recipient: "did:test:recipient",
|
|
161
|
+
message: testPerspectiveExpression
|
|
162
|
+
}];
|
|
163
|
+
}
|
|
164
|
+
runtimeMessageReceived() {
|
|
165
|
+
return testPerspectiveExpression;
|
|
166
|
+
}
|
|
167
|
+
exceptionOccurred() {
|
|
168
|
+
return {
|
|
169
|
+
title: "Test title",
|
|
170
|
+
message: "Test message",
|
|
171
|
+
type: ExceptionType.LanguageIsNotLoaded,
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
__decorate([
|
|
176
|
+
Mutation(returns => Boolean),
|
|
177
|
+
__metadata("design:type", Function),
|
|
178
|
+
__metadata("design:paramtypes", []),
|
|
179
|
+
__metadata("design:returntype", Boolean)
|
|
180
|
+
], RuntimeResolver.prototype, "runtimeQuit", null);
|
|
181
|
+
__decorate([
|
|
182
|
+
Mutation(returns => Boolean),
|
|
183
|
+
__param(0, Arg('url')),
|
|
184
|
+
__metadata("design:type", Function),
|
|
185
|
+
__metadata("design:paramtypes", [String]),
|
|
186
|
+
__metadata("design:returntype", Boolean)
|
|
187
|
+
], RuntimeResolver.prototype, "runtimeOpenLink", null);
|
|
188
|
+
__decorate([
|
|
189
|
+
Query(returns => RuntimeInfo),
|
|
190
|
+
__metadata("design:type", Function),
|
|
191
|
+
__metadata("design:paramtypes", []),
|
|
192
|
+
__metadata("design:returntype", RuntimeInfo)
|
|
193
|
+
], RuntimeResolver.prototype, "runtimeInfo", null);
|
|
194
|
+
__decorate([
|
|
195
|
+
Mutation(returns => [String]),
|
|
196
|
+
__param(0, Arg("agents", type => [String])),
|
|
197
|
+
__metadata("design:type", Function),
|
|
198
|
+
__metadata("design:paramtypes", [Array]),
|
|
199
|
+
__metadata("design:returntype", Array)
|
|
200
|
+
], RuntimeResolver.prototype, "addTrustedAgents", null);
|
|
201
|
+
__decorate([
|
|
202
|
+
Mutation(returns => [String]),
|
|
203
|
+
__param(0, Arg("agents", type => [String])),
|
|
204
|
+
__metadata("design:type", Function),
|
|
205
|
+
__metadata("design:paramtypes", [Array]),
|
|
206
|
+
__metadata("design:returntype", Array)
|
|
207
|
+
], RuntimeResolver.prototype, "deleteTrustedAgents", null);
|
|
208
|
+
__decorate([
|
|
209
|
+
Query(returns => [String]),
|
|
210
|
+
__metadata("design:type", Function),
|
|
211
|
+
__metadata("design:paramtypes", []),
|
|
212
|
+
__metadata("design:returntype", Array)
|
|
213
|
+
], RuntimeResolver.prototype, "getTrustedAgents", null);
|
|
214
|
+
__decorate([
|
|
215
|
+
Query(returns => [String]),
|
|
216
|
+
__metadata("design:type", Function),
|
|
217
|
+
__metadata("design:paramtypes", []),
|
|
218
|
+
__metadata("design:returntype", Array)
|
|
219
|
+
], RuntimeResolver.prototype, "runtimeKnownLinkLanguageTemplates", null);
|
|
220
|
+
__decorate([
|
|
221
|
+
Mutation(returns => [String]),
|
|
222
|
+
__param(0, Arg("addresses", type => [String])),
|
|
223
|
+
__metadata("design:type", Function),
|
|
224
|
+
__metadata("design:paramtypes", [Array]),
|
|
225
|
+
__metadata("design:returntype", Array)
|
|
226
|
+
], RuntimeResolver.prototype, "runtimeAddKnownLinkLanguageTemplates", null);
|
|
227
|
+
__decorate([
|
|
228
|
+
Mutation(returns => [String]),
|
|
229
|
+
__param(0, Arg("addresses", type => [String])),
|
|
230
|
+
__metadata("design:type", Function),
|
|
231
|
+
__metadata("design:paramtypes", [Array]),
|
|
232
|
+
__metadata("design:returntype", Array)
|
|
233
|
+
], RuntimeResolver.prototype, "runtimeRemoveKnownLinkLanguageTemplates", null);
|
|
234
|
+
__decorate([
|
|
235
|
+
Query(returns => [String]),
|
|
236
|
+
__metadata("design:type", Function),
|
|
237
|
+
__metadata("design:paramtypes", []),
|
|
238
|
+
__metadata("design:returntype", Array)
|
|
239
|
+
], RuntimeResolver.prototype, "runtimeFriends", null);
|
|
240
|
+
__decorate([
|
|
241
|
+
Mutation(returns => [String]),
|
|
242
|
+
__param(0, Arg("dids", type => [String])),
|
|
243
|
+
__metadata("design:type", Function),
|
|
244
|
+
__metadata("design:paramtypes", [Array]),
|
|
245
|
+
__metadata("design:returntype", Array)
|
|
246
|
+
], RuntimeResolver.prototype, "runtimeAddFriends", null);
|
|
247
|
+
__decorate([
|
|
248
|
+
Mutation(returns => [String]),
|
|
249
|
+
__param(0, Arg("dids", type => [String])),
|
|
250
|
+
__metadata("design:type", Function),
|
|
251
|
+
__metadata("design:paramtypes", [Array]),
|
|
252
|
+
__metadata("design:returntype", Array)
|
|
253
|
+
], RuntimeResolver.prototype, "runtimeRemoveFriends", null);
|
|
254
|
+
__decorate([
|
|
255
|
+
Query(),
|
|
256
|
+
__metadata("design:type", Function),
|
|
257
|
+
__metadata("design:paramtypes", []),
|
|
258
|
+
__metadata("design:returntype", String)
|
|
259
|
+
], RuntimeResolver.prototype, "runtimeHcAgentInfos", null);
|
|
260
|
+
__decorate([
|
|
261
|
+
Mutation(returns => Boolean),
|
|
262
|
+
__param(0, Arg("agentInfos", type => String)),
|
|
263
|
+
__metadata("design:type", Function),
|
|
264
|
+
__metadata("design:paramtypes", [Object]),
|
|
265
|
+
__metadata("design:returntype", Boolean)
|
|
266
|
+
], RuntimeResolver.prototype, "runtimeHcAddAgentInfos", null);
|
|
267
|
+
__decorate([
|
|
268
|
+
Query(returns => Boolean),
|
|
269
|
+
__param(0, Arg("did", type => String)),
|
|
270
|
+
__param(1, Arg("didSigningKeyId", type => String)),
|
|
271
|
+
__param(2, Arg("data", type => String)),
|
|
272
|
+
__param(3, Arg("signedData", type => String)),
|
|
273
|
+
__metadata("design:type", Function),
|
|
274
|
+
__metadata("design:paramtypes", [String, String, String, String]),
|
|
275
|
+
__metadata("design:returntype", void 0)
|
|
276
|
+
], RuntimeResolver.prototype, "runtimeVerifyStringSignedByDid", null);
|
|
277
|
+
__decorate([
|
|
278
|
+
Mutation(),
|
|
279
|
+
__param(0, Arg("status", type => PerspectiveInput)),
|
|
280
|
+
__metadata("design:type", Function),
|
|
281
|
+
__metadata("design:paramtypes", [Perspective]),
|
|
282
|
+
__metadata("design:returntype", Boolean)
|
|
283
|
+
], RuntimeResolver.prototype, "runtimeSetStatus", null);
|
|
284
|
+
__decorate([
|
|
285
|
+
Query({ nullable: true }),
|
|
286
|
+
__param(0, Arg("did", type => String)),
|
|
287
|
+
__metadata("design:type", Function),
|
|
288
|
+
__metadata("design:paramtypes", [String]),
|
|
289
|
+
__metadata("design:returntype", PerspectiveExpression)
|
|
290
|
+
], RuntimeResolver.prototype, "runtimeFriendStatus", null);
|
|
291
|
+
__decorate([
|
|
292
|
+
Mutation(),
|
|
293
|
+
__param(0, Arg("did", type => String)),
|
|
294
|
+
__param(1, Arg("message", type => PerspectiveInput)),
|
|
295
|
+
__metadata("design:type", Function),
|
|
296
|
+
__metadata("design:paramtypes", [String, PerspectiveInput]),
|
|
297
|
+
__metadata("design:returntype", Boolean)
|
|
298
|
+
], RuntimeResolver.prototype, "runtimeFriendSendMessage", null);
|
|
299
|
+
__decorate([
|
|
300
|
+
Query(returns => [PerspectiveExpression]),
|
|
301
|
+
__param(0, Arg("filter", type => String, { nullable: true })),
|
|
302
|
+
__metadata("design:type", Function),
|
|
303
|
+
__metadata("design:paramtypes", [String]),
|
|
304
|
+
__metadata("design:returntype", Array)
|
|
305
|
+
], RuntimeResolver.prototype, "runtimeMessageInbox", null);
|
|
306
|
+
__decorate([
|
|
307
|
+
Query(returns => [SentMessage]),
|
|
308
|
+
__param(0, Arg("filter", type => String, { nullable: true })),
|
|
309
|
+
__metadata("design:type", Function),
|
|
310
|
+
__metadata("design:paramtypes", [String]),
|
|
311
|
+
__metadata("design:returntype", Array)
|
|
312
|
+
], RuntimeResolver.prototype, "runtimeMessageOutbox", null);
|
|
313
|
+
__decorate([
|
|
314
|
+
Subscription({ topics: RUNTIME_MESSAGED_RECEIVED_TOPIC, nullable: true }),
|
|
315
|
+
__metadata("design:type", Function),
|
|
316
|
+
__metadata("design:paramtypes", []),
|
|
317
|
+
__metadata("design:returntype", PerspectiveExpression)
|
|
318
|
+
], RuntimeResolver.prototype, "runtimeMessageReceived", null);
|
|
319
|
+
__decorate([
|
|
320
|
+
Subscription({ topics: EXCEPTION_OCCURRED_TOPIC, nullable: true }),
|
|
321
|
+
__metadata("design:type", Function),
|
|
322
|
+
__metadata("design:paramtypes", []),
|
|
323
|
+
__metadata("design:returntype", ExceptionInfo)
|
|
324
|
+
], RuntimeResolver.prototype, "exceptionOccurred", null);
|
|
325
|
+
RuntimeResolver = __decorate([
|
|
326
|
+
Resolver()
|
|
327
|
+
], RuntimeResolver);
|
|
328
|
+
export default RuntimeResolver;
|