@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,337 @@
|
|
|
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, InputType } from "type-graphql";
|
|
11
|
+
import { Perspective } from "../perspectives/Perspective";
|
|
12
|
+
import { ExpressionGeneric } from "../expression/Expression";
|
|
13
|
+
/** AD4M's representation of an Agent
|
|
14
|
+
*
|
|
15
|
+
* AD4M Agents are build around DIDs, which are used to identify and authenticate the Agent.
|
|
16
|
+
* Conceptually, an Agent is regarded as something that can speak and that can listen.
|
|
17
|
+
*
|
|
18
|
+
* Agents speak by creating Expressions in AD4M Languages which are signed by the Agent's DID key,
|
|
19
|
+
* And they also speak (broadcast) by putting semantic statements into their public "Agent Perspective".
|
|
20
|
+
* They listen (can receive messages) through their "direct message Language".
|
|
21
|
+
*
|
|
22
|
+
* These three aspects are represented by the three fields of this class.
|
|
23
|
+
*
|
|
24
|
+
* This class is used as format for the Expressions in the Agent language.
|
|
25
|
+
* Since AD4M treats DID URIs as addresses for the Agent Language,
|
|
26
|
+
* DIDs are resolved to Expressions that are objects of this class.
|
|
27
|
+
* Thus, this is how agents see (other) agents.
|
|
28
|
+
*/
|
|
29
|
+
let Agent = class Agent {
|
|
30
|
+
constructor(did, perspective) {
|
|
31
|
+
this.did = did;
|
|
32
|
+
if (perspective) {
|
|
33
|
+
this.perspective = perspective;
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
this.perspective = new Perspective();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
__decorate([
|
|
41
|
+
Field(),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], Agent.prototype, "did", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
Field((type) => Perspective, { nullable: true }),
|
|
46
|
+
__metadata("design:type", Perspective)
|
|
47
|
+
], Agent.prototype, "perspective", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
Field({ nullable: true }),
|
|
50
|
+
__metadata("design:type", String)
|
|
51
|
+
], Agent.prototype, "directMessageLanguage", void 0);
|
|
52
|
+
Agent = __decorate([
|
|
53
|
+
ObjectType(),
|
|
54
|
+
__metadata("design:paramtypes", [String, Perspective])
|
|
55
|
+
], Agent);
|
|
56
|
+
export { Agent };
|
|
57
|
+
let AgentExpression = class AgentExpression extends ExpressionGeneric(Agent) {
|
|
58
|
+
};
|
|
59
|
+
AgentExpression = __decorate([
|
|
60
|
+
ObjectType()
|
|
61
|
+
], AgentExpression);
|
|
62
|
+
export { AgentExpression };
|
|
63
|
+
let EntanglementProof = class EntanglementProof {
|
|
64
|
+
constructor(did, didSigningKeyId, deviceKeyType, deviceKey, deviceKeySignedByDid, didSignedByDeviceKey) {
|
|
65
|
+
this.did = did;
|
|
66
|
+
this.didSigningKeyId = didSigningKeyId;
|
|
67
|
+
this.deviceKeyType = deviceKeyType;
|
|
68
|
+
this.deviceKey = deviceKey;
|
|
69
|
+
this.deviceKeySignedByDid = deviceKeySignedByDid;
|
|
70
|
+
this.didSignedByDeviceKey = didSignedByDeviceKey;
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
__decorate([
|
|
74
|
+
Field(),
|
|
75
|
+
__metadata("design:type", String)
|
|
76
|
+
], EntanglementProof.prototype, "did", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
Field(),
|
|
79
|
+
__metadata("design:type", String)
|
|
80
|
+
], EntanglementProof.prototype, "didSigningKeyId", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
Field(),
|
|
83
|
+
__metadata("design:type", String)
|
|
84
|
+
], EntanglementProof.prototype, "deviceKeyType", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
Field(),
|
|
87
|
+
__metadata("design:type", String)
|
|
88
|
+
], EntanglementProof.prototype, "deviceKey", void 0);
|
|
89
|
+
__decorate([
|
|
90
|
+
Field(),
|
|
91
|
+
__metadata("design:type", String)
|
|
92
|
+
], EntanglementProof.prototype, "deviceKeySignedByDid", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
Field({ nullable: true }),
|
|
95
|
+
__metadata("design:type", String)
|
|
96
|
+
], EntanglementProof.prototype, "didSignedByDeviceKey", void 0);
|
|
97
|
+
EntanglementProof = __decorate([
|
|
98
|
+
ObjectType(),
|
|
99
|
+
__metadata("design:paramtypes", [String, String, String, String, String, String])
|
|
100
|
+
], EntanglementProof);
|
|
101
|
+
export { EntanglementProof };
|
|
102
|
+
let EntanglementProofInput = class EntanglementProofInput {
|
|
103
|
+
constructor(did, didSigningKeyId, deviceKeyType, deviceKey, deviceKeySignedByDid, didSignedByDeviceKey) {
|
|
104
|
+
this.did = did;
|
|
105
|
+
this.didSigningKeyId = didSigningKeyId;
|
|
106
|
+
this.deviceKeyType = deviceKeyType;
|
|
107
|
+
this.deviceKey = deviceKey;
|
|
108
|
+
this.deviceKeySignedByDid = deviceKeySignedByDid;
|
|
109
|
+
this.didSignedByDeviceKey = didSignedByDeviceKey;
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
__decorate([
|
|
113
|
+
Field(),
|
|
114
|
+
__metadata("design:type", String)
|
|
115
|
+
], EntanglementProofInput.prototype, "did", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
Field(),
|
|
118
|
+
__metadata("design:type", String)
|
|
119
|
+
], EntanglementProofInput.prototype, "didSigningKeyId", void 0);
|
|
120
|
+
__decorate([
|
|
121
|
+
Field(),
|
|
122
|
+
__metadata("design:type", String)
|
|
123
|
+
], EntanglementProofInput.prototype, "deviceKeyType", void 0);
|
|
124
|
+
__decorate([
|
|
125
|
+
Field(),
|
|
126
|
+
__metadata("design:type", String)
|
|
127
|
+
], EntanglementProofInput.prototype, "deviceKey", void 0);
|
|
128
|
+
__decorate([
|
|
129
|
+
Field(),
|
|
130
|
+
__metadata("design:type", String)
|
|
131
|
+
], EntanglementProofInput.prototype, "deviceKeySignedByDid", void 0);
|
|
132
|
+
__decorate([
|
|
133
|
+
Field(),
|
|
134
|
+
__metadata("design:type", String)
|
|
135
|
+
], EntanglementProofInput.prototype, "didSignedByDeviceKey", void 0);
|
|
136
|
+
EntanglementProofInput = __decorate([
|
|
137
|
+
InputType(),
|
|
138
|
+
__metadata("design:paramtypes", [String, String, String, String, String, String])
|
|
139
|
+
], EntanglementProofInput);
|
|
140
|
+
export { EntanglementProofInput };
|
|
141
|
+
let AgentSignature = class AgentSignature {
|
|
142
|
+
constructor(signature, publicKey) {
|
|
143
|
+
this.signature = signature;
|
|
144
|
+
this.publicKey = publicKey;
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
__decorate([
|
|
148
|
+
Field(),
|
|
149
|
+
__metadata("design:type", String)
|
|
150
|
+
], AgentSignature.prototype, "signature", void 0);
|
|
151
|
+
__decorate([
|
|
152
|
+
Field(),
|
|
153
|
+
__metadata("design:type", String)
|
|
154
|
+
], AgentSignature.prototype, "publicKey", void 0);
|
|
155
|
+
AgentSignature = __decorate([
|
|
156
|
+
ObjectType(),
|
|
157
|
+
__metadata("design:paramtypes", [String, String])
|
|
158
|
+
], AgentSignature);
|
|
159
|
+
export { AgentSignature };
|
|
160
|
+
let Resource = class Resource {
|
|
161
|
+
constructor(domain, pointers) {
|
|
162
|
+
this.domain = domain;
|
|
163
|
+
this.pointers = pointers;
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
__decorate([
|
|
167
|
+
Field(),
|
|
168
|
+
__metadata("design:type", String)
|
|
169
|
+
], Resource.prototype, "domain", void 0);
|
|
170
|
+
__decorate([
|
|
171
|
+
Field((type) => [String]),
|
|
172
|
+
__metadata("design:type", Array)
|
|
173
|
+
], Resource.prototype, "pointers", void 0);
|
|
174
|
+
Resource = __decorate([
|
|
175
|
+
ObjectType(),
|
|
176
|
+
__metadata("design:paramtypes", [String, Array])
|
|
177
|
+
], Resource);
|
|
178
|
+
export { Resource };
|
|
179
|
+
let Capability = class Capability {
|
|
180
|
+
constructor(withF, can) {
|
|
181
|
+
this.with = withF;
|
|
182
|
+
this.can = can;
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
__decorate([
|
|
186
|
+
Field((type) => Resource),
|
|
187
|
+
__metadata("design:type", Resource)
|
|
188
|
+
], Capability.prototype, "with", void 0);
|
|
189
|
+
__decorate([
|
|
190
|
+
Field((type) => [String]),
|
|
191
|
+
__metadata("design:type", Array)
|
|
192
|
+
], Capability.prototype, "can", void 0);
|
|
193
|
+
Capability = __decorate([
|
|
194
|
+
ObjectType(),
|
|
195
|
+
__metadata("design:paramtypes", [Resource, Array])
|
|
196
|
+
], Capability);
|
|
197
|
+
export { Capability };
|
|
198
|
+
let AuthInfo = class AuthInfo {
|
|
199
|
+
constructor(appName, appDesc, appUrl, capabilities, appIconPath) {
|
|
200
|
+
this.appName = appName;
|
|
201
|
+
this.appDesc = appDesc;
|
|
202
|
+
this.appIconPath = appIconPath;
|
|
203
|
+
this.appUrl = appUrl;
|
|
204
|
+
this.capabilities = capabilities;
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
__decorate([
|
|
208
|
+
Field(),
|
|
209
|
+
__metadata("design:type", String)
|
|
210
|
+
], AuthInfo.prototype, "appName", void 0);
|
|
211
|
+
__decorate([
|
|
212
|
+
Field(),
|
|
213
|
+
__metadata("design:type", String)
|
|
214
|
+
], AuthInfo.prototype, "appDesc", void 0);
|
|
215
|
+
__decorate([
|
|
216
|
+
Field(),
|
|
217
|
+
__metadata("design:type", String)
|
|
218
|
+
], AuthInfo.prototype, "appUrl", void 0);
|
|
219
|
+
__decorate([
|
|
220
|
+
Field({ nullable: true }),
|
|
221
|
+
__metadata("design:type", String)
|
|
222
|
+
], AuthInfo.prototype, "appIconPath", void 0);
|
|
223
|
+
__decorate([
|
|
224
|
+
Field((type) => [Capability]),
|
|
225
|
+
__metadata("design:type", Array)
|
|
226
|
+
], AuthInfo.prototype, "capabilities", void 0);
|
|
227
|
+
AuthInfo = __decorate([
|
|
228
|
+
ObjectType(),
|
|
229
|
+
__metadata("design:paramtypes", [String, String, String, Array, String])
|
|
230
|
+
], AuthInfo);
|
|
231
|
+
export { AuthInfo };
|
|
232
|
+
let Apps = class Apps {
|
|
233
|
+
constructor(requestId, auth, token, revoked) {
|
|
234
|
+
this.requestId = requestId;
|
|
235
|
+
this.auth = auth;
|
|
236
|
+
this.token = token;
|
|
237
|
+
this.revoked = revoked;
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
__decorate([
|
|
241
|
+
Field(),
|
|
242
|
+
__metadata("design:type", String)
|
|
243
|
+
], Apps.prototype, "requestId", void 0);
|
|
244
|
+
__decorate([
|
|
245
|
+
Field(),
|
|
246
|
+
__metadata("design:type", String)
|
|
247
|
+
], Apps.prototype, "token", void 0);
|
|
248
|
+
__decorate([
|
|
249
|
+
Field({ nullable: true }),
|
|
250
|
+
__metadata("design:type", Boolean)
|
|
251
|
+
], Apps.prototype, "revoked", void 0);
|
|
252
|
+
__decorate([
|
|
253
|
+
Field(),
|
|
254
|
+
__metadata("design:type", AuthInfo)
|
|
255
|
+
], Apps.prototype, "auth", void 0);
|
|
256
|
+
Apps = __decorate([
|
|
257
|
+
ObjectType(),
|
|
258
|
+
__metadata("design:paramtypes", [String, AuthInfo, String, Boolean])
|
|
259
|
+
], Apps);
|
|
260
|
+
export { Apps };
|
|
261
|
+
let ResourceInput = class ResourceInput {
|
|
262
|
+
constructor(domain, pointers) {
|
|
263
|
+
this.domain = domain;
|
|
264
|
+
this.pointers = pointers;
|
|
265
|
+
}
|
|
266
|
+
};
|
|
267
|
+
__decorate([
|
|
268
|
+
Field(),
|
|
269
|
+
__metadata("design:type", String)
|
|
270
|
+
], ResourceInput.prototype, "domain", void 0);
|
|
271
|
+
__decorate([
|
|
272
|
+
Field((type) => [String]),
|
|
273
|
+
__metadata("design:type", Array)
|
|
274
|
+
], ResourceInput.prototype, "pointers", void 0);
|
|
275
|
+
ResourceInput = __decorate([
|
|
276
|
+
InputType(),
|
|
277
|
+
__metadata("design:paramtypes", [String, Array])
|
|
278
|
+
], ResourceInput);
|
|
279
|
+
export { ResourceInput };
|
|
280
|
+
let CapabilityInput = class CapabilityInput {
|
|
281
|
+
constructor(withF, can) {
|
|
282
|
+
this.with = withF;
|
|
283
|
+
this.can = can;
|
|
284
|
+
}
|
|
285
|
+
};
|
|
286
|
+
__decorate([
|
|
287
|
+
Field((type) => ResourceInput),
|
|
288
|
+
__metadata("design:type", ResourceInput)
|
|
289
|
+
], CapabilityInput.prototype, "with", void 0);
|
|
290
|
+
__decorate([
|
|
291
|
+
Field((type) => [String]),
|
|
292
|
+
__metadata("design:type", Array)
|
|
293
|
+
], CapabilityInput.prototype, "can", void 0);
|
|
294
|
+
CapabilityInput = __decorate([
|
|
295
|
+
InputType(),
|
|
296
|
+
__metadata("design:paramtypes", [ResourceInput, Array])
|
|
297
|
+
], CapabilityInput);
|
|
298
|
+
export { CapabilityInput };
|
|
299
|
+
let AuthInfoInput = class AuthInfoInput {
|
|
300
|
+
constructor(appName, appDesc, appDomain, appUrl, appIconPath, capabilities) {
|
|
301
|
+
this.appName = appName;
|
|
302
|
+
this.appDesc = appDesc;
|
|
303
|
+
this.appUrl = appUrl;
|
|
304
|
+
this.appDomain = appDomain;
|
|
305
|
+
this.capabilities = capabilities;
|
|
306
|
+
this.appIconPath = appIconPath;
|
|
307
|
+
}
|
|
308
|
+
};
|
|
309
|
+
__decorate([
|
|
310
|
+
Field(),
|
|
311
|
+
__metadata("design:type", String)
|
|
312
|
+
], AuthInfoInput.prototype, "appName", void 0);
|
|
313
|
+
__decorate([
|
|
314
|
+
Field(),
|
|
315
|
+
__metadata("design:type", String)
|
|
316
|
+
], AuthInfoInput.prototype, "appDesc", void 0);
|
|
317
|
+
__decorate([
|
|
318
|
+
Field(),
|
|
319
|
+
__metadata("design:type", String)
|
|
320
|
+
], AuthInfoInput.prototype, "appDomain", void 0);
|
|
321
|
+
__decorate([
|
|
322
|
+
Field({ nullable: true }),
|
|
323
|
+
__metadata("design:type", String)
|
|
324
|
+
], AuthInfoInput.prototype, "appUrl", void 0);
|
|
325
|
+
__decorate([
|
|
326
|
+
Field({ nullable: true }),
|
|
327
|
+
__metadata("design:type", String)
|
|
328
|
+
], AuthInfoInput.prototype, "appIconPath", void 0);
|
|
329
|
+
__decorate([
|
|
330
|
+
Field((type) => [CapabilityInput], { nullable: true }),
|
|
331
|
+
__metadata("design:type", Array)
|
|
332
|
+
], AuthInfoInput.prototype, "capabilities", void 0);
|
|
333
|
+
AuthInfoInput = __decorate([
|
|
334
|
+
InputType(),
|
|
335
|
+
__metadata("design:paramtypes", [String, String, String, String, String, Array])
|
|
336
|
+
], AuthInfoInput);
|
|
337
|
+
export { AuthInfoInput };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ApolloClient } from "@apollo/client/core";
|
|
2
|
+
import { PerspectiveInput } from "../perspectives/Perspective";
|
|
3
|
+
import { Agent, Apps, AuthInfoInput, EntanglementProof, EntanglementProofInput } from "./Agent";
|
|
4
|
+
import { AgentStatus } from "./AgentStatus";
|
|
5
|
+
import { LinkMutations } from "../links/Links";
|
|
6
|
+
export interface InitializeArgs {
|
|
7
|
+
did: string;
|
|
8
|
+
didDocument: string;
|
|
9
|
+
keystore: string;
|
|
10
|
+
passphrase: string;
|
|
11
|
+
}
|
|
12
|
+
export type AgentUpdatedCallback = (agent: Agent) => null;
|
|
13
|
+
export type AgentStatusChangedCallback = (agent: Agent) => null;
|
|
14
|
+
export type AgentAppsUpdatedCallback = () => null;
|
|
15
|
+
/**
|
|
16
|
+
* Provides access to all functions regarding the local agent,
|
|
17
|
+
* such as generating, locking, unlocking, importing the DID keystore,
|
|
18
|
+
* as well as updating the publicly shared Agent expression.
|
|
19
|
+
*/
|
|
20
|
+
export declare class AgentClient {
|
|
21
|
+
#private;
|
|
22
|
+
constructor(client: ApolloClient<any>, subscribe?: boolean);
|
|
23
|
+
/**
|
|
24
|
+
* Returns the Agent expression of the local agent as it is shared
|
|
25
|
+
* publicly via the AgentLanguage.
|
|
26
|
+
*
|
|
27
|
+
* I.e. this is the users profile.
|
|
28
|
+
*/
|
|
29
|
+
me(): Promise<Agent>;
|
|
30
|
+
status(): Promise<AgentStatus>;
|
|
31
|
+
generate(passphrase: string): Promise<AgentStatus>;
|
|
32
|
+
import(args: InitializeArgs): Promise<AgentStatus>;
|
|
33
|
+
lock(passphrase: string): Promise<AgentStatus>;
|
|
34
|
+
unlock(passphrase: string, holochain?: boolean): Promise<AgentStatus>;
|
|
35
|
+
byDID(did: string): Promise<Agent>;
|
|
36
|
+
updatePublicPerspective(perspective: PerspectiveInput): Promise<Agent>;
|
|
37
|
+
mutatePublicPerspective(mutations: LinkMutations): Promise<Agent>;
|
|
38
|
+
updateDirectMessageLanguage(directMessageLanguage: string): Promise<Agent>;
|
|
39
|
+
addEntanglementProofs(proofs: EntanglementProofInput[]): Promise<EntanglementProof[]>;
|
|
40
|
+
deleteEntanglementProofs(proofs: EntanglementProofInput[]): Promise<EntanglementProof[]>;
|
|
41
|
+
getEntanglementProofs(): Promise<string[]>;
|
|
42
|
+
entanglementProofPreFlight(deviceKey: string, deviceKeyType: string): Promise<EntanglementProof>;
|
|
43
|
+
addUpdatedListener(listener: any): void;
|
|
44
|
+
addAppChangedListener(listener: any): void;
|
|
45
|
+
subscribeAgentUpdated(): void;
|
|
46
|
+
subscribeAppsChanged(): void;
|
|
47
|
+
addAgentStatusChangedListener(listener: any): void;
|
|
48
|
+
subscribeAgentStatusChanged(): void;
|
|
49
|
+
requestCapability(authInfo: AuthInfoInput): Promise<string>;
|
|
50
|
+
permitCapability(auth: string): Promise<string>;
|
|
51
|
+
generateJwt(requestId: string, rand: string): Promise<string>;
|
|
52
|
+
getApps(): Promise<Apps[]>;
|
|
53
|
+
removeApp(requestId: string): Promise<Apps[]>;
|
|
54
|
+
revokeToken(requestId: string): Promise<Apps[]>;
|
|
55
|
+
isLocked(): Promise<boolean>;
|
|
56
|
+
signMessage(message: string): Promise<string>;
|
|
57
|
+
}
|