Add initial project structure with database setup, logging, and workflow management

This commit is contained in:
2026-08-14 11:36:54 +07:00
commit 5dc992a517
21 changed files with 2080 additions and 0 deletions
+4
View File
@@ -0,0 +1,4 @@
export default function main(context) {
log.info({ data: context.data }, "add-one");
return { data: (context.data || 0) + 1 };
}
+4
View File
@@ -0,0 +1,4 @@
export default function main(context) {
log.info({ input: context.input }, "add-ten");
return context.input + 10;
}
+10
View File
@@ -0,0 +1,10 @@
// this script will get current time
export default function getCurrentTime() {
return {
data: {
datetime: new Date().toISOString(),
processId: "1234"
}
}
}
+6
View File
@@ -0,0 +1,6 @@
import jsonata from "jsonata";
export default function jsonataFn(context) {
const expression = jsonata(context.config.expression);
return expression.evaluate(context.data)
}
+14
View File
@@ -0,0 +1,14 @@
import axios from "axios";
export default function ntfy(ctx) {
log.info({ ctx }, "ntfy");
const headers = {}
if(ctx.data?.title) {
headers.Title = ctx.data.title
}
axios.post(ctx.config?.url || "https://ntfy.sh/scrunner", ctx.data?.message || "Hello from scrunner", {
headers: headers
})
return {sent: "true"}
}