@slack/web-api
Advanced tools
Comparing version 5.8.0 to 5.8.1
@@ -21,3 +21,3 @@ "use strict"; | ||
})(); | ||
logger.setName(`${name}:${instanceId}`); | ||
logger.setName(`web-api:${name}:${instanceId}`); | ||
if (level !== undefined) { | ||
@@ -24,0 +24,0 @@ logger.setLevel(level); |
@@ -455,2 +455,3 @@ "use strict"; | ||
this.logger.debug(`apiCall('${method}') start`); | ||
warnDeprecations(method, this.logger); | ||
if (typeof options === 'string' || typeof options === 'number' || typeof options === 'boolean') { | ||
@@ -763,2 +764,17 @@ throw new TypeError(`Expected an options argument but instead received a ${typeof options}`); | ||
} | ||
/** | ||
* Log a warning when using a deprecated method | ||
* @param method api method being called | ||
* @param logger instance of web clients logger | ||
*/ | ||
function warnDeprecations(method, logger) { | ||
const deprecatedMethods = ['channels.', 'groups.', 'im.', 'mpim.']; | ||
const isDeprecated = deprecatedMethods.some((depMethod) => { | ||
const re = new RegExp(`^${depMethod}`); | ||
return re.test(method); | ||
}); | ||
if (isDeprecated) { | ||
logger.warn(`${method} is deprecated. Please use the Conversations API instead. For more info, go to https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api`); | ||
} | ||
} | ||
//# sourceMappingURL=WebClient.js.map |
{ | ||
"name": "@slack/web-api", | ||
"version": "5.8.0", | ||
"version": "5.8.1", | ||
"description": "Official library for using the Slack Platform's Web API", | ||
@@ -5,0 +5,0 @@ "author": "Slack Technologies, Inc.", |
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
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
179374
2404