@graview/core 0.1.2 → 0.1.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/dist/app.d.ts +9 -1
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js.map +1 -1
- package/dist/capabilities.js +1 -1
- package/dist/capabilities.js.map +1 -1
- package/dist/cli/check/policy.d.ts.map +1 -1
- package/dist/cli/check/policy.js +40 -0
- package/dist/cli/check/policy.js.map +1 -1
- package/dist/cli/index.d.ts +2 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/document/canonical.d.ts +2 -1
- package/dist/document/canonical.d.ts.map +1 -1
- package/dist/document/canonical.js +2 -1
- package/dist/document/canonical.js.map +1 -1
- package/dist/document/compile.d.ts.map +1 -1
- package/dist/document/compile.js +22 -2
- package/dist/document/compile.js.map +1 -1
- package/dist/document/diff.d.ts.map +1 -1
- package/dist/document/diff.js +8 -1
- package/dist/document/diff.js.map +1 -1
- package/dist/document/edit.d.ts +7 -1
- package/dist/document/edit.d.ts.map +1 -1
- package/dist/document/edit.js +58 -2
- package/dist/document/edit.js.map +1 -1
- package/dist/document/index.d.ts +1 -1
- package/dist/document/index.d.ts.map +1 -1
- package/dist/document/migrate.d.ts.map +1 -1
- package/dist/document/migrate.js +3 -2
- package/dist/document/migrate.js.map +1 -1
- package/dist/document/patch.d.ts.map +1 -1
- package/dist/document/patch.js +2 -5
- package/dist/document/patch.js.map +1 -1
- package/dist/document/schema.d.ts +12 -10
- package/dist/document/schema.d.ts.map +1 -1
- package/dist/document/schema.js +2 -0
- package/dist/document/schema.js.map +1 -1
- package/dist/document/to-document.d.ts.map +1 -1
- package/dist/document/to-document.js +5 -1
- package/dist/document/to-document.js.map +1 -1
- package/dist/graph/graph.d.ts +9 -0
- package/dist/graph/graph.d.ts.map +1 -1
- package/dist/graph/graph.js +18 -4
- package/dist/graph/graph.js.map +1 -1
- package/dist/index.d.ts +11 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/dist/integrity.d.ts.map +1 -1
- package/dist/integrity.js +35 -5
- package/dist/integrity.js.map +1 -1
- package/dist/invariants/types.d.ts +1 -1
- package/dist/invariants/types.d.ts.map +1 -1
- package/dist/labels.js +1 -1
- package/dist/labels.js.map +1 -1
- package/dist/mutations/define-mutation.d.ts +22 -2
- package/dist/mutations/define-mutation.d.ts.map +1 -1
- package/dist/mutations/define-mutation.js +21 -8
- package/dist/mutations/define-mutation.js.map +1 -1
- package/dist/mutations/node-ref.d.ts +5 -2
- package/dist/mutations/node-ref.d.ts.map +1 -1
- package/dist/mutations/node-ref.js +28 -7
- package/dist/mutations/node-ref.js.map +1 -1
- package/dist/mutations/types.d.ts +2 -2
- package/dist/mutations/types.d.ts.map +1 -1
- package/dist/ops/log.d.ts +22 -0
- package/dist/ops/log.d.ts.map +1 -1
- package/dist/ops/log.js +14 -0
- package/dist/ops/log.js.map +1 -1
- package/dist/ops/served.d.ts +80 -0
- package/dist/ops/served.d.ts.map +1 -0
- package/dist/ops/served.js +316 -0
- package/dist/ops/served.js.map +1 -0
- package/dist/ops/types.d.ts +8 -0
- package/dist/ops/types.d.ts.map +1 -1
- package/dist/ops/undo.d.ts +6 -0
- package/dist/ops/undo.d.ts.map +1 -1
- package/dist/ops/undo.js +3 -0
- package/dist/ops/undo.js.map +1 -1
- package/dist/ops/withheld.d.ts +63 -8
- package/dist/ops/withheld.d.ts.map +1 -1
- package/dist/ops/withheld.js +198 -22
- package/dist/ops/withheld.js.map +1 -1
- package/dist/ops/writers.d.ts +29 -0
- package/dist/ops/writers.d.ts.map +1 -0
- package/dist/ops/writers.js +98 -0
- package/dist/ops/writers.js.map +1 -0
- package/dist/permissions/sight.d.ts +33 -4
- package/dist/permissions/sight.d.ts.map +1 -1
- package/dist/permissions/sight.js +106 -22
- package/dist/permissions/sight.js.map +1 -1
- package/dist/presence.d.ts +48 -1
- package/dist/presence.d.ts.map +1 -1
- package/dist/presence.js +51 -2
- package/dist/presence.js.map +1 -1
- package/dist/refusal.d.ts +38 -0
- package/dist/refusal.d.ts.map +1 -0
- package/dist/refusal.js +44 -0
- package/dist/refusal.js.map +1 -0
- package/dist/schema/json-schema.d.ts.map +1 -1
- package/dist/schema/json-schema.js +27 -1
- package/dist/schema/json-schema.js.map +1 -1
- package/dist/schema/schema.d.ts +19 -4
- package/dist/schema/schema.d.ts.map +1 -1
- package/dist/schema/schema.js.map +1 -1
- package/dist/schema/types.d.ts +11 -0
- package/dist/schema/types.d.ts.map +1 -1
- package/dist/seen.d.ts +60 -1
- package/dist/seen.d.ts.map +1 -1
- package/dist/seen.js +467 -29
- package/dist/seen.js.map +1 -1
- package/dist/store.d.ts +151 -10
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +228 -40
- package/dist/store.js.map +1 -1
- package/dist/testing.js.map +1 -1
- package/dist/validate-graph.d.ts +2 -1
- package/dist/validate-graph.d.ts.map +1 -1
- package/dist/validate-graph.js +8 -1
- package/dist/validate-graph.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
package/dist/seen.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
import type { GraphDiff } from "./graph/diff.js";
|
|
2
|
+
import type { GraphNodeBase } from "./graph/types.js";
|
|
3
|
+
import type { GraphEdge } from "./graph/types.js";
|
|
4
|
+
import type { Violation } from "./invariants/types.js";
|
|
1
5
|
import { type LogReading } from "./ops/log.js";
|
|
2
6
|
import type { Operation } from "./ops/types.js";
|
|
7
|
+
import { type SeatLens } from "./ops/withheld.js";
|
|
3
8
|
import type { Policy, Principal } from "./permissions/types.js";
|
|
4
9
|
import type { AnySchema } from "./schema/schema.js";
|
|
5
10
|
import type { Store } from "./store.js";
|
|
@@ -17,12 +22,21 @@ interface Judged {
|
|
|
17
22
|
in(id: string): readonly {
|
|
18
23
|
readonly id: string;
|
|
19
24
|
}[];
|
|
25
|
+
/** A store's own graph says its links, so an op can be judged where it stood (FR-55). */
|
|
26
|
+
outEdges?(id: string): readonly GraphEdge[];
|
|
27
|
+
inEdges?(id: string): readonly GraphEdge[];
|
|
20
28
|
};
|
|
21
29
|
readonly log: LogReading;
|
|
22
30
|
/** The kinds of the modules this workspace has off (FR-12), kept from every seat as a sight keeps a record. */
|
|
23
31
|
readonly modules?: {
|
|
24
32
|
readonly disabledKinds: ReadonlySet<string>;
|
|
25
33
|
};
|
|
34
|
+
/** The declaration, to say which of a kind's fields a record may be served without (FR-55). */
|
|
35
|
+
readonly schema?: {
|
|
36
|
+
tryDefinition(kind: string): {
|
|
37
|
+
readonly fields: unknown;
|
|
38
|
+
} | undefined;
|
|
39
|
+
};
|
|
26
40
|
}
|
|
27
41
|
/**
|
|
28
42
|
* WHETHER ANYTHING IS KEPT FROM THIS SEAT: a sight the policy declares
|
|
@@ -35,10 +49,55 @@ export declare function hidesFrom(store: Judged, principal: Principal): boolean;
|
|
|
35
49
|
* now; one since removed by the kind the log says it was, and so never by
|
|
36
50
|
* an edge it no longer has; and a string that names no record at all (a
|
|
37
51
|
* label in a call's arguments) is nothing to keep from anybody.
|
|
52
|
+
*
|
|
53
|
+
* THE JUDGEMENT FOLLOWS THE STORE (FR-51). It reads the policy, the
|
|
54
|
+
* modules that are off and who made each record as it is asked, not as it
|
|
55
|
+
* was taken: one taken before a commit and asked after it knows the record
|
|
56
|
+
* just made is its maker's own. Asking costs nothing more for that — who
|
|
57
|
+
* made what is an index the log keeps as it goes (`recordsOf`).
|
|
38
58
|
*/
|
|
39
59
|
export declare function seesId(store: Judged, principal: Principal): (id: string) => boolean;
|
|
40
|
-
/**
|
|
60
|
+
/**
|
|
61
|
+
* WHAT ONE SEAT IS SERVED (FR-55) — the judgement every surface built on
|
|
62
|
+
* the seat view reads, so a snapshot, a log, an answer and the wire cannot
|
|
63
|
+
* disagree about it.
|
|
64
|
+
*
|
|
65
|
+
* Its sight (`seesId`) says which records it may be told of. An id is
|
|
66
|
+
* minted from a label, so a seen record's field that holds the id of one
|
|
67
|
+
* it may not see tells it that record's name: such a field is CLEARED in
|
|
68
|
+
* what the seat is served — the record stays, usable, without it — when
|
|
69
|
+
* the kind's declaration lets a record be without it. When the field is
|
|
70
|
+
* one the record cannot do without, clearing it would serve a record that
|
|
71
|
+
* fails its own declaration, and a client refuses to load that: the record
|
|
72
|
+
* is WITHHELD from the seat whole instead, as if its sight did not reach
|
|
73
|
+
* it — not in the graph, the snapshot, the log's primitives or an edge.
|
|
74
|
+
* Which ids a field names is judged by the seat's sight alone, so a record
|
|
75
|
+
* naming one withheld this way still names a record the seat may see.
|
|
76
|
+
*/
|
|
77
|
+
export declare function seatLens(store: Judged, principal: Principal): SeatLens;
|
|
78
|
+
/** The store's log as one seat may read it: every op in its place, the ones it may not see withheld (FR-16), and no id it may not see in any of them (FR-55). */
|
|
41
79
|
export declare function logSeenBy(store: Judged, principal: Principal): readonly Operation[];
|
|
80
|
+
/**
|
|
81
|
+
* A CHANGE'S ANSWER AS ONE SEAT MAY BE TOLD IT (FR-55) — the diff, the
|
|
82
|
+
* primitives, the ops and the rules it would break or mend of a preview,
|
|
83
|
+
* an apply or an undo, for a surface that hands a seat what its own act
|
|
84
|
+
* did: an act may touch what its own seat may not see. Records and edges
|
|
85
|
+
* it is not served go, a field naming one it may not see is cleared as
|
|
86
|
+
* the view clears it, the ops are redacted as its log is, and a sentence
|
|
87
|
+
* that names what it may not see says only that a change it cannot see
|
|
88
|
+
* happened. With nothing kept from the seat, the answer as it is.
|
|
89
|
+
*/
|
|
90
|
+
export declare function answerSeenBy<A extends {
|
|
91
|
+
readonly diff?: GraphDiff<GraphNodeBase>;
|
|
92
|
+
readonly primitives?: readonly unknown[];
|
|
93
|
+
readonly reads?: readonly string[];
|
|
94
|
+
readonly writes?: readonly string[];
|
|
95
|
+
readonly intent?: string;
|
|
96
|
+
readonly introduces?: readonly Violation[];
|
|
97
|
+
readonly resolves?: readonly Violation[];
|
|
98
|
+
readonly violationsAfter?: readonly Violation[];
|
|
99
|
+
readonly ops?: readonly Operation[];
|
|
100
|
+
}>(store: Judged, principal: Principal, answer: A): A;
|
|
42
101
|
/** A log reading over a seat's redacted ops, for `checkUndo`. */
|
|
43
102
|
export declare function readingOf(ops: readonly Operation[], epochs: LogReading["epochs"]): LogReading;
|
|
44
103
|
/**
|
package/dist/seen.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seen.d.ts","sourceRoot":"","sources":["../src/seen.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"seen.d.ts","sourceRoot":"","sources":["../src/seen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAc,MAAM,iBAAiB,CAAC;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,KAAK,EAAgB,SAAS,EAAiB,MAAM,kBAAkB,CAAC;AAC/E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAuB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAEpE,OAAO,KAAK,EAAS,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGvD,OAAO,EAAwC,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAGxF,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC,qFAAqF;AACrF,UAAU,MAAM;IACd,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE;QACd,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG;YAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,IAAI,EA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