@tinycloud/node-sdk 3.6.2-beta.0 → 3.7.0-beta.2
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--OyL6lZh.d.ts → TinyCloudNode-CclYdOh4.d.ts} +15 -6
- package/dist/{TinyCloudNode-BMi72EIk.d.cts → TinyCloudNode-u_PobKS1.d.cts} +15 -6
- package/dist/{authority-U0m7P2TE.d.cts → authority-CI3qRIcu.d.cts} +1 -1
- package/dist/{authority-DSG538B7.d.ts → authority-OZr9meoT.d.ts} +1 -1
- package/dist/core.cjs +63 -30
- 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 +67 -31
- package/dist/core.js.map +1 -1
- package/dist/index.cjs +63 -30
- 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 +67 -31
- 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, l as BOOTSTRAP_COMPLETION_MARKER_KEY, m as BOOTSTRAP_COMPLETION_MARKER_VERSION, n as BootstrapCompletionMarker, B as BootstrapWarning, C as CreateOwnerDelegationParams, D as DelegateToOptions, a as DelegateToResult, b as DelegatedAccess, E as EnsureEncryptionNetworkOptions, I as InvalidRestoredSessionError, N as NodeEventEmitterStrategy, c as NodeUserAuthorization, o as NodeUserAuthorizationAuthorizeFn, d as NodeUserAuthorizationConfig, p as OpenKeyAuthorizationResultV1, q as OpenKeyAuthorizeInput, r as OpenKeyAuthorizeTinyCloud, s as OpenKeyBridgeInput, O as OwnerDelegationReceipt, t as RestorableSession, R as RuntimePermissionGrantOptions, S as SecretPermissionHint, e as SecretReadInput, f as SecretReadResult, g as SignStrategy, T as TinyCloudNode, h as TinyCloudNodeConfig, U as UnifiedOwnerRootInput, i as UnifiedOwnerRootReceipt, j as UnsupportedSessionRestoreError, k as defaultSignStrategy, w as wireOpenKeyAuthorize } from './TinyCloudNode-
|
|
4
|
+
export { A as ACCEPTED_MARKER_VERSIONS, l as BOOTSTRAP_COMPLETION_MARKER_KEY, m as BOOTSTRAP_COMPLETION_MARKER_VERSION, n as BootstrapCompletionMarker, B as BootstrapWarning, C as CreateOwnerDelegationParams, D as DelegateToOptions, a as DelegateToResult, b as DelegatedAccess, E as EnsureEncryptionNetworkOptions, I as InvalidRestoredSessionError, N as NodeEventEmitterStrategy, c as NodeUserAuthorization, o as NodeUserAuthorizationAuthorizeFn, d as NodeUserAuthorizationConfig, p as OpenKeyAuthorizationResultV1, q as OpenKeyAuthorizeInput, r as OpenKeyAuthorizeTinyCloud, s as OpenKeyBridgeInput, O as OwnerDelegationReceipt, t as RestorableSession, R as RuntimePermissionGrantOptions, S as SecretPermissionHint, e as SecretReadInput, f as SecretReadResult, g as SignStrategy, T as TinyCloudNode, h as TinyCloudNodeConfig, U as UnifiedOwnerRootInput, i as UnifiedOwnerRootReceipt, j as UnsupportedSessionRestoreError, k as defaultSignStrategy, w as wireOpenKeyAuthorize } from './TinyCloudNode-u_PobKS1.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
|
export { A as AuthDelegationArtifact, b as AuthRequestArtifact, C as CompactRuntimeDelegationInput, D as DelegationAuthority, P as PortableDelegation, R as RUNTIME_DELEGATION_REJECTIONS, c as RuntimeDelegationActivator, e as RuntimeDelegationRejectedError, f as RuntimeDelegationRejection, S as SessionGrantProof, V as ValidatedRuntimeDelegation, g as VerifiedSessionGrant, a as activateCompactRuntimeDelegation, h as activateValidatedRuntimeDelegation, d as deserializeDelegation, i as grantAuthRequest, s as serializeDelegation, j as signedCompactUcanExpiry, k as siweRuntimeDelegation } from './delegation-0LKZkmP2.cjs';
|
|
7
7
|
import { KVReplicaStorage } from '@tinycloud/sdk-services';
|
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, l as BOOTSTRAP_COMPLETION_MARKER_KEY, m as BOOTSTRAP_COMPLETION_MARKER_VERSION, n as BootstrapCompletionMarker, B as BootstrapWarning, C as CreateOwnerDelegationParams, D as DelegateToOptions, a as DelegateToResult, b as DelegatedAccess, E as EnsureEncryptionNetworkOptions, I as InvalidRestoredSessionError, N as NodeEventEmitterStrategy, c as NodeUserAuthorization, o as NodeUserAuthorizationAuthorizeFn, d as NodeUserAuthorizationConfig, p as OpenKeyAuthorizationResultV1, q as OpenKeyAuthorizeInput, r as OpenKeyAuthorizeTinyCloud, s as OpenKeyBridgeInput, O as OwnerDelegationReceipt, t as RestorableSession, R as RuntimePermissionGrantOptions, S as SecretPermissionHint, e as SecretReadInput, f as SecretReadResult, g as SignStrategy, T as TinyCloudNode, h as TinyCloudNodeConfig, U as UnifiedOwnerRootInput, i as UnifiedOwnerRootReceipt, j as UnsupportedSessionRestoreError, k as defaultSignStrategy, w as wireOpenKeyAuthorize } from './TinyCloudNode
|
|
4
|
+
export { A as ACCEPTED_MARKER_VERSIONS, l as BOOTSTRAP_COMPLETION_MARKER_KEY, m as BOOTSTRAP_COMPLETION_MARKER_VERSION, n as BootstrapCompletionMarker, B as BootstrapWarning, C as CreateOwnerDelegationParams, D as DelegateToOptions, a as DelegateToResult, b as DelegatedAccess, E as EnsureEncryptionNetworkOptions, I as InvalidRestoredSessionError, N as NodeEventEmitterStrategy, c as NodeUserAuthorization, o as NodeUserAuthorizationAuthorizeFn, d as NodeUserAuthorizationConfig, p as OpenKeyAuthorizationResultV1, q as OpenKeyAuthorizeInput, r as OpenKeyAuthorizeTinyCloud, s as OpenKeyBridgeInput, O as OwnerDelegationReceipt, t as RestorableSession, R as RuntimePermissionGrantOptions, S as SecretPermissionHint, e as SecretReadInput, f as SecretReadResult, g as SignStrategy, T as TinyCloudNode, h as TinyCloudNodeConfig, U as UnifiedOwnerRootInput, i as UnifiedOwnerRootReceipt, j as UnsupportedSessionRestoreError, k as defaultSignStrategy, w as wireOpenKeyAuthorize } from './TinyCloudNode-CclYdOh4.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
|
export { A as AuthDelegationArtifact, b as AuthRequestArtifact, C as CompactRuntimeDelegationInput, D as DelegationAuthority, P as PortableDelegation, R as RUNTIME_DELEGATION_REJECTIONS, c as RuntimeDelegationActivator, e as RuntimeDelegationRejectedError, f as RuntimeDelegationRejection, S as SessionGrantProof, V as ValidatedRuntimeDelegation, g as VerifiedSessionGrant, a as activateCompactRuntimeDelegation, h as activateValidatedRuntimeDelegation, d as deserializeDelegation, i as grantAuthRequest, s as serializeDelegation, j as signedCompactUcanExpiry, k as siweRuntimeDelegation } from './delegation-0LKZkmP2.js';
|
|
7
7
|
import { KVReplicaStorage } from '@tinycloud/sdk-services';
|
package/dist/index.js
CHANGED
|
@@ -18724,7 +18724,10 @@ import {
|
|
|
18724
18724
|
resolveSecretPath as resolveSecretPath2,
|
|
18725
18725
|
registerPolicyV3,
|
|
18726
18726
|
CREDENTIAL_INVITATION_REQUEST_DOMAIN,
|
|
18727
|
-
|
|
18727
|
+
ShareDeliveryRefusedError,
|
|
18728
|
+
shortDeliveryLinkBodyCid,
|
|
18729
|
+
verifyShareDeliveryAuthorizationV3Bytes,
|
|
18730
|
+
withoutShareLink,
|
|
18728
18731
|
verifyEip191MessageSignature,
|
|
18729
18732
|
signCompactUcanRootAuthorization,
|
|
18730
18733
|
markDelegationTerminal,
|
|
@@ -21721,17 +21724,7 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
21721
21724
|
throw new Error("WASM binding does not support invokeAny");
|
|
21722
21725
|
}
|
|
21723
21726
|
const routedEntries = entries;
|
|
21724
|
-
const
|
|
21725
|
-
const operation = this.operationFromInvokeAnyEntry(entry);
|
|
21726
|
-
return operation ? [operation] : [];
|
|
21727
|
-
});
|
|
21728
|
-
const authorityCid = routedEntries.length === 1 ? routedEntries[0]?.revokeAuthorityCid : void 0;
|
|
21729
|
-
const explicitGrant = authorityCid === void 0 ? void 0 : this.runtimePermissionGrants.find((grant2) => grant2.delegation.cid === authorityCid);
|
|
21730
|
-
if (authorityCid !== void 0 && !explicitGrant) {
|
|
21731
|
-
throw new Error(`Explicit revocation authority ${authorityCid} is not installed.`);
|
|
21732
|
-
}
|
|
21733
|
-
const grant = explicitGrant ?? this.findGrantForOperations(operations);
|
|
21734
|
-
const invocationSession = explicitGrant ? explicitGrant.session : !grant || grant.provenance === "primary" ? session : grant.session;
|
|
21727
|
+
const { session: invocationSession, grant } = this.selectInvokeAnySession(session, entries);
|
|
21735
21728
|
const caveatPreservingEntries = routedEntries.map(({ revokeAuthorityCid: _cid, ...entry }) => {
|
|
21736
21729
|
const requested = this.operationFromInvokeAnyEntry(entry);
|
|
21737
21730
|
const granted = grant && requested && grant.operations.find(
|
|
@@ -21969,6 +21962,27 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
21969
21962
|
get siweDomain() {
|
|
21970
21963
|
return this.config.domain ?? "app.tinycloud.xyz";
|
|
21971
21964
|
}
|
|
21965
|
+
/**
|
|
21966
|
+
* The session (key, issuer, proof) that signs an invokeAny call for `entries`:
|
|
21967
|
+
* the explicit revocation authority, else the covering non-primary runtime
|
|
21968
|
+
* grant, else the caller's session. Everything that re-signs the resulting
|
|
21969
|
+
* invocation must use this session's key.
|
|
21970
|
+
*/
|
|
21971
|
+
selectInvokeAnySession(session, entries) {
|
|
21972
|
+
const routedEntries = entries;
|
|
21973
|
+
const operations = routedEntries.flatMap((entry) => {
|
|
21974
|
+
const operation = this.operationFromInvokeAnyEntry(entry);
|
|
21975
|
+
return operation ? [operation] : [];
|
|
21976
|
+
});
|
|
21977
|
+
const authorityCid = routedEntries.length === 1 ? routedEntries[0]?.revokeAuthorityCid : void 0;
|
|
21978
|
+
const explicitGrant = authorityCid === void 0 ? void 0 : this.runtimePermissionGrants.find((grant2) => grant2.delegation.cid === authorityCid);
|
|
21979
|
+
if (authorityCid !== void 0 && !explicitGrant) {
|
|
21980
|
+
throw new Error(`Explicit revocation authority ${authorityCid} is not installed.`);
|
|
21981
|
+
}
|
|
21982
|
+
const grant = explicitGrant ?? this.findGrantForOperations(operations);
|
|
21983
|
+
const invocationSession = explicitGrant ? explicitGrant.session : !grant || grant.provenance === "primary" ? session : grant.session;
|
|
21984
|
+
return { session: invocationSession, grant };
|
|
21985
|
+
}
|
|
21972
21986
|
/**
|
|
21973
21987
|
* SharingService for receive-only access (no session required), bound to the
|
|
21974
21988
|
* current service graph. This lets session-only users receive sharing links
|
|
@@ -24388,7 +24402,13 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
24388
24402
|
async bindInvocationAudience(authorization, audience) {
|
|
24389
24403
|
const session = this.currentTinyCloudSession() ?? this._activeServiceSession;
|
|
24390
24404
|
if (session === void 0) throw new Error("Not signed in. Call signIn() first.");
|
|
24391
|
-
|
|
24405
|
+
const payload = JSON.parse(
|
|
24406
|
+
new TextDecoder().decode(base64UrlDecode(authorization.split(".")[1] ?? ""))
|
|
24407
|
+
);
|
|
24408
|
+
const did = (value) => String(value).split("#", 1)[0];
|
|
24409
|
+
const signer = [session, ...this.runtimePermissionGrants.map((grant) => grant.session)].find((candidate) => did(candidate.verificationMethod) === did(payload.iss));
|
|
24410
|
+
if (!signer) throw new Error("invocation issuer does not match a held session");
|
|
24411
|
+
return rewriteInvocationAudience(authorization, audience, signer.jwk);
|
|
24392
24412
|
}
|
|
24393
24413
|
/**
|
|
24394
24414
|
* Connect a wallet to upgrade from session-only mode to wallet mode.
|
|
@@ -24723,23 +24743,25 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
24723
24743
|
throw new Error("WASM binding does not support invocation CID computation");
|
|
24724
24744
|
}
|
|
24725
24745
|
const session = binding?.session ?? this.requireEncryptionSession();
|
|
24746
|
+
const entries = [
|
|
24747
|
+
{
|
|
24748
|
+
resource: input.networkId,
|
|
24749
|
+
service: "encryption",
|
|
24750
|
+
path: input.networkId,
|
|
24751
|
+
action: input.action
|
|
24752
|
+
}
|
|
24753
|
+
];
|
|
24726
24754
|
const headers = this.invokeAnyWithRuntimePermissions(
|
|
24727
24755
|
session,
|
|
24728
|
-
|
|
24729
|
-
{
|
|
24730
|
-
resource: input.networkId,
|
|
24731
|
-
service: "encryption",
|
|
24732
|
-
path: input.networkId,
|
|
24733
|
-
action: input.action
|
|
24734
|
-
}
|
|
24735
|
-
],
|
|
24756
|
+
entries,
|
|
24736
24757
|
[input.facts]
|
|
24737
24758
|
);
|
|
24759
|
+
const signingSession = this.selectInvokeAnySession(session, entries).session;
|
|
24738
24760
|
const authorization = authorizationHeader(headers);
|
|
24739
24761
|
const audienceBound = await rewriteInvocationAudience(
|
|
24740
24762
|
authorization,
|
|
24741
24763
|
input.targetNode,
|
|
24742
|
-
|
|
24764
|
+
signingSession.jwk
|
|
24743
24765
|
);
|
|
24744
24766
|
binding?.graph.assertActive();
|
|
24745
24767
|
return {
|
|
@@ -24792,7 +24814,11 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
24792
24814
|
path: networkId,
|
|
24793
24815
|
actions: ["tinycloud.encryption/decrypt"]
|
|
24794
24816
|
}) : void 0;
|
|
24795
|
-
throw new DecryptTransportResponseError(
|
|
24817
|
+
throw new DecryptTransportResponseError(
|
|
24818
|
+
response.status,
|
|
24819
|
+
permissionHint,
|
|
24820
|
+
response.status === 404 && networkId === this.getDefaultEncryptionNetworkId() && await response.text().catch(() => "") === "network not found" ? `Network not found: ${networkId}. Sign in again with a current SDK to create the account's encryption network.` : void 0
|
|
24821
|
+
);
|
|
24796
24822
|
}
|
|
24797
24823
|
return await response.json();
|
|
24798
24824
|
}
|
|
@@ -25257,8 +25283,14 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
25257
25283
|
fetch: globalThis.fetch.bind(globalThis)
|
|
25258
25284
|
});
|
|
25259
25285
|
}
|
|
25260
|
-
/**
|
|
25286
|
+
/**
|
|
25287
|
+
* Authorize one short-lived v3 delivery. `shareUrl` is the short `/s/<id>#v=4&k=…&c=…` link: the node fetches the
|
|
25288
|
+
* sealed body by id and opens it with the link's key, so the body of the request carries the link and nothing else
|
|
25289
|
+
* of the share. `envelope` is the signed v3 envelope the sender holds; it checks the node's admission here and is
|
|
25290
|
+
* not sent.
|
|
25291
|
+
*/
|
|
25261
25292
|
async authorizeShareDeliveryV3(input) {
|
|
25293
|
+
const envelopeRef = await shortDeliveryLinkBodyCid(input.shareUrl, input.trustedOrigins);
|
|
25262
25294
|
const session = this.currentTinyCloudSession();
|
|
25263
25295
|
const serviceSession = this._serviceContext?.session;
|
|
25264
25296
|
if (!session || !serviceSession) throw new Error("Share delivery requires an authenticated session");
|
|
@@ -25268,15 +25300,12 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
25268
25300
|
}
|
|
25269
25301
|
const jtiDigest = new Uint8Array(await crypto.subtle.digest("SHA-256", idempotencyBytes));
|
|
25270
25302
|
const body = {
|
|
25271
|
-
envelope: input.envelope,
|
|
25272
|
-
sealedEnvelope: input.sealedEnvelope,
|
|
25273
|
-
envelopeKey: input.envelopeKey,
|
|
25274
|
-
shareCid: input.shareCid,
|
|
25275
25303
|
recipientEmail: input.recipientEmail,
|
|
25276
25304
|
shareUrl: input.shareUrl,
|
|
25277
25305
|
documentName: input.documentName,
|
|
25278
25306
|
jti: base64UrlEncode(jtiDigest.slice(0, 16)),
|
|
25279
|
-
|
|
25307
|
+
// Re-normalised through Date, so the sent value is always `YYYY-MM-DDTHH:mm:ss.SSSZ` (UTC, three digits).
|
|
25308
|
+
expiresAt: new Date(input.expiresAt).toISOString()
|
|
25280
25309
|
};
|
|
25281
25310
|
const requestBodyDigest = base64UrlEncode(new Uint8Array(await crypto.subtle.digest("SHA-256", new TextEncoder().encode(canonicalizeEncryptionJson(body)))));
|
|
25282
25311
|
const request = { ...body, requestBodyDigest };
|
|
@@ -25286,9 +25315,16 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
25286
25315
|
headers: { accept: "application/json", "content-type": "application/json", authorization },
|
|
25287
25316
|
body: canonicalizeEncryptionJson(request)
|
|
25288
25317
|
});
|
|
25289
|
-
if (
|
|
25290
|
-
|
|
25318
|
+
if (response.status === 400 || response.status === 422) throw new ShareDeliveryRefusedError();
|
|
25319
|
+
if (!response.ok) {
|
|
25320
|
+
const reply = await response.text().catch(() => response.statusText);
|
|
25321
|
+
const body2 = (await withoutShareLink(reply, input.shareUrl)).trim().slice(0, 512);
|
|
25322
|
+
throw Object.assign(new Error(`V3 share delivery authorization failed: HTTP ${response.status}${body2 ? ` - ${body2}` : ""}`), { status: response.status });
|
|
25323
|
+
}
|
|
25324
|
+
const verified = await verifyShareDeliveryAuthorizationV3Bytes(new Uint8Array(await response.arrayBuffer()), {
|
|
25291
25325
|
request,
|
|
25326
|
+
envelope: input.envelope,
|
|
25327
|
+
envelopeRef,
|
|
25292
25328
|
senderKeyDid: this.credentialHolderDid,
|
|
25293
25329
|
deliveryAudience: input.deliveryAudience
|
|
25294
25330
|
});
|