@slack/web-api
Advanced tools
Comparing version 5.0.1 to 5.1.0
@@ -302,2 +302,37 @@ /// <reference types="node" /> | ||
} | ||
export interface FilesRemoteInfoArguments extends WebAPICallOptions, TokenOverridable { | ||
file?: string; | ||
external_id?: string; | ||
} | ||
export interface FilesRemoteListArguments extends WebAPICallOptions, TokenOverridable, CursorPaginationEnabled { | ||
ts_from?: string; | ||
ts_to?: string; | ||
channel?: string; | ||
} | ||
export interface FilesRemoteAddArguments extends WebAPICallOptions, TokenOverridable { | ||
title: string; | ||
external_url: string; | ||
external_id: string; | ||
filetype: string; | ||
preview_image?: Buffer | Stream; | ||
indexable_file_contents?: Buffer | Stream; | ||
} | ||
export interface FilesRemoteUpdateArguments extends WebAPICallOptions, TokenOverridable { | ||
title?: string; | ||
external_url?: string; | ||
filetype?: string; | ||
preview_image?: Buffer | Stream; | ||
indexable_file_contents?: Buffer | Stream; | ||
file?: string; | ||
external_id?: string; | ||
} | ||
export interface FilesRemoteRemoveArguments extends WebAPICallOptions, TokenOverridable { | ||
file?: string; | ||
external_id?: string; | ||
} | ||
export interface FilesRemoteShareArguments extends WebAPICallOptions, TokenOverridable { | ||
channels: string; | ||
file?: string; | ||
external_id?: string; | ||
} | ||
export interface GroupsArchiveArguments extends WebAPICallOptions, TokenOverridable { | ||
@@ -304,0 +339,0 @@ channel: string; |
@@ -13,2 +13,3 @@ "use strict"; | ||
exports.cursorPaginationEnabledMethods.add('files.info'); | ||
exports.cursorPaginationEnabledMethods.add('files.remote.list'); | ||
exports.cursorPaginationEnabledMethods.add('groups.list'); | ||
@@ -15,0 +16,0 @@ exports.cursorPaginationEnabledMethods.add('im.list'); |
@@ -200,2 +200,10 @@ /// <reference types="node" /> | ||
}; | ||
remote: { | ||
info: Method<methods.FilesRemoteInfoArguments>; | ||
list: Method<methods.FilesRemoteListArguments>; | ||
add: Method<methods.FilesRemoteAddArguments>; | ||
update: Method<methods.FilesRemoteUpdateArguments>; | ||
remove: Method<methods.FilesRemoteRemoveArguments>; | ||
share: Method<methods.FilesRemoteShareArguments>; | ||
}; | ||
}; | ||
@@ -400,2 +408,3 @@ /** | ||
retryAfter?: number; | ||
messages?: string[]; | ||
}; | ||
@@ -402,0 +411,0 @@ [key: string]: unknown; |
@@ -177,2 +177,10 @@ "use strict"; | ||
}, | ||
remote: { | ||
info: (this.apiCall.bind(this, 'files.remote.info')), | ||
list: (this.apiCall.bind(this, 'files.remote.list')), | ||
add: (this.apiCall.bind(this, 'files.remote.add')), | ||
update: (this.apiCall.bind(this, 'files.remote.update')), | ||
remove: (this.apiCall.bind(this, 'files.remote.remove')), | ||
share: (this.apiCall.bind(this, 'files.remote.share')), | ||
}, | ||
}; | ||
@@ -364,3 +372,3 @@ /** | ||
async apiCall(method, options) { | ||
this.logger.debug('apiCall() start'); | ||
this.logger.debug(`apiCall('${method}') start`); | ||
if (typeof options === 'string' || typeof options === 'number' || typeof options === 'boolean') { | ||
@@ -646,3 +654,6 @@ throw new TypeError(`Expected an options argument but instead received a ${typeof options}`); | ||
if (response.headers['retry-after'] !== undefined) { | ||
return parseInt(response.headers['retry-after'], 10); | ||
const retryAfter = parseInt(response.headers['retry-after'], 10); | ||
if (!Number.isNaN(retryAfter)) { | ||
return retryAfter; | ||
} | ||
} | ||
@@ -649,0 +660,0 @@ return undefined; |
{ | ||
"name": "@slack/web-api", | ||
"version": "5.0.1", | ||
"version": "5.1.0", | ||
"description": "Official library for using the Slack Platform's Web API", | ||
@@ -45,4 +45,3 @@ "author": "Slack Technologies, Inc.", | ||
"@slack/logger": "^1.0.0", | ||
"@slack/types": "^1.0.0", | ||
"@types/form-data": "^2.2.1", | ||
"@slack/types": "^1.1.0", | ||
"@types/is-stream": "^1.1.0", | ||
@@ -53,3 +52,3 @@ "@types/node": ">=8.9.0", | ||
"eventemitter3": "^3.1.0", | ||
"form-data": "^2.3.3", | ||
"form-data": "^2.5.0", | ||
"is-stream": "^1.1.0", | ||
@@ -68,3 +67,3 @@ "p-queue": "^2.4.2", | ||
"nock": "^10.0.6", | ||
"nyc": "^13.3.0", | ||
"nyc": "^14.1.1", | ||
"shelljs": "^0.8.3", | ||
@@ -79,3 +78,3 @@ "shx": "^0.3.2", | ||
}, | ||
"gitHead": "0a53364d7cdb6d4485ba30676086bcaaabc46b4e" | ||
"gitHead": "35b40af1dc28ef40cb00eb9a47f902e73c27b03f" | ||
} |
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
155981
11
2046
1
- Removed@types/form-data@^2.2.1
- Removed@types/form-data@2.5.0(transitive)
Updated@slack/types@^1.1.0
Updatedform-data@^2.5.0