skystream-cli 1.4.6 → 1.4.7

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/index.js +9 -7
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -12,7 +12,7 @@ const program = new Command();
12
12
  program
13
13
  .name('skystream')
14
14
  .description('SkyStream Plugin Development Kit CLI (Sky Gen 2)')
15
- .version('1.4.6');
15
+ .version('1.4.7');
16
16
  // Schemas
17
17
  const pluginSchema = z.object({
18
18
  packageName: z.string().min(5).regex(/^[a-z0-9._-]+$/),
@@ -463,15 +463,16 @@ program.command('test')
463
463
  }
464
464
  const res = await axios.get(url, { headers: finalHeaders });
465
465
  const body = typeof res.data === 'string' ? res.data : JSON.stringify(res.data);
466
+ const response = { status: res.status, statusCode: res.status, body, headers: res.headers };
466
467
  if (cb)
467
- cb({ status: res.status, statusCode: res.status, body, headers: res.headers });
468
- return body;
468
+ cb(response);
469
+ return response;
469
470
  }
470
471
  catch (e) {
471
472
  const res = { status: e.response?.status || 500, statusCode: e.response?.status || 500, body: e.response?.data || e.message, headers: e.response?.headers || {} };
472
473
  if (cb)
473
474
  cb(res);
474
- return typeof res.body === 'string' ? res.body : JSON.stringify(res.body);
475
+ return res;
475
476
  }
476
477
  },
477
478
  http_post: async (url, headers, body, cb) => {
@@ -482,15 +483,16 @@ program.command('test')
482
483
  }
483
484
  const res = await axios.post(url, body, { headers: finalHeaders });
484
485
  const resBody = typeof res.data === 'string' ? res.data : JSON.stringify(res.data);
486
+ const response = { status: res.status, statusCode: res.status, body: resBody, headers: res.headers };
485
487
  if (cb)
486
- cb({ status: res.status, statusCode: res.status, body: resBody, headers: res.headers });
487
- return resBody;
488
+ cb(response);
489
+ return response;
488
490
  }
489
491
  catch (e) {
490
492
  const res = { status: e.response?.status || 500, statusCode: e.response?.status || 500, body: e.response?.data || e.message, headers: e.response?.headers || {} };
491
493
  if (cb)
492
494
  cb(res);
493
- return typeof res.body === 'string' ? res.body : JSON.stringify(res.body);
495
+ return res;
494
496
  }
495
497
  },
496
498
  registerSettings: (schema) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skystream-cli",
3
- "version": "1.4.6",
3
+ "version": "1.4.7",
4
4
  "type": "module",
5
5
  "description": "SkyStream Plugin Development Kit & Repository Manager",
6
6
  "main": "dist/index.js",