bdy 1.17.7-dev → 1.17.8-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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bdy",
3
3
  "preferGlobal": false,
4
- "version": "1.17.7-dev",
4
+ "version": "1.17.8-dev",
5
5
  "type": "commonjs",
6
6
  "license": "MIT",
7
7
  "scripts": {
@@ -64,16 +64,19 @@ const installService = async (options) => {
64
64
  if (!isSupported) {
65
65
  output_1.default.exitError(texts_1.ERR_AGENT_NOT_SUPPORTED);
66
66
  }
67
- const { token, host } = await input_1.default.tunnelToken(options.token);
68
67
  let id = '';
69
68
  let agentToken = '';
70
- let agent;
69
+ let addToken = options.token;
70
+ if (options.id && addToken) {
71
+ id = options.id;
72
+ agentToken = addToken;
73
+ addToken = '';
74
+ }
75
+ const { token, host } = await input_1.default.tunnelToken(addToken);
71
76
  const port = input_1.default.port(options.port);
72
77
  const target = !!options.target;
73
- if (options.id && options.agentToken) {
74
- // if id & token passed set as it is
75
- id = options.id;
76
- agentToken = options.agentToken;
78
+ let agent;
79
+ if (id) {
77
80
  try {
78
81
  agent = await buddy_1.default.fetchAgent(id, host, agentToken);
79
82
  }
@@ -138,12 +141,14 @@ const installApp = async (options) => {
138
141
  }
139
142
  let id;
140
143
  let agentToken;
144
+ let addToken = options.token;
141
145
  const port = input_1.default.port(options.port);
142
- if (options.id && options.agentToken) {
146
+ if (options.id && addToken) {
143
147
  id = options.id;
144
- agentToken = options.agentToken;
148
+ agentToken = addToken;
149
+ addToken = '';
145
150
  }
146
- const { token, host } = await input_1.default.tunnelToken(options.token);
151
+ const { token, host } = await input_1.default.tunnelToken(addToken);
147
152
  if (!id) {
148
153
  const tags = prepareTags(options.tag);
149
154
  try {
@@ -200,8 +205,7 @@ const installApp = async (options) => {
200
205
  const commandAgentInstall = (0, utils_1.newCommand)('install', texts_1.DESC_COMMAND_AGENT_INSTALL);
201
206
  commandAgentInstall.option('-s, --start [true|false]', texts_1.OPTION_AGENT_START, 'true');
202
207
  commandAgentInstall.option('-i, --id <id>', texts_1.OPTION_AGENT_ID);
203
- commandAgentInstall.option('--agent-token <agent-token>', texts_1.OPTION_AGENT_TOKEN);
204
- commandAgentInstall.option('-t, --token <token>', texts_1.OPTION_TOKEN);
208
+ commandAgentInstall.option('-t, --token <token>', texts_1.OPTION_AGENT_TOKEN);
205
209
  commandAgentInstall.option('-p, --port <port>', texts_1.OPTION_AGENT_PORT, '7456');
206
210
  commandAgentInstall.option('-u, --user <user>', texts_1.OPTION_USER);
207
211
  commandAgentInstall.option('-a,--app', texts_1.OPTION_APP);
@@ -361,7 +361,7 @@ exports.OPTION_NAME = 'Name of the tunnel';
361
361
  exports.OPTION_ID = 'Id of the tunnel';
362
362
  exports.OPTION_AGENT_ID = 'Start existing agent';
363
363
  exports.OPTION_AGENT_START = 'Start agent right away';
364
- exports.OPTION_AGENT_TOKEN = 'Token to authorize existing agent';
364
+ exports.OPTION_AGENT_TOKEN = 'token to authorize existing agent agent or token to add a new agent';
365
365
  exports.OPTION_USER = 'OS user name. Default: root (macOS/Linux), LocalSystem (Windows. Provide as DOMAIN\\USER (use `whoami` to get full username)';
366
366
  exports.OPTION_APP = 'Starts bdy agent as standalone process';
367
367
  exports.OPTION_PASS = 'Password of the user. Only set for Windows';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bdy",
3
3
  "preferGlobal": false,
4
- "version": "1.17.7-dev",
4
+ "version": "1.17.8-dev",
5
5
  "type": "commonjs",
6
6
  "license": "MIT",
7
7
  "scripts": {