@lunora/do 1.0.0-alpha.34 → 1.0.0-alpha.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +380 -69
- package/dist/index.d.ts +380 -69
- package/dist/index.mjs +4 -3
- package/dist/packem_shared/{ADMIN_FUNCTIONS-CAHLZMj8.mjs → ADMIN_FUNCTIONS-CqVmUVNs.mjs} +2 -0
- package/dist/packem_shared/{ROOT_DO_SIZE_WARN_BYTES-B5c6kQIN.mjs → ROOT_DO_SIZE_WARN_BYTES-QSOI2hpe.mjs} +376 -65
- package/dist/packem_shared/context-telemetry-DWfYDxCS.mjs +165 -0
- package/dist/packem_shared/createMetrics-BIL8Cl8X.mjs +1 -0
- package/dist/packem_shared/{serveRelationFanout-BgaNg3Hu.mjs → serveRelationFanout-Yiyx2OQB.mjs} +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -2165,6 +2165,227 @@ declare const recordAuthEvent: (sql: SqlExec, input: RecordAuthEventInput) => vo
|
|
|
2165
2165
|
* throwing. `failureRate` is derived here so the consumer needn't recompute it.
|
|
2166
2166
|
*/
|
|
2167
2167
|
declare const readAuthMetrics: (sql: SqlExec) => AuthMetrics;
|
|
2168
|
+
/**
|
|
2169
|
+
* Shared, bundler-inlined helpers for the structured `fields` a
|
|
2170
|
+
* `ctx.log.<level>(message, fields)` / `ctx.log.with(fields)` call carries.
|
|
2171
|
+
*
|
|
2172
|
+
* Inlined (like {@link file://./otlp.ts}) so `@lunora/do`, `@lunora/runtime`,
|
|
2173
|
+
* `@lunora/config`, and `@lunora/studio` — which sit on different tiers with no
|
|
2174
|
+
* acceptable runtime dependency edge between them — share ONE implementation of
|
|
2175
|
+
* field rendering/normalization instead of the byte-identical copies they would
|
|
2176
|
+
* otherwise hand-mirror. Keep this genuinely zero-dependency (only built-ins) so
|
|
2177
|
+
* inlining into each `dist` stays sound.
|
|
2178
|
+
*/
|
|
2179
|
+
/** Structured, filterable key/value fields attached to a `ctx.log` line. */
|
|
2180
|
+
type LogFields = Record<string, unknown>;
|
|
2181
|
+
/**
|
|
2182
|
+
* What kind of instrument produced a measurement, which decides how a collector
|
|
2183
|
+
* aggregates it:
|
|
2184
|
+
*
|
|
2185
|
+
* - `counter` — a monotonic delta to add up (requests, retries, bytes sent).
|
|
2186
|
+
* - `gauge` — a point-in-time reading that replaces the last one (queue depth,
|
|
2187
|
+
* cache size).
|
|
2188
|
+
* - `histogram` — a value whose *distribution* matters (latency, payload size),
|
|
2189
|
+
* giving percentiles rather than just a mean.
|
|
2190
|
+
*/
|
|
2191
|
+
type MetricKind = "counter" | "gauge" | "histogram";
|
|
2192
|
+
/**
|
|
2193
|
+
* One measurement recorded from a function handler.
|
|
2194
|
+
*
|
|
2195
|
+
* Each `ctx.metrics.*` call produces exactly one of these — the runtime does no
|
|
2196
|
+
* pre-aggregation, so counters carry **delta** temporality and a collector sums
|
|
2197
|
+
* them. That keeps the sink model identical to logs and spans (one event, one
|
|
2198
|
+
* export) at the cost of chattiness in a hot loop, where the handler should sum
|
|
2199
|
+
* locally and record once.
|
|
2200
|
+
*/
|
|
2201
|
+
interface MetricEvent {
|
|
2202
|
+
/**
|
|
2203
|
+
* Structured attributes the caller attached, normalized to a fresh bag of
|
|
2204
|
+
* JSON-safe primitives (see `shared/log-fields.ts`). These are the metric's
|
|
2205
|
+
* dimensions — keep them low-cardinality; an id-valued attribute creates a
|
|
2206
|
+
* distinct time series per id.
|
|
2207
|
+
*
|
|
2208
|
+
* Caller-controlled, so they MAY contain user input and they DO egress to
|
|
2209
|
+
* whatever destination the sink ships to — the same caveat as a log line's
|
|
2210
|
+
* `fields` and a span's `error.message`. Scrub upstream if that matters.
|
|
2211
|
+
*/
|
|
2212
|
+
attributes?: LogFields;
|
|
2213
|
+
/** Function path that recorded the measurement, e.g. `"orders:checkout"`. */
|
|
2214
|
+
functionPath: string;
|
|
2215
|
+
/** Instrument kind; see {@link MetricKind}. */
|
|
2216
|
+
kind: MetricKind;
|
|
2217
|
+
/** Instrument name, e.g. `"orders.placed"`. */
|
|
2218
|
+
name: string;
|
|
2219
|
+
/** Shard key for single-shard calls; absent for the unnamed root DO. */
|
|
2220
|
+
shardKey?: string;
|
|
2221
|
+
/** Wall-clock millis when the measurement was recorded. */
|
|
2222
|
+
ts: number;
|
|
2223
|
+
/**
|
|
2224
|
+
* The measured value: the increment for a `counter`, the current reading for
|
|
2225
|
+
* a `gauge`, the observed sample for a `histogram`.
|
|
2226
|
+
*/
|
|
2227
|
+
value: number;
|
|
2228
|
+
}
|
|
2229
|
+
/**
|
|
2230
|
+
* One span produced by a `ctx.trace(name, fn)` call, or the synthetic root span
|
|
2231
|
+
* the shard records for the dispatch itself so a waterfall has a bar to hang
|
|
2232
|
+
* its children under.
|
|
2233
|
+
*
|
|
2234
|
+
* Ids are the same lowercase-hex form the OTLP encoders and `traceparent` use
|
|
2235
|
+
* (32-hex trace, 16-hex span), so a `SpanEvent` composes into an OTLP span with
|
|
2236
|
+
* no reformatting.
|
|
2237
|
+
*/
|
|
2238
|
+
interface SpanEvent {
|
|
2239
|
+
/**
|
|
2240
|
+
* Structured attributes the caller attached, already normalized to a fresh
|
|
2241
|
+
* bag of JSON-safe primitives (see `shared/log-fields.ts`) exactly like a log
|
|
2242
|
+
* line's `fields`. Absent when the caller passed none.
|
|
2243
|
+
*/
|
|
2244
|
+
attributes?: LogFields;
|
|
2245
|
+
/** Wall-clock duration of the span body, in milliseconds. */
|
|
2246
|
+
durationMs: number;
|
|
2247
|
+
/**
|
|
2248
|
+
* Populated when the span body threw. `type` is the error's constructor name
|
|
2249
|
+
* (or its `LunoraError` code); `message` is the human-readable string and may
|
|
2250
|
+
* include user input, so sinks shipping to third parties should scrub it.
|
|
2251
|
+
*/
|
|
2252
|
+
error?: {
|
|
2253
|
+
message: string;
|
|
2254
|
+
type: string;
|
|
2255
|
+
};
|
|
2256
|
+
/**
|
|
2257
|
+
* Function path the span was created under, e.g. `"messages:list"`. A span
|
|
2258
|
+
* created inside a function invoked via `ctx.runQuery`/`runMutation`/
|
|
2259
|
+
* `runAction` carries the OUTER entrypoint's path, since the composed call
|
|
2260
|
+
* reuses its context — the same attribution rule `ctx.log` follows.
|
|
2261
|
+
*/
|
|
2262
|
+
functionPath: string;
|
|
2263
|
+
/** Caller-supplied span name, e.g. `"stripe.charge"`. */
|
|
2264
|
+
name: string;
|
|
2265
|
+
/** True when the span body returned without throwing. */
|
|
2266
|
+
ok: boolean;
|
|
2267
|
+
/**
|
|
2268
|
+
* Span id of the enclosing span — the parent `ctx.trace` when nested, else
|
|
2269
|
+
* the dispatch's own RPC span (from the inbound `traceparent`). A span with
|
|
2270
|
+
* no inbound trace context is parented to a locally-minted root, so this is
|
|
2271
|
+
* always set for a `ctx.trace` span; only the synthetic `dispatch` span below
|
|
2272
|
+
* carries `""`, meaning "nothing above me in this trace".
|
|
2273
|
+
*/
|
|
2274
|
+
parentSpanId: string;
|
|
2275
|
+
/**
|
|
2276
|
+
* True for the synthetic span representing the **dispatch itself**, which the
|
|
2277
|
+
* shard records so a waterfall has a bar for the request to hang its
|
|
2278
|
+
* `ctx.trace` spans under.
|
|
2279
|
+
*
|
|
2280
|
+
* Named for what it is rather than "root": it is not the root of the
|
|
2281
|
+
* collector-side trace — the worker's own RPC span sits above it — and it is
|
|
2282
|
+
* never exported to a sink, because the runtime already emits that dispatch
|
|
2283
|
+
* via `onRpc` and a collector would otherwise show it twice. Locally it *is*
|
|
2284
|
+
* the outermost span, which is why the fold prefers it as a trace's anchor.
|
|
2285
|
+
*/
|
|
2286
|
+
dispatch?: boolean;
|
|
2287
|
+
/** Shard key for single-shard calls; absent for the unnamed root DO. */
|
|
2288
|
+
shardKey?: string;
|
|
2289
|
+
/** This span's own id (16-hex). */
|
|
2290
|
+
spanId: string;
|
|
2291
|
+
/** Wall-clock millis when the span started. */
|
|
2292
|
+
startTs: number;
|
|
2293
|
+
/** Trace this span belongs to (32-hex) — shared with the dispatch's logs. */
|
|
2294
|
+
traceId: string;
|
|
2295
|
+
/** Acting userId, or absent when anonymous. */
|
|
2296
|
+
userId?: string;
|
|
2297
|
+
}
|
|
2298
|
+
/**
|
|
2299
|
+
* Structural shape of the `ctx.trace` span factory (see the server
|
|
2300
|
+
* `LunoraTracer`). Declared here rather than imported so `@lunora/do` takes no
|
|
2301
|
+
* dependency on `@lunora/server`; a cross-package assignability guard in
|
|
2302
|
+
* `@lunora/testing` fails the build if the two drift apart.
|
|
2303
|
+
*/
|
|
2304
|
+
type ContextTracer = <T>(name: string, function_: (trace: ContextTracer) => Promise<T> | T, attributes?: LogFields) => Promise<T>;
|
|
2305
|
+
/** Structural shape of the `ctx.metrics` recorder (see the server `LunoraMetrics`). */
|
|
2306
|
+
interface ContextMetrics {
|
|
2307
|
+
count: (name: string, value?: number, attributes?: LogFields) => void;
|
|
2308
|
+
gauge: (name: string, value: number, attributes?: LogFields) => void;
|
|
2309
|
+
record: (name: string, value: number, attributes?: LogFields) => void;
|
|
2310
|
+
}
|
|
2311
|
+
/** The trace a ctx's spans hang off: the shared id, and the span they parent to. */
|
|
2312
|
+
interface TraceAnchor {
|
|
2313
|
+
rootSpanId: string;
|
|
2314
|
+
traceId: string;
|
|
2315
|
+
}
|
|
2316
|
+
/** What {@link createTracer} needs from the shard to build a span. */
|
|
2317
|
+
interface TracerDeps {
|
|
2318
|
+
/** The trace this ctx's spans belong to. */
|
|
2319
|
+
anchor: TraceAnchor;
|
|
2320
|
+
/** Function path the spans are attributed to. */
|
|
2321
|
+
functionPath: string;
|
|
2322
|
+
/** Hand a finished span to the buffer + sink. */
|
|
2323
|
+
record: (span: SpanEvent) => void;
|
|
2324
|
+
/** Shard key for single-shard calls; absent for the unnamed root DO. */
|
|
2325
|
+
shardKey: string | undefined;
|
|
2326
|
+
/** Read lazily — the acting user is resolved per span, not per ctx. */
|
|
2327
|
+
userId: () => string | undefined;
|
|
2328
|
+
}
|
|
2329
|
+
/** What {@link createMetrics} needs from the shard to build a measurement. */
|
|
2330
|
+
interface MetricsDeps {
|
|
2331
|
+
functionPath: string;
|
|
2332
|
+
record: (event: MetricEvent) => void;
|
|
2333
|
+
shardKey: string | undefined;
|
|
2334
|
+
}
|
|
2335
|
+
/**
|
|
2336
|
+
* Build the `ctx.trace` span factory for one dispatched function.
|
|
2337
|
+
*
|
|
2338
|
+
* **Nesting is explicit, not ambient.** Each span's body receives a tracer bound
|
|
2339
|
+
* to that span; calling it is what makes a child. An earlier design kept an
|
|
2340
|
+
* ambient stack of "the currently open span" and parented to its top, which
|
|
2341
|
+
* reads nicer but is unfixably wrong under concurrency: in
|
|
2342
|
+
* `Promise.all([trace("a", …), trace("b", …)])`, `b` starts while `a` is on the
|
|
2343
|
+
* stack and is recorded as a *child* of `a` rather than its sibling — and
|
|
2344
|
+
* parallel fan-out is one of the main things people reach for a tracer to
|
|
2345
|
+
* measure. Distinguishing "called inside a's body" from "called concurrently
|
|
2346
|
+
* with a" needs `AsyncLocalStorage`, which this package deliberately avoids (see
|
|
2347
|
+
* `dependency-tracker.ts` — shard DOs run under a slimmer compat profile than
|
|
2348
|
+
* `nodejs_compat`). So the parent is threaded, exactly like the dependency
|
|
2349
|
+
* tracker and the subscription identity: correct in every case, and visible at
|
|
2350
|
+
* the call site.
|
|
2351
|
+
*
|
|
2352
|
+
* The anchor is passed in for the same reason. `ShardDO.currentRequestTrace` is
|
|
2353
|
+
* cleared in the dispatch `finally`, and a subscription re-run builds its ctx
|
|
2354
|
+
* during* the writing mutation's flush — so reading that shared field at span
|
|
2355
|
+
* time would file the re-run's spans under the mutation's trace.
|
|
2356
|
+
*/
|
|
2357
|
+
declare const createTracer: (deps: TracerDeps) => ContextTracer;
|
|
2358
|
+
/**
|
|
2359
|
+
* Build the `ctx.metrics` recorder for one dispatched function.
|
|
2360
|
+
*
|
|
2361
|
+
* Deliberately stateless: each call emits one measurement rather than
|
|
2362
|
+
* accumulating into a per-dispatch map. Pre-aggregating here would have to pick a
|
|
2363
|
+
* flush point and a merge rule per instrument kind (sum a counter, last-wins a
|
|
2364
|
+
* gauge, and a histogram cannot be merged at all without losing the
|
|
2365
|
+
* distribution) — so the runtime stays a transport and the collector, which is
|
|
2366
|
+
* built for exactly this, does the aggregation.
|
|
2367
|
+
*/
|
|
2368
|
+
declare const createMetrics: (deps: MetricsDeps) => ContextMetrics;
|
|
2369
|
+
/**
|
|
2370
|
+
* Build the synthetic root span for a finished dispatch — the bar the studio's
|
|
2371
|
+
* waterfall hangs a request's `ctx.trace` spans under.
|
|
2372
|
+
*
|
|
2373
|
+
* Pure: the caller decides whether to record it (only when the dispatch actually
|
|
2374
|
+
* produced spans) and where to put it. It is never routed to `sink.onSpan`,
|
|
2375
|
+
* because the runtime already emits the dispatch to `onRpc` and a collector would
|
|
2376
|
+
* otherwise show it twice.
|
|
2377
|
+
*/
|
|
2378
|
+
declare const dispatchRootSpan: (input: {
|
|
2379
|
+
anchor: TraceAnchor;
|
|
2380
|
+
durationMs: number;
|
|
2381
|
+
failure: {
|
|
2382
|
+
thrown: unknown;
|
|
2383
|
+
} | undefined;
|
|
2384
|
+
functionPath: string;
|
|
2385
|
+
shardKey: string | undefined;
|
|
2386
|
+
startTs: number;
|
|
2387
|
+
userId: string | undefined;
|
|
2388
|
+
}) => SpanEvent;
|
|
2168
2389
|
/** Reserved table the per-shard runner tracks migration progress in. Auto-hidden from the data browser by the `__lunora` prefix. */
|
|
2169
2390
|
declare const DATA_MIGRATION_STATE_TABLE = "__lunora_migrations";
|
|
2170
2391
|
type MigrationDirection = "down" | "up";
|
|
@@ -2553,6 +2774,7 @@ declare const ADMIN_FUNCTIONS: {
|
|
|
2553
2774
|
readonly getFanoutMetrics: "__lunora_admin__:getFanoutMetrics";
|
|
2554
2775
|
readonly getFunctionStats: "__lunora_admin__:getFunctionStats";
|
|
2555
2776
|
readonly getIssues: "__lunora_admin__:getIssues";
|
|
2777
|
+
readonly getMetricSeries: "__lunora_admin__:getMetricSeries";
|
|
2556
2778
|
readonly listSubscriptions: "__lunora_admin__:listSubscriptions";
|
|
2557
2779
|
readonly listTableIndexes: "__lunora_admin__:listTableIndexes";
|
|
2558
2780
|
readonly getLogs: "__lunora_admin__:getLogs";
|
|
@@ -2562,6 +2784,7 @@ declare const ADMIN_FUNCTIONS: {
|
|
|
2562
2784
|
readonly getRequestLog: "__lunora_admin__:getRequestLog";
|
|
2563
2785
|
readonly getSecurityAudit: "__lunora_admin__:getSecurityAudit";
|
|
2564
2786
|
readonly getSettings: "__lunora_admin__:getSettings";
|
|
2787
|
+
readonly getTraces: "__lunora_admin__:getTraces";
|
|
2565
2788
|
readonly getWorkflowInstanceStatus: "__lunora_admin__:getWorkflowInstanceStatus";
|
|
2566
2789
|
readonly importShard: "__lunora_admin__:importShard";
|
|
2567
2790
|
readonly listFlags: "__lunora_admin__:listFlags";
|
|
@@ -3316,8 +3539,62 @@ declare const readFunctionMetricsTotals: (sql: SqlExec) => {
|
|
|
3316
3539
|
errors: number;
|
|
3317
3540
|
requests: number;
|
|
3318
3541
|
};
|
|
3319
|
-
/**
|
|
3320
|
-
|
|
3542
|
+
/**
|
|
3543
|
+
* Severity of a `ctx.log.*` call. The five console method names (`log` is the
|
|
3544
|
+
* default level, distinct from `info`) plus `trace`/`fatal`, so the logger spans
|
|
3545
|
+
* the full OpenTelemetry severity ramp (`trace`→`fatal`).
|
|
3546
|
+
*/
|
|
3547
|
+
type ContextLogLevel = "debug" | "error" | "fatal" | "info" | "log" | "trace" | "warn";
|
|
3548
|
+
/**
|
|
3549
|
+
* Per-event context handed to a sink alongside the event: lets a sink register
|
|
3550
|
+
* background work (a telemetry POST, a durable pipeline send) with the request's
|
|
3551
|
+
* `waitUntil` so it survives isolate teardown after the response returns. Absent
|
|
3552
|
+
* `waitUntil` (no request context) means the sink falls back to fire-and-forget.
|
|
3553
|
+
*/
|
|
3554
|
+
interface LogSinkContext {
|
|
3555
|
+
/** Keep a background promise alive past the response (the request's `waitUntil`). */
|
|
3556
|
+
waitUntil?: (promise: Promise<unknown>) => void;
|
|
3557
|
+
}
|
|
3558
|
+
/**
|
|
3559
|
+
* One application log line emitted from a function handler via `ctx.log`.
|
|
3560
|
+
* Produced per `ctx.log.*` call (unlike a per-dispatch RPC summary).
|
|
3561
|
+
*/
|
|
3562
|
+
interface LogEvent {
|
|
3563
|
+
/** Raw arguments passed to the `ctx.log.*` call, in order. */
|
|
3564
|
+
args: unknown[];
|
|
3565
|
+
/**
|
|
3566
|
+
* Structured fields the caller attached (`ctx.log.info(message, fields)` or a
|
|
3567
|
+
* bound `ctx.log.with(fields)` child), already normalized to a fresh bag of
|
|
3568
|
+
* JSON-safe primitives (see `shared/log-fields.ts`). Absent for a plain
|
|
3569
|
+
* console-style call.
|
|
3570
|
+
*/
|
|
3571
|
+
fields?: LogFields;
|
|
3572
|
+
/** Function path that emitted the line, e.g. `"messages:list"`. */
|
|
3573
|
+
functionPath: string;
|
|
3574
|
+
/** Severity the line was logged at. */
|
|
3575
|
+
level: ContextLogLevel;
|
|
3576
|
+
/** Display string — the message, or the console-style args rendered and space-joined. */
|
|
3577
|
+
message: string;
|
|
3578
|
+
/** Shard key for single-shard calls; absent for the unnamed root DO. */
|
|
3579
|
+
shardKey?: string;
|
|
3580
|
+
/** Span id of the RPC this line was emitted under (trace correlation), or absent. */
|
|
3581
|
+
spanId?: string;
|
|
3582
|
+
/** Trace id this line belongs to (from the inbound `traceparent`), or absent. */
|
|
3583
|
+
traceId?: string;
|
|
3584
|
+
/** Wall-clock millis when the line was emitted. */
|
|
3585
|
+
ts: number;
|
|
3586
|
+
/** Acting userId, or absent when anonymous. */
|
|
3587
|
+
userId?: string;
|
|
3588
|
+
}
|
|
3589
|
+
/**
|
|
3590
|
+
* Severity of a buffered log entry — the full seven-tier `ctx.log` ramp
|
|
3591
|
+
* (`trace`→`fatal`), not a console-shaped subset. The buffer used to fold the
|
|
3592
|
+
* ramp onto four tiers, which made `trace` and `fatal` lines indistinguishable
|
|
3593
|
+
* from `debug` and `error` in the Studio Logs panel; it now stores the level the
|
|
3594
|
+
* caller actually logged at. Container-lifecycle entries only ever use
|
|
3595
|
+
* `info`/`error`, which remain part of the union.
|
|
3596
|
+
*/
|
|
3597
|
+
type LogLevel = ContextLogLevel;
|
|
3321
3598
|
/**
|
|
3322
3599
|
* One buffered log line. `functionPath` is the RPC that produced it (when the
|
|
3323
3600
|
* entry came from the RPC dispatch site); `timestamp` is `Date.now()` at the
|
|
@@ -3327,7 +3604,7 @@ type LogLevel = "debug" | "error" | "info" | "warn";
|
|
|
3327
3604
|
*/
|
|
3328
3605
|
interface LogEntry {
|
|
3329
3606
|
exitCode?: number;
|
|
3330
|
-
/** Structured fields from a `ctx.log
|
|
3607
|
+
/** Structured fields from a `ctx.log.<level>(message, fields)` / `ctx.log.with(fields)` call, when present. */
|
|
3331
3608
|
fields?: Record<string, unknown>;
|
|
3332
3609
|
functionPath?: string;
|
|
3333
3610
|
instance?: string;
|
|
@@ -3653,66 +3930,6 @@ declare const resolveRelationPredicates: (where: WhereInput | undefined, options
|
|
|
3653
3930
|
* schema's shard modes are both in hand).
|
|
3654
3931
|
*/
|
|
3655
3932
|
declare const assertShapeShardable: (effectiveWhere: WhereInput | undefined, schema: ResolveContext["schema"], table: string) => void;
|
|
3656
|
-
/**
|
|
3657
|
-
* Shared, bundler-inlined helpers for the structured `fields` a
|
|
3658
|
-
* `ctx.log.<level>(message, fields)` / `ctx.log.with(fields)` call carries.
|
|
3659
|
-
*
|
|
3660
|
-
* Inlined (like {@link file://./otlp.ts}) so `@lunora/do`, `@lunora/runtime`,
|
|
3661
|
-
* `@lunora/config`, and `@lunora/studio` — which sit on different tiers with no
|
|
3662
|
-
* acceptable runtime dependency edge between them — share ONE implementation of
|
|
3663
|
-
* field rendering/normalization instead of the byte-identical copies they would
|
|
3664
|
-
* otherwise hand-mirror. Keep this genuinely zero-dependency (only built-ins) so
|
|
3665
|
-
* inlining into each `dist` stays sound.
|
|
3666
|
-
*/
|
|
3667
|
-
/** Structured, filterable key/value fields attached to a `ctx.log` line. */
|
|
3668
|
-
type LogFields = Record<string, unknown>;
|
|
3669
|
-
/**
|
|
3670
|
-
* Severity of a `ctx.log.*` call. The five console method names (`log` is the
|
|
3671
|
-
* default level, distinct from `info`) plus `trace`/`fatal`, so the logger spans
|
|
3672
|
-
* the full OpenTelemetry severity ramp (`trace`→`fatal`).
|
|
3673
|
-
*/
|
|
3674
|
-
type ContextLogLevel = "debug" | "error" | "fatal" | "info" | "log" | "trace" | "warn";
|
|
3675
|
-
/**
|
|
3676
|
-
* Per-event context handed to a sink alongside the event: lets a sink register
|
|
3677
|
-
* background work (a telemetry POST, a durable pipeline send) with the request's
|
|
3678
|
-
* `waitUntil` so it survives isolate teardown after the response returns. Absent
|
|
3679
|
-
* `waitUntil` (no request context) means the sink falls back to fire-and-forget.
|
|
3680
|
-
*/
|
|
3681
|
-
interface LogSinkContext {
|
|
3682
|
-
/** Keep a background promise alive past the response (the request's `waitUntil`). */
|
|
3683
|
-
waitUntil?: (promise: Promise<unknown>) => void;
|
|
3684
|
-
}
|
|
3685
|
-
/**
|
|
3686
|
-
* One application log line emitted from a function handler via `ctx.log`.
|
|
3687
|
-
* Produced per `ctx.log.*` call (unlike a per-dispatch RPC summary).
|
|
3688
|
-
*/
|
|
3689
|
-
interface LogEvent {
|
|
3690
|
-
/** Raw arguments passed to the `ctx.log.*` call, in order. */
|
|
3691
|
-
args: unknown[];
|
|
3692
|
-
/**
|
|
3693
|
-
* Structured fields the caller attached (`ctx.log.info(message, fields)` or a
|
|
3694
|
-
* bound `ctx.log.with(fields)` child), already normalized to a fresh bag of
|
|
3695
|
-
* JSON-safe primitives (see `shared/log-fields.ts`). Absent for a plain
|
|
3696
|
-
* console-style call.
|
|
3697
|
-
*/
|
|
3698
|
-
fields?: LogFields;
|
|
3699
|
-
/** Function path that emitted the line, e.g. `"messages:list"`. */
|
|
3700
|
-
functionPath: string;
|
|
3701
|
-
/** Severity the line was logged at. */
|
|
3702
|
-
level: ContextLogLevel;
|
|
3703
|
-
/** Display string — the message, or the console-style args rendered and space-joined. */
|
|
3704
|
-
message: string;
|
|
3705
|
-
/** Shard key for single-shard calls; absent for the unnamed root DO. */
|
|
3706
|
-
shardKey?: string;
|
|
3707
|
-
/** Span id of the RPC this line was emitted under (trace correlation), or absent. */
|
|
3708
|
-
spanId?: string;
|
|
3709
|
-
/** Trace id this line belongs to (from the inbound `traceparent`), or absent. */
|
|
3710
|
-
traceId?: string;
|
|
3711
|
-
/** Wall-clock millis when the line was emitted. */
|
|
3712
|
-
ts: number;
|
|
3713
|
-
/** Acting userId, or absent when anonymous. */
|
|
3714
|
-
userId?: string;
|
|
3715
|
-
}
|
|
3716
3933
|
/**
|
|
3717
3934
|
* The `ctx.log` event contract (shape + severity union) lives in
|
|
3718
3935
|
* `shared/log-event.ts` (inlined into each `dist`) so the DO that builds these
|
|
@@ -3971,15 +4188,22 @@ declare const subscriptionListDeltas: (previousJson: string, nextResult: unknown
|
|
|
3971
4188
|
* `@lunora/do` takes no dependency on `@lunora/runtime`; the event is the same
|
|
3972
4189
|
* {@link LogEventInput} shape `emitLogEvent` consumes, built once per call.
|
|
3973
4190
|
*/
|
|
3974
|
-
|
|
4191
|
+
/**
|
|
4192
|
+
* The sink surface the DO hands its three signals to: `ctx.log` lines, `ctx.trace`
|
|
4193
|
+
* spans, and `ctx.metrics` measurements. Structurally compatible with
|
|
4194
|
+
* `@lunora/runtime`'s `ObservabilitySink` without taking a dependency on it.
|
|
4195
|
+
*/
|
|
4196
|
+
interface TelemetrySink {
|
|
3975
4197
|
onLog?: (event: LogEventInput, context?: LogSinkContext) => void;
|
|
4198
|
+
onMetric?: (event: MetricEvent, context?: LogSinkContext) => void;
|
|
4199
|
+
onSpan?: (event: SpanEvent, context?: LogSinkContext) => void;
|
|
3976
4200
|
}
|
|
3977
4201
|
/**
|
|
3978
4202
|
* Structural shape of the `ctx.log` logger the DO builds (see the server
|
|
3979
4203
|
* `LunoraLogger`). Declared locally so `@lunora/do` takes no dependency on
|
|
3980
4204
|
* `@lunora/server`; the overloaded public method type lives there.
|
|
3981
4205
|
*/
|
|
3982
|
-
interface
|
|
4206
|
+
interface ContextLogger {
|
|
3983
4207
|
debug: (...args: unknown[]) => void;
|
|
3984
4208
|
error: (...args: unknown[]) => void;
|
|
3985
4209
|
fatal: (...args: unknown[]) => void;
|
|
@@ -3987,7 +4211,7 @@ interface CtxLogger {
|
|
|
3987
4211
|
log: (...args: unknown[]) => void;
|
|
3988
4212
|
trace: (...args: unknown[]) => void;
|
|
3989
4213
|
warn: (...args: unknown[]) => void;
|
|
3990
|
-
with: (fields: LogFields) =>
|
|
4214
|
+
with: (fields: LogFields) => ContextLogger;
|
|
3991
4215
|
}
|
|
3992
4216
|
/**
|
|
3993
4217
|
* Minimal projection of `DurableObjectState` that the ShardDO base requires.
|
|
@@ -4396,6 +4620,14 @@ declare abstract class ShardDO {
|
|
|
4396
4620
|
private currentRequestIp;
|
|
4397
4621
|
/** W3C `traceparent` of the inbound RPC; forwarded onto outbound container fetches. */
|
|
4398
4622
|
private currentRequestTraceparent;
|
|
4623
|
+
/**
|
|
4624
|
+
* Trace ids for the in-flight dispatch, resolved once at entry (see
|
|
4625
|
+
* {@link resolveTraceAnchor}). Shared by `ctx.trace` and by the synthetic
|
|
4626
|
+
* root span recorded on the way out so both agree even with no inbound
|
|
4627
|
+
* `traceparent`. Cleared in the same `finally` as the other per-request
|
|
4628
|
+
* fields.
|
|
4629
|
+
*/
|
|
4630
|
+
private currentRequestTrace;
|
|
4399
4631
|
/**
|
|
4400
4632
|
* Client-issued idempotency key for the in-flight mutation, forwarded via the
|
|
4401
4633
|
* `x-lunora-mutation-id` header. When set, the dispatch path dedups the call
|
|
@@ -4593,6 +4825,19 @@ declare abstract class ShardDO {
|
|
|
4593
4825
|
* "recent RPC errors on this instance" feed, not a general application log.
|
|
4594
4826
|
*/
|
|
4595
4827
|
private readonly logs;
|
|
4828
|
+
/**
|
|
4829
|
+
* Recent `ctx.trace` spans (plus the synthetic per-dispatch root), powering
|
|
4830
|
+
* the studio's Traces panel. In-memory and hibernation-volatile like
|
|
4831
|
+
* `logs` — production tracing ships to a collector via `otlpSink`.
|
|
4832
|
+
*/
|
|
4833
|
+
private readonly spans;
|
|
4834
|
+
/**
|
|
4835
|
+
* Running aggregates of `ctx.metrics.*` measurements, powering the studio's
|
|
4836
|
+
* Metrics panel. In-memory and hibernation-volatile like `logs` and
|
|
4837
|
+
* `spans`, but folds samples into per-series totals rather than ringing
|
|
4838
|
+
* raw events — production aggregation ships to a collector via the sink.
|
|
4839
|
+
*/
|
|
4840
|
+
private readonly metricSeries;
|
|
4596
4841
|
/**
|
|
4597
4842
|
* In-flight dependency tracker for the currently-executing query. Set by
|
|
4598
4843
|
* `runCachedQuery` so the ctx-db hooks (wired via `onRead`) can
|
|
@@ -4816,6 +5061,15 @@ declare abstract class ShardDO {
|
|
|
4816
5061
|
* container fetches carry it and the container's spans join the same trace.
|
|
4817
5062
|
*/
|
|
4818
5063
|
protected getCurrentTraceparent(): string | undefined;
|
|
5064
|
+
/**
|
|
5065
|
+
* The in-flight dispatch's trace ids, for the generated `buildCtx` to hand to
|
|
5066
|
+
* {@link makeTracer}. `undefined` outside a dispatch (an alarm, a lifecycle
|
|
5067
|
+
* hook), where the tracer mints its own anchor.
|
|
5068
|
+
*/
|
|
5069
|
+
protected getCurrentTrace(): {
|
|
5070
|
+
rootSpanId: string;
|
|
5071
|
+
traceId: string;
|
|
5072
|
+
} | undefined;
|
|
4819
5073
|
/**
|
|
4820
5074
|
* Identity claims (email, name, roles, …) forwarded by the runtime's
|
|
4821
5075
|
* `resolveIdentity` hook. Returns `undefined` for anonymous requests
|
|
@@ -5469,7 +5723,7 @@ declare abstract class ShardDO {
|
|
|
5469
5723
|
* Unlike request-log args, `ctx.log` args are NOT redacted: the developer
|
|
5470
5724
|
* chose to log them, exactly like a raw `console.log`.
|
|
5471
5725
|
*/
|
|
5472
|
-
protected recordUserLog(functionPath: string, level: ContextLogLevel, args: unknown[], message: string, fields: Record<string, unknown> | undefined, sink?:
|
|
5726
|
+
protected recordUserLog(functionPath: string, level: ContextLogLevel, args: unknown[], message: string, fields: Record<string, unknown> | undefined, sink?: TelemetrySink): void;
|
|
5473
5727
|
/**
|
|
5474
5728
|
* Build the `ctx.log` logger for one dispatched function. Each severity method
|
|
5475
5729
|
* accepts either the structured form (`(message, fields)`) or console-style
|
|
@@ -5477,7 +5731,59 @@ declare abstract class ShardDO {
|
|
|
5477
5731
|
* stamps `fields` onto every line. The generated `buildCtx` calls this once
|
|
5478
5732
|
* per dispatch and assigns the result to `ctx.log`.
|
|
5479
5733
|
*/
|
|
5480
|
-
protected makeLogger(functionPath: string, sink?:
|
|
5734
|
+
protected makeLogger(functionPath: string, sink?: TelemetrySink, boundFields?: Record<string, unknown>): ContextLogger;
|
|
5735
|
+
/**
|
|
5736
|
+
* Build the `ctx.trace` span factory for one dispatched function. The
|
|
5737
|
+
* generated `buildCtx` calls this once per dispatch and assigns the result to
|
|
5738
|
+
* `ctx.trace`.
|
|
5739
|
+
*
|
|
5740
|
+
* Thin wiring over {@link createTracer}, which owns the span semantics (see
|
|
5741
|
+
* there for why nesting is explicit rather than ambient). Everything it needs
|
|
5742
|
+
* from the shard is passed explicitly.
|
|
5743
|
+
*
|
|
5744
|
+
* `anchor` is the trace this ctx's spans belong to; omit it for a ctx with no
|
|
5745
|
+
* owning dispatch (an alarm, a subscription re-run) to mint a fresh anchor, so
|
|
5746
|
+
* `ctx.trace` still yields a coherent self-contained trace there.
|
|
5747
|
+
*/
|
|
5748
|
+
protected makeTracer(functionPath: string, sink?: TelemetrySink, anchor?: TraceAnchor): ContextTracer;
|
|
5749
|
+
/**
|
|
5750
|
+
* Build the `ctx.metrics` recorder for one dispatched function. Thin wiring
|
|
5751
|
+
* over {@link createMetrics}, which owns the instrument semantics.
|
|
5752
|
+
*/
|
|
5753
|
+
protected makeMetrics(functionPath: string, sink?: TelemetrySink): ContextMetrics;
|
|
5754
|
+
/**
|
|
5755
|
+
* Fold one measurement into the in-memory {@link metricSeries} readout and
|
|
5756
|
+
* hand it to the optional `sink.onMetric`. Best-effort like
|
|
5757
|
+
* {@link recordUserLog} and {@link recordSpan}: recording a measurement must
|
|
5758
|
+
* never break the handler that recorded it.
|
|
5759
|
+
*
|
|
5760
|
+
* The buffer folds rather than rings: a measurement's value is in its
|
|
5761
|
+
* aggregate over a window, which a bounded ring of raw samples can't represent
|
|
5762
|
+
* (it evicts the oldest samples, the ones a running total needs). So the
|
|
5763
|
+
* buffer keeps one running aggregate per series and resets on hibernation like
|
|
5764
|
+
* logs and spans — a "recent metrics on this instance" dev readout. Durable,
|
|
5765
|
+
* cross-instance aggregation is still the sink's job.
|
|
5766
|
+
*/
|
|
5767
|
+
protected recordMetric(event: MetricEvent, sink?: TelemetrySink): void;
|
|
5768
|
+
/**
|
|
5769
|
+
* Buffer the synthetic root span for a finished dispatch. The caller gates
|
|
5770
|
+
* this on the dispatch having actually produced spans (the `hasTrace` check at
|
|
5771
|
+
* the call site): every request minting a root would fill the bounded ring
|
|
5772
|
+
* with single-bar traces from uninstrumented handlers and evict the
|
|
5773
|
+
* instrumented ones the panel exists to show.
|
|
5774
|
+
*
|
|
5775
|
+
* `anchor` carries the dispatch's trace ids, captured at entry rather than
|
|
5776
|
+
* read from `this` here — this runs after the handler's awaits, where the
|
|
5777
|
+
* shared field may already belong to an interleaved dispatch.
|
|
5778
|
+
*/
|
|
5779
|
+
private recordDispatchRootSpan;
|
|
5780
|
+
/**
|
|
5781
|
+
* Buffer one span for the studio Traces panel and hand it to the optional
|
|
5782
|
+
* `sink.onSpan`. Best-effort throughout, exactly like {@link recordUserLog}:
|
|
5783
|
+
* a span is recorded *after* its body already settled, so letting a telemetry
|
|
5784
|
+
* failure escape here would turn a succeeded operation into a failed request.
|
|
5785
|
+
*/
|
|
5786
|
+
protected recordSpan(span: SpanEvent, sink?: TelemetrySink): void;
|
|
5481
5787
|
/**
|
|
5482
5788
|
* Assemble the per-socket {@link LifecycleDispatchInfo} from its attachment:
|
|
5483
5789
|
* the verified identity to replay and the {@link LifecycleEvent} the hooks
|
|
@@ -6588,6 +6894,11 @@ declare abstract class ShardDO {
|
|
|
6588
6894
|
private deliverWhisperLocal;
|
|
6589
6895
|
private readAttachment;
|
|
6590
6896
|
}
|
|
6897
|
+
/**
|
|
6898
|
+
* @deprecated Renamed to {@link TelemetrySink} — it carries spans and metrics as
|
|
6899
|
+
* well as logs. Kept as an alias so existing import sites keep working.
|
|
6900
|
+
*/
|
|
6901
|
+
type LogSink = TelemetrySink;
|
|
6591
6902
|
/** Conventional DO instance name, passed to `idFromName` to address the single registry instance. */
|
|
6592
6903
|
declare const SHARD_REGISTRY_DO_NAME: string;
|
|
6593
6904
|
/**
|
|
@@ -6745,4 +7056,4 @@ interface WhereSqlStrategy {
|
|
|
6745
7056
|
* `undefined` when the input imposes no constraint (empty `where`).
|
|
6746
7057
|
*/
|
|
6747
7058
|
declare const compileWhereSql: (where: WhereInput | undefined, strategy: WhereSqlStrategy) => SQL | undefined;
|
|
6748
|
-
export { ADMIN_FUNCTIONS, ADMIN_FUNCTION_PREFIX, AGGREGATE_SQL_FUNCTION, AUTH_METRICS_BUCKETS_TABLE, AUTH_METRICS_BUCKET_MS, AUTH_METRICS_BUCKET_RETENTION, AUTH_METRICS_TABLE, type AdvisoriesResult, type AdvisoryFinding, type AggregateIndexDefinitionLike, type AggregateOp, type AggregateOptions, type AggregateResult, type AggregateTally, type ApplyOnDeleteOptions, type AuditEntry, type AuditLogResult, type AuthMetrics, type AuthMetricsBucket, type BroadcastDelta, CDC_LOG_TABLE, type CacheEntry, type CapturedMailRow, type CdcChange, type Clock, type ColumnMeta, type ColumnMetaLike, ConflictError, type CountArgs, CountRlsUnsupportedError, type CtxDbOptions, DATA_MIGRATION_STATE_TABLE, DEFAULT_MAX_RELATION_KEYS, type DataMigrationDocument, type DataMigrationLike, type DataMigrationTransform, type DatabaseWriterLike, type DependencyTracker, type DeployInfo, type ExportRow, type ExportShardAdminArgs, type ExportShardArgs, type ExternalSourceDiffResult, type ExternalSourceLike, FLAGS_FUNCTION_PREFIX, FUNCTION_METRICS_BUCKETS_TABLE, FUNCTION_METRICS_BUCKET_MS, FUNCTION_METRICS_BUCKET_RETENTION, FUNCTION_METRICS_INDEX_TABLE, FUNCTION_METRICS_TABLE, type FacetColumnOptions, type FacetColumnResult, type FacetValue, type FieldOperators, type FlagEvaluation, type FlagsResult, type FunctionCallStat, type FunctionMetricBucket, type FunctionMetricIndexHit, type FunctionStatsResult, type GroupByEntry, type GroupByOptions, type HibernatableWebSocket, type IdGenerator, type ImportError, type ImportShardAdminArgs, type ImportShardArgs, type ImportShardResult, type IncrementalMaterializeResult, type IndexDefinitionLike, type IndexRangeBuilderLike, LogBuffer, type LogEntry, type LogEventInput, type LogLevel, type LogSink, MAIL_RETENTION, MAIL_TABLE, MAX_SQL_ROWS, MIN_ADMIN_TOKEN_LENGTH, MIN_AUTH_SECRET_LENGTH, type MaskColumnMetadata, type MaskPoliciesResult, type MaterializeResult, type MigrationDirection, type MigrationRunResult, type MigrationStatus, type MigrationStatusRow, type MutationDelta, type NestedWith, NotFoundError, NotUniqueError, type OnDeleteActionLike, type OrderByInput, type OrderKey, type PaginationOptions, type PitrBookmarkResult, type PitrRestoreArgs, type PitrRestoreResult, type PitrStorage, type QueryArgs, type QueryPage, type QueueMetadata, type QueuesResult, RANK_TIEBREAK, RELATION_FUNCTION_PREFIX, RLS_UNWRAP_SYMBOL, ROOT_DO_SIZE_WARN_BYTES, ROOT_SHARD_NAME, type RankDirection, type RankIndexDefinitionLike, type RankOptions, type RankPage, type RankPageOptions, type RankPageRow, type RankPageRowKey, type RankResult, type RankSortKeyLike, ReactiveCache, type ReactiveCacheOptions, type ReadHook, type ReadTablePageOptions, type RecordAuthEventInput, type RecordFunctionMetricInput, type RecordMailInput, type RelationDefinitionLike, type RenderedSql, type ResolveRelationPredicatesOptions, type ResolveWithOptions, type RestrictableQueryOptions, type RlsPoliciesResult, type RlsPolicyMetadata, RlsRequiredError, type RlsRoleMetadata, type RpcRequest, type RunDataMigrationOptions, type RunShardApplyCdcArgs, type RunShardApplyCdcResult, type RunShardBulkDeleteArgs, type RunShardBulkDeleteResult, type RunShardExportArgs, type RunShardImportArgs, type RunShardMigrationArgs, type RunShardRankBeforeArgs, type RunShardRankPageArgs, type RunShardWriteArgs, type RunShardWriteResult, type RunTriggersOptions, SCAN_DEP, SESSION_DO_TTL_DEFAULT, SHARD_REGISTRY_DO_NAME, type SchedulableWorkflowReferenceLike, type ScheduledFunctionDoc, type SchedulerLike, type SchemaLike, type SearchFilterBuilderLike, type SecurityAuditResult, type SecurityFinding, type SecurityFindingKind, type SecurityFindingLevel, type SelectMatchingIdsOptions, type ServerDefaultContextLike, SessionDO, type SessionRecord, type SettingEntry, type SettingKind, type SettingsResult, type ShapeSubscriptionQuery, ShardDO, type ShardDOOptions, type ShardDOState, type ShardRankPageResult, ShardRegistryDO, type SocketAttachment, type SortDirection, type SourceClientLike, type SourceCursorLike, type SourceRefresh, type SqlConsoleResult, type SqlCursor, type SqlEngine, type SqlExec, type StorageRuleMetadata, type StorageRulesResult, type StudioFeaturesResult, type SubscriptionEnvelope, type SubscriptionOutcome, type SubscriptionQuery, type SystemDatabaseReader, type SystemDoc, type SystemQuery, type SystemReaderOptions, type SystemReaderSchedulerLike, type SystemReaderStorageLike, type SystemTableName, type TableColumnsResult, type TableDefinitionLike, type TableIndexInfo, type TableIndexesResult, type TableInfo, type TablePage, type TableReaderLike, type TablesColumnsResult, type TransactionSqlLike, type TriggerContextLike, type TriggerDefinitionLike, type TriggerEventLike, type TriggerOpLike, type TriggerTimingLike, type ValidatorLike, type WhereInput, type WhereSqlStrategy, type WithInput, type WorkflowMetadata, type WorkflowsResult, type WriteEvent, type WriteHook, aggregateSqlFunction, aggregateTableName, applyCdcChanges, applyOnDelete, applySelect, armRestore, assertFlatPredicate, assertReadonly, assertShapeShardable, assertValidClientId, backfillAggregateIndexes, backfillRankIndexes, buildFtsMatch, buildSecurityAudit, buildSeekWhere, clearCapturedMail, coerceAggregateNumber, compileWhereSql, containsRelationPredicate, createDependencyTracker, createShardCtxDb, createSystemReader, decodeCursor, depKey, diffExternalSource, encodeAggregateKey, encodeCursor, encodePartitionKey, ensureAuthMetricsTables, ensureFunctionMetricsTables, ensureMailTable, exportShardRows, exportShardTable, facetColumn, fanOutScalarCounts, foldAggregateTally, ftsTableName, guardWriter, hasTrigger, importShardRows, isRelationPredicate, isSoftDeleted, isSourceDue, liftSourceId, listTables, matchesRankStaticWhere, matchesStaticWhere, materializeExternalRows, materializeExternalRowsIncremental, mergeWhere, normalizeCountArgument, normalizeIdStructurally, normalizeOrderKeys, parseExportShardArgs, parseImportShardArgs, planAggregateLookup, pullExternalSourceIncrementalTick, pullExternalSourceTick, rankTableName, reactiveCacheKey, readAggregateValue, readAuthMetrics, readBookmark, readCapturedMail, readCdcChanges, readExternalSourceBaseline, readFunctionMetricBuckets, readFunctionMetricIndexHits, readFunctionMetrics, readFunctionMetricsTotals, readMigrationStatus, readTablePage, recordAuthEvent, recordCapturedMail, recordFunctionMetric, renderSql, resolveRankPartition, resolveRelationPredicates, resolveWith, runDataMigration, runExternalSourceTick, runReadonlySql, runRowValidators, runShardMigrations, runTriggers, scoreDocument, selectExportTables, selectIndexForAggregate, selectIndexForCount, selectIndexForGroupBy, selectMatchingIds, serveRelationFanout, softDeleteScope, sortColumnName, stableStringify, stableWireKey, stringifySearchText, subscriptionListDeltas, throwingScheduler, tokenizeSearch, trimCdcChanges, validateImportRow };
|
|
7059
|
+
export { ADMIN_FUNCTIONS, ADMIN_FUNCTION_PREFIX, AGGREGATE_SQL_FUNCTION, AUTH_METRICS_BUCKETS_TABLE, AUTH_METRICS_BUCKET_MS, AUTH_METRICS_BUCKET_RETENTION, AUTH_METRICS_TABLE, type AdvisoriesResult, type AdvisoryFinding, type AggregateIndexDefinitionLike, type AggregateOp, type AggregateOptions, type AggregateResult, type AggregateTally, type ApplyOnDeleteOptions, type AuditEntry, type AuditLogResult, type AuthMetrics, type AuthMetricsBucket, type BroadcastDelta, CDC_LOG_TABLE, type CacheEntry, type CapturedMailRow, type CdcChange, type Clock, type ColumnMeta, type ColumnMetaLike, ConflictError, type ContextMetrics, type ContextTracer, type CountArgs, CountRlsUnsupportedError, type CtxDbOptions, DATA_MIGRATION_STATE_TABLE, DEFAULT_MAX_RELATION_KEYS, type DataMigrationDocument, type DataMigrationLike, type DataMigrationTransform, type DatabaseWriterLike, type DependencyTracker, type DeployInfo, type ExportRow, type ExportShardAdminArgs, type ExportShardArgs, type ExternalSourceDiffResult, type ExternalSourceLike, FLAGS_FUNCTION_PREFIX, FUNCTION_METRICS_BUCKETS_TABLE, FUNCTION_METRICS_BUCKET_MS, FUNCTION_METRICS_BUCKET_RETENTION, FUNCTION_METRICS_INDEX_TABLE, FUNCTION_METRICS_TABLE, type FacetColumnOptions, type FacetColumnResult, type FacetValue, type FieldOperators, type FlagEvaluation, type FlagsResult, type FunctionCallStat, type FunctionMetricBucket, type FunctionMetricIndexHit, type FunctionStatsResult, type GroupByEntry, type GroupByOptions, type HibernatableWebSocket, type IdGenerator, type ImportError, type ImportShardAdminArgs, type ImportShardArgs, type ImportShardResult, type IncrementalMaterializeResult, type IndexDefinitionLike, type IndexRangeBuilderLike, LogBuffer, type LogEntry, type LogEventInput, type LogLevel, type LogSink, MAIL_RETENTION, MAIL_TABLE, MAX_SQL_ROWS, MIN_ADMIN_TOKEN_LENGTH, MIN_AUTH_SECRET_LENGTH, type MaskColumnMetadata, type MaskPoliciesResult, type MaterializeResult, type MetricsDeps, type MigrationDirection, type MigrationRunResult, type MigrationStatus, type MigrationStatusRow, type MutationDelta, type NestedWith, NotFoundError, NotUniqueError, type OnDeleteActionLike, type OrderByInput, type OrderKey, type PaginationOptions, type PitrBookmarkResult, type PitrRestoreArgs, type PitrRestoreResult, type PitrStorage, type QueryArgs, type QueryPage, type QueueMetadata, type QueuesResult, RANK_TIEBREAK, RELATION_FUNCTION_PREFIX, RLS_UNWRAP_SYMBOL, ROOT_DO_SIZE_WARN_BYTES, ROOT_SHARD_NAME, type RankDirection, type RankIndexDefinitionLike, type RankOptions, type RankPage, type RankPageOptions, type RankPageRow, type RankPageRowKey, type RankResult, type RankSortKeyLike, ReactiveCache, type ReactiveCacheOptions, type ReadHook, type ReadTablePageOptions, type RecordAuthEventInput, type RecordFunctionMetricInput, type RecordMailInput, type RelationDefinitionLike, type RenderedSql, type ResolveRelationPredicatesOptions, type ResolveWithOptions, type RestrictableQueryOptions, type RlsPoliciesResult, type RlsPolicyMetadata, RlsRequiredError, type RlsRoleMetadata, type RpcRequest, type RunDataMigrationOptions, type RunShardApplyCdcArgs, type RunShardApplyCdcResult, type RunShardBulkDeleteArgs, type RunShardBulkDeleteResult, type RunShardExportArgs, type RunShardImportArgs, type RunShardMigrationArgs, type RunShardRankBeforeArgs, type RunShardRankPageArgs, type RunShardWriteArgs, type RunShardWriteResult, type RunTriggersOptions, SCAN_DEP, SESSION_DO_TTL_DEFAULT, SHARD_REGISTRY_DO_NAME, type SchedulableWorkflowReferenceLike, type ScheduledFunctionDoc, type SchedulerLike, type SchemaLike, type SearchFilterBuilderLike, type SecurityAuditResult, type SecurityFinding, type SecurityFindingKind, type SecurityFindingLevel, type SelectMatchingIdsOptions, type ServerDefaultContextLike, SessionDO, type SessionRecord, type SettingEntry, type SettingKind, type SettingsResult, type ShapeSubscriptionQuery, ShardDO, type ShardDOOptions, type ShardDOState, type ShardRankPageResult, ShardRegistryDO, type SocketAttachment, type SortDirection, type SourceClientLike, type SourceCursorLike, type SourceRefresh, type SqlConsoleResult, type SqlCursor, type SqlEngine, type SqlExec, type StorageRuleMetadata, type StorageRulesResult, type StudioFeaturesResult, type SubscriptionEnvelope, type SubscriptionOutcome, type SubscriptionQuery, type SystemDatabaseReader, type SystemDoc, type SystemQuery, type SystemReaderOptions, type SystemReaderSchedulerLike, type SystemReaderStorageLike, type SystemTableName, type TableColumnsResult, type TableDefinitionLike, type TableIndexInfo, type TableIndexesResult, type TableInfo, type TablePage, type TableReaderLike, type TablesColumnsResult, type TelemetrySink, type TraceAnchor, type TracerDeps, type TransactionSqlLike, type TriggerContextLike, type TriggerDefinitionLike, type TriggerEventLike, type TriggerOpLike, type TriggerTimingLike, type ValidatorLike, type WhereInput, type WhereSqlStrategy, type WithInput, type WorkflowMetadata, type WorkflowsResult, type WriteEvent, type WriteHook, aggregateSqlFunction, aggregateTableName, applyCdcChanges, applyOnDelete, applySelect, armRestore, assertFlatPredicate, assertReadonly, assertShapeShardable, assertValidClientId, backfillAggregateIndexes, backfillRankIndexes, buildFtsMatch, buildSecurityAudit, buildSeekWhere, clearCapturedMail, coerceAggregateNumber, compileWhereSql, containsRelationPredicate, createDependencyTracker, createMetrics, createShardCtxDb, createSystemReader, createTracer, decodeCursor, depKey, diffExternalSource, dispatchRootSpan, encodeAggregateKey, encodeCursor, encodePartitionKey, ensureAuthMetricsTables, ensureFunctionMetricsTables, ensureMailTable, exportShardRows, exportShardTable, facetColumn, fanOutScalarCounts, foldAggregateTally, ftsTableName, guardWriter, hasTrigger, importShardRows, isRelationPredicate, isSoftDeleted, isSourceDue, liftSourceId, listTables, matchesRankStaticWhere, matchesStaticWhere, materializeExternalRows, materializeExternalRowsIncremental, mergeWhere, normalizeCountArgument, normalizeIdStructurally, normalizeOrderKeys, parseExportShardArgs, parseImportShardArgs, planAggregateLookup, pullExternalSourceIncrementalTick, pullExternalSourceTick, rankTableName, reactiveCacheKey, readAggregateValue, readAuthMetrics, readBookmark, readCapturedMail, readCdcChanges, readExternalSourceBaseline, readFunctionMetricBuckets, readFunctionMetricIndexHits, readFunctionMetrics, readFunctionMetricsTotals, readMigrationStatus, readTablePage, recordAuthEvent, recordCapturedMail, recordFunctionMetric, renderSql, resolveRankPartition, resolveRelationPredicates, resolveWith, runDataMigration, runExternalSourceTick, runReadonlySql, runRowValidators, runShardMigrations, runTriggers, scoreDocument, selectExportTables, selectIndexForAggregate, selectIndexForCount, selectIndexForGroupBy, selectMatchingIds, serveRelationFanout, softDeleteScope, sortColumnName, stableStringify, stableWireKey, stringifySearchText, subscriptionListDeltas, throwingScheduler, tokenizeSearch, trimCdcChanges, validateImportRow };
|