blockmine 1.25.0 → 1.27.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/CHANGELOG.md +46 -3
- package/backend/cli.js +1 -1
- package/backend/package.json +2 -2
- package/backend/prisma/migrations/20260328173000_add_plugin_source_ref/migration.sql +2 -0
- package/backend/prisma/migrations/migration_lock.toml +2 -2
- package/backend/prisma/schema.prisma +2 -0
- package/backend/src/api/routes/apiKeys.js +8 -0
- package/backend/src/api/routes/bots.js +258 -9
- package/backend/src/api/routes/eventGraphs.js +151 -1
- package/backend/src/api/routes/health.js +38 -0
- package/backend/src/api/routes/nodeRegistry.js +63 -0
- package/backend/src/api/routes/plugins.js +254 -29
- package/backend/src/container.js +11 -8
- package/backend/src/core/BotCommandLoader.js +161 -0
- package/backend/src/core/BotConnection.js +125 -0
- package/backend/src/core/BotEventHandlers.js +234 -0
- package/backend/src/core/BotIPCHandler.js +445 -0
- package/backend/src/core/BotManager.js +15 -7
- package/backend/src/core/BotProcess.js +75 -142
- package/backend/src/core/EventGraphManager.js +7 -3
- package/backend/src/core/GraphDebugHandler.js +229 -0
- package/backend/src/core/GraphDebugIPC.js +117 -0
- package/backend/src/core/GraphExecutionEngine.js +545 -978
- package/backend/src/core/GraphTraversal.js +80 -0
- package/backend/src/core/GraphValidation.js +73 -0
- package/backend/src/core/NodeDefinition.js +138 -0
- package/backend/src/core/NodeRegistry.js +153 -141
- package/backend/src/core/PluginManager.js +272 -31
- package/backend/src/core/RewindSignal.js +9 -0
- package/backend/src/core/config/ConfigValidator.js +72 -0
- package/backend/src/core/config/FeatureFlags.js +52 -0
- package/backend/src/core/config/__tests__/ConfigValidator.test.js +232 -0
- package/backend/src/core/domain/entities/Bot.js +39 -0
- package/backend/src/core/domain/entities/Command.js +41 -0
- package/backend/src/core/domain/entities/EventGraph.js +39 -0
- package/backend/src/core/domain/entities/Plugin.js +45 -0
- package/backend/src/core/domain/entities/User.js +40 -0
- package/backend/src/core/domain/services/DependencyResolver.js +168 -0
- package/backend/src/core/domain/services/GraphValidator.js +117 -0
- package/backend/src/core/domain/services/PermissionChecker.js +34 -0
- package/backend/src/core/domain/services/__tests__/DependencyResolver.test.js +126 -0
- package/backend/src/core/domain/valueObjects/BotConfig.js +27 -0
- package/backend/src/core/domain/valueObjects/DependencyGraph.js +86 -0
- package/backend/src/core/domain/valueObjects/PluginManifest.js +36 -0
- package/backend/src/core/errors/BaseError.js +29 -0
- package/backend/src/core/errors/ErrorHandler.js +81 -0
- package/backend/src/core/errors/__tests__/ErrorHandler.test.js +188 -0
- package/backend/src/core/errors/index.js +68 -0
- package/backend/src/core/infrastructure/BatchingUtility.js +66 -0
- package/backend/src/core/infrastructure/CircuitBreaker.js +103 -0
- package/backend/src/core/infrastructure/ConnectionPool.js +81 -0
- package/backend/src/core/infrastructure/RateLimiter.js +64 -0
- package/backend/src/core/infrastructure/__tests__/BatchingUtility.test.js +86 -0
- package/backend/src/core/infrastructure/__tests__/CircuitBreaker.test.js +156 -0
- package/backend/src/core/infrastructure/__tests__/ConnectionPool.test.js +146 -0
- package/backend/src/core/infrastructure/__tests__/RateLimiter.test.js +171 -0
- package/backend/src/core/ipc/botApiFactory.js +72 -0
- package/backend/src/core/ipc/ipcMessageTypes.js +115 -0
- package/backend/src/core/logging/AuditLogger.js +61 -0
- package/backend/src/core/logging/StructuredLogger.js +80 -0
- package/backend/src/core/logging/__tests__/StructuredLogger.test.js +213 -0
- package/backend/src/core/logging/index.js +7 -0
- package/backend/src/core/metrics/MetricsCollector.js +104 -0
- package/backend/src/core/metrics/__tests__/MetricsCollector.test.js +131 -0
- package/backend/src/core/node-registries/actionsNodes.js +191 -0
- package/backend/src/core/node-registries/arraysNodes.js +152 -0
- package/backend/src/core/node-registries/botNodes.js +48 -0
- package/backend/src/core/node-registries/containerNodes.js +141 -0
- package/backend/src/core/node-registries/dataNodes.js +284 -0
- package/backend/src/core/node-registries/debugNodes.js +23 -0
- package/backend/src/core/node-registries/eventsNodes.js +223 -0
- package/backend/src/core/node-registries/flowNodes.js +151 -0
- package/backend/src/core/node-registries/furnaceNodes.js +123 -0
- package/backend/src/core/node-registries/index.js +108 -0
- package/backend/src/core/node-registries/inventory.js +102 -106
- package/backend/src/core/node-registries/logicNodes.js +54 -0
- package/backend/src/core/node-registries/mathNodes.js +38 -0
- package/backend/src/core/node-registries/navigationNodes.js +109 -0
- package/backend/src/core/node-registries/objectsNodes.js +90 -0
- package/backend/src/core/node-registries/stringsNodes.js +165 -0
- package/backend/src/core/node-registries/timeNodes.js +105 -0
- package/backend/src/core/node-registries/typeNodes.js +22 -0
- package/backend/src/core/node-registries/usersNodes.js +126 -0
- package/backend/src/core/nodes/arrays/shuffle.js +14 -0
- package/backend/src/core/nodes/bot/get_name.js +8 -0
- package/backend/src/core/nodes/bot/stop_bot.js +5 -0
- package/backend/src/core/nodes/container/open.js +101 -111
- package/backend/src/core/nodes/data/store_read.js +26 -0
- package/backend/src/core/nodes/data/store_write.js +23 -0
- package/backend/src/core/nodes/event/call_event.js +31 -0
- package/backend/src/core/nodes/event/custom_event.js +8 -0
- package/backend/src/core/nodes/flow/timer.js +35 -0
- package/backend/src/core/nodes/inventory/drop.js +73 -65
- package/backend/src/core/nodes/inventory/equip.js +54 -45
- package/backend/src/core/nodes/inventory/select_slot.js +48 -46
- package/backend/src/core/nodes/navigation/follow.js +54 -51
- package/backend/src/core/nodes/navigation/go_to.js +41 -53
- package/backend/src/core/nodes/navigation/go_to_entity.js +65 -69
- package/backend/src/core/nodes/navigation/go_to_player.js +65 -70
- package/backend/src/core/nodes/navigation/stop.js +17 -26
- package/backend/src/core/nodes/users/add_to_group.js +24 -0
- package/backend/src/core/nodes/users/check_permission.js +26 -0
- package/backend/src/core/nodes/users/remove_from_group.js +24 -0
- package/backend/src/core/services/BotIPCMessageRouter.js +337 -0
- package/backend/src/core/services/BotLifecycleService.js +41 -632
- package/backend/src/core/services/CacheManager.js +83 -23
- package/backend/src/core/services/CrashRestartManager.js +42 -0
- package/backend/src/core/services/DebugSessionManager.js +114 -12
- package/backend/src/core/services/EventGraphService.js +69 -0
- package/backend/src/core/services/MinecraftBotManager.js +9 -1
- package/backend/src/core/services/PluginManagementService.js +84 -0
- package/backend/src/core/services/TestModeContext.js +65 -0
- package/backend/src/core/services/__tests__/CacheManager.test.js +168 -0
- package/backend/src/core/services.js +1 -11
- package/backend/src/core/validation/InputValidator.js +167 -0
- package/backend/src/core/validation/__tests__/InputValidator.test.js +296 -0
- package/backend/src/real-time/botApi/index.js +1 -1
- package/backend/src/real-time/socketHandler.js +26 -0
- package/backend/src/server.js +10 -5
- package/frontend/dist/assets/{browser-ponyfill-DN7pwmHT.js → browser-ponyfill-D8y0Ty7C.js} +1 -1
- package/frontend/dist/assets/index-CFJLS0dk.css +32 -0
- package/frontend/dist/assets/{index-LSy71uwm.js → index-D91UGNMG.js} +1880 -1881
- package/frontend/dist/index.html +2 -2
- package/frontend/dist/locales/en/bots.json +4 -1
- package/frontend/dist/locales/en/common.json +7 -1
- package/frontend/dist/locales/en/login.json +2 -0
- package/frontend/dist/locales/en/management.json +79 -1
- package/frontend/dist/locales/en/nodes.json +59 -4
- package/frontend/dist/locales/en/plugin-detail.json +24 -4
- package/frontend/dist/locales/en/plugins.json +226 -7
- package/frontend/dist/locales/en/setup.json +2 -0
- package/frontend/dist/locales/en/sidebar.json +171 -3
- package/frontend/dist/locales/en/visual-editor.json +230 -31
- package/frontend/dist/locales/ru/bots.json +4 -1
- package/frontend/dist/locales/ru/login.json +2 -0
- package/frontend/dist/locales/ru/management.json +79 -1
- package/frontend/dist/locales/ru/minecraft-viewer.json +3 -0
- package/frontend/dist/locales/ru/nodes.json +105 -51
- package/frontend/dist/locales/ru/plugins.json +103 -4
- package/frontend/dist/locales/ru/setup.json +2 -0
- package/frontend/dist/locales/ru/sidebar.json +171 -3
- package/frontend/dist/locales/ru/visual-editor.json +232 -33
- package/frontend/package.json +2 -0
- package/nul +12 -0
- package/package.json +3 -3
- package/backend/package-lock.json +0 -6801
- package/backend/src/core/node-registries/actions.js +0 -202
- package/backend/src/core/node-registries/arrays.js +0 -155
- package/backend/src/core/node-registries/bot.js +0 -23
- package/backend/src/core/node-registries/container.js +0 -162
- package/backend/src/core/node-registries/data.js +0 -290
- package/backend/src/core/node-registries/debug.js +0 -26
- package/backend/src/core/node-registries/events.js +0 -201
- package/backend/src/core/node-registries/flow.js +0 -139
- package/backend/src/core/node-registries/furnace.js +0 -143
- package/backend/src/core/node-registries/logic.js +0 -62
- package/backend/src/core/node-registries/math.js +0 -42
- package/backend/src/core/node-registries/navigation.js +0 -111
- package/backend/src/core/node-registries/objects.js +0 -98
- package/backend/src/core/node-registries/strings.js +0 -187
- package/backend/src/core/node-registries/time.js +0 -113
- package/backend/src/core/node-registries/type.js +0 -25
- package/backend/src/core/node-registries/users.js +0 -79
- package/frontend/dist/assets/index-SfhKxI4-.css +0 -32
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
const { GRAPH_TYPES } = require('../../core/constants/graphTypes');
|
|
2
|
+
|
|
3
|
+
const logicNodes = [
|
|
4
|
+
{
|
|
5
|
+
type: 'logic:operation',
|
|
6
|
+
label: '💡 Логика',
|
|
7
|
+
category: 'Логика',
|
|
8
|
+
description: 'Выполняет логическую операцию. Для НЕ (NOT) используется только вход А.',
|
|
9
|
+
graphType: GRAPH_TYPES.ALL,
|
|
10
|
+
dynamicPins: true,
|
|
11
|
+
evaluator: require('../../core/nodes/logic/operation').evaluate,
|
|
12
|
+
computeInputs: (data) => [
|
|
13
|
+
{ id: 'a', name: 'A', type: 'Boolean', required: true, inlineField: true },
|
|
14
|
+
{ id: 'b', name: 'B', type: 'Boolean', required: true, inlineField: true }
|
|
15
|
+
],
|
|
16
|
+
computeOutputs: () => [
|
|
17
|
+
{ id: 'result', name: 'Результат', type: 'Boolean' }
|
|
18
|
+
],
|
|
19
|
+
defaultData: {}
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
type: 'logic:compare',
|
|
23
|
+
label: '⎗ Сравнение',
|
|
24
|
+
category: 'Логика',
|
|
25
|
+
description: 'Сравнивает два значения.',
|
|
26
|
+
graphType: GRAPH_TYPES.ALL,
|
|
27
|
+
evaluator: require('../../core/nodes/logic/compare').evaluate,
|
|
28
|
+
computeInputs: (data) => [
|
|
29
|
+
{ id: 'a', name: 'A', type: 'Wildcard', required: false, inlineField: true },
|
|
30
|
+
{ id: 'b', name: 'B', type: 'Wildcard', required: false, inlineField: true }
|
|
31
|
+
],
|
|
32
|
+
computeOutputs: () => [
|
|
33
|
+
{ id: 'result', name: 'Результат', type: 'Boolean' }
|
|
34
|
+
],
|
|
35
|
+
defaultData: {}
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
type: 'logic:not',
|
|
39
|
+
label: '! НЕ',
|
|
40
|
+
category: 'Логика',
|
|
41
|
+
description: 'Инвертирует boolean значение (NOT).',
|
|
42
|
+
graphType: GRAPH_TYPES.ALL,
|
|
43
|
+
evaluator: require('../../core/nodes/logic/not').evaluate,
|
|
44
|
+
computeInputs: (data) => [
|
|
45
|
+
{ id: 'value', name: 'Значение', type: 'Boolean', required: false, inlineField: true }
|
|
46
|
+
],
|
|
47
|
+
computeOutputs: () => [
|
|
48
|
+
{ id: 'result', name: 'Результат', type: 'Boolean' }
|
|
49
|
+
],
|
|
50
|
+
defaultData: { value: false }
|
|
51
|
+
}
|
|
52
|
+
];
|
|
53
|
+
|
|
54
|
+
module.exports = logicNodes;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
const { GRAPH_TYPES } = require('../../core/constants/graphTypes');
|
|
2
|
+
|
|
3
|
+
const mathNodes = [
|
|
4
|
+
{
|
|
5
|
+
type: 'math:operation',
|
|
6
|
+
label: '🔢 Математика',
|
|
7
|
+
category: 'Математика',
|
|
8
|
+
description: 'Выполняет математическую операцию над двумя числами.',
|
|
9
|
+
graphType: GRAPH_TYPES.ALL,
|
|
10
|
+
evaluator: require('../../core/nodes/math/operation').evaluate,
|
|
11
|
+
computeInputs: (data) => [
|
|
12
|
+
{ id: 'a', name: 'A', type: 'Number', required: true, inlineField: true, placeholder: '0' },
|
|
13
|
+
{ id: 'b', name: 'B', type: 'Number', required: true, inlineField: true, placeholder: '0' }
|
|
14
|
+
],
|
|
15
|
+
computeOutputs: () => [
|
|
16
|
+
{ id: 'result', name: 'Результат', type: 'Number' }
|
|
17
|
+
],
|
|
18
|
+
defaultData: { a: 0, b: 0 }
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
type: 'math:random_number',
|
|
22
|
+
label: '🎲 Случайное число',
|
|
23
|
+
category: 'Математика',
|
|
24
|
+
graphType: GRAPH_TYPES.ALL,
|
|
25
|
+
description: 'Генерирует случайное число в заданном диапазоне.',
|
|
26
|
+
evaluator: require('../../core/nodes/math/random_number').evaluate,
|
|
27
|
+
computeInputs: (data) => [
|
|
28
|
+
{ id: 'min', name: 'Мин', type: 'Number', required: false, inlineField: true, placeholder: '0' },
|
|
29
|
+
{ id: 'max', name: 'Макс', type: 'Number', required: false, inlineField: true, placeholder: '100' }
|
|
30
|
+
],
|
|
31
|
+
computeOutputs: () => [
|
|
32
|
+
{ id: 'result', name: 'Результат', type: 'Number' }
|
|
33
|
+
],
|
|
34
|
+
defaultData: { min: 0, max: 100 }
|
|
35
|
+
}
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
module.exports = mathNodes;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
const { GRAPH_TYPES } = require('../../core/constants/graphTypes');
|
|
2
|
+
|
|
3
|
+
const navigationNodes = [
|
|
4
|
+
{
|
|
5
|
+
type: 'navigation:go_to',
|
|
6
|
+
label: '🚶 Идти к координатам',
|
|
7
|
+
category: 'Навигация',
|
|
8
|
+
description: 'Перемещает бота к указанным координатам используя pathfinding.',
|
|
9
|
+
graphType: GRAPH_TYPES.ALL,
|
|
10
|
+
executor: require('../../core/nodes/navigation/go_to').execute,
|
|
11
|
+
evaluator: require('../../core/nodes/navigation/go_to').evaluate,
|
|
12
|
+
computeInputs: (data) => [
|
|
13
|
+
{ id: 'exec', name: 'Выполнить', type: 'Exec' },
|
|
14
|
+
{ id: 'x', name: 'X', type: 'Number', required: false, inlineField: true, placeholder: '0' },
|
|
15
|
+
{ id: 'y', name: 'Y', type: 'Number', required: false, inlineField: true, placeholder: '64' },
|
|
16
|
+
{ id: 'z', name: 'Z', type: 'Number', required: false, inlineField: true, placeholder: '0' },
|
|
17
|
+
{ id: 'range', name: 'Радиус', type: 'Number', required: false, inlineField: true, placeholder: '1' }
|
|
18
|
+
],
|
|
19
|
+
computeOutputs: (data) => [
|
|
20
|
+
{ id: 'exec', name: 'Дошёл', type: 'Exec' },
|
|
21
|
+
{ id: 'exec_failed', name: 'Не удалось', type: 'Exec' },
|
|
22
|
+
{ id: 'success', name: 'Успех?', type: 'Boolean' }
|
|
23
|
+
],
|
|
24
|
+
defaultData: { x: 0, y: 64, z: 0, range: 1 },
|
|
25
|
+
theme: { headerColor: '#3b82f6', accentColor: '#60a5fa' }
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
type: 'navigation:go_to_player',
|
|
29
|
+
label: '🏃 Идти к игроку',
|
|
30
|
+
category: 'Навигация',
|
|
31
|
+
description: 'Перемещает бота к указанному игроку.',
|
|
32
|
+
graphType: GRAPH_TYPES.ALL,
|
|
33
|
+
executor: require('../../core/nodes/navigation/go_to_player').execute,
|
|
34
|
+
evaluator: require('../../core/nodes/navigation/go_to_player').evaluate,
|
|
35
|
+
computeInputs: (data) => [
|
|
36
|
+
{ id: 'exec', name: 'Выполнить', type: 'Exec' },
|
|
37
|
+
{ id: 'playerName', name: 'Имя игрока', type: 'String', required: true, inlineField: true, placeholder: 'Steve' },
|
|
38
|
+
{ id: 'range', name: 'Радиус', type: 'Number', required: false, inlineField: true, placeholder: '3' }
|
|
39
|
+
],
|
|
40
|
+
computeOutputs: (data) => [
|
|
41
|
+
{ id: 'exec', name: 'Дошёл', type: 'Exec' },
|
|
42
|
+
{ id: 'exec_failed', name: 'Не удалось', type: 'Exec' },
|
|
43
|
+
{ id: 'success', name: 'Успех?', type: 'Boolean' },
|
|
44
|
+
{ id: 'playerPosition', name: 'Позиция игрока', type: 'Object' }
|
|
45
|
+
],
|
|
46
|
+
defaultData: { playerName: '', range: 3 },
|
|
47
|
+
theme: { headerColor: '#3b82f6', accentColor: '#60a5fa' }
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
type: 'navigation:go_to_entity',
|
|
51
|
+
label: '🎯 Идти к сущности',
|
|
52
|
+
category: 'Навигация',
|
|
53
|
+
description: 'Перемещает бота к указанной сущности.',
|
|
54
|
+
graphType: GRAPH_TYPES.ALL,
|
|
55
|
+
executor: require('../../core/nodes/navigation/go_to_entity').execute,
|
|
56
|
+
evaluator: require('../../core/nodes/navigation/go_to_entity').evaluate,
|
|
57
|
+
computeInputs: (data) => [
|
|
58
|
+
{ id: 'exec', name: 'Выполнить', type: 'Exec' },
|
|
59
|
+
{ id: 'entity', name: 'Сущность', type: 'Object', required: true, inlineField: false },
|
|
60
|
+
{ id: 'range', name: 'Радиус', type: 'Number', required: false, inlineField: true, placeholder: '3' }
|
|
61
|
+
],
|
|
62
|
+
computeOutputs: (data) => [
|
|
63
|
+
{ id: 'exec', name: 'Дошёл', type: 'Exec' },
|
|
64
|
+
{ id: 'exec_failed', name: 'Не удалось', type: 'Exec' },
|
|
65
|
+
{ id: 'success', name: 'Успех?', type: 'Boolean' }
|
|
66
|
+
],
|
|
67
|
+
defaultData: { range: 3 },
|
|
68
|
+
theme: { headerColor: '#3b82f6', accentColor: '#60a5fa' }
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
type: 'navigation:follow',
|
|
72
|
+
label: '👥 Следовать за игроком',
|
|
73
|
+
category: 'Навигация',
|
|
74
|
+
description: 'Начинает следовать за игроком.',
|
|
75
|
+
graphType: GRAPH_TYPES.ALL,
|
|
76
|
+
executor: require('../../core/nodes/navigation/follow').execute,
|
|
77
|
+
evaluator: require('../../core/nodes/navigation/follow').evaluate,
|
|
78
|
+
computeInputs: (data) => [
|
|
79
|
+
{ id: 'exec', name: 'Выполнить', type: 'Exec' },
|
|
80
|
+
{ id: 'target', name: 'Цель', type: 'String', required: true, inlineField: true, placeholder: 'Steve' },
|
|
81
|
+
{ id: 'range', name: 'Дистанция', type: 'Number', required: false, inlineField: true, placeholder: '5' }
|
|
82
|
+
],
|
|
83
|
+
computeOutputs: (data) => [
|
|
84
|
+
{ id: 'exec', name: 'Начал следовать', type: 'Exec' },
|
|
85
|
+
{ id: 'following', name: 'Следует?', type: 'Boolean' }
|
|
86
|
+
],
|
|
87
|
+
defaultData: { target: '', range: 5 },
|
|
88
|
+
theme: { headerColor: '#3b82f6', accentColor: '#60a5fa' }
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
type: 'navigation:stop',
|
|
92
|
+
label: '🛑 Остановиться',
|
|
93
|
+
category: 'Навигация',
|
|
94
|
+
description: 'Останавливает текущее движение бота.',
|
|
95
|
+
graphType: GRAPH_TYPES.ALL,
|
|
96
|
+
executor: require('../../core/nodes/navigation/stop').execute,
|
|
97
|
+
evaluator: require('../../core/nodes/navigation/stop').evaluate,
|
|
98
|
+
computeInputs: (data) => [
|
|
99
|
+
{ id: 'exec', name: 'Выполнить', type: 'Exec' }
|
|
100
|
+
],
|
|
101
|
+
computeOutputs: (data) => [
|
|
102
|
+
{ id: 'exec', name: 'Выполнено', type: 'Exec' }
|
|
103
|
+
],
|
|
104
|
+
defaultData: {},
|
|
105
|
+
theme: { headerColor: '#3b82f6', accentColor: '#60a5fa' }
|
|
106
|
+
}
|
|
107
|
+
];
|
|
108
|
+
|
|
109
|
+
module.exports = navigationNodes;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
const { GRAPH_TYPES } = require('../../core/constants/graphTypes');
|
|
2
|
+
|
|
3
|
+
const objectsNodes = [
|
|
4
|
+
{
|
|
5
|
+
type: 'object:create',
|
|
6
|
+
label: '🏗️ Создать объект',
|
|
7
|
+
category: 'Объект',
|
|
8
|
+
description: 'Создает объект из пар ключ-значение.',
|
|
9
|
+
graphType: GRAPH_TYPES.ALL,
|
|
10
|
+
evaluator: require('../../core/nodes/objects/create').evaluate,
|
|
11
|
+
computeInputs: () => [],
|
|
12
|
+
computeOutputs: () => [
|
|
13
|
+
{ id: 'object', name: 'Объект', type: 'Object' }
|
|
14
|
+
],
|
|
15
|
+
defaultData: {},
|
|
16
|
+
theme: { headerColor: '#8b5cf6', accentColor: '#a78bfa' }
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
type: 'object:get',
|
|
20
|
+
label: '📤 Получить значение',
|
|
21
|
+
category: 'Объект',
|
|
22
|
+
description: 'Получает значение по ключу из объекта.',
|
|
23
|
+
graphType: GRAPH_TYPES.ALL,
|
|
24
|
+
evaluator: require('../../core/nodes/objects/get').evaluate,
|
|
25
|
+
computeInputs: (data) => [
|
|
26
|
+
{ id: 'object', name: 'Объект', type: 'Object', required: true },
|
|
27
|
+
{ id: 'key', name: 'Ключ', type: 'String', required: true, inlineField: true, placeholder: 'key...' }
|
|
28
|
+
],
|
|
29
|
+
computeOutputs: () => [
|
|
30
|
+
{ id: 'value', name: 'Значение', type: 'Any' }
|
|
31
|
+
],
|
|
32
|
+
defaultData: { key: '' },
|
|
33
|
+
theme: { headerColor: '#8b5cf6', accentColor: '#a78bfa' }
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
type: 'object:set',
|
|
37
|
+
label: '➕ Добавить/Изменить ключ',
|
|
38
|
+
category: 'Объект',
|
|
39
|
+
description: 'Добавляет или изменяет значение по ключу в объекте.',
|
|
40
|
+
graphType: GRAPH_TYPES.ALL,
|
|
41
|
+
evaluator: require('../../core/nodes/objects/set').evaluate,
|
|
42
|
+
computeInputs: (data) => [
|
|
43
|
+
{ id: 'object', name: 'Объект', type: 'Object', required: true },
|
|
44
|
+
{ id: 'key', name: 'Ключ', type: 'String', required: true, inlineField: true, placeholder: 'key...' },
|
|
45
|
+
{ id: 'value', name: 'Значение', type: 'Any', required: true }
|
|
46
|
+
],
|
|
47
|
+
computeOutputs: () => [
|
|
48
|
+
{ id: 'new_object', name: 'Новый объект', type: 'Object' }
|
|
49
|
+
],
|
|
50
|
+
defaultData: { key: '' },
|
|
51
|
+
theme: { headerColor: '#8b5cf6', accentColor: '#a78bfa' }
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
type: 'object:delete',
|
|
55
|
+
label: '➖ Удалить ключ',
|
|
56
|
+
category: 'Объект',
|
|
57
|
+
description: 'Удаляет ключ из объекта.',
|
|
58
|
+
graphType: GRAPH_TYPES.ALL,
|
|
59
|
+
evaluator: require('../../core/nodes/objects/delete').evaluate,
|
|
60
|
+
computeInputs: (data) => [
|
|
61
|
+
{ id: 'object', name: 'Объект', type: 'Object', required: true },
|
|
62
|
+
{ id: 'key', name: 'Ключ', type: 'String', required: true, inlineField: true, placeholder: 'key...' }
|
|
63
|
+
],
|
|
64
|
+
computeOutputs: () => [
|
|
65
|
+
{ id: 'new_object', name: 'Новый объект', type: 'Object' }
|
|
66
|
+
],
|
|
67
|
+
defaultData: { key: '' },
|
|
68
|
+
theme: { headerColor: '#8b5cf6', accentColor: '#a78bfa' }
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
type: 'object:has_key',
|
|
72
|
+
label: '🔍 Проверить ключ',
|
|
73
|
+
category: 'Объект',
|
|
74
|
+
description: 'Проверяет наличие ключа в объекте и возвращает значение.',
|
|
75
|
+
graphType: GRAPH_TYPES.ALL,
|
|
76
|
+
evaluator: require('../../core/nodes/objects/has_key').evaluate,
|
|
77
|
+
computeInputs: (data) => [
|
|
78
|
+
{ id: 'object', name: 'Объект', type: 'Object', required: true },
|
|
79
|
+
{ id: 'key', name: 'Ключ', type: 'String', required: true, inlineField: true, placeholder: 'key...' }
|
|
80
|
+
],
|
|
81
|
+
computeOutputs: () => [
|
|
82
|
+
{ id: 'result', name: 'Найден', type: 'Boolean' },
|
|
83
|
+
{ id: 'value', name: 'Значение', type: 'Any' }
|
|
84
|
+
],
|
|
85
|
+
defaultData: { key: '' },
|
|
86
|
+
theme: { headerColor: '#8b5cf6', accentColor: '#a78bfa' }
|
|
87
|
+
}
|
|
88
|
+
];
|
|
89
|
+
|
|
90
|
+
module.exports = objectsNodes;
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
const { GRAPH_TYPES } = require('../../core/constants/graphTypes');
|
|
2
|
+
|
|
3
|
+
const stringsNodes = [
|
|
4
|
+
{
|
|
5
|
+
type: 'string:contains',
|
|
6
|
+
label: '🔍 Строка содержит',
|
|
7
|
+
category: 'Строки',
|
|
8
|
+
description: 'Проверяет, содержит ли одна строка другую.',
|
|
9
|
+
graphType: GRAPH_TYPES.ALL,
|
|
10
|
+
evaluator: require('../../core/nodes/strings/contains').evaluate,
|
|
11
|
+
computeInputs: (data) => [
|
|
12
|
+
{ id: 'haystack', name: 'Строка', type: 'String', required: true, inlineField: true, placeholder: '' },
|
|
13
|
+
{ id: 'needle', name: 'Подстрока', type: 'String', required: true, inlineField: true, placeholder: '' },
|
|
14
|
+
{ id: 'case_sensitive', name: 'Учет регистра', type: 'Boolean', required: false, inlineField: true }
|
|
15
|
+
],
|
|
16
|
+
computeOutputs: () => [
|
|
17
|
+
{ id: 'result', name: 'Содержит?', type: 'Boolean' }
|
|
18
|
+
],
|
|
19
|
+
defaultData: { haystack: '', needle: '', case_sensitive: false }
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
type: 'string:matches',
|
|
23
|
+
label: '🔎 RegEx совпадает',
|
|
24
|
+
category: 'Строки',
|
|
25
|
+
description: 'Проверяет совпадение с регулярным выражением.',
|
|
26
|
+
graphType: GRAPH_TYPES.ALL,
|
|
27
|
+
evaluator: require('../../core/nodes/strings/matches').evaluate,
|
|
28
|
+
computeInputs: (data) => [
|
|
29
|
+
{ id: 'string', name: 'Строка', type: 'String', required: true, inlineField: true, placeholder: '' },
|
|
30
|
+
{ id: 'regex', name: 'RegEx', type: 'String', required: true, inlineField: true, placeholder: '' }
|
|
31
|
+
],
|
|
32
|
+
computeOutputs: () => [
|
|
33
|
+
{ id: 'result', name: 'Совпадает?', type: 'Boolean' }
|
|
34
|
+
],
|
|
35
|
+
defaultData: { string: '', regex: '' }
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
type: 'string:equals',
|
|
39
|
+
label: '🔤 Строка равна',
|
|
40
|
+
category: 'Строки',
|
|
41
|
+
description: 'Проверяет равенство двух строк.',
|
|
42
|
+
graphType: GRAPH_TYPES.ALL,
|
|
43
|
+
evaluator: require('../../core/nodes/strings/equals').evaluate,
|
|
44
|
+
computeInputs: (data) => [
|
|
45
|
+
{ id: 'a', name: 'A', type: 'String', required: true, inlineField: true, placeholder: '' },
|
|
46
|
+
{ id: 'b', name: 'B', type: 'String', required: true, inlineField: true, placeholder: '' },
|
|
47
|
+
{ id: 'case_sensitive', name: 'Учет регистра', type: 'Boolean', required: false, inlineField: true }
|
|
48
|
+
],
|
|
49
|
+
computeOutputs: () => [
|
|
50
|
+
{ id: 'result', name: 'Равны?', type: 'Boolean' }
|
|
51
|
+
],
|
|
52
|
+
defaultData: { a: '', b: '', case_sensitive: false }
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
type: 'string:starts_with',
|
|
56
|
+
label: '▶️ Начинается с',
|
|
57
|
+
category: 'Строки',
|
|
58
|
+
description: 'Проверяет, начинается ли строка с подстроки.',
|
|
59
|
+
graphType: GRAPH_TYPES.ALL,
|
|
60
|
+
evaluator: require('../../core/nodes/strings/starts_with').evaluate,
|
|
61
|
+
computeInputs: (data) => [
|
|
62
|
+
{ id: 'string', name: 'Строка', type: 'String', required: true, inlineField: true, placeholder: '' },
|
|
63
|
+
{ id: 'prefix', name: 'Префикс', type: 'String', required: true, inlineField: true, placeholder: '' },
|
|
64
|
+
{ id: 'case_sensitive', name: 'Учет регистра', type: 'Boolean', required: false, inlineField: true }
|
|
65
|
+
],
|
|
66
|
+
computeOutputs: () => [
|
|
67
|
+
{ id: 'result', name: 'Начинается?', type: 'Boolean' }
|
|
68
|
+
],
|
|
69
|
+
defaultData: { string: '', prefix: '', case_sensitive: false }
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
type: 'string:ends_with',
|
|
73
|
+
label: '◀️ Заканчивается на',
|
|
74
|
+
category: 'Строки',
|
|
75
|
+
description: 'Проверяет, заканчивается ли строка подстрокой.',
|
|
76
|
+
graphType: GRAPH_TYPES.ALL,
|
|
77
|
+
evaluator: require('../../core/nodes/strings/ends_with').evaluate,
|
|
78
|
+
computeInputs: (data) => [
|
|
79
|
+
{ id: 'string', name: 'Строка', type: 'String', required: true, inlineField: true, placeholder: '' },
|
|
80
|
+
{ id: 'suffix', name: 'Суффикс', type: 'String', required: true, inlineField: true, placeholder: '' },
|
|
81
|
+
{ id: 'case_sensitive', name: 'Учет регистра', type: 'Boolean', required: false, inlineField: true }
|
|
82
|
+
],
|
|
83
|
+
computeOutputs: () => [
|
|
84
|
+
{ id: 'result', name: 'Заканчивается?', type: 'Boolean' }
|
|
85
|
+
],
|
|
86
|
+
defaultData: { string: '', suffix: '', case_sensitive: false }
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
type: 'string:length',
|
|
90
|
+
label: '📏 Длина строки',
|
|
91
|
+
category: 'Строки',
|
|
92
|
+
description: 'Возвращает количество символов.',
|
|
93
|
+
graphType: GRAPH_TYPES.ALL,
|
|
94
|
+
evaluator: require('../../core/nodes/strings/length').evaluate,
|
|
95
|
+
computeInputs: (data) => [
|
|
96
|
+
{ id: 'string', name: 'Строка', type: 'String', required: true, inlineField: true, placeholder: '' }
|
|
97
|
+
],
|
|
98
|
+
computeOutputs: () => [
|
|
99
|
+
{ id: 'length', name: 'Длина', type: 'Number' }
|
|
100
|
+
],
|
|
101
|
+
defaultData: { string: '' }
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
type: 'string:split',
|
|
105
|
+
label: '✂️ Разделить строку',
|
|
106
|
+
category: 'Строки',
|
|
107
|
+
description: 'Разделяет строку на массив по разделителю.',
|
|
108
|
+
graphType: GRAPH_TYPES.ALL,
|
|
109
|
+
evaluator: require('../../core/nodes/strings/split').evaluate,
|
|
110
|
+
computeInputs: (data) => [
|
|
111
|
+
{ id: 'string', name: 'Строка', type: 'String', required: true, inlineField: true, placeholder: '' },
|
|
112
|
+
{ id: 'separator', name: 'Разделитель', type: 'String', required: true, inlineField: true, placeholder: ',' }
|
|
113
|
+
],
|
|
114
|
+
computeOutputs: () => [
|
|
115
|
+
{ id: 'array', name: 'Массив', type: 'Array' }
|
|
116
|
+
],
|
|
117
|
+
defaultData: { string: '', separator: ',' }
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
type: 'string:concat',
|
|
121
|
+
label: 'Строка: Объединить',
|
|
122
|
+
category: 'Строки',
|
|
123
|
+
description: 'Объединяет две или более строки в одну.',
|
|
124
|
+
graphType: GRAPH_TYPES.ALL,
|
|
125
|
+
dynamicPins: true,
|
|
126
|
+
evaluator: require('../../core/nodes/strings/concat').evaluate,
|
|
127
|
+
computeInputs: (data) => [],
|
|
128
|
+
computeOutputs: () => [
|
|
129
|
+
{ id: 'result', name: 'Результат', type: 'String' }
|
|
130
|
+
],
|
|
131
|
+
defaultData: {}
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
type: 'string:to_upper',
|
|
135
|
+
label: '⬆️ В верхний регистр',
|
|
136
|
+
category: 'Строки',
|
|
137
|
+
description: 'Преобразует строку в верхний регистр (UPPERCASE).',
|
|
138
|
+
graphType: GRAPH_TYPES.ALL,
|
|
139
|
+
evaluator: require('../../core/nodes/strings/to_upper').evaluate,
|
|
140
|
+
computeInputs: (data) => [
|
|
141
|
+
{ id: 'text', name: 'Текст', type: 'String', required: false, inlineField: true, placeholder: '' }
|
|
142
|
+
],
|
|
143
|
+
computeOutputs: () => [
|
|
144
|
+
{ id: 'result', name: 'Result', type: 'String' }
|
|
145
|
+
],
|
|
146
|
+
defaultData: { text: '' }
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
type: 'string:to_lower',
|
|
150
|
+
label: '⬇️ В нижний регистр',
|
|
151
|
+
category: 'Строки',
|
|
152
|
+
description: 'Преобразует строку в нижний регистр (lowercase).',
|
|
153
|
+
graphType: GRAPH_TYPES.ALL,
|
|
154
|
+
evaluator: require('../../core/nodes/strings/to_lower').evaluate,
|
|
155
|
+
computeInputs: (data) => [
|
|
156
|
+
{ id: 'text', name: 'Текст', type: 'String', required: false, inlineField: true, placeholder: '' }
|
|
157
|
+
],
|
|
158
|
+
computeOutputs: () => [
|
|
159
|
+
{ id: 'result', name: 'Result', type: 'String' }
|
|
160
|
+
],
|
|
161
|
+
defaultData: { text: '' }
|
|
162
|
+
}
|
|
163
|
+
];
|
|
164
|
+
|
|
165
|
+
module.exports = stringsNodes;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
const { GRAPH_TYPES } = require('../constants/graphTypes');
|
|
2
|
+
|
|
3
|
+
const timeNodes = [
|
|
4
|
+
{
|
|
5
|
+
type: 'time:datetime_literal',
|
|
6
|
+
label: '📅 Дата и время',
|
|
7
|
+
category: 'Время',
|
|
8
|
+
description: 'Создает объект даты и времени из строки. Если строка пустая, вернет текущее время.',
|
|
9
|
+
graphType: GRAPH_TYPES.ALL,
|
|
10
|
+
evaluator: require('../nodes/data/datetime_literal').evaluate,
|
|
11
|
+
computeInputs: (data) => [
|
|
12
|
+
{ id: 'date', name: 'Дата (строка)', type: 'String', required: false, inlineField: true, placeholder: '2024-01-01 12:00' }
|
|
13
|
+
],
|
|
14
|
+
computeOutputs: (data) => [
|
|
15
|
+
{ id: 'value', name: 'Дата', type: 'DateTime' }
|
|
16
|
+
],
|
|
17
|
+
defaultData: { date: '' },
|
|
18
|
+
theme: { headerColor: '#d97706', accentColor: '#f59e0b' }
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
type: 'time:now',
|
|
22
|
+
label: '⏰ Текущее время',
|
|
23
|
+
category: 'Время',
|
|
24
|
+
description: 'Возвращает текущую дату и время.',
|
|
25
|
+
graphType: GRAPH_TYPES.ALL,
|
|
26
|
+
evaluator: require('../nodes/time/now').evaluate,
|
|
27
|
+
computeInputs: () => [],
|
|
28
|
+
computeOutputs: () => [
|
|
29
|
+
{ id: 'now', name: 'Сейчас', type: 'DateTime' }
|
|
30
|
+
],
|
|
31
|
+
defaultData: {},
|
|
32
|
+
theme: { headerColor: '#d97706', accentColor: '#f59e0b' }
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
type: 'time:format',
|
|
36
|
+
label: '📝 Отформатировать дату',
|
|
37
|
+
category: 'Время',
|
|
38
|
+
description: 'Форматирует дату в строку. Формат по-умолчанию: yyyy-MM-dd HH:mm:ss',
|
|
39
|
+
graphType: GRAPH_TYPES.ALL,
|
|
40
|
+
evaluator: require('../nodes/time/format').evaluate,
|
|
41
|
+
computeInputs: (data) => [
|
|
42
|
+
{ id: 'date', name: 'Дата', type: 'DateTime', required: true, inlineField: true, placeholder: '' },
|
|
43
|
+
{ id: 'format', name: 'Формат', type: 'String', required: false, inlineField: true, placeholder: 'yyyy-MM-dd HH:mm:ss' }
|
|
44
|
+
],
|
|
45
|
+
computeOutputs: (data) => [
|
|
46
|
+
{ id: 'formatted', name: 'Строка', type: 'String' }
|
|
47
|
+
],
|
|
48
|
+
defaultData: { format: 'yyyy-MM-dd HH:mm:ss' },
|
|
49
|
+
theme: { headerColor: '#d97706', accentColor: '#f59e0b' }
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
type: 'time:add',
|
|
53
|
+
label: '➕ Прибавить время',
|
|
54
|
+
category: 'Время',
|
|
55
|
+
description: 'Добавляет к дате указанный промежуток времени. Пример объекта продолжительности: { "seconds": 5, "minutes": 1 }',
|
|
56
|
+
graphType: GRAPH_TYPES.ALL,
|
|
57
|
+
evaluator: require('../nodes/time/add').evaluate,
|
|
58
|
+
computeInputs: (data) => [
|
|
59
|
+
{ id: 'date', name: 'Дата', type: 'DateTime', required: true, inlineField: true, placeholder: '' },
|
|
60
|
+
{ id: 'duration', name: 'Продолжительность', type: 'Object', required: true, inlineField: true, placeholder: '{ seconds: 5 }' }
|
|
61
|
+
],
|
|
62
|
+
computeOutputs: (data) => [
|
|
63
|
+
{ id: 'result', name: 'Новая дата', type: 'DateTime' }
|
|
64
|
+
],
|
|
65
|
+
defaultData: { duration: null },
|
|
66
|
+
theme: { headerColor: '#d97706', accentColor: '#f59e0b' }
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
type: 'time:diff',
|
|
70
|
+
label: '↔️ Разница во времени',
|
|
71
|
+
category: 'Время',
|
|
72
|
+
description: 'Вычисляет разницу между двумя датами в миллисекундах (Дата А - Дата Б).',
|
|
73
|
+
graphType: GRAPH_TYPES.ALL,
|
|
74
|
+
evaluator: require('../nodes/time/diff').evaluate,
|
|
75
|
+
computeInputs: (data) => [
|
|
76
|
+
{ id: 'date_left', name: 'Дата А', type: 'DateTime', required: true, inlineField: true, placeholder: '' },
|
|
77
|
+
{ id: 'date_right', name: 'Дата Б', type: 'DateTime', required: true, inlineField: true, placeholder: '' }
|
|
78
|
+
],
|
|
79
|
+
computeOutputs: (data) => [
|
|
80
|
+
{ id: 'diff', name: 'Разница (мс)', type: 'Number' }
|
|
81
|
+
],
|
|
82
|
+
defaultData: {},
|
|
83
|
+
theme: { headerColor: '#d97706', accentColor: '#f59e0b' }
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
type: 'time:compare',
|
|
87
|
+
label: '⚖️ Сравнить даты',
|
|
88
|
+
category: 'Время',
|
|
89
|
+
description: 'Сравнивает две даты.',
|
|
90
|
+
graphType: GRAPH_TYPES.ALL,
|
|
91
|
+
evaluator: require('../nodes/time/compare').evaluate,
|
|
92
|
+
computeInputs: (data) => [
|
|
93
|
+
{ id: 'date_left', name: 'Дата А', type: 'DateTime', required: true, inlineField: true, placeholder: '' },
|
|
94
|
+
{ id: 'date_right', name: 'Дата Б', type: 'DateTime', required: true, inlineField: true, placeholder: '' },
|
|
95
|
+
{ id: 'operation', name: 'Операция', type: 'String', required: false, inlineField: true, placeholder: 'before|after|equal' }
|
|
96
|
+
],
|
|
97
|
+
computeOutputs: (data) => [
|
|
98
|
+
{ id: 'result', name: 'Результат', type: 'Boolean' }
|
|
99
|
+
],
|
|
100
|
+
defaultData: { operation: '' },
|
|
101
|
+
theme: { headerColor: '#d97706', accentColor: '#f59e0b' }
|
|
102
|
+
}
|
|
103
|
+
];
|
|
104
|
+
|
|
105
|
+
module.exports = timeNodes;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const { GRAPH_TYPES } = require('../../core/constants/graphTypes');
|
|
2
|
+
|
|
3
|
+
const typeNodes = [
|
|
4
|
+
{
|
|
5
|
+
type: 'type:to_string',
|
|
6
|
+
label: '📝 В строку',
|
|
7
|
+
category: 'Типы',
|
|
8
|
+
description: 'Преобразует любое значение в строку (toString).',
|
|
9
|
+
graphType: GRAPH_TYPES.ALL,
|
|
10
|
+
evaluator: require('../../core/nodes/type/to_string').evaluate,
|
|
11
|
+
computeInputs: (data) => [
|
|
12
|
+
{ id: 'value', name: 'Значение', type: 'Wildcard', required: false }
|
|
13
|
+
],
|
|
14
|
+
computeOutputs: () => [
|
|
15
|
+
{ id: 'result', name: 'Result', type: 'String' }
|
|
16
|
+
],
|
|
17
|
+
defaultData: {},
|
|
18
|
+
theme: { headerColor: '#0891b2', accentColor: '#06b6d4' }
|
|
19
|
+
}
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
module.exports = typeNodes;
|