zitejs 0.9.56 → 0.9.57
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/caller/index.js +14 -1
- package/dist/cjs/db/index.js +5 -0
- package/dist/esm/api/index.d.ts +2 -0
- package/dist/esm/api/index.js +1 -0
- package/dist/esm/caller/index.js +14 -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/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/caller/index.js
CHANGED
|
@@ -3,6 +3,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createCaller = createCaller;
|
|
4
4
|
exports.createStreamingCaller = createStreamingCaller;
|
|
5
5
|
const env_js_1 = require("../internal/env.js");
|
|
6
|
+
function getMode() {
|
|
7
|
+
if (typeof window === "undefined")
|
|
8
|
+
return "preview";
|
|
9
|
+
const host = window.location.host;
|
|
10
|
+
return host.startsWith("zite-editor") ||
|
|
11
|
+
host.startsWith("zite-action-") ||
|
|
12
|
+
host.endsWith(".zite-dev-sandbox.com") ||
|
|
13
|
+
host.endsWith(".zite-sandbox.com") ||
|
|
14
|
+
host.endsWith(".zite-dev-app.com") ||
|
|
15
|
+
host.endsWith(".zite-app.com")
|
|
16
|
+
? "preview"
|
|
17
|
+
: "live";
|
|
18
|
+
}
|
|
6
19
|
const ENVIRONMENTS = {
|
|
7
20
|
production: "https://workflows.zite.com",
|
|
8
21
|
staging: "https://workflows.zitestaging.com",
|
|
@@ -49,7 +62,7 @@ function buildFetchOptions(name, input, extra) {
|
|
|
49
62
|
},
|
|
50
63
|
body: JSON.stringify({
|
|
51
64
|
inputs: input,
|
|
52
|
-
mode:
|
|
65
|
+
mode: getMode(),
|
|
53
66
|
usageToken: token,
|
|
54
67
|
...(ziteAuthToken ? { ziteAuthToken } : {}),
|
|
55
68
|
...extra,
|
|
@@ -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; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createCaller } from '../caller/index.js';
|
package/dist/esm/caller/index.js
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
import { getEnv } from "../internal/env.js";
|
|
2
|
+
function getMode() {
|
|
3
|
+
if (typeof window === "undefined")
|
|
4
|
+
return "preview";
|
|
5
|
+
const host = window.location.host;
|
|
6
|
+
return host.startsWith("zite-editor") ||
|
|
7
|
+
host.startsWith("zite-action-") ||
|
|
8
|
+
host.endsWith(".zite-dev-sandbox.com") ||
|
|
9
|
+
host.endsWith(".zite-sandbox.com") ||
|
|
10
|
+
host.endsWith(".zite-dev-app.com") ||
|
|
11
|
+
host.endsWith(".zite-app.com")
|
|
12
|
+
? "preview"
|
|
13
|
+
: "live";
|
|
14
|
+
}
|
|
2
15
|
const ENVIRONMENTS = {
|
|
3
16
|
production: "https://workflows.zite.com",
|
|
4
17
|
staging: "https://workflows.zitestaging.com",
|
|
@@ -45,7 +58,7 @@ function buildFetchOptions(name, input, extra) {
|
|
|
45
58
|
},
|
|
46
59
|
body: JSON.stringify({
|
|
47
60
|
inputs: input,
|
|
48
|
-
mode:
|
|
61
|
+
mode: getMode(),
|
|
49
62
|
usageToken: token,
|
|
50
63
|
...(ziteAuthToken ? { ziteAuthToken } : {}),
|
|
51
64
|
...extra,
|
package/dist/esm/cli.js
CHANGED
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createTableClient } from '../runtime/index.js';
|