adobe-ims-servicetoken
Advanced tools
Comparing version 3.0.9 to 3.0.10
/** | ||
* adobe-ims-servicetoken | ||
* | ||
* @copyright 2023 Jason Mulligan <jason.mulligan@avoidwork.com> | ||
* @copyright 2024 Jason Mulligan <jason.mulligan@avoidwork.com> | ||
* @license BSD-3-Clause | ||
* @version 3.0.9 | ||
* @version 3.0.10 | ||
*/ | ||
import {createHash}from'node:crypto';const AMPERSAND = "&"; | ||
import {createHash}from'crypto';const AMPERSAND = "&"; | ||
const BASE64 = "base64"; | ||
@@ -22,4 +22,6 @@ const CLIENT_ID = "client_id"; | ||
const SHA1 = "sha1"; | ||
const STRING = "string";const tokens = new Map(); | ||
const STRING = "string"; | ||
const FUNCTION = "function";const tokens = new Map(); | ||
const fetch = (...args) => import('node-fetch').then(({default: fetch}) => fetch(...args)); // eslint-disable-line no-shadow | ||
const clone = typeof structuredClone === FUNCTION ? structuredClone : arg => JSON.parse(JSON.stringify(arg)); | ||
@@ -82,3 +84,3 @@ async function token ({ | ||
tokens.set(key, data.access_token); | ||
result = structuredClone(data.access_token); | ||
result = clone(data.access_token); | ||
@@ -101,3 +103,3 @@ if (data.expires_in !== void 0) { | ||
} else { | ||
result = structuredClone(tokens.get(key)); | ||
result = clone(tokens.get(key)); | ||
} | ||
@@ -104,0 +106,0 @@ |
{ | ||
"name": "adobe-ims-servicetoken", | ||
"version": "3.0.9", | ||
"version": "3.0.10", | ||
"description": "Adobe IMS Service Token lifecycle management", | ||
@@ -48,3 +48,3 @@ "source": "src/ims.js", | ||
"eslint": "^8.52.0", | ||
"husky": "^8.0.3", | ||
"husky": "^9.0.11", | ||
"rollup": "^4.2.0", | ||
@@ -51,0 +51,0 @@ "typescript": "^5.2.2" |
@@ -0,0 +0,0 @@ export function token({ url, grant_type, client_id, client_secret, code, jwt_token }?: { |
Sorry, the diff of this file is not supported yet
8170
197