@remnawave/backend-contract 2.6.23 → 2.6.24
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/build/backend/api/controllers/node-plugins.d.ts +1 -0
- package/build/backend/api/controllers/node-plugins.d.ts.map +1 -1
- package/build/backend/api/controllers/node-plugins.js +1 -0
- package/build/backend/api/routes.d.ts +1 -0
- package/build/backend/api/routes.d.ts.map +1 -1
- package/build/backend/api/routes.js +1 -0
- package/build/backend/commands/node-plugins/executor.command.d.ts +178 -0
- package/build/backend/commands/node-plugins/executor.command.d.ts.map +1 -0
- package/build/backend/commands/node-plugins/executor.command.js +58 -0
- package/build/backend/commands/node-plugins/index.d.ts +1 -0
- package/build/backend/commands/node-plugins/index.d.ts.map +1 -1
- package/build/backend/commands/node-plugins/index.js +1 -0
- package/build/frontend/api/controllers/node-plugins.js +1 -0
- package/build/frontend/api/routes.js +1 -0
- package/build/frontend/commands/node-plugins/executor.command.js +58 -0
- package/build/frontend/commands/node-plugins/index.js +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-plugins.d.ts","sourceRoot":"","sources":["../../../../api/controllers/node-plugins.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,EAAG,cAAuB,CAAC;AAI/D,eAAO,MAAM,mBAAmB;;yBAEhB,MAAM;;4BAEH,MAAM
|
|
1
|
+
{"version":3,"file":"node-plugins.d.ts","sourceRoot":"","sources":["../../../../api/controllers/node-plugins.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,EAAG,cAAuB,CAAC;AAI/D,eAAO,MAAM,mBAAmB;;yBAEhB,MAAM;;4BAEH,MAAM;;;;;;;CASf,CAAC"}
|
|
@@ -264,6 +264,7 @@ export declare const REST_API: {
|
|
|
264
264
|
readonly REORDER: "/api/node-plugins/actions/reorder";
|
|
265
265
|
readonly CLONE: "/api/node-plugins/actions/clone";
|
|
266
266
|
};
|
|
267
|
+
readonly EXECUTOR: "/api/node-plugins/executor";
|
|
267
268
|
};
|
|
268
269
|
readonly BANDWIDTH_STATS: {
|
|
269
270
|
readonly NODES: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../api/routes.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI,EAAG,MAAe,CAAC;AACpC,eAAO,MAAM,YAAY,EAAG,UAAmB,CAAC;AAChD,eAAO,MAAM,WAAW,EAAG,SAAkB,CAAC;AAC9C,eAAO,MAAM,cAAc,EAAG,SAAkB,CAAC;AAEjD,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;gCAyBE,MAAM;;;;;;;;;qCAYD,MAAM;;gCAGX,MAAM;;;;;oCAOF,MAAM;qCAIL,MAAM;qCAIN,MAAM;;2CAKA,MAAM;;;;;;;;;;;;gCAgBjB,MAAM;qCAGD,MAAM;0CAED,MAAM;sDAEM,MAAM;;qCAMvB,MAAM;oCAIP,MAAM;2CAIC,MAAM;iDAIA,MAAM;;;8BAOzB,MAAM;6CAES,MAAM;0CAIT,MAAM;2DAIW,MAAM;+CAIlB,MAAM;oCAIjB,MAAM;gCAIV,MAAM;;;;;;;;;;;;;;;;;;;;;kCAyBJ,MAAM;0CAEE,MAAM;uCAET,MAAM;;;;;;qCASR,MAAM;gCAEX,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAoCT,MAAM;;gCAKH,MAAM;;;;;;;;;;;;;;mDAiBa,MAAM;;;;;;;;;0CAYf,MAAM;kCAId,MAAM;6CAIK,MAAM;iDAIF,MAAM;;;6CAMV,MAAM;;qDAKE,MAAM;;;;;;qCAStB,MAAM;gCAIX,MAAM;sDAIgB,MAAM;6DAIC,MAAM;;;;;;;;;;qCAa9B,MAAM;gCAIX,MAAM;0CAII,MAAM;;uCAKT,MAAM;0CAEH,MAAM;;;;;;;;;;yCAWP,MAAM;8CAED,MAAM;;;;6CAMP,MAAM;;;gDAKH,MAAM;;;;;;;;;;;;;;;;qCAiBjB,MAAM;gCAIX,MAAM;;uCAKC,MAAM;0CAEH,MAAM;;;;;;;;;;;6BAYnB,MAAM;;;gCAIH,MAAM;;;;;;;;6BAST,MAAM;;;gCAIH,MAAM
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../api/routes.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI,EAAG,MAAe,CAAC;AACpC,eAAO,MAAM,YAAY,EAAG,UAAmB,CAAC;AAChD,eAAO,MAAM,WAAW,EAAG,SAAkB,CAAC;AAC9C,eAAO,MAAM,cAAc,EAAG,SAAkB,CAAC;AAEjD,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;gCAyBE,MAAM;;;;;;;;;qCAYD,MAAM;;gCAGX,MAAM;;;;;oCAOF,MAAM;qCAIL,MAAM;qCAIN,MAAM;;2CAKA,MAAM;;;;;;;;;;;;gCAgBjB,MAAM;qCAGD,MAAM;0CAED,MAAM;sDAEM,MAAM;;qCAMvB,MAAM;oCAIP,MAAM;2CAIC,MAAM;iDAIA,MAAM;;;8BAOzB,MAAM;6CAES,MAAM;0CAIT,MAAM;2DAIW,MAAM;+CAIlB,MAAM;oCAIjB,MAAM;gCAIV,MAAM;;;;;;;;;;;;;;;;;;;;;kCAyBJ,MAAM;0CAEE,MAAM;uCAET,MAAM;;;;;;qCASR,MAAM;gCAEX,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAoCT,MAAM;;gCAKH,MAAM;;;;;;;;;;;;;;mDAiBa,MAAM;;;;;;;;;0CAYf,MAAM;kCAId,MAAM;6CAIK,MAAM;iDAIF,MAAM;;;6CAMV,MAAM;;qDAKE,MAAM;;;;;;qCAStB,MAAM;gCAIX,MAAM;sDAIgB,MAAM;6DAIC,MAAM;;;;;;;;;;qCAa9B,MAAM;gCAIX,MAAM;0CAII,MAAM;;uCAKT,MAAM;0CAEH,MAAM;;;;;;;;;;yCAWP,MAAM;8CAED,MAAM;;;;6CAMP,MAAM;;;gDAKH,MAAM;;;;;;;;;;;;;;;;qCAiBjB,MAAM;gCAIX,MAAM;;uCAKC,MAAM;0CAEH,MAAM;;;;;;;;;;;6BAYnB,MAAM;;;gCAIH,MAAM;;;;;;;;6BAST,MAAM;;;gCAIH,MAAM;;;;;;;;;;;;uCAaC,MAAM;;;yCAIJ,MAAM;;;;2CAKJ,MAAM;;;6CAIJ,MAAM;;;;;mCAMhB,MAAM;+CAEM,MAAM;;;CAIlC,CAAC"}
|
|
@@ -301,6 +301,7 @@ exports.REST_API = {
|
|
|
301
301
|
REORDER: `${exports.ROOT}/${CONTROLLERS.NODE_PLUGINS_CONTROLLER}/${CONTROLLERS.NODE_PLUGINS_ROUTES.ACTIONS.REORDER}`,
|
|
302
302
|
CLONE: `${exports.ROOT}/${CONTROLLERS.NODE_PLUGINS_CONTROLLER}/${CONTROLLERS.NODE_PLUGINS_ROUTES.ACTIONS.CLONE}`,
|
|
303
303
|
},
|
|
304
|
+
EXECUTOR: `${exports.ROOT}/${CONTROLLERS.NODE_PLUGINS_CONTROLLER}/${CONTROLLERS.NODE_PLUGINS_ROUTES.EXECUTOR}`,
|
|
304
305
|
},
|
|
305
306
|
BANDWIDTH_STATS: {
|
|
306
307
|
NODES: {
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare namespace PluginExecutorCommand {
|
|
3
|
+
const url: "/api/node-plugins/executor";
|
|
4
|
+
const TSQ_url: "/api/node-plugins/executor";
|
|
5
|
+
const endpointDetails: import("../../constants").EndpointDetails;
|
|
6
|
+
const CommandSchema: z.ZodDiscriminatedUnion<"command", [z.ZodObject<{
|
|
7
|
+
command: z.ZodLiteral<"blockIps">;
|
|
8
|
+
ips: z.ZodArray<z.ZodObject<{
|
|
9
|
+
ip: z.ZodString;
|
|
10
|
+
timeout: z.ZodNumber;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
ip: string;
|
|
13
|
+
timeout: number;
|
|
14
|
+
}, {
|
|
15
|
+
ip: string;
|
|
16
|
+
timeout: number;
|
|
17
|
+
}>, "many">;
|
|
18
|
+
}, "strip", z.ZodTypeAny, {
|
|
19
|
+
ips: {
|
|
20
|
+
ip: string;
|
|
21
|
+
timeout: number;
|
|
22
|
+
}[];
|
|
23
|
+
command: "blockIps";
|
|
24
|
+
}, {
|
|
25
|
+
ips: {
|
|
26
|
+
ip: string;
|
|
27
|
+
timeout: number;
|
|
28
|
+
}[];
|
|
29
|
+
command: "blockIps";
|
|
30
|
+
}>, z.ZodObject<{
|
|
31
|
+
command: z.ZodLiteral<"unblockIps">;
|
|
32
|
+
ips: z.ZodArray<z.ZodString, "many">;
|
|
33
|
+
}, "strip", z.ZodTypeAny, {
|
|
34
|
+
ips: string[];
|
|
35
|
+
command: "unblockIps";
|
|
36
|
+
}, {
|
|
37
|
+
ips: string[];
|
|
38
|
+
command: "unblockIps";
|
|
39
|
+
}>, z.ZodObject<{
|
|
40
|
+
command: z.ZodLiteral<"recreateTables">;
|
|
41
|
+
}, "strip", z.ZodTypeAny, {
|
|
42
|
+
command: "recreateTables";
|
|
43
|
+
}, {
|
|
44
|
+
command: "recreateTables";
|
|
45
|
+
}>]>;
|
|
46
|
+
const TargetNodesSchema: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
|
|
47
|
+
target: z.ZodLiteral<"allNodes">;
|
|
48
|
+
}, "strip", z.ZodTypeAny, {
|
|
49
|
+
target: "allNodes";
|
|
50
|
+
}, {
|
|
51
|
+
target: "allNodes";
|
|
52
|
+
}>, z.ZodObject<{
|
|
53
|
+
target: z.ZodLiteral<"specificNodes">;
|
|
54
|
+
nodeUuids: z.ZodArray<z.ZodString, "many">;
|
|
55
|
+
}, "strip", z.ZodTypeAny, {
|
|
56
|
+
target: "specificNodes";
|
|
57
|
+
nodeUuids: string[];
|
|
58
|
+
}, {
|
|
59
|
+
target: "specificNodes";
|
|
60
|
+
nodeUuids: string[];
|
|
61
|
+
}>]>;
|
|
62
|
+
const RequestSchema: z.ZodObject<{
|
|
63
|
+
command: z.ZodDiscriminatedUnion<"command", [z.ZodObject<{
|
|
64
|
+
command: z.ZodLiteral<"blockIps">;
|
|
65
|
+
ips: z.ZodArray<z.ZodObject<{
|
|
66
|
+
ip: z.ZodString;
|
|
67
|
+
timeout: z.ZodNumber;
|
|
68
|
+
}, "strip", z.ZodTypeAny, {
|
|
69
|
+
ip: string;
|
|
70
|
+
timeout: number;
|
|
71
|
+
}, {
|
|
72
|
+
ip: string;
|
|
73
|
+
timeout: number;
|
|
74
|
+
}>, "many">;
|
|
75
|
+
}, "strip", z.ZodTypeAny, {
|
|
76
|
+
ips: {
|
|
77
|
+
ip: string;
|
|
78
|
+
timeout: number;
|
|
79
|
+
}[];
|
|
80
|
+
command: "blockIps";
|
|
81
|
+
}, {
|
|
82
|
+
ips: {
|
|
83
|
+
ip: string;
|
|
84
|
+
timeout: number;
|
|
85
|
+
}[];
|
|
86
|
+
command: "blockIps";
|
|
87
|
+
}>, z.ZodObject<{
|
|
88
|
+
command: z.ZodLiteral<"unblockIps">;
|
|
89
|
+
ips: z.ZodArray<z.ZodString, "many">;
|
|
90
|
+
}, "strip", z.ZodTypeAny, {
|
|
91
|
+
ips: string[];
|
|
92
|
+
command: "unblockIps";
|
|
93
|
+
}, {
|
|
94
|
+
ips: string[];
|
|
95
|
+
command: "unblockIps";
|
|
96
|
+
}>, z.ZodObject<{
|
|
97
|
+
command: z.ZodLiteral<"recreateTables">;
|
|
98
|
+
}, "strip", z.ZodTypeAny, {
|
|
99
|
+
command: "recreateTables";
|
|
100
|
+
}, {
|
|
101
|
+
command: "recreateTables";
|
|
102
|
+
}>]>;
|
|
103
|
+
targetNodes: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
|
|
104
|
+
target: z.ZodLiteral<"allNodes">;
|
|
105
|
+
}, "strip", z.ZodTypeAny, {
|
|
106
|
+
target: "allNodes";
|
|
107
|
+
}, {
|
|
108
|
+
target: "allNodes";
|
|
109
|
+
}>, z.ZodObject<{
|
|
110
|
+
target: z.ZodLiteral<"specificNodes">;
|
|
111
|
+
nodeUuids: z.ZodArray<z.ZodString, "many">;
|
|
112
|
+
}, "strip", z.ZodTypeAny, {
|
|
113
|
+
target: "specificNodes";
|
|
114
|
+
nodeUuids: string[];
|
|
115
|
+
}, {
|
|
116
|
+
target: "specificNodes";
|
|
117
|
+
nodeUuids: string[];
|
|
118
|
+
}>]>;
|
|
119
|
+
}, "strip", z.ZodTypeAny, {
|
|
120
|
+
targetNodes: {
|
|
121
|
+
target: "allNodes";
|
|
122
|
+
} | {
|
|
123
|
+
target: "specificNodes";
|
|
124
|
+
nodeUuids: string[];
|
|
125
|
+
};
|
|
126
|
+
command: {
|
|
127
|
+
ips: {
|
|
128
|
+
ip: string;
|
|
129
|
+
timeout: number;
|
|
130
|
+
}[];
|
|
131
|
+
command: "blockIps";
|
|
132
|
+
} | {
|
|
133
|
+
ips: string[];
|
|
134
|
+
command: "unblockIps";
|
|
135
|
+
} | {
|
|
136
|
+
command: "recreateTables";
|
|
137
|
+
};
|
|
138
|
+
}, {
|
|
139
|
+
targetNodes: {
|
|
140
|
+
target: "allNodes";
|
|
141
|
+
} | {
|
|
142
|
+
target: "specificNodes";
|
|
143
|
+
nodeUuids: string[];
|
|
144
|
+
};
|
|
145
|
+
command: {
|
|
146
|
+
ips: {
|
|
147
|
+
ip: string;
|
|
148
|
+
timeout: number;
|
|
149
|
+
}[];
|
|
150
|
+
command: "blockIps";
|
|
151
|
+
} | {
|
|
152
|
+
ips: string[];
|
|
153
|
+
command: "unblockIps";
|
|
154
|
+
} | {
|
|
155
|
+
command: "recreateTables";
|
|
156
|
+
};
|
|
157
|
+
}>;
|
|
158
|
+
type Request = z.infer<typeof RequestSchema>;
|
|
159
|
+
const ResponseSchema: z.ZodObject<{
|
|
160
|
+
response: z.ZodObject<{
|
|
161
|
+
eventSent: z.ZodBoolean;
|
|
162
|
+
}, "strip", z.ZodTypeAny, {
|
|
163
|
+
eventSent: boolean;
|
|
164
|
+
}, {
|
|
165
|
+
eventSent: boolean;
|
|
166
|
+
}>;
|
|
167
|
+
}, "strip", z.ZodTypeAny, {
|
|
168
|
+
response: {
|
|
169
|
+
eventSent: boolean;
|
|
170
|
+
};
|
|
171
|
+
}, {
|
|
172
|
+
response: {
|
|
173
|
+
eventSent: boolean;
|
|
174
|
+
};
|
|
175
|
+
}>;
|
|
176
|
+
type Response = z.infer<typeof ResponseSchema>;
|
|
177
|
+
}
|
|
178
|
+
//# sourceMappingURL=executor.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor.command.d.ts","sourceRoot":"","sources":["../../../../commands/node-plugins/executor.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,yBAAiB,qBAAqB,CAAC;IAC5B,MAAM,GAAG,8BAAiC,CAAC;IAC3C,MAAM,OAAO,8BAAM,CAAC;IAEpB,MAAM,eAAe,2CAI3B,CAAC;IAEK,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAyBxB,CAAC;IAEI,MAAM,iBAAiB;;;;;;;;;;;;;;;QAY5B,CAAC;IAEI,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAGxB,CAAC;IAEH,KAAY,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;IAE7C,MAAM,cAAc;;;;;;;;;;;;;;;;MAIzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PluginExecutorCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const api_1 = require("../../api");
|
|
6
|
+
const constants_1 = require("../../constants");
|
|
7
|
+
var PluginExecutorCommand;
|
|
8
|
+
(function (PluginExecutorCommand) {
|
|
9
|
+
PluginExecutorCommand.url = api_1.REST_API.NODE_PLUGINS.EXECUTOR;
|
|
10
|
+
PluginExecutorCommand.TSQ_url = PluginExecutorCommand.url;
|
|
11
|
+
PluginExecutorCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.NODE_PLUGINS_ROUTES.EXECUTOR, 'post', 'Execute command on node plugins');
|
|
12
|
+
PluginExecutorCommand.CommandSchema = zod_1.z.discriminatedUnion('command', [
|
|
13
|
+
zod_1.z
|
|
14
|
+
.object({
|
|
15
|
+
command: zod_1.z.literal('blockIps'),
|
|
16
|
+
ips: zod_1.z
|
|
17
|
+
.array(zod_1.z.object({
|
|
18
|
+
ip: zod_1.z.string().ip(),
|
|
19
|
+
timeout: zod_1.z.number(),
|
|
20
|
+
}))
|
|
21
|
+
.min(1),
|
|
22
|
+
})
|
|
23
|
+
.describe('Block IPs'),
|
|
24
|
+
zod_1.z
|
|
25
|
+
.object({
|
|
26
|
+
command: zod_1.z.literal('unblockIps'),
|
|
27
|
+
ips: zod_1.z.array(zod_1.z.string().ip()).min(1),
|
|
28
|
+
})
|
|
29
|
+
.describe('Unblock IPs'),
|
|
30
|
+
zod_1.z
|
|
31
|
+
.object({
|
|
32
|
+
command: zod_1.z.literal('recreateTables'),
|
|
33
|
+
})
|
|
34
|
+
.describe('Recreate tables'),
|
|
35
|
+
]);
|
|
36
|
+
PluginExecutorCommand.TargetNodesSchema = zod_1.z.discriminatedUnion('target', [
|
|
37
|
+
zod_1.z
|
|
38
|
+
.object({
|
|
39
|
+
target: zod_1.z.literal('allNodes'),
|
|
40
|
+
})
|
|
41
|
+
.describe('Target all connected nodes'),
|
|
42
|
+
zod_1.z
|
|
43
|
+
.object({
|
|
44
|
+
target: zod_1.z.literal('specificNodes'),
|
|
45
|
+
nodeUuids: zod_1.z.array(zod_1.z.string().uuid()).min(1),
|
|
46
|
+
})
|
|
47
|
+
.describe('Target specific nodes'),
|
|
48
|
+
]);
|
|
49
|
+
PluginExecutorCommand.RequestSchema = zod_1.z.object({
|
|
50
|
+
command: PluginExecutorCommand.CommandSchema,
|
|
51
|
+
targetNodes: PluginExecutorCommand.TargetNodesSchema,
|
|
52
|
+
});
|
|
53
|
+
PluginExecutorCommand.ResponseSchema = zod_1.z.object({
|
|
54
|
+
response: zod_1.z.object({
|
|
55
|
+
eventSent: zod_1.z.boolean(),
|
|
56
|
+
}),
|
|
57
|
+
});
|
|
58
|
+
})(PluginExecutorCommand || (exports.PluginExecutorCommand = PluginExecutorCommand = {}));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './actions';
|
|
2
2
|
export * from './create-node-plugin.command';
|
|
3
3
|
export * from './delete-node-plugin.command';
|
|
4
|
+
export * from './executor.command';
|
|
4
5
|
export * from './get-node-plugin.command';
|
|
5
6
|
export * from './get-node-plugins.command';
|
|
6
7
|
export * from './update-node-plugin.command';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../commands/node-plugins/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../commands/node-plugins/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC"}
|
|
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./actions"), exports);
|
|
18
18
|
__exportStar(require("./create-node-plugin.command"), exports);
|
|
19
19
|
__exportStar(require("./delete-node-plugin.command"), exports);
|
|
20
|
+
__exportStar(require("./executor.command"), exports);
|
|
20
21
|
__exportStar(require("./get-node-plugin.command"), exports);
|
|
21
22
|
__exportStar(require("./get-node-plugins.command"), exports);
|
|
22
23
|
__exportStar(require("./update-node-plugin.command"), exports);
|
|
@@ -301,6 +301,7 @@ exports.REST_API = {
|
|
|
301
301
|
REORDER: `${exports.ROOT}/${CONTROLLERS.NODE_PLUGINS_CONTROLLER}/${CONTROLLERS.NODE_PLUGINS_ROUTES.ACTIONS.REORDER}`,
|
|
302
302
|
CLONE: `${exports.ROOT}/${CONTROLLERS.NODE_PLUGINS_CONTROLLER}/${CONTROLLERS.NODE_PLUGINS_ROUTES.ACTIONS.CLONE}`,
|
|
303
303
|
},
|
|
304
|
+
EXECUTOR: `${exports.ROOT}/${CONTROLLERS.NODE_PLUGINS_CONTROLLER}/${CONTROLLERS.NODE_PLUGINS_ROUTES.EXECUTOR}`,
|
|
304
305
|
},
|
|
305
306
|
BANDWIDTH_STATS: {
|
|
306
307
|
NODES: {
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PluginExecutorCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const api_1 = require("../../api");
|
|
6
|
+
const constants_1 = require("../../constants");
|
|
7
|
+
var PluginExecutorCommand;
|
|
8
|
+
(function (PluginExecutorCommand) {
|
|
9
|
+
PluginExecutorCommand.url = api_1.REST_API.NODE_PLUGINS.EXECUTOR;
|
|
10
|
+
PluginExecutorCommand.TSQ_url = PluginExecutorCommand.url;
|
|
11
|
+
PluginExecutorCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.NODE_PLUGINS_ROUTES.EXECUTOR, 'post', 'Execute command on node plugins');
|
|
12
|
+
PluginExecutorCommand.CommandSchema = zod_1.z.discriminatedUnion('command', [
|
|
13
|
+
zod_1.z
|
|
14
|
+
.object({
|
|
15
|
+
command: zod_1.z.literal('blockIps'),
|
|
16
|
+
ips: zod_1.z
|
|
17
|
+
.array(zod_1.z.object({
|
|
18
|
+
ip: zod_1.z.string().ip(),
|
|
19
|
+
timeout: zod_1.z.number(),
|
|
20
|
+
}))
|
|
21
|
+
.min(1),
|
|
22
|
+
})
|
|
23
|
+
.describe('Block IPs'),
|
|
24
|
+
zod_1.z
|
|
25
|
+
.object({
|
|
26
|
+
command: zod_1.z.literal('unblockIps'),
|
|
27
|
+
ips: zod_1.z.array(zod_1.z.string().ip()).min(1),
|
|
28
|
+
})
|
|
29
|
+
.describe('Unblock IPs'),
|
|
30
|
+
zod_1.z
|
|
31
|
+
.object({
|
|
32
|
+
command: zod_1.z.literal('recreateTables'),
|
|
33
|
+
})
|
|
34
|
+
.describe('Recreate tables'),
|
|
35
|
+
]);
|
|
36
|
+
PluginExecutorCommand.TargetNodesSchema = zod_1.z.discriminatedUnion('target', [
|
|
37
|
+
zod_1.z
|
|
38
|
+
.object({
|
|
39
|
+
target: zod_1.z.literal('allNodes'),
|
|
40
|
+
})
|
|
41
|
+
.describe('Target all connected nodes'),
|
|
42
|
+
zod_1.z
|
|
43
|
+
.object({
|
|
44
|
+
target: zod_1.z.literal('specificNodes'),
|
|
45
|
+
nodeUuids: zod_1.z.array(zod_1.z.string().uuid()).min(1),
|
|
46
|
+
})
|
|
47
|
+
.describe('Target specific nodes'),
|
|
48
|
+
]);
|
|
49
|
+
PluginExecutorCommand.RequestSchema = zod_1.z.object({
|
|
50
|
+
command: PluginExecutorCommand.CommandSchema,
|
|
51
|
+
targetNodes: PluginExecutorCommand.TargetNodesSchema,
|
|
52
|
+
});
|
|
53
|
+
PluginExecutorCommand.ResponseSchema = zod_1.z.object({
|
|
54
|
+
response: zod_1.z.object({
|
|
55
|
+
eventSent: zod_1.z.boolean(),
|
|
56
|
+
}),
|
|
57
|
+
});
|
|
58
|
+
})(PluginExecutorCommand || (exports.PluginExecutorCommand = PluginExecutorCommand = {}));
|
|
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./actions"), exports);
|
|
18
18
|
__exportStar(require("./create-node-plugin.command"), exports);
|
|
19
19
|
__exportStar(require("./delete-node-plugin.command"), exports);
|
|
20
|
+
__exportStar(require("./executor.command"), exports);
|
|
20
21
|
__exportStar(require("./get-node-plugin.command"), exports);
|
|
21
22
|
__exportStar(require("./get-node-plugins.command"), exports);
|
|
22
23
|
__exportStar(require("./update-node-plugin.command"), exports);
|