bdy 1.17.23-dev → 1.17.25-dev
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/distTs/package.json +1 -1
- package/distTs/src/agent/agent.js +59 -21
- package/distTs/src/agent/manager.js +100 -8
- package/distTs/src/command/agent/install.js +6 -2
- package/distTs/src/command/agent/proxy/disable.js +27 -0
- package/distTs/src/command/agent/proxy/enable.js +27 -0
- package/distTs/src/command/agent/proxy/status.js +32 -0
- package/distTs/src/command/agent/proxy.js +15 -0
- package/distTs/src/command/agent/status.js +19 -5
- package/distTs/src/command/agent/tunnel/disable.js +27 -0
- package/distTs/src/command/agent/tunnel/enable.js +27 -0
- package/distTs/src/command/agent/tunnel/status.js +11 -1
- package/distTs/src/command/agent/tunnel.js +4 -0
- package/distTs/src/command/agent.js +2 -0
- package/distTs/src/command/package/publish.js +2 -2
- package/distTs/src/command/tunnel/http.js +1 -1
- package/distTs/src/command/tunnel/start.js +1 -1
- package/distTs/src/command/tunnel/tcp.js +1 -1
- package/distTs/src/command/tunnel/tls.js +1 -1
- package/distTs/src/texts.js +29 -13
- package/distTs/src/tunnel/api/agent.js +18 -0
- package/distTs/src/tunnel/api/buddy.js +35 -3
- package/package.json +1 -1
package/distTs/package.json
CHANGED
|
@@ -17,6 +17,8 @@ class Agent extends events_1.default {
|
|
|
17
17
|
token;
|
|
18
18
|
service;
|
|
19
19
|
target;
|
|
20
|
+
tunneling;
|
|
21
|
+
proxy;
|
|
20
22
|
disabled;
|
|
21
23
|
tunnels;
|
|
22
24
|
tags;
|
|
@@ -25,13 +27,15 @@ class Agent extends events_1.default {
|
|
|
25
27
|
socket;
|
|
26
28
|
manager;
|
|
27
29
|
onRefresh;
|
|
28
|
-
constructor(id, host, token, service, target, tags, api, disabled) {
|
|
30
|
+
constructor(id, host, token, service, target, tunneling, proxy, tags, api, disabled) {
|
|
29
31
|
super();
|
|
30
32
|
this.id = id;
|
|
31
33
|
this.host = host;
|
|
32
34
|
this.token = token;
|
|
33
35
|
this.service = service;
|
|
34
36
|
this.target = target;
|
|
37
|
+
this.tunneling = tunneling;
|
|
38
|
+
this.proxy = proxy;
|
|
35
39
|
this.disabled = disabled;
|
|
36
40
|
this.tunnels = [];
|
|
37
41
|
this.tags = tags || [];
|
|
@@ -80,14 +84,29 @@ class Agent extends events_1.default {
|
|
|
80
84
|
output_1.default.exitError(texts_1.ERR_AGENT_REMOVED);
|
|
81
85
|
}
|
|
82
86
|
else {
|
|
83
|
-
const
|
|
84
|
-
|
|
87
|
+
const hasTunneling = typeof (data.tunneling) === 'boolean';
|
|
88
|
+
const hasProxy = typeof (data.proxy) === 'boolean';
|
|
89
|
+
let shouldFetch = false;
|
|
90
|
+
if (this.target !== data.target) {
|
|
91
|
+
shouldFetch = true;
|
|
92
|
+
this.target = !!data.target;
|
|
93
|
+
}
|
|
94
|
+
if (hasTunneling && this.tunneling !== data.tunneling) {
|
|
95
|
+
shouldFetch = true;
|
|
96
|
+
this.tunneling = data.tunneling;
|
|
97
|
+
}
|
|
98
|
+
if (hasProxy && this.proxy !== data.proxy) {
|
|
99
|
+
shouldFetch = true;
|
|
100
|
+
this.proxy = data.proxy;
|
|
101
|
+
}
|
|
102
|
+
if (shouldFetch)
|
|
103
|
+
this.startStopTunnels();
|
|
85
104
|
this.tags = data.tags || [];
|
|
86
105
|
if (!!data.disabled !== this.disabled) {
|
|
87
106
|
if (data.disabled)
|
|
88
|
-
|
|
107
|
+
this.disable();
|
|
89
108
|
else
|
|
90
|
-
|
|
109
|
+
this.enable();
|
|
91
110
|
}
|
|
92
111
|
if (data.action) {
|
|
93
112
|
try {
|
|
@@ -142,37 +161,49 @@ class Agent extends events_1.default {
|
|
|
142
161
|
this.refreshIn15();
|
|
143
162
|
}
|
|
144
163
|
async start() {
|
|
145
|
-
|
|
146
|
-
this.
|
|
164
|
+
this.tunnels.forEach((t) => {
|
|
165
|
+
if (this.canStartTunnel(t))
|
|
147
166
|
t.start();
|
|
148
|
-
|
|
149
|
-
}
|
|
167
|
+
});
|
|
150
168
|
if (this.socket) {
|
|
151
169
|
this.socket.fetch(!this.disabled, '', null, true, this.getTunnelsUpdate(), true);
|
|
152
170
|
}
|
|
153
171
|
}
|
|
154
|
-
|
|
155
|
-
this.disabled = false;
|
|
172
|
+
startStopTunnels(activate = null, disabled = null, resetFirstHeard = false) {
|
|
156
173
|
this.tunnels.forEach((t) => {
|
|
157
|
-
|
|
174
|
+
if (this.canStartTunnel(t))
|
|
175
|
+
t.start();
|
|
176
|
+
else
|
|
177
|
+
t.stop();
|
|
158
178
|
});
|
|
159
179
|
if (this.socket) {
|
|
160
|
-
this.socket.fetch(
|
|
180
|
+
this.socket.fetch(activate, '', disabled, resetFirstHeard, this.getTunnelsUpdate(), true);
|
|
161
181
|
}
|
|
162
182
|
}
|
|
183
|
+
enable() {
|
|
184
|
+
this.disabled = false;
|
|
185
|
+
this.startStopTunnels(true, false, true);
|
|
186
|
+
}
|
|
163
187
|
async markInactive() {
|
|
164
188
|
if (this.socket) {
|
|
165
189
|
this.socket.fetch(false, '', null, false, this.getTunnelsUpdate(true), true);
|
|
166
190
|
}
|
|
167
191
|
}
|
|
168
|
-
|
|
192
|
+
changeTarget(val) {
|
|
193
|
+
this.target = val;
|
|
194
|
+
this.startStopTunnels();
|
|
195
|
+
}
|
|
196
|
+
changeProxy(val) {
|
|
197
|
+
this.proxy = val;
|
|
198
|
+
this.startStopTunnels();
|
|
199
|
+
}
|
|
200
|
+
changeTunneling(val) {
|
|
201
|
+
this.tunneling = val;
|
|
202
|
+
this.startStopTunnels();
|
|
203
|
+
}
|
|
204
|
+
disable() {
|
|
169
205
|
this.disabled = true;
|
|
170
|
-
this.
|
|
171
|
-
t.stop();
|
|
172
|
-
});
|
|
173
|
-
if (this.socket) {
|
|
174
|
-
this.socket.fetch(!this.disabled, '', this.disabled, false, this.getTunnelsUpdate(), true);
|
|
175
|
-
}
|
|
206
|
+
this.startStopTunnels(false, true);
|
|
176
207
|
}
|
|
177
208
|
async delete() {
|
|
178
209
|
try {
|
|
@@ -277,9 +308,16 @@ class Agent extends events_1.default {
|
|
|
277
308
|
});
|
|
278
309
|
return update;
|
|
279
310
|
}
|
|
311
|
+
canStartTunnel(tunnel) {
|
|
312
|
+
if (this.disabled)
|
|
313
|
+
return false;
|
|
314
|
+
if (!this.proxy && !this.target && tunnel.type === tunnel_2.TUNNEL_TYPE.SSH)
|
|
315
|
+
return false;
|
|
316
|
+
return !(!this.tunneling && tunnel.type !== tunnel_2.TUNNEL_TYPE.SSH);
|
|
317
|
+
}
|
|
280
318
|
addTunnel(tunnel) {
|
|
281
319
|
this.tunnels.push(tunnel);
|
|
282
|
-
if (
|
|
320
|
+
if (this.canStartTunnel(tunnel))
|
|
283
321
|
tunnel.start();
|
|
284
322
|
tunnel.on(tunnel_2.TUNNEL_EVENT.OPEN, () => this.update(true));
|
|
285
323
|
tunnel.on(tunnel_2.TUNNEL_EVENT.CLOSED, () => this.update());
|
|
@@ -142,6 +142,24 @@ class AgentManagerClass {
|
|
|
142
142
|
target: this.agent.target,
|
|
143
143
|
});
|
|
144
144
|
}
|
|
145
|
+
async processAgentTunneling(res) {
|
|
146
|
+
if (!this.agent) {
|
|
147
|
+
this.serverError(res, 'Agent not enabled');
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
this.serverOutput(res, {
|
|
151
|
+
tunneling: this.agent.tunneling,
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
async processAgentProxy(res) {
|
|
155
|
+
if (!this.agent) {
|
|
156
|
+
this.serverError(res, 'Agent not enabled');
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
this.serverOutput(res, {
|
|
160
|
+
proxy: this.agent.proxy,
|
|
161
|
+
});
|
|
162
|
+
}
|
|
145
163
|
async processAgentTargetEnable(res) {
|
|
146
164
|
if (!this.agent) {
|
|
147
165
|
this.serverError(res, 'Agent not enabled');
|
|
@@ -149,7 +167,37 @@ class AgentManagerClass {
|
|
|
149
167
|
}
|
|
150
168
|
try {
|
|
151
169
|
await buddy_1.default.enableTarget(this.id || '', this.host || '', this.token || '');
|
|
152
|
-
this.agent.
|
|
170
|
+
this.agent.changeTarget(true);
|
|
171
|
+
}
|
|
172
|
+
catch (err) {
|
|
173
|
+
this.serverError(res, err.message);
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
this.serverOutput(res, {});
|
|
177
|
+
}
|
|
178
|
+
async processAgentTunnelingEnable(res) {
|
|
179
|
+
if (!this.agent) {
|
|
180
|
+
this.serverError(res, 'Agent not enabled');
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
try {
|
|
184
|
+
await buddy_1.default.enableTunneling(this.id || '', this.host || '', this.token || '');
|
|
185
|
+
this.agent.changeTunneling(true);
|
|
186
|
+
}
|
|
187
|
+
catch (err) {
|
|
188
|
+
this.serverError(res, err.message);
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
this.serverOutput(res, {});
|
|
192
|
+
}
|
|
193
|
+
async processAgentProxyEnable(res) {
|
|
194
|
+
if (!this.agent) {
|
|
195
|
+
this.serverError(res, 'Agent not enabled');
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
try {
|
|
199
|
+
await buddy_1.default.enableProxy(this.id || '', this.host || '', this.token || '');
|
|
200
|
+
this.agent.changeProxy(true);
|
|
153
201
|
}
|
|
154
202
|
catch (err) {
|
|
155
203
|
this.serverError(res, err.message);
|
|
@@ -164,7 +212,37 @@ class AgentManagerClass {
|
|
|
164
212
|
}
|
|
165
213
|
try {
|
|
166
214
|
await buddy_1.default.disableTarget(this.id || '', this.host || '', this.token || '');
|
|
167
|
-
this.agent.
|
|
215
|
+
this.agent.changeTarget(false);
|
|
216
|
+
}
|
|
217
|
+
catch (err) {
|
|
218
|
+
this.serverError(res, err.message);
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
this.serverOutput(res, {});
|
|
222
|
+
}
|
|
223
|
+
async processAgentTunnelingDisable(res) {
|
|
224
|
+
if (!this.agent) {
|
|
225
|
+
this.serverError(res, 'Agent not enabled');
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
try {
|
|
229
|
+
await buddy_1.default.disableTunneling(this.id || '', this.host || '', this.token || '');
|
|
230
|
+
this.agent.changeTunneling(false);
|
|
231
|
+
}
|
|
232
|
+
catch (err) {
|
|
233
|
+
this.serverError(res, err.message);
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
this.serverOutput(res, {});
|
|
237
|
+
}
|
|
238
|
+
async processAgentProxyDisable(res) {
|
|
239
|
+
if (!this.agent) {
|
|
240
|
+
this.serverError(res, 'Agent not enabled');
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
try {
|
|
244
|
+
await buddy_1.default.disableProxy(this.id || '', this.host || '', this.token || '');
|
|
245
|
+
this.agent.changeProxy(false);
|
|
168
246
|
}
|
|
169
247
|
catch (err) {
|
|
170
248
|
this.serverError(res, err.message);
|
|
@@ -178,7 +256,9 @@ class AgentManagerClass {
|
|
|
178
256
|
status: this.status,
|
|
179
257
|
version: (0, utils_1.getVersion)(),
|
|
180
258
|
enabled: !this.agent?.disabled,
|
|
181
|
-
target: !!this.agent?.target
|
|
259
|
+
target: !!this.agent?.target,
|
|
260
|
+
tunneling: !!this.agent?.tunneling,
|
|
261
|
+
proxy: !!this.agent?.proxy
|
|
182
262
|
});
|
|
183
263
|
}
|
|
184
264
|
processBody(req) {
|
|
@@ -302,16 +382,16 @@ class AgentManagerClass {
|
|
|
302
382
|
}
|
|
303
383
|
output_1.default.exitError(txt);
|
|
304
384
|
}
|
|
305
|
-
|
|
385
|
+
agentDisable() {
|
|
306
386
|
if (!this.agent)
|
|
307
387
|
return false;
|
|
308
|
-
|
|
388
|
+
this.agent.disable();
|
|
309
389
|
return true;
|
|
310
390
|
}
|
|
311
|
-
|
|
391
|
+
agentEnable() {
|
|
312
392
|
if (!this.agent)
|
|
313
393
|
return false;
|
|
314
|
-
|
|
394
|
+
this.agent.enable();
|
|
315
395
|
return true;
|
|
316
396
|
}
|
|
317
397
|
async processAgentEnable(res) {
|
|
@@ -343,7 +423,7 @@ class AgentManagerClass {
|
|
|
343
423
|
this.serverError(res, 'Agent not enabled');
|
|
344
424
|
return;
|
|
345
425
|
}
|
|
346
|
-
const saved =
|
|
426
|
+
const saved = this.agentDisable();
|
|
347
427
|
if (!saved) {
|
|
348
428
|
this.serverError(res, 'Something went wrong');
|
|
349
429
|
return;
|
|
@@ -385,6 +465,10 @@ class AgentManagerClass {
|
|
|
385
465
|
return this.processStatus(res);
|
|
386
466
|
if (req.url === '/target')
|
|
387
467
|
return this.processAgentTarget(res);
|
|
468
|
+
if (req.url === '/tunneling')
|
|
469
|
+
return this.processAgentTunneling(res);
|
|
470
|
+
if (req.url === '/proxy')
|
|
471
|
+
return this.processAgentProxy(res);
|
|
388
472
|
if (req.url === '/agent/tags')
|
|
389
473
|
return this.processAgentTags(res);
|
|
390
474
|
if (req.url === '/agent/tags/set')
|
|
@@ -393,6 +477,14 @@ class AgentManagerClass {
|
|
|
393
477
|
return this.processAgentTargetEnable(res);
|
|
394
478
|
if (req.url === '/target/disable')
|
|
395
479
|
return this.processAgentTargetDisable(res);
|
|
480
|
+
if (req.url === '/tunneling/enable')
|
|
481
|
+
return this.processAgentTunnelingEnable(res);
|
|
482
|
+
if (req.url === '/tunneling/disable')
|
|
483
|
+
return this.processAgentTunnelingDisable(res);
|
|
484
|
+
if (req.url === '/proxy/enable')
|
|
485
|
+
return this.processAgentProxyEnable(res);
|
|
486
|
+
if (req.url === '/proxy/disable')
|
|
487
|
+
return this.processAgentProxyDisable(res);
|
|
396
488
|
if (req.url === '/tunnels')
|
|
397
489
|
return this.processTunnels(res);
|
|
398
490
|
if (req.url === '/tunnel/add')
|
|
@@ -75,6 +75,8 @@ const installService = async (options) => {
|
|
|
75
75
|
const { token, host } = await input_1.default.tunnelToken(addToken);
|
|
76
76
|
const port = input_1.default.port(options.port);
|
|
77
77
|
const target = !!options.target;
|
|
78
|
+
const tunneling = !!options.tunneling;
|
|
79
|
+
const proxy = !!options.proxy;
|
|
78
80
|
let agent;
|
|
79
81
|
if (id) {
|
|
80
82
|
try {
|
|
@@ -86,7 +88,7 @@ const installService = async (options) => {
|
|
|
86
88
|
}
|
|
87
89
|
if (!agent) {
|
|
88
90
|
const tags = prepareTags(options.tag);
|
|
89
|
-
agent = await buddy_1.default.register(true, target, host, token, tags, (region) => {
|
|
91
|
+
agent = await buddy_1.default.register(true, target, tunneling, proxy, host, token, tags, (region) => {
|
|
90
92
|
cfg_1.default.setRegionIfNotSet(region);
|
|
91
93
|
});
|
|
92
94
|
id = agent.id;
|
|
@@ -153,7 +155,7 @@ const installApp = async (options) => {
|
|
|
153
155
|
const tags = prepareTags(options.tag);
|
|
154
156
|
try {
|
|
155
157
|
output_1.default.normal(texts_1.TXT_AGENT_STANDALONE_AGENT_REGISTERING, false);
|
|
156
|
-
const agent = await buddy_1.default.register(true, !!options.target, host, token, tags, (region) => {
|
|
158
|
+
const agent = await buddy_1.default.register(true, !!options.target, !!options.tunneling, !!options.proxy, host, token, tags, (region) => {
|
|
157
159
|
cfg_1.default.setRegionIfNotSet(region);
|
|
158
160
|
});
|
|
159
161
|
logger_1.default.info(texts_1.TXT_AGENT_STANDALONE_AGENT_REGISTERED);
|
|
@@ -211,6 +213,8 @@ commandAgentInstall.option('-u, --user <user>', texts_1.OPTION_USER);
|
|
|
211
213
|
commandAgentInstall.option('-a,--app', texts_1.OPTION_APP);
|
|
212
214
|
commandAgentInstall.option('--pass <password>', texts_1.OPTION_PASS);
|
|
213
215
|
commandAgentInstall.option('--target', texts_1.OPTION_AGENT_TARGET);
|
|
216
|
+
commandAgentInstall.option('--proxy', texts_1.OPTION_AGENT_PROXY);
|
|
217
|
+
commandAgentInstall.option('--tunneling', texts_1.OPTION_AGENT_TUNNELING, true);
|
|
214
218
|
commandAgentInstall.option('--tag <tag...>', texts_1.OPTION_AGENT_TAG);
|
|
215
219
|
commandAgentInstall.option('-d, --debug', texts_1.OPTION_AGENT_DEBUG);
|
|
216
220
|
commandAgentInstall.action(async (options) => {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const utils_1 = require("../../../utils");
|
|
7
|
+
const texts_1 = require("../../../texts");
|
|
8
|
+
const output_1 = __importDefault(require("../../../output"));
|
|
9
|
+
const agent_1 = __importDefault(require("../../../tunnel/api/agent"));
|
|
10
|
+
const commandAgentProxyDisable = (0, utils_1.newCommand)('disable', texts_1.DESC_COMMAND_AGENT_PROXY_DISABLE);
|
|
11
|
+
commandAgentProxyDisable.action(async () => {
|
|
12
|
+
if (!commandAgentProxyDisable.agentInstalled) {
|
|
13
|
+
output_1.default.exitError(texts_1.ERR_AGENT_NOT_INSTALLED);
|
|
14
|
+
}
|
|
15
|
+
if (!commandAgentProxyDisable.agentStatus) {
|
|
16
|
+
output_1.default.exitError(texts_1.ERR_AGENT_NOT_RUNNING);
|
|
17
|
+
}
|
|
18
|
+
try {
|
|
19
|
+
const api = new agent_1.default(commandAgentProxyDisable.agentPort || 0);
|
|
20
|
+
await api.disableAgentProxy();
|
|
21
|
+
output_1.default.exitSuccess(texts_1.TXT_AGENT_PROXY_DISABLED);
|
|
22
|
+
}
|
|
23
|
+
catch (err) {
|
|
24
|
+
output_1.default.exitError(err);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
exports.default = commandAgentProxyDisable;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const utils_1 = require("../../../utils");
|
|
7
|
+
const texts_1 = require("../../../texts");
|
|
8
|
+
const output_1 = __importDefault(require("../../../output"));
|
|
9
|
+
const agent_1 = __importDefault(require("../../../tunnel/api/agent"));
|
|
10
|
+
const commandAgentProxyEnable = (0, utils_1.newCommand)('enable', texts_1.DESC_COMMAND_AGENT_PROXY_ENABLE);
|
|
11
|
+
commandAgentProxyEnable.action(async () => {
|
|
12
|
+
if (!commandAgentProxyEnable.agentInstalled) {
|
|
13
|
+
output_1.default.exitError(texts_1.ERR_AGENT_NOT_INSTALLED);
|
|
14
|
+
}
|
|
15
|
+
if (!commandAgentProxyEnable.agentStatus) {
|
|
16
|
+
output_1.default.exitError(texts_1.ERR_AGENT_NOT_RUNNING);
|
|
17
|
+
}
|
|
18
|
+
try {
|
|
19
|
+
const api = new agent_1.default(commandAgentProxyEnable.agentPort || 0);
|
|
20
|
+
await api.enableAgentProxy();
|
|
21
|
+
output_1.default.exitSuccess(texts_1.TXT_AGENT_TARGET_ENABLED);
|
|
22
|
+
}
|
|
23
|
+
catch (err) {
|
|
24
|
+
output_1.default.exitError(err);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
exports.default = commandAgentProxyEnable;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const utils_1 = require("../../../utils");
|
|
7
|
+
const texts_1 = require("../../../texts");
|
|
8
|
+
const output_1 = __importDefault(require("../../../output"));
|
|
9
|
+
const agent_1 = __importDefault(require("../../../tunnel/api/agent"));
|
|
10
|
+
const commandAgentProxyStatus = (0, utils_1.newCommand)('status', texts_1.DESC_COMMAND_AGENT_PROXY_STATUS);
|
|
11
|
+
commandAgentProxyStatus.action(async () => {
|
|
12
|
+
if (!commandAgentProxyStatus.agentInstalled) {
|
|
13
|
+
output_1.default.exitError(texts_1.ERR_AGENT_NOT_INSTALLED);
|
|
14
|
+
}
|
|
15
|
+
if (!commandAgentProxyStatus.agentStatus) {
|
|
16
|
+
output_1.default.exitError(texts_1.ERR_AGENT_NOT_RUNNING);
|
|
17
|
+
}
|
|
18
|
+
try {
|
|
19
|
+
const api = new agent_1.default(commandAgentProxyStatus.agentPort || 0);
|
|
20
|
+
const data = await api.fetchAgentProxy();
|
|
21
|
+
if (data.proxy) {
|
|
22
|
+
output_1.default.exitSuccess(texts_1.TXT_AGENT_PROXY_ENABLED);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
output_1.default.exitError(texts_1.TXT_AGENT_PROXY_DISABLED);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
output_1.default.exitError(err);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
exports.default = commandAgentProxyStatus;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const utils_1 = require("../../utils");
|
|
7
|
+
const texts_1 = require("../../texts");
|
|
8
|
+
const status_1 = __importDefault(require("./proxy/status"));
|
|
9
|
+
const disable_1 = __importDefault(require("./proxy/disable"));
|
|
10
|
+
const enable_1 = __importDefault(require("./proxy/enable"));
|
|
11
|
+
const commandAgentProxy = (0, utils_1.newCommand)('proxy', texts_1.DESC_COMMAND_AGENT_PROXY);
|
|
12
|
+
commandAgentProxy.addCommand(status_1.default);
|
|
13
|
+
commandAgentProxy.addCommand(enable_1.default);
|
|
14
|
+
commandAgentProxy.addCommand(disable_1.default);
|
|
15
|
+
exports.default = commandAgentProxy;
|
|
@@ -8,7 +8,7 @@ const texts_1 = require("../../texts");
|
|
|
8
8
|
const utils_1 = require("../../utils");
|
|
9
9
|
const tunnel_1 = require("../../types/tunnel");
|
|
10
10
|
const commandAgentStatus = (0, utils_1.newCommand)('status', texts_1.DESC_COMMAND_AGENT_STATUS);
|
|
11
|
-
const outputStatus = (installed, standalone, version, id, running, enabled, target, status) => {
|
|
11
|
+
const outputStatus = (installed, standalone, version, id, running, enabled, target, tunneling, proxy, status) => {
|
|
12
12
|
if (!installed) {
|
|
13
13
|
output_1.default.exitError(texts_1.ERR_AGENT_NOT_INSTALLED);
|
|
14
14
|
}
|
|
@@ -29,9 +29,19 @@ const outputStatus = (installed, standalone, version, id, running, enabled, targ
|
|
|
29
29
|
output_1.default.normal(', ', false);
|
|
30
30
|
if (enabled) {
|
|
31
31
|
output_1.default.green('enabled');
|
|
32
|
-
let msg = 'Enabled:
|
|
33
|
-
if (target)
|
|
34
|
-
msg += '
|
|
32
|
+
let msg = 'Enabled: ';
|
|
33
|
+
if (!target && !tunneling && !proxy)
|
|
34
|
+
msg += 'Nothing';
|
|
35
|
+
else {
|
|
36
|
+
const opts = [];
|
|
37
|
+
if (tunneling)
|
|
38
|
+
opts.push('Tunnels');
|
|
39
|
+
if (target)
|
|
40
|
+
opts.push('Target');
|
|
41
|
+
if (proxy)
|
|
42
|
+
opts.push('Proxy for targets');
|
|
43
|
+
msg += opts.join(', ');
|
|
44
|
+
}
|
|
35
45
|
output_1.default.normal(msg);
|
|
36
46
|
}
|
|
37
47
|
else {
|
|
@@ -49,13 +59,17 @@ commandAgentStatus.action(async () => {
|
|
|
49
59
|
const running = !!commandAgentStatus.agentStatus;
|
|
50
60
|
let enabled = true;
|
|
51
61
|
let target = false;
|
|
62
|
+
let tunneling = true;
|
|
63
|
+
let proxy = false;
|
|
52
64
|
let status = tunnel_1.TUNNEL_AGENT_STATUS.DISABLED;
|
|
53
65
|
if (commandAgentStatus.agentStatus) {
|
|
54
66
|
version = commandAgentStatus.agentStatus.version;
|
|
55
67
|
enabled = commandAgentStatus.agentStatus.enabled;
|
|
56
68
|
status = commandAgentStatus.agentStatus.status;
|
|
57
69
|
target = commandAgentStatus.agentStatus.target;
|
|
70
|
+
tunneling = commandAgentStatus.agentStatus.tunneling;
|
|
71
|
+
proxy = commandAgentStatus.agentStatus.proxy;
|
|
58
72
|
}
|
|
59
|
-
outputStatus(!!commandAgentStatus.agentInstalled, !!commandAgentStatus.agentStandalone, version, id, running, enabled, target, status);
|
|
73
|
+
outputStatus(!!commandAgentStatus.agentInstalled, !!commandAgentStatus.agentStandalone, version, id, running, enabled, target, tunneling, proxy, status);
|
|
60
74
|
});
|
|
61
75
|
exports.default = commandAgentStatus;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const utils_1 = require("../../../utils");
|
|
7
|
+
const texts_1 = require("../../../texts");
|
|
8
|
+
const output_1 = __importDefault(require("../../../output"));
|
|
9
|
+
const agent_1 = __importDefault(require("../../../tunnel/api/agent"));
|
|
10
|
+
const commandAgentTunnelDisable = (0, utils_1.newCommand)('disable', texts_1.DESC_COMMAND_AGENT_TUNNELING_DISABLE);
|
|
11
|
+
commandAgentTunnelDisable.action(async () => {
|
|
12
|
+
if (!commandAgentTunnelDisable.agentInstalled) {
|
|
13
|
+
output_1.default.exitError(texts_1.ERR_AGENT_NOT_INSTALLED);
|
|
14
|
+
}
|
|
15
|
+
if (!commandAgentTunnelDisable.agentStatus) {
|
|
16
|
+
output_1.default.exitError(texts_1.ERR_AGENT_NOT_RUNNING);
|
|
17
|
+
}
|
|
18
|
+
try {
|
|
19
|
+
const api = new agent_1.default(commandAgentTunnelDisable.agentPort || 0);
|
|
20
|
+
await api.disableAgentTunneling();
|
|
21
|
+
output_1.default.exitSuccess(texts_1.TXT_AGENT_TUNNELING_DISABLED);
|
|
22
|
+
}
|
|
23
|
+
catch (err) {
|
|
24
|
+
output_1.default.exitError(err);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
exports.default = commandAgentTunnelDisable;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const utils_1 = require("../../../utils");
|
|
7
|
+
const texts_1 = require("../../../texts");
|
|
8
|
+
const output_1 = __importDefault(require("../../../output"));
|
|
9
|
+
const agent_1 = __importDefault(require("../../../tunnel/api/agent"));
|
|
10
|
+
const commandAgentTunnelEnable = (0, utils_1.newCommand)('enable', texts_1.DESC_COMMAND_AGENT_TUNNELING_ENABLE);
|
|
11
|
+
commandAgentTunnelEnable.action(async () => {
|
|
12
|
+
if (!commandAgentTunnelEnable.agentInstalled) {
|
|
13
|
+
output_1.default.exitError(texts_1.ERR_AGENT_NOT_INSTALLED);
|
|
14
|
+
}
|
|
15
|
+
if (!commandAgentTunnelEnable.agentStatus) {
|
|
16
|
+
output_1.default.exitError(texts_1.ERR_AGENT_NOT_RUNNING);
|
|
17
|
+
}
|
|
18
|
+
try {
|
|
19
|
+
const api = new agent_1.default(commandAgentTunnelEnable.agentPort || 0);
|
|
20
|
+
await api.enableAgentTunneling();
|
|
21
|
+
output_1.default.exitSuccess(texts_1.TXT_AGENT_TUNNELING_ENABLED);
|
|
22
|
+
}
|
|
23
|
+
catch (err) {
|
|
24
|
+
output_1.default.exitError(err);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
exports.default = commandAgentTunnelEnable;
|
|
@@ -10,7 +10,7 @@ const tunnel_1 = __importDefault(require("../../../agent/socket/tunnel"));
|
|
|
10
10
|
const utils_1 = require("../../../utils");
|
|
11
11
|
const commandAgentTunnelStatus = (0, utils_1.newCommand)('status', texts_1.DESC_COMMAND_AGENT_TUNNEL_STATUS);
|
|
12
12
|
commandAgentTunnelStatus.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_AGENT_TUNNEL_STATUS}`);
|
|
13
|
-
commandAgentTunnelStatus.argument('
|
|
13
|
+
commandAgentTunnelStatus.argument('[id]', texts_1.OPTION_ID);
|
|
14
14
|
commandAgentTunnelStatus.action(async (id) => {
|
|
15
15
|
if (!commandAgentTunnelStatus.agentInstalled) {
|
|
16
16
|
output_1.default.exitError(texts_1.ERR_AGENT_NOT_INSTALLED);
|
|
@@ -20,6 +20,16 @@ commandAgentTunnelStatus.action(async (id) => {
|
|
|
20
20
|
}
|
|
21
21
|
try {
|
|
22
22
|
const api = new agent_1.default(commandAgentTunnelStatus.agentPort || 0);
|
|
23
|
+
if (!id) {
|
|
24
|
+
const data = await api.fetchAgentTunneling();
|
|
25
|
+
if (data.tunneling) {
|
|
26
|
+
output_1.default.exitSuccess(texts_1.TXT_AGENT_TUNNELING_ENABLED);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
output_1.default.exitError(texts_1.TXT_AGENT_TUNNELING_DISABLED);
|
|
30
|
+
}
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
23
33
|
const ws = await api.socketTunnel(id);
|
|
24
34
|
const tunnel = new tunnel_1.default(ws, id);
|
|
25
35
|
await tunnel.waitForReady();
|
|
@@ -12,6 +12,8 @@ const start_1 = __importDefault(require("./tunnel/start"));
|
|
|
12
12
|
const texts_1 = require("../../texts");
|
|
13
13
|
const status_1 = __importDefault(require("./tunnel/status"));
|
|
14
14
|
const utils_1 = require("../../utils");
|
|
15
|
+
const enable_1 = __importDefault(require("./tunnel/enable"));
|
|
16
|
+
const disable_1 = __importDefault(require("./tunnel/disable"));
|
|
15
17
|
const commandAgentTunnel = (0, utils_1.newCommand)('tunnel', texts_1.DESC_COMMAND_AGENT_TUNNEL);
|
|
16
18
|
commandAgentTunnel.addCommand(tcp_1.default);
|
|
17
19
|
commandAgentTunnel.addCommand(tls_1.default);
|
|
@@ -20,6 +22,8 @@ commandAgentTunnel.addCommand(start_1.default);
|
|
|
20
22
|
commandAgentTunnel.addCommand(remove_1.default);
|
|
21
23
|
commandAgentTunnel.addCommand(list_1.default);
|
|
22
24
|
commandAgentTunnel.addCommand(status_1.default);
|
|
25
|
+
commandAgentTunnel.addCommand(enable_1.default);
|
|
26
|
+
commandAgentTunnel.addCommand(disable_1.default);
|
|
23
27
|
commandAgentTunnel.addHelpText('after', `\nEXAMPLES:${(0, texts_1.EXAMPLE_TUNNEL_HTTP)(true)}
|
|
24
28
|
${(0, texts_1.EXAMPLE_TUNNEL_TLS)(true)}
|
|
25
29
|
${(0, texts_1.EXAMPLE_TUNNEL_TCP)(true)}
|
|
@@ -20,6 +20,7 @@ const enable_1 = __importDefault(require("./agent/enable"));
|
|
|
20
20
|
const disable_1 = __importDefault(require("./agent/disable"));
|
|
21
21
|
const debug_1 = __importDefault(require("./agent/debug"));
|
|
22
22
|
const tags_1 = __importDefault(require("./agent/tags"));
|
|
23
|
+
const proxy_1 = __importDefault(require("./agent/proxy"));
|
|
23
24
|
const commandAgent = (0, utils_1.newCommand)('agent', texts_1.DESC_COMMAND_AGENT);
|
|
24
25
|
commandAgent.addCommand(install_1.default);
|
|
25
26
|
commandAgent.addCommand(enable_1.default);
|
|
@@ -31,6 +32,7 @@ commandAgent.addCommand(uninstall_1.default);
|
|
|
31
32
|
commandAgent.addCommand(status_1.default);
|
|
32
33
|
commandAgent.addCommand(tunnel_1.default);
|
|
33
34
|
commandAgent.addCommand(target_1.default);
|
|
35
|
+
commandAgent.addCommand(proxy_1.default);
|
|
34
36
|
commandAgent.addCommand(tags_1.default);
|
|
35
37
|
commandAgent.addCommand(update_1.default);
|
|
36
38
|
commandAgent.addCommand(version_1.default);
|
|
@@ -161,8 +161,8 @@ const addEntryToZip = (dirPath, zip, entry) => {
|
|
|
161
161
|
name += '/';
|
|
162
162
|
else
|
|
163
163
|
name = name.replace(/^\//, '');
|
|
164
|
-
const file = new fflate_1.default.
|
|
165
|
-
level:
|
|
164
|
+
const file = new fflate_1.default.ZipDeflate(name, {
|
|
165
|
+
level: 3,
|
|
166
166
|
});
|
|
167
167
|
zip.add(file);
|
|
168
168
|
if (isDir) {
|
|
@@ -20,7 +20,7 @@ commandHttp.action(async (target, options) => {
|
|
|
20
20
|
const { host, token } = await input_1.default.tunnelToken(options.token);
|
|
21
21
|
const prepared = await cfg_1.default.prepareTunnel(tunnel_1.TUNNEL_TYPE.HTTP, target, options, true);
|
|
22
22
|
await output_1.default.spinner(texts_1.TXT_OPENING_TUNNEL);
|
|
23
|
-
const agent = await buddy_1.default.register(false, false, host, token, [], (region) => {
|
|
23
|
+
const agent = await buddy_1.default.register(false, false, true, false, host, token, [], (region) => {
|
|
24
24
|
cfg_1.default.setRegionIfNotSet(region);
|
|
25
25
|
});
|
|
26
26
|
await agent.start();
|
|
@@ -20,7 +20,7 @@ commandStart.action(async (name, options) => {
|
|
|
20
20
|
const { token, host } = await input_1.default.tunnelToken(options.token);
|
|
21
21
|
const prepared = cfg_1.default.getTunnel(name);
|
|
22
22
|
await output_1.default.spinner(texts_1.TXT_OPENING_TUNNEL);
|
|
23
|
-
const agent = await buddy_1.default.register(false, false, host, token, [], (region) => {
|
|
23
|
+
const agent = await buddy_1.default.register(false, false, true, false, host, token, [], (region) => {
|
|
24
24
|
cfg_1.default.setRegionIfNotSet(region);
|
|
25
25
|
});
|
|
26
26
|
await agent.start();
|
|
@@ -19,7 +19,7 @@ commandTcp.action(async (target, options) => {
|
|
|
19
19
|
const { host, token } = await input_1.default.tunnelToken(options.token);
|
|
20
20
|
const prepared = await cfg_1.default.prepareTunnel(tunnel_1.TUNNEL_TYPE.TCP, target, options, true);
|
|
21
21
|
await output_1.default.spinner(texts_1.TXT_OPENING_TUNNEL);
|
|
22
|
-
const agent = await buddy_1.default.register(false, false, host, token, [], (region) => {
|
|
22
|
+
const agent = await buddy_1.default.register(false, false, true, false, host, token, [], (region) => {
|
|
23
23
|
cfg_1.default.setRegionIfNotSet(region);
|
|
24
24
|
});
|
|
25
25
|
await agent.start();
|
|
@@ -19,7 +19,7 @@ commandTls.action(async (target, options) => {
|
|
|
19
19
|
const { token, host } = await input_1.default.tunnelToken(options.token);
|
|
20
20
|
const prepared = await cfg_1.default.prepareTunnel(tunnel_1.TUNNEL_TYPE.TLS, target, options, true);
|
|
21
21
|
await output_1.default.spinner(texts_1.TXT_OPENING_TUNNEL);
|
|
22
|
-
const agent = await buddy_1.default.register(false, false, host, token, [], (region) => {
|
|
22
|
+
const agent = await buddy_1.default.register(false, false, true, false, host, token, [], (region) => {
|
|
23
23
|
cfg_1.default.setRegionIfNotSet(region);
|
|
24
24
|
});
|
|
25
25
|
await agent.start();
|
package/distTs/src/texts.js
CHANGED
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ERR_USER_AGENT_IS_NOT_VALID = exports.ERR_BA_IS_NOT_VALID = exports.ERR_BA_LOGIN_NOT_PROVIDED = exports.ERR_BA_PASSWORD_NOT_PROVIDED = exports.ERR_CB_THRESHOLD_IS_NOT_VALID = exports.ERR_CERT_PATH_IS_NOT_VALID = exports.ERR_KEY_PATH_IS_NOT_VALID = exports.ERR_CA_PATH_IS_NOT_VALID = exports.ERR_WRONG_CA = exports.ERR_WRONG_KEY_CERT = exports.ERR_NAME_WITHOUT_ASTERISK = exports.ERR_PORT_IS_NOT_VALID = exports.ERR_REGION_IS_NOT_VALID = exports.ERR_PATH_IS_NOT_DIRECTORY = exports.ERR_DIRECTORY_DOES_NOT_EXISTS = exports.ERR_TERMINATE_IS_NOT_VALID = exports.ERR_TIMEOUT_IS_NOT_VALID = exports.ERR_TYPE_IS_NOT_VALID = exports.ERR_TARGET_IS_NOT_VALID = exports.ERR_SAVING_AGENT_CONFIG = exports.ERR_AGENT_NOT_REGISTERED = exports.ERR_RUN_PIPELINE_WRONG_VARIABLE = exports.ERR_RUN_PIPELINE_WRONG_ACTION = exports.ERR_RUN_PIPELINE_WRONG_DELAY = exports.ERR_RUN_PIPELINE_WRONG_PRIORITY = exports.ERR_RUN_PIPELINE_WAIT_TIMEOUT = exports.ERR_SANDBOX_EXEC_RUNTIME_NOT_FOUND = exports.ERR_PACKAGE_VERSIONS_NOT_FOUND = exports.ERR_PACKAGE_NOT_FOUND = exports.ERR_PACKAGE_VERSION_NOT_FOUND = exports.ERR_PACKAGE_VERSION_EXISTS = exports.ERR_PACKAGE_PUBLISH_NOT_FOUND = exports.ERR_PACKAGE_DOWNLOAD_NOT_FOUND = exports.ERR_PIPELINE_NOT_FOUND = exports.ERR_PROJECT_NOT_FOUND = exports.ERR_WORKSPACE_NOT_FOUND = exports.ERR_REST_API_YAML_NOT_FOUND = exports.ERR_REST_API_YAML = exports.ERR_REST_API_PROJECT = exports.ERR_REST_API_WORKSPACE = exports.ERR_PATH_NOT_EXISTS = exports.ERR_REST_API_REGION = exports.ERR_REST_API_URL = exports.ERR_REST_API_TOKEN = exports.ERR_REST_API_RATE_LIMIT = exports.ERR_REST_API_RESOURCE_NOT_FOUND = exports.ERR_REST_API_WRONG_TOKEN = exports.ERR_REST_API_CONNECT_ERROR = exports.ERR_REST_API_NOT_RESPONDING = exports.ERR_REST_API_GENERAL_ERROR = void 0;
|
|
4
4
|
exports.ERR_INVALID_CLOSE_SESSION_RESPONSE = exports.ERR_INVALID_SNAPSHOTS_RESPONSE = exports.ERR_INVALID_SNAPSHOT_RESPONSE = exports.ERR_MISSING_URLS = exports.ERR_RESOURCE_NOT_FOUND = exports.ERR_MISSING_EXEC_COMMAND = exports.ERR_PARSING_STORIES = exports.ERR_UNSUPPORTED_STORYBOOK = exports.ERR_MISSING_STORYBOOK_INDEX_FILE = exports.ERR_WRONG_STORYBOOK_DIRECTORY = exports.ERR_MISSING_BUILD_ID = exports.ERR_MISSING_UT_TOKEN = exports.ERR_MISSING_VT_TOKEN = exports.ERR_CONFIG_CORRUPTED = exports.ERR_WRONG_TOKEN = exports.ERR_TOKEN_NOT_PROVIDED = exports.ERR_CANT_CREATE_DIR_IN_HOME = exports.ERR_CONNECTION_ERROR = exports.ERR_CONNECTION_TIMEOUT = exports.ERR_WRONG_STREAM = exports.ERR_WRONG_HANDSHAKE = exports.ERR_FETCH_VERSION = exports.ERR_PACKAGE_DOWNLOAD_REPLACE = exports.ERR_PACKAGE_DOWNLOAD_NOT_EMPTY_DIR = exports.ERR_PACKAGE_DOWNLOAD_IS_FILE = exports.ERR_PACKAGE_DOWNLOAD_READDIR = exports.ERR_PACKAGE_DOWNLOAD_MKDIR = exports.ERR_SWW = exports.ERR_NOT_FOUND = exports.ERR_FAILED_TO_CONNECT_TO_AGENT = exports.ERR_TUNNEL_REMOVED = exports.ERR_TUNNELS_DISABLED = exports.ERR_AGENT_LIMIT_REACHED = exports.ERR_TUNNEL_TARGET_INVALID = exports.ERR_WORKSPACE_FLAGGED = exports.ERR_TUNNEL_LIMIT_REACHED = exports.ERR_DOMAIN_RESTRICTED = exports.ERR_AGENT_REMOVED = exports.ERR_FAILED_TO_CONNECT = exports.ERR_TUNNEL_ALREADY_EXISTS = exports.ERR_AGENT_NOT_SUPPORTED = exports.ERR_AGENT_ADMIN_RIGHTS = exports.ERR_SWW_AGENT_UPDATING = exports.ERR_SWW_AGENT_ENABLING = exports.ERR_AGENT_TAG_INVALID = exports.ERR_AGENT_NOT_FOUND = exports.ERR_AGENT_NOT_RUNNING = exports.ERR_AGENT_NOT_INSTALLED = exports.ERR_TUNNEL_NOT_FOUND = exports.ERR_WHITELIST_IS_NOT_VALID = void 0;
|
|
5
|
-
exports.
|
|
6
|
-
exports.
|
|
7
|
-
exports.
|
|
8
|
-
exports.
|
|
9
|
-
exports.
|
|
10
|
-
exports.
|
|
11
|
-
exports.
|
|
12
|
-
exports.
|
|
13
|
-
exports.
|
|
14
|
-
exports.
|
|
15
|
-
exports.
|
|
16
|
-
exports.EXAMPLE_PACKAGE_VERSION_DELETE = exports.EXAMPLE_PACKAGE_VERSION_GET = exports.EXAMPLE_PACKAGE_VERSION_LIST = exports.EXAMPLE_PACKAGE_CREATE = exports.EXAMPLE_PACKAGE_DELETE = exports.EXAMPLE_PACKAGE_DOWNLOAD = void 0;
|
|
5
|
+
exports.DESC_COMMAND_CONFIG_ADD_TCP = exports.DESC_COMMAND_CONFIG_ADD_HTTP = exports.AGENT_FETCH_RETRY = exports.NO_TUNNELS_STARTED = exports.TXT_AGENT_STANDALONE_EXITING = exports.TXT_AGENT_STANDALONE_STARTED = exports.TXT_AGENT_STANDALONE_AGENT_REGISTER_ERROR = exports.TXT_AGENT_STANDALONE_AGENT_REGISTERED = exports.TXT_AGENT_STANDALONE_AGENT_REGISTERING = exports.TXT_AGENT_STANDALONE_AGENT_FETCH_ERROR = exports.TXT_AGENT_STANDALONE_AGENT_FETCHED = exports.TXT_AGENT_STANDALONE_AGENT_FETCHING = exports.TXT_TUNNEL_ADDED = exports.TXT_TUNNEL_REMOVED = exports.TXT_REGION_SAVED = exports.TXT_TIMEOUT_SAVED = exports.TXT_TOKEN_REMOVED = exports.TXT_TOKEN_SAVED = exports.TXT_WHITELIST_SAVED = exports.TXT_TUNNEL_STOPPED = exports.TXT_TUNNEL_STARTED = exports.TXY_AGENT_CONFIRM_DELETE = exports.TXT_AGENT_DISABLED = exports.TXT_AGENT_ALREADY_INSTALLED = exports.TXT_AGENT_UPDATED = exports.TXT_AGENT_INSTALLED = exports.TXT_AGENT_NO_TAGS = exports.TXT_AGENT_TAGS_SET = exports.TXT_AGENT_TUNNELING_DISABLED = exports.TXT_AGENT_TUNNELING_ENABLED = exports.TXT_AGENT_PROXY_DISABLED = exports.TXT_AGENT_PROXY_ENABLED = exports.TXT_AGENT_TARGET_DISABLED = exports.TXT_AGENT_TARGET_ENABLED = exports.TXT_AGENT_RESTARTED = exports.TXT_AGENT_DEBUG_OFF = exports.TXT_AGENT_DEBUG_ON = exports.TXT_AGENT_STARTED = exports.TXT_AGENT_STOPPED = exports.WARN_BROWSER_VERSION = exports.ERR_RESOURCE_DISCOVERY = exports.ERR_NO_SNAPSHOTS_TO_SEND = exports.ERR_INVALID_SNAPSHOT = exports.ERR_TEST_EXECUTION = exports.ERR_INVALID_JSON = exports.ERR_INVALID_DOWNLOAD_RESPONSE = exports.ERR_INVALID_SCRAPE_RESPONSE = exports.ERR_INVALID_COMPARE_LINKS_RESPONSE = exports.ERR_INVALID_STORYBOOK_RESPONSE = exports.ERR_INVALID_DEFAULT_SETTINGS_RESPONSE = void 0;
|
|
6
|
+
exports.DESC_COMMAND_TUNNEL = exports.DESC_COMMAND_AGENT = exports.DESC_COMMAND_HTTP = exports.DESC_COMMAND_CONFIG = exports.DESC_COMMAND_AGENT_VERSION = exports.DESC_COMMAND_AGENT_UPDATE = exports.OPT_COMMAND_AGENT_TAGS_SET = exports.DESC_COMMAND_AGENT_TAGS_SET = exports.DESC_COMMAND_AGENT_TAGS_GET = exports.DESC_COMMAND_AGENT_TAGS = exports.DESC_COMMAND_AGENT_PROXY = exports.DESC_COMMAND_AGENT_TARGET = exports.DESC_COMMAND_AGENT_TUNNEL = exports.DESC_COMMAND_AGENT_STOP = exports.DESC_COMMAND_AGENT_PROXY_DISABLE = exports.DESC_COMMAND_AGENT_TARGET_DISABLE = exports.DESC_COMMAND_AGENT_TUNNELING_DISABLE = exports.DESC_COMMAND_AGENT_TUNNELING_ENABLE = exports.DESC_COMMAND_AGENT_PROXY_ENABLE = exports.DESC_COMMAND_AGENT_TARGET_ENABLE = exports.DESC_COMMAND_AGENT_PROXY_STATUS = exports.DESC_COMMAND_AGENT_TARGET_STATUS = exports.DESC_COMMAND_AGENT_STATUS = exports.DESC_COMMAND_AGENT_RESTART = exports.DESC_COMMAND_AGENT_ENABLE = exports.DESC_COMMAND_AGENT_DEBUG = exports.DESC_COMMAND_AGENT_DISABLE = exports.DESC_COMMAND_AGENT_START = exports.DESC_COMMAND_AGENT_INSTALL = exports.DESC_COMMAND_AGENT_UNINSTALL = exports.DESC_COMMAND_AGENT_TUNNEL_REMOVE = exports.DESC_COMMAND_AGENT_TUNNEL_STATUS = exports.DESC_COMMAND_AGENT_TUNNEL_LIST = exports.DESC_COMMAND_CONFIG_SET = exports.DESC_COMMAND_CONFIG_REMOVE = exports.DESC_COMMAND_CONFIG_GET = exports.DESC_COMMAND_CONFIG_ADD = exports.DESC_COMMAND_CONFIG_SET_WHITELIST = exports.DESC_COMMAND_CONFIG_SET_TOKEN = exports.DESC_COMMAND_CONFIG_SET_TIMEOUT = exports.DESC_COMMAND_CONFIG_SET_REGION = exports.DESC_COMMAND_CONFIG_REMOVE_TOKEN = exports.DESC_COMMAND_CONFIG_REMOVE_TUNNEL = exports.DESC_COMMAND_CONFIG_GET_WHITELIST = exports.DESC_COMMAND_CONFIG_GET_TUNNELS = exports.DESC_COMMAND_CONFIG_GET_TUNNEL = exports.DESC_COMMAND_CONFIG_GET_TOKEN = exports.DESC_COMMAND_CONFIG_GET_TIMEOUT = exports.DESC_COMMAND_CONFIG_GET_REGION = exports.DESC_COMMAND_CONFIG_ADD_TLS = void 0;
|
|
7
|
+
exports.OPTION_REST_API_ENDPOINT = exports.OPTION_DEFAULT_REGION = exports.OPTION_REGION = exports.TXT_PACKAGE_UNZIPPING_COUNT = exports.TXT_PACKAGE_UNZIPPED = exports.TXT_PACKAGE_UNZIPPING = exports.TXT_PACKAGE_DOWNLOADED_ZIP = exports.TXT_PACKAGE_DOWNLOADING_ZIP = exports.TXT_PACKAGE_DOWNLOADED = exports.TXT_PACKAGE_PUBLISHED = exports.TXT_PACKAGE_ENTRIES_FOUND = exports.TXT_PACKAGE_UPLOADED = exports.TXT_PACKAGE_UPLOADING = exports.TXT_PACKAGE_ZIPPED = exports.TXT_PACKAGE_ZIP_ENTRIES = exports.TXT_PACKAGE_ONE_ENTRY_FOUND = exports.TXT_PACKAGE_NO_ENTRIES_FOUND = exports.TXT_PACKAGE_SCANNING_DIR = exports.TXT_PIPELINE_RUN_FINISH_FAILED = exports.TXT_PIPELINE_RUN_FINISH_SUCCESSFULLY = exports.TXT_STORIES_AMOUNT = exports.TXT_PIPELINE_RUN_STILL_WAITING = exports.TXT_PIPELINE_RUN_WAIT = exports.TXT_PIPELINE_RUN_SUCCESS = exports.TXT_OPENING_TUNNEL = exports.TXT_UPDATING_AGENT = exports.TXT_ENABLING_AGENT = exports.TXT_NEW_AGENT_VERSION = exports.TXT_NEW_CLI_DOCKER_VERSION = exports.OPTION_UPLOAD_DRY_RUN = exports.OPTION_UPLOAD_REPORT_FORMAT = exports.OPTION_UPLOAD_REPORT_GLOB = exports.DESC_COMMAND_UT_UPLOAD = exports.DESC_COMMAND_UT = exports.DESC_COMMAND_VT_INSTALL_BROWSER = exports.DESC_COMMAND_VT_EXEC = exports.DESC_COMMAND_VT_SCRAPE = exports.DESC_COMMAND_VT_COMPARE = exports.DESC_COMMAND_VT_STORYBOOK = exports.DESC_COMMAND_VT_CLOSE = exports.DESC_COMMAND_VT = exports.DESC_COMMAND_PIPELINE_RUN = exports.DESC_COMMAND_PACKAGE_DOWNLOAD = exports.DESC_COMMAND_PACKAGE_PUBLISH = exports.DESC_COMMAND_PACKAGE = exports.DESC_COMMAND_PIPELINE = exports.DESC_PROGRAM = exports.DESC_COMMAND_TLS = exports.DESC_COMMAND_TCP = exports.DESC_COMMAND_START = void 0;
|
|
8
|
+
exports.OPTION_NAME = exports.OPTION_TARGET = exports.OPTION_TLS_TERMINATE = exports.OPTION_TLS_CA = exports.OPTION_TLS_CERT = exports.OPTION_TLS_KEY = exports.OPTION_HTTP_CIRCUIT_BREAKER = exports.OPTION_HTTP_COMPRESSION = exports.OPTION_HTTP_2 = exports.OPTION_HTTP_VERIFY = exports.OPTION_HTTP_LOG = exports.OPTION_HTTP_AUTH_BUDDY = exports.OPTION_HTTP_AUTH = exports.OPTION_HTTP_HOST = exports.OPTION_CONFIRM_FORCE = exports.OPTION_FORCE = exports.OPTION_TOKEN = exports.OPTION_TIMEOUT = exports.OPTION_FOLLOW = exports.OPTION_SERVE = exports.OPTION_HEADER_USER_AGENT = exports.OPTION_RESPONSE_HEADER = exports.OPTION_HEADER = exports.OPTION_WHITELIST = exports.OPTION_REST_API_PER_PAGE = exports.OPTION_REST_API_PAGE = exports.OPTION_REST_API_PROJECT = exports.OPTION_REST_API_WORKSPACE = exports.OPTION_PIPELINE_RUN_WAIT = exports.OPTION_PIPELINE_RUN_ACTION = exports.OPTION_REST_API_TOKEN = exports.OPTION_PACKAGE_DOWNLOAD_REPLACE = exports.OPTION_PACKAGE_DOWNLOAD_MERGE = exports.OPTION_PACKAGE_PUBLISH_OVERWRITE_VERSION = exports.OPTION_PACKAGE_PUBLISH_CREATE = exports.OPTION_PACKAGE_ID = exports.OPTION_PACKAGE_DOWNLOAD_PATH = exports.OPTION_PACKAGE_PUBLISH_PATH = exports.OPTION_PIPELINE_RUN_ARGUMENT = exports.OPTION_PIPELINE_RUN_DELAY = exports.OPTION_PIPELINE_RUN_VAR = exports.OPTION_PIPELINE_RUN_PRIORITY = exports.OPTION_PIPELINE_RUN_CLEAR_CACHE = exports.OPTION_PIPELINE_RUN_REFRESH = exports.OPTION_PIPELINE_RUN_COMMENT = exports.OPTION_PIPELINE_RUN_PULL_REQUEST = exports.OPTION_PIPELINE_RUN_REVISION = exports.OPTION_PIPELINE_RUN_TAG = exports.OPTION_PIPELINE_RUN_BRANCH = exports.OPTION_REST_API_REGION = void 0;
|
|
9
|
+
exports.LOG_ERROR_SAVING_AGENT_STANDALONE_CONFIG = exports.LOG_ERROR_SAVING_AGENT_SYSTEM_CONFIG = exports.LOG_SAVING_AGENT_LOCAL_CONFIG = exports.LOG_REMOVING_AGENT_PROC_ID = exports.LOG_SAVING_AGENT_PROC_ID = exports.LOG_SAVING_AGENT_SYSTEM_CONFIG = exports.LOG_REGISTERING_AGENT = exports.OPTION_SCRAPE_OUTPUT_DIR = exports.OPTION_SCRAPE_DELAY = exports.OPTION_SCRAPE_DARK_MODE = exports.OPTION_SCRAPE_WAIT_FOR_ELEMENT = exports.OPTION_SCRAPE_DEVICE_PIXEL_RATIO = exports.OPTION_SCRAPE_VIEWPORT = exports.OPTION_SCRAPE_BROWSER = exports.OPTION_SCRAPE_XPATH_SELECTOR = exports.OPTION_SCRAPE_CSS_SELECTOR = exports.OPTION_SCRAPE_FULL_PAGE = exports.OPTION_SCRAPE_QUALITY = exports.OPTION_SCRAPE_OUTPUT_TYPE = exports.OPTION_SCRAPE_FOLLOW = exports.OPTION_SCRAPE_URL = exports.OPTION_COMPARE_WAIT_FOR = exports.OPTION_COMPARE_DELAY = exports.OPTION_COMPARE_HEADER = exports.OPTION_COMPARE_COOKIE = exports.OPTION_COMPARE_IGNORE = exports.OPTION_COMPARE_IGNORE_URLS = exports.OPTION_COMPARE_DRY_RUN = exports.OPTION_COMPARE_URLS_FILE = exports.OPTION_COMPARE_SITEMAP = exports.OPTION_COMPARE_URLS = exports.OPTION_COMPARE_RESPECT_ROBOTS = exports.OPTION_COMPARE_FOLLOW = exports.OPTION_EXEC_PARALLEL = exports.OPTION_EXEC_ONE_BY_ONE = exports.OPTION_EXEC_SKIP_DISCOVERY = exports.OPTION_EXEC_COMMAND = exports.OPTION_AGENT_DEBUG = exports.OPTION_AGENT_PORT = exports.OPTION_AGENT_TAG = exports.OPTION_AGENT_TUNNELING = exports.OPTION_AGENT_PROXY = exports.OPTION_AGENT_TARGET = exports.OPTION_PASS = exports.OPTION_APP = exports.OPTION_USER = exports.OPTION_AGENT_TOKEN = exports.OPTION_AGENT_START = exports.OPTION_AGENT_ID = exports.OPTION_ID = void 0;
|
|
10
|
+
exports.LOG_TUNNEL_HTTP_WRONG_USER_AGENTS = exports.LOG_TUNNEL_HTTP_CIRCUIT_BREAKER_OPEN = exports.LOG_TUNNEL_HTTP_RATE_LIMIT = exports.LOG_TUNNEL_HTTP_WRON_AUTH = exports.LOG_TUNNEL_IDENTIFIED = exports.LOG_TUNNEL_DISCONNECTED = exports.LOG_TUNNEL_FAILED = exports.LOG_TUNNEL_CONNECTED = exports.LOG_AGENT_STARTED = exports.LOG_AGENT_SERVER_STARTED = exports.LOG_ERROR_STARTING_AGENT_SERVER = exports.LOG_SSH_CONNECTION = exports.LOG_WRONG_STREAM = exports.LOG_DETECTED_STREAM = exports.LOG_HTTP2_REQUEST = exports.LOG_HTTP2_CONNECTION = exports.LOG_HTTP1_REQUEST = exports.LOG_HTTP1_CONNECTION = exports.LOG_ERROR = exports.LOG_STOPPING_TUNNEL = exports.LOG_STARTING_TUNNEL = exports.LOG_ENABLING_AGENT_TUNNELING = exports.LOG_ENABLING_AGENT_PROXY = exports.LOG_ENABLING_AGENT_TARGET = exports.LOG_DISABLING_AGENT_TUNNELING = exports.LOG_DISABLING_AGENT_PROXY = exports.LOG_DISABLING_AGENT_TARGET = exports.LOG_REMOVING_TUNNEL = exports.LOG_TUNNEL_REGISTERED = exports.LOG_ERROR_WHILE_REFRESHING_AGENT = exports.LOG_REGISTERING_TUNNEL = exports.LOG_GETTING_AGENT = exports.LOG_UNREGISTERING_AGENT = exports.LOG_REGION_DETECTED = exports.LOG_AGENT_REGISTERED = exports.LOG_SOCKET_DISCONNECTED = exports.LOG_SOCKET_CONNECTED = exports.LOG_AGENT_NSSM_CLEARING = exports.LOG_AGENT_NSSM_EXTRACTING = exports.LOG_AGENT_NSSM_DOWNLOADING = exports.LOG_AGENT_ENABLED = exports.LOG_AGENT_STARTING_SYSTEM = exports.LOG_AGENT_STOPPING_SYSTEM = exports.LOG_AGENT_ENABLING_SYSTEM = exports.LOG_AGENT_SYSTEM_SERVICE_CONFIG = exports.LOG_AGENT_EXTRACTING_ARCHIVE = exports.LOG_AGENT_DOWNLOADING_ARCHIVE = exports.LOG_AGENT_SYSTEM_DIR = exports.LOG_ERROR_SAVING_AGENT_LOCAL_CONFIG = exports.LOG_ERROR_REMOVING_AGENT_STANDALONE_LOCK_FILE = void 0;
|
|
11
|
+
exports.OPTION_SANDBOX_APP_TYPE = exports.OPTION_SANDBOX_APP_DIR = exports.OPTION_SANDBOX_RUN_COMMAND = exports.OPTION_SANDBOX_YAML = exports.OPTION_SANDBOX_TAGS = exports.OPTION_SANDBOX_INSTALL_COMMANDS = exports.OPTION_SANDBOX_RESOURCES = exports.OPTION_SANDBOX_OS = exports.OPTION_SANDBOX_NAME = exports.OPTION_SANDBOX_IDENTIFIER = exports.TXT_AUTOCOMPLETE_UNINSTALLED = exports.TXT_AUTOCOMPLETE_INSTALLED = exports.DESC_COMMAND_AUTOCOMPLETE_UNINSTALL = exports.DESC_COMMAND_AUTOCOMPLETE_INSTALL = exports.DESC_COMMAND_AUTOCOMPLETE = exports.DESC_COMMAND_SANDBOX_EXEC = exports.DESC_COMMAND_SANDBOX_STATUS = exports.DESC_COMMAND_SANDBOX_RESTART = exports.DESC_COMMAND_SANDBOX_STOP = exports.DESC_COMMAND_SANDBOX_START = exports.DESC_COMMAND_SANDBOX_DESTROY = exports.DESC_COMMAND_SANDBOX_GET = exports.DESC_COMMAND_SANDBOX_LIST = exports.DESC_COMMAND_SANDBOX_UPDATE = exports.DESC_COMMAND_SANDBOX_GET_YAML = exports.DESC_COMMAND_SANDBOX_CREATE = exports.DESC_COMMAND_SANDBOX = exports.DEBUG_WAIT_FOR_IDLE_TIMEOUT = exports.DEBUG_WAIT_FOR_IDLE = exports.DEBUG_RESOURCE_DISCOVERY_TIMEOUT = exports.DEBUG_AUTO_WIDTH = exports.DEBUG_AUTO_SCROLL = exports.DEBUG_RESOURCE_SCRAPPING_URL = exports.DEBUG_SNAPSHOT_PROCESSING = exports.DEBUG_SNAPSHOTS_PROCESSING = exports.DEBUG_EXEC_COMMAND = exports.DEBUG_EXEC_TEST_COMMAND = exports.LOG_INSTALLED_BROWSER = exports.LOG_SESSION_LINK = exports.LOG_SENDING_DATA = exports.LOG_SENDING_REQUEST = exports.LOG_PROCESSING_SNAPSHOTS = exports.LOG_RUNNING_EXEC_COMMAND = exports.LOG_TUNNEL_SSH_STREAM = exports.LOG_TUNNEL_TLS_AGENT_STREAM = exports.LOG_TUNNEL_TLS_REGION_STREAM = exports.LOG_TUNNEL_TLS_TARGET_STREAM = exports.LOG_TUNNEL_HTTP2_STREAM = exports.LOG_TUNNEL_HTTP1_STREAM = exports.LOG_TUNNEL_TCP_STREAM = void 0;
|
|
12
|
+
exports.DESC_COMMAND_SANDBOX_ENDPOINT_GET = exports.DESC_COMMAND_SANDBOX_ENDPOINT_LIST = exports.DESC_COMMAND_SANDBOX_ENDPOINT = exports.ERR_SANDBOX_SNAPSHOTS_NOT_FOUND = exports.ERR_SANDBOX_SNAPSHOT_NOT_FOUND = exports.ERR_SANDBOX_SNAPSHOT_FAILED = exports.TXT_SANDBOX_SNAPSHOT_WAITING = exports.TXT_SANDBOX_SNAPSHOT_DELETE_CONFIRM = exports.TXT_SANDBOX_SNAPSHOT_DELETED = exports.TXT_SANDBOX_SNAPSHOT_CREATED = exports.OPTION_SANDBOX_FROM_SNAPSHOT = exports.OPTION_SANDBOX_SNAPSHOT_NAME_ARG = exports.OPTION_SANDBOX_SNAPSHOT_NAME = exports.DESC_COMMAND_SANDBOX_SNAPSHOT_DELETE = exports.DESC_COMMAND_SANDBOX_SNAPSHOT_GET = exports.DESC_COMMAND_SANDBOX_SNAPSHOT_CREATE = exports.DESC_COMMAND_SANDBOX_SNAPSHOT_LIST = exports.DESC_COMMAND_SANDBOX_SNAPSHOT = exports.TXT_SANDBOX_COMMAND_KILLED = exports.OPTION_SANDBOX_COMMAND_KILL_CONFIRM = exports.OPTION_SANDBOX_COMMAND_ID = exports.DESC_COMMAND_SANDBOX_EXEC_KILL = exports.DESC_COMMAND_SANDBOX_EXEC_LOGS = exports.DESC_COMMAND_SANDBOX_EXEC_STATUS = exports.DESC_COMMAND_SANDBOX_EXEC_LIST = exports.TXT_SANDBOX_WAITING_START = exports.TXT_SANDBOX_WAITING_STOP = exports.TXT_SANDBOX_WAITING_SETUP = exports.TXT_SANDBOX_WAITING_RUNNING = exports.TXT_SANDBOX_STOPPED = exports.TXT_SANDBOX_STARTED = exports.TXT_SANDBOX_DESTROYED = exports.TXT_SANDBOX_DESTROY_CONFIRM = exports.TXT_SANDBOX_UPDATED = exports.TXT_SANDBOX_CREATED = exports.TXT_SANDBOX_CREATING = exports.OPTION_SANDBOX_WAIT = exports.OPTION_SANDBOX_WAIT_CONFIGURED = exports.OPTION_SANDBOX_WAIT_RUNNING = exports.ERR_SANDBOX_STOP_FAILED = exports.ERR_SANDBOX_NO_COMMANDS = exports.ERR_SANDBOX_RUNNING_FAILED = exports.ERR_SANDBOX_STOP_TIMEOUT = exports.ERR_SANDBOX_SNAPSHOT_TIMEOUT = exports.ERR_SANDBOX_RUNNING_TIMEOUT = exports.ERR_SANDBOX_SETUP_TIMEOUT = exports.ERR_SANDBOX_SETUP_FAILED = exports.ERR_SANDBOX_INVALID_RESOURCES = exports.ERR_SANDBOX_NOT_FOUND = exports.OPTION_SANDBOX_RUNTIME = void 0;
|
|
13
|
+
exports.DESC_COMMAND_API_WORKSPACE = exports.DESC_COMMAND_API_REQUEST_URL = exports.DESC_COMMAND_API_GET = exports.DESC_COMMAND_API_PATCH = exports.DESC_COMMAND_API_DELETE = exports.DESC_COMMAND_API_PUT = exports.DESC_COMMAND_API_POST = exports.DESC_COMMAND_API_LIST = exports.DESC_COMMAND_API = exports.ERR_WHOAMI_LOGOUT = exports.TXT_WHOAMI_NO_WORKSPACE = exports.DESC_COMMAND_WHOAMI = exports.TXT_SANDBOX_EXEC_FAILED = exports.TXT_SANDBOX_EXEC_INPROGRESS = exports.TXT_SANDBOX_EXEC_SUCCESS = exports.TXT_SANDBOX_EXEC_BACKGROUND = exports.TXT_SANDBOX_EXEC_ID = exports.ERR_SANDBOX_CP_INVALID_SOURCE = exports.ERR_SANDBOX_CP_INVALID_DEST = exports.ERR_SANDBOX_CP_REPLACE = exports.ERR_SANDBOX_CP_MKDIR = exports.ERR_SANDBOX_CP_PATH_EXISTS = exports.ERR_SANDBOX_CP_NOT_EMPTY_DIR = exports.ERR_SANDBOX_CP_READDIR = exports.ERR_SANDBOX_CP_DEST_NOT_FOLDER = exports.ERR_SANDBOX_CP_SOURCE_NOT_FOUND = exports.TXT_SANDBOX_CP_DONE = exports.TXT_SANDBOX_CP_PROGRESS = exports.TXT_SANDBOX_UNZIPPING_COUNT = exports.TXT_SANDBOX_UNZIP_DONE = exports.TXT_SANDBOX_UNZIP = exports.TXT_SANDBOX_CP_DOWNLOAD_DONE = exports.TXT_SANDBOX_CP_DOWNLOAD = exports.OPTION_SANDBOX_CP_DOWNLOAD_REPLACE = exports.OPTION_SANDBOX_CP_DOWNLOAD_MERGE = exports.OPTION_SANDBOX_CP_DEST = exports.OPTION_SANDBOX_CP_SOURCE = exports.DESC_COMMAND_SANDBOX_CP = exports.ERR_SANDBOX_ENDPOINTS_NOT_FOUND = exports.ERR_SANDBOX_ENDPOINT_NOT_FOUND = exports.ERR_SANDBOX_ENDPOINT_EXISTS = exports.TXT_SANDBOX_ENDPOINT_DELETED = exports.TXT_SANDBOX_ENDPOINT_DELETE_CONFIRM = exports.TXT_SANDBOX_ENDPOINT_ADDED = exports.OPTION_SANDBOX_ENDPOINT_TYPE = exports.OPTION_SANDBOX_ENDPOINT_PORT = exports.OPTION_SANDBOX_ENDPOINT_NAME_ARG = exports.OPTION_SANDBOX_ENDPOINT_NAME = exports.DESC_COMMAND_SANDBOX_ENDPOINT_DELETE = exports.DESC_COMMAND_SANDBOX_ENDPOINT_ADD = void 0;
|
|
14
|
+
exports.DESC_COMMAND_PACKAGE_VERSION_LIST = exports.DESC_COMMAND_PACKAGE_VERSION_DELETE = exports.DESC_COMMAND_PACKAGE_DOCKER_LOGIN = exports.DESC_COMMAND_PACKAGE_LIST = exports.DESC_COMMAND_PACKAGE_VERSION = exports.ERR_API_MESSAGE_REPLACER = exports.ERR_LOGIN_INVALID_BASE_URL = exports.ERR_LOGIN_NO_WORKSPACE_FOUND = exports.ERR_LOGIN_NO_WORKSPACES = exports.ERR_LOGIN_HTTP_SUCCESS = exports.ERR_LOGIN_HTTP_FAILED = exports.TXT_LOGIN_OAUTH = exports.ERR_LOGIN_HTTP_SERVER_PORT_TAKEN = exports.TXT_LOGIN_SUCCESS = exports.TXT_LOGIN_SELECT_WORKSPACE = exports.TXT_LOGIN_ENTER_BASE_URL = exports.TXT_LOGIN_SELECT_REGION = exports.TXT_WORKSPACE_NONE = exports.TXT_WORKSPACE_SET_SUCCESS = exports.ARG_COMMAND_WORKSPACE = exports.DESC_COMMAND_WORKSPACE_GET = exports.DESC_COMMAND_WORKSPACE_SET = exports.DESC_COMMAND_WORKSPACE_LIST = exports.DESC_COMMAND_WORKSPACE = exports.TXT_LOGOUT_SUCCESS = exports.DESC_COMMAND_LOGOUT = exports.DESC_COMMAND_LOGIN = exports.ERR_API_MEDIA_TYPE_NOT_IMPLEMENTED = exports.ERR_API_PARAMETER_NOT_REPLACED = exports.TXT_API_ENDPOINT_REQUIRED_SCOPES = exports.ERR_API_ENDPOINT_NOT_FOUND = exports.ERR_API_WRONG_METHOD = exports.ERR_SCHEMA_FETCH_FAILED = exports.OPT_COMMAND_API_INFO_URL = exports.OPT_COMMAND_API_INFO_SCHEMA = exports.OPT_COMMAND_API_INFO_METHOD = exports.OPT_COMMAND_API_LIST_SEARCH = exports.OPT_COMMAND_API_LIST_METHOD = exports.ERR_API_REQUEST_BODY_VALUE = exports.ERR_API_REQUEST_QUERY_VALUE = exports.ERR_API_REQUEST_INVALID_JSON = exports.ERR_API_REQUEST_FILE_ERROR = exports.ERR_API_REQUEST_OUTPUT_EXISTS = exports.DESC_COMMAND_API_INFO = exports.DESC_COMMAND_API_FORM = exports.DESC_COMMAND_API_JSON = exports.DESC_COMMAND_API_DATA = exports.DESC_COMMAND_API_OUTPUT = exports.DESC_COMMAND_API_REQUEST_QUERY = exports.DESC_COMMAND_API_PROJECT = void 0;
|
|
15
|
+
exports.EXAMPLE_TUNNEL_TCP = exports.EXAMPLE_TUNNEL_TLS = exports.EXAMPLE_AGENT_TUNNEL_START = exports.EXAMPLE_AGENT_TUNNEL_STATUS = exports.EXAMPLE_AGENT_TUNNEL_REMOVE = exports.EXAMPLE_AGENT_TUNNEL_LIST = exports.EXAMPLE_TUNNEL_HTTP = exports.EXAMPLE_SANDBOX_CREATE = exports.EXAMPLE_SANDBOX_CP = exports.ERR_PROJECT_NO_PROJECTS = exports.TXT_LOGIN_SELECT_PROJECT = exports.TXT_COMMAND_PROJECT_LINK_RANDOM = exports.TXT_COMMAND_PROJECT_LINK_NOT_FOUND = exports.TXT_COMMAND_PROJECT_LINK_NAME = exports.TXT_COMMAND_PROJECT_LINK_NEW = exports.ERR_COMMAND_PROJECT_LINK_DIR_NOT_DIR = exports.TXT_COMMAND_PROJECT_LINKED = exports.TXT_COMMAND_PROJECT_LINK_GIT_REPO = exports.TXT_COMMAND_PROJECT_LINK_DIR_CONFIRM = exports.TXT_COMMAND_PROJECT_LINK_DIR_LINKED = exports.ERR_COMMAND_PROJECT_LINK_DIR_CREATE = exports.OPT_COMMAND_PROJECT_LINK_HAS_REMOTE = exports.OPT_COMMAND_PROJECT_LINK_DIRECTORY = exports.OPT_COMMAND_PROJECT_LINK_GIT = exports.OPT_COMMAND_PROJECT_LINK_RELINK = exports.DESC_COMMAND_PROJECT_LINK = exports.DESC_COMMAND_PROJECT_LIST = exports.DESC_COMMAND_PROJECT_GIT = exports.DESC_COMMAND_PROJECT_GIT_CREDENTIAL = exports.DESC_COMMAND_PROJECT = exports.TXT_PACKAGE_VERSION_DOWNLOAD = exports.TXT_PACKAGE_PUBLISH = exports.TXT_PACKAGE_CREATED = exports.TXT_PACKAGE_VERSION_DELETED = exports.TXT_PACKAGE_DELETED = exports.ERR_COMMAND_PACKAGE_TYPE = exports.OPT_COMMAND_PACKAGE_VERSION = exports.OPT_COMMAND_PACKAGE_IDENTIFIER = exports.OPT_COMMAND_PACKAGE_CREATE_IDENTIFIER = exports.OPT_COMMAND_PACKAGE_NAME = exports.OPT_COMMAND_PACKAGE_TYPE = exports.DESC_COMMAND_PACKAGE_CREATE = exports.DESC_COMMAND_PACKAGE_GET = exports.TXT_PACKAGE_DOCKER_LOGIN_FAILED = exports.TXT_PACKAGE_DOCKER_LOGIN_SUCCESS = exports.TXT_PACKAGE_VERSION_DELETE_CONFIRM = exports.TXT_PACKAGE_DELETE_CONFIRM = exports.DESC_COMMAND_PACKAGE_DELETE = exports.ERR_COMMAND_PACKAGE_NO_PROJECTS = exports.DESC_COMMAND_PACKAGE_VERSION_GET = void 0;
|
|
16
|
+
exports.EXAMPLE_PACKAGE_VERSION_DELETE = exports.EXAMPLE_PACKAGE_VERSION_GET = exports.EXAMPLE_PACKAGE_VERSION_LIST = exports.EXAMPLE_PACKAGE_CREATE = exports.EXAMPLE_PACKAGE_DELETE = exports.EXAMPLE_PACKAGE_DOWNLOAD = exports.EXAMPLE_PACKAGE_PUBLISH = exports.EXAMPLE_PIPELINE_RUN = exports.EXAMPLE_SANDBOX_ENDPOINT_LIST = exports.EXAMPLE_SANDBOX_ENDPOINT_GET = exports.EXAMPLE_SANDBOX_ENDPOINT_DELETE = exports.EXAMPLE_SANDBOX_ENDPOINT_CREATE = exports.EXAMPLE_SANDBOX_SNAPSHOT_LIST = exports.EXAMPLE_SANDBOX_SNAPSHOT_GET = exports.EXAMPLE_SANDBOX_SNAPSHOT_DELETE = exports.EXAMPLE_SANDBOX_SNAPSHOT_CREATE = exports.EXAMPLE_SANDBOX_EXEC_STATUS = exports.EXAMPLE_SANDBOX_EXEC_LOGS = exports.EXAMPLE_SANDBOX_EXEC_LIST = exports.EXAMPLE_SANDBOX_EXEC_KILL = exports.EXAMPLE_SANDBOX_EXEC_COMMAND = exports.EXAMPLE_TUNNEL_START = void 0;
|
|
17
17
|
const utils_1 = require("./utils");
|
|
18
18
|
exports.ERR_REST_API_GENERAL_ERROR = 'Something went wrong';
|
|
19
19
|
exports.ERR_REST_API_NOT_RESPONDING = 'Api endpoint not responding. Try again later...';
|
|
@@ -175,6 +175,10 @@ exports.TXT_AGENT_DEBUG_OFF = 'Agent debug mode off';
|
|
|
175
175
|
exports.TXT_AGENT_RESTARTED = 'Agent restarted';
|
|
176
176
|
exports.TXT_AGENT_TARGET_ENABLED = 'Agent is available as a target';
|
|
177
177
|
exports.TXT_AGENT_TARGET_DISABLED = 'Agent is unavailable as a target';
|
|
178
|
+
exports.TXT_AGENT_PROXY_ENABLED = 'Agent is available as a proxy';
|
|
179
|
+
exports.TXT_AGENT_PROXY_DISABLED = 'Agent is unavailable as a proxy';
|
|
180
|
+
exports.TXT_AGENT_TUNNELING_ENABLED = 'Agent tunnels are available';
|
|
181
|
+
exports.TXT_AGENT_TUNNELING_DISABLED = 'Agent tunnels are unavailable';
|
|
178
182
|
exports.TXT_AGENT_TAGS_SET = 'Agent tags set';
|
|
179
183
|
exports.TXT_AGENT_NO_TAGS = 'Agent has no tags set';
|
|
180
184
|
exports.TXT_AGENT_INSTALLED = 'Agent installed';
|
|
@@ -233,11 +237,17 @@ exports.DESC_COMMAND_AGENT_ENABLE = 'Enable agent and all tunnels';
|
|
|
233
237
|
exports.DESC_COMMAND_AGENT_RESTART = 'Restarts agent and all tunnels';
|
|
234
238
|
exports.DESC_COMMAND_AGENT_STATUS = 'Show the status of Buddy agent';
|
|
235
239
|
exports.DESC_COMMAND_AGENT_TARGET_STATUS = 'Show the status of Buddy agent as a target';
|
|
240
|
+
exports.DESC_COMMAND_AGENT_PROXY_STATUS = 'Show the status of Buddy agent as a proxy';
|
|
236
241
|
exports.DESC_COMMAND_AGENT_TARGET_ENABLE = 'Enable Buddy agent as a target';
|
|
242
|
+
exports.DESC_COMMAND_AGENT_PROXY_ENABLE = 'Enable Buddy agent as a proxy';
|
|
243
|
+
exports.DESC_COMMAND_AGENT_TUNNELING_ENABLE = 'Enable Buddy agent tunnels';
|
|
244
|
+
exports.DESC_COMMAND_AGENT_TUNNELING_DISABLE = 'Disable Buddy agent tunnels';
|
|
237
245
|
exports.DESC_COMMAND_AGENT_TARGET_DISABLE = 'Disable Buddy agent as a target';
|
|
246
|
+
exports.DESC_COMMAND_AGENT_PROXY_DISABLE = 'Disable Buddy agent as a proxy';
|
|
238
247
|
exports.DESC_COMMAND_AGENT_STOP = 'Stops the server agent';
|
|
239
248
|
exports.DESC_COMMAND_AGENT_TUNNEL = "Manage agent's tunnels";
|
|
240
249
|
exports.DESC_COMMAND_AGENT_TARGET = "Manage agent's target availability";
|
|
250
|
+
exports.DESC_COMMAND_AGENT_PROXY = "Manage agent's target availability";
|
|
241
251
|
exports.DESC_COMMAND_AGENT_TAGS = "Manage agent's tags";
|
|
242
252
|
exports.DESC_COMMAND_AGENT_TAGS_GET = "Get agent's tags";
|
|
243
253
|
exports.DESC_COMMAND_AGENT_TAGS_SET = "Set agent's tags";
|
|
@@ -360,7 +370,7 @@ exports.OPTION_TLS_CA = 'Path to a TLS PEM CA certificate for TLS auth';
|
|
|
360
370
|
exports.OPTION_TLS_TERMINATE = 'Terminate TLS at "target", "agent", "region". By default TLS is terminated at "region"';
|
|
361
371
|
exports.OPTION_TARGET = 'Target address to redirect traffic to. Host is optional and by default local machine. Port is by default 80';
|
|
362
372
|
exports.OPTION_NAME = 'Name of the tunnel';
|
|
363
|
-
exports.OPTION_ID = 'Id of the tunnel';
|
|
373
|
+
exports.OPTION_ID = 'Id of the tunnel. If not provided status of tunneling service';
|
|
364
374
|
exports.OPTION_AGENT_ID = 'Start existing agent';
|
|
365
375
|
exports.OPTION_AGENT_START = 'Start agent right away';
|
|
366
376
|
exports.OPTION_AGENT_TOKEN = 'token to authorize existing agent agent or token to add a new agent';
|
|
@@ -368,6 +378,8 @@ exports.OPTION_USER = 'OS user name. Default: root (macOS/Linux), LocalSystem (W
|
|
|
368
378
|
exports.OPTION_APP = 'Starts bdy agent as standalone process';
|
|
369
379
|
exports.OPTION_PASS = 'Password of the user. Only set for Windows';
|
|
370
380
|
exports.OPTION_AGENT_TARGET = 'Makes the agent available as a target';
|
|
381
|
+
exports.OPTION_AGENT_PROXY = 'Makes the agent available as a proxy';
|
|
382
|
+
exports.OPTION_AGENT_TUNNELING = 'Makes available adding tunnels in the agent. Default: true';
|
|
371
383
|
exports.OPTION_AGENT_TAG = 'Tag agent. Can be passed multiple times';
|
|
372
384
|
exports.OPTION_AGENT_PORT = 'Agent API port';
|
|
373
385
|
exports.OPTION_AGENT_DEBUG = 'Turns on debug mode';
|
|
@@ -435,7 +447,11 @@ const LOG_TUNNEL_REGISTERED = (id) => `Tunnel registered with id '${id}'`;
|
|
|
435
447
|
exports.LOG_TUNNEL_REGISTERED = LOG_TUNNEL_REGISTERED;
|
|
436
448
|
exports.LOG_REMOVING_TUNNEL = 'Removing tunnel...';
|
|
437
449
|
exports.LOG_DISABLING_AGENT_TARGET = 'Disabling agent as target';
|
|
450
|
+
exports.LOG_DISABLING_AGENT_PROXY = 'Disabling agent as proxy';
|
|
451
|
+
exports.LOG_DISABLING_AGENT_TUNNELING = 'Disabling agent tunneling';
|
|
438
452
|
exports.LOG_ENABLING_AGENT_TARGET = 'Enabling agent as target';
|
|
453
|
+
exports.LOG_ENABLING_AGENT_PROXY = 'Enabling agent as proxy';
|
|
454
|
+
exports.LOG_ENABLING_AGENT_TUNNELING = 'Enabling agent tunneling';
|
|
439
455
|
const LOG_STARTING_TUNNEL = (id) => `Starting tunnel '${id}'`;
|
|
440
456
|
exports.LOG_STARTING_TUNNEL = LOG_STARTING_TUNNEL;
|
|
441
457
|
const LOG_STOPPING_TUNNEL = (id) => `Stopping tunnel '${id}'`;
|
|
@@ -72,15 +72,33 @@ class ApiAgent {
|
|
|
72
72
|
async fetchAgentTarget() {
|
|
73
73
|
return makeRequest(this.port, '/target');
|
|
74
74
|
}
|
|
75
|
+
async fetchAgentProxy() {
|
|
76
|
+
return makeRequest(this.port, '/proxy');
|
|
77
|
+
}
|
|
78
|
+
async fetchAgentTunneling() {
|
|
79
|
+
return makeRequest(this.port, '/tunneling');
|
|
80
|
+
}
|
|
75
81
|
async fetchAgentTags() {
|
|
76
82
|
return makeRequest(this.port, '/agent/tags');
|
|
77
83
|
}
|
|
78
84
|
async enableAgentTarget() {
|
|
79
85
|
return makeRequest(this.port, '/target/enable');
|
|
80
86
|
}
|
|
87
|
+
async enableAgentProxy() {
|
|
88
|
+
return makeRequest(this.port, '/proxy/enable');
|
|
89
|
+
}
|
|
90
|
+
async enableAgentTunneling() {
|
|
91
|
+
return makeRequest(this.port, '/tunneling/enable');
|
|
92
|
+
}
|
|
93
|
+
async disableAgentTunneling() {
|
|
94
|
+
return makeRequest(this.port, '/tunneling/disable');
|
|
95
|
+
}
|
|
81
96
|
async disableAgentTarget() {
|
|
82
97
|
return makeRequest(this.port, '/target/disable');
|
|
83
98
|
}
|
|
99
|
+
async disableAgentProxy() {
|
|
100
|
+
return makeRequest(this.port, '/proxy/disable');
|
|
101
|
+
}
|
|
84
102
|
async stopTunnel(id) {
|
|
85
103
|
return makeRequest(this.port, '/tunnel/stop', {
|
|
86
104
|
id,
|
|
@@ -59,7 +59,7 @@ const makeRequest = async (host, path, body, method = 'POST', respAsJson = true,
|
|
|
59
59
|
}
|
|
60
60
|
};
|
|
61
61
|
class ApiBuddyClass {
|
|
62
|
-
async register(service, target, host, token, tags, onDefaultRegion) {
|
|
62
|
+
async register(service, target, tunneling, proxy, host, token, tags, onDefaultRegion) {
|
|
63
63
|
const version = (0, utils_1.getVersion)();
|
|
64
64
|
const hostname = (0, utils_1.getHostname)();
|
|
65
65
|
const platform = (0, utils_1.getPlatform)();
|
|
@@ -72,12 +72,14 @@ class ApiBuddyClass {
|
|
|
72
72
|
service,
|
|
73
73
|
tags,
|
|
74
74
|
target,
|
|
75
|
+
tunneling,
|
|
76
|
+
proxy
|
|
75
77
|
});
|
|
76
78
|
logger_1.default.info((0, texts_1.LOG_AGENT_REGISTERED)(r.id));
|
|
77
79
|
logger_1.default.info((0, texts_1.LOG_REGION_DETECTED)(r.region));
|
|
78
80
|
if (onDefaultRegion)
|
|
79
81
|
onDefaultRegion(r.region);
|
|
80
|
-
return new agent_1.default(r.id, host, r.token, service, target, r.tags || [], this, false);
|
|
82
|
+
return new agent_1.default(r.id, host, r.token, service, target, tunneling, proxy, r.tags || [], this, false);
|
|
81
83
|
}
|
|
82
84
|
async unregister(id, host, token) {
|
|
83
85
|
logger_1.default.info(texts_1.LOG_UNREGISTERING_AGENT);
|
|
@@ -93,7 +95,9 @@ class ApiBuddyClass {
|
|
|
93
95
|
token,
|
|
94
96
|
id,
|
|
95
97
|
});
|
|
96
|
-
|
|
98
|
+
const tunneling = typeof (r.tunneling) === 'boolean' ? r.tunneling : true;
|
|
99
|
+
const proxy = typeof (r.proxy) === 'boolean' ? r.proxy : false;
|
|
100
|
+
return new agent_1.default(r.id, host, token, !!r.service, !!r.target, tunneling, proxy, r.tags || [], this, !!r.disabled);
|
|
97
101
|
}
|
|
98
102
|
async fetchAgentKeys(id, host, token) {
|
|
99
103
|
return await makeRequest(host, '/tunnel/agent/fetch/keys', {
|
|
@@ -108,6 +112,20 @@ class ApiBuddyClass {
|
|
|
108
112
|
token,
|
|
109
113
|
});
|
|
110
114
|
}
|
|
115
|
+
async disableTunneling(agentId, host, token) {
|
|
116
|
+
logger_1.default.info(texts_1.LOG_DISABLING_AGENT_TUNNELING);
|
|
117
|
+
await makeRequest(host, '/tunnel/agent/tunneling/disable', {
|
|
118
|
+
agentId,
|
|
119
|
+
token,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
async disableProxy(agentId, host, token) {
|
|
123
|
+
logger_1.default.info(texts_1.LOG_DISABLING_AGENT_PROXY);
|
|
124
|
+
await makeRequest(host, '/tunnel/agent/proxy/disable', {
|
|
125
|
+
agentId,
|
|
126
|
+
token,
|
|
127
|
+
});
|
|
128
|
+
}
|
|
111
129
|
async enableTarget(agentId, host, token) {
|
|
112
130
|
logger_1.default.info(texts_1.LOG_ENABLING_AGENT_TARGET);
|
|
113
131
|
await makeRequest(host, '/tunnel/agent/target/enable', {
|
|
@@ -115,6 +133,20 @@ class ApiBuddyClass {
|
|
|
115
133
|
token,
|
|
116
134
|
});
|
|
117
135
|
}
|
|
136
|
+
async enableTunneling(agentId, host, token) {
|
|
137
|
+
logger_1.default.info(texts_1.LOG_ENABLING_AGENT_TUNNELING);
|
|
138
|
+
await makeRequest(host, '/tunnel/agent/tunneling/enable', {
|
|
139
|
+
agentId,
|
|
140
|
+
token,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
async enableProxy(agentId, host, token) {
|
|
144
|
+
logger_1.default.info(texts_1.LOG_ENABLING_AGENT_PROXY);
|
|
145
|
+
await makeRequest(host, '/tunnel/agent/proxy/enable', {
|
|
146
|
+
agentId,
|
|
147
|
+
token,
|
|
148
|
+
});
|
|
149
|
+
}
|
|
118
150
|
async markAgentAsInactive(agentId, host, token) {
|
|
119
151
|
await makeRequest(host, '/tunnel/agent/target/mark-inactive', {
|
|
120
152
|
agentId,
|