@dccxx/auggiegw 1.0.3 → 1.0.4

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.
Files changed (2) hide show
  1. package/dist/cli.js +15 -4
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -196,11 +196,19 @@ async function authProxy(proxyId, proxyPassword, apiUrl) {
196
196
  const data = (await response.json());
197
197
  return data;
198
198
  }
199
- async function handleLogin() {
199
+ async function handleLogin(usernameArg, passwordArg) {
200
200
  try {
201
201
  const config = loadConfig();
202
- const username = await promptInput('Username: ');
203
- const password = await promptInput('Password: ', true);
202
+ let username;
203
+ let password;
204
+ if (usernameArg && passwordArg) {
205
+ username = usernameArg;
206
+ password = passwordArg;
207
+ }
208
+ else {
209
+ username = await promptInput('Username: ');
210
+ password = await promptInput('Password: ', true);
211
+ }
204
212
  if (!username || !password) {
205
213
  console.error('Error: Username and password are required');
206
214
  process.exit(1);
@@ -292,7 +300,10 @@ async function handleFetch() {
292
300
  }
293
301
  const program = new Command();
294
302
  program.name('auggiegw').description('CLI tool for auggiegw authentication').version('1.0.0');
295
- program.command('login').description('Login and store credentials').action(handleLogin);
303
+ program
304
+ .command('login [username] [password]')
305
+ .description('Login and store credentials')
306
+ .action(handleLogin);
296
307
  program.command('logout').description('Logout and remove stored credentials').action(handleLogout);
297
308
  program
298
309
  .command('fetch')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dccxx/auggiegw",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "A Node.js TypeScript package",
5
5
  "main": "./dist/cli.js",
6
6
  "types": "./dist/cli.d.ts",