@tinycloud/node-sdk 3.1.0-beta.11 → 3.1.0-beta.12
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-CJiLya1s.d.cts → core-CMDgVfBj.d.cts} +1 -0
- package/dist/{core-CJiLya1s.d.ts → core-CMDgVfBj.d.ts} +1 -0
- package/dist/core.cjs +82 -30
- 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 +82 -30
- package/dist/core.js.map +1 -1
- package/dist/index.cjs +82 -30
- 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 +82 -30
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ISigner, Bytes, CapabilityPresentationEnvelopeV1, 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, 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, IUserAuthorization, IWasmBindings, IdentityParseError, IngestOptions, InlineEncryptedEnvelope, InvokeFunction, JWK, KVBatchReadResponse, KVCreateSignedReadUrlOptions, KVResponse, KVService, KVServiceConfig, KVSignedReadUrlResponse, KeyInfo, KeyProvider, KeyType, Manifest, ManifestDefaults, ManifestRegistryRecord, ManifestSecretActions, ManifestValidationError, NETWORK_NAME_PATTERN, NetworkDescriptor, NetworkIdError, NodeDescriptorFetcher, OpenKeyCallbackStrategy, OpenKeySigningRequestBody, OpenKeySigningResponseBody, OpenKeySigningStrategyOptions, OwnerDelegationPermission, ParsedNetworkId, ParsedSecretCatalogKey, PermissionEntry, PermissionNotInManifestError, PersistedSessionData, PkhDidParts, PrefixedKVService, ProtocolMismatchError, QueryOptions, QueryResponse, RandomReceiverKeyInput, ReceiveOptions, ReceiverKeyPair, ReceiverKeySigner, RegisterBatchSuccess, RegisterPolicyV3Input, RegisterPolicyV3Receipt, ResolvedCapabilities, ResolvedDelegate, ResolvedSecretPath, ResourceCapability, SECRET_NAME_RE, SQLAction, SQLActionType, SQLService, SQLServiceConfig, STORAGE_FULL_MESSAGE, STORAGE_WRITE_TOO_LARGE_MESSAGE, SchemaInfo, SecretCatalogEntry, SecretPayload, SecretScopeOptions, SecretsError, SecretsService, ServiceContext, ServiceContextConfig, ServiceSession, SessionExpiredError, ShareAccess, ShareLink, ShareLinkData, ShareSchema, SharingService, SharingServiceConfig, SignCallback, SignInOptions, SignRequest, SignResponse, SignedReceiverKeyInput, SilentNotificationHandler, Space, SpaceAbilitiesMap, SpaceConfig, SpaceCreationContext, SpaceErrorCode, SpaceErrorCodes, SpaceInfo, SpaceOwnership, SpaceService, SpaceServiceConfig, SqlStatement, SqlValue, StoredDelegationChain, SubscribeOptions, TableInfo, TelemetryConfig, TelemetryEventHandler, TinyCloud, TinyCloudConfig, 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, 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, tinyCloudDebugLogger, validateEnvelope, validateManifest, verifyDecryptResponse } from '@tinycloud/sdk-core';
|
|
3
|
-
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, F as FileSessionStorage, I as InvalidRestoredSessionError, M as MemorySessionStorage, N as NodeEventEmitterStrategy, j as NodeUserAuthorization, k as NodeUserAuthorizationConfig, O as OwnerDelegationReceipt, P as PortableDelegation, R as RUNTIME_DELEGATION_REJECTIONS, l as RestorableSession, m as RuntimeDelegationActivator, n as RuntimeDelegationRejectedError, o as RuntimeDelegationRejection, p as RuntimePermissionGrantOptions, S as SecretPermissionHint, q as SecretReadInput, r as SecretReadResult, s as SessionGrantProof, t as SignStrategy, T as TinyCloudNode, u as TinyCloudNodeConfig, U as UnifiedOwnerRootInput, v as UnifiedOwnerRootReceipt, w as UnsupportedSessionRestoreError, V as ValidatedRuntimeDelegation, x as VerifiedSessionGrant, W as WasmKeyProvider, y as WasmKeyProviderConfig, z as activateCompactRuntimeDelegation, G as activateValidatedRuntimeDelegation, H as createWasmKeyProvider, J as defaultSignStrategy, K as deserializeDelegation, L as grantAuthRequest, Q as serializeDelegation } from './core-
|
|
3
|
+
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, F as FileSessionStorage, I as InvalidRestoredSessionError, M as MemorySessionStorage, N as NodeEventEmitterStrategy, j as NodeUserAuthorization, k as NodeUserAuthorizationConfig, O as OwnerDelegationReceipt, P as PortableDelegation, R as RUNTIME_DELEGATION_REJECTIONS, l as RestorableSession, m as RuntimeDelegationActivator, n as RuntimeDelegationRejectedError, o as RuntimeDelegationRejection, p as RuntimePermissionGrantOptions, S as SecretPermissionHint, q as SecretReadInput, r as SecretReadResult, s as SessionGrantProof, t as SignStrategy, T as TinyCloudNode, u as TinyCloudNodeConfig, U as UnifiedOwnerRootInput, v as UnifiedOwnerRootReceipt, w as UnsupportedSessionRestoreError, V as ValidatedRuntimeDelegation, x as VerifiedSessionGrant, W as WasmKeyProvider, y as WasmKeyProviderConfig, z as activateCompactRuntimeDelegation, G as activateValidatedRuntimeDelegation, H as createWasmKeyProvider, J as defaultSignStrategy, K as deserializeDelegation, L as grantAuthRequest, Q as serializeDelegation } from './core-CMDgVfBj.cjs';
|
|
4
4
|
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';
|
|
5
5
|
import 'events';
|
|
6
6
|
import '@tinycloud/sdk-services';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ISigner, Bytes, CapabilityPresentationEnvelopeV1, 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, 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, IUserAuthorization, IWasmBindings, IdentityParseError, IngestOptions, InlineEncryptedEnvelope, InvokeFunction, JWK, KVBatchReadResponse, KVCreateSignedReadUrlOptions, KVResponse, KVService, KVServiceConfig, KVSignedReadUrlResponse, KeyInfo, KeyProvider, KeyType, Manifest, ManifestDefaults, ManifestRegistryRecord, ManifestSecretActions, ManifestValidationError, NETWORK_NAME_PATTERN, NetworkDescriptor, NetworkIdError, NodeDescriptorFetcher, OpenKeyCallbackStrategy, OpenKeySigningRequestBody, OpenKeySigningResponseBody, OpenKeySigningStrategyOptions, OwnerDelegationPermission, ParsedNetworkId, ParsedSecretCatalogKey, PermissionEntry, PermissionNotInManifestError, PersistedSessionData, PkhDidParts, PrefixedKVService, ProtocolMismatchError, QueryOptions, QueryResponse, RandomReceiverKeyInput, ReceiveOptions, ReceiverKeyPair, ReceiverKeySigner, RegisterBatchSuccess, RegisterPolicyV3Input, RegisterPolicyV3Receipt, ResolvedCapabilities, ResolvedDelegate, ResolvedSecretPath, ResourceCapability, SECRET_NAME_RE, SQLAction, SQLActionType, SQLService, SQLServiceConfig, STORAGE_FULL_MESSAGE, STORAGE_WRITE_TOO_LARGE_MESSAGE, SchemaInfo, SecretCatalogEntry, SecretPayload, SecretScopeOptions, SecretsError, SecretsService, ServiceContext, ServiceContextConfig, ServiceSession, SessionExpiredError, ShareAccess, ShareLink, ShareLinkData, ShareSchema, SharingService, SharingServiceConfig, SignCallback, SignInOptions, SignRequest, SignResponse, SignedReceiverKeyInput, SilentNotificationHandler, Space, SpaceAbilitiesMap, SpaceConfig, SpaceCreationContext, SpaceErrorCode, SpaceErrorCodes, SpaceInfo, SpaceOwnership, SpaceService, SpaceServiceConfig, SqlStatement, SqlValue, StoredDelegationChain, SubscribeOptions, TableInfo, TelemetryConfig, TelemetryEventHandler, TinyCloud, TinyCloudConfig, 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, 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, tinyCloudDebugLogger, validateEnvelope, validateManifest, verifyDecryptResponse } from '@tinycloud/sdk-core';
|
|
3
|
-
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, F as FileSessionStorage, I as InvalidRestoredSessionError, M as MemorySessionStorage, N as NodeEventEmitterStrategy, j as NodeUserAuthorization, k as NodeUserAuthorizationConfig, O as OwnerDelegationReceipt, P as PortableDelegation, R as RUNTIME_DELEGATION_REJECTIONS, l as RestorableSession, m as RuntimeDelegationActivator, n as RuntimeDelegationRejectedError, o as RuntimeDelegationRejection, p as RuntimePermissionGrantOptions, S as SecretPermissionHint, q as SecretReadInput, r as SecretReadResult, s as SessionGrantProof, t as SignStrategy, T as TinyCloudNode, u as TinyCloudNodeConfig, U as UnifiedOwnerRootInput, v as UnifiedOwnerRootReceipt, w as UnsupportedSessionRestoreError, V as ValidatedRuntimeDelegation, x as VerifiedSessionGrant, W as WasmKeyProvider, y as WasmKeyProviderConfig, z as activateCompactRuntimeDelegation, G as activateValidatedRuntimeDelegation, H as createWasmKeyProvider, J as defaultSignStrategy, K as deserializeDelegation, L as grantAuthRequest, Q as serializeDelegation } from './core-
|
|
3
|
+
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, F as FileSessionStorage, I as InvalidRestoredSessionError, M as MemorySessionStorage, N as NodeEventEmitterStrategy, j as NodeUserAuthorization, k as NodeUserAuthorizationConfig, O as OwnerDelegationReceipt, P as PortableDelegation, R as RUNTIME_DELEGATION_REJECTIONS, l as RestorableSession, m as RuntimeDelegationActivator, n as RuntimeDelegationRejectedError, o as RuntimeDelegationRejection, p as RuntimePermissionGrantOptions, S as SecretPermissionHint, q as SecretReadInput, r as SecretReadResult, s as SessionGrantProof, t as SignStrategy, T as TinyCloudNode, u as TinyCloudNodeConfig, U as UnifiedOwnerRootInput, v as UnifiedOwnerRootReceipt, w as UnsupportedSessionRestoreError, V as ValidatedRuntimeDelegation, x as VerifiedSessionGrant, W as WasmKeyProvider, y as WasmKeyProviderConfig, z as activateCompactRuntimeDelegation, G as activateValidatedRuntimeDelegation, H as createWasmKeyProvider, J as defaultSignStrategy, K as deserializeDelegation, L as grantAuthRequest, Q as serializeDelegation } from './core-CMDgVfBj.js';
|
|
4
4
|
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';
|
|
5
5
|
import 'events';
|
|
6
6
|
import '@tinycloud/sdk-services';
|
package/dist/index.js
CHANGED
|
@@ -19722,15 +19722,21 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
19722
19722
|
if (!this.wasmBindings.invokeAny) {
|
|
19723
19723
|
throw new Error("WASM binding does not support invokeAny");
|
|
19724
19724
|
}
|
|
19725
|
-
const
|
|
19725
|
+
const routedEntries = entries;
|
|
19726
|
+
const operations = routedEntries.flatMap((entry) => {
|
|
19726
19727
|
const operation = this.operationFromInvokeAnyEntry(entry);
|
|
19727
19728
|
return operation ? [operation] : [];
|
|
19728
19729
|
});
|
|
19729
|
-
const
|
|
19730
|
-
const
|
|
19731
|
-
|
|
19730
|
+
const authorityCid = routedEntries.length === 1 ? routedEntries[0]?.revokeAuthorityCid : void 0;
|
|
19731
|
+
const explicitGrant = authorityCid === void 0 ? void 0 : this.runtimePermissionGrants.find((grant2) => grant2.delegation.cid === authorityCid);
|
|
19732
|
+
if (authorityCid !== void 0 && !explicitGrant) {
|
|
19733
|
+
throw new Error(`Explicit revocation authority ${authorityCid} is not installed.`);
|
|
19734
|
+
}
|
|
19735
|
+
const grant = explicitGrant ?? this.findGrantForOperations(operations);
|
|
19736
|
+
const invocationSession = explicitGrant ? explicitGrant.session : !grant || grant.provenance === "primary" ? session : grant.session;
|
|
19737
|
+
const caveatPreservingEntries = routedEntries.map(({ revokeAuthorityCid: _cid, ...entry }) => {
|
|
19732
19738
|
const requested = this.operationFromInvokeAnyEntry(entry);
|
|
19733
|
-
const granted = requested && grant.operations.find(
|
|
19739
|
+
const granted = grant && requested && grant.operations.find(
|
|
19734
19740
|
(candidate) => this.operationCovers(candidate, requested)
|
|
19735
19741
|
);
|
|
19736
19742
|
if (!granted?.caveats?.length) {
|
|
@@ -19740,7 +19746,7 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
19740
19746
|
throw new Error("Invocation caveats do not match signed ReCap authority.");
|
|
19741
19747
|
}
|
|
19742
19748
|
return { ...entry, caveats: cloneRecapCaveats(granted.caveats) };
|
|
19743
|
-
})
|
|
19749
|
+
});
|
|
19744
19750
|
return this.wasmBindings.invokeAny(invocationSession, caveatPreservingEntries, facts);
|
|
19745
19751
|
};
|
|
19746
19752
|
this.explicitHost = config.host;
|
|
@@ -21086,6 +21092,7 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
21086
21092
|
stagedSessionExpiry,
|
|
21087
21093
|
stagedRecap
|
|
21088
21094
|
);
|
|
21095
|
+
const stagedAccountSpaceId = stagedAddress ? this.wasmBindings.makeSpaceId(stagedAddress, stagedChainId, ACCOUNT_REGISTRY_SPACE2) : void 0;
|
|
21089
21096
|
const stagedGraph = this.stageRestoredServiceGraph({
|
|
21090
21097
|
host: stagedHost,
|
|
21091
21098
|
manager: stagedManager,
|
|
@@ -21094,6 +21101,7 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
21094
21101
|
nodeDid: stagedNodeDid,
|
|
21095
21102
|
address: stagedAddress,
|
|
21096
21103
|
chainId: stagedChainId,
|
|
21104
|
+
accountSpaceId: stagedAccountSpaceId,
|
|
21097
21105
|
tinyCloudSession: stagedTcSession,
|
|
21098
21106
|
sessionExpiry: stagedSessionExpiry,
|
|
21099
21107
|
recap: stagedRecap
|
|
@@ -21259,6 +21267,7 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
21259
21267
|
}
|
|
21260
21268
|
const delegationManager = new DelegationManager({
|
|
21261
21269
|
hosts: [input.host],
|
|
21270
|
+
accountSpaceId: input.accountSpaceId,
|
|
21262
21271
|
session: input.serviceSession,
|
|
21263
21272
|
invoke: graph.invoke,
|
|
21264
21273
|
invokeAny: graph.invokeAny,
|
|
@@ -22963,6 +22972,14 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
22963
22972
|
delegation.delegationHeader
|
|
22964
22973
|
);
|
|
22965
22974
|
if (!activateResult.success) {
|
|
22975
|
+
if (this.operationsFromDelegation(delegation).some(
|
|
22976
|
+
(operation) => operation.resource?.startsWith("urn:cid:") === true && operation.service === "delegation" && operation.action === "tinycloud.delegation/revoke"
|
|
22977
|
+
) && activateResult.status === 401 && /Cannot find parent delegation/i.test(activateResult.error ?? "")) {
|
|
22978
|
+
throw Object.assign(
|
|
22979
|
+
new Error("The host cannot activate a root raw-CID revoke authority without a parent delegation."),
|
|
22980
|
+
{ code: "RAW_RECAP_RESOURCE_UNSUPPORTED", cause: activateResult }
|
|
22981
|
+
);
|
|
22982
|
+
}
|
|
22966
22983
|
throw Object.assign(
|
|
22967
22984
|
new Error(`Failed to activate runtime permission delegation: ${describeHostFailure2(activateResult)}`),
|
|
22968
22985
|
{ cause: activateResult }
|
|
@@ -23010,10 +23027,10 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
23010
23027
|
}
|
|
23011
23028
|
this.assertDelegationCaveatsPreservable(expanded);
|
|
23012
23029
|
const rawEntries = expanded.filter(
|
|
23013
|
-
(entry) => this.isEncryptionPermissionEntry(entry)
|
|
23030
|
+
(entry) => this.isEncryptionPermissionEntry(entry) || this.isRawRevocationPermissionEntry(entry)
|
|
23014
23031
|
);
|
|
23015
23032
|
const spaceEntries = expanded.filter(
|
|
23016
|
-
(entry) => !this.isEncryptionPermissionEntry(entry)
|
|
23033
|
+
(entry) => !this.isEncryptionPermissionEntry(entry) && !this.isRawRevocationPermissionEntry(entry)
|
|
23017
23034
|
);
|
|
23018
23035
|
const bySpace = /* @__PURE__ */ new Map();
|
|
23019
23036
|
for (const entry of spaceEntries) {
|
|
@@ -23040,17 +23057,29 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
23040
23057
|
}
|
|
23041
23058
|
const delegatedEntries = [...entries, ...rawForDelegation];
|
|
23042
23059
|
const abilities = this.permissionsToAbilities(entries);
|
|
23043
|
-
const prepared =
|
|
23044
|
-
|
|
23045
|
-
|
|
23046
|
-
|
|
23047
|
-
|
|
23048
|
-
|
|
23049
|
-
|
|
23050
|
-
|
|
23051
|
-
|
|
23052
|
-
|
|
23053
|
-
|
|
23060
|
+
const prepared = (() => {
|
|
23061
|
+
try {
|
|
23062
|
+
return this.wasmBindings.prepareSession({
|
|
23063
|
+
abilities,
|
|
23064
|
+
...rawForDelegation.length > 0 ? { rawAbilities: this.permissionsToRawAbilities(rawForDelegation) } : {},
|
|
23065
|
+
address: this.wasmBindings.ensureEip55(session.address),
|
|
23066
|
+
chainId: session.chainId,
|
|
23067
|
+
domain: this.siweDomain,
|
|
23068
|
+
issuedAt: now.toISOString(),
|
|
23069
|
+
expirationTime: expiresAt.toISOString(),
|
|
23070
|
+
spaceId,
|
|
23071
|
+
jwk: session.jwk
|
|
23072
|
+
});
|
|
23073
|
+
} catch (error) {
|
|
23074
|
+
if (rawForDelegation.some((entry) => this.isRawRevocationPermissionEntry(entry)) && /invalid ReCap resource URI/i.test(error instanceof Error ? error.message : String(error))) {
|
|
23075
|
+
throw Object.assign(
|
|
23076
|
+
new Error("This WASM build cannot encode raw urn:cid ReCap resources."),
|
|
23077
|
+
{ code: "RAW_RECAP_RESOURCE_UNSUPPORTED", cause: error }
|
|
23078
|
+
);
|
|
23079
|
+
}
|
|
23080
|
+
throw error;
|
|
23081
|
+
}
|
|
23082
|
+
})();
|
|
23054
23083
|
const signature2 = await this.signer.signMessage(prepared.siwe);
|
|
23055
23084
|
const delegatedSession = this.wasmBindings.completeSessionSetup({
|
|
23056
23085
|
...prepared,
|
|
@@ -23061,6 +23090,12 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
23061
23090
|
delegatedSession.delegationHeader
|
|
23062
23091
|
);
|
|
23063
23092
|
if (!activateResult.success) {
|
|
23093
|
+
if (rawForDelegation.some((entry) => this.isRawRevocationPermissionEntry(entry)) && activateResult.status === 401 && /Cannot find parent delegation/i.test(activateResult.error ?? "")) {
|
|
23094
|
+
throw Object.assign(
|
|
23095
|
+
new Error("The host cannot activate a root raw-CID revoke authority without a parent delegation."),
|
|
23096
|
+
{ code: "RAW_RECAP_RESOURCE_UNSUPPORTED", cause: activateResult }
|
|
23097
|
+
);
|
|
23098
|
+
}
|
|
23064
23099
|
throw Object.assign(
|
|
23065
23100
|
new Error(`Failed to activate runtime permission delegation: ${describeHostFailure2(activateResult)}`),
|
|
23066
23101
|
{ cause: activateResult }
|
|
@@ -23762,6 +23797,7 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
23762
23797
|
permissionsToAbilities(entries) {
|
|
23763
23798
|
const abilities = {};
|
|
23764
23799
|
for (const entry of entries) {
|
|
23800
|
+
if (this.isRawRevocationPermissionEntry(entry)) continue;
|
|
23765
23801
|
const service = this.shortServiceName(entry.service);
|
|
23766
23802
|
abilities[service] ?? (abilities[service] = {});
|
|
23767
23803
|
const existing = abilities[service][entry.path] ?? [];
|
|
@@ -23779,9 +23815,16 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
23779
23815
|
isEncryptionPermissionEntry(entry) {
|
|
23780
23816
|
return entry.service === ENCRYPTION_PERMISSION_SERVICE2 && this.isEncryptionNetworkOperation("encryption", entry.path, entry.space);
|
|
23781
23817
|
}
|
|
23818
|
+
isRawRevocationPermissionEntry(entry) {
|
|
23819
|
+
return entry.service === "tinycloud.delegation" && entry.path === "" && entry.space?.startsWith("urn:cid:") === true && entry.actions.includes("tinycloud.delegation/revoke");
|
|
23820
|
+
}
|
|
23782
23821
|
permissionsToRawAbilities(entries) {
|
|
23783
23822
|
const rawAbilities = {};
|
|
23784
23823
|
for (const entry of entries) {
|
|
23824
|
+
if (this.isRawRevocationPermissionEntry(entry)) {
|
|
23825
|
+
rawAbilities[entry.space] = [...new Set(entry.actions)];
|
|
23826
|
+
continue;
|
|
23827
|
+
}
|
|
23785
23828
|
if (!this.isEncryptionPermissionEntry(entry)) {
|
|
23786
23829
|
continue;
|
|
23787
23830
|
}
|
|
@@ -23801,7 +23844,7 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
23801
23844
|
return entries.flatMap((entry) => {
|
|
23802
23845
|
const service = this.shortServiceName(entry.service);
|
|
23803
23846
|
return entry.actions.map((action) => ({
|
|
23804
|
-
...this.isEncryptionNetworkOperation(service, entry.path, entry.space) ? { resource: entry.path } : { spaceId },
|
|
23847
|
+
...this.isRawRevocationPermissionEntry(entry) ? { resource: entry.space } : this.isEncryptionNetworkOperation(service, entry.path, entry.space) ? { resource: entry.path } : { spaceId },
|
|
23805
23848
|
service,
|
|
23806
23849
|
path: entry.path,
|
|
23807
23850
|
action,
|
|
@@ -23811,11 +23854,13 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
23811
23854
|
}
|
|
23812
23855
|
/** Raw network authority cannot be covered by a nested encryption space. */
|
|
23813
23856
|
signedCapabilitySubset(requested, granted) {
|
|
23814
|
-
const rawGranted = granted.filter((entry) => this.isEncryptionPermissionEntry(entry)).map((entry) => ({ ...entry, space: "encryption" })
|
|
23815
|
-
const spaceGranted = granted.filter(
|
|
23857
|
+
const rawGranted = granted.filter((entry) => this.isEncryptionPermissionEntry(entry) || this.isRawRevocationPermissionEntry(entry)).map((entry) => this.isEncryptionPermissionEntry(entry) ? { ...entry, space: "encryption" } : entry);
|
|
23858
|
+
const spaceGranted = granted.filter(
|
|
23859
|
+
(entry) => !this.isEncryptionPermissionEntry(entry) && !this.isRawRevocationPermissionEntry(entry)
|
|
23860
|
+
);
|
|
23816
23861
|
const missing = requested.filter((entry) => {
|
|
23817
|
-
const raw = this.isEncryptionPermissionEntry(entry);
|
|
23818
|
-
const comparable = raw ? { ...entry, space: "encryption" } : entry;
|
|
23862
|
+
const raw = this.isEncryptionPermissionEntry(entry) || this.isRawRevocationPermissionEntry(entry);
|
|
23863
|
+
const comparable = raw && this.isEncryptionPermissionEntry(entry) ? { ...entry, space: "encryption" } : entry;
|
|
23819
23864
|
return !isCapabilitySubset([comparable], raw ? rawGranted : spaceGranted).subset;
|
|
23820
23865
|
});
|
|
23821
23866
|
return { subset: missing.length === 0, missing };
|
|
@@ -23830,10 +23875,11 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
23830
23875
|
}
|
|
23831
23876
|
permissionEntriesToOperations(entries, session) {
|
|
23832
23877
|
return entries.flatMap((entry) => {
|
|
23833
|
-
const
|
|
23878
|
+
const rawRevocation = this.isRawRevocationPermissionEntry(entry);
|
|
23879
|
+
const spaceId = rawRevocation ? void 0 : this.resolvePermissionSpace(entry.space, session);
|
|
23834
23880
|
const service = this.shortServiceName(entry.service);
|
|
23835
23881
|
return entry.actions.map((action) => ({
|
|
23836
|
-
...this.isEncryptionNetworkOperation(service, entry.path, entry.space) ? { resource: entry.path } : { spaceId },
|
|
23882
|
+
...rawRevocation ? { resource: entry.space } : this.isEncryptionNetworkOperation(service, entry.path, entry.space) ? { resource: entry.path } : { spaceId },
|
|
23837
23883
|
service,
|
|
23838
23884
|
path: entry.path,
|
|
23839
23885
|
action,
|
|
@@ -23912,7 +23958,7 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
23912
23958
|
delegatedResourcesForEntries(entries, spaceId) {
|
|
23913
23959
|
return entries.map((entry) => ({
|
|
23914
23960
|
service: this.shortServiceName(entry.service),
|
|
23915
|
-
space: this.isEncryptionPermissionEntry(entry) ? "encryption" : spaceId,
|
|
23961
|
+
space: this.isRawRevocationPermissionEntry(entry) ? entry.space : this.isEncryptionPermissionEntry(entry) ? "encryption" : spaceId,
|
|
23916
23962
|
path: entry.path,
|
|
23917
23963
|
actions: [...entry.actions],
|
|
23918
23964
|
...entry.caveats === void 0 ? {} : { caveats: cloneRecapCaveats(entry.caveats) }
|
|
@@ -23922,8 +23968,9 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
23922
23968
|
const resources = delegation.resources !== void 0 && delegation.resources.length > 0 ? delegation.resources : this.flatDelegationResources(delegation);
|
|
23923
23969
|
return resources.flatMap((resource) => {
|
|
23924
23970
|
const service = this.invocationServiceName(resource.service);
|
|
23971
|
+
const rawRevocation = service === "delegation" && resource.space.startsWith("urn:cid:") && resource.path === "";
|
|
23925
23972
|
return resource.actions.map((action) => ({
|
|
23926
|
-
...this.isEncryptionNetworkOperation(service, resource.path, resource.space) ? { resource: resource.path } : { spaceId: resource.space },
|
|
23973
|
+
...rawRevocation ? { resource: resource.space } : this.isEncryptionNetworkOperation(service, resource.path, resource.space) ? { resource: resource.path } : { spaceId: resource.space },
|
|
23927
23974
|
service,
|
|
23928
23975
|
path: resource.path,
|
|
23929
23976
|
action,
|
|
@@ -23969,7 +24016,7 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
23969
24016
|
* @internal
|
|
23970
24017
|
*/
|
|
23971
24018
|
buildActivationAbilities(delegation) {
|
|
23972
|
-
var _a, _b, _c;
|
|
24019
|
+
var _a, _b, _c, _d;
|
|
23973
24020
|
const resources = delegation.resources !== void 0 && delegation.resources.length > 0 ? delegation.resources : this.flatDelegationResources(delegation);
|
|
23974
24021
|
const abilities = {};
|
|
23975
24022
|
const rawAbilities = {};
|
|
@@ -23989,13 +24036,18 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
23989
24036
|
addActions(rawAbilities[resource.path], resource.actions);
|
|
23990
24037
|
continue;
|
|
23991
24038
|
}
|
|
24039
|
+
if (service === "delegation" && resource.space.startsWith("urn:cid:") && resource.path === "") {
|
|
24040
|
+
rawAbilities[_b = resource.space] ?? (rawAbilities[_b] = []);
|
|
24041
|
+
addActions(rawAbilities[resource.space], resource.actions);
|
|
24042
|
+
continue;
|
|
24043
|
+
}
|
|
23992
24044
|
if (resource.space !== delegation.spaceId) {
|
|
23993
24045
|
throw new Error(
|
|
23994
24046
|
`useDelegation: resource targets space '${resource.space}' but the delegation activates space '${delegation.spaceId}'. Multi-space delegations cannot be activated in a single useDelegation call.`
|
|
23995
24047
|
);
|
|
23996
24048
|
}
|
|
23997
24049
|
abilities[service] ?? (abilities[service] = {});
|
|
23998
|
-
(
|
|
24050
|
+
(_c = abilities[service])[_d = resource.path] ?? (_c[_d] = []);
|
|
23999
24051
|
addActions(abilities[service][resource.path], resource.actions);
|
|
24000
24052
|
}
|
|
24001
24053
|
return { abilities, rawAbilities };
|