@d34dman/flowdrop 0.0.6 → 0.0.7

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.
@@ -42,7 +42,7 @@ export class FlowDropApiClient {
42
42
  * Fetch available node types and their metadata
43
43
  */
44
44
  async getAvailableNodes() {
45
- const response = await this.request('/api/flowdrop/nodes');
45
+ const response = await this.request('/nodes');
46
46
  if (!response.success || !response.data) {
47
47
  throw new Error(response.error || 'Failed to fetch available nodes');
48
48
  }
@@ -52,7 +52,7 @@ export class FlowDropApiClient {
52
52
  * Fetch nodes by category
53
53
  */
54
54
  async getNodesByCategory(category) {
55
- const response = await this.request(`/api/nodes?category=${encodeURIComponent(category)}`);
55
+ const response = await this.request(`/nodes?category=${encodeURIComponent(category)}`);
56
56
  if (!response.success || !response.data) {
57
57
  throw new Error(response.error || 'Failed to fetch nodes by category');
58
58
  }
@@ -62,7 +62,7 @@ export class FlowDropApiClient {
62
62
  * Fetch a specific node's metadata
63
63
  */
64
64
  async getNodeMetadata(nodeId) {
65
- const response = await this.request(`/api/nodes/${encodeURIComponent(nodeId)}`);
65
+ const response = await this.request(`/nodes/${encodeURIComponent(nodeId)}`);
66
66
  if (!response.success || !response.data) {
67
67
  throw new Error(response.error || 'Failed to fetch node metadata');
68
68
  }
@@ -72,7 +72,7 @@ export class FlowDropApiClient {
72
72
  * Save a workflow
73
73
  */
74
74
  async saveWorkflow(workflow) {
75
- const response = await this.request('/api/flowdrop/workflows', {
75
+ const response = await this.request('/workflows', {
76
76
  method: 'POST',
77
77
  body: JSON.stringify(workflow)
78
78
  });
@@ -85,7 +85,7 @@ export class FlowDropApiClient {
85
85
  * Update an existing workflow
86
86
  */
87
87
  async updateWorkflow(workflowId, workflow) {
88
- const response = await this.request(`/api/workflows/${encodeURIComponent(workflowId)}`, {
88
+ const response = await this.request(`/workflows/${encodeURIComponent(workflowId)}`, {
89
89
  method: 'PUT',
90
90
  body: JSON.stringify(workflow)
91
91
  });
@@ -98,7 +98,7 @@ export class FlowDropApiClient {
98
98
  * Load a workflow by ID
99
99
  */
100
100
  async loadWorkflow(workflowId) {
101
- const response = await this.request(`/api/workflows/${encodeURIComponent(workflowId)}`);
101
+ const response = await this.request(`/workflows/${encodeURIComponent(workflowId)}`);
102
102
  if (!response.success || !response.data) {
103
103
  throw new Error(response.error || 'Failed to load workflow');
104
104
  }
@@ -108,7 +108,7 @@ export class FlowDropApiClient {
108
108
  * List all workflows
109
109
  */
110
110
  async listWorkflows() {
111
- const response = await this.request('/api/flowdrop/workflows');
111
+ const response = await this.request('/workflows');
112
112
  if (!response.success || !response.data) {
113
113
  throw new Error(response.error || 'Failed to list workflows');
114
114
  }
@@ -118,7 +118,7 @@ export class FlowDropApiClient {
118
118
  * Delete a workflow
119
119
  */
120
120
  async deleteWorkflow(workflowId) {
121
- const response = await this.request(`/api/workflows/${encodeURIComponent(workflowId)}`, {
121
+ const response = await this.request(`/workflows/${encodeURIComponent(workflowId)}`, {
122
122
  method: 'DELETE'
123
123
  });
124
124
  if (!response.success) {
@@ -129,7 +129,7 @@ export class FlowDropApiClient {
129
129
  * Execute a workflow
130
130
  */
131
131
  async executeWorkflow(workflowId, inputs) {
132
- const response = await this.request(`/api/workflows/${encodeURIComponent(workflowId)}/execute`, {
132
+ const response = await this.request(`/workflows/${encodeURIComponent(workflowId)}/execute`, {
133
133
  method: 'POST',
134
134
  body: JSON.stringify({ inputs })
135
135
  });
@@ -142,7 +142,7 @@ export class FlowDropApiClient {
142
142
  * Get execution status
143
143
  */
144
144
  async getExecutionStatus(executionId) {
145
- const response = await this.request(`/api/executions/${encodeURIComponent(executionId)}`);
145
+ const response = await this.request(`/executions/${encodeURIComponent(executionId)}`);
146
146
  if (!response.success || !response.data) {
147
147
  throw new Error(response.error || 'Failed to get execution status');
148
148
  }
@@ -152,7 +152,7 @@ export class FlowDropApiClient {
152
152
  * Cancel workflow execution
153
153
  */
154
154
  async cancelExecution(executionId) {
155
- const response = await this.request(`/api/executions/${encodeURIComponent(executionId)}/cancel`, {
155
+ const response = await this.request(`/executions/${encodeURIComponent(executionId)}/cancel`, {
156
156
  method: 'POST'
157
157
  });
158
158
  if (!response.success) {
@@ -163,7 +163,7 @@ export class FlowDropApiClient {
163
163
  * Get execution logs
164
164
  */
165
165
  async getExecutionLogs(executionId) {
166
- const response = await this.request(`/api/executions/${encodeURIComponent(executionId)}/logs`);
166
+ const response = await this.request(`/executions/${encodeURIComponent(executionId)}/logs`);
167
167
  if (!response.success || !response.data) {
168
168
  throw new Error(response.error || 'Failed to get execution logs');
169
169
  }
@@ -173,7 +173,7 @@ export class FlowDropApiClient {
173
173
  * Validate workflow configuration
174
174
  */
175
175
  async validateWorkflow(workflow) {
176
- const response = await this.request('/api/flowdrop/workflows/validate', {
176
+ const response = await this.request('/workflows/validate', {
177
177
  method: 'POST',
178
178
  body: JSON.stringify(workflow)
179
179
  });
@@ -186,7 +186,7 @@ export class FlowDropApiClient {
186
186
  * Export workflow as JSON
187
187
  */
188
188
  async exportWorkflow(workflowId) {
189
- const response = await this.request(`/api/workflows/${encodeURIComponent(workflowId)}/export`);
189
+ const response = await this.request(`/workflows/${encodeURIComponent(workflowId)}/export`);
190
190
  if (!response.success || !response.data) {
191
191
  throw new Error(response.error || 'Failed to export workflow');
192
192
  }
@@ -196,7 +196,7 @@ export class FlowDropApiClient {
196
196
  * Import workflow from JSON
197
197
  */
198
198
  async importWorkflow(workflowJson) {
199
- const response = await this.request('/api/flowdrop/workflows/import', {
199
+ const response = await this.request('/workflows/import', {
200
200
  method: 'POST',
201
201
  body: JSON.stringify({ workflow: workflowJson })
202
202
  });
@@ -209,7 +209,7 @@ export class FlowDropApiClient {
209
209
  * Fetch port configuration
210
210
  */
211
211
  async getPortConfig() {
212
- const response = await this.request('/api/flowdrop/port-config');
212
+ const response = await this.request('/port-config');
213
213
  if (!response.success || !response.data) {
214
214
  throw new Error(response.error || 'Failed to fetch port configuration');
215
215
  }
@@ -219,7 +219,7 @@ export class FlowDropApiClient {
219
219
  * Fetch pipeline data including job information and status
220
220
  */
221
221
  async getPipelineData(pipelineId) {
222
- const response = await this.request(`/api/flowdrop/pipeline/${encodeURIComponent(pipelineId)}`);
222
+ const response = await this.request(`/pipeline/${encodeURIComponent(pipelineId)}`);
223
223
  return response;
224
224
  }
225
225
  }
@@ -164,18 +164,19 @@
164
164
  */
165
165
  async function testApiConnection(): Promise<void> {
166
166
  try {
167
- const testUrl = '/api/flowdrop/nodes';
167
+ const baseUrl = endpointConfig?.baseUrl || apiBaseUrl || "/api/flowdrop";
168
+ const testUrl = `${baseUrl}/nodes`;
168
169
 
169
170
  const response = await fetch(testUrl);
170
171
  const data = await response.json();
171
172
 
172
173
  if (response.ok && data.success) {
173
- apiToasts.success('API connection test', 'Connection successful');
174
+ apiToasts.success("API connection test", "Connection successful");
174
175
  } else {
175
- apiToasts.error('API connection test', 'Connection failed');
176
+ apiToasts.error("API connection test", "Connection failed");
176
177
  }
177
178
  } catch (err) {
178
- apiToasts.error('API connection test', err instanceof Error ? err.message : 'Unknown error');
179
+ apiToasts.error("API connection test", err instanceof Error ? err.message : "Unknown error");
179
180
  }
180
181
  }
181
182
 
@@ -30,7 +30,7 @@
30
30
  let { pipelineId, workflow, apiClient, baseUrl, onActionsReady }: Props = $props();
31
31
 
32
32
  // Initialize API client if not provided
33
- const client = apiClient || new FlowDropApiClient(baseUrl || window.location.origin);
33
+ const client = apiClient || new FlowDropApiClient(baseUrl || "/api/flowdrop");
34
34
 
35
35
  // Pipeline status and job data
36
36
  let pipelineStatus = $state<string>('unknown');
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@d34dman/flowdrop",
3
3
  "license": "MIT",
4
4
  "private": false,
5
- "version": "0.0.6",
5
+ "version": "0.0.7",
6
6
  "scripts": {
7
7
  "dev": "vite dev",
8
8
  "build": "vite build && npm run prepack",
@@ -83,6 +83,10 @@
83
83
  "@sveltejs/kit": "^2.0.0",
84
84
  "svelte": "^5.0.0"
85
85
  },
86
+ "repository": {
87
+ "type": "git",
88
+ "url": "git+https://github.com/d34dman/flowdrop.git"
89
+ },
86
90
  "devDependencies": {
87
91
  "@chromatic-com/storybook": "^4.0.1",
88
92
  "@eslint/compat": "^1.2.5",