@chabokan.net/cli 0.8.6 → 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,312 +1,4 @@
1
1
  {
2
- "version": "0.8.6",
3
- "commands": {
4
- "deploy": {
5
- "id": "deploy",
6
- "description": "this command help you build and deploy your service to chabokan in easy way.",
7
- "strict": true,
8
- "pluginName": "@chabokan.net/cli",
9
- "pluginAlias": "@chabokan.net/cli",
10
- "pluginType": "core",
11
- "aliases": [],
12
- "flags": {
13
- "help": {
14
- "name": "help",
15
- "type": "boolean",
16
- "char": "h",
17
- "description": "Show CLI help.",
18
- "allowNo": false
19
- },
20
- "path": {
21
- "name": "path",
22
- "type": "option",
23
- "char": "p",
24
- "description": "service path in your computer",
25
- "multiple": false
26
- },
27
- "service": {
28
- "name": "service",
29
- "type": "option",
30
- "char": "s",
31
- "description": "service name",
32
- "multiple": false
33
- }
34
- },
35
- "args": {}
36
- },
37
- "login": {
38
- "id": "login",
39
- "description": "login to hub.chabokan.net account",
40
- "strict": true,
41
- "pluginName": "@chabokan.net/cli",
42
- "pluginAlias": "@chabokan.net/cli",
43
- "pluginType": "core",
44
- "aliases": [],
45
- "flags": {
46
- "help": {
47
- "name": "help",
48
- "type": "boolean",
49
- "char": "h",
50
- "description": "Show CLI help.",
51
- "allowNo": false
52
- },
53
- "username": {
54
- "name": "username",
55
- "type": "option",
56
- "char": "u",
57
- "description": "your username",
58
- "multiple": false
59
- },
60
- "password": {
61
- "name": "password",
62
- "type": "option",
63
- "char": "p",
64
- "description": "your password",
65
- "multiple": false
66
- },
67
- "token": {
68
- "name": "token",
69
- "type": "option",
70
- "char": "t",
71
- "description": "login with api token",
72
- "multiple": false
73
- }
74
- },
75
- "args": {}
76
- },
77
- "account:list": {
78
- "id": "account:list",
79
- "description": "show accounts list",
80
- "strict": true,
81
- "pluginName": "@chabokan.net/cli",
82
- "pluginAlias": "@chabokan.net/cli",
83
- "pluginType": "core",
84
- "aliases": [],
85
- "flags": {
86
- "help": {
87
- "name": "help",
88
- "type": "boolean",
89
- "char": "h",
90
- "description": "Show CLI help.",
91
- "allowNo": false
92
- }
93
- },
94
- "args": {}
95
- },
96
- "account:remove": {
97
- "id": "account:remove",
98
- "description": "remove account from list",
99
- "strict": true,
100
- "pluginName": "@chabokan.net/cli",
101
- "pluginAlias": "@chabokan.net/cli",
102
- "pluginType": "core",
103
- "aliases": [],
104
- "flags": {
105
- "help": {
106
- "name": "help",
107
- "type": "boolean",
108
- "char": "h",
109
- "description": "Show CLI help.",
110
- "allowNo": false
111
- }
112
- },
113
- "args": {}
114
- },
115
- "account:use": {
116
- "id": "account:use",
117
- "description": "switch your default user between logged in users",
118
- "strict": true,
119
- "pluginName": "@chabokan.net/cli",
120
- "pluginAlias": "@chabokan.net/cli",
121
- "pluginType": "core",
122
- "aliases": [],
123
- "flags": {
124
- "help": {
125
- "name": "help",
126
- "type": "boolean",
127
- "char": "h",
128
- "description": "Show CLI help.",
129
- "allowNo": false
130
- },
131
- "user": {
132
- "name": "user",
133
- "type": "option",
134
- "char": "u",
135
- "description": "default user",
136
- "multiple": false
137
- }
138
- },
139
- "args": {}
140
- },
141
- "service:list": {
142
- "id": "service:list",
143
- "description": "show account services list",
144
- "strict": true,
145
- "pluginName": "@chabokan.net/cli",
146
- "pluginAlias": "@chabokan.net/cli",
147
- "pluginType": "core",
148
- "aliases": [],
149
- "flags": {
150
- "help": {
151
- "name": "help",
152
- "type": "boolean",
153
- "char": "h",
154
- "description": "Show CLI help.",
155
- "allowNo": false
156
- }
157
- },
158
- "args": {}
159
- },
160
- "service:logs": {
161
- "id": "service:logs",
162
- "description": "read latest logs from service",
163
- "strict": true,
164
- "pluginName": "@chabokan.net/cli",
165
- "pluginAlias": "@chabokan.net/cli",
166
- "pluginType": "core",
167
- "aliases": [],
168
- "flags": {
169
- "help": {
170
- "name": "help",
171
- "type": "boolean",
172
- "char": "h",
173
- "description": "Show CLI help.",
174
- "allowNo": false
175
- },
176
- "service": {
177
- "name": "service",
178
- "type": "option",
179
- "char": "s",
180
- "description": "service name",
181
- "multiple": false
182
- }
183
- },
184
- "args": {}
185
- },
186
- "service:resize": {
187
- "id": "service:resize",
188
- "description": "resize a service",
189
- "strict": true,
190
- "pluginName": "@chabokan.net/cli",
191
- "pluginAlias": "@chabokan.net/cli",
192
- "pluginType": "core",
193
- "aliases": [],
194
- "flags": {
195
- "help": {
196
- "name": "help",
197
- "type": "boolean",
198
- "char": "h",
199
- "description": "Show CLI help.",
200
- "allowNo": false
201
- },
202
- "service": {
203
- "name": "service",
204
- "type": "option",
205
- "char": "s",
206
- "description": "service name",
207
- "multiple": false
208
- },
209
- "ram": {
210
- "name": "ram",
211
- "type": "option",
212
- "char": "r",
213
- "description": "RAM",
214
- "multiple": false
215
- },
216
- "cpu": {
217
- "name": "cpu",
218
- "type": "option",
219
- "char": "c",
220
- "description": "CPU",
221
- "multiple": false
222
- },
223
- "disk": {
224
- "name": "disk",
225
- "type": "option",
226
- "char": "d",
227
- "description": "DISK",
228
- "multiple": false
229
- }
230
- },
231
- "args": {}
232
- },
233
- "service:restart": {
234
- "id": "service:restart",
235
- "description": "restart a service",
236
- "strict": true,
237
- "pluginName": "@chabokan.net/cli",
238
- "pluginAlias": "@chabokan.net/cli",
239
- "pluginType": "core",
240
- "aliases": [],
241
- "flags": {
242
- "help": {
243
- "name": "help",
244
- "type": "boolean",
245
- "char": "h",
246
- "description": "Show CLI help.",
247
- "allowNo": false
248
- },
249
- "service": {
250
- "name": "service",
251
- "type": "option",
252
- "char": "s",
253
- "description": "service name",
254
- "multiple": false
255
- }
256
- },
257
- "args": {}
258
- },
259
- "service:start": {
260
- "id": "service:start",
261
- "description": "start a service",
262
- "strict": true,
263
- "pluginName": "@chabokan.net/cli",
264
- "pluginAlias": "@chabokan.net/cli",
265
- "pluginType": "core",
266
- "aliases": [],
267
- "flags": {
268
- "help": {
269
- "name": "help",
270
- "type": "boolean",
271
- "char": "h",
272
- "description": "Show CLI help.",
273
- "allowNo": false
274
- },
275
- "service": {
276
- "name": "service",
277
- "type": "option",
278
- "char": "s",
279
- "description": "service name",
280
- "multiple": false
281
- }
282
- },
283
- "args": {}
284
- },
285
- "service:stop": {
286
- "id": "service:stop",
287
- "description": "stop a service",
288
- "strict": true,
289
- "pluginName": "@chabokan.net/cli",
290
- "pluginAlias": "@chabokan.net/cli",
291
- "pluginType": "core",
292
- "aliases": [],
293
- "flags": {
294
- "help": {
295
- "name": "help",
296
- "type": "boolean",
297
- "char": "h",
298
- "description": "Show CLI help.",
299
- "allowNo": false
300
- },
301
- "service": {
302
- "name": "service",
303
- "type": "option",
304
- "char": "s",
305
- "description": "service name",
306
- "multiple": false
307
- }
308
- },
309
- "args": {}
310
- }
311
- }
2
+ "commands": {},
3
+ "version": "0.8.8"
312
4
  }
package/package.json CHANGED
@@ -1,67 +1,67 @@
1
1
  {
2
- "name": "@chabokan.net/cli",
3
- "version": "0.8.6",
2
+ "name": "@chabokan.net/cli",
3
+ "version": "0.8.8",
4
4
  "description": "Chabokan Cli for PaaS Services",
5
5
  "author": "Mohammad Abdi",
6
6
  "bin": {
7
- "chabok": "./bin/run"
7
+ "chabok": "./bin/run.js"
8
8
  },
9
- "homepage": "https://github.com/chabokan/cli",
10
- "license": "MIT",
11
- "main": "lib/index.js",
12
- "repository": "chabokan/cli",
13
- "files": [
14
- "/bin",
15
- "/lib",
16
- "/npm-shrinkwrap.json",
17
- "/oclif.manifest.json"
18
- ],
19
9
  "dependencies": {
20
- "@oclif/core": "^1.18.0",
21
- "@oclif/plugin-autocomplete": "^1.3.3",
22
- "@oclif/plugin-help": "^5",
23
- "@oclif/plugin-plugins": "^2.1.2",
24
- "@oclif/plugin-version": "^1.1.3",
25
- "axios": "^1.1.3",
26
- "boxen": "^5.1.2",
27
- "chalk": "^4.1.2",
10
+ "@oclif/core": "^3",
11
+ "@oclif/plugin-help": "^6",
12
+ "@oclif/plugin-plugins": "^5",
13
+ "@oclif/plugin-autocomplete": "^3.0.18",
14
+ "@oclif/plugin-version": "^2.1.2",
15
+ "axios": "^1.7.2",
16
+ "boxen": "^7.1.1",
17
+ "chalk": "^5.3.0",
28
18
  "form-data": "^4.0.0",
29
- "fs-extra": "^9.1.0",
30
- "globby": "^11.1.0",
31
- "got": "^11.8.2",
32
- "https-proxy-agent": "^5.0.1",
33
- "ignore": "^5.1.0",
34
- "inquirer": "^8.2.4",
35
- "package-json": "^6.5.0",
19
+ "fs-extra": "^11.2.0",
20
+ "globby": "^14.0.1",
21
+ "got": "^13.0.0",
22
+ "https-proxy-agent": "^7.0.4",
23
+ "ignore": "^5.3.1",
24
+ "inquirer": "^9.2.22",
25
+ "package-json": "^10.0.0",
36
26
  "progress": "^2.0.3",
37
- "semver": "^7.3.8",
38
- "semver-diff": "^3.1.1",
39
- "tar": "^6.1.11"
27
+ "semver": "^7.6.2",
28
+ "semver-diff": "^4.0.0",
29
+ "tar": "^7.1.0"
40
30
  },
41
31
  "devDependencies": {
42
- "@oclif/test": "^2.2.3",
32
+ "@oclif/prettier-config": "^0.2.1",
33
+ "@oclif/test": "^4",
43
34
  "@types/chai": "^4",
44
- "@types/fs-extra": "^5.0.5",
45
- "@types/inquirer": "^9.0.2",
46
- "@types/mocha": "^9.0.0",
47
- "@types/node": "^16.11.65",
48
- "@types/progress": "^2.0.3",
49
- "@types/semver": "^7.3.12",
50
- "@types/tar": "^6.1.3",
35
+ "@types/mocha": "^10",
36
+ "@types/node": "^18",
51
37
  "chai": "^4",
52
- "eslint": "^7.32.0",
53
- "eslint-config-oclif": "^4",
54
- "eslint-config-oclif-typescript": "^1.0.3",
55
- "mocha": "^9",
56
- "oclif": "^3",
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",
57
44
  "shx": "^0.3.3",
58
- "ts-node": "^10.9.1",
59
- "tslib": "^2.3.1",
60
- "typescript": "^4.8.4"
45
+ "ts-node": "^10",
46
+ "typescript": "^5",
47
+ "@types/fs-extra": "^11.0.4",
48
+ "@types/inquirer": "^9.0.7",
49
+ "@types/progress": "^2.0.7",
50
+ "@types/semver": "^7.5.8",
51
+ "@types/tar": "^6.1.13"
61
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",
62
62
  "oclif": {
63
63
  "bin": "chabok",
64
- "commands": "./lib/commands",
64
+ "commands": "./dist/commands",
65
65
  "additionalHelpFlags": [
66
66
  "-h"
67
67
  ],
@@ -70,6 +70,7 @@
70
70
  ],
71
71
  "plugins": [
72
72
  "@oclif/plugin-help",
73
+ "@oclif/plugin-plugins",
73
74
  "@oclif/plugin-autocomplete",
74
75
  "@oclif/plugin-version"
75
76
  ],
@@ -83,17 +84,18 @@
83
84
  }
84
85
  }
85
86
  },
87
+ "repository": "chabokan/cli",
86
88
  "scripts": {
87
- "build": "shx rm -rf lib && rm -rf tsconfig.tsbuildinfo && tsc -b",
88
- "lint": "eslint . --ext .ts --config .eslintrc",
89
+ "build": "shx rm -rf dist && tsc -b",
90
+ "lint": "eslint . --ext .ts",
89
91
  "postpack": "shx rm -f oclif.manifest.json",
90
- "posttest": "yarn lint",
91
- "prepack": "yarn build && oclif manifest && oclif readme",
92
+ "posttest": "npm run lint",
93
+ "prepack": "oclif manifest && oclif readme",
92
94
  "test": "mocha --forbid-only \"test/**/*.test.ts\"",
93
95
  "version": "oclif readme && git add README.md"
94
96
  },
95
- "engines": {
96
- "node": ">=16.0.0"
97
+ "engines": {
98
+ "node": ">=18.18.0"
97
99
  },
98
100
  "bugs": "https://github.com/chabokan/cli/issues",
99
101
  "keywords": [
@@ -104,5 +106,5 @@
104
106
  "cloud",
105
107
  "docker"
106
108
  ],
107
- "types": "lib/index.d.ts"
109
+ "types": "dist/index.d.ts"
108
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").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,65 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const core_1 = require("@oclif/core");
5
- const axios_1 = tslib_1.__importDefault(require("axios"));
6
- const constants_1 = require("./constants");
7
- const helper_1 = require("./helper");
8
- const https_proxy_agent_1 = tslib_1.__importDefault(require("https-proxy-agent"));
9
- const fs = tslib_1.__importStar(require("fs"));
10
- const got_1 = tslib_1.__importDefault(require("got"));
11
- const https = tslib_1.__importStar(require("https"));
12
- class default_1 extends core_1.Command {
13
- constructor() {
14
- super(...arguments);
15
- this.axiosConfig = Object.assign({}, axios_1.default.defaults);
16
- this.got = got_1.default.extend();
17
- }
18
- async read_config() {
19
- return (0, helper_1.read_config_file)();
20
- }
21
- async write_config(object) {
22
- fs.writeFileSync(constants_1.GLOBAL_CONF_PATH, JSON.stringify(object));
23
- }
24
- async get_services(filter = {}) {
25
- return await (0, helper_1.get_all_services)(filter, this.axiosConfig);
26
- }
27
- async init_run() {
28
- await (0, helper_1.checkUpdate)(this.config.version);
29
- const main_agent = new https.Agent({
30
- rejectUnauthorized: false
31
- });
32
- // @ts-ignore
33
- const gotConfig = {};
34
- this.axiosConfig.httpsAgent = main_agent;
35
- this.axiosConfig.baseURL = constants_1.BASE_API_URL;
36
- gotConfig.prefixUrl = this.axiosConfig.baseURL;
37
- gotConfig.agent = { https: main_agent };
38
- const proxy = process.env.http_proxy || process.env.https_proxy;
39
- if (proxy) {
40
- this.log(`Using proxy server ${proxy}`);
41
- // @ts-ignore
42
- const agent = new https_proxy_agent_1.default(proxy);
43
- this.axiosConfig.httpsAgent = agent;
44
- this.axiosConfig.proxy = false;
45
- // @ts-ignore
46
- gotConfig.agent = { https: agent };
47
- }
48
- const config_json = (0, helper_1.read_config_file)();
49
- this.got = got_1.default.extend(gotConfig);
50
- if ((0, helper_1.isEmptyObject)(config_json) || (0, helper_1.isEmptyObject)(config_json.users)) {
51
- return;
52
- }
53
- // @ts-ignore
54
- const token = config_json.users[config_json.default_user]["token"] || null;
55
- if (token) {
56
- this.axiosConfig.headers.Authorization = `Token ${token}`;
57
- gotConfig.headers = { Authorization: `Token ${token}` };
58
- }
59
- this.got = got_1.default.extend(gotConfig);
60
- }
61
- }
62
- exports.default = default_1;
63
- default_1.flags = {
64
- help: core_1.Flags.help({ char: 'h' }),
65
- };
@@ -1,8 +0,0 @@
1
- import Command from "../../base";
2
- export default class AccountList extends Command {
3
- static description: string;
4
- static flags: {
5
- help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
6
- };
7
- run(): Promise<void>;
8
- }
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const base_1 = tslib_1.__importDefault(require("../../base"));
5
- const core_1 = require("@oclif/core");
6
- class AccountList extends base_1.default {
7
- async run() {
8
- const { args, flags } = await this.parse(AccountList);
9
- const cli = this;
10
- await this.init_run();
11
- const config_json = await this.read_config();
12
- if (Object.keys(config_json.users).length > 0) {
13
- const accounts_data = Object.keys(config_json.users).map((account) => {
14
- return {
15
- Name: account,
16
- };
17
- });
18
- core_1.CliUx.ux.table(accounts_data, {
19
- Name: {},
20
- }, flags);
21
- }
22
- else {
23
- cli.log("first you should login");
24
- return;
25
- }
26
- }
27
- }
28
- exports.default = AccountList;
29
- AccountList.description = 'show accounts list';
30
- AccountList.flags = Object.assign({}, base_1.default.flags);
@@ -1,8 +0,0 @@
1
- import Command from "../../base";
2
- export default class AccountRemove extends Command {
3
- static description: string;
4
- static flags: {
5
- help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
6
- };
7
- run(): Promise<void>;
8
- }