@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,39 +1,54 @@
|
|
|
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 _NeighbourhoodProxy_client, _NeighbourhoodProxy_pID;
|
|
1
13
|
export class NeighbourhoodProxy {
|
|
2
14
|
constructor(client, pID) {
|
|
3
|
-
this
|
|
4
|
-
this
|
|
15
|
+
_NeighbourhoodProxy_client.set(this, void 0);
|
|
16
|
+
_NeighbourhoodProxy_pID.set(this, void 0);
|
|
17
|
+
__classPrivateFieldSet(this, _NeighbourhoodProxy_client, client, "f");
|
|
18
|
+
__classPrivateFieldSet(this, _NeighbourhoodProxy_pID, pID, "f");
|
|
5
19
|
}
|
|
6
20
|
async otherAgents() {
|
|
7
|
-
return await this.
|
|
21
|
+
return await __classPrivateFieldGet(this, _NeighbourhoodProxy_client, "f").otherAgents(__classPrivateFieldGet(this, _NeighbourhoodProxy_pID, "f"));
|
|
8
22
|
}
|
|
9
23
|
async hasTelepresenceAdapter() {
|
|
10
|
-
return await this.
|
|
24
|
+
return await __classPrivateFieldGet(this, _NeighbourhoodProxy_client, "f").hasTelepresenceAdapter(__classPrivateFieldGet(this, _NeighbourhoodProxy_pID, "f"));
|
|
11
25
|
}
|
|
12
26
|
async onlineAgents() {
|
|
13
|
-
return await this.
|
|
27
|
+
return await __classPrivateFieldGet(this, _NeighbourhoodProxy_client, "f").onlineAgents(__classPrivateFieldGet(this, _NeighbourhoodProxy_pID, "f"));
|
|
14
28
|
}
|
|
15
29
|
async setOnlineStatus(status) {
|
|
16
|
-
return await this.
|
|
30
|
+
return await __classPrivateFieldGet(this, _NeighbourhoodProxy_client, "f").setOnlineStatus(__classPrivateFieldGet(this, _NeighbourhoodProxy_pID, "f"), status);
|
|
17
31
|
}
|
|
18
32
|
async setOnlineStatusU(status) {
|
|
19
|
-
return await this.
|
|
33
|
+
return await __classPrivateFieldGet(this, _NeighbourhoodProxy_client, "f").setOnlineStatusU(__classPrivateFieldGet(this, _NeighbourhoodProxy_pID, "f"), status);
|
|
20
34
|
}
|
|
21
35
|
async sendSignal(remoteAgentDid, payload) {
|
|
22
|
-
return await this.
|
|
36
|
+
return await __classPrivateFieldGet(this, _NeighbourhoodProxy_client, "f").sendSignal(__classPrivateFieldGet(this, _NeighbourhoodProxy_pID, "f"), remoteAgentDid, payload);
|
|
23
37
|
}
|
|
24
38
|
async sendSignalU(remoteAgentDid, payload) {
|
|
25
|
-
return await this.
|
|
39
|
+
return await __classPrivateFieldGet(this, _NeighbourhoodProxy_client, "f").sendSignalU(__classPrivateFieldGet(this, _NeighbourhoodProxy_pID, "f"), remoteAgentDid, payload);
|
|
26
40
|
}
|
|
27
41
|
async sendBroadcast(payload, loopback = false) {
|
|
28
|
-
return await this.
|
|
42
|
+
return await __classPrivateFieldGet(this, _NeighbourhoodProxy_client, "f").sendBroadcast(__classPrivateFieldGet(this, _NeighbourhoodProxy_pID, "f"), payload, loopback);
|
|
29
43
|
}
|
|
30
44
|
async sendBroadcastU(payload, loopback = false) {
|
|
31
|
-
return await this.
|
|
45
|
+
return await __classPrivateFieldGet(this, _NeighbourhoodProxy_client, "f").sendBroadcastU(__classPrivateFieldGet(this, _NeighbourhoodProxy_pID, "f"), payload, loopback);
|
|
32
46
|
}
|
|
33
47
|
async addSignalHandler(handler) {
|
|
34
|
-
await this.
|
|
48
|
+
await __classPrivateFieldGet(this, _NeighbourhoodProxy_client, "f").addSignalHandler(__classPrivateFieldGet(this, _NeighbourhoodProxy_pID, "f"), handler);
|
|
35
49
|
}
|
|
36
50
|
removeSignalHandler(handler) {
|
|
37
|
-
this.
|
|
51
|
+
__classPrivateFieldGet(this, _NeighbourhoodProxy_client, "f").removeSignalHandler(__classPrivateFieldGet(this, _NeighbourhoodProxy_pID, "f"), handler);
|
|
38
52
|
}
|
|
39
53
|
}
|
|
54
|
+
_NeighbourhoodProxy_client = new WeakMap(), _NeighbourhoodProxy_pID = new WeakMap();
|
|
@@ -33,7 +33,11 @@ describe("NeighbourhoodProxy", () => {
|
|
|
33
33
|
const subscriptions = [];
|
|
34
34
|
const subscribe = (args) => {
|
|
35
35
|
subscriptions.push(args);
|
|
36
|
-
|
|
36
|
+
new Promise((resolve) => {
|
|
37
|
+
setTimeout(() => {
|
|
38
|
+
resolve({});
|
|
39
|
+
}, 10);
|
|
40
|
+
});
|
|
37
41
|
};
|
|
38
42
|
const mockApolloClient = {
|
|
39
43
|
subscribe: () => ({
|
|
@@ -7,7 +7,7 @@ import { NeighbourhoodProxy } from "../neighbourhood/NeighbourhoodProxy";
|
|
|
7
7
|
import { LinkQuery } from "./LinkQuery";
|
|
8
8
|
import { Perspective } from "./Perspective";
|
|
9
9
|
import { PerspectiveHandle, PerspectiveState } from "./PerspectiveHandle";
|
|
10
|
-
import { LinkStatus, PerspectiveProxy } from
|
|
10
|
+
import { LinkStatus, PerspectiveProxy } from './PerspectiveProxy';
|
|
11
11
|
import { AIClient } from "../ai/AIClient";
|
|
12
12
|
import { AllInstancesResult } from "../model/Ad4mModel";
|
|
13
13
|
export type PerspectiveHandleCallback = (perspective: PerspectiveHandle) => null;
|
|
@@ -15,14 +15,7 @@ export type UuidCallback = (uuid: string) => null;
|
|
|
15
15
|
export type LinkCallback = (link: LinkExpression) => null;
|
|
16
16
|
export type SyncStateChangeCallback = (state: PerspectiveState) => null;
|
|
17
17
|
export declare class PerspectiveClient {
|
|
18
|
-
private
|
|
19
|
-
private _perspectiveAddedCallbacks;
|
|
20
|
-
private _perspectiveUpdatedCallbacks;
|
|
21
|
-
private _perspectiveRemovedCallbacks;
|
|
22
|
-
private _perspectiveSyncStateChangeCallbacks;
|
|
23
|
-
private _expressionClient?;
|
|
24
|
-
private _neighbourhoodClient?;
|
|
25
|
-
private _aiClient?;
|
|
18
|
+
#private;
|
|
26
19
|
constructor(client: ApolloClient<any>, subscribe?: boolean);
|
|
27
20
|
setExpressionClient(client: ExpressionClient): void;
|
|
28
21
|
setNeighbourhoodClient(client: NeighbourhoodClient): void;
|
|
@@ -49,6 +42,13 @@ export declare class PerspectiveClient {
|
|
|
49
42
|
result: AllInstancesResult;
|
|
50
43
|
isInit?: boolean;
|
|
51
44
|
}>;
|
|
45
|
+
perspectiveSubscribeSurrealQuery(uuid: string, query: string): Promise<{
|
|
46
|
+
subscriptionId: string;
|
|
47
|
+
result: AllInstancesResult;
|
|
48
|
+
isInit?: boolean;
|
|
49
|
+
}>;
|
|
50
|
+
perspectiveKeepAliveSurrealQuery(uuid: string, subscriptionId: string): Promise<boolean>;
|
|
51
|
+
perspectiveDisposeSurrealQuerySubscription(uuid: string, subscriptionId: string): Promise<boolean>;
|
|
52
52
|
subscribeToQueryUpdates(subscriptionId: string, onData: (result: AllInstancesResult) => void): () => void;
|
|
53
53
|
keepAliveQuery(uuid: string, subscriptionId: string): Promise<boolean>;
|
|
54
54
|
disposeQuerySubscription(uuid: string, subscriptionId: string): Promise<boolean>;
|