@tinycloud/node-sdk 2.11.0-beta.1 → 2.11.0-beta.3
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-CQ_5wXQT.d.cts → core-DfcWH9i4.d.cts} +66 -2
- package/dist/{core-CQ_5wXQT.d.ts → core-DfcWH9i4.d.ts} +66 -2
- package/dist/core.cjs +79 -8
- 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 +79 -8
- package/dist/core.js.map +1 -1
- package/dist/index.cjs +79 -8
- 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 -8
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/core.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, AccountApplication, AccountApplicationListOptions, AccountDelegation, AccountDelegationListOptions, AccountDelegationRevokeOptions, AccountIndexEnsureResult, AccountIndexRebuildResult, AccountIndexStatus, AccountIndexedReadOptions, AccountService, AccountServiceConfig, AccountSpace, AccountSpaceListOptions, AccountStatus, AutoApproveSpaceCreationHandler, AutoRejectStrategy, AutoSignStrategy, BatchOptions, BatchResponse, CallbackStrategy, CanonicalAddress, CanonicalParsedNetworkId, CapabilityEntry, CapabilityKeyRegistry, CapabilityKeyRegistryErrorCode, CapabilityKeyRegistryErrorCodes, CaveatedDelegationUnsupportedError, ClientSession, ColumnInfo, ComposeManifestOptions, ComposedManifestRequest, CreateDelegationParams, DEFAULT_MANIFEST_SPACE, DEFAULT_MANIFEST_VERSION, DEFAULT_SIGNED_READ_URL_EXPIRY_MS, DataVaultConfig, DataVaultService, DatabaseHandle, DelegateReceivedShareParams, DelegatedShareAccess, Delegation, DelegationChain, DelegationChainV2, DelegationDirection, DelegationError, DelegationErrorCode, DelegationErrorCodes, DelegationFilters, DelegationManager, DelegationManagerConfig, DelegationRecord, DelegationResult, DidCacheKeyOptions, DidEqualsOptions, DuckDbAction, DuckDbActionType, DuckDbBatchOptions, DuckDbBatchResponse, DuckDbDatabaseHandle, DuckDbExecuteOptions, DuckDbExecuteResponse, DuckDbOptions, DuckDbQueryOptions, DuckDbQueryResponse, DuckDbService, DuckDbServiceConfig, DuckDbStatement, DuckDbValue, EncodedShareData, ExecuteOptions, ExecuteResponse, Extension, FetchFunction, GenerateShareParams, ICapabilityKeyRegistry, IDataVaultService, IDatabaseHandle, IDuckDbDatabaseHandle, IDuckDbService, IENSResolver, IKVService, INotificationHandler, IPrefixedKVService, ISQLService, ISecretsService, ISessionManager, ISessionStorage, ISharingService, ISigner, ISpace, ISpaceCreationHandler, ISpaceScopedDelegations, ISpaceScopedSharing, ISpaceService, IUserAuthorization, IWasmBindings, IdentityParseError, IngestOptions, InvokeFunction, JWK, KVBatchReadResponse, KVCreateSignedReadUrlOptions, KVResponse, KVService, KVServiceConfig, KVSignedReadUrlResponse, KeyInfo, KeyProvider, KeyType, Manifest, ManifestDefaults, ManifestRegistryRecord, ManifestSecretActions, ManifestValidationError, OpenKeyCallbackStrategy, OpenKeySigningRequestBody, OpenKeySigningResponseBody, OpenKeySigningStrategyOptions, OwnerSharePolicyRegistrationReceipt, PermissionEntry, PermissionNotInManifestError, PersistedSessionData, PkhDidParts, PrefixedKVService, ProtocolMismatchError, QueryOptions, QueryResponse, ReceiveOptions, RegisterOwnerSharePolicyParams, 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, SilentNotificationHandler, Space, SpaceAbilitiesMap, SpaceConfig, SpaceCreationContext, SpaceErrorCode, SpaceErrorCodes, SpaceInfo, SpaceOwnership, SpaceService, SpaceServiceConfig, SqlStatement, SqlValue, StoredDelegationChain, 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, VersionCheckError, ViewInfo, WasmVaultFunctions, addressStorageKey, buildSpaceUri, canonicalizeAddress, canonicalizeDid, canonicalizeDidUrl, canonicalizeNetworkId, canonicalizeSecretScope, checkNodeInfo, clearTinyCloudDebugLogs, composeManifestRequest, createCapabilityKeyRegistry, createOpenKeyCallbackSigningStrategy, createSharingService, createSpaceService, createVaultCrypto, defaultSpaceCreationHandler, didCacheKey, didEquals, disableTinyCloudDebug, enableTinyCloudDebug, expandActionShortNames, expandPermissionEntries, expandPermissionEntry, getTinyCloudDebugLogs, installTinyCloudDebugGlobals, isCapabilitySubset, isEvmAddress, loadManifest, makePkhSpaceId, makePublicSpaceId, parseCanonicalNetworkId, parseExpiry, parsePkhDid, parseSpaceUri, pkhDid, principalDid, principalDidEquals, resolveManifest, resolveSecretListPrefix, resolveSecretPath, resourceCapabilitiesToSpaceAbilitiesMap, tinyCloudDebugLogger, validateManifest } from '@tinycloud/sdk-core';
|
|
2
|
-
export { C as CreateOwnerDelegationParams, D as DelegateToOptions, b as DelegateToResult, c as DelegatedAccess, F as FileSessionStorage, M as MemorySessionStorage, N as NodeEventEmitterStrategy, e as NodeUserAuthorization, f as NodeUserAuthorizationConfig, O as OwnerDelegationReceipt, P as PortableDelegation, h as RuntimePermissionGrantOptions, S as SecretPermissionHint, i as SecretReadInput, j as SecretReadResult, k as SignStrategy, T as TinyCloudNode, l as TinyCloudNodeConfig, U as UnsupportedSessionRestoreError, W as WasmKeyProvider, m as WasmKeyProviderConfig, o as createWasmKeyProvider, p as defaultSignStrategy, q as deserializeDelegation, s as serializeDelegation } from './core-
|
|
1
|
+
export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, AccountApplication, AccountApplicationListOptions, AccountApplicationRegisterOptions, AccountDelegation, AccountDelegationListOptions, AccountDelegationRevokeOptions, AccountIndexEnsureResult, AccountIndexRebuildResult, AccountIndexStatus, AccountIndexedReadOptions, AccountService, AccountServiceConfig, AccountSpace, AccountSpaceListOptions, AccountStatus, AutoApproveSpaceCreationHandler, AutoRejectStrategy, AutoSignStrategy, BatchOptions, BatchResponse, CallbackStrategy, CanonicalAddress, CanonicalParsedNetworkId, CapabilityEntry, CapabilityKeyRegistry, CapabilityKeyRegistryErrorCode, CapabilityKeyRegistryErrorCodes, CaveatedDelegationUnsupportedError, ClientSession, ColumnInfo, ComposeManifestOptions, ComposedManifestRequest, CreateDelegationParams, DEFAULT_MANIFEST_SPACE, DEFAULT_MANIFEST_VERSION, DEFAULT_SIGNED_READ_URL_EXPIRY_MS, DataVaultConfig, DataVaultService, DatabaseHandle, DelegateReceivedShareParams, DelegatedShareAccess, Delegation, DelegationChain, DelegationChainV2, DelegationDirection, DelegationError, DelegationErrorCode, DelegationErrorCodes, DelegationFilters, DelegationManager, DelegationManagerConfig, DelegationRecord, DelegationResult, DidCacheKeyOptions, DidEqualsOptions, DuckDbAction, DuckDbActionType, DuckDbBatchOptions, DuckDbBatchResponse, DuckDbDatabaseHandle, DuckDbExecuteOptions, DuckDbExecuteResponse, DuckDbOptions, DuckDbQueryOptions, DuckDbQueryResponse, DuckDbService, DuckDbServiceConfig, DuckDbStatement, DuckDbValue, EncodedShareData, ExecuteOptions, ExecuteResponse, Extension, FetchFunction, GenerateShareParams, ICapabilityKeyRegistry, IDataVaultService, IDatabaseHandle, IDuckDbDatabaseHandle, IDuckDbService, IENSResolver, IKVService, INotificationHandler, IPrefixedKVService, ISQLService, ISecretsService, ISessionManager, ISessionStorage, ISharingService, ISigner, ISpace, ISpaceCreationHandler, ISpaceScopedDelegations, ISpaceScopedSharing, ISpaceService, IUserAuthorization, IWasmBindings, IdentityParseError, IngestOptions, InvokeFunction, JWK, KVBatchReadResponse, KVCreateSignedReadUrlOptions, KVResponse, KVService, KVServiceConfig, KVSignedReadUrlResponse, KeyInfo, KeyProvider, KeyType, Manifest, ManifestDefaults, ManifestRegistryRecord, ManifestSecretActions, ManifestValidationError, OpenKeyCallbackStrategy, OpenKeySigningRequestBody, OpenKeySigningResponseBody, OpenKeySigningStrategyOptions, OwnerSharePolicyRegistrationReceipt, PermissionEntry, PermissionNotInManifestError, PersistedSessionData, PkhDidParts, PrefixedKVService, ProtocolMismatchError, QueryOptions, QueryResponse, ReceiveOptions, RegisterOwnerSharePolicyParams, 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, SilentNotificationHandler, Space, SpaceAbilitiesMap, SpaceConfig, SpaceCreationContext, SpaceErrorCode, SpaceErrorCodes, SpaceInfo, SpaceOwnership, SpaceService, SpaceServiceConfig, SqlStatement, SqlValue, StoredDelegationChain, 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, VersionCheckError, ViewInfo, WasmVaultFunctions, addressStorageKey, buildSpaceUri, canonicalizeAddress, canonicalizeDid, canonicalizeDidUrl, canonicalizeNetworkId, canonicalizeSecretScope, checkNodeInfo, clearTinyCloudDebugLogs, composeManifestRequest, createCapabilityKeyRegistry, createOpenKeyCallbackSigningStrategy, createSharingService, createSpaceService, createVaultCrypto, defaultSpaceCreationHandler, didCacheKey, didEquals, disableTinyCloudDebug, enableTinyCloudDebug, expandActionShortNames, expandPermissionEntries, expandPermissionEntry, getTinyCloudDebugLogs, installTinyCloudDebugGlobals, isCapabilitySubset, isEvmAddress, loadManifest, makePkhSpaceId, makePublicSpaceId, parseCanonicalNetworkId, parseExpiry, parsePkhDid, parseSpaceUri, pkhDid, principalDid, principalDidEquals, resolveManifest, resolveSecretListPrefix, resolveSecretPath, resourceCapabilitiesToSpaceAbilitiesMap, tinyCloudDebugLogger, validateManifest } from '@tinycloud/sdk-core';
|
|
2
|
+
export { C as CreateOwnerDelegationParams, D as DelegateToOptions, b as DelegateToResult, c as DelegatedAccess, E as EnsureEncryptionNetworkOptions, F as FileSessionStorage, M as MemorySessionStorage, N as NodeEventEmitterStrategy, e as NodeUserAuthorization, f as NodeUserAuthorizationConfig, O as OwnerDelegationReceipt, P as PortableDelegation, h as RuntimePermissionGrantOptions, S as SecretPermissionHint, i as SecretReadInput, j as SecretReadResult, k as SignStrategy, T as TinyCloudNode, l as TinyCloudNodeConfig, U as UnsupportedSessionRestoreError, W as WasmKeyProvider, m as WasmKeyProviderConfig, o as createWasmKeyProvider, p as defaultSignStrategy, q as deserializeDelegation, s as serializeDelegation } from './core-DfcWH9i4.cjs';
|
|
3
3
|
import 'events';
|
|
4
4
|
import '@tinycloud/sdk-services';
|
package/dist/core.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, AccountApplication, AccountApplicationListOptions, AccountDelegation, AccountDelegationListOptions, AccountDelegationRevokeOptions, AccountIndexEnsureResult, AccountIndexRebuildResult, AccountIndexStatus, AccountIndexedReadOptions, AccountService, AccountServiceConfig, AccountSpace, AccountSpaceListOptions, AccountStatus, AutoApproveSpaceCreationHandler, AutoRejectStrategy, AutoSignStrategy, BatchOptions, BatchResponse, CallbackStrategy, CanonicalAddress, CanonicalParsedNetworkId, CapabilityEntry, CapabilityKeyRegistry, CapabilityKeyRegistryErrorCode, CapabilityKeyRegistryErrorCodes, CaveatedDelegationUnsupportedError, ClientSession, ColumnInfo, ComposeManifestOptions, ComposedManifestRequest, CreateDelegationParams, DEFAULT_MANIFEST_SPACE, DEFAULT_MANIFEST_VERSION, DEFAULT_SIGNED_READ_URL_EXPIRY_MS, DataVaultConfig, DataVaultService, DatabaseHandle, DelegateReceivedShareParams, DelegatedShareAccess, Delegation, DelegationChain, DelegationChainV2, DelegationDirection, DelegationError, DelegationErrorCode, DelegationErrorCodes, DelegationFilters, DelegationManager, DelegationManagerConfig, DelegationRecord, DelegationResult, DidCacheKeyOptions, DidEqualsOptions, DuckDbAction, DuckDbActionType, DuckDbBatchOptions, DuckDbBatchResponse, DuckDbDatabaseHandle, DuckDbExecuteOptions, DuckDbExecuteResponse, DuckDbOptions, DuckDbQueryOptions, DuckDbQueryResponse, DuckDbService, DuckDbServiceConfig, DuckDbStatement, DuckDbValue, EncodedShareData, ExecuteOptions, ExecuteResponse, Extension, FetchFunction, GenerateShareParams, ICapabilityKeyRegistry, IDataVaultService, IDatabaseHandle, IDuckDbDatabaseHandle, IDuckDbService, IENSResolver, IKVService, INotificationHandler, IPrefixedKVService, ISQLService, ISecretsService, ISessionManager, ISessionStorage, ISharingService, ISigner, ISpace, ISpaceCreationHandler, ISpaceScopedDelegations, ISpaceScopedSharing, ISpaceService, IUserAuthorization, IWasmBindings, IdentityParseError, IngestOptions, InvokeFunction, JWK, KVBatchReadResponse, KVCreateSignedReadUrlOptions, KVResponse, KVService, KVServiceConfig, KVSignedReadUrlResponse, KeyInfo, KeyProvider, KeyType, Manifest, ManifestDefaults, ManifestRegistryRecord, ManifestSecretActions, ManifestValidationError, OpenKeyCallbackStrategy, OpenKeySigningRequestBody, OpenKeySigningResponseBody, OpenKeySigningStrategyOptions, OwnerSharePolicyRegistrationReceipt, PermissionEntry, PermissionNotInManifestError, PersistedSessionData, PkhDidParts, PrefixedKVService, ProtocolMismatchError, QueryOptions, QueryResponse, ReceiveOptions, RegisterOwnerSharePolicyParams, 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, SilentNotificationHandler, Space, SpaceAbilitiesMap, SpaceConfig, SpaceCreationContext, SpaceErrorCode, SpaceErrorCodes, SpaceInfo, SpaceOwnership, SpaceService, SpaceServiceConfig, SqlStatement, SqlValue, StoredDelegationChain, 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, VersionCheckError, ViewInfo, WasmVaultFunctions, addressStorageKey, buildSpaceUri, canonicalizeAddress, canonicalizeDid, canonicalizeDidUrl, canonicalizeNetworkId, canonicalizeSecretScope, checkNodeInfo, clearTinyCloudDebugLogs, composeManifestRequest, createCapabilityKeyRegistry, createOpenKeyCallbackSigningStrategy, createSharingService, createSpaceService, createVaultCrypto, defaultSpaceCreationHandler, didCacheKey, didEquals, disableTinyCloudDebug, enableTinyCloudDebug, expandActionShortNames, expandPermissionEntries, expandPermissionEntry, getTinyCloudDebugLogs, installTinyCloudDebugGlobals, isCapabilitySubset, isEvmAddress, loadManifest, makePkhSpaceId, makePublicSpaceId, parseCanonicalNetworkId, parseExpiry, parsePkhDid, parseSpaceUri, pkhDid, principalDid, principalDidEquals, resolveManifest, resolveSecretListPrefix, resolveSecretPath, resourceCapabilitiesToSpaceAbilitiesMap, tinyCloudDebugLogger, validateManifest } from '@tinycloud/sdk-core';
|
|
2
|
-
export { C as CreateOwnerDelegationParams, D as DelegateToOptions, b as DelegateToResult, c as DelegatedAccess, F as FileSessionStorage, M as MemorySessionStorage, N as NodeEventEmitterStrategy, e as NodeUserAuthorization, f as NodeUserAuthorizationConfig, O as OwnerDelegationReceipt, P as PortableDelegation, h as RuntimePermissionGrantOptions, S as SecretPermissionHint, i as SecretReadInput, j as SecretReadResult, k as SignStrategy, T as TinyCloudNode, l as TinyCloudNodeConfig, U as UnsupportedSessionRestoreError, W as WasmKeyProvider, m as WasmKeyProviderConfig, o as createWasmKeyProvider, p as defaultSignStrategy, q as deserializeDelegation, s as serializeDelegation } from './core-
|
|
1
|
+
export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, AccountApplication, AccountApplicationListOptions, AccountApplicationRegisterOptions, AccountDelegation, AccountDelegationListOptions, AccountDelegationRevokeOptions, AccountIndexEnsureResult, AccountIndexRebuildResult, AccountIndexStatus, AccountIndexedReadOptions, AccountService, AccountServiceConfig, AccountSpace, AccountSpaceListOptions, AccountStatus, AutoApproveSpaceCreationHandler, AutoRejectStrategy, AutoSignStrategy, BatchOptions, BatchResponse, CallbackStrategy, CanonicalAddress, CanonicalParsedNetworkId, CapabilityEntry, CapabilityKeyRegistry, CapabilityKeyRegistryErrorCode, CapabilityKeyRegistryErrorCodes, CaveatedDelegationUnsupportedError, ClientSession, ColumnInfo, ComposeManifestOptions, ComposedManifestRequest, CreateDelegationParams, DEFAULT_MANIFEST_SPACE, DEFAULT_MANIFEST_VERSION, DEFAULT_SIGNED_READ_URL_EXPIRY_MS, DataVaultConfig, DataVaultService, DatabaseHandle, DelegateReceivedShareParams, DelegatedShareAccess, Delegation, DelegationChain, DelegationChainV2, DelegationDirection, DelegationError, DelegationErrorCode, DelegationErrorCodes, DelegationFilters, DelegationManager, DelegationManagerConfig, DelegationRecord, DelegationResult, DidCacheKeyOptions, DidEqualsOptions, DuckDbAction, DuckDbActionType, DuckDbBatchOptions, DuckDbBatchResponse, DuckDbDatabaseHandle, DuckDbExecuteOptions, DuckDbExecuteResponse, DuckDbOptions, DuckDbQueryOptions, DuckDbQueryResponse, DuckDbService, DuckDbServiceConfig, DuckDbStatement, DuckDbValue, EncodedShareData, ExecuteOptions, ExecuteResponse, Extension, FetchFunction, GenerateShareParams, ICapabilityKeyRegistry, IDataVaultService, IDatabaseHandle, IDuckDbDatabaseHandle, IDuckDbService, IENSResolver, IKVService, INotificationHandler, IPrefixedKVService, ISQLService, ISecretsService, ISessionManager, ISessionStorage, ISharingService, ISigner, ISpace, ISpaceCreationHandler, ISpaceScopedDelegations, ISpaceScopedSharing, ISpaceService, IUserAuthorization, IWasmBindings, IdentityParseError, IngestOptions, InvokeFunction, JWK, KVBatchReadResponse, KVCreateSignedReadUrlOptions, KVResponse, KVService, KVServiceConfig, KVSignedReadUrlResponse, KeyInfo, KeyProvider, KeyType, Manifest, ManifestDefaults, ManifestRegistryRecord, ManifestSecretActions, ManifestValidationError, OpenKeyCallbackStrategy, OpenKeySigningRequestBody, OpenKeySigningResponseBody, OpenKeySigningStrategyOptions, OwnerSharePolicyRegistrationReceipt, PermissionEntry, PermissionNotInManifestError, PersistedSessionData, PkhDidParts, PrefixedKVService, ProtocolMismatchError, QueryOptions, QueryResponse, ReceiveOptions, RegisterOwnerSharePolicyParams, 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, SilentNotificationHandler, Space, SpaceAbilitiesMap, SpaceConfig, SpaceCreationContext, SpaceErrorCode, SpaceErrorCodes, SpaceInfo, SpaceOwnership, SpaceService, SpaceServiceConfig, SqlStatement, SqlValue, StoredDelegationChain, 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, VersionCheckError, ViewInfo, WasmVaultFunctions, addressStorageKey, buildSpaceUri, canonicalizeAddress, canonicalizeDid, canonicalizeDidUrl, canonicalizeNetworkId, canonicalizeSecretScope, checkNodeInfo, clearTinyCloudDebugLogs, composeManifestRequest, createCapabilityKeyRegistry, createOpenKeyCallbackSigningStrategy, createSharingService, createSpaceService, createVaultCrypto, defaultSpaceCreationHandler, didCacheKey, didEquals, disableTinyCloudDebug, enableTinyCloudDebug, expandActionShortNames, expandPermissionEntries, expandPermissionEntry, getTinyCloudDebugLogs, installTinyCloudDebugGlobals, isCapabilitySubset, isEvmAddress, loadManifest, makePkhSpaceId, makePublicSpaceId, parseCanonicalNetworkId, parseExpiry, parsePkhDid, parseSpaceUri, pkhDid, principalDid, principalDidEquals, resolveManifest, resolveSecretListPrefix, resolveSecretPath, resourceCapabilitiesToSpaceAbilitiesMap, tinyCloudDebugLogger, validateManifest } from '@tinycloud/sdk-core';
|
|
2
|
+
export { C as CreateOwnerDelegationParams, D as DelegateToOptions, b as DelegateToResult, c as DelegatedAccess, E as EnsureEncryptionNetworkOptions, F as FileSessionStorage, M as MemorySessionStorage, N as NodeEventEmitterStrategy, e as NodeUserAuthorization, f as NodeUserAuthorizationConfig, O as OwnerDelegationReceipt, P as PortableDelegation, h as RuntimePermissionGrantOptions, S as SecretPermissionHint, i as SecretReadInput, j as SecretReadResult, k as SignStrategy, T as TinyCloudNode, l as TinyCloudNodeConfig, U as UnsupportedSessionRestoreError, W as WasmKeyProvider, m as WasmKeyProviderConfig, o as createWasmKeyProvider, p as defaultSignStrategy, q as deserializeDelegation, s as serializeDelegation } from './core-DfcWH9i4.js';
|
|
3
3
|
import 'events';
|
|
4
4
|
import '@tinycloud/sdk-services';
|
package/dist/core.js
CHANGED
|
@@ -473,6 +473,15 @@ var NodeUserAuthorization = class {
|
|
|
473
473
|
get nodeFeatures() {
|
|
474
474
|
return this._nodeFeatures;
|
|
475
475
|
}
|
|
476
|
+
/**
|
|
477
|
+
* The node DID reported by `GET /info` for `host`, if the sign-in (or
|
|
478
|
+
* restore) that populated it targeted that same host. Returns `undefined`
|
|
479
|
+
* for any other host, and for nodes whose `/info` omits `nodeId`, so callers
|
|
480
|
+
* fall back to fetching it themselves rather than using a foreign node's DID.
|
|
481
|
+
*/
|
|
482
|
+
nodeIdForHost(host) {
|
|
483
|
+
return this._nodeInfoIdentity?.host === host ? this._nodeInfoIdentity.nodeId : void 0;
|
|
484
|
+
}
|
|
476
485
|
get lastActivationSkippedSpaceIds() {
|
|
477
486
|
return [...this._lastActivationSkippedSpaceIds];
|
|
478
487
|
}
|
|
@@ -942,11 +951,13 @@ var NodeUserAuthorization = class {
|
|
|
942
951
|
this._tinyCloudSession = tinyCloudSession;
|
|
943
952
|
this._address = address;
|
|
944
953
|
this._chainId = chainId;
|
|
954
|
+
const infoHost = this.primaryTinyCloudHost;
|
|
945
955
|
const nodeInfo = await checkNodeInfo(
|
|
946
|
-
|
|
956
|
+
infoHost,
|
|
947
957
|
this.wasm.protocolVersion()
|
|
948
958
|
);
|
|
949
959
|
this._nodeFeatures = nodeInfo.features;
|
|
960
|
+
this._nodeInfoIdentity = nodeInfo.nodeId ? { host: infoHost, nodeId: nodeInfo.nodeId } : void 0;
|
|
950
961
|
for (const ext of this.extensions) {
|
|
951
962
|
if (ext.afterSignIn) {
|
|
952
963
|
await ext.afterSignIn(clientSession);
|
|
@@ -1112,11 +1123,13 @@ var NodeUserAuthorization = class {
|
|
|
1112
1123
|
this._tinyCloudSession = tinyCloudSession;
|
|
1113
1124
|
this._address = address;
|
|
1114
1125
|
this._chainId = chainId;
|
|
1126
|
+
const infoHost = this.primaryTinyCloudHost;
|
|
1115
1127
|
const nodeInfo = await checkNodeInfo(
|
|
1116
|
-
|
|
1128
|
+
infoHost,
|
|
1117
1129
|
this.wasm.protocolVersion()
|
|
1118
1130
|
);
|
|
1119
1131
|
this._nodeFeatures = nodeInfo.features;
|
|
1132
|
+
this._nodeInfoIdentity = nodeInfo.nodeId ? { host: infoHost, nodeId: nodeInfo.nodeId } : void 0;
|
|
1120
1133
|
for (const ext of this.extensions) {
|
|
1121
1134
|
if (ext.afterSignIn) {
|
|
1122
1135
|
await ext.afterSignIn(clientSession);
|
|
@@ -2081,6 +2094,12 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
2081
2094
|
this._baseSecrets = /* @__PURE__ */ new Map();
|
|
2082
2095
|
this._secrets = /* @__PURE__ */ new Map();
|
|
2083
2096
|
this.runtimePermissionGrants = [];
|
|
2097
|
+
/**
|
|
2098
|
+
* Owned space ids this sign-in has already confirmed are hosted. Consulted by
|
|
2099
|
+
* {@link ensureOwnedSpaceHostedById}; cleared on every {@link signIn} because
|
|
2100
|
+
* hosting is confirmed against the session that was active at the time.
|
|
2101
|
+
*/
|
|
2102
|
+
this.confirmedHostedSpaceIds = /* @__PURE__ */ new Set();
|
|
2084
2103
|
/**
|
|
2085
2104
|
* True when the last signIn() detected an interactive signer and skipped
|
|
2086
2105
|
* client-side bootstrap. Apps can read this to know whether bootstrap was
|
|
@@ -2477,6 +2496,7 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
2477
2496
|
this._spaceService = void 0;
|
|
2478
2497
|
this._serviceContext = void 0;
|
|
2479
2498
|
this.runtimePermissionGrants = [];
|
|
2499
|
+
this.confirmedHostedSpaceIds.clear();
|
|
2480
2500
|
await this.tc.signIn(options);
|
|
2481
2501
|
this.syncResolvedHostFromAuth();
|
|
2482
2502
|
const oldGraph = this._serviceGraph;
|
|
@@ -2659,14 +2679,18 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
2659
2679
|
}
|
|
2660
2680
|
if (step.kind === "seed-applications") {
|
|
2661
2681
|
const registered = await this.account.applications.register(
|
|
2662
|
-
step.manifests.length > 0 ? [...step.manifests] : TINYCLOUD_SECRETS_BOOTSTRAP_MANIFEST
|
|
2682
|
+
step.manifests.length > 0 ? [...step.manifests] : TINYCLOUD_SECRETS_BOOTSTRAP_MANIFEST,
|
|
2683
|
+
// Bootstrap only runs on an account with no registry records, so the
|
|
2684
|
+
// manifest-hash pre-read is definitionally a miss. Skip it; the write
|
|
2685
|
+
// it guards is an INSERT OR REPLACE and is safe to repeat.
|
|
2686
|
+
{ assumeUnregistered: true }
|
|
2663
2687
|
);
|
|
2664
2688
|
if (!registered.ok) {
|
|
2665
2689
|
throw new Error(`Failed to seed bootstrap applications: ${registered.error.message}`);
|
|
2666
2690
|
}
|
|
2667
2691
|
}
|
|
2668
2692
|
if (step.kind === "encryption-network-create") {
|
|
2669
|
-
await this.ensureEncryptionNetwork(step.networkId);
|
|
2693
|
+
await this.ensureEncryptionNetwork(step.networkId, { assumeMissing: true });
|
|
2670
2694
|
}
|
|
2671
2695
|
if (step.kind === "secret-records-schema") {
|
|
2672
2696
|
const db = this.sqlForSpace(step.spaceId).db(step.database);
|
|
@@ -2945,6 +2969,22 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
2945
2969
|
await this.ensureEncryptionNetwork(networkId);
|
|
2946
2970
|
}
|
|
2947
2971
|
}
|
|
2972
|
+
/**
|
|
2973
|
+
* Ensure one of this user's owned spaces is hosted, at most once per space
|
|
2974
|
+
* per sign-in.
|
|
2975
|
+
*
|
|
2976
|
+
* Account bootstrap funnels six calls through here (via
|
|
2977
|
+
* `AccountService.ensureAccountSpaceHosted`), and each one re-submits
|
|
2978
|
+
* `activateSessionWithHost` with the *primary* session. That session's recap
|
|
2979
|
+
* covers only `default` and `secrets`, so the account space appears in
|
|
2980
|
+
* neither `activated` nor `skipped` and the guard below returns immediately
|
|
2981
|
+
* — the repeat calls cannot change the outcome, they only cost round trips.
|
|
2982
|
+
*
|
|
2983
|
+
* The memo is per sign-in ({@link confirmedHostedSpaceIds} is cleared in
|
|
2984
|
+
* `signIn`) and only records confirmed successes. A wrong skip is
|
|
2985
|
+
* self-revealing: the next write to the space fails immediately and loudly
|
|
2986
|
+
* with `404 Space not found`.
|
|
2987
|
+
*/
|
|
2948
2988
|
async ensureOwnedSpaceHostedById(spaceId) {
|
|
2949
2989
|
if (!this.auth) {
|
|
2950
2990
|
throw new Error("Owned space hosting requires wallet mode");
|
|
@@ -2953,12 +2993,16 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
2953
2993
|
if (!session) {
|
|
2954
2994
|
throw new Error("Owned space hosting requires an active session");
|
|
2955
2995
|
}
|
|
2996
|
+
if (this.confirmedHostedSpaceIds.has(spaceId)) {
|
|
2997
|
+
return;
|
|
2998
|
+
}
|
|
2956
2999
|
const host = this.hosts[0] ?? this.config.host;
|
|
2957
3000
|
if (!host) {
|
|
2958
3001
|
throw new Error("Owned space hosting requires a TinyCloud host");
|
|
2959
3002
|
}
|
|
2960
3003
|
const activation = await activateSessionWithHost2(host, session.delegationHeader);
|
|
2961
3004
|
if (activation.success && !activation.skipped?.includes(spaceId)) {
|
|
3005
|
+
this.confirmedHostedSpaceIds.add(spaceId);
|
|
2962
3006
|
return;
|
|
2963
3007
|
}
|
|
2964
3008
|
if (!activation.success && activation.status !== 404) {
|
|
@@ -2977,6 +3021,7 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
2977
3021
|
`Failed to activate session after creating owned space ${spaceId}: ${retry.error ?? "space was skipped"}`
|
|
2978
3022
|
);
|
|
2979
3023
|
}
|
|
3024
|
+
this.confirmedHostedSpaceIds.add(spaceId);
|
|
2980
3025
|
}
|
|
2981
3026
|
/**
|
|
2982
3027
|
* Host one of this user's owned spaces by name (e.g. `"applications"`).
|
|
@@ -3299,6 +3344,7 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
3299
3344
|
this.tc = stagedGraph.core;
|
|
3300
3345
|
this._recapOperationsCache = stagedPrimary.cache;
|
|
3301
3346
|
this.runtimePermissionGrants = stagedPrimary.grants;
|
|
3347
|
+
this.confirmedHostedSpaceIds.clear();
|
|
3302
3348
|
if (this.auth) {
|
|
3303
3349
|
this.auth.installRestoredSession(stagedManager, stagedTcSession, [stagedHost]);
|
|
3304
3350
|
this._restoredTcSession = void 0;
|
|
@@ -3881,7 +3927,17 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
3881
3927
|
verifyNodeSignature: (nodeId, message, signature) => verifyDidKeyEd25519Signature(nodeId, message, signature)
|
|
3882
3928
|
};
|
|
3883
3929
|
}
|
|
3930
|
+
/**
|
|
3931
|
+
* The node DID for {@link config.host}.
|
|
3932
|
+
*
|
|
3933
|
+
* Sign-in already performs `GET /info` for the protocol-version check, and
|
|
3934
|
+
* that response carries `nodeId`, so reuse it rather than fetching `/info` a
|
|
3935
|
+
* second time. Only a value recorded for this exact host qualifies; older
|
|
3936
|
+
* nodes that omit `nodeId` fall through to the fetch.
|
|
3937
|
+
*/
|
|
3884
3938
|
async fetchNodeId() {
|
|
3939
|
+
const cached = this.auth?.nodeIdForHost(this.config.host);
|
|
3940
|
+
if (cached) return cached;
|
|
3885
3941
|
const response = await fetch(`${this.config.host}/info`);
|
|
3886
3942
|
if (!response.ok) {
|
|
3887
3943
|
throw new Error(`Failed to fetch node info: HTTP ${response.status}`);
|
|
@@ -4653,6 +4709,13 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
4653
4709
|
body
|
|
4654
4710
|
)
|
|
4655
4711
|
});
|
|
4712
|
+
if (response.status === 409) {
|
|
4713
|
+
const existing = await this.getEncryptionNetwork(networkId);
|
|
4714
|
+
if (existing) return existing;
|
|
4715
|
+
throw new Error(
|
|
4716
|
+
`Encryption network ${networkId} already exists but could not be read back`
|
|
4717
|
+
);
|
|
4718
|
+
}
|
|
4656
4719
|
if (!response.ok) {
|
|
4657
4720
|
throw new Error(
|
|
4658
4721
|
`Failed to create encryption network ${networkId}: HTTP ${response.status} ${await response.text()}`
|
|
@@ -4661,11 +4724,19 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
4661
4724
|
const created = await response.json();
|
|
4662
4725
|
return created.descriptor;
|
|
4663
4726
|
}
|
|
4664
|
-
|
|
4727
|
+
/**
|
|
4728
|
+
* Ensure an encryption network exists, creating it if necessary.
|
|
4729
|
+
*
|
|
4730
|
+
* @param nameOrNetworkId - Network name or full `urn:tinycloud:encryption:` id.
|
|
4731
|
+
* @param options - See {@link EnsureEncryptionNetworkOptions}.
|
|
4732
|
+
*/
|
|
4733
|
+
async ensureEncryptionNetwork(nameOrNetworkId = DEFAULT_ENCRYPTION_NETWORK_NAME, options = {}) {
|
|
4665
4734
|
const networkId = nameOrNetworkId.startsWith("urn:tinycloud:encryption:") ? nameOrNetworkId : this.getDefaultEncryptionNetworkId(nameOrNetworkId);
|
|
4666
|
-
|
|
4667
|
-
|
|
4668
|
-
|
|
4735
|
+
if (!options.assumeMissing) {
|
|
4736
|
+
const existing = await this.getEncryptionNetwork(networkId);
|
|
4737
|
+
if (existing) {
|
|
4738
|
+
return existing;
|
|
4739
|
+
}
|
|
4669
4740
|
}
|
|
4670
4741
|
const parsed = parseNetworkId2(networkId);
|
|
4671
4742
|
if (!didPrincipalMatches2(parsed.ownerDid, this.did)) {
|