next-workflow-builder 0.4.4 → 0.4.6
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/{chunk-Z3BJJYHM.js → chunk-3XFDIK7H.js} +6 -1
- package/dist/{chunk-TFNZVQEH.js → chunk-C7GDB4KC.js} +1 -1
- package/dist/{chunk-XJ67EFQA.js → chunk-MIBRBQIJ.js} +1 -1
- package/dist/{chunk-2IJUDWUK.js → chunk-X5GOM4L4.js} +1 -1
- package/dist/client/index.js +60 -41
- package/dist/{condition-YFHUXD7D.js → condition-IWTKYMBN.js} +3 -3
- package/dist/{database-query-Q2JDUQ3N.js → database-query-C4GDVVDK.js} +2 -2
- package/dist/{loop-37IXIL3L.js → loop-2237QQBO.js} +3 -3
- package/dist/{merge-2GBB4W2S.js → merge-Q5YUAT6F.js} +3 -3
- package/dist/next/index.js +2 -2
- package/dist/plugins/index.d.ts +6 -1
- package/dist/plugins/index.js +3 -1
- package/dist/server/api/index.js +29 -8
- package/dist/server/index.js +3 -3
- package/dist/{switch-SG2SNUUJ.js → switch-H2N4F2YX.js} +3 -3
- package/package.json +1 -1
|
@@ -217,6 +217,10 @@ function generateAIActionPrompts() {
|
|
|
217
217
|
}
|
|
218
218
|
return lines.join("\n");
|
|
219
219
|
}
|
|
220
|
+
function integrationRequiresCredentials(type) {
|
|
221
|
+
const plugin = integrationRegistry.get(type);
|
|
222
|
+
return !!plugin && plugin.formFields.length > 0;
|
|
223
|
+
}
|
|
220
224
|
|
|
221
225
|
export {
|
|
222
226
|
registerCodegenTemplates,
|
|
@@ -242,5 +246,6 @@ export {
|
|
|
242
246
|
getCredentialMapping,
|
|
243
247
|
isFieldGroup,
|
|
244
248
|
flattenConfigFields,
|
|
245
|
-
generateAIActionPrompts
|
|
249
|
+
generateAIActionPrompts,
|
|
250
|
+
integrationRequiresCredentials
|
|
246
251
|
};
|
package/dist/client/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
databaseQueryAction,
|
|
5
5
|
generateWorkflowCode,
|
|
6
6
|
httpRequestAction
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-MIBRBQIJ.js";
|
|
8
8
|
import {
|
|
9
9
|
cn
|
|
10
10
|
} from "../chunk-5YYA34YV.js";
|
|
@@ -19,8 +19,9 @@ import {
|
|
|
19
19
|
getIntegrationLabels,
|
|
20
20
|
getOutputDisplayConfig,
|
|
21
21
|
getSortedIntegrationTypes,
|
|
22
|
+
integrationRequiresCredentials,
|
|
22
23
|
isFieldGroup
|
|
23
|
-
} from "../chunk-
|
|
24
|
+
} from "../chunk-3XFDIK7H.js";
|
|
24
25
|
|
|
25
26
|
// src/client/components/pages/workflow-page.tsx
|
|
26
27
|
import { AuthView } from "@daveyplate/better-auth-ui";
|
|
@@ -5103,7 +5104,9 @@ function ActionConfig({
|
|
|
5103
5104
|
return SYSTEM_ACTION_INTEGRATIONS2[actionType];
|
|
5104
5105
|
}
|
|
5105
5106
|
const action = findActionById(actionType);
|
|
5106
|
-
|
|
5107
|
+
const type = action?.integration;
|
|
5108
|
+
if (type && !integrationRequiresCredentials(type)) return void 0;
|
|
5109
|
+
return type;
|
|
5107
5110
|
}, [actionType]);
|
|
5108
5111
|
const shouldUseManagedKeys = integrationType === "ai-gateway" && aiGatewayStatus?.enabled && aiGatewayStatus?.isVercelUser;
|
|
5109
5112
|
const hasExistingConnections = useMemo4(() => {
|
|
@@ -11479,6 +11482,9 @@ function getMissingIntegrations(nodes, userIntegrations) {
|
|
|
11479
11482
|
if (!requiredIntegrationType) {
|
|
11480
11483
|
continue;
|
|
11481
11484
|
}
|
|
11485
|
+
if (!integrationRequiresCredentials(requiredIntegrationType)) {
|
|
11486
|
+
continue;
|
|
11487
|
+
}
|
|
11482
11488
|
const configuredIntegrationId = node.data.config?.integrationId;
|
|
11483
11489
|
const hasValidIntegration = configuredIntegrationId && userIntegrationIds.has(configuredIntegrationId);
|
|
11484
11490
|
if (hasValidIntegration) {
|
|
@@ -12267,43 +12273,55 @@ function WorkflowMenuComponent({
|
|
|
12267
12273
|
actions
|
|
12268
12274
|
}) {
|
|
12269
12275
|
return /* @__PURE__ */ jsxs51("div", { className: "flex flex-col gap-1", children: [
|
|
12270
|
-
/* @__PURE__ */ jsx73(
|
|
12271
|
-
|
|
12272
|
-
|
|
12273
|
-
|
|
12274
|
-
|
|
12275
|
-
/* @__PURE__ */
|
|
12276
|
-
|
|
12277
|
-
|
|
12278
|
-
|
|
12279
|
-
|
|
12280
|
-
|
|
12281
|
-
|
|
12282
|
-
|
|
12283
|
-
|
|
12284
|
-
|
|
12285
|
-
|
|
12286
|
-
|
|
12287
|
-
|
|
12288
|
-
|
|
12289
|
-
|
|
12290
|
-
|
|
12291
|
-
|
|
12292
|
-
|
|
12293
|
-
|
|
12294
|
-
|
|
12295
|
-
|
|
12296
|
-
|
|
12297
|
-
|
|
12298
|
-
|
|
12299
|
-
|
|
12300
|
-
|
|
12301
|
-
|
|
12302
|
-
|
|
12303
|
-
|
|
12304
|
-
|
|
12305
|
-
|
|
12306
|
-
|
|
12276
|
+
/* @__PURE__ */ jsx73(
|
|
12277
|
+
"div",
|
|
12278
|
+
{
|
|
12279
|
+
className: "flex h-9 max-w-[160px] items-center overflow-hidden rounded-md border bg-secondary text-secondary-foreground sm:max-w-none",
|
|
12280
|
+
children: /* @__PURE__ */ jsxs51(DropdownMenu, { onOpenChange: (open) => open && actions.loadWorkflows(), children: [
|
|
12281
|
+
/* @__PURE__ */ jsxs51(
|
|
12282
|
+
DropdownMenuTrigger,
|
|
12283
|
+
{
|
|
12284
|
+
className: "flex h-full cursor-pointer items-center gap-2 px-3 font-medium text-sm transition-all hover:bg-black/5 dark:hover:bg-white/5",
|
|
12285
|
+
children: [
|
|
12286
|
+
/* @__PURE__ */ jsx73(WorkflowIcon, { className: "size-4 shrink-0" }),
|
|
12287
|
+
/* @__PURE__ */ jsx73("p", { className: "truncate font-medium text-sm", children: workflowId ? state.workflowName : /* @__PURE__ */ jsxs51(Fragment17, { children: [
|
|
12288
|
+
/* @__PURE__ */ jsx73("span", { className: "sm:hidden", children: "New" }),
|
|
12289
|
+
/* @__PURE__ */ jsx73("span", { className: "hidden sm:inline", children: "New Workflow" })
|
|
12290
|
+
] }) }),
|
|
12291
|
+
/* @__PURE__ */ jsx73(ChevronDown3, { className: "size-3 shrink-0 opacity-50" })
|
|
12292
|
+
]
|
|
12293
|
+
}
|
|
12294
|
+
),
|
|
12295
|
+
/* @__PURE__ */ jsxs51(DropdownMenuContent, { align: "start", className: "w-64", children: [
|
|
12296
|
+
/* @__PURE__ */ jsx73(
|
|
12297
|
+
DropdownMenuItem,
|
|
12298
|
+
{
|
|
12299
|
+
asChild: true,
|
|
12300
|
+
className: "flex items-center justify-between",
|
|
12301
|
+
children: /* @__PURE__ */ jsxs51("a", { href: "/", children: [
|
|
12302
|
+
"New Workflow",
|
|
12303
|
+
" ",
|
|
12304
|
+
!workflowId && /* @__PURE__ */ jsx73(Check5, { className: "size-4 shrink-0" })
|
|
12305
|
+
] })
|
|
12306
|
+
}
|
|
12307
|
+
),
|
|
12308
|
+
/* @__PURE__ */ jsx73(DropdownMenuSeparator, {}),
|
|
12309
|
+
state.allWorkflows.length === 0 ? /* @__PURE__ */ jsx73(DropdownMenuItem, { disabled: true, children: "No workflows found" }) : state.allWorkflows.filter((w) => w.name !== "__current__").map((workflow) => /* @__PURE__ */ jsxs51(
|
|
12310
|
+
DropdownMenuItem,
|
|
12311
|
+
{
|
|
12312
|
+
className: "flex items-center justify-between",
|
|
12313
|
+
onClick: () => state.router.push(`/workflows/${workflow.id}`),
|
|
12314
|
+
children: [
|
|
12315
|
+
/* @__PURE__ */ jsx73("span", { className: "truncate", children: workflow.name }),
|
|
12316
|
+
workflow.id === state.currentWorkflowId && /* @__PURE__ */ jsx73(Check5, { className: "size-4 shrink-0" })
|
|
12317
|
+
]
|
|
12318
|
+
},
|
|
12319
|
+
workflow.id
|
|
12320
|
+
))
|
|
12321
|
+
] })
|
|
12322
|
+
] })
|
|
12323
|
+
}
|
|
12324
|
+
),
|
|
12307
12325
|
workflowId && !state.isOwner && /* @__PURE__ */ jsx73("span", { className: "text-muted-foreground text-xs uppercase lg:hidden", children: "Read-only" })
|
|
12308
12326
|
] });
|
|
12309
12327
|
}
|
|
@@ -12662,7 +12680,8 @@ var requiresIntegration = (actionType) => {
|
|
|
12662
12680
|
return true;
|
|
12663
12681
|
}
|
|
12664
12682
|
const action = findActionById(actionType);
|
|
12665
|
-
|
|
12683
|
+
if (!action) return false;
|
|
12684
|
+
return integrationRequiresCredentials(action.integration);
|
|
12666
12685
|
};
|
|
12667
12686
|
var getProviderLogo = (actionType) => {
|
|
12668
12687
|
switch (actionType) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "./chunk-KZNRU3LB.js";
|
|
2
|
-
import "./chunk-
|
|
2
|
+
import "./chunk-C7GDB4KC.js";
|
|
3
3
|
import "./chunk-F6HAK4HT.js";
|
|
4
4
|
import "./chunk-5YYA34YV.js";
|
|
5
5
|
import "./chunk-OQHML4II.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-X5GOM4L4.js";
|
|
7
7
|
import "./chunk-BL6QJDNB.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-3XFDIK7H.js";
|
|
9
9
|
import "./chunk-O3I2INCD.js";
|
|
10
10
|
import {
|
|
11
11
|
withStepLogging
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "./chunk-KZNRU3LB.js";
|
|
2
|
-
import "./chunk-
|
|
2
|
+
import "./chunk-C7GDB4KC.js";
|
|
3
3
|
import "./chunk-F6HAK4HT.js";
|
|
4
4
|
import "./chunk-5YYA34YV.js";
|
|
5
5
|
import "./chunk-OQHML4II.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-X5GOM4L4.js";
|
|
7
7
|
import "./chunk-BL6QJDNB.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-3XFDIK7H.js";
|
|
9
9
|
import "./chunk-O3I2INCD.js";
|
|
10
10
|
import {
|
|
11
11
|
withStepLogging
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "./chunk-KZNRU3LB.js";
|
|
2
|
-
import "./chunk-
|
|
2
|
+
import "./chunk-C7GDB4KC.js";
|
|
3
3
|
import "./chunk-F6HAK4HT.js";
|
|
4
4
|
import "./chunk-5YYA34YV.js";
|
|
5
5
|
import "./chunk-OQHML4II.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-X5GOM4L4.js";
|
|
7
7
|
import "./chunk-BL6QJDNB.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-3XFDIK7H.js";
|
|
9
9
|
import "./chunk-O3I2INCD.js";
|
|
10
10
|
import {
|
|
11
11
|
withStepLogging
|
package/dist/next/index.js
CHANGED
package/dist/plugins/index.d.ts
CHANGED
|
@@ -109,5 +109,10 @@ declare function flattenConfigFields(fields: ActionConfigField[]): ActionConfigF
|
|
|
109
109
|
* This dynamically builds the action types documentation for the AI
|
|
110
110
|
*/
|
|
111
111
|
declare function generateAIActionPrompts(): string;
|
|
112
|
+
/**
|
|
113
|
+
* Check if an integration type requires credentials (has formFields).
|
|
114
|
+
* Plugins with no formFields (e.g. facebook-event-scraper) don't need a connection.
|
|
115
|
+
*/
|
|
116
|
+
declare function integrationRequiresCredentials(type: IntegrationType): boolean;
|
|
112
117
|
|
|
113
|
-
export { ActionConfigField, ActionConfigFieldBase, ActionConfigFieldGroup, ActionWithFullId, IntegrationPlugin, computeActionId, findActionById, flattenConfigFields, generateAIActionPrompts, getActionsByCategory, getAllActions, getAllDependencies, getAllEnvVars, getAllIntegrations, getCodegenTemplate, getCredentialMapping, getDependenciesForActions, getIntegration, getIntegrationDescriptions, getIntegrationLabels, getIntegrationTypes, getOutputDisplayConfig, getPluginEnvVars, getSortedIntegrationTypes, isFieldGroup, parseActionId, registerCodegenTemplates, registerIntegration, registerOutputDisplayConfigs };
|
|
118
|
+
export { ActionConfigField, ActionConfigFieldBase, ActionConfigFieldGroup, ActionWithFullId, IntegrationPlugin, computeActionId, findActionById, flattenConfigFields, generateAIActionPrompts, getActionsByCategory, getAllActions, getAllDependencies, getAllEnvVars, getAllIntegrations, getCodegenTemplate, getCredentialMapping, getDependenciesForActions, getIntegration, getIntegrationDescriptions, getIntegrationLabels, getIntegrationTypes, getOutputDisplayConfig, getPluginEnvVars, getSortedIntegrationTypes, integrationRequiresCredentials, isFieldGroup, parseActionId, registerCodegenTemplates, registerIntegration, registerOutputDisplayConfigs };
|
package/dist/plugins/index.js
CHANGED
|
@@ -18,12 +18,13 @@ import {
|
|
|
18
18
|
getOutputDisplayConfig,
|
|
19
19
|
getPluginEnvVars,
|
|
20
20
|
getSortedIntegrationTypes,
|
|
21
|
+
integrationRequiresCredentials,
|
|
21
22
|
isFieldGroup,
|
|
22
23
|
parseActionId,
|
|
23
24
|
registerCodegenTemplates,
|
|
24
25
|
registerIntegration,
|
|
25
26
|
registerOutputDisplayConfigs
|
|
26
|
-
} from "../chunk-
|
|
27
|
+
} from "../chunk-3XFDIK7H.js";
|
|
27
28
|
export {
|
|
28
29
|
computeActionId,
|
|
29
30
|
findActionById,
|
|
@@ -44,6 +45,7 @@ export {
|
|
|
44
45
|
getOutputDisplayConfig,
|
|
45
46
|
getPluginEnvVars,
|
|
46
47
|
getSortedIntegrationTypes,
|
|
48
|
+
integrationRequiresCredentials,
|
|
47
49
|
isFieldGroup,
|
|
48
50
|
parseActionId,
|
|
49
51
|
registerCodegenTemplates,
|
package/dist/server/api/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
sanitizeFunctionName,
|
|
12
12
|
sanitizeStepName,
|
|
13
13
|
sanitizeVarName
|
|
14
|
-
} from "../../chunk-
|
|
14
|
+
} from "../../chunk-MIBRBQIJ.js";
|
|
15
15
|
import {
|
|
16
16
|
auth,
|
|
17
17
|
getAuthConfig
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
findActionById,
|
|
39
39
|
getAllEnvVars,
|
|
40
40
|
getDependenciesForActions
|
|
41
|
-
} from "../../chunk-
|
|
41
|
+
} from "../../chunk-3XFDIK7H.js";
|
|
42
42
|
import {
|
|
43
43
|
accounts,
|
|
44
44
|
apiKeys,
|
|
@@ -416,7 +416,7 @@ triggerStep.maxRetries = 0;
|
|
|
416
416
|
var SYSTEM_ACTIONS = {
|
|
417
417
|
"Database Query": {
|
|
418
418
|
// biome-ignore lint/suspicious/noExplicitAny: Dynamic module import
|
|
419
|
-
importer: () => import("../../database-query-
|
|
419
|
+
importer: () => import("../../database-query-C4GDVVDK.js"),
|
|
420
420
|
stepFunction: "databaseQueryStep"
|
|
421
421
|
},
|
|
422
422
|
"HTTP Request": {
|
|
@@ -426,22 +426,22 @@ var SYSTEM_ACTIONS = {
|
|
|
426
426
|
},
|
|
427
427
|
Condition: {
|
|
428
428
|
// biome-ignore lint/suspicious/noExplicitAny: Dynamic module import
|
|
429
|
-
importer: () => import("../../condition-
|
|
429
|
+
importer: () => import("../../condition-IWTKYMBN.js"),
|
|
430
430
|
stepFunction: "conditionStep"
|
|
431
431
|
},
|
|
432
432
|
Loop: {
|
|
433
433
|
// biome-ignore lint/suspicious/noExplicitAny: Dynamic module import
|
|
434
|
-
importer: () => import("../../loop-
|
|
434
|
+
importer: () => import("../../loop-2237QQBO.js"),
|
|
435
435
|
stepFunction: "loopStep"
|
|
436
436
|
},
|
|
437
437
|
Switch: {
|
|
438
438
|
// biome-ignore lint/suspicious/noExplicitAny: Dynamic module import
|
|
439
|
-
importer: () => import("../../switch-
|
|
439
|
+
importer: () => import("../../switch-H2N4F2YX.js"),
|
|
440
440
|
stepFunction: "switchStep"
|
|
441
441
|
},
|
|
442
442
|
Merge: {
|
|
443
443
|
// biome-ignore lint/suspicious/noExplicitAny: Dynamic module import
|
|
444
|
-
importer: () => import("../../merge-
|
|
444
|
+
importer: () => import("../../merge-Q5YUAT6F.js"),
|
|
445
445
|
stepFunction: "mergeStep"
|
|
446
446
|
}
|
|
447
447
|
};
|
|
@@ -660,10 +660,14 @@ async function executeWorkflow(input) {
|
|
|
660
660
|
const results = {};
|
|
661
661
|
const nodeMap = new Map(nodes.map((n) => [n.id, n]));
|
|
662
662
|
const edgesBySource = /* @__PURE__ */ new Map();
|
|
663
|
+
const edgesByTarget = /* @__PURE__ */ new Map();
|
|
663
664
|
for (const edge of edges) {
|
|
664
665
|
const targets = edgesBySource.get(edge.source) || [];
|
|
665
666
|
targets.push(edge.target);
|
|
666
667
|
edgesBySource.set(edge.source, targets);
|
|
668
|
+
const sources = edgesByTarget.get(edge.target) || [];
|
|
669
|
+
sources.push(edge.source);
|
|
670
|
+
edgesByTarget.set(edge.target, sources);
|
|
667
671
|
}
|
|
668
672
|
const nodesWithIncoming = new Set(edges.map((e) => e.target));
|
|
669
673
|
const triggerNodes = nodes.filter(
|
|
@@ -788,10 +792,27 @@ async function executeWorkflow(input) {
|
|
|
788
792
|
nodeName: getNodeName(node),
|
|
789
793
|
nodeType: actionType
|
|
790
794
|
};
|
|
795
|
+
const predecessorData = {};
|
|
796
|
+
const predecessorIds = edgesByTarget.get(nodeId) || [];
|
|
797
|
+
for (const predId of predecessorIds) {
|
|
798
|
+
const sanitizedPredId = predId.replace(/[^a-zA-Z0-9]/g, "_");
|
|
799
|
+
const predOutput = outputs[sanitizedPredId];
|
|
800
|
+
if (predOutput?.data && typeof predOutput.data === "object") {
|
|
801
|
+
let payload = predOutput.data;
|
|
802
|
+
if ("success" in payload && "data" in payload && payload.data && typeof payload.data === "object") {
|
|
803
|
+
payload = payload.data;
|
|
804
|
+
}
|
|
805
|
+
for (const [key, value] of Object.entries(payload)) {
|
|
806
|
+
if (key !== "success" && key !== "error") {
|
|
807
|
+
predecessorData[key] = value;
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
}
|
|
791
812
|
console.log("[Workflow Executor] Calling executeActionStep");
|
|
792
813
|
const stepResult = await executeActionStep({
|
|
793
814
|
actionType,
|
|
794
|
-
config: processedConfig,
|
|
815
|
+
config: { ...predecessorData, ...processedConfig },
|
|
795
816
|
outputs,
|
|
796
817
|
context: stepContext
|
|
797
818
|
});
|
package/dist/server/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "../chunk-KZNRU3LB.js";
|
|
4
4
|
import {
|
|
5
5
|
discoverPlugins
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-C7GDB4KC.js";
|
|
7
7
|
import {
|
|
8
8
|
auth
|
|
9
9
|
} from "../chunk-F6HAK4HT.js";
|
|
@@ -13,12 +13,12 @@ import {
|
|
|
13
13
|
import "../chunk-OQHML4II.js";
|
|
14
14
|
import {
|
|
15
15
|
fetchCredentials
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-X5GOM4L4.js";
|
|
17
17
|
import {
|
|
18
18
|
decrypt,
|
|
19
19
|
encrypt
|
|
20
20
|
} from "../chunk-BL6QJDNB.js";
|
|
21
|
-
import "../chunk-
|
|
21
|
+
import "../chunk-3XFDIK7H.js";
|
|
22
22
|
import {
|
|
23
23
|
getErrorMessage
|
|
24
24
|
} from "../chunk-O3I2INCD.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "./chunk-KZNRU3LB.js";
|
|
2
|
-
import "./chunk-
|
|
2
|
+
import "./chunk-C7GDB4KC.js";
|
|
3
3
|
import "./chunk-F6HAK4HT.js";
|
|
4
4
|
import "./chunk-5YYA34YV.js";
|
|
5
5
|
import "./chunk-OQHML4II.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-X5GOM4L4.js";
|
|
7
7
|
import "./chunk-BL6QJDNB.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-3XFDIK7H.js";
|
|
9
9
|
import "./chunk-O3I2INCD.js";
|
|
10
10
|
import {
|
|
11
11
|
withStepLogging
|