@mytmpvpn/mytmpvpn-cli 1.9.0 → 2.0.1
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/.eslintrc.js +30 -0
- package/LICENSE +661 -0
- package/dist/mytmpvpn.js +3 -1
- package/package.json +20 -12
- package/src/mytmpvpn.ts +3 -1
- package/#package-lock.json# +0 -6527
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mytmpvpn/mytmpvpn-cli",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "MyTmpVpn CLI",
|
|
5
5
|
"main": "./dist/mytmpvpn.js",
|
|
6
6
|
"bin": {
|
|
@@ -9,11 +9,13 @@
|
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"build": "tsc --build && chmod +x dist/mytmpvpn.js",
|
|
12
|
+
"lint": "eslint",
|
|
12
13
|
"watch": "tsc -w",
|
|
13
14
|
"test": "jest",
|
|
14
15
|
"clean": "rm -rf dist/",
|
|
15
|
-
"link-deps": "npm link ../mytmpvpn-common ../mytmpvpn-client",
|
|
16
|
-
"build-all": "./build-all-dependencies"
|
|
16
|
+
"link-deps": "(cd ../mytmpvpn-common && npm link) && (cd ../mytmpvpn-client && npm link) && npm link ../mytmpvpn-common ../mytmpvpn-client",
|
|
17
|
+
"build-all": "./build-all-dependencies",
|
|
18
|
+
"upgrade": "ncu --target semver --upgrade"
|
|
17
19
|
},
|
|
18
20
|
"keywords": [
|
|
19
21
|
"VPN"
|
|
@@ -25,16 +27,22 @@
|
|
|
25
27
|
},
|
|
26
28
|
"license": "GNU GPL",
|
|
27
29
|
"dependencies": {
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"@
|
|
31
|
-
"
|
|
30
|
+
"@mytmpvpn/mytmpvpn-client": "^2.4.2",
|
|
31
|
+
"@mytmpvpn/mytmpvpn-common": "^4.0.1",
|
|
32
|
+
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
|
33
|
+
"commander": "^9.5.0",
|
|
34
|
+
"eslint": "^8.57.1",
|
|
35
|
+
"eslint-config-standard-with-typescript": "^39.1.1",
|
|
36
|
+
"eslint-plugin-import": "^2.31.0",
|
|
37
|
+
"eslint-plugin-n": "^16.6.2",
|
|
38
|
+
"eslint-plugin-promise": "^6.6.0",
|
|
39
|
+
"loglevel": "^1.9.2"
|
|
32
40
|
},
|
|
33
41
|
"devDependencies": {
|
|
34
|
-
"@types/jest": "^29.
|
|
35
|
-
"@types/node": "^18.
|
|
36
|
-
"jest": "^29.
|
|
37
|
-
"ts-jest": "^29.
|
|
38
|
-
"typescript": "^4.
|
|
42
|
+
"@types/jest": "^29.5.14",
|
|
43
|
+
"@types/node": "^18.19.68",
|
|
44
|
+
"jest": "^29.7.0",
|
|
45
|
+
"ts-jest": "^29.2.5",
|
|
46
|
+
"typescript": "^4.9.5"
|
|
39
47
|
}
|
|
40
48
|
}
|
package/src/mytmpvpn.ts
CHANGED
|
@@ -120,16 +120,18 @@ program.command('create')
|
|
|
120
120
|
.choices(vpnlib.getVpnConfigTypes())
|
|
121
121
|
.default(vpnlib.VpnType.WireGuard))
|
|
122
122
|
.option('--peanuts <nb>', 'Max number of peanuts to use (specify -1 for maximum)', '-1')
|
|
123
|
+
.option('--deleteAfter seconds', 'Number of seconds after which the vpn will be terminated')
|
|
123
124
|
.action((region: string, _, command) => {
|
|
124
125
|
const options = command.optsWithGlobals()
|
|
125
126
|
const syncStr = options.sync ? "synchronously" : "asynchronously"
|
|
127
|
+
const deleteAfter = options.deleteAfter ? options.deleteAfter : undefined
|
|
126
128
|
log.debug(`Creating new ${options.type} vpn into ${region} ${syncStr}`)
|
|
127
129
|
auth.getLoggedInClientFromFiles({ appConfigFile: options.appConfig, userConfigFile: options.userConfig, profileName: options.profile }, (err, client) => {
|
|
128
130
|
if (err) {
|
|
129
131
|
handleError(err, options.verbose)
|
|
130
132
|
return
|
|
131
133
|
}
|
|
132
|
-
client.createVpn(region, { type: options.type, maxPeanuts: options.peanuts }).then(vpn => {
|
|
134
|
+
client.createVpn(region, { type: options.type, maxPeanuts: options.peanuts, deleteAfter }).then(vpn => {
|
|
133
135
|
if (!options.sync) {
|
|
134
136
|
log.info(vpn)
|
|
135
137
|
return
|