@coasys/ad4m 0.8.0 → 0.8.2-prerelease

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/lib/index.cjs +29 -53
  2. package/lib/index.js +8085 -0
  3. package/lib/shims/reflect-metadata.js +0 -0
  4. package/lib/shims/type-graphql.js +70 -0
  5. package/lib/src/Ad4mClient.js +66 -0
  6. package/lib/src/Address.js +1 -0
  7. package/lib/src/DID.js +1 -0
  8. package/lib/src/Exception.js +7 -0
  9. package/lib/src/Literal.js +76 -0
  10. package/lib/src/PubSub.js +14 -0
  11. package/lib/src/SmartLiteral.js +74 -0
  12. package/lib/src/agent/Agent.js +337 -0
  13. package/lib/src/agent/AgentClient.js +431 -0
  14. package/lib/src/agent/AgentResolver.js +325 -0
  15. package/lib/src/agent/AgentStatus.js +61 -0
  16. package/lib/src/buildSchema.js +36 -0
  17. package/lib/src/expression/Expression.js +143 -0
  18. package/lib/src/expression/ExpressionClient.js +102 -0
  19. package/lib/src/expression/ExpressionRef.js +67 -0
  20. package/lib/src/expression/ExpressionResolver.js +106 -0
  21. package/lib/src/index.js +30 -0
  22. package/lib/src/jestSetup.js +1 -0
  23. package/lib/src/language/Icon.js +24 -0
  24. package/lib/src/language/Language.js +79 -0
  25. package/lib/src/language/LanguageClient.js +137 -0
  26. package/lib/src/language/LanguageContext.js +2 -0
  27. package/lib/src/language/LanguageHandle.js +41 -0
  28. package/lib/src/language/LanguageMeta.js +89 -0
  29. package/lib/src/language/LanguageRef.js +30 -0
  30. package/lib/src/language/LanguageResolver.js +143 -0
  31. package/lib/src/links/Links.js +148 -0
  32. package/lib/src/links/Links.test.js +33 -0
  33. package/lib/src/neighbourhood/Neighbourhood.js +38 -0
  34. package/lib/src/neighbourhood/NeighbourhoodClient.js +256 -0
  35. package/lib/src/neighbourhood/NeighbourhoodProxy.js +54 -0
  36. package/lib/src/neighbourhood/NeighbourhoodResolver.js +180 -0
  37. package/lib/src/perspectives/LinkQuery.js +80 -0
  38. package/lib/src/perspectives/Perspective.js +144 -0
  39. package/lib/src/perspectives/Perspective.test.js +20 -0
  40. package/lib/src/perspectives/PerspectiveClient.d.ts +1 -0
  41. package/lib/src/perspectives/PerspectiveClient.js +418 -0
  42. package/lib/src/perspectives/PerspectiveDiff.js +33 -0
  43. package/lib/src/perspectives/PerspectiveHandle.js +59 -0
  44. package/lib/src/perspectives/PerspectiveProxy.d.ts +8 -8
  45. package/lib/src/perspectives/PerspectiveProxy.js +501 -0
  46. package/lib/src/perspectives/PerspectiveResolver.d.ts +1 -0
  47. package/lib/src/perspectives/PerspectiveResolver.js +376 -0
  48. package/lib/src/runtime/RuntimeClient.js +263 -0
  49. package/lib/src/runtime/RuntimeResolver.js +328 -0
  50. package/lib/src/schema.gql +1 -0
  51. package/lib/src/subject/SDNADecorators.js +250 -0
  52. package/lib/src/subject/Subject.js +164 -0
  53. package/lib/src/subject/SubjectEntity.js +250 -0
  54. package/lib/src/subject/util.js +73 -0
  55. package/lib/src/typeDefs.js +380 -0
  56. package/lib/src/unwrapApolloResult.js +14 -0
  57. package/lib/src/utils.js +21 -0
  58. package/package.json +9 -2
  59. package/patches/graphql@15.7.2.patch +39 -0
  60. package/pnpm-workspace.yaml +19 -0
  61. package/src/Ad4mClient.test.ts +5 -0
  62. package/src/perspectives/PerspectiveClient.ts +9 -0
  63. package/src/perspectives/PerspectiveProxy.ts +22 -56
  64. package/src/perspectives/PerspectiveResolver.ts +5 -0
  65. package/src/subject/Subject.ts +9 -6
  66. package/src/unwrapApolloResult.ts +3 -1
@@ -0,0 +1,180 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
11
+ return function (target, key) { decorator(target, key, paramIndex); }
12
+ };
13
+ import { Arg, Mutation, Query, Resolver, Subscription, PubSub } from "type-graphql";
14
+ import { PerspectiveHandle, PerspectiveState } from "../perspectives/PerspectiveHandle";
15
+ import { Perspective, PerspectiveExpression, PerspectiveInput, PerspectiveUnsignedInput } from "../perspectives/Perspective";
16
+ import { TEST_AGENT_DID } from "../agent/AgentResolver";
17
+ import { OnlineAgent } from "../language/Language";
18
+ import { testLink } from "../perspectives/PerspectiveResolver";
19
+ import { NEIGHBOURHOOD_SIGNAL_RECEIVED_TOPIC, PERSPECTIVE_UPDATED_TOPIC } from "../PubSub";
20
+ const testPerspectiveExpression = new PerspectiveExpression();
21
+ testPerspectiveExpression.author = TEST_AGENT_DID;
22
+ testPerspectiveExpression.timestamp = new Date().toISOString();
23
+ testPerspectiveExpression.data = new Perspective([testLink]);
24
+ testPerspectiveExpression.proof = {
25
+ signature: '',
26
+ key: '',
27
+ valid: true
28
+ };
29
+ /**
30
+ * Resolver classes are used here to define the GraphQL schema
31
+ * (through the type-graphql annotations)
32
+ * and are spawned in the client tests in Ad4mClient.test.ts.
33
+ * For the latter, they return test fixtures.
34
+ */
35
+ let NeighbourhoodResolver = class NeighbourhoodResolver {
36
+ neighbourhoodPublishFromPerspective(perspectiveUUID, linkLanguage, meta) {
37
+ return "neighbourhood://neighbourhoodAddress";
38
+ }
39
+ neighbourhoodJoinFromUrl(url, pubSub) {
40
+ const perspective = new PerspectiveHandle;
41
+ perspective.name = "test-perspective";
42
+ perspective.sharedUrl = url;
43
+ perspective.uuid = "234234234";
44
+ perspective.state = PerspectiveState.Synced;
45
+ pubSub.publish(PERSPECTIVE_UPDATED_TOPIC, { perspective });
46
+ return perspective;
47
+ }
48
+ neighbourhoodOtherAgents(perspectiveUUID) {
49
+ return ['did:test:other'];
50
+ }
51
+ neighbourhoodHasTelepresenceAdapter(perspectiveUUID) {
52
+ return true;
53
+ }
54
+ neighbourhoodOnlineAgents(perspectiveUUID) {
55
+ const onlineAgent = new OnlineAgent();
56
+ onlineAgent.did = 'did:test:online';
57
+ onlineAgent.status = testPerspectiveExpression;
58
+ return [onlineAgent];
59
+ }
60
+ neighbourhoodSetOnlineStatus(perspectiveUUID, status) {
61
+ return true;
62
+ }
63
+ neighbourhoodSetOnlineStatusU(perspectiveUUID, status) {
64
+ return true;
65
+ }
66
+ neighbourhoodSendSignal(perspectiveUUID, recipient, signal) {
67
+ return true;
68
+ }
69
+ neighbourhoodSendSignalU(perspectiveUUID, recipient, signal) {
70
+ return true;
71
+ }
72
+ neighbourhoodSendBroadcast(perspectiveUUID, signal) {
73
+ return true;
74
+ }
75
+ neighbourhoodSendBroadcastU(perspectiveUUID, signal) {
76
+ return true;
77
+ }
78
+ neighbourhoodSignal(pID) {
79
+ return testPerspectiveExpression;
80
+ }
81
+ };
82
+ __decorate([
83
+ Mutation(returns => String),
84
+ __param(0, Arg('perspectiveUUID')),
85
+ __param(1, Arg('linkLanguage')),
86
+ __param(2, Arg('meta')),
87
+ __metadata("design:type", Function),
88
+ __metadata("design:paramtypes", [String, String, PerspectiveInput]),
89
+ __metadata("design:returntype", String)
90
+ ], NeighbourhoodResolver.prototype, "neighbourhoodPublishFromPerspective", null);
91
+ __decorate([
92
+ Mutation(returns => PerspectiveHandle),
93
+ __param(0, Arg('url')),
94
+ __param(1, PubSub()),
95
+ __metadata("design:type", Function),
96
+ __metadata("design:paramtypes", [String, Object]),
97
+ __metadata("design:returntype", PerspectiveHandle)
98
+ ], NeighbourhoodResolver.prototype, "neighbourhoodJoinFromUrl", null);
99
+ __decorate([
100
+ Query(returns => [String]),
101
+ __param(0, Arg('perspectiveUUID')),
102
+ __metadata("design:type", Function),
103
+ __metadata("design:paramtypes", [String]),
104
+ __metadata("design:returntype", Array)
105
+ ], NeighbourhoodResolver.prototype, "neighbourhoodOtherAgents", null);
106
+ __decorate([
107
+ Query(),
108
+ __param(0, Arg('perspectiveUUID')),
109
+ __metadata("design:type", Function),
110
+ __metadata("design:paramtypes", [String]),
111
+ __metadata("design:returntype", Boolean)
112
+ ], NeighbourhoodResolver.prototype, "neighbourhoodHasTelepresenceAdapter", null);
113
+ __decorate([
114
+ Query(returns => [OnlineAgent]),
115
+ __param(0, Arg('perspectiveUUID')),
116
+ __metadata("design:type", Function),
117
+ __metadata("design:paramtypes", [String]),
118
+ __metadata("design:returntype", Array)
119
+ ], NeighbourhoodResolver.prototype, "neighbourhoodOnlineAgents", null);
120
+ __decorate([
121
+ Mutation(),
122
+ __param(0, Arg('perspectiveUUID')),
123
+ __param(1, Arg('status')),
124
+ __metadata("design:type", Function),
125
+ __metadata("design:paramtypes", [String, PerspectiveInput]),
126
+ __metadata("design:returntype", Boolean)
127
+ ], NeighbourhoodResolver.prototype, "neighbourhoodSetOnlineStatus", null);
128
+ __decorate([
129
+ Mutation(),
130
+ __param(0, Arg('perspectiveUUID')),
131
+ __param(1, Arg('status')),
132
+ __metadata("design:type", Function),
133
+ __metadata("design:paramtypes", [String, PerspectiveUnsignedInput]),
134
+ __metadata("design:returntype", Boolean)
135
+ ], NeighbourhoodResolver.prototype, "neighbourhoodSetOnlineStatusU", null);
136
+ __decorate([
137
+ Mutation(),
138
+ __param(0, Arg('perspectiveUUID')),
139
+ __param(1, Arg('remoteAgentDid')),
140
+ __param(2, Arg('payload')),
141
+ __metadata("design:type", Function),
142
+ __metadata("design:paramtypes", [String, String, PerspectiveInput]),
143
+ __metadata("design:returntype", Boolean)
144
+ ], NeighbourhoodResolver.prototype, "neighbourhoodSendSignal", null);
145
+ __decorate([
146
+ Mutation(),
147
+ __param(0, Arg('perspectiveUUID')),
148
+ __param(1, Arg('remoteAgentDid')),
149
+ __param(2, Arg('payload')),
150
+ __metadata("design:type", Function),
151
+ __metadata("design:paramtypes", [String, String, PerspectiveUnsignedInput]),
152
+ __metadata("design:returntype", Boolean)
153
+ ], NeighbourhoodResolver.prototype, "neighbourhoodSendSignalU", null);
154
+ __decorate([
155
+ Mutation(),
156
+ __param(0, Arg('perspectiveUUID')),
157
+ __param(1, Arg('payload')),
158
+ __metadata("design:type", Function),
159
+ __metadata("design:paramtypes", [String, PerspectiveInput]),
160
+ __metadata("design:returntype", Boolean)
161
+ ], NeighbourhoodResolver.prototype, "neighbourhoodSendBroadcast", null);
162
+ __decorate([
163
+ Mutation(),
164
+ __param(0, Arg('perspectiveUUID')),
165
+ __param(1, Arg('payload')),
166
+ __metadata("design:type", Function),
167
+ __metadata("design:paramtypes", [String, PerspectiveUnsignedInput]),
168
+ __metadata("design:returntype", Boolean)
169
+ ], NeighbourhoodResolver.prototype, "neighbourhoodSendBroadcastU", null);
170
+ __decorate([
171
+ Subscription({ topics: NEIGHBOURHOOD_SIGNAL_RECEIVED_TOPIC, nullable: true }),
172
+ __param(0, Arg('perspectiveUUID')),
173
+ __metadata("design:type", Function),
174
+ __metadata("design:paramtypes", [String]),
175
+ __metadata("design:returntype", PerspectiveExpression)
176
+ ], NeighbourhoodResolver.prototype, "neighbourhoodSignal", null);
177
+ NeighbourhoodResolver = __decorate([
178
+ Resolver()
179
+ ], NeighbourhoodResolver);
180
+ export default NeighbourhoodResolver;
@@ -0,0 +1,80 @@
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
+ let LinkQuery = class LinkQuery {
12
+ constructor(obj) {
13
+ if (obj) {
14
+ // @ts-ignore
15
+ this.source = obj.source;
16
+ // @ts-ignore
17
+ this.predicate = obj.predicate;
18
+ // @ts-ignore
19
+ this.target = obj.target;
20
+ // @ts-ignore
21
+ if (obj.fromDate) {
22
+ // @ts-ignore
23
+ this.fromDate = obj.fromDate;
24
+ }
25
+ ;
26
+ // @ts-ignore
27
+ if (obj.untilDate) {
28
+ // @ts-ignore
29
+ this.untilDate = obj.untilDate;
30
+ }
31
+ // @ts-ignore
32
+ if (obj.limit) {
33
+ // @ts-ignore
34
+ this.limit = obj.limit;
35
+ }
36
+ }
37
+ }
38
+ isMatch(l) {
39
+ if (this.source)
40
+ if (this.source !== l.source)
41
+ return false;
42
+ if (this.predicate)
43
+ if (this.predicate !== l.predicate)
44
+ return false;
45
+ if (this.target)
46
+ if (this.target !== l.target)
47
+ return false;
48
+ return true;
49
+ }
50
+ };
51
+ __decorate([
52
+ Field({ nullable: true }),
53
+ __metadata("design:type", String)
54
+ ], LinkQuery.prototype, "source", void 0);
55
+ __decorate([
56
+ Field({ nullable: true }),
57
+ __metadata("design:type", String)
58
+ ], LinkQuery.prototype, "target", void 0);
59
+ __decorate([
60
+ Field({ nullable: true }),
61
+ __metadata("design:type", String)
62
+ ], LinkQuery.prototype, "predicate", void 0);
63
+ __decorate([
64
+ Field({ nullable: true }),
65
+ __metadata("design:type", Date)
66
+ ], LinkQuery.prototype, "fromDate", void 0);
67
+ __decorate([
68
+ Field({ nullable: true }),
69
+ __metadata("design:type", Date)
70
+ ], LinkQuery.prototype, "untilDate", void 0);
71
+ __decorate([
72
+ Field({ nullable: true }),
73
+ __metadata("design:type", Number)
74
+ ], LinkQuery.prototype, "limit", void 0);
75
+ LinkQuery = __decorate([
76
+ ObjectType(),
77
+ InputType(),
78
+ __metadata("design:paramtypes", [Object])
79
+ ], LinkQuery);
80
+ export { LinkQuery };
@@ -0,0 +1,144 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ var PerspectiveUnsignedInput_1;
11
+ import { Field, ObjectType, InputType } from "type-graphql";
12
+ import { ExpressionGeneric } from "../expression/Expression";
13
+ import { LinkExpression, LinkExpressionInput, LinkInput } from "../links/Links";
14
+ /** A Perspective represents subjective meaning, encoded through
15
+ * associations between expressions, a.k.a. Links, that is a graph
16
+ * over the objective Expressions of any subset of Languages.
17
+ *
18
+ * This type represents the clean onotological concept of a Perspective.
19
+ * An instance of this class can be regarded as an immutable snapshot of
20
+ * a mutable perspective.
21
+ *
22
+ * The types PerspectiveProxy and PerspectiveHandle are used when dealing
23
+ * with an instantiated mutable perspective as is done through most of
24
+ * the GraphQL mutations.
25
+ */
26
+ let Perspective = class Perspective {
27
+ constructor(links) {
28
+ if (links) {
29
+ this.links = links;
30
+ }
31
+ else {
32
+ this.links = [];
33
+ }
34
+ }
35
+ /** Convenience function for filtering links just like with PerspectiveProxy */
36
+ get(query) {
37
+ if (!query || !query.source && !query.predicate && !query.target) {
38
+ return this.links;
39
+ }
40
+ if (query.source) {
41
+ let result = JSON.parse(JSON.stringify(this.links));
42
+ // @ts-ignore
43
+ if (query.target)
44
+ result = result.filter(l => l.data.target === query.target);
45
+ // @ts-ignore
46
+ if (query.predicate)
47
+ result = result.filter(l => l.data.predicate === query.predicate);
48
+ //@ts-ignore
49
+ if (query.fromDate)
50
+ result = result.filter(l => new Date(l.timestamp) >= query.fromDate);
51
+ //@ts-ignore
52
+ if (query.untilDate)
53
+ result = result.filter(l => new Date(l.timestamp) <= query.untilDate);
54
+ // console.debug("result", result)
55
+ if (query.limit)
56
+ result = result.slice(0, query.limit);
57
+ return result;
58
+ }
59
+ // console.debug("getLinks 3")
60
+ if (query.target) {
61
+ //@ts-ignore
62
+ let result = JSON.parse(JSON.stringify(this.links));
63
+ // @ts-ignore
64
+ if (query.predicate)
65
+ result = result.filter(l => l.data.predicate === query.predicate);
66
+ //@ts-ignore
67
+ if (query.fromDate)
68
+ result = result.filter(l => new Date(l.timestamp) >= query.fromDate);
69
+ //@ts-ignore
70
+ if (query.untilDate)
71
+ result = result.filter(l => new Date(l.timestamp) <= query.untilDate);
72
+ if (query.limit)
73
+ result = result.slice(0, query.limit);
74
+ return result;
75
+ }
76
+ // console.debug("getLinks 4")
77
+ //@ts-ignore
78
+ let result = JSON.parse(JSON.stringify(this.links));
79
+ result = result.filter(link => link.data.predicate === query.predicate);
80
+ if (query.limit)
81
+ result = result.slice(0, query.limit);
82
+ return result;
83
+ }
84
+ /** Convenience function to get the target of the first link that matches the given query
85
+ * This makes sense when the query is expected to return only one link
86
+ * and the target of that link is what you are looking for.
87
+ */
88
+ getSingleTarget(query) {
89
+ delete query.target;
90
+ const foundLinks = this.get(query);
91
+ if (foundLinks.length)
92
+ return foundLinks[0].data.target;
93
+ else
94
+ return null;
95
+ }
96
+ };
97
+ __decorate([
98
+ Field(type => [LinkExpression]),
99
+ __metadata("design:type", Array)
100
+ ], Perspective.prototype, "links", void 0);
101
+ Perspective = __decorate([
102
+ ObjectType(),
103
+ __metadata("design:paramtypes", [Array])
104
+ ], Perspective);
105
+ export { Perspective };
106
+ let PerspectiveInput = class PerspectiveInput {
107
+ };
108
+ __decorate([
109
+ Field(type => [LinkExpressionInput]),
110
+ __metadata("design:type", Array)
111
+ ], PerspectiveInput.prototype, "links", void 0);
112
+ PerspectiveInput = __decorate([
113
+ InputType()
114
+ ], PerspectiveInput);
115
+ export { PerspectiveInput };
116
+ let PerspectiveUnsignedInput = PerspectiveUnsignedInput_1 = class PerspectiveUnsignedInput {
117
+ constructor(links) {
118
+ if (links)
119
+ this.links = links;
120
+ else
121
+ this.links = [];
122
+ }
123
+ static fromLink(link) {
124
+ let obj = new PerspectiveUnsignedInput_1();
125
+ obj.links.push(link);
126
+ return obj;
127
+ }
128
+ };
129
+ __decorate([
130
+ Field(type => [LinkInput]),
131
+ __metadata("design:type", Array)
132
+ ], PerspectiveUnsignedInput.prototype, "links", void 0);
133
+ PerspectiveUnsignedInput = PerspectiveUnsignedInput_1 = __decorate([
134
+ InputType(),
135
+ __metadata("design:paramtypes", [Array])
136
+ ], PerspectiveUnsignedInput);
137
+ export { PerspectiveUnsignedInput };
138
+ let PerspectiveExpression = class PerspectiveExpression extends ExpressionGeneric(Perspective) {
139
+ };
140
+ PerspectiveExpression = __decorate([
141
+ ObjectType()
142
+ ], PerspectiveExpression);
143
+ export { PerspectiveExpression };
144
+ ;
@@ -0,0 +1,20 @@
1
+ import { Perspective } from "./Perspective";
2
+ import { Link, LinkExpression } from "../links/Links";
3
+ import { LinkQuery } from "./LinkQuery";
4
+ const link = new LinkExpression();
5
+ link.author = 'did:method:12345';
6
+ link.timestamp = new Date().toString();
7
+ link.data = new Link({ source: 'root', target: 'perspective://Qm34589a3ccc0' });
8
+ link.proof = { signature: 'asdfasdf', key: 'asdfasdf' };
9
+ describe('Perspective', () => {
10
+ it('implements get()', () => {
11
+ let p = new Perspective([link]);
12
+ let result = p.get(new LinkQuery({ source: 'root' }));
13
+ expect(result).toEqual([link]);
14
+ });
15
+ it('implements getSingleTarget()', () => {
16
+ let p = new Perspective([link]);
17
+ let result = p.getSingleTarget(new LinkQuery({ source: 'root' }));
18
+ expect(result).toEqual(link.data.target);
19
+ });
20
+ });
@@ -37,6 +37,7 @@ export declare class PerspectiveClient {
37
37
  removeLink(uuid: string, link: LinkExpressionInput): Promise<{
38
38
  perspectiveRemoveLink: boolean;
39
39
  }>;
40
+ addSdna(uuid: string, name: string, sdnaCode: string, sdnaType: "subject_class" | "flow" | "custom"): Promise<boolean>;
40
41
  getExpression(expressionURI: string): Promise<ExpressionRendered>;
41
42
  createExpression(content: any, languageAddress: string): Promise<string>;
42
43
  addPerspectiveAddedListener(cb: PerspectiveHandleCallback): void;