@coasys/ad4m 0.12.0-rc1-dev → 0.12.0-rc1-dev.2
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/jest.config.js +4 -4
- package/lib/index.cjs +5999 -6044
- package/lib/index.js +5977 -6038
- package/lib/src/Ad4mClient.d.ts +16 -9
- package/lib/src/Ad4mClient.js +25 -46
- package/lib/src/Ad4mClient.test.d.ts +1 -0
- package/lib/src/Ad4mClient.test.js +1204 -0
- package/lib/src/Literal.d.ts +2 -1
- package/lib/src/Literal.js +35 -38
- package/lib/src/Literal.test.d.ts +1 -0
- package/lib/src/Literal.test.js +41 -0
- package/lib/src/SmartLiteral.d.ts +2 -1
- package/lib/src/SmartLiteral.js +15 -30
- package/lib/src/agent/AgentClient.d.ts +4 -1
- package/lib/src/agent/AgentClient.js +99 -79
- package/lib/src/ai/AIClient.d.ts +2 -1
- package/lib/src/ai/AIClient.js +220 -224
- package/lib/src/expression/ExpressionClient.d.ts +1 -1
- package/lib/src/expression/ExpressionClient.js +86 -73
- package/lib/src/index.d.ts +1 -1
- package/lib/src/index.js +1 -1
- package/lib/src/language/LanguageClient.d.ts +1 -1
- package/lib/src/language/LanguageClient.js +52 -52
- package/lib/src/model/Ad4mModel.d.ts +157 -937
- package/lib/src/model/Ad4mModel.js +212 -2797
- package/lib/src/model/Ad4mModel.test.js +1002 -561
- package/lib/src/model/decorators.d.ts +94 -426
- package/lib/src/model/decorators.js +333 -741
- package/lib/src/model/mutation.d.ts +81 -0
- package/lib/src/model/mutation.js +317 -0
- package/lib/src/model/parentUtils.d.ts +32 -0
- package/lib/src/model/parentUtils.js +64 -0
- package/lib/src/model/prolog/generatePrologFacts.d.ts +36 -0
- package/lib/src/model/prolog/generatePrologFacts.js +139 -0
- package/lib/src/model/prolog/index.d.ts +1 -0
- package/lib/src/model/prolog/index.js +1 -0
- package/lib/src/model/query/ModelQueryBuilder.d.ts +82 -0
- package/lib/src/model/query/ModelQueryBuilder.js +115 -0
- package/lib/src/model/query/QueryBuilder.d.ts +101 -0
- package/lib/src/model/query/QueryBuilder.js +193 -0
- package/lib/src/model/query/SurrealQueryBuilder.d.ts +48 -0
- package/lib/src/model/query/SurrealQueryBuilder.js +371 -0
- package/lib/src/model/query/fetchInstance.d.ts +24 -0
- package/lib/src/model/query/fetchInstance.js +144 -0
- package/lib/src/model/query/hydration.d.ts +54 -0
- package/lib/src/model/query/hydration.js +214 -0
- package/lib/src/model/query/operations.d.ts +59 -0
- package/lib/src/model/query/operations.js +384 -0
- package/lib/src/model/query/snapshot.d.ts +59 -0
- package/lib/src/model/query/snapshot.js +106 -0
- package/lib/src/model/query/surrealCompiler.d.ts +42 -0
- package/lib/src/model/query/surrealCompiler.js +304 -0
- package/lib/src/model/schema/fromJSONSchema.d.ts +67 -0
- package/lib/src/model/schema/fromJSONSchema.js +264 -0
- package/lib/src/model/schema/metadata.d.ts +15 -0
- package/lib/src/model/schema/metadata.js +112 -0
- package/lib/src/model/subscription.d.ts +47 -0
- package/lib/src/model/subscription.js +231 -0
- package/lib/src/model/transaction.d.ts +27 -0
- package/lib/src/model/transaction.js +32 -0
- package/lib/src/model/types.d.ts +195 -0
- package/lib/src/model/types.js +8 -0
- package/lib/src/model/util.js +7 -7
- package/lib/src/neighbourhood/NeighbourhoodClient.d.ts +5 -1
- package/lib/src/neighbourhood/NeighbourhoodClient.js +263 -181
- package/lib/src/neighbourhood/NeighbourhoodProxy.d.ts +2 -1
- package/lib/src/neighbourhood/NeighbourhoodProxy.js +13 -28
- package/lib/src/neighbourhood/NeighbourhoodProxy.test.js +1 -5
- package/lib/src/perspectives/PerspectiveClient.d.ts +9 -9
- package/lib/src/perspectives/PerspectiveClient.js +316 -240
- package/lib/src/perspectives/PerspectiveProxy.d.ts +54 -92
- package/lib/src/perspectives/PerspectiveProxy.js +803 -444
- package/lib/src/runtime/RuntimeClient.d.ts +5 -1
- package/lib/src/runtime/RuntimeClient.js +412 -238
- package/lib/src/shacl/SHACLFlow.test.js +164 -105
- package/lib/src/shacl/SHACLShape.d.ts +17 -3
- package/lib/src/shacl/SHACLShape.js +127 -90
- package/lib/src/shacl/SHACLShape.test.js +244 -176
- package/lib/src/utils.d.ts +8 -0
- package/lib/src/utils.js +21 -7
- package/package.json +8 -13
- package/src/Ad4mClient.test.ts +1564 -1315
- package/src/Ad4mClient.ts +55 -54
- package/src/Literal.test.ts +45 -26
- package/src/Literal.ts +82 -66
- package/src/SmartLiteral.ts +74 -58
- package/src/agent/AgentClient.ts +144 -99
- package/src/ai/AIClient.ts +409 -359
- package/src/expression/ExpressionClient.ts +142 -96
- package/src/index.ts +1 -1
- package/src/language/LanguageClient.ts +137 -113
- package/src/model/Ad4mModel.test.ts +1128 -647
- package/src/model/Ad4mModel.ts +485 -3247
- package/src/model/IMPROVEMENTS.md +482 -0
- package/src/model/PREDICATE_COLLISION_FIX.md +651 -0
- package/src/model/README.md +317 -0
- package/src/model/SHACL_MUTATION_DECOUPLING.md +356 -0
- package/src/model/SUBSCRIPTION_STRATEGY.md +317 -0
- package/src/model/TC39_STAGE_3_DECORATORS.md +609 -0
- package/src/model/decorators.ts +689 -1046
- package/src/model/mutation.ts +461 -0
- package/src/model/parentUtils.ts +91 -0
- package/src/model/prolog/generatePrologFacts.ts +176 -0
- package/src/model/prolog/index.ts +1 -0
- package/src/model/query/ModelQueryBuilder.ts +173 -0
- package/src/model/query/fetchInstance.ts +181 -0
- package/src/model/query/hydration.ts +273 -0
- package/src/model/query/operations.ts +510 -0
- package/src/model/query/snapshot.ts +126 -0
- package/src/model/query/surrealCompiler.ts +376 -0
- package/src/model/schema/fromJSONSchema.ts +411 -0
- package/src/model/schema/metadata.ts +148 -0
- package/src/model/subscription.ts +307 -0
- package/src/model/transaction.ts +60 -0
- package/src/model/types.ts +207 -0
- package/src/model/util.ts +47 -48
- package/src/neighbourhood/NeighbourhoodClient.ts +393 -251
- package/src/neighbourhood/NeighbourhoodProxy.test.ts +3 -7
- package/src/neighbourhood/NeighbourhoodProxy.ts +58 -40
- package/src/perspectives/PerspectiveClient.ts +779 -540
- package/src/perspectives/PerspectiveProxy.ts +2860 -2053
- package/src/runtime/RuntimeClient.ts +775 -476
- package/src/shacl/SHACLFlow.test.ts +196 -129
- package/src/shacl/SHACLShape.test.ts +284 -190
- package/src/shacl/SHACLShape.ts +225 -172
- package/src/utils.ts +31 -17
- package/tsconfig.json +9 -10
- package/src/model/Subject.ts +0 -159
|
@@ -1,114 +1,127 @@
|
|
|
1
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
-
};
|
|
7
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
-
};
|
|
12
|
-
var _ExpressionClient_apolloClient;
|
|
13
1
|
import { gql } from "@apollo/client/core";
|
|
14
2
|
import unwrapApolloResult from "../unwrapApolloResult";
|
|
15
3
|
import { Literal } from "../Literal";
|
|
16
4
|
export class ExpressionClient {
|
|
17
5
|
constructor(client) {
|
|
18
|
-
|
|
19
|
-
__classPrivateFieldSet(this, _ExpressionClient_apolloClient, client, "f");
|
|
6
|
+
this._apolloClient = client;
|
|
20
7
|
}
|
|
21
8
|
async get(url, alwaysGet = false) {
|
|
22
9
|
if (!alwaysGet) {
|
|
23
10
|
try {
|
|
24
11
|
let literalValue = Literal.fromUrl(url).get();
|
|
25
|
-
if (typeof literalValue ===
|
|
26
|
-
if (
|
|
12
|
+
if (typeof literalValue === "object" && literalValue !== null) {
|
|
13
|
+
if ("author" in literalValue &&
|
|
14
|
+
"timestamp" in literalValue &&
|
|
15
|
+
"data" in literalValue &&
|
|
16
|
+
"proof" in literalValue) {
|
|
27
17
|
return literalValue;
|
|
28
18
|
}
|
|
29
19
|
}
|
|
30
20
|
}
|
|
31
21
|
catch (e) { }
|
|
32
22
|
}
|
|
33
|
-
const { expression } = unwrapApolloResult(await
|
|
34
|
-
query: gql `
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
23
|
+
const { expression } = unwrapApolloResult(await this._apolloClient.query({
|
|
24
|
+
query: gql `
|
|
25
|
+
query expression($url: String!) {
|
|
26
|
+
expression(url: $url) {
|
|
27
|
+
author
|
|
28
|
+
timestamp
|
|
29
|
+
data
|
|
30
|
+
language {
|
|
31
|
+
address
|
|
32
|
+
}
|
|
33
|
+
proof {
|
|
34
|
+
valid
|
|
35
|
+
invalid
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
`,
|
|
40
|
+
variables: { url },
|
|
49
41
|
}));
|
|
50
42
|
return expression;
|
|
51
43
|
}
|
|
52
44
|
async getMany(urls) {
|
|
53
|
-
const { expressionMany } = unwrapApolloResult(await
|
|
54
|
-
query: gql `
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
|
|
45
|
+
const { expressionMany } = unwrapApolloResult(await this._apolloClient.query({
|
|
46
|
+
query: gql `
|
|
47
|
+
query expressionMany($urls: [String!]!) {
|
|
48
|
+
expressionMany(urls: $urls) {
|
|
49
|
+
author
|
|
50
|
+
timestamp
|
|
51
|
+
data
|
|
52
|
+
language {
|
|
53
|
+
address
|
|
54
|
+
}
|
|
55
|
+
proof {
|
|
56
|
+
valid
|
|
57
|
+
invalid
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
`,
|
|
62
|
+
variables: { urls },
|
|
69
63
|
}));
|
|
70
64
|
return expressionMany;
|
|
71
65
|
}
|
|
72
66
|
async getRaw(url) {
|
|
73
|
-
const { expressionRaw } = unwrapApolloResult(await
|
|
74
|
-
query: gql `
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
67
|
+
const { expressionRaw } = unwrapApolloResult(await this._apolloClient.query({
|
|
68
|
+
query: gql `
|
|
69
|
+
query expressionRaw($url: String!) {
|
|
70
|
+
expressionRaw(url: $url)
|
|
71
|
+
}
|
|
72
|
+
`,
|
|
73
|
+
variables: { url },
|
|
78
74
|
}));
|
|
79
75
|
return expressionRaw;
|
|
80
76
|
}
|
|
81
77
|
async create(content, languageAddress) {
|
|
82
78
|
content = JSON.stringify(content);
|
|
83
|
-
const { expressionCreate } = unwrapApolloResult(await
|
|
84
|
-
mutation: gql `
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
79
|
+
const { expressionCreate } = unwrapApolloResult(await this._apolloClient.mutate({
|
|
80
|
+
mutation: gql `
|
|
81
|
+
mutation expressionCreate(
|
|
82
|
+
$content: String!
|
|
83
|
+
$languageAddress: String!
|
|
84
|
+
) {
|
|
85
|
+
expressionCreate(
|
|
86
|
+
content: $content
|
|
87
|
+
languageAddress: $languageAddress
|
|
88
|
+
)
|
|
89
|
+
}
|
|
90
|
+
`,
|
|
91
|
+
variables: { content, languageAddress },
|
|
88
92
|
}));
|
|
89
93
|
return expressionCreate;
|
|
90
94
|
}
|
|
91
95
|
async interactions(url) {
|
|
92
|
-
const { expressionInteractions } = unwrapApolloResult(await
|
|
93
|
-
query: gql `
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
96
|
+
const { expressionInteractions } = unwrapApolloResult(await this._apolloClient.query({
|
|
97
|
+
query: gql `
|
|
98
|
+
query expressionInteractions($url: String!) {
|
|
99
|
+
expressionInteractions(url: $url) {
|
|
100
|
+
label
|
|
101
|
+
name
|
|
102
|
+
parameters {
|
|
103
|
+
name
|
|
104
|
+
type
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
`,
|
|
109
|
+
variables: { url },
|
|
101
110
|
}));
|
|
102
111
|
return expressionInteractions;
|
|
103
112
|
}
|
|
104
113
|
async interact(url, interactionCall) {
|
|
105
|
-
const { expressionInteract } = unwrapApolloResult(await
|
|
106
|
-
mutation: gql `
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
114
|
+
const { expressionInteract } = unwrapApolloResult(await this._apolloClient.mutate({
|
|
115
|
+
mutation: gql `
|
|
116
|
+
mutation expressionInteract(
|
|
117
|
+
$url: String!
|
|
118
|
+
$interactionCall: InteractionCall!
|
|
119
|
+
) {
|
|
120
|
+
expressionInteract(url: $url, interactionCall: $interactionCall)
|
|
121
|
+
}
|
|
122
|
+
`,
|
|
123
|
+
variables: { url, interactionCall },
|
|
110
124
|
}));
|
|
111
125
|
return expressionInteract;
|
|
112
126
|
}
|
|
113
127
|
}
|
|
114
|
-
_ExpressionClient_apolloClient = new WeakMap();
|
package/lib/src/index.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export * from "./perspectives/PerspectiveDiff";
|
|
|
20
20
|
export * from "./perspectives/LinkQuery";
|
|
21
21
|
export * from "./SmartLiteral";
|
|
22
22
|
export * from "./model/decorators";
|
|
23
|
-
export * from "./model/
|
|
23
|
+
export * from "./model/prolog";
|
|
24
24
|
export * from "./neighbourhood/Neighbourhood";
|
|
25
25
|
export * from "./neighbourhood/NeighbourhoodProxy";
|
|
26
26
|
export * from "./typeDefs";
|
package/lib/src/index.js
CHANGED
|
@@ -20,7 +20,7 @@ export * from "./perspectives/PerspectiveDiff";
|
|
|
20
20
|
export * from "./perspectives/LinkQuery";
|
|
21
21
|
export * from "./SmartLiteral";
|
|
22
22
|
export * from "./model/decorators";
|
|
23
|
-
export * from "./model/
|
|
23
|
+
export * from "./model/prolog";
|
|
24
24
|
export * from "./neighbourhood/Neighbourhood";
|
|
25
25
|
export * from "./neighbourhood/NeighbourhoodProxy";
|
|
26
26
|
export * from "./typeDefs";
|
|
@@ -3,7 +3,7 @@ import { LanguageHandle } from "./LanguageHandle";
|
|
|
3
3
|
import { LanguageMeta, LanguageMetaInput } from "./LanguageMeta";
|
|
4
4
|
import { LanguageRef } from "./LanguageRef";
|
|
5
5
|
export declare class LanguageClient {
|
|
6
|
-
|
|
6
|
+
private _apolloClient;
|
|
7
7
|
constructor(apolloClient: ApolloClient<any>);
|
|
8
8
|
byAddress(address: string): Promise<LanguageHandle>;
|
|
9
9
|
byFilter(filter: string): Promise<LanguageHandle[]>;
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
-
};
|
|
7
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
-
};
|
|
12
|
-
var _LanguageClient_apolloClient;
|
|
13
1
|
import { gql } from "@apollo/client/core";
|
|
14
2
|
import unwrapApolloResult from "../unwrapApolloResult";
|
|
15
3
|
const LANGUAGE_COMPLETE = `
|
|
@@ -33,59 +21,72 @@ const LANGUAGE_META = `
|
|
|
33
21
|
`;
|
|
34
22
|
export class LanguageClient {
|
|
35
23
|
constructor(apolloClient) {
|
|
36
|
-
|
|
37
|
-
__classPrivateFieldSet(this, _LanguageClient_apolloClient, apolloClient, "f");
|
|
24
|
+
this._apolloClient = apolloClient;
|
|
38
25
|
}
|
|
39
26
|
async byAddress(address) {
|
|
40
|
-
const { language } = unwrapApolloResult(await
|
|
27
|
+
const { language } = unwrapApolloResult(await this._apolloClient.query({
|
|
41
28
|
query: gql `query byAddress($address: String!) {
|
|
42
29
|
language(address: $address) {
|
|
43
30
|
${LANGUAGE_COMPLETE}
|
|
44
31
|
}
|
|
45
32
|
}`,
|
|
46
|
-
variables: { address }
|
|
33
|
+
variables: { address },
|
|
47
34
|
}));
|
|
48
35
|
return language;
|
|
49
36
|
}
|
|
50
37
|
async byFilter(filter) {
|
|
51
|
-
const { languages } = unwrapApolloResult(await
|
|
38
|
+
const { languages } = unwrapApolloResult(await this._apolloClient.query({
|
|
52
39
|
query: gql `query byFilter($filter: String!) {
|
|
53
40
|
languages(filter: $filter) {
|
|
54
41
|
${LANGUAGE_COMPLETE}
|
|
55
42
|
}
|
|
56
43
|
}`,
|
|
57
|
-
variables: { filter }
|
|
44
|
+
variables: { filter },
|
|
58
45
|
}));
|
|
59
46
|
return languages;
|
|
60
47
|
}
|
|
61
48
|
async all() {
|
|
62
|
-
return this.byFilter(
|
|
49
|
+
return this.byFilter("");
|
|
63
50
|
}
|
|
64
51
|
async writeSettings(languageAddress, settings) {
|
|
65
|
-
const { languageWriteSettings } = unwrapApolloResult(await
|
|
66
|
-
mutation: gql `
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
52
|
+
const { languageWriteSettings } = unwrapApolloResult(await this._apolloClient.mutate({
|
|
53
|
+
mutation: gql `
|
|
54
|
+
mutation writeSettings(
|
|
55
|
+
$languageAddress: String!
|
|
56
|
+
$settings: String!
|
|
57
|
+
) {
|
|
58
|
+
languageWriteSettings(
|
|
59
|
+
languageAddress: $languageAddress
|
|
60
|
+
settings: $settings
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
`,
|
|
64
|
+
variables: { languageAddress, settings },
|
|
70
65
|
}));
|
|
71
66
|
return languageWriteSettings;
|
|
72
67
|
}
|
|
73
68
|
async applyTemplateAndPublish(sourceLanguageHash, templateData) {
|
|
74
|
-
const { languageApplyTemplateAndPublish } = unwrapApolloResult(await
|
|
75
|
-
mutation: gql `
|
|
76
|
-
|
|
77
|
-
|
|
69
|
+
const { languageApplyTemplateAndPublish } = unwrapApolloResult(await this._apolloClient.mutate({
|
|
70
|
+
mutation: gql `
|
|
71
|
+
mutation languageApplyTemplateAndPublish(
|
|
72
|
+
$sourceLanguageHash: String!
|
|
73
|
+
$templateData: String!
|
|
74
|
+
) {
|
|
75
|
+
languageApplyTemplateAndPublish(
|
|
76
|
+
sourceLanguageHash: $sourceLanguageHash
|
|
77
|
+
templateData: $templateData
|
|
78
78
|
) {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
79
|
+
name
|
|
80
|
+
address
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
`,
|
|
84
|
+
variables: { sourceLanguageHash, templateData },
|
|
84
85
|
}));
|
|
85
86
|
return languageApplyTemplateAndPublish;
|
|
86
87
|
}
|
|
87
88
|
async publish(languagePath, languageMeta) {
|
|
88
|
-
const { languagePublish } = unwrapApolloResult(await
|
|
89
|
+
const { languagePublish } = unwrapApolloResult(await this._apolloClient.mutate({
|
|
89
90
|
mutation: gql `mutation languagePublish(
|
|
90
91
|
$languagePath: String!,
|
|
91
92
|
$languageMeta: LanguageMetaInput!,
|
|
@@ -94,12 +95,12 @@ export class LanguageClient {
|
|
|
94
95
|
${LANGUAGE_META}
|
|
95
96
|
}
|
|
96
97
|
}`,
|
|
97
|
-
variables: { languagePath, languageMeta }
|
|
98
|
+
variables: { languagePath, languageMeta },
|
|
98
99
|
}));
|
|
99
100
|
return languagePublish;
|
|
100
101
|
}
|
|
101
102
|
async meta(address) {
|
|
102
|
-
const { languageMeta } = unwrapApolloResult(await
|
|
103
|
+
const { languageMeta } = unwrapApolloResult(await this._apolloClient.query({
|
|
103
104
|
query: gql `query languageMeta(
|
|
104
105
|
$address: String!,
|
|
105
106
|
) {
|
|
@@ -107,31 +108,30 @@ export class LanguageClient {
|
|
|
107
108
|
${LANGUAGE_META}
|
|
108
109
|
}
|
|
109
110
|
}`,
|
|
110
|
-
variables: { address }
|
|
111
|
+
variables: { address },
|
|
111
112
|
}));
|
|
112
113
|
return languageMeta;
|
|
113
114
|
}
|
|
114
115
|
async source(address) {
|
|
115
|
-
const { languageSource } = unwrapApolloResult(await
|
|
116
|
-
query: gql `
|
|
117
|
-
|
|
118
|
-
)
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
variables: { address }
|
|
116
|
+
const { languageSource } = unwrapApolloResult(await this._apolloClient.query({
|
|
117
|
+
query: gql `
|
|
118
|
+
query languageSource($address: String!) {
|
|
119
|
+
languageSource(address: $address)
|
|
120
|
+
}
|
|
121
|
+
`,
|
|
122
|
+
variables: { address },
|
|
122
123
|
}));
|
|
123
124
|
return languageSource;
|
|
124
125
|
}
|
|
125
126
|
async remove(address) {
|
|
126
|
-
const { languageRemove } = unwrapApolloResult(await
|
|
127
|
-
mutation: gql `
|
|
128
|
-
|
|
129
|
-
)
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
variables: { address }
|
|
127
|
+
const { languageRemove } = unwrapApolloResult(await this._apolloClient.mutate({
|
|
128
|
+
mutation: gql `
|
|
129
|
+
mutation languageRemove($address: String!) {
|
|
130
|
+
languageRemove(address: $address)
|
|
131
|
+
}
|
|
132
|
+
`,
|
|
133
|
+
variables: { address },
|
|
133
134
|
}));
|
|
134
135
|
return languageRemove;
|
|
135
136
|
}
|
|
136
137
|
}
|
|
137
|
-
_LanguageClient_apolloClient = new WeakMap();
|