@tinycloud/sdk-services 3.2.0-beta.3 → 3.2.0-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/{BaseService-BDQXjWMx.d.cts → BaseService-4wwJq1Gn.d.cts} +1 -1
  2. package/dist/{BaseService-Di_hVfUV.d.ts → BaseService-BGr2slUz.d.ts} +1 -1
  3. package/dist/encryption/index.cjs +5 -1
  4. package/dist/encryption/index.cjs.map +1 -1
  5. package/dist/encryption/index.d.cts +2 -2
  6. package/dist/encryption/index.d.ts +2 -2
  7. package/dist/encryption/index.js +5 -1
  8. package/dist/encryption/index.js.map +1 -1
  9. package/dist/index.cjs +190 -11
  10. package/dist/index.cjs.map +1 -1
  11. package/dist/index.d.cts +157 -6
  12. package/dist/index.d.ts +157 -6
  13. package/dist/index.js +184 -11
  14. package/dist/index.js.map +1 -1
  15. package/dist/internal/decrypt-transport-response-error.d.cts +1 -1
  16. package/dist/internal/decrypt-transport-response-error.d.ts +1 -1
  17. package/dist/kv/index.cjs +56 -11
  18. package/dist/kv/index.cjs.map +1 -1
  19. package/dist/kv/index.d.cts +5 -4
  20. package/dist/kv/index.d.ts +5 -4
  21. package/dist/kv/index.js +56 -11
  22. package/dist/kv/index.js.map +1 -1
  23. package/dist/kv/replication/index.cjs +44 -19
  24. package/dist/kv/replication/index.cjs.map +1 -1
  25. package/dist/kv/replication/index.d.cts +4 -3
  26. package/dist/kv/replication/index.d.ts +4 -3
  27. package/dist/kv/replication/index.js +44 -19
  28. package/dist/kv/replication/index.js.map +1 -1
  29. package/dist/kv/replication/prefix.cjs +43 -0
  30. package/dist/kv/replication/prefix.cjs.map +1 -0
  31. package/dist/kv/replication/prefix.d.cts +6 -0
  32. package/dist/kv/replication/prefix.d.ts +6 -0
  33. package/dist/kv/replication/prefix.js +17 -0
  34. package/dist/kv/replication/prefix.js.map +1 -0
  35. package/dist/{scope-BmLxwyl-.d.ts → scope-CoKKmMiI.d.ts} +5 -5
  36. package/dist/{scope-D855kRDx.d.cts → scope-D7wmjbMH.d.cts} +5 -5
  37. package/dist/sql/index.cjs +44 -2
  38. package/dist/sql/index.cjs.map +1 -1
  39. package/dist/sql/index.d.cts +2 -2
  40. package/dist/sql/index.d.ts +2 -2
  41. package/dist/sql/index.js +44 -2
  42. package/dist/sql/index.js.map +1 -1
  43. package/dist/{types-7A5rHWRY.d.cts → types-D-9A3Sut.d.cts} +6 -0
  44. package/dist/{types-7A5rHWRY.d.ts → types-D-9A3Sut.d.ts} +6 -0
  45. package/package.json +14 -1
package/dist/index.d.cts CHANGED
@@ -1,15 +1,16 @@
1
- import { a as IServiceContext, c as InvokeFunction, d as InvokeAnyFunction, F as FetchFunction, S as ServiceSession, e as RetryPolicy, T as TelemetryConfig, I as IService, E as EventHandler, b as ServiceError, R as Result, P as PermissionHint, f as StorageQuotaInfo } from './types-7A5rHWRY.cjs';
2
- export { g as ErrorCode, h as ErrorCodes, i as FetchRequestInit, j as FetchResponse, k as InvocationFact, l as InvocationFacts, m as InvokeAnyEntry, n as ServiceErrorEvent, o as ServiceHeaders, p as ServiceRequestEvent, q as ServiceResponseEvent, r as ServiceRetryEvent, s as TelemetryEventHandler, t as TelemetryEvents, u as TelemetrySpanEvent, v as defaultRetryPolicy, w as err, x as ok, y as serviceError } from './types-7A5rHWRY.cjs';
1
+ import { a as IServiceContext, c as InvokeFunction, d as InvokeAnyFunction, F as FetchFunction, S as ServiceSession, e as RetryPolicy, T as TelemetryConfig, I as IService, E as EventHandler, b as ServiceError, R as Result, P as PermissionHint, f as StorageQuotaInfo } from './types-D-9A3Sut.cjs';
2
+ export { g as ErrorCode, h as ErrorCodes, i as FetchRequestInit, j as FetchResponse, k as InvocationFact, l as InvocationFacts, m as InvokeAnyEntry, n as ServiceErrorEvent, o as ServiceHeaders, p as ServiceRequestEvent, q as ServiceResponseEvent, r as ServiceRetryEvent, s as TelemetryEventHandler, t as TelemetryEvents, u as TelemetrySpanEvent, v as defaultRetryPolicy, w as err, x as ok, y as serviceError } from './types-D-9A3Sut.cjs';
3
3
  import { z } from 'zod';
4
- import { B as BaseService } from './BaseService-BDQXjWMx.cjs';
5
- export { a as BaseServiceOptions, R as RequestSignal, S as ServiceConstructor, b as ServiceRegistration } from './BaseService-BDQXjWMx.cjs';
4
+ import { B as BaseService } from './BaseService-4wwJq1Gn.cjs';
5
+ export { a as BaseServiceOptions, R as RequestSignal, S as ServiceConstructor, b as ServiceRegistration } from './BaseService-4wwJq1Gn.cjs';
6
6
  import { IKVService } from './kv/index.cjs';
7
7
  export { IPrefixedKVService, KVService, PrefixedKVService } from './kv/index.cjs';
8
- export { A as AuthorityRefusal, C as CLEAR_PENDING_WARNING, I as DEFAULT_SIGNED_READ_URL_EXPIRY_MS, J as KVAction, M as KVActionType, N as KVBatchPutItem, O as KVBatchPutOptions, Q as KVBatchPutResponse, S as KVBatchReadResponse, T as KVChange, U as KVChangesAuthority, V as KVChangesOptions, W as KVChangesResponse, X as KVCreateSignedReadUrlOptions, Y as KVDeleteOptions, Z as KVGetOptions, _ as KVHeadOptions, $ as KVListOptions, b as KVListPage, a0 as KVListResponse, a1 as KVPutOptions, c as KVReadThrough, d as KVReplicaHandle, e as KVReplicaSpec, f as KVReplicaStorage, a as KVReplicationController, K as KVReplicationDeps, a2 as KVResponse, a3 as KVResponseHeaders, a4 as KVServiceConfig, a5 as KVSignedReadUrlResponse, L as LocalGetResult, g as LocalListResult, h as LocalReadMeta, i as LocalReplicaStatus, j as LocalSyncResult, k as PendingWriteRecord, l as PendingWriteState, P as PendingWriteStore, m as PinnedKey, n as PurgeTarget, o as ReplicaAuthorityState, p as ReplicaCoverage, q as ReplicaDevice, r as ReplicaGrantInfo, s as ReplicaState, t as ReplicaStatusEntry, u as ReplicationAuthority, v as ReplicationControl, w as ReplicationEvent, R as ReplicationIdentity, x as ReplicationOptions, y as ReplicationPurgeReport, z as ReplicationReason, B as ReplicationScheduler, D as ResolvedReplicationOptions, E as canonicalReplicationIdentity, F as kvPrefixCovers, G as replicationIdentityKey, H as requiresSecretsOptIn } from './scope-D855kRDx.cjs';
8
+ export { A as AuthorityRefusal, C as CLEAR_PENDING_WARNING, H as DEFAULT_SIGNED_READ_URL_EXPIRY_MS, I as KVAction, J as KVActionType, M as KVBatchPutItem, N as KVBatchPutOptions, O as KVBatchPutResponse, Q as KVBatchReadResponse, S as KVChange, T as KVChangesAuthority, U as KVChangesOptions, V as KVChangesResponse, W as KVCreateSignedReadUrlOptions, X as KVDeleteOptions, Y as KVGetOptions, Z as KVHeadOptions, _ as KVListOptions, b as KVListPage, $ as KVListResponse, a0 as KVPutOptions, c as KVReadThrough, d as KVReplicaHandle, e as KVReplicaSpec, f as KVReplicaStorage, a as KVReplicationController, K as KVReplicationDeps, a1 as KVResponse, a2 as KVResponseHeaders, a3 as KVServiceConfig, a4 as KVSignedReadUrlResponse, L as LocalGetResult, g as LocalListResult, h as LocalReadMeta, i as LocalReplicaStatus, j as LocalSyncResult, k as PendingWriteRecord, l as PendingWriteState, P as PendingWriteStore, m as PinnedKey, n as PurgeTarget, o as ReplicaAuthorityState, p as ReplicaCoverage, q as ReplicaDevice, r as ReplicaGrantInfo, s as ReplicaState, t as ReplicaStatusEntry, u as ReplicationAuthority, v as ReplicationControl, w as ReplicationEvent, R as ReplicationIdentity, x as ReplicationOptions, y as ReplicationPurgeReport, z as ReplicationReason, B as ReplicationScheduler, D as ResolvedReplicationOptions, E as canonicalReplicationIdentity, F as replicationIdentityKey, G as requiresSecretsOptIn } from './scope-D7wmjbMH.cjs';
9
9
  export { BatchOptions, BatchResponse, DatabaseHandle, ExecuteOptions, ExecuteResponse, IDatabaseHandle, ISQLMigrations, ISQLService, QueryOptions, QueryResponse, SQLAction, SQLActionType, SQLMigrations, SQLService, SQLServiceConfig, SqlMigration, SqlMigrationApplyOptions, SqlMigrationApplyResponse, SqlStatement, SqlValue } from './sql/index.cjs';
10
10
  import { IEncryptionService, DecryptCapabilityProof } from './encryption/index.cjs';
11
11
  export { BuildCanonicalDecryptRequestInput, BuildDecryptFactsInput, BuildDecryptInvocationInput, BuiltDecryptInvocation, CanonicalDecryptRequest, CanonicalJson, DECRYPT_ACTION, DECRYPT_FACT_TYPE, DECRYPT_RESULT_TYPE, DEFAULT_ENCRYPTION_ALG, DEFAULT_KEY_VERSION, DecryptEnvelopeOptions, DecryptInvocationFact, DecryptInvocationSigner, DecryptRequestBody, DecryptResponseBody, DecryptTransport, DiscoverNetworkInput, DiscoveredNetwork, DiscoverySource, ENCRYPTION_NETWORK_URN_PREFIX, ENCRYPTION_SERVICE, ENCRYPTION_SERVICE_SHORT, ENVELOPE_VERSION, EncryptToNetworkInput, EncryptToNetworkOptions, EncryptToNetworkResult, EncryptionCrypto, EncryptionError, EncryptionErrorInput, EncryptionService, EncryptionServiceConfig, InlineEncryptedEnvelope, Json, NETWORK_NAME_PATTERN, NetworkDescriptor, NetworkIdError, NodeDescriptorFetcher, ParsedNetworkId, RandomReceiverKeyInput, ReceiverKeyPair, ReceiverKeySigner, SignedReceiverKeyInput, VerifyDecryptResponseInput, WellKnownDescriptorFetcher, base64Decode, base64Encode, buildCanonicalDecryptRequest, buildDecryptAttenuation, buildDecryptFacts, buildDecryptInvocation, buildNetworkId, canonicalHashHex, canonicalSignedResponse, canonicalize as canonicalizeEncryptionJson, checkDecryptInvocationInput, decryptEnvelopeWithKey, deriveSignedReceiverKey, discoverNetwork, encryptToNetwork, encryptionError, ensureNetworkUsableForDecrypt, generateRandomReceiverKey, hexDecode, hexEncode, isNetworkId, networkDiscoveryKey, openWrappedKey, parseNetworkId, utf8Decode, utf8Encode, validateEnvelope, verifyDecryptResponse } from './encryption/index.cjs';
12
12
  export { DecryptTransportResponseError } from '@tinycloud/sdk-services/internal/decrypt-transport-response-error';
13
+ export { kvPrefixCovers } from './kv/replication/prefix.cjs';
13
14
 
14
15
  type TinyCloudDebugLevel = "debug";
15
16
  interface TinyCloudDebugEvent {
@@ -1141,11 +1142,37 @@ declare function parseStorageQuotaBytes(responseText: string): {
1141
1142
  usedBytes: number;
1142
1143
  limitBytes: number;
1143
1144
  } | undefined;
1145
+ /**
1146
+ * Account-wide storage totals the node attaches to a storage rejection when
1147
+ * billing supplied them. `limitBytes` is the plan budget shared by all the
1148
+ * owner's spaces, so this is the number to show the user, not the space's.
1149
+ */
1150
+ interface StorageAccountUsage {
1151
+ usedBytes: number;
1152
+ limitBytes: number;
1153
+ /** Plan tier id, e.g. `free` or `paid`. */
1154
+ plan?: string;
1155
+ }
1156
+ /** What a node storage rejection says about the space and the account. */
1157
+ interface StorageRejectionDetails {
1158
+ usedBytes?: number;
1159
+ limitBytes?: number;
1160
+ account?: StorageAccountUsage;
1161
+ }
1162
+ /**
1163
+ * Parse a node storage rejection. The node sends a JSON body
1164
+ * (`{error, message, space: {usedBytes, limitBytes}, account?: {usedBytes,
1165
+ * limitBytes, plan}}`); older nodes send only the plain-text message. Returns
1166
+ * undefined when the body is neither, e.g. a proxy's own 413 page.
1167
+ */
1168
+ declare function parseStorageRejection(responseText: string): StorageRejectionDetails | undefined;
1144
1169
  /**
1145
1170
  * Build the error for a write the node rejected for storage: 402 when storage
1146
1171
  * is already full, 413 when this write is larger than what is left. KV, SQL
1147
1172
  * and DuckDB all report it with the same codes and message so an app can
1148
1173
  * detect "storage full" in one place with {@link isStorageFullError}.
1174
+ * `meta.usedBytes`/`meta.limitBytes` describe the space; `meta.account`
1175
+ * carries the account totals when the node sent them.
1149
1176
  */
1150
1177
  declare function storageRejectionError(service: string, status: 402 | 413, meta: Record<string, unknown>, responseText: string): ServiceError;
1151
1178
  /**
@@ -1651,10 +1678,129 @@ declare class HooksService extends BaseService implements IHooksService {
1651
1678
  private createInvokeHeaders;
1652
1679
  }
1653
1680
 
1681
+ /**
1682
+ * The single `storage.full` event: the first write any service saw rejected
1683
+ * because the owner's TinyCloud storage is full. Reads keep working, so an app
1684
+ * shows a read-only banner from this one listener instead of handling the
1685
+ * error at every write site.
1686
+ */
1687
+ interface StorageFullEvent {
1688
+ /** Service that saw the rejection, e.g. `kv` or `sql`. */
1689
+ service: string;
1690
+ /** The rejection: `STORAGE_QUOTA_EXCEEDED` or `STORAGE_LIMIT_REACHED`. */
1691
+ error: ServiceError;
1692
+ /** Bytes used by the rejected space, when the node sent them. */
1693
+ usedBytes?: number;
1694
+ /** The space's share of the account budget, when the node sent it. */
1695
+ limitBytes?: number;
1696
+ /** Account-wide totals, when the node had them from billing. */
1697
+ account?: StorageAccountUsage;
1698
+ /**
1699
+ * Space the rejected write targeted, when the service context knew it.
1700
+ * Storage is one budget per owner, so this says whose storage is full.
1701
+ */
1702
+ spaceId?: string;
1703
+ }
1704
+ type StorageFullHandler = (event: StorageFullEvent) => void;
1705
+ /**
1706
+ * Turns the storage rejections seen by any number of service contexts into
1707
+ * one `storage.full` event, and remembers whose storage is full so read paths
1708
+ * can skip their best-effort writes.
1709
+ *
1710
+ * Storage is one budget per owner, so fullness is recorded per owner, apart
1711
+ * from the event: a rejection on one owner's space never hides a later
1712
+ * rejection on another's. The event fires once per episode, which lasts until
1713
+ * no owner is known to be full.
1714
+ *
1715
+ * The event goes through the rejecting context's `emit` (so telemetry and the
1716
+ * debug log see it) and then to the handlers registered with {@link on}.
1717
+ */
1718
+ declare class StorageFullMonitor {
1719
+ private readonly ownerOf;
1720
+ /** The emitted event, until the episode ends. */
1721
+ private event;
1722
+ /** First rejection per owner key; {@link UNKNOWN_OWNER} when the space was unknown. */
1723
+ private readonly full;
1724
+ private readonly handlers;
1725
+ /**
1726
+ * @param ownerOf Owner key of a space id. Spaces with one key share one
1727
+ * storage budget. Defaults to the space id itself.
1728
+ */
1729
+ constructor(ownerOf?: (spaceId: string) => string);
1730
+ /** True while any owner's storage is known to be full. */
1731
+ get isFull(): boolean;
1732
+ /** The rejection `storage.full` announced, until the episode ends. */
1733
+ get rejection(): StorageFullEvent | undefined;
1734
+ /**
1735
+ * True when a write to `spaceId`'s owner was rejected, or a write whose
1736
+ * space was unknown was: that one could have been any owner's.
1737
+ */
1738
+ isFullFor(spaceId: string | undefined): boolean;
1739
+ /** Watch a context's service errors. Returns the unsubscribe function. */
1740
+ observe(context: IServiceContext): () => void;
1741
+ /** Subscribe to the `storage.full` event. Returns the unsubscribe function. */
1742
+ on(handler: StorageFullHandler): () => void;
1743
+ /** Forget that any owner's storage is full; the next rejection emits `storage.full` again. */
1744
+ clear(): void;
1745
+ /**
1746
+ * Forget that `spaceId`'s owner is full (`undefined`: the rejections whose
1747
+ * space was unknown). Once no owner is full, the next rejection emits
1748
+ * `storage.full` again.
1749
+ */
1750
+ clearFor(spaceId: string | undefined): void;
1751
+ }
1752
+
1753
+ /** Where the owner frees up space or upgrades their plan. */
1754
+ declare const STORAGE_MANAGE_URL = "https://account.tinycloud.xyz/billing";
1755
+ /** Storage counts as nearly full from this share of the limit. */
1756
+ declare const STORAGE_NEARLY_FULL_RATIO = 0.9;
1757
+ type StorageUsageState = "ok" | "nearly_full" | "full";
1758
+ /** Byte counts as the node's usage read reports them; `null` limit means unlimited. */
1759
+ interface StorageUsage {
1760
+ usedBytes: number;
1761
+ limitBytes: number | null;
1762
+ }
1763
+ /**
1764
+ * The owner's TinyCloud storage, as `tc.storage.status()` reports it.
1765
+ * `usedBytes`/`limitBytes` describe the space that was asked about; its limit
1766
+ * is that space's share of the account budget.
1767
+ */
1768
+ interface StorageStatus extends StorageUsage {
1769
+ /** Account-wide totals; storage is one budget shared by all the owner's spaces. */
1770
+ account?: StorageUsage & {
1771
+ plan?: string;
1772
+ };
1773
+ /** Plan tier id, e.g. `free` or `paid`, when known. */
1774
+ plan?: string;
1775
+ /** From the account totals when known, else from the space. */
1776
+ state: StorageUsageState;
1777
+ /** Where to free up space or upgrade. */
1778
+ manageUrl: string;
1779
+ }
1780
+ interface StorageStatusOptions {
1781
+ /** Space name (e.g. `secrets`) or full space id. Defaults to the session's primary space. */
1782
+ space?: string;
1783
+ }
1784
+ /** `tc.storage.status()`: reads the owner's usage and plan from the node. */
1785
+ interface IStorageService {
1786
+ status(options?: StorageStatusOptions): Promise<Result<StorageStatus>>;
1787
+ }
1788
+ /** `full` at or over the limit, `nearly_full` from 90% of it; never full without a limit. */
1789
+ declare function storageUsageState(usedBytes: number, limitBytes: number | null): StorageUsageState;
1790
+ /**
1791
+ * Parse the node's usage read (`tinycloud.space/info`):
1792
+ * `{space: {usedBytes, limitBytes}, account?: {usedBytes, limitBytes, plan?}, manageUrl}`.
1793
+ * Returns undefined when the body lacks the space numbers, e.g. a node that
1794
+ * predates the usage read.
1795
+ */
1796
+ declare function parseStorageStatus(body: unknown): StorageStatus | undefined;
1797
+
1798
+ /** @deprecated Use `tc.on("storage.full", handler)` instead. Nothing in the SDK calls `onUpgradeRequired`. */
1654
1799
  interface QuotaConfig {
1655
1800
  /** Called when a storage quota error is detected (402/413) */
1656
1801
  onUpgradeRequired?: (info: StorageQuotaInfo) => void;
1657
1802
  }
1803
+ /** @deprecated Use `StorageStatus` from `tc.storage.status()`. */
1658
1804
  interface QuotaStatus {
1659
1805
  /** Storage limit in bytes for this space */
1660
1806
  limitBytes: number;
@@ -1663,6 +1809,11 @@ interface QuotaStatus {
1663
1809
  /** Remaining storage in bytes */
1664
1810
  remainingBytes?: number;
1665
1811
  }
1812
+ /**
1813
+ * @deprecated Use `tc.storage.status()` for usage and `tc.on("storage.full", handler)`
1814
+ * for rejections. This class reads billing's unauthenticated quota endpoint
1815
+ * and is not wired into the SDK; it will be removed in a future major release.
1816
+ */
1666
1817
  declare class TinyCloudQuota {
1667
1818
  private config;
1668
1819
  private quotaUrl;
@@ -2430,4 +2581,4 @@ declare class SecretsService implements ISecretsService {
2430
2581
  listAll(): Promise<Result<SecretCatalogEntry[], SecretsError>>;
2431
2582
  }
2432
2583
 
2433
- export { type AuthorizationVerdict, BaseService, type ColumnInfo, type DataVaultConfig, DataVaultService, DecryptCapabilityProof, DuckDbAction, type DuckDbActionType, type DuckDbBatchOptions, type BatchResponse as DuckDbBatchResponse, DuckDbDatabaseHandle, type DuckDbExecuteOptions, type ExecuteResponse as DuckDbExecuteResponse, type DuckDbOptions, type DuckDbQueryOptions, type QueryResponse as DuckDbQueryResponse, DuckDbService, type DuckDbServiceConfig, type DuckDbStatement, type DuckDbValue, EventHandler, FetchFunction, GenericKVResponseSchema, type GenericKVResponseType, GenericResultSchema, type HookEvent, type HookServiceName, type HookStreamEvent, type HookStreamRetryConfig, type HookSubscription, type HookWebhookListOptions, type HookWebhookRecord, type HookWebhookRegistration, type HookWebhookScope, type HookWebhookUnregisterOptions, HooksService, type HooksServiceConfig, type IDataVaultService, type IDuckDbDatabaseHandle, type IDuckDbService, IEncryptionService, type IHooksService, IKVService, type ISecretsService, IService, IServiceContext, InvokeAnyFunction, InvokeFunction, KVListResponseSchema, type KVListResponseType, KVListResultSchema, type KVListResultType, KVResponseHeadersSchema, type KVResponseHeadersType, MAX_SECRET_SCOPE_LENGTH, type ParsedSecretCatalogKey, PermissionHint, type QuotaConfig, type QuotaStatus, type ResolvedSecretPath, Result, RetryPolicy, RetryPolicySchema, type RetryPolicyType, SECRET_NAME_RE, SECRET_SCOPE_RE, STORAGE_FULL_MESSAGE, STORAGE_WRITE_TOO_LARGE_MESSAGE, type SchemaInfo, type SecretCatalogEntry, type SecretPayload, type SecretPutOptions, type SecretScopeOptions, type SecretsError, SecretsService, ServiceContext, type ServiceContextConfig, ServiceError, ServiceErrorEventSchema, type ServiceErrorEventType, ServiceErrorSchema, type ServiceErrorType, ServiceRequestEventSchema, type ServiceRequestEventType, ServiceResponseEventSchema, type ServiceResponseEventType, ServiceRetryEventSchema, type ServiceRetryEventType, ServiceSession, ServiceSessionSchema, type ServiceSessionType, StorageQuotaInfo, type SubscribeOptions, TC832_RESERVED_SCOPES, type TableInfo, TelemetryConfig, TelemetrySpanEventSchema, type TelemetrySpanEventType, type TinyCloudDebugEnableOptions, type TinyCloudDebugEvent, type TinyCloudDebugLevel, TinyCloudDebugLogger, type TinyCloudDebugTimer, TinyCloudQuota, type ValidationError, type VaultCrypto, type VaultEntry, type VaultError, type VaultGetOptions, type VaultGrantOptions, VaultHeaders, type VaultListOptions, type VaultListPage, type VaultNetworkReadResult, VaultPublicSpaceKVActions, type VaultPutOptions, type ViewInfo, type WasmVaultFunctions, abortedError, appSecretScope, authExpiredError, authRequiredError, authUnauthorizedError, authorizationVerdictOf, canonicalizeSecretScope, clearTinyCloudDebugLogs, createKVResponseSchema, createResultSchema, createVaultCrypto, disableTinyCloudDebug, enableTinyCloudDebug, errorResult, getTinyCloudDebugLogs, installTinyCloudDebugGlobals, isStorageFullError, networkError, notFoundError, parseAuthError, parseCapabilityResource, parsePermissionHint, parsePermissionHintFromErrorText, parseSecretCatalogKey, parseStorageQuotaBytes, permissionDeniedError, resolveSecretListPrefix, resolveSecretPath, storageLimitReachedError, storageQuotaExceededError, storageRejectionError, timeoutError, tinyCloudDebugLogger, validateKVListResponse, validateKVResponseHeaders, validateRetryPolicy, validateServiceError, validateServiceRequestEvent, validateServiceResponseEvent, validateServiceSession, validateTelemetrySpanEvent, validatedCapabilityOf, wrapError };
2584
+ export { type AuthorizationVerdict, BaseService, type ColumnInfo, type DataVaultConfig, DataVaultService, DecryptCapabilityProof, DuckDbAction, type DuckDbActionType, type DuckDbBatchOptions, type BatchResponse as DuckDbBatchResponse, DuckDbDatabaseHandle, type DuckDbExecuteOptions, type ExecuteResponse as DuckDbExecuteResponse, type DuckDbOptions, type DuckDbQueryOptions, type QueryResponse as DuckDbQueryResponse, DuckDbService, type DuckDbServiceConfig, type DuckDbStatement, type DuckDbValue, EventHandler, FetchFunction, GenericKVResponseSchema, type GenericKVResponseType, GenericResultSchema, type HookEvent, type HookServiceName, type HookStreamEvent, type HookStreamRetryConfig, type HookSubscription, type HookWebhookListOptions, type HookWebhookRecord, type HookWebhookRegistration, type HookWebhookScope, type HookWebhookUnregisterOptions, HooksService, type HooksServiceConfig, type IDataVaultService, type IDuckDbDatabaseHandle, type IDuckDbService, IEncryptionService, type IHooksService, IKVService, type ISecretsService, IService, IServiceContext, type IStorageService, InvokeAnyFunction, InvokeFunction, KVListResponseSchema, type KVListResponseType, KVListResultSchema, type KVListResultType, KVResponseHeadersSchema, type KVResponseHeadersType, MAX_SECRET_SCOPE_LENGTH, type ParsedSecretCatalogKey, PermissionHint, type QuotaConfig, type QuotaStatus, type ResolvedSecretPath, Result, RetryPolicy, RetryPolicySchema, type RetryPolicyType, SECRET_NAME_RE, SECRET_SCOPE_RE, STORAGE_FULL_MESSAGE, STORAGE_MANAGE_URL, STORAGE_NEARLY_FULL_RATIO, STORAGE_WRITE_TOO_LARGE_MESSAGE, type SchemaInfo, type SecretCatalogEntry, type SecretPayload, type SecretPutOptions, type SecretScopeOptions, type SecretsError, SecretsService, ServiceContext, type ServiceContextConfig, ServiceError, ServiceErrorEventSchema, type ServiceErrorEventType, ServiceErrorSchema, type ServiceErrorType, ServiceRequestEventSchema, type ServiceRequestEventType, ServiceResponseEventSchema, type ServiceResponseEventType, ServiceRetryEventSchema, type ServiceRetryEventType, ServiceSession, ServiceSessionSchema, type ServiceSessionType, type StorageAccountUsage, type StorageFullEvent, type StorageFullHandler, StorageFullMonitor, StorageQuotaInfo, type StorageRejectionDetails, type StorageStatus, type StorageStatusOptions, type StorageUsage, type StorageUsageState, type SubscribeOptions, TC832_RESERVED_SCOPES, type TableInfo, TelemetryConfig, TelemetrySpanEventSchema, type TelemetrySpanEventType, type TinyCloudDebugEnableOptions, type TinyCloudDebugEvent, type TinyCloudDebugLevel, TinyCloudDebugLogger, type TinyCloudDebugTimer, TinyCloudQuota, type ValidationError, type VaultCrypto, type VaultEntry, type VaultError, type VaultGetOptions, type VaultGrantOptions, VaultHeaders, type VaultListOptions, type VaultListPage, type VaultNetworkReadResult, VaultPublicSpaceKVActions, type VaultPutOptions, type ViewInfo, type WasmVaultFunctions, abortedError, appSecretScope, authExpiredError, authRequiredError, authUnauthorizedError, authorizationVerdictOf, canonicalizeSecretScope, clearTinyCloudDebugLogs, createKVResponseSchema, createResultSchema, createVaultCrypto, disableTinyCloudDebug, enableTinyCloudDebug, errorResult, getTinyCloudDebugLogs, installTinyCloudDebugGlobals, isStorageFullError, networkError, notFoundError, parseAuthError, parseCapabilityResource, parsePermissionHint, parsePermissionHintFromErrorText, parseSecretCatalogKey, parseStorageQuotaBytes, parseStorageRejection, parseStorageStatus, permissionDeniedError, resolveSecretListPrefix, resolveSecretPath, storageLimitReachedError, storageQuotaExceededError, storageRejectionError, storageUsageState, timeoutError, tinyCloudDebugLogger, validateKVListResponse, validateKVResponseHeaders, validateRetryPolicy, validateServiceError, validateServiceRequestEvent, validateServiceResponseEvent, validateServiceSession, validateTelemetrySpanEvent, validatedCapabilityOf, wrapError };
package/dist/index.d.ts CHANGED
@@ -1,15 +1,16 @@
1
- import { a as IServiceContext, c as InvokeFunction, d as InvokeAnyFunction, F as FetchFunction, S as ServiceSession, e as RetryPolicy, T as TelemetryConfig, I as IService, E as EventHandler, b as ServiceError, R as Result, P as PermissionHint, f as StorageQuotaInfo } from './types-7A5rHWRY.js';
2
- export { g as ErrorCode, h as ErrorCodes, i as FetchRequestInit, j as FetchResponse, k as InvocationFact, l as InvocationFacts, m as InvokeAnyEntry, n as ServiceErrorEvent, o as ServiceHeaders, p as ServiceRequestEvent, q as ServiceResponseEvent, r as ServiceRetryEvent, s as TelemetryEventHandler, t as TelemetryEvents, u as TelemetrySpanEvent, v as defaultRetryPolicy, w as err, x as ok, y as serviceError } from './types-7A5rHWRY.js';
1
+ import { a as IServiceContext, c as InvokeFunction, d as InvokeAnyFunction, F as FetchFunction, S as ServiceSession, e as RetryPolicy, T as TelemetryConfig, I as IService, E as EventHandler, b as ServiceError, R as Result, P as PermissionHint, f as StorageQuotaInfo } from './types-D-9A3Sut.js';
2
+ export { g as ErrorCode, h as ErrorCodes, i as FetchRequestInit, j as FetchResponse, k as InvocationFact, l as InvocationFacts, m as InvokeAnyEntry, n as ServiceErrorEvent, o as ServiceHeaders, p as ServiceRequestEvent, q as ServiceResponseEvent, r as ServiceRetryEvent, s as TelemetryEventHandler, t as TelemetryEvents, u as TelemetrySpanEvent, v as defaultRetryPolicy, w as err, x as ok, y as serviceError } from './types-D-9A3Sut.js';
3
3
  import { z } from 'zod';
4
- import { B as BaseService } from './BaseService-Di_hVfUV.js';
5
- export { a as BaseServiceOptions, R as RequestSignal, S as ServiceConstructor, b as ServiceRegistration } from './BaseService-Di_hVfUV.js';
4
+ import { B as BaseService } from './BaseService-BGr2slUz.js';
5
+ export { a as BaseServiceOptions, R as RequestSignal, S as ServiceConstructor, b as ServiceRegistration } from './BaseService-BGr2slUz.js';
6
6
  import { IKVService } from './kv/index.js';
7
7
  export { IPrefixedKVService, KVService, PrefixedKVService } from './kv/index.js';
8
- export { A as AuthorityRefusal, C as CLEAR_PENDING_WARNING, I as DEFAULT_SIGNED_READ_URL_EXPIRY_MS, J as KVAction, M as KVActionType, N as KVBatchPutItem, O as KVBatchPutOptions, Q as KVBatchPutResponse, S as KVBatchReadResponse, T as KVChange, U as KVChangesAuthority, V as KVChangesOptions, W as KVChangesResponse, X as KVCreateSignedReadUrlOptions, Y as KVDeleteOptions, Z as KVGetOptions, _ as KVHeadOptions, $ as KVListOptions, b as KVListPage, a0 as KVListResponse, a1 as KVPutOptions, c as KVReadThrough, d as KVReplicaHandle, e as KVReplicaSpec, f as KVReplicaStorage, a as KVReplicationController, K as KVReplicationDeps, a2 as KVResponse, a3 as KVResponseHeaders, a4 as KVServiceConfig, a5 as KVSignedReadUrlResponse, L as LocalGetResult, g as LocalListResult, h as LocalReadMeta, i as LocalReplicaStatus, j as LocalSyncResult, k as PendingWriteRecord, l as PendingWriteState, P as PendingWriteStore, m as PinnedKey, n as PurgeTarget, o as ReplicaAuthorityState, p as ReplicaCoverage, q as ReplicaDevice, r as ReplicaGrantInfo, s as ReplicaState, t as ReplicaStatusEntry, u as ReplicationAuthority, v as ReplicationControl, w as ReplicationEvent, R as ReplicationIdentity, x as ReplicationOptions, y as ReplicationPurgeReport, z as ReplicationReason, B as ReplicationScheduler, D as ResolvedReplicationOptions, E as canonicalReplicationIdentity, F as kvPrefixCovers, G as replicationIdentityKey, H as requiresSecretsOptIn } from './scope-BmLxwyl-.js';
8
+ export { A as AuthorityRefusal, C as CLEAR_PENDING_WARNING, H as DEFAULT_SIGNED_READ_URL_EXPIRY_MS, I as KVAction, J as KVActionType, M as KVBatchPutItem, N as KVBatchPutOptions, O as KVBatchPutResponse, Q as KVBatchReadResponse, S as KVChange, T as KVChangesAuthority, U as KVChangesOptions, V as KVChangesResponse, W as KVCreateSignedReadUrlOptions, X as KVDeleteOptions, Y as KVGetOptions, Z as KVHeadOptions, _ as KVListOptions, b as KVListPage, $ as KVListResponse, a0 as KVPutOptions, c as KVReadThrough, d as KVReplicaHandle, e as KVReplicaSpec, f as KVReplicaStorage, a as KVReplicationController, K as KVReplicationDeps, a1 as KVResponse, a2 as KVResponseHeaders, a3 as KVServiceConfig, a4 as KVSignedReadUrlResponse, L as LocalGetResult, g as LocalListResult, h as LocalReadMeta, i as LocalReplicaStatus, j as LocalSyncResult, k as PendingWriteRecord, l as PendingWriteState, P as PendingWriteStore, m as PinnedKey, n as PurgeTarget, o as ReplicaAuthorityState, p as ReplicaCoverage, q as ReplicaDevice, r as ReplicaGrantInfo, s as ReplicaState, t as ReplicaStatusEntry, u as ReplicationAuthority, v as ReplicationControl, w as ReplicationEvent, R as ReplicationIdentity, x as ReplicationOptions, y as ReplicationPurgeReport, z as ReplicationReason, B as ReplicationScheduler, D as ResolvedReplicationOptions, E as canonicalReplicationIdentity, F as replicationIdentityKey, G as requiresSecretsOptIn } from './scope-CoKKmMiI.js';
9
9
  export { BatchOptions, BatchResponse, DatabaseHandle, ExecuteOptions, ExecuteResponse, IDatabaseHandle, ISQLMigrations, ISQLService, QueryOptions, QueryResponse, SQLAction, SQLActionType, SQLMigrations, SQLService, SQLServiceConfig, SqlMigration, SqlMigrationApplyOptions, SqlMigrationApplyResponse, SqlStatement, SqlValue } from './sql/index.js';
10
10
  import { IEncryptionService, DecryptCapabilityProof } from './encryption/index.js';
11
11
  export { BuildCanonicalDecryptRequestInput, BuildDecryptFactsInput, BuildDecryptInvocationInput, BuiltDecryptInvocation, CanonicalDecryptRequest, CanonicalJson, DECRYPT_ACTION, DECRYPT_FACT_TYPE, DECRYPT_RESULT_TYPE, DEFAULT_ENCRYPTION_ALG, DEFAULT_KEY_VERSION, DecryptEnvelopeOptions, DecryptInvocationFact, DecryptInvocationSigner, DecryptRequestBody, DecryptResponseBody, DecryptTransport, DiscoverNetworkInput, DiscoveredNetwork, DiscoverySource, ENCRYPTION_NETWORK_URN_PREFIX, ENCRYPTION_SERVICE, ENCRYPTION_SERVICE_SHORT, ENVELOPE_VERSION, EncryptToNetworkInput, EncryptToNetworkOptions, EncryptToNetworkResult, EncryptionCrypto, EncryptionError, EncryptionErrorInput, EncryptionService, EncryptionServiceConfig, InlineEncryptedEnvelope, Json, NETWORK_NAME_PATTERN, NetworkDescriptor, NetworkIdError, NodeDescriptorFetcher, ParsedNetworkId, RandomReceiverKeyInput, ReceiverKeyPair, ReceiverKeySigner, SignedReceiverKeyInput, VerifyDecryptResponseInput, WellKnownDescriptorFetcher, base64Decode, base64Encode, buildCanonicalDecryptRequest, buildDecryptAttenuation, buildDecryptFacts, buildDecryptInvocation, buildNetworkId, canonicalHashHex, canonicalSignedResponse, canonicalize as canonicalizeEncryptionJson, checkDecryptInvocationInput, decryptEnvelopeWithKey, deriveSignedReceiverKey, discoverNetwork, encryptToNetwork, encryptionError, ensureNetworkUsableForDecrypt, generateRandomReceiverKey, hexDecode, hexEncode, isNetworkId, networkDiscoveryKey, openWrappedKey, parseNetworkId, utf8Decode, utf8Encode, validateEnvelope, verifyDecryptResponse } from './encryption/index.js';
12
12
  export { DecryptTransportResponseError } from '@tinycloud/sdk-services/internal/decrypt-transport-response-error';
13
+ export { kvPrefixCovers } from './kv/replication/prefix.js';
13
14
 
14
15
  type TinyCloudDebugLevel = "debug";
15
16
  interface TinyCloudDebugEvent {
@@ -1141,11 +1142,37 @@ declare function parseStorageQuotaBytes(responseText: string): {
1141
1142
  usedBytes: number;
1142
1143
  limitBytes: number;
1143
1144
  } | undefined;
1145
+ /**
1146
+ * Account-wide storage totals the node attaches to a storage rejection when
1147
+ * billing supplied them. `limitBytes` is the plan budget shared by all the
1148
+ * owner's spaces, so this is the number to show the user, not the space's.
1149
+ */
1150
+ interface StorageAccountUsage {
1151
+ usedBytes: number;
1152
+ limitBytes: number;
1153
+ /** Plan tier id, e.g. `free` or `paid`. */
1154
+ plan?: string;
1155
+ }
1156
+ /** What a node storage rejection says about the space and the account. */
1157
+ interface StorageRejectionDetails {
1158
+ usedBytes?: number;
1159
+ limitBytes?: number;
1160
+ account?: StorageAccountUsage;
1161
+ }
1162
+ /**
1163
+ * Parse a node storage rejection. The node sends a JSON body
1164
+ * (`{error, message, space: {usedBytes, limitBytes}, account?: {usedBytes,
1165
+ * limitBytes, plan}}`); older nodes send only the plain-text message. Returns
1166
+ * undefined when the body is neither, e.g. a proxy's own 413 page.
1167
+ */
1168
+ declare function parseStorageRejection(responseText: string): StorageRejectionDetails | undefined;
1144
1169
  /**
1145
1170
  * Build the error for a write the node rejected for storage: 402 when storage
1146
1171
  * is already full, 413 when this write is larger than what is left. KV, SQL
1147
1172
  * and DuckDB all report it with the same codes and message so an app can
1148
1173
  * detect "storage full" in one place with {@link isStorageFullError}.
1174
+ * `meta.usedBytes`/`meta.limitBytes` describe the space; `meta.account`
1175
+ * carries the account totals when the node sent them.
1149
1176
  */
1150
1177
  declare function storageRejectionError(service: string, status: 402 | 413, meta: Record<string, unknown>, responseText: string): ServiceError;
1151
1178
  /**
@@ -1651,10 +1678,129 @@ declare class HooksService extends BaseService implements IHooksService {
1651
1678
  private createInvokeHeaders;
1652
1679
  }
1653
1680
 
1681
+ /**
1682
+ * The single `storage.full` event: the first write any service saw rejected
1683
+ * because the owner's TinyCloud storage is full. Reads keep working, so an app
1684
+ * shows a read-only banner from this one listener instead of handling the
1685
+ * error at every write site.
1686
+ */
1687
+ interface StorageFullEvent {
1688
+ /** Service that saw the rejection, e.g. `kv` or `sql`. */
1689
+ service: string;
1690
+ /** The rejection: `STORAGE_QUOTA_EXCEEDED` or `STORAGE_LIMIT_REACHED`. */
1691
+ error: ServiceError;
1692
+ /** Bytes used by the rejected space, when the node sent them. */
1693
+ usedBytes?: number;
1694
+ /** The space's share of the account budget, when the node sent it. */
1695
+ limitBytes?: number;
1696
+ /** Account-wide totals, when the node had them from billing. */
1697
+ account?: StorageAccountUsage;
1698
+ /**
1699
+ * Space the rejected write targeted, when the service context knew it.
1700
+ * Storage is one budget per owner, so this says whose storage is full.
1701
+ */
1702
+ spaceId?: string;
1703
+ }
1704
+ type StorageFullHandler = (event: StorageFullEvent) => void;
1705
+ /**
1706
+ * Turns the storage rejections seen by any number of service contexts into
1707
+ * one `storage.full` event, and remembers whose storage is full so read paths
1708
+ * can skip their best-effort writes.
1709
+ *
1710
+ * Storage is one budget per owner, so fullness is recorded per owner, apart
1711
+ * from the event: a rejection on one owner's space never hides a later
1712
+ * rejection on another's. The event fires once per episode, which lasts until
1713
+ * no owner is known to be full.
1714
+ *
1715
+ * The event goes through the rejecting context's `emit` (so telemetry and the
1716
+ * debug log see it) and then to the handlers registered with {@link on}.
1717
+ */
1718
+ declare class StorageFullMonitor {
1719
+ private readonly ownerOf;
1720
+ /** The emitted event, until the episode ends. */
1721
+ private event;
1722
+ /** First rejection per owner key; {@link UNKNOWN_OWNER} when the space was unknown. */
1723
+ private readonly full;
1724
+ private readonly handlers;
1725
+ /**
1726
+ * @param ownerOf Owner key of a space id. Spaces with one key share one
1727
+ * storage budget. Defaults to the space id itself.
1728
+ */
1729
+ constructor(ownerOf?: (spaceId: string) => string);
1730
+ /** True while any owner's storage is known to be full. */
1731
+ get isFull(): boolean;
1732
+ /** The rejection `storage.full` announced, until the episode ends. */
1733
+ get rejection(): StorageFullEvent | undefined;
1734
+ /**
1735
+ * True when a write to `spaceId`'s owner was rejected, or a write whose
1736
+ * space was unknown was: that one could have been any owner's.
1737
+ */
1738
+ isFullFor(spaceId: string | undefined): boolean;
1739
+ /** Watch a context's service errors. Returns the unsubscribe function. */
1740
+ observe(context: IServiceContext): () => void;
1741
+ /** Subscribe to the `storage.full` event. Returns the unsubscribe function. */
1742
+ on(handler: StorageFullHandler): () => void;
1743
+ /** Forget that any owner's storage is full; the next rejection emits `storage.full` again. */
1744
+ clear(): void;
1745
+ /**
1746
+ * Forget that `spaceId`'s owner is full (`undefined`: the rejections whose
1747
+ * space was unknown). Once no owner is full, the next rejection emits
1748
+ * `storage.full` again.
1749
+ */
1750
+ clearFor(spaceId: string | undefined): void;
1751
+ }
1752
+
1753
+ /** Where the owner frees up space or upgrades their plan. */
1754
+ declare const STORAGE_MANAGE_URL = "https://account.tinycloud.xyz/billing";
1755
+ /** Storage counts as nearly full from this share of the limit. */
1756
+ declare const STORAGE_NEARLY_FULL_RATIO = 0.9;
1757
+ type StorageUsageState = "ok" | "nearly_full" | "full";
1758
+ /** Byte counts as the node's usage read reports them; `null` limit means unlimited. */
1759
+ interface StorageUsage {
1760
+ usedBytes: number;
1761
+ limitBytes: number | null;
1762
+ }
1763
+ /**
1764
+ * The owner's TinyCloud storage, as `tc.storage.status()` reports it.
1765
+ * `usedBytes`/`limitBytes` describe the space that was asked about; its limit
1766
+ * is that space's share of the account budget.
1767
+ */
1768
+ interface StorageStatus extends StorageUsage {
1769
+ /** Account-wide totals; storage is one budget shared by all the owner's spaces. */
1770
+ account?: StorageUsage & {
1771
+ plan?: string;
1772
+ };
1773
+ /** Plan tier id, e.g. `free` or `paid`, when known. */
1774
+ plan?: string;
1775
+ /** From the account totals when known, else from the space. */
1776
+ state: StorageUsageState;
1777
+ /** Where to free up space or upgrade. */
1778
+ manageUrl: string;
1779
+ }
1780
+ interface StorageStatusOptions {
1781
+ /** Space name (e.g. `secrets`) or full space id. Defaults to the session's primary space. */
1782
+ space?: string;
1783
+ }
1784
+ /** `tc.storage.status()`: reads the owner's usage and plan from the node. */
1785
+ interface IStorageService {
1786
+ status(options?: StorageStatusOptions): Promise<Result<StorageStatus>>;
1787
+ }
1788
+ /** `full` at or over the limit, `nearly_full` from 90% of it; never full without a limit. */
1789
+ declare function storageUsageState(usedBytes: number, limitBytes: number | null): StorageUsageState;
1790
+ /**
1791
+ * Parse the node's usage read (`tinycloud.space/info`):
1792
+ * `{space: {usedBytes, limitBytes}, account?: {usedBytes, limitBytes, plan?}, manageUrl}`.
1793
+ * Returns undefined when the body lacks the space numbers, e.g. a node that
1794
+ * predates the usage read.
1795
+ */
1796
+ declare function parseStorageStatus(body: unknown): StorageStatus | undefined;
1797
+
1798
+ /** @deprecated Use `tc.on("storage.full", handler)` instead. Nothing in the SDK calls `onUpgradeRequired`. */
1654
1799
  interface QuotaConfig {
1655
1800
  /** Called when a storage quota error is detected (402/413) */
1656
1801
  onUpgradeRequired?: (info: StorageQuotaInfo) => void;
1657
1802
  }
1803
+ /** @deprecated Use `StorageStatus` from `tc.storage.status()`. */
1658
1804
  interface QuotaStatus {
1659
1805
  /** Storage limit in bytes for this space */
1660
1806
  limitBytes: number;
@@ -1663,6 +1809,11 @@ interface QuotaStatus {
1663
1809
  /** Remaining storage in bytes */
1664
1810
  remainingBytes?: number;
1665
1811
  }
1812
+ /**
1813
+ * @deprecated Use `tc.storage.status()` for usage and `tc.on("storage.full", handler)`
1814
+ * for rejections. This class reads billing's unauthenticated quota endpoint
1815
+ * and is not wired into the SDK; it will be removed in a future major release.
1816
+ */
1666
1817
  declare class TinyCloudQuota {
1667
1818
  private config;
1668
1819
  private quotaUrl;
@@ -2430,4 +2581,4 @@ declare class SecretsService implements ISecretsService {
2430
2581
  listAll(): Promise<Result<SecretCatalogEntry[], SecretsError>>;
2431
2582
  }
2432
2583
 
2433
- export { type AuthorizationVerdict, BaseService, type ColumnInfo, type DataVaultConfig, DataVaultService, DecryptCapabilityProof, DuckDbAction, type DuckDbActionType, type DuckDbBatchOptions, type BatchResponse as DuckDbBatchResponse, DuckDbDatabaseHandle, type DuckDbExecuteOptions, type ExecuteResponse as DuckDbExecuteResponse, type DuckDbOptions, type DuckDbQueryOptions, type QueryResponse as DuckDbQueryResponse, DuckDbService, type DuckDbServiceConfig, type DuckDbStatement, type DuckDbValue, EventHandler, FetchFunction, GenericKVResponseSchema, type GenericKVResponseType, GenericResultSchema, type HookEvent, type HookServiceName, type HookStreamEvent, type HookStreamRetryConfig, type HookSubscription, type HookWebhookListOptions, type HookWebhookRecord, type HookWebhookRegistration, type HookWebhookScope, type HookWebhookUnregisterOptions, HooksService, type HooksServiceConfig, type IDataVaultService, type IDuckDbDatabaseHandle, type IDuckDbService, IEncryptionService, type IHooksService, IKVService, type ISecretsService, IService, IServiceContext, InvokeAnyFunction, InvokeFunction, KVListResponseSchema, type KVListResponseType, KVListResultSchema, type KVListResultType, KVResponseHeadersSchema, type KVResponseHeadersType, MAX_SECRET_SCOPE_LENGTH, type ParsedSecretCatalogKey, PermissionHint, type QuotaConfig, type QuotaStatus, type ResolvedSecretPath, Result, RetryPolicy, RetryPolicySchema, type RetryPolicyType, SECRET_NAME_RE, SECRET_SCOPE_RE, STORAGE_FULL_MESSAGE, STORAGE_WRITE_TOO_LARGE_MESSAGE, type SchemaInfo, type SecretCatalogEntry, type SecretPayload, type SecretPutOptions, type SecretScopeOptions, type SecretsError, SecretsService, ServiceContext, type ServiceContextConfig, ServiceError, ServiceErrorEventSchema, type ServiceErrorEventType, ServiceErrorSchema, type ServiceErrorType, ServiceRequestEventSchema, type ServiceRequestEventType, ServiceResponseEventSchema, type ServiceResponseEventType, ServiceRetryEventSchema, type ServiceRetryEventType, ServiceSession, ServiceSessionSchema, type ServiceSessionType, StorageQuotaInfo, type SubscribeOptions, TC832_RESERVED_SCOPES, type TableInfo, TelemetryConfig, TelemetrySpanEventSchema, type TelemetrySpanEventType, type TinyCloudDebugEnableOptions, type TinyCloudDebugEvent, type TinyCloudDebugLevel, TinyCloudDebugLogger, type TinyCloudDebugTimer, TinyCloudQuota, type ValidationError, type VaultCrypto, type VaultEntry, type VaultError, type VaultGetOptions, type VaultGrantOptions, VaultHeaders, type VaultListOptions, type VaultListPage, type VaultNetworkReadResult, VaultPublicSpaceKVActions, type VaultPutOptions, type ViewInfo, type WasmVaultFunctions, abortedError, appSecretScope, authExpiredError, authRequiredError, authUnauthorizedError, authorizationVerdictOf, canonicalizeSecretScope, clearTinyCloudDebugLogs, createKVResponseSchema, createResultSchema, createVaultCrypto, disableTinyCloudDebug, enableTinyCloudDebug, errorResult, getTinyCloudDebugLogs, installTinyCloudDebugGlobals, isStorageFullError, networkError, notFoundError, parseAuthError, parseCapabilityResource, parsePermissionHint, parsePermissionHintFromErrorText, parseSecretCatalogKey, parseStorageQuotaBytes, permissionDeniedError, resolveSecretListPrefix, resolveSecretPath, storageLimitReachedError, storageQuotaExceededError, storageRejectionError, timeoutError, tinyCloudDebugLogger, validateKVListResponse, validateKVResponseHeaders, validateRetryPolicy, validateServiceError, validateServiceRequestEvent, validateServiceResponseEvent, validateServiceSession, validateTelemetrySpanEvent, validatedCapabilityOf, wrapError };
2584
+ export { type AuthorizationVerdict, BaseService, type ColumnInfo, type DataVaultConfig, DataVaultService, DecryptCapabilityProof, DuckDbAction, type DuckDbActionType, type DuckDbBatchOptions, type BatchResponse as DuckDbBatchResponse, DuckDbDatabaseHandle, type DuckDbExecuteOptions, type ExecuteResponse as DuckDbExecuteResponse, type DuckDbOptions, type DuckDbQueryOptions, type QueryResponse as DuckDbQueryResponse, DuckDbService, type DuckDbServiceConfig, type DuckDbStatement, type DuckDbValue, EventHandler, FetchFunction, GenericKVResponseSchema, type GenericKVResponseType, GenericResultSchema, type HookEvent, type HookServiceName, type HookStreamEvent, type HookStreamRetryConfig, type HookSubscription, type HookWebhookListOptions, type HookWebhookRecord, type HookWebhookRegistration, type HookWebhookScope, type HookWebhookUnregisterOptions, HooksService, type HooksServiceConfig, type IDataVaultService, type IDuckDbDatabaseHandle, type IDuckDbService, IEncryptionService, type IHooksService, IKVService, type ISecretsService, IService, IServiceContext, type IStorageService, InvokeAnyFunction, InvokeFunction, KVListResponseSchema, type KVListResponseType, KVListResultSchema, type KVListResultType, KVResponseHeadersSchema, type KVResponseHeadersType, MAX_SECRET_SCOPE_LENGTH, type ParsedSecretCatalogKey, PermissionHint, type QuotaConfig, type QuotaStatus, type ResolvedSecretPath, Result, RetryPolicy, RetryPolicySchema, type RetryPolicyType, SECRET_NAME_RE, SECRET_SCOPE_RE, STORAGE_FULL_MESSAGE, STORAGE_MANAGE_URL, STORAGE_NEARLY_FULL_RATIO, STORAGE_WRITE_TOO_LARGE_MESSAGE, type SchemaInfo, type SecretCatalogEntry, type SecretPayload, type SecretPutOptions, type SecretScopeOptions, type SecretsError, SecretsService, ServiceContext, type ServiceContextConfig, ServiceError, ServiceErrorEventSchema, type ServiceErrorEventType, ServiceErrorSchema, type ServiceErrorType, ServiceRequestEventSchema, type ServiceRequestEventType, ServiceResponseEventSchema, type ServiceResponseEventType, ServiceRetryEventSchema, type ServiceRetryEventType, ServiceSession, ServiceSessionSchema, type ServiceSessionType, type StorageAccountUsage, type StorageFullEvent, type StorageFullHandler, StorageFullMonitor, StorageQuotaInfo, type StorageRejectionDetails, type StorageStatus, type StorageStatusOptions, type StorageUsage, type StorageUsageState, type SubscribeOptions, TC832_RESERVED_SCOPES, type TableInfo, TelemetryConfig, TelemetrySpanEventSchema, type TelemetrySpanEventType, type TinyCloudDebugEnableOptions, type TinyCloudDebugEvent, type TinyCloudDebugLevel, TinyCloudDebugLogger, type TinyCloudDebugTimer, TinyCloudQuota, type ValidationError, type VaultCrypto, type VaultEntry, type VaultError, type VaultGetOptions, type VaultGrantOptions, VaultHeaders, type VaultListOptions, type VaultListPage, type VaultNetworkReadResult, VaultPublicSpaceKVActions, type VaultPutOptions, type ViewInfo, type WasmVaultFunctions, abortedError, appSecretScope, authExpiredError, authRequiredError, authUnauthorizedError, authorizationVerdictOf, canonicalizeSecretScope, clearTinyCloudDebugLogs, createKVResponseSchema, createResultSchema, createVaultCrypto, disableTinyCloudDebug, enableTinyCloudDebug, errorResult, getTinyCloudDebugLogs, installTinyCloudDebugGlobals, isStorageFullError, networkError, notFoundError, parseAuthError, parseCapabilityResource, parsePermissionHint, parsePermissionHintFromErrorText, parseSecretCatalogKey, parseStorageQuotaBytes, parseStorageRejection, parseStorageStatus, permissionDeniedError, resolveSecretListPrefix, resolveSecretPath, storageLimitReachedError, storageQuotaExceededError, storageRejectionError, storageUsageState, timeoutError, tinyCloudDebugLogger, validateKVListResponse, validateKVResponseHeaders, validateRetryPolicy, validateServiceError, validateServiceRequestEvent, validateServiceResponseEvent, validateServiceSession, validateTelemetrySpanEvent, validatedCapabilityOf, wrapError };