@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.
- package/README.md +229 -0
- package/jest-setup.ts +1 -0
- package/jest.config.js +6 -0
- package/jsdoc.json +28 -0
- package/lib/index.cjs +8165 -0
- package/lib/index.js +8130 -0
- package/lib/shims/reflect-metadata.d.ts +0 -0
- package/lib/shims/reflect-metadata.js +0 -0
- package/lib/shims/type-graphql.d.ts +32 -0
- package/lib/shims/type-graphql.js +70 -0
- package/lib/src/Ad4mClient.d.ts +26 -0
- package/lib/src/Ad4mClient.js +66 -0
- package/lib/src/Address.d.ts +1 -0
- package/lib/src/Address.js +1 -0
- package/lib/src/DID.d.ts +1 -0
- package/lib/src/DID.js +1 -0
- package/lib/src/Exception.d.ts +6 -0
- package/lib/src/Exception.js +7 -0
- package/lib/src/Literal.d.ts +7 -0
- package/lib/src/Literal.js +76 -0
- package/lib/src/PubSub.d.ts +14 -0
- package/lib/src/PubSub.js +14 -0
- package/lib/src/SmartLiteral.d.ts +12 -0
- package/lib/src/SmartLiteral.js +74 -0
- package/lib/src/agent/Agent.d.ts +104 -0
- package/lib/src/agent/Agent.js +337 -0
- package/lib/src/agent/AgentClient.d.ts +57 -0
- package/lib/src/agent/AgentClient.js +431 -0
- package/lib/src/agent/AgentResolver.d.ts +30 -0
- package/lib/src/agent/AgentResolver.js +325 -0
- package/lib/src/agent/AgentStatus.d.ts +8 -0
- package/lib/src/agent/AgentStatus.js +61 -0
- package/lib/src/buildSchema.d.ts +1 -0
- package/lib/src/buildSchema.js +36 -0
- package/lib/src/expression/Expression.d.ts +28 -0
- package/lib/src/expression/Expression.js +143 -0
- package/lib/src/expression/ExpressionClient.d.ts +13 -0
- package/lib/src/expression/ExpressionClient.js +102 -0
- package/lib/src/expression/ExpressionRef.d.ts +9 -0
- package/lib/src/expression/ExpressionRef.js +67 -0
- package/lib/src/expression/ExpressionResolver.d.ts +10 -0
- package/lib/src/expression/ExpressionResolver.js +106 -0
- package/lib/src/index.d.ts +30 -0
- package/lib/src/index.js +30 -0
- package/lib/src/jestSetup.d.ts +1 -0
- package/lib/src/jestSetup.js +1 -0
- package/lib/src/language/Icon.d.ts +4 -0
- package/lib/src/language/Icon.js +24 -0
- package/lib/src/language/Language.d.ts +195 -0
- package/lib/src/language/Language.js +79 -0
- package/lib/src/language/LanguageClient.d.ts +17 -0
- package/lib/src/language/LanguageClient.js +137 -0
- package/lib/src/language/LanguageContext.d.ts +37 -0
- package/lib/src/language/LanguageContext.js +2 -0
- package/lib/src/language/LanguageHandle.d.ts +9 -0
- package/lib/src/language/LanguageHandle.js +41 -0
- package/lib/src/language/LanguageMeta.d.ts +35 -0
- package/lib/src/language/LanguageMeta.js +89 -0
- package/lib/src/language/LanguageRef.d.ts +6 -0
- package/lib/src/language/LanguageRef.js +30 -0
- package/lib/src/language/LanguageResolver.d.ts +19 -0
- package/lib/src/language/LanguageResolver.js +143 -0
- package/lib/src/links/Links.d.ts +39 -0
- package/lib/src/links/Links.js +148 -0
- package/lib/src/links/Links.test.d.ts +1 -0
- package/lib/src/links/Links.test.js +33 -0
- package/lib/src/neighbourhood/Neighbourhood.d.ts +10 -0
- package/lib/src/neighbourhood/Neighbourhood.js +38 -0
- package/lib/src/neighbourhood/NeighbourhoodClient.d.ts +25 -0
- package/lib/src/neighbourhood/NeighbourhoodClient.js +256 -0
- package/lib/src/neighbourhood/NeighbourhoodProxy.d.ts +19 -0
- package/lib/src/neighbourhood/NeighbourhoodProxy.js +54 -0
- package/lib/src/neighbourhood/NeighbourhoodResolver.d.ts +24 -0
- package/lib/src/neighbourhood/NeighbourhoodResolver.js +180 -0
- package/lib/src/perspectives/LinkQuery.d.ts +11 -0
- package/lib/src/perspectives/LinkQuery.js +80 -0
- package/lib/src/perspectives/Perspective.d.ts +38 -0
- package/lib/src/perspectives/Perspective.js +144 -0
- package/lib/src/perspectives/Perspective.test.d.ts +1 -0
- package/lib/src/perspectives/Perspective.test.js +20 -0
- package/lib/src/perspectives/PerspectiveClient.d.ts +54 -0
- package/lib/src/perspectives/PerspectiveClient.js +410 -0
- package/lib/src/perspectives/PerspectiveDiff.d.ts +9 -0
- package/lib/src/perspectives/PerspectiveDiff.js +33 -0
- package/lib/src/perspectives/PerspectiveHandle.d.ts +16 -0
- package/lib/src/perspectives/PerspectiveHandle.js +59 -0
- package/lib/src/perspectives/PerspectiveProxy.d.ts +178 -0
- package/lib/src/perspectives/PerspectiveProxy.js +540 -0
- package/lib/src/perspectives/PerspectiveResolver.d.ts +37 -0
- package/lib/src/perspectives/PerspectiveResolver.js +362 -0
- package/lib/src/runtime/RuntimeClient.d.ts +33 -0
- package/lib/src/runtime/RuntimeClient.js +263 -0
- package/lib/src/runtime/RuntimeResolver.d.ts +47 -0
- package/lib/src/runtime/RuntimeResolver.js +328 -0
- package/lib/src/schema.gql +382 -0
- package/lib/src/subject/SDNADecorators.d.ts +45 -0
- package/lib/src/subject/SDNADecorators.js +250 -0
- package/lib/src/subject/Subject.d.ts +7 -0
- package/lib/src/subject/Subject.js +160 -0
- package/lib/src/subject/SubjectEntity.d.ts +31 -0
- package/lib/src/subject/SubjectEntity.js +250 -0
- package/lib/src/subject/util.d.ts +12 -0
- package/lib/src/subject/util.js +73 -0
- package/lib/src/typeDefs.d.ts +1 -0
- package/lib/src/typeDefs.js +379 -0
- package/lib/src/unwrapApolloResult.d.ts +2 -0
- package/lib/src/unwrapApolloResult.js +12 -0
- package/lib/src/utils.d.ts +2 -0
- package/lib/src/utils.js +21 -0
- package/package.json +61 -0
- package/rollup.config.js +27 -0
- package/shims/reflect-metadata.ts +0 -0
- package/shims/type-graphql.ts +75 -0
- package/src/Ad4mClient.test.ts +1085 -0
- package/src/Ad4mClient.ts +63 -0
- package/src/Address.ts +1 -0
- package/src/DID.ts +1 -0
- package/src/Exception.ts +6 -0
- package/src/Literal.test.ts +31 -0
- package/src/Literal.ts +81 -0
- package/src/PubSub.ts +14 -0
- package/src/SmartLiteral.ts +75 -0
- package/src/agent/Agent.ts +293 -0
- package/src/agent/AgentClient.ts +531 -0
- package/src/agent/AgentResolver.ts +263 -0
- package/src/agent/AgentStatus.ts +44 -0
- package/src/buildSchema.ts +41 -0
- package/src/expression/Expression.ts +99 -0
- package/src/expression/ExpressionClient.ts +99 -0
- package/src/expression/ExpressionRef.ts +63 -0
- package/src/expression/ExpressionResolver.ts +64 -0
- package/src/index.ts +30 -0
- package/src/jestSetup.ts +1 -0
- package/src/language/Icon.ts +11 -0
- package/src/language/Language.ts +266 -0
- package/src/language/LanguageClient.ts +160 -0
- package/src/language/LanguageContext.ts +37 -0
- package/src/language/LanguageHandle.ts +23 -0
- package/src/language/LanguageMeta.ts +70 -0
- package/src/language/LanguageRef.ts +18 -0
- package/src/language/LanguageResolver.ts +98 -0
- package/src/links/Links.test.ts +40 -0
- package/src/links/Links.ts +107 -0
- package/src/neighbourhood/Neighbourhood.ts +22 -0
- package/src/neighbourhood/NeighbourhoodClient.ts +276 -0
- package/src/neighbourhood/NeighbourhoodProxy.ts +58 -0
- package/src/neighbourhood/NeighbourhoodResolver.ts +100 -0
- package/src/perspectives/LinkQuery.ts +66 -0
- package/src/perspectives/Perspective.test.ts +23 -0
- package/src/perspectives/Perspective.ts +118 -0
- package/src/perspectives/PerspectiveClient.ts +444 -0
- package/src/perspectives/PerspectiveDiff.ts +15 -0
- package/src/perspectives/PerspectiveHandle.ts +39 -0
- package/src/perspectives/PerspectiveProxy.ts +611 -0
- package/src/perspectives/PerspectiveResolver.ts +220 -0
- package/src/runtime/RuntimeClient.ts +283 -0
- package/src/runtime/RuntimeResolver.ts +193 -0
- package/src/subject/SDNADecorators.ts +334 -0
- package/src/subject/Subject.ts +153 -0
- package/src/subject/SubjectEntity.ts +292 -0
- package/src/subject/util.ts +85 -0
- package/src/typeDefs.ts +6 -0
- package/src/unwrapApolloResult.ts +14 -0
- package/src/utils.ts +25 -0
- package/tsconfig-browser.json +82 -0
- package/tsconfig.json +80 -0
- package/yarn-error.log +22814 -0
|
@@ -0,0 +1,148 @@
|
|
|
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
|
+
import { Field, InputType, ObjectType } from "type-graphql";
|
|
11
|
+
import { ExpressionGeneric, ExpressionGenericInput } from '../expression/Expression';
|
|
12
|
+
let Link = class Link {
|
|
13
|
+
constructor(obj) {
|
|
14
|
+
this.source = obj.source ? obj.source : '';
|
|
15
|
+
this.target = obj.target ? obj.target : '';
|
|
16
|
+
this.predicate = obj.predicate ? obj.predicate : '';
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
__decorate([
|
|
20
|
+
Field(),
|
|
21
|
+
__metadata("design:type", String)
|
|
22
|
+
], Link.prototype, "source", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
Field(),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], Link.prototype, "target", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
Field({ nullable: true }),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], Link.prototype, "predicate", void 0);
|
|
31
|
+
Link = __decorate([
|
|
32
|
+
ObjectType(),
|
|
33
|
+
__metadata("design:paramtypes", [Object])
|
|
34
|
+
], Link);
|
|
35
|
+
export { Link };
|
|
36
|
+
let LinkMutations = class LinkMutations {
|
|
37
|
+
};
|
|
38
|
+
__decorate([
|
|
39
|
+
Field(type => [LinkInput]),
|
|
40
|
+
__metadata("design:type", Array)
|
|
41
|
+
], LinkMutations.prototype, "additions", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
Field(type => [LinkExpressionInput]),
|
|
44
|
+
__metadata("design:type", Array)
|
|
45
|
+
], LinkMutations.prototype, "removals", void 0);
|
|
46
|
+
LinkMutations = __decorate([
|
|
47
|
+
InputType()
|
|
48
|
+
], LinkMutations);
|
|
49
|
+
export { LinkMutations };
|
|
50
|
+
let LinkExpressionMutations = class LinkExpressionMutations {
|
|
51
|
+
constructor(additions, removals) {
|
|
52
|
+
this.additions = additions;
|
|
53
|
+
this.removals = removals;
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
__decorate([
|
|
57
|
+
Field(type => [LinkExpression]),
|
|
58
|
+
__metadata("design:type", Array)
|
|
59
|
+
], LinkExpressionMutations.prototype, "additions", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
Field(type => [LinkExpression]),
|
|
62
|
+
__metadata("design:type", Array)
|
|
63
|
+
], LinkExpressionMutations.prototype, "removals", void 0);
|
|
64
|
+
LinkExpressionMutations = __decorate([
|
|
65
|
+
ObjectType(),
|
|
66
|
+
__metadata("design:paramtypes", [Array, Array])
|
|
67
|
+
], LinkExpressionMutations);
|
|
68
|
+
export { LinkExpressionMutations };
|
|
69
|
+
let LinkInput = class LinkInput {
|
|
70
|
+
};
|
|
71
|
+
__decorate([
|
|
72
|
+
Field(),
|
|
73
|
+
__metadata("design:type", String)
|
|
74
|
+
], LinkInput.prototype, "source", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
Field(),
|
|
77
|
+
__metadata("design:type", String)
|
|
78
|
+
], LinkInput.prototype, "target", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
Field({ nullable: true }),
|
|
81
|
+
__metadata("design:type", String)
|
|
82
|
+
], LinkInput.prototype, "predicate", void 0);
|
|
83
|
+
LinkInput = __decorate([
|
|
84
|
+
InputType()
|
|
85
|
+
], LinkInput);
|
|
86
|
+
export { LinkInput };
|
|
87
|
+
let LinkExpression = class LinkExpression extends ExpressionGeneric(Link) {
|
|
88
|
+
hash() {
|
|
89
|
+
const mash = JSON.stringify(this.data, Object.keys(this.data).sort()) +
|
|
90
|
+
JSON.stringify(this.author) + this.timestamp;
|
|
91
|
+
let hash = 0, i, chr;
|
|
92
|
+
for (i = 0; i < mash.length; i++) {
|
|
93
|
+
chr = mash.charCodeAt(i);
|
|
94
|
+
hash = ((hash << 5) - hash) + chr;
|
|
95
|
+
hash |= 0; // Convert to 32bit integer
|
|
96
|
+
}
|
|
97
|
+
return hash;
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
__decorate([
|
|
101
|
+
Field({ nullable: true, defaultValue: 'shared' }),
|
|
102
|
+
__metadata("design:type", String)
|
|
103
|
+
], LinkExpression.prototype, "status", void 0);
|
|
104
|
+
LinkExpression = __decorate([
|
|
105
|
+
ObjectType()
|
|
106
|
+
], LinkExpression);
|
|
107
|
+
export { LinkExpression };
|
|
108
|
+
;
|
|
109
|
+
let LinkExpressionInput = class LinkExpressionInput extends ExpressionGenericInput(LinkInput) {
|
|
110
|
+
};
|
|
111
|
+
__decorate([
|
|
112
|
+
Field({ nullable: true, defaultValue: 'shared' }),
|
|
113
|
+
__metadata("design:type", String)
|
|
114
|
+
], LinkExpressionInput.prototype, "status", void 0);
|
|
115
|
+
LinkExpressionInput = __decorate([
|
|
116
|
+
InputType()
|
|
117
|
+
], LinkExpressionInput);
|
|
118
|
+
export { LinkExpressionInput };
|
|
119
|
+
;
|
|
120
|
+
export function linkEqual(l1, l2) {
|
|
121
|
+
return l1.author == l2.author &&
|
|
122
|
+
l1.timestamp == l2.timestamp &&
|
|
123
|
+
l1.data.source == l2.data.source &&
|
|
124
|
+
l1.data.predicate == l2.data.predicate &&
|
|
125
|
+
l1.data.target == l2.data.target;
|
|
126
|
+
}
|
|
127
|
+
export function isLink(l) {
|
|
128
|
+
return l && l.source && l.target;
|
|
129
|
+
}
|
|
130
|
+
let LinkExpressionUpdated = class LinkExpressionUpdated {
|
|
131
|
+
constructor(oldLink, newLink) {
|
|
132
|
+
this.oldLink = oldLink;
|
|
133
|
+
this.newLink = newLink;
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
__decorate([
|
|
137
|
+
Field(type => LinkExpression),
|
|
138
|
+
__metadata("design:type", LinkExpression)
|
|
139
|
+
], LinkExpressionUpdated.prototype, "oldLink", void 0);
|
|
140
|
+
__decorate([
|
|
141
|
+
Field(type => LinkExpression),
|
|
142
|
+
__metadata("design:type", LinkExpression)
|
|
143
|
+
], LinkExpressionUpdated.prototype, "newLink", void 0);
|
|
144
|
+
LinkExpressionUpdated = __decorate([
|
|
145
|
+
ObjectType(),
|
|
146
|
+
__metadata("design:paramtypes", [LinkExpression, LinkExpression])
|
|
147
|
+
], LinkExpressionUpdated);
|
|
148
|
+
export { LinkExpressionUpdated };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { LinkQuery } from '../perspectives/LinkQuery';
|
|
2
|
+
const query = new LinkQuery({
|
|
3
|
+
source: 'a'
|
|
4
|
+
});
|
|
5
|
+
describe('LinkQuery', () => {
|
|
6
|
+
it('can match positively', () => {
|
|
7
|
+
expect(query.isMatch({
|
|
8
|
+
source: 'a',
|
|
9
|
+
predicate: 'b',
|
|
10
|
+
target: 'c'
|
|
11
|
+
})).toBe(true);
|
|
12
|
+
expect(query.isMatch({
|
|
13
|
+
source: 'a',
|
|
14
|
+
target: 'c'
|
|
15
|
+
})).toBe(true);
|
|
16
|
+
expect(query.isMatch({
|
|
17
|
+
source: 'a',
|
|
18
|
+
predicate: 'b',
|
|
19
|
+
target: 'c'
|
|
20
|
+
})).toBe(true);
|
|
21
|
+
});
|
|
22
|
+
it('can match negatively', () => {
|
|
23
|
+
expect(query.isMatch({
|
|
24
|
+
source: 'c',
|
|
25
|
+
predicate: 'b',
|
|
26
|
+
target: 'c'
|
|
27
|
+
})).toBe(false);
|
|
28
|
+
expect(query.isMatch({
|
|
29
|
+
source: 'c',
|
|
30
|
+
target: 'b'
|
|
31
|
+
})).toBe(false);
|
|
32
|
+
});
|
|
33
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Perspective } from "../perspectives/Perspective";
|
|
2
|
+
export declare class Neighbourhood {
|
|
3
|
+
linkLanguage: string;
|
|
4
|
+
meta: Perspective;
|
|
5
|
+
constructor(linkLanguage: string, meta: Perspective);
|
|
6
|
+
}
|
|
7
|
+
declare const NeighbourhoodExpression_base: any;
|
|
8
|
+
export declare class NeighbourhoodExpression extends NeighbourhoodExpression_base {
|
|
9
|
+
}
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
import { Field, ObjectType } from "type-graphql";
|
|
11
|
+
import { ExpressionGeneric } from "../expression/Expression";
|
|
12
|
+
import { Perspective } from "../perspectives/Perspective";
|
|
13
|
+
let Neighbourhood = class Neighbourhood {
|
|
14
|
+
constructor(linkLanguage, meta) {
|
|
15
|
+
this.linkLanguage = linkLanguage;
|
|
16
|
+
this.meta = meta;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
__decorate([
|
|
20
|
+
Field(),
|
|
21
|
+
__metadata("design:type", String)
|
|
22
|
+
], Neighbourhood.prototype, "linkLanguage", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
Field(),
|
|
25
|
+
__metadata("design:type", Perspective)
|
|
26
|
+
], Neighbourhood.prototype, "meta", void 0);
|
|
27
|
+
Neighbourhood = __decorate([
|
|
28
|
+
ObjectType(),
|
|
29
|
+
__metadata("design:paramtypes", [String, Perspective])
|
|
30
|
+
], Neighbourhood);
|
|
31
|
+
export { Neighbourhood };
|
|
32
|
+
let NeighbourhoodExpression = class NeighbourhoodExpression extends ExpressionGeneric(Neighbourhood) {
|
|
33
|
+
};
|
|
34
|
+
NeighbourhoodExpression = __decorate([
|
|
35
|
+
ObjectType()
|
|
36
|
+
], NeighbourhoodExpression);
|
|
37
|
+
export { NeighbourhoodExpression };
|
|
38
|
+
;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ApolloClient } from "@apollo/client/core";
|
|
2
|
+
import { Address } from "../Address";
|
|
3
|
+
import { DID } from "../DID";
|
|
4
|
+
import { OnlineAgent, TelepresenceSignalCallback } from "../language/Language";
|
|
5
|
+
import { Perspective, PerspectiveUnsignedInput } from "../perspectives/Perspective";
|
|
6
|
+
import { PerspectiveHandle } from "../perspectives/PerspectiveHandle";
|
|
7
|
+
export declare class NeighbourhoodClient {
|
|
8
|
+
#private;
|
|
9
|
+
constructor(client: ApolloClient<any>);
|
|
10
|
+
publishFromPerspective(perspectiveUUID: string, linkLanguage: Address, meta: Perspective): Promise<string>;
|
|
11
|
+
joinFromUrl(url: string): Promise<PerspectiveHandle>;
|
|
12
|
+
otherAgents(perspectiveUUID: string): Promise<DID[]>;
|
|
13
|
+
hasTelepresenceAdapter(perspectiveUUID: string): Promise<boolean>;
|
|
14
|
+
onlineAgents(perspectiveUUID: string): Promise<OnlineAgent[]>;
|
|
15
|
+
setOnlineStatus(perspectiveUUID: string, status: Perspective): Promise<boolean>;
|
|
16
|
+
setOnlineStatusU(perspectiveUUID: string, status: PerspectiveUnsignedInput): Promise<boolean>;
|
|
17
|
+
sendSignal(perspectiveUUID: string, remoteAgentDid: string, payload: Perspective): Promise<boolean>;
|
|
18
|
+
sendSignalU(perspectiveUUID: string, remoteAgentDid: string, payload: PerspectiveUnsignedInput): Promise<boolean>;
|
|
19
|
+
sendBroadcast(perspectiveUUID: string, payload: Perspective): Promise<boolean>;
|
|
20
|
+
sendBroadcastU(perspectiveUUID: string, payload: PerspectiveUnsignedInput): Promise<boolean>;
|
|
21
|
+
dispatchSignal(perspectiveUUID: string, signal: any): void;
|
|
22
|
+
subscribeToSignals(perspectiveUUID: string): Promise<void>;
|
|
23
|
+
addSignalHandler(perspectiveUUID: string, handler: TelepresenceSignalCallback): Promise<void>;
|
|
24
|
+
removeSignalHandler(perspectiveUUID: string, handler: TelepresenceSignalCallback): void;
|
|
25
|
+
}
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
+
};
|
|
7
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
+
};
|
|
12
|
+
var _NeighbourhoodClient_apolloClient, _NeighbourhoodClient_signalHandlers;
|
|
13
|
+
import { gql } from "@apollo/client/core";
|
|
14
|
+
import unwrapApolloResult from "../unwrapApolloResult";
|
|
15
|
+
export class NeighbourhoodClient {
|
|
16
|
+
constructor(client) {
|
|
17
|
+
_NeighbourhoodClient_apolloClient.set(this, void 0);
|
|
18
|
+
_NeighbourhoodClient_signalHandlers.set(this, new Map());
|
|
19
|
+
__classPrivateFieldSet(this, _NeighbourhoodClient_apolloClient, client, "f");
|
|
20
|
+
}
|
|
21
|
+
async publishFromPerspective(perspectiveUUID, linkLanguage, meta) {
|
|
22
|
+
const { neighbourhoodPublishFromPerspective } = unwrapApolloResult(await __classPrivateFieldGet(this, _NeighbourhoodClient_apolloClient, "f").mutate({
|
|
23
|
+
mutation: gql `mutation neighbourhoodPublishFromPerspective(
|
|
24
|
+
$linkLanguage: String!,
|
|
25
|
+
$meta: PerspectiveInput!,
|
|
26
|
+
$perspectiveUUID: String!
|
|
27
|
+
) {
|
|
28
|
+
neighbourhoodPublishFromPerspective(
|
|
29
|
+
linkLanguage: $linkLanguage,
|
|
30
|
+
meta: $meta,
|
|
31
|
+
perspectiveUUID: $perspectiveUUID
|
|
32
|
+
)
|
|
33
|
+
}`,
|
|
34
|
+
variables: { perspectiveUUID, linkLanguage, meta: meta }
|
|
35
|
+
}));
|
|
36
|
+
return neighbourhoodPublishFromPerspective;
|
|
37
|
+
}
|
|
38
|
+
async joinFromUrl(url) {
|
|
39
|
+
const { neighbourhoodJoinFromUrl } = unwrapApolloResult(await __classPrivateFieldGet(this, _NeighbourhoodClient_apolloClient, "f").mutate({
|
|
40
|
+
mutation: gql `mutation neighbourhoodJoinFromUrl($url: String!) {
|
|
41
|
+
neighbourhoodJoinFromUrl(url: $url) {
|
|
42
|
+
uuid
|
|
43
|
+
name
|
|
44
|
+
sharedUrl
|
|
45
|
+
state
|
|
46
|
+
neighbourhood {
|
|
47
|
+
data {
|
|
48
|
+
linkLanguage
|
|
49
|
+
meta {
|
|
50
|
+
links
|
|
51
|
+
{
|
|
52
|
+
author
|
|
53
|
+
timestamp
|
|
54
|
+
data { source, predicate, target }
|
|
55
|
+
proof { valid, invalid, signature, key }
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
author
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}`,
|
|
63
|
+
variables: { url }
|
|
64
|
+
}));
|
|
65
|
+
return neighbourhoodJoinFromUrl;
|
|
66
|
+
}
|
|
67
|
+
async otherAgents(perspectiveUUID) {
|
|
68
|
+
const { neighbourhoodOtherAgents } = unwrapApolloResult(await __classPrivateFieldGet(this, _NeighbourhoodClient_apolloClient, "f").query({
|
|
69
|
+
query: gql `query neighbourhoodOtherAgents($perspectiveUUID: String!) {
|
|
70
|
+
neighbourhoodOtherAgents(perspectiveUUID: $perspectiveUUID)
|
|
71
|
+
}`,
|
|
72
|
+
variables: { perspectiveUUID }
|
|
73
|
+
}));
|
|
74
|
+
return neighbourhoodOtherAgents;
|
|
75
|
+
}
|
|
76
|
+
async hasTelepresenceAdapter(perspectiveUUID) {
|
|
77
|
+
const { neighbourhoodHasTelepresenceAdapter } = unwrapApolloResult(await __classPrivateFieldGet(this, _NeighbourhoodClient_apolloClient, "f").query({
|
|
78
|
+
query: gql `query neighbourhoodHasTelepresenceAdapter($perspectiveUUID: String!) {
|
|
79
|
+
neighbourhoodHasTelepresenceAdapter(perspectiveUUID: $perspectiveUUID)
|
|
80
|
+
}`,
|
|
81
|
+
variables: { perspectiveUUID }
|
|
82
|
+
}));
|
|
83
|
+
return neighbourhoodHasTelepresenceAdapter;
|
|
84
|
+
}
|
|
85
|
+
async onlineAgents(perspectiveUUID) {
|
|
86
|
+
const { neighbourhoodOnlineAgents } = unwrapApolloResult(await __classPrivateFieldGet(this, _NeighbourhoodClient_apolloClient, "f").query({
|
|
87
|
+
query: gql `query neighbourhoodOnlineAgents($perspectiveUUID: String!) {
|
|
88
|
+
neighbourhoodOnlineAgents(perspectiveUUID: $perspectiveUUID) {
|
|
89
|
+
did
|
|
90
|
+
status {
|
|
91
|
+
author
|
|
92
|
+
timestamp
|
|
93
|
+
data {
|
|
94
|
+
links {
|
|
95
|
+
author
|
|
96
|
+
timestamp
|
|
97
|
+
data { source, predicate, target }
|
|
98
|
+
proof { valid, invalid, signature, key }
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
proof { valid, invalid, signature, key }
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}`,
|
|
105
|
+
variables: { perspectiveUUID }
|
|
106
|
+
}));
|
|
107
|
+
return neighbourhoodOnlineAgents;
|
|
108
|
+
}
|
|
109
|
+
async setOnlineStatus(perspectiveUUID, status) {
|
|
110
|
+
const { neighbourhoodSetOnlineStatus } = unwrapApolloResult(await __classPrivateFieldGet(this, _NeighbourhoodClient_apolloClient, "f").mutate({
|
|
111
|
+
mutation: gql `mutation neighbourhoodSetOnlineStatus(
|
|
112
|
+
$perspectiveUUID: String!,
|
|
113
|
+
$status: PerspectiveInput!
|
|
114
|
+
) {
|
|
115
|
+
neighbourhoodSetOnlineStatus(
|
|
116
|
+
perspectiveUUID: $perspectiveUUID,
|
|
117
|
+
status: $status
|
|
118
|
+
)
|
|
119
|
+
}`,
|
|
120
|
+
variables: { perspectiveUUID, status }
|
|
121
|
+
}));
|
|
122
|
+
return neighbourhoodSetOnlineStatus;
|
|
123
|
+
}
|
|
124
|
+
async setOnlineStatusU(perspectiveUUID, status) {
|
|
125
|
+
const { neighbourhoodSetOnlineStatusU } = unwrapApolloResult(await __classPrivateFieldGet(this, _NeighbourhoodClient_apolloClient, "f").mutate({
|
|
126
|
+
mutation: gql `mutation neighbourhoodSetOnlineStatusU(
|
|
127
|
+
$perspectiveUUID: String!,
|
|
128
|
+
$status: PerspectiveUnsignedInput!
|
|
129
|
+
) {
|
|
130
|
+
neighbourhoodSetOnlineStatusU(
|
|
131
|
+
perspectiveUUID: $perspectiveUUID,
|
|
132
|
+
status: $status
|
|
133
|
+
)
|
|
134
|
+
}`,
|
|
135
|
+
variables: { perspectiveUUID, status }
|
|
136
|
+
}));
|
|
137
|
+
return neighbourhoodSetOnlineStatusU;
|
|
138
|
+
}
|
|
139
|
+
async sendSignal(perspectiveUUID, remoteAgentDid, payload) {
|
|
140
|
+
const { neighbourhoodSendSignal } = unwrapApolloResult(await __classPrivateFieldGet(this, _NeighbourhoodClient_apolloClient, "f").mutate({
|
|
141
|
+
mutation: gql `mutation neighbourhoodSendSignal(
|
|
142
|
+
$perspectiveUUID: String!,
|
|
143
|
+
$remoteAgentDid: String!,
|
|
144
|
+
$payload: PerspectiveInput!
|
|
145
|
+
) {
|
|
146
|
+
neighbourhoodSendSignal(
|
|
147
|
+
perspectiveUUID: $perspectiveUUID,
|
|
148
|
+
remoteAgentDid: $remoteAgentDid,
|
|
149
|
+
payload: $payload
|
|
150
|
+
)
|
|
151
|
+
}`,
|
|
152
|
+
variables: { perspectiveUUID, remoteAgentDid, payload }
|
|
153
|
+
}));
|
|
154
|
+
return neighbourhoodSendSignal;
|
|
155
|
+
}
|
|
156
|
+
async sendSignalU(perspectiveUUID, remoteAgentDid, payload) {
|
|
157
|
+
const { neighbourhoodSendSignalU } = unwrapApolloResult(await __classPrivateFieldGet(this, _NeighbourhoodClient_apolloClient, "f").mutate({
|
|
158
|
+
mutation: gql `mutation neighbourhoodSendSignalU(
|
|
159
|
+
$perspectiveUUID: String!,
|
|
160
|
+
$remoteAgentDid: String!,
|
|
161
|
+
$payload: PerspectiveUnsignedInput!
|
|
162
|
+
) {
|
|
163
|
+
neighbourhoodSendSignalU(
|
|
164
|
+
perspectiveUUID: $perspectiveUUID,
|
|
165
|
+
remoteAgentDid: $remoteAgentDid,
|
|
166
|
+
payload: $payload
|
|
167
|
+
)
|
|
168
|
+
}`,
|
|
169
|
+
variables: { perspectiveUUID, remoteAgentDid, payload }
|
|
170
|
+
}));
|
|
171
|
+
return neighbourhoodSendSignalU;
|
|
172
|
+
}
|
|
173
|
+
async sendBroadcast(perspectiveUUID, payload) {
|
|
174
|
+
const { neighbourhoodSendBroadcast } = unwrapApolloResult(await __classPrivateFieldGet(this, _NeighbourhoodClient_apolloClient, "f").mutate({
|
|
175
|
+
mutation: gql `mutation neighbourhoodSendBroadcast(
|
|
176
|
+
$perspectiveUUID: String!,
|
|
177
|
+
$payload: PerspectiveInput!
|
|
178
|
+
) {
|
|
179
|
+
neighbourhoodSendBroadcast(
|
|
180
|
+
perspectiveUUID: $perspectiveUUID,
|
|
181
|
+
payload: $payload
|
|
182
|
+
)
|
|
183
|
+
}`,
|
|
184
|
+
variables: { perspectiveUUID, payload }
|
|
185
|
+
}));
|
|
186
|
+
return neighbourhoodSendBroadcast;
|
|
187
|
+
}
|
|
188
|
+
async sendBroadcastU(perspectiveUUID, payload) {
|
|
189
|
+
const { neighbourhoodSendBroadcastU } = unwrapApolloResult(await __classPrivateFieldGet(this, _NeighbourhoodClient_apolloClient, "f").mutate({
|
|
190
|
+
mutation: gql `mutation neighbourhoodSendBroadcastU(
|
|
191
|
+
$perspectiveUUID: String!,
|
|
192
|
+
$payload: PerspectiveUnsignedInput!
|
|
193
|
+
) {
|
|
194
|
+
neighbourhoodSendBroadcastU(
|
|
195
|
+
perspectiveUUID: $perspectiveUUID,
|
|
196
|
+
payload: $payload
|
|
197
|
+
)
|
|
198
|
+
}`,
|
|
199
|
+
variables: { perspectiveUUID, payload }
|
|
200
|
+
}));
|
|
201
|
+
return neighbourhoodSendBroadcastU;
|
|
202
|
+
}
|
|
203
|
+
dispatchSignal(perspectiveUUID, signal) {
|
|
204
|
+
const handlers = __classPrivateFieldGet(this, _NeighbourhoodClient_signalHandlers, "f").get(perspectiveUUID);
|
|
205
|
+
if (handlers) {
|
|
206
|
+
handlers.forEach(handler => handler(signal));
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
async subscribeToSignals(perspectiveUUID) {
|
|
210
|
+
const that = this;
|
|
211
|
+
await __classPrivateFieldGet(this, _NeighbourhoodClient_apolloClient, "f").subscribe({
|
|
212
|
+
query: gql `subscription neighbourhoodSignal($perspectiveUUID: String!) {
|
|
213
|
+
neighbourhoodSignal(perspectiveUUID: $perspectiveUUID) {
|
|
214
|
+
author
|
|
215
|
+
timestamp
|
|
216
|
+
data {
|
|
217
|
+
links
|
|
218
|
+
{
|
|
219
|
+
author
|
|
220
|
+
timestamp
|
|
221
|
+
data { source, predicate, target }
|
|
222
|
+
proof { valid, invalid, signature, key }
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
proof { valid, invalid, signature, key }
|
|
226
|
+
}
|
|
227
|
+
}`,
|
|
228
|
+
variables: { perspectiveUUID }
|
|
229
|
+
}).subscribe({
|
|
230
|
+
next: (result) => {
|
|
231
|
+
const { neighbourhoodSignal } = unwrapApolloResult(result);
|
|
232
|
+
that.dispatchSignal(perspectiveUUID, neighbourhoodSignal);
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
async addSignalHandler(perspectiveUUID, handler) {
|
|
237
|
+
let handlersForPerspective = __classPrivateFieldGet(this, _NeighbourhoodClient_signalHandlers, "f").get(perspectiveUUID);
|
|
238
|
+
if (!handlersForPerspective) {
|
|
239
|
+
handlersForPerspective = [];
|
|
240
|
+
await this.subscribeToSignals(perspectiveUUID);
|
|
241
|
+
}
|
|
242
|
+
handlersForPerspective.push(handler);
|
|
243
|
+
__classPrivateFieldGet(this, _NeighbourhoodClient_signalHandlers, "f").set(perspectiveUUID, handlersForPerspective);
|
|
244
|
+
}
|
|
245
|
+
removeSignalHandler(perspectiveUUID, handler) {
|
|
246
|
+
const handlersForPerspective = __classPrivateFieldGet(this, _NeighbourhoodClient_signalHandlers, "f").get(perspectiveUUID);
|
|
247
|
+
if (handlersForPerspective) {
|
|
248
|
+
const index = handlersForPerspective.indexOf(handler);
|
|
249
|
+
if (index > -1) {
|
|
250
|
+
handlersForPerspective.splice(index, 1);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
__classPrivateFieldGet(this, _NeighbourhoodClient_signalHandlers, "f").set(perspectiveUUID, handlersForPerspective);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
_NeighbourhoodClient_apolloClient = new WeakMap(), _NeighbourhoodClient_signalHandlers = new WeakMap();
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { DID } from "../DID";
|
|
2
|
+
import { OnlineAgent } from "../language/Language";
|
|
3
|
+
import { Perspective, PerspectiveExpression, PerspectiveUnsignedInput } from "../perspectives/Perspective";
|
|
4
|
+
import { NeighbourhoodClient } from "./NeighbourhoodClient";
|
|
5
|
+
export declare class NeighbourhoodProxy {
|
|
6
|
+
#private;
|
|
7
|
+
constructor(client: NeighbourhoodClient, pID: string);
|
|
8
|
+
otherAgents(): Promise<DID[]>;
|
|
9
|
+
hasTelepresenceAdapter(): Promise<boolean>;
|
|
10
|
+
onlineAgents(): Promise<OnlineAgent[]>;
|
|
11
|
+
setOnlineStatus(status: Perspective): Promise<boolean>;
|
|
12
|
+
setOnlineStatusU(status: PerspectiveUnsignedInput): Promise<boolean>;
|
|
13
|
+
sendSignal(remoteAgentDid: string, payload: Perspective): Promise<boolean>;
|
|
14
|
+
sendSignalU(remoteAgentDid: string, payload: PerspectiveUnsignedInput): Promise<boolean>;
|
|
15
|
+
sendBroadcast(payload: Perspective): Promise<boolean>;
|
|
16
|
+
sendBroadcastU(payload: PerspectiveUnsignedInput): Promise<boolean>;
|
|
17
|
+
addSignalHandler(handler: (payload: PerspectiveExpression) => void): Promise<void>;
|
|
18
|
+
removeSignalHandler(handler: (payload: PerspectiveExpression) => void): void;
|
|
19
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
+
};
|
|
7
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
+
};
|
|
12
|
+
var _NeighbourhoodProxy_client, _NeighbourhoodProxy_pID;
|
|
13
|
+
export class NeighbourhoodProxy {
|
|
14
|
+
constructor(client, pID) {
|
|
15
|
+
_NeighbourhoodProxy_client.set(this, void 0);
|
|
16
|
+
_NeighbourhoodProxy_pID.set(this, void 0);
|
|
17
|
+
__classPrivateFieldSet(this, _NeighbourhoodProxy_client, client, "f");
|
|
18
|
+
__classPrivateFieldSet(this, _NeighbourhoodProxy_pID, pID, "f");
|
|
19
|
+
}
|
|
20
|
+
async otherAgents() {
|
|
21
|
+
return await __classPrivateFieldGet(this, _NeighbourhoodProxy_client, "f").otherAgents(__classPrivateFieldGet(this, _NeighbourhoodProxy_pID, "f"));
|
|
22
|
+
}
|
|
23
|
+
async hasTelepresenceAdapter() {
|
|
24
|
+
return await __classPrivateFieldGet(this, _NeighbourhoodProxy_client, "f").hasTelepresenceAdapter(__classPrivateFieldGet(this, _NeighbourhoodProxy_pID, "f"));
|
|
25
|
+
}
|
|
26
|
+
async onlineAgents() {
|
|
27
|
+
return await __classPrivateFieldGet(this, _NeighbourhoodProxy_client, "f").onlineAgents(__classPrivateFieldGet(this, _NeighbourhoodProxy_pID, "f"));
|
|
28
|
+
}
|
|
29
|
+
async setOnlineStatus(status) {
|
|
30
|
+
return await __classPrivateFieldGet(this, _NeighbourhoodProxy_client, "f").setOnlineStatus(__classPrivateFieldGet(this, _NeighbourhoodProxy_pID, "f"), status);
|
|
31
|
+
}
|
|
32
|
+
async setOnlineStatusU(status) {
|
|
33
|
+
return await __classPrivateFieldGet(this, _NeighbourhoodProxy_client, "f").setOnlineStatusU(__classPrivateFieldGet(this, _NeighbourhoodProxy_pID, "f"), status);
|
|
34
|
+
}
|
|
35
|
+
async sendSignal(remoteAgentDid, payload) {
|
|
36
|
+
return await __classPrivateFieldGet(this, _NeighbourhoodProxy_client, "f").sendSignal(__classPrivateFieldGet(this, _NeighbourhoodProxy_pID, "f"), remoteAgentDid, payload);
|
|
37
|
+
}
|
|
38
|
+
async sendSignalU(remoteAgentDid, payload) {
|
|
39
|
+
return await __classPrivateFieldGet(this, _NeighbourhoodProxy_client, "f").sendSignalU(__classPrivateFieldGet(this, _NeighbourhoodProxy_pID, "f"), remoteAgentDid, payload);
|
|
40
|
+
}
|
|
41
|
+
async sendBroadcast(payload) {
|
|
42
|
+
return await __classPrivateFieldGet(this, _NeighbourhoodProxy_client, "f").sendBroadcast(__classPrivateFieldGet(this, _NeighbourhoodProxy_pID, "f"), payload);
|
|
43
|
+
}
|
|
44
|
+
async sendBroadcastU(payload) {
|
|
45
|
+
return await __classPrivateFieldGet(this, _NeighbourhoodProxy_client, "f").sendBroadcastU(__classPrivateFieldGet(this, _NeighbourhoodProxy_pID, "f"), payload);
|
|
46
|
+
}
|
|
47
|
+
async addSignalHandler(handler) {
|
|
48
|
+
await __classPrivateFieldGet(this, _NeighbourhoodProxy_client, "f").addSignalHandler(__classPrivateFieldGet(this, _NeighbourhoodProxy_pID, "f"), handler);
|
|
49
|
+
}
|
|
50
|
+
removeSignalHandler(handler) {
|
|
51
|
+
__classPrivateFieldGet(this, _NeighbourhoodProxy_client, "f").removeSignalHandler(__classPrivateFieldGet(this, _NeighbourhoodProxy_pID, "f"), handler);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
_NeighbourhoodProxy_client = new WeakMap(), _NeighbourhoodProxy_pID = new WeakMap();
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { PerspectiveHandle } from "../perspectives/PerspectiveHandle";
|
|
2
|
+
import { PerspectiveExpression, PerspectiveInput, PerspectiveUnsignedInput } from "../perspectives/Perspective";
|
|
3
|
+
import { DID } from "../DID";
|
|
4
|
+
import { OnlineAgent } from "../language/Language";
|
|
5
|
+
/**
|
|
6
|
+
* Resolver classes are used here to define the GraphQL schema
|
|
7
|
+
* (through the type-graphql annotations)
|
|
8
|
+
* and are spawned in the client tests in Ad4mClient.test.ts.
|
|
9
|
+
* For the latter, they return test fixtures.
|
|
10
|
+
*/
|
|
11
|
+
export default class NeighbourhoodResolver {
|
|
12
|
+
neighbourhoodPublishFromPerspective(perspectiveUUID: string, linkLanguage: string, meta: PerspectiveInput): string;
|
|
13
|
+
neighbourhoodJoinFromUrl(url: string, pubSub: any): PerspectiveHandle;
|
|
14
|
+
neighbourhoodOtherAgents(perspectiveUUID: string): DID[];
|
|
15
|
+
neighbourhoodHasTelepresenceAdapter(perspectiveUUID: string): boolean;
|
|
16
|
+
neighbourhoodOnlineAgents(perspectiveUUID: string): OnlineAgent[];
|
|
17
|
+
neighbourhoodSetOnlineStatus(perspectiveUUID: string, status: PerspectiveInput): boolean;
|
|
18
|
+
neighbourhoodSetOnlineStatusU(perspectiveUUID: string, status: PerspectiveUnsignedInput): boolean;
|
|
19
|
+
neighbourhoodSendSignal(perspectiveUUID: string, recipient: DID, signal: PerspectiveInput): boolean;
|
|
20
|
+
neighbourhoodSendSignalU(perspectiveUUID: string, recipient: DID, signal: PerspectiveUnsignedInput): boolean;
|
|
21
|
+
neighbourhoodSendBroadcast(perspectiveUUID: string, signal: PerspectiveInput): boolean;
|
|
22
|
+
neighbourhoodSendBroadcastU(perspectiveUUID: string, signal: PerspectiveUnsignedInput): boolean;
|
|
23
|
+
neighbourhoodSignal(pID: string): PerspectiveExpression;
|
|
24
|
+
}
|