flowengine-mcp-app 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +215 -0
- package/build/client.d.ts +51 -0
- package/build/client.d.ts.map +1 -0
- package/build/client.js +161 -0
- package/build/client.js.map +1 -0
- package/build/index.d.ts +7 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +650 -0
- package/build/index.js.map +1 -0
- package/build/ui/base.d.ts +7 -0
- package/build/ui/base.d.ts.map +1 -0
- package/build/ui/base.js +301 -0
- package/build/ui/base.js.map +1 -0
- package/build/ui/demo.d.ts +14 -0
- package/build/ui/demo.d.ts.map +1 -0
- package/build/ui/demo.js +222 -0
- package/build/ui/demo.js.map +1 -0
- package/build/ui/instances.d.ts +17 -0
- package/build/ui/instances.d.ts.map +1 -0
- package/build/ui/instances.js +229 -0
- package/build/ui/instances.js.map +1 -0
- package/build/ui/portals.d.ts +14 -0
- package/build/ui/portals.d.ts.map +1 -0
- package/build/ui/portals.js +184 -0
- package/build/ui/portals.js.map +1 -0
- package/build/ui/widgets.d.ts +17 -0
- package/build/ui/widgets.d.ts.map +1 -0
- package/build/ui/widgets.js +200 -0
- package/build/ui/widgets.js.map +1 -0
- package/build/ui/workflows.d.ts +17 -0
- package/build/ui/workflows.d.ts.map +1 -0
- package/build/ui/workflows.js +217 -0
- package/build/ui/workflows.js.map +1 -0
- package/package.json +54 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 FlowEngine
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
# FlowEngine MCP App
|
|
2
|
+
|
|
3
|
+
Interactive UI for managing FlowEngine directly from Claude Code! This MCP App brings rich, visual dashboards right into your AI coding assistant.
|
|
4
|
+
|
|
5
|
+
## 🎯 Features
|
|
6
|
+
|
|
7
|
+
- **🎬 n8n Demo & Templates** - Explore pre-built workflows and automation templates
|
|
8
|
+
- **🏢 Client Portals** - Manage your client instances and portals with visual dashboards
|
|
9
|
+
- **⚡ Workflow Manager** - View, toggle, and monitor automation workflows
|
|
10
|
+
- **🎨 UI Builder** - Create and manage forms, chatbots, and interactive components
|
|
11
|
+
- **🚀 Hosting Management** - Monitor instance health, storage, and status
|
|
12
|
+
|
|
13
|
+
All with beautiful, interactive UIs rendered directly in Claude Code!
|
|
14
|
+
|
|
15
|
+
## 📦 Installation
|
|
16
|
+
|
|
17
|
+
### Prerequisites
|
|
18
|
+
|
|
19
|
+
- Node.js 18 or higher
|
|
20
|
+
- FlowEngine account with API key
|
|
21
|
+
- Claude Code (Claude Desktop, VSCode, or CLI)
|
|
22
|
+
|
|
23
|
+
### Step 1: Get Your FlowEngine API Key
|
|
24
|
+
|
|
25
|
+
1. Log in to [FlowEngine](https://flowengine.cloud)
|
|
26
|
+
2. Go to **Settings → API Access**
|
|
27
|
+
3. Click **Generate API Key**
|
|
28
|
+
4. Copy the full API key (shown only once!)
|
|
29
|
+
|
|
30
|
+
### Step 2: Configure Claude Code
|
|
31
|
+
|
|
32
|
+
The MCP app will be automatically downloaded from npm when first used. Add the following to your Claude configuration:
|
|
33
|
+
|
|
34
|
+
**For Claude Desktop:**
|
|
35
|
+
|
|
36
|
+
Edit `~/Library/Application Support/Claude/claude_desktop_config.json`:
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"mcpServers": {
|
|
41
|
+
"flowengine": {
|
|
42
|
+
"command": "npx",
|
|
43
|
+
"args": ["-y", "@flowengine/mcp-app"],
|
|
44
|
+
"env": {
|
|
45
|
+
"FLOWENGINE_API_KEY": "your-api-key-here",
|
|
46
|
+
"FLOWENGINE_BASE_URL": "https://flowengine.cloud"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**For Claude Code CLI:**
|
|
54
|
+
|
|
55
|
+
Edit `~/.config/claude/config.json`:
|
|
56
|
+
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"mcpServers": {
|
|
60
|
+
"flowengine": {
|
|
61
|
+
"command": "npx",
|
|
62
|
+
"args": ["-y", "@flowengine/mcp-app"],
|
|
63
|
+
"env": {
|
|
64
|
+
"FLOWENGINE_API_KEY": "your-api-key-here",
|
|
65
|
+
"FLOWENGINE_BASE_URL": "https://flowengine.cloud"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**For VSCode (Claude Extension):**
|
|
73
|
+
|
|
74
|
+
Edit your workspace/user settings:
|
|
75
|
+
|
|
76
|
+
```json
|
|
77
|
+
{
|
|
78
|
+
"mcp.servers": {
|
|
79
|
+
"flowengine": {
|
|
80
|
+
"command": "npx",
|
|
81
|
+
"args": ["-y", "@flowengine/mcp-app"],
|
|
82
|
+
"env": {
|
|
83
|
+
"FLOWENGINE_API_KEY": "your-api-key-here",
|
|
84
|
+
"FLOWENGINE_BASE_URL": "https://flowengine.cloud"
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Step 3: Restart Claude
|
|
92
|
+
|
|
93
|
+
Restart Claude Desktop, start a new Claude Code CLI session, or reload your VSCode window to load the MCP App.
|
|
94
|
+
|
|
95
|
+
> **💡 Tip:** You can copy the pre-configured MCP setup directly from FlowEngine Settings → API Access!
|
|
96
|
+
|
|
97
|
+
## 🚀 Usage
|
|
98
|
+
|
|
99
|
+
Once configured, you can access FlowEngine features directly in Claude Code:
|
|
100
|
+
|
|
101
|
+
### View Interactive Dashboards
|
|
102
|
+
|
|
103
|
+
Ask Claude to show you any of these UIs:
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
"Show me the FlowEngine demo"
|
|
107
|
+
"Show me my client portals"
|
|
108
|
+
"Show me my workflows"
|
|
109
|
+
"Show me the UI builder"
|
|
110
|
+
"Show me my hosting instances"
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Claude will render interactive HTML dashboards directly in the chat!
|
|
114
|
+
|
|
115
|
+
### Use Tools for Quick Actions
|
|
116
|
+
|
|
117
|
+
You can also ask Claude to perform actions:
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
"List all my workflows"
|
|
121
|
+
"Toggle workflow abc123"
|
|
122
|
+
"Show me the status of my instances"
|
|
123
|
+
"Get recent executions for workflow xyz"
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Available Resources
|
|
127
|
+
|
|
128
|
+
- `app://flowengine/demo` - n8n Demo & Templates showcase
|
|
129
|
+
- `app://flowengine/portals` - Client portals dashboard
|
|
130
|
+
- `app://flowengine/workflows` - Workflows manager
|
|
131
|
+
- `app://flowengine/ui-builder` - UI component builder
|
|
132
|
+
- `app://flowengine/hosting` - Instance hosting management
|
|
133
|
+
|
|
134
|
+
### Available Tools
|
|
135
|
+
|
|
136
|
+
- `flowengine_list_workflows` - List all workflows
|
|
137
|
+
- `flowengine_toggle_workflow` - Enable/disable a workflow
|
|
138
|
+
- `flowengine_get_workflow_executions` - Get workflow execution history
|
|
139
|
+
- `flowengine_list_instances` - List all instances
|
|
140
|
+
- `flowengine_get_instance_status` - Get instance health status
|
|
141
|
+
- `flowengine_list_ui_components` - List forms/chatbots/widgets
|
|
142
|
+
- `flowengine_get_component` - Get component details
|
|
143
|
+
- `flowengine_list_portals` - List client portals
|
|
144
|
+
|
|
145
|
+
## 🎨 Screenshots
|
|
146
|
+
|
|
147
|
+
The MCP App provides beautiful, dark-themed UIs that match Claude Code's interface:
|
|
148
|
+
|
|
149
|
+
- **Dashboard Cards** - Clean card-based layouts for all resources
|
|
150
|
+
- **Status Badges** - Color-coded status indicators (Active, Paused, Error)
|
|
151
|
+
- **Storage Meters** - Visual storage usage bars
|
|
152
|
+
- **Interactive Tables** - Sortable execution history and metrics
|
|
153
|
+
- **Action Buttons** - Quick actions for common tasks
|
|
154
|
+
|
|
155
|
+
## 🔧 Development
|
|
156
|
+
|
|
157
|
+
### Project Structure
|
|
158
|
+
|
|
159
|
+
```
|
|
160
|
+
flowengine-mcp/
|
|
161
|
+
├── src/
|
|
162
|
+
│ ├── index.ts # Main MCP App server
|
|
163
|
+
│ ├── client.ts # FlowEngine API client
|
|
164
|
+
│ └── ui/
|
|
165
|
+
│ ├── base.ts # Base UI layout and styles
|
|
166
|
+
│ ├── demo.ts # n8n demo showcase
|
|
167
|
+
│ ├── portals.ts # Client portals UI
|
|
168
|
+
│ ├── workflows.ts # Workflows manager UI
|
|
169
|
+
│ ├── widgets.ts # UI builder UI
|
|
170
|
+
│ └── instances.ts # Hosting management UI
|
|
171
|
+
├── package.json
|
|
172
|
+
├── tsconfig.json
|
|
173
|
+
└── README.md
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### Build
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
npm run build
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### Watch Mode (for development)
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
npm run dev
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## 🤝 Contributing
|
|
189
|
+
|
|
190
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
191
|
+
|
|
192
|
+
## 📝 License
|
|
193
|
+
|
|
194
|
+
MIT
|
|
195
|
+
|
|
196
|
+
## 🆘 Support
|
|
197
|
+
|
|
198
|
+
For issues or questions:
|
|
199
|
+
- FlowEngine: [https://flowengine.cloud/support](https://flowengine.cloud/support)
|
|
200
|
+
- MCP Documentation: [https://modelcontextprotocol.io](https://modelcontextprotocol.io)
|
|
201
|
+
|
|
202
|
+
## 🎉 What's Next?
|
|
203
|
+
|
|
204
|
+
This MCP App is just the beginning! Future features planned:
|
|
205
|
+
|
|
206
|
+
- [ ] Real-time execution monitoring
|
|
207
|
+
- [ ] Workflow editor integration
|
|
208
|
+
- [ ] Template marketplace
|
|
209
|
+
- [ ] Advanced analytics dashboard
|
|
210
|
+
- [ ] Team collaboration features
|
|
211
|
+
- [ ] Webhook testing UI
|
|
212
|
+
- [ ] Credential management UI
|
|
213
|
+
- [ ] Backup & restore UI
|
|
214
|
+
|
|
215
|
+
Stay tuned for updates!
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FlowEngine API Client
|
|
3
|
+
* Handles all API requests with API key authentication
|
|
4
|
+
*/
|
|
5
|
+
export interface FlowEngineConfig {
|
|
6
|
+
apiKey: string;
|
|
7
|
+
baseUrl?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare class FlowEngineClient {
|
|
10
|
+
private apiKey;
|
|
11
|
+
private baseUrl;
|
|
12
|
+
constructor(config: FlowEngineConfig);
|
|
13
|
+
private request;
|
|
14
|
+
getClientInstances(): Promise<unknown>;
|
|
15
|
+
getClientPanelWorkflows(instanceId: string): Promise<unknown>;
|
|
16
|
+
getClientPanelWidgets(instanceId: string): Promise<unknown>;
|
|
17
|
+
getWorkflows(instanceId?: string): Promise<unknown>;
|
|
18
|
+
toggleWorkflow(workflowId: string, enabled: boolean): Promise<unknown>;
|
|
19
|
+
archiveWorkflow(workflowId: string): Promise<unknown>;
|
|
20
|
+
getWorkflowParameters(workflowId: string): Promise<unknown>;
|
|
21
|
+
getWidgets(instanceId?: string): Promise<unknown>;
|
|
22
|
+
getWidget(widgetId: string): Promise<unknown>;
|
|
23
|
+
createWidget(data: any): Promise<unknown>;
|
|
24
|
+
updateWidget(widgetId: string, data: any): Promise<unknown>;
|
|
25
|
+
deleteWidget(widgetId: string): Promise<unknown>;
|
|
26
|
+
getInstances(): Promise<unknown>;
|
|
27
|
+
getInstanceStatus(instanceId: string): Promise<unknown>;
|
|
28
|
+
provisionInstance(data: any): Promise<unknown>;
|
|
29
|
+
updateInstance(data: any): Promise<unknown>;
|
|
30
|
+
deleteInstance(instanceId: string): Promise<unknown>;
|
|
31
|
+
getExecutions(instanceId?: string): Promise<unknown>;
|
|
32
|
+
getWorkflowExecutions(workflowId: string): Promise<unknown>;
|
|
33
|
+
importWorkflowToInstance(data: {
|
|
34
|
+
instanceId: string;
|
|
35
|
+
workflowJSON: any;
|
|
36
|
+
workflowTitle?: string;
|
|
37
|
+
}): Promise<unknown>;
|
|
38
|
+
importTemplate(data: {
|
|
39
|
+
templateId: string;
|
|
40
|
+
instanceId: string;
|
|
41
|
+
}): Promise<unknown>;
|
|
42
|
+
listTemplates(): Promise<unknown>;
|
|
43
|
+
getCredentials(instanceId?: string): Promise<unknown>;
|
|
44
|
+
getCredentialTypes(): Promise<unknown>;
|
|
45
|
+
createCredential(data: any): Promise<unknown>;
|
|
46
|
+
deleteCredential(credentialId: string): Promise<unknown>;
|
|
47
|
+
testCredential(data: any): Promise<unknown>;
|
|
48
|
+
getUserBudget(): Promise<unknown>;
|
|
49
|
+
getApiKeyInfo(): Promise<unknown>;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,OAAO,CAAS;gBAEZ,MAAM,EAAE,gBAAgB;YAKtB,OAAO;IAmBf,kBAAkB;IAIlB,uBAAuB,CAAC,UAAU,EAAE,MAAM;IAI1C,qBAAqB,CAAC,UAAU,EAAE,MAAM;IAKxC,YAAY,CAAC,UAAU,CAAC,EAAE,MAAM;IAKhC,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO;IAOnD,eAAe,CAAC,UAAU,EAAE,MAAM;IAMlC,qBAAqB,CAAC,UAAU,EAAE,MAAM;IAKxC,UAAU,CAAC,UAAU,CAAC,EAAE,MAAM;IAK9B,SAAS,CAAC,QAAQ,EAAE,MAAM;IAI1B,YAAY,CAAC,IAAI,EAAE,GAAG;IAOtB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG;IAOxC,YAAY,CAAC,QAAQ,EAAE,MAAM;IAO7B,YAAY;IAIZ,iBAAiB,CAAC,UAAU,EAAE,MAAM;IAIpC,iBAAiB,CAAC,IAAI,EAAE,GAAG;IAO3B,cAAc,CAAC,IAAI,EAAE,GAAG;IAOxB,cAAc,CAAC,UAAU,EAAE,MAAM;IAQjC,aAAa,CAAC,UAAU,CAAC,EAAE,MAAM;IAKjC,qBAAqB,CAAC,UAAU,EAAE,MAAM;IAIxC,wBAAwB,CAAC,IAAI,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,GAAG,CAAC;QAAC,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE;IAOhG,cAAc,CAAC,IAAI,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE;IAO/D,aAAa;IAKb,cAAc,CAAC,UAAU,CAAC,EAAE,MAAM;IAKlC,kBAAkB;IAIlB,gBAAgB,CAAC,IAAI,EAAE,GAAG;IAO1B,gBAAgB,CAAC,YAAY,EAAE,MAAM;IAMrC,cAAc,CAAC,IAAI,EAAE,GAAG;IAQxB,aAAa;IAIb,aAAa;CAGpB"}
|
package/build/client.js
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FlowEngine API Client
|
|
3
|
+
* Handles all API requests with API key authentication
|
|
4
|
+
*/
|
|
5
|
+
export class FlowEngineClient {
|
|
6
|
+
apiKey;
|
|
7
|
+
baseUrl;
|
|
8
|
+
constructor(config) {
|
|
9
|
+
this.apiKey = config.apiKey;
|
|
10
|
+
this.baseUrl = config.baseUrl || 'https://flowengine.cloud';
|
|
11
|
+
}
|
|
12
|
+
async request(endpoint, options = {}) {
|
|
13
|
+
const url = `${this.baseUrl}${endpoint}`;
|
|
14
|
+
const headers = {
|
|
15
|
+
'Authorization': `Bearer ${this.apiKey}`,
|
|
16
|
+
'Content-Type': 'application/json',
|
|
17
|
+
...options.headers,
|
|
18
|
+
};
|
|
19
|
+
const response = await fetch(url, { ...options, headers });
|
|
20
|
+
if (!response.ok) {
|
|
21
|
+
const error = await response.text();
|
|
22
|
+
throw new Error(`FlowEngine API Error (${response.status}): ${error}`);
|
|
23
|
+
}
|
|
24
|
+
return response.json();
|
|
25
|
+
}
|
|
26
|
+
// Portal / Client Panel APIs
|
|
27
|
+
async getClientInstances() {
|
|
28
|
+
return this.request('/api/client/instances');
|
|
29
|
+
}
|
|
30
|
+
async getClientPanelWorkflows(instanceId) {
|
|
31
|
+
return this.request(`/api/client-panel/${instanceId}/workflows`);
|
|
32
|
+
}
|
|
33
|
+
async getClientPanelWidgets(instanceId) {
|
|
34
|
+
return this.request(`/api/client-panel/${instanceId}/all-widgets`);
|
|
35
|
+
}
|
|
36
|
+
// Workflow APIs
|
|
37
|
+
async getWorkflows(instanceId) {
|
|
38
|
+
const params = instanceId ? `?instanceId=${instanceId}` : '';
|
|
39
|
+
return this.request(`/api/client/workflows${params}`);
|
|
40
|
+
}
|
|
41
|
+
async toggleWorkflow(workflowId, enabled) {
|
|
42
|
+
return this.request(`/api/client/workflows/${workflowId}/toggle`, {
|
|
43
|
+
method: 'PATCH',
|
|
44
|
+
body: JSON.stringify({ active: enabled }),
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
async archiveWorkflow(workflowId) {
|
|
48
|
+
return this.request(`/api/client/workflows/${workflowId}/archive`, {
|
|
49
|
+
method: 'PATCH',
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
async getWorkflowParameters(workflowId) {
|
|
53
|
+
return this.request(`/api/client/workflows/${workflowId}/parameters`);
|
|
54
|
+
}
|
|
55
|
+
// Widget / UI Builder APIs
|
|
56
|
+
async getWidgets(instanceId) {
|
|
57
|
+
const params = instanceId ? `?instanceId=${instanceId}` : '';
|
|
58
|
+
return this.request(`/api/client/widgets${params}`);
|
|
59
|
+
}
|
|
60
|
+
async getWidget(widgetId) {
|
|
61
|
+
return this.request(`/api/client/widgets/${widgetId}`);
|
|
62
|
+
}
|
|
63
|
+
async createWidget(data) {
|
|
64
|
+
return this.request('/api/client/widgets', {
|
|
65
|
+
method: 'POST',
|
|
66
|
+
body: JSON.stringify(data),
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
async updateWidget(widgetId, data) {
|
|
70
|
+
return this.request(`/api/client/widgets/${widgetId}`, {
|
|
71
|
+
method: 'PUT',
|
|
72
|
+
body: JSON.stringify(data),
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
async deleteWidget(widgetId) {
|
|
76
|
+
return this.request(`/api/client/widgets/${widgetId}`, {
|
|
77
|
+
method: 'DELETE',
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
// Instance / Hosting APIs
|
|
81
|
+
async getInstances() {
|
|
82
|
+
return this.request('/api/client/instances');
|
|
83
|
+
}
|
|
84
|
+
async getInstanceStatus(instanceId) {
|
|
85
|
+
return this.request(`/api/n8n/status?instanceId=${instanceId}`);
|
|
86
|
+
}
|
|
87
|
+
async provisionInstance(data) {
|
|
88
|
+
return this.request('/api/n8n/provision-instance', {
|
|
89
|
+
method: 'POST',
|
|
90
|
+
body: JSON.stringify(data),
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
async updateInstance(data) {
|
|
94
|
+
return this.request('/api/n8n/manage', {
|
|
95
|
+
method: 'POST',
|
|
96
|
+
body: JSON.stringify(data),
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
async deleteInstance(instanceId) {
|
|
100
|
+
return this.request('/api/n8n/delete-instance', {
|
|
101
|
+
method: 'POST',
|
|
102
|
+
body: JSON.stringify({ instanceId }),
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
// Execution APIs
|
|
106
|
+
async getExecutions(instanceId) {
|
|
107
|
+
const params = instanceId ? `?instanceId=${instanceId}` : '';
|
|
108
|
+
return this.request(`/api/client/executions${params}`);
|
|
109
|
+
}
|
|
110
|
+
async getWorkflowExecutions(workflowId) {
|
|
111
|
+
return this.request(`/api/client/workflows/${workflowId}/executions`);
|
|
112
|
+
}
|
|
113
|
+
async importWorkflowToInstance(data) {
|
|
114
|
+
return this.request('/api/workflows/import-to-instance', {
|
|
115
|
+
method: 'POST',
|
|
116
|
+
body: JSON.stringify(data),
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
async importTemplate(data) {
|
|
120
|
+
return this.request(`/api/client/templates/${data.templateId}/import`, {
|
|
121
|
+
method: 'POST',
|
|
122
|
+
body: JSON.stringify({ instanceId: data.instanceId }),
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
async listTemplates() {
|
|
126
|
+
return this.request('/api/n8n-templates');
|
|
127
|
+
}
|
|
128
|
+
// Credential APIs
|
|
129
|
+
async getCredentials(instanceId) {
|
|
130
|
+
const params = instanceId ? `?instanceId=${instanceId}` : '';
|
|
131
|
+
return this.request(`/api/client/credentials${params}`);
|
|
132
|
+
}
|
|
133
|
+
async getCredentialTypes() {
|
|
134
|
+
return this.request('/api/client/credentials/types');
|
|
135
|
+
}
|
|
136
|
+
async createCredential(data) {
|
|
137
|
+
return this.request('/api/client/credentials', {
|
|
138
|
+
method: 'POST',
|
|
139
|
+
body: JSON.stringify(data),
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
async deleteCredential(credentialId) {
|
|
143
|
+
return this.request(`/api/client/credentials/${credentialId}`, {
|
|
144
|
+
method: 'DELETE',
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
async testCredential(data) {
|
|
148
|
+
return this.request('/api/client/credentials/test', {
|
|
149
|
+
method: 'POST',
|
|
150
|
+
body: JSON.stringify(data),
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
// User / Budget APIs
|
|
154
|
+
async getUserBudget() {
|
|
155
|
+
return this.request('/api/client/budget');
|
|
156
|
+
}
|
|
157
|
+
async getApiKeyInfo() {
|
|
158
|
+
return this.request('/api/user/api-keys/info');
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,MAAM,OAAO,gBAAgB;IACnB,MAAM,CAAS;IACf,OAAO,CAAS;IAExB,YAA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