@tinycloud/sdk-services 3.2.5 → 3.2.6-beta.4
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-4wwJq1Gn.d.cts → BaseService-1Ug6y7DC.d.cts} +1 -1
- package/dist/{BaseService-BGr2slUz.d.ts → BaseService-Bn07Vudy.d.ts} +1 -1
- package/dist/encryption/index.cjs +2 -0
- 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 +2 -0
- package/dist/encryption/index.js.map +1 -1
- package/dist/index.cjs +16 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -11
- package/dist/index.d.ts +14 -11
- package/dist/index.js +16 -8
- 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 +2 -0
- package/dist/kv/index.cjs.map +1 -1
- package/dist/kv/index.d.cts +7 -4
- package/dist/kv/index.d.ts +7 -4
- package/dist/kv/index.js +2 -0
- package/dist/kv/index.js.map +1 -1
- package/dist/kv/replication/contractConstants.cjs +115 -0
- package/dist/kv/replication/contractConstants.cjs.map +1 -0
- package/dist/kv/replication/contractConstants.d.cts +77 -0
- package/dist/kv/replication/contractConstants.d.ts +77 -0
- package/dist/kv/replication/contractConstants.js +75 -0
- package/dist/kv/replication/contractConstants.js.map +1 -0
- package/dist/kv/replication/grantPolicyConstants.cjs +42 -0
- package/dist/kv/replication/grantPolicyConstants.cjs.map +1 -0
- package/dist/kv/replication/grantPolicyConstants.d.cts +10 -0
- package/dist/kv/replication/grantPolicyConstants.d.ts +10 -0
- package/dist/kv/replication/grantPolicyConstants.js +14 -0
- package/dist/kv/replication/grantPolicyConstants.js.map +1 -0
- package/dist/kv/replication/grantPolicyTypes.cjs +19 -0
- package/dist/kv/replication/grantPolicyTypes.cjs.map +1 -0
- package/dist/kv/replication/grantPolicyTypes.d.cts +87 -0
- package/dist/kv/replication/grantPolicyTypes.d.ts +87 -0
- package/dist/kv/replication/grantPolicyTypes.js +1 -0
- package/dist/kv/replication/grantPolicyTypes.js.map +1 -0
- package/dist/kv/replication/index.cjs +5 -4
- package/dist/kv/replication/index.cjs.map +1 -1
- package/dist/kv/replication/index.d.cts +6 -3
- package/dist/kv/replication/index.d.ts +6 -3
- package/dist/kv/replication/index.js +5 -4
- package/dist/kv/replication/index.js.map +1 -1
- package/dist/scope-BnyVPZ5E.d.ts +1659 -0
- package/dist/scope-CQ5kmHlt.d.cts +1659 -0
- package/dist/sql/index.cjs +2 -0
- 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 +2 -0
- package/dist/sql/index.js.map +1 -1
- package/dist/{types-D-9A3Sut.d.cts → types-gmdUiorz.d.cts} +2 -0
- package/dist/{types-D-9A3Sut.d.ts → types-gmdUiorz.d.ts} +2 -0
- package/package.json +40 -1
- package/dist/scope-CoKKmMiI.d.ts +0 -957
- package/dist/scope-D7wmjbMH.d.cts +0 -957
package/dist/index.d.cts
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
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-gmdUiorz.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-gmdUiorz.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-1Ug6y7DC.cjs';
|
|
5
|
+
export { a as BaseServiceOptions, R as RequestSignal, S as ServiceConstructor, b as ServiceRegistration } from './BaseService-1Ug6y7DC.cjs';
|
|
6
6
|
import { IKVService } from './kv/index.cjs';
|
|
7
7
|
export { IPrefixedKVService, KVService, PrefixedKVService } from './kv/index.cjs';
|
|
8
|
-
export { A as AuthorityRefusal, C as CLEAR_PENDING_WARNING,
|
|
8
|
+
export { A as AuthorityRefusal, C as CLEAR_PENDING_WARNING, ah as DEFAULT_SIGNED_READ_URL_EXPIRY_MS, ai as KVAction, aj as KVActionType, ak as KVBatchPutItem, al as KVBatchPutOptions, am as KVBatchPutResponse, an as KVBatchReadResponse, ao as KVChange, ap as KVChangesAuthority, aq as KVChangesOptions, ar as KVChangesResponse, as as KVCreateSignedReadUrlOptions, at as KVDeleteOptions, au as KVGetOptions, av as KVHeadOptions, aw as KVListOptions, b as KVListPage, ax as KVListResponse, ay as KVPutOptions, c as KVReadThrough, d as KVReplicaHandle, e as KVReplicaSpec, f as KVReplicaStorage, a as KVReplicationController, K as KVReplicationDeps, az as KVResponse, aA as KVResponseHeaders, aB as KVServiceConfig, aC 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 ReplicaAccountGate, p as ReplicaAdmitHook, q as ReplicaAuthorityState, r as ReplicaBrowserGateAccess, s as ReplicaBrowserGateSnapshot, t as ReplicaBrowserGateTx, u as ReplicaBrowserPageAdmission, v as ReplicaClock, w as ReplicaCoverage, x as ReplicaDeliveryDecision, y as ReplicaDenyInput, z as ReplicaDenyOutcome, B as ReplicaDevice, D as ReplicaEraseReport, E as ReplicaGateAccess, F as ReplicaGateReason, G as ReplicaGateScope, H as ReplicaGateSnapshot, I as ReplicaGateTx, J as ReplicaGatedError, M as ReplicaGatedHandle, N as ReplicaGatedSpec, O as ReplicaGatedStorage, Q as ReplicaGrantInfo, S as ReplicaGuardedStore, T as ReplicaInspectedStatus, U as ReplicaLifecycleGate, V as ReplicaPageAdmission, W as ReplicaPartitionEraser, X as ReplicaPartitionIndexEntry, Y as ReplicaPeerCommit, Z as ReplicaPrivateGateHash, _ as ReplicaPurgeIntent, $ as ReplicaQuotaLedger, a0 as ReplicaQuotaSpec, a1 as ReplicaSessionStamp, a2 as ReplicaStampedReply, a3 as ReplicaState, a4 as ReplicaStatusEntry, a5 as ReplicationAuthority, a6 as ReplicationControl, a7 as ReplicationEvent, R as ReplicationIdentity, a8 as ReplicationOptions, a9 as ReplicationPurgeReport, aa as ReplicationReason, ab as ReplicationScheduler, ac as ResolvedReplicationOptions, ad as SaltedHash, ae as canonicalReplicationIdentity, af as replicationIdentityKey, ag as requiresSecretsOptIn } from './scope-CQ5kmHlt.cjs';
|
|
9
|
+
export { ClampConsentAnchor, ConsentDeadlineMs, EffectiveGrantExpiry, EffectiveGrantExpiryInput, MintRemainingMs, NeedsSilentRenewal, ReplicaConsentAnchor, ReplicaConsentSource, ReplicaGrantPolicy } from './kv/replication/grantPolicyTypes.cjs';
|
|
9
10
|
export { BatchOptions, BatchResponse, DatabaseHandle, ExecuteOptions, ExecuteResponse, IDatabaseHandle, ISQLMigrations, ISQLService, QueryOptions, QueryResponse, SQLAction, SQLActionType, SQLMigrations, SQLService, SQLServiceConfig, SqlMigration, SqlMigrationApplyOptions, SqlMigrationApplyResponse, SqlStatement, SqlValue } from './sql/index.cjs';
|
|
10
11
|
import { IEncryptionService, DecryptCapabilityProof } from './encryption/index.cjs';
|
|
11
12
|
export { BuildCanonicalDecryptRequestInput, BuildDecryptFactsInput, BuildDecryptInvocationInput, BuiltDecryptInvocation, CanonicalDecryptRequest, CanonicalJson, DECRYPT_ACTION, DECRYPT_FACT_TYPE, DECRYPT_RESULT_TYPE, DEFAULT_ENCRYPTION_ALG, DEFAULT_KEY_VERSION, DecryptEnvelopeOptions, DecryptInvocationFact, DecryptInvocationSigner, DecryptRequestBody, DecryptResponseBody, DecryptTransport, DiscoverNetworkInput, DiscoveredNetwork, DiscoverySource, ENCRYPTION_NETWORK_URN_PREFIX, ENCRYPTION_SERVICE, ENCRYPTION_SERVICE_SHORT, ENVELOPE_VERSION, EncryptToNetworkInput, EncryptToNetworkOptions, EncryptToNetworkResult, EncryptionCrypto, EncryptionError, EncryptionErrorInput, EncryptionService, EncryptionServiceConfig, InlineEncryptedEnvelope, Json, NETWORK_NAME_PATTERN, NetworkDescriptor, NetworkIdError, NodeDescriptorFetcher, ParsedNetworkId, RandomReceiverKeyInput, ReceiverKeyPair, ReceiverKeySigner, SignedReceiverKeyInput, VerifyDecryptResponseInput, WellKnownDescriptorFetcher, base64Decode, base64Encode, buildCanonicalDecryptRequest, buildDecryptAttenuation, buildDecryptFacts, buildDecryptInvocation, buildNetworkId, canonicalHashHex, canonicalSignedResponse, canonicalize as canonicalizeEncryptionJson, checkDecryptInvocationInput, decryptEnvelopeWithKey, deriveSignedReceiverKey, discoverNetwork, encryptToNetwork, encryptionError, ensureNetworkUsableForDecrypt, generateRandomReceiverKey, hexDecode, hexEncode, isNetworkId, networkDiscoveryKey, openWrappedKey, parseNetworkId, utf8Decode, utf8Encode, validateEnvelope, verifyDecryptResponse } from './encryption/index.cjs';
|
|
12
13
|
export { DecryptTransportResponseError } from '@tinycloud/sdk-services/internal/decrypt-transport-response-error';
|
|
13
14
|
export { kvPrefixCovers } from './kv/replication/prefix.cjs';
|
|
15
|
+
import './kv/replication/contractConstants.cjs';
|
|
16
|
+
import './kv/replication/grantPolicyConstants.cjs';
|
|
14
17
|
|
|
15
18
|
type TinyCloudDebugLevel = "debug";
|
|
16
19
|
interface TinyCloudDebugEvent {
|
|
@@ -488,14 +491,14 @@ declare const ServiceRequestEventSchema: z.ZodObject<{
|
|
|
488
491
|
timestamp: z.ZodNumber;
|
|
489
492
|
}, "strip", z.ZodTypeAny, {
|
|
490
493
|
timestamp: number;
|
|
491
|
-
service: string;
|
|
492
494
|
action: string;
|
|
495
|
+
service: string;
|
|
493
496
|
key?: string | undefined;
|
|
494
497
|
span?: string | undefined;
|
|
495
498
|
}, {
|
|
496
499
|
timestamp: number;
|
|
497
|
-
service: string;
|
|
498
500
|
action: string;
|
|
501
|
+
service: string;
|
|
499
502
|
key?: string | undefined;
|
|
500
503
|
span?: string | undefined;
|
|
501
504
|
}>;
|
|
@@ -514,16 +517,16 @@ declare const ServiceResponseEventSchema: z.ZodObject<{
|
|
|
514
517
|
}, "strip", z.ZodTypeAny, {
|
|
515
518
|
duration: number;
|
|
516
519
|
ok: boolean;
|
|
517
|
-
service: string;
|
|
518
520
|
action: string;
|
|
521
|
+
service: string;
|
|
519
522
|
durationMs?: number | undefined;
|
|
520
523
|
status?: number | undefined;
|
|
521
524
|
span?: string | undefined;
|
|
522
525
|
}, {
|
|
523
526
|
duration: number;
|
|
524
527
|
ok: boolean;
|
|
525
|
-
service: string;
|
|
526
528
|
action: string;
|
|
529
|
+
service: string;
|
|
527
530
|
durationMs?: number | undefined;
|
|
528
531
|
status?: number | undefined;
|
|
529
532
|
span?: string | undefined;
|
|
@@ -682,8 +685,8 @@ declare const TelemetrySpanEventSchema: z.ZodObject<{
|
|
|
682
685
|
meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
683
686
|
} | undefined;
|
|
684
687
|
status?: number | undefined;
|
|
685
|
-
service?: string | undefined;
|
|
686
688
|
action?: string | undefined;
|
|
689
|
+
service?: string | undefined;
|
|
687
690
|
}, {
|
|
688
691
|
durationMs: number;
|
|
689
692
|
ok: boolean;
|
|
@@ -696,8 +699,8 @@ declare const TelemetrySpanEventSchema: z.ZodObject<{
|
|
|
696
699
|
meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
697
700
|
} | undefined;
|
|
698
701
|
status?: number | undefined;
|
|
699
|
-
service?: string | undefined;
|
|
700
702
|
action?: string | undefined;
|
|
703
|
+
service?: string | undefined;
|
|
701
704
|
}>;
|
|
702
705
|
type TelemetrySpanEventType = z.infer<typeof TelemetrySpanEventSchema>;
|
|
703
706
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
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-gmdUiorz.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-gmdUiorz.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-Bn07Vudy.js';
|
|
5
|
+
export { a as BaseServiceOptions, R as RequestSignal, S as ServiceConstructor, b as ServiceRegistration } from './BaseService-Bn07Vudy.js';
|
|
6
6
|
import { IKVService } from './kv/index.js';
|
|
7
7
|
export { IPrefixedKVService, KVService, PrefixedKVService } from './kv/index.js';
|
|
8
|
-
export { A as AuthorityRefusal, C as CLEAR_PENDING_WARNING,
|
|
8
|
+
export { A as AuthorityRefusal, C as CLEAR_PENDING_WARNING, ah as DEFAULT_SIGNED_READ_URL_EXPIRY_MS, ai as KVAction, aj as KVActionType, ak as KVBatchPutItem, al as KVBatchPutOptions, am as KVBatchPutResponse, an as KVBatchReadResponse, ao as KVChange, ap as KVChangesAuthority, aq as KVChangesOptions, ar as KVChangesResponse, as as KVCreateSignedReadUrlOptions, at as KVDeleteOptions, au as KVGetOptions, av as KVHeadOptions, aw as KVListOptions, b as KVListPage, ax as KVListResponse, ay as KVPutOptions, c as KVReadThrough, d as KVReplicaHandle, e as KVReplicaSpec, f as KVReplicaStorage, a as KVReplicationController, K as KVReplicationDeps, az as KVResponse, aA as KVResponseHeaders, aB as KVServiceConfig, aC 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 ReplicaAccountGate, p as ReplicaAdmitHook, q as ReplicaAuthorityState, r as ReplicaBrowserGateAccess, s as ReplicaBrowserGateSnapshot, t as ReplicaBrowserGateTx, u as ReplicaBrowserPageAdmission, v as ReplicaClock, w as ReplicaCoverage, x as ReplicaDeliveryDecision, y as ReplicaDenyInput, z as ReplicaDenyOutcome, B as ReplicaDevice, D as ReplicaEraseReport, E as ReplicaGateAccess, F as ReplicaGateReason, G as ReplicaGateScope, H as ReplicaGateSnapshot, I as ReplicaGateTx, J as ReplicaGatedError, M as ReplicaGatedHandle, N as ReplicaGatedSpec, O as ReplicaGatedStorage, Q as ReplicaGrantInfo, S as ReplicaGuardedStore, T as ReplicaInspectedStatus, U as ReplicaLifecycleGate, V as ReplicaPageAdmission, W as ReplicaPartitionEraser, X as ReplicaPartitionIndexEntry, Y as ReplicaPeerCommit, Z as ReplicaPrivateGateHash, _ as ReplicaPurgeIntent, $ as ReplicaQuotaLedger, a0 as ReplicaQuotaSpec, a1 as ReplicaSessionStamp, a2 as ReplicaStampedReply, a3 as ReplicaState, a4 as ReplicaStatusEntry, a5 as ReplicationAuthority, a6 as ReplicationControl, a7 as ReplicationEvent, R as ReplicationIdentity, a8 as ReplicationOptions, a9 as ReplicationPurgeReport, aa as ReplicationReason, ab as ReplicationScheduler, ac as ResolvedReplicationOptions, ad as SaltedHash, ae as canonicalReplicationIdentity, af as replicationIdentityKey, ag as requiresSecretsOptIn } from './scope-BnyVPZ5E.js';
|
|
9
|
+
export { ClampConsentAnchor, ConsentDeadlineMs, EffectiveGrantExpiry, EffectiveGrantExpiryInput, MintRemainingMs, NeedsSilentRenewal, ReplicaConsentAnchor, ReplicaConsentSource, ReplicaGrantPolicy } from './kv/replication/grantPolicyTypes.js';
|
|
9
10
|
export { BatchOptions, BatchResponse, DatabaseHandle, ExecuteOptions, ExecuteResponse, IDatabaseHandle, ISQLMigrations, ISQLService, QueryOptions, QueryResponse, SQLAction, SQLActionType, SQLMigrations, SQLService, SQLServiceConfig, SqlMigration, SqlMigrationApplyOptions, SqlMigrationApplyResponse, SqlStatement, SqlValue } from './sql/index.js';
|
|
10
11
|
import { IEncryptionService, DecryptCapabilityProof } from './encryption/index.js';
|
|
11
12
|
export { BuildCanonicalDecryptRequestInput, BuildDecryptFactsInput, BuildDecryptInvocationInput, BuiltDecryptInvocation, CanonicalDecryptRequest, CanonicalJson, DECRYPT_ACTION, DECRYPT_FACT_TYPE, DECRYPT_RESULT_TYPE, DEFAULT_ENCRYPTION_ALG, DEFAULT_KEY_VERSION, DecryptEnvelopeOptions, DecryptInvocationFact, DecryptInvocationSigner, DecryptRequestBody, DecryptResponseBody, DecryptTransport, DiscoverNetworkInput, DiscoveredNetwork, DiscoverySource, ENCRYPTION_NETWORK_URN_PREFIX, ENCRYPTION_SERVICE, ENCRYPTION_SERVICE_SHORT, ENVELOPE_VERSION, EncryptToNetworkInput, EncryptToNetworkOptions, EncryptToNetworkResult, EncryptionCrypto, EncryptionError, EncryptionErrorInput, EncryptionService, EncryptionServiceConfig, InlineEncryptedEnvelope, Json, NETWORK_NAME_PATTERN, NetworkDescriptor, NetworkIdError, NodeDescriptorFetcher, ParsedNetworkId, RandomReceiverKeyInput, ReceiverKeyPair, ReceiverKeySigner, SignedReceiverKeyInput, VerifyDecryptResponseInput, WellKnownDescriptorFetcher, base64Decode, base64Encode, buildCanonicalDecryptRequest, buildDecryptAttenuation, buildDecryptFacts, buildDecryptInvocation, buildNetworkId, canonicalHashHex, canonicalSignedResponse, canonicalize as canonicalizeEncryptionJson, checkDecryptInvocationInput, decryptEnvelopeWithKey, deriveSignedReceiverKey, discoverNetwork, encryptToNetwork, encryptionError, ensureNetworkUsableForDecrypt, generateRandomReceiverKey, hexDecode, hexEncode, isNetworkId, networkDiscoveryKey, openWrappedKey, parseNetworkId, utf8Decode, utf8Encode, validateEnvelope, verifyDecryptResponse } from './encryption/index.js';
|
|
12
13
|
export { DecryptTransportResponseError } from '@tinycloud/sdk-services/internal/decrypt-transport-response-error';
|
|
13
14
|
export { kvPrefixCovers } from './kv/replication/prefix.js';
|
|
15
|
+
import './kv/replication/contractConstants.js';
|
|
16
|
+
import './kv/replication/grantPolicyConstants.js';
|
|
14
17
|
|
|
15
18
|
type TinyCloudDebugLevel = "debug";
|
|
16
19
|
interface TinyCloudDebugEvent {
|
|
@@ -488,14 +491,14 @@ declare const ServiceRequestEventSchema: z.ZodObject<{
|
|
|
488
491
|
timestamp: z.ZodNumber;
|
|
489
492
|
}, "strip", z.ZodTypeAny, {
|
|
490
493
|
timestamp: number;
|
|
491
|
-
service: string;
|
|
492
494
|
action: string;
|
|
495
|
+
service: string;
|
|
493
496
|
key?: string | undefined;
|
|
494
497
|
span?: string | undefined;
|
|
495
498
|
}, {
|
|
496
499
|
timestamp: number;
|
|
497
|
-
service: string;
|
|
498
500
|
action: string;
|
|
501
|
+
service: string;
|
|
499
502
|
key?: string | undefined;
|
|
500
503
|
span?: string | undefined;
|
|
501
504
|
}>;
|
|
@@ -514,16 +517,16 @@ declare const ServiceResponseEventSchema: z.ZodObject<{
|
|
|
514
517
|
}, "strip", z.ZodTypeAny, {
|
|
515
518
|
duration: number;
|
|
516
519
|
ok: boolean;
|
|
517
|
-
service: string;
|
|
518
520
|
action: string;
|
|
521
|
+
service: string;
|
|
519
522
|
durationMs?: number | undefined;
|
|
520
523
|
status?: number | undefined;
|
|
521
524
|
span?: string | undefined;
|
|
522
525
|
}, {
|
|
523
526
|
duration: number;
|
|
524
527
|
ok: boolean;
|
|
525
|
-
service: string;
|
|
526
528
|
action: string;
|
|
529
|
+
service: string;
|
|
527
530
|
durationMs?: number | undefined;
|
|
528
531
|
status?: number | undefined;
|
|
529
532
|
span?: string | undefined;
|
|
@@ -682,8 +685,8 @@ declare const TelemetrySpanEventSchema: z.ZodObject<{
|
|
|
682
685
|
meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
683
686
|
} | undefined;
|
|
684
687
|
status?: number | undefined;
|
|
685
|
-
service?: string | undefined;
|
|
686
688
|
action?: string | undefined;
|
|
689
|
+
service?: string | undefined;
|
|
687
690
|
}, {
|
|
688
691
|
durationMs: number;
|
|
689
692
|
ok: boolean;
|
|
@@ -696,8 +699,8 @@ declare const TelemetrySpanEventSchema: z.ZodObject<{
|
|
|
696
699
|
meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
697
700
|
} | undefined;
|
|
698
701
|
status?: number | undefined;
|
|
699
|
-
service?: string | undefined;
|
|
700
702
|
action?: string | undefined;
|
|
703
|
+
service?: string | undefined;
|
|
701
704
|
}>;
|
|
702
705
|
type TelemetrySpanEventType = z.infer<typeof TelemetrySpanEventSchema>;
|
|
703
706
|
/**
|
package/dist/index.js
CHANGED
|
@@ -68,6 +68,8 @@ var TelemetryEvents = {
|
|
|
68
68
|
REPLICATION_SYNC: "replication.sync",
|
|
69
69
|
REPLICATION_STATE: "replication.state",
|
|
70
70
|
REPLICATION_DIVERGENCE: "replication.divergence",
|
|
71
|
+
REPLICATION_GRANT: "replication.grant",
|
|
72
|
+
REPLICATION_LIFECYCLE: "replication.lifecycle",
|
|
71
73
|
/** Emitted once, on the first write rejected because storage is full. */
|
|
72
74
|
STORAGE_FULL: "storage.full"
|
|
73
75
|
};
|
|
@@ -104,21 +106,27 @@ var SAFE_NUMBER_FIELDS = /* @__PURE__ */ new Set([
|
|
|
104
106
|
"fetched",
|
|
105
107
|
"pages",
|
|
106
108
|
"lagMs",
|
|
107
|
-
"pendingCleared"
|
|
109
|
+
"pendingCleared",
|
|
110
|
+
"partitions",
|
|
111
|
+
"remaining",
|
|
112
|
+
"expiryMs"
|
|
108
113
|
]);
|
|
109
|
-
var SAFE_BOOLEAN_FIELDS = /* @__PURE__ */ new Set(["authenticated", "ok", "persisted"]);
|
|
114
|
+
var SAFE_BOOLEAN_FIELDS = /* @__PURE__ */ new Set(["authenticated", "ok", "persisted", "purgePending"]);
|
|
110
115
|
var SAFE_REPLICATION_FIELDS = {
|
|
111
116
|
source: ["replica", "network", "none"],
|
|
112
|
-
reason: ["hit", "absent", "deleted", "content_missing", "coverage_incomplete", "not_covered", "pending_write", "grant_missing", "grant_expired", "grant_revoked", "grant_not_yet_valid", "stale", "replica_error", "runtime_unsupported", "replica_unavailable", "unsupported_option", "network_cursor", "cursor_restart", "aborted", "REPLICA_BEHIND_OWN_WRITES", "REPLICA_UNPROVEN_SINCE_START", "NETWORK_REQUESTED"],
|
|
117
|
+
reason: ["hit", "absent", "deleted", "content_missing", "coverage_incomplete", "not_covered", "pending_write", "grant_missing", "grant_expired", "grant_revoked", "grant_not_yet_valid", "stale", "replica_error", "runtime_unsupported", "replica_unavailable", "unsupported_option", "network_cursor", "cursor_restart", "aborted", "REPLICA_BEHIND_OWN_WRITES", "REPLICA_UNPROVEN_SINCE_START", "NETWORK_REQUESTED", "replica_gated", "sign_out", "account_switch", "consent_expired", "startup"],
|
|
113
118
|
op: ["get", "list", "put", "delete", "batchPut"],
|
|
114
|
-
trigger: ["start", "interval", "stale_read", "manual"],
|
|
119
|
+
trigger: ["start", "interval", "stale_read", "manual", "peer"],
|
|
120
|
+
origin: ["peer"],
|
|
115
121
|
outcome: ["found", "not_found", "error", "committed", "failed", "ambiguous", "ok", "busy", "aborted"],
|
|
116
|
-
class: ["offline", "authority", "storage", "node"],
|
|
117
|
-
state: ["opened", "grant_installed", "grant_missing", "runtime_unsupported", "unavailable", "revoked", "recreated", "purged", "purge_failed", "pending_store_error", "pinned", "pending_cleared", "closed", "idle", "ready"],
|
|
122
|
+
class: ["offline", "authority", "storage", "node", "lifecycle"],
|
|
123
|
+
state: ["opened", "grant_installed", "grant_missing", "runtime_unsupported", "unavailable", "revoked", "recreated", "purged", "purge_failed", "pending_store_error", "pinned", "pending_cleared", "closed", "idle", "ready", "gated"],
|
|
124
|
+
action: ["minted", "renewed", "renewal_refused", "renewal_deferred", "capped", "expired", "consent_deadline_reached", "denied", "deny_stale", "deny_failed", "database_deleted", "marker_set", "marker_cleared", "unguarded", "drained", "erased", "erase_failed", "activation_blocked", "activated", "recovered"],
|
|
125
|
+
gate: ["not_established", "stamp_stale", "principal_mismatch", "purge_pending", "logout_pending", "gate_unavailable"],
|
|
118
126
|
kind: ["value", "missing_local", "extra_local", "keys", "order"],
|
|
119
127
|
coverage: ["empty", "bootstrapping", "complete"],
|
|
120
128
|
authority: ["valid", "expired", "revoked", "not-yet-valid"],
|
|
121
|
-
code: ["NETWORK_ERROR", "TIMEOUT", "ABORTED", "REPLICA_BUSY", "REPLICA_BEHIND_OWN_WRITES", "REPLICA_UNPROVEN_SINCE_START", "NETWORK_REQUESTED", "INTEGRITY_ERROR", "STORAGE_ERROR", "REPLICA_CLOSED", "RUNTIME_UNSUPPORTED", "GRANT_EXPIRED", "GRANT_REVOKED", "GRANT_NOT_YET_VALID", "GRANT_MISSING", "GRANT_INVALID", "SOURCE_CHANGED", "PROTOCOL_ERROR", "SCOPE_VIOLATION", "NODE_ERROR", "CONTENT_MISMATCH", "STORAGE_FULL"],
|
|
129
|
+
code: ["NETWORK_ERROR", "TIMEOUT", "ABORTED", "REPLICA_BUSY", "REPLICA_BEHIND_OWN_WRITES", "REPLICA_UNPROVEN_SINCE_START", "NETWORK_REQUESTED", "INTEGRITY_ERROR", "STORAGE_ERROR", "REPLICA_CLOSED", "RUNTIME_UNSUPPORTED", "GRANT_EXPIRED", "GRANT_REVOKED", "GRANT_NOT_YET_VALID", "GRANT_MISSING", "GRANT_INVALID", "SOURCE_CHANGED", "PROTOCOL_ERROR", "SCOPE_VIOLATION", "NODE_ERROR", "CONTENT_MISMATCH", "STORAGE_FULL", "REPLICA_GATED", "RESET_REQUIRED", "STORAGE_BUDGET", "CONSENT_EXPIRED"],
|
|
122
130
|
pendingState: ["in_flight", "committed", "ambiguous"],
|
|
123
131
|
strategy: ["session", "minted", "installed"],
|
|
124
132
|
verify: ["match", "diverged", "error", "aborted"]
|
|
@@ -871,7 +879,7 @@ var ServiceContext = class {
|
|
|
871
879
|
}
|
|
872
880
|
assertActive() {
|
|
873
881
|
if (this._retired) {
|
|
874
|
-
throw new Error("Service graph has been retired
|
|
882
|
+
throw new Error("Service graph has been retired: its session was replaced or signed out.");
|
|
875
883
|
}
|
|
876
884
|
}
|
|
877
885
|
wrapInvokeAny(invokeAny) {
|