Skip to content

Commit

Permalink
Adding cross-fetch dependency because fetch() isn't native until …
Browse files Browse the repository at this point in the history
…node18 and still need to support older versions, setting `engine` in `package.json` `>=6` for `const` to be valid
  • Loading branch information
avoidwork committed Nov 2, 2023
1 parent 827dbb2 commit cb1f0ea
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 14 deletions.
3 changes: 2 additions & 1 deletion dist/adobe-ims-servicetoken.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
*
* @copyright 2023 Jason Mulligan <jason.mulligan@avoidwork.com>
* @license BSD-3-Clause
* @version 3.0.5
* @version 3.0.6
*/
'use strict';

var node_crypto = require('node:crypto');
var fetch = require('cross-fetch');

const AMPERSAND = "&";
const BASE64 = "base64";
Expand Down
4 changes: 2 additions & 2 deletions dist/adobe-ims-servicetoken.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
*
* @copyright 2023 Jason Mulligan <jason.mulligan@avoidwork.com>
* @license BSD-3-Clause
* @version 3.0.5
* @version 3.0.6
*/
import {createHash}from'node:crypto';const AMPERSAND = "&";
import {createHash}from'node:crypto';import fetch from'cross-fetch';const AMPERSAND = "&";
const BASE64 = "base64";
const CLIENT_ID = "client_id";
const CLIENT_SECRET = "client_secret";
Expand Down
25 changes: 16 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "adobe-ims-servicetoken",
"version": "3.0.5",
"version": "3.0.6",
"description": "Adobe IMS Service Token lifecycle management",
"source": "src/ims.js",
"main": "dist/adobe-ims-servicetoken.cjs",
Expand All @@ -10,7 +10,7 @@
},
"type": "module",
"engines": {
"node": ">=16.14.2"
"node": ">=6"
},
"files": [
"dist",
Expand Down Expand Up @@ -47,5 +47,8 @@
"husky": "^8.0.3",
"rollup": "^4.2.0",
"typescript": "^5.2.2"
},
"dependencies": {
"cross-fetch": "^4.0.0"
}
}
1 change: 1 addition & 0 deletions src/token.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {createHash} from "node:crypto";
import fetch from "cross-fetch";
import {
AMPERSAND,
BASE64,
Expand Down

0 comments on commit cb1f0ea

Please sign in to comment.