@slack/webhook
Advanced tools
Comparing version 6.0.0 to 6.1.0
@@ -39,2 +39,3 @@ /// <reference types="node" /> | ||
agent?: Agent; | ||
timeout?: number; | ||
} | ||
@@ -41,0 +42,0 @@ export interface IncomingWebhookSendArguments extends IncomingWebhookDefaultArguments { |
@@ -14,3 +14,5 @@ "use strict"; | ||
class IncomingWebhook { | ||
constructor(url, defaults = {}) { | ||
constructor(url, defaults = { | ||
timeout: 0, | ||
}) { | ||
if (url === undefined) { | ||
@@ -27,4 +29,5 @@ throw new Error('Incoming webhook URL is required'); | ||
proxy: false, | ||
timeout: defaults.timeout, | ||
headers: { | ||
'User-Agent': instrument_1.getUserAgent(), | ||
'User-Agent': (0, instrument_1.getUserAgent)(), | ||
}, | ||
@@ -54,6 +57,6 @@ }); | ||
if (error.response !== undefined) { | ||
throw errors_1.httpErrorWithOriginal(error); | ||
throw (0, errors_1.httpErrorWithOriginal)(error); | ||
} | ||
else if (error.request !== undefined) { | ||
throw errors_1.requestErrorWithOriginal(error); | ||
throw (0, errors_1.requestErrorWithOriginal)(error); | ||
} | ||
@@ -68,2 +71,3 @@ else { | ||
*/ | ||
// eslint-disable-next-line class-methods-use-this | ||
buildResult(response) { | ||
@@ -70,0 +74,0 @@ return { |
@@ -24,3 +24,3 @@ "use strict"; | ||
const os = __importStar(require("os")); | ||
const packageJson = require('../package.json'); // tslint:disable-line:no-require-imports no-var-requires | ||
const packageJson = require('../package.json'); // eslint-disable-line import/no-commonjs, @typescript-eslint/no-var-requires | ||
/** | ||
@@ -27,0 +27,0 @@ * Replaces occurrences of '/' with ':' in a string, since '/' is meaningful inside User-Agent strings as a separator. |
{ | ||
"name": "@slack/webhook", | ||
"version": "6.0.0", | ||
"version": "6.1.0", | ||
"description": "Official library for using the Slack Platform's Incoming Webhooks", | ||
"author": "Slack Technologies, Inc.", | ||
"author": "Slack Technologies, LLC", | ||
"license": "MIT", | ||
@@ -36,4 +36,4 @@ "keywords": [ | ||
"build:clean": "shx rm -rf ./dist ./coverage ./.nyc_output", | ||
"lint": "tslint --project .", | ||
"test": "npm run build && nyc mocha --config .mocharc.json src/*.spec.js", | ||
"lint": "eslint --ext .ts src", | ||
"test": "npm run lint && npm run build && nyc mocha --config .mocharc.json src/*.spec.js", | ||
"coverage": "codecov -F webhook --root=$PWD", | ||
@@ -45,6 +45,8 @@ "ref-docs:model": "api-extractor run" | ||
"@types/node": ">=12.0.0", | ||
"axios": "^0.21.1" | ||
"axios": "^0.21.4" | ||
}, | ||
"devDependencies": { | ||
"@microsoft/api-extractor": "^7.3.4", | ||
"@typescript-eslint/eslint-plugin": "^4.4.1", | ||
"@typescript-eslint/parser": "^4.4.0", | ||
"@types/chai": "^4.1.7", | ||
@@ -54,4 +56,10 @@ "@types/mocha": "^5.2.6", | ||
"codecov": "^3.2.0", | ||
"mocha": "^6.0.2", | ||
"nock": "^10.0.6", | ||
"eslint": "^7.32.0", | ||
"eslint-config-airbnb-base": "^14.2.1", | ||
"eslint-config-airbnb-typescript": "^12.3.1", | ||
"eslint-plugin-import": "^2.22.1", | ||
"eslint-plugin-jsdoc": "^30.6.1", | ||
"eslint-plugin-node": "^11.1.0", | ||
"mocha": "^9.1.0", | ||
"nock": "^13.0.0", | ||
"nyc": "^14.1.1", | ||
@@ -62,6 +70,4 @@ "shx": "^0.3.2", | ||
"ts-node": "^8.0.3", | ||
"tslint": "^5.13.1", | ||
"tslint-config-airbnb": "^5.11.1", | ||
"typescript": "^4.1.0" | ||
} | ||
} |
# Slack Incoming Webhooks | ||
[![build-ci](https://github.com/slackapi/node-slack-sdk/workflows/CI%20Build/badge.svg)](https://github.com/slackapi/node-slack-sdk/actions?query=workflow%3A%22CI+Build%22) | ||
<!-- TODO: per-flag badge https://docs.codecov.io/docs/flags#section-flag-badges-and-graphs --> | ||
[![codecov](https://codecov.io/gh/slackapi/node-slack-sdk/branch/master/graph/badge.svg)](https://codecov.io/gh/slackapi/node-slack-sdk) | ||
<!-- TODO: npm versions with scoped packages: https://github.com/rvagg/nodei.co/issues/24 --> | ||
The `@slack/webhook` package contains a helper for making requests to Slack's [Incoming | ||
@@ -9,0 +4,0 @@ Webhooks](https://api.slack.com/incoming-webhooks). Use it in your app to send a notification to a channel. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21945
276
21
119
1
Updatedaxios@^0.21.4