@tinycloud/sdk-core 2.0.4-beta.0 → 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/index.cjs +20 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -2
- package/dist/index.d.ts +13 -2
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -33,6 +33,7 @@ __export(index_exports, {
|
|
|
33
33
|
DuckDbService: () => import_sdk_services4.DuckDbService,
|
|
34
34
|
EnsDataSchema: () => EnsDataSchema,
|
|
35
35
|
ErrorCodes: () => import_sdk_services4.ErrorCodes,
|
|
36
|
+
HooksService: () => import_sdk_services4.HooksService,
|
|
36
37
|
KVService: () => import_sdk_services4.KVService,
|
|
37
38
|
PrefixedKVService: () => import_sdk_services4.PrefixedKVService,
|
|
38
39
|
ProtocolMismatchError: () => ProtocolMismatchError,
|
|
@@ -1554,6 +1555,7 @@ var TinyCloud = class _TinyCloud {
|
|
|
1554
1555
|
}
|
|
1555
1556
|
this._serviceContext = new import_sdk_services2.ServiceContext({
|
|
1556
1557
|
invoke: effectiveInvoke,
|
|
1558
|
+
invokeAny: this.config.invokeAny,
|
|
1557
1559
|
fetch: fetchFn ?? this.config.fetch ?? globalThis.fetch.bind(globalThis),
|
|
1558
1560
|
hosts: effectiveHosts,
|
|
1559
1561
|
retryPolicy: this.config.retryPolicy
|
|
@@ -1562,6 +1564,7 @@ var TinyCloud = class _TinyCloud {
|
|
|
1562
1564
|
kv: import_sdk_services2.KVService,
|
|
1563
1565
|
sql: import_sdk_services2.SQLService,
|
|
1564
1566
|
duckdb: import_sdk_services2.DuckDbService,
|
|
1567
|
+
hooks: import_sdk_services2.HooksService,
|
|
1565
1568
|
...this.config.services
|
|
1566
1569
|
};
|
|
1567
1570
|
for (const [name, ServiceClass] of Object.entries(serviceConstructors)) {
|
|
@@ -1642,6 +1645,22 @@ var TinyCloud = class _TinyCloud {
|
|
|
1642
1645
|
}
|
|
1643
1646
|
return service;
|
|
1644
1647
|
}
|
|
1648
|
+
/**
|
|
1649
|
+
* Get the Hooks service.
|
|
1650
|
+
* @throws Error if services are not initialized
|
|
1651
|
+
*/
|
|
1652
|
+
get hooks() {
|
|
1653
|
+
if (!this._servicesInitialized) {
|
|
1654
|
+
throw new Error(
|
|
1655
|
+
"Services not initialized. Call initializeServices() first, or use TinyCloudWeb/TinyCloudNode which handles this automatically."
|
|
1656
|
+
);
|
|
1657
|
+
}
|
|
1658
|
+
const service = this._services.get("hooks");
|
|
1659
|
+
if (!service) {
|
|
1660
|
+
throw new Error("Hooks service is not registered.");
|
|
1661
|
+
}
|
|
1662
|
+
return service;
|
|
1663
|
+
}
|
|
1645
1664
|
/**
|
|
1646
1665
|
* Get the Data Vault service.
|
|
1647
1666
|
* @throws Error if services are not initialized or vault service is not registered
|
|
@@ -3775,6 +3794,7 @@ async function checkNodeInfo(host, sdkProtocol, fetchFn = globalThis.fetch.bind(
|
|
|
3775
3794
|
DuckDbService,
|
|
3776
3795
|
EnsDataSchema,
|
|
3777
3796
|
ErrorCodes,
|
|
3797
|
+
HooksService,
|
|
3778
3798
|
KVService,
|
|
3779
3799
|
PrefixedKVService,
|
|
3780
3800
|
ProtocolMismatchError,
|