build(deps, deps-dev): upgrade major versions for dependencies of `@superset/embedded-sdk` (#30242)

Signed-off-by: hainenber <dotronghai96@gmail.com>
This commit is contained in:
Đỗ Trọng Hải 2024-09-12 21:40:18 +07:00 committed by GitHub
parent 2e107398ae
commit 8c0b873ae2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 2374 additions and 2118 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "@superset-ui/embedded-sdk",
"version": "0.1.1",
"version": "0.1.2",
"description": "SDK for embedding resources from Superset into your own application",
"access": "public",
"keywords": [
@ -22,7 +22,7 @@
"module": "lib/index.js",
"types": "dist/index.d.ts",
"scripts": {
"build": "tsc ; babel src --out-dir lib --extensions '.ts,.tsx' ; webpack --mode production",
"build": "tsc && babel src --out-dir lib --extensions '.ts,.tsx' && webpack --mode production",
"ci:release": "node ./release-if-necessary.js",
"test": "jest"
},
@ -34,20 +34,21 @@
],
"dependencies": {
"@superset-ui/switchboard": "^0.20.2",
"jwt-decode": "^3.1.2"
"jwt-decode": "^4.0.0"
},
"devDependencies": {
"@babel/cli": "^7.16.8",
"@babel/core": "^7.16.12",
"@babel/preset-env": "^7.16.11",
"@babel/preset-typescript": "^7.16.7",
"@babel/cli": "^7.25.6",
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.4",
"@babel/preset-typescript": "^7.24.7",
"@types/jest": "^29.5.12",
"axios": "^1.6.0",
"babel-loader": "^8.2.3",
"@types/node": "^22.5.4",
"axios": "^1.7.7",
"babel-loader": "^9.1.3",
"jest": "^29.7.0",
"typescript": "^4.5.5",
"webpack": "^5.67.0",
"webpack-cli": "^4.9.2"
"typescript": "^5.6.2",
"webpack": "^5.94.0",
"webpack-cli": "^5.1.4"
},
"repository": {
"type": "git",

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import jwt_decode from "jwt-decode";
import { jwtDecode } from "jwt-decode";
export const REFRESH_TIMING_BUFFER_MS = 5000 // refresh guest token early to avoid failed superset requests
export const MIN_REFRESH_WAIT_MS = 10000 // avoid blasting requests as fast as the cpu can handle
@ -24,7 +24,7 @@ export const DEFAULT_TOKEN_EXP_MS = 300000 // (5 min) used only when parsing gue
// when do we refresh the guest token?
export function getGuestTokenRefreshTiming(currentGuestToken: string) {
const parsedJwt = jwt_decode<Record<string, any>>(currentGuestToken);
const parsedJwt = jwtDecode<Record<string, any>>(currentGuestToken);
// if exp is int, it is in seconds, but Date() takes milliseconds
const exp = new Date(/[^0-9\.]/g.test(parsedJwt.exp) ? parsedJwt.exp : parseFloat(parsedJwt.exp) * 1000);
const isValidDate = exp.toString() !== 'Invalid Date';