@graview/core 0.1.0 → 0.1.3
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/README.md +7 -0
- package/dist/app.d.ts +17 -0
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js.map +1 -1
- package/dist/arrange.d.ts +3 -2
- package/dist/arrange.d.ts.map +1 -1
- package/dist/arrange.js +19 -2
- package/dist/arrange.js.map +1 -1
- package/dist/beginning.d.ts +5 -2
- package/dist/beginning.d.ts.map +1 -1
- package/dist/beginning.js +28 -0
- package/dist/beginning.js.map +1 -1
- package/dist/capabilities.d.ts +32 -0
- package/dist/capabilities.d.ts.map +1 -0
- package/dist/capabilities.js +31 -0
- package/dist/capabilities.js.map +1 -0
- package/dist/cli/check/index.d.ts +1 -0
- package/dist/cli/check/index.d.ts.map +1 -1
- package/dist/cli/check/index.js +1 -0
- package/dist/cli/check/index.js.map +1 -1
- package/dist/cli/check/lenses.d.ts.map +1 -1
- package/dist/cli/check/lenses.js +25 -0
- package/dist/cli/check/lenses.js.map +1 -1
- package/dist/cli/check/policy.d.ts.map +1 -1
- package/dist/cli/check/policy.js +35 -0
- package/dist/cli/check/policy.js.map +1 -1
- package/dist/cli/check/relations.d.ts.map +1 -1
- package/dist/cli/check/relations.js +31 -0
- package/dist/cli/check/relations.js.map +1 -1
- package/dist/cli/check/views.d.ts +14 -0
- package/dist/cli/check/views.d.ts.map +1 -0
- package/dist/cli/check/views.js +27 -0
- package/dist/cli/check/views.js.map +1 -0
- package/dist/cli/check.d.ts.map +1 -1
- package/dist/cli/check.js +2 -1
- package/dist/cli/check.js.map +1 -1
- package/dist/cli/create.d.ts +1 -1
- package/dist/cli/create.d.ts.map +1 -1
- package/dist/cli/create.js +63 -1
- package/dist/cli/create.js.map +1 -1
- package/dist/cli/index.d.ts +18 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +66 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/conformance/fixtures.d.ts +41 -0
- package/dist/conformance/fixtures.d.ts.map +1 -0
- package/dist/conformance/fixtures.js +950 -0
- package/dist/conformance/fixtures.js.map +1 -0
- package/dist/conformance/index.d.ts +54 -0
- package/dist/conformance/index.d.ts.map +1 -0
- package/dist/conformance/index.js +81 -0
- package/dist/conformance/index.js.map +1 -0
- package/dist/document/canonical.d.ts +4 -0
- package/dist/document/canonical.d.ts.map +1 -0
- package/dist/document/canonical.js +29 -0
- package/dist/document/canonical.js.map +1 -0
- package/dist/document/compile.d.ts +43 -0
- package/dist/document/compile.d.ts.map +1 -0
- package/dist/document/compile.js +807 -0
- package/dist/document/compile.js.map +1 -0
- package/dist/document/diff.d.ts +32 -0
- package/dist/document/diff.d.ts.map +1 -0
- package/dist/document/diff.js +148 -0
- package/dist/document/diff.js.map +1 -0
- package/dist/document/edit.d.ts +63 -0
- package/dist/document/edit.d.ts.map +1 -0
- package/dist/document/edit.js +1432 -0
- package/dist/document/edit.js.map +1 -0
- package/dist/document/expr/analyze.d.ts +14 -0
- package/dist/document/expr/analyze.d.ts.map +1 -0
- package/dist/document/expr/analyze.js +52 -0
- package/dist/document/expr/analyze.js.map +1 -0
- package/dist/document/expr/evaluate.d.ts +36 -0
- package/dist/document/expr/evaluate.d.ts.map +1 -0
- package/dist/document/expr/evaluate.js +344 -0
- package/dist/document/expr/evaluate.js.map +1 -0
- package/dist/document/expr/index.d.ts +8 -0
- package/dist/document/expr/index.d.ts.map +1 -0
- package/dist/document/expr/index.js +5 -0
- package/dist/document/expr/index.js.map +1 -0
- package/dist/document/expr/parse.d.ts +50 -0
- package/dist/document/expr/parse.d.ts.map +1 -0
- package/dist/document/expr/parse.js +240 -0
- package/dist/document/expr/parse.js.map +1 -0
- package/dist/document/expr/print.d.ts +4 -0
- package/dist/document/expr/print.d.ts.map +1 -0
- package/dist/document/expr/print.js +81 -0
- package/dist/document/expr/print.js.map +1 -0
- package/dist/document/findings.d.ts +15 -0
- package/dist/document/findings.d.ts.map +1 -0
- package/dist/document/findings.js +30 -0
- package/dist/document/findings.js.map +1 -0
- package/dist/document/graview-template.d.ts +148 -0
- package/dist/document/graview-template.d.ts.map +1 -0
- package/dist/document/graview-template.js +450 -0
- package/dist/document/graview-template.js.map +1 -0
- package/dist/document/index.d.ts +27 -0
- package/dist/document/index.d.ts.map +1 -0
- package/dist/document/index.js +16 -0
- package/dist/document/index.js.map +1 -0
- package/dist/document/migrate.d.ts +41 -0
- package/dist/document/migrate.d.ts.map +1 -0
- package/dist/document/migrate.js +252 -0
- package/dist/document/migrate.js.map +1 -0
- package/dist/document/patch.d.ts +16 -0
- package/dist/document/patch.d.ts.map +1 -0
- package/dist/document/patch.js +79 -0
- package/dist/document/patch.js.map +1 -0
- package/dist/document/rules.d.ts +40 -0
- package/dist/document/rules.d.ts.map +1 -0
- package/dist/document/rules.js +88 -0
- package/dist/document/rules.js.map +1 -0
- package/dist/document/schema.d.ts +461 -0
- package/dist/document/schema.d.ts.map +1 -0
- package/dist/document/schema.js +199 -0
- package/dist/document/schema.js.map +1 -0
- package/dist/document/template.d.ts +28 -0
- package/dist/document/template.d.ts.map +1 -0
- package/dist/document/template.js +117 -0
- package/dist/document/template.js.map +1 -0
- package/dist/document/to-document.d.ts +34 -0
- package/dist/document/to-document.d.ts.map +1 -0
- package/dist/document/to-document.js +186 -0
- package/dist/document/to-document.js.map +1 -0
- package/dist/document/upgrade.d.ts +9 -0
- package/dist/document/upgrade.d.ts.map +1 -0
- package/dist/document/upgrade.js +19 -0
- package/dist/document/upgrade.js.map +1 -0
- package/dist/document/views.d.ts +65 -0
- package/dist/document/views.d.ts.map +1 -0
- package/dist/document/views.js +264 -0
- package/dist/document/views.js.map +1 -0
- package/dist/formats.d.ts +50 -0
- package/dist/formats.d.ts.map +1 -0
- package/dist/formats.js +75 -0
- package/dist/formats.js.map +1 -0
- package/dist/graph/graph.d.ts +61 -3
- package/dist/graph/graph.d.ts.map +1 -1
- package/dist/graph/graph.js +187 -20
- package/dist/graph/graph.js.map +1 -1
- package/dist/index.d.ts +43 -18
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +31 -11
- package/dist/index.js.map +1 -1
- package/dist/integrity.d.ts +46 -0
- package/dist/integrity.d.ts.map +1 -0
- package/dist/integrity.js +179 -0
- package/dist/integrity.js.map +1 -0
- package/dist/invariants/engine.d.ts +8 -0
- package/dist/invariants/engine.d.ts.map +1 -1
- package/dist/invariants/engine.js +40 -2
- package/dist/invariants/engine.js.map +1 -1
- package/dist/invariants/types.d.ts +19 -0
- package/dist/invariants/types.d.ts.map +1 -1
- package/dist/labels.d.ts +65 -0
- package/dist/labels.d.ts.map +1 -0
- package/dist/labels.js +123 -0
- package/dist/labels.js.map +1 -0
- package/dist/mutations/define-mutation.d.ts.map +1 -1
- package/dist/mutations/define-mutation.js +5 -6
- package/dist/mutations/define-mutation.js.map +1 -1
- package/dist/mutations/derive-edits.d.ts.map +1 -1
- package/dist/mutations/derive-edits.js +20 -1
- package/dist/mutations/derive-edits.js.map +1 -1
- package/dist/mutations/form.d.ts +9 -0
- package/dist/mutations/form.d.ts.map +1 -1
- package/dist/mutations/form.js +20 -0
- package/dist/mutations/form.js.map +1 -1
- package/dist/mutations/node-ref.d.ts +6 -0
- package/dist/mutations/node-ref.d.ts.map +1 -1
- package/dist/mutations/node-ref.js +22 -8
- package/dist/mutations/node-ref.js.map +1 -1
- package/dist/mutations/types.d.ts +8 -0
- package/dist/mutations/types.d.ts.map +1 -1
- package/dist/mutations/words.d.ts +49 -0
- package/dist/mutations/words.d.ts.map +1 -0
- package/dist/mutations/words.js +61 -0
- package/dist/mutations/words.js.map +1 -0
- package/dist/ops/log.d.ts +156 -4
- package/dist/ops/log.d.ts.map +1 -1
- package/dist/ops/log.js +234 -51
- package/dist/ops/log.js.map +1 -1
- package/dist/ops/revisions.d.ts +66 -0
- package/dist/ops/revisions.d.ts.map +1 -0
- package/dist/ops/revisions.js +97 -0
- package/dist/ops/revisions.js.map +1 -0
- package/dist/ops/types.d.ts +49 -1
- package/dist/ops/types.d.ts.map +1 -1
- package/dist/ops/undo.d.ts +29 -2
- package/dist/ops/undo.d.ts.map +1 -1
- package/dist/ops/undo.js +110 -1
- package/dist/ops/undo.js.map +1 -1
- package/dist/ops/withheld.d.ts +37 -0
- package/dist/ops/withheld.d.ts.map +1 -0
- package/dist/ops/withheld.js +84 -0
- package/dist/ops/withheld.js.map +1 -0
- package/dist/permissions/policy.d.ts +15 -0
- package/dist/permissions/policy.d.ts.map +1 -1
- package/dist/permissions/policy.js +28 -1
- package/dist/permissions/policy.js.map +1 -1
- package/dist/permissions/sight.d.ts +66 -0
- package/dist/permissions/sight.d.ts.map +1 -0
- package/dist/permissions/sight.js +131 -0
- package/dist/permissions/sight.js.map +1 -0
- package/dist/permissions/types.d.ts +26 -0
- package/dist/permissions/types.d.ts.map +1 -1
- package/dist/permissions/types.js.map +1 -1
- package/dist/persistence/memory.d.ts.map +1 -1
- package/dist/persistence/memory.js +25 -0
- package/dist/persistence/memory.js.map +1 -1
- package/dist/persistence/sql.d.ts +43 -0
- package/dist/persistence/sql.d.ts.map +1 -0
- package/dist/persistence/sql.js +154 -0
- package/dist/persistence/sql.js.map +1 -0
- package/dist/persistence/sqlite.d.ts +17 -3
- package/dist/persistence/sqlite.d.ts.map +1 -1
- package/dist/persistence/sqlite.js +32 -96
- package/dist/persistence/sqlite.js.map +1 -1
- package/dist/persistence/types.d.ts +19 -0
- package/dist/persistence/types.d.ts.map +1 -1
- package/dist/presence.d.ts +56 -0
- package/dist/presence.d.ts.map +1 -1
- package/dist/presence.js +62 -2
- package/dist/presence.js.map +1 -1
- package/dist/refusal.d.ts +34 -0
- package/dist/refusal.d.ts.map +1 -0
- package/dist/refusal.js +40 -0
- package/dist/refusal.js.map +1 -0
- package/dist/scaffold/from-template.d.ts +16 -0
- package/dist/scaffold/from-template.d.ts.map +1 -0
- package/dist/scaffold/from-template.js +157 -0
- package/dist/scaffold/from-template.js.map +1 -0
- package/dist/scaffold/index.d.ts +10 -1
- package/dist/scaffold/index.d.ts.map +1 -1
- package/dist/scaffold/index.js +35 -7
- package/dist/scaffold/index.js.map +1 -1
- package/dist/scaffold/names.d.ts +4 -0
- package/dist/scaffold/names.d.ts.map +1 -1
- package/dist/scaffold/names.js.map +1 -1
- package/dist/scaffold/project.d.ts +1 -1
- package/dist/scaffold/project.d.ts.map +1 -1
- package/dist/scaffold/project.js +44 -13
- package/dist/scaffold/project.js.map +1 -1
- package/dist/scaffold/ui.d.ts.map +1 -1
- package/dist/scaffold/ui.js +19 -10
- package/dist/scaffold/ui.js.map +1 -1
- package/dist/schema/define-node.d.ts +20 -0
- package/dist/schema/define-node.d.ts.map +1 -1
- package/dist/schema/define-node.js +27 -2
- package/dist/schema/define-node.js.map +1 -1
- package/dist/schema/path.d.ts +19 -0
- package/dist/schema/path.d.ts.map +1 -0
- package/dist/schema/path.js +34 -0
- package/dist/schema/path.js.map +1 -0
- package/dist/schema/types.d.ts +17 -0
- package/dist/schema/types.d.ts.map +1 -1
- package/dist/seen.d.ts +64 -0
- package/dist/seen.d.ts.map +1 -0
- package/dist/seen.js +200 -0
- package/dist/seen.js.map +1 -0
- package/dist/store.d.ts +378 -8
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +801 -41
- package/dist/store.js.map +1 -1
- package/dist/testing.d.ts +6 -0
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +3 -1
- package/dist/testing.js.map +1 -1
- package/dist/theme/palettes.d.ts.map +1 -1
- package/dist/theme/palettes.js +4 -0
- package/dist/theme/palettes.js.map +1 -1
- package/dist/theme/types.d.ts +9 -0
- package/dist/theme/types.d.ts.map +1 -1
- package/dist/theme/types.js +4 -0
- package/dist/theme/types.js.map +1 -1
- package/dist/validate-graph.d.ts +84 -0
- package/dist/validate-graph.d.ts.map +1 -0
- package/dist/validate-graph.js +295 -0
- package/dist/validate-graph.js.map +1 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +3 -0
- package/dist/version.js.map +1 -0
- package/dist/views/types.d.ts +8 -0
- package/dist/views/types.d.ts.map +1 -1
- package/dist/views/types.js +5 -0
- package/dist/views/types.js.map +1 -1
- package/dist/watched.d.ts +39 -0
- package/dist/watched.d.ts.map +1 -1
- package/dist/watched.js +94 -1
- package/dist/watched.js.map +1 -1
- package/dist/who.d.ts +24 -1
- package/dist/who.d.ts.map +1 -1
- package/dist/who.js +49 -2
- package/dist/who.js.map +1 -1
- package/package.json +9 -1
|
@@ -0,0 +1,461 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const FORMAT = "graview-document";
|
|
3
|
+
export declare const FORMAT_VERSION = 1;
|
|
4
|
+
export declare const MAX_DOCUMENT_BYTES: number;
|
|
5
|
+
/** kebab-case: kinds, acts, rules, edges, roles, modules. */
|
|
6
|
+
export declare const NAME: RegExp;
|
|
7
|
+
/** Field names are identifiers so a rule can say them bare: `quote != null`. */
|
|
8
|
+
export declare const FIELD_NAME: RegExp;
|
|
9
|
+
/**
|
|
10
|
+
* A RELATION'S NAME may be kebab-case or one camelCase word. camelCase is
|
|
11
|
+
* recommended: a rule can then walk it bare (`tendedBy.name`), where
|
|
12
|
+
* `tended-by.name` would read as a subtraction.
|
|
13
|
+
*/
|
|
14
|
+
export declare const EDGE_NAME: RegExp;
|
|
15
|
+
export declare const FIELD_TYPES: readonly ["string", "text", "number", "integer", "boolean", "date", "datetime", "enum", "list", "url", "email"];
|
|
16
|
+
export type FieldType = (typeof FIELD_TYPES)[number];
|
|
17
|
+
export declare const FieldSpec: z.ZodObject<{
|
|
18
|
+
type: z.ZodEnum<{
|
|
19
|
+
string: "string";
|
|
20
|
+
number: "number";
|
|
21
|
+
boolean: "boolean";
|
|
22
|
+
text: "text";
|
|
23
|
+
date: "date";
|
|
24
|
+
enum: "enum";
|
|
25
|
+
list: "list";
|
|
26
|
+
email: "email";
|
|
27
|
+
integer: "integer";
|
|
28
|
+
datetime: "datetime";
|
|
29
|
+
url: "url";
|
|
30
|
+
}>;
|
|
31
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
32
|
+
description: z.ZodOptional<z.ZodString>;
|
|
33
|
+
label: z.ZodOptional<z.ZodString>;
|
|
34
|
+
options: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
35
|
+
of: z.ZodOptional<z.ZodEnum<{
|
|
36
|
+
string: "string";
|
|
37
|
+
number: "number";
|
|
38
|
+
date: "date";
|
|
39
|
+
}>>;
|
|
40
|
+
default: z.ZodOptional<z.ZodUnknown>;
|
|
41
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
42
|
+
format: z.ZodOptional<z.ZodEnum<{
|
|
43
|
+
money: "money";
|
|
44
|
+
percent: "percent";
|
|
45
|
+
duration: "duration";
|
|
46
|
+
}>>;
|
|
47
|
+
renamedFrom: z.ZodOptional<z.ZodString>;
|
|
48
|
+
}, z.core.$strict>;
|
|
49
|
+
export type FieldSpec = z.infer<typeof FieldSpec>;
|
|
50
|
+
export declare const EdgeSpec: z.ZodObject<{
|
|
51
|
+
to: z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodLiteral<"*">]>;
|
|
52
|
+
cardinality: z.ZodOptional<z.ZodEnum<{
|
|
53
|
+
one: "one";
|
|
54
|
+
many: "many";
|
|
55
|
+
}>>;
|
|
56
|
+
description: z.ZodOptional<z.ZodString>;
|
|
57
|
+
inverse: z.ZodOptional<z.ZodString>;
|
|
58
|
+
appendOnly: z.ZodOptional<z.ZodBoolean>;
|
|
59
|
+
renamedFrom: z.ZodOptional<z.ZodString>;
|
|
60
|
+
}, z.core.$strict>;
|
|
61
|
+
export type EdgeSpec = z.infer<typeof EdgeSpec>;
|
|
62
|
+
export declare const KindSpec: z.ZodObject<{
|
|
63
|
+
noun: z.ZodOptional<z.ZodString>;
|
|
64
|
+
plural: z.ZodOptional<z.ZodString>;
|
|
65
|
+
description: z.ZodOptional<z.ZodString>;
|
|
66
|
+
fields: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
67
|
+
type: z.ZodEnum<{
|
|
68
|
+
string: "string";
|
|
69
|
+
number: "number";
|
|
70
|
+
boolean: "boolean";
|
|
71
|
+
text: "text";
|
|
72
|
+
date: "date";
|
|
73
|
+
enum: "enum";
|
|
74
|
+
list: "list";
|
|
75
|
+
email: "email";
|
|
76
|
+
integer: "integer";
|
|
77
|
+
datetime: "datetime";
|
|
78
|
+
url: "url";
|
|
79
|
+
}>;
|
|
80
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
81
|
+
description: z.ZodOptional<z.ZodString>;
|
|
82
|
+
label: z.ZodOptional<z.ZodString>;
|
|
83
|
+
options: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
84
|
+
of: z.ZodOptional<z.ZodEnum<{
|
|
85
|
+
string: "string";
|
|
86
|
+
number: "number";
|
|
87
|
+
date: "date";
|
|
88
|
+
}>>;
|
|
89
|
+
default: z.ZodOptional<z.ZodUnknown>;
|
|
90
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
91
|
+
format: z.ZodOptional<z.ZodEnum<{
|
|
92
|
+
money: "money";
|
|
93
|
+
percent: "percent";
|
|
94
|
+
duration: "duration";
|
|
95
|
+
}>>;
|
|
96
|
+
renamedFrom: z.ZodOptional<z.ZodString>;
|
|
97
|
+
}, z.core.$strict>>;
|
|
98
|
+
label: z.ZodOptional<z.ZodString>;
|
|
99
|
+
describe: z.ZodOptional<z.ZodString>;
|
|
100
|
+
lifecycle: z.ZodOptional<z.ZodObject<{
|
|
101
|
+
field: z.ZodString;
|
|
102
|
+
retired: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
103
|
+
}, z.core.$strict>>;
|
|
104
|
+
figure: z.ZodOptional<z.ZodString>;
|
|
105
|
+
glance: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
106
|
+
edges: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
107
|
+
to: z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodLiteral<"*">]>;
|
|
108
|
+
cardinality: z.ZodOptional<z.ZodEnum<{
|
|
109
|
+
one: "one";
|
|
110
|
+
many: "many";
|
|
111
|
+
}>>;
|
|
112
|
+
description: z.ZodOptional<z.ZodString>;
|
|
113
|
+
inverse: z.ZodOptional<z.ZodString>;
|
|
114
|
+
appendOnly: z.ZodOptional<z.ZodBoolean>;
|
|
115
|
+
renamedFrom: z.ZodOptional<z.ZodString>;
|
|
116
|
+
}, z.core.$strict>>>;
|
|
117
|
+
renamedFrom: z.ZodOptional<z.ZodString>;
|
|
118
|
+
}, z.core.$strict>;
|
|
119
|
+
export type KindSpec = z.infer<typeof KindSpec>;
|
|
120
|
+
/** A value an effect writes: a literal, `$arg`, `$subject`, `$new`, `$now`, `$today`, or `{ expr }`. */
|
|
121
|
+
export declare const ValueSpec: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodArray<z.ZodUnknown>, z.ZodObject<{
|
|
122
|
+
expr: z.ZodString;
|
|
123
|
+
}, z.core.$strict>]>;
|
|
124
|
+
export type ValueSpec = z.infer<typeof ValueSpec>;
|
|
125
|
+
export declare const EffectSpec: z.ZodUnion<readonly [z.ZodObject<{
|
|
126
|
+
create: z.ZodString;
|
|
127
|
+
as: z.ZodOptional<z.ZodString>;
|
|
128
|
+
set: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodArray<z.ZodUnknown>, z.ZodObject<{
|
|
129
|
+
expr: z.ZodString;
|
|
130
|
+
}, z.core.$strict>]>>>;
|
|
131
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
132
|
+
set: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodArray<z.ZodUnknown>, z.ZodObject<{
|
|
133
|
+
expr: z.ZodString;
|
|
134
|
+
}, z.core.$strict>]>>;
|
|
135
|
+
target: z.ZodOptional<z.ZodString>;
|
|
136
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
137
|
+
connect: z.ZodString;
|
|
138
|
+
from: z.ZodString;
|
|
139
|
+
to: z.ZodString;
|
|
140
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
141
|
+
sever: z.ZodString;
|
|
142
|
+
from: z.ZodString;
|
|
143
|
+
to: z.ZodString;
|
|
144
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
145
|
+
remove: z.ZodString;
|
|
146
|
+
}, z.core.$strict>]>;
|
|
147
|
+
export type EffectSpec = z.infer<typeof EffectSpec>;
|
|
148
|
+
export declare const ActSpec: z.ZodObject<{
|
|
149
|
+
title: z.ZodOptional<z.ZodString>;
|
|
150
|
+
description: z.ZodOptional<z.ZodString>;
|
|
151
|
+
fromTheOtherEnd: z.ZodOptional<z.ZodString>;
|
|
152
|
+
on: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
153
|
+
creates: z.ZodOptional<z.ZodString>;
|
|
154
|
+
sets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodArray<z.ZodUnknown>, z.ZodObject<{
|
|
155
|
+
expr: z.ZodString;
|
|
156
|
+
}, z.core.$strict>]>>>;
|
|
157
|
+
writes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
158
|
+
connects: z.ZodOptional<z.ZodString>;
|
|
159
|
+
severs: z.ZodOptional<z.ZodString>;
|
|
160
|
+
removes: z.ZodOptional<z.ZodLiteral<true>>;
|
|
161
|
+
args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
162
|
+
type: z.ZodEnum<{
|
|
163
|
+
string: "string";
|
|
164
|
+
number: "number";
|
|
165
|
+
boolean: "boolean";
|
|
166
|
+
text: "text";
|
|
167
|
+
date: "date";
|
|
168
|
+
enum: "enum";
|
|
169
|
+
list: "list";
|
|
170
|
+
email: "email";
|
|
171
|
+
integer: "integer";
|
|
172
|
+
datetime: "datetime";
|
|
173
|
+
url: "url";
|
|
174
|
+
}>;
|
|
175
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
176
|
+
description: z.ZodOptional<z.ZodString>;
|
|
177
|
+
label: z.ZodOptional<z.ZodString>;
|
|
178
|
+
options: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
179
|
+
of: z.ZodOptional<z.ZodEnum<{
|
|
180
|
+
string: "string";
|
|
181
|
+
number: "number";
|
|
182
|
+
date: "date";
|
|
183
|
+
}>>;
|
|
184
|
+
default: z.ZodOptional<z.ZodUnknown>;
|
|
185
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
186
|
+
format: z.ZodOptional<z.ZodEnum<{
|
|
187
|
+
money: "money";
|
|
188
|
+
percent: "percent";
|
|
189
|
+
duration: "duration";
|
|
190
|
+
}>>;
|
|
191
|
+
renamedFrom: z.ZodOptional<z.ZodString>;
|
|
192
|
+
}, z.core.$strict>>>;
|
|
193
|
+
effects: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
194
|
+
create: z.ZodString;
|
|
195
|
+
as: z.ZodOptional<z.ZodString>;
|
|
196
|
+
set: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodArray<z.ZodUnknown>, z.ZodObject<{
|
|
197
|
+
expr: z.ZodString;
|
|
198
|
+
}, z.core.$strict>]>>>;
|
|
199
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
200
|
+
set: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodArray<z.ZodUnknown>, z.ZodObject<{
|
|
201
|
+
expr: z.ZodString;
|
|
202
|
+
}, z.core.$strict>]>>;
|
|
203
|
+
target: z.ZodOptional<z.ZodString>;
|
|
204
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
205
|
+
connect: z.ZodString;
|
|
206
|
+
from: z.ZodString;
|
|
207
|
+
to: z.ZodString;
|
|
208
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
209
|
+
sever: z.ZodString;
|
|
210
|
+
from: z.ZodString;
|
|
211
|
+
to: z.ZodString;
|
|
212
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
213
|
+
remove: z.ZodString;
|
|
214
|
+
}, z.core.$strict>]>>>;
|
|
215
|
+
allowedWhen: z.ZodOptional<z.ZodString>;
|
|
216
|
+
refusal: z.ZodOptional<z.ZodString>;
|
|
217
|
+
destructive: z.ZodOptional<z.ZodBoolean>;
|
|
218
|
+
}, z.core.$strict>;
|
|
219
|
+
export type ActSpec = z.infer<typeof ActSpec>;
|
|
220
|
+
export declare const RepairSpec: z.ZodObject<{
|
|
221
|
+
act: z.ZodString;
|
|
222
|
+
label: z.ZodOptional<z.ZodString>;
|
|
223
|
+
args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodArray<z.ZodUnknown>, z.ZodObject<{
|
|
224
|
+
expr: z.ZodString;
|
|
225
|
+
}, z.core.$strict>]>>>;
|
|
226
|
+
}, z.core.$strict>;
|
|
227
|
+
export declare const RuleSpec: z.ZodObject<{
|
|
228
|
+
title: z.ZodOptional<z.ZodString>;
|
|
229
|
+
description: z.ZodOptional<z.ZodString>;
|
|
230
|
+
over: z.ZodUnion<readonly [z.ZodLiteral<"graph">, z.ZodString]>;
|
|
231
|
+
when: z.ZodOptional<z.ZodString>;
|
|
232
|
+
require: z.ZodString;
|
|
233
|
+
says: z.ZodOptional<z.ZodString>;
|
|
234
|
+
repairs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
235
|
+
act: z.ZodString;
|
|
236
|
+
label: z.ZodOptional<z.ZodString>;
|
|
237
|
+
args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodArray<z.ZodUnknown>, z.ZodObject<{
|
|
238
|
+
expr: z.ZodString;
|
|
239
|
+
}, z.core.$strict>]>>>;
|
|
240
|
+
}, z.core.$strict>>>;
|
|
241
|
+
}, z.core.$strict>;
|
|
242
|
+
export type RuleSpec = z.infer<typeof RuleSpec>;
|
|
243
|
+
export declare const GrantSpec: z.ZodObject<{
|
|
244
|
+
roles: z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodLiteral<"*">]>;
|
|
245
|
+
mutations: z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodLiteral<"*">]>;
|
|
246
|
+
kinds: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodLiteral<"*">]>>;
|
|
247
|
+
describe: z.ZodOptional<z.ZodString>;
|
|
248
|
+
self: z.ZodOptional<z.ZodBoolean>;
|
|
249
|
+
}, z.core.$strict>;
|
|
250
|
+
/**
|
|
251
|
+
* Who sees which kinds — the framework's `Sight`, one meaning (FR-02).
|
|
252
|
+
* Absent: everyone sees everything. Present: a kind no sight names is seen
|
|
253
|
+
* by nobody but the system (a host that gives its owners everything serves
|
|
254
|
+
* them as the system, or names them in a sight).
|
|
255
|
+
*/
|
|
256
|
+
export declare const SightSpec: z.ZodObject<{
|
|
257
|
+
roles: z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodLiteral<"*">]>;
|
|
258
|
+
kinds: z.ZodArray<z.ZodString>;
|
|
259
|
+
own: z.ZodOptional<z.ZodBoolean>;
|
|
260
|
+
}, z.core.$strict>;
|
|
261
|
+
export type SightSpec = z.infer<typeof SightSpec>;
|
|
262
|
+
export declare const PolicySpec: z.ZodObject<{
|
|
263
|
+
grants: z.ZodArray<z.ZodObject<{
|
|
264
|
+
roles: z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodLiteral<"*">]>;
|
|
265
|
+
mutations: z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodLiteral<"*">]>;
|
|
266
|
+
kinds: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodLiteral<"*">]>>;
|
|
267
|
+
describe: z.ZodOptional<z.ZodString>;
|
|
268
|
+
self: z.ZodOptional<z.ZodBoolean>;
|
|
269
|
+
}, z.core.$strict>>;
|
|
270
|
+
sees: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
271
|
+
roles: z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodLiteral<"*">]>;
|
|
272
|
+
kinds: z.ZodArray<z.ZodString>;
|
|
273
|
+
own: z.ZodOptional<z.ZodBoolean>;
|
|
274
|
+
}, z.core.$strict>>>;
|
|
275
|
+
}, z.core.$strict>;
|
|
276
|
+
export type PolicySpec = z.infer<typeof PolicySpec>;
|
|
277
|
+
export declare const BrandSpec: z.ZodObject<{
|
|
278
|
+
accent: z.ZodString;
|
|
279
|
+
name: z.ZodOptional<z.ZodString>;
|
|
280
|
+
}, z.core.$strict>;
|
|
281
|
+
export declare const DocumentSpec: z.ZodObject<{
|
|
282
|
+
format: z.ZodLiteral<"graview-document">;
|
|
283
|
+
formatVersion: z.ZodLiteral<1>;
|
|
284
|
+
name: z.ZodString;
|
|
285
|
+
description: z.ZodOptional<z.ZodString>;
|
|
286
|
+
version: z.ZodOptional<z.ZodNumber>;
|
|
287
|
+
kinds: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
288
|
+
noun: z.ZodOptional<z.ZodString>;
|
|
289
|
+
plural: z.ZodOptional<z.ZodString>;
|
|
290
|
+
description: z.ZodOptional<z.ZodString>;
|
|
291
|
+
fields: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
292
|
+
type: z.ZodEnum<{
|
|
293
|
+
string: "string";
|
|
294
|
+
number: "number";
|
|
295
|
+
boolean: "boolean";
|
|
296
|
+
text: "text";
|
|
297
|
+
date: "date";
|
|
298
|
+
enum: "enum";
|
|
299
|
+
list: "list";
|
|
300
|
+
email: "email";
|
|
301
|
+
integer: "integer";
|
|
302
|
+
datetime: "datetime";
|
|
303
|
+
url: "url";
|
|
304
|
+
}>;
|
|
305
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
306
|
+
description: z.ZodOptional<z.ZodString>;
|
|
307
|
+
label: z.ZodOptional<z.ZodString>;
|
|
308
|
+
options: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
309
|
+
of: z.ZodOptional<z.ZodEnum<{
|
|
310
|
+
string: "string";
|
|
311
|
+
number: "number";
|
|
312
|
+
date: "date";
|
|
313
|
+
}>>;
|
|
314
|
+
default: z.ZodOptional<z.ZodUnknown>;
|
|
315
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
316
|
+
format: z.ZodOptional<z.ZodEnum<{
|
|
317
|
+
money: "money";
|
|
318
|
+
percent: "percent";
|
|
319
|
+
duration: "duration";
|
|
320
|
+
}>>;
|
|
321
|
+
renamedFrom: z.ZodOptional<z.ZodString>;
|
|
322
|
+
}, z.core.$strict>>;
|
|
323
|
+
label: z.ZodOptional<z.ZodString>;
|
|
324
|
+
describe: z.ZodOptional<z.ZodString>;
|
|
325
|
+
lifecycle: z.ZodOptional<z.ZodObject<{
|
|
326
|
+
field: z.ZodString;
|
|
327
|
+
retired: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
328
|
+
}, z.core.$strict>>;
|
|
329
|
+
figure: z.ZodOptional<z.ZodString>;
|
|
330
|
+
glance: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
331
|
+
edges: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
332
|
+
to: z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodLiteral<"*">]>;
|
|
333
|
+
cardinality: z.ZodOptional<z.ZodEnum<{
|
|
334
|
+
one: "one";
|
|
335
|
+
many: "many";
|
|
336
|
+
}>>;
|
|
337
|
+
description: z.ZodOptional<z.ZodString>;
|
|
338
|
+
inverse: z.ZodOptional<z.ZodString>;
|
|
339
|
+
appendOnly: z.ZodOptional<z.ZodBoolean>;
|
|
340
|
+
renamedFrom: z.ZodOptional<z.ZodString>;
|
|
341
|
+
}, z.core.$strict>>>;
|
|
342
|
+
renamedFrom: z.ZodOptional<z.ZodString>;
|
|
343
|
+
}, z.core.$strict>>;
|
|
344
|
+
acts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
345
|
+
title: z.ZodOptional<z.ZodString>;
|
|
346
|
+
description: z.ZodOptional<z.ZodString>;
|
|
347
|
+
fromTheOtherEnd: z.ZodOptional<z.ZodString>;
|
|
348
|
+
on: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
349
|
+
creates: z.ZodOptional<z.ZodString>;
|
|
350
|
+
sets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodArray<z.ZodUnknown>, z.ZodObject<{
|
|
351
|
+
expr: z.ZodString;
|
|
352
|
+
}, z.core.$strict>]>>>;
|
|
353
|
+
writes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
354
|
+
connects: z.ZodOptional<z.ZodString>;
|
|
355
|
+
severs: z.ZodOptional<z.ZodString>;
|
|
356
|
+
removes: z.ZodOptional<z.ZodLiteral<true>>;
|
|
357
|
+
args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
358
|
+
type: z.ZodEnum<{
|
|
359
|
+
string: "string";
|
|
360
|
+
number: "number";
|
|
361
|
+
boolean: "boolean";
|
|
362
|
+
text: "text";
|
|
363
|
+
date: "date";
|
|
364
|
+
enum: "enum";
|
|
365
|
+
list: "list";
|
|
366
|
+
email: "email";
|
|
367
|
+
integer: "integer";
|
|
368
|
+
datetime: "datetime";
|
|
369
|
+
url: "url";
|
|
370
|
+
}>;
|
|
371
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
372
|
+
description: z.ZodOptional<z.ZodString>;
|
|
373
|
+
label: z.ZodOptional<z.ZodString>;
|
|
374
|
+
options: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
375
|
+
of: z.ZodOptional<z.ZodEnum<{
|
|
376
|
+
string: "string";
|
|
377
|
+
number: "number";
|
|
378
|
+
date: "date";
|
|
379
|
+
}>>;
|
|
380
|
+
default: z.ZodOptional<z.ZodUnknown>;
|
|
381
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
382
|
+
format: z.ZodOptional<z.ZodEnum<{
|
|
383
|
+
money: "money";
|
|
384
|
+
percent: "percent";
|
|
385
|
+
duration: "duration";
|
|
386
|
+
}>>;
|
|
387
|
+
renamedFrom: z.ZodOptional<z.ZodString>;
|
|
388
|
+
}, z.core.$strict>>>;
|
|
389
|
+
effects: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
390
|
+
create: z.ZodString;
|
|
391
|
+
as: z.ZodOptional<z.ZodString>;
|
|
392
|
+
set: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodArray<z.ZodUnknown>, z.ZodObject<{
|
|
393
|
+
expr: z.ZodString;
|
|
394
|
+
}, z.core.$strict>]>>>;
|
|
395
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
396
|
+
set: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodArray<z.ZodUnknown>, z.ZodObject<{
|
|
397
|
+
expr: z.ZodString;
|
|
398
|
+
}, z.core.$strict>]>>;
|
|
399
|
+
target: z.ZodOptional<z.ZodString>;
|
|
400
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
401
|
+
connect: z.ZodString;
|
|
402
|
+
from: z.ZodString;
|
|
403
|
+
to: z.ZodString;
|
|
404
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
405
|
+
sever: z.ZodString;
|
|
406
|
+
from: z.ZodString;
|
|
407
|
+
to: z.ZodString;
|
|
408
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
409
|
+
remove: z.ZodString;
|
|
410
|
+
}, z.core.$strict>]>>>;
|
|
411
|
+
allowedWhen: z.ZodOptional<z.ZodString>;
|
|
412
|
+
refusal: z.ZodOptional<z.ZodString>;
|
|
413
|
+
destructive: z.ZodOptional<z.ZodBoolean>;
|
|
414
|
+
}, z.core.$strict>>>;
|
|
415
|
+
rules: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
416
|
+
title: z.ZodOptional<z.ZodString>;
|
|
417
|
+
description: z.ZodOptional<z.ZodString>;
|
|
418
|
+
over: z.ZodUnion<readonly [z.ZodLiteral<"graph">, z.ZodString]>;
|
|
419
|
+
when: z.ZodOptional<z.ZodString>;
|
|
420
|
+
require: z.ZodString;
|
|
421
|
+
says: z.ZodOptional<z.ZodString>;
|
|
422
|
+
repairs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
423
|
+
act: z.ZodString;
|
|
424
|
+
label: z.ZodOptional<z.ZodString>;
|
|
425
|
+
args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodArray<z.ZodUnknown>, z.ZodObject<{
|
|
426
|
+
expr: z.ZodString;
|
|
427
|
+
}, z.core.$strict>]>>>;
|
|
428
|
+
}, z.core.$strict>>>;
|
|
429
|
+
}, z.core.$strict>>>;
|
|
430
|
+
roles: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
431
|
+
policy: z.ZodOptional<z.ZodObject<{
|
|
432
|
+
grants: z.ZodArray<z.ZodObject<{
|
|
433
|
+
roles: z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodLiteral<"*">]>;
|
|
434
|
+
mutations: z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodLiteral<"*">]>;
|
|
435
|
+
kinds: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodLiteral<"*">]>>;
|
|
436
|
+
describe: z.ZodOptional<z.ZodString>;
|
|
437
|
+
self: z.ZodOptional<z.ZodBoolean>;
|
|
438
|
+
}, z.core.$strict>>;
|
|
439
|
+
sees: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
440
|
+
roles: z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodLiteral<"*">]>;
|
|
441
|
+
kinds: z.ZodArray<z.ZodString>;
|
|
442
|
+
own: z.ZodOptional<z.ZodBoolean>;
|
|
443
|
+
}, z.core.$strict>>>;
|
|
444
|
+
}, z.core.$strict>>;
|
|
445
|
+
modules: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
446
|
+
lenses: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
447
|
+
pages: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
448
|
+
views: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
449
|
+
card: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
450
|
+
row: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
451
|
+
page: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
452
|
+
}, z.core.$strict>>>;
|
|
453
|
+
brand: z.ZodOptional<z.ZodObject<{
|
|
454
|
+
accent: z.ZodString;
|
|
455
|
+
name: z.ZodOptional<z.ZodString>;
|
|
456
|
+
}, z.core.$strict>>;
|
|
457
|
+
settings: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
458
|
+
migrations: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
459
|
+
}, z.core.$strict>;
|
|
460
|
+
export type GraviewDocument = z.infer<typeof DocumentSpec>;
|
|
461
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/document/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,eAAO,MAAM,MAAM,qBAAqB,CAAC;AACzC,eAAO,MAAM,cAAc,IAAI,CAAC;AAChC,eAAO,MAAM,kBAAkB,QAAa,CAAC;AAE7C,6DAA6D;AAC7D,eAAO,MAAM,IAAI,QAAoC,CAAC;AACtD,gFAAgF;AAChF,eAAO,MAAM,UAAU,QAAwB,CAAC;AAIhD;;;;GAIG;AACH,eAAO,MAAM,SAAS,QAA0D,CAAC;AAUjF,eAAO,MAAM,WAAW,iHAAkH,CAAC;AAC3I,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAErD,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAoBlB,CAAC;AACL,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAElD,eAAO,MAAM,QAAQ;;;;;;;;;;kBAUV,CAAC;AACZ,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC;AAEhD,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAgBV,CAAC;AACZ,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC;AAEhD,wGAAwG;AACxG,eAAO,MAAM,SAAS;;oBAA0H,CAAC;AACjJ,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAIlD,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;oBAMrB,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAEpD,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAmBT,CAAC;AACZ,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAC;AAE9C,eAAO,MAAM,UAAU;;;;;;kBAMZ,CAAC;AAEZ,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;kBAUV,CAAC;AACZ,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC;AAEhD,eAAO,MAAM,SAAS;;;;;;kBAQX,CAAC;AAEZ;;;;;GAKG;AACH,eAAO,MAAM,SAAS;;;;kBAOX,CAAC;AACZ,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAElD,eAAO,MAAM,UAAU;;;;;;;;;;;;;kBAKZ,CAAC;AACZ,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAEpD,eAAO,MAAM,SAAS;;;kBAKX,CAAC;AAaZ,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAoBd,CAAC;AACZ,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC"}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/*
|
|
3
|
+
* THE GRAVIEW DECLARATION DOCUMENT, v1 — as data a stranger can hand us.
|
|
4
|
+
*
|
|
5
|
+
* docs/declaration-document.md is the prose; this is the shape. Every key is
|
|
6
|
+
* closed (`strict`): an unknown key is a finding, not something quietly
|
|
7
|
+
* ignored, because a model that misspells `requires` for `require` should be
|
|
8
|
+
* told, not given an app whose rule holds nothing.
|
|
9
|
+
*/
|
|
10
|
+
export const FORMAT = "graview-document";
|
|
11
|
+
export const FORMAT_VERSION = 1;
|
|
12
|
+
export const MAX_DOCUMENT_BYTES = 256 * 1024;
|
|
13
|
+
/** kebab-case: kinds, acts, rules, edges, roles, modules. */
|
|
14
|
+
export const NAME = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/;
|
|
15
|
+
/** Field names are identifiers so a rule can say them bare: `quote != null`. */
|
|
16
|
+
export const FIELD_NAME = /^[a-z][A-Za-z0-9]*$/;
|
|
17
|
+
const RESERVED_FIELDS = new Set(["id", "kind"]);
|
|
18
|
+
const name = (what) => z.string().regex(NAME, `${what} names are lower-case words joined by hyphens, like "booked-vendor"`);
|
|
19
|
+
/**
|
|
20
|
+
* A RELATION'S NAME may be kebab-case or one camelCase word. camelCase is
|
|
21
|
+
* recommended: a rule can then walk it bare (`tendedBy.name`), where
|
|
22
|
+
* `tended-by.name` would read as a subtraction.
|
|
23
|
+
*/
|
|
24
|
+
export const EDGE_NAME = /^(?:[a-z][a-z0-9]*(?:-[a-z0-9]+)*|[a-z][A-Za-z0-9]*)$/;
|
|
25
|
+
const edgeName = z.string().regex(EDGE_NAME, 'relation names are one camelCase word, like "tendedBy"');
|
|
26
|
+
const fieldName = z
|
|
27
|
+
.string()
|
|
28
|
+
.regex(FIELD_NAME, 'field names are one word or camelCase, like "dueDate" — rules say them bare')
|
|
29
|
+
.refine((n) => !RESERVED_FIELDS.has(n), 'a field cannot be called "id" or "kind" — the framework keeps those; try "type" or "category"');
|
|
30
|
+
const sentence = z.string().min(1).max(500);
|
|
31
|
+
const expression = z.string().min(1).max(2000);
|
|
32
|
+
const template = z.string().min(1).max(300);
|
|
33
|
+
export const FIELD_TYPES = ["string", "text", "number", "integer", "boolean", "date", "datetime", "enum", "list", "url", "email"];
|
|
34
|
+
export const FieldSpec = z
|
|
35
|
+
.object({
|
|
36
|
+
type: z.enum(FIELD_TYPES),
|
|
37
|
+
required: z.boolean().optional(),
|
|
38
|
+
description: sentence.optional(),
|
|
39
|
+
/** What the field is called on screen, where its name does not say it. */
|
|
40
|
+
label: z.string().min(1).max(60).optional(),
|
|
41
|
+
options: z.array(z.string().min(1).max(80)).min(1).max(100).optional(),
|
|
42
|
+
of: z.enum(["string", "number", "date"]).optional(),
|
|
43
|
+
default: z.unknown().optional(),
|
|
44
|
+
unit: z.string().max(12).optional(),
|
|
45
|
+
format: z.enum(["money", "percent", "duration"]).optional(),
|
|
46
|
+
/** The name this field had in the previous version: its values move instead of being dropped. */
|
|
47
|
+
renamedFrom: z.string().regex(FIELD_NAME).optional(),
|
|
48
|
+
})
|
|
49
|
+
.strict()
|
|
50
|
+
.superRefine((f, ctx) => {
|
|
51
|
+
if (f.type === "enum" && !f.options)
|
|
52
|
+
ctx.addIssue({ code: "custom", message: 'an enum field lists its "options"', path: ["options"] });
|
|
53
|
+
if (f.type !== "enum" && f.options)
|
|
54
|
+
ctx.addIssue({ code: "custom", message: '"options" belongs only on an enum field', path: ["options"] });
|
|
55
|
+
if (f.type !== "list" && f.of)
|
|
56
|
+
ctx.addIssue({ code: "custom", message: '"of" belongs only on a list field', path: ["of"] });
|
|
57
|
+
});
|
|
58
|
+
export const EdgeSpec = z
|
|
59
|
+
.object({
|
|
60
|
+
to: z.union([z.array(name("kind")).min(1), z.literal("*")]),
|
|
61
|
+
cardinality: z.enum(["one", "many"]).optional(),
|
|
62
|
+
description: sentence.optional(),
|
|
63
|
+
inverse: z.string().min(1).max(80).optional(),
|
|
64
|
+
appendOnly: z.boolean().optional(),
|
|
65
|
+
/** The name this relation had in the previous version: its links move. */
|
|
66
|
+
renamedFrom: z.string().optional(),
|
|
67
|
+
})
|
|
68
|
+
.strict();
|
|
69
|
+
export const KindSpec = z
|
|
70
|
+
.object({
|
|
71
|
+
noun: z.string().min(1).max(40).optional(),
|
|
72
|
+
plural: z.string().min(1).max(40).optional(),
|
|
73
|
+
description: sentence.optional(),
|
|
74
|
+
fields: z.record(fieldName, FieldSpec).refine((f) => Object.keys(f).length > 0, "a kind has at least one field"),
|
|
75
|
+
label: template.optional(),
|
|
76
|
+
describe: template.optional(),
|
|
77
|
+
lifecycle: z.object({ field: fieldName, retired: z.array(z.union([z.string(), z.number(), z.boolean()])).min(1) }).strict().optional(),
|
|
78
|
+
figure: z.string().max(20_000).optional(),
|
|
79
|
+
/** What a glance at one says — a card, a row, a hit in Find — first, in this order: the definition's `display.glance` (FR-39). */
|
|
80
|
+
glance: z.array(fieldName).min(1).max(20).optional(),
|
|
81
|
+
edges: z.record(edgeName, EdgeSpec).optional(),
|
|
82
|
+
/** The name this kind had in the previous version: its records move. */
|
|
83
|
+
renamedFrom: z.string().regex(NAME).optional(),
|
|
84
|
+
})
|
|
85
|
+
.strict();
|
|
86
|
+
/** A value an effect writes: a literal, `$arg`, `$subject`, `$new`, `$now`, `$today`, or `{ expr }`. */
|
|
87
|
+
export const ValueSpec = z.union([z.string(), z.number(), z.boolean(), z.null(), z.array(z.unknown()), z.object({ expr: expression }).strict()]);
|
|
88
|
+
const ref = z.string().regex(/^\$[A-Za-z][A-Za-z0-9]*$/, 'a reference is "$" and a name, like "$subject" or "$new"');
|
|
89
|
+
export const EffectSpec = z.union([
|
|
90
|
+
z.object({ create: name("kind"), as: z.string().regex(FIELD_NAME).optional(), set: z.record(fieldName, ValueSpec).optional() }).strict(),
|
|
91
|
+
z.object({ set: z.record(fieldName, ValueSpec), target: ref.optional() }).strict(),
|
|
92
|
+
z.object({ connect: edgeName, from: ref, to: ref }).strict(),
|
|
93
|
+
z.object({ sever: edgeName, from: ref, to: ref }).strict(),
|
|
94
|
+
z.object({ remove: ref }).strict(),
|
|
95
|
+
]);
|
|
96
|
+
export const ActSpec = z
|
|
97
|
+
.object({
|
|
98
|
+
title: z.string().min(1).max(80).optional(),
|
|
99
|
+
description: sentence.optional(),
|
|
100
|
+
/** How the act reads standing on the far end of the relation it makes or breaks. */
|
|
101
|
+
fromTheOtherEnd: z.string().min(1).max(80).optional(),
|
|
102
|
+
on: z.union([name("kind"), z.array(name("kind")).min(1)]).optional(),
|
|
103
|
+
creates: name("kind").optional(),
|
|
104
|
+
sets: z.record(fieldName, ValueSpec).optional(),
|
|
105
|
+
writes: z.array(fieldName).min(1).optional(),
|
|
106
|
+
connects: edgeName.optional(),
|
|
107
|
+
severs: edgeName.optional(),
|
|
108
|
+
removes: z.literal(true).optional(),
|
|
109
|
+
args: z.record(fieldName, FieldSpec).optional(),
|
|
110
|
+
effects: z.array(EffectSpec).min(1).max(20).optional(),
|
|
111
|
+
allowedWhen: expression.optional(),
|
|
112
|
+
refusal: template.optional(),
|
|
113
|
+
destructive: z.boolean().optional(),
|
|
114
|
+
})
|
|
115
|
+
.strict();
|
|
116
|
+
export const RepairSpec = z
|
|
117
|
+
.object({
|
|
118
|
+
act: name("act"),
|
|
119
|
+
label: z.string().min(1).max(80).optional(),
|
|
120
|
+
args: z.record(z.string(), ValueSpec).optional(),
|
|
121
|
+
})
|
|
122
|
+
.strict();
|
|
123
|
+
export const RuleSpec = z
|
|
124
|
+
.object({
|
|
125
|
+
title: z.string().min(1).max(120).optional(),
|
|
126
|
+
description: sentence.optional(),
|
|
127
|
+
over: z.union([z.literal("graph"), name("kind")]),
|
|
128
|
+
when: expression.optional(),
|
|
129
|
+
require: expression,
|
|
130
|
+
says: template.optional(),
|
|
131
|
+
repairs: z.array(RepairSpec).max(10).optional(),
|
|
132
|
+
})
|
|
133
|
+
.strict();
|
|
134
|
+
export const GrantSpec = z
|
|
135
|
+
.object({
|
|
136
|
+
roles: z.union([z.array(name("role")).min(1), z.literal("*")]),
|
|
137
|
+
mutations: z.union([z.array(name("act")).min(1), z.literal("*")]),
|
|
138
|
+
kinds: z.union([z.array(name("kind")), z.literal("*")]).optional(),
|
|
139
|
+
describe: sentence.optional(),
|
|
140
|
+
self: z.boolean().optional(),
|
|
141
|
+
})
|
|
142
|
+
.strict();
|
|
143
|
+
/**
|
|
144
|
+
* Who sees which kinds — the framework's `Sight`, one meaning (FR-02).
|
|
145
|
+
* Absent: everyone sees everything. Present: a kind no sight names is seen
|
|
146
|
+
* by nobody but the system (a host that gives its owners everything serves
|
|
147
|
+
* them as the system, or names them in a sight).
|
|
148
|
+
*/
|
|
149
|
+
export const SightSpec = z
|
|
150
|
+
.object({
|
|
151
|
+
roles: z.union([z.array(name("role")).min(1), z.literal("*")]),
|
|
152
|
+
kinds: z.array(name("kind")).min(1),
|
|
153
|
+
/** Only the principal's own records: the ones they made, their own record, and what an edge joins to it. */
|
|
154
|
+
own: z.boolean().optional(),
|
|
155
|
+
})
|
|
156
|
+
.strict();
|
|
157
|
+
export const PolicySpec = z
|
|
158
|
+
.object({
|
|
159
|
+
grants: z.array(GrantSpec),
|
|
160
|
+
sees: z.array(SightSpec).optional(),
|
|
161
|
+
})
|
|
162
|
+
.strict();
|
|
163
|
+
export const BrandSpec = z
|
|
164
|
+
.object({
|
|
165
|
+
accent: z.string().regex(/^#[0-9a-fA-F]{6}$/, 'an accent is a colour like "#c2577a"'),
|
|
166
|
+
name: z.string().min(1).max(60).optional(),
|
|
167
|
+
})
|
|
168
|
+
.strict();
|
|
169
|
+
const loose = z.record(z.string(), z.unknown());
|
|
170
|
+
/** A kind's view specs: which slots it fills. The blocks are checked in views.ts, sentence by sentence. */
|
|
171
|
+
const ViewSpecsSpec = z
|
|
172
|
+
.object({
|
|
173
|
+
card: z.array(z.unknown()).optional(),
|
|
174
|
+
row: z.array(z.unknown()).optional(),
|
|
175
|
+
page: z.array(z.unknown()).optional(),
|
|
176
|
+
})
|
|
177
|
+
.strict();
|
|
178
|
+
export const DocumentSpec = z
|
|
179
|
+
.object({
|
|
180
|
+
format: z.literal(FORMAT),
|
|
181
|
+
formatVersion: z.literal(FORMAT_VERSION),
|
|
182
|
+
name: z.string().min(1).max(80),
|
|
183
|
+
description: sentence.optional(),
|
|
184
|
+
version: z.number().int().min(1).optional(),
|
|
185
|
+
kinds: z.record(name("kind"), KindSpec).refine((k) => Object.keys(k).length > 0, "a document declares at least one kind").refine((k) => Object.keys(k).length <= 40, "a document declares at most 40 kinds"),
|
|
186
|
+
acts: z.record(name("act"), ActSpec).optional(),
|
|
187
|
+
rules: z.record(name("rule"), RuleSpec).optional(),
|
|
188
|
+
roles: z.array(name("role")).optional(),
|
|
189
|
+
policy: PolicySpec.optional(),
|
|
190
|
+
modules: loose.optional(),
|
|
191
|
+
lenses: z.array(loose).optional(),
|
|
192
|
+
pages: loose.optional(),
|
|
193
|
+
views: z.record(z.string(), ViewSpecsSpec).optional(),
|
|
194
|
+
brand: BrandSpec.optional(),
|
|
195
|
+
settings: z.array(loose).optional(),
|
|
196
|
+
migrations: z.array(loose).optional(),
|
|
197
|
+
})
|
|
198
|
+
.strict();
|
|
199
|
+
//# sourceMappingURL=schema.js.map
|