@lunora/runtime 1.0.0-alpha.291 → 1.0.0-alpha.293
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 +263 -69
- package/dist/index.d.ts +263 -69
- package/dist/index.mjs +1 -1
- package/dist/packem_shared/{base64-Bl1_r2k1.mjs → base64-DANXv-kI.mjs} +1 -1
- package/dist/packem_shared/composeWorker-C7SAGqH1.mjs +40 -0
- package/dist/packem_shared/{createCrossShardRelationCapabilities-Bm04PAy7.mjs → createCrossShardRelationCapabilities-BBUXTMhk.mjs} +1 -1
- package/dist/packem_shared/{createKvCursorStore-Bkn5pilz.mjs → createKvCursorStore-0cZ7aD4K.mjs} +1 -1
- package/dist/packem_shared/createQueryCoordinator-DIrlAqnz.mjs +1 -0
- package/dist/packem_shared/{createShardClient-Dar1gB9v.mjs → createShardClient-M_c0MHVS.mjs} +1 -1
- package/dist/packem_shared/{export-tap-C2B_SATf.mjs → export-tap-CMyD7rin.mjs} +1 -1
- package/dist/packem_shared/{identity-header-CG1FNe-S.mjs → identity-header-DqrLFqFq.mjs} +1 -1
- package/dist/packem_shared/{memoize-identity-DzVUB2rt.mjs → memoize-identity-Cbr1Sdt3.mjs} +1 -1
- package/dist/packem_shared/memoizeIdentity-45ptlQSS.mjs +1 -0
- package/dist/packem_shared/{portable-json-CSq6T1AU.mjs → portable-json-BBbxVWK6.mjs} +1 -1
- package/dist/packem_shared/{toAirbyteMessages-DY0vsuEn.mjs → toAirbyteMessages-BVogmTPJ.mjs} +1 -1
- package/package.json +5 -4
- package/dist/packem_shared/composeWorker-Bhpq03F6.mjs +0 -40
- package/dist/packem_shared/createQueryCoordinator-CaQF9cds.mjs +0 -1
- package/dist/packem_shared/memoizeIdentity-CUl7PPpt.mjs +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ShardDirectory, HttpCacheLike } from '@lunora/platform';
|
|
1
|
+
import { ShardDirectory, HttpCacheLike, R2MultipartUploadLike } from '@lunora/platform';
|
|
2
2
|
import { RankDirection, RankPageRow, DatabaseWriterLike, CrossShardReadArgs, QueryPage } from '@lunora/shard-engine';
|
|
3
3
|
export type { RankDirection as RankPageDirection, RankPageRowKey as RankPageKey, RankPageRow, ShardRankPageResult } from '@lunora/shard-engine';
|
|
4
4
|
import { R2SqlClient } from '@lunora/bindings/r2sql';
|
|
@@ -1257,6 +1257,11 @@ interface QueryCoordinator {
|
|
|
1257
1257
|
* other tables fall back to the runtime's default `__root__` shard.
|
|
1258
1258
|
*/
|
|
1259
1259
|
orchestrateImport: (namespace: ShardNamespaceInput, request: ImportFanOutRequest) => Promise<ImportFanOutResult>;
|
|
1260
|
+
/**
|
|
1261
|
+
* Send each shard its own staged-import session RPC (bounded concurrency,
|
|
1262
|
+
* the per-shard timeout) and return every shard's outcome in call order.
|
|
1263
|
+
*/
|
|
1264
|
+
orchestrateImportSession: (namespace: ShardNamespaceInput, request: ImportSessionFanOutRequest) => Promise<ReadonlyArray<ImportSessionShardOutcome>>;
|
|
1260
1265
|
/** Fan a migration admin RPC out to every live shard of a table and roll up the per-shard outcomes. */
|
|
1261
1266
|
orchestrateMigration: (namespace: ShardNamespaceInput, request: MigrationFanOutRequest) => Promise<MigrationFanOutResult>;
|
|
1262
1267
|
/**
|
|
@@ -1287,6 +1292,12 @@ interface QueryCoordinator {
|
|
|
1287
1292
|
*/
|
|
1288
1293
|
orchestrateShardTraffic: (namespace: ShardNamespaceInput, request: ShardTrafficFanOutRequest) => Promise<ShardTrafficFanOutResult>;
|
|
1289
1294
|
readonly registry: ShardRegistry;
|
|
1295
|
+
/**
|
|
1296
|
+
* Every live shard holding any of `tables` (the registry, plus the default
|
|
1297
|
+
* shard for a table it cannot list) — the shards a replace import must reach
|
|
1298
|
+
* so that one the import does not mention is still emptied.
|
|
1299
|
+
*/
|
|
1300
|
+
shardKeysForTables: (tables: ReadonlyArray<string>, defaultShardKey: DefaultShardKey) => Promise<ReadonlyArray<string>>;
|
|
1290
1301
|
}
|
|
1291
1302
|
/**
|
|
1292
1303
|
* Cross-shard export request. `tables` is the union of every table the caller
|
|
@@ -1410,6 +1421,28 @@ interface ImportFanOutRequest {
|
|
|
1410
1421
|
/** `"replace"` overwrites a row whose `_id` already exists; the default `"skip"` reports it as a conflict and leaves it unchanged. */
|
|
1411
1422
|
onConflict?: "replace" | "skip";
|
|
1412
1423
|
}
|
|
1424
|
+
/**
|
|
1425
|
+
* One staged-import session RPC per shard (`__lunora_admin__:importStage`,
|
|
1426
|
+
* `importCommit`, `importAbort`, …), each with its own args.
|
|
1427
|
+
*/
|
|
1428
|
+
interface ImportSessionFanOutRequest {
|
|
1429
|
+
calls: ReadonlyArray<{
|
|
1430
|
+
args: Record<string, unknown>;
|
|
1431
|
+
shardKey: string;
|
|
1432
|
+
}>;
|
|
1433
|
+
functionPath: string;
|
|
1434
|
+
headers?: Record<string, string>;
|
|
1435
|
+
}
|
|
1436
|
+
/** One shard's answer to an {@link ImportSessionFanOutRequest}: its unwrapped result, or why it failed. */
|
|
1437
|
+
interface ImportSessionShardOutcome {
|
|
1438
|
+
error?: {
|
|
1439
|
+
code: string;
|
|
1440
|
+
message: string;
|
|
1441
|
+
timedOut: boolean;
|
|
1442
|
+
};
|
|
1443
|
+
shardKey: string;
|
|
1444
|
+
value?: unknown;
|
|
1445
|
+
}
|
|
1413
1446
|
interface ShardImportOutcome {
|
|
1414
1447
|
error?: {
|
|
1415
1448
|
message: string;
|
|
@@ -1505,6 +1538,123 @@ interface ShardTrafficFanOutResult {
|
|
|
1505
1538
|
shards: ReadonlyArray<ShardTrafficEntry>;
|
|
1506
1539
|
}
|
|
1507
1540
|
declare const createQueryCoordinator: (options: QueryCoordinatorOptions) => QueryCoordinator;
|
|
1541
|
+
/** One KV namespace as the studio's KV browser surfaces it. */
|
|
1542
|
+
interface KvNamespaceSummary {
|
|
1543
|
+
/** The wrangler/env binding name, e.g. `"MY_KV"`. */
|
|
1544
|
+
binding: string;
|
|
1545
|
+
}
|
|
1546
|
+
/** One key entry as the KV admin browser surfaces it. */
|
|
1547
|
+
interface KvKeyEntry {
|
|
1548
|
+
/** Absolute expiration (Unix seconds), when set. */
|
|
1549
|
+
expiration?: number;
|
|
1550
|
+
/** Per-key metadata set at write time, or absent when none. */
|
|
1551
|
+
metadata?: unknown;
|
|
1552
|
+
/** The key name. */
|
|
1553
|
+
name: string;
|
|
1554
|
+
}
|
|
1555
|
+
/** A paginated page of KV keys as the admin browser returns it. */
|
|
1556
|
+
interface KvKeyListResult {
|
|
1557
|
+
/** Opaque cursor for the next page; absent when the listing is complete. */
|
|
1558
|
+
cursor?: string;
|
|
1559
|
+
/** The keys on this page. */
|
|
1560
|
+
keys: KvKeyEntry[];
|
|
1561
|
+
/** True when this is the final page. */
|
|
1562
|
+
listComplete: boolean;
|
|
1563
|
+
}
|
|
1564
|
+
/** A KV value together with its stored metadata. */
|
|
1565
|
+
interface KvValueResult {
|
|
1566
|
+
/** Per-key metadata, or `null` when none. */
|
|
1567
|
+
metadata: unknown;
|
|
1568
|
+
/** The stored value as a string, or `null` when the key is absent. */
|
|
1569
|
+
value: null | string;
|
|
1570
|
+
}
|
|
1571
|
+
/**
|
|
1572
|
+
* The introspector the worker wires for the studio's KV browser. Build it from
|
|
1573
|
+
* the env's bound KV namespaces. Omit it and the `/_lunora/admin/kv/*`
|
|
1574
|
+
* endpoints respond `KV_NOT_CONFIGURED`.
|
|
1575
|
+
*/
|
|
1576
|
+
interface KvIntrospector {
|
|
1577
|
+
/** Delete a key from a namespace. No-op when the key is absent. */
|
|
1578
|
+
deleteKey: (options: {
|
|
1579
|
+
key: string;
|
|
1580
|
+
namespace: string;
|
|
1581
|
+
}) => Promise<void>;
|
|
1582
|
+
/**
|
|
1583
|
+
* Read a value and its metadata from a namespace key — as text, or with
|
|
1584
|
+
* `encoding: "base64"` as the base64 of its raw bytes (what the admin export
|
|
1585
|
+
* uses, so a binary value survives the round trip).
|
|
1586
|
+
*/
|
|
1587
|
+
getValue: (options: {
|
|
1588
|
+
encoding?: "base64";
|
|
1589
|
+
key: string;
|
|
1590
|
+
namespace: string;
|
|
1591
|
+
}) => Promise<KvValueResult>;
|
|
1592
|
+
/** List keys in a namespace, optionally filtered by prefix and paginated. */
|
|
1593
|
+
listKeys: (options: {
|
|
1594
|
+
cursor?: string;
|
|
1595
|
+
limit?: number;
|
|
1596
|
+
namespace: string;
|
|
1597
|
+
prefix?: string;
|
|
1598
|
+
}) => Promise<KvKeyListResult>;
|
|
1599
|
+
/** List the registered KV namespaces (binding names). */
|
|
1600
|
+
listNamespaces: () => Promise<KvNamespaceSummary[]>;
|
|
1601
|
+
/** Write a value (as text, or the bytes of a base64 `value` under `encoding: "base64"`) with optional absolute expiration / relative TTL and metadata. */
|
|
1602
|
+
putValue: (options: {
|
|
1603
|
+
encoding?: "base64";
|
|
1604
|
+
expiration?: number;
|
|
1605
|
+
expirationTtl?: number;
|
|
1606
|
+
key: string;
|
|
1607
|
+
metadata?: unknown;
|
|
1608
|
+
namespace: string;
|
|
1609
|
+
value: string;
|
|
1610
|
+
}) => Promise<void>;
|
|
1611
|
+
}
|
|
1612
|
+
/**
|
|
1613
|
+
* The auth tables that live outside the schema — better-auth's tables in the auth
|
|
1614
|
+
* D1 database, or every table of the DO-backed auth object. `@lunora/auth`'s
|
|
1615
|
+
* `createSqlAuthDataPort` / `createDoAuthWiring(...).dataPort` build one.
|
|
1616
|
+
*/
|
|
1617
|
+
interface AuthDataPort {
|
|
1618
|
+
/** Every row of every auth table, parents (`user`) before the rows that reference them. */
|
|
1619
|
+
exportRows: () => AsyncIterable<{
|
|
1620
|
+
doc: Record<string, unknown>;
|
|
1621
|
+
table: string;
|
|
1622
|
+
}>;
|
|
1623
|
+
/** Insert rows, skipping any whose key already exists (append-only, like the table import). `index` is the row's position in `rows`. */
|
|
1624
|
+
importRows: (rows: ReadonlyArray<{
|
|
1625
|
+
doc: Record<string, unknown>;
|
|
1626
|
+
table: string;
|
|
1627
|
+
}>) => Promise<{
|
|
1628
|
+
conflicts: number;
|
|
1629
|
+
errors: ReadonlyArray<{
|
|
1630
|
+
index: number;
|
|
1631
|
+
message: string;
|
|
1632
|
+
table: string;
|
|
1633
|
+
}>;
|
|
1634
|
+
inserted: number;
|
|
1635
|
+
}>;
|
|
1636
|
+
/**
|
|
1637
|
+
* Make the auth tables hold exactly `rows`, in one transaction of the auth
|
|
1638
|
+
* store: on any error nothing changed. Signed-in sessions and one-time tokens
|
|
1639
|
+
* are cleared with them. Absent ⇒ a replace import of a snapshot carrying the
|
|
1640
|
+
* `auth` section is refused. With `dryRun`, checks the rows and writes nothing: a
|
|
1641
|
+
* commit runs it before any shard is written.
|
|
1642
|
+
*/
|
|
1643
|
+
replaceRows?: (rows: ReadonlyArray<{
|
|
1644
|
+
doc: Record<string, unknown>;
|
|
1645
|
+
table: string;
|
|
1646
|
+
}>, options?: {
|
|
1647
|
+
dryRun?: boolean;
|
|
1648
|
+
}) => Promise<{
|
|
1649
|
+
deleted: number;
|
|
1650
|
+
errors: ReadonlyArray<{
|
|
1651
|
+
index: number;
|
|
1652
|
+
message: string;
|
|
1653
|
+
table: string;
|
|
1654
|
+
}>;
|
|
1655
|
+
inserted: number;
|
|
1656
|
+
}>;
|
|
1657
|
+
}
|
|
1508
1658
|
/**
|
|
1509
1659
|
* One change in the export stream — a clean projection of the raw op-log CDC
|
|
1510
1660
|
* record that preserves `seq` (for ordering / idempotency downstream) and the
|
|
@@ -1888,71 +2038,6 @@ interface IdentityContractLike {
|
|
|
1888
2038
|
/** Validate resolver-returned claims against the declared contract. */
|
|
1889
2039
|
validate: (identity: Record<string, unknown>) => IdentityValidation;
|
|
1890
2040
|
}
|
|
1891
|
-
/** One KV namespace as the studio's KV browser surfaces it. */
|
|
1892
|
-
interface KvNamespaceSummary {
|
|
1893
|
-
/** The wrangler/env binding name, e.g. `"MY_KV"`. */
|
|
1894
|
-
binding: string;
|
|
1895
|
-
}
|
|
1896
|
-
/** One key entry as the KV admin browser surfaces it. */
|
|
1897
|
-
interface KvKeyEntry {
|
|
1898
|
-
/** Absolute expiration (Unix seconds), when set. */
|
|
1899
|
-
expiration?: number;
|
|
1900
|
-
/** Per-key metadata set at write time, or absent when none. */
|
|
1901
|
-
metadata?: unknown;
|
|
1902
|
-
/** The key name. */
|
|
1903
|
-
name: string;
|
|
1904
|
-
}
|
|
1905
|
-
/** A paginated page of KV keys as the admin browser returns it. */
|
|
1906
|
-
interface KvKeyListResult {
|
|
1907
|
-
/** Opaque cursor for the next page; absent when the listing is complete. */
|
|
1908
|
-
cursor?: string;
|
|
1909
|
-
/** The keys on this page. */
|
|
1910
|
-
keys: KvKeyEntry[];
|
|
1911
|
-
/** True when this is the final page. */
|
|
1912
|
-
listComplete: boolean;
|
|
1913
|
-
}
|
|
1914
|
-
/** A KV value together with its stored metadata. */
|
|
1915
|
-
interface KvValueResult {
|
|
1916
|
-
/** Per-key metadata, or `null` when none. */
|
|
1917
|
-
metadata: unknown;
|
|
1918
|
-
/** The stored value as a string, or `null` when the key is absent. */
|
|
1919
|
-
value: null | string;
|
|
1920
|
-
}
|
|
1921
|
-
/**
|
|
1922
|
-
* The introspector the worker wires for the studio's KV browser. Build it from
|
|
1923
|
-
* the env's bound KV namespaces. Omit it and the `/_lunora/admin/kv/*`
|
|
1924
|
-
* endpoints respond `KV_NOT_CONFIGURED`.
|
|
1925
|
-
*/
|
|
1926
|
-
interface KvIntrospector {
|
|
1927
|
-
/** Delete a key from a namespace. No-op when the key is absent. */
|
|
1928
|
-
deleteKey: (options: {
|
|
1929
|
-
key: string;
|
|
1930
|
-
namespace: string;
|
|
1931
|
-
}) => Promise<void>;
|
|
1932
|
-
/** Read a value (as text) and its metadata from a namespace key. */
|
|
1933
|
-
getValue: (options: {
|
|
1934
|
-
key: string;
|
|
1935
|
-
namespace: string;
|
|
1936
|
-
}) => Promise<KvValueResult>;
|
|
1937
|
-
/** List keys in a namespace, optionally filtered by prefix and paginated. */
|
|
1938
|
-
listKeys: (options: {
|
|
1939
|
-
cursor?: string;
|
|
1940
|
-
limit?: number;
|
|
1941
|
-
namespace: string;
|
|
1942
|
-
prefix?: string;
|
|
1943
|
-
}) => Promise<KvKeyListResult>;
|
|
1944
|
-
/** List the registered KV namespaces (binding names). */
|
|
1945
|
-
listNamespaces: () => Promise<KvNamespaceSummary[]>;
|
|
1946
|
-
/** Write a value (as text) with optional absolute expiration / relative TTL and metadata. */
|
|
1947
|
-
putValue: (options: {
|
|
1948
|
-
expiration?: number;
|
|
1949
|
-
expirationTtl?: number;
|
|
1950
|
-
key: string;
|
|
1951
|
-
metadata?: unknown;
|
|
1952
|
-
namespace: string;
|
|
1953
|
-
value: string;
|
|
1954
|
-
}) => Promise<void>;
|
|
1955
|
-
}
|
|
1956
2041
|
/** The unredacted facts about a thrown value, for observability sinks only. */
|
|
1957
2042
|
interface ErrorDetail {
|
|
1958
2043
|
/** The `LunoraError` taxonomy code, when the thrown value carries one. */
|
|
@@ -2564,7 +2649,7 @@ interface ObservabilityEvent {
|
|
|
2564
2649
|
* here under the runtime's historical names.
|
|
2565
2650
|
*
|
|
2566
2651
|
* `LogLevel` is the canonical `ctx.log` severity union (the five console tiers
|
|
2567
|
-
* plus `trace`/`fatal`);
|
|
2652
|
+
* plus `trace`/`fatal`); ObservabilitySinkContext is the shared per-event sink
|
|
2568
2653
|
* context (a `waitUntil` to keep a background send alive past the response).
|
|
2569
2654
|
*/
|
|
2570
2655
|
type LogLevel = ContextLogLevel;
|
|
@@ -3476,6 +3561,56 @@ type GlobalImportFunction = (request: {
|
|
|
3476
3561
|
/** Existing rows overwritten under `onConflict: "replace"`. */
|
|
3477
3562
|
replaced?: number;
|
|
3478
3563
|
}>;
|
|
3564
|
+
/**
|
|
3565
|
+
* The `.global()` half of a staged replace import (`/_lunora/admin/import?mode=replace`),
|
|
3566
|
+
* over `@lunora/d1`'s `stageGlobalRows` / `commitStagedGlobalRows` /
|
|
3567
|
+
* `abortStagedGlobalRows`. A failure that carries a string `code`
|
|
3568
|
+
* (`IMPORT_SESSION_EXPIRED`, `IMPORT_SESSION_STALE`, …) is answered with it.
|
|
3569
|
+
* Every call names the session's `generation`; rows of another are refused.
|
|
3570
|
+
*/
|
|
3571
|
+
interface GlobalImportStaging {
|
|
3572
|
+
/** Forget a session's staged rows (of that generation only). */
|
|
3573
|
+
abort: (request: {
|
|
3574
|
+
generation: string;
|
|
3575
|
+
session: string;
|
|
3576
|
+
}) => Promise<void>;
|
|
3577
|
+
/** Swap the staged rows in for `tables` (writes, then prune); `staged` says whether the session staged any row here. */
|
|
3578
|
+
commit: (request: {
|
|
3579
|
+
generation: string;
|
|
3580
|
+
session: string;
|
|
3581
|
+
staged: boolean;
|
|
3582
|
+
tables: ReadonlyArray<string>;
|
|
3583
|
+
}) => Promise<{
|
|
3584
|
+
conflicts: number;
|
|
3585
|
+
deleted?: Record<string, number>;
|
|
3586
|
+
errors: ReadonlyArray<{
|
|
3587
|
+
code: string;
|
|
3588
|
+
line: number;
|
|
3589
|
+
message: string;
|
|
3590
|
+
table: string;
|
|
3591
|
+
}>;
|
|
3592
|
+
inserted: Record<string, number>;
|
|
3593
|
+
}>;
|
|
3594
|
+
/** Validate and stage one request's rows; any refused row stages none. */
|
|
3595
|
+
stage: (request: {
|
|
3596
|
+
generation: string;
|
|
3597
|
+
rows: ReadonlyArray<{
|
|
3598
|
+
doc: Record<string, unknown>;
|
|
3599
|
+
line: number;
|
|
3600
|
+
table: string;
|
|
3601
|
+
}>;
|
|
3602
|
+
session: string;
|
|
3603
|
+
tables: ReadonlyArray<string>;
|
|
3604
|
+
}) => Promise<{
|
|
3605
|
+
errors: ReadonlyArray<{
|
|
3606
|
+
code: string;
|
|
3607
|
+
line: number;
|
|
3608
|
+
message: string;
|
|
3609
|
+
table: string;
|
|
3610
|
+
}>;
|
|
3611
|
+
staged: Record<string, number>;
|
|
3612
|
+
}>;
|
|
3613
|
+
}
|
|
3479
3614
|
/** One R2 object as the storage browser surfaces it. Mirrors `@lunora/storage`'s `R2ObjectLike`. */
|
|
3480
3615
|
interface StorageObject {
|
|
3481
3616
|
customMetadata?: Record<string, string>;
|
|
@@ -3611,6 +3746,7 @@ type StorageListFunction = (prefix?: string, options?: {
|
|
|
3611
3746
|
}) => Promise<{
|
|
3612
3747
|
cursor?: string;
|
|
3613
3748
|
objects: StorageObject[];
|
|
3749
|
+
truncated?: boolean;
|
|
3614
3750
|
}>;
|
|
3615
3751
|
/**
|
|
3616
3752
|
* Deletes one object from a storage bucket for the admin file browser.
|
|
@@ -3630,6 +3766,7 @@ type StorageDeleteFunction = (key: string, options?: {
|
|
|
3630
3766
|
type StorageUploadFunction = (key: string, body: ArrayBuffer, options?: {
|
|
3631
3767
|
bucket?: string;
|
|
3632
3768
|
contentType?: string;
|
|
3769
|
+
customMetadata?: Record<string, string>;
|
|
3633
3770
|
sha256?: string;
|
|
3634
3771
|
}) => Promise<{
|
|
3635
3772
|
etag?: string;
|
|
@@ -3638,6 +3775,16 @@ type StorageUploadFunction = (key: string, body: ArrayBuffer, options?: {
|
|
|
3638
3775
|
etag?: string;
|
|
3639
3776
|
key: string;
|
|
3640
3777
|
};
|
|
3778
|
+
/**
|
|
3779
|
+
* Begins a multipart upload of one object. Structurally `@lunora/storage`'s
|
|
3780
|
+
* `Storage["createMultipartUpload"]` with the target `bucket` added; the
|
|
3781
|
+
* import assembles a restored object over 32 MiB through it.
|
|
3782
|
+
*/
|
|
3783
|
+
type StorageMultipartUploadFunction = (key: string, options?: {
|
|
3784
|
+
bucket?: string;
|
|
3785
|
+
contentType?: string;
|
|
3786
|
+
customMetadata?: Record<string, string>;
|
|
3787
|
+
}) => Promise<R2MultipartUploadLike>;
|
|
3641
3788
|
/**
|
|
3642
3789
|
* Reads one object's bytes back out of a storage bucket. Structurally the part
|
|
3643
3790
|
* of `@lunora/storage`'s `Storage["download"]` the admin endpoint needs — the
|
|
@@ -3788,6 +3935,8 @@ interface ScheduledControllerLike {
|
|
|
3788
3935
|
type CronHandler = (controller: ScheduledControllerLike, env: unknown, context: ExecutionContextLike) => Promise<void> | void;
|
|
3789
3936
|
/** One forwarded queue message: the platform's opaque `body` plus its id. */
|
|
3790
3937
|
interface QueueForwardMessage {
|
|
3938
|
+
/** The platform's delivery attempt of the message, which a retry policy needs to see a last delivery. */
|
|
3939
|
+
attempts?: number;
|
|
3791
3940
|
body: unknown;
|
|
3792
3941
|
id: string;
|
|
3793
3942
|
}
|
|
@@ -3799,14 +3948,25 @@ interface QueueForwardBatch {
|
|
|
3799
3948
|
/** Outcome of a forwarded batch: the ids to retry (everything else is acked). */
|
|
3800
3949
|
interface QueueForwardResult {
|
|
3801
3950
|
retry?: ReadonlyArray<string>;
|
|
3951
|
+
/** The delay, in seconds, each retried id asked for; one absent here is retried at once. */
|
|
3952
|
+
retryDelays?: Readonly<Record<string, number>>;
|
|
3802
3953
|
}
|
|
3803
3954
|
/**
|
|
3804
3955
|
* Process a batch of queue messages forwarded by the platform. WfP namespaced
|
|
3805
3956
|
* Workers can't be queue consumers, so a platform-owned consumer fans batches in
|
|
3806
3957
|
* here; return the ids to retry. Env-driven side effects
|
|
3807
3958
|
* (sending mail, etc.) belong in the app's handler.
|
|
3959
|
+
*
|
|
3960
|
+
* `hold.holdSeconds` is set while the deployment is paused, and only for a
|
|
3961
|
+
* handler whose `WorkerOptions.queueHandlerHolds` is `true`, as
|
|
3962
|
+
* {@link TriggerTrace.holdSeconds} is for the native `queue()` entry: the handler
|
|
3963
|
+
* holds each message back that long instead of running it — a fresh delayed copy
|
|
3964
|
+
* sent through its own producer binding, then acked, so a long pause spends none
|
|
3965
|
+
* of the platform's delivery attempts.
|
|
3808
3966
|
*/
|
|
3809
|
-
type QueueForwardHandler = (batch: QueueForwardBatch, env: unknown, context: ExecutionContextLike
|
|
3967
|
+
type QueueForwardHandler = (batch: QueueForwardBatch, env: unknown, context: ExecutionContextLike, hold?: {
|
|
3968
|
+
holdSeconds: number;
|
|
3969
|
+
}) => Promise<QueueForwardResult | undefined> | QueueForwardResult | undefined;
|
|
3810
3970
|
/**
|
|
3811
3971
|
* The trigger's own trace, handed to a consumer so every function it dispatches
|
|
3812
3972
|
* is a child of the trigger span instead of an unrelated root trace.
|
|
@@ -4179,6 +4339,17 @@ interface WorkerOptions {
|
|
|
4179
4339
|
* Only meaningful alongside `authHandler`.
|
|
4180
4340
|
*/
|
|
4181
4341
|
authBasePath?: string;
|
|
4342
|
+
/**
|
|
4343
|
+
* The auth tables that live outside the schema (better-auth's tables in the auth
|
|
4344
|
+
* D1 database, or the DO-backed auth object's), read and written by the admin
|
|
4345
|
+
* export / import as the `$auth` section — so a backup, restore and eject carry
|
|
4346
|
+
* users and accounts with the app's own tables. Never signed-in sessions,
|
|
4347
|
+
* one-time tokens or the auth audit log: users sign in again after a restore,
|
|
4348
|
+
* and a replace clears the sessions and tokens. Codegen wires it for
|
|
4349
|
+
* both auth modes. Omit it and the export has no auth section, and an import's
|
|
4350
|
+
* `$auth` rows are reported as `AUTH_NOT_CONFIGURED`.
|
|
4351
|
+
*/
|
|
4352
|
+
authData?: AuthDataPort;
|
|
4182
4353
|
/**
|
|
4183
4354
|
* Optional prebound `@lunora/auth` handler for the OAuth discovery documents
|
|
4184
4355
|
* that live OUTSIDE the auth base path — the RFC 9728 protected-resource
|
|
@@ -4415,6 +4586,11 @@ interface WorkerOptions {
|
|
|
4415
4586
|
* rows targeting global tables are reported as hard errors.
|
|
4416
4587
|
*/
|
|
4417
4588
|
importGlobals?: GlobalImportFunction;
|
|
4589
|
+
/**
|
|
4590
|
+
* Stage and commit `.global()` rows for a replace import. When omitted, a
|
|
4591
|
+
* replace import whose scope holds a `.global()` table is refused.
|
|
4592
|
+
*/
|
|
4593
|
+
importGlobalsStaging?: GlobalImportStaging;
|
|
4418
4594
|
/**
|
|
4419
4595
|
* Set when `importGlobals` honours a row's `op: "delete"`. An import that
|
|
4420
4596
|
* carries global delete rows is refused unless this is set: an importer that
|
|
@@ -4597,6 +4773,14 @@ interface WorkerOptions {
|
|
|
4597
4773
|
* message ids to retry; the rest are acked. Omit if the app has no queues.
|
|
4598
4774
|
*/
|
|
4599
4775
|
queueHandler?: QueueForwardHandler;
|
|
4776
|
+
/**
|
|
4777
|
+
* Whether {@link WorkerOptions.queueHandler} honours its `hold` argument. Set,
|
|
4778
|
+
* a paused deployment calls the handler with `hold` and it holds the batch
|
|
4779
|
+
* itself. Unset, a paused deployment never calls the handler and answers every
|
|
4780
|
+
* message as a delayed retry instead: a handler that ignored `hold` would run
|
|
4781
|
+
* and ack work the pause was meant to stop. Codegen's handler sets it.
|
|
4782
|
+
*/
|
|
4783
|
+
queueHandlerHolds?: boolean;
|
|
4600
4784
|
/**
|
|
4601
4785
|
* Serve one-shot **queries** from a read replica placed in the caller's
|
|
4602
4786
|
* region instead of from the shard owner. Off by default.
|
|
@@ -4798,6 +4982,16 @@ interface WorkerOptions {
|
|
|
4798
4982
|
* responds `STORAGE_NOT_CONFIGURED`.
|
|
4799
4983
|
*/
|
|
4800
4984
|
storageList?: StorageListFunction;
|
|
4985
|
+
/**
|
|
4986
|
+
* Begins a multipart upload, which the admin import uses to assemble a
|
|
4987
|
+
* restored storage object over 32 MiB from its staged chunks (in parts of
|
|
4988
|
+
* at least 5 MiB, one held at a time). The generated app worker emits
|
|
4989
|
+
* `(key, opts) => pick(opts?.bucket).createMultipartUpload(key, opts)`.
|
|
4990
|
+
* Omit it, or run on a bucket without multipart uploads, and such an
|
|
4991
|
+
* object is reported (`STORAGE_OBJECT_TOO_LARGE` / `STORAGE_IMPORT_FAILED`)
|
|
4992
|
+
* instead of restored; smaller ones are unaffected.
|
|
4993
|
+
*/
|
|
4994
|
+
storageMultipartUpload?: StorageMultipartUploadFunction;
|
|
4801
4995
|
/**
|
|
4802
4996
|
* Mints a (signed or public) URL for one object, backing the admin-gated
|
|
4803
4997
|
* `GET /_lunora/admin/storage/url` endpoint the studio's "copy URL" action
|
|
@@ -6006,7 +6200,7 @@ type StudioDocumentName = "architecture" | "openapi" | "openrpc";
|
|
|
6006
6200
|
*/
|
|
6007
6201
|
declare const loadStudioDocument: (binding: unknown, name: StudioDocumentName) => Promise<unknown>;
|
|
6008
6202
|
declare const VERSION: string;
|
|
6009
|
-
export { type AccessContextLike, type AccessIdentityLike, type AdminTableResolver, type AdminTokenSummary, type AiRunBinding, type AirbyteMessage, type AnalyticsEngineDataPointLike, type AnalyticsEngineDatasetLike, type AnalyticsEngineSinkOptions, type AssetsFetcherLike, type AuthAdmin, type AuthCapabilities, type AuthConfigInfo, type AuthImpersonation, type AuthPage, type AuthSession, type AuthUser, type AuthUserFieldSpec, BACKUP_KEY_PREFIX, type BackupManifest, type BackupManifestEntry, type BackupRetentionPreview, type BackupStore, type ComposeIdentityResolversErrorMode, type ComposeIdentityResolversOptions, type ConnectorChange, type ConnectorSyncPage, type CorsOptions, type CreatedAdminToken, type CronHandler, type CronJobDispatch, type CronJobInfo, type CrossOriginOpenerPolicy, type CrossShardCounter, type CrossShardReader, type CrossShardRelationCapabilities, type CrossShardRelationOptions, type CsrfOptions, DEFAULT_LOG_COLUMNS, DEFAULT_REGISTRY_CACHE_TTL_MS, type DurableObjectJurisdiction, type DynamicShardRegistry, type DynamicShardRegistryOptions, type ExecutionContextLike, type ExportBatch, type ExportChange, type ExportCursorStore, type ExportFanOutRequest, type ExportFanOutResult, type ExportSink, type ExportTapFailure, type ExportTapResult, type FanOutRequest, type FanOutResult, type FanOutSpec, type FivetranResponse, type FrameworkHostHandler, type FrameworkWorkerOptions, type FrameworkWorkerOptionsInput, type FunctionDescriptor, type FunctionRegistryEntry, type FunctionRegistryLike, type GlobalExportFunction as GlobalExportFn, type GlobalImportFunction as GlobalImportFn, type GlobalIntrospector, type GlobalTableInfo as GlobalTableInfoMeta, type GlobalTablePage as GlobalTablePageMeta, HEALTH_PATH, HEALTH_READY_PATH, type HealthAuthPosture, type HealthBody, type HealthCheckReport, type HealthProbe, type HealthProbeKind, type HealthProbeResult, type HealthRouteDeps, type HttpActionContext, type HttpActionLike, type HttpRouterLike, type IdentityContractLike, type IdentityResolver, type IdentityValidation, type ImportFanOutRequest, type ImportFanOutResult, type KvIntrospector, type KvKeyEntry, type KvKeyListResult, type KvNamespaceSummary, type KvValueResult, LOG_ARCHIVE_NOT_CONFIGURED, LOG_ARCHIVE_PATH, type ListAuthUsersOptions, type LogArchiveConfig, type LogEvent, type LogFields, type LogLevel, LunoraError, type LunoraErrorBody, type LunoraHandlerOptions, type LunoraWorker, type MemoizeIdentityOptions, type MergeStrategy, type MetricEvent, type MetricKind, type MigrationFanOutRequest, type MigrationFanOutResult, NOOP_EXECUTION_CONTEXT, type NotifySubscriptionDevice, type NotifySubscriptionStoreLike, type ObservabilityEvent, type ObservabilitySink, type ObservabilitySinkContext,
|
|
6203
|
+
export { type AccessContextLike, type AccessIdentityLike, type AdminTableResolver, type AdminTokenSummary, type AiRunBinding, type AirbyteMessage, type AnalyticsEngineDataPointLike, type AnalyticsEngineDatasetLike, type AnalyticsEngineSinkOptions, type AssetsFetcherLike, type AuthAdmin, type AuthCapabilities, type AuthConfigInfo, type AuthDataPort, type AuthImpersonation, type AuthPage, type AuthSession, type AuthUser, type AuthUserFieldSpec, BACKUP_KEY_PREFIX, type BackupManifest, type BackupManifestEntry, type BackupRetentionPreview, type BackupStore, type ComposeIdentityResolversErrorMode, type ComposeIdentityResolversOptions, type ConnectorChange, type ConnectorSyncPage, type CorsOptions, type CreatedAdminToken, type CronHandler, type CronJobDispatch, type CronJobInfo, type CrossOriginOpenerPolicy, type CrossShardCounter, type CrossShardReader, type CrossShardRelationCapabilities, type CrossShardRelationOptions, type CsrfOptions, DEFAULT_LOG_COLUMNS, DEFAULT_REGISTRY_CACHE_TTL_MS, type DurableObjectJurisdiction, type DynamicShardRegistry, type DynamicShardRegistryOptions, type ExecutionContextLike, type ExportBatch, type ExportChange, type ExportCursorStore, type ExportFanOutRequest, type ExportFanOutResult, type ExportSink, type ExportTapFailure, type ExportTapResult, type FanOutRequest, type FanOutResult, type FanOutSpec, type FivetranResponse, type FrameworkHostHandler, type FrameworkWorkerOptions, type FrameworkWorkerOptionsInput, type FunctionDescriptor, type FunctionRegistryEntry, type FunctionRegistryLike, type GlobalExportFunction as GlobalExportFn, type GlobalImportFunction as GlobalImportFn, type GlobalImportStaging, type GlobalIntrospector, type GlobalTableInfo as GlobalTableInfoMeta, type GlobalTablePage as GlobalTablePageMeta, HEALTH_PATH, HEALTH_READY_PATH, type HealthAuthPosture, type HealthBody, type HealthCheckReport, type HealthProbe, type HealthProbeKind, type HealthProbeResult, type HealthRouteDeps, type HttpActionContext, type HttpActionLike, type HttpRouterLike, type IdentityContractLike, type IdentityResolver, type IdentityValidation, type ImportFanOutRequest, type ImportFanOutResult, type ImportSessionFanOutRequest, type ImportSessionShardOutcome, type KvIntrospector, type KvKeyEntry, type KvKeyListResult, type KvNamespaceSummary, type KvValueResult, LOG_ARCHIVE_NOT_CONFIGURED, LOG_ARCHIVE_PATH, type ListAuthUsersOptions, type LogArchiveConfig, type LogEvent, type LogFields, type LogLevel, LunoraError, type LunoraErrorBody, type LunoraHandlerOptions, type LunoraWorker, type MemoizeIdentityOptions, type MergeStrategy, type MetricEvent, type MetricKind, type MigrationFanOutRequest, type MigrationFanOutResult, NOOP_EXECUTION_CONTEXT, type NotifySubscriptionDevice, type NotifySubscriptionStoreLike, type ObservabilityEvent, type ObservabilitySink, type ObservabilitySinkContext,
|
|
6010
6204
|
/**
|
|
6011
6205
|
* Resource attribute bag used by OTLP exporters. Re-exported from `shared/otlp`
|
|
6012
6206
|
* because {@link OtlpSinkOptions.resourceAttributes} is part of the public
|