@versori/run 0.3.0-beta.2 → 0.3.0-beta.3

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 +1 @@
1
- {"version":3,"file":"isTokenValid.d.ts","sourceRoot":"","sources":["../../../../src/src/services/credentials/isTokenValid.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAY,MAAM,UAAU,CAAC;AAI9C,wBAAgB,YAAY,CAAC,CAAC,EAAE,QAAQ,CAAC,KAAK,GAAG,OAAO,CAMvD"}
1
+ {"version":3,"file":"isTokenValid.d.ts","sourceRoot":"","sources":["../../../../src/src/services/credentials/isTokenValid.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAY,MAAM,UAAU,CAAC;AAI9C,wBAAgB,YAAY,CAAC,CAAC,EAAE,QAAQ,CAAC,KAAK,GAAG,OAAO,CAsBvD"}
@@ -4,5 +4,20 @@ export function isTokenValid(t) {
4
4
  if (!t.expiry) {
5
5
  return true;
6
6
  }
7
+ // the timestamp for api key looks like this
8
+ // {
9
+ // "token": {
10
+ // "access_token": "dgfjdghjhfgjdfghj",
11
+ // "token_type": "",
12
+ // "expiry": {
13
+ // "seconds": "-62135596800",
14
+ // "nanos": 0
15
+ // }
16
+ // }
17
+ // }
18
+ // just hope and pray that it is valid
19
+ if (t.expiry.seconds <= 0) {
20
+ return true;
21
+ }
7
22
  return (timestampMs(t.expiry) - TOKEN_EXPIRY_JITTER_MS) > Date.now();
8
23
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@versori/run",
3
- "version": "v0.3.0-beta.2",
3
+ "version": "v0.3.0-beta.3",
4
4
  "description": "Versori Run",
5
5
  "homepage": "https://github.com/versori/versori-run#readme",
6
6
  "repository": {
@@ -1 +1 @@
1
- {"version":3,"file":"isTokenValid.d.ts","sourceRoot":"","sources":["../../../../src/src/services/credentials/isTokenValid.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAY,MAAM,UAAU,CAAC;AAI9C,wBAAgB,YAAY,CAAC,CAAC,EAAE,QAAQ,CAAC,KAAK,GAAG,OAAO,CAMvD"}
1
+ {"version":3,"file":"isTokenValid.d.ts","sourceRoot":"","sources":["../../../../src/src/services/credentials/isTokenValid.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAY,MAAM,UAAU,CAAC;AAI9C,wBAAgB,YAAY,CAAC,CAAC,EAAE,QAAQ,CAAC,KAAK,GAAG,OAAO,CAsBvD"}
@@ -7,5 +7,20 @@ function isTokenValid(t) {
7
7
  if (!t.expiry) {
8
8
  return true;
9
9
  }
10
+ // the timestamp for api key looks like this
11
+ // {
12
+ // "token": {
13
+ // "access_token": "dgfjdghjhfgjdfghj",
14
+ // "token_type": "",
15
+ // "expiry": {
16
+ // "seconds": "-62135596800",
17
+ // "nanos": 0
18
+ // }
19
+ // }
20
+ // }
21
+ // just hope and pray that it is valid
22
+ if (t.expiry.seconds <= 0) {
23
+ return true;
24
+ }
10
25
  return ((0, wkt_1.timestampMs)(t.expiry) - TOKEN_EXPIRY_JITTER_MS) > Date.now();
11
26
  }