8000 Releases · slackapi/bolt-js · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Releases: slackapi/bolt-js

@slack/bolt@4.0.0-rc.3

08 Oct 16:13
Compare
Choose a tag to compare
Pre-release

Bolt v4 Release Candidate 3

A lot! We have prepared a migration guide to help bolt-js consumers migrate their bolt v3 apps to v4.

What's Changed

Breaking Changes

Middleware Type Changes

In bolt we have a set of Slack*MiddlewareArgs types: for events, shortcuts, commands, and so on. They 'wrap' the underlying event payloads with additional middleware-relevant bits like a next() method, a context object for devs to augment, and so on.

Many of these types, for example the SlackEventMiddlewareArgs type, previously used a conditional to sometimes define particular additional helper utilities on the middleware arguments. For example, the say utility, or tacking on a convenience message property for message-event-related payloads. This was problematic in practice in TypeScript situations, not just internally (this change fixes #2135) within the bolt codebase but for developers as well: when the payload was not of a type that required the extra utility, these properties would be required to exist on the middleware arguments but have a value of undefined. Those of us trying to build generic middleware utilities would have to deal with TS compilation errors and needing to liberally type-cast to avoid these conditional mismatches with undefined.

Instead, these MiddlewareArgs types now conditionally create a type intersection when appropriate in order to provide this conditional-utility-extension mechanism. In practice that looks something like:

type SomeMiddlewareArgs<EventType extends string = string> = {
  // some type in here
} & (EventType extends 'message'
  // If this is a message event, add a `message` property
  ? { message: EventFromType<EventType> }
  : unknown
)

With the above, now when a message payload is wrapped up into middleware arguments, it will contain an appropriate message property, whereas a non-message payload will be intersected with unknown - effectively a type "noop." No more e.g. say: undefined or message: undefined to deal with!

Other Breaking Changes

  • drops node v14 and v16 (are now EOL'ed)
  • express to v4->v5; ExpressReceiver users will be exposed to express v4 -> v5 breaking changes
  • upgrades to @slack/socket-mode v2; SocketModeReceiver users who have attached custom event listeners to the public socketModeClient directly should read the v1 -> v2 migration guide in case the major upgrade could affect them
  • upgrades @slack/web-api v7; all users should read the web-api v6->v7 migration guide to see what the scope of breaking changes the client within listeners is affected by
  • removed exported type: KnownKeys
  • @slack/types now exist under a named export types.
  • removed the SocketModeFunctions class that had a single static method on it and instead directly exposed the defaultProcessEventErrorHandler method from it.
  • the built-in middleware functions ignoreSelf and directMention now no longer must be invoked as a method in order to return middleware; instead they are middleware to be used directly. this lines up the API for these built-in middlewares to match the other builtins.
  • AWSReceiver's AwsEvent interface now models event payloads a bit differently; we now properly model AWS API Gateway v1 and v2 payloads separately.
  • remove deprecated methods/modules/properties:
    • OptionsRequest interface
    • authed_users and authed_teams from event payload envelope
    • render-html-for-install-path module
    • verify and VerifyOptions from the verify-request module
    • src/receivers/http-utils.ts module

Non-breaking Changes

  • expose the bundled @slack/web-api dependency under the webApi named export
  • dependency updates:
    • upgrades raw-body to v3
    • upgrades @slack/oauth to v3
    • removes promise.allsettled since that is natively supported in node since v14
    • moves @types/tsscmp to dev dependencies since that is not exposed to developers

@slack/bolt@3.22.0

27 Sep 23:20
d79969a
Compare
Choose a tag to compare

What's new

This release adds support for the assistant.threads.* API methods introduced in @slack/web-api@6.13.0 🤖 as well as improvements to documentation at the new https://tools.slack.dev/bolt-js site and patches to dependencies 🔒

Example usage

More details about these endpoints can be discovered in the documentation, and listeners can be added to code to respond to incoming events like so:

app.event('assistant_thread_started', async ({ client, event, logger }) => {
  logger.info('A new thread started');
  logger.debug(event);
  const now = new Date();
  const title = await client.assistant.threads.setTitle({
    title: `Chats from ${now.toISOString()}`,
    channel_id: event.assistant_thread.channel_id,
    thread_ts: event.assistant_thread.thread_ts,
  });
  logger.debug(title);
  const suggestions = await client.assistant.threads.setSuggestedPrompts({
    channel_id: event.assistant_thread.channel_id,
    thread_ts: event.assistant_thread.thread_ts,
    title: 'Ask the computer for answers',
    prompts: [
      {
        title: 'Find the time',
        message: `What happens at ${Math.floor(now.getTime() / 1000)}`,
      },
    ],
  });
  logger.debug(suggestions);
});

app.event('assistant_thread_context_changed', async ({ client, event, logger }) => {
  logger.info('The channel of focus changed');
  logger.debug(event);
  const response = client.chat.postMessage({
    thread_ts: event.assistant_thread.thread_ts,
    channel: event.assistant_thread.channel_id,
    text: `Now visiting <#${event.assistant_thread.context.channel_id}>`,
  });
  logger.debug(response);
});

app.message(async ({ client, message, logger }) => {
  logger.info('A new message was received');
  logger.debug(message);
  if (message.subtype === 'message_changed' || message.subtype === 'message_deleted') {
    return;
  }
  const status = await client.assistant.threads.setStatus({
    channel_id: message.channel,
    thread_ts: message.thread_ts,
    status: 'is thinking...',
  });
  logger.debug(status);
  /**
    * Actual response generation could happen here!
    */
  setTimeout(async () => {
    const response = await client.chat.postMessage({
      channel: message.channel,
      thread_ts: message.thread_ts,
      text: 'How insightful!',
    });
    logger.debug(response);
  }, 3000);
});

Changes

📚 Documentation

📦 Dependencies

  • chore(deps-dev): bump @types/node from 22.5.4 to 22.5.5 - Thanks @dependabot! #2263
  • Upgrade express version - Thanks @helzahalim! #2270
  • chore(deps): bump @slack/web-api from 6.12.1 to 6.13.0 - Thanks @zimeg! #2273

🎉 New contributors

Full Changelog: https://github.com/slackapi/bolt-js/compare/@slack/bolt@3.21.4...@slack/bolt@3.22.0

@slack/bolt@3.21.4

11 Sep 22:28
87d75c5
Compare
Choose a tag to compare

What's Changed

  • chore(deps): upgrade path-to-regexp to partially address a security vulnerability (#2242) by @filmaj in #2251

Full Changelog: https://github.com/slackapi/bolt-js/compare/@slack/bolt@3.21.3...@slack/bolt@3.21.4

@slack/bolt@3.21.3

11 Sep 12:57
15107f8
Compare
Choose a tag to compare

What's Changed

Woops! We (coughfilmajcough) removed the EnvelopedEvent export in a recent change. We are adding it back in in this patch release. Please accept our sincere apologies for this temporary breaking change in bolt 3.21.2.

Changelog

New Contributors

Full Changelog: https://github.com/slackapi/bolt-js/compare/@slack/bolt@3.21.2...@slack/bolt@3.21.3

@slack/bolt@3.21.2

06 Sep 12:07
de08aaa
Compare
Choose a tag to compare

What's Changed

The main change in this patch release is creating an npm release for the change in #2223, where exported event payload types were moved from bolt-js to @slack/types. If you see errors compiling your TypeScript-based application that look like:

Module './types' has already exported a member

.. then upgrading to this release should address the issue (see #2233 and #2234 for issue details).

  • fix: pass a no-op next function to the last listener middleware by @filmaj in #2214 (fixes #1457)
  • fix: remove please-upgrade-node by @filmaj in #2221 (fixes #1274)
  • Bump @slack/types and consume event payloads from it by @filmaj in #2223
  • fix: tsconfig - skip checking dependency d.ts files by @filmaj in #2226

Full Changelog: https://github.com/slackapi/bolt-js/compare/@slack/bolt@3.21.1...@slack/bolt@3.21.2

@slack/bolt@3.21.1

16 Aug 02:23
23f16ce
Compare
Choose a tag to compare

What's Changed

This patch release brings improvements to documentation and sureness in our CI, as well as security updates to certain @slack packages - see CVE-2024-39338 and axios@1.7.4 for more details!

Changes

📚 Documentation

🔒 Security

🧰 Maintenance

  • ci: add bolt-ts-custom-function-template to list of test samples - Thanks @filmaj! #2205

Full Changelog: https://github.com/slackapi/bolt-js/compare/@slack/bolt@3.21.0...@slack/bolt@3.21.1

@slack/bolt@3.21.0

14 Aug 18:41
2384c41
Compare
Choose a tag to compare

What's Changed

Bolt-JS now supports Custom Steps! That's right, your trusty Bolt app now let's you expose Custom Steps in Bolt, allowing you to provide steps for use in Workflow Builder.

You can now use the new function() method to register handlers for the function_executed event. Check out our API docs on the topic to get started.

Changelog

New Contributors

Full Changelog: https://github.com/slackapi/bolt-js/compare/@slack/bolt@3.20.0...@slack/bolt@3.21.0

@slack/bolt@3.20.0

12 Aug 17:31
a717253
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: https://github.com/slackapi/bolt-js/compare/@slack/bolt@3.19.0...@slack/bolt@3.20.0

@slack/bolt@3.19.0

19 Jun 23:12
16fe244
Compare
Choose a tag to compare

What's Changed

More customizations for the AwsLambdaReceiver have landed as well as a few touchups to typings and documented details!

With this release, the signature verification for AwsLambdaReceiver can now be turned off if that's something you're interested in! Perhaps you have your own stylish way of verifying these signatures. The following can be added to your receiver to unlock this:

const { App, AwsLambdaReceiver } = require('@slack/bolt');

const app = new App({
  ...
  receiver: new AwsLambdaReceiver({
    signatureVerification: false,
  }),
});

Read on and browse around for more details on all of the changes included!

🎁 Enhancements

  • Add flag to AwsLambdaReceiver to enable/disable signature verification in #2107 - thanks @noah-guillory!

🐛 Fixes

  • Add a type predicate for CodedError in #2110 - thanks @filmaj!
  • ButtonAction value field not required in #2134 - thanks @srajiang!
  • fix(types): return void promises from the express receiver middleware parser in #2141 - thanks @zimeg!

📚 Documentation

  • docs: fixed duplicative header links in reference in #2120 - thanks @lukegalbraithrussell!
  • docs: deprecate Steps from Apps docs in #2130 - thanks @filmaj!
  • docs: add JSDoc to and list out all available builtin middleware functions in the docs in #2136 - thanks @filmaj!

🧰 Maintenance

  • ci(test): perform unit testing against node version 22 in #2140 - thanks @zimeg!
  • chore(release): tag version @slack/bolt@3.19.0 in #2142 - thanks @zimeg!

📦 Dependencies

New Contributors

Full Changelog: https://github.com/slackapi/bolt-js/compare/@slack/bolt@3.18.0...@slack/bolt@3.19.0

@slack/bolt@3.18.0

25 Apr 17:07
65413b9
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: https://github.com/slackapi/bolt-js/compare/@slack/bolt@3.17.1...@slack/bolt@3.18.0

0