@coasys/ad4m 0.12.0-rc1-dev.2 → 0.12.0-rc1-dev.4
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 +10 -3
- package/lib/index.cjs +6893 -5884
- package/lib/index.js +6889 -5872
- package/lib/src/Ad4mClient.d.ts +9 -16
- package/lib/src/Ad4mClient.js +46 -25
- package/lib/src/Literal.d.ts +1 -2
- package/lib/src/Literal.js +38 -35
- package/lib/src/SmartLiteral.d.ts +1 -2
- package/lib/src/SmartLiteral.js +30 -15
- package/lib/src/agent/AgentClient.d.ts +1 -4
- package/lib/src/agent/AgentClient.js +79 -99
- package/lib/src/ai/AIClient.d.ts +1 -2
- package/lib/src/ai/AIClient.js +224 -220
- package/lib/src/expression/ExpressionClient.d.ts +1 -1
- package/lib/src/expression/ExpressionClient.js +73 -86
- 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 +1351 -144
- package/lib/src/model/Ad4mModel.js +3760 -228
- package/lib/src/model/Ad4mModel.test.js +522 -979
- package/lib/src/model/Subject.d.ts +3 -3
- package/lib/src/model/Subject.js +25 -25
- package/lib/src/model/decorators.d.ts +444 -100
- package/lib/src/model/decorators.js +686 -321
- package/lib/src/model/util.d.ts +6 -6
- package/lib/src/model/util.js +24 -24
- package/lib/src/neighbourhood/NeighbourhoodClient.d.ts +1 -5
- package/lib/src/neighbourhood/NeighbourhoodClient.js +179 -242
- package/lib/src/neighbourhood/NeighbourhoodProxy.d.ts +1 -2
- package/lib/src/neighbourhood/NeighbourhoodProxy.js +28 -13
- package/lib/src/neighbourhood/NeighbourhoodProxy.test.js +5 -1
- package/lib/src/perspectives/PerspectiveClient.d.ts +9 -9
- package/lib/src/perspectives/PerspectiveClient.js +240 -316
- package/lib/src/perspectives/PerspectiveProxy.d.ts +99 -61
- package/lib/src/perspectives/PerspectiveProxy.js +485 -832
- package/lib/src/runtime/RuntimeClient.d.ts +1 -5
- package/lib/src/runtime/RuntimeClient.js +238 -412
- package/lib/src/shacl/SHACLFlow.test.js +105 -164
- package/lib/src/shacl/SHACLShape.d.ts +12 -17
- package/lib/src/shacl/SHACLShape.js +115 -128
- package/lib/src/shacl/SHACLShape.test.js +176 -244
- package/lib/src/shims/reflect-metadata.d.ts +0 -0
- package/lib/src/shims/type-graphql.d.ts +32 -0
- package/lib/src/src/Ad4mClient.d.ts +28 -0
- package/lib/src/src/Address.d.ts +1 -0
- package/lib/src/src/DID.d.ts +1 -0
- package/lib/src/src/Exception.d.ts +7 -0
- package/lib/src/src/Literal.d.ts +7 -0
- package/lib/src/src/PubSub.d.ts +17 -0
- package/lib/src/src/SmartLiteral.d.ts +12 -0
- package/lib/src/src/agent/Agent.d.ts +110 -0
- package/lib/src/src/agent/AgentClient.d.ts +62 -0
- package/lib/src/src/agent/AgentResolver.d.ts +30 -0
- package/lib/src/src/agent/AgentStatus.d.ts +8 -0
- package/lib/src/src/ai/AIClient.d.ts +32 -0
- package/lib/src/src/ai/AIResolver.d.ts +75 -0
- package/lib/src/src/ai/Tasks.d.ts +37 -0
- package/lib/src/src/buildSchema.d.ts +1 -0
- package/lib/src/src/expression/Expression.d.ts +28 -0
- package/lib/src/src/expression/ExpressionClient.d.ts +13 -0
- package/lib/src/src/expression/ExpressionRef.d.ts +9 -0
- package/lib/src/src/expression/ExpressionResolver.d.ts +10 -0
- package/lib/src/src/index.d.ts +35 -0
- package/lib/src/src/jestSetup.d.ts +1 -0
- package/lib/src/src/language/Icon.d.ts +4 -0
- package/lib/src/src/language/Language.d.ts +206 -0
- package/lib/src/src/language/LanguageClient.d.ts +17 -0
- package/lib/src/src/language/LanguageContext.d.ts +37 -0
- package/lib/src/src/language/LanguageHandle.d.ts +9 -0
- package/lib/src/src/language/LanguageMeta.d.ts +35 -0
- package/lib/src/src/language/LanguageRef.d.ts +6 -0
- package/lib/src/src/language/LanguageResolver.d.ts +19 -0
- package/lib/src/src/links/Links.d.ts +39 -0
- package/lib/src/src/links/Links.test.d.ts +1 -0
- package/lib/src/src/model/Ad4mModel.d.ts +1438 -0
- package/lib/src/src/model/Ad4mModel.test.d.ts +1 -0
- package/lib/src/src/model/Subject.d.ts +25 -0
- package/lib/src/src/model/decorators.d.ts +545 -0
- package/lib/src/src/model/util.d.ts +12 -0
- package/lib/src/src/neighbourhood/Neighbourhood.d.ts +10 -0
- package/lib/src/src/neighbourhood/NeighbourhoodClient.d.ts +25 -0
- package/lib/src/src/neighbourhood/NeighbourhoodProxy.d.ts +19 -0
- package/lib/src/src/neighbourhood/NeighbourhoodProxy.test.d.ts +1 -0
- package/lib/src/src/neighbourhood/NeighbourhoodResolver.d.ts +24 -0
- package/lib/src/src/perspectives/LinkQuery.d.ts +11 -0
- package/lib/src/src/perspectives/Perspective.d.ts +38 -0
- package/lib/src/src/perspectives/Perspective.test.d.ts +1 -0
- package/lib/src/src/perspectives/PerspectiveClient.d.ts +97 -0
- package/lib/src/src/perspectives/PerspectiveDiff.d.ts +9 -0
- package/lib/src/src/perspectives/PerspectiveHandle.d.ts +18 -0
- package/lib/src/src/perspectives/PerspectiveProxy.d.ts +865 -0
- package/lib/src/src/perspectives/PerspectiveResolver.d.ts +57 -0
- package/lib/src/src/runtime/RuntimeClient.d.ts +56 -0
- package/lib/src/src/runtime/RuntimeResolver.d.ts +132 -0
- package/lib/src/src/shacl/SHACLFlow.d.ts +171 -0
- package/lib/src/src/shacl/SHACLFlow.test.d.ts +1 -0
- package/lib/src/src/shacl/SHACLShape.d.ts +117 -0
- package/lib/src/src/shacl/SHACLShape.test.d.ts +1 -0
- package/lib/src/src/typeDefs.d.ts +1 -0
- package/lib/src/src/unwrapApolloResult.d.ts +2 -0
- package/lib/src/src/utils.d.ts +25 -0
- package/lib/src/utils.d.ts +0 -8
- package/lib/src/utils.js +7 -21
- package/package.json +15 -14
- package/src/Ad4mClient.test.ts +1315 -1564
- package/src/Ad4mClient.ts +54 -55
- package/src/Literal.test.ts +26 -45
- package/src/Literal.ts +66 -82
- package/src/SmartLiteral.ts +58 -74
- package/src/agent/AgentClient.ts +99 -144
- package/src/ai/AIClient.ts +359 -409
- package/src/expression/ExpressionClient.ts +96 -142
- package/src/index.ts +1 -1
- package/src/language/LanguageClient.ts +113 -137
- package/src/model/Ad4mModel.test.ts +616 -1114
- package/src/model/Ad4mModel.ts +4386 -451
- package/src/model/Subject.ts +159 -0
- package/src/model/decorators.ts +1168 -667
- package/src/model/util.ts +54 -53
- package/src/neighbourhood/NeighbourhoodClient.ts +266 -392
- package/src/neighbourhood/NeighbourhoodProxy.test.ts +7 -3
- package/src/neighbourhood/NeighbourhoodProxy.ts +40 -58
- package/src/perspectives/PerspectiveClient.ts +540 -779
- package/src/perspectives/PerspectiveProxy.ts +2067 -2860
- package/src/runtime/RuntimeClient.ts +476 -775
- package/src/shacl/SHACLFlow.test.ts +129 -196
- package/src/shacl/SHACLShape.test.ts +190 -284
- package/src/shacl/SHACLShape.ts +200 -224
- package/src/utils.ts +17 -31
- package/tsconfig.json +10 -9
- package/src/model/IMPROVEMENTS.md +0 -482
- package/src/model/PREDICATE_COLLISION_FIX.md +0 -651
- package/src/model/README.md +0 -317
- package/src/model/SHACL_MUTATION_DECOUPLING.md +0 -356
- package/src/model/SUBSCRIPTION_STRATEGY.md +0 -317
- package/src/model/TC39_STAGE_3_DECORATORS.md +0 -609
- package/src/model/mutation.ts +0 -461
- package/src/model/parentUtils.ts +0 -91
- package/src/model/prolog/generatePrologFacts.ts +0 -176
- package/src/model/prolog/index.ts +0 -1
- package/src/model/query/ModelQueryBuilder.ts +0 -173
- package/src/model/query/fetchInstance.ts +0 -181
- package/src/model/query/hydration.ts +0 -273
- package/src/model/query/operations.ts +0 -510
- package/src/model/query/snapshot.ts +0 -126
- package/src/model/query/surrealCompiler.ts +0 -376
- package/src/model/schema/fromJSONSchema.ts +0 -411
- package/src/model/schema/metadata.ts +0 -148
- package/src/model/subscription.ts +0 -307
- package/src/model/transaction.ts +0 -60
- package/src/model/types.ts +0 -207
|
@@ -1,127 +1,114 @@
|
|
|
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;
|
|
1
13
|
import { gql } from "@apollo/client/core";
|
|
2
14
|
import unwrapApolloResult from "../unwrapApolloResult";
|
|
3
15
|
import { Literal } from "../Literal";
|
|
4
16
|
export class ExpressionClient {
|
|
5
17
|
constructor(client) {
|
|
6
|
-
this
|
|
18
|
+
_ExpressionClient_apolloClient.set(this, void 0);
|
|
19
|
+
__classPrivateFieldSet(this, _ExpressionClient_apolloClient, client, "f");
|
|
7
20
|
}
|
|
8
21
|
async get(url, alwaysGet = false) {
|
|
9
22
|
if (!alwaysGet) {
|
|
10
23
|
try {
|
|
11
24
|
let literalValue = Literal.fromUrl(url).get();
|
|
12
|
-
if (typeof literalValue ===
|
|
13
|
-
if (
|
|
14
|
-
"timestamp" in literalValue &&
|
|
15
|
-
"data" in literalValue &&
|
|
16
|
-
"proof" in literalValue) {
|
|
25
|
+
if (typeof literalValue === 'object' && literalValue !== null) {
|
|
26
|
+
if ('author' in literalValue && 'timestamp' in literalValue && 'data' in literalValue && 'proof' in literalValue) {
|
|
17
27
|
return literalValue;
|
|
18
28
|
}
|
|
19
29
|
}
|
|
20
30
|
}
|
|
21
31
|
catch (e) { }
|
|
22
32
|
}
|
|
23
|
-
const { expression } = unwrapApolloResult(await this.
|
|
24
|
-
query: gql `
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
`,
|
|
40
|
-
variables: { url },
|
|
33
|
+
const { expression } = unwrapApolloResult(await __classPrivateFieldGet(this, _ExpressionClient_apolloClient, "f").query({
|
|
34
|
+
query: gql `query expression($url: String!) {
|
|
35
|
+
expression(url: $url) {
|
|
36
|
+
author
|
|
37
|
+
timestamp
|
|
38
|
+
data
|
|
39
|
+
language {
|
|
40
|
+
address
|
|
41
|
+
}
|
|
42
|
+
proof {
|
|
43
|
+
valid
|
|
44
|
+
invalid
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}`,
|
|
48
|
+
variables: { url }
|
|
41
49
|
}));
|
|
42
50
|
return expression;
|
|
43
51
|
}
|
|
44
52
|
async getMany(urls) {
|
|
45
|
-
const { expressionMany } = unwrapApolloResult(await this.
|
|
46
|
-
query: gql `
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
`,
|
|
62
|
-
variables: { urls },
|
|
53
|
+
const { expressionMany } = unwrapApolloResult(await __classPrivateFieldGet(this, _ExpressionClient_apolloClient, "f").query({
|
|
54
|
+
query: gql `query expressionMany($urls: [String!]!) {
|
|
55
|
+
expressionMany(urls: $urls) {
|
|
56
|
+
author
|
|
57
|
+
timestamp
|
|
58
|
+
data
|
|
59
|
+
language {
|
|
60
|
+
address
|
|
61
|
+
}
|
|
62
|
+
proof {
|
|
63
|
+
valid
|
|
64
|
+
invalid
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}`,
|
|
68
|
+
variables: { urls }
|
|
63
69
|
}));
|
|
64
70
|
return expressionMany;
|
|
65
71
|
}
|
|
66
72
|
async getRaw(url) {
|
|
67
|
-
const { expressionRaw } = unwrapApolloResult(await this.
|
|
68
|
-
query: gql `
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
`,
|
|
73
|
-
variables: { url },
|
|
73
|
+
const { expressionRaw } = unwrapApolloResult(await __classPrivateFieldGet(this, _ExpressionClient_apolloClient, "f").query({
|
|
74
|
+
query: gql `query expressionRaw($url: String!) {
|
|
75
|
+
expressionRaw(url: $url)
|
|
76
|
+
}`,
|
|
77
|
+
variables: { url }
|
|
74
78
|
}));
|
|
75
79
|
return expressionRaw;
|
|
76
80
|
}
|
|
77
81
|
async create(content, languageAddress) {
|
|
78
82
|
content = JSON.stringify(content);
|
|
79
|
-
const { expressionCreate } = unwrapApolloResult(await this.
|
|
80
|
-
mutation: gql `
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
) {
|
|
85
|
-
expressionCreate(
|
|
86
|
-
content: $content
|
|
87
|
-
languageAddress: $languageAddress
|
|
88
|
-
)
|
|
89
|
-
}
|
|
90
|
-
`,
|
|
91
|
-
variables: { content, languageAddress },
|
|
83
|
+
const { expressionCreate } = unwrapApolloResult(await __classPrivateFieldGet(this, _ExpressionClient_apolloClient, "f").mutate({
|
|
84
|
+
mutation: gql `mutation expressionCreate($content: String!, $languageAddress: String!){
|
|
85
|
+
expressionCreate(content: $content, languageAddress: $languageAddress)
|
|
86
|
+
}`,
|
|
87
|
+
variables: { content, languageAddress }
|
|
92
88
|
}));
|
|
93
89
|
return expressionCreate;
|
|
94
90
|
}
|
|
95
91
|
async interactions(url) {
|
|
96
|
-
const { expressionInteractions } = unwrapApolloResult(await this.
|
|
97
|
-
query: gql `
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
`,
|
|
109
|
-
variables: { url },
|
|
92
|
+
const { expressionInteractions } = unwrapApolloResult(await __classPrivateFieldGet(this, _ExpressionClient_apolloClient, "f").query({
|
|
93
|
+
query: gql `query expressionInteractions($url: String!) {
|
|
94
|
+
expressionInteractions(url: $url) {
|
|
95
|
+
label
|
|
96
|
+
name
|
|
97
|
+
parameters { name, type }
|
|
98
|
+
}
|
|
99
|
+
}`,
|
|
100
|
+
variables: { url }
|
|
110
101
|
}));
|
|
111
102
|
return expressionInteractions;
|
|
112
103
|
}
|
|
113
104
|
async interact(url, interactionCall) {
|
|
114
|
-
const { expressionInteract } = unwrapApolloResult(await this.
|
|
115
|
-
mutation: gql `
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
) {
|
|
120
|
-
expressionInteract(url: $url, interactionCall: $interactionCall)
|
|
121
|
-
}
|
|
122
|
-
`,
|
|
123
|
-
variables: { url, interactionCall },
|
|
105
|
+
const { expressionInteract } = unwrapApolloResult(await __classPrivateFieldGet(this, _ExpressionClient_apolloClient, "f").mutate({
|
|
106
|
+
mutation: gql `mutation expressionInteract($url: String!, $interactionCall: InteractionCall!){
|
|
107
|
+
expressionInteract(url: $url, interactionCall: $interactionCall)
|
|
108
|
+
}`,
|
|
109
|
+
variables: { url, interactionCall }
|
|
124
110
|
}));
|
|
125
111
|
return expressionInteract;
|
|
126
112
|
}
|
|
127
113
|
}
|
|
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/Subject";
|
|
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/Subject";
|
|
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
|
-
private
|
|
6
|
+
#private;
|
|
7
7
|
constructor(apolloClient: ApolloClient<any>);
|
|
8
8
|
byAddress(address: string): Promise<LanguageHandle>;
|
|
9
9
|
byFilter(filter: string): Promise<LanguageHandle[]>;
|
|
@@ -1,3 +1,15 @@
|
|
|
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;
|
|
1
13
|
import { gql } from "@apollo/client/core";
|
|
2
14
|
import unwrapApolloResult from "../unwrapApolloResult";
|
|
3
15
|
const LANGUAGE_COMPLETE = `
|
|
@@ -21,72 +33,59 @@ const LANGUAGE_META = `
|
|
|
21
33
|
`;
|
|
22
34
|
export class LanguageClient {
|
|
23
35
|
constructor(apolloClient) {
|
|
24
|
-
this
|
|
36
|
+
_LanguageClient_apolloClient.set(this, void 0);
|
|
37
|
+
__classPrivateFieldSet(this, _LanguageClient_apolloClient, apolloClient, "f");
|
|
25
38
|
}
|
|
26
39
|
async byAddress(address) {
|
|
27
|
-
const { language } = unwrapApolloResult(await this.
|
|
40
|
+
const { language } = unwrapApolloResult(await __classPrivateFieldGet(this, _LanguageClient_apolloClient, "f").query({
|
|
28
41
|
query: gql `query byAddress($address: String!) {
|
|
29
42
|
language(address: $address) {
|
|
30
43
|
${LANGUAGE_COMPLETE}
|
|
31
44
|
}
|
|
32
45
|
}`,
|
|
33
|
-
variables: { address }
|
|
46
|
+
variables: { address }
|
|
34
47
|
}));
|
|
35
48
|
return language;
|
|
36
49
|
}
|
|
37
50
|
async byFilter(filter) {
|
|
38
|
-
const { languages } = unwrapApolloResult(await this.
|
|
51
|
+
const { languages } = unwrapApolloResult(await __classPrivateFieldGet(this, _LanguageClient_apolloClient, "f").query({
|
|
39
52
|
query: gql `query byFilter($filter: String!) {
|
|
40
53
|
languages(filter: $filter) {
|
|
41
54
|
${LANGUAGE_COMPLETE}
|
|
42
55
|
}
|
|
43
56
|
}`,
|
|
44
|
-
variables: { filter }
|
|
57
|
+
variables: { filter }
|
|
45
58
|
}));
|
|
46
59
|
return languages;
|
|
47
60
|
}
|
|
48
61
|
async all() {
|
|
49
|
-
return this.byFilter(
|
|
62
|
+
return this.byFilter('');
|
|
50
63
|
}
|
|
51
64
|
async writeSettings(languageAddress, settings) {
|
|
52
|
-
const { languageWriteSettings } = unwrapApolloResult(await this.
|
|
53
|
-
mutation: gql `
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
) {
|
|
58
|
-
languageWriteSettings(
|
|
59
|
-
languageAddress: $languageAddress
|
|
60
|
-
settings: $settings
|
|
61
|
-
)
|
|
62
|
-
}
|
|
63
|
-
`,
|
|
64
|
-
variables: { languageAddress, settings },
|
|
65
|
+
const { languageWriteSettings } = unwrapApolloResult(await __classPrivateFieldGet(this, _LanguageClient_apolloClient, "f").mutate({
|
|
66
|
+
mutation: gql `mutation writeSettings($languageAddress: String!, $settings: String!) {
|
|
67
|
+
languageWriteSettings(languageAddress: $languageAddress, settings: $settings)
|
|
68
|
+
}`,
|
|
69
|
+
variables: { languageAddress, settings }
|
|
65
70
|
}));
|
|
66
71
|
return languageWriteSettings;
|
|
67
72
|
}
|
|
68
73
|
async applyTemplateAndPublish(sourceLanguageHash, templateData) {
|
|
69
|
-
const { languageApplyTemplateAndPublish } = unwrapApolloResult(await this.
|
|
70
|
-
mutation: gql `
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
$templateData: String!
|
|
74
|
-
) {
|
|
75
|
-
languageApplyTemplateAndPublish(
|
|
76
|
-
sourceLanguageHash: $sourceLanguageHash
|
|
77
|
-
templateData: $templateData
|
|
74
|
+
const { languageApplyTemplateAndPublish } = unwrapApolloResult(await __classPrivateFieldGet(this, _LanguageClient_apolloClient, "f").mutate({
|
|
75
|
+
mutation: gql `mutation languageApplyTemplateAndPublish(
|
|
76
|
+
$sourceLanguageHash: String!,
|
|
77
|
+
$templateData: String!,
|
|
78
78
|
) {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
variables: { sourceLanguageHash, templateData },
|
|
79
|
+
languageApplyTemplateAndPublish(sourceLanguageHash: $sourceLanguageHash, templateData: $templateData) {
|
|
80
|
+
name, address
|
|
81
|
+
}
|
|
82
|
+
}`,
|
|
83
|
+
variables: { sourceLanguageHash, templateData }
|
|
85
84
|
}));
|
|
86
85
|
return languageApplyTemplateAndPublish;
|
|
87
86
|
}
|
|
88
87
|
async publish(languagePath, languageMeta) {
|
|
89
|
-
const { languagePublish } = unwrapApolloResult(await this.
|
|
88
|
+
const { languagePublish } = unwrapApolloResult(await __classPrivateFieldGet(this, _LanguageClient_apolloClient, "f").mutate({
|
|
90
89
|
mutation: gql `mutation languagePublish(
|
|
91
90
|
$languagePath: String!,
|
|
92
91
|
$languageMeta: LanguageMetaInput!,
|
|
@@ -95,12 +94,12 @@ export class LanguageClient {
|
|
|
95
94
|
${LANGUAGE_META}
|
|
96
95
|
}
|
|
97
96
|
}`,
|
|
98
|
-
variables: { languagePath, languageMeta }
|
|
97
|
+
variables: { languagePath, languageMeta }
|
|
99
98
|
}));
|
|
100
99
|
return languagePublish;
|
|
101
100
|
}
|
|
102
101
|
async meta(address) {
|
|
103
|
-
const { languageMeta } = unwrapApolloResult(await this.
|
|
102
|
+
const { languageMeta } = unwrapApolloResult(await __classPrivateFieldGet(this, _LanguageClient_apolloClient, "f").query({
|
|
104
103
|
query: gql `query languageMeta(
|
|
105
104
|
$address: String!,
|
|
106
105
|
) {
|
|
@@ -108,30 +107,31 @@ export class LanguageClient {
|
|
|
108
107
|
${LANGUAGE_META}
|
|
109
108
|
}
|
|
110
109
|
}`,
|
|
111
|
-
variables: { address }
|
|
110
|
+
variables: { address }
|
|
112
111
|
}));
|
|
113
112
|
return languageMeta;
|
|
114
113
|
}
|
|
115
114
|
async source(address) {
|
|
116
|
-
const { languageSource } = unwrapApolloResult(await this.
|
|
117
|
-
query: gql `
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
variables: { address }
|
|
115
|
+
const { languageSource } = unwrapApolloResult(await __classPrivateFieldGet(this, _LanguageClient_apolloClient, "f").query({
|
|
116
|
+
query: gql `query languageSource(
|
|
117
|
+
$address: String!,
|
|
118
|
+
) {
|
|
119
|
+
languageSource(address: $address)
|
|
120
|
+
}`,
|
|
121
|
+
variables: { address }
|
|
123
122
|
}));
|
|
124
123
|
return languageSource;
|
|
125
124
|
}
|
|
126
125
|
async remove(address) {
|
|
127
|
-
const { languageRemove } = unwrapApolloResult(await this.
|
|
128
|
-
mutation: gql `
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
variables: { address }
|
|
126
|
+
const { languageRemove } = unwrapApolloResult(await __classPrivateFieldGet(this, _LanguageClient_apolloClient, "f").mutate({
|
|
127
|
+
mutation: gql `mutation languageRemove(
|
|
128
|
+
$address: String!,
|
|
129
|
+
) {
|
|
130
|
+
languageRemove(address: $address)
|
|
131
|
+
}`,
|
|
132
|
+
variables: { address }
|
|
134
133
|
}));
|
|
135
134
|
return languageRemove;
|
|
136
135
|
}
|
|
137
136
|
}
|
|
137
|
+
_LanguageClient_apolloClient = new WeakMap();
|