@coasys/ad4m 0.10.1-release-candidate-3-test-2 → 0.10.1-release-candidate-4-debug-strings
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 +105 -6
- package/lib/index.js +106 -7
- package/lib/src/language/Language.d.ts +3 -0
- package/lib/src/model/Ad4mModel.js +11 -5
- package/lib/src/perspectives/PerspectiveClient.js +1 -1
- package/lib/src/runtime/RuntimeClient.d.ts +3 -0
- package/lib/src/runtime/RuntimeClient.js +30 -0
- package/lib/src/runtime/RuntimeResolver.d.ts +9 -0
- package/lib/src/runtime/RuntimeResolver.js +54 -0
- package/lib/src/schema.gql +10 -0
- package/lib/src/typeDefs.js +10 -0
- package/package.json +1 -2
- package/src/language/Language.ts +6 -2
- package/src/model/Ad4mModel.ts +13 -6
- package/src/perspectives/PerspectiveClient.ts +1 -1
- package/src/runtime/RuntimeClient.ts +33 -0
- package/src/runtime/RuntimeResolver.ts +34 -0
- package/lib/src/subject/Ad4mModel.d.ts +0 -550
- package/lib/src/subject/Ad4mModel.js +0 -956
- package/lib/src/subject/SDNADecorators.d.ts +0 -188
- package/lib/src/subject/SDNADecorators.js +0 -360
- package/lib/src/subject/Subject.d.ts +0 -25
- package/lib/src/subject/Subject.js +0 -188
- package/lib/src/subject/SubjectEntity.d.ts +0 -185
- package/lib/src/subject/SubjectEntity.js +0 -591
- package/lib/src/subject/decorators.d.ts +0 -496
- package/lib/src/subject/decorators.js +0 -683
- package/lib/src/subject/util.d.ts +0 -12
- package/lib/src/subject/util.js +0 -73
- package/yarn-error.log +0 -90
|
@@ -194,6 +194,28 @@ TriggeredNotification = __decorate([
|
|
|
194
194
|
ObjectType()
|
|
195
195
|
], TriggeredNotification);
|
|
196
196
|
export { TriggeredNotification };
|
|
197
|
+
let DebugStringEntry = class DebugStringEntry {
|
|
198
|
+
};
|
|
199
|
+
__decorate([
|
|
200
|
+
Field(),
|
|
201
|
+
__metadata("design:type", String)
|
|
202
|
+
], DebugStringEntry.prototype, "neighbourhoodUrl", void 0);
|
|
203
|
+
__decorate([
|
|
204
|
+
Field(),
|
|
205
|
+
__metadata("design:type", String)
|
|
206
|
+
], DebugStringEntry.prototype, "debugString", void 0);
|
|
207
|
+
__decorate([
|
|
208
|
+
Field(),
|
|
209
|
+
__metadata("design:type", String)
|
|
210
|
+
], DebugStringEntry.prototype, "operation", void 0);
|
|
211
|
+
__decorate([
|
|
212
|
+
Field(),
|
|
213
|
+
__metadata("design:type", String)
|
|
214
|
+
], DebugStringEntry.prototype, "timestamp", void 0);
|
|
215
|
+
DebugStringEntry = __decorate([
|
|
216
|
+
ObjectType()
|
|
217
|
+
], DebugStringEntry);
|
|
218
|
+
export { DebugStringEntry };
|
|
197
219
|
let ImportStats = class ImportStats {
|
|
198
220
|
};
|
|
199
221
|
__decorate([
|
|
@@ -302,6 +324,10 @@ let RuntimeResolver = class RuntimeResolver {
|
|
|
302
324
|
runtimeKnownLinkLanguageTemplates() {
|
|
303
325
|
return ["Qm12345abcdef"];
|
|
304
326
|
}
|
|
327
|
+
runtimeDebugStrings(neighbourhoodUrl) {
|
|
328
|
+
// Real implementation will be provided by the executor
|
|
329
|
+
return [];
|
|
330
|
+
}
|
|
305
331
|
runtimeAddKnownLinkLanguageTemplates(addresses) {
|
|
306
332
|
return addresses;
|
|
307
333
|
}
|
|
@@ -320,6 +346,15 @@ let RuntimeResolver = class RuntimeResolver {
|
|
|
320
346
|
runtimeHcAgentInfos() {
|
|
321
347
|
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] } }]);
|
|
322
348
|
}
|
|
349
|
+
runtimeGetNetworkMetrics() {
|
|
350
|
+
return JSON.stringify({
|
|
351
|
+
"metrics": {},
|
|
352
|
+
"stats": {}
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
runtimeRestartHolochain() {
|
|
356
|
+
return true;
|
|
357
|
+
}
|
|
323
358
|
runtimeHcAddAgentInfos(agentInfos) {
|
|
324
359
|
return true;
|
|
325
360
|
}
|
|
@@ -456,6 +491,13 @@ __decorate([
|
|
|
456
491
|
__metadata("design:paramtypes", []),
|
|
457
492
|
__metadata("design:returntype", Array)
|
|
458
493
|
], RuntimeResolver.prototype, "runtimeKnownLinkLanguageTemplates", null);
|
|
494
|
+
__decorate([
|
|
495
|
+
Query(returns => [DebugStringEntry]),
|
|
496
|
+
__param(0, Arg("neighbourhoodUrl", type => String, { nullable: true })),
|
|
497
|
+
__metadata("design:type", Function),
|
|
498
|
+
__metadata("design:paramtypes", [String]),
|
|
499
|
+
__metadata("design:returntype", Array)
|
|
500
|
+
], RuntimeResolver.prototype, "runtimeDebugStrings", null);
|
|
459
501
|
__decorate([
|
|
460
502
|
Mutation(returns => [String]),
|
|
461
503
|
__param(0, Arg("addresses", type => [String])),
|
|
@@ -496,6 +538,18 @@ __decorate([
|
|
|
496
538
|
__metadata("design:paramtypes", []),
|
|
497
539
|
__metadata("design:returntype", String)
|
|
498
540
|
], RuntimeResolver.prototype, "runtimeHcAgentInfos", null);
|
|
541
|
+
__decorate([
|
|
542
|
+
Query(),
|
|
543
|
+
__metadata("design:type", Function),
|
|
544
|
+
__metadata("design:paramtypes", []),
|
|
545
|
+
__metadata("design:returntype", String)
|
|
546
|
+
], RuntimeResolver.prototype, "runtimeGetNetworkMetrics", null);
|
|
547
|
+
__decorate([
|
|
548
|
+
Mutation(returns => Boolean),
|
|
549
|
+
__metadata("design:type", Function),
|
|
550
|
+
__metadata("design:paramtypes", []),
|
|
551
|
+
__metadata("design:returntype", Boolean)
|
|
552
|
+
], RuntimeResolver.prototype, "runtimeRestartHolochain", null);
|
|
499
553
|
__decorate([
|
|
500
554
|
Mutation(returns => Boolean),
|
|
501
555
|
__param(0, Arg("agentInfos", type => String)),
|
package/lib/src/schema.gql
CHANGED
|
@@ -96,6 +96,13 @@ input CapabilityInput {
|
|
|
96
96
|
# The javascript `Date` as string. Type represents date and time as the ISO Date string.
|
|
97
97
|
scalar DateTime
|
|
98
98
|
|
|
99
|
+
type DebugStringEntry {
|
|
100
|
+
debugString: String!
|
|
101
|
+
neighbourhoodUrl: String!
|
|
102
|
+
operation: String!
|
|
103
|
+
timestamp: String!
|
|
104
|
+
}
|
|
105
|
+
|
|
99
106
|
type EntanglementProof {
|
|
100
107
|
deviceKey: String!
|
|
101
108
|
deviceKeySignedByDid: String!
|
|
@@ -371,6 +378,7 @@ type Mutation {
|
|
|
371
378
|
runtimeRemoveKnownLinkLanguageTemplates(addresses: [String!]!): [String!]!
|
|
372
379
|
runtimeRemoveNotification(id: String!): Boolean!
|
|
373
380
|
runtimeRequestInstallNotification(notification: NotificationInput!): String!
|
|
381
|
+
runtimeRestartHolochain: Boolean!
|
|
374
382
|
runtimeSetStatus(status: PerspectiveInput!): Boolean!
|
|
375
383
|
runtimeUpdateNotification(id: String!, notification: NotificationInput!): Boolean!
|
|
376
384
|
}
|
|
@@ -471,8 +479,10 @@ type Query {
|
|
|
471
479
|
perspectiveQueryProlog(query: String!, uuid: String!): String!
|
|
472
480
|
perspectiveSnapshot(uuid: String!): Perspective
|
|
473
481
|
perspectives: [PerspectiveHandle!]!
|
|
482
|
+
runtimeDebugStrings(neighbourhoodUrl: String): [DebugStringEntry!]!
|
|
474
483
|
runtimeFriendStatus(did: String!): PerspectiveExpression
|
|
475
484
|
runtimeFriends: [String!]!
|
|
485
|
+
runtimeGetNetworkMetrics: String!
|
|
476
486
|
runtimeHcAgentInfos: String!
|
|
477
487
|
runtimeInfo: RuntimeInfo!
|
|
478
488
|
runtimeKnownLinkLanguageTemplates: [String!]!
|
package/lib/src/typeDefs.js
CHANGED
|
@@ -92,6 +92,13 @@ input CapabilityInput {
|
|
|
92
92
|
|
|
93
93
|
scalar DateTime
|
|
94
94
|
|
|
95
|
+
type DebugStringEntry {
|
|
96
|
+
debugString: String!
|
|
97
|
+
neighbourhoodUrl: String!
|
|
98
|
+
operation: String!
|
|
99
|
+
timestamp: String!
|
|
100
|
+
}
|
|
101
|
+
|
|
95
102
|
type EntanglementProof {
|
|
96
103
|
deviceKey: String!
|
|
97
104
|
deviceKeySignedByDid: String!
|
|
@@ -367,6 +374,7 @@ type Mutation {
|
|
|
367
374
|
runtimeRemoveKnownLinkLanguageTemplates(addresses: [String!]!): [String!]!
|
|
368
375
|
runtimeRemoveNotification(id: String!): Boolean!
|
|
369
376
|
runtimeRequestInstallNotification(notification: NotificationInput!): String!
|
|
377
|
+
runtimeRestartHolochain: Boolean!
|
|
370
378
|
runtimeSetStatus(status: PerspectiveInput!): Boolean!
|
|
371
379
|
runtimeUpdateNotification(id: String!, notification: NotificationInput!): Boolean!
|
|
372
380
|
}
|
|
@@ -467,8 +475,10 @@ type Query {
|
|
|
467
475
|
perspectiveQueryProlog(query: String!, uuid: String!): String!
|
|
468
476
|
perspectiveSnapshot(uuid: String!): Perspective
|
|
469
477
|
perspectives: [PerspectiveHandle!]!
|
|
478
|
+
runtimeDebugStrings(neighbourhoodUrl: String): [DebugStringEntry!]!
|
|
470
479
|
runtimeFriendStatus(did: String!): PerspectiveExpression
|
|
471
480
|
runtimeFriends: [String!]!
|
|
481
|
+
runtimeGetNetworkMetrics: String!
|
|
472
482
|
runtimeHcAgentInfos: String!
|
|
473
483
|
runtimeInfo: RuntimeInfo!
|
|
474
484
|
runtimeKnownLinkLanguageTemplates: [String!]!
|
package/package.json
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
"module": "lib/index.js",
|
|
6
6
|
"types": "lib/src/index.d.ts",
|
|
7
7
|
"type": "module",
|
|
8
|
-
|
|
9
8
|
"scripts": {
|
|
10
9
|
"build": "patch-package && tsc && pnpm run buildSchema && pnpm run bundle",
|
|
11
10
|
"buildSchema": "node --es-module-specifier-resolution=node lib/src/buildSchema.js",
|
|
@@ -69,5 +68,5 @@
|
|
|
69
68
|
"graphql@15.7.2": "patches/graphql@15.7.2.patch"
|
|
70
69
|
}
|
|
71
70
|
},
|
|
72
|
-
"version": "0.10.1-release-candidate-
|
|
71
|
+
"version": "0.10.1-release-candidate-4-debug-strings"
|
|
73
72
|
}
|
package/src/language/Language.ts
CHANGED
|
@@ -148,8 +148,9 @@ export interface GetAllAdapter {
|
|
|
148
148
|
getAll(filter: any, count: number, page: number): Promise<Expression[] | null>;
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
export type PerspectiveDiffObserver = (diff: PerspectiveDiff)=>void;
|
|
152
|
-
export type SyncStateChangeObserver = (state: PerspectiveState)=>void;
|
|
151
|
+
export type PerspectiveDiffObserver = (diff: PerspectiveDiff) => void;
|
|
152
|
+
export type SyncStateChangeObserver = (state: PerspectiveState) => void;
|
|
153
|
+
export type DebugStringObserver = (debugString: string, operation: string) => void;
|
|
153
154
|
|
|
154
155
|
/** Interface for "Link Languages" that facilitate the synchronization
|
|
155
156
|
* between agents' local Perspectives inside a Neighbourhood.
|
|
@@ -187,6 +188,9 @@ export interface LinkSyncAdapter {
|
|
|
187
188
|
|
|
188
189
|
/** Add a sync state callback method */
|
|
189
190
|
addSyncStateChangeCallback(callback: SyncStateChangeObserver);
|
|
191
|
+
|
|
192
|
+
/** Add a debug string callback method for capturing internal debug information */
|
|
193
|
+
addDebugStringCallback?(callback: DebugStringObserver);
|
|
190
194
|
}
|
|
191
195
|
|
|
192
196
|
export type MessageCallback = (message: PerspectiveExpression) => void;
|
package/src/model/Ad4mModel.ts
CHANGED
|
@@ -698,6 +698,13 @@ export class Ad4mModel {
|
|
|
698
698
|
// We use createSubject's initialValues to set properties (but not collections)
|
|
699
699
|
// We then later use innerUpdate to set collections
|
|
700
700
|
|
|
701
|
+
let batchCreatedHere = false;
|
|
702
|
+
if(!batchId) {
|
|
703
|
+
batchId = await this.perspective.createBatch()
|
|
704
|
+
batchCreatedHere = true;
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
|
|
701
708
|
// First filter out the properties that are not collections (arrays)
|
|
702
709
|
const initialValues = {};
|
|
703
710
|
for (const [key, value] of Object.entries(this)) {
|
|
@@ -724,13 +731,13 @@ export class Ad4mModel {
|
|
|
724
731
|
// Set collections
|
|
725
732
|
await this.innerUpdate(false, batchId)
|
|
726
733
|
|
|
727
|
-
// If we
|
|
728
|
-
// since the instance won't exist
|
|
729
|
-
|
|
730
|
-
|
|
734
|
+
// If we got a batchId passed in, we let the caller decide when to commit.
|
|
735
|
+
// But then we can call getData() since the instance won't exist in the perspective
|
|
736
|
+
// until the bacht is committedl
|
|
737
|
+
if (batchCreatedHere) {
|
|
738
|
+
await this.perspective.commitBatch(batchId)
|
|
739
|
+
await this.getData();
|
|
731
740
|
}
|
|
732
|
-
|
|
733
|
-
await this.getData();
|
|
734
741
|
}
|
|
735
742
|
|
|
736
743
|
private cleanCopy() {
|
|
@@ -192,6 +192,39 @@ export class RuntimeClient {
|
|
|
192
192
|
return runtimeHcAgentInfos
|
|
193
193
|
}
|
|
194
194
|
|
|
195
|
+
async getNetworkMetrics(): Promise<String> {
|
|
196
|
+
const { runtimeGetNetworkMetrics } = unwrapApolloResult(await this.#apolloClient.query({
|
|
197
|
+
query: gql`query runtimeGetNetworkMetrics {
|
|
198
|
+
runtimeGetNetworkMetrics
|
|
199
|
+
}`,
|
|
200
|
+
}))
|
|
201
|
+
return runtimeGetNetworkMetrics
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
async debugStrings(neighbourhoodUrl?: string): Promise<any[]> {
|
|
205
|
+
const { runtimeDebugStrings } = unwrapApolloResult(await this.#apolloClient.query({
|
|
206
|
+
query: gql`query runtimeDebugStrings($neighbourhoodUrl: String) {
|
|
207
|
+
runtimeDebugStrings(neighbourhoodUrl: $neighbourhoodUrl) {
|
|
208
|
+
neighbourhoodUrl
|
|
209
|
+
debugString
|
|
210
|
+
operation
|
|
211
|
+
timestamp
|
|
212
|
+
}
|
|
213
|
+
}`,
|
|
214
|
+
variables: { neighbourhoodUrl }
|
|
215
|
+
}))
|
|
216
|
+
return runtimeDebugStrings
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
async restartHolochain(): Promise<Boolean> {
|
|
220
|
+
const { runtimeRestartHolochain } = unwrapApolloResult(await this.#apolloClient.mutate({
|
|
221
|
+
mutation: gql`mutation runtimeRestartHolochain {
|
|
222
|
+
runtimeRestartHolochain
|
|
223
|
+
}`,
|
|
224
|
+
}))
|
|
225
|
+
return runtimeRestartHolochain
|
|
226
|
+
}
|
|
227
|
+
|
|
195
228
|
async hcAddAgentInfos(agentInfos: String): Promise<void> {
|
|
196
229
|
const { runtimeHcAddAgentInfos } = unwrapApolloResult(await this.#apolloClient.mutate({
|
|
197
230
|
mutation: gql`mutation runtimeHcAddAgentInfos($agentInfos: String!) {
|
|
@@ -138,6 +138,21 @@ export class TriggeredNotification {
|
|
|
138
138
|
triggerMatch: string;
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
+
@ObjectType()
|
|
142
|
+
export class DebugStringEntry {
|
|
143
|
+
@Field()
|
|
144
|
+
neighbourhoodUrl: string;
|
|
145
|
+
|
|
146
|
+
@Field()
|
|
147
|
+
debugString: string;
|
|
148
|
+
|
|
149
|
+
@Field()
|
|
150
|
+
operation: string;
|
|
151
|
+
|
|
152
|
+
@Field()
|
|
153
|
+
timestamp: string;
|
|
154
|
+
}
|
|
155
|
+
|
|
141
156
|
@ObjectType()
|
|
142
157
|
export class ImportStats {
|
|
143
158
|
@Field()
|
|
@@ -239,6 +254,12 @@ export default class RuntimeResolver {
|
|
|
239
254
|
return ["Qm12345abcdef"]
|
|
240
255
|
}
|
|
241
256
|
|
|
257
|
+
@Query(returns => [DebugStringEntry])
|
|
258
|
+
runtimeDebugStrings(@Arg("neighbourhoodUrl", type => String, {nullable: true}) neighbourhoodUrl?: string): DebugStringEntry[] {
|
|
259
|
+
// Real implementation will be provided by the executor
|
|
260
|
+
return []
|
|
261
|
+
}
|
|
262
|
+
|
|
242
263
|
@Mutation(returns => [String])
|
|
243
264
|
runtimeAddKnownLinkLanguageTemplates(@Arg("addresses", type => [String]) addresses: string[]): string[] {
|
|
244
265
|
return addresses
|
|
@@ -269,6 +290,19 @@ export default class RuntimeResolver {
|
|
|
269
290
|
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]}}])
|
|
270
291
|
}
|
|
271
292
|
|
|
293
|
+
@Query()
|
|
294
|
+
runtimeGetNetworkMetrics(): String {
|
|
295
|
+
return JSON.stringify({
|
|
296
|
+
"metrics": {},
|
|
297
|
+
"stats": {}
|
|
298
|
+
})
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
@Mutation(returns => Boolean)
|
|
302
|
+
runtimeRestartHolochain(): Boolean {
|
|
303
|
+
return true
|
|
304
|
+
}
|
|
305
|
+
|
|
272
306
|
@Mutation(returns => Boolean)
|
|
273
307
|
runtimeHcAddAgentInfos(@Arg("agentInfos", type => String) agentInfos): boolean {
|
|
274
308
|
return true
|