@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
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export declare class AgentStatus {
|
|
2
|
-
isInitialized: Boolean;
|
|
3
|
-
isUnlocked: Boolean;
|
|
4
|
-
did?: string;
|
|
5
|
-
didDocument?: string;
|
|
6
|
-
error?: string;
|
|
7
|
-
constructor(obj?: object);
|
|
8
|
-
}
|
|
1
|
+
export declare class AgentStatus {
|
|
2
|
+
isInitialized: Boolean;
|
|
3
|
+
isUnlocked: Boolean;
|
|
4
|
+
did?: string;
|
|
5
|
+
didDocument?: string;
|
|
6
|
+
error?: string;
|
|
7
|
+
constructor(obj?: object);
|
|
8
|
+
}
|
|
@@ -1,61 +1,61 @@
|
|
|
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
|
-
let AgentStatus = class AgentStatus {
|
|
12
|
-
constructor(obj) {
|
|
13
|
-
if (obj) {
|
|
14
|
-
//@ts-ignore
|
|
15
|
-
this.isInitialized = obj.isInitialized;
|
|
16
|
-
if (!this.isInitialized) {
|
|
17
|
-
this.isInitialized = false;
|
|
18
|
-
}
|
|
19
|
-
//@ts-ignore
|
|
20
|
-
this.isUnlocked = obj.isUnlocked;
|
|
21
|
-
if (!this.isUnlocked) {
|
|
22
|
-
this.isUnlocked = false;
|
|
23
|
-
}
|
|
24
|
-
//@ts-ignore
|
|
25
|
-
this.did = obj.did;
|
|
26
|
-
//@ts-ignore
|
|
27
|
-
this.didDocument = obj.didDocument;
|
|
28
|
-
//@ts-ignore
|
|
29
|
-
this.error = obj.error;
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
this.isInitialized = false;
|
|
33
|
-
this.isUnlocked = false;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
__decorate([
|
|
38
|
-
Field(),
|
|
39
|
-
__metadata("design:type", Boolean)
|
|
40
|
-
], AgentStatus.prototype, "isInitialized", void 0);
|
|
41
|
-
__decorate([
|
|
42
|
-
Field(),
|
|
43
|
-
__metadata("design:type", Boolean)
|
|
44
|
-
], AgentStatus.prototype, "isUnlocked", void 0);
|
|
45
|
-
__decorate([
|
|
46
|
-
Field({ nullable: true }),
|
|
47
|
-
__metadata("design:type", String)
|
|
48
|
-
], AgentStatus.prototype, "did", void 0);
|
|
49
|
-
__decorate([
|
|
50
|
-
Field({ nullable: true }),
|
|
51
|
-
__metadata("design:type", String)
|
|
52
|
-
], AgentStatus.prototype, "didDocument", void 0);
|
|
53
|
-
__decorate([
|
|
54
|
-
Field({ nullable: true }),
|
|
55
|
-
__metadata("design:type", String)
|
|
56
|
-
], AgentStatus.prototype, "error", void 0);
|
|
57
|
-
AgentStatus = __decorate([
|
|
58
|
-
ObjectType(),
|
|
59
|
-
__metadata("design:paramtypes", [Object])
|
|
60
|
-
], AgentStatus);
|
|
61
|
-
export { AgentStatus };
|
|
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
|
+
let AgentStatus = class AgentStatus {
|
|
12
|
+
constructor(obj) {
|
|
13
|
+
if (obj) {
|
|
14
|
+
//@ts-ignore
|
|
15
|
+
this.isInitialized = obj.isInitialized;
|
|
16
|
+
if (!this.isInitialized) {
|
|
17
|
+
this.isInitialized = false;
|
|
18
|
+
}
|
|
19
|
+
//@ts-ignore
|
|
20
|
+
this.isUnlocked = obj.isUnlocked;
|
|
21
|
+
if (!this.isUnlocked) {
|
|
22
|
+
this.isUnlocked = false;
|
|
23
|
+
}
|
|
24
|
+
//@ts-ignore
|
|
25
|
+
this.did = obj.did;
|
|
26
|
+
//@ts-ignore
|
|
27
|
+
this.didDocument = obj.didDocument;
|
|
28
|
+
//@ts-ignore
|
|
29
|
+
this.error = obj.error;
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
this.isInitialized = false;
|
|
33
|
+
this.isUnlocked = false;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
__decorate([
|
|
38
|
+
Field(),
|
|
39
|
+
__metadata("design:type", Boolean)
|
|
40
|
+
], AgentStatus.prototype, "isInitialized", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
Field(),
|
|
43
|
+
__metadata("design:type", Boolean)
|
|
44
|
+
], AgentStatus.prototype, "isUnlocked", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
Field({ nullable: true }),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], AgentStatus.prototype, "did", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
Field({ nullable: true }),
|
|
51
|
+
__metadata("design:type", String)
|
|
52
|
+
], AgentStatus.prototype, "didDocument", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
Field({ nullable: true }),
|
|
55
|
+
__metadata("design:type", String)
|
|
56
|
+
], AgentStatus.prototype, "error", void 0);
|
|
57
|
+
AgentStatus = __decorate([
|
|
58
|
+
ObjectType(),
|
|
59
|
+
__metadata("design:paramtypes", [Object])
|
|
60
|
+
], AgentStatus);
|
|
61
|
+
export { AgentStatus };
|
package/lib/src/buildSchema.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import "reflect-metadata";
|
|
1
|
+
import "reflect-metadata";
|
package/lib/src/buildSchema.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import "reflect-metadata";
|
|
2
|
-
import fs from 'fs';
|
|
3
|
-
import path from "path";
|
|
4
|
-
import { fileURLToPath } from 'url';
|
|
5
|
-
import { buildSchema } from "type-graphql";
|
|
6
|
-
import AgentResolver from "./agent/AgentResolver";
|
|
7
|
-
import ExpressionResolver from "./expression/ExpressionResolver";
|
|
8
|
-
import LanguageResolver from "./language/LanguageResolver";
|
|
9
|
-
import NeighbourhoodResolver from "./neighbourhood/NeighbourhoodResolver";
|
|
10
|
-
import PerspectiveResolver from "./perspectives/PerspectiveResolver";
|
|
11
|
-
import RuntimeResolver from "./runtime/RuntimeResolver";
|
|
12
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
13
|
-
const __dirname = path.dirname(__filename);
|
|
14
|
-
buildSchema({
|
|
15
|
-
resolvers: [
|
|
16
|
-
AgentResolver,
|
|
17
|
-
ExpressionResolver,
|
|
18
|
-
LanguageResolver,
|
|
19
|
-
NeighbourhoodResolver,
|
|
20
|
-
PerspectiveResolver,
|
|
21
|
-
RuntimeResolver
|
|
22
|
-
],
|
|
23
|
-
emitSchemaFile: {
|
|
24
|
-
path: __dirname + '/schema.gql',
|
|
25
|
-
commentDescriptions: true
|
|
26
|
-
}
|
|
27
|
-
})
|
|
28
|
-
.then(() => {
|
|
29
|
-
const schemaFile = fs.readFileSync(__dirname + '/schema.gql');
|
|
30
|
-
const schemaFileWithoutComments = schemaFile.toString().split("\n").filter((line) => !line.startsWith('#')).join("\n");
|
|
31
|
-
const typeDefsFile = `
|
|
32
|
-
export const typeDefsString = \`${schemaFileWithoutComments}\`
|
|
33
|
-
`;
|
|
34
|
-
fs.writeFileSync(__dirname + '/typeDefs.js', typeDefsFile);
|
|
35
|
-
//fs.writeFileSync(__dirname+'/src/typeDefs.js', typeDefsFile)
|
|
36
|
-
});
|
|
1
|
+
import "reflect-metadata";
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import path from "path";
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
5
|
+
import { buildSchema } from "type-graphql";
|
|
6
|
+
import AgentResolver from "./agent/AgentResolver";
|
|
7
|
+
import ExpressionResolver from "./expression/ExpressionResolver";
|
|
8
|
+
import LanguageResolver from "./language/LanguageResolver";
|
|
9
|
+
import NeighbourhoodResolver from "./neighbourhood/NeighbourhoodResolver";
|
|
10
|
+
import PerspectiveResolver from "./perspectives/PerspectiveResolver";
|
|
11
|
+
import RuntimeResolver from "./runtime/RuntimeResolver";
|
|
12
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
13
|
+
const __dirname = path.dirname(__filename);
|
|
14
|
+
buildSchema({
|
|
15
|
+
resolvers: [
|
|
16
|
+
AgentResolver,
|
|
17
|
+
ExpressionResolver,
|
|
18
|
+
LanguageResolver,
|
|
19
|
+
NeighbourhoodResolver,
|
|
20
|
+
PerspectiveResolver,
|
|
21
|
+
RuntimeResolver
|
|
22
|
+
],
|
|
23
|
+
emitSchemaFile: {
|
|
24
|
+
path: __dirname + '/schema.gql',
|
|
25
|
+
commentDescriptions: true
|
|
26
|
+
}
|
|
27
|
+
})
|
|
28
|
+
.then(() => {
|
|
29
|
+
const schemaFile = fs.readFileSync(__dirname + '/schema.gql');
|
|
30
|
+
const schemaFileWithoutComments = schemaFile.toString().split("\n").filter((line) => !line.startsWith('#')).join("\n");
|
|
31
|
+
const typeDefsFile = `
|
|
32
|
+
export const typeDefsString = \`${schemaFileWithoutComments}\`
|
|
33
|
+
`;
|
|
34
|
+
fs.writeFileSync(__dirname + '/typeDefs.js', typeDefsFile);
|
|
35
|
+
//fs.writeFileSync(__dirname+'/src/typeDefs.js', typeDefsFile)
|
|
36
|
+
});
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { ClassType } from "type-graphql";
|
|
2
|
-
import { Icon } from "../language/Icon";
|
|
3
|
-
import { LanguageRef } from "../language/LanguageRef";
|
|
4
|
-
export declare class ExpressionProof {
|
|
5
|
-
signature: string;
|
|
6
|
-
key: string;
|
|
7
|
-
valid?: boolean;
|
|
8
|
-
invalid?: boolean;
|
|
9
|
-
constructor(sig: string, k: string);
|
|
10
|
-
}
|
|
11
|
-
export declare class ExpressionProofInput {
|
|
12
|
-
signature: string;
|
|
13
|
-
key: string;
|
|
14
|
-
valid?: boolean;
|
|
15
|
-
invalid?: boolean;
|
|
16
|
-
}
|
|
17
|
-
export declare function ExpressionGeneric<DataType>(DataTypeClass: ClassType<DataType>): any;
|
|
18
|
-
export declare function ExpressionGenericInput<DataType>(DataTypeClass: ClassType<DataType>): any;
|
|
19
|
-
declare const Expression_base: any;
|
|
20
|
-
export declare class Expression extends Expression_base {
|
|
21
|
-
}
|
|
22
|
-
declare const ExpressionRendered_base: any;
|
|
23
|
-
export declare class ExpressionRendered extends ExpressionRendered_base {
|
|
24
|
-
language: LanguageRef;
|
|
25
|
-
icon: Icon;
|
|
26
|
-
}
|
|
27
|
-
export declare function isExpression(e: any): boolean;
|
|
28
|
-
export {};
|
|
1
|
+
import { ClassType } from "type-graphql";
|
|
2
|
+
import { Icon } from "../language/Icon";
|
|
3
|
+
import { LanguageRef } from "../language/LanguageRef";
|
|
4
|
+
export declare class ExpressionProof {
|
|
5
|
+
signature: string;
|
|
6
|
+
key: string;
|
|
7
|
+
valid?: boolean;
|
|
8
|
+
invalid?: boolean;
|
|
9
|
+
constructor(sig: string, k: string);
|
|
10
|
+
}
|
|
11
|
+
export declare class ExpressionProofInput {
|
|
12
|
+
signature: string;
|
|
13
|
+
key: string;
|
|
14
|
+
valid?: boolean;
|
|
15
|
+
invalid?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare function ExpressionGeneric<DataType>(DataTypeClass: ClassType<DataType>): any;
|
|
18
|
+
export declare function ExpressionGenericInput<DataType>(DataTypeClass: ClassType<DataType>): any;
|
|
19
|
+
declare const Expression_base: any;
|
|
20
|
+
export declare class Expression extends Expression_base {
|
|
21
|
+
}
|
|
22
|
+
declare const ExpressionRendered_base: any;
|
|
23
|
+
export declare class ExpressionRendered extends ExpressionRendered_base {
|
|
24
|
+
language: LanguageRef;
|
|
25
|
+
icon: Icon;
|
|
26
|
+
}
|
|
27
|
+
export declare function isExpression(e: any): boolean;
|
|
28
|
+
export {};
|
|
@@ -1,143 +1,143 @@
|
|
|
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 { Icon } from "../language/Icon";
|
|
12
|
-
import { LanguageRef } from "../language/LanguageRef";
|
|
13
|
-
let ExpressionProof = class ExpressionProof {
|
|
14
|
-
constructor(sig, k) {
|
|
15
|
-
this.key = k;
|
|
16
|
-
this.signature = sig;
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
__decorate([
|
|
20
|
-
Field({ nullable: true }),
|
|
21
|
-
__metadata("design:type", String)
|
|
22
|
-
], ExpressionProof.prototype, "signature", void 0);
|
|
23
|
-
__decorate([
|
|
24
|
-
Field({ nullable: true }),
|
|
25
|
-
__metadata("design:type", String)
|
|
26
|
-
], ExpressionProof.prototype, "key", void 0);
|
|
27
|
-
__decorate([
|
|
28
|
-
Field({ nullable: true }),
|
|
29
|
-
__metadata("design:type", Boolean)
|
|
30
|
-
], ExpressionProof.prototype, "valid", void 0);
|
|
31
|
-
__decorate([
|
|
32
|
-
Field({ nullable: true }),
|
|
33
|
-
__metadata("design:type", Boolean)
|
|
34
|
-
], ExpressionProof.prototype, "invalid", void 0);
|
|
35
|
-
ExpressionProof = __decorate([
|
|
36
|
-
ObjectType(),
|
|
37
|
-
InputType(),
|
|
38
|
-
__metadata("design:paramtypes", [String, String])
|
|
39
|
-
], ExpressionProof);
|
|
40
|
-
export { ExpressionProof };
|
|
41
|
-
let ExpressionProofInput = class ExpressionProofInput {
|
|
42
|
-
};
|
|
43
|
-
__decorate([
|
|
44
|
-
Field({ nullable: true }),
|
|
45
|
-
__metadata("design:type", String)
|
|
46
|
-
], ExpressionProofInput.prototype, "signature", void 0);
|
|
47
|
-
__decorate([
|
|
48
|
-
Field({ nullable: true }),
|
|
49
|
-
__metadata("design:type", String)
|
|
50
|
-
], ExpressionProofInput.prototype, "key", void 0);
|
|
51
|
-
__decorate([
|
|
52
|
-
Field({ nullable: true }),
|
|
53
|
-
__metadata("design:type", Boolean)
|
|
54
|
-
], ExpressionProofInput.prototype, "valid", void 0);
|
|
55
|
-
__decorate([
|
|
56
|
-
Field({ nullable: true }),
|
|
57
|
-
__metadata("design:type", Boolean)
|
|
58
|
-
], ExpressionProofInput.prototype, "invalid", void 0);
|
|
59
|
-
ExpressionProofInput = __decorate([
|
|
60
|
-
InputType()
|
|
61
|
-
], ExpressionProofInput);
|
|
62
|
-
export { ExpressionProofInput };
|
|
63
|
-
//Note having any as return type here fixes compilation errors but I think we loose the ExpressionClass type in resulting .d.ts gql files
|
|
64
|
-
export function ExpressionGeneric(DataTypeClass) {
|
|
65
|
-
let ExpressionClass = class ExpressionClass {
|
|
66
|
-
constructor(author, timestamp, data, proof) {
|
|
67
|
-
this.author = author;
|
|
68
|
-
this.timestamp = timestamp;
|
|
69
|
-
this.data = data;
|
|
70
|
-
this.proof = proof;
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
__decorate([
|
|
74
|
-
Field(),
|
|
75
|
-
__metadata("design:type", String)
|
|
76
|
-
], ExpressionClass.prototype, "author", void 0);
|
|
77
|
-
__decorate([
|
|
78
|
-
Field(),
|
|
79
|
-
__metadata("design:type", String)
|
|
80
|
-
], ExpressionClass.prototype, "timestamp", void 0);
|
|
81
|
-
__decorate([
|
|
82
|
-
Field(type => DataTypeClass),
|
|
83
|
-
__metadata("design:type", Object)
|
|
84
|
-
], ExpressionClass.prototype, "data", void 0);
|
|
85
|
-
__decorate([
|
|
86
|
-
Field(),
|
|
87
|
-
__metadata("design:type", ExpressionProof)
|
|
88
|
-
], ExpressionClass.prototype, "proof", void 0);
|
|
89
|
-
ExpressionClass = __decorate([
|
|
90
|
-
ObjectType(),
|
|
91
|
-
__metadata("design:paramtypes", [String, String, Object, ExpressionProof])
|
|
92
|
-
], ExpressionClass);
|
|
93
|
-
return ExpressionClass;
|
|
94
|
-
}
|
|
95
|
-
export function ExpressionGenericInput(DataTypeClass) {
|
|
96
|
-
let ExpressionClass = class ExpressionClass {
|
|
97
|
-
};
|
|
98
|
-
__decorate([
|
|
99
|
-
Field(),
|
|
100
|
-
__metadata("design:type", String)
|
|
101
|
-
], ExpressionClass.prototype, "author", void 0);
|
|
102
|
-
__decorate([
|
|
103
|
-
Field(),
|
|
104
|
-
__metadata("design:type", String)
|
|
105
|
-
], ExpressionClass.prototype, "timestamp", void 0);
|
|
106
|
-
__decorate([
|
|
107
|
-
Field(type => DataTypeClass),
|
|
108
|
-
__metadata("design:type", Object)
|
|
109
|
-
], ExpressionClass.prototype, "data", void 0);
|
|
110
|
-
__decorate([
|
|
111
|
-
Field(),
|
|
112
|
-
__metadata("design:type", ExpressionProofInput)
|
|
113
|
-
], ExpressionClass.prototype, "proof", void 0);
|
|
114
|
-
ExpressionClass = __decorate([
|
|
115
|
-
InputType()
|
|
116
|
-
], ExpressionClass);
|
|
117
|
-
return ExpressionClass;
|
|
118
|
-
}
|
|
119
|
-
let Expression = class Expression extends ExpressionGeneric(Object) {
|
|
120
|
-
};
|
|
121
|
-
Expression = __decorate([
|
|
122
|
-
ObjectType()
|
|
123
|
-
], Expression);
|
|
124
|
-
export { Expression };
|
|
125
|
-
;
|
|
126
|
-
let ExpressionRendered = class ExpressionRendered extends ExpressionGeneric(String) {
|
|
127
|
-
};
|
|
128
|
-
__decorate([
|
|
129
|
-
Field(),
|
|
130
|
-
__metadata("design:type", LanguageRef)
|
|
131
|
-
], ExpressionRendered.prototype, "language", void 0);
|
|
132
|
-
__decorate([
|
|
133
|
-
Field(),
|
|
134
|
-
__metadata("design:type", Icon)
|
|
135
|
-
], ExpressionRendered.prototype, "icon", void 0);
|
|
136
|
-
ExpressionRendered = __decorate([
|
|
137
|
-
ObjectType()
|
|
138
|
-
], ExpressionRendered);
|
|
139
|
-
export { ExpressionRendered };
|
|
140
|
-
;
|
|
141
|
-
export function isExpression(e) {
|
|
142
|
-
return e && e.author && e.timestamp && e.data;
|
|
143
|
-
}
|
|
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 { Icon } from "../language/Icon";
|
|
12
|
+
import { LanguageRef } from "../language/LanguageRef";
|
|
13
|
+
let ExpressionProof = class ExpressionProof {
|
|
14
|
+
constructor(sig, k) {
|
|
15
|
+
this.key = k;
|
|
16
|
+
this.signature = sig;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
__decorate([
|
|
20
|
+
Field({ nullable: true }),
|
|
21
|
+
__metadata("design:type", String)
|
|
22
|
+
], ExpressionProof.prototype, "signature", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
Field({ nullable: true }),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], ExpressionProof.prototype, "key", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
Field({ nullable: true }),
|
|
29
|
+
__metadata("design:type", Boolean)
|
|
30
|
+
], ExpressionProof.prototype, "valid", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
Field({ nullable: true }),
|
|
33
|
+
__metadata("design:type", Boolean)
|
|
34
|
+
], ExpressionProof.prototype, "invalid", void 0);
|
|
35
|
+
ExpressionProof = __decorate([
|
|
36
|
+
ObjectType(),
|
|
37
|
+
InputType(),
|
|
38
|
+
__metadata("design:paramtypes", [String, String])
|
|
39
|
+
], ExpressionProof);
|
|
40
|
+
export { ExpressionProof };
|
|
41
|
+
let ExpressionProofInput = class ExpressionProofInput {
|
|
42
|
+
};
|
|
43
|
+
__decorate([
|
|
44
|
+
Field({ nullable: true }),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], ExpressionProofInput.prototype, "signature", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
Field({ nullable: true }),
|
|
49
|
+
__metadata("design:type", String)
|
|
50
|
+
], ExpressionProofInput.prototype, "key", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
Field({ nullable: true }),
|
|
53
|
+
__metadata("design:type", Boolean)
|
|
54
|
+
], ExpressionProofInput.prototype, "valid", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
Field({ nullable: true }),
|
|
57
|
+
__metadata("design:type", Boolean)
|
|
58
|
+
], ExpressionProofInput.prototype, "invalid", void 0);
|
|
59
|
+
ExpressionProofInput = __decorate([
|
|
60
|
+
InputType()
|
|
61
|
+
], ExpressionProofInput);
|
|
62
|
+
export { ExpressionProofInput };
|
|
63
|
+
//Note having any as return type here fixes compilation errors but I think we loose the ExpressionClass type in resulting .d.ts gql files
|
|
64
|
+
export function ExpressionGeneric(DataTypeClass) {
|
|
65
|
+
let ExpressionClass = class ExpressionClass {
|
|
66
|
+
constructor(author, timestamp, data, proof) {
|
|
67
|
+
this.author = author;
|
|
68
|
+
this.timestamp = timestamp;
|
|
69
|
+
this.data = data;
|
|
70
|
+
this.proof = proof;
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
__decorate([
|
|
74
|
+
Field(),
|
|
75
|
+
__metadata("design:type", String)
|
|
76
|
+
], ExpressionClass.prototype, "author", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
Field(),
|
|
79
|
+
__metadata("design:type", String)
|
|
80
|
+
], ExpressionClass.prototype, "timestamp", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
Field(type => DataTypeClass),
|
|
83
|
+
__metadata("design:type", Object)
|
|
84
|
+
], ExpressionClass.prototype, "data", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
Field(),
|
|
87
|
+
__metadata("design:type", ExpressionProof)
|
|
88
|
+
], ExpressionClass.prototype, "proof", void 0);
|
|
89
|
+
ExpressionClass = __decorate([
|
|
90
|
+
ObjectType(),
|
|
91
|
+
__metadata("design:paramtypes", [String, String, Object, ExpressionProof])
|
|
92
|
+
], ExpressionClass);
|
|
93
|
+
return ExpressionClass;
|
|
94
|
+
}
|
|
95
|
+
export function ExpressionGenericInput(DataTypeClass) {
|
|
96
|
+
let ExpressionClass = class ExpressionClass {
|
|
97
|
+
};
|
|
98
|
+
__decorate([
|
|
99
|
+
Field(),
|
|
100
|
+
__metadata("design:type", String)
|
|
101
|
+
], ExpressionClass.prototype, "author", void 0);
|
|
102
|
+
__decorate([
|
|
103
|
+
Field(),
|
|
104
|
+
__metadata("design:type", String)
|
|
105
|
+
], ExpressionClass.prototype, "timestamp", void 0);
|
|
106
|
+
__decorate([
|
|
107
|
+
Field(type => DataTypeClass),
|
|
108
|
+
__metadata("design:type", Object)
|
|
109
|
+
], ExpressionClass.prototype, "data", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
Field(),
|
|
112
|
+
__metadata("design:type", ExpressionProofInput)
|
|
113
|
+
], ExpressionClass.prototype, "proof", void 0);
|
|
114
|
+
ExpressionClass = __decorate([
|
|
115
|
+
InputType()
|
|
116
|
+
], ExpressionClass);
|
|
117
|
+
return ExpressionClass;
|
|
118
|
+
}
|
|
119
|
+
let Expression = class Expression extends ExpressionGeneric(Object) {
|
|
120
|
+
};
|
|
121
|
+
Expression = __decorate([
|
|
122
|
+
ObjectType()
|
|
123
|
+
], Expression);
|
|
124
|
+
export { Expression };
|
|
125
|
+
;
|
|
126
|
+
let ExpressionRendered = class ExpressionRendered extends ExpressionGeneric(String) {
|
|
127
|
+
};
|
|
128
|
+
__decorate([
|
|
129
|
+
Field(),
|
|
130
|
+
__metadata("design:type", LanguageRef)
|
|
131
|
+
], ExpressionRendered.prototype, "language", void 0);
|
|
132
|
+
__decorate([
|
|
133
|
+
Field(),
|
|
134
|
+
__metadata("design:type", Icon)
|
|
135
|
+
], ExpressionRendered.prototype, "icon", void 0);
|
|
136
|
+
ExpressionRendered = __decorate([
|
|
137
|
+
ObjectType()
|
|
138
|
+
], ExpressionRendered);
|
|
139
|
+
export { ExpressionRendered };
|
|
140
|
+
;
|
|
141
|
+
export function isExpression(e) {
|
|
142
|
+
return e && e.author && e.timestamp && e.data;
|
|
143
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ApolloClient } from "@apollo/client/core";
|
|
2
|
-
import { InteractionCall, InteractionMeta } from "../language/Language";
|
|
3
|
-
import { ExpressionRendered } from "./Expression";
|
|
4
|
-
export declare class ExpressionClient {
|
|
5
|
-
#private;
|
|
6
|
-
constructor(client: ApolloClient<any>);
|
|
7
|
-
get(url: string): Promise<ExpressionRendered>;
|
|
8
|
-
getMany(urls: string[]): Promise<ExpressionRendered[]>;
|
|
9
|
-
getRaw(url: string): Promise<string>;
|
|
10
|
-
create(content: any, languageAddress: string): Promise<string>;
|
|
11
|
-
interactions(url: string): Promise<InteractionMeta[]>;
|
|
12
|
-
interact(url: string, interactionCall: InteractionCall): Promise<string | null>;
|
|
13
|
-
}
|
|
1
|
+
import { ApolloClient } from "@apollo/client/core";
|
|
2
|
+
import { InteractionCall, InteractionMeta } from "../language/Language";
|
|
3
|
+
import { ExpressionRendered } from "./Expression";
|
|
4
|
+
export declare class ExpressionClient {
|
|
5
|
+
#private;
|
|
6
|
+
constructor(client: ApolloClient<any>);
|
|
7
|
+
get(url: string): Promise<ExpressionRendered>;
|
|
8
|
+
getMany(urls: string[]): Promise<ExpressionRendered[]>;
|
|
9
|
+
getRaw(url: string): Promise<string>;
|
|
10
|
+
create(content: any, languageAddress: string): Promise<string>;
|
|
11
|
+
interactions(url: string): Promise<InteractionMeta[]>;
|
|
12
|
+
interact(url: string, interactionCall: InteractionCall): Promise<string | null>;
|
|
13
|
+
}
|