@coasys/ad4m 0.12.0-rc1-dev.4 → 0.12.0-rc2
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/lib/index.cjs +5052 -4446
- package/lib/index.js +5019 -4442
- package/lib/src/agent/AgentClient.d.ts +4 -0
- package/lib/src/agent/AgentClient.js +34 -0
- package/lib/src/index.d.ts +2 -3
- package/lib/src/index.js +2 -3
- package/lib/src/model/Ad4mModel.d.ts +8 -782
- package/lib/src/model/Ad4mModel.js +160 -2354
- package/lib/src/model/ModelQueryBuilder.d.ts +370 -0
- package/lib/src/model/ModelQueryBuilder.js +556 -0
- package/lib/src/model/decorators.d.ts +71 -23
- package/lib/src/model/decorators.js +133 -384
- package/lib/src/model/hydration.d.ts +102 -0
- package/lib/src/model/hydration.js +709 -0
- package/lib/src/model/index.d.ts +20 -0
- package/lib/src/model/index.js +20 -0
- package/lib/src/model/{schema/fromJSONSchema.d.ts → json-schema.d.ts} +45 -12
- package/lib/src/model/json-schema.js +326 -0
- package/lib/src/model/prolog-facts.d.ts +37 -0
- package/lib/src/model/{prolog/generatePrologFacts.js → prolog-facts.js} +47 -52
- package/lib/src/model/query-common.d.ts +14 -0
- package/lib/src/model/query-common.js +36 -0
- package/lib/src/model/query-prolog.d.ts +15 -0
- package/lib/src/model/query-prolog.js +140 -0
- package/lib/src/model/query-surreal.d.ts +44 -0
- package/lib/src/model/query-surreal.js +249 -0
- package/lib/src/model/relation-filtering.test.js +838 -0
- package/lib/src/model/sdna.d.ts +14 -0
- package/lib/src/model/sdna.js +141 -0
- package/lib/src/model/shacl-gen.d.ts +31 -0
- package/lib/src/model/shacl-gen.js +246 -0
- package/lib/src/model/surreal-utils.d.ts +42 -0
- package/lib/src/model/surreal-utils.js +128 -0
- package/lib/src/model/types.d.ts +75 -96
- package/lib/src/model/types.js +4 -4
- package/lib/src/model/util.d.ts +4 -5
- package/lib/src/model/util.js +12 -32
- package/lib/src/perspectives/PerspectiveClient.d.ts +1 -1
- package/lib/src/perspectives/PerspectiveProxy.d.ts +1 -1
- package/lib/src/perspectives/WakerSubscriptionManager.d.ts +79 -0
- package/lib/src/perspectives/WakerSubscriptionManager.js +196 -0
- package/lib/src/runtime/RuntimeResolver.d.ts +14 -0
- package/lib/src/runtime/RuntimeResolver.js +73 -0
- package/lib/src/schema.gql +14 -0
- package/lib/src/shacl/SHACLShape.d.ts +23 -0
- package/lib/src/shacl/SHACLShape.js +45 -0
- package/lib/src/typeDefs.js +14 -0
- package/package.json +13 -8
- package/src/agent/AgentClient.ts +45 -0
- package/src/index.ts +2 -3
- package/src/model/Ad4mModel.ts +1089 -3686
- package/src/model/ModelQueryBuilder.ts +617 -0
- package/src/model/Subject.ts +1 -1
- package/src/model/decorators.ts +218 -453
- package/src/model/hydration.ts +796 -0
- package/src/model/index.ts +21 -0
- package/src/model/json-schema.ts +424 -0
- package/src/model/prolog-facts.ts +145 -0
- package/src/model/query-common.ts +48 -0
- package/src/model/query-prolog.ts +148 -0
- package/src/model/query-surreal.ts +280 -0
- package/src/model/relation-filtering.test.ts +803 -0
- package/src/model/sdna.ts +170 -0
- package/src/model/shacl-gen.ts +292 -0
- package/src/model/surreal-utils.ts +147 -0
- package/src/model/types.ts +182 -0
- package/src/model/util.ts +13 -36
- package/src/perspectives/PerspectiveClient.ts +1 -1
- package/src/perspectives/PerspectiveProxy.ts +1 -1
- package/src/perspectives/WakerSubscriptionManager.ts +292 -0
- package/src/runtime/RuntimeResolver.ts +53 -0
- package/src/shacl/SHACLShape.ts +83 -0
- package/lib/src/Ad4mClient.test.js +0 -1204
- package/lib/src/Literal.test.d.ts +0 -1
- package/lib/src/Literal.test.js +0 -41
- package/lib/src/model/mutation.d.ts +0 -81
- package/lib/src/model/mutation.js +0 -317
- package/lib/src/model/parentUtils.d.ts +0 -32
- package/lib/src/model/parentUtils.js +0 -64
- package/lib/src/model/prolog/generatePrologFacts.d.ts +0 -36
- package/lib/src/model/prolog/index.d.ts +0 -1
- package/lib/src/model/prolog/index.js +0 -1
- package/lib/src/model/query/ModelQueryBuilder.d.ts +0 -82
- package/lib/src/model/query/ModelQueryBuilder.js +0 -115
- package/lib/src/model/query/QueryBuilder.d.ts +0 -101
- package/lib/src/model/query/QueryBuilder.js +0 -193
- package/lib/src/model/query/SurrealQueryBuilder.d.ts +0 -48
- package/lib/src/model/query/SurrealQueryBuilder.js +0 -371
- package/lib/src/model/query/fetchInstance.d.ts +0 -24
- package/lib/src/model/query/fetchInstance.js +0 -144
- package/lib/src/model/query/hydration.d.ts +0 -54
- package/lib/src/model/query/hydration.js +0 -214
- package/lib/src/model/query/operations.d.ts +0 -59
- package/lib/src/model/query/operations.js +0 -384
- package/lib/src/model/query/snapshot.d.ts +0 -59
- package/lib/src/model/query/snapshot.js +0 -106
- package/lib/src/model/query/surrealCompiler.d.ts +0 -42
- package/lib/src/model/query/surrealCompiler.js +0 -304
- package/lib/src/model/schema/fromJSONSchema.js +0 -264
- package/lib/src/model/schema/metadata.d.ts +0 -15
- package/lib/src/model/schema/metadata.js +0 -112
- package/lib/src/model/subscription.d.ts +0 -47
- package/lib/src/model/subscription.js +0 -231
- package/lib/src/model/transaction.d.ts +0 -27
- package/lib/src/model/transaction.js +0 -32
- package/lib/src/shims/reflect-metadata.d.ts +0 -0
- package/lib/src/shims/type-graphql.d.ts +0 -32
- package/lib/src/src/Ad4mClient.d.ts +0 -28
- package/lib/src/src/Address.d.ts +0 -1
- package/lib/src/src/DID.d.ts +0 -1
- package/lib/src/src/Exception.d.ts +0 -7
- package/lib/src/src/Literal.d.ts +0 -7
- package/lib/src/src/PubSub.d.ts +0 -17
- package/lib/src/src/SmartLiteral.d.ts +0 -12
- package/lib/src/src/agent/Agent.d.ts +0 -110
- package/lib/src/src/agent/AgentClient.d.ts +0 -62
- package/lib/src/src/agent/AgentResolver.d.ts +0 -30
- package/lib/src/src/agent/AgentStatus.d.ts +0 -8
- package/lib/src/src/ai/AIClient.d.ts +0 -32
- package/lib/src/src/ai/AIResolver.d.ts +0 -75
- package/lib/src/src/ai/Tasks.d.ts +0 -37
- package/lib/src/src/buildSchema.d.ts +0 -1
- package/lib/src/src/expression/Expression.d.ts +0 -28
- package/lib/src/src/expression/ExpressionClient.d.ts +0 -13
- package/lib/src/src/expression/ExpressionRef.d.ts +0 -9
- package/lib/src/src/expression/ExpressionResolver.d.ts +0 -10
- package/lib/src/src/index.d.ts +0 -35
- package/lib/src/src/jestSetup.d.ts +0 -1
- package/lib/src/src/language/Icon.d.ts +0 -4
- package/lib/src/src/language/Language.d.ts +0 -206
- package/lib/src/src/language/LanguageClient.d.ts +0 -17
- package/lib/src/src/language/LanguageContext.d.ts +0 -37
- package/lib/src/src/language/LanguageHandle.d.ts +0 -9
- package/lib/src/src/language/LanguageMeta.d.ts +0 -35
- package/lib/src/src/language/LanguageRef.d.ts +0 -6
- package/lib/src/src/language/LanguageResolver.d.ts +0 -19
- package/lib/src/src/links/Links.d.ts +0 -39
- package/lib/src/src/links/Links.test.d.ts +0 -1
- package/lib/src/src/model/Ad4mModel.d.ts +0 -1438
- package/lib/src/src/model/Ad4mModel.test.d.ts +0 -1
- package/lib/src/src/model/Subject.d.ts +0 -25
- package/lib/src/src/model/decorators.d.ts +0 -545
- package/lib/src/src/model/util.d.ts +0 -12
- package/lib/src/src/neighbourhood/Neighbourhood.d.ts +0 -10
- package/lib/src/src/neighbourhood/NeighbourhoodClient.d.ts +0 -25
- package/lib/src/src/neighbourhood/NeighbourhoodProxy.d.ts +0 -19
- package/lib/src/src/neighbourhood/NeighbourhoodProxy.test.d.ts +0 -1
- package/lib/src/src/neighbourhood/NeighbourhoodResolver.d.ts +0 -24
- package/lib/src/src/perspectives/LinkQuery.d.ts +0 -11
- package/lib/src/src/perspectives/Perspective.d.ts +0 -38
- package/lib/src/src/perspectives/Perspective.test.d.ts +0 -1
- package/lib/src/src/perspectives/PerspectiveClient.d.ts +0 -97
- package/lib/src/src/perspectives/PerspectiveDiff.d.ts +0 -9
- package/lib/src/src/perspectives/PerspectiveHandle.d.ts +0 -18
- package/lib/src/src/perspectives/PerspectiveProxy.d.ts +0 -865
- package/lib/src/src/perspectives/PerspectiveResolver.d.ts +0 -57
- package/lib/src/src/runtime/RuntimeClient.d.ts +0 -56
- package/lib/src/src/runtime/RuntimeResolver.d.ts +0 -132
- package/lib/src/src/shacl/SHACLFlow.d.ts +0 -171
- package/lib/src/src/shacl/SHACLFlow.test.d.ts +0 -1
- package/lib/src/src/shacl/SHACLShape.d.ts +0 -117
- package/lib/src/src/shacl/SHACLShape.test.d.ts +0 -1
- package/lib/src/src/typeDefs.d.ts +0 -1
- package/lib/src/src/unwrapApolloResult.d.ts +0 -2
- package/lib/src/src/utils.d.ts +0 -25
- /package/lib/src/{Ad4mClient.test.d.ts → model/relation-filtering.test.d.ts} +0 -0
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
import type { Address } from '../Address';
|
|
2
|
-
import { DID } from '../DID';
|
|
3
|
-
import type { Expression } from '../expression/Expression';
|
|
4
|
-
import { Perspective, PerspectiveExpression } from '../perspectives/Perspective';
|
|
5
|
-
import { PerspectiveDiff } from '../perspectives/PerspectiveDiff';
|
|
6
|
-
import { PerspectiveState } from '../perspectives/PerspectiveHandle';
|
|
7
|
-
/** Interface of AD4M Languages
|
|
8
|
-
*
|
|
9
|
-
* Any JavaScript module that implements a create() function that returns an object that implements this interface
|
|
10
|
-
* is a valid AD4M language.
|
|
11
|
-
* So the AD4M-internal representation of a language is an object that implements this interface.
|
|
12
|
-
*
|
|
13
|
-
* Since there are a few different kinds of languages, this interface is split into optional sub-interfaces.
|
|
14
|
-
* The only required property is the name of the language.
|
|
15
|
-
*
|
|
16
|
-
* The most usual kind of language is the "Expression Language", which is a language that can be used to create
|
|
17
|
-
* and share Expressions.
|
|
18
|
-
* For that, implement the expressionsAdapter and expressionUI interface.
|
|
19
|
-
*
|
|
20
|
-
* The second most common kind of language is the "Link Language", which is a language that builds the core
|
|
21
|
-
* of AD4M Neighbourhoods.
|
|
22
|
-
* For that, implement the linksAdapter interface.
|
|
23
|
-
*/
|
|
24
|
-
export interface Language {
|
|
25
|
-
readonly name: string;
|
|
26
|
-
/** Flagging expressions as immutable to enable
|
|
27
|
-
* expression caching in the ad4m-executor
|
|
28
|
-
*/
|
|
29
|
-
isImmutableExpression?(expression: Address): boolean;
|
|
30
|
-
/** ExpressionAdapter implements means of getting an Expression
|
|
31
|
-
* by address and putting an expression
|
|
32
|
-
*/
|
|
33
|
-
readonly expressionAdapter?: ExpressionAdapter;
|
|
34
|
-
/** Interface for getting UI/web components for rendering Expressions of this Language */
|
|
35
|
-
readonly expressionUI?: ExpressionUI;
|
|
36
|
-
/** Interface of LinkLanguages for the core implementation of Neighbourhoods */
|
|
37
|
-
readonly linksAdapter?: LinkSyncAdapter;
|
|
38
|
-
/** Additional Interface of LinkLanguages that support telepresence features,
|
|
39
|
-
* that is:
|
|
40
|
-
* - seeing who is online and getting a status
|
|
41
|
-
* - sending/receiveing p2p signals to other online agents without affecting
|
|
42
|
-
* the shared Perspective of the Neighbourhood
|
|
43
|
-
* (see TelepresenceAdapter for more details)
|
|
44
|
-
*/
|
|
45
|
-
readonly telepresenceAdapter?: TelepresenceAdapter;
|
|
46
|
-
/** Implementation of a Language that defines and stores Languages*/
|
|
47
|
-
readonly languageAdapter?: LanguageAdapter;
|
|
48
|
-
/** Optional adapter for getting Expressions by author */
|
|
49
|
-
readonly getByAuthorAdapter?: GetByAuthorAdapter;
|
|
50
|
-
/** Optional adapter for getting all Expressions */
|
|
51
|
-
readonly getAllAdapter?: GetAllAdapter;
|
|
52
|
-
/** Optional adapter for direct messaging between agents */
|
|
53
|
-
readonly directMessageAdapter?: DirectMessageAdapter;
|
|
54
|
-
/** Interface for providing UI components for the settings of this Language */
|
|
55
|
-
readonly settingsUI?: SettingsUI;
|
|
56
|
-
/** Optional function to make any cleanup/teardown if your language gets deleting in the ad4m-executor */
|
|
57
|
-
readonly teardown?: () => void;
|
|
58
|
-
/** All available interactions this agent could execute on given expression */
|
|
59
|
-
interactions(expression: Address): Interaction[];
|
|
60
|
-
}
|
|
61
|
-
/** UI factories returning web components */
|
|
62
|
-
export interface ExpressionUI {
|
|
63
|
-
/** Returns JS code of a web component that renders the given expression */
|
|
64
|
-
icon(): string;
|
|
65
|
-
/** Returns JS code of a web component used to create new expressions */
|
|
66
|
-
constructorIcon(): string;
|
|
67
|
-
}
|
|
68
|
-
export interface SettingsUI {
|
|
69
|
-
settingsIcon(): string;
|
|
70
|
-
}
|
|
71
|
-
/** Interface for the most common Expression Languages */
|
|
72
|
-
export interface ExpressionAdapter {
|
|
73
|
-
/** Returns an Expression by address, or null if there is no Expression
|
|
74
|
-
* with that given address
|
|
75
|
-
*/
|
|
76
|
-
get(address: Address): Promise<Expression | null>;
|
|
77
|
-
/** Strategy for putting an expression with needs to be different
|
|
78
|
-
* for those two cases:
|
|
79
|
-
* 1. PublicSharing means that this language supports the creation
|
|
80
|
-
* and sharing of Expressions, which is the common use-case
|
|
81
|
-
* 2. ReadOnlyLanguage means that the Language implements a pre-defined
|
|
82
|
-
* set of expressions (which can be infinite or finite).
|
|
83
|
-
* For example the url-iframe Language which directly maps URLs to
|
|
84
|
-
* addresses - meaning every well formed URL is an address in this
|
|
85
|
-
* Language. Or a potential Language implementing the verbs/predicates
|
|
86
|
-
* of a spec like FOAF.
|
|
87
|
-
*/
|
|
88
|
-
putAdapter: PublicSharing | ReadOnlyLanguage;
|
|
89
|
-
}
|
|
90
|
-
/** Implement this interface if your Language supports creation of sharing
|
|
91
|
-
* of Expressions.
|
|
92
|
-
* See ExpressionAdapter
|
|
93
|
-
*/
|
|
94
|
-
export interface PublicSharing {
|
|
95
|
-
/** Create an Expression and shares it.
|
|
96
|
-
* Return the Expression's address.
|
|
97
|
-
* @param content is the object created by the constructorIcon component
|
|
98
|
-
*/
|
|
99
|
-
createPublic(content: object): Promise<Address>;
|
|
100
|
-
}
|
|
101
|
-
/** Implement this interface if your Language is defined over a static
|
|
102
|
-
* set of pre-defined Expressions.
|
|
103
|
-
*/
|
|
104
|
-
export interface ReadOnlyLanguage {
|
|
105
|
-
/** This just calculates the address of an object
|
|
106
|
-
* @param content is the object created by the constructorIcon component
|
|
107
|
-
*/
|
|
108
|
-
addressOf(content: object): Promise<Address>;
|
|
109
|
-
}
|
|
110
|
-
export interface LanguageAdapter {
|
|
111
|
-
getLanguageSource(address: Address): Promise<string>;
|
|
112
|
-
}
|
|
113
|
-
export interface GetByAuthorAdapter {
|
|
114
|
-
getByAuthor(author: DID, count: number, page: number): Promise<Expression[] | null>;
|
|
115
|
-
}
|
|
116
|
-
export interface GetAllAdapter {
|
|
117
|
-
getAll(filter: any, count: number, page: number): Promise<Expression[] | null>;
|
|
118
|
-
}
|
|
119
|
-
export type PerspectiveDiffObserver = (diff: PerspectiveDiff) => void;
|
|
120
|
-
export type SyncStateChangeObserver = (state: PerspectiveState) => void;
|
|
121
|
-
/** Interface for "Link Languages" that facilitate the synchronization
|
|
122
|
-
* between agents' local Perspectives inside a Neighbourhood.
|
|
123
|
-
* The assumption is that every version of the shared Perspective
|
|
124
|
-
* is labeled with a unique revision string.
|
|
125
|
-
* Changes are committed and retrieved through diffs.
|
|
126
|
-
* Think of a LinkSyncAdapter as a git branch to which agents commit
|
|
127
|
-
* their changes to and pull diffs from their current revision
|
|
128
|
-
* to the latest one.
|
|
129
|
-
*/
|
|
130
|
-
export interface LinkSyncAdapter {
|
|
131
|
-
writable(): boolean;
|
|
132
|
-
public(): boolean;
|
|
133
|
-
others(): Promise<DID[]>;
|
|
134
|
-
/** What revision are we on now -> what changes are included in output of render() */
|
|
135
|
-
currentRevision(): Promise<string>;
|
|
136
|
-
/**
|
|
137
|
-
* Check for and get new changes,
|
|
138
|
-
* notify others of local changes.
|
|
139
|
-
* This function will be called every
|
|
140
|
-
* few seconds by the ad4m-executor.
|
|
141
|
-
* */
|
|
142
|
-
sync(): Promise<PerspectiveDiff>;
|
|
143
|
-
/** Returns the full, rendered Perspective at currentRevision */
|
|
144
|
-
render(): Promise<Perspective>;
|
|
145
|
-
/** Publish changes */
|
|
146
|
-
commit(diff: PerspectiveDiff): Promise<string>;
|
|
147
|
-
/** Get push notification when a diff got published */
|
|
148
|
-
addCallback(callback: PerspectiveDiffObserver): any;
|
|
149
|
-
/** Add a sync state callback method */
|
|
150
|
-
addSyncStateChangeCallback(callback: SyncStateChangeObserver): any;
|
|
151
|
-
/**
|
|
152
|
-
* Set the local agents (DIDs) that own this perspective/neighbourhood.
|
|
153
|
-
* This is used to determine which agents should be registered in the DHT.
|
|
154
|
-
* Optional - if not implemented, all local agents may be registered.
|
|
155
|
-
*
|
|
156
|
-
* This is a temporary hack to support multiple users on one node joining the same neighbourhood.
|
|
157
|
-
* Once we migrate the LanguageController to Rust and run Languages per user, each user will get their
|
|
158
|
-
* own language instance and we won't need to explicitly set local agents. This will provide better
|
|
159
|
-
* isolation and avoid the need to share language state between users.
|
|
160
|
-
*/
|
|
161
|
-
setLocalAgents?(agents: DID[]): void;
|
|
162
|
-
}
|
|
163
|
-
export type MessageCallback = (message: PerspectiveExpression) => void;
|
|
164
|
-
export type StatusCallback = (caller: DID) => Perspective;
|
|
165
|
-
export interface DirectMessageAdapter {
|
|
166
|
-
recipient(): DID;
|
|
167
|
-
status(): Promise<PerspectiveExpression | void>;
|
|
168
|
-
sendP2P(message: Perspective): Promise<PerspectiveExpression | void>;
|
|
169
|
-
sendInbox(message: Perspective): Promise<PerspectiveExpression | void>;
|
|
170
|
-
setStatus(status: PerspectiveExpression): any;
|
|
171
|
-
inbox(filter?: string): Promise<PerspectiveExpression[]>;
|
|
172
|
-
addMessageCallback(callback: MessageCallback): any;
|
|
173
|
-
}
|
|
174
|
-
export declare class InteractionParameter {
|
|
175
|
-
name: string;
|
|
176
|
-
type: string;
|
|
177
|
-
}
|
|
178
|
-
export declare class InteractionMeta {
|
|
179
|
-
label: string;
|
|
180
|
-
name: string;
|
|
181
|
-
parameters: InteractionParameter[];
|
|
182
|
-
}
|
|
183
|
-
export interface Interaction {
|
|
184
|
-
readonly label: string;
|
|
185
|
-
readonly name: string;
|
|
186
|
-
readonly parameters: InteractionParameter[];
|
|
187
|
-
execute(parameters: object): Promise<string | null>;
|
|
188
|
-
}
|
|
189
|
-
export declare class InteractionCall {
|
|
190
|
-
name: string;
|
|
191
|
-
parametersStringified: string;
|
|
192
|
-
get parameters(): object;
|
|
193
|
-
constructor(name: string, parameters: object);
|
|
194
|
-
}
|
|
195
|
-
export declare class OnlineAgent {
|
|
196
|
-
did: DID;
|
|
197
|
-
status: PerspectiveExpression;
|
|
198
|
-
}
|
|
199
|
-
export type TelepresenceSignalCallback = (payload: PerspectiveExpression, recipientDid?: string) => void;
|
|
200
|
-
export interface TelepresenceAdapter {
|
|
201
|
-
setOnlineStatus(status: PerspectiveExpression): Promise<void>;
|
|
202
|
-
getOnlineAgents(): Promise<OnlineAgent[]>;
|
|
203
|
-
sendSignal(remoteAgentDid: string, payload: PerspectiveExpression): Promise<object>;
|
|
204
|
-
sendBroadcast(payload: PerspectiveExpression): Promise<object>;
|
|
205
|
-
registerSignalCallback(callback: TelepresenceSignalCallback): Promise<void>;
|
|
206
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ApolloClient } from "@apollo/client/core";
|
|
2
|
-
import { LanguageHandle } from "./LanguageHandle";
|
|
3
|
-
import { LanguageMeta, LanguageMetaInput } from "./LanguageMeta";
|
|
4
|
-
import { LanguageRef } from "./LanguageRef";
|
|
5
|
-
export declare class LanguageClient {
|
|
6
|
-
#private;
|
|
7
|
-
constructor(apolloClient: ApolloClient<any>);
|
|
8
|
-
byAddress(address: string): Promise<LanguageHandle>;
|
|
9
|
-
byFilter(filter: string): Promise<LanguageHandle[]>;
|
|
10
|
-
all(): Promise<LanguageHandle[]>;
|
|
11
|
-
writeSettings(languageAddress: string, settings: string): Promise<Boolean>;
|
|
12
|
-
applyTemplateAndPublish(sourceLanguageHash: string, templateData: string): Promise<LanguageRef>;
|
|
13
|
-
publish(languagePath: string, languageMeta: LanguageMetaInput): Promise<LanguageMeta>;
|
|
14
|
-
meta(address: string): Promise<LanguageMeta>;
|
|
15
|
-
source(address: string): Promise<string>;
|
|
16
|
-
remove(address: string): Promise<Boolean>;
|
|
17
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import type { AppSignalCb } from '@holochain/client';
|
|
3
|
-
import { Expression } from "../expression/Expression";
|
|
4
|
-
export interface AgentService {
|
|
5
|
-
readonly did: string;
|
|
6
|
-
createSignedExpression(data: any): Expression;
|
|
7
|
-
}
|
|
8
|
-
export interface SignaturesService {
|
|
9
|
-
verify(expr: Expression): boolean;
|
|
10
|
-
}
|
|
11
|
-
export interface LanguageContext {
|
|
12
|
-
agent: AgentService;
|
|
13
|
-
signatures: SignaturesService;
|
|
14
|
-
storageDirectory: string;
|
|
15
|
-
customSettings: object;
|
|
16
|
-
Holochain: HolochainLanguageDelegate | undefined;
|
|
17
|
-
ad4mSignal: Ad4mSignalCB;
|
|
18
|
-
}
|
|
19
|
-
export declare class Dna {
|
|
20
|
-
file: Buffer;
|
|
21
|
-
nick: string;
|
|
22
|
-
zomeCalls: [string, string][];
|
|
23
|
-
}
|
|
24
|
-
export interface HolochainLanguageDelegate {
|
|
25
|
-
/** Installs/registers a given DNA in the ad4m-executor */
|
|
26
|
-
registerDNAs(dnas: Dna[], holochainSignalCallback?: AppSignalCb): Promise<void>;
|
|
27
|
-
/** Makes a single call to a given holochain DNA. Underlying implementation puts these calls into a sync fifo queue */
|
|
28
|
-
call(dnaNick: string, zomeName: string, fnName: string, params: object | string): Promise<any>;
|
|
29
|
-
/** 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 */
|
|
30
|
-
callAsync(calls: {
|
|
31
|
-
dnaNick: string;
|
|
32
|
-
zomeName: string;
|
|
33
|
-
fnName: string;
|
|
34
|
-
params: object | string;
|
|
35
|
-
}[], timeoutMs?: number): Promise<any[]>;
|
|
36
|
-
}
|
|
37
|
-
export type Ad4mSignalCB = (signal: any) => void;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
export declare class LanguageMeta {
|
|
2
|
-
name: string;
|
|
3
|
-
address: string;
|
|
4
|
-
description: string;
|
|
5
|
-
author: string;
|
|
6
|
-
templated: boolean;
|
|
7
|
-
templateSourceLanguageAddress?: string;
|
|
8
|
-
templateAppliedParams?: string;
|
|
9
|
-
possibleTemplateParams?: string[];
|
|
10
|
-
sourceCodeLink?: string;
|
|
11
|
-
}
|
|
12
|
-
export declare class LanguageMetaInput {
|
|
13
|
-
name: string;
|
|
14
|
-
description: string;
|
|
15
|
-
possibleTemplateParams?: string[];
|
|
16
|
-
sourceCodeLink?: string;
|
|
17
|
-
constructor(name?: string, description?: string);
|
|
18
|
-
}
|
|
19
|
-
export declare class LanguageMetaInternal {
|
|
20
|
-
name: string;
|
|
21
|
-
address: string;
|
|
22
|
-
description: string;
|
|
23
|
-
templateSourceLanguageAddress?: string;
|
|
24
|
-
templateAppliedParams?: string;
|
|
25
|
-
possibleTemplateParams?: string[];
|
|
26
|
-
sourceCodeLink?: string;
|
|
27
|
-
}
|
|
28
|
-
declare const LanguageExpression_base: any;
|
|
29
|
-
export declare class LanguageExpression extends LanguageExpression_base {
|
|
30
|
-
}
|
|
31
|
-
export declare class LanguageLanguageInput {
|
|
32
|
-
bundle: string;
|
|
33
|
-
meta: LanguageMetaInternal;
|
|
34
|
-
}
|
|
35
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { LanguageHandle } from "./LanguageHandle";
|
|
2
|
-
import { LanguageMeta, LanguageMetaInput } from "./LanguageMeta";
|
|
3
|
-
import { LanguageRef } from "./LanguageRef";
|
|
4
|
-
/**
|
|
5
|
-
* Resolver classes are used here to define the GraphQL schema
|
|
6
|
-
* (through the type-graphql annotations)
|
|
7
|
-
* and are spawned in the client tests in Ad4mClient.test.ts.
|
|
8
|
-
* For the latter, they return test fixtures.
|
|
9
|
-
*/
|
|
10
|
-
export default class LanguageResolver {
|
|
11
|
-
language(address: string): LanguageHandle;
|
|
12
|
-
languages(filter: string): LanguageHandle[];
|
|
13
|
-
languageWriteSettings(languageAddress: string, settings: string): Boolean;
|
|
14
|
-
languageApplyTemplateAndPublish(sourceLanguageHash: string, templateData: string): LanguageRef;
|
|
15
|
-
languagePublish(languagePath: string, languageMeta: LanguageMetaInput): LanguageMeta;
|
|
16
|
-
languageMeta(address: string): LanguageMeta;
|
|
17
|
-
languageSource(address: string): string;
|
|
18
|
-
languageRemove(address: string): Boolean;
|
|
19
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { LinkStatus } from "../perspectives/PerspectiveProxy";
|
|
2
|
-
export declare class Link {
|
|
3
|
-
source: string;
|
|
4
|
-
target: string;
|
|
5
|
-
predicate?: string;
|
|
6
|
-
constructor(obj: any);
|
|
7
|
-
}
|
|
8
|
-
export declare class LinkMutations {
|
|
9
|
-
additions: LinkInput[];
|
|
10
|
-
removals: LinkExpressionInput[];
|
|
11
|
-
}
|
|
12
|
-
export declare class LinkExpressionMutations {
|
|
13
|
-
additions: LinkExpression[];
|
|
14
|
-
removals: LinkExpression[];
|
|
15
|
-
constructor(additions: LinkExpression[], removals: LinkExpression[]);
|
|
16
|
-
}
|
|
17
|
-
export declare class LinkInput {
|
|
18
|
-
source: string;
|
|
19
|
-
target: string;
|
|
20
|
-
predicate?: string;
|
|
21
|
-
}
|
|
22
|
-
declare const LinkExpression_base: any;
|
|
23
|
-
export declare class LinkExpression extends LinkExpression_base {
|
|
24
|
-
hash(): number;
|
|
25
|
-
status?: LinkStatus;
|
|
26
|
-
}
|
|
27
|
-
declare const LinkExpressionInput_base: any;
|
|
28
|
-
export declare class LinkExpressionInput extends LinkExpressionInput_base {
|
|
29
|
-
hash: () => number;
|
|
30
|
-
status?: LinkStatus;
|
|
31
|
-
}
|
|
32
|
-
export declare function linkEqual(l1: LinkExpression, l2: LinkExpression): boolean;
|
|
33
|
-
export declare function isLink(l: any): boolean;
|
|
34
|
-
export declare class LinkExpressionUpdated {
|
|
35
|
-
oldLink: LinkExpression;
|
|
36
|
-
newLink: LinkExpression;
|
|
37
|
-
constructor(oldLink: LinkExpression, newLink: LinkExpression);
|
|
38
|
-
}
|
|
39
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|