@tinycloud/node-sdk 2.0.4 → 2.1.0-beta.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.cjs +67 -9
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.cts +11 -1
- package/dist/core.d.ts +11 -1
- package/dist/core.js +69 -9
- package/dist/core.js.map +1 -1
- package/dist/index.cjs +90 -28
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +84 -11
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ISigner, Bytes, IWasmBindings, ISessionManager } from '@tinycloud/sdk-core';
|
|
2
|
-
export { AutoApproveSpaceCreationHandler, AutoRejectStrategy, AutoSignStrategy, BatchOptions, BatchResponse, CallbackStrategy, CapabilityEntry, CapabilityKeyRegistry, CapabilityKeyRegistryErrorCode, CapabilityKeyRegistryErrorCodes, ClientSession, ColumnInfo, CreateDelegationParams, DataVaultConfig, DataVaultService, DatabaseHandle, Delegation, DelegationChain, DelegationChainV2, DelegationDirection, DelegationError, DelegationErrorCode, DelegationErrorCodes, DelegationFilters, DelegationManager, DelegationManagerConfig, DelegationRecord, DelegationResult, 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, ISessionManager, ISessionStorage, ISharingService, ISigner, ISpace, ISpaceCreationHandler, ISpaceScopedDelegations, ISpaceScopedSharing, ISpaceService, IUserAuthorization, IWasmBindings, IngestOptions, InvokeFunction, JWK, KVResponse, KVService, KVServiceConfig, KeyInfo, KeyProvider, KeyType, PersistedSessionData, PrefixedKVService, ProtocolMismatchError, QueryOptions, QueryResponse, ReceiveOptions, SQLAction, SQLActionType, SQLService, SQLServiceConfig, SchemaInfo, ServiceContext, ServiceContextConfig, ServiceSession, ShareAccess, ShareLink, ShareLinkData, ShareSchema, SharingService, SharingServiceConfig, SignCallback, SignRequest, SignResponse, SilentNotificationHandler, Space, SpaceConfig, SpaceCreationContext, SpaceErrorCode, SpaceErrorCodes, SpaceInfo, SpaceOwnership, SpaceService, SpaceServiceConfig, SqlStatement, SqlValue, StoredDelegationChain, TableInfo, TinyCloud, TinyCloudConfig, TinyCloudSession, UnsupportedFeatureError, VaultCrypto, VaultEntry, VaultError, VaultGetOptions, VaultGrantOptions, VaultHeaders, VaultListOptions, VaultPublicSpaceKVActions, VaultPutOptions, VersionCheckError, ViewInfo, WasmVaultFunctions, buildSpaceUri, checkNodeInfo, createCapabilityKeyRegistry, createSharingService, createSpaceService, createVaultCrypto, defaultSpaceCreationHandler, makePublicSpaceId, parseSpaceUri } from '@tinycloud/sdk-core';
|
|
2
|
+
export { AutoApproveSpaceCreationHandler, AutoRejectStrategy, AutoSignStrategy, BatchOptions, BatchResponse, CallbackStrategy, CapabilityEntry, CapabilityKeyRegistry, CapabilityKeyRegistryErrorCode, CapabilityKeyRegistryErrorCodes, ClientSession, ColumnInfo, CreateDelegationParams, DataVaultConfig, DataVaultService, DatabaseHandle, Delegation, DelegationChain, DelegationChainV2, DelegationDirection, DelegationError, DelegationErrorCode, DelegationErrorCodes, DelegationFilters, DelegationManager, DelegationManagerConfig, DelegationRecord, DelegationResult, DuckDbAction, DuckDbActionType, DuckDbBatchOptions, DuckDbBatchResponse, DuckDbDatabaseHandle, DuckDbExecuteOptions, DuckDbExecuteResponse, DuckDbOptions, DuckDbQueryOptions, DuckDbQueryResponse, DuckDbService, DuckDbServiceConfig, DuckDbStatement, DuckDbValue, EncodedShareData, ExecuteOptions, ExecuteResponse, Extension, FetchFunction, GenerateShareParams, HookEvent, HookServiceName, HookStreamEvent, HookSubscription, HookWebhookListOptions, HookWebhookRecord, HookWebhookRegistration, HookWebhookScope, HookWebhookUnregisterOptions, HooksService, HooksServiceConfig, ICapabilityKeyRegistry, IDataVaultService, IDatabaseHandle, IDuckDbDatabaseHandle, IDuckDbService, IENSResolver, IHooksService, IKVService, INotificationHandler, IPrefixedKVService, ISQLService, ISessionManager, ISessionStorage, ISharingService, ISigner, ISpace, ISpaceCreationHandler, ISpaceScopedDelegations, ISpaceScopedSharing, ISpaceService, IUserAuthorization, IWasmBindings, IngestOptions, InvokeFunction, JWK, KVResponse, KVService, KVServiceConfig, KeyInfo, KeyProvider, KeyType, PersistedSessionData, PrefixedKVService, ProtocolMismatchError, QueryOptions, QueryResponse, ReceiveOptions, SQLAction, SQLActionType, SQLService, SQLServiceConfig, SchemaInfo, ServiceContext, ServiceContextConfig, ServiceSession, ShareAccess, ShareLink, ShareLinkData, ShareSchema, SharingService, SharingServiceConfig, SignCallback, SignRequest, SignResponse, SilentNotificationHandler, Space, SpaceConfig, SpaceCreationContext, SpaceErrorCode, SpaceErrorCodes, SpaceInfo, SpaceOwnership, SpaceService, SpaceServiceConfig, SqlStatement, SqlValue, StoredDelegationChain, SubscribeOptions, TableInfo, TinyCloud, TinyCloudConfig, TinyCloudSession, UnsupportedFeatureError, VaultCrypto, VaultEntry, VaultError, VaultGetOptions, VaultGrantOptions, VaultHeaders, VaultListOptions, VaultPublicSpaceKVActions, VaultPutOptions, VersionCheckError, ViewInfo, WasmVaultFunctions, buildSpaceUri, checkNodeInfo, createCapabilityKeyRegistry, createSharingService, createSpaceService, createVaultCrypto, defaultSpaceCreationHandler, makePublicSpaceId, parseSpaceUri } from '@tinycloud/sdk-core';
|
|
3
3
|
export { DelegatedAccess, FileSessionStorage, MemorySessionStorage, NodeEventEmitterStrategy, NodeUserAuthorization, NodeUserAuthorizationConfig, PortableDelegation, SignStrategy, TinyCloudNode, TinyCloudNodeConfig, WasmKeyProvider, WasmKeyProviderConfig, createWasmKeyProvider, defaultSignStrategy, deserializeDelegation, serializeDelegation } from './core.cjs';
|
|
4
|
-
import { invoke, prepareSession, completeSessionSetup, ensureEip55, makeSpaceId, createDelegation, 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';
|
|
4
|
+
import { invoke, invokeAny, prepareSession, completeSessionSetup, ensureEip55, makeSpaceId, createDelegation, 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';
|
|
7
7
|
|
|
@@ -70,6 +70,7 @@ declare class NodeWasmBindings implements IWasmBindings {
|
|
|
70
70
|
private static panicHookInitialized;
|
|
71
71
|
constructor();
|
|
72
72
|
invoke: typeof invoke;
|
|
73
|
+
invokeAny: typeof invokeAny;
|
|
73
74
|
prepareSession: typeof prepareSession;
|
|
74
75
|
completeSessionSetup: typeof completeSessionSetup;
|
|
75
76
|
ensureEip55: typeof ensureEip55;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ISigner, Bytes, IWasmBindings, ISessionManager } from '@tinycloud/sdk-core';
|
|
2
|
-
export { AutoApproveSpaceCreationHandler, AutoRejectStrategy, AutoSignStrategy, BatchOptions, BatchResponse, CallbackStrategy, CapabilityEntry, CapabilityKeyRegistry, CapabilityKeyRegistryErrorCode, CapabilityKeyRegistryErrorCodes, ClientSession, ColumnInfo, CreateDelegationParams, DataVaultConfig, DataVaultService, DatabaseHandle, Delegation, DelegationChain, DelegationChainV2, DelegationDirection, DelegationError, DelegationErrorCode, DelegationErrorCodes, DelegationFilters, DelegationManager, DelegationManagerConfig, DelegationRecord, DelegationResult, 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, ISessionManager, ISessionStorage, ISharingService, ISigner, ISpace, ISpaceCreationHandler, ISpaceScopedDelegations, ISpaceScopedSharing, ISpaceService, IUserAuthorization, IWasmBindings, IngestOptions, InvokeFunction, JWK, KVResponse, KVService, KVServiceConfig, KeyInfo, KeyProvider, KeyType, PersistedSessionData, PrefixedKVService, ProtocolMismatchError, QueryOptions, QueryResponse, ReceiveOptions, SQLAction, SQLActionType, SQLService, SQLServiceConfig, SchemaInfo, ServiceContext, ServiceContextConfig, ServiceSession, ShareAccess, ShareLink, ShareLinkData, ShareSchema, SharingService, SharingServiceConfig, SignCallback, SignRequest, SignResponse, SilentNotificationHandler, Space, SpaceConfig, SpaceCreationContext, SpaceErrorCode, SpaceErrorCodes, SpaceInfo, SpaceOwnership, SpaceService, SpaceServiceConfig, SqlStatement, SqlValue, StoredDelegationChain, TableInfo, TinyCloud, TinyCloudConfig, TinyCloudSession, UnsupportedFeatureError, VaultCrypto, VaultEntry, VaultError, VaultGetOptions, VaultGrantOptions, VaultHeaders, VaultListOptions, VaultPublicSpaceKVActions, VaultPutOptions, VersionCheckError, ViewInfo, WasmVaultFunctions, buildSpaceUri, checkNodeInfo, createCapabilityKeyRegistry, createSharingService, createSpaceService, createVaultCrypto, defaultSpaceCreationHandler, makePublicSpaceId, parseSpaceUri } from '@tinycloud/sdk-core';
|
|
2
|
+
export { AutoApproveSpaceCreationHandler, AutoRejectStrategy, AutoSignStrategy, BatchOptions, BatchResponse, CallbackStrategy, CapabilityEntry, CapabilityKeyRegistry, CapabilityKeyRegistryErrorCode, CapabilityKeyRegistryErrorCodes, ClientSession, ColumnInfo, CreateDelegationParams, DataVaultConfig, DataVaultService, DatabaseHandle, Delegation, DelegationChain, DelegationChainV2, DelegationDirection, DelegationError, DelegationErrorCode, DelegationErrorCodes, DelegationFilters, DelegationManager, DelegationManagerConfig, DelegationRecord, DelegationResult, DuckDbAction, DuckDbActionType, DuckDbBatchOptions, DuckDbBatchResponse, DuckDbDatabaseHandle, DuckDbExecuteOptions, DuckDbExecuteResponse, DuckDbOptions, DuckDbQueryOptions, DuckDbQueryResponse, DuckDbService, DuckDbServiceConfig, DuckDbStatement, DuckDbValue, EncodedShareData, ExecuteOptions, ExecuteResponse, Extension, FetchFunction, GenerateShareParams, HookEvent, HookServiceName, HookStreamEvent, HookSubscription, HookWebhookListOptions, HookWebhookRecord, HookWebhookRegistration, HookWebhookScope, HookWebhookUnregisterOptions, HooksService, HooksServiceConfig, ICapabilityKeyRegistry, IDataVaultService, IDatabaseHandle, IDuckDbDatabaseHandle, IDuckDbService, IENSResolver, IHooksService, IKVService, INotificationHandler, IPrefixedKVService, ISQLService, ISessionManager, ISessionStorage, ISharingService, ISigner, ISpace, ISpaceCreationHandler, ISpaceScopedDelegations, ISpaceScopedSharing, ISpaceService, IUserAuthorization, IWasmBindings, IngestOptions, InvokeFunction, JWK, KVResponse, KVService, KVServiceConfig, KeyInfo, KeyProvider, KeyType, PersistedSessionData, PrefixedKVService, ProtocolMismatchError, QueryOptions, QueryResponse, ReceiveOptions, SQLAction, SQLActionType, SQLService, SQLServiceConfig, SchemaInfo, ServiceContext, ServiceContextConfig, ServiceSession, ShareAccess, ShareLink, ShareLinkData, ShareSchema, SharingService, SharingServiceConfig, SignCallback, SignRequest, SignResponse, SilentNotificationHandler, Space, SpaceConfig, SpaceCreationContext, SpaceErrorCode, SpaceErrorCodes, SpaceInfo, SpaceOwnership, SpaceService, SpaceServiceConfig, SqlStatement, SqlValue, StoredDelegationChain, SubscribeOptions, TableInfo, TinyCloud, TinyCloudConfig, TinyCloudSession, UnsupportedFeatureError, VaultCrypto, VaultEntry, VaultError, VaultGetOptions, VaultGrantOptions, VaultHeaders, VaultListOptions, VaultPublicSpaceKVActions, VaultPutOptions, VersionCheckError, ViewInfo, WasmVaultFunctions, buildSpaceUri, checkNodeInfo, createCapabilityKeyRegistry, createSharingService, createSpaceService, createVaultCrypto, defaultSpaceCreationHandler, makePublicSpaceId, parseSpaceUri } from '@tinycloud/sdk-core';
|
|
3
3
|
export { DelegatedAccess, FileSessionStorage, MemorySessionStorage, NodeEventEmitterStrategy, NodeUserAuthorization, NodeUserAuthorizationConfig, PortableDelegation, SignStrategy, TinyCloudNode, TinyCloudNodeConfig, WasmKeyProvider, WasmKeyProviderConfig, createWasmKeyProvider, defaultSignStrategy, deserializeDelegation, serializeDelegation } from './core.js';
|
|
4
|
-
import { invoke, prepareSession, completeSessionSetup, ensureEip55, makeSpaceId, createDelegation, 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';
|
|
4
|
+
import { invoke, invokeAny, prepareSession, completeSessionSetup, ensureEip55, makeSpaceId, createDelegation, 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';
|
|
7
7
|
|
|
@@ -70,6 +70,7 @@ declare class NodeWasmBindings implements IWasmBindings {
|
|
|
70
70
|
private static panicHookInitialized;
|
|
71
71
|
constructor();
|
|
72
72
|
invoke: typeof invoke;
|
|
73
|
+
invokeAny: typeof invokeAny;
|
|
73
74
|
prepareSession: typeof prepareSession;
|
|
74
75
|
completeSessionSetup: typeof completeSessionSetup;
|
|
75
76
|
ensureEip55: typeof ensureEip55;
|
package/dist/index.js
CHANGED
|
@@ -17030,6 +17030,7 @@ var require_utils2 = __commonJS({
|
|
|
17030
17030
|
// src/NodeWasmBindings.ts
|
|
17031
17031
|
import {
|
|
17032
17032
|
invoke,
|
|
17033
|
+
invokeAny,
|
|
17033
17034
|
prepareSession,
|
|
17034
17035
|
completeSessionSetup,
|
|
17035
17036
|
ensureEip55,
|
|
@@ -17051,6 +17052,7 @@ import {
|
|
|
17051
17052
|
var _NodeWasmBindings = class _NodeWasmBindings {
|
|
17052
17053
|
constructor() {
|
|
17053
17054
|
this.invoke = invoke;
|
|
17055
|
+
this.invokeAny = invokeAny;
|
|
17054
17056
|
this.prepareSession = prepareSession;
|
|
17055
17057
|
this.completeSessionSetup = completeSessionSetup;
|
|
17056
17058
|
this.ensureEip55 = ensureEip55;
|
|
@@ -17153,6 +17155,7 @@ import {
|
|
|
17153
17155
|
KVService as KVService2,
|
|
17154
17156
|
SQLService as SQLService2,
|
|
17155
17157
|
DuckDbService as DuckDbService2,
|
|
17158
|
+
HooksService as HooksService2,
|
|
17156
17159
|
DataVaultService,
|
|
17157
17160
|
createVaultCrypto,
|
|
17158
17161
|
ServiceContext as ServiceContext2,
|
|
@@ -17292,12 +17295,22 @@ var NodeUserAuthorization = class {
|
|
|
17292
17295
|
},
|
|
17293
17296
|
capabilities: {
|
|
17294
17297
|
"": ["tinycloud.capabilities/read"]
|
|
17298
|
+
},
|
|
17299
|
+
hooks: {
|
|
17300
|
+
"": [
|
|
17301
|
+
"tinycloud.hooks/subscribe",
|
|
17302
|
+
"tinycloud.hooks/register",
|
|
17303
|
+
"tinycloud.hooks/list",
|
|
17304
|
+
"tinycloud.hooks/unregister"
|
|
17305
|
+
]
|
|
17295
17306
|
}
|
|
17296
17307
|
};
|
|
17297
17308
|
this.sessionExpirationMs = config.sessionExpirationMs ?? 60 * 60 * 1e3;
|
|
17298
17309
|
this.autoCreateSpace = config.autoCreateSpace ?? false;
|
|
17299
17310
|
this.spaceCreationHandler = config.spaceCreationHandler;
|
|
17300
|
-
this.tinycloudHosts = config.tinycloudHosts ?? [
|
|
17311
|
+
this.tinycloudHosts = config.tinycloudHosts ?? [
|
|
17312
|
+
"https://node.tinycloud.xyz"
|
|
17313
|
+
];
|
|
17301
17314
|
this.enablePublicSpace = config.enablePublicSpace ?? true;
|
|
17302
17315
|
this.nonce = config.nonce;
|
|
17303
17316
|
this.siweConfig = config.siweConfig;
|
|
@@ -17437,7 +17450,10 @@ var NodeUserAuthorization = class {
|
|
|
17437
17450
|
throw err;
|
|
17438
17451
|
}
|
|
17439
17452
|
} catch (error) {
|
|
17440
|
-
handler.onSpaceCreationFailed?.(
|
|
17453
|
+
handler.onSpaceCreationFailed?.(
|
|
17454
|
+
creationContext,
|
|
17455
|
+
error instanceof Error ? error : new Error(String(error))
|
|
17456
|
+
);
|
|
17441
17457
|
throw error;
|
|
17442
17458
|
}
|
|
17443
17459
|
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
@@ -17471,7 +17487,10 @@ var NodeUserAuthorization = class {
|
|
|
17471
17487
|
throw err;
|
|
17472
17488
|
}
|
|
17473
17489
|
} catch (error) {
|
|
17474
|
-
handler.onSpaceCreationFailed?.(
|
|
17490
|
+
handler.onSpaceCreationFailed?.(
|
|
17491
|
+
creationContext,
|
|
17492
|
+
error instanceof Error ? error : new Error(String(error))
|
|
17493
|
+
);
|
|
17475
17494
|
throw error;
|
|
17476
17495
|
}
|
|
17477
17496
|
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
@@ -17580,7 +17599,10 @@ var NodeUserAuthorization = class {
|
|
|
17580
17599
|
this._tinyCloudSession = tinyCloudSession;
|
|
17581
17600
|
this._address = address;
|
|
17582
17601
|
this._chainId = chainId;
|
|
17583
|
-
const nodeInfo = await checkNodeInfo(
|
|
17602
|
+
const nodeInfo = await checkNodeInfo(
|
|
17603
|
+
this.tinycloudHosts[0],
|
|
17604
|
+
this.wasm.protocolVersion()
|
|
17605
|
+
);
|
|
17584
17606
|
this._nodeFeatures = nodeInfo.features;
|
|
17585
17607
|
for (const ext of this.extensions) {
|
|
17586
17608
|
if (ext.afterSignIn) {
|
|
@@ -17740,7 +17762,10 @@ var NodeUserAuthorization = class {
|
|
|
17740
17762
|
this._tinyCloudSession = tinyCloudSession;
|
|
17741
17763
|
this._address = address;
|
|
17742
17764
|
this._chainId = chainId;
|
|
17743
|
-
const nodeInfo = await checkNodeInfo(
|
|
17765
|
+
const nodeInfo = await checkNodeInfo(
|
|
17766
|
+
this.tinycloudHosts[0],
|
|
17767
|
+
this.wasm.protocolVersion()
|
|
17768
|
+
);
|
|
17744
17769
|
this._nodeFeatures = nodeInfo.features;
|
|
17745
17770
|
for (const ext of this.extensions) {
|
|
17746
17771
|
if (ext.afterSignIn) {
|
|
@@ -17791,7 +17816,9 @@ var NodeUserAuthorization = class {
|
|
|
17791
17816
|
);
|
|
17792
17817
|
}
|
|
17793
17818
|
default:
|
|
17794
|
-
throw new Error(
|
|
17819
|
+
throw new Error(
|
|
17820
|
+
`Unknown sign strategy: ${this.signStrategy.type}`
|
|
17821
|
+
);
|
|
17795
17822
|
}
|
|
17796
17823
|
}
|
|
17797
17824
|
/**
|
|
@@ -17821,6 +17848,7 @@ var NodeUserAuthorization = class {
|
|
|
17821
17848
|
// src/DelegatedAccess.ts
|
|
17822
17849
|
import {
|
|
17823
17850
|
KVService,
|
|
17851
|
+
HooksService,
|
|
17824
17852
|
SQLService,
|
|
17825
17853
|
DuckDbService,
|
|
17826
17854
|
ServiceContext
|
|
@@ -17845,6 +17873,9 @@ var DelegatedAccess = class {
|
|
|
17845
17873
|
this._duckdb = new DuckDbService({});
|
|
17846
17874
|
this._duckdb.initialize(this._serviceContext);
|
|
17847
17875
|
this._serviceContext.registerService("duckdb", this._duckdb);
|
|
17876
|
+
this._hooks = new HooksService({});
|
|
17877
|
+
this._hooks.initialize(this._serviceContext);
|
|
17878
|
+
this._serviceContext.registerService("hooks", this._hooks);
|
|
17848
17879
|
const serviceSession = {
|
|
17849
17880
|
delegationHeader: session.delegationHeader,
|
|
17850
17881
|
delegationCid: session.delegationCid,
|
|
@@ -17890,6 +17921,12 @@ var DelegatedAccess = class {
|
|
|
17890
17921
|
get duckdb() {
|
|
17891
17922
|
return this._duckdb;
|
|
17892
17923
|
}
|
|
17924
|
+
/**
|
|
17925
|
+
* Hooks write-stream subscriptions on the delegated space.
|
|
17926
|
+
*/
|
|
17927
|
+
get hooks() {
|
|
17928
|
+
return this._hooks;
|
|
17929
|
+
}
|
|
17893
17930
|
};
|
|
17894
17931
|
|
|
17895
17932
|
// src/keys/WasmKeyProvider.ts
|
|
@@ -18095,7 +18132,9 @@ var TinyCloudNode = class _TinyCloudNode {
|
|
|
18095
18132
|
nonce: config.nonce,
|
|
18096
18133
|
siweConfig: config.siweConfig
|
|
18097
18134
|
});
|
|
18098
|
-
this.tc = new TinyCloud(this.auth
|
|
18135
|
+
this.tc = new TinyCloud(this.auth, {
|
|
18136
|
+
invokeAny: this.wasmBindings.invokeAny
|
|
18137
|
+
});
|
|
18099
18138
|
}
|
|
18100
18139
|
/**
|
|
18101
18140
|
* Get the primary identity DID for this user.
|
|
@@ -18164,6 +18203,7 @@ var TinyCloudNode = class _TinyCloudNode {
|
|
|
18164
18203
|
this._kv = void 0;
|
|
18165
18204
|
this._sql = void 0;
|
|
18166
18205
|
this._duckdb = void 0;
|
|
18206
|
+
this._hooks = void 0;
|
|
18167
18207
|
this._serviceContext = void 0;
|
|
18168
18208
|
await this.tc.signIn();
|
|
18169
18209
|
this.initializeServices();
|
|
@@ -18183,6 +18223,7 @@ var TinyCloudNode = class _TinyCloudNode {
|
|
|
18183
18223
|
this._kv = void 0;
|
|
18184
18224
|
this._sql = void 0;
|
|
18185
18225
|
this._duckdb = void 0;
|
|
18226
|
+
this._hooks = void 0;
|
|
18186
18227
|
this._serviceContext = void 0;
|
|
18187
18228
|
if (sessionData.address) {
|
|
18188
18229
|
this._address = sessionData.address;
|
|
@@ -18192,6 +18233,7 @@ var TinyCloudNode = class _TinyCloudNode {
|
|
|
18192
18233
|
}
|
|
18193
18234
|
this._serviceContext = new ServiceContext2({
|
|
18194
18235
|
invoke: this.wasmBindings.invoke,
|
|
18236
|
+
invokeAny: this.wasmBindings.invokeAny,
|
|
18195
18237
|
fetch: globalThis.fetch.bind(globalThis),
|
|
18196
18238
|
hosts: [this.config.host]
|
|
18197
18239
|
});
|
|
@@ -18204,6 +18246,9 @@ var TinyCloudNode = class _TinyCloudNode {
|
|
|
18204
18246
|
this._duckdb = new DuckDbService2({});
|
|
18205
18247
|
this._duckdb.initialize(this._serviceContext);
|
|
18206
18248
|
this._serviceContext.registerService("duckdb", this._duckdb);
|
|
18249
|
+
this._hooks = new HooksService2({});
|
|
18250
|
+
this._hooks.initialize(this._serviceContext);
|
|
18251
|
+
this._serviceContext.registerService("hooks", this._hooks);
|
|
18207
18252
|
const serviceSession = {
|
|
18208
18253
|
delegationHeader: sessionData.delegationHeader,
|
|
18209
18254
|
delegationCid: sessionData.delegationCid,
|
|
@@ -18303,7 +18348,9 @@ var TinyCloudNode = class _TinyCloudNode {
|
|
|
18303
18348
|
nonce: this.config.nonce,
|
|
18304
18349
|
siweConfig: this.config.siweConfig
|
|
18305
18350
|
});
|
|
18306
|
-
this.tc = new TinyCloud(this.auth
|
|
18351
|
+
this.tc = new TinyCloud(this.auth, {
|
|
18352
|
+
invokeAny: this.wasmBindings.invokeAny
|
|
18353
|
+
});
|
|
18307
18354
|
this.config.prefix = prefix;
|
|
18308
18355
|
}
|
|
18309
18356
|
/**
|
|
@@ -18341,7 +18388,9 @@ var TinyCloudNode = class _TinyCloudNode {
|
|
|
18341
18388
|
nonce: this.config.nonce,
|
|
18342
18389
|
siweConfig: this.config.siweConfig
|
|
18343
18390
|
});
|
|
18344
|
-
this.tc = new TinyCloud(this.auth
|
|
18391
|
+
this.tc = new TinyCloud(this.auth, {
|
|
18392
|
+
invokeAny: this.wasmBindings.invokeAny
|
|
18393
|
+
});
|
|
18345
18394
|
this.config.prefix = prefix;
|
|
18346
18395
|
}
|
|
18347
18396
|
/**
|
|
@@ -18356,6 +18405,7 @@ var TinyCloudNode = class _TinyCloudNode {
|
|
|
18356
18405
|
this.tc.initializeServices(this.wasmBindings.invoke, [this.config.host]);
|
|
18357
18406
|
this._serviceContext = new ServiceContext2({
|
|
18358
18407
|
invoke: this.wasmBindings.invoke,
|
|
18408
|
+
invokeAny: this.wasmBindings.invokeAny,
|
|
18359
18409
|
fetch: globalThis.fetch.bind(globalThis),
|
|
18360
18410
|
hosts: [this.config.host]
|
|
18361
18411
|
});
|
|
@@ -18373,6 +18423,9 @@ var TinyCloudNode = class _TinyCloudNode {
|
|
|
18373
18423
|
this._duckdb.initialize(this._serviceContext);
|
|
18374
18424
|
this._serviceContext.registerService("duckdb", this._duckdb);
|
|
18375
18425
|
}
|
|
18426
|
+
this._hooks = new HooksService2({});
|
|
18427
|
+
this._hooks.initialize(this._serviceContext);
|
|
18428
|
+
this._serviceContext.registerService("hooks", this._hooks);
|
|
18376
18429
|
const serviceSession = {
|
|
18377
18430
|
delegationHeader: session.delegationHeader,
|
|
18378
18431
|
delegationCid: session.delegationCid,
|
|
@@ -18751,6 +18804,15 @@ var TinyCloudNode = class _TinyCloudNode {
|
|
|
18751
18804
|
}
|
|
18752
18805
|
return this._vault;
|
|
18753
18806
|
}
|
|
18807
|
+
/**
|
|
18808
|
+
* Hooks write stream subscription API.
|
|
18809
|
+
*/
|
|
18810
|
+
get hooks() {
|
|
18811
|
+
if (!this._hooks) {
|
|
18812
|
+
throw new Error("Not signed in. Call signIn() first.");
|
|
18813
|
+
}
|
|
18814
|
+
return this._hooks;
|
|
18815
|
+
}
|
|
18754
18816
|
// ===========================================================================
|
|
18755
18817
|
// v2 Service Accessors
|
|
18756
18818
|
// ===========================================================================
|
|
@@ -19541,8 +19603,18 @@ function deserializeDelegation(data) {
|
|
|
19541
19603
|
// src/index.ts
|
|
19542
19604
|
import { KVService as KVService3, PrefixedKVService } from "@tinycloud/sdk-core";
|
|
19543
19605
|
import { SQLService as SQLService3, SQLAction, DatabaseHandle } from "@tinycloud/sdk-core";
|
|
19544
|
-
import {
|
|
19545
|
-
|
|
19606
|
+
import {
|
|
19607
|
+
DuckDbService as DuckDbService3,
|
|
19608
|
+
DuckDbDatabaseHandle,
|
|
19609
|
+
DuckDbAction
|
|
19610
|
+
} from "@tinycloud/sdk-core";
|
|
19611
|
+
import {
|
|
19612
|
+
DataVaultService as DataVaultService2,
|
|
19613
|
+
VaultHeaders,
|
|
19614
|
+
VaultPublicSpaceKVActions,
|
|
19615
|
+
createVaultCrypto as createVaultCrypto2
|
|
19616
|
+
} from "@tinycloud/sdk-core";
|
|
19617
|
+
import { HooksService as HooksService3 } from "@tinycloud/sdk-core";
|
|
19546
19618
|
import {
|
|
19547
19619
|
DelegationManager as DelegationManager2,
|
|
19548
19620
|
SharingService as SharingService2,
|
|
@@ -19583,6 +19655,7 @@ export {
|
|
|
19583
19655
|
DuckDbDatabaseHandle,
|
|
19584
19656
|
DuckDbService3 as DuckDbService,
|
|
19585
19657
|
FileSessionStorage,
|
|
19658
|
+
HooksService3 as HooksService,
|
|
19586
19659
|
KVService3 as KVService,
|
|
19587
19660
|
MemorySessionStorage,
|
|
19588
19661
|
NodeUserAuthorization,
|