@terros-inc/cli 1.0.2 → 1.0.4
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/commands/auth.js +12 -1
- package/package.json +24 -15
- package/terros.yml +1664 -1673
package/dist/commands/auth.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { signInToAuth0 } from "../auth/auth0.js";
|
|
2
|
-
import { saveTokens } from "../auth/tokens.js";
|
|
2
|
+
import { getTokens, saveTokens } from "../auth/tokens.js";
|
|
3
3
|
export const authCommands = {
|
|
4
4
|
login: {
|
|
5
5
|
description: 'Sign in to Terros',
|
|
@@ -9,4 +9,15 @@ export const authCommands = {
|
|
|
9
9
|
console.log('Signed in successfully');
|
|
10
10
|
},
|
|
11
11
|
},
|
|
12
|
+
token: {
|
|
13
|
+
description: 'Get Terros API Token',
|
|
14
|
+
async run() {
|
|
15
|
+
const tokens = await getTokens();
|
|
16
|
+
if (tokens === null) {
|
|
17
|
+
console.error('CLI not authorized. Run \`terros auth login\` to authenticate.');
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
console.log(tokens.access_token);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
12
23
|
};
|
package/package.json
CHANGED
|
@@ -3,6 +3,15 @@
|
|
|
3
3
|
"bin": {
|
|
4
4
|
"terros": "./cli.js"
|
|
5
5
|
},
|
|
6
|
+
"bugs": {
|
|
7
|
+
"url": "https://github.com/terros-inc/cli/issues"
|
|
8
|
+
},
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"luxon": "^3.7.2",
|
|
11
|
+
"minimist": "^1.2.8",
|
|
12
|
+
"open": "^11.0.0",
|
|
13
|
+
"yaml": "^2.9.0"
|
|
14
|
+
},
|
|
6
15
|
"description": "Command-line interface for Terros Sales platform",
|
|
7
16
|
"devDependencies": {
|
|
8
17
|
"@types/minimist": "^1.2.5",
|
|
@@ -10,13 +19,6 @@
|
|
|
10
19
|
"typescript": "^6.0.3",
|
|
11
20
|
"@types/luxon": "^3.7.1"
|
|
12
21
|
},
|
|
13
|
-
"keywords": [
|
|
14
|
-
"terros",
|
|
15
|
-
"cli"
|
|
16
|
-
],
|
|
17
|
-
"license": "MIT",
|
|
18
|
-
"main": "./dist/index.js",
|
|
19
|
-
"name": "@terros-inc/cli",
|
|
20
22
|
"engines": {
|
|
21
23
|
"node": ">=24"
|
|
22
24
|
},
|
|
@@ -25,19 +27,26 @@
|
|
|
25
27
|
"terros.yml",
|
|
26
28
|
"dist"
|
|
27
29
|
],
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
"homepage": "https://github.com/terros-inc/cli#readme",
|
|
31
|
+
"keywords": [
|
|
32
|
+
"terros",
|
|
33
|
+
"cli"
|
|
34
|
+
],
|
|
35
|
+
"license": "MIT",
|
|
36
|
+
"main": "./dist/index.js",
|
|
37
|
+
"name": "@terros-inc/cli",
|
|
36
38
|
"publishConfig": {
|
|
37
39
|
"access": "public",
|
|
38
40
|
"tag": "latest"
|
|
39
41
|
},
|
|
42
|
+
"repository": {
|
|
43
|
+
"type": "git",
|
|
44
|
+
"url": "git+https://github.com/terros-inc/cli.git"
|
|
45
|
+
},
|
|
46
|
+
"type": "module",
|
|
47
|
+
"version": "1.0.4",
|
|
40
48
|
"scripts": {
|
|
49
|
+
"fetch-openapi": "wget https://docs.terros.com/openapi/terros.yml",
|
|
41
50
|
"build": "tsc",
|
|
42
51
|
"start": "node src/index.ts"
|
|
43
52
|
}
|