@coasys/ad4m 0.13.1-staging.11 → 0.13.1-staging.13
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 +547 -72
- package/lib/index.js +547 -72
- package/lib/src/apiClient.d.ts +7 -2
- package/lib/src/apiClient.js +3 -2
- package/lib/src/generated/api/AISessionMessage.d.ts +4 -3
- package/lib/src/generated/api/AiEndpoint.d.ts +3 -2
- package/lib/src/generated/api/Cardinality.d.ts +7 -0
- package/lib/src/generated/api/Cardinality.js +2 -0
- package/lib/src/generated/api/CascadeStep.d.ts +12 -0
- package/lib/src/generated/api/CascadeStep.js +2 -0
- package/lib/src/generated/api/CollectionItemAdded.d.ts +14 -0
- package/lib/src/generated/api/CollectionItemAdded.js +2 -0
- package/lib/src/generated/api/CollectionItemRemoved.d.ts +12 -0
- package/lib/src/generated/api/CollectionItemRemoved.js +2 -0
- package/lib/src/generated/api/CollectionItems.d.ts +7 -0
- package/lib/src/generated/api/CollectionItems.js +2 -0
- package/lib/src/generated/api/ConfigChanged.d.ts +8 -0
- package/lib/src/generated/api/ConfigChanged.js +2 -0
- package/lib/src/generated/api/ConfigKeyInfo.d.ts +10 -0
- package/lib/src/generated/api/ConfigKeyInfo.js +1 -0
- package/lib/src/generated/api/ConfigRefusal.d.ts +6 -0
- package/lib/src/generated/api/ConfigRefusal.js +1 -0
- package/lib/src/generated/api/DeviceKeys.d.ts +9 -0
- package/lib/src/generated/api/DeviceKeys.js +2 -0
- package/lib/src/generated/api/Events.d.ts +2 -0
- package/lib/src/generated/api/InstanceAddToCollection.d.ts +16 -0
- package/lib/src/generated/api/InstanceAddToCollection.js +2 -0
- package/lib/src/generated/api/InstanceCreate.d.ts +31 -0
- package/lib/src/generated/api/InstanceCreate.js +2 -0
- package/lib/src/generated/api/InstanceCreated.d.ts +17 -0
- package/lib/src/generated/api/InstanceCreated.js +1 -0
- package/lib/src/generated/api/InstanceError.d.ts +55 -0
- package/lib/src/generated/api/InstanceError.js +1 -0
- package/lib/src/generated/api/InstanceRemove.d.ts +12 -0
- package/lib/src/generated/api/InstanceRemove.js +2 -0
- package/lib/src/generated/api/InstanceRemoveFromCollection.d.ts +16 -0
- package/lib/src/generated/api/InstanceRemoveFromCollection.js +2 -0
- package/lib/src/generated/api/InstanceRemoved.d.ts +10 -0
- package/lib/src/generated/api/InstanceRemoved.js +2 -0
- package/lib/src/generated/api/InstanceUpdate.d.ts +15 -0
- package/lib/src/generated/api/InstanceUpdate.js +2 -0
- package/lib/src/generated/api/InstanceUpdated.d.ts +5 -0
- package/lib/src/generated/api/InstanceUpdated.js +2 -0
- package/lib/src/generated/api/KeyClass.d.ts +4 -0
- package/lib/src/generated/api/KeyClass.js +2 -0
- package/lib/src/generated/api/LogTail.d.ts +6 -0
- package/lib/src/generated/api/LogTail.js +2 -0
- package/lib/src/generated/api/LogTailParams.d.ts +9 -0
- package/lib/src/generated/api/LogTailParams.js +2 -0
- package/lib/src/generated/api/PerspectiveInstanceAddToCollectionParams.d.ts +14 -0
- package/lib/src/generated/api/PerspectiveInstanceAddToCollectionParams.js +2 -0
- package/lib/src/generated/api/PerspectiveInstanceCreateParams.d.ts +29 -0
- package/lib/src/generated/api/PerspectiveInstanceCreateParams.js +2 -0
- package/lib/src/generated/api/PerspectiveInstanceRemoveFromCollectionParams.d.ts +14 -0
- package/lib/src/generated/api/PerspectiveInstanceRemoveFromCollectionParams.js +2 -0
- package/lib/src/generated/api/PerspectiveInstanceRemoveParams.d.ts +9 -0
- package/lib/src/generated/api/PerspectiveInstanceRemoveParams.js +2 -0
- package/lib/src/generated/api/PerspectiveInstanceUpdateParams.d.ts +13 -0
- package/lib/src/generated/api/PerspectiveInstanceUpdateParams.js +2 -0
- package/lib/src/generated/api/Pinned.d.ts +5 -0
- package/lib/src/generated/api/Pinned.js +2 -0
- package/lib/src/generated/api/ReadOnlyReason.d.ts +4 -0
- package/lib/src/generated/api/ReadOnlyReason.js +2 -0
- package/lib/src/generated/api/RefusalReason.d.ts +4 -0
- package/lib/src/generated/api/RefusalReason.js +2 -0
- package/lib/src/generated/api/RpcMethods.d.ts +60 -0
- package/lib/src/generated/api/RpcMethods.js +3 -0
- package/lib/src/generated/api/RuntimeConfig.d.ts +23 -0
- package/lib/src/generated/api/RuntimeConfig.js +1 -0
- package/lib/src/generated/api/SetConfigParams.d.ts +7 -0
- package/lib/src/generated/api/SetConfigParams.js +2 -0
- package/lib/src/generated/api/SetConfigResult.d.ts +8 -0
- package/lib/src/generated/api/SetConfigResult.js +1 -0
- package/lib/src/generated/api/ValidationError.d.ts +34 -0
- package/lib/src/generated/api/ValidationError.js +1 -0
- package/lib/src/generated/api/ValidationProblem.d.ts +34 -0
- package/lib/src/generated/api/ValidationProblem.js +1 -0
- package/lib/src/generated/api/WriteStep.d.ts +37 -0
- package/lib/src/generated/api/WriteStep.js +2 -0
- package/lib/src/generated/api/index.d.ts +30 -0
- package/lib/src/identity/IdentityClient.d.ts +14 -0
- package/lib/src/identity/IdentityClient.js +17 -0
- package/lib/src/model/shacl-gen.js +4 -2
- package/lib/src/neighbourhood/MeshManager.d.ts +17 -1
- package/lib/src/neighbourhood/MeshManager.js +17 -0
- package/lib/src/neighbourhood/NeighbourhoodProxy.d.ts +7 -2
- package/lib/src/neighbourhood/NeighbourhoodProxy.js +7 -2
- package/lib/src/neighbourhood/Session.d.ts +5 -3
- package/lib/src/neighbourhood/Session.js +171 -26
- package/lib/src/perspectives/PerspectiveClient.d.ts +34 -0
- package/lib/src/perspectives/PerspectiveClient.js +45 -0
- package/lib/src/perspectives/PerspectiveProxy.d.ts +33 -0
- package/lib/src/perspectives/PerspectiveProxy.js +67 -2
- package/lib/src/perspectives/WakerSubscriptionManager.d.ts +23 -1
- package/lib/src/perspectives/WakerSubscriptionManager.js +187 -36
- package/lib/src/runtime/RuntimeClient.d.ts +13 -1
- package/lib/src/runtime/RuntimeClient.js +20 -0
- package/lib/src/shacl/SHACLShape.js +6 -2
- package/package.json +2 -2
- package/src/Ad4mClient.test.ts +118 -2
- package/src/apiClient.ts +10 -4
- package/src/generated/api/AISessionMessage.ts +4 -3
- package/src/generated/api/AiEndpoint.ts +3 -2
- package/src/generated/api/Cardinality.ts +6 -0
- package/src/generated/api/CascadeStep.ts +6 -0
- package/src/generated/api/CollectionItemAdded.ts +11 -0
- package/src/generated/api/CollectionItemRemoved.ts +9 -0
- package/src/generated/api/CollectionItems.ts +6 -0
- package/src/generated/api/ConfigChanged.ts +7 -0
- package/src/generated/api/ConfigKeyInfo.ts +8 -0
- package/src/generated/api/ConfigRefusal.ts +4 -0
- package/src/generated/api/DeviceKeys.ts +8 -0
- package/src/generated/api/Events.ts +2 -0
- package/src/generated/api/InstanceAddToCollection.ts +14 -0
- package/src/generated/api/InstanceCreate.ts +32 -0
- package/src/generated/api/InstanceCreated.ts +16 -0
- package/src/generated/api/InstanceError.ts +10 -0
- package/src/generated/api/InstanceRemove.ts +11 -0
- package/src/generated/api/InstanceRemoveFromCollection.ts +14 -0
- package/src/generated/api/InstanceRemoved.ts +9 -0
- package/src/generated/api/InstanceUpdate.ts +14 -0
- package/src/generated/api/InstanceUpdated.ts +3 -0
- package/src/generated/api/KeyClass.ts +6 -0
- package/src/generated/api/LogTail.ts +6 -0
- package/src/generated/api/LogTailParams.ts +10 -0
- package/src/generated/api/PerspectiveInstanceAddToCollectionParams.ts +11 -0
- package/src/generated/api/PerspectiveInstanceCreateParams.ts +29 -0
- package/src/generated/api/PerspectiveInstanceRemoveFromCollectionParams.ts +11 -0
- package/src/generated/api/PerspectiveInstanceRemoveParams.ts +7 -0
- package/src/generated/api/PerspectiveInstanceUpdateParams.ts +11 -0
- package/src/generated/api/Pinned.ts +7 -0
- package/src/generated/api/ReadOnlyReason.ts +6 -0
- package/src/generated/api/RefusalReason.ts +6 -0
- package/src/generated/api/RpcMethods.ts +30 -0
- package/src/generated/api/RuntimeConfig.ts +24 -0
- package/src/generated/api/SetConfigParams.ts +6 -0
- package/src/generated/api/SetConfigResult.ts +7 -0
- package/src/generated/api/ValidationError.ts +34 -0
- package/src/generated/api/ValidationProblem.ts +7 -0
- package/src/generated/api/WriteStep.ts +6 -0
- package/src/generated/api/index.ts +34 -0
- package/src/identity/IdentityClient.ts +20 -0
- package/src/model/shacl-gen.ts +4 -2
- package/src/neighbourhood/MeshManager.test.ts +57 -0
- package/src/neighbourhood/MeshManager.ts +26 -0
- package/src/neighbourhood/NeighbourhoodProxy.ts +7 -2
- package/src/neighbourhood/Session.test.ts +355 -3
- package/src/neighbourhood/Session.ts +170 -28
- package/src/perspectives/PerspectiveClient.ts +56 -0
- package/src/perspectives/PerspectiveProxy.test.ts +34 -0
- package/src/perspectives/PerspectiveProxy.ts +76 -2
- package/src/perspectives/WakerSubscriptionManager.test.ts +379 -1
- package/src/perspectives/WakerSubscriptionManager.ts +189 -41
- package/src/runtime/RuntimeClient.ts +25 -1
- package/src/shacl/SHACLFlow.test.ts +4 -2
- package/src/shacl/SHACLShape.test.ts +10 -3
- package/src/shacl/SHACLShape.ts +6 -2
package/lib/src/apiClient.d.ts
CHANGED
|
@@ -7,11 +7,16 @@ export interface WsEvent {
|
|
|
7
7
|
}
|
|
8
8
|
/** Error thrown by ApiClient when an RPC call fails. */
|
|
9
9
|
export declare class RpcError extends Error {
|
|
10
|
-
/** Error code (maps to HTTP status semantics: 400, 401, 403, 404, 500). */
|
|
10
|
+
/** Error code (maps to HTTP status semantics: 400, 401, 403, 404, 422, 500). */
|
|
11
11
|
readonly status: number;
|
|
12
12
|
/** Raw error message from server. */
|
|
13
13
|
readonly body: string;
|
|
14
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Structured detail the executor attached (`error.data`), when it did: e.g. the
|
|
16
|
+
* `InstanceError` of a refused `perspective.instance*` write.
|
|
17
|
+
*/
|
|
18
|
+
readonly data?: unknown;
|
|
19
|
+
constructor(status: number, body: string, data?: unknown);
|
|
15
20
|
}
|
|
16
21
|
/** Options accepted by [`ApiClient.call`]. */
|
|
17
22
|
export interface CallOptions {
|
package/lib/src/apiClient.js
CHANGED
|
@@ -2,11 +2,12 @@ import { callSafely } from './notifyListeners';
|
|
|
2
2
|
import { LONG_METHODS, OPENS_METHODS, READ_METHODS } from './generated/api/RpcMethods';
|
|
3
3
|
/** Error thrown by ApiClient when an RPC call fails. */
|
|
4
4
|
export class RpcError extends Error {
|
|
5
|
-
constructor(status, body) {
|
|
5
|
+
constructor(status, body, data) {
|
|
6
6
|
super(`RPC error ${status}: ${body}`);
|
|
7
7
|
this.name = "RpcError";
|
|
8
8
|
this.status = status;
|
|
9
9
|
this.body = body;
|
|
10
|
+
this.data = data;
|
|
10
11
|
}
|
|
11
12
|
}
|
|
12
13
|
const DEFAULT_TIMEOUT_MS = 30000;
|
|
@@ -192,7 +193,7 @@ export class ApiClient {
|
|
|
192
193
|
pending.resolve(parsed.result);
|
|
193
194
|
return;
|
|
194
195
|
}
|
|
195
|
-
const rpcError = new RpcError(error.code ?? 500, error.message ?? 'Unknown error');
|
|
196
|
+
const rpcError = new RpcError(error.code ?? 500, error.message ?? 'Unknown error', error.data);
|
|
196
197
|
pending.reject(rpcError);
|
|
197
198
|
// The executor answers 401 only when the token stopped working, then closes the socket.
|
|
198
199
|
if (rpcError.status === 401)
|
|
@@ -14,9 +14,10 @@ export type AISessionMessage = {
|
|
|
14
14
|
/**
|
|
15
15
|
* The transcript entry: `{"text": ..}` for user and assistant turns;
|
|
16
16
|
* `{"name", "arguments", "target"?, "writes", "result"? | "error"?}` for a
|
|
17
|
-
* tool step. `writes` is the
|
|
18
|
-
* (`agent_session::tool_writes`),
|
|
19
|
-
* changed
|
|
17
|
+
* tool step. `writes` is the tool's declared intent
|
|
18
|
+
* (`agent_session::tool_writes`), recorded before the call runs. It does
|
|
19
|
+
* not say the call changed anything: a refused or failed write still has
|
|
20
|
+
* `writes: true`.
|
|
20
21
|
*/
|
|
21
22
|
content: unknown;
|
|
22
23
|
/**
|
|
@@ -14,8 +14,9 @@ export type AiEndpoint = {
|
|
|
14
14
|
maxNumCtx?: number | null;
|
|
15
15
|
/**
|
|
16
16
|
* How long a request to this endpoint may take, queueing included. Unset: 300 s for
|
|
17
|
-
* chat `/v1` forwards, 600 s for chat the executor answers
|
|
18
|
-
*
|
|
17
|
+
* chat `/v1` forwards, 600 s for chat the executor answers, 60 s for embeddings, 120 s
|
|
18
|
+
* for speech. An OpenAI-protocol chat client uses this value for a stream too. A value
|
|
19
|
+
* above 600 s is kept. A stream has no second timer in `within_endpoint_limits`.
|
|
19
20
|
*/
|
|
20
21
|
requestTimeoutSecs?: number | null;
|
|
21
22
|
/**
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type CollectionItemAdded = {
|
|
2
|
+
className: string;
|
|
3
|
+
baseUri: string;
|
|
4
|
+
/**
|
|
5
|
+
* The collection's canonical name.
|
|
6
|
+
*/
|
|
7
|
+
collection: string;
|
|
8
|
+
itemUri: string;
|
|
9
|
+
/**
|
|
10
|
+
* 0 when the item was in the collection already (as the batch's effective graph has it).
|
|
11
|
+
*/
|
|
12
|
+
linksAdded: number;
|
|
13
|
+
alreadyMember: boolean;
|
|
14
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type CollectionItemRemoved = {
|
|
2
|
+
className: string;
|
|
3
|
+
baseUri: string;
|
|
4
|
+
collection: string;
|
|
5
|
+
itemUri: string;
|
|
6
|
+
/**
|
|
7
|
+
* 0 when the item was not in the collection (as the batch's effective graph has it).
|
|
8
|
+
* Inside a batch, a member that only the batch had added counts too — it leaves by
|
|
9
|
+
* cancelling the staged addition.
|
|
10
|
+
*/
|
|
11
|
+
linksRemoved: number;
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An executor's device keys from its one wallet key: the `did:key` it signs with, and the
|
|
3
|
+
* X25519 multikey (`z6LS…`) a sender seals to. `identity.rekey` answers the new ones;
|
|
4
|
+
* `identity.custodyStatus` the current ones.
|
|
5
|
+
*/
|
|
6
|
+
export type DeviceKeys = {
|
|
7
|
+
sign: string;
|
|
8
|
+
enc: string;
|
|
9
|
+
};
|
|
@@ -5,6 +5,7 @@ import type { AiEndpointStatusEvent } from "./AiEndpointStatusEvent";
|
|
|
5
5
|
import type { Apps } from "./Apps";
|
|
6
6
|
import type { AutoProcessorEvent } from "./AutoProcessorEvent";
|
|
7
7
|
import type { AutoProcessorNeighbourhoodState } from "./AutoProcessorNeighbourhoodState";
|
|
8
|
+
import type { ConfigChanged } from "./ConfigChanged";
|
|
8
9
|
import type { ExceptionOccurredEvent } from "./ExceptionOccurredEvent";
|
|
9
10
|
import type { FlowStateChangedEvent } from "./FlowStateChangedEvent";
|
|
10
11
|
import type { HostingUserInfo } from "./HostingUserInfo";
|
|
@@ -56,6 +57,7 @@ export interface EventMap {
|
|
|
56
57
|
"sfu-session-replaced": SfuSessionReplaced;
|
|
57
58
|
"flow-state-changed": FlowStateChangedEvent;
|
|
58
59
|
"identity-fork": IdentityForkEvent;
|
|
60
|
+
"config-changed": ConfigChanged;
|
|
59
61
|
}
|
|
60
62
|
export type EventName = keyof EventMap;
|
|
61
63
|
/** Events about one perspective: they carry `perspectiveUuid`. */
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Add an item to a collection of an instance.
|
|
3
|
+
*/
|
|
4
|
+
export type InstanceAddToCollection = {
|
|
5
|
+
className: string;
|
|
6
|
+
baseUri: string;
|
|
7
|
+
collection: string;
|
|
8
|
+
/**
|
|
9
|
+
* The item, usually another instance's URI.
|
|
10
|
+
*/
|
|
11
|
+
itemUri: string;
|
|
12
|
+
/**
|
|
13
|
+
* An open batch to stage the write into; see `InstanceCreate`'s `batchId`.
|
|
14
|
+
*/
|
|
15
|
+
batchId?: string;
|
|
16
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create an instance of a subject class.
|
|
3
|
+
*/
|
|
4
|
+
export type InstanceCreate = {
|
|
5
|
+
/**
|
|
6
|
+
* The subject class, as the perspective names it (matched case-insensitively).
|
|
7
|
+
*/
|
|
8
|
+
className: string;
|
|
9
|
+
/**
|
|
10
|
+
* Values by property name: one JSON value per single-valued property (of the property's
|
|
11
|
+
* type), an array of item URIs per collection. Required properties must be present.
|
|
12
|
+
*/
|
|
13
|
+
properties?: Record<string, unknown>;
|
|
14
|
+
/**
|
|
15
|
+
* The new instance's URI. A random `ad4m://obj/…` one when absent; a bare string becomes a
|
|
16
|
+
* literal URI.
|
|
17
|
+
*/
|
|
18
|
+
baseUri?: string;
|
|
19
|
+
/**
|
|
20
|
+
* A node to put the new instance under, through the parent class's own `children` relation
|
|
21
|
+
* when it has one, else `ad4m://has_child`.
|
|
22
|
+
*/
|
|
23
|
+
parent?: string;
|
|
24
|
+
/**
|
|
25
|
+
* An open batch (`perspective.createBatch`) to stage the write into; it lands on the
|
|
26
|
+
* batch's commit. Absent: the create commits on its own. On a non-validation error the
|
|
27
|
+
* batch may hold a partial write — discard it (`perspective.discardBatch`), don't commit
|
|
28
|
+
* it.
|
|
29
|
+
*/
|
|
30
|
+
batchId?: string;
|
|
31
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { CollectionItems } from "./CollectionItems";
|
|
2
|
+
export type InstanceCreated = {
|
|
3
|
+
/**
|
|
4
|
+
* The class's canonical name.
|
|
5
|
+
*/
|
|
6
|
+
className: string;
|
|
7
|
+
/**
|
|
8
|
+
* The new instance's URI (its id).
|
|
9
|
+
*/
|
|
10
|
+
baseUri: string;
|
|
11
|
+
propertiesSet: Array<string>;
|
|
12
|
+
collectionsSet: Array<CollectionItems>;
|
|
13
|
+
/**
|
|
14
|
+
* The parent it was put under, when one was named.
|
|
15
|
+
*/
|
|
16
|
+
parent: string | null;
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { CascadeStep } from "./CascadeStep";
|
|
2
|
+
import type { ValidationError } from "./ValidationError";
|
|
3
|
+
import type { WriteStep } from "./WriteStep";
|
|
4
|
+
/**
|
|
5
|
+
* A refused or failed instance write. Serialized (camelCase, tagged by `kind`) as the data of
|
|
6
|
+
* the RPC error; MCP writes its own text from it.
|
|
7
|
+
*/
|
|
8
|
+
export type InstanceError = {
|
|
9
|
+
"kind": "unknownClass";
|
|
10
|
+
className: string;
|
|
11
|
+
registered: Array<string>;
|
|
12
|
+
} | {
|
|
13
|
+
"kind": "abstractClass";
|
|
14
|
+
className: string;
|
|
15
|
+
} | {
|
|
16
|
+
"kind": "invalidUri";
|
|
17
|
+
field: string;
|
|
18
|
+
value: string;
|
|
19
|
+
} | {
|
|
20
|
+
"kind": "emptyProperties";
|
|
21
|
+
} | {
|
|
22
|
+
"kind": "batchNotFound";
|
|
23
|
+
batchId: string;
|
|
24
|
+
} | {
|
|
25
|
+
"kind": "validation";
|
|
26
|
+
className: string;
|
|
27
|
+
errors: Array<ValidationError>;
|
|
28
|
+
} | {
|
|
29
|
+
"kind": "notFound";
|
|
30
|
+
className: string;
|
|
31
|
+
baseUri: string;
|
|
32
|
+
} | {
|
|
33
|
+
"kind": "alreadyExists";
|
|
34
|
+
className: string;
|
|
35
|
+
baseUri: string;
|
|
36
|
+
} | {
|
|
37
|
+
"kind": "storedAsExpressions";
|
|
38
|
+
className: string;
|
|
39
|
+
collection: string;
|
|
40
|
+
itemUri: string;
|
|
41
|
+
language: string;
|
|
42
|
+
members: Array<string>;
|
|
43
|
+
} | {
|
|
44
|
+
"kind": "failed";
|
|
45
|
+
className: string;
|
|
46
|
+
step: WriteStep;
|
|
47
|
+
error: string;
|
|
48
|
+
} | {
|
|
49
|
+
"kind": "partiallyRemoved";
|
|
50
|
+
className: string;
|
|
51
|
+
baseUri: string;
|
|
52
|
+
removed: number;
|
|
53
|
+
step: CascadeStep;
|
|
54
|
+
error: string;
|
|
55
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Remove an instance: every link from and to it. Through an abstract class (#1435), the
|
|
3
|
+
* destructor of each of the record's classes it reads.
|
|
4
|
+
*/
|
|
5
|
+
export type InstanceRemove = {
|
|
6
|
+
className: string;
|
|
7
|
+
baseUri: string;
|
|
8
|
+
/**
|
|
9
|
+
* An open batch to stage the write into; see `InstanceCreate`'s `batchId`.
|
|
10
|
+
*/
|
|
11
|
+
batchId?: string;
|
|
12
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Remove an item from a collection of an instance (the membership link only).
|
|
3
|
+
*/
|
|
4
|
+
export type InstanceRemoveFromCollection = {
|
|
5
|
+
className: string;
|
|
6
|
+
baseUri: string;
|
|
7
|
+
collection: string;
|
|
8
|
+
/**
|
|
9
|
+
* The item as a read of the instance lists it.
|
|
10
|
+
*/
|
|
11
|
+
itemUri: string;
|
|
12
|
+
/**
|
|
13
|
+
* An open batch to stage the write into; see `InstanceCreate`'s `batchId`.
|
|
14
|
+
*/
|
|
15
|
+
batchId?: string;
|
|
16
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type InstanceRemoved = {
|
|
2
|
+
className: string;
|
|
3
|
+
baseUri: string;
|
|
4
|
+
/**
|
|
5
|
+
* The links the cascade removed from the effective graph; `None` through an abstract
|
|
6
|
+
* class, whose classes' destructors ran. Inside a caller's batch they are staged, not
|
|
7
|
+
* committed — including staged additions the call cancelled.
|
|
8
|
+
*/
|
|
9
|
+
linksRemoved: number | null;
|
|
10
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Set single-valued properties of an instance; the others stay as they are.
|
|
3
|
+
*/
|
|
4
|
+
export type InstanceUpdate = {
|
|
5
|
+
className: string;
|
|
6
|
+
baseUri: string;
|
|
7
|
+
/**
|
|
8
|
+
* Values by property name, at least one; single-valued properties only.
|
|
9
|
+
*/
|
|
10
|
+
properties: Record<string, unknown>;
|
|
11
|
+
/**
|
|
12
|
+
* An open batch to stage the write into; see `InstanceCreate`'s `batchId`.
|
|
13
|
+
*/
|
|
14
|
+
batchId?: string;
|
|
15
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type PerspectiveInstanceAddToCollectionParams = {
|
|
2
|
+
uuid: string;
|
|
3
|
+
className: string;
|
|
4
|
+
baseUri: string;
|
|
5
|
+
collection: string;
|
|
6
|
+
/**
|
|
7
|
+
* The item, usually another instance's URI.
|
|
8
|
+
*/
|
|
9
|
+
itemUri: string;
|
|
10
|
+
/**
|
|
11
|
+
* An open batch to stage the write into; see `InstanceCreate`'s `batchId`.
|
|
12
|
+
*/
|
|
13
|
+
batchId?: string;
|
|
14
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export type PerspectiveInstanceCreateParams = {
|
|
2
|
+
uuid: string;
|
|
3
|
+
/**
|
|
4
|
+
* The subject class, as the perspective names it (matched case-insensitively).
|
|
5
|
+
*/
|
|
6
|
+
className: string;
|
|
7
|
+
/**
|
|
8
|
+
* Values by property name: one JSON value per single-valued property (of the property's
|
|
9
|
+
* type), an array of item URIs per collection. Required properties must be present.
|
|
10
|
+
*/
|
|
11
|
+
properties?: Record<string, unknown>;
|
|
12
|
+
/**
|
|
13
|
+
* The new instance's URI. A random `ad4m://obj/…` one when absent; a bare string becomes a
|
|
14
|
+
* literal URI.
|
|
15
|
+
*/
|
|
16
|
+
baseUri?: string;
|
|
17
|
+
/**
|
|
18
|
+
* A node to put the new instance under, through the parent class's own `children` relation
|
|
19
|
+
* when it has one, else `ad4m://has_child`.
|
|
20
|
+
*/
|
|
21
|
+
parent?: string;
|
|
22
|
+
/**
|
|
23
|
+
* An open batch (`perspective.createBatch`) to stage the write into; it lands on the
|
|
24
|
+
* batch's commit. Absent: the create commits on its own. On a non-validation error the
|
|
25
|
+
* batch may hold a partial write — discard it (`perspective.discardBatch`), don't commit
|
|
26
|
+
* it.
|
|
27
|
+
*/
|
|
28
|
+
batchId?: string;
|
|
29
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type PerspectiveInstanceRemoveFromCollectionParams = {
|
|
2
|
+
uuid: string;
|
|
3
|
+
className: string;
|
|
4
|
+
baseUri: string;
|
|
5
|
+
collection: string;
|
|
6
|
+
/**
|
|
7
|
+
* The item as a read of the instance lists it.
|
|
8
|
+
*/
|
|
9
|
+
itemUri: string;
|
|
10
|
+
/**
|
|
11
|
+
* An open batch to stage the write into; see `InstanceCreate`'s `batchId`.
|
|
12
|
+
*/
|
|
13
|
+
batchId?: string;
|
|
14
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type PerspectiveInstanceUpdateParams = {
|
|
2
|
+
uuid: string;
|
|
3
|
+
className: string;
|
|
4
|
+
baseUri: string;
|
|
5
|
+
/**
|
|
6
|
+
* Values by property name, at least one; single-valued properties only.
|
|
7
|
+
*/
|
|
8
|
+
properties: Record<string, unknown>;
|
|
9
|
+
/**
|
|
10
|
+
* An open batch to stage the write into; see `InstanceCreate`'s `batchId`.
|
|
11
|
+
*/
|
|
12
|
+
batchId?: string;
|
|
13
|
+
};
|