Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): update dependency @slack/bolt to v4 #97

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Oct 23, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@slack/bolt (source) ^3.21.1 -> ^4.0.0 age adoption passing confidence

Release Notes

slackapi/bolt-js (@​slack/bolt)

v4.2.0

Compare Source

What's Changed

Hello! 👋 This release updates dependencies to keep packages secure and makes the logger of your app public for use outside of event listeners when using TypeScript! 🔐 🌲

const app = new App({ ... });

(async () => {
  await app.start(process.env.PORT || 3000);
  app.logger.info('⚡️ Bolt app is running!'); // The app logger can now be used here!
})();
🎁 Enhancements
🔐 Security
📚 Documentation
🧰 Maintenance
🤖 Dependencies

Full Changelog: https://github.com/slackapi/bolt-js/compare/[@​slack/bolt](https://redirect.github.com/slack/bolt)[@​4](https://redirect.github.com/4).1.1...[@​slack/bolt](https://redirect.github.com/slack/bolt)[@​4](https://redirect.github.com/4).2.0

v4.1.1

Compare Source

What's Changed

Changelog

New Contributors

Full Changelog: https://github.com/slackapi/bolt-js/compare/[@​slack/bolt](https://redirect.github.com/slack/bolt)[@​4](https://redirect.github.com/4).1.0...[@​slack/bolt](https://redirect.github.com/slack/bolt)[@​4](https://redirect.github.com/4).1.1

v4.1.0

Compare Source

What's Changed

Full Changelog: https://github.com/slackapi/bolt-js/compare/[@​slack/bolt](https://redirect.github.com/slack/bolt)[@​4](https://redirect.github.com/4).0.1...[@​slack/bolt](https://redirect.github.com/slack/bolt)[@​4](https://redirect.github.com/4).1.0

v4.0.1

Compare Source

What's Changed

Full Changelog: https://github.com/slackapi/bolt-js/compare/[@​slack/bolt](https://redirect.github.com/slack/bolt)[@​4](https://redirect.github.com/4).0.0...[@​slack/bolt](https://redirect.github.com/slack/bolt)[@​4](https://redirect.github.com/4).0.1

v4.0.0

Compare Source

Bolt v4

What's Changed

New Features

Support for Agents & Assistants is now available!

Bolt now offers a simple and intuitive way to create an Agent/Assistant using the new Assistant class. Simply include the required callbacks and add the assistant to your App instance. Get up and running even quicker with a working, out-of-the-box example that utilizes OpenAI here.

Breaking Changes

We have prepared a migration guide to help BoltJS consumers migrate their Bolt v3 apps to v4.

While a few breaking changes were introduced, we don't expect a majority of bolt v3 users to require changing their apps to upgrade to v4. More complex apps may need a few tweaks. TL;DR is: if your bolt v3 app is built with TypeScript, or uses the ExpressReceiver or the AwsLambdaReceiver, or your app used previously-deprecated types or functions, best to read the migration guide.

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 https://github.com/slackapi/bolt-js/issues/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 - fixes #​2242
  • 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 - fixes #​2225
  • 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 - fixes #​2272
  • 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
  • fixed an issue in AwsLambdaReceiver where apps with no registered handlers that processed an incoming event would still log out an error related to not acknowledging the request in time - fixes #​2284
  • 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

Changelog

Full Changelog: https://github.com/slackapi/bolt-js/compare/[@&#8203;slack/bolt](https://redirect.github.com/slack/bolt)[@&#8203;3](https://redirect.github.com/3).22.0...[@&#8203;slack/bolt](https://redirect.github.com/slack/bolt)[@&#8203;4](https://redirect.github.com/4).0.0

v3.22.0

Compare Source

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

🎉 New contributors

Full Changelog: https://github.com/slackapi/bolt-js/compare/[@&#8203;slack/bolt](https://redirect.github.com/slack/bolt)[@&#8203;3](https://redirect.github.com/3).21.4...[@&#8203;slack/bolt](https://redirect.github.com/slack/bolt)[@&#8203;3](https://redirect.github.com/3).22.0

v3.21.4

Compare Source

What's Changed

Full Changelog: https://github.com/slackapi/bolt-js/compare/[@&#8203;slack/bolt](https://redirect.github.com/slack/bolt)[@&#8203;3](https://redirect.github.com/3).21.3...[@&#8203;slack/bolt](https://redirect.github.com/slack/bolt)[@&#8203;3](https://redirect.github.com/3).21.4

v3.21.3

Compare Source

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/[@&#8203;slack/bolt](https://redirect.github.com/slack/bolt)[@&#8203;3](https://redirect.github.com/3).21.2...[@&#8203;slack/bolt](https://redirect.github.com/slack/bolt)[@&#8203;3](https://redirect.github.com/3).21.3

v3.21.2

Compare Source

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).

Full Changelog: https://github.com/slackapi/bolt-js/compare/[@&#8203;slack/bolt](https://redirect.github.com/slack/bolt)[@&#8203;3](https://redirect.github.com/3).21.1...[@&#8203;slack/bolt](https://redirect.github.com/slack/bolt)[@&#8203;3](https://redirect.github.com/3).21.2


Configuration

📅 Schedule: Branch creation - "before 07:00 on Thursday" in timezone Europe/Oslo, Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

Copy link
Contributor Author

renovate bot commented Oct 23, 2024

⚠️ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: yarn.lock
➤ YN0000: · Yarn 4.3.1
➤ YN0000: ┌ Resolution step
➤ YN0085: │ + @slack/bolt@npm:4.0.1, @slack/socket-mode@npm:2.0.2, @slack/types@npm:2.14.0, @slack/web-api@npm:7.7.0, @types/ws@npm:8.5.12, accepts@npm:2.0.0, and 26 more.
➤ YN0085: │ - @slack/bolt@npm:3.21.1, @slack/oauth@npm:2.6.3, @slack/socket-mode@npm:1.3.6, @types/jsonwebtoken@npm:8.5.9, @types/promise.allsettled@npm:1.0.6, and 15 more.
➤ YN0000: └ Completed in 3s 364ms
➤ YN0000: ┌ Post-resolution validation
➤ YN0060: │ zod is listed by your project with version 3.23.8 (p2b8e9), which doesn't satisfy what @instructor-ai/instructor and other dependencies request (but they have non-overlapping ranges!).
➤ YN0060: │ zod is listed by your project with version 3.23.8 (p8c1b0), which doesn't satisfy what @instructor-ai/instructor and other dependencies request (but they have non-overlapping ranges!).
➤ YN0060: │ zod is listed by your project with version 3.23.8 (pd5e02), which doesn't satisfy what @instructor-ai/instructor and other dependencies request (but they have non-overlapping ranges!).
➤ YN0086: │ Some peer dependencies are incorrectly met by your project; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code.
➤ YN0086: │ Some peer dependencies are incorrectly met by dependencies; run yarn explain peer-requirements for details.
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: │ /tmp/xfs-d50ed58d STDOUT Packing @bdb-dd/mack@https://github.com/bdb-dd/mack.git#commit=14338e54e63d85151e9065d28b25caa778b9a73a from sources
➤ YN0000: │ /tmp/xfs-d50ed58d STDOUT Using Yarn Classic for bootstrap. Reason: "__metadata" key not found in yarn.lock, must be a Yarn classic lockfile
➤ YN0000: │ /tmp/xfs-d50ed58d STDOUT 
➤ YN0000: │ /tmp/xfs-d50ed58d STDOUT ➤ YN0000: Downloading https://classic.yarnpkg.com/latest.js
➤ YN0000: │ /tmp/xfs-d50ed58d STDOUT ➤ YN0000: Saving the new release in .yarn/releases/yarn-classic.cjs
➤ YN0000: │ /tmp/xfs-d50ed58d STDOUT ➤ YN0000: Done in 1s 234ms
➤ YN0000: │ /tmp/xfs-d50ed58d STDOUT 
➤ YN0000: │ /tmp/xfs-d50ed58d STDERR ! The local project doesn't define a 'packageManager' field. Corepack will now add one referencing yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e.
➤ YN0000: │ /tmp/xfs-d50ed58d STDERR ! For more details about this field, consult the documentation at https://nodejs.org/api/packages.html#packagemanager
➤ YN0000: │ /tmp/xfs-d50ed58d STDERR 
➤ YN0000: │ /tmp/xfs-d50ed58d STDOUT yarn install v1.22.22
➤ YN0000: │ /tmp/xfs-d50ed58d STDOUT [1/4] Resolving packages...
➤ YN0000: │ /tmp/xfs-d50ed58d STDOUT [2/4] Fetching packages...
➤ YN0000: │ /tmp/xfs-d50ed58d STDOUT [3/4] Linking dependencies...
➤ YN0000: │ /tmp/xfs-d50ed58d STDOUT [4/4] Building fresh packages...
➤ YN0000: │ /tmp/xfs-d50ed58d STDOUT $ yarn run compile
➤ YN0000: │ /tmp/xfs-d50ed58d STDOUT yarn run v1.22.22
➤ YN0000: │ /tmp/xfs-d50ed58d STDOUT $ tsc
➤ YN0000: │ /tmp/xfs-d50ed58d STDOUT Done in 4.58s.
➤ YN0000: │ /tmp/xfs-d50ed58d STDOUT Done in 17.46s.
➤ YN0000: │ /tmp/xfs-d50ed58d STDOUT 
➤ YN0000: │ /tmp/xfs-d50ed58d STDOUT yarn pack v1.22.22
➤ YN0000: │ /tmp/xfs-d50ed58d STDOUT success Wrote tarball to "/tmp/xfs-d50ed58d/package.tgz".
➤ YN0000: │ /tmp/xfs-d50ed58d STDOUT Done in 0.14s.
➤ YN0000: │ /tmp/xfs-c02b168a STDOUT Packing @bdb-dd/mack@https://github.com/bdb-dd/mack.git#commit=14338e54e63d85151e9065d28b25caa778b9a73a from sources
➤ YN0000: │ /tmp/xfs-c02b168a STDOUT Using Yarn Classic for bootstrap. Reason: "__metadata" key not found in yarn.lock, must be a Yarn classic lockfile
➤ YN0000: │ /tmp/xfs-c02b168a STDOUT 
➤ YN0000: │ /tmp/xfs-c02b168a STDOUT ➤ YN0000: Downloading https://classic.yarnpkg.com/latest.js
➤ YN0000: │ /tmp/xfs-c02b168a STDOUT ➤ YN0000: Saving the new release in .yarn/releases/yarn-classic.cjs
➤ YN0000: │ /tmp/xfs-c02b168a STDOUT ➤ YN0000: Done in 0s 778ms
➤ YN0000: │ /tmp/xfs-c02b168a STDOUT 
➤ YN0000: │ /tmp/xfs-c02b168a STDERR ! The local project doesn't define a 'packageManager' field. Corepack will now add one referencing yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e.
➤ YN0000: │ /tmp/xfs-c02b168a STDERR ! For more details about this field, consult the documentation at https://nodejs.org/api/packages.html#packagemanager
➤ YN0000: │ /tmp/xfs-c02b168a STDERR 
➤ YN0000: │ /tmp/xfs-c02b168a STDOUT yarn install v1.22.22
➤ YN0000: │ /tmp/xfs-c02b168a STDOUT [1/4] Resolving packages...
➤ YN0000: │ /tmp/xfs-c02b168a STDOUT [2/4] Fetching packages...
➤ YN0000: │ /tmp/xfs-c02b168a STDOUT [3/4] Linking dependencies...
➤ YN0000: │ /tmp/xfs-c02b168a STDOUT [4/4] Building fresh packages...
➤ YN0000: │ /tmp/xfs-c02b168a STDOUT $ yarn run compile
➤ YN0000: │ /tmp/xfs-c02b168a STDOUT yarn run v1.22.22
➤ YN0000: │ /tmp/xfs-c02b168a STDOUT $ tsc
➤ YN0000: │ /tmp/xfs-c02b168a STDOUT Done in 5.03s.
➤ YN0000: │ /tmp/xfs-c02b168a STDOUT Done in 21.83s.
➤ YN0000: │ /tmp/xfs-c02b168a STDOUT 
➤ YN0000: │ /tmp/xfs-c02b168a STDOUT yarn pack v1.22.22
➤ YN0000: │ /tmp/xfs-c02b168a STDOUT success Wrote tarball to "/tmp/xfs-c02b168a/package.tgz".
➤ YN0000: │ /tmp/xfs-c02b168a STDOUT Done in 0.17s.
➤ YN0018: │ @bdb-dd/mack@https://github.com/bdb-dd/mack.git#commit=14338e54e63d85151e9065d28b25caa778b9a73a: The remote archive doesn't match the expected checksum
➤ YN0000: └ Completed in 53s 841ms
➤ YN0000: · Failed with errors in 57s 275ms

@renovate renovate bot changed the title Update dependency @slack/bolt to v4 fix(deps): update dependency @slack/bolt to v4 Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants