@chabokan.net/cli 0.8.7 → 0.8.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.
@@ -1,434 +1,4 @@
1
1
  {
2
- "commands": {
3
- "deploy": {
4
- "aliases": [],
5
- "args": {},
6
- "description": "this command help you build and deploy your service to chabokan in easy way.",
7
- "flags": {
8
- "help": {
9
- "char": "h",
10
- "description": "Show CLI help.",
11
- "name": "help",
12
- "allowNo": false,
13
- "type": "boolean"
14
- },
15
- "path": {
16
- "char": "p",
17
- "description": "service path in your computer",
18
- "name": "path",
19
- "hasDynamicHelp": false,
20
- "multiple": false,
21
- "type": "option"
22
- },
23
- "service": {
24
- "char": "s",
25
- "description": "service name",
26
- "name": "service",
27
- "hasDynamicHelp": false,
28
- "multiple": false,
29
- "type": "option"
30
- }
31
- },
32
- "hasDynamicHelp": false,
33
- "hiddenAliases": [],
34
- "id": "deploy",
35
- "pluginAlias": "@chabokan.net/cli",
36
- "pluginName": "@chabokan.net/cli",
37
- "pluginType": "core",
38
- "strict": true,
39
- "enableJsonFlag": false,
40
- "isESM": true,
41
- "relativePath": [
42
- "lib",
43
- "commands",
44
- "deploy.js"
45
- ]
46
- },
47
- "login": {
48
- "aliases": [],
49
- "args": {},
50
- "description": "login to hub.chabokan.net account",
51
- "flags": {
52
- "help": {
53
- "char": "h",
54
- "description": "Show CLI help.",
55
- "name": "help",
56
- "allowNo": false,
57
- "type": "boolean"
58
- },
59
- "username": {
60
- "char": "u",
61
- "description": "your username",
62
- "name": "username",
63
- "hasDynamicHelp": false,
64
- "multiple": false,
65
- "type": "option"
66
- },
67
- "password": {
68
- "char": "p",
69
- "description": "your password",
70
- "name": "password",
71
- "hasDynamicHelp": false,
72
- "multiple": false,
73
- "type": "option"
74
- },
75
- "token": {
76
- "char": "t",
77
- "description": "login with api token",
78
- "name": "token",
79
- "hasDynamicHelp": false,
80
- "multiple": false,
81
- "type": "option"
82
- }
83
- },
84
- "hasDynamicHelp": false,
85
- "hiddenAliases": [],
86
- "id": "login",
87
- "pluginAlias": "@chabokan.net/cli",
88
- "pluginName": "@chabokan.net/cli",
89
- "pluginType": "core",
90
- "strict": true,
91
- "enableJsonFlag": false,
92
- "isESM": true,
93
- "relativePath": [
94
- "lib",
95
- "commands",
96
- "login.js"
97
- ]
98
- },
99
- "account:list": {
100
- "aliases": [],
101
- "args": {},
102
- "description": "show accounts list",
103
- "flags": {
104
- "help": {
105
- "char": "h",
106
- "description": "Show CLI help.",
107
- "name": "help",
108
- "allowNo": false,
109
- "type": "boolean"
110
- }
111
- },
112
- "hasDynamicHelp": false,
113
- "hiddenAliases": [],
114
- "id": "account:list",
115
- "pluginAlias": "@chabokan.net/cli",
116
- "pluginName": "@chabokan.net/cli",
117
- "pluginType": "core",
118
- "strict": true,
119
- "enableJsonFlag": false,
120
- "isESM": true,
121
- "relativePath": [
122
- "lib",
123
- "commands",
124
- "account",
125
- "list.js"
126
- ]
127
- },
128
- "account:remove": {
129
- "aliases": [],
130
- "args": {},
131
- "description": "remove account from list",
132
- "flags": {
133
- "help": {
134
- "char": "h",
135
- "description": "Show CLI help.",
136
- "name": "help",
137
- "allowNo": false,
138
- "type": "boolean"
139
- }
140
- },
141
- "hasDynamicHelp": false,
142
- "hiddenAliases": [],
143
- "id": "account:remove",
144
- "pluginAlias": "@chabokan.net/cli",
145
- "pluginName": "@chabokan.net/cli",
146
- "pluginType": "core",
147
- "strict": true,
148
- "enableJsonFlag": false,
149
- "isESM": true,
150
- "relativePath": [
151
- "lib",
152
- "commands",
153
- "account",
154
- "remove.js"
155
- ]
156
- },
157
- "account:use": {
158
- "aliases": [],
159
- "args": {},
160
- "description": "switch your default user between logged in users",
161
- "flags": {
162
- "help": {
163
- "char": "h",
164
- "description": "Show CLI help.",
165
- "name": "help",
166
- "allowNo": false,
167
- "type": "boolean"
168
- },
169
- "user": {
170
- "char": "u",
171
- "description": "default user",
172
- "name": "user",
173
- "hasDynamicHelp": false,
174
- "multiple": false,
175
- "type": "option"
176
- }
177
- },
178
- "hasDynamicHelp": false,
179
- "hiddenAliases": [],
180
- "id": "account:use",
181
- "pluginAlias": "@chabokan.net/cli",
182
- "pluginName": "@chabokan.net/cli",
183
- "pluginType": "core",
184
- "strict": true,
185
- "enableJsonFlag": false,
186
- "isESM": true,
187
- "relativePath": [
188
- "lib",
189
- "commands",
190
- "account",
191
- "use.js"
192
- ]
193
- },
194
- "service:list": {
195
- "aliases": [],
196
- "args": {},
197
- "description": "show account services list",
198
- "flags": {
199
- "help": {
200
- "char": "h",
201
- "description": "Show CLI help.",
202
- "name": "help",
203
- "allowNo": false,
204
- "type": "boolean"
205
- }
206
- },
207
- "hasDynamicHelp": false,
208
- "hiddenAliases": [],
209
- "id": "service:list",
210
- "pluginAlias": "@chabokan.net/cli",
211
- "pluginName": "@chabokan.net/cli",
212
- "pluginType": "core",
213
- "strict": true,
214
- "enableJsonFlag": false,
215
- "isESM": true,
216
- "relativePath": [
217
- "lib",
218
- "commands",
219
- "service",
220
- "list.js"
221
- ]
222
- },
223
- "service:logs": {
224
- "aliases": [],
225
- "args": {},
226
- "description": "read latest logs from service",
227
- "flags": {
228
- "help": {
229
- "char": "h",
230
- "description": "Show CLI help.",
231
- "name": "help",
232
- "allowNo": false,
233
- "type": "boolean"
234
- },
235
- "service": {
236
- "char": "s",
237
- "description": "service name",
238
- "name": "service",
239
- "hasDynamicHelp": false,
240
- "multiple": false,
241
- "type": "option"
242
- }
243
- },
244
- "hasDynamicHelp": false,
245
- "hiddenAliases": [],
246
- "id": "service:logs",
247
- "pluginAlias": "@chabokan.net/cli",
248
- "pluginName": "@chabokan.net/cli",
249
- "pluginType": "core",
250
- "strict": true,
251
- "enableJsonFlag": false,
252
- "isESM": true,
253
- "relativePath": [
254
- "lib",
255
- "commands",
256
- "service",
257
- "logs.js"
258
- ]
259
- },
260
- "service:resize": {
261
- "aliases": [],
262
- "args": {},
263
- "description": "resize a service",
264
- "flags": {
265
- "help": {
266
- "char": "h",
267
- "description": "Show CLI help.",
268
- "name": "help",
269
- "allowNo": false,
270
- "type": "boolean"
271
- },
272
- "service": {
273
- "char": "s",
274
- "description": "service name",
275
- "name": "service",
276
- "hasDynamicHelp": false,
277
- "multiple": false,
278
- "type": "option"
279
- },
280
- "ram": {
281
- "char": "r",
282
- "description": "RAM",
283
- "name": "ram",
284
- "hasDynamicHelp": false,
285
- "multiple": false,
286
- "type": "option"
287
- },
288
- "cpu": {
289
- "char": "c",
290
- "description": "CPU",
291
- "name": "cpu",
292
- "hasDynamicHelp": false,
293
- "multiple": false,
294
- "type": "option"
295
- },
296
- "disk": {
297
- "char": "d",
298
- "description": "DISK",
299
- "name": "disk",
300
- "hasDynamicHelp": false,
301
- "multiple": false,
302
- "type": "option"
303
- }
304
- },
305
- "hasDynamicHelp": false,
306
- "hiddenAliases": [],
307
- "id": "service:resize",
308
- "pluginAlias": "@chabokan.net/cli",
309
- "pluginName": "@chabokan.net/cli",
310
- "pluginType": "core",
311
- "strict": true,
312
- "enableJsonFlag": false,
313
- "isESM": true,
314
- "relativePath": [
315
- "lib",
316
- "commands",
317
- "service",
318
- "resize.js"
319
- ]
320
- },
321
- "service:restart": {
322
- "aliases": [],
323
- "args": {},
324
- "description": "restart a service",
325
- "flags": {
326
- "help": {
327
- "char": "h",
328
- "description": "Show CLI help.",
329
- "name": "help",
330
- "allowNo": false,
331
- "type": "boolean"
332
- },
333
- "service": {
334
- "char": "s",
335
- "description": "service name",
336
- "name": "service",
337
- "hasDynamicHelp": false,
338
- "multiple": false,
339
- "type": "option"
340
- }
341
- },
342
- "hasDynamicHelp": false,
343
- "hiddenAliases": [],
344
- "id": "service:restart",
345
- "pluginAlias": "@chabokan.net/cli",
346
- "pluginName": "@chabokan.net/cli",
347
- "pluginType": "core",
348
- "strict": true,
349
- "enableJsonFlag": false,
350
- "isESM": true,
351
- "relativePath": [
352
- "lib",
353
- "commands",
354
- "service",
355
- "restart.js"
356
- ]
357
- },
358
- "service:start": {
359
- "aliases": [],
360
- "args": {},
361
- "description": "start a service",
362
- "flags": {
363
- "help": {
364
- "char": "h",
365
- "description": "Show CLI help.",
366
- "name": "help",
367
- "allowNo": false,
368
- "type": "boolean"
369
- },
370
- "service": {
371
- "char": "s",
372
- "description": "service name",
373
- "name": "service",
374
- "hasDynamicHelp": false,
375
- "multiple": false,
376
- "type": "option"
377
- }
378
- },
379
- "hasDynamicHelp": false,
380
- "hiddenAliases": [],
381
- "id": "service:start",
382
- "pluginAlias": "@chabokan.net/cli",
383
- "pluginName": "@chabokan.net/cli",
384
- "pluginType": "core",
385
- "strict": true,
386
- "enableJsonFlag": false,
387
- "isESM": true,
388
- "relativePath": [
389
- "lib",
390
- "commands",
391
- "service",
392
- "start.js"
393
- ]
394
- },
395
- "service:stop": {
396
- "aliases": [],
397
- "args": {},
398
- "description": "stop a service",
399
- "flags": {
400
- "help": {
401
- "char": "h",
402
- "description": "Show CLI help.",
403
- "name": "help",
404
- "allowNo": false,
405
- "type": "boolean"
406
- },
407
- "service": {
408
- "char": "s",
409
- "description": "service name",
410
- "name": "service",
411
- "hasDynamicHelp": false,
412
- "multiple": false,
413
- "type": "option"
414
- }
415
- },
416
- "hasDynamicHelp": false,
417
- "hiddenAliases": [],
418
- "id": "service:stop",
419
- "pluginAlias": "@chabokan.net/cli",
420
- "pluginName": "@chabokan.net/cli",
421
- "pluginType": "core",
422
- "strict": true,
423
- "enableJsonFlag": false,
424
- "isESM": true,
425
- "relativePath": [
426
- "lib",
427
- "commands",
428
- "service",
429
- "stop.js"
430
- ]
431
- }
432
- },
433
- "version": "0.8.7"
2
+ "commands": {},
3
+ "version": "0.8.8"
434
4
  }
package/package.json CHANGED
@@ -1,27 +1,16 @@
1
1
  {
2
- "name": "@chabokan.net/cli",
3
- "version": "0.8.7",
2
+ "name": "@chabokan.net/cli",
3
+ "version": "0.8.8",
4
4
  "description": "Chabokan Cli for PaaS Services",
5
5
  "author": "Mohammad Abdi",
6
- "type": "module",
7
6
  "bin": {
8
- "chabok": "./bin/run"
7
+ "chabok": "./bin/run.js"
9
8
  },
10
- "homepage": "https://github.com/chabokan/cli",
11
- "license": "MIT",
12
- "main": "lib/index.js",
13
- "repository": "chabokan/cli",
14
- "files": [
15
- "/bin",
16
- "/lib",
17
- "/npm-shrinkwrap.json",
18
- "/oclif.manifest.json"
19
- ],
20
9
  "dependencies": {
21
- "@oclif/core": "^3.26.6",
22
- "@oclif/plugin-autocomplete": "^3.0.18",
10
+ "@oclif/core": "^3",
23
11
  "@oclif/plugin-help": "^6",
24
- "@oclif/plugin-plugins": "^5.1.3",
12
+ "@oclif/plugin-plugins": "^5",
13
+ "@oclif/plugin-autocomplete": "^3.0.18",
25
14
  "@oclif/plugin-version": "^2.1.2",
26
15
  "axios": "^1.7.2",
27
16
  "boxen": "^7.1.1",
@@ -40,29 +29,39 @@
40
29
  "tar": "^7.1.0"
41
30
  },
42
31
  "devDependencies": {
43
- "@oclif/test": "^4.0.2",
32
+ "@oclif/prettier-config": "^0.2.1",
33
+ "@oclif/test": "^4",
44
34
  "@types/chai": "^4",
35
+ "@types/mocha": "^10",
36
+ "@types/node": "^18",
37
+ "chai": "^4",
38
+ "eslint": "^8",
39
+ "eslint-config-oclif": "^5",
40
+ "eslint-config-oclif-typescript": "^3",
41
+ "eslint-config-prettier": "^9",
42
+ "mocha": "^10",
43
+ "oclif": "^4",
44
+ "shx": "^0.3.3",
45
+ "ts-node": "^10",
46
+ "typescript": "^5",
45
47
  "@types/fs-extra": "^11.0.4",
46
48
  "@types/inquirer": "^9.0.7",
47
- "@types/mocha": "^10.0.6",
48
- "@types/node": "^20.12.12",
49
49
  "@types/progress": "^2.0.7",
50
50
  "@types/semver": "^7.5.8",
51
- "@types/tar": "^6.1.13",
52
- "chai": "^5",
53
- "eslint": "^9.3.0",
54
- "eslint-config-oclif": "^5",
55
- "eslint-config-oclif-typescript": "^3.1.7",
56
- "mocha": "^10",
57
- "oclif": "^4",
58
- "shx": "^0.3.4",
59
- "ts-node": "^10.9.2",
60
- "tslib": "^2.6.2",
61
- "typescript": "^5.4.5"
51
+ "@types/tar": "^6.1.13"
62
52
  },
53
+ "files": [
54
+ "/bin",
55
+ "/dist",
56
+ "/oclif.manifest.json"
57
+ ],
58
+ "homepage": "https://github.com/chabokan/cli",
59
+ "license": "MIT",
60
+ "main": "dist/index.js",
61
+ "type": "module",
63
62
  "oclif": {
64
63
  "bin": "chabok",
65
- "commands": "./lib/commands",
64
+ "commands": "./dist/commands",
66
65
  "additionalHelpFlags": [
67
66
  "-h"
68
67
  ],
@@ -71,6 +70,7 @@
71
70
  ],
72
71
  "plugins": [
73
72
  "@oclif/plugin-help",
73
+ "@oclif/plugin-plugins",
74
74
  "@oclif/plugin-autocomplete",
75
75
  "@oclif/plugin-version"
76
76
  ],
@@ -84,16 +84,17 @@
84
84
  }
85
85
  }
86
86
  },
87
+ "repository": "chabokan/cli",
87
88
  "scripts": {
88
- "build": "shx rm -rf lib && rm -rf tsconfig.tsbuildinfo && tsc -b",
89
- "lint": "eslint . --ext .ts --config .eslintrc",
89
+ "build": "shx rm -rf dist && tsc -b",
90
+ "lint": "eslint . --ext .ts",
90
91
  "postpack": "shx rm -f oclif.manifest.json",
91
- "posttest": "yarn lint",
92
- "prepack": "yarn build && oclif manifest && oclif readme",
92
+ "posttest": "npm run lint",
93
+ "prepack": "oclif manifest && oclif readme",
93
94
  "test": "mocha --forbid-only \"test/**/*.test.ts\"",
94
95
  "version": "oclif readme && git add README.md"
95
96
  },
96
- "engines": {
97
+ "engines": {
97
98
  "node": ">=18.18.0"
98
99
  },
99
100
  "bugs": "https://github.com/chabokan/cli/issues",
@@ -105,5 +106,5 @@
105
106
  "cloud",
106
107
  "docker"
107
108
  ],
108
- "types": "lib/index.d.ts"
109
+ "types": "dist/index.d.ts"
109
110
  }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2019 Salesforce
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
package/bin/dev DELETED
@@ -1,17 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const oclif = require('@oclif/core')
4
-
5
- const path = require('path')
6
- const project = path.join(__dirname, '..', 'tsconfig.json')
7
-
8
- // In dev mode -> use ts-node and dev plugins
9
- process.env.NODE_ENV = 'development'
10
-
11
- require('ts-node').register({project})
12
-
13
- // In dev mode, always show stack traces
14
- oclif.settings.debug = true;
15
-
16
- // Start the CLI
17
- oclif.run().then(oclif.flush).catch(oclif.Errors.handle)
package/bin/run DELETED
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const oclif = require('@oclif/core')
4
-
5
- oclif.run().then(require('@oclif/core/flush')).catch(require('@oclif/core/handle'))
package/lib/base.d.ts DELETED
@@ -1,15 +0,0 @@
1
- import { Command } from '@oclif/core';
2
- export default abstract class extends Command {
3
- static flags: {
4
- help: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<void>;
5
- };
6
- axiosConfig: any;
7
- got: import("got").Got;
8
- read_config(): Promise<{
9
- users: {};
10
- default_user: string;
11
- }>;
12
- write_config(object: any): Promise<void>;
13
- get_services(filter?: {}): Promise<any>;
14
- init_run(): Promise<void>;
15
- }
package/lib/base.js DELETED
@@ -1,64 +0,0 @@
1
- import { Command, Flags } from '@oclif/core';
2
- import axios from 'axios';
3
- import { BASE_API_URL, GLOBAL_CONF_PATH } from './constants.js';
4
- import { checkUpdate, get_all_services, isEmptyObject, read_config_file } from './helper.js';
5
- import HttpsProxyAgent from 'https-proxy-agent';
6
- import * as fs from 'fs';
7
- import got from 'got';
8
- import * as https from 'https';
9
- class default_1 extends Command {
10
- constructor() {
11
- super(...arguments);
12
- this.axiosConfig = {
13
- ...axios.defaults
14
- };
15
- this.got = got.extend();
16
- }
17
- async read_config() {
18
- return read_config_file();
19
- }
20
- async write_config(object) {
21
- fs.writeFileSync(GLOBAL_CONF_PATH, JSON.stringify(object));
22
- }
23
- async get_services(filter = {}) {
24
- return await get_all_services(filter, this.axiosConfig);
25
- }
26
- async init_run() {
27
- await checkUpdate(this.config.version);
28
- const main_agent = new https.Agent({
29
- rejectUnauthorized: false
30
- });
31
- // @ts-ignore
32
- const gotConfig = {};
33
- this.axiosConfig.httpsAgent = main_agent;
34
- this.axiosConfig.baseURL = BASE_API_URL;
35
- gotConfig.prefixUrl = this.axiosConfig.baseURL;
36
- gotConfig.agent = { https: main_agent };
37
- const proxy = process.env.http_proxy || process.env.https_proxy;
38
- if (proxy) {
39
- this.log(`Using proxy server ${proxy}`);
40
- // @ts-ignore
41
- const agent = new HttpsProxyAgent(proxy);
42
- this.axiosConfig.httpsAgent = agent;
43
- this.axiosConfig.proxy = false;
44
- // @ts-ignore
45
- gotConfig.agent = { https: agent };
46
- }
47
- const config_json = read_config_file();
48
- this.got = got.extend(gotConfig);
49
- if (isEmptyObject(config_json) || isEmptyObject(config_json.users)) {
50
- return;
51
- }
52
- // @ts-ignore
53
- const token = config_json.users[config_json.default_user]["token"] || null;
54
- if (token) {
55
- this.axiosConfig.headers.Authorization = `Token ${token}`;
56
- gotConfig.headers = { Authorization: `Token ${token}` };
57
- }
58
- this.got = got.extend(gotConfig);
59
- }
60
- }
61
- default_1.flags = {
62
- help: Flags.help({ char: 'h' }),
63
- };
64
- export default default_1;