@mytmpvpn/mytmpvpn-cli 4.1.0 → 4.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/dist/mytmpvpn.js +42 -9
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +6 -6
- package/src/mytmpvpn.ts +4 -4
- package/tsconfig.json +2 -2
package/dist/mytmpvpn.js
CHANGED
|
@@ -1,18 +1,51 @@
|
|
|
1
1
|
#!/usr/bin/env -S NODE_NO_WARNINGS=1 node
|
|
2
2
|
"use strict";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
3
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
37
|
// Use NODE_NO_WARNINGS=1 to get rid of the fetch node deprecated API
|
|
5
38
|
// https://github.com/netlify/cli/issues/4608 -- but it hangs the process: https://github.com/nodejs/node/issues/21960
|
|
6
|
-
const fs = require("fs");
|
|
7
|
-
const path = require("path");
|
|
39
|
+
const fs = __importStar(require("fs"));
|
|
40
|
+
const path = __importStar(require("path"));
|
|
8
41
|
const commander_1 = require("commander");
|
|
9
|
-
const log = require("loglevel");
|
|
42
|
+
const log = __importStar(require("loglevel"));
|
|
10
43
|
log.setDefaultLevel("info");
|
|
11
|
-
const vpnlib = require("@mytmpvpn/mytmpvpn-common/models/vpn");
|
|
44
|
+
const vpnlib = __importStar(require("@mytmpvpn/mytmpvpn-common/models/vpn"));
|
|
12
45
|
const mytmpvpn_client_1 = require("@mytmpvpn/mytmpvpn-client");
|
|
13
|
-
const appconfig = require("@mytmpvpn/mytmpvpn-client/appconfig");
|
|
14
|
-
const userconfig = require("@mytmpvpn/mytmpvpn-client/userconfig");
|
|
15
|
-
const client = require("@mytmpvpn/mytmpvpn-client/client");
|
|
46
|
+
const appconfig = __importStar(require("@mytmpvpn/mytmpvpn-client/appconfig"));
|
|
47
|
+
const userconfig = __importStar(require("@mytmpvpn/mytmpvpn-client/userconfig"));
|
|
48
|
+
const client = __importStar(require("@mytmpvpn/mytmpvpn-client/client"));
|
|
16
49
|
const program = new commander_1.Command();
|
|
17
50
|
function handleError(error, verbose = false) {
|
|
18
51
|
if (error.response) {
|
|
@@ -74,10 +107,10 @@ program.command('get-peanuts-balance')
|
|
|
74
107
|
}).then(client => {
|
|
75
108
|
client.getPeanutsBalance().then(balance => {
|
|
76
109
|
log.info(balance);
|
|
77
|
-
}).catch(err => {
|
|
110
|
+
}).catch((err) => {
|
|
78
111
|
handleError(err);
|
|
79
112
|
});
|
|
80
|
-
}).catch(err => {
|
|
113
|
+
}).catch((err) => {
|
|
81
114
|
handleError(err, options.verbose);
|
|
82
115
|
});
|
|
83
116
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"root":["../src/mytmpvpn.ts"],"version":"5.9.3"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mytmpvpn/mytmpvpn-cli",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "MyTmpVpn CLI",
|
|
5
5
|
"main": "./dist/mytmpvpn.js",
|
|
6
6
|
"bin": {
|
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
},
|
|
31
31
|
"license": "GNU GPL",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@mytmpvpn/mytmpvpn-client": "^
|
|
34
|
-
"@mytmpvpn/mytmpvpn-common": "^
|
|
33
|
+
"@mytmpvpn/mytmpvpn-client": "^6.0.0",
|
|
34
|
+
"@mytmpvpn/mytmpvpn-common": "^8.0.0",
|
|
35
35
|
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
|
36
|
-
"commander": "^
|
|
36
|
+
"commander": "^14.0.1",
|
|
37
37
|
"eslint": "^8.57.1",
|
|
38
38
|
"eslint-config-standard-with-typescript": "^39.1.1",
|
|
39
39
|
"eslint-plugin-import": "^2.32.0",
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/jest": "^29.5.14",
|
|
46
|
-
"@types/node": "^
|
|
46
|
+
"@types/node": "^24.8.1",
|
|
47
47
|
"jest": "^29.7.0",
|
|
48
48
|
"ts-jest": "^29.4.5",
|
|
49
|
-
"typescript": "^
|
|
49
|
+
"typescript": "^5.9.3"
|
|
50
50
|
}
|
|
51
51
|
}
|
package/src/mytmpvpn.ts
CHANGED
|
@@ -78,10 +78,10 @@ program.command('get-peanuts-balance')
|
|
|
78
78
|
}).then(client => {
|
|
79
79
|
client.getPeanutsBalance().then(balance => {
|
|
80
80
|
log.info(balance)
|
|
81
|
-
}).catch(err => {
|
|
81
|
+
}).catch((err: any) => {
|
|
82
82
|
handleError(err)
|
|
83
83
|
})
|
|
84
|
-
}).catch(err => {
|
|
84
|
+
}).catch((err: any) => {
|
|
85
85
|
handleError(err, options.verbose)
|
|
86
86
|
})
|
|
87
87
|
})
|
|
@@ -97,7 +97,7 @@ program.command('list-regions')
|
|
|
97
97
|
.then(((regions: any) => {
|
|
98
98
|
log.info(JSON.stringify(regions, null, 2))
|
|
99
99
|
}))
|
|
100
|
-
.catch((err) => handleError(err))
|
|
100
|
+
.catch((err: any) => handleError(err))
|
|
101
101
|
})
|
|
102
102
|
|
|
103
103
|
program.command('list-regions-detailed')
|
|
@@ -111,7 +111,7 @@ program.command('list-regions-detailed')
|
|
|
111
111
|
.then(((regions: any) => {
|
|
112
112
|
log.info(JSON.stringify(regions, null, 2))
|
|
113
113
|
}))
|
|
114
|
-
.catch((err) => handleError(err))
|
|
114
|
+
.catch((err: any) => handleError(err))
|
|
115
115
|
})
|
|
116
116
|
|
|
117
117
|
program.command('create')
|
package/tsconfig.json
CHANGED
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
|
|
36
36
|
|
|
37
37
|
/* Modules */
|
|
38
|
-
"module": "
|
|
38
|
+
"module": "Node16", /* Specify what module code is generated. */
|
|
39
39
|
// "rootDir": "./src", /* Specify the root folder within your source files. */
|
|
40
|
-
|
|
40
|
+
"moduleResolution": "node16", /* Specify how TypeScript looks up a file from a given module specifier. */
|
|
41
41
|
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
|
42
42
|
//"typeRoots": ["./node_modules/@types"], /* Specify multiple folders that act like './node_modules/@types'. */
|
|
43
43
|
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|