mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-28 00:02:42 +00:00
feat: SQS triggers (#5182)
* feat: first commit * fix: npm check * fix: openapi file * feat: update openapi and migration * feat: basic implementation done * fix: fix: no used function when no feature * feat: capture done * Update capture.rs * nits: change sqs trigger * fix: make migration great again * feat: add message attributes * feat: nits: fix error messages, remove console.log and add try catch * update sqs icon and ee feature for sqs_trigger * update: change sqs name casing and added test connection button * nits: update Icon and add create from template button * fix: ci build and error compilation * update migration type sqs * update link on create from template button for sqs, add archive in workspace export and update sqlx * fix: ci * Update SqsTriggerEditorInner.svelte * add link to docs, use generic function for resource and fix import error * chore: update .github ci * nits: remove empty * update to match ee repo changement * Update backend/windmill-api/src/resources.rs Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> * add sqs handling for the cli and refacoring sqsEditorInner * Update cli/sync.ts Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> * fix: add break to switch statement for sqs case * fix: display aws_resource_path when retrieve or create a new trigger * rework sqs ui, fix postgres optional port * fix: ci * update ui for trigger * update repo ref and specific * feat: add ready endpoints for workers to enterprise * update ref * Update frontend/src/lib/script_helpers.ts Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> --------- Co-authored-by: HugoCasa <hugo@casademont.ch> Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> Co-authored-by: Ruben Fiszel <ruben@windmill.dev>
This commit is contained in:
committed by
GitHub
co-authored by
ellipsis-dev[bot]
HugoCasa
Ruben Fiszel
parent
867ce4c842
commit
c1351f8155
+10
-1
@@ -4,6 +4,7 @@ import {
|
||||
KafkaTrigger,
|
||||
NatsTrigger,
|
||||
PostgresTrigger,
|
||||
SqsTrigger,
|
||||
WebsocketTrigger,
|
||||
} from "./gen/types.gen.ts";
|
||||
import { colors, Command, log, SEP, Table } from "./deps.ts";
|
||||
@@ -23,6 +24,7 @@ type Trigger = {
|
||||
kafka: KafkaTrigger;
|
||||
nats: NatsTrigger;
|
||||
postgres: PostgresTrigger;
|
||||
sqs: SqsTrigger;
|
||||
};
|
||||
|
||||
type TriggerFile<K extends TriggerType> = Omit<
|
||||
@@ -54,6 +56,7 @@ async function getTrigger<K extends TriggerType>(
|
||||
kafka: wmill.getKafkaTrigger,
|
||||
nats: wmill.getNatsTrigger,
|
||||
postgres: wmill.getPostgresTrigger,
|
||||
sqs: wmill.getSqsTrigger,
|
||||
};
|
||||
const triggerFunction = triggerFunctions[triggerType];
|
||||
|
||||
@@ -79,6 +82,7 @@ async function updateTrigger<K extends TriggerType>(
|
||||
kafka: wmill.updateKafkaTrigger,
|
||||
nats: wmill.updateNatsTrigger,
|
||||
postgres: wmill.updatePostgresTrigger,
|
||||
sqs: wmill.updateSqsTrigger,
|
||||
};
|
||||
const triggerFunction = triggerFunctions[triggerType];
|
||||
await triggerFunction({ workspace, path, requestBody: trigger });
|
||||
@@ -102,6 +106,7 @@ async function createTrigger<K extends TriggerType>(
|
||||
kafka: wmill.createKafkaTrigger,
|
||||
nats: wmill.createNatsTrigger,
|
||||
postgres: wmill.createPostgresTrigger,
|
||||
sqs: wmill.createSqsTrigger,
|
||||
};
|
||||
const triggerFunction = triggerFunctions[triggerType];
|
||||
await triggerFunction({ workspace, path, requestBody: trigger });
|
||||
@@ -175,6 +180,9 @@ async function list(opts: GlobalOptions) {
|
||||
const postgresTriggers = await wmill.listPostgresTriggers({
|
||||
workspace: workspace.workspaceId,
|
||||
});
|
||||
const sqsTriggers = await wmill.listSqsTriggers({
|
||||
workspace: workspace.workspaceId,
|
||||
});
|
||||
|
||||
const triggers = [
|
||||
...httpTriggers.map((x) => ({ path: x.path, kind: "http" })),
|
||||
@@ -182,6 +190,7 @@ async function list(opts: GlobalOptions) {
|
||||
...kafkaTriggers.map((x) => ({ path: x.path, kind: "kafka" })),
|
||||
...natsTriggers.map((x) => ({ path: x.path, kind: "nats" })),
|
||||
...postgresTriggers.map((x) => ({ path: x.path, kind: "postgres" })),
|
||||
...sqsTriggers.map((x) => ({ path: x.path, kind: "sqs" })),
|
||||
];
|
||||
|
||||
new Table()
|
||||
@@ -195,7 +204,7 @@ async function list(opts: GlobalOptions) {
|
||||
function checkIfValidTrigger(kind: string | undefined): kind is TriggerType {
|
||||
if (
|
||||
kind &&
|
||||
["http", "websocket", "kafka", "nats", "postgres"].includes(kind)
|
||||
["http", "websocket", "kafka", "nats", "postgres", "sqs"].includes(kind)
|
||||
) {
|
||||
return true;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user