@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/core.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ISessionStorage, PersistedSessionData, AutoSignStrategy, AutoRejectStrategy, CallbackStrategy, IUserAuthorization, ISigner, ISpaceCreationHandler, IWasmBindings, SiweConfig, ClientSession, TinyCloudSession, Extension, Delegation, IKVService, ISQLService, IDuckDbService, INotificationHandler, IENSResolver, IDataVaultService, ICapabilityKeyRegistry, DelegationManager, ISpaceService, ISharingService, CreateDelegationParams, DelegationResult, KeyProvider, ISessionManager, JWK } from '@tinycloud/sdk-core';
|
|
1
|
+
import { ISessionStorage, PersistedSessionData, AutoSignStrategy, AutoRejectStrategy, CallbackStrategy, IUserAuthorization, ISigner, ISpaceCreationHandler, IWasmBindings, SiweConfig, ClientSession, TinyCloudSession, Extension, Delegation, IKVService, ISQLService, IDuckDbService, IHooksService, INotificationHandler, IENSResolver, IDataVaultService, ICapabilityKeyRegistry, DelegationManager, ISpaceService, ISharingService, CreateDelegationParams, DelegationResult, KeyProvider, ISessionManager, JWK } from '@tinycloud/sdk-core';
|
|
2
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';
|
|
3
3
|
import { EventEmitter } from 'events';
|
|
4
4
|
import { InvokeFunction } from '@tinycloud/sdk-services';
|
|
@@ -444,6 +444,7 @@ declare class DelegatedAccess {
|
|
|
444
444
|
private _kv;
|
|
445
445
|
private _sql;
|
|
446
446
|
private _duckdb;
|
|
447
|
+
private _hooks;
|
|
447
448
|
constructor(session: TinyCloudSession, delegation: PortableDelegation, host: string, invoke: InvokeFunction);
|
|
448
449
|
/**
|
|
449
450
|
* Get the delegation this access was created from.
|
|
@@ -469,6 +470,10 @@ declare class DelegatedAccess {
|
|
|
469
470
|
* DuckDB operations on the delegated space.
|
|
470
471
|
*/
|
|
471
472
|
get duckdb(): IDuckDbService;
|
|
473
|
+
/**
|
|
474
|
+
* Hooks write-stream subscriptions on the delegated space.
|
|
475
|
+
*/
|
|
476
|
+
get hooks(): IHooksService;
|
|
472
477
|
}
|
|
473
478
|
|
|
474
479
|
/**
|
|
@@ -573,6 +578,7 @@ declare class TinyCloudNode {
|
|
|
573
578
|
private _kv?;
|
|
574
579
|
private _sql?;
|
|
575
580
|
private _duckdb?;
|
|
581
|
+
private _hooks?;
|
|
576
582
|
private _vault?;
|
|
577
583
|
/** Cached public KV with proper delegation (set by ensurePublicSpace) */
|
|
578
584
|
private _publicKV?;
|
|
@@ -776,6 +782,10 @@ declare class TinyCloudNode {
|
|
|
776
782
|
* Call `vault.unlock(signer)` after signIn() to derive encryption keys.
|
|
777
783
|
*/
|
|
778
784
|
get vault(): IDataVaultService;
|
|
785
|
+
/**
|
|
786
|
+
* Hooks write stream subscription API.
|
|
787
|
+
*/
|
|
788
|
+
get hooks(): IHooksService;
|
|
779
789
|
/**
|
|
780
790
|
* Get the CapabilityKeyRegistry for managing keys and their capabilities.
|
|
781
791
|
*
|
package/dist/core.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ISessionStorage, PersistedSessionData, AutoSignStrategy, AutoRejectStrategy, CallbackStrategy, IUserAuthorization, ISigner, ISpaceCreationHandler, IWasmBindings, SiweConfig, ClientSession, TinyCloudSession, Extension, Delegation, IKVService, ISQLService, IDuckDbService, INotificationHandler, IENSResolver, IDataVaultService, ICapabilityKeyRegistry, DelegationManager, ISpaceService, ISharingService, CreateDelegationParams, DelegationResult, KeyProvider, ISessionManager, JWK } from '@tinycloud/sdk-core';
|
|
1
|
+
import { ISessionStorage, PersistedSessionData, AutoSignStrategy, AutoRejectStrategy, CallbackStrategy, IUserAuthorization, ISigner, ISpaceCreationHandler, IWasmBindings, SiweConfig, ClientSession, TinyCloudSession, Extension, Delegation, IKVService, ISQLService, IDuckDbService, IHooksService, INotificationHandler, IENSResolver, IDataVaultService, ICapabilityKeyRegistry, DelegationManager, ISpaceService, ISharingService, CreateDelegationParams, DelegationResult, KeyProvider, ISessionManager, JWK } from '@tinycloud/sdk-core';
|
|
2
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';
|
|
3
3
|
import { EventEmitter } from 'events';
|
|
4
4
|
import { InvokeFunction } from '@tinycloud/sdk-services';
|
|
@@ -444,6 +444,7 @@ declare class DelegatedAccess {
|
|
|
444
444
|
private _kv;
|
|
445
445
|
private _sql;
|
|
446
446
|
private _duckdb;
|
|
447
|
+
private _hooks;
|
|
447
448
|
constructor(session: TinyCloudSession, delegation: PortableDelegation, host: string, invoke: InvokeFunction);
|
|
448
449
|
/**
|
|
449
450
|
* Get the delegation this access was created from.
|
|
@@ -469,6 +470,10 @@ declare class DelegatedAccess {
|
|
|
469
470
|
* DuckDB operations on the delegated space.
|
|
470
471
|
*/
|
|
471
472
|
get duckdb(): IDuckDbService;
|
|
473
|
+
/**
|
|
474
|
+
* Hooks write-stream subscriptions on the delegated space.
|
|
475
|
+
*/
|
|
476
|
+
get hooks(): IHooksService;
|
|
472
477
|
}
|
|
473
478
|
|
|
474
479
|
/**
|
|
@@ -573,6 +578,7 @@ declare class TinyCloudNode {
|
|
|
573
578
|
private _kv?;
|
|
574
579
|
private _sql?;
|
|
575
580
|
private _duckdb?;
|
|
581
|
+
private _hooks?;
|
|
576
582
|
private _vault?;
|
|
577
583
|
/** Cached public KV with proper delegation (set by ensurePublicSpace) */
|
|
578
584
|
private _publicKV?;
|
|
@@ -776,6 +782,10 @@ declare class TinyCloudNode {
|
|
|
776
782
|
* Call `vault.unlock(signer)` after signIn() to derive encryption keys.
|
|
777
783
|
*/
|
|
778
784
|
get vault(): IDataVaultService;
|
|
785
|
+
/**
|
|
786
|
+
* Hooks write stream subscription API.
|
|
787
|
+
*/
|
|
788
|
+
get hooks(): IHooksService;
|
|
779
789
|
/**
|
|
780
790
|
* Get the CapabilityKeyRegistry for managing keys and their capabilities.
|
|
781
791
|
*
|
package/dist/core.js
CHANGED
|
@@ -253,12 +253,22 @@ var NodeUserAuthorization = class {
|
|
|
253
253
|
},
|
|
254
254
|
capabilities: {
|
|
255
255
|
"": ["tinycloud.capabilities/read"]
|
|
256
|
+
},
|
|
257
|
+
hooks: {
|
|
258
|
+
"": [
|
|
259
|
+
"tinycloud.hooks/subscribe",
|
|
260
|
+
"tinycloud.hooks/register",
|
|
261
|
+
"tinycloud.hooks/list",
|
|
262
|
+
"tinycloud.hooks/unregister"
|
|
263
|
+
]
|
|
256
264
|
}
|
|
257
265
|
};
|
|
258
266
|
this.sessionExpirationMs = config.sessionExpirationMs ?? 60 * 60 * 1e3;
|
|
259
267
|
this.autoCreateSpace = config.autoCreateSpace ?? false;
|
|
260
268
|
this.spaceCreationHandler = config.spaceCreationHandler;
|
|
261
|
-
this.tinycloudHosts = config.tinycloudHosts ?? [
|
|
269
|
+
this.tinycloudHosts = config.tinycloudHosts ?? [
|
|
270
|
+
"https://node.tinycloud.xyz"
|
|
271
|
+
];
|
|
262
272
|
this.enablePublicSpace = config.enablePublicSpace ?? true;
|
|
263
273
|
this.nonce = config.nonce;
|
|
264
274
|
this.siweConfig = config.siweConfig;
|
|
@@ -398,7 +408,10 @@ var NodeUserAuthorization = class {
|
|
|
398
408
|
throw err;
|
|
399
409
|
}
|
|
400
410
|
} catch (error) {
|
|
401
|
-
handler.onSpaceCreationFailed?.(
|
|
411
|
+
handler.onSpaceCreationFailed?.(
|
|
412
|
+
creationContext,
|
|
413
|
+
error instanceof Error ? error : new Error(String(error))
|
|
414
|
+
);
|
|
402
415
|
throw error;
|
|
403
416
|
}
|
|
404
417
|
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
@@ -432,7 +445,10 @@ var NodeUserAuthorization = class {
|
|
|
432
445
|
throw err;
|
|
433
446
|
}
|
|
434
447
|
} catch (error) {
|
|
435
|
-
handler.onSpaceCreationFailed?.(
|
|
448
|
+
handler.onSpaceCreationFailed?.(
|
|
449
|
+
creationContext,
|
|
450
|
+
error instanceof Error ? error : new Error(String(error))
|
|
451
|
+
);
|
|
436
452
|
throw error;
|
|
437
453
|
}
|
|
438
454
|
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
@@ -541,7 +557,10 @@ var NodeUserAuthorization = class {
|
|
|
541
557
|
this._tinyCloudSession = tinyCloudSession;
|
|
542
558
|
this._address = address;
|
|
543
559
|
this._chainId = chainId;
|
|
544
|
-
const nodeInfo = await checkNodeInfo(
|
|
560
|
+
const nodeInfo = await checkNodeInfo(
|
|
561
|
+
this.tinycloudHosts[0],
|
|
562
|
+
this.wasm.protocolVersion()
|
|
563
|
+
);
|
|
545
564
|
this._nodeFeatures = nodeInfo.features;
|
|
546
565
|
for (const ext of this.extensions) {
|
|
547
566
|
if (ext.afterSignIn) {
|
|
@@ -701,7 +720,10 @@ var NodeUserAuthorization = class {
|
|
|
701
720
|
this._tinyCloudSession = tinyCloudSession;
|
|
702
721
|
this._address = address;
|
|
703
722
|
this._chainId = chainId;
|
|
704
|
-
const nodeInfo = await checkNodeInfo(
|
|
723
|
+
const nodeInfo = await checkNodeInfo(
|
|
724
|
+
this.tinycloudHosts[0],
|
|
725
|
+
this.wasm.protocolVersion()
|
|
726
|
+
);
|
|
705
727
|
this._nodeFeatures = nodeInfo.features;
|
|
706
728
|
for (const ext of this.extensions) {
|
|
707
729
|
if (ext.afterSignIn) {
|
|
@@ -752,7 +774,9 @@ var NodeUserAuthorization = class {
|
|
|
752
774
|
);
|
|
753
775
|
}
|
|
754
776
|
default:
|
|
755
|
-
throw new Error(
|
|
777
|
+
throw new Error(
|
|
778
|
+
`Unknown sign strategy: ${this.signStrategy.type}`
|
|
779
|
+
);
|
|
756
780
|
}
|
|
757
781
|
}
|
|
758
782
|
/**
|
|
@@ -786,6 +810,7 @@ import {
|
|
|
786
810
|
KVService as KVService2,
|
|
787
811
|
SQLService as SQLService2,
|
|
788
812
|
DuckDbService as DuckDbService2,
|
|
813
|
+
HooksService as HooksService2,
|
|
789
814
|
DataVaultService,
|
|
790
815
|
createVaultCrypto,
|
|
791
816
|
ServiceContext as ServiceContext2,
|
|
@@ -801,6 +826,7 @@ import {
|
|
|
801
826
|
// src/DelegatedAccess.ts
|
|
802
827
|
import {
|
|
803
828
|
KVService,
|
|
829
|
+
HooksService,
|
|
804
830
|
SQLService,
|
|
805
831
|
DuckDbService,
|
|
806
832
|
ServiceContext
|
|
@@ -825,6 +851,9 @@ var DelegatedAccess = class {
|
|
|
825
851
|
this._duckdb = new DuckDbService({});
|
|
826
852
|
this._duckdb.initialize(this._serviceContext);
|
|
827
853
|
this._serviceContext.registerService("duckdb", this._duckdb);
|
|
854
|
+
this._hooks = new HooksService({});
|
|
855
|
+
this._hooks.initialize(this._serviceContext);
|
|
856
|
+
this._serviceContext.registerService("hooks", this._hooks);
|
|
828
857
|
const serviceSession = {
|
|
829
858
|
delegationHeader: session.delegationHeader,
|
|
830
859
|
delegationCid: session.delegationCid,
|
|
@@ -870,6 +899,12 @@ var DelegatedAccess = class {
|
|
|
870
899
|
get duckdb() {
|
|
871
900
|
return this._duckdb;
|
|
872
901
|
}
|
|
902
|
+
/**
|
|
903
|
+
* Hooks write-stream subscriptions on the delegated space.
|
|
904
|
+
*/
|
|
905
|
+
get hooks() {
|
|
906
|
+
return this._hooks;
|
|
907
|
+
}
|
|
873
908
|
};
|
|
874
909
|
|
|
875
910
|
// src/keys/WasmKeyProvider.ts
|
|
@@ -1075,7 +1110,9 @@ var TinyCloudNode = class _TinyCloudNode {
|
|
|
1075
1110
|
nonce: config.nonce,
|
|
1076
1111
|
siweConfig: config.siweConfig
|
|
1077
1112
|
});
|
|
1078
|
-
this.tc = new TinyCloud(this.auth
|
|
1113
|
+
this.tc = new TinyCloud(this.auth, {
|
|
1114
|
+
invokeAny: this.wasmBindings.invokeAny
|
|
1115
|
+
});
|
|
1079
1116
|
}
|
|
1080
1117
|
/**
|
|
1081
1118
|
* Get the primary identity DID for this user.
|
|
@@ -1144,6 +1181,7 @@ var TinyCloudNode = class _TinyCloudNode {
|
|
|
1144
1181
|
this._kv = void 0;
|
|
1145
1182
|
this._sql = void 0;
|
|
1146
1183
|
this._duckdb = void 0;
|
|
1184
|
+
this._hooks = void 0;
|
|
1147
1185
|
this._serviceContext = void 0;
|
|
1148
1186
|
await this.tc.signIn();
|
|
1149
1187
|
this.initializeServices();
|
|
@@ -1163,6 +1201,7 @@ var TinyCloudNode = class _TinyCloudNode {
|
|
|
1163
1201
|
this._kv = void 0;
|
|
1164
1202
|
this._sql = void 0;
|
|
1165
1203
|
this._duckdb = void 0;
|
|
1204
|
+
this._hooks = void 0;
|
|
1166
1205
|
this._serviceContext = void 0;
|
|
1167
1206
|
if (sessionData.address) {
|
|
1168
1207
|
this._address = sessionData.address;
|
|
@@ -1172,6 +1211,7 @@ var TinyCloudNode = class _TinyCloudNode {
|
|
|
1172
1211
|
}
|
|
1173
1212
|
this._serviceContext = new ServiceContext2({
|
|
1174
1213
|
invoke: this.wasmBindings.invoke,
|
|
1214
|
+
invokeAny: this.wasmBindings.invokeAny,
|
|
1175
1215
|
fetch: globalThis.fetch.bind(globalThis),
|
|
1176
1216
|
hosts: [this.config.host]
|
|
1177
1217
|
});
|
|
@@ -1184,6 +1224,9 @@ var TinyCloudNode = class _TinyCloudNode {
|
|
|
1184
1224
|
this._duckdb = new DuckDbService2({});
|
|
1185
1225
|
this._duckdb.initialize(this._serviceContext);
|
|
1186
1226
|
this._serviceContext.registerService("duckdb", this._duckdb);
|
|
1227
|
+
this._hooks = new HooksService2({});
|
|
1228
|
+
this._hooks.initialize(this._serviceContext);
|
|
1229
|
+
this._serviceContext.registerService("hooks", this._hooks);
|
|
1187
1230
|
const serviceSession = {
|
|
1188
1231
|
delegationHeader: sessionData.delegationHeader,
|
|
1189
1232
|
delegationCid: sessionData.delegationCid,
|
|
@@ -1283,7 +1326,9 @@ var TinyCloudNode = class _TinyCloudNode {
|
|
|
1283
1326
|
nonce: this.config.nonce,
|
|
1284
1327
|
siweConfig: this.config.siweConfig
|
|
1285
1328
|
});
|
|
1286
|
-
this.tc = new TinyCloud(this.auth
|
|
1329
|
+
this.tc = new TinyCloud(this.auth, {
|
|
1330
|
+
invokeAny: this.wasmBindings.invokeAny
|
|
1331
|
+
});
|
|
1287
1332
|
this.config.prefix = prefix;
|
|
1288
1333
|
}
|
|
1289
1334
|
/**
|
|
@@ -1321,7 +1366,9 @@ var TinyCloudNode = class _TinyCloudNode {
|
|
|
1321
1366
|
nonce: this.config.nonce,
|
|
1322
1367
|
siweConfig: this.config.siweConfig
|
|
1323
1368
|
});
|
|
1324
|
-
this.tc = new TinyCloud(this.auth
|
|
1369
|
+
this.tc = new TinyCloud(this.auth, {
|
|
1370
|
+
invokeAny: this.wasmBindings.invokeAny
|
|
1371
|
+
});
|
|
1325
1372
|
this.config.prefix = prefix;
|
|
1326
1373
|
}
|
|
1327
1374
|
/**
|
|
@@ -1336,6 +1383,7 @@ var TinyCloudNode = class _TinyCloudNode {
|
|
|
1336
1383
|
this.tc.initializeServices(this.wasmBindings.invoke, [this.config.host]);
|
|
1337
1384
|
this._serviceContext = new ServiceContext2({
|
|
1338
1385
|
invoke: this.wasmBindings.invoke,
|
|
1386
|
+
invokeAny: this.wasmBindings.invokeAny,
|
|
1339
1387
|
fetch: globalThis.fetch.bind(globalThis),
|
|
1340
1388
|
hosts: [this.config.host]
|
|
1341
1389
|
});
|
|
@@ -1353,6 +1401,9 @@ var TinyCloudNode = class _TinyCloudNode {
|
|
|
1353
1401
|
this._duckdb.initialize(this._serviceContext);
|
|
1354
1402
|
this._serviceContext.registerService("duckdb", this._duckdb);
|
|
1355
1403
|
}
|
|
1404
|
+
this._hooks = new HooksService2({});
|
|
1405
|
+
this._hooks.initialize(this._serviceContext);
|
|
1406
|
+
this._serviceContext.registerService("hooks", this._hooks);
|
|
1356
1407
|
const serviceSession = {
|
|
1357
1408
|
delegationHeader: session.delegationHeader,
|
|
1358
1409
|
delegationCid: session.delegationCid,
|
|
@@ -1731,6 +1782,15 @@ var TinyCloudNode = class _TinyCloudNode {
|
|
|
1731
1782
|
}
|
|
1732
1783
|
return this._vault;
|
|
1733
1784
|
}
|
|
1785
|
+
/**
|
|
1786
|
+
* Hooks write stream subscription API.
|
|
1787
|
+
*/
|
|
1788
|
+
get hooks() {
|
|
1789
|
+
if (!this._hooks) {
|
|
1790
|
+
throw new Error("Not signed in. Call signIn() first.");
|
|
1791
|
+
}
|
|
1792
|
+
return this._hooks;
|
|
1793
|
+
}
|
|
1734
1794
|
// ===========================================================================
|
|
1735
1795
|
// v2 Service Accessors
|
|
1736
1796
|
// ===========================================================================
|