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.
- package/dist/index.js +9 -7
- 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.
|
|
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(
|
|
468
|
-
return
|
|
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
|
|
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(
|
|
487
|
-
return
|
|
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
|
|
495
|
+
return res;
|
|
494
496
|
}
|
|
495
497
|
},
|
|
496
498
|
registerSettings: (schema) => {
|