@rayspec/spec 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +105 -0
- package/dist/brace-params.d.ts +32 -0
- package/dist/brace-params.d.ts.map +1 -0
- package/dist/brace-params.js +89 -0
- package/dist/brace-params.js.map +1 -0
- package/dist/detect.d.ts +44 -0
- package/dist/detect.d.ts.map +1 -0
- package/dist/detect.js +72 -0
- package/dist/detect.js.map +1 -0
- package/dist/errors.d.ts +204 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +165 -0
- package/dist/errors.js.map +1 -0
- package/dist/export.d.ts +54 -0
- package/dist/export.d.ts.map +1 -0
- package/dist/export.js +121 -0
- package/dist/export.js.map +1 -0
- package/dist/grammar.d.ts +569 -0
- package/dist/grammar.d.ts.map +1 -0
- package/dist/grammar.js +503 -0
- package/dist/grammar.js.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/lint.d.ts +79 -0
- package/dist/lint.d.ts.map +1 -0
- package/dist/lint.js +823 -0
- package/dist/lint.js.map +1 -0
- package/dist/parse.d.ts +8 -0
- package/dist/parse.d.ts.map +1 -0
- package/dist/parse.js +118 -0
- package/dist/parse.js.map +1 -0
- package/dist/product-events.d.ts +73 -0
- package/dist/product-events.d.ts.map +1 -0
- package/dist/product-events.js +42 -0
- package/dist/product-events.js.map +1 -0
- package/dist/product-grammar.d.ts +948 -0
- package/dist/product-grammar.d.ts.map +1 -0
- package/dist/product-grammar.js +581 -0
- package/dist/product-grammar.js.map +1 -0
- package/dist/product-lint.d.ts +74 -0
- package/dist/product-lint.d.ts.map +1 -0
- package/dist/product-lint.js +821 -0
- package/dist/product-lint.js.map +1 -0
- package/dist/product-parse.d.ts +8 -0
- package/dist/product-parse.d.ts.map +1 -0
- package/dist/product-parse.js +119 -0
- package/dist/product-parse.js.map +1 -0
- package/dist/product-scope.d.ts +53 -0
- package/dist/product-scope.d.ts.map +1 -0
- package/dist/product-scope.js +55 -0
- package/dist/product-scope.js.map +1 -0
- package/dist/product-views-lint.d.ts +14 -0
- package/dist/product-views-lint.d.ts.map +1 -0
- package/dist/product-views-lint.js +669 -0
- package/dist/product-views-lint.js.map +1 -0
- package/dist/product-views.d.ts +426 -0
- package/dist/product-views.d.ts.map +1 -0
- package/dist/product-views.js +317 -0
- package/dist/product-views.js.map +1 -0
- package/package.json +34 -0
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Product-YAML VIEW read + projection vocabulary.
|
|
3
|
+
*
|
|
4
|
+
* This module declares HOW a Product-YAML view reads backing data and shapes its DTO — as CLOSED,
|
|
5
|
+
* FAIL-CLOSED, ZERO-CODE data. It resolves the earlier conflation of "what backing
|
|
6
|
+
* data does the view read" with "what DTO shape does it return") by giving each half its own
|
|
7
|
+
* declaration with its own validation:
|
|
8
|
+
*
|
|
9
|
+
* - `source` (+ `read`) = the BACKING DATA: a store / artifact query / capability ref, an
|
|
10
|
+
* equality filter over declared params, exclusions, ordering, and a
|
|
11
|
+
* read MODE (list | single | collect). Validated kind-aware by
|
|
12
|
+
* `product-views-lint.ts` (a contract id NEVER satisfies a source).
|
|
13
|
+
* - `response_contract` (+ `read.shape`) = the DTO: the declared contract names the client-facing
|
|
14
|
+
* shape; `shape` declares how rows PROJECT into it. Validated by the
|
|
15
|
+
* shape⊆contract conformance pass (separate from source resolution).
|
|
16
|
+
*
|
|
17
|
+
* DESIGN LAWS (enforced by product-views-lint + the @rayspec/views-runtime interpreter):
|
|
18
|
+
* - EVERYTHING here is data: literals, column names, param names, JSON paths. There is no
|
|
19
|
+
* expression language, no computed string, no handler reference — the "route declarations
|
|
20
|
+
* cannot run arbitrary code" gate is structural (closed discriminated unions + strict objects).
|
|
21
|
+
* - Every leaf carries a declared `type` from a closed set and an optional literal `default`
|
|
22
|
+
* (default `null`): a raw value that does not match the type is replaced by the default, which
|
|
23
|
+
* reproduces the frozen legacy read handlers' null-safety (`typeof x === 'number' ? x : null`)
|
|
24
|
+
* as DECLARED, stable behavior ("stable null behavior").
|
|
25
|
+
* - Recursion is real (a list item may contain lookups/items) but each context is CLOSED: an
|
|
26
|
+
* `items` (jsonb-array) shape admits only `item`/`const` fields BY CONSTRUCTION; a `read.absent`
|
|
27
|
+
* shape admits only `param`/`const`. Context rules that depend on the read mode (page fields
|
|
28
|
+
* only in `list`, group/self-counts only in `collect`, …) live in `product-views-lint.ts`.
|
|
29
|
+
*
|
|
30
|
+
* REPRESENTABLE: the recursive `ViewObjectShape` uses `z.lazy`, which the pinned zod@4.4.3
|
|
31
|
+
* `z.toJSONSchema` exports as a `$defs` self-reference (verified empirically for this shape) — so
|
|
32
|
+
* `exportProductJsonSchema` keeps working and the committed `product.schema.json` stays derivable.
|
|
33
|
+
*/
|
|
34
|
+
import { z } from 'zod';
|
|
35
|
+
import { SafeIdentifier } from './grammar.js';
|
|
36
|
+
// ---------------------------------------------------------------------------------------
|
|
37
|
+
// params — the view's DECLARED request inputs (path/query), each with a closed shape preset
|
|
38
|
+
// ---------------------------------------------------------------------------------------
|
|
39
|
+
/**
|
|
40
|
+
* The CLOSED param shape presets ("input params"). A free-form author regex is deliberately NOT
|
|
41
|
+
* offered (an adversarial pattern is a ReDoS vector; a preset set is fail-closed and product-neutral):
|
|
42
|
+
* - `safe_id` — `/^[A-Za-z0-9_.-]{1,128}$/` (a bounded id/token shape).
|
|
43
|
+
* - `positive_int` — an integer string ≥ 1.
|
|
44
|
+
* - `nonnegative_int` — an integer string ≥ 0.
|
|
45
|
+
* - `string` — any non-empty string ≤ 1024 chars (bounded; params are DATA, never code).
|
|
46
|
+
*/
|
|
47
|
+
export const ViewParamShapePreset = z.enum([
|
|
48
|
+
'safe_id',
|
|
49
|
+
'positive_int',
|
|
50
|
+
'nonnegative_int',
|
|
51
|
+
'string',
|
|
52
|
+
]);
|
|
53
|
+
export const ViewParamSpec = z
|
|
54
|
+
.object({
|
|
55
|
+
/** Where the param binds: a `{name}` path segment or a `?name=` query param. */
|
|
56
|
+
in: z.enum(['path', 'query']),
|
|
57
|
+
/**
|
|
58
|
+
* Whether the request MUST carry it. Path params are required by construction (the router only
|
|
59
|
+
* matches a present segment) — lint rejects `required:false` on a path param. Query params
|
|
60
|
+
* default to optional.
|
|
61
|
+
*/
|
|
62
|
+
required: z.boolean().optional(),
|
|
63
|
+
/** The closed validation preset (see `ViewParamShapePreset`). */
|
|
64
|
+
shape: ViewParamShapePreset,
|
|
65
|
+
/** An optional CLOSED value set (e.g. `[mic, system]`) — the param must be one of these. */
|
|
66
|
+
enum: z.array(z.string().min(1)).min(1).optional(),
|
|
67
|
+
})
|
|
68
|
+
.strict();
|
|
69
|
+
// ---------------------------------------------------------------------------------------
|
|
70
|
+
// literal values + leaf types (the closed data vocabulary)
|
|
71
|
+
// ---------------------------------------------------------------------------------------
|
|
72
|
+
/** A literal scalar (string/number/boolean). */
|
|
73
|
+
const ViewScalar = z.union([z.string(), z.number(), z.boolean()]);
|
|
74
|
+
/**
|
|
75
|
+
* A literal DATA value a view may declare: a scalar, `null`, an array of scalars (e.g. the frozen
|
|
76
|
+
* `artifacts: []`), or the EMPTY object `{}`. Nothing else — a nested object/array literal would be
|
|
77
|
+
* an un-inspected blob; richer defaults belong in the projection itself.
|
|
78
|
+
*/
|
|
79
|
+
export const ViewConstValue = z.union([
|
|
80
|
+
ViewScalar,
|
|
81
|
+
z.null(),
|
|
82
|
+
z.array(ViewScalar),
|
|
83
|
+
z.strictObject({}),
|
|
84
|
+
]);
|
|
85
|
+
/**
|
|
86
|
+
* The CLOSED leaf type a projected value is checked against. A raw value that does not match
|
|
87
|
+
* is replaced by the field's declared `default` (default `null`) — never passed through mis-typed:
|
|
88
|
+
* - `integer` — a finite integer; `number` — any finite number; `string`/`boolean` — typeof checks;
|
|
89
|
+
* - `object` — a non-null, non-array object (e.g. a persisted jsonb payload surfaced verbatim);
|
|
90
|
+
* - `array` — an array (surfaced verbatim; use `items` to PROJECT array elements instead).
|
|
91
|
+
*/
|
|
92
|
+
export const ViewLeafType = z.enum(['string', 'number', 'integer', 'boolean', 'object', 'array']);
|
|
93
|
+
// ---------------------------------------------------------------------------------------
|
|
94
|
+
// value references — how filters and sub-read matches name their inputs
|
|
95
|
+
// ---------------------------------------------------------------------------------------
|
|
96
|
+
/** A reference to a DECLARED view param (validated by lint: the param must exist in `params`). */
|
|
97
|
+
export const ViewParamRef = z.object({ param: z.string().min(1) }).strict();
|
|
98
|
+
/** A literal value. */
|
|
99
|
+
export const ViewConstRef = z.object({ const: ViewConstValue }).strict();
|
|
100
|
+
/** A reference to the PARENT row's column (sub-read matches only). */
|
|
101
|
+
export const ViewColumnRef = z.object({ column: SafeIdentifier }).strict();
|
|
102
|
+
/** A view-level filter argument: a declared param or a literal. */
|
|
103
|
+
export const ViewFilterArg = z.union([ViewParamRef, ViewConstRef]);
|
|
104
|
+
/** A sub-read match argument: the parent row's column, a declared param, or a literal. */
|
|
105
|
+
export const ViewMatchArg = z.union([ViewColumnRef, ViewParamRef, ViewConstRef]);
|
|
106
|
+
/** Order rows by a column (default `asc`). Executed server-side through the tenant-bound facade. */
|
|
107
|
+
export const ViewOrderBy = z
|
|
108
|
+
.object({ column: SafeIdentifier, dir: z.enum(['asc', 'desc']).optional() })
|
|
109
|
+
.strict();
|
|
110
|
+
/**
|
|
111
|
+
* Exclude rows where `column === equals` (e.g. the frozen `dismissed === true` skip). STRICT
|
|
112
|
+
* equality on a literal — a non-matching / malformed column value is NOT excluded (the safe
|
|
113
|
+
* read-route default: a read never hides rows on a bad flag — mirrors the canonical `=== true` test).
|
|
114
|
+
*/
|
|
115
|
+
export const ViewExclude = z
|
|
116
|
+
.object({ column: SafeIdentifier, equals: z.union([ViewScalar, z.null()]) })
|
|
117
|
+
.strict();
|
|
118
|
+
/**
|
|
119
|
+
* A nested one-to-many / one-to-one read against another STORE, keyed by equality matches. The
|
|
120
|
+
* tenant predicate is STRUCTURAL beneath every match (the interpreter reads through the tenant-bound
|
|
121
|
+
* `HandlerDb` facade over the real `TenantDb` chokepoint) — a match can narrow, never widen. A match
|
|
122
|
+
* value that resolves to `undefined`/`null` at request time yields NO rows (deterministic, no query)
|
|
123
|
+
* rather than an unfiltered read — fail-closed.
|
|
124
|
+
*/
|
|
125
|
+
export const ViewSubRead = z
|
|
126
|
+
.object({
|
|
127
|
+
store: SafeIdentifier,
|
|
128
|
+
/** Child-column → parent-column/param/literal equality matches (lint requires ≥ 1). */
|
|
129
|
+
match: z.record(SafeIdentifier, ViewMatchArg),
|
|
130
|
+
exclude: z.array(ViewExclude).optional(),
|
|
131
|
+
order_by: z.array(ViewOrderBy).optional(),
|
|
132
|
+
})
|
|
133
|
+
.strict();
|
|
134
|
+
// ---------------------------------------------------------------------------------------
|
|
135
|
+
// leaf fields
|
|
136
|
+
// ---------------------------------------------------------------------------------------
|
|
137
|
+
/** Project a row column, type-checked, with a literal default on mismatch/absence. */
|
|
138
|
+
export const ViewFieldColumn = z
|
|
139
|
+
.object({
|
|
140
|
+
kind: z.literal('column'),
|
|
141
|
+
column: SafeIdentifier,
|
|
142
|
+
type: ViewLeafType,
|
|
143
|
+
default: ViewConstValue.optional(),
|
|
144
|
+
})
|
|
145
|
+
.strict();
|
|
146
|
+
/** Project a JSON path INTO a jsonb column (e.g. `payload.duration`), type-checked + defaulted. */
|
|
147
|
+
export const ViewFieldJson = z
|
|
148
|
+
.object({
|
|
149
|
+
kind: z.literal('json'),
|
|
150
|
+
column: SafeIdentifier,
|
|
151
|
+
/** The key path into the jsonb value (data keys, no expressions). */
|
|
152
|
+
path: z.array(z.string().min(1)).min(1),
|
|
153
|
+
type: ViewLeafType,
|
|
154
|
+
default: ViewConstValue.optional(),
|
|
155
|
+
})
|
|
156
|
+
.strict();
|
|
157
|
+
/** Echo a DECLARED, validated request param (e.g. `session_id`) into the DTO. */
|
|
158
|
+
export const ViewFieldParam = z
|
|
159
|
+
.object({ kind: z.literal('param'), param: z.string().min(1) })
|
|
160
|
+
.strict();
|
|
161
|
+
/** A literal DTO value (the frozen `sample_rate: null`, `artifacts: []`, …). */
|
|
162
|
+
export const ViewFieldConst = z
|
|
163
|
+
.object({ kind: z.literal('const'), value: ViewConstValue })
|
|
164
|
+
.strict();
|
|
165
|
+
/** Inside an `items` shape ONLY: project a key path from the CURRENT array element. */
|
|
166
|
+
export const ViewFieldItem = z
|
|
167
|
+
.object({
|
|
168
|
+
kind: z.literal('item'),
|
|
169
|
+
path: z.array(z.string().min(1)).min(1),
|
|
170
|
+
type: ViewLeafType,
|
|
171
|
+
default: ViewConstValue.optional(),
|
|
172
|
+
})
|
|
173
|
+
.strict();
|
|
174
|
+
/**
|
|
175
|
+
* The shape applied to each element of a jsonb ARRAY (`items` fields). CLOSED BY CONSTRUCTION to
|
|
176
|
+
* `item`/`const` fields — an array element has no row/param context, so no other kind is even
|
|
177
|
+
* representable here (fail-closed at the grammar, not by convention).
|
|
178
|
+
*/
|
|
179
|
+
export const ViewItemShape = z
|
|
180
|
+
.object({ fields: z.record(SafeIdentifier, z.union([ViewFieldItem, ViewFieldConst])) })
|
|
181
|
+
.strict();
|
|
182
|
+
/** The scalar a `lookup` extracts from its matched row: a column, optionally a JSON path into it. */
|
|
183
|
+
export const ViewLookupLeaf = z
|
|
184
|
+
.object({ column: SafeIdentifier, path: z.array(z.string().min(1)).optional() })
|
|
185
|
+
.strict();
|
|
186
|
+
/** The leaf a `group` extracts per row (like a column/json leaf, without the `kind` tag). */
|
|
187
|
+
export const ViewGroupValue = z
|
|
188
|
+
.object({
|
|
189
|
+
column: SafeIdentifier,
|
|
190
|
+
path: z.array(z.string().min(1)).optional(),
|
|
191
|
+
type: ViewLeafType,
|
|
192
|
+
default: ViewConstValue.optional(),
|
|
193
|
+
})
|
|
194
|
+
.strict();
|
|
195
|
+
/**
|
|
196
|
+
* The recursive object shape. `z.lazy` defers the union so `list`/`group`/`page_items` can nest
|
|
197
|
+
* shapes; zod@4.4.3 parses this and `z.toJSONSchema` exports it as a `$defs` self-reference.
|
|
198
|
+
*/
|
|
199
|
+
export const ViewObjectShape = z
|
|
200
|
+
.object({
|
|
201
|
+
fields: z.record(SafeIdentifier, z.lazy(() => ViewField)),
|
|
202
|
+
})
|
|
203
|
+
.strict();
|
|
204
|
+
const ViewFieldItemsSchema = z
|
|
205
|
+
.object({
|
|
206
|
+
kind: z.literal('items'),
|
|
207
|
+
column: SafeIdentifier,
|
|
208
|
+
path: z.array(z.string().min(1)).optional(),
|
|
209
|
+
shape: ViewItemShape,
|
|
210
|
+
})
|
|
211
|
+
.strict();
|
|
212
|
+
const ViewFieldListSchema = z
|
|
213
|
+
.object({ kind: z.literal('list'), source: ViewSubRead, shape: ViewObjectShape })
|
|
214
|
+
.strict();
|
|
215
|
+
const ViewFieldLookupSchema = z
|
|
216
|
+
.object({
|
|
217
|
+
kind: z.literal('lookup'),
|
|
218
|
+
source: ViewSubRead,
|
|
219
|
+
field: ViewLookupLeaf,
|
|
220
|
+
type: ViewLeafType,
|
|
221
|
+
default: ViewConstValue.optional(),
|
|
222
|
+
})
|
|
223
|
+
.strict();
|
|
224
|
+
const ViewFieldCountsSchema = z
|
|
225
|
+
.object({
|
|
226
|
+
kind: z.literal('counts'),
|
|
227
|
+
of: ViewSubRead.optional(),
|
|
228
|
+
by: SafeIdentifier,
|
|
229
|
+
buckets: z.array(SafeIdentifier).min(1),
|
|
230
|
+
total: z.enum(['all_rows', 'bucket_rows']),
|
|
231
|
+
})
|
|
232
|
+
.strict();
|
|
233
|
+
const ViewFieldGroupSchema = z
|
|
234
|
+
.object({
|
|
235
|
+
kind: z.literal('group'),
|
|
236
|
+
column: SafeIdentifier,
|
|
237
|
+
equals: ViewScalar,
|
|
238
|
+
mode: z.enum(['list', 'first', 'last']),
|
|
239
|
+
value: ViewGroupValue.optional(),
|
|
240
|
+
shape: ViewObjectShape.optional(),
|
|
241
|
+
absent: ViewConstValue.optional(),
|
|
242
|
+
})
|
|
243
|
+
.strict();
|
|
244
|
+
const ViewFieldPageItemsSchema = z
|
|
245
|
+
.object({ kind: z.literal('page_items'), shape: ViewObjectShape })
|
|
246
|
+
.strict();
|
|
247
|
+
const ViewFieldPageTotalSchema = z.object({ kind: z.literal('page_total') }).strict();
|
|
248
|
+
const ViewFieldPageNextOffsetSchema = z.object({ kind: z.literal('page_next_offset') }).strict();
|
|
249
|
+
/**
|
|
250
|
+
* The CLOSED field union. An unknown/typo'd `kind` is fail-closed-rejected by the discriminated
|
|
251
|
+
* union (a `schema_violation`, never a silently-dropped field — the FAIL-OPEN lesson: reject loudly).
|
|
252
|
+
*/
|
|
253
|
+
export const ViewField = z.discriminatedUnion('kind', [
|
|
254
|
+
ViewFieldColumn,
|
|
255
|
+
ViewFieldJson,
|
|
256
|
+
ViewFieldParam,
|
|
257
|
+
ViewFieldConst,
|
|
258
|
+
ViewFieldItemsSchema,
|
|
259
|
+
ViewFieldListSchema,
|
|
260
|
+
ViewFieldLookupSchema,
|
|
261
|
+
ViewFieldCountsSchema,
|
|
262
|
+
ViewFieldGroupSchema,
|
|
263
|
+
ViewFieldPageItemsSchema,
|
|
264
|
+
ViewFieldPageTotalSchema,
|
|
265
|
+
ViewFieldPageNextOffsetSchema,
|
|
266
|
+
]);
|
|
267
|
+
// ---------------------------------------------------------------------------------------
|
|
268
|
+
// read — the view's declarative read (mode + filter + shape [+ absent])
|
|
269
|
+
// ---------------------------------------------------------------------------------------
|
|
270
|
+
/**
|
|
271
|
+
* How the view reads its source:
|
|
272
|
+
* - `list` — many rows, PAGINATED (pagination declaration required): the top-level shape is the
|
|
273
|
+
* ENVELOPE (page_items / page_total / page_next_offset + param/const fields only).
|
|
274
|
+
* - `single` — the first matching row: the top-level shape projects THAT row; `absent` (or
|
|
275
|
+
* `absent_state: not_ready_409`) declares what happens when there is none.
|
|
276
|
+
* - `collect` — ALL matching rows, aggregated: the top-level shape admits param/const/group/counts.
|
|
277
|
+
*/
|
|
278
|
+
export const ViewReadMode = z.enum(['list', 'single', 'collect']);
|
|
279
|
+
/**
|
|
280
|
+
* The absent-row DTO for `single` mode with `absent_state: empty_200` (the frozen absent-transcript /
|
|
281
|
+
* absent-intelligence 200 shapes). CLOSED to `param`/`const` fields by construction — there is no row
|
|
282
|
+
* to project from.
|
|
283
|
+
*/
|
|
284
|
+
export const ViewAbsentShape = z
|
|
285
|
+
.object({ fields: z.record(SafeIdentifier, z.union([ViewFieldParam, ViewFieldConst])) })
|
|
286
|
+
.strict();
|
|
287
|
+
export const ViewRead = z
|
|
288
|
+
.object({
|
|
289
|
+
mode: ViewReadMode,
|
|
290
|
+
/** Source-column → param/literal equality filter (AND; the tenant predicate is beneath it). */
|
|
291
|
+
filter: z.record(SafeIdentifier, ViewFilterArg).optional(),
|
|
292
|
+
exclude: z.array(ViewExclude).optional(),
|
|
293
|
+
order_by: z.array(ViewOrderBy).optional(),
|
|
294
|
+
/** The DTO projection (SEPARATE from `response_contract`, which names the contract it must fit). */
|
|
295
|
+
shape: ViewObjectShape,
|
|
296
|
+
/** `single` + `empty_200` ONLY: the absent-row DTO. */
|
|
297
|
+
absent: ViewAbsentShape.optional(),
|
|
298
|
+
})
|
|
299
|
+
.strict();
|
|
300
|
+
/**
|
|
301
|
+
* Conditional-read behavior. `etag` (GET only): the runtime derives a strong ETag from the
|
|
302
|
+
* response DTO, sets it on the 200, and answers a matching `If-None-Match` with a bodyless 304.
|
|
303
|
+
* `If-Range` is DELIBERATELY not a view construct: byte-range serving is Tier-B media-capability
|
|
304
|
+
* behavior (a media-serving concern), never a Product-YAML view — so it cannot be mis-declared.
|
|
305
|
+
*/
|
|
306
|
+
export const ViewConditionalRead = z.enum(['etag']);
|
|
307
|
+
/**
|
|
308
|
+
* DTO field / param names that can never be declared (prototype-pollution guards). `SafeIdentifier`
|
|
309
|
+
* admits a leading underscore, so `__proto__` would otherwise pass — lint rejects these everywhere a
|
|
310
|
+
* name is declared (fields, params, match keys, buckets).
|
|
311
|
+
*/
|
|
312
|
+
export const VIEW_RESERVED_NAMES = new Set([
|
|
313
|
+
'__proto__',
|
|
314
|
+
'constructor',
|
|
315
|
+
'prototype',
|
|
316
|
+
]);
|
|
317
|
+
//# sourceMappingURL=product-views.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-views.js","sourceRoot":"","sources":["../src/product-views.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,0FAA0F;AAC1F,4FAA4F;AAC5F,0FAA0F;AAE1F;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,IAAI,CAAC;IACzC,SAAS;IACT,cAAc;IACd,iBAAiB;IACjB,QAAQ;CACT,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC;KAC3B,MAAM,CAAC;IACN,gFAAgF;IAChF,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7B;;;;OAIG;IACH,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAChC,iEAAiE;IACjE,KAAK,EAAE,oBAAoB;IAC3B,4FAA4F;IAC5F,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;CACnD,CAAC;KACD,MAAM,EAAE,CAAC;AAGZ,0FAA0F;AAC1F,2DAA2D;AAC3D,0FAA0F;AAE1F,gDAAgD;AAChD,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE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AAQ,EAAE;IAC1D,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,QAAQ,EAAE;IACxC,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,QAAQ,EAAE;IACzC,oGAAoG;IACpG,KAAK,EAAE,eAAe;IACtB,uDAAuD;IACvD,MAAM,EAAE,eAAe,CAAC,QAAQ,EAAE;CACnC,CAAC;KACD,MAAM,EAAE,CAAC;AAGZ;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAGpD;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAwB,IAAI,GAAG,CAAC;IAC9D,WAAW;IACX,aAAa;IACb,WAAW;CACZ,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@rayspec/spec",
|
|
3
|
+
"version": "1.5.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"files": [
|
|
6
|
+
"dist"
|
|
7
|
+
],
|
|
8
|
+
"license": "FSL-1.1-ALv2",
|
|
9
|
+
"type": "module",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"main": "./dist/index.js",
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"ajv": "8.20.0",
|
|
20
|
+
"yaml": "2.9.0",
|
|
21
|
+
"zod": "4.4.3",
|
|
22
|
+
"@rayspec/core": "1.5.0"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@types/node": "22.12.0",
|
|
26
|
+
"typescript": "5.9.3",
|
|
27
|
+
"vitest": "4.1.9"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build": "tsc -b",
|
|
31
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
32
|
+
"test": "vitest run"
|
|
33
|
+
}
|
|
34
|
+
}
|