@lunora/runtime 1.0.0-alpha.292 → 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.ts 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. */
@@ -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) => Promise<QueueForwardResult | undefined> | QueueForwardResult | undefined;
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
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{declareAppJurisdiction as t}from"./packem_shared/declareAppJurisdiction-DEba2p42.mjs";import{BACKUP_KEY_PREFIX as s,backupManifestKey as i,backupObjectKey as p,backupObjectKeyOfManifest as n,isBackupManifestEntry as c,isBackupManifestKey as m,normalizeBackupPrefix as f}from"./packem_shared/BACKUP_KEY_PREFIX-BOtSu-_3.mjs";import{toAirbyteMessages as E,toFivetranResponse as R}from"./packem_shared/toAirbyteMessages-DY0vsuEn.mjs";import{composeWorker as d,createLunoraHandler as l,createWorker as u,defineRpcEnvelope as _,resolveLunoraOptions as k,withFrameworkWorker as b}from"./packem_shared/composeWorker-Bhpq03F6.mjs";import{createCrossShardRelationCapabilities as C}from"./packem_shared/createCrossShardRelationCapabilities-Bm04PAy7.mjs";import{DEFAULT_REGISTRY_CACHE_TTL_MS as A,SHARD_REGISTRY_DO_NAME as L,createDynamicShardRegistry as T}from"./packem_shared/DEFAULT_REGISTRY_CACHE_TTL_MS-w_RLPiwj.mjs";import{parseStackFrames as H,toError as P}from"./packem_shared/parseStackFrames-CZddjveh.mjs";import{LunoraError as v,toErrorResponse as I}from"./packem_shared/LunoraError-PkZWF-_g.mjs";import{c as F,a as M,d as N,r as G,b as K,s as U,w}from"./packem_shared/export-tap-C2B_SATf.mjs";import{HEALTH_PATH as Y,HEALTH_READY_PATH as z,buildHealthRoutes as X,d1Probe as j,durableObjectProbe as V,presenceProbe as W}from"./packem_shared/HEALTH_PATH-B8ndDG3s.mjs";import{LOG_ARCHIVE_PATH as J,resolveLogArchiveFromEnv as Q}from"./packem_shared/LOG_ARCHIVE_PATH-dTuCzfyj.mjs";import{m as $,a as ee}from"./packem_shared/memoize-identity-DzVUB2rt.mjs";import{e as oe,a as te}from"./packem_shared/observability-9slk__Gi.mjs";import{enrichSink as se,filterSink as ie}from"./packem_shared/enrichSink-8_qnPWNH.mjs";import{a as ne,c as ce,b as me,o as fe,p as xe,w as Ee}from"./packem_shared/observability-sinks-BA76CH4h.mjs";import{D as Se,c as de}from"./packem_shared/pipeline-log-reader-C-nuWG_e.mjs";import{createQueryCoordinator as ue,createStaticShardRegistry as _e}from"./packem_shared/createQueryCoordinator-CaQF9cds.mjs";import{applyJurisdiction as be,resolveShard as ye}from"./packem_shared/applyJurisdiction-DKQE8kOA.mjs";import{a as Oe,r as Ae,b as Le}from"./packem_shared/rest-cache-q5V06Etw.mjs";import{a as he,b as He,c as Pe,r as ge}from"./packem_shared/rest-routes-D5NWHmVl.mjs";import{d as Ie,e as De,h as Fe,r as Me}from"./packem_shared/security-headers-0DqdJ04h.mjs";import{createShardClient as Ge}from"./packem_shared/createShardClient-Dar1gB9v.mjs";import{STORAGE_UPLOAD_MAX_BODY_BYTES as Ue}from"./packem_shared/STORAGE_UPLOAD_MAX_BODY_BYTES-Onz8HkiB.mjs";import{loadStudioDocument as Be}from"./packem_shared/loadStudioDocument-BSYQEMnd.mjs";import{LOG_ARCHIVE_NOT_CONFIGURED as ze}from"./packem_shared/LOG_ARCHIVE_NOT_CONFIGURED-CDpi4yFD.mjs";import{NOOP_EXECUTION_CONTEXT as je}from"./packem_shared/NOOP_EXECUTION_CONTEXT-YmXqH-jH.mjs";import{composeIdentityResolvers as We,routeIdentityResolvers as qe}from"./packem_shared/composeIdentityResolvers-CpdHuDyk.mjs";const e="0.0.0";export{s as BACKUP_KEY_PREFIX,Se as DEFAULT_LOG_COLUMNS,A as DEFAULT_REGISTRY_CACHE_TTL_MS,Y as HEALTH_PATH,z as HEALTH_READY_PATH,ze as LOG_ARCHIVE_NOT_CONFIGURED,J as LOG_ARCHIVE_PATH,v as LunoraError,je as NOOP_EXECUTION_CONTEXT,L as SHARD_REGISTRY_DO_NAME,Ue as STORAGE_UPLOAD_MAX_BODY_BYTES,e as VERSION,ne as analyticsEngineSink,be as applyJurisdiction,Oe as applyRestCache,he as argsFromQuery,i as backupManifestKey,p as backupObjectKey,n as backupObjectKeyOfManifest,X as buildHealthRoutes,He as buildRestRoutes,ce as combineSinks,We as composeIdentityResolvers,d as composeWorker,me as consoleSink,C as createCrossShardRelationCapabilities,T as createDynamicShardRegistry,F as createKvCursorStore,l as createLunoraHandler,M as createMemoryCursorStore,de as createPipelineLogReader,ue as createQueryCoordinator,Pe as createRestRateLimit,Ge as createShardClient,_e as createStaticShardRegistry,u as createWorker,j as d1Probe,t as declareAppJurisdiction,Ie as decorateResponse,N as defineExportSink,_ as defineRpcEnvelope,V as durableObjectProbe,oe as emitLogEvent,te as emitRpcEvent,De as enforceOrigin,se as enrichSink,ie as filterSink,Fe as handleCorsPreflight,c as isBackupManifestEntry,m as isBackupManifestKey,Be as loadStudioDocument,$ as memoizeIdentity,ee as memoizeIdentityPerRequest,f as normalizeBackupPrefix,fe as otlpSink,H as parseStackFrames,xe as pipelineLogSink,W as presenceProbe,G as r2Sink,Ae as requestCarriesCredentials,Q as resolveLogArchiveFromEnv,k as resolveLunoraOptions,Me as resolveSecurity,ye as resolveShard,Le as restCacheHeaders,ge as restSurfaceFromRegistry,qe as routeIdentityResolvers,K as runExportTap,U as sanitizeChange,E as toAirbyteMessages,P as toError,I as toErrorResponse,R as toFivetranResponse,w as webhookExportSink,Ee as webhookSink,b as withFrameworkWorker};
1
+ import{declareAppJurisdiction as t}from"./packem_shared/declareAppJurisdiction-DEba2p42.mjs";import{BACKUP_KEY_PREFIX as s,backupManifestKey as i,backupObjectKey as p,backupObjectKeyOfManifest as n,isBackupManifestEntry as c,isBackupManifestKey as m,normalizeBackupPrefix as f}from"./packem_shared/BACKUP_KEY_PREFIX-BOtSu-_3.mjs";import{toAirbyteMessages as E,toFivetranResponse as R}from"./packem_shared/toAirbyteMessages-BVogmTPJ.mjs";import{composeWorker as d,createLunoraHandler as l,createWorker as u,defineRpcEnvelope as _,resolveLunoraOptions as k,withFrameworkWorker as b}from"./packem_shared/composeWorker-C7SAGqH1.mjs";import{createCrossShardRelationCapabilities as C}from"./packem_shared/createCrossShardRelationCapabilities-BBUXTMhk.mjs";import{DEFAULT_REGISTRY_CACHE_TTL_MS as A,SHARD_REGISTRY_DO_NAME as L,createDynamicShardRegistry as T}from"./packem_shared/DEFAULT_REGISTRY_CACHE_TTL_MS-w_RLPiwj.mjs";import{parseStackFrames as H,toError as P}from"./packem_shared/parseStackFrames-CZddjveh.mjs";import{LunoraError as v,toErrorResponse as I}from"./packem_shared/LunoraError-PkZWF-_g.mjs";import{c as F,a as M,d as N,r as G,b as K,s as U,w}from"./packem_shared/export-tap-CMyD7rin.mjs";import{HEALTH_PATH as Y,HEALTH_READY_PATH as z,buildHealthRoutes as X,d1Probe as j,durableObjectProbe as V,presenceProbe as W}from"./packem_shared/HEALTH_PATH-B8ndDG3s.mjs";import{LOG_ARCHIVE_PATH as J,resolveLogArchiveFromEnv as Q}from"./packem_shared/LOG_ARCHIVE_PATH-dTuCzfyj.mjs";import{m as $,a as ee}from"./packem_shared/memoize-identity-Cbr1Sdt3.mjs";import{e as oe,a as te}from"./packem_shared/observability-9slk__Gi.mjs";import{enrichSink as se,filterSink as ie}from"./packem_shared/enrichSink-8_qnPWNH.mjs";import{a as ne,c as ce,b as me,o as fe,p as xe,w as Ee}from"./packem_shared/observability-sinks-BA76CH4h.mjs";import{D as Se,c as de}from"./packem_shared/pipeline-log-reader-C-nuWG_e.mjs";import{createQueryCoordinator as ue,createStaticShardRegistry as _e}from"./packem_shared/createQueryCoordinator-DIrlAqnz.mjs";import{applyJurisdiction as be,resolveShard as ye}from"./packem_shared/applyJurisdiction-DKQE8kOA.mjs";import{a as Oe,r as Ae,b as Le}from"./packem_shared/rest-cache-q5V06Etw.mjs";import{a as he,b as He,c as Pe,r as ge}from"./packem_shared/rest-routes-D5NWHmVl.mjs";import{d as Ie,e as De,h as Fe,r as Me}from"./packem_shared/security-headers-0DqdJ04h.mjs";import{createShardClient as Ge}from"./packem_shared/createShardClient-M_c0MHVS.mjs";import{STORAGE_UPLOAD_MAX_BODY_BYTES as Ue}from"./packem_shared/STORAGE_UPLOAD_MAX_BODY_BYTES-Onz8HkiB.mjs";import{loadStudioDocument as Be}from"./packem_shared/loadStudioDocument-BSYQEMnd.mjs";import{LOG_ARCHIVE_NOT_CONFIGURED as ze}from"./packem_shared/LOG_ARCHIVE_NOT_CONFIGURED-CDpi4yFD.mjs";import{NOOP_EXECUTION_CONTEXT as je}from"./packem_shared/NOOP_EXECUTION_CONTEXT-YmXqH-jH.mjs";import{composeIdentityResolvers as We,routeIdentityResolvers as qe}from"./packem_shared/composeIdentityResolvers-CpdHuDyk.mjs";const e="0.0.0";export{s as BACKUP_KEY_PREFIX,Se as DEFAULT_LOG_COLUMNS,A as DEFAULT_REGISTRY_CACHE_TTL_MS,Y as HEALTH_PATH,z as HEALTH_READY_PATH,ze as LOG_ARCHIVE_NOT_CONFIGURED,J as LOG_ARCHIVE_PATH,v as LunoraError,je as NOOP_EXECUTION_CONTEXT,L as SHARD_REGISTRY_DO_NAME,Ue as STORAGE_UPLOAD_MAX_BODY_BYTES,e as VERSION,ne as analyticsEngineSink,be as applyJurisdiction,Oe as applyRestCache,he as argsFromQuery,i as backupManifestKey,p as backupObjectKey,n as backupObjectKeyOfManifest,X as buildHealthRoutes,He as buildRestRoutes,ce as combineSinks,We as composeIdentityResolvers,d as composeWorker,me as consoleSink,C as createCrossShardRelationCapabilities,T as createDynamicShardRegistry,F as createKvCursorStore,l as createLunoraHandler,M as createMemoryCursorStore,de as createPipelineLogReader,ue as createQueryCoordinator,Pe as createRestRateLimit,Ge as createShardClient,_e as createStaticShardRegistry,u as createWorker,j as d1Probe,t as declareAppJurisdiction,Ie as decorateResponse,N as defineExportSink,_ as defineRpcEnvelope,V as durableObjectProbe,oe as emitLogEvent,te as emitRpcEvent,De as enforceOrigin,se as enrichSink,ie as filterSink,Fe as handleCorsPreflight,c as isBackupManifestEntry,m as isBackupManifestKey,Be as loadStudioDocument,$ as memoizeIdentity,ee as memoizeIdentityPerRequest,f as normalizeBackupPrefix,fe as otlpSink,H as parseStackFrames,xe as pipelineLogSink,W as presenceProbe,G as r2Sink,Ae as requestCarriesCredentials,Q as resolveLogArchiveFromEnv,k as resolveLunoraOptions,Me as resolveSecurity,ye as resolveShard,Le as restCacheHeaders,ge as restSurfaceFromRegistry,qe as routeIdentityResolvers,K as runExportTap,U as sanitizeChange,E as toAirbyteMessages,P as toError,I as toErrorResponse,R as toFivetranResponse,w as webhookExportSink,Ee as webhookSink,b as withFrameworkWorker};
@@ -1 +1 @@
1
- const s=t=>{let n="";for(let a=0;a<t.length;a+=32768)n+=String.fromCharCode(...t.subarray(a,a+32768));return btoa(n)},l=t=>{const n=atob(t),r=new Uint8Array(n.length);for(let a=0;a<n.length;a+=1)r[a]=n.codePointAt(a)??0;return r},o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",h=t=>{let n="",r=0;const a=t.length-2;for(;r<a;r+=3){const e=t[r]<<16|t[r+1]<<8|t[r+2];n+=o.charAt(e>>18&63)+o.charAt(e>>12&63)+o.charAt(e>>6&63)+o.charAt(e&63)}const c=t.length-r;if(c===1){const e=t[r]<<16;n+=o.charAt(e>>18&63)+o.charAt(e>>12&63)}else if(c===2){const e=t[r]<<16|t[r+1]<<8;n+=o.charAt(e>>18&63)+o.charAt(e>>12&63)+o.charAt(e>>6&63)}return n},i=t=>{const n=t.replaceAll("-","+").replaceAll("_","/"),r=n+"=".repeat((4-n.length%4)%4);return l(r)};export{s as a,l as b,i as f,h as t};
1
+ const s=t=>{let n="";for(let a=0;a<t.length;a+=32768)n+=String.fromCharCode(...t.subarray(a,a+32768));return btoa(n)},l=t=>{const n=atob(t),r=new Uint8Array(n.length);for(let a=0;a<n.length;a+=1)r[a]=n.codePointAt(a)??0;return r},o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",h=t=>{let n="",r=0;const a=t.length-2;for(;r<a;r+=3){const e=t[r]<<16|t[r+1]<<8|t[r+2];n+=o.charAt(e>>18&63)+o.charAt(e>>12&63)+o.charAt(e>>6&63)+o.charAt(e&63)}const c=t.length-r;if(c===1){const e=t[r]<<16;n+=o.charAt(e>>18&63)+o.charAt(e>>12&63)}else if(c===2){const e=t[r]<<16|t[r+1]<<8;n+=o.charAt(e>>18&63)+o.charAt(e>>12&63)+o.charAt(e>>6&63)}return n},i=t=>{const n=t.replaceAll("-","+").replaceAll("_","/"),r=n+"=".repeat((4-n.length%4)%4);return l(r)};export{l as a,s as b,i as f,h as t};