@coasys/ad4m 0.8.0-fix → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +229 -229
- package/jest.config.js +5 -5
- package/jsdoc.json +27 -27
- package/lib/index.cjs +4522 -4571
- package/lib/index.js +4522 -4571
- package/lib/shims/type-graphql.d.ts +32 -32
- package/lib/shims/type-graphql.js +70 -70
- package/lib/src/Ad4mClient.d.ts +26 -26
- package/lib/src/Ad4mClient.js +66 -66
- package/lib/src/Address.d.ts +1 -1
- package/lib/src/Address.js +1 -1
- package/lib/src/DID.d.ts +1 -1
- package/lib/src/DID.js +1 -1
- package/lib/src/Exception.d.ts +6 -6
- package/lib/src/Exception.js +7 -7
- package/lib/src/Literal.d.ts +7 -7
- package/lib/src/Literal.js +76 -76
- package/lib/src/PubSub.d.ts +14 -14
- package/lib/src/PubSub.js +14 -14
- package/lib/src/SmartLiteral.d.ts +12 -12
- package/lib/src/SmartLiteral.js +74 -74
- package/lib/src/agent/Agent.d.ts +104 -104
- package/lib/src/agent/Agent.js +337 -337
- package/lib/src/agent/AgentClient.d.ts +57 -57
- package/lib/src/agent/AgentClient.js +431 -431
- package/lib/src/agent/AgentResolver.d.ts +30 -30
- package/lib/src/agent/AgentResolver.js +325 -325
- package/lib/src/agent/AgentStatus.d.ts +8 -8
- package/lib/src/agent/AgentStatus.js +61 -61
- package/lib/src/buildSchema.d.ts +1 -1
- package/lib/src/buildSchema.js +36 -36
- package/lib/src/expression/Expression.d.ts +28 -28
- package/lib/src/expression/Expression.js +143 -143
- package/lib/src/expression/ExpressionClient.d.ts +13 -13
- package/lib/src/expression/ExpressionClient.js +102 -102
- package/lib/src/expression/ExpressionRef.d.ts +9 -9
- package/lib/src/expression/ExpressionRef.js +67 -67
- package/lib/src/expression/ExpressionResolver.d.ts +10 -10
- package/lib/src/expression/ExpressionResolver.js +106 -106
- package/lib/src/index.d.ts +30 -30
- package/lib/src/index.js +30 -30
- package/lib/src/jestSetup.d.ts +1 -1
- package/lib/src/jestSetup.js +1 -1
- package/lib/src/language/Icon.d.ts +4 -4
- package/lib/src/language/Icon.js +24 -24
- package/lib/src/language/Language.d.ts +195 -195
- package/lib/src/language/Language.js +79 -79
- package/lib/src/language/LanguageClient.d.ts +17 -17
- package/lib/src/language/LanguageClient.js +137 -137
- package/lib/src/language/LanguageContext.d.ts +37 -37
- package/lib/src/language/LanguageContext.js +2 -2
- package/lib/src/language/LanguageHandle.d.ts +9 -9
- package/lib/src/language/LanguageHandle.js +41 -41
- package/lib/src/language/LanguageMeta.d.ts +35 -35
- package/lib/src/language/LanguageMeta.js +89 -89
- package/lib/src/language/LanguageRef.d.ts +6 -6
- package/lib/src/language/LanguageRef.js +30 -30
- package/lib/src/language/LanguageResolver.d.ts +19 -19
- package/lib/src/language/LanguageResolver.js +143 -143
- package/lib/src/links/Links.d.ts +39 -39
- package/lib/src/links/Links.js +148 -148
- package/lib/src/links/Links.test.d.ts +1 -1
- package/lib/src/links/Links.test.js +33 -33
- package/lib/src/neighbourhood/Neighbourhood.d.ts +10 -10
- package/lib/src/neighbourhood/Neighbourhood.js +38 -38
- package/lib/src/neighbourhood/NeighbourhoodClient.d.ts +25 -25
- package/lib/src/neighbourhood/NeighbourhoodClient.js +256 -256
- package/lib/src/neighbourhood/NeighbourhoodProxy.d.ts +19 -19
- package/lib/src/neighbourhood/NeighbourhoodProxy.js +54 -54
- package/lib/src/neighbourhood/NeighbourhoodResolver.d.ts +24 -24
- package/lib/src/neighbourhood/NeighbourhoodResolver.js +180 -180
- package/lib/src/perspectives/LinkQuery.d.ts +11 -11
- package/lib/src/perspectives/LinkQuery.js +80 -80
- package/lib/src/perspectives/Perspective.d.ts +38 -38
- package/lib/src/perspectives/Perspective.js +144 -144
- package/lib/src/perspectives/Perspective.test.d.ts +1 -1
- package/lib/src/perspectives/Perspective.test.js +20 -20
- package/lib/src/perspectives/PerspectiveClient.d.ts +55 -54
- package/lib/src/perspectives/PerspectiveClient.js +418 -410
- package/lib/src/perspectives/PerspectiveDiff.d.ts +9 -9
- package/lib/src/perspectives/PerspectiveDiff.js +33 -33
- package/lib/src/perspectives/PerspectiveHandle.d.ts +16 -16
- package/lib/src/perspectives/PerspectiveHandle.js +59 -59
- package/lib/src/perspectives/PerspectiveProxy.d.ts +178 -178
- package/lib/src/perspectives/PerspectiveProxy.js +501 -540
- package/lib/src/perspectives/PerspectiveResolver.d.ts +38 -37
- package/lib/src/perspectives/PerspectiveResolver.js +376 -362
- package/lib/src/runtime/RuntimeClient.d.ts +33 -33
- package/lib/src/runtime/RuntimeClient.js +263 -263
- package/lib/src/runtime/RuntimeResolver.d.ts +47 -47
- package/lib/src/runtime/RuntimeResolver.js +328 -328
- package/lib/src/schema.gql +1 -0
- package/lib/src/subject/SDNADecorators.d.ts +45 -45
- package/lib/src/subject/SDNADecorators.js +250 -250
- package/lib/src/subject/Subject.d.ts +7 -7
- package/lib/src/subject/Subject.js +160 -160
- package/lib/src/subject/SubjectEntity.d.ts +31 -31
- package/lib/src/subject/SubjectEntity.js +250 -250
- package/lib/src/subject/util.d.ts +12 -12
- package/lib/src/subject/util.js +73 -73
- package/lib/src/typeDefs.d.ts +1 -1
- package/lib/src/typeDefs.js +1 -0
- package/lib/src/unwrapApolloResult.d.ts +2 -2
- package/lib/src/unwrapApolloResult.js +14 -12
- package/lib/src/utils.d.ts +2 -2
- package/lib/src/utils.js +21 -21
- package/package.json +61 -61
- package/rollup.config.js +26 -26
- package/shims/type-graphql.ts +75 -75
- package/src/Ad4mClient.test.ts +1089 -1084
- package/src/Ad4mClient.ts +62 -62
- package/src/Address.ts +1 -1
- package/src/Exception.ts +6 -6
- package/src/Literal.test.ts +30 -30
- package/src/Literal.ts +80 -80
- package/src/PubSub.ts +13 -13
- package/src/SmartLiteral.ts +74 -74
- package/src/agent/Agent.ts +293 -293
- package/src/agent/AgentClient.ts +531 -531
- package/src/agent/AgentResolver.ts +263 -263
- package/src/agent/AgentStatus.ts +43 -43
- package/src/buildSchema.ts +41 -41
- package/src/expression/Expression.ts +99 -99
- package/src/expression/ExpressionClient.ts +98 -98
- package/src/expression/ExpressionRef.ts +62 -62
- package/src/expression/ExpressionResolver.ts +63 -63
- package/src/index.ts +30 -30
- package/src/language/Icon.ts +10 -10
- package/src/language/Language.ts +266 -266
- package/src/language/LanguageClient.ts +159 -159
- package/src/language/LanguageContext.ts +37 -37
- package/src/language/LanguageHandle.ts +23 -23
- package/src/language/LanguageMeta.ts +69 -69
- package/src/language/LanguageRef.ts +18 -18
- package/src/language/LanguageResolver.ts +98 -98
- package/src/links/Links.test.ts +39 -39
- package/src/links/Links.ts +107 -107
- package/src/neighbourhood/Neighbourhood.ts +22 -22
- package/src/neighbourhood/NeighbourhoodClient.ts +275 -275
- package/src/neighbourhood/NeighbourhoodProxy.ts +58 -58
- package/src/neighbourhood/NeighbourhoodResolver.ts +99 -99
- package/src/perspectives/LinkQuery.ts +65 -65
- package/src/perspectives/Perspective.test.ts +22 -22
- package/src/perspectives/Perspective.ts +118 -118
- package/src/perspectives/PerspectiveClient.ts +452 -443
- package/src/perspectives/PerspectiveDiff.ts +15 -15
- package/src/perspectives/PerspectiveHandle.ts +39 -39
- package/src/perspectives/PerspectiveProxy.ts +576 -610
- package/src/perspectives/PerspectiveResolver.ts +224 -219
- package/src/runtime/RuntimeClient.ts +282 -282
- package/src/runtime/RuntimeResolver.ts +192 -192
- package/src/subject/SDNADecorators.ts +333 -333
- package/src/subject/Subject.ts +152 -152
- package/src/subject/SubjectEntity.ts +291 -291
- package/src/subject/util.ts +84 -84
- package/src/typeDefs.ts +5 -5
- package/src/unwrapApolloResult.ts +15 -13
- package/src/utils.ts +25 -25
- package/tsconfig-browser.json +82 -82
- package/tsconfig.json +80 -80
- package/yarn-error.log +0 -22814
package/lib/src/links/Links.d.ts
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { LinkStatus } from "../perspectives/PerspectiveProxy";
|
|
2
|
-
export declare class Link {
|
|
3
|
-
source: string;
|
|
4
|
-
target: string;
|
|
5
|
-
predicate?: string;
|
|
6
|
-
constructor(obj: any);
|
|
7
|
-
}
|
|
8
|
-
export declare class LinkMutations {
|
|
9
|
-
additions: LinkInput[];
|
|
10
|
-
removals: LinkExpressionInput[];
|
|
11
|
-
}
|
|
12
|
-
export declare class LinkExpressionMutations {
|
|
13
|
-
additions: LinkExpression[];
|
|
14
|
-
removals: LinkExpression[];
|
|
15
|
-
constructor(additions: LinkExpression[], removals: LinkExpression[]);
|
|
16
|
-
}
|
|
17
|
-
export declare class LinkInput {
|
|
18
|
-
source: string;
|
|
19
|
-
target: string;
|
|
20
|
-
predicate?: string;
|
|
21
|
-
}
|
|
22
|
-
declare const LinkExpression_base: any;
|
|
23
|
-
export declare class LinkExpression extends LinkExpression_base {
|
|
24
|
-
hash(): number;
|
|
25
|
-
status?: LinkStatus;
|
|
26
|
-
}
|
|
27
|
-
declare const LinkExpressionInput_base: any;
|
|
28
|
-
export declare class LinkExpressionInput extends LinkExpressionInput_base {
|
|
29
|
-
hash: () => number;
|
|
30
|
-
status?: LinkStatus;
|
|
31
|
-
}
|
|
32
|
-
export declare function linkEqual(l1: LinkExpression, l2: LinkExpression): boolean;
|
|
33
|
-
export declare function isLink(l: any): boolean;
|
|
34
|
-
export declare class LinkExpressionUpdated {
|
|
35
|
-
oldLink: LinkExpression;
|
|
36
|
-
newLink: LinkExpression;
|
|
37
|
-
constructor(oldLink: LinkExpression, newLink: LinkExpression);
|
|
38
|
-
}
|
|
39
|
-
export {};
|
|
1
|
+
import { LinkStatus } from "../perspectives/PerspectiveProxy";
|
|
2
|
+
export declare class Link {
|
|
3
|
+
source: string;
|
|
4
|
+
target: string;
|
|
5
|
+
predicate?: string;
|
|
6
|
+
constructor(obj: any);
|
|
7
|
+
}
|
|
8
|
+
export declare class LinkMutations {
|
|
9
|
+
additions: LinkInput[];
|
|
10
|
+
removals: LinkExpressionInput[];
|
|
11
|
+
}
|
|
12
|
+
export declare class LinkExpressionMutations {
|
|
13
|
+
additions: LinkExpression[];
|
|
14
|
+
removals: LinkExpression[];
|
|
15
|
+
constructor(additions: LinkExpression[], removals: LinkExpression[]);
|
|
16
|
+
}
|
|
17
|
+
export declare class LinkInput {
|
|
18
|
+
source: string;
|
|
19
|
+
target: string;
|
|
20
|
+
predicate?: string;
|
|
21
|
+
}
|
|
22
|
+
declare const LinkExpression_base: any;
|
|
23
|
+
export declare class LinkExpression extends LinkExpression_base {
|
|
24
|
+
hash(): number;
|
|
25
|
+
status?: LinkStatus;
|
|
26
|
+
}
|
|
27
|
+
declare const LinkExpressionInput_base: any;
|
|
28
|
+
export declare class LinkExpressionInput extends LinkExpressionInput_base {
|
|
29
|
+
hash: () => number;
|
|
30
|
+
status?: LinkStatus;
|
|
31
|
+
}
|
|
32
|
+
export declare function linkEqual(l1: LinkExpression, l2: LinkExpression): boolean;
|
|
33
|
+
export declare function isLink(l: any): boolean;
|
|
34
|
+
export declare class LinkExpressionUpdated {
|
|
35
|
+
oldLink: LinkExpression;
|
|
36
|
+
newLink: LinkExpression;
|
|
37
|
+
constructor(oldLink: LinkExpression, newLink: LinkExpression);
|
|
38
|
+
}
|
|
39
|
+
export {};
|
package/lib/src/links/Links.js
CHANGED
|
@@ -1,148 +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 };
|
|
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 };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,33 +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
|
-
});
|
|
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
|
+
});
|
|
@@ -1,10 +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 {};
|
|
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 {};
|
|
@@ -1,38 +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
|
-
;
|
|
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
|
+
;
|
|
@@ -1,25 +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
|
-
}
|
|
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
|
+
}
|