pushnetgo-cli 1.1.2 → 1.2.0

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/README.md CHANGED
@@ -7,120 +7,64 @@ Command-line tool for PushNetGo App — sync music, validate API keys.
7
7
  ```bash
8
8
  npm install -g pushnetgo-cli
9
9
  export MYAPP_API_KEY="pushnetgo-xxx"
10
- pushnetgo-cli token check
11
- pushnetgo-cli api-url
12
- pushnetgo-cli sync-music --url "https://..."
10
+ pushnetgo-cli
13
11
  ```
14
12
 
15
- **Three commands. No Firebase config needed. Works on any machine.**
13
+ ## API Endpoint
16
14
 
17
- ## Install
15
+ All operations use one endpoint:
18
16
 
19
- ```bash
20
- npm install -g pushnetgo-cli
21
17
  ```
22
-
23
- Or run without installing:
24
-
25
- ```bash
26
- npx pushnetgo-cli token check --key pushnetgo-xxx
18
+ POST https://flutter-ai-playground-f8e3b.web.app/api
19
+ Auth: x-api-key: pushnetgo-xxx
27
20
  ```
28
21
 
29
- ## HTTP API Endpoints
22
+ ### 3 Operations
30
23
 
31
- | URL | Purpose |
32
- |-----|---------|
33
- | `https://flutter-ai-playground-f8e3b.web.app/api/pushnetgo-upload` | Upload music from URL |
34
- | `https://us-central1-flutter-ai-playground-f8e3b.cloudfunctions.net/unifiedGatewayApi` | All actions (token-check, sync-music) |
35
-
36
- Auth: `x-api-key: pushnetgo-xxx`
37
-
38
- ### Actions
39
-
40
- #### token-check
24
+ #### 1. Verify Key
41
25
 
42
26
  ```bash
43
- curl -X POST https://us-central1-flutter-ai-playground-f8e3b.cloudfunctions.net/unifiedGatewayApi \
27
+ curl -X POST https://flutter-ai-playground-f8e3b.web.app/api \
44
28
  -H "Content-Type: application/json" \
45
29
  -H "x-api-key: pushnetgo-xxx" \
46
30
  -d '{"action":"token-check"}'
47
31
  ```
48
32
 
49
- #### sync-music
50
-
51
- Download an MP3 from URL and upload to PushNetGo project.
33
+ #### 2. Upload Music
52
34
 
53
35
  ```bash
54
- curl -X POST https://us-central1-flutter-ai-playground-f8e3b.cloudfunctions.net/unifiedGatewayApi \
36
+ curl -X POST https://flutter-ai-playground-f8e3b.web.app/api \
55
37
  -H "Content-Type: application/json" \
56
38
  -H "x-api-key: pushnetgo-xxx" \
57
- -d '{"action":"sync-music","projectId":"my-project","url":"https://example.com/track.mp3"}'
58
- ```
59
-
60
- ## CLI Usage
61
-
62
- Set your API key as an environment variable:
63
-
64
- ```bash
65
- export MYAPP_API_KEY="pushnetgo-xxx"
66
- ```
67
-
68
- Or pass it with each command:
69
-
70
- ```bash
71
- pushnetgo-cli --key pushnetgo-xxx <command>
39
+ -d '{"action":"sync-music","url":"https://example.com/track.mp3","title":"My Song"}'
72
40
  ```
73
41
 
74
- ### Commands
75
-
76
- #### sync-music
77
-
78
- Upload local MP3 files or import from URL:
42
+ #### 3. Download Music
79
43
 
80
44
  ```bash
81
- # Upload from local directory
82
- pushnetgo-cli sync-music --project radio99 --dir /path/to/mp3
83
-
84
- # Import from URL
85
- pushnetgo-cli sync-music --project radio99 --url "https://api.mureka.ai/output.mp3"
86
- ```
87
-
88
- #### token check
89
-
90
- Validate an API key:
45
+ # First get track info
46
+ curl -X POST https://flutter-ai-playground-f8e3b.web.app/api \
47
+ -H "x-api-key: pushnetgo-xxx" \
48
+ -d '{"action":"music_list"}'
91
49
 
92
- ```bash
93
- pushnetgo-cli token check
94
- pushnetgo-cli token check --key pushnetgo-xxx
50
+ # Then download from the returned downloadUrl
51
+ curl -O "https://storage.googleapis.com/flutter-ai-playground-f8e3b.firebasestorage.app/music_files/xxx.mp3"
95
52
  ```
96
53
 
97
- ## Uploading Music (Avoid 403)
98
-
99
- Do NOT call Firebase Storage REST API directly — requests will be blocked by Security Rules (App Check).
100
-
101
- Use the Cloud Functions endpoint or CLI instead:
54
+ ## Commands
102
55
 
103
56
  ```bash
104
- # HTTP API (any language)
105
- curl -X POST https://us-central1-flutter-ai-playground-f8e3b.cloudfunctions.net/unifiedGatewayApi \
106
- -H "Content-Type: application/json" \
107
- -H "x-api-key: pushnetgo-xxx" \
108
- -d '{"action":"sync-music","projectId":"p1","url":"https://..."}'
109
-
110
- # CLI
111
- pushnetgo-cli sync-music --url "https://api.mureka.ai/output.mp3"
57
+ pushnetgo-cli chat "hello" — AI chat
58
+ pushnetgo-cli music list — list tracks
59
+ pushnetgo-cli music get <id> — track info
60
+ pushnetgo-cli music download <id> — download to local
61
+ pushnetgo-cli music upload --url URL — upload from URL
62
+ pushnetgo-cli music delete <id> — delete track
63
+ pushnetgo-cli token check — validate key
112
64
  ```
113
65
 
114
- Both methods use server-side Firebase Admin SDK to bypass Storage rules.
115
-
116
66
  ## API Key Format
117
67
 
118
- PushNetGo API keys use the format:
119
-
120
68
  ```
121
69
  pushnetgo-{32-character-hex-uuid}
122
70
  ```
123
-
124
- Example: `pushnetgo-6d122db2132d4a94a91a46e529fd2752`
125
-
126
- Keys are generated from the PushNetGo App Token Hub.
@@ -2,7 +2,7 @@
2
2
 
3
3
  const { Command } = require('commander');
4
4
  const program = new Command();
5
- const API_URL = 'https://us-central1-flutter-ai-playground-f8e3b.cloudfunctions.net/unifiedGatewayApi';
5
+ const API_URL = 'https://flutter-ai-playground-f8e3b.web.app/api';
6
6
  const VERSION = require('../package.json').version;
7
7
 
8
8
  program
@@ -111,8 +111,8 @@ if (process.argv.length <= 2) {
111
111
  pushnetgo-cli api-url — HTTP endpoint
112
112
 
113
113
  Setup guide: curl -s https://flutter-ai-playground-f8e3b.web.app/guide.sh | bash
114
- Public guide: GET https://flutter-ai-playground-f8e3b.web.app/api
115
- HTTP endpoint: ${API_URL}
114
+ Public API: POST https://flutter-ai-playground-f8e3b.web.app/api
115
+ Auth: x-api-key: pushnetgo-xxx
116
116
  Auth: x-api-key: pushnetgo-xxx
117
117
 
118
118
  No Firebase config needed. Any machine.`);
package/guide.sh CHANGED
@@ -7,8 +7,8 @@ set -e
7
7
 
8
8
  KEY="${1:-$MYAPP_API_KEY}"
9
9
  CLI="pushnetgo-cli"
10
- API="https://us-central1-flutter-ai-playground-f8e3b.cloudfunctions.net/unifiedGatewayApi"
11
- UPLOAD="https://flutter-ai-playground-f8e3b.web.app/api/pushnetgo-upload"
10
+ API="https://flutter-ai-playground-f8e3b.web.app/api"
11
+ UPLOAD="https://flutter-ai-playground-f8e3b.web.app/api"
12
12
 
13
13
  echo ""
14
14
  echo "=============================================="
@@ -1,7 +1,7 @@
1
1
  const https = require('https');
2
2
  const http = require('http');
3
3
 
4
- const API_URL = 'https://us-central1-flutter-ai-playground-f8e3b.cloudfunctions.net/unifiedGatewayApi';
4
+ const API_URL = 'https://flutter-ai-playground-f8e3b.web.app/api';
5
5
 
6
6
  const fs = require('fs');
7
7
  const path = require('path');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pushnetgo-cli",
3
- "version": "1.1.2",
3
+ "version": "1.2.0",
4
4
  "description": "PushNetGo App CLI — HTTP API: https://us-central1-flutter-ai-playground-f8e3b.cloudfunctions.net/unifiedGatewayApi",
5
5
  "bin": {
6
6
  "pushnetgo-cli": "./bin/pushnetgo-cli.js"