changed tb imports

This commit is contained in:
dswbx
2025-04-10 10:40:12 +02:00
parent ad7926db4c
commit 3859b9ba00
60 changed files with 233 additions and 188 deletions
+3 -1
View File
@@ -1,5 +1,7 @@
import { Const, type Static, StringRecord, Type, transformObject } from "core/utils";
import { Const, type Static, StringRecord, transformObject } from "core/utils";
import { TaskMap, TriggerMap } from "flows";
import * as tbbox from "@sinclair/typebox";
const { Type } = tbbox;
export const TASKS = {
...TaskMap,
+2 -1
View File
@@ -1,7 +1,8 @@
import type { EventManager } from "core/events";
import { Type } from "core/utils";
import type { Flow } from "../Flow";
import { Trigger } from "./Trigger";
import * as tbbox from "@sinclair/typebox";
const { Type } = tbbox;
export class EventTrigger extends Trigger<typeof EventTrigger.schema> {
override type = "event";
+3 -1
View File
@@ -1,7 +1,9 @@
import { StringEnum, Type } from "core/utils";
import { StringEnum } from "core/utils";
import type { Context, Hono } from "hono";
import type { Flow } from "../Flow";
import { Trigger } from "./Trigger";
import * as tbbox from "@sinclair/typebox";
const { Type } = tbbox;
const httpMethods = ["GET", "POST", "PUT", "PATCH", "DELETE"] as const;
+3 -1
View File
@@ -1,6 +1,8 @@
import { type Static, StringEnum, Type, parse } from "core/utils";
import { type Static, StringEnum, parse } from "core/utils";
import type { Execution } from "../Execution";
import type { Flow } from "../Flow";
import * as tbbox from "@sinclair/typebox";
const { Type } = tbbox;
export class Trigger<Schema extends typeof Trigger.schema = typeof Trigger.schema> {
// @todo: remove this
+4 -3
View File
@@ -1,8 +1,9 @@
import type { StaticDecode, TSchema } from "@sinclair/typebox";
import type { NodeProps } from "@xyflow/react";
import { BkndError, SimpleRenderer } from "core";
import { type Static, type TObject, Type, Value, parse, ucFirst } from "core/utils";
import type { ExecutionEvent, InputsMap } from "../flows/Execution";
import { type Static, type TObject, Value, parse, ucFirst } from "core/utils";
import type { InputsMap } from "../flows/Execution";
import * as tbbox from "@sinclair/typebox";
const { Type } = tbbox;
//type InstanceOf<T> = T extends new (...args: any) => infer R ? R : never;
export type TaskResult<Output = any> = {
+3 -2
View File
@@ -1,6 +1,7 @@
import { StringEnum, Type } from "core/utils";
import type { InputsMap } from "../../flows/Execution";
import { StringEnum } from "core/utils";
import { Task, dynamic } from "../Task";
import * as tbbox from "@sinclair/typebox";
const { Type } = tbbox;
const FetchMethods = ["GET", "POST", "PUT", "PATCH", "DELETE"];
+2 -1
View File
@@ -1,5 +1,6 @@
import { Type } from "core/utils";
import { Task } from "../Task";
import * as tbbox from "@sinclair/typebox";
const { Type } = tbbox;
export class LogTask extends Task<typeof LogTask.schema> {
type = "log";
+2 -1
View File
@@ -1,5 +1,6 @@
import { Type } from "core/utils";
import { Task } from "../Task";
import * as tbbox from "@sinclair/typebox";
const { Type } = tbbox;
export class RenderTask<Output extends Record<string, any>> extends Task<
typeof RenderTask.schema,
+2 -1
View File
@@ -1,6 +1,7 @@
import { Type } from "core/utils";
import { Flow } from "../../flows/Flow";
import { Task, dynamic } from "../Task";
import * as tbbox from "@sinclair/typebox";
const { Type } = tbbox;
export class SubFlowTask<Output extends Record<string, any>> extends Task<
typeof SubFlowTask.schema,