@tinycloud/node-sdk 3.0.1-beta.0 → 3.1.0-beta.1
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-DufYfxi-.d.cts → core-Bm76PnOz.d.cts} +7 -1
- package/dist/{core-DufYfxi-.d.ts → core-Bm76PnOz.d.ts} +7 -1
- package/dist/core.cjs +44 -17
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.cts +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +45 -17
- package/dist/core.js.map +1 -1
- package/dist/index.cjs +44 -17
- 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 +45 -17
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/core.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
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, ParsedSecretCatalogKey, PermissionEntry, PermissionNotInManifestError, PersistedSessionData, PkhDidParts, PrefixedKVService, ProtocolMismatchError, QueryOptions, QueryResponse, ReceiveOptions, RegisterBatchSuccess, RegisterPolicyV3Input, RegisterPolicyV3Receipt, ResolvedCapabilities, ResolvedDelegate, ResolvedSecretPath, ResourceCapability, SECRET_NAME_RE, SQLAction, SQLActionType, SQLService, SQLServiceConfig, SchemaInfo, SecretCatalogEntry, 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, parseSecretCatalogKey, parseSpaceUri, pkhDid, principalDid, principalDidEquals, resolveManifest, resolveSecretListPrefix, resolveSecretPath, resourceCapabilitiesToSpaceAbilitiesMap, tinyCloudDebugLogger, validateManifest } from '@tinycloud/sdk-core';
|
|
2
|
-
export { e as BootstrapWarning, C as CompactRuntimeDelegationInput, f as CreateOwnerDelegationParams, D as DelegateToOptions, g as DelegateToResult, h as DelegatedAccess, E as EnsureEncryptionNetworkOptions, F as FileSessionStorage, I as InvalidRestoredSessionError, M as MemorySessionStorage, N as NodeEventEmitterStrategy, j as NodeUserAuthorization, k as NodeUserAuthorizationConfig, O as OwnerDelegationReceipt, P as PortableDelegation, m as RuntimePermissionGrantOptions, S as SecretPermissionHint, n as SecretReadInput, o as SecretReadResult, p as SignStrategy, T as TinyCloudNode, q as TinyCloudNodeConfig, U as UnifiedOwnerRootInput, r as UnifiedOwnerRootReceipt, s as UnsupportedSessionRestoreError, V as ValidatedRuntimeDelegation, W as WasmKeyProvider, t as WasmKeyProviderConfig, u as activateCompactRuntimeDelegation, w as createWasmKeyProvider, x as defaultSignStrategy, y as deserializeDelegation, G as serializeDelegation } from './core-
|
|
2
|
+
export { e as BootstrapWarning, C as CompactRuntimeDelegationInput, f as CreateOwnerDelegationParams, D as DelegateToOptions, g as DelegateToResult, h as DelegatedAccess, E as EnsureEncryptionNetworkOptions, F as FileSessionStorage, I as InvalidRestoredSessionError, M as MemorySessionStorage, N as NodeEventEmitterStrategy, j as NodeUserAuthorization, k as NodeUserAuthorizationConfig, O as OwnerDelegationReceipt, P as PortableDelegation, m as RuntimePermissionGrantOptions, S as SecretPermissionHint, n as SecretReadInput, o as SecretReadResult, p as SignStrategy, T as TinyCloudNode, q as TinyCloudNodeConfig, U as UnifiedOwnerRootInput, r as UnifiedOwnerRootReceipt, s as UnsupportedSessionRestoreError, V as ValidatedRuntimeDelegation, W as WasmKeyProvider, t as WasmKeyProviderConfig, u as activateCompactRuntimeDelegation, w as createWasmKeyProvider, x as defaultSignStrategy, y as deserializeDelegation, G as serializeDelegation } from './core-Bm76PnOz.cjs';
|
|
3
3
|
import 'events';
|
|
4
4
|
import '@tinycloud/sdk-services';
|
package/dist/core.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
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, ParsedSecretCatalogKey, PermissionEntry, PermissionNotInManifestError, PersistedSessionData, PkhDidParts, PrefixedKVService, ProtocolMismatchError, QueryOptions, QueryResponse, ReceiveOptions, RegisterBatchSuccess, RegisterPolicyV3Input, RegisterPolicyV3Receipt, ResolvedCapabilities, ResolvedDelegate, ResolvedSecretPath, ResourceCapability, SECRET_NAME_RE, SQLAction, SQLActionType, SQLService, SQLServiceConfig, SchemaInfo, SecretCatalogEntry, 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, parseSecretCatalogKey, parseSpaceUri, pkhDid, principalDid, principalDidEquals, resolveManifest, resolveSecretListPrefix, resolveSecretPath, resourceCapabilitiesToSpaceAbilitiesMap, tinyCloudDebugLogger, validateManifest } from '@tinycloud/sdk-core';
|
|
2
|
-
export { e as BootstrapWarning, C as CompactRuntimeDelegationInput, f as CreateOwnerDelegationParams, D as DelegateToOptions, g as DelegateToResult, h as DelegatedAccess, E as EnsureEncryptionNetworkOptions, F as FileSessionStorage, I as InvalidRestoredSessionError, M as MemorySessionStorage, N as NodeEventEmitterStrategy, j as NodeUserAuthorization, k as NodeUserAuthorizationConfig, O as OwnerDelegationReceipt, P as PortableDelegation, m as RuntimePermissionGrantOptions, S as SecretPermissionHint, n as SecretReadInput, o as SecretReadResult, p as SignStrategy, T as TinyCloudNode, q as TinyCloudNodeConfig, U as UnifiedOwnerRootInput, r as UnifiedOwnerRootReceipt, s as UnsupportedSessionRestoreError, V as ValidatedRuntimeDelegation, W as WasmKeyProvider, t as WasmKeyProviderConfig, u as activateCompactRuntimeDelegation, w as createWasmKeyProvider, x as defaultSignStrategy, y as deserializeDelegation, G as serializeDelegation } from './core-
|
|
2
|
+
export { e as BootstrapWarning, C as CompactRuntimeDelegationInput, f as CreateOwnerDelegationParams, D as DelegateToOptions, g as DelegateToResult, h as DelegatedAccess, E as EnsureEncryptionNetworkOptions, F as FileSessionStorage, I as InvalidRestoredSessionError, M as MemorySessionStorage, N as NodeEventEmitterStrategy, j as NodeUserAuthorization, k as NodeUserAuthorizationConfig, O as OwnerDelegationReceipt, P as PortableDelegation, m as RuntimePermissionGrantOptions, S as SecretPermissionHint, n as SecretReadInput, o as SecretReadResult, p as SignStrategy, T as TinyCloudNode, q as TinyCloudNodeConfig, U as UnifiedOwnerRootInput, r as UnifiedOwnerRootReceipt, s as UnsupportedSessionRestoreError, V as ValidatedRuntimeDelegation, W as WasmKeyProvider, t as WasmKeyProviderConfig, u as activateCompactRuntimeDelegation, w as createWasmKeyProvider, x as defaultSignStrategy, y as deserializeDelegation, G as serializeDelegation } from './core-Bm76PnOz.js';
|
|
3
3
|
import 'events';
|
|
4
4
|
import '@tinycloud/sdk-services';
|
package/dist/core.js
CHANGED
|
@@ -726,21 +726,28 @@ var NodeUserAuthorization = class {
|
|
|
726
726
|
});
|
|
727
727
|
const signature = await this.signMessage(siwe, purpose);
|
|
728
728
|
const headers = this.wasm.siweToDelegationHeaders({ siwe, signature });
|
|
729
|
-
|
|
730
|
-
return result.success;
|
|
729
|
+
return submitHostDelegation(host, headers);
|
|
731
730
|
}
|
|
732
731
|
/**
|
|
733
732
|
* Create a specific space on the server via host delegation.
|
|
734
733
|
* Used for lazy creation of additional spaces (e.g., public).
|
|
735
734
|
*/
|
|
736
735
|
async hostPublicSpace(spaceId) {
|
|
737
|
-
return this.hostSpace(spaceId);
|
|
736
|
+
return (await this.hostSpace(spaceId)).success;
|
|
738
737
|
}
|
|
739
738
|
/**
|
|
740
739
|
* Create a specific owned space on the server via host delegation.
|
|
741
740
|
* Used by manifest registry setup for the account space.
|
|
742
741
|
*/
|
|
743
742
|
async hostOwnedSpace(spaceId, purpose) {
|
|
743
|
+
return (await this.hostOwnedSpaceResult(spaceId, purpose)).success;
|
|
744
|
+
}
|
|
745
|
+
/**
|
|
746
|
+
* {@link hostOwnedSpace} with the full host-delegation result, so a failure
|
|
747
|
+
* keeps its HTTP status (e.g. a typed 401/403) instead of collapsing to
|
|
748
|
+
* `false`.
|
|
749
|
+
*/
|
|
750
|
+
async hostOwnedSpaceResult(spaceId, purpose) {
|
|
744
751
|
return this.hostSpace(spaceId, purpose);
|
|
745
752
|
}
|
|
746
753
|
/**
|
|
@@ -783,7 +790,7 @@ var NodeUserAuthorization = class {
|
|
|
783
790
|
return;
|
|
784
791
|
}
|
|
785
792
|
try {
|
|
786
|
-
const created = await this.hostSpace();
|
|
793
|
+
const created = (await this.hostSpace()).success;
|
|
787
794
|
if (!created) {
|
|
788
795
|
const err = new Error(`Failed to create space: ${primarySpaceId}`);
|
|
789
796
|
handler.onSpaceCreationFailed?.(creationContext, err);
|
|
@@ -820,7 +827,7 @@ var NodeUserAuthorization = class {
|
|
|
820
827
|
return;
|
|
821
828
|
}
|
|
822
829
|
try {
|
|
823
|
-
const created = await this.hostSpace();
|
|
830
|
+
const created = (await this.hostSpace()).success;
|
|
824
831
|
if (!created) {
|
|
825
832
|
const err = new Error(`Failed to create space: ${primarySpaceId}`);
|
|
826
833
|
handler.onSpaceCreationFailed?.(creationContext, err);
|
|
@@ -1662,6 +1669,7 @@ var NodeUserAuthorization = class {
|
|
|
1662
1669
|
import {
|
|
1663
1670
|
TinyCloud,
|
|
1664
1671
|
activateSessionWithHost as activateSessionWithHost2,
|
|
1672
|
+
authorizationVerdictOf,
|
|
1665
1673
|
KVService as KVService2,
|
|
1666
1674
|
SQLService as SQLService2,
|
|
1667
1675
|
DuckDbService as DuckDbService2,
|
|
@@ -2400,6 +2408,10 @@ function persistedExpiry(value) {
|
|
|
2400
2408
|
function sameInstant(left, right) {
|
|
2401
2409
|
return left.getTime() === right.getTime();
|
|
2402
2410
|
}
|
|
2411
|
+
function describeHostFailure(result) {
|
|
2412
|
+
const text = result.error?.trim();
|
|
2413
|
+
return text ? `${result.status} - ${text}` : `${result.status}`;
|
|
2414
|
+
}
|
|
2403
2415
|
function ownerDelegationPermissions(params) {
|
|
2404
2416
|
const hasPermissions = Object.prototype.hasOwnProperty.call(params, "permissions");
|
|
2405
2417
|
const hasLegacy = Object.prototype.hasOwnProperty.call(params, "path") || Object.prototype.hasOwnProperty.call(params, "actions");
|
|
@@ -3513,8 +3525,9 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
3513
3525
|
await this.ensureOwnedSpaceHostedById(accountSpaceId);
|
|
3514
3526
|
const result = await this.account.applications.register(request.manifests);
|
|
3515
3527
|
if (!result.ok) {
|
|
3516
|
-
throw
|
|
3517
|
-
`Failed to write manifest registry records: ${result.error.message}`
|
|
3528
|
+
throw Object.assign(
|
|
3529
|
+
new Error(`Failed to write manifest registry records: ${result.error.message}`),
|
|
3530
|
+
{ cause: result.error }
|
|
3518
3531
|
);
|
|
3519
3532
|
}
|
|
3520
3533
|
}
|
|
@@ -3539,7 +3552,10 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
3539
3552
|
if (this.currentSessionCanListSpaces()) {
|
|
3540
3553
|
const spaces = await this.account.spaces.syncAccessible();
|
|
3541
3554
|
if (!spaces.ok) {
|
|
3542
|
-
throw
|
|
3555
|
+
throw Object.assign(
|
|
3556
|
+
new Error(`Failed to sync account spaces: ${spaces.error.message}`),
|
|
3557
|
+
{ cause: spaces.error }
|
|
3558
|
+
);
|
|
3543
3559
|
}
|
|
3544
3560
|
}
|
|
3545
3561
|
});
|
|
@@ -3594,8 +3610,10 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
3594
3610
|
await task();
|
|
3595
3611
|
return;
|
|
3596
3612
|
} catch (error) {
|
|
3613
|
+
const verdict = authorizationVerdictOf(error);
|
|
3597
3614
|
const message = error instanceof Error ? error.message : String(error);
|
|
3598
|
-
|
|
3615
|
+
const isAuthorizationVerdict = verdict === void 0 ? /Unauthorized Action|\b(?:401|403)\b/.test(message) : verdict !== "other";
|
|
3616
|
+
if (isAuthorizationVerdict) {
|
|
3599
3617
|
console.warn(
|
|
3600
3618
|
"TinyCloud account registry sync stopped: authorization verdict is not retryable",
|
|
3601
3619
|
error
|
|
@@ -3675,19 +3693,26 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
3675
3693
|
return;
|
|
3676
3694
|
}
|
|
3677
3695
|
if (!activation.success && activation.status !== 404) {
|
|
3678
|
-
throw
|
|
3679
|
-
`Failed to check owned space ${spaceId}: ${activation
|
|
3696
|
+
throw Object.assign(
|
|
3697
|
+
new Error(`Failed to check owned space ${spaceId}: ${describeHostFailure(activation)}`),
|
|
3698
|
+
{ cause: activation }
|
|
3680
3699
|
);
|
|
3681
3700
|
}
|
|
3682
|
-
const created = await this.auth.
|
|
3683
|
-
if (!created) {
|
|
3684
|
-
throw
|
|
3701
|
+
const created = await this.auth.hostOwnedSpaceResult(spaceId);
|
|
3702
|
+
if (!created.success) {
|
|
3703
|
+
throw Object.assign(
|
|
3704
|
+
new Error(`Failed to create owned space ${spaceId}: ${describeHostFailure(created)}`),
|
|
3705
|
+
{ cause: created }
|
|
3706
|
+
);
|
|
3685
3707
|
}
|
|
3686
3708
|
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
3687
3709
|
const retry = await activateSessionWithHost2(host, session.delegationHeader);
|
|
3688
3710
|
if (!retry.success || retry.skipped?.includes(spaceId)) {
|
|
3689
|
-
throw
|
|
3690
|
-
|
|
3711
|
+
throw Object.assign(
|
|
3712
|
+
new Error(
|
|
3713
|
+
`Failed to activate session after creating owned space ${spaceId}: ${retry.success ? "space was skipped" : describeHostFailure(retry)}`
|
|
3714
|
+
),
|
|
3715
|
+
{ cause: retry }
|
|
3691
3716
|
);
|
|
3692
3717
|
}
|
|
3693
3718
|
this.confirmedHostedSpaceIds.add(spaceId);
|
|
@@ -5235,7 +5260,10 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
5235
5260
|
const activation = await activateSessionWithHost2(host, delegationSession.delegationHeader);
|
|
5236
5261
|
assertOwnerGraphActive();
|
|
5237
5262
|
if (!activation.success) {
|
|
5238
|
-
throw
|
|
5263
|
+
throw Object.assign(
|
|
5264
|
+
new Error(`Owner delegation import failed: ${activation.status} ${activation.error ?? ""}`.trim()),
|
|
5265
|
+
{ cause: activation }
|
|
5266
|
+
);
|
|
5239
5267
|
}
|
|
5240
5268
|
const delegation = {
|
|
5241
5269
|
cid: delegationSession.delegationCid,
|