@tinycloud/sdk-services 3.2.0-beta.2 → 3.2.0-beta.5
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/{BaseService-DWbPbov7.d.cts → BaseService-BDQXjWMx.d.cts} +1 -1
- package/dist/{BaseService-B_UKhVht.d.ts → BaseService-Di_hVfUV.d.ts} +1 -1
- package/dist/encryption/index.cjs +7 -1
- package/dist/encryption/index.cjs.map +1 -1
- package/dist/encryption/index.d.cts +2 -2
- package/dist/encryption/index.d.ts +2 -2
- package/dist/encryption/index.js +7 -1
- package/dist/encryption/index.js.map +1 -1
- package/dist/index.cjs +605 -357
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +37 -26
- package/dist/index.d.ts +37 -26
- package/dist/index.js +600 -357
- package/dist/index.js.map +1 -1
- package/dist/internal/decrypt-transport-response-error.d.cts +1 -1
- package/dist/internal/decrypt-transport-response-error.d.ts +1 -1
- package/dist/kv/index.cjs +540 -338
- package/dist/kv/index.cjs.map +1 -1
- package/dist/kv/index.d.cts +18 -468
- package/dist/kv/index.d.ts +18 -468
- package/dist/kv/index.js +534 -337
- package/dist/kv/index.js.map +1 -1
- package/dist/kv/replication/index.cjs +1398 -0
- package/dist/kv/replication/index.cjs.map +1 -0
- package/dist/kv/replication/index.d.cts +10 -0
- package/dist/kv/replication/index.d.ts +10 -0
- package/dist/kv/replication/index.js +1365 -0
- package/dist/kv/replication/index.js.map +1 -0
- package/dist/kv/replication/prefix.cjs +43 -0
- package/dist/kv/replication/prefix.cjs.map +1 -0
- package/dist/kv/replication/prefix.d.cts +6 -0
- package/dist/kv/replication/prefix.d.ts +6 -0
- package/dist/kv/replication/prefix.js +17 -0
- package/dist/kv/replication/prefix.js.map +1 -0
- package/dist/scope-BKge7zDT.d.ts +957 -0
- package/dist/scope-C05VVAXH.d.cts +957 -0
- package/dist/sql/index.cjs +12 -6
- package/dist/sql/index.cjs.map +1 -1
- package/dist/sql/index.d.cts +2 -2
- package/dist/sql/index.d.ts +2 -2
- package/dist/sql/index.js +12 -6
- package/dist/sql/index.js.map +1 -1
- package/dist/{types-CVwwxqXF.d.cts → types-7A5rHWRY.d.cts} +10 -1
- package/dist/{types-CVwwxqXF.d.ts → types-7A5rHWRY.d.ts} +10 -1
- package/package.json +31 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,14 +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-
|
|
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-
|
|
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';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { B as BaseService } from './BaseService-
|
|
5
|
-
export { a as BaseServiceOptions, R as RequestSignal, S as ServiceConstructor, b as ServiceRegistration } from './BaseService-
|
|
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';
|
|
6
6
|
import { IKVService } from './kv/index.cjs';
|
|
7
|
-
export {
|
|
7
|
+
export { IPrefixedKVService, KVService, PrefixedKVService } from './kv/index.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-C05VVAXH.cjs';
|
|
8
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';
|
|
9
10
|
import { IEncryptionService, DecryptCapabilityProof } from './encryption/index.cjs';
|
|
10
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';
|
|
11
12
|
export { DecryptTransportResponseError } from '@tinycloud/sdk-services/internal/decrypt-transport-response-error';
|
|
13
|
+
export { kvPrefixCovers } from './kv/replication/prefix.cjs';
|
|
12
14
|
|
|
13
15
|
type TinyCloudDebugLevel = "debug";
|
|
14
16
|
interface TinyCloudDebugEvent {
|
|
@@ -92,14 +94,14 @@ declare const ServiceErrorSchema: z.ZodObject<{
|
|
|
92
94
|
/** Additional metadata about the error - passthrough allows any object properties */
|
|
93
95
|
meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
94
96
|
}, "strip", z.ZodTypeAny, {
|
|
95
|
-
message: string;
|
|
96
97
|
code: string;
|
|
98
|
+
message: string;
|
|
97
99
|
service: string;
|
|
98
100
|
cause?: unknown;
|
|
99
101
|
meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
100
102
|
}, {
|
|
101
|
-
message: string;
|
|
102
103
|
code: string;
|
|
104
|
+
message: string;
|
|
103
105
|
service: string;
|
|
104
106
|
cause?: unknown;
|
|
105
107
|
meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -177,22 +179,22 @@ declare const GenericResultSchema: z.ZodDiscriminatedUnion<"ok", [z.ZodObject<{
|
|
|
177
179
|
/** Additional metadata about the error - passthrough allows any object properties */
|
|
178
180
|
meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
179
181
|
}, "strip", z.ZodTypeAny, {
|
|
180
|
-
message: string;
|
|
181
182
|
code: string;
|
|
183
|
+
message: string;
|
|
182
184
|
service: string;
|
|
183
185
|
cause?: unknown;
|
|
184
186
|
meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
185
187
|
}, {
|
|
186
|
-
message: string;
|
|
187
188
|
code: string;
|
|
189
|
+
message: string;
|
|
188
190
|
service: string;
|
|
189
191
|
cause?: unknown;
|
|
190
192
|
meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
191
193
|
}>;
|
|
192
194
|
}, "strip", z.ZodTypeAny, {
|
|
193
195
|
error: {
|
|
194
|
-
message: string;
|
|
195
196
|
code: string;
|
|
197
|
+
message: string;
|
|
196
198
|
service: string;
|
|
197
199
|
cause?: unknown;
|
|
198
200
|
meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -200,8 +202,8 @@ declare const GenericResultSchema: z.ZodDiscriminatedUnion<"ok", [z.ZodObject<{
|
|
|
200
202
|
ok: false;
|
|
201
203
|
}, {
|
|
202
204
|
error: {
|
|
203
|
-
message: string;
|
|
204
205
|
code: string;
|
|
206
|
+
message: string;
|
|
205
207
|
service: string;
|
|
206
208
|
cause?: unknown;
|
|
207
209
|
meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -488,14 +490,14 @@ declare const ServiceRequestEventSchema: z.ZodObject<{
|
|
|
488
490
|
timestamp: number;
|
|
489
491
|
service: string;
|
|
490
492
|
action: string;
|
|
491
|
-
span?: string | undefined;
|
|
492
493
|
key?: string | undefined;
|
|
494
|
+
span?: string | undefined;
|
|
493
495
|
}, {
|
|
494
496
|
timestamp: number;
|
|
495
497
|
service: string;
|
|
496
498
|
action: string;
|
|
497
|
-
span?: string | undefined;
|
|
498
499
|
key?: string | undefined;
|
|
500
|
+
span?: string | undefined;
|
|
499
501
|
}>;
|
|
500
502
|
type ServiceRequestEventType = z.infer<typeof ServiceRequestEventSchema>;
|
|
501
503
|
/**
|
|
@@ -545,22 +547,22 @@ declare const ServiceErrorEventSchema: z.ZodObject<{
|
|
|
545
547
|
/** Additional metadata about the error - passthrough allows any object properties */
|
|
546
548
|
meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
547
549
|
}, "strip", z.ZodTypeAny, {
|
|
548
|
-
message: string;
|
|
549
550
|
code: string;
|
|
551
|
+
message: string;
|
|
550
552
|
service: string;
|
|
551
553
|
cause?: unknown;
|
|
552
554
|
meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
553
555
|
}, {
|
|
554
|
-
message: string;
|
|
555
556
|
code: string;
|
|
557
|
+
message: string;
|
|
556
558
|
service: string;
|
|
557
559
|
cause?: unknown;
|
|
558
560
|
meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
559
561
|
}>;
|
|
560
562
|
}, "strip", z.ZodTypeAny, {
|
|
561
563
|
error: {
|
|
562
|
-
message: string;
|
|
563
564
|
code: string;
|
|
565
|
+
message: string;
|
|
564
566
|
service: string;
|
|
565
567
|
cause?: unknown;
|
|
566
568
|
meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -569,8 +571,8 @@ declare const ServiceErrorEventSchema: z.ZodObject<{
|
|
|
569
571
|
span?: string | undefined;
|
|
570
572
|
}, {
|
|
571
573
|
error: {
|
|
572
|
-
message: string;
|
|
573
574
|
code: string;
|
|
575
|
+
message: string;
|
|
574
576
|
service: string;
|
|
575
577
|
cause?: unknown;
|
|
576
578
|
meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -598,22 +600,22 @@ declare const ServiceRetryEventSchema: z.ZodObject<{
|
|
|
598
600
|
/** Additional metadata about the error - passthrough allows any object properties */
|
|
599
601
|
meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
600
602
|
}, "strip", z.ZodTypeAny, {
|
|
601
|
-
message: string;
|
|
602
603
|
code: string;
|
|
604
|
+
message: string;
|
|
603
605
|
service: string;
|
|
604
606
|
cause?: unknown;
|
|
605
607
|
meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
606
608
|
}, {
|
|
607
|
-
message: string;
|
|
608
609
|
code: string;
|
|
610
|
+
message: string;
|
|
609
611
|
service: string;
|
|
610
612
|
cause?: unknown;
|
|
611
613
|
meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
612
614
|
}>;
|
|
613
615
|
}, "strip", z.ZodTypeAny, {
|
|
614
616
|
error: {
|
|
615
|
-
message: string;
|
|
616
617
|
code: string;
|
|
618
|
+
message: string;
|
|
617
619
|
service: string;
|
|
618
620
|
cause?: unknown;
|
|
619
621
|
meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -623,8 +625,8 @@ declare const ServiceRetryEventSchema: z.ZodObject<{
|
|
|
623
625
|
maxAttempts: number;
|
|
624
626
|
}, {
|
|
625
627
|
error: {
|
|
626
|
-
message: string;
|
|
627
628
|
code: string;
|
|
629
|
+
message: string;
|
|
628
630
|
service: string;
|
|
629
631
|
cause?: unknown;
|
|
630
632
|
meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -656,14 +658,14 @@ declare const TelemetrySpanEventSchema: z.ZodObject<{
|
|
|
656
658
|
/** Additional metadata about the error - passthrough allows any object properties */
|
|
657
659
|
meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
658
660
|
}, "strip", z.ZodTypeAny, {
|
|
659
|
-
message: string;
|
|
660
661
|
code: string;
|
|
662
|
+
message: string;
|
|
661
663
|
service: string;
|
|
662
664
|
cause?: unknown;
|
|
663
665
|
meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
664
666
|
}, {
|
|
665
|
-
message: string;
|
|
666
667
|
code: string;
|
|
668
|
+
message: string;
|
|
667
669
|
service: string;
|
|
668
670
|
cause?: unknown;
|
|
669
671
|
meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -673,8 +675,8 @@ declare const TelemetrySpanEventSchema: z.ZodObject<{
|
|
|
673
675
|
ok: boolean;
|
|
674
676
|
span: string;
|
|
675
677
|
error?: {
|
|
676
|
-
message: string;
|
|
677
678
|
code: string;
|
|
679
|
+
message: string;
|
|
678
680
|
service: string;
|
|
679
681
|
cause?: unknown;
|
|
680
682
|
meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -687,8 +689,8 @@ declare const TelemetrySpanEventSchema: z.ZodObject<{
|
|
|
687
689
|
ok: boolean;
|
|
688
690
|
span: string;
|
|
689
691
|
error?: {
|
|
690
|
-
message: string;
|
|
691
692
|
code: string;
|
|
693
|
+
message: string;
|
|
692
694
|
service: string;
|
|
693
695
|
cause?: unknown;
|
|
694
696
|
meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -923,6 +925,7 @@ declare class ServiceContext implements IServiceContext {
|
|
|
923
925
|
private _services;
|
|
924
926
|
private _eventHandlers;
|
|
925
927
|
private _abortController;
|
|
928
|
+
private _operationAbortSignal?;
|
|
926
929
|
private _retired;
|
|
927
930
|
private readonly _invoke;
|
|
928
931
|
private readonly _invokeAny?;
|
|
@@ -1007,6 +1010,8 @@ declare class ServiceContext implements IServiceContext {
|
|
|
1007
1010
|
* Get the abort signal for cancelling operations.
|
|
1008
1011
|
*/
|
|
1009
1012
|
get abortSignal(): AbortSignal;
|
|
1013
|
+
get operationAbortSignal(): AbortSignal | undefined;
|
|
1014
|
+
setOperationAbortSignal(signal: AbortSignal | undefined): void;
|
|
1010
1015
|
/**
|
|
1011
1016
|
* Permanently retire this graph after its owner installs a replacement.
|
|
1012
1017
|
* Unlike `abort()`, retirement never creates a fresh controller, so captured
|
|
@@ -1722,10 +1727,13 @@ interface VaultGetOptions<T = unknown> {
|
|
|
1722
1727
|
deserialize?: (data: Uint8Array) => T;
|
|
1723
1728
|
/** Return raw decrypted bytes without deserialization */
|
|
1724
1729
|
raw?: boolean;
|
|
1730
|
+
/** Force the underlying KV read to bypass replica read-through. */
|
|
1731
|
+
source?: "network";
|
|
1725
1732
|
/** Delegated KV service for reading from the grantor's space (used by getShared) */
|
|
1726
1733
|
kv?: {
|
|
1727
1734
|
get<V>(key: string, options?: {
|
|
1728
1735
|
raw?: boolean;
|
|
1736
|
+
source?: "network";
|
|
1729
1737
|
}): Promise<{
|
|
1730
1738
|
ok: boolean;
|
|
1731
1739
|
data?: {
|
|
@@ -1743,8 +1751,9 @@ interface VaultGetOptions<T = unknown> {
|
|
|
1743
1751
|
interface VaultListOptions {
|
|
1744
1752
|
/** Prefix filter for key names */
|
|
1745
1753
|
prefix?: string;
|
|
1746
|
-
/** Remove prefix from returned keys */
|
|
1747
1754
|
removePrefix?: boolean;
|
|
1755
|
+
/** Force the underlying KV list to bypass replica read-through. */
|
|
1756
|
+
source?: "network";
|
|
1748
1757
|
/** Maximum number of keys to return. */
|
|
1749
1758
|
limit?: number;
|
|
1750
1759
|
/** Opaque cursor returned by a prior bounded page. */
|
|
@@ -2343,6 +2352,8 @@ declare const SECRET_NAME_RE: RegExp;
|
|
|
2343
2352
|
interface SecretScopeOptions {
|
|
2344
2353
|
/** Optional logical scope. Omit for the global secret namespace. */
|
|
2345
2354
|
scope?: string;
|
|
2355
|
+
/** Bypass replication for existence-sensitive reads. */
|
|
2356
|
+
source?: "network";
|
|
2346
2357
|
}
|
|
2347
2358
|
/** Canonical secret scope grammar shared with the TC-832 `/request` link. */
|
|
2348
2359
|
declare const SECRET_SCOPE_RE: RegExp;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +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-
|
|
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-
|
|
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';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { B as BaseService } from './BaseService-
|
|
5
|
-
export { a as BaseServiceOptions, R as RequestSignal, S as ServiceConstructor, b as ServiceRegistration } from './BaseService-
|
|
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';
|
|
6
6
|
import { IKVService } from './kv/index.js';
|
|
7
|
-
export {
|
|
7
|
+
export { IPrefixedKVService, KVService, PrefixedKVService } from './kv/index.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-BKge7zDT.js';
|
|
8
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';
|
|
9
10
|
import { IEncryptionService, DecryptCapabilityProof } from './encryption/index.js';
|
|
10
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';
|
|
11
12
|
export { DecryptTransportResponseError } from '@tinycloud/sdk-services/internal/decrypt-transport-response-error';
|
|
13
|
+
export { kvPrefixCovers } from './kv/replication/prefix.js';
|
|
12
14
|
|
|
13
15
|
type TinyCloudDebugLevel = "debug";
|
|
14
16
|
interface TinyCloudDebugEvent {
|
|
@@ -92,14 +94,14 @@ declare const ServiceErrorSchema: z.ZodObject<{
|
|
|
92
94
|
/** Additional metadata about the error - passthrough allows any object properties */
|
|
93
95
|
meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
94
96
|
}, "strip", z.ZodTypeAny, {
|
|
95
|
-
message: string;
|
|
96
97
|
code: string;
|
|
98
|
+
message: string;
|
|
97
99
|
service: string;
|
|
98
100
|
cause?: unknown;
|
|
99
101
|
meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
100
102
|
}, {
|
|
101
|
-
message: string;
|
|
102
103
|
code: string;
|
|
104
|
+
message: string;
|
|
103
105
|
service: string;
|
|
104
106
|
cause?: unknown;
|
|
105
107
|
meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -177,22 +179,22 @@ declare const GenericResultSchema: z.ZodDiscriminatedUnion<"ok", [z.ZodObject<{
|
|
|
177
179
|
/** Additional metadata about the error - passthrough allows any object properties */
|
|
178
180
|
meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
179
181
|
}, "strip", z.ZodTypeAny, {
|
|
180
|
-
message: string;
|
|
181
182
|
code: string;
|
|
183
|
+
message: string;
|
|
182
184
|
service: string;
|
|
183
185
|
cause?: unknown;
|
|
184
186
|
meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
185
187
|
}, {
|
|
186
|
-
message: string;
|
|
187
188
|
code: string;
|
|
189
|
+
message: string;
|
|
188
190
|
service: string;
|
|
189
191
|
cause?: unknown;
|
|
190
192
|
meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
191
193
|
}>;
|
|
192
194
|
}, "strip", z.ZodTypeAny, {
|
|
193
195
|
error: {
|
|
194
|
-
message: string;
|
|
195
196
|
code: string;
|
|
197
|
+
message: string;
|
|
196
198
|
service: string;
|
|
197
199
|
cause?: unknown;
|
|
198
200
|
meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -200,8 +202,8 @@ declare const GenericResultSchema: z.ZodDiscriminatedUnion<"ok", [z.ZodObject<{
|
|
|
200
202
|
ok: false;
|
|
201
203
|
}, {
|
|
202
204
|
error: {
|
|
203
|
-
message: string;
|
|
204
205
|
code: string;
|
|
206
|
+
message: string;
|
|
205
207
|
service: string;
|
|
206
208
|
cause?: unknown;
|
|
207
209
|
meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -488,14 +490,14 @@ declare const ServiceRequestEventSchema: z.ZodObject<{
|
|
|
488
490
|
timestamp: number;
|
|
489
491
|
service: string;
|
|
490
492
|
action: string;
|
|
491
|
-
span?: string | undefined;
|
|
492
493
|
key?: string | undefined;
|
|
494
|
+
span?: string | undefined;
|
|
493
495
|
}, {
|
|
494
496
|
timestamp: number;
|
|
495
497
|
service: string;
|
|
496
498
|
action: string;
|
|
497
|
-
span?: string | undefined;
|
|
498
499
|
key?: string | undefined;
|
|
500
|
+
span?: string | undefined;
|
|
499
501
|
}>;
|
|
500
502
|
type ServiceRequestEventType = z.infer<typeof ServiceRequestEventSchema>;
|
|
501
503
|
/**
|
|
@@ -545,22 +547,22 @@ declare const ServiceErrorEventSchema: z.ZodObject<{
|
|
|
545
547
|
/** Additional metadata about the error - passthrough allows any object properties */
|
|
546
548
|
meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
547
549
|
}, "strip", z.ZodTypeAny, {
|
|
548
|
-
message: string;
|
|
549
550
|
code: string;
|
|
551
|
+
message: string;
|
|
550
552
|
service: string;
|
|
551
553
|
cause?: unknown;
|
|
552
554
|
meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
553
555
|
}, {
|
|
554
|
-
message: string;
|
|
555
556
|
code: string;
|
|
557
|
+
message: string;
|
|
556
558
|
service: string;
|
|
557
559
|
cause?: unknown;
|
|
558
560
|
meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
559
561
|
}>;
|
|
560
562
|
}, "strip", z.ZodTypeAny, {
|
|
561
563
|
error: {
|
|
562
|
-
message: string;
|
|
563
564
|
code: string;
|
|
565
|
+
message: string;
|
|
564
566
|
service: string;
|
|
565
567
|
cause?: unknown;
|
|
566
568
|
meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -569,8 +571,8 @@ declare const ServiceErrorEventSchema: z.ZodObject<{
|
|
|
569
571
|
span?: string | undefined;
|
|
570
572
|
}, {
|
|
571
573
|
error: {
|
|
572
|
-
message: string;
|
|
573
574
|
code: string;
|
|
575
|
+
message: string;
|
|
574
576
|
service: string;
|
|
575
577
|
cause?: unknown;
|
|
576
578
|
meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -598,22 +600,22 @@ declare const ServiceRetryEventSchema: z.ZodObject<{
|
|
|
598
600
|
/** Additional metadata about the error - passthrough allows any object properties */
|
|
599
601
|
meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
600
602
|
}, "strip", z.ZodTypeAny, {
|
|
601
|
-
message: string;
|
|
602
603
|
code: string;
|
|
604
|
+
message: string;
|
|
603
605
|
service: string;
|
|
604
606
|
cause?: unknown;
|
|
605
607
|
meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
606
608
|
}, {
|
|
607
|
-
message: string;
|
|
608
609
|
code: string;
|
|
610
|
+
message: string;
|
|
609
611
|
service: string;
|
|
610
612
|
cause?: unknown;
|
|
611
613
|
meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
612
614
|
}>;
|
|
613
615
|
}, "strip", z.ZodTypeAny, {
|
|
614
616
|
error: {
|
|
615
|
-
message: string;
|
|
616
617
|
code: string;
|
|
618
|
+
message: string;
|
|
617
619
|
service: string;
|
|
618
620
|
cause?: unknown;
|
|
619
621
|
meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -623,8 +625,8 @@ declare const ServiceRetryEventSchema: z.ZodObject<{
|
|
|
623
625
|
maxAttempts: number;
|
|
624
626
|
}, {
|
|
625
627
|
error: {
|
|
626
|
-
message: string;
|
|
627
628
|
code: string;
|
|
629
|
+
message: string;
|
|
628
630
|
service: string;
|
|
629
631
|
cause?: unknown;
|
|
630
632
|
meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -656,14 +658,14 @@ declare const TelemetrySpanEventSchema: z.ZodObject<{
|
|
|
656
658
|
/** Additional metadata about the error - passthrough allows any object properties */
|
|
657
659
|
meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
658
660
|
}, "strip", z.ZodTypeAny, {
|
|
659
|
-
message: string;
|
|
660
661
|
code: string;
|
|
662
|
+
message: string;
|
|
661
663
|
service: string;
|
|
662
664
|
cause?: unknown;
|
|
663
665
|
meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
664
666
|
}, {
|
|
665
|
-
message: string;
|
|
666
667
|
code: string;
|
|
668
|
+
message: string;
|
|
667
669
|
service: string;
|
|
668
670
|
cause?: unknown;
|
|
669
671
|
meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -673,8 +675,8 @@ declare const TelemetrySpanEventSchema: z.ZodObject<{
|
|
|
673
675
|
ok: boolean;
|
|
674
676
|
span: string;
|
|
675
677
|
error?: {
|
|
676
|
-
message: string;
|
|
677
678
|
code: string;
|
|
679
|
+
message: string;
|
|
678
680
|
service: string;
|
|
679
681
|
cause?: unknown;
|
|
680
682
|
meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -687,8 +689,8 @@ declare const TelemetrySpanEventSchema: z.ZodObject<{
|
|
|
687
689
|
ok: boolean;
|
|
688
690
|
span: string;
|
|
689
691
|
error?: {
|
|
690
|
-
message: string;
|
|
691
692
|
code: string;
|
|
693
|
+
message: string;
|
|
692
694
|
service: string;
|
|
693
695
|
cause?: unknown;
|
|
694
696
|
meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -923,6 +925,7 @@ declare class ServiceContext implements IServiceContext {
|
|
|
923
925
|
private _services;
|
|
924
926
|
private _eventHandlers;
|
|
925
927
|
private _abortController;
|
|
928
|
+
private _operationAbortSignal?;
|
|
926
929
|
private _retired;
|
|
927
930
|
private readonly _invoke;
|
|
928
931
|
private readonly _invokeAny?;
|
|
@@ -1007,6 +1010,8 @@ declare class ServiceContext implements IServiceContext {
|
|
|
1007
1010
|
* Get the abort signal for cancelling operations.
|
|
1008
1011
|
*/
|
|
1009
1012
|
get abortSignal(): AbortSignal;
|
|
1013
|
+
get operationAbortSignal(): AbortSignal | undefined;
|
|
1014
|
+
setOperationAbortSignal(signal: AbortSignal | undefined): void;
|
|
1010
1015
|
/**
|
|
1011
1016
|
* Permanently retire this graph after its owner installs a replacement.
|
|
1012
1017
|
* Unlike `abort()`, retirement never creates a fresh controller, so captured
|
|
@@ -1722,10 +1727,13 @@ interface VaultGetOptions<T = unknown> {
|
|
|
1722
1727
|
deserialize?: (data: Uint8Array) => T;
|
|
1723
1728
|
/** Return raw decrypted bytes without deserialization */
|
|
1724
1729
|
raw?: boolean;
|
|
1730
|
+
/** Force the underlying KV read to bypass replica read-through. */
|
|
1731
|
+
source?: "network";
|
|
1725
1732
|
/** Delegated KV service for reading from the grantor's space (used by getShared) */
|
|
1726
1733
|
kv?: {
|
|
1727
1734
|
get<V>(key: string, options?: {
|
|
1728
1735
|
raw?: boolean;
|
|
1736
|
+
source?: "network";
|
|
1729
1737
|
}): Promise<{
|
|
1730
1738
|
ok: boolean;
|
|
1731
1739
|
data?: {
|
|
@@ -1743,8 +1751,9 @@ interface VaultGetOptions<T = unknown> {
|
|
|
1743
1751
|
interface VaultListOptions {
|
|
1744
1752
|
/** Prefix filter for key names */
|
|
1745
1753
|
prefix?: string;
|
|
1746
|
-
/** Remove prefix from returned keys */
|
|
1747
1754
|
removePrefix?: boolean;
|
|
1755
|
+
/** Force the underlying KV list to bypass replica read-through. */
|
|
1756
|
+
source?: "network";
|
|
1748
1757
|
/** Maximum number of keys to return. */
|
|
1749
1758
|
limit?: number;
|
|
1750
1759
|
/** Opaque cursor returned by a prior bounded page. */
|
|
@@ -2343,6 +2352,8 @@ declare const SECRET_NAME_RE: RegExp;
|
|
|
2343
2352
|
interface SecretScopeOptions {
|
|
2344
2353
|
/** Optional logical scope. Omit for the global secret namespace. */
|
|
2345
2354
|
scope?: string;
|
|
2355
|
+
/** Bypass replication for existence-sensitive reads. */
|
|
2356
|
+
source?: "network";
|
|
2346
2357
|
}
|
|
2347
2358
|
/** Canonical secret scope grammar shared with the TC-832 `/request` link. */
|
|
2348
2359
|
declare const SECRET_SCOPE_RE: RegExp;
|