@tinycloud/node-sdk 2.3.0-beta.2 → 2.3.0-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/{core-CWdCZ8q6.d.cts → core-CNyXnUx9.d.cts} +0 -1
- package/dist/{core-CWdCZ8q6.d.ts → core-CNyXnUx9.d.ts} +0 -1
- package/dist/core.cjs +70 -38
- 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 +84 -42
- package/dist/core.js.map +1 -1
- package/dist/index.cjs +70 -38
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +79 -41
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ISigner, Bytes, IWasmBindings, ISessionManager } from '@tinycloud/sdk-core';
|
|
2
|
-
export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, AutoApproveSpaceCreationHandler, AutoRejectStrategy, AutoSignStrategy, BatchOptions, BatchResponse, BuildCanonicalDecryptRequestInput, BuildDecryptFactsInput, BuildDecryptInvocationInput, BuiltDecryptInvocation, CallbackStrategy, CanonicalDecryptRequest, CanonicalJson, CapabilityEntry, CapabilityKeyRegistry, CapabilityKeyRegistryErrorCode, CapabilityKeyRegistryErrorCodes, 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, Delegation, DelegationChain, DelegationChainV2, DelegationDirection, DelegationError, DelegationErrorCode, DelegationErrorCodes, DelegationFilters, DelegationManager, DelegationManagerConfig, DelegationRecord, DelegationResult, 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, IUserAuthorization, IWasmBindings, IngestOptions, InlineEncryptedEnvelope, InvokeFunction, JWK, KVCreateSignedReadUrlOptions, KVResponse, KVService, KVServiceConfig, KVSignedReadUrlResponse, KeyInfo, KeyProvider, KeyType, Manifest, ManifestDefaults, ManifestRegistryRecord, ManifestSecretActions, ManifestValidationError, NETWORK_NAME_PATTERN, NetworkDescriptor, NetworkIdError, NodeDescriptorFetcher, ParsedNetworkId, PermissionEntry, PermissionNotInManifestError, PersistedSessionData, PrefixedKVService, ProtocolMismatchError, QueryOptions, QueryResponse, RandomReceiverKeyInput, ReceiveOptions, ReceiverKeyPair, ReceiverKeySigner, ResolvedCapabilities, ResolvedDelegate, ResolvedSecretPath, ResourceCapability, SECRET_NAME_RE, SQLAction, SQLActionType, SQLService, SQLServiceConfig, SchemaInfo, SecretPayload, 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, StoredDelegationChain, SubscribeOptions, TableInfo, TinyCloud, TinyCloudConfig, TinyCloudSession, UnsupportedFeatureError, VAULT_PERMISSION_SERVICE, VaultCrypto, VaultEntry, VaultError, VaultGetOptions, VaultGrantOptions, VaultHeaders, VaultListOptions, VaultPublicSpaceKVActions, VaultPutOptions, VerifyDecryptResponseInput, VersionCheckError, ViewInfo, WasmVaultFunctions, WellKnownDescriptorFetcher, buildCanonicalDecryptRequest, buildDecryptAttenuation, buildDecryptFacts, buildDecryptInvocation, buildNetworkId, buildSpaceUri, canonicalHashHex, canonicalSignedResponse, canonicalizeEncryptionJson, canonicalizeSecretScope, checkDecryptInvocationInput, checkNodeInfo, composeManifestRequest, createCapabilityKeyRegistry, createSharingService, createSpaceService, createVaultCrypto, decryptEnvelopeWithKey, defaultSpaceCreationHandler, deriveSignedReceiverKey, discoverNetwork, encryptToNetwork, encryptionBase64Decode, encryptionBase64Encode, encryptionError, encryptionUtf8Decode, encryptionUtf8Encode, ensureNetworkUsableForDecrypt, expandActionShortNames, expandPermissionEntries, expandPermissionEntry, generateRandomReceiverKey, hexDecode, hexEncode, isCapabilitySubset, isNetworkId, loadManifest, makePublicSpaceId, networkDiscoveryKey, openWrappedKey, parseExpiry, parseNetworkId, parseSpaceUri, resolveManifest, resolveSecretListPrefix, resolveSecretPath, resourceCapabilitiesToSpaceAbilitiesMap, validateEnvelope, validateManifest, verifyDecryptResponse } from '@tinycloud/sdk-core';
|
|
3
|
-
export { D as DelegateToOptions, a as DelegateToResult, b as DelegatedAccess, F as FileSessionStorage, M as MemorySessionStorage, N as NodeEventEmitterStrategy, c as NodeUserAuthorization, d as NodeUserAuthorizationConfig, P as PortableDelegation, R as RestorableSession, e as RuntimePermissionGrantOptions, S as SignStrategy, T as TinyCloudNode, f as TinyCloudNodeConfig, W as WasmKeyProvider, g as WasmKeyProviderConfig, h as createWasmKeyProvider, i as defaultSignStrategy, j as deserializeDelegation, s as serializeDelegation } from './core-
|
|
2
|
+
export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, AutoApproveSpaceCreationHandler, AutoRejectStrategy, AutoSignStrategy, BatchOptions, BatchResponse, BuildCanonicalDecryptRequestInput, BuildDecryptFactsInput, BuildDecryptInvocationInput, BuiltDecryptInvocation, CallbackStrategy, CanonicalAddress, CanonicalDecryptRequest, CanonicalJson, CanonicalParsedNetworkId, CapabilityEntry, CapabilityKeyRegistry, CapabilityKeyRegistryErrorCode, CapabilityKeyRegistryErrorCodes, 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, Delegation, DelegationChain, DelegationChainV2, DelegationDirection, DelegationError, DelegationErrorCode, DelegationErrorCodes, DelegationFilters, DelegationManager, DelegationManagerConfig, DelegationRecord, DelegationResult, 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, IUserAuthorization, IWasmBindings, IdentityParseError, IngestOptions, InlineEncryptedEnvelope, InvokeFunction, JWK, KVCreateSignedReadUrlOptions, KVResponse, KVService, KVServiceConfig, KVSignedReadUrlResponse, KeyInfo, KeyProvider, KeyType, Manifest, ManifestDefaults, ManifestRegistryRecord, ManifestSecretActions, ManifestValidationError, NETWORK_NAME_PATTERN, NetworkDescriptor, NetworkIdError, NodeDescriptorFetcher, ParsedNetworkId, PermissionEntry, PermissionNotInManifestError, PersistedSessionData, PkhDidParts, PrefixedKVService, ProtocolMismatchError, QueryOptions, QueryResponse, RandomReceiverKeyInput, ReceiveOptions, ReceiverKeyPair, ReceiverKeySigner, ResolvedCapabilities, ResolvedDelegate, ResolvedSecretPath, ResourceCapability, SECRET_NAME_RE, SQLAction, SQLActionType, SQLService, SQLServiceConfig, SchemaInfo, SecretPayload, 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, StoredDelegationChain, SubscribeOptions, TableInfo, TinyCloud, TinyCloudConfig, TinyCloudSession, UnsupportedFeatureError, VAULT_PERMISSION_SERVICE, VaultCrypto, VaultEntry, VaultError, VaultGetOptions, VaultGrantOptions, VaultHeaders, VaultListOptions, VaultPublicSpaceKVActions, VaultPutOptions, VerifyDecryptResponseInput, VersionCheckError, ViewInfo, WasmVaultFunctions, WellKnownDescriptorFetcher, addressStorageKey, buildCanonicalDecryptRequest, buildDecryptAttenuation, buildDecryptFacts, buildDecryptInvocation, buildNetworkId, buildSpaceUri, canonicalHashHex, canonicalSignedResponse, canonicalizeAddress, canonicalizeDid, canonicalizeDidUrl, canonicalizeEncryptionJson, canonicalizeNetworkId, canonicalizeSecretScope, checkDecryptInvocationInput, checkNodeInfo, composeManifestRequest, createCapabilityKeyRegistry, createSharingService, createSpaceService, createVaultCrypto, decryptEnvelopeWithKey, defaultSpaceCreationHandler, deriveSignedReceiverKey, didCacheKey, didEquals, discoverNetwork, encryptToNetwork, encryptionBase64Decode, encryptionBase64Encode, encryptionError, encryptionUtf8Decode, encryptionUtf8Encode, ensureNetworkUsableForDecrypt, expandActionShortNames, expandPermissionEntries, expandPermissionEntry, generateRandomReceiverKey, hexDecode, hexEncode, isCapabilitySubset, isEvmAddress, isNetworkId, loadManifest, makePkhSpaceId, makePublicSpaceId, networkDiscoveryKey, openWrappedKey, parseCanonicalNetworkId, parseExpiry, parseNetworkId, parsePkhDid, parseSpaceUri, pkhDid, principalDid, principalDidEquals, resolveManifest, resolveSecretListPrefix, resolveSecretPath, resourceCapabilitiesToSpaceAbilitiesMap, validateEnvelope, validateManifest, verifyDecryptResponse } from '@tinycloud/sdk-core';
|
|
3
|
+
export { D as DelegateToOptions, a as DelegateToResult, b as DelegatedAccess, F as FileSessionStorage, M as MemorySessionStorage, N as NodeEventEmitterStrategy, c as NodeUserAuthorization, d as NodeUserAuthorizationConfig, P as PortableDelegation, R as RestorableSession, e as RuntimePermissionGrantOptions, S as SignStrategy, T as TinyCloudNode, f as TinyCloudNodeConfig, W as WasmKeyProvider, g as WasmKeyProviderConfig, h as createWasmKeyProvider, i as defaultSignStrategy, j as deserializeDelegation, s as serializeDelegation } from './core-CNyXnUx9.cjs';
|
|
4
4
|
import { invoke, invokeAny, computeCid, prepareSession, completeSessionSetup, ensureEip55, makeSpaceId, createDelegation, parseRecapFromSiwe, 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';
|
|
5
5
|
import 'events';
|
|
6
6
|
import '@tinycloud/sdk-services';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ISigner, Bytes, IWasmBindings, ISessionManager } from '@tinycloud/sdk-core';
|
|
2
|
-
export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, AutoApproveSpaceCreationHandler, AutoRejectStrategy, AutoSignStrategy, BatchOptions, BatchResponse, BuildCanonicalDecryptRequestInput, BuildDecryptFactsInput, BuildDecryptInvocationInput, BuiltDecryptInvocation, CallbackStrategy, CanonicalDecryptRequest, CanonicalJson, CapabilityEntry, CapabilityKeyRegistry, CapabilityKeyRegistryErrorCode, CapabilityKeyRegistryErrorCodes, 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, Delegation, DelegationChain, DelegationChainV2, DelegationDirection, DelegationError, DelegationErrorCode, DelegationErrorCodes, DelegationFilters, DelegationManager, DelegationManagerConfig, DelegationRecord, DelegationResult, 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, IUserAuthorization, IWasmBindings, IngestOptions, InlineEncryptedEnvelope, InvokeFunction, JWK, KVCreateSignedReadUrlOptions, KVResponse, KVService, KVServiceConfig, KVSignedReadUrlResponse, KeyInfo, KeyProvider, KeyType, Manifest, ManifestDefaults, ManifestRegistryRecord, ManifestSecretActions, ManifestValidationError, NETWORK_NAME_PATTERN, NetworkDescriptor, NetworkIdError, NodeDescriptorFetcher, ParsedNetworkId, PermissionEntry, PermissionNotInManifestError, PersistedSessionData, PrefixedKVService, ProtocolMismatchError, QueryOptions, QueryResponse, RandomReceiverKeyInput, ReceiveOptions, ReceiverKeyPair, ReceiverKeySigner, ResolvedCapabilities, ResolvedDelegate, ResolvedSecretPath, ResourceCapability, SECRET_NAME_RE, SQLAction, SQLActionType, SQLService, SQLServiceConfig, SchemaInfo, SecretPayload, 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, StoredDelegationChain, SubscribeOptions, TableInfo, TinyCloud, TinyCloudConfig, TinyCloudSession, UnsupportedFeatureError, VAULT_PERMISSION_SERVICE, VaultCrypto, VaultEntry, VaultError, VaultGetOptions, VaultGrantOptions, VaultHeaders, VaultListOptions, VaultPublicSpaceKVActions, VaultPutOptions, VerifyDecryptResponseInput, VersionCheckError, ViewInfo, WasmVaultFunctions, WellKnownDescriptorFetcher, buildCanonicalDecryptRequest, buildDecryptAttenuation, buildDecryptFacts, buildDecryptInvocation, buildNetworkId, buildSpaceUri, canonicalHashHex, canonicalSignedResponse, canonicalizeEncryptionJson, canonicalizeSecretScope, checkDecryptInvocationInput, checkNodeInfo, composeManifestRequest, createCapabilityKeyRegistry, createSharingService, createSpaceService, createVaultCrypto, decryptEnvelopeWithKey, defaultSpaceCreationHandler, deriveSignedReceiverKey, discoverNetwork, encryptToNetwork, encryptionBase64Decode, encryptionBase64Encode, encryptionError, encryptionUtf8Decode, encryptionUtf8Encode, ensureNetworkUsableForDecrypt, expandActionShortNames, expandPermissionEntries, expandPermissionEntry, generateRandomReceiverKey, hexDecode, hexEncode, isCapabilitySubset, isNetworkId, loadManifest, makePublicSpaceId, networkDiscoveryKey, openWrappedKey, parseExpiry, parseNetworkId, parseSpaceUri, resolveManifest, resolveSecretListPrefix, resolveSecretPath, resourceCapabilitiesToSpaceAbilitiesMap, validateEnvelope, validateManifest, verifyDecryptResponse } from '@tinycloud/sdk-core';
|
|
3
|
-
export { D as DelegateToOptions, a as DelegateToResult, b as DelegatedAccess, F as FileSessionStorage, M as MemorySessionStorage, N as NodeEventEmitterStrategy, c as NodeUserAuthorization, d as NodeUserAuthorizationConfig, P as PortableDelegation, R as RestorableSession, e as RuntimePermissionGrantOptions, S as SignStrategy, T as TinyCloudNode, f as TinyCloudNodeConfig, W as WasmKeyProvider, g as WasmKeyProviderConfig, h as createWasmKeyProvider, i as defaultSignStrategy, j as deserializeDelegation, s as serializeDelegation } from './core-
|
|
2
|
+
export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, AutoApproveSpaceCreationHandler, AutoRejectStrategy, AutoSignStrategy, BatchOptions, BatchResponse, BuildCanonicalDecryptRequestInput, BuildDecryptFactsInput, BuildDecryptInvocationInput, BuiltDecryptInvocation, CallbackStrategy, CanonicalAddress, CanonicalDecryptRequest, CanonicalJson, CanonicalParsedNetworkId, CapabilityEntry, CapabilityKeyRegistry, CapabilityKeyRegistryErrorCode, CapabilityKeyRegistryErrorCodes, 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, Delegation, DelegationChain, DelegationChainV2, DelegationDirection, DelegationError, DelegationErrorCode, DelegationErrorCodes, DelegationFilters, DelegationManager, DelegationManagerConfig, DelegationRecord, DelegationResult, 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, IUserAuthorization, IWasmBindings, IdentityParseError, IngestOptions, InlineEncryptedEnvelope, InvokeFunction, JWK, KVCreateSignedReadUrlOptions, KVResponse, KVService, KVServiceConfig, KVSignedReadUrlResponse, KeyInfo, KeyProvider, KeyType, Manifest, ManifestDefaults, ManifestRegistryRecord, ManifestSecretActions, ManifestValidationError, NETWORK_NAME_PATTERN, NetworkDescriptor, NetworkIdError, NodeDescriptorFetcher, ParsedNetworkId, PermissionEntry, PermissionNotInManifestError, PersistedSessionData, PkhDidParts, PrefixedKVService, ProtocolMismatchError, QueryOptions, QueryResponse, RandomReceiverKeyInput, ReceiveOptions, ReceiverKeyPair, ReceiverKeySigner, ResolvedCapabilities, ResolvedDelegate, ResolvedSecretPath, ResourceCapability, SECRET_NAME_RE, SQLAction, SQLActionType, SQLService, SQLServiceConfig, SchemaInfo, SecretPayload, 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, StoredDelegationChain, SubscribeOptions, TableInfo, TinyCloud, TinyCloudConfig, TinyCloudSession, UnsupportedFeatureError, VAULT_PERMISSION_SERVICE, VaultCrypto, VaultEntry, VaultError, VaultGetOptions, VaultGrantOptions, VaultHeaders, VaultListOptions, VaultPublicSpaceKVActions, VaultPutOptions, VerifyDecryptResponseInput, VersionCheckError, ViewInfo, WasmVaultFunctions, WellKnownDescriptorFetcher, addressStorageKey, buildCanonicalDecryptRequest, buildDecryptAttenuation, buildDecryptFacts, buildDecryptInvocation, buildNetworkId, buildSpaceUri, canonicalHashHex, canonicalSignedResponse, canonicalizeAddress, canonicalizeDid, canonicalizeDidUrl, canonicalizeEncryptionJson, canonicalizeNetworkId, canonicalizeSecretScope, checkDecryptInvocationInput, checkNodeInfo, composeManifestRequest, createCapabilityKeyRegistry, createSharingService, createSpaceService, createVaultCrypto, decryptEnvelopeWithKey, defaultSpaceCreationHandler, deriveSignedReceiverKey, didCacheKey, didEquals, discoverNetwork, encryptToNetwork, encryptionBase64Decode, encryptionBase64Encode, encryptionError, encryptionUtf8Decode, encryptionUtf8Encode, ensureNetworkUsableForDecrypt, expandActionShortNames, expandPermissionEntries, expandPermissionEntry, generateRandomReceiverKey, hexDecode, hexEncode, isCapabilitySubset, isEvmAddress, isNetworkId, loadManifest, makePkhSpaceId, makePublicSpaceId, networkDiscoveryKey, openWrappedKey, parseCanonicalNetworkId, parseExpiry, parseNetworkId, parsePkhDid, parseSpaceUri, pkhDid, principalDid, principalDidEquals, resolveManifest, resolveSecretListPrefix, resolveSecretPath, resourceCapabilitiesToSpaceAbilitiesMap, validateEnvelope, validateManifest, verifyDecryptResponse } from '@tinycloud/sdk-core';
|
|
3
|
+
export { D as DelegateToOptions, a as DelegateToResult, b as DelegatedAccess, F as FileSessionStorage, M as MemorySessionStorage, N as NodeEventEmitterStrategy, c as NodeUserAuthorization, d as NodeUserAuthorizationConfig, P as PortableDelegation, R as RestorableSession, e as RuntimePermissionGrantOptions, S as SignStrategy, T as TinyCloudNode, f as TinyCloudNodeConfig, W as WasmKeyProvider, g as WasmKeyProviderConfig, h as createWasmKeyProvider, i as defaultSignStrategy, j as deserializeDelegation, s as serializeDelegation } from './core-CNyXnUx9.js';
|
|
4
4
|
import { invoke, invokeAny, computeCid, prepareSession, completeSessionSetup, ensureEip55, makeSpaceId, createDelegation, parseRecapFromSiwe, 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';
|
|
5
5
|
import 'events';
|
|
6
6
|
import '@tinycloud/sdk-services';
|
package/dist/index.js
CHANGED
|
@@ -17183,7 +17183,10 @@ import {
|
|
|
17183
17183
|
EXPIRY as EXPIRY3,
|
|
17184
17184
|
canonicalHashHex,
|
|
17185
17185
|
canonicalizeEncryptionJson,
|
|
17186
|
-
verifyDidKeyEd25519Signature
|
|
17186
|
+
verifyDidKeyEd25519Signature,
|
|
17187
|
+
canonicalizeAddress as canonicalizeAddress2,
|
|
17188
|
+
pkhDid as pkhDid2,
|
|
17189
|
+
principalDidEquals
|
|
17187
17190
|
} from "@tinycloud/sdk-core";
|
|
17188
17191
|
|
|
17189
17192
|
// src/authorization/NodeUserAuthorization.ts
|
|
@@ -17199,7 +17202,10 @@ import {
|
|
|
17199
17202
|
resourceCapabilitiesToAbilitiesMap,
|
|
17200
17203
|
resourceCapabilitiesToSpaceAbilitiesMap,
|
|
17201
17204
|
resolveTinyCloudHosts,
|
|
17202
|
-
EXPIRY
|
|
17205
|
+
EXPIRY,
|
|
17206
|
+
canonicalizeAddress,
|
|
17207
|
+
makePkhSpaceId,
|
|
17208
|
+
pkhDid
|
|
17203
17209
|
} from "@tinycloud/sdk-core";
|
|
17204
17210
|
|
|
17205
17211
|
// src/authorization/strategies.ts
|
|
@@ -17396,15 +17402,16 @@ var NodeUserAuthorization = class {
|
|
|
17396
17402
|
* expired-at-epoch-zero.
|
|
17397
17403
|
*/
|
|
17398
17404
|
setRestoredTinyCloudSession(session) {
|
|
17399
|
-
|
|
17400
|
-
this.
|
|
17405
|
+
const address = canonicalizeAddress(session.address);
|
|
17406
|
+
this._tinyCloudSession = { ...session, address };
|
|
17407
|
+
this._address = address;
|
|
17401
17408
|
this._chainId = session.chainId;
|
|
17402
17409
|
}
|
|
17403
17410
|
async resolveTinyCloudHostsForSignIn(address, chainId) {
|
|
17404
17411
|
if (this.tinycloudHosts && this.tinycloudHosts.length > 0) {
|
|
17405
17412
|
return;
|
|
17406
17413
|
}
|
|
17407
|
-
const subject =
|
|
17414
|
+
const subject = pkhDid(address, chainId);
|
|
17408
17415
|
const resolved = await resolveTinyCloudHosts(subject, {
|
|
17409
17416
|
registryUrl: this.tinycloudRegistryUrl,
|
|
17410
17417
|
fallbackHosts: this.tinycloudFallbackHosts
|
|
@@ -17468,19 +17475,19 @@ var NodeUserAuthorization = class {
|
|
|
17468
17475
|
if (space.startsWith("tinycloud:")) {
|
|
17469
17476
|
return space;
|
|
17470
17477
|
}
|
|
17471
|
-
return
|
|
17478
|
+
return makePkhSpaceId(address, chainId, space);
|
|
17472
17479
|
}
|
|
17473
17480
|
defaultEncryptionNetworkId(address, chainId) {
|
|
17474
|
-
return `urn:tinycloud:encryption
|
|
17481
|
+
return `urn:tinycloud:encryption:${pkhDid(address, chainId)}:default`;
|
|
17475
17482
|
}
|
|
17476
17483
|
resolveSignInCapabilities(address, chainId) {
|
|
17477
17484
|
const request = this.getCapabilityRequest();
|
|
17478
17485
|
if (request === void 0) {
|
|
17479
17486
|
const defaultNetworkId = this.defaultEncryptionNetworkId(address, chainId);
|
|
17480
|
-
const secretsSpaceId =
|
|
17487
|
+
const secretsSpaceId = makePkhSpaceId(address, chainId, "secrets");
|
|
17481
17488
|
return {
|
|
17482
17489
|
abilities: this.defaultActions,
|
|
17483
|
-
spaceId:
|
|
17490
|
+
spaceId: makePkhSpaceId(address, chainId, this.spacePrefix),
|
|
17484
17491
|
spaceAbilities: {
|
|
17485
17492
|
[secretsSpaceId]: {
|
|
17486
17493
|
kv: {
|
|
@@ -17742,9 +17749,9 @@ var NodeUserAuthorization = class {
|
|
|
17742
17749
|
* @param options - Optional per-call SIWE overrides for this sign-in only
|
|
17743
17750
|
*/
|
|
17744
17751
|
async signIn(options) {
|
|
17745
|
-
this._address = await this.signer.getAddress();
|
|
17752
|
+
this._address = canonicalizeAddress(await this.signer.getAddress());
|
|
17746
17753
|
this._chainId = await this.signer.getChainId();
|
|
17747
|
-
const address = this.
|
|
17754
|
+
const address = this._address;
|
|
17748
17755
|
const chainId = this._chainId;
|
|
17749
17756
|
await this.resolveTinyCloudHostsForSignIn(address, chainId);
|
|
17750
17757
|
const keyId = `session-${Date.now()}`;
|
|
@@ -17789,7 +17796,7 @@ var NodeUserAuthorization = class {
|
|
|
17789
17796
|
siwe: prepared.siwe,
|
|
17790
17797
|
signature: signature2
|
|
17791
17798
|
};
|
|
17792
|
-
const spacesMetadata = this.enablePublicSpace ? { public:
|
|
17799
|
+
const spacesMetadata = this.enablePublicSpace ? { public: makePkhSpaceId(address, chainId, "public") } : void 0;
|
|
17793
17800
|
const tinyCloudSession = {
|
|
17794
17801
|
address,
|
|
17795
17802
|
chainId,
|
|
@@ -17864,7 +17871,7 @@ var NodeUserAuthorization = class {
|
|
|
17864
17871
|
*/
|
|
17865
17872
|
async signMessage(message) {
|
|
17866
17873
|
if (!this._address) {
|
|
17867
|
-
this._address = await this.signer.getAddress();
|
|
17874
|
+
this._address = canonicalizeAddress(await this.signer.getAddress());
|
|
17868
17875
|
}
|
|
17869
17876
|
if (!this._chainId) {
|
|
17870
17877
|
this._chainId = await this.signer.getChainId();
|
|
@@ -17891,7 +17898,7 @@ var NodeUserAuthorization = class {
|
|
|
17891
17898
|
* ```
|
|
17892
17899
|
*/
|
|
17893
17900
|
async prepareSessionForSigning() {
|
|
17894
|
-
const address =
|
|
17901
|
+
const address = canonicalizeAddress(await this.signer.getAddress());
|
|
17895
17902
|
const chainId = await this.signer.getChainId();
|
|
17896
17903
|
const keyId = `session-${Date.now()}`;
|
|
17897
17904
|
this.sessionManager.renameSessionKeyId("default", keyId);
|
|
@@ -17941,7 +17948,7 @@ var NodeUserAuthorization = class {
|
|
|
17941
17948
|
...prepared,
|
|
17942
17949
|
signature: signature2
|
|
17943
17950
|
});
|
|
17944
|
-
const address =
|
|
17951
|
+
const address = canonicalizeAddress(await this.signer.getAddress());
|
|
17945
17952
|
const chainId = await this.signer.getChainId();
|
|
17946
17953
|
await this.resolveTinyCloudHostsForSignIn(address, chainId);
|
|
17947
17954
|
const clientSession = {
|
|
@@ -17952,7 +17959,7 @@ var NodeUserAuthorization = class {
|
|
|
17952
17959
|
siwe: prepared.siwe,
|
|
17953
17960
|
signature: signature2
|
|
17954
17961
|
};
|
|
17955
|
-
const spacesMetadata = this.enablePublicSpace ? { public:
|
|
17962
|
+
const spacesMetadata = this.enablePublicSpace ? { public: makePkhSpaceId(address, chainId, "public") } : void 0;
|
|
17956
17963
|
const tinyCloudSession = {
|
|
17957
17964
|
address,
|
|
17958
17965
|
chainId,
|
|
@@ -18495,6 +18502,13 @@ var NETWORK_CREATE_ACTION = "tinycloud.encryption/network.create";
|
|
|
18495
18502
|
var DECRYPT_ACTION = "tinycloud.encryption/decrypt";
|
|
18496
18503
|
var NETWORK_ADMIN_TYPE = "tinycloud.encryption.network-admin/v1";
|
|
18497
18504
|
var DEFAULT_SESSION_EXPIRATION_MS = EXPIRY3.SESSION_MS;
|
|
18505
|
+
function didPrincipalMatches(actual, expected) {
|
|
18506
|
+
try {
|
|
18507
|
+
return principalDidEquals(actual, expected);
|
|
18508
|
+
} catch {
|
|
18509
|
+
return actual === expected;
|
|
18510
|
+
}
|
|
18511
|
+
}
|
|
18498
18512
|
function base64UrlEncode(bytes) {
|
|
18499
18513
|
const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
|
|
18500
18514
|
let output = "";
|
|
@@ -18791,7 +18805,7 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
18791
18805
|
*/
|
|
18792
18806
|
get did() {
|
|
18793
18807
|
if (this._address) {
|
|
18794
|
-
return
|
|
18808
|
+
return pkhDid2(this._address, this._chainId);
|
|
18795
18809
|
}
|
|
18796
18810
|
return this.sessionManager.getDID(this.sessionKeyId);
|
|
18797
18811
|
}
|
|
@@ -18808,7 +18822,7 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
18808
18822
|
* Get the Ethereum address for this user.
|
|
18809
18823
|
*/
|
|
18810
18824
|
get address() {
|
|
18811
|
-
return this._address;
|
|
18825
|
+
return this.auth?.address() ?? this._address;
|
|
18812
18826
|
}
|
|
18813
18827
|
/**
|
|
18814
18828
|
* Check if this instance is in session-only mode (no wallet).
|
|
@@ -18846,7 +18860,7 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
18846
18860
|
);
|
|
18847
18861
|
}
|
|
18848
18862
|
await this.wasmBindings.ensureInitialized?.();
|
|
18849
|
-
this._address = await this.signer.getAddress();
|
|
18863
|
+
this._address = canonicalizeAddress2(await this.signer.getAddress());
|
|
18850
18864
|
this._chainId = await this.signer.getChainId();
|
|
18851
18865
|
this._kv = void 0;
|
|
18852
18866
|
this._sql = void 0;
|
|
@@ -18953,8 +18967,9 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
18953
18967
|
this._spaceService = void 0;
|
|
18954
18968
|
this._serviceContext = void 0;
|
|
18955
18969
|
this.runtimePermissionGrants = [];
|
|
18956
|
-
|
|
18957
|
-
|
|
18970
|
+
const restoredAddress = sessionData.address ? canonicalizeAddress2(sessionData.address) : void 0;
|
|
18971
|
+
if (restoredAddress) {
|
|
18972
|
+
this._address = restoredAddress;
|
|
18958
18973
|
}
|
|
18959
18974
|
if (sessionData.chainId) {
|
|
18960
18975
|
this._chainId = sessionData.chainId;
|
|
@@ -18989,9 +19004,9 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
18989
19004
|
this._vault.initialize(this._serviceContext);
|
|
18990
19005
|
this._serviceContext.registerService("vault", this._vault);
|
|
18991
19006
|
this.initializeV2Services(serviceSession);
|
|
18992
|
-
if (sessionData.siwe &&
|
|
19007
|
+
if (sessionData.siwe && restoredAddress && sessionData.chainId) {
|
|
18993
19008
|
const tcSession = {
|
|
18994
|
-
address:
|
|
19009
|
+
address: restoredAddress,
|
|
18995
19010
|
chainId: sessionData.chainId,
|
|
18996
19011
|
sessionKey: JSON.stringify(sessionData.jwk),
|
|
18997
19012
|
spaceId: sessionData.spaceId,
|
|
@@ -19330,8 +19345,8 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
19330
19345
|
fetchByNetworkId: (networkId) => this.getEncryptionNetwork(networkId)
|
|
19331
19346
|
},
|
|
19332
19347
|
wellKnown: {
|
|
19333
|
-
fetchWellKnown: async (
|
|
19334
|
-
if (!this._address ||
|
|
19348
|
+
fetchWellKnown: async (principal, discoveryKey) => {
|
|
19349
|
+
if (!this._address || !didPrincipalMatches(principal, this.did)) {
|
|
19335
19350
|
return null;
|
|
19336
19351
|
}
|
|
19337
19352
|
if (!this.config.host) {
|
|
@@ -19655,7 +19670,7 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
19655
19670
|
return {
|
|
19656
19671
|
cid: delegationSession.delegationCid,
|
|
19657
19672
|
delegateDID: params.shareKeyDID,
|
|
19658
|
-
delegatorDID:
|
|
19673
|
+
delegatorDID: pkhDid2(session.address, session.chainId),
|
|
19659
19674
|
spaceId: params.spaceId,
|
|
19660
19675
|
path: params.path,
|
|
19661
19676
|
actions: params.actions,
|
|
@@ -19987,13 +20002,8 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
19987
20002
|
if (delegation.expiry.getTime() <= Date.now()) {
|
|
19988
20003
|
throw new SessionExpiredError(delegation.expiry);
|
|
19989
20004
|
}
|
|
19990
|
-
const expectedDids =
|
|
19991
|
-
|
|
19992
|
-
this.didWithoutFragment(session.verificationMethod),
|
|
19993
|
-
this.sessionDid,
|
|
19994
|
-
this.didWithoutFragment(this.sessionDid)
|
|
19995
|
-
]);
|
|
19996
|
-
if (!expectedDids.has(delegation.delegateDID)) {
|
|
20005
|
+
const expectedDids = [session.verificationMethod, this.sessionDid];
|
|
20006
|
+
if (!expectedDids.some((did) => didPrincipalMatches(delegation.delegateDID, did))) {
|
|
19997
20007
|
throw new Error(
|
|
19998
20008
|
`Runtime delegation targets ${delegation.delegateDID} but this session key is ${session.verificationMethod}.`
|
|
19999
20009
|
);
|
|
@@ -20520,7 +20530,9 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
20520
20530
|
"materializeDelegation requires a composed manifest request"
|
|
20521
20531
|
);
|
|
20522
20532
|
}
|
|
20523
|
-
const target = request.delegationTargets.find(
|
|
20533
|
+
const target = request.delegationTargets.find(
|
|
20534
|
+
(entry) => didPrincipalMatches(entry.did, did)
|
|
20535
|
+
);
|
|
20524
20536
|
if (!target) {
|
|
20525
20537
|
throw new Error(`No manifest delegation target found for DID ${did}`);
|
|
20526
20538
|
}
|
|
@@ -20828,10 +20840,6 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
20828
20840
|
expiresAt: delegation.expiry
|
|
20829
20841
|
};
|
|
20830
20842
|
}
|
|
20831
|
-
didWithoutFragment(did) {
|
|
20832
|
-
const fragment = did.indexOf("#");
|
|
20833
|
-
return fragment === -1 ? did : did.slice(0, fragment);
|
|
20834
|
-
}
|
|
20835
20843
|
installRuntimeGrantFromServiceSession(delegation, session, expiresAt) {
|
|
20836
20844
|
const operations = this.operationsFromDelegation(delegation);
|
|
20837
20845
|
if (operations.length === 0) {
|
|
@@ -21027,7 +21035,7 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
21027
21035
|
if (resolvedDelegateDID.endsWith(".eth") && this.config.ensResolver) {
|
|
21028
21036
|
const address = await this.config.ensResolver.resolveAddress(resolvedDelegateDID);
|
|
21029
21037
|
if (!address) throw new Error(`Could not resolve ENS name: ${resolvedDelegateDID}`);
|
|
21030
|
-
resolvedDelegateDID =
|
|
21038
|
+
resolvedDelegateDID = pkhDid2(address, 1);
|
|
21031
21039
|
}
|
|
21032
21040
|
const entries = legacyParamsToPermissionEntries(
|
|
21033
21041
|
params.actions,
|
|
@@ -21184,7 +21192,7 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
21184
21192
|
const targetHost = delegation.host ?? this.config.host;
|
|
21185
21193
|
if (this.isSessionOnly) {
|
|
21186
21194
|
const myDid = this.did;
|
|
21187
|
-
if (delegation.delegateDID
|
|
21195
|
+
if (!didPrincipalMatches(delegation.delegateDID, myDid)) {
|
|
21188
21196
|
throw new Error(
|
|
21189
21197
|
`Delegation targets ${delegation.delegateDID} but this user's DID is ${myDid}. The delegation must target this user's DID.`
|
|
21190
21198
|
);
|
|
@@ -21408,7 +21416,22 @@ import { TinyCloud as TinyCloud2 } from "@tinycloud/sdk-core";
|
|
|
21408
21416
|
import {
|
|
21409
21417
|
SilentNotificationHandler as SilentNotificationHandler2,
|
|
21410
21418
|
AutoApproveSpaceCreationHandler as AutoApproveSpaceCreationHandler2,
|
|
21411
|
-
defaultSpaceCreationHandler
|
|
21419
|
+
defaultSpaceCreationHandler,
|
|
21420
|
+
IdentityParseError,
|
|
21421
|
+
addressStorageKey,
|
|
21422
|
+
canonicalizeAddress as canonicalizeAddress3,
|
|
21423
|
+
canonicalizeDid,
|
|
21424
|
+
canonicalizeDidUrl,
|
|
21425
|
+
canonicalizeNetworkId,
|
|
21426
|
+
didCacheKey,
|
|
21427
|
+
didEquals,
|
|
21428
|
+
isEvmAddress,
|
|
21429
|
+
makePkhSpaceId as makePkhSpaceId2,
|
|
21430
|
+
parsePkhDid,
|
|
21431
|
+
pkhDid as pkhDid3,
|
|
21432
|
+
principalDid,
|
|
21433
|
+
principalDidEquals as principalDidEquals2,
|
|
21434
|
+
parseCanonicalNetworkId
|
|
21412
21435
|
} from "@tinycloud/sdk-core";
|
|
21413
21436
|
|
|
21414
21437
|
// src/storage/FileSessionStorage.ts
|
|
@@ -21691,6 +21714,7 @@ export {
|
|
|
21691
21714
|
EncryptionService2 as EncryptionService,
|
|
21692
21715
|
FileSessionStorage,
|
|
21693
21716
|
HooksService3 as HooksService,
|
|
21717
|
+
IdentityParseError,
|
|
21694
21718
|
KVService3 as KVService,
|
|
21695
21719
|
ManifestValidationError,
|
|
21696
21720
|
MemorySessionStorage,
|
|
@@ -21721,6 +21745,7 @@ export {
|
|
|
21721
21745
|
VaultPublicSpaceKVActions,
|
|
21722
21746
|
VersionCheckError,
|
|
21723
21747
|
WasmKeyProvider,
|
|
21748
|
+
addressStorageKey,
|
|
21724
21749
|
buildCanonicalDecryptRequest,
|
|
21725
21750
|
buildDecryptAttenuation,
|
|
21726
21751
|
buildDecryptFacts,
|
|
@@ -21729,7 +21754,11 @@ export {
|
|
|
21729
21754
|
buildSpaceUri,
|
|
21730
21755
|
canonicalHashHex2 as canonicalHashHex,
|
|
21731
21756
|
canonicalSignedResponse,
|
|
21757
|
+
canonicalizeAddress3 as canonicalizeAddress,
|
|
21758
|
+
canonicalizeDid,
|
|
21759
|
+
canonicalizeDidUrl,
|
|
21732
21760
|
canonicalizeEncryptionJson2 as canonicalizeEncryptionJson,
|
|
21761
|
+
canonicalizeNetworkId,
|
|
21733
21762
|
canonicalizeSecretScope,
|
|
21734
21763
|
checkDecryptInvocationInput,
|
|
21735
21764
|
checkNodeInfo2 as checkNodeInfo,
|
|
@@ -21744,6 +21773,8 @@ export {
|
|
|
21744
21773
|
defaultSpaceCreationHandler,
|
|
21745
21774
|
deriveSignedReceiverKey,
|
|
21746
21775
|
deserializeDelegation,
|
|
21776
|
+
didCacheKey,
|
|
21777
|
+
didEquals,
|
|
21747
21778
|
discoverNetwork,
|
|
21748
21779
|
encryptToNetwork,
|
|
21749
21780
|
encryptionBase64Decode,
|
|
@@ -21759,14 +21790,21 @@ export {
|
|
|
21759
21790
|
hexDecode,
|
|
21760
21791
|
hexEncode,
|
|
21761
21792
|
isCapabilitySubset2 as isCapabilitySubset,
|
|
21793
|
+
isEvmAddress,
|
|
21762
21794
|
isNetworkId,
|
|
21763
21795
|
loadManifest,
|
|
21796
|
+
makePkhSpaceId2 as makePkhSpaceId,
|
|
21764
21797
|
makePublicSpaceId2 as makePublicSpaceId,
|
|
21765
21798
|
networkDiscoveryKey,
|
|
21766
21799
|
openWrappedKey,
|
|
21800
|
+
parseCanonicalNetworkId,
|
|
21767
21801
|
parseExpiry2 as parseExpiry,
|
|
21768
21802
|
parseNetworkId,
|
|
21803
|
+
parsePkhDid,
|
|
21769
21804
|
parseSpaceUri,
|
|
21805
|
+
pkhDid3 as pkhDid,
|
|
21806
|
+
principalDid,
|
|
21807
|
+
principalDidEquals2 as principalDidEquals,
|
|
21770
21808
|
resolveManifest2 as resolveManifest,
|
|
21771
21809
|
resolveSecretListPrefix2 as resolveSecretListPrefix,
|
|
21772
21810
|
resolveSecretPath2 as resolveSecretPath,
|