@coasys/ad4m 0.8.0-fix

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.
Files changed (167) hide show
  1. package/README.md +229 -0
  2. package/jest-setup.ts +1 -0
  3. package/jest.config.js +6 -0
  4. package/jsdoc.json +28 -0
  5. package/lib/index.cjs +8165 -0
  6. package/lib/index.js +8130 -0
  7. package/lib/shims/reflect-metadata.d.ts +0 -0
  8. package/lib/shims/reflect-metadata.js +0 -0
  9. package/lib/shims/type-graphql.d.ts +32 -0
  10. package/lib/shims/type-graphql.js +70 -0
  11. package/lib/src/Ad4mClient.d.ts +26 -0
  12. package/lib/src/Ad4mClient.js +66 -0
  13. package/lib/src/Address.d.ts +1 -0
  14. package/lib/src/Address.js +1 -0
  15. package/lib/src/DID.d.ts +1 -0
  16. package/lib/src/DID.js +1 -0
  17. package/lib/src/Exception.d.ts +6 -0
  18. package/lib/src/Exception.js +7 -0
  19. package/lib/src/Literal.d.ts +7 -0
  20. package/lib/src/Literal.js +76 -0
  21. package/lib/src/PubSub.d.ts +14 -0
  22. package/lib/src/PubSub.js +14 -0
  23. package/lib/src/SmartLiteral.d.ts +12 -0
  24. package/lib/src/SmartLiteral.js +74 -0
  25. package/lib/src/agent/Agent.d.ts +104 -0
  26. package/lib/src/agent/Agent.js +337 -0
  27. package/lib/src/agent/AgentClient.d.ts +57 -0
  28. package/lib/src/agent/AgentClient.js +431 -0
  29. package/lib/src/agent/AgentResolver.d.ts +30 -0
  30. package/lib/src/agent/AgentResolver.js +325 -0
  31. package/lib/src/agent/AgentStatus.d.ts +8 -0
  32. package/lib/src/agent/AgentStatus.js +61 -0
  33. package/lib/src/buildSchema.d.ts +1 -0
  34. package/lib/src/buildSchema.js +36 -0
  35. package/lib/src/expression/Expression.d.ts +28 -0
  36. package/lib/src/expression/Expression.js +143 -0
  37. package/lib/src/expression/ExpressionClient.d.ts +13 -0
  38. package/lib/src/expression/ExpressionClient.js +102 -0
  39. package/lib/src/expression/ExpressionRef.d.ts +9 -0
  40. package/lib/src/expression/ExpressionRef.js +67 -0
  41. package/lib/src/expression/ExpressionResolver.d.ts +10 -0
  42. package/lib/src/expression/ExpressionResolver.js +106 -0
  43. package/lib/src/index.d.ts +30 -0
  44. package/lib/src/index.js +30 -0
  45. package/lib/src/jestSetup.d.ts +1 -0
  46. package/lib/src/jestSetup.js +1 -0
  47. package/lib/src/language/Icon.d.ts +4 -0
  48. package/lib/src/language/Icon.js +24 -0
  49. package/lib/src/language/Language.d.ts +195 -0
  50. package/lib/src/language/Language.js +79 -0
  51. package/lib/src/language/LanguageClient.d.ts +17 -0
  52. package/lib/src/language/LanguageClient.js +137 -0
  53. package/lib/src/language/LanguageContext.d.ts +37 -0
  54. package/lib/src/language/LanguageContext.js +2 -0
  55. package/lib/src/language/LanguageHandle.d.ts +9 -0
  56. package/lib/src/language/LanguageHandle.js +41 -0
  57. package/lib/src/language/LanguageMeta.d.ts +35 -0
  58. package/lib/src/language/LanguageMeta.js +89 -0
  59. package/lib/src/language/LanguageRef.d.ts +6 -0
  60. package/lib/src/language/LanguageRef.js +30 -0
  61. package/lib/src/language/LanguageResolver.d.ts +19 -0
  62. package/lib/src/language/LanguageResolver.js +143 -0
  63. package/lib/src/links/Links.d.ts +39 -0
  64. package/lib/src/links/Links.js +148 -0
  65. package/lib/src/links/Links.test.d.ts +1 -0
  66. package/lib/src/links/Links.test.js +33 -0
  67. package/lib/src/neighbourhood/Neighbourhood.d.ts +10 -0
  68. package/lib/src/neighbourhood/Neighbourhood.js +38 -0
  69. package/lib/src/neighbourhood/NeighbourhoodClient.d.ts +25 -0
  70. package/lib/src/neighbourhood/NeighbourhoodClient.js +256 -0
  71. package/lib/src/neighbourhood/NeighbourhoodProxy.d.ts +19 -0
  72. package/lib/src/neighbourhood/NeighbourhoodProxy.js +54 -0
  73. package/lib/src/neighbourhood/NeighbourhoodResolver.d.ts +24 -0
  74. package/lib/src/neighbourhood/NeighbourhoodResolver.js +180 -0
  75. package/lib/src/perspectives/LinkQuery.d.ts +11 -0
  76. package/lib/src/perspectives/LinkQuery.js +80 -0
  77. package/lib/src/perspectives/Perspective.d.ts +38 -0
  78. package/lib/src/perspectives/Perspective.js +144 -0
  79. package/lib/src/perspectives/Perspective.test.d.ts +1 -0
  80. package/lib/src/perspectives/Perspective.test.js +20 -0
  81. package/lib/src/perspectives/PerspectiveClient.d.ts +54 -0
  82. package/lib/src/perspectives/PerspectiveClient.js +410 -0
  83. package/lib/src/perspectives/PerspectiveDiff.d.ts +9 -0
  84. package/lib/src/perspectives/PerspectiveDiff.js +33 -0
  85. package/lib/src/perspectives/PerspectiveHandle.d.ts +16 -0
  86. package/lib/src/perspectives/PerspectiveHandle.js +59 -0
  87. package/lib/src/perspectives/PerspectiveProxy.d.ts +178 -0
  88. package/lib/src/perspectives/PerspectiveProxy.js +540 -0
  89. package/lib/src/perspectives/PerspectiveResolver.d.ts +37 -0
  90. package/lib/src/perspectives/PerspectiveResolver.js +362 -0
  91. package/lib/src/runtime/RuntimeClient.d.ts +33 -0
  92. package/lib/src/runtime/RuntimeClient.js +263 -0
  93. package/lib/src/runtime/RuntimeResolver.d.ts +47 -0
  94. package/lib/src/runtime/RuntimeResolver.js +328 -0
  95. package/lib/src/schema.gql +382 -0
  96. package/lib/src/subject/SDNADecorators.d.ts +45 -0
  97. package/lib/src/subject/SDNADecorators.js +250 -0
  98. package/lib/src/subject/Subject.d.ts +7 -0
  99. package/lib/src/subject/Subject.js +160 -0
  100. package/lib/src/subject/SubjectEntity.d.ts +31 -0
  101. package/lib/src/subject/SubjectEntity.js +250 -0
  102. package/lib/src/subject/util.d.ts +12 -0
  103. package/lib/src/subject/util.js +73 -0
  104. package/lib/src/typeDefs.d.ts +1 -0
  105. package/lib/src/typeDefs.js +379 -0
  106. package/lib/src/unwrapApolloResult.d.ts +2 -0
  107. package/lib/src/unwrapApolloResult.js +12 -0
  108. package/lib/src/utils.d.ts +2 -0
  109. package/lib/src/utils.js +21 -0
  110. package/package.json +61 -0
  111. package/rollup.config.js +27 -0
  112. package/shims/reflect-metadata.ts +0 -0
  113. package/shims/type-graphql.ts +75 -0
  114. package/src/Ad4mClient.test.ts +1085 -0
  115. package/src/Ad4mClient.ts +63 -0
  116. package/src/Address.ts +1 -0
  117. package/src/DID.ts +1 -0
  118. package/src/Exception.ts +6 -0
  119. package/src/Literal.test.ts +31 -0
  120. package/src/Literal.ts +81 -0
  121. package/src/PubSub.ts +14 -0
  122. package/src/SmartLiteral.ts +75 -0
  123. package/src/agent/Agent.ts +293 -0
  124. package/src/agent/AgentClient.ts +531 -0
  125. package/src/agent/AgentResolver.ts +263 -0
  126. package/src/agent/AgentStatus.ts +44 -0
  127. package/src/buildSchema.ts +41 -0
  128. package/src/expression/Expression.ts +99 -0
  129. package/src/expression/ExpressionClient.ts +99 -0
  130. package/src/expression/ExpressionRef.ts +63 -0
  131. package/src/expression/ExpressionResolver.ts +64 -0
  132. package/src/index.ts +30 -0
  133. package/src/jestSetup.ts +1 -0
  134. package/src/language/Icon.ts +11 -0
  135. package/src/language/Language.ts +266 -0
  136. package/src/language/LanguageClient.ts +160 -0
  137. package/src/language/LanguageContext.ts +37 -0
  138. package/src/language/LanguageHandle.ts +23 -0
  139. package/src/language/LanguageMeta.ts +70 -0
  140. package/src/language/LanguageRef.ts +18 -0
  141. package/src/language/LanguageResolver.ts +98 -0
  142. package/src/links/Links.test.ts +40 -0
  143. package/src/links/Links.ts +107 -0
  144. package/src/neighbourhood/Neighbourhood.ts +22 -0
  145. package/src/neighbourhood/NeighbourhoodClient.ts +276 -0
  146. package/src/neighbourhood/NeighbourhoodProxy.ts +58 -0
  147. package/src/neighbourhood/NeighbourhoodResolver.ts +100 -0
  148. package/src/perspectives/LinkQuery.ts +66 -0
  149. package/src/perspectives/Perspective.test.ts +23 -0
  150. package/src/perspectives/Perspective.ts +118 -0
  151. package/src/perspectives/PerspectiveClient.ts +444 -0
  152. package/src/perspectives/PerspectiveDiff.ts +15 -0
  153. package/src/perspectives/PerspectiveHandle.ts +39 -0
  154. package/src/perspectives/PerspectiveProxy.ts +611 -0
  155. package/src/perspectives/PerspectiveResolver.ts +220 -0
  156. package/src/runtime/RuntimeClient.ts +283 -0
  157. package/src/runtime/RuntimeResolver.ts +193 -0
  158. package/src/subject/SDNADecorators.ts +334 -0
  159. package/src/subject/Subject.ts +153 -0
  160. package/src/subject/SubjectEntity.ts +292 -0
  161. package/src/subject/util.ts +85 -0
  162. package/src/typeDefs.ts +6 -0
  163. package/src/unwrapApolloResult.ts +14 -0
  164. package/src/utils.ts +25 -0
  165. package/tsconfig-browser.json +82 -0
  166. package/tsconfig.json +80 -0
  167. package/yarn-error.log +22814 -0
@@ -0,0 +1,47 @@
1
+ import { Perspective, PerspectiveExpression, PerspectiveInput } from "../perspectives/Perspective";
2
+ import { ExceptionType } from "../Exception";
3
+ export declare class SentMessage {
4
+ recipient: string;
5
+ message: PerspectiveExpression;
6
+ }
7
+ export declare class RuntimeInfo {
8
+ ad4mExecutorVersion: string;
9
+ isInitialized: Boolean;
10
+ isUnlocked: Boolean;
11
+ }
12
+ export declare class ExceptionInfo {
13
+ title: string;
14
+ message: string;
15
+ type: ExceptionType;
16
+ addon?: string;
17
+ }
18
+ /**
19
+ * Resolver classes are used here to define the GraphQL schema
20
+ * (through the type-graphql annotations)
21
+ * and are spawned in the client tests in Ad4mClient.test.ts.
22
+ * For the latter, they return test fixtures.
23
+ */
24
+ export default class RuntimeResolver {
25
+ runtimeQuit(): Boolean;
26
+ runtimeOpenLink(url: string): Boolean;
27
+ runtimeInfo(): RuntimeInfo;
28
+ addTrustedAgents(agents: string[]): string[];
29
+ deleteTrustedAgents(agents: string[]): string[];
30
+ getTrustedAgents(): string[];
31
+ runtimeKnownLinkLanguageTemplates(): string[];
32
+ runtimeAddKnownLinkLanguageTemplates(addresses: string[]): string[];
33
+ runtimeRemoveKnownLinkLanguageTemplates(addresses: string[]): string[];
34
+ runtimeFriends(): string[];
35
+ runtimeAddFriends(dids: string[]): string[];
36
+ runtimeRemoveFriends(dids: string[]): string[];
37
+ runtimeHcAgentInfos(): String;
38
+ runtimeHcAddAgentInfos(agentInfos: any): boolean;
39
+ runtimeVerifyStringSignedByDid(did: string, didSigningKeyId: string, data: string, signedData: string): boolean;
40
+ runtimeSetStatus(status: Perspective): boolean;
41
+ runtimeFriendStatus(did: string): PerspectiveExpression;
42
+ runtimeFriendSendMessage(did: string, message: PerspectiveInput): boolean;
43
+ runtimeMessageInbox(filter?: string): PerspectiveExpression[];
44
+ runtimeMessageOutbox(filter?: string): SentMessage[];
45
+ runtimeMessageReceived(): PerspectiveExpression;
46
+ exceptionOccurred(): ExceptionInfo;
47
+ }
@@ -0,0 +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;