zitejs 0.9.23 → 0.9.24

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.
@@ -9,11 +9,20 @@ const ENVIRONMENTS = {
9
9
  staging: 'https://workflows.zitestaging.com',
10
10
  local: 'http://localhost:2506',
11
11
  };
12
+ function getExecutionConfig() {
13
+ return globalThis.__ZITE_EXECUTION_CONFIG__;
14
+ }
12
15
  function getRunnerUrl() {
16
+ const config = getExecutionConfig();
17
+ if (config?.workflowRunnerUrl)
18
+ return config.workflowRunnerUrl;
13
19
  const env = (0, env_js_1.getEnv)('ZITE_ENV', 'VITE_ZITE_ENV') ?? 'production';
14
20
  return (0, env_js_1.getEnv)('ZITE_RUNNER_URL', 'VITE_ZITE_RUNNER_URL') ?? ENVIRONMENTS[env] ?? ENVIRONMENTS.production;
15
21
  }
16
22
  function getToken() {
23
+ const config = getExecutionConfig();
24
+ if (config?.token)
25
+ return config.token;
17
26
  return (0, env_js_1.getEnv)('ZITE_DB_TOKEN', 'VITE_ZITE_DB_TOKEN') ?? '';
18
27
  }
19
28
  async function wrapSdkCall(integrationId, className, methodName, params) {
@@ -4,11 +4,20 @@ const ENVIRONMENTS = {
4
4
  staging: 'https://workflows.zitestaging.com',
5
5
  local: 'http://localhost:2506',
6
6
  };
7
+ function getExecutionConfig() {
8
+ return globalThis.__ZITE_EXECUTION_CONFIG__;
9
+ }
7
10
  function getRunnerUrl() {
11
+ const config = getExecutionConfig();
12
+ if (config?.workflowRunnerUrl)
13
+ return config.workflowRunnerUrl;
8
14
  const env = getEnv('ZITE_ENV', 'VITE_ZITE_ENV') ?? 'production';
9
15
  return getEnv('ZITE_RUNNER_URL', 'VITE_ZITE_RUNNER_URL') ?? ENVIRONMENTS[env] ?? ENVIRONMENTS.production;
10
16
  }
11
17
  function getToken() {
18
+ const config = getExecutionConfig();
19
+ if (config?.token)
20
+ return config.token;
12
21
  return getEnv('ZITE_DB_TOKEN', 'VITE_ZITE_DB_TOKEN') ?? '';
13
22
  }
14
23
  export async function wrapSdkCall(integrationId, className, methodName, params) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zitejs",
3
- "version": "0.9.23",
3
+ "version": "0.9.24",
4
4
  "description": "The Zite framework — build apps on Zite Database",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/runtime/index.js",