rustore 1.0.3 → 1.0.5
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 +92 -3
- package/dist/api/apps.d.ts +126 -1
- package/dist/api/apps.d.ts.map +1 -1
- package/dist/api/apps.js +396 -9
- package/dist/api/apps.js.map +1 -1
- package/dist/api/catalog.d.ts +25 -0
- package/dist/api/catalog.d.ts.map +1 -1
- package/dist/api/catalog.js +41 -0
- package/dist/api/catalog.js.map +1 -1
- package/dist/api/payments-app.d.ts +40 -0
- package/dist/api/payments-app.d.ts.map +1 -1
- package/dist/api/payments-app.js +70 -0
- package/dist/api/payments-app.js.map +1 -1
- package/dist/api/payments.d.ts +37 -0
- package/dist/api/payments.d.ts.map +1 -1
- package/dist/api/payments.js +56 -0
- package/dist/api/payments.js.map +1 -1
- package/dist/bin.js +498 -4
- package/dist/bin.js.map +1 -1
- package/dist/commands/apps.d.ts +81 -1
- package/dist/commands/apps.d.ts.map +1 -1
- package/dist/commands/apps.js +361 -0
- package/dist/commands/apps.js.map +1 -1
- package/dist/commands/catalog.d.ts +31 -0
- package/dist/commands/catalog.d.ts.map +1 -0
- package/dist/commands/catalog.js +117 -0
- package/dist/commands/catalog.js.map +1 -0
- package/dist/commands/feedback.js +2 -2
- package/dist/commands/feedback.js.map +1 -1
- package/dist/commands/payments-app.d.ts +50 -0
- package/dist/commands/payments-app.d.ts.map +1 -0
- package/dist/commands/payments-app.js +197 -0
- package/dist/commands/payments-app.js.map +1 -0
- package/dist/commands/payments.d.ts +42 -0
- package/dist/commands/payments.d.ts.map +1 -0
- package/dist/commands/payments.js +152 -0
- package/dist/commands/payments.js.map +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +35 -11
- package/dist/config.js.map +1 -1
- package/dist/types.d.ts +445 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +8 -8
- package/README.en.md +0 -331
package/README.en.md
DELETED
|
@@ -1,331 +0,0 @@
|
|
|
1
|
-
<div align="center">
|
|
2
|
-
<img src="assets/icon.png" alt="rustore CLI" width="128" height="128">
|
|
3
|
-
<h1>rustore<br>CLI for RuStore API</h1>
|
|
4
|
-
<p>Command-line interface for interacting with RuStore API</p>
|
|
5
|
-
<p>
|
|
6
|
-
<a href="README.en.md">English</a> | <a href="README.md">Русский</a>
|
|
7
|
-
</p>
|
|
8
|
-
</div>
|
|
9
|
-
|
|
10
|
-
[![NPM version][npm-image]][npm-url]
|
|
11
|
-
![npm-typescript]
|
|
12
|
-
[![License][github-license]][github-license-url]
|
|
13
|
-
|
|
14
|
-
## 🌟 Features
|
|
15
|
-
|
|
16
|
-
- 🔐 Authentication via private key from RuStore Console
|
|
17
|
-
- 🔑 Automatic access token management
|
|
18
|
-
- 📦 Work with RuStore API (payments, subscriptions, applications)
|
|
19
|
-
- 📄 JSON output format (`--json`) for convenient integration and processing
|
|
20
|
-
- ⚙️ Configuration saved in `~/.rustore/config.json`
|
|
21
|
-
- 🧪 Full test coverage
|
|
22
|
-
|
|
23
|
-
## 🛠️ Installation
|
|
24
|
-
|
|
25
|
-
### Global Installation
|
|
26
|
-
|
|
27
|
-
```sh
|
|
28
|
-
npm install -g rustore
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
After installation, use the command:
|
|
32
|
-
|
|
33
|
-
```sh
|
|
34
|
-
rustore --help
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
### Using via npx (without installation)
|
|
38
|
-
|
|
39
|
-
You can use the CLI without installation via `npx`:
|
|
40
|
-
|
|
41
|
-
```sh
|
|
42
|
-
npx rustore --help
|
|
43
|
-
npx rustore login --key-id <keyId> --key <privateKey>
|
|
44
|
-
npx rustore apps list
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### Local Installation
|
|
48
|
-
|
|
49
|
-
```sh
|
|
50
|
-
npm install rustore
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
## 📖 Usage
|
|
54
|
-
|
|
55
|
-
### Initial Setup
|
|
56
|
-
|
|
57
|
-
Before using the CLI, you need to obtain a private key from [RuStore Console](https://console.rustore.ru/sign-in).
|
|
58
|
-
|
|
59
|
-
### Authentication
|
|
60
|
-
|
|
61
|
-
```sh
|
|
62
|
-
# Authentication with keyId and private key
|
|
63
|
-
rustore login --key-id <keyId> --key <base64-key>
|
|
64
|
-
|
|
65
|
-
# Or short form
|
|
66
|
-
rustore login -i <keyId> -k <base64-key>
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
**Example:**
|
|
70
|
-
|
|
71
|
-
```sh
|
|
72
|
-
rustore login --key-id 123456 --key MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC...
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
### Check Status
|
|
76
|
-
|
|
77
|
-
```sh
|
|
78
|
-
# Show information about current authentication
|
|
79
|
-
rustore whoami
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
### Logout
|
|
83
|
-
|
|
84
|
-
```sh
|
|
85
|
-
# Remove token (keys remain in config)
|
|
86
|
-
rustore logout
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
### Working with Applications
|
|
90
|
-
|
|
91
|
-
```sh
|
|
92
|
-
# Get list of applications
|
|
93
|
-
rustore apps list
|
|
94
|
-
|
|
95
|
-
# Get all applications (with pagination)
|
|
96
|
-
rustore apps list --all
|
|
97
|
-
|
|
98
|
-
# Output result in JSON format (convenient for scripts and integrations)
|
|
99
|
-
rustore apps list --json
|
|
100
|
-
|
|
101
|
-
# Combining options: get all applications in JSON format
|
|
102
|
-
rustore apps list --all --json
|
|
103
|
-
|
|
104
|
-
# Filtering with JSON output
|
|
105
|
-
rustore apps list --app-name "MyApp" --json
|
|
106
|
-
rustore apps list --app-status PUBLISHED --json
|
|
107
|
-
|
|
108
|
-
# Create draft version of application
|
|
109
|
-
rustore apps create-draft --app-id 123456 --version-name "1.0.0" --version-code 1
|
|
110
|
-
|
|
111
|
-
# Create draft version with JSON output
|
|
112
|
-
rustore apps create-draft --app-id 123456 --version-name "2.0.0" --version-code 2 --json
|
|
113
|
-
|
|
114
|
-
# Upload APK file for version (is-main-apk is required)
|
|
115
|
-
rustore apps upload-apk --package-name com.example.app --version-id 789 --file ./app-release.apk --is-main-apk true
|
|
116
|
-
|
|
117
|
-
# Upload APK file with Huawei Mobile Services
|
|
118
|
-
rustore apps upload-apk --package-name com.example.app --version-id 789 --file ./app-release.apk --is-main-apk false --services-type HMS
|
|
119
|
-
|
|
120
|
-
# Upload APK file with JSON output
|
|
121
|
-
rustore apps upload-apk --package-name com.example.app --version-id 789 --file ./app-release.apk --is-main-apk true --json
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
### Working with Feedback
|
|
125
|
-
|
|
126
|
-
```sh
|
|
127
|
-
# Get application feedback
|
|
128
|
-
rustore feedback list --package-name com.example.app
|
|
129
|
-
|
|
130
|
-
# Get all feedback (with pagination)
|
|
131
|
-
rustore feedback list --package-name com.example.app --all
|
|
132
|
-
|
|
133
|
-
# Get feedback in JSON format
|
|
134
|
-
rustore feedback list --package-name com.example.app --json
|
|
135
|
-
|
|
136
|
-
# Leave a response to feedback
|
|
137
|
-
rustore feedback answer --package-name com.example.app --comment-id 123456 --text "Thank you for your feedback!"
|
|
138
|
-
|
|
139
|
-
# Get feedback response status
|
|
140
|
-
rustore feedback status --package-name com.example.app --feedback-id 789
|
|
141
|
-
|
|
142
|
-
# Get all feedback responses
|
|
143
|
-
rustore feedback status --package-name com.example.app
|
|
144
|
-
|
|
145
|
-
# Update feedback response
|
|
146
|
-
rustore feedback update --package-name com.example.app --feedback-id 789 --text "Updated response"
|
|
147
|
-
|
|
148
|
-
# Delete feedback response
|
|
149
|
-
rustore feedback delete --package-name com.example.app --feedback-id 789
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
**💡 Tip:** The `--json` flag is useful for:
|
|
153
|
-
|
|
154
|
-
- Automation and scripts
|
|
155
|
-
- Integration with other tools
|
|
156
|
-
- Data processing via `jq` or other JSON parsers
|
|
157
|
-
- Saving results to file: `rustore apps list --json > apps.json`
|
|
158
|
-
|
|
159
|
-
## 📁 Configuration
|
|
160
|
-
|
|
161
|
-
The CLI saves configuration in `~/.rustore/config.json`:
|
|
162
|
-
|
|
163
|
-
```json
|
|
164
|
-
{
|
|
165
|
-
"keyId": "your-key-id",
|
|
166
|
-
"privateKey": "your-private-key-base64",
|
|
167
|
-
"token": "jwe-token",
|
|
168
|
-
"tokenExpiresAt": 1234567890
|
|
169
|
-
}
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
## 🔧 Development
|
|
173
|
-
|
|
174
|
-
### Installing Dependencies
|
|
175
|
-
|
|
176
|
-
```sh
|
|
177
|
-
npm install
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
### Building
|
|
181
|
-
|
|
182
|
-
```sh
|
|
183
|
-
npm run build
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
### Running in Development Mode
|
|
187
|
-
|
|
188
|
-
```sh
|
|
189
|
-
npm start
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
### Testing
|
|
193
|
-
|
|
194
|
-
```sh
|
|
195
|
-
# Run all tests
|
|
196
|
-
npm test
|
|
197
|
-
|
|
198
|
-
# Tests in watch mode
|
|
199
|
-
npm run test:watch
|
|
200
|
-
|
|
201
|
-
# With coverage
|
|
202
|
-
npm run test:coverage
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
#### How to Test Current Changes
|
|
206
|
-
|
|
207
|
-
1. **Build the project:**
|
|
208
|
-
|
|
209
|
-
```sh
|
|
210
|
-
npm run build
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-
2. **Type checking:**
|
|
214
|
-
|
|
215
|
-
```sh
|
|
216
|
-
npm run type-check
|
|
217
|
-
# or
|
|
218
|
-
./node_modules/.bin/tsc --noEmit
|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
3. **Run tests:**
|
|
222
|
-
|
|
223
|
-
```sh
|
|
224
|
-
npm test
|
|
225
|
-
```
|
|
226
|
-
|
|
227
|
-
4. **Test CLI locally:**
|
|
228
|
-
|
|
229
|
-
```sh
|
|
230
|
-
# Run without installation (via tsx)
|
|
231
|
-
npm start -- login <keyId> --key <key>
|
|
232
|
-
|
|
233
|
-
# Or after build
|
|
234
|
-
node dist/bin.js whoami
|
|
235
|
-
```
|
|
236
|
-
|
|
237
|
-
5. **Linting:**
|
|
238
|
-
```sh
|
|
239
|
-
npm run lint
|
|
240
|
-
npm run lint:fix
|
|
241
|
-
```
|
|
242
|
-
|
|
243
|
-
### Type Checking
|
|
244
|
-
|
|
245
|
-
```sh
|
|
246
|
-
npm run type-check
|
|
247
|
-
```
|
|
248
|
-
|
|
249
|
-
### Linting
|
|
250
|
-
|
|
251
|
-
```sh
|
|
252
|
-
npm run lint
|
|
253
|
-
npm run lint:fix
|
|
254
|
-
```
|
|
255
|
-
|
|
256
|
-
## 📚 API
|
|
257
|
-
|
|
258
|
-
### API Structure
|
|
259
|
-
|
|
260
|
-
The API is organized by categories, as in RuStore documentation:
|
|
261
|
-
|
|
262
|
-
- **Apps API** (`appsApi`) - Application upload and publication (general methods)
|
|
263
|
-
- **Payments API** (`paymentsApi`) - Working with payments and subscriptions (general methods)
|
|
264
|
-
- **Payments App API** (`paymentsAppApi`) - Working with payments and subscriptions (application methods)
|
|
265
|
-
- **Catalog API** (`catalogApi`) - Product catalog API
|
|
266
|
-
- **Feedback API** (`feedbackApi`) - Working with application feedback
|
|
267
|
-
|
|
268
|
-
### Programmatic Access
|
|
269
|
-
|
|
270
|
-
```typescript
|
|
271
|
-
import {login, appsApi, paymentsApi, catalogApi, feedbackApi} from 'rustore';
|
|
272
|
-
|
|
273
|
-
// Authentication
|
|
274
|
-
await login('keyId', 'privateKey');
|
|
275
|
-
|
|
276
|
-
// Get list of applications
|
|
277
|
-
const appsResponse = await appsApi.getAppList();
|
|
278
|
-
console.log(appsResponse.body.content);
|
|
279
|
-
|
|
280
|
-
// Get all applications (with automatic pagination)
|
|
281
|
-
const allApps = await appsApi.getAllApps();
|
|
282
|
-
|
|
283
|
-
// Create draft version of application
|
|
284
|
-
const draftVersion = await appsApi.createDraftVersion(123456, {
|
|
285
|
-
versionName: '1.0.0',
|
|
286
|
-
versionCode: 1,
|
|
287
|
-
});
|
|
288
|
-
|
|
289
|
-
// Upload APK file for version
|
|
290
|
-
const uploadResult = await appsApi.uploadApkFile(
|
|
291
|
-
'com.example.app', // packageName instead of appId
|
|
292
|
-
draftVersion.body?.versionId || 789,
|
|
293
|
-
'./app-release.apk',
|
|
294
|
-
{
|
|
295
|
-
isMainApk: true, // required parameter
|
|
296
|
-
servicesType: 'Unknown', // optional: 'HMS' or 'Unknown'
|
|
297
|
-
},
|
|
298
|
-
);
|
|
299
|
-
|
|
300
|
-
// Get application feedback
|
|
301
|
-
const feedbackResponse = await feedbackApi.getFeedback('com.example.app');
|
|
302
|
-
|
|
303
|
-
// Leave a response to feedback
|
|
304
|
-
const answerResponse = await feedbackApi.createFeedbackAnswer('com.example.app', 123456, {
|
|
305
|
-
text: 'Thank you for your feedback!',
|
|
306
|
-
});
|
|
307
|
-
|
|
308
|
-
// Get feedback response status
|
|
309
|
-
const statusResponse = await feedbackApi.getFeedbackAnswerStatus('com.example.app', 789);
|
|
310
|
-
|
|
311
|
-
// Using other API categories
|
|
312
|
-
// await paymentsApi.refund(...);
|
|
313
|
-
// await catalogApi.getProducts(...);
|
|
314
|
-
```
|
|
315
|
-
|
|
316
|
-
## 🔗 Useful Links
|
|
317
|
-
|
|
318
|
-
- [RuStore API Documentation](https://www.rustore.ru/help/en/work-with-rustore-api)
|
|
319
|
-
- [Authorization Process](https://www.rustore.ru/help/work-with-rustore-api/api-authorization-token)
|
|
320
|
-
- [RuStore Console](https://console.rustore.ru/sign-in)
|
|
321
|
-
|
|
322
|
-
## 📝 License
|
|
323
|
-
|
|
324
|
-
MIT
|
|
325
|
-
|
|
326
|
-
[package-name]: rustore
|
|
327
|
-
[npm-url]: https://www.npmjs.com/package/rustore
|
|
328
|
-
[npm-image]: https://img.shields.io/npm/v/rustore
|
|
329
|
-
[github-license]: https://img.shields.io/github/license/romankurnovskii/rustore
|
|
330
|
-
[github-license-url]: https://github.com/romankurnovskii/rustore/blob/main/LICENSE
|
|
331
|
-
[npm-typescript]: https://img.shields.io/npm/types/rustore
|