windmill-components 1.444.1 → 1.444.2

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.
@@ -10,7 +10,7 @@ import { Highlight } from 'svelte-highlight';
10
10
  import { typescript } from 'svelte-highlight/languages';
11
11
  import ClipboardPanel from '../details/ClipboardPanel.svelte';
12
12
  import { copyToClipboard } from '../../utils';
13
- import { page } from '$app/stores';
13
+ // import { page } from '$app/stores'
14
14
  import { base } from '../../base';
15
15
  import TriggerTokens from './TriggerTokens.svelte';
16
16
  import { workspaceStore, userStore } from '../../stores';
@@ -35,7 +35,7 @@ let userSettings;
35
35
  let url = '';
36
36
  $: webhooks = isFlow ? computeFlowWebhooks(path) : computeScriptWebhooks(hash, path);
37
37
  function computeScriptWebhooks(hash, path) {
38
- let webhookBase = `${$page.url.origin}${base}/api/w/${$workspaceStore}/jobs`;
38
+ let webhookBase = `${location.origin}${base}/api/w/${$workspaceStore}/jobs`;
39
39
  return {
40
40
  async: {
41
41
  hash: `${webhookBase}/run/h/${hash}`,
@@ -49,7 +49,7 @@ function computeScriptWebhooks(hash, path) {
49
49
  };
50
50
  }
51
51
  function computeFlowWebhooks(path) {
52
- let webhooksBase = `${$page.url.origin}${base}/api/w/${$workspaceStore}/jobs`;
52
+ let webhooksBase = `${location.origin}${base}/api/w/${$workspaceStore}/jobs`;
53
53
  let urlAsync = `${webhooksBase}/run/f/${path}`;
54
54
  let urlSync = `${webhooksBase}/run_wait_result/f/${path}`;
55
55
  return {
@@ -124,7 +124,7 @@ async function triggerJob() {
124
124
  function waitForJobCompletion(UUID) {
125
125
  return new Promise(async (resolve, reject) => {
126
126
  try {
127
- const endpoint = \`${$page.url.origin}/api/w/${$workspaceStore}/jobs_u/completed/get_result_maybe/\${UUID}\`;
127
+ const endpoint = \`${location.origin}/api/w/${$workspaceStore}/jobs_u/completed/get_result_maybe/\${UUID}\`;
128
128
  const checkResponse = await fetch(endpoint, {
129
129
  method: 'GET',
130
130
  headers: ${JSON.stringify(headers(), null, 2).replaceAll('\n', '\n\t\t\t\t')}
@@ -149,7 +149,7 @@ function waitForJobCompletion(UUID) {
149
149
  // Combine and return
150
150
  return `${mainFunction}\n\n${triggerJobFunction}\n\n${waitForJobCompletionFunction}`;
151
151
  }
152
- let captureUrl = `${$page.url.origin}/api/w/${$workspaceStore}/capture_u/webhook/${isFlow ? 'flow' : 'script'}/${path}`;
152
+ let captureUrl = `${location.origin}/api/w/${$workspaceStore}/capture_u/webhook/${isFlow ? 'flow' : 'script'}/${path}`;
153
153
  function captureCurlCode() {
154
154
  return `curl \\
155
155
  -X POST ${captureUrl} \\
@@ -165,7 +165,7 @@ ${webhookType === 'sync' ? 'RESULT' : 'UUID'}=$(curl -s ${requestType != 'get_pa
165
165
  ${webhookType === 'sync'
166
166
  ? 'echo -E $RESULT | jq'
167
167
  : `
168
- URL="${$page.url.origin}/api/w/${$workspaceStore}/jobs_u/completed/get_result_maybe/$UUID"
168
+ URL="${location.origin}/api/w/${$workspaceStore}/jobs_u/completed/get_result_maybe/$UUID"
169
169
  while true; do
170
170
  curl -s -H "Authorization: Bearer $TOKEN" $URL -o res.json
171
171
  COMPLETED=$(cat res.json | jq .completed)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "windmill-components",
3
- "version": "1.444.1",
3
+ "version": "1.444.2",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build",