tering-serieuze-cli 1.3.0 → 1.5.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/index.mjs CHANGED
@@ -4,7 +4,7 @@
4
4
  import { Command } from "commander";
5
5
  import figlet from "figlet";
6
6
  import inquirer from "inquirer";
7
- import { TssApi, FilesystemCache, OnePasswordCache } from "tering-serieuze-sdk";
7
+ import { TssApi, FilesystemCache } from "tering-serieuze-sdk";
8
8
 
9
9
  // src/completion.ts
10
10
  import omelette from "omelette";
@@ -30,7 +30,7 @@ async function initCompletion(api2) {
30
30
  }
31
31
 
32
32
  // package.json
33
- var version = "1.2.0";
33
+ var version = "1.4.0";
34
34
 
35
35
  // src/index.ts
36
36
  var Commands = /* @__PURE__ */ ((Commands2) => {
@@ -51,7 +51,7 @@ var api = new TssApi(
51
51
  },
52
52
  {
53
53
  jingle: new FilesystemCache("jingle"),
54
- auth: new OnePasswordCache("TSS-TOKEN")
54
+ auth: new FilesystemCache("TSS-TOKEN")
55
55
  }
56
56
  );
57
57
  var program = new Command();
@@ -88,7 +88,11 @@ program.command("login" /* login */).description("Authenticate yourself so you c
88
88
  const user = await api.user.get();
89
89
  console.log("Logged in as " + user.email);
90
90
  } catch (e) {
91
- console.error("Invalid token!");
91
+ if (e.status >= 500) {
92
+ console.error("Uit. Dit kan niet gebeuren want TSS geeft een status >= 500 terug");
93
+ } else {
94
+ console.error("Invalid token!");
95
+ }
92
96
  await api.auth.removeToken();
93
97
  }
94
98
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tering-serieuze-cli",
3
- "version": "1.3.0",
3
+ "version": "1.5.0",
4
4
  "description": "Teringserieuze CLI",
5
5
  "author": "Frank",
6
6
  "main": "dist/index.mjs",
@@ -27,7 +27,7 @@
27
27
  "figlet": "^1.5.2",
28
28
  "inquirer": "^9.1.4",
29
29
  "omelette": "^0.4.17",
30
- "tering-serieuze-sdk": "^3.0.0",
30
+ "tering-serieuze-sdk": "^3.1.0",
31
31
  "tering-serieuze-types": "^1.14.1"
32
32
  },
33
33
  "devDependencies": {
package/src/index.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  import { Command } from "commander";
4
4
  import figlet from "figlet";
5
5
  import inquirer from "inquirer";
6
- import { TssApi, FilesystemCache, OnePasswordCache } from "tering-serieuze-sdk";
6
+ import { TssApi, FilesystemCache } from "tering-serieuze-sdk";
7
7
  import { initCompletion } from "./completion";
8
8
  // @ts-ignore
9
9
  import { version } from "../package.json";
@@ -27,7 +27,7 @@ const api = new TssApi(
27
27
  },
28
28
  {
29
29
  jingle: new FilesystemCache("jingle"),
30
- auth: new OnePasswordCache("TSS-TOKEN"),
30
+ auth: new FilesystemCache("TSS-TOKEN"),
31
31
  }
32
32
  );
33
33
 
@@ -79,8 +79,13 @@ program
79
79
  try {
80
80
  const user = await api.user.get();
81
81
  console.log("Logged in as " + user.email);
82
- } catch (e) {
83
- console.error("Invalid token!");
82
+ } catch (e: any) {
83
+ if (e.status >= 500) {
84
+ console.error("Uit. Dit kan niet gebeuren want TSS geeft een status >= 500 terug");
85
+ } else {
86
+ console.error("Invalid token!");
87
+ }
88
+
84
89
  await api.auth.removeToken();
85
90
  }
86
91
  });