orcheo-studio 0.24.3 → 0.24.4
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/.bumpversion.cfg +1 -1
- package/dist/assets/{arc-BnLNnEym.js → arc-99TH-Koz.js} +1 -1
- package/dist/assets/{architectureDiagram-VXUJARFQ-B8dIgVkK.js → architectureDiagram-VXUJARFQ-DugaTSY2.js} +1 -1
- package/dist/assets/{blockDiagram-VD42YOAC-BhDb_8Vg.js → blockDiagram-VD42YOAC-BH68wVtD.js} +1 -1
- package/dist/assets/{c4Diagram-YG6GDRKO-DxHEo9Fv.js → c4Diagram-YG6GDRKO-V6Vqtp7B.js} +1 -1
- package/dist/assets/channel-D562bZxL.js +1 -0
- package/dist/assets/{chunk-4BX2VUAB-DMBtc1td.js → chunk-4BX2VUAB-CvbCAMNv.js} +1 -1
- package/dist/assets/{chunk-55IACEB6-DMMV3uf8.js → chunk-55IACEB6-h_T3kQh7.js} +1 -1
- package/dist/assets/{chunk-B4BG7PRW-BVmjJQGD.js → chunk-B4BG7PRW-Dm6dgbGh.js} +1 -1
- package/dist/assets/{chunk-DI55MBZ5-3C02UFww.js → chunk-DI55MBZ5-DSXFA4Fi.js} +1 -1
- package/dist/assets/{chunk-FMBD7UC4-D-PvzEp6.js → chunk-FMBD7UC4-DJDlfjt1.js} +1 -1
- package/dist/assets/{chunk-QN33PNHL-BNp075o8.js → chunk-QN33PNHL-BnjUGeBL.js} +1 -1
- package/dist/assets/{chunk-QZHKN3VN-ChdFCxgk.js → chunk-QZHKN3VN-BRudOghZ.js} +1 -1
- package/dist/assets/{chunk-TZMSLE5B-DKr2kcEO.js → chunk-TZMSLE5B-CpxSpvqK.js} +1 -1
- package/dist/assets/classDiagram-2ON5EDUG-Dix_KnuM.js +1 -0
- package/dist/assets/classDiagram-v2-WZHVMYZB-Dix_KnuM.js +1 -0
- package/dist/assets/clone-0c2Tu-SH.js +1 -0
- package/dist/assets/{cose-bilkent-S5V4N54A-T8_HzNYG.js → cose-bilkent-S5V4N54A-Dl80WZ_a.js} +1 -1
- package/dist/assets/{dagre-6UL2VRFP-Chzqb9xS.js → dagre-6UL2VRFP-vw-vkw78.js} +1 -1
- package/dist/assets/{diagram-PSM6KHXK-CLiXfMfi.js → diagram-PSM6KHXK-B4MT5Nvf.js} +1 -1
- package/dist/assets/{diagram-QEK2KX5R-DYE_yT-r.js → diagram-QEK2KX5R-CMioZnRI.js} +1 -1
- package/dist/assets/{diagram-S2PKOQOG-B4LSPAmZ.js → diagram-S2PKOQOG-PJAE8YS0.js} +1 -1
- package/dist/assets/{erDiagram-Q2GNP2WA-D9fO0sd2.js → erDiagram-Q2GNP2WA-DCd-WouG.js} +1 -1
- package/dist/assets/{flowDiagram-NV44I4VS-BU7f4j4T.js → flowDiagram-NV44I4VS-DS__-WT4.js} +1 -1
- package/dist/assets/{ganttDiagram-JELNMOA3-BSvXqVC4.js → ganttDiagram-JELNMOA3-Btifh-31.js} +1 -1
- package/dist/assets/{gitGraphDiagram-V2S2FVAM-B6qztLiE.js → gitGraphDiagram-V2S2FVAM-BCyjopey.js} +1 -1
- package/dist/assets/{graph-CxstBGnL.js → graph-6YBx8iQ0.js} +1 -1
- package/dist/assets/{index-Cnz1aoh0.js → index-lkycEDHM.js} +108 -108
- package/dist/assets/{infoDiagram-HS3SLOUP-BN6_fsOH.js → infoDiagram-HS3SLOUP-CAsJ2eU1.js} +1 -1
- package/dist/assets/{isUndefined-DxBJKB1b.js → isUndefined-CcAlyXn3.js} +1 -1
- package/dist/assets/{journeyDiagram-XKPGCS4Q-CnjRjeOv.js → journeyDiagram-XKPGCS4Q-Bi8XsX15.js} +1 -1
- package/dist/assets/{kanban-definition-3W4ZIXB7-qaU6OHR6.js → kanban-definition-3W4ZIXB7-PTAFVsDn.js} +1 -1
- package/dist/assets/{layout-BULznkFT.js → layout-Do-GOFdW.js} +1 -1
- package/dist/assets/{linear-ogckhhec.js → linear-CZlgolw0.js} +1 -1
- package/dist/assets/{min-DljR10o-.js → min-N15IYW1Y.js} +1 -1
- package/dist/assets/{mindmap-definition-VGOIOE7T-DaEYqWVU.js → mindmap-definition-VGOIOE7T-Dlgxv6Jo.js} +1 -1
- package/dist/assets/{pieDiagram-ADFJNKIX-C_xhGVfM.js → pieDiagram-ADFJNKIX-Dr2AfIw5.js} +1 -1
- package/dist/assets/{quadrantDiagram-AYHSOK5B-D_TV5asG.js → quadrantDiagram-AYHSOK5B-B8TPuvW6.js} +1 -1
- package/dist/assets/{requirementDiagram-UZGBJVZJ-BuLlPC62.js → requirementDiagram-UZGBJVZJ-CdD2oP1N.js} +1 -1
- package/dist/assets/{sankeyDiagram-TZEHDZUN-1P0__QD_.js → sankeyDiagram-TZEHDZUN-XEMX6l5k.js} +1 -1
- package/dist/assets/{sequenceDiagram-WL72ISMW-TfKpluC6.js → sequenceDiagram-WL72ISMW-BlIKpBev.js} +1 -1
- package/dist/assets/{stateDiagram-FKZM4ZOC-nQ-BoGjY.js → stateDiagram-FKZM4ZOC-D3KGQY6v.js} +1 -1
- package/dist/assets/stateDiagram-v2-4FDKWEC3-Di3Nkv2n.js +1 -0
- package/dist/assets/{timeline-definition-IT6M3QCI-Bz79EHNk.js → timeline-definition-IT6M3QCI-TkL4mz_f.js} +1 -1
- package/dist/assets/{treemap-GDKQZRPO-BiJYOG6x.js → treemap-GDKQZRPO-BDp_c1Vc.js} +1 -1
- package/dist/assets/{xychartDiagram-PRI3JC2R-_EJmDCRo.js → xychartDiagram-PRI3JC2R-D0dNQImL.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/orcheo.png +0 -0
- package/package.json +1 -1
- package/public/orcheo.png +0 -0
- package/src/features/workflow/components/dialogs/add-credential-dialog.tsx +6 -2
- package/src/features/workflow/components/dialogs/credentials-vault.tsx +9 -3
- package/src/features/workflow/components/dialogs/upload-workflow-dialog.tsx +5 -0
- package/src/features/workflow/lib/workflow-frontmatter.ts +110 -0
- package/src/features/workflow/lib/workflow-storage.ts +5 -2
- package/src/lib/config.ts +25 -3
- package/dist/assets/channel-0htV4G8n.js +0 -1
- package/dist/assets/classDiagram-2ON5EDUG-Blgk-ihj.js +0 -1
- package/dist/assets/classDiagram-v2-WZHVMYZB-Blgk-ihj.js +0 -1
- package/dist/assets/clone-BgMTf_8w.js +0 -1
- package/dist/assets/stateDiagram-v2-4FDKWEC3-hx1MeqAD.js +0 -1
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
const FRONTMATTER_START_RE = /^# \/\/\/ (?<type>[a-zA-Z0-9_-]+)[ \t]*$/;
|
|
2
|
+
const FRONTMATTER_END_RE = /^# \/\/\/[ \t]*$/;
|
|
3
|
+
|
|
4
|
+
const STRING_FIELDS = new Set([
|
|
5
|
+
"name",
|
|
6
|
+
"id",
|
|
7
|
+
"handle",
|
|
8
|
+
"description",
|
|
9
|
+
"entrypoint",
|
|
10
|
+
]);
|
|
11
|
+
|
|
12
|
+
export interface WorkflowFrontmatter {
|
|
13
|
+
name?: string;
|
|
14
|
+
id?: string;
|
|
15
|
+
handle?: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
entrypoint?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const parseTomlString = (value: string): string | undefined => {
|
|
21
|
+
const trimmed = value.trim();
|
|
22
|
+
if (trimmed.startsWith('"') && trimmed.endsWith('"')) {
|
|
23
|
+
try {
|
|
24
|
+
const parsed = JSON.parse(trimmed) as unknown;
|
|
25
|
+
return typeof parsed === "string" && parsed.trim() ? parsed.trim() : undefined;
|
|
26
|
+
} catch {
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
if (trimmed.startsWith("'") && trimmed.endsWith("'")) {
|
|
31
|
+
const parsed = trimmed.slice(1, -1);
|
|
32
|
+
return parsed.trim() ? parsed.trim() : undefined;
|
|
33
|
+
}
|
|
34
|
+
return undefined;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const collectOrcheoFrontmatter = (source: string): string[] | undefined => {
|
|
38
|
+
const blocks: string[][] = [];
|
|
39
|
+
let currentLines: string[] = [];
|
|
40
|
+
let currentType: string | undefined;
|
|
41
|
+
let inBlock = false;
|
|
42
|
+
|
|
43
|
+
for (const line of source.split(/\r?\n/)) {
|
|
44
|
+
if (inBlock) {
|
|
45
|
+
if (FRONTMATTER_END_RE.test(line)) {
|
|
46
|
+
if (currentType === "orcheo") {
|
|
47
|
+
blocks.push(currentLines);
|
|
48
|
+
}
|
|
49
|
+
currentLines = [];
|
|
50
|
+
currentType = undefined;
|
|
51
|
+
inBlock = false;
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
currentLines.push(line);
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const match = line.match(FRONTMATTER_START_RE);
|
|
59
|
+
if (match?.groups?.type) {
|
|
60
|
+
currentType = match.groups.type;
|
|
61
|
+
currentLines = [];
|
|
62
|
+
inBlock = true;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (blocks.length !== 1) {
|
|
67
|
+
return undefined;
|
|
68
|
+
}
|
|
69
|
+
return blocks[0];
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const toTomlLines = (contentLines: string[]): string[] =>
|
|
73
|
+
contentLines.flatMap((line) => {
|
|
74
|
+
if (!line.startsWith("#")) {
|
|
75
|
+
return [];
|
|
76
|
+
}
|
|
77
|
+
let stripped = line.slice(1);
|
|
78
|
+
if (stripped.startsWith(" ") || stripped.startsWith("\t")) {
|
|
79
|
+
stripped = stripped.slice(1);
|
|
80
|
+
}
|
|
81
|
+
return [stripped];
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
export const parseWorkflowFrontmatter = (
|
|
85
|
+
source: string,
|
|
86
|
+
): WorkflowFrontmatter => {
|
|
87
|
+
const contentLines = collectOrcheoFrontmatter(source);
|
|
88
|
+
if (!contentLines) {
|
|
89
|
+
return {};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const frontmatter: WorkflowFrontmatter = {};
|
|
93
|
+
for (const line of toTomlLines(contentLines)) {
|
|
94
|
+
const trimmed = line.trim();
|
|
95
|
+
if (!trimmed || trimmed.startsWith("#")) {
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
const match = trimmed.match(/^([A-Za-z0-9_-]+)\s*=\s*(.+)$/);
|
|
99
|
+
const key = match?.[1];
|
|
100
|
+
if (!key || !STRING_FIELDS.has(key)) {
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
const value = parseTomlString(match[2] ?? "");
|
|
104
|
+
if (!value) {
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
frontmatter[key as keyof WorkflowFrontmatter] = value;
|
|
108
|
+
}
|
|
109
|
+
return frontmatter;
|
|
110
|
+
};
|
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
clearWorkflowUploadError,
|
|
30
30
|
saveWorkflowUploadError,
|
|
31
31
|
} from "./workflow-upload-errors";
|
|
32
|
+
import { parseWorkflowFrontmatter } from "./workflow-frontmatter";
|
|
32
33
|
import type {
|
|
33
34
|
ApiWorkflow,
|
|
34
35
|
SaveWorkflowInput,
|
|
@@ -372,11 +373,13 @@ export const uploadWorkflowFromFiles = async (
|
|
|
372
373
|
options?: { actor?: string },
|
|
373
374
|
): Promise<StoredWorkflow> => {
|
|
374
375
|
const actor = resolveActor(options?.actor);
|
|
376
|
+
const frontmatter = parseWorkflowFrontmatter(script);
|
|
375
377
|
const created = await request<ApiWorkflow>(API_BASE, {
|
|
376
378
|
method: "POST",
|
|
377
379
|
body: JSON.stringify({
|
|
378
380
|
name: workflowName,
|
|
379
|
-
|
|
381
|
+
handle: frontmatter.handle ?? undefined,
|
|
382
|
+
description: frontmatter.description ?? null,
|
|
380
383
|
tags: [],
|
|
381
384
|
actor,
|
|
382
385
|
}),
|
|
@@ -387,7 +390,7 @@ export const uploadWorkflowFromFiles = async (
|
|
|
387
390
|
method: "POST",
|
|
388
391
|
body: JSON.stringify({
|
|
389
392
|
script,
|
|
390
|
-
entrypoint: null,
|
|
393
|
+
entrypoint: frontmatter.entrypoint ?? null,
|
|
391
394
|
runnable_config: config ?? null,
|
|
392
395
|
metadata: { source: "studio-upload" },
|
|
393
396
|
notes: null,
|
package/src/lib/config.ts
CHANGED
|
@@ -1,4 +1,25 @@
|
|
|
1
|
-
const
|
|
1
|
+
const VITE_DEV_ORIGINS = new Set([
|
|
2
|
+
"http://localhost:2026",
|
|
3
|
+
"http://127.0.0.1:2026",
|
|
4
|
+
// `vite preview`'s default port. It serves the built SPA standalone (not
|
|
5
|
+
// colocated with the backend), so it must fall back to the dev backend
|
|
6
|
+
// default rather than treating itself as the backend's own origin.
|
|
7
|
+
"http://localhost:4173",
|
|
8
|
+
"http://127.0.0.1:4173",
|
|
9
|
+
]);
|
|
10
|
+
|
|
11
|
+
const getDefaultBackendUrl = (): string => {
|
|
12
|
+
if (typeof window === "undefined") {
|
|
13
|
+
return "http://localhost:2025";
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const origin = window.location.origin;
|
|
17
|
+
if (origin && !VITE_DEV_ORIGINS.has(origin)) {
|
|
18
|
+
return origin;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return "http://localhost:2025";
|
|
22
|
+
};
|
|
2
23
|
|
|
3
24
|
const trimTrailingSlash = (value: string) => value.replace(/\/+$/, "");
|
|
4
25
|
|
|
@@ -33,14 +54,15 @@ const normaliseBaseUrl = (value: string): string => {
|
|
|
33
54
|
|
|
34
55
|
export const getBackendBaseUrl = (): string => {
|
|
35
56
|
const fromEnv = (import.meta.env?.VITE_ORCHEO_BACKEND_URL ?? "") as string;
|
|
36
|
-
const
|
|
57
|
+
const defaultBackendUrl = getDefaultBackendUrl();
|
|
58
|
+
const candidate = fromEnv || defaultBackendUrl;
|
|
37
59
|
const normalised = normaliseBaseUrl(candidate);
|
|
38
60
|
|
|
39
61
|
if (fromEnv && !isValidUrl(normalised)) {
|
|
40
62
|
console.warn(
|
|
41
63
|
"Invalid VITE_ORCHEO_BACKEND_URL provided, falling back to default backend URL.",
|
|
42
64
|
);
|
|
43
|
-
return normaliseBaseUrl(
|
|
65
|
+
return normaliseBaseUrl(defaultBackendUrl);
|
|
44
66
|
}
|
|
45
67
|
|
|
46
68
|
return normalised;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ap as o,aq as n}from"./index-Cnz1aoh0.js";const t=(a,r)=>o.lang.round(n.parse(a)[r]);export{t as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as a,c as s,a as e,C as t}from"./chunk-B4BG7PRW-BVmjJQGD.js";import{_ as i}from"./index-Cnz1aoh0.js";import"./chunk-FMBD7UC4-D-PvzEp6.js";import"./chunk-55IACEB6-DMMV3uf8.js";import"./chunk-QN33PNHL-BNp075o8.js";var p={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{p as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as a,c as s,a as e,C as t}from"./chunk-B4BG7PRW-BVmjJQGD.js";import{_ as i}from"./index-Cnz1aoh0.js";import"./chunk-FMBD7UC4-D-PvzEp6.js";import"./chunk-55IACEB6-DMMV3uf8.js";import"./chunk-QN33PNHL-BNp075o8.js";var p={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{p as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ay as r}from"./index-Cnz1aoh0.js";var a=4;function n(o){return r(o,a)}export{n as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as t,b as r,a,S as s}from"./chunk-DI55MBZ5-3C02UFww.js";import{_ as i}from"./index-Cnz1aoh0.js";import"./chunk-55IACEB6-DMMV3uf8.js";import"./chunk-QN33PNHL-BNp075o8.js";var l={parser:a,get db(){return new s(2)},renderer:r,styles:t,init:i(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{l as diagram};
|