@tinycloud/sdk-services 2.4.0-beta.16 → 2.4.0-beta.19

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
@@ -7,6 +7,52 @@ export { BatchOptions, BatchResponse, DatabaseHandle, ExecuteOptions, ExecuteRes
7
7
  import { IEncryptionService, DecryptCapabilityProof } from './encryption/index.cjs';
8
8
  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';
9
9
 
10
+ type TinyCloudDebugLevel = "debug";
11
+ interface TinyCloudDebugEvent {
12
+ sequence: number;
13
+ timestamp: number;
14
+ timestampIso: string;
15
+ level: TinyCloudDebugLevel;
16
+ event: string;
17
+ message?: string;
18
+ data?: unknown;
19
+ durationMs?: number;
20
+ startedAt?: number;
21
+ endedAt?: number;
22
+ }
23
+ interface TinyCloudDebugEnableOptions {
24
+ /**
25
+ * Persist the debug flag in browser localStorage. Defaults to true.
26
+ * Node runtimes intentionally do not persist this setting.
27
+ */
28
+ persist?: boolean;
29
+ }
30
+ interface TinyCloudDebugTimer {
31
+ stop: (data?: unknown) => TinyCloudDebugEvent | undefined;
32
+ }
33
+ declare class TinyCloudDebugLogger {
34
+ private enabled;
35
+ private sequence;
36
+ private events;
37
+ private maxEvents;
38
+ isEnabled(): boolean;
39
+ enable(options?: TinyCloudDebugEnableOptions): void;
40
+ disable(options?: TinyCloudDebugEnableOptions): void;
41
+ clear(): void;
42
+ getLogs(): TinyCloudDebugEvent[];
43
+ log(event: string, data?: unknown, message?: string): TinyCloudDebugEvent | undefined;
44
+ startTimer(event: string, data?: unknown): TinyCloudDebugTimer;
45
+ timeAsync<T>(event: string, operation: () => Promise<T>, data?: unknown): Promise<T>;
46
+ time<T>(event: string, operation: () => T, data?: unknown): T;
47
+ private record;
48
+ }
49
+ declare const tinyCloudDebugLogger: TinyCloudDebugLogger;
50
+ declare function enableTinyCloudDebug(options?: TinyCloudDebugEnableOptions): TinyCloudDebugLogger;
51
+ declare function disableTinyCloudDebug(options?: TinyCloudDebugEnableOptions): TinyCloudDebugLogger;
52
+ declare function getTinyCloudDebugLogs(): TinyCloudDebugEvent[];
53
+ declare function clearTinyCloudDebugLogs(): void;
54
+ declare function installTinyCloudDebugGlobals(): void;
55
+
10
56
  /**
11
57
  * Zod schemas for SDK Services API response types.
12
58
  *
@@ -43,14 +89,14 @@ declare const ServiceErrorSchema: z.ZodObject<{
43
89
  /** Additional metadata about the error - passthrough allows any object properties */
44
90
  meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
45
91
  }, "strip", z.ZodTypeAny, {
46
- code: string;
47
92
  message: string;
93
+ code: string;
48
94
  service: string;
49
95
  cause?: unknown;
50
96
  meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
51
97
  }, {
52
- code: string;
53
98
  message: string;
99
+ code: string;
54
100
  service: string;
55
101
  cause?: unknown;
56
102
  meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -128,22 +174,22 @@ declare const GenericResultSchema: z.ZodDiscriminatedUnion<"ok", [z.ZodObject<{
128
174
  /** Additional metadata about the error - passthrough allows any object properties */
129
175
  meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
130
176
  }, "strip", z.ZodTypeAny, {
131
- code: string;
132
177
  message: string;
178
+ code: string;
133
179
  service: string;
134
180
  cause?: unknown;
135
181
  meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
136
182
  }, {
137
- code: string;
138
183
  message: string;
184
+ code: string;
139
185
  service: string;
140
186
  cause?: unknown;
141
187
  meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
142
188
  }>;
143
189
  }, "strip", z.ZodTypeAny, {
144
190
  error: {
145
- code: string;
146
191
  message: string;
192
+ code: string;
147
193
  service: string;
148
194
  cause?: unknown;
149
195
  meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -151,8 +197,8 @@ declare const GenericResultSchema: z.ZodDiscriminatedUnion<"ok", [z.ZodObject<{
151
197
  ok: false;
152
198
  }, {
153
199
  error: {
154
- code: string;
155
200
  message: string;
201
+ code: string;
156
202
  service: string;
157
203
  cause?: unknown;
158
204
  meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -420,15 +466,15 @@ declare const ServiceRequestEventSchema: z.ZodObject<{
420
466
  key: z.ZodOptional<z.ZodString>;
421
467
  timestamp: z.ZodNumber;
422
468
  }, "strip", z.ZodTypeAny, {
469
+ timestamp: number;
423
470
  service: string;
424
471
  action: string;
425
- timestamp: number;
426
472
  span?: string | undefined;
427
473
  key?: string | undefined;
428
474
  }, {
475
+ timestamp: number;
429
476
  service: string;
430
477
  action: string;
431
- timestamp: number;
432
478
  span?: string | undefined;
433
479
  key?: string | undefined;
434
480
  }>;
@@ -449,17 +495,17 @@ declare const ServiceResponseEventSchema: z.ZodObject<{
449
495
  ok: boolean;
450
496
  action: string;
451
497
  duration: number;
498
+ durationMs?: number | undefined;
452
499
  status?: number | undefined;
453
500
  span?: string | undefined;
454
- durationMs?: number | undefined;
455
501
  }, {
456
502
  service: string;
457
503
  ok: boolean;
458
504
  action: string;
459
505
  duration: number;
506
+ durationMs?: number | undefined;
460
507
  status?: number | undefined;
461
508
  span?: string | undefined;
462
- durationMs?: number | undefined;
463
509
  }>;
464
510
  type ServiceResponseEventType = z.infer<typeof ServiceResponseEventSchema>;
465
511
  /**
@@ -480,22 +526,22 @@ declare const ServiceErrorEventSchema: z.ZodObject<{
480
526
  /** Additional metadata about the error - passthrough allows any object properties */
481
527
  meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
482
528
  }, "strip", z.ZodTypeAny, {
483
- code: string;
484
529
  message: string;
530
+ code: string;
485
531
  service: string;
486
532
  cause?: unknown;
487
533
  meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
488
534
  }, {
489
- code: string;
490
535
  message: string;
536
+ code: string;
491
537
  service: string;
492
538
  cause?: unknown;
493
539
  meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
494
540
  }>;
495
541
  }, "strip", z.ZodTypeAny, {
496
542
  error: {
497
- code: string;
498
543
  message: string;
544
+ code: string;
499
545
  service: string;
500
546
  cause?: unknown;
501
547
  meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -504,8 +550,8 @@ declare const ServiceErrorEventSchema: z.ZodObject<{
504
550
  span?: string | undefined;
505
551
  }, {
506
552
  error: {
507
- code: string;
508
553
  message: string;
554
+ code: string;
509
555
  service: string;
510
556
  cause?: unknown;
511
557
  meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -533,22 +579,22 @@ declare const ServiceRetryEventSchema: z.ZodObject<{
533
579
  /** Additional metadata about the error - passthrough allows any object properties */
534
580
  meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
535
581
  }, "strip", z.ZodTypeAny, {
536
- code: string;
537
582
  message: string;
583
+ code: string;
538
584
  service: string;
539
585
  cause?: unknown;
540
586
  meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
541
587
  }, {
542
- code: string;
543
588
  message: string;
589
+ code: string;
544
590
  service: string;
545
591
  cause?: unknown;
546
592
  meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
547
593
  }>;
548
594
  }, "strip", z.ZodTypeAny, {
549
595
  error: {
550
- code: string;
551
596
  message: string;
597
+ code: string;
552
598
  service: string;
553
599
  cause?: unknown;
554
600
  meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -558,8 +604,8 @@ declare const ServiceRetryEventSchema: z.ZodObject<{
558
604
  maxAttempts: number;
559
605
  }, {
560
606
  error: {
561
- code: string;
562
607
  message: string;
608
+ code: string;
563
609
  service: string;
564
610
  cause?: unknown;
565
611
  meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -591,25 +637,25 @@ declare const TelemetrySpanEventSchema: z.ZodObject<{
591
637
  /** Additional metadata about the error - passthrough allows any object properties */
592
638
  meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
593
639
  }, "strip", z.ZodTypeAny, {
594
- code: string;
595
640
  message: string;
641
+ code: string;
596
642
  service: string;
597
643
  cause?: unknown;
598
644
  meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
599
645
  }, {
600
- code: string;
601
646
  message: string;
647
+ code: string;
602
648
  service: string;
603
649
  cause?: unknown;
604
650
  meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
605
651
  }>>;
606
652
  }, "strip", z.ZodTypeAny, {
653
+ durationMs: number;
607
654
  ok: boolean;
608
655
  span: string;
609
- durationMs: number;
610
656
  error?: {
611
- code: string;
612
657
  message: string;
658
+ code: string;
613
659
  service: string;
614
660
  cause?: unknown;
615
661
  meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -618,12 +664,12 @@ declare const TelemetrySpanEventSchema: z.ZodObject<{
618
664
  status?: number | undefined;
619
665
  action?: string | undefined;
620
666
  }, {
667
+ durationMs: number;
621
668
  ok: boolean;
622
669
  span: string;
623
- durationMs: number;
624
670
  error?: {
625
- code: string;
626
671
  message: string;
672
+ code: string;
627
673
  service: string;
628
674
  cause?: unknown;
629
675
  meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -954,6 +1000,9 @@ declare class ServiceContext implements IServiceContext {
954
1000
  * Get the retry policy configuration.
955
1001
  */
956
1002
  get retryPolicy(): RetryPolicy;
1003
+ private wrapInvoke;
1004
+ private wrapInvokeAny;
1005
+ private wrapFetch;
957
1006
  }
958
1007
 
959
1008
  /**
@@ -2099,4 +2148,4 @@ declare class SecretsService implements ISecretsService {
2099
2148
  list(options?: SecretScopeOptions): Promise<Result<string[], SecretsError>>;
2100
2149
  }
2101
2150
 
2102
- 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, 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, TinyCloudQuota, type ValidationError, type VaultCrypto, type VaultEntry, type VaultError, type VaultGetOptions, type VaultGrantOptions, VaultHeaders, type VaultListOptions, VaultPublicSpaceKVActions, type VaultPutOptions, type ViewInfo, type WasmVaultFunctions, abortedError, authExpiredError, authRequiredError, authUnauthorizedError, canonicalizeSecretScope, createKVResponseSchema, createResultSchema, createVaultCrypto, errorResult, networkError, notFoundError, parseAuthError, permissionDeniedError, resolveSecretListPrefix, resolveSecretPath, storageLimitReachedError, storageQuotaExceededError, timeoutError, validateKVListResponse, validateKVResponseHeaders, validateRetryPolicy, validateServiceError, validateServiceRequestEvent, validateServiceResponseEvent, validateServiceSession, validateTelemetrySpanEvent, wrapError };
2151
+ 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, 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, VaultPublicSpaceKVActions, type VaultPutOptions, type ViewInfo, type WasmVaultFunctions, abortedError, authExpiredError, authRequiredError, authUnauthorizedError, canonicalizeSecretScope, clearTinyCloudDebugLogs, createKVResponseSchema, createResultSchema, createVaultCrypto, disableTinyCloudDebug, enableTinyCloudDebug, errorResult, getTinyCloudDebugLogs, installTinyCloudDebugGlobals, networkError, notFoundError, parseAuthError, permissionDeniedError, resolveSecretListPrefix, resolveSecretPath, storageLimitReachedError, storageQuotaExceededError, timeoutError, tinyCloudDebugLogger, validateKVListResponse, validateKVResponseHeaders, validateRetryPolicy, validateServiceError, validateServiceRequestEvent, validateServiceResponseEvent, validateServiceSession, validateTelemetrySpanEvent, wrapError };
package/dist/index.d.ts CHANGED
@@ -7,6 +7,52 @@ export { BatchOptions, BatchResponse, DatabaseHandle, ExecuteOptions, ExecuteRes
7
7
  import { IEncryptionService, DecryptCapabilityProof } from './encryption/index.js';
8
8
  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';
9
9
 
10
+ type TinyCloudDebugLevel = "debug";
11
+ interface TinyCloudDebugEvent {
12
+ sequence: number;
13
+ timestamp: number;
14
+ timestampIso: string;
15
+ level: TinyCloudDebugLevel;
16
+ event: string;
17
+ message?: string;
18
+ data?: unknown;
19
+ durationMs?: number;
20
+ startedAt?: number;
21
+ endedAt?: number;
22
+ }
23
+ interface TinyCloudDebugEnableOptions {
24
+ /**
25
+ * Persist the debug flag in browser localStorage. Defaults to true.
26
+ * Node runtimes intentionally do not persist this setting.
27
+ */
28
+ persist?: boolean;
29
+ }
30
+ interface TinyCloudDebugTimer {
31
+ stop: (data?: unknown) => TinyCloudDebugEvent | undefined;
32
+ }
33
+ declare class TinyCloudDebugLogger {
34
+ private enabled;
35
+ private sequence;
36
+ private events;
37
+ private maxEvents;
38
+ isEnabled(): boolean;
39
+ enable(options?: TinyCloudDebugEnableOptions): void;
40
+ disable(options?: TinyCloudDebugEnableOptions): void;
41
+ clear(): void;
42
+ getLogs(): TinyCloudDebugEvent[];
43
+ log(event: string, data?: unknown, message?: string): TinyCloudDebugEvent | undefined;
44
+ startTimer(event: string, data?: unknown): TinyCloudDebugTimer;
45
+ timeAsync<T>(event: string, operation: () => Promise<T>, data?: unknown): Promise<T>;
46
+ time<T>(event: string, operation: () => T, data?: unknown): T;
47
+ private record;
48
+ }
49
+ declare const tinyCloudDebugLogger: TinyCloudDebugLogger;
50
+ declare function enableTinyCloudDebug(options?: TinyCloudDebugEnableOptions): TinyCloudDebugLogger;
51
+ declare function disableTinyCloudDebug(options?: TinyCloudDebugEnableOptions): TinyCloudDebugLogger;
52
+ declare function getTinyCloudDebugLogs(): TinyCloudDebugEvent[];
53
+ declare function clearTinyCloudDebugLogs(): void;
54
+ declare function installTinyCloudDebugGlobals(): void;
55
+
10
56
  /**
11
57
  * Zod schemas for SDK Services API response types.
12
58
  *
@@ -43,14 +89,14 @@ declare const ServiceErrorSchema: z.ZodObject<{
43
89
  /** Additional metadata about the error - passthrough allows any object properties */
44
90
  meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
45
91
  }, "strip", z.ZodTypeAny, {
46
- code: string;
47
92
  message: string;
93
+ code: string;
48
94
  service: string;
49
95
  cause?: unknown;
50
96
  meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
51
97
  }, {
52
- code: string;
53
98
  message: string;
99
+ code: string;
54
100
  service: string;
55
101
  cause?: unknown;
56
102
  meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -128,22 +174,22 @@ declare const GenericResultSchema: z.ZodDiscriminatedUnion<"ok", [z.ZodObject<{
128
174
  /** Additional metadata about the error - passthrough allows any object properties */
129
175
  meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
130
176
  }, "strip", z.ZodTypeAny, {
131
- code: string;
132
177
  message: string;
178
+ code: string;
133
179
  service: string;
134
180
  cause?: unknown;
135
181
  meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
136
182
  }, {
137
- code: string;
138
183
  message: string;
184
+ code: string;
139
185
  service: string;
140
186
  cause?: unknown;
141
187
  meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
142
188
  }>;
143
189
  }, "strip", z.ZodTypeAny, {
144
190
  error: {
145
- code: string;
146
191
  message: string;
192
+ code: string;
147
193
  service: string;
148
194
  cause?: unknown;
149
195
  meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -151,8 +197,8 @@ declare const GenericResultSchema: z.ZodDiscriminatedUnion<"ok", [z.ZodObject<{
151
197
  ok: false;
152
198
  }, {
153
199
  error: {
154
- code: string;
155
200
  message: string;
201
+ code: string;
156
202
  service: string;
157
203
  cause?: unknown;
158
204
  meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -420,15 +466,15 @@ declare const ServiceRequestEventSchema: z.ZodObject<{
420
466
  key: z.ZodOptional<z.ZodString>;
421
467
  timestamp: z.ZodNumber;
422
468
  }, "strip", z.ZodTypeAny, {
469
+ timestamp: number;
423
470
  service: string;
424
471
  action: string;
425
- timestamp: number;
426
472
  span?: string | undefined;
427
473
  key?: string | undefined;
428
474
  }, {
475
+ timestamp: number;
429
476
  service: string;
430
477
  action: string;
431
- timestamp: number;
432
478
  span?: string | undefined;
433
479
  key?: string | undefined;
434
480
  }>;
@@ -449,17 +495,17 @@ declare const ServiceResponseEventSchema: z.ZodObject<{
449
495
  ok: boolean;
450
496
  action: string;
451
497
  duration: number;
498
+ durationMs?: number | undefined;
452
499
  status?: number | undefined;
453
500
  span?: string | undefined;
454
- durationMs?: number | undefined;
455
501
  }, {
456
502
  service: string;
457
503
  ok: boolean;
458
504
  action: string;
459
505
  duration: number;
506
+ durationMs?: number | undefined;
460
507
  status?: number | undefined;
461
508
  span?: string | undefined;
462
- durationMs?: number | undefined;
463
509
  }>;
464
510
  type ServiceResponseEventType = z.infer<typeof ServiceResponseEventSchema>;
465
511
  /**
@@ -480,22 +526,22 @@ declare const ServiceErrorEventSchema: z.ZodObject<{
480
526
  /** Additional metadata about the error - passthrough allows any object properties */
481
527
  meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
482
528
  }, "strip", z.ZodTypeAny, {
483
- code: string;
484
529
  message: string;
530
+ code: string;
485
531
  service: string;
486
532
  cause?: unknown;
487
533
  meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
488
534
  }, {
489
- code: string;
490
535
  message: string;
536
+ code: string;
491
537
  service: string;
492
538
  cause?: unknown;
493
539
  meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
494
540
  }>;
495
541
  }, "strip", z.ZodTypeAny, {
496
542
  error: {
497
- code: string;
498
543
  message: string;
544
+ code: string;
499
545
  service: string;
500
546
  cause?: unknown;
501
547
  meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -504,8 +550,8 @@ declare const ServiceErrorEventSchema: z.ZodObject<{
504
550
  span?: string | undefined;
505
551
  }, {
506
552
  error: {
507
- code: string;
508
553
  message: string;
554
+ code: string;
509
555
  service: string;
510
556
  cause?: unknown;
511
557
  meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -533,22 +579,22 @@ declare const ServiceRetryEventSchema: z.ZodObject<{
533
579
  /** Additional metadata about the error - passthrough allows any object properties */
534
580
  meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
535
581
  }, "strip", z.ZodTypeAny, {
536
- code: string;
537
582
  message: string;
583
+ code: string;
538
584
  service: string;
539
585
  cause?: unknown;
540
586
  meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
541
587
  }, {
542
- code: string;
543
588
  message: string;
589
+ code: string;
544
590
  service: string;
545
591
  cause?: unknown;
546
592
  meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
547
593
  }>;
548
594
  }, "strip", z.ZodTypeAny, {
549
595
  error: {
550
- code: string;
551
596
  message: string;
597
+ code: string;
552
598
  service: string;
553
599
  cause?: unknown;
554
600
  meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -558,8 +604,8 @@ declare const ServiceRetryEventSchema: z.ZodObject<{
558
604
  maxAttempts: number;
559
605
  }, {
560
606
  error: {
561
- code: string;
562
607
  message: string;
608
+ code: string;
563
609
  service: string;
564
610
  cause?: unknown;
565
611
  meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -591,25 +637,25 @@ declare const TelemetrySpanEventSchema: z.ZodObject<{
591
637
  /** Additional metadata about the error - passthrough allows any object properties */
592
638
  meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
593
639
  }, "strip", z.ZodTypeAny, {
594
- code: string;
595
640
  message: string;
641
+ code: string;
596
642
  service: string;
597
643
  cause?: unknown;
598
644
  meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
599
645
  }, {
600
- code: string;
601
646
  message: string;
647
+ code: string;
602
648
  service: string;
603
649
  cause?: unknown;
604
650
  meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
605
651
  }>>;
606
652
  }, "strip", z.ZodTypeAny, {
653
+ durationMs: number;
607
654
  ok: boolean;
608
655
  span: string;
609
- durationMs: number;
610
656
  error?: {
611
- code: string;
612
657
  message: string;
658
+ code: string;
613
659
  service: string;
614
660
  cause?: unknown;
615
661
  meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -618,12 +664,12 @@ declare const TelemetrySpanEventSchema: z.ZodObject<{
618
664
  status?: number | undefined;
619
665
  action?: string | undefined;
620
666
  }, {
667
+ durationMs: number;
621
668
  ok: boolean;
622
669
  span: string;
623
- durationMs: number;
624
670
  error?: {
625
- code: string;
626
671
  message: string;
672
+ code: string;
627
673
  service: string;
628
674
  cause?: unknown;
629
675
  meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -954,6 +1000,9 @@ declare class ServiceContext implements IServiceContext {
954
1000
  * Get the retry policy configuration.
955
1001
  */
956
1002
  get retryPolicy(): RetryPolicy;
1003
+ private wrapInvoke;
1004
+ private wrapInvokeAny;
1005
+ private wrapFetch;
957
1006
  }
958
1007
 
959
1008
  /**
@@ -2099,4 +2148,4 @@ declare class SecretsService implements ISecretsService {
2099
2148
  list(options?: SecretScopeOptions): Promise<Result<string[], SecretsError>>;
2100
2149
  }
2101
2150
 
2102
- 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, 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, TinyCloudQuota, type ValidationError, type VaultCrypto, type VaultEntry, type VaultError, type VaultGetOptions, type VaultGrantOptions, VaultHeaders, type VaultListOptions, VaultPublicSpaceKVActions, type VaultPutOptions, type ViewInfo, type WasmVaultFunctions, abortedError, authExpiredError, authRequiredError, authUnauthorizedError, canonicalizeSecretScope, createKVResponseSchema, createResultSchema, createVaultCrypto, errorResult, networkError, notFoundError, parseAuthError, permissionDeniedError, resolveSecretListPrefix, resolveSecretPath, storageLimitReachedError, storageQuotaExceededError, timeoutError, validateKVListResponse, validateKVResponseHeaders, validateRetryPolicy, validateServiceError, validateServiceRequestEvent, validateServiceResponseEvent, validateServiceSession, validateTelemetrySpanEvent, wrapError };
2151
+ 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, 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, VaultPublicSpaceKVActions, type VaultPutOptions, type ViewInfo, type WasmVaultFunctions, abortedError, authExpiredError, authRequiredError, authUnauthorizedError, canonicalizeSecretScope, clearTinyCloudDebugLogs, createKVResponseSchema, createResultSchema, createVaultCrypto, disableTinyCloudDebug, enableTinyCloudDebug, errorResult, getTinyCloudDebugLogs, installTinyCloudDebugGlobals, networkError, notFoundError, parseAuthError, permissionDeniedError, resolveSecretListPrefix, resolveSecretPath, storageLimitReachedError, storageQuotaExceededError, timeoutError, tinyCloudDebugLogger, validateKVListResponse, validateKVResponseHeaders, validateRetryPolicy, validateServiceError, validateServiceRequestEvent, validateServiceResponseEvent, validateServiceSession, validateTelemetrySpanEvent, wrapError };