@syncropel/projections 0.1.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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAoDH;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,QAAQ;IACR,KAAK;IACL,MAAM;IACN,MAAM;IACN,SAAS;IACT,aAAa;IACb,kBAAkB;IAClB,MAAM;IACN,SAAS;IACT,MAAM;IACN,MAAM;IACN,WAAW;IACX,QAAQ;IACR,aAAa;IACb,aAAa;IACb,QAAQ;IACR,aAAa;IACb,aAAa;IACb,UAAU;CACF,CAAC","sourcesContent":["/**\n * SRP v0.1 — TypeScript schema types.\n *\n * The Syncropel Rendering Protocol is a narrow JSON schema of block-level\n * primitives for declarative UI documents. See the spec and examples at\n * https://syncropel.com.\n */\n\n// ---------------------------------------------------------------------------\n// Document envelope\n// ---------------------------------------------------------------------------\n\n/**\n * An SRP v0.1 document — the top-level envelope a Tier-1 extension emits.\n */\nexport interface SRPDocument {\n srp: \"0.1\";\n meta?: SRPMeta;\n root: SRPNode;\n}\n\nexport interface SRPMeta {\n name?: string;\n version?: string;\n description?: string;\n publisher?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Discriminated union of all 19 node types\n// ---------------------------------------------------------------------------\n\nexport type SRPNode =\n // Containers (5)\n | ColumnNode\n | RowNode\n | GridNode\n | CardNode\n | DividerNode\n // Record rendering (3)\n | RecordLineNode\n | RecordLineListNode\n | ChipNode\n // Data display (4)\n | HeadingNode\n | TextNode\n | StatNode\n | KeyValueNode\n // Interactive (4)\n | ButtonNode\n | IconButtonNode\n | CopyButtonNode\n | SelectNode\n // Feedback (3)\n | EmptyStateNode\n | ErrorStateNode\n | SkeletonNode;\n\n/**\n * The 19 canonical node-type discriminator strings.\n */\nexport const NODE_TYPES = [\n \"column\",\n \"row\",\n \"grid\",\n \"card\",\n \"divider\",\n \"record-line\",\n \"record-line-list\",\n \"chip\",\n \"heading\",\n \"text\",\n \"stat\",\n \"key-value\",\n \"button\",\n \"icon-button\",\n \"copy-button\",\n \"select\",\n \"empty-state\",\n \"error-state\",\n \"skeleton\",\n] as const;\n\nexport type NodeType = (typeof NODE_TYPES)[number];\n\n// ---------------------------------------------------------------------------\n// Fields every node may carry\n// ---------------------------------------------------------------------------\n\ninterface NodeBase {\n when?: string;\n bind?: Record<string, unknown>;\n actions?: Record<string, ActionDesc>;\n}\n\n// ---------------------------------------------------------------------------\n// Token unions (mirror @syncropel/react token scales)\n// ---------------------------------------------------------------------------\n\nexport type Gap = \"none\" | \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\nexport type Padding = \"none\" | \"xs\" | \"sm\" | \"md\" | \"lg\";\nexport type DividerSpacing = \"none\" | \"xs\" | \"sm\" | \"md\" | \"lg\";\nexport type Cols = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;\n\nexport type ColumnAlign = \"start\" | \"center\" | \"end\" | \"stretch\";\nexport type RowAlign = \"start\" | \"center\" | \"end\" | \"stretch\" | \"baseline\";\nexport type Justify =\n | \"start\"\n | \"center\"\n | \"end\"\n | \"between\"\n | \"around\"\n | \"evenly\";\n\nexport type RecordLineVariant =\n | \"feed\"\n | \"compact\"\n | \"detail\"\n | \"search\"\n | \"thread\";\n\nexport type ChipTone = \"default\" | \"info\" | \"warn\" | \"error\";\n\nexport type TextSize = \"xs\" | \"sm\" | \"md\" | \"lg\";\nexport type TextWeight = \"normal\" | \"medium\" | \"semibold\";\nexport type TextTone =\n | \"primary\"\n | \"secondary\"\n | \"muted\"\n | \"success\"\n | \"warning\"\n | \"danger\";\n\nexport type ButtonVariant = \"primary\" | \"secondary\" | \"ghost\" | \"danger\";\nexport type ButtonSize = \"xs\" | \"sm\" | \"md\";\n\nexport type SkeletonShape = \"rect\" | \"circle\" | \"text\";\n\n/**\n * Glyph kinds — the closed enumeration of semantic symbols the palette renders.\n * Covers act types, domain objects, thread states, and the AITL marker.\n */\nexport type GlyphKind =\n // Act types (coordination)\n | \"INTEND\"\n | \"DO\"\n | \"KNOW\"\n | \"LEARN\"\n // Act types (effects)\n | \"GET\"\n | \"PUT\"\n | \"CALL\"\n | \"MAP\"\n // AITL marker\n | \"AITL\"\n // Domain objects\n | \"thread\"\n | \"fork\"\n | \"record-parent\"\n | \"namespace\"\n | \"actor\"\n | \"file\"\n | \"pattern\"\n | \"page\"\n | \"view\"\n // Thread states\n | \"state-open\"\n | \"state-active\"\n | \"state-converged\"\n | \"state-closed\"\n | \"state-abandoned\";\n\n// ---------------------------------------------------------------------------\n// Actions + queries\n// ---------------------------------------------------------------------------\n\nexport interface ActionDesc {\n intent: string;\n payload?: Record<string, unknown>;\n}\n\n/**\n * VQL (Value Query Language) — the query shape a Syncropel server resolves\n * against its record store. Used by `record-line-list` nodes that bind to\n * a live query rather than a static list of record ids.\n *\n * The shape is deliberately open (index signature) — additional fields\n * are protocol extensions the server understands.\n */\nexport interface VQLQuery {\n act?: string;\n actor?: string;\n thread?: string;\n kind?: string;\n since?: number;\n limit?: number;\n [k: string]: unknown;\n}\n\n// ---------------------------------------------------------------------------\n// Container node definitions (5)\n// ---------------------------------------------------------------------------\n\nexport interface ColumnNode extends NodeBase {\n type: \"column\";\n props?: { gap?: Gap; align?: ColumnAlign; justify?: Justify };\n children?: SRPNode[];\n}\n\nexport interface RowNode extends NodeBase {\n type: \"row\";\n props?: {\n gap?: Gap;\n align?: RowAlign;\n justify?: Justify;\n wrap?: boolean;\n };\n children?: SRPNode[];\n}\n\nexport interface GridNode extends NodeBase {\n type: \"grid\";\n props: { cols: Cols; gap?: Gap; rowGap?: Gap; colGap?: Gap };\n children?: SRPNode[];\n}\n\nexport interface CardNode extends NodeBase {\n type: \"card\";\n props?: { padding?: Padding; interactive?: boolean };\n children?: SRPNode[];\n}\n\nexport interface DividerNode extends NodeBase {\n type: \"divider\";\n props?: { orientation?: \"horizontal\" | \"vertical\"; spacing?: DividerSpacing };\n}\n\n// ---------------------------------------------------------------------------\n// Record-rendering (3)\n// ---------------------------------------------------------------------------\n\nexport interface RecordLineNode extends NodeBase {\n type: \"record-line\";\n props: { variant: RecordLineVariant };\n bind: { record: string };\n}\n\nexport interface RecordLineListNode extends NodeBase {\n type: \"record-line-list\";\n props: { variant: RecordLineVariant; max?: number; empty?: string };\n bind: { query: VQLQuery } | { items: string[] };\n}\n\nexport interface ChipNode extends NodeBase {\n type: \"chip\";\n props: { label: string; tone?: ChipTone; glyph?: GlyphKind };\n}\n\n// ---------------------------------------------------------------------------\n// Data display (4)\n// ---------------------------------------------------------------------------\n\nexport interface HeadingNode extends NodeBase {\n type: \"heading\";\n props: { level: 1 | 2 | 3 | 4 | 5 | 6; text: string };\n}\n\nexport interface TextNode extends NodeBase {\n type: \"text\";\n props: {\n text: string;\n size?: TextSize;\n weight?: TextWeight;\n tone?: TextTone;\n inline?: boolean;\n };\n}\n\nexport interface StatNode extends NodeBase {\n type: \"stat\";\n props: {\n label: string;\n value: string | number;\n delta?: string | number;\n deltaTone?: \"auto\" | \"neutral\";\n };\n}\n\nexport interface KeyValueNode extends NodeBase {\n type: \"key-value\";\n props: { label: string; value: string };\n}\n\n// ---------------------------------------------------------------------------\n// Interactive (4)\n// ---------------------------------------------------------------------------\n\nexport interface ButtonNode extends NodeBase {\n type: \"button\";\n props: {\n label: string;\n variant?: ButtonVariant;\n size?: ButtonSize;\n disabled?: boolean;\n loading?: boolean;\n };\n actions?: { onClick?: ActionDesc };\n}\n\nexport interface IconButtonNode extends NodeBase {\n type: \"icon-button\";\n props: {\n glyph: GlyphKind;\n ariaLabel: string;\n variant?: ButtonVariant;\n size?: ButtonSize;\n disabled?: boolean;\n loading?: boolean;\n };\n actions?: { onClick?: ActionDesc };\n}\n\nexport interface CopyButtonNode extends NodeBase {\n type: \"copy-button\";\n props: { value: string; label?: string };\n}\n\nexport interface SelectNode extends NodeBase {\n type: \"select\";\n props: { options: { label: string; value: string }[] };\n bind: { value: string };\n actions?: { onChange?: ActionDesc };\n}\n\n// ---------------------------------------------------------------------------\n// Feedback (3)\n// ---------------------------------------------------------------------------\n\nexport interface EmptyStateNode extends NodeBase {\n type: \"empty-state\";\n props: {\n message: string;\n action?: { label: string; intent: string };\n };\n}\n\nexport interface ErrorStateNode extends NodeBase {\n type: \"error-state\";\n props: {\n message: string;\n retry?: { intent: string };\n };\n}\n\nexport interface SkeletonNode extends NodeBase {\n type: \"skeleton\";\n props?: {\n shape?: SkeletonShape;\n width?: string | number | \"full\";\n height?: string | number;\n };\n}\n"]}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Runtime validators for SRP v0.1 documents.
3
+ *
4
+ * Pure functions — no dependencies. Return a ValidationResult with either a
5
+ * `valid: true` flag or a list of errors keyed by path.
6
+ */
7
+ import type { SRPDocument, SRPNode } from "./schema.js";
8
+ export interface ValidationError {
9
+ /** JSON-pointer-style path to the offending node, e.g. "/root/children/0". */
10
+ path: string;
11
+ /** Human-readable message. */
12
+ message: string;
13
+ /** Machine-readable code for programmatic handling. */
14
+ code: ValidationErrorCode;
15
+ }
16
+ export type ValidationErrorCode = "SRP_VERSION_INVALID" | "ROOT_MISSING" | "NODE_NOT_OBJECT" | "NODE_TYPE_MISSING" | "NODE_TYPE_UNKNOWN" | "PROPS_MISSING_REQUIRED" | "PROPS_INVALID_VALUE" | "CHILDREN_NOT_ARRAY" | "CHILDREN_NOT_ALLOWED" | "BIND_MISSING_REQUIRED" | "BIND_INVALID_SHAPE";
17
+ export type ValidationResult = {
18
+ valid: true;
19
+ } | {
20
+ valid: false;
21
+ errors: ValidationError[];
22
+ };
23
+ /**
24
+ * Validate a full SRP document.
25
+ *
26
+ * Returns `{ valid: true }` when the document conforms to SRP v0.1.
27
+ * Returns `{ valid: false, errors }` with every violation keyed by a
28
+ * JSON-pointer-style path when it doesn't.
29
+ */
30
+ export declare function validateSRP(doc: unknown): ValidationResult;
31
+ /**
32
+ * Validate a single node (used internally and useful standalone for
33
+ * incremental SRP authoring).
34
+ */
35
+ export declare function validateNode(node: unknown, path: string): ValidationResult;
36
+ /**
37
+ * Type guard: true when `doc` is a well-formed SRP document.
38
+ * Useful in adapter code that receives untrusted JSON.
39
+ */
40
+ export declare function isSRPDocument(doc: unknown): doc is SRPDocument;
41
+ /**
42
+ * Type guard: true when `node` is a well-formed SRP node.
43
+ */
44
+ export declare function isSRPNode(node: unknown): node is SRPNode;
45
+ //# sourceMappingURL=validators.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../src/validators.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAOxD,MAAM,WAAW,eAAe;IAC9B,8EAA8E;IAC9E,IAAI,EAAE,MAAM,CAAC;IACb,8BAA8B;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,uDAAuD;IACvD,IAAI,EAAE,mBAAmB,CAAC;CAC3B;AAED,MAAM,MAAM,mBAAmB,GAC3B,qBAAqB,GACrB,cAAc,GACd,iBAAiB,GACjB,mBAAmB,GACnB,mBAAmB,GACnB,wBAAwB,GACxB,qBAAqB,GACrB,oBAAoB,GACpB,sBAAsB,GACtB,uBAAuB,GACvB,oBAAoB,CAAC;AAEzB,MAAM,MAAM,gBAAgB,GACxB;IAAE,KAAK,EAAE,IAAI,CAAA;CAAE,GACf;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,eAAe,EAAE,CAAA;CAAE,CAAC;AAahD;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,gBAAgB,CA4B1D;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,gBAAgB,CAM1E;AA0dD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,WAAW,CAG9D;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,OAAO,CAGxD"}
@@ -0,0 +1,312 @@
1
+ /**
2
+ * Runtime validators for SRP v0.1 documents.
3
+ *
4
+ * Pure functions — no dependencies. Return a ValidationResult with either a
5
+ * `valid: true` flag or a list of errors keyed by path.
6
+ */
7
+ import { NODE_TYPES } from "./schema.js";
8
+ class Collector {
9
+ errors = [];
10
+ add(path, code, message) {
11
+ this.errors.push({ path, code, message });
12
+ }
13
+ }
14
+ // ---------------------------------------------------------------------------
15
+ // Public API
16
+ // ---------------------------------------------------------------------------
17
+ /**
18
+ * Validate a full SRP document.
19
+ *
20
+ * Returns `{ valid: true }` when the document conforms to SRP v0.1.
21
+ * Returns `{ valid: false, errors }` with every violation keyed by a
22
+ * JSON-pointer-style path when it doesn't.
23
+ */
24
+ export function validateSRP(doc) {
25
+ const c = new Collector();
26
+ if (typeof doc !== "object" || doc === null) {
27
+ c.add("", "NODE_NOT_OBJECT", "SRP document must be an object");
28
+ return { valid: false, errors: c.errors };
29
+ }
30
+ const d = doc;
31
+ if (d.srp !== "0.1") {
32
+ c.add("/srp", "SRP_VERSION_INVALID", `srp field must be the exact string "0.1", got ${JSON.stringify(d.srp)}`);
33
+ }
34
+ if (!("root" in d)) {
35
+ c.add("/root", "ROOT_MISSING", "SRP document must have a root node");
36
+ return { valid: false, errors: c.errors };
37
+ }
38
+ validateNodeInto(d.root, "/root", c);
39
+ return c.errors.length === 0
40
+ ? { valid: true }
41
+ : { valid: false, errors: c.errors };
42
+ }
43
+ /**
44
+ * Validate a single node (used internally and useful standalone for
45
+ * incremental SRP authoring).
46
+ */
47
+ export function validateNode(node, path) {
48
+ const c = new Collector();
49
+ validateNodeInto(node, path, c);
50
+ return c.errors.length === 0
51
+ ? { valid: true }
52
+ : { valid: false, errors: c.errors };
53
+ }
54
+ function validateNodeInto(node, path, c) {
55
+ if (typeof node !== "object" || node === null) {
56
+ c.add(path, "NODE_NOT_OBJECT", `Node at ${path} must be an object`);
57
+ return;
58
+ }
59
+ const n = node;
60
+ if (typeof n.type !== "string") {
61
+ c.add(`${path}/type`, "NODE_TYPE_MISSING", `Node at ${path} must have a string "type" field`);
62
+ return;
63
+ }
64
+ if (!NODE_TYPES.includes(n.type)) {
65
+ c.add(`${path}/type`, "NODE_TYPE_UNKNOWN", `Unknown node type "${n.type}" at ${path}. Allowed: ${NODE_TYPES.join(", ")}`);
66
+ return;
67
+ }
68
+ // Per-type validation dispatched below
69
+ switch (n.type) {
70
+ case "column":
71
+ case "row":
72
+ case "card":
73
+ validateContainer(n, path, c);
74
+ break;
75
+ case "grid":
76
+ validateGrid(n, path, c);
77
+ break;
78
+ case "divider":
79
+ validateDivider(n, path, c);
80
+ break;
81
+ case "record-line":
82
+ validateRecordLine(n, path, c);
83
+ break;
84
+ case "record-line-list":
85
+ validateRecordLineList(n, path, c);
86
+ break;
87
+ case "chip":
88
+ validateChip(n, path, c);
89
+ break;
90
+ case "heading":
91
+ validateHeading(n, path, c);
92
+ break;
93
+ case "text":
94
+ validateText(n, path, c);
95
+ break;
96
+ case "stat":
97
+ validateStat(n, path, c);
98
+ break;
99
+ case "key-value":
100
+ validateKeyValue(n, path, c);
101
+ break;
102
+ case "button":
103
+ validateButton(n, path, c);
104
+ break;
105
+ case "icon-button":
106
+ validateIconButton(n, path, c);
107
+ break;
108
+ case "copy-button":
109
+ validateCopyButton(n, path, c);
110
+ break;
111
+ case "select":
112
+ validateSelect(n, path, c);
113
+ break;
114
+ case "empty-state":
115
+ validateEmptyState(n, path, c);
116
+ break;
117
+ case "error-state":
118
+ validateErrorState(n, path, c);
119
+ break;
120
+ case "skeleton":
121
+ validateSkeleton(n, path, c);
122
+ break;
123
+ }
124
+ }
125
+ // ---------------------------------------------------------------------------
126
+ // Per-node validators
127
+ // ---------------------------------------------------------------------------
128
+ function validateContainer(n, path, c) {
129
+ if ("children" in n && n.children !== undefined) {
130
+ if (!Array.isArray(n.children)) {
131
+ c.add(`${path}/children`, "CHILDREN_NOT_ARRAY", `${n.type} "children" must be an array`);
132
+ }
133
+ else {
134
+ n.children.forEach((child, i) => {
135
+ validateNodeInto(child, `${path}/children/${i}`, c);
136
+ });
137
+ }
138
+ }
139
+ }
140
+ function validateGrid(n, path, c) {
141
+ const props = (n.props ?? {});
142
+ if (typeof props.cols !== "number" || !Number.isInteger(props.cols)) {
143
+ c.add(`${path}/props/cols`, "PROPS_MISSING_REQUIRED", `grid requires "props.cols" to be an integer`);
144
+ }
145
+ else if (props.cols < 1 || props.cols > 12) {
146
+ c.add(`${path}/props/cols`, "PROPS_INVALID_VALUE", `grid "props.cols" must be between 1 and 12, got ${props.cols}`);
147
+ }
148
+ validateContainer(n, path, c);
149
+ }
150
+ function validateDivider(n, path, c) {
151
+ if ("children" in n) {
152
+ c.add(`${path}/children`, "CHILDREN_NOT_ALLOWED", `divider cannot have children`);
153
+ }
154
+ }
155
+ function validateRecordLine(n, path, c) {
156
+ const props = (n.props ?? {});
157
+ if (typeof props.variant !== "string") {
158
+ c.add(`${path}/props/variant`, "PROPS_MISSING_REQUIRED", `record-line requires "props.variant"`);
159
+ }
160
+ const bind = n.bind;
161
+ if (!bind || typeof bind.record !== "string") {
162
+ c.add(`${path}/bind/record`, "BIND_MISSING_REQUIRED", `record-line requires "bind.record" (a record id string)`);
163
+ }
164
+ }
165
+ function validateRecordLineList(n, path, c) {
166
+ const props = (n.props ?? {});
167
+ if (typeof props.variant !== "string") {
168
+ c.add(`${path}/props/variant`, "PROPS_MISSING_REQUIRED", `record-line-list requires "props.variant"`);
169
+ }
170
+ const bind = n.bind;
171
+ if (!bind) {
172
+ c.add(`${path}/bind`, "BIND_MISSING_REQUIRED", `record-line-list requires "bind.query" or "bind.items"`);
173
+ return;
174
+ }
175
+ const hasQuery = "query" in bind;
176
+ const hasItems = "items" in bind;
177
+ if (!hasQuery && !hasItems) {
178
+ c.add(`${path}/bind`, "BIND_INVALID_SHAPE", `record-line-list "bind" must contain either "query" or "items"`);
179
+ }
180
+ else if (hasQuery && hasItems) {
181
+ c.add(`${path}/bind`, "BIND_INVALID_SHAPE", `record-line-list "bind" cannot contain both "query" and "items"`);
182
+ }
183
+ else if (hasItems && !Array.isArray(bind.items)) {
184
+ c.add(`${path}/bind/items`, "BIND_INVALID_SHAPE", `record-line-list "bind.items" must be an array of record ids`);
185
+ }
186
+ }
187
+ function validateChip(n, path, c) {
188
+ const props = (n.props ?? {});
189
+ if (typeof props.label !== "string") {
190
+ c.add(`${path}/props/label`, "PROPS_MISSING_REQUIRED", `chip requires "props.label"`);
191
+ }
192
+ }
193
+ function validateHeading(n, path, c) {
194
+ const props = (n.props ?? {});
195
+ if (typeof props.level !== "number" || !Number.isInteger(props.level)) {
196
+ c.add(`${path}/props/level`, "PROPS_MISSING_REQUIRED", `heading requires "props.level" to be an integer`);
197
+ }
198
+ else if (props.level < 1 || props.level > 6) {
199
+ c.add(`${path}/props/level`, "PROPS_INVALID_VALUE", `heading "props.level" must be 1-6, got ${props.level}`);
200
+ }
201
+ if (typeof props.text !== "string") {
202
+ c.add(`${path}/props/text`, "PROPS_MISSING_REQUIRED", `heading requires "props.text"`);
203
+ }
204
+ }
205
+ function validateText(n, path, c) {
206
+ const props = (n.props ?? {});
207
+ if (typeof props.text !== "string") {
208
+ c.add(`${path}/props/text`, "PROPS_MISSING_REQUIRED", `text requires "props.text"`);
209
+ }
210
+ }
211
+ function validateStat(n, path, c) {
212
+ const props = (n.props ?? {});
213
+ if (typeof props.label !== "string") {
214
+ c.add(`${path}/props/label`, "PROPS_MISSING_REQUIRED", `stat requires "props.label"`);
215
+ }
216
+ if (typeof props.value !== "string" && typeof props.value !== "number") {
217
+ c.add(`${path}/props/value`, "PROPS_MISSING_REQUIRED", `stat requires "props.value" (string or number)`);
218
+ }
219
+ }
220
+ function validateKeyValue(n, path, c) {
221
+ const props = (n.props ?? {});
222
+ if (typeof props.label !== "string") {
223
+ c.add(`${path}/props/label`, "PROPS_MISSING_REQUIRED", `key-value requires "props.label"`);
224
+ }
225
+ if (typeof props.value !== "string") {
226
+ c.add(`${path}/props/value`, "PROPS_MISSING_REQUIRED", `key-value requires "props.value"`);
227
+ }
228
+ }
229
+ function validateButton(n, path, c) {
230
+ const props = (n.props ?? {});
231
+ if (typeof props.label !== "string") {
232
+ c.add(`${path}/props/label`, "PROPS_MISSING_REQUIRED", `button requires "props.label"`);
233
+ }
234
+ }
235
+ function validateIconButton(n, path, c) {
236
+ const props = (n.props ?? {});
237
+ if (typeof props.glyph !== "string") {
238
+ c.add(`${path}/props/glyph`, "PROPS_MISSING_REQUIRED", `icon-button requires "props.glyph" (Glyph kind string)`);
239
+ }
240
+ if (typeof props.ariaLabel !== "string" || props.ariaLabel.length === 0) {
241
+ c.add(`${path}/props/ariaLabel`, "PROPS_MISSING_REQUIRED", `icon-button requires a non-empty "props.ariaLabel" (WCAG 2.1 AA)`);
242
+ }
243
+ }
244
+ function validateCopyButton(n, path, c) {
245
+ const props = (n.props ?? {});
246
+ if (typeof props.value !== "string") {
247
+ c.add(`${path}/props/value`, "PROPS_MISSING_REQUIRED", `copy-button requires "props.value"`);
248
+ }
249
+ }
250
+ function validateSelect(n, path, c) {
251
+ const props = (n.props ?? {});
252
+ if (!Array.isArray(props.options)) {
253
+ c.add(`${path}/props/options`, "PROPS_MISSING_REQUIRED", `select requires "props.options" (array of {label, value})`);
254
+ return;
255
+ }
256
+ props.options.forEach((opt, i) => {
257
+ if (typeof opt !== "object" || opt === null) {
258
+ c.add(`${path}/props/options/${i}`, "PROPS_INVALID_VALUE", `select option must be an object`);
259
+ return;
260
+ }
261
+ const o = opt;
262
+ if (typeof o.label !== "string" || typeof o.value !== "string") {
263
+ c.add(`${path}/props/options/${i}`, "PROPS_INVALID_VALUE", `select option must have string "label" and "value"`);
264
+ }
265
+ });
266
+ }
267
+ function validateEmptyState(n, path, c) {
268
+ const props = (n.props ?? {});
269
+ if (typeof props.message !== "string") {
270
+ c.add(`${path}/props/message`, "PROPS_MISSING_REQUIRED", `empty-state requires "props.message"`);
271
+ }
272
+ }
273
+ function validateErrorState(n, path, c) {
274
+ const props = (n.props ?? {});
275
+ if (typeof props.message !== "string") {
276
+ c.add(`${path}/props/message`, "PROPS_MISSING_REQUIRED", `error-state requires "props.message"`);
277
+ }
278
+ }
279
+ function validateSkeleton(n, path, c) {
280
+ const props = (n.props ?? {});
281
+ if (props && typeof props.shape === "string") {
282
+ const allowed = ["rect", "circle", "text"];
283
+ if (!allowed.includes(props.shape)) {
284
+ c.add(`${path}/props/shape`, "PROPS_INVALID_VALUE", `skeleton "props.shape" must be one of ${allowed.join(" | ")}, got ${props.shape}`);
285
+ }
286
+ if (props.shape === "rect" &&
287
+ props.height === undefined) {
288
+ c.add(`${path}/props/height`, "PROPS_MISSING_REQUIRED", `skeleton shape='rect' requires "props.height"`);
289
+ }
290
+ }
291
+ // Returned silently — suppress unused-param warning
292
+ void n;
293
+ }
294
+ // ---------------------------------------------------------------------------
295
+ // Helpers for library consumers
296
+ // ---------------------------------------------------------------------------
297
+ /**
298
+ * Type guard: true when `doc` is a well-formed SRP document.
299
+ * Useful in adapter code that receives untrusted JSON.
300
+ */
301
+ export function isSRPDocument(doc) {
302
+ const result = validateSRP(doc);
303
+ return result.valid;
304
+ }
305
+ /**
306
+ * Type guard: true when `node` is a well-formed SRP node.
307
+ */
308
+ export function isSRPNode(node) {
309
+ const result = validateNode(node, "");
310
+ return result.valid;
311
+ }
312
+ //# sourceMappingURL=validators.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validators.js","sourceRoot":"","sources":["../src/validators.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAgCzC,MAAM,SAAS;IACb,MAAM,GAAsB,EAAE,CAAC;IAC/B,GAAG,CAAC,IAAY,EAAE,IAAyB,EAAE,OAAe;QAC1D,IAAI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AE,MAAM,CAAC,CAAC;QAC3C,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;YACnC,CAAC,CAAC,GAAG,CACH,GAAG,IAAI,cAAc,EACrB,qBAAqB,EACrB,yCAAyC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,KAAK,CAAC,KAAK,EAAE,CACnF,CAAC;QACJ,CAAC;QACD,IACE,KAAK,CAAC,KAAK,KAAK,MAAM;YACtB,KAAK,CAAC,MAAM,KAAK,SAAS,EAC1B,CAAC;YACD,CAAC,CAAC,GAAG,CACH,GAAG,IAAI,eAAe,EACtB,wBAAwB,EACxB,+CAA+C,CAChD,CAAC;QACJ,CAAC;IACH,CAAC;IAED,oDAAoD;IACpD,KAAK,CAAC,CAAC;AACT,CAAC;AAED,8EAA8E;AAC9E,gCAAgC;AAChC,8EAA8E;AAE9E;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,GAAY;IACxC,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;IAChC,OAAO,MAAM,CAAC,KAAK,CAAC;AACtB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,IAAa;IACrC,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACtC,OAAO,MAAM,CAAC,KAAK,CAAC;AACtB,CAAC","sourcesContent":["/**\n * Runtime validators for SRP v0.1 documents.\n *\n * Pure functions — no dependencies. Return a ValidationResult with either a\n * `valid: true` flag or a list of errors keyed by path.\n */\n\nimport type { SRPDocument, SRPNode } from \"./schema.js\";\nimport { NODE_TYPES } from \"./schema.js\";\n\n// ---------------------------------------------------------------------------\n// Result types\n// ---------------------------------------------------------------------------\n\nexport interface ValidationError {\n /** JSON-pointer-style path to the offending node, e.g. \"/root/children/0\". */\n path: string;\n /** Human-readable message. */\n message: string;\n /** Machine-readable code for programmatic handling. */\n code: ValidationErrorCode;\n}\n\nexport type ValidationErrorCode =\n | \"SRP_VERSION_INVALID\"\n | \"ROOT_MISSING\"\n | \"NODE_NOT_OBJECT\"\n | \"NODE_TYPE_MISSING\"\n | \"NODE_TYPE_UNKNOWN\"\n | \"PROPS_MISSING_REQUIRED\"\n | \"PROPS_INVALID_VALUE\"\n | \"CHILDREN_NOT_ARRAY\"\n | \"CHILDREN_NOT_ALLOWED\"\n | \"BIND_MISSING_REQUIRED\"\n | \"BIND_INVALID_SHAPE\";\n\nexport type ValidationResult =\n | { valid: true }\n | { valid: false; errors: ValidationError[] };\n\nclass Collector {\n errors: ValidationError[] = [];\n add(path: string, code: ValidationErrorCode, message: string): void {\n this.errors.push({ path, code, message });\n }\n}\n\n// ---------------------------------------------------------------------------\n// Public API\n// ---------------------------------------------------------------------------\n\n/**\n * Validate a full SRP document.\n *\n * Returns `{ valid: true }` when the document conforms to SRP v0.1.\n * Returns `{ valid: false, errors }` with every violation keyed by a\n * JSON-pointer-style path when it doesn't.\n */\nexport function validateSRP(doc: unknown): ValidationResult {\n const c = new Collector();\n\n if (typeof doc !== \"object\" || doc === null) {\n c.add(\"\", \"NODE_NOT_OBJECT\", \"SRP document must be an object\");\n return { valid: false, errors: c.errors };\n }\n\n const d = doc as Record<string, unknown>;\n\n if (d.srp !== \"0.1\") {\n c.add(\n \"/srp\",\n \"SRP_VERSION_INVALID\",\n `srp field must be the exact string \"0.1\", got ${JSON.stringify(d.srp)}`,\n );\n }\n\n if (!(\"root\" in d)) {\n c.add(\"/root\", \"ROOT_MISSING\", \"SRP document must have a root node\");\n return { valid: false, errors: c.errors };\n }\n\n validateNodeInto(d.root, \"/root\", c);\n\n return c.errors.length === 0\n ? { valid: true }\n : { valid: false, errors: c.errors };\n}\n\n/**\n * Validate a single node (used internally and useful standalone for\n * incremental SRP authoring).\n */\nexport function validateNode(node: unknown, path: string): ValidationResult {\n const c = new Collector();\n validateNodeInto(node, path, c);\n return c.errors.length === 0\n ? { valid: true }\n : { valid: false, errors: c.errors };\n}\n\nfunction validateNodeInto(\n node: unknown,\n path: string,\n c: Collector,\n): void {\n if (typeof node !== \"object\" || node === null) {\n c.add(path, \"NODE_NOT_OBJECT\", `Node at ${path} must be an object`);\n return;\n }\n\n const n = node as Record<string, unknown>;\n\n if (typeof n.type !== \"string\") {\n c.add(\n `${path}/type`,\n \"NODE_TYPE_MISSING\",\n `Node at ${path} must have a string \"type\" field`,\n );\n return;\n }\n\n if (!(NODE_TYPES as readonly string[]).includes(n.type)) {\n c.add(\n `${path}/type`,\n \"NODE_TYPE_UNKNOWN\",\n `Unknown node type \"${n.type}\" at ${path}. Allowed: ${NODE_TYPES.join(\", \")}`,\n );\n return;\n }\n\n // Per-type validation dispatched below\n switch (n.type) {\n case \"column\":\n case \"row\":\n case \"card\":\n validateContainer(n, path, c);\n break;\n case \"grid\":\n validateGrid(n, path, c);\n break;\n case \"divider\":\n validateDivider(n, path, c);\n break;\n case \"record-line\":\n validateRecordLine(n, path, c);\n break;\n case \"record-line-list\":\n validateRecordLineList(n, path, c);\n break;\n case \"chip\":\n validateChip(n, path, c);\n break;\n case \"heading\":\n validateHeading(n, path, c);\n break;\n case \"text\":\n validateText(n, path, c);\n break;\n case \"stat\":\n validateStat(n, path, c);\n break;\n case \"key-value\":\n validateKeyValue(n, path, c);\n break;\n case \"button\":\n validateButton(n, path, c);\n break;\n case \"icon-button\":\n validateIconButton(n, path, c);\n break;\n case \"copy-button\":\n validateCopyButton(n, path, c);\n break;\n case \"select\":\n validateSelect(n, path, c);\n break;\n case \"empty-state\":\n validateEmptyState(n, path, c);\n break;\n case \"error-state\":\n validateErrorState(n, path, c);\n break;\n case \"skeleton\":\n validateSkeleton(n, path, c);\n break;\n }\n}\n\n// ---------------------------------------------------------------------------\n// Per-node validators\n// ---------------------------------------------------------------------------\n\nfunction validateContainer(\n n: Record<string, unknown>,\n path: string,\n c: Collector,\n): void {\n if (\"children\" in n && n.children !== undefined) {\n if (!Array.isArray(n.children)) {\n c.add(\n `${path}/children`,\n \"CHILDREN_NOT_ARRAY\",\n `${n.type} \"children\" must be an array`,\n );\n } else {\n n.children.forEach((child, i) => {\n validateNodeInto(child, `${path}/children/${i}`, c);\n });\n }\n }\n}\n\nfunction validateGrid(\n n: Record<string, unknown>,\n path: string,\n c: Collector,\n): void {\n const props = (n.props ?? {}) as Record<string, unknown>;\n if (typeof props.cols !== \"number\" || !Number.isInteger(props.cols)) {\n c.add(\n `${path}/props/cols`,\n \"PROPS_MISSING_REQUIRED\",\n `grid requires \"props.cols\" to be an integer`,\n );\n } else if (props.cols < 1 || props.cols > 12) {\n c.add(\n `${path}/props/cols`,\n \"PROPS_INVALID_VALUE\",\n `grid \"props.cols\" must be between 1 and 12, got ${props.cols}`,\n );\n }\n validateContainer(n, path, c);\n}\n\nfunction validateDivider(\n n: Record<string, unknown>,\n path: string,\n c: Collector,\n): void {\n if (\"children\" in n) {\n c.add(\n `${path}/children`,\n \"CHILDREN_NOT_ALLOWED\",\n `divider cannot have children`,\n );\n }\n}\n\nfunction validateRecordLine(\n n: Record<string, unknown>,\n path: string,\n c: Collector,\n): void {\n const props = (n.props ?? {}) as Record<string, unknown>;\n if (typeof props.variant !== \"string\") {\n c.add(\n `${path}/props/variant`,\n \"PROPS_MISSING_REQUIRED\",\n `record-line requires \"props.variant\"`,\n );\n }\n\n const bind = n.bind as Record<string, unknown> | undefined;\n if (!bind || typeof bind.record !== \"string\") {\n c.add(\n `${path}/bind/record`,\n \"BIND_MISSING_REQUIRED\",\n `record-line requires \"bind.record\" (a record id string)`,\n );\n }\n}\n\nfunction validateRecordLineList(\n n: Record<string, unknown>,\n path: string,\n c: Collector,\n): void {\n const props = (n.props ?? {}) as Record<string, unknown>;\n if (typeof props.variant !== \"string\") {\n c.add(\n `${path}/props/variant`,\n \"PROPS_MISSING_REQUIRED\",\n `record-line-list requires \"props.variant\"`,\n );\n }\n\n const bind = n.bind as Record<string, unknown> | undefined;\n if (!bind) {\n c.add(\n `${path}/bind`,\n \"BIND_MISSING_REQUIRED\",\n `record-line-list requires \"bind.query\" or \"bind.items\"`,\n );\n return;\n }\n\n const hasQuery = \"query\" in bind;\n const hasItems = \"items\" in bind;\n if (!hasQuery && !hasItems) {\n c.add(\n `${path}/bind`,\n \"BIND_INVALID_SHAPE\",\n `record-line-list \"bind\" must contain either \"query\" or \"items\"`,\n );\n } else if (hasQuery && hasItems) {\n c.add(\n `${path}/bind`,\n \"BIND_INVALID_SHAPE\",\n `record-line-list \"bind\" cannot contain both \"query\" and \"items\"`,\n );\n } else if (hasItems && !Array.isArray(bind.items)) {\n c.add(\n `${path}/bind/items`,\n \"BIND_INVALID_SHAPE\",\n `record-line-list \"bind.items\" must be an array of record ids`,\n );\n }\n}\n\nfunction validateChip(\n n: Record<string, unknown>,\n path: string,\n c: Collector,\n): void {\n const props = (n.props ?? {}) as Record<string, unknown>;\n if (typeof props.label !== \"string\") {\n c.add(\n `${path}/props/label`,\n \"PROPS_MISSING_REQUIRED\",\n `chip requires \"props.label\"`,\n );\n }\n}\n\nfunction validateHeading(\n n: Record<string, unknown>,\n path: string,\n c: Collector,\n): void {\n const props = (n.props ?? {}) as Record<string, unknown>;\n if (typeof props.level !== \"number\" || !Number.isInteger(props.level)) {\n c.add(\n `${path}/props/level`,\n \"PROPS_MISSING_REQUIRED\",\n `heading requires \"props.level\" to be an integer`,\n );\n } else if (props.level < 1 || props.level > 6) {\n c.add(\n `${path}/props/level`,\n \"PROPS_INVALID_VALUE\",\n `heading \"props.level\" must be 1-6, got ${props.level}`,\n );\n }\n if (typeof props.text !== \"string\") {\n c.add(\n `${path}/props/text`,\n \"PROPS_MISSING_REQUIRED\",\n `heading requires \"props.text\"`,\n );\n }\n}\n\nfunction validateText(\n n: Record<string, unknown>,\n path: string,\n c: Collector,\n): void {\n const props = (n.props ?? {}) as Record<string, unknown>;\n if (typeof props.text !== \"string\") {\n c.add(\n `${path}/props/text`,\n \"PROPS_MISSING_REQUIRED\",\n `text requires \"props.text\"`,\n );\n }\n}\n\nfunction validateStat(\n n: Record<string, unknown>,\n path: string,\n c: Collector,\n): void {\n const props = (n.props ?? {}) as Record<string, unknown>;\n if (typeof props.label !== \"string\") {\n c.add(\n `${path}/props/label`,\n \"PROPS_MISSING_REQUIRED\",\n `stat requires \"props.label\"`,\n );\n }\n if (typeof props.value !== \"string\" && typeof props.value !== \"number\") {\n c.add(\n `${path}/props/value`,\n \"PROPS_MISSING_REQUIRED\",\n `stat requires \"props.value\" (string or number)`,\n );\n }\n}\n\nfunction validateKeyValue(\n n: Record<string, unknown>,\n path: string,\n c: Collector,\n): void {\n const props = (n.props ?? {}) as Record<string, unknown>;\n if (typeof props.label !== \"string\") {\n c.add(\n `${path}/props/label`,\n \"PROPS_MISSING_REQUIRED\",\n `key-value requires \"props.label\"`,\n );\n }\n if (typeof props.value !== \"string\") {\n c.add(\n `${path}/props/value`,\n \"PROPS_MISSING_REQUIRED\",\n `key-value requires \"props.value\"`,\n );\n }\n}\n\nfunction validateButton(\n n: Record<string, unknown>,\n path: string,\n c: Collector,\n): void {\n const props = (n.props ?? {}) as Record<string, unknown>;\n if (typeof props.label !== \"string\") {\n c.add(\n `${path}/props/label`,\n \"PROPS_MISSING_REQUIRED\",\n `button requires \"props.label\"`,\n );\n }\n}\n\nfunction validateIconButton(\n n: Record<string, unknown>,\n path: string,\n c: Collector,\n): void {\n const props = (n.props ?? {}) as Record<string, unknown>;\n if (typeof props.glyph !== \"string\") {\n c.add(\n `${path}/props/glyph`,\n \"PROPS_MISSING_REQUIRED\",\n `icon-button requires \"props.glyph\" (Glyph kind string)`,\n );\n }\n if (typeof props.ariaLabel !== \"string\" || props.ariaLabel.length === 0) {\n c.add(\n `${path}/props/ariaLabel`,\n \"PROPS_MISSING_REQUIRED\",\n `icon-button requires a non-empty \"props.ariaLabel\" (WCAG 2.1 AA)`,\n );\n }\n}\n\nfunction validateCopyButton(\n n: Record<string, unknown>,\n path: string,\n c: Collector,\n): void {\n const props = (n.props ?? {}) as Record<string, unknown>;\n if (typeof props.value !== \"string\") {\n c.add(\n `${path}/props/value`,\n \"PROPS_MISSING_REQUIRED\",\n `copy-button requires \"props.value\"`,\n );\n }\n}\n\nfunction validateSelect(\n n: Record<string, unknown>,\n path: string,\n c: Collector,\n): void {\n const props = (n.props ?? {}) as Record<string, unknown>;\n if (!Array.isArray(props.options)) {\n c.add(\n `${path}/props/options`,\n \"PROPS_MISSING_REQUIRED\",\n `select requires \"props.options\" (array of {label, value})`,\n );\n return;\n }\n props.options.forEach((opt, i) => {\n if (typeof opt !== \"object\" || opt === null) {\n c.add(\n `${path}/props/options/${i}`,\n \"PROPS_INVALID_VALUE\",\n `select option must be an object`,\n );\n return;\n }\n const o = opt as Record<string, unknown>;\n if (typeof o.label !== \"string\" || typeof o.value !== \"string\") {\n c.add(\n `${path}/props/options/${i}`,\n \"PROPS_INVALID_VALUE\",\n `select option must have string \"label\" and \"value\"`,\n );\n }\n });\n}\n\nfunction validateEmptyState(\n n: Record<string, unknown>,\n path: string,\n c: Collector,\n): void {\n const props = (n.props ?? {}) as Record<string, unknown>;\n if (typeof props.message !== \"string\") {\n c.add(\n `${path}/props/message`,\n \"PROPS_MISSING_REQUIRED\",\n `empty-state requires \"props.message\"`,\n );\n }\n}\n\nfunction validateErrorState(\n n: Record<string, unknown>,\n path: string,\n c: Collector,\n): void {\n const props = (n.props ?? {}) as Record<string, unknown>;\n if (typeof props.message !== \"string\") {\n c.add(\n `${path}/props/message`,\n \"PROPS_MISSING_REQUIRED\",\n `error-state requires \"props.message\"`,\n );\n }\n}\n\nfunction validateSkeleton(\n n: Record<string, unknown>,\n path: string,\n c: Collector,\n): void {\n const props = (n.props ?? {}) as Record<string, unknown> | undefined;\n if (props && typeof props.shape === \"string\") {\n const allowed = [\"rect\", \"circle\", \"text\"];\n if (!allowed.includes(props.shape)) {\n c.add(\n `${path}/props/shape`,\n \"PROPS_INVALID_VALUE\",\n `skeleton \"props.shape\" must be one of ${allowed.join(\" | \")}, got ${props.shape}`,\n );\n }\n if (\n props.shape === \"rect\" &&\n props.height === undefined\n ) {\n c.add(\n `${path}/props/height`,\n \"PROPS_MISSING_REQUIRED\",\n `skeleton shape='rect' requires \"props.height\"`,\n );\n }\n }\n\n // Returned silently — suppress unused-param warning\n void n;\n}\n\n// ---------------------------------------------------------------------------\n// Helpers for library consumers\n// ---------------------------------------------------------------------------\n\n/**\n * Type guard: true when `doc` is a well-formed SRP document.\n * Useful in adapter code that receives untrusted JSON.\n */\nexport function isSRPDocument(doc: unknown): doc is SRPDocument {\n const result = validateSRP(doc);\n return result.valid;\n}\n\n/**\n * Type guard: true when `node` is a well-formed SRP node.\n */\nexport function isSRPNode(node: unknown): node is SRPNode {\n const result = validateNode(node, \"\");\n return result.valid;\n}\n"]}
package/package.json ADDED
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "@syncropel/projections",
3
+ "version": "0.1.0",
4
+ "description": "TypeScript schema + validators for the Syncropel Rendering Protocol (SRP v0.1) — declarative UI documents for query-driven and AI-generated interfaces.",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ }
13
+ },
14
+ "sideEffects": false,
15
+ "files": [
16
+ "dist/",
17
+ "README.md",
18
+ "CHANGELOG.md",
19
+ "LICENSE"
20
+ ],
21
+ "scripts": {
22
+ "build": "tsc",
23
+ "typecheck": "tsc --noEmit",
24
+ "test": "tsx --test tests/*.test.ts",
25
+ "clean": "rm -rf dist"
26
+ },
27
+ "keywords": [
28
+ "syncropel",
29
+ "projections",
30
+ "srp",
31
+ "schema",
32
+ "declarative-ui"
33
+ ],
34
+ "license": "Apache-2.0",
35
+ "author": "Syncropic, Inc. <hello@syncropic.com>",
36
+ "homepage": "https://syncropel.com",
37
+ "repository": {
38
+ "type": "git",
39
+ "url": "git+https://github.com/syncropic/syncropel-core.git",
40
+ "directory": "sdks/typescript-projections"
41
+ },
42
+ "bugs": {
43
+ "url": "https://github.com/syncropic/syncropel-core/issues"
44
+ },
45
+ "publishConfig": {
46
+ "access": "public"
47
+ },
48
+ "engines": {
49
+ "node": ">=18"
50
+ },
51
+ "dependencies": {},
52
+ "devDependencies": {
53
+ "@types/node": "^22.0.0",
54
+ "tsx": "^4.0.0",
55
+ "typescript": "^5.4.0"
56
+ }
57
+ }