@skychameleon/workflow 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skychameleon/workflow",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Everything about workflow",
5
5
  "license": "ISC",
6
6
  "type": "module",
@@ -20,11 +20,13 @@
20
20
  "zod": "^4.3.6"
21
21
  },
22
22
  "exports": {
23
- "./workflow.schema": "./workflow/workflow.schema.ts",
24
- "./edges": "./workflow/query-rule.schema.ts",
25
- "./blocks": "./workflow/registry.ts"
23
+ "./workflow": "./workflow/workflow.schema.ts",
24
+ "./edges": "./workflow/edges/index.ts",
25
+ "./blocks": "./workflow/blocks/index.ts",
26
+ "./shared": "./workflow/shared/index.ts",
27
+ "./validation": "./workflow/validation/index.ts"
26
28
  },
27
29
  "peerDependencies": {
28
30
  "zod": "^3.22.0"
29
31
  }
30
- }
32
+ }
@@ -3,9 +3,9 @@ import createBaseBlockSchema from "../base.schema";
3
3
  import { VarSetBlockSchemaZod } from "../general/var-set.schema";
4
4
  import {
5
5
  AdditionalOptionsZod,
6
- InputVarChatBotTypeZod,
7
6
  SendTextZod,
8
7
  } from "../shared/general.types";
8
+ import { InputVarChatBotTypeZod } from "../../shared/shared.schema";
9
9
 
10
10
  /**
11
11
  * Блок отвечающий за получения файла
@@ -2,11 +2,11 @@ import z from "zod";
2
2
  import {
3
3
  AdditionalOptionsZod,
4
4
  CodeExpressionZod,
5
- InputVarChatBotTypeZod,
6
5
  SendTextZod,
7
6
  } from "../shared/general.types";
8
7
  import createBaseBlockSchema from "../base.schema";
9
8
  import { VarSetBlockSchemaZod } from "../general/var-set.schema";
9
+ import { InputVarChatBotTypeZod } from "../../shared/shared.schema";
10
10
 
11
11
  /**
12
12
  * Типы для составления клавиатуры
@@ -1,11 +1,11 @@
1
1
  import z from "zod";
2
2
  import createBaseBlockSchema from "../base.schema";
3
3
  import {
4
- VarType,
5
4
  SendTextZod,
6
5
  AdditionalOptionsZod,
7
6
  } from "../shared/general.types";
8
7
  import { VarSetBlockSchemaZod } from "../general/var-set.schema";
8
+ import { VarType } from "../../shared/shared.schema";
9
9
 
10
10
  /**
11
11
  * Блок отвечающий за отправление файлов
@@ -2,11 +2,9 @@ import z from "zod";
2
2
  import createBaseBlockSchema from "../base.schema";
3
3
  import {
4
4
  CodeExpressionZod,
5
- VarTypeZod,
6
- InputVarChatBotTypeZod,
7
- type VarType,
8
5
  } from "../shared/general.types";
9
6
  import { regexVarName } from "../validation/regex";
7
+ import { InputVarChatBotTypeZod, VarTypeZod } from "../../shared/shared.schema";
10
8
 
11
9
  export const CompletionTypesZod = z.enum(["function", "variable"]);
12
10
  export type CompletionTypes = z.infer<typeof CompletionTypesZod>;
@@ -0,0 +1,15 @@
1
+ export * from "./base.schema"
2
+ export * from "./registry"
3
+
4
+ export * from "./chat_bot/input-file.schema"
5
+ export * from "./chat_bot/input-text.schema"
6
+ export * from "./chat_bot/send-file.schema"
7
+ export * from "./chat_bot/send-msg.schema"
8
+
9
+ export * from "./general/run-code.schema"
10
+ export * from "./general/start.schema"
11
+ export * from "./general/var-set.schema"
12
+
13
+ export * from "./shared/general.types"
14
+ export * from "./validation/duplicate-vars.start"
15
+ export * from "./validation/regex"
@@ -23,13 +23,3 @@ export const ChatBotBlocksSchemaZods = z.union([
23
23
  ]);
24
24
 
25
25
  export type ChatBotBlocksSchema = z.infer<typeof ChatBotBlocksSchemaZods>;
26
-
27
- export default {
28
- StartBlockSchemaZod,
29
- VarSetBlockSchemaZod,
30
- RunCodeBlockSchemaZod,
31
- SendMsgChatBotBlockSchemaZod,
32
- SendFileChatBotBlockSchemaZod,
33
- InputTextChatBotBlockSchemaZod,
34
- InputFileChatBotBlockSchemaZod
35
- }
@@ -53,25 +53,3 @@ export const AdditionalOptionsZod = z.object({
53
53
  send_other_chat: z.union([z.literal(false), ChatIDZod]),
54
54
  });
55
55
  export type AdditionalOptions = z.infer<typeof AdditionalOptionsZod>;
56
-
57
- /**
58
- * Типы переменных
59
- *
60
- * Типы для полученных сообщений из чат-ботов
61
- * Общие типы
62
- */
63
- export enum InputVarChatBotType {
64
- FILE = "file",
65
- }
66
- export const InputVarChatBotTypeZod = z.enum(InputVarChatBotType);
67
-
68
- export enum VarType {
69
- STRING = "string",
70
- NUMBER = "number",
71
- BOOLEAN = "boolean",
72
- OBJECT = "object",
73
- ARRAY = "array",
74
- FUNCTION = "function",
75
- ANY = "any",
76
- }
77
- export const VarTypeZod = z.enum(VarType);
@@ -16,4 +16,5 @@ const createBaseEdgeSchemaZod = <Type extends EdgeTypes, Guard>(
16
16
  target: z.string(),
17
17
  guards: guard,
18
18
  });
19
+
19
20
  export default createBaseEdgeSchemaZod;
@@ -0,0 +1,2 @@
1
+ export * from "./base.schema"
2
+ export * from "./query-rule.schema"
@@ -1,5 +1,4 @@
1
1
  import { z } from "zod";
2
- import { VarTypeZod } from "../blocks/shared/general.types";
3
2
  import createBaseEdgeSchemaZod from "./base.schema";
4
3
  import { VarSetBlockSchemaZod } from "../blocks/general/var-set.schema";
5
4
 
@@ -0,0 +1 @@
1
+ export * from "./shared.schema"
@@ -0,0 +1,24 @@
1
+ import z from "zod";
2
+
3
+ /**
4
+ * Типы переменных
5
+ *
6
+ * Типы для полученных сообщений из чат-ботов
7
+ * Общие типы
8
+ */
9
+
10
+ export enum InputVarChatBotType {
11
+ FILE = "file",
12
+ }
13
+ export const InputVarChatBotTypeZod = z.enum(InputVarChatBotType);
14
+
15
+ export enum VarType {
16
+ STRING = "string",
17
+ NUMBER = "number",
18
+ BOOLEAN = "boolean",
19
+ OBJECT = "object",
20
+ ARRAY = "array",
21
+ FUNCTION = "function",
22
+ ANY = "any",
23
+ }
24
+ export const VarTypeZod = z.enum(VarType);
@@ -0,0 +1,4 @@
1
+ export * from "./check-edge-to-blocks"
2
+ export * from "./check-rule-var"
3
+ export * from "./duplicate-id-blocks"
4
+ export * from "./duplicate-id-edges"
@@ -5,12 +5,10 @@ import {
5
5
  } from "./blocks/registry";
6
6
  import {
7
7
  QueryRuleEdgeSchemaZod,
8
- type QueryRuleEdgeSchema,
9
8
  } from "./edges/query-rule.schema";
10
9
  import { checkEdgeToBlocks } from "./validation/check-edge-to-blocks";
11
10
  import { duplicateIdBlocks } from "./validation/duplicate-id-blocks";
12
11
  import { duplicateIdEdges } from "./validation/duplicate-id-edges";
13
- import { checkRuleVar } from "./validation/check-rule-var";
14
12
 
15
13
  export const MetadataSchemaZod = z.object({
16
14
  name: z.string(),