@tinycloud/node-sdk 2.4.0-beta.3 → 2.4.0-beta.6
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-ClOKiSR_.d.cts → core-zT0sxgtZ.d.cts} +14 -2
- package/dist/{core-ClOKiSR_.d.ts → core-zT0sxgtZ.d.ts} +14 -2
- package/dist/core.cjs +287 -201
- 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 +115 -27
- package/dist/core.js.map +1 -1
- package/dist/index.cjs +330 -244
- 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 +119 -31
- 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, 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, TelemetryConfig, TelemetryEventHandler, 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 { A as AuthDelegationArtifact, a as AuthRequestArtifact, D as DelegateToOptions, b as DelegateToResult, c as DelegatedAccess, d as DelegationAuthority, F as FileSessionStorage, M as MemorySessionStorage, N as NodeEventEmitterStrategy, e as NodeUserAuthorization, f as NodeUserAuthorizationConfig, P as PortableDelegation, R as RestorableSession, g as RuntimePermissionGrantOptions, S as SignStrategy, T as TinyCloudNode, h as TinyCloudNodeConfig, W as WasmKeyProvider, i as WasmKeyProviderConfig, j as createWasmKeyProvider, k as defaultSignStrategy, l as deserializeDelegation, m as grantAuthRequest, s as serializeDelegation } from './core-
|
|
2
|
+
export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, AccountApplication, AccountDelegation, AccountDelegationListOptions, AccountDelegationRevokeOptions, AccountIndexRebuildResult, AccountService, AccountServiceConfig, AccountStatus, 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, TelemetryConfig, TelemetryEventHandler, 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 { A as AuthDelegationArtifact, a as AuthRequestArtifact, D as DelegateToOptions, b as DelegateToResult, c as DelegatedAccess, d as DelegationAuthority, F as FileSessionStorage, M as MemorySessionStorage, N as NodeEventEmitterStrategy, e as NodeUserAuthorization, f as NodeUserAuthorizationConfig, P as PortableDelegation, R as RestorableSession, g as RuntimePermissionGrantOptions, S as SignStrategy, T as TinyCloudNode, h as TinyCloudNodeConfig, W as WasmKeyProvider, i as WasmKeyProviderConfig, j as createWasmKeyProvider, k as defaultSignStrategy, l as deserializeDelegation, m as grantAuthRequest, s as serializeDelegation } from './core-zT0sxgtZ.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, 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, TelemetryConfig, TelemetryEventHandler, 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 { A as AuthDelegationArtifact, a as AuthRequestArtifact, D as DelegateToOptions, b as DelegateToResult, c as DelegatedAccess, d as DelegationAuthority, F as FileSessionStorage, M as MemorySessionStorage, N as NodeEventEmitterStrategy, e as NodeUserAuthorization, f as NodeUserAuthorizationConfig, P as PortableDelegation, R as RestorableSession, g as RuntimePermissionGrantOptions, S as SignStrategy, T as TinyCloudNode, h as TinyCloudNodeConfig, W as WasmKeyProvider, i as WasmKeyProviderConfig, j as createWasmKeyProvider, k as defaultSignStrategy, l as deserializeDelegation, m as grantAuthRequest, s as serializeDelegation } from './core-
|
|
2
|
+
export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, AccountApplication, AccountDelegation, AccountDelegationListOptions, AccountDelegationRevokeOptions, AccountIndexRebuildResult, AccountService, AccountServiceConfig, AccountStatus, 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, TelemetryConfig, TelemetryEventHandler, 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 { A as AuthDelegationArtifact, a as AuthRequestArtifact, D as DelegateToOptions, b as DelegateToResult, c as DelegatedAccess, d as DelegationAuthority, F as FileSessionStorage, M as MemorySessionStorage, N as NodeEventEmitterStrategy, e as NodeUserAuthorization, f as NodeUserAuthorizationConfig, P as PortableDelegation, R as RestorableSession, g as RuntimePermissionGrantOptions, S as SignStrategy, T as TinyCloudNode, h as TinyCloudNodeConfig, W as WasmKeyProvider, i as WasmKeyProviderConfig, j as createWasmKeyProvider, k as defaultSignStrategy, l as deserializeDelegation, m as grantAuthRequest, s as serializeDelegation } from './core-zT0sxgtZ.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
|
@@ -17186,7 +17186,8 @@ import {
|
|
|
17186
17186
|
verifyDidKeyEd25519Signature,
|
|
17187
17187
|
canonicalizeAddress as canonicalizeAddress2,
|
|
17188
17188
|
pkhDid as pkhDid2,
|
|
17189
|
-
principalDidEquals
|
|
17189
|
+
principalDidEquals as principalDidEquals2,
|
|
17190
|
+
parseNetworkId as parseNetworkId2
|
|
17190
17191
|
} from "@tinycloud/sdk-core";
|
|
17191
17192
|
|
|
17192
17193
|
// src/authorization/NodeUserAuthorization.ts
|
|
@@ -17199,6 +17200,8 @@ import {
|
|
|
17199
17200
|
DEFAULT_MANIFEST_SPACE,
|
|
17200
17201
|
ENCRYPTION_PERMISSION_SERVICE,
|
|
17201
17202
|
composeManifestRequest,
|
|
17203
|
+
parseNetworkId,
|
|
17204
|
+
principalDidEquals,
|
|
17202
17205
|
resourceCapabilitiesToAbilitiesMap,
|
|
17203
17206
|
resourceCapabilitiesToSpaceAbilitiesMap,
|
|
17204
17207
|
resolveTinyCloudHosts,
|
|
@@ -17283,6 +17286,25 @@ var MemorySessionStorage = class {
|
|
|
17283
17286
|
};
|
|
17284
17287
|
|
|
17285
17288
|
// src/authorization/NodeUserAuthorization.ts
|
|
17289
|
+
var DECRYPT_ACTION = "tinycloud.encryption/decrypt";
|
|
17290
|
+
var NETWORK_CREATE_ACTION = "tinycloud.encryption/network.create";
|
|
17291
|
+
function didPrincipalMatches(actual, expected) {
|
|
17292
|
+
try {
|
|
17293
|
+
return principalDidEquals(actual, expected);
|
|
17294
|
+
} catch {
|
|
17295
|
+
return actual === expected;
|
|
17296
|
+
}
|
|
17297
|
+
}
|
|
17298
|
+
function addRawAbility(rawAbilities, resource, action) {
|
|
17299
|
+
const actions = rawAbilities[resource];
|
|
17300
|
+
if (actions === void 0) {
|
|
17301
|
+
rawAbilities[resource] = [action];
|
|
17302
|
+
return;
|
|
17303
|
+
}
|
|
17304
|
+
if (!actions.includes(action)) {
|
|
17305
|
+
actions.push(action);
|
|
17306
|
+
}
|
|
17307
|
+
}
|
|
17286
17308
|
var NodeUserAuthorization = class {
|
|
17287
17309
|
constructor(config) {
|
|
17288
17310
|
this.extensions = [];
|
|
@@ -17512,20 +17534,18 @@ var NodeUserAuthorization = class {
|
|
|
17512
17534
|
};
|
|
17513
17535
|
}
|
|
17514
17536
|
const rawAbilities = {};
|
|
17537
|
+
const currentDid = pkhDid(address, chainId);
|
|
17515
17538
|
const spaceResources = request.resources.filter((entry) => {
|
|
17516
17539
|
if (entry.service !== ENCRYPTION_PERMISSION_SERVICE) {
|
|
17517
17540
|
return true;
|
|
17518
17541
|
}
|
|
17519
|
-
const
|
|
17520
|
-
|
|
17521
|
-
|
|
17522
|
-
|
|
17523
|
-
const
|
|
17524
|
-
|
|
17525
|
-
|
|
17526
|
-
existing.push(action);
|
|
17527
|
-
seen.add(action);
|
|
17528
|
-
}
|
|
17542
|
+
for (const action of entry.actions) {
|
|
17543
|
+
addRawAbility(rawAbilities, entry.path, action);
|
|
17544
|
+
}
|
|
17545
|
+
if (entry.actions.includes(DECRYPT_ACTION)) {
|
|
17546
|
+
const parsed = parseNetworkId(entry.path);
|
|
17547
|
+
if (didPrincipalMatches(parsed.ownerDid, currentDid)) {
|
|
17548
|
+
addRawAbility(rawAbilities, entry.path, NETWORK_CREATE_ACTION);
|
|
17529
17549
|
}
|
|
17530
17550
|
}
|
|
17531
17551
|
return false;
|
|
@@ -18084,6 +18104,9 @@ var NodeUserAuthorization = class {
|
|
|
18084
18104
|
}
|
|
18085
18105
|
};
|
|
18086
18106
|
|
|
18107
|
+
// src/account/AccountService.ts
|
|
18108
|
+
import { AccountService } from "@tinycloud/sdk-core";
|
|
18109
|
+
|
|
18087
18110
|
// src/DelegatedAccess.ts
|
|
18088
18111
|
import {
|
|
18089
18112
|
KVService,
|
|
@@ -18501,13 +18524,13 @@ var NodeSecretsService = class {
|
|
|
18501
18524
|
// src/TinyCloudNode.ts
|
|
18502
18525
|
var DEFAULT_HOST = "https://node.tinycloud.xyz";
|
|
18503
18526
|
var DEFAULT_ENCRYPTION_NETWORK_NAME = "default";
|
|
18504
|
-
var
|
|
18505
|
-
var
|
|
18527
|
+
var NETWORK_CREATE_ACTION2 = "tinycloud.encryption/network.create";
|
|
18528
|
+
var DECRYPT_ACTION2 = "tinycloud.encryption/decrypt";
|
|
18506
18529
|
var NETWORK_ADMIN_TYPE = "tinycloud.encryption.network-admin/v1";
|
|
18507
18530
|
var DEFAULT_SESSION_EXPIRATION_MS = EXPIRY3.SESSION_MS;
|
|
18508
|
-
function
|
|
18531
|
+
function didPrincipalMatches2(actual, expected) {
|
|
18509
18532
|
try {
|
|
18510
|
-
return
|
|
18533
|
+
return principalDidEquals2(actual, expected);
|
|
18511
18534
|
} catch {
|
|
18512
18535
|
return actual === expected;
|
|
18513
18536
|
}
|
|
@@ -18844,6 +18867,37 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
18844
18867
|
get spaceId() {
|
|
18845
18868
|
return this.auth?.tinyCloudSession?.spaceId;
|
|
18846
18869
|
}
|
|
18870
|
+
/**
|
|
18871
|
+
* Get the account space ID for this wallet identity.
|
|
18872
|
+
* Available after wallet-backed sign-in or a restored session with address metadata.
|
|
18873
|
+
*/
|
|
18874
|
+
get accountSpaceId() {
|
|
18875
|
+
if (!this._address) {
|
|
18876
|
+
return void 0;
|
|
18877
|
+
}
|
|
18878
|
+
return this.wasmBindings.makeSpaceId(this._address, this._chainId, ACCOUNT_REGISTRY_SPACE);
|
|
18879
|
+
}
|
|
18880
|
+
/**
|
|
18881
|
+
* Account-level application and delegation helpers.
|
|
18882
|
+
*/
|
|
18883
|
+
get account() {
|
|
18884
|
+
if (!this._account) {
|
|
18885
|
+
this._account = new AccountService({
|
|
18886
|
+
getDid: () => this.did,
|
|
18887
|
+
getHost: () => this.hosts[0] ?? this.config.host,
|
|
18888
|
+
getPrimarySpaceId: () => this.spaceId,
|
|
18889
|
+
getAccountSpaceId: () => this.accountSpaceId,
|
|
18890
|
+
getSpaces: () => this.spaces,
|
|
18891
|
+
getAccountDb: () => this.accountSpaceId ? this.sqlForSpace(this.accountSpaceId).db("account") : void 0,
|
|
18892
|
+
ensureAccountSpaceHosted: async () => {
|
|
18893
|
+
if (this.accountSpaceId && this.auth) {
|
|
18894
|
+
await this.ensureOwnedSpaceHosted(this.accountSpaceId);
|
|
18895
|
+
}
|
|
18896
|
+
}
|
|
18897
|
+
});
|
|
18898
|
+
}
|
|
18899
|
+
return this._account;
|
|
18900
|
+
}
|
|
18847
18901
|
/**
|
|
18848
18902
|
* Get the current TinyCloud session.
|
|
18849
18903
|
* Available after signIn().
|
|
@@ -18881,6 +18935,7 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
18881
18935
|
await this.tc.signIn(options);
|
|
18882
18936
|
this.syncResolvedHostFromAuth();
|
|
18883
18937
|
this.initializeServices();
|
|
18938
|
+
await this.ensureRequestedEncryptionNetworks();
|
|
18884
18939
|
if (this.config.manifest === void 0 && this.config.capabilityRequest === void 0) {
|
|
18885
18940
|
await this.ensureOwnedSpaceHosted(this.ownedSpaceId("secrets"));
|
|
18886
18941
|
}
|
|
@@ -18917,6 +18972,31 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
18917
18972
|
}
|
|
18918
18973
|
}
|
|
18919
18974
|
}
|
|
18975
|
+
requestedEncryptionNetworkIds() {
|
|
18976
|
+
const request = this.capabilityRequest;
|
|
18977
|
+
if (!request) {
|
|
18978
|
+
return [];
|
|
18979
|
+
}
|
|
18980
|
+
const networkIds = /* @__PURE__ */ new Set();
|
|
18981
|
+
for (const resource of request.resources) {
|
|
18982
|
+
if (resource.service === ENCRYPTION_PERMISSION_SERVICE2 && resource.path.startsWith("urn:tinycloud:encryption:") && resource.actions.includes(DECRYPT_ACTION2)) {
|
|
18983
|
+
networkIds.add(resource.path);
|
|
18984
|
+
}
|
|
18985
|
+
}
|
|
18986
|
+
return [...networkIds];
|
|
18987
|
+
}
|
|
18988
|
+
async ensureRequestedEncryptionNetworks() {
|
|
18989
|
+
if (!this.signer || !this.auth) {
|
|
18990
|
+
return;
|
|
18991
|
+
}
|
|
18992
|
+
for (const networkId of this.requestedEncryptionNetworkIds()) {
|
|
18993
|
+
const parsed = parseNetworkId2(networkId);
|
|
18994
|
+
if (!didPrincipalMatches2(parsed.ownerDid, this.did)) {
|
|
18995
|
+
continue;
|
|
18996
|
+
}
|
|
18997
|
+
await this.ensureEncryptionNetwork(networkId);
|
|
18998
|
+
}
|
|
18999
|
+
}
|
|
18920
19000
|
async ensureOwnedSpaceHosted(spaceId) {
|
|
18921
19001
|
if (!this.auth) {
|
|
18922
19002
|
throw new Error("Owned space hosting requires wallet mode");
|
|
@@ -19385,7 +19465,7 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
19385
19465
|
const signed2 = await this.signRawNetworkAuthorization({
|
|
19386
19466
|
targetNode: input.targetNode,
|
|
19387
19467
|
networkId: input.networkId,
|
|
19388
|
-
action:
|
|
19468
|
+
action: DECRYPT_ACTION2,
|
|
19389
19469
|
facts: input.facts
|
|
19390
19470
|
});
|
|
19391
19471
|
return {
|
|
@@ -19402,7 +19482,7 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
19402
19482
|
},
|
|
19403
19483
|
wellKnown: {
|
|
19404
19484
|
fetchWellKnown: async (principal, discoveryKey) => {
|
|
19405
|
-
if (!this._address || !
|
|
19485
|
+
if (!this._address || !didPrincipalMatches2(principal, this.did)) {
|
|
19406
19486
|
return null;
|
|
19407
19487
|
}
|
|
19408
19488
|
if (!this.config.host) {
|
|
@@ -19909,12 +19989,12 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
19909
19989
|
crypto2.sha256,
|
|
19910
19990
|
body
|
|
19911
19991
|
),
|
|
19912
|
-
action:
|
|
19992
|
+
action: NETWORK_CREATE_ACTION2
|
|
19913
19993
|
};
|
|
19914
19994
|
const signed2 = await this.signRawNetworkAuthorization({
|
|
19915
19995
|
targetNode,
|
|
19916
19996
|
networkId,
|
|
19917
|
-
action:
|
|
19997
|
+
action: NETWORK_CREATE_ACTION2,
|
|
19918
19998
|
facts
|
|
19919
19999
|
});
|
|
19920
20000
|
const response = await fetch(`${this.config.host}/encryption/networks`, {
|
|
@@ -19935,12 +20015,19 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
19935
20015
|
const created = await response.json();
|
|
19936
20016
|
return created.descriptor;
|
|
19937
20017
|
}
|
|
19938
|
-
async ensureEncryptionNetwork(
|
|
19939
|
-
const
|
|
20018
|
+
async ensureEncryptionNetwork(nameOrNetworkId = DEFAULT_ENCRYPTION_NETWORK_NAME) {
|
|
20019
|
+
const networkId = nameOrNetworkId.startsWith("urn:tinycloud:encryption:") ? nameOrNetworkId : this.getDefaultEncryptionNetworkId(nameOrNetworkId);
|
|
20020
|
+
const existing = await this.getEncryptionNetwork(networkId);
|
|
19940
20021
|
if (existing) {
|
|
19941
20022
|
return existing;
|
|
19942
20023
|
}
|
|
19943
|
-
|
|
20024
|
+
const parsed = parseNetworkId2(networkId);
|
|
20025
|
+
if (!didPrincipalMatches2(parsed.ownerDid, this.did)) {
|
|
20026
|
+
throw new Error(
|
|
20027
|
+
`Cannot create encryption network ${networkId}: owner ${parsed.ownerDid} does not match signed-in DID ${this.did}`
|
|
20028
|
+
);
|
|
20029
|
+
}
|
|
20030
|
+
return this.createEncryptionNetwork(parsed.name);
|
|
19944
20031
|
}
|
|
19945
20032
|
/**
|
|
19946
20033
|
* App-facing secrets API backed by the `secrets` space vault.
|
|
@@ -20088,7 +20175,7 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
20088
20175
|
throw new SessionExpiredError(delegation.expiry);
|
|
20089
20176
|
}
|
|
20090
20177
|
const expectedDids = [session.verificationMethod, this.sessionDid];
|
|
20091
|
-
if (!expectedDids.some((did) =>
|
|
20178
|
+
if (!expectedDids.some((did) => didPrincipalMatches2(delegation.delegateDID, did))) {
|
|
20092
20179
|
throw new Error(
|
|
20093
20180
|
`Runtime delegation targets ${delegation.delegateDID} but this session key is ${session.verificationMethod}.`
|
|
20094
20181
|
);
|
|
@@ -20617,7 +20704,7 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
20617
20704
|
);
|
|
20618
20705
|
}
|
|
20619
20706
|
const target = request.delegationTargets.find(
|
|
20620
|
-
(entry) =>
|
|
20707
|
+
(entry) => didPrincipalMatches2(entry.did, did)
|
|
20621
20708
|
);
|
|
20622
20709
|
if (!target) {
|
|
20623
20710
|
throw new Error(`No manifest delegation target found for DID ${did}`);
|
|
@@ -21347,7 +21434,7 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
21347
21434
|
const targetHost = delegation.host ?? this.config.host;
|
|
21348
21435
|
if (this.isSessionOnly) {
|
|
21349
21436
|
const myDid = this.did;
|
|
21350
|
-
if (!
|
|
21437
|
+
if (!didPrincipalMatches2(delegation.delegateDID, myDid)) {
|
|
21351
21438
|
throw new Error(
|
|
21352
21439
|
`Delegation targets ${delegation.delegateDID} but this user's DID is ${myDid}. The delegation must target this user's DID.`
|
|
21353
21440
|
);
|
|
@@ -21578,7 +21665,7 @@ import {
|
|
|
21578
21665
|
parsePkhDid,
|
|
21579
21666
|
pkhDid as pkhDid3,
|
|
21580
21667
|
principalDid,
|
|
21581
|
-
principalDidEquals as
|
|
21668
|
+
principalDidEquals as principalDidEquals3,
|
|
21582
21669
|
parseCanonicalNetworkId
|
|
21583
21670
|
} from "@tinycloud/sdk-core";
|
|
21584
21671
|
|
|
@@ -21791,7 +21878,7 @@ import {
|
|
|
21791
21878
|
} from "@tinycloud/sdk-core";
|
|
21792
21879
|
import {
|
|
21793
21880
|
EncryptionService as EncryptionService2,
|
|
21794
|
-
parseNetworkId,
|
|
21881
|
+
parseNetworkId as parseNetworkId3,
|
|
21795
21882
|
buildNetworkId,
|
|
21796
21883
|
isNetworkId,
|
|
21797
21884
|
networkDiscoveryKey,
|
|
@@ -21826,7 +21913,7 @@ import {
|
|
|
21826
21913
|
DEFAULT_KEY_VERSION,
|
|
21827
21914
|
DECRYPT_FACT_TYPE,
|
|
21828
21915
|
DECRYPT_RESULT_TYPE,
|
|
21829
|
-
DECRYPT_ACTION as
|
|
21916
|
+
DECRYPT_ACTION as DECRYPT_ACTION3,
|
|
21830
21917
|
ENCRYPTION_SERVICE,
|
|
21831
21918
|
ENCRYPTION_SERVICE_SHORT,
|
|
21832
21919
|
encryptionError
|
|
@@ -21862,10 +21949,11 @@ import { ServiceContext as ServiceContext3 } from "@tinycloud/sdk-core";
|
|
|
21862
21949
|
export {
|
|
21863
21950
|
ACCOUNT_REGISTRY_PATH,
|
|
21864
21951
|
ACCOUNT_REGISTRY_SPACE2 as ACCOUNT_REGISTRY_SPACE,
|
|
21952
|
+
AccountService,
|
|
21865
21953
|
AutoApproveSpaceCreationHandler2 as AutoApproveSpaceCreationHandler,
|
|
21866
21954
|
CapabilityKeyRegistry2 as CapabilityKeyRegistry,
|
|
21867
21955
|
CapabilityKeyRegistryErrorCodes,
|
|
21868
|
-
|
|
21956
|
+
DECRYPT_ACTION3 as DECRYPT_ACTION,
|
|
21869
21957
|
DECRYPT_FACT_TYPE,
|
|
21870
21958
|
DECRYPT_RESULT_TYPE,
|
|
21871
21959
|
DEFAULT_ENCRYPTION_ALG,
|
|
@@ -21974,12 +22062,12 @@ export {
|
|
|
21974
22062
|
openWrappedKey,
|
|
21975
22063
|
parseCanonicalNetworkId,
|
|
21976
22064
|
parseExpiry2 as parseExpiry,
|
|
21977
|
-
parseNetworkId,
|
|
22065
|
+
parseNetworkId3 as parseNetworkId,
|
|
21978
22066
|
parsePkhDid,
|
|
21979
22067
|
parseSpaceUri,
|
|
21980
22068
|
pkhDid3 as pkhDid,
|
|
21981
22069
|
principalDid,
|
|
21982
|
-
|
|
22070
|
+
principalDidEquals3 as principalDidEquals,
|
|
21983
22071
|
resolveManifest2 as resolveManifest,
|
|
21984
22072
|
resolveSecretListPrefix2 as resolveSecretListPrefix,
|
|
21985
22073
|
resolveSecretPath2 as resolveSecretPath,
|