@universal-workflow/widget-core 0.1.1

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/README.md ADDED
@@ -0,0 +1,24 @@
1
+ # @universal-workflow/widget-core
2
+
3
+ Core logic and utilities for the Universal Workflow system.
4
+
5
+ ## Features
6
+
7
+ - License Management
8
+ - API Client for workflows
9
+ - Serialization/Deserialization
10
+ - Node Registry
11
+
12
+ ## Installation
13
+
14
+ ```bash
15
+ npm install @universal-workflow/widget-core
16
+ ```
17
+
18
+ ## Usage
19
+
20
+ ```typescript
21
+ import { ApiClient, LicenseManager } from "@universal-workflow/widget-core";
22
+
23
+ // Use as needed
24
+ ```
@@ -0,0 +1,119 @@
1
+ interface LicenseConfig {
2
+ licenseKey: string;
3
+ widgetVersion: string;
4
+ validationEndpoint?: string;
5
+ }
6
+ interface ValidationResult {
7
+ valid: boolean;
8
+ plan?: string;
9
+ features?: Record<string, any>;
10
+ reason?: string;
11
+ }
12
+ declare class LicenseManager {
13
+ private config;
14
+ private validationResult;
15
+ constructor(config: LicenseConfig);
16
+ validate(): Promise<ValidationResult>;
17
+ isFeatureEnabled(featureName: string): boolean;
18
+ }
19
+
20
+ interface ApiConfig {
21
+ baseUrl: string;
22
+ endpoints: {
23
+ create: string;
24
+ update: string;
25
+ get: string;
26
+ list?: string;
27
+ };
28
+ headers?: Record<string, string>;
29
+ }
30
+ declare class ApiClient {
31
+ private config;
32
+ constructor(config: ApiConfig);
33
+ private request;
34
+ getWorkflow(id: string): Promise<any>;
35
+ createWorkflow(workflow: any): Promise<{
36
+ id: string;
37
+ }>;
38
+ updateWorkflow(id: string, workflow: any): Promise<void>;
39
+ }
40
+
41
+ interface WorkflowData {
42
+ nodes: any[];
43
+ edges: any[];
44
+ viewport?: {
45
+ x: number;
46
+ y: number;
47
+ zoom: number;
48
+ };
49
+ }
50
+ declare class WorkflowSerializer {
51
+ static serialize(nodes: any[], edges: any[], viewport?: any): string;
52
+ static deserialize(json: string): {
53
+ nodes: any[];
54
+ edges: any[];
55
+ viewport?: any;
56
+ };
57
+ }
58
+ declare const serialize: typeof WorkflowSerializer.serialize;
59
+ declare const deserialize: typeof WorkflowSerializer.deserialize;
60
+
61
+ interface ConnectorOperation {
62
+ id: string;
63
+ label: string;
64
+ description?: string;
65
+ method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
66
+ path: string;
67
+ inputs: NodeField[];
68
+ }
69
+ interface ConnectorDefinition {
70
+ id: string;
71
+ label: string;
72
+ category: NodeCategory;
73
+ icon: string;
74
+ color: string;
75
+ baseUrl: string;
76
+ auth: {
77
+ type: 'bearer' | 'header' | 'query' | 'none';
78
+ key?: string;
79
+ placeholder?: string;
80
+ };
81
+ operations: ConnectorOperation[];
82
+ }
83
+ declare function createConnectorNode(def: ConnectorDefinition): NodeTypeDefinition;
84
+
85
+ type NodeCategory = 'trigger' | 'action' | 'logic' | 'utility';
86
+ interface NodeHandle {
87
+ id: string;
88
+ type: 'source' | 'target';
89
+ label?: string;
90
+ }
91
+ interface NodeField {
92
+ key: string;
93
+ label: string;
94
+ type: 'text' | 'number' | 'select' | 'boolean' | 'json' | 'code';
95
+ options?: {
96
+ label: string;
97
+ value: string;
98
+ }[];
99
+ placeholder?: string;
100
+ description?: string;
101
+ }
102
+ interface NodeTypeDefinition {
103
+ type: string;
104
+ label: string;
105
+ description: string;
106
+ category: NodeCategory;
107
+ icon: string;
108
+ color: string;
109
+ handles: NodeHandle[];
110
+ inputs: NodeField[];
111
+ }
112
+
113
+ declare const nodeRegistry: Record<string, NodeTypeDefinition>;
114
+ declare function getConnectorDetails(typeId: string): ConnectorDefinition | undefined;
115
+
116
+ declare const standardConnectors: ConnectorDefinition[];
117
+ declare function registerConnector(def: ConnectorDefinition): void;
118
+
119
+ export { ApiClient, type ApiConfig, type ConnectorDefinition, type ConnectorOperation, type LicenseConfig, LicenseManager, type NodeCategory, type NodeField, type NodeHandle, type NodeTypeDefinition, type WorkflowData, WorkflowSerializer, createConnectorNode, deserialize, getConnectorDetails, nodeRegistry, registerConnector, serialize, standardConnectors };
@@ -0,0 +1,119 @@
1
+ interface LicenseConfig {
2
+ licenseKey: string;
3
+ widgetVersion: string;
4
+ validationEndpoint?: string;
5
+ }
6
+ interface ValidationResult {
7
+ valid: boolean;
8
+ plan?: string;
9
+ features?: Record<string, any>;
10
+ reason?: string;
11
+ }
12
+ declare class LicenseManager {
13
+ private config;
14
+ private validationResult;
15
+ constructor(config: LicenseConfig);
16
+ validate(): Promise<ValidationResult>;
17
+ isFeatureEnabled(featureName: string): boolean;
18
+ }
19
+
20
+ interface ApiConfig {
21
+ baseUrl: string;
22
+ endpoints: {
23
+ create: string;
24
+ update: string;
25
+ get: string;
26
+ list?: string;
27
+ };
28
+ headers?: Record<string, string>;
29
+ }
30
+ declare class ApiClient {
31
+ private config;
32
+ constructor(config: ApiConfig);
33
+ private request;
34
+ getWorkflow(id: string): Promise<any>;
35
+ createWorkflow(workflow: any): Promise<{
36
+ id: string;
37
+ }>;
38
+ updateWorkflow(id: string, workflow: any): Promise<void>;
39
+ }
40
+
41
+ interface WorkflowData {
42
+ nodes: any[];
43
+ edges: any[];
44
+ viewport?: {
45
+ x: number;
46
+ y: number;
47
+ zoom: number;
48
+ };
49
+ }
50
+ declare class WorkflowSerializer {
51
+ static serialize(nodes: any[], edges: any[], viewport?: any): string;
52
+ static deserialize(json: string): {
53
+ nodes: any[];
54
+ edges: any[];
55
+ viewport?: any;
56
+ };
57
+ }
58
+ declare const serialize: typeof WorkflowSerializer.serialize;
59
+ declare const deserialize: typeof WorkflowSerializer.deserialize;
60
+
61
+ interface ConnectorOperation {
62
+ id: string;
63
+ label: string;
64
+ description?: string;
65
+ method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
66
+ path: string;
67
+ inputs: NodeField[];
68
+ }
69
+ interface ConnectorDefinition {
70
+ id: string;
71
+ label: string;
72
+ category: NodeCategory;
73
+ icon: string;
74
+ color: string;
75
+ baseUrl: string;
76
+ auth: {
77
+ type: 'bearer' | 'header' | 'query' | 'none';
78
+ key?: string;
79
+ placeholder?: string;
80
+ };
81
+ operations: ConnectorOperation[];
82
+ }
83
+ declare function createConnectorNode(def: ConnectorDefinition): NodeTypeDefinition;
84
+
85
+ type NodeCategory = 'trigger' | 'action' | 'logic' | 'utility';
86
+ interface NodeHandle {
87
+ id: string;
88
+ type: 'source' | 'target';
89
+ label?: string;
90
+ }
91
+ interface NodeField {
92
+ key: string;
93
+ label: string;
94
+ type: 'text' | 'number' | 'select' | 'boolean' | 'json' | 'code';
95
+ options?: {
96
+ label: string;
97
+ value: string;
98
+ }[];
99
+ placeholder?: string;
100
+ description?: string;
101
+ }
102
+ interface NodeTypeDefinition {
103
+ type: string;
104
+ label: string;
105
+ description: string;
106
+ category: NodeCategory;
107
+ icon: string;
108
+ color: string;
109
+ handles: NodeHandle[];
110
+ inputs: NodeField[];
111
+ }
112
+
113
+ declare const nodeRegistry: Record<string, NodeTypeDefinition>;
114
+ declare function getConnectorDetails(typeId: string): ConnectorDefinition | undefined;
115
+
116
+ declare const standardConnectors: ConnectorDefinition[];
117
+ declare function registerConnector(def: ConnectorDefinition): void;
118
+
119
+ export { ApiClient, type ApiConfig, type ConnectorDefinition, type ConnectorOperation, type LicenseConfig, LicenseManager, type NodeCategory, type NodeField, type NodeHandle, type NodeTypeDefinition, type WorkflowData, WorkflowSerializer, createConnectorNode, deserialize, getConnectorDetails, nodeRegistry, registerConnector, serialize, standardConnectors };
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";var c=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var k=(o,e)=>{for(var t in e)c(o,t,{get:e[t],enumerable:!0})},f=(o,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of h(e))!m.call(o,i)&&i!==t&&c(o,i,{get:()=>e[i],enumerable:!(a=g(e,i))||a.enumerable});return o};var x=o=>f(c({},"__esModule",{value:!0}),o);var D={};k(D,{ApiClient:()=>y,LicenseManager:()=>d,WorkflowSerializer:()=>l,createConnectorNode:()=>r,deserialize:()=>S,getConnectorDetails:()=>w,nodeRegistry:()=>s,registerConnector:()=>C,serialize:()=>T,standardConnectors:()=>n});module.exports=x(D);var v="http://localhost:3000/api/v1/license/validate",d=class{constructor(e){this.config=e;this.validationResult=null}async validate(){if(this.validationResult)return this.validationResult;try{let e=this.config.validationEndpoint||v,a=await(await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({licenseKey:this.config.licenseKey,widgetVersion:this.config.widgetVersion,originUrl:typeof window!="undefined"?window.location.origin:""})})).json();return this.validationResult=a,a}catch(e){return console.error("License validation failed",e),{valid:!1,reason:"Network Error"}}}isFeatureEnabled(e){var t,a;return(t=this.validationResult)!=null&&t.valid?!!((a=this.validationResult.features)!=null&&a[e]):!1}};var y=class{constructor(e){this.config=e}async request(e,t,a){let i={"Content-Type":"application/json",...this.config.headers},p=await fetch(e,{method:t,headers:i,body:a?JSON.stringify(a):void 0});if(!p.ok)throw new Error(`API Request failed: ${p.statusText}`);return p.json()}async getWorkflow(e){let t=`${this.config.baseUrl}${this.config.endpoints.get.replace(":id",e)}`;return this.request(t,"GET")}async createWorkflow(e){let t=`${this.config.baseUrl}${this.config.endpoints.create}`;return this.request(t,"POST",e)}async updateWorkflow(e,t){let a=`${this.config.baseUrl}${this.config.endpoints.update.replace(":id",e)}`;return this.request(a,"PUT",t)}};var l=class{static serialize(e,t,a){return JSON.stringify({nodes:e,edges:t,viewport:a})}static deserialize(e){try{let t=JSON.parse(e);return{nodes:t.nodes||[],edges:t.edges||[],viewport:t.viewport}}catch{return{nodes:[],edges:[]}}}},T=l.serialize,S=l.deserialize;function r(o){return{type:o.id,label:o.label,description:`Integration with ${o.label}`,category:o.category,icon:o.icon,color:o.color,handles:[{id:"in",type:"target"},{id:"out",type:"source"}],inputs:[{key:"auth_token",label:"API Key / Token",type:"text",placeholder:o.auth.placeholder||"Enter API Key"},{key:"operation",label:"Action",type:"select",options:o.operations.map(e=>({label:e.label,value:e.id}))}]}}var n=[{id:"google-sheets",label:"Google Sheets",category:"utility",icon:"Sheet",color:"emerald",baseUrl:"https://sheets.googleapis.com/v4/spreadsheets",auth:{type:"bearer",placeholder:"OAuth Token"},operations:[{id:"append_row",label:"Append Row",method:"POST",path:"/{spreadsheetId}/values/{range}:append",inputs:[{key:"spreadsheetId",label:"Spreadsheet ID",type:"text"},{key:"range",label:"Range (Sheet1!A1)",type:"text"},{key:"values",label:"Row Values (JSON Array)",type:"json"}]},{id:"get_values",label:"Get Row(s)",method:"GET",path:"/{spreadsheetId}/values/{range}",inputs:[{key:"spreadsheetId",label:"Spreadsheet ID",type:"text"},{key:"range",label:"Range",type:"text"}]}]},{id:"slack-connector",label:"Slack API",category:"action",icon:"MessageSquare",color:"blue",baseUrl:"https://slack.com/api",auth:{type:"bearer",placeholder:"xoxb-..."},operations:[{id:"post_message",label:"Post Message",method:"POST",path:"/chat.postMessage",inputs:[{key:"channel",label:"Channel ID",type:"text"},{key:"text",label:"Message Text",type:"text"}]}]},{id:"openai",label:"OpenAI",category:"action",icon:"Bot",color:"zinc",baseUrl:"https://api.openai.com/v1",auth:{type:"bearer",placeholder:"sk-..."},operations:[{id:"chat_completion",label:"Chat Completion",method:"POST",path:"/chat/completions",inputs:[{key:"model",label:"Model",type:"select",options:[{label:"GPT-4o",value:"gpt-4o"},{label:"GPT-3.5",value:"gpt-3.5-turbo"}]},{key:"messages",label:"Messages (JSON)",type:"json"}]}]}];function C(o){n.push(o)}var b=[{id:"triggers",nodes:[{type:"manual-trigger",label:"Manual Trigger",description:"Start flow on button click",category:"trigger",icon:"Play",color:"emerald",inputs:[]},{type:"cron-trigger",label:"Cron Schedule",description:"Trigger on a schedule",category:"trigger",icon:"Clock",color:"emerald",inputs:[{key:"expression",label:"Cron Expression",type:"text",placeholder:"0 9 * * 1 (Every Mon at 9am)"}]},{id:"github-trigger",label:"GitHub Trigger",category:"trigger",icon:"Github",color:"zinc",baseUrl:"https://api.github.com",auth:{type:"header",key:"X-GitHub-Token"},operations:[{id:"on_push",label:"On Push",method:"POST",path:"/repos/{owner}/{repo}/hooks",inputs:[{key:"owner",label:"Owner",type:"text"},{key:"repo",label:"Repository",type:"text"}]},{id:"on_star",label:"On New Star",method:"POST",path:"/repos/{owner}/{repo}/hooks",inputs:[{key:"owner",label:"Owner",type:"text"},{key:"repo",label:"Repository",type:"text"}]}]}]},{id:"logic",nodes:[{type:"switch",label:"Switch / Router",description:"Route based on value",category:"logic",icon:"GitFork",color:"orange",inputs:[{key:"property",label:"Property to Check",type:"text"},{key:"cases",label:"Cases (comma sep)",type:"text",placeholder:"marketing, sales, support"}]},{type:"ab-split",label:"A/B Split",description:"Randomly split traffic",category:"logic",icon:"Percent",color:"orange",inputs:[{key:"percentA",label:"Percentage for A",type:"text",placeholder:"50"}]},{type:"wait",label:"Wait / Delay",description:"Pause execution",category:"logic",icon:"Timer",color:"orange",inputs:[{key:"duration",label:"Duration",type:"text",placeholder:"5000"},{key:"unit",label:"Unit",type:"select",options:[{label:"Milliseconds",value:"ms"},{label:"Seconds",value:"s"}]}]}]},{id:"utilities",nodes:[{type:"text-transform",label:"Text Transform",description:"Modify text strings",category:"utility",icon:"Type",color:"zinc",inputs:[{key:"action",label:"Action",type:"select",options:[{label:"To Upper Case",value:"upper"},{label:"To Lower Case",value:"lower"},{label:"Trim",value:"trim"},{label:"Replace",value:"replace"}]},{key:"input",label:"Input Text",type:"text"}]},{type:"json-parser",label:"JSON Helper",description:"Parse or stringify JSON",category:"utility",icon:"Code",color:"zinc",inputs:[{key:"action",label:"Action",type:"select",options:[{label:"Parse (String to JSON)",value:"parse"},{label:"Stringify (JSON to String)",value:"stringify"}]},{key:"data",label:"Data",type:"json"}]},{type:"math-calc",label:"Math Calculator",description:"Perform calculations",category:"utility",icon:"Calculator",color:"zinc",inputs:[{key:"operation",label:"Operation",type:"select",options:[{label:"Add",value:"add"},{label:"Subtract",value:"sub"},{label:"Multiply",value:"mul"},{label:"Divide",value:"div"},{label:"Random Number",value:"random"}]},{key:"a",label:"Value A",type:"text"},{key:"b",label:"Value B",type:"text"}]},{type:"crypto",label:"Cryptography",description:"Hash or Encrypt data",category:"utility",icon:"Lock",color:"zinc",inputs:[{key:"algo",label:"Algorithm",type:"select",options:[{label:"MD5",value:"md5"},{label:"SHA-256",value:"sha256"},{label:"Base64 Encode",value:"base64_enc"},{label:"Base64 Decode",value:"base64_dec"}]},{key:"input",label:"value",type:"text"}]},{type:"date-time",label:"Date & Time",description:"Format or manipulate dates",category:"utility",icon:"Calendar",color:"zinc",inputs:[{key:"operation",label:"Action",type:"select",options:[{label:"Now (ISO)",value:"now"},{label:"Format Date",value:"format"},{label:"Add Time",value:"add"}]},{key:"date",label:"Date String",type:"text"},{key:"format",label:"Format Pattern",type:"text",placeholder:"YYYY-MM-DD"}]}]},{id:"integrations-productivity",nodes:[{id:"google-drive",label:"Google Drive",icon:"HardDrive",color:"blue",category:"action",baseUrl:"https://www.googleapis.com/drive/v3",auth:{type:"bearer",placeholder:"OAuth Token"},operations:[{id:"list",label:"List Files",method:"GET",path:"/files",inputs:[{key:"q",label:"Query",type:"text"}]},{id:"upload",label:"Upload File",method:"POST",path:"/files",inputs:[{key:"name",label:"Name",type:"text"},{key:"content",label:"Content",type:"text"}]}]},{id:"notion",label:"Notion",icon:"FileText",color:"zinc",category:"action",baseUrl:"https://api.notion.com/v1",auth:{type:"header",key:"Authorization",placeholder:"Bearer secret_..."},operations:[{id:"create_page",label:"Create Page",method:"POST",path:"/pages",inputs:[{key:"parent_id",label:"Parent DB ID",type:"text"},{key:"properties",label:"Properties JSON",type:"json"}]},{id:"query_db",label:"Query Database",method:"POST",path:"/databases/{id}/query",inputs:[{key:"id",label:"Database ID",type:"text"}]}]},{id:"airtable",label:"Airtable",icon:"Database",color:"amber",category:"action",baseUrl:"https://api.airtable.com/v0",auth:{type:"bearer",placeholder:"pat_..."},operations:[{id:"create_record",label:"Create Record",method:"POST",path:"/{baseId}/{tableId}",inputs:[{key:"baseId",label:"Base ID",type:"text"},{key:"tableId",label:"Table Name",type:"text"},{key:"fields",label:"Fields JSON",type:"json"}]},{id:"list_records",label:"List Records",method:"GET",path:"/{baseId}/{tableId}",inputs:[{key:"baseId",label:"Base ID",type:"text"},{key:"tableId",label:"Table Name",type:"text"}]}]}]},{id:"integrations-crm-marketing",nodes:[{id:"salesforce",label:"Salesforce",icon:"Cloud",color:"blue",category:"action",baseUrl:"https://{instance}.salesforce.com/services/data/vXX.X",auth:{type:"bearer"},operations:[{id:"create_lead",label:"Create Lead",method:"POST",path:"/sobjects/Lead",inputs:[{key:"instance",label:"Instance URL",type:"text"},{key:"LastName",label:"Last Name",type:"text"},{key:"Company",label:"Company",type:"text"}]}]},{id:"hubspot",label:"HubSpot",icon:"Users",color:"orange",category:"action",baseUrl:"https://api.hubapi.com",auth:{type:"bearer"},operations:[{id:"create_contact",label:"Create Contact",method:"POST",path:"/crm/v3/objects/contacts",inputs:[{key:"properties",label:"Properties JSON",type:"json"}]}]},{id:"mailchimp",label:"Mailchimp",icon:"Mail",color:"yellow",category:"action",baseUrl:"https://{dc}.api.mailchimp.com/3.0",auth:{type:"bearer"},operations:[{id:"add_member",label:"Add Subscriber",method:"POST",path:"/lists/{list_id}/members",inputs:[{key:"dc",label:"Data Center (usX)",type:"text"},{key:"list_id",label:"List ID",type:"text"},{key:"email_address",label:"Email",type:"text"},{key:"status",label:"Status",type:"select",options:[{label:"subscribed",value:"subscribed"}]}]}]}]},{id:"integrations-commerce",nodes:[{id:"shopify",label:"Shopify",icon:"ShoppingBag",color:"emerald",category:"action",baseUrl:"https://{shop}.myshopify.com/admin/api/2023-10",auth:{type:"header",key:"X-Shopify-Access-Token"},operations:[{id:"get_products",label:"Get Products",method:"GET",path:"/products.json",inputs:[{key:"shop",label:"Shop Name",type:"text"}]},{id:"create_order",label:"Create Order",method:"POST",path:"/orders.json",inputs:[{key:"shop",label:"Shop Name",type:"text"},{key:"order",label:"Order JSON",type:"json"}]}]},{id:"stripe",label:"Stripe",icon:"CreditCard",color:"indigo",category:"action",baseUrl:"https://api.stripe.com/v1",auth:{type:"bearer"},operations:[{id:"create_customer",label:"Create Customer",method:"POST",path:"/customers",inputs:[{key:"email",label:"Email",type:"text"}]},{id:"list_charges",label:"List Charges",method:"GET",path:"/charges",inputs:[{key:"limit",label:"Limit",type:"text"}]}]}]}];function u(){b.forEach(o=>{o.nodes.forEach(e=>{if(e.operations){let t={id:e.id,label:e.label,category:e.category,icon:e.icon,color:e.color,baseUrl:e.baseUrl,auth:e.auth,operations:e.operations};s[t.id]=r(t)}else{let t={type:e.type,label:e.label,description:e.description,category:e.category,icon:e.icon,color:e.color,handles:e.handles||[{id:"in",type:"target"},{id:"out",type:"source"}],inputs:e.inputs};s[t.type]=t}})})}var s={webhook:{type:"webhook",label:"Webhook",description:"Triggers when a URL is called",category:"trigger",icon:"Webhook",color:"emerald",handles:[{id:"out",type:"source"}],inputs:[{key:"method",label:"HTTP Method",type:"select",options:[{label:"GET",value:"GET"},{label:"POST",value:"POST"}]},{key:"path",label:"Path",type:"text",placeholder:"/webhook/..."}]},schedule:{type:"schedule",label:"Schedule",description:"Triggers on a specific interval",category:"trigger",icon:"Clock",color:"emerald",handles:[{id:"out",type:"source"}],inputs:[{key:"interval",label:"Interval",type:"select",options:[{label:"Every Minute",value:"1m"},{label:"Every Hour",value:"1h"},{label:"Every Day",value:"1d"}]},{key:"cron",label:"Cron Expression",type:"text",placeholder:"* * * * *"}]},"http-request":{type:"http-request",label:"HTTP Request",description:"Make an external API call",category:"action",icon:"Globe",color:"blue",handles:[{id:"in",type:"target"},{id:"out",type:"source"}],inputs:[{key:"url",label:"URL",type:"text",placeholder:"https://api.example.com"},{key:"method",label:"Method",type:"select",options:[{label:"GET",value:"GET"},{label:"POST",value:"POST"},{label:"PUT",value:"PUT"},{label:"DELETE",value:"DELETE"}]},{key:"headers",label:"Headers",type:"json"},{key:"body",label:"Body",type:"json"}]},email:{type:"email",label:"Send Email",description:"Send an email to a recipient",category:"action",icon:"Mail",color:"blue",handles:[{id:"in",type:"target"},{id:"out",type:"source"}],inputs:[{key:"to",label:"To",type:"text"},{key:"subject",label:"Subject",type:"text"},{key:"body",label:"Body",type:"text"}]},slack:{type:"slack",label:"Slack (Simple)",description:"Send a message to a channel",category:"action",icon:"MessageSquare",color:"blue",handles:[{id:"in",type:"target"},{id:"out",type:"source"}],inputs:[{key:"webhookUrl",label:"Webhook URL",type:"text"},{key:"message",label:"Message",type:"text"}]},"if-else":{type:"if-else",label:"If / Else",description:"Branch flow based on condition",category:"logic",icon:"Split",color:"orange",handles:[{id:"in",type:"target"},{id:"true",type:"source",label:"True"},{id:"false",type:"source",label:"False"}],inputs:[{key:"condition",label:"Condition",type:"code",description:"Javascript expression returning true/false"}]},merge:{type:"merge",label:"Merge",description:"Combine multiple branches",category:"logic",icon:"GitMerge",color:"orange",handles:[{id:"in-a",type:"target",label:"A"},{id:"in-b",type:"target",label:"B"},{id:"out",type:"source"}],inputs:[]}};n.forEach(o=>{s[o.id]=r(o)});u();function w(o){return n.find(e=>e.id===o)}0&&(module.exports={ApiClient,LicenseManager,WorkflowSerializer,createConnectorNode,deserialize,getConnectorDetails,nodeRegistry,registerConnector,serialize,standardConnectors});
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/license/manager.ts","../src/api/client.ts","../src/io/serializer.ts","../src/nodes/connector.ts","../src/nodes/standard-library.ts","../src/nodes/catalog.json","../src/nodes/loader.ts","../src/nodes/registry.ts"],"sourcesContent":["export * from './license';\nexport * from './api';\nexport * from './io/serializer';\nexport * from './nodes/registry';\nexport * from './nodes/connector';\nexport * from './nodes/standard-library';\n","export interface LicenseConfig {\n licenseKey: string;\n widgetVersion: string;\n validationEndpoint?: string; // Defaults to our SaaS\n}\n\ninterface ValidationResult {\n valid: boolean;\n plan?: string;\n features?: Record<string, any>;\n reason?: string;\n}\n\nconst DEFAULT_VALIDATION_URL = 'http://localhost:3000/api/v1/license/validate';\n\nexport class LicenseManager {\n private validationResult: ValidationResult | null = null;\n\n constructor(private config: LicenseConfig) {}\n\n async validate(): Promise<ValidationResult> {\n if (this.validationResult) return this.validationResult;\n\n try {\n const endpoint = this.config.validationEndpoint || DEFAULT_VALIDATION_URL;\n const response = await fetch(endpoint, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n licenseKey: this.config.licenseKey,\n widgetVersion: this.config.widgetVersion,\n originUrl: typeof window !== 'undefined' ? window.location.origin : '',\n }),\n });\n\n const data = await response.json();\n this.validationResult = data;\n return data;\n\n } catch (error) {\n console.error('License validation failed', error);\n // Fail open or closed? Strict requirement implies validation is key.\n return { valid: false, reason: 'Network Error' };\n }\n }\n\n isFeatureEnabled(featureName: string): boolean {\n if (!this.validationResult?.valid) return false;\n return !!this.validationResult.features?.[featureName];\n }\n}\n","export interface ApiConfig {\n baseUrl: string;\n endpoints: {\n create: string; // POST\n update: string; // PUT\n get: string; // GET\n list?: string; // GET\n };\n headers?: Record<string, string>;\n}\n\nexport class ApiClient {\n constructor(private config: ApiConfig) {}\n\n private async request<T>(url: string, method: string, body?: any): Promise<T> {\n const headers = {\n 'Content-Type': 'application/json',\n ...this.config.headers,\n };\n\n const response = await fetch(url, {\n method,\n headers,\n body: body ? JSON.stringify(body) : undefined,\n });\n\n if (!response.ok) {\n throw new Error(`API Request failed: ${response.statusText}`);\n }\n\n return response.json();\n }\n\n async getWorkflow(id: string): Promise<any> {\n const url = `${this.config.baseUrl}${this.config.endpoints.get.replace(':id', id)}`;\n return this.request(url, 'GET');\n }\n\n async createWorkflow(workflow: any): Promise<{ id: string }> {\n const url = `${this.config.baseUrl}${this.config.endpoints.create}`;\n return this.request(url, 'POST', workflow);\n }\n\n async updateWorkflow(id: string, workflow: any): Promise<void> {\n const url = `${this.config.baseUrl}${this.config.endpoints.update.replace(':id', id)}`;\n return this.request(url, 'PUT', workflow);\n }\n}\n","\nexport interface WorkflowData {\n nodes: any[];\n edges: any[];\n viewport?: { x: number; y: number; zoom: number };\n}\n\nexport class WorkflowSerializer {\n static serialize(nodes: any[], edges: any[], viewport?: any): string {\n const data: WorkflowData = { nodes, edges, viewport };\n return JSON.stringify(data);\n }\n\n static deserialize(json: string): { nodes: any[], edges: any[], viewport?: any } {\n try {\n const data = JSON.parse(json);\n return {\n nodes: data.nodes || [],\n edges: data.edges || [],\n viewport: data.viewport\n };\n } catch(e) {\n return { nodes: [], edges: [] };\n }\n }\n}\n\nexport const serialize = WorkflowSerializer.serialize;\nexport const deserialize = WorkflowSerializer.deserialize;\n","import { NodeField, NodeCategory, NodeTypeDefinition } from './registry';\n\nexport interface ConnectorOperation {\n id: string; // e.g., 'create_issue'\n label: string;\n description?: string;\n method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';\n path: string; // e.g., '/repos/{owner}/{repo}/issues'\n inputs: NodeField[]; // Arguments specific to this operation\n}\n\nexport interface ConnectorDefinition {\n id: string; // e.g., 'github'\n label: string;\n category: NodeCategory;\n icon: string;\n color: string;\n baseUrl: string; // e.g., 'https://api.github.com'\n auth: {\n type: 'bearer' | 'header' | 'query' | 'none';\n key?: string; // e.g., 'Authorization' or 'api_key'\n placeholder?: string; // User instruction\n };\n operations: ConnectorOperation[];\n}\n\n// Factory function to convert a ConnectorDefinition into a regular NodeTypeDefinition\n// The idea is: The node type will be set to 'connector' internally, but we register it as 'github', 'slack', etc.\n// The PROPERTY PANEL will handle the dynamic rendering of operations.\n\nexport function createConnectorNode(def: ConnectorDefinition): NodeTypeDefinition {\n return {\n type: def.id,\n label: def.label,\n description: `Integration with ${def.label}`,\n category: def.category,\n icon: def.icon,\n color: def.color,\n handles: [\n { id: 'in', type: 'target' },\n { id: 'out', type: 'source' }\n ],\n // The inputs shown to the user initially\n inputs: [\n // Auth Config (usually a saved connection ID, but here raw text for simplicity)\n { \n key: 'auth_token', \n label: 'API Key / Token', \n type: 'text', \n placeholder: def.auth.placeholder || 'Enter API Key'\n },\n // Operation Selector\n {\n key: 'operation',\n label: 'Action',\n type: 'select',\n options: def.operations.map(op => ({ label: op.label, value: op.id }))\n },\n // We can't dynamically render the *rest* of the inputs here statically.\n // The PropertyPanel component needs to see 'operation' and append the inputs from that operation.\n // We can store the definition in a special property or look it up.\n ]\n };\n}\n","// This list represents the \"Essential Pack\" of integrations.\nimport { ConnectorDefinition } from './connector';\n\nexport const standardConnectors: ConnectorDefinition[] = [\n // ... existing ...\n {\n id: 'google-sheets',\n label: 'Google Sheets',\n category: 'utility',\n icon: 'Sheet',\n color: 'emerald',\n baseUrl: 'https://sheets.googleapis.com/v4/spreadsheets',\n auth: { type: 'bearer', placeholder: 'OAuth Token' },\n operations: [\n {\n id: 'append_row',\n label: 'Append Row',\n method: 'POST',\n path: '/{spreadsheetId}/values/{range}:append',\n inputs: [\n { key: 'spreadsheetId', label: 'Spreadsheet ID', type: 'text' },\n { key: 'range', label: 'Range (Sheet1!A1)', type: 'text' },\n { key: 'values', label: 'Row Values (JSON Array)', type: 'json' }\n ]\n },\n {\n id: 'get_values',\n label: 'Get Row(s)',\n method: 'GET',\n path: '/{spreadsheetId}/values/{range}',\n inputs: [\n { key: 'spreadsheetId', label: 'Spreadsheet ID', type: 'text' },\n { key: 'range', label: 'Range', type: 'text' }\n ]\n }\n ]\n },\n {\n id: 'slack-connector', \n label: 'Slack API',\n category: 'action',\n icon: 'MessageSquare',\n color: 'blue',\n baseUrl: 'https://slack.com/api',\n auth: { type: 'bearer', placeholder: 'xoxb-...' },\n operations: [\n {\n id: 'post_message',\n label: 'Post Message',\n method: 'POST',\n path: '/chat.postMessage',\n inputs: [\n { key: 'channel', label: 'Channel ID', type: 'text' },\n { key: 'text', label: 'Message Text', type: 'text' }\n ]\n }\n ]\n },\n {\n id: 'openai',\n label: 'OpenAI',\n category: 'action',\n icon: 'Bot',\n color: 'zinc',\n baseUrl: 'https://api.openai.com/v1',\n auth: { type: 'bearer', placeholder: 'sk-...' },\n operations: [\n {\n id: 'chat_completion',\n label: 'Chat Completion',\n method: 'POST',\n path: '/chat/completions',\n inputs: [\n { key: 'model', label: 'Model', type: 'select', options: [{label: 'GPT-4o', value: 'gpt-4o'}, {label: 'GPT-3.5', value: 'gpt-3.5-turbo'}] },\n { key: 'messages', label: 'Messages (JSON)', type: 'json' }\n ]\n }\n ]\n }\n];\n\nexport function registerConnector(def: ConnectorDefinition) {\n standardConnectors.push(def);\n}\n","[\n {\n \"id\": \"triggers\",\n \"nodes\": [\n {\n \"type\": \"manual-trigger\",\n \"label\": \"Manual Trigger\",\n \"description\": \"Start flow on button click\",\n \"category\": \"trigger\",\n \"icon\": \"Play\",\n \"color\": \"emerald\",\n \"inputs\": []\n },\n {\n \"type\": \"cron-trigger\",\n \"label\": \"Cron Schedule\",\n \"description\": \"Trigger on a schedule\",\n \"category\": \"trigger\",\n \"icon\": \"Clock\",\n \"color\": \"emerald\",\n \"inputs\": [\n { \"key\": \"expression\", \"label\": \"Cron Expression\", \"type\": \"text\", \"placeholder\": \"0 9 * * 1 (Every Mon at 9am)\" }\n ]\n },\n {\n \"id\": \"github-trigger\",\n \"label\": \"GitHub Trigger\",\n \"category\": \"trigger\",\n \"icon\": \"Github\",\n \"color\": \"zinc\",\n \"baseUrl\": \"https://api.github.com\",\n \"auth\": { \"type\": \"header\", \"key\": \"X-GitHub-Token\" },\n \"operations\": [\n { \"id\": \"on_push\", \"label\": \"On Push\", \"method\": \"POST\", \"path\": \"/repos/{owner}/{repo}/hooks\", \"inputs\": [{\"key\": \"owner\", \"label\": \"Owner\", \"type\": \"text\"}, {\"key\": \"repo\", \"label\": \"Repository\", \"type\": \"text\"}] },\n { \"id\": \"on_star\", \"label\": \"On New Star\", \"method\": \"POST\", \"path\": \"/repos/{owner}/{repo}/hooks\", \"inputs\": [{\"key\": \"owner\", \"label\": \"Owner\", \"type\": \"text\"}, {\"key\": \"repo\", \"label\": \"Repository\", \"type\": \"text\"}] }\n ]\n }\n ]\n },\n {\n \"id\": \"logic\",\n \"nodes\": [\n {\n \"type\": \"switch\",\n \"label\": \"Switch / Router\",\n \"description\": \"Route based on value\",\n \"category\": \"logic\",\n \"icon\": \"GitFork\",\n \"color\": \"orange\",\n \"inputs\": [\n { \"key\": \"property\", \"label\": \"Property to Check\", \"type\": \"text\" },\n { \"key\": \"cases\", \"label\": \"Cases (comma sep)\", \"type\": \"text\", \"placeholder\": \"marketing, sales, support\" }\n ]\n },\n {\n \"type\": \"ab-split\",\n \"label\": \"A/B Split\",\n \"description\": \"Randomly split traffic\",\n \"category\": \"logic\",\n \"icon\": \"Percent\",\n \"color\": \"orange\",\n \"inputs\": [\n { \"key\": \"percentA\", \"label\": \"Percentage for A\", \"type\": \"text\", \"placeholder\": \"50\" }\n ]\n },\n {\n \"type\": \"wait\",\n \"label\": \"Wait / Delay\",\n \"description\": \"Pause execution\",\n \"category\": \"logic\",\n \"icon\": \"Timer\",\n \"color\": \"orange\",\n \"inputs\": [\n { \"key\": \"duration\", \"label\": \"Duration\", \"type\": \"text\", \"placeholder\": \"5000\" },\n { \"key\": \"unit\", \"label\": \"Unit\", \"type\": \"select\", \"options\": [{\"label\": \"Milliseconds\", \"value\": \"ms\"}, {\"label\": \"Seconds\", \"value\": \"s\"}] }\n ]\n }\n ]\n },\n {\n \"id\": \"utilities\",\n \"nodes\": [\n {\n \"type\": \"text-transform\",\n \"label\": \"Text Transform\",\n \"description\": \"Modify text strings\",\n \"category\": \"utility\",\n \"icon\": \"Type\",\n \"color\": \"zinc\",\n \"inputs\": [\n {\n \"key\": \"action\",\n \"label\": \"Action\",\n \"type\": \"select\",\n \"options\": [\n { \"label\": \"To Upper Case\", \"value\": \"upper\" },\n { \"label\": \"To Lower Case\", \"value\": \"lower\" },\n { \"label\": \"Trim\", \"value\": \"trim\" },\n { \"label\": \"Replace\", \"value\": \"replace\" }\n ]\n },\n { \"key\": \"input\", \"label\": \"Input Text\", \"type\": \"text\" }\n ]\n },\n {\n \"type\": \"json-parser\",\n \"label\": \"JSON Helper\",\n \"description\": \"Parse or stringify JSON\",\n \"category\": \"utility\",\n \"icon\": \"Code\",\n \"color\": \"zinc\",\n \"inputs\": [\n {\n \"key\": \"action\",\n \"label\": \"Action\",\n \"type\": \"select\",\n \"options\": [\n { \"label\": \"Parse (String to JSON)\", \"value\": \"parse\" },\n { \"label\": \"Stringify (JSON to String)\", \"value\": \"stringify\" }\n ]\n },\n { \"key\": \"data\", \"label\": \"Data\", \"type\": \"json\" }\n ]\n },\n {\n \"type\": \"math-calc\",\n \"label\": \"Math Calculator\",\n \"description\": \"Perform calculations\",\n \"category\": \"utility\",\n \"icon\": \"Calculator\",\n \"color\": \"zinc\",\n \"inputs\": [\n {\n \"key\": \"operation\",\n \"label\": \"Operation\",\n \"type\": \"select\",\n \"options\": [\n { \"label\": \"Add\", \"value\": \"add\" },\n { \"label\": \"Subtract\", \"value\": \"sub\" },\n { \"label\": \"Multiply\", \"value\": \"mul\" },\n { \"label\": \"Divide\", \"value\": \"div\" },\n { \"label\": \"Random Number\", \"value\": \"random\" }\n ]\n },\n { \"key\": \"a\", \"label\": \"Value A\", \"type\": \"text\" },\n { \"key\": \"b\", \"label\": \"Value B\", \"type\": \"text\" }\n ]\n },\n {\n \"type\": \"crypto\",\n \"label\": \"Cryptography\",\n \"description\": \"Hash or Encrypt data\",\n \"category\": \"utility\",\n \"icon\": \"Lock\",\n \"color\": \"zinc\",\n \"inputs\": [\n { \"key\": \"algo\", \"label\": \"Algorithm\", \"type\": \"select\", \"options\": [{\"label\": \"MD5\", \"value\": \"md5\"}, {\"label\": \"SHA-256\", \"value\": \"sha256\"}, {\"label\": \"Base64 Encode\", \"value\": \"base64_enc\"}, {\"label\": \"Base64 Decode\", \"value\": \"base64_dec\"}] },\n { \"key\": \"input\", \"label\": \"value\", \"type\": \"text\" }\n ]\n },\n {\n \"type\": \"date-time\",\n \"label\": \"Date & Time\",\n \"description\": \"Format or manipulate dates\",\n \"category\": \"utility\",\n \"icon\": \"Calendar\",\n \"color\": \"zinc\",\n \"inputs\": [\n { \"key\": \"operation\", \"label\": \"Action\", \"type\": \"select\", \"options\": [{\"label\": \"Now (ISO)\", \"value\": \"now\"}, {\"label\": \"Format Date\", \"value\": \"format\"}, {\"label\": \"Add Time\", \"value\": \"add\"}] },\n { \"key\": \"date\", \"label\": \"Date String\", \"type\": \"text\" },\n { \"key\": \"format\", \"label\": \"Format Pattern\", \"type\": \"text\", \"placeholder\": \"YYYY-MM-DD\" }\n ]\n }\n\n ]\n },\n {\n \"id\": \"integrations-productivity\",\n \"nodes\": [\n {\n \"id\": \"google-drive\",\n \"label\": \"Google Drive\",\n \"icon\": \"HardDrive\",\n \"color\": \"blue\",\n \"category\": \"action\",\n \"baseUrl\": \"https://www.googleapis.com/drive/v3\",\n \"auth\": { \"type\": \"bearer\", \"placeholder\": \"OAuth Token\" },\n \"operations\": [\n { \"id\": \"list\", \"label\": \"List Files\", \"method\": \"GET\", \"path\": \"/files\", \"inputs\": [{\"key\": \"q\", \"label\": \"Query\", \"type\": \"text\"}] },\n { \"id\": \"upload\", \"label\": \"Upload File\", \"method\": \"POST\", \"path\": \"/files\", \"inputs\": [{\"key\": \"name\", \"label\": \"Name\", \"type\": \"text\"}, {\"key\": \"content\", \"label\": \"Content\", \"type\": \"text\"}] }\n ]\n },\n {\n \"id\": \"notion\",\n \"label\": \"Notion\",\n \"icon\": \"FileText\",\n \"color\": \"zinc\",\n \"category\": \"action\",\n \"baseUrl\": \"https://api.notion.com/v1\",\n \"auth\": { \"type\": \"header\", \"key\": \"Authorization\", \"placeholder\": \"Bearer secret_...\" },\n \"operations\": [\n { \"id\": \"create_page\", \"label\": \"Create Page\", \"method\": \"POST\", \"path\": \"/pages\", \"inputs\": [{\"key\": \"parent_id\", \"label\": \"Parent DB ID\", \"type\": \"text\"}, {\"key\": \"properties\", \"label\": \"Properties JSON\", \"type\": \"json\"}] },\n { \"id\": \"query_db\", \"label\": \"Query Database\", \"method\": \"POST\", \"path\": \"/databases/{id}/query\", \"inputs\": [{\"key\": \"id\", \"label\": \"Database ID\", \"type\": \"text\"}] }\n ]\n },\n {\n \"id\": \"airtable\",\n \"label\": \"Airtable\",\n \"icon\": \"Database\",\n \"color\": \"amber\",\n \"category\": \"action\",\n \"baseUrl\": \"https://api.airtable.com/v0\",\n \"auth\": { \"type\": \"bearer\", \"placeholder\": \"pat_...\" },\n \"operations\": [\n { \"id\": \"create_record\", \"label\": \"Create Record\", \"method\": \"POST\", \"path\": \"/{baseId}/{tableId}\", \"inputs\": [{\"key\": \"baseId\", \"label\": \"Base ID\", \"type\": \"text\"}, {\"key\": \"tableId\", \"label\": \"Table Name\", \"type\": \"text\"}, {\"key\": \"fields\", \"label\": \"Fields JSON\", \"type\": \"json\"}] },\n { \"id\": \"list_records\", \"label\": \"List Records\", \"method\": \"GET\", \"path\": \"/{baseId}/{tableId}\", \"inputs\": [{\"key\": \"baseId\", \"label\": \"Base ID\", \"type\": \"text\"}, {\"key\": \"tableId\", \"label\": \"Table Name\", \"type\": \"text\"}] }\n ]\n }\n ]\n },\n {\n \"id\": \"integrations-crm-marketing\",\n \"nodes\": [\n {\n \"id\": \"salesforce\",\n \"label\": \"Salesforce\",\n \"icon\": \"Cloud\",\n \"color\": \"blue\",\n \"category\": \"action\",\n \"baseUrl\": \"https://{instance}.salesforce.com/services/data/vXX.X\",\n \"auth\": { \"type\": \"bearer\" },\n \"operations\": [\n { \"id\": \"create_lead\", \"label\": \"Create Lead\", \"method\": \"POST\", \"path\": \"/sobjects/Lead\", \"inputs\": [{\"key\": \"instance\", \"label\": \"Instance URL\", \"type\": \"text\"}, {\"key\": \"LastName\", \"label\": \"Last Name\", \"type\": \"text\"}, {\"key\": \"Company\", \"label\": \"Company\", \"type\": \"text\"}] }\n ]\n },\n {\n \"id\": \"hubspot\",\n \"label\": \"HubSpot\",\n \"icon\": \"Users\",\n \"color\": \"orange\",\n \"category\": \"action\",\n \"baseUrl\": \"https://api.hubapi.com\",\n \"auth\": { \"type\": \"bearer\" },\n \"operations\": [\n { \"id\": \"create_contact\", \"label\": \"Create Contact\", \"method\": \"POST\", \"path\": \"/crm/v3/objects/contacts\", \"inputs\": [{\"key\": \"properties\", \"label\": \"Properties JSON\", \"type\": \"json\"}] }\n ]\n },\n {\n \"id\": \"mailchimp\",\n \"label\": \"Mailchimp\",\n \"icon\": \"Mail\",\n \"color\": \"yellow\",\n \"category\": \"action\",\n \"baseUrl\": \"https://{dc}.api.mailchimp.com/3.0\",\n \"auth\": { \"type\": \"bearer\" },\n \"operations\": [\n { \"id\": \"add_member\", \"label\": \"Add Subscriber\", \"method\": \"POST\", \"path\": \"/lists/{list_id}/members\", \"inputs\": [{\"key\": \"dc\", \"label\": \"Data Center (usX)\", \"type\": \"text\"}, {\"key\": \"list_id\", \"label\": \"List ID\", \"type\": \"text\"}, {\"key\": \"email_address\", \"label\": \"Email\", \"type\": \"text\"}, {\"key\": \"status\", \"label\": \"Status\", \"type\": \"select\", \"options\": [{\"label\":\"subscribed\",\"value\":\"subscribed\"}]}] }\n ]\n }\n ]\n },\n {\n \"id\": \"integrations-commerce\",\n \"nodes\": [\n {\n \"id\": \"shopify\",\n \"label\": \"Shopify\",\n \"icon\": \"ShoppingBag\",\n \"color\": \"emerald\",\n \"category\": \"action\",\n \"baseUrl\": \"https://{shop}.myshopify.com/admin/api/2023-10\",\n \"auth\": { \"type\": \"header\", \"key\": \"X-Shopify-Access-Token\" },\n \"operations\": [\n { \"id\": \"get_products\", \"label\": \"Get Products\", \"method\": \"GET\", \"path\": \"/products.json\", \"inputs\": [{\"key\": \"shop\", \"label\": \"Shop Name\", \"type\": \"text\"}] },\n { \"id\": \"create_order\", \"label\": \"Create Order\", \"method\": \"POST\", \"path\": \"/orders.json\", \"inputs\": [{\"key\": \"shop\", \"label\": \"Shop Name\", \"type\": \"text\"}, {\"key\": \"order\", \"label\": \"Order JSON\", \"type\": \"json\"}] }\n ]\n },\n {\n \"id\": \"stripe\",\n \"label\": \"Stripe\",\n \"icon\": \"CreditCard\",\n \"color\": \"indigo\",\n \"category\": \"action\",\n \"baseUrl\": \"https://api.stripe.com/v1\",\n \"auth\": { \"type\": \"bearer\" },\n \"operations\": [\n { \"id\": \"create_customer\", \"label\": \"Create Customer\", \"method\": \"POST\", \"path\": \"/customers\", \"inputs\": [{\"key\": \"email\", \"label\": \"Email\", \"type\": \"text\"}] },\n { \"id\": \"list_charges\", \"label\": \"List Charges\", \"method\": \"GET\", \"path\": \"/charges\", \"inputs\": [{\"key\": \"limit\", \"label\": \"Limit\", \"type\": \"text\"}] }\n ]\n }\n ]\n }\n]\n","import { NodeTypeDefinition, nodeRegistry } from './registry';\nimport { createConnectorNode, ConnectorDefinition } from './connector';\nimport catalogData from './catalog.json';\n\n// Helper to convert catalog entries to registry definitions\nexport function loadCatalog() {\n catalogData.forEach((group: any) => {\n group.nodes.forEach((node: any) => {\n // Check if it's a connector (has operations) or a native node\n if (node.operations) {\n // It's a connector\n const connector: ConnectorDefinition = {\n id: node.id,\n label: node.label,\n category: node.category,\n icon: node.icon,\n color: node.color,\n baseUrl: node.baseUrl,\n auth: node.auth,\n operations: node.operations\n };\n // Register it\n nodeRegistry[connector.id] = createConnectorNode(connector);\n // We also need to add it to generic connector lookups if we used a separate array.\n // But createConnectorNode returns a definition that we put in registry.\n // However, for PropertyPanel execution logic to find operations, we need it in a lookup.\n // Let's attach the connector definition to the registry entry metadata if possible, \n // OR extending the look up function.\n // HACK: We will push to standardConnectors array in standard-library if we want `getConnectorDetails` to find it.\n } else {\n // It's a standard simple node\n const def: NodeTypeDefinition = {\n type: node.type,\n label: node.label,\n description: node.description,\n category: node.category,\n icon: node.icon,\n color: node.color,\n handles: node.handles || [ { id: 'in', type: 'target' }, { id: 'out', type: 'source' } ],\n inputs: node.inputs\n };\n nodeRegistry[def.type] = def;\n }\n });\n });\n}\n","export type NodeCategory = 'trigger' | 'action' | 'logic' | 'utility';\n\nexport interface NodeHandle {\n id: string;\n type: 'source' | 'target';\n label?: string;\n}\n\nexport interface NodeField {\n key: string;\n label: string;\n type: 'text' | 'number' | 'select' | 'boolean' | 'json' | 'code';\n options?: { label: string; value: string }[];\n placeholder?: string;\n description?: string;\n}\n\nexport interface NodeTypeDefinition {\n type: string;\n label: string;\n description: string;\n category: NodeCategory;\n icon: string; \n color: string; // Tailwind class component for border/bg\n handles: NodeHandle[];\n inputs: NodeField[];\n}\n\nimport { createConnectorNode, ConnectorDefinition } from './connector';\nimport { standardConnectors } from './standard-library';\n\n// ... existing definitions ...\nexport const nodeRegistry: Record<string, NodeTypeDefinition> = {\n // ... existing static nodes ...\n 'webhook': {\n type: 'webhook',\n label: 'Webhook',\n description: 'Triggers when a URL is called',\n category: 'trigger',\n icon: 'Webhook',\n color: 'emerald',\n handles: [{ id: 'out', type: 'source' }],\n inputs: [\n { key: 'method', label: 'HTTP Method', type: 'select', options: [{ label: 'GET', value: 'GET'}, { label: 'POST', value: 'POST'}] },\n { key: 'path', label: 'Path', type: 'text', placeholder: '/webhook/...' }\n ]\n },\n 'schedule': {\n type: 'schedule',\n label: 'Schedule',\n description: 'Triggers on a specific interval',\n category: 'trigger',\n icon: 'Clock',\n color: 'emerald',\n handles: [{ id: 'out', type: 'source' }],\n inputs: [\n { key: 'interval', label: 'Interval', type: 'select', options: [{ label: 'Every Minute', value: '1m'}, { label: 'Every Hour', value: '1h'}, { label: 'Every Day', value: '1d'}] },\n { key: 'cron', label: 'Cron Expression', type: 'text', placeholder: '* * * * *' }\n ]\n },\n 'http-request': {\n type: 'http-request',\n label: 'HTTP Request',\n description: 'Make an external API call',\n category: 'action',\n icon: 'Globe',\n color: 'blue',\n handles: [{ id: 'in', type: 'target' }, { id: 'out', type: 'source' }],\n inputs: [\n { key: 'url', label: 'URL', type: 'text', placeholder: 'https://api.example.com' },\n { key: 'method', label: 'Method', type: 'select', options: [{ label: 'GET', value: 'GET'}, { label: 'POST', value: 'POST'}, { label: 'PUT', value: 'PUT'}, { label: 'DELETE', value: 'DELETE'}] },\n { key: 'headers', label: 'Headers', type: 'json' },\n { key: 'body', label: 'Body', type: 'json' }\n ]\n },\n 'email': {\n type: 'email',\n label: 'Send Email',\n description: 'Send an email to a recipient',\n category: 'action',\n icon: 'Mail',\n color: 'blue',\n handles: [{ id: 'in', type: 'target' }, { id: 'out', type: 'source' }],\n inputs: [\n { key: 'to', label: 'To', type: 'text' },\n { key: 'subject', label: 'Subject', type: 'text' },\n { key: 'body', label: 'Body', type: 'text' } \n ]\n },\n 'slack': {\n type: 'slack',\n label: 'Slack (Simple)',\n description: 'Send a message to a channel',\n category: 'action',\n icon: 'MessageSquare',\n color: 'blue',\n handles: [{ id: 'in', type: 'target' }, { id: 'out', type: 'source' }],\n inputs: [\n { key: 'webhookUrl', label: 'Webhook URL', type: 'text' },\n { key: 'message', label: 'Message', type: 'text' }\n ]\n },\n 'if-else': {\n type: 'if-else',\n label: 'If / Else',\n description: 'Branch flow based on condition',\n category: 'logic',\n icon: 'Split',\n color: 'orange',\n handles: [\n { id: 'in', type: 'target' },\n { id: 'true', type: 'source', label: 'True' },\n { id: 'false', type: 'source', label: 'False' }\n ],\n inputs: [\n { key: 'condition', label: 'Condition', type: 'code', description: 'Javascript expression returning true/false' }\n ]\n },\n 'merge': {\n type: 'merge',\n label: 'Merge',\n description: 'Combine multiple branches',\n category: 'logic',\n icon: 'GitMerge',\n color: 'orange',\n handles: [\n { id: 'in-a', type: 'target', label: 'A' },\n { id: 'in-b', type: 'target', label: 'B' },\n { id: 'out', type: 'source' }\n ],\n inputs: []\n }\n};\n\n// Inject Standard Connectors\nstandardConnectors.forEach(conn => {\n nodeRegistry[conn.id] = createConnectorNode(conn);\n});\n\nimport { loadCatalog } from './loader';\n// Initialize Catalog\nloadCatalog();\n\n// Helper to get definition details if it is a connector\nexport function getConnectorDetails(typeId: string): ConnectorDefinition | undefined {\n return standardConnectors.find(c => c.id === typeId);\n}\n"],"mappings":"yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,eA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AO,OACP,QAAS,CAAC,CAAE,GAAI,KAAM,KAAM,QAAS,EAAG,CAAE,GAAI,MAAO,KAAM,QAAS,CAAC,EACrE,OAAQ,CACR,CAAE,IAAK,aAAc,MAAO,cAAe,KAAM,MAAO,EACxD,CAAE,IAAK,UAAW,MAAO,UAAW,KAAM,MAAO,CACjD,CACJ,EACA,UAAW,CACP,KAAM,UACN,MAAO,YACP,YAAa,iCACb,SAAU,QACV,KAAM,QACN,MAAO,SACP,QAAS,CACT,CAAE,GAAI,KAAM,KAAM,QAAS,EAC3B,CAAE,GAAI,OAAQ,KAAM,SAAU,MAAO,MAAO,EAC5C,CAAE,GAAI,QAAS,KAAM,SAAU,MAAO,OAAQ,CAC9C,EACA,OAAQ,CACR,CAAE,IAAK,YAAa,MAAO,YAAa,KAAM,OAAQ,YAAa,4CAA6C,CAChH,CACJ,EACA,MAAS,CACL,KAAM,QACN,MAAO,QACP,YAAa,4BACb,SAAU,QACV,KAAM,WACN,MAAO,SACP,QAAS,CACT,CAAE,GAAI,OAAQ,KAAM,SAAU,MAAO,GAAI,EACzC,CAAE,GAAI,OAAQ,KAAM,SAAU,MAAO,GAAI,EACzC,CAAE,GAAI,MAAO,KAAM,QAAS,CAC5B,EACA,OAAQ,CAAC,CACb,CACJ,EAGAC,EAAmB,QAAQC,GAAQ,CAC/BF,EAAaE,EAAK,EAAE,EAAIC,EAAoBD,CAAI,CACpD,CAAC,EAIDE,EAAY,EAGL,SAASC,EAAoBC,EAAiD,CACjF,OAAOL,EAAmB,KAAKM,GAAKA,EAAE,KAAOD,CAAM,CACvD","names":["index_exports","__export","ApiClient","LicenseManager","WorkflowSerializer","createConnectorNode","deserialize","getConnectorDetails","nodeRegistry","registerConnector","serialize","standardConnectors","__toCommonJS","DEFAULT_VALIDATION_URL","LicenseManager","config","endpoint","data","error","featureName","_a","_b","ApiClient","config","url","method","body","headers","response","id","workflow","WorkflowSerializer","nodes","edges","viewport","json","data","serialize","deserialize","createConnectorNode","def","op","standardConnectors","registerConnector","def","catalog_default","loadCatalog","catalog_default","group","node","connector","nodeRegistry","createConnectorNode","def","nodeRegistry","standardConnectors","conn","createConnectorNode","loadCatalog","getConnectorDetails","typeId","c"]}
package/dist/index.mjs ADDED
@@ -0,0 +1,2 @@
1
+ var u="http://localhost:3000/api/v1/license/validate",c=class{constructor(e){this.config=e;this.validationResult=null}async validate(){if(this.validationResult)return this.validationResult;try{let e=this.config.validationEndpoint||u,a=await(await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({licenseKey:this.config.licenseKey,widgetVersion:this.config.widgetVersion,originUrl:typeof window!="undefined"?window.location.origin:""})})).json();return this.validationResult=a,a}catch(e){return console.error("License validation failed",e),{valid:!1,reason:"Network Error"}}}isFeatureEnabled(e){var t,a;return(t=this.validationResult)!=null&&t.valid?!!((a=this.validationResult.features)!=null&&a[e]):!1}};var d=class{constructor(e){this.config=e}async request(e,t,a){let p={"Content-Type":"application/json",...this.config.headers},s=await fetch(e,{method:t,headers:p,body:a?JSON.stringify(a):void 0});if(!s.ok)throw new Error(`API Request failed: ${s.statusText}`);return s.json()}async getWorkflow(e){let t=`${this.config.baseUrl}${this.config.endpoints.get.replace(":id",e)}`;return this.request(t,"GET")}async createWorkflow(e){let t=`${this.config.baseUrl}${this.config.endpoints.create}`;return this.request(t,"POST",e)}async updateWorkflow(e,t){let a=`${this.config.baseUrl}${this.config.endpoints.update.replace(":id",e)}`;return this.request(a,"PUT",t)}};var i=class{static serialize(e,t,a){return JSON.stringify({nodes:e,edges:t,viewport:a})}static deserialize(e){try{let t=JSON.parse(e);return{nodes:t.nodes||[],edges:t.edges||[],viewport:t.viewport}}catch{return{nodes:[],edges:[]}}}},T=i.serialize,S=i.deserialize;function l(o){return{type:o.id,label:o.label,description:`Integration with ${o.label}`,category:o.category,icon:o.icon,color:o.color,handles:[{id:"in",type:"target"},{id:"out",type:"source"}],inputs:[{key:"auth_token",label:"API Key / Token",type:"text",placeholder:o.auth.placeholder||"Enter API Key"},{key:"operation",label:"Action",type:"select",options:o.operations.map(e=>({label:e.label,value:e.id}))}]}}var r=[{id:"google-sheets",label:"Google Sheets",category:"utility",icon:"Sheet",color:"emerald",baseUrl:"https://sheets.googleapis.com/v4/spreadsheets",auth:{type:"bearer",placeholder:"OAuth Token"},operations:[{id:"append_row",label:"Append Row",method:"POST",path:"/{spreadsheetId}/values/{range}:append",inputs:[{key:"spreadsheetId",label:"Spreadsheet ID",type:"text"},{key:"range",label:"Range (Sheet1!A1)",type:"text"},{key:"values",label:"Row Values (JSON Array)",type:"json"}]},{id:"get_values",label:"Get Row(s)",method:"GET",path:"/{spreadsheetId}/values/{range}",inputs:[{key:"spreadsheetId",label:"Spreadsheet ID",type:"text"},{key:"range",label:"Range",type:"text"}]}]},{id:"slack-connector",label:"Slack API",category:"action",icon:"MessageSquare",color:"blue",baseUrl:"https://slack.com/api",auth:{type:"bearer",placeholder:"xoxb-..."},operations:[{id:"post_message",label:"Post Message",method:"POST",path:"/chat.postMessage",inputs:[{key:"channel",label:"Channel ID",type:"text"},{key:"text",label:"Message Text",type:"text"}]}]},{id:"openai",label:"OpenAI",category:"action",icon:"Bot",color:"zinc",baseUrl:"https://api.openai.com/v1",auth:{type:"bearer",placeholder:"sk-..."},operations:[{id:"chat_completion",label:"Chat Completion",method:"POST",path:"/chat/completions",inputs:[{key:"model",label:"Model",type:"select",options:[{label:"GPT-4o",value:"gpt-4o"},{label:"GPT-3.5",value:"gpt-3.5-turbo"}]},{key:"messages",label:"Messages (JSON)",type:"json"}]}]}];function w(o){r.push(o)}var y=[{id:"triggers",nodes:[{type:"manual-trigger",label:"Manual Trigger",description:"Start flow on button click",category:"trigger",icon:"Play",color:"emerald",inputs:[]},{type:"cron-trigger",label:"Cron Schedule",description:"Trigger on a schedule",category:"trigger",icon:"Clock",color:"emerald",inputs:[{key:"expression",label:"Cron Expression",type:"text",placeholder:"0 9 * * 1 (Every Mon at 9am)"}]},{id:"github-trigger",label:"GitHub Trigger",category:"trigger",icon:"Github",color:"zinc",baseUrl:"https://api.github.com",auth:{type:"header",key:"X-GitHub-Token"},operations:[{id:"on_push",label:"On Push",method:"POST",path:"/repos/{owner}/{repo}/hooks",inputs:[{key:"owner",label:"Owner",type:"text"},{key:"repo",label:"Repository",type:"text"}]},{id:"on_star",label:"On New Star",method:"POST",path:"/repos/{owner}/{repo}/hooks",inputs:[{key:"owner",label:"Owner",type:"text"},{key:"repo",label:"Repository",type:"text"}]}]}]},{id:"logic",nodes:[{type:"switch",label:"Switch / Router",description:"Route based on value",category:"logic",icon:"GitFork",color:"orange",inputs:[{key:"property",label:"Property to Check",type:"text"},{key:"cases",label:"Cases (comma sep)",type:"text",placeholder:"marketing, sales, support"}]},{type:"ab-split",label:"A/B Split",description:"Randomly split traffic",category:"logic",icon:"Percent",color:"orange",inputs:[{key:"percentA",label:"Percentage for A",type:"text",placeholder:"50"}]},{type:"wait",label:"Wait / Delay",description:"Pause execution",category:"logic",icon:"Timer",color:"orange",inputs:[{key:"duration",label:"Duration",type:"text",placeholder:"5000"},{key:"unit",label:"Unit",type:"select",options:[{label:"Milliseconds",value:"ms"},{label:"Seconds",value:"s"}]}]}]},{id:"utilities",nodes:[{type:"text-transform",label:"Text Transform",description:"Modify text strings",category:"utility",icon:"Type",color:"zinc",inputs:[{key:"action",label:"Action",type:"select",options:[{label:"To Upper Case",value:"upper"},{label:"To Lower Case",value:"lower"},{label:"Trim",value:"trim"},{label:"Replace",value:"replace"}]},{key:"input",label:"Input Text",type:"text"}]},{type:"json-parser",label:"JSON Helper",description:"Parse or stringify JSON",category:"utility",icon:"Code",color:"zinc",inputs:[{key:"action",label:"Action",type:"select",options:[{label:"Parse (String to JSON)",value:"parse"},{label:"Stringify (JSON to String)",value:"stringify"}]},{key:"data",label:"Data",type:"json"}]},{type:"math-calc",label:"Math Calculator",description:"Perform calculations",category:"utility",icon:"Calculator",color:"zinc",inputs:[{key:"operation",label:"Operation",type:"select",options:[{label:"Add",value:"add"},{label:"Subtract",value:"sub"},{label:"Multiply",value:"mul"},{label:"Divide",value:"div"},{label:"Random Number",value:"random"}]},{key:"a",label:"Value A",type:"text"},{key:"b",label:"Value B",type:"text"}]},{type:"crypto",label:"Cryptography",description:"Hash or Encrypt data",category:"utility",icon:"Lock",color:"zinc",inputs:[{key:"algo",label:"Algorithm",type:"select",options:[{label:"MD5",value:"md5"},{label:"SHA-256",value:"sha256"},{label:"Base64 Encode",value:"base64_enc"},{label:"Base64 Decode",value:"base64_dec"}]},{key:"input",label:"value",type:"text"}]},{type:"date-time",label:"Date & Time",description:"Format or manipulate dates",category:"utility",icon:"Calendar",color:"zinc",inputs:[{key:"operation",label:"Action",type:"select",options:[{label:"Now (ISO)",value:"now"},{label:"Format Date",value:"format"},{label:"Add Time",value:"add"}]},{key:"date",label:"Date String",type:"text"},{key:"format",label:"Format Pattern",type:"text",placeholder:"YYYY-MM-DD"}]}]},{id:"integrations-productivity",nodes:[{id:"google-drive",label:"Google Drive",icon:"HardDrive",color:"blue",category:"action",baseUrl:"https://www.googleapis.com/drive/v3",auth:{type:"bearer",placeholder:"OAuth Token"},operations:[{id:"list",label:"List Files",method:"GET",path:"/files",inputs:[{key:"q",label:"Query",type:"text"}]},{id:"upload",label:"Upload File",method:"POST",path:"/files",inputs:[{key:"name",label:"Name",type:"text"},{key:"content",label:"Content",type:"text"}]}]},{id:"notion",label:"Notion",icon:"FileText",color:"zinc",category:"action",baseUrl:"https://api.notion.com/v1",auth:{type:"header",key:"Authorization",placeholder:"Bearer secret_..."},operations:[{id:"create_page",label:"Create Page",method:"POST",path:"/pages",inputs:[{key:"parent_id",label:"Parent DB ID",type:"text"},{key:"properties",label:"Properties JSON",type:"json"}]},{id:"query_db",label:"Query Database",method:"POST",path:"/databases/{id}/query",inputs:[{key:"id",label:"Database ID",type:"text"}]}]},{id:"airtable",label:"Airtable",icon:"Database",color:"amber",category:"action",baseUrl:"https://api.airtable.com/v0",auth:{type:"bearer",placeholder:"pat_..."},operations:[{id:"create_record",label:"Create Record",method:"POST",path:"/{baseId}/{tableId}",inputs:[{key:"baseId",label:"Base ID",type:"text"},{key:"tableId",label:"Table Name",type:"text"},{key:"fields",label:"Fields JSON",type:"json"}]},{id:"list_records",label:"List Records",method:"GET",path:"/{baseId}/{tableId}",inputs:[{key:"baseId",label:"Base ID",type:"text"},{key:"tableId",label:"Table Name",type:"text"}]}]}]},{id:"integrations-crm-marketing",nodes:[{id:"salesforce",label:"Salesforce",icon:"Cloud",color:"blue",category:"action",baseUrl:"https://{instance}.salesforce.com/services/data/vXX.X",auth:{type:"bearer"},operations:[{id:"create_lead",label:"Create Lead",method:"POST",path:"/sobjects/Lead",inputs:[{key:"instance",label:"Instance URL",type:"text"},{key:"LastName",label:"Last Name",type:"text"},{key:"Company",label:"Company",type:"text"}]}]},{id:"hubspot",label:"HubSpot",icon:"Users",color:"orange",category:"action",baseUrl:"https://api.hubapi.com",auth:{type:"bearer"},operations:[{id:"create_contact",label:"Create Contact",method:"POST",path:"/crm/v3/objects/contacts",inputs:[{key:"properties",label:"Properties JSON",type:"json"}]}]},{id:"mailchimp",label:"Mailchimp",icon:"Mail",color:"yellow",category:"action",baseUrl:"https://{dc}.api.mailchimp.com/3.0",auth:{type:"bearer"},operations:[{id:"add_member",label:"Add Subscriber",method:"POST",path:"/lists/{list_id}/members",inputs:[{key:"dc",label:"Data Center (usX)",type:"text"},{key:"list_id",label:"List ID",type:"text"},{key:"email_address",label:"Email",type:"text"},{key:"status",label:"Status",type:"select",options:[{label:"subscribed",value:"subscribed"}]}]}]}]},{id:"integrations-commerce",nodes:[{id:"shopify",label:"Shopify",icon:"ShoppingBag",color:"emerald",category:"action",baseUrl:"https://{shop}.myshopify.com/admin/api/2023-10",auth:{type:"header",key:"X-Shopify-Access-Token"},operations:[{id:"get_products",label:"Get Products",method:"GET",path:"/products.json",inputs:[{key:"shop",label:"Shop Name",type:"text"}]},{id:"create_order",label:"Create Order",method:"POST",path:"/orders.json",inputs:[{key:"shop",label:"Shop Name",type:"text"},{key:"order",label:"Order JSON",type:"json"}]}]},{id:"stripe",label:"Stripe",icon:"CreditCard",color:"indigo",category:"action",baseUrl:"https://api.stripe.com/v1",auth:{type:"bearer"},operations:[{id:"create_customer",label:"Create Customer",method:"POST",path:"/customers",inputs:[{key:"email",label:"Email",type:"text"}]},{id:"list_charges",label:"List Charges",method:"GET",path:"/charges",inputs:[{key:"limit",label:"Limit",type:"text"}]}]}]}];function b(){y.forEach(o=>{o.nodes.forEach(e=>{if(e.operations){let t={id:e.id,label:e.label,category:e.category,icon:e.icon,color:e.color,baseUrl:e.baseUrl,auth:e.auth,operations:e.operations};n[t.id]=l(t)}else{let t={type:e.type,label:e.label,description:e.description,category:e.category,icon:e.icon,color:e.color,handles:e.handles||[{id:"in",type:"target"},{id:"out",type:"source"}],inputs:e.inputs};n[t.type]=t}})})}var n={webhook:{type:"webhook",label:"Webhook",description:"Triggers when a URL is called",category:"trigger",icon:"Webhook",color:"emerald",handles:[{id:"out",type:"source"}],inputs:[{key:"method",label:"HTTP Method",type:"select",options:[{label:"GET",value:"GET"},{label:"POST",value:"POST"}]},{key:"path",label:"Path",type:"text",placeholder:"/webhook/..."}]},schedule:{type:"schedule",label:"Schedule",description:"Triggers on a specific interval",category:"trigger",icon:"Clock",color:"emerald",handles:[{id:"out",type:"source"}],inputs:[{key:"interval",label:"Interval",type:"select",options:[{label:"Every Minute",value:"1m"},{label:"Every Hour",value:"1h"},{label:"Every Day",value:"1d"}]},{key:"cron",label:"Cron Expression",type:"text",placeholder:"* * * * *"}]},"http-request":{type:"http-request",label:"HTTP Request",description:"Make an external API call",category:"action",icon:"Globe",color:"blue",handles:[{id:"in",type:"target"},{id:"out",type:"source"}],inputs:[{key:"url",label:"URL",type:"text",placeholder:"https://api.example.com"},{key:"method",label:"Method",type:"select",options:[{label:"GET",value:"GET"},{label:"POST",value:"POST"},{label:"PUT",value:"PUT"},{label:"DELETE",value:"DELETE"}]},{key:"headers",label:"Headers",type:"json"},{key:"body",label:"Body",type:"json"}]},email:{type:"email",label:"Send Email",description:"Send an email to a recipient",category:"action",icon:"Mail",color:"blue",handles:[{id:"in",type:"target"},{id:"out",type:"source"}],inputs:[{key:"to",label:"To",type:"text"},{key:"subject",label:"Subject",type:"text"},{key:"body",label:"Body",type:"text"}]},slack:{type:"slack",label:"Slack (Simple)",description:"Send a message to a channel",category:"action",icon:"MessageSquare",color:"blue",handles:[{id:"in",type:"target"},{id:"out",type:"source"}],inputs:[{key:"webhookUrl",label:"Webhook URL",type:"text"},{key:"message",label:"Message",type:"text"}]},"if-else":{type:"if-else",label:"If / Else",description:"Branch flow based on condition",category:"logic",icon:"Split",color:"orange",handles:[{id:"in",type:"target"},{id:"true",type:"source",label:"True"},{id:"false",type:"source",label:"False"}],inputs:[{key:"condition",label:"Condition",type:"code",description:"Javascript expression returning true/false"}]},merge:{type:"merge",label:"Merge",description:"Combine multiple branches",category:"logic",icon:"GitMerge",color:"orange",handles:[{id:"in-a",type:"target",label:"A"},{id:"in-b",type:"target",label:"B"},{id:"out",type:"source"}],inputs:[]}};r.forEach(o=>{n[o.id]=l(o)});b();function j(o){return r.find(e=>e.id===o)}export{d as ApiClient,c as LicenseManager,i as WorkflowSerializer,l as createConnectorNode,S as deserialize,j as getConnectorDetails,n as nodeRegistry,w as registerConnector,T as serialize,r as standardConnectors};
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/license/manager.ts","../src/api/client.ts","../src/io/serializer.ts","../src/nodes/connector.ts","../src/nodes/standard-library.ts","../src/nodes/catalog.json","../src/nodes/loader.ts","../src/nodes/registry.ts"],"sourcesContent":["export interface LicenseConfig {\n licenseKey: string;\n widgetVersion: string;\n validationEndpoint?: string; // Defaults to our SaaS\n}\n\ninterface ValidationResult {\n valid: boolean;\n plan?: string;\n features?: Record<string, any>;\n reason?: string;\n}\n\nconst DEFAULT_VALIDATION_URL = 'http://localhost:3000/api/v1/license/validate';\n\nexport class LicenseManager {\n private validationResult: ValidationResult | null = null;\n\n constructor(private config: LicenseConfig) {}\n\n async validate(): Promise<ValidationResult> {\n if (this.validationResult) return this.validationResult;\n\n try {\n const endpoint = this.config.validationEndpoint || DEFAULT_VALIDATION_URL;\n const response = await fetch(endpoint, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n licenseKey: this.config.licenseKey,\n widgetVersion: this.config.widgetVersion,\n originUrl: typeof window !== 'undefined' ? window.location.origin : '',\n }),\n });\n\n const data = await response.json();\n this.validationResult = data;\n return data;\n\n } catch (error) {\n console.error('License validation failed', error);\n // Fail open or closed? Strict requirement implies validation is key.\n return { valid: false, reason: 'Network Error' };\n }\n }\n\n isFeatureEnabled(featureName: string): boolean {\n if (!this.validationResult?.valid) return false;\n return !!this.validationResult.features?.[featureName];\n }\n}\n","export interface ApiConfig {\n baseUrl: string;\n endpoints: {\n create: string; // POST\n update: string; // PUT\n get: string; // GET\n list?: string; // GET\n };\n headers?: Record<string, string>;\n}\n\nexport class ApiClient {\n constructor(private config: ApiConfig) {}\n\n private async request<T>(url: string, method: string, body?: any): Promise<T> {\n const headers = {\n 'Content-Type': 'application/json',\n ...this.config.headers,\n };\n\n const response = await fetch(url, {\n method,\n headers,\n body: body ? JSON.stringify(body) : undefined,\n });\n\n if (!response.ok) {\n throw new Error(`API Request failed: ${response.statusText}`);\n }\n\n return response.json();\n }\n\n async getWorkflow(id: string): Promise<any> {\n const url = `${this.config.baseUrl}${this.config.endpoints.get.replace(':id', id)}`;\n return this.request(url, 'GET');\n }\n\n async createWorkflow(workflow: any): Promise<{ id: string }> {\n const url = `${this.config.baseUrl}${this.config.endpoints.create}`;\n return this.request(url, 'POST', workflow);\n }\n\n async updateWorkflow(id: string, workflow: any): Promise<void> {\n const url = `${this.config.baseUrl}${this.config.endpoints.update.replace(':id', id)}`;\n return this.request(url, 'PUT', workflow);\n }\n}\n","\nexport interface WorkflowData {\n nodes: any[];\n edges: any[];\n viewport?: { x: number; y: number; zoom: number };\n}\n\nexport class WorkflowSerializer {\n static serialize(nodes: any[], edges: any[], viewport?: any): string {\n const data: WorkflowData = { nodes, edges, viewport };\n return JSON.stringify(data);\n }\n\n static deserialize(json: string): { nodes: any[], edges: any[], viewport?: any } {\n try {\n const data = JSON.parse(json);\n return {\n nodes: data.nodes || [],\n edges: data.edges || [],\n viewport: data.viewport\n };\n } catch(e) {\n return { nodes: [], edges: [] };\n }\n }\n}\n\nexport const serialize = WorkflowSerializer.serialize;\nexport const deserialize = WorkflowSerializer.deserialize;\n","import { NodeField, NodeCategory, NodeTypeDefinition } from './registry';\n\nexport interface ConnectorOperation {\n id: string; // e.g., 'create_issue'\n label: string;\n description?: string;\n method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';\n path: string; // e.g., '/repos/{owner}/{repo}/issues'\n inputs: NodeField[]; // Arguments specific to this operation\n}\n\nexport interface ConnectorDefinition {\n id: string; // e.g., 'github'\n label: string;\n category: NodeCategory;\n icon: string;\n color: string;\n baseUrl: string; // e.g., 'https://api.github.com'\n auth: {\n type: 'bearer' | 'header' | 'query' | 'none';\n key?: string; // e.g., 'Authorization' or 'api_key'\n placeholder?: string; // User instruction\n };\n operations: ConnectorOperation[];\n}\n\n// Factory function to convert a ConnectorDefinition into a regular NodeTypeDefinition\n// The idea is: The node type will be set to 'connector' internally, but we register it as 'github', 'slack', etc.\n// The PROPERTY PANEL will handle the dynamic rendering of operations.\n\nexport function createConnectorNode(def: ConnectorDefinition): NodeTypeDefinition {\n return {\n type: def.id,\n label: def.label,\n description: `Integration with ${def.label}`,\n category: def.category,\n icon: def.icon,\n color: def.color,\n handles: [\n { id: 'in', type: 'target' },\n { id: 'out', type: 'source' }\n ],\n // The inputs shown to the user initially\n inputs: [\n // Auth Config (usually a saved connection ID, but here raw text for simplicity)\n { \n key: 'auth_token', \n label: 'API Key / Token', \n type: 'text', \n placeholder: def.auth.placeholder || 'Enter API Key'\n },\n // Operation Selector\n {\n key: 'operation',\n label: 'Action',\n type: 'select',\n options: def.operations.map(op => ({ label: op.label, value: op.id }))\n },\n // We can't dynamically render the *rest* of the inputs here statically.\n // The PropertyPanel component needs to see 'operation' and append the inputs from that operation.\n // We can store the definition in a special property or look it up.\n ]\n };\n}\n","// This list represents the \"Essential Pack\" of integrations.\nimport { ConnectorDefinition } from './connector';\n\nexport const standardConnectors: ConnectorDefinition[] = [\n // ... existing ...\n {\n id: 'google-sheets',\n label: 'Google Sheets',\n category: 'utility',\n icon: 'Sheet',\n color: 'emerald',\n baseUrl: 'https://sheets.googleapis.com/v4/spreadsheets',\n auth: { type: 'bearer', placeholder: 'OAuth Token' },\n operations: [\n {\n id: 'append_row',\n label: 'Append Row',\n method: 'POST',\n path: '/{spreadsheetId}/values/{range}:append',\n inputs: [\n { key: 'spreadsheetId', label: 'Spreadsheet ID', type: 'text' },\n { key: 'range', label: 'Range (Sheet1!A1)', type: 'text' },\n { key: 'values', label: 'Row Values (JSON Array)', type: 'json' }\n ]\n },\n {\n id: 'get_values',\n label: 'Get Row(s)',\n method: 'GET',\n path: '/{spreadsheetId}/values/{range}',\n inputs: [\n { key: 'spreadsheetId', label: 'Spreadsheet ID', type: 'text' },\n { key: 'range', label: 'Range', type: 'text' }\n ]\n }\n ]\n },\n {\n id: 'slack-connector', \n label: 'Slack API',\n category: 'action',\n icon: 'MessageSquare',\n color: 'blue',\n baseUrl: 'https://slack.com/api',\n auth: { type: 'bearer', placeholder: 'xoxb-...' },\n operations: [\n {\n id: 'post_message',\n label: 'Post Message',\n method: 'POST',\n path: '/chat.postMessage',\n inputs: [\n { key: 'channel', label: 'Channel ID', type: 'text' },\n { key: 'text', label: 'Message Text', type: 'text' }\n ]\n }\n ]\n },\n {\n id: 'openai',\n label: 'OpenAI',\n category: 'action',\n icon: 'Bot',\n color: 'zinc',\n baseUrl: 'https://api.openai.com/v1',\n auth: { type: 'bearer', placeholder: 'sk-...' },\n operations: [\n {\n id: 'chat_completion',\n label: 'Chat Completion',\n method: 'POST',\n path: '/chat/completions',\n inputs: [\n { key: 'model', label: 'Model', type: 'select', options: [{label: 'GPT-4o', value: 'gpt-4o'}, {label: 'GPT-3.5', value: 'gpt-3.5-turbo'}] },\n { key: 'messages', label: 'Messages (JSON)', type: 'json' }\n ]\n }\n ]\n }\n];\n\nexport function registerConnector(def: ConnectorDefinition) {\n standardConnectors.push(def);\n}\n","[\n {\n \"id\": \"triggers\",\n \"nodes\": [\n {\n \"type\": \"manual-trigger\",\n \"label\": \"Manual Trigger\",\n \"description\": \"Start flow on button click\",\n \"category\": \"trigger\",\n \"icon\": \"Play\",\n \"color\": \"emerald\",\n \"inputs\": []\n },\n {\n \"type\": \"cron-trigger\",\n \"label\": \"Cron Schedule\",\n \"description\": \"Trigger on a schedule\",\n \"category\": \"trigger\",\n \"icon\": \"Clock\",\n \"color\": \"emerald\",\n \"inputs\": [\n { \"key\": \"expression\", \"label\": \"Cron Expression\", \"type\": \"text\", \"placeholder\": \"0 9 * * 1 (Every Mon at 9am)\" }\n ]\n },\n {\n \"id\": \"github-trigger\",\n \"label\": \"GitHub Trigger\",\n \"category\": \"trigger\",\n \"icon\": \"Github\",\n \"color\": \"zinc\",\n \"baseUrl\": \"https://api.github.com\",\n \"auth\": { \"type\": \"header\", \"key\": \"X-GitHub-Token\" },\n \"operations\": [\n { \"id\": \"on_push\", \"label\": \"On Push\", \"method\": \"POST\", \"path\": \"/repos/{owner}/{repo}/hooks\", \"inputs\": [{\"key\": \"owner\", \"label\": \"Owner\", \"type\": \"text\"}, {\"key\": \"repo\", \"label\": \"Repository\", \"type\": \"text\"}] },\n { \"id\": \"on_star\", \"label\": \"On New Star\", \"method\": \"POST\", \"path\": \"/repos/{owner}/{repo}/hooks\", \"inputs\": [{\"key\": \"owner\", \"label\": \"Owner\", \"type\": \"text\"}, {\"key\": \"repo\", \"label\": \"Repository\", \"type\": \"text\"}] }\n ]\n }\n ]\n },\n {\n \"id\": \"logic\",\n \"nodes\": [\n {\n \"type\": \"switch\",\n \"label\": \"Switch / Router\",\n \"description\": \"Route based on value\",\n \"category\": \"logic\",\n \"icon\": \"GitFork\",\n \"color\": \"orange\",\n \"inputs\": [\n { \"key\": \"property\", \"label\": \"Property to Check\", \"type\": \"text\" },\n { \"key\": \"cases\", \"label\": \"Cases (comma sep)\", \"type\": \"text\", \"placeholder\": \"marketing, sales, support\" }\n ]\n },\n {\n \"type\": \"ab-split\",\n \"label\": \"A/B Split\",\n \"description\": \"Randomly split traffic\",\n \"category\": \"logic\",\n \"icon\": \"Percent\",\n \"color\": \"orange\",\n \"inputs\": [\n { \"key\": \"percentA\", \"label\": \"Percentage for A\", \"type\": \"text\", \"placeholder\": \"50\" }\n ]\n },\n {\n \"type\": \"wait\",\n \"label\": \"Wait / Delay\",\n \"description\": \"Pause execution\",\n \"category\": \"logic\",\n \"icon\": \"Timer\",\n \"color\": \"orange\",\n \"inputs\": [\n { \"key\": \"duration\", \"label\": \"Duration\", \"type\": \"text\", \"placeholder\": \"5000\" },\n { \"key\": \"unit\", \"label\": \"Unit\", \"type\": \"select\", \"options\": [{\"label\": \"Milliseconds\", \"value\": \"ms\"}, {\"label\": \"Seconds\", \"value\": \"s\"}] }\n ]\n }\n ]\n },\n {\n \"id\": \"utilities\",\n \"nodes\": [\n {\n \"type\": \"text-transform\",\n \"label\": \"Text Transform\",\n \"description\": \"Modify text strings\",\n \"category\": \"utility\",\n \"icon\": \"Type\",\n \"color\": \"zinc\",\n \"inputs\": [\n {\n \"key\": \"action\",\n \"label\": \"Action\",\n \"type\": \"select\",\n \"options\": [\n { \"label\": \"To Upper Case\", \"value\": \"upper\" },\n { \"label\": \"To Lower Case\", \"value\": \"lower\" },\n { \"label\": \"Trim\", \"value\": \"trim\" },\n { \"label\": \"Replace\", \"value\": \"replace\" }\n ]\n },\n { \"key\": \"input\", \"label\": \"Input Text\", \"type\": \"text\" }\n ]\n },\n {\n \"type\": \"json-parser\",\n \"label\": \"JSON Helper\",\n \"description\": \"Parse or stringify JSON\",\n \"category\": \"utility\",\n \"icon\": \"Code\",\n \"color\": \"zinc\",\n \"inputs\": [\n {\n \"key\": \"action\",\n \"label\": \"Action\",\n \"type\": \"select\",\n \"options\": [\n { \"label\": \"Parse (String to JSON)\", \"value\": \"parse\" },\n { \"label\": \"Stringify (JSON to String)\", \"value\": \"stringify\" }\n ]\n },\n { \"key\": \"data\", \"label\": \"Data\", \"type\": \"json\" }\n ]\n },\n {\n \"type\": \"math-calc\",\n \"label\": \"Math Calculator\",\n \"description\": \"Perform calculations\",\n \"category\": \"utility\",\n \"icon\": \"Calculator\",\n \"color\": \"zinc\",\n \"inputs\": [\n {\n \"key\": \"operation\",\n \"label\": \"Operation\",\n \"type\": \"select\",\n \"options\": [\n { \"label\": \"Add\", \"value\": \"add\" },\n { \"label\": \"Subtract\", \"value\": \"sub\" },\n { \"label\": \"Multiply\", \"value\": \"mul\" },\n { \"label\": \"Divide\", \"value\": \"div\" },\n { \"label\": \"Random Number\", \"value\": \"random\" }\n ]\n },\n { \"key\": \"a\", \"label\": \"Value A\", \"type\": \"text\" },\n { \"key\": \"b\", \"label\": \"Value B\", \"type\": \"text\" }\n ]\n },\n {\n \"type\": \"crypto\",\n \"label\": \"Cryptography\",\n \"description\": \"Hash or Encrypt data\",\n \"category\": \"utility\",\n \"icon\": \"Lock\",\n \"color\": \"zinc\",\n \"inputs\": [\n { \"key\": \"algo\", \"label\": \"Algorithm\", \"type\": \"select\", \"options\": [{\"label\": \"MD5\", \"value\": \"md5\"}, {\"label\": \"SHA-256\", \"value\": \"sha256\"}, {\"label\": \"Base64 Encode\", \"value\": \"base64_enc\"}, {\"label\": \"Base64 Decode\", \"value\": \"base64_dec\"}] },\n { \"key\": \"input\", \"label\": \"value\", \"type\": \"text\" }\n ]\n },\n {\n \"type\": \"date-time\",\n \"label\": \"Date & Time\",\n \"description\": \"Format or manipulate dates\",\n \"category\": \"utility\",\n \"icon\": \"Calendar\",\n \"color\": \"zinc\",\n \"inputs\": [\n { \"key\": \"operation\", \"label\": \"Action\", \"type\": \"select\", \"options\": [{\"label\": \"Now (ISO)\", \"value\": \"now\"}, {\"label\": \"Format Date\", \"value\": \"format\"}, {\"label\": \"Add Time\", \"value\": \"add\"}] },\n { \"key\": \"date\", \"label\": \"Date String\", \"type\": \"text\" },\n { \"key\": \"format\", \"label\": \"Format Pattern\", \"type\": \"text\", \"placeholder\": \"YYYY-MM-DD\" }\n ]\n }\n\n ]\n },\n {\n \"id\": \"integrations-productivity\",\n \"nodes\": [\n {\n \"id\": \"google-drive\",\n \"label\": \"Google Drive\",\n \"icon\": \"HardDrive\",\n \"color\": \"blue\",\n \"category\": \"action\",\n \"baseUrl\": \"https://www.googleapis.com/drive/v3\",\n \"auth\": { \"type\": \"bearer\", \"placeholder\": \"OAuth Token\" },\n \"operations\": [\n { \"id\": \"list\", \"label\": \"List Files\", \"method\": \"GET\", \"path\": \"/files\", \"inputs\": [{\"key\": \"q\", \"label\": \"Query\", \"type\": \"text\"}] },\n { \"id\": \"upload\", \"label\": \"Upload File\", \"method\": \"POST\", \"path\": \"/files\", \"inputs\": [{\"key\": \"name\", \"label\": \"Name\", \"type\": \"text\"}, {\"key\": \"content\", \"label\": \"Content\", \"type\": \"text\"}] }\n ]\n },\n {\n \"id\": \"notion\",\n \"label\": \"Notion\",\n \"icon\": \"FileText\",\n \"color\": \"zinc\",\n \"category\": \"action\",\n \"baseUrl\": \"https://api.notion.com/v1\",\n \"auth\": { \"type\": \"header\", \"key\": \"Authorization\", \"placeholder\": \"Bearer secret_...\" },\n \"operations\": [\n { \"id\": \"create_page\", \"label\": \"Create Page\", \"method\": \"POST\", \"path\": \"/pages\", \"inputs\": [{\"key\": \"parent_id\", \"label\": \"Parent DB ID\", \"type\": \"text\"}, {\"key\": \"properties\", \"label\": \"Properties JSON\", \"type\": \"json\"}] },\n { \"id\": \"query_db\", \"label\": \"Query Database\", \"method\": \"POST\", \"path\": \"/databases/{id}/query\", \"inputs\": [{\"key\": \"id\", \"label\": \"Database ID\", \"type\": \"text\"}] }\n ]\n },\n {\n \"id\": \"airtable\",\n \"label\": \"Airtable\",\n \"icon\": \"Database\",\n \"color\": \"amber\",\n \"category\": \"action\",\n \"baseUrl\": \"https://api.airtable.com/v0\",\n \"auth\": { \"type\": \"bearer\", \"placeholder\": \"pat_...\" },\n \"operations\": [\n { \"id\": \"create_record\", \"label\": \"Create Record\", \"method\": \"POST\", \"path\": \"/{baseId}/{tableId}\", \"inputs\": [{\"key\": \"baseId\", \"label\": \"Base ID\", \"type\": \"text\"}, {\"key\": \"tableId\", \"label\": \"Table Name\", \"type\": \"text\"}, {\"key\": \"fields\", \"label\": \"Fields JSON\", \"type\": \"json\"}] },\n { \"id\": \"list_records\", \"label\": \"List Records\", \"method\": \"GET\", \"path\": \"/{baseId}/{tableId}\", \"inputs\": [{\"key\": \"baseId\", \"label\": \"Base ID\", \"type\": \"text\"}, {\"key\": \"tableId\", \"label\": \"Table Name\", \"type\": \"text\"}] }\n ]\n }\n ]\n },\n {\n \"id\": \"integrations-crm-marketing\",\n \"nodes\": [\n {\n \"id\": \"salesforce\",\n \"label\": \"Salesforce\",\n \"icon\": \"Cloud\",\n \"color\": \"blue\",\n \"category\": \"action\",\n \"baseUrl\": \"https://{instance}.salesforce.com/services/data/vXX.X\",\n \"auth\": { \"type\": \"bearer\" },\n \"operations\": [\n { \"id\": \"create_lead\", \"label\": \"Create Lead\", \"method\": \"POST\", \"path\": \"/sobjects/Lead\", \"inputs\": [{\"key\": \"instance\", \"label\": \"Instance URL\", \"type\": \"text\"}, {\"key\": \"LastName\", \"label\": \"Last Name\", \"type\": \"text\"}, {\"key\": \"Company\", \"label\": \"Company\", \"type\": \"text\"}] }\n ]\n },\n {\n \"id\": \"hubspot\",\n \"label\": \"HubSpot\",\n \"icon\": \"Users\",\n \"color\": \"orange\",\n \"category\": \"action\",\n \"baseUrl\": \"https://api.hubapi.com\",\n \"auth\": { \"type\": \"bearer\" },\n \"operations\": [\n { \"id\": \"create_contact\", \"label\": \"Create Contact\", \"method\": \"POST\", \"path\": \"/crm/v3/objects/contacts\", \"inputs\": [{\"key\": \"properties\", \"label\": \"Properties JSON\", \"type\": \"json\"}] }\n ]\n },\n {\n \"id\": \"mailchimp\",\n \"label\": \"Mailchimp\",\n \"icon\": \"Mail\",\n \"color\": \"yellow\",\n \"category\": \"action\",\n \"baseUrl\": \"https://{dc}.api.mailchimp.com/3.0\",\n \"auth\": { \"type\": \"bearer\" },\n \"operations\": [\n { \"id\": \"add_member\", \"label\": \"Add Subscriber\", \"method\": \"POST\", \"path\": \"/lists/{list_id}/members\", \"inputs\": [{\"key\": \"dc\", \"label\": \"Data Center (usX)\", \"type\": \"text\"}, {\"key\": \"list_id\", \"label\": \"List ID\", \"type\": \"text\"}, {\"key\": \"email_address\", \"label\": \"Email\", \"type\": \"text\"}, {\"key\": \"status\", \"label\": \"Status\", \"type\": \"select\", \"options\": [{\"label\":\"subscribed\",\"value\":\"subscribed\"}]}] }\n ]\n }\n ]\n },\n {\n \"id\": \"integrations-commerce\",\n \"nodes\": [\n {\n \"id\": \"shopify\",\n \"label\": \"Shopify\",\n \"icon\": \"ShoppingBag\",\n \"color\": \"emerald\",\n \"category\": \"action\",\n \"baseUrl\": \"https://{shop}.myshopify.com/admin/api/2023-10\",\n \"auth\": { \"type\": \"header\", \"key\": \"X-Shopify-Access-Token\" },\n \"operations\": [\n { \"id\": \"get_products\", \"label\": \"Get Products\", \"method\": \"GET\", \"path\": \"/products.json\", \"inputs\": [{\"key\": \"shop\", \"label\": \"Shop Name\", \"type\": \"text\"}] },\n { \"id\": \"create_order\", \"label\": \"Create Order\", \"method\": \"POST\", \"path\": \"/orders.json\", \"inputs\": [{\"key\": \"shop\", \"label\": \"Shop Name\", \"type\": \"text\"}, {\"key\": \"order\", \"label\": \"Order JSON\", \"type\": \"json\"}] }\n ]\n },\n {\n \"id\": \"stripe\",\n \"label\": \"Stripe\",\n \"icon\": \"CreditCard\",\n \"color\": \"indigo\",\n \"category\": \"action\",\n \"baseUrl\": \"https://api.stripe.com/v1\",\n \"auth\": { \"type\": \"bearer\" },\n \"operations\": [\n { \"id\": \"create_customer\", \"label\": \"Create Customer\", \"method\": \"POST\", \"path\": \"/customers\", \"inputs\": [{\"key\": \"email\", \"label\": \"Email\", \"type\": \"text\"}] },\n { \"id\": \"list_charges\", \"label\": \"List Charges\", \"method\": \"GET\", \"path\": \"/charges\", \"inputs\": [{\"key\": \"limit\", \"label\": \"Limit\", \"type\": \"text\"}] }\n ]\n }\n ]\n }\n]\n","import { NodeTypeDefinition, nodeRegistry } from './registry';\nimport { createConnectorNode, ConnectorDefinition } from './connector';\nimport catalogData from './catalog.json';\n\n// Helper to convert catalog entries to registry definitions\nexport function loadCatalog() {\n catalogData.forEach((group: any) => {\n group.nodes.forEach((node: any) => {\n // Check if it's a connector (has operations) or a native node\n if (node.operations) {\n // It's a connector\n const connector: ConnectorDefinition = {\n id: node.id,\n label: node.label,\n category: node.category,\n icon: node.icon,\n color: node.color,\n baseUrl: node.baseUrl,\n auth: node.auth,\n operations: node.operations\n };\n // Register it\n nodeRegistry[connector.id] = createConnectorNode(connector);\n // We also need to add it to generic connector lookups if we used a separate array.\n // But createConnectorNode returns a definition that we put in registry.\n // However, for PropertyPanel execution logic to find operations, we need it in a lookup.\n // Let's attach the connector definition to the registry entry metadata if possible, \n // OR extending the look up function.\n // HACK: We will push to standardConnectors array in standard-library if we want `getConnectorDetails` to find it.\n } else {\n // It's a standard simple node\n const def: NodeTypeDefinition = {\n type: node.type,\n label: node.label,\n description: node.description,\n category: node.category,\n icon: node.icon,\n color: node.color,\n handles: node.handles || [ { id: 'in', type: 'target' }, { id: 'out', type: 'source' } ],\n inputs: node.inputs\n };\n nodeRegistry[def.type] = def;\n }\n });\n });\n}\n","export type NodeCategory = 'trigger' | 'action' | 'logic' | 'utility';\n\nexport interface NodeHandle {\n id: string;\n type: 'source' | 'target';\n label?: string;\n}\n\nexport interface NodeField {\n key: string;\n label: string;\n type: 'text' | 'number' | 'select' | 'boolean' | 'json' | 'code';\n options?: { label: string; value: string }[];\n placeholder?: string;\n description?: string;\n}\n\nexport interface NodeTypeDefinition {\n type: string;\n label: string;\n description: string;\n category: NodeCategory;\n icon: string; \n color: string; // Tailwind class component for border/bg\n handles: NodeHandle[];\n inputs: NodeField[];\n}\n\nimport { createConnectorNode, ConnectorDefinition } from './connector';\nimport { standardConnectors } from './standard-library';\n\n// ... existing definitions ...\nexport const nodeRegistry: Record<string, NodeTypeDefinition> = {\n // ... existing static nodes ...\n 'webhook': {\n type: 'webhook',\n label: 'Webhook',\n description: 'Triggers when a URL is called',\n category: 'trigger',\n icon: 'Webhook',\n color: 'emerald',\n handles: [{ id: 'out', type: 'source' }],\n inputs: [\n { key: 'method', label: 'HTTP Method', type: 'select', options: [{ label: 'GET', value: 'GET'}, { label: 'POST', value: 'POST'}] },\n { key: 'path', label: 'Path', type: 'text', placeholder: '/webhook/...' }\n ]\n },\n 'schedule': {\n type: 'schedule',\n label: 'Schedule',\n description: 'Triggers on a specific interval',\n category: 'trigger',\n icon: 'Clock',\n color: 'emerald',\n handles: [{ id: 'out', type: 'source' }],\n inputs: [\n { key: 'interval', label: 'Interval', type: 'select', options: [{ label: 'Every Minute', value: '1m'}, { label: 'Every Hour', value: '1h'}, { label: 'Every Day', value: '1d'}] },\n { key: 'cron', label: 'Cron Expression', type: 'text', placeholder: '* * * * *' }\n ]\n },\n 'http-request': {\n type: 'http-request',\n label: 'HTTP Request',\n description: 'Make an external API call',\n category: 'action',\n icon: 'Globe',\n color: 'blue',\n handles: [{ id: 'in', type: 'target' }, { id: 'out', type: 'source' }],\n inputs: [\n { key: 'url', label: 'URL', type: 'text', placeholder: 'https://api.example.com' },\n { key: 'method', label: 'Method', type: 'select', options: [{ label: 'GET', value: 'GET'}, { label: 'POST', value: 'POST'}, { label: 'PUT', value: 'PUT'}, { label: 'DELETE', value: 'DELETE'}] },\n { key: 'headers', label: 'Headers', type: 'json' },\n { key: 'body', label: 'Body', type: 'json' }\n ]\n },\n 'email': {\n type: 'email',\n label: 'Send Email',\n description: 'Send an email to a recipient',\n category: 'action',\n icon: 'Mail',\n color: 'blue',\n handles: [{ id: 'in', type: 'target' }, { id: 'out', type: 'source' }],\n inputs: [\n { key: 'to', label: 'To', type: 'text' },\n { key: 'subject', label: 'Subject', type: 'text' },\n { key: 'body', label: 'Body', type: 'text' } \n ]\n },\n 'slack': {\n type: 'slack',\n label: 'Slack (Simple)',\n description: 'Send a message to a channel',\n category: 'action',\n icon: 'MessageSquare',\n color: 'blue',\n handles: [{ id: 'in', type: 'target' }, { id: 'out', type: 'source' }],\n inputs: [\n { key: 'webhookUrl', label: 'Webhook URL', type: 'text' },\n { key: 'message', label: 'Message', type: 'text' }\n ]\n },\n 'if-else': {\n type: 'if-else',\n label: 'If / Else',\n description: 'Branch flow based on condition',\n category: 'logic',\n icon: 'Split',\n color: 'orange',\n handles: [\n { id: 'in', type: 'target' },\n { id: 'true', type: 'source', label: 'True' },\n { id: 'false', type: 'source', label: 'False' }\n ],\n inputs: [\n { key: 'condition', label: 'Condition', type: 'code', description: 'Javascript expression returning true/false' }\n ]\n },\n 'merge': {\n type: 'merge',\n label: 'Merge',\n description: 'Combine multiple branches',\n category: 'logic',\n icon: 'GitMerge',\n color: 'orange',\n handles: [\n { id: 'in-a', type: 'target', label: 'A' },\n { id: 'in-b', type: 'target', label: 'B' },\n { id: 'out', type: 'source' }\n ],\n inputs: []\n }\n};\n\n// Inject Standard Connectors\nstandardConnectors.forEach(conn => {\n nodeRegistry[conn.id] = createConnectorNode(conn);\n});\n\nimport { loadCatalog } from './loader';\n// Initialize Catalog\nloadCatalog();\n\n// Helper to get definition details if it is a connector\nexport function getConnectorDetails(typeId: string): ConnectorDefinition | undefined {\n return standardConnectors.find(c => c.id === typeId);\n}\n"],"mappings":"AAaA,IAAMA,EAAyB,gDAElBC,EAAN,KAAqB,CAG1B,YAAoBC,EAAuB,CAAvB,YAAAA,EAFpB,KAAQ,iBAA4C,IAER,CAE5C,MAAM,UAAsC,CAC1C,GAAI,KAAK,iBAAk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AE,GAAI,KAAM,KAAM,QAAS,EAC3B,CAAE,GAAI,OAAQ,KAAM,SAAU,MAAO,MAAO,EAC5C,CAAE,GAAI,QAAS,KAAM,SAAU,MAAO,OAAQ,CAC9C,EACA,OAAQ,CACR,CAAE,IAAK,YAAa,MAAO,YAAa,KAAM,OAAQ,YAAa,4CAA6C,CAChH,CACJ,EACA,MAAS,CACL,KAAM,QACN,MAAO,QACP,YAAa,4BACb,SAAU,QACV,KAAM,WACN,MAAO,SACP,QAAS,CACT,CAAE,GAAI,OAAQ,KAAM,SAAU,MAAO,GAAI,EACzC,CAAE,GAAI,OAAQ,KAAM,SAAU,MAAO,GAAI,EACzC,CAAE,GAAI,MAAO,KAAM,QAAS,CAC5B,EACA,OAAQ,CAAC,CACb,CACJ,EAGAC,EAAmB,QAAQC,GAAQ,CAC/BF,EAAaE,EAAK,EAAE,EAAIC,EAAoBD,CAAI,CACpD,CAAC,EAIDE,EAAY,EAGL,SAASC,EAAoBC,EAAiD,CACjF,OAAOL,EAAmB,KAAKM,GAAKA,EAAE,KAAOD,CAAM,CACvD","names":["DEFAULT_VALIDATION_URL","LicenseManager","config","endpoint","data","error","featureName","_a","_b","ApiClient","config","url","method","body","headers","response","id","workflow","WorkflowSerializer","nodes","edges","viewport","json","data","serialize","deserialize","createConnectorNode","def","op","standardConnectors","registerConnector","def","catalog_default","loadCatalog","catalog_default","group","node","connector","nodeRegistry","createConnectorNode","def","nodeRegistry","standardConnectors","conn","createConnectorNode","loadCatalog","getConnectorDetails","typeId","c"]}
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "@universal-workflow/widget-core",
3
+ "version": "0.1.1",
4
+ "main": "./dist/index.js",
5
+ "module": "./dist/index.mjs",
6
+ "types": "./dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "require": "./dist/index.js",
11
+ "import": "./dist/index.mjs"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist"
16
+ ],
17
+ "license": "MIT",
18
+ "scripts": {
19
+ "build": "tsup",
20
+ "dev": "tsup --watch",
21
+ "lint": "eslint ."
22
+ },
23
+ "dependencies": {
24
+ "nanoid": "^5.0.0",
25
+ "zod": "^3.22.0"
26
+ },
27
+ "devDependencies": {
28
+ "eslint": "^8.0.0",
29
+ "typescript": "^5.0.0",
30
+ "tsup": "^8.3.5"
31
+ }
32
+ }