@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,160 +1,160 @@
|
|
|
1
|
-
import { ApolloClient, gql } from "@apollo/client/core"
|
|
2
|
-
import unwrapApolloResult from "../unwrapApolloResult"
|
|
3
|
-
import { LanguageHandle } from "./LanguageHandle"
|
|
4
|
-
import { LanguageMeta, LanguageMetaInput } from "./LanguageMeta"
|
|
5
|
-
import { LanguageRef } from "./LanguageRef"
|
|
6
|
-
|
|
7
|
-
const LANGUAGE_COMPLETE = `
|
|
8
|
-
name
|
|
9
|
-
address
|
|
10
|
-
settings
|
|
11
|
-
icon { code }
|
|
12
|
-
constructorIcon { code }
|
|
13
|
-
settingsIcon { code }
|
|
14
|
-
`
|
|
15
|
-
|
|
16
|
-
const LANGUAGE_META = `
|
|
17
|
-
name
|
|
18
|
-
address
|
|
19
|
-
description
|
|
20
|
-
author
|
|
21
|
-
templated
|
|
22
|
-
templateSourceLanguageAddress
|
|
23
|
-
templateAppliedParams
|
|
24
|
-
possibleTemplateParams
|
|
25
|
-
sourceCodeLink
|
|
26
|
-
`
|
|
27
|
-
|
|
28
|
-
export class LanguageClient {
|
|
29
|
-
#apolloClient: ApolloClient<any>
|
|
30
|
-
|
|
31
|
-
constructor(apolloClient: ApolloClient<any>) {
|
|
32
|
-
this.#apolloClient = apolloClient
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
async byAddress(address: string): Promise<LanguageHandle> {
|
|
36
|
-
const { language } = unwrapApolloResult(await this.#apolloClient.query({
|
|
37
|
-
query: gql`query byAddress($address: String!) {
|
|
38
|
-
language(address: $address) {
|
|
39
|
-
${LANGUAGE_COMPLETE}
|
|
40
|
-
}
|
|
41
|
-
}`,
|
|
42
|
-
variables: { address }
|
|
43
|
-
}))
|
|
44
|
-
return language
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
async byFilter(filter: string): Promise<LanguageHandle[]> {
|
|
48
|
-
const { languages } = unwrapApolloResult(await this.#apolloClient.query({
|
|
49
|
-
query: gql`query byFilter($filter: String!) {
|
|
50
|
-
languages(filter: $filter) {
|
|
51
|
-
${LANGUAGE_COMPLETE}
|
|
52
|
-
}
|
|
53
|
-
}`,
|
|
54
|
-
variables: { filter }
|
|
55
|
-
}))
|
|
56
|
-
return languages
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
async all(): Promise<LanguageHandle[]> {
|
|
60
|
-
return this.byFilter('')
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
async writeSettings(
|
|
64
|
-
languageAddress: string,
|
|
65
|
-
settings: string
|
|
66
|
-
): Promise<Boolean> {
|
|
67
|
-
const { languageWriteSettings } = unwrapApolloResult(await this.#apolloClient.mutate({
|
|
68
|
-
mutation: gql`mutation writeSettings($languageAddress: String!, $settings: String!) {
|
|
69
|
-
languageWriteSettings(languageAddress: $languageAddress, settings: $settings)
|
|
70
|
-
}`,
|
|
71
|
-
variables: { languageAddress, settings }
|
|
72
|
-
}))
|
|
73
|
-
return languageWriteSettings
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
async applyTemplateAndPublish(
|
|
77
|
-
sourceLanguageHash: string,
|
|
78
|
-
templateData: string
|
|
79
|
-
): Promise<LanguageRef> {
|
|
80
|
-
const { languageApplyTemplateAndPublish } = unwrapApolloResult(await this.#apolloClient.mutate({
|
|
81
|
-
mutation: gql`mutation languageApplyTemplateAndPublish(
|
|
82
|
-
$sourceLanguageHash: String!,
|
|
83
|
-
$templateData: String!,
|
|
84
|
-
) {
|
|
85
|
-
languageApplyTemplateAndPublish(sourceLanguageHash: $sourceLanguageHash, templateData: $templateData) {
|
|
86
|
-
name, address
|
|
87
|
-
}
|
|
88
|
-
}`,
|
|
89
|
-
variables: { sourceLanguageHash, templateData }
|
|
90
|
-
}))
|
|
91
|
-
|
|
92
|
-
return languageApplyTemplateAndPublish
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
async publish(
|
|
96
|
-
languagePath: string,
|
|
97
|
-
languageMeta: LanguageMetaInput
|
|
98
|
-
): Promise<LanguageMeta> {
|
|
99
|
-
const { languagePublish } = unwrapApolloResult(await this.#apolloClient.mutate({
|
|
100
|
-
mutation: gql`mutation languagePublish(
|
|
101
|
-
$languagePath: String!,
|
|
102
|
-
$languageMeta: LanguageMetaInput!,
|
|
103
|
-
) {
|
|
104
|
-
languagePublish(languagePath: $languagePath, languageMeta: $languageMeta) {
|
|
105
|
-
${LANGUAGE_META}
|
|
106
|
-
}
|
|
107
|
-
}`,
|
|
108
|
-
variables: { languagePath, languageMeta }
|
|
109
|
-
}))
|
|
110
|
-
|
|
111
|
-
return languagePublish
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
async meta(
|
|
115
|
-
address: string,
|
|
116
|
-
): Promise<LanguageMeta> {
|
|
117
|
-
const { languageMeta } = unwrapApolloResult(await this.#apolloClient.query({
|
|
118
|
-
query: gql`query languageMeta(
|
|
119
|
-
$address: String!,
|
|
120
|
-
) {
|
|
121
|
-
languageMeta(address: $address) {
|
|
122
|
-
${LANGUAGE_META}
|
|
123
|
-
}
|
|
124
|
-
}`,
|
|
125
|
-
variables: { address }
|
|
126
|
-
}))
|
|
127
|
-
|
|
128
|
-
return languageMeta
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
async source(
|
|
132
|
-
address: string,
|
|
133
|
-
): Promise<string> {
|
|
134
|
-
const { languageSource } = unwrapApolloResult(await this.#apolloClient.query({
|
|
135
|
-
query: gql`query languageSource(
|
|
136
|
-
$address: String!,
|
|
137
|
-
) {
|
|
138
|
-
languageSource(address: $address)
|
|
139
|
-
}`,
|
|
140
|
-
variables: { address }
|
|
141
|
-
}))
|
|
142
|
-
|
|
143
|
-
return languageSource
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
async remove(
|
|
147
|
-
address: string
|
|
148
|
-
): Promise<Boolean> {
|
|
149
|
-
const { languageRemove } = unwrapApolloResult(await this.#apolloClient.mutate({
|
|
150
|
-
mutation: gql`mutation languageRemove(
|
|
151
|
-
$address: String!,
|
|
152
|
-
) {
|
|
153
|
-
languageRemove(address: $address)
|
|
154
|
-
}`,
|
|
155
|
-
variables: { address }
|
|
156
|
-
}))
|
|
157
|
-
|
|
158
|
-
return languageRemove
|
|
159
|
-
}
|
|
1
|
+
import { ApolloClient, gql } from "@apollo/client/core"
|
|
2
|
+
import unwrapApolloResult from "../unwrapApolloResult"
|
|
3
|
+
import { LanguageHandle } from "./LanguageHandle"
|
|
4
|
+
import { LanguageMeta, LanguageMetaInput } from "./LanguageMeta"
|
|
5
|
+
import { LanguageRef } from "./LanguageRef"
|
|
6
|
+
|
|
7
|
+
const LANGUAGE_COMPLETE = `
|
|
8
|
+
name
|
|
9
|
+
address
|
|
10
|
+
settings
|
|
11
|
+
icon { code }
|
|
12
|
+
constructorIcon { code }
|
|
13
|
+
settingsIcon { code }
|
|
14
|
+
`
|
|
15
|
+
|
|
16
|
+
const LANGUAGE_META = `
|
|
17
|
+
name
|
|
18
|
+
address
|
|
19
|
+
description
|
|
20
|
+
author
|
|
21
|
+
templated
|
|
22
|
+
templateSourceLanguageAddress
|
|
23
|
+
templateAppliedParams
|
|
24
|
+
possibleTemplateParams
|
|
25
|
+
sourceCodeLink
|
|
26
|
+
`
|
|
27
|
+
|
|
28
|
+
export class LanguageClient {
|
|
29
|
+
#apolloClient: ApolloClient<any>
|
|
30
|
+
|
|
31
|
+
constructor(apolloClient: ApolloClient<any>) {
|
|
32
|
+
this.#apolloClient = apolloClient
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async byAddress(address: string): Promise<LanguageHandle> {
|
|
36
|
+
const { language } = unwrapApolloResult(await this.#apolloClient.query({
|
|
37
|
+
query: gql`query byAddress($address: String!) {
|
|
38
|
+
language(address: $address) {
|
|
39
|
+
${LANGUAGE_COMPLETE}
|
|
40
|
+
}
|
|
41
|
+
}`,
|
|
42
|
+
variables: { address }
|
|
43
|
+
}))
|
|
44
|
+
return language
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async byFilter(filter: string): Promise<LanguageHandle[]> {
|
|
48
|
+
const { languages } = unwrapApolloResult(await this.#apolloClient.query({
|
|
49
|
+
query: gql`query byFilter($filter: String!) {
|
|
50
|
+
languages(filter: $filter) {
|
|
51
|
+
${LANGUAGE_COMPLETE}
|
|
52
|
+
}
|
|
53
|
+
}`,
|
|
54
|
+
variables: { filter }
|
|
55
|
+
}))
|
|
56
|
+
return languages
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
async all(): Promise<LanguageHandle[]> {
|
|
60
|
+
return this.byFilter('')
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async writeSettings(
|
|
64
|
+
languageAddress: string,
|
|
65
|
+
settings: string
|
|
66
|
+
): Promise<Boolean> {
|
|
67
|
+
const { languageWriteSettings } = unwrapApolloResult(await this.#apolloClient.mutate({
|
|
68
|
+
mutation: gql`mutation writeSettings($languageAddress: String!, $settings: String!) {
|
|
69
|
+
languageWriteSettings(languageAddress: $languageAddress, settings: $settings)
|
|
70
|
+
}`,
|
|
71
|
+
variables: { languageAddress, settings }
|
|
72
|
+
}))
|
|
73
|
+
return languageWriteSettings
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
async applyTemplateAndPublish(
|
|
77
|
+
sourceLanguageHash: string,
|
|
78
|
+
templateData: string
|
|
79
|
+
): Promise<LanguageRef> {
|
|
80
|
+
const { languageApplyTemplateAndPublish } = unwrapApolloResult(await this.#apolloClient.mutate({
|
|
81
|
+
mutation: gql`mutation languageApplyTemplateAndPublish(
|
|
82
|
+
$sourceLanguageHash: String!,
|
|
83
|
+
$templateData: String!,
|
|
84
|
+
) {
|
|
85
|
+
languageApplyTemplateAndPublish(sourceLanguageHash: $sourceLanguageHash, templateData: $templateData) {
|
|
86
|
+
name, address
|
|
87
|
+
}
|
|
88
|
+
}`,
|
|
89
|
+
variables: { sourceLanguageHash, templateData }
|
|
90
|
+
}))
|
|
91
|
+
|
|
92
|
+
return languageApplyTemplateAndPublish
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
async publish(
|
|
96
|
+
languagePath: string,
|
|
97
|
+
languageMeta: LanguageMetaInput
|
|
98
|
+
): Promise<LanguageMeta> {
|
|
99
|
+
const { languagePublish } = unwrapApolloResult(await this.#apolloClient.mutate({
|
|
100
|
+
mutation: gql`mutation languagePublish(
|
|
101
|
+
$languagePath: String!,
|
|
102
|
+
$languageMeta: LanguageMetaInput!,
|
|
103
|
+
) {
|
|
104
|
+
languagePublish(languagePath: $languagePath, languageMeta: $languageMeta) {
|
|
105
|
+
${LANGUAGE_META}
|
|
106
|
+
}
|
|
107
|
+
}`,
|
|
108
|
+
variables: { languagePath, languageMeta }
|
|
109
|
+
}))
|
|
110
|
+
|
|
111
|
+
return languagePublish
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
async meta(
|
|
115
|
+
address: string,
|
|
116
|
+
): Promise<LanguageMeta> {
|
|
117
|
+
const { languageMeta } = unwrapApolloResult(await this.#apolloClient.query({
|
|
118
|
+
query: gql`query languageMeta(
|
|
119
|
+
$address: String!,
|
|
120
|
+
) {
|
|
121
|
+
languageMeta(address: $address) {
|
|
122
|
+
${LANGUAGE_META}
|
|
123
|
+
}
|
|
124
|
+
}`,
|
|
125
|
+
variables: { address }
|
|
126
|
+
}))
|
|
127
|
+
|
|
128
|
+
return languageMeta
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
async source(
|
|
132
|
+
address: string,
|
|
133
|
+
): Promise<string> {
|
|
134
|
+
const { languageSource } = unwrapApolloResult(await this.#apolloClient.query({
|
|
135
|
+
query: gql`query languageSource(
|
|
136
|
+
$address: String!,
|
|
137
|
+
) {
|
|
138
|
+
languageSource(address: $address)
|
|
139
|
+
}`,
|
|
140
|
+
variables: { address }
|
|
141
|
+
}))
|
|
142
|
+
|
|
143
|
+
return languageSource
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
async remove(
|
|
147
|
+
address: string
|
|
148
|
+
): Promise<Boolean> {
|
|
149
|
+
const { languageRemove } = unwrapApolloResult(await this.#apolloClient.mutate({
|
|
150
|
+
mutation: gql`mutation languageRemove(
|
|
151
|
+
$address: String!,
|
|
152
|
+
) {
|
|
153
|
+
languageRemove(address: $address)
|
|
154
|
+
}`,
|
|
155
|
+
variables: { address }
|
|
156
|
+
}))
|
|
157
|
+
|
|
158
|
+
return languageRemove
|
|
159
|
+
}
|
|
160
160
|
}
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import type { AppSignalCb } from '@holochain/client'
|
|
2
|
-
import { Expression } from "../expression/Expression";
|
|
3
|
-
|
|
4
|
-
export interface AgentService {
|
|
5
|
-
readonly did: string
|
|
6
|
-
createSignedExpression(data: any): Expression
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export interface SignaturesService {
|
|
10
|
-
verify(expr: Expression): boolean
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface LanguageContext {
|
|
14
|
-
agent: AgentService;
|
|
15
|
-
signatures: SignaturesService;
|
|
16
|
-
storageDirectory: string;
|
|
17
|
-
customSettings: object;
|
|
18
|
-
Holochain: HolochainLanguageDelegate | undefined;
|
|
19
|
-
ad4mSignal: Ad4mSignalCB;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export class Dna {
|
|
23
|
-
file: Buffer
|
|
24
|
-
nick: string
|
|
25
|
-
zomeCalls: [string, string][]
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export interface HolochainLanguageDelegate {
|
|
29
|
-
/** Installs/registers a given DNA in the ad4m-executor */
|
|
30
|
-
registerDNAs(dnas: Dna[], holochainSignalCallback?: AppSignalCb): Promise<void>;
|
|
31
|
-
/** Makes a single call to a given holochain DNA. Underlying implementation puts these calls into a sync fifo queue */
|
|
32
|
-
call(dnaNick: string, zomeName: string, fnName: string, params: object|string): Promise<any>;
|
|
33
|
-
/** Makes all supplied calls in parallel to the provided holochain dna... Should only be called on read operations to avoid source chain async mutation errors */
|
|
34
|
-
callAsync(calls: {dnaNick: string, zomeName: string, fnName: string, params: object|string}[], timeoutMs?: number): Promise<any[]>;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export type Ad4mSignalCB = (signal: any) => void
|
|
1
|
+
import type { AppSignalCb } from '@holochain/client'
|
|
2
|
+
import { Expression } from "../expression/Expression";
|
|
3
|
+
|
|
4
|
+
export interface AgentService {
|
|
5
|
+
readonly did: string
|
|
6
|
+
createSignedExpression(data: any): Expression
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface SignaturesService {
|
|
10
|
+
verify(expr: Expression): boolean
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface LanguageContext {
|
|
14
|
+
agent: AgentService;
|
|
15
|
+
signatures: SignaturesService;
|
|
16
|
+
storageDirectory: string;
|
|
17
|
+
customSettings: object;
|
|
18
|
+
Holochain: HolochainLanguageDelegate | undefined;
|
|
19
|
+
ad4mSignal: Ad4mSignalCB;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export class Dna {
|
|
23
|
+
file: Buffer
|
|
24
|
+
nick: string
|
|
25
|
+
zomeCalls: [string, string][]
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface HolochainLanguageDelegate {
|
|
29
|
+
/** Installs/registers a given DNA in the ad4m-executor */
|
|
30
|
+
registerDNAs(dnas: Dna[], holochainSignalCallback?: AppSignalCb): Promise<void>;
|
|
31
|
+
/** Makes a single call to a given holochain DNA. Underlying implementation puts these calls into a sync fifo queue */
|
|
32
|
+
call(dnaNick: string, zomeName: string, fnName: string, params: object|string): Promise<any>;
|
|
33
|
+
/** Makes all supplied calls in parallel to the provided holochain dna... Should only be called on read operations to avoid source chain async mutation errors */
|
|
34
|
+
callAsync(calls: {dnaNick: string, zomeName: string, fnName: string, params: object|string}[], timeoutMs?: number): Promise<any[]>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export type Ad4mSignalCB = (signal: any) => void
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { Field, ObjectType } from "type-graphql";
|
|
2
|
-
import { Icon } from "./Icon";
|
|
3
|
-
|
|
4
|
-
@ObjectType()
|
|
5
|
-
export class LanguageHandle {
|
|
6
|
-
@Field()
|
|
7
|
-
name: string;
|
|
8
|
-
|
|
9
|
-
@Field()
|
|
10
|
-
address: string;
|
|
11
|
-
|
|
12
|
-
@Field({nullable: true})
|
|
13
|
-
settings?: string;
|
|
14
|
-
|
|
15
|
-
@Field({nullable: true})
|
|
16
|
-
icon?: Icon;
|
|
17
|
-
|
|
18
|
-
@Field({nullable: true})
|
|
19
|
-
constructorIcon?: Icon;
|
|
20
|
-
|
|
21
|
-
@Field({nullable: true})
|
|
22
|
-
settingsIcon?: Icon;
|
|
23
|
-
}
|
|
1
|
+
import { Field, ObjectType } from "type-graphql";
|
|
2
|
+
import { Icon } from "./Icon";
|
|
3
|
+
|
|
4
|
+
@ObjectType()
|
|
5
|
+
export class LanguageHandle {
|
|
6
|
+
@Field()
|
|
7
|
+
name: string;
|
|
8
|
+
|
|
9
|
+
@Field()
|
|
10
|
+
address: string;
|
|
11
|
+
|
|
12
|
+
@Field({nullable: true})
|
|
13
|
+
settings?: string;
|
|
14
|
+
|
|
15
|
+
@Field({nullable: true})
|
|
16
|
+
icon?: Icon;
|
|
17
|
+
|
|
18
|
+
@Field({nullable: true})
|
|
19
|
+
constructorIcon?: Icon;
|
|
20
|
+
|
|
21
|
+
@Field({nullable: true})
|
|
22
|
+
settingsIcon?: Icon;
|
|
23
|
+
}
|
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
import { Field, InputType, ObjectType } from "type-graphql";
|
|
2
|
-
import { ExpressionGeneric } from "../expression/Expression";
|
|
3
|
-
|
|
4
|
-
@ObjectType()
|
|
5
|
-
export class LanguageMeta {
|
|
6
|
-
@Field()
|
|
7
|
-
name: string;
|
|
8
|
-
|
|
9
|
-
@Field()
|
|
10
|
-
address: string;
|
|
11
|
-
|
|
12
|
-
@Field({nullable: true})
|
|
13
|
-
description: string;
|
|
14
|
-
|
|
15
|
-
@Field()
|
|
16
|
-
author: string;
|
|
17
|
-
|
|
18
|
-
@Field({nullable: true})
|
|
19
|
-
templated: boolean
|
|
20
|
-
|
|
21
|
-
@Field({nullable: true})
|
|
22
|
-
templateSourceLanguageAddress?: string;
|
|
23
|
-
|
|
24
|
-
@Field({nullable: true})
|
|
25
|
-
templateAppliedParams?: string;
|
|
26
|
-
|
|
27
|
-
@Field(type => [String], {nullable: true})
|
|
28
|
-
possibleTemplateParams?: string[];
|
|
29
|
-
|
|
30
|
-
@Field({nullable: true})
|
|
31
|
-
sourceCodeLink?: string;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
@InputType()
|
|
35
|
-
export class LanguageMetaInput {
|
|
36
|
-
@Field()
|
|
37
|
-
name: string;
|
|
38
|
-
|
|
39
|
-
@Field()
|
|
40
|
-
description: string;
|
|
41
|
-
|
|
42
|
-
@Field(type => [String], {nullable: true})
|
|
43
|
-
possibleTemplateParams?: string[];
|
|
44
|
-
|
|
45
|
-
@Field({nullable: true})
|
|
46
|
-
sourceCodeLink?: string;
|
|
47
|
-
|
|
48
|
-
constructor(name?: string, description?: string) {
|
|
49
|
-
this.name = name
|
|
50
|
-
this.description = description
|
|
51
|
-
if(!this.description) this.description = ""
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export class LanguageMetaInternal {
|
|
56
|
-
name: string;
|
|
57
|
-
address: string;
|
|
58
|
-
description: string;
|
|
59
|
-
templateSourceLanguageAddress?: string;
|
|
60
|
-
templateAppliedParams?: string;
|
|
61
|
-
possibleTemplateParams?: string[];
|
|
62
|
-
sourceCodeLink?: string;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export class LanguageExpression extends ExpressionGeneric(LanguageMetaInternal) {};
|
|
66
|
-
|
|
67
|
-
export class LanguageLanguageInput {
|
|
68
|
-
bundle: string;
|
|
69
|
-
meta: LanguageMetaInternal;
|
|
1
|
+
import { Field, InputType, ObjectType } from "type-graphql";
|
|
2
|
+
import { ExpressionGeneric } from "../expression/Expression";
|
|
3
|
+
|
|
4
|
+
@ObjectType()
|
|
5
|
+
export class LanguageMeta {
|
|
6
|
+
@Field()
|
|
7
|
+
name: string;
|
|
8
|
+
|
|
9
|
+
@Field()
|
|
10
|
+
address: string;
|
|
11
|
+
|
|
12
|
+
@Field({nullable: true})
|
|
13
|
+
description: string;
|
|
14
|
+
|
|
15
|
+
@Field()
|
|
16
|
+
author: string;
|
|
17
|
+
|
|
18
|
+
@Field({nullable: true})
|
|
19
|
+
templated: boolean
|
|
20
|
+
|
|
21
|
+
@Field({nullable: true})
|
|
22
|
+
templateSourceLanguageAddress?: string;
|
|
23
|
+
|
|
24
|
+
@Field({nullable: true})
|
|
25
|
+
templateAppliedParams?: string;
|
|
26
|
+
|
|
27
|
+
@Field(type => [String], {nullable: true})
|
|
28
|
+
possibleTemplateParams?: string[];
|
|
29
|
+
|
|
30
|
+
@Field({nullable: true})
|
|
31
|
+
sourceCodeLink?: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@InputType()
|
|
35
|
+
export class LanguageMetaInput {
|
|
36
|
+
@Field()
|
|
37
|
+
name: string;
|
|
38
|
+
|
|
39
|
+
@Field()
|
|
40
|
+
description: string;
|
|
41
|
+
|
|
42
|
+
@Field(type => [String], {nullable: true})
|
|
43
|
+
possibleTemplateParams?: string[];
|
|
44
|
+
|
|
45
|
+
@Field({nullable: true})
|
|
46
|
+
sourceCodeLink?: string;
|
|
47
|
+
|
|
48
|
+
constructor(name?: string, description?: string) {
|
|
49
|
+
this.name = name
|
|
50
|
+
this.description = description
|
|
51
|
+
if(!this.description) this.description = ""
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export class LanguageMetaInternal {
|
|
56
|
+
name: string;
|
|
57
|
+
address: string;
|
|
58
|
+
description: string;
|
|
59
|
+
templateSourceLanguageAddress?: string;
|
|
60
|
+
templateAppliedParams?: string;
|
|
61
|
+
possibleTemplateParams?: string[];
|
|
62
|
+
sourceCodeLink?: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export class LanguageExpression extends ExpressionGeneric(LanguageMetaInternal) {};
|
|
66
|
+
|
|
67
|
+
export class LanguageLanguageInput {
|
|
68
|
+
bundle: string;
|
|
69
|
+
meta: LanguageMetaInternal;
|
|
70
70
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import type { Address } from '../Address'
|
|
2
|
-
import { Field, ObjectType } from "type-graphql";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
// Unique Language ID with option type
|
|
6
|
-
@ObjectType()
|
|
7
|
-
export class LanguageRef {
|
|
8
|
-
@Field()
|
|
9
|
-
address: Address;
|
|
10
|
-
|
|
11
|
-
@Field()
|
|
12
|
-
name: string;
|
|
13
|
-
|
|
14
|
-
constructor(address?: Address, name?: string) {
|
|
15
|
-
this.address = address
|
|
16
|
-
this.name = name
|
|
17
|
-
}
|
|
18
|
-
}
|
|
1
|
+
import type { Address } from '../Address'
|
|
2
|
+
import { Field, ObjectType } from "type-graphql";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
// Unique Language ID with option type
|
|
6
|
+
@ObjectType()
|
|
7
|
+
export class LanguageRef {
|
|
8
|
+
@Field()
|
|
9
|
+
address: Address;
|
|
10
|
+
|
|
11
|
+
@Field()
|
|
12
|
+
name: string;
|
|
13
|
+
|
|
14
|
+
constructor(address?: Address, name?: string) {
|
|
15
|
+
this.address = address
|
|
16
|
+
this.name = name
|
|
17
|
+
}
|
|
18
|
+
}
|