@tinycloud/node-sdk 3.3.0-beta.18 → 3.3.0-beta.21
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-DmF9QUcS.d.cts → TinyCloudNode-BPDOmuf6.d.cts} +106 -4
- package/dist/{TinyCloudNode-DmF9QUcS.d.ts → TinyCloudNode-BPDOmuf6.d.ts} +106 -4
- package/dist/{authority-Cy5tMflt.d.cts → authority-21H2cKmO.d.cts} +1 -1
- package/dist/{authority-BY0jd0P3.d.ts → authority-C-pzOYXq.d.ts} +1 -1
- package/dist/core.cjs +114 -2
- 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 +121 -2
- package/dist/core.js.map +1 -1
- package/dist/index.cjs +114 -2
- 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 +121 -2
- 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 +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ISigner, Bytes, IWasmBindings, PersistedSessionProof, ISessionManager } from '@tinycloud/sdk-core';
|
|
2
2
|
export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, AccountApplication, AccountApplicationListOptions, AccountApplicationRegisterOptions, AccountDelegation, AccountDelegationListOptions, AccountDelegationPage, AccountDelegationQueryOptions, AccountDelegationRecord, AccountDelegationResource, AccountDelegationRevokeOptions, AccountIndexEnsureResult, AccountIndexRebuildResult, AccountIndexStatus, AccountIndexedReadOptions, AccountService, AccountServiceConfig, AccountSpace, AccountSpaceListOptions, AccountStatus, AuthorityRefusal, AutoApproveSpaceCreationHandler, AutoRejectStrategy, AutoSignStrategy, BatchOptions, BatchResponse, BuildCanonicalDecryptRequestInput, BuildDecryptFactsInput, BuildDecryptInvocationInput, BuiltDecryptInvocation, CallbackStrategy, CanonicalAddress, CanonicalDecryptRequest, CanonicalJson, CanonicalParsedNetworkId, CapabilityEntry, CapabilityKeyRegistry, CapabilityKeyRegistryErrorCode, CapabilityKeyRegistryErrorCodes, CaveatedDelegationUnsupportedError, ClientSession, ColumnInfo, ComposeManifestOptions, ComposedManifestRequest, CreateDelegationParams, DECRYPT_ACTION, DECRYPT_FACT_TYPE, DECRYPT_RESULT_TYPE, DEFAULT_ENCRYPTION_ALG, DEFAULT_KEY_VERSION, DEFAULT_MANIFEST_SPACE, DEFAULT_MANIFEST_VERSION, DEFAULT_SIGNED_READ_URL_EXPIRY_MS, DataVaultConfig, DataVaultService, DatabaseHandle, DecryptCapabilityProof, DecryptEnvelopeOptions, DecryptInvocationFact, DecryptInvocationSigner, DecryptRequestBody, DecryptResponseBody, DecryptTransport, DecryptTransportResponseError, DelegateReceivedShareParams, DelegatedShareAccess, Delegation, DelegationChain, DelegationChainV2, DelegationDirection, DelegationError, DelegationErrorCode, DelegationErrorCodes, DelegationFilters, DelegationManager, DelegationManagerConfig, DelegationRecord, DelegationResult, DelegationRevocationReceipt, DidCacheKeyOptions, DidEqualsOptions, DiscoverNetworkInput, DiscoveredNetwork, DiscoverySource, DuckDbAction, DuckDbActionType, DuckDbBatchOptions, DuckDbBatchResponse, DuckDbDatabaseHandle, DuckDbExecuteOptions, DuckDbExecuteResponse, DuckDbOptions, DuckDbQueryOptions, DuckDbQueryResponse, DuckDbService, DuckDbServiceConfig, DuckDbStatement, DuckDbValue, ENCRYPTION_NETWORK_URN_PREFIX, ENCRYPTION_SERVICE, ENCRYPTION_SERVICE_SHORT, ENVELOPE_VERSION, EncodedShareData, EncryptToNetworkInput, EncryptToNetworkOptions, EncryptToNetworkResult, EncryptionCrypto, EncryptionError, EncryptionErrorInput, EncryptionService, EncryptionServiceConfig, ExecuteOptions, ExecuteResponse, Extension, FetchFunction, GenerateShareParams, HookEvent, HookServiceName, HookStreamEvent, HookSubscription, HookWebhookListOptions, HookWebhookRecord, HookWebhookRegistration, HookWebhookScope, HookWebhookUnregisterOptions, HooksService, HooksServiceConfig, ICapabilityKeyRegistry, IDataVaultService, IDatabaseHandle, IDuckDbDatabaseHandle, IDuckDbService, IENSResolver, IEncryptionService, IHooksService, IKVService, INotificationHandler, IPrefixedKVService, ISQLService, ISecretsService, ISessionManager, ISessionStorage, ISharingService, ISigner, ISpace, ISpaceCreationHandler, ISpaceScopedDelegations, ISpaceScopedSharing, ISpaceService, IStorageService, IUserAuthorization, IWasmBindings, IdentityParseError, IngestOptions, InlineEncryptedEnvelope, InvokeFunction, JWK, KVBatchReadResponse, KVCreateSignedReadUrlOptions, KVListPage, KVReadThrough, KVReplicaHandle, KVReplicaSpec, KVReplicaStorage, KVReplicationController, KVReplicationDeps, KVResponse, KVService, KVServiceConfig, KVSignedReadUrlResponse, KeyInfo, KeyProvider, KeyType, LocalGetResult, LocalListResult, LocalReadMeta, LocalReplicaStatus, LocalSyncResult, MAX_SECRET_SCOPE_LENGTH, Manifest, ManifestDefaults, ManifestRegistryRecord, ManifestSecretActions, ManifestValidationError, NETWORK_NAME_PATTERN, NetworkDescriptor, NetworkIdError, NodeDescriptorFetcher, OpenKeyCallbackStrategy, OpenKeySigningRequestBody, OpenKeySigningResponseBody, OpenKeySigningStrategyOptions, OwnerDelegationPermission, ParsedNetworkId, ParsedSecretCatalogKey, PendingWriteRecord, PendingWriteState, PendingWriteStore, PermissionEntry, PermissionNotInManifestError, PersistedSessionData, PinnedKey, PkhDidParts, PrefixedKVService, ProtocolMismatchError, PurgeTarget, QueryOptions, QueryResponse, RandomReceiverKeyInput, ReceiveOptions, ReceiverKeyPair, ReceiverKeySigner, RegisterBatchSuccess, RegisterPolicyV3Input, RegisterPolicyV3Receipt, ReplicaAuthorityState, ReplicaCoverage, ReplicaDevice, ReplicaGatedHandle, ReplicaGrantInfo, ReplicaInspectedStatus, ReplicaState, ReplicaStatusEntry, ReplicationAuthority, ReplicationControl, ReplicationEvent, ReplicationIdentity, ReplicationOptions, ReplicationPurgeReport, ReplicationReason, ReplicationScheduler, ResolvedCapabilities, ResolvedDelegate, ResolvedReplicationOptions, ResolvedSecretPath, ResourceCapability, SECRET_NAME_RE, SECRET_SCOPE_RE, SQLAction, SQLActionType, SQLService, SQLServiceConfig, STORAGE_FULL_MESSAGE, STORAGE_MANAGE_URL, STORAGE_WRITE_TOO_LARGE_MESSAGE, SchemaInfo, SecretCatalogEntry, SecretPayload, SecretPutOptions, SecretScopeOptions, SecretsError, SecretsService, ServiceContext, ServiceContextConfig, ServiceSession, SessionExpiredError, ShareAccess, ShareLink, ShareLinkData, ShareSchema, SharingService, SharingServiceConfig, SignCallback, SignInOptions, SignRequest, SignResponse, SignedReceiverKeyInput, SilentNotificationHandler, Space, SpaceAbilitiesMap, SpaceConfig, SpaceCreationContext, SpaceErrorCode, SpaceErrorCodes, SpaceInfo, SpaceOwnership, SpaceService, SpaceServiceConfig, SqlStatement, SqlValue, StorageAccountUsage, StorageFullEvent, StorageStatus, StorageStatusOptions, StorageUsage, StorageUsageState, StoredDelegationChain, SubscribeOptions, TC832_RESERVED_SCOPES, TableInfo, TelemetryConfig, TelemetryEventHandler, TinyCloud, TinyCloudConfig, TinyCloudDebugEnableOptions, TinyCloudDebugEvent, TinyCloudDebugLevel, TinyCloudDebugLogger, TinyCloudDebugTimer, TinyCloudSession, UnsupportedFeatureError, VAULT_PERMISSION_SERVICE, VaultCrypto, VaultEntry, VaultError, VaultGetOptions, VaultGrantOptions, VaultHeaders, VaultListOptions, VaultNetworkReadResult, VaultPublicSpaceKVActions, VaultPutOptions, VerifyDecryptResponseInput, VersionCheckError, ViewInfo, WasmVaultFunctions, WellKnownDescriptorFetcher, addressStorageKey, appSecretScope, buildCanonicalDecryptRequest, buildDecryptAttenuation, buildDecryptFacts, buildDecryptInvocation, buildNetworkId, buildSpaceUri, canonicalHashHex, canonicalSignedResponse, canonicalizeAddress, canonicalizeDid, canonicalizeDidUrl, canonicalizeEncryptionJson, canonicalizeNetworkId, canonicalizeSecretScope, checkDecryptInvocationInput, checkNodeInfo, clearTinyCloudDebugLogs, composeManifestRequest, createCapabilityKeyRegistry, createOpenKeyCallbackSigningStrategy, createSharingService, createSpaceService, createVaultCrypto, decryptEnvelopeWithKey, defaultSpaceCreationHandler, deriveSignedReceiverKey, didCacheKey, didEquals, disableTinyCloudDebug, discoverNetwork, enableTinyCloudDebug, encryptToNetwork, encryptionBase64Decode, encryptionBase64Encode, encryptionError, encryptionUtf8Decode, encryptionUtf8Encode, ensureNetworkUsableForDecrypt, expandActionShortNames, expandPermissionEntries, expandPermissionEntry, generateRandomReceiverKey, getTinyCloudDebugLogs, hexDecode, hexEncode, installTinyCloudDebugGlobals, isCapabilitySubset, isEvmAddress, isNetworkId, isStorageFullError, loadManifest, makePkhSpaceId, makePublicSpaceId, networkDiscoveryKey, openWrappedKey, parseCanonicalNetworkId, parseExpiry, parseNetworkId, parsePkhDid, parseSecretCatalogKey, parseSpaceUri, pkhDid, principalDid, principalDidEquals, resolveManifest, resolveSecretListPrefix, resolveSecretPath, resourceCapabilitiesToSpaceAbilitiesMap, storageUsageState, tinyCloudDebugLogger, validateEnvelope, validateManifest, verifyDecryptResponse } from '@tinycloud/sdk-core';
|
|
3
3
|
export { F as FileSessionStorage, M as MemorySessionStorage, W as WasmKeyProvider, a as WasmKeyProviderConfig, c as createWasmKeyProvider } from './WasmKeyProvider-5Ee7fcAw.cjs';
|
|
4
|
-
export { A as ACCEPTED_MARKER_VERSIONS, a as AuthDelegationArtifact, b as AuthRequestArtifact, B as BOOTSTRAP_COMPLETION_MARKER_KEY, c as BOOTSTRAP_COMPLETION_MARKER_VERSION, d as BootstrapCompletionMarker, e as BootstrapWarning, C as CompactRuntimeDelegationInput, f as CreateOwnerDelegationParams, D as DelegateToOptions, g as DelegateToResult, h as DelegatedAccess, i as DelegationAuthority, E as EnsureEncryptionNetworkOptions, I as InvalidRestoredSessionError, N as NodeEventEmitterStrategy, j as NodeUserAuthorization, k as NodeUserAuthorizationAuthorizeFn, l as NodeUserAuthorizationConfig, O as OpenKeyAuthorizationResultV1, m as OpenKeyAuthorizeInput, n as OpenKeyAuthorizeTinyCloud, o as OpenKeyBridgeInput, p as OwnerDelegationReceipt, P as PortableDelegation, R as RUNTIME_DELEGATION_REJECTIONS, q as RestorableSession, r as RuntimeDelegationActivator, s as RuntimeDelegationRejectedError, t as RuntimeDelegationRejection, u as RuntimePermissionGrantOptions, S as SecretPermissionHint, v as SecretReadInput, w as SecretReadResult, x as SessionGrantProof, y as SignStrategy, T as TinyCloudNode, z as TinyCloudNodeConfig, U as UnifiedOwnerRootInput, F as UnifiedOwnerRootReceipt, G as UnsupportedSessionRestoreError, V as ValidatedRuntimeDelegation, H as VerifiedSessionGrant, J as activateCompactRuntimeDelegation, K as activateValidatedRuntimeDelegation, L as defaultSignStrategy, M as deserializeDelegation, Q as grantAuthRequest, W as serializeDelegation, X as signedCompactUcanExpiry, Y as siweRuntimeDelegation, Z as wireOpenKeyAuthorize } from './TinyCloudNode-
|
|
4
|
+
export { A as ACCEPTED_MARKER_VERSIONS, a as AuthDelegationArtifact, b as AuthRequestArtifact, B as BOOTSTRAP_COMPLETION_MARKER_KEY, c as BOOTSTRAP_COMPLETION_MARKER_VERSION, d as BootstrapCompletionMarker, e as BootstrapWarning, C as CompactRuntimeDelegationInput, f as CreateOwnerDelegationParams, D as DelegateToOptions, g as DelegateToResult, h as DelegatedAccess, i as DelegationAuthority, E as EnsureEncryptionNetworkOptions, I as InvalidRestoredSessionError, N as NodeEventEmitterStrategy, j as NodeUserAuthorization, k as NodeUserAuthorizationAuthorizeFn, l as NodeUserAuthorizationConfig, O as OpenKeyAuthorizationResultV1, m as OpenKeyAuthorizeInput, n as OpenKeyAuthorizeTinyCloud, o as OpenKeyBridgeInput, p as OwnerDelegationReceipt, P as PortableDelegation, R as RUNTIME_DELEGATION_REJECTIONS, q as RestorableSession, r as RuntimeDelegationActivator, s as RuntimeDelegationRejectedError, t as RuntimeDelegationRejection, u as RuntimePermissionGrantOptions, S as SecretPermissionHint, v as SecretReadInput, w as SecretReadResult, x as SessionGrantProof, y as SignStrategy, T as TinyCloudNode, z as TinyCloudNodeConfig, U as UnifiedOwnerRootInput, F as UnifiedOwnerRootReceipt, G as UnsupportedSessionRestoreError, V as ValidatedRuntimeDelegation, H as VerifiedSessionGrant, J as activateCompactRuntimeDelegation, K as activateValidatedRuntimeDelegation, L as defaultSignStrategy, M as deserializeDelegation, Q as grantAuthRequest, W as serializeDelegation, X as signedCompactUcanExpiry, Y as siweRuntimeDelegation, Z as wireOpenKeyAuthorize } from './TinyCloudNode-BPDOmuf6.cjs';
|
|
5
5
|
import { invoke, invokeAny, computeCid, prepareSession, completeSessionSetup, ensureEip55, makeSpaceId, createDelegation, parseRecapFromSiwe, parseVerifiedRecapFromSiwe, generateHostSIWEMessage, siweToDelegationHeaders, protocolVersion, vault_encrypt, vault_decrypt, vault_derive_key, vault_x25519_from_seed, vault_x25519_dh, vault_random_bytes, vault_sha256 } from '@tinycloud/node-sdk-wasm';
|
|
6
6
|
import { KVReplicaStorage } from '@tinycloud/sdk-services';
|
|
7
7
|
import { ProfileReplicaPurge } from '@tinycloud/sdk-services/kv/replication';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ISigner, Bytes, IWasmBindings, PersistedSessionProof, ISessionManager } from '@tinycloud/sdk-core';
|
|
2
2
|
export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, AccountApplication, AccountApplicationListOptions, AccountApplicationRegisterOptions, AccountDelegation, AccountDelegationListOptions, AccountDelegationPage, AccountDelegationQueryOptions, AccountDelegationRecord, AccountDelegationResource, AccountDelegationRevokeOptions, AccountIndexEnsureResult, AccountIndexRebuildResult, AccountIndexStatus, AccountIndexedReadOptions, AccountService, AccountServiceConfig, AccountSpace, AccountSpaceListOptions, AccountStatus, AuthorityRefusal, AutoApproveSpaceCreationHandler, AutoRejectStrategy, AutoSignStrategy, BatchOptions, BatchResponse, BuildCanonicalDecryptRequestInput, BuildDecryptFactsInput, BuildDecryptInvocationInput, BuiltDecryptInvocation, CallbackStrategy, CanonicalAddress, CanonicalDecryptRequest, CanonicalJson, CanonicalParsedNetworkId, CapabilityEntry, CapabilityKeyRegistry, CapabilityKeyRegistryErrorCode, CapabilityKeyRegistryErrorCodes, CaveatedDelegationUnsupportedError, ClientSession, ColumnInfo, ComposeManifestOptions, ComposedManifestRequest, CreateDelegationParams, DECRYPT_ACTION, DECRYPT_FACT_TYPE, DECRYPT_RESULT_TYPE, DEFAULT_ENCRYPTION_ALG, DEFAULT_KEY_VERSION, DEFAULT_MANIFEST_SPACE, DEFAULT_MANIFEST_VERSION, DEFAULT_SIGNED_READ_URL_EXPIRY_MS, DataVaultConfig, DataVaultService, DatabaseHandle, DecryptCapabilityProof, DecryptEnvelopeOptions, DecryptInvocationFact, DecryptInvocationSigner, DecryptRequestBody, DecryptResponseBody, DecryptTransport, DecryptTransportResponseError, DelegateReceivedShareParams, DelegatedShareAccess, Delegation, DelegationChain, DelegationChainV2, DelegationDirection, DelegationError, DelegationErrorCode, DelegationErrorCodes, DelegationFilters, DelegationManager, DelegationManagerConfig, DelegationRecord, DelegationResult, DelegationRevocationReceipt, DidCacheKeyOptions, DidEqualsOptions, DiscoverNetworkInput, DiscoveredNetwork, DiscoverySource, DuckDbAction, DuckDbActionType, DuckDbBatchOptions, DuckDbBatchResponse, DuckDbDatabaseHandle, DuckDbExecuteOptions, DuckDbExecuteResponse, DuckDbOptions, DuckDbQueryOptions, DuckDbQueryResponse, DuckDbService, DuckDbServiceConfig, DuckDbStatement, DuckDbValue, ENCRYPTION_NETWORK_URN_PREFIX, ENCRYPTION_SERVICE, ENCRYPTION_SERVICE_SHORT, ENVELOPE_VERSION, EncodedShareData, EncryptToNetworkInput, EncryptToNetworkOptions, EncryptToNetworkResult, EncryptionCrypto, EncryptionError, EncryptionErrorInput, EncryptionService, EncryptionServiceConfig, ExecuteOptions, ExecuteResponse, Extension, FetchFunction, GenerateShareParams, HookEvent, HookServiceName, HookStreamEvent, HookSubscription, HookWebhookListOptions, HookWebhookRecord, HookWebhookRegistration, HookWebhookScope, HookWebhookUnregisterOptions, HooksService, HooksServiceConfig, ICapabilityKeyRegistry, IDataVaultService, IDatabaseHandle, IDuckDbDatabaseHandle, IDuckDbService, IENSResolver, IEncryptionService, IHooksService, IKVService, INotificationHandler, IPrefixedKVService, ISQLService, ISecretsService, ISessionManager, ISessionStorage, ISharingService, ISigner, ISpace, ISpaceCreationHandler, ISpaceScopedDelegations, ISpaceScopedSharing, ISpaceService, IStorageService, IUserAuthorization, IWasmBindings, IdentityParseError, IngestOptions, InlineEncryptedEnvelope, InvokeFunction, JWK, KVBatchReadResponse, KVCreateSignedReadUrlOptions, KVListPage, KVReadThrough, KVReplicaHandle, KVReplicaSpec, KVReplicaStorage, KVReplicationController, KVReplicationDeps, KVResponse, KVService, KVServiceConfig, KVSignedReadUrlResponse, KeyInfo, KeyProvider, KeyType, LocalGetResult, LocalListResult, LocalReadMeta, LocalReplicaStatus, LocalSyncResult, MAX_SECRET_SCOPE_LENGTH, Manifest, ManifestDefaults, ManifestRegistryRecord, ManifestSecretActions, ManifestValidationError, NETWORK_NAME_PATTERN, NetworkDescriptor, NetworkIdError, NodeDescriptorFetcher, OpenKeyCallbackStrategy, OpenKeySigningRequestBody, OpenKeySigningResponseBody, OpenKeySigningStrategyOptions, OwnerDelegationPermission, ParsedNetworkId, ParsedSecretCatalogKey, PendingWriteRecord, PendingWriteState, PendingWriteStore, PermissionEntry, PermissionNotInManifestError, PersistedSessionData, PinnedKey, PkhDidParts, PrefixedKVService, ProtocolMismatchError, PurgeTarget, QueryOptions, QueryResponse, RandomReceiverKeyInput, ReceiveOptions, ReceiverKeyPair, ReceiverKeySigner, RegisterBatchSuccess, RegisterPolicyV3Input, RegisterPolicyV3Receipt, ReplicaAuthorityState, ReplicaCoverage, ReplicaDevice, ReplicaGatedHandle, ReplicaGrantInfo, ReplicaInspectedStatus, ReplicaState, ReplicaStatusEntry, ReplicationAuthority, ReplicationControl, ReplicationEvent, ReplicationIdentity, ReplicationOptions, ReplicationPurgeReport, ReplicationReason, ReplicationScheduler, ResolvedCapabilities, ResolvedDelegate, ResolvedReplicationOptions, ResolvedSecretPath, ResourceCapability, SECRET_NAME_RE, SECRET_SCOPE_RE, SQLAction, SQLActionType, SQLService, SQLServiceConfig, STORAGE_FULL_MESSAGE, STORAGE_MANAGE_URL, STORAGE_WRITE_TOO_LARGE_MESSAGE, SchemaInfo, SecretCatalogEntry, SecretPayload, SecretPutOptions, SecretScopeOptions, SecretsError, SecretsService, ServiceContext, ServiceContextConfig, ServiceSession, SessionExpiredError, ShareAccess, ShareLink, ShareLinkData, ShareSchema, SharingService, SharingServiceConfig, SignCallback, SignInOptions, SignRequest, SignResponse, SignedReceiverKeyInput, SilentNotificationHandler, Space, SpaceAbilitiesMap, SpaceConfig, SpaceCreationContext, SpaceErrorCode, SpaceErrorCodes, SpaceInfo, SpaceOwnership, SpaceService, SpaceServiceConfig, SqlStatement, SqlValue, StorageAccountUsage, StorageFullEvent, StorageStatus, StorageStatusOptions, StorageUsage, StorageUsageState, StoredDelegationChain, SubscribeOptions, TC832_RESERVED_SCOPES, TableInfo, TelemetryConfig, TelemetryEventHandler, TinyCloud, TinyCloudConfig, TinyCloudDebugEnableOptions, TinyCloudDebugEvent, TinyCloudDebugLevel, TinyCloudDebugLogger, TinyCloudDebugTimer, TinyCloudSession, UnsupportedFeatureError, VAULT_PERMISSION_SERVICE, VaultCrypto, VaultEntry, VaultError, VaultGetOptions, VaultGrantOptions, VaultHeaders, VaultListOptions, VaultNetworkReadResult, VaultPublicSpaceKVActions, VaultPutOptions, VerifyDecryptResponseInput, VersionCheckError, ViewInfo, WasmVaultFunctions, WellKnownDescriptorFetcher, addressStorageKey, appSecretScope, buildCanonicalDecryptRequest, buildDecryptAttenuation, buildDecryptFacts, buildDecryptInvocation, buildNetworkId, buildSpaceUri, canonicalHashHex, canonicalSignedResponse, canonicalizeAddress, canonicalizeDid, canonicalizeDidUrl, canonicalizeEncryptionJson, canonicalizeNetworkId, canonicalizeSecretScope, checkDecryptInvocationInput, checkNodeInfo, clearTinyCloudDebugLogs, composeManifestRequest, createCapabilityKeyRegistry, createOpenKeyCallbackSigningStrategy, createSharingService, createSpaceService, createVaultCrypto, decryptEnvelopeWithKey, defaultSpaceCreationHandler, deriveSignedReceiverKey, didCacheKey, didEquals, disableTinyCloudDebug, discoverNetwork, enableTinyCloudDebug, encryptToNetwork, encryptionBase64Decode, encryptionBase64Encode, encryptionError, encryptionUtf8Decode, encryptionUtf8Encode, ensureNetworkUsableForDecrypt, expandActionShortNames, expandPermissionEntries, expandPermissionEntry, generateRandomReceiverKey, getTinyCloudDebugLogs, hexDecode, hexEncode, installTinyCloudDebugGlobals, isCapabilitySubset, isEvmAddress, isNetworkId, isStorageFullError, loadManifest, makePkhSpaceId, makePublicSpaceId, networkDiscoveryKey, openWrappedKey, parseCanonicalNetworkId, parseExpiry, parseNetworkId, parsePkhDid, parseSecretCatalogKey, parseSpaceUri, pkhDid, principalDid, principalDidEquals, resolveManifest, resolveSecretListPrefix, resolveSecretPath, resourceCapabilitiesToSpaceAbilitiesMap, storageUsageState, tinyCloudDebugLogger, validateEnvelope, validateManifest, verifyDecryptResponse } from '@tinycloud/sdk-core';
|
|
3
3
|
export { F as FileSessionStorage, M as MemorySessionStorage, W as WasmKeyProvider, a as WasmKeyProviderConfig, c as createWasmKeyProvider } from './WasmKeyProvider-5Ee7fcAw.js';
|
|
4
|
-
export { A as ACCEPTED_MARKER_VERSIONS, a as AuthDelegationArtifact, b as AuthRequestArtifact, B as BOOTSTRAP_COMPLETION_MARKER_KEY, c as BOOTSTRAP_COMPLETION_MARKER_VERSION, d as BootstrapCompletionMarker, e as BootstrapWarning, C as CompactRuntimeDelegationInput, f as CreateOwnerDelegationParams, D as DelegateToOptions, g as DelegateToResult, h as DelegatedAccess, i as DelegationAuthority, E as EnsureEncryptionNetworkOptions, I as InvalidRestoredSessionError, N as NodeEventEmitterStrategy, j as NodeUserAuthorization, k as NodeUserAuthorizationAuthorizeFn, l as NodeUserAuthorizationConfig, O as OpenKeyAuthorizationResultV1, m as OpenKeyAuthorizeInput, n as OpenKeyAuthorizeTinyCloud, o as OpenKeyBridgeInput, p as OwnerDelegationReceipt, P as PortableDelegation, R as RUNTIME_DELEGATION_REJECTIONS, q as RestorableSession, r as RuntimeDelegationActivator, s as RuntimeDelegationRejectedError, t as RuntimeDelegationRejection, u as RuntimePermissionGrantOptions, S as SecretPermissionHint, v as SecretReadInput, w as SecretReadResult, x as SessionGrantProof, y as SignStrategy, T as TinyCloudNode, z as TinyCloudNodeConfig, U as UnifiedOwnerRootInput, F as UnifiedOwnerRootReceipt, G as UnsupportedSessionRestoreError, V as ValidatedRuntimeDelegation, H as VerifiedSessionGrant, J as activateCompactRuntimeDelegation, K as activateValidatedRuntimeDelegation, L as defaultSignStrategy, M as deserializeDelegation, Q as grantAuthRequest, W as serializeDelegation, X as signedCompactUcanExpiry, Y as siweRuntimeDelegation, Z as wireOpenKeyAuthorize } from './TinyCloudNode-
|
|
4
|
+
export { A as ACCEPTED_MARKER_VERSIONS, a as AuthDelegationArtifact, b as AuthRequestArtifact, B as BOOTSTRAP_COMPLETION_MARKER_KEY, c as BOOTSTRAP_COMPLETION_MARKER_VERSION, d as BootstrapCompletionMarker, e as BootstrapWarning, C as CompactRuntimeDelegationInput, f as CreateOwnerDelegationParams, D as DelegateToOptions, g as DelegateToResult, h as DelegatedAccess, i as DelegationAuthority, E as EnsureEncryptionNetworkOptions, I as InvalidRestoredSessionError, N as NodeEventEmitterStrategy, j as NodeUserAuthorization, k as NodeUserAuthorizationAuthorizeFn, l as NodeUserAuthorizationConfig, O as OpenKeyAuthorizationResultV1, m as OpenKeyAuthorizeInput, n as OpenKeyAuthorizeTinyCloud, o as OpenKeyBridgeInput, p as OwnerDelegationReceipt, P as PortableDelegation, R as RUNTIME_DELEGATION_REJECTIONS, q as RestorableSession, r as RuntimeDelegationActivator, s as RuntimeDelegationRejectedError, t as RuntimeDelegationRejection, u as RuntimePermissionGrantOptions, S as SecretPermissionHint, v as SecretReadInput, w as SecretReadResult, x as SessionGrantProof, y as SignStrategy, T as TinyCloudNode, z as TinyCloudNodeConfig, U as UnifiedOwnerRootInput, F as UnifiedOwnerRootReceipt, G as UnsupportedSessionRestoreError, V as ValidatedRuntimeDelegation, H as VerifiedSessionGrant, J as activateCompactRuntimeDelegation, K as activateValidatedRuntimeDelegation, L as defaultSignStrategy, M as deserializeDelegation, Q as grantAuthRequest, W as serializeDelegation, X as signedCompactUcanExpiry, Y as siweRuntimeDelegation, Z as wireOpenKeyAuthorize } from './TinyCloudNode-BPDOmuf6.js';
|
|
5
5
|
import { invoke, invokeAny, computeCid, prepareSession, completeSessionSetup, ensureEip55, makeSpaceId, createDelegation, parseRecapFromSiwe, parseVerifiedRecapFromSiwe, generateHostSIWEMessage, siweToDelegationHeaders, protocolVersion, vault_encrypt, vault_decrypt, vault_derive_key, vault_x25519_from_seed, vault_x25519_dh, vault_random_bytes, vault_sha256 } from '@tinycloud/node-sdk-wasm';
|
|
6
6
|
import { KVReplicaStorage } from '@tinycloud/sdk-services';
|
|
7
7
|
import { ProfileReplicaPurge } from '@tinycloud/sdk-services/kv/replication';
|
package/dist/index.js
CHANGED
|
@@ -18557,6 +18557,8 @@ import {
|
|
|
18557
18557
|
canonicalizeAddress as canonicalizeAddress2,
|
|
18558
18558
|
pkhDid as pkhDid2,
|
|
18559
18559
|
resolveTinyCloudHosts as resolveTinyCloudHosts2,
|
|
18560
|
+
resolveFailClosedTinyCloudHosts as resolveFailClosedTinyCloudHosts2,
|
|
18561
|
+
createInMemoryRegistrySequenceStore as createInMemoryRegistrySequenceStore2,
|
|
18560
18562
|
publishLocationRecord,
|
|
18561
18563
|
principalDidEquals as principalDidEquals3,
|
|
18562
18564
|
parseNetworkId as parseNetworkId2,
|
|
@@ -18598,6 +18600,11 @@ import {
|
|
|
18598
18600
|
resourceCapabilitiesToAbilitiesMap,
|
|
18599
18601
|
resourceCapabilitiesToSpaceAbilitiesMap,
|
|
18600
18602
|
resolveTinyCloudHosts,
|
|
18603
|
+
resolveFailClosedTinyCloudHosts,
|
|
18604
|
+
lookupOwnerRegistryVerdict,
|
|
18605
|
+
assertSpaceCreationAllowed,
|
|
18606
|
+
createInMemoryRegistrySequenceStore,
|
|
18607
|
+
registryOwnerSubjectV1,
|
|
18601
18608
|
EXPIRY,
|
|
18602
18609
|
canonicalizeAddress,
|
|
18603
18610
|
makePkhSpaceId,
|
|
@@ -18812,6 +18819,11 @@ var NodeUserAuthorization = class {
|
|
|
18812
18819
|
this.tinycloudHosts = config.tinycloudHosts;
|
|
18813
18820
|
this.tinycloudRegistryUrl = config.tinycloudRegistryUrl;
|
|
18814
18821
|
this.tinycloudFallbackHosts = config.tinycloudFallbackHosts;
|
|
18822
|
+
this.registryPolicy = config.registryPolicy;
|
|
18823
|
+
this.newUserHost = config.newUserHost;
|
|
18824
|
+
this.registryChainId = config.registryChainId;
|
|
18825
|
+
this.registrySequenceStore = config.registrySequenceStore ?? createInMemoryRegistrySequenceStore();
|
|
18826
|
+
this.onNodeNotFound = config.onNodeNotFound;
|
|
18815
18827
|
this.autoDiscoverLocalNode = config.autoDiscoverLocalNode;
|
|
18816
18828
|
this.localNodeUrl = config.localNodeUrl;
|
|
18817
18829
|
this.localLinkName = config.localLinkName;
|
|
@@ -18923,6 +18935,7 @@ var NodeUserAuthorization = class {
|
|
|
18923
18935
|
this._nodeFeaturesKnown = nodeFeatures !== void 0;
|
|
18924
18936
|
this._nodeInfoIdentity = void 0;
|
|
18925
18937
|
this.tinycloudHosts = hosts && hosts.length > 0 ? [...hosts] : void 0;
|
|
18938
|
+
this.registryVerdict = void 0;
|
|
18926
18939
|
this._lastActivationSkippedSpaceIds = [];
|
|
18927
18940
|
this._lastActivationActivatedSpaceIds = [];
|
|
18928
18941
|
if (!session) {
|
|
@@ -18973,6 +18986,23 @@ var NodeUserAuthorization = class {
|
|
|
18973
18986
|
if (this.tinycloudHosts && this.tinycloudHosts.length > 0) {
|
|
18974
18987
|
return;
|
|
18975
18988
|
}
|
|
18989
|
+
if (this.registryPolicy === "fail-closed") {
|
|
18990
|
+
const resolved2 = await resolveFailClosedTinyCloudHosts(address, {
|
|
18991
|
+
registryUrl: this.tinycloudRegistryUrl,
|
|
18992
|
+
registryChainId: this.registryChainId,
|
|
18993
|
+
newUserHost: this.newUserHost,
|
|
18994
|
+
sequenceStore: this.registrySequenceStore,
|
|
18995
|
+
onNodeNotFound: this.onNodeNotFound,
|
|
18996
|
+
autoDiscoverLocalNode: this.autoDiscoverLocalNode,
|
|
18997
|
+
localNodeUrl: this.localNodeUrl,
|
|
18998
|
+
localLinkName: this.localLinkName,
|
|
18999
|
+
expectedNodeDid: this.expectedNodeDid,
|
|
19000
|
+
localNodeIdentityStore: this.localNodeIdentityStore
|
|
19001
|
+
});
|
|
19002
|
+
this.tinycloudHosts = resolved2.hosts;
|
|
19003
|
+
this.registryVerdict = resolved2.verdict;
|
|
19004
|
+
return;
|
|
19005
|
+
}
|
|
18976
19006
|
const subject = pkhDid(address, chainId);
|
|
18977
19007
|
const resolved = await resolveTinyCloudHosts(subject, {
|
|
18978
19008
|
registryUrl: this.tinycloudRegistryUrl,
|
|
@@ -18985,6 +19015,32 @@ var NodeUserAuthorization = class {
|
|
|
18985
19015
|
});
|
|
18986
19016
|
this.tinycloudHosts = resolved.hosts;
|
|
18987
19017
|
}
|
|
19018
|
+
/**
|
|
19019
|
+
* Space-creation guard (TC-1443). Under `registryPolicy: "fail-closed"`,
|
|
19020
|
+
* throws unless the owner's registry verdict allows a space on the primary
|
|
19021
|
+
* host: `NodeRegistryEntryExistsError` when the owner's record does not
|
|
19022
|
+
* list it, `RegistryUnavailableError` when the registry gives no
|
|
19023
|
+
* verdict. Reuses this session's sign-in verdict unless it was
|
|
19024
|
+
* `unavailable`, else looks it up now (explicit-host apps). Under the
|
|
19025
|
+
* default policy it returns at once and performs no lookup.
|
|
19026
|
+
*/
|
|
19027
|
+
async assertMayCreateSpace() {
|
|
19028
|
+
if (this.registryPolicy !== "fail-closed") return;
|
|
19029
|
+
if (this._address === void 0) {
|
|
19030
|
+
throw new Error("Must be signed in to create a space");
|
|
19031
|
+
}
|
|
19032
|
+
await this.ensureTinyCloudHosts();
|
|
19033
|
+
const subject = registryOwnerSubjectV1(this._address, this.registryChainId);
|
|
19034
|
+
let verdict = this.registryVerdict;
|
|
19035
|
+
if (verdict?.subject !== subject || verdict.status === "unavailable") {
|
|
19036
|
+
verdict = await lookupOwnerRegistryVerdict(subject, {
|
|
19037
|
+
registryUrl: this.tinycloudRegistryUrl,
|
|
19038
|
+
sequenceStore: this.registrySequenceStore
|
|
19039
|
+
});
|
|
19040
|
+
this.registryVerdict = verdict;
|
|
19041
|
+
}
|
|
19042
|
+
assertSpaceCreationAllowed(verdict, this.primaryTinyCloudHost);
|
|
19043
|
+
}
|
|
18988
19044
|
requireTinyCloudHosts() {
|
|
18989
19045
|
if (!this.tinycloudHosts || this.tinycloudHosts.length === 0) {
|
|
18990
19046
|
throw new Error("TinyCloud hosts have not been resolved. Call signIn() first.");
|
|
@@ -19433,6 +19489,7 @@ var NodeUserAuthorization = class {
|
|
|
19433
19489
|
if (!handler) {
|
|
19434
19490
|
return;
|
|
19435
19491
|
}
|
|
19492
|
+
await this.guardSpaceCreation(handler, creationContext);
|
|
19436
19493
|
const confirmed = await handler.confirmSpaceCreation(creationContext);
|
|
19437
19494
|
if (!confirmed) {
|
|
19438
19495
|
return;
|
|
@@ -19473,6 +19530,7 @@ var NodeUserAuthorization = class {
|
|
|
19473
19530
|
if (!handler) {
|
|
19474
19531
|
return;
|
|
19475
19532
|
}
|
|
19533
|
+
await this.guardSpaceCreation(handler, creationContext);
|
|
19476
19534
|
const confirmed = await handler.confirmSpaceCreation(creationContext);
|
|
19477
19535
|
if (!confirmed) {
|
|
19478
19536
|
return;
|
|
@@ -19514,6 +19572,16 @@ var NodeUserAuthorization = class {
|
|
|
19514
19572
|
{ cause: result }
|
|
19515
19573
|
);
|
|
19516
19574
|
}
|
|
19575
|
+
/** {@link assertMayCreateSpace}, reporting a refusal to the creation handler before rethrowing it. */
|
|
19576
|
+
async guardSpaceCreation(handler, context) {
|
|
19577
|
+
try {
|
|
19578
|
+
await this.assertMayCreateSpace();
|
|
19579
|
+
} catch (error) {
|
|
19580
|
+
const failure = error instanceof Error ? error : new Error(String(error));
|
|
19581
|
+
handler.onSpaceCreationFailed?.(context, failure);
|
|
19582
|
+
throw failure;
|
|
19583
|
+
}
|
|
19584
|
+
}
|
|
19517
19585
|
recordActivationSkippedSpaces(result, primarySpaceId) {
|
|
19518
19586
|
if (result.success) {
|
|
19519
19587
|
this._lastActivationSkippedSpaceIds = result.skipped ?? [];
|
|
@@ -21482,7 +21550,9 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
21482
21550
|
this.explicitHost = config.host;
|
|
21483
21551
|
this.config = {
|
|
21484
21552
|
...config,
|
|
21485
|
-
host: config.host ?? DEFAULT_HOST
|
|
21553
|
+
host: config.host ?? DEFAULT_HOST,
|
|
21554
|
+
// One store for every authorization this client creates.
|
|
21555
|
+
registrySequenceStore: config.registrySequenceStore ?? createInMemoryRegistrySequenceStore2()
|
|
21486
21556
|
};
|
|
21487
21557
|
if (this.config.replication?.enabled) {
|
|
21488
21558
|
const runtime = getNodeReplicationLoaders().runtime().then(({ ReplicationRuntime: ReplicationRuntime2 }) => {
|
|
@@ -21752,6 +21822,7 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
21752
21822
|
tinycloudHosts: this.explicitHost ? [this.explicitHost] : void 0,
|
|
21753
21823
|
tinycloudRegistryUrl: config.tinycloudRegistryUrl,
|
|
21754
21824
|
tinycloudFallbackHosts: config.tinycloudFallbackHosts,
|
|
21825
|
+
...this.registryPolicyConfig(),
|
|
21755
21826
|
autoDiscoverLocalNode: config.autoDiscoverLocalNode,
|
|
21756
21827
|
localNodeUrl: config.localNodeUrl,
|
|
21757
21828
|
localLinkName: config.localLinkName,
|
|
@@ -22457,6 +22528,9 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
22457
22528
|
const primarySession = auth.tinyCloudSession;
|
|
22458
22529
|
const defaultSpaceId = this.ownedSpaceId("default");
|
|
22459
22530
|
const canReusePrimaryBootstrapSession = primarySession?.spaceId === defaultSpaceId && auth.capabilityRequest === BOOTSTRAP_SESSION_REQUESTS.default;
|
|
22531
|
+
if (steps.some((step) => step.kind === "host")) {
|
|
22532
|
+
await this.assertMayCreateSpace();
|
|
22533
|
+
}
|
|
22460
22534
|
for (const step of steps) {
|
|
22461
22535
|
if (step.kind !== "session") continue;
|
|
22462
22536
|
graph.assertActive();
|
|
@@ -23098,6 +23172,8 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
23098
23172
|
{ cause: activation }
|
|
23099
23173
|
);
|
|
23100
23174
|
}
|
|
23175
|
+
await this.assertMayCreateSpace();
|
|
23176
|
+
if (signal?.aborted) throw signal.reason;
|
|
23101
23177
|
const created = await this.hostOwnedSpaceOnce(spaceId, signal);
|
|
23102
23178
|
if (!created.success) {
|
|
23103
23179
|
throw Object.assign(
|
|
@@ -23211,6 +23287,12 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
23211
23287
|
* session's recap doesn't cover it and the registry has no record; the host
|
|
23212
23288
|
* SIWE is idempotent server-side. Must be called after {@link signIn}.
|
|
23213
23289
|
*
|
|
23290
|
+
* Under `registryPolicy: "fail-closed"`, hosting is refused with
|
|
23291
|
+
* `NodeRegistryEntryExistsError` when the owner's registry record does not
|
|
23292
|
+
* list the host, or `RegistryUnavailableError` when the registry gives no
|
|
23293
|
+
* verdict. {@link hostOwnedSpace} itself is an explicit action and is not
|
|
23294
|
+
* guarded.
|
|
23295
|
+
*
|
|
23214
23296
|
* @param name - The owned space name (e.g. `"secrets"`).
|
|
23215
23297
|
* @returns The hosted owned-space URI.
|
|
23216
23298
|
*/
|
|
@@ -23222,8 +23304,25 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
23222
23304
|
if (this.hostedOwnedSpaceIds.has(spaceId) || await this.isOwnedSpaceRegistered(spaceId)) {
|
|
23223
23305
|
return spaceId;
|
|
23224
23306
|
}
|
|
23307
|
+
await this.assertMayCreateSpace();
|
|
23225
23308
|
return this.hostOwnedSpace(name);
|
|
23226
23309
|
}
|
|
23310
|
+
/**
|
|
23311
|
+
* Space-creation guard (TC-1443) for the automatic hosting paths: sign-in's
|
|
23312
|
+
* owned spaces, account bootstrap, {@link ensureOwnedSpaceHosted} and
|
|
23313
|
+
* {@link ensurePublicSpace}. Only `registryPolicy: "fail-closed"` consults
|
|
23314
|
+
* the registry ({@link NodeUserAuthorization.assertMayCreateSpace}); the
|
|
23315
|
+
* default policy performs no lookup.
|
|
23316
|
+
*/
|
|
23317
|
+
async assertMayCreateSpace() {
|
|
23318
|
+
if (this.config.registryPolicy !== "fail-closed") return;
|
|
23319
|
+
await this.auth.assertMayCreateSpace();
|
|
23320
|
+
}
|
|
23321
|
+
/** Registry-policy settings shared by every authorization this client creates. */
|
|
23322
|
+
registryPolicyConfig() {
|
|
23323
|
+
const { registryPolicy, newUserHost, registryChainId, registrySequenceStore, onNodeNotFound } = this.config;
|
|
23324
|
+
return { registryPolicy, newUserHost, registryChainId, registrySequenceStore, onNodeNotFound };
|
|
23325
|
+
}
|
|
23227
23326
|
/**
|
|
23228
23327
|
* Submit the host delegation for an owned space, sharing one in-flight
|
|
23229
23328
|
* request (and so one approval) between concurrent callers in this session,
|
|
@@ -23901,6 +24000,21 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
23901
24000
|
if (address === void 0 || chainId === void 0) {
|
|
23902
24001
|
return void 0;
|
|
23903
24002
|
}
|
|
24003
|
+
if (this.config.registryPolicy === "fail-closed") {
|
|
24004
|
+
const resolved2 = await resolveFailClosedTinyCloudHosts2(address, {
|
|
24005
|
+
registryUrl: this.config.tinycloudRegistryUrl,
|
|
24006
|
+
registryChainId: this.config.registryChainId,
|
|
24007
|
+
newUserHost: this.config.newUserHost,
|
|
24008
|
+
sequenceStore: this.config.registrySequenceStore,
|
|
24009
|
+
onNodeNotFound: this.config.onNodeNotFound,
|
|
24010
|
+
autoDiscoverLocalNode: this.config.autoDiscoverLocalNode,
|
|
24011
|
+
localNodeUrl: this.config.localNodeUrl,
|
|
24012
|
+
localLinkName: this.config.localLinkName,
|
|
24013
|
+
expectedNodeDid: this.config.expectedNodeDid,
|
|
24014
|
+
localNodeIdentityStore: this.config.localNodeIdentityStore
|
|
24015
|
+
});
|
|
24016
|
+
return resolved2.hosts[0];
|
|
24017
|
+
}
|
|
23904
24018
|
const resolved = await resolveTinyCloudHosts2(pkhDid2(address, chainId), {
|
|
23905
24019
|
registryUrl: this.config.tinycloudRegistryUrl,
|
|
23906
24020
|
fallbackHosts: this.config.tinycloudFallbackHosts,
|
|
@@ -24093,6 +24207,7 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
24093
24207
|
tinycloudHosts: this.explicitHost ? [this.explicitHost] : void 0,
|
|
24094
24208
|
tinycloudRegistryUrl: this.config.tinycloudRegistryUrl,
|
|
24095
24209
|
tinycloudFallbackHosts: this.config.tinycloudFallbackHosts,
|
|
24210
|
+
...this.registryPolicyConfig(),
|
|
24096
24211
|
autoDiscoverLocalNode: this.config.autoDiscoverLocalNode,
|
|
24097
24212
|
localNodeUrl: this.config.localNodeUrl,
|
|
24098
24213
|
localLinkName: this.config.localLinkName,
|
|
@@ -24152,6 +24267,7 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
24152
24267
|
tinycloudHosts: this.explicitHost ? [this.explicitHost] : void 0,
|
|
24153
24268
|
tinycloudRegistryUrl: this.config.tinycloudRegistryUrl,
|
|
24154
24269
|
tinycloudFallbackHosts: this.config.tinycloudFallbackHosts,
|
|
24270
|
+
...this.registryPolicyConfig(),
|
|
24155
24271
|
autoDiscoverLocalNode: this.config.autoDiscoverLocalNode,
|
|
24156
24272
|
localNodeUrl: this.config.localNodeUrl,
|
|
24157
24273
|
localLinkName: this.config.localLinkName,
|
|
@@ -25789,7 +25905,9 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
25789
25905
|
* Ensure the user's public space exists and is accessible.
|
|
25790
25906
|
* Creates the space and activates a session delegation for it.
|
|
25791
25907
|
* This is the trigger for lazy public space creation — call it
|
|
25792
|
-
* before writing to spaces.get('public').kv.
|
|
25908
|
+
* before writing to spaces.get('public').kv. The vault calls it on unlock.
|
|
25909
|
+
* Under `registryPolicy: "fail-closed"` creation goes through the
|
|
25910
|
+
* space-creation guard.
|
|
25793
25911
|
*/
|
|
25794
25912
|
async ensurePublicSpace() {
|
|
25795
25913
|
if (!this.auth || !this.session || !this.signer) {
|
|
@@ -25799,6 +25917,7 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
25799
25917
|
if (!publicSpaceId) {
|
|
25800
25918
|
throw new Error("Public space not enabled. Set enablePublicSpace: true in config.");
|
|
25801
25919
|
}
|
|
25920
|
+
await this.assertMayCreateSpace();
|
|
25802
25921
|
await this.auth.hostPublicSpace(publicSpaceId);
|
|
25803
25922
|
const kvActions = [KV3.PUT, KV3.GET, KV3.DEL, KV3.LIST, KV3.METADATA];
|
|
25804
25923
|
const abilities = { kv: { "": kvActions } };
|