@super-line/core 0.6.0 → 0.7.0
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/dist/index.cjs +4 -1
- package/dist/index.d.cts +46 -1
- package/dist/index.d.ts +46 -1
- package/dist/index.js +4 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -103,7 +103,10 @@ var InspectorContract = defineContract({
|
|
|
103
103
|
getTopology: { input: s(), output: s() },
|
|
104
104
|
listConnections: { input: s(), output: s() },
|
|
105
105
|
getNode: { input: s(), output: s() },
|
|
106
|
-
getConn: { input: s(), output: s() }
|
|
106
|
+
getConn: { input: s(), output: s() },
|
|
107
|
+
listStores: { input: s(), output: s() },
|
|
108
|
+
listResources: { input: s(), output: s() },
|
|
109
|
+
readResource: { input: s(), output: s() }
|
|
107
110
|
},
|
|
108
111
|
serverToClient: {
|
|
109
112
|
events: { payload: s(), subscribe: true }
|
package/dist/index.d.cts
CHANGED
|
@@ -344,6 +344,19 @@ interface ConnView {
|
|
|
344
344
|
/** Whether ctx/data could be read (false for conns on another node). */
|
|
345
345
|
ctxAvailable: boolean;
|
|
346
346
|
}
|
|
347
|
+
/** A configured Store — what `listStores` returns. `model` is the backend's declared consistency model, if any. */
|
|
348
|
+
interface StoreInfo {
|
|
349
|
+
name: string;
|
|
350
|
+
model?: 'lww' | 'crdt';
|
|
351
|
+
}
|
|
352
|
+
/** A Resource's current value — what `readResource` returns. Materialized + safe-serialized server-side. */
|
|
353
|
+
interface StoreResourceView {
|
|
354
|
+
data: unknown;
|
|
355
|
+
accessRules: Record<string, {
|
|
356
|
+
read: boolean;
|
|
357
|
+
write: boolean;
|
|
358
|
+
}>;
|
|
359
|
+
}
|
|
347
360
|
/** A failed response/reply, carried on `msg.response` / `msg.serverReply`. */
|
|
348
361
|
interface MessageError {
|
|
349
362
|
code: string;
|
|
@@ -418,6 +431,14 @@ type InspectorEvent = {
|
|
|
418
431
|
ok: boolean;
|
|
419
432
|
output?: unknown;
|
|
420
433
|
error?: MessageError;
|
|
434
|
+
} | {
|
|
435
|
+
type: 'store.create';
|
|
436
|
+
store: string;
|
|
437
|
+
id: string;
|
|
438
|
+
} | {
|
|
439
|
+
type: 'store.delete';
|
|
440
|
+
store: string;
|
|
441
|
+
id: string;
|
|
421
442
|
} | {
|
|
422
443
|
type: 'store.write';
|
|
423
444
|
store: string;
|
|
@@ -483,6 +504,28 @@ declare const InspectorContract: {
|
|
|
483
504
|
}>;
|
|
484
505
|
readonly output: StandardSchemaV1<ConnView, ConnView>;
|
|
485
506
|
};
|
|
507
|
+
readonly listStores: {
|
|
508
|
+
readonly input: StandardSchemaV1<void, void>;
|
|
509
|
+
readonly output: StandardSchemaV1<StoreInfo[], StoreInfo[]>;
|
|
510
|
+
};
|
|
511
|
+
readonly listResources: {
|
|
512
|
+
readonly input: StandardSchemaV1<{
|
|
513
|
+
store: string;
|
|
514
|
+
}, {
|
|
515
|
+
store: string;
|
|
516
|
+
}>;
|
|
517
|
+
readonly output: StandardSchemaV1<string[], string[]>;
|
|
518
|
+
};
|
|
519
|
+
readonly readResource: {
|
|
520
|
+
readonly input: StandardSchemaV1<{
|
|
521
|
+
store: string;
|
|
522
|
+
id: string;
|
|
523
|
+
}, {
|
|
524
|
+
store: string;
|
|
525
|
+
id: string;
|
|
526
|
+
}>;
|
|
527
|
+
readonly output: StandardSchemaV1<StoreResourceView, StoreResourceView>;
|
|
528
|
+
};
|
|
486
529
|
};
|
|
487
530
|
readonly serverToClient: {
|
|
488
531
|
readonly events: {
|
|
@@ -663,6 +706,8 @@ interface ServerStore {
|
|
|
663
706
|
* or `self` (the store owns a shared backend and core fans only to local subscribers).
|
|
664
707
|
*/
|
|
665
708
|
readonly clustering: 'relay' | 'self';
|
|
709
|
+
/** Consistency model, surfaced to the inspector for display. Optional; omit if a backend has no clean label. */
|
|
710
|
+
readonly model?: 'lww' | 'crdt';
|
|
666
711
|
/** Current snapshot of a Resource (for catch-up on subscribe), or undefined if absent. */
|
|
667
712
|
read(id: string): Awaitable<Resource | undefined>;
|
|
668
713
|
/** Create a Resource with initial data + access rules (server-authoritative). */
|
|
@@ -811,4 +856,4 @@ interface ClientTransport {
|
|
|
811
856
|
}): RawConn;
|
|
812
857
|
}
|
|
813
858
|
|
|
814
|
-
export { type AccessRules, type Adapter, type AnyData, type AuthOutcome, type ClientFrame, type ClientInput, type ClientStore, type ClientTransport, type ConnDescriptor, type ConnView, type Contract, type DataOf, type Directional, type EmitData, type ErrFrame, type ErrorCode, type EventData, type Events, type EvtFrame, type Frame, type Handshake, INSPECTOR_ROLE, INSPECTOR_SUBPROTOCOL, type InferIn, type InferOut, type InspectedContract, type InspectedDirectional, type InspectedMessage, InspectorContract, type InspectorEvent, type MessageFlavor, type NodeStat, type NodeView, type Output, PROTOCOL, type Perms, type PingFrame, type PongFrame, type PresenceStore, type Principal, type PubFrame, type RawConn, type ReqFrame, type RequestDef, type Requests, type ResFrame, type Resource, type ResourceReplica, type RoleBlock, type RoleOf, type RoleRequests, type RoleTopics, type SChangeFrame, type SCloseFrame, type SErrFrame, type SOpenFrame, type SReadFrame, type SReqFrame, type SResFrame, type SWriteFrame, type Schema, type SchemaConverter, type Serializer, type ServerEntry, type ServerFrame, type ServerInput, type ServerMessageDef, type ServerMessages, type ServerReplica, type ServerRequestDef, type ServerRequests, type ServerStore, type ServerTransport, type SharedEvents, type SharedRequests, type SharedServerRequests, type SharedTopics, type StoreChange, type SubFrame, SuperLineError, type SuperLineErrorCode, type Topics, type UnsubFrame, classifyContract, defineContract, jsonSerializer, removeAtPath, validate, validateSync };
|
|
859
|
+
export { type AccessRules, type Adapter, type AnyData, type AuthOutcome, type ClientFrame, type ClientInput, type ClientStore, type ClientTransport, type ConnDescriptor, type ConnView, type Contract, type DataOf, type Directional, type EmitData, type ErrFrame, type ErrorCode, type EventData, type Events, type EvtFrame, type Frame, type Handshake, INSPECTOR_ROLE, INSPECTOR_SUBPROTOCOL, type InferIn, type InferOut, type InspectedContract, type InspectedDirectional, type InspectedMessage, InspectorContract, type InspectorEvent, type MessageFlavor, type NodeStat, type NodeView, type Output, PROTOCOL, type Perms, type PingFrame, type PongFrame, type PresenceStore, type Principal, type PubFrame, type RawConn, type ReqFrame, type RequestDef, type Requests, type ResFrame, type Resource, type ResourceReplica, type RoleBlock, type RoleOf, type RoleRequests, type RoleTopics, type SChangeFrame, type SCloseFrame, type SErrFrame, type SOpenFrame, type SReadFrame, type SReqFrame, type SResFrame, type SWriteFrame, type Schema, type SchemaConverter, type Serializer, type ServerEntry, type ServerFrame, type ServerInput, type ServerMessageDef, type ServerMessages, type ServerReplica, type ServerRequestDef, type ServerRequests, type ServerStore, type ServerTransport, type SharedEvents, type SharedRequests, type SharedServerRequests, type SharedTopics, type StoreChange, type StoreInfo, type StoreResourceView, type SubFrame, SuperLineError, type SuperLineErrorCode, type Topics, type UnsubFrame, classifyContract, defineContract, jsonSerializer, removeAtPath, validate, validateSync };
|
package/dist/index.d.ts
CHANGED
|
@@ -344,6 +344,19 @@ interface ConnView {
|
|
|
344
344
|
/** Whether ctx/data could be read (false for conns on another node). */
|
|
345
345
|
ctxAvailable: boolean;
|
|
346
346
|
}
|
|
347
|
+
/** A configured Store — what `listStores` returns. `model` is the backend's declared consistency model, if any. */
|
|
348
|
+
interface StoreInfo {
|
|
349
|
+
name: string;
|
|
350
|
+
model?: 'lww' | 'crdt';
|
|
351
|
+
}
|
|
352
|
+
/** A Resource's current value — what `readResource` returns. Materialized + safe-serialized server-side. */
|
|
353
|
+
interface StoreResourceView {
|
|
354
|
+
data: unknown;
|
|
355
|
+
accessRules: Record<string, {
|
|
356
|
+
read: boolean;
|
|
357
|
+
write: boolean;
|
|
358
|
+
}>;
|
|
359
|
+
}
|
|
347
360
|
/** A failed response/reply, carried on `msg.response` / `msg.serverReply`. */
|
|
348
361
|
interface MessageError {
|
|
349
362
|
code: string;
|
|
@@ -418,6 +431,14 @@ type InspectorEvent = {
|
|
|
418
431
|
ok: boolean;
|
|
419
432
|
output?: unknown;
|
|
420
433
|
error?: MessageError;
|
|
434
|
+
} | {
|
|
435
|
+
type: 'store.create';
|
|
436
|
+
store: string;
|
|
437
|
+
id: string;
|
|
438
|
+
} | {
|
|
439
|
+
type: 'store.delete';
|
|
440
|
+
store: string;
|
|
441
|
+
id: string;
|
|
421
442
|
} | {
|
|
422
443
|
type: 'store.write';
|
|
423
444
|
store: string;
|
|
@@ -483,6 +504,28 @@ declare const InspectorContract: {
|
|
|
483
504
|
}>;
|
|
484
505
|
readonly output: StandardSchemaV1<ConnView, ConnView>;
|
|
485
506
|
};
|
|
507
|
+
readonly listStores: {
|
|
508
|
+
readonly input: StandardSchemaV1<void, void>;
|
|
509
|
+
readonly output: StandardSchemaV1<StoreInfo[], StoreInfo[]>;
|
|
510
|
+
};
|
|
511
|
+
readonly listResources: {
|
|
512
|
+
readonly input: StandardSchemaV1<{
|
|
513
|
+
store: string;
|
|
514
|
+
}, {
|
|
515
|
+
store: string;
|
|
516
|
+
}>;
|
|
517
|
+
readonly output: StandardSchemaV1<string[], string[]>;
|
|
518
|
+
};
|
|
519
|
+
readonly readResource: {
|
|
520
|
+
readonly input: StandardSchemaV1<{
|
|
521
|
+
store: string;
|
|
522
|
+
id: string;
|
|
523
|
+
}, {
|
|
524
|
+
store: string;
|
|
525
|
+
id: string;
|
|
526
|
+
}>;
|
|
527
|
+
readonly output: StandardSchemaV1<StoreResourceView, StoreResourceView>;
|
|
528
|
+
};
|
|
486
529
|
};
|
|
487
530
|
readonly serverToClient: {
|
|
488
531
|
readonly events: {
|
|
@@ -663,6 +706,8 @@ interface ServerStore {
|
|
|
663
706
|
* or `self` (the store owns a shared backend and core fans only to local subscribers).
|
|
664
707
|
*/
|
|
665
708
|
readonly clustering: 'relay' | 'self';
|
|
709
|
+
/** Consistency model, surfaced to the inspector for display. Optional; omit if a backend has no clean label. */
|
|
710
|
+
readonly model?: 'lww' | 'crdt';
|
|
666
711
|
/** Current snapshot of a Resource (for catch-up on subscribe), or undefined if absent. */
|
|
667
712
|
read(id: string): Awaitable<Resource | undefined>;
|
|
668
713
|
/** Create a Resource with initial data + access rules (server-authoritative). */
|
|
@@ -811,4 +856,4 @@ interface ClientTransport {
|
|
|
811
856
|
}): RawConn;
|
|
812
857
|
}
|
|
813
858
|
|
|
814
|
-
export { type AccessRules, type Adapter, type AnyData, type AuthOutcome, type ClientFrame, type ClientInput, type ClientStore, type ClientTransport, type ConnDescriptor, type ConnView, type Contract, type DataOf, type Directional, type EmitData, type ErrFrame, type ErrorCode, type EventData, type Events, type EvtFrame, type Frame, type Handshake, INSPECTOR_ROLE, INSPECTOR_SUBPROTOCOL, type InferIn, type InferOut, type InspectedContract, type InspectedDirectional, type InspectedMessage, InspectorContract, type InspectorEvent, type MessageFlavor, type NodeStat, type NodeView, type Output, PROTOCOL, type Perms, type PingFrame, type PongFrame, type PresenceStore, type Principal, type PubFrame, type RawConn, type ReqFrame, type RequestDef, type Requests, type ResFrame, type Resource, type ResourceReplica, type RoleBlock, type RoleOf, type RoleRequests, type RoleTopics, type SChangeFrame, type SCloseFrame, type SErrFrame, type SOpenFrame, type SReadFrame, type SReqFrame, type SResFrame, type SWriteFrame, type Schema, type SchemaConverter, type Serializer, type ServerEntry, type ServerFrame, type ServerInput, type ServerMessageDef, type ServerMessages, type ServerReplica, type ServerRequestDef, type ServerRequests, type ServerStore, type ServerTransport, type SharedEvents, type SharedRequests, type SharedServerRequests, type SharedTopics, type StoreChange, type SubFrame, SuperLineError, type SuperLineErrorCode, type Topics, type UnsubFrame, classifyContract, defineContract, jsonSerializer, removeAtPath, validate, validateSync };
|
|
859
|
+
export { type AccessRules, type Adapter, type AnyData, type AuthOutcome, type ClientFrame, type ClientInput, type ClientStore, type ClientTransport, type ConnDescriptor, type ConnView, type Contract, type DataOf, type Directional, type EmitData, type ErrFrame, type ErrorCode, type EventData, type Events, type EvtFrame, type Frame, type Handshake, INSPECTOR_ROLE, INSPECTOR_SUBPROTOCOL, type InferIn, type InferOut, type InspectedContract, type InspectedDirectional, type InspectedMessage, InspectorContract, type InspectorEvent, type MessageFlavor, type NodeStat, type NodeView, type Output, PROTOCOL, type Perms, type PingFrame, type PongFrame, type PresenceStore, type Principal, type PubFrame, type RawConn, type ReqFrame, type RequestDef, type Requests, type ResFrame, type Resource, type ResourceReplica, type RoleBlock, type RoleOf, type RoleRequests, type RoleTopics, type SChangeFrame, type SCloseFrame, type SErrFrame, type SOpenFrame, type SReadFrame, type SReqFrame, type SResFrame, type SWriteFrame, type Schema, type SchemaConverter, type Serializer, type ServerEntry, type ServerFrame, type ServerInput, type ServerMessageDef, type ServerMessages, type ServerReplica, type ServerRequestDef, type ServerRequests, type ServerStore, type ServerTransport, type SharedEvents, type SharedRequests, type SharedServerRequests, type SharedTopics, type StoreChange, type StoreInfo, type StoreResourceView, type SubFrame, SuperLineError, type SuperLineErrorCode, type Topics, type UnsubFrame, classifyContract, defineContract, jsonSerializer, removeAtPath, validate, validateSync };
|
package/dist/index.js
CHANGED
|
@@ -67,7 +67,10 @@ var InspectorContract = defineContract({
|
|
|
67
67
|
getTopology: { input: s(), output: s() },
|
|
68
68
|
listConnections: { input: s(), output: s() },
|
|
69
69
|
getNode: { input: s(), output: s() },
|
|
70
|
-
getConn: { input: s(), output: s() }
|
|
70
|
+
getConn: { input: s(), output: s() },
|
|
71
|
+
listStores: { input: s(), output: s() },
|
|
72
|
+
listResources: { input: s(), output: s() },
|
|
73
|
+
readResource: { input: s(), output: s() }
|
|
71
74
|
},
|
|
72
75
|
serverToClient: {
|
|
73
76
|
events: { payload: s(), subscribe: true }
|