zitejs 0.9.36 → 0.9.39
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/cjs/api/index.js +5 -0
- package/dist/cjs/bundle/index.js +8 -1
- package/dist/cjs/db/index.js +5 -0
- package/dist/cjs/runtime/index.js +2 -2
- package/dist/esm/api/index.d.ts +2 -0
- package/dist/esm/api/index.js +1 -0
- package/dist/esm/bundle/index.js +8 -1
- package/dist/esm/cli.js +0 -0
- package/dist/esm/db/index.d.ts +2 -0
- package/dist/esm/db/index.js +1 -0
- package/dist/esm/runtime/index.d.ts +6 -2
- package/dist/esm/runtime/index.js +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createCaller = void 0;
|
|
4
|
+
var index_js_1 = require("../caller/index.js");
|
|
5
|
+
Object.defineProperty(exports, "createCaller", { enumerable: true, get: function () { return index_js_1.createCaller; } });
|
package/dist/cjs/bundle/index.js
CHANGED
|
@@ -406,7 +406,14 @@ async function bundleOneOffScriptImpl(scriptPath, sdkPath) {
|
|
|
406
406
|
}
|
|
407
407
|
}
|
|
408
408
|
catch { }
|
|
409
|
-
|
|
409
|
+
// Initialize the worker runtime (sets globalThis.__wrapSdkCall) like the
|
|
410
|
+
// endpoint wrapper does — otherwise createTableClient/createSqlClient from
|
|
411
|
+
// zitejs/db throw "Zite SDK runtime not initialized" at the worker.
|
|
412
|
+
const runtimeInit = `import { __wrapSdkCall, initRuntime } from '@zite/endpoints-runtime-sdk';
|
|
413
|
+
globalThis.__wrapSdkCall = __wrapSdkCall;
|
|
414
|
+
initRuntime();`;
|
|
415
|
+
const wrappedScript = `${runtimeInit}
|
|
416
|
+
${importSection}
|
|
410
417
|
export async function execute() {
|
|
411
418
|
${bodySection}
|
|
412
419
|
}`;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createTableClient = void 0;
|
|
4
|
+
var index_js_1 = require("../runtime/index.js");
|
|
5
|
+
Object.defineProperty(exports, "createTableClient", { enumerable: true, get: function () { return index_js_1.createTableClient; } });
|
|
@@ -50,13 +50,13 @@ function createTableClient(className) {
|
|
|
50
50
|
create: (data) => getSdkCall()(DB_INTEGRATION_ID, className, "create", {
|
|
51
51
|
baseId: getBaseId(),
|
|
52
52
|
tableId: resolveTableId(className),
|
|
53
|
-
|
|
53
|
+
...data,
|
|
54
54
|
}),
|
|
55
55
|
update: (id, data) => getSdkCall()(DB_INTEGRATION_ID, className, "update", {
|
|
56
56
|
baseId: getBaseId(),
|
|
57
57
|
tableId: resolveTableId(className),
|
|
58
58
|
id,
|
|
59
|
-
|
|
59
|
+
...data,
|
|
60
60
|
}),
|
|
61
61
|
delete: (id) => getSdkCall()(DB_INTEGRATION_ID, className, "delete", {
|
|
62
62
|
baseId: getBaseId(),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createCaller } from '../caller/index.js';
|
package/dist/esm/bundle/index.js
CHANGED
|
@@ -370,7 +370,14 @@ async function bundleOneOffScriptImpl(scriptPath, sdkPath) {
|
|
|
370
370
|
}
|
|
371
371
|
}
|
|
372
372
|
catch { }
|
|
373
|
-
|
|
373
|
+
// Initialize the worker runtime (sets globalThis.__wrapSdkCall) like the
|
|
374
|
+
// endpoint wrapper does — otherwise createTableClient/createSqlClient from
|
|
375
|
+
// zitejs/db throw "Zite SDK runtime not initialized" at the worker.
|
|
376
|
+
const runtimeInit = `import { __wrapSdkCall, initRuntime } from '@zite/endpoints-runtime-sdk';
|
|
377
|
+
globalThis.__wrapSdkCall = __wrapSdkCall;
|
|
378
|
+
initRuntime();`;
|
|
379
|
+
const wrappedScript = `${runtimeInit}
|
|
380
|
+
${importSection}
|
|
374
381
|
export async function execute() {
|
|
375
382
|
${bodySection}
|
|
376
383
|
}`;
|
package/dist/esm/cli.js
CHANGED
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createTableClient } from '../runtime/index.js';
|
|
@@ -14,8 +14,12 @@ export interface TableClient<T> {
|
|
|
14
14
|
filters?: unknown;
|
|
15
15
|
filter?: unknown;
|
|
16
16
|
}): Promise<T>;
|
|
17
|
-
create(data:
|
|
18
|
-
|
|
17
|
+
create(data: {
|
|
18
|
+
record: Partial<T>;
|
|
19
|
+
}): Promise<T>;
|
|
20
|
+
update(id: string, data: {
|
|
21
|
+
record: Partial<T>;
|
|
22
|
+
}): Promise<T>;
|
|
19
23
|
delete(id: string): Promise<{
|
|
20
24
|
deleted: true;
|
|
21
25
|
}>;
|
|
@@ -45,13 +45,13 @@ export function createTableClient(className) {
|
|
|
45
45
|
create: (data) => getSdkCall()(DB_INTEGRATION_ID, className, "create", {
|
|
46
46
|
baseId: getBaseId(),
|
|
47
47
|
tableId: resolveTableId(className),
|
|
48
|
-
|
|
48
|
+
...data,
|
|
49
49
|
}),
|
|
50
50
|
update: (id, data) => getSdkCall()(DB_INTEGRATION_ID, className, "update", {
|
|
51
51
|
baseId: getBaseId(),
|
|
52
52
|
tableId: resolveTableId(className),
|
|
53
53
|
id,
|
|
54
|
-
|
|
54
|
+
...data,
|
|
55
55
|
}),
|
|
56
56
|
delete: (id) => getSdkCall()(DB_INTEGRATION_ID, className, "delete", {
|
|
57
57
|
baseId: getBaseId(),
|