@versini/auth-common 2.11.0 → 2.12.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.d.ts CHANGED
@@ -6,6 +6,7 @@ declare const AUTH_TYPES: {
6
6
  ID_AND_ACCESS_TOKEN: string;
7
7
  CODE: string;
8
8
  REFRESH_TOKEN: string;
9
+ PASSKEY: string;
9
10
  };
10
11
  declare const HEADERS: {
11
12
  CLIENT_ID: string;
@@ -73,4 +74,4 @@ type HeadersLike = Record<string, unknown> & {
73
74
  */
74
75
  declare const getToken: (headers: HeadersLike, clientId: string) => string;
75
76
 
76
- export { API_TYPE, AUTH_TYPES, HEADERS, JWT, JWT_PUBLIC_KEY, TOKEN_EXPIRATION, decodeToken, generateCodeChallenge, getToken, pkceChallengePair, verifyAndExtractToken, verifyChallenge };
77
+ export { API_TYPE, AUTH_TYPES, HEADERS, type HeadersLike, JWT, JWT_PUBLIC_KEY, TOKEN_EXPIRATION, decodeToken, generateCodeChallenge, getToken, pkceChallengePair, verifyAndExtractToken, verifyChallenge };
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  /*!
2
- @versini/auth-common v2.11.0
2
+ @versini/auth-common v2.12.0
3
3
  © 2024 gizmette.com
4
4
  */
5
5
  try {
6
6
  window.__VERSINI_AUTH_COMMON__ || (window.__VERSINI_AUTH_COMMON__ = {
7
- version: "2.11.0",
8
- buildTime: "07/07/2024 10:25 AM EDT",
7
+ version: "2.12.0",
8
+ buildTime: "07/15/2024 09:28 AM EDT",
9
9
  homepage: "https://github.com/aversini/auth-client",
10
10
  license: "MIT"
11
11
  });
@@ -16,7 +16,8 @@ const Qe = {
16
16
  ACCESS_TOKEN: "token",
17
17
  ID_AND_ACCESS_TOKEN: "id_token token",
18
18
  CODE: "code",
19
- REFRESH_TOKEN: "refresh_token"
19
+ REFRESH_TOKEN: "refresh_token",
20
+ PASSKEY: "passkey"
20
21
  }, Xe = {
21
22
  CLIENT_ID: "X-Auth-ClientId"
22
23
  }, N = {
@@ -156,8 +157,7 @@ function de(e, t) {
156
157
  if (t.length > 2) {
157
158
  const n = t.pop();
158
159
  r += `one of ${t.join(", ")}, or ${n}.`;
159
- } else
160
- t.length === 2 ? r += `one of ${t[0]} or ${t[1]}.` : r += `${t[0]}.`;
160
+ } else t.length === 2 ? r += `one of ${t[0]} or ${t[1]}.` : r += `${t[0]}.`;
161
161
  throw new TypeError(r);
162
162
  }
163
163
  }
@@ -218,8 +218,7 @@ function G(e, t, ...r) {
218
218
  if (r.length > 2) {
219
219
  const a = r.pop();
220
220
  e += `one of type ${r.join(", ")}, or ${a}.`;
221
- } else
222
- r.length === 2 ? e += `one of type ${r[0]} or ${r[1]}.` : e += `of type ${r[0]}.`;
221
+ } else r.length === 2 ? e += `one of type ${r[0]} or ${r[1]}.` : e += `of type ${r[0]}.`;
223
222
  return t == null ? e += ` Received ${t}` : typeof t == "function" && t.name ? e += ` Received function ${t.name}` : typeof t == "object" && t != null && (n = t.constructor) != null && n.name && (e += ` Received an instance of ${t.constructor.name}`), e;
224
223
  }
225
224
  const L = (e, ...t) => G("Key must be ", e, ...t);
@@ -593,8 +592,7 @@ async function xe(e, t, r) {
593
592
  } catch {
594
593
  throw new u("Failed to base64url decode the payload");
595
594
  }
596
- else
597
- typeof e.payload == "string" ? y = v.encode(e.payload) : y = e.payload;
595
+ else typeof e.payload == "string" ? y = v.encode(e.payload) : y = e.payload;
598
596
  const l = { payload: y };
599
597
  return e.protected !== void 0 && (l.protectedHeader = n), e.header !== void 0 && (l.unprotectedHeader = e.header), p ? { ...l, key: t } : l;
600
598
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@versini/auth-common",
3
- "version": "2.11.0",
3
+ "version": "2.12.0",
4
4
  "license": "MIT",
5
5
  "author": "Arno Versini",
6
6
  "publishConfig": {
@@ -29,11 +29,12 @@
29
29
  "lint": "biome lint src",
30
30
  "start": "static-server dist --port 5173",
31
31
  "test:watch": "vitest",
32
- "test": "vitest run"
32
+ "test": "vitest run",
33
+ "test:coverage": "vitest run --coverage"
33
34
  },
34
35
  "dependencies": {
35
36
  "jose": "5.6.3",
36
37
  "uuid": "10.0.0"
37
38
  },
38
- "gitHead": "e6e92b161c834eba2f655e9e6b80bdd7b5cb2316"
39
+ "gitHead": "ae50d0965f6c30ea5bb8ace592c3cd99e736803e"
39
40
  }