Skip to content

Commit a151684

Browse files
committed
refactor: remove example HTTP functions, add inline/http badges in palette
- Remove http-request, json-transform, text-template (no running services) - Seed SQL now has 4 HTTP + 13 inline = 17 functions - Palette shows 'inline' (amber) and 'http' (cyan) badges per node - Clear visual demarcation between in-process and HTTP-dispatched functions
1 parent 62c8e96 commit a151684

10 files changed

Lines changed: 6 additions & 296 deletions

File tree

functions/http-request/handler.json

Lines changed: 0 additions & 32 deletions
This file was deleted.

functions/http-request/handler.ts

Lines changed: 0 additions & 32 deletions
This file was deleted.

functions/json-transform/handler.json

Lines changed: 0 additions & 27 deletions
This file was deleted.

functions/json-transform/handler.ts

Lines changed: 0 additions & 32 deletions
This file was deleted.

functions/text-template/handler.json

Lines changed: 0 additions & 26 deletions
This file was deleted.

functions/text-template/handler.ts

Lines changed: 0 additions & 25 deletions
This file was deleted.

pgpm/constructive-infra-seed/deploy/schemas/constructive_compute_public/tables/platform_function_definitions/fixtures/seed_built_in_functions.sql

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -31,42 +31,6 @@ VALUES
3131
'custom',
3232
'http'
3333
),
34-
(
35-
'http-request',
36-
'http-request',
37-
'http://localhost:8086',
38-
true, true, 'platform',
39-
'Makes an HTTP request to an external URL and returns the response',
40-
(SELECT id FROM constructive_infra_public.platform_namespaces WHERE name = 'default' AND database_id = '00000000-0000-0000-0000-000000000000'),
41-
ARRAY[
42-
ROW('AUTH_TOKEN', false)
43-
]::constructive_compute_public.function_requirement[],
44-
ARRAY[]::constructive_compute_public.function_requirement[],
45-
'[{"name":"url","type":"string","description":"Request URL"},{"name":"body","type":"json","description":"Request body (for POST/PUT/PATCH)","optional":true},{"name":"headers","type":"json","description":"Additional request headers","optional":true}]'::jsonb,
46-
'[{"name":"data","type":"json","description":"Response body parsed as JSON"},{"name":"status","type":"number","description":"HTTP status code"},{"name":"headers","type":"json","description":"Response headers"}]'::jsonb,
47-
'[{"name":"method","type":"string","default":"GET","description":"HTTP method (GET, POST, PUT, PATCH, DELETE)","required":false},{"name":"timeout","type":"number","default":30000,"description":"Request timeout in milliseconds","required":false},{"name":"retries","type":"number","default":0,"description":"Number of retry attempts on failure","required":false}]'::jsonb,
48-
true,
49-
'globe',
50-
'network',
51-
'http'
52-
),
53-
(
54-
'json-transform',
55-
'json-transform',
56-
'http://localhost:8085',
57-
true, true, 'platform',
58-
'Transforms JSON data using a JSONPath expression and optional mapping',
59-
(SELECT id FROM constructive_infra_public.platform_namespaces WHERE name = 'default' AND database_id = '00000000-0000-0000-0000-000000000000'),
60-
ARRAY[]::constructive_compute_public.function_requirement[],
61-
ARRAY[]::constructive_compute_public.function_requirement[],
62-
'[{"name":"data","type":"json","description":"Input JSON data to transform"},{"name":"mapping","type":"json","description":"Key mapping object (old_key → new_key)","optional":true}]'::jsonb,
63-
'[{"name":"result","type":"json","description":"Transformed JSON output"},{"name":"count","type":"number","description":"Number of keys processed"}]'::jsonb,
64-
'[{"name":"path","type":"string","default":"$","description":"JSONPath expression to select data","required":false},{"name":"flatten","type":"boolean","default":false,"description":"Whether to flatten nested objects","required":false},{"name":"removeNulls","type":"boolean","default":true,"description":"Strip null values from output","required":false}]'::jsonb,
65-
false,
66-
'braces',
67-
'data',
68-
'http'
69-
),
7034
(
7135
'python-example',
7236
'python-example',
@@ -140,23 +104,6 @@ VALUES
140104
'email',
141105
'http'
142106
),
143-
(
144-
'text-template',
145-
'text-template',
146-
'http://localhost:8087',
147-
true, true, 'platform',
148-
'Renders a text template with variable substitution using {{variable}} syntax',
149-
(SELECT id FROM constructive_infra_public.platform_namespaces WHERE name = 'default' AND database_id = '00000000-0000-0000-0000-000000000000'),
150-
ARRAY[]::constructive_compute_public.function_requirement[],
151-
ARRAY[]::constructive_compute_public.function_requirement[],
152-
'[{"name":"variables","type":"json","description":"Key-value pairs for template substitution"}]'::jsonb,
153-
'[{"name":"text","type":"string","description":"Rendered template output"},{"name":"missingVars","type":"json","description":"Array of template variables that had no value"}]'::jsonb,
154-
'[{"name":"template","type":"string","default":"","description":"Template string with {{variable}} placeholders","required":true},{"name":"strict","type":"boolean","default":false,"description":"Fail if any template variable is missing","required":false},{"name":"fallback","type":"string","default":"","description":"Default value for missing variables (when not strict)","required":false}]'::jsonb,
155-
false,
156-
'file-text',
157-
'string',
158-
'http'
159-
),
160107
(
161108
'math/add',
162109
'math/add',

pgpm/constructive-infra-seed/revert/schemas/constructive_compute_public/tables/platform_function_definitions/fixtures/seed_built_in_functions.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ BEGIN;
77
DELETE FROM constructive_compute_public.platform_function_definitions
88
WHERE is_built_in = true
99
AND scope = 'platform'
10-
AND name IN ('node-example', 'http-request', 'json-transform', 'python-example', 'send-email', 'send-verification-link', 'text-template', 'math/add', 'math/multiply', 'math/subtract', 'const/number', 'const/string', 'const/boolean', 'json/select', 'json/object', 'json/merge', 'json/split', 'string/template', 'flow/guard', 'coerce');
10+
AND name IN ('node-example', 'python-example', 'send-email', 'send-verification-link', 'math/add', 'math/multiply', 'math/subtract', 'const/number', 'const/string', 'const/boolean', 'json/select', 'json/object', 'json/merge', 'json/split', 'string/template', 'flow/guard', 'coerce');
1111

1212
COMMIT;

pgpm/constructive-infra-seed/verify/schemas/constructive_compute_public/tables/platform_function_definitions/fixtures/seed_built_in_functions.sql

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@ BEGIN;
77
SELECT 1 FROM constructive_compute_public.platform_function_definitions
88
WHERE name = 'node-example' AND is_built_in = true;
99

10-
SELECT 1 FROM constructive_compute_public.platform_function_definitions
11-
WHERE name = 'http-request' AND is_built_in = true;
12-
13-
SELECT 1 FROM constructive_compute_public.platform_function_definitions
14-
WHERE name = 'json-transform' AND is_built_in = true;
15-
1610
SELECT 1 FROM constructive_compute_public.platform_function_definitions
1711
WHERE name = 'python-example' AND is_built_in = true;
1812

@@ -22,9 +16,6 @@ WHERE name = 'send-email' AND is_built_in = true;
2216
SELECT 1 FROM constructive_compute_public.platform_function_definitions
2317
WHERE name = 'send-verification-link' AND is_built_in = true;
2418

25-
SELECT 1 FROM constructive_compute_public.platform_function_definitions
26-
WHERE name = 'text-template' AND is_built_in = true;
27-
2819
SELECT 1 FROM constructive_compute_public.platform_function_definitions
2920
WHERE name = 'math/add' AND is_built_in = true;
3021

www/src/components/FlowsPanel.tsx

Lines changed: 5 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -134,62 +134,6 @@ const MOCK_FUNCTIONS: FunctionNode[] = [
134134
outputs: [{ name: 'result', type: 'json', description: 'Send result with status and message ID' }],
135135
volatile: true, icon: 'mail', category: 'email',
136136
},
137-
{
138-
name: 'json-transform', taskIdentifier: 'json-transform', serviceUrl: '', isInvocable: true, isBuiltIn: true,
139-
scope: 'platform', description: 'Transforms JSON data using a JSONPath expression and optional mapping',
140-
inputs: [
141-
{ name: 'data', type: 'json', description: 'Input JSON data to transform' },
142-
{ name: 'mapping', type: 'json', description: 'Key mapping object (old_key → new_key)', optional: true },
143-
],
144-
outputs: [
145-
{ name: 'result', type: 'json', description: 'Transformed JSON output' },
146-
{ name: 'count', type: 'number', description: 'Number of keys processed' },
147-
],
148-
props: [
149-
{ name: 'path', type: 'string', default: '$', description: 'JSONPath expression to select data' },
150-
{ name: 'flatten', type: 'boolean', default: false, description: 'Whether to flatten nested objects' },
151-
{ name: 'removeNulls', type: 'boolean', default: true, description: 'Strip null values from output' },
152-
],
153-
icon: 'braces', category: 'data',
154-
},
155-
{
156-
name: 'http-request', taskIdentifier: 'http-request', serviceUrl: '', isInvocable: true, isBuiltIn: true,
157-
scope: 'platform', description: 'Makes an HTTP request to an external URL',
158-
requiredSecrets: [{ name: 'AUTH_TOKEN', required: false }],
159-
inputs: [
160-
{ name: 'url', type: 'string', description: 'Request URL' },
161-
{ name: 'body', type: 'json', description: 'Request body (for POST/PUT/PATCH)', optional: true },
162-
{ name: 'headers', type: 'json', description: 'Additional request headers', optional: true },
163-
],
164-
outputs: [
165-
{ name: 'data', type: 'json', description: 'Response body parsed as JSON' },
166-
{ name: 'status', type: 'number', description: 'HTTP status code' },
167-
{ name: 'headers', type: 'json', description: 'Response headers' },
168-
],
169-
props: [
170-
{ name: 'method', type: 'string', default: 'GET', description: 'HTTP method (GET, POST, PUT, PATCH, DELETE)' },
171-
{ name: 'timeout', type: 'number', default: 30000, description: 'Request timeout in milliseconds' },
172-
{ name: 'retries', type: 'number', default: 0, description: 'Number of retry attempts on failure' },
173-
],
174-
volatile: true, icon: 'globe', category: 'network',
175-
},
176-
{
177-
name: 'text-template', taskIdentifier: 'text-template', serviceUrl: '', isInvocable: true, isBuiltIn: true,
178-
scope: 'platform', description: 'Renders a text template with {{variable}} substitution',
179-
inputs: [
180-
{ name: 'variables', type: 'json', description: 'Key-value pairs for template substitution' },
181-
],
182-
outputs: [
183-
{ name: 'text', type: 'string', description: 'Rendered template output' },
184-
{ name: 'missingVars', type: 'json', description: 'Array of template variables with no value' },
185-
],
186-
props: [
187-
{ name: 'template', type: 'string', default: '', description: 'Template string with {{variable}} placeholders', required: true },
188-
{ name: 'strict', type: 'boolean', default: false, description: 'Fail if any template variable is missing' },
189-
{ name: 'fallback', type: 'string', default: '', description: 'Default value for missing variables' },
190-
],
191-
icon: 'file-text', category: 'string',
192-
},
193137
// ─── Inline nodes (run in-process, no HTTP) ────────────────────────
194138
{
195139
name: 'math/add', taskIdentifier: 'math/add', isInvocable: true, isBuiltIn: true,
@@ -1087,9 +1031,11 @@ export function FlowsPanel() {
10871031
<span className="text-sm text-zinc-300 truncate">
10881032
{def.name.split('/').pop()}
10891033
</span>
1090-
{fn?.runtime === 'inline' && (
1091-
<Zap size={10} className="text-amber-500 flex-shrink-0 ml-auto" title="Inline (in-process)" />
1092-
)}
1034+
{fn?.runtime === 'inline' ? (
1035+
<span className="ml-auto px-1.5 py-0.5 text-[9px] font-medium rounded bg-amber-900/40 text-amber-400 flex-shrink-0" title="Runs in-process on the compute worker">inline</span>
1036+
) : isFunction ? (
1037+
<span className="ml-auto px-1.5 py-0.5 text-[9px] font-medium rounded bg-cyan-900/40 text-cyan-400 flex-shrink-0" title="Dispatched via HTTP to a function service">http</span>
1038+
) : null}
10931039
</div>
10941040
</button>
10951041
))}

0 commit comments

Comments
 (0)