@tinycloud/node-sdk 3.4.0 → 3.5.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{TinyCloudNode-DeV-L_14.d.cts → TinyCloudNode-N4mfZI_k.d.cts} +7 -1
- package/dist/{TinyCloudNode-DeV-L_14.d.ts → TinyCloudNode-N4mfZI_k.d.ts} +7 -1
- package/dist/{authority-BO2VqGnD.d.cts → authority-BgZpUFss.d.cts} +1 -1
- package/dist/{authority-CtsxSAoP.d.ts → authority-C670-9su.d.ts} +1 -1
- package/dist/core.cjs +216 -27
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.cts +2 -2
- package/dist/core.d.ts +2 -2
- package/dist/core.js +221 -28
- package/dist/core.js.map +1 -1
- package/dist/index.cjs +232 -43
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +223 -30
- package/dist/index.js.map +1 -1
- package/dist/replication/authority.d.cts +2 -2
- package/dist/replication/authority.d.ts +2 -2
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ISigner, Bytes, IWasmBindings, PersistedSessionProof, ISessionManager } from '@tinycloud/sdk-core';
|
|
2
2
|
export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, AccountApplication, AccountApplicationListOptions, AccountApplicationRegisterOptions, AccountDelegation, AccountDelegationListOptions, AccountDelegationPage, AccountDelegationQueryOptions, AccountDelegationRecord, AccountDelegationResource, AccountDelegationRevokeOptions, AccountIndexEnsureResult, AccountIndexRebuildResult, AccountIndexStatus, AccountIndexedReadOptions, AccountService, AccountServiceConfig, AccountSpace, AccountSpaceListOptions, AccountStatus, AuthorityRefusal, AutoApproveSpaceCreationHandler, AutoRejectStrategy, AutoSignStrategy, BatchOptions, BatchResponse, BuildCanonicalDecryptRequestInput, BuildDecryptFactsInput, BuildDecryptInvocationInput, BuiltDecryptInvocation, CallbackStrategy, CanonicalAddress, CanonicalDecryptRequest, CanonicalJson, CanonicalParsedNetworkId, CapabilityEntry, CapabilityKeyRegistry, CapabilityKeyRegistryErrorCode, CapabilityKeyRegistryErrorCodes, CaveatedDelegationUnsupportedError, ClientSession, ColumnInfo, ComposeManifestOptions, ComposedManifestRequest, CreateDelegationParams, DECRYPT_ACTION, DECRYPT_FACT_TYPE, DECRYPT_RESULT_TYPE, DEFAULT_ENCRYPTION_ALG, DEFAULT_KEY_VERSION, DEFAULT_MANIFEST_SPACE, DEFAULT_MANIFEST_VERSION, DEFAULT_SIGNED_READ_URL_EXPIRY_MS, DataVaultConfig, DataVaultService, DatabaseHandle, DecryptCapabilityProof, DecryptEnvelopeOptions, DecryptInvocationFact, DecryptInvocationSigner, DecryptRequestBody, DecryptResponseBody, DecryptTransport, DecryptTransportResponseError, DelegateReceivedShareParams, DelegatedShareAccess, Delegation, DelegationChain, DelegationChainV2, DelegationDirection, DelegationError, DelegationErrorCode, DelegationErrorCodes, DelegationFilters, DelegationManager, DelegationManagerConfig, DelegationRecord, DelegationResult, DelegationRevocationReceipt, DidCacheKeyOptions, DidEqualsOptions, DiscoverNetworkInput, DiscoveredNetwork, DiscoverySource, DuckDbAction, DuckDbActionType, DuckDbBatchOptions, DuckDbBatchResponse, DuckDbDatabaseHandle, DuckDbExecuteOptions, DuckDbExecuteResponse, DuckDbOptions, DuckDbQueryOptions, DuckDbQueryResponse, DuckDbService, DuckDbServiceConfig, DuckDbStatement, DuckDbValue, ENCRYPTION_NETWORK_URN_PREFIX, ENCRYPTION_SERVICE, ENCRYPTION_SERVICE_SHORT, ENVELOPE_VERSION, EncodedShareData, EncryptToNetworkInput, EncryptToNetworkOptions, EncryptToNetworkResult, EncryptionCrypto, EncryptionError, EncryptionErrorInput, EncryptionService, EncryptionServiceConfig, ExecuteOptions, ExecuteResponse, Extension, FetchFunction, GenerateShareParams, HookEvent, HookServiceName, HookStreamEvent, HookSubscription, HookWebhookListOptions, HookWebhookRecord, HookWebhookRegistration, HookWebhookScope, HookWebhookUnregisterOptions, HooksService, HooksServiceConfig, ICapabilityKeyRegistry, IDataVaultService, IDatabaseHandle, IDuckDbDatabaseHandle, IDuckDbService, IENSResolver, IEncryptionService, IHooksService, IKVService, INotificationHandler, IPrefixedKVService, ISQLService, ISecretsService, ISessionManager, ISessionStorage, ISharingService, ISigner, ISpace, ISpaceCreationHandler, ISpaceScopedDelegations, ISpaceScopedSharing, ISpaceService, IStorageService, IUserAuthorization, IWasmBindings, IdentityParseError, IngestOptions, InlineEncryptedEnvelope, InvokeFunction, JWK, KVBatchReadResponse, KVCreateSignedReadUrlOptions, KVListPage, KVReadThrough, KVReplicaHandle, KVReplicaSpec, KVReplicaStorage, KVReplicationController, KVReplicationDeps, KVResponse, KVService, KVServiceConfig, KVSignedReadUrlResponse, KeyInfo, KeyProvider, KeyType, LocalGetResult, LocalListResult, LocalReadMeta, LocalReplicaStatus, LocalSyncResult, MAX_SECRET_SCOPE_LENGTH, Manifest, ManifestDefaults, ManifestRegistryRecord, ManifestSecretActions, ManifestValidationError, NETWORK_NAME_PATTERN, NetworkDescriptor, NetworkIdError, NodeDescriptorFetcher, OpenKeyCallbackStrategy, OpenKeySigningRequestBody, OpenKeySigningResponseBody, OpenKeySigningStrategyOptions, OwnerDelegationPermission, ParsedNetworkId, ParsedSecretCatalogKey, PendingWriteRecord, PendingWriteState, PendingWriteStore, PermissionEntry, PermissionNotInManifestError, PersistedSessionData, PinnedKey, PkhDidParts, PrefixedKVService, ProtocolMismatchError, PurgeTarget, QueryOptions, QueryResponse, RandomReceiverKeyInput, ReceiveOptions, ReceiverKeyPair, ReceiverKeySigner, RegisterBatchSuccess, RegisterPolicyV3Input, RegisterPolicyV3Receipt, ReplicaAuthorityState, ReplicaCoverage, ReplicaDevice, ReplicaGatedHandle, ReplicaGrantInfo, ReplicaInspectedStatus, ReplicaState, ReplicaStatusEntry, ReplicationAuthority, ReplicationControl, ReplicationEvent, ReplicationIdentity, ReplicationOptions, ReplicationPurgeReport, ReplicationReason, ReplicationScheduler, ResolvedCapabilities, ResolvedDelegate, ResolvedReplicationOptions, ResolvedSecretPath, ResourceCapability, SECRET_NAME_RE, SECRET_SCOPE_RE, SQLAction, SQLActionType, SQLService, SQLServiceConfig, STORAGE_FULL_MESSAGE, STORAGE_MANAGE_URL, STORAGE_WRITE_TOO_LARGE_MESSAGE, SchemaInfo, SecretCatalogEntry, SecretPayload, SecretPutOptions, SecretScopeOptions, SecretsError, SecretsService, ServiceContext, ServiceContextConfig, ServiceSession, SessionExpiredError, ShareAccess, ShareLink, ShareLinkData, ShareSchema, SharingService, SharingServiceConfig, SignCallback, SignInOptions, SignRequest, SignResponse, SignedReceiverKeyInput, SilentNotificationHandler, Space, SpaceAbilitiesMap, SpaceConfig, SpaceCreationContext, SpaceErrorCode, SpaceErrorCodes, SpaceInfo, SpaceOwnership, SpaceService, SpaceServiceConfig, SqlStatement, SqlValue, StorageAccountUsage, StorageFullEvent, StorageStatus, StorageStatusOptions, StorageUsage, StorageUsageState, StoredDelegationChain, SubscribeOptions, TC832_RESERVED_SCOPES, TableInfo, TelemetryConfig, TelemetryEventHandler, TinyCloud, TinyCloudConfig, TinyCloudDebugEnableOptions, TinyCloudDebugEvent, TinyCloudDebugLevel, TinyCloudDebugLogger, TinyCloudDebugTimer, TinyCloudSession, UnsupportedFeatureError, VAULT_PERMISSION_SERVICE, VaultCrypto, VaultEntry, VaultError, VaultGetOptions, VaultGrantOptions, VaultHeaders, VaultListOptions, VaultNetworkReadResult, VaultPublicSpaceKVActions, VaultPutOptions, VerifyDecryptResponseInput, VersionCheckError, ViewInfo, WasmVaultFunctions, WellKnownDescriptorFetcher, addressStorageKey, appSecretScope, buildCanonicalDecryptRequest, buildDecryptAttenuation, buildDecryptFacts, buildDecryptInvocation, buildNetworkId, buildSpaceUri, canonicalHashHex, canonicalSignedResponse, canonicalizeAddress, canonicalizeDid, canonicalizeDidUrl, canonicalizeEncryptionJson, canonicalizeNetworkId, canonicalizeSecretScope, checkDecryptInvocationInput, checkNodeInfo, clearTinyCloudDebugLogs, composeManifestRequest, createCapabilityKeyRegistry, createOpenKeyCallbackSigningStrategy, createSharingService, createSpaceService, createVaultCrypto, decryptEnvelopeWithKey, defaultSpaceCreationHandler, deriveSignedReceiverKey, didCacheKey, didEquals, disableTinyCloudDebug, discoverNetwork, enableTinyCloudDebug, encryptToNetwork, encryptionBase64Decode, encryptionBase64Encode, encryptionError, encryptionUtf8Decode, encryptionUtf8Encode, ensureNetworkUsableForDecrypt, expandActionShortNames, expandPermissionEntries, expandPermissionEntry, generateRandomReceiverKey, getTinyCloudDebugLogs, hexDecode, hexEncode, installTinyCloudDebugGlobals, isCapabilitySubset, isEvmAddress, isNetworkId, isStorageFullError, loadManifest, makePkhSpaceId, makePublicSpaceId, networkDiscoveryKey, openWrappedKey, parseCanonicalNetworkId, parseExpiry, parseNetworkId, parsePkhDid, parseSecretCatalogKey, parseSpaceUri, pkhDid, principalDid, principalDidEquals, resolveManifest, resolveSecretListPrefix, resolveSecretPath, resourceCapabilitiesToSpaceAbilitiesMap, storageUsageState, tinyCloudDebugLogger, validateEnvelope, validateManifest, verifyDecryptResponse } from '@tinycloud/sdk-core';
|
|
3
3
|
export { F as FileSessionStorage, M as MemorySessionStorage, W as WasmKeyProvider, a as WasmKeyProviderConfig, c as createWasmKeyProvider } from './WasmKeyProvider-5Ee7fcAw.cjs';
|
|
4
|
-
export { A as ACCEPTED_MARKER_VERSIONS, a as AuthDelegationArtifact, b as AuthRequestArtifact, B as BOOTSTRAP_COMPLETION_MARKER_KEY, c as BOOTSTRAP_COMPLETION_MARKER_VERSION, d as BootstrapCompletionMarker, e as BootstrapWarning, C as CompactRuntimeDelegationInput, f as CreateOwnerDelegationParams, D as DelegateToOptions, g as DelegateToResult, h as DelegatedAccess, i as DelegationAuthority, E as EnsureEncryptionNetworkOptions, I as InvalidRestoredSessionError, N as NodeEventEmitterStrategy, j as NodeUserAuthorization, k as NodeUserAuthorizationAuthorizeFn, l as NodeUserAuthorizationConfig, O as OpenKeyAuthorizationResultV1, m as OpenKeyAuthorizeInput, n as OpenKeyAuthorizeTinyCloud, o as OpenKeyBridgeInput, p as OwnerDelegationReceipt, P as PortableDelegation, R as RUNTIME_DELEGATION_REJECTIONS, q as RestorableSession, r as RuntimeDelegationActivator, s as RuntimeDelegationRejectedError, t as RuntimeDelegationRejection, u as RuntimePermissionGrantOptions, S as SecretPermissionHint, v as SecretReadInput, w as SecretReadResult, x as SessionGrantProof, y as SignStrategy, T as TinyCloudNode, z as TinyCloudNodeConfig, U as UnifiedOwnerRootInput, F as UnifiedOwnerRootReceipt, G as UnsupportedSessionRestoreError, V as ValidatedRuntimeDelegation, H as VerifiedSessionGrant, J as activateCompactRuntimeDelegation, K as activateValidatedRuntimeDelegation, L as defaultSignStrategy, M as deserializeDelegation, Q as grantAuthRequest, W as serializeDelegation, X as signedCompactUcanExpiry, Y as siweRuntimeDelegation, Z as wireOpenKeyAuthorize } from './TinyCloudNode-
|
|
4
|
+
export { A as ACCEPTED_MARKER_VERSIONS, a as AuthDelegationArtifact, b as AuthRequestArtifact, B as BOOTSTRAP_COMPLETION_MARKER_KEY, c as BOOTSTRAP_COMPLETION_MARKER_VERSION, d as BootstrapCompletionMarker, e as BootstrapWarning, C as CompactRuntimeDelegationInput, f as CreateOwnerDelegationParams, D as DelegateToOptions, g as DelegateToResult, h as DelegatedAccess, i as DelegationAuthority, E as EnsureEncryptionNetworkOptions, I as InvalidRestoredSessionError, N as NodeEventEmitterStrategy, j as NodeUserAuthorization, k as NodeUserAuthorizationAuthorizeFn, l as NodeUserAuthorizationConfig, O as OpenKeyAuthorizationResultV1, m as OpenKeyAuthorizeInput, n as OpenKeyAuthorizeTinyCloud, o as OpenKeyBridgeInput, p as OwnerDelegationReceipt, P as PortableDelegation, R as RUNTIME_DELEGATION_REJECTIONS, q as RestorableSession, r as RuntimeDelegationActivator, s as RuntimeDelegationRejectedError, t as RuntimeDelegationRejection, u as RuntimePermissionGrantOptions, S as SecretPermissionHint, v as SecretReadInput, w as SecretReadResult, x as SessionGrantProof, y as SignStrategy, T as TinyCloudNode, z as TinyCloudNodeConfig, U as UnifiedOwnerRootInput, F as UnifiedOwnerRootReceipt, G as UnsupportedSessionRestoreError, V as ValidatedRuntimeDelegation, H as VerifiedSessionGrant, J as activateCompactRuntimeDelegation, K as activateValidatedRuntimeDelegation, L as defaultSignStrategy, M as deserializeDelegation, Q as grantAuthRequest, W as serializeDelegation, X as signedCompactUcanExpiry, Y as siweRuntimeDelegation, Z as wireOpenKeyAuthorize } from './TinyCloudNode-N4mfZI_k.cjs';
|
|
5
5
|
import { invoke, invokeAny, computeCid, prepareSession, completeSessionSetup, ensureEip55, makeSpaceId, createDelegation, parseRecapFromSiwe, parseVerifiedRecapFromSiwe, generateHostSIWEMessage, siweToDelegationHeaders, protocolVersion, vault_encrypt, vault_decrypt, vault_derive_key, vault_x25519_from_seed, vault_x25519_dh, vault_random_bytes, vault_sha256 } from '@tinycloud/node-sdk-wasm';
|
|
6
6
|
import { KVReplicaStorage } from '@tinycloud/sdk-services';
|
|
7
7
|
import { ProfileReplicaPurge } from '@tinycloud/sdk-services/kv/replication';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ISigner, Bytes, IWasmBindings, PersistedSessionProof, ISessionManager } from '@tinycloud/sdk-core';
|
|
2
2
|
export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, AccountApplication, AccountApplicationListOptions, AccountApplicationRegisterOptions, AccountDelegation, AccountDelegationListOptions, AccountDelegationPage, AccountDelegationQueryOptions, AccountDelegationRecord, AccountDelegationResource, AccountDelegationRevokeOptions, AccountIndexEnsureResult, AccountIndexRebuildResult, AccountIndexStatus, AccountIndexedReadOptions, AccountService, AccountServiceConfig, AccountSpace, AccountSpaceListOptions, AccountStatus, AuthorityRefusal, AutoApproveSpaceCreationHandler, AutoRejectStrategy, AutoSignStrategy, BatchOptions, BatchResponse, BuildCanonicalDecryptRequestInput, BuildDecryptFactsInput, BuildDecryptInvocationInput, BuiltDecryptInvocation, CallbackStrategy, CanonicalAddress, CanonicalDecryptRequest, CanonicalJson, CanonicalParsedNetworkId, CapabilityEntry, CapabilityKeyRegistry, CapabilityKeyRegistryErrorCode, CapabilityKeyRegistryErrorCodes, CaveatedDelegationUnsupportedError, ClientSession, ColumnInfo, ComposeManifestOptions, ComposedManifestRequest, CreateDelegationParams, DECRYPT_ACTION, DECRYPT_FACT_TYPE, DECRYPT_RESULT_TYPE, DEFAULT_ENCRYPTION_ALG, DEFAULT_KEY_VERSION, DEFAULT_MANIFEST_SPACE, DEFAULT_MANIFEST_VERSION, DEFAULT_SIGNED_READ_URL_EXPIRY_MS, DataVaultConfig, DataVaultService, DatabaseHandle, DecryptCapabilityProof, DecryptEnvelopeOptions, DecryptInvocationFact, DecryptInvocationSigner, DecryptRequestBody, DecryptResponseBody, DecryptTransport, DecryptTransportResponseError, DelegateReceivedShareParams, DelegatedShareAccess, Delegation, DelegationChain, DelegationChainV2, DelegationDirection, DelegationError, DelegationErrorCode, DelegationErrorCodes, DelegationFilters, DelegationManager, DelegationManagerConfig, DelegationRecord, DelegationResult, DelegationRevocationReceipt, DidCacheKeyOptions, DidEqualsOptions, DiscoverNetworkInput, DiscoveredNetwork, DiscoverySource, DuckDbAction, DuckDbActionType, DuckDbBatchOptions, DuckDbBatchResponse, DuckDbDatabaseHandle, DuckDbExecuteOptions, DuckDbExecuteResponse, DuckDbOptions, DuckDbQueryOptions, DuckDbQueryResponse, DuckDbService, DuckDbServiceConfig, DuckDbStatement, DuckDbValue, ENCRYPTION_NETWORK_URN_PREFIX, ENCRYPTION_SERVICE, ENCRYPTION_SERVICE_SHORT, ENVELOPE_VERSION, EncodedShareData, EncryptToNetworkInput, EncryptToNetworkOptions, EncryptToNetworkResult, EncryptionCrypto, EncryptionError, EncryptionErrorInput, EncryptionService, EncryptionServiceConfig, ExecuteOptions, ExecuteResponse, Extension, FetchFunction, GenerateShareParams, HookEvent, HookServiceName, HookStreamEvent, HookSubscription, HookWebhookListOptions, HookWebhookRecord, HookWebhookRegistration, HookWebhookScope, HookWebhookUnregisterOptions, HooksService, HooksServiceConfig, ICapabilityKeyRegistry, IDataVaultService, IDatabaseHandle, IDuckDbDatabaseHandle, IDuckDbService, IENSResolver, IEncryptionService, IHooksService, IKVService, INotificationHandler, IPrefixedKVService, ISQLService, ISecretsService, ISessionManager, ISessionStorage, ISharingService, ISigner, ISpace, ISpaceCreationHandler, ISpaceScopedDelegations, ISpaceScopedSharing, ISpaceService, IStorageService, IUserAuthorization, IWasmBindings, IdentityParseError, IngestOptions, InlineEncryptedEnvelope, InvokeFunction, JWK, KVBatchReadResponse, KVCreateSignedReadUrlOptions, KVListPage, KVReadThrough, KVReplicaHandle, KVReplicaSpec, KVReplicaStorage, KVReplicationController, KVReplicationDeps, KVResponse, KVService, KVServiceConfig, KVSignedReadUrlResponse, KeyInfo, KeyProvider, KeyType, LocalGetResult, LocalListResult, LocalReadMeta, LocalReplicaStatus, LocalSyncResult, MAX_SECRET_SCOPE_LENGTH, Manifest, ManifestDefaults, ManifestRegistryRecord, ManifestSecretActions, ManifestValidationError, NETWORK_NAME_PATTERN, NetworkDescriptor, NetworkIdError, NodeDescriptorFetcher, OpenKeyCallbackStrategy, OpenKeySigningRequestBody, OpenKeySigningResponseBody, OpenKeySigningStrategyOptions, OwnerDelegationPermission, ParsedNetworkId, ParsedSecretCatalogKey, PendingWriteRecord, PendingWriteState, PendingWriteStore, PermissionEntry, PermissionNotInManifestError, PersistedSessionData, PinnedKey, PkhDidParts, PrefixedKVService, ProtocolMismatchError, PurgeTarget, QueryOptions, QueryResponse, RandomReceiverKeyInput, ReceiveOptions, ReceiverKeyPair, ReceiverKeySigner, RegisterBatchSuccess, RegisterPolicyV3Input, RegisterPolicyV3Receipt, ReplicaAuthorityState, ReplicaCoverage, ReplicaDevice, ReplicaGatedHandle, ReplicaGrantInfo, ReplicaInspectedStatus, ReplicaState, ReplicaStatusEntry, ReplicationAuthority, ReplicationControl, ReplicationEvent, ReplicationIdentity, ReplicationOptions, ReplicationPurgeReport, ReplicationReason, ReplicationScheduler, ResolvedCapabilities, ResolvedDelegate, ResolvedReplicationOptions, ResolvedSecretPath, ResourceCapability, SECRET_NAME_RE, SECRET_SCOPE_RE, SQLAction, SQLActionType, SQLService, SQLServiceConfig, STORAGE_FULL_MESSAGE, STORAGE_MANAGE_URL, STORAGE_WRITE_TOO_LARGE_MESSAGE, SchemaInfo, SecretCatalogEntry, SecretPayload, SecretPutOptions, SecretScopeOptions, SecretsError, SecretsService, ServiceContext, ServiceContextConfig, ServiceSession, SessionExpiredError, ShareAccess, ShareLink, ShareLinkData, ShareSchema, SharingService, SharingServiceConfig, SignCallback, SignInOptions, SignRequest, SignResponse, SignedReceiverKeyInput, SilentNotificationHandler, Space, SpaceAbilitiesMap, SpaceConfig, SpaceCreationContext, SpaceErrorCode, SpaceErrorCodes, SpaceInfo, SpaceOwnership, SpaceService, SpaceServiceConfig, SqlStatement, SqlValue, StorageAccountUsage, StorageFullEvent, StorageStatus, StorageStatusOptions, StorageUsage, StorageUsageState, StoredDelegationChain, SubscribeOptions, TC832_RESERVED_SCOPES, TableInfo, TelemetryConfig, TelemetryEventHandler, TinyCloud, TinyCloudConfig, TinyCloudDebugEnableOptions, TinyCloudDebugEvent, TinyCloudDebugLevel, TinyCloudDebugLogger, TinyCloudDebugTimer, TinyCloudSession, UnsupportedFeatureError, VAULT_PERMISSION_SERVICE, VaultCrypto, VaultEntry, VaultError, VaultGetOptions, VaultGrantOptions, VaultHeaders, VaultListOptions, VaultNetworkReadResult, VaultPublicSpaceKVActions, VaultPutOptions, VerifyDecryptResponseInput, VersionCheckError, ViewInfo, WasmVaultFunctions, WellKnownDescriptorFetcher, addressStorageKey, appSecretScope, buildCanonicalDecryptRequest, buildDecryptAttenuation, buildDecryptFacts, buildDecryptInvocation, buildNetworkId, buildSpaceUri, canonicalHashHex, canonicalSignedResponse, canonicalizeAddress, canonicalizeDid, canonicalizeDidUrl, canonicalizeEncryptionJson, canonicalizeNetworkId, canonicalizeSecretScope, checkDecryptInvocationInput, checkNodeInfo, clearTinyCloudDebugLogs, composeManifestRequest, createCapabilityKeyRegistry, createOpenKeyCallbackSigningStrategy, createSharingService, createSpaceService, createVaultCrypto, decryptEnvelopeWithKey, defaultSpaceCreationHandler, deriveSignedReceiverKey, didCacheKey, didEquals, disableTinyCloudDebug, discoverNetwork, enableTinyCloudDebug, encryptToNetwork, encryptionBase64Decode, encryptionBase64Encode, encryptionError, encryptionUtf8Decode, encryptionUtf8Encode, ensureNetworkUsableForDecrypt, expandActionShortNames, expandPermissionEntries, expandPermissionEntry, generateRandomReceiverKey, getTinyCloudDebugLogs, hexDecode, hexEncode, installTinyCloudDebugGlobals, isCapabilitySubset, isEvmAddress, isNetworkId, isStorageFullError, loadManifest, makePkhSpaceId, makePublicSpaceId, networkDiscoveryKey, openWrappedKey, parseCanonicalNetworkId, parseExpiry, parseNetworkId, parsePkhDid, parseSecretCatalogKey, parseSpaceUri, pkhDid, principalDid, principalDidEquals, resolveManifest, resolveSecretListPrefix, resolveSecretPath, resourceCapabilitiesToSpaceAbilitiesMap, storageUsageState, tinyCloudDebugLogger, validateEnvelope, validateManifest, verifyDecryptResponse } from '@tinycloud/sdk-core';
|
|
3
3
|
export { F as FileSessionStorage, M as MemorySessionStorage, W as WasmKeyProvider, a as WasmKeyProviderConfig, c as createWasmKeyProvider } from './WasmKeyProvider-5Ee7fcAw.js';
|
|
4
|
-
export { A as ACCEPTED_MARKER_VERSIONS, a as AuthDelegationArtifact, b as AuthRequestArtifact, B as BOOTSTRAP_COMPLETION_MARKER_KEY, c as BOOTSTRAP_COMPLETION_MARKER_VERSION, d as BootstrapCompletionMarker, e as BootstrapWarning, C as CompactRuntimeDelegationInput, f as CreateOwnerDelegationParams, D as DelegateToOptions, g as DelegateToResult, h as DelegatedAccess, i as DelegationAuthority, E as EnsureEncryptionNetworkOptions, I as InvalidRestoredSessionError, N as NodeEventEmitterStrategy, j as NodeUserAuthorization, k as NodeUserAuthorizationAuthorizeFn, l as NodeUserAuthorizationConfig, O as OpenKeyAuthorizationResultV1, m as OpenKeyAuthorizeInput, n as OpenKeyAuthorizeTinyCloud, o as OpenKeyBridgeInput, p as OwnerDelegationReceipt, P as PortableDelegation, R as RUNTIME_DELEGATION_REJECTIONS, q as RestorableSession, r as RuntimeDelegationActivator, s as RuntimeDelegationRejectedError, t as RuntimeDelegationRejection, u as RuntimePermissionGrantOptions, S as SecretPermissionHint, v as SecretReadInput, w as SecretReadResult, x as SessionGrantProof, y as SignStrategy, T as TinyCloudNode, z as TinyCloudNodeConfig, U as UnifiedOwnerRootInput, F as UnifiedOwnerRootReceipt, G as UnsupportedSessionRestoreError, V as ValidatedRuntimeDelegation, H as VerifiedSessionGrant, J as activateCompactRuntimeDelegation, K as activateValidatedRuntimeDelegation, L as defaultSignStrategy, M as deserializeDelegation, Q as grantAuthRequest, W as serializeDelegation, X as signedCompactUcanExpiry, Y as siweRuntimeDelegation, Z as wireOpenKeyAuthorize } from './TinyCloudNode-
|
|
4
|
+
export { A as ACCEPTED_MARKER_VERSIONS, a as AuthDelegationArtifact, b as AuthRequestArtifact, B as BOOTSTRAP_COMPLETION_MARKER_KEY, c as BOOTSTRAP_COMPLETION_MARKER_VERSION, d as BootstrapCompletionMarker, e as BootstrapWarning, C as CompactRuntimeDelegationInput, f as CreateOwnerDelegationParams, D as DelegateToOptions, g as DelegateToResult, h as DelegatedAccess, i as DelegationAuthority, E as EnsureEncryptionNetworkOptions, I as InvalidRestoredSessionError, N as NodeEventEmitterStrategy, j as NodeUserAuthorization, k as NodeUserAuthorizationAuthorizeFn, l as NodeUserAuthorizationConfig, O as OpenKeyAuthorizationResultV1, m as OpenKeyAuthorizeInput, n as OpenKeyAuthorizeTinyCloud, o as OpenKeyBridgeInput, p as OwnerDelegationReceipt, P as PortableDelegation, R as RUNTIME_DELEGATION_REJECTIONS, q as RestorableSession, r as RuntimeDelegationActivator, s as RuntimeDelegationRejectedError, t as RuntimeDelegationRejection, u as RuntimePermissionGrantOptions, S as SecretPermissionHint, v as SecretReadInput, w as SecretReadResult, x as SessionGrantProof, y as SignStrategy, T as TinyCloudNode, z as TinyCloudNodeConfig, U as UnifiedOwnerRootInput, F as UnifiedOwnerRootReceipt, G as UnsupportedSessionRestoreError, V as ValidatedRuntimeDelegation, H as VerifiedSessionGrant, J as activateCompactRuntimeDelegation, K as activateValidatedRuntimeDelegation, L as defaultSignStrategy, M as deserializeDelegation, Q as grantAuthRequest, W as serializeDelegation, X as signedCompactUcanExpiry, Y as siweRuntimeDelegation, Z as wireOpenKeyAuthorize } from './TinyCloudNode-N4mfZI_k.js';
|
|
5
5
|
import { invoke, invokeAny, computeCid, prepareSession, completeSessionSetup, ensureEip55, makeSpaceId, createDelegation, parseRecapFromSiwe, parseVerifiedRecapFromSiwe, generateHostSIWEMessage, siweToDelegationHeaders, protocolVersion, vault_encrypt, vault_decrypt, vault_derive_key, vault_x25519_from_seed, vault_x25519_dh, vault_random_bytes, vault_sha256 } from '@tinycloud/node-sdk-wasm';
|
|
6
6
|
import { KVReplicaStorage } from '@tinycloud/sdk-services';
|
|
7
7
|
import { ProfileReplicaPurge } from '@tinycloud/sdk-services/kv/replication';
|
package/dist/index.js
CHANGED
|
@@ -17936,6 +17936,173 @@ var PrivateKeySigner = class {
|
|
|
17936
17936
|
}
|
|
17937
17937
|
};
|
|
17938
17938
|
|
|
17939
|
+
// src/recordingServiceContext.ts
|
|
17940
|
+
import {
|
|
17941
|
+
ServiceContext
|
|
17942
|
+
} from "@tinycloud/sdk-services";
|
|
17943
|
+
import {
|
|
17944
|
+
buildRequestEvent,
|
|
17945
|
+
invocationMetaOf,
|
|
17946
|
+
requestBytesOf
|
|
17947
|
+
} from "@tinycloud/sdk-services/telemetry/requestLog";
|
|
17948
|
+
|
|
17949
|
+
// src/recordingRegistry.ts
|
|
17950
|
+
var unrecordedFetches = /* @__PURE__ */ new WeakMap();
|
|
17951
|
+
function registerRecording(context, unrecordedFetch) {
|
|
17952
|
+
unrecordedFetches.set(context, unrecordedFetch);
|
|
17953
|
+
}
|
|
17954
|
+
function unrecordedFetchOf(context) {
|
|
17955
|
+
const unrecordedFetch = unrecordedFetches.get(context);
|
|
17956
|
+
return unrecordedFetch ? unrecordedFetch() : context.fetch;
|
|
17957
|
+
}
|
|
17958
|
+
|
|
17959
|
+
// src/recordingServiceContext.ts
|
|
17960
|
+
var SYNC_ABILITY = "tinycloud.kv/sync";
|
|
17961
|
+
var INFO_PATH = "/info";
|
|
17962
|
+
function outcomeCodeOf(response) {
|
|
17963
|
+
return response === void 0 ? "ERROR" : response.ok ? "ok" : `HTTP_${response.status}`;
|
|
17964
|
+
}
|
|
17965
|
+
function replicationOp(url, meta) {
|
|
17966
|
+
if (meta !== void 0) return meta.action === SYNC_ABILITY ? `${meta.service}/sync` : void 0;
|
|
17967
|
+
return isInfoUrl(url) ? "sync/info" : void 0;
|
|
17968
|
+
}
|
|
17969
|
+
function isInfoUrl(url) {
|
|
17970
|
+
try {
|
|
17971
|
+
return new URL(url).pathname.replace(/\/+$/, "") === INFO_PATH;
|
|
17972
|
+
} catch {
|
|
17973
|
+
return false;
|
|
17974
|
+
}
|
|
17975
|
+
}
|
|
17976
|
+
function replicationEvent(sample, op) {
|
|
17977
|
+
return buildRequestEvent({
|
|
17978
|
+
service: "sync",
|
|
17979
|
+
op,
|
|
17980
|
+
url: sample.url,
|
|
17981
|
+
bytes: requestBytesOf(sample.init?.body, sample.response?.headers.get("content-length")),
|
|
17982
|
+
durationMs: performance.now() - sample.clock,
|
|
17983
|
+
attempts: sample.attempts ?? 1,
|
|
17984
|
+
ok: sample.response?.ok === true,
|
|
17985
|
+
code: outcomeCodeOf(sample.response),
|
|
17986
|
+
at: sample.at
|
|
17987
|
+
});
|
|
17988
|
+
}
|
|
17989
|
+
function createServiceContext(config) {
|
|
17990
|
+
const { requestSink, ...base2 } = config;
|
|
17991
|
+
return requestSink === void 0 ? new ServiceContext(base2) : new RecordingServiceContext(base2, requestSink);
|
|
17992
|
+
}
|
|
17993
|
+
var RecordingServiceContext = class extends ServiceContext {
|
|
17994
|
+
constructor(config, sink) {
|
|
17995
|
+
const pending = {};
|
|
17996
|
+
super({
|
|
17997
|
+
...config,
|
|
17998
|
+
invoke: rememberInvoke(config.invoke, sink, pending),
|
|
17999
|
+
invokeAny: config.invokeAny ? rememberInvokeAny(config.invokeAny, sink, pending) : void 0
|
|
18000
|
+
});
|
|
18001
|
+
this.requestSink = sink;
|
|
18002
|
+
this.pending = pending;
|
|
18003
|
+
registerRecording(this, () => this.unrecordedFetch);
|
|
18004
|
+
}
|
|
18005
|
+
/** Per-call recording; `_fetch` is read at access time, so overrides apply. */
|
|
18006
|
+
get fetch() {
|
|
18007
|
+
const raw = super.fetch;
|
|
18008
|
+
return (url, init2) => this.recordCall(raw, url, init2);
|
|
18009
|
+
}
|
|
18010
|
+
/** Transport without per-call recording. */
|
|
18011
|
+
get unrecordedFetch() {
|
|
18012
|
+
return super.fetch;
|
|
18013
|
+
}
|
|
18014
|
+
/**
|
|
18015
|
+
* One event per logical request. The first resolved attempt's init is the logged request and
|
|
18016
|
+
* `attempts` counts resolved builds. A retired context throws before the first build and records
|
|
18017
|
+
* nothing, as master does.
|
|
18018
|
+
*/
|
|
18019
|
+
async invokeWithRetry(url, build) {
|
|
18020
|
+
const at = Date.now();
|
|
18021
|
+
const clock = performance.now();
|
|
18022
|
+
let reached = false;
|
|
18023
|
+
let attempts = 0;
|
|
18024
|
+
let first;
|
|
18025
|
+
let firstMeta;
|
|
18026
|
+
let response;
|
|
18027
|
+
const attempt = async () => {
|
|
18028
|
+
reached = true;
|
|
18029
|
+
this.pending.meta = void 0;
|
|
18030
|
+
const built = build();
|
|
18031
|
+
const meta = this.pending.meta;
|
|
18032
|
+
const init2 = await built;
|
|
18033
|
+
attempts += 1;
|
|
18034
|
+
if (first === void 0) {
|
|
18035
|
+
first = init2;
|
|
18036
|
+
firstMeta = meta;
|
|
18037
|
+
}
|
|
18038
|
+
return init2;
|
|
18039
|
+
};
|
|
18040
|
+
try {
|
|
18041
|
+
response = await super.invokeWithRetry(url, attempt);
|
|
18042
|
+
return response;
|
|
18043
|
+
} finally {
|
|
18044
|
+
if (reached) {
|
|
18045
|
+
this.observeAttempt({ url, init: first, response, meta: firstMeta, at, clock, attempts });
|
|
18046
|
+
}
|
|
18047
|
+
}
|
|
18048
|
+
}
|
|
18049
|
+
async recordCall(fetchFn, url, init2) {
|
|
18050
|
+
const at = Date.now();
|
|
18051
|
+
const clock = performance.now();
|
|
18052
|
+
let response;
|
|
18053
|
+
try {
|
|
18054
|
+
response = await fetchFn(url, init2);
|
|
18055
|
+
return response;
|
|
18056
|
+
} finally {
|
|
18057
|
+
this.observeAttempt({ url, init: init2, response, at, clock });
|
|
18058
|
+
}
|
|
18059
|
+
}
|
|
18060
|
+
observeAttempt(sample) {
|
|
18061
|
+
try {
|
|
18062
|
+
const replication = replicationOp(sample.url, sample.meta ?? invocationMetaOf(sample.init?.headers));
|
|
18063
|
+
if (replication !== void 0) {
|
|
18064
|
+
this.requestSink.record(replicationEvent(sample, replication));
|
|
18065
|
+
return;
|
|
18066
|
+
}
|
|
18067
|
+
const headers = sample.init?.headers;
|
|
18068
|
+
if (sample.meta !== void 0 && typeof headers === "object" && headers !== null) {
|
|
18069
|
+
this.requestSink.remember(headers, sample.meta);
|
|
18070
|
+
}
|
|
18071
|
+
this.requestSink.observe({
|
|
18072
|
+
url: sample.url,
|
|
18073
|
+
requestHeaders: headers,
|
|
18074
|
+
requestBody: sample.init?.body,
|
|
18075
|
+
responseContentLength: sample.response?.headers.get("content-length"),
|
|
18076
|
+
ok: sample.response?.ok === true,
|
|
18077
|
+
code: outcomeCodeOf(sample.response),
|
|
18078
|
+
durationMs: performance.now() - sample.clock,
|
|
18079
|
+
attempts: sample.attempts ?? 1,
|
|
18080
|
+
at: sample.at
|
|
18081
|
+
});
|
|
18082
|
+
} catch {
|
|
18083
|
+
}
|
|
18084
|
+
}
|
|
18085
|
+
};
|
|
18086
|
+
function rememberInvoke(invoke2, sink, pending) {
|
|
18087
|
+
return (session, service, path, action, facts) => {
|
|
18088
|
+
const headers = invoke2(session, service, path, action, facts);
|
|
18089
|
+
const meta = { service, path, action, spaceId: session.spaceId };
|
|
18090
|
+
pending.meta = meta;
|
|
18091
|
+
sink.remember(headers, meta);
|
|
18092
|
+
return headers;
|
|
18093
|
+
};
|
|
18094
|
+
}
|
|
18095
|
+
function rememberInvokeAny(invokeAny2, sink, pending) {
|
|
18096
|
+
return (session, entries, facts) => {
|
|
18097
|
+
const headers = invokeAny2(session, entries, facts);
|
|
18098
|
+
const first = entries[0];
|
|
18099
|
+
const meta = first === void 0 ? void 0 : { service: first.service, path: first.path, action: first.action, spaceId: first.spaceId ?? session.spaceId };
|
|
18100
|
+
pending.meta = meta;
|
|
18101
|
+
if (meta !== void 0) sink.remember(headers, meta);
|
|
18102
|
+
return headers;
|
|
18103
|
+
};
|
|
18104
|
+
}
|
|
18105
|
+
|
|
17939
18106
|
// src/delegation.ts
|
|
17940
18107
|
import {
|
|
17941
18108
|
canonicalizeRecapCaveats,
|
|
@@ -18511,7 +18678,6 @@ import {
|
|
|
18511
18678
|
DecryptTransportResponseError,
|
|
18512
18679
|
SecretsService,
|
|
18513
18680
|
createVaultCrypto,
|
|
18514
|
-
ServiceContext as ServiceContext2,
|
|
18515
18681
|
SilentNotificationHandler,
|
|
18516
18682
|
DelegationManager,
|
|
18517
18683
|
SpaceService,
|
|
@@ -18575,6 +18741,7 @@ import {
|
|
|
18575
18741
|
parsePermissionHint,
|
|
18576
18742
|
tinyCloudDebugLogger
|
|
18577
18743
|
} from "@tinycloud/sdk-services";
|
|
18744
|
+
import { RequestLog, observeReplicaReads, readOnlyRequestLog } from "@tinycloud/sdk-services/telemetry/requestLog";
|
|
18578
18745
|
|
|
18579
18746
|
// src/authorization/NodeUserAuthorization.ts
|
|
18580
18747
|
init_authority_sign_in();
|
|
@@ -20425,8 +20592,7 @@ import {
|
|
|
20425
20592
|
KVService,
|
|
20426
20593
|
HooksService,
|
|
20427
20594
|
SQLService,
|
|
20428
|
-
DuckDbService
|
|
20429
|
-
ServiceContext
|
|
20595
|
+
DuckDbService
|
|
20430
20596
|
} from "@tinycloud/sdk-core";
|
|
20431
20597
|
var DelegatedAccess = class {
|
|
20432
20598
|
/**
|
|
@@ -20439,12 +20605,13 @@ var DelegatedAccess = class {
|
|
|
20439
20605
|
this.session = session;
|
|
20440
20606
|
this._delegation = delegation;
|
|
20441
20607
|
this.host = host;
|
|
20442
|
-
const context =
|
|
20608
|
+
const context = createServiceContext({
|
|
20443
20609
|
invoke: invoke2,
|
|
20444
20610
|
invokeAny: invokeAny2,
|
|
20445
20611
|
fetch: lifetime?.fetch ?? globalThis.fetch.bind(globalThis),
|
|
20446
20612
|
hosts: [host],
|
|
20447
|
-
telemetry
|
|
20613
|
+
telemetry,
|
|
20614
|
+
requestSink: lifetime?.requestSink
|
|
20448
20615
|
});
|
|
20449
20616
|
this._serviceContext = lifetime ? lifetime.track(context) : context;
|
|
20450
20617
|
const prefix = this._delegation.path.replace(/\/$/, "");
|
|
@@ -21044,11 +21211,12 @@ function createDefaultSessionKey(wasm) {
|
|
|
21044
21211
|
return { manager, keyId, jwk: JSON.parse(jwkStr) };
|
|
21045
21212
|
}
|
|
21046
21213
|
var ServiceGraphLifetime = class {
|
|
21047
|
-
constructor(invokeFn, invokeAnyFn, fetchFn, observeContext) {
|
|
21214
|
+
constructor(invokeFn, invokeAnyFn, fetchFn, observeContext, requestSink) {
|
|
21048
21215
|
this.invokeFn = invokeFn;
|
|
21049
21216
|
this.invokeAnyFn = invokeAnyFn;
|
|
21050
21217
|
this.fetchFn = fetchFn;
|
|
21051
21218
|
this.observeContext = observeContext;
|
|
21219
|
+
this.requestSink = requestSink;
|
|
21052
21220
|
this.abortController = new AbortController();
|
|
21053
21221
|
this.contexts = /* @__PURE__ */ new Set();
|
|
21054
21222
|
this.retired = false;
|
|
@@ -21619,6 +21787,7 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
21619
21787
|
this.sessionManager = sessionKey.manager;
|
|
21620
21788
|
this.sessionKeyId = sessionKey.keyId;
|
|
21621
21789
|
this.sessionKeyJwk = sessionKey.jwk;
|
|
21790
|
+
this._requestLog = config.requestLog === true ? new RequestLog() : void 0;
|
|
21622
21791
|
this._serviceGraph = this.createServiceGraphLifetime();
|
|
21623
21792
|
this._capabilityRegistry = new CapabilityKeyRegistry();
|
|
21624
21793
|
this._keyProvider = new WasmKeyProvider({
|
|
@@ -21790,7 +21959,8 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
21790
21959
|
createKVService: (config) => {
|
|
21791
21960
|
const prefix = config.pathPrefix?.replace(/\/$/, "");
|
|
21792
21961
|
const kvService = new KVService2({ prefix });
|
|
21793
|
-
const kvContext = receiveOnlyGraph.track(
|
|
21962
|
+
const kvContext = receiveOnlyGraph.track(createServiceContext({
|
|
21963
|
+
requestSink: receiveOnlyGraph.requestSink,
|
|
21794
21964
|
invoke: config.invoke,
|
|
21795
21965
|
fetch: config.fetch ?? globalThis.fetch.bind(globalThis),
|
|
21796
21966
|
hosts: config.hosts,
|
|
@@ -21853,6 +22023,10 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
21853
22023
|
shouldUseBootstrapSignInRequest(config) {
|
|
21854
22024
|
return config.autoBootstrapAccount !== false && config.manifest === void 0 && config.capabilityRequest === void 0 && (config.prefix ?? "default") === "default" && isOpenKeyAutoSignStrategy(config.signStrategy);
|
|
21855
22025
|
}
|
|
22026
|
+
/** Sanitized developer request events; undefined unless the node was built with `requestLog: true`. */
|
|
22027
|
+
get requests() {
|
|
22028
|
+
return this._requestLog === void 0 ? void 0 : readOnlyRequestLog(this._requestLog);
|
|
22029
|
+
}
|
|
21856
22030
|
createServiceGraphLifetime() {
|
|
21857
22031
|
return new ServiceGraphLifetime(
|
|
21858
22032
|
this.invokeWithRuntimePermissions,
|
|
@@ -21863,7 +22037,9 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
21863
22037
|
(url, init2) => globalThis.fetch(url, init2),
|
|
21864
22038
|
(context) => {
|
|
21865
22039
|
this.storageFull.observe(context);
|
|
21866
|
-
|
|
22040
|
+
if (this._requestLog) observeReplicaReads(context, this._requestLog);
|
|
22041
|
+
},
|
|
22042
|
+
this._requestLog
|
|
21867
22043
|
);
|
|
21868
22044
|
}
|
|
21869
22045
|
syncResolvedHostFromAuth() {
|
|
@@ -22186,6 +22362,7 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
22186
22362
|
this.hostedOwnedSpaceIds.clear();
|
|
22187
22363
|
this.cancelOwnedSpaceHosts();
|
|
22188
22364
|
this.storageFull.clear();
|
|
22365
|
+
this._requestLog?.clear();
|
|
22189
22366
|
this._bootstrapSkipped = false;
|
|
22190
22367
|
this._bootstrapStatus = { skipped: false };
|
|
22191
22368
|
this.replicationDelegateSession = void 0;
|
|
@@ -22277,7 +22454,10 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
22277
22454
|
const denial = await this.denyReplicaGate({ reason: "account_switch", principal: priorPrincipal, next: nextPrincipal });
|
|
22278
22455
|
this.replicaRestoreGate = denial?.status === "unguarded" ? "gate_unavailable" : "stamp_stale";
|
|
22279
22456
|
}
|
|
22280
|
-
if (address !== this._address || chainId !== this._chainId)
|
|
22457
|
+
if (address !== this._address || chainId !== this._chainId) {
|
|
22458
|
+
this.storageFull.clear();
|
|
22459
|
+
this._requestLog?.clear();
|
|
22460
|
+
}
|
|
22281
22461
|
this._address = address;
|
|
22282
22462
|
this._chainId = chainId;
|
|
22283
22463
|
this._kv = void 0;
|
|
@@ -22856,10 +23036,11 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
22856
23036
|
const contexts = [context];
|
|
22857
23037
|
const accountSpaceId = this.ownedSpaceId(ACCOUNT_REGISTRY_SPACE2);
|
|
22858
23038
|
const createScopedContext = (spaceId) => {
|
|
22859
|
-
const scoped = this._serviceGraph.track(
|
|
23039
|
+
const scoped = this._serviceGraph.track(createServiceContext({
|
|
23040
|
+
requestSink: this._serviceGraph.requestSink,
|
|
22860
23041
|
invoke: context.invoke,
|
|
22861
23042
|
invokeAny: context.invokeAny,
|
|
22862
|
-
fetch: context
|
|
23043
|
+
fetch: unrecordedFetchOf(context),
|
|
22863
23044
|
hosts: context.hosts,
|
|
22864
23045
|
telemetry: this.config.telemetry,
|
|
22865
23046
|
retryPolicy: this.config.retryPolicy
|
|
@@ -22923,10 +23104,11 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
22923
23104
|
const promise = this.enqueueAccountRegistryOperation(session, async () => {
|
|
22924
23105
|
const sharedContext = this._serviceContext;
|
|
22925
23106
|
if (!sharedContext) return;
|
|
22926
|
-
const context = this._serviceGraph.track(
|
|
23107
|
+
const context = this._serviceGraph.track(createServiceContext({
|
|
23108
|
+
requestSink: this._serviceGraph.requestSink,
|
|
22927
23109
|
invoke: sharedContext.invoke,
|
|
22928
23110
|
invokeAny: sharedContext.invokeAny,
|
|
22929
|
-
fetch: sharedContext
|
|
23111
|
+
fetch: unrecordedFetchOf(sharedContext),
|
|
22930
23112
|
hosts: sharedContext.hosts,
|
|
22931
23113
|
telemetry: this.config.telemetry,
|
|
22932
23114
|
retryPolicy: this.config.retryPolicy
|
|
@@ -23660,6 +23842,7 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
23660
23842
|
if (resolvedHost) this.config.host = resolvedHost;
|
|
23661
23843
|
if (spaceOwnerKey(serviceSession.spaceId) !== this.currentStorageOwner()) {
|
|
23662
23844
|
this.storageFull.clear();
|
|
23845
|
+
this._requestLog?.clear();
|
|
23663
23846
|
}
|
|
23664
23847
|
this._address = stagedAddress;
|
|
23665
23848
|
this._chainId = stagedChainId;
|
|
@@ -23779,7 +23962,8 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
23779
23962
|
const coreContext = graph.track(core.serviceContext);
|
|
23780
23963
|
coreContext.setSession(input.serviceSession);
|
|
23781
23964
|
}
|
|
23782
|
-
const serviceContext = graph.track(
|
|
23965
|
+
const serviceContext = graph.track(createServiceContext({
|
|
23966
|
+
requestSink: graph.requestSink,
|
|
23783
23967
|
invoke: graph.invoke,
|
|
23784
23968
|
invokeAny: graph.invokeAny,
|
|
23785
23969
|
fetch: graph.fetch,
|
|
@@ -23867,7 +24051,8 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
23867
24051
|
},
|
|
23868
24052
|
createKVService: (config) => {
|
|
23869
24053
|
const service = new KVService2({ prefix: config.pathPrefix?.replace(/\/$/, "") });
|
|
23870
|
-
const context = graph.track(
|
|
24054
|
+
const context = graph.track(createServiceContext({
|
|
24055
|
+
requestSink: graph.requestSink,
|
|
23871
24056
|
invoke: config.invoke,
|
|
23872
24057
|
fetch: config.fetch ?? globalThis.fetch.bind(globalThis),
|
|
23873
24058
|
hosts: config.hosts,
|
|
@@ -23907,7 +24092,8 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
23907
24092
|
createKVService: (spaceId) => {
|
|
23908
24093
|
graph.assertActive();
|
|
23909
24094
|
const scopedKv = new KVService2({});
|
|
23910
|
-
const context = graph.track(
|
|
24095
|
+
const context = graph.track(createServiceContext({
|
|
24096
|
+
requestSink: graph.requestSink,
|
|
23911
24097
|
invoke: graph.invoke,
|
|
23912
24098
|
invokeAny: graph.invokeAny,
|
|
23913
24099
|
fetch: graph.fetch,
|
|
@@ -23923,7 +24109,8 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
23923
24109
|
createVaultService: (spaceId) => {
|
|
23924
24110
|
graph.assertActive();
|
|
23925
24111
|
const scopedKv = new KVService2({});
|
|
23926
|
-
const context = graph.track(
|
|
24112
|
+
const context = graph.track(createServiceContext({
|
|
24113
|
+
requestSink: graph.requestSink,
|
|
23927
24114
|
invoke: graph.invoke,
|
|
23928
24115
|
invokeAny: graph.invokeAny,
|
|
23929
24116
|
fetch: graph.fetch,
|
|
@@ -24322,7 +24509,8 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
24322
24509
|
this._serviceGraph.fetch
|
|
24323
24510
|
);
|
|
24324
24511
|
this._serviceGraph.track(this.tc.serviceContext);
|
|
24325
|
-
this._serviceContext = this._serviceGraph.track(
|
|
24512
|
+
this._serviceContext = this._serviceGraph.track(createServiceContext({
|
|
24513
|
+
requestSink: this._serviceGraph.requestSink,
|
|
24326
24514
|
invoke: this._serviceGraph.invoke,
|
|
24327
24515
|
invokeAny: this._serviceGraph.invokeAny,
|
|
24328
24516
|
fetch: this._serviceGraph.fetch,
|
|
@@ -24370,10 +24558,11 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
24370
24558
|
createSpaceScopedKVService(spaceId) {
|
|
24371
24559
|
const kvService = new KVService2({});
|
|
24372
24560
|
if (this._serviceContext) {
|
|
24373
|
-
const spaceScopedContext = this._serviceGraph.track(
|
|
24561
|
+
const spaceScopedContext = this._serviceGraph.track(createServiceContext({
|
|
24562
|
+
requestSink: this._serviceGraph.requestSink,
|
|
24374
24563
|
invoke: this._serviceContext.invoke,
|
|
24375
24564
|
invokeAny: this._serviceContext.invokeAny,
|
|
24376
|
-
fetch: this._serviceContext
|
|
24565
|
+
fetch: unrecordedFetchOf(this._serviceContext),
|
|
24377
24566
|
hosts: this._serviceContext.hosts,
|
|
24378
24567
|
telemetry: this.config.telemetry,
|
|
24379
24568
|
retryPolicy: this.config.retryPolicy
|
|
@@ -24839,7 +25028,8 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
24839
25028
|
createKVService: (config) => {
|
|
24840
25029
|
graph.assertActive();
|
|
24841
25030
|
const service = new KVService2({ prefix: config.pathPrefix?.replace(/\/$/, "") });
|
|
24842
|
-
const context = graph.track(
|
|
25031
|
+
const context = graph.track(createServiceContext({
|
|
25032
|
+
requestSink: graph.requestSink,
|
|
24843
25033
|
invoke: config.invoke,
|
|
24844
25034
|
fetch: config.fetch ?? graph.fetch,
|
|
24845
25035
|
hosts: config.hosts,
|
|
@@ -25160,10 +25350,11 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
25160
25350
|
throw new Error("Not signed in. Call signIn() first.");
|
|
25161
25351
|
}
|
|
25162
25352
|
const sql = new SQLService2({});
|
|
25163
|
-
const spaceScopedContext = this._serviceGraph.track(
|
|
25353
|
+
const spaceScopedContext = this._serviceGraph.track(createServiceContext({
|
|
25354
|
+
requestSink: this._serviceGraph.requestSink,
|
|
25164
25355
|
invoke: this._serviceContext.invoke,
|
|
25165
25356
|
invokeAny: this._serviceContext.invokeAny,
|
|
25166
|
-
fetch: this._serviceContext
|
|
25357
|
+
fetch: unrecordedFetchOf(this._serviceContext),
|
|
25167
25358
|
hosts: this._serviceContext.hosts,
|
|
25168
25359
|
telemetry: this.config.telemetry,
|
|
25169
25360
|
retryPolicy: this.config.retryPolicy
|
|
@@ -25191,10 +25382,11 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
25191
25382
|
throw new Error("Not signed in. Call signIn() first.");
|
|
25192
25383
|
}
|
|
25193
25384
|
const kv = new KVService2({});
|
|
25194
|
-
const spaceScopedContext = this._serviceGraph.track(
|
|
25385
|
+
const spaceScopedContext = this._serviceGraph.track(createServiceContext({
|
|
25386
|
+
requestSink: this._serviceGraph.requestSink,
|
|
25195
25387
|
invoke: this._serviceContext.invoke,
|
|
25196
25388
|
invokeAny: this._serviceContext.invokeAny,
|
|
25197
|
-
fetch: this._serviceContext
|
|
25389
|
+
fetch: unrecordedFetchOf(this._serviceContext),
|
|
25198
25390
|
hosts: this._serviceContext.hosts
|
|
25199
25391
|
}));
|
|
25200
25392
|
spaceScopedContext.setSession({ ...this._serviceContext.session, spaceId });
|
|
@@ -25980,7 +26172,8 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
25980
26172
|
}
|
|
25981
26173
|
if (this._serviceContext) {
|
|
25982
26174
|
const publicKV = new KVService2({ prefix: "" });
|
|
25983
|
-
const publicContext = this._serviceGraph.track(
|
|
26175
|
+
const publicContext = this._serviceGraph.track(createServiceContext({
|
|
26176
|
+
requestSink: this._serviceGraph.requestSink,
|
|
25984
26177
|
invoke: this._serviceGraph.invoke,
|
|
25985
26178
|
fetch: this._serviceGraph.fetch,
|
|
25986
26179
|
hosts: this._serviceContext.hosts,
|
|
@@ -27829,7 +28022,7 @@ import {
|
|
|
27829
28022
|
UnsupportedFeatureError as UnsupportedFeatureError2,
|
|
27830
28023
|
checkNodeInfo as checkNodeInfo3
|
|
27831
28024
|
} from "@tinycloud/sdk-core";
|
|
27832
|
-
import { ServiceContext as
|
|
28025
|
+
import { ServiceContext as ServiceContext5 } from "@tinycloud/sdk-core";
|
|
27833
28026
|
|
|
27834
28027
|
// src/replication/sqlite.ts
|
|
27835
28028
|
init_authority();
|
|
@@ -27838,7 +28031,7 @@ import { createHash as createHash2, randomBytes as randomBytes2 } from "crypto";
|
|
|
27838
28031
|
import { lstatSync, readFileSync as readFileSync2, statSync } from "fs";
|
|
27839
28032
|
import { chmod, lstat, mkdir, open as openFile, readFile, readdir, realpath, rename, rm, rmdir, stat } from "fs/promises";
|
|
27840
28033
|
import { basename, dirname as dirname2, join as join2, parse as parse2, resolve, sep } from "path";
|
|
27841
|
-
import { KVService as KVService3, ServiceContext as
|
|
28034
|
+
import { KVService as KVService3, ServiceContext as ServiceContext4, principalDid as principalDid2 } from "@tinycloud/sdk-core";
|
|
27842
28035
|
import {
|
|
27843
28036
|
canonicalReplicationIdentity,
|
|
27844
28037
|
replicationIdentityKey,
|
|
@@ -28999,7 +29192,7 @@ transports_fn = async function() {
|
|
|
28999
29192
|
const device = __privateGet(this, _device);
|
|
29000
29193
|
const fetch2 = spec.fetch ?? globalThis.fetch.bind(globalThis);
|
|
29001
29194
|
return (grant) => {
|
|
29002
|
-
const context = new
|
|
29195
|
+
const context = new ServiceContext4({
|
|
29003
29196
|
invoke: wasm.invoke,
|
|
29004
29197
|
invokeAny: wasm.invokeAny,
|
|
29005
29198
|
fetch: fetch2,
|
|
@@ -30406,7 +30599,7 @@ export {
|
|
|
30406
30599
|
STORAGE_MANAGE_URL,
|
|
30407
30600
|
STORAGE_WRITE_TOO_LARGE_MESSAGE2 as STORAGE_WRITE_TOO_LARGE_MESSAGE,
|
|
30408
30601
|
SecretsService2 as SecretsService,
|
|
30409
|
-
|
|
30602
|
+
ServiceContext5 as ServiceContext,
|
|
30410
30603
|
SessionExpiredError2 as SessionExpiredError,
|
|
30411
30604
|
SharingService2 as SharingService,
|
|
30412
30605
|
SilentNotificationHandler2 as SilentNotificationHandler,
|