next-workflow-builder 0.5.0 → 0.7.0
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/CHANGELOG.md +156 -0
- package/README.md +1 -1
- package/dist/chunk-5J6TNMJG.js +1 -0
- package/dist/chunk-6UXAINJQ.js +1 -0
- package/dist/chunk-7WFHHPX4.js +1 -0
- package/dist/chunk-BNX2SV7E.js +1 -0
- package/dist/chunk-CYVALTSI.js +218 -0
- package/dist/chunk-DMHGXYVW.js +14 -0
- package/dist/chunk-HB2H2PVI.js +42 -0
- package/dist/chunk-IEOZJAW2.js +1 -0
- package/dist/chunk-KFTXS23Q.js +1 -0
- package/dist/chunk-NI6U7PHC.js +76 -0
- package/dist/chunk-PRVESNIO.js +1 -0
- package/dist/chunk-QRG4O4PE.js +2 -0
- package/dist/chunk-R5GS6TJS.js +1 -0
- package/dist/client/index.js +160 -13725
- package/dist/condition-CFAA7UDI.js +1 -0
- package/dist/database-query-OHFQUPLV.js +1 -0
- package/dist/handler-NWAMWKXW.js +1 -0
- package/dist/http-request-EHJHOTNA.js +1 -0
- package/dist/loop-5LPVY452.js +1 -0
- package/dist/merge-HYBHX22D.js +1 -0
- package/dist/next/index.d.ts +9 -0
- package/dist/next/index.js +1 -84
- package/dist/plugins/index.js +1 -54
- package/dist/server/api/index.d.ts +30 -1
- package/dist/server/api/index.js +18 -2360
- package/dist/server/index.js +1 -60
- package/dist/switch-ZPVREROE.js +1 -0
- package/drizzle.config.ts +9 -0
- package/package.json +27 -2
- package/src/plugins/types.ts +31 -0
- package/src/server/db/schema.ts +228 -0
- package/src/server/lib/utils/id.ts +26 -0
- package/dist/chunk-3XFDIK7H.js +0 -251
- package/dist/chunk-5H76TY4T.js +0 -51
- package/dist/chunk-5YYA34YV.js +0 -96
- package/dist/chunk-C7GDB4KC.js +0 -550
- package/dist/chunk-CKE7ETZL.js +0 -169
- package/dist/chunk-EMCA7GLF.js +0 -1305
- package/dist/chunk-J72T2LRL.js +0 -66
- package/dist/chunk-JUV5RBYM.js +0 -105
- package/dist/chunk-O3I2INCD.js +0 -71
- package/dist/chunk-OQHML4II.js +0 -36
- package/dist/chunk-PEVVELQ6.js +0 -438
- package/dist/condition-VHC4KYLI.js +0 -29
- package/dist/database-query-BYPF5CDB.js +0 -99
- package/dist/http-request-4OT32ZXA.js +0 -76
- package/dist/loop-S5H7DSCB.js +0 -47
- package/dist/merge-X5JAIZSZ.js +0 -107
- package/dist/style-prefixed.css +0 -5167
- package/dist/switch-WZBVDWWR.js +0 -68
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-R5GS6TJS.js";import"./chunk-CYVALTSI.js";import"./chunk-IEOZJAW2.js";import"./chunk-6UXAINJQ.js";import"./chunk-BNX2SV7E.js";import"./chunk-PRVESNIO.js";import"./chunk-KFTXS23Q.js";import"./chunk-QRG4O4PE.js";import"./chunk-7WFHHPX4.js";import{q as o}from"./chunk-5J6TNMJG.js";import"server-only";function n(t){return{condition:t.condition}}async function e(t){"use step";return o(t,()=>Promise.resolve(n(t)))}e.maxRetries=0;export{e as conditionStep};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as s}from"./chunk-PRVESNIO.js";import"./chunk-KFTXS23Q.js";import"./chunk-QRG4O4PE.js";import{q as u}from"./chunk-5J6TNMJG.js";import"server-only";import{sql as c}from"drizzle-orm";import{drizzle as l}from"drizzle-orm/postgres-js";import d from"postgres";function y(e){let r=e.dbQuery||e.query;return!r||r.trim()===""?"SQL query is required":null}function f(e){return d(e,{max:1,connect_timeout:10,idle_timeout:20})}async function g(e,r){return await l(e).execute(c.raw(r))}function b(e){if(!(e instanceof Error))return"Unknown database error";let r=e.message;return r.includes("ECONNREFUSED")?"Connection refused. Please check your database URL and ensure the database is running.":r.includes("ENOTFOUND")?"Database host not found. Please check your database URL.":r.includes("authentication failed")?"Authentication failed. Please check your database credentials.":r.includes("does not exist")?`Database error: ${r}`:r}async function p(e){if(e)try{await e.end()}catch{}}async function m(e){let r=y(e);if(r)return{success:!1,error:r};let a=(e.integrationId?await s(e.integrationId):{}).DATABASE_URL;if(!a)return{success:!1,error:"DATABASE_URL is not configured. Please add it in Project Integrations."};let o=e.dbQuery||e.query,n=null;try{n=f(a);let t=await g(n,o);return await n.end(),{success:!0,rows:t,count:Array.isArray(t)?t.length:0}}catch(t){return await p(n),{success:!1,error:`Database query failed: ${b(t)}`}}}async function D(e){"use step";return u(e,()=>m(e))}D.maxRetries=0;export{D as databaseQueryStep};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as h,e as I}from"./chunk-HB2H2PVI.js";import"./chunk-DMHGXYVW.js";import{b as N}from"./chunk-IEOZJAW2.js";import"./chunk-6UXAINJQ.js";import"./chunk-BNX2SV7E.js";import{i as x}from"./chunk-KFTXS23Q.js";import{k as A,w as O}from"./chunk-QRG4O4PE.js";import{a as g,i as s,j as f,k as p,l as y,o as d}from"./chunk-5J6TNMJG.js";import{WebStandardStreamableHTTPServerTransport as _}from"@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js";import{withMcpAuth as q}from"better-auth/plugins";import{McpServer as b}from"@modelcontextprotocol/sdk/server/mcp.js";import{and as k,desc as v,eq as c,inArray as W}from"drizzle-orm";import{z as n}from"zod";function J(a,i){a.tool("list_workflows","List the authenticated user's workflows",{limit:n.number().optional(),offset:n.number().optional()},async({limit:o,offset:t})=>{let r=await d.select().from(s).where(c(s.userId,i)).orderBy(v(s.updatedAt)).limit(o??50).offset(t??0);return{content:[{type:"text",text:JSON.stringify(r.map(e=>({...e,createdAt:e.createdAt.toISOString(),updatedAt:e.updatedAt.toISOString()})))}]}}),a.tool("get_workflow","Get a workflow by ID",{workflowId:n.string()},async({workflowId:o})=>{let t=await d.query.workflows.findFirst({where:k(c(s.id,o),c(s.userId,i))});return t?{content:[{type:"text",text:JSON.stringify({...t,createdAt:t.createdAt.toISOString(),updatedAt:t.updatedAt.toISOString()})}]}:{content:[{type:"text",text:JSON.stringify({error:"Workflow not found"})}]}}),a.tool("create_workflow","Create a new workflow",{name:n.string(),description:n.string().optional(),nodes:n.array(n.record(n.string(),n.unknown())),edges:n.array(n.record(n.string(),n.unknown()))},async({name:o,description:t,nodes:r,edges:e})=>{if(!(await x(r,i)).valid)return{content:[{type:"text",text:JSON.stringify({error:"Invalid integration references"})}]};let m=g(),[u]=await d.insert(s).values({id:m,name:o,description:t,nodes:r,edges:e,userId:i}).returning();return{content:[{type:"text",text:JSON.stringify({...u,createdAt:u.createdAt.toISOString(),updatedAt:u.updatedAt.toISOString()})}]}}),a.tool("update_workflow","Update an existing workflow",{workflowId:n.string(),name:n.string().optional(),description:n.string().optional(),nodes:n.array(n.record(n.string(),n.unknown())).optional(),edges:n.array(n.record(n.string(),n.unknown())).optional()},async({workflowId:o,name:t,description:r,nodes:e,edges:w})=>{if(!await d.query.workflows.findFirst({where:k(c(s.id,o),c(s.userId,i))}))return{content:[{type:"text",text:JSON.stringify({error:"Workflow not found"})}]};if(e&&!(await x(e,i)).valid)return{content:[{type:"text",text:JSON.stringify({error:"Invalid integration references"})}]};let u={updatedAt:new Date};t!==void 0&&(u.name=t),r!==void 0&&(u.description=r),e!==void 0&&(u.nodes=e),w!==void 0&&(u.edges=w);let[l]=await d.update(s).set(u).where(c(s.id,o)).returning();return{content:[{type:"text",text:JSON.stringify({...l,createdAt:l.createdAt.toISOString(),updatedAt:l.updatedAt.toISOString()})}]}}),a.tool("delete_workflow","Delete a workflow",{workflowId:n.string()},async({workflowId:o})=>{if(!await d.query.workflows.findFirst({where:k(c(s.id,o),c(s.userId,i))}))return{content:[{type:"text",text:JSON.stringify({error:"Workflow not found"})}]};let e=(await d.query.workflowExecutions.findMany({where:c(p.workflowId,o),columns:{id:!0}})).map(w=>w.id);return e.length>0&&(await d.delete(y).where(W(y.executionId,e)),await d.delete(p).where(c(p.workflowId,o))),await d.delete(s).where(c(s.id,o)),{content:[{type:"text",text:JSON.stringify({success:!0})}]}}),a.tool("duplicate_workflow","Duplicate a workflow",{workflowId:n.string()},async({workflowId:o})=>{let t=await d.query.workflows.findFirst({where:k(c(s.id,o),c(s.userId,i))});if(!t)return{content:[{type:"text",text:JSON.stringify({error:"Workflow not found"})}]};let r=t.nodes,e=r.map(l=>({...l,id:g()})),w=new Map(r.map((l,S)=>[l.id,e[S].id])),m=t.edges.map(l=>({...l,id:g(),source:w.get(l.source)||l.source,target:w.get(l.target)||l.target})),[u]=await d.insert(s).values({id:g(),name:`${t.name} (Copy)`,description:t.description,nodes:e,edges:m,userId:i,visibility:"private"}).returning();return{content:[{type:"text",text:JSON.stringify({...u,createdAt:u.createdAt.toISOString(),updatedAt:u.updatedAt.toISOString()})}]}}),a.tool("execute_workflow","Execute a workflow",{workflowId:n.string(),input:n.record(n.string(),n.unknown()).optional()},async({workflowId:o,input:t})=>{let r=await d.query.workflows.findFirst({where:k(c(s.id,o),c(s.userId,i))});if(!r)return{content:[{type:"text",text:JSON.stringify({error:"Workflow not found"})}]};if(!(await x(r.nodes,i)).valid)return{content:[{type:"text",text:JSON.stringify({error:"Invalid integration references"})}]};let[w]=await d.insert(p).values({workflowId:o,userId:i,status:"running",input:t??{}}).returning();return I(w.id,o,r.nodes,r.edges,t??{}),{content:[{type:"text",text:JSON.stringify({executionId:w.id,status:"running"})}]}}),a.tool("get_execution_status","Get execution status and logs",{executionId:n.string()},async({executionId:o})=>{let t=await d.query.workflowExecutions.findFirst({where:c(p.id,o),with:{workflow:!0}});if(!t||t.workflow.userId!==i)return{content:[{type:"text",text:JSON.stringify({error:"Execution not found"})}]};let r=await d.query.workflowExecutionLogs.findMany({where:c(y.executionId,o),orderBy:[v(y.timestamp)]});return{content:[{type:"text",text:JSON.stringify({status:t.status,input:t.input,output:t.output,error:t.error,startedAt:t.startedAt.toISOString(),completedAt:t.completedAt?.toISOString(),logs:r.map(e=>({nodeId:e.nodeId,nodeName:e.nodeName,nodeType:e.nodeType,status:e.status,input:e.input,output:e.output,error:e.error}))})}]}}),a.tool("list_available_actions","List all available plugin actions with their config fields",{},async()=>{let t=A().map(r=>({id:r.id,label:r.label,description:r.description,category:r.category,integration:r.integration,configFields:O(r.configFields).map(e=>({key:e.key,label:e.label,type:e.type,required:e.required,placeholder:e.placeholder}))}));return{content:[{type:"text",text:JSON.stringify(t)}]}}),a.tool("list_integrations","List the authenticated user's connected integrations",{},async()=>{let o=await d.select({id:f.id,name:f.name,type:f.type,isManaged:f.isManaged,createdAt:f.createdAt,updatedAt:f.updatedAt}).from(f).where(c(f.userId,i));return{content:[{type:"text",text:JSON.stringify(o.map(t=>({...t,createdAt:t.createdAt.toISOString(),updatedAt:t.updatedAt.toISOString()})))}]}})}function L(a){let i=new b({name:"workflow-builder",version:"1.0.0"});return J(i,a),i}async function M(a,i){let o=L(i),t=new _({sessionIdGenerator:void 0});return await o.connect(t),await t.handleRequest(a)}async function X(a){if(a.method==="POST"){if(process.env.NWB_ANONYMOUS_AUTH!=="false"){let i=await h(a);if(i)return M(a,i.id)}return q(N,async(i,o)=>M(i,o.userId))(a)}return new Response("Method not allowed",{status:405})}export{X as handleMcpRequest};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as s}from"./chunk-7WFHHPX4.js";import{q as n}from"./chunk-5J6TNMJG.js";import"server-only";function o(t){if(!t)return{};try{return JSON.parse(t)}catch{return{}}}function a(t,e){if(!(t==="GET"||!e))try{let r=JSON.parse(e);return Object.keys(r).length>0?JSON.stringify(r):void 0}catch{let r=e.trim();return r&&r!=="{}"?e:void 0}}function i(t){return t.headers.get("content-type")?.includes("application/json")?t.json():t.text()}async function c(t){if(!t.endpoint)return{success:!1,error:"HTTP request failed: URL is required"};try{let e=await fetch(t.endpoint,{method:t.httpMethod,headers:o(t.httpHeaders),body:a(t.httpMethod,t.httpBody)});if(!e.ok){let u=await e.text().catch(()=>"Unknown error");return{success:!1,error:`HTTP request failed with status ${e.status}: ${u}`,status:e.status}}return{success:!0,data:await i(e),status:e.status}}catch(e){return{success:!1,error:`HTTP request failed: ${s(e)}`}}}async function p(t){"use step";return n(t,()=>c(t))}p.maxRetries=0;export{p as httpRequestStep};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-R5GS6TJS.js";import"./chunk-CYVALTSI.js";import"./chunk-IEOZJAW2.js";import"./chunk-6UXAINJQ.js";import"./chunk-BNX2SV7E.js";import"./chunk-PRVESNIO.js";import"./chunk-KFTXS23Q.js";import"./chunk-QRG4O4PE.js";import"./chunk-7WFHHPX4.js";import{q as m}from"./chunk-5J6TNMJG.js";import"server-only";function h(t){let c=typeof t.items=="string"?JSON.parse(t.items):t.items,n=Array.isArray(c)?c:[],e=Math.max(1,t.batchSize||1),o=t.currentBatchIndex??0,r=n.length,a=Math.ceil(r/e),s=o*e,p=Math.min(s+e,r),u=n.slice(s,p),i=u[0];return{hasMore:o<a-1,currentBatchIndex:o,currentBatch:u,currentItem:i,currentIndex:s,totalItems:r,totalBatches:a,items:n,batchSize:e}}async function I(t){"use step";return m(t,()=>Promise.resolve(h(t)))}I.maxRetries=0;export{I as loopStep};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-R5GS6TJS.js";import"./chunk-CYVALTSI.js";import"./chunk-IEOZJAW2.js";import"./chunk-6UXAINJQ.js";import"./chunk-BNX2SV7E.js";import"./chunk-PRVESNIO.js";import"./chunk-KFTXS23Q.js";import"./chunk-QRG4O4PE.js";import"./chunk-7WFHHPX4.js";import{q as g}from"./chunk-5J6TNMJG.js";import"server-only";function p(e,t){if(e&&typeof e=="object")return e[t]}function m(e,t){let o=[...e,...t];return{merged:o,totalItems:o.length}}function f(e,t,o){let l=Math.max(e.length,t.length),c=o!=="discard",u=[];for(let r=0;r<l;r++){let s=e[r],n=t[r];!c&&(s===void 0||n===void 0)||u.push({...s&&typeof s=="object"?s:{input1:s??null},...n&&typeof n=="object"?n:{input2:n??null}})}return{merged:u,totalItems:u.length}}function h(e,t,o,l,c){let u=new Map;for(let n of t){let i=p(n,l);u.has(i)||u.set(i,[]),u.get(i).push(n)}let r=[],s=new Set;for(let n of e){let i=p(n,o),d=u.get(i);if(d&&d.length>0){s.add(i);for(let a of d)r.push({...typeof n=="object"?n:{},...typeof a=="object"?a:{}})}else(c==="leftOuter"||c==="fullOuter")&&r.push({...typeof n=="object"?n:{}})}if(c==="rightOuter"||c==="fullOuter")for(let n of t){let i=p(n,l);s.has(i)||r.push({...typeof n=="object"?n:{}})}return{merged:r,totalItems:r.length}}function y(e){let t=Array.isArray(e.input1)?e.input1:[],o=Array.isArray(e.input2)?e.input2:[];switch(e.mode||"append"){case"append":return m(t,o);case"combineByPosition":return f(t,o,e.unmatchedHandling||"useNull");case"combineByFields":return h(t,o,e.matchField1||"id",e.matchField2||"id",e.joinType||"inner");default:return m(t,o)}}async function w(e){"use step";return g(e,()=>Promise.resolve(y(e)))}w.maxRetries=0;export{w as mergeStep};
|
package/dist/next/index.d.ts
CHANGED
|
@@ -6,8 +6,17 @@ declare const NextWorkflowBuilderConfigSchema: z.ZodObject<{
|
|
|
6
6
|
debug: z.ZodOptional<z.ZodBoolean>;
|
|
7
7
|
/** Set Better Auth options (must be JSON-serializable). */
|
|
8
8
|
authOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
9
|
+
/** Enable anonymous authentication so users can try the app before signing in. Defaults to true. */
|
|
10
|
+
anonymousAuth: z.ZodOptional<z.ZodBoolean>;
|
|
9
11
|
/** Override the database connection URL. Defaults to process.env.DATABASE_URL. */
|
|
10
12
|
databaseUrl: z.ZodOptional<z.ZodString>;
|
|
13
|
+
/** MCP (Model Context Protocol) server configuration. */
|
|
14
|
+
mcp: z.ZodOptional<z.ZodObject<{
|
|
15
|
+
/** Enable the MCP server endpoint. */
|
|
16
|
+
enabled: z.ZodBoolean;
|
|
17
|
+
/** Login page path for OAuth consent. Defaults to "/sign-in". */
|
|
18
|
+
loginPage: z.ZodOptional<z.ZodString>;
|
|
19
|
+
}, z.core.$strict>>;
|
|
11
20
|
}, z.core.$strict>;
|
|
12
21
|
|
|
13
22
|
/**
|
package/dist/next/index.js
CHANGED
|
@@ -1,84 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
discoverPlugins
|
|
3
|
-
} from "../chunk-C7GDB4KC.js";
|
|
4
|
-
import "../chunk-OQHML4II.js";
|
|
5
|
-
import "../chunk-3XFDIK7H.js";
|
|
6
|
-
|
|
7
|
-
// src/next/index.ts
|
|
8
|
-
import { join } from "path";
|
|
9
|
-
import { z as z2 } from "zod";
|
|
10
|
-
|
|
11
|
-
// src/next/schema.ts
|
|
12
|
-
import { z } from "zod";
|
|
13
|
-
var NextWorkflowBuilderConfigSchema = z.strictObject({
|
|
14
|
-
/** Enable debug logging. */
|
|
15
|
-
debug: z.boolean().optional(),
|
|
16
|
-
/** Set Better Auth options (must be JSON-serializable). */
|
|
17
|
-
authOptions: z.record(z.string(), z.unknown()).optional(),
|
|
18
|
-
/** Override the database connection URL. Defaults to process.env.DATABASE_URL. */
|
|
19
|
-
databaseUrl: z.string().optional()
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
// src/next/index.ts
|
|
23
|
-
var VIRTUAL_PLUGINS_MODULE = "virtual:workflow-builder-plugins";
|
|
24
|
-
var VIRTUAL_STEP_REGISTRY_MODULE = "virtual:workflow-builder-step-registry";
|
|
25
|
-
var nextWorkflowBuilder = (config = {}) => {
|
|
26
|
-
const { error, data: loaderOptions } = NextWorkflowBuilderConfigSchema.safeParse(config);
|
|
27
|
-
if (error) {
|
|
28
|
-
console.error("Error validating NextWorkflowBuilderConfig");
|
|
29
|
-
throw z2.prettifyError(error);
|
|
30
|
-
}
|
|
31
|
-
if (loaderOptions.authOptions) {
|
|
32
|
-
process.env.NWB_AUTH_OPTIONS = JSON.stringify(loaderOptions.authOptions);
|
|
33
|
-
}
|
|
34
|
-
if (loaderOptions.databaseUrl) {
|
|
35
|
-
process.env.NWB_DATABASE_URL = loaderOptions.databaseUrl;
|
|
36
|
-
}
|
|
37
|
-
discoverPlugins();
|
|
38
|
-
return function withNextWorkflowBuilder(nextConfig = {}) {
|
|
39
|
-
const consumerPluginsRelative = "./plugins/index.ts";
|
|
40
|
-
const consumerPluginsAbsolute = join(process.cwd(), "plugins", "index.ts");
|
|
41
|
-
const consumerStepRegistryRelative = "./lib/step-registry.ts";
|
|
42
|
-
const consumerStepRegistryAbsolute = join(process.cwd(), "lib", "step-registry.ts");
|
|
43
|
-
const inlinedEnv = {};
|
|
44
|
-
if (loaderOptions.authOptions) {
|
|
45
|
-
inlinedEnv.NWB_AUTH_OPTIONS = JSON.stringify(loaderOptions.authOptions);
|
|
46
|
-
}
|
|
47
|
-
if (loaderOptions.databaseUrl) {
|
|
48
|
-
inlinedEnv.NWB_DATABASE_URL = loaderOptions.databaseUrl;
|
|
49
|
-
}
|
|
50
|
-
return {
|
|
51
|
-
...nextConfig,
|
|
52
|
-
...Object.keys(inlinedEnv).length > 0 ? {
|
|
53
|
-
env: {
|
|
54
|
-
...nextConfig.env,
|
|
55
|
-
...inlinedEnv
|
|
56
|
-
}
|
|
57
|
-
} : {},
|
|
58
|
-
// Turbopack alias (used by `next dev` in Next.js 15+)
|
|
59
|
-
turbopack: {
|
|
60
|
-
...nextConfig.turbopack,
|
|
61
|
-
resolveAlias: {
|
|
62
|
-
...nextConfig.turbopack?.resolveAlias,
|
|
63
|
-
[VIRTUAL_PLUGINS_MODULE]: consumerPluginsRelative,
|
|
64
|
-
[VIRTUAL_STEP_REGISTRY_MODULE]: consumerStepRegistryRelative
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
// Webpack alias (used by `next build`)
|
|
68
|
-
webpack: (webpackConfig, options) => {
|
|
69
|
-
webpackConfig.resolve = webpackConfig.resolve || {};
|
|
70
|
-
webpackConfig.resolve.alias = webpackConfig.resolve.alias || {};
|
|
71
|
-
webpackConfig.resolve.alias[VIRTUAL_PLUGINS_MODULE] = consumerPluginsAbsolute;
|
|
72
|
-
webpackConfig.resolve.alias[VIRTUAL_STEP_REGISTRY_MODULE] = consumerStepRegistryAbsolute;
|
|
73
|
-
if (typeof nextConfig.webpack === "function") {
|
|
74
|
-
return nextConfig.webpack(webpackConfig, options);
|
|
75
|
-
}
|
|
76
|
-
return webpackConfig;
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
};
|
|
80
|
-
};
|
|
81
|
-
var next_default = nextWorkflowBuilder;
|
|
82
|
-
export {
|
|
83
|
-
next_default as default
|
|
84
|
-
};
|
|
1
|
+
import{a as l}from"../chunk-CYVALTSI.js";import"../chunk-BNX2SV7E.js";import"../chunk-QRG4O4PE.js";import{join as a}from"path";import{z as _}from"zod";import{z as o}from"zod";var n=o.strictObject({debug:o.boolean().optional(),authOptions:o.record(o.string(),o.unknown()).optional(),anonymousAuth:o.boolean().optional(),databaseUrl:o.string().optional(),mcp:o.strictObject({enabled:o.boolean(),loginPage:o.string().optional()}).optional()});var u="virtual:workflow-builder-plugins",p="virtual:workflow-builder-step-registry",A=(c={})=>{let{error:i,data:e}=n.safeParse(c);if(i)throw console.error("Error validating NextWorkflowBuilderConfig"),_.prettifyError(i);return e.authOptions&&(process.env.NWB_AUTH_OPTIONS=JSON.stringify(e.authOptions)),e.databaseUrl&&(process.env.NWB_DATABASE_URL=e.databaseUrl),e.anonymousAuth===!1&&(process.env.NWB_ANONYMOUS_AUTH="false"),e.mcp?.enabled&&(process.env.NWB_MCP_ENABLED="true",process.env.NWB_MCP_LOGIN_PAGE=e.mcp.loginPage||"/auth/sign-in"),l(),function(s={}){let f="./plugins/index.ts",d=a(process.cwd(),"plugins","index.ts"),N="./lib/step-registry.ts",g=a(process.cwd(),"lib","step-registry.ts"),t={};return e.authOptions&&(t.NWB_AUTH_OPTIONS=JSON.stringify(e.authOptions)),e.databaseUrl&&(t.NWB_DATABASE_URL=e.databaseUrl),e.anonymousAuth===!1&&(t.NWB_ANONYMOUS_AUTH="false"),e.mcp?.enabled&&(t.NWB_MCP_ENABLED="true",t.NWB_MCP_LOGIN_PAGE=e.mcp.loginPage||"/auth/sign-in"),{...s,...Object.keys(t).length>0?{env:{...s.env,...t}}:{},turbopack:{...s.turbopack,resolveAlias:{...s.turbopack?.resolveAlias,[u]:f,[p]:N}},webpack:(r,m)=>(r.resolve=r.resolve||{},r.resolve.alias=r.resolve.alias||{},r.resolve.alias[u]=d,r.resolve.alias[p]=g,typeof s.webpack=="function"?s.webpack(r,m):r)}}},U=A;export{U as default};
|
package/dist/plugins/index.js
CHANGED
|
@@ -1,54 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
computeActionId,
|
|
3
|
-
findActionById,
|
|
4
|
-
flattenConfigFields,
|
|
5
|
-
generateAIActionPrompts,
|
|
6
|
-
getActionsByCategory,
|
|
7
|
-
getAllActions,
|
|
8
|
-
getAllDependencies,
|
|
9
|
-
getAllEnvVars,
|
|
10
|
-
getAllIntegrations,
|
|
11
|
-
getCodegenTemplate,
|
|
12
|
-
getCredentialMapping,
|
|
13
|
-
getDependenciesForActions,
|
|
14
|
-
getIntegration,
|
|
15
|
-
getIntegrationDescriptions,
|
|
16
|
-
getIntegrationLabels,
|
|
17
|
-
getIntegrationTypes,
|
|
18
|
-
getOutputDisplayConfig,
|
|
19
|
-
getPluginEnvVars,
|
|
20
|
-
getSortedIntegrationTypes,
|
|
21
|
-
integrationRequiresCredentials,
|
|
22
|
-
isFieldGroup,
|
|
23
|
-
parseActionId,
|
|
24
|
-
registerCodegenTemplates,
|
|
25
|
-
registerIntegration,
|
|
26
|
-
registerOutputDisplayConfigs
|
|
27
|
-
} from "../chunk-3XFDIK7H.js";
|
|
28
|
-
export {
|
|
29
|
-
computeActionId,
|
|
30
|
-
findActionById,
|
|
31
|
-
flattenConfigFields,
|
|
32
|
-
generateAIActionPrompts,
|
|
33
|
-
getActionsByCategory,
|
|
34
|
-
getAllActions,
|
|
35
|
-
getAllDependencies,
|
|
36
|
-
getAllEnvVars,
|
|
37
|
-
getAllIntegrations,
|
|
38
|
-
getCodegenTemplate,
|
|
39
|
-
getCredentialMapping,
|
|
40
|
-
getDependenciesForActions,
|
|
41
|
-
getIntegration,
|
|
42
|
-
getIntegrationDescriptions,
|
|
43
|
-
getIntegrationLabels,
|
|
44
|
-
getIntegrationTypes,
|
|
45
|
-
getOutputDisplayConfig,
|
|
46
|
-
getPluginEnvVars,
|
|
47
|
-
getSortedIntegrationTypes,
|
|
48
|
-
integrationRequiresCredentials,
|
|
49
|
-
isFieldGroup,
|
|
50
|
-
parseActionId,
|
|
51
|
-
registerCodegenTemplates,
|
|
52
|
-
registerIntegration,
|
|
53
|
-
registerOutputDisplayConfigs
|
|
54
|
-
};
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y}from"../chunk-QRG4O4PE.js";export{e as computeActionId,m as findActionById,w as flattenConfigFields,x as generateAIActionPrompts,l as getActionsByCategory,k as getAllActions,q as getAllDependencies,t as getAllEnvVars,i as getAllIntegrations,b as getCodegenTemplate,u as getCredentialMapping,r as getDependenciesForActions,h as getIntegration,o as getIntegrationDescriptions,n as getIntegrationLabels,j as getIntegrationTypes,d as getOutputDisplayConfig,s as getPluginEnvVars,p as getSortedIntegrationTypes,y as integrationRequiresCredentials,v as isFieldGroup,f as parseActionId,a as registerCodegenTemplates,g as registerIntegration,c as registerOutputDisplayConfigs};
|
|
@@ -1,3 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Route handler for /.well-known/oauth-authorization-server
|
|
3
|
+
*
|
|
4
|
+
* MCP clients (e.g. Claude Desktop) fetch OAuth authorization server metadata
|
|
5
|
+
* at the root /.well-known/oauth-authorization-server per RFC 8414.
|
|
6
|
+
*
|
|
7
|
+
* Usage: re-export from app/.well-known/oauth-authorization-server/route.ts
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* export { oAuthDiscoveryHandler as GET } from "next-workflow-builder/api";
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
declare const oAuthDiscoveryHandler: (request: Request) => Promise<Response>;
|
|
15
|
+
/**
|
|
16
|
+
* Route handler for /.well-known/oauth-protected-resource
|
|
17
|
+
*
|
|
18
|
+
* MCP clients fetch protected resource metadata at the root
|
|
19
|
+
* /.well-known/oauth-protected-resource to discover the authorization server.
|
|
20
|
+
*
|
|
21
|
+
* Usage: re-export from app/.well-known/oauth-protected-resource/route.ts
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* export { oAuthResourceHandler as GET } from "next-workflow-builder/api";
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
declare const oAuthResourceHandler: (request: Request) => Promise<Response>;
|
|
29
|
+
|
|
1
30
|
declare function GET(request: Request): Promise<Response>;
|
|
2
31
|
declare function POST(request: Request): Promise<Response>;
|
|
3
32
|
declare function PUT(request: Request): Promise<Response>;
|
|
@@ -5,4 +34,4 @@ declare function PATCH(request: Request): Promise<Response>;
|
|
|
5
34
|
declare function DELETE(request: Request): Promise<Response>;
|
|
6
35
|
declare function OPTIONS(_request: Request): Promise<Response>;
|
|
7
36
|
|
|
8
|
-
export { DELETE, GET, OPTIONS, PATCH, POST, PUT };
|
|
37
|
+
export { DELETE, GET, OPTIONS, PATCH, POST, PUT, oAuthDiscoveryHandler, oAuthResourceHandler };
|