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.
@@ -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; } });
@@ -406,7 +406,14 @@ async function bundleOneOffScriptImpl(scriptPath, sdkPath) {
406
406
  }
407
407
  }
408
408
  catch { }
409
- const wrappedScript = `${importSection}
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
- record: data,
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
- record: data,
59
+ ...data,
60
60
  }),
61
61
  delete: (id) => getSdkCall()(DB_INTEGRATION_ID, className, "delete", {
62
62
  baseId: getBaseId(),
@@ -0,0 +1,2 @@
1
+ export { createCaller } from '../caller/index.js';
2
+ export type { EndpointConfig } from '../caller/index.js';
@@ -0,0 +1 @@
1
+ export { createCaller } from '../caller/index.js';
@@ -370,7 +370,14 @@ async function bundleOneOffScriptImpl(scriptPath, sdkPath) {
370
370
  }
371
371
  }
372
372
  catch { }
373
- const wrappedScript = `${importSection}
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,2 @@
1
+ export { createTableClient } from '../runtime/index.js';
2
+ export type { TableClient } from '../runtime/index.js';
@@ -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: Partial<T>): Promise<T>;
18
- update(id: string, data: Partial<T>): Promise<T>;
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
- record: data,
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
- record: data,
54
+ ...data,
55
55
  }),
56
56
  delete: (id) => getSdkCall()(DB_INTEGRATION_ID, className, "delete", {
57
57
  baseId: getBaseId(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zitejs",
3
- "version": "0.9.36",
3
+ "version": "0.9.39",
4
4
  "description": "The Zite framework — build apps on Zite Database",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/runtime/index.js",