mirror of
https://github.com/bknd-io/bknd/
synced 2026-08-03 08:36:01 +00:00
initial refactor
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user