initial refactor

This commit is contained in:
dswbx
2025-06-21 13:35:58 +02:00
parent b2086c4da7
commit 42edce904f
93 changed files with 1021 additions and 1216 deletions
+6 -3
View File
@@ -1,15 +1,16 @@
import { type Static, transformObject } from "core/utils";
import { transformObject } from "core/utils";
import { Flow, HttpTrigger } from "flows";
import { Hono } from "hono";
import { Module } from "modules/Module";
import { TASKS, flowsConfigSchema } from "./flows-schema";
import type { s } from "core/object/schema";
export type AppFlowsSchema = Static<typeof flowsConfigSchema>;
export type AppFlowsSchema = s.Static<typeof flowsConfigSchema>;
export type TAppFlowSchema = AppFlowsSchema["flows"][number];
export type TAppFlowTriggerSchema = TAppFlowSchema["trigger"];
export type { TAppFlowTaskSchema } from "./flows-schema";
export class AppFlows extends Module<typeof flowsConfigSchema> {
export class AppFlows extends Module<AppFlowsSchema> {
private flows: Record<string, Flow> = {};
getSchema() {
@@ -80,6 +81,8 @@ export class AppFlows extends Module<typeof flowsConfigSchema> {
this.setBuilt();
}
// @todo: fix this
// @ts-expect-error
override toJSON() {
return {
...this.config,