@tinycloud/sdk-services 2.10.0-beta.0 → 2.10.0

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.cts CHANGED
@@ -1,7 +1,7 @@
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-KCcgZiab.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-KCcgZiab.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-qwMmB7qB.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-qwMmB7qB.cjs';
3
3
  import { z } from 'zod';
4
- import { B as BaseService } from './BaseService-DxSU4U-v.cjs';
4
+ import { B as BaseService } from './BaseService-BhpVpA9b.cjs';
5
5
  import { IKVService } from './kv/index.cjs';
6
6
  export { DEFAULT_SIGNED_READ_URL_EXPIRY_MS, IPrefixedKVService, KVAction, KVActionType, KVBatchPutItem, KVBatchPutOptions, KVBatchPutResponse, KVBatchReadResponse, KVCreateSignedReadUrlOptions, KVDeleteOptions, KVGetOptions, KVHeadOptions, KVListOptions, KVListResponse, KVPutOptions, KVResponse, KVResponseHeaders, KVService, KVServiceConfig, KVSignedReadUrlResponse, PrefixedKVService } from './kv/index.cjs';
7
7
  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';
@@ -418,10 +418,16 @@ type GenericKVResponseType = z.infer<typeof GenericKVResponseSchema>;
418
418
  declare const KVListResponseSchema: z.ZodObject<{
419
419
  /** Array of keys matching the list criteria */
420
420
  keys: z.ZodArray<z.ZodString, "many">;
421
+ truncated: z.ZodOptional<z.ZodBoolean>;
422
+ nextCursor: z.ZodOptional<z.ZodString>;
421
423
  }, "strip", z.ZodTypeAny, {
422
424
  keys: string[];
425
+ truncated?: boolean | undefined;
426
+ nextCursor?: string | undefined;
423
427
  }, {
424
428
  keys: string[];
429
+ truncated?: boolean | undefined;
430
+ nextCursor?: string | undefined;
425
431
  }>;
426
432
  type KVListResponseType = z.infer<typeof KVListResponseSchema>;
427
433
  /**
@@ -432,19 +438,29 @@ declare const KVListResultSchema: z.ZodDiscriminatedUnion<"ok", [z.ZodObject<{
432
438
  data: z.ZodObject<{
433
439
  /** Array of keys matching the list criteria */
434
440
  keys: z.ZodArray<z.ZodString, "many">;
441
+ truncated: z.ZodOptional<z.ZodBoolean>;
442
+ nextCursor: z.ZodOptional<z.ZodString>;
435
443
  }, "strip", z.ZodTypeAny, {
436
444
  keys: string[];
445
+ truncated?: boolean | undefined;
446
+ nextCursor?: string | undefined;
437
447
  }, {
438
448
  keys: string[];
449
+ truncated?: boolean | undefined;
450
+ nextCursor?: string | undefined;
439
451
  }>;
440
452
  }, "strip", z.ZodTypeAny, {
441
453
  data: {
442
454
  keys: string[];
455
+ truncated?: boolean | undefined;
456
+ nextCursor?: string | undefined;
443
457
  };
444
458
  ok: true;
445
459
  }, {
446
460
  data: {
447
461
  keys: string[];
462
+ truncated?: boolean | undefined;
463
+ nextCursor?: string | undefined;
448
464
  };
449
465
  ok: true;
450
466
  }>, z.ZodObject<{
@@ -1595,6 +1611,15 @@ interface VaultListOptions {
1595
1611
  prefix?: string;
1596
1612
  /** Remove prefix from returned keys */
1597
1613
  removePrefix?: boolean;
1614
+ /** Maximum number of keys to return. */
1615
+ limit?: number;
1616
+ /** Opaque cursor returned by a prior bounded page. */
1617
+ cursor?: string;
1618
+ }
1619
+ interface VaultListPage {
1620
+ keys: string[];
1621
+ truncated: boolean;
1622
+ nextCursor?: string;
1598
1623
  }
1599
1624
  /**
1600
1625
  * Options for vault grant (sharing) operations.
@@ -1763,6 +1788,8 @@ interface IDataVaultService extends IService {
1763
1788
  * @returns Result with the decrypted entry
1764
1789
  */
1765
1790
  get<T = unknown>(key: string, options?: VaultGetOptions<T>): Promise<Result<VaultEntry<T>, VaultError>>;
1791
+ /** Read a network-encrypted value with safe, phase-classified failures. */
1792
+ readNetworkEncrypted<T = unknown>(key: string, options?: VaultGetOptions<T>): Promise<VaultNetworkReadResult<T>>;
1766
1793
  /**
1767
1794
  * Delete an encrypted key.
1768
1795
  *
@@ -1776,6 +1803,8 @@ interface IDataVaultService extends IService {
1776
1803
  * @returns Result with array of key names
1777
1804
  */
1778
1805
  list(options?: VaultListOptions): Promise<Result<string[], VaultError>>;
1806
+ /** List one bounded, cursor-aware page of vault keys. */
1807
+ listPage(options?: VaultListOptions): Promise<Result<VaultListPage, VaultError>>;
1779
1808
  /**
1780
1809
  * Get envelope metadata for a key without decrypting the value.
1781
1810
  *
@@ -2049,6 +2078,7 @@ declare class DataVaultService extends BaseService implements IDataVaultService
2049
2078
  * @returns Result with array of key names (vault/ prefix stripped)
2050
2079
  */
2051
2080
  list(options?: VaultListOptions): Promise<Result<string[], VaultError>>;
2081
+ listPage(options?: VaultListOptions): Promise<Result<VaultListPage, VaultError>>;
2052
2082
  /**
2053
2083
  * Get envelope metadata for a key without decrypting the value.
2054
2084
  *
@@ -2200,4 +2230,4 @@ declare class SecretsService implements ISecretsService {
2200
2230
  list(options?: SecretScopeOptions): Promise<Result<string[], SecretsError>>;
2201
2231
  }
2202
2232
 
2203
- export { BaseService, type BaseServiceOptions, 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 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, PermissionHint, type QuotaConfig, type QuotaStatus, type ResolvedSecretPath, Result, RetryPolicy, RetryPolicySchema, type RetryPolicyType, SECRET_NAME_RE, type SchemaInfo, type SecretPayload, type SecretScopeOptions, type SecretsError, SecretsService, type ServiceConstructor, ServiceContext, type ServiceContextConfig, ServiceError, ServiceErrorEventSchema, type ServiceErrorEventType, ServiceErrorSchema, type ServiceErrorType, type ServiceRegistration, ServiceRequestEventSchema, type ServiceRequestEventType, ServiceResponseEventSchema, type ServiceResponseEventType, ServiceRetryEventSchema, type ServiceRetryEventType, ServiceSession, ServiceSessionSchema, type ServiceSessionType, StorageQuotaInfo, type SubscribeOptions, 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 VaultNetworkReadResult, VaultPublicSpaceKVActions, type VaultPutOptions, type ViewInfo, type WasmVaultFunctions, abortedError, authExpiredError, authRequiredError, authUnauthorizedError, canonicalizeSecretScope, clearTinyCloudDebugLogs, createKVResponseSchema, createResultSchema, createVaultCrypto, disableTinyCloudDebug, enableTinyCloudDebug, errorResult, getTinyCloudDebugLogs, installTinyCloudDebugGlobals, networkError, notFoundError, parseAuthError, parsePermissionHint, parsePermissionHintFromErrorText, permissionDeniedError, resolveSecretListPrefix, resolveSecretPath, storageLimitReachedError, storageQuotaExceededError, timeoutError, tinyCloudDebugLogger, validateKVListResponse, validateKVResponseHeaders, validateRetryPolicy, validateServiceError, validateServiceRequestEvent, validateServiceResponseEvent, validateServiceSession, validateTelemetrySpanEvent, wrapError };
2233
+ export { BaseService, type BaseServiceOptions, 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 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, PermissionHint, type QuotaConfig, type QuotaStatus, type ResolvedSecretPath, Result, RetryPolicy, RetryPolicySchema, type RetryPolicyType, SECRET_NAME_RE, type SchemaInfo, type SecretPayload, type SecretScopeOptions, type SecretsError, SecretsService, type ServiceConstructor, ServiceContext, type ServiceContextConfig, ServiceError, ServiceErrorEventSchema, type ServiceErrorEventType, ServiceErrorSchema, type ServiceErrorType, type ServiceRegistration, ServiceRequestEventSchema, type ServiceRequestEventType, ServiceResponseEventSchema, type ServiceResponseEventType, ServiceRetryEventSchema, type ServiceRetryEventType, ServiceSession, ServiceSessionSchema, type ServiceSessionType, StorageQuotaInfo, type SubscribeOptions, 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, authExpiredError, authRequiredError, authUnauthorizedError, canonicalizeSecretScope, clearTinyCloudDebugLogs, createKVResponseSchema, createResultSchema, createVaultCrypto, disableTinyCloudDebug, enableTinyCloudDebug, errorResult, getTinyCloudDebugLogs, installTinyCloudDebugGlobals, networkError, notFoundError, parseAuthError, parsePermissionHint, parsePermissionHintFromErrorText, permissionDeniedError, resolveSecretListPrefix, resolveSecretPath, storageLimitReachedError, storageQuotaExceededError, timeoutError, tinyCloudDebugLogger, validateKVListResponse, validateKVResponseHeaders, validateRetryPolicy, validateServiceError, validateServiceRequestEvent, validateServiceResponseEvent, validateServiceSession, validateTelemetrySpanEvent, wrapError };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
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-KCcgZiab.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-KCcgZiab.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-qwMmB7qB.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-qwMmB7qB.js';
3
3
  import { z } from 'zod';
4
- import { B as BaseService } from './BaseService-BiYeqCRT.js';
4
+ import { B as BaseService } from './BaseService-CuV-ZVPs.js';
5
5
  import { IKVService } from './kv/index.js';
6
6
  export { DEFAULT_SIGNED_READ_URL_EXPIRY_MS, IPrefixedKVService, KVAction, KVActionType, KVBatchPutItem, KVBatchPutOptions, KVBatchPutResponse, KVBatchReadResponse, KVCreateSignedReadUrlOptions, KVDeleteOptions, KVGetOptions, KVHeadOptions, KVListOptions, KVListResponse, KVPutOptions, KVResponse, KVResponseHeaders, KVService, KVServiceConfig, KVSignedReadUrlResponse, PrefixedKVService } from './kv/index.js';
7
7
  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';
@@ -418,10 +418,16 @@ type GenericKVResponseType = z.infer<typeof GenericKVResponseSchema>;
418
418
  declare const KVListResponseSchema: z.ZodObject<{
419
419
  /** Array of keys matching the list criteria */
420
420
  keys: z.ZodArray<z.ZodString, "many">;
421
+ truncated: z.ZodOptional<z.ZodBoolean>;
422
+ nextCursor: z.ZodOptional<z.ZodString>;
421
423
  }, "strip", z.ZodTypeAny, {
422
424
  keys: string[];
425
+ truncated?: boolean | undefined;
426
+ nextCursor?: string | undefined;
423
427
  }, {
424
428
  keys: string[];
429
+ truncated?: boolean | undefined;
430
+ nextCursor?: string | undefined;
425
431
  }>;
426
432
  type KVListResponseType = z.infer<typeof KVListResponseSchema>;
427
433
  /**
@@ -432,19 +438,29 @@ declare const KVListResultSchema: z.ZodDiscriminatedUnion<"ok", [z.ZodObject<{
432
438
  data: z.ZodObject<{
433
439
  /** Array of keys matching the list criteria */
434
440
  keys: z.ZodArray<z.ZodString, "many">;
441
+ truncated: z.ZodOptional<z.ZodBoolean>;
442
+ nextCursor: z.ZodOptional<z.ZodString>;
435
443
  }, "strip", z.ZodTypeAny, {
436
444
  keys: string[];
445
+ truncated?: boolean | undefined;
446
+ nextCursor?: string | undefined;
437
447
  }, {
438
448
  keys: string[];
449
+ truncated?: boolean | undefined;
450
+ nextCursor?: string | undefined;
439
451
  }>;
440
452
  }, "strip", z.ZodTypeAny, {
441
453
  data: {
442
454
  keys: string[];
455
+ truncated?: boolean | undefined;
456
+ nextCursor?: string | undefined;
443
457
  };
444
458
  ok: true;
445
459
  }, {
446
460
  data: {
447
461
  keys: string[];
462
+ truncated?: boolean | undefined;
463
+ nextCursor?: string | undefined;
448
464
  };
449
465
  ok: true;
450
466
  }>, z.ZodObject<{
@@ -1595,6 +1611,15 @@ interface VaultListOptions {
1595
1611
  prefix?: string;
1596
1612
  /** Remove prefix from returned keys */
1597
1613
  removePrefix?: boolean;
1614
+ /** Maximum number of keys to return. */
1615
+ limit?: number;
1616
+ /** Opaque cursor returned by a prior bounded page. */
1617
+ cursor?: string;
1618
+ }
1619
+ interface VaultListPage {
1620
+ keys: string[];
1621
+ truncated: boolean;
1622
+ nextCursor?: string;
1598
1623
  }
1599
1624
  /**
1600
1625
  * Options for vault grant (sharing) operations.
@@ -1763,6 +1788,8 @@ interface IDataVaultService extends IService {
1763
1788
  * @returns Result with the decrypted entry
1764
1789
  */
1765
1790
  get<T = unknown>(key: string, options?: VaultGetOptions<T>): Promise<Result<VaultEntry<T>, VaultError>>;
1791
+ /** Read a network-encrypted value with safe, phase-classified failures. */
1792
+ readNetworkEncrypted<T = unknown>(key: string, options?: VaultGetOptions<T>): Promise<VaultNetworkReadResult<T>>;
1766
1793
  /**
1767
1794
  * Delete an encrypted key.
1768
1795
  *
@@ -1776,6 +1803,8 @@ interface IDataVaultService extends IService {
1776
1803
  * @returns Result with array of key names
1777
1804
  */
1778
1805
  list(options?: VaultListOptions): Promise<Result<string[], VaultError>>;
1806
+ /** List one bounded, cursor-aware page of vault keys. */
1807
+ listPage(options?: VaultListOptions): Promise<Result<VaultListPage, VaultError>>;
1779
1808
  /**
1780
1809
  * Get envelope metadata for a key without decrypting the value.
1781
1810
  *
@@ -2049,6 +2078,7 @@ declare class DataVaultService extends BaseService implements IDataVaultService
2049
2078
  * @returns Result with array of key names (vault/ prefix stripped)
2050
2079
  */
2051
2080
  list(options?: VaultListOptions): Promise<Result<string[], VaultError>>;
2081
+ listPage(options?: VaultListOptions): Promise<Result<VaultListPage, VaultError>>;
2052
2082
  /**
2053
2083
  * Get envelope metadata for a key without decrypting the value.
2054
2084
  *
@@ -2200,4 +2230,4 @@ declare class SecretsService implements ISecretsService {
2200
2230
  list(options?: SecretScopeOptions): Promise<Result<string[], SecretsError>>;
2201
2231
  }
2202
2232
 
2203
- export { BaseService, type BaseServiceOptions, 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 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, PermissionHint, type QuotaConfig, type QuotaStatus, type ResolvedSecretPath, Result, RetryPolicy, RetryPolicySchema, type RetryPolicyType, SECRET_NAME_RE, type SchemaInfo, type SecretPayload, type SecretScopeOptions, type SecretsError, SecretsService, type ServiceConstructor, ServiceContext, type ServiceContextConfig, ServiceError, ServiceErrorEventSchema, type ServiceErrorEventType, ServiceErrorSchema, type ServiceErrorType, type ServiceRegistration, ServiceRequestEventSchema, type ServiceRequestEventType, ServiceResponseEventSchema, type ServiceResponseEventType, ServiceRetryEventSchema, type ServiceRetryEventType, ServiceSession, ServiceSessionSchema, type ServiceSessionType, StorageQuotaInfo, type SubscribeOptions, 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 VaultNetworkReadResult, VaultPublicSpaceKVActions, type VaultPutOptions, type ViewInfo, type WasmVaultFunctions, abortedError, authExpiredError, authRequiredError, authUnauthorizedError, canonicalizeSecretScope, clearTinyCloudDebugLogs, createKVResponseSchema, createResultSchema, createVaultCrypto, disableTinyCloudDebug, enableTinyCloudDebug, errorResult, getTinyCloudDebugLogs, installTinyCloudDebugGlobals, networkError, notFoundError, parseAuthError, parsePermissionHint, parsePermissionHintFromErrorText, permissionDeniedError, resolveSecretListPrefix, resolveSecretPath, storageLimitReachedError, storageQuotaExceededError, timeoutError, tinyCloudDebugLogger, validateKVListResponse, validateKVResponseHeaders, validateRetryPolicy, validateServiceError, validateServiceRequestEvent, validateServiceResponseEvent, validateServiceSession, validateTelemetrySpanEvent, wrapError };
2233
+ export { BaseService, type BaseServiceOptions, 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 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, PermissionHint, type QuotaConfig, type QuotaStatus, type ResolvedSecretPath, Result, RetryPolicy, RetryPolicySchema, type RetryPolicyType, SECRET_NAME_RE, type SchemaInfo, type SecretPayload, type SecretScopeOptions, type SecretsError, SecretsService, type ServiceConstructor, ServiceContext, type ServiceContextConfig, ServiceError, ServiceErrorEventSchema, type ServiceErrorEventType, ServiceErrorSchema, type ServiceErrorType, type ServiceRegistration, ServiceRequestEventSchema, type ServiceRequestEventType, ServiceResponseEventSchema, type ServiceResponseEventType, ServiceRetryEventSchema, type ServiceRetryEventType, ServiceSession, ServiceSessionSchema, type ServiceSessionType, StorageQuotaInfo, type SubscribeOptions, 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, authExpiredError, authRequiredError, authUnauthorizedError, canonicalizeSecretScope, clearTinyCloudDebugLogs, createKVResponseSchema, createResultSchema, createVaultCrypto, disableTinyCloudDebug, enableTinyCloudDebug, errorResult, getTinyCloudDebugLogs, installTinyCloudDebugGlobals, networkError, notFoundError, parseAuthError, parsePermissionHint, parsePermissionHintFromErrorText, permissionDeniedError, resolveSecretListPrefix, resolveSecretPath, storageLimitReachedError, storageQuotaExceededError, timeoutError, tinyCloudDebugLogger, validateKVListResponse, validateKVResponseHeaders, validateRetryPolicy, validateServiceError, validateServiceRequestEvent, validateServiceResponseEvent, validateServiceSession, validateTelemetrySpanEvent, wrapError };
package/dist/index.js CHANGED
@@ -373,7 +373,9 @@ function createKVResponseSchema(dataSchema) {
373
373
  var GenericKVResponseSchema = createKVResponseSchema(z.unknown());
374
374
  var KVListResponseSchema = z.object({
375
375
  /** Array of keys matching the list criteria */
376
- keys: z.array(z.string())
376
+ keys: z.array(z.string()),
377
+ truncated: z.boolean().optional(),
378
+ nextCursor: z.string().optional()
377
379
  });
378
380
  var KVListResultSchema = createResultSchema(KVListResponseSchema);
379
381
  var ServiceRequestEventSchema = z.object({
@@ -2139,7 +2141,10 @@ var KVService = class extends BaseService {
2139
2141
  KVAction.LIST,
2140
2142
  void 0,
2141
2143
  options?.signal,
2142
- options?.limit === void 0 ? void 0 : { "x-tinycloud-limit": String(options.limit) }
2144
+ options?.limit === void 0 && options?.cursor === void 0 ? void 0 : {
2145
+ ...options?.limit === void 0 ? {} : { "x-tinycloud-limit": String(options.limit) },
2146
+ ...options?.cursor === void 0 ? {} : { "x-tinycloud-cursor": options.cursor }
2147
+ }
2143
2148
  );
2144
2149
  if (!response.ok) {
2145
2150
  if (response.status === 401) {
@@ -2171,7 +2176,8 @@ var KVService = class extends BaseService {
2171
2176
  }
2172
2177
  return ok({
2173
2178
  keys,
2174
- ...response.headers.get("x-tinycloud-truncated") === null ? {} : { truncated: response.headers.get("x-tinycloud-truncated") === "true" }
2179
+ ...response.headers.get("x-tinycloud-truncated") === null ? {} : { truncated: response.headers.get("x-tinycloud-truncated") === "true" },
2180
+ ...response.headers.get("x-tinycloud-next-cursor") === null ? {} : { nextCursor: response.headers.get("x-tinycloud-next-cursor") ?? void 0 }
2175
2181
  });
2176
2182
  } catch (error) {
2177
2183
  return err(wrapError("kv", error));
@@ -4896,6 +4902,10 @@ var DataVaultService = class extends BaseService {
4896
4902
  * @returns Result with array of key names (vault/ prefix stripped)
4897
4903
  */
4898
4904
  async list(options) {
4905
+ const page = await this.listPage(options);
4906
+ return page.ok ? { ok: true, data: page.data.keys } : page;
4907
+ }
4908
+ async listPage(options) {
4899
4909
  return this.withTelemetry("list", options?.prefix, async () => {
4900
4910
  if (!this.isUnlocked) {
4901
4911
  return vaultError({
@@ -4913,7 +4923,9 @@ var DataVaultService = class extends BaseService {
4913
4923
  const listPrefix = options?.prefix ? `vault/${options.prefix}` : "vault/";
4914
4924
  const listResult = await this.tc.kv.list({
4915
4925
  prefix: listPrefix,
4916
- removePrefix: true
4926
+ removePrefix: true,
4927
+ ...options?.limit === void 0 ? {} : { limit: options.limit },
4928
+ ...options?.cursor === void 0 ? {} : { cursor: options.cursor }
4917
4929
  });
4918
4930
  if (!listResult.ok) {
4919
4931
  return vaultError({
@@ -4930,7 +4942,11 @@ var DataVaultService = class extends BaseService {
4930
4942
  (k) => k.startsWith(userPrefix) ? k.slice(userPrefix.length) : k
4931
4943
  );
4932
4944
  }
4933
- return ok(keys);
4945
+ return ok({
4946
+ keys,
4947
+ truncated: listResult.data.truncated === true,
4948
+ ...listResult.data.nextCursor === void 0 ? {} : { nextCursor: listResult.data.nextCursor }
4949
+ });
4934
4950
  } catch (error) {
4935
4951
  return vaultError({
4936
4952
  code: "STORAGE_ERROR",