From babcec51cf6d950943aaaa9f5ccec259928141c5 Mon Sep 17 00:00:00 2001 From: Fil Maj Date: Thu, 18 Jan 2024 10:33:13 -0500 Subject: [PATCH] Prep for new major version of oauth library (#1727) --- packages/oauth/package.json | 61 ++++++++++++-------------- packages/oauth/src/install-provider.ts | 2 +- 2 files changed, 30 insertions(+), 33 deletions(-) diff --git a/packages/oauth/package.json b/packages/oauth/package.json index 4f3d59258..ccc6c0923 100644 --- a/packages/oauth/package.json +++ b/packages/oauth/package.json @@ -16,8 +16,8 @@ "dist/**/*" ], "engines": { - "node": ">=12.13.0", - "npm": ">=6.12.0" + "node": ">=18", + "npm": ">=8.6.0" }, "repository": "slackapi/node-slack-sdk", "homepage": "https://slack.dev/node-slack-sdk/oauth", @@ -32,43 +32,40 @@ "build": "npm run build:clean && tsc", "build:clean": "shx rm -rf ./dist ./coverage ./.nyc_output", "lint": "eslint --fix --ext .ts src", - "test": "npm run lint && npm run test:mocha", - "test:mocha": "nyc mocha --config .mocharc.json src/*.spec.js src/**/*.spec.js src/*.spec.ts src/**/*.spec.ts", + "test": "npm run build && npm run lint && npm run test:mocha", + "test:mocha": "nyc --reporter=text-summary mocha --config .mocharc.json src/*.spec.js src/**/*.spec.js src/*.spec.ts src/**/*.spec.ts", "ref-docs:model": "api-extractor run", "watch": "npx nodemon --watch 'src' --ext 'ts' --exec npm run build" }, "dependencies": { - "@slack/logger": "^3.0.0", - "@slack/web-api": "^6.11.2", - "@types/jsonwebtoken": "^8.3.7", - "@types/node": ">=12", - "jsonwebtoken": "^9.0.0", - "lodash.isstring": "^4.0.1" + "@slack/logger": "^4", + "@slack/web-api": "^7", + "@types/jsonwebtoken": "^9", + "@types/node": ">=18", + "jsonwebtoken": "^9", + "lodash.isstring": "^4" }, "devDependencies": { - "@microsoft/api-extractor": "^7.38.0", - "@types/chai": "^4.3.5", - "@types/mocha": "^10.0.1", - "@types/sinon": "^10.0.20", - "@typescript-eslint/eslint-plugin": "^6.4.1", - "@typescript-eslint/parser": "^6.4.0", - "chai": "^4.3.8", - "eslint": "^8.47.0", - "eslint-config-airbnb-base": "^15.0.0", - "eslint-config-airbnb-typescript": "^17.1.0", - "eslint-plugin-import": "^2.28.1", - "eslint-plugin-jsdoc": "^46.5.0", - "eslint-plugin-node": "^11.1.0", - "mocha": "^10.2.0", - "nop": "^1.0.0", - "nyc": "^15.1.0", - "rewiremock": "^3.13.9", + "@microsoft/api-extractor": "^7", + "@types/chai": "^4", + "@types/mocha": "^10", + "@types/sinon": "^17", + "@typescript-eslint/eslint-plugin": "^6", + "@typescript-eslint/parser": "^6", + "chai": "^4", + "eslint": "^8", + "eslint-config-airbnb-base": "^15", + "eslint-config-airbnb-typescript": "^17", + "eslint-plugin-import": "^2", + "eslint-plugin-jsdoc": "^48", + "eslint-plugin-node": "^11", + "mocha": "^10", + "nyc": "^15", + "rewiremock": "^3", "shx": "^0.3.2", - "sinon": "^15.2.0", + "sinon": "^17", "source-map-support": "^0.5.21", - "superagent": "^3.3.1", - "ts-node": "^10.8.1", - "typescript": "^4.1", - "uncaughtException": "^1.0.0" + "ts-node": "^10", + "typescript": "5.3.3" } } diff --git a/packages/oauth/src/install-provider.ts b/packages/oauth/src/install-provider.ts index 7975508f3..5d15a3e3e 100644 --- a/packages/oauth/src/install-provider.ts +++ b/packages/oauth/src/install-provider.ts @@ -830,7 +830,7 @@ interface AuthTestResult extends WebAPICallResult { async function runAuthTest(token: string, clientOptions: WebClientOptions): Promise { const client = new WebClient(token, clientOptions); - const authResult = await client.auth.test(); + const authResult = await client.auth.test({}); return authResult as unknown as AuthTestResult; }