skystream-cli 1.2.7 → 1.2.8

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 (3) hide show
  1. package/README.md +16 -1
  2. package/dist/index.js +26 -5
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -82,7 +82,22 @@ skystream test [options]
82
82
  **Options:**
83
83
  - `-p, --path <path>`: Path to plugin folder (Default: `.`).
84
84
  - `-f, --function <name>`: Function to test (Default: `getHome`).
85
- - `-q, --query <query>`: Query string for functions like `search`.
85
+ - `-q, --query <query>`: Query string (URLs for `load`/`loadStreams`, keywords for `search`).
86
+
87
+ **Examples:**
88
+ ```bash
89
+ # Test dashboard categories
90
+ skystream test -f getHome
91
+
92
+ # Test search with a keyword
93
+ skystream test -f search -q "avatar"
94
+
95
+ # Test full details for a movie/series
96
+ skystream test -f load -q "https://site.com/movie/123"
97
+
98
+ # Test stream links extraction
99
+ skystream test -f loadStreams -q "https://site.com/movie/123"
100
+ ```
86
101
 
87
102
  ---
88
103
 
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ const program = new Command();
9
9
  program
10
10
  .name('skystream')
11
11
  .description('SkyStream Plugin Development Kit CLI (Sky Gen 2)')
12
- .version('1.2.7');
12
+ .version('1.2.8');
13
13
  // Schemas
14
14
  const pluginSchema = z.object({
15
15
  packageName: z.string().min(5).regex(/^[a-z0-9._-]+$/),
@@ -445,12 +445,33 @@ program.command('test')
445
445
  }
446
446
  const callback = (res) => {
447
447
  console.log('\n--- Result ---');
448
+ if (res && res.success === false) {
449
+ console.log(`\x1b[31mStatus: FAILED\x1b[0m`);
450
+ console.log(`\x1b[31mError Code: ${res.errorCode || 'UNKNOWN'}\x1b[0m`);
451
+ if (res.message)
452
+ console.log(`\x1b[31mMessage: ${res.message}\x1b[0m`);
453
+ }
454
+ else {
455
+ console.log(`\x1b[32mStatus: SUCCESS\x1b[0m`);
456
+ }
448
457
  console.log(JSON.stringify(res, null, 2));
449
458
  };
450
- if (options.function === 'getHome')
451
- await fn(callback);
452
- else
453
- await fn(options.query, callback);
459
+ try {
460
+ if (options.function === 'getHome')
461
+ await fn(callback);
462
+ else if (!options.query || options.query.trim() === "") {
463
+ console.warn(`\x1b[33mWarning: Function '${options.function}' usually requires a query/URL (-q), but none was provided.\x1b[0m`);
464
+ await fn(options.query, callback);
465
+ }
466
+ else {
467
+ await fn(options.query, callback);
468
+ }
469
+ }
470
+ catch (e) {
471
+ console.error(`\n\x1b[31m--- CRITICAL ERROR DURING EXECUTION ---\x1b[0m`);
472
+ console.error(`\x1b[31m${e.stack || e.message}\x1b[0m\n`);
473
+ process.exit(2);
474
+ }
454
475
  });
455
476
  program.command('deploy')
456
477
  .description('Deploy all plugins and repository index')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skystream-cli",
3
- "version": "1.2.7",
3
+ "version": "1.2.8",
4
4
  "type": "module",
5
5
  "description": "SkyStream Plugin Development Kit & Repository Manager",
6
6
  "main": "dist/index.js",