@tinycloud/sdk-services 3.1.0 → 3.2.0-beta.3
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 +683 -362
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +81 -29
- package/dist/index.d.ts +81 -29
- package/dist/index.js +674 -362
- 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 +532 -336
- package/dist/kv/index.cjs.map +1 -1
- package/dist/kv/index.d.cts +17 -468
- package/dist/kv/index.d.ts +17 -468
- package/dist/kv/index.js +526 -335
- package/dist/kv/index.js.map +1 -1
- package/dist/kv/replication/index.cjs +1375 -0
- package/dist/kv/replication/index.cjs.map +1 -0
- package/dist/kv/replication/index.d.cts +9 -0
- package/dist/kv/replication/index.d.ts +9 -0
- package/dist/kv/replication/index.js +1342 -0
- package/dist/kv/replication/index.js.map +1 -0
- package/dist/scope-BmLxwyl-.d.ts +957 -0
- package/dist/scope-D855kRDx.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 +18 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
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, I as DEFAULT_SIGNED_READ_URL_EXPIRY_MS, J as KVAction, M as KVActionType, N as KVBatchPutItem, O as KVBatchPutOptions, Q as KVBatchPutResponse, S as KVBatchReadResponse, T as KVChange, U as KVChangesAuthority, V as KVChangesOptions, W as KVChangesResponse, X as KVCreateSignedReadUrlOptions, Y as KVDeleteOptions, Z as KVGetOptions, _ as KVHeadOptions, $ as KVListOptions, b as KVListPage, a0 as KVListResponse, a1 as KVPutOptions, c as KVReadThrough, d as KVReplicaHandle, e as KVReplicaSpec, f as KVReplicaStorage, a as KVReplicationController, K as KVReplicationDeps, a2 as KVResponse, a3 as KVResponseHeaders, a4 as KVServiceConfig, a5 as KVSignedReadUrlResponse, L as LocalGetResult, g as LocalListResult, h as LocalReadMeta, i as LocalReplicaStatus, j as LocalSyncResult, k as PendingWriteRecord, l as PendingWriteState, P as PendingWriteStore, m as PinnedKey, n as PurgeTarget, o as ReplicaAuthorityState, p as ReplicaCoverage, q as ReplicaDevice, r as ReplicaGrantInfo, s as ReplicaState, t as ReplicaStatusEntry, u as ReplicationAuthority, v as ReplicationControl, w as ReplicationEvent, R as ReplicationIdentity, x as ReplicationOptions, y as ReplicationPurgeReport, z as ReplicationReason, B as ReplicationScheduler, D as ResolvedReplicationOptions, E as canonicalReplicationIdentity, F as kvPrefixCovers, G as replicationIdentityKey, H as requiresSecretsOptIn } from './scope-BmLxwyl-.js';
|
|
8
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';
|
|
@@ -92,14 +93,14 @@ declare const ServiceErrorSchema: z.ZodObject<{
|
|
|
92
93
|
/** Additional metadata about the error - passthrough allows any object properties */
|
|
93
94
|
meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
94
95
|
}, "strip", z.ZodTypeAny, {
|
|
95
|
-
message: string;
|
|
96
96
|
code: string;
|
|
97
|
+
message: string;
|
|
97
98
|
service: string;
|
|
98
99
|
cause?: unknown;
|
|
99
100
|
meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
100
101
|
}, {
|
|
101
|
-
message: string;
|
|
102
102
|
code: string;
|
|
103
|
+
message: string;
|
|
103
104
|
service: string;
|
|
104
105
|
cause?: unknown;
|
|
105
106
|
meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -177,22 +178,22 @@ declare const GenericResultSchema: z.ZodDiscriminatedUnion<"ok", [z.ZodObject<{
|
|
|
177
178
|
/** Additional metadata about the error - passthrough allows any object properties */
|
|
178
179
|
meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
179
180
|
}, "strip", z.ZodTypeAny, {
|
|
180
|
-
message: string;
|
|
181
181
|
code: string;
|
|
182
|
+
message: string;
|
|
182
183
|
service: string;
|
|
183
184
|
cause?: unknown;
|
|
184
185
|
meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
185
186
|
}, {
|
|
186
|
-
message: string;
|
|
187
187
|
code: string;
|
|
188
|
+
message: string;
|
|
188
189
|
service: string;
|
|
189
190
|
cause?: unknown;
|
|
190
191
|
meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
191
192
|
}>;
|
|
192
193
|
}, "strip", z.ZodTypeAny, {
|
|
193
194
|
error: {
|
|
194
|
-
message: string;
|
|
195
195
|
code: string;
|
|
196
|
+
message: string;
|
|
196
197
|
service: string;
|
|
197
198
|
cause?: unknown;
|
|
198
199
|
meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -200,8 +201,8 @@ declare const GenericResultSchema: z.ZodDiscriminatedUnion<"ok", [z.ZodObject<{
|
|
|
200
201
|
ok: false;
|
|
201
202
|
}, {
|
|
202
203
|
error: {
|
|
203
|
-
message: string;
|
|
204
204
|
code: string;
|
|
205
|
+
message: string;
|
|
205
206
|
service: string;
|
|
206
207
|
cause?: unknown;
|
|
207
208
|
meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -488,14 +489,14 @@ declare const ServiceRequestEventSchema: z.ZodObject<{
|
|
|
488
489
|
timestamp: number;
|
|
489
490
|
service: string;
|
|
490
491
|
action: string;
|
|
491
|
-
span?: string | undefined;
|
|
492
492
|
key?: string | undefined;
|
|
493
|
+
span?: string | undefined;
|
|
493
494
|
}, {
|
|
494
495
|
timestamp: number;
|
|
495
496
|
service: string;
|
|
496
497
|
action: string;
|
|
497
|
-
span?: string | undefined;
|
|
498
498
|
key?: string | undefined;
|
|
499
|
+
span?: string | undefined;
|
|
499
500
|
}>;
|
|
500
501
|
type ServiceRequestEventType = z.infer<typeof ServiceRequestEventSchema>;
|
|
501
502
|
/**
|
|
@@ -545,22 +546,22 @@ declare const ServiceErrorEventSchema: z.ZodObject<{
|
|
|
545
546
|
/** Additional metadata about the error - passthrough allows any object properties */
|
|
546
547
|
meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
547
548
|
}, "strip", z.ZodTypeAny, {
|
|
548
|
-
message: string;
|
|
549
549
|
code: string;
|
|
550
|
+
message: string;
|
|
550
551
|
service: string;
|
|
551
552
|
cause?: unknown;
|
|
552
553
|
meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
553
554
|
}, {
|
|
554
|
-
message: string;
|
|
555
555
|
code: string;
|
|
556
|
+
message: string;
|
|
556
557
|
service: string;
|
|
557
558
|
cause?: unknown;
|
|
558
559
|
meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
559
560
|
}>;
|
|
560
561
|
}, "strip", z.ZodTypeAny, {
|
|
561
562
|
error: {
|
|
562
|
-
message: string;
|
|
563
563
|
code: string;
|
|
564
|
+
message: string;
|
|
564
565
|
service: string;
|
|
565
566
|
cause?: unknown;
|
|
566
567
|
meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -569,8 +570,8 @@ declare const ServiceErrorEventSchema: z.ZodObject<{
|
|
|
569
570
|
span?: string | undefined;
|
|
570
571
|
}, {
|
|
571
572
|
error: {
|
|
572
|
-
message: string;
|
|
573
573
|
code: string;
|
|
574
|
+
message: string;
|
|
574
575
|
service: string;
|
|
575
576
|
cause?: unknown;
|
|
576
577
|
meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -598,22 +599,22 @@ declare const ServiceRetryEventSchema: z.ZodObject<{
|
|
|
598
599
|
/** Additional metadata about the error - passthrough allows any object properties */
|
|
599
600
|
meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
600
601
|
}, "strip", z.ZodTypeAny, {
|
|
601
|
-
message: string;
|
|
602
602
|
code: string;
|
|
603
|
+
message: string;
|
|
603
604
|
service: string;
|
|
604
605
|
cause?: unknown;
|
|
605
606
|
meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
606
607
|
}, {
|
|
607
|
-
message: string;
|
|
608
608
|
code: string;
|
|
609
|
+
message: string;
|
|
609
610
|
service: string;
|
|
610
611
|
cause?: unknown;
|
|
611
612
|
meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
612
613
|
}>;
|
|
613
614
|
}, "strip", z.ZodTypeAny, {
|
|
614
615
|
error: {
|
|
615
|
-
message: string;
|
|
616
616
|
code: string;
|
|
617
|
+
message: string;
|
|
617
618
|
service: string;
|
|
618
619
|
cause?: unknown;
|
|
619
620
|
meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -623,8 +624,8 @@ declare const ServiceRetryEventSchema: z.ZodObject<{
|
|
|
623
624
|
maxAttempts: number;
|
|
624
625
|
}, {
|
|
625
626
|
error: {
|
|
626
|
-
message: string;
|
|
627
627
|
code: string;
|
|
628
|
+
message: string;
|
|
628
629
|
service: string;
|
|
629
630
|
cause?: unknown;
|
|
630
631
|
meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -656,14 +657,14 @@ declare const TelemetrySpanEventSchema: z.ZodObject<{
|
|
|
656
657
|
/** Additional metadata about the error - passthrough allows any object properties */
|
|
657
658
|
meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
658
659
|
}, "strip", z.ZodTypeAny, {
|
|
659
|
-
message: string;
|
|
660
660
|
code: string;
|
|
661
|
+
message: string;
|
|
661
662
|
service: string;
|
|
662
663
|
cause?: unknown;
|
|
663
664
|
meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
664
665
|
}, {
|
|
665
|
-
message: string;
|
|
666
666
|
code: string;
|
|
667
|
+
message: string;
|
|
667
668
|
service: string;
|
|
668
669
|
cause?: unknown;
|
|
669
670
|
meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -673,8 +674,8 @@ declare const TelemetrySpanEventSchema: z.ZodObject<{
|
|
|
673
674
|
ok: boolean;
|
|
674
675
|
span: string;
|
|
675
676
|
error?: {
|
|
676
|
-
message: string;
|
|
677
677
|
code: string;
|
|
678
|
+
message: string;
|
|
678
679
|
service: string;
|
|
679
680
|
cause?: unknown;
|
|
680
681
|
meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -687,8 +688,8 @@ declare const TelemetrySpanEventSchema: z.ZodObject<{
|
|
|
687
688
|
ok: boolean;
|
|
688
689
|
span: string;
|
|
689
690
|
error?: {
|
|
690
|
-
message: string;
|
|
691
691
|
code: string;
|
|
692
|
+
message: string;
|
|
692
693
|
service: string;
|
|
693
694
|
cause?: unknown;
|
|
694
695
|
meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -923,6 +924,7 @@ declare class ServiceContext implements IServiceContext {
|
|
|
923
924
|
private _services;
|
|
924
925
|
private _eventHandlers;
|
|
925
926
|
private _abortController;
|
|
927
|
+
private _operationAbortSignal?;
|
|
926
928
|
private _retired;
|
|
927
929
|
private readonly _invoke;
|
|
928
930
|
private readonly _invokeAny?;
|
|
@@ -1007,6 +1009,8 @@ declare class ServiceContext implements IServiceContext {
|
|
|
1007
1009
|
* Get the abort signal for cancelling operations.
|
|
1008
1010
|
*/
|
|
1009
1011
|
get abortSignal(): AbortSignal;
|
|
1012
|
+
get operationAbortSignal(): AbortSignal | undefined;
|
|
1013
|
+
setOperationAbortSignal(signal: AbortSignal | undefined): void;
|
|
1010
1014
|
/**
|
|
1011
1015
|
* Permanently retire this graph after its owner installs a replacement.
|
|
1012
1016
|
* Unlike `abort()`, retirement never creates a fresh controller, so captured
|
|
@@ -1708,6 +1712,11 @@ interface VaultPutOptions {
|
|
|
1708
1712
|
contentType?: string;
|
|
1709
1713
|
/** Custom serializer (default: JSON.stringify for objects) */
|
|
1710
1714
|
serialize?: (value: unknown) => Uint8Array;
|
|
1715
|
+
/**
|
|
1716
|
+
* `"*"` writes only when no value exists at the key. An existing value
|
|
1717
|
+
* fails with `ALREADY_EXISTS`; it is never overwritten.
|
|
1718
|
+
*/
|
|
1719
|
+
ifNoneMatch?: "*";
|
|
1711
1720
|
}
|
|
1712
1721
|
/**
|
|
1713
1722
|
* Options for vault get operations.
|
|
@@ -1717,10 +1726,13 @@ interface VaultGetOptions<T = unknown> {
|
|
|
1717
1726
|
deserialize?: (data: Uint8Array) => T;
|
|
1718
1727
|
/** Return raw decrypted bytes without deserialization */
|
|
1719
1728
|
raw?: boolean;
|
|
1729
|
+
/** Force the underlying KV read to bypass replica read-through. */
|
|
1730
|
+
source?: "network";
|
|
1720
1731
|
/** Delegated KV service for reading from the grantor's space (used by getShared) */
|
|
1721
1732
|
kv?: {
|
|
1722
1733
|
get<V>(key: string, options?: {
|
|
1723
1734
|
raw?: boolean;
|
|
1735
|
+
source?: "network";
|
|
1724
1736
|
}): Promise<{
|
|
1725
1737
|
ok: boolean;
|
|
1726
1738
|
data?: {
|
|
@@ -1738,8 +1750,9 @@ interface VaultGetOptions<T = unknown> {
|
|
|
1738
1750
|
interface VaultListOptions {
|
|
1739
1751
|
/** Prefix filter for key names */
|
|
1740
1752
|
prefix?: string;
|
|
1741
|
-
/** Remove prefix from returned keys */
|
|
1742
1753
|
removePrefix?: boolean;
|
|
1754
|
+
/** Force the underlying KV list to bypass replica read-through. */
|
|
1755
|
+
source?: "network";
|
|
1743
1756
|
/** Maximum number of keys to return. */
|
|
1744
1757
|
limit?: number;
|
|
1745
1758
|
/** Opaque cursor returned by a prior bounded page. */
|
|
@@ -1830,6 +1843,28 @@ type VaultErrorInput = {
|
|
|
1830
1843
|
code: "STORAGE_ERROR";
|
|
1831
1844
|
cause: Error;
|
|
1832
1845
|
message?: string;
|
|
1846
|
+
meta?: Record<string, unknown>;
|
|
1847
|
+
} | {
|
|
1848
|
+
code: "ALREADY_EXISTS";
|
|
1849
|
+
key: string;
|
|
1850
|
+
message?: string;
|
|
1851
|
+
meta?: Record<string, unknown>;
|
|
1852
|
+
/** The typed KV error that refused the write (an `Error` carrying its `code`, `service` and `meta`). */
|
|
1853
|
+
cause: ServiceError & Error;
|
|
1854
|
+
} | {
|
|
1855
|
+
/** HTTP 401 only: the session must sign in again. */
|
|
1856
|
+
code: "AUTH_UNAUTHORIZED";
|
|
1857
|
+
message: string;
|
|
1858
|
+
meta?: Record<string, unknown>;
|
|
1859
|
+
/** The typed KV error that refused the write (an `Error` carrying its `code`, `service` and `meta`). */
|
|
1860
|
+
cause: ServiceError & Error;
|
|
1861
|
+
} | {
|
|
1862
|
+
/** A 403, or an authorization refusal without a status: signing in again does not help. */
|
|
1863
|
+
code: "PERMISSION_DENIED";
|
|
1864
|
+
message: string;
|
|
1865
|
+
meta?: Record<string, unknown>;
|
|
1866
|
+
/** The typed KV error that refused the write (an `Error` carrying its `code`, `service` and `meta`). */
|
|
1867
|
+
cause: ServiceError & Error;
|
|
1833
1868
|
} | {
|
|
1834
1869
|
code: "STORAGE_QUOTA_EXCEEDED" | "STORAGE_LIMIT_REACHED";
|
|
1835
1870
|
message: string;
|
|
@@ -2316,7 +2351,24 @@ declare const SECRET_NAME_RE: RegExp;
|
|
|
2316
2351
|
interface SecretScopeOptions {
|
|
2317
2352
|
/** Optional logical scope. Omit for the global secret namespace. */
|
|
2318
2353
|
scope?: string;
|
|
2354
|
+
/** Bypass replication for existence-sensitive reads. */
|
|
2355
|
+
source?: "network";
|
|
2319
2356
|
}
|
|
2357
|
+
/** Canonical secret scope grammar shared with the TC-832 `/request` link. */
|
|
2358
|
+
declare const SECRET_SCOPE_RE: RegExp;
|
|
2359
|
+
/** Longest scope the TC-832 `/request` link accepts. */
|
|
2360
|
+
declare const MAX_SECRET_SCOPE_LENGTH = 64;
|
|
2361
|
+
/** Scopes the TC-832 `/request` link refuses. */
|
|
2362
|
+
declare const TC832_RESERVED_SCOPES: readonly string[];
|
|
2363
|
+
interface SecretPutOptions extends SecretScopeOptions {
|
|
2364
|
+
/** Write only when no secret exists under this name; never overwrite. */
|
|
2365
|
+
ifAbsent?: boolean;
|
|
2366
|
+
}
|
|
2367
|
+
/**
|
|
2368
|
+
* Derive the canonical secret scope for an app id such as
|
|
2369
|
+
* `xyz.tinycloud.feed-workflows` → `xyz-tinycloud-feed-workflows`.
|
|
2370
|
+
*/
|
|
2371
|
+
declare function appSecretScope(appId: string): string;
|
|
2320
2372
|
interface ResolvedSecretPath {
|
|
2321
2373
|
/** Canonical env-style secret name. */
|
|
2322
2374
|
name: string;
|
|
@@ -2357,7 +2409,7 @@ interface ISecretsService {
|
|
|
2357
2409
|
lock(): void;
|
|
2358
2410
|
readonly isUnlocked: boolean;
|
|
2359
2411
|
get(name: string, options?: SecretScopeOptions): Promise<Result<string, SecretsError>>;
|
|
2360
|
-
put(name: string, value: string, options?:
|
|
2412
|
+
put(name: string, value: string, options?: SecretPutOptions): Promise<Result<void, SecretsError>>;
|
|
2361
2413
|
delete(name: string, options?: SecretScopeOptions): Promise<Result<void, SecretsError>>;
|
|
2362
2414
|
list(options?: SecretScopeOptions): Promise<Result<string[], SecretsError>>;
|
|
2363
2415
|
/** List global and scoped secrets without decrypting their values. */
|
|
@@ -2372,10 +2424,10 @@ declare class SecretsService implements ISecretsService {
|
|
|
2372
2424
|
unlock(signer?: unknown): Promise<Result<void, VaultError>>;
|
|
2373
2425
|
lock(): void;
|
|
2374
2426
|
get(name: string, options?: SecretScopeOptions): Promise<Result<string, SecretsError>>;
|
|
2375
|
-
put(name: string, value: string, options?:
|
|
2427
|
+
put(name: string, value: string, options?: SecretPutOptions): Promise<Result<void, SecretsError>>;
|
|
2376
2428
|
delete(name: string, options?: SecretScopeOptions): Promise<Result<void, SecretsError>>;
|
|
2377
2429
|
list(options?: SecretScopeOptions): Promise<Result<string[], SecretsError>>;
|
|
2378
2430
|
listAll(): Promise<Result<SecretCatalogEntry[], SecretsError>>;
|
|
2379
2431
|
}
|
|
2380
2432
|
|
|
2381
|
-
export { type AuthorizationVerdict, BaseService, type ColumnInfo, type DataVaultConfig, DataVaultService, DecryptCapabilityProof, DuckDbAction, type DuckDbActionType, type DuckDbBatchOptions, type BatchResponse as DuckDbBatchResponse, DuckDbDatabaseHandle, type DuckDbExecuteOptions, type ExecuteResponse as DuckDbExecuteResponse, type DuckDbOptions, type DuckDbQueryOptions, type QueryResponse as DuckDbQueryResponse, DuckDbService, type DuckDbServiceConfig, type DuckDbStatement, type DuckDbValue, EventHandler, FetchFunction, GenericKVResponseSchema, type GenericKVResponseType, GenericResultSchema, type HookEvent, type HookServiceName, type HookStreamEvent, type HookStreamRetryConfig, type HookSubscription, type HookWebhookListOptions, type HookWebhookRecord, type HookWebhookRegistration, type HookWebhookScope, type HookWebhookUnregisterOptions, HooksService, type HooksServiceConfig, type IDataVaultService, type IDuckDbDatabaseHandle, type IDuckDbService, IEncryptionService, type IHooksService, IKVService, type ISecretsService, IService, IServiceContext, InvokeAnyFunction, InvokeFunction, KVListResponseSchema, type KVListResponseType, KVListResultSchema, type KVListResultType, KVResponseHeadersSchema, type KVResponseHeadersType, type ParsedSecretCatalogKey, PermissionHint, type QuotaConfig, type QuotaStatus, type ResolvedSecretPath, Result, RetryPolicy, RetryPolicySchema, type RetryPolicyType, SECRET_NAME_RE, STORAGE_FULL_MESSAGE, STORAGE_WRITE_TOO_LARGE_MESSAGE, type SchemaInfo, type SecretCatalogEntry, type SecretPayload, type SecretScopeOptions, type SecretsError, SecretsService, ServiceContext, type ServiceContextConfig, ServiceError, ServiceErrorEventSchema, type ServiceErrorEventType, ServiceErrorSchema, type ServiceErrorType, ServiceRequestEventSchema, type ServiceRequestEventType, ServiceResponseEventSchema, type ServiceResponseEventType, ServiceRetryEventSchema, type ServiceRetryEventType, ServiceSession, ServiceSessionSchema, type ServiceSessionType, StorageQuotaInfo, type SubscribeOptions, 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, authorizationVerdictOf, canonicalizeSecretScope, clearTinyCloudDebugLogs, createKVResponseSchema, createResultSchema, createVaultCrypto, disableTinyCloudDebug, enableTinyCloudDebug, errorResult, getTinyCloudDebugLogs, installTinyCloudDebugGlobals, isStorageFullError, networkError, notFoundError, parseAuthError, parseCapabilityResource, parsePermissionHint, parsePermissionHintFromErrorText, parseSecretCatalogKey, parseStorageQuotaBytes, permissionDeniedError, resolveSecretListPrefix, resolveSecretPath, storageLimitReachedError, storageQuotaExceededError, storageRejectionError, timeoutError, tinyCloudDebugLogger, validateKVListResponse, validateKVResponseHeaders, validateRetryPolicy, validateServiceError, validateServiceRequestEvent, validateServiceResponseEvent, validateServiceSession, validateTelemetrySpanEvent, validatedCapabilityOf, wrapError };
|
|
2433
|
+
export { type AuthorizationVerdict, BaseService, type ColumnInfo, type DataVaultConfig, DataVaultService, DecryptCapabilityProof, DuckDbAction, type DuckDbActionType, type DuckDbBatchOptions, type BatchResponse as DuckDbBatchResponse, DuckDbDatabaseHandle, type DuckDbExecuteOptions, type ExecuteResponse as DuckDbExecuteResponse, type DuckDbOptions, type DuckDbQueryOptions, type QueryResponse as DuckDbQueryResponse, DuckDbService, type DuckDbServiceConfig, type DuckDbStatement, type DuckDbValue, EventHandler, FetchFunction, GenericKVResponseSchema, type GenericKVResponseType, GenericResultSchema, type HookEvent, type HookServiceName, type HookStreamEvent, type HookStreamRetryConfig, type HookSubscription, type HookWebhookListOptions, type HookWebhookRecord, type HookWebhookRegistration, type HookWebhookScope, type HookWebhookUnregisterOptions, HooksService, type HooksServiceConfig, type IDataVaultService, type IDuckDbDatabaseHandle, type IDuckDbService, IEncryptionService, type IHooksService, IKVService, type ISecretsService, IService, IServiceContext, InvokeAnyFunction, InvokeFunction, KVListResponseSchema, type KVListResponseType, KVListResultSchema, type KVListResultType, KVResponseHeadersSchema, type KVResponseHeadersType, MAX_SECRET_SCOPE_LENGTH, type ParsedSecretCatalogKey, PermissionHint, type QuotaConfig, type QuotaStatus, type ResolvedSecretPath, Result, RetryPolicy, RetryPolicySchema, type RetryPolicyType, SECRET_NAME_RE, SECRET_SCOPE_RE, STORAGE_FULL_MESSAGE, STORAGE_WRITE_TOO_LARGE_MESSAGE, type SchemaInfo, type SecretCatalogEntry, type SecretPayload, type SecretPutOptions, type SecretScopeOptions, type SecretsError, SecretsService, ServiceContext, type ServiceContextConfig, ServiceError, ServiceErrorEventSchema, type ServiceErrorEventType, ServiceErrorSchema, type ServiceErrorType, ServiceRequestEventSchema, type ServiceRequestEventType, ServiceResponseEventSchema, type ServiceResponseEventType, ServiceRetryEventSchema, type ServiceRetryEventType, ServiceSession, ServiceSessionSchema, type ServiceSessionType, StorageQuotaInfo, type SubscribeOptions, TC832_RESERVED_SCOPES, type TableInfo, TelemetryConfig, TelemetrySpanEventSchema, type TelemetrySpanEventType, type TinyCloudDebugEnableOptions, type TinyCloudDebugEvent, type TinyCloudDebugLevel, TinyCloudDebugLogger, type TinyCloudDebugTimer, TinyCloudQuota, type ValidationError, type VaultCrypto, type VaultEntry, type VaultError, type VaultGetOptions, type VaultGrantOptions, VaultHeaders, type VaultListOptions, type VaultListPage, type VaultNetworkReadResult, VaultPublicSpaceKVActions, type VaultPutOptions, type ViewInfo, type WasmVaultFunctions, abortedError, appSecretScope, authExpiredError, authRequiredError, authUnauthorizedError, authorizationVerdictOf, canonicalizeSecretScope, clearTinyCloudDebugLogs, createKVResponseSchema, createResultSchema, createVaultCrypto, disableTinyCloudDebug, enableTinyCloudDebug, errorResult, getTinyCloudDebugLogs, installTinyCloudDebugGlobals, isStorageFullError, networkError, notFoundError, parseAuthError, parseCapabilityResource, parsePermissionHint, parsePermissionHintFromErrorText, parseSecretCatalogKey, parseStorageQuotaBytes, permissionDeniedError, resolveSecretListPrefix, resolveSecretPath, storageLimitReachedError, storageQuotaExceededError, storageRejectionError, timeoutError, tinyCloudDebugLogger, validateKVListResponse, validateKVResponseHeaders, validateRetryPolicy, validateServiceError, validateServiceRequestEvent, validateServiceResponseEvent, validateServiceSession, validateTelemetrySpanEvent, validatedCapabilityOf, wrapError };
|