@lunora/bindings 1.0.0-alpha.4 → 1.0.0-alpha.41

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.
Files changed (58) hide show
  1. package/LICENSE.md +6 -0
  2. package/dist/analytics/index.d.mts +73 -84
  3. package/dist/analytics/index.d.ts +73 -84
  4. package/dist/analytics/index.mjs +1 -2
  5. package/dist/images/index.d.mts +173 -149
  6. package/dist/images/index.d.ts +173 -149
  7. package/dist/images/index.mjs +1 -3
  8. package/dist/kv/index.d.mts +74 -151
  9. package/dist/kv/index.d.ts +74 -151
  10. package/dist/kv/index.mjs +1 -2
  11. package/dist/packem_shared/AnalyticsSqlError-BEKML_Dg.mjs +1 -0
  12. package/dist/packem_shared/R2SqlError-CJ_zgztT.mjs +1 -0
  13. package/dist/packem_shared/SelectBuilder-Dnqem9T0.mjs +1 -0
  14. package/dist/packem_shared/SetOperation-kiI5Wnlm.mjs +1 -0
  15. package/dist/packem_shared/Sql-BfnxRway.mjs +1 -0
  16. package/dist/packem_shared/WindowExpression-VX7EEV3h.mjs +1 -0
  17. package/dist/packem_shared/WindowFunction-CL4jYy2l.mjs +1 -0
  18. package/dist/packem_shared/asc-DP_WFiAE.mjs +1 -0
  19. package/dist/packem_shared/buildImageDeliveryUrl-Brqs-dcZ.mjs +1 -0
  20. package/dist/packem_shared/buildSignedImageUrl-DbSDmjWK.mjs +4 -0
  21. package/dist/packem_shared/concurrent-vRmSvRpF.mjs +1 -0
  22. package/dist/packem_shared/createAnalytics-BXTNc57d.mjs +1 -0
  23. package/dist/packem_shared/createContextVectors-Bk6ZVCqQ.mjs +6 -0
  24. package/dist/packem_shared/createImages-CHgMZP4g.mjs +1 -0
  25. package/dist/packem_shared/createKv-B0RfMMal.mjs +1 -0
  26. package/dist/packem_shared/createKvIntrospector-DT1k8mCG.mjs +1 -0
  27. package/dist/packem_shared/createPipelines-CIvqrc7E.mjs +1 -0
  28. package/dist/packem_shared/createVectorAdminIntrospector-DrsigTJs.mjs +1 -0
  29. package/dist/packem_shared/createVectors-DirhBYpw.mjs +1 -0
  30. package/dist/pipelines/index.d.mts +24 -24
  31. package/dist/pipelines/index.d.ts +24 -24
  32. package/dist/pipelines/index.mjs +1 -1
  33. package/dist/r2sql/index.d.mts +148 -123
  34. package/dist/r2sql/index.d.ts +148 -123
  35. package/dist/r2sql/index.mjs +1 -7
  36. package/dist/vectors/index.d.mts +185 -134
  37. package/dist/vectors/index.d.ts +185 -134
  38. package/dist/vectors/index.mjs +1 -3
  39. package/package.json +3 -2
  40. package/dist/packem_shared/AnalyticsSqlError-C2nz3jpH.mjs +0 -41
  41. package/dist/packem_shared/R2SqlError-Boygg3S0.mjs +0 -65
  42. package/dist/packem_shared/SelectBuilder-DHaXZwn_.mjs +0 -167
  43. package/dist/packem_shared/SetOperation-RDHcxccj.mjs +0 -80
  44. package/dist/packem_shared/Sql-DceGtcUd.mjs +0 -68
  45. package/dist/packem_shared/WindowExpression-Cg9s2xcr.mjs +0 -44
  46. package/dist/packem_shared/WindowFunction-DA3pGC3N.mjs +0 -82
  47. package/dist/packem_shared/asc-Cur-xO8v.mjs +0 -16
  48. package/dist/packem_shared/buildImageDeliveryUrl-B6_QU91n.mjs +0 -33
  49. package/dist/packem_shared/buildSignedImageUrl-6iibA9v1.mjs +0 -113
  50. package/dist/packem_shared/concurrent-Dj5sOibv.mjs +0 -23
  51. package/dist/packem_shared/createAnalytics-CEEI69o9.mjs +0 -57
  52. package/dist/packem_shared/createContextVectors-BSizpmu5.mjs +0 -140
  53. package/dist/packem_shared/createImages-BzRnsz3H.mjs +0 -85
  54. package/dist/packem_shared/createKv-7lNrS1W2.mjs +0 -143
  55. package/dist/packem_shared/createKvIntrospector-CrAgQp1w.mjs +0 -77
  56. package/dist/packem_shared/createPipelines-CfyJ6VGu.mjs +0 -10
  57. package/dist/packem_shared/createVectorAdminIntrospector-C-qTDWA1.mjs +0 -53
  58. package/dist/packem_shared/createVectors-DqxgEPQb.mjs +0 -95
@@ -1,8 +1,8 @@
1
1
  import { LunoraError } from '@lunora/errors';
2
2
  /**
3
- * A composed SQL fragment. Carries the finished `text`; `toString()` returns it
4
- * so a fragment can be dropped straight into a template or `String(...)`.
5
- */
3
+ * A composed SQL fragment. Carries the finished `text`; `toString()` returns it
4
+ * so a fragment can be dropped straight into a template or `String(...)`.
5
+ */
6
6
  declare class Sql {
7
7
  readonly text: string;
8
8
  constructor(text: string);
@@ -11,32 +11,32 @@ declare class Sql {
11
11
  /** True when `value` is a {@link Sql} fragment (an already-trusted, pre-escaped span). */
12
12
  declare const isSql: (value: unknown) => value is Sql;
13
13
  /**
14
- * Wrap an already-trusted string as a {@link Sql} fragment so {@link sql}
15
- * splices it **verbatim** (no escaping). Use ONLY for SQL you constructed
16
- * yourself (identifiers, keywords, sub-fragments) — never for user input.
17
- */
14
+ * Wrap an already-trusted string as a {@link Sql} fragment so {@link sql}
15
+ * splices it **verbatim** (no escaping). Use ONLY for SQL you constructed
16
+ * yourself (identifiers, keywords, sub-fragments) — never for user input.
17
+ */
18
18
  declare const raw: (text: string) => Sql;
19
19
  /** Resolve a `string | Sql` to its raw text. A bare string is taken as trusted SQL (callers pass identifiers/fragments here). */
20
20
  declare const toText: (value: Sql | string) => string;
21
21
  /**
22
- * Render a JS value as an R2 SQL literal:
23
- *
24
- * - `null` / `undefined` → `NULL`
25
- * - `boolean` → `true` / `false`
26
- * - finite `number` / `bigint` → the numeric text (non-finite throws — `NaN`/`Infinity` have no SQL literal)
27
- * - `Date` → an RFC3339 string literal (R2 SQL's `timestamp` form)
28
- * - `string` → a single-quoted, escaped literal
29
- * - `Array` → a parenthesised, comma-separated list of literals (for `IN (...)`)
30
- *
31
- * Anything else (object, symbol, function) throws — there is no safe SQL literal
32
- * for it, and silently coercing would risk a malformed or injectable statement.
33
- */
22
+ * Render a JS value as an R2 SQL literal:
23
+ *
24
+ * - `null` / `undefined` → `NULL`
25
+ * - `boolean` → `true` / `false`
26
+ * - finite `number` / `bigint` → the numeric text (non-finite throws — `NaN`/`Infinity` have no SQL literal)
27
+ * - `Date` → an RFC3339 string literal (R2 SQL's `timestamp` form; an invalid `Date` throws)
28
+ * - `string` → a single-quoted, escaped literal
29
+ * - `Array` → a parenthesised, comma-separated list of literals (for `IN (...)`)
30
+ *
31
+ * Anything else (object, symbol, function) throws — there is no safe SQL literal
32
+ * for it, and silently coercing would risk a malformed or injectable statement.
33
+ */
34
34
  declare const lit: (value: unknown) => string;
35
35
  /**
36
- * Tagged template producing a safe {@link Sql} fragment. Each interpolation is
37
- * escaped with {@link lit} unless it is already a {@link Sql} (spliced
38
- * verbatim), so user values can never break out of their literal.
39
- */
36
+ * Tagged template producing a safe {@link Sql} fragment. Each interpolation is
37
+ * escaped with {@link lit} unless it is already a {@link Sql} (spliced
38
+ * verbatim), so user values can never break out of their literal.
39
+ */
40
40
  declare const sql: (strings: TemplateStringsArray, ...values: unknown[]) => Sql;
41
41
  /** Join SQL fragments/strings with `separator` into one {@link Sql} (e.g. `AND`-ed conditions). */
42
42
  declare const joinSql: (parts: ReadonlyArray<Sql | string>, separator: string) => Sql;
@@ -52,29 +52,29 @@ declare const desc: (expr: Sql | string) => OrderTerm;
52
52
  /** Render one {@link OrderTerm} to SQL. */
53
53
  declare const renderOrderTerm: (term: OrderTerm) => string;
54
54
  /**
55
- * Public types for `@lunora/bindings/r2sql`.
56
- *
57
- * R2 SQL is Cloudflare's serverless, distributed query engine over **Apache
58
- * Iceberg** tables in [R2 Data Catalog](https://developers.cloudflare.com/r2/data-catalog/).
59
- * It has **no Workers binding** — every query is an HTTPS round-trip to the REST
60
- * endpoint (`POST …/r2-sql/query/{bucket}`). So, like Hyperdrive's `ctx.sql`, the
61
- * client is **non-deterministic external I/O**: it is wired onto `ActionCtx`
62
- * only (see the `r2sql_outside_action` advisor lint) and its reads are NOT
63
- * tracked by Lunora live queries.
64
- *
65
- * Everything here is deliberately structural (no hard dependency on
66
- * `@cloudflare/workers-types`) so unit tests can inject a plain `fetch` double
67
- * and never touch the network — mirroring `AnalyticsSqlConfig` in
68
- * `@lunora/bindings/analytics`.
69
- */
55
+ * Public types for `@lunora/bindings/r2sql`.
56
+ *
57
+ * R2 SQL is Cloudflare's serverless, distributed query engine over **Apache
58
+ * Iceberg** tables in [R2 Data Catalog](https://developers.cloudflare.com/r2/data-catalog/).
59
+ * It has **no Workers binding** — every query is an HTTPS round-trip to the REST
60
+ * endpoint (`POST …/r2-sql/query/{bucket}`). So, like Hyperdrive's `ctx.sql`, the
61
+ * client is **non-deterministic external I/O**: it is wired onto `ActionCtx`
62
+ * only (see the `r2sql_outside_action` advisor lint) and its reads are NOT
63
+ * tracked by Lunora live queries.
64
+ *
65
+ * Everything here is deliberately structural (no hard dependency on
66
+ * `@cloudflare/workers-types`) so unit tests can inject a plain `fetch` double
67
+ * and never touch the network — mirroring `AnalyticsSqlConfig` in
68
+ * `@lunora/bindings/analytics`.
69
+ */
70
70
  /**
71
- * Configuration for a {@link import("./client").R2SqlClient | R2SqlClient}.
72
- *
73
- * `apiToken` is a **secret** — a Cloudflare API token scoped to R2 SQL (read),
74
- * R2 Data Catalog, and R2 storage. It is never a binding and must never be
75
- * auto-scaffolded with a real value; the caller provides it from
76
- * env/`.dev.vars`.
77
- */
71
+ * Configuration for a {@link import("./client").R2SqlClient | R2SqlClient}.
72
+ *
73
+ * `apiToken` is a **secret** — a Cloudflare API token scoped to R2 SQL (read),
74
+ * R2 Data Catalog, and R2 storage. It is never a binding and must never be
75
+ * auto-scaffolded with a real value; the caller provides it from
76
+ * env/`.dev.vars`.
77
+ */
78
78
  interface R2SqlConfig {
79
79
  /** Cloudflare account id that owns the bucket/catalog. */
80
80
  accountId: string;
@@ -83,36 +83,46 @@ interface R2SqlConfig {
83
83
  /** The R2 bucket (warehouse) whose Data Catalog the queries run against. */
84
84
  bucket: string;
85
85
  /**
86
- * Override the REST base URL. Defaults to Cloudflare's public R2 SQL host
87
- * (`https://api.sql.cloudflarestorage.com/api/v1/accounts`). Injected in
88
- * tests, or pointed at a regional/preview host.
89
- */
86
+ * Override the REST base URL. Defaults to Cloudflare's public R2 SQL host
87
+ * (`https://api.sql.cloudflarestorage.com/api/v1/accounts`). Injected in
88
+ * tests, or pointed at a regional/preview host.
89
+ */
90
90
  endpoint?: string;
91
91
  /**
92
- * `fetch` implementation. Defaults to the global `fetch`; injected in tests
93
- * so a query never touches the network.
94
- */
92
+ * `fetch` implementation. Defaults to the global `fetch`; injected in tests
93
+ * so a query never touches the network.
94
+ */
95
95
  fetch?: typeof globalThis.fetch;
96
+ /**
97
+ * Milliseconds before an in-flight query (the fetch AND its body read) is
98
+ * aborted and surfaced as an `R2SqlError` with status 504. Defaults to
99
+ * 60_000 — analytical scans legitimately run tens of seconds. `undefined`
100
+ * means the default, not unbounded.
101
+ *
102
+ * The deadline is carried by the request's `signal`, so a custom `fetch`
103
+ * (above) that ignores `signal` leaves the query unbounded.
104
+ */
105
+ timeoutMs?: number;
96
106
  }
97
107
  /**
98
- * One column descriptor in a result's schema: the column `name` and, when the
99
- * engine reports it, the Iceberg storage `type` (`integer`, `string`,
100
- * `timestamp`, …). R2 SQL does not always echo a schema block, so `type` is
101
- * optional and `columns` may be derived from the first row's keys.
102
- */
108
+ * One column descriptor in a result's schema: the column `name` and, when the
109
+ * engine reports it, the Iceberg storage `type` (`integer`, `string`,
110
+ * `timestamp`, …). R2 SQL does not always echo a schema block, so `type` is
111
+ * optional and `columns` may be derived from the first row's keys.
112
+ */
103
113
  interface R2SqlColumn {
104
114
  name: string;
105
115
  type?: string;
106
116
  }
107
117
  /**
108
- * A parsed R2 SQL result. R2 SQL returns a Cloudflare envelope
109
- * (`{ success, result, errors }`); we surface the `rows` (the `result` array of
110
- * column→value records), the inferred/echoed `columns`, and the `rowCount`.
111
- *
112
- * `Row` defaults to an open record; supply it (`from&lt;MyRow>(…)` /
113
- * `query&lt;MyRow>(…)`) to get typed result fields — R2 SQL tables live in Iceberg,
114
- * not `defineSchema`, so the row type is caller-declared rather than inferred.
115
- */
118
+ * A parsed R2 SQL result. R2 SQL returns a Cloudflare envelope
119
+ * (`{ success, result, errors }`); we surface the `rows` (the `result` array of
120
+ * column→value records), the inferred/echoed `columns`, and the `rowCount`.
121
+ *
122
+ * `Row` defaults to an open record; supply it (`from<MyRow>(…)` /
123
+ * `query<MyRow>(…)`) to get typed result fields — R2 SQL tables live in Iceberg,
124
+ * not `defineSchema`, so the row type is caller-declared rather than inferred.
125
+ */
116
126
  interface R2SqlResult<Row = Record<string, unknown>> {
117
127
  /** Column descriptors, echoed by the engine or inferred from the first row. */
118
128
  columns: R2SqlColumn[];
@@ -124,25 +134,25 @@ interface R2SqlResult<Row = Record<string, unknown>> {
124
134
  /** Options for {@link import("./client").R2SqlClient.explain | explain}. */
125
135
  interface R2SqlExplainOptions {
126
136
  /**
127
- * `"json"` runs `EXPLAIN FORMAT JSON` (structured plan); `"text"` (default)
128
- * runs a plain `EXPLAIN`.
129
- */
137
+ * `"json"` runs `EXPLAIN FORMAT JSON` (structured plan); `"text"` (default)
138
+ * runs a plain `EXPLAIN`.
139
+ */
130
140
  format?: "json" | "text";
131
141
  }
132
142
  /**
133
- * Executes a finished SQL string against R2 SQL and returns the parsed result.
134
- * Deliberately non-generic (the row type is a caller-side concern) — the typed
135
- * `run()` / `query()` boundaries cast the open result to the declared row.
136
- */
143
+ * Executes a finished SQL string against R2 SQL and returns the parsed result.
144
+ * Deliberately non-generic (the row type is a caller-side concern) — the typed
145
+ * `run()` / `query()` boundaries cast the open result to the declared row.
146
+ */
137
147
  type QueryExecutor = (statement: string) => Promise<R2SqlResult>;
138
148
  /** Anything that compiles to a statement and can run — a {@link import("./builder").SelectBuilder | SelectBuilder} or {@link import("./set-operation").SetOperation | SetOperation}. */
139
149
  interface Queryable<Row = Record<string, unknown>> {
140
150
  /**
141
- * True when this query carries its own `ORDER BY`/`LIMIT`, so a set
142
- * operation must parenthesise it (R2 SQL rejects a bare `LIMIT` before a set
143
- * operator). Read structurally by the set-operation renderer to avoid an
144
- * import cycle.
145
- */
151
+ * True when this query carries its own `ORDER BY`/`LIMIT`, so a set
152
+ * operation must parenthesise it (R2 SQL rejects a bare `LIMIT` before a set
153
+ * operator). Read structurally by the set-operation renderer to avoid an
154
+ * import cycle.
155
+ */
146
156
  readonly needsWrapForSetOperation?: boolean;
147
157
  run: () => Promise<R2SqlResult<Row>>;
148
158
  toSQL: () => string;
@@ -155,16 +165,16 @@ interface SetMember {
155
165
  query: Queryable<unknown>;
156
166
  }
157
167
  /**
158
- * A composition of queries via set operations. Chain more operations, or apply a
159
- * single `ORDER BY` / `LIMIT` to the combined result.
160
- */
168
+ * A composition of queries via set operations. Chain more operations, or apply a
169
+ * single `ORDER BY` / `LIMIT` to the combined result.
170
+ */
161
171
  declare class SetOperation<Row = Record<string, unknown>> implements Queryable<Row> {
162
172
  /**
163
- * Always `true`: a nested set operation must be parenthesised when it is a
164
- * member of another set operation, or mixed operators mis-associate — e.g.
165
- * `a.union(b.except(c))` must render `a UNION (b EXCEPT c)`, not the flat
166
- * `a UNION b EXCEPT c`.
167
- */
173
+ * Always `true`: a nested set operation must be parenthesised when it is a
174
+ * member of another set operation, or mixed operators mis-associate — e.g.
175
+ * `a.union(b.except(c))` must render `a UNION (b EXCEPT c)`, not the flat
176
+ * `a UNION b EXCEPT c`.
177
+ */
168
178
  readonly needsWrapForSetOperation = true;
169
179
  private readonly exec;
170
180
  private readonly members;
@@ -192,9 +202,9 @@ declare class SetOperation<Row = Record<string, unknown>> implements Queryable<R
192
202
  private add;
193
203
  }
194
204
  /**
195
- * A fluent `SELECT` over one Iceberg table (`namespace.table`), generic over the
196
- * caller-declared `Row` result type.
197
- */
205
+ * A fluent `SELECT` over one Iceberg table (`namespace.table`), generic over the
206
+ * caller-declared `Row` result type.
207
+ */
198
208
  declare class SelectBuilder<Row = Record<string, unknown>> implements Queryable<Row> {
199
209
  private readonly exec;
200
210
  private readonly table;
@@ -232,9 +242,9 @@ declare class SelectBuilder<Row = Record<string, unknown>> implements Queryable<
232
242
  /** Add `HAVING` condition(s) over aggregates; multiple are `AND`-ed. */
233
243
  having(...conditions: Condition[]): this;
234
244
  /**
235
- * `QUALIFY` — filter on a window function without a subquery, e.g.
236
- * `.qualify(fn.rowNumber().over({ partitionBy: "region", orderBy: desc("total") }).lte(3))`.
237
- */
245
+ * `QUALIFY` — filter on a window function without a subquery, e.g.
246
+ * `.qualify(fn.rowNumber().over({ partitionBy: "region", orderBy: desc("total") }).lte(3))`.
247
+ */
238
248
  qualify(condition: Condition): this;
239
249
  /** `ORDER BY` term(s) — bare strings (ASC) or {@link import("./order").asc | asc}/{@link import("./order").desc | desc} tags. */
240
250
  orderBy(...terms: OrderTerm[]): this;
@@ -262,18 +272,18 @@ declare class SelectBuilder<Row = Record<string, unknown>> implements Queryable<
262
272
  private setOperation;
263
273
  }
264
274
  /**
265
- * Thrown when R2 SQL responds with a non-2xx status, an `success: false`
266
- * envelope, or an unparseable body; carries the HTTP `status` and the raw body
267
- * for the caller to surface.
268
- */
275
+ * Thrown when R2 SQL responds with a non-2xx status, an `success: false`
276
+ * envelope, or an unparseable body; carries the HTTP `status` and the raw body
277
+ * for the caller to surface.
278
+ */
269
279
  declare class R2SqlError extends LunoraError {
270
280
  constructor(status: number, body: string);
271
281
  }
272
282
  /**
273
- * The typed R2 SQL surface bound to `ctx.r2sql` on **`ActionCtx` only**. This is
274
- * the exact type the generated ctx imports as
275
- * `import("@lunora/bindings/r2sql").R2SqlClient` — keep the name and shape stable.
276
- */
283
+ * The typed R2 SQL surface bound to `ctx.r2sql` on **`ActionCtx` only**. This is
284
+ * the exact type the generated ctx imports as
285
+ * `import("@lunora/bindings/r2sql").R2SqlClient` — keep the name and shape stable.
286
+ */
277
287
  interface R2SqlClient {
278
288
  /** Run `DESCRIBE namespace.table` — column names and Iceberg types. */
279
289
  describe: (table: string) => Promise<R2SqlResult>;
@@ -289,16 +299,16 @@ interface R2SqlClient {
289
299
  showTables: (namespace: string) => Promise<R2SqlResult>;
290
300
  }
291
301
  /**
292
- * Build an {@link R2SqlClient}. Each query POSTs to the bucket's
293
- * `r2-sql/query/{bucket}` endpoint with the bearer token, then normalises the
294
- * envelope into {@link R2SqlResult}.
295
- */
302
+ * Build an {@link R2SqlClient}. Each query POSTs to the bucket's
303
+ * `r2-sql/query/{bucket}` endpoint with the bearer token, then normalises the
304
+ * envelope into {@link R2SqlResult}.
305
+ */
296
306
  declare const createR2Sql: (config: R2SqlConfig) => R2SqlClient;
297
307
  /**
298
- * A windowed expression. Extends {@link Sql}, so it is usable anywhere a raw
299
- * fragment is; `.as(alias)` makes a `SELECT` item, and the comparison helpers
300
- * (`.lte`, `.gt`, `.between`, …) make `QUALIFY` conditions.
301
- */
308
+ * A windowed expression. Extends {@link Sql}, so it is usable anywhere a raw
309
+ * fragment is; `.as(alias)` makes a `SELECT` item, and the comparison helpers
310
+ * (`.lte`, `.gt`, `.between`, …) make `QUALIFY` conditions.
311
+ */
302
312
  declare class WindowExpression extends Sql {
303
313
  /** Alias the expression — `... AS alias` — for use in a `SELECT` list. */
304
314
  as(alias: string): Sql;
@@ -310,18 +320,18 @@ declare class WindowExpression extends Sql {
310
320
  gt(value: unknown): Sql;
311
321
  /** `expr >= value`. */
312
322
  gte(value: unknown): Sql;
313
- /** `expr &lt; value`. */
323
+ /** `expr < value`. */
314
324
  lt(value: unknown): Sql;
315
- /** `expr &lt;= value`. */
325
+ /** `expr <= value`. */
316
326
  lte(value: unknown): Sql;
317
327
  private compare;
318
328
  }
319
329
  /** The `OVER (...)` window specification. */
320
330
  interface OverSpec {
321
331
  /**
322
- * A raw frame clause, e.g. `"ROWS BETWEEN 2 PRECEDING AND CURRENT ROW"`.
323
- * Spliced verbatim — it is keyword-only SQL, not a value.
324
- */
332
+ * A raw frame clause, e.g. `"ROWS BETWEEN 2 PRECEDING AND CURRENT ROW"`.
333
+ * Spliced verbatim — it is keyword-only SQL, not a value.
334
+ */
325
335
  frame?: string;
326
336
  /** `ORDER BY` term(s) within the window. */
327
337
  orderBy?: OrderTerm | OrderTerm[];
@@ -329,9 +339,9 @@ interface OverSpec {
329
339
  partitionBy?: Sql | string | (Sql | string)[];
330
340
  }
331
341
  /**
332
- * A window function awaiting its `OVER (...)`. Call {@link WindowFunction.over |
333
- * .over} to bind a window and get a {@link WindowExpression}.
334
- */
342
+ * A window function awaiting its `OVER (...)`. Call {@link WindowFunction.over |
343
+ * .over} to bind a window and get a {@link WindowExpression}.
344
+ */
335
345
  declare class WindowFunction {
336
346
  private readonly callText;
337
347
  constructor(callText: string);
@@ -339,13 +349,13 @@ declare class WindowFunction {
339
349
  over(spec?: OverSpec): WindowExpression;
340
350
  }
341
351
  /**
342
- * Window-function builders. Each returns a {@link WindowFunction}; chain
343
- * `.over(...)` to bind the window.
344
- *
345
- * Ranking: `rowNumber`, `rank`, `denseRank`, `percentRank`, `cumeDist`,
346
- * `ntile`. Offset/value: `lag`, `lead`, `firstValue`, `lastValue`, `nthValue`.
347
- * Aggregates used as windows: `sum`, `avg`, `count`, `min`, `max`.
348
- */
352
+ * Window-function builders. Each returns a {@link WindowFunction}; chain
353
+ * `.over(...)` to bind the window.
354
+ *
355
+ * Ranking: `rowNumber`, `rank`, `denseRank`, `percentRank`, `cumeDist`,
356
+ * `ntile`. Offset/value: `lag`, `lead`, `firstValue`, `lastValue`, `nthValue`.
357
+ * Aggregates used as windows: `sum`, `avg`, `count`, `min`, `max`.
358
+ */
349
359
  declare const fn: {
350
360
  /** `AVG(column) OVER (...)`. */
351
361
  avg: (column: Sql | string) => WindowFunction;
@@ -380,4 +390,19 @@ declare const fn: {
380
390
  /** `SUM(column) OVER (...)`. */
381
391
  sum: (column: Sql | string) => WindowFunction;
382
392
  };
383
- export { type Condition, type OrderTerm, type OverSpec, type QueryExecutor, type Queryable, type R2SqlClient, type R2SqlColumn, type R2SqlConfig, R2SqlError, type R2SqlExplainOptions, type R2SqlResult, SelectBuilder, SetOperation, Sql, WindowExpression, WindowFunction, asc, createR2Sql, desc, fn, isSql, joinSql, lit, raw, renderOrderTerm, sql, toText };
393
+ export { type Condition, type OrderTerm, type OverSpec, type QueryExecutor, type Queryable, type R2SqlClient, type R2SqlColumn, type R2SqlConfig, R2SqlError, type R2SqlExplainOptions, type R2SqlResult,
394
+ /**
395
+ * `@lunora/bindings/r2sql` — typed, chainable R2 SQL for Lunora.
396
+ *
397
+ * Query Cloudflare [R2 SQL](https://developers.cloudflare.com/r2-sql/) — the
398
+ * serverless engine over Apache Iceberg tables in R2 Data Catalog — from a
399
+ * Lunora **action** via `ctx.r2sql`. First-class support for the 2026-06-21
400
+ * features: window functions (`fn.rowNumber().over(...)`), `DISTINCT` /
401
+ * `DISTINCT ON`, `QUALIFY`, and set operations (`.union()/.intersect()/.except()`).
402
+ *
403
+ * R2 SQL is non-deterministic external I/O with no Workers binding, so — like
404
+ * `ctx.sql` (Hyperdrive) — it is wired onto `ActionCtx` only and its reads are
405
+ * not tracked by Lunora live queries (see the `r2sql_outside_action` advisor
406
+ * lint). See the README and `createR2Sql` JSDoc.
407
+ */
408
+ SelectBuilder, SetOperation, Sql, WindowExpression, WindowFunction, asc, createR2Sql, desc, fn, isSql, joinSql, lit, raw, renderOrderTerm, sql, toText };
@@ -1,7 +1 @@
1
- export { default as SelectBuilder } from '../packem_shared/SelectBuilder-DHaXZwn_.mjs';
2
- export { R2SqlError, createR2Sql } from '../packem_shared/R2SqlError-Boygg3S0.mjs';
3
- export { asc, desc, renderOrderTerm } from '../packem_shared/asc-Cur-xO8v.mjs';
4
- export { default as SetOperation } from '../packem_shared/SetOperation-RDHcxccj.mjs';
5
- export { Sql, isSql, joinSql, lit, raw, sql, toText } from '../packem_shared/Sql-DceGtcUd.mjs';
6
- export { WindowFunction, fn } from '../packem_shared/WindowFunction-DA3pGC3N.mjs';
7
- export { default as WindowExpression } from '../packem_shared/WindowExpression-Cg9s2xcr.mjs';
1
+ import{default as o}from"../packem_shared/SelectBuilder-Dnqem9T0.mjs";import{R2SqlError as l,createR2Sql as f}from"../packem_shared/R2SqlError-CJ_zgztT.mjs";import{asc as d,desc as i,renderOrderTerm as n}from"../packem_shared/asc-DP_WFiAE.mjs";import{default as s}from"../packem_shared/SetOperation-kiI5Wnlm.mjs";import{Sql as m,isSql as S,joinSql as q,lit as c,raw as u,sql as w,toText as E}from"../packem_shared/Sql-BfnxRway.mjs";import{WindowFunction as R,fn as T}from"../packem_shared/WindowFunction-CL4jYy2l.mjs";import{default as j}from"../packem_shared/WindowExpression-VX7EEV3h.mjs";export{l as R2SqlError,o as SelectBuilder,s as SetOperation,m as Sql,j as WindowExpression,R as WindowFunction,d as asc,f as createR2Sql,i as desc,T as fn,S as isSql,q as joinSql,c as lit,u as raw,n as renderOrderTerm,w as sql,E as toText};