diff --git a/CHANGELOG.md b/CHANGELOG.md index a61ebc4..b7a5ba0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Change Log -## v1.2.0 – 2020-06-26 +## v1.2.1 – 2020-06-27 + +* Fix issue where Slack timestamp format not permitted for `ts` and `threadTs` parameters of the `Message` surface object. + +## v1.2.0 – 2020-06-27 * Parameter `ts` for the `Message` surface object is now supported. diff --git a/package.json b/package.json index e6359b0..3bde273 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "slack-block-builder", - "version": "1.2.0", + "version": "1.2.1", "description": "Maintainable code for interactive Slack messages, modals and home tabs. A must-have for the Slack Block Kit framework.", "author": { "name": "Ray East", diff --git a/src/surfaces/message.js b/src/surfaces/message.js index f87480c..3e89278 100644 --- a/src/surfaces/message.js +++ b/src/surfaces/message.js @@ -80,12 +80,12 @@ class Message extends Surface { * * {@link https://api.slack.com/messaging/composing|View in Slack API Documentation} * - * @param {timestamp} timestamp The timestamp of message to be replied to + * @param {string} string The Slack-produced timestamp of message to be replied to * @return {this} The instance on which the method is called */ - threadTs(timestamp) { - return this.set(timestamp, props.threadTs); + threadTs(string) { + return this.set(string, props.threadTs); } /** @@ -93,12 +93,12 @@ class Message extends Surface { * * {@link https://api.slack.com/messaging/composing|View in Slack API Documentation} * - * @param {timestamp} timestamp The timestamp of message to be replied to + * @param {string} string The Slack-produced timestamp of message to be replaced * @return {this} The instance on which the method is called */ - ts(timestamp) { - return this.set(timestamp, props.ts); + ts(string) { + return this.set(string, props.ts); } /** diff --git a/src/utility/validators/default-type-rules.js b/src/utility/validators/default-type-rules.js index 9822e2d..0d76adf 100644 --- a/src/utility/validators/default-type-rules.js +++ b/src/utility/validators/default-type-rules.js @@ -56,8 +56,8 @@ module.exports = { notifyOnClose: types.isBool, description: types.isString, asUser: types.isBool, - ts: types.isTimestamp, - threadTs: types.isTimestamp, + ts: types.isString, + threadTs: types.isString, replaceOriginal: types.isBool, deleteOriginal: types.isBool, responseType: types.isResponseTypeEnum, diff --git a/tests/mocks/valid-prop-data-mapping.js b/tests/mocks/valid-prop-data-mapping.js index d3fa6f8..de10b56 100644 --- a/tests/mocks/valid-prop-data-mapping.js +++ b/tests/mocks/valid-prop-data-mapping.js @@ -55,8 +55,8 @@ module.exports = { privateMetaData: types.string, callbackId: types.string, asUser: types.bool, - threadsTs: types.timestamp, - ts: types.timestamp, + threadsTs: types.string, + ts: types.string, replaceOriginal: types.bool, deleteOriginal: types.bool, responseType: types.ephemeral, diff --git a/tests/surfaces/mocks/message.mock.js b/tests/surfaces/mocks/message.mock.js index 0e1c89b..8f69dc3 100644 --- a/tests/surfaces/mocks/message.mock.js +++ b/tests/surfaces/mocks/message.mock.js @@ -3,9 +3,9 @@ const { getSurfaces, ...Surfaces } = require('../../../src/surfaces'); const props = { channel: 'channel', text: 'text', - ts: 1593125546.000100, - threadTs: 1593125546.000100, - postAt: 1593125546.000100, + ts: '1593125546.000100', + threadTs: '1593125546.000100', + postAt: 1593125546, }; const mock = new Surfaces.Message({ ...props });