@tinycloud/node-sdk 2.3.0-beta.7 → 2.3.0
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-CNyXnUx9.d.cts → core-BdlIWB-K.d.cts} +19 -2
- package/dist/{core-CNyXnUx9.d.ts → core-BdlIWB-K.d.ts} +19 -2
- package/dist/core.cjs +66 -14
- 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 +66 -14
- package/dist/core.js.map +1 -1
- package/dist/index.cjs +66 -14
- 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 +66 -14
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/core.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, AutoApproveSpaceCreationHandler, AutoRejectStrategy, AutoSignStrategy, BatchOptions, BatchResponse, CallbackStrategy, CanonicalAddress, CanonicalParsedNetworkId, CapabilityEntry, CapabilityKeyRegistry, CapabilityKeyRegistryErrorCode, CapabilityKeyRegistryErrorCodes, ClientSession, ColumnInfo, ComposeManifestOptions, ComposedManifestRequest, CreateDelegationParams, DEFAULT_MANIFEST_SPACE, DEFAULT_MANIFEST_VERSION, DEFAULT_SIGNED_READ_URL_EXPIRY_MS, DataVaultConfig, DataVaultService, DatabaseHandle, 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, KVCreateSignedReadUrlOptions, KVResponse, KVService, KVServiceConfig, KVSignedReadUrlResponse, KeyInfo, KeyProvider, KeyType, Manifest, ManifestDefaults, ManifestRegistryRecord, ManifestSecretActions, ManifestValidationError, PermissionEntry, PermissionNotInManifestError, PersistedSessionData, PkhDidParts, PrefixedKVService, ProtocolMismatchError, QueryOptions, QueryResponse, ReceiveOptions, 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, TinyCloud, TinyCloudConfig, TinyCloudSession, UnsupportedFeatureError, VAULT_PERMISSION_SERVICE, VaultCrypto, VaultEntry, VaultError, VaultGetOptions, VaultGrantOptions, VaultHeaders, VaultListOptions, VaultPublicSpaceKVActions, VaultPutOptions, VersionCheckError, ViewInfo, WasmVaultFunctions, addressStorageKey, buildSpaceUri, canonicalizeAddress, canonicalizeDid, canonicalizeDidUrl, canonicalizeNetworkId, canonicalizeSecretScope, checkNodeInfo, composeManifestRequest, createCapabilityKeyRegistry, createSharingService, createSpaceService, createVaultCrypto, defaultSpaceCreationHandler, didCacheKey, didEquals, expandActionShortNames, expandPermissionEntries, expandPermissionEntry, isCapabilitySubset, isEvmAddress, loadManifest, makePkhSpaceId, makePublicSpaceId, parseCanonicalNetworkId, parseExpiry, parsePkhDid, parseSpaceUri, pkhDid, principalDid, principalDidEquals, resolveManifest, resolveSecretListPrefix, resolveSecretPath, resourceCapabilitiesToSpaceAbilitiesMap, validateManifest } from '@tinycloud/sdk-core';
|
|
2
|
-
export { D as DelegateToOptions, a as DelegateToResult, b as DelegatedAccess, F as FileSessionStorage, M as MemorySessionStorage, N as NodeEventEmitterStrategy, c as NodeUserAuthorization, d as NodeUserAuthorizationConfig, P as PortableDelegation, e as RuntimePermissionGrantOptions, S as SignStrategy, T as TinyCloudNode, f as TinyCloudNodeConfig, W as WasmKeyProvider, g as WasmKeyProviderConfig, h as createWasmKeyProvider, i as defaultSignStrategy, j as deserializeDelegation, s as serializeDelegation } from './core-
|
|
1
|
+
export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, AutoApproveSpaceCreationHandler, AutoRejectStrategy, AutoSignStrategy, BatchOptions, BatchResponse, CallbackStrategy, CanonicalAddress, CanonicalParsedNetworkId, CapabilityEntry, CapabilityKeyRegistry, CapabilityKeyRegistryErrorCode, CapabilityKeyRegistryErrorCodes, ClientSession, ColumnInfo, ComposeManifestOptions, ComposedManifestRequest, CreateDelegationParams, DEFAULT_MANIFEST_SPACE, DEFAULT_MANIFEST_VERSION, DEFAULT_SIGNED_READ_URL_EXPIRY_MS, DataVaultConfig, DataVaultService, DatabaseHandle, 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, KVCreateSignedReadUrlOptions, KVResponse, KVService, KVServiceConfig, KVSignedReadUrlResponse, KeyInfo, KeyProvider, KeyType, Manifest, ManifestDefaults, ManifestRegistryRecord, ManifestSecretActions, ManifestValidationError, PermissionEntry, PermissionNotInManifestError, PersistedSessionData, PkhDidParts, PrefixedKVService, ProtocolMismatchError, QueryOptions, QueryResponse, ReceiveOptions, 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, TinyCloudSession, UnsupportedFeatureError, VAULT_PERMISSION_SERVICE, VaultCrypto, VaultEntry, VaultError, VaultGetOptions, VaultGrantOptions, VaultHeaders, VaultListOptions, VaultPublicSpaceKVActions, VaultPutOptions, VersionCheckError, ViewInfo, WasmVaultFunctions, addressStorageKey, buildSpaceUri, canonicalizeAddress, canonicalizeDid, canonicalizeDidUrl, canonicalizeNetworkId, canonicalizeSecretScope, checkNodeInfo, composeManifestRequest, createCapabilityKeyRegistry, createSharingService, createSpaceService, createVaultCrypto, defaultSpaceCreationHandler, didCacheKey, didEquals, expandActionShortNames, expandPermissionEntries, expandPermissionEntry, isCapabilitySubset, isEvmAddress, loadManifest, makePkhSpaceId, makePublicSpaceId, parseCanonicalNetworkId, parseExpiry, parsePkhDid, parseSpaceUri, pkhDid, principalDid, principalDidEquals, resolveManifest, resolveSecretListPrefix, resolveSecretPath, resourceCapabilitiesToSpaceAbilitiesMap, validateManifest } from '@tinycloud/sdk-core';
|
|
2
|
+
export { D as DelegateToOptions, a as DelegateToResult, b as DelegatedAccess, F as FileSessionStorage, M as MemorySessionStorage, N as NodeEventEmitterStrategy, c as NodeUserAuthorization, d as NodeUserAuthorizationConfig, P as PortableDelegation, e as RuntimePermissionGrantOptions, S as SignStrategy, T as TinyCloudNode, f as TinyCloudNodeConfig, W as WasmKeyProvider, g as WasmKeyProviderConfig, h as createWasmKeyProvider, i as defaultSignStrategy, j as deserializeDelegation, s as serializeDelegation } from './core-BdlIWB-K.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, AutoApproveSpaceCreationHandler, AutoRejectStrategy, AutoSignStrategy, BatchOptions, BatchResponse, CallbackStrategy, CanonicalAddress, CanonicalParsedNetworkId, CapabilityEntry, CapabilityKeyRegistry, CapabilityKeyRegistryErrorCode, CapabilityKeyRegistryErrorCodes, ClientSession, ColumnInfo, ComposeManifestOptions, ComposedManifestRequest, CreateDelegationParams, DEFAULT_MANIFEST_SPACE, DEFAULT_MANIFEST_VERSION, DEFAULT_SIGNED_READ_URL_EXPIRY_MS, DataVaultConfig, DataVaultService, DatabaseHandle, 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, KVCreateSignedReadUrlOptions, KVResponse, KVService, KVServiceConfig, KVSignedReadUrlResponse, KeyInfo, KeyProvider, KeyType, Manifest, ManifestDefaults, ManifestRegistryRecord, ManifestSecretActions, ManifestValidationError, PermissionEntry, PermissionNotInManifestError, PersistedSessionData, PkhDidParts, PrefixedKVService, ProtocolMismatchError, QueryOptions, QueryResponse, ReceiveOptions, 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, TinyCloud, TinyCloudConfig, TinyCloudSession, UnsupportedFeatureError, VAULT_PERMISSION_SERVICE, VaultCrypto, VaultEntry, VaultError, VaultGetOptions, VaultGrantOptions, VaultHeaders, VaultListOptions, VaultPublicSpaceKVActions, VaultPutOptions, VersionCheckError, ViewInfo, WasmVaultFunctions, addressStorageKey, buildSpaceUri, canonicalizeAddress, canonicalizeDid, canonicalizeDidUrl, canonicalizeNetworkId, canonicalizeSecretScope, checkNodeInfo, composeManifestRequest, createCapabilityKeyRegistry, createSharingService, createSpaceService, createVaultCrypto, defaultSpaceCreationHandler, didCacheKey, didEquals, expandActionShortNames, expandPermissionEntries, expandPermissionEntry, isCapabilitySubset, isEvmAddress, loadManifest, makePkhSpaceId, makePublicSpaceId, parseCanonicalNetworkId, parseExpiry, parsePkhDid, parseSpaceUri, pkhDid, principalDid, principalDidEquals, resolveManifest, resolveSecretListPrefix, resolveSecretPath, resourceCapabilitiesToSpaceAbilitiesMap, validateManifest } from '@tinycloud/sdk-core';
|
|
2
|
-
export { D as DelegateToOptions, a as DelegateToResult, b as DelegatedAccess, F as FileSessionStorage, M as MemorySessionStorage, N as NodeEventEmitterStrategy, c as NodeUserAuthorization, d as NodeUserAuthorizationConfig, P as PortableDelegation, e as RuntimePermissionGrantOptions, S as SignStrategy, T as TinyCloudNode, f as TinyCloudNodeConfig, W as WasmKeyProvider, g as WasmKeyProviderConfig, h as createWasmKeyProvider, i as defaultSignStrategy, j as deserializeDelegation, s as serializeDelegation } from './core-
|
|
1
|
+
export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, AutoApproveSpaceCreationHandler, AutoRejectStrategy, AutoSignStrategy, BatchOptions, BatchResponse, CallbackStrategy, CanonicalAddress, CanonicalParsedNetworkId, CapabilityEntry, CapabilityKeyRegistry, CapabilityKeyRegistryErrorCode, CapabilityKeyRegistryErrorCodes, ClientSession, ColumnInfo, ComposeManifestOptions, ComposedManifestRequest, CreateDelegationParams, DEFAULT_MANIFEST_SPACE, DEFAULT_MANIFEST_VERSION, DEFAULT_SIGNED_READ_URL_EXPIRY_MS, DataVaultConfig, DataVaultService, DatabaseHandle, 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, KVCreateSignedReadUrlOptions, KVResponse, KVService, KVServiceConfig, KVSignedReadUrlResponse, KeyInfo, KeyProvider, KeyType, Manifest, ManifestDefaults, ManifestRegistryRecord, ManifestSecretActions, ManifestValidationError, PermissionEntry, PermissionNotInManifestError, PersistedSessionData, PkhDidParts, PrefixedKVService, ProtocolMismatchError, QueryOptions, QueryResponse, ReceiveOptions, 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, TinyCloudSession, UnsupportedFeatureError, VAULT_PERMISSION_SERVICE, VaultCrypto, VaultEntry, VaultError, VaultGetOptions, VaultGrantOptions, VaultHeaders, VaultListOptions, VaultPublicSpaceKVActions, VaultPutOptions, VersionCheckError, ViewInfo, WasmVaultFunctions, addressStorageKey, buildSpaceUri, canonicalizeAddress, canonicalizeDid, canonicalizeDidUrl, canonicalizeNetworkId, canonicalizeSecretScope, checkNodeInfo, composeManifestRequest, createCapabilityKeyRegistry, createSharingService, createSpaceService, createVaultCrypto, defaultSpaceCreationHandler, didCacheKey, didEquals, expandActionShortNames, expandPermissionEntries, expandPermissionEntry, isCapabilitySubset, isEvmAddress, loadManifest, makePkhSpaceId, makePublicSpaceId, parseCanonicalNetworkId, parseExpiry, parsePkhDid, parseSpaceUri, pkhDid, principalDid, principalDidEquals, resolveManifest, resolveSecretListPrefix, resolveSecretPath, resourceCapabilitiesToSpaceAbilitiesMap, validateManifest } from '@tinycloud/sdk-core';
|
|
2
|
+
export { D as DelegateToOptions, a as DelegateToResult, b as DelegatedAccess, F as FileSessionStorage, M as MemorySessionStorage, N as NodeEventEmitterStrategy, c as NodeUserAuthorization, d as NodeUserAuthorizationConfig, P as PortableDelegation, e as RuntimePermissionGrantOptions, S as SignStrategy, T as TinyCloudNode, f as TinyCloudNodeConfig, W as WasmKeyProvider, g as WasmKeyProviderConfig, h as createWasmKeyProvider, i as defaultSignStrategy, j as deserializeDelegation, s as serializeDelegation } from './core-BdlIWB-K.js';
|
|
3
3
|
import 'events';
|
|
4
4
|
import '@tinycloud/sdk-services';
|
package/dist/core.js
CHANGED
|
@@ -436,11 +436,13 @@ var NodeUserAuthorization = class {
|
|
|
436
436
|
const request = this.getCapabilityRequest();
|
|
437
437
|
if (request === void 0) {
|
|
438
438
|
const defaultNetworkId = this.defaultEncryptionNetworkId(address, chainId);
|
|
439
|
+
const primarySpaceId2 = makePkhSpaceId(address, chainId, this.spacePrefix);
|
|
439
440
|
const secretsSpaceId = makePkhSpaceId(address, chainId, "secrets");
|
|
440
441
|
return {
|
|
441
442
|
abilities: this.defaultActions,
|
|
442
|
-
spaceId:
|
|
443
|
+
spaceId: primarySpaceId2,
|
|
443
444
|
spaceAbilities: {
|
|
445
|
+
[primarySpaceId2]: this.defaultActions,
|
|
444
446
|
[secretsSpaceId]: {
|
|
445
447
|
kv: {
|
|
446
448
|
"vault/secrets/": [
|
|
@@ -1080,14 +1082,15 @@ import {
|
|
|
1080
1082
|
ServiceContext
|
|
1081
1083
|
} from "@tinycloud/sdk-core";
|
|
1082
1084
|
var DelegatedAccess = class {
|
|
1083
|
-
constructor(session, delegation, host, invoke) {
|
|
1085
|
+
constructor(session, delegation, host, invoke, telemetry) {
|
|
1084
1086
|
this.session = session;
|
|
1085
1087
|
this._delegation = delegation;
|
|
1086
1088
|
this.host = host;
|
|
1087
1089
|
this._serviceContext = new ServiceContext({
|
|
1088
1090
|
invoke,
|
|
1089
1091
|
fetch: globalThis.fetch.bind(globalThis),
|
|
1090
|
-
hosts: [host]
|
|
1092
|
+
hosts: [host],
|
|
1093
|
+
telemetry
|
|
1091
1094
|
});
|
|
1092
1095
|
const prefix = this._delegation.path.replace(/\/$/, "");
|
|
1093
1096
|
this._kv = new KVService({ prefix });
|
|
@@ -1678,7 +1681,8 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
1678
1681
|
const kvContext = new ServiceContext2({
|
|
1679
1682
|
invoke: config2.invoke,
|
|
1680
1683
|
fetch: config2.fetch ?? globalThis.fetch.bind(globalThis),
|
|
1681
|
-
hosts: config2.hosts
|
|
1684
|
+
hosts: config2.hosts,
|
|
1685
|
+
telemetry: this.config.telemetry
|
|
1682
1686
|
});
|
|
1683
1687
|
kvContext.setSession(config2.session);
|
|
1684
1688
|
kvService.initialize(kvContext);
|
|
@@ -1735,7 +1739,8 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
1735
1739
|
includeAccountRegistryPermissions: config.includeAccountRegistryPermissions
|
|
1736
1740
|
});
|
|
1737
1741
|
this.tc = new TinyCloud(this.auth, {
|
|
1738
|
-
invokeAny: this.invokeAnyWithRuntimePermissions
|
|
1742
|
+
invokeAny: this.invokeAnyWithRuntimePermissions,
|
|
1743
|
+
telemetry: config.telemetry
|
|
1739
1744
|
});
|
|
1740
1745
|
}
|
|
1741
1746
|
syncResolvedHostFromAuth() {
|
|
@@ -1967,7 +1972,8 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
1967
1972
|
invoke: this.invokeWithRuntimePermissions,
|
|
1968
1973
|
invokeAny: this.invokeAnyWithRuntimePermissions,
|
|
1969
1974
|
fetch: globalThis.fetch.bind(globalThis),
|
|
1970
|
-
hosts: [this.config.host]
|
|
1975
|
+
hosts: [this.config.host],
|
|
1976
|
+
telemetry: this.config.telemetry
|
|
1971
1977
|
});
|
|
1972
1978
|
this._kv = new KVService2({});
|
|
1973
1979
|
this._kv.initialize(this._serviceContext);
|
|
@@ -2078,7 +2084,8 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
2078
2084
|
includeAccountRegistryPermissions: this.config.includeAccountRegistryPermissions
|
|
2079
2085
|
});
|
|
2080
2086
|
this.tc = new TinyCloud(this.auth, {
|
|
2081
|
-
invokeAny: this.invokeAnyWithRuntimePermissions
|
|
2087
|
+
invokeAny: this.invokeAnyWithRuntimePermissions,
|
|
2088
|
+
telemetry: this.config.telemetry
|
|
2082
2089
|
});
|
|
2083
2090
|
this.config.prefix = prefix;
|
|
2084
2091
|
}
|
|
@@ -2122,7 +2129,8 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
2122
2129
|
includeAccountRegistryPermissions: this.config.includeAccountRegistryPermissions
|
|
2123
2130
|
});
|
|
2124
2131
|
this.tc = new TinyCloud(this.auth, {
|
|
2125
|
-
invokeAny: this.invokeAnyWithRuntimePermissions
|
|
2132
|
+
invokeAny: this.invokeAnyWithRuntimePermissions,
|
|
2133
|
+
telemetry: this.config.telemetry
|
|
2126
2134
|
});
|
|
2127
2135
|
this.config.prefix = prefix;
|
|
2128
2136
|
}
|
|
@@ -2140,7 +2148,8 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
2140
2148
|
invoke: this.invokeWithRuntimePermissions,
|
|
2141
2149
|
invokeAny: this.invokeAnyWithRuntimePermissions,
|
|
2142
2150
|
fetch: globalThis.fetch.bind(globalThis),
|
|
2143
|
-
hosts: [this.config.host]
|
|
2151
|
+
hosts: [this.config.host],
|
|
2152
|
+
telemetry: this.config.telemetry
|
|
2144
2153
|
});
|
|
2145
2154
|
this._kv = new KVService2({});
|
|
2146
2155
|
this._kv.initialize(this._serviceContext);
|
|
@@ -2179,7 +2188,8 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
2179
2188
|
const spaceScopedContext = new ServiceContext2({
|
|
2180
2189
|
invoke: this._serviceContext.invoke,
|
|
2181
2190
|
fetch: this._serviceContext.fetch,
|
|
2182
|
-
hosts: this._serviceContext.hosts
|
|
2191
|
+
hosts: this._serviceContext.hosts,
|
|
2192
|
+
telemetry: this.config.telemetry
|
|
2183
2193
|
});
|
|
2184
2194
|
const session = this._serviceContext.session;
|
|
2185
2195
|
if (session) {
|
|
@@ -2744,12 +2754,41 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
2744
2754
|
const spaceScopedContext = new ServiceContext2({
|
|
2745
2755
|
invoke: this._serviceContext.invoke,
|
|
2746
2756
|
fetch: this._serviceContext.fetch,
|
|
2747
|
-
hosts: this._serviceContext.hosts
|
|
2757
|
+
hosts: this._serviceContext.hosts,
|
|
2758
|
+
telemetry: this.config.telemetry
|
|
2748
2759
|
});
|
|
2749
2760
|
spaceScopedContext.setSession({ ...this._serviceContext.session, spaceId });
|
|
2750
2761
|
sql.initialize(spaceScopedContext);
|
|
2751
2762
|
return sql;
|
|
2752
2763
|
}
|
|
2764
|
+
/**
|
|
2765
|
+
* Get a KV service scoped to a specific space.
|
|
2766
|
+
*
|
|
2767
|
+
* The KV counterpart to {@link sqlForSpace}: clones the active service
|
|
2768
|
+
* context and overrides its session's spaceId so that subsequent
|
|
2769
|
+
* `kv/<action>` invocations route to that space. Useful for reading data
|
|
2770
|
+
* that a manifest app stores outside the primary space (e.g. transcripts a
|
|
2771
|
+
* `defaults: true` app keeps under the owner's `applications` space), when
|
|
2772
|
+
* the caller already holds a delegation covering the target space.
|
|
2773
|
+
*
|
|
2774
|
+
* Does NOT auto-create the space.
|
|
2775
|
+
*
|
|
2776
|
+
* @param spaceId - Full space URI (`tinycloud:pkh:eip155:<chain>:<addr>:<name>`).
|
|
2777
|
+
*/
|
|
2778
|
+
kvForSpace(spaceId) {
|
|
2779
|
+
if (!this._serviceContext || !this._serviceContext.session) {
|
|
2780
|
+
throw new Error("Not signed in. Call signIn() first.");
|
|
2781
|
+
}
|
|
2782
|
+
const kv = new KVService2({});
|
|
2783
|
+
const spaceScopedContext = new ServiceContext2({
|
|
2784
|
+
invoke: this._serviceContext.invoke,
|
|
2785
|
+
fetch: this._serviceContext.fetch,
|
|
2786
|
+
hosts: this._serviceContext.hosts
|
|
2787
|
+
});
|
|
2788
|
+
spaceScopedContext.setSession({ ...this._serviceContext.session, spaceId });
|
|
2789
|
+
kv.initialize(spaceScopedContext);
|
|
2790
|
+
return kv;
|
|
2791
|
+
}
|
|
2753
2792
|
/**
|
|
2754
2793
|
* DuckDB database operations on this user's space.
|
|
2755
2794
|
*/
|
|
@@ -3316,7 +3355,8 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
3316
3355
|
const publicContext = new ServiceContext2({
|
|
3317
3356
|
invoke: this.invokeWithRuntimePermissions,
|
|
3318
3357
|
fetch: this._serviceContext.fetch,
|
|
3319
|
-
hosts: this._serviceContext.hosts
|
|
3358
|
+
hosts: this._serviceContext.hosts,
|
|
3359
|
+
telemetry: this.config.telemetry
|
|
3320
3360
|
});
|
|
3321
3361
|
publicContext.setSession({
|
|
3322
3362
|
delegationHeader: delegationSession.delegationHeader,
|
|
@@ -4212,7 +4252,13 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
4212
4252
|
},
|
|
4213
4253
|
delegation.expiry
|
|
4214
4254
|
);
|
|
4215
|
-
return new DelegatedAccess(
|
|
4255
|
+
return new DelegatedAccess(
|
|
4256
|
+
session2,
|
|
4257
|
+
delegation,
|
|
4258
|
+
targetHost,
|
|
4259
|
+
this.wasmBindings.invoke,
|
|
4260
|
+
this.config.telemetry
|
|
4261
|
+
);
|
|
4216
4262
|
}
|
|
4217
4263
|
const mySession = this.auth?.tinyCloudSession;
|
|
4218
4264
|
if (!mySession) {
|
|
@@ -4290,7 +4336,13 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
4290
4336
|
},
|
|
4291
4337
|
expirationTime
|
|
4292
4338
|
);
|
|
4293
|
-
return new DelegatedAccess(
|
|
4339
|
+
return new DelegatedAccess(
|
|
4340
|
+
session,
|
|
4341
|
+
delegation,
|
|
4342
|
+
targetHost,
|
|
4343
|
+
this.wasmBindings.invoke,
|
|
4344
|
+
this.config.telemetry
|
|
4345
|
+
);
|
|
4294
4346
|
}
|
|
4295
4347
|
/**
|
|
4296
4348
|
* Create a sub-delegation from a received delegation.
|